PageSourceSearch

https://www.advania.se/hubfs/hub_generated/template_assets/1/281478499551/1789989332781/template_app.min.js

js advania.se collected 2026-09-24 17:58:32 UTC 94,178 bytes, 3 lines download raw bytes

1/*! For license information please see app.js.LICENSE.txt */
2(()=>{var t={158:function(t){var e,i;e="undefined"!=typeof window?window:this,i=function(){function t(){}let e=t.prototype;return e.on=function(t,e){if(!t||!e)return this;let i=this._events=this._events||{},s=i[t]=i[t]||[];return s.includes(e)||s.push(e),this},e.once=function(t,e){if(!t||!e)return this;this.on(t,e);let i=this._onceEvents=this._onceEvents||{};return(i[t]=i[t]||{})[e]=!0,this},e.off=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;let s=i.indexOf(e);return-1!=s&&i.splice(s,1),this},e.emitEvent=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;i=i.slice(0),e=e||[];let s=this._onceEvents&&this._onceEvents[t];for(let n of i)s&&s[n]&&(this.off(t,n),delete s[n]),n.apply(this,e);return this},e.allOff=function(){return delete this._events,delete this._onceEvents,this},t},t.exports?t.exports=i():e.EvEmitter=i()},47:function(t){var e,i;e=this,i=function(t){let e={extend:function(t,e){return Object.assign(t,e)},modulo:function(t,e){return(t%e+e)%e},makeArray:function(t){return Array.isArray(t)?t:null==t?[]:"object"==typeof t&&"number"==typeof t.length?[...t]:[t]},removeFrom:function(t,e){let i=t.indexOf(e);-1!=i&&t.splice(i,1)},getParent:function(t,e){for(;t.parentNode&&t!=document.body;)if((t=t.parentNode).matches(e))return t},getQueryElement:function(t){return"string"==typeof t?document.querySelector(t):t},handleEvent:function(t){let e="on"+t.type;this[e]&&this[e](t)},filterFindElements:function(t,i){return(t=e.makeArray(t)).filter(t=>t instanceof HTMLElement).reduce((t,e)=>{if(!i)return t.push(e),t;e.matches(i)&&t.push(e);let s=e.querySelectorAll(i);return t.concat(...s)},[])},debounceMethod:function(t,e,i){i=i||100;let s=t.prototype[e],n=e+"Timeout";t.prototype[e]=function(){clearTimeout(this[n]);let t=arguments;this[n]=setTimeout(()=>{s.apply(this,t),delete this[n]},i)}},docReady:function(t){let e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},toDashed:function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()}},i=t.console;return e.htmlInit=function(s,n){e.docReady(function(){let o="data-"+e.toDashed(n),r=document.querySelectorAll(`[${o}]`),l=t.jQuery;[...r].forEach(t=>{let e,r=t.getAttribute(o);try{e=r&&JSON.parse(r)}catch(e){return void(i&&i.error(`Error parsing ${o} on ${t.className}: ${e}`))}let a=new s(t,e);l&&l.data(t,n,a)})})},e},t.exports?t.exports=i(e):e.fizzyUIUtils=i(e)},31:function(t,e,i){!function(e,s){t.exports?t.exports=s(i(442),i(47)):s(e.Flickity,e.fizzyUIUtils)}("undefined"!=typeof window?window:this,function(t,e){let i=t.Slide;i.prototype.renderFadePosition=function(){},i.prototype.setOpacity=function(t){this.cells.forEach(e=>{e.element.style.opacity=t})},t.create.fade=function(){this.fadeIndex=this.selectedIndex,this.prevSelectedIndex=this.selectedIndex,this.on("select",this.onSelectFade),this.on("dragEnd",this.onDragEndFade),this.on("settle",this.onSettleFade),this.on("activate",this.onActivateFade),this.on("deactivate",this.onDeactivateFade)};let s=t.prototype,n=s.updateSlides;s.updateSlides=function(){n.apply(this,arguments),this.options.fade&&this.slides.forEach((t,e)=>{let i=t.target-t.x,s=t.cells[0].x;t.cells.forEach(t=>{let e=t.x-s-i;this._renderCellPosition(t,e)});let n=e===this.selectedIndex?1:0;t.setOpacity(n)})},s.onSelectFade=function(){this.fadeIndex=Math.min(this.prevSelectedIndex,this.slides.length-1),this.prevSelectedIndex=this.selectedIndex},s.onSettleFade=function(){delete this.didDragEnd,this.options.fade&&(this.selectedSlide.setOpacity(1),this.slides[this.fadeIndex]&&this.fadeIndex!==this.selectedIndex&&this.slides[this.fadeIndex].setOpacity(0))},s.onDragEndFade=function(){this.didDragEnd=!0},s.onActivateFade=function(){this.options.fade&&this.element.classList.add("is-fade")},s.onDeactivateFade=function(){this.options.fade&&(this.element.classList.remove("is-fade"),this.slides.forEach(t=>{t.setOpacity("")}))};let o=s.positionSlider;s.positionSlider=function(){this.options.fade?(this.fadeSlides(),this.dispatchScrollEvent()):o.apply(this,arguments)};let r=s.positionSliderAtSelected;s.positionSliderAtSelected=function(){this.options.fade&&this.setTranslateX(0),r.apply(this,arguments)},s.fadeSlides=function(){if(this.slides.length<2)return;let t=this.getFadeIndexes(),e=this.slides[t.a],i=this.slides[t.b],s=this.wrapDifference(e.target,i.target),n=this.wrapDifference(e.target,-this.x);n/=s,e.setOpacity(1-n),i.setOpacity(n);let o=t.a;this.isDragging&&(o=n>.5?t.a:t.b),void 0!==this.fadeHideIndex&&this.fadeHideIndex!==o&&this.fadeHideIndex!==t.a&&this.fadeHideIndex!==t.b&&this.slides[this.fadeHideIndex].setOpacity(0),this.fadeHideIndex=o},s.getFadeIndexes=function(){return this.isDragging||this.didDragEnd?this.options.wrapAround?this.getFadeDragWrapIndexes():this.getFadeDragLimitIndexes():{a:this.fadeIndex,b:this.selectedIndex}},s.getFadeDragWrapIndexes=function(){let t=this.slides.map(function(t,e){return this.get
2SlideDistance(-this.x,e)},this),i=t.map(function(t){return Math.abs(t)}),s=Math.min(...i),n=i.indexOf(s),o=t[n],r=this.slides.length,l=o>=0?1:-1;return{a:n,b:e.modulo(n+l,r)}},s.getFadeDragLimitIndexes=function(){let t=0;for(let e=0;e<this.slides.length-1;e++){let i=this.slides[e];if(-this.x<i.target)break;t=e}return{a:t,b:t+1}},s.wrapDifference=function(t,e){let i=e-t;if(!this.options.wrapAround)return i;let s=i+this.slideableWidth,n=i-this.slideableWidth;return Math.abs(s)<Math.abs(i)&&(i=s),Math.abs(n)<Math.abs(i)&&(i=n),i};let l=s._updateWrapShiftCells;s._updateWrapShiftCells=function(){this.options.fade?this.isWrapping=this.getIsWrapping():l.apply(this,arguments)};let a=s.shiftWrapCells;return s.shiftWrapCells=function(){this.options.fade||a.apply(this,arguments)},t})},597:function(t,e,i){!function(e,s){t.exports?t.exports=s(i(680),i(47)):s(e.Flickity,e.fizzyUIUtils)}("undefined"!=typeof window?window:this,function(t,e){let i=t.prototype;return i.insert=function(t,e){let i=this._makeCells(t);if(!i||!i.length)return;let s=this.cells.length;e=void 0===e?s:e;let n=function(t){let e=document.createDocumentFragment();return t.forEach(t=>e.appendChild(t.element)),e}(i),o=e===s;if(o)this.slider.appendChild(n);else{let t=this.cells[e].element;this.slider.insertBefore(n,t)}if(0===e)this.cells=i.concat(this.cells);else if(o)this.cells=this.cells.concat(i);else{let t=this.cells.splice(e,s-e);this.cells=this.cells.concat(i).concat(t)}this._sizeCells(i),this.cellChange(e),this.positionSliderAtSelected()},i.append=function(t){this.insert(t,this.cells.length)},i.prepend=function(t){this.insert(t,0)},i.remove=function(t){let i=this.getCells(t);if(!i||!i.length)return;let s=this.cells.length-1;i.forEach(t=>{t.remove();let i=this.cells.indexOf(t);s=Math.min(i,s),e.removeFrom(this.cells,t)}),this.cellChange(s),this.positionSliderAtSelected()},i.cellSizeChange=function(t){let e=this.getCell(t);if(!e)return;e.getSize();let i=this.cells.indexOf(e);this.cellChange(i)},i.cellChange=function(t){let e=this.selectedElement;this._positionCells(t),this._updateWrapShiftCells(),this.setGallerySize();let i=this.getCell(e);i&&(this.selectedIndex=this.getCellSlideIndex(i)),this.selectedIndex=Math.min(this.slides.length-1,this.selectedIndex),this.emitEvent("cellChange",[t]),this.select(this.selectedIndex)},t})},880:function(t,e,i){!function(e,s){t.exports?t.exports=s(i(47)):(e.Flickity=e.Flickity||{},e.Flickity.animatePrototype=s(e.fizzyUIUtils))}("undefined"!=typeof window?window:this,function(t){let e={startAnimation:function(){this.isAnimating||(this.isAnimating=!0,this.restingFrames=0,this.animate())},animate:function(){this.applyDragForce(),this.applySelectedAttraction();let t=this.x;this.integratePhysics(),this.positionSlider(),this.settle(t),this.isAnimating&&requestAnimationFrame(()=>this.animate())},positionSlider:function(){let e=this.x;this.isWrapping&&(e=t.modulo(e,this.slideableWidth)-this.slideableWidth,this.shiftWrapCells(e)),this.setTranslateX(e,this.isAnimating),this.dispatchScrollEvent()},setTranslateX:function(t,e){t+=this.cursorPosition,this.options.rightToLeft&&(t=-t);let i=this.getPositionValue(t);this.slider.style.transform=e?`translate3d(${i},0,0)`:`translateX(${i})`},dispatchScrollEvent:function(){let t=this.slides[0];if(!t)return;let e=-this.x-t.target,i=e/this.slidesWidth;this.dispatchEvent("scroll",null,[i,e])},positionSliderAtSelected:function(){this.cells.length&&(this.x=-this.selectedSlide.target,this.velocity=0,this.positionSlider())},getPositionValue:function(t){return this.options.percentPosition?.01*Math.round(t/this.size.innerWidth*1e4)+"%":Math.round(t)+"px"},settle:function(t){!this.isPointerDown&&Math.round(100*this.x)===Math.round(100*t)&&this.restingFrames++,this.restingFrames>2&&(this.isAnimating=!1,delete this.isFreeScrolling,this.positionSlider(),this.dispatchEvent("settle",null,[this.selectedIndex]))},shiftWrapCells:function(t){let e=this.cursorPosition+t;this._shiftCells(this.beforeShiftCells,e,-1);let i=this.size.innerWidth-(t+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,i,1)}
2,_shiftCells:function(t,e,i){t.forEach(t=>{let s=e>0?i:0;this._wrapShiftCell(t,s),e-=t.size.outerWidth})},_unshiftCells:function(t){t&&t.length&&t.forEach(t=>this._wrapShiftCell(t,0))},_wrapShiftCell:function(t,e){this._renderCellPosition(t,t.x+this.slideableWidth*e)},integratePhysics:function(){this.x+=this.velocity,this.velocity*=this.getFrictionFactor()},applyForce:function(t){this.velocity+=t},getFrictionFactor:function(){return 1-this.options[this.isFreeScrolling?"freeScrollFriction":"friction"]},getRestingPosition:function(){return this.x+this.velocity/(1-this.getFrictionFactor())},applyDragForce:function(){if(!this.isDraggable||!this.isPointerDown)return;let t=this.dragX-this.x-this.velocity;this.applyForce(t)},applySelectedAttraction:function(){if(this.isDraggable&&this.isPointerDown||this.isFreeScrolling||!this.slides.length)return;let t=(-1*this.selectedSlide.target-this.x)*this.options.selectedAttraction;this.applyForce(t)}};return e})},229:function(t,e,i){!function(e,s){t.exports?t.exports=s(i(131)):(e.Flickity=e.Flickity||{},e.Flickity.Cell=s(e.getSize))}("undefined"!=typeof window?window:this,function(t){const e="flickity-cell";function i(t){this.element=t,this.element.classList.add(e),this.x=0,this.unselect()}let s=i.prototype;return s.destroy=function(){this.unselect(),this.element.classList.remove(e),this.element.style.transform="",this.element.removeAttribute("aria-hidden")},s.getSize=function(){this.size=t(this.element)},s.select=function(){this.element.classList.add("is-selected"),this.element.removeAttribute("aria-hidden")},s.unselect=function(){this.element.classList.remove("is-selected"),this.element.setAttribute("aria-hidden","true")},s.remove=function(){this.element.remove()},i})},680:function(t,e,i){!function(e,s){if(t.exports)t.exports=s(e,i(158),i(131),i(47),i(229),i(714),i(880));else{let t=e.Flickity;e.Flickity=s(e,e.EvEmitter,e.getSize,e.fizzyUIUtils,t.Cell,t.Slide,t.animatePrototype)}}("undefined"!=typeof window?window:this,function(t,e,i,s,n,o,r){const{getComputedStyle:l,console:a}=t;let{jQuery:h}=t,c=0,d={};function u(t,e){let i=s.getQueryElement(t);if(i){if(this.element=i,this.element.flickityGUID){let t=d[this.element.flickityGUID];return t&&t.option(e),t}h&&(this.$element=h(this.element)),this.options={...this.constructor.defaults},this.option(e),this._create()}else a&&a.error(`Bad element for Flickity: ${i||t}`)}u.defaults={accessibility:!0,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:!0,percentPosition:!0,resize:!0,selectedAttraction:.025,setGallerySize:!0},u.create={};let p=u.prototype;Object.assign(p,e.prototype),p._create=function(){let{resize:e,watchCSS:i,rightToLeft:s}=this.options,n=this.guid=++c;this.element.flickityGUID=n,d[n]=this,this.selectedIndex=0,this.restingFrames=0,this.x=0,this.velocity=0,this.beginMargin=s?"marginRight":"marginLeft",this.endMargin=s?"marginLeft":"marginRight",this.viewport=document.createElement("div"),this.viewport.className="flickity-viewport",this._createSlider(),this.focusableElems=[this.element],(e||i)&&t.addEventListener("resize",this);for(let t in this.options.on){let e=this.options.on[t];this.on(t,e)}for(let t in u.create)u.create[t].call(this);i?this.watchCSS():this.activate()},p.option=function(t){Object.assign(this.options,t)},p.activate=function(){if(this.isActive)return;this.isActive=!0,this.element.classList.add("flickity-enabled"),this.options.rightToLeft&&this.element.classList.add("flickity-rtl"),this.getSize();let t=this._filterFindCellElements(this.element.children);this.slider.append(...t),this.viewport.append(this.slider),this.element.append(this.viewport),this.reloadCells(),this.options.accessibility&&(this.element.tabIndex=0,this.element.addEventListener("keydown",this)),this.emitEvent("activate"),this.selectInitialIndex(),this.isInitActivated=!0,this.dispatchEvent("ready")},p._createSlider=function(){let t=document.createElement("div");t.className="flickity-slider",this.slider=t},p._filterFindCellElements=function(t){return s.filterFindElements(t,this.options.cellSelector)},p.reloadCells=function(){this.cells=this._makeCells(this.slider.children),this.positionCells(),this._updateWrapShiftCells(),this.setGallerySize()},p._makeCells=function(t){return this._filterFindCellElements(t).map(t=>new n(t))},p.getLastCell=function(){return this.cells[this.cells.length-1]},p.getLastSlide=function(){return this.slides[this.slides.length-1]},p.positionCells=function(){this._sizeCells(this.cells),this._positionCells(0)},p._positionCells=function(t){t=t||0,this.maxCellHeight=t&&this.maxCellHeight||0;let e=0;if(t>0){let i=this.cells[t-1];e=i.x+i.size.outerWidth}this.cells.slice(t).forEach(t=>{t.x=e,this._renderCellPosition(t,e),e+=t.size.outerWidth,this.maxCellHeight=Math.max(t.size.outerHeight,this.maxCellHeight)}),this.slideableWidth=e,this.updateSlides(),this._containSlides(),this.slidesWidth=this.cells.length?this.getLastSlide().target-this.slides[0].target:0},p._renderCellPosition=function(t,e){let i=e*(this.options.rightToLeft?-1:1);this.options.percentPosition&&(i*=this.size.innerWidth/t.size.width);let s=this.getPositionValue(i);t.element.style.transform=`translateX( ${s} )`},p._sizeCells=function(t){t.forEach(t=>t.getSize())},p.updateSlides=function(){if(this.slides=[],!this.cells.length)return;let{beginMargin:t,endMargin:e}=this,i=new o(t,e,this.cellAlign);this.slides.push(i);let s=this._getCanCellFit();
vendor: 4,334 bytes, line 2
2this.cells.forEach((n,r)=>{if(!i.cells.length)return void i.addCell(n);let l=i.outerWidth-i.firstMargin+(n.size.outerWidth-n.size[e]);s(r,l)||(i.updateTarget(),i=new o(t,e,this.cellAlign),this.slides.push(i)),i.addCell(n)}),i.updateTarget(),this.updateSelectedSlide()},p._getCanCellFit=function(){let{groupCells:t}=this.options;if(!t)return()=>!1;if("number"==typeof t){let e=parseInt(t,10);return t=>t%e!=0}let e=1,i="string"==typeof t&&t.match(/^(\d+)%$/);i&&(e=parseInt(i[1],10)/100);let s=(this.size.innerWidth+1)*e;return(t,e)=>e<=s},p._init=p.reposition=function(){this.positionCells(),this.positionSliderAtSelected()},p.getSize=function(){this.size=i(this.element),this.setCellAlign(),this.cursorPosition=this.size.innerWidth*this.cellAlign};let m={left:0,center:.5,right:1};p.setCellAlign=function(){let{cellAlign:t,rightToLeft:e}=this.options,i=m[t];this.cellAlign=void 0!==i?i:t,e&&(this.cellAlign=1-this.cellAlign)},p.setGallerySize=function(){if(!this.options.setGallerySize)return;let t=this.options.adaptiveHeight&&this.selectedSlide?this.selectedSlide.height:this.maxCellHeight;this.viewport.style.height=`${t}px`},p._updateWrapShiftCells=function(){if(this.isWrapping=this.getIsWrapping(),!this.isWrapping)return;this._unshiftCells(this.beforeShiftCells),this._unshiftCells(this.afterShiftCells);let t=this.cursorPosition,e=this.cells.length-1;this.beforeShiftCells=this._getGapCells(t,e,-1);let i=this.size.innerWidth-this.cursorPosition;this.afterShiftCells=this._getGapCells(i,0,1)},p.getIsWrapping=function(){let{wrapAround:t}=this.options;if(!t||this.slides.length<2)return!1;if("fill"!==t)return!0;let e=this.slideableWidth-this.size.innerWidth;if(e>this.size.innerWidth)return!0;for(let t of this.cells)if(t.size.outerWidth>e)return!1;return!0},p._getGapCells=function(t,e,i){let s=[];for(;t>0;){let n=this.cells[e];if(!n)break;s.push(n),e+=i,t-=n.size.outerWidth}return s},p._containSlides=function(){if(!this.options.contain||this.isWrapping||!this.cells.length)return;let t=this.slideableWidth-this.getLastCell().size[this.endMargin];if(t<this.size.innerWidth)this.slides.forEach(e=>{e.target=t*this.cellAlign});else{let e=this.cursorPosition+this.cells[0].size[this.beginMargin],i=t-this.size.innerWidth*(1-this.cellAlign);this.slides.forEach(t=>{t.target=Math.max(t.target,e),t.target=Math.min(t.target,i)})}},p.dispatchEvent=function(t,e,i){let s=e?[e].concat(i):i;if(this.emitEvent(t,s),h&&this.$element){let s=t+=this.options.namespaceJQueryEvents?".flickity":"";if(e){let i=new h.Event(e);i.type=t,s=i}this.$element.trigger(s,i)}};const f=["dragStart","dragMove","dragEnd","pointerDown","pointerMove","pointerEnd","staticClick"];let g=p.emitEvent;p.emitEvent=function(t,e){if("staticClick"===t){let t=this.getParentCell(e[0].target),i=t&&t.element,s=t&&this.cells.indexOf(t);e=e.concat(i,s)}if(g.call(this,t,e),!f.includes(t)||!h||!this.$element)return;t+=this.options.namespaceJQueryEvents?".flickity":"";let i=e.shift(0),s=new h.Event(i);s.type=t,this.$element.trigger(s,e)},p.select=function(t,e,i){if(!this.isActive)return;if(t=parseInt(t,10),this._wrapSelect(t),(this.isWrapping||e)&&(t=s.modulo(t,this.slides.length)),!this.slides[t])return;let n=this.selectedIndex;this.selectedIndex=t,this.updateSelectedSlide(),i?this.positionSliderAtSelected():this.startAnimation(),this.options.adaptiveHeight&&this.setGallerySize(),this.dispatchEvent("select",null,[t]),t!==n&&this.dispatchEvent("change",null,[t])},p._wrapSelect=function(t){if(!this.isWrapping)return;const{selectedIndex:e,slideableWidth:i,slides:{length:n}}=this;if(!this.isDragSelect){let i=s.modulo(t,n),o=Math.abs(i-e),r=Math.abs(i+n-e),l=Math.abs(i-n-e);r<o?t+=n:l<o&&(t-=n)}t<0?this.x-=i:t>=n&&(this.x+=i)},p.previous=function(t,e){this.select(this.selectedIndex-1,t,e)},p.next=function(t,e){this.select(this.selectedIndex+1,t,e)},p.updateSelectedSlide=function(){let t=this.slides[this.selectedIndex];t&&(this.unselectSelectedSlide(),this.selectedSlide=t,t.select(),this.selectedCells=t.cells,this.selectedElements=t.getCellElements(),this.selectedCell=t.cells[0],this.selectedElement=this.selectedElements[0])},p.unselectSelectedSlide=function(){this.selectedSlide&&this.selectedSlide.unselect()},p.selectInitialIndex=function(){let t=this.options.initialIndex;if(this.isInitActivated)return void this.select(this.selectedIndex,!1,
2!0);if(t&&"string"==typeof t&&this.queryCell(t))return void this.selectCell(t,!1,!0);let e=0;t&&this.slides[t]&&(e=t),this.select(e,!1,!0)},p.selectCell=function(t,e,i){let s=this.queryCell(t);if(!s)return;let n=this.getCellSlideIndex(s);this.select(n,e,i)},p.getCellSlideIndex=function(t){let e=this.slides.find(e=>e.cells.includes(t));return this.slides.indexOf(e)},p.getCell=function(t){for(let e of this.cells)if(e.element===t)return e},p.getCells=function(t){return(t=s.makeArray(t)).map(t=>this.getCell(t)).filter(Boolean)},p.getCellElements=function(){return this.cells.map(t=>t.element)},p.getParentCell=function(t){let e=this.getCell(t);if(e)return e;let i=t.closest(".flickity-slider > *");return this.getCell(i)},p.getAdjacentCellElements=function(t,e){if(!t)return this.selectedSlide.getCellElements();e=void 0===e?this.selectedIndex:e;let i=this.slides.length;if(1+2*t>=i)return this.getCellElements();let n=[];for(let o=e-t;o<=e+t;o++){let t=this.isWrapping?s.modulo(o,i):o,e=this.slides[t];e&&(n=n.concat(e.getCellElements()))}return n},p.queryCell=function(t){return"number"==typeof t?this.cells[t]:("string"==typeof t&&!t.match(/^[#.]?[\d/]/)&&(t=this.element.querySelector(t)),this.getCell(t))},p.uiChange=function(){this.emitEvent("uiChange")},p.onresize=function(){this.watchCSS(),this.resize()},s.debounceMethod(u,"onresize",150),p.resize=function(){if(!this.isActive||this.isAnimating||this.isDragging)return;this.getSize(),this.isWrapping&&(this.x=s.modulo(this.x,this.slideableWidth)),this.positionCells(),this._updateWrapShiftCells(),this.setGallerySize(),this.emitEvent("resize");let t=this.selectedElements&&this.selectedElements[0];this.selectCell(t,!1,!0)},p.watchCSS=function(){this.options.watchCSS&&(l(this.element,":after").content.includes("flickity")?this.activate():this.deactivate())},p.onkeydown=function(t){let{activeElement:e}=document,i=u.keyboardHandlers[t.key];this.options.accessibility&&e&&i&&this.focusableElems.some(t=>e===t)&&i.call(this)},u.keyboardHandlers={ArrowLeft:function(){this.uiChange(),this[this.options.rightToLeft?"next":"previous"]()},ArrowRight:function(){this.uiChange(),this[this.options.rightToLeft?"previous":"next"]()}},p.focus=function(){this.element.focus({preventScroll:!0})},p.deactivate=function(){this.isActive&&(this.element.classList.remove("flickity-enabled"),this.element.classList.remove("flickity-rtl"),this.unselectSelectedSlide(),this.cells.forEach(t=>t.destroy()),this.viewport.remove(),this.element.append(...this.slider.children),this.options.accessibility&&(this.element.removeAttribute("tabIndex"),this.element.removeEventListener("keydown",this)),this.isActive=!1,this.emitEvent("deactivate"))},p.destroy=function(){this.deactivate(),t.removeEventListener("resize",this),this.allOff(),this.emitEvent("destroy"),h&&this.$element&&h.removeData(this.element,"flickity"),delete this.element.flickityGUID,delete d[this.guid]},Object.assign(p,r),u.data=function(t){if(t=s.getQueryElement(t))return d[t.flickityGUID]},s.htmlInit(u,"flickity");let{jQueryBridget:y}=t;return h&&y&&y("flickity",u,h),u.setJQuery=function(t){h=t},u.Cell=n,u.Slide=o,u})},690:function(t,e,i){!function(e,s){t.exports?t.exports=s(e,i(680),i(842),i(47)):e.Flickity=s(e,e.Flickity,e.Unidragger,e.fizzyUIUtils)}("undefined"!=typeof window?window:this,function(t,e,i,s){Object.assign(e.defaults,{draggable:">1",dragThreshold:3});let n=e.prototype;function o(){return{x:t.pageXOffset,y:t.pageYOffset}}return Object.assign(n,i.prototype),n.touchActionValue="",e.create.drag=function(){this.on("activate",this.onActivateDrag),this.on("uiChange",this._uiChangeDrag),this.on("deactivate",this.onDeactivateDrag),this.on("cellChange",this.updateDraggable),this.on("pointerDown",this.handlePointerDown),this.on("pointerUp",this.handlePointerUp),this.on("pointerDown",this.handlePointerDone),this.on("dragStart",this.handleDragStart),this.on("dragMove",this.handleDragMove),this.on("dragEnd",this.handleDragEnd),this.on("staticClick",this.handleStaticClick)},n.onActivateDrag=function(){this.handles=[this.viewport],this.bindHandles(),this.updateDraggable()},n.onDeactivateDrag=function(){this.unbindHandles(),this.element.classList.remove("is-draggable")},n.updateDraggable=function(){">1"===this.options.draggable?this.isDraggable=this.slides.length>1:this.isDraggable=this.options.draggable,this.element.classList.toggle("is-draggable",this.isDraggable)},n._uiChangeDrag=function(){delete this.isFreeScrolling},n.handlePointerDown=function(e){if(!this.isDraggable)return void this.bindActivePointerEvents(e);let i="touchstart"===e.type,s="touch"===e.pointerType,n=e.target.matches("input, textarea, select");i||s||n||e.preventDefault(),n||this.focus(),document.activeElement!==this.element&&document.activeElement.blur(),this.dragX=this.x,this.viewport.classList.add("is-pointer-down"),this.pointerDownScroll=o(),t.addEventListener("scroll",this),this.bindActivePointerEvents(e)},n.hasDragStarted=function(t){return Math.abs(t.x)>this.options.dragThreshold},n.handlePointerUp=function(){delete this.isTouchScrolling,this.viewport.classList.remove("is-pointer-down")},n.handlePointerDone=function(){t.removeEventListener("scroll",this),delete this.pointerDownScroll},n.handleDragStart=function(){this.isDraggable&&(this.dragStartPosition=this.x,this.startAnimation(),t.removeEventListener("scroll",this))}
2,n.handleDragMove=function(t,e,i){if(!this.isDraggable)return;t.preventDefault(),this.previousDragX=this.dragX;let s=this.options.rightToLeft?-1:1;this.isWrapping&&(i.x%=this.slideableWidth);let n=this.dragStartPosition+i.x*s;if(!this.isWrapping){let t=Math.max(-this.slides[0].target,this.dragStartPosition);n=n>t?.5*(n+t):n;let e=Math.min(-this.getLastSlide().target,this.dragStartPosition);n=n<e?.5*(n+e):n}this.dragX=n,this.dragMoveTime=new Date},n.handleDragEnd=function(){if(!this.isDraggable)return;let{freeScroll:t}=this.options;t&&(this.isFreeScrolling=!0);let e=this.dragEndRestingSelect();if(t&&!this.isWrapping){let t=this.getRestingPosition();this.isFreeScrolling=-t>this.slides[0].target&&-t<this.getLastSlide().target}else t||e!==this.selectedIndex||(e+=this.dragEndBoostSelect());delete this.previousDragX,this.isDragSelect=this.isWrapping,this.select(e),delete this.isDragSelect},n.dragEndRestingSelect=function(){let t=this.getRestingPosition(),e=Math.abs(this.getSlideDistance(-t,this.selectedIndex)),i=this._getClosestResting(t,e,1),s=this._getClosestResting(t,e,-1);return i.distance<s.distance?i.index:s.index},n._getClosestResting=function(t,e,i){let s=this.selectedIndex,n=1/0,o=this.options.contain&&!this.isWrapping?(t,e)=>t<=e:(t,e)=>t<e;for(;o(e,n)&&(s+=i,n=e,null!==(e=this.getSlideDistance(-t,s)));)e=Math.abs(e);return{distance:n,index:s-i}},n.getSlideDistance=function(t,e){let i=this.slides.length,n=this.options.wrapAround&&i>1,o=n?s.modulo(e,i):e,r=this.slides[o];if(!r)return null;let l=n?this.slideableWidth*Math.floor(e/i):0;return t-(r.target+l)},n.dragEndBoostSelect=function(){if(void 0===this.previousDragX||!this.dragMoveTime||new Date-this.dragMoveTime>100)return 0;let t=this.getSlideDistance(-this.dragX,this.selectedIndex),e=this.previousDragX-this.dragX;return t>0&&e>0?1:t<0&&e<0?-1:0},n.onscroll=function(){let t=o(),e=this.pointerDownScroll.x-t.x,i=this.pointerDownScroll.y-t.y;(Math.abs(e)>3||Math.abs(i)>3)&&this.pointerDone()},e})},835:function(t,e,i){!function(e,s){t.exports?t.exports=s(i(680),i(564)):s(e.Flickity,e.imagesLoaded)}("undefined"!=typeof window?window:this,function(t,e){return t.create.imagesLoaded=function(){this.on("activate",this.imagesLoaded)},t.prototype.imagesLoaded=function(){this.options.imagesLoaded&&e(this.slider).on("progress",(t,e)=>{let i=this.getParentCell(e.img);this.cellSizeChange(i&&i.element),this.options.freeScroll||this.positionSliderAtSelected()})},t})},442:(t,e,i)=>{if(t.exports){const e=i(680);i(690),i(410),i(573),i(516),i(597),i(227),i(835),t.exports=e}},227:function(t,e,i){!function(e,s){t.exports?t.exports=s(i(680),i(47)):s(e.Flickity,e.fizzyUIUtils)}("undefined"!=typeof window?window:this,function(t,e){const i="data-flickity-lazyload",s=`${i}-src`,n=`${i}-srcset`,o=`img[${i}], img[${s}], img[${n}], source[${n}]`;t.create.lazyLoad=function(){this.on("select",this.lazyLoad),this.handleLazyLoadComplete=this.onLazyLoadComplete.bind(this)};let r=t.prototype;function l(t){if(t.matches("img")){let e=t.getAttribute(i),o=t.getAttribute(s),r=t.getAttribute(n);if(e||o||r)return t}return[...t.querySelectorAll(o)]}function a(t,e){this.img=t,this.onComplete=e,this.load()}return r.lazyLoad=function(){let{lazyLoad:t}=this.options;if(!t)return;let e="number"==typeof t?t:0;this.getAdjacentCellElements(e).map(l).flat().forEach(t=>new a(t,this.handleLazyLoadComplete))},r.onLazyLoadComplete=function(t,e){let i=this.getParentCell(t),s=i&&i.element;this.cellSizeChange(s),this.dispatchEvent("lazyLoad",e,s)},a.prototype.handleEvent=e.handleEvent,a.prototype.load=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this);let t=this.img.getAttribute(i)||this.img.getAttribute(s),e=this.img.getAttribute(n);this.img.src=t,e&&this.img.setAttribute("srcset",e),this.img.removeAttribute(i),this.img.removeAttribute(s),this.img.removeAttribute(n)},a.prototype.onload=function(t){this.complete(t,"flickity-lazyloaded")},a.prototype.onerror=function(t){this.complete(t,"flickity-lazyerror")},a.prototype.complete=function(t,e){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this),(this.img.parentNode.matches("picture")?this.img.parentNode:this.img).classList.add(e),this.onComplete(this.img,t)},t.LazyLoader=a,t})}
2,573:function(t,e,i){!function(e,s){t.exports?t.exports=s(i(680),i(47)):s(e.Flickity,e.fizzyUIUtils)}("undefined"!=typeof window?window:this,function(t,e){function i(){this.holder=document.createElement("div"),this.holder.className="flickity-page-dots",this.dots=[]}i.prototype.setDots=function(t){let e=t-this.dots.length;e>0?this.addDots(e):e<0&&this.removeDots(-e)},i.prototype.addDots=function(t){let e=new Array(t).fill().map((t,e)=>{let i=document.createElement("button");i.setAttribute("type","button");let s=e+1+this.dots.length;return i.className="flickity-page-dot",i.textContent=`View slide ${s}`,i});this.holder.append(...e),this.dots=this.dots.concat(e)},i.prototype.removeDots=function(t){this.dots.splice(this.dots.length-t,t).forEach(t=>t.remove())},i.prototype.updateSelected=function(t){this.selectedDot&&(this.selectedDot.classList.remove("is-selected"),this.selectedDot.removeAttribute("aria-current")),this.dots.length&&(this.selectedDot=this.dots[t],this.selectedDot.classList.add("is-selected"),this.selectedDot.setAttribute("aria-current","step"))},t.PageDots=i,Object.assign(t.defaults,{pageDots:!0}),t.create.pageDots=function(){this.options.pageDots&&(this.pageDots=new i,this.handlePageDotsClick=this.onPageDotsClick.bind(this),this.on("activate",this.activatePageDots),this.on("select",this.updateSelectedPageDots),this.on("cellChange",this.updatePageDots),this.on("resize",this.updatePageDots),this.on("deactivate",this.deactivatePageDots))};let s=t.prototype;return s.activatePageDots=function(){this.pageDots.setDots(this.slides.length),this.focusableElems.push(...this.pageDots.dots),this.pageDots.holder.addEventListener("click",this.handlePageDotsClick),this.element.append(this.pageDots.holder)},s.onPageDotsClick=function(t){let e=this.pageDots.dots.indexOf(t.target);-1!==e&&(this.uiChange(),this.select(e))},s.updateSelectedPageDots=function(){this.pageDots.updateSelected(this.selectedIndex)},s.updatePageDots=function(){this.pageDots.dots.forEach(t=>{e.removeFrom(this.focusableElems,t)}),this.pageDots.setDots(this.slides.length),this.focusableElems.push(...this.pageDots.dots)},s.deactivatePageDots=function(){this.pageDots.holder.remove(),this.pageDots.holder.removeEventListener("click",this.handlePageDotsClick)},t.PageDots=i,t})},516:function(t,e,i){!function(e,s){t.exports?t.exports=s(i(680)):s(e.Flickity)}("undefined"!=typeof window?window:this,function(t){function e(t,e){this.autoPlay=t,this.onTick=e,this.state="stopped",this.onVisibilityChange=this.visibilityChange.bind(this),this.onVisibilityPlay=this.visibilityPlay.bind(this)}e.prototype.play=function(){"playing"!==this.state&&(document.hidden?document.addEventListener("visibilitychange",this.onVisibilityPlay):(this.state="playing",document.addEventListener("visibilitychange",this.onVisibilityChange),this.tick()))},e.prototype.tick=function(){if("playing"!==this.state)return;let t="number"==typeof this.autoPlay?this.autoPlay:3e3;this.clear(),this.timeout=setTimeout(()=>{this.onTick(),this.tick()},t)},e.prototype.stop=function(){this.state="stopped",this.clear(),document.removeEventListener("visibilitychange",this.onVisibilityChange)},e.prototype.clear=function(){clearTimeout(this.timeout)},e.prototype.pause=function(){"playing"===this.state&&(this.state="paused",this.clear())},e.prototype.unpause=function(){"paused"===this.state&&this.play()},e.prototype.visibilityChange=function(){this[document.hidden?"pause":"unpause"]()},e.prototype.visibilityPlay=function(){this.play(),document.removeEventListener("visibilitychange",this.onVisibilityPlay)},Object.assign(t.defaults,{pauseAutoPlayOnHover:!0}),t.create.player=function(){this.player=new e(this.options.autoPlay,()=>{this.next(!0)}),this.on("activate",this.activatePlayer),this.on("uiChange",this.stopPlayer),this.on("pointerDown",this.stopPlayer),this.on("deactivate",this.deactivatePlayer)};let i=t.prototype;return i.activatePlayer=function(){this.options.autoPlay&&(this.player.play(),this.element.addEventListener("mouseenter",this))},i.playPlayer=function(){this.player.play()},i.stopPlayer=function(){this.player.stop()},i.pausePlayer=function(){this.player.pause()},i.unpausePlayer=function(){this.player.unpause()},i.deactivatePlayer=function(){this.player.stop(),this.element.removeEventListener("mouseenter",this)},i.onmouseenter=function(){this.options.pauseAutoPlayOnHover&&(this.player.pause(),this.element.addEventListener("mouseleave",this))},i.onmouseleave=function(){this.player.unpause(),this.element.removeEventListener("mouseleave",this)},t.Player=e,t})}
2,410:function(t,e,i){!function(e,s){t.exports?t.exports=s(i(680)):s(e.Flickity)}("undefined"!=typeof window?window:this,function(t){const e="http://www.w3.org/2000/svg";function i(t,e,i){this.increment=t,this.direction=e,this.isPrevious="previous"===t,this.isLeft="left"===e,this._create(i)}i.prototype._create=function(t){let e=this.element=document.createElement("button");e.className=`flickity-button flickity-prev-next-button ${this.increment}`;let i=this.isPrevious?"Previous":"Next";e.setAttribute("type","button"),e.setAttribute("aria-label",i),this.disable();let s=this.createSVG(i,t);e.append(s)},i.prototype.createSVG=function(t,i){let s=document.createElementNS(e,"svg");s.setAttribute("class","flickity-button-icon"),s.setAttribute("viewBox","0 0 100 100");let n=document.createElementNS(e,"title");n.append(t);let o=document.createElementNS(e,"path"),r=function(t){if("string"==typeof t)return t;let{x0:e,x1:i,x2:s,x3:n,y1:o,y2:r}=t;return`M ${e}, 50\n    L ${i}, ${o+50}\n    L ${s}, ${r+50}\n    L ${n}, 50\n    L ${s}, ${50-r}\n    L ${i}, ${50-o}\n    Z`}(i);return o.setAttribute("d",r),o.setAttribute("class","arrow"),this.isLeft||o.setAttribute("transform","translate(100, 100) rotate(180)"),s.append(n,o),s},i.prototype.enable=function(){this.element.removeAttribute("disabled")},i.prototype.disable=function(){this.element.setAttribute("disabled",!0)},Object.assign(t.defaults,{prevNextButtons:!0,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}}),t.create.prevNextButtons=function(){if(!this.options.prevNextButtons)return;let{rightToLeft:t,arrowShape:e}=this.options,s=t?"right":"left",n=t?"left":"right";this.prevButton=new i("previous",s,e),this.nextButton=new i("next",n,e),this.focusableElems.push(this.prevButton.element),this.focusableElems.push(this.nextButton.element),this.handlePrevButtonClick=()=>{this.uiChange(),this.previous()},this.handleNextButtonClick=()=>{this.uiChange(),this.next()},this.on("activate",this.activatePrevNextButtons),this.on("select",this.updatePrevNextButtons)};let s=t.prototype;return s.updatePrevNextButtons=function(){let t=this.slides.length?this.slides.length-1:0;this.updatePrevNextButton(this.prevButton,0),this.updatePrevNextButton(this.nextButton,t)},s.updatePrevNextButton=function(t,e){if(this.isWrapping&&this.slides.length>1)return void t.enable();let i=this.selectedIndex!==e;t[i?"enable":"disable"](),!i&&document.activeElement===t.element&&this.focus()},s.activatePrevNextButtons=function(){this.prevButton.element.addEventListener("click",this.handlePrevButtonClick),this.nextButton.element.addEventListener("click",this.handleNextButtonClick),this.element.append(this.prevButton.element,this.nextButton.element),this.on("deactivate",this.deactivatePrevNextButtons)},s.deactivatePrevNextButtons=function(){this.prevButton.element.remove(),this.nextButton.element.remove(),this.prevButton.element.removeEventListener("click",this.handlePrevButtonClick),this.nextButton.element.removeEventListener("click",this.handleNextButtonClick),this.off("deactivate",this.deactivatePrevNextButtons)},t.PrevNextButton=i,t})},714:function(t){!function(e,i){t.exports?t.exports=i():(e.Flickity=e.Flickity||{},e.Flickity.Slide=i())}("undefined"!=typeof window?window:this,function(){function t(t,e,i){this.beginMargin=t,this.endMargin=e,this.cellAlign=i,this.cells=[],this.outerWidth=0,this.height=0}let e=t.prototype;return e.addCell=function(t){this.cells.push(t),this.outerWidth+=t.size.outerWidth,this.height=Math.max(t.size.outerHeight,this.height),1===this.cells.length&&(this.x=t.x,this.firstMargin=t.size[this.beginMargin])},e.updateTarget=function(){let t=this.getLastCell(),e=t?t.size[this.endMargin]:0,i=this.outerWidth-(this.firstMargin+e);this.target=this.x+this.firstMargin+i*this.cellAlign},e.getLastCell=function(){return this.cells[this.cells.length-1]},e.select=function(){this.cells.forEach(t=>t.select())},e.unselect=function(){this.cells.forEach(t=>t.unselect())},e.getCellElements=function(){return this.cells.map(t=>t.element)},t})},131:t=>{!function(e,i){t.exports?t.exports=i():e.getSize=i()}(window,function(){function t(t){let e=parseFloat(t);return-1==t.indexOf("%")&&!isNaN(e)&&e}let e=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];return e.length,function(i){if("string"==typeof i&&(i=document.querySelector(i)),!i||"object"!=typeof i||!i.nodeType)return;let s=getComputedStyle(i);if("none"==s.display)return function(){let t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};
2return e.forEach(e=>{t[e]=0}),t}();let n={};n.width=i.offsetWidth,n.height=i.offsetHeight;let o=n.isBorderBox="border-box"==s.boxSizing;e.forEach(t=>{let e=s[t],i=parseFloat(e);n[t]=isNaN(i)?0:i});let r=n.paddingLeft+n.paddingRight,l=n.paddingTop+n.paddingBottom,a=n.marginLeft+n.marginRight,h=n.marginTop+n.marginBottom,c=n.borderLeftWidth+n.borderRightWidth,d=n.borderTopWidth+n.borderBottomWidth,u=t(s.width);!1!==u&&(n.width=u+(o?0:r+c));let p=t(s.height);return!1!==p&&(n.height=p+(o?0:l+d)),n.innerWidth=n.width-(r+c),n.innerHeight=n.height-(l+d),n.outerWidth=n.width+a,n.outerHeight=n.height+h,n}})},564:function(t,e,i){!function(e,s){t.exports?t.exports=s(e,i(158)):e.imagesLoaded=s(e,e.EvEmitter)}("undefined"!=typeof window?window:this,function(t,e){let i=t.jQuery,s=t.console;function n(t,e,o){if(!(this instanceof n))return new n(t,e,o);let r=t;var l;"string"==typeof t&&(r=document.querySelectorAll(t)),r?(this.elements=(l=r,Array.isArray(l)?l:"object"==typeof l&&"number"==typeof l.length?[...l]:[l]),this.options={},"function"==typeof e?o=e:Object.assign(this.options,e),o&&this.on("always",o),this.getImages(),i&&(this.jqDeferred=new i.Deferred),setTimeout(this.check.bind(this))):s.error(`Bad element for imagesLoaded ${r||t}`)}n.prototype=Object.create(e.prototype),n.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)};const o=[1,9,11];n.prototype.addElementImages=function(t){"IMG"===t.nodeName&&this.addImage(t),!0===this.options.background&&this.addElementBackgroundImages(t);let{nodeType:e}=t;if(!e||!o.includes(e))return;let i=t.querySelectorAll("img");for(let t of i)this.addImage(t);if("string"==typeof this.options.background){let e=t.querySelectorAll(this.options.background);for(let t of e)this.addElementBackgroundImages(t)}};const r=/url\((['"])?(.*?)\1\)/gi;function l(t){this.img=t}function a(t,e){this.url=t,this.element=e,this.img=new Image}return n.prototype.addElementBackgroundImages=function(t){let e=getComputedStyle(t);if(!e)return;let i=r.exec(e.backgroundImage);for(;null!==i;){let s=i&&i[2];s&&this.addBackground(s,t),i=r.exec(e.backgroundImage)}},n.prototype.addImage=function(t){let e=new l(t);this.images.push(e)},n.prototype.addBackground=function(t,e){let i=new a(t,e);this.images.push(i)},n.prototype.check=function(){if(this.progressedCount=0,this.hasAnyBroken=!1,!this.images.length)return void this.complete();let t=(t,e,i)=>{setTimeout(()=>{this.progress(t,e,i)})};this.images.forEach(function(e){e.once("progress",t),e.check()})},n.prototype.progress=function(t,e,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount===this.images.length&&this.complete(),this.options.debug&&s&&s.log(`progress: ${i}`,t,e)},n.prototype.complete=function(){let t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){let t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},l.prototype=Object.create(e.prototype),l.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.img.crossOrigin&&(this.proxyImage.crossOrigin=this.img.crossOrigin),this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.currentSrc||this.img.src)},l.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},l.prototype.confirm=function(t,e){this.isLoaded=t;let{parentNode:i}=this.img,s="PICTURE"===i.nodeName?i:this.img;this.emitEvent("progress",[this,s,e])},l.prototype.handleEvent=function(t){let e="on"+t.type;this[e]&&this[e](t)},l.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},l.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},l.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},a.prototype=Object.create(l.prototype),a.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWi
2dth,"naturalWidth"),this.unbindEvents())},a.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},a.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},n.makeJQueryPlugin=function(e){(e=e||t.jQuery)&&(i=e,i.fn.imagesLoaded=function(t,e){return new n(this,t,e).jqDeferred.promise(i(this))})},n.makeJQueryPlugin(),n})},292:()=>{function t(){const t=JSON.parse(localStorage.getItem("selectedEducations"))||[],e=document.querySelector("div.hs_educations.hs-educations"),i=e?.querySelector('textarea[name="educations"]');if(i){let s=e.querySelector(".chosen-educations");s||(s=document.createElement("div"),s.classList.add("chosen-educations"),i.insertAdjacentElement("afterend",s)),s.innerHTML=t.length?`<ul>${t.map((t,e)=>`\n\t\t\t\t<li>\n\t\t\t\t\t${t.name}\n\t\t\t\t\t<button class="remove-education" data-index="${e}" aria-label="Remove * ${t.name}">✕</button>\n\t\t\t\t</li>`).join("")}</ul>`:"<p>Inga utbildningar valda ännu.</p>";const n=t.map(t=>`* ${t.name}`).join(", ");i.value!==n&&(i.value=n,i.dispatchEvent(new Event("change",{bubbles:!0})),i.dispatchEvent(new Event("input",{bubbles:!0})),i.dispatchEvent(new Event("blur",{bubbles:!0})))}const s=document.querySelector("aside .chosen-educations"),n=document.querySelector("aside h4")??document.querySelector("aside h3");s&&(n?.setAttribute("data-count",t.length),s.innerHTML=t.length?`<ul>${t.map((t,e)=>`\n\t\t\t\t<li>\n\t\t\t\t\t${t.name}\n\t\t\t\t\t<button class="remove-education" data-index="${e}" aria-label="Remove * ${t.name}">✕</button>\n\t\t\t\t</li>`).join("")}</ul>`:"<p>Inga utbildningar valda ännu.</p>"),document.querySelectorAll(".catalog-input[type='checkbox']").forEach(e=>{e.checked=t.some(t=>t.value===e.value)})}document.addEventListener("click",e=>{if(e.target.classList.contains("remove-education")){const i=parseInt(e.target.getAttribute("data-index")),s=JSON.parse(localStorage.getItem("selectedEducations"))||[],n=s.splice(i,1)[0];localStorage.setItem("selectedEducations",JSON.stringify(s));const o=document.querySelector(`.catalog-input[value="${n.value}"]`);o&&(o.checked=!1),t()}}),document.addEventListener("DOMContentLoaded",()=>{const t=document.getElementById("sign-up-button");t?.addEventListener("click",e=>{e.preventDefault(),localStorage.setItem("education_landing_page","true");const i=t.getAttribute("data-lp-url")||window.location.pathname;window.location.href=i})}),document.addEventListener("DOMContentLoaded",()=>{const e="true"===localStorage.getItem("education_landing_page"),i=document.getElementById("education-main"),s=document.getElementById("education-lp");i&&s&&(e?(i.style.display="none",s.style.display="block",localStorage.removeItem("education_landing_page")):(i.style.display="block",s.style.display="none")),function(){const e=(JSON.parse(localStorage.getItem("selectedEducations"))||[]).map(t=>t.value);document.querySelectorAll(".catalog-input[type='checkbox']").forEach(i=>{e.includes(i.value)&&(i.checked=!0),i.addEventListener("change",()=>{let e=JSON.parse(localStorage.getItem("selectedEducations"))||[];i.checked?e.some(t=>t.value===i.value)||e.push({name:i.name,value:i.value}):e=e.filter(t=>t.value!==i.value),localStorage.setItem("selectedEducations",JSON.stringify(e)),t()})})}(),t();const n=new MutationObserver(()=>{const e=document.querySelector("div.hs_educations.hs-educations"),i=e?.querySelector('textarea[name="educations"]');e&&i&&(n.disconnect(),t(),setTimeout(()=>{const t=(JSON.parse(localStorage.getItem("selectedEducations"))||[]).map(t=>`* ${t.name}`).join(", ");i.value=t,i.dispatchEvent(new Event("change",{bubbles:!0})),i.dispatchEvent(new Event("input",{bubbles:!0})),i.dispatchEvent(new Event("blur",{bubbles:!0}))},100))});n.observe(document.body,{childList:!0,subtree:!0})})},381:()=>{document.querySelectorAll(".hs-web-interactive-inline").forEach(t=>{const e=!!t?.dataset?.ctaClass&&t.dataset.ctaClass.split(" "),i=new MutationObserver((i,s)=>{for(const n of i)"data-rendered"===n.attributeName&&"true"==t.dataset.rendered&&(t.querySelector("a").classList.add(...e),t.removeAttribute("data-cta-class"),s.disconnect())});e&&i.observe(t,{attributes:!0,childList:!1,subtree:!1})})},380:()=>{const t=new IntersectionObserver(e=>
2{e.forEach(e=>{if(e.isIntersecting){t.unobserve(e.target);let i={};try{i=JSON.parse(e.target.dataset.lottie)}catch{i={}}import("https://cdn.jsdelivr.net/npm/@lottiefiles/dotlottie-web/+esm").then(({DotLottie:t})=>{let s=new t({canvas:e.target,renderConfig:{autoResize:!0},...i});s.addEventListener("load",()=>{const t=s.animationSize();e.target.style.aspectRatio=`${t.width} / ${t.height}`,s.resize()}),e.target.dotLottie=s}).catch(t=>console.error("Error loading DotLottie:",t))}})},{rootMargin:"0% 0% 25% 0%"});document.querySelectorAll("[data-lottie]").forEach(e=>{t.observe(e)})},842:function(t,e,i){!function(e,s){t.exports?t.exports=s(e,i(158)):e.Unidragger=s(e,e.EvEmitter)}("undefined"!=typeof window?window:this,function(t,e){function i(){}let s,n,o=i.prototype=Object.create(e.prototype);o.handleEvent=function(t){let e="on"+t.type;this[e]&&this[e](t)},"ontouchstart"in t?(s="touchstart",n=["touchmove","touchend","touchcancel"]):t.PointerEvent?(s="pointerdown",n=["pointermove","pointerup","pointercancel"]):(s="mousedown",n=["mousemove","mouseup"]),o.touchActionValue="none",o.bindHandles=function(){this._bindHandles("addEventListener",this.touchActionValue)},o.unbindHandles=function(){this._bindHandles("removeEventListener","")},o._bindHandles=function(e,i){this.handles.forEach(n=>{n[e](s,this),n[e]("click",this),t.PointerEvent&&(n.style.touchAction=i)})},o.bindActivePointerEvents=function(){n.forEach(e=>{t.addEventListener(e,this)})},o.unbindActivePointerEvents=function(){n.forEach(e=>{t.removeEventListener(e,this)})},o.withPointer=function(t,e){e.pointerId===this.pointerIdentifier&&this[t](e,e)},o.withTouch=function(t,e){let i;for(let t of e.changedTouches)t.identifier===this.pointerIdentifier&&(i=t);i&&this[t](e,i)},o.onmousedown=function(t){this.pointerDown(t,t)},o.ontouchstart=function(t){this.pointerDown(t,t.changedTouches[0])},o.onpointerdown=function(t){this.pointerDown(t,t)};const r=["TEXTAREA","INPUT","SELECT","OPTION"],l=["radio","checkbox","button","submit","image","file"];return o.pointerDown=function(t,e){let i=r.includes(t.target.nodeName),s=l.includes(t.target.type),n=!i||s;!this.isPointerDown&&!t.button&&n&&(this.isPointerDown=!0,this.pointerIdentifier=void 0!==e.pointerId?e.pointerId:e.identifier,this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY},this.bindActivePointerEvents(),this.emitEvent("pointerDown",[t,e]))},o.onmousemove=function(t){this.pointerMove(t,t)},o.onpointermove=function(t){this.withPointer("pointerMove",t)},o.ontouchmove=function(t){this.withTouch("pointerMove",t)},o.pointerMove=function(t,e){let i={x:e.pageX-this.pointerDownPointer.pageX,y:e.pageY-this.pointerDownPointer.pageY};this.emitEvent("pointerMove",[t,e,i]),!this.isDragging&&this.hasDragStarted(i)&&this.dragStart(t,e),this.isDragging&&this.dragMove(t,e,i)},o.hasDragStarted=function(t){return Math.abs(t.x)>3||Math.abs(t.y)>3}
2,o.dragStart=function(t,e){this.isDragging=!0,this.isPreventingClicks=!0,this.emitEvent("dragStart",[t,e])},o.dragMove=function(t,e,i){this.emitEvent("dragMove",[t,e,i])},o.onmouseup=function(t){this.pointerUp(t,t)},o.onpointerup=function(t){this.withPointer("pointerUp",t)},o.ontouchend=function(t){this.withTouch("pointerUp",t)},o.pointerUp=function(t,e){this.pointerDone(),this.emitEvent("pointerUp",[t,e]),this.isDragging?this.dragEnd(t,e):this.staticClick(t,e)},o.dragEnd=function(t,e){this.isDragging=!1,setTimeout(()=>delete this.isPreventingClicks),this.emitEvent("dragEnd",[t,e])},o.pointerDone=function(){this.isPointerDown=!1,delete this.pointerIdentifier,this.unbindActivePointerEvents(),this.emitEvent("pointerDone")},o.onpointercancel=function(t){this.withPointer("pointerCancel",t)},o.ontouchcancel=function(t){this.withTouch("pointerCancel",t)},o.pointerCancel=function(t,e){this.pointerDone(),this.emitEvent("pointerCancel",[t,e])},o.onclick=function(t){this.isPreventingClicks&&t.preventDefault()},o.staticClick=function(t,e){let i="mouseup"===t.type;i&&this.isIgnoringMouseUp||(this.emitEvent("staticClick",[t,e]),i&&(this.isIgnoringMouseUp=!0,setTimeout(()=>{delete this.isIgnoringMouseUp},400)))},i})}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var o=e[s]={exports:{}};return t[s].call(o.exports,o,o.exports,i),o.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";class t{constructor(t,e,i){this.el=t,this.finalValue=e,this.config=Object.assign({duration:2e3},i);const s=document.documentElement.lang||"en";this.numberFormat=new Intl.NumberFormat(s)}mount(){if(!Number.isFinite(this.finalValue))return void(this.el.innerText=this.el.dataset.count);const t=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&(t.unobserve(e.target),this.countUp())})});t.observe(this.el)}easeOutCubic(t){const e=t-1;return e*e*e+1}countUp(){const t=performance.now();this.el.innerHTML=0;const e=Number.isInteger(this.finalValue),i=setInterval(()=>{const s=(performance.now()-t)/this.config.duration;let n=this.easeOutCubic(s)*this.finalValue;n=e?Math.round(n):Math.round(100*n)/100,this.finalValue>=n&&(this.el.innerText=this.numberFormat.format(n)),s>=1&&clearInterval(i)},50)}}class e{constructor(t){this.el=t;const e=/^(\d{4})-(\d{2})-(\d{2})/.exec((t.dataset.countdown||"").trim()),i=/^(\d{1,2}):(\d{2})$/.exec((t.dataset.countdownTime||"").trim());this.target=e?new Date(parseInt(e[1],10),parseInt(e[2],10)-1,parseInt(e[3],10),i?parseInt(i[1],10):0,i?parseInt(i[2],10):0).getTime():NaN,this.units=["months","weeks","days","hours","minutes","seconds"],this.unitEls={},this.units.forEach(e=>{const i=t.querySelector(`[data-countdown-unit="${e}"]`);i&&(this.unitEls[e]={container:i,value:i.querySelector("[data-countdown-value]")})}),this.presentUnits=this.units.filter(t=>this.unitEls[t]),this.hasSeconds=!!this.unitEls.seconds}mount(){this.el.dataset.countdownMounted||(this.el.dataset.countdownMounted="true",this.target&&!Number.isNaN(this.target)?(this.render(),setInterval(()=>this.render(),this.hasSeconds?1e3:6e4)):console.warn("CountDown: invalid target date, not starting.",this.el.dataset.countdown))}getParts(t){const e=new Date;if(t<=e)return{months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0};let i=12*(t.getFullYear()-e.getFullYear())+(t.getMonth()-e.getMonth()),s=new Date(e);s.setMonth(s.getMonth()+i),s>t&&(i--,s.setMonth(s.getMonth()-1));let n=t-s;const o=Math.floor(n/6048e5);n-=7*o*24*60*60*1e3;const r=Math.floor(n/864e5);n-=24*r*60*60*1e3;const l=Math.floor(n/36e5);n-=60*l*60*1e3;const a=Math.floor(n/6e4);return n-=60*a*1e3,{months:i,weeks:o,days:r,hours:l,minutes:a,seconds:Math.floor(n/1e3)}}render(){const t=this.getParts(new Date(this.target));let e=this.presentUnits.findIndex(e=>t[e]>0);-1===e&&(e=this.presentUnits.length-1),this.presentUnits.forEach((i,s)=>{this.unitEls[i].value.textContent=t[i],this.unitEls[i].container.hidden=s<e})}}class s{constructor(t){this.el=t,this.text=t.dataset.formSubmitText}mount(){this.apply(),this.observer=new MutationObserver(()=>this.apply()),this.observer.observe(this.el,{childList:!0,subtree:!0})}apply(){const t=this.el.querySelector('form :is(button, input)[type="submit"]');t&&("INPUT"===t.tagName?t.value!==this.text&&(t.value=this.text):t.textContent.trim()!==this.text&&(t.textContent=this.text))}}class n{constructor(t,e){this.form=t,this.timeout=null,this.config=Object.assign({throttle:0},e)}mount(){this.form.addEventListener("change",t=>{this.config.throttle?(this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.submit()},this.config.throttle)):this.submit()})}submit(){this.form.dispatchEvent(new Event("submit",{bubbles:!0,cancelable:!0})),this.form.submit()}}class o{constructor(t,e){this.el=t,this.config=Object.assign({hash:this.el.getAttribute("href"),defaultText:this.el.
2innerText,toggleText:this.el.innerText},e)}mount(){this.config.hash===window.location.hash&&this.onAdd(),this.el.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),this.toggleHash()})}toggleHash(){if(this.config.hash===window.location.hash){const t=window.pageYOffset;window.location.hash="#",window.scrollTo({top:t}),"replaceState"in window.history&&window.history.replaceState("",document.title,window.location.pathname+window.location.search),this.onRemove()}else{const t=window.pageYOffset;window.location.hash=this.config.hash,window.scrollTo({top:t}),this.onAdd()}}onAdd(){this.config.defaultText!==this.config.toggleText&&(this.el.innerText=this.config.toggleText),document.documentElement.classList.add("hash-active","hash-active-"+this.config.hash.substr(1))}onRemove(){this.config.defaultText!==this.config.toggleText&&(this.el.innerText=this.config.defaultText),document.documentElement.classList.remove("hash-active","hash-active-"+this.config.hash.substr(1))}}var r=i(31),l=i.n(r);class a{constructor(t,e={}){this.el=t,this.config=Object.assign({wrapAround:!0,cellAlign:"left"},e)}mount(){if(void 0===l())return;const t=l().prototype.resize;l().prototype.resize=function(){this.element.classList.add("flickity-resize"),t.call(this),this.element.classList.remove("flickity-resize")};const e=l().prototype.next;l().prototype.next=function(t,i){e.call(this,t,i),this.selectedIndex===this._padIndex&&e.call(this,t,i)};const i=l().prototype.previous;l().prototype.previous=function(t,e){i.call(this,t,e),this.selectedIndex===this._padIndex&&i.call(this,t,e)},l().PrevNextButton.prototype.createSVG=()=>"","slideshowResponsiveAdaptiveHeight"in this.el.dataset&&(this.mediaQuery=window.matchMedia("(min-width: 768px)"),this.mediaQuery.addEventListener("change",()=>this.createFlickity())),this.createFlickity()}createFlickity(){this.el.flickity?.destroy(),this.resizeObserver?.disconnect(),this.padCellsForWrap();const t={...this.config};this.mediaQuery&&(t.adaptiveHeight=!this.mediaQuery.matches),this.el.flickity=new(l())(this.el,t),this.el.flickity.cells?.length?this.onFlickityReady():this.el.flickity.on("ready",()=>this.onFlickityReady())}onFlickityReady(){const t=this.el.flickity?.cells;Array.isArray(t)&&t.length&&(this.el.querySelector("[data-slideshow-pad]")&&(this.el.flickity._padIndex=t.length-1,this.el.flickity.pageDots?.dots?.at(-1)?.remove()),this.resizeObserver=new ResizeObserver(()=>{this.el.flickity.resize()}),t.forEach(t=>this.resizeObserver.observe(t.element)),this.el.dataset.slideshowTitles&&this.initSlideTitles(t))}getCellElements(){const t=this.config.cellSelector;return t?Array.from(this.el.querySelectorAll(t)):Array.from(this.el.children)}padCellsForWrap(){if(!this.config.wrapAround)return;const t=this.getCellElements();if(t.some(t=>t.hasAttribute("data-slideshow-pad")))return;if(2!==t.length)return;const e=t[t.length-1].cloneNode(!0);e.setAttribute("data-slideshow-pad",""),e.removeAttribute("id"),e.querySelectorAll("[id]").forEach(t=>t.removeAttribute("id")),t[t.length-1].after(e)}initSlideTitles(t){const e=this.el.querySelector(".flickity-prev-next-button.previous"),i=this.el.querySelector(".flickity-prev-next-button.next");if(!e||!i)return;const s=s=>{const n=t.length;if(!n)return;const o=(s-1+n)%n,r=(s+1)%n,l=t[o]?.element?.dataset?.title??"",a=t[r]?.element?.dataset?.title??"";e.style.setProperty("--prev-title",`'${l}'`),i.style.setProperty("--next-title",`'${a}'`)};s(this.el.flickity.selectedIndex),this.el.flickity.on("change",s)}}class h{constructor(t,e={}){this.el=t,this.conf=e,this.conf.clientIP=e.clientIP||null,this.debug=!!e.debug,this.data=null;const i=(t.dataset.fiberExcantoBaseUrl||"").trim();this.excantoBaseUrl=i||"https://excantoprod.service-now.com/api/exab",this.STEPS={COMPANY:"company",USAGE:"usage",ADDON:"addon",DETAILS:"details",OFFICE_HOTEL:"office-hotel",SUCCESS:"success"},this.USAGE_TYPES={KONTORSHOTELL:"kontorshotell"},this.state={company:"",usage:"",addons:{},totalMonthly:0,totalOneTime:0,details:{}},this.texts=Object.assign({companyPlaceholder:"Välj fastighetsägare",oneTimeFeeSuffix:"kr engångsavgift",summary:"{monthly} kr per månad. Engångsavgift {onetime} kr.",errorGeneric:"Något gick fel. Försök igen om en stund."},e.texts||{}),this.companySelect=this.el.querySelector("[data-fiber-company]"),this.usageContainer=this.el.querySelector("[data-fiber-usage]"),this.priceRowsContainer=this.el.querySelector("[data-fiber-price-rows]"),this.stepForms=this.el.querySelectorAll("[data-fiber-form]"),this.detailsForm=this.el.querySelector(`[data-fiber-step="${this.STEPS.DETAILS}"] [data-fiber-form]`),this.backButtons=this.el.querySelectorAll("[data-fiber-back]"),this.totalSummaryElements=this.el.querySelectorAll("[data-fiber-total-summary]"),this.errorElement=this.el.querySelector("[data-fiber-error]"),this.slides=Array.from(this.el.querySelectorAll("[data-fiber-step]")),this.stepsOrder=[],this.slides.forEac
2h(t=>{const e=t.getAttribute("data-fiber-step");e&&this.stepsOrder.push(e)}),this.addonSlide=this.el.querySelector(`[data-fiber-step="${this.STEPS.ADDON}"]`),this.detailsSlide=this.el.querySelector(`[data-fiber-step="${this.STEPS.DETAILS}"]`),this.officeHotelSlide=this.el.querySelector(`[data-fiber-step="${this.STEPS.OFFICE_HOTEL}"]`),this.popoverTemplate=document.querySelector("[data-fiber-popover]"),this.popoverTemplateHtml=this.popoverTemplate?this.popoverTemplate.innerHTML:"",this.flkty=null}getStepIndex(t){return t?this.slides.findIndex(e=>e.getAttribute("data-fiber-step")===t):-1}getNextStepName(t){if(!t)return null;if(t===this.STEPS.USAGE&&this.state.usage===this.USAGE_TYPES.KONTORSHOTELL)return this.STEPS.OFFICE_HOTEL;const e=this.stepsOrder.indexOf(t);if(-1===e)return null;const i=this.stepsOrder[e+1];return i===this.STEPS.OFFICE_HOTEL?this.stepsOrder[e+2]||null:i||null}getPreviousStepName(t){if(!t)return null;if(t===this.STEPS.OFFICE_HOTEL)return this.STEPS.USAGE;const e=this.stepsOrder.indexOf(t);return-1===e?null:this.stepsOrder[e-1]||null}parseTpl(t,e){return t.replace(/\$\{([^}]+)\}/g,(t,i)=>{const s=i.trim();if(!s.includes(".")){const t=e[s];return null!=t?String(t):""}const n=s.split(".");let o=e;for(let t=0;t<n.length;t++){if(null==o)return"";o=o[n[t]]}return null!=o?String(o):""})}async mount(){this.flkty=this.el.flickity||null,this.flkty||console.warn("FiberForm: el.flickity missing - is data-slideshow set on the [data-fiber] element?"),this.data=await this.getData(),this.data?(this.populateCompaniesSelect(),this.renderInternetUsageOptions(),this.bindDetailsChange(),this.bindStepNavigation(),this.flkty&&this.flkty.resize(),this.logState("mount")):console.warn("FiberForm: no data loaded")}async getData(){const t=`${this.excantoBaseUrl}/enet_pricelist`;try{const e=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)return console.error("FiberForm getData HTTP error:",e.status),null;const i=await e.json();return this.logDebug("serviceNow:pricelist:response",i),i}catch(t){return console.error("FiberForm getData error:",t),null}}async fetchClientIP(){try{const t=await fetch("https://api.ipify.org?format=json");if(!t.ok)return void(this.conf.clientIP=null);const e=await t.json();this.conf.clientIP=e&&e.ip?e.ip:null}catch(t){this.conf.clientIP=null}}logDebug(t,e){this.debug&&console.log(`[FiberForm debug] ${t}`,e)}logState(t){if(!this.debug)return;const e=JSON.parse(JSON.stringify(this.state));console.log("[FiberForm state]",t,e)}populateCompaniesSelect(){if(!this.companySelect)return void console.warn("FiberForm: no company select element found");const t=this.data?.result?.companies;t?(this.companySelect.innerHTML=`\n\t\t\t<option value="">${this.texts.companyPlaceholder}</option>\n\t\t\t${Object.entries(t).map(([t,e])=>`\n\t\t\t\t<option value="${t}">\n\t\t\t\t\t${e.visningsnamn?.trim()||t}\n\t\t\t\t</option>\n\t\t\t`).join("")}\n\t\t`,this.companySelect.addEventListener("change",()=>{this.state.company=this.companySelect.value,this.logState("companyChange"),this.updateTableFromInputs()})):console.warn("FiberForm: no companies data found in API response")}renderInternetUsageOptions(){if(!this.usageContainer)return void console.warn("FiberForm: no usage container element found");const t=this.data?.result?.internetanvandare;t?(this.usageContainer.innerHTML=Object.entries(t).map(([t,e],i)=>{const s=(e.visningsnamn||"").trim();let n=`<h3 class="h5">${s}</h3>`,o="",r="";if(s.includes("Gbit/s")){const t=s.split(" - "),e=t[0]||"",i=(t[1]||"").trim(),l=e.split(" Gbit/s "),a=l[0]||"",h=(l[1]||"").replace(" användare","").trim(),c=a.trim().split(/\s+/),d=c[0]||"",u=c.slice(1).join(" ");d&&u&&(n=`<h3 class="h5">${d}<br>${u} Gbit/s</h3>`),h&&(o=`<p>Användare: <strong>${h}</strong></p>`),i&&(r=`<p><strong>${i}</strong></p>`)}return`\n\t\t\t\t<label>\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype="radio"\n\t\t\t\t\t\tname="fiber_internet_usage"\n\t\t\t\t\t\tvalue="${t}"\n\t\t\t\t\t\trequired\n\t\t\t\t\t\t${0===i?"checked":""}\n\t\t\t\t\t>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t${n}\n\t\t\t\t\t\t${o}\n\t\t\t\t\t\t${r}\n\t\t\t\t\t</div>\n\t\t\t\t</label>\n\t\t\t`}).join(""),this.usageContainer.querySelectorAll('input[type="radio"][name="fiber_internet_usage"]').forEach(t=>{t.checked&&(this.state.usage=t.value,this.logState("usageInitial"),this.applyUsageSelection(t.value)),t.addEventListener("change",()=>{t.checked&&(this.state.usage=t.value,this.logState("usageChange"),this.applyUsageSelection(t.value))})})):console.warn("FiberForm: no internet usage data found in API response")}applyUsageSelection(t){const e=t===this.USAGE_TYPES.KONTORSHOTELL;e?(this.priceRowsContainer&&(this.priceRowsContainer.innerHTML=""),this.state.addons={},this.state.totalMonthly=0,this.state.totalOneTime=0,this.updateTableFromInputs()):this.renderAddonTable(t),this.toggleStepVisibility(this.addonSlide,!e),this.toggleStepVisibility(this.detailsSlide,!e),this.toggleStepVisibility(this.officeHotelSlide,e)}renderAddonTable(t){if(!this.priceRowsContainer)return void console.warn("FiberForm: no price rows container found");const e=this.data?.result?.tillaggstjanster,i=this.data?.result?.extraTjanster,s=this.data?.result?.internetanvandare;if(!e||!i||!s)return console.warn("FiberForm: missing add-on data in API response"),this.priceRowsContainer.innerHTML="",this.updateTableFromInputs(),void(this.flkty&&this.flkty.resize());let n=e[`${t}_prislista`];if(this.priceRowsContainer.innerHTML="",!n)return this.updateTableFromInputs(),void(this.flkty&&this.flkty.resize());n={...n},n.eProduct&&delete n.eProduct,n.publikipadress=i.publikipadress,n={eProduct:s[t],...n}
2,Object.entries(n).forEach(([t,e])=>{const i=this.createAddonRow(t,e);i&&this.priceRowsContainer.appendChild(i)}),this.updateTableFromInputs(),this.flkty&&this.flkty.resize()}createAddonRow(t,e){const i=Number(e.antal??0),s=Number(e.manadspris??0),n=Number(e.engangspris??0),o=n>0?1:0,r=document.createElement("div");i<=0&&(r.style.display="none");const l=document.createElement("div"),a=document.createElement("p");if(a.textContent=e.visningsnamn||"",l.appendChild(a),this.popoverTemplateHtml&&e.beskrivning){const i=`fiber-popover-${t}`,s=document.createElement("button");s.type="button",s.ariaLabel="Läs mer",s.setAttribute("popovertarget",i);const n=this.parseTpl(this.popoverTemplateHtml,{id:i,title:e.visningsnamn||"",body:e.beskrivning}),o=document.createElement("div");o.innerHTML=n;const r=o.firstElementChild;l.appendChild(s),r&&l.appendChild(r)}r.appendChild(l);const h=document.createElement("div"),c=document.createElement("input");if(c.type="number",c.min=o.toString(),c.name=`addons[${t}][quantity]`,c.fiberData={key:t,description:e.beskrivning||"",article:e.artikelnummer||"",unitPrice:s,oneTimePrice:n},0===s)c.value=(i>0?i:1).toString(),c.disabled=!0,h.appendChild(c);else{c.value=Math.max(o,i).toString();const t=document.createElement("button"),e=document.createElement("button");t.type="button",e.type="button",t.textContent="-",e.textContent="+",h.appendChild(t),h.appendChild(c),h.appendChild(e);const s=t=>{const e=Math.max(o,t);c.value=e.toString(),this.updateTableFromInputs()};c.addEventListener("change",()=>{s(Number(c.value||0))}),t.addEventListener("click",()=>{s(Number(c.value||0)-1)}),e.addEventListener("click",()=>{s(Number(c.value||0)+1)})}r.appendChild(h);const d=document.createElement("div"),u=document.createElement("strong");u.setAttribute("data-fiber-row-total","true");const p=Number(c.value||0);return u.textContent=(s*p).toString(),d.appendChild(u),r.appendChild(d),r}updateTableFromInputs(){if(!this.priceRowsContainer)return this.state.addons={},this.state.totalMonthly=0,void(this.state.totalOneTime=0);const t=this.priceRowsContainer.querySelectorAll('input[type="number"]'),e={};let i=0,s=0;t.forEach(t=>{const n=t.fiberData;if(!n)return;const o=Number(t.value||0),r="publikipadress"===n.key?Math.max(0,o-1):o,l=n.unitPrice*r;o>0&&n.oneTimePrice>0&&(s+=n.oneTimePrice),e[n.key]={description:n.description,article:n.article,unitPrice:n.unitPrice,oneTimePrice:n.oneTimePrice,quantity:o,monthlyTotal:l},i+=l;const a=t.parentElement&&t.parentElement.parentElement;if(!a)return;const h=a.querySelector("[data-fiber-row-total]");h&&(h.textContent=l.toString())}),this.state.company&&this.state.company.toLowerCase().includes("vasakronan")&&(s=Math.max(0,s-4800)),this.state.addons=e,this.state.totalMonthly=i,this.state.totalOneTime=s,this.logState("addonsUpdate");const n=this.texts.summary.replace("{monthly}",i).replace("{onetime}",s);this.totalSummaryElements.forEach(t=>{"STRONG"===t.tagName?t.textContent=n:t.innerHTML=n})}collectDetailsFromForms(){return this.detailsForm?Object.fromEntries(new FormData(this.detailsForm)):{}}bindDetailsChange(){if(!this.detailsForm)return;const t=()=>{this.state.details=this.collectDetailsFromForms(),this.logState("detailsChange")};this.detailsForm.addEventListener("input",()=>{this.hideError(),t()}),this.detailsForm.addEventListener("change",()=>{this.hideError(),t()}),t()}updateDetailsStateFromForms(){this.state.details=this.collectDetailsFromForms(),this.logState("detailsSubmitSync")}showError(t){this.errorElement&&(this.errorElement.textContent=t||this.texts.errorGeneric,this.errorElement.style.display="")}hideError(){this.errorElement&&(this.errorElement.style.display="none",this.errorElement.textContent="")}setSubmitting(t,e){if(!t)return;const i=t.querySelector('button[type="submit"], input[type="submit"]');i&&(i.disabled=e,e?i.classList.add("is-loading"):i.classList.remove("is-loading"))}async handleFinalSubmit(t){if(t.reportValidity()){this.updateDetailsStateFromForms(),this.hideError(),this.setSubmitting(t,!0),this.conf.clientIP||await this.fetchClientIP();try{await this.sendToExcanto(this.state)}catch(e){return console.error("FiberForm submit error:",e),this.showError(this.texts.errorGeneric),void this.setSubmitting(t,!1)}if(this.sendToHubspot(this.state).catch(t=>console.error("HubSpot submit error (non-blocking):",t)),this.setSubmitting(t,!1),this.flkty){const t=this.getStepIndex(this.STEPS.SUCCESS);-1!==t?this.flkty.select(t,!0,!0):this.flkty.select(this.slides.length-1,!0,!0),this.flkty.resize()}}}async sendToHubspot(t){const e=this.conf.hubspotHubId,i=this.conf.hubspotFormId;if(!e||!i)throw new Error("HubSpot config missing (hubspotHubId / hub
2spotFormId)");const s=t.details||{},n=Object.keys(s).map(t=>({name:t,value:s[t]})),o=this.data?.result?.internetanvandare?.[t.usage]?.visningsnamn||"";o&&n.push({name:"antalanvandare",value:o});const r={pageUri:location.href.replace(location.search,""),pageName:document.title};if(this.conf.clientIP&&(r.ipAddress=this.conf.clientIP),"function"==typeof getCookie){const t=getCookie("hubspotutk");t&&(r.hutk=t)}const l={submittedAt:Date.now().toString(),fields:n,context:r},a=`https://api.hsforms.com/submissions/v3/integration/submit/${e}/${i}`;let h;this.logDebug("hubspot:request",{url:a,payload:l});try{h=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})}catch(t){throw console.error("FiberForm HubSpot network error:",t),new Error("HubSpot network error")}let c=null;try{c=await h.json()}catch(t){}if(c&&Array.isArray(c.errors)&&c.errors.length)throw c.errors.forEach(t=>console.log("HubSpot error:",t.message)),this.logDebug("hubspot:response:error",{status:h.status,body:c}),new Error("HubSpot request failed");if(!h.ok)throw this.logDebug("hubspot:response:httpError",{status:h.status,body:c}),new Error(`HubSpot HTTP error: ${h.status}`);return this.logDebug("hubspot:response:success",{status:h.status,body:c}),c}buildExcantoPayload(t){const e=t.details||{},i=document.getElementById("termsconditionslink"),s=i&&i.getAttribute("href")||"",n=t=>("on"===t||"true"===t||!0===t).toString(),o={company:t.company||"",fretagsnamn:e.company||"",organisationsnummer:e.organisationsnummer||"",adress:e.delivery_address||"",postnummer:e.zip||"",ort:e.city||"",frnamn:e.firstname||"",efternamn:e.lastname||"",telefonnummer:e.phone||"",epost:e.email||"",faktureringsadress:e.physical_invoicing_address__street||"",faktureringspostnummer:e.physical_invoicing_address__postal_code||"",faktureringsort:e.physical_invoicing_address__city||"",villkor:n(e.fiber_order_terms_conditions),gdpr:n(e["LEGAL_CONSENT.subscription_type_135936309"]),fiber_form_terms_and_conditions_link:s,ordertyp:"eNet",kontorshotell:"false",nskatstartdatum:e.nskatstartdatum||"",antalanvandare:this.data?.result?.internetanvandare?.[t.usage]?.visningsnamn||"",totalmanadspris:t.totalMonthly.toString(),totalengangspris:t.totalOneTime.toString(),eposttillekonomi:e.eposttillekonomi||"",referenceid:e.invoicing_reference||"",epostfaktura:e.invoicing_email||"",expressleverans:"",pappersfaktura:"",kommentar:e.comment||"",ip:this.conf.clientIP||""};let r=0;return Object.values(t.addons||{}).forEach(t=>{o[`a${r}_0`]=t.description||"",o[`a${r}_1`]=(t.article||"").toString(),o[`a${r}_2`]=t.monthlyTotal.toString(),o[`a${r}_3`]=t.quantity.toString(),r+=1}),o}async sendToExcanto(t){const e=this.buildExcantoPayload(t),i=`${this.excantoBaseUrl}/enet_order`;let s;this.logState("beforeExcanto"),this.logDebug("excanto:request",{url:i,payload:e});try{s=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(t){throw console.error("FiberForm Excanto network error:",t),new Error("Excanto network error")}let n=null;try{n=await s.json()}catch(t){}if(n&&Array.isArray(n.errors)&&n.errors.length)throw n.errors.forEach(t=>console.log("Excanto error:",t.message)),this.logDebug("excanto:response:error",{status:s.status,body:n}),new Error("Excanto request failed");if(!s.ok)throw this.logDebug("excanto:response:httpError",{status:s.status,body:n}),new Error(`Excanto HTTP error: ${s.status}`);return this.logDebug("excanto:response:success",{status:s.status,body:n}),n||{ok:s.ok}}applyChromeFix(t){const e=t.querySelector('button[type="submit"]');e&&e.addEventListener("click",e=>{if(!t.checkValidity()){e.preventDefault();const i=getComputedStyle(document.documentElement).getPropertyValue("scroll-behavior");document.documentElement.style.scrollBehavior="auto",t.reportValidity(),document.documentElement.style.scrollBehavior=i}})}bindStepNavigation(){this.stepForms.forEach(t=>{this.applyChromeFix(t),t.addEventListener("submit",async e=>{e.preventDefault();const i=t.closest("[data-fiber-step]"),s=i?i.getAttribute("data-fiber-step"):"";if(s===this.STEPS.DETAILS)await this.handleFinalSubmit(t);else if(t.reportValidity()&&this.flkty){const t=this.flkty.selectedIndex,e=this.slides[t],i=e?e.getAttribute("data-fiber-step"):s,n=this.getNextStepName(i);let o=t+1;if(n){const t=this.getStepIndex(n);-1!==t&&(o=t)}this.flkty.select(o,!0,!0),this.flkty.resize(),this.el.scrollIntoView({behavior:"smooth"})}})}),this.backButtons.forEach(t=>{t.addEventListener("click",t=>{if(t.preventDefault(),!this.flkty)return;const e=this.flkty.selectedIndex,i=this.slides[e],s=i?i.getAttribute("data-fiber-step"):"",n=this.getPreviousStepName(s);let o=e-1;if(n){const t=this.getStepIndex(n);-1!==t&&(o=t)}o<0&&(o=0),this.flkty.select(o,!0,!0),this.flkty.resize(),this.el.scrollIntoView({behavior:"smooth"})})})}toggleStepVisibility(t,e){t&&(t.style.display=e?"":"none",this.flkty&&this.flkty.resize())}}class c{constructor(t,e){this.el=t,this.config=Object.assign({target:this.el.getAttribute("href")?document.getElementById(this.el.getAttribute("href").substr(1)):null,templateDialog:null,preventDefault:!0},e),this.openEvent=new CustomEvent("sleek-ui/dialog/trigger-open",{bubbles:!0,detail:{dialog:this.config.target,data:this.el.dataset.dialogData||null}})}mount(){this.config.target&&this.el.addEventListener("click",t=>{this.config.preventDefault&&t.preventDefault(),this.el.dispatchEvent(this.openEvent),"script"===this.config.target.nodeName.toLowerCase()||"template"===this.config.target.nodeName.toLowerCase()?this.config.templateDialog?(this.config.templateDialog.className="dialog dialog--no-transition "+this.config.target.className,this.config.templateDialog.innerHTML=this.config.target.innerHTML+'<a class="dialog-close-button" role="button">&times;</a>',setTimeout(()=>{this.config.templateDialog.classList.remove("dialog--no-transition"),this.config.templateDialog.sleekDialog.open()},50)):console.error("DialogTrigger points to a script or template but no template dialog element is specified"):this.config.target.sleekDialog.open()})}}class d{constructor(t,e){this.el=t,this.config=Object.assign({},e),this.openEvent=new CustomEvent("sleek-ui/dialog/open",{bubbles:!0,detail:{dialog:this.el}}
2),this.closeEvent=new CustomEvent("sleek-ui/dialog/close",{bubbles:!0,detail:{dialog:this.el}})}mount(){this.el.sleekDialog={open:()=>{document.documentElement.classList.add("dialog-open"),document.documentElement.classList.add("dialog-open--"+this.el.id),this.el.classList.add("open"),this.el.dispatchEvent(this.openEvent)},close:()=>{document.documentElement.classList.remove("dialog-open"),document.documentElement.classList.remove("dialog-open--"+this.el.id),this.el.classList.remove("open"),this.el.dispatchEvent(this.closeEvent)},isOpen:()=>this.el.classList.contains("open"),isClosed:()=>!this.el.classList.contains("open"),getStatus:()=>this.el.classList.contains("open")?"open":"close"};var t=document.createElement("div");t.classList.add("dialog-backdrop"),this.el.parentNode.insertBefore(t,this.el.nextSibling),t.addEventListener("click",e=>{e.target===t&&this.el.sleekDialog.close()});var e=document.createElement("a");e.innerHTML="&times;",e.classList.add("dialog-close-button"),e.setAttribute("role","button"),this.el.appendChild(e),this.el.addEventListener("click",t=>{t.target.classList.contains("dialog-close-button")&&(t.preventDefault(),this.el.sleekDialog.close())}),document.addEventListener("keydown",t=>{27===t.keyCode&&this.el.sleekDialog.close()})}}i(292),i(381),i(380);const u=document.getElementById("translations");function p(t){if(u){var e=!1;try{e=JSON.parse(document.getElementById("translations").textContent)}catch{e=!1}return e&&e[t]?e[t]:t}return t}document.querySelectorAll("#site-header").forEach(t=>{const e=p("Back"),i=t.querySelector("a.menu-toggle"),s=t.querySelector("nav"),n=s.querySelectorAll("li.dropdown");i.addEventListener("click",e=>{e.preventDefault(),t.classList.toggle("menu-open"),t.style.setProperty("--menu-open-deep",0)}),s.querySelectorAll('a[href*="#"]').forEach(e=>{e.addEventListener("click",()=>{t.classList.remove("menu-open"),t.style.setProperty("--menu-open-deep",0)})}),n.forEach(i=>{const s=i.querySelector("a"),n=i.querySelector("ul");if(s.href){const t=document.createElement("li"),e=document.createElement("a");t.className="dupe",e.innerHTML=s.innerHTML,e.href=s.href,t.append(e),n.prepend(t)}const o=document.createElement("li"),r=document.createElement("a");o.className="back",r.innerHTML=e,r.role="button",o.append(r),n.prepend(o),s.addEventListener("click",e=>{if(window.matchMedia("(max-width: 1079px)").matches){e.preventDefault(),i.classList.add("open");const s=parseInt(getComputedStyle(t).getPropertyValue("--menu-open-deep"));t.style.setProperty("--menu-open-deep",s+1)}}),r.addEventListener("click",e=>{e.preventDefault(),i.classList.remove("open");const s=parseInt(getComputedStyle(t).getPropertyValue("--menu-open-deep"));t.style.setProperty("--menu-open-deep",s-1)})})});class m{constructor(t,e,i){this.el=t,this.data=e,this.config=Object.assign({api:!0,buildHTML:!0},i),this.ytPlayStates={"??":"unknown","-1":"unstarted",0:"ended",1:"playing",2:"paused",3:"buffering",5:"video-cued"},this.readyEvent=new CustomEvent("sleek-ui/video-embed/ready",{bubbles:!0})}mount(){if(this.config.buildHTML?this.buildHTML():this.wrapEl=this.el,this.config.api)if(this.el.dataset.src&&this.el.setAttribute("src",this.el.dataset.src),"YouTube"===this.data.provider_name){let t=this.el.getAttribute("src");if(-1===t.indexOf("enablejsapi=1")&&(-1===t.indexOf("?")?t+="?enablejsapi=1":t+="&enablejsapi=1",this.el.setAttribute("src",t)),"YT"in window)this.initYouTube();else{const t=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{t&&t(),this.initYouTube()},this.addScript("https://www.youtube.com/iframe_api")}}else"Vimeo"===this.data.provider_name&&this.addVimeoScript("https://player.vimeo.com/api/player.js").then(()=>this.initVimeo());else this.toggleSrc(),this.el.dispatchEvent(this.readyEvent)}buildHTML(){let t;this.wrapEl=this.el.parentNode,this.wrapEl.classList.add("video-embed","video-embed--"+this.data.provider_name),this.thumbnailEl=document.createElement("div"),this.thumbnailEl.classList.add("thumbnail"),this.thumbnailEl.appendChild(this.buildThumbnailHTML()),this.data.title&&this.el.setAttribute("title",this.data.title),t=document.createElement("div"),t.classList.add("video"),t.appendChild(this.el),this.wrapEl.appendChild(t),this.wrapEl.appendChild(this.thumbnailEl),this.data.title&&this.wrapEl.appendChild(void 0)}buildThumbnailHTML(){const t=this.data.thumbnail_url||"https://placehold.it/800x600?text=N/A",e=t.split(".").pop().toLowerCase();if(["mp4","webm","ogg","ogv"].includes(e)){const e=document.createElement("video");return e.loading="lazy",e.src=t,e.autoplay=!0,e.muted=!0,e.loop=!0,e.playsInl
2ine=!0,e}{const e=document.createElement("img");return e.setAttribute("loading","lazy"),e.src=t,e}}initYouTube(){this.ytPlayer=new YT.Player(this.el,{events:{onReady:t=>{this.el.dispatchEvent(this.readyEvent),this.wrapEl.classList.add("video-embed--state-"+(this.ytPlayStates[t.data]||"unknown"))},onStateChange:t=>{for(var[e,i]of Object.entries(this.ytPlayStates))this.wrapEl.classList.remove("video-embed--state-"+i);this.wrapEl.classList.add("video-embed--state-"+(this.ytPlayStates[t.data]||"unknown"))}}}),this.thumbnailEl&&this.thumbnailEl.addEventListener("click",t=>{this.play()})}initVimeo(){this.vimeoPlayer=new Vimeo.Player(this.el),this.vimeoPlayer.ready().then(()=>this.el.dispatchEvent(this.readyEvent)),this.vimeoPlayer.on("play",()=>{this.wrapEl.classList.add("video-embed--state-playing")}),this.vimeoPlayer.on("ended",()=>{this.wrapEl.classList.remove("video-embed--state-playing")}),this.vimeoPlayer.on("pause",()=>{this.wrapEl.classList.remove("video-embed--state-playing")}),this.thumbnailEl&&this.thumbnailEl.addEventListener("click",t=>{this.play()})}play(){this.vimeoPlayer?this.vimeoPlayer.play():this.ytPlayer&&this.ytPlayer.playVideo()}pause(){this.vimeoPlayer?this.vimeoPlayer.pause():this.ytPlayer&&this.ytPlayer.pauseVideo()}addScript(t){return new Promise((e,i)=>{const s=document.querySelector('script[src="'+t+'"]');if(s)e(s);else{const i=document.createElement("script");i.src=t,document.body.appendChild(i),i.addEventListener("load",()=>e(i))}})}addVimeoScript(t){return new Promise((e,i)=>{const s=document.querySelector('script[src="'+t+'"]');if(s)"undefined"==typeof Vimeo?s.addEventListener("load",()=>e(s)):e(s);else{const i=document.createElement("script");i.src=t,document.body.appendChild(i),i.addEventListener("load",()=>e(i))}})}toggleSrc(){const t=this.el.dataset.src||this.el.getAttribute("src");this.el.removeAttribute("src"),this.thumbnailEl&&this.thumbnailEl.addEventListener("click",e=>{this.el.setAttribute("src",t+"&autoplay=true"),this.wrapEl.classList.add("video-embed--state-playing")})}}const f=new IntersectionObserver(t=>{t.forEach(t=>{if(t.isIntersecting){f.unobserve(t.target);let e={};try{e=JSON.parse(t.target.dataset.oembed)}catch{e={}}t.target.dataset.oembedThumbnail&&(e.thumbnail_url=t.target.dataset.oembedThumbnail),e&&e.provider_name&&("YouTube"===e.provider_name||"Vimeo"===e.provider_name)&&(t.target.sleekVideoEmbed=new m(t.target,e,{api:!1}),t.target.sleekVideoEmbed.mount())}})},{threshold:.25});document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-oembed]").forEach(t=>{f.observe(t)})}),document.addEventListener("DOMContentLoaded",()=>{var t=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&0===e.target.src.length&&(e.target.src=e.target.dataset.src,t.unobserve(e.target),e.target.load())})});document.querySelectorAll("video[data-src]").forEach(e=>{t.observe(e)})});class g{constructor(t){this.el=t,this.listEl=this.el.querySelector("[data-search-results-list]"),this.paginationEl=this.el.querySelector("[data-search-results-pagination]"),this.listItemTpl=document.getElementById("template-search-results-item").innerHTML,this.paginationTpl=
2document.getElementById("template-search-results-pagination").innerHTML,this.nothingFoundTpl=document.getElementById("template-search-results-nothing-found").innerHTML;try{this.tags=JSON.parse(this.el.dataset.searchResultsTags)}catch{this.tags=null}const e=["term","offset","pathPrefix"],i=new URLSearchParams(window.location.search);for(const t of i)-1===e.indexOf(t)&&i.delete(t);this.params=Object.fromEntries(i)}parseTpl(t,e){return t.replace(/\$\{([^}]+)\}/g,(t,i)=>{const s=e[i];return void 0!==s?s:""})}async mount(){const t=await this.fetchResults(this.params)||{total:0,offset:0,limit:10,results:[]};this.updateResults(t),this.updatePagination(t)}processResult(t){const e=new URL(t.url),i=e.pathname,s=decodeURIComponent(i);if(t.path=e.pathname,i.startsWith("/kundereferanser/")||i.startsWith("/kundecase/")||i.startsWith("/kundcase/")||i.startsWith("/ajankohtaista/asiakastarinat/"))t.pathTag=p("Customer cases");else if(i.startsWith("/kunnskap/artikler/"))t.pathTag=p("Articles");else if(i.startsWith("/om-oss/aktuelt/")||i.startsWith("/nyhetsrum/"))t.pathTag=p("News");else if(i.startsWith("/techstudion")||s.includes("podcast"))t.pathTag=p("Podcast");else if(s.includes("/ordförrådet")||s.includes("/it-ordboka")||s.includes("/it-ordbog"))t.pathTag=p("Dictionary");else if(s.includes("webinar")||i.startsWith("/kunnskap/webinarer-arrangementer/")||s.includes("webinaarin")||s.includes("tallenne")||s.includes("event"))t.pathTag=p("Webinar & Event");else switch(t.type){case"BLOG_POST":t.pathTag=p("Blog post");break;case"LISTING_PAGE":t.pathTag=p("Blog");break;default:t.pathTag=p("Page")}const n=document.createElement("div");n.innerHTML=t.description||"",t.description=n.innerText,n.innerHTML=t.title||"",t.title=n.innerText,t.description=t.description.substring(0,350).replace(/\.*$/,"")+"..."}async fetchRaw(t){const e={limit:10,analytics:!1,...t},i=new URLSearchParams(e);["SITE_PAGE","LANDING_PAGE","BLOG_POST","LISTING_PAGE"].forEach(t=>i.append("type",t));const s="/_hcms/search?"+i.toString(),n=await fetch(s);return!!n.ok&&n.json()}narrowPathPrefix(t){if(!t||t.length<=30)return t||"";const e=t.split("/").filter(Boolean);let i="";for(const t of e){const e=`${i}/${t}/`;if(e.length>30)break;i=e}return i}async fetchFilteredResults(t,e){const i=Number(t.offset)||0,s=Number(t.limit)||10,n=this.narrowPathPrefix(e);let o=0,r=1/0;const l=[];for(;o<r&&o<1e3;){const i={...t,offset:o,limit:100};delete i.pathPrefix,n&&(i.pathPrefix=n);const s=await this.fetchRaw(i);if(!s)break;if(r=s.total,s.results.forEach(t=>{decodeURIComponent(new URL(t.url).pathname).startsWith(e)&&l.push(t)}),o+=s.results.length,0===s.results.length)break}return l.forEach(t=>this.processResult(t)),{total:l.length,offset:i,limit:s,results:l.slice(i,i+s)}}async fetchResults(t){const e=t.pathPrefix||"";if(e.length>30)return this.fetchFilteredResults(t,e);const i=await this.fetchRaw(t);return!!i&&(i.results.forEach(t=>this.processResult(t)),i)}updateResults(t){if(document.querySelectorAll("[data-num-total-search-results]").forEach(e=>e.innerHTML=t.total),t.results.length){let e="";t.results.forEach(t=>{e+=this.parseTpl(this.listItemTpl,t)}),this.listEl.innerHTML=e}else this.el.classList.add("no-results"),this.listEl.innerHTML=this.parseTpl(this.nothingFoundTpl,t)}updatePagination(t){if(t.results.length>0){const e=Math.ceil(t.total/t.limit),i=e*t.limit-t.limit,s={prevQry:"",nextQry:"",pages:""},n=Math.max(t.offset-t.limit,0),o=new URLSearchParams(window.location.search);o.set("offset",n),s.prevQry=o.toString(),0===t.offset?s.prevState="disabled":s.prevState="enabled";const r=Math.min(t.offset+t.limit,i),l=new URLSearchParams(window.location.search);l.set("offset",r),s.nextQry=l.toString(),t.offset===i?s.nextState="disabled":s.nextState="enabled";let a=document.createElement("div"),h=0;for(h=0;h<e;h++){let e=document.createElement("a"),i=h*t.limit,s=new URLSearchParams(window.location.search);s.set("offset",i),e.setAttribute("href","?"+s.toString()),e.innerText=h+1,t.offset==i&&e.classList.add("active"),a.appendChild(e)}h>1&&(s.pages=a.innerHTML),this.paginationEl.innerHTML=this.parseTpl(this.paginationTpl,s)}else this.paginationEl.innerHTML=""}}document.querySelectorAll("#search-results").forEach(t=>{new g(t).mount().then(()=>{const e=new URLSearchParams(window.location.search).get("term");if(e){const i=document.createElement("div");i.textContent=e;const s=i.textContent,n=p('Search results for "%s"'),o=t.dataset.titleTemplate||"",r=n||o||'Search results for "%s"';document.title=r.replace("%s",s)}})}),document.documentElement.style.setProperty("--scrollbar-width",window.innerWidth-document.body.clientWidth+"px"),new class{constructor(t){this.config=Object.assign({classEl:document.documentElement,farThreshold:100},t),this.lastScrollTop=0,this.lastScrollTopNS=0}mount(){this.setScrollStats(),window.addEventListener("scroll",t=>{this.setScrollStats()},{passive:!0})}setScrollStats(){const t=Math.max(document.documentElement.scrollTop||document.body.scrollTop,0),e=document.documentElement.scrollHeight;Math.abs(this.lastScrollTopNS-t)>0&&(t>this.lastScrollTopNS?(this.config.classEl.classList.remove("scrolling-up","scrolling-up-far"),this.config.classEl.classList.add("scrolling-down","has-scrolled-down")):(this.config.classEl.classList.remove("scrolling-down","scrolling-down-far"),this.config.classEl.classList.add("scrolling-up","has-scrolled-up")),this.lastScrollTopNS=t),Math.abs(this.lastScrollTop-t)>this.config.farThreshold&&(t>this.lastScrollTop?(this.config.classEl.classList.remove("scrolling-up-far"),this.config.classEl.classList.add("scrolling-down-far","has-scrolled-down-far")):(this.config.classEl.classList.remove("scrolling-down-far"),this.config.classEl.classList.add("scrolling-up-far","has-scrolled-up-far")),this.lastScrollTop=t),t>e/2?this.config.classEl.classList.add("scrolling-down-halfway"):this.config.classEl.classList.remove("scrolling-down-halfway"),t?(this.config.classEl.classList.add("has-scrolled"),this.config.classEl.classList.remove("at-top")):(this.config.classEl.classList.add("at-top"),this.config.classEl.classList.remove("has-scrolled","scrolling-down","has-scrolled-down","scrolling-down-far","has-scrolled-down-far","scrolling-up","has-scrolled-up","scrolling-up-far","has-scrolled-up-far"))}}({farThreshold:100}
2).mount(),document.querySelectorAll("[data-count]").forEach(e=>{const i=parseFloat(e.dataset.count,10);new t(e,i).mount()}),document.querySelectorAll("[data-countdown]").forEach(t=>{new e(t).mount()}),document.querySelectorAll("[data-form-submit-text]").forEach(t=>{new s(t).mount()}),document.querySelectorAll("[data-submit-onchange]").forEach(t=>{new n(t).mount()}),document.querySelectorAll("[data-filter-all]").forEach(t=>{!function(t){let e="all",i="";const s=t.querySelector(t.dataset.filterAll);if(!s)return;const n=Array.from(s.children),o=t.querySelectorAll("[data-filter-category]");o.forEach(t=>{"all"===t.dataset.filterCategory&&t.classList.add("active"),t.addEventListener("click",i=>{i.preventDefault(),e=t.dataset.filterCategory,o.forEach(t=>{t.classList.toggle("active",t.dataset.filterCategory===e)}),a()})});const r=t.querySelector(".filterSearch");r&&r.addEventListener("input",t=>{i=t.target.value.toLowerCase().trim(),a()});const l=t.querySelector(".filter-form");function a(){n.forEach(t=>{const s=(t.dataset.categories||"").split(" "),n=(t.dataset.name||"").toLowerCase(),o=(t.dataset.description||"").toLowerCase(),r="all"===e||s.includes(e),l=""===i||n.includes(i)||o.includes(i);r&&l?t.classList.remove("inactive"):t.classList.add("inactive")})}l&&l.addEventListener("submit",t=>t.preventDefault())}(t)}),document.querySelectorAll("[data-toggle-hash]").forEach(t=>{new o(t,{toggleText:t.dataset.toggleHash||t.innerText}).mount()}),document.querySelectorAll("[data-slideshow]").forEach(t=>{let e=t.dataset.slideshow;try{e=e?JSON.parse(e):{}}catch{e={}}new a(t,e).mount(),"undefined"!=typeof slideshowObserver&&slideshowObserver.observe(t)}),document.querySelectorAll("[data-fiber]").forEach(t=>{let e=t.dataset.fiber;try{e=e?JSON.parse(e):{}}catch{e={}}new h(t,e).mount()}),document.querySelectorAll("[data-slideshow-nav]").forEach(t=>{const e=document.querySelector(t.dataset.slideshowNav);if(!e)return;const i=t.hasAttribute("data-slideshow-no-active-first"),s=[...t.children],n=()=>{const n=e.flickity;if(!n)return;let o=!1;const r=()=>{const t=n.selectedIndex;s.forEach(t=>t.classList.remove("active")),!i||o?(s[t]?.classList.add("active"),o=!0):o=!0};t.addEventListener("click",e=>{const i=e.target.closest("a, [data-slideshow-nav-target]");if(!i)return;e.preventDefault();const s=i.dataset.slideshowNavTarget||i.getAttribute("href"),o=s?document.querySelector(s):null;if(!o)return;const r=n.cells.findIndex(t=>t.element===o);-1!==r&&n.select(r,!1,"slideshowNavInstant"in t.dataset)}),n.on("select",r),r()};e.flickity?.isAnimating?setTimeout(n,50):n()}),document.querySelectorAll("[data-clear-active]").forEach(t=>{const e=document.querySelector(t.dataset.clearActive);e&&t.addEventListener("click",t=>{t.preventDefault(),e.querySelectorAll(".active").forEach(t=>t.classList.remove("active"))})}),document.querySelectorAll("[data-dictionary-filter]").forEach(t=>{const e=t.querySelector("#dictionarySearch"),i=t.querySelector("#searchDropdown"),s=Array.from(t.querySelectorAll("li.dictionary-words")).map(t=>({name:t.dataset.name,url:t.querySelector("a")?.href}));e.addEventListener("input",()=>{const t=e.value.trim().toLowerCase();if(i.innerHTML="",t.length<1)return void i.classList.remove("active");const n=s.filter(e=>e.name.includes(t));n.length>0&&n.forEach(t=>{const e=document.createElement("li");e.innerHTML=`<a href="${t.url}">${t.name}</a>`,i.appendChild(e)}),i.classList.toggle("active",n.length>0)}),document.addEventListener("mousedown",e=>{t.contains(e.target)||i.classList.remove("active")}),window.addEventListener("scroll",()=>{i.classList.remove("active")}),document.addEventListener("keydown",t=>{"Escape"===t.key&&i.classList.remove("active")})});const y=document.createElement("div");y.classList.add("dialog"),document.body.appendChild(y),document.querySelectorAll('a[href^="#dialog-"]').forEach(t=>{new c(t,{target:document.getElementById(t.getAttribute("href").substr(1)),templateDialog:y}).mount()}),document.querySelectorAll("div.dialog").forEach(t=>{new d(t).mount()})})()})();
3//# sourceURL=https://25168988.fs1.hubspotusercontent-eu1.net/hubfs/25168988/hub_generated/template_assets/1/281478499551/1789989332781/template_app.js

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.