PageSourceSearch

https://cdn.siroko.com/front_build/product-listing.73b386857c3a.js

js siroko.com collected 2026-10-02 04:52:11 UTC 13,978 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3111],{36266:(e,t,r)=>{r.d(t,{A:()=>v});r(52675),r(89463),r(2259),r(45700),r(28706),r(2008),r(51629),r(23418),r(64346),r(23792),r(34782),r(89572),r(23288),r(62010),r(2892),r(67945),r(84185),r(5506),r(83851),r(81278),r(79432),r(26099),r(84864),r(27495),r(38781),r(47764),r(23500),r(62953);var n=r(82612);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){u(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],c=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}}function u(e,t,r){return(t=f(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}var h="is-shown",d="click",y={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},p={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};const v=function(){return e=function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),u(this,"_handleClickCallback",(function(e){(0,n.g7)(r._config.clickCallback,[e])})),this._config=this._getConfig(t),this._element=null,this._isAppended=!1},t=[{key:"show",value:function(){if(this._config.isVisible){this._append();var e=this._getElement();this._config.isAnimated&&(0,n.qm)(e),e.classList.add(h)}else(0,n.g7)(this.dispose())}},{key:"hide",value:function(e){var t=this;this._config.isVisible?(this._getElement().classList.remove(h),this._queueCallback((function(){e&&e(),t.dispose()}),this._element,this._config.isAnimated)):(0,n.g7)(this.dispose())}},{key:"dispose",value:function(){this._isAppended&&(this._element.removeEventListener(d,this._handleClickCallback),this._element.remove(),this._isAppended=!1)}},{key:"_append",value:function(){if(!this._isAppended){var e=this._getElement(),t=null,r=this._config.rootElement;if("string"==typeof r)try{t=document.querySelector(this._config.rootElement)}catch(e){}else r instanceof HTMLElement&&(t=r);t&&(t.appendChild(this._element),e.addEventListener(d,this._handleClickCallback),this._isAppended=!0)}}},{key:"_getElement",value:function(){if(!this._element){var e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add("fade"),this._element=e}return this._element}},{key:"_typeCheckConfig",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.constructor.DefaultType,r=0,i=Object.entries(t);r<i.length;r++){var o=s(i[r],2),a=o[0],c=o[1],l=e[a],u=(0,n.vq)(l)?"element":(0,n.Ax)(l);if(!new RegExp(c).test(u))throw new TypeError("".concat(this.constructor.NAME.toUpperCase(),': Option "').concat(a,'" provided type "').concat(u,'" but expected type "').concat(c,'".'))}}},{key:"_getConfig",value:function(e){return e=a(a({},this.constructor.Default),"object"===i(e)?e:{}),this._typeCheckConfig(e),e}},{key:"_queueCallback",value:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];(0,n.dO)(e,t,r)}}],r=[{key:"Default",get:function(){return y}},{key:"DefaultType",get:function(){return p}},{key:"NAME",get:function(){return"backdrop"}}],t&&l(e.prototype,t),r&&l(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},27636:(e,t,r)=>{r(51629),r(23792),r(26910),r(36033),r(26099),r(47764),r(23500),r(62953);var n=r(36189),i=(r(52675),r(89463),r(2259),r(45700),r(28706),r(23418),r(64346),r(34782),r(89572),r(23288),r(62010),r(2892),r(84185),r(27495),r(38781),r(5746
1),r(3296),r(27208),r(48408),r(31643));function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}}function l(e,t,r){return(t=u(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var f="featured",h="all";const d=function(){return e=function e(t,r){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),l(this,"_handleChange",(function(){n._updateButtonsState()})),l(this,"_handleClick",(function(e){var t=e.target.closest("button[data-action]");t&&(t.matches('[data-action="reset"]')&&n.resetFilters(),t.matches('[data-action="apply"]')&&n.applyFilters())})),l(this,"_handlePopState",(function(){n._filters=n._getInitialFilters(),n._syncSortRadios(n._filters.sort);var e=n._element.querySelectorAll('input[name="category"]');e&&e.forEach((function(e){e.value===n._filters.category?e.checked=!0:e.checked=!1}));var t=n._getSortedProducts(n._products,{sort:n._filters.sort});n._updateDOM(t),n._updateButtonsState(),n._emitEvent("product-listing:change",n._filters)})),t&&(this._element=t,this._products=Array.isArray(r)?r:[],this._filters=this._getInitialFilters(),this._offcanvas=this._initializeOffcanvas(),this._addEventListeners())},t=[{key:"setSort",value:function(e){e&&e!==this._filters.sort&&(this._filters.sort=e,this._applySort(e),this._syncSortRadios(e),this._updateButtonsState(),this._emitEvent("product-listing:change",this._filters))}},{key:"applyFilters",value:function(){var e=this._getSelectedFiltersFromDOM(),t=e.sort,r=e.category;if(t!==this._filters.sort||r!==this._filters.category){if(r!==this._filters.category){var n=this._element.querySelector('input[name="category"]:checked'),i=(null==n?void 0:n.dataset.url)||null;if(i){var o=new URL(i,window.location.origin);return t===f?o.searchParams.delete("sort"):o.searchParams.set("sort",t),this._offcanvas.hide(),void(window.location.href=o.toString())}}this._filters=this._normalizeFilters({sort:t,category:r}),this._applySort(this._filters.sort),this._updateButtonsState(),this._offcanvas.hide(),this._emitEvent("product-listing:change",this._filters)}}},{key:"resetFilters",value:function(){this._syncFiltersToDOM({sort:f,category:h}),this._updateButtonsState()}},{key:"on",value:function(e,t){this._element.addEventListener(e,t)}},{key:"off",value:function(e,t){this._element.removeEventListener(e,t)}},{key:"_isDefault",value:function(e){return e.sort===f&&e.category===h}},{key:"_normalizeFilters",value:function(e){return{sort:e.sort||f,category:e.category||h}}},{key:"_getInitialFilters",value:function(){var e=new URLSearchParams(window.location.search),t={sort:e.get("sort"),category:e.get("filter")};return this._normalizeFilters(t)}},{key:"_getSelectedFiltersFromDOM",value:function(){var e,t;return{sort:(null===(e=this._element.querySelector('input[name="sort"]:checked'))||void 0===e?void 0:e.value)||f,category:(null===(t=this._element.querySelector('input[name="category"]:checked'))||void 0===t?void 0:t.value)||h}}},{key:"_initializeOffcanvas",value:function(){return new i.A(this._element)}},{key:"_updateDOM",value:function(e){var t=document.querySelector(".product-grid");if(t){var r=new Map;t.querySelectorAll(".product__card").forEach((function(e){var t=e.getAttribute("data-id");t&&r.set(t,e)}));var n=document.createDocumentFragment();e.forEach((function(e){var t=r.get(String(e.id));t&&n.appendChild(t)})),t.appendChild(n)}}},{key:"_getSortedProducts",value:function(e,t){var r=t.sort,n=a(e);switch(r){case"price_desc":n.sort((function(e,t){return Number(t.price)-Number(e.price)}));break;case"price_asc":n.sort((function(e,t){return Number(e.price)-Number(t.price)}));break;case"newest":n.sort((function(e,t){return new Date(t.date)-new Date(e.date)}));break;case"bestsellers":n.sort((function(e,t){return Number(t.sales)-Number(e.sales)}));break;default:n.sort((function(e,t){return Number(t.score)-Number(e.score)}))}return n}},{key:"_applySort",value:function(e){var t=new URL(window.location.href);e===f?t.searchParams.delete("sort"):t.searchParams.set("sort",e),window.history.replaceState({},"",t),this._syncCategoryLinksSort(e);var r=this._getSortedProducts(this._products,{sort:e});this._updateDOM(r)}},{key:"_syncCategoryLinksSort",value:function(e){document.querySelectorAll(".collection__filter-group a[href]").forEach((function(t){var r=t.getAttribute("href");if(r){var n=new URL(r,window.location.origin);e===f?n.searchParams.delete("sort"):n.searchParams.set("sort",e),t.setAttribute("href","".concat(n.pathname).concat(n.search).concat(n.hash))}}))}},{key:"_syncSortRadios",value:function(e){this._element.querySelectorAll('input[name="sort"]').forEach((function(t){t.checked=t.value===e}))}},{key:"_syncFiltersToDOM",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._filters,t=e.sort,r=e.category;this._element.querySelectorAll('input[name="sort"]').forEach((function(e){e.checked=e.value===t})),this._element.querySelectorAll('input[name="category"]').forEach((function(e){e.checked=e.value===r}))}},{key:"_updateButtonsState",value:function(){var e=this._getSelectedFiltersFromDOM(),t=this._isDefault(e),r=e.sort===this._filters.sort&&e.category===this._filters.category;this._setResetButtonState(t),this._setApplyButtonState(r)}},{key:"_setApplyButtonState",value:function(e){var t=this._element.querySelector('[data-action="apply"]');t&&(t.disabled=e)}},{key:"_setResetButtonState",value:function(e){var t=this._element.querySelector('[data-action="reset"]');t&&(t.disabled=e)}},{key:"_emitEvent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._element.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0}))}},{key:"_addEventListeners",value:function(){var e=this;this._element.addEventListener("change",this._handleChange),this._element.addEventListener("click",this._handleClick),this._offcanvas._element.addEventListener("hidden.offcanvas",(function(){e._syncFiltersToDOM(e._filters),e._updateButtonsState()})),window.addEventListener("popstate",this._handlePopState)}}],t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();var y=new Map,p=document.getElementById("filters-offcanvas"),v=p?new d(p,window.PRODUCTS):null,m=document.querySelectorAll(".js-custom-select:not(.js-not-initialize)"),_=document.querySelectorAll(".js-sort-label");m.forEach((function(e){var t=new n.A(e,{isSelect:!0}),r=t.getElement();y.set(e,t),r.addEventListener("change",(function(e){var t=e.target.value;v&&v.setSort(t)}))}
1)),v&&v.on("product-listing:change",(function(e){var t=e.detail.sort;m.forEach((function(e){var r=y.get(e);r&&r.setOptionByValue(t)})),function(e){var t=document.querySelector('#sort-products option[value="'.concat(e,'"]'));t&&_.forEach((function(e){e.textContent=t.textContent}))}(t)}))}},e=>{e.O(0,[7136,4740,9627,3220,7380,4631,3216,6189,1643],(()=>{return t=27636,e(e.s=t);var t}));e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.