@sledge-app/js 0.0.14 → 0.0.15

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 e,j as t,$ as i,a as s,b as l,c as n,d,e as r,f as a,g as o,h as c,i as u,k as g,l as h,m as p,n as m,o as _,p as v,q as w,r as x,s as f,t as j,u as C,v as y,w as S,x as N,y as L,z as A,A as T,B as E,C as b,D as R,E as I,F as O,G as P,H as k,I as D,J as M,K as W,L as B,M as H,N as U,O as F,P as G,Q as $,S as V,T as q,U as z,V as J,W as Z,X as K,Y,Z as X,_ as Q,a0 as ee,a1 as te,a2 as ie,a3 as se,a4 as le,a5 as ne,a6 as de,a7 as re,a8 as ae,a9 as oe,aa as ce,ab as ue,ac as ge,ad as he,ae as pe,af as me,ag as _e,ah as ve}from"./assets/vendor-f2befdd9.js";const we="",xe=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},fe=e=>{document.addEventListener("DOMContentLoaded",e)},je=(e,t)=>{let i=!1;document.body.addEventListener("DOMNodeInserted",(()=>{!i&&e&&(i=!0,t())}))},Ce=(e,t,i)=>{if(e&&i.includes(e)&&t&&i.includes(t)){let s=i.indexOf(e)+e.length;return i.substring(s,i.indexOf(t,s))}return i},ye=e=>"function"==typeof e,Se="https://sledge-api-preprod.offstack.io",Ne="https://instant-search-engine.offstack.io",Le="sledge-embed-script",Ae="data-component",Te={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_COMPONENT:"data-render-component"},WISHLIST:{SHARE_ID:"data-share-id"},PRODUCT_REVIEW:{RATING_SIZE:"data-rating-size"},INSTANT_SEARCH:{QUERY_KEYWORD:"data-query-keyword"}},Ee={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"},be={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"}},Re={GLOBAL:{ELEMENT_PRODUCT_CARDS:`[${Ae}="product-cards"]`,ELEMENT_SUGGESTION_KEYWORD_LISTS:`[${Ae}="suggestion-keyword-lists"]`,ELEMENT_OTHER_INDEX_LISTS:`[${Ae}="other-index-lists"]`,ELEMENT_SEARCH_VIEW_MORE_RESULT:`[${Ae}="search-view-more-result"]`},WISHLIST:{ELEMENT_BADGE:`[${Ae}="wishlist-badge"]`,ELEMENT_BADGE_MENU_ITEM:'[href="#sledge-wishlist-badge-menu-item"]',ELEMENT_TRIGGER:`[${Ae}="wishlist-trigger"]`,ELEMENT_WIDGET:`[${Ae}="wishlist-widget"]`,ELEMENT_BUTTON_DETAIL:`[${Ae}="wishlist-button-detail"]`},PRODUCT_REVIEW:{ELEMENT_WIDGET:`[${Ae}="product-review-widget"]`,ELEMENT_RATING:`[${Ae}="product-review-rating"]`},INSTANT_SEARCH:{ELEMENT_SEARCH_WIDGET:`[${Ae}="instant-search-widget"]`,ELEMENT_SEARCH_ICON_WIDGET:`[${Ae}="instant-search-icon-widget"]`,ELEMENT_SEARCH_RESULT_WIDGET:`[${Ae}="instant-search-result-widget"]`,ELEMENT_PLP_WIDGET:`[${Ae}="instant-search-product-filter-widget"]`}},Ie=[10,25,50,100],Oe="/pages/search-result",Pe={STORE:{NAME:"{{ shop.name }}"}},ke={PRODUCT:{CARDS:"ProductCards"},SUGGESTION_KEYWORD_LISTS:"SuggestionKeywordLists",OTHER_INDEX_LISTS:"OtherIndexLists",SEARCH_VIEW_MORE_RESULT:"SearchViewMoreResult"},De="gid://shopify/",Me=`${De}Product/`,We=`${De}ProductVariant/`,Be=async e=>{let t=localStorage.getItem(Ee.AUTH_APP);var i=new Headers;i.append("Authorization",`Bearer ${t}`);var s={method:"GET",headers:i,redirect:"follow"};return await fetch(`${Se}/app/${e}/setting`,s).then((e=>e.json())).then((e=>e)).catch((()=>{}))},He=async e=>{const{API_KEY:t,INSTANT_SEARCH_API_KEY:i,USER_ID:s,USER_EMAIL:l,USER_FULLNAME:n}=e;var d=new Headers;d.append("Authorization",`Bearer ${t||""}`),d.append("Content-Type","application/json");var r={method:"POST",headers:d,body:JSON.stringify({user:{id:s||"",email:l||"",name:n||"",anonym:localStorage.getItem(Ee.ANONYM_ID)||""}}),redirect:"follow"};return await fetch(`${Se}/app/token`,r).then((e=>e.json())).then((async e=>{const{data:t}=e||{},{anonym:s,token:l}=t||{};return localStorage.setItem(Ee.ANONYM_ID,s||""),localStorage.setItem(Ee.AUTH_APP,l||""),localStorage.setItem(Ee.INSTANT_SEARCH_AUTH_APP,i||""),e})).catch((e=>e))},Ue="",Fe="",Ge=()=>{const[c,u]=e.useState(""),[g,h]=e.useState(""),[p,m]=e.useState(""),[_,v]=e.useState(""),[w,x]=e.useState(""),[f,j]=e.useState(!1),[C,y]=e.useState({onSubmit:()=>{}});return e.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeConfirmationPopup=({title:e,message:t,textSubmit:i,textCancel:s,buttonSubmitType:l,onSubmit:n})=>{j(!0),u(e),h(t),m(i),v(s),x(l),y({onSubmit:n})})}),[]),t.jsx(i,{open:f,onOpenChange:j,children:t.jsxs(s,{children:[t.jsx(l,{className:"sledge__alert-dialog-overlay AlertDialogOverlay"}),t.jsxs(n,{className:"sledge__alert-dialog-content AlertDialogContent",children:[t.jsx(d,{className:"AlertDialogTitle",dangerouslySetInnerHTML:{__html:c}}),t.jsx(r,{className:"AlertDialogDescription",dangerouslySetInnerHTML:{__html:g}}),t.jsxs("div",{className:"AlertDialogFooter",children:[t.jsx(a,{asChild:!0,children:t.jsx("button",{className:"sledge__alert-dialog-button sledge__alert-dialog-button-cancel",onClick:()=>j(!1),children:_})}),t.jsx(o,{asChild:!0,children:t.jsx("button",{className:`sledge__alert-dialog-button ${w}`,onClick:()=>{C.onSubmit(),j(!1)},children:p})})]})]})]})})},$e=()=>{let i=document.querySelector(`[${Ae}="${be.ELEMENT_CONFIRMATION_POPUP}"]`);i||(i=document.createElement("div"),i.setAttribute(Ae,be.ELEMENT_CONFIRMATION_POPUP),document.body.appendChild(i)),i&&(i.innerHTML="",c.createRoot(i).render(t.jsx(e.StrictMode,{children:t.jsx(Ge,{})})))},Ve="",qe=()=>{const[i,s]=e.useState(""),[l,n]=e.useState(""),[d,r]=e.useState(""),[a,o]=e.useState(!1);return e.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeInfoPopup=({title:e,message:t,textCancel:i})=>{o(!0),s(e),n(t),r(i)})}),[]),t.jsx(u,{open:a,onOpenChange:o,children:t.jsxs(g,{children:[t.jsx(h,{className:"sledge__dialog-overlay DialogOverlay"}),t.jsxs(p,{className:"sledge__dialog-content DialogContent",children:[t.jsx(m,{className:"DialogTitle",dangerouslySetInnerHTML:{__html:i}}),t.jsx(_,{className:"DialogDescription",dangerouslySetInnerHTML:{__html:l}}),t.jsx("div",{className:"DialogCloseButton",children:t.jsx("button",{className:"sledge__dialog-button sledge__dialog-button-cancel",onClick:()=>o(!1),children:d})}),t.jsx("button",{className:"IconButton","aria-label":"Close",onClick:()=>o(!1),children:t.jsx("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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"})})})]})]})})},ze=()=>{let i=document.querySelector(`[${Ae}="${be.ELEMENT_INFO_POPUP}"]`);i||(i=document.createElement("div"),i.setAttribute(Ae,be.ELEMENT_INFO_POPUP),document.body.appendChild(i)),i&&(i.innerHTML="",c.createRoot(i).render(t.jsx(e.StrictMode,{children:t.jsx(qe,{})})))},Je="",Ze=()=>{const[i,s]=e.useState(!1),[l,n]=e.useState(""),[d,r]=e.useState(""),[a,o]=e.useState(""),[c,u]=e.useState(null),[g,h]=e.useState(""),p=e.useRef(0);return e.useEffect((()=>("undefined"!=typeof window&&(window.sledgeToastNotification=({title:e,message:t,location:i="bottom-right",icon:l=null,type:d})=>{n(e),r(t),o(i),u(l),h(d),s(!1),window.clearTimeout(p.current),p.current=window.setTimeout((()=>{s(!0)}),10)}),()=>clearTimeout(p.current))),[]),t.jsxs(v,{children:[t.jsxs(w,{className:"sledge__ToastRoot",open:i,onOpenChange:s,children:[t.jsxs("div",{className:"sledge__toast-icon-wrapper",children:[c,t.jsx("div",{className:"sledge__toast-type","data-notification-type":g,children:"success"===g?t.jsx(ft,{width:15,height:15,color:"white"}):t.jsx(jt,{width:15,height:15,color:"white"})})]}),t.jsxs("div",{className:"sledge__toast-message-wrapper",children:[t.jsx(x,{className:"sledge__ToastTitle",children:l}),t.jsx(f,{asChild:!0,children:t.jsx("p",{className:"sledge__ToastDescription",children:d})})]}),t.jsx("div",{className:"sledge__toast-action-wrapper",children:t.jsx(j,{className:"sledge__ToastAction",asChild:!0,altText:"Close notification",children:t.jsx(Lt,{colorType:"outlined-danger",children:"Dismiss"})})})]}),t.jsx(C,{className:"sledge__ToastViewport","data-location":a})]})},Ke=()=>{let i=document.querySelector(`[${Ae}="${be.ELEMENT_TOAST_NOTIFICATION}"]`);i||(i=document.createElement("div"),i.setAttribute(Ae,be.ELEMENT_TOAST_NOTIFICATION),document.body.appendChild(i)),i&&(i.innerHTML="",c.createRoot(i).render(t.jsx(e.StrictMode,{children:t.jsx(Ze,{})})))},Ye="",Xe=({trigger:i,content:s,isOpen:l,setIsOpen:n,hideCloseIcon:d,align:r,className:a,withOpenState:o=!0,withArrow:c=!0,customArrow:u="",sideOffset:g=5,alignOffset:h=0})=>{const[p,m]=e.useState(!!o&&l);return e.useEffect((()=>{var e;let t=null==(e=null==document?void 0:document.querySelector(".PopoverArrow"))?void 0:e.parentElement;t&&(null==u?void 0:u.length)&&(t.style.display="inline-flex",t.innerHTML=u)}),[p]),t.jsxs(y,{...o&&{open:l},...n&&{onOpenChange:e=>{m(e),n(e)}},children:[t.jsx(S,{asChild:!0,children:i}),t.jsx(N,{children:t.jsxs(L,{className:`sledge__popover-content ${a||""}`,sideOffset:g,alignOffset:h,align:r,...n&&{onOpenAutoFocus:()=>n(!0),onCloseAutoFocus:()=>n(!1)},children:[s,!d&&t.jsx(A,{className:"PopoverClose","aria-label":"Close",children:t.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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"})})}),c?t.jsx(T,{className:"PopoverArrow"}):null]})})]})},Qe="",et=({value:i,total:s,fillColor:l="",outlineColor:n=""})=>{const[d,r]=e.useState(0);return e.useEffect((()=>{const e=setTimeout((()=>r(+i/s*100)),150);return()=>clearTimeout(e)}),[]),t.jsx(E,{className:"sledge__progress",value:d,style:n?{borderWidth:"1px",borderStyle:"solid",borderColor:n}:{},children:t.jsx(b,{className:"ProgressIndicator",style:{transform:`translateX(-${100-d}%)`,...l&&{backgroundColor:l}}})})},tt="",it=({id:e,name:i,value:s,required:l,label:n,defaultChecked:d,labelStyle:r={},onClick:a})=>t.jsxs("div",{className:"sledge__checkbox-wrapper",children:[t.jsx(R,{className:"sledge__checkbox-root",defaultChecked:d,id:e,name:i,value:s,required:l,onClick:a,children:t.jsx(I,{className:"sledge__checkbox-indicator",children:t.jsx("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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&&t.jsx("label",{className:"sledge__checkbox-label",htmlFor:e,style:r,children:n})]}),st="",lt=i=>{const{defaultValue:s,min:l,max:n,step:d=1,setValueCommit:r,setValueChange:a}=i,[o,c]=e.useState(s);return t.jsx("form",{children:t.jsxs(O,{className:"sledge__SliderRoot",defaultValue:s,min:l,max:n,step:d,"aria-label":"Volume",onValueCommit:e=>{r&&r(e),c(e)},onValueChange:e=>{a&&a(e),c(e)},children:[t.jsx(P,{className:"sledge__SliderTrack",children:t.jsx(k,{className:"sledge__SliderRange"})}),t.jsx(Vs,{content:o[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:t.jsx(D,{className:"sledge__SliderThumb"})}),t.jsx(Vs,{content:o[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:t.jsx(D,{className:"sledge__SliderThumb"})})]})})},nt="",dt=({currentPage:e,totalPage:i,totalResult:s,onChange:l})=>{const n=1===e,d=e===i;return t.jsxs("div",{className:"sledge__pagination",children:[t.jsx("button",{type:"button",className:"sledge__pagination-navigation",...n?{disabled:!0}:{onClick:()=>l(e-1)},children:t.jsx(_t,{width:17,height:17,color:"black"})}),t.jsxs("span",{children:["Page ",e," of ",i," - total ",s," result"]}),t.jsx("button",{type:"button",className:"sledge__pagination-navigation",...d?{disabled:!0}:{onClick:()=>l(e+1)},children:t.jsx(vt,{width:17,height:17,color:"black"})})]})},rt="",at=({id:e,name:i,required:s,defaultValue:l,items:n,labelStyle:d={},onValueChange:r})=>t.jsx("div",{className:"sledge__radio-group-wrapper",children:t.jsx("form",{children:t.jsx(M,{className:"sledge__radio-group-root","aria-label":"View density",defaultValue:l,id:e,name:i,required:s,onValueChange:r,children:n.map(((i,s)=>{const{label:l,value:n}=i;return t.jsxs("div",{className:"sledge__radio-group-item-flex",children:[t.jsx(W,{className:"sledge__radio-group-item",value:n,id:`${e}${s}`,children:t.jsx(B,{className:"sledge__radio-group-indicator"})}),t.jsx("label",{className:"sledge__radio-group-label",htmlFor:`${e}${s}`,style:d,children:l})]},s)}))})})}),ot="",ct=({id:e,name:i,value:s,rgb:l,image:n,required:d,defaultChecked:r,onClick:a})=>{const o={...(null==n?void 0:n.length)?{backgroundImage:`url(${n})`}:{backgroundColor:l}};return t.jsx("div",{className:"sledge__color-swatch-wrapper",children:t.jsx(R,{className:"sledge__color-swatch-root",defaultChecked:r,id:e,name:i,value:s,required:d,onClick:a,style:o})})},ut="",gt=({name:e,placeholder:i,required:s,defaultValue:l,items:n,labelStyle:d={},onValueChange:r})=>t.jsx("div",{className:"sledge__select-wrapper",children:t.jsxs(G,{name:e,required:s,onValueChange:r,children:[t.jsxs($,{className:"sledge__select-trigger",children:[t.jsx(V,{placeholder:i}),t.jsx(q,{className:"sledge__select-icon",children:t.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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"})})})]}),t.jsx(z,{children:t.jsxs(J,{className:"sledge__select-content",children:[t.jsx(Z,{className:"sledge__select-scroll-button",children:t.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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"})})}),t.jsx(K,{className:"sledge__select-viewport",children:n.map(((e,i)=>{const{label:s,value:l}=e;return t.jsx(ht,{value:l,children:s},i)}))}),t.jsx(Y,{className:"sledge__select-scroll-button",children:t.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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"})})})]})})]})}),ht=e.forwardRef((({children:e,className:i="",...s},l)=>t.jsxs(H,{className:`sledge__select-item ${i}`,...s,ref:l,children:[t.jsx(U,{children:e}),t.jsx(F,{className:"sledge__select-item-indicator",children:t.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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"})})})]}))),pt=({width:e,height:i,type:s,color:l})=>t.jsx("span",{className:"sledge-icon__heart",children:"outline"===s?t.jsx("svg",{width:e,height:i,id:"sledge-icon-heart-line",viewBox:"0 0 18 17",fill:l,children:t.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"})}):t.jsx("svg",{width:e,height:i,id:"sledge-icon-heart-fill",viewBox:"0 0 18 17",fill:l,children:t.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"})})}),mt=({width:e,height:i,color:s})=>t.jsx("span",{className:"sledge-icon__arrow-down",children:t.jsx("svg",{width:e,height:i,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("g",{id:"Arrow - Down 2",children:t.jsx("g",{id:"Iconly/Light-Outline/Arrow---Down-2",children:t.jsx("g",{id:"Arrow---Down-2",children:t.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})})})})})}),_t=({width:e,height:i,color:s})=>t.jsx("span",{className:"sledge-icon__arrow-left",children:t.jsx("svg",{width:e,height:i,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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})})}),vt=({width:e,height:i,color:s})=>t.jsx("span",{className:"sledge-icon__arrow-right",children:t.jsx("svg",{width:e,height:i,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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})})}),wt=({width:e,height:i,color:s})=>t.jsx("span",{className:"sledge-icon__arrow-right",children:t.jsx("svg",{width:e,height:i,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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})})}),xt=({width:e,height:i,color:s})=>t.jsx("span",{className:"sledge-icon__bag",children:t.jsx("svg",{width:e,height:i,viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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})})}),ft=({width:e,height:i,color:s})=>t.jsx("span",{className:"sledge-icon__check",children:t.jsx("svg",{width:e,height:i,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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})})}),jt=({width:e,height:i,color:s})=>t.jsx("span",{className:"sledge-icon__close",children:t.jsx("svg",{width:e,height:i,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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})})}),Ct=({width:e,height:i,color:s})=>t.jsx("span",{className:"sledge-icon__star",children:t.jsx("svg",{width:e,height:i,viewBox:"0 0 32 33",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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"})})}),yt=({width:e,height:i,color:s})=>t.jsx("span",{className:"sledge-icon__upload",children:t.jsx("svg",{width:e,height:i,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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})})}),St=({width:e,height:i,color:s})=>t.jsx("span",{className:"sledge-icon__search",children:t.jsx("svg",{width:e,height:i,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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})})}),Nt="",Lt=e.forwardRef(((e,i)=>{const{className:s="",children:l,colorType:n="light",fullWidth:d=!1,elementType:r="button",link:a="",...o}=e;return"hyperlink"===r&&(null==a?void 0:a.length)?t.jsx("a",{href:a,className:`sledge__button ${s||""}`,"data-button-color-type":n,"data-button-full-width":d,ref:i,...o,children:l}):t.jsx("button",{className:`sledge__button ${s||""}`,"data-button-color-type":n,"data-button-full-width":d,ref:i,...o,children:l})})),At="",Tt=i=>{const{className:s="",icon:l,value:n="",withClearField:d,onChange:r,onResetField:a,fieldRef:o,...c}=i,[u,g]=e.useState(!1);return e.useEffect((()=>{g(Boolean(n))}),[n]),t.jsxs("div",{className:`sledge__search-input-field-wrapper ${s||""}`,children:[l?t.jsx("div",{className:"sledge__search-input-field-icon",children:l}):null,t.jsx("input",{className:"sledge__search-input-field",value:n,onChange:e=>(e=>{r&&r({value:e.target.value})})(e),ref:o,...c}),u&&d?t.jsx("div",{className:"sledge__clear-field-wrapper",children:t.jsx("button",{className:"sledge__clear-field",type:"button",onClick:()=>{(null==o?void 0:o.current)&&o.current.focus(),r&&r({value:""}),a&&a()},children:t.jsx("svg",{viewBox:"0 0 20 20",focusable:"false","aria-hidden":"true",width:14,height:14,children:t.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]})},Et="",bt=i=>{var s;const{className:l="",placeholder:n=null,prefixLabel:d=null,prefixSelectedLabel:r="",align:a="end",onChange:o,value:c="",options:u=[]}=i,[g,h]=e.useState(!1),p=(null==(s=null==u?void 0:u.filter((({value:e})=>e===c))[0])?void 0:s.label)||n;return t.jsx("div",{className:`sledge__select-field-wrapper ${l||""}`,children:t.jsx(Xe,{trigger:t.jsxs("button",{type:"button",className:"sledge__button sledge__select-field","data-button-color-type":"light","data-button-full-width":"true",children:[d?t.jsx("span",{className:"sledge__select-field-icon",children:d}):null,t.jsx("span",{children:(null==r?void 0:r.length)?`${r} ${p}`:p})]}),content:t.jsx("ul",{className:"sledge__select-field-option",children:null==u?void 0:u.map(((e,i)=>{const{label:s,value:l}=e;return t.jsx("li",{onClick:()=>((e,t)=>{o&&o({label:e,value:t}),h(!1)})(s,l),...l===c&&{"data-selected":!0},children:s},i)}))}),isOpen:g,setIsOpen:h,hideCloseIcon:!0,align:a,className:"sledge__select-field-option-content",withArrow:!1})})},Rt="",It=async e=>{var t,i=new Headers;i.append("Content-Type","application/json");let s=[];e.map((e=>{const{id:t,quantity:i}=e;s.push({id:t,quantity:i})}));var l={method:"POST",headers:i,body:JSON.stringify({items:s}),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`,l).then((e=>e.json())).then((e=>e)).catch((()=>{}))},Ot="",Pt="",kt=async(e,t)=>{const{page:i,limit:s,sort:l,keyword:n,rating:d}=t||{};let r=xe(e),a=localStorage.getItem(Ee.AUTH_APP),o="?"+new URLSearchParams({page:i||"",limit:s||"",sort:l||"",keyword:n||"",rating:d||""}).toString();var c=new Headers;c.append("Authorization",`Bearer ${a}`);var u={method:"GET",headers:c,redirect:"follow"};return await fetch(`${Se}/review/${r}${o}`,u).then((e=>e.json())).then((e=>e)).catch((()=>{}))},Dt=async e=>{let t=xe(e),i=localStorage.getItem(Ee.AUTH_APP);var s=new Headers;s.append("Authorization",`Bearer ${i}`);var l={method:"GET",headers:s,redirect:"follow"};return await fetch(`${Se}/review/info/${t}`,l).then((e=>e.json())).then((e=>e)).catch((()=>{}))},Mt=async()=>{let e=localStorage.getItem(Ee.AUTH_APP);var t=new Headers;t.append("Authorization",`Bearer ${e}`);var i={method:"GET",headers:t,redirect:"follow"};return await fetch(`${Se}/review/media`,i).then((e=>e.json())).then((e=>e)).catch((()=>{}))},Wt=async e=>{let t=localStorage.getItem(Ee.AUTH_APP);var i=new Headers;i.append("Authorization",`Bearer ${t}`);var s=new FormData;[...e].map((e=>{s.append("files",e,e.name)}));var l={method:"POST",headers:i,body:s,redirect:"follow"};return await fetch(`${Se}/review/media`,l).then((e=>e.json())).then((e=>e)).catch((()=>{}))},Bt=async e=>{let t=localStorage.getItem(Ee.AUTH_APP);var i=new Headers;i.append("Authorization",`Bearer ${t}`);var s={method:"DELETE",headers:i,redirect:"follow"};return await fetch(`${Se}/review/media/${e}`,s).then((e=>e.json())).then((e=>e)).catch((()=>{}))},Ht=async e=>{const{userFirstName:t,userLastName:i,userEmail:s,productId:l,productVariantId:n,rating:d,title:r,review:a,mediaIds:o}=e;let c=localStorage.getItem(Ee.AUTH_APP);var u=new Headers;u.append("Authorization",`Bearer ${c}`),u.append("Content-Type","application/json");var g={method:"POST",headers:u,body:JSON.stringify({user:{name:`${t}${i?` ${i}`:""}`,email:s},product:{id:xe(l),variant_id:xe(n)},review:{rating:d,title:r,review:a,media_ids:o}}),redirect:"follow"};return await fetch(`${Se}/review`,g).then((e=>e.json())).then((e=>e)).catch((()=>{}))},Ut=t=>{const i=e.useRef();return e.useEffect((()=>{i.current=t})),i.current},Ft=i=>{var s;const{value:l,size:n="md",data:d,withSkeletonLoading:r=!0}=i,{productId:a}=d||{},{isRenderApp:o}=e.useContext(Fi),[c,u]=e.useState(!0),[g,h]=e.useState(!0),[p,m]=e.useState({width:0,height:0}),[_,v]=e.useState(0),[w,x]=e.useState("0"),[f,j]=e.useState({}),C=Ut({productId:a}),{fill_color:y,outline_color:S}=(null==(s=null==f?void 0:f.display)?void 0:s.rating)||{},N=async e=>{let t;h(!0);let i=!1;if(t=JSON.parse(e),!t)return;const{status:s,data:n}=t,{code:r}=s;i=200===r||!1,i&&(j(n),await(async()=>{var e;if(l&&!d)x(l),h(!1);else{let t,i,s=!1,l=0;if(t=await Dt(a),!t)return;const{status:n,data:d}=t,{code:r}=n;s=200===r||!1,l=(null==d?void 0:d.review_count)?d.review_count:0,i=(null==(e=null==d?void 0:d.rating)?void 0:e.average)?d.rating.average:0,s&&(v(l),x(i),h(!1),u(!1))}})())};return e.useEffect((()=>{if(!(null==o?void 0:o.productReview))return;m("xs"===n?{width:14.4,height:14.4}:"sm"===n?{width:18,height:18}:{width:28.8,height:28.8}),Boolean(C&&(null==C?void 0:C.productId)!==a)&&u(!0),N(localStorage.getItem(Ee.PRODUCT_REVIEW_SETTING)||"")}),[o,a]),t.jsx("div",{className:"sledge-product-review__rating",children:c&&r?t.jsx(tl.Item,{width:"230px",height:"28px",color:"grey-100",rounded:"md"}):t.jsxs(t.Fragment,{children:[t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",style:{display:"none"},id:"sledge-product-review-rating-icon-svg-store",children:[t.jsx("symbol",{id:"sledge-product-review-icons-rating-icon-fill",viewBox:"0 0 30 29",fill:y||"#23BC45",children:t.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"})}),t.jsx("symbol",{id:"sledge-product-review-icons-rating-icon-line",viewBox:"0 0 30 29",stroke:S||"#8D9196",fill:"none",children:t.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"})}),t.jsx("defs",{children:t.jsxs("g",{id:"sledge-product-review-icons-rating-icon",children:[t.jsx("use",{href:"#sledge-product-review-icons-rating-icon-line",className:"sledge-product-review__rating-icon-line"}),t.jsx("use",{href:"#sledge-product-review-icons-rating-icon-fill",className:"sledge-product-review__rating-icon-fill"})]})})]}),!g&&t.jsxs(t.Fragment,{children:[[1,2,3,4,5].map(((e,i)=>{let s=Math.floor(parseFloat(w)),l=String(w).includes(",")?String(w).split(","):[],n=String(w).includes(".")?String(w).split("."):[],d=l.length||n.length?l[1]||n[1]:0,r="fill-0";return e>s&&s+1===e&&(r=`fill-${d}`),X.createElement("svg",{...p,viewBox:"0 0 30 29","data-product-review-rating-fill":e<=s?"full":r,key:i},t.jsx("use",{href:"#sledge-product-review-icons-rating-icon"}))})),!l&&d?t.jsxs("div",{className:"sledge-product-review__rating-summary-total",children:["(",_,")"]}):t.jsx(t.Fragment,{})]})]})})},Gt=i=>{const s=i.getAttribute(Te.GLOBAL.PRODUCT_ID),l=i.getAttribute(Te.PRODUCT_REVIEW.RATING_SIZE);i.innerHTML="",c.createRoot(i).render(t.jsx(e.StrictMode,{children:t.jsx(Fi.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0}},children:t.jsx(Ft,{data:{productId:s||""},size:l})})}))},$t=()=>{let e=Array.from(document.querySelectorAll(Re.PRODUCT_REVIEW.ELEMENT_RATING));je(e,(()=>{e.length&&e.map((e=>Gt(e)))})),new MutationObserver((function(t){t.forEach((function(t){Array.prototype.slice.call(t.addedNodes).forEach((function(t){1===t.nodeType&&t.querySelector(Re.PRODUCT_REVIEW.ELEMENT_RATING)&&(e=Array.from(t.querySelectorAll(Re.PRODUCT_REVIEW.ELEMENT_RATING)),e.length&&e.map((e=>Gt(e))))}))}))})).observe(document.body,{childList:!0,subtree:!0,attributes:!1,characterData:!1})},Vt="",qt=({isFirstLoading:e,text:i,dataSettings:s,data:l,onAfterAddReview:n})=>{var d,r,a;const{text_color:o,border_color:c,border_radius:u,padding_top:g,padding_bottom:h,padding_left:p,padding_right:m,background_color:_,font_size:v,font_weight:w,text_transform:x}=(null==(r=null==(d=null==s?void 0:s.display)?void 0:d.widget)?void 0:r.button_write_review)||{},{button_write_review:f}=(null==(a=null==s?void 0:s.languages)?void 0:a.widget)||{},j={...o&&{color:o},...c&&{borderColor:c},...u&&{borderRadius:u},...g&&{paddingTop:g},...h&&{paddingBottom:h},...p&&{paddingLeft:p},...m&&{paddingRight:m},..._&&{backgroundColor:_},...v&&{fontSize:v},...w&&{fontWeight:w},...x&&{textTransform:x}};return t.jsx("div",{className:"sledge-product-review__widget-header-item",children:e?t.jsx(tl.Item,{width:"134px",height:"42px",rounded:"lg",color:"grey-100"}):t.jsxs(Lt,{type:"button",colorType:"success",onClick:()=>"undefined"!=typeof window&&window.sledgeProductReviewWidgetFormAdd&&window.sledgeProductReviewWidgetFormAdd(l,n),style:j,children:[t.jsx("svg",{width:16,height:17,viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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"})}),i||(f||"Add review")]})})},zt=({isFirstLoading:i,productReviewSort:s,dataSettings:l,setSelectedSort:n,setIsRefreshWidgetList:d})=>{var r,a;const{default_sort:o,show_sorting_options:c}=(null==(r=null==l?void 0:l.display)?void 0:r.widget)||{},[u,g]=e.useState(o||null),h=u||(null==(a=s[0])?void 0:a.value);return t.jsx(t.Fragment,{children:c?t.jsx("div",{className:"sledge-product-review__widget-header-item",children:i?t.jsx(tl.Item,{width:"134px",height:"42px",rounded:"lg",color:"grey-100"}):t.jsx(bt,{align:"end",prefixLabel:t.jsx("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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:s.map((e=>{const{name:t,value:i}=e;return{label:t,value:i}})),value:h,onChange:({value:e})=>(e=>{g(e),d&&d(!0),n&&n(e)})(e)})}):null})},Jt={open:{rotate:180},closed:{rotate:0},transition:{type:"spring",duration:.2}},Zt={hidden:{opacity:0,scale:0},visible:e=>{const{duration:t}=e||{};return{opacity:1,scale:1,transition:{type:"spring",duration:t||.7}}}},Kt=i=>{var s,l,n;const{data:d,dataSettings:r}=i,{productId:a}=d||{},{fill_color:o,outline_color:c}=(null==(l=null==(s=null==r?void 0:r.display)?void 0:s.widget)?void 0:l.summary_bar)||{},{review_singular:u,review_plural:g}=(null==(n=null==r?void 0:r.languages)?void 0:n.widget)||{},[h,p]=e.useState(!0),[m,_]=e.useState(!0),[v,w]=e.useState(!0),[x,f]=e.useState(!0),[j,C]=e.useState(!1),[y,S]=e.useState(0),[N,L]=e.useState({5:0,4:0,3:0,2:0,1:0}),[A,T]=e.useState("0"),E=Ut({productId:a}),b=async()=>{var e;let t,i,s,l=!1,n=0;if(t=await Dt(a),!t)return;const{status:d,data:r}=t,{code:o}=d;l=200===o||!1,n=(null==r?void 0:r.review_count)?r.review_count:0,i=(null==r?void 0:r.rating)?{5:r.rating[5]||0,4:r.rating[4]||0,3:r.rating[3]||0,2:r.rating[2]||0,1:r.rating[1]||0}:N,s=(null==(e=null==r?void 0:r.rating)?void 0:e.average)?r.rating.average:"0",l&&(S(n),L(i),T(s),w(!1),f(!1),p(!1),j&&_(!1))};return e.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetSummaryUpdate=()=>{f(!0),b()}),Boolean(E&&(null==E?void 0:E.productId)!==a)&&p(!0),b()}),[j,a]),t.jsx("div",{className:"sledge-product-review__widget-summary",children:h?t.jsx(tl.Item,{width:"630px",height:"42px",color:"grey-100",rounded:"md",animationDuration:"5s"}):t.jsx(Xe,{trigger:v?t.jsx(t.Fragment,{}):t.jsxs(Q.div,{initial:!1,animate:j?"open":"closed",className:"sledge-product-review__widget-summary-trigger",children:[t.jsx("div",{className:"sledge-product-review__widget-summary-average",children:A}),t.jsx("div",{className:"sledge-product-review__widget-summary-rating",children:!x&&t.jsx(Ft,{value:String(A),size:"md",withSkeletonLoading:!1})}),t.jsxs("div",{className:"sledge-product-review__widget-summary-total",children:[y," ",y>1?g||"Reviews":u||"Review"]}),t.jsx(Q.div,{variants:Jt,className:"summary-trigger-icon",children:t.jsx("svg",{width:20,height:20,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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?t.jsx("div",{className:"sledge-product-review__widget-summary-dist-progress",children:[5,4,3,2,1].map((e=>t.jsxs("div",{className:"sledge-product-review__widget-summary-dist-progress-item",children:[t.jsx(tl.Item,{width:"108px",height:"22px",color:"grey-100",rounded:"md",animationDuration:"15s"}),t.jsx(tl.Item,{width:"128px",height:"22px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{marginLeft:"13px",marginRight:"12px"}}),t.jsx(tl.Item,{width:"38px",height:"22px",color:"grey-100",rounded:"md",animationDuration:"42s"})]},e)))}):t.jsx("div",{className:"sledge-product-review__widget-summary-dist",children:t.jsx("div",{className:"sledge-product-review__widget-summary-dist-progress",children:[5,4,3,2,1].map(((e,i)=>t.jsxs("div",{className:"sledge-product-review__widget-summary-dist-progress-item",children:[t.jsx(Ft,{value:e,size:"sm",withSkeletonLoading:!1}),t.jsx(et,{value:String(N[e]),total:y,fillColor:o,outlineColor:c}),t.jsxs("small",{children:["(",N[e],")"]})]},i)))})}),setIsOpen:C,hideCloseIcon:!0,align:"end",alignOffset:-170,className:"sledge-product-review__widget-summary-content",withArrow:!1})})},Yt=i=>{const[s,l]=e.useState(!0);return e.useEffect((()=>{l(!1)}),[]),t.jsx(t.Fragment,{children:!s&&t.jsx("div",{className:"sledge-product-review__widget-header",children:e.Children.count(i.children)&&e.Children.map(i.children,(t=>e.cloneElement(t,{...i})))})})};Yt.Sort=zt,Yt.AddTrigger=qt,Yt.Summary=Kt;const Xt=e=>{var i;const{isFirstLoading:s,isLoading:l,productReviewData:n,dataSettings:d,currentPage:r,setCurrentPage:a,totalPage:o,totalData:c,setIsReplaceWidgetList:u}=e||{},{type:g}=(null==(i=null==d?void 0:d.display)?void 0:i.widget)||{},h="list"===g?t.jsx(dt,{currentPage:r||1,totalPage:o||1,totalResult:c||0,onChange:e=>(e=>{a&&a(e),u&&u(!0)})(e)}):null;return t.jsx(t.Fragment,{children:l?t.jsxs(t.Fragment,{children:[t.jsx(tl.ReviewGrid,{count:"grid"===g?8:10,type:g,gridItemHeights:["252px","342px","196px","398px","342px","252px","398px","196px"]}),s?null:h]}):t.jsx("div",{className:"sledge-product-review__widget-review-wrapper","data-layout-type":g,children:(null==n?void 0:n.length)?t.jsxs(t.Fragment,{children:[t.jsx(ei,{...e}),h]}):t.jsx(Qt,{...e})})})},Qt=i=>{var s;const{dataSettings:l}=i||{},{title_no_result:n,text_no_result:d}=(null==(s=null==l?void 0:l.languages)?void 0:s.widget)||{},[r,a]=e.useState(""),[o,c]=e.useState("");return e.useEffect((()=>{a(n||"No reviews for this item yet!"),c(d||'Click "write a review" button to add a review on this product')}),[]),t.jsxs("div",{className:"sledge-product-review__widget-product-empty",children:[t.jsx("div",{className:"sledge-product-review__widget-product-empty-title",dangerouslySetInnerHTML:{__html:r}}),t.jsx("div",{className:"sledge-product-review__widget-product-empty-description",dangerouslySetInnerHTML:{__html:o}})]})},ei=i=>{var s,l,n,d,r,a,o,c;const{productReviewData:u,currentPage:g,setCurrentPage:h,totalPage:p,totalData:m,dataSettings:_,setIsRefreshWidgetList:v,setIsReplaceWidgetList:w}=i||{},{type:x,rating_size:f,show_review_date:j}=(null==(s=null==_?void 0:_.display)?void 0:s.widget)||{},{text_color:C,border_color:y,border_radius:S,padding_top:N,padding_bottom:L,padding_left:A,padding_right:T,background_color:E,font_size:b,font_weight:R,text_transform:I}=(null==(n=null==(l=null==_?void 0:_.display)?void 0:l.widget)?void 0:n.button_load_more)||{},{text_color:O,border_color:P,border_radius:k,padding_top:D,padding_bottom:M,padding_left:W,padding_right:B,background_color:H,font_size:U,font_weight:F,text_transform:G}=(null==(r=null==(d=null==_?void 0:_.display)?void 0:d.widget)?void 0:r.verified)||{},{button_load_more:$,verified:V}=(null==(a=null==_?void 0:_.languages)?void 0:a.widget)||{},{name:q,image:z}=(null==(c=null==(o=null==_?void 0:_.display)?void 0:o.widget)?void 0:c.replier)||{},J={...C&&{color:C},...y&&{borderColor:y},...S&&{borderRadius:S},...N&&{paddingTop:N},...L&&{paddingBottom:L},...A&&{paddingLeft:A},...T&&{paddingRight:T},...E&&{backgroundColor:E},...b&&{fontSize:b},...R&&{fontWeight:R},...I&&{textTransform:I}},Z={...O&&{color:O},...P&&{borderWidth:"1px",borderStyle:"solid",borderColor:P},...k&&{borderRadius:k},...D&&{paddingTop:D},...M&&{paddingBottom:M},...W&&{paddingLeft:W},...B&&{paddingRight:B},...H&&{backgroundColor:H},...U&&{fontSize:U},...F&&{fontWeight:F},...G&&{textTransform:G}};let K=g||0,Y=p||0;const[X,Q]=e.useState(!1),[ie,se]=e.useState(!1);e.useEffect((()=>{se(!(Y===K&&!X)&&Y>=K)}),[X]),e.useEffect((()=>{Q(!1)}),[u]);const le=t.jsxs(t.Fragment,{children:[(null==u?void 0:u.length)?t.jsx(ee,{columnsCountBreakPoints:{350:1,750:3,1024:4},className:"sledge-product-review__widget-review-grid",children:t.jsx(te,{gutter:"30px",children:u.map(((e,i)=>{var s,l;const{user:{name:n},review:{rating:d,review:r,media:a,reply:o,is_verified:c},created_at:u}=e;let g=new Intl.DateTimeFormat("en-US").format(new Date(u)),h=q?String(String(q).includes("<span>")?String(q).split("<span>")[0]:String(q)).replaceAll(Pe.STORE.NAME,null==(s=o[0])?void 0:s.name):null==(l=o[0])?void 0:l.name,p=q?Ce("<span>","</span>",q):"Admin";return t.jsx("div",{className:"sledge-product-review__widget-review-card",onClick:()=>"undefined"!=typeof window&&window.sledgeProductReviewWidgetPopupDetail&&window.sledgeProductReviewWidgetPopupDetail({...e,settings:_}),children:t.jsxs("div",{className:"sledge-product-review__widget-review-card-content",children:[t.jsxs("div",{className:"sledge-product-review__widget-review-card-desc-wrapper",children:[t.jsxs("div",{className:"sledge-product-review__widget-review-card-desc",children:[t.jsxs("div",{className:"sledge-product-review__widget-review-card-customer",children:[t.jsx("span",{children:n}),c?t.jsx("span",{className:"sledge-product-review__widget-review-card-verified-text",style:Z,children:V}):null]}),t.jsxs("div",{className:"sledge-product-review__widget-review-card-column",children:[t.jsx("div",{className:"sledge-product-review__widget-review-card-rating",children:t.jsx(Ft,{value:d,size:f,withSkeletonLoading:!1})}),j?t.jsx("div",{className:"sledge-product-review__widget-review-card-date",children:g}):null]}),t.jsx("div",{className:"sledge-product-review__widget-review-card-message",children:r.length>=250?`${r.slice(0,250)}...`:r})]}),(null==a?void 0:a.length)?t.jsx("div",{className:"sledge-product-review__widget-review-card-image",children:a.slice(0,4).map(((e,i)=>{const{type:s,file:l}=e;let n="image"===s?t.jsx("img",{src:l,alt:"sledge-review-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${Se}/img/blank-image.png`},i):t.jsx("video",{controls:!1,children:t.jsx("source",{src:l})},i);return i<3?n:t.jsxs("div",{className:"sledge-product-review__widget-review-card-media",children:[t.jsx("div",{className:"sledge-product-review__widget-review-card-media-more",children:"More+"}),n]},i)}))}):t.jsx(t.Fragment,{})]}),(null==o?void 0:o.length)?t.jsxs("div",{className:"sledge-product-review__widget-review-card-reply",children:[t.jsxs("div",{className:"sledge-product-review__widget-review-card-reply-title",children:[t.jsx("img",{src:z||"",alt:"sledge-review-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${Se}/img/blank-image.png`,className:"sledge-product-review__widget-review-card-reply-profile-image"},i),t.jsx("span",{className:"sledge-product-review__widget-review-card-reply-name",children:h}),t.jsx("span",{className:"sledge-product-review__widget-review-card-reply-status",children:p})]}),t.jsx("div",{className:"sledge-product-review__widget-review-card-reply-message",dangerouslySetInnerHTML:{__html:o[0].text}})]}):null]})},i)}))})}):t.jsx(t.Fragment,{}),ie&&t.jsx("div",{className:"sledge-product-review__widget-button-load-more",children:t.jsx(Lt,{type:"button",role:"button",colorType:"light",disabled:X,onClick:()=>{h&&g&&h(g+1),Q(!0)},style:{...J,...X&&{cursor:"wait"}},children:X?"Loading...":$||"Load More"})})]}),ne=t.jsx(t.Fragment,{children:(null==u?void 0:u.length)?t.jsx(ee,{columnsCountBreakPoints:{350:1},className:"sledge-product-review__widget-review-grid",children:t.jsx(te,{children:u.map(((e,i)=>{var s,l;const{id:n,user:{name:d},review:{rating:r,review:a,media:o,reply:c,is_verified:u},created_at:g}=e;let h=new Intl.DateTimeFormat("en-US").format(new Date(g)),p=q?String(String(q).includes("<span>")?String(q).split("<span>")[0]:String(q)).replaceAll(Pe.STORE.NAME,null==(s=c[0])?void 0:s.name):null==(l=c[0])?void 0:l.name,m=q?Ce("<span>","</span>",q):"Admin";return t.jsxs("div",{className:"sledge-product-review__widget-review-card",onClick:()=>"undefined"!=typeof window&&window.sledgeProductReviewWidgetPopupDetail&&window.sledgeProductReviewWidgetPopupDetail({...e,settings:_}),children:[t.jsxs("div",{className:"sledge-product-review__widget-review-card-customer-wrapper",children:[t.jsxs("div",{className:"sledge-product-review__widget-review-card-customer",children:[t.jsx("span",{children:d}),u?t.jsx("span",{className:"sledge-product-review__widget-review-card-verified-text",style:Z,children:V}):null]}),t.jsxs("div",{className:"sledge-product-review__widget-review-card-column",children:[t.jsx("div",{className:"sledge-product-review__widget-review-card-rating",children:t.jsx(Ft,{value:r,size:f,withSkeletonLoading:!1})}),j?t.jsx("div",{className:"sledge-product-review__widget-review-card-date",children:h}):null]})]}),t.jsx("div",{className:"sledge-product-review__widget-review-card-content",children:t.jsx("div",{className:"sledge-product-review__widget-review-card-desc-wrapper",children:t.jsxs("div",{className:"sledge-product-review__widget-review-card-desc",children:[t.jsx("div",{className:"sledge-product-review__widget-review-card-message",children:a.length>=350?`${a.slice(0,350)}...`:a}),(null==c?void 0:c.length)?t.jsxs("div",{className:"sledge-product-review__widget-review-card-reply",children:[t.jsxs("div",{className:"sledge-product-review__widget-review-card-reply-title",children:[t.jsx("svg",{width:18,height:16,viewBox:"0 0 18 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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"})}),t.jsx("img",{src:z||"",alt:"sledge-review-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${Se}/img/blank-image.png`,className:"sledge-product-review__widget-review-card-reply-profile-image"},i),t.jsx("span",{className:"sledge-product-review__widget-review-card-reply-name",children:p}),t.jsx("span",{className:"sledge-product-review__widget-review-card-reply-status",children:m})]}),t.jsx("div",{className:"sledge-product-review__widget-review-card-reply-message",dangerouslySetInnerHTML:{__html:c[0].text}})]}):null]})})}),(null==o?void 0:o.length)?t.jsx("div",{className:"sledge-product-review__widget-review-card-image",children:o.slice(0,4).map(((e,i)=>{const{type:s,file:l}=e;let n="image"===s?t.jsx("img",{src:l,alt:"sledge-review-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${Se}/img/blank-image.png`},i):t.jsx("video",{controls:!1,children:t.jsx("source",{src:l})},i);return i<3?n:t.jsxs("div",{className:"sledge-product-review__widget-review-card-media",children:[t.jsx("div",{className:"sledge-product-review__widget-review-card-media-more",children:"More+"}),n]},i)}))}):t.jsx(t.Fragment,{})]},i)}))})}):t.jsx(t.Fragment,{})});return"list"===x?ne:le},ti=i=>{const{children:s,data:l,onAfterAddReview:n}=i,{productId:d}=l||{},{isRenderApp:r}=e.useContext(Fi),[a,o]=e.useState(!0),[c,u]=e.useState(!0),[g,h]=e.useState(!1),[p,m]=e.useState(!1),[_,v]=e.useState([]),[w,x]=e.useState([]),[f,j]=e.useState(""),[C,y]=e.useState(1),[S,N]=e.useState(0),[L,A]=e.useState(0),[T,E]=e.useState({}),b=Ut({currentPage:C,isReplaceWidgetList:p,productId:d}),R=async(e=!1,t=!1,i)=>{var s;let l,n=10,r=f;if(u(!!t||!e),!e||t){t||y(1),v([]);let e=await I(i);const{review_per_page:l,default_sort:d}=(null==(s=null==e?void 0:e.display)?void 0:s.widget)||{};n=l||n,r=f||d,j(r)}let a,c,g=!1,p=0,w=0,S={page:e?C:1,limit:n,sort:r};if(l=await kt(d,S),!l)return;const{status:L,data:T,page:E,sorts:b}=l,{code:R}=L;g=200===R||!1,a=(null==T?void 0:T.length)?t=>(null==_?void 0:_.length)&&e?[...t,...T]:T:[],c=(null==b?void 0:b.length)?b:[],p=(null==E?void 0:E.total_page)||1,w=(null==E?void 0:E.total_data)||1,g&&(v(a),x(c),N(p),A(w),u(!1),h(!1),m(!1),setTimeout((()=>{o(!1)}),1300))},I=async e=>{let t,i=!1;if(t=JSON.parse(e),!t)return;const{status:s,data:l}=t,{code:n}=s;return i=200===n||!1,i?(E(l),l):void 0};return e.useEffect((()=>{if(!(null==r?void 0:r.productReview))return;let e=localStorage.getItem(Ee.PRODUCT_REVIEW_SETTING)||"";"undefined"!=typeof window&&(window.sledgeProductReviewWidgetListUpdate=()=>{R(!1,!1,e)}),Boolean(b&&(null==b?void 0:b.productId)!==d)&&R(!1,!1,e),I(e)}),[r,d]),e.useEffect((()=>{if(!(null==r?void 0:r.productReview))return;let e=Boolean(b&&(null==b?void 0:b.currentPage)!==C),t=localStorage.getItem(Ee.PRODUCT_REVIEW_SETTING)||"";Boolean(b&&(null==b?void 0:b.isReplaceWidgetList)!==p)?R(!0,!0,t):R(!g&&e,p,t)}),[C,g,p,r]),t.jsx(t.Fragment,{children:t.jsx("div",{className:"sledge-product-review__widget-wrapper",children:e.Children.count(s)&&e.Children.map(s,(t=>e.cloneElement(t,{data:l,isFirstLoading:a,isLoading:c,productReviewData:_,productReviewSort:w,selectedSort:f,currentPage:C,totalPage:S,totalData:L,dataSettings:T,setIsLoading:u,setIsRefreshWidgetList:h,setIsReplaceWidgetList:m,setSelectedSort:j,setCurrentPage:y,onAfterAddReview:n})))})})},ii=({children:i})=>t.jsx(t.Fragment,{children:e.Children.count(i)&&e.Children.map(i,(t=>e.cloneElement(t,{})))});ii.Root=ti,ii.Header=Yt,ii.List=Xt;const si="",li=()=>{var i,s,l;const[n,d]=e.useState(!1),[r,a]=e.useState(""),[o,c]=e.useState(""),[m,_]=e.useState(""),[v,w]=e.useState(""),[x,f]=e.useState([]),[j,C]=e.useState([]),[y,S]=e.useState(""),[N,L]=e.useState(""),[A,T]=e.useState(!1),[E,b]=e.useState(""),[R,I]=e.useState({}),[O,P]=e.useState(0),[k,D]=e.useState({}),{text_color:M,border_color:W,border_radius:B,padding_top:H,padding_bottom:U,padding_left:F,padding_right:G,background_color:$,font_size:V,font_weight:q,text_transform:z}=(null==(s=null==(i=null==R?void 0:R.display)?void 0:i.widget)?void 0:s.verified)||{},{verified:J}=(null==(l=null==R?void 0:R.languages)?void 0:l.widget)||{},Z={...M&&{color:M},...W&&{borderWidth:"1px",borderStyle:"solid",borderColor:W},...B&&{borderRadius:B},...H&&{paddingTop:H},...U&&{paddingBottom:U},...F&&{paddingLeft:F},...G&&{paddingRight:G},...$&&{backgroundColor:$},...V&&{fontSize:V},...q&&{fontWeight:q},...z&&{textTransform:z}},K=0===O,Y=O===(null==x?void 0:x.length)-1;return e.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetPopupDetail=e=>{var t,i,s,l;const{user:{name:n},review:{rating:r,title:o,review:u,media:g,reply:h,is_verified:p},created_at:m,settings:v}=e,{name:x,image:j}=(null==(i=null==(t=null==v?void 0:v.display)?void 0:t.widget)?void 0:i.replier)||{};a(n),c(r),_(o),w(u),f(g),C(h),S(x?String(String(x).includes("<span>")?String(x).split("<span>")[0]:String(x)).replaceAll(Pe.STORE.NAME,null==(s=h[0])?void 0:s.name):null==(l=h[0])?void 0:l.name),L(x?Ce("<span>","</span>",x):"Admin"),T(p),b(new Intl.DateTimeFormat("en-US").format(new Date(m))),d(!0),I(v),P(0),D({name:x,image:j})})}),[]),t.jsx(u,{open:n,onOpenChange:d,children:t.jsxs(g,{children:[t.jsx(h,{className:"sledge__popup-overlay"}),t.jsx(h,{className:"sledge__popup-overlay-blur"}),t.jsx(p,{className:"sledge-product-review__widget-popup-detail-content DialogContent",children:t.jsxs("div",{className:"sledge-product-review__widget-popup-flex",children:[t.jsxs("div",{className:"sledge-product-review__widget-popup-image",children:[t.jsx("div",{className:"sledge-product-review__widget-popup-close",onClick:()=>d(!1),children:t.jsx("svg",{width:18,height:18,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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==x?void 0:x.length)?t.jsxs(t.Fragment,{children:[x.map(((i,s)=>{const{type:l,file:n}=i,d={hidden:{opacity:0,visibility:"hidden"},show:{opacity:1,visibility:"visible"}};let r="image"===l?t.jsx("img",{src:n,alt:"sledge-review-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${Se}/img/blank-image.png`,style:d[O!==s?"hidden":"show"]}):t.jsx("video",{controls:!0,style:d[O!==s?"hidden":"show"],children:t.jsx("source",{src:n})});return t.jsx(e.Fragment,{children:r},s)})),t.jsxs("div",{className:"sledge-product-review__widget-popup-media-nav",children:[!K&&t.jsx("div",{className:"sledge-product-review__widget-popup-media-nav-item sledge-product-review__widget-popup-media-nav-item-prev",onClick:()=>P(O-1),children:t.jsx(_t,{width:16,height:16,color:"white"})}),!Y&&t.jsx("div",{className:"sledge-product-review__widget-popup-media-nav-item sledge-product-review__widget-popup-media-nav-item-next",onClick:()=>P(O+1),children:t.jsx(vt,{width:16,height:16,color:"white"})})]})]}):t.jsx("div",{className:"sledge-product-review__widget-popup-no-media",children:"No Media Upload"})]}),t.jsxs("div",{className:"sledge-product-review__widget-popup-content",children:[t.jsxs("div",{className:"sledge-product-review__widget-popup-content-heading",children:[t.jsx("div",{className:"sledge-product-review__widget-popup-content-title",children:r}),A?t.jsx("div",{className:"sledge-product-review__widget-popup-content-verified-text",style:Z,children:J}):null]}),t.jsxs("div",{className:"sledge-product-review__widget-popup-content-subheading",children:[t.jsx(Ft,{value:o,size:"sm",withSkeletonLoading:!1}),t.jsx("div",{className:"sledge-product-review__widget-popup-content-date",children:E})]}),t.jsx("div",{className:"sledge-product-review__widget-popup-content-title-description",children:m}),t.jsxs("div",{className:"sledge-product-review__widget-popup-content-description",children:[t.jsx("div",{className:"sledge-product-review__widget-popup-content-message",dangerouslySetInnerHTML:{__html:v}}),(null==j?void 0:j.length)?t.jsxs("div",{className:"sledge-product-review__widget-popup-reply-wrapper",children:[t.jsxs("div",{className:"sledge-product-review__widget-review-card-reply-title",children:[t.jsx("img",{src:(null==k?void 0:k.image)||"",alt:"sledge-review-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${Se}/img/blank-image.png`,className:"sledge-product-review__widget-review-card-reply-profile-image"}),t.jsx("span",{className:"sledge-product-review__widget-review-card-reply-name",children:y}),t.jsx("span",{className:"sledge-product-review__widget-review-card-reply-status",children:N})]}),t.jsx("div",{className:"sledge-product-review__widget-popup-content-message",dangerouslySetInnerHTML:{__html:j[0].text}})]}):t.jsx(t.Fragment,{})]})]})]})})]})})},ni="",di=()=>{var i,s,l,n;const{sledgeAnonymId:d}=e.useContext(Fi),[r,a]=e.useState(!1),[o,c]=e.useState([{key:"Step_SelectRate",isDone:!0,component:ri},{key:"Step_WriteReview",isDone:!1,component:ai},{key:"Step_PersonalData",isDone:!1,component:oi}]),[m,_]=e.useState(o[0]),[v,w]=e.useState(!1),[x,f]=e.useState(null),[j,C]=e.useState(!1),[y,S]=e.useState(!1),[N,L]=e.useState(!1),[A,T]=e.useState(null),[E,b]=e.useState({}),[R,I]=e.useState({onAfterAddReview:e=>{}}),[O,P]=e.useState(""),[k,D]=e.useState(""),[M,W]=e.useState(""),[B,H]=e.useState(""),[U,F]=e.useState(""),[G,$]=e.useState(0),[V,q]=e.useState(""),[z,J]=e.useState(""),[Z,K]=e.useState([]),[Y,X]=e.useState([]),{title_added_to_review:Q,text_added_to_review:ee}=(null==(i=null==E?void 0:E.languages)?void 0:i.notification)||{},{title_confirm_add_review:te,text_confirm_add_review:le,button_submit_confirm_add_review:ne,button_cancel_confirm_add_review:de}=(null==(s=null==E?void 0:E.languages)?void 0:s.popup)||{},{navigation_previous:re,navigation_next:ae,button_submit:oe}=(null==(l=null==E?void 0:E.languages)?void 0:l.write_review_form)||{},ce=async()=>{let e;C(!0);let i=!1;if(e=await Ht({userFirstName:O,userLastName:k,userEmail:M,productId:B,productVariantId:U,rating:G,title:V,review:z,mediaIds:Z}),!e)return;const{status:{code:s}}=e;i=200===s,i?(R.onAfterAddReview("success"),setTimeout((()=>{C(!1),a(!1),_(o[0]),P(""),D(""),W(""),$(0),q(""),J(""),K([]),X([]),ge&&ge(),"undefined"!=typeof window&&(window.sledgeProductReviewWidgetListUpdate&&window.sledgeProductReviewWidgetListUpdate(),window.sledgeProductReviewWidgetSummaryUpdate&&window.sledgeProductReviewWidgetSummaryUpdate(),window.sledgeToastNotification&&window.sledgeToastNotification({title:Q,message:ee,type:"success",icon:t.jsx(Ct,{width:40,height:40,color:"black"})}))}),500)):(R.onAfterAddReview("failed"),C(!1),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:"failed add to review",type:"failed",icon:t.jsx(Ct,{width:40,height:40,color:"black"})}))},ue=()=>{const e=o.findIndex((e=>e.key===m.key));c((e=>e.map((e=>(e.key===m.key&&(e.isDone=!0),e))))),_(o[e+1])},ge=async()=>{let e,t=!1,i=[],s=[];if(e=await Mt(),!e)return;const{status:l,data:n}=e,{code:d}=l;t=200===d||!1,i=(null==n?void 0:n.ids)||[],s=(null==n?void 0:n.media)||[],t&&(K(i),X(s),S(!1),L(!1),T(null))},he=()=>{"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:te,message:le,textSubmit:ne,textCancel:de,buttonSubmitType:"success",onSubmit:ce||{}})};return e.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetFormAdd=(e,t)=>{const{productId:i,productVariantId:s}=e||{};a(!0),H(i||""),F(s||""),t&&I({onAfterAddReview:t})}),(async e=>{let t,i=!1;if(t=JSON.parse(e),!t)return;const{status:s,data:l}=t,{code:n}=s;i=200===n||!1,i&&(b(l),await ge())})(localStorage.getItem(Ee.PRODUCT_REVIEW_SETTING)||"")}),[]),e.useEffect((()=>{_(o[0])}),[d]),e.useEffect((()=>{switch(null==m?void 0:m.key){case"Step_SelectRate":w(!!G),f(t.jsxs(t.Fragment,{children:[t.jsx("span",{children:ae}),t.jsx(wt,{width:18,height:18,color:"black"})]}));break;case"Step_WriteReview":w(!0),f(d?t.jsxs(t.Fragment,{children:[t.jsx("span",{children:ae}),t.jsx(wt,{width:18,height:18,color:"black"})]}):oe);break;case"Step_PersonalData":w(!0),f(oe)}}),[m,G,z,O,M,d]),t.jsx(u,{open:r,onOpenChange:a,children:t.jsxs(g,{children:[t.jsx(h,{className:"sledge__popup-overlay"}),t.jsx(h,{className:"sledge__popup-overlay-blur"}),t.jsx(p,{className:"sledge-product-review__widget-form-add-content DialogContent",children:t.jsxs(ie,{className:"sledge-product-review__widget-form-review FormRoot",onSubmit:e=>(e=>{e.preventDefault(),"Step_SelectRate"===(null==m?void 0:m.key)?ue():d&&"Step_WriteReview"===(null==m?void 0:m.key)?ue&&ue():he&&he()})(e),"data-active-step":(null==m?void 0:m.key)||"","data-visible-next":v,children:[t.jsx("div",{className:"sledge-product-review__widget-form-add-step",children:(null==m?void 0:m.component)&&e.cloneElement(t.jsx(m.component,{}),{steps:o,activeStep:m,isLoadingAddReview:j,isLoadingUploadMedia:y,isLoadingDeleteMedia:N,selectedDeleteMediaId:A,dataSettings:E,postUserFirstName:O,postUserLastName:k,postUserEmail:M,postRating:G,postReview:z,postMedia:Y,setIsLoadingUploadMedia:S,setIsLoadingDeleteMedia:L,setSelectedDeleteMediaId:T,handleNext:ue,handleProductReviewMedia:ge,handleAddReview:ce,setPostUserFirstName:P,setPostUserLastName:D,setPostUserEmail:W,setPostRating:$,setPostTitle:q,setPostReview:J,confirmAddReview:he})}),t.jsxs("div",{className:"sledge-product-review__widget-form-add-step-navigator",children:[(null==(n=o[0])?void 0:n.key)===(null==m?void 0:m.key)?t.jsx("span",{}):t.jsx("span",{onClick:()=>{const e=o.findIndex((e=>e.key===m.key));0!==e&&(c((e=>e.map((e=>(e.key===m.key&&(e.isDone=!1),e))))),_(o[e-1]))},children:re}),v&&t.jsx(se,{asChild:!0,disabled:j,children:t.jsx(Lt,{role:"button",colorType:"light",style:{...j&&{cursor:"wait"}},children:j?"Adding...":x})})]})]})})]})})},ri=e=>{var i,s,l,n;const{postRating:d,setPostRating:r,setPostTitle:a,dataSettings:o}=e,{text_color:c,border_color:u,border_radius:g,padding_top:h,padding_bottom:p,padding_left:m,padding_right:_,background_color:v,selected_background_color:w,font_size:x,font_weight:f,text_transform:j}=(null==(s=null==(i=null==o?void 0:o.display)?void 0:i.write_review_form)?void 0:s.button_select_rating)||{},{title:C,ratings:y}=(null==(n=null==(l=null==o?void 0:o.languages)?void 0:l.write_review_form)?void 0:n.select_rating)||{},{rating_5:S,rating_4:N,rating_3:L,rating_2:A,rating_1:T}=y||{},E={...c&&{color:c},...u&&{borderColor:u},...g&&{borderRadius:g},...h&&{paddingTop:h},...p&&{paddingBottom:p},...m&&{paddingLeft:m},..._&&{paddingRight:_},...x&&{fontSize:x},...f&&{fontWeight:f},...j&&{textTransform:j}},b=[{rate:5,title:S},{rate:4,title:N},{rate:3,title:L},{rate:2,title:A},{rate:1,title:T}];return t.jsxs("div",{className:"sledge-product-review__widget-form",children:[t.jsx("div",{className:"sledge-product-review__widget-form-title",children:C}),t.jsx("div",{className:"sledge-product-review__widget-form-select-rate-list",children:b.map(((e,i)=>t.jsxs("button",{type:"button",className:`sledge-product-review__widget-form-select-rate-list-item ${e.rate===d&&"selected"}`,onClick:()=>{return t=e.rate,i=e.title,r&&r(t),void(a&&a(i));var t,i},style:{...E,...v&&w?{backgroundColor:e.rate===d?w:v}:{}},children:[t.jsx(Fi.Provider,{value:{isRenderApp:{productReview:!0}},children:t.jsx(Ft,{value:e.rate,size:"md",withSkeletonLoading:!1})})," ",t.jsx("span",{className:"sledge-product-review__widget-form-select-rate-text",children:e.title})]},i)))})]})},ai=i=>{var s;const{isLoadingUploadMedia:l,isLoadingDeleteMedia:n,selectedDeleteMediaId:d,dataSettings:r,postMedia:a,postReview:o,setIsLoadingUploadMedia:c,setIsLoadingDeleteMedia:u,setSelectedDeleteMediaId:g,handleNext:h,handleProductReviewMedia:p,setPostMediaIds:m,setPostMedia:_,setPostReview:v}=i,{description:w}=(null==(s=null==r?void 0:r.languages)?void 0:s.write_review_form)||{},{title:x,form_placeholder:f}=w||{},[j,C]=e.useState(!1),y=async()=>{if(!d)return;let e;u&&u(!0);let i=!1;if(e=await Bt(d),!e)return;const{status:s}=e,{code:l}=s;i=200===l,i?(p&&p(),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Media removed",message:"successfully removed from media",type:"success",icon:t.jsx(yt,{width:40,height:40,color:"black"})})):(u&&u(!1),g&&g(null),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:"failed delete to media",type:"failed",icon:t.jsx(yt,{width:40,height:40,color:"black"})}))};e.useEffect((()=>{C(!1)}),[]),e.useEffect((()=>{d&&j&&(C(!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:y||{}}))}),[d,j]);const S=t.jsx("label",{htmlFor:"file-upload",className:"sledge-product-review__widget-form-upload-media-file",children:t.jsx("div",{className:"sledge-product-review__widget-form-upload-media",children:t.jsxs("div",{className:"sledge-product-review__widget-form-upload-media-description",children:[t.jsx(yt,{width:32,height:32,color:"currentColor"}),t.jsx("div",{className:"sledge-product-review__widget-form-upload-media-text",children:l?t.jsx("span",{children:"Uploading..."}):t.jsxs(t.Fragment,{children:[t.jsx("span",{children:"Upload a file PNG, JPG max 5MB"}),t.jsx("input",{id:"file-upload",name:"file-upload",type:"file",multiple:!0,onChange:e=>{e.target.files&&(async e=>{let i;c&&c(!0);let s=!1,l=[],n=[];i=await Wt(e),i||(c&&c(!1),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:"failed add to media",type:"failed",icon:t.jsx(yt,{width:40,height:40,color:"black"})}));const{status:d,data:r}=i||{},{code:a}=d||{};s=200===a,l=(null==r?void 0:r.ids)||[],n=(null==r?void 0:r.media)||[],s?(m&&m(l),_&&_(n),p&&p(),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Media added",message:"successfully added to media",type:"success",icon:t.jsx(yt,{width:40,height:40,color:"black"})})):(c&&c(!1),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:"failed add to media",type:"failed",icon:t.jsx(yt,{width:40,height:40,color:"black"})}))})(e.target.files)},className:"sledge-product-review__widget-form-sr-only"})]})})]})})});return t.jsxs("div",{className:"sledge-product-review__widget-form",children:[t.jsx("div",{className:"sledge-product-review__widget-form-title",children:x}),t.jsx(ks,{className:"Textarea",required:!0,placeholder:f,value:o,onChange:e=>v&&v(e.target.value)}),(null==a?void 0:a.length)?t.jsx(t.Fragment,{children:t.jsxs("div",{className:"sledge-product-review__widget-form-upload-media-filled",children:[a.map(((e,i)=>{const{id:s,file:l,type:r}=e;let a=n&&s==d;return t.jsxs(Q.div,{initial:"hidden",animate:"visible",variants:Zt,className:"sledge-product-review__widget-form-upload-media-filled-item",children:[a?t.jsx("div",{className:"sledge-product-review__widget-form-upload-media-delete-loading",children:"Deleting..."}):t.jsx("div",{className:"sledge-product-review__widget-form-upload-media-delete-item",onClick:()=>{C(!0),g&&g(s)},children:t.jsx("svg",{width:25,height:20,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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?t.jsx("img",{src:l,className:"sledge-product-review__widget-form-upload-media-filled-item-file",alt:"sledge-review-uploaded-image",loading:"lazy",onError:e=>e.currentTarget.src=`${Se}/img/blank-image.png`}):t.jsx("video",{controls:!a,className:"sledge-product-review__widget-form-upload-media-filled-item-file",children:t.jsx("source",{src:l})})]},i)})),S]})}):S]})},oi=e=>{var i;const{dataSettings:s,postUserFirstName:l,postUserLastName:n,postUserEmail:d,setPostUserFirstName:r,setPostUserLastName:a,setPostUserEmail:o}=e,{user:c}=(null==(i=null==s?void 0:s.languages)?void 0:i.write_review_form)||{},{title:u,first_name_form_placeholder:g,last_name_form_placeholder:h,email_form_placeholder:p}=c||{};return t.jsx("div",{className:"sledge-product-review__widget-form",children:t.jsxs("div",{className:"sledge-product-review__widget-form-personal-data",children:[t.jsx("div",{className:"sledge-product-review__widget-form-title",children:u}),t.jsxs("div",{className:"sledge-product-review__widget-form-group-flex",children:[t.jsx(Ms,{name:"userFirstName",type:"text",required:!0,placeholder:g,onChange:e=>r&&r(e.target.value),value:l}),t.jsx(Ms,{name:"userLastName",type:"text",required:!0,placeholder:h,onChange:e=>a&&a(e.target.value),value:n})]}),t.jsx(Ms,{name:"userEmail",type:"email",required:!0,placeholder:p,onChange:e=>o&&o(e.target.value),value:d}),t.jsxs("div",{className:"sledge-product-review__widget-form-review-description",children:["By submitting, I acknowledge the ",t.jsx("a",{href:"#",children:"Terms of Service"})," and ",t.jsx("a",{href:"#",children:"Privacy Policy"})," and that my review will be publicly posted and shared online"]})]})})},ci=()=>{let i=document.querySelector(Re.PRODUCT_REVIEW.ELEMENT_WIDGET);je(i,(()=>{if(i){const s=i.getAttribute(Te.GLOBAL.PRODUCT_ID),l=i.getAttribute(Te.GLOBAL.PRODUCT_VARIANT_ID),n=i.getAttribute(Te.GLOBAL.ON_AFTER_ADD_REVIEW);i.innerHTML="",c.createRoot(i).render(t.jsx(e.StrictMode,{children:t.jsx(Fi.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0}},children:t.jsxs(ii.Root,{data:{productId:s||"",productVariantId:l||""},onAfterAddReview:e=>{i&&n&&eval(n)({element:i,state:e})},children:[t.jsxs(ii.Header,{children:[t.jsx(Yt.Summary,{}),t.jsx(Yt.AddTrigger,{}),t.jsx(Yt.Sort,{})]}),t.jsx(ii.List,{})]})})}))}}))},ui=()=>{let i=document.querySelector(`[${Ae}="${be.PRODUCT_REVIEW.ELEMENT_WIDGET_POPUP_DETAIL}"]`);i||(i=document.createElement("div"),i.setAttribute(Ae,be.PRODUCT_REVIEW.ELEMENT_WIDGET_POPUP_DETAIL),document.body.appendChild(i)),i&&(i.innerHTML="",c.createRoot(i).render(t.jsx(e.StrictMode,{children:t.jsx(li,{})})))},gi=()=>{let i=document.querySelector(`[${Ae}="${be.PRODUCT_REVIEW.ELEMENT_WIDGET_FORM_ADD}"]`);i||(i=document.createElement("div"),i.setAttribute(Ae,be.PRODUCT_REVIEW.ELEMENT_WIDGET_FORM_ADD),document.body.appendChild(i)),i&&(i.innerHTML="",c.createRoot(i).render(t.jsx(e.StrictMode,{children:t.jsx(di,{})})))},hi=()=>{ci(),ui(),gi(),$t()},pi=e=>t.jsx(Oi,{layoutType:"product-filter",...e}),mi=()=>{let i=document.querySelector(Re.INSTANT_SEARCH.ELEMENT_PLP_WIDGET);je(i,(()=>{var s,l,n,d;if(i){const r=i.getAttribute(Te.INSTANT_SEARCH.QUERY_KEYWORD),a=i.getAttribute(Te.GLOBAL.COLLECTION_ID),o=i.getAttribute(Te.GLOBAL.ON_AFTER_ADD_TO_CART),u=i.getAttribute(Te.GLOBAL.ON_AFTER_ADD_WISHLIST),g=i.getAttribute(Te.GLOBAL.ON_AFTER_REMOVE_WISHLIST),h=i.getAttribute(Te.GLOBAL.ON_AFTER_RENDER_PRODUCT),p=null==(s=i.querySelector(Re.GLOBAL.ELEMENT_PRODUCT_CARDS))?void 0:s.getAttribute(Te.GLOBAL.RENDER_COMPONENT);null==(l=i.querySelector(Re.GLOBAL.ELEMENT_SUGGESTION_KEYWORD_LISTS))||l.getAttribute(Te.GLOBAL.RENDER_COMPONENT),null==(n=i.querySelector(Re.GLOBAL.ELEMENT_OTHER_INDEX_LISTS))||n.getAttribute(Te.GLOBAL.RENDER_COMPONENT),null==(d=i.querySelector(Re.GLOBAL.ELEMENT_SEARCH_VIEW_MORE_RESULT))||d.getAttribute(Te.GLOBAL.RENDER_COMPONENT),i.innerHTML="",c.createRoot(i).render(t.jsx(e.StrictMode,{children:t.jsx(Fi.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0}},children:t.jsx(pi,{query:{keyword:r||""},data:{collectionId:Number(a)||""},onAfterAddToCart:e=>{i&&o&&eval(o)({element:i,state:e})},onAfterAddWishlist:e=>{i&&u&&eval(u)({element:i,state:e})},onAfterRemoveWishlist:e=>{i&&g&&eval(g)({element:i,state:e})},onAfterRenderProduct:e=>{i&&h&&eval(h)({element:i,state:e})},children:t.jsx(Gi,{component:p?eval(p):null,isJsVersion:!0})})})}))}}))},_i="",vi=i=>{const{size:s="sm",children:l,onAfterAddToCart:n,onAfterAddWishlist:d,onAfterRemoveWishlist:r,onAfterRenderProduct:a}=i||{};let o=null,c=null,u=null,g=null,h=!1;e.Children.map(l,(t=>{if(e.isValidElement(t)&&ye(t.type)){const{component:e,isJsVersion:i}=(null==t?void 0:t.props)||{};switch(h=i,t.type.name){case ke.PRODUCT.CARDS:o=e;break;case ke.SUGGESTION_KEYWORD_LISTS:c=e;break;case ke.OTHER_INDEX_LISTS:u=e;break;case ke.SEARCH_VIEW_MORE_RESULT:g=e}}}));const{isRenderApp:p}=e.useContext(Fi),[m,_]=e.useState({width:0,height:0});e.useEffect((()=>{(null==p?void 0:p.instantSearch)&&_("xs"===s?{width:14,height:14}:"sm"===s?{width:20,height:20}:{width:25,height:25})}),[p]);return t.jsx("span",{className:"sledge-instant-search__icon-widget",onClick:()=>{"undefined"!=typeof window&&window.sledgeInstantSearchIconWidgetPopup&&window.sledgeInstantSearchIconWidgetPopup(n,d,r,a,h,o,c,u,g)},children:t.jsx(St,{...m,color:"currentColor"})})},wi="",xi=async(e,t,i)=>{let s=localStorage.getItem(Ee.INSTANT_SEARCH_AUTH_APP);var l=new Headers;l.append("Authorization",`Bearer ${s}`),l.append("Content-Type","application/json");var n={method:t,headers:l,redirect:"follow",...i&&{body:JSON.stringify(i)}};return await fetch(`${Ne}${e}`,n).then((e=>e.json())).then((e=>e)).catch((()=>{}))},fi=async(e,t)=>await xi(`/indexes/${e}/search`,"POST",t),ji=async e=>await xi("/multi-search","POST",e),Ci=async e=>{const{keyword:t,resultCount:i}=e;let s=localStorage.getItem(Ee.AUTH_APP);var l=new Headers;l.append("Authorization",`Bearer ${s}`),l.append("Content-Type","application/json");var n={method:"POST",headers:l,body:JSON.stringify({keyword:t,result_count:i}),redirect:"follow"};return await fetch(`${Se}/instantsearch/statistics/search`,n).then((e=>e.json())).then((e=>e)).catch((()=>{}))},yi=async e=>{const{productId:t}=e;let i=localStorage.getItem(Ee.AUTH_APP);var s=new Headers;s.append("Authorization",`Bearer ${i}`),s.append("Content-Type","application/json");var l={method:"POST",headers:s,body:JSON.stringify({product:{id:xe(t)}}),redirect:"follow"};return await fetch(`${Se}/instantsearch/statistics/click`,l).then((e=>e.json())).then((e=>e)).catch((()=>{}))},Si=async e=>{const{productId:t}=e;let i=localStorage.getItem(Ee.AUTH_APP);var s=new Headers;s.append("Authorization",`Bearer ${i}`),s.append("Content-Type","application/json");var l={method:"POST",headers:s,body:JSON.stringify({product:{id:xe(t)}}),redirect:"follow"};return await fetch(`${Se}/instantsearch/statistics/cart`,l).then((e=>e.json())).then((e=>e)).catch((()=>{}))},Ni=({listsComponent:e,name:i,items:s,isComponentJsVersion:l})=>{const n=e?e({name:i,items:s}):null;return e?l?t.jsx("div",{dangerouslySetInnerHTML:{__html:n}}):n:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-title",children:i}),(null==s?void 0:s.length)?t.jsx("ul",{className:"sledge-instant-search__icon-widget-search-form-result-list",children:s.map(((e,i)=>{const{title:s,url:l}=e;return t.jsx("li",{children:t.jsx("a",{href:l,className:"sledge-instant-search__icon-widget-search-form-result-list-link",children:s})},i)}))}):t.jsx("ul",{className:"sledge-instant-search__icon-widget-search-form-result-list",children:t.jsxs("li",{className:"sledge-instant-search__icon-widget-search-form-result-item-disabled",children:["No ",null==i?void 0:i.toLowerCase()," were found"]})})]})},Li=({listsComponent:e,keywords:i,isComponentJsVersion:s=!1})=>{const l=e?e({keywords:i}):null;return e?s?t.jsx("div",{dangerouslySetInnerHTML:{__html:l}}):l:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-title",children:"Suggestions"}),t.jsx("ul",{className:"sledge-instant-search__icon-widget-search-form-result-list",children:null==i?void 0:i.map(((e,i)=>t.jsx("li",{children:t.jsxs("a",{href:`${Oe}?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:[t.jsx(St,{width:12,height:12,color:"#677487"})," ",e]})},i)))})]})},Ai=({component:e,keyword:i,isComponentJsVersion:s=!1})=>{const l=e?e({keyword:i}):null;return e?s?t.jsx("div",{dangerouslySetInnerHTML:{__html:l}}):l:t.jsx("a",{href:`${Oe}?q=${i}`,className:"sledge-instant-search__icon-widget-button-more",children:"View More Result"})},Ti={OtherIndexLists:Ni,SuggestionKeywordLists:Li,SearchViewMoreResult:Ai},Ei=()=>{var i,s,l,n,d,r,a,o,c,m,_,v,w,x,f,j,C,y,S,N,L,A;const[T,E]=e.useState(!0),[b,R]=e.useState(!1),[I,O]=e.useState(""),[P,k]=e.useState(""),[D,M]=e.useState([]),[W,B]=e.useState([]),[H,U]=e.useState([]),[F,G]=e.useState([]),[$,V]=e.useState({}),[q,z]=e.useState({}),[J,Z]=e.useState(""),[K,Y]=e.useState({onAfterAddToCart:e=>{},onAfterAddWishlist:e=>{},onAfterRemoveWishlist:e=>{},onAfterRenderProduct:e=>{},separateJsVersionComponent:null,productCardsComponent:null,suggestionKeywordListsComponent:null,otherIndexListsComponent:null,searchViewMoreResultComponent:null}),X=e.useRef(null),Q=Ut({keyword:I}),ee=async(e,t=!1)=>{var i,s,l,n,d,r,a,o,c,u,g;if(!b)return;E(!0);const{tabs:h,suffix_index_product:p,hidden_tags:m,display:_}=e,v=(null==(i=null==_?void 0:_.search)?void 0:i.suggestion)||{};let w,x={queries:h.map((e=>{var t;const{index:i}=e;let s=i.includes(p),l=[];return(null==m?void 0:m.length)&&l.push(`tags NOT IN [${m}]`),(null==(t=null==_?void 0:_.filter)?void 0:t.show_out_of_stock)||l.push("variants.inventory_quantity > 0"),{indexUid:i,q:I,hitsPerPage:s?6:4,filter:s?l.join(" AND "):""}}))};if(w=await ji(x),!w)return;const{results:f}=w;let j=null==f?void 0:f.filter((({indexUid:e})=>null==e?void 0:e.includes(p)));t&&(null==I?void 0:I.length)&&Ci({keyword:I,resultCount:(null==(s=j[0])?void 0:s.totalHits)||0});let C=(null==(l=null==f?void 0:f.filter((({indexUid:e})=>!(null==e?void 0:e.includes(p)))))?void 0:l.map((e=>{const{indexUid:t}=e,{name:i}=null==h?void 0:h.find((({index:e})=>e.includes(t)));return{...e,name:i||""}})))||[],y=(null==j?void 0:j.length)?null==(n=j[0])?void 0:n.hits:[],S=I.length?(null==y?void 0:y.length)?"":"no_result":"zero_character",N=Boolean(!I.length&&Object.keys(v).length&&(null==(r=null==(d=v[S])?void 0:d.products)?void 0:r.active)&&(null==(c=null==(o=null==(a=v[S])?void 0:a.products)?void 0:o.list)?void 0:c.length));M(N?null==(g=null==(u=v[S])?void 0:u.products)?void 0:g.list:y),B(C),Z(S),E(!1)};return e.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeInstantSearchIconWidgetPopup=(e=(()=>{}),t=(()=>{}),i=(()=>{}),s=(()=>{}),l=null,n=(()=>{}),d=(()=>{}),r=(()=>{}),a=(()=>{}))=>{R(!0),Y({onAfterAddToCart:e,onAfterAddWishlist:t,onAfterRemoveWishlist:i,onAfterRenderProduct:s,separateJsVersionComponent:l,productCardsComponent:n,suggestionKeywordListsComponent:d,otherIndexListsComponent:r,searchViewMoreResultComponent:a}),setTimeout((()=>{(null==X?void 0:X.current)&&(X.current.focus(),X.current.value=I)}),500)}),(async e=>{var t;if(!b)return;let i,s=!1;if(i=JSON.parse(e),!i)return;const{status:l,data:n}=i,{code:d}=l,{tabs:r,suffix_index_product:a,hidden_tags:o,display:c}=n;s=200===d||!1,s&&(U(r),k(a),G(o),V(c),z(null==(t=null==c?void 0:c.search)?void 0:t.suggestion),await ee(n))})(localStorage.getItem(Ee.INSTANT_SEARCH_SETTING)||"")}),[b]),e.useEffect((()=>{if(Boolean(Q&&(null==Q?void 0:Q.keyword)!==I)){const e=setTimeout((()=>{ee({tabs:H,suffix_index_product:P,hidden_tags:F,display:$},!0)}),500);return()=>clearTimeout(e)}}),[I]),t.jsx(u,{open:b,onOpenChange:R,children:t.jsxs(g,{children:[t.jsx(h,{className:"sledge__popup-overlay"}),t.jsx(h,{className:"sledge__popup-overlay-blur"}),t.jsxs(p,{className:"sledge-instant-search__icon-widget-popup-detail-content","data-layout-type":(null==(i=null==$?void 0:$.search)?void 0:i.layout)||"",children:[t.jsx(Tt,{type:"text",icon:t.jsx(St,{width:20,height:20,color:"#000000"}),placeholder:"Search anything...",value:I,fieldRef:X,onChange:({value:e})=>O(e),className:"sledge-instant-search__icon-widget-search-form-field",withClearField:!0}),t.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result",children:T?t.jsx(zs,{children:t.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-wrapper",children:t.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex",children:[t.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((i=>t.jsxs(e.Fragment,{children:[t.jsx(tl.Item,{width:"100%",height:"42px",color:"grey-100",rounded:"md",...Boolean(i)&&{style:{marginTop:"12px"}}}),t.jsx("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",gap:"12px",marginTop:"12px"},children:[1,2,3].map((e=>t.jsx(tl.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{maxWidth:"140px"}},e)))})]},i)))}),t.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-product",children:t.jsx(tl.ProductGrid,{count:6,type:"medium"})})]})})}):t.jsx(zs,{children:t.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-wrapper",children:t.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex",children:[t.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-other",children:[Object.keys(q).length&&(null==(l=null==(s=q[J])?void 0:s.keywords)?void 0:l.active)&&(null==(r=null==(d=null==(n=q[J])?void 0:n.keywords)?void 0:d.list)?void 0:r.length)?t.jsx(Ti.SuggestionKeywordLists,{listsComponent:K.suggestionKeywordListsComponent,keywords:q[J].keywords.list,isComponentJsVersion:K.separateJsVersionComponent}):null,W&&W.map(((i,s)=>{const{hits:l,name:n}=i;return t.jsx(e.Fragment,{children:t.jsx(Ti.OtherIndexLists,{listsComponent:K.otherIndexListsComponent,name:n,items:l,isComponentJsVersion:K.separateJsVersionComponent})},s)}))]}),t.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-product",children:[(null==D?void 0:D.length)?t.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-product",children:t.jsx(Os,{sourceApp:"instant-search",type:"medium",data:D.map((e=>{const{variants:t,...i}=e||{};return{product:i,variants:t}})),setting:{show_vendor:null==(a=null==$?void 0:$.search)?void 0:a.show_vendor,show_sku:null==(o=null==$?void 0:$.search)?void 0:o.show_sku,show_price:null==(c=null==$?void 0:$.search)?void 0:c.show_price},showOptionOutOfStock:!0,isComponentJsVersion:K.separateJsVersionComponent,cards:K.productCardsComponent,onAfterAddToCart:K.onAfterAddToCart,onAfterAddWishlist:K.onAfterAddWishlist,onAfterRemoveWishlist:K.onAfterRemoveWishlist,onAfterRenderProduct:K.onAfterRenderProduct})}):Object.keys(q).length&&(null==(_=null==(m=q[J])?void 0:m.products)?void 0:_.active)&&(null==(x=null==(w=null==(v=q[J])?void 0:v.products)?void 0:w.list)?void 0:x.length)?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-product-suggestion-no-result-text",children:[t.jsx("span",{children:"Sorry"}),", nothing found for ",t.jsx("span",{children:I}),". Did you mean:"]}),t.jsx(Os,{sourceApp:"instant-search",type:"medium",data:q[J].products.list.map((e=>{const{variants:t,...i}=e||{};return{product:i,variants:t}})),setting:{show_vendor:null==(f=null==$?void 0:$.search)?void 0:f.show_vendor,show_sku:null==(j=null==$?void 0:$.search)?void 0:j.show_sku,show_price:null==(C=null==$?void 0:$.search)?void 0:C.show_price},showOptionOutOfStock:!0,isComponentJsVersion:K.separateJsVersionComponent,cards:K.productCardsComponent,onAfterAddToCart:K.onAfterAddToCart,onAfterAddWishlist:K.onAfterAddWishlist,onAfterRemoveWishlist:K.onAfterRemoveWishlist,onAfterRenderProduct:K.onAfterRenderProduct})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-title",children:"Products"}),t.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-item-disabled",children:"No product were found"})]}),(null==D?void 0:D.length)||Object.keys(q).length&&(null==(S=null==(y=q[J])?void 0:y.products)?void 0:S.active)&&(null==(A=null==(L=null==(N=q[J])?void 0:N.products)?void 0:L.list)?void 0:A.length)?t.jsx("div",{className:"sledge-instant-search__icon-widget-button-more-wrapper",children:t.jsx(Ti.SearchViewMoreResult,{component:K.searchViewMoreResultComponent,keyword:I,isComponentJsVersion:K.separateJsVersionComponent})}):null]})]})})})})]})]})})},bi=()=>{let i=document.querySelector(Re.INSTANT_SEARCH.ELEMENT_SEARCH_ICON_WIDGET);je(i,(()=>{var s,l,n,d;if(i){const r=i.getAttribute(Te.GLOBAL.ICON_SIZE),a=i.getAttribute(Te.GLOBAL.ON_AFTER_ADD_TO_CART),o=i.getAttribute(Te.GLOBAL.ON_AFTER_ADD_WISHLIST),u=i.getAttribute(Te.GLOBAL.ON_AFTER_REMOVE_WISHLIST),g=i.getAttribute(Te.GLOBAL.ON_AFTER_RENDER_PRODUCT),h=null==(s=i.querySelector(Re.GLOBAL.ELEMENT_PRODUCT_CARDS))?void 0:s.getAttribute(Te.GLOBAL.RENDER_COMPONENT),p=null==(l=i.querySelector(Re.GLOBAL.ELEMENT_SUGGESTION_KEYWORD_LISTS))?void 0:l.getAttribute(Te.GLOBAL.RENDER_COMPONENT),m=null==(n=i.querySelector(Re.GLOBAL.ELEMENT_OTHER_INDEX_LISTS))?void 0:n.getAttribute(Te.GLOBAL.RENDER_COMPONENT),_=null==(d=i.querySelector(Re.GLOBAL.ELEMENT_SEARCH_VIEW_MORE_RESULT))?void 0:d.getAttribute(Te.GLOBAL.RENDER_COMPONENT);i.innerHTML="",c.createRoot(i).render(t.jsx(e.StrictMode,{children:t.jsx(Fi.Provider,{value:{isRenderApp:{instantSearch:!0}},children:t.jsxs(vi,{size:r||"sm",onAfterAddToCart:e=>{i&&a&&eval(a)({element:i,state:e})},onAfterAddWishlist:e=>{i&&o&&eval(o)({element:i,state:e})},onAfterRemoveWishlist:e=>{i&&u&&eval(u)({element:i,state:e})},onAfterRenderProduct:e=>{i&&g&&eval(g)({element:i,state:e})},children:[t.jsx(Vi,{component:p?eval(p):null,isJsVersion:!0}),t.jsx($i,{component:m?eval(m):null,isJsVersion:!0}),t.jsx(Gi,{component:h?eval(h):null,isJsVersion:!0}),t.jsx(qi,{component:_?eval(_):null,isJsVersion:!0})]})})}))}}))},Ri=()=>{let i=document.createElement("div");i.setAttribute(Ae,be.INSTANT_SEARCH.ELEMENT_SEARCH_ICON_WIDGET_POPUP),document.body.appendChild(i),i&&(i.innerHTML="",c.createRoot(i).render(t.jsx(e.StrictMode,{children:t.jsx(Ei,{})})))},Ii="",Oi=i=>{var s,l,n,d,r,a,o,c,u,g;const{layoutType:h="default",query:p,data:m,children:_,onAfterAddToCart:v,onAfterAddWishlist:w,onAfterRemoveWishlist:x,onAfterRenderProduct:f}=i,{keyword:j=""}=p||{},{collectionId:C}=m||{};let y=null,S=!1;e.Children.map(_,(t=>{if(e.isValidElement(t)&&ye(t.type)&&t.type.name===ke.PRODUCT.CARDS){const{component:e,isJsVersion:i}=(null==t?void 0:t.props)||{};y=e,S=i}}));const{isRenderApp:N}=e.useContext(Fi),[L,A]=e.useState(!0),[T,E]=e.useState(!0),[b,R]=e.useState(""),[I,O]=e.useState(null),[P,k]=e.useState(),[D,M]=e.useState(t.jsx(Pi,{})),[W,B]=e.useState(!0),[H,U]=e.useState([]),[F,G]=e.useState([]),[$,V]=e.useState([]),[q,z]=e.useState([]),[J,Z]=e.useState(""),[K,Y]=e.useState({}),[X,Q]=e.useState([]),[ee,te]=e.useState({}),[ie,se]=e.useState([]),[le,ne]=e.useState(""),[de,re]=e.useState(!1),ae=Ut({keyword:b}),oe=async(e,t)=>{const{filters:i,tabs:s,suffix_index_product:l,hidden_tags:n,display:d,show_out_of_stock:r}=e;let a,o={queries:("product-filter"===h?s.filter((({index:e})=>null==e?void 0:e.includes(l))):s).map((e=>{const{index:s}=e;let d=!1,a=d?[]:null==i?void 0:i.map((e=>{const{collections:t,items:i}=e;return C&&(null==t?void 0:t.includes(Number(C)))||(null==t?void 0:t.includes("all"))?(d=!0,null==i?void 0:i.map((({value:e})=>e))):void 0})),o=s.includes(l),c=o&&a.length,u=[];return(null==n?void 0:n.length)&&u.push(`tags NOT IN [${n}]`),r||u.push("variants.inventory_quantity > 0"),C&&u.push(`collections.id = '${C}'`),c&&z(a[0]),{indexUid:s,q:"default"===t?"":b,hitsPerPage:1,facets:c?a[0]:[],filter:o?u.join(" AND "):""}}))};if(a=await ji(o),!a)return;const{results:c}=a;if(setTimeout((()=>{A(!1)}),1300),B(!1),E(!1),"totalDataPerIndex"===t)V(null==s?void 0:s.map((e=>{const{index:t}=e,{totalHits:i}=(null==c?void 0:c.find((({indexUid:e})=>e===t)))||{};return{...e,total:i}})));else{const{facetDistribution:e,facetStats:t}=(null==c?void 0:c.find((({indexUid:e})=>e.includes(l))))||{};Y(e?Object.fromEntries(Object.entries(e).map((i=>{let s=i[0],l=[];return"variants.inventory_quantity"===s?(Object.keys(e[s]).map((t=>Boolean(Number(t))?e[s][t]:0)),l=[{name:"In Stock",value:"> 0"}]):l="variants.price"===s?t[s]:Object.keys(e[s]).map((t=>({name:t,value:t,total:e[s][t]||0}))),[s,l]}))):{})}};e.useEffect((()=>{if(!(null==N?void 0:N.instantSearch))return;const e=new URLSearchParams(document.location.search);R((null==e?void 0:e.get(j))||""),(async e=>{let t;B(!0);let i,s=!1;if(t=JSON.parse(e),!t)return;const{status:l,data:n}=t,{code:d}=l,{allowed_sorts:r,default_sort:a,filters:o,tabs:c,suffix_index_product:u,hidden_tags:g,display:p,colors:m,show_out_of_stock:_}=n;s=200===d||!1,s&&(U((null==r?void 0:r.length)?r:[]),G((null==o?void 0:o.length)?o:[]),Z(u),Q(g),te(p),se(m),ne(a),re(_),i=c.find((({index:e})=>e.includes(u))),Object.keys(i).length&&(O(i.index),k(i.name)),await oe(n,"default"),"default"===h&&await oe(n,"totalDataPerIndex"))})(localStorage.getItem(Ee.INSTANT_SEARCH_SETTING)||"")}),[N]),e.useEffect((()=>{if(Boolean(ae&&(null==ae?void 0:ae.keyword)!==b)&&"default"===h){const e=setTimeout((()=>{oe({filters:F,tabs:$,suffix_index_product:J,hidden_tags:X,display:ee,colors:ie,show_out_of_stock:de},"totalDataPerIndex")}),500);return()=>clearTimeout(e)}}),[b]);const ce="default"===h?t.jsx("div",{className:"sledge-instant-search__result-tab-list sledge-instant-search__result-tab-list-skeleton",children:[1,2,3,4,5].map((e=>t.jsx(tl.Item,{width:"122px",height:"28px",rounded:"md",color:"grey-100",animationDuration:"15s"},e)))}):null,ue=(null==(s=null==ee?void 0:ee.filter)?void 0:s.enable_on_search)&&"horizontal"===(null==(l=null==ee?void 0:ee.filter)?void 0:l.layout)?t.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-skeleton",children:[1,2,3,4,5,6,7].map((e=>t.jsx(tl.Item,{width:"106px",height:"42px",rounded:"md",color:"grey-100",animationDuration:"13s"},e)))}):null,ge=(null==(n=null==ee?void 0:ee.filter)?void 0:n.enable_on_search)&&"vertical"===(null==(d=null==ee?void 0:ee.filter)?void 0:d.layout)?t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px",justifyContent:"space-between",marginBottom:"23px"},children:[t.jsx(tl.Item,{width:"117px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"15s"}),t.jsx(tl.Item,{width:"80px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"15s"})]}),t.jsx(tl.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"18px"}}),[1,2,3].map((e=>t.jsx(tl.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}},e))),t.jsx(tl.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"18px"}}),t.jsx(tl.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"14px"}}),t.jsx(tl.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}}),t.jsx(tl.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"17px"}}),t.jsx(tl.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"38px"}}),t.jsx(tl.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"35px"}}),t.jsx(tl.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"12px"}}),t.jsx(tl.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}}),t.jsx(tl.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"20px"}}),t.jsx(tl.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"12px"}}),[1,2,3].map((e=>t.jsx(tl.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}},e))),t.jsx(tl.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"11px"}}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"12px"},children:[1,2,3,4,5,6,7,8,9].map((e=>t.jsx(tl.Item,{width:"34px",height:"34px",color:"grey-100",rounded:"full",animationDuration:"40s"},e)))})]}):null,he=t.jsxs(t.Fragment,{children:[(null==(r=null==ee?void 0:ee.filter)?void 0:r.show_total_products)&&"vertical"===(null==(a=null==ee?void 0:ee.filter)?void 0:a.layout)?t.jsx(tl.Item,{width:"117px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{marginBottom:"21px"}}):null,t.jsx(tl.ProductGrid,{count:12,type:"large"})]}),pe=t.jsxs("div",{className:"sledge-instant-search__result-data-keyword",children:[(null==(o=null==ee?void 0:ee.filter)?void 0:o.show_total_products)&&"horizontal"===(null==(c=null==ee?void 0:ee.filter)?void 0:c.layout)?t.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-horizontal",children:t.jsx(tl.Item,{width:"117px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"13s"})}):null,t.jsx("div",{className:"sledge-instant-search__result-data-keyword-form",children:t.jsx(tl.Item,{width:"100%",height:"42px",color:"grey-100",rounded:"lg",style:{maxWidth:"630px"}})}),t.jsxs("div",{className:"sledge-instant-search__result-data-summary-item sledge-instant-search__result-data-summary-select-field",children:[t.jsx("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:t.jsx(tl.Item,{width:"150px",height:"42px",color:"grey-100",rounded:"lg"})}),t.jsx("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:t.jsx(tl.Item,{width:"150px",height:"42px",color:"grey-100",rounded:"lg"})})]})]});return t.jsxs("div",{className:"sledge-instant-search__result-container",children:[L?null:t.jsx("div",{className:""+("default"===h&&(null==$?void 0:$.length)?"sledge-instant-search__result-tab":"sledge-instant-search__result-tab-no-index"),children:"default"===h&&(null==$?void 0:$.length)?t.jsx("ul",{className:"sledge-instant-search__result-tab-list",children:$.map((e=>{const{name:i,index:s,total:l}=e;let n=I===s;return t.jsxs("li",{onClick:e=>((e,i,s)=>{O(e),k(i),M(e.includes(J)?t.jsx(Pi,{}):t.jsx(ki,{}))})(s,i),className:""+(n?"sledge-instant-search__result-tab-list-item-active":""),children:[i,t.jsx("span",{className:"sledge-instant-search__result-tab-total",children:l||0})]},s)}))}):null}),L&&(null==h?void 0:h.length)?t.jsxs(t.Fragment,{children:[ce,ue,t.jsxs("div",{className:"sledge-instant-search__result-wrapper sledge-instant-search__result-wrapper-skeleton",children:[(null==(u=null==ee?void 0:ee.filter)?void 0:u.enable_on_search)&&"vertical"===(null==(g=null==ee?void 0:ee.filter)?void 0:g.layout)?t.jsx("div",{className:"sledge-instant-search__result-filter",children:ge}):null,t.jsxs("div",{className:"sledge-instant-search__result-data",children:[pe,he]})]})]}):e.cloneElement(D,{isLoading:T,keyword:b,clickedTabIndexId:I,clickedTabIndexName:P,isLoadingSetting:W,allowedSorts:H,allowedFilters:F,facets:q,searchResultFacets:K,hiddenTags:X,displaySettings:ee,colorSwatches:ie,defaultSort:le,showOutOfStock:de,query:p,data:m,separateJsVersionComponent:S,productCardsComponent:y,onAfterAddToCart:v,onAfterAddWishlist:w,onAfterRemoveWishlist:x,onAfterRenderProduct:f,setIsLoading:E,setKeyword:R,filterHorizontalSkeleton:ue,filterVerticalSkeleton:ge,productGridSkeleton:he,searchAndSelectOptionSkeleton:pe})]})},Pi=i=>{var s,l,n,d,r,a,o,c,u,g,h,p,m,_,v,w,x,f,j,C;const{keyword:y,clickedTabIndexId:S,isLoadingSetting:N,allowedSorts:L,allowedFilters:A,facets:T,searchResultFacets:E,hiddenTags:b,displaySettings:R,colorSwatches:I,defaultSort:O,showOutOfStock:P,query:k,data:D,separateJsVersionComponent:M,productCardsComponent:W,setKeyword:B,filterHorizontalSkeleton:H,filterVerticalSkeleton:U,productGridSkeleton:F,searchAndSelectOptionSkeleton:G,onAfterAddToCart:$,onAfterAddWishlist:V,onAfterRemoveWishlist:q,onAfterRenderProduct:z}=i||{},{keyword:J=""}=k||{},{collectionId:Z}=D||{},[K,Y]=e.useState(!0),[X,ee]=e.useState(!0),[te,ie]=e.useState(!1),[se,le]=e.useState(!1),[ne,de]=e.useState(O||""),[re,ae]=e.useState(L&&Boolean(null==L?void 0:L.length)?null==(s=L.find((({value:e})=>e===O)))?void 0:s.label:""),[oe,ce]=e.useState((null==(l=null==R?void 0:R.search)?void 0:l.limit)||10),[ue,ge]=e.useState(null),[he,pe]=e.useState({...P?{}:{"variants.inventory_quantity":"> 0"}}),[me,_e]=e.useState(!1),[ve,we]=e.useState([]),[xe,fe]=e.useState(0),[je,Ce]=e.useState(1),[ye,Se]=e.useState(0),[Ne,Le]=e.useState(0),[Ae,Te]=e.useState([]),[Ee,be]=e.useState([]),[Re,Ie]=e.useState(!1),[Oe,Pe]=e.useState(null),ke=Ut({keyword:y,clickedLimitId:oe,clickedFacets:he}),{color:De,font_size:Me,font_weight:We,text_transform:Be}=(null==(n=null==R?void 0:R.filter)?void 0:n.title)||{},{color:He,font_size:Ue,font_weight:Fe,text_transform:Ge}=(null==(d=null==R?void 0:R.filter)?void 0:d.option)||{},{text_color:$e,border_color:Ve,border_radius:qe,padding_top:ze,padding_bottom:Je,padding_left:Ze,padding_right:Ke,background_color:Ye,font_size:Qe,font_weight:et,text_transform:tt}=(null==(r=null==R?void 0:R.filter)?void 0:r.button)||{},st={...De&&{color:De},...Me&&{fontSize:Me},...We&&{fontWeight:We},...Be&&{textTransform:Be}},nt={...He&&{color:He},...Ue&&{fontSize:Ue},...Fe&&{fontWeight:Fe},...Ge&&{textTransform:Ge}},rt=e=>{var t;const i=new URLSearchParams(document.location.search),s=Object.fromEntries(i);let l={};for(const d in s){(null==T?void 0:T.length)&&!T.includes(d)&&(l[d]=s[d])}for(const d in e)(null==(t=e[d])?void 0:t.length)&&(l[d]=e[d]);const n=new URLSearchParams({...l}).toString();window.history.pushState(null,"",`${document.location.pathname}${(null==n?void 0:n.length)?`?${n}`:""}`)},ot=e=>{ge(e===ue?"":e)},ut=()=>{Ie(!0),pe({}),_e(!me),rt({}),Te([]),setTimeout((()=>{Ie(!1)}),10)},ht=(e,t,i=!1)=>{var s;Ie(!0);let l=[t],n=["variants.price"].includes(e);he&&(i?l=[t]:(null==(s=he[e])?void 0:s.includes(t))?l=he[e].filter((e=>e!==t)):n?(he[e],he[e]===t?(l=[],Te([])):l=t):l=he[e]?[...he[e],t]:[t]);let d={...he,[e]:l};rt(d),pe(d),_e(!me),setTimeout((()=>{Ie(!1)}),10)},pt=async(e=!1,i=!1)=>{if(!S)return;e&&Ce(1),ee(!0);let s,l=(e=>{const t=new URLSearchParams(document.location.search),i=Object.fromEntries(t);for(const s in i)(null==T?void 0:T.length)&&T.includes(s)&&(e[s]=i[s].split(","));return Object.keys(e).length&&pe(e),e})(he),n=Object.entries(l).map((e=>{var t,i;if((null==e?void 0:e.length)&&e[1].length){let s=e[0],l=["variants.inventory_quantity"].includes(s),n=["variants.price"].includes(s),d=["tags"].includes(s);return Array.isArray(e[1])&&(null==(t=e[1])?void 0:t.length)>1?n?`${s} >= ${e[1][0]} AND ${s} <= ${e[1][1]}`:d?`${s} IN [${e[1]}]`:null==(i=e[1])?void 0:i.map((e=>l?`${s} ${e}`:`${s} = '${e}'`)).join(" OR "):l?`${s} ${e[1]}`:d?`${s} IN [${e[1]}]`:`${s} = '${e[1]}'`}return null})).filter((e=>e));(null==b?void 0:b.length)&&n.push(`tags NOT IN [${b}]`),Z&&n.push(`collections.id = '${Z}'`);let d={q:y,sort:ne?[ne]:[],page:e?1:je,hitsPerPage:oe,facets:T,filter:n.join(" AND ")};s=await fi(S,d),((e,i)=>{var s;if(!e)return;const{hits:l,processingTimeMs:n,totalHits:d,totalPages:r}=e;i&&(null==y?void 0:y.length)&&Ci({keyword:y,resultCount:d||0}),Y(!1),ee(!1),we(l),fe(n||0),Se(r),Le(d||0),Pe(t.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:(null==(s=null==R?void 0:R.filter)?void 0:s.show_total_products)?t.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[d," result"," ",(null==y?void 0:y.length)?t.jsxs(t.Fragment,{children:["for ",t.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',y,'"']})]}):null]}):null}))})(s,i)},_t=e=>{const t=new URLSearchParams(document.location.search);t.set(J,e),B&&B(e),window.history.pushState(null,"",`${document.location.pathname}?${t.toString()}`)};e.useEffect((()=>{let e=Boolean(ke&&((null==ke?void 0:ke.keyword)!==y||(null==ke?void 0:ke.clickedLimitId)!==oe||(null==ke?void 0:ke.clickedFacets)!==he));if(Boolean(ke&&(null==ke?void 0:ke.keyword)!==y)){const e=setTimeout((()=>{pt(!0,!0)}),500);return()=>clearTimeout(e)}pt(e)}),[ne,oe,me,y,je,S]),e.useEffect((()=>{(()=>{var e,t;if(!(null==(e=null==R?void 0:R.filter)?void 0:e.enable_on_search)||(null==(t=null==R?void 0:R.filter)?void 0:t.hide_when_one_value)&&Ne<=1)return;let i=!1;i||null==A||A.map((e=>{const{collections:t,items:s}=e;(Z&&(null==t?void 0:t.includes(Number(Z)))||(null==t?void 0:t.includes("all")))&&(i=!0,be(s))}))})()}),[A,E,Ne]);const vt=({label:e,name:i,value:s,index:l})=>{var n;let d=s;return["variants.price"].includes(i)&&(d=null==s?void 0:s.join(" - ")),t.jsxs("div",{className:"sledge-instant-search__result-filter-item-refine-selected",style:nt,children:[t.jsxs("span",{className:"sledge-instant-search__result-filter-item-title-refine-list",children:[e,": ",null==(n=String(d))?void 0:n.replaceAll("_"," ")]}),t.jsx("span",{className:"sledge-instant-search__result-filter-item-refine-title-clear",onClick:()=>ht(i,s),children:t.jsx("svg",{width:12,height:12,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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"})})})]},l)},wt=e=>{var i,s;const{value:l,label:n,display:d}=e;let r=null,a=E[l],o=null==(i=null==R?void 0:R.filter)?void 0:i.show_number_matching_product;return"slider"===d.toLowerCase()?r=t.jsxs("div",{className:"sledge-instant-search__result-filter-item-list-slider",children:[t.jsx(lt,{defaultValue:[Ae[0]||(null==a?void 0:a.min),Ae[1]||(null==a?void 0:a.max)],min:null==a?void 0:a.min,max:null==a?void 0:a.max,step:1,setValueCommit:e=>ht(l,e),setValueChange:e=>Te(e)}),t.jsxs("div",{className:"sledge-instant-search__result-filter-item-list-slider-minmax",children:[t.jsx("div",{className:"sledge-instant-search__result-filter-minmax-field",children:Ae[0]||(null==a?void 0:a.min)}),t.jsx("div",{className:"sledge-instant-search__result-filter-minmax-field",children:Ae[1]||(null==a?void 0:a.max)})]})]}):"checkbox"===d.toLowerCase()&&(null==a?void 0:a.length)?r=t.jsx(t.Fragment,{children:null==a?void 0:a.map(((e,i)=>{var s;return t.jsx("li",{children:t.jsx(it,{id:`${l}_${i}`,name:l,value:e.value,label:`${e.name}${void 0!==e.total&&o?` (${e.total})`:""}`,onClick:e=>ht(l,e.currentTarget.value),defaultChecked:he&&(null==(s=he[l])?void 0:s.includes(e.value)),labelStyle:nt})},i)}))}):"radio"===d.toLowerCase()&&(null==a?void 0:a.length)?r=t.jsx("li",{children:t.jsx(at,{id:l,name:l,onValueChange:e=>ht(l,e,!0),items:null==a?void 0:a.map((e=>{const{name:t,value:i,total:s}=e;return{label:`${t} ${void 0!==s&&o?` (${s})`:""}`,value:i}})),defaultValue:he&&(null==(s=he[l])?void 0:s.length)?he[l][0]:"",labelStyle:nt})}):"select"===d.toLowerCase()&&(null==a?void 0:a.length)?r=t.jsx("li",{children:t.jsx(gt,{placeholder:`Select ${n}`,name:l,onValueChange:e=>ht(l,e,!0),items:null==a?void 0:a.map((e=>{const{name:t,value:i,total:s}=e;return{label:`${t} ${void 0!==s&&o?` (${s})`:""}`,value:i}})),labelStyle:nt})}):"swatch"===d.toLowerCase()&&(null==a?void 0:a.length)&&(r=t.jsx(t.Fragment,{children:null==a?void 0:a.map(((e,i)=>{var s;let n=(null==I?void 0:I.filter((({name:t})=>null==t?void 0:t.includes(e.value)))[0])||{};return t.jsx("li",{children:t.jsx(ct,{id:`${l}_${i}`,name:l,value:e.value,rgb:null==n?void 0:n.rgb,image:null==n?void 0:n.image,onClick:e=>ht(l,e.currentTarget.value),defaultChecked:he&&(null==(s=he[l])?void 0:s.includes(e.value))})},i)}))})),r},xt=Ee.map(((e,i)=>{const{value:s,label:l,display:n}=e;let d=ue===s,r=E[s],a=Boolean("slider"===n.toLowerCase()?r:null==r?void 0:r.length),o=["select"].includes(n.toLowerCase())&&(null==r?void 0:r.length),c=["sledge-instant-search__result-filter-item-list"],u=wt(e);return"swatch"===n.toLowerCase()&&(null==r?void 0:r.length)&&c.push("sledge-instant-search__result-filter-item-color-swatches"),a?t.jsxs("div",{className:"sledge-instant-search__result-filter-item",children:[t.jsxs("div",{className:"sledge-instant-search__result-filter-item-title",onClick:()=>ot(s),children:[t.jsx("span",{className:"sledge-instant-search__result-filter-title",style:st,children:l}),t.jsx(Q.div,{initial:!1,animate:d?"open":"closed",variants:Jt,children:t.jsx(mt,{width:15,height:15,color:"#000000"})})]}),d&&t.jsx("ul",{className:c.join(" "),children:o?u:Re?null:u})]},i):null})),ft=Ee.map(((e,i)=>{const{value:s,label:l,display:n}=e;let d=ue===s,r=E[s],a=Boolean("slider"===n.toLowerCase()?r:null==r?void 0:r.length),o=["radio","select"].includes(n.toLowerCase())&&(null==r?void 0:r.length),c=["sledge-instant-search__result-filter-item-list"],u=wt(e);return"swatch"===n.toLowerCase()&&(null==r?void 0:r.length)&&c.push("sledge-instant-search__result-filter-item-color-swatches"),a?t.jsx("div",{className:"",children:t.jsx(Xe,{trigger:t.jsxs(Lt,{type:"button",onClick:()=>ot(s),children:[l,t.jsx(Q.div,{initial:"closed",animate:d?"open":"closed",variants:Jt,className:"sort-trigger-icon",children:t.jsx(mt,{width:20,height:20,color:"#000000"})})]}),content:t.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-facet",children:d&&t.jsx("ul",{className:c.join(" "),children:o?u:Re?null:u})}),withOpenState:!1,setIsOpen:e=>ge(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>'})},i):null}));let jt=[];Object.entries(he).map((e=>{var t,i;if((null==e?void 0:e.length)&&e[1].length){let s=e[0];if(["variants.inventory_quantity"].includes(s))return;let l=["variants.price"].includes(s),n=Ee.filter((({value:e})=>null==e?void 0:e.includes(s))),d=(null==n?void 0:n.length)?n[0].label:s;return Array.isArray(e[1])&&(null==(t=e[1])?void 0:t.length)>1?l?jt.push({label:d,name:s,value:e[1]}):null==(i=e[1])?void 0:i.map((e=>{jt.push({label:d,name:s,value:e})})):jt.push({label:d,name:s,value:e[1][0]})}}));const Ct=t.jsx(dt,{currentPage:je,totalPage:ye,totalResult:Ne,onChange:e=>(e=>{Ce(e)})(e)});return t.jsxs(t.Fragment,{children:[(null==(a=null==R?void 0:R.filter)?void 0:a.enable_on_search)&&"horizontal"===(null==(o=null==R?void 0:R.filter)?void 0:o.layout)?t.jsx(t.Fragment,{children:K?H:t.jsx(t.Fragment,{children:N?t.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-loading",children:H}):ft.every((e=>!e))?null:t.jsxs("div",{className:"sledge-instant-search__result-filter-horizontal-wrapper",children:[t.jsx("div",{className:"sledge-instant-search__result-filter-horizontal",children:ft}),Boolean((null==jt?void 0:jt.length)&&(null==(c=null==R?void 0:R.filter)?void 0:c.show_refine_by_block))?t.jsx(t.Fragment,{children:Boolean(jt.every((e=>!e)))?null:t.jsxs("div",{className:"sledge-instant-search__result-filter-horizontal",children:[t.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-refine-item sledge-instant-search__result-filter-horizontal-refine-item-clear-all",onClick:ut,children:"Clear All"}),jt.map(((e,t)=>{const{label:i,name:s,value:l}=e;return vt({label:i,name:s,value:l,index:t})}))]})}):null]})})}):null,t.jsx("div",{className:"sledge-instant-search__result-wrapper","data-filter-layout":null==(u=null==R?void 0:R.filter)?void 0:u.layout,children:t.jsxs(t.Fragment,{children:[(null==(g=null==R?void 0:R.filter)?void 0:g.enable_on_search)&&"vertical"===(null==(h=null==R?void 0:R.filter)?void 0:h.layout)?K?t.jsx("div",{className:"sledge-instant-search__result-filter",children:U}):xt.every((e=>!e))?null:t.jsx("div",{className:"sledge-instant-search__result-filter",children:N?U:t.jsxs(t.Fragment,{children:[Boolean((null==jt?void 0:jt.length)&&(null==(p=null==R?void 0:R.filter)?void 0:p.show_refine_by_block))?Boolean(jt.every((e=>!e)))?null:t.jsxs("div",{className:"sledge-instant-search__result-filter-item",children:[t.jsxs("div",{className:"sledge-instant-search__result-filter-item-title-refine",children:[t.jsx("strong",{className:"sledge-instant-search__result-filter-item-title-refine-heading",children:"Filter"}),t.jsx("span",{className:"sledge-instant-search__result-filter-item-title-refine-clear",onClick:ut,children:"Clear All"})]}),t.jsx("div",{className:"sledge-instant-search__result-filter-item-refine-selected-flex",children:jt.map(((e,t)=>{const{label:i,name:s,value:l}=e;return vt({label:i,name:s,value:l,index:t})}))})]}):null,xt]})}):null,t.jsxs("div",{className:"sledge-instant-search__result-data",children:[K?G:t.jsxs("div",{className:"sledge-instant-search__result-data-keyword",children:["horizontal"===(null==(m=null==R?void 0:R.filter)?void 0:m.layout)&&t.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-horizontal",children:Oe}),t.jsx(Tt,{type:"text",icon:t.jsx(St,{width:18,height:18,color:"#868686"}),placeholder:"Search products...",value:y,onChange:({value:e})=>_t(e),onResetField:()=>_t(""),className:"sledge-instant-search__result-data-keyword-form",withClearField:!0}),t.jsxs("div",{className:"sledge-instant-search__result-data-summary-item sledge-instant-search__result-data-summary-select-field",children:[t.jsxs("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:[t.jsx("span",{children:"Sort by:"}),L&&Boolean(null==L?void 0:L.length)&&t.jsx(bt,{align:"end",prefixLabel:t.jsx("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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:L.map((e=>{const{label:t,value:i}=e;return{label:t,value:i}})),value:ne,onChange:({label:e,value:t})=>((e,t)=>{ie(!1),ae(e),de(t)})(e,t)})]}),t.jsxs("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:[t.jsx("span",{children:"Limit:"}),(null==(_=null==R?void 0:R.search)?void 0:_.allowed_limit)&&Boolean(null==(w=null==(v=null==R?void 0:R.search)?void 0:v.allowed_limit)?void 0:w.length)&&t.jsx(bt,{align:"end",options:R.search.allowed_limit.map((e=>({label:e,value:e}))),value:oe,onChange:({value:e})=>(e=>{le(!1),ce(e)})(e)})]})]})]}),X?t.jsxs(t.Fragment,{children:[F,(null==ve?void 0:ve.length)?Ct:null]}):t.jsxs(t.Fragment,{children:["vertical"===(null==(x=null==R?void 0:R.filter)?void 0:x.layout)&&t.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-vertical",children:Oe}),(null==ve?void 0:ve.length)?t.jsxs(t.Fragment,{children:[t.jsx(Os,{sourceApp:"instant-search",type:"large",data:ve.map((e=>{const{variants:t,...i}=e||{};return{product:i,variants:t}})),setting:{show_vendor:null==(f=null==R?void 0:R.search)?void 0:f.show_vendor,show_sku:null==(j=null==R?void 0:R.search)?void 0:j.show_sku,show_price:null==(C=null==R?void 0:R.search)?void 0:C.show_price},isComponentJsVersion:M,cards:W,showOptionOutOfStock:!0,onAfterAddToCart:$,onAfterAddWishlist:V,onAfterRemoveWishlist:q,onAfterRenderProduct:z}),Ct]}):t.jsx(Di,{})]})]})]})})]})},ki=i=>{var s,l,n,d;const{keyword:r,clickedTabIndexId:a,clickedTabIndexName:o,setKeyword:c}=i||{},[u,g]=e.useState(!0),[h,p]=e.useState(!0),[m,_]=e.useState(""),[v,w]=e.useState([]),[x,f]=e.useState(0),[j,C]=e.useState(1),[y,S]=e.useState(0),[N,L]=e.useState(0),[A,T]=e.useState(null),E=Ut({keyword:r}),b=async()=>{if(!a)return;let e;p(!0);let i={q:r,sort:m?[m]:[],page:j,hitsPerPage:12};e=await fi(a,i),(e=>{if(!e)return;const{hits:i,processingTimeMs:s,totalHits:l,totalPages:n}=e;g(!1),p(!1),w(i),f(s||0),S(n),L(l||0),T(t.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:t.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[l," result"," ",(null==r?void 0:r.length)?t.jsxs(t.Fragment,{children:["for ",t.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',r,'"']})]}):null]})}))})(e)};e.useEffect((()=>{if(Boolean(E&&(null==E?void 0:E.keyword)!==r)){const e=setTimeout((()=>{b()}),500);return()=>clearTimeout(e)}b()}),[m,r,j,a]);const R=t.jsx("div",{className:"sledge-instant-search__result-data-keyword sledge-instant-search__result-data-keyword-category",children:t.jsx(Tt,{type:"text",icon:t.jsx(St,{width:18,height:18,color:"#868686"}),placeholder:`Search ${o?o.toLowerCase():""}...`,value:r,onChange:({value:e})=>c&&c(e),onResetField:()=>c&&c(""),className:"sledge-instant-search__result-data-keyword-form",withClearField:!0})}),I=t.jsx("div",{className:"sledge-instant-search__result-data-summary",children:t.jsx(tl.Item,{width:"117px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"18s"})}),O=(null==(s=String(a))?void 0:s.includes("collection"))?t.jsx(tl.CollectionGrid,{count:3}):(null==(l=String(a))?void 0:l.includes("page"))?t.jsx(tl.PageGrid,{count:12}):(null==(n=String(a))?void 0:n.includes("blog"))||(null==(d=String(a))?void 0:d.includes("article"))?t.jsx(tl.BlogGrid,{count:12}):null,P=()=>t.jsxs("div",{className:"sledge-instant-search__result-data-category-wrapper",children:[R,I,O]}),k=()=>t.jsxs(t.Fragment,{children:[R,I,O]}),D=e=>{var i,s,l,n;return(null==(i=String(a))?void 0:i.includes("collection"))?t.jsx(Bs,{...e}):(null==(s=String(a))?void 0:s.includes("page"))?t.jsx(Us,{...e}):(null==(l=String(a))?void 0:l.includes("blog"))||(null==(n=String(a))?void 0:n.includes("article"))?t.jsx(Gs,{...e}):null};return t.jsx("div",{className:"sledge-instant-search__result-wrapper",children:u?t.jsx(P,{}):t.jsx("div",{className:"sledge-instant-search__result-data-category-wrapper",children:h?t.jsx(k,{}):t.jsxs(t.Fragment,{children:[R,t.jsx("div",{className:"sledge-instant-search__result-data-summary",children:A}),(null==v?void 0:v.length)?t.jsxs(t.Fragment,{children:[t.jsx(D,{data:v.map((e=>{const{id:t,title:i,url:s}=e;return{id:t,title:i,description:`${i}${o?` ${o.toLowerCase()}`:""}`,url:s,image:""}}))}),t.jsx(dt,{currentPage:j,totalPage:y,totalResult:N,onChange:e=>(e=>{C(e)})(e)})]}):t.jsx(Di,{})]})})})},Di=i=>{const[s,l]=e.useState(""),[n,d]=e.useState("");return e.useEffect((()=>{l("No results found"),d("Your search did not match any results. <br/> Please try again")}),[]),t.jsxs("div",{className:"sledge-instant-search__result-empty",children:[t.jsx("div",{className:"sledge-instant-search__result-empty-title",dangerouslySetInnerHTML:{__html:s}}),t.jsx("div",{className:"sledge-instant-search__result-empty-description",dangerouslySetInnerHTML:{__html:n}})]})},Mi=()=>{let i=document.querySelector(Re.INSTANT_SEARCH.ELEMENT_SEARCH_RESULT_WIDGET);je(i,(()=>{var s,l,n,d;if(i){const r=i.getAttribute(Te.INSTANT_SEARCH.QUERY_KEYWORD),a=i.getAttribute(Te.GLOBAL.ON_AFTER_ADD_TO_CART),o=i.getAttribute(Te.GLOBAL.ON_AFTER_ADD_WISHLIST),u=i.getAttribute(Te.GLOBAL.ON_AFTER_REMOVE_WISHLIST),g=i.getAttribute(Te.GLOBAL.ON_AFTER_RENDER_PRODUCT),h=null==(s=i.querySelector(Re.GLOBAL.ELEMENT_PRODUCT_CARDS))?void 0:s.getAttribute(Te.GLOBAL.RENDER_COMPONENT);null==(l=i.querySelector(Re.GLOBAL.ELEMENT_SUGGESTION_KEYWORD_LISTS))||l.getAttribute(Te.GLOBAL.RENDER_COMPONENT),null==(n=i.querySelector(Re.GLOBAL.ELEMENT_OTHER_INDEX_LISTS))||n.getAttribute(Te.GLOBAL.RENDER_COMPONENT),null==(d=i.querySelector(Re.GLOBAL.ELEMENT_SEARCH_VIEW_MORE_RESULT))||d.getAttribute(Te.GLOBAL.RENDER_COMPONENT),i.innerHTML="",c.createRoot(i).render(t.jsx(e.StrictMode,{children:t.jsx(Fi.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0}},children:t.jsx(Oi,{query:{keyword:r||""},onAfterAddToCart:e=>{i&&a&&eval(a)({element:i,state:e})},onAfterAddWishlist:e=>{i&&o&&eval(o)({element:i,state:e})},onAfterRemoveWishlist:e=>{i&&u&&eval(u)({element:i,state:e})},onAfterRenderProduct:e=>{i&&g&&eval(g)({element:i,state:e})},children:t.jsx(Gi,{component:h?eval(h):null,isJsVersion:!0})})})}))}}))},Wi="",Bi=i=>{var s,l,n,d,r,a,o,c,u,g,h,p,m,_,v,w,x,f,j,C,y;const{width:S="400px",children:N,onAfterAddToCart:L,onAfterAddWishlist:A,onAfterRemoveWishlist:T,onAfterRenderProduct:E}=i;let b=null,R=null,I=null,O=null,P=!1;e.Children.map(N,(t=>{if(e.isValidElement(t)&&ye(t.type)){const{component:e,isJsVersion:i}=(null==t?void 0:t.props)||{};switch(P=i,t.type.name){case ke.PRODUCT.CARDS:b=e;break;case ke.SUGGESTION_KEYWORD_LISTS:R=e;break;case ke.OTHER_INDEX_LISTS:I=e;break;case ke.SEARCH_VIEW_MORE_RESULT:O=e}}}));const{isRenderApp:k}=e.useContext(Fi),[D,M]=e.useState(!0),[W,B]=e.useState(""),[H,U]=e.useState(""),[F,G]=e.useState([]),[$,V]=e.useState([]),[q,z]=e.useState([]),[J,Z]=e.useState([]),[K,Y]=e.useState({}),[X,ee]=e.useState({}),[te,ie]=e.useState(""),se=Ut({keyword:W}),le=async(e,t=!1)=>{var i,s,l,n,d,r,a,o,c,u,g;if(!W.length)return;M(!0);const{tabs:h,suffix_index_product:p,hidden_tags:m,display:_}=e,v=(null==(i=null==_?void 0:_.search)?void 0:i.suggestion)||{};let w,x={queries:h.map((e=>{var t;const{index:i}=e;let s=i.includes(p),l=[];return(null==m?void 0:m.length)&&l.push(`tags NOT IN [${m}]`),(null==(t=null==_?void 0:_.filter)?void 0:t.show_out_of_stock)||l.push("variants.inventory_quantity > 0"),{indexUid:i,q:W,hitsPerPage:s?6:4,filter:s?l.join(" AND "):""}}))};if(w=await ji(x),!w)return;const{results:f}=w;let j=null==f?void 0:f.filter((({indexUid:e})=>null==e?void 0:e.includes(p)));t&&(null==W?void 0:W.length)&&Ci({keyword:W,resultCount:(null==(s=j[0])?void 0:s.totalHits)||0});let C=(null==(l=null==f?void 0:f.filter((({indexUid:e})=>!(null==e?void 0:e.includes(p)))))?void 0:l.map((e=>{const{indexUid:t}=e,{name:i}=null==h?void 0:h.find((({index:e})=>e.includes(t)));return{...e,name:i||""}})))||[],y=(null==j?void 0:j.length)?null==(n=j[0])?void 0:n.hits:[],S=W.length?(null==y?void 0:y.length)?"":"no_result":"zero_character",N=Boolean(!W.length&&Object.keys(v).length&&(null==(r=null==(d=v[S])?void 0:d.products)?void 0:r.active)&&(null==(c=null==(o=null==(a=v[S])?void 0:a.products)?void 0:o.list)?void 0:c.length));G(N?null==(g=null==(u=v[S])?void 0:u.products)?void 0:g.list:y),V(C),ie(S),M(!1)};e.useEffect((()=>{(null==k?void 0:k.instantSearch)&&(async e=>{var t;if(!W.length)return;let i,s=!1;if(i=JSON.parse(e),!i)return;const{status:l,data:n}=i,{code:d}=l,{tabs:r,suffix_index_product:a,hidden_tags:o,display:c}=n;s=200===d||!1,s&&(z(r),U(a),Z(o),Y(c),ee(null==(t=null==c?void 0:c.search)?void 0:t.suggestion),await le(n))})(localStorage.getItem(Ee.INSTANT_SEARCH_SETTING)||"")}),[W]),e.useEffect((()=>{if(Boolean(se&&(null==se?void 0:se.keyword)!==W)){const e=setTimeout((()=>{le({tabs:q,suffix_index_product:H,hidden_tags:J,display:K},!0)}),500);return()=>clearTimeout(e)}}),[W]);const ne={maxWidth:S};return t.jsxs("div",{className:"sledge-instant-search__widget-search-form-wrapper",style:ne,children:[t.jsx(Tt,{type:"text",icon:t.jsx(St,{width:18,height:18,color:"#868686"}),placeholder:"Search anything",value:W,onChange:({value:e})=>B(e),onResetField:()=>B(""),withClearField:!0}),t.jsx(Q.div,{initial:"hidden",animate:W.length?"visible":"hidden",variants:Zt,className:"sledge-instant-search__widget-search-form-result",children:D?t.jsx(zs,{children:t.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex",children:[t.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((i=>t.jsxs(e.Fragment,{children:[t.jsx(tl.Item,{width:"100%",height:"42px",color:"grey-100",rounded:"md",...Boolean(i)&&{style:{marginTop:"12px"}}}),t.jsx("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",gap:"12px",marginTop:"12px"},children:[1,2,3].map((e=>t.jsx(tl.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{maxWidth:"140px"}},e)))})]},i)))}),t.jsx("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-product",children:t.jsx(tl.ProductGrid,{count:6,type:"small"})})]})}):t.jsx(zs,{isLoading:D,withCorner:!1,children:t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex",children:[t.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-other",children:[Object.keys(X).length&&(null==(l=null==(s=X[te])?void 0:s.keywords)?void 0:l.active)&&(null==(r=null==(d=null==(n=X[te])?void 0:n.keywords)?void 0:d.list)?void 0:r.length)?t.jsx(Ti.SuggestionKeywordLists,{listsComponent:R,keywords:X[te].keywords.list,isComponentJsVersion:P}):null,$.map(((i,s)=>{const{hits:l,name:n}=i;return t.jsx(e.Fragment,{children:t.jsx(Ti.OtherIndexLists,{listsComponent:I,name:n,items:l,isComponentJsVersion:P})},s)}))]}),t.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-product",children:[t.jsx("div",{className:"sledge-instant-search__widget-search-form-result-title-product",children:"Products"}),(null==F?void 0:F.length)?t.jsx("div",{className:"sledge-instant-search__widget-search-form-result-product",children:t.jsx(Os,{sourceApp:"instant-search",type:"small",data:F.map((e=>{const{variants:t,...i}=e||{};return{product:i,variants:t}})),setting:{show_vendor:null==(a=null==K?void 0:K.search)?void 0:a.show_vendor,show_sku:null==(o=null==K?void 0:K.search)?void 0:o.show_sku,show_price:null==(c=null==K?void 0:K.search)?void 0:c.show_price},showOptionOutOfStock:!0,isComponentJsVersion:P,cards:b,onAfterAddToCart:L,onAfterAddWishlist:A,onAfterRemoveWishlist:T,onAfterRenderProduct:E})}):Object.keys(X).length&&(null==(g=null==(u=X[te])?void 0:u.products)?void 0:g.active)&&(null==(m=null==(p=null==(h=X[te])?void 0:h.products)?void 0:p.list)?void 0:m.length)?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-product-suggestion-no-result-text",children:[t.jsx("span",{children:"Sorry, nothing found for"})," ",t.jsx("strong",{children:W}),". ",t.jsx("span",{children:"Did you mean:"})]}),t.jsx(Os,{sourceApp:"instant-search",type:"small",data:X[te].products.list.map((e=>{const{variants:t,...i}=e||{};return{product:i,variants:t}})),setting:{show_vendor:null==(_=null==K?void 0:K.search)?void 0:_.show_vendor,show_sku:null==(v=null==K?void 0:K.search)?void 0:v.show_sku,show_price:null==(w=null==K?void 0:K.search)?void 0:w.show_price},showOptionOutOfStock:!0,isComponentJsVersion:P,cards:b,onAfterAddToCart:L,onAfterAddWishlist:A,onAfterRemoveWishlist:T,onAfterRenderProduct:E})]}):t.jsx("div",{className:"sledge-instant-search__widget-search-form-result-product-disabled",children:"No product were found"})]})]}),(null==F?void 0:F.length)||Object.keys(X).length&&(null==(f=null==(x=X[te])?void 0:x.products)?void 0:f.active)&&(null==(y=null==(C=null==(j=X[te])?void 0:j.products)?void 0:C.list)?void 0:y.length)?t.jsx("div",{className:"sledge-instant-search__widget-button-more-wrapper",children:t.jsx(Ti.SearchViewMoreResult,{component:O,keyword:W,isComponentJsVersion:P})}):null]})})})]})},Hi=()=>{let i=document.querySelector(Re.INSTANT_SEARCH.ELEMENT_SEARCH_WIDGET);je(i,(()=>{var s,l,n,d;if(i){const r=i.getAttribute(Te.GLOBAL.WIDTH_ELEMENT),a=i.getAttribute(Te.GLOBAL.ON_AFTER_ADD_TO_CART),o=i.getAttribute(Te.GLOBAL.ON_AFTER_ADD_WISHLIST),u=i.getAttribute(Te.GLOBAL.ON_AFTER_REMOVE_WISHLIST),g=i.getAttribute(Te.GLOBAL.ON_AFTER_RENDER_PRODUCT),h=null==(s=i.querySelector(Re.GLOBAL.ELEMENT_PRODUCT_CARDS))?void 0:s.getAttribute(Te.GLOBAL.RENDER_COMPONENT),p=null==(l=i.querySelector(Re.GLOBAL.ELEMENT_SUGGESTION_KEYWORD_LISTS))?void 0:l.getAttribute(Te.GLOBAL.RENDER_COMPONENT),m=null==(n=i.querySelector(Re.GLOBAL.ELEMENT_OTHER_INDEX_LISTS))?void 0:n.getAttribute(Te.GLOBAL.RENDER_COMPONENT),_=null==(d=i.querySelector(Re.GLOBAL.ELEMENT_SEARCH_VIEW_MORE_RESULT))?void 0:d.getAttribute(Te.GLOBAL.RENDER_COMPONENT);i.innerHTML="",c.createRoot(i).render(t.jsx(e.StrictMode,{children:t.jsx(Fi.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0}},children:t.jsxs(Bi,{width:r||"",onAfterAddToCart:e=>{i&&a&&eval(a)({element:i,state:e})},onAfterAddWishlist:e=>{i&&o&&eval(o)({element:i,state:e})},onAfterRemoveWishlist:e=>{i&&u&&eval(u)({element:i,state:e})},onAfterRenderProduct:e=>{i&&g&&eval(g)({element:i,state:e})},children:[t.jsx(Vi,{component:p?eval(p):null,isJsVersion:!0}),t.jsx($i,{component:m?eval(m):null,isJsVersion:!0}),t.jsx(Gi,{component:h?eval(h):null,isJsVersion:!0}),t.jsx(qi,{component:_?eval(_):null,isJsVersion:!0})]})})}))}}))},Ui=()=>{mi(),Mi(),bi(),Ri(),Hi()},Fi=e.createContext({apiKey:"",instantSearchApiKey:"",userId:"",userEmail:"",userFullname:"",isRenderApp:{wishlist:!1,productReview:!1,instantSearch:!1},triggerRenderMultipleComponent:{wishlist:{badge:{trigger:()=>{},value:!1}}},sledgeAnonymId:""}),Gi=({component:e})=>null,$i=({component:e})=>null,Vi=({component:e})=>null,qi=({component:e})=>null,zi=i=>{var s,l;const{sledgeAnonymId:n}=e.useContext(Fi),{isFirstLoading:d,isLoading:r,totalWishlist:a,isMaximizeTotalWishlist:o,proxyUrl:c,position:u="left",dataSettings:g}=i||{},{is_required_login:h}=(null==(s=null==g?void 0:g.display)?void 0:s.global)||{},{type:p}=(null==(l=null==g?void 0:g.display)?void 0:l.widget)||{},[m,_]=e.useState(!1);e.useEffect((()=>{_(n&&h)}),[n]);return t.jsx("div",{className:`sledge-wishlist__badge-floating sledge-wishlist__badge-floating-${u}`,children:t.jsxs("span",{onClick:e=>{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"}):("popup_window"===p&&"undefined"!=typeof window&&window.sledgeWishlistWidgetPopup&&window.sledgeWishlistWidgetPopup(),window.location.href="popup_window"===p?"#":c||"/")},className:"sledge-wishlist__badge-floating-icon-link",children:[t.jsx("span",{className:"sledge-wishlist__badge-floating-text",children:"My Wishlist"}),t.jsxs("span",{className:"sledge-wishlist__badge-icon",children:[t.jsx(pt,{width:18,height:18,type:"fill",color:"#000000"}),!d&&t.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-bottom-right "+(o?"sledge-wishlist__badge-fit-content":""),children:r||m?0:`${o?"99+":a}`||0})]})]})})},Ji=i=>{var s,l;const{sledgeAnonymId:n}=e.useContext(Fi),{isFirstLoading:d,isLoading:r,totalWishlist:a,isMaximizeTotalWishlist:o,proxyUrl:c,position:u="bottom-right",dataSettings:g}=i||{},{is_required_login:h}=(null==(s=null==g?void 0:g.display)?void 0:s.global)||{},{type:p}=(null==(l=null==g?void 0:g.display)?void 0:l.widget)||{},[m,_]=e.useState(!1);e.useEffect((()=>{_(n&&h)}),[n]);return t.jsx("div",{className:`sledge-wishlist__badge-floating-icon sledge-wishlist__badge-floating-${u}`,children:t.jsx("span",{onClick:e=>{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"}):("popup_window"===p&&"undefined"!=typeof window&&window.sledgeWishlistWidgetPopup&&window.sledgeWishlistWidgetPopup(),window.location.href="popup_window"===p?"#":c||"/")},className:"sledge-wishlist__badge-floating-icon-link",children:t.jsxs("span",{className:"sledge-wishlist__badge-icon",children:[t.jsx(pt,{width:27.01,height:25.73,type:"outline",color:"#000000"}),!d&&t.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-bottom-right "+(o?"sledge-wishlist__badge-fit-content":""),children:r||m?0:`${o?"99+":a}`||0})]})})})},Zi=i=>{var s,l;const{sledgeAnonymId:n}=e.useContext(Fi),{isFirstLoading:d,isLoading:r,totalWishlist:a,isMaximizeTotalWishlist:o,proxyUrl:c,dataSettings:u}=i||{},{is_required_login:g}=(null==(s=null==u?void 0:u.display)?void 0:s.global)||{},{type:h}=(null==(l=null==u?void 0:u.display)?void 0:l.widget)||{},p="#000000",[m,_]=e.useState(p),[v,w]=e.useState(!1);e.useEffect((()=>{w(n&&g)}),[n]);return t.jsxs("span",{className:"sledge-wishlist__badge",onClick:e=>{e.preventDefault(),e.stopPropagation(),v?"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"}):("popup_window"===h&&"undefined"!=typeof window&&window.sledgeWishlistWidgetPopup&&window.sledgeWishlistWidgetPopup(),window.location.href="popup_window"===h?"#":c||"/")},onMouseEnter:()=>_("#F85538"),onMouseLeave:()=>_(p),children:[t.jsx(pt,{width:20,height:20,type:"outline",color:m}),!d&&t.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-header-menu "+(o?"sledge-wishlist__badge-fit-content":""),children:r||v?0:`${o?"99+":a}`||0})]})},Ki=async e=>{const{page:t,limit:i,sort:s,keyword:l,shareId:n}=e||{};let d=localStorage.getItem(Ee.AUTH_APP),r="?"+new URLSearchParams({page:t||"",limit:i||"",sort:s||"",keyword:l||"",share_id:n||""}).toString();var a=new Headers;a.append("Authorization",`Bearer ${d}`);var o={method:"GET",headers:a,redirect:"follow"};return await fetch(`${Se}/wishlist${r}`,o).then((e=>e.json())).then((e=>e)).catch((()=>{}))},Yi=async e=>{const{productId:t,productVariantId:i,productName:s,productVendor:l,productSku:n,productVariantName:d,productLink:r,productImage:a,productCurrency:o,productPrice:c}=e;let u=localStorage.getItem(Ee.AUTH_APP);var g=new Headers;g.append("Authorization",`Bearer ${u}`),g.append("Content-Type","application/json");var h={method:"POST",headers:g,body:JSON.stringify({product:{id:xe(t),variant_id:xe(i),name:s,vendor:l,sku:n,variant_name:d,url:r,image_url:a,currency:o,price:c}}),redirect:"follow"};return await fetch(`${Se}/wishlist`,h).then((e=>e.json())).then((e=>e)).catch((()=>{}))},Xi=async e=>{let t=localStorage.getItem(Ee.AUTH_APP);var i=new Headers;i.append("Authorization",`Bearer ${t}`),i.append("Content-Type","application/json");let s=e.map((e=>{const{productId:t,productVariantId:i,productName:s,productVariantName:l,productLink:n,productImage:d,productCurrency:r,productPrice:a}=e;return{id:xe(t),variant_id:xe(i),name:s,variant_name:l,url:n,image_url:d,currency:r,price:a}}));var l={method:"POST",headers:i,body:JSON.stringify({products:s}),redirect:"follow"};return await fetch(`${Se}/wishlist/bulk`,l).then((e=>e.json())).then((e=>e)).catch((()=>{}))},Qi=async()=>{let e=localStorage.getItem(Ee.AUTH_APP);var t=new Headers;t.append("Authorization",`Bearer ${e}`);var i={method:"GET",headers:t,redirect:"follow"};return await fetch(`${Se}/wishlist/info`,i).then((e=>e.json())).then((e=>e)).catch((()=>{}))},es=async(e,t)=>{let i=xe(e),s=t?xe(t):"",l=localStorage.getItem(Ee.AUTH_APP),n="?"+new URLSearchParams({variant_id:s}).toString();var d=new Headers;d.append("Authorization",`Bearer ${l}`);var r={method:"GET",headers:d,redirect:"follow"};return await fetch(`${Se}/wishlist/check/${i}${n}`,r).then((e=>e.json())).then((e=>Boolean(e.data))).catch((()=>{}))},ts=async()=>{let e=localStorage.getItem(Ee.AUTH_APP);var t=new Headers;t.append("Authorization",`Bearer ${e}`);var i={method:"DELETE",headers:t,redirect:"follow"};return await fetch(`${Se}/wishlist/clear`,i).then((e=>e.json())).then((e=>e)).catch((()=>{}))},is=async e=>{const{productId:t}=e;let i=localStorage.getItem(Ee.AUTH_APP);var s=new Headers;s.append("Authorization",`Bearer ${i}`),s.append("Content-Type","application/json");var l={method:"POST",headers:s,body:JSON.stringify({product:{id:xe(t)}}),redirect:"follow"};return await fetch(`${Se}/wishlist/cart`,l).then((e=>e.json())).then((e=>e)).catch((()=>{}))},ss=i=>{const{children:s}=i,{isRenderApp:l,triggerRenderMultipleComponent:n}=e.useContext(Fi),[d,r]=e.useState(0),[a,o]=e.useState(!0),[c,u]=e.useState(!0),[g,h]=e.useState(!1),[p,m]=e.useState(""),[_,v]=e.useState({}),w=async()=>{var e,t,i;let s,l,n,d=!1;s=await Qi(),d=200===(null==(e=null==s?void 0:s.status)?void 0:e.code)||!1,l=(null==(t=null==s?void 0:s.data)?void 0:t.total_data)?s.data.total_data:0,n=(null==(i=null==s?void 0:s.data)?void 0:i.proxy_url)||"",d&&(r(l),h(l>99),m(n),o(!1),u(!1))};return e.useEffect((()=>{(null==l?void 0:l.wishlist)&&("undefined"!=typeof window&&(window.sledgeWishlistBadgeUpdate=()=>{w()}),(async e=>{let t,i=!1;if(t=JSON.parse(e),!t)return;const{status:s,data:l}=t,{code:n}=s;i=200===n||!1,i&&(v(l),await w())})(localStorage.getItem(Ee.WISHLIST_SETTING)||""))}),[l,n]),t.jsx(t.Fragment,{children:e.Children.count(s)&&e.Children.map(s,(t=>e.cloneElement(t,{isFirstLoading:a,isLoading:c,totalWishlist:d,isMaximizeTotalWishlist:g,proxyUrl:p,dataSettings:_})))})},ls=i=>{var s,l;const{sledgeAnonymId:n}=e.useContext(Fi),{htmlElement:d,proxyUrl:r,dataSettings:a}=i||{},{is_required_login:o}=(null==(s=null==a?void 0:a.display)?void 0:s.global)||{},{type:c}=(null==(l=null==a?void 0:a.display)?void 0:l.widget)||{},[u,g]=e.useState(!1);e.useEffect((()=>{g(n&&o)}),[n]);return t.jsx("span",{onClick:e=>{e.preventDefault(),e.stopPropagation(),u?"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"}):("popup_window"===c&&"undefined"!=typeof window&&window.sledgeWishlistWidgetPopup&&window.sledgeWishlistWidgetPopup(),window.location.href="popup_window"===c?"#":r||"/")},children:t.jsx("span",{dangerouslySetInnerHTML:{__html:d}})})},ns=({children:i})=>t.jsx(t.Fragment,{children:e.Children.count(i)&&e.Children.map(i,(t=>e.cloneElement(t,{})))});ns.Root=ss,ns.HeaderMenu=Zi,ns.FloatingFull=zi,ns.FloatingIcon=Ji,ns.MenuItem=ls;const ds=()=>{const i=JSON.parse(localStorage.getItem(Ee.WISHLIST_SETTING)||"");if(!i)return;const{data:s}=i,{type:l,floating_button_type:n}=(null==s?void 0:s.launch_point)||{};if("floating_button"===l)if("left"===n||"right"===n){let i=document.createElement("div");i.setAttribute(Ae,be.WISHLIST.ELEMENT_BADGE_FLOATING_FULL),document.body.appendChild(i),i&&(i.innerHTML="",c.createRoot(i).render(t.jsx(e.StrictMode,{children:t.jsx(Fi.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0}},children:t.jsx(ns.Root,{children:t.jsx(ns.FloatingFull,{position:n})})})})))}else{let i=document.createElement("div");i.setAttribute(Ae,be.WISHLIST.ELEMENT_BADGE_FLOATING_ICON),document.body.appendChild(i),i&&(i.innerHTML="",c.createRoot(i).render(t.jsx(e.StrictMode,{children:t.jsx(Fi.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0}},children:t.jsx(ns.Root,{children:t.jsx(ns.FloatingIcon,{position:n})})})})))}else if("header_menu"===l){let i=document.querySelector(Re.WISHLIST.ELEMENT_BADGE);je(i,(()=>{i&&(i.innerHTML="",c.createRoot(i).render(t.jsx(e.StrictMode,{children:t.jsx(Fi.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0}},children:t.jsx(ns.Root,{children:t.jsx(ns.HeaderMenu,{})})})})))}))}else{let i=document.querySelector(Re.WISHLIST.ELEMENT_BADGE_MENU_ITEM);je(i,(()=>{i&&c.createRoot(i).render(t.jsx(e.StrictMode,{children:t.jsx(Fi.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0}},children:t.jsx(ns.Root,{children:t.jsx(ns.MenuItem,{htmlElement:i.innerHTML})})})}))}))}},rs="",as=i=>{var s,l,n,d,r;const{data:a,onAfterAddWishlist:o,onAfterRemoveWishlist:c}=i,{productId:u,productVariantId:g}=a||{},{isRenderApp:h,triggerRenderMultipleComponent:p,sledgeAnonymId:m}=e.useContext(Fi),[_,v]=e.useState(!0),[w,x]=e.useState(!0),[f,j]=e.useState(!1),[C,y]=e.useState({}),[S,N]=e.useState(!1),[L,A]=e.useState(!1),{is_required_login:T}=(null==(s=null==C?void 0:C.display)?void 0:s.global)||{},{type:E,icon:b,click_again_action:R,text_color:I,border_color:O,border_radius:P,padding_top:k,padding_bottom:D,padding_left:M,padding_right:W,background_color:B,font_size:H,font_weight:U,text_transform:F}=(null==(l=null==C?void 0:C.display)?void 0:l.button_detail)||{},{show:G,location:$}=(null==(n=null==C?void 0:C.display)?void 0:n.notification)||{},{before_adding_wishlist:V,after_adding_wishlist:q,remove_from_wishlist:z}=(null==(d=null==C?void 0:C.languages)?void 0:d.button_detail)||{},{title_added_to_wishlist:J,text_added_to_wishlist:Z,title_removed_to_wishlist:K,text_removed_to_wishlist:Y}=(null==(r=null==C?void 0:C.languages)?void 0:r.notification)||{},X={...I&&{color:I},...O&&{borderColor:O},...P&&{borderRadius:P},...k&&{paddingTop:k},...D&&{paddingBottom:D},...M&&{paddingLeft:M},...W&&{paddingRight:W},...B&&{backgroundColor:B},...H&&{fontSize:H},...U&&{fontWeight:U},...F&&{textTransform:F}},Q=async()=>{let e;e=await es(u,g),j(e)},ee=async e=>{var i,s,l,n,d,r,u;if(e.preventDefault(),e.stopPropagation(),L)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"}));N(!0),j(!f);let g=await Yi(a);200===(null==(i=null==g?void 0:g.status)?void 0:i.code)?(N(!1),"undefined"!=typeof window&&(window.sledgeWishlistBadgeUpdate&&((null==(l=null==(s=null==p?void 0:p.wishlist)?void 0:s.badge)?void 0:l.trigger)&&(null==(u=null==(n=null==p?void 0:p.wishlist)?void 0:n.badge)||u.trigger(!(null==(r=null==(d=null==p?void 0:p.wishlist)?void 0:d.badge)?void 0:r.value))),window.sledgeWishlistBadgeUpdate()),window.sledgeWishlistWidgetListUpdate&&window.sledgeWishlistWidgetListUpdate(),window.sledgeWishlistTriggerUpdate&&window.sledgeWishlistTriggerUpdate()),Q(),f?c&&c("success"):o&&o("success"),"undefined"!=typeof window&&window.sledgeToastNotification&&G&&window.sledgeToastNotification({title:f?K:J,message:f?Y:Z,location:$,type:"success",icon:t.jsx(pt,{width:40,height:40,color:"black",type:"outline"})})):(f?c&&c("failed"):o&&o("failed"),N(!1),"undefined"!=typeof window&&window.sledgeToastNotification&&G&&window.sledgeToastNotification({title:"Failed",message:"failed add to wishlist",location:$,type:"failed"}))};e.useEffect((()=>{(null==h?void 0:h.wishlist)&&("undefined"!=typeof window&&(window.sledgeWishlistButtonDetailUpdate=()=>{Q()}),(async e=>{let t;x(!0);let i=!1;if(t=JSON.parse(e),!t)return;const{status:s,data:l}=t,{code:n}=s;i=200===n||!1,i&&(y(l),x(!1),setTimeout((()=>{v(!1)}),1300))})(localStorage.getItem(Ee.WISHLIST_SETTING)||""))}),[h]),e.useEffect((()=>{A(m&&T)}),[m]),e.useEffect((()=>{Q()}),[g]);const te=t.jsxs(t.Fragment,{children:[E&&String(E).toLowerCase().includes("icon")&&(null==b?void 0:b.length)?t.jsx("span",{className:"sledge-wishlist__widget-button-detail-icon",dangerouslySetInnerHTML:{__html:b},style:{fill:I}}):null,L?V:E&&String(E).toLowerCase().includes("text")?S?f?"Adding...":"Removing...":f&&!R?q:f?z:V:null]});return t.jsx(t.Fragment,{children:_?t.jsx(tl.Item,{width:"100%",height:"44px",rounded:"md",color:"grey-100"}):t.jsx(t.Fragment,{children:E&&String(E).toLowerCase().includes("button")?t.jsx(Lt,{type:"button",fullWidth:!0,style:X,...S||f&&!R?{disabled:!0}:{onClick:e=>ee(e)},children:te}):t.jsx("span",{className:"sledge-wishlist__widget-button-detail",style:X,...S||f&&!R?{disabled:!0}:{onClick:e=>ee(e)},children:te})})})},os=()=>{let i=document.querySelector(Re.WISHLIST.ELEMENT_BUTTON_DETAIL);je(i,(()=>{if(i){const s=i.getAttribute(Te.GLOBAL.PRODUCT_ID),l=i.getAttribute(Te.GLOBAL.PRODUCT_VARIANT_ID),n=i.getAttribute(Te.GLOBAL.PRODUCT_NAME),d=i.getAttribute(Te.GLOBAL.PRODUCT_VENDOR),r=i.getAttribute(Te.GLOBAL.PRODUCT_SKU),a=i.getAttribute(Te.GLOBAL.PRODUCT_VARIANT_NAME),o=i.getAttribute(Te.GLOBAL.PRODUCT_LINK),u=i.getAttribute(Te.GLOBAL.PRODUCT_IMAGE),g=i.getAttribute(Te.GLOBAL.PRODUCT_CURRENCY),h=i.getAttribute(Te.GLOBAL.PRODUCT_PRICE),p=i.getAttribute(Te.GLOBAL.ON_AFTER_ADD_WISHLIST),m=i.getAttribute(Te.GLOBAL.ON_AFTER_REMOVE_WISHLIST);i.innerHTML="",c.createRoot(i).render(t.jsx(e.StrictMode,{children:t.jsx(Fi.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0}},children:t.jsx(as,{data:{productId:s||"",productVariantId:l||"",productName:n||"",productVendor:d||"",productSku:r||"",productVariantName:a||"",productLink:o||"",productImage:u||"",productCurrency:g||"",productPrice:h||""},onAfterAddWishlist:e=>{i&&p&&eval(p)({element:i,state:e})},onAfterRemoveWishlist:e=>{i&&m&&eval(m)({element:i,state:e})}})})}))}}))},cs="",us=i=>{var s,l,n;const{data:d,forceActive:r=!1,hidden:a=!1,onAfterAddWishlist:o,onAfterRemoveWishlist:c}=i,{productId:u,productVariantId:g}=d||{},{isRenderApp:h,triggerRenderMultipleComponent:p,sledgeAnonymId:m}=e.useContext(Fi),_="#767676",v="outline",w="#F85538",x="fill",[f,j]=e.useState(_),[C,y]=e.useState(v),[S,N]=e.useState(!1),[L,A]=e.useState(!0),[T,E]=e.useState({}),[b,R]=e.useState({onAfterAddWishlist:o,onAfterRemoveWishlist:c}),[I,O]=e.useState(!1),{is_required_login:P}=(null==(s=null==T?void 0:T.display)?void 0:s.global)||{},{show:k,location:D}=(null==(l=null==T?void 0:T.display)?void 0:l.notification)||{},{title_added_to_wishlist:M,text_added_to_wishlist:W,title_removed_to_wishlist:B,text_removed_to_wishlist:H}=(null==(n=null==T?void 0:T.languages)?void 0:n.notification)||{},U=async()=>{let e;e=await es(u,g),N(r||e)};e.useEffect((()=>{(null==h?void 0:h.wishlist)&&("undefined"!=typeof window&&(window.sledgeWishlistTriggerUpdate=()=>{U()}),(async e=>{let t;A(!0);let i=!1;if(t=JSON.parse(e),!t)return;const{status:s,data:l}=t,{code:n}=s;i=200===n||!1,i&&(E(l),A(!1))})(localStorage.getItem(Ee.WISHLIST_SETTING)||""))}),[h]),e.useEffect((()=>{O(m&&P)}),[m]),e.useEffect((()=>{U()}),[g]);const F=(S||r)&&!I;return e.useEffect((()=>{F?(j(w),y(x)):(j(_),y(v))}),[S]),t.jsx(t.Fragment,{children:!L&&!a&&t.jsx("div",{className:"sledge-wishlist__trigger-block",children:t.jsx("span",{className:"sledge-wishlist__trigger",onClick:e=>(async e=>{var i,s,l,n,r,a;if(e.preventDefault(),e.stopPropagation(),I)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"}));N(!S);let o=await Yi(d);const{status:c,data:u}=o||{},{code:g}=c||{};200===g?("undefined"!=typeof window&&(window.sledgeWishlistBadgeUpdate&&((null==(s=null==(i=null==p?void 0:p.wishlist)?void 0:i.badge)?void 0:s.trigger)&&(null==(a=null==(l=null==p?void 0:p.wishlist)?void 0:l.badge)||a.trigger(!(null==(r=null==(n=null==p?void 0:p.wishlist)?void 0:n.badge)?void 0:r.value))),window.sledgeWishlistBadgeUpdate()),window.sledgeWishlistWidgetListUpdate&&window.sledgeWishlistWidgetListUpdate(),window.sledgeWishlistButtonDetailUpdate&&window.sledgeWishlistButtonDetailUpdate()),U(),S?b.onAfterRemoveWishlist&&b.onAfterRemoveWishlist("success"):b.onAfterAddWishlist&&b.onAfterAddWishlist("success"),"undefined"!=typeof window&&window.sledgeToastNotification&&k&&window.sledgeToastNotification({title:S?B:M,message:S?H:W,location:D,type:"success",icon:t.jsx(pt,{width:40,height:40,color:"black",type:"outline"})})):(S?b.onAfterRemoveWishlist&&b.onAfterRemoveWishlist("failed"):b.onAfterAddWishlist&&b.onAfterAddWishlist("failed"),"undefined"!=typeof window&&window.sledgeToastNotification&&k&&window.sledgeToastNotification({title:"Failed",message:"failed add to wishlist",location:D,type:"failed",icon:t.jsx(pt,{width:40,height:40,color:"black",type:"outline"})}))})(e),onMouseEnter:()=>{F||(j(w),y(x))},onMouseLeave:()=>{F||(j(_),y(v))},children:t.jsx(pt,{width:16.67,height:15.83,type:C,color:f})})})})},gs=(i,s="")=>{i.parentNode&&i.parentNode.classList.add("sledge-wishlist__trigger-parent-element"),i.classList.add("sledge-wishlist__trigger-wrapper");const l=i.getAttribute(Te.GLOBAL.PRODUCT_ID),n=i.getAttribute(Te.GLOBAL.PRODUCT_VARIANT_ID),d=i.getAttribute(Te.GLOBAL.PRODUCT_NAME),r=i.getAttribute(Te.GLOBAL.PRODUCT_VENDOR),a=i.getAttribute(Te.GLOBAL.PRODUCT_SKU),o=i.getAttribute(Te.GLOBAL.PRODUCT_VARIANT_NAME),u=i.getAttribute(Te.GLOBAL.PRODUCT_LINK),g=i.getAttribute(Te.GLOBAL.PRODUCT_IMAGE),h=i.getAttribute(Te.GLOBAL.PRODUCT_CURRENCY),p=i.getAttribute(Te.GLOBAL.PRODUCT_PRICE),m=i.getAttribute(Te.GLOBAL.ON_AFTER_ADD_WISHLIST),_=i.getAttribute(Te.GLOBAL.ON_AFTER_REMOVE_WISHLIST);i.innerHTML="",c.createRoot(i).render(t.jsx(e.StrictMode,{children:t.jsx(Fi.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0}},children:t.jsx(us,{data:{productId:l||"",productVariantId:n||"",productName:d||"",productVendor:r||"",productSku:a||"",productVariantName:o||"",productLink:u||"",productImage:g||"",productCurrency:h||"",productPrice:p||""},onAfterAddWishlist:e=>{i&&m&&eval(m)({element:i,state:e})},onAfterRemoveWishlist:e=>{i&&_&&eval(_)({element:i,state:e})}})})}))},hs=()=>{let e=Array.from(document.querySelectorAll(Re.WISHLIST.ELEMENT_TRIGGER));je(e,(()=>{e.length&&e.map((e=>{gs(e,e)}))})),new MutationObserver((function(t){t.forEach((function(t){Array.prototype.slice.call(t.addedNodes).forEach((function(t){1===t.nodeType&&t.querySelector(Re.WISHLIST.ELEMENT_TRIGGER)&&(e=Array.from(t.querySelectorAll(Re.WISHLIST.ELEMENT_TRIGGER)),e.length&&e.map((e=>{gs(e,e)})))}))}))})).observe(document.body,{childList:!0,subtree:!0,attributes:!1,characterData:!1})},ps="",ms=({buttonText:i,shareId:s,dataSettings:l,isFirstLoading:n})=>{var d,r,a,o,c;const{sledgeAnonymId:u}=e.useContext(Fi),{is_required_login:g}=(null==(d=null==l?void 0:l.display)?void 0:d.global)||{},{text_color:h,border_color:p,border_radius:m,padding_top:_,padding_bottom:v,padding_left:w,padding_right:x,background_color:f,font_size:j,font_weight:C,text_transform:y}=(null==(a=null==(r=null==l?void 0:l.display)?void 0:r.widget)?void 0:a.button_clear_all)||{},{title_confirm_clear_all_wishlist:S,text_confirm_clear_all_wishlist:N,button_submit_confirm_clear_all_wishlist:L,button_cancel_confirm_clear_all_wishlist:A}=(null==(o=null==l?void 0:l.languages)?void 0:o.popup)||{},{button_clear_all:T}=(null==(c=null==l?void 0:l.languages)?void 0:c.widget)||{},[E,b]=e.useState(!1),R={...h&&{color:h},...p&&{borderColor:p},...m&&{borderRadius:m},..._&&{paddingTop:_},...v&&{paddingBottom:v},...w&&{paddingLeft:w},...x&&{paddingRight:x},...f&&{backgroundColor:f},...j&&{fontSize:j},...C&&{fontWeight:C},...y&&{textTransform:y}};e.useEffect((()=>{b(u&&g)}),[u]);return t.jsx(t.Fragment,{children:!E&&t.jsx(t.Fragment,{children:!s&&t.jsx(t.Fragment,{children:n?t.jsx(tl.Item,{width:"132px",height:"46px",color:"grey-100",rounded:"md"}):t.jsx("div",{className:"sledge-wishlist__widget-header-item",children:t.jsx(Lt,{type:"button",colorType:"danger",onClick:()=>{"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:S,message:N,textSubmit:L,textCancel:A,buttonSubmitType:"danger",onSubmit:window.sledgeWishlistWidgetClearList||{}})},style:R,children:T||(i||"Clear Wishlist")})})})})})},_s=({wishlistData:i,buttonText:s,showShareTrigger:l,shareLink:n,shareId:d,dataSettings:r,isFirstLoading:a})=>{var o,c,u,g,h,p;const{triggerRenderMultipleComponent:m,sledgeAnonymId:_}=e.useContext(Fi),{is_required_login:v}=(null==(o=null==r?void 0:r.display)?void 0:o.global)||{},{text_color:w,border_color:x,border_radius:f,padding_top:j,padding_bottom:C,padding_left:y,padding_right:S,background_color:N,font_size:L,font_weight:A,text_transform:T}=(null==(u=null==(c=null==r?void 0:r.display)?void 0:c.widget)?void 0:u.button_share)||{},{title_share_wishlist:E}=(null==(g=null==r?void 0:r.languages)?void 0:g.popup)||{},{button_share:b}=(null==(h=null==r?void 0:r.languages)?void 0:h.widget)||{},{title_added_all_to_wishlist:R,text_added_all_to_wishlist:I}=(null==(p=null==r?void 0:r.languages)?void 0:p.notification)||{},[O,P]=e.useState(!1),k={...w&&{color:w},...x&&{borderColor:x},...f&&{borderRadius:f},...j&&{paddingTop:j},...C&&{paddingBottom:C},...y&&{paddingLeft:y},...S&&{paddingRight:S},...N&&{backgroundColor:N},...L&&{fontSize:L},...A&&{fontWeight:A},...T&&{textTransform:T}},[D,M]=e.useState(!1);let W='<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 B=async()=>{var e,t,s,l,n,d,r;M(!0);let a=i.map((e=>{const{id:t,variant_id:i,name:s,variant_name:l,url:n,image_url:d,currency:r,price:a}=e.product;return{productId:t,productVariantId:i,productName:s,productVariantName:l,productLink:n,productImage:d,productCurrency:r,productPrice:a}})),o=await Xi(a);200===(null==(e=null==o?void 0:o.status)?void 0:e.code)?("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==(l=null==m?void 0:m.wishlist)?void 0:l.badge)||r.trigger(!(null==(d=null==(n=null==m?void 0:m.wishlist)?void 0:n.badge)?void 0:d.value))),window.sledgeWishlistBadgeUpdate()),window.sledgeInfoPopup&&window.sledgeInfoPopup({title:R,message:I,textCancel:"Cancel"})),M(!1)):"undefined"!=typeof window&&window.sledgeInfoPopup&&window.sledgeInfoPopup({title:"Failed",message:"Failed add to wishlist, please try again",textCancel:"Cancel"})};return e.useEffect((()=>{P(_&&v)}),[_]),t.jsx(t.Fragment,{children:!O&&t.jsx(t.Fragment,{children:l&&t.jsx(t.Fragment,{children:a?t.jsx(tl.Item,{width:"136px",height:"46px",color:"grey-100",rounded:"md"}):t.jsx("div",{className:"sledge-wishlist__widget-header-item sledge-wishlist__widget-header-share-trigger",children:t.jsx(Lt,{type:"button",style:k,...d&&!i.length||D?{disabled:!0}:{onClick:async()=>{d&&i.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>${i.length}</strong> item to your wishlist page.`,textSubmit:"Add to your wishlist",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:B||{}}):"undefined"!=typeof window&&window.sledgeInfoPopup&&(window.sledgeInfoPopup({title:E,message:n?`<div class="sledge-wishlist__widget-box-copy">\n <div class="sledge-wishlist__widget-box-copy-icon" title="Copy to clipboard">\n ${W}\n </div>\n <div class="sledge-wishlist__widget-box-copy-content">${n}</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 i=null==(e=document.querySelector(".sledge-wishlist__widget-box-copy-content"))?void 0:e.textContent;i&&(navigator.clipboard.writeText(i),t&&(t.classList.add("active"),t.innerHTML='<svg width="20" height="20" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg>',setTimeout((()=>{t&&(t.classList.remove("active"),t.innerHTML=W)}),2500)))}))}}))})())}},children:d?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-top-right",children:i.length}),D?"Adding...":"Add to your wishlist"]}):b||(s||"Share Wishlist")})})})})})},vs=({setIsLoading:i,setKeyword:s,keyword:l,placeholder:n,dataSettings:d})=>{var r,a;const{sledgeAnonymId:o}=e.useContext(Fi),{is_required_login:c}=(null==(r=null==d?void 0:d.display)?void 0:r.global)||{},{search_form_placeholder:u}=(null==(a=null==d?void 0:d.languages)?void 0:a.widget)||{},[g,h]=e.useState(!1),p=e.useRef(null);return e.useEffect((()=>{h(o&&c)}),[o]),t.jsx(t.Fragment,{children:!g&&t.jsx(Tt,{type:"text",icon:t.jsx(St,{width:18,height:18,color:"#868686"}),placeholder:u||(n||"Search product..."),value:l,fieldRef:p,onChange:({value:e})=>(e=>{s&&s(e)})(e),onResetField:()=>{var e;i&&i(!0),s&&s(""),null==(e=null==p?void 0:p.current)||e.focus()},className:"sledge-wishlist__widget-search-form",withClearField:!0})})},ws=({text:e,dataSettings:i})=>{var s,l,n;const{color:d,font_size:r,font_weight:a,text_transform:o}=(null==(l=null==(s=null==i?void 0:i.display)?void 0:s.widget)?void 0:l.header_title)||{},{header_title:c}=(null==(n=null==i?void 0:i.languages)?void 0:n.widget)||{},u={...d&&{color:d},...r&&{fontSize:r},...a&&{fontWeight:a},...o&&{textTransform:o}};return t.jsx("div",{className:"sledge-wishlist__widget-header-item",children:t.jsx("h1",{style:u,children:c||(e||"My Wishlist")})})},xs=({options:i,defaultLimitOptions:s,selectedLimit:l,setSelectedLimit:n,setIsRefreshWidgetList:d,dataSettings:r})=>{var a;const{sledgeAnonymId:o}=e.useContext(Fi),{is_required_login:c}=(null==(a=null==r?void 0:r.display)?void 0:a.global)||{},[u,g]=e.useState(!1);let h=i||s;return e.useEffect((()=>{g(o&&c)}),[o]),t.jsx(t.Fragment,{children:!u&&t.jsx(t.Fragment,{children:h&&Boolean(null==h?void 0:h.length)&&t.jsx("div",{className:"sledge-wishlist__widget-header-item",children:t.jsx(bt,{align:"end",options:h.map((e=>({label:e,value:e}))),value:l||h[0],onChange:({value:e})=>(e=>{n&&n(e),d&&d(!0)})(e)})})})})},fs=({wishlistSort:i,selectedSort:s,setSelectedSort:l,setIsRefreshWidgetList:n,dataSettings:d})=>{var r,a;const{sledgeAnonymId:o}=e.useContext(Fi),{is_required_login:c}=(null==(r=null==d?void 0:d.display)?void 0:r.global)||{},[u,g]=e.useState(!1);return e.useEffect((()=>{g(o&&c)}),[o]),t.jsx(t.Fragment,{children:!u&&t.jsx(t.Fragment,{children:i&&Boolean(null==i?void 0:i.length)&&t.jsx("div",{className:"sledge-wishlist__widget-header-item",children:t.jsx(bt,{align:"end",options:i.map((e=>{const{name:t,value:i}=e;return{label:t,value:i}})),value:s||(null==(a=i[0])?void 0:a.value),onChange:({value:e})=>(e=>{l&&l(e),n&&n(!0)})(e)})})})})},js=({isFirstLoading:i,...s})=>t.jsx("div",{className:"sledge-wishlist__widget-header",children:i?t.jsxs("div",{style:{display:"flex",gap:"8px",width:"100%",justifyContent:"space-between"},children:[t.jsx(tl.Item,{width:"190px",height:"46px",color:"grey-100",rounded:"md"}),t.jsxs("div",{style:{display:"flex",gap:"8px"},children:[t.jsx(tl.Item,{width:"440px",height:"46px",color:"grey-100",rounded:"md"}),t.jsx(tl.Item,{width:"132px",height:"46px",color:"grey-100",rounded:"md"}),t.jsx(tl.Item,{width:"136px",height:"46px",color:"grey-100",rounded:"md"})]}),t.jsxs("div",{style:{display:"flex",gap:"26px"},children:[t.jsx(tl.Item,{width:"190px",height:"46px",color:"grey-100",rounded:"md"}),t.jsx(tl.Item,{width:"190px",height:"46px",color:"grey-100",rounded:"md"})]})]}):e.Children.count(s.children)&&e.Children.map(s.children,(t=>e.cloneElement(t,{...s})))});js.Title=ws,js.SearchForm=vs,js.ShareTrigger=_s,js.ClearTrigger=ms,js.Sort=fs,js.Limit=xs;const Cs="large",ys=i=>{var s;const{sledgeAnonymId:l}=e.useContext(Fi),{isLoading:n,wishlistData:d,dataSettings:r,gridType:a=Cs}=i||{},{is_required_login:o}=(null==(s=null==r?void 0:r.display)?void 0:s.global)||{},[c,u]=e.useState(!1);return e.useEffect((()=>{u(l&&o)}),[l]),t.jsx(t.Fragment,{children:n?t.jsx(tl.ProductGrid,{count:8,type:a}):t.jsx("div",{className:"sledge-wishlist__widget-product-wrapper",children:!(null==d?void 0:d.length)||c?t.jsx(Ss,{...i,isRequiredLogin:c}):t.jsx(Ns,{...i})})})},Ss=i=>{var s;const{onSearch:l,keyword:n,dataSettings:d,isRequiredLogin:r}=i||{},{title_no_result:a,text_no_result:o}=(null==(s=null==d?void 0:d.languages)?void 0:s.widget)||{},[c,u]=e.useState(""),[g,h]=e.useState(""),[p,m]=e.useState(!1),[_,v]=e.useState(""),[w,x]=e.useState("");return e.useEffect((()=>{r?(u("Login required!"),h("Please login to save your wishlist across devices."),m(!0),v("Login"),x("/account/login")):l||(u(n?"No products found":a),h(n?"Your search did not match any products. <br/> Please try again":o),m(!n),v("Continue Shopping"),x("/"))}),[l,d]),t.jsxs("div",{className:"sledge-wishlist__widget-product-empty",children:[t.jsx("div",{className:"sledge-wishlist__widget-product-empty-title",dangerouslySetInnerHTML:{__html:c}}),t.jsx("div",{className:"sledge-wishlist__widget-product-empty-description",dangerouslySetInnerHTML:{__html:g}}),p&&t.jsx("div",{className:"sledge-wishlist__widget-button-wrapper",children:t.jsx("a",{href:w,className:"sledge__button","data-button-color-type":"light",children:_})})]})},Ns=i=>{var s,l,n,d,r,a,o,c;const{wishlistData:u,currentPage:g,setCurrentPage:h,totalPage:p,shareId:m,dataSettings:_,gridType:v=Cs,productCardsComponent:w,separateJsVersionComponent:x,onAfterAddToCart:f,onAfterAddWishlist:j,onAfterRemoveWishlist:C,onAfterRenderProduct:y}=i||{},{show_add_to_cart:S,redirect_add_to_cart:N}=(null==(s=null==_?void 0:_.display)?void 0:s.widget)||{},{text_color:L,border_color:A,border_radius:T,padding_top:E,padding_bottom:b,padding_left:R,padding_right:I,background_color:O,font_size:P,font_weight:k,text_transform:D}=(null==(n=null==(l=null==_?void 0:_.display)?void 0:l.widget)?void 0:n.button_add_to_cart)||{},{color:M,font_size:W,font_weight:B,text_transform:H}=(null==(r=null==(d=null==_?void 0:_.display)?void 0:d.widget)?void 0:r.price)||{},{color:U,font_size:F,font_weight:G,text_transform:$}=(null==(o=null==(a=null==_?void 0:_.display)?void 0:a.widget)?void 0:o.product_name)||{},{button_add_to_cart:V}=(null==(c=null==_?void 0:_.languages)?void 0:c.widget)||{},q={...L&&{color:L},...A&&{borderColor:A},...T&&{borderRadius:T},...E&&{paddingTop:E},...b&&{paddingBottom:b},...R&&{paddingLeft:R},...I&&{paddingRight:I},...O&&{backgroundColor:O},...P&&{fontSize:P},...k&&{fontWeight:k},...D&&{textTransform:D}},z={...M&&{color:M},...W&&{fontSize:W},...B&&{fontWeight:B},...H&&{textTransform:H}},J={...U&&{color:U},...F&&{fontSize:F},...G&&{fontWeight:G},...$&&{textTransform:$}};let Z=g||0,K=p||0;const[Y,X]=e.useState(!1),[Q,ee]=e.useState(!1);return e.useEffect((()=>{ee(!(K===Z&&!Y)&&K>=Z)}),[Y]),e.useEffect((()=>{X(!1)}),[u]),t.jsxs(t.Fragment,{children:[(null==u?void 0:u.length)?t.jsx(Os,{sourceApp:"wishlist",type:v,data:u.map((e=>{const{id:t,variant_id:i,name:s,variant_name:l,url:n,image_url:d,currency:r,price:a,vendor:o,sku:c}=(null==e?void 0:e.product)||{},u=new URL(n).pathname.split("/"),g=u[u.length-1];return{product:{id:t,admin_graphql_api_id:`${Me}${t}`,handle:g,title:s,image:{src:d},url:n,vendor:o,currency:r},variants:[{id:i,admin_graphql_api_id:`${We}${i}`,title:l,price:a,sku:c}]}})),setting:{show_vendor:!0,show_sku:!0,show_price:!0,show_add_to_cart:S,redirect_add_to_cart:N,language_button_add_to_cart:V,display_product_name_style:J,display_price_style:z,display_button_add_to_cart_style:q},showOptionOutOfStock:!1,triggerPropAdditional:{forceActive:!0,...m&&{hidden:!0}},isComponentJsVersion:x,cards:w,onAfterAddToCart:f,onAfterAddWishlist:j,onAfterRemoveWishlist:C,onAfterRenderProduct:y}):t.jsx(t.Fragment,{}),Q&&t.jsx("div",{className:"sledge-wishlist__widget-button-load-more",children:t.jsx(Lt,{type:"button",role:"button",colorType:"light",disabled:Y,onClick:()=>{h&&g&&h(g+1),X(!0)},style:{...Y&&{cursor:"wait"}},children:Y?"Loading...":"Load More"})})]})},Ls=i=>{var s;const{children:l,data:n,onAfterAddToCart:d,onAfterAddWishlist:r,onAfterRemoveWishlist:a,onAfterRenderProduct:o}=i,c=(null==n?void 0:n.shareId)?n.shareId:"",{isRenderApp:u,triggerRenderMultipleComponent:g,sledgeAnonymId:h}=e.useContext(Fi),[p,m]=e.useState(!0),[_,v]=e.useState(!0),[w,x]=e.useState([]),[f,j]=e.useState([]),[C,y]=e.useState(!1),[S,N]=e.useState(""),[L,A]=e.useState(""),[T,E]=e.useState(""),[b,R]=e.useState(1),[I,O]=e.useState(0),[P,k]=e.useState(!1),[D,M]=e.useState(!1),[W,B]=e.useState(""),[H,U]=e.useState(""),[F,G]=e.useState({}),[$,V]=e.useState(!1),q=Ut({keyword:T,currentPage:b}),z=Ie,{is_required_login:J}=(null==(s=null==F?void 0:F.display)?void 0:s.global)||{},Z=async(e=!1)=>{var t,i,s,l;let n;v(!e),e||(R(1),x([]));let d,r,a=!1,o=0,u={page:e?b:1,limit:L||z[0],sort:S,keyword:T,shareId:c};n=await Ki(u),a=200===(null==(t=null==n?void 0:n.status)?void 0:t.code)||!1,d=(null==(i=n.data)?void 0:i.length)?t=>(null==w?void 0:w.length)&&e?[...t,...n.data]:n.data:[],r=(null==(s=n.sorts)?void 0:s.length)?n.sorts:[],o=(null==(l=null==n?void 0:n.page)?void 0:l.total_page)||1,a&&(x(d),j(r),O(o),v(!1),y(!1))};e.useEffect((()=>{let e=Boolean(q&&(null==q?void 0:q.currentPage)!==b);if(q&&(null==q?void 0:q.keyword)!==T){k(!0);const e=setTimeout((()=>{k(!1),Z()}),500);return()=>clearTimeout(e)}Z(!C&&e)}),[T,b,C]),e.useEffect((()=>{(null==u?void 0:u.wishlist)&&("undefined"!=typeof window&&(window.sledgeWishlistWidgetListUpdate=()=>{Z()},window.sledgeWishlistWidgetClearList=()=>{(async()=>{var e,t,i,s,l,n,d;let r;v(!0);let a=!1;r=await ts(),a=200===(null==(e=null==r?void 0:r.status)?void 0:e.code),a?(await Z(),"undefined"!=typeof window&&window.sledgeWishlistBadgeUpdate&&((null==(i=null==(t=null==g?void 0:g.wishlist)?void 0:t.badge)?void 0:i.trigger)&&(null==(d=null==(s=null==g?void 0:g.wishlist)?void 0:s.badge)||d.trigger(!(null==(n=null==(l=null==g?void 0:g.wishlist)?void 0:l.badge)?void 0:n.value))),window.sledgeWishlistBadgeUpdate())):"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:"failed clear all wishlist",type:"failed"})})()}),(async()=>{var e,t,i;let s;M(!1);let l,n,d=!1;s=await Qi(),d=200===(null==(e=null==s?void 0:s.status)?void 0:e.code)||!1,l=(null==(t=null==s?void 0:s.data)?void 0:t.share_link)||"",n=(null==(i=null==s?void 0:s.data)?void 0:i.proxy_url)||"",d&&(B(window.location.origin+l),U(n),M(!0))})(),(async e=>{let t,i=!1;if(t=JSON.parse(e),!t)return;const{status:s,data:l}=t,{code:n}=s;i=200===n||!1,i&&G(l)})(localStorage.getItem(Ee.WISHLIST_SETTING)||""),setTimeout((()=>{m(!1)}),1300))}),[u]),e.useEffect((()=>{V(h&&!J)}),[h]);let K=null,Y=!1;return e.Children.map(l,(t=>{if(e.isValidElement(t)&&ye(t.type)&&t.type.name===ke.PRODUCT.CARDS){const{component:e,isJsVersion:i}=(null==t?void 0:t.props)||{};K=e,Y=i}})),t.jsx(t.Fragment,{children:t.jsxs("div",{className:"sledge-wishlist__widget-wrapper",children:[$&&t.jsx(t.Fragment,{children:p?t.jsx(tl.Item,{width:"99.5%",height:"72px",color:"grey-100",rounded:"none",animationDuration:"3s",style:{margin:"0 auto"}}):t.jsx("div",{className:"sledge-wishlist__widget-alert",children:t.jsxs("div",{className:"sledge-wishlist__widget-alert-text",children:["Please login to save your wishlist across devices.",t.jsx("a",{href:"/account/login",className:"sledge-wishlist__widget-alert-link",children:"Login Here"})]})})}),e.Children.count(l)&&e.Children.map(l,(t=>e.cloneElement(t,{isLoading:_,isFirstLoading:p,wishlistData:w,wishlistSort:f,selectedSort:S,selectedLimit:L,keyword:T,currentPage:b,totalPage:I,defaultLimitOptions:z,onSearch:P,showShareTrigger:D,shareLink:W,shareId:c,proxyUrl:H,dataSettings:F,separateJsVersionComponent:Y,productCardsComponent:K,setIsLoading:v,setIsRefreshWidgetList:y,setSelectedSort:N,setSelectedLimit:A,setKeyword:E,setCurrentPage:R,onAfterAddToCart:d,onAfterAddWishlist:r,onAfterRemoveWishlist:a,onAfterRenderProduct:o})))]})})},As=({children:i})=>t.jsx(t.Fragment,{children:e.Children.count(i)&&e.Children.map(i,(t=>e.cloneElement(t,{})))});As.Root=Ls,As.Header=js,As.List=ys;const Ts="",Es=({children:i})=>{const[s,l]=e.useState(!1);return e.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeWishlistWidgetPopup=()=>{l(!0)})}),[]),t.jsx(u,{open:s,onOpenChange:l,children:t.jsxs(g,{children:[t.jsx(h,{className:"sledge__popup-overlay"}),t.jsx(h,{className:"sledge__popup-overlay-blur"}),t.jsx(p,{className:"sledge-wishlist__widget-popup-content DialogContent",children:t.jsxs("div",{className:"sledge-wishlist__widget-popup-wrapper",children:[t.jsx("div",{className:"sledge-wishlist__widget-popup-close",onClick:()=>l(!1),children:t.jsx("svg",{width:18,height:18,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}),i]})})]})})},bs=()=>{let i=document.querySelector(Re.WISHLIST.ELEMENT_WIDGET);je(i,(()=>{var s;if(i){const l=i.getAttribute(Te.WISHLIST.SHARE_ID),n=i.getAttribute(Te.GLOBAL.ON_AFTER_ADD_TO_CART),d=i.getAttribute(Te.GLOBAL.ON_AFTER_ADD_WISHLIST),r=i.getAttribute(Te.GLOBAL.ON_AFTER_REMOVE_WISHLIST),a=i.getAttribute(Te.GLOBAL.ON_AFTER_RENDER_PRODUCT),o=null==(s=i.querySelector(Re.GLOBAL.ELEMENT_PRODUCT_CARDS))?void 0:s.getAttribute(Te.GLOBAL.RENDER_COMPONENT);i.innerHTML="",c.createRoot(i).render(t.jsx(e.StrictMode,{children:t.jsx(Fi.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0}},children:t.jsxs(As.Root,{data:{shareId:l||""},onAfterAddToCart:e=>{i&&n&&eval(n)({element:i,state:e})},onAfterAddWishlist:e=>{i&&d&&eval(d)({element:i,state:e})},onAfterRemoveWishlist:e=>{i&&r&&eval(r)({element:i,state:e})},onAfterRenderProduct:e=>{i&&a&&eval(a)({element:i,state:e})},children:[t.jsx(Gi,{component:o?eval(o):null,isJsVersion:!0}),t.jsxs(As.Header,{children:[t.jsx(js.Title,{text:"My Wishlist"}),t.jsx(js.SearchForm,{placeholder:"Search product"}),t.jsx(js.ClearTrigger,{buttonText:"Clear Wishlist"}),t.jsx(js.ShareTrigger,{buttonText:"Share Wishlist"}),t.jsx(js.Sort,{}),t.jsx(js.Limit,{options:[10,25,50,100]})]}),t.jsx(As.List,{gridType:"large"})]})})}))}}))},Rs=()=>{let i=document.querySelector(`[${Ae}="${be.WISHLIST.ELEMENT_WIDGET_POPUP}"]`);i||(i=document.createElement("div"),i.setAttribute(Ae,be.WISHLIST.ELEMENT_WIDGET_POPUP),document.body.appendChild(i)),i&&(i.innerHTML="",c.createRoot(i).render(t.jsx(e.StrictMode,{children:t.jsx(Fi.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0}},children:t.jsx(Es,{children:t.jsxs(As.Root,{children:[t.jsxs(As.Header,{children:[t.jsx(js.Title,{text:"My Wishlist"}),t.jsx(js.SearchForm,{placeholder:"Search product"}),t.jsx(js.ClearTrigger,{buttonText:"Clear Wishlist"}),t.jsx(js.ShareTrigger,{buttonText:"Share Wishlist"}),t.jsx(js.Sort,{}),t.jsx(js.Limit,{options:[10,25,50,100]})]}),t.jsx(As.List,{gridType:"medium"})]})})})})))},Is=()=>{ds(),hs(),bs(),Rs(),os()},Os=({type:i,className:s="",data:l,setting:n,showOptionOutOfStock:d=!1,triggerPropAdditional:r,sourceApp:a=null,isComponentJsVersion:o=!1,cards:c,onAfterAddToCart:u,onAfterAddWishlist:g,onAfterRemoveWishlist:h,onAfterRenderProduct:p})=>{const{show_vendor:m=!0,show_sku:_=!0,show_price:v=!0,show_add_to_cart:w=!0,redirect_add_to_cart:x=!0,language_button_add_to_cart:f="Add To Cart",display_product_name_style:j={},display_price_style:C={},display_button_add_to_cart_style:y={}}=n||{},[S,N]=e.useState(null);return e.useEffect((()=>{p&&p("success")}),[]),t.jsx("div",{className:`sledge__product-grid ${s}`,"data-grid-type":i,children:null==l?void 0:l.map(((i,s)=>{const{product:l,variants:n}=i||{},{id:p,title:L,image:A,url:T,vendor:E="",currency:b}=l||{},{id:R="",title:I="",price:O="",sku:P=""}=(null==n?void 0:n.length)?n[0]:{};let k=S==R,D=!(!(null==n?void 0:n.length)||!Object.hasOwn(n[0],"inventory_quantity"))&&(!n[0].inventory_quantity&&d);const M=c?c({product:{...l,variants:n.map(((e,t)=>{const{inventory_quantity:i}=e||{};return{...e,is_out_of_stock:!!Object.hasOwn(n[t],"inventory_quantity")&&!i}}))}}):null;return c?t.jsx(e.Fragment,{children:o?t.jsx("div",{dangerouslySetInnerHTML:{__html:M}}):M},s):t.jsxs("div",{className:"sledge__product-grid-card",children:[t.jsxs("div",{className:"sledge__product-grid-content",children:[t.jsxs("div",{className:"sledge__product-grid-card-image",children:[t.jsxs("a",{href:T,onClick:()=>"instant-search"===a&&yi({productId:p}),children:[t.jsx(us,{data:{productId:p,productVariantId:R,productName:L,productVendor:E,productSku:P,productVariantName:I,productLink:T,productImage:(null==A?void 0:A.src)||`${Se}/img/blank-image.png`,productCurrency:b,productPrice:O},...r,onAfterAddWishlist:g,onAfterRemoveWishlist:h}),t.jsx("img",{src:(null==A?void 0:A.src)||"",alt:"sledge-product-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${Se}/img/blank-image.png`})]}),D?t.jsx("div",{className:"sledge__product-grid-card-out-of-stock",children:"Sold out"}):null]}),t.jsxs("div",{className:"sledge__product-grid-card-desc",children:[t.jsxs("div",{className:"sledge__product-grid-card-title",children:[L?t.jsx("a",{href:T,onClick:()=>"instant-search"===a&&yi({productId:p}),children:t.jsx("h3",{style:j,children:L})}):null,v?t.jsx("div",{className:"sledge__product-grid-card-price",children:t.jsxs("p",{style:C,children:[b,O]})}):null]}),t.jsxs("div",{className:"sledge__product-grid-card-text",children:[t.jsx("div",{children:I}),t.jsxs("div",{children:[t.jsx(t.Fragment,{children:m?t.jsxs(t.Fragment,{children:["Vendor: ",E]}):null}),t.jsx(t.Fragment,{children:" | "}),t.jsx(t.Fragment,{children:_?t.jsxs(t.Fragment,{children:["SKU: ",P]}):null})]})]}),t.jsx("div",{className:"sledge__product-grid-card-rating",children:t.jsx(Ft,{data:{productId:p},size:"xs",withSkeletonLoading:!1})})]})]}),w?t.jsx("div",{className:"sledge__product-grid-button-wrapper",children:t.jsx(Lt,{type:"button",colorType:"light",style:{...y,...k&&{cursor:"wait"}},...k||D?{disabled:!0}:{onClick:()=>(async e=>{var i;const{id:s,quantity:l}=e;N(s);let n=await It([{id:s,quantity:l}]);(null==(i=null==n?void 0:n.items)?void 0:i.length)?("wishlist"===a?await is({productId:s}):"instant-search"===a&&await Si({productId:s}),N(null),u&&u("success"),x?window.location.href="/cart":window.sledgeToastNotification({title:"Cart added",message:"Successfully added to wishlist",type:"success",icon:t.jsx(xt,{width:40,height:40,color:"black"})})):(u&&u("failed"),setTimeout((()=>{var e;N(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:t.jsx(xt,{width:40,height:40,color:"black"})})}),1e3))})({id:R,quantity:1})},children:k?"Adding...":D?"Sold out":t.jsxs(t.Fragment,{children:[t.jsx("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.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"})}),t.jsx("span",{children:f||"Add To Cart"})]})})}):null]},s)}))})},Ps="",ks=e=>{const{className:i="",value:s="",onChange:l,required:n,...d}=e;return t.jsx("div",{className:`sledge__text-area-field-wrapper ${i||""}`,children:t.jsxs(le,{className:"FormField FormTextArea",name:"review",children:[t.jsxs("div",{className:"sledge__text-area-field-control",children:[t.jsx(ne,{asChild:!0,children:t.jsx("textarea",{className:"sledge__text-area-field",value:s,onChange:e=>(e=>{l&&l(e)})(e),rows:6,maxLength:1e3,required:n,...d})}),t.jsxs("div",{className:"sledge__text-area-field-counter",children:[null==s?void 0:s.length,"/",1e3]})]}),n&&t.jsx(de,{className:"FormMessage",match:"valueMissing",children:"Required field"})]})})},Ds="",Ms=e=>{const{className:i="",value:s="",onChange:l,required:n,type:d,name:r="",...a}=e;return t.jsx("div",{className:`sledge__input-field-wrapper ${i||""}`,children:t.jsxs(le,{className:"FormField",name:r,children:[t.jsx(ne,{asChild:!0,children:t.jsx("input",{className:"sledge__input-field",type:d,value:s,required:n,onChange:e=>(e=>{l&&l(e)})(e),...a})}),n&&t.jsx(de,{className:"FormMessage",match:"valueMissing",children:"Required field"}),"email"===d&&t.jsx(de,{className:"FormMessage",match:"typeMismatch",children:"Please fill a valid email address"})]})})},Ws="",Bs=({className:e="",data:i})=>t.jsx(t.Fragment,{children:(null==i?void 0:i.length)?t.jsx("div",{className:`sledge__collection-grid ${e}`,children:i.map(((e,i)=>{const{id:s,title:l,description:n,url:d,image:r}=e;return t.jsxs("div",{className:"sledge__collection-grid-card",children:[t.jsx("div",{className:"sledge__collection-grid-card-image",children:t.jsx("img",{src:r||`${Se}/img/blank-image.png`,alt:"sledge-product-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${Se}/img/blank-image.png`})}),t.jsxs("div",{className:"sledge__collection-grid-card-content",children:[t.jsxs("div",{className:"sledge__collection-grid-card-text",children:[t.jsx("div",{className:"sledge__collection-grid-card-content-title",children:l}),t.jsx("div",{className:"sledge__collection-grid-card-content-description",children:n})]}),t.jsx("div",{className:"sledge__collection-grid-card-content-button-wrapper",children:t.jsx(Lt,{type:"button",colorType:"success",elementType:"hyperlink",link:d,children:"Shop Now"})})]})]},i)}))}):null}),Hs="",Us=({className:e="",data:i})=>t.jsx(t.Fragment,{children:(null==i?void 0:i.length)?t.jsx("div",{className:`sledge__page-grid ${e}`,children:i.map(((e,i)=>{const{id:s,title:l,description:n,url:d,image:r}=e;return t.jsx("a",{href:d,children:t.jsxs("div",{className:"sledge__page-grid-card",children:[t.jsx("div",{className:"sledge__page-grid-card-image",children:t.jsx("img",{src:r||`${Se}/img/blank-image.png`,alt:"sledge-product-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${Se}/img/blank-image.png`})}),t.jsxs("div",{className:"sledge__page-grid-card-content",children:[t.jsx("div",{className:"sledge__page-grid-card-content-title",children:l}),t.jsx("div",{className:"sledge__page-grid-card-content-description",children:n})]})]})},i)}))}):null}),Fs="",Gs=({className:e="",data:i})=>t.jsx(t.Fragment,{children:(null==i?void 0:i.length)?t.jsx("div",{className:`sledge__blog-grid ${e}`,children:null==i?void 0:i.map(((e,i)=>{const{id:s,title:l,date:n,description:d,url:r,image:a}=e;return t.jsxs("div",{className:"sledge__blog-grid-card",children:[t.jsxs("div",{className:"sledge__blog-grid-content",children:[t.jsx("div",{className:"sledge__blog-grid-card-image",children:t.jsx("a",{href:r,children:t.jsx("img",{src:a||`${Se}/img/blank-image.png`,alt:"sledge-blog-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${Se}/img/blank-image.png`})})}),t.jsxs("div",{className:"sledge__blog-grid-card-desc",children:[t.jsx("div",{className:"sledge__blog-grid-card-title",children:t.jsx("div",{children:t.jsx("a",{href:r,children:t.jsx("div",{children:l})})})}),(null==n?void 0:n.length)?t.jsx("div",{className:"sledge__blog-grid-card-date",children:n}):null,t.jsx("div",{className:"sledge__blog-grid-card-text",children:d})]})]}),t.jsx("div",{className:"sledge__blog-grid-button-wrapper",children:t.jsx(Lt,{type:"button",colorType:"light",elementType:"hyperlink",link:r,children:"Learn More"})})]},i)}))}):null}),$s="",Vs=({children:i,content:s,withArrow:l=!0,customArrow:n="",sideOffset:d=5,alignOffset:r=0,wrapTrigger:a=!0})=>{const[o,c]=e.useState(!1);return e.useEffect((()=>{var e;let t=null==(e=null==document?void 0:document.querySelector(".sledge__tooltip-arrow"))?void 0:e.parentElement;t&&(null==n?void 0:n.length)&&(t.classList.add("sledge__tooltip-arrow-parent"),t.innerHTML=n)}),[o]),t.jsx(re,{delayDuration:0,children:t.jsxs(ae,{onOpenChange:c,children:[t.jsx(oe,{asChild:!0,children:a?t.jsx("span",{children:i}):i}),t.jsx(ce,{children:t.jsxs(ue,{className:"sledge__tooltip-content",sideOffset:d,alignOffset:r,children:[s,l?t.jsx(ge,{className:"sledge__tooltip-arrow"}):null]})})]})})},qs="",zs=({children:e,isLoading:i=!1,className:s="",withCorner:l=!0})=>t.jsxs(he,{className:`sledge__scroll-area-root ${s}`,children:[t.jsx(pe,{className:"sledge__scroll-area-viewport "+(i?"sledge__scroll-area-viewport-loading":""),children:e}),!i&&t.jsxs(t.Fragment,{children:[t.jsx(me,{className:"sledge__scroll-area-scrollbar",orientation:"vertical",children:t.jsx(_e,{className:"sledge__scroll-area-thumb"})}),t.jsx(me,{className:"sledge__scroll-area-scrollbar",orientation:"horizontal",children:t.jsx(_e,{className:"sledge__scroll-area-thumb"})}),l&&t.jsx(ve,{className:"sledge__scroll-area-corner"})]})]}),Js="",Zs=({width:e,height:i,rounded:s,color:l,animationDuration:n="8s",disableAnimation:d=!1,style:r={},className:a="",...o})=>t.jsx("div",{className:`sledge__skeleton-item ${a} ${d?"":"sledge__skeleton-item-animation"}`,style:{width:e,height:i,WebkitAnimationDuration:n,animationDuration:n,...r},"data-skeleton-rounded":s,"data-skeleton-color":l,...o}),Ks=({count:e,type:i})=>{let s=[];for(let l=0;l<e;l++)s.push(t.jsxs("div",{className:"sledge__product-grid-card",children:[t.jsxs("div",{className:"sledge__product-grid-content",children:[t.jsxs("div",{className:"sledge__product-grid-card-image sledge__skeleton-product-grid-card-image",children:[t.jsx("div",{className:"sledge-wishlist__trigger-block",children:t.jsx(Zs,{width:"40px",height:"40px",color:"grey-300",rounded:"sm",disableAnimation:!0})}),t.jsx(Zs,{width:"100%",height:"100%",color:"grey-100",rounded:"md"})]}),t.jsxs("div",{className:"sledge__product-grid-card-desc",children:[t.jsxs("div",{className:"sledge__product-grid-card-title",children:[t.jsx(Zs,{width:"134px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"15s"}),t.jsx(Zs,{width:"80px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"20s"})]}),t.jsx("div",{className:"sledge__product-grid-card-text",children:t.jsx(Zs,{width:"190px",height:"46px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{marginBottom:"16px"}})})]})]}),t.jsx("div",{className:"sledge__product-grid-button-wrapper",children:t.jsx(Zs,{width:"117px",height:"40px",color:"grey-100",rounded:"md",animationDuration:"15s"})})]},l));return t.jsx("div",{className:"sledge__product-grid sledge__skeleton-product-grid sledge__skeleton-pointer-events-none","data-grid-type":i,children:s})},Ys=({count:e,type:i,gridItemHeights:s=[]})=>{let l=[];for(let n=0;n<e;n++)l.push(t.jsx("div",{className:"sledge-product-review__widget-review-card",children:t.jsx(Zs,{width:"100%",height:"list"===i||"grid"===i&&!(null==s?void 0:s.length)?"111px":s[n],color:"grey-100",rounded:"md",animationDuration:"list"===i?"2.5s":"8s"})},n));return t.jsx(ee,{columnsCountBreakPoints:"grid"===i?{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:t.jsx(te,{gutter:"30px",children:l})})},Xs=({count:e})=>{let i=[];for(let s=0;s<e;s++)i.push(t.jsxs("div",{className:"sledge__collection-grid-card",children:[t.jsx("div",{className:"sledge__collection-grid-card-image",children:t.jsx(Zs,{width:"246px",height:"246px",color:"grey-300",rounded:"md"})}),t.jsxs("div",{className:"sledge__collection-grid-card-content",children:[t.jsxs("div",{className:"sledge__collection-grid-card-text",children:[t.jsx("div",{className:"sledge__collection-grid-card-content-title",children:t.jsx(Zs,{width:"100%",height:"70px",color:"grey-300",rounded:"lg"})}),t.jsx("div",{className:"sledge__collection-grid-card-content-description",children:t.jsx(Zs,{width:"100%",height:"47px",color:"grey-300",rounded:"md",style:{maxWidth:"357px"}})})]}),t.jsx("div",{className:"sledge__collection-grid-card-content-button-wrapper",children:t.jsx(Zs,{width:"100%",height:"40px",color:"grey-300",rounded:"md",animationDuration:"20s",style:{maxWidth:"117px"}})})]})]},s));return t.jsx("div",{className:"sledge__collection-grid sledge__skeleton-collection-grid sledge__skeleton-pointer-events-none",children:i})},Qs=({count:e})=>{let i=[];for(let s=0;s<e;s++)i.push(t.jsxs("div",{className:"sledge__page-grid-card",children:[t.jsx("div",{className:"sledge__page-grid-card-image",children:t.jsx(Zs,{width:"100%",height:"100%",color:"grey-300",rounded:"md",animationDuration:"13s",style:{borderTopRightRadius:0,borderBottomRightRadius:0}})}),t.jsxs("div",{className:"sledge__page-grid-card-content",children:[t.jsx("div",{className:"sledge__page-grid-card-content-title",children:t.jsx(Zs,{width:"100%",height:"40px",color:"grey-300",rounded:"md",animationDuration:"6s"})}),t.jsx("div",{className:"sledge__page-grid-card-content-description",children:t.jsx(Zs,{width:"100%",height:"40px",color:"grey-300",rounded:"md",animationDuration:"17s",style:{maxWidth:"115px"}})})]})]},s));return t.jsx("div",{className:"sledge__page-grid sledge__skeleton-page-grid sledge__skeleton-pointer-events-none",children:i})},el=({count:e})=>{let i=[];for(let s=0;s<e;s++)i.push(t.jsx("div",{className:"sledge__blog-grid-card",children:t.jsxs("div",{className:"sledge__blog-grid-content",children:[t.jsx("div",{className:"sledge__blog-grid-card-image",children:t.jsx(Zs,{width:"100%",height:"100%",color:"grey-100",rounded:"md",animationDuration:"10s"})}),t.jsxs("div",{className:"sledge__blog-grid-card-desc",children:[t.jsx(Zs,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"242px",marginTop:"26px",marginBottom:"12px"}}),t.jsx(Zs,{width:"100%",height:"28px",color:"grey-100",rounded:"md",animationDuration:"23s",style:{maxWidth:"80px",marginBottom:"27px"}}),t.jsx(Zs,{width:"100%",height:"80px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{maxWidth:"190px",marginBottom:"27px"}}),t.jsx(Zs,{width:"100%",height:"40px",color:"grey-100",rounded:"md",animationDuration:"20s",style:{maxWidth:"117px"}})]})]})},s));return t.jsx("div",{className:"sledge__blog-grid sledge__skeleton-blog-grid sledge__skeleton-pointer-events-none",children:i})},tl={Item:Zs,ReviewGrid:Ys,ProductGrid:Ks,CollectionGrid:Xs,PageGrid:Qs,BlogGrid:el},il="color: white; background: black; border: 1px solid white; padding: 2px 5px; border-radius: 350px;";fe((()=>{let e=document.querySelector(`script[id="${Le}"]`);const t=null==e?void 0:e.getAttribute(Te.GLOBAL.API_KEY),i=null==e?void 0:e.getAttribute(Te.GLOBAL.INSTANT_SEARCH_API_KEY),s=null==e?void 0:e.getAttribute(Te.GLOBAL.USER_ID),l=null==e?void 0:e.getAttribute(Te.GLOBAL.USER_EMAIL),n=null==e?void 0:e.getAttribute(Te.GLOBAL.USER_FULLNAME);He({API_KEY:t||"",INSTANT_SEARCH_API_KEY:i||"",USER_ID:s||"",USER_EMAIL:l||"",USER_FULLNAME:n||""}).then((e=>{var t,i;(null==(t=null==e?void 0:e.data)?void 0:t.token)?($e(),ze(),Ke(),Be("wishlist").then((e=>{var t;200===(null==(t=null==e?void 0:e.status)?void 0:t.code)?(localStorage.setItem(Ee.WISHLIST_SETTING,JSON.stringify(e)),Is()):console.error("%cSledge",il,"Error wishlist app settings")})),Be("review").then((e=>{var t;200===(null==(t=null==e?void 0:e.status)?void 0:t.code)?(localStorage.setItem(Ee.PRODUCT_REVIEW_SETTING,JSON.stringify(e)),hi()):console.error("%cSledge",il,"Error product review app settings")})),Be("instantsearch").then((e=>{var t;200===(null==(t=null==e?void 0:e.status)?void 0:t.code)?(localStorage.setItem(Ee.INSTANT_SEARCH_SETTING,JSON.stringify(e)),Ui()):console.error("%cSledge",il,"Error instant search app settings")}))):console.error("%cSledge",il,`${(null==(i=e.status)?void 0:i.code)?e.status.message:e}`)}))}));
1
+ import{R as React,j as jsxRuntimeExports,$ as $905f4ae918aab1aa$export$be92b6f5f03c0fe9,a as $905f4ae918aab1aa$export$602eac185826482c,b as $905f4ae918aab1aa$export$c6fdb837b070b4ff,c as $905f4ae918aab1aa$export$7c6e2c02157bb7d2,d as $905f4ae918aab1aa$export$f99233281efd08a0,e as $905f4ae918aab1aa$export$393edc798c47379d,f as $905f4ae918aab1aa$export$848c9b7ead0df967,g as $905f4ae918aab1aa$export$e19cd5f9376f8cee,h as client,i as $5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,k as $5d3850c4d0b4e6c7$export$602eac185826482c,l as $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,m as $5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,n as $5d3850c4d0b4e6c7$export$f99233281efd08a0,o as $5d3850c4d0b4e6c7$export$393edc798c47379d,p as $054eb8030ebde76e$export$2881499e37b75b9a,q as $054eb8030ebde76e$export$be92b6f5f03c0fe9,r as $054eb8030ebde76e$export$f99233281efd08a0,s as $054eb8030ebde76e$export$393edc798c47379d,t as $054eb8030ebde76e$export$e19cd5f9376f8cee,u as $054eb8030ebde76e$export$d5c6c08dc2d3ca7,v as $cb5cc270b50c6fcd$export$be92b6f5f03c0fe9,w as $cb5cc270b50c6fcd$export$41fb9f06171c75f4,x as $cb5cc270b50c6fcd$export$602eac185826482c,y as $cb5cc270b50c6fcd$export$7c6e2c02157bb7d2,z as $cb5cc270b50c6fcd$export$f39c2d165cd861fe,A as $cb5cc270b50c6fcd$export$21b07c8f274aebd5,B as $67824d98245208a0$export$be92b6f5f03c0fe9,C as $67824d98245208a0$export$adb584737d712b70,D as $e698a72e93240346$export$be92b6f5f03c0fe9,E as $e698a72e93240346$export$adb584737d712b70,F as $faa2e61a3361514f$export$be92b6f5f03c0fe9,G as $faa2e61a3361514f$export$13921ac0cc260818,H as $faa2e61a3361514f$export$9a58ef0d7ad3278c,I as $faa2e61a3361514f$export$6521433ed15a34db,J as $f99a8c78507165f7$export$be92b6f5f03c0fe9,K as $f99a8c78507165f7$export$6d08773d2e66f8f2,L as $f99a8c78507165f7$export$adb584737d712b70,M as $cc7e05a45900e73f$export$6d08773d2e66f8f2,N as $cc7e05a45900e73f$export$d6e5bf9c43ea9319,O as $cc7e05a45900e73f$export$c3468e2714d175fa,P as $cc7e05a45900e73f$export$be92b6f5f03c0fe9,Q as $cc7e05a45900e73f$export$41fb9f06171c75f4,S as $cc7e05a45900e73f$export$4c8d1a57a761ef94,T as $cc7e05a45900e73f$export$f04a61298a47a40f,U as $cc7e05a45900e73f$export$602eac185826482c,V as $cc7e05a45900e73f$export$7c6e2c02157bb7d2,W as $cc7e05a45900e73f$export$2f60d3ec9ad468f2,X as $cc7e05a45900e73f$export$d5c6c08dc2d3ca7,Y as $cc7e05a45900e73f$export$bf1aedc3039c8d63,Z as reactExports,_ as motion,a0 as MasonryResponsive,a1 as Masonry,a2 as $d94698215c4408a7$export$be92b6f5f03c0fe9,a3 as $d94698215c4408a7$export$2c4cf1f7b42ef78c,a4 as $d94698215c4408a7$export$a455218a85c89869,a5 as $d94698215c4408a7$export$7a7fa4424cb20976,a6 as $d94698215c4408a7$export$f69c19e57285b83a,a7 as $a093c7e1ec25a057$export$2881499e37b75b9a,a8 as $a093c7e1ec25a057$export$be92b6f5f03c0fe9,a9 as $a093c7e1ec25a057$export$41fb9f06171c75f4,aa as $a093c7e1ec25a057$export$602eac185826482c,ab as $a093c7e1ec25a057$export$7c6e2c02157bb7d2,ac as $a093c7e1ec25a057$export$21b07c8f274aebd5,ad as $57acba87d6e25586$export$be92b6f5f03c0fe9,ae as $57acba87d6e25586$export$d5c6c08dc2d3ca7,af as $57acba87d6e25586$export$9a4e88b92edfce6b,ag as $57acba87d6e25586$export$6521433ed15a34db,ah as $57acba87d6e25586$export$ac61190d9fc311a9}from"./assets/vendor-f2befdd9.js";const root="",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,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_COMPONENT:"data-render-component"},WISHLIST:{SHARE_ID:"data-share-id"},PRODUCT_REVIEW:{RATING_SIZE:"data-rating-size"},INSTANT_SEARCH:{QUERY_KEYWORD:"data-query-keyword"}},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_PRODUCT_CARDS:`[${SELECTOR_ATTRIBUTE_KEY}="product-cards"]`,ELEMENT_SUGGESTION_KEYWORD_LISTS:`[${SELECTOR_ATTRIBUTE_KEY}="suggestion-keyword-lists"]`,ELEMENT_OTHER_INDEX_LISTS:`[${SELECTOR_ATTRIBUTE_KEY}="other-index-lists"]`,ELEMENT_SEARCH_VIEW_MORE_RESULT:`[${SELECTOR_ATTRIBUTE_KEY}="search-view-more-result"]`},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 }}"}},SEPARATE_COMPONENT_DISPLAY_NAME={PRODUCT:{CARDS:"ProductCards"},SUGGESTION_KEYWORD_LISTS:"SuggestionKeywordLists",OTHER_INDEX_LISTS:"OtherIndexLists",SEARCH_VIEW_MORE_RESULT:"SearchViewMoreResult"},SHOPIFY_GID="gid://shopify/",SHOPIFY_GID_PRODUCT_ID=`${SHOPIFY_GID}Product/`,SHOPIFY_GID_PRODUCT_VARIANT_ID=`${SHOPIFY_GID}ProductVariant/`,getSetting=async e=>{let t=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/${e}/setting`,i).then((e=>e.json())).then((e=>e)).catch((()=>{}))},getToken=async e=>{const{API_KEY:t,INSTANT_SEARCH_API_KEY:s,USER_ID:i,USER_EMAIL:n,USER_FULLNAME:r}=e;var o=new Headers;o.append("Authorization",`Bearer ${t||""}`),o.append("Content-Type","application/json");var l={method:"POST",headers:o,body:JSON.stringify({user:{id:i||"",email:n||"",name:r||"",anonym:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||""}}),redirect:"follow"};return await fetch(`${API_URL}/app/token`,l).then((e=>e.json())).then((async e=>{const{data:t}=e||{},{anonym:i,token:n}=t||{};return localStorage.setItem(LOCAL_STORAGE_KEY.ANONYM_ID,i||""),localStorage.setItem(LOCAL_STORAGE_KEY.AUTH_APP,n||""),localStorage.setItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_AUTH_APP,s||""),e})).catch((e=>e))},Loading="",ConfirmationPopup$1="",ConfirmationPopup=()=>{const[e,t]=React.useState(""),[s,i]=React.useState(""),[n,r]=React.useState(""),[o,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:o,buttonSubmitType:a,onSubmit:c})=>{u(!0),t(e),i(s),r(n),l(o),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 AlertDialogOverlay"}),jsxRuntimeExports.jsxs($905f4ae918aab1aa$export$7c6e2c02157bb7d2,{className:"sledge__alert-dialog-content AlertDialogContent",children:[jsxRuntimeExports.jsx($905f4ae918aab1aa$export$f99233281efd08a0,{className:"AlertDialogTitle",dangerouslySetInnerHTML:{__html:e}}),jsxRuntimeExports.jsx($905f4ae918aab1aa$export$393edc798c47379d,{className:"AlertDialogDescription",dangerouslySetInnerHTML:{__html:s}}),jsxRuntimeExports.jsxs("div",{className:"AlertDialogFooter",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:o})}),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,r]=React.useState(""),[o,l]=React.useState(!1);return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeInfoPopup=({title:e,message:s,textCancel:n})=>{l(!0),t(e),i(s),r(n)})}),[]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:o,onOpenChange:l,children:jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$602eac185826482c,{children:[jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__dialog-overlay DialogOverlay"}),jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,{className:"sledge__dialog-content DialogContent",children:[jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$f99233281efd08a0,{className:"DialogTitle",dangerouslySetInnerHTML:{__html:e}}),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$393edc798c47379d,{className:"DialogDescription",dangerouslySetInnerHTML:{__html:s}}),jsxRuntimeExports.jsx("div",{className:"DialogCloseButton",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,r]=React.useState(""),[o,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:o=null,type:a})=>{i(e),r(s),l(n),d(o),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":o})]})},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:r,className:o,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 ${o||""}`,sideOffset:c,alignOffset:u,align:r,...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,r]=React.useState(0);return React.useEffect((()=>{const s=setTimeout((()=>r(+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:r,labelStyle:o={},onClick:l})=>jsxRuntimeExports.jsxs("div",{className:"sledge__checkbox-wrapper",children:[jsxRuntimeExports.jsx($e698a72e93240346$export$be92b6f5f03c0fe9,{className:"sledge__checkbox-root",defaultChecked:r,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:o,children:n})]}),Slider$1="",Slider=e=>{const{defaultValue:t,min:s,max:i,step:n=1,setValueCommit:r,setValueChange:o}=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=>{r&&r(e),a(e)},onValueChange:e=>{o&&o(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,r=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",...r?{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:r={},onValueChange:o})=>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:o,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:r,children:i})]},s)}))})})}),ColorSwatch$1="",ColorSwatch=({id:e,name:t,value:s,rgb:i,image:n,required:r,defaultChecked:o,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:o,id:e,name:t,value:s,required:r,onClick:l,style:a})})},Select$1="",Select=({name:e,placeholder:t,required:s,defaultValue:i,items:n,labelStyle:r={},onValueChange:o})=>jsxRuntimeExports.jsx("div",{className:"sledge__select-wrapper",children:jsxRuntimeExports.jsxs($cc7e05a45900e73f$export$be92b6f5f03c0fe9,{name:e,required:s,onValueChange:o,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:r=!1,elementType:o="button",link:l="",...a}=e;return"hyperlink"===o&&(null==l?void 0:l.length)?jsxRuntimeExports.jsx("a",{href:l,className:`sledge__button ${s||""}`,"data-button-color-type":n,"data-button-full-width":r,ref:t,...a,children:i}):jsxRuntimeExports.jsx("button",{className:`sledge__button ${s||""}`,"data-button-color-type":n,"data-button-full-width":r,ref:t,...a,children:i})})),SearchInputField$1="",SearchInputField=e=>{const{className:t="",icon:s,value:i="",withClearField:n,onChange:r,onResetField:o,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=>{r&&r({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(),r&&r({value:""}),o&&o()},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:r="",align:o="end",onChange:l,value:a="",options:d=[]}=e,[c,u]=React.useState(!1),x=(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==r?void 0:r.length)?`${r} ${x}`:x})]}),content:jsxRuntimeExports.jsx("ul",{className:"sledge__select-field-option",children:null==d?void 0:d.map(((e,t)=>{const{label:s,value:i}=e;return jsxRuntimeExports.jsx("li",{onClick:()=>((e,t)=>{l&&l({label:e,value:t}),u(!1)})(s,i),...i===a&&{"data-selected":!0},children:s},t)}))}),isOpen:c,setIsOpen:u,hideCloseIcon:!0,align:o,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((()=>{}))},Badge$1="",Rating$1="",getReview=async(e,t)=>{const{page:s,limit:i,sort:n,keyword:r,rating:o}=t||{};let l=sanitizeDataId(e),a=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),d="?"+new URLSearchParams({page:s||"",limit:i||"",sort:n||"",keyword:r||"",rating:o||""}).toString();var c=new Headers;c.append("Authorization",`Bearer ${a}`);var u={method:"GET",headers:c,redirect:"follow"};return await fetch(`${API_URL}/review/${l}${d}`,u).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:r,rating:o,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(r)},review:{rating:o,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",data:n,withSkeletonLoading:r=!0}=e,{productId:o}=n||{},{isRenderApp:l}=React.useContext(SledgeContext),[a,d]=React.useState(!0),[c,u]=React.useState(!0),[x,p]=React.useState({width:0,height:0}),[m,g]=React.useState(0),[_,R]=React.useState("0"),[h,E]=React.useState({}),j=usePrevious({productId:o}),{fill_color:v,outline_color:w}=(null==(t=null==h?void 0:h.display)?void 0:t.rating)||{},T=async e=>{let t;u(!0);let i=!1;if(t=JSON.parse(e),!t)return;const{status:r,data:l}=t,{code:a}=r;i=200===a||!1,i&&(E(l),await(async()=>{var e;if(s&&!n)R(s),u(!1);else{let t,s,i=!1,n=0;if(t=await getReviewInfo(o),!t)return;const{status:r,data:l}=t,{code:a}=r;i=200===a||!1,n=(null==l?void 0:l.review_count)?l.review_count:0,s=(null==(e=null==l?void 0:l.rating)?void 0:e.average)?l.rating.average:0,i&&(g(n),R(s),u(!1),d(!1))}})())};return React.useEffect((()=>{if(!(null==l?void 0:l.productReview))return;p("xs"===i?{width:14.4,height:14.4}:"sm"===i?{width:18,height:18}:{width:28.8,height:28.8}),Boolean(j&&(null==j?void 0:j.productId)!==o)&&d(!0),T(localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||"")}),[l,o]),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__rating",children:a&&r?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:v||"#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:w||"#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"})]})})]}),!c&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[[1,2,3,4,5].map(((e,t)=>{let s=Math.floor(parseFloat(_)),i=String(_).includes(",")?String(_).split(","):[],n=String(_).includes(".")?String(_).split("."):[],r=i.length||n.length?i[1]||n[1]:0,o="fill-0";return e>s&&s+1===e&&(o=`fill-${r}`),reactExports.createElement("svg",{...x,viewBox:"0 0 30 29","data-product-review-rating-fill":e<=s?"full":o,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:["(",m,")"]}):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}},children:jsxRuntimeExports.jsx(Rating,{data:{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})},Widget$3="",WidgetHeaderAddTrigger=({isFirstLoading:e,text:t,dataSettings:s,data:i,onAfterAddReview:n})=>{var r,o,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==(o=null==(r=null==s?void 0:s.display)?void 0:r.widget)?void 0:o.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})=>{var r,o;const{default_sort:l,show_sorting_options:a}=(null==(r=null==s?void 0:s.display)?void 0:r.widget)||{},[d,c]=React.useState(l||null),u=d||(null==(o=t[0])?void 0:o.value);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:a?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-header-item",children:e?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"134px",height:"42px",rounded:"lg",color:"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:u,onChange:({value:e})=>(e=>{c(e),n&&n(!0),i&&i(e)})(e)})}):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{data:n,dataSettings:r}=e,{productId:o}=n||{},{fill_color:l,outline_color:a}=(null==(s=null==(t=null==r?void 0:r.display)?void 0:t.widget)?void 0:s.summary_bar)||{},{review_singular:d,review_plural:c}=(null==(i=null==r?void 0:r.languages)?void 0:i.widget)||{},[u,x]=React.useState(!0),[p,m]=React.useState(!0),[g,_]=React.useState(!0),[R,h]=React.useState(!0),[E,j]=React.useState(!1),[v,w]=React.useState(0),[T,f]=React.useState({5:0,4:0,3:0,2:0,1:0}),[S,A]=React.useState("0"),C=usePrevious({productId:o}),L=async()=>{var e;let t,s,i,n=!1,r=0;if(t=await getReviewInfo(o),!t)return;const{status:l,data:a}=t,{code:d}=l;n=200===d||!1,r=(null==a?void 0:a.review_count)?a.review_count:0,s=(null==a?void 0:a.rating)?{5:a.rating[5]||0,4:a.rating[4]||0,3:a.rating[3]||0,2:a.rating[2]||0,1:a.rating[1]||0}:T,i=(null==(e=null==a?void 0:a.rating)?void 0:e.average)?a.rating.average:"0",n&&(w(r),f(s),A(i),_(!1),h(!1),x(!1),E&&m(!1))};return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetSummaryUpdate=()=>{h(!0),L()}),Boolean(C&&(null==C?void 0:C.productId)!==o)&&x(!0),L()}),[E,o]),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary",children:u?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"630px",height:"42px",color:"grey-100",rounded:"md",animationDuration:"5s"}):jsxRuntimeExports.jsx(Popover,{trigger:g?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}):jsxRuntimeExports.jsxs(motion.div,{initial:!1,animate:E?"open":"closed",className:"sledge-product-review__widget-summary-trigger",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-average",children:S}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-rating",children:!R&&jsxRuntimeExports.jsx(Rating,{value:String(S),size:"md",withSkeletonLoading:!1})}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-total",children:[v," ",v>1?c||"Reviews":d||"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:p?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}),jsxRuntimeExports.jsx(Progress,{value:String(T[e]),total:v,fillColor:l,outlineColor:a}),jsxRuntimeExports.jsxs("small",{children:["(",T[e],")"]})]},t)))})}),setIsOpen:j,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:r,currentPage:o,setCurrentPage:l,totalPage:a,totalData:d,setIsReplaceWidgetList:c}=e||{},{type:u}=(null==(t=null==r?void 0:r.display)?void 0:t.widget)||{},x="list"===u?jsxRuntimeExports.jsx(Pagination,{currentPage:o||1,totalPage:a||1,totalResult:d||0,onChange:e=>(e=>{l&&l(e),c&&c(!0)})(e)}):null;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:i?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SkeletonLoading.ReviewGrid,{count:"grid"===u?8:10,type:u,gridItemHeights:["252px","342px","196px","398px","342px","252px","398px","196px"]}),s?null:x]}):jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-wrapper","data-layout-type":u,children:(null==n?void 0:n.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ReviewWrapper,{...e}),x]}):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)||{},[r,o]=React.useState(""),[l,a]=React.useState("");return React.useEffect((()=>{o(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:r}}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-product-empty-description",dangerouslySetInnerHTML:{__html:l}})]})},ReviewWrapper=e=>{var t,s,i,n,r,o,l,a;const{productReviewData:d,currentPage:c,setCurrentPage:u,totalPage:x,totalData:p,dataSettings:m,setIsRefreshWidgetList:g,setIsReplaceWidgetList:_}=e||{},{type:R,rating_size:h,show_review_date:E}=(null==(t=null==m?void 0:m.display)?void 0:t.widget)||{},{text_color:j,border_color:v,border_radius:w,padding_top:T,padding_bottom:f,padding_left:S,padding_right:A,background_color:C,font_size:L,font_weight:I,text_transform:N}=(null==(i=null==(s=null==m?void 0:m.display)?void 0:s.widget)?void 0:i.button_load_more)||{},{text_color:y,border_color:b,border_radius:O,padding_top:$,padding_bottom:D,padding_left:P,padding_right:W,background_color:U,font_size:k,font_weight:M,text_transform:B}=(null==(r=null==(n=null==m?void 0:m.display)?void 0:n.widget)?void 0:r.verified)||{},{button_load_more:H,verified:F}=(null==(o=null==m?void 0:m.languages)?void 0:o.widget)||{},{name:G,image:V}=(null==(a=null==(l=null==m?void 0:m.display)?void 0:l.widget)?void 0:a.replier)||{},Y={...j&&{color:j},...v&&{borderColor:v},...w&&{borderRadius:w},...T&&{paddingTop:T},...f&&{paddingBottom:f},...S&&{paddingLeft:S},...A&&{paddingRight:A},...C&&{backgroundColor:C},...L&&{fontSize:L},...I&&{fontWeight:I},...N&&{textTransform:N}},K={...y&&{color:y},...b&&{borderWidth:"1px",borderStyle:"solid",borderColor:b},...O&&{borderRadius:O},...$&&{paddingTop:$},...D&&{paddingBottom:D},...P&&{paddingLeft:P},...W&&{paddingRight:W},...U&&{backgroundColor:U},...k&&{fontSize:k},...M&&{fontWeight:M},...B&&{textTransform:B}};let q=c||0,z=x||0;const[J,Z]=React.useState(!1),[X,Q]=React.useState(!1);React.useEffect((()=>{Q(!(z===q&&!J)&&z>=q)}),[J]),React.useEffect((()=>{Z(!1)}),[d]);const ee=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:r,review:o,media:l,reply:a,is_verified:d},created_at:c}=e;let u=new Intl.DateTimeFormat("en-US").format(new Date(c)),x=G?String(String(G).includes("<span>")?String(G).split("<span>")[0]:String(G)).replaceAll(OBJECT_DATA_STRING_KEY.STORE.NAME,null==(s=a[0])?void 0:s.name):null==(i=a[0])?void 0:i.name,p=G?getTextBetween("<span>","</span>",G):"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:K,children:F}):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:h,withSkeletonLoading:!1})}),E?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:o.length>=250?`${o.slice(0,250)}...`:o})]}),(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",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:V||"",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,{}),X&&jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-button-load-more",children:jsxRuntimeExports.jsx(Button,{type:"button",role:"button",colorType:"light",disabled:J,onClick:()=>{u&&c&&u(c+1),Z(!0)},style:{...Y,...J&&{cursor:"wait"}},children:J?"Loading...":H||"Load More"})})]}),te=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:r},review:{rating:o,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=G?String(String(G).includes("<span>")?String(G).split("<span>")[0]:String(G)).replaceAll(OBJECT_DATA_STRING_KEY.STORE.NAME,null==(s=d[0])?void 0:s.name):null==(i=d[0])?void 0:i.name,g=G?getTextBetween("<span>","</span>",G):"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:r}),c?jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-review-card-verified-text",style:K,children:F}):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:h,withSkeletonLoading:!1})}),E?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:V||"",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",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"===R?te:ee},WidgetRoot$1=e=>{const{children:t,data:s,onAfterAddReview:i}=e,{productId:n}=s||{},{isRenderApp:r}=React.useContext(SledgeContext),[o,l]=React.useState(!0),[a,d]=React.useState(!0),[c,u]=React.useState(!1),[x,p]=React.useState(!1),[m,g]=React.useState([]),[_,R]=React.useState([]),[h,E]=React.useState(""),[j,v]=React.useState(1),[w,T]=React.useState(0),[f,S]=React.useState(0),[A,C]=React.useState({}),L=usePrevious({currentPage:j,isReplaceWidgetList:x,productId:n}),I=async(e=!1,t=!1,s)=>{var i;let r,o=10,a=h;if(d(!!t||!e),!e||t){t||v(1),g([]);let e=await N(s);const{review_per_page:n,default_sort:r}=(null==(i=null==e?void 0:e.display)?void 0:i.widget)||{};o=n||o,a=h||r,E(a)}let c,x,_=!1,w=0,f=0,A={page:e?j:1,limit:o,sort:a};if(r=await getReview(n,A),!r)return;const{status:C,data:L,page:I,sorts:y}=r,{code:b}=C;_=200===b||!1,c=(null==L?void 0:L.length)?t=>(null==m?void 0:m.length)&&e?[...t,...L]:L:[],x=(null==y?void 0:y.length)?y:[],w=(null==I?void 0:I.total_page)||1,f=(null==I?void 0:I.total_data)||1,_&&(g(c),R(x),T(w),S(f),d(!1),u(!1),p(!1),setTimeout((()=>{l(!1)}),1300))},N=async e=>{let t,s=!1;if(t=JSON.parse(e),!t)return;const{status:i,data:n}=t,{code:r}=i;return s=200===r||!1,s?(C(n),n):void 0};return React.useEffect((()=>{if(!(null==r?void 0:r.productReview))return;let e=localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||"";"undefined"!=typeof window&&(window.sledgeProductReviewWidgetListUpdate=()=>{I(!1,!1,e)}),Boolean(L&&(null==L?void 0:L.productId)!==n)&&I(!1,!1,e),N(e)}),[r,n]),React.useEffect((()=>{if(!(null==r?void 0:r.productReview))return;let e=Boolean(L&&(null==L?void 0:L.currentPage)!==j),t=localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||"";Boolean(L&&(null==L?void 0:L.isReplaceWidgetList)!==x)?I(!0,!0,t):I(!c&&e,x,t)}),[j,c,x,r]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-wrapper",children:React.Children.count(t)&&React.Children.map(t,(e=>React.cloneElement(e,{data:s,isFirstLoading:o,isLoading:a,productReviewData:m,productReviewSort:_,selectedSort:h,currentPage:j,totalPage:w,totalData:f,dataSettings:A,setIsLoading:d,setIsRefreshWidgetList:u,setIsReplaceWidgetList:p,setSelectedSort:E,setCurrentPage:v,onAfterAddReview:i})))})})},Widget$2=({children:e})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:React.Children.count(e)&&React.Children.map(e,(e=>React.cloneElement(e,{})))});Widget$2.Root=WidgetRoot$1,Widget$2.Header=WidgetHeader$1,Widget$2.List=WidgetList$1;const WidgetPopupDetail$1="",WidgetPopupDetail=()=>{var e,t,s;const[i,n]=React.useState(!1),[r,o]=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:$,padding_bottom:D,padding_left:P,padding_right:W,background_color:U,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:H}=(null==(s=null==S?void 0:S.languages)?void 0:s.widget)||{},F={...y&&{color:y},...b&&{borderWidth:"1px",borderStyle:"solid",borderColor:b},...O&&{borderRadius:O},...$&&{paddingTop:$},...D&&{paddingBottom:D},...P&&{paddingLeft:P},...W&&{paddingRight:W},...U&&{backgroundColor:U},...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,r;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)||{};o(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==(r=R[0])?void 0:r.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})})}),[]),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 DialogContent",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 r="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:r},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:r}),v?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-verified-text",style:F,children:H}):null]}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-content-subheading",children:[jsxRuntimeExports.jsx(Rating,{value:l,size:"sm",withSkeletonLoading:!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$1="",WidgetFormAdd=()=>{var e,t,s,i;const{sledgeAnonymId:n}=React.useContext(SledgeContext),[r,o]=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,$]=React.useState(""),[D,P]=React.useState(""),[W,U]=React.useState(0),[k,M]=React.useState(""),[B,H]=React.useState(""),[F,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:D,rating:W,title:k,review:B,mediaIds:F}),!e)return;const{status:{code:s}}=e;t=200===s,t?(S.onAfterAddReview("success"),setTimeout((()=>{_(!1),o(!1),c(l[0]),L(""),N(""),b(""),U(0),M(""),H(""),G([]),Y([]),ne&&ne(),"undefined"!=typeof window&&(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:r}=e,{code:o}=n;t=200===o||!1,s=(null==r?void 0:r.ids)||[],i=(null==r?void 0:r.media)||[],t&&(G(s),Y(i),h(!1),j(!1),w(null))},re=()=>{"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||{};o(!0),$(s||""),P(i||""),t&&A({onAfterAddReview:t})}),(async e=>{let t,s=!1;if(t=JSON.parse(e),!t)return;const{status:i,data:n}=t,{code:r}=i;s=200===r||!1,s&&(f(n),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(!!W),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,W,B,C,y,n]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:r,onOpenChange:o,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 DialogContent",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():re&&re()})(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:W,postReview:B,postMedia:V,setIsLoadingUploadMedia:h,setIsLoadingDeleteMedia:j,setSelectedDeleteMediaId:w,handleNext:ie,handleProductReviewMedia:ne,handleAddReview:se,setPostUserFirstName:L,setPostUserLastName:N,setPostUserEmail:b,setPostRating:U,setPostTitle:M,setPostReview:H,confirmAddReview:re})}),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:r,setPostRating:o,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===r&&"selected"}`,onClick:()=>{return t=e.rate,s=e.title,o&&o(t),void(l&&l(s));var t,s},style:{...L,..._&&R?{backgroundColor:e.rate===r?R:_}:{}},children:[jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{productReview:!0}},children:jsxRuntimeExports.jsx(Rating,{value:e.rate,size:"md",withSkeletonLoading:!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:r,postMedia:o,postReview:l,setIsLoadingUploadMedia:a,setIsLoadingDeleteMedia:d,setSelectedDeleteMediaId:c,handleNext:u,handleProductReviewMedia:x,setPostMediaIds:p,setPostMedia:m,setPostReview:g}=e,{description:_}=(null==(t=null==r?void 0:r.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:r,data:o}=t||{},{code:l}=r||{};s=200===l,i=(null==o?void 0:o.ids)||[],n=(null==o?void 0:o.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==o?void 0:o.length)?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form-upload-media-filled",children:[o.map(((e,t)=>{const{id:s,file:r,type:o}=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"===o?jsxRuntimeExports.jsx("img",{src:r,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:r})})]},t)})),w]})}):w]})},Step_PersonalData=e=>{var t;const{dataSettings:s,postUserFirstName:i,postUserLastName:n,postUserEmail:r,setPostUserFirstName:o,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=>o&&o(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:r}),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}},children:jsxRuntimeExports.jsxs(Widget$2.Root,{data:{productId:PRODUCT_ID||"",productVariantId:PRODUCT_VARIANT_ID||""},onAfterAddReview:state=>{element&&ON_AFTER_ADD_REVIEW&&eval(ON_AFTER_ADD_REVIEW)({element:element,state:state})},children:[jsxRuntimeExports.jsxs(Widget$2.Header,{children:[jsxRuntimeExports.jsx(WidgetHeader$1.Summary,{}),jsxRuntimeExports.jsx(WidgetHeader$1.AddTrigger,{}),jsxRuntimeExports.jsx(WidgetHeader$1.Sort,{})]}),jsxRuntimeExports.jsx(Widget$2.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(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(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,_b,_c,_d;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_PRODUCT_CARDS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_COMPONENT);null==(_b=element.querySelector(SELECTOR.GLOBAL.ELEMENT_SUGGESTION_KEYWORD_LISTS))||_b.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_COMPONENT),null==(_c=element.querySelector(SELECTOR.GLOBAL.ELEMENT_OTHER_INDEX_LISTS))||_c.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_COMPONENT),null==(_d=element.querySelector(SELECTOR.GLOBAL.ELEMENT_SEARCH_VIEW_MORE_RESULT))||_d.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_COMPONENT),element.innerHTML="",client.createRoot(element).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0}},children:jsxRuntimeExports.jsx(ProductFilterWidget,{query:{keyword:QUERY_KEYWORD||""},data:{collectionId:Number(COLLECTION_ID)||""},onAfterAddToCart:state=>{element&&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)({element:element,state:state})},onAfterRemoveWishlist:state=>{element&&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)({element:element,state:state})},children:jsxRuntimeExports.jsx(ProductCards,{component:PRODUCT_CARDS?eval(PRODUCT_CARDS):null,isJsVersion:!0})})})}))}}))},SearchIconWidget$1="",SearchIconWidget=e=>{const{size:t="sm",children:s,onAfterAddToCart:i,onAfterAddWishlist:n,onAfterRemoveWishlist:r,onAfterRenderProduct:o}=e||{};let l=null,a=null,d=null,c=null,u=!1;React.Children.map(s,(e=>{if(React.isValidElement(e)&&isFunction(e.type)){const{component:t,isJsVersion:s}=(null==e?void 0:e.props)||{};switch(u=s,e.type.name){case SEPARATE_COMPONENT_DISPLAY_NAME.PRODUCT.CARDS:l=t;break;case SEPARATE_COMPONENT_DISPLAY_NAME.SUGGESTION_KEYWORD_LISTS:a=t;break;case SEPARATE_COMPONENT_DISPLAY_NAME.OTHER_INDEX_LISTS:d=t;break;case SEPARATE_COMPONENT_DISPLAY_NAME.SEARCH_VIEW_MORE_RESULT:c=t}}}));const{isRenderApp:x}=React.useContext(SledgeContext),[p,m]=React.useState({width:0,height:0});React.useEffect((()=>{(null==x?void 0:x.instantSearch)&&m("xs"===t?{width:14,height:14}:"sm"===t?{width:20,height:20}:{width:25,height:25})}),[x]);return jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__icon-widget",onClick:()=>{"undefined"!=typeof window&&window.sledgeInstantSearchIconWidgetPopup&&window.sledgeInstantSearchIconWidgetPopup(i,n,r,o,u,l,a,d,c)},children:jsxRuntimeExports.jsx(SearchIcon,{...p,color:"currentColor"})})},SearchIconWidgetPopup$1="",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 r={method:t,headers:n,redirect:"follow",...s&&{body:JSON.stringify(s)}};return await fetch(`${INSTANT_SEARCH_ENGINE_URL}${e}`,r).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 r={method:"POST",headers:n,body:JSON.stringify({keyword:t,result_count:s}),redirect:"follow"};return await fetch(`${API_URL}/instantsearch/statistics/search`,r).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$1=({listsComponent:e,name:t,items:s,isComponentJsVersion:i})=>{const n=e?e({name:t,items:s}):null;return e?i?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:n}}):n: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$1=({listsComponent:e,keywords:t,isComponentJsVersion:s=!1})=>{const i=e?e({keywords:t}):null;return e?s?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:i}}):i: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$1=({component:e,keyword:t,isComponentJsVersion:s=!1})=>{const i=e?e({keyword:t}):null;return e?s?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:i}}):i:jsxRuntimeExports.jsx("a",{href:`${SEARCH_RESULT_URL}?q=${t}`,className:"sledge-instant-search__icon-widget-button-more",children:"View More Result"})},Global={OtherIndexLists:OtherIndexLists$1,SuggestionKeywordLists:SuggestionKeywordLists$1,SearchViewMoreResult:SearchViewMoreResult$1},SearchIconWidgetPopup=()=>{var e,t,s,i,n,r,o,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,W]=React.useState([]),[U,k]=React.useState({}),[M,B]=React.useState({}),[H,F]=React.useState(""),[G,V]=React.useState({onAfterAddToCart:e=>{},onAfterAddWishlist:e=>{},onAfterRemoveWishlist:e=>{},onAfterRenderProduct:e=>{},separateJsVersionComponent: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,r,o,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==(r=v[0])?void 0:r.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==(o=R[C])?void 0:o.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),F(C),T(!1)};return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeInstantSearchIconWidgetPopup=(e=(()=>{}),t=(()=>{}),s=(()=>{}),i=(()=>{}),n=null,r=(()=>{}),o=(()=>{}),l=(()=>{}),a=(()=>{}))=>{S(!0),V({onAfterAddToCart:e,onAfterAddWishlist:t,onAfterRemoveWishlist:s,onAfterRenderProduct:i,separateJsVersionComponent:n,productCardsComponent:r,suggestionKeywordListsComponent:o,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,i=!1;if(s=JSON.parse(e),!s)return;const{status:n,data:r}=s,{code:o}=n,{tabs:l,suffix_index_product:a,hidden_tags:d,display:c}=r;i=200===o||!1,i&&(D(l),I(a),W(d),k(c),B(null==(t=null==c?void 0:c.search)?void 0:t.suggestion),await q(r))})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||"")}),[f]),React.useEffect((()=>{if(Boolean(K&&(null==K?void 0:K.keyword)!==A)){const e=setTimeout((()=>{q({tabs:$,suffix_index_product:L,hidden_tags:P,display:U},!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==U?void 0:U.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[H])?void 0:t.keywords)?void 0:s.active)&&(null==(r=null==(n=null==(i=M[H])?void 0:i.keywords)?void 0:n.list)?void 0:r.length)?jsxRuntimeExports.jsx(Global.SuggestionKeywordLists,{listsComponent:G.suggestionKeywordListsComponent,keywords:M[H].keywords.list,isComponentJsVersion:G.separateJsVersionComponent}):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.separateJsVersionComponent})},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==(o=null==U?void 0:U.search)?void 0:o.show_vendor,show_sku:null==(l=null==U?void 0:U.search)?void 0:l.show_sku,show_price:null==(a=null==U?void 0:U.search)?void 0:a.show_price},showOptionOutOfStock:!0,isComponentJsVersion:G.separateJsVersionComponent,cards:G.productCardsComponent,onAfterAddToCart:G.onAfterAddToCart,onAfterAddWishlist:G.onAfterAddWishlist,onAfterRemoveWishlist:G.onAfterRemoveWishlist,onAfterRenderProduct:G.onAfterRenderProduct})}):Object.keys(M).length&&(null==(c=null==(d=M[H])?void 0:d.products)?void 0:c.active)&&(null==(p=null==(x=null==(u=M[H])?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[H].products.list.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(m=null==U?void 0:U.search)?void 0:m.show_vendor,show_sku:null==(g=null==U?void 0:U.search)?void 0:g.show_sku,show_price:null==(_=null==U?void 0:U.search)?void 0:_.show_price},showOptionOutOfStock:!0,isComponentJsVersion:G.separateJsVersionComponent,cards:G.productCardsComponent,onAfterAddToCart:G.onAfterAddToCart,onAfterAddWishlist:G.onAfterAddWishlist,onAfterRemoveWishlist:G.onAfterRemoveWishlist,onAfterRenderProduct:G.onAfterRenderProduct})]}):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[H])?void 0:R.products)?void 0:h.active)&&(null==(v=null==(j=null==(E=M[H])?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.separateJsVersionComponent})}):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_PRODUCT_CARDS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_COMPONENT),SUGGESTION_KEYWORD_LISTS=null==(_b=element.querySelector(SELECTOR.GLOBAL.ELEMENT_SUGGESTION_KEYWORD_LISTS))?void 0:_b.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_COMPONENT),OTHER_INDEX_LISTS=null==(_c=element.querySelector(SELECTOR.GLOBAL.ELEMENT_OTHER_INDEX_LISTS))?void 0:_c.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_COMPONENT),SEARCH_VIEW_MORE_RESULT=null==(_d=element.querySelector(SELECTOR.GLOBAL.ELEMENT_SEARCH_VIEW_MORE_RESULT))?void 0:_d.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_COMPONENT);element.innerHTML="",client.createRoot(element).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{instantSearch:!0}},children:jsxRuntimeExports.jsxs(SearchIconWidget,{size:ICON_SIZE||"sm",onAfterAddToCart:state=>{element&&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)({element:element,state:state})},onAfterRemoveWishlist:state=>{element&&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)({element:element,state:state})},children:[jsxRuntimeExports.jsx(SuggestionKeywordLists,{component:SUGGESTION_KEYWORD_LISTS?eval(SUGGESTION_KEYWORD_LISTS):null,isJsVersion:!0}),jsxRuntimeExports.jsx(OtherIndexLists,{component:OTHER_INDEX_LISTS?eval(OTHER_INDEX_LISTS):null,isJsVersion:!0}),jsxRuntimeExports.jsx(ProductCards,{component:PRODUCT_CARDS?eval(PRODUCT_CARDS):null,isJsVersion:!0}),jsxRuntimeExports.jsx(SearchViewMoreResult,{component:SEARCH_VIEW_MORE_RESULT?eval(SEARCH_VIEW_MORE_RESULT):null,isJsVersion:!0})]})})}))}}))},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(SearchIconWidgetPopup,{})})))},SearchResultWidget$1="",SearchResultWidget=e=>{var t,s,i,n,r,o,l,a,d,c;const{layoutType:u="default",query:x,data:p,children:m,onAfterAddToCart:g,onAfterAddWishlist:_,onAfterRemoveWishlist:R,onAfterRenderProduct:h}=e,{keyword:E=""}=x||{},{collectionId:j}=p||{};let v=null,w=!1;React.Children.map(m,(e=>{if(React.isValidElement(e)&&isFunction(e.type)&&e.type.name===SEPARATE_COMPONENT_DISPLAY_NAME.PRODUCT.CARDS){const{component:t,isJsVersion:s}=(null==e?void 0:e.props)||{};v=t,w=s}}));const{isRenderApp:T}=React.useContext(SledgeContext),[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,W]=React.useState(!0),[U,k]=React.useState([]),[M,B]=React.useState([]),[H,F]=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,re]=React.useState(!1),oe=usePrevious({keyword:L}),le=async(e,t)=>{const{filters:s,tabs:i,suffix_index_product:n,hidden_tags:r,display:o,show_out_of_stock:l}=e;let a,d={queries:("product-filter"===u?i.filter((({index:e})=>null==e?void 0:e.includes(n))):i).map((e=>{const{index:i}=e;let o=!1,a=o?[]:null==s?void 0:s.map((e=>{const{collections:t,items:s}=e;return j&&(null==t?void 0:t.includes(Number(j)))||(null==t?void 0:t.includes("all"))?(o=!0,null==s?void 0:s.map((({value:e})=>e))):void 0})),d=i.includes(n),c=d&&a.length,u=[];return(null==r?void 0:r.length)&&u.push(`tags NOT IN [${r}]`),l||u.push("variants.inventory_quantity > 0"),j&&u.push(`collections.id = '${j}'`),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(setTimeout((()=>{S(!1)}),1300),W(!1),C(!1),"totalDataPerIndex"===t)F(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==T?void 0:T.instantSearch))return;const e=new URLSearchParams(document.location.search);I((null==e?void 0:e.get(E))||""),(async e=>{let t;W(!0);let s,i=!1;if(t=JSON.parse(e),!t)return;const{status:n,data:r}=t,{code:o}=n,{allowed_sorts:l,default_sort:a,filters:d,tabs:c,suffix_index_product:x,hidden_tags:p,display:m,colors:g,show_out_of_stock:_}=r;i=200===o||!1,i&&(k((null==l?void 0:l.length)?l:[]),B((null==d?void 0:d.length)?d:[]),K(x),Z(p),Q(m),te(g),ie(a),re(_),s=c.find((({index:e})=>e.includes(x))),Object.keys(s).length&&(y(s.index),O(s.name)),await le(r,"default"),"default"===u&&await le(r,"totalDataPerIndex"))})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||"")}),[T]),React.useEffect((()=>{if(Boolean(oe&&(null==oe?void 0:oe.keyword)!==L)&&"default"===u){const e=setTimeout((()=>{le({filters:M,tabs:H,suffix_index_product:Y,hidden_tags:J,display:X,colors:ee,show_out_of_stock:ne},"totalDataPerIndex")}),500);return()=>clearTimeout(e)}}),[L]);const ae="default"===u?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,de=(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,ce=(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,ue=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==(r=null==X?void 0:X.filter)?void 0:r.show_total_products)&&"vertical"===(null==(o=null==X?void 0:X.filter)?void 0:o.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"})]}),xe=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",children:[f?null:jsxRuntimeExports.jsx("div",{className:""+("default"===u&&(null==H?void 0:H.length)?"sledge-instant-search__result-tab":"sledge-instant-search__result-tab-no-index"),children:"default"===u&&(null==H?void 0:H.length)?jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__result-tab-list",children:H.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),D(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==u?void 0:u.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[ae,de,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:ce}):null,jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data",children:[xe,ue]})]})]}):React.cloneElement($,{isLoading:A,keyword:L,clickedTabIndexId:N,clickedTabIndexName:b,isLoadingSetting:P,allowedSorts:U,allowedFilters:M,facets:G,searchResultFacets:q,hiddenTags:J,displaySettings:X,colorSwatches:ee,defaultSort:se,showOutOfStock:ne,query:x,data:p,separateJsVersionComponent:w,productCardsComponent:v,onAfterAddToCart:g,onAfterAddWishlist:_,onAfterRemoveWishlist:R,onAfterRenderProduct:h,setIsLoading:C,setKeyword:I,filterHorizontalSkeleton:de,filterVerticalSkeleton:ce,productGridSkeleton:ue,searchAndSelectOptionSkeleton:xe})]})},ResultProduct=e=>{var t,s,i,n,r,o,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,data:$,separateJsVersionComponent:D,productCardsComponent:P,setKeyword:W,filterHorizontalSkeleton:U,filterVerticalSkeleton:k,productGridSkeleton:M,searchAndSelectOptionSkeleton:B,onAfterAddToCart:H,onAfterAddWishlist:F,onAfterRemoveWishlist:G,onAfterRenderProduct:V}=e||{},{keyword:Y=""}=O||{},{collectionId:K}=$||{},[q,z]=React.useState(!0),[J,Z]=React.useState(!0),[X,Q]=React.useState(!1),[ee,te]=React.useState(!1),[se,ie]=React.useState(y||""),[ne,re]=React.useState(f&&Boolean(null==f?void 0:f.length)?null==(t=f.find((({value:e})=>e===y)))?void 0:t.label:""),[oe,le]=React.useState((null==(s=null==I?void 0:I.search)?void 0:s.limit)||10),[ae,de]=React.useState(null),[ce,ue]=React.useState({...b?{}:{"variants.inventory_quantity":"> 0"}}),[xe,pe]=React.useState(!1),[me,ge]=React.useState([]),[_e,Re]=React.useState(0),[he,Ee]=React.useState(1),[je,ve]=React.useState(0),[we,Te]=React.useState(0),[fe,Se]=React.useState([]),[Ae,Ce]=React.useState([]),[Le,Ie]=React.useState(!1),[Ne,ye]=React.useState(null),be=usePrevious({keyword:v,clickedLimitId:oe,clickedFacets:ce}),{color:Oe,font_size:$e,font_weight:De,text_transform:Pe}=(null==(i=null==I?void 0:I.filter)?void 0:i.title)||{},{color:We,font_size:Ue,font_weight:ke,text_transform:Me}=(null==(n=null==I?void 0:I.filter)?void 0:n.option)||{},{text_color:Be,border_color:He,border_radius:Fe,padding_top:Ge,padding_bottom:Ve,padding_left:Ye,padding_right:Ke,background_color:qe,font_size:ze,font_weight:Je,text_transform:Ze}=(null==(r=null==I?void 0:I.filter)?void 0:r.button)||{},Xe={...Oe&&{color:Oe},...$e&&{fontSize:$e},...De&&{fontWeight:De},...Pe&&{textTransform:Pe}},Qe={...We&&{color:We},...Ue&&{fontSize:Ue},...ke&&{fontWeight:ke},...Me&&{textTransform:Me}},et=e=>{var t;const s=new URLSearchParams(document.location.search),i=Object.fromEntries(s);let n={};for(const o in i){(null==A?void 0:A.length)&&!A.includes(o)&&(n[o]=i[o])}for(const o in e)(null==(t=e[o])?void 0:t.length)&&(n[o]=e[o]);const r=new URLSearchParams({...n}).toString();window.history.pushState(null,"",`${document.location.pathname}${(null==r?void 0:r.length)?`?${r}`:""}`)},tt=e=>{de(e===ae?"":e)},st=()=>{Ie(!0),ue({}),pe(!xe),et({}),Se([]),setTimeout((()=>{Ie(!1)}),10)},it=(e,t,s=!1)=>{var i;Ie(!0);let n=[t],r=["variants.price"].includes(e);ce&&(s?n=[t]:(null==(i=ce[e])?void 0:i.includes(t))?n=ce[e].filter((e=>e!==t)):r?(ce[e],ce[e]===t?(n=[],Se([])):n=t):n=ce[e]?[...ce[e],t]:[t]);let o={...ce,[e]:n};et(o),ue(o),pe(!xe),setTimeout((()=>{Ie(!1)}),10)},nt=async(e=!1,t=!1)=>{if(!w)return;e&&Ee(1),Z(!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&&ue(e),e})(ce),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),r=["variants.price"].includes(i),o=["tags"].includes(i);return Array.isArray(e[1])&&(null==(t=e[1])?void 0:t.length)>1?r?`${i} >= ${e[1][0]} AND ${i} <= ${e[1][1]}`:o?`${i} IN [${e[1]}]`:null==(s=e[1])?void 0:s.map((e=>n?`${i} ${e}`:`${i} = '${e}'`)).join(" OR "):n?`${i} ${e[1]}`:o?`${i} IN [${e[1]}]`:`${i} = '${e[1]}'`}return null})).filter((e=>e));(null==L?void 0:L.length)&&n.push(`tags NOT IN [${L}]`),K&&n.push(`collections.id = '${K}'`);let r={q:v,sort:se?[se]:[],page:e?1:he,hitsPerPage:oe,facets:A,filter:n.join(" AND ")};s=await search(w,r),((e,t)=>{var s;if(!e)return;const{hits:i,processingTimeMs:n,totalHits:r,totalPages:o}=e;t&&(null==v?void 0:v.length)&&searchTrigger({keyword:v,resultCount:r||0}),z(!1),Z(!1),ge(i),Re(n||0),ve(o),Te(r||0),ye(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:[r," 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(Y,e),W&&W(e),window.history.pushState(null,"",`${document.location.pathname}?${t.toString()}`)};React.useEffect((()=>{let e=Boolean(be&&((null==be?void 0:be.keyword)!==v||(null==be?void 0:be.clickedLimitId)!==oe||(null==be?void 0:be.clickedFacets)!==ce));if(Boolean(be&&(null==be?void 0:be.keyword)!==v)){const e=setTimeout((()=>{nt(!0,!0)}),500);return()=>clearTimeout(e)}nt(e)}),[se,oe,xe,v,he,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)&&we<=1)return;let s=!1;s||null==S||S.map((e=>{const{collections:t,items:i}=e;(K&&(null==t?void 0:t.includes(Number(K)))||(null==t?void 0:t.includes("all")))&&(s=!0,Ce(i))}))})()}),[S,C,we]);const ot=({label:e,name:t,value:s,index:i})=>{var n;let r=s;return["variants.price"].includes(t)&&(r=null==s?void 0:s.join(" - ")),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-refine-selected",style:Qe,children:[jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-filter-item-title-refine-list",children:[e,": ",null==(n=String(r))?void 0:n.replaceAll("_"," ")]}),jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-item-refine-title-clear",onClick:()=>it(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)},lt=e=>{var t,s;const{value:i,label:n,display:r}=e;let o=null,l=C[i],a=null==(t=null==I?void 0:I.filter)?void 0:t.show_number_matching_product;return"slider"===r.toLowerCase()?o=jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-list-slider",children:[jsxRuntimeExports.jsx(Slider,{defaultValue:[fe[0]||(null==l?void 0:l.min),fe[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=>it(i,e),setValueChange:e=>Se(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:fe[0]||(null==l?void 0:l.min)}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-minmax-field",children:fe[1]||(null==l?void 0:l.max)})]})]}):"checkbox"===r.toLowerCase()&&(null==l?void 0:l.length)?o=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=>it(i,e.currentTarget.value),defaultChecked:ce&&(null==(s=ce[i])?void 0:s.includes(e.value)),labelStyle:Qe})},t)}))}):"radio"===r.toLowerCase()&&(null==l?void 0:l.length)?o=jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx(RadioGroup,{id:i,name:i,onValueChange:e=>it(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:ce&&(null==(s=ce[i])?void 0:s.length)?ce[i][0]:"",labelStyle:Qe})}):"select"===r.toLowerCase()&&(null==l?void 0:l.length)?o=jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx(Select,{placeholder:`Select ${n}`,name:i,onValueChange:e=>it(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:Qe})}):"swatch"===r.toLowerCase()&&(null==l?void 0:l.length)&&(o=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=>it(i,e.currentTarget.value),defaultChecked:ce&&(null==(s=ce[i])?void 0:s.includes(e.value))})},t)}))})),o},at=Ae.map(((e,t)=>{const{value:s,label:i,display:n}=e;let r=ae===s,o=C[s],l=Boolean("slider"===n.toLowerCase()?o:null==o?void 0:o.length),a=["select"].includes(n.toLowerCase())&&(null==o?void 0:o.length),d=["sledge-instant-search__result-filter-item-list"],c=lt(e);return"swatch"===n.toLowerCase()&&(null==o?void 0:o.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:()=>tt(s),children:[jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-title",style:Xe,children:i}),jsxRuntimeExports.jsx(motion.div,{initial:!1,animate:r?"open":"closed",variants:ROTATE_FILTER_ARROW_ANIMATION,children:jsxRuntimeExports.jsx(ChevronArrowDownIcon,{width:15,height:15,color:"#000000"})})]}),r&&jsxRuntimeExports.jsx("ul",{className:d.join(" "),children:a?c:Le?null:c})]},t):null})),dt=Ae.map(((e,t)=>{const{value:s,label:i,display:n}=e;let r=ae===s,o=C[s],l=Boolean("slider"===n.toLowerCase()?o:null==o?void 0:o.length),a=["radio","select"].includes(n.toLowerCase())&&(null==o?void 0:o.length),d=["sledge-instant-search__result-filter-item-list"],c=lt(e);return"swatch"===n.toLowerCase()&&(null==o?void 0:o.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:()=>tt(s),children:[i,jsxRuntimeExports.jsx(motion.div,{initial:"closed",animate:r?"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:r&&jsxRuntimeExports.jsx("ul",{className:d.join(" "),children:a?c:Le?null:c})}),withOpenState:!1,setIsOpen:e=>de(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 ct=[];Object.entries(ce).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),r=Ae.filter((({value:e})=>null==e?void 0:e.includes(i))),o=(null==r?void 0:r.length)?r[0].label:i;return Array.isArray(e[1])&&(null==(t=e[1])?void 0:t.length)>1?n?ct.push({label:o,name:i,value:e[1]}):null==(s=e[1])?void 0:s.map((e=>{ct.push({label:o,name:i,value:e})})):ct.push({label:o,name:i,value:e[1][0]})}}));const ut=jsxRuntimeExports.jsx(Pagination,{currentPage:he,totalPage:je,totalResult:we,onChange:e=>(e=>{Ee(e)})(e)});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==(o=null==I?void 0:I.filter)?void 0:o.enable_on_search)&&"horizontal"===(null==(l=null==I?void 0:I.filter)?void 0:l.layout)?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:q?U:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:T?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-loading",children:U}):dt.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:dt}),Boolean((null==ct?void 0:ct.length)&&(null==(a=null==I?void 0:I.filter)?void 0:a.show_refine_by_block))?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Boolean(ct.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:st,children:"Clear All"}),ct.map(((e,t)=>{const{label:s,name:i,value:n}=e;return ot({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)?q?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:k}):at.every((e=>!e))?null:jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:T?k:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Boolean((null==ct?void 0:ct.length)&&(null==(x=null==I?void 0:I.filter)?void 0:x.show_refine_by_block))?Boolean(ct.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:st,children:"Clear All"})]}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-item-refine-selected-flex",children:ct.map(((e,t)=>{const{label:s,name:i,value:n}=e;return ot({label:s,name:i,value:n,index:t})}))})]}):null,at]})}):null,jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data",children:[q?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:Ne}),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:se,onChange:({label:e,value:t})=>((e,t)=>{Q(!1),re(e),ie(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:oe,onChange:({value:e})=>(e=>{te(!1),le(e)})(e)})]})]})]}),J?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[M,(null==me?void 0:me.length)?ut: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:Ne}),(null==me?void 0:me.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"large",data:me.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:D,cards:P,showOptionOutOfStock:!0,onAfterAddToCart:H,onAfterAddWishlist:F,onAfterRemoveWishlist:G,onAfterRenderProduct:V}),ut]}):jsxRuntimeExports.jsx(ResultEmpty,{})]})]})]})})]})},ResultCategory=e=>{var t,s,i,n;const{keyword:r,clickedTabIndexId:o,clickedTabIndexName:l,setKeyword:a}=e||{},[d,c]=React.useState(!0),[u,x]=React.useState(!0),[p,m]=React.useState(""),[g,_]=React.useState([]),[R,h]=React.useState(0),[E,j]=React.useState(1),[v,w]=React.useState(0),[T,f]=React.useState(0),[S,A]=React.useState(null),C=usePrevious({keyword:r}),L=async()=>{if(!o)return;let e;x(!0);let t={q:r,sort:p?[p]:[],page:E,hitsPerPage:12};e=await search(o,t),(e=>{if(!e)return;const{hits:t,processingTimeMs:s,totalHits:i,totalPages:n}=e;c(!1),x(!1),_(t),h(s||0),w(n),f(i||0),A(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==r?void 0:r.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["for ",jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',r,'"']})]}):null]})}))})(e)};React.useEffect((()=>{if(Boolean(C&&(null==C?void 0:C.keyword)!==r)){const e=setTimeout((()=>{L()}),500);return()=>clearTimeout(e)}L()}),[p,r,E,o]);const I=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:r,onChange:({value:e})=>a&&a(e),onResetField:()=>a&&a(""),className:"sledge-instant-search__result-data-keyword-form",withClearField:!0})}),N=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"})}),y=(null==(t=String(o))?void 0:t.includes("collection"))?jsxRuntimeExports.jsx(SkeletonLoading.CollectionGrid,{count:3}):(null==(s=String(o))?void 0:s.includes("page"))?jsxRuntimeExports.jsx(SkeletonLoading.PageGrid,{count:12}):(null==(i=String(o))?void 0:i.includes("blog"))||(null==(n=String(o))?void 0:n.includes("article"))?jsxRuntimeExports.jsx(SkeletonLoading.BlogGrid,{count:12}):null,b=()=>jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-category-wrapper",children:[I,N,y]}),O=()=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[I,N,y]}),$=e=>{var t,s,i,n;return(null==(t=String(o))?void 0:t.includes("collection"))?jsxRuntimeExports.jsx(CollectionGrid,{...e}):(null==(s=String(o))?void 0:s.includes("page"))?jsxRuntimeExports.jsx(PageGrid,{...e}):(null==(i=String(o))?void 0:i.includes("blog"))||(null==(n=String(o))?void 0:n.includes("article"))?jsxRuntimeExports.jsx(BlogGrid,{...e}):null};return jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-wrapper",children:d?jsxRuntimeExports.jsx(b,{}):jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-category-wrapper",children:u?jsxRuntimeExports.jsx(O,{}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[I,jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary",children:S}),(null==g?void 0:g.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx($,{data:g.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:E,totalPage:v,totalResult:T,onChange:e=>(e=>{j(e)})(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,_b,_c,_d;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_PRODUCT_CARDS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_COMPONENT);null==(_b=element.querySelector(SELECTOR.GLOBAL.ELEMENT_SUGGESTION_KEYWORD_LISTS))||_b.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_COMPONENT),null==(_c=element.querySelector(SELECTOR.GLOBAL.ELEMENT_OTHER_INDEX_LISTS))||_c.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_COMPONENT),null==(_d=element.querySelector(SELECTOR.GLOBAL.ELEMENT_SEARCH_VIEW_MORE_RESULT))||_d.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_COMPONENT),element.innerHTML="",client.createRoot(element).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0}},children:jsxRuntimeExports.jsx(SearchResultWidget,{query:{keyword:QUERY_KEYWORD||""},onAfterAddToCart:state=>{element&&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)({element:element,state:state})},onAfterRemoveWishlist:state=>{element&&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)({element:element,state:state})},children:jsxRuntimeExports.jsx(ProductCards,{component:PRODUCT_CARDS?eval(PRODUCT_CARDS):null,isJsVersion:!0})})})}))}}))},SearchWidget$1="",SearchWidget=e=>{var t,s,i,n,r,o,l,a,d,c,u,x,p,m,g,_,R,h,E,j,v;const{width:w="400px",children:T,onAfterAddToCart:f,onAfterAddWishlist:S,onAfterRemoveWishlist:A,onAfterRenderProduct:C}=e;let L=null,I=null,N=null,y=null,b=!1;React.Children.map(T,(e=>{if(React.isValidElement(e)&&isFunction(e.type)){const{component:t,isJsVersion:s}=(null==e?void 0:e.props)||{};switch(b=s,e.type.name){case SEPARATE_COMPONENT_DISPLAY_NAME.PRODUCT.CARDS:L=t;break;case SEPARATE_COMPONENT_DISPLAY_NAME.SUGGESTION_KEYWORD_LISTS:I=t;break;case SEPARATE_COMPONENT_DISPLAY_NAME.OTHER_INDEX_LISTS:N=t;break;case SEPARATE_COMPONENT_DISPLAY_NAME.SEARCH_VIEW_MORE_RESULT:y=t}}}));const{isRenderApp:O}=React.useContext(SledgeContext),[$,D]=React.useState(!0),[P,W]=React.useState(""),[U,k]=React.useState(""),[M,B]=React.useState([]),[H,F]=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,r,o,l,a,d,c,u,x;if(!P.length)return;D(!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==(r=v[0])?void 0:r.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==(o=R[f])?void 0:o.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),F(w),Q(f),D(!1)};React.useEffect((()=>{(null==O?void 0:O.instantSearch)&&(async e=>{var t;if(!P.length)return;let s,i=!1;if(s=JSON.parse(e),!s)return;const{status:n,data:r}=s,{code:o}=n,{tabs:l,suffix_index_product:a,hidden_tags:d,display:c}=r;i=200===o||!1,i&&(V(l),k(a),K(d),z(c),Z(null==(t=null==c?void 0:c.search)?void 0:t.suggestion),await te(r))})(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:U,hidden_tags:Y,display:q},!0)}),500);return()=>clearTimeout(e)}}),[P]);const se={maxWidth:w};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})=>W(e),onResetField:()=>W(""),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:$?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:$,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==(r=null==(n=null==(i=J[X])?void 0:i.keywords)?void 0:n.list)?void 0:r.length)?jsxRuntimeExports.jsx(Global.SuggestionKeywordLists,{listsComponent:I,keywords:J[X].keywords.list,isComponentJsVersion:b}):null,H.map(((e,t)=>{const{hits:s,name:i}=e;return jsxRuntimeExports.jsx(React.Fragment,{children:jsxRuntimeExports.jsx(Global.OtherIndexLists,{listsComponent:N,name:i,items:s,isComponentJsVersion:b})},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==(o=null==q?void 0:q.search)?void 0:o.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:b,cards:L,onAfterAddToCart:f,onAfterAddWishlist:S,onAfterRemoveWishlist:A,onAfterRenderProduct:C})}):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:b,cards:L,onAfterAddToCart:f,onAfterAddWishlist:S,onAfterRemoveWishlist:A,onAfterRenderProduct:C})]}):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:y,keyword:P,isComponentJsVersion:b})}):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_PRODUCT_CARDS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_COMPONENT),SUGGESTION_KEYWORD_LISTS=null==(_b=element.querySelector(SELECTOR.GLOBAL.ELEMENT_SUGGESTION_KEYWORD_LISTS))?void 0:_b.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_COMPONENT),OTHER_INDEX_LISTS=null==(_c=element.querySelector(SELECTOR.GLOBAL.ELEMENT_OTHER_INDEX_LISTS))?void 0:_c.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_COMPONENT),SEARCH_VIEW_MORE_RESULT=null==(_d=element.querySelector(SELECTOR.GLOBAL.ELEMENT_SEARCH_VIEW_MORE_RESULT))?void 0:_d.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_COMPONENT);element.innerHTML="",client.createRoot(element).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0}},children:jsxRuntimeExports.jsxs(SearchWidget,{width:WIDTH_ELEMENT||"",onAfterAddToCart:state=>{element&&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)({element:element,state:state})},onAfterRemoveWishlist:state=>{element&&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)({element:element,state:state})},children:[jsxRuntimeExports.jsx(SuggestionKeywordLists,{component:SUGGESTION_KEYWORD_LISTS?eval(SUGGESTION_KEYWORD_LISTS):null,isJsVersion:!0}),jsxRuntimeExports.jsx(OtherIndexLists,{component:OTHER_INDEX_LISTS?eval(OTHER_INDEX_LISTS):null,isJsVersion:!0}),jsxRuntimeExports.jsx(ProductCards,{component:PRODUCT_CARDS?eval(PRODUCT_CARDS):null,isJsVersion:!0}),jsxRuntimeExports.jsx(SearchViewMoreResult,{component:SEARCH_VIEW_MORE_RESULT?eval(SEARCH_VIEW_MORE_RESULT):null,isJsVersion:!0})]})})}))}}))},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}}},sledgeAnonymId:""}),ProductCards=({component:e})=>null,OtherIndexLists=({component:e})=>null,SuggestionKeywordLists=({component:e})=>null,SearchViewMoreResult=({component:e})=>null,BadgeFloatingFull=e=>{var t,s;const{sledgeAnonymId:i}=React.useContext(SledgeContext),{isFirstLoading:n,isLoading:r,totalWishlist:o,isMaximizeTotalWishlist:l,proxyUrl:a,position:d="left",dataSettings:c}=e||{},{is_required_login:u}=(null==(t=null==c?void 0:c.display)?void 0:t.global)||{},{type:x}=(null==(s=null==c?void 0:c.display)?void 0:s.widget)||{},[p,m]=React.useState(!1);React.useEffect((()=>{m(i&&u)}),[i]);return jsxRuntimeExports.jsx("div",{className:`sledge-wishlist__badge-floating sledge-wishlist__badge-floating-${d}`,children:jsxRuntimeExports.jsxs("span",{onClick:e=>{e.preventDefault(),e.stopPropagation(),p?"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"}):("popup_window"===x&&"undefined"!=typeof window&&window.sledgeWishlistWidgetPopup&&window.sledgeWishlistWidgetPopup(),window.location.href="popup_window"===x?"#":a||"/")},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"}),!n&&jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-bottom-right "+(l?"sledge-wishlist__badge-fit-content":""),children:r||p?0:`${l?"99+":o}`||0})]})]})})},BadgeFloatingIcon=e=>{var t,s;const{sledgeAnonymId:i}=React.useContext(SledgeContext),{isFirstLoading:n,isLoading:r,totalWishlist:o,isMaximizeTotalWishlist:l,proxyUrl:a,position:d="bottom-right",dataSettings:c}=e||{},{is_required_login:u}=(null==(t=null==c?void 0:c.display)?void 0:t.global)||{},{type:x}=(null==(s=null==c?void 0:c.display)?void 0:s.widget)||{},[p,m]=React.useState(!1);React.useEffect((()=>{m(i&&u)}),[i]);return jsxRuntimeExports.jsx("div",{className:`sledge-wishlist__badge-floating-icon sledge-wishlist__badge-floating-${d}`,children:jsxRuntimeExports.jsx("span",{onClick:e=>{e.preventDefault(),e.stopPropagation(),p?"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"}):("popup_window"===x&&"undefined"!=typeof window&&window.sledgeWishlistWidgetPopup&&window.sledgeWishlistWidgetPopup(),window.location.href="popup_window"===x?"#":a||"/")},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"}),!n&&jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-bottom-right "+(l?"sledge-wishlist__badge-fit-content":""),children:r||p?0:`${l?"99+":o}`||0})]})})})},BadgeHeaderMenu=e=>{var t,s;const{sledgeAnonymId:i}=React.useContext(SledgeContext),{isFirstLoading:n,isLoading:r,totalWishlist:o,isMaximizeTotalWishlist:l,proxyUrl:a,dataSettings:d}=e||{},{is_required_login:c}=(null==(t=null==d?void 0:d.display)?void 0:t.global)||{},{type:u}=(null==(s=null==d?void 0:d.display)?void 0:s.widget)||{},x="#000000",[p,m]=React.useState(x),[g,_]=React.useState(!1);React.useEffect((()=>{_(i&&c)}),[i]);return jsxRuntimeExports.jsxs("span",{className:"sledge-wishlist__badge",onClick:e=>{e.preventDefault(),e.stopPropagation(),g?"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"}):("popup_window"===u&&"undefined"!=typeof window&&window.sledgeWishlistWidgetPopup&&window.sledgeWishlistWidgetPopup(),window.location.href="popup_window"===u?"#":a||"/")},onMouseEnter:()=>m("#F85538"),onMouseLeave:()=>m(x),children:[jsxRuntimeExports.jsx(HeartIcon,{width:20,height:20,type:"outline",color:p}),!n&&jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-header-menu "+(l?"sledge-wishlist__badge-fit-content":""),children:r||g?0:`${l?"99+":o}`||0})]})},getWishlist=async e=>{const{page:t,limit:s,sort:i,keyword:n,shareId:r}=e||{};let o=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),l="?"+new URLSearchParams({page:t||"",limit:s||"",sort:i||"",keyword:n||"",share_id:r||""}).toString();var a=new Headers;a.append("Authorization",`Bearer ${o}`);var d={method:"GET",headers:a,redirect:"follow"};return await fetch(`${API_URL}/wishlist${l}`,d).then((e=>e.json())).then((e=>e)).catch((()=>{}))},addWishlist=async e=>{const{productId:t,productVariantId:s,productName:i,productVendor:n,productSku:r,productVariantName:o,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:r,variant_name:o,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:r,productImage:o,productCurrency:l,productPrice:a}=e;return{id:sanitizeDataId(t),variant_id:sanitizeDataId(s),name:i,variant_name:n,url:r,image_url:o,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()=>{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}/wishlist/info`,s).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),r="?"+new URLSearchParams({variant_id:i}).toString();var o=new Headers;o.append("Authorization",`Bearer ${n}`);var l={method:"GET",headers:o,redirect:"follow"};return await fetch(`${API_URL}/wishlist/check/${s}${r}`,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}=e,{isRenderApp:s,triggerRenderMultipleComponent:i}=React.useContext(SledgeContext),[n,r]=React.useState(0),[o,l]=React.useState(!0),[a,d]=React.useState(!0),[c,u]=React.useState(!1),[x,p]=React.useState(""),[m,g]=React.useState({}),_=async()=>{var e,t,s;let i,n,o,a=!1;i=await getWishlistInfo(),a=200===(null==(e=null==i?void 0:i.status)?void 0:e.code)||!1,n=(null==(t=null==i?void 0:i.data)?void 0:t.total_data)?i.data.total_data:0,o=(null==(s=null==i?void 0:i.data)?void 0:s.proxy_url)||"",a&&(r(n),u(n>99),p(o),l(!1),d(!1))};return React.useEffect((()=>{(null==s?void 0:s.wishlist)&&("undefined"!=typeof window&&(window.sledgeWishlistBadgeUpdate=()=>{_()}),(async e=>{let t,s=!1;if(t=JSON.parse(e),!t)return;const{status:i,data:n}=t,{code:r}=i;s=200===r||!1,s&&(g(n),await _())})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||""))}),[s,i]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:React.Children.count(t)&&React.Children.map(t,(e=>React.cloneElement(e,{isFirstLoading:o,isLoading:a,totalWishlist:n,isMaximizeTotalWishlist:c,proxyUrl:x,dataSettings:m})))})},BadgeMenuItem=e=>{var t,s;const{sledgeAnonymId:i}=React.useContext(SledgeContext),{htmlElement:n,proxyUrl:r,dataSettings:o}=e||{},{is_required_login:l}=(null==(t=null==o?void 0:o.display)?void 0:t.global)||{},{type:a}=(null==(s=null==o?void 0:o.display)?void 0:s.widget)||{},[d,c]=React.useState(!1);React.useEffect((()=>{c(i&&l)}),[i]);return jsxRuntimeExports.jsx("span",{onClick:e=>{e.preventDefault(),e.stopPropagation(),d?"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"}):("popup_window"===a&&"undefined"!=typeof window&&window.sledgeWishlistWidgetPopup&&window.sledgeWishlistWidgetPopup(),window.location.href="popup_window"===a?"#":r||"/")},children:jsxRuntimeExports.jsx("span",{dangerouslySetInnerHTML:{__html:n}})})},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,Badge.MenuItem=BadgeMenuItem;const BadgeInitSelector=()=>{const e=JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||"");if(!e)return;const{data:t}=e,{type:s,floating_button_type:i}=(null==t?void 0:t.launch_point)||{};if("floating_button"===s)if("left"===i||"right"===i){let e=document.createElement("div");e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.WISHLIST.ELEMENT_BADGE_FLOATING_FULL),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}},children:jsxRuntimeExports.jsx(Badge.Root,{children:jsxRuntimeExports.jsx(Badge.FloatingFull,{position:i})})})})))}else{let e=document.createElement("div");e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.WISHLIST.ELEMENT_BADGE_FLOATING_ICON),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}},children:jsxRuntimeExports.jsx(Badge.Root,{children:jsxRuntimeExports.jsx(Badge.FloatingIcon,{position:i})})})})))}else if("header_menu"===s){let e=document.querySelector(SELECTOR.WISHLIST.ELEMENT_BADGE);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}},children:jsxRuntimeExports.jsx(Badge.Root,{children:jsxRuntimeExports.jsx(Badge.HeaderMenu,{})})})})))}))}else{let e=document.querySelector(SELECTOR.WISHLIST.ELEMENT_BADGE_MENU_ITEM);detectInitSelector(e,(()=>{e&&client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0}},children:jsxRuntimeExports.jsx(Badge.Root,{children:jsxRuntimeExports.jsx(Badge.MenuItem,{htmlElement:e.innerHTML})})})}))}))}},ButtonDetail$1="",ButtonDetail=e=>{var t,s,i,n,r;const{data:o,onAfterAddWishlist:l,onAfterRemoveWishlist:a}=e,{productId:d,productVariantId:c}=o||{},{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:$,padding_left:D,padding_right:P,background_color:W,font_size:U,font_weight:k,text_transform:M}=(null==(s=null==j?void 0:j.display)?void 0:s.button_detail)||{},{show:B,location:H}=(null==(i=null==j?void 0:j.display)?void 0:i.notification)||{},{before_adding_wishlist:F,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==(r=null==j?void 0:j.languages)?void 0:r.notification)||{},J={...N&&{color:N},...y&&{borderColor:y},...b&&{borderRadius:b},...O&&{paddingTop:O},...$&&{paddingBottom:$},...D&&{paddingLeft:D},...P&&{paddingRight:P},...W&&{backgroundColor:W},...U&&{fontSize:U},...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,r,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(o);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==(r=null==x?void 0:x.wishlist)?void 0:r.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:H,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:H,type:"failed"}))};React.useEffect((()=>{(null==u?void 0:u.wishlist)&&("undefined"!=typeof window&&(window.sledgeWishlistButtonDetailUpdate=()=>{Z()}),(async e=>{let t;R(!0);let s=!1;if(t=JSON.parse(e),!t)return;const{status:i,data:n}=t,{code:r}=i;s=200===r||!1,s&&(v(n),R(!1),setTimeout((()=>{g(!1)}),1300))})(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?F:C&&String(C).toLowerCase().includes("text")?w?h?"Adding...":"Removing...":h&&!I?G:h?V:F:null]});return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{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}},children:jsxRuntimeExports.jsx(ButtonDetail,{data:{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)({element:element,state:state})},onAfterRemoveWishlist:state=>{element&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)({element:element,state:state})}})})}))}}))},Trigger$1="",Trigger=e=>{var t,s,i;const{data:n,forceActive:r=!1,hidden:o=!1,onAfterAddWishlist:l,onAfterRemoveWishlist:a}=e,{productId:d,productVariantId:c}=n||{},{isRenderApp:u,triggerRenderMultipleComponent:x,sledgeAnonymId:p}=React.useContext(SledgeContext),m="#767676",g="outline",_="#F85538",R="fill",[h,E]=React.useState(m),[j,v]=React.useState(g),[w,T]=React.useState(!1),[f,S]=React.useState(!0),[A,C]=React.useState({}),[L,I]=React.useState({onAfterAddWishlist:l,onAfterRemoveWishlist:a}),[N,y]=React.useState(!1),{is_required_login:b}=(null==(t=null==A?void 0:A.display)?void 0:t.global)||{},{show:O,location:$}=(null==(s=null==A?void 0:A.display)?void 0:s.notification)||{},{title_added_to_wishlist:D,text_added_to_wishlist:P,title_removed_to_wishlist:W,text_removed_to_wishlist:U}=(null==(i=null==A?void 0:A.languages)?void 0:i.notification)||{},k=async()=>{let e;e=await checkWishlist(d,c),T(r||e)};React.useEffect((()=>{(null==u?void 0:u.wishlist)&&("undefined"!=typeof window&&(window.sledgeWishlistTriggerUpdate=()=>{k()}),(async e=>{let t;S(!0);let s=!1;if(t=JSON.parse(e),!t)return;const{status:i,data:n}=t,{code:r}=i;s=200===r||!1,s&&(C(n),S(!1))})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||""))}),[u]),React.useEffect((()=>{y(p&&b)}),[p]),React.useEffect((()=>{k()}),[c]);const M=(w||r)&&!N;return React.useEffect((()=>{M?(E(_),v(R)):(E(m),v(g))}),[w]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!f&&!o&&jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__trigger-block",children:jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__trigger",onClick:e=>(async e=>{var t,s,i,r,o,l;if(e.preventDefault(),e.stopPropagation(),N)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(!w);let a=await addWishlist(n);const{status:d,data:c}=a||{},{code:u}=d||{};200===u?("undefined"!=typeof window&&(window.sledgeWishlistBadgeUpdate&&((null==(s=null==(t=null==x?void 0:x.wishlist)?void 0:t.badge)?void 0:s.trigger)&&(null==(l=null==(i=null==x?void 0:x.wishlist)?void 0:i.badge)||l.trigger(!(null==(o=null==(r=null==x?void 0:x.wishlist)?void 0:r.badge)?void 0:o.value))),window.sledgeWishlistBadgeUpdate()),window.sledgeWishlistWidgetListUpdate&&window.sledgeWishlistWidgetListUpdate(),window.sledgeWishlistButtonDetailUpdate&&window.sledgeWishlistButtonDetailUpdate()),k(),w?L.onAfterRemoveWishlist&&L.onAfterRemoveWishlist("success"):L.onAfterAddWishlist&&L.onAfterAddWishlist("success"),"undefined"!=typeof window&&window.sledgeToastNotification&&O&&window.sledgeToastNotification({title:w?W:D,message:w?U:P,location:$,type:"success",icon:jsxRuntimeExports.jsx(HeartIcon,{width:40,height:40,color:"black",type:"outline"})})):(w?L.onAfterRemoveWishlist&&L.onAfterRemoveWishlist("failed"):L.onAfterAddWishlist&&L.onAfterAddWishlist("failed"),"undefined"!=typeof window&&window.sledgeToastNotification&&O&&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:()=>{M||(E(_),v(R))},onMouseLeave:()=>{M||(E(m),v(g))},children:jsxRuntimeExports.jsx(HeartIcon,{width:16.67,height:15.83,type:j,color:h})})})})},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}},children:jsxRuntimeExports.jsx(Trigger,{data:{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)({element:item,state:state})},onAfterRemoveWishlist:state=>{item&&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})},Widget$1="",WidgetHeaderClearTrigger=({buttonText:e,shareId:t,dataSettings:s,isFirstLoading:i})=>{var n,r,o,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==(o=null==(r=null==s?void 0:s.display)?void 0:r.widget)?void 0:o.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:A||(e||"Clear Wishlist")})})})})})},WidgetHeaderShareTrigger=({wishlistData:e,buttonText:t,showShareTrigger:s,shareLink:i,shareId:n,dataSettings:r,isFirstLoading:o})=>{var l,a,d,c,u,x;const{triggerRenderMultipleComponent:p,sledgeAnonymId:m}=React.useContext(SledgeContext),{is_required_login:g}=(null==(l=null==r?void 0:r.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==r?void 0:r.display)?void 0:a.widget)?void 0:d.button_share)||{},{title_share_wishlist:C}=(null==(c=null==r?void 0:r.languages)?void 0:c.popup)||{},{button_share:L}=(null==(u=null==r?void 0:r.languages)?void 0:u.widget)||{},{title_added_all_to_wishlist:I,text_added_all_to_wishlist:N}=(null==(x=null==r?void 0:r.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 W=async()=>{var t,s,i,n,r,o,l;D(!0);let a=e.map((e=>{const{id:t,variant_id:s,name:i,variant_name:n,url:r,image_url:o,currency:l,price:a}=e.product;return{productId:t,productVariantId:s,productName:i,productVariantName:n,productLink:r,productImage:o,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==(o=null==(r=null==p?void 0:p.wishlist)?void 0:r.badge)?void 0:o.value))),window.sledgeWishlistBadgeUpdate()),window.sledgeInfoPopup&&window.sledgeInfoPopup({title:I,message:N,textCancel:"Cancel"})),D(!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:o?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||$?{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:W||{}}):"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}),$?"Adding...":"Add to your wishlist"]}):L||(t||"Share Wishlist")})})})})})},WidgetHeaderSearchForm=({setIsLoading:e,setKeyword:t,keyword:s,placeholder:i,dataSettings:n})=>{var r,o;const{sledgeAnonymId:l}=React.useContext(SledgeContext),{is_required_login:a}=(null==(r=null==n?void 0:n.display)?void 0:r.global)||{},{search_form_placeholder:d}=(null==(o=null==n?void 0:n.languages)?void 0:o.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:d||(i||"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-search-form",withClearField:!0})})},WidgetHeaderTitle=({text:e,dataSettings:t})=>{var s,i,n;const{color:r,font_size:o,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={...r&&{color:r},...o&&{fontSize:o},...l&&{fontWeight:l},...a&&{textTransform:a}};return jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:jsxRuntimeExports.jsx("h1",{style:c,children:d||(e||"My Wishlist")})})},WidgetHeaderLimit=({options:e,defaultLimitOptions:t,selectedLimit:s,setSelectedLimit:i,setIsRefreshWidgetList:n,dataSettings:r})=>{var o;const{sledgeAnonymId:l}=React.useContext(SledgeContext),{is_required_login:a}=(null==(o=null==r?void 0:r.display)?void 0:o.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 r,o;const{sledgeAnonymId:l}=React.useContext(SledgeContext),{is_required_login:a}=(null==(r=null==n?void 0:n.display)?void 0:r.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==(o=e[0])?void 0:o.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:r,gridType:o=defaultGridType}=e||{},{is_required_login:l}=(null==(t=null==r?void 0:r.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:o}):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:r}=e||{},{title_no_result:o,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((()=>{r?(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":o),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,r,o,l,a;const{wishlistData:d,currentPage:c,setCurrentPage:u,totalPage:x,shareId:p,dataSettings:m,gridType:g=defaultGridType,productCardsComponent:_,separateJsVersionComponent:R,onAfterAddToCart:h,onAfterAddWishlist:E,onAfterRemoveWishlist:j,onAfterRenderProduct:v}=e||{},{show_add_to_cart:w,redirect_add_to_cart:T}=(null==(t=null==m?void 0:m.display)?void 0:t.widget)||{},{text_color:f,border_color:S,border_radius:A,padding_top:C,padding_bottom:L,padding_left:I,padding_right:N,background_color:y,font_size:b,font_weight:O,text_transform:$}=(null==(i=null==(s=null==m?void 0:m.display)?void 0:s.widget)?void 0:i.button_add_to_cart)||{},{color:D,font_size:P,font_weight:W,text_transform:U}=(null==(r=null==(n=null==m?void 0:m.display)?void 0:n.widget)?void 0:r.price)||{},{color:k,font_size:M,font_weight:B,text_transform:H}=(null==(l=null==(o=null==m?void 0:m.display)?void 0:o.widget)?void 0:l.product_name)||{},{button_add_to_cart:F}=(null==(a=null==m?void 0:m.languages)?void 0:a.widget)||{},G={...f&&{color:f},...S&&{borderColor:S},...A&&{borderRadius:A},...C&&{paddingTop:C},...L&&{paddingBottom:L},...I&&{paddingLeft:I},...N&&{paddingRight:N},...y&&{backgroundColor:y},...b&&{fontSize:b},...O&&{fontWeight:O},...$&&{textTransform:$}},V={...D&&{color:D},...P&&{fontSize:P},...W&&{fontWeight:W},...U&&{textTransform:U}},Y={...k&&{color:k},...M&&{fontSize:M},...B&&{fontWeight:B},...H&&{textTransform:H}};let K=c||0,q=x||0;const[z,J]=React.useState(!1),[Z,X]=React.useState(!1);return React.useEffect((()=>{X(!(q===K&&!z)&&q>=K)}),[z]),React.useEffect((()=>{J(!1)}),[d]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==d?void 0:d.length)?jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"wishlist",type:g,data:d.map((e=>{const{id:t,variant_id:s,name:i,variant_name:n,url:r,image_url:o,currency:l,price:a,vendor:d,sku:c}=(null==e?void 0:e.product)||{},u=new URL(r).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:o},url:r,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:w,redirect_add_to_cart:T,language_button_add_to_cart:F,display_product_name_style:Y,display_price_style:V,display_button_add_to_cart_style:G},showOptionOutOfStock:!1,triggerPropAdditional:{forceActive:!0,...p&&{hidden:!0}},isComponentJsVersion:R,cards:_,onAfterAddToCart:h,onAfterAddWishlist:E,onAfterRemoveWishlist:j,onAfterRenderProduct:v}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),Z&&jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-button-load-more",children:jsxRuntimeExports.jsx(Button,{type:"button",role:"button",colorType:"light",disabled:z,onClick:()=>{u&&c&&u(c+1),J(!0)},style:{...z&&{cursor:"wait"}},children:z?"Loading...":"Load More"})})]})},WidgetRoot=e=>{var t;const{children:s,data:i,onAfterAddToCart:n,onAfterAddWishlist:r,onAfterRemoveWishlist:o,onAfterRenderProduct:l}=e,a=(null==i?void 0:i.shareId)?i.shareId:"",{isRenderApp:d,triggerRenderMultipleComponent:c,sledgeAnonymId:u}=React.useContext(SledgeContext),[x,p]=React.useState(!0),[m,g]=React.useState(!0),[_,R]=React.useState([]),[h,E]=React.useState([]),[j,v]=React.useState(!1),[w,T]=React.useState(""),[f,S]=React.useState(""),[A,C]=React.useState(""),[L,I]=React.useState(1),[N,y]=React.useState(0),[b,O]=React.useState(!1),[$,D]=React.useState(!1),[P,W]=React.useState(""),[U,k]=React.useState(""),[M,B]=React.useState({}),[H,F]=React.useState(!1),G=usePrevious({keyword:A,currentPage:L}),V=DEFAULT_LIMIT_VALUE,{is_required_login:Y}=(null==(t=null==M?void 0:M.display)?void 0:t.global)||{},K=async(e=!1)=>{var t,s,i,n;let r;g(!e),e||(I(1),R([]));let o,l,d=!1,c=0,u={page:e?L:1,limit:f||V[0],sort:w,keyword:A,shareId:a};r=await getWishlist(u),d=200===(null==(t=null==r?void 0:r.status)?void 0:t.code)||!1,o=(null==(s=r.data)?void 0:s.length)?t=>(null==_?void 0:_.length)&&e?[...t,...r.data]:r.data:[],l=(null==(i=r.sorts)?void 0:i.length)?r.sorts:[],c=(null==(n=null==r?void 0:r.page)?void 0:n.total_page)||1,d&&(R(o),E(l),y(c),g(!1),v(!1))};React.useEffect((()=>{let e=Boolean(G&&(null==G?void 0:G.currentPage)!==L);if(G&&(null==G?void 0:G.keyword)!==A){O(!0);const e=setTimeout((()=>{O(!1),K()}),500);return()=>clearTimeout(e)}K(!j&&e)}),[A,L,j]),React.useEffect((()=>{(null==d?void 0:d.wishlist)&&("undefined"!=typeof window&&(window.sledgeWishlistWidgetListUpdate=()=>{K()},window.sledgeWishlistWidgetClearList=()=>{(async()=>{var e,t,s,i,n,r,o;let l;g(!0);let a=!1;l=await clearWishlist(),a=200===(null==(e=null==l?void 0:l.status)?void 0:e.code),a?(await K(),"undefined"!=typeof window&&window.sledgeWishlistBadgeUpdate&&((null==(s=null==(t=null==c?void 0:c.wishlist)?void 0:t.badge)?void 0:s.trigger)&&(null==(o=null==(i=null==c?void 0:c.wishlist)?void 0:i.badge)||o.trigger(!(null==(r=null==(n=null==c?void 0:c.wishlist)?void 0:n.badge)?void 0:r.value))),window.sledgeWishlistBadgeUpdate())):"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:"failed clear all wishlist",type:"failed"})})()}),(async()=>{var e,t,s;let i;D(!1);let n,r,o=!1;i=await getWishlistInfo(),o=200===(null==(e=null==i?void 0:i.status)?void 0:e.code)||!1,n=(null==(t=null==i?void 0:i.data)?void 0:t.share_link)||"",r=(null==(s=null==i?void 0:i.data)?void 0:s.proxy_url)||"",o&&(W(window.location.origin+n),k(r),D(!0))})(),(async e=>{let t,s=!1;if(t=JSON.parse(e),!t)return;const{status:i,data:n}=t,{code:r}=i;s=200===r||!1,s&&B(n)})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||""),setTimeout((()=>{p(!1)}),1300))}),[d]),React.useEffect((()=>{F(u&&!Y)}),[u]);let q=null,z=!1;return React.Children.map(s,(e=>{if(React.isValidElement(e)&&isFunction(e.type)&&e.type.name===SEPARATE_COMPONENT_DISPLAY_NAME.PRODUCT.CARDS){const{component:t,isJsVersion:s}=(null==e?void 0:e.props)||{};q=t,z=s}})),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"sledge-wishlist__widget-wrapper",children:[H&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:x?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"99.5%",height:"72px",color:"grey-100",rounded:"none",animationDuration:"3s",style:{margin:"0 auto"}}):jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-alert",children:jsxRuntimeExports.jsxs("div",{className:"sledge-wishlist__widget-alert-text",children:["Please login to save your wishlist across devices.",jsxRuntimeExports.jsx("a",{href:"/account/login",className:"sledge-wishlist__widget-alert-link",children:"Login Here"})]})})}),React.Children.count(s)&&React.Children.map(s,(e=>React.cloneElement(e,{isLoading:m,isFirstLoading:x,wishlistData:_,wishlistSort:h,selectedSort:w,selectedLimit:f,keyword:A,currentPage:L,totalPage:N,defaultLimitOptions:V,onSearch:b,showShareTrigger:$,shareLink:P,shareId:a,proxyUrl:U,dataSettings:M,separateJsVersionComponent:z,productCardsComponent:q,setIsLoading:g,setIsRefreshWidgetList:v,setSelectedSort:T,setSelectedLimit:S,setKeyword:C,setCurrentPage:I,onAfterAddToCart:n,onAfterAddWishlist:r,onAfterRemoveWishlist:o,onAfterRenderProduct:l})))]})})},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 WidgetPopup$1="",WidgetPopup=({children:e})=>{const[t,s]=React.useState(!1);return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeWishlistWidgetPopup=()=>{s(!0)})}),[]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:t,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.jsx($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,{className:"sledge-wishlist__widget-popup-content DialogContent",children:jsxRuntimeExports.jsxs("div",{className:"sledge-wishlist__widget-popup-wrapper",children:[jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-popup-close",onClick:()=>s(!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:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}),e]})})]})})},WidgetInitSelector=()=>{let element=document.querySelector(SELECTOR.WISHLIST.ELEMENT_WIDGET);detectInitSelector(element,(()=>{var _a;if(element){const SHARE_ID=element.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.SHARE_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_PRODUCT_CARDS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_COMPONENT);element.innerHTML="",client.createRoot(element).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0}},children:jsxRuntimeExports.jsxs(Widget.Root,{data:{shareId:SHARE_ID||""},onAfterAddToCart:state=>{element&&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)({element:element,state:state})},onAfterRemoveWishlist:state=>{element&&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)({element:element,state:state})},children:[jsxRuntimeExports.jsx(ProductCards,{component:PRODUCT_CARDS?eval(PRODUCT_CARDS):null,isJsVersion:!0}),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"})]})})}))}}))},WidgetPopupInitSelector=()=>{let e=document.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.WISHLIST.ELEMENT_WIDGET_POPUP}"]`);e||(e=document.createElement("div"),e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.WISHLIST.ELEMENT_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}},children:jsxRuntimeExports.jsx(WidgetPopup,{children:jsxRuntimeExports.jsxs(Widget.Root,{children:[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:"medium"})]})})})})))},WishlistInitSelector=()=>{BadgeInitSelector(),TriggerInitSelector(),WidgetInitSelector(),WidgetPopupInitSelector(),ButtonDetailInitSelector()},ProductGrid=({type:e,className:t="",data:s,setting:i,showOptionOutOfStock:n=!1,triggerPropAdditional:r,sourceApp:o=null,isComponentJsVersion:l=!1,cards:a,onAfterAddToCart:d,onAfterAddWishlist:c,onAfterRemoveWishlist:u,onAfterRenderProduct:x})=>{const{show_vendor:p=!0,show_sku:m=!0,show_price:g=!0,show_add_to_cart:_=!0,redirect_add_to_cart:R=!0,language_button_add_to_cart:h="Add To Cart",display_product_name_style:E={},display_price_style:j={},display_button_add_to_cart_style:v={}}=i||{},[w,T]=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:f,image:S,url:A,vendor:C="",currency:L}=s||{},{id:I="",title:N="",price:y="",sku:b=""}=(null==i?void 0:i.length)?i[0]:{};let O=w==I,$=!(!(null==i?void 0:i.length)||!Object.hasOwn(i[0],"inventory_quantity"))&&(!i[0].inventory_quantity&&n);const D=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}}))}}):null;return a?jsxRuntimeExports.jsx(React.Fragment,{children:l?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:D}}):D},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:A,onClick:()=>"instant-search"===o&&productClickTrigger({productId:x}),children:[jsxRuntimeExports.jsx(Trigger,{data:{productId:x,productVariantId:I,productName:f,productVendor:C,productSku:b,productVariantName:N,productLink:A,productImage:(null==S?void 0:S.src)||`${API_URL}/img/blank-image.png`,productCurrency:L,productPrice:y},...r,onAfterAddWishlist:c,onAfterRemoveWishlist:u}),jsxRuntimeExports.jsx("img",{src:(null==S?void 0:S.src)||"",alt:"sledge-product-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`})]}),$?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:[f?jsxRuntimeExports.jsx("a",{href:A,onClick:()=>"instant-search"===o&&productClickTrigger({productId:x}),children:jsxRuntimeExports.jsx("h3",{style:E,children:f})}):null,g?jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-price",children:jsxRuntimeExports.jsxs("p",{style:j,children:[L,y]})}):null]}),jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-text",children:[jsxRuntimeExports.jsx("div",{children:N}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:p?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["Vendor: ",C]}):null}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:" | "}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:m?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["SKU: ",b]}):null})]})]}),jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-rating",children:jsxRuntimeExports.jsx(Rating,{data:{productId:x},size:"xs",withSkeletonLoading:!1})})]})]}),_?jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-button-wrapper",children:jsxRuntimeExports.jsx(Button,{type:"button",colorType:"light",style:{...v,...O&&{cursor:"wait"}},...O||$?{disabled:!0}:{onClick:()=>(async e=>{var t;const{id:s,quantity:i}=e;T(s);let n=await addToCart([{id:s,quantity:i}]);(null==(t=null==n?void 0:n.items)?void 0:t.length)?("wishlist"===o?await addToCartTrigger({productId:s}):"instant-search"===o&&await addToCartTrigger$1({productId:s}),T(null),d&&d("success"),R?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;T(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:I,quantity:1})},children:O?"Adding...":$?"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:h||"Add To Cart"})]})})}):null]},t)}))})},TextAreaField$1="",TextAreaField=e=>{const{className:t="",value:s="",onChange:i,required:n,...r}=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,...r})}),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:r,name:o="",...l}=e;return jsxRuntimeExports.jsx("div",{className:`sledge__input-field-wrapper ${t||""}`,children:jsxRuntimeExports.jsxs($d94698215c4408a7$export$a455218a85c89869,{className:"FormField",name:o,children:[jsxRuntimeExports.jsx($d94698215c4408a7$export$7a7fa4424cb20976,{asChild:!0,children:jsxRuntimeExports.jsx("input",{className:"sledge__input-field",type:r,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"===r&&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:r,image:o}=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:o||`${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:r,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:r,image:o}=e;return jsxRuntimeExports.jsx("a",{href:r,children:jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card",children:[jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-image",children:jsxRuntimeExports.jsx("img",{src:o||`${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:r,url:o,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:o,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:o,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:r})]})]}),jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-button-wrapper",children:jsxRuntimeExports.jsx(Button,{type:"button",colorType:"light",elementType:"hyperlink",link:o,children:"Learn More"})})]},t)}))}):null}),Tooltip$1="",Tooltip=({children:e,content:t,withArrow:s=!0,customArrow:i="",sideOffset:n=5,alignOffset:r=0,wrapTrigger:o=!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:o?jsxRuntimeExports.jsx("span",{children:e}):e}),jsxRuntimeExports.jsx($a093c7e1ec25a057$export$602eac185826482c,{children:jsxRuntimeExports.jsxs($a093c7e1ec25a057$export$7c6e2c02157bb7d2,{className:"sledge__tooltip-content",sideOffset:n,alignOffset:r,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:r=!1,style:o={},className:l="",...a})=>jsxRuntimeExports.jsx("div",{className:`sledge__skeleton-item ${l} ${r?"":"sledge__skeleton-item-animation"}`,style:{width:e,height:t,WebkitAnimationDuration:n,animationDuration:n,...o},"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),r=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:r||""}).then((e=>{var t,s;(null==(t=null==e?void 0:e.data)?void 0:t.token)?(ConfirmationPopupInitSelector(),InfoPopupInitSelector(),ToastNotificationInitSelector(),getSetting("wishlist").then((e=>{var t;200===(null==(t=null==e?void 0:e.status)?void 0:t.code)?(localStorage.setItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING,JSON.stringify(e)),WishlistInitSelector()):console.error("%cSledge",consoleErrorStyle,"Error wishlist app settings")})),getSetting("review").then((e=>{var t;200===(null==(t=null==e?void 0:e.status)?void 0:t.code)?(localStorage.setItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING,JSON.stringify(e)),ProductReviewInitSelector()):console.error("%cSledge",consoleErrorStyle,"Error product review app settings")})),getSetting("instantsearch").then((e=>{var t;200===(null==(t=null==e?void 0:e.status)?void 0:t.code)?(localStorage.setItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING,JSON.stringify(e)),InstantSearchInitSelector()):console.error("%cSledge",consoleErrorStyle,"Error instant search app settings")}))):console.error("%cSledge",consoleErrorStyle,`${(null==(s=e.status)?void 0:s.code)?e.status.message:e}`)}))}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sledge-app/js",
3
3
  "private": false,
4
- "version": "0.0.14",
4
+ "version": "0.0.15",
5
5
  "type": "module",
6
6
  "browser": "./dist/sledge.umd.min.js",
7
7
  "files": [