PageSourceSearch

https://www.siniat.pl/etex/js/assets/js/7635.a40f52522f38d8e56312.mjs

js siniat.pl collected 2026-10-07 23:25:57 UTC 19,072 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkwebpack=self.webpackChunkwebpack||[]).push([[7635],{72717:function(t,e,i){var s=i(42799),a=i(79234);class n extends s.o{constructor(t,e){super(t),this.init(),this.type=e}init(){}static getInstance(t){if(!n.instance[t]){let e=document.querySelector("[data-component-class='FavoritesManager']");n.instance[t]=e?new n(e,t):null}return n.instance[t]}addFavorite(t,e){const i=this.parm.addFavoriteUrl+"?ts="+(new Date).getTime();let s={id:t,type:this.type},n=new a.o(i,s,!1);this.ajaxWrapper.doFetch(n).then((t=>e(t)))}addFavorites(t,e){const i=this.parm.addFavoritesUrl+"?ts="+(new Date).getTime();let s={ids:t,type:this.type},n=new a.o(i,s,!1);this.ajaxWrapper.doFetch(n).then((t=>e(t)))}deleteFavorite(t,e){const i=this.parm.deleteFavoriteUrl+"?ts="+(new Date).getTime();let s={id:t,type:this.type},n=new a.o(i,s,!1);this.ajaxWrapper.doFetch(n).then((t=>e(t)))}deleteFavorites(t,e){const i=this.parm.deleteFavoritesUrl+"?ts="+(new Date).getTime();let s={ids:t,type:this.type},n=new a.o(i,s,!1);this.ajaxWrapper.doFetch(n).then((t=>e(t)))}listFavorites(t){const e=this.parm.listFavoritesUrl+"?ts="+(new Date).getTime();let i={type:this.type},s=new a.o(e,i,!1);this.ajaxWrapper.doFetch(s).then((e=>t(e)))}}n.instance=[],e.Z=n},27635:function(t,e,i){i.r(e),i.d(e,{default:function(){return R}});var s=i(42799),a=i(79234),n=i(83491),r=i(72717),l=i(70392),o=i.n(l),h=i(66497),c=i(58706),d=i(33876),u=i(76356);const E=".js-dialog-title",T="[data-js='text-search']";class p extends c.BaseDialog{constructor(t,e){super(t),this.init(),this.defaultTitle=e,this.titleEl=this.element.querySelector(E),this.textSearchEl=this.element.querySelector(T)}init(){super.init()}setTitle(t){this.titleEl.innerText=t}onHide(t,e){this.titleEl.innerText=this.defaultTitle,this.textSearchEl&&(this.textSearchEl.value=""),super.onHide(t,e)}}var m=".c-choice__label",g="data-facet-name",C="data-goto-page",y=".js-range-input",S=".js-range-remove",A=".js-empty-result",L="/api/reporter-app/fireprotectionproject/unlinkentities",O="/api/reporter-app/fireprotectionproject/linkentities";class R extends s.o{constructor(t){super(t),this.SELECTOR_TABLE_CONTAINER="resultsContainer",this.SELECTOR_TABLE_CUSTOM_CONTAINER="resultsCustomFavoritesContainer",this.SELECTOR_FACETMAP_CONTAINER="[data-js='facet-map']",this.SELECTOR_PAGER_CONTAINER="[data-js='pager']",this.SELECTOR_TOTALCOUNT_CONTAINER="[data-js='total-count']",this.SELECTOR_DATA_PAGE="data-goto-page",this.SELECTOR_DATA_ID="data-id",this.SELECTOR_HIDDEN="u-hidden",this.SELECTOR_TEXTSEARCH="[data-js='text-search']",this.SELECTOR_CLEAR_BUTTON="[data-js='search-clear-button']",this.SELECTOR_CLOSE_DIALOG=".js-close-dialog",this.SELECTOR_CURRENT_QUERY="#catalog-search-current-query",this.SELECTOR_OPEN_CATALOG_SEARCH=".js-open-catalog-search",this.SELECTOR_OPEN_CATALOG_SEARCH_FOR_FAVORITES=".js-open-catalog-search-for-favorites",this.SELECTOR_OPEN_CATALOG_SEARCH_FOR_PROMAT_FAVORITES=".js-open-catalog-search-for-promat-favorites",this.SELECTOR_FACET_MAP_SELECTION=".js-facet-map-selection",this.SELECTOR_SPECIFIC_CATEGORY_CATALOG_SEARCH_CLOSE_BTN=".js-close-category-specific-catalog-search",this.SELECTOR_SEARCH_FILTER_CONTAINER=".c-search-filter",this.SELECTOR_CATEGORIES_CONTAINER=".c-filters-subject",this.isDirty=!1,this.init()}init(){if(this.searchTextEl=this.element.querySelector(this.SELECTOR_TEXTSEARCH),this.currentQuery=this.parm.currentQuery,this.currentPage=1,this.entityTypeKey=this.parm.entityTypeKey.toLowerCase(),!this.parm.hasCategorySelection){const t=this.getInitialAjaxData();this.doAjaxRequest(t)}this.bindDialogEvents(),this.bindListerEvents(),this.bindSearchChange(),this.bindClearButton(),this.nestedDialogsWorkAround();const t=this.element.querySelector("#modal-category-selection"),e=this.element.querySelector("#modal-catalog-search");t&&(this.categorySelectionDialog=new d.Vq(t)),e&&(this.catalogSearchDialog=new p(e,this.parm.defaultCatalogSearchTitle));let i=this.element.querySelector(`#${this.SELECTOR_TABLE_CONTAINER}`);if(!i)return;this.reInitCompsOnDomChangeFor(i,!1);let s=this.element.querySelector(`#${this.SELECTOR_TABLE_CUSTOM_CONTAINER}`);s&&this.reInitCompsOnDomChangeFor(s,!1)}bindDialogEvents(){document.querySelectorAll(this.SELECTOR_OPEN_CATALOG_SEARCH).forEac
1h((t=>t.addEventListener("click",(()=>{if(this.filterOnFavorites=!1,this.categorySelectionDialog)this.resetHighlightedSelectedCategory(),this.categorySelectionDialog.show();else{const t=this.getInitialAjaxData();this.doAjaxRequest(t).then((()=>{this.catalogSearchDialog.show()})),this.catalogSearchDialog.show()}})))),document.querySelectorAll(this.SELECTOR_OPEN_CATALOG_SEARCH_FOR_FAVORITES).forEach((t=>t.addEventListener("click",(t=>{const e=t.target.closest("li").dataset.dialogTitle;this.catalogSearchDialog.setTitle(e),this.filterOnFavorites=!0,this.currentCategoryId=null;const i=this.element.querySelector("#tab-productsList-1-panel");if(i instanceof HTMLElement&&i.matches(".js-tabs-panel.is-active")&&this.parm.listUrl)this.doAjaxRequestCustomProducts().then((()=>{this.catalogSearchDialog.show()}));else{const t=this.getInitialAjaxData();this.doAjaxRequest(t).then((()=>{this.catalogSearchDialog.show()}))}})))),document.querySelectorAll(this.SELECTOR_OPEN_CATALOG_SEARCH_FOR_PROMAT_FAVORITES).forEach((t=>t.addEventListener("click",(t=>{const e=t.target.closest("li").dataset.dialogTitle;this.catalogSearchDialog.setTitle(e),this.filterOnFavorites=!0,this.currentCategoryId=null;const i=this.getInitialAjaxData();this.doAjaxRequest(i).then((()=>{this.catalogSearchDialog.show()}))})))),this.element.querySelectorAll(this.SELECTOR_FACET_MAP_SELECTION).forEach((t=>t.addEventListener("click",(t=>{this.currentCategoryId=t.target.dataset.categoryId,this.highlightSelectedCategory(),this.currentQuery=null,this.currentPage=null,this.searchTextEl.value=null,this.facetMapAndListUpdate(null,null,null,null,null).then((()=>{this.categorySelectionDialog.hide(),this.catalogSearchDialog.show()}))})))),this.element.addEventListener("click",(t=>{t.target.closest(this.SELECTOR_SPECIFIC_CATEGORY_CATALOG_SEARCH_CLOSE_BTN)&&(this.catalogSearchDialog.hide(),this.resetHighlightedSelectedCategory(),this.categorySelectionDialog.show())}))}resetHighlightedSelectedCategory(){this.element.querySelectorAll(this.SELECTOR_FACET_MAP_SELECTION).forEach((t=>{const e=t,i=t.parentElement;i.classList.add("is-disabled"),i.classList.remove("is-enabled"),e.checked=!1}))}highlightSelectedCategory(){this.element.querySelectorAll(this.SELECTOR_FACET_MAP_SELECTION).forEach((t=>{const e=t,i=t.parentElement;this.currentCategoryId&&e.dataset.categoryId===this.currentCategoryId?(i.classList.add("is-enabled"),i.classList.remove("is-disabled")):(i.classList.add("is-disabled"),i.classList.remove("is-enabled"),e.checked=!1)}))}bindListerEvents(){this.bindPaging(),this.bindFacetChange(),this.bindRangeChange(),this.bindRangeRemove(),this.bindEntityMethods(),this.bindCustomEntityMethods(),this.bindClose(),this.bindTabSelectionChange()}doAjaxRequest(t){const e=this.parm.updateUrl+"&filterOnFavorites="+this.filterOnFavorites+"&categoryId="+this.currentCategoryId+"&ts="+(new Date).getTime(),i=new a.o(e,t,!0);i.headers={"x-current-entity-id":this.parm.currentEntityId},this.absModal=this.element.querySelector(".js-abs-modal"),this.reInitCompsOnDomChangeFor(this.absModal.parentElement,!0);return this.ajaxWrapper.doFetch(i).then((t=>{t.clone().text().then((t=>{const e=new n.E(t),i=this.element.querySelector(`#${this.SELECTOR_TABLE_CONTAINER}`),s=this.element.querySelector(this.SELECTOR_FACETMAP_CONTAINER),a=this.element.querySelector(this.SELECTOR_PAGER_CONTAINER),r=this.element.querySelector(this.SELECTOR_TOTALCOUNT_CONTAINER),l=this.element.querySelector(this.SELECTOR_SEARCH_FILTER_CONTAINER),o=e.getComponentUpdate("emptystate");o?(i.innerHTML=o.content,s.classList.add("u-hidden"),a.classList.add("u-hidden"),r.classList.add("u-hidden")):(i.innerHTML=e.getComponentUpdate("list").content,s.classList.remove("u-hidden"),a.classList.remove("u-hidden"),r.classList.remove("u-hidden")),s.innerHTML=e.getComponentUpdate("facetmap").content,a.innerHTML=e.getComponentUpdate("pager").content,r.innerHTML=e.getComponentUpdate("totalcount").content,l.classList.remove("u-hidden"),new c.AbsModal(this.absModal),this.currentQuery=this.element.querySelector(this.SELECTOR_CURRENT_QUERY).value})),this.updating=!1}))}bindClose(){this.element.querySelector(".js-close-dialog").addEventListener("click",(()=>{this.isDirty&&o().publish(h.m.favoritesChangedFromDialog)}))}bindTabSelectionChange(){this.element.querySelectorAll("section.o-tabs__panel-item").forEach((t=>{new MutationObserver((t=>{t.forEach((t=>{if("attributes"===t.type&&"class"===t.attributeName){const e=t.target;if(!e.matches(".js-tabs-panel.is-active"))return;if("tab-productsList-1-panel"==e.id)this.doAjaxRequestCustomProducts();else{const t=this.getInitialAjaxData();this.doAjaxRequest(t)}}}))})).observe(t,{attributes:!0,attributeFilter:["class"]})}))}bindSearchChange(){let t=this.element.querySelector(this.SELECTOR_TEXTSEARCH);t.addEventListener("keypress",(e=>{var i=t.value;13===e.which&&(e.preventDefault(),(i=t.value)&&i.length>0?this.facetMapAndListUpdate(null,null,this.currentQuery,null,i):this.facetMapAndListUpdate(null,null,null,null,null))})),t.addEventListener("keyup",(e=>{var i=t.value,s=this.element.querySelector(this.SELECTOR_CLEAR_BUTTON);i&&i.length>0?s.classList.remove(this.SELECTOR_HIDDEN):s.classList.add(this.SELECTOR_HIDDEN)}))}bindClearButton(){let t=this.element.querySelector(this.SELECTOR_CLEAR_BUTTON);t.addEventListener("click",(()=>{let e=this.element.querySelector(this.SELECTOR_TEXTSEARCH),i=e.value;i&&i.length>0&&(e.value="",this.facetMapAndListUpdate(null,null,null,null,null)),this.showAndHide(t,null)}))}bindRangeChange(){u.Z.bindRangeChange(this,this.element,y,this.selectionChanged)}bindRangeRemove(){u.Z.bindRangeRemove(this,this.element,S,this.selectionChanged)}bindFacetChange(){this.element.addEventListener("click",(t=>{var e=t.target.closest(m);if(e){var i=e.parentElement.querySelector("input"),s=!i.checked;if(i.attributes.getNamedItem(g)){var a=i.attributes.getNamedItem(g).value,
1n=i.attributes.getNamedItem("value").value;this.selectionChanged(s,a,n)}}}))}bindPaging(){this.element.addEventListener("click",(t=>{var e=t.target.closest(`[${this.SELECTOR_DATA_PAGE}]`);if(e){var i=parseInt(e.attributes.getNamedItem(this.SELECTOR_DATA_PAGE).value);this.currentPage=i;var s=this.parm.pagingUrl+"&filterOnFavorites="+this.filterOnFavorites+"&categoryId="+this.currentCategoryId+"&ts="+(new Date).getTime();if(0===(i=parseInt(e.attributes.getNamedItem(C).value)))return;this.currentPage=i;var r={currentQuery:this.currentQuery,pageNumber:this.currentPage},l=new a.o(s,r,!0);l.headers={"x-current-entity-id":this.parm.currentEntityId},this.ajaxWrapper.doFetch(l).then((t=>{t.clone().text().then((t=>{var e=new n.E(t),i=this.element.querySelector(`#${this.SELECTOR_TABLE_CONTAINER}`),s=this.element.querySelector(this.SELECTOR_PAGER_CONTAINER),a=this.element.querySelector(this.SELECTOR_TOTALCOUNT_CONTAINER),r=this.element.querySelector(this.SELECTOR_SEARCH_FILTER_CONTAINER);i.innerHTML=e.getComponentUpdate("list").content,s.innerHTML=e.getComponentUpdate("pager").content,a.innerHTML=e.getComponentUpdate("totalcount").content,r.classList.remove("u-hidden")}))}))}}))}onPagingUpdate(t){this.updating=!1}bindEntityMethods(){var t=this.element.querySelector(`#${this.SELECTOR_TABLE_CONTAINER}`);t&&t.addEventListener("click",(t=>{var e=t.target.closest("[data-js]");e&&("addEntity"===e.attributes.getNamedItem("data-js").value?this.addEntity(e):this.removeEntity(e))}))}bindCustomEntityMethods(){var t=this.element.querySelector(`#${this.SELECTOR_TABLE_CUSTOM_CONTAINER}`);t&&t.addEventListener("click",(t=>{var e=t.target.closest("[data-js]");e&&("addCustomEntity"===e.attributes.getNamedItem("data-js").value?this.addCustomEntity(e):this.removeCustomEntity(e))}))}selectionChanged(t,e,i){this.updating||this.facetMapAndListUpdate(e,i,this.currentQuery,t,null)}facetMapAndListUpdate(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;this.updating=!0;const n={preFilter:"",currentQuery:i,facet:t,facetValue:e,selectFacetValue:!!e&&s,searchText:a};return this.doAjaxRequest(n)}removeEntity(t){var e=t.closest(`[${this.SELECTOR_DATA_ID}]`).attributes.getNamedItem(this.SELECTOR_DATA_ID).value;if(e){let s=this.getOtherButton(t),n=this.getTransitionButton(t);if(this.showAndHide(t,n),0==this.parm.purpose)r.Z.getInstance(this.entityTypeKey).deleteFavorite(e,(()=>{o().publish(h.m.entityUnselected,new h.Q(e,this.parm.entityTypeKey)),this.showAndHide(n,s)}));else if(1==this.parm.purpose){let t={identifier:this.parm.currentEntityId,entityType:this.parm.entityTypeKey,externalIdentifiers:[]};t.externalIdentifiers.push(e);var i=new a.o(L,t,!1);i.method="POST",this.ajaxWrapper.doFetch(i).then((()=>{o().publish(h.m.entityUnselected,new h.Q(e,this.parm.entityTypeKey)),this.showAndHide(n,s)}))}}this.isDirty=!0}addEntity(t){var e=t.closest(`[${this.SELECTOR_DATA_ID}]`).attributes.getNamedItem(this.SELECTOR_DATA_ID).value;if(e){let s=this.getOtherButton(t),n=this.getTransitionButton(t);if(this.showAndHide(t,n),0==this.parm.purpose)r.Z.getInstance(this.entityTypeKey).addFavorite(e,(()=>this.showAndHide(n,s)));else if(1==this.parm.purpose){let t={identifier:this.parm.currentEntityId,entityType:this.parm.entityTypeKey,externalIdentifiers:[]};t.externalIdentifiers.push(e);var i=new a.o(O,t,!1);this.ajaxWrapper.doFetch(i).then((()=>{this.showAndHide(n,s)}))}}this.isDirty=!0}removeCustomEntity(t){var e=t.closest(`[${this.SELECTOR_DATA_ID}]`).attributes.getNamedItem(this.SELECTOR_DATA_ID).value;if(e&&this.parm.currentEntityId){let s=this.getOtherButton(t),n=this.getTransitionButton(t);if(this.showAndHide(t,n),1==this.parm.purpose){let t={identifier:this.parm.currentEntityId,entityType:this.parm.customEntityTypeKey,externalIdentifiers:[]};t.externalIdentifiers.push(e);var i=new a.o(L,t,!1);i.method="POST",this.ajaxWrapper.doFetch(i).then((()=>{o().publish(h.m.entityUnselected,new h.Q(e,this.parm.customEntityTypeKey)),this.showAndHide(n,s)}))}}this.isDirty=!0}addCustomEntity(t){var e=t.closest(`[${this.SELECTOR_DATA_ID}]`).attributes.getNamedItem(this.SELECTOR_DATA_ID).value;if(e&&this.parm.currentEntityId){let s=this.getOtherButton(t),n=this.getTransitionButton(t);if(this.showAndHide(t,n),1==this.parm.purpose){let t={identifier:this.parm.currentEntityId,entityType:this.parm.customEntityTypeKey,externalIdentifiers:[]};t.externalIdentifiers.push(e);var i=new a.o(O,t,!1);this.ajaxWrapper.doFetch(i).then((()=>{this.showAndHide(n,s)}))}}this.isDirty=!0}showAndHide(t,e){this.toggleHidden(t),e&&this.toggleHidden(e)}toggleHidden(t){t.classList.contains(this.SELECTOR_HIDDEN)?t.classList.remove(this.SELECTOR_HIDDEN):t.classList.add(this.SELECTOR_HIDDEN)}getOtherButton(t){var e,i=t.attributes.getNamedItem("data-js").value;return t.parentElement.querySelectorAll("[data-js]").forEach((t=>{var s=t.attributes.getNamedItem("data-js").value;s.includes("Transition")||s.includes(i)||(e=t)})),e}getTransitionButton(t){var e,i=t.attributes.getNamedItem("data-js").value;return t.parentElement.querySelectorAll("[data-js]").forEach((t=>{t.attributes.getNamedItem("data-js").value===i+"Transition"&&(e=t)})),e}nestedDialogsWorkAround(){this.element.querySelector(this.SELECTOR_CLOSE_DIALOG).addEventListener("click",(()=>{const t=this.getInitialAjaxData();this.doAjaxRequest(t)}))}getInitialAjaxData(){return{preFilter:"",currentQuery:this.currentQuery,facet:null,facetValue:null,selectFacetValue:!1,searchText:null}}doAjaxRequestCustomProducts(){var t=this.parm.listUrl+"&ts="+(new Date).getTime(),e=new a.o(t,null,!0);null!==this.parm.currentEntityId&&(e.headers={"x-current-entity-id":this.parm.currentEntityId}),this.absModal=this.element.querySelector(".js-abs-modal"),this.reInitCompsOnDomChangeFor(this.absModal.parentElement,!0);return this.ajaxWrapper.doFetch(e).then((t=>{t.clone().text().then((t=>{const e=this.element.querySelector(`#${this.SELECTOR_TABLE_CUSTOM_CONTAINER}`),i=this.element.querySelector(this.SELECTOR_TOTALCOUNT_CONTAINER),s=this.element.querySelector(A),a=this.element.querySelector(this.SELECTOR_CATEGORIES_CONTAINER),r=this.element.querySelector(this.SELECTOR_SEARCH_FILTER_CONTAINER),l=this.element.querySelector(this.SELECTOR_PAGER_CONTAINER);let o=new n.E(t);o.getComponentUpdate("list").json.totalCount<=0?(s.classList.remove("u-hidden"),e.classList.add("u-hidden")):e&&(this.isDirty||(e.innerHTML=o.getComponentUpdate("list").content),i.innerHTML=o.getComponentUpdate("totalCount").content,a.classList.add("u-hidden"),r.classList.add("u-hidden"),l.classList.add("u-hidden")),new c.AbsModal(this.absModal),this.updating=!1}))}))}}}
1,66497:function(t,e,i){i.d(e,{Q:function(){return s},m:function(){return a}});class s{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";this.entityId=t,this.entityType=e,this.entityName=i,this.entityImgUrl=s,this.entityUrl=a}}class a{}a.entitySelected="entity-selected",a.entityUnselected="entity-unselected",a.favoritesBulkDeleted="favorites-bulk-delete",a.favoritesChangedFromDialog="favoritesChangedFromDialog",a.entityRemoved="entityRemoved",a.externalProductCreatedOrUpdated="externalProductCreatedOrUpdated"},76356:function(t,e,i){i.d(e,{Z:function(){return s}});class s{static bindRangeChange(t,e,i,s){e.addEventListener("focusout",(a=>{const n=a.target.closest(i);if(n){const i=n.dataset.facetName,a=e.querySelector(`[data-facet-name='${i}'][class~="js-range-input-min"]`),r=e.querySelector(`[data-facet-name='${i}'][class~="js-range-input-max"]`);let l=this.convertToFloat(a.min),o=this.convertToFloat(a.max),h=this.convertToFloat(a.value),
1c=this.convertToFloat(r.value);const d=this.convertToFloat(a.dataset.userSelected),u=this.convertToFloat(r.dataset.userSelected);if(h<l&&(h=l),c>o&&(c=o),c<h){const t=c;c=h,h=t}if(a.value=h.toString(),r.value=c.toString(),h!==d||c!==u){Number.isNaN(h)&&(h=parseFloat(a.min)),Number.isNaN(c)&&(c=parseFloat(r.max)),a.max=c.toString(),r.min=h.toString();const e=`${h}-${c}`;s.call(t,!0,i,e)}}}))}static bindRangeRemove(t,e,i,s){e.addEventListener("click",(e=>{const a=e.target.closest(i);if(a){const e=a.dataset.facetName;s.call(t,!0,e,null)}}))}static convertToFloat(t){return t?parseFloat(t.toString().replace(",",".")):NaN}}},83491:function(t,e,i){i.d(e,{E:function(){return n}});var s=i(47277),a=i.n(s);class n{constructor(t){this.rawResponse=t,this.response=a()(t)}getComponentUpdate(t){var e=this.response.filter("[data-component="+t+"]");return e.length?{content:e.html().trim(),json:a().parseJSON(e.find("script[type='json']")[0].innerHTML)}:null}getChildComponentUpdate(t){var e=this.response.find("[data-component="+t+"]");return e.length?{content:e[0].innerHTML,json:a().parseJSON(this.response.find("script")[0].innerHTML)}:null}}}}]);

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.