"use strict";
function _classCallCheck(e, n) {
if (!(e instanceof n))
throw new TypeError("Cannot call a class as a function");
}
var Core = function e() {
_classCallCheck(this, e),
new MobileMenu(),
new FixedMenu(),
new HomeSlider(),
new ShowMember(),
new MeetSlider(),
new Gallery(),
new AboutNews(),
new AboutHeroSlider(),
new ContactPerson(),
new Video(),
new StepForm(),
new ScrollTo(),
new SelectClient(),
new ShowAccountNumber(),
new StrategySlider(),
new Accordion(),
//new StickyMenu(),
new LabCoopSections(),
new FilterLabPosts();
},
domReady = function (e) {
"interactive" === document.readyState || "complete" === document.readyState
? e()
: document.addEventListener("DOMContentLoaded", e);
};
domReady(function (e) {
return new Core();
});
("use strict");
/(trident|msie)/i.test(navigator.userAgent) &&
document.getElementById &&
window.addEventListener &&
window.addEventListener(
"hashchange",
function () {
var t,
e = location.hash.substring(1);
/^[A-z0-9_-]+$/.test(e) &&
(t = document.getElementById(e)) &&
(/^(?:a|select|input|button|textarea)$/i.test(t.tagName) ||
(t.tabIndex = -1),
t.focus());
},
!1
);
("use strict");
function _classCallCheck(t, o) {
if (!(t instanceof o))
throw new TypeError("Cannot call a class as a function");
}
var AboutHeroSlider = function t() {
_classCallCheck(this, t),
(this.container = document.querySelector(".hero__sliderContainer")),
this.container &&
(this.sliderInstance = tns({
container: ".hero__sliderContainer",
items: 1,
controls: !1,
autoplay: !0,
autoplayButtonOutput: !1,
autoplayTimeout: 5e3,
navPosition: "bottom",
mouseDrag: !0,
}));
};
("use strict");
function _classCallCheck(t, n) {
if (!(t instanceof n))
throw new TypeError("Cannot call a class as a function");
}
var AboutNews = function t() {
_classCallCheck(this, t),
(this.container = document.querySelector(".aboutNews__inner")),
this.container &&
(this.sliderInstance = tns({
container: ".aboutNews__inner",
items: 1,
controls: !1,
autoplay: !0,
autoplayButtonOutput: !1,
autoplayTimeout: 222e4,
navPosition: "bottom",
autoHeight: !0,
}));
};
("use strict");
function _classCallCheck(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(e, t) {
for (var i = 0; i < t.length; i++) {
var a = t[i];
(a.enumerable = a.enumerable || !1),
(a.configurable = !0),
"value" in a && (a.writable = !0),
Object.defineProperty(e, a.key, a);
}
}
function _createClass(e, t, i) {
return (
t && _defineProperties(e.prototype, t), i && _defineProperties(e, i), e
);
}
var Accordion = (function () {
function e() {
_classCallCheck(this, e),
(this.container = document.querySelector(".abilityFaq__list")),
this.container &&
((this.activeClass = "abilityFaq__answer--show"),
(this.activeItem = "abilityFaq__item--active"),
this.init());
}
return (
_createClass(e, [
{
key: "init",
value: function () {
var i = this;
(this.items = document.querySelectorAll(".abilityFaq__item")),
this.items.forEach(function (t) {
t.addEventListener("click", function () {
var e = t.querySelector(".abilityFaq__answer");
t.classList.toggle(i.activeItem),
e.style.maxHeight
? (e.style.maxHeight = null)
: (e.style.maxHeight = e.scrollHeight + "px");
});
});
},
},
]),
e
);
})();
("use strict");
function _classCallCheck(e, s) {
if (!(e instanceof s))
throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(e, s) {
for (var t = 0; t < s.length; t++) {
var i = s[t];
(i.enumerable = i.enumerable || !1),
(i.configurable = !0),
"value" in i && (i.writable = !0),
Object.defineProperty(e, i.key, i);
}
}
function _createClass(e, s, t) {
return (
s && _defineProperties(e.prototype, s), t && _defineProperties(e, t), e
);
}
var ContactPerson = (function () {
function e() {
var s = this;
_classCallCheck(this, e),
(this.links = document.querySelectorAll(".contact__link")),
(this.closeBtns = document.querySelectorAll(".contact__icon.icon-close")),
this.links.length &&
((this.activeClass = "contact__link--selected"),
(this.hideClass = "contact__link--hide"),
this.links.forEach(function (e) {
e.addEventListener("click", function () {
e.classList.contains(s.activeClass)
? s.clear()
: (s.hide(),
e.classList.remove(s.hideClass),
e.classList.add(s.activeClass));
});
}),
this.closeBtns.forEach(function (e) {
e.addEventListener("click", function () {
s.clear();
});
}));
}
return (
_createClass(e, [
{
key: "hide",
value: function () {
var s = this;
this.links.forEach(function (e) {
e.classList.remove(s.activeClass), e.classList.add(s.hideClass);
});
},
},
{
key: "clear",
value: function () {
var s = this;
this.links.forEach(function (e) {
e.classList.remove(s.activeClass), e.classList.remove(s.hideClass);
});
},
},
]),
e
);
})();
("use strict");
function _classCallCheck(t, e) {
if (!(t instanceof e))
throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(t, e) {
for (var s = 0; s < e.length; s++) {
var n = e[s];
(n.enumerable = n.enumerable || !1),
(n.configurable = !0),
"value" in n && (n.writable = !0),
Object.defineProperty(t, n.key, n);
}
}
function _createClass(t, e, s) {
return (
e && _defineProperties(t.prototype, e), s && _defineProperties(t, s), t
);
}
var FilterLabPosts = (function () {
function t() {
_classCallCheck(this, t),
(this.container = document.querySelector(".labPosts__inner")),
(this.spinner = document.querySelector(".labPosts__loader")),
(this.filter = document.querySelectorAll(".labPosts__button--filter")),
(this.showFilter = document.querySelector(
".labPosts__button--showFilters"
)),
(this.applyFilters = document.querySelector(
".labPosts__button--applyFilters"
)),
(this.select = document.querySelector(".labPosts__select")),
(this.selectDate = document.querySelector(".labPosts__yearSelect")),
(this.popup = document.querySelector(".offerPopup")),
(this.addIdea = document.querySelector(".labPosts__addIdea")),
(this.currentFilters = { category: null, year: null }),
this.container && this.init();
}
return (
_createClass(t, [
{
key: "init",
value: function () {
(this.colors = {
testy: "#ffe62c",
przygotowanie: "#7171ff",
wdrozone: "#00d0ef",
}),
(this.classes = {
spinner: "labPosts__loader--show",
filter: "labPosts__button--selected",
select: "labPosts__select--show",
popup: "offerPopup--show",
}),
this.getPosts(),
this.bindButton();
},
},
{
key: "bindButton",
value: function () {
var a = this;
this.showFilter.addEventListener("click", function () {
a.select.classList.toggle(a.classes.select);
}),
this.addIdea.addEventListener("click", function () {
a.popup.classList.add(a.classes.popup),
document
.querySelector(".offerPopup__close")
.addEventListener("click", function () {
a.popup.classList.remove(a.classes.popup);
});
}),
this.selectDate.addEventListener("change", function (t) {
var e = t.target.value;
a.currentFilters.year = e;
}),
this.applyFilters.addEventListener("click", function () {
a.getPosts();
}),
this.filter.forEach(function (t) {
t.addEventListener("click", function (t) {
var e = t.target,
s = e.dataset.cat,
n = e.classList.contains(a.classes.filter);
a.filter.forEach(function (t) {
t.classList.remove(a.classes.filter);
}),
n
? (a.currentFilters.category = null)
: (e.classList.add(a.classes.filter),
(a.currentFilters.category = s)),
a.getPosts();
});
});
},
},
{
key: "filterEmptyFilters",
value: function () {
var s = this;
return Object.keys(this.currentFilters)
.filter(function (t) {
return s.currentFilters[t];
})
.reduce(function (t, e) {
return (t[e] = s.currentFilters[e]), t;
}, {});
},
},
{
key: "getPosts",
value: function () {
var e = this;
this.spinner.classList.add(this.classes.spinner);
var t = "".concat(ajaxUrl, "?action=").concat("get_lab_posts"),
s = this.filterEmptyFilters(),
n = !0;
return (
s.category && (n = !1),
fetch(t, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(s),
})
.then(function (t) {
return t.json();
})
.then(function (t) {
return e.applyResponse(t.data, n);
})
);
},
},
{
key: "applyResponse",
value: function (t, e) {
var s = this.formatData(t, e);
(this.container.innerHTML = s),
this.spinner.classList.remove(this.classes.spinner);
},
},
{
key: "formatData",
value: function (t, e) {
var s = this,
n = "";
if (e) {
var a = { przygotowanie: [], testy: [], wdrozone: [] };
t.map(function (t) {
a[t.tax.slug].push(t);
}),
Object.values(a).forEach(function (t) {
n += s.getColumnTemplate(t);
});
} else n += this.getColumnTemplate(t, !0);
return t.length || (n = this.getEmptyTemplate()), n;
},
},
{
key: "getPostsTemplate",
value: function (t) {
var e = this,
s = "";
return (
t.map(function (t) {
s += e.getPostTemplate(t);
}),
s
);
},
},
{
key: "getPostTemplate",
value: function (t) {
var e = t.author,
s = t.authorPic,
n = t.date,
a = t.title,
o = t.excerpt,
l = t.link,
c = t.tax;
return '\n
\n
\n
\n\n ')
.concat(
this.getAuthorTemplate(s, c.slug),
'\n\n
\n
\n\n \n\n
\n
'
)
.concat(a, '
\n
przez ')
.concat(e, '
\n
')
.concat(
o,
"
\n
\n
\n\n "
)
.concat(
this.getLinkTemplate(l, c.slug),
"\n\n
\n
\n
"
);
},
},
{
key: "getAuthorTemplate",
value: function (t, e) {
var s = "";
return (
t &&
(s +=
'\n \n \n
')),
s
);
},
},
{
key: "getLinkTemplate",
value: function (t, e) {
var s = "",
n = {
testy: "Dowiedz się więcej...",
przygotowanie: "",
wdrozone: "Zobacz case study",
};
return (
"" !== n[e] &&
(s += '')
.concat(n[e], " ")),
s
);
},
},
{
key: "getColumnTemplate",
value: function (t, e) {
return '\n \n '
)
.concat(this.getPostsTemplate(t), "\n
");
},
},
{
key: "getEmptyTemplate",
value: function () {
return '\n \n
Nie znaleziono postów.
\n \n ';
},
},
]),
t
);
})();
("use strict");
function _classCallCheck(e, i) {
if (!(e instanceof i))
throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(e, i) {
for (var t = 0; t < i.length; t++) {
var s = i[t];
(s.enumerable = s.enumerable || !1),
(s.configurable = !0),
"value" in s && (s.writable = !0),
Object.defineProperty(e, s.key, s);
}
}
function _createClass(e, i, t) {
return (
i && _defineProperties(e.prototype, i), t && _defineProperties(e, t), e
);
}
var FixedMenu = (function () {
function e() {
_classCallCheck(this, e),
(this.menu = document.querySelector(".mainMenu")),
(this.offset = this.menu.offsetTop + this.menu.offsetHeight + 30),
(this.fixedClass = "mainMenu--fixed"),
(this.bodyFixed = "menuFixed"),
this.init();
}
return (
_createClass(e, [
{
key: "init",
value: function () {
var e = this;
window.addEventListener("scroll", function () {
e.setFixed();
});
},
},
{
key: "setFixed",
value: function () {
window.pageYOffset > this.offset
? (this.menu.classList.add(this.fixedClass),
document.body.classList.add(this.bodyFixed))
: (this.menu.classList.remove(this.fixedClass),
document.body.classList.remove(this.bodyFixed));
},
},
]),
e
);
})();
("use strict");
function _classCallCheck(a, t) {
if (!(a instanceof t))
throw new TypeError("Cannot call a class as a function");
}
var Gallery = function a() {
var t = this;
_classCallCheck(this, a);
var n = "jsGalleryImage",
c = document.querySelector(".".concat(n)),
i = window.innerWidth - 110 - 40 - 80;
c &&
(this.instance = lc_lightbox(".".concat(n), {
wrap_class: "lcl_fade_oc",
thumb_attr: "data-lcl-thumb",
skin: "minimal",
max_width: i,
cmd_position: "outer",
animation_time: 500,
})),
window.addEventListener("resize", function () {
t.instance && lcl_close();
});
};
("use strict");
function _classCallCheck(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
(i.enumerable = i.enumerable || !1),
(i.configurable = !0),
"value" in i && (i.writable = !0),
Object.defineProperty(e, i.key, i);
}
}
function _createClass(e, t, n) {
return (
t && _defineProperties(e.prototype, t), n && _defineProperties(e, n), e
);
}
var HomeSlider = (function () {
function t() {
var e = this;
_classCallCheck(this, t),
(this.container = document.querySelector(".clients__sliderContainer")),
this.container &&
window.addEventListener("scroll", function () {
!e.sliderInstance &&
e.isScrolledIntoView(e.container) &&
(e.sliderInstance = tns({
container: ".clients__sliderContainer",
items: 3,
controls: !1,
autoplay: !0,
autoplayButtonOutput: !1,
autoplayTimeout: 3e3,
navPosition: "bottom",
mouseDrag: !0,
gutter: 50,
responsive: { 782: { gutter: 105, items: 5 } },
}));
});
}
return (
_createClass(t, [
{
key: "isScrolledIntoView",
value: function (e) {
var t = e.getBoundingClientRect(),
n = t.top,
i = t.bottom;
return n < window.innerHeight && 0 <= i;
},
},
]),
t
);
})();
("use strict");
function _classCallCheck(t, e) {
if (!(t instanceof e))
throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(t, e) {
for (var s = 0; s < e.length; s++) {
var n = e[s];
(n.enumerable = n.enumerable || !1),
(n.configurable = !0),
"value" in n && (n.writable = !0),
Object.defineProperty(t, n.key, n);
}
}
function _createClass(t, e, s) {
return (
e && _defineProperties(t.prototype, e), s && _defineProperties(t, s), t
);
}
var LabCoopSections = (function () {
function t() {
_classCallCheck(this, t),
(this.nav = document.querySelectorAll(".labCoop__button")),
(this.sections = document.querySelectorAll(".labCoop__section")),
(this.showAllName = "show-all"),
(this.classes = {
button: "labCoop__button--active",
section: "labCoop__section--active",
}),
this.nav.length && this.sections.length && (this.bind(), this.init());
}
return (
_createClass(t, [
{
key: "bind",
value: function () {
var s = this;
this.nav.forEach(function (e) {
e.addEventListener("click", function () {
var t = e.dataset.target;
t !== s.showAllName
? (s.setActiveSection(t), s.setActiveButton(t))
: s.showAll();
});
});
},
},
{
key: "init",
value: function () {
this.showAll();
},
},
{
key: "setActiveSection",
value: function (e) {
var s = this;
this.sections.forEach(function (t) {
t.dataset.section === e
? t.classList.add(s.classes.section)
: t.classList.remove(s.classes.section);
});
},
},
{
key: "setActiveButton",
value: function (e) {
var s = this;
this.nav.forEach(function (t) {
t.dataset.target === e
? t.classList.add(s.classes.button)
: t.classList.remove(s.classes.button);
});
},
},
{
key: "showAll",
value: function () {
var e = this;
this.setActiveButton(this.showAllName),
this.sections.forEach(function (t) {
t.classList.add(e.classes.section);
});
},
},
]),
t
);
})();
("use strict");
function _classCallCheck(t, e) {
if (!(t instanceof e))
throw new TypeError("Cannot call a class as a function");
}
var MeetSlider = function t() {
_classCallCheck(this, t),
(this.container = document.querySelector(".meet__gallery")),
this.container &&
(this.sliderInstance = tns({
container: ".meet__gallery",
items: 1,
controls: !1,
autoplay: !0,
autoplayButtonOutput: !1,
autoplayTimeout: 3e3,
navPosition: "bottom",
gutter: 0,
responsive: { 782: { gutter: 12, items: 3 } },
}));
};
("use strict");
function _classCallCheck(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var s = t[n];
(s.enumerable = s.enumerable || !1),
(s.configurable = !0),
"value" in s && (s.writable = !0),
Object.defineProperty(e, s.key, s);
}
}
function _createClass(e, t, n) {
return (
t && _defineProperties(e.prototype, t), n && _defineProperties(e, n), e
);
}
var MobileMenu = (function () {
function t(e) {
_classCallCheck(this, t),
(this.menu = document.querySelector(".mainMenu")),
(this.button = document.querySelector(".mainMenu__hamburger")),
(this.classes = {
menu: "mainMenu--open",
button: "mainMenu__hamburger--menuOpen",
}),
this.setEvents();
}
return (
_createClass(t, [
{
key: "setEvents",
value: function () {
var e = this;
this.button.addEventListener("click", function () {
e.button.classList.contains(e.classes.button)
? e.close()
: e.open();
});
},
},
{
key: "open",
value: function () {
this.menu.classList.add(this.classes.menu),
this.button.classList.add(this.classes.button);
},
},
{
key: "close",
value: function () {
this.menu.classList.remove(this.classes.menu),
this.button.classList.remove(this.classes.button);
},
},
]),
t
);
})();
("use strict");
function _classCallCheck(t, o) {
if (!(t instanceof o))
throw new TypeError("Cannot call a class as a function");
}
var OfferSlider = function t() {
_classCallCheck(this, t),
(this.container = document.querySelector(".offerShowcase--show")),
this.container &&
(this.sliderInstance = tns({
container: ".offerShowcase--show",
items: 1,
controls: !1,
autoplay: !0,
autoplayButtonOutput: !1,
autoplayTimeout: 3e3,
navPosition: "bottom",
gutter: 0,
responsive: { 600: { gutter: 84, items: 3 } },
}));
};
("use strict");
function _classCallCheck(a, l) {
if (!(a instanceof l))
throw new TypeError("Cannot call a class as a function");
}
var Parallax = function a() {
_classCallCheck(this, a);
document.querySelectorAll(".parallax").forEach(function (a) {
a.dataset.parallax;
new Rellax(a);
});
};
("use strict");
function _classCallCheck(a, n) {
if (!(a instanceof n))
throw new TypeError("Cannot call a class as a function");
}
var SaveOfferEntry = function a(n) {
_classCallCheck(this, a);
var t = "".concat(ajaxUrl, "?action=").concat("new_offer_entry");
fetch(t, {
method: "POST",
body: JSON.stringify(n),
headers: { "Content-Type": "application/json" },
});
};
("use strict");
function _classCallCheck(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(e, t) {
for (var o = 0; o < t.length; o++) {
var n = t[o];
(n.enumerable = n.enumerable || !1),
(n.configurable = !0),
"value" in n && (n.writable = !0),
Object.defineProperty(e, n.key, n);
}
}
function _createClass(e, t, o) {
return (
t && _defineProperties(e.prototype, t), o && _defineProperties(e, o), e
);
}
var ScrollTo = (function () {
function e() {
_classCallCheck(this, e),
(this.elements = document.querySelectorAll(".jsScrollTo")),
this.elements.length &&
((this.menuHeight = 90), (this.offset = 40), this.init());
}
return (
_createClass(e, [
{
key: "init",
value: function () {
var r = this;
if (
(this.elements.forEach(function (a) {
a.addEventListener("click", function () {
var e = a.dataset.target,
t = document.querySelector(e),
o = window.location.pathname,
n = "#".concat(e.match(/(\[data-section=')(.*)(?='])/)[2]);
if (t) {
var i = t.offsetTop - r.menuHeight - r.offset;
window.scrollTo({ top: i, behavior: "smooth" }),
window.location.replace(o + n);
}
});
}),
window.location.hash)
) {
var e = document.querySelector(
"[data-section='".concat(window.location.hash.substring(1), "']")
);
if (e) {
var t = e.offsetTop - this.menuHeight - this.offset;
window.scrollTo({ top: t, behavior: "smooth" });
}
}
},
},
]),
e
);
})();
("use strict");
function _classCallCheck(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(e, t) {
for (var s = 0; s < t.length; s++) {
var n = t[s];
(n.enumerable = n.enumerable || !1),
(n.configurable = !0),
"value" in n && (n.writable = !0),
Object.defineProperty(e, n.key, n);
}
}
function _createClass(e, t, s) {
return (
t && _defineProperties(e.prototype, t), s && _defineProperties(e, s), e
);
}
var SelectClient = (function () {
function e() {
_classCallCheck(this, e),
(this.clientsContainer = document.querySelector(".aboutClients__inner")),
this.clientsContainer &&
((this.logos = document.querySelectorAll(".aboutClients__logoWrap")),
(this.classess = {
active: "aboutClients__container--active",
logo: "aboutClients__logoWrap--active",
}),
this.init());
}
return (
_createClass(e, [
{
key: "init",
value: function () {
this.bindEvents(), this.select(0);
},
},
{
key: "bindEvents",
value: function () {
var s = this;
this.logos.forEach(function (e, t) {
e.addEventListener("click", function () {
s.select(t);
});
});
},
},
{
key: "select",
value: function (s) {
var n = this;
document
.querySelectorAll(".aboutClients__container")
.forEach(function (e, t) {
t === s
? (e.classList.add(n.classess.active),
n.logos[t].classList.add(n.classess.logo))
: (e.classList.remove(n.classess.active),
n.logos[t].classList.remove(n.classess.logo));
});
},
},
]),
e
);
})();
("use strict");
function _classCallCheck(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
(i.enumerable = i.enumerable || !1),
(i.configurable = !0),
"value" in i && (i.writable = !0),
Object.defineProperty(e, i.key, i);
}
}
function _createClass(e, t, n) {
return (
t && _defineProperties(e.prototype, t), n && _defineProperties(e, n), e
);
}
var ShowAccountNumber = (function () {
function e() {
_classCallCheck(this, e),
(this.button = document.querySelector(".jsShowAccountNumber")),
(this.textToShow = document.querySelector(".jsAccountNumber")),
this.button && this.textToShow && this.init();
}
return (
_createClass(e, [
{
key: "init",
value: function () {
(this.textToShow.style = "display: none"), this.bindEvents();
},
},
{
key: "bindEvents",
value: function () {
var e = this;
this.button.addEventListener("click", function () {
(e.button.style = "display: none"),
(e.textToShow.style = "display: inline");
});
},
},
]),
e
);
})();
("use strict");
function _classCallCheck(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(e, t) {
for (var i = 0; i < t.length; i++) {
var n = t[i];
(n.enumerable = n.enumerable || !1),
(n.configurable = !0),
"value" in n && (n.writable = !0),
Object.defineProperty(e, n.key, n);
}
}
function _createClass(e, t, i) {
return (
t && _defineProperties(e.prototype, t), i && _defineProperties(e, i), e
);
}
var ShowMember = (function () {
function e() {
_classCallCheck(this, e),
(this.button = document.querySelector(".jsShowMember")),
this.button &&
((this.container = document.querySelector(".team__content")),
(this.child = document.querySelector(".team__member")),
(this.hideClass = "team__button--hide"),
(this.allowedHeight = 2 * this.child.offsetHeight),
this.init());
}
return (
_createClass(e, [
{
key: "init",
value: function () {
var e = this;
(this.container.style = "max-height: ".concat(
this.allowedHeight,
"px"
)),
this.container.scrollHeight === this.container.offsetHeight &&
this.button.classList.add(this.hideClass),
this.button.addEventListener("click", function () {
(e.container.style = ""), e.button.classList.add(e.hideClass);
});
},
},
]),
e
);
})();
("use strict");
function _slicedToArray(e, t) {
return (
_arrayWithHoles(e) || _iterableToArrayLimit(e, t) || _nonIterableRest()
);
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
function _iterableToArrayLimit(e, t) {
var s = [],
n = !0,
r = !1,
i = void 0;
try {
for (
var a, o = e[Symbol.iterator]();
!(n = (a = o.next()).done) && (s.push(a.value), !t || s.length !== t);
n = !0
);
} catch (e) {
(r = !0), (i = e);
} finally {
try {
n || null == o.return || o.return();
} finally {
if (r) throw i;
}
}
return s;
}
function _arrayWithHoles(e) {
if (Array.isArray(e)) return e;
}
function _classCallCheck(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(e, t) {
for (var s = 0; s < t.length; s++) {
var n = t[s];
(n.enumerable = n.enumerable || !1),
(n.configurable = !0),
"value" in n && (n.writable = !0),
Object.defineProperty(e, n.key, n);
}
}
function _createClass(e, t, s) {
return (
t && _defineProperties(e.prototype, t), s && _defineProperties(e, s), e
);
}
var StepForm = (function () {
function e() {
var n = this;
_classCallCheck(this, e),
(this.sections = document.querySelectorAll(".offerSection")),
(this.steps = document.querySelectorAll(".step__section")),
(this.input = document.querySelector(".offerSection__input")),
(this.spinner = document.querySelector(".offer__loader")),
(this.form = document.querySelector(".offerPopup")),
(this.selectedValues = []),
this.sections.forEach(function (e, t) {
var s = e.querySelector(".offerSection__header");
(n.selectedValues[t] = {}), (n.selectedValues[t].header = s.innerText);
}),
(this.maxLength = this.sections.length),
(this.animationDelay = 500),
(this.canChange = !0),
(this.selectedSectionId = null),
(this.selectedType = null),
(this.selectedGoal = null),
(this.classess = {
section: "offerSection--show",
chosenSection: "offerShowcase--show",
step: "step__section--selected",
form: "offerPopup--show",
inputError: "offerSection__input--error",
spinner: "offer__loader--show",
}),
this.sections.length &&
this.steps.length &&
this.spinner &&
(this.bindEvents(), this.init());
}
return (
_createClass(e, [
{
key: "init",
value: function () {
this.select(0);
},
},
{
key: "bindEvents",
value: function () {
var i = this;
this.input.addEventListener("keyup", function (e) {
if ("Enter" === e.key) {
var t = e.target.value;
i.validateInput(t)
? (i.triggerValueChange(2, t),
(i.selectedValues[2].value = t),
i.select(3),
i.input.classList.remove(i.classess.inputError),
i.saveFormData(t))
: i.input.classList.add(i.classess.inputError);
}
}),
this.sections.forEach(function (e, r) {
var t = e.querySelectorAll(".offerSection__button"),
s = e.querySelector(".offerSection__save");
t.forEach(function (s, n) {
s.addEventListener("click", function () {
var e = s.dataset.target;
if (e)
"caseStudy" === e
? (i.select(4), i.setSelectedSection())
: "offer" === e && i.showForm();
else {
var t = s.innerText;
i.triggerValueChange(r, t.replace(/\r?\n/g, " ")),
(i.selectedValues[r].value = t.replace(/\r?\n/g, " ")),
i.generateDynamicTitle(r, n),
i.select(r + 1);
}
});
}),
s &&
s.addEventListener("click", function () {
var e = s.previousElementSibling.value;
i.validateInput(e)
? (i.triggerValueChange(r, e),
(i.selectedValues[r].value = e),
i.select(r + 1),
i.input.classList.remove(i.classess.inputError),
i.saveFormData(e))
: i.input.classList.add(i.classess.inputError);
});
}),
this.steps.forEach(function (e, t) {
e.querySelector(".step__inner").addEventListener(
"click",
function () {
e.classList.contains(i.classess.step) && i.select(t);
}
);
});
},
},
{
key: "select",
value: function (n) {
var r = this;
this.canChange &&
n < this.maxLength &&
this.sections.forEach(function (t, s) {
s !== n
? t.classList.remove(r.classess.section)
: ((r.canChange = !1),
n !== r.selectedSectionId &&
r.spinner.classList.add(r.classess.spinner),
setTimeout(function () {
t.classList.add(r.classess.section);
var e = s < r.steps.length ? s : r.steps.length - 1;
r.steps[e].classList.add(r.classess.step),
r.spinner.classList.remove(r.classess.spinner),
(r.canChange = !0),
(r.selectedSectionId = n);
}, r.animationDelay));
});
},
},
{
key: "setSelectedSection",
value: function () {
var t = this,
s = this.selectedValues[1].value;
document.querySelectorAll(".offerShowcase").forEach(function (e) {
e.dataset.name === s && e.classList.add(t.classess.chosenSection);
});
},
},
{
key: "generateDynamicTitle",
value: function (e, t) {
var s = document.querySelectorAll(".offerSection__dynamicTitle");
if (s.length) {
0 === e
? (this.selectedType = ["stronom", "sklepom", "portalom"][t])
: 1 === e &&
(this.selectedGoal = [
"lepszej widoczności",
"wiekszego ruchu",
"wyższej konwersji",
][t]);
var n = "Zobacz jak pomogliśmy innym "
.concat(this.selectedType, ", z celem ")
.concat(this.selectedGoal, ".");
s.forEach(function (e) {
return (e.childNodes[0].nodeValue = n);
});
}
},
},
{
key: "showForm",
value: function () {
var e = this;
this.form.classList.add(this.classess.form),
document
.querySelector(".offerPopup__close")
.addEventListener("click", function () {
e.closeForm();
});
},
},
{
key: "closeForm",
value: function () {
this.form.classList.remove(this.classess.form);
},
},
{
key: "triggerValueChange",
value: function (e, t) {
jQuery("#nf-field-" + [25, 26, 27][e])
.val(t)
.trigger("change");
},
},
{
key: "validateInput",
value: function (e) {
return e.match(/.+\..+/) && 4 <= e.length;
},
},
{
key: "saveFormData",
value: function () {
var e = _slicedToArray(this.selectedValues, 3),
t = e[0],
s = e[1],
n = e[2],
r = { type: t.value, goal: s.value, domain: n.value };
new SaveOfferEntry(r);
},
},
]),
e
);
})();
("use strict");
function _classCallCheck(e, n) {
if (!(e instanceof n))
throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(e, n) {
for (var t = 0; t < n.length; t++) {
var i = n[t];
(i.enumerable = i.enumerable || !1),
(i.configurable = !0),
"value" in i && (i.writable = !0),
Object.defineProperty(e, i.key, i);
}
}
function _createClass(e, n, t) {
return (
n && _defineProperties(e.prototype, n), t && _defineProperties(e, t), e
);
}
// var StickyMenu = (function () {
// function e() {
// _classCallCheck(this, e),
// (this.menu = document.querySelector(".abilityMenu")),
// this.menu && this.initSticky();
// }
// return (
// _createClass(e, [
// {
// key: "initSticky",
// value: function () {
// new StickySidebar(".abilityMenu", {
// containerSelector: ".abilityWrapper__inner",
// innerWrapperSelector: ".abilityMenu__outer",
// topSpacing: 200,
// bottomSpacing: 80,
// minWidth: 200,
// });
// },
// },
// ]),
// e
// );
// })();
("use strict");
function _classCallCheck(t, a) {
if (!(t instanceof a))
throw new TypeError("Cannot call a class as a function");
}
var StrategySlider = function t() {
_classCallCheck(this, t),
(this.container = document.querySelector(".strategyResults__container")),
this.container &&
(this.sliderInstance = tns({
container: ".strategyResults__container",
items: 1,
controls: !1,
autoplay: !0,
autoplayButtonOutput: !1,
autoplayTimeout: 5e3,
navPosition: "bottom",
mouseDrag: !0,
}));
};
("use strict");
function _classCallCheck(c, a) {
if (!(c instanceof a))
throw new TypeError("Cannot call a class as a function");
}
var Video = function c() {
_classCallCheck(this, c);
var a = ".jsVideo";
// console.log('Video', document.querySelector(a), GLightbox);
document.querySelector(a) && GLightbox({ selector: a });
};