@sledge-app/react-instant-search 0.0.112 → 0.0.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/SearchIconWidget/SearchIconWidgetPopup.d.ts.map +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/sledge-react-instant-search.cjs +1 -1
- package/dist/sledge-react-instant-search.cjs.map +1 -1
- package/dist/sledge-react-instant-search.js +104 -177
- package/dist/sledge-react-instant-search.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const vendor=require("./vendor-9c93dcff.cjs"),React=require("react"),core=require("@sledge-app/core");require("react-dom");const ProductFilterWidget=e=>vendor.jsxRuntimeExports.jsx(SearchResultWidget,{layoutType:"product-filter",...e}),API_URL="https://sledge-api-preprod.offstack.io",INSTANT_SEARCH_ENGINE_URL="https://instant-search-engine.offstack.io",SELECTOR_ATTRIBUTE_KEY="data-component",DATASET_ATTRIBUTE_KEY={GLOBAL:{ON_AFTER_ADD_WISHLIST:"data-on-after-add-wishlist",ON_AFTER_REMOVE_WISHLIST:"data-on-after-remove-wishlist",ON_AFTER_ADD_TO_CART:"data-on-after-add-to-cart",ON_AFTER_ADD_REVIEW:"data-on-after-add-review",ON_AFTER_RENDER_PRODUCT:"data-on-after-render-product",PRODUCT_ID:"data-product-id",PRODUCT_VARIANT_ID:"data-product-variant-id",PRODUCT_NAME:"data-product-name",PRODUCT_VENDOR:"data-product-vendor",PRODUCT_SKU:"data-product-sku",PRODUCT_VARIANT_NAME:"data-product-variant-name",PRODUCT_LINK:"data-product-link",PRODUCT_IMAGE:"data-product-image",PRODUCT_CURRENCY:"data-product-currency",PRODUCT_PRICE:"data-product-price",USER_ID:"data-user-id",USER_EMAIL:"data-user-email",USER_FULLNAME:"data-user-fullname",COLLECTION_ID:"data-collection-id",WIDTH_ELEMENT:"data-width-element",ICON_SIZE:"data-icon-size",API_KEY:"data-api-key",INSTANT_SEARCH_API_KEY:"data-instant-search-api-key",RENDER_PRODUCT_CARD:"data-render-product-card",WITH_SKELETON_LOADING:"data-with-skeleton-loading"},WISHLIST:{SHARE_ID:"data-share-id",QUERY_SHARE_ID:"data-query-share-id",CUSTOM_ROUTE_PAGE:"data-custom-route-page",RENDER_WISHLIST_WIDGET_ALERT:"data-render-wishlist-widget-alert",USE_PROXY_URL:"data-use-proxy-url"},PRODUCT_REVIEW:{RATING_SIZE:"data-rating-size",RATING_TOTAL:"data-rating-total",RATING_AVERAGE:"data-rating-average"},INSTANT_SEARCH:{ON_AFTER_RENDER_COLLECTION:"data-on-after-render-collection",ON_AFTER_RENDER_PAGE:"data-on-after-render-page",ON_AFTER_RENDER_BLOG:"data-on-after-render-blog",ON_AFTER_RENDER_ARTICLE:"data-on-after-render-article",QUERY_KEYWORD:"data-query-keyword",RENDER_SUGGESTION_KEYWORD_LIST:"data-render-suggestion-keyword-list",RENDER_OTHER_INDEX_LIST:"data-render-other-index-list",RENDER_SEARCH_VIEW_MORE_RESULT:"data-render-search-view-more-result",RENDER_COLLECTION_CARD:"data-render-collection-card",RENDER_PAGE_CARD:"data-render-page-card",RENDER_BLOG_CARD:"data-render-blog-card",RENDER_ARTICLE_CARD:"data-render-article-card"}},LOCAL_STORAGE_KEY={ANONYM_ID:"sledge-anonym-id",AUTH_APP:"sledge-auth-app",INSTANT_SEARCH_AUTH_APP:"sledge-instant-search-auth-app",GENERAL_SETTING:"sledge-general-setting",WISHLIST_SETTING:"sledge-wishlist-setting",PRODUCT_REVIEW_SETTING:"sledge-product-review-setting",INSTANT_SEARCH_SETTING:"sledge-instant-search-setting",ISSUED_AUTH_APP:"sledge-issued-auth-app",EXPIRED_AUTH_APP:"sledge-expired-auth-app",EXPIRED_SETTING:"sledge-expired-setting"},INTERNAL_SELECTOR_VALUE={ELEMENT_TOAST_NOTIFICATION:"toast-notification",ELEMENT_CONFIRMATION_POPUP:"confirmation-popup",ELEMENT_INFO_POPUP:"info-popup",ELEMENT_CONTAINER_WIDGET:"container-widget",WISHLIST:{ELEMENT_BADGE_FLOATING_ICON:"wishlist-badge-floating-icon",ELEMENT_BADGE_FLOATING_FULL:"wishlist-badge-floating-full",ELEMENT_WIDGET_POPUP:"wishlist-widget-popup"},PRODUCT_REVIEW:{ELEMENT_WIDGET_POPUP_DETAIL:"product-review-widget-popup-detail",ELEMENT_WIDGET_FORM_ADD:"product-review-widget-form-add"},INSTANT_SEARCH:{ELEMENT_SEARCH_ICON_WIDGET_POPUP:"instant-search-icon-widget-popup"}},SELECTOR={GLOBAL:{ELEMENT_CUSTOM_COMPONENTS:`[${SELECTOR_ATTRIBUTE_KEY}="custom-components"]`},WISHLIST:{ELEMENT_BADGE:`[${SELECTOR_ATTRIBUTE_KEY}="wishlist-badge"]`,ELEMENT_BADGE_MENU_ITEM:'[href="#sledge-wishlist-badge-menu-item"]',ELEMENT_TRIGGER:`[${SELECTOR_ATTRIBUTE_KEY}="wishlist-trigger"]`,ELEMENT_WIDGET:`[${SELECTOR_ATTRIBUTE_KEY}="wishlist-widget"]`,ELEMENT_BUTTON_DETAIL:`[${SELECTOR_ATTRIBUTE_KEY}="wishlist-button-detail"]`},PRODUCT_REVIEW:{ELEMENT_WIDGET:`[${SELECTOR_ATTRIBUTE_KEY}="product-review-widget"]`,ELEMENT_RATING:`[${SELECTOR_ATTRIBUTE_KEY}="product-review-rating"]`},INSTANT_SEARCH:{ELEMENT_SEARCH_WIDGET:`[${SELECTOR_ATTRIBUTE_KEY}="instant-search-widget"]`,ELEMENT_SEARCH_ICON_WIDGET:`[${SELECTOR_ATTRIBUTE_KEY}="instant-search-icon-widget"]`,ELEMENT_SEARCH_RESULT_WIDGET:`[${SELECTOR_ATTRIBUTE_KEY}="instant-search-result-widget"]`,ELEMENT_PLP_WIDGET:`[${SELECTOR_ATTRIBUTE_KEY}="instant-search-product-filter-widget"]`}},SEARCH_RESULT_URL="/pages/search-result",ELEMENT_ID={PRODUCT_REVIEW:{ELEMENT_WIDGET:"product-review-widget"}},PAYLOAD_API_ALIASES={Authorization:"zbNTHXQpW7OmI",Method:"Gba2Tb9Ys7JGu",GET:"JniUtw5dNfeKW",POST:"a9Dmw0qP9hvQE",PUT:"dEnOjbvTzULLK",DELETE:"pLC93Tvsu6g7H"};async function swr(e,t){if("undefined"!=typeof caches&&"GET"===t.method){const t=await getData(e);return await t.json()}return fetch(e,t).then((e=>e.json()))}async function getData(e){return caches.open("sledge-1").then((t=>t.match(e).then((n=>{const s=fetch(e).then((async n=>{const s=e.split("?")[0],o=await t.matchAll(),r=await o.filter((t=>t.url.includes(s)&&t.url!==e));for(const e of r)await t.delete(e.url);return t.put(e,n.clone()),n}));return n||s}))))}const sanitizeDataId=e=>{if(!e)return"";let t=String(e);if(t.includes("shopify")&&t.includes("/")){let e=t.split("/");return e[e.length-1]||t}return t},detectInitSelector=e=>{const{element:t,init:n,reRender:s=!1}=e;let o=!1;s?t&&n():document.body.addEventListener("DOMNodeInserted",(()=>{!o&&t&&(o=!0,n())}))},isFunction=e=>"function"==typeof e,scrollToElement=e=>{const{element:t,headerOffset:n}=e;if(t){var s=(null==t?void 0:t.getBoundingClientRect().top)+window.scrollY-n;window.scrollTo({top:s,behavior:"smooth"})}},fetchApi=async e=>{const{url:t,method:n,authorization:s="",payload:o={},headers:r={},isSimpleRequest:i=!0,isUploadFile:l=!1}=e;var d=new Headers;i||(s&&d.append("Authorization",`Bearer ${s}`),Object.keys(r).length&&Object.keys(r).forEach((function(e){d.append(e,r[e])})));var a=new FormData;(i||l)&&(s&&i&&a.append(PAYLOAD_API_ALIASES.Authorization,s),a.append(PAYLOAD_API_ALIASES.Method,PAYLOAD_API_ALIASES[n]),Object.keys(o).length&&Object.keys(o).forEach((function(e){l&&(null==o?void 0:o.files)&&[...o.files].map((e=>{a.append("files",e,e.name)})),a.append(e,o[e])})));const c=i?"POST":n;var u={method:c,redirect:"follow",headers:d,body:"GET"===c?null:i||l?a:JSON.stringify(o)};return await swr(`${t}`,u)},convertDate=(e,t={timeZone:"Asia/Jakarta",year:"numeric",month:"numeric",day:"numeric"})=>new Date(e).toLocaleString("en-US",t),root="",Loading="",ConfirmationPopup="",InfoPopup="",ToastNotification="",Popover$1="",Popover=({trigger:e,content:t,isOpen:n,setIsOpen:s,hideCloseIcon:o,align:r,className:i,withOpenState:l=!0,withArrow:d=!0,customArrow:a="",sideOffset:c=5,alignOffset:u=0})=>{const[x,m]=React.useState(!!l&&n);return React.useEffect((()=>{var e;let t=null==(e=null==document?void 0:document.querySelector(".PopoverArrow"))?void 0:e.parentElement;t&&(null==a?void 0:a.length)&&(t.style.display="inline-flex",t.innerHTML=a)}),[x]),vendor.jsxRuntimeExports.jsxs(vendor.$cb5cc270b50c6fcd$export$be92b6f5f03c0fe9,{...l&&{open:n},...s&&{onOpenChange:e=>{m(e),s(e)}},children:[vendor.jsxRuntimeExports.jsx(vendor.$cb5cc270b50c6fcd$export$41fb9f06171c75f4,{asChild:!0,children:e}),vendor.jsxRuntimeExports.jsx(vendor.$cb5cc270b50c6fcd$export$602eac185826482c,{children:vendor.jsxRuntimeExports.jsxs(vendor.$cb5cc270b50c6fcd$export$7c6e2c02157bb7d2,{className:`sledge__popover-content ${i||""}`,sideOffset:c,alignOffset:u,align:r,...s&&{onOpenAutoFocus:()=>s(!0),onCloseAutoFocus:()=>s(!1)},children:[t,!o&&vendor.jsxRuntimeExports.jsx(vendor.$cb5cc270b50c6fcd$export$f39c2d165cd861fe,{className:"PopoverClose","aria-label":"Close",children:vendor.jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vendor.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"})})}),d?vendor.jsxRuntimeExports.jsx(vendor.$cb5cc270b50c6fcd$export$21b07c8f274aebd5,{className:"PopoverArrow"}):null]})})]})},Progress$1="",Progress=({value:e,total:t,fillColor:n="",outlineColor:s=""})=>{const[o,r]=React.useState(0);return React.useEffect((()=>{const n=setTimeout((()=>r(+e/t*100)),150);return()=>clearTimeout(n)}),[]),vendor.jsxRuntimeExports.jsx(vendor.$67824d98245208a0$export$be92b6f5f03c0fe9,{className:"sledge__progress",value:o,style:s?{borderWidth:"1px",borderStyle:"solid",borderColor:s}:{},children:vendor.jsxRuntimeExports.jsx(vendor.$67824d98245208a0$export$adb584737d712b70,{className:"ProgressIndicator",style:{transform:`translateX(-${100-o}%)`,...n&&{backgroundColor:n}}})})},Checkbox$1="",Checkbox=({id:e,name:t,value:n,required:s,label:o,defaultChecked:r,labelStyle:i={},onClick:l})=>vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__checkbox-wrapper",children:[vendor.jsxRuntimeExports.jsx(vendor.$e698a72e93240346$export$be92b6f5f03c0fe9,{className:"sledge__checkbox-root",defaultChecked:r,id:e,name:t,value:n,required:s,onClick:l,children:vendor.jsxRuntimeExports.jsx(vendor.$e698a72e93240346$export$adb584737d712b70,{className:"sledge__checkbox-indicator",children:vendor.jsxRuntimeExports.jsx("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vendor.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"})})})}),o&&vendor.jsxRuntimeExports.jsx("label",{className:"sledge__checkbox-label",htmlFor:e,style:i,children:o})]}),Slider$1="",Slider=e=>{const{defaultValue:t,min:n,max:s,step:o=1,setValueCommit:r,setValueChange:i}=e,[l,d]=React.useState(t);return vendor.jsxRuntimeExports.jsx("form",{children:vendor.jsxRuntimeExports.jsxs(vendor.$faa2e61a3361514f$export$be92b6f5f03c0fe9,{className:"sledge__SliderRoot",defaultValue:t,min:n,max:s,step:o,"aria-label":"Volume",onValueCommit:e=>{r&&r(e),d(e)},onValueChange:e=>{i&&i(e),d(e)},children:[vendor.jsxRuntimeExports.jsx(vendor.$faa2e61a3361514f$export$13921ac0cc260818,{className:"sledge__SliderTrack",children:vendor.jsxRuntimeExports.jsx(vendor.$faa2e61a3361514f$export$9a58ef0d7ad3278c,{className:"sledge__SliderRange"})}),vendor.jsxRuntimeExports.jsx(Tooltip,{content:l[0],customArrow:'<svg width="19" height="5" viewBox="0 0 19 5" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 4.99998C9 9.48298e-05 16.4996 1.99678e-05 18.4999 0L9 2.2985e-06L0.5 2.04891e-06C9 2.2985e-06 9 4.99998 9 4.99998Z" fill="#43c6ac"/></svg>',wrapTrigger:!1,children:vendor.jsxRuntimeExports.jsx(vendor.$faa2e61a3361514f$export$6521433ed15a34db,{className:"sledge__SliderThumb"})}),vendor.jsxRuntimeExports.jsx(Tooltip,{content:l[1],customArrow:'<svg width="19" height="5" viewBox="0 0 19 5" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 4.99998C9 9.48298e-05 16.4996 1.99678e-05 18.4999 0L9 2.2985e-06L0.5 2.04891e-06C9 2.2985e-06 9 4.99998 9 4.99998Z" fill="#43c6ac"/></svg>',wrapTrigger:!1,children:vendor.jsxRuntimeExports.jsx(vendor.$faa2e61a3361514f$export$6521433ed15a34db,{className:"sledge__SliderThumb"})})]})})},Pagination$1="",Pagination=({currentPage:e,totalPage:t,totalResult:n,onChange:s})=>{const o=1===e,r=e===t;return vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__pagination",children:[vendor.jsxRuntimeExports.jsx("button",{type:"button",className:"sledge__pagination-navigation",...o?{disabled:!0}:{onClick:()=>s(e-1)},children:vendor.jsxRuntimeExports.jsx(ChevronArrowLeftIcon,{width:16,height:16,color:"black"})}),vendor.jsxRuntimeExports.jsxs("span",{children:["Page ",e," of ",t," - total ",n," result"]}),vendor.jsxRuntimeExports.jsx("button",{type:"button",className:"sledge__pagination-navigation",...r?{disabled:!0}:{onClick:()=>s(e+1)},children:vendor.jsxRuntimeExports.jsx(ChevronArrowRightIcon,{width:16,height:16,color:"black"})})]})},RadioGroup$1="",RadioGroup=({id:e,name:t,required:n,defaultValue:s,items:o,labelStyle:r={},onValueChange:i})=>vendor.jsxRuntimeExports.jsx("div",{className:"sledge__radio-group-wrapper",children:vendor.jsxRuntimeExports.jsx("form",{children:vendor.jsxRuntimeExports.jsx(vendor.$f99a8c78507165f7$export$be92b6f5f03c0fe9,{className:"sledge__radio-group-root","aria-label":"View density",defaultValue:s,id:e,name:t,required:n,onValueChange:i,children:o.map(((t,n)=>{const{label:s,value:o}=t;return vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__radio-group-item-flex",children:[vendor.jsxRuntimeExports.jsx(vendor.$f99a8c78507165f7$export$6d08773d2e66f8f2,{className:"sledge__radio-group-item",value:o,id:`${e}${n}`,children:vendor.jsxRuntimeExports.jsx(vendor.$f99a8c78507165f7$export$adb584737d712b70,{className:"sledge__radio-group-indicator"})}),vendor.jsxRuntimeExports.jsx("label",{className:"sledge__radio-group-label",htmlFor:`${e}${n}`,style:r,children:s})]},n)}))})})}),ColorSwatch$1="",ColorSwatch=({id:e,name:t,value:n,rgb:s,image:o,required:r,defaultChecked:i,onClick:l})=>{const d={...(null==o?void 0:o.length)?{backgroundImage:`url(${o})`}:{backgroundColor:s}};return vendor.jsxRuntimeExports.jsx("div",{className:"sledge__color-swatch-wrapper",children:vendor.jsxRuntimeExports.jsx(vendor.$e698a72e93240346$export$be92b6f5f03c0fe9,{className:"sledge__color-swatch-root",defaultChecked:i,id:e,name:t,value:n,required:r,onClick:l,style:d})})},Select$1="",Select=({name:e,placeholder:t,required:n,defaultValue:s,items:o,labelStyle:r={},onValueChange:i})=>vendor.jsxRuntimeExports.jsx("div",{className:"sledge__select-wrapper",children:vendor.jsxRuntimeExports.jsxs(vendor.$cc7e05a45900e73f$export$be92b6f5f03c0fe9,{name:e,required:n,onValueChange:i,children:[vendor.jsxRuntimeExports.jsxs(vendor.$cc7e05a45900e73f$export$41fb9f06171c75f4,{className:"sledge__select-trigger",children:[vendor.jsxRuntimeExports.jsx(vendor.$cc7e05a45900e73f$export$4c8d1a57a761ef94,{placeholder:t}),vendor.jsxRuntimeExports.jsx(vendor.$cc7e05a45900e73f$export$f04a61298a47a40f,{className:"sledge__select-icon",children:vendor.jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vendor.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"})})})]}),vendor.jsxRuntimeExports.jsx(vendor.$cc7e05a45900e73f$export$602eac185826482c,{children:vendor.jsxRuntimeExports.jsxs(vendor.$cc7e05a45900e73f$export$7c6e2c02157bb7d2,{className:"sledge__select-content",children:[vendor.jsxRuntimeExports.jsx(vendor.$cc7e05a45900e73f$export$2f60d3ec9ad468f2,{className:"sledge__select-scroll-button",children:vendor.jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vendor.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"})})}),vendor.jsxRuntimeExports.jsx(vendor.$cc7e05a45900e73f$export$d5c6c08dc2d3ca7,{className:"sledge__select-viewport",children:o.map(((e,t)=>{const{label:n,value:s}=e;return vendor.jsxRuntimeExports.jsx(SelectItemComponent,{value:s,children:n},t)}))}),vendor.jsxRuntimeExports.jsx(vendor.$cc7e05a45900e73f$export$bf1aedc3039c8d63,{className:"sledge__select-scroll-button",children:vendor.jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vendor.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="",...n},s)=>vendor.jsxRuntimeExports.jsxs(vendor.$cc7e05a45900e73f$export$6d08773d2e66f8f2,{className:`sledge__select-item ${t}`,...n,ref:s,children:[vendor.jsxRuntimeExports.jsx(vendor.$cc7e05a45900e73f$export$d6e5bf9c43ea9319,{children:e}),vendor.jsxRuntimeExports.jsx(vendor.$cc7e05a45900e73f$export$c3468e2714d175fa,{className:"sledge__select-item-indicator",children:vendor.jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vendor.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:n,color:s})=>vendor.jsxRuntimeExports.jsx("span",{className:"sledge-icon__heart",children:"outline"===n?vendor.jsxRuntimeExports.jsx("svg",{width:e,height:t,id:"sledge-icon-heart-line",viewBox:"0 0 18 17",fill:s,children:vendor.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"})}):vendor.jsxRuntimeExports.jsx("svg",{width:e,height:t,id:"sledge-icon-heart-fill",viewBox:"0 0 18 17",fill:s,children:vendor.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:n})=>vendor.jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-down",children:vendor.jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vendor.jsxRuntimeExports.jsx("g",{id:"Arrow - Down 2",children:vendor.jsxRuntimeExports.jsx("g",{id:"Iconly/Light-Outline/Arrow---Down-2",children:vendor.jsxRuntimeExports.jsx("g",{id:"Arrow---Down-2",children:vendor.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:n})})})})})}),ChevronArrowLeftIcon=({width:e,height:t,color:n})=>vendor.jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-left",children:vendor.jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vendor.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:n})})}),ChevronArrowRightIcon=({width:e,height:t,color:n})=>vendor.jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-right",children:vendor.jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vendor.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:n})})}),BagIcon=({width:e,height:t,color:n})=>vendor.jsxRuntimeExports.jsx("span",{className:"sledge-icon__bag",children:vendor.jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 18 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vendor.jsxRuntimeExports.jsx("g",{id:"vuesax/bold/bag-2",children:vendor.jsxRuntimeExports.jsx("g",{id:"bag-2",children:vendor.jsxRuntimeExports.jsx("path",{id:"Vector",d:"M14.3711 6.04627C13.919 5.54693 13.2374 5.25677 12.2927 5.15555V4.64271C12.2927 3.71824 11.9013 2.82752 11.2131 2.20671C10.518 1.57241 9.6138 1.2755 8.67584 1.36322C7.06309 1.51842 5.70676 3.07719 5.70676 4.76417V5.15555C4.76205 5.25677 4.08051 5.54693 3.6284 6.04627C2.97385 6.77505 2.9941 7.74674 3.06833 8.42154L3.54068 12.1801C3.68238 13.496 4.21547 14.8455 7.11707 14.8455H10.8824C13.784 14.8455 14.3171 13.496 14.4588 12.1869L14.9312 8.41479C15.0054 7.74674 15.0189 6.77505 14.3711 6.04627ZM8.77031 2.30118C9.4451 2.24045 10.0862 2.44963 10.5855 2.90174C11.0781 3.34711 11.3548 3.98141 11.3548 4.64271V5.11506H6.64472V4.76417C6.64472 3.56304 7.63666 2.40915 8.77031 2.30118ZM6.58399 8.87365H6.57724C6.2061 8.87365 5.90245 8.56999 5.90245 8.19885C5.90245 7.82772 6.2061 7.52406 6.57724 7.52406C6.95512 7.52406 7.25878 7.82772 7.25878 8.19885C7.25878 8.56999 6.95512 8.87365 6.58399 8.87365ZM11.3075 8.87365H11.3008C10.9296 8.87365 10.626 8.56999 10.626 8.19885C10.626 7.82772 10.9296 7.52406 11.3008 7.52406C11.6787 7.52406 11.9823 7.82772 11.9823 8.19885C11.9823 8.56999 11.6787 8.87365 11.3075 8.87365Z",fill:n})})})})}),CloseIcon=({width:e,height:t,color:n})=>vendor.jsxRuntimeExports.jsx("span",{className:"sledge-icon__close",children:vendor.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 20 20",focusable:"false","aria-hidden":"true",width:e,height:t,children:vendor.jsxRuntimeExports.jsx("path",{d:"m11.414 10 6.293-6.293a1 1 0 1 0-1.414-1.414l-6.293 6.293-6.293-6.293a1 1 0 0 0-1.414 1.414l6.293 6.293-6.293 6.293a1 1 0 1 0 1.414 1.414l6.293-6.293 6.293 6.293a.998.998 0 0 0 1.707-.707.999.999 0 0 0-.293-.707l-6.293-6.293z",fill:n})})}),SearchIcon=({width:e,height:t,color:n})=>vendor.jsxRuntimeExports.jsx("span",{className:"sledge-icon__search",children:vendor.jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vendor.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:n})})}),MessageAddIcon=({width:e,height:t,color:n})=>vendor.jsxRuntimeExports.jsx("span",{className:"sledge-icon__message-add",children:vendor.jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vendor.jsxRuntimeExports.jsx("g",{id:"vuesax/bold/message-add",children:vendor.jsxRuntimeExports.jsx("g",{id:"message-add",children:vendor.jsxRuntimeExports.jsx("path",{id:"Vector",d:"M11.1666 1.33301H5.83325C3.16659 1.33301 1.83325 2.66634 1.83325 5.33301V13.9997C1.83325 14.3663 2.13325 14.6663 2.49992 14.6663H11.1666C13.8333 14.6663 15.1666 13.333 15.1666 10.6663V5.33301C15.1666 2.66634 13.8333 1.33301 11.1666 1.33301ZM10.8333 8.49967H8.99992V10.333C8.99992 10.6063 8.77325 10.833 8.49992 10.833C8.22658 10.833 7.99992 10.6063 7.99992 10.333V8.49967H6.16658C5.89325 8.49967 5.66658 8.27301 5.66658 7.99967C5.66658 7.72634 5.89325 7.49967 6.16658 7.49967H7.99992V5.66634C7.99992 5.39301 8.22658 5.16634 8.49992 5.16634C8.77325 5.16634 8.99992 5.39301 8.99992 5.66634V7.49967H10.8333C11.1066 7.49967 11.3333 7.72634 11.3333 7.99967C11.3333 8.27301 11.1066 8.49967 10.8333 8.49967Z",fill:n})})})})}),SwapIcon=({width:e,height:t,color:n})=>vendor.jsxRuntimeExports.jsx("span",{className:"sledge-icon__swap",children:vendor.jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vendor.jsxRuntimeExports.jsx("g",{id:"Swap",children:vendor.jsxRuntimeExports.jsx("g",{id:"Iconly/Light-Outline/Swap",children:vendor.jsxRuntimeExports.jsx("g",{id:"Swap_2",children:vendor.jsxRuntimeExports.jsx("path",{id:"Combined-Shape",d:"M11.7263 3.864C11.9795 3.864 12.1887 4.0521 12.2218 4.29616L12.2263 4.364L12.2262 12.2307L14.0904 10.359C14.2852 10.1633 14.6018 10.1626 14.7975 10.3574C14.9754 10.5345 14.9922 10.8122 14.8474 11.0083L14.7991 11.0645L12.0806 13.7956C12.0642 13.8117 12.0476 13.8263 12.03 13.8398L12.0806 13.7956C12.0561 13.8203 12.0296 13.8418 12.0017 13.8603C11.992 13.8663 11.9819 13.8725 11.9715 13.8784C11.9619 13.8842 11.9522 13.8892 11.9423 13.894C11.9325 13.8983 11.9226 13.9027 11.9125 13.9067C11.8998 13.9122 11.8866 13.9168 11.8734 13.9209C11.8656 13.9229 11.8576 13.9252 11.8495 13.9272C11.8351 13.9312 11.8206 13.9342 11.8061 13.9365C11.7993 13.9373 11.7921 13.9383 11.7849 13.9391C11.7685 13.9414 11.7522 13.9425 11.7359 13.9428C11.7327 13.9425 11.7295 13.9425 11.7263 13.9425L11.7166 13.9428C11.7003 13.9425 11.684 13.9414 11.6678 13.9395L11.7263 13.9425C11.6991 13.9425 11.6724 13.9403 11.6463 13.9362C11.6319 13.9342 11.6174 13.9312 11.6031 13.9276C11.5955 13.9253 11.5879 13.9232 11.5804 13.9209C11.566 13.9169 11.5518 13.9118 11.5378 13.9061C11.5301 13.9026 11.5227 13.8994 11.5154 13.896C11.5038 13.891 11.4923 13.8851 11.4809 13.8787C11.4707 13.8725 11.4606 13.8663 11.4508 13.8598C11.4431 13.8552 11.4355 13.8499 11.428 13.8443L11.4227 13.8398C11.4051 13.8263 11.3884 13.8117 11.3728 13.7961L11.3719 13.7956L8.65336 11.0645C8.45855 10.8688 8.45928 10.5522 8.65499 10.3574C8.83292 10.1803 9.11073 10.1648 9.30613 10.3105L9.3621 10.359L11.2262 12.232L11.2263 4.364C11.2263 4.08786 11.4502 3.864 11.7263 3.864ZM5.10736 2.05497L5.1171 2.05469C5.13339 2.055 5.14967 2.05611 5.16588 2.058L5.10736 2.05497C5.1346 2.05497 5.16133 2.05714 5.18739 2.06133C5.20164 2.06328 5.21594 2.06623 5.23012 2.0698C5.23846 2.07225 5.24696 2.07463 5.25536 2.07723C5.26849 2.08093 5.2812 2.08543 5.29374 2.09046C5.30281 2.0945 5.31199 2.09851 5.32103 2.10279C5.33176 2.10743 5.34234 2.11289 5.35274 2.11876C5.36166 2.12425 5.37048 2.12959 5.37912 2.1352C5.38801 2.14048 5.39691 2.14667 5.40565 2.15318L5.4618 2.20186L8.18032 4.93297C8.37513 5.12868 8.3744 5.44527 8.17869 5.64008C8.00077 5.81718 7.72295 5.83267 7.52755 5.68698L7.47158 5.63844L5.60692 3.76469L5.60736 11.6335C5.60736 11.9096 5.3835 12.1335 5.10736 12.1335C4.85423 12.1335 4.64503 11.9454 4.61192 11.7013L4.60736 11.6335L4.60692 3.76535L2.74329 5.63844C2.56618 5.81636 2.28845 5.83314 2.09237 5.68836L2.03618 5.64008C1.85826 5.46298 1.84148 5.18524 1.98626 4.98916L2.03455 4.93297L4.75306 2.20186L4.78251 2.17486C4.78942 2.16895 4.7965 2.16322 4.80373 2.15768L4.75306 2.20186C4.77759 2.17722 4.80405 2.15567 4.83195 2.13721C4.84168 2.13115 4.8518 2.12496 4.86214 2.11912C4.87175 2.11333 4.88152 2.10825 4.8914 2.10352C4.90117 2.0992 4.91107 2.09484 4.92114 2.09079C4.93393 2.08533 4.94704 2.0807 4.9603 2.07663C4.96836 2.07446 4.97662 2.07215 4.98496 2.07006C4.99839 2.06637 5.01197 2.06355 5.02562 2.06129C5.03383 2.06027 5.04188 2.05915 5.04999 2.05822C5.06542 2.0561 5.08126 2.05503 5.0971 2.0547C5.1006 2.055 5.10398 2.05497 5.10736 2.05497Z",fill:n})})})})})}),NoteIcon=({width:e,height:t,color:n})=>vendor.jsxRuntimeExports.jsx("span",{className:"sledge-icon__note",children:vendor.jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vendor.jsxRuntimeExports.jsxs("g",{id:"vuesax/bold/note-2",children:[vendor.jsxRuntimeExports.jsx("path",{id:"Vector",d:"M8.95178 13.3046C9.13494 13.3473 9.15172 13.5871 8.97332 13.6466L7.91998 13.9933C5.27332 14.8466 3.87998 14.1333 3.01998 11.4866L2.16665 8.85328C1.31332 6.20661 2.01998 4.80661 4.66665 3.95328L4.67731 3.94975C5.08018 3.81633 5.48102 4.22359 5.37901 4.63553C5.37264 4.66126 5.3663 4.68718 5.35998 4.71328L4.70665 7.50661C3.97332 10.6466 5.04665 12.3799 8.18665 13.1266L8.95178 13.3046Z",fill:n}),vendor.jsxRuntimeExports.jsx("path",{id:"Vector_2",d:"M11.9467 2.14033L10.8334 1.88033C8.6067 1.35366 7.28004 1.787 6.50004 3.40033C6.30004 3.807 6.14004 4.30033 6.00671 4.867L5.35337 7.66033C4.70004 10.447 5.56004 11.8203 8.34004 12.4803L9.46004 12.747C9.8467 12.8403 10.2067 12.9003 10.54 12.927C12.62 13.127 13.7267 12.1537 14.2867 9.747L14.94 6.96033C15.5934 4.17366 14.74 2.79366 11.9467 2.14033ZM10.6934 8.887C10.6334 9.11366 10.4334 9.26033 10.2067 9.26033C10.1667 9.26033 10.1267 9.25366 10.08 9.247L8.14004 8.75366C7.87337 8.687 7.71337 8.41366 7.78004 8.147C7.84671 7.88033 8.12004 7.72033 8.38671 7.787L10.3267 8.28033C10.6 8.347 10.76 8.62033 10.6934 8.887ZM12.6467 6.63366C12.5867 6.86033 12.3867 7.007 12.16 7.007C12.12 7.007 12.08 7.00033 12.0334 6.99366L8.80004 6.17366C8.53337 6.107 8.37337 5.83366 8.44004 5.567C8.50671 5.30033 8.78004 5.14033 9.04671 5.207L12.28 6.027C12.5534 6.087 12.7134 6.36033 12.6467 6.63366Z",fill:n})]})})}),Button$1="",Button=React.forwardRef(((e,t)=>{const{className:n="",children:s,colorType:o="light",fullWidth:r=!1,elementType:i="button",link:l="",...d}=e;return"hyperlink"===i&&(null==l?void 0:l.length)?vendor.jsxRuntimeExports.jsx("a",{href:l,className:`sledge__button ${n||""}`,"data-button-color-type":o,"data-button-full-width":r,ref:t,...d,children:s}):vendor.jsxRuntimeExports.jsx("button",{className:`sledge__button ${n||""}`,"data-button-color-type":o,"data-button-full-width":r,ref:t,...d,children:s})})),SearchInputField$1="",SearchInputField=e=>{const{className:t="",icon:n,value:s="",withClearField:o,onChange:r,onResetField:i,fieldRef:l,...d}=e,[a,c]=React.useState(!1);return React.useEffect((()=>{c(Boolean(s))}),[s]),vendor.jsxRuntimeExports.jsxs("div",{className:`sledge__search-input-field-wrapper ${t||""}`,children:[n?vendor.jsxRuntimeExports.jsx("div",{className:"sledge__search-input-field-icon",children:n}):null,vendor.jsxRuntimeExports.jsx("input",{className:"sledge__search-input-field",value:s,onChange:e=>(e=>{r&&r({value:e.target.value})})(e),ref:l,...d}),a&&o?vendor.jsxRuntimeExports.jsx("div",{className:"sledge__clear-field-wrapper",children:vendor.jsxRuntimeExports.jsx("button",{className:"sledge__clear-field",type:"button",onClick:()=>{(null==l?void 0:l.current)&&l.current.focus(),r&&r({value:""}),i&&i()},children:vendor.jsxRuntimeExports.jsx(CloseIcon,{width:14,height:14,color:"#393d4e"})})}):null]})},SelectField$1="",ROTATE_FILTER_ARROW_ANIMATION={open:{rotate:180},closed:{rotate:0},transition:{type:"spring",duration:.2}},VISIBLE_ANIMATION={hidden:{opacity:0,scale:0},visible:e=>{const{duration:t}=e||{};return{opacity:1,scale:1,transition:{type:"spring",duration:t||.7}}}},SelectField=e=>{var t;const{className:n="",placeholder:s=null,prefixLabel:o=null,prefixSelectedLabel:r="",align:i="end",onChange:l,value:d="",options:a=[],LinkComponent:c,link:u}=e,[x,m]=React.useState(!1),p=(null==(t=null==a?void 0:a.filter((({value:e})=>e===d))[0])?void 0:t.label)||s;return vendor.jsxRuntimeExports.jsx("div",{className:`sledge__select-field-wrapper ${n||""}`,children:vendor.jsxRuntimeExports.jsx(Popover,{trigger:vendor.jsxRuntimeExports.jsxs("button",{type:"button",className:"sledge__button sledge__select-field","data-button-color-type":"light","data-button-full-width":"true",children:[o?vendor.jsxRuntimeExports.jsx("span",{className:"sledge__select-field-icon",children:o}):null,vendor.jsxRuntimeExports.jsx("span",{children:(null==r?void 0:r.length)?`${r} ${p}`:p}),vendor.jsxRuntimeExports.jsx(vendor.motion.div,{initial:"closed",animate:x?"open":"closed",variants:ROTATE_FILTER_ARROW_ANIMATION,className:"sort-trigger-icon",children:vendor.jsxRuntimeExports.jsx(ChevronArrowDownIcon,{width:18,height:18,color:"#000000"})})]}),content:vendor.jsxRuntimeExports.jsx("ul",{className:"sledge__select-field-option",children:null==a?void 0:a.map(((e,t)=>{const{label:n,value:s}=e,o=()=>vendor.jsxRuntimeExports.jsx("li",{onClick:()=>((e,t)=>{l&&l({label:e,value:t}),m(!1)})(n,s),...s===d&&{"data-selected":!0},children:n},t);return c?vendor.jsxRuntimeExports.jsx(c,{scroll:!1,to:null==u?void 0:u.replace("value",s),href:null==u?void 0:u.replace("value",s),children:vendor.jsxRuntimeExports.jsx(o,{})},t):vendor.jsxRuntimeExports.jsx(o,{},t)}))}),isOpen:x,setIsOpen:m,hideCloseIcon:!0,align:i,className:"sledge__select-field-option-content",withArrow:!1})})},ProductGrid$1="",addToCart=async e=>{var t,n;let s=[];if(e.map((e=>{const{id:t,quantity:n}=e;s.push({id:t,quantity:n})})),"undefined"==typeof window||!(null==(n=null==(t=null==window?void 0:window.Shopify)?void 0:t.routes)?void 0:n.root))return;let o=`${window.Shopify.routes.root}cart/add.js`,r={items:s};return await fetchApi({url:o,method:"POST",payload:r,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},BadgeFloatingFull=e=>{var t;const{sledgeAnonymId:n}=React.useContext(core.SledgeContext),{isFirstLoading:s,isLoading:o,totalWishlist:r,isMaximizeTotalWishlist:i,proxyUrl:l,position:d="left",dataSettings:a,useProxyUrl:c}=e||{},{is_required_login:u}=(null==(t=null==a?void 0:a.display)?void 0:t.global)||{},[x,m]=React.useState(!1);React.useEffect((()=>{m(n&&u)}),[n]);return vendor.jsxRuntimeExports.jsx("div",{className:`sledge-wishlist__badge-floating sledge-wishlist__badge-floating-${d}`,children:vendor.jsxRuntimeExports.jsxs("span",{onClick:e=>{x&&(e.preventDefault(),e.stopPropagation()),x?"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Login required!",message:"Please login to save your wishlist across devices.",textSubmit:"Login",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:()=>window.location.href="/account/login"}):c&&(window.location.href=l||"/")},className:"sledge-wishlist__badge-floating-icon-link",children:[vendor.jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-floating-text",children:"My Wishlist"}),vendor.jsxRuntimeExports.jsxs("span",{className:"sledge-wishlist__badge-icon",children:[vendor.jsxRuntimeExports.jsx(HeartIcon,{width:18,height:18,type:"fill",color:"#000000"}),!s&&vendor.jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-bottom-right "+(i?"sledge-wishlist__badge-fit-content":""),children:o||x?0:`${i?"99+":r}`||0})]})]})})},BadgeFloatingIcon=e=>{var t;const{sledgeAnonymId:n}=React.useContext(core.SledgeContext),{isFirstLoading:s,isLoading:o,totalWishlist:r,isMaximizeTotalWishlist:i,proxyUrl:l,position:d="bottom-right",dataSettings:a,useProxyUrl:c}=e||{},{is_required_login:u}=(null==(t=null==a?void 0:a.display)?void 0:t.global)||{},[x,m]=React.useState(!1);React.useEffect((()=>{m(n&&u)}),[n]);return vendor.jsxRuntimeExports.jsx("div",{className:`sledge-wishlist__badge-floating-icon sledge-wishlist__badge-floating-${d}`,children:vendor.jsxRuntimeExports.jsx("span",{onClick:e=>{x&&(e.preventDefault(),e.stopPropagation()),x?"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Login required!",message:"Please login to save your wishlist across devices.",textSubmit:"Login",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:()=>window.location.href="/account/login"}):c&&(window.location.href=l||"/")},className:"sledge-wishlist__badge-floating-icon-link",children:vendor.jsxRuntimeExports.jsxs("span",{className:"sledge-wishlist__badge-icon",children:[vendor.jsxRuntimeExports.jsx(HeartIcon,{width:27.01,height:25.73,type:"outline",color:"#000000"}),!s&&vendor.jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-bottom-right "+(i?"sledge-wishlist__badge-fit-content":""),children:o||x?0:`${i?"99+":r}`||0})]})})})},BadgeHeaderMenu=e=>{var t;const{sledgeAnonymId:n}=React.useContext(core.SledgeContext),{isFirstLoading:s,isLoading:o,totalWishlist:r,isMaximizeTotalWishlist:i,proxyUrl:l,dataSettings:d,useProxyUrl:a}=e||{},{is_required_login:c}=(null==(t=null==d?void 0:d.display)?void 0:t.global)||{},u="#000000",[x,m]=React.useState(u),[p,h]=React.useState(!1);React.useEffect((()=>{h(n&&c)}),[n]);return vendor.jsxRuntimeExports.jsxs("span",{className:"sledge-wishlist__badge",onClick:e=>{p&&(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"}):a&&(window.location.href=l||"/")},onMouseEnter:()=>m("#F85538"),onMouseLeave:()=>m(u),children:[vendor.jsxRuntimeExports.jsx(HeartIcon,{width:20,height:20,type:"outline",color:x}),!s&&vendor.jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-header-menu "+(i?"sledge-wishlist__badge-fit-content":""),children:o||p?0:`${i?"99+":r}`||0})]})},addWishlist=async e=>{const{productId:t,productVariantId:n,productName:s,productVendor:o,productSku:r,productVariantName:i,productLink:l,productImage:d,productCurrency:a,productPrice:c}=e;let u="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",x=`${API_URL}/wishlist`,m={product:JSON.stringify({id:sanitizeDataId(t),variant_id:sanitizeDataId(n),name:s,vendor:o,sku:r,variant_name:i,url:l,image_url:d,currency:a,price:c})};return await fetchApi({url:x,method:"POST",authorization:u,payload:m}).then((e=>e)).catch((()=>{}))},bulkAddWishlist=async e=>{let t="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",n=e.map((e=>{const{productId:t,productVariantId:n,productName:s,productVariantName:o,productLink:r,productImage:i,productCurrency:l,productPrice:d}=e;return{id:sanitizeDataId(t),variant_id:sanitizeDataId(n),name:s,variant_name:o,url:r,image_url:i,currency:l,price:d}})),s=`${API_URL}/wishlist/bulk`,o={products:n};return await fetchApi({url:s,method:"POST",authorization:t,payload:o,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},getWishlistInfo=async e=>{let t=e||("undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||""),n=`${API_URL}/wishlist/info`;return await fetchApi({url:n,method:"GET",authorization:t}).then((e=>e)).catch((()=>{}))},checkWishlist=async(e,t)=>{let n=sanitizeDataId(e),s=t?sanitizeDataId(t):"",o="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",r="?"+new URLSearchParams({variant_id:s}).toString(),i=`${API_URL}/wishlist/check/${n}${r}`;return await fetchApi({url:i,method:"GET",authorization:o}).then((e=>Boolean(e.data))).catch((()=>{}))},addToCartTrigger$1=async e=>{const{productId:t}=e;let n="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",s=`${API_URL}/wishlist/cart`,o={product:JSON.stringify({id:sanitizeDataId(t)})};return await fetchApi({url:s,method:"POST",authorization:n,payload:o}).then((e=>e)).catch((()=>{}))},BadgeRoot=e=>{const{children:t,useProxyUrl:n=!1,data:s}=e,{isRenderApp:o,triggerRenderMultipleComponent:r}=React.useContext(core.SledgeContext),{wishlist:i}=o||{},[l,d]=React.useState((null==s?void 0:s.total_data)||0),[a,c]=React.useState(!s),[u,x]=React.useState(!s),[m,p]=React.useState(!1),[h,g]=React.useState((null==s?void 0:s.proxy_url)||""),[v,_]=React.useState({}),R=async e=>{let t;t=JSON.parse(e),t&&(_(t),await(async()=>{var e,t,n;let s,o,r,i=!1;s=await getWishlistInfo(),i=200===(null==(e=null==s?void 0:s.status)?void 0:e.code)||!1,o=(null==(t=null==s?void 0:s.data)?void 0:t.total_data)?s.data.total_data:0,r=(null==(n=null==s?void 0:s.data)?void 0:n.proxy_url)||"",i&&(d(o),p(o>99),g(r),c(!1),x(!1))})())};return React.useEffect((()=>{i&&R(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||null)}),[i,r]),vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:React.Children.count(t)&&React.Children.map(t,(e=>React.cloneElement(e,{isFirstLoading:a,isLoading:u,totalWishlist:l,isMaximizeTotalWishlist:m,proxyUrl:h,dataSettings:v,useProxyUrl:n})))})},Badge=({children:e})=>vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:React.Children.count(e)&&React.Children.map(e,(e=>React.cloneElement(e,{})))});Badge.Root=BadgeRoot,Badge.HeaderMenu=BadgeHeaderMenu,Badge.FloatingFull=BadgeFloatingFull,Badge.FloatingIcon=BadgeFloatingIcon;const BadgeInitSelector=(e=!1)=>{const t=JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||"");if(!t)return;const{floating_button_type:n}=(null==t?void 0:t.launch_point)||{},s=String(n).includes("bottom");if("none"!==n)if(s){let e=document.createElement("div");if(e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.WISHLIST.ELEMENT_BADGE_FLOATING_ICON),document.body.appendChild(e),e){e.innerHTML="";const t=e.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.USE_PROXY_URL);vendor.client.createRoot(e).render(vendor.jsxRuntimeExports.jsx(React.StrictMode,{children:vendor.jsxRuntimeExports.jsx(core.SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:vendor.jsxRuntimeExports.jsx(Badge.Root,{useProxyUrl:Boolean(t&&"true"===t),children:vendor.jsxRuntimeExports.jsx(Badge.FloatingIcon,{position:n})})})}))}}else{let e=document.createElement("div");if(e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.WISHLIST.ELEMENT_BADGE_FLOATING_FULL),document.body.appendChild(e),e){e.innerHTML="";const t=e.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.USE_PROXY_URL);vendor.client.createRoot(e).render(vendor.jsxRuntimeExports.jsx(React.StrictMode,{children:vendor.jsxRuntimeExports.jsx(core.SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:vendor.jsxRuntimeExports.jsx(Badge.Root,{useProxyUrl:Boolean(t&&"true"===t),children:vendor.jsxRuntimeExports.jsx(Badge.FloatingFull,{position:n})})})}))}}else{let t=Array.from(document.querySelectorAll(SELECTOR.WISHLIST.ELEMENT_BADGE));detectInitSelector({element:t,init:()=>{t.length&&t.map((e=>{if(e){const t=e.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.USE_PROXY_URL);e.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.ELEMENT_CONTAINER_WIDGET}"]`)&&e.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.ELEMENT_CONTAINER_WIDGET}"]`).remove();let n=document.createElement("div");n.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.ELEMENT_CONTAINER_WIDGET),e.appendChild(n),vendor.client.createRoot(n).render(vendor.jsxRuntimeExports.jsx(React.StrictMode,{children:vendor.jsxRuntimeExports.jsx(core.SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:vendor.jsxRuntimeExports.jsx(Badge.Root,{useProxyUrl:Boolean(t&&"true"===t),children:vendor.jsxRuntimeExports.jsx(Badge.HeaderMenu,{})})})}))}}))},reRender:e})}},Trigger=e=>{var t,n,s;const{params:o,forceActive:r=!1,hidden:i=!1,onAfterAddWishlist:l,onAfterRemoveWishlist:d,wishlistChecked:a}=e,{productId:c,productVariantId:u}=o||{},{isRenderApp:x,triggerRenderMultipleComponent:m,sledgeAnonymId:p}=React.useContext(core.SledgeContext),{wishlist:h}=x||{},g="#767676",v="outline",_="#F85538",R="fill",j="boolean"==typeof a,E=!!j&&a,[w,f]=React.useState(E?_:g),[S,C]=React.useState(E?R:v),[T,A]=React.useState(!!a),[L,N]=React.useState(!j),[I,y]=React.useState({}),[b,O]=React.useState({onAfterAddWishlist:l,onAfterRemoveWishlist:d}),[k,P]=React.useState(!1),[$,W]=React.useState(!0),{is_required_login:D}=(null==(t=null==I?void 0:I.display)?void 0:t.global)||{},{show:F,location:B}=(null==(n=null==I?void 0:I.display)?void 0:n.notification)||{},{title_added_to_wishlist:U,text_added_to_wishlist:M,title_removed_to_wishlist:G,text_removed_to_wishlist:H}=(null==(s=null==I?void 0:I.languages)?void 0:s.notification)||{},V=async()=>{let e;"boolean"==typeof a&&$?(e=a,W(!1)):e=await checkWishlist(c,u),A(r||e)};React.useEffect((()=>{h&&("undefined"!=typeof window&&(window.sledgeWishlistTriggerUpdate=()=>{V()}),(async e=>{let t;N(!0),t=JSON.parse(e),t&&(y(t),N(!1))})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||null))}),[h]),React.useEffect((()=>{P(p&&D)}),[p]),React.useEffect((()=>{h&&V()}),[h,u]);const K=(T||r)&&!k;return React.useEffect((()=>{K?(f(_),C(R)):(f(g),C(v))}),[T]),vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:!L&&!i&&vendor.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__trigger-block",children:vendor.jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__trigger",onClick:e=>(async e=>{var t,n,s,r,i,l;if(e.preventDefault(),e.stopPropagation(),k)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"}));A(!T);let d=await addWishlist(o);const{status:c,data:u}=d||{},{code:x}=c||{};200===x?((null==(n=null==(t=null==m?void 0:m.wishlist)?void 0:t.badge)?void 0:n.trigger)&&"boolean"!=typeof a&&(null==(l=null==(s=null==m?void 0:m.wishlist)?void 0:s.badge)||l.trigger(!(null==(i=null==(r=null==m?void 0:m.wishlist)?void 0:r.badge)?void 0:i.value))),BadgeInitSelector(!0),"undefined"!=typeof window&&(window.sledgeWishlistWidgetListUpdate&&window.sledgeWishlistWidgetListUpdate(),window.sledgeWishlistButtonDetailUpdate&&window.sledgeWishlistButtonDetailUpdate()),V(),T?b.onAfterRemoveWishlist&&b.onAfterRemoveWishlist("success"):b.onAfterAddWishlist&&b.onAfterAddWishlist("success"),"undefined"!=typeof window&&window.sledgeToastNotification&&F&&window.sledgeToastNotification({title:T?G:U,message:T?H:M,location:B,type:"success",icon:vendor.jsxRuntimeExports.jsx(HeartIcon,{width:40,height:40,color:"black",type:"outline"})})):(T?b.onAfterRemoveWishlist&&b.onAfterRemoveWishlist("failed"):b.onAfterAddWishlist&&b.onAfterAddWishlist("failed"),"undefined"!=typeof window&&window.sledgeToastNotification&&F&&window.sledgeToastNotification({title:"Failed",message:"failed add to wishlist",location:B,type:"failed",icon:vendor.jsxRuntimeExports.jsx(HeartIcon,{width:40,height:40,color:"black",type:"outline"})}))})(e),onMouseEnter:()=>{K||(f(_),C(R))},onMouseLeave:()=>{K||(f(g),C(v))},children:vendor.jsxRuntimeExports.jsx(HeartIcon,{width:16.67,height:15.83,type:S,color:w})})})})},WidgetHeaderClearTrigger=({buttonText:e,shareId:t,dataSettings:n,isFirstLoading:s})=>{var o,r,i,l,d;const{sledgeAnonymId:a}=React.useContext(core.SledgeContext),{is_required_login:c}=(null==(o=null==n?void 0:n.display)?void 0:o.global)||{},{text_color:u,border_color:x,border_radius:m,padding_top:p,padding_bottom:h,padding_left:g,padding_right:v,background_color:_,font_size:R,font_weight:j,text_transform:E}=(null==(i=null==(r=null==n?void 0:n.display)?void 0:r.widget)?void 0:i.button_clear_all)||{},{title_confirm_clear_all_wishlist:w,text_confirm_clear_all_wishlist:f,button_submit_confirm_clear_all_wishlist:S,button_cancel_confirm_clear_all_wishlist:C}=(null==(l=null==n?void 0:n.languages)?void 0:l.popup)||{},{button_clear_all:T}=(null==(d=null==n?void 0:n.languages)?void 0:d.widget)||{},[A,L]=React.useState(!1),N={...u&&{color:u},...x&&{borderColor:x},...m&&{borderRadius:m},...p&&{paddingTop:p},...h&&{paddingBottom:h},...g&&{paddingLeft:g},...v&&{paddingRight:v},..._&&{backgroundColor:_},...R&&{fontSize:R},...j&&{fontWeight:j},...E&&{textTransform:E}};React.useEffect((()=>{L(a&&c)}),[a]);return vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:!A&&vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:!t&&vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:s?vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"132px",height:"46px",color:"lighten",rounded:"md"}):vendor.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:vendor.jsxRuntimeExports.jsx(Button,{type:"button",colorType:"danger",onClick:()=>{"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:w,message:f,textSubmit:S,textCancel:C,buttonSubmitType:"danger",onSubmit:window.sledgeWishlistWidgetClearList||{}})},style:N,children:e||(T||"Clear Wishlist")})})})})})},WidgetHeaderShareTrigger=({wishlistData:e,buttonText:t,showShareTrigger:n,shareLink:s,shareId:o,dataSettings:r,isFirstLoading:i})=>{var l,d,a,c,u,x;const{triggerRenderMultipleComponent:m,sledgeAnonymId:p}=React.useContext(core.SledgeContext),{is_required_login:h}=(null==(l=null==r?void 0:r.display)?void 0:l.global)||{},{text_color:g,border_color:v,border_radius:_,padding_top:R,padding_bottom:j,padding_left:E,padding_right:w,background_color:f,font_size:S,font_weight:C,text_transform:T}=(null==(a=null==(d=null==r?void 0:r.display)?void 0:d.widget)?void 0:a.button_share)||{},{title_share_wishlist:A}=(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:N,text_added_all_to_wishlist:I}=(null==(x=null==r?void 0:r.languages)?void 0:x.notification)||{},[y,b]=React.useState(!1),O={...g&&{color:g},...v&&{borderColor:v},..._&&{borderRadius:_},...R&&{paddingTop:R},...j&&{paddingBottom:j},...E&&{paddingLeft:E},...w&&{paddingRight:w},...f&&{backgroundColor:f},...S&&{fontSize:S},...C&&{fontWeight:C},...T&&{textTransform:T}},[k,P]=React.useState(!1);let $='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g id="vuesax/linear/copy">\n <g id="copy">\n <path id="Vector" d="M16 12.9V17.1C16 20.6 14.6 22 11.1 22H6.9C3.4 22 2 20.6 2 17.1V12.9C2 9.4 3.4 8 6.9 8H11.1C14.6 8 16 9.4 16 12.9Z" stroke="#767676" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path id="Vector_2" d="M22 6.9V11.1C22 14.6 20.6 16 17.1 16H16V12.9C16 9.4 14.6 8 11.1 8H8V6.9C8 3.4 9.4 2 12.9 2H17.1C20.6 2 22 3.4 22 6.9Z" stroke="#767676" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n </g>\n </g>\n </svg>\n ';const W=async()=>{var t,n,s,o,r,i,l;P(!0);let d=e.map((e=>{const{id:t,variant_id:n,name:s,variant_name:o,url:r,image_url:i,currency:l,price:d}=e.product;return{productId:t,productVariantId:n,productName:s,productVariantName:o,productLink:r,productImage:i,productCurrency:l,productPrice:d}})),a=await bulkAddWishlist(d);200===(null==(t=null==a?void 0:a.status)?void 0:t.code)?("undefined"!=typeof window&&((null==(s=null==(n=null==m?void 0:m.wishlist)?void 0:n.badge)?void 0:s.trigger)&&(null==(l=null==(o=null==m?void 0:m.wishlist)?void 0:o.badge)||l.trigger(!(null==(i=null==(r=null==m?void 0:m.wishlist)?void 0:r.badge)?void 0:i.value))),BadgeInitSelector(),window.sledgeInfoPopup&&window.sledgeInfoPopup({title:N,message:I,textCancel:"Cancel"})),P(!1)):"undefined"!=typeof window&&window.sledgeInfoPopup&&window.sledgeInfoPopup({title:"Failed",message:"Failed add to wishlist, please try again",textCancel:"Cancel"})};return React.useEffect((()=>{b(p&&h)}),[p]),vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:!y&&vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:n&&vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:i?vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"136px",height:"46px",color:"lighten",rounded:"md"}):vendor.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item sledge-wishlist__widget-header-share-trigger",children:vendor.jsxRuntimeExports.jsx(Button,{type:"button",style:O,...o&&!e.length||k?{disabled:!0}:{onClick:async()=>{o&&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:A,message:s?`<div class="sledge-wishlist__widget-box-copy">\n <div class="sledge-wishlist__widget-box-copy-icon" title="Copy to clipboard">\n ${$}\n </div>\n <div class="sledge-wishlist__widget-box-copy-content">${s}</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 n=null==(e=document.querySelector(".sledge-wishlist__widget-box-copy-content"))?void 0:e.textContent;n&&(navigator.clipboard.writeText(n),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=$)}),2500)))}))}}))})())}},children:o?vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:[vendor.jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-top-right",children:e.length}),k?"Adding...":"Add to your wishlist"]}):t||(L||"Share Wishlist")})})})})})},WidgetHeaderSearchForm=({setIsLoading:e,setKeyword:t,keyword:n,placeholder:s,dataSettings:o})=>{var r,i;const{sledgeAnonymId:l}=React.useContext(core.SledgeContext),{is_required_login:d}=(null==(r=null==o?void 0:o.display)?void 0:r.global)||{},{search_form_placeholder:a}=(null==(i=null==o?void 0:o.languages)?void 0:i.widget)||{},[c,u]=React.useState(!1),x=React.useRef(null);return React.useEffect((()=>{u(l&&d)}),[l]),vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:!c&&vendor.jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:vendor.jsxRuntimeExports.jsx(SearchIcon,{width:18,height:18,color:"#868686"}),placeholder:s||(a||"Search product..."),value:n,fieldRef:x,onChange:({value:e})=>(e=>{t&&t(e)})(e),onResetField:()=>{var n;e&&e(!0),t&&t(""),null==(n=null==x?void 0:x.current)||n.focus()},className:"sledge-wishlist__widget-header-item sledge-wishlist__widget-search-form",withClearField:!0})})},WidgetHeaderTitle=({text:e,dataSettings:t})=>{var n,s,o;const{color:r,font_size:i,font_weight:l,text_transform:d}=(null==(s=null==(n=null==t?void 0:t.display)?void 0:n.widget)?void 0:s.header_title)||{},{header_title:a}=(null==(o=null==t?void 0:t.languages)?void 0:o.widget)||{},c={...r&&{color:r},...i&&{fontSize:i},...l&&{fontWeight:l},...d&&{textTransform:d}};return vendor.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:vendor.jsxRuntimeExports.jsx("h1",{style:c,children:e||(a||"My Wishlist")})})},WidgetHeaderLimit=({options:e,defaultLimitOptions:t,selectedLimit:n,setSelectedLimit:s,setIsRefreshWidgetList:o,dataSettings:r})=>{var i;const{sledgeAnonymId:l}=React.useContext(core.SledgeContext),{is_required_login:d}=(null==(i=null==r?void 0:r.display)?void 0:i.global)||{},[a,c]=React.useState(!1);let u=e||t;return React.useEffect((()=>{c(l&&d)}),[l]),vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:a?null:vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:u&&Boolean(null==u?void 0:u.length)&&vendor.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:vendor.jsxRuntimeExports.jsx(SelectField,{align:"end",options:u.map((e=>({label:e,value:e}))),value:n||u[0],onChange:({value:e})=>(e=>{s&&s(e),o&&o(!0)})(e)})})})})},WidgetHeaderSort$1=({wishlistSort:e,selectedSort:t,setSelectedSort:n,setIsRefreshWidgetList:s,dataSettings:o})=>{var r,i;const{sledgeAnonymId:l}=React.useContext(core.SledgeContext),{is_required_login:d}=(null==(r=null==o?void 0:o.display)?void 0:r.global)||{},[a,c]=React.useState(!1);return React.useEffect((()=>{c(l&&d)}),[l]),vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:a?null:vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:e&&Boolean(null==e?void 0:e.length)&&vendor.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:vendor.jsxRuntimeExports.jsx(SelectField,{align:"end",options:e.map((e=>{const{name:t,value:n}=e;return{label:t,value:n}})),value:t||(null==(i=e[0])?void 0:i.value),onChange:({value:e})=>(e=>{n&&n(e),s&&s(!0)})(e)})})})})},WidgetHeader$1=({isFirstLoading:e,...t})=>vendor.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header",children:e?vendor.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"8px",width:"100%",justifyContent:"space-between"},children:[vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"190px",height:"46px",color:"lighten",rounded:"md"}),vendor.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"8px"},children:[vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"440px",height:"46px",color:"lighten",rounded:"md"}),vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"132px",height:"46px",color:"lighten",rounded:"md"}),vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"136px",height:"46px",color:"lighten",rounded:"md"})]}),vendor.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"26px"},children:[vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"190px",height:"46px",color:"lighten",rounded:"md"}),vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"190px",height:"46px",color:"lighten",rounded:"md"})]})]}):React.Children.count(t.children)&&React.Children.map(t.children,(e=>React.cloneElement(e,{...t})))});WidgetHeader$1.Title=WidgetHeaderTitle,WidgetHeader$1.SearchForm=WidgetHeaderSearchForm,WidgetHeader$1.ShareTrigger=WidgetHeaderShareTrigger,WidgetHeader$1.ClearTrigger=WidgetHeaderClearTrigger,WidgetHeader$1.Sort=WidgetHeaderSort$1,WidgetHeader$1.Limit=WidgetHeaderLimit;const usePrevious=e=>{const t=React.useRef();return React.useEffect((()=>{t.current=e})),t.current},getReviewInfo=async e=>{let t=sanitizeDataId(e),n="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",s=`${API_URL}/review/info/${t}?${PAYLOAD_API_ALIASES.Authorization}=${n}`;return await fetchApi({url:s,method:"GET",authorization:n,isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},getProductsReviewInfo=async(e,t)=>{let n=e.map((e=>sanitizeDataId(e))),s=t||("undefined"!=typeof localStorage&&(null==localStorage?void 0:localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP))||""),o=`${API_URL}/review/info/ids/${n.join(",")}?${PAYLOAD_API_ALIASES.Authorization}=${s}`;return await fetchApi({url:o,method:"GET",authorization:s,isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},Rating=e=>{var t,n;const{total:s,average:o,size:r="sm",params:i,withSkeletonLoading:l=!0,withTotal:d=!0,isScrollToElementWidget:a=!0,data:c,sledgeSettings:u}=e,{productId:x}=i||{},{isRenderApp:m,triggerRenderMultipleComponent:p}=React.useContext(core.SledgeContext),{productReview:h}=m||{},g=!c&&void 0===s&&void 0===o,[v,_]=React.useState(g),[R,j]=React.useState(g),[E,w]=React.useState(c||void 0!==s||void 0!==o?getSizing(r):{width:0,height:0}),[f,S]=React.useState((null==c?void 0:c.review_count)||s||0),[C,T]=React.useState((null==(t=null==c?void 0:c.rating)?void 0:t.average)||o||"0"),[A,L]=React.useState((null==u?void 0:u.review)||{}),[N,I]=React.useState(!0),y=usePrevious({productId:x}),{fill_color:b,outline_color:O}=(null==(n=null==A?void 0:A.display)?void 0:n.rating)||{},k=async(e,t=!1)=>{var n,s,o,r,i,l,d;if(e!==x)return;let a,u,m,h=!1,g=0;if(c&&N)m=c,h=!0,I(!1);else{if(a=await getReviewInfo(e),!a)return;const{status:t}=a;m=a.data;const{code:n}=t;h=200===n||!1}g=(null==m?void 0:m.review_count)?m.review_count:0,u=(null==(n=null==m?void 0:m.rating)?void 0:n.average)?m.rating.average:0,h&&(S(g),T(u),j(!1),_(!1),t&&(null==(o=null==(s=null==p?void 0:p.productReview)?void 0:s.rating)?void 0:o.value)&&(null==(i=null==(r=null==p?void 0:p.productReview)?void 0:r.rating)?void 0:i.trigger)&&(null==(d=null==(l=null==p?void 0:p.productReview)?void 0:l.rating)||d.trigger("")))},P=async e=>{let t;j(!0),t=JSON.parse(e),t&&(L(t),await(async()=>{void 0!==s||void 0!==o?j(!1):k(x)})())};return React.useEffect((()=>{if(!h)return;w("xs"===r?{width:14.4,height:14.4}:"sm"===r?{width:18,height:18}:{width:28.8,height:28.8}),Boolean(y&&(null==y?void 0:y.productId)!==x)&&_(!0),P(localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||null)}),[h,x]),React.useEffect((()=>{var e,t,n,s;!x||x&&(null==(t=null==(e=null==p?void 0:p.productReview)?void 0:e.rating)?void 0:t.value)!==x||(_(!0),k(null==(s=null==(n=null==p?void 0:p.productReview)?void 0:n.rating)?void 0:s.value,!0))}),[x,p]),vendor.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__rating",onClick:()=>{a&&setTimeout((()=>{scrollToElement({element:document.getElementById(ELEMENT_ID.PRODUCT_REVIEW.ELEMENT_WIDGET),headerOffset:50})}),200)},children:v&&l?vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"230px",height:"28px",color:"lighten",rounded:"md"}):vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:[vendor.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",style:{display:"none"},id:"sledge-product-review-rating-icon-svg-store",children:[vendor.jsxRuntimeExports.jsx("symbol",{id:"sledge-product-review-icons-rating-icon-fill",viewBox:"0 0 30 29",fill:b||"#43c6ac",children:vendor.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"})}),vendor.jsxRuntimeExports.jsx("symbol",{id:"sledge-product-review-icons-rating-icon-line",viewBox:"0 0 30 29",stroke:O||"#8D9196",fill:"none",children:vendor.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"})}),vendor.jsxRuntimeExports.jsx("defs",{children:vendor.jsxRuntimeExports.jsxs("g",{id:"sledge-product-review-icons-rating-icon",children:[vendor.jsxRuntimeExports.jsx("use",{href:"#sledge-product-review-icons-rating-icon-line",className:"sledge-product-review__rating-icon-line"}),vendor.jsxRuntimeExports.jsx("use",{href:"#sledge-product-review-icons-rating-icon-fill",className:"sledge-product-review__rating-icon-fill"})]})})]}),!R&&vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:[[1,2,3,4,5].map(((e,t)=>{let n=Math.floor(parseFloat(C)),s=String(C).includes(",")?String(C).split(","):[],o=String(C).includes(".")?String(C).split("."):[],r=s.length||o.length?s[1]||o[1]:0,i="fill-0";return e>n&&n+1===e&&(i=`fill-${r}`),React.createElement("svg",{...E,viewBox:"0 0 30 29","data-product-review-rating-fill":e<=n?"full":i,key:t},vendor.jsxRuntimeExports.jsx("use",{href:"#sledge-product-review-icons-rating-icon"}))})),d?vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__rating-summary-total",children:["(",f,")"]}):vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{})]})]})})},getSizing=e=>"xs"===e?{width:14.4,height:14.4}:"sm"===e?{width:18,height:18}:{width:28.8,height:28.8},WidgetHeaderAddTrigger=({isFirstLoading:e,text:t,dataSettings:n,params:s,onAfterAddReview:o})=>{var r,i,l;const{text_color:d,border_color:a,border_radius:c,padding_top:u,padding_bottom:x,padding_left:m,padding_right:p,background_color:h,font_size:g,font_weight:v,text_transform:_}=(null==(i=null==(r=null==n?void 0:n.display)?void 0:r.widget)?void 0:i.button_write_review)||{},{button_write_review:R}=(null==(l=null==n?void 0:n.languages)?void 0:l.widget)||{},j={...d&&{color:d},...a&&{borderColor:a},...c&&{borderRadius:c},...u&&{paddingTop:u},...x&&{paddingBottom:x},...m&&{paddingLeft:m},...p&&{paddingRight:p},...h&&{backgroundColor:h},...g&&{fontSize:g},...v&&{fontWeight:v},..._&&{textTransform:_}};return vendor.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-header-item",children:e?vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"134px",height:"42px",rounded:"lg",color:"lighten"}):vendor.jsxRuntimeExports.jsxs(Button,{type:"button",colorType:"success",className:"sledge-product-review__widget-header-add-trigger",onClick:()=>"undefined"!=typeof window&&window.sledgeProductReviewWidgetFormAdd&&window.sledgeProductReviewWidgetFormAdd(s,o),style:j,children:[vendor.jsxRuntimeExports.jsx(MessageAddIcon,{width:16,height:16,color:"currentColor"}),t||(R||"Add review")]})})},WidgetHeaderSort=({isFirstLoading:e,productReviewSort:t,dataSettings:n,setSelectedSort:s,setIsRefreshWidgetList:o})=>{var r,i;const{default_sort:l,show_sorting_options:d}=(null==(r=null==n?void 0:n.display)?void 0:r.widget)||{},[a,c]=React.useState(l||null),u=a||(null==(i=t[0])?void 0:i.value);return vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:d?vendor.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-header-item",children:e?vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"134px",height:"42px",rounded:"lg",color:"lighten"}):vendor.jsxRuntimeExports.jsx(SelectField,{align:"end",prefixLabel:vendor.jsxRuntimeExports.jsx(SwapIcon,{width:16,height:16,color:"currentColor"}),prefixSelectedLabel:"Sort by",options:t.map((e=>{const{name:t,value:n}=e;return{label:t,value:n}})),value:u,onChange:({value:e})=>(e=>{c(e),o&&o(!0),s&&s(e)})(e),link:"?page=1&sort=value"})}):null})},WidgetHeaderSummary=e=>{var t,n,s,o;const{params:r,dataSettings:i,summaryData:l,sledgeSettings:d}=e,{productId:a}=r||{},{fill_color:c,outline_color:u}=(null==(n=null==(t=null==i?void 0:i.display)?void 0:t.widget)?void 0:n.summary_bar)||{},{review_singular:x,review_plural:m}=(null==(s=null==i?void 0:i.languages)?void 0:s.widget)||{},[p,h]=React.useState(!0),[g,v]=React.useState(!0),[_,R]=React.useState(!0),[j,E]=React.useState(!l),[w,f]=React.useState(!1),[S,C]=React.useState(0|(null==l?void 0:l.review_count)),[T,A]=React.useState((null==l?void 0:l.rating)||{5:0,4:0,3:0,2:0,1:0}),[L,N]=React.useState((null==(o=null==l?void 0:l.rating)?void 0:o.average)||"0"),[I,y]=React.useState(!0),b=usePrevious({productId:a}),O=async()=>{var e;let t,n,s,o,r=!1,i=0;if(l&&I)n=l,r=!0,y(!1);else{if(t=await getReviewInfo(a),!t)return;const{status:e}=t,{code:s}=e;n=t.data,r=200===s||!1}i=(null==n?void 0:n.review_count)?n.review_count:0,s=(null==n?void 0:n.rating)?{5:n.rating[5]||0,4:n.rating[4]||0,3:n.rating[3]||0,2:n.rating[2]||0,1:n.rating[1]||0}:T,o=(null==(e=null==n?void 0:n.rating)?void 0:e.average)?n.rating.average:"0",r&&(C(i),A(s),N(o),R(!1),E(!1),h(!1),w&&v(!1))};return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetSummaryUpdate=()=>{E(!0),O()}),Boolean(b&&(null==b?void 0:b.productId)!==a)&&h(!0),O()}),[w,a]),vendor.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary",children:p&&!l?vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"630px",height:"42px",color:"lighten",rounded:"md"}):_&&!l?null:vendor.jsxRuntimeExports.jsx(Popover,{trigger:vendor.jsxRuntimeExports.jsxs(vendor.motion.div,{initial:!1,animate:w?"open":"closed",className:"sledge-product-review__widget-summary-trigger",children:[vendor.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-average",children:L}),vendor.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-rating",children:!j&&vendor.jsxRuntimeExports.jsx(Rating,{data:l,sledgeSettings:d,average:String(L),size:"md",withSkeletonLoading:!1,withTotal:!1,isScrollToElementWidget:!1})}),vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-total",children:[S," ",S>1?m||"Reviews":x||"Review"]}),vendor.jsxRuntimeExports.jsx(vendor.motion.div,{variants:ROTATE_FILTER_ARROW_ANIMATION,className:"summary-trigger-icon",children:vendor.jsxRuntimeExports.jsx("svg",{width:20,height:20,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vendor.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:g?vendor.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-dist-progress",children:[5,4,3,2,1].map((e=>vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-dist-progress-item",children:[vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"108px",height:"22px",color:"lighten",rounded:"md"}),vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"128px",height:"22px",color:"lighten",rounded:"md",style:{marginLeft:"13px",marginRight:"12px"}}),vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"38px",height:"22px",color:"lighten",rounded:"md"})]},e)))}):vendor.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-dist",children:vendor.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-dist-progress",children:[5,4,3,2,1].map(((e,t)=>vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-dist-progress-item",children:[vendor.jsxRuntimeExports.jsx(Rating,{data:l,sledgeSettings:d,average:e,size:"sm",withSkeletonLoading:!1,withTotal:!1,isScrollToElementWidget:!1}),vendor.jsxRuntimeExports.jsx(Progress,{value:String(T[e]),total:S,fillColor:c,outlineColor:u}),vendor.jsxRuntimeExports.jsxs("small",{children:["(",T[e],")"]})]},t)))})}),setIsOpen:f,hideCloseIcon:!0,align:"end",alignOffset:-170,className:"sledge-product-review__widget-summary-content",withArrow:!1})})},WidgetHeader=e=>{const[t,n]=React.useState(!e.data);return React.useEffect((()=>{n(!1)}),[]),vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:!t&&vendor.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.Sort=WidgetHeaderSort,WidgetHeader.AddTrigger=WidgetHeaderAddTrigger,WidgetHeader.Summary=WidgetHeaderSummary;const search=async(e,t)=>{let n="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_AUTH_APP)||"",s=`${INSTANT_SEARCH_ENGINE_URL}/indexes/${e}/search`;return await fetchApi({url:s,method:"POST",authorization:n,payload:t,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},multiSearch=async(e,t)=>{let n=t||("undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_AUTH_APP)||""),s=`${INSTANT_SEARCH_ENGINE_URL}/multi-search`;return await fetchApi({url:s,method:"POST",authorization:n,payload:e,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},searchTrigger=async e=>{const{keyword:t,resultCount:n}=e;let s="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",o=`${API_URL}/instantsearch/statistics/search`,r={keyword:t,result_count:n};return await fetchApi({url:o,method:"POST",authorization:s,payload:r,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},productClickTrigger=async e=>{const{productId:t}=e;let n="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",s=`${API_URL}/instantsearch/statistics/click`,o={product:{id:sanitizeDataId(t)}};return await fetchApi({url:s,method:"POST",authorization:n,payload:o,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},addToCartTrigger=async e=>{const{productId:t}=e;let n="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",s=`${API_URL}/instantsearch/statistics/cart`,o={product:{id:sanitizeDataId(t)}};return await fetchApi({url:s,method:"POST",authorization:n,payload:o,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},ProductGrid=({type:e,className:t="",data:n,setting:s,showOptionOutOfStock:o=!1,triggerPropAdditional:r,sourceApp:i=null,isComponentJsVersion:l=!1,cards:d,onAfterAddToCart:a,onAfterAddWishlist:c,onAfterRemoveWishlist:u,onAfterRenderProduct:x,showPopupComponent:m,setShowPopupComponent:p,dataReviews:h,dataWishlists:g})=>{const{show_vendor:v=!0,show_sku:_=!0,show_price:R=!0,show_add_to_cart:j=!0,redirect_add_to_cart:E=!0,language_button_add_to_cart:w="Add To Cart",display_product_name_style:f={},display_price_style:S={},display_button_add_to_cart_style:C={}}=s||{},[T,A]=React.useState(null);return React.useEffect((()=>{x&&x("success")}),[]),vendor.jsxRuntimeExports.jsx("div",{className:`sledge__product-grid ${t}`,"data-grid-type":e,children:null==n?void 0:n.map(((e,t)=>{var n,s,x;const{product:L,variants:N}=e||{},{id:I,title:y,image:b,url:O,vendor:k="",currency:P}=L||{},{id:$="",title:W="",price:D="",sku:F=""}=(null==N?void 0:N.length)?N[0]:{};let B=T==$,U=!(!(null==N?void 0:N.length)||!Object.hasOwn(N[0],"inventory_quantity"))&&(!N[0].inventory_quantity&&o);const M=d?d({product:{...L,variants:N.map(((e,t)=>{const{inventory_quantity:n}=e||{};return{...e,is_out_of_stock:!!Object.hasOwn(N[t],"inventory_quantity")&&!n}})),...h&&Object.keys(h).length?{review:{total:(null==(n=null==h?void 0:h[I])?void 0:n.review_count)?null==h?void 0:h[I].review_count:0,average:(null==(x=null==(s=null==h?void 0:h[I])?void 0:s.rating)?void 0:x.average)?null==h?void 0:h[I].rating.average:0}}:{}},showPopupComponent:m,setShowPopupComponent:p}):null;return d?vendor.jsxRuntimeExports.jsx(React.Fragment,{children:l?vendor.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:M}}):M},t):vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card",children:[vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-content",children:[vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-image",children:[vendor.jsxRuntimeExports.jsxs("a",{href:O,onClick:()=>"instant-search"===i&&productClickTrigger({productId:I}),children:[vendor.jsxRuntimeExports.jsx(Trigger,{params:{productId:I,productVariantId:$,productName:y,productVendor:k,productSku:F,productVariantName:W,productLink:O,productImage:(null==b?void 0:b.src)||`${API_URL}/img/blank-image.png`,productCurrency:P,productPrice:D},...r,onAfterAddWishlist:c,onAfterRemoveWishlist:u,wishlistChecked:null==g?void 0:g[I]}),vendor.jsxRuntimeExports.jsx("img",{src:(null==b?void 0:b.src)||`${API_URL}/img/blank-image.png`,alt:"sledge-card-image",loading:"lazy"})]}),U?vendor.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-out-of-stock",children:"Sold out"}):null]}),vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-desc",children:[vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-title",children:[R?vendor.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-price",children:vendor.jsxRuntimeExports.jsxs("p",{style:S,children:[P,D]})}):null,v?vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-badge-vendor",children:["Vendor: ",(null==k?void 0:k.length)>5?`${String(k).substring(0,5)}...`:k]}):null]}),vendor.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-rating",children:vendor.jsxRuntimeExports.jsx(Rating,{params:{productId:I},size:"xs",withSkeletonLoading:!1,isScrollToElementWidget:!1,data:null==h?void 0:h[I]})}),y?vendor.jsxRuntimeExports.jsx("a",{href:O,onClick:()=>"instant-search"===i&&productClickTrigger({productId:I}),children:vendor.jsxRuntimeExports.jsx("h3",{className:"sledge__product-grid-card-product-name",style:f,children:y})}):null,vendor.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-text",children:_?vendor.jsxRuntimeExports.jsxs("div",{children:["SKU: ",F]}):null})]})]}),j?vendor.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-button-wrapper",children:vendor.jsxRuntimeExports.jsx(Button,{type:"button",colorType:"light",style:{...C,...B&&{cursor:"wait"}},...B||U?{disabled:!0}:{onClick:()=>(async e=>{var t;const{id:n,quantity:s}=e;A(n);let o=await addToCart([{id:n,quantity:s}]);(null==(t=null==o?void 0:o.items)?void 0:t.length)?("wishlist"===i?await addToCartTrigger$1({productId:n}):"instant-search"===i&&await addToCartTrigger({productId:n}),A(null),a&&a("success"),E?window.location.href="/cart":window.sledgeToastNotification({title:"Cart added",message:"Successfully added to wishlist",type:"success",icon:vendor.jsxRuntimeExports.jsx(BagIcon,{width:40,height:40,color:"black"})})):(a&&a("failed"),setTimeout((()=>{var e;A(null),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:(null==(e=null==o?void 0:o.description)?void 0:e.length)?o.description:"failed add to cart, please try again",type:"failed",icon:vendor.jsxRuntimeExports.jsx(BagIcon,{width:40,height:40,color:"black"})})}),1e3))})({id:$,quantity:1})},children:B?"Adding...":U?"Sold out":vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:[vendor.jsxRuntimeExports.jsx(BagIcon,{width:15,height:15,color:"#393D4E"}),vendor.jsxRuntimeExports.jsx("span",{children:w||"Add To Cart"})]})})}):null]},t)}))})},TextAreaField="",InputField="",CollectionGrid$1="",CollectionGrid=({className:e="",data:t,cards:n,isComponentJsVersion:s,onAfterRenderCollection:o})=>(React.useEffect((()=>{o&&o("success")}),[]),vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:(null==t?void 0:t.length)?vendor.jsxRuntimeExports.jsx("div",{className:`sledge__collection-grid ${e}`,children:t.map(((e,t)=>{const{id:o,title:r,body_html:i,url:l,image:d}=e,a=n?n({data:e}):null;return n?vendor.jsxRuntimeExports.jsx(React.Fragment,{children:s?vendor.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:a}}):a},t):vendor.jsxRuntimeExports.jsx("a",{href:l,children:vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card",children:[vendor.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-image-wrapper",children:vendor.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-image",children:vendor.jsxRuntimeExports.jsx("img",{src:(null==d?void 0:d.src)||`${API_URL}/img/blank-image.png`,alt:"sledge-card-image",loading:"lazy"})})}),vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-content",children:[vendor.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-title",children:r}),i?vendor.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-description",dangerouslySetInnerHTML:{__html:i}}):null]})]})},t)}))}):null})),PageGrid$1="",PageGrid=({className:e="",data:t,cards:n,isComponentJsVersion:s,onAfterRenderPage:o})=>(React.useEffect((()=>{o&&o("success")}),[]),vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:(null==t?void 0:t.length)?vendor.jsxRuntimeExports.jsx("div",{className:`sledge__page-grid ${e}`,children:t.map(((e,t)=>{const{id:o,title:r,body_html:i,url:l,image:d}=e,a=n?n({data:e}):null;return n?vendor.jsxRuntimeExports.jsx(React.Fragment,{children:s?vendor.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:a}}):a},t):vendor.jsxRuntimeExports.jsx("a",{href:l,children:vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card",children:[vendor.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-image-wrapper",children:vendor.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-image",children:vendor.jsxRuntimeExports.jsx("img",{src:(null==d?void 0:d.src)||`${API_URL}/img/blank-image.png`,alt:"sledge-card-image",loading:"lazy"})})}),vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card-content",children:[vendor.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-title",children:r}),i?vendor.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-description",dangerouslySetInnerHTML:{__html:i}}):null]})]})},t)}))}):null})),BlogGrid$1="",BlogGrid=({className:e="",data:t,cards:n,isComponentJsVersion:s,onAfterRenderBlog:o})=>(React.useEffect((()=>{o&&o("success")}),[]),vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:(null==t?void 0:t.length)?vendor.jsxRuntimeExports.jsx("div",{className:`sledge__blog-grid ${e}`,children:null==t?void 0:t.map(((e,t)=>{const{id:o,title:r,created_at:i,url:l,image:d}=e,a=n?n({data:e}):null;return n?vendor.jsxRuntimeExports.jsx(React.Fragment,{children:s?vendor.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:a}}):a},t):vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card",children:[vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-content",children:[vendor.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-image",children:vendor.jsxRuntimeExports.jsx("a",{href:l,children:vendor.jsxRuntimeExports.jsx("img",{src:(null==d?void 0:d.src)||`${API_URL}/img/blank-image.png`,alt:"sledge-card-image",loading:"lazy"})})}),vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card-desc",children:[vendor.jsxRuntimeExports.jsx("a",{href:l,children:vendor.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-title",children:r})}),i?vendor.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-badge-vendor",children:convertDate(i)}):null]})]}),vendor.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-button-wrapper",children:vendor.jsxRuntimeExports.jsx("a",{href:l,children:vendor.jsxRuntimeExports.jsxs(Button,{type:"button",colorType:"light",children:[vendor.jsxRuntimeExports.jsx(NoteIcon,{width:16,height:16,color:"#000000"}),vendor.jsxRuntimeExports.jsx("span",{children:"View Blog"})]})})})]},t)}))}):null})),ArticleGrid$1="",ArticleGrid=({className:e="",data:t,cards:n,isComponentJsVersion:s,onAfterRenderArticle:o})=>(React.useEffect((()=>{o&&o("success")}),[]),vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:(null==t?void 0:t.length)?vendor.jsxRuntimeExports.jsx("div",{className:`sledge__article-grid ${e}`,children:null==t?void 0:t.map(((e,t)=>{const{id:o,title:r,created_at:i,summary_html:l,url:d,image:a}=e,c=n?n({data:e}):null;return n?vendor.jsxRuntimeExports.jsx(React.Fragment,{children:s?vendor.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:c}}):c},t):vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-card",children:[vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-content",children:[vendor.jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-card-image",children:vendor.jsxRuntimeExports.jsx("a",{href:d,children:vendor.jsxRuntimeExports.jsx("img",{src:(null==a?void 0:a.src)||`${API_URL}/img/blank-image.png`,alt:"sledge-card-image",loading:"lazy"})})}),vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-card-desc",children:[vendor.jsxRuntimeExports.jsx("a",{href:d,children:vendor.jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-card-title",children:r})}),i?vendor.jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-badge-vendor",children:convertDate(i)}):null,l?vendor.jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-card-text",dangerouslySetInnerHTML:{__html:l}}):null]})]}),vendor.jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-button-wrapper",children:vendor.jsxRuntimeExports.jsx("a",{href:d,children:vendor.jsxRuntimeExports.jsxs(Button,{type:"button",colorType:"light",children:[vendor.jsxRuntimeExports.jsx(NoteIcon,{width:16,height:16,color:"#000000"}),vendor.jsxRuntimeExports.jsx("span",{children:"View Article"})]})})})]},t)}))}):null})),Tooltip$1="",Tooltip=({children:e,content:t,withArrow:n=!0,customArrow:s="",sideOffset:o=5,alignOffset:r=0,wrapTrigger:i=!0})=>{const[l,d]=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==s?void 0:s.length)&&(t.classList.add("sledge__tooltip-arrow-parent"),t.innerHTML=s)}),[l]),vendor.jsxRuntimeExports.jsx(vendor.$a093c7e1ec25a057$export$2881499e37b75b9a,{delayDuration:0,children:vendor.jsxRuntimeExports.jsxs(vendor.$a093c7e1ec25a057$export$be92b6f5f03c0fe9,{onOpenChange:d,children:[vendor.jsxRuntimeExports.jsx(vendor.$a093c7e1ec25a057$export$41fb9f06171c75f4,{asChild:!0,children:i?vendor.jsxRuntimeExports.jsx("span",{children:e}):e}),vendor.jsxRuntimeExports.jsx(vendor.$a093c7e1ec25a057$export$602eac185826482c,{children:vendor.jsxRuntimeExports.jsxs(vendor.$a093c7e1ec25a057$export$7c6e2c02157bb7d2,{className:"sledge__tooltip-content",sideOffset:o,alignOffset:r,children:[t,n?vendor.jsxRuntimeExports.jsx(vendor.$a093c7e1ec25a057$export$21b07c8f274aebd5,{className:"sledge__tooltip-arrow"}):null]})})]})})},ScrollArea$1="",ScrollArea=({children:e,isLoading:t=!1,className:n=""})=>vendor.jsxRuntimeExports.jsxs(vendor.$57acba87d6e25586$export$be92b6f5f03c0fe9,{className:`sledge__scroll-area-root ${n}`,children:[vendor.jsxRuntimeExports.jsx(vendor.$57acba87d6e25586$export$d5c6c08dc2d3ca7,{className:"sledge__scroll-area-viewport "+(t?"sledge__scroll-area-viewport-loading":""),children:e}),!t&&vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:[vendor.jsxRuntimeExports.jsx(vendor.$57acba87d6e25586$export$9a4e88b92edfce6b,{className:"sledge__scroll-area-scrollbar",orientation:"vertical",children:vendor.jsxRuntimeExports.jsx(vendor.$57acba87d6e25586$export$6521433ed15a34db,{className:"sledge__scroll-area-thumb"})}),vendor.jsxRuntimeExports.jsx(vendor.$57acba87d6e25586$export$9a4e88b92edfce6b,{className:"sledge__scroll-area-scrollbar",orientation:"horizontal",children:vendor.jsxRuntimeExports.jsx(vendor.$57acba87d6e25586$export$6521433ed15a34db,{className:"sledge__scroll-area-thumb"})})]})]}),SkeletonLoading$1="",SkeletonItem=({width:e,height:t,rounded:n,color:s,style:o={},className:r="",...i})=>{var l,d,a,c,u;const[x,m]=React.useState({});return React.useEffect((()=>{(async e=>{let t;t=JSON.parse(e),t&&m(t)})(localStorage.getItem(LOCAL_STORAGE_KEY.GENERAL_SETTING)||null)}),[]),vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:(null==(l=null==x?void 0:x.skeleton)?void 0:l.enable)?vendor.jsxRuntimeExports.jsx("div",{className:`sledge__skeleton-item sledge__skeleton-item-animation ${r}`,style:{width:e,height:t,...(null==(a=null==(d=null==x?void 0:x.skeleton)?void 0:d.colors)?void 0:a.main_color)&&{background:null==(u=null==(c=null==x?void 0:x.skeleton)?void 0:c.colors)?void 0:u.main_color},...o},"data-skeleton-rounded":n,"data-skeleton-color":s,...i}):null})},SkeletonProductGrid=({count:e,type:t})=>{let n=[];for(let s=0;s<e;s++)n.push(vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card",children:[vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-content",children:[vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-image sledge__skeleton-product-grid-card-image",children:[vendor.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__trigger-block",children:vendor.jsxRuntimeExports.jsx(SkeletonItem,{width:"32px",height:"32px",color:"darken",rounded:"sm"})}),vendor.jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"100%",color:"lighten",rounded:"md",style:{borderBottomLeftRadius:0,borderBottomRightRadius:0}})]}),vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-desc",children:[vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-title",children:[vendor.jsxRuntimeExports.jsx(SkeletonItem,{width:"79px",height:"28px",color:"lighten",rounded:"md"}),vendor.jsxRuntimeExports.jsx(SkeletonItem,{width:"80px",height:"28px",color:"lighten",rounded:"md"})]}),vendor.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-rating",children:vendor.jsxRuntimeExports.jsx(SkeletonItem,{width:"134px",height:"25px",color:"lighten",rounded:"md"})}),vendor.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-text",children:vendor.jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"35px",color:"lighten",rounded:"md",style:{marginBottom:"16px"}})})]})]}),vendor.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-button-wrapper",children:vendor.jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"lighten",rounded:"md"})})]},s));return vendor.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid sledge__skeleton-product-grid sledge__skeleton-pointer-events-none","data-grid-type":t,children:n})},SkeletonReviewGrid=({count:e,type:t,gridItemHeights:n=[]})=>{let s=[];for(let o=0;o<e;o++)s.push(vendor.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card",children:vendor.jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"list"===t||"grid"===t&&!(null==n?void 0:n.length)?"111px":n[o],color:"lighten",rounded:"md"})},o));return vendor.jsxRuntimeExports.jsx(vendor.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:vendor.jsxRuntimeExports.jsx(vendor.Masonry,{gutter:"30px",children:s})})},SkeletonCollectionGrid=({count:e})=>{let t=[];for(let n=0;n<e;n++)t.push(vendor.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card",children:vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-content",children:[vendor.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-title",children:vendor.jsxRuntimeExports.jsx(SkeletonItem,{width:"139px",height:"32px",color:"darken",rounded:"md"})}),vendor.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-description",children:vendor.jsxRuntimeExports.jsx(SkeletonItem,{width:"238px",height:"48px",color:"darken",rounded:"md"})})]})},n));return vendor.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 n=0;n<e;n++)t.push(vendor.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card",children:vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card-content",children:[vendor.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-title",children:vendor.jsxRuntimeExports.jsx(SkeletonItem,{width:"139px",height:"32px",color:"darken",rounded:"md"})}),vendor.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-description",children:vendor.jsxRuntimeExports.jsx(SkeletonItem,{width:"238px",height:"48px",color:"darken",rounded:"md"})})]})},n));return vendor.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 n=0;n<e;n++)t.push(vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card",children:[vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-content",children:[vendor.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-image sledge__skeleton-blog-grid-card-image",children:vendor.jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"100%",color:"lighten",rounded:"md",style:{borderBottomLeftRadius:0,borderBottomRightRadius:0}})}),vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card-desc",children:[vendor.jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"lighten",rounded:"md"}),vendor.jsxRuntimeExports.jsx(SkeletonItem,{width:"79px",height:"26px",color:"lighten",rounded:"md",style:{marginTop:"12px",marginBottom:"16px"}}),vendor.jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"72px",color:"lighten",rounded:"md"})]})]}),vendor.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-button-wrapper",children:vendor.jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"lighten",rounded:"md"})})]},n));return vendor.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid sledge__skeleton-blog-grid sledge__skeleton-pointer-events-none",children:t})},SkeletonArticleGrid=({count:e})=>{let t=[];for(let n=0;n<e;n++)t.push(vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-card",children:[vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-content",children:[vendor.jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-card-image sledge__skeleton-article-grid-card-image",children:vendor.jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"100%",color:"lighten",rounded:"md",style:{borderBottomLeftRadius:0,borderBottomRightRadius:0}})}),vendor.jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-card-desc",children:[vendor.jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"lighten",rounded:"md"}),vendor.jsxRuntimeExports.jsx(SkeletonItem,{width:"79px",height:"26px",color:"lighten",rounded:"md",style:{marginTop:"12px",marginBottom:"16px"}}),vendor.jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"72px",color:"lighten",rounded:"md"})]})]}),vendor.jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-button-wrapper",children:vendor.jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"lighten",rounded:"md"})})]},n));return vendor.jsxRuntimeExports.jsx("div",{className:"sledge__article-grid sledge__skeleton-article-grid sledge__skeleton-pointer-events-none",children:t})},SkeletonLoading={Item:SkeletonItem,ReviewGrid:SkeletonReviewGrid,ProductGrid:SkeletonProductGrid,CollectionGrid:SkeletonCollectionGrid,PageGrid:SkeletonPageGrid,BlogGrid:SkeletonBlogGrid,ArticleGrid:SkeletonArticleGrid},SearchIconWidget=e=>{const{isRenderApp:t,isJsVersion:n}=React.useContext(core.SledgeContext),{instantSearch:s}=t||{},{size:o="sm",children:r,onAfterAddToCart:i,onAfterAddWishlist:l,onAfterRemoveWishlist:d,onAfterRenderProduct:a}=e||{};let c=null,u=null,x=null,m=null;React.Children.map(r,(e=>{if(React.isValidElement(e)&&isFunction(e.type)){const{productCard:t,suggestionKeywordList:n,otherIndexList:s,searchViewMoreResult:o}=(null==e?void 0:e.props)||{};t&&isFunction(t)&&(c=t),n&&isFunction(n)&&(u=n),s&&isFunction(s)&&(x=s),o&&isFunction(o)&&(m=o)}}));const[p,h]=React.useState({width:0,height:0});React.useEffect((()=>{s&&h("xs"===o?{width:14,height:14}:"sm"===o?{width:20,height:20}:{width:25,height:25})}),[s]);return vendor.jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__icon-widget",onClick:()=>{"undefined"!=typeof window&&window.sledgeInstantSearchIconWidgetPopup&&window.sledgeInstantSearchIconWidgetPopup({onAfterAddToCart:i,onAfterAddWishlist:l,onAfterRemoveWishlist:d,onAfterRenderProduct:a,isJsVersion:n,productCardsComponent:c,suggestionKeywordListsComponent:u,otherIndexListsComponent:x,searchViewMoreResultComponent:m})},children:vendor.jsxRuntimeExports.jsx(SearchIcon,{...p,color:"currentColor"})})},OtherIndexLists=({listsComponent:e,name:t,items:n,isComponentJsVersion:s,showPopupComponent:o,setShowPopupComponent:r})=>{const i=e?e({name:t,items:n,showPopupComponent:o,setShowPopupComponent:r}):null;return e?s?vendor.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:i}}):i:vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:[vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-title",children:t}),(null==n?void 0:n.length)?vendor.jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__icon-widget-search-form-result-list",children:n.map(((e,t)=>{const{title:n,url:s}=e;return vendor.jsxRuntimeExports.jsx("li",{children:vendor.jsxRuntimeExports.jsx("a",{href:s,className:"sledge-instant-search__icon-widget-search-form-result-list-link",children:n})},t)}))}):vendor.jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__icon-widget-search-form-result-list",children:vendor.jsxRuntimeExports.jsxs("li",{className:"sledge-instant-search__icon-widget-search-form-result-item-disabled",children:["No ",null==t?void 0:t.toLowerCase()," were found"]})})]})},SuggestionKeywordLists=({listsComponent:e,keywords:t,isComponentJsVersion:n=!1,showPopupComponent:s,setShowPopupComponent:o})=>{const r=e?e({keywords:t,showPopupComponent:s,setShowPopupComponent:o}):null;return e?n?vendor.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:r}}):r:vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:[vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-title",children:"Suggestions"}),vendor.jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__icon-widget-search-form-result-list",children:null==t?void 0:t.map(((e,t)=>vendor.jsxRuntimeExports.jsx("li",{children:vendor.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:[vendor.jsxRuntimeExports.jsx(SearchIcon,{width:12,height:12,color:"#677487"})," ",e]})},t)))})]})},SearchViewMoreResult=({component:e,keyword:t,isComponentJsVersion:n=!1,showPopupComponent:s,setShowPopupComponent:o})=>{const r=e?e({keyword:t,showPopupComponent:s,setShowPopupComponent:o}):null;return e?n?vendor.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:r}}):r:vendor.jsxRuntimeExports.jsx("a",{href:`${SEARCH_RESULT_URL}?q=${t}`,className:"sledge-instant-search__icon-widget-button-more",children:"View More Result"})},Global={OtherIndexLists:OtherIndexLists,SuggestionKeywordLists:SuggestionKeywordLists,SearchViewMoreResult:SearchViewMoreResult},SearchIconWidgetPopup=()=>{var e,t,n,s,o,r,i,l,d,a,c,u,x,m,p,h,g,v,_,R,j,E;const{isRenderApp:w}=React.useContext(core.SledgeContext),{instantSearch:f}=w||{},[S,C]=React.useState(!0),[T,A]=React.useState(!1),[L,N]=React.useState(!1),[I,y]=React.useState(""),[b,O]=React.useState([]),[k,P]=React.useState([]),[$,W]=React.useState({}),[D,F]=React.useState({}),[B,U]=React.useState({}),[M,G]=React.useState(""),[H,V]=React.useState({onAfterAddToCart:e=>{},onAfterAddWishlist:e=>{},onAfterRemoveWishlist:e=>{},onAfterRenderProduct:e=>{},isJsVersion:null,productCardsComponent:null,suggestionKeywordListsComponent:null,otherIndexListsComponent:null,searchViewMoreResultComponent:null}),K=React.useRef(null),Y=usePrevious({keyword:I}),z=async e=>{var t,n,s,o,r,i,l,d,a,c,u,x;const{data:m,onSearch:p=!1,withFetchReviewInfo:h=!1}=e;C(!0);const{tabs:g,suffix_index_product:v,hidden_tags:_,display:R,show_out_of_stock:j}=m,E=(null==(t=null==R?void 0:R.search)?void 0:t.suggestion)||{};let w,f={queries:g.map((e=>{const{index:t}=e;let n=t.includes(v),s=[];return(null==_?void 0:_.length)&&s.push(`tags NOT IN [${_}]`),j||s.push("variants.inventory_quantity > 0"),{indexUid:t,q:I,hitsPerPage:n?6:4,filter:n?s.join(" AND "):""}}))};if(w=await multiSearch(f),!w)return;const{results:S}=w;let T=null==S?void 0:S.filter((({indexUid:e})=>null==e?void 0:e.includes(v)));p&&(null==I?void 0:I.length)&&searchTrigger({keyword:I,resultCount:(null==(n=T[0])?void 0:n.totalHits)||0});let L=(null==(s=null==S?void 0:S.filter((({indexUid:e})=>!(null==e?void 0:e.includes(v)))))?void 0:s.map((e=>{const{indexUid:t}=e,{name:n}=null==g?void 0:g.find((({index:e})=>e.includes(t)));return{...e,name:n||""}})))||[],N=(null==T?void 0:T.length)?null==(o=T[0])?void 0:o.hits:[],y=I.length?(null==N?void 0:N.length)?"":"no_result":"zero_character",b=Boolean(!I.length&&Object.keys(E).length&&(null==(i=null==(r=E[y])?void 0:r.products)?void 0:i.active)&&(null==(a=null==(d=null==(l=E[y])?void 0:l.products)?void 0:d.list)?void 0:a.length))?null==(u=null==(c=E[y])?void 0:c.products)?void 0:u.list:N;if(h){let e=b.map((({id:e})=>e)),t=await getProductsReviewInfo(e);200===(null==(x=null==t?void 0:t.status)?void 0:x.code)&&W(null==t?void 0:t.data)}else W({});O(b),P(L),G(y),C(!1),A(!0)};return React.useEffect((()=>{f&&("undefined"!=typeof window&&(window.sledgeInstantSearchIconWidgetPopup=({onAfterAddToCart:e=(()=>{}),onAfterAddWishlist:t=(()=>{}),onAfterRemoveWishlist:n=(()=>{}),onAfterRenderProduct:s=(()=>{}),isJsVersion:o=null,productCardsComponent:r=(()=>{}),suggestionKeywordListsComponent:i=(()=>{}),otherIndexListsComponent:l=(()=>{}),searchViewMoreResultComponent:d=(()=>{})})=>{N(!0),V({onAfterAddToCart:e,onAfterAddWishlist:t,onAfterRemoveWishlist:n,onAfterRenderProduct:s,isJsVersion:o,productCardsComponent:r,suggestionKeywordListsComponent:i,otherIndexListsComponent:l,searchViewMoreResultComponent:d})}),(async e=>{var t;let n;if(n=JSON.parse(e),!n)return;const{display:s}=n;F(s),U(null==(t=null==s?void 0:s.search)?void 0:t.suggestion),await z({data:n,withFetchReviewInfo:!0})})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||null))}),[f]),React.useEffect((()=>{T&&SearchIconWidgetInitSelector()}),[T]),React.useEffect((()=>{L?document.body.classList.add("sledge__open-popup-state"):document.body.classList.remove("sledge__open-popup-state")}),[L]),React.useEffect((()=>{if(Boolean(Y&&(null==Y?void 0:Y.keyword)!==I)){const e=JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||""),t=setTimeout((()=>{e&&z({data:e,onSearch:!0})}),500);return()=>clearTimeout(t)}}),[I]),vendor.jsxRuntimeExports.jsx(vendor.$5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:L,onOpenChange:N,children:vendor.jsxRuntimeExports.jsxs(vendor.$5d3850c4d0b4e6c7$export$602eac185826482c,{children:[vendor.jsxRuntimeExports.jsx(vendor.$5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__popup-overlay"}),vendor.jsxRuntimeExports.jsx(vendor.$5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__popup-overlay-blur"}),vendor.jsxRuntimeExports.jsxs(vendor.$5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,{className:"sledge-instant-search__icon-widget-popup-detail-content","data-layout-type":(null==(e=null==D?void 0:D.search)?void 0:e.layout)||"",children:[vendor.jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:vendor.jsxRuntimeExports.jsx(SearchIcon,{width:20,height:20,color:"#000000"}),placeholder:"Search anything...",value:I,fieldRef:K,onChange:({value:e})=>y(e),className:"sledge-instant-search__icon-widget-search-form-field",withClearField:!0}),vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result",children:S?vendor.jsxRuntimeExports.jsx(ScrollArea,{children:vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-wrapper",children:vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex",children:[vendor.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=>vendor.jsxRuntimeExports.jsxs(React.Fragment,{children:[vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"42px",color:"lighten",rounded:"md",...Boolean(e)&&{style:{marginTop:"12px"}}}),vendor.jsxRuntimeExports.jsx("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",gap:"12px",marginTop:"12px"},children:[1,2,3].map((e=>vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"140px"}},e)))})]},e)))}),vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-product",children:vendor.jsxRuntimeExports.jsx(SkeletonLoading.ProductGrid,{count:6,type:"medium"})})]})})}):vendor.jsxRuntimeExports.jsx(ScrollArea,{children:vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-wrapper",children:vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex",children:[vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-other",children:[Object.keys(B).length&&(null==(n=null==(t=B[M])?void 0:t.keywords)?void 0:n.active)&&(null==(r=null==(o=null==(s=B[M])?void 0:s.keywords)?void 0:o.list)?void 0:r.length)?vendor.jsxRuntimeExports.jsx(Global.SuggestionKeywordLists,{listsComponent:H.suggestionKeywordListsComponent,keywords:B[M].keywords.list,isComponentJsVersion:H.isJsVersion,showPopupComponent:L,setShowPopupComponent:N}):null,k&&k.map(((e,t)=>{const{hits:n,name:s}=e;return vendor.jsxRuntimeExports.jsx(React.Fragment,{children:vendor.jsxRuntimeExports.jsx(Global.OtherIndexLists,{listsComponent:H.otherIndexListsComponent,name:s,items:n,isComponentJsVersion:H.isJsVersion,showPopupComponent:L,setShowPopupComponent:N})},t)}))]}),vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-product",children:[(null==b?void 0:b.length)?vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-product",children:vendor.jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"medium",data:b.map((e=>{const{variants:t,...n}=e||{};return{product:n,variants:t}})),setting:{show_vendor:null==(i=null==D?void 0:D.search)?void 0:i.show_vendor,show_sku:null==(l=null==D?void 0:D.search)?void 0:l.show_sku,show_price:null==(d=null==D?void 0:D.search)?void 0:d.show_price},showOptionOutOfStock:!0,isComponentJsVersion:H.isJsVersion,cards:H.productCardsComponent,onAfterAddToCart:H.onAfterAddToCart,onAfterAddWishlist:H.onAfterAddWishlist,onAfterRemoveWishlist:H.onAfterRemoveWishlist,onAfterRenderProduct:H.onAfterRenderProduct,showPopupComponent:L,setShowPopupComponent:N,dataReviews:$})}):Object.keys(B).length&&(null==(c=null==(a=B[M])?void 0:a.products)?void 0:c.active)&&(null==(m=null==(x=null==(u=B[M])?void 0:u.products)?void 0:x.list)?void 0:m.length)?vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:[vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-product-suggestion-no-result-text",children:[vendor.jsxRuntimeExports.jsx("span",{children:"Sorry"}),", nothing found for ",vendor.jsxRuntimeExports.jsx("span",{children:I}),". Did you mean:"]}),vendor.jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"medium",data:B[M].products.list.map((e=>{const{variants:t,...n}=e||{};return{product:n,variants:t}})),setting:{show_vendor:null==(p=null==D?void 0:D.search)?void 0:p.show_vendor,show_sku:null==(h=null==D?void 0:D.search)?void 0:h.show_sku,show_price:null==(g=null==D?void 0:D.search)?void 0:g.show_price},showOptionOutOfStock:!0,isComponentJsVersion:H.isJsVersion,cards:H.productCardsComponent,onAfterAddToCart:H.onAfterAddToCart,onAfterAddWishlist:H.onAfterAddWishlist,onAfterRemoveWishlist:H.onAfterRemoveWishlist,onAfterRenderProduct:H.onAfterRenderProduct,showPopupComponent:L,setShowPopupComponent:N})]}):vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:[vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-title",children:"Products"}),vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-item-disabled",children:"No product were found"})]}),(null==b?void 0:b.length)||Object.keys(B).length&&(null==(_=null==(v=B[M])?void 0:v.products)?void 0:_.active)&&(null==(E=null==(j=null==(R=B[M])?void 0:R.products)?void 0:j.list)?void 0:E.length)?vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-button-more-wrapper",children:vendor.jsxRuntimeExports.jsx(Global.SearchViewMoreResult,{component:H.searchViewMoreResultComponent,keyword:I,isComponentJsVersion:H.isJsVersion,showPopupComponent:L,setShowPopupComponent:N})}):null]})]})})})})]})]})})},SearchIconWidgetInitSelector=()=>{let element=Array.from(document.querySelectorAll(SELECTOR.INSTANT_SEARCH.ELEMENT_SEARCH_ICON_WIDGET));detectInitSelector({element:element,init:()=>{element.length&&element.map((item=>{var _a,_b,_c,_d;if(item){const ICON_SIZE=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ICON_SIZE),ON_AFTER_ADD_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST),ON_AFTER_RENDER_PRODUCT=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_RENDER_PRODUCT),PRODUCT_CARDS=null==(_a=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_PRODUCT_CARD),SUGGESTION_KEYWORD_LISTS=null==(_b=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_b.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_SUGGESTION_KEYWORD_LIST),OTHER_INDEX_LISTS=null==(_c=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_c.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_OTHER_INDEX_LIST),SEARCH_VIEW_MORE_RESULT=null==(_d=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_d.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_SEARCH_VIEW_MORE_RESULT);item.innerHTML="",vendor.client.createRoot(item).render(vendor.jsxRuntimeExports.jsx(React.StrictMode,{children:vendor.jsxRuntimeExports.jsx(core.SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:vendor.jsxRuntimeExports.jsx(SearchIconWidget,{size:ICON_SIZE||"sm",onAfterAddWishlist:state=>{item&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({state:state})},onAfterRenderProduct:state=>{item&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({state:state})},children:vendor.jsxRuntimeExports.jsx(core.CustomComponents,{suggestionKeywordList:SUGGESTION_KEYWORD_LISTS?eval(SUGGESTION_KEYWORD_LISTS):null,otherIndexList:OTHER_INDEX_LISTS?eval(OTHER_INDEX_LISTS):null,productCard:PRODUCT_CARDS?eval(PRODUCT_CARDS):null,searchViewMoreResult:SEARCH_VIEW_MORE_RESULT?eval(SEARCH_VIEW_MORE_RESULT):null})})})}))}}))}})},SearchResultWidget=e=>{var t,n,s,o,r,i,l,d,a,c,u,x,m,p,h,g,v,_,R;const{isRenderApp:j,isJsVersion:E}=React.useContext(core.SledgeContext),{instantSearch:w}=j||{},{layoutType:f="default",query:S,params:C,children:T,onAfterAddToCart:A,onAfterAddWishlist:L,onAfterRemoveWishlist:N,onAfterRenderProduct:I,onAfterRenderCollection:y,onAfterRenderPage:b,onAfterRenderBlog:O,onAfterRenderArticle:k,data:P,sledgeSettings:$}=e,{keyword:W=""}=S||{},{collectionId:D}=C||{};let F=null,B=null,U=null,M=null,G=null;React.Children.map(T,(e=>{if(React.isValidElement(e)&&isFunction(e.type)){const{productCard:t,collectionCard:n,pageCard:s,blogCard:o,articleCard:r}=(null==e?void 0:e.props)||{};t&&isFunction(t)&&(F=t),n&&isFunction(n)&&(B=n),s&&isFunction(s)&&(U=s),o&&isFunction(o)&&(M=o),r&&isFunction(r)&&(G=r)}}));const H="undefined"!=typeof document?new URLSearchParams(null==(t=null==document?void 0:document.location)?void 0:t.search):null,[V]=React.useState("undefined"!=typeof localStorage?JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||"{}"):{}),[K,Y]=React.useState(!P),[z,q]=React.useState(!P),[J,Z]=React.useState(null==H?void 0:H.get(W)),[X,Q]=React.useState(null),[ee,te]=React.useState(),[ne,se]=React.useState(vendor.jsxRuntimeExports.jsx(ResultProduct,{})),[oe,re]=React.useState(!P),[ie,le]=React.useState((null==(n=null==$?void 0:$.instantsearch)?void 0:n.allowed_sorts)||[]),[de,ae]=React.useState((null==(s=null==$?void 0:$.instantsearch)?void 0:s.filters)||[]),[ce,ue]=React.useState([]),[xe,me]=React.useState([]),[pe,he]=React.useState((null==(o=null==$?void 0:$.instantsearch)?void 0:o.suffix_index_product)||""),[ge,ve]=React.useState({}),[_e,Re]=React.useState((null==(r=null==$?void 0:$.instantsearch)?void 0:r.hidden_tags)||[]),[je,Ee]=React.useState((null==(i=null==$?void 0:$.instantsearch)?void 0:i.display)||{}),[we,fe]=React.useState((null==(l=null==$?void 0:$.instantsearch)?void 0:l.colors)||[]),[Se,Ce]=React.useState((null==(d=null==$?void 0:$.instantsearch)?void 0:d.default_sort)||""),[Te,Ae]=React.useState(null==(a=null==$?void 0:$.instantsearch)?void 0:a.show_out_of_stock),[Le,Ne]=React.useState(!0),Ie=React.useRef(null),ye=usePrevious({keyword:J}),be=async(e,t)=>{const{filters:n,tabs:s,suffix_index_product:o,hidden_tags:r,show_out_of_stock:i}=e;let l,d={queries:("product-filter"===f?s.filter((({index:e})=>null==e?void 0:e.includes(o))):s).map((e=>{const{index:s}=e;let l=!1,d=l?[]:null==n?void 0:n.map((e=>{const{collections:t,items:n}=e;return D&&(null==t?void 0:t.includes(Number(D)))||(null==t?void 0:t.includes("all"))?(l=!0,null==n?void 0:n.map((({value:e})=>e))):void 0})),a=s.includes(o),c=a&&d.length,u=[];return(null==r?void 0:r.length)&&u.push(`tags NOT IN [${r}]`),i||u.push("variants.inventory_quantity > 0"),D&&u.push(`collections.id = '${D}'`),c&&me(d[0]),{indexUid:s,q:"default"===t?"":J,hitsPerPage:1,facets:c?d[0]:[],filter:a?u.join(" AND "):""}}))};if(P&&Le?(l=P.result,Ne(!1)):l=await multiSearch(d),!l)return;const{results:a}=l;if(Y(!1),re(!1),q(!1),"totalDataPerIndex"===t)ue(null==s?void 0:s.map((e=>{const{index:t}=e,{totalHits:n}=(null==a?void 0:a.find((({indexUid:e})=>e===t)))||{};return{...e,total:n}})));else{const{facetDistribution:e,facetStats:t}=(null==a?void 0:a.find((({indexUid:e})=>e.includes(o))))||{};ve(e?Object.fromEntries(Object.entries(e).map((n=>{let s=n[0],o=[];return"variants.inventory_quantity"===s?(Object.keys(e[s]).map((t=>Boolean(Number(t))?e[s][t]:0)),o=[{name:"In Stock",value:"> 0"}]):o="variants.price"===s?t[s]:Object.keys(e[s]).map((t=>({name:t,value:t,total:e[s][t]||0}))),[s,o]}))):{})}};React.useEffect((()=>{if(!w)return;const e=new URLSearchParams(document.location.search);Z((null==e?void 0:e.get(W))||""),(async e=>{let t,n;if(re(!0),t=JSON.parse(e),!t)return;const{allowed_sorts:s,default_sort:o,filters:r,tabs:i,suffix_index_product:l,hidden_tags:d,display:a,colors:c,show_out_of_stock:u}=t;le((null==s?void 0:s.length)?s:[]),ae((null==r?void 0:r.length)?r:[]),he(l),Re(d),Ee(a),fe(c),Ce(o),Ae(u),n=i.find((({index:e})=>e.includes(l))),Object.keys(n).length&&(Q(n.index),te(n.name)),await be(t,"default"),"default"===f&&await be(t,"totalDataPerIndex")})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||null)}),[w]),React.useEffect((()=>{if(Boolean(ye&&(null==ye?void 0:ye.keyword)!==J)&&"default"===f){const e=JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||""),t=setTimeout((()=>{e&&be(e,"totalDataPerIndex")}),500);return()=>clearTimeout(t)}}),[J]);const Oe="default"===f?vendor.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=>vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"122px",height:"28px",rounded:"md",color:"lighten"},e)))}):null,ke=(null==(c=null==je?void 0:je.filter)?void 0:c.enable_on_search)&&"horizontal"===(null==(u=null==je?void 0:je.filter)?void 0:u.layout)?vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-skeleton",children:[1,2,3,4,5,6,7].map((e=>vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"106px",height:"42px",rounded:"md",color:"lighten"},e)))}):null,Pe=(null==(x=null==je?void 0:je.filter)?void 0:x.enable_on_search)&&"vertical"===(null==(m=null==je?void 0:je.filter)?void 0:m.layout)?vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:[vendor.jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px",justifyContent:"space-between",marginBottom:"23px"},children:[vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"117px",height:"28px",color:"lighten",rounded:"md"}),vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"80px",height:"28px",color:"lighten",rounded:"md"})]}),vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"18px"}}),[1,2,3].map((e=>vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}},e))),vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"18px"}}),vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"14px"}}),vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}}),vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"17px"}}),vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"38px"}}),vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"35px"}}),vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"12px"}}),vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}}),vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"20px"}}),vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"12px"}}),[1,2,3].map((e=>vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}},e))),vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"11px"}}),vendor.jsxRuntimeExports.jsx("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"12px"},children:[1,2,3,4,5,6,7,8,9].map((e=>vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"34px",height:"34px",color:"lighten",rounded:"full"},e)))})]}):null,$e=vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:[(null==(p=null==je?void 0:je.filter)?void 0:p.show_total_products)&&"vertical"===(null==(h=null==je?void 0:je.filter)?void 0:h.layout)?vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"117px",height:"28px",color:"lighten",rounded:"md",style:{marginBottom:"21px"}}):null,vendor.jsxRuntimeExports.jsx(SkeletonLoading.ProductGrid,{count:12,type:"large"})]}),We=vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-keyword",children:[(null==(g=null==je?void 0:je.filter)?void 0:g.show_total_products)&&"horizontal"===(null==(v=null==je?void 0:je.filter)?void 0:v.layout)?vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-horizontal",children:vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"117px",height:"28px",color:"lighten",rounded:"md"})}):null,vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-keyword-form",children:vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"42px",color:"lighten",rounded:"lg",style:{maxWidth:"630px"}})}),vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-item sledge-instant-search__result-data-summary-select-field",children:[vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"150px",height:"42px",color:"lighten",rounded:"lg"})}),vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"150px",height:"42px",color:"lighten",rounded:"lg"})})]})]});return vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-container",ref:Ie,children:[K?null:vendor.jsxRuntimeExports.jsx("div",{className:""+("default"===f&&(null==ce?void 0:ce.length)?"sledge-instant-search__result-tab":"sledge-instant-search__result-tab-no-index"),children:"default"===f&&(null==ce?void 0:ce.length)?vendor.jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__result-tab-list",children:ce.map((e=>{const{name:t,index:n,total:s}=e;let o=X===n;return vendor.jsxRuntimeExports.jsxs("li",{onClick:e=>((e,t,n)=>{Q(e),te(t),se(e.includes(pe)?vendor.jsxRuntimeExports.jsx(ResultProduct,{}):vendor.jsxRuntimeExports.jsx(ResultCategory,{}))})(n,t),className:""+(o?"sledge-instant-search__result-tab-list-item-active":""),children:[t,vendor.jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-tab-total",children:s||0})]},n)}))}):null}),K&&(null==f?void 0:f.length)&&!P?vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:[Oe,ke,vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-wrapper sledge-instant-search__result-wrapper-skeleton",children:[(null==(_=null==je?void 0:je.filter)?void 0:_.enable_on_search)&&"vertical"===(null==(R=null==je?void 0:je.filter)?void 0:R.layout)?vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:Pe}):null,vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data",children:[We,$e]})]})]}):React.cloneElement(ne,{isLoading:z,keyword:J,clickedTabIndexId:X,clickedTabIndexName:ee,isLoadingSetting:oe,allowedSorts:ie,allowedFilters:de,facets:xe,searchResultFacets:ge,hiddenTags:_e,displaySettings:je,colorSwatches:we,defaultSort:Se,showOutOfStock:Te,query:S,params:C,isJsVersion:E,productCardsComponent:F,collectionCardsComponent:B,pageCardsComponent:U,blogCardsComponent:M,articleCardsComponent:G,onAfterAddToCart:A,onAfterAddWishlist:L,onAfterRemoveWishlist:N,onAfterRenderProduct:I,onAfterRenderCollection:y,onAfterRenderPage:b,onAfterRenderBlog:O,onAfterRenderArticle:k,setIsLoading:q,setKeyword:Z,filterHorizontalSkeleton:ke,filterVerticalSkeleton:Pe,productGridSkeleton:$e,searchAndSelectOptionSkeleton:We,searchResultContainerRef:Ie,data:P,settings:V})]})},ResultProduct=e=>{var t,n,s,o,r,i,l,d,a,c,u,x,m,p,h,g,v,_,R,j,E,w,f,S,C,T;const{keyword:A,clickedTabIndexId:L,isLoadingSetting:N,allowedSorts:I,allowedFilters:y,facets:b,searchResultFacets:O,hiddenTags:k,displaySettings:P,colorSwatches:$,defaultSort:W,showOutOfStock:D,query:F,params:B,isJsVersion:U,productCardsComponent:M,setKeyword:G,filterHorizontalSkeleton:H,filterVerticalSkeleton:V,productGridSkeleton:K,searchAndSelectOptionSkeleton:Y,onAfterAddToCart:z,onAfterAddWishlist:q,onAfterRemoveWishlist:J,onAfterRenderProduct:Z,searchResultContainerRef:X,data:Q,settings:ee}=e||{},{keyword:te=""}=F||{},{collectionId:ne}=B||{},[se,oe]=React.useState(!Q),[re,ie]=React.useState(!Q),[le,de]=React.useState(!1),[ae,ce]=React.useState(!1),[ue,xe]=React.useState(W||""),[me,pe]=React.useState(I&&Boolean(null==I?void 0:I.length)?null==(t=I.find((({value:e})=>e===W)))?void 0:t.label:""),[he,ge]=React.useState((null==(n=null==P?void 0:P.search)?void 0:n.limit)||10),[ve,_e]=React.useState(null),[Re,je]=React.useState({...D?{}:{"variants.inventory_quantity":"> 0"}}),[Ee,we]=React.useState(!1),[fe,Se]=React.useState((null==(r=null==(o=null==(s=null==Q?void 0:Q.result)?void 0:s.results)?void 0:o[0])?void 0:r.hits)||[]),[Ce,Te]=React.useState(0),[Ae,Le]=React.useState(1),[Ne,Ie]=React.useState(0),[ye,be]=React.useState((null==(d=null==(l=null==(i=null==Q?void 0:Q.result)?void 0:i.results)?void 0:l[0])?void 0:d.totalHits)||0),[Oe,ke]=React.useState([]),[Pe,$e]=React.useState([]),[We,De]=React.useState(!1),[Fe,Be]=React.useState(!0),[Ue,Me]=React.useState(Q?vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:(null==(Ge=null==P?void 0:P.filter)?void 0:Ge.show_total_products)?vendor.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[ye," result"," ",(null==A?void 0:A.length)?vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:["for ",vendor.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',A,'"']})]}):null]}):null}):null);var Ge;const He=usePrevious({keyword:A,clickedLimitId:he,clickedFacets:Re}),{color:Ve,font_size:Ke,font_weight:Ye,text_transform:ze}=(null==(a=null==P?void 0:P.filter)?void 0:a.title)||{},{color:qe,font_size:Je,font_weight:Ze,text_transform:Xe}=(null==(c=null==P?void 0:P.filter)?void 0:c.option)||{},{text_color:Qe,border_color:et,border_radius:tt,padding_top:nt,padding_bottom:st,padding_left:ot,padding_right:rt,background_color:it,font_size:lt,font_weight:dt,text_transform:at}=(null==(u=null==P?void 0:P.filter)?void 0:u.button)||{},ct={...Ve&&{color:Ve},...Ke&&{fontSize:Ke},...Ye&&{fontWeight:Ye},...ze&&{textTransform:ze}},ut={...qe&&{color:qe},...Je&&{fontSize:Je},...Ze&&{fontWeight:Ze},...Xe&&{textTransform:Xe}},xt=e=>{var t;const n=new URLSearchParams(document.location.search),s=Object.fromEntries(n);let o={};for(const i in s){(null==b?void 0:b.length)&&!b.includes(i)&&(o[i]=s[i])}for(const i in e)(null==(t=e[i])?void 0:t.length)&&(o[i]=e[i]);const r=new URLSearchParams({...o}).toString();window.history.pushState(null,"",`${document.location.pathname}${(null==r?void 0:r.length)?`?${r}`:""}`)},mt=e=>{_e(e===ve?"":e)},pt=()=>{De(!0),je({}),we(!Ee),xt({}),ke([]),setTimeout((()=>{De(!1)}),10)},ht=(e,t,n=!1)=>{var s;De(!0);let o=[t],r=["variants.price"].includes(e);Re&&(n?o=[t]:(null==(s=Re[e])?void 0:s.includes(t))?o=Re[e].filter((e=>e!==t)):r?(Re[e],Re[e]===t?(o=[],ke([])):o=t):o=Re[e]?[...Re[e],t]:[t]);let i={...Re,[e]:o};xt(i),je(i),we(!Ee),setTimeout((()=>{De(!1)}),10)},gt=async(e=!1,t=!1)=>{var n,s;if(!L)return;e&&Le(1),ie(!0);let o,r=(e=>{const t=new URLSearchParams(document.location.search),n=Object.fromEntries(t);for(const s in n)(null==b?void 0:b.length)&&b.includes(s)&&(e[s]=n[s].split(","));return Object.keys(e).length&&je(e),e})(Re),i=Object.entries(r).map((e=>{var t,n;if((null==e?void 0:e.length)&&e[1].length){let s=e[0],o=["variants.inventory_quantity"].includes(s),r=["variants.price"].includes(s),i=["tags"].includes(s);return Array.isArray(e[1])&&(null==(t=e[1])?void 0:t.length)>1?r?`${s} >= ${e[1][0]} AND ${s} <= ${e[1][1]}`:i?`${s} IN [${e[1]}]`:null==(n=e[1])?void 0:n.map((e=>o?`${s} ${e}`:`${s} = '${e}'`)).join(" OR "):o?`${s} ${e[1]}`:i?`${s} IN [${e[1]}]`:`${s} = '${e[1]}'`}return null})).filter((e=>e));(null==k?void 0:k.length)&&i.push(`tags NOT IN [${k}]`),ne&&i.push(`collections.id = '${ne}'`);let l={q:A,sort:ue?[ue]:[],page:e?1:Ae,hitsPerPage:he,facets:b,filter:i.join(" AND ")};Q&&Fe?(o=null==(s=null==(n=null==Q?void 0:Q.result)?void 0:n.results)?void 0:s[0],Be(!1)):o=await search(L,l),((e,t)=>{var n;if(!e)return;const{hits:s,processingTimeMs:o,totalHits:r,totalPages:i}=e;t&&(null==A?void 0:A.length)&&searchTrigger({keyword:A,resultCount:r||0}),oe(!1),ie(!1),Se(s),Te(o||0),Ie(i),be(r||0),Me(vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:(null==(n=null==P?void 0:P.filter)?void 0:n.show_total_products)?vendor.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[r," result"," ",(null==A?void 0:A.length)?vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:["for ",vendor.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',A,'"']})]}):null]}):null}))})(o,t)},vt=e=>{const t=new URLSearchParams(document.location.search);t.set(te,e),G&&G(e),window.history.pushState(null,"",`${document.location.pathname}?${t.toString()}`)};React.useEffect((()=>{let e=Boolean(He&&((null==He?void 0:He.keyword)!==A||(null==He?void 0:He.clickedLimitId)!==he||(null==He?void 0:He.clickedFacets)!==Re));if(Boolean(He&&(null==He?void 0:He.keyword)!==A)){const e=setTimeout((()=>{gt(!0,!0)}),500);return()=>clearTimeout(e)}gt(e)}),[ue,he,Ee,A,Ae,L,ne]),React.useEffect((()=>{(()=>{var e,t;if(!(null==(e=null==P?void 0:P.filter)?void 0:e.enable_on_search)||(null==(t=null==P?void 0:P.filter)?void 0:t.hide_when_one_value)&&ye<=1)return;let n=!1;n||null==y||y.map((e=>{const{collections:t,items:s}=e;(ne&&(null==t?void 0:t.includes(Number(ne)))||(null==t?void 0:t.includes("all")))&&(n=!0,$e(s))}))})()}),[y,O,ye]);const _t=({label:e,name:t,value:n,index:s})=>{var o;let r=n;return["variants.price"].includes(t)&&(r=null==n?void 0:n.join(" - ")),vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-refine-selected",style:ut,children:[vendor.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-filter-item-title-refine-list",children:[e,": ",null==(o=String(r))?void 0:o.replaceAll("_"," ")]}),vendor.jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-item-refine-title-clear",onClick:()=>ht(t,n),children:vendor.jsxRuntimeExports.jsx("svg",{width:12,height:12,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vendor.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"})})})]},s)},Rt=e=>{var t,n;const{value:s,label:o,display:r}=e;let i=null,l=O[s],d=null==(t=null==P?void 0:P.filter)?void 0:t.show_number_matching_product;return"slider"===r.toLowerCase()?i=vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-list-slider",children:[vendor.jsxRuntimeExports.jsx(Slider,{defaultValue:[Oe[0]||(null==l?void 0:l.min),Oe[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=>ht(s,e),setValueChange:e=>ke(e)}),vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-list-slider-minmax",children:[vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-minmax-field",children:Oe[0]||(null==l?void 0:l.min)}),vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-minmax-field",children:Oe[1]||(null==l?void 0:l.max)})]})]}):"checkbox"===r.toLowerCase()&&(null==l?void 0:l.length)?i=vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:null==l?void 0:l.map(((e,t)=>{var n;return vendor.jsxRuntimeExports.jsx("li",{children:vendor.jsxRuntimeExports.jsx(Checkbox,{id:`${s}_${t}`,name:s,value:e.value,label:`${e.name}${void 0!==e.total&&d?` (${e.total})`:""}`,onClick:e=>ht(s,e.currentTarget.value),defaultChecked:Re&&(null==(n=Re[s])?void 0:n.includes(e.value)),labelStyle:ut})},t)}))}):"radio"===r.toLowerCase()&&(null==l?void 0:l.length)?i=vendor.jsxRuntimeExports.jsx("li",{children:vendor.jsxRuntimeExports.jsx(RadioGroup,{id:s,name:s,onValueChange:e=>ht(s,e,!0),items:null==l?void 0:l.map((e=>{const{name:t,value:n,total:s}=e;return{label:`${t} ${void 0!==s&&d?` (${s})`:""}`,value:n}})),defaultValue:Re&&(null==(n=Re[s])?void 0:n.length)?Re[s][0]:"",labelStyle:ut})}):"select"===r.toLowerCase()&&(null==l?void 0:l.length)?i=vendor.jsxRuntimeExports.jsx("li",{children:vendor.jsxRuntimeExports.jsx(Select,{placeholder:`Select ${o}`,name:s,onValueChange:e=>ht(s,e,!0),items:null==l?void 0:l.map((e=>{const{name:t,value:n,total:s}=e;return{label:`${t} ${void 0!==s&&d?` (${s})`:""}`,value:n}})),labelStyle:ut})}):"swatch"===r.toLowerCase()&&(null==l?void 0:l.length)&&(i=vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:null==l?void 0:l.map(((e,t)=>{var n;let o=(null==$?void 0:$.filter((({name:t})=>null==t?void 0:t.includes(e.value)))[0])||{};return vendor.jsxRuntimeExports.jsx("li",{children:vendor.jsxRuntimeExports.jsx(ColorSwatch,{id:`${s}_${t}`,name:s,value:e.value,rgb:null==o?void 0:o.rgb,image:null==o?void 0:o.image,onClick:e=>ht(s,e.currentTarget.value),defaultChecked:Re&&(null==(n=Re[s])?void 0:n.includes(e.value))})},t)}))})),i},jt=Pe.map(((e,t)=>{const{value:n,label:s,display:o}=e;let r=ve===n,i=O[n],l=Boolean("slider"===o.toLowerCase()?i:null==i?void 0:i.length),d=["select"].includes(o.toLowerCase())&&(null==i?void 0:i.length),a=["sledge-instant-search__result-filter-item-list"],c=Rt(e);return"swatch"===o.toLowerCase()&&(null==i?void 0:i.length)&&a.push("sledge-instant-search__result-filter-item-color-swatches"),l?vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item",children:[vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-title",onClick:()=>mt(n),children:[vendor.jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-title",style:ct,children:s}),vendor.jsxRuntimeExports.jsx(vendor.motion.div,{initial:!1,animate:r?"open":"closed",variants:ROTATE_FILTER_ARROW_ANIMATION,children:vendor.jsxRuntimeExports.jsx(ChevronArrowDownIcon,{width:15,height:15,color:"#000000"})})]}),r&&vendor.jsxRuntimeExports.jsx("ul",{className:a.join(" "),children:d?c:We?null:c})]},t):null})),Et=Pe.map(((e,t)=>{const{value:n,label:s,display:o}=e;let r=ve===n,i=O[n],l=Boolean("slider"===o.toLowerCase()?i:null==i?void 0:i.length),d=["radio","select"].includes(o.toLowerCase())&&(null==i?void 0:i.length),a=["sledge-instant-search__result-filter-item-list"],c=Rt(e);return"swatch"===o.toLowerCase()&&(null==i?void 0:i.length)&&a.push("sledge-instant-search__result-filter-item-color-swatches"),l?vendor.jsxRuntimeExports.jsx("div",{className:"",children:vendor.jsxRuntimeExports.jsx(Popover,{trigger:vendor.jsxRuntimeExports.jsxs(Button,{type:"button",onClick:()=>mt(n),children:[s,vendor.jsxRuntimeExports.jsx(vendor.motion.div,{initial:"closed",animate:r?"open":"closed",variants:ROTATE_FILTER_ARROW_ANIMATION,className:"sort-trigger-icon",children:vendor.jsxRuntimeExports.jsx(ChevronArrowDownIcon,{width:20,height:20,color:"#000000"})})]}),content:vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-facet",children:r&&vendor.jsxRuntimeExports.jsx("ul",{className:a.join(" "),children:d?c:We?null:c})}),withOpenState:!1,setIsOpen:e=>_e(e?n:""),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 wt=[];Object.entries(Re).map((e=>{var t,n;if((null==e?void 0:e.length)&&e[1].length){let s=e[0];if(["variants.inventory_quantity"].includes(s))return;let o=["variants.price"].includes(s),r=Pe.filter((({value:e})=>null==e?void 0:e.includes(s))),i=(null==r?void 0:r.length)?r[0].label:s;return Array.isArray(e[1])&&(null==(t=e[1])?void 0:t.length)>1?o?wt.push({label:i,name:s,value:e[1]}):null==(n=e[1])?void 0:n.map((e=>{wt.push({label:i,name:s,value:e})})):wt.push({label:i,name:s,value:e[1][0]})}}));const ft=vendor.jsxRuntimeExports.jsx(Pagination,{currentPage:Ae,totalPage:Ne,totalResult:ye,onChange:e=>(e=>{Le(e),setTimeout((()=>{scrollToElement({element:X.current,headerOffset:50})}),200)})(e)});return vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:[(null==(x=null==P?void 0:P.filter)?void 0:x.enable_on_search)&&"horizontal"===(null==(m=null==P?void 0:P.filter)?void 0:m.layout)?vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:se&&!Q?H:vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:N&&!Q?vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-loading",children:H}):Et.every((e=>!e))?null:vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-horizontal-wrapper",children:[vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal",children:Et}),Boolean((null==wt?void 0:wt.length)&&(null==(p=null==P?void 0:P.filter)?void 0:p.show_refine_by_block))?vendor.jsxRuntimeExports.jsx(vendor.jsxRuntimeExports.Fragment,{children:Boolean(wt.every((e=>!e)))?null:vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-horizontal",children:[vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-refine-item sledge-instant-search__result-filter-horizontal-refine-item-clear-all",onClick:pt,children:"Clear All"}),wt.map(((e,t)=>{const{label:n,name:s,value:o}=e;return _t({label:n,name:s,value:o,index:t})}))]})}):null]})})}):null,vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-wrapper","data-filter-layout":null==(h=null==P?void 0:P.filter)?void 0:h.layout,children:vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:[(null==(g=null==P?void 0:P.filter)?void 0:g.enable_on_search)&&"vertical"===(null==(v=null==P?void 0:P.filter)?void 0:v.layout)?se?vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:V}):jt.every((e=>!e))?null:vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:N?V:vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:[Boolean((null==wt?void 0:wt.length)&&(null==(_=null==P?void 0:P.filter)?void 0:_.show_refine_by_block))?Boolean(wt.every((e=>!e)))?null:vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item",children:[vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-title-refine",children:[vendor.jsxRuntimeExports.jsx("strong",{className:"sledge-instant-search__result-filter-item-title-refine-heading",children:"Filter"}),vendor.jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-item-title-refine-clear",onClick:pt,children:"Clear All"})]}),vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-item-refine-selected-flex",children:wt.map(((e,t)=>{const{label:n,name:s,value:o}=e;return _t({label:n,name:s,value:o,index:t})}))})]}):null,jt]})}):null,vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data",children:[se?Y:vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-keyword",children:["horizontal"===(null==(R=null==P?void 0:P.filter)?void 0:R.layout)&&vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-horizontal",children:Ue}),vendor.jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:vendor.jsxRuntimeExports.jsx(SearchIcon,{width:18,height:18,color:"#868686"}),placeholder:"Search products...",value:A,onChange:({value:e})=>vt(e),onResetField:()=>vt(""),className:"sledge-instant-search__result-data-keyword-form",withClearField:!0}),vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-item sledge-instant-search__result-data-summary-select-field",children:[vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:[vendor.jsxRuntimeExports.jsx("span",{children:"Sort by:"}),I&&Boolean(null==I?void 0:I.length)&&vendor.jsxRuntimeExports.jsx(SelectField,{align:"end",prefixLabel:vendor.jsxRuntimeExports.jsx("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vendor.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:I.map((e=>{const{label:t,value:n}=e;return{label:t,value:n}})),value:ue||(null==ee?void 0:ee.default_sort),onChange:({label:e,value:t})=>((e,t)=>{de(!1),pe(e),xe(t)})(e,t)})]}),vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:[vendor.jsxRuntimeExports.jsx("span",{children:"Limit:"}),(null==(j=null==P?void 0:P.search)?void 0:j.allowed_limit)&&Boolean(null==(w=null==(E=null==P?void 0:P.search)?void 0:E.allowed_limit)?void 0:w.length)&&vendor.jsxRuntimeExports.jsx(SelectField,{align:"end",options:P.search.allowed_limit.map((e=>({label:e,value:e}))),value:he,onChange:({value:e})=>(e=>{ce(!1),ge(e)})(e)})]})]})]}),re?vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:[K,(null==fe?void 0:fe.length)?ft:null]}):vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:["vertical"===(null==(f=null==P?void 0:P.filter)?void 0:f.layout)&&vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-vertical",children:Ue}),(null==fe?void 0:fe.length)?vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:[vendor.jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"large",data:fe.map((e=>{const{variants:t,...n}=e||{};return{product:n,variants:t}})),setting:{show_vendor:null==(S=null==P?void 0:P.search)?void 0:S.show_vendor,show_sku:null==(C=null==P?void 0:P.search)?void 0:C.show_sku,show_price:null==(T=null==P?void 0:P.search)?void 0:T.show_price},isComponentJsVersion:U,cards:M,showOptionOutOfStock:!0,onAfterAddToCart:z,onAfterAddWishlist:q,onAfterRemoveWishlist:J,onAfterRenderProduct:Z,dataWishlists:null==Q?void 0:Q.wishlists,dataReviews:null==Q?void 0:Q.reviews}),ft]}):vendor.jsxRuntimeExports.jsx(ResultEmpty,{})]})]})]})})]})},ResultCategory=e=>{var t,n,s,o;const{keyword:r,clickedTabIndexId:i,clickedTabIndexName:l,isJsVersion:d,collectionCardsComponent:a,pageCardsComponent:c,blogCardsComponent:u,articleCardsComponent:x,setKeyword:m,searchResultContainerRef:p,onAfterRenderCollection:h,onAfterRenderPage:g,onAfterRenderBlog:v,onAfterRenderArticle:_}=e||{},[R,j]=React.useState(!0),[E,w]=React.useState(!0),[f,S]=React.useState(""),[C,T]=React.useState([]),[A,L]=React.useState(0),[N,I]=React.useState(1),[y,b]=React.useState(0),[O,k]=React.useState(0),[P,$]=React.useState(null),W=usePrevious({keyword:r}),D=async()=>{if(!i)return;let e;w(!0);let t={q:r,sort:f?[f]:[],page:N,hitsPerPage:12};e=await search(i,t),(e=>{if(!e)return;const{hits:t,processingTimeMs:n,totalHits:s,totalPages:o}=e;j(!1),w(!1),T(t),L(n||0),b(o),k(s||0),$(vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:vendor.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[s," result"," ",(null==r?void 0:r.length)?vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:["for ",vendor.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',r,'"']})]}):null]})}))})(e)};React.useEffect((()=>{if(Boolean(W&&(null==W?void 0:W.keyword)!==r)){const e=setTimeout((()=>{D()}),500);return()=>clearTimeout(e)}D()}),[f,r,N,i]);const F=vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-keyword sledge-instant-search__result-data-keyword-category",children:vendor.jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:vendor.jsxRuntimeExports.jsx(SearchIcon,{width:18,height:18,color:"#868686"}),placeholder:`Search ${l?l.toLowerCase():""}...`,value:r,onChange:({value:e})=>m&&m(e),onResetField:()=>m&&m(""),className:"sledge-instant-search__result-data-keyword-form",withClearField:!0})}),B=vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary",children:vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"117px",height:"28px",color:"lighten",rounded:"md"})}),U=(null==(t=String(i))?void 0:t.includes("collection"))?vendor.jsxRuntimeExports.jsx(SkeletonLoading.CollectionGrid,{count:6}):(null==(n=String(i))?void 0:n.includes("page"))?vendor.jsxRuntimeExports.jsx(SkeletonLoading.PageGrid,{count:6}):(null==(s=String(i))?void 0:s.includes("blog"))?vendor.jsxRuntimeExports.jsx(SkeletonLoading.BlogGrid,{count:12}):(null==(o=String(i))?void 0:o.includes("article"))?vendor.jsxRuntimeExports.jsx(SkeletonLoading.ArticleGrid,{count:12}):null,M=()=>vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-category-wrapper",children:[F,B,U]}),G=()=>vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:[F,B,U]}),H=e=>{var t,n,s,o;return(null==(t=String(i))?void 0:t.includes("collection"))?vendor.jsxRuntimeExports.jsx(CollectionGrid,{cards:a,onAfterRenderCollection:h,...e}):(null==(n=String(i))?void 0:n.includes("page"))?vendor.jsxRuntimeExports.jsx(PageGrid,{cards:c,onAfterRenderPage:g,...e}):(null==(s=String(i))?void 0:s.includes("blog"))?vendor.jsxRuntimeExports.jsx(BlogGrid,{cards:u,onAfterRenderBlog:v,...e}):(null==(o=String(i))?void 0:o.includes("article"))?vendor.jsxRuntimeExports.jsx(ArticleGrid,{cards:x,onAfterRenderArticle:_,...e}):null};return vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-wrapper",children:R?vendor.jsxRuntimeExports.jsx(M,{}):vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-category-wrapper",children:E?vendor.jsxRuntimeExports.jsx(G,{}):vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:[F,vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary",children:P}),(null==C?void 0:C.length)?vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:[vendor.jsxRuntimeExports.jsx(H,{data:C,isComponentJsVersion:d}),vendor.jsxRuntimeExports.jsx(Pagination,{currentPage:N,totalPage:y,totalResult:O,onChange:e=>(e=>{I(e),setTimeout((()=>{scrollToElement({element:p.current,headerOffset:50})}),200)})(e)})]}):vendor.jsxRuntimeExports.jsx(ResultEmpty,{})]})})})},ResultEmpty=e=>{const[t,n]=React.useState(""),[s,o]=React.useState("");return React.useEffect((()=>{n("No results found"),o("Your search did not match any results. <br/> Please try again")}),[]),vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-empty",children:[vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-empty-title",dangerouslySetInnerHTML:{__html:t}}),vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-empty-description",dangerouslySetInnerHTML:{__html:s}})]})},SearchWidget=e=>{var t,n,s,o,r,i,l,d,a,c,u,x,m,p,h,g,v,_,R,j,E;const{isRenderApp:w,isJsVersion:f}=React.useContext(core.SledgeContext),{instantSearch:S}=w||{},{width:C="400px",children:T,onAfterAddToCart:A,onAfterAddWishlist:L,onAfterRemoveWishlist:N,onAfterRenderProduct:I}=e;let y=null,b=null,O=null,k=null;React.Children.map(T,(e=>{if(React.isValidElement(e)&&isFunction(e.type)){const{productCard:t,suggestionKeywordList:n,otherIndexList:s,searchViewMoreResult:o}=(null==e?void 0:e.props)||{};t&&isFunction(t)&&(y=t),n&&isFunction(n)&&(b=n),s&&isFunction(s)&&(O=s),o&&isFunction(o)&&(k=o)}}));const[P,$]=React.useState(!0),[W,D]=React.useState(""),[F,B]=React.useState([]),[U,M]=React.useState([]),[G,H]=React.useState({}),[V,K]=React.useState({}),[Y,z]=React.useState(""),q=usePrevious({keyword:W}),J=async(e,t=!1)=>{var n,s,o,r,i,l,d,a,c,u,x;if(!W.length)return;$(!0);const{tabs:m,suffix_index_product:p,hidden_tags:h,display:g,show_out_of_stock:v}=e,_=(null==(n=null==g?void 0:g.search)?void 0:n.suggestion)||{};let R,j={queries:m.map((e=>{const{index:t}=e;let n=t.includes(p),s=[];return(null==h?void 0:h.length)&&s.push(`tags NOT IN [${h}]`),v||s.push("variants.inventory_quantity > 0"),{indexUid:t,q:W,hitsPerPage:n?6:4,filter:n?s.join(" AND "):""}}))};if(R=await multiSearch(j),!R)return;const{results:E}=R;let w=null==E?void 0:E.filter((({indexUid:e})=>null==e?void 0:e.includes(p)));t&&(null==W?void 0:W.length)&&searchTrigger({keyword:W,resultCount:(null==(s=w[0])?void 0:s.totalHits)||0});let f=(null==(o=null==E?void 0:E.filter((({indexUid:e})=>!(null==e?void 0:e.includes(p)))))?void 0:o.map((e=>{const{indexUid:t}=e,{name:n}=null==m?void 0:m.find((({index:e})=>e.includes(t)));return{...e,name:n||""}})))||[],S=(null==w?void 0:w.length)?null==(r=w[0])?void 0:r.hits:[],C=W.length?(null==S?void 0:S.length)?"":"no_result":"zero_character",T=Boolean(!W.length&&Object.keys(_).length&&(null==(l=null==(i=_[C])?void 0:i.products)?void 0:l.active)&&(null==(c=null==(a=null==(d=_[C])?void 0:d.products)?void 0:a.list)?void 0:c.length));B(T?null==(x=null==(u=_[C])?void 0:u.products)?void 0:x.list:S),M(f),z(C),$(!1)};React.useEffect((()=>{S&&(async e=>{var t;if(!W.length)return;let n;if(n=JSON.parse(e),!n)return;const{display:s}=n;H(s),K(null==(t=null==s?void 0:s.search)?void 0:t.suggestion),await J(n)})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||null)}),[W]),React.useEffect((()=>{if(Boolean(q&&(null==q?void 0:q.keyword)!==W)){const e=JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||""),t=setTimeout((()=>{e&&J(e,!0)}),500);return()=>clearTimeout(t)}}),[W]);const Z={maxWidth:C};return vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-wrapper",style:Z,children:[vendor.jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:vendor.jsxRuntimeExports.jsx(SearchIcon,{width:18,height:18,color:"#868686"}),placeholder:"Search anything",value:W,onChange:({value:e})=>D(e),onResetField:()=>D(""),withClearField:!0}),vendor.jsxRuntimeExports.jsx(vendor.motion.div,{initial:"hidden",animate:W.length?"visible":"hidden",variants:VISIBLE_ANIMATION,className:"sledge-instant-search__widget-search-form-result",children:P?vendor.jsxRuntimeExports.jsx(ScrollArea,{children:vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex",children:[vendor.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=>vendor.jsxRuntimeExports.jsxs(React.Fragment,{children:[vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"42px",color:"lighten",rounded:"md",...Boolean(e)&&{style:{marginTop:"12px"}}}),vendor.jsxRuntimeExports.jsx("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",gap:"12px",marginTop:"12px"},children:[1,2,3].map((e=>vendor.jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"140px"}},e)))})]},e)))}),vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-product",children:vendor.jsxRuntimeExports.jsx(SkeletonLoading.ProductGrid,{count:6,type:"small"})})]})}):vendor.jsxRuntimeExports.jsx(ScrollArea,{isLoading:P,children:vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:[vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex",children:[vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-other",children:[Object.keys(V).length&&(null==(n=null==(t=V[Y])?void 0:t.keywords)?void 0:n.active)&&(null==(r=null==(o=null==(s=V[Y])?void 0:s.keywords)?void 0:o.list)?void 0:r.length)?vendor.jsxRuntimeExports.jsx(Global.SuggestionKeywordLists,{listsComponent:b,keywords:V[Y].keywords.list,isComponentJsVersion:f}):null,U.map(((e,t)=>{const{hits:n,name:s}=e;return vendor.jsxRuntimeExports.jsx(React.Fragment,{children:vendor.jsxRuntimeExports.jsx(Global.OtherIndexLists,{listsComponent:O,name:s,items:n,isComponentJsVersion:f})},t)}))]}),vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-product",children:[vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-title-product",children:"Products"}),(null==F?void 0:F.length)?vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-product",children:vendor.jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"small",data:F.map((e=>{const{variants:t,...n}=e||{};return{product:n,variants:t}})),setting:{show_vendor:null==(i=null==G?void 0:G.search)?void 0:i.show_vendor,show_sku:null==(l=null==G?void 0:G.search)?void 0:l.show_sku,show_price:null==(d=null==G?void 0:G.search)?void 0:d.show_price},showOptionOutOfStock:!0,isComponentJsVersion:f,cards:y,onAfterAddToCart:A,onAfterAddWishlist:L,onAfterRemoveWishlist:N,onAfterRenderProduct:I})}):Object.keys(V).length&&(null==(c=null==(a=V[Y])?void 0:a.products)?void 0:c.active)&&(null==(m=null==(x=null==(u=V[Y])?void 0:u.products)?void 0:x.list)?void 0:m.length)?vendor.jsxRuntimeExports.jsxs(vendor.jsxRuntimeExports.Fragment,{children:[vendor.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-product-suggestion-no-result-text",children:[vendor.jsxRuntimeExports.jsx("span",{children:"Sorry, nothing found for"})," ",vendor.jsxRuntimeExports.jsx("strong",{children:W}),". ",vendor.jsxRuntimeExports.jsx("span",{children:"Did you mean:"})]}),vendor.jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"small",data:V[Y].products.list.map((e=>{const{variants:t,...n}=e||{};return{product:n,variants:t}})),setting:{show_vendor:null==(p=null==G?void 0:G.search)?void 0:p.show_vendor,show_sku:null==(h=null==G?void 0:G.search)?void 0:h.show_sku,show_price:null==(g=null==G?void 0:G.search)?void 0:g.show_price},showOptionOutOfStock:!0,isComponentJsVersion:f,cards:y,onAfterAddToCart:A,onAfterAddWishlist:L,onAfterRemoveWishlist:N,onAfterRenderProduct:I})]}):vendor.jsxRuntimeExports.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(V).length&&(null==(_=null==(v=V[Y])?void 0:v.products)?void 0:_.active)&&(null==(E=null==(j=null==(R=V[Y])?void 0:R.products)?void 0:j.list)?void 0:E.length)?vendor.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-button-more-wrapper",children:vendor.jsxRuntimeExports.jsx(Global.SearchViewMoreResult,{component:k,keyword:W,isComponentJsVersion:f})}):null]})})})]})};exports.ProductFilterWidget=ProductFilterWidget,exports.SearchIconWidget=SearchIconWidget,exports.SearchIconWidgetPopup=SearchIconWidgetPopup,exports.SearchResultWidget=SearchResultWidget,exports.SearchWidget=SearchWidget;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./vendor-9c93dcff.cjs"),t=require("react"),s=require("@sledge-app/core");require("react-dom");const i="https://sledge-api-preprod.offstack.io",n="https://instant-search-engine.offstack.io",l="data-component",o={SHARE_ID:"data-share-id",QUERY_SHARE_ID:"data-query-share-id",CUSTOM_ROUTE_PAGE:"data-custom-route-page",RENDER_WISHLIST_WIDGET_ALERT:"data-render-wishlist-widget-alert",USE_PROXY_URL:"data-use-proxy-url"},r="sledge-anonym-id",d="sledge-auth-app",a="sledge-instant-search-auth-app",u="sledge-general-setting",c="sledge-wishlist-setting",x="sledge-product-review-setting",m="sledge-instant-search-setting",p="container-widget",h={ELEMENT_BADGE_FLOATING_ICON:"wishlist-badge-floating-icon",ELEMENT_BADGE_FLOATING_FULL:"wishlist-badge-floating-full",ELEMENT_WIDGET_POPUP:"wishlist-widget-popup"},g={GLOBAL:{ELEMENT_CUSTOM_COMPONENTS:`[${l}="custom-components"]`},WISHLIST:{ELEMENT_BADGE:`[${l}="wishlist-badge"]`,ELEMENT_BADGE_MENU_ITEM:'[href="#sledge-wishlist-badge-menu-item"]',ELEMENT_TRIGGER:`[${l}="wishlist-trigger"]`,ELEMENT_WIDGET:`[${l}="wishlist-widget"]`,ELEMENT_BUTTON_DETAIL:`[${l}="wishlist-button-detail"]`},PRODUCT_REVIEW:{ELEMENT_WIDGET:`[${l}="product-review-widget"]`,ELEMENT_RATING:`[${l}="product-review-rating"]`},INSTANT_SEARCH:{ELEMENT_SEARCH_WIDGET:`[${l}="instant-search-widget"]`,ELEMENT_SEARCH_ICON_WIDGET:`[${l}="instant-search-icon-widget"]`,ELEMENT_SEARCH_RESULT_WIDGET:`[${l}="instant-search-result-widget"]`,ELEMENT_PLP_WIDGET:`[${l}="instant-search-product-filter-widget"]`}},j="/pages/search-result",v={ELEMENT_WIDGET:"product-review-widget"},_={Authorization:"zbNTHXQpW7OmI",Method:"Gba2Tb9Ys7JGu",GET:"JniUtw5dNfeKW",POST:"a9Dmw0qP9hvQE",PUT:"dEnOjbvTzULLK",DELETE:"pLC93Tvsu6g7H"};async function w(e,t){if("undefined"!=typeof caches&&"GET"===t.method){const t=await async function(e){const t="sledge-1";return caches.open(t).then((t=>t.match(e).then((s=>{const i=fetch(e).then((async s=>{const i=e.split("?")[0],n=await t.matchAll(),l=await n.filter((t=>t.url.includes(i)&&t.url!==e));for(const e of l)await t.delete(e.url);return t.put(e,s.clone()),s}));return s||i}))))}(e);return await t.json()}return fetch(e,t).then((e=>e.json()))}const f=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},R=e=>"function"==typeof e,E=e=>{const{element:t,headerOffset:s}=e;if(t){var i=(null==t?void 0:t.getBoundingClientRect().top)+window.scrollY-s;window.scrollTo({top:i,behavior:"smooth"})}},C=async e=>{const{url:t,method:s,authorization:i="",payload:n={},headers:l={},isSimpleRequest:o=!0,isUploadFile:r=!1}=e;var d=new Headers;o||(i&&d.append("Authorization",`Bearer ${i}`),Object.keys(l).length&&Object.keys(l).forEach((function(e){d.append(e,l[e])})));var a=new FormData;(o||r)&&(i&&o&&a.append(_.Authorization,i),a.append(_.Method,_[s]),Object.keys(n).length&&Object.keys(n).forEach((function(e){r&&(null==n?void 0:n.files)&&[...n.files].map((e=>{a.append("files",e,e.name)})),a.append(e,n[e])})));const u=o?"POST":s;var c={method:u,redirect:"follow",headers:d,body:"GET"===u?null:o||r?a:JSON.stringify(n)};return await w(`${t}`,c)},y=(e,t={timeZone:"Asia/Jakarta",year:"numeric",month:"numeric",day:"numeric"})=>new Date(e).toLocaleString("en-US",t),b=({trigger:s,content:i,isOpen:n,setIsOpen:l,hideCloseIcon:o,align:r,className:d,withOpenState:a=!0,withArrow:u=!0,customArrow:c="",sideOffset:x=5,alignOffset:m=0})=>{const[p,h]=t.useState(!!a&&n);return t.useEffect((()=>{var e;let t=null==(e=null==document?void 0:document.querySelector(".PopoverArrow"))?void 0:e.parentElement;t&&(null==c?void 0:c.length)&&(t.style.display="inline-flex",t.innerHTML=c)}),[p]),e.jsxRuntimeExports.jsxs(e.$cb5cc270b50c6fcd$export$be92b6f5f03c0fe9,{...a&&{open:n},...l&&{onOpenChange:e=>{h(e),l(e)}},children:[e.jsxRuntimeExports.jsx(e.$cb5cc270b50c6fcd$export$41fb9f06171c75f4,{asChild:!0,children:s}),e.jsxRuntimeExports.jsx(e.$cb5cc270b50c6fcd$export$602eac185826482c,{children:e.jsxRuntimeExports.jsxs(e.$cb5cc270b50c6fcd$export$7c6e2c02157bb7d2,{className:`sledge__popover-content ${d||""}`,sideOffset:x,alignOffset:m,align:r,...l&&{onOpenAutoFocus:()=>l(!0),onCloseAutoFocus:()=>l(!1)},children:[i,!o&&e.jsxRuntimeExports.jsx(e.$cb5cc270b50c6fcd$export$f39c2d165cd861fe,{className:"PopoverClose","aria-label":"Close",children:e.jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.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"})})}),u?e.jsxRuntimeExports.jsx(e.$cb5cc270b50c6fcd$export$21b07c8f274aebd5,{className:"PopoverArrow"}):null]})})]})},S=({value:s,total:i,fillColor:n="",outlineColor:l=""})=>{const[o,r]=t.useState(0);return t.useEffect((()=>{const e=setTimeout((()=>r(+s/i*100)),150);return()=>clearTimeout(e)}),[]),e.jsxRuntimeExports.jsx(e.$67824d98245208a0$export$be92b6f5f03c0fe9,{className:"sledge__progress",value:o,style:l?{borderWidth:"1px",borderStyle:"solid",borderColor:l}:{},children:e.jsxRuntimeExports.jsx(e.$67824d98245208a0$export$adb584737d712b70,{className:"ProgressIndicator",style:{transform:`translateX(-${100-o}%)`,...n&&{backgroundColor:n}}})})},N=({id:t,name:s,value:i,required:n,label:l,defaultChecked:o,labelStyle:r={},onClick:d})=>e.jsxRuntimeExports.jsxs("div",{className:"sledge__checkbox-wrapper",children:[e.jsxRuntimeExports.jsx(e.$e698a72e93240346$export$be92b6f5f03c0fe9,{className:"sledge__checkbox-root",defaultChecked:o,id:t,name:s,value:i,required:n,onClick:d,children:e.jsxRuntimeExports.jsx(e.$e698a72e93240346$export$adb584737d712b70,{className:"sledge__checkbox-indicator",children:e.jsxRuntimeExports.jsx("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.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"})})})}),l&&e.jsxRuntimeExports.jsx("label",{className:"sledge__checkbox-label",htmlFor:t,style:r,children:l})]}),L=s=>{const{defaultValue:i,min:n,max:l,step:o=1,setValueCommit:r,setValueChange:d}=s,[a,u]=t.useState(i);return e.jsxRuntimeExports.jsx("form",{children:e.jsxRuntimeExports.jsxs(e.$faa2e61a3361514f$export$be92b6f5f03c0fe9,{className:"sledge__SliderRoot",defaultValue:i,min:n,max:l,step:o,"aria-label":"Volume",onValueCommit:e=>{r&&r(e),u(e)},onValueChange:e=>{d&&d(e),u(e)},children:[e.jsxRuntimeExports.jsx(e.$faa2e61a3361514f$export$13921ac0cc260818,{className:"sledge__SliderTrack",children:e.jsxRuntimeExports.jsx(e.$faa2e61a3361514f$export$9a58ef0d7ad3278c,{className:"sledge__SliderRange"})}),e.jsxRuntimeExports.jsx(pe,{content:a[0],customArrow:'<svg width="19" height="5" viewBox="0 0 19 5" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 4.99998C9 9.48298e-05 16.4996 1.99678e-05 18.4999 0L9 2.2985e-06L0.5 2.04891e-06C9 2.2985e-06 9 4.99998 9 4.99998Z" fill="#43c6ac"/></svg>',wrapTrigger:!1,children:e.jsxRuntimeExports.jsx(e.$faa2e61a3361514f$export$6521433ed15a34db,{className:"sledge__SliderThumb"})}),e.jsxRuntimeExports.jsx(pe,{content:a[1],customArrow:'<svg width="19" height="5" viewBox="0 0 19 5" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 4.99998C9 9.48298e-05 16.4996 1.99678e-05 18.4999 0L9 2.2985e-06L0.5 2.04891e-06C9 2.2985e-06 9 4.99998 9 4.99998Z" fill="#43c6ac"/></svg>',wrapTrigger:!1,children:e.jsxRuntimeExports.jsx(e.$faa2e61a3361514f$export$6521433ed15a34db,{className:"sledge__SliderThumb"})})]})})},$=({currentPage:t,totalPage:s,totalResult:i,onChange:n})=>{const l=1===t,o=t===s;return e.jsxRuntimeExports.jsxs("div",{className:"sledge__pagination",children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"sledge__pagination-navigation",...l?{disabled:!0}:{onClick:()=>n(t-1)},children:e.jsxRuntimeExports.jsx(W,{width:16,height:16,color:"black"})}),e.jsxRuntimeExports.jsxs("span",{children:["Page ",t," of ",s," - total ",i," result"]}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"sledge__pagination-navigation",...o?{disabled:!0}:{onClick:()=>n(t+1)},children:e.jsxRuntimeExports.jsx(M,{width:16,height:16,color:"black"})})]})},A=({id:t,name:s,required:i,defaultValue:n,items:l,labelStyle:o={},onValueChange:r})=>e.jsxRuntimeExports.jsx("div",{className:"sledge__radio-group-wrapper",children:e.jsxRuntimeExports.jsx("form",{children:e.jsxRuntimeExports.jsx(e.$f99a8c78507165f7$export$be92b6f5f03c0fe9,{className:"sledge__radio-group-root","aria-label":"View density",defaultValue:n,id:t,name:s,required:i,onValueChange:r,children:l.map(((s,i)=>{const{label:n,value:l}=s;return e.jsxRuntimeExports.jsxs("div",{className:"sledge__radio-group-item-flex",children:[e.jsxRuntimeExports.jsx(e.$f99a8c78507165f7$export$6d08773d2e66f8f2,{className:"sledge__radio-group-item",value:l,id:`${t}${i}`,children:e.jsxRuntimeExports.jsx(e.$f99a8c78507165f7$export$adb584737d712b70,{className:"sledge__radio-group-indicator"})}),e.jsxRuntimeExports.jsx("label",{className:"sledge__radio-group-label",htmlFor:`${t}${i}`,style:o,children:n})]},i)}))})})}),k=({id:t,name:s,value:i,rgb:n,image:l,required:o,defaultChecked:r,onClick:d})=>{const a={...(null==l?void 0:l.length)?{backgroundImage:`url(${l})`}:{backgroundColor:n}};return e.jsxRuntimeExports.jsx("div",{className:"sledge__color-swatch-wrapper",children:e.jsxRuntimeExports.jsx(e.$e698a72e93240346$export$be92b6f5f03c0fe9,{className:"sledge__color-swatch-root",defaultChecked:r,id:t,name:s,value:i,required:o,onClick:d,style:a})})},I=({name:t,placeholder:s,required:i,defaultValue:n,items:l,labelStyle:o={},onValueChange:r})=>e.jsxRuntimeExports.jsx("div",{className:"sledge__select-wrapper",children:e.jsxRuntimeExports.jsxs(e.$cc7e05a45900e73f$export$be92b6f5f03c0fe9,{name:t,required:i,onValueChange:r,children:[e.jsxRuntimeExports.jsxs(e.$cc7e05a45900e73f$export$41fb9f06171c75f4,{className:"sledge__select-trigger",children:[e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$4c8d1a57a761ef94,{placeholder:s}),e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$f04a61298a47a40f,{className:"sledge__select-icon",children:e.jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.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"})})})]}),e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$602eac185826482c,{children:e.jsxRuntimeExports.jsxs(e.$cc7e05a45900e73f$export$7c6e2c02157bb7d2,{className:"sledge__select-content",children:[e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$2f60d3ec9ad468f2,{className:"sledge__select-scroll-button",children:e.jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.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"})})}),e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$d5c6c08dc2d3ca7,{className:"sledge__select-viewport",children:l.map(((t,s)=>{const{label:i,value:n}=t;return e.jsxRuntimeExports.jsx(T,{value:n,children:i},s)}))}),e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$bf1aedc3039c8d63,{className:"sledge__select-scroll-button",children:e.jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.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"})})})]})})]})}),T=t.forwardRef((({children:t,className:s="",...i},n)=>e.jsxRuntimeExports.jsxs(e.$cc7e05a45900e73f$export$6d08773d2e66f8f2,{className:`sledge__select-item ${s}`,...i,ref:n,children:[e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$d6e5bf9c43ea9319,{children:t}),e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$c3468e2714d175fa,{className:"sledge__select-item-indicator",children:e.jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.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"})})})]}))),P=({width:t,height:s,type:i,color:n})=>e.jsxRuntimeExports.jsx("span",{className:"sledge-icon__heart",children:"outline"===i?e.jsxRuntimeExports.jsx("svg",{width:t,height:s,id:"sledge-icon-heart-line",viewBox:"0 0 18 17",fill:n,children:e.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"})}):e.jsxRuntimeExports.jsx("svg",{width:t,height:s,id:"sledge-icon-heart-fill",viewBox:"0 0 18 17",fill:n,children:e.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"})})}),O=({width:t,height:s,color:i})=>e.jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-down",children:e.jsxRuntimeExports.jsx("svg",{width:t,height:s,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("g",{id:"Arrow - Down 2",children:e.jsxRuntimeExports.jsx("g",{id:"Iconly/Light-Outline/Arrow---Down-2",children:e.jsxRuntimeExports.jsx("g",{id:"Arrow---Down-2",children:e.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:i})})})})})}),W=({width:t,height:s,color:i})=>e.jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-left",children:e.jsxRuntimeExports.jsx("svg",{width:t,height:s,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.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:i})})}),M=({width:t,height:s,color:i})=>e.jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-right",children:e.jsxRuntimeExports.jsx("svg",{width:t,height:s,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.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:i})})}),F=({width:t,height:s,color:i})=>e.jsxRuntimeExports.jsx("span",{className:"sledge-icon__bag",children:e.jsxRuntimeExports.jsx("svg",{width:t,height:s,viewBox:"0 0 18 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("g",{id:"vuesax/bold/bag-2",children:e.jsxRuntimeExports.jsx("g",{id:"bag-2",children:e.jsxRuntimeExports.jsx("path",{id:"Vector",d:"M14.3711 6.04627C13.919 5.54693 13.2374 5.25677 12.2927 5.15555V4.64271C12.2927 3.71824 11.9013 2.82752 11.2131 2.20671C10.518 1.57241 9.6138 1.2755 8.67584 1.36322C7.06309 1.51842 5.70676 3.07719 5.70676 4.76417V5.15555C4.76205 5.25677 4.08051 5.54693 3.6284 6.04627C2.97385 6.77505 2.9941 7.74674 3.06833 8.42154L3.54068 12.1801C3.68238 13.496 4.21547 14.8455 7.11707 14.8455H10.8824C13.784 14.8455 14.3171 13.496 14.4588 12.1869L14.9312 8.41479C15.0054 7.74674 15.0189 6.77505 14.3711 6.04627ZM8.77031 2.30118C9.4451 2.24045 10.0862 2.44963 10.5855 2.90174C11.0781 3.34711 11.3548 3.98141 11.3548 4.64271V5.11506H6.64472V4.76417C6.64472 3.56304 7.63666 2.40915 8.77031 2.30118ZM6.58399 8.87365H6.57724C6.2061 8.87365 5.90245 8.56999 5.90245 8.19885C5.90245 7.82772 6.2061 7.52406 6.57724 7.52406C6.95512 7.52406 7.25878 7.82772 7.25878 8.19885C7.25878 8.56999 6.95512 8.87365 6.58399 8.87365ZM11.3075 8.87365H11.3008C10.9296 8.87365 10.626 8.56999 10.626 8.19885C10.626 7.82772 10.9296 7.52406 11.3008 7.52406C11.6787 7.52406 11.9823 7.82772 11.9823 8.19885C11.9823 8.56999 11.6787 8.87365 11.3075 8.87365Z",fill:i})})})})}),V=({width:t,height:s,color:i})=>e.jsxRuntimeExports.jsx("span",{className:"sledge-icon__close",children:e.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 20 20",focusable:"false","aria-hidden":"true",width:t,height:s,children:e.jsxRuntimeExports.jsx("path",{d:"m11.414 10 6.293-6.293a1 1 0 1 0-1.414-1.414l-6.293 6.293-6.293-6.293a1 1 0 0 0-1.414 1.414l6.293 6.293-6.293 6.293a1 1 0 1 0 1.414 1.414l6.293-6.293 6.293 6.293a.998.998 0 0 0 1.707-.707.999.999 0 0 0-.293-.707l-6.293-6.293z",fill:i})})}),B=({width:t,height:s,color:i})=>e.jsxRuntimeExports.jsx("span",{className:"sledge-icon__search",children:e.jsxRuntimeExports.jsx("svg",{width:t,height:s,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.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:i})})}),q=({width:t,height:s,color:i})=>e.jsxRuntimeExports.jsx("span",{className:"sledge-icon__message-add",children:e.jsxRuntimeExports.jsx("svg",{width:t,height:s,viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("g",{id:"vuesax/bold/message-add",children:e.jsxRuntimeExports.jsx("g",{id:"message-add",children:e.jsxRuntimeExports.jsx("path",{id:"Vector",d:"M11.1666 1.33301H5.83325C3.16659 1.33301 1.83325 2.66634 1.83325 5.33301V13.9997C1.83325 14.3663 2.13325 14.6663 2.49992 14.6663H11.1666C13.8333 14.6663 15.1666 13.333 15.1666 10.6663V5.33301C15.1666 2.66634 13.8333 1.33301 11.1666 1.33301ZM10.8333 8.49967H8.99992V10.333C8.99992 10.6063 8.77325 10.833 8.49992 10.833C8.22658 10.833 7.99992 10.6063 7.99992 10.333V8.49967H6.16658C5.89325 8.49967 5.66658 8.27301 5.66658 7.99967C5.66658 7.72634 5.89325 7.49967 6.16658 7.49967H7.99992V5.66634C7.99992 5.39301 8.22658 5.16634 8.49992 5.16634C8.77325 5.16634 8.99992 5.39301 8.99992 5.66634V7.49967H10.8333C11.1066 7.49967 11.3333 7.72634 11.3333 7.99967C11.3333 8.27301 11.1066 8.49967 10.8333 8.49967Z",fill:i})})})})}),z=({width:t,height:s,color:i})=>e.jsxRuntimeExports.jsx("span",{className:"sledge-icon__swap",children:e.jsxRuntimeExports.jsx("svg",{width:t,height:s,viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("g",{id:"Swap",children:e.jsxRuntimeExports.jsx("g",{id:"Iconly/Light-Outline/Swap",children:e.jsxRuntimeExports.jsx("g",{id:"Swap_2",children:e.jsxRuntimeExports.jsx("path",{id:"Combined-Shape",d:"M11.7263 3.864C11.9795 3.864 12.1887 4.0521 12.2218 4.29616L12.2263 4.364L12.2262 12.2307L14.0904 10.359C14.2852 10.1633 14.6018 10.1626 14.7975 10.3574C14.9754 10.5345 14.9922 10.8122 14.8474 11.0083L14.7991 11.0645L12.0806 13.7956C12.0642 13.8117 12.0476 13.8263 12.03 13.8398L12.0806 13.7956C12.0561 13.8203 12.0296 13.8418 12.0017 13.8603C11.992 13.8663 11.9819 13.8725 11.9715 13.8784C11.9619 13.8842 11.9522 13.8892 11.9423 13.894C11.9325 13.8983 11.9226 13.9027 11.9125 13.9067C11.8998 13.9122 11.8866 13.9168 11.8734 13.9209C11.8656 13.9229 11.8576 13.9252 11.8495 13.9272C11.8351 13.9312 11.8206 13.9342 11.8061 13.9365C11.7993 13.9373 11.7921 13.9383 11.7849 13.9391C11.7685 13.9414 11.7522 13.9425 11.7359 13.9428C11.7327 13.9425 11.7295 13.9425 11.7263 13.9425L11.7166 13.9428C11.7003 13.9425 11.684 13.9414 11.6678 13.9395L11.7263 13.9425C11.6991 13.9425 11.6724 13.9403 11.6463 13.9362C11.6319 13.9342 11.6174 13.9312 11.6031 13.9276C11.5955 13.9253 11.5879 13.9232 11.5804 13.9209C11.566 13.9169 11.5518 13.9118 11.5378 13.9061C11.5301 13.9026 11.5227 13.8994 11.5154 13.896C11.5038 13.891 11.4923 13.8851 11.4809 13.8787C11.4707 13.8725 11.4606 13.8663 11.4508 13.8598C11.4431 13.8552 11.4355 13.8499 11.428 13.8443L11.4227 13.8398C11.4051 13.8263 11.3884 13.8117 11.3728 13.7961L11.3719 13.7956L8.65336 11.0645C8.45855 10.8688 8.45928 10.5522 8.65499 10.3574C8.83292 10.1803 9.11073 10.1648 9.30613 10.3105L9.3621 10.359L11.2262 12.232L11.2263 4.364C11.2263 4.08786 11.4502 3.864 11.7263 3.864ZM5.10736 2.05497L5.1171 2.05469C5.13339 2.055 5.14967 2.05611 5.16588 2.058L5.10736 2.05497C5.1346 2.05497 5.16133 2.05714 5.18739 2.06133C5.20164 2.06328 5.21594 2.06623 5.23012 2.0698C5.23846 2.07225 5.24696 2.07463 5.25536 2.07723C5.26849 2.08093 5.2812 2.08543 5.29374 2.09046C5.30281 2.0945 5.31199 2.09851 5.32103 2.10279C5.33176 2.10743 5.34234 2.11289 5.35274 2.11876C5.36166 2.12425 5.37048 2.12959 5.37912 2.1352C5.38801 2.14048 5.39691 2.14667 5.40565 2.15318L5.4618 2.20186L8.18032 4.93297C8.37513 5.12868 8.3744 5.44527 8.17869 5.64008C8.00077 5.81718 7.72295 5.83267 7.52755 5.68698L7.47158 5.63844L5.60692 3.76469L5.60736 11.6335C5.60736 11.9096 5.3835 12.1335 5.10736 12.1335C4.85423 12.1335 4.64503 11.9454 4.61192 11.7013L4.60736 11.6335L4.60692 3.76535L2.74329 5.63844C2.56618 5.81636 2.28845 5.83314 2.09237 5.68836L2.03618 5.64008C1.85826 5.46298 1.84148 5.18524 1.98626 4.98916L2.03455 4.93297L4.75306 2.20186L4.78251 2.17486C4.78942 2.16895 4.7965 2.16322 4.80373 2.15768L4.75306 2.20186C4.77759 2.17722 4.80405 2.15567 4.83195 2.13721C4.84168 2.13115 4.8518 2.12496 4.86214 2.11912C4.87175 2.11333 4.88152 2.10825 4.8914 2.10352C4.90117 2.0992 4.91107 2.09484 4.92114 2.09079C4.93393 2.08533 4.94704 2.0807 4.9603 2.07663C4.96836 2.07446 4.97662 2.07215 4.98496 2.07006C4.99839 2.06637 5.01197 2.06355 5.02562 2.06129C5.03383 2.06027 5.04188 2.05915 5.04999 2.05822C5.06542 2.0561 5.08126 2.05503 5.0971 2.0547C5.1006 2.055 5.10398 2.05497 5.10736 2.05497Z",fill:i})})})})})}),U=({width:t,height:s,color:i})=>e.jsxRuntimeExports.jsx("span",{className:"sledge-icon__note",children:e.jsxRuntimeExports.jsx("svg",{width:t,height:s,viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsxs("g",{id:"vuesax/bold/note-2",children:[e.jsxRuntimeExports.jsx("path",{id:"Vector",d:"M8.95178 13.3046C9.13494 13.3473 9.15172 13.5871 8.97332 13.6466L7.91998 13.9933C5.27332 14.8466 3.87998 14.1333 3.01998 11.4866L2.16665 8.85328C1.31332 6.20661 2.01998 4.80661 4.66665 3.95328L4.67731 3.94975C5.08018 3.81633 5.48102 4.22359 5.37901 4.63553C5.37264 4.66126 5.3663 4.68718 5.35998 4.71328L4.70665 7.50661C3.97332 10.6466 5.04665 12.3799 8.18665 13.1266L8.95178 13.3046Z",fill:i}),e.jsxRuntimeExports.jsx("path",{id:"Vector_2",d:"M11.9467 2.14033L10.8334 1.88033C8.6067 1.35366 7.28004 1.787 6.50004 3.40033C6.30004 3.807 6.14004 4.30033 6.00671 4.867L5.35337 7.66033C4.70004 10.447 5.56004 11.8203 8.34004 12.4803L9.46004 12.747C9.8467 12.8403 10.2067 12.9003 10.54 12.927C12.62 13.127 13.7267 12.1537 14.2867 9.747L14.94 6.96033C15.5934 4.17366 14.74 2.79366 11.9467 2.14033ZM10.6934 8.887C10.6334 9.11366 10.4334 9.26033 10.2067 9.26033C10.1667 9.26033 10.1267 9.25366 10.08 9.247L8.14004 8.75366C7.87337 8.687 7.71337 8.41366 7.78004 8.147C7.84671 7.88033 8.12004 7.72033 8.38671 7.787L10.3267 8.28033C10.6 8.347 10.76 8.62033 10.6934 8.887ZM12.6467 6.63366C12.5867 6.86033 12.3867 7.007 12.16 7.007C12.12 7.007 12.08 7.00033 12.0334 6.99366L8.80004 6.17366C8.53337 6.107 8.37337 5.83366 8.44004 5.567C8.50671 5.30033 8.78004 5.14033 9.04671 5.207L12.28 6.027C12.5534 6.087 12.7134 6.36033 12.6467 6.63366Z",fill:i})]})})}),H=t.forwardRef(((t,s)=>{const{className:i="",children:n,colorType:l="light",fullWidth:o=!1,elementType:r="button",link:d="",...a}=t;return"hyperlink"===r&&(null==d?void 0:d.length)?e.jsxRuntimeExports.jsx("a",{href:d,className:`sledge__button ${i||""}`,"data-button-color-type":l,"data-button-full-width":o,ref:s,...a,children:n}):e.jsxRuntimeExports.jsx("button",{className:`sledge__button ${i||""}`,"data-button-color-type":l,"data-button-full-width":o,ref:s,...a,children:n})})),J=s=>{const{className:i="",icon:n,value:l="",withClearField:o,onChange:r,onResetField:d,fieldRef:a,...u}=s,[c,x]=t.useState(!1);return t.useEffect((()=>{x(Boolean(l))}),[l]),e.jsxRuntimeExports.jsxs("div",{className:`sledge__search-input-field-wrapper ${i||""}`,children:[n?e.jsxRuntimeExports.jsx("div",{className:"sledge__search-input-field-icon",children:n}):null,e.jsxRuntimeExports.jsx("input",{className:"sledge__search-input-field",value:l,onChange:e=>(e=>{r&&r({value:e.target.value})})(e),ref:a,...u}),c&&o?e.jsxRuntimeExports.jsx("div",{className:"sledge__clear-field-wrapper",children:e.jsxRuntimeExports.jsx("button",{className:"sledge__clear-field",type:"button",onClick:()=>{(null==a?void 0:a.current)&&a.current.focus(),r&&r({value:""}),d&&d()},children:e.jsxRuntimeExports.jsx(V,{width:14,height:14,color:"#393d4e"})})}):null]})},D={open:{rotate:180},closed:{rotate:0},transition:{type:"spring",duration:.2}},G={hidden:{opacity:0,scale:0},visible:e=>{const{duration:t}=e||{};return{opacity:1,scale:1,transition:{type:"spring",duration:t||.7}}}},Z=s=>{var i;const{className:n="",placeholder:l=null,prefixLabel:o=null,prefixSelectedLabel:r="",align:d="end",onChange:a,value:u="",options:c=[],LinkComponent:x,link:m}=s,[p,h]=t.useState(!1),g=(null==(i=null==c?void 0:c.filter((({value:e})=>e===u))[0])?void 0:i.label)||l;return e.jsxRuntimeExports.jsx("div",{className:`sledge__select-field-wrapper ${n||""}`,children:e.jsxRuntimeExports.jsx(b,{trigger:e.jsxRuntimeExports.jsxs("button",{type:"button",className:"sledge__button sledge__select-field","data-button-color-type":"light","data-button-full-width":"true",children:[o?e.jsxRuntimeExports.jsx("span",{className:"sledge__select-field-icon",children:o}):null,e.jsxRuntimeExports.jsx("span",{children:(null==r?void 0:r.length)?`${r} ${g}`:g}),e.jsxRuntimeExports.jsx(e.motion.div,{initial:"closed",animate:p?"open":"closed",variants:D,className:"sort-trigger-icon",children:e.jsxRuntimeExports.jsx(O,{width:18,height:18,color:"#000000"})})]}),content:e.jsxRuntimeExports.jsx("ul",{className:"sledge__select-field-option",children:null==c?void 0:c.map(((t,s)=>{const{label:i,value:n}=t,l=()=>e.jsxRuntimeExports.jsx("li",{onClick:()=>((e,t)=>{a&&a({label:e,value:t}),h(!1)})(i,n),...n===u&&{"data-selected":!0},children:i},s);return x?e.jsxRuntimeExports.jsx(x,{scroll:!1,to:null==m?void 0:m.replace("value",n),href:null==m?void 0:m.replace("value",n),children:e.jsxRuntimeExports.jsx(l,{})},s):e.jsxRuntimeExports.jsx(l,{},s)}))}),isOpen:p,setIsOpen:h,hideCloseIcon:!0,align:d,className:"sledge__select-field-option-content",withArrow:!1})})},K=({children:s})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:t.Children.count(s)&&t.Children.map(s,(e=>t.cloneElement(e,{})))});K.Root=n=>{const{children:l,useProxyUrl:o=!1,data:r}=n,{isRenderApp:a,triggerRenderMultipleComponent:u}=t.useContext(s.SledgeContext),{wishlist:x}=a||{},[m,p]=t.useState((null==r?void 0:r.total_data)||0),[h,g]=t.useState(!r),[j,v]=t.useState(!r),[_,w]=t.useState(!1),[f,R]=t.useState((null==r?void 0:r.proxy_url)||""),[E,y]=t.useState({}),b=async()=>{var e,t,s;let n,l,o,r=!1;n=await(async e=>{let t=e||"undefined"!=typeof localStorage&&localStorage.getItem(d)||"",s=`${i}/wishlist/info`;return await C({url:s,method:"GET",authorization:t}).then((e=>e)).catch((()=>{}))})(),r=200===(null==(e=null==n?void 0:n.status)?void 0:e.code)||!1,l=(null==(t=null==n?void 0:n.data)?void 0:t.total_data)?n.data.total_data:0,o=(null==(s=null==n?void 0:n.data)?void 0:s.proxy_url)||"",r&&(p(l),w(l>99),R(o),g(!1),v(!1))};return t.useEffect((()=>{x&&(async e=>{let t;t=JSON.parse(e),t&&(y(t),await b())})(localStorage.getItem(c)||null)}),[x,u]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:t.Children.count(l)&&t.Children.map(l,(e=>t.cloneElement(e,{isFirstLoading:h,isLoading:j,totalWishlist:m,isMaximizeTotalWishlist:_,proxyUrl:f,dataSettings:E,useProxyUrl:o})))})},K.HeaderMenu=i=>{var n;const{sledgeAnonymId:l}=t.useContext(s.SledgeContext),{isFirstLoading:o,isLoading:r,totalWishlist:d,isMaximizeTotalWishlist:a,proxyUrl:u,dataSettings:c,useProxyUrl:x}=i||{},{is_required_login:m}=(null==(n=null==c?void 0:c.display)?void 0:n.global)||{},p="#000000",[h,g]=t.useState(p),[j,v]=t.useState(!1);t.useEffect((()=>{v(l&&m)}),[l]);return e.jsxRuntimeExports.jsxs("span",{className:"sledge-wishlist__badge",onClick:e=>{j&&(e.preventDefault(),e.stopPropagation()),j?"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"}):x&&(window.location.href=u||"/")},onMouseEnter:()=>g("#F85538"),onMouseLeave:()=>g(p),children:[e.jsxRuntimeExports.jsx(P,{width:20,height:20,type:"outline",color:h}),!o&&e.jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-header-menu "+(a?"sledge-wishlist__badge-fit-content":""),children:r||j?0:`${a?"99+":d}`||0})]})},K.FloatingFull=i=>{var n;const{sledgeAnonymId:l}=t.useContext(s.SledgeContext),{isFirstLoading:o,isLoading:r,totalWishlist:d,isMaximizeTotalWishlist:a,proxyUrl:u,position:c="left",dataSettings:x,useProxyUrl:m}=i||{},{is_required_login:p}=(null==(n=null==x?void 0:x.display)?void 0:n.global)||{},[h,g]=t.useState(!1);t.useEffect((()=>{g(l&&p)}),[l]);return e.jsxRuntimeExports.jsx("div",{className:`sledge-wishlist__badge-floating sledge-wishlist__badge-floating-${c}`,children:e.jsxRuntimeExports.jsxs("span",{onClick:e=>{h&&(e.preventDefault(),e.stopPropagation()),h?"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"}):m&&(window.location.href=u||"/")},className:"sledge-wishlist__badge-floating-icon-link",children:[e.jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-floating-text",children:"My Wishlist"}),e.jsxRuntimeExports.jsxs("span",{className:"sledge-wishlist__badge-icon",children:[e.jsxRuntimeExports.jsx(P,{width:18,height:18,type:"fill",color:"#000000"}),!o&&e.jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-bottom-right "+(a?"sledge-wishlist__badge-fit-content":""),children:r||h?0:`${a?"99+":d}`||0})]})]})})},K.FloatingIcon=i=>{var n;const{sledgeAnonymId:l}=t.useContext(s.SledgeContext),{isFirstLoading:o,isLoading:r,totalWishlist:d,isMaximizeTotalWishlist:a,proxyUrl:u,position:c="bottom-right",dataSettings:x,useProxyUrl:m}=i||{},{is_required_login:p}=(null==(n=null==x?void 0:x.display)?void 0:n.global)||{},[h,g]=t.useState(!1);t.useEffect((()=>{g(l&&p)}),[l]);return e.jsxRuntimeExports.jsx("div",{className:`sledge-wishlist__badge-floating-icon sledge-wishlist__badge-floating-${c}`,children:e.jsxRuntimeExports.jsx("span",{onClick:e=>{h&&(e.preventDefault(),e.stopPropagation()),h?"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"}):m&&(window.location.href=u||"/")},className:"sledge-wishlist__badge-floating-icon-link",children:e.jsxRuntimeExports.jsxs("span",{className:"sledge-wishlist__badge-icon",children:[e.jsxRuntimeExports.jsx(P,{width:27.01,height:25.73,type:"outline",color:"#000000"}),!o&&e.jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-bottom-right "+(a?"sledge-wishlist__badge-fit-content":""),children:r||h?0:`${a?"99+":d}`||0})]})})})};const Y=(i=!1)=>{const n=JSON.parse(localStorage.getItem(c)||"");if(!n)return;const{floating_button_type:d}=(null==n?void 0:n.launch_point)||{},a=String(d).includes("bottom");if("none"!==d)if(a){let i=document.createElement("div");if(i.setAttribute(l,h.ELEMENT_BADGE_FLOATING_ICON),document.body.appendChild(i),i){i.innerHTML="";const n=i.getAttribute(o.USE_PROXY_URL);e.client.createRoot(i).render(e.jsxRuntimeExports.jsx(t.StrictMode,{children:e.jsxRuntimeExports.jsx(s.SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(r)||"",isJsVersion:!0},children:e.jsxRuntimeExports.jsx(K.Root,{useProxyUrl:Boolean(n&&"true"===n),children:e.jsxRuntimeExports.jsx(K.FloatingIcon,{position:d})})})}))}}else{let i=document.createElement("div");if(i.setAttribute(l,h.ELEMENT_BADGE_FLOATING_FULL),document.body.appendChild(i),i){i.innerHTML="";const n=i.getAttribute(o.USE_PROXY_URL);e.client.createRoot(i).render(e.jsxRuntimeExports.jsx(t.StrictMode,{children:e.jsxRuntimeExports.jsx(s.SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(r)||"",isJsVersion:!0},children:e.jsxRuntimeExports.jsx(K.Root,{useProxyUrl:Boolean(n&&"true"===n),children:e.jsxRuntimeExports.jsx(K.FloatingFull,{position:d})})})}))}}else{let n=Array.from(document.querySelectorAll(g.WISHLIST.ELEMENT_BADGE));(e=>{const{element:t,init:s,reRender:i=!1}=e;let n=!1;i?t&&s():document.body.addEventListener("DOMNodeInserted",(()=>{!n&&t&&(n=!0,s())}))})({element:n,init:()=>{n.length&&n.map((i=>{if(i){const n=i.getAttribute(o.USE_PROXY_URL);i.querySelector(`[${l}="${p}"]`)&&i.querySelector(`[${l}="${p}"]`).remove();let d=document.createElement("div");d.setAttribute(l,p),i.appendChild(d),e.client.createRoot(d).render(e.jsxRuntimeExports.jsx(t.StrictMode,{children:e.jsxRuntimeExports.jsx(s.SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(r)||"",isJsVersion:!0},children:e.jsxRuntimeExports.jsx(K.Root,{useProxyUrl:Boolean(n&&"true"===n),children:e.jsxRuntimeExports.jsx(K.HeaderMenu,{})})})}))}}))},reRender:i})}},X=n=>{var l,o,r;const{params:a,forceActive:u=!1,hidden:x=!1,onAfterAddWishlist:m,onAfterRemoveWishlist:p,wishlistChecked:h}=n,{productId:g,productVariantId:j}=a||{},{isRenderApp:v,triggerRenderMultipleComponent:_,sledgeAnonymId:w}=t.useContext(s.SledgeContext),{wishlist:R}=v||{},E="#767676",y="outline",b="#F85538",S="fill",N="boolean"==typeof h,L=!!N&&h,[$,A]=t.useState(L?b:E),[k,I]=t.useState(L?S:y),[T,O]=t.useState(!!h),[W,M]=t.useState(!N),[F,V]=t.useState({}),[B,q]=t.useState({onAfterAddWishlist:m,onAfterRemoveWishlist:p}),[z,U]=t.useState(!1),[H,J]=t.useState(!0),{is_required_login:D}=(null==(l=null==F?void 0:F.display)?void 0:l.global)||{},{show:G,location:Z}=(null==(o=null==F?void 0:F.display)?void 0:o.notification)||{},{title_added_to_wishlist:K,text_added_to_wishlist:X,title_removed_to_wishlist:Q,text_removed_to_wishlist:ee}=(null==(r=null==F?void 0:F.languages)?void 0:r.notification)||{},te=async()=>{let e;"boolean"==typeof h&&H?(e=h,J(!1)):e=await(async(e,t)=>{let s=f(e),n=t?f(t):"",l="undefined"!=typeof localStorage&&localStorage.getItem(d)||"",o="?"+new URLSearchParams({variant_id:n}).toString(),r=`${i}/wishlist/check/${s}${o}`;return await C({url:r,method:"GET",authorization:l}).then((e=>Boolean(e.data))).catch((()=>{}))})(g,j),O(u||e)},se=async t=>{var s,n,l,o,r,u;if(t.preventDefault(),t.stopPropagation(),z)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"}));O(!T);let c=await(async e=>{const{productId:t,productVariantId:s,productName:n,productVendor:l,productSku:o,productVariantName:r,productLink:a,productImage:u,productCurrency:c,productPrice:x}=e;let m="undefined"!=typeof localStorage&&localStorage.getItem(d)||"",p=`${i}/wishlist`,h={product:JSON.stringify({id:f(t),variant_id:f(s),name:n,vendor:l,sku:o,variant_name:r,url:a,image_url:u,currency:c,price:x})};return await C({url:p,method:"POST",authorization:m,payload:h}).then((e=>e)).catch((()=>{}))})(a);const{status:x,data:m}=c||{},{code:p}=x||{};200===p?((null==(n=null==(s=null==_?void 0:_.wishlist)?void 0:s.badge)?void 0:n.trigger)&&"boolean"!=typeof h&&(null==(u=null==(l=null==_?void 0:_.wishlist)?void 0:l.badge)||u.trigger(!(null==(r=null==(o=null==_?void 0:_.wishlist)?void 0:o.badge)?void 0:r.value))),Y(!0),"undefined"!=typeof window&&(window.sledgeWishlistWidgetListUpdate&&window.sledgeWishlistWidgetListUpdate(),window.sledgeWishlistButtonDetailUpdate&&window.sledgeWishlistButtonDetailUpdate()),te(),T?B.onAfterRemoveWishlist&&B.onAfterRemoveWishlist("success"):B.onAfterAddWishlist&&B.onAfterAddWishlist("success"),"undefined"!=typeof window&&window.sledgeToastNotification&&G&&window.sledgeToastNotification({title:T?Q:K,message:T?ee:X,location:Z,type:"success",icon:e.jsxRuntimeExports.jsx(P,{width:40,height:40,color:"black",type:"outline"})})):(T?B.onAfterRemoveWishlist&&B.onAfterRemoveWishlist("failed"):B.onAfterAddWishlist&&B.onAfterAddWishlist("failed"),"undefined"!=typeof window&&window.sledgeToastNotification&&G&&window.sledgeToastNotification({title:"Failed",message:"failed add to wishlist",location:Z,type:"failed",icon:e.jsxRuntimeExports.jsx(P,{width:40,height:40,color:"black",type:"outline"})}))};t.useEffect((()=>{R&&("undefined"!=typeof window&&(window.sledgeWishlistTriggerUpdate=()=>{te()}),(async e=>{let t;M(!0),t=JSON.parse(e),t&&(V(t),M(!1))})(localStorage.getItem(c)||null))}),[R]),t.useEffect((()=>{U(w&&D)}),[w]),t.useEffect((()=>{R&&te()}),[R,j]);const ie=(T||u)&&!z;return t.useEffect((()=>{ie?(A(b),I(S)):(A(E),I(y))}),[T]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!W&&!x&&e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__trigger-block",children:e.jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__trigger",onClick:e=>se(e),onMouseEnter:()=>{ie||(A(b),I(S))},onMouseLeave:()=>{ie||(A(E),I(y))},children:e.jsxRuntimeExports.jsx(P,{width:16.67,height:15.83,type:k,color:$})})})})},Q=({isFirstLoading:s,...i})=>e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header",children:s?e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"8px",width:"100%",justifyContent:"space-between"},children:[e.jsxRuntimeExports.jsx(je.Item,{width:"190px",height:"46px",color:"lighten",rounded:"md"}),e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"8px"},children:[e.jsxRuntimeExports.jsx(je.Item,{width:"440px",height:"46px",color:"lighten",rounded:"md"}),e.jsxRuntimeExports.jsx(je.Item,{width:"132px",height:"46px",color:"lighten",rounded:"md"}),e.jsxRuntimeExports.jsx(je.Item,{width:"136px",height:"46px",color:"lighten",rounded:"md"})]}),e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"26px"},children:[e.jsxRuntimeExports.jsx(je.Item,{width:"190px",height:"46px",color:"lighten",rounded:"md"}),e.jsxRuntimeExports.jsx(je.Item,{width:"190px",height:"46px",color:"lighten",rounded:"md"})]})]}):t.Children.count(i.children)&&t.Children.map(i.children,(e=>t.cloneElement(e,{...i})))});Q.Title=({text:t,dataSettings:s})=>{var i,n,l;const{color:o,font_size:r,font_weight:d,text_transform:a}=(null==(n=null==(i=null==s?void 0:s.display)?void 0:i.widget)?void 0:n.header_title)||{},{header_title:u}=(null==(l=null==s?void 0:s.languages)?void 0:l.widget)||{},c={...o&&{color:o},...r&&{fontSize:r},...d&&{fontWeight:d},...a&&{textTransform:a}};return e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:e.jsxRuntimeExports.jsx("h1",{style:c,children:t||(u||"My Wishlist")})})},Q.SearchForm=({setIsLoading:i,setKeyword:n,keyword:l,placeholder:o,dataSettings:r})=>{var d,a;const{sledgeAnonymId:u}=t.useContext(s.SledgeContext),{is_required_login:c}=(null==(d=null==r?void 0:r.display)?void 0:d.global)||{},{search_form_placeholder:x}=(null==(a=null==r?void 0:r.languages)?void 0:a.widget)||{},[m,p]=t.useState(!1),h=t.useRef(null);return t.useEffect((()=>{p(u&&c)}),[u]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!m&&e.jsxRuntimeExports.jsx(J,{type:"text",icon:e.jsxRuntimeExports.jsx(B,{width:18,height:18,color:"#868686"}),placeholder:o||(x||"Search product..."),value:l,fieldRef:h,onChange:({value:e})=>(e=>{n&&n(e)})(e),onResetField:()=>{var e;i&&i(!0),n&&n(""),null==(e=null==h?void 0:h.current)||e.focus()},className:"sledge-wishlist__widget-header-item sledge-wishlist__widget-search-form",withClearField:!0})})},Q.ShareTrigger=({wishlistData:n,buttonText:l,showShareTrigger:o,shareLink:r,shareId:a,dataSettings:u,isFirstLoading:c})=>{var x,m,p,h,g,j;const{triggerRenderMultipleComponent:v,sledgeAnonymId:_}=t.useContext(s.SledgeContext),{is_required_login:w}=(null==(x=null==u?void 0:u.display)?void 0:x.global)||{},{text_color:R,border_color:E,border_radius:y,padding_top:b,padding_bottom:S,padding_left:N,padding_right:L,background_color:$,font_size:A,font_weight:k,text_transform:I}=(null==(p=null==(m=null==u?void 0:u.display)?void 0:m.widget)?void 0:p.button_share)||{},{title_share_wishlist:T}=(null==(h=null==u?void 0:u.languages)?void 0:h.popup)||{},{button_share:P}=(null==(g=null==u?void 0:u.languages)?void 0:g.widget)||{},{title_added_all_to_wishlist:O,text_added_all_to_wishlist:W}=(null==(j=null==u?void 0:u.languages)?void 0:j.notification)||{},[M,F]=t.useState(!1),V={...R&&{color:R},...E&&{borderColor:E},...y&&{borderRadius:y},...b&&{paddingTop:b},...S&&{paddingBottom:S},...N&&{paddingLeft:N},...L&&{paddingRight:L},...$&&{backgroundColor:$},...A&&{fontSize:A},...k&&{fontWeight:k},...I&&{textTransform:I}},[B,q]=t.useState(!1);let z='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g id="vuesax/linear/copy">\n <g id="copy">\n <path id="Vector" d="M16 12.9V17.1C16 20.6 14.6 22 11.1 22H6.9C3.4 22 2 20.6 2 17.1V12.9C2 9.4 3.4 8 6.9 8H11.1C14.6 8 16 9.4 16 12.9Z" stroke="#767676" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path id="Vector_2" d="M22 6.9V11.1C22 14.6 20.6 16 17.1 16H16V12.9C16 9.4 14.6 8 11.1 8H8V6.9C8 3.4 9.4 2 12.9 2H17.1C20.6 2 22 3.4 22 6.9Z" stroke="#767676" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n </g>\n </g>\n </svg>\n ';const U=async()=>{var e,t,s,l,o,r,a;q(!0);let u=n.map((e=>{const{id:t,variant_id:s,name:i,variant_name:n,url:l,image_url:o,currency:r,price:d}=e.product;return{productId:t,productVariantId:s,productName:i,productVariantName:n,productLink:l,productImage:o,productCurrency:r,productPrice:d}})),c=await(async e=>{let t="undefined"!=typeof localStorage&&localStorage.getItem(d)||"",s=e.map((e=>{const{productId:t,productVariantId:s,productName:i,productVariantName:n,productLink:l,productImage:o,productCurrency:r,productPrice:d}=e;return{id:f(t),variant_id:f(s),name:i,variant_name:n,url:l,image_url:o,currency:r,price:d}})),n=`${i}/wishlist/bulk`,l={products:s};return await C({url:n,method:"POST",authorization:t,payload:l,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))})(u);200===(null==(e=null==c?void 0:c.status)?void 0:e.code)?("undefined"!=typeof window&&((null==(s=null==(t=null==v?void 0:v.wishlist)?void 0:t.badge)?void 0:s.trigger)&&(null==(a=null==(l=null==v?void 0:v.wishlist)?void 0:l.badge)||a.trigger(!(null==(r=null==(o=null==v?void 0:v.wishlist)?void 0:o.badge)?void 0:r.value))),Y(),window.sledgeInfoPopup&&window.sledgeInfoPopup({title:O,message:W,textCancel:"Cancel"})),q(!1)):"undefined"!=typeof window&&window.sledgeInfoPopup&&window.sledgeInfoPopup({title:"Failed",message:"Failed add to wishlist, please try again",textCancel:"Cancel"})};return t.useEffect((()=>{F(_&&w)}),[_]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!M&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:o&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:c?e.jsxRuntimeExports.jsx(je.Item,{width:"136px",height:"46px",color:"lighten",rounded:"md"}):e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item sledge-wishlist__widget-header-share-trigger",children:e.jsxRuntimeExports.jsx(H,{type:"button",style:V,...a&&!n.length||B?{disabled:!0}:{onClick:async()=>{a&&n.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>${n.length}</strong> item to your wishlist page.`,textSubmit:"Add to your wishlist",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:U||{}}):"undefined"!=typeof window&&window.sledgeInfoPopup&&(window.sledgeInfoPopup({title:T,message:r?`<div class="sledge-wishlist__widget-box-copy">\n <div class="sledge-wishlist__widget-box-copy-icon" title="Copy to clipboard">\n ${z}\n </div>\n <div class="sledge-wishlist__widget-box-copy-content">${r}</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=z)}),2500)))}))}}))})())}},children:a?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-top-right",children:n.length}),B?"Adding...":"Add to your wishlist"]}):l||(P||"Share Wishlist")})})})})})},Q.ClearTrigger=({buttonText:i,shareId:n,dataSettings:l,isFirstLoading:o})=>{var r,d,a,u,c;const{sledgeAnonymId:x}=t.useContext(s.SledgeContext),{is_required_login:m}=(null==(r=null==l?void 0:l.display)?void 0:r.global)||{},{text_color:p,border_color:h,border_radius:g,padding_top:j,padding_bottom:v,padding_left:_,padding_right:w,background_color:f,font_size:R,font_weight:E,text_transform:C}=(null==(a=null==(d=null==l?void 0:l.display)?void 0:d.widget)?void 0:a.button_clear_all)||{},{title_confirm_clear_all_wishlist:y,text_confirm_clear_all_wishlist:b,button_submit_confirm_clear_all_wishlist:S,button_cancel_confirm_clear_all_wishlist:N}=(null==(u=null==l?void 0:l.languages)?void 0:u.popup)||{},{button_clear_all:L}=(null==(c=null==l?void 0:l.languages)?void 0:c.widget)||{},[$,A]=t.useState(!1),k={...p&&{color:p},...h&&{borderColor:h},...g&&{borderRadius:g},...j&&{paddingTop:j},...v&&{paddingBottom:v},..._&&{paddingLeft:_},...w&&{paddingRight:w},...f&&{backgroundColor:f},...R&&{fontSize:R},...E&&{fontWeight:E},...C&&{textTransform:C}};t.useEffect((()=>{A(x&&m)}),[x]);return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!$&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!n&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:o?e.jsxRuntimeExports.jsx(je.Item,{width:"132px",height:"46px",color:"lighten",rounded:"md"}):e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:e.jsxRuntimeExports.jsx(H,{type:"button",colorType:"danger",onClick:()=>{"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:y,message:b,textSubmit:S,textCancel:N,buttonSubmitType:"danger",onSubmit:window.sledgeWishlistWidgetClearList||{}})},style:k,children:i||(L||"Clear Wishlist")})})})})})},Q.Sort=({wishlistSort:i,selectedSort:n,setSelectedSort:l,setIsRefreshWidgetList:o,dataSettings:r})=>{var d,a;const{sledgeAnonymId:u}=t.useContext(s.SledgeContext),{is_required_login:c}=(null==(d=null==r?void 0:r.display)?void 0:d.global)||{},[x,m]=t.useState(!1);return t.useEffect((()=>{m(u&&c)}),[u]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:x?null:e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:i&&Boolean(null==i?void 0:i.length)&&e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:e.jsxRuntimeExports.jsx(Z,{align:"end",options:i.map((e=>{const{name:t,value:s}=e;return{label:t,value:s}})),value:n||(null==(a=i[0])?void 0:a.value),onChange:({value:e})=>(e=>{l&&l(e),o&&o(!0)})(e)})})})})},Q.Limit=({options:i,defaultLimitOptions:n,selectedLimit:l,setSelectedLimit:o,setIsRefreshWidgetList:r,dataSettings:d})=>{var a;const{sledgeAnonymId:u}=t.useContext(s.SledgeContext),{is_required_login:c}=(null==(a=null==d?void 0:d.display)?void 0:a.global)||{},[x,m]=t.useState(!1);let p=i||n;return t.useEffect((()=>{m(u&&c)}),[u]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:x?null:e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:p&&Boolean(null==p?void 0:p.length)&&e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:e.jsxRuntimeExports.jsx(Z,{align:"end",options:p.map((e=>({label:e,value:e}))),value:l||p[0],onChange:({value:e})=>(e=>{o&&o(e),r&&r(!0)})(e)})})})})};const ee=e=>{const s=t.useRef();return t.useEffect((()=>{s.current=e})),s.current},te=async e=>{let t=f(e),s="undefined"!=typeof localStorage&&localStorage.getItem(d)||"",n=`${i}/review/info/${t}?${_.Authorization}=${s}`;return await C({url:n,method:"GET",authorization:s,isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},se=i=>{var n,l;const{total:o,average:r,size:d="sm",params:a,withSkeletonLoading:u=!0,withTotal:c=!0,isScrollToElementWidget:m=!0,data:p,sledgeSettings:h}=i,{productId:g}=a||{},{isRenderApp:j,triggerRenderMultipleComponent:_}=t.useContext(s.SledgeContext),{productReview:w}=j||{},f=!p&&void 0===o&&void 0===r,[R,C]=t.useState(f),[y,b]=t.useState(f),[S,N]=t.useState(p||void 0!==o||void 0!==r?ie(d):{width:0,height:0}),[L,$]=t.useState((null==p?void 0:p.review_count)||o||0),[A,k]=t.useState((null==(n=null==p?void 0:p.rating)?void 0:n.average)||r||"0"),[I,T]=t.useState((null==h?void 0:h.review)||{}),[P,O]=t.useState(!0),W=ee({productId:g}),{fill_color:M,outline_color:F}=(null==(l=null==I?void 0:I.display)?void 0:l.rating)||{},V=async(e,t=!1)=>{var s,i,n,l,o,r,d;if(e!==g)return;let a,u,c,x=!1,m=0;if(p&&P)c=p,x=!0,O(!1);else{if(a=await te(e),!a)return;const{status:t}=a;c=a.data;const{code:s}=t;x=200===s||!1}m=(null==c?void 0:c.review_count)?c.review_count:0,u=(null==(s=null==c?void 0:c.rating)?void 0:s.average)?c.rating.average:0,x&&($(m),k(u),b(!1),C(!1),t&&(null==(n=null==(i=null==_?void 0:_.productReview)?void 0:i.rating)?void 0:n.value)&&(null==(o=null==(l=null==_?void 0:_.productReview)?void 0:l.rating)?void 0:o.trigger)&&(null==(d=null==(r=null==_?void 0:_.productReview)?void 0:r.rating)||d.trigger("")))},B=async e=>{let t;b(!0),t=JSON.parse(e),t&&(T(t),await(async()=>{void 0!==o||void 0!==r?b(!1):V(g)})())};return t.useEffect((()=>{if(!w)return;N("xs"===d?{width:14.4,height:14.4}:"sm"===d?{width:18,height:18}:{width:28.8,height:28.8}),Boolean(W&&(null==W?void 0:W.productId)!==g)&&C(!0),B(localStorage.getItem(x)||null)}),[w,g]),t.useEffect((()=>{var e,t,s,i;!g||g&&(null==(t=null==(e=null==_?void 0:_.productReview)?void 0:e.rating)?void 0:t.value)!==g||(C(!0),V(null==(i=null==(s=null==_?void 0:_.productReview)?void 0:s.rating)?void 0:i.value,!0))}),[g,_]),e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__rating",onClick:()=>{m&&setTimeout((()=>{E({element:document.getElementById(v.ELEMENT_WIDGET),headerOffset:50})}),200)},children:R&&u?e.jsxRuntimeExports.jsx(je.Item,{width:"230px",height:"28px",color:"lighten",rounded:"md"}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",style:{display:"none"},id:"sledge-product-review-rating-icon-svg-store",children:[e.jsxRuntimeExports.jsx("symbol",{id:"sledge-product-review-icons-rating-icon-fill",viewBox:"0 0 30 29",fill:M||"#43c6ac",children:e.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"})}),e.jsxRuntimeExports.jsx("symbol",{id:"sledge-product-review-icons-rating-icon-line",viewBox:"0 0 30 29",stroke:F||"#8D9196",fill:"none",children:e.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"})}),e.jsxRuntimeExports.jsx("defs",{children:e.jsxRuntimeExports.jsxs("g",{id:"sledge-product-review-icons-rating-icon",children:[e.jsxRuntimeExports.jsx("use",{href:"#sledge-product-review-icons-rating-icon-line",className:"sledge-product-review__rating-icon-line"}),e.jsxRuntimeExports.jsx("use",{href:"#sledge-product-review-icons-rating-icon-fill",className:"sledge-product-review__rating-icon-fill"})]})})]}),!y&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[[1,2,3,4,5].map(((s,i)=>{let n=Math.floor(parseFloat(A)),l=String(A).includes(",")?String(A).split(","):[],o=String(A).includes(".")?String(A).split("."):[],r=l.length||o.length?l[1]||o[1]:0,d="fill-0";return s>n&&n+1===s&&(d=`fill-${r}`),t.createElement("svg",{...S,viewBox:"0 0 30 29","data-product-review-rating-fill":s<=n?"full":d,key:i},e.jsxRuntimeExports.jsx("use",{href:"#sledge-product-review-icons-rating-icon"}))})),c?e.jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__rating-summary-total",children:["(",L,")"]}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{})]})]})})},ie=e=>"xs"===e?{width:14.4,height:14.4}:"sm"===e?{width:18,height:18}:{width:28.8,height:28.8},ne=s=>{const[i,n]=t.useState(!s.data);return t.useEffect((()=>{n(!1)}),[]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!i&&e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-header",children:t.Children.count(s.children)&&t.Children.map(s.children,(e=>t.cloneElement(e,{...s})))})})};ne.Sort=({isFirstLoading:s,productReviewSort:i,dataSettings:n,setSelectedSort:l,setIsRefreshWidgetList:o})=>{var r,d;const{default_sort:a,show_sorting_options:u}=(null==(r=null==n?void 0:n.display)?void 0:r.widget)||{},[c,x]=t.useState(a||null),m=c||(null==(d=i[0])?void 0:d.value);return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:u?e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-header-item",children:s?e.jsxRuntimeExports.jsx(je.Item,{width:"134px",height:"42px",rounded:"lg",color:"lighten"}):e.jsxRuntimeExports.jsx(Z,{align:"end",prefixLabel:e.jsxRuntimeExports.jsx(z,{width:16,height:16,color:"currentColor"}),prefixSelectedLabel:"Sort by",options:i.map((e=>{const{name:t,value:s}=e;return{label:t,value:s}})),value:m,onChange:({value:e})=>(e=>{x(e),o&&o(!0),l&&l(e)})(e),link:"?page=1&sort=value"})}):null})},ne.AddTrigger=({isFirstLoading:t,text:s,dataSettings:i,params:n,onAfterAddReview:l})=>{var o,r,d;const{text_color:a,border_color:u,border_radius:c,padding_top:x,padding_bottom:m,padding_left:p,padding_right:h,background_color:g,font_size:j,font_weight:v,text_transform:_}=(null==(r=null==(o=null==i?void 0:i.display)?void 0:o.widget)?void 0:r.button_write_review)||{},{button_write_review:w}=(null==(d=null==i?void 0:i.languages)?void 0:d.widget)||{},f={...a&&{color:a},...u&&{borderColor:u},...c&&{borderRadius:c},...x&&{paddingTop:x},...m&&{paddingBottom:m},...p&&{paddingLeft:p},...h&&{paddingRight:h},...g&&{backgroundColor:g},...j&&{fontSize:j},...v&&{fontWeight:v},..._&&{textTransform:_}};return e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-header-item",children:t?e.jsxRuntimeExports.jsx(je.Item,{width:"134px",height:"42px",rounded:"lg",color:"lighten"}):e.jsxRuntimeExports.jsxs(H,{type:"button",colorType:"success",className:"sledge-product-review__widget-header-add-trigger",onClick:()=>"undefined"!=typeof window&&window.sledgeProductReviewWidgetFormAdd&&window.sledgeProductReviewWidgetFormAdd(n,l),style:f,children:[e.jsxRuntimeExports.jsx(q,{width:16,height:16,color:"currentColor"}),s||(w||"Add review")]})})},ne.Summary=s=>{var i,n,l,o;const{params:r,dataSettings:d,summaryData:a,sledgeSettings:u}=s,{productId:c}=r||{},{fill_color:x,outline_color:m}=(null==(n=null==(i=null==d?void 0:d.display)?void 0:i.widget)?void 0:n.summary_bar)||{},{review_singular:p,review_plural:h}=(null==(l=null==d?void 0:d.languages)?void 0:l.widget)||{},[g,j]=t.useState(!0),[v,_]=t.useState(!0),[w,f]=t.useState(!0),[R,E]=t.useState(!a),[C,y]=t.useState(!1),[N,L]=t.useState(0|(null==a?void 0:a.review_count)),[$,A]=t.useState((null==a?void 0:a.rating)||{5:0,4:0,3:0,2:0,1:0}),[k,I]=t.useState((null==(o=null==a?void 0:a.rating)?void 0:o.average)||"0"),[T,P]=t.useState(!0),O=ee({productId:c}),W=async()=>{var e;let t,s,i,n,l=!1,o=0;if(a&&T)s=a,l=!0,P(!1);else{if(t=await te(c),!t)return;const{status:e}=t,{code:i}=e;s=t.data,l=200===i||!1}o=(null==s?void 0:s.review_count)?s.review_count:0,i=(null==s?void 0:s.rating)?{5:s.rating[5]||0,4:s.rating[4]||0,3:s.rating[3]||0,2:s.rating[2]||0,1:s.rating[1]||0}:$,n=(null==(e=null==s?void 0:s.rating)?void 0:e.average)?s.rating.average:"0",l&&(L(o),A(i),I(n),f(!1),E(!1),j(!1),C&&_(!1))};return t.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetSummaryUpdate=()=>{E(!0),W()}),Boolean(O&&(null==O?void 0:O.productId)!==c)&&j(!0),W()}),[C,c]),e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary",children:g&&!a?e.jsxRuntimeExports.jsx(je.Item,{width:"630px",height:"42px",color:"lighten",rounded:"md"}):w&&!a?null:e.jsxRuntimeExports.jsx(b,{trigger:e.jsxRuntimeExports.jsxs(e.motion.div,{initial:!1,animate:C?"open":"closed",className:"sledge-product-review__widget-summary-trigger",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-average",children:k}),e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-rating",children:!R&&e.jsxRuntimeExports.jsx(se,{data:a,sledgeSettings:u,average:String(k),size:"md",withSkeletonLoading:!1,withTotal:!1,isScrollToElementWidget:!1})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-total",children:[N," ",N>1?h||"Reviews":p||"Review"]}),e.jsxRuntimeExports.jsx(e.motion.div,{variants:D,className:"summary-trigger-icon",children:e.jsxRuntimeExports.jsx("svg",{width:20,height:20,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.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:v?e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-dist-progress",children:[5,4,3,2,1].map((t=>e.jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-dist-progress-item",children:[e.jsxRuntimeExports.jsx(je.Item,{width:"108px",height:"22px",color:"lighten",rounded:"md"}),e.jsxRuntimeExports.jsx(je.Item,{width:"128px",height:"22px",color:"lighten",rounded:"md",style:{marginLeft:"13px",marginRight:"12px"}}),e.jsxRuntimeExports.jsx(je.Item,{width:"38px",height:"22px",color:"lighten",rounded:"md"})]},t)))}):e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-dist",children:e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-dist-progress",children:[5,4,3,2,1].map(((t,s)=>e.jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-dist-progress-item",children:[e.jsxRuntimeExports.jsx(se,{data:a,sledgeSettings:u,average:t,size:"sm",withSkeletonLoading:!1,withTotal:!1,isScrollToElementWidget:!1}),e.jsxRuntimeExports.jsx(S,{value:String($[t]),total:N,fillColor:x,outlineColor:m}),e.jsxRuntimeExports.jsxs("small",{children:["(",$[t],")"]})]},s)))})}),setIsOpen:y,hideCloseIcon:!0,align:"end",alignOffset:-170,className:"sledge-product-review__widget-summary-content",withArrow:!1})})};const le=async(e,t)=>{let s="undefined"!=typeof localStorage&&localStorage.getItem(a)||"",i=`${n}/indexes/${e}/search`;return await C({url:i,method:"POST",authorization:s,payload:t,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},oe=async(e,t)=>{let s=t||("undefined"!=typeof localStorage&&localStorage.getItem(a)||""),i=`${n}/multi-search`;return await C({url:i,method:"POST",authorization:s,payload:e,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},re=async e=>{const{keyword:t,resultCount:s}=e;let n="undefined"!=typeof localStorage&&localStorage.getItem(d)||"",l=`${i}/instantsearch/statistics/search`,o={keyword:t,result_count:s};return await C({url:l,method:"POST",authorization:n,payload:o,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},de=async e=>{const{productId:t}=e;let s="undefined"!=typeof localStorage&&localStorage.getItem(d)||"",n=`${i}/instantsearch/statistics/click`,l={product:{id:f(t)}};return await C({url:n,method:"POST",authorization:s,payload:l,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},ae=({type:s,className:n="",data:l,setting:o,showOptionOutOfStock:r=!1,triggerPropAdditional:a,sourceApp:u=null,isComponentJsVersion:c=!1,cards:x,onAfterAddToCart:m,onAfterAddWishlist:p,onAfterRemoveWishlist:h,onAfterRenderProduct:g,showPopupComponent:j,setShowPopupComponent:v,dataReviews:_,dataWishlists:w})=>{const{show_vendor:R=!0,show_sku:E=!0,show_price:y=!0,show_add_to_cart:b=!0,redirect_add_to_cart:S=!0,language_button_add_to_cart:N="Add To Cart",display_product_name_style:L={},display_price_style:$={},display_button_add_to_cart_style:A={}}=o||{},[k,I]=t.useState(null),T=async t=>{var s;const{id:n,quantity:l}=t;I(n);let o=await(async e=>{var t,s;let i=[];if(e.map((e=>{const{id:t,quantity:s}=e;i.push({id:t,quantity:s})})),"undefined"==typeof window||!(null==(s=null==(t=null==window?void 0:window.Shopify)?void 0:t.routes)?void 0:s.root))return;let n=`${window.Shopify.routes.root}cart/add.js`,l={items:i};return await C({url:n,method:"POST",payload:l,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))})([{id:n,quantity:l}]);(null==(s=null==o?void 0:o.items)?void 0:s.length)?("wishlist"===u?await(async e=>{const{productId:t}=e;let s="undefined"!=typeof localStorage&&localStorage.getItem(d)||"",n=`${i}/wishlist/cart`,l={product:JSON.stringify({id:f(t)})};return await C({url:n,method:"POST",authorization:s,payload:l}).then((e=>e)).catch((()=>{}))})({productId:n}):"instant-search"===u&&await(async e=>{const{productId:t}=e;let s="undefined"!=typeof localStorage&&localStorage.getItem(d)||"",n=`${i}/instantsearch/statistics/cart`,l={product:{id:f(t)}};return await C({url:n,method:"POST",authorization:s,payload:l,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))})({productId:n}),I(null),m&&m("success"),S?window.location.href="/cart":window.sledgeToastNotification({title:"Cart added",message:"Successfully added to wishlist",type:"success",icon:e.jsxRuntimeExports.jsx(F,{width:40,height:40,color:"black"})})):(m&&m("failed"),setTimeout((()=>{var t;I(null),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:(null==(t=null==o?void 0:o.description)?void 0:t.length)?o.description:"failed add to cart, please try again",type:"failed",icon:e.jsxRuntimeExports.jsx(F,{width:40,height:40,color:"black"})})}),1e3))};return t.useEffect((()=>{g&&g("success")}),[]),e.jsxRuntimeExports.jsx("div",{className:`sledge__product-grid ${n}`,"data-grid-type":s,children:null==l?void 0:l.map(((s,n)=>{var l,o,d;const{product:m,variants:g}=s||{},{id:f,title:C,image:S,url:I,vendor:P="",currency:O}=m||{},{id:W="",title:M="",price:V="",sku:B=""}=(null==g?void 0:g.length)?g[0]:{};let q=k==W,z=!(!(null==g?void 0:g.length)||!Object.hasOwn(g[0],"inventory_quantity"))&&(!g[0].inventory_quantity&&r);const U=x?x({product:{...m,variants:g.map(((e,t)=>{const{inventory_quantity:s}=e||{};return{...e,is_out_of_stock:!!Object.hasOwn(g[t],"inventory_quantity")&&!s}})),..._&&Object.keys(_).length?{review:{total:(null==(l=null==_?void 0:_[f])?void 0:l.review_count)?null==_?void 0:_[f].review_count:0,average:(null==(d=null==(o=null==_?void 0:_[f])?void 0:o.rating)?void 0:d.average)?null==_?void 0:_[f].rating.average:0}}:{}},showPopupComponent:j,setShowPopupComponent:v}):null;return x?e.jsxRuntimeExports.jsx(t.Fragment,{children:c?e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:U}}):U},n):e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-content",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-image",children:[e.jsxRuntimeExports.jsxs("a",{href:I,onClick:()=>"instant-search"===u&&de({productId:f}),children:[e.jsxRuntimeExports.jsx(X,{params:{productId:f,productVariantId:W,productName:C,productVendor:P,productSku:B,productVariantName:M,productLink:I,productImage:(null==S?void 0:S.src)||`${i}/img/blank-image.png`,productCurrency:O,productPrice:V},...a,onAfterAddWishlist:p,onAfterRemoveWishlist:h,wishlistChecked:null==w?void 0:w[f]}),e.jsxRuntimeExports.jsx("img",{src:(null==S?void 0:S.src)||`${i}/img/blank-image.png`,alt:"sledge-card-image",loading:"lazy"})]}),z?e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-out-of-stock",children:"Sold out"}):null]}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-desc",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-title",children:[y?e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-price",children:e.jsxRuntimeExports.jsxs("p",{style:$,children:[O,V]})}):null,R?e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-badge-vendor",children:["Vendor: ",(null==P?void 0:P.length)>5?`${String(P).substring(0,5)}...`:P]}):null]}),e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-rating",children:e.jsxRuntimeExports.jsx(se,{params:{productId:f},size:"xs",withSkeletonLoading:!1,isScrollToElementWidget:!1,data:null==_?void 0:_[f]})}),C?e.jsxRuntimeExports.jsx("a",{href:I,onClick:()=>"instant-search"===u&&de({productId:f}),children:e.jsxRuntimeExports.jsx("h3",{className:"sledge__product-grid-card-product-name",style:L,children:C})}):null,e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-text",children:E?e.jsxRuntimeExports.jsxs("div",{children:["SKU: ",B]}):null})]})]}),b?e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-button-wrapper",children:e.jsxRuntimeExports.jsx(H,{type:"button",colorType:"light",style:{...A,...q&&{cursor:"wait"}},...q||z?{disabled:!0}:{onClick:()=>T({id:W,quantity:1})},children:q?"Adding...":z?"Sold out":e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(F,{width:15,height:15,color:"#393D4E"}),e.jsxRuntimeExports.jsx("span",{children:N||"Add To Cart"})]})})}):null]},n)}))})},ue=({className:s="",data:n,cards:l,isComponentJsVersion:o,onAfterRenderCollection:r})=>(t.useEffect((()=>{r&&r("success")}),[]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:(null==n?void 0:n.length)?e.jsxRuntimeExports.jsx("div",{className:`sledge__collection-grid ${s}`,children:n.map(((s,n)=>{const{id:r,title:d,body_html:a,url:u,image:c}=s,x=l?l({data:s}):null;return l?e.jsxRuntimeExports.jsx(t.Fragment,{children:o?e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:x}}):x},n):e.jsxRuntimeExports.jsx("a",{href:u,children:e.jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-image-wrapper",children:e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-image",children:e.jsxRuntimeExports.jsx("img",{src:(null==c?void 0:c.src)||`${i}/img/blank-image.png`,alt:"sledge-card-image",loading:"lazy"})})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-content",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-title",children:d}),a?e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-description",dangerouslySetInnerHTML:{__html:a}}):null]})]})},n)}))}):null})),ce=({className:s="",data:n,cards:l,isComponentJsVersion:o,onAfterRenderPage:r})=>(t.useEffect((()=>{r&&r("success")}),[]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:(null==n?void 0:n.length)?e.jsxRuntimeExports.jsx("div",{className:`sledge__page-grid ${s}`,children:n.map(((s,n)=>{const{id:r,title:d,body_html:a,url:u,image:c}=s,x=l?l({data:s}):null;return l?e.jsxRuntimeExports.jsx(t.Fragment,{children:o?e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:x}}):x},n):e.jsxRuntimeExports.jsx("a",{href:u,children:e.jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-image-wrapper",children:e.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-image",children:e.jsxRuntimeExports.jsx("img",{src:(null==c?void 0:c.src)||`${i}/img/blank-image.png`,alt:"sledge-card-image",loading:"lazy"})})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card-content",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-title",children:d}),a?e.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-description",dangerouslySetInnerHTML:{__html:a}}):null]})]})},n)}))}):null})),xe=({className:s="",data:n,cards:l,isComponentJsVersion:o,onAfterRenderBlog:r})=>(t.useEffect((()=>{r&&r("success")}),[]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:(null==n?void 0:n.length)?e.jsxRuntimeExports.jsx("div",{className:`sledge__blog-grid ${s}`,children:null==n?void 0:n.map(((s,n)=>{const{id:r,title:d,created_at:a,url:u,image:c}=s,x=l?l({data:s}):null;return l?e.jsxRuntimeExports.jsx(t.Fragment,{children:o?e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:x}}):x},n):e.jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-content",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-image",children:e.jsxRuntimeExports.jsx("a",{href:u,children:e.jsxRuntimeExports.jsx("img",{src:(null==c?void 0:c.src)||`${i}/img/blank-image.png`,alt:"sledge-card-image",loading:"lazy"})})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card-desc",children:[e.jsxRuntimeExports.jsx("a",{href:u,children:e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-title",children:d})}),a?e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-badge-vendor",children:y(a)}):null]})]}),e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-button-wrapper",children:e.jsxRuntimeExports.jsx("a",{href:u,children:e.jsxRuntimeExports.jsxs(H,{type:"button",colorType:"light",children:[e.jsxRuntimeExports.jsx(U,{width:16,height:16,color:"#000000"}),e.jsxRuntimeExports.jsx("span",{children:"View Blog"})]})})})]},n)}))}):null})),me=({className:s="",data:n,cards:l,isComponentJsVersion:o,onAfterRenderArticle:r})=>(t.useEffect((()=>{r&&r("success")}),[]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:(null==n?void 0:n.length)?e.jsxRuntimeExports.jsx("div",{className:`sledge__article-grid ${s}`,children:null==n?void 0:n.map(((s,n)=>{const{id:r,title:d,created_at:a,summary_html:u,url:c,image:x}=s,m=l?l({data:s}):null;return l?e.jsxRuntimeExports.jsx(t.Fragment,{children:o?e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:m}}):m},n):e.jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-card",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-content",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-card-image",children:e.jsxRuntimeExports.jsx("a",{href:c,children:e.jsxRuntimeExports.jsx("img",{src:(null==x?void 0:x.src)||`${i}/img/blank-image.png`,alt:"sledge-card-image",loading:"lazy"})})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-card-desc",children:[e.jsxRuntimeExports.jsx("a",{href:c,children:e.jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-card-title",children:d})}),a?e.jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-badge-vendor",children:y(a)}):null,u?e.jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-card-text",dangerouslySetInnerHTML:{__html:u}}):null]})]}),e.jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-button-wrapper",children:e.jsxRuntimeExports.jsx("a",{href:c,children:e.jsxRuntimeExports.jsxs(H,{type:"button",colorType:"light",children:[e.jsxRuntimeExports.jsx(U,{width:16,height:16,color:"#000000"}),e.jsxRuntimeExports.jsx("span",{children:"View Article"})]})})})]},n)}))}):null})),pe=({children:s,content:i,withArrow:n=!0,customArrow:l="",sideOffset:o=5,alignOffset:r=0,wrapTrigger:d=!0})=>{const[a,u]=t.useState(!1);return t.useEffect((()=>{var e;let t=null==(e=null==document?void 0:document.querySelector(".sledge__tooltip-arrow"))?void 0:e.parentElement;t&&(null==l?void 0:l.length)&&(t.classList.add("sledge__tooltip-arrow-parent"),t.innerHTML=l)}),[a]),e.jsxRuntimeExports.jsx(e.$a093c7e1ec25a057$export$2881499e37b75b9a,{delayDuration:0,children:e.jsxRuntimeExports.jsxs(e.$a093c7e1ec25a057$export$be92b6f5f03c0fe9,{onOpenChange:u,children:[e.jsxRuntimeExports.jsx(e.$a093c7e1ec25a057$export$41fb9f06171c75f4,{asChild:!0,children:d?e.jsxRuntimeExports.jsx("span",{children:s}):s}),e.jsxRuntimeExports.jsx(e.$a093c7e1ec25a057$export$602eac185826482c,{children:e.jsxRuntimeExports.jsxs(e.$a093c7e1ec25a057$export$7c6e2c02157bb7d2,{className:"sledge__tooltip-content",sideOffset:o,alignOffset:r,children:[i,n?e.jsxRuntimeExports.jsx(e.$a093c7e1ec25a057$export$21b07c8f274aebd5,{className:"sledge__tooltip-arrow"}):null]})})]})})},he=({children:t,isLoading:s=!1,className:i=""})=>e.jsxRuntimeExports.jsxs(e.$57acba87d6e25586$export$be92b6f5f03c0fe9,{className:`sledge__scroll-area-root ${i}`,children:[e.jsxRuntimeExports.jsx(e.$57acba87d6e25586$export$d5c6c08dc2d3ca7,{className:"sledge__scroll-area-viewport "+(s?"sledge__scroll-area-viewport-loading":""),children:t}),!s&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.$57acba87d6e25586$export$9a4e88b92edfce6b,{className:"sledge__scroll-area-scrollbar",orientation:"vertical",children:e.jsxRuntimeExports.jsx(e.$57acba87d6e25586$export$6521433ed15a34db,{className:"sledge__scroll-area-thumb"})}),e.jsxRuntimeExports.jsx(e.$57acba87d6e25586$export$9a4e88b92edfce6b,{className:"sledge__scroll-area-scrollbar",orientation:"horizontal",children:e.jsxRuntimeExports.jsx(e.$57acba87d6e25586$export$6521433ed15a34db,{className:"sledge__scroll-area-thumb"})})]})]}),ge=({width:s,height:i,rounded:n,color:l,style:o={},className:r="",...d})=>{var a,c,x,m,p;const[h,g]=t.useState({});return t.useEffect((()=>{(async e=>{let t;t=JSON.parse(e),t&&g(t)})(localStorage.getItem(u)||null)}),[]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:(null==(a=null==h?void 0:h.skeleton)?void 0:a.enable)?e.jsxRuntimeExports.jsx("div",{className:`sledge__skeleton-item sledge__skeleton-item-animation ${r}`,style:{width:s,height:i,...(null==(x=null==(c=null==h?void 0:h.skeleton)?void 0:c.colors)?void 0:x.main_color)&&{background:null==(p=null==(m=null==h?void 0:h.skeleton)?void 0:m.colors)?void 0:p.main_color},...o},"data-skeleton-rounded":n,"data-skeleton-color":l,...d}):null})},je={Item:ge,ReviewGrid:({count:t,type:s,gridItemHeights:i=[]})=>{let n=[];for(let l=0;l<t;l++)n.push(e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card",children:e.jsxRuntimeExports.jsx(ge,{width:"100%",height:"list"===s||"grid"===s&&!(null==i?void 0:i.length)?"111px":i[l],color:"lighten",rounded:"md"})},l));return e.jsxRuntimeExports.jsx(e.MasonryResponsive,{columnsCountBreakPoints:"grid"===s?{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:e.jsxRuntimeExports.jsx(e.Masonry,{gutter:"30px",children:n})})},ProductGrid:({count:t,type:s})=>{let i=[];for(let n=0;n<t;n++)i.push(e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-content",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-image sledge__skeleton-product-grid-card-image",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__trigger-block",children:e.jsxRuntimeExports.jsx(ge,{width:"32px",height:"32px",color:"darken",rounded:"sm"})}),e.jsxRuntimeExports.jsx(ge,{width:"100%",height:"100%",color:"lighten",rounded:"md",style:{borderBottomLeftRadius:0,borderBottomRightRadius:0}})]}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-desc",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-title",children:[e.jsxRuntimeExports.jsx(ge,{width:"79px",height:"28px",color:"lighten",rounded:"md"}),e.jsxRuntimeExports.jsx(ge,{width:"80px",height:"28px",color:"lighten",rounded:"md"})]}),e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-rating",children:e.jsxRuntimeExports.jsx(ge,{width:"134px",height:"25px",color:"lighten",rounded:"md"})}),e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-text",children:e.jsxRuntimeExports.jsx(ge,{width:"100%",height:"35px",color:"lighten",rounded:"md",style:{marginBottom:"16px"}})})]})]}),e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-button-wrapper",children:e.jsxRuntimeExports.jsx(ge,{width:"100%",height:"40px",color:"lighten",rounded:"md"})})]},n));return e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid sledge__skeleton-product-grid sledge__skeleton-pointer-events-none","data-grid-type":s,children:i})},CollectionGrid:({count:t})=>{let s=[];for(let i=0;i<t;i++)s.push(e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card",children:e.jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-content",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-title",children:e.jsxRuntimeExports.jsx(ge,{width:"139px",height:"32px",color:"darken",rounded:"md"})}),e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-description",children:e.jsxRuntimeExports.jsx(ge,{width:"238px",height:"48px",color:"darken",rounded:"md"})})]})},i));return e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid sledge__skeleton-collection-grid sledge__skeleton-pointer-events-none",children:s})},PageGrid:({count:t})=>{let s=[];for(let i=0;i<t;i++)s.push(e.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card",children:e.jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card-content",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-title",children:e.jsxRuntimeExports.jsx(ge,{width:"139px",height:"32px",color:"darken",rounded:"md"})}),e.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-description",children:e.jsxRuntimeExports.jsx(ge,{width:"238px",height:"48px",color:"darken",rounded:"md"})})]})},i));return e.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid sledge__skeleton-page-grid sledge__skeleton-pointer-events-none",children:s})},BlogGrid:({count:t})=>{let s=[];for(let i=0;i<t;i++)s.push(e.jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-content",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-image sledge__skeleton-blog-grid-card-image",children:e.jsxRuntimeExports.jsx(ge,{width:"100%",height:"100%",color:"lighten",rounded:"md",style:{borderBottomLeftRadius:0,borderBottomRightRadius:0}})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card-desc",children:[e.jsxRuntimeExports.jsx(ge,{width:"100%",height:"40px",color:"lighten",rounded:"md"}),e.jsxRuntimeExports.jsx(ge,{width:"79px",height:"26px",color:"lighten",rounded:"md",style:{marginTop:"12px",marginBottom:"16px"}}),e.jsxRuntimeExports.jsx(ge,{width:"100%",height:"72px",color:"lighten",rounded:"md"})]})]}),e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-button-wrapper",children:e.jsxRuntimeExports.jsx(ge,{width:"100%",height:"40px",color:"lighten",rounded:"md"})})]},i));return e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid sledge__skeleton-blog-grid sledge__skeleton-pointer-events-none",children:s})},ArticleGrid:({count:t})=>{let s=[];for(let i=0;i<t;i++)s.push(e.jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-card",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-content",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-card-image sledge__skeleton-article-grid-card-image",children:e.jsxRuntimeExports.jsx(ge,{width:"100%",height:"100%",color:"lighten",rounded:"md",style:{borderBottomLeftRadius:0,borderBottomRightRadius:0}})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-card-desc",children:[e.jsxRuntimeExports.jsx(ge,{width:"100%",height:"40px",color:"lighten",rounded:"md"}),e.jsxRuntimeExports.jsx(ge,{width:"79px",height:"26px",color:"lighten",rounded:"md",style:{marginTop:"12px",marginBottom:"16px"}}),e.jsxRuntimeExports.jsx(ge,{width:"100%",height:"72px",color:"lighten",rounded:"md"})]})]}),e.jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-button-wrapper",children:e.jsxRuntimeExports.jsx(ge,{width:"100%",height:"40px",color:"lighten",rounded:"md"})})]},i));return e.jsxRuntimeExports.jsx("div",{className:"sledge__article-grid sledge__skeleton-article-grid sledge__skeleton-pointer-events-none",children:s})}},ve=({listsComponent:t,name:s,items:i,isComponentJsVersion:n,showPopupComponent:l,setShowPopupComponent:o})=>{const r=t?t({name:s,items:i,showPopupComponent:l,setShowPopupComponent:o}):null;return t?n?e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:r}}):r:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-title",children:s}),(null==i?void 0:i.length)?e.jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__icon-widget-search-form-result-list",children:i.map(((t,s)=>{const{title:i,url:n}=t;return e.jsxRuntimeExports.jsx("li",{children:e.jsxRuntimeExports.jsx("a",{href:n,className:"sledge-instant-search__icon-widget-search-form-result-list-link",children:i})},s)}))}):e.jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__icon-widget-search-form-result-list",children:e.jsxRuntimeExports.jsxs("li",{className:"sledge-instant-search__icon-widget-search-form-result-item-disabled",children:["No ",null==s?void 0:s.toLowerCase()," were found"]})})]})},_e=({listsComponent:t,keywords:s,isComponentJsVersion:i=!1,showPopupComponent:n,setShowPopupComponent:l})=>{const o=t?t({keywords:s,showPopupComponent:n,setShowPopupComponent:l}):null;return t?i?e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:o}}):o:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-title",children:"Suggestions"}),e.jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__icon-widget-search-form-result-list",children:null==s?void 0:s.map(((t,s)=>e.jsxRuntimeExports.jsx("li",{children:e.jsxRuntimeExports.jsxs("a",{href:`${j}?q=${t}`,className:"sledge-instant-search__icon-widget-search-form-result-list-link sledge-instant-search__icon-widget-search-form-result-list-link-suggestion",children:[e.jsxRuntimeExports.jsx(B,{width:12,height:12,color:"#677487"})," ",t]})},s)))})]})},we=({component:t,keyword:s,isComponentJsVersion:i=!1,showPopupComponent:n,setShowPopupComponent:l})=>{const o=t?t({keyword:s,showPopupComponent:n,setShowPopupComponent:l}):null;return t?i?e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:o}}):o:e.jsxRuntimeExports.jsx("a",{href:`${j}?q=${s}`,className:"sledge-instant-search__icon-widget-button-more",children:"View More Result"})},fe=i=>{var n,l,o,r,d,a,u,c,x,p,h,g,j,v,_,w,f,E,C;const{isRenderApp:y,isJsVersion:b}=t.useContext(s.SledgeContext),{instantSearch:S}=y||{},{layoutType:N="default",query:L,params:$,children:A,onAfterAddToCart:k,onAfterAddWishlist:I,onAfterRemoveWishlist:T,onAfterRenderProduct:P,onAfterRenderCollection:O,onAfterRenderPage:W,onAfterRenderBlog:M,onAfterRenderArticle:F,data:V,sledgeSettings:B}=i,{keyword:q=""}=L||{},{collectionId:z}=$||{};let U=null,H=null,J=null,D=null,G=null;t.Children.map(A,(e=>{if(t.isValidElement(e)&&R(e.type)){const{productCard:t,collectionCard:s,pageCard:i,blogCard:n,articleCard:l}=(null==e?void 0:e.props)||{};t&&R(t)&&(U=t),s&&R(s)&&(H=s),i&&R(i)&&(J=i),n&&R(n)&&(D=n),l&&R(l)&&(G=l)}}));const Z="undefined"!=typeof document?new URLSearchParams(null==(n=null==document?void 0:document.location)?void 0:n.search):null,[K]=t.useState("undefined"!=typeof localStorage?JSON.parse(localStorage.getItem(m)||"{}"):{}),[Y,X]=t.useState(!V),[Q,te]=t.useState(!V),[se,ie]=t.useState(null==Z?void 0:Z.get(q)),[ne,le]=t.useState(null),[re,de]=t.useState(),[ae,ue]=t.useState(e.jsxRuntimeExports.jsx(Re,{})),[ce,xe]=t.useState(!V),[me,pe]=t.useState((null==(l=null==B?void 0:B.instantsearch)?void 0:l.allowed_sorts)||[]),[he,ge]=t.useState((null==(o=null==B?void 0:B.instantsearch)?void 0:o.filters)||[]),[ve,_e]=t.useState([]),[we,fe]=t.useState([]),[Ce,ye]=t.useState((null==(r=null==B?void 0:B.instantsearch)?void 0:r.suffix_index_product)||""),[be,Se]=t.useState({}),[Ne,Le]=t.useState((null==(d=null==B?void 0:B.instantsearch)?void 0:d.hidden_tags)||[]),[$e,Ae]=t.useState((null==(a=null==B?void 0:B.instantsearch)?void 0:a.display)||{}),[ke,Ie]=t.useState((null==(u=null==B?void 0:B.instantsearch)?void 0:u.colors)||[]),[Te,Pe]=t.useState((null==(c=null==B?void 0:B.instantsearch)?void 0:c.default_sort)||""),[Oe,We]=t.useState(null==(x=null==B?void 0:B.instantsearch)?void 0:x.show_out_of_stock),[Me,Fe]=t.useState(!0),Ve=t.useRef(null),Be=ee({keyword:se}),qe=async(e,t)=>{const{filters:s,tabs:i,suffix_index_product:n,hidden_tags:l,show_out_of_stock:o}=e;let r,d={queries:("product-filter"===N?i.filter((({index:e})=>null==e?void 0:e.includes(n))):i).map((e=>{const{index:i}=e;let r=!1,d=r?[]:null==s?void 0:s.map((e=>{const{collections:t,items:s}=e;return z&&(null==t?void 0:t.includes(Number(z)))||(null==t?void 0:t.includes("all"))?(r=!0,null==s?void 0:s.map((({value:e})=>e))):void 0})),a=i.includes(n),u=a&&d.length,c=[];return(null==l?void 0:l.length)&&c.push(`tags NOT IN [${l}]`),o||c.push("variants.inventory_quantity > 0"),z&&c.push(`collections.id = '${z}'`),u&&fe(d[0]),{indexUid:i,q:"default"===t?"":se,hitsPerPage:1,facets:u?d[0]:[],filter:a?c.join(" AND "):""}}))};if(V&&Me?(r=V.result,Fe(!1)):r=await oe(d),!r)return;const{results:a}=r;if(X(!1),xe(!1),te(!1),"totalDataPerIndex"===t)_e(null==i?void 0:i.map((e=>{const{index:t}=e,{totalHits:s}=(null==a?void 0:a.find((({indexUid:e})=>e===t)))||{};return{...e,total:s}})));else{const{facetDistribution:e,facetStats:t}=(null==a?void 0:a.find((({indexUid:e})=>e.includes(n))))||{};Se(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]}))):{})}};t.useEffect((()=>{if(!S)return;const e=new URLSearchParams(document.location.search);ie((null==e?void 0:e.get(q))||""),(async e=>{let t,s;if(xe(!0),t=JSON.parse(e),!t)return;const{allowed_sorts:i,default_sort:n,filters:l,tabs:o,suffix_index_product:r,hidden_tags:d,display:a,colors:u,show_out_of_stock:c}=t;pe((null==i?void 0:i.length)?i:[]),ge((null==l?void 0:l.length)?l:[]),ye(r),Le(d),Ae(a),Ie(u),Pe(n),We(c),s=o.find((({index:e})=>e.includes(r))),Object.keys(s).length&&(le(s.index),de(s.name)),await qe(t,"default"),"default"===N&&await qe(t,"totalDataPerIndex")})(localStorage.getItem(m)||null)}),[S]),t.useEffect((()=>{if(Boolean(Be&&(null==Be?void 0:Be.keyword)!==se)&&"default"===N){const e=JSON.parse(localStorage.getItem(m)||""),t=setTimeout((()=>{e&&qe(e,"totalDataPerIndex")}),500);return()=>clearTimeout(t)}}),[se]);const ze="default"===N?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-tab-list sledge-instant-search__result-tab-list-skeleton",children:[1,2,3,4,5].map((t=>e.jsxRuntimeExports.jsx(je.Item,{width:"122px",height:"28px",rounded:"md",color:"lighten"},t)))}):null,Ue=(null==(p=null==$e?void 0:$e.filter)?void 0:p.enable_on_search)&&"horizontal"===(null==(h=null==$e?void 0:$e.filter)?void 0:h.layout)?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-skeleton",children:[1,2,3,4,5,6,7].map((t=>e.jsxRuntimeExports.jsx(je.Item,{width:"106px",height:"42px",rounded:"md",color:"lighten"},t)))}):null,He=(null==(g=null==$e?void 0:$e.filter)?void 0:g.enable_on_search)&&"vertical"===(null==(j=null==$e?void 0:$e.filter)?void 0:j.layout)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px",justifyContent:"space-between",marginBottom:"23px"},children:[e.jsxRuntimeExports.jsx(je.Item,{width:"117px",height:"28px",color:"lighten",rounded:"md"}),e.jsxRuntimeExports.jsx(je.Item,{width:"80px",height:"28px",color:"lighten",rounded:"md"})]}),e.jsxRuntimeExports.jsx(je.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"18px"}}),[1,2,3].map((t=>e.jsxRuntimeExports.jsx(je.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}},t))),e.jsxRuntimeExports.jsx(je.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"18px"}}),e.jsxRuntimeExports.jsx(je.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"14px"}}),e.jsxRuntimeExports.jsx(je.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}}),e.jsxRuntimeExports.jsx(je.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"17px"}}),e.jsxRuntimeExports.jsx(je.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"38px"}}),e.jsxRuntimeExports.jsx(je.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"35px"}}),e.jsxRuntimeExports.jsx(je.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"12px"}}),e.jsxRuntimeExports.jsx(je.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}}),e.jsxRuntimeExports.jsx(je.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"20px"}}),e.jsxRuntimeExports.jsx(je.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"12px"}}),[1,2,3].map((t=>e.jsxRuntimeExports.jsx(je.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}},t))),e.jsxRuntimeExports.jsx(je.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"11px"}}),e.jsxRuntimeExports.jsx("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"12px"},children:[1,2,3,4,5,6,7,8,9].map((t=>e.jsxRuntimeExports.jsx(je.Item,{width:"34px",height:"34px",color:"lighten",rounded:"full"},t)))})]}):null,Je=e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[(null==(v=null==$e?void 0:$e.filter)?void 0:v.show_total_products)&&"vertical"===(null==(_=null==$e?void 0:$e.filter)?void 0:_.layout)?e.jsxRuntimeExports.jsx(je.Item,{width:"117px",height:"28px",color:"lighten",rounded:"md",style:{marginBottom:"21px"}}):null,e.jsxRuntimeExports.jsx(je.ProductGrid,{count:12,type:"large"})]}),De=e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-keyword",children:[(null==(w=null==$e?void 0:$e.filter)?void 0:w.show_total_products)&&"horizontal"===(null==(f=null==$e?void 0:$e.filter)?void 0:f.layout)?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-horizontal",children:e.jsxRuntimeExports.jsx(je.Item,{width:"117px",height:"28px",color:"lighten",rounded:"md"})}):null,e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-keyword-form",children:e.jsxRuntimeExports.jsx(je.Item,{width:"100%",height:"42px",color:"lighten",rounded:"lg",style:{maxWidth:"630px"}})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-item sledge-instant-search__result-data-summary-select-field",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:e.jsxRuntimeExports.jsx(je.Item,{width:"150px",height:"42px",color:"lighten",rounded:"lg"})}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:e.jsxRuntimeExports.jsx(je.Item,{width:"150px",height:"42px",color:"lighten",rounded:"lg"})})]})]});return e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-container",ref:Ve,children:[Y?null:e.jsxRuntimeExports.jsx("div",{className:""+("default"===N&&(null==ve?void 0:ve.length)?"sledge-instant-search__result-tab":"sledge-instant-search__result-tab-no-index"),children:"default"===N&&(null==ve?void 0:ve.length)?e.jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__result-tab-list",children:ve.map((t=>{const{name:s,index:i,total:n}=t;let l=ne===i;return e.jsxRuntimeExports.jsxs("li",{onClick:t=>((t,s,i)=>{le(t),de(s),ue(t.includes(Ce)?e.jsxRuntimeExports.jsx(Re,{}):e.jsxRuntimeExports.jsx(Ee,{}))})(i,s),className:""+(l?"sledge-instant-search__result-tab-list-item-active":""),children:[s,e.jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-tab-total",children:n||0})]},i)}))}):null}),Y&&(null==N?void 0:N.length)&&!V?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[ze,Ue,e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-wrapper sledge-instant-search__result-wrapper-skeleton",children:[(null==(E=null==$e?void 0:$e.filter)?void 0:E.enable_on_search)&&"vertical"===(null==(C=null==$e?void 0:$e.filter)?void 0:C.layout)?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:He}):null,e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data",children:[De,Je]})]})]}):t.cloneElement(ae,{isLoading:Q,keyword:se,clickedTabIndexId:ne,clickedTabIndexName:re,isLoadingSetting:ce,allowedSorts:me,allowedFilters:he,facets:we,searchResultFacets:be,hiddenTags:Ne,displaySettings:$e,colorSwatches:ke,defaultSort:Te,showOutOfStock:Oe,query:L,params:$,isJsVersion:b,productCardsComponent:U,collectionCardsComponent:H,pageCardsComponent:J,blogCardsComponent:D,articleCardsComponent:G,onAfterAddToCart:k,onAfterAddWishlist:I,onAfterRemoveWishlist:T,onAfterRenderProduct:P,onAfterRenderCollection:O,onAfterRenderPage:W,onAfterRenderBlog:M,onAfterRenderArticle:F,setIsLoading:te,setKeyword:ie,filterHorizontalSkeleton:Ue,filterVerticalSkeleton:He,productGridSkeleton:Je,searchAndSelectOptionSkeleton:De,searchResultContainerRef:Ve,data:V,settings:K})]})},Re=s=>{var i,n,l,o,r,d,a,u,c,x,m,p,h,g,j,v,_,w,f,R,C,y,S,T,P,W;const{keyword:M,clickedTabIndexId:F,isLoadingSetting:V,allowedSorts:q,allowedFilters:z,facets:U,searchResultFacets:G,hiddenTags:K,displaySettings:Y,colorSwatches:X,defaultSort:Q,showOutOfStock:te,query:se,params:ie,isJsVersion:ne,productCardsComponent:oe,setKeyword:de,filterHorizontalSkeleton:ue,filterVerticalSkeleton:ce,productGridSkeleton:xe,searchAndSelectOptionSkeleton:me,onAfterAddToCart:pe,onAfterAddWishlist:he,onAfterRemoveWishlist:ge,onAfterRenderProduct:je,searchResultContainerRef:ve,data:_e,settings:we}=s||{},{keyword:fe=""}=se||{},{collectionId:Re}=ie||{},[Ee,ye]=t.useState(!_e),[be,Se]=t.useState(!_e),[Ne,Le]=t.useState(!1),[$e,Ae]=t.useState(!1),[ke,Ie]=t.useState(Q||""),[Te,Pe]=t.useState(q&&Boolean(null==q?void 0:q.length)?null==(i=q.find((({value:e})=>e===Q)))?void 0:i.label:""),[Oe,We]=t.useState((null==(n=null==Y?void 0:Y.search)?void 0:n.limit)||10),[Me,Fe]=t.useState(null),[Ve,Be]=t.useState({...te?{}:{"variants.inventory_quantity":"> 0"}}),[qe,ze]=t.useState(!1),[Ue,He]=t.useState((null==(r=null==(o=null==(l=null==_e?void 0:_e.result)?void 0:l.results)?void 0:o[0])?void 0:r.hits)||[]),[Je,De]=t.useState(0),[Ge,Ze]=t.useState(1),[Ke,Ye]=t.useState(0),[Xe,Qe]=t.useState((null==(u=null==(a=null==(d=null==_e?void 0:_e.result)?void 0:d.results)?void 0:a[0])?void 0:u.totalHits)||0),[et,tt]=t.useState([]),[st,it]=t.useState([]),[nt,lt]=t.useState(!1),[ot,rt]=t.useState(!0),[dt,at]=t.useState(_e?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:(null==(ut=null==Y?void 0:Y.filter)?void 0:ut.show_total_products)?e.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[Xe," result"," ",(null==M?void 0:M.length)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["for ",e.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',M,'"']})]}):null]}):null}):null);var ut;const ct=ee({keyword:M,clickedLimitId:Oe,clickedFacets:Ve}),{color:xt,font_size:mt,font_weight:pt,text_transform:ht}=(null==(c=null==Y?void 0:Y.filter)?void 0:c.title)||{},{color:gt,font_size:jt,font_weight:vt,text_transform:_t}=(null==(x=null==Y?void 0:Y.filter)?void 0:x.option)||{},{text_color:wt,border_color:ft,border_radius:Rt,padding_top:Et,padding_bottom:Ct,padding_left:yt,padding_right:bt,background_color:St,font_size:Nt,font_weight:Lt,text_transform:$t}=(null==(m=null==Y?void 0:Y.filter)?void 0:m.button)||{},At={...xt&&{color:xt},...mt&&{fontSize:mt},...pt&&{fontWeight:pt},...ht&&{textTransform:ht}},kt={...gt&&{color:gt},...jt&&{fontSize:jt},...vt&&{fontWeight:vt},..._t&&{textTransform:_t}},It=e=>{var t;const s=new URLSearchParams(document.location.search),i=Object.fromEntries(s);let n={};for(const o in i){(null==U?void 0:U.length)&&!U.includes(o)&&(n[o]=i[o])}for(const o in e)(null==(t=e[o])?void 0:t.length)&&(n[o]=e[o]);const l=new URLSearchParams({...n}).toString();window.history.pushState(null,"",`${document.location.pathname}${(null==l?void 0:l.length)?`?${l}`:""}`)},Tt=e=>{Fe(e===Me?"":e)},Pt=()=>{lt(!0),Be({}),ze(!qe),It({}),tt([]),setTimeout((()=>{lt(!1)}),10)},Ot=(e,t,s=!1)=>{var i;lt(!0);let n=[t],l=["variants.price"].includes(e);Ve&&(s?n=[t]:(null==(i=Ve[e])?void 0:i.includes(t))?n=Ve[e].filter((e=>e!==t)):l?(Ve[e],Ve[e]===t?(n=[],tt([])):n=t):n=Ve[e]?[...Ve[e],t]:[t]);let o={...Ve,[e]:n};It(o),Be(o),ze(!qe),setTimeout((()=>{lt(!1)}),10)},Wt=async(t=!1,s=!1)=>{var i,n;if(!F)return;t&&Ze(1),Se(!0);let l,o=(e=>{const t=new URLSearchParams(document.location.search),s=Object.fromEntries(t);for(const i in s)(null==U?void 0:U.length)&&U.includes(i)&&(e[i]=s[i].split(","));return Object.keys(e).length&&Be(e),e})(Ve),r=Object.entries(o).map((e=>{var t,s;if((null==e?void 0:e.length)&&e[1].length){let i=e[0],n=["variants.inventory_quantity"].includes(i),l=["variants.price"].includes(i),o=["tags"].includes(i);return Array.isArray(e[1])&&(null==(t=e[1])?void 0:t.length)>1?l?`${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==K?void 0:K.length)&&r.push(`tags NOT IN [${K}]`),Re&&r.push(`collections.id = '${Re}'`);let d={q:M,sort:ke?[ke]:[],page:t?1:Ge,hitsPerPage:Oe,facets:U,filter:r.join(" AND ")};_e&&ot?(l=null==(n=null==(i=null==_e?void 0:_e.result)?void 0:i.results)?void 0:n[0],rt(!1)):l=await le(F,d),((t,s)=>{var i;if(!t)return;const{hits:n,processingTimeMs:l,totalHits:o,totalPages:r}=t;s&&(null==M?void 0:M.length)&&re({keyword:M,resultCount:o||0}),ye(!1),Se(!1),He(n),De(l||0),Ye(r),Qe(o||0),at(e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:(null==(i=null==Y?void 0:Y.filter)?void 0:i.show_total_products)?e.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[o," result"," ",(null==M?void 0:M.length)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["for ",e.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',M,'"']})]}):null]}):null}))})(l,s)},Mt=e=>{const t=new URLSearchParams(document.location.search);t.set(fe,e),de&&de(e),window.history.pushState(null,"",`${document.location.pathname}?${t.toString()}`)};t.useEffect((()=>{let e=Boolean(ct&&((null==ct?void 0:ct.keyword)!==M||(null==ct?void 0:ct.clickedLimitId)!==Oe||(null==ct?void 0:ct.clickedFacets)!==Ve));if(Boolean(ct&&(null==ct?void 0:ct.keyword)!==M)){const e=setTimeout((()=>{Wt(!0,!0)}),500);return()=>clearTimeout(e)}Wt(e)}),[ke,Oe,qe,M,Ge,F,Re]),t.useEffect((()=>{(()=>{var e,t;if(!(null==(e=null==Y?void 0:Y.filter)?void 0:e.enable_on_search)||(null==(t=null==Y?void 0:Y.filter)?void 0:t.hide_when_one_value)&&Xe<=1)return;let s=!1;s||null==z||z.map((e=>{const{collections:t,items:i}=e;(Re&&(null==t?void 0:t.includes(Number(Re)))||(null==t?void 0:t.includes("all")))&&(s=!0,it(i))}))})()}),[z,G,Xe]);const Ft=({label:t,name:s,value:i,index:n})=>{var l;let o=i;return["variants.price"].includes(s)&&(o=null==i?void 0:i.join(" - ")),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-refine-selected",style:kt,children:[e.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-filter-item-title-refine-list",children:[t,": ",null==(l=String(o))?void 0:l.replaceAll("_"," ")]}),e.jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-item-refine-title-clear",onClick:()=>Ot(s,i),children:e.jsxRuntimeExports.jsx("svg",{width:12,height:12,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.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"})})})]},n)},Vt=t=>{var s,i;const{value:n,label:l,display:o}=t;let r=null,d=G[n],a=null==(s=null==Y?void 0:Y.filter)?void 0:s.show_number_matching_product;return"slider"===o.toLowerCase()?r=e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-list-slider",children:[e.jsxRuntimeExports.jsx(L,{defaultValue:[et[0]||(null==d?void 0:d.min),et[1]||(null==d?void 0:d.max)],min:null==d?void 0:d.min,max:null==d?void 0:d.max,step:1,setValueCommit:e=>Ot(n,e),setValueChange:e=>tt(e)}),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-list-slider-minmax",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-minmax-field",children:et[0]||(null==d?void 0:d.min)}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-minmax-field",children:et[1]||(null==d?void 0:d.max)})]})]}):"checkbox"===o.toLowerCase()&&(null==d?void 0:d.length)?r=e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:null==d?void 0:d.map(((t,s)=>{var i;return e.jsxRuntimeExports.jsx("li",{children:e.jsxRuntimeExports.jsx(N,{id:`${n}_${s}`,name:n,value:t.value,label:`${t.name}${void 0!==t.total&&a?` (${t.total})`:""}`,onClick:e=>Ot(n,e.currentTarget.value),defaultChecked:Ve&&(null==(i=Ve[n])?void 0:i.includes(t.value)),labelStyle:kt})},s)}))}):"radio"===o.toLowerCase()&&(null==d?void 0:d.length)?r=e.jsxRuntimeExports.jsx("li",{children:e.jsxRuntimeExports.jsx(A,{id:n,name:n,onValueChange:e=>Ot(n,e,!0),items:null==d?void 0:d.map((e=>{const{name:t,value:s,total:i}=e;return{label:`${t} ${void 0!==i&&a?` (${i})`:""}`,value:s}})),defaultValue:Ve&&(null==(i=Ve[n])?void 0:i.length)?Ve[n][0]:"",labelStyle:kt})}):"select"===o.toLowerCase()&&(null==d?void 0:d.length)?r=e.jsxRuntimeExports.jsx("li",{children:e.jsxRuntimeExports.jsx(I,{placeholder:`Select ${l}`,name:n,onValueChange:e=>Ot(n,e,!0),items:null==d?void 0:d.map((e=>{const{name:t,value:s,total:i}=e;return{label:`${t} ${void 0!==i&&a?` (${i})`:""}`,value:s}})),labelStyle:kt})}):"swatch"===o.toLowerCase()&&(null==d?void 0:d.length)&&(r=e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:null==d?void 0:d.map(((t,s)=>{var i;let l=(null==X?void 0:X.filter((({name:e})=>null==e?void 0:e.includes(t.value)))[0])||{};return e.jsxRuntimeExports.jsx("li",{children:e.jsxRuntimeExports.jsx(k,{id:`${n}_${s}`,name:n,value:t.value,rgb:null==l?void 0:l.rgb,image:null==l?void 0:l.image,onClick:e=>Ot(n,e.currentTarget.value),defaultChecked:Ve&&(null==(i=Ve[n])?void 0:i.includes(t.value))})},s)}))})),r},Bt=st.map(((t,s)=>{const{value:i,label:n,display:l}=t;let o=Me===i,r=G[i],d=Boolean("slider"===l.toLowerCase()?r:null==r?void 0:r.length),a=["select"].includes(l.toLowerCase())&&(null==r?void 0:r.length),u=["sledge-instant-search__result-filter-item-list"],c=Vt(t);return"swatch"===l.toLowerCase()&&(null==r?void 0:r.length)&&u.push("sledge-instant-search__result-filter-item-color-swatches"),d?e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-title",onClick:()=>Tt(i),children:[e.jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-title",style:At,children:n}),e.jsxRuntimeExports.jsx(e.motion.div,{initial:!1,animate:o?"open":"closed",variants:D,children:e.jsxRuntimeExports.jsx(O,{width:15,height:15,color:"#000000"})})]}),o&&e.jsxRuntimeExports.jsx("ul",{className:u.join(" "),children:a?c:nt?null:c})]},s):null})),qt=st.map(((t,s)=>{const{value:i,label:n,display:l}=t;let o=Me===i,r=G[i],d=Boolean("slider"===l.toLowerCase()?r:null==r?void 0:r.length),a=["radio","select"].includes(l.toLowerCase())&&(null==r?void 0:r.length),u=["sledge-instant-search__result-filter-item-list"],c=Vt(t);return"swatch"===l.toLowerCase()&&(null==r?void 0:r.length)&&u.push("sledge-instant-search__result-filter-item-color-swatches"),d?e.jsxRuntimeExports.jsx("div",{className:"",children:e.jsxRuntimeExports.jsx(b,{trigger:e.jsxRuntimeExports.jsxs(H,{type:"button",onClick:()=>Tt(i),children:[n,e.jsxRuntimeExports.jsx(e.motion.div,{initial:"closed",animate:o?"open":"closed",variants:D,className:"sort-trigger-icon",children:e.jsxRuntimeExports.jsx(O,{width:20,height:20,color:"#000000"})})]}),content:e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-facet",children:o&&e.jsxRuntimeExports.jsx("ul",{className:u.join(" "),children:a?c:nt?null:c})}),withOpenState:!1,setIsOpen:e=>Fe(e?i:""),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>'})},s):null}));let zt=[];Object.entries(Ve).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),l=st.filter((({value:e})=>null==e?void 0:e.includes(i))),o=(null==l?void 0:l.length)?l[0].label:i;return Array.isArray(e[1])&&(null==(t=e[1])?void 0:t.length)>1?n?zt.push({label:o,name:i,value:e[1]}):null==(s=e[1])?void 0:s.map((e=>{zt.push({label:o,name:i,value:e})})):zt.push({label:o,name:i,value:e[1][0]})}}));const Ut=e.jsxRuntimeExports.jsx($,{currentPage:Ge,totalPage:Ke,totalResult:Xe,onChange:e=>(e=>{Ze(e),setTimeout((()=>{E({element:ve.current,headerOffset:50})}),200)})(e)});return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[(null==(p=null==Y?void 0:Y.filter)?void 0:p.enable_on_search)&&"horizontal"===(null==(h=null==Y?void 0:Y.filter)?void 0:h.layout)?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:Ee&&!_e?ue:e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:V&&!_e?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-loading",children:ue}):qt.every((e=>!e))?null:e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-horizontal-wrapper",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal",children:qt}),Boolean((null==zt?void 0:zt.length)&&(null==(g=null==Y?void 0:Y.filter)?void 0:g.show_refine_by_block))?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:Boolean(zt.every((e=>!e)))?null:e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-horizontal",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-refine-item sledge-instant-search__result-filter-horizontal-refine-item-clear-all",onClick:Pt,children:"Clear All"}),zt.map(((e,t)=>{const{label:s,name:i,value:n}=e;return Ft({label:s,name:i,value:n,index:t})}))]})}):null]})})}):null,e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-wrapper","data-filter-layout":null==(j=null==Y?void 0:Y.filter)?void 0:j.layout,children:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[(null==(v=null==Y?void 0:Y.filter)?void 0:v.enable_on_search)&&"vertical"===(null==(_=null==Y?void 0:Y.filter)?void 0:_.layout)?Ee?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:ce}):Bt.every((e=>!e))?null:e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:V?ce:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[Boolean((null==zt?void 0:zt.length)&&(null==(w=null==Y?void 0:Y.filter)?void 0:w.show_refine_by_block))?Boolean(zt.every((e=>!e)))?null:e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-title-refine",children:[e.jsxRuntimeExports.jsx("strong",{className:"sledge-instant-search__result-filter-item-title-refine-heading",children:"Filter"}),e.jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-item-title-refine-clear",onClick:Pt,children:"Clear All"})]}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-item-refine-selected-flex",children:zt.map(((e,t)=>{const{label:s,name:i,value:n}=e;return Ft({label:s,name:i,value:n,index:t})}))})]}):null,Bt]})}):null,e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data",children:[Ee?me:e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-keyword",children:["horizontal"===(null==(f=null==Y?void 0:Y.filter)?void 0:f.layout)&&e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-horizontal",children:dt}),e.jsxRuntimeExports.jsx(J,{type:"text",icon:e.jsxRuntimeExports.jsx(B,{width:18,height:18,color:"#868686"}),placeholder:"Search products...",value:M,onChange:({value:e})=>Mt(e),onResetField:()=>Mt(""),className:"sledge-instant-search__result-data-keyword-form",withClearField:!0}),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-item sledge-instant-search__result-data-summary-select-field",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:[e.jsxRuntimeExports.jsx("span",{children:"Sort by:"}),q&&Boolean(null==q?void 0:q.length)&&e.jsxRuntimeExports.jsx(Z,{align:"end",prefixLabel:e.jsxRuntimeExports.jsx("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.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:q.map((e=>{const{label:t,value:s}=e;return{label:t,value:s}})),value:ke||(null==we?void 0:we.default_sort),onChange:({label:e,value:t})=>((e,t)=>{Le(!1),Pe(e),Ie(t)})(e,t)})]}),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:[e.jsxRuntimeExports.jsx("span",{children:"Limit:"}),(null==(R=null==Y?void 0:Y.search)?void 0:R.allowed_limit)&&Boolean(null==(y=null==(C=null==Y?void 0:Y.search)?void 0:C.allowed_limit)?void 0:y.length)&&e.jsxRuntimeExports.jsx(Z,{align:"end",options:Y.search.allowed_limit.map((e=>({label:e,value:e}))),value:Oe,onChange:({value:e})=>(e=>{Ae(!1),We(e)})(e)})]})]})]}),be?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[xe,(null==Ue?void 0:Ue.length)?Ut:null]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["vertical"===(null==(S=null==Y?void 0:Y.filter)?void 0:S.layout)&&e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-vertical",children:dt}),(null==Ue?void 0:Ue.length)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(ae,{sourceApp:"instant-search",type:"large",data:Ue.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(T=null==Y?void 0:Y.search)?void 0:T.show_vendor,show_sku:null==(P=null==Y?void 0:Y.search)?void 0:P.show_sku,show_price:null==(W=null==Y?void 0:Y.search)?void 0:W.show_price},isComponentJsVersion:ne,cards:oe,showOptionOutOfStock:!0,onAfterAddToCart:pe,onAfterAddWishlist:he,onAfterRemoveWishlist:ge,onAfterRenderProduct:je,dataWishlists:null==_e?void 0:_e.wishlists,dataReviews:null==_e?void 0:_e.reviews}),Ut]}):e.jsxRuntimeExports.jsx(Ce,{})]})]})]})})]})},Ee=s=>{var i,n,l,o;const{keyword:r,clickedTabIndexId:d,clickedTabIndexName:a,isJsVersion:u,collectionCardsComponent:c,pageCardsComponent:x,blogCardsComponent:m,articleCardsComponent:p,setKeyword:h,searchResultContainerRef:g,onAfterRenderCollection:j,onAfterRenderPage:v,onAfterRenderBlog:_,onAfterRenderArticle:w}=s||{},[f,R]=t.useState(!0),[C,y]=t.useState(!0),[b,S]=t.useState(""),[N,L]=t.useState([]),[A,k]=t.useState(0),[I,T]=t.useState(1),[P,O]=t.useState(0),[W,M]=t.useState(0),[F,V]=t.useState(null),q=ee({keyword:r}),z=async()=>{if(!d)return;let t;y(!0);let s={q:r,sort:b?[b]:[],page:I,hitsPerPage:12};t=await le(d,s),(t=>{if(!t)return;const{hits:s,processingTimeMs:i,totalHits:n,totalPages:l}=t;R(!1),y(!1),L(s),k(i||0),O(l),M(n||0),V(e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:e.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[n," result"," ",(null==r?void 0:r.length)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["for ",e.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',r,'"']})]}):null]})}))})(t)};t.useEffect((()=>{if(Boolean(q&&(null==q?void 0:q.keyword)!==r)){const e=setTimeout((()=>{z()}),500);return()=>clearTimeout(e)}z()}),[b,r,I,d]);const U=e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-keyword sledge-instant-search__result-data-keyword-category",children:e.jsxRuntimeExports.jsx(J,{type:"text",icon:e.jsxRuntimeExports.jsx(B,{width:18,height:18,color:"#868686"}),placeholder:`Search ${a?a.toLowerCase():""}...`,value:r,onChange:({value:e})=>h&&h(e),onResetField:()=>h&&h(""),className:"sledge-instant-search__result-data-keyword-form",withClearField:!0})}),H=e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary",children:e.jsxRuntimeExports.jsx(je.Item,{width:"117px",height:"28px",color:"lighten",rounded:"md"})}),D=(null==(i=String(d))?void 0:i.includes("collection"))?e.jsxRuntimeExports.jsx(je.CollectionGrid,{count:6}):(null==(n=String(d))?void 0:n.includes("page"))?e.jsxRuntimeExports.jsx(je.PageGrid,{count:6}):(null==(l=String(d))?void 0:l.includes("blog"))?e.jsxRuntimeExports.jsx(je.BlogGrid,{count:12}):(null==(o=String(d))?void 0:o.includes("article"))?e.jsxRuntimeExports.jsx(je.ArticleGrid,{count:12}):null,G=()=>e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-category-wrapper",children:[U,H,D]}),Z=()=>e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[U,H,D]}),K=t=>{var s,i,n,l;return(null==(s=String(d))?void 0:s.includes("collection"))?e.jsxRuntimeExports.jsx(ue,{cards:c,onAfterRenderCollection:j,...t}):(null==(i=String(d))?void 0:i.includes("page"))?e.jsxRuntimeExports.jsx(ce,{cards:x,onAfterRenderPage:v,...t}):(null==(n=String(d))?void 0:n.includes("blog"))?e.jsxRuntimeExports.jsx(xe,{cards:m,onAfterRenderBlog:_,...t}):(null==(l=String(d))?void 0:l.includes("article"))?e.jsxRuntimeExports.jsx(me,{cards:p,onAfterRenderArticle:w,...t}):null};return e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-wrapper",children:f?e.jsxRuntimeExports.jsx(G,{}):e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-category-wrapper",children:C?e.jsxRuntimeExports.jsx(Z,{}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[U,e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary",children:F}),(null==N?void 0:N.length)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(K,{data:N,isComponentJsVersion:u}),e.jsxRuntimeExports.jsx($,{currentPage:I,totalPage:P,totalResult:W,onChange:e=>(e=>{T(e),setTimeout((()=>{E({element:g.current,headerOffset:50})}),200)})(e)})]}):e.jsxRuntimeExports.jsx(Ce,{})]})})})},Ce=s=>{const[i,n]=t.useState(""),[l,o]=t.useState("");return t.useEffect((()=>{n("No results found"),o("Your search did not match any results. <br/> Please try again")}),[]),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-empty",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-empty-title",dangerouslySetInnerHTML:{__html:i}}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-empty-description",dangerouslySetInnerHTML:{__html:l}})]})};exports.ProductFilterWidget=t=>e.jsxRuntimeExports.jsx(fe,{layoutType:"product-filter",...t}),exports.SearchIconWidget=i=>{const{isRenderApp:n,isJsVersion:l}=t.useContext(s.SledgeContext),{instantSearch:o}=n||{},{size:r="sm",children:d,onAfterAddToCart:a,onAfterAddWishlist:u,onAfterRemoveWishlist:c,onAfterRenderProduct:x}=i||{};let m=null,p=null,h=null,g=null;t.Children.map(d,(e=>{if(t.isValidElement(e)&&R(e.type)){const{productCard:t,suggestionKeywordList:s,otherIndexList:i,searchViewMoreResult:n}=(null==e?void 0:e.props)||{};t&&R(t)&&(m=t),s&&R(s)&&(p=s),i&&R(i)&&(h=i),n&&R(n)&&(g=n)}}));const[j,v]=t.useState({width:0,height:0});t.useEffect((()=>{o&&v("xs"===r?{width:14,height:14}:"sm"===r?{width:20,height:20}:{width:25,height:25})}),[o]);return e.jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__icon-widget",onClick:()=>{"undefined"!=typeof window&&window.sledgeInstantSearchIconWidgetPopup&&window.sledgeInstantSearchIconWidgetPopup({onAfterAddToCart:a,onAfterAddWishlist:u,onAfterRemoveWishlist:c,onAfterRenderProduct:x,isJsVersion:l,productCardsComponent:m,suggestionKeywordListsComponent:p,otherIndexListsComponent:h,searchViewMoreResultComponent:g})},children:e.jsxRuntimeExports.jsx(B,{...j,color:"currentColor"})})},exports.SearchIconWidgetPopup=()=>{var n,l,o,r,a,u,c,x,p,h,g,j,v,w,R,E,y,b,S,N,L,$;const{isRenderApp:A}=t.useContext(s.SledgeContext),{instantSearch:k}=A||{},[I,T]=t.useState(!0),[P,O]=t.useState(!1),[W,M]=t.useState(""),[F,V]=t.useState([]),[q,z]=t.useState([]),[U,H]=t.useState({}),[D,G]=t.useState({}),[Z,K]=t.useState({}),[Y,X]=t.useState(""),[Q,te]=t.useState({onAfterAddToCart:e=>{},onAfterAddWishlist:e=>{},onAfterRemoveWishlist:e=>{},onAfterRenderProduct:e=>{},isJsVersion:null,productCardsComponent:null,suggestionKeywordListsComponent:null,otherIndexListsComponent:null,searchViewMoreResultComponent:null}),se=t.useRef(null),ie=ee({keyword:W}),ne=async e=>{var t,s,n,l,o,r,a,u,c,x,m,p;const{data:h,onSearch:g=!1,withFetchReviewInfo:j=!1}=e;T(!0);const{tabs:v,suffix_index_product:w,hidden_tags:R,display:E,show_out_of_stock:y}=h,b=(null==(t=null==E?void 0:E.search)?void 0:t.suggestion)||{};let S,N={queries:v.map((e=>{const{index:t}=e;let s=t.includes(w),i=[];return(null==R?void 0:R.length)&&i.push(`tags NOT IN [${R}]`),y||i.push("variants.inventory_quantity > 0"),{indexUid:t,q:W,hitsPerPage:s?6:4,filter:s?i.join(" AND "):""}}))};if(S=await oe(N),!S)return;const{results:L}=S;let $=null==L?void 0:L.filter((({indexUid:e})=>null==e?void 0:e.includes(w)));g&&(null==W?void 0:W.length)&&re({keyword:W,resultCount:(null==(s=$[0])?void 0:s.totalHits)||0});let A=(null==(n=null==L?void 0:L.filter((({indexUid:e})=>!(null==e?void 0:e.includes(w)))))?void 0:n.map((e=>{const{indexUid:t}=e,{name:s}=null==v?void 0:v.find((({index:e})=>e.includes(t)));return{...e,name:s||""}})))||[],k=(null==$?void 0:$.length)?null==(l=$[0])?void 0:l.hits:[],I=W.length?(null==k?void 0:k.length)?"":"no_result":"zero_character",P=Boolean(!W.length&&Object.keys(b).length&&(null==(r=null==(o=b[I])?void 0:o.products)?void 0:r.active)&&(null==(c=null==(u=null==(a=b[I])?void 0:a.products)?void 0:u.list)?void 0:c.length))?null==(m=null==(x=b[I])?void 0:x.products)?void 0:m.list:k;if(j){let e=P.map((({id:e})=>e)),t=await(async(e,t)=>{let s=e.map((e=>f(e))),n=t||"undefined"!=typeof localStorage&&(null==localStorage?void 0:localStorage.getItem(d))||"",l=`${i}/review/info/ids/${s.join(",")}?${_.Authorization}=${n}`;return await C({url:l,method:"GET",authorization:n,isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))})(e);200===(null==(p=null==t?void 0:t.status)?void 0:p.code)&&H(null==t?void 0:t.data)}else H({});V(P),z(A),X(I),T(!1)};return t.useEffect((()=>{k&&("undefined"!=typeof window&&(window.sledgeInstantSearchIconWidgetPopup=({onAfterAddToCart:e=(()=>{}),onAfterAddWishlist:t=(()=>{}),onAfterRemoveWishlist:s=(()=>{}),onAfterRenderProduct:i=(()=>{}),isJsVersion:n=null,productCardsComponent:l=(()=>{}),suggestionKeywordListsComponent:o=(()=>{}),otherIndexListsComponent:r=(()=>{}),searchViewMoreResultComponent:d=(()=>{})})=>{O(!0),te({onAfterAddToCart:e,onAfterAddWishlist:t,onAfterRemoveWishlist:s,onAfterRenderProduct:i,isJsVersion:n,productCardsComponent:l,suggestionKeywordListsComponent:o,otherIndexListsComponent:r,searchViewMoreResultComponent:d})}),(async e=>{var t;let s;if(s=JSON.parse(e),!s)return;const{display:i}=s;G(i),K(null==(t=null==i?void 0:i.search)?void 0:t.suggestion),await ne({data:s,withFetchReviewInfo:!0})})(localStorage.getItem(m)||null))}),[k]),t.useEffect((()=>{P?document.body.classList.add("sledge__open-popup-state"):document.body.classList.remove("sledge__open-popup-state")}),[P]),t.useEffect((()=>{if(Boolean(ie&&(null==ie?void 0:ie.keyword)!==W)){const e=JSON.parse(localStorage.getItem(m)||""),t=setTimeout((()=>{e&&ne({data:e,onSearch:!0})}),500);return()=>clearTimeout(t)}}),[W]),e.jsxRuntimeExports.jsx(e.$5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:P,onOpenChange:O,children:e.jsxRuntimeExports.jsxs(e.$5d3850c4d0b4e6c7$export$602eac185826482c,{children:[e.jsxRuntimeExports.jsx(e.$5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__popup-overlay"}),e.jsxRuntimeExports.jsx(e.$5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__popup-overlay-blur"}),e.jsxRuntimeExports.jsxs(e.$5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,{className:"sledge-instant-search__icon-widget-popup-detail-content","data-layout-type":(null==(n=null==D?void 0:D.search)?void 0:n.layout)||"",children:[e.jsxRuntimeExports.jsx(J,{type:"text",icon:e.jsxRuntimeExports.jsx(B,{width:20,height:20,color:"#000000"}),placeholder:"Search anything...",value:W,fieldRef:se,onChange:({value:e})=>M(e),className:"sledge-instant-search__icon-widget-search-form-field",withClearField:!0}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result",children:I?e.jsxRuntimeExports.jsx(he,{children:e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-wrapper",children:e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex",children:[e.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((s=>e.jsxRuntimeExports.jsxs(t.Fragment,{children:[e.jsxRuntimeExports.jsx(je.Item,{width:"100%",height:"42px",color:"lighten",rounded:"md",...Boolean(s)&&{style:{marginTop:"12px"}}}),e.jsxRuntimeExports.jsx("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",gap:"12px",marginTop:"12px"},children:[1,2,3].map((t=>e.jsxRuntimeExports.jsx(je.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"140px"}},t)))})]},s)))}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-product",children:e.jsxRuntimeExports.jsx(je.ProductGrid,{count:6,type:"medium"})})]})})}):e.jsxRuntimeExports.jsx(he,{children:e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-wrapper",children:e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-other",children:[Object.keys(Z).length&&(null==(o=null==(l=Z[Y])?void 0:l.keywords)?void 0:o.active)&&(null==(u=null==(a=null==(r=Z[Y])?void 0:r.keywords)?void 0:a.list)?void 0:u.length)?e.jsxRuntimeExports.jsx(_e,{listsComponent:Q.suggestionKeywordListsComponent,keywords:Z[Y].keywords.list,isComponentJsVersion:Q.isJsVersion,showPopupComponent:P,setShowPopupComponent:O}):null,q&&q.map(((s,i)=>{const{hits:n,name:l}=s;return e.jsxRuntimeExports.jsx(t.Fragment,{children:e.jsxRuntimeExports.jsx(ve,{listsComponent:Q.otherIndexListsComponent,name:l,items:n,isComponentJsVersion:Q.isJsVersion,showPopupComponent:P,setShowPopupComponent:O})},i)}))]}),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-product",children:[(null==F?void 0:F.length)?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-product",children:e.jsxRuntimeExports.jsx(ae,{sourceApp:"instant-search",type:"medium",data:F.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(c=null==D?void 0:D.search)?void 0:c.show_vendor,show_sku:null==(x=null==D?void 0:D.search)?void 0:x.show_sku,show_price:null==(p=null==D?void 0:D.search)?void 0:p.show_price},showOptionOutOfStock:!0,isComponentJsVersion:Q.isJsVersion,cards:Q.productCardsComponent,onAfterAddToCart:Q.onAfterAddToCart,onAfterAddWishlist:Q.onAfterAddWishlist,onAfterRemoveWishlist:Q.onAfterRemoveWishlist,onAfterRenderProduct:Q.onAfterRenderProduct,showPopupComponent:P,setShowPopupComponent:O,dataReviews:U})}):Object.keys(Z).length&&(null==(g=null==(h=Z[Y])?void 0:h.products)?void 0:g.active)&&(null==(w=null==(v=null==(j=Z[Y])?void 0:j.products)?void 0:v.list)?void 0:w.length)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-product-suggestion-no-result-text",children:[e.jsxRuntimeExports.jsx("span",{children:"Sorry"}),", nothing found for ",e.jsxRuntimeExports.jsx("span",{children:W}),". Did you mean:"]}),e.jsxRuntimeExports.jsx(ae,{sourceApp:"instant-search",type:"medium",data:Z[Y].products.list.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(R=null==D?void 0:D.search)?void 0:R.show_vendor,show_sku:null==(E=null==D?void 0:D.search)?void 0:E.show_sku,show_price:null==(y=null==D?void 0:D.search)?void 0:y.show_price},showOptionOutOfStock:!0,isComponentJsVersion:Q.isJsVersion,cards:Q.productCardsComponent,onAfterAddToCart:Q.onAfterAddToCart,onAfterAddWishlist:Q.onAfterAddWishlist,onAfterRemoveWishlist:Q.onAfterRemoveWishlist,onAfterRenderProduct:Q.onAfterRenderProduct,showPopupComponent:P,setShowPopupComponent:O})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-title",children:"Products"}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-item-disabled",children:"No product were found"})]}),(null==F?void 0:F.length)||Object.keys(Z).length&&(null==(S=null==(b=Z[Y])?void 0:b.products)?void 0:S.active)&&(null==($=null==(L=null==(N=Z[Y])?void 0:N.products)?void 0:L.list)?void 0:$.length)?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-button-more-wrapper",children:e.jsxRuntimeExports.jsx(we,{component:Q.searchViewMoreResultComponent,keyword:W,isComponentJsVersion:Q.isJsVersion,showPopupComponent:P,setShowPopupComponent:O})}):null]})]})})})})]})]})})},exports.SearchResultWidget=fe,exports.SearchWidget=i=>{var n,l,o,r,d,a,u,c,x,p,h,g,j,v,_,w,f,E,C,y,b;const{isRenderApp:S,isJsVersion:N}=t.useContext(s.SledgeContext),{instantSearch:L}=S||{},{width:$="400px",children:A,onAfterAddToCart:k,onAfterAddWishlist:I,onAfterRemoveWishlist:T,onAfterRenderProduct:P}=i;let O=null,W=null,M=null,F=null;t.Children.map(A,(e=>{if(t.isValidElement(e)&&R(e.type)){const{productCard:t,suggestionKeywordList:s,otherIndexList:i,searchViewMoreResult:n}=(null==e?void 0:e.props)||{};t&&R(t)&&(O=t),s&&R(s)&&(W=s),i&&R(i)&&(M=i),n&&R(n)&&(F=n)}}));const[V,q]=t.useState(!0),[z,U]=t.useState(""),[H,D]=t.useState([]),[Z,K]=t.useState([]),[Y,X]=t.useState({}),[Q,te]=t.useState({}),[se,ie]=t.useState(""),ne=ee({keyword:z}),le=async(e,t=!1)=>{var s,i,n,l,o,r,d,a,u,c,x;if(!z.length)return;q(!0);const{tabs:m,suffix_index_product:p,hidden_tags:h,display:g,show_out_of_stock:j}=e,v=(null==(s=null==g?void 0:g.search)?void 0:s.suggestion)||{};let _,w={queries:m.map((e=>{const{index:t}=e;let s=t.includes(p),i=[];return(null==h?void 0:h.length)&&i.push(`tags NOT IN [${h}]`),j||i.push("variants.inventory_quantity > 0"),{indexUid:t,q:z,hitsPerPage:s?6:4,filter:s?i.join(" AND "):""}}))};if(_=await oe(w),!_)return;const{results:f}=_;let R=null==f?void 0:f.filter((({indexUid:e})=>null==e?void 0:e.includes(p)));t&&(null==z?void 0:z.length)&&re({keyword:z,resultCount:(null==(i=R[0])?void 0:i.totalHits)||0});let E=(null==(n=null==f?void 0:f.filter((({indexUid:e})=>!(null==e?void 0:e.includes(p)))))?void 0:n.map((e=>{const{indexUid:t}=e,{name:s}=null==m?void 0:m.find((({index:e})=>e.includes(t)));return{...e,name:s||""}})))||[],C=(null==R?void 0:R.length)?null==(l=R[0])?void 0:l.hits:[],y=z.length?(null==C?void 0:C.length)?"":"no_result":"zero_character",b=Boolean(!z.length&&Object.keys(v).length&&(null==(r=null==(o=v[y])?void 0:o.products)?void 0:r.active)&&(null==(u=null==(a=null==(d=v[y])?void 0:d.products)?void 0:a.list)?void 0:u.length));D(b?null==(x=null==(c=v[y])?void 0:c.products)?void 0:x.list:C),K(E),ie(y),q(!1)};t.useEffect((()=>{L&&(async e=>{var t;if(!z.length)return;let s;if(s=JSON.parse(e),!s)return;const{display:i}=s;X(i),te(null==(t=null==i?void 0:i.search)?void 0:t.suggestion),await le(s)})(localStorage.getItem(m)||null)}),[z]),t.useEffect((()=>{if(Boolean(ne&&(null==ne?void 0:ne.keyword)!==z)){const e=JSON.parse(localStorage.getItem(m)||""),t=setTimeout((()=>{e&&le(e,!0)}),500);return()=>clearTimeout(t)}}),[z]);const de={maxWidth:$};return e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-wrapper",style:de,children:[e.jsxRuntimeExports.jsx(J,{type:"text",icon:e.jsxRuntimeExports.jsx(B,{width:18,height:18,color:"#868686"}),placeholder:"Search anything",value:z,onChange:({value:e})=>U(e),onResetField:()=>U(""),withClearField:!0}),e.jsxRuntimeExports.jsx(e.motion.div,{initial:"hidden",animate:z.length?"visible":"hidden",variants:G,className:"sledge-instant-search__widget-search-form-result",children:V?e.jsxRuntimeExports.jsx(he,{children:e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex",children:[e.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((s=>e.jsxRuntimeExports.jsxs(t.Fragment,{children:[e.jsxRuntimeExports.jsx(je.Item,{width:"100%",height:"42px",color:"lighten",rounded:"md",...Boolean(s)&&{style:{marginTop:"12px"}}}),e.jsxRuntimeExports.jsx("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",gap:"12px",marginTop:"12px"},children:[1,2,3].map((t=>e.jsxRuntimeExports.jsx(je.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"140px"}},t)))})]},s)))}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-product",children:e.jsxRuntimeExports.jsx(je.ProductGrid,{count:6,type:"small"})})]})}):e.jsxRuntimeExports.jsx(he,{isLoading:V,children:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-other",children:[Object.keys(Q).length&&(null==(l=null==(n=Q[se])?void 0:n.keywords)?void 0:l.active)&&(null==(d=null==(r=null==(o=Q[se])?void 0:o.keywords)?void 0:r.list)?void 0:d.length)?e.jsxRuntimeExports.jsx(_e,{listsComponent:W,keywords:Q[se].keywords.list,isComponentJsVersion:N}):null,Z.map(((s,i)=>{const{hits:n,name:l}=s;return e.jsxRuntimeExports.jsx(t.Fragment,{children:e.jsxRuntimeExports.jsx(ve,{listsComponent:M,name:l,items:n,isComponentJsVersion:N})},i)}))]}),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-product",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-title-product",children:"Products"}),(null==H?void 0:H.length)?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-product",children:e.jsxRuntimeExports.jsx(ae,{sourceApp:"instant-search",type:"small",data:H.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(a=null==Y?void 0:Y.search)?void 0:a.show_vendor,show_sku:null==(u=null==Y?void 0:Y.search)?void 0:u.show_sku,show_price:null==(c=null==Y?void 0:Y.search)?void 0:c.show_price},showOptionOutOfStock:!0,isComponentJsVersion:N,cards:O,onAfterAddToCart:k,onAfterAddWishlist:I,onAfterRemoveWishlist:T,onAfterRenderProduct:P})}):Object.keys(Q).length&&(null==(p=null==(x=Q[se])?void 0:x.products)?void 0:p.active)&&(null==(j=null==(g=null==(h=Q[se])?void 0:h.products)?void 0:g.list)?void 0:j.length)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-product-suggestion-no-result-text",children:[e.jsxRuntimeExports.jsx("span",{children:"Sorry, nothing found for"})," ",e.jsxRuntimeExports.jsx("strong",{children:z}),". ",e.jsxRuntimeExports.jsx("span",{children:"Did you mean:"})]}),e.jsxRuntimeExports.jsx(ae,{sourceApp:"instant-search",type:"small",data:Q[se].products.list.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(v=null==Y?void 0:Y.search)?void 0:v.show_vendor,show_sku:null==(_=null==Y?void 0:Y.search)?void 0:_.show_sku,show_price:null==(w=null==Y?void 0:Y.search)?void 0:w.show_price},showOptionOutOfStock:!0,isComponentJsVersion:N,cards:O,onAfterAddToCart:k,onAfterAddWishlist:I,onAfterRemoveWishlist:T,onAfterRenderProduct:P})]}):e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-product-disabled",children:"No product were found"})]})]}),(null==H?void 0:H.length)||Object.keys(Q).length&&(null==(E=null==(f=Q[se])?void 0:f.products)?void 0:E.active)&&(null==(b=null==(y=null==(C=Q[se])?void 0:C.products)?void 0:y.list)?void 0:b.length)?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-button-more-wrapper",children:e.jsxRuntimeExports.jsx(we,{component:F,keyword:z,isComponentJsVersion:N})}):null]})})})]})};
|
|
2
2
|
//# sourceMappingURL=sledge-react-instant-search.cjs.map
|