1import{$ as d}from"./jquery-BoRPd-fL.js";import{S as O}from"./SelectField-Cxo3mcWb.js";import{c as v,S as y,a as _}from"../main-IQqeOzm7.js";import{S as u}from"./Scroller-RoBd6nFi.js";import{H as E}from"./Header-CzerSYeI.js";import{B as w}from"./Btn-mNwuUIh4.js";import{C as H}from"./Card-9DzIZX-T.js";import{W as S}from"./Wysiwyg-Dty2g2dl.js";import{T as I}from"./Tabs-Bdl87Nup.js";import{S as L}from"./SocialMedia-Cg9yHyXw.js";import{P as x}from"./Pagination-BJ-GL264.js";import{T as k}from"./TextField-4YyfPyyG.js";import{A as B}from"./ArticleAside-BdXSzJBA.js";import{R as A}from"./Recaptcha-L0vwRNE3.js";import"./_commonjsHelpers-CqkleIqs.js";import"./InputActions-DuSxCZt4.js";import"./FormBase-DxENdrze.js";/* empty css */import"./baguetteBox-Blr6zO0w.js";import"./AssetUrl-B5-qCeML.js";import"./plyr-player-config-DZLxEWYB.js";class V{constructor(){this.htmlEntitiesToReplace={"&":"&","<":"<",">":">",'"':"""}}escapeHTMLEntities(t){return t.replace(/[&<>"]/g,e=>this.htmlEntitiesToReplace[e]||e)}}const g={scrollDuration:1e3,scrollOffsetToActive:140,minimumTopOffset:120,navigationBuffer:12,desktopMediaQuery:"(min-width: 992px)",desktopNextSectionVisibilityOffset:50},f={collapsed:"blog__toc--collapsed",activeItem:"blog__toc-item--active",visitedItem:"blog__toc-item--visited",toggleRipple:"blog__toc-toggle-ripple",linkRipple:"blog__toc-link-ripple"},c={tableOfContents:'[data-js="blog-toc"]',tableOfContentsContainer:"[data-toc-container]",navigation:'[data-js="navigation"]',item:".blog__toc-item",link:".blog__toc-link",linkText:".blog__toc-link-text",toggle:'[data-js="blog-toc-toggle"]',listWrapper:".blog__toc-list-wrapper",activeIndicator:'[data-js="blog-toc-active-indicator"]',toggleIconWrapper:".blog__toc-toggle-icon-wrapper"},C={sector:"navigation--sector",sectorScroll:"navigation--sector-scroll"},N={titleHeight:"--blog-toc-title-height"};class M{constructor(t,e){this.element=t,this.processing=!1,this.blogItems=[],this.sanitizer=new V,this.tableOfContents=[],this.handleTableOfContentsViewportChange=null,this.spinner=e.find(i=>i instanceof _),this.run()}run(){this.initTableOfContents(),this.filterContainer=this.element.getElementsByClassName("blog-list__filter")[0],this.blogListContainer=this.element.getElementsByClassName("blog-list__container--animatable")[0],this.blogList=this.element.getElementsByClassName("blog-list__list")[0],this.$moreBtn=d(this.element).find(".blog-list__show-category-btn"),this.tabs=this.element.getElementsByClassName("blog-list__tab"),this.goToCategoryBtn=this.element.getElementsByClassName("blog-list__show-category-btn")[0],this.selectYearElement=d(this.element).find(".blog-list__select-year").chosen({hide_results_on_select:!1,disable_search:!0}),this.filterContainer!==void 0&&this.blogList!==void 0&&(this.noPostsText=this.filterContainer.dataset.noPostsText,this.init())}init(){const t=this.element.getElementsByClassName("c-tabs-nav__item--active")[0];t!==void 0&&(this.loadItemsByUrl(t.dataset.categoryPath),this.reloadItemsOnTabChange(),this.selectYear())}initTableOfContents(){const t=Array.from(this.element.querySelectorAll(c.tableOfContents));if(this.tableOfContents=t.map(e=>this.createTableOfContentsInstance(e)).filter(Boolean),this.tableOfContents.length===0){this.setMobileTableOfContentsViewportOffset(!1);return}this.getUpdateTableOfContentsHandler(),this.handleTableOfContentsViewportChange=this.getTableOfContentsViewportChangeHandler(),this.syncTableOfContentsLayoutMetrics(),this.handleTableOfContentsViewportChange(),this.scheduleTableOfContentsUpdate(),window.addEventListener("scroll",this.scheduleTableOfContentsUpdate,{passive:!0}),window.addEventListener("resize",this.handleTableOfContentsViewportChange,{passive:!0})}createTableOfContentsInstance(t){const i=Array.from(t.querySelectorAll(c.item)).map(a=>{const p=a.getAttribute("data-anchor"),h=a.querySelector(c.link),m=a.querySelector(c.linkText);if(!p||!h||!m)return null;const b=this.getTargetElementByAnchor(p);return b?(h.addEventListener("click",this.getTableOfContentsClickHandler(b,m,t)),{anchor:p,itemElement:a,linkElement:h,linkTextElement:m,targetElement:b}):null}
1).filter(Boolean);if(i.length===0)return null;const s=t.querySelector(c.toggle),n=t.querySelector(c.listWrapper),o=t.querySelector(c.activeIndicator),l=t.querySelector(c.toggleIconWrapper),r={tableOfContentsElement:t,tableOfContentsContainerElement:t.closest(c.tableOfContentsContainer),items:i,titleElement:s,listWrapperElement:n,activeIndicatorElement:o,toggleIconWrapperElement:l,isCollapsed:!1,isDesktopViewport:null,activeItem:null};if(s&&n){const a=this.getTableOfContentsToggleHandler(r),p=this.getTableOfContentsToggleKeydownHandler(a);s.addEventListener("click",a),s.addEventListener("keydown",p)}return r}getTableOfContentsToggleHandler(t){return()=>{const e=this.isDesktopTableOfContentsViewport();this.setTableOfContentsCollapsedState(t,!t.isCollapsed),this.updateDesktopTableOfContentsHeight(t,e),this.triggerToggleRipple(t),t.isCollapsed?this.setTableOfContentsActiveIndicatorVisibility(t,!1):this.updateTableOfContentsActiveIndicator(t,t.activeItem)}}triggerToggleRipple(t){const e=t.toggleIconWrapperElement;if(!e)return;const i=e.querySelector(`.${f.toggleRipple}`);i&&i.remove();const s=document.createElement("span");s.className=f.toggleRipple,s.addEventListener("animationend",()=>{s.remove()},{once:!0}),e.appendChild(s)}getTableOfContentsToggleKeydownHandler(t){return e=>{e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),t())}}getTableOfContentsViewportChangeHandler(){return()=>{const t=this.isDesktopTableOfContentsViewport();this.syncTableOfContentsLayoutMetrics(),this.setMobileTableOfContentsViewportOffset(!t),this.tableOfContents.forEach(e=>{this.syncTableOfContentsViewportState(e,t),this.updateDesktopTableOfContentsHeight(e,t)}),this.scheduleTableOfContentsUpdate()}}syncTableOfContentsViewportState(t,e){t.isDesktopViewport!==e&&(t.isDesktopViewport=e,this.setTableOfContentsCollapsedState(t,!e),t.isCollapsed?this.setTableOfContentsActiveIndicatorVisibility(t,!1):this.updateTableOfContentsActiveIndicator(t,t.activeItem))}isDesktopTableOfContentsViewport(){return window.matchMedia(g.desktopMediaQuery).matches}syncTableOfContentsLayoutMetrics(){this.tableOfContents.forEach(t=>{this.syncTableOfContentsLayoutMetricsForItem(t)})}syncTableOfContentsLayoutMetricsForItem(t){const e=this.getTableOfContentsTitleHeight(t);e>0&&this.setTableOfContentsCssVariable(t,N.titleHeight,`${e}px`)}setTableOfContentsCssVariable(t,e,i){t.tableOfContentsElement.style.setProperty(e,i)}updateDesktopTableOfContentsHeight(t,e){if(!t.listWrapperElement)return;if(!e){t.listWrapperElement.style.maxHeight="";return}if(t.isCollapsed)return;const i=this.getTableOfContentsTitleHeight(t),s=t.listWrapperElement.scrollHeight,n=this.getTableOfContentsNextSiblingElement(t);let o=s;if(n){const l=n.getBoundingClientRect().top,r=window.innerHeight-g.desktopNextSectionVisibilityOffset,p=t.tableOfContentsElement.offsetHeight+(r-l);o=Math.min(s,Math.max(0,p-i))}t.listWrapperElement.style.maxHeight=`${Math.round(o)}px`}setMobileTableOfContentsViewportOffset(t){if(!t){document.body.style.paddingBottom="";return}const e=this.tableOfContents.map(s=>this.getTableOfContentsTitleHeight(s)).filter(Boolean),i=e.length>0?Math.max(...e):0;document.body.style.paddingBottom=`calc(${i}px + env(safe-area-inset-bottom, 0px))`}getTableOfContentsTitleHeight(t){return t.titleElement?t.titleElement.offsetHeight:0}getTableOfContentsByElement(t){return this.tableOfContents.find(e=>e.tableOfContentsElement===t)||null}getTableOfContentsNextSiblingElement(t){return t.tableOfContentsContainerElement?t.tableOfContentsContainerElement.nextElementSibling:null}setTableOfContentsActiveIndicatorVisibility(t,e){t.activeIndicatorElement&&(t.activeIndicatorElement.style.opacity=e?"1":"0")}setTableOfContentsCollapsedState(t,e){t.isCollapsed=e,t.tableOfContentsElement.classList.toggle(f.collapsed,t.isCollapsed),t.titleElement&&t.titleElement.setAttribute("aria-expanded",String(!t.isCollapsed))}getTableOfContentsClickHandler(t,e,i){return s=>{if(s.preventDefault(),this.triggerTableOfContentsLinkRipple(s,e),!this.isDesktopTableOfContentsViewport()){const l=this.getTableOfContentsByElement(i);l&&(this.setTableOfContentsCollapsedState(l,!0),this.setTableOfContentsActiveIndicatorVisibility(l,!1))}const n=this.getNavigationOffsetForTarget(t),o=t.offsetTop-this.getMarginTopOfElement(t)-n;u.scrollToPosition(o,g.scrollDuration)}}triggerTableOfContentsLinkRipple(t,e){if(!e)return;const i=e.querySelector(`.${f.linkRipple}`);i&&i.remove();const s=e.getBoundingClientRect(),n=Math.max(s.width,s.height),o=n/2,l=t.clientX||s.left+s.width/2,r=t.clientY||s.top+s.height/2,a=document.createElement("span");a.className=f.linkRipple,a.style.width=`${n}px`,a.style.height=`${n}px`,a.style.left=`${l-s.left-o}px`,a.style.top=`${r-s.top-o}px`,a.addEventListener("animationend",()=>{a.remove()},{once:!0}),e.appendChild(a)}getTargetElementByAnchor(t){if(!t)return null;const e=t.charAt(0)==="#"?t.substring(1):t;return e===""?null:document.getElementById(e)}getUpdateTableOfContentsHandler(){this.tableOfContentsUpdateScheduled=!1;const t=()=>{this.tableOfContentsUpdateScheduled=!1;const i=window.pageYOffset+this.getCurrentNavigationOffset()+g.scrollOffsetToActive,s=this.isDesktopTableOfContentsViewport();
1this.tableOfContents.forEach(n=>{this.updateDesktopTableOfContentsHeight(n,s),this.updateActiveTableOfContentsItem(n,i)})};return this.scheduleTableOfContentsUpdate=()=>{this.tableOfContentsUpdateScheduled||(this.tableOfContentsUpdateScheduled=!0,window.requestAnimationFrame(t))},t}updateActiveTableOfContentsItem(t,e){let i=null,s=-1;for(let n=0;n<t.items.length;n+=1){const o=t.items[n];if(e>=o.targetElement.offsetTop)i=o,s=n;else break}i!==t.activeItem&&(this.applyActiveTableOfContentsClasses(t,s),t.activeItem=i,this.scrollTableOfContentsToActiveItem(t,i)),this.updateTableOfContentsActiveIndicator(t,i)}applyActiveTableOfContentsClasses(t,e){t.items.forEach((i,s)=>{const n=i.itemElement,o=s===e,l=e>-1&&s<e;n.classList.toggle(f.activeItem,o),n.classList.toggle(f.visitedItem,l)})}scrollTableOfContentsToActiveItem(t,e){if(!t.listWrapperElement||!e)return;const i=t.listWrapperElement;if(i.scrollHeight<=i.clientHeight)return;const s=e.itemElement,n=s.offsetTop,o=s.offsetHeight,l=i.clientHeight,r=i.scrollHeight-l,a=Math.min(Math.max(0,n+o/2-l/2),r);i.scrollTo({top:a,behavior:"smooth"})}updateTableOfContentsActiveIndicator(t,e){if(!t.activeIndicatorElement||!t.listWrapperElement)return;if(!e||t.isCollapsed){this.setTableOfContentsActiveIndicatorVisibility(t,!1);return}const i=e.linkElement,s=t.activeIndicatorElement,n=i.offsetLeft,o=i.offsetTop,l=i.offsetHeight;s.style.left=`${n}px`,s.style.height=`${l}px`,s.style.transform=`translate3d(0, ${o}px, 0)`,this.setTableOfContentsActiveIndicatorVisibility(t,!0)}getNavigationElements(){return Array.from(document.querySelectorAll(c.navigation))}getPrimaryNavigationHeight(t){const e=t[0]||null;return e?e.offsetHeight:0}getVisibleSectorNavigationHeight(t){const e=t.slice(1).find(i=>i.classList.contains(C.sector));return!e||e.classList.contains(C.sectorScroll)?0:e.offsetHeight}getCurrentNavigationOffset(){const t=this.getNavigationElements(),e=this.getPrimaryNavigationHeight(t)+this.getVisibleSectorNavigationHeight(t);return Math.max(e+g.navigationBuffer,g.minimumTopOffset)}getNavigationOffsetForTarget(t){if(!t)return g.minimumTopOffset;const e=this.getNavigationElements(),i=window.pageYOffset,s=t.offsetTop-this.getMarginTopOfElement(t),n=i<s,o=this.getPrimaryNavigationHeight(e),l=n?0:this.getVisibleSectorNavigationHeight(e),r=o+l;return Math.max(r+g.navigationBuffer,g.minimumTopOffset)}getMarginTopOfElement(t){const e=t.currentStyle||window.getComputedStyle(t);return parseInt(e.marginTop,10)||0}reloadItemsOnTabChange(){Array.from(this.tabs).forEach(t=>{t.addEventListener("click",()=>{this.loadItemsByUrl(t.dataset.categoryPath)})})}updateGoToCategoryBtn(t){this.goToCategoryBtn.href=t,this.goToCategoryBtn.style.display=this.blogItems.length===0?"none":"inline-flex"}loadItemsByUrl(t){const e=this;this.processing||(this.processing=!0,e.blogListContainer.classList.remove("blog-list__container--shown"),this.spinner.show(),d.ajax({type:"GET",url:t,cache:!1,data:this.ajaxData,beforeSend(i){i.setRequestHeader("X-Readonly-Session",1)},success(i){e.blogList.innerHTML="",i.length>0?(e.blogItems=i,e.blogItems.forEach(s=>{const n=e.getItemTemplate(s);d(e.blogList).append(n)}),e.updateGoToCategoryBtn(t),e.$moreBtn.show()):(d(e.blogList).append(e.getNoItemsTemplate()),e.$moreBtn.hide()),e.blogListContainer.classList.add("blog-list__container--shown"),e.spinner.hide(),e.processing=!1,u.triggerScrollEvent()},error(i){console.error(i)}}))}selectYear(){this.selectYearElement&&this.selectYearElement.on("change",(t,e)=>{this.ajaxData=e.selected.length>0?{year:e.selected}:null;const i=this.filterContainer.querySelector(".c-tabs-nav__item--active").dataset.categoryPath;this.loadItemsByUrl(i)})}getNoItemsTemplate(){return`<div class="grid__col--12 mt--8 h-wysiwyg"> 2 <p>${this.noPostsText&&this.noPostsText.length>0?this.noPostsText:"Brak artykuÅów w tej kategorii."}</p> 3 </div>`}escapeHTMLEntities(t){return this.sanitizer.escapeHTMLEntities(t)}getItemTemplate(t){const e=!!parseInt(t.show_update_date,10),i=this.blogListContainer.getAttribute("translateUpdated");let s=`<div class="grid__col--4 mt--8"> 4 <div class="card"> 5 <a href="${t.url_path}" 6 class="card__wrapper h-text-dimming" 7 title="${this.escapeHTMLEntities(t.title)}">`;return t.picture!==""&&(s+=` 8 <div class="card__img-wrapper"> 9 <figure class="progressive"> 10 <img 11 class="placeholder preview lazy card__img" 12 data-progressive-class="card__img" 13 data-js="img-converter" 14 data-src="${t.picture_mobile}" 15 src="${t.picture_progressive}" 16 loading="lazy" 17 alt="${this.escapeHTMLEntities(t.title)}" 18 /> 19 </figure> 20 </div>`),s+=`<div class="card__body"> 21 <div class="card__metadata"> 22 <div class="card__data"> 23 <div>${t.date_publish}</div>`,e&&(s+=`<div class="card__data-updated">${i}: ${t.set_update_date.substring(0,10)}</div>`),s+="</div>",t.reading_time!=null&&(s+=`<div class="card__place">${t.reading_time} min</div>`),s+=`</div> 24 <div class="card__title"> 25 ${this.escapeHTMLEntities(t.title)} 26 </div> 27 <p class="card__text h-text-blur"> 28 ${this.escapeHTMLEntities(t.short_description)} 29 </p> 30 </div> 31 </a> 32 </div> 33 </div>`,s}}const nt=v(M,".m-blog",[E,w,H,S,I,L,x,O,k,y,B,A]);export{M as BlogModule,nt as default};
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.