![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /proc/thread-self/cwd/wp-content/plugins/bdthemes-element-pack/assets/vendor/js/ |
function timeline(a,b){function c(a,b){return"number"==typeof a||0==a%1||(console.warn(`${r} The value "${a}" entered for the setting "${b}" is not an integer.`),!1)}function d(a,b,c){b.classList.add(c),a.parentNode.insertBefore(b,a),b.appendChild(a)}function e(a){a.forEach(a=>{d(a.querySelector(".bdt-timeline-content"),document.createElement("div"),"bdt-timeline-content-wrapper"),d(a.querySelector(".bdt-timeline-content-wrapper"),document.createElement("div"),"bdt-timeline-item-inner")})}function f(a,b){const c=a.getBoundingClientRect(),d=window.innerHeight||document.documentElement.clientHeight,e=v.verticalTrigger.defaultValue.match(/(\d*\.?\d*)(.*)/);let f=b.unit,g=b.value,h=d;return"px"===f&&g>=d&&(console.warn("The value entered for the setting \"verticalTrigger\" is larger than the window height. The default value will be used instead."),[,g,f]=e),"px"===f?h=parseInt(h-g,10):"%"===f&&(h=parseInt(h*((100-g)/100),10)),c.top<=h&&c.left<=(window.innerWidth||document.documentElement.clientWidth)&&0<=c.top+c.height&&0<=c.left+c.width}function g(a,b){a.style.webkitTransform=b,a.style.msTransform=b,a.style.transform=b}function h(a){window.innerWidth>a.settings.forceVerticalMode&&(function(){a.itemWidth=a.wrap.offsetWidth/a.settings.visibleItems,a.items.forEach(b=>{b.style.width=`${a.itemWidth}px`}),a.scrollerWidth=a.itemWidth*a.items.length,a.scroller.style.width=`${a.scrollerWidth}px`}(),function(){let b=0,c=0;a.items.forEach((a,d)=>{a.style.height="auto";const e=a.offsetHeight;0==d%2?c=e>c?e:c:b=e>b?e:b});const d=`translateY(${c}px)`;a.items.forEach((e,f)=>{0==f%2?(e.style.height=`${c}px`,"bottom"===a.settings.horizontalStartPosition?(e.classList.add("bdt-timeline-item--bottom"),g(e,d)):e.classList.add("bdt-timeline-item--top")):(e.style.height=`${b}px`,"bottom"===a.settings.horizontalStartPosition?e.classList.add("bdt-timeline-item--top"):(e.classList.add("bdt-timeline-item--bottom"),g(e,d)))}),a.scroller.style.height=`${c+b}px`}())}function i(a){if(a.items.length>a.settings.visibleItems){const b=document.createElement("button"),c=document.createElement("button"),d=a.items[0].offsetHeight;b.className="bdt-timeline-nav-button bdt-timeline-nav-button--prev",c.className="bdt-timeline-nav-button bdt-timeline-nav-button--next",b.textContent="Previous",c.textContent="Next",b.style.top=`${d}px`,c.style.top=`${d}px`,0===u?b.disabled=!0:u===a.items.length-a.settings.visibleItems&&(c.disabled=!0),a.timelineEl.appendChild(b),a.timelineEl.appendChild(c)}}function j(a){const b=a.timelineEl.querySelector(".bdt-timeline-divider");b&&a.timelineEl.removeChild(b);const c=a.items[0].offsetHeight,d=document.createElement("span");d.className="bdt-timeline-divider",d.style.top=`${c}px`,a.timelineEl.appendChild(d)}function k(a){const b=a.items[u].offsetLeft;g(a.scroller,`translate3d(-${b}px, 0, 0)`)}function l(a){const b=a.timelineEl.querySelectorAll(".bdt-timeline-nav-button"),c=a.timelineEl.querySelector(".bdt-timeline-nav-button--prev"),d=a.timelineEl.querySelector(".bdt-timeline-nav-button--next"),f=a.items.length-a.settings.visibleItems,g=parseInt(a.settings.moveItems,10);[].forEach.call(b,b=>{b.addEventListener("click",function(b){b.preventDefault(),u=this.classList.contains("bdt-timeline-nav-button--next")?u+=g:u-=g,0===u||0>u?(u=0,c.disabled=!0,d.disabled=!1):u===f||u>f?(u=f,c.disabled=!1,d.disabled=!0):(c.disabled=!1,d.disabled=!1),k(a)})})}function m(a){u=a.settings.startIndex,a.timelineEl.classList.add("bdt-timeline--horizontal"),h(a),k(a),i(a),j(a),l(a)}function n(a){let b=0;a.items.forEach((c,d)=>{c.classList.remove("animated","fadeIn"),!f(c,a.settings.verticalTrigger)&&0<d?c.classList.add("animated"):b=d;const e="left"===a.settings.verticalStartPosition?1:0;d%2==e&&window.innerWidth>a.settings.forceVerticalMode?c.classList.add("bdt-timeline-item--right"):c.classList.add("bdt-timeline-item--left")});for(let c=0;c<b;c+=1)a.items[c].classList.remove("animated","fadeIn");window.addEventListener("scroll",()=>{a.items.forEach(b=>{f(b,a.settings.verticalTrigger)&&b.classList.add("fadeIn")})})}function o(a){a.timelineEl.classList.remove("bdt-timeline--horizontal","bdt-timeline--mobile"),a.scroller.removeAttribute("style"),a.items.forEach(a=>{a.removeAttribute("style"),a.classList.remove("animated","fadeIn","bdt-timeline-item--left","bdt-timeline-item--right")});const b=a.timelineEl.querySelectorAll(".bdt-timeline-nav-button");[].forEach.call(b,a=>{a.parentNode.removeChild(a)})}function p(){q.forEach(a=>{a.timelineEl.style.opacity=0,a.timelineEl.classList.contains("bdt-timeline--loaded")||e(a.items),o(a),window.innerWidth<=a.settings.forceVerticalMode&&a.timelineEl.classList.add("bdt-timeline--mobile"),"horizontal"===a.settings.mode&&window.innerWidth>a.settings.forceVerticalMode?m(a):n(a),a.timelineEl.classList.add("bdt-timeline--loaded"),setTimeout(()=>{a.timelineEl.style.opacity=1},500)})}const q=[],r="Timeline:";let s,t=window.innerWidth,u=0;const v={forceVerticalMode:{type:"integer",defaultValue:700},horizontalStartPosition:{type:"string",acceptedValues:["bottom","top"],defaultValue:"top"},mode:{type:"string",acceptedValues:["horizontal","vertical"],defaultValue:"horizontal"},moveItems:{type:"integer",defaultValue:1},startIndex:{type:"integer",defaultValue:0},verticalStartPosition:{type:"string",acceptedValues:["left","right"],defaultValue:"left"},verticalTrigger:{type:"string",defaultValue:"15%"},visibleItems:{type:"integer",defaultValue:3}};a.length&&[].forEach.call(a,function(a){const d=a.id?`#${a.id}`:`.${a.className}`,e="could not be found as a direct descendant of",f=a.dataset;let g,h,i;const j={};try{if(g=a.querySelector(".bdt-timeline-wrapper"),!g)throw new Error(`${r} .bdt-timeline-wrapper ${e} ${d}`);else if(h=g.querySelector(".bdt-timeline-items"),!h)throw new Error(`${r} .bdt-timeline-items ${e} .bdt-timeline-wrapper`);else i=[].slice.call(h.children,0)}catch(a){return console.warn(a.message),!1}Object.keys(v).forEach(a=>{j[a]=v[a].defaultValue,f[a]?j[a]=f[a]:b&&b[a]&&(j[a]=b[a]),"integer"===v[a].type?(!j[a]||!c(j[a],a))&&(j[a]=v[a].defaultValue):"string"===v[a].type&&v[a].acceptedValues&&-1===v[a].acceptedValues.indexOf(j[a])&&(console.warn(`${r} The value "${j[a]}" entered for the setting "${a}" was not recognised.`),j[a]=v[a].defaultValue)});const k=v.verticalTrigger.defaultValue.match(/(\d*\.?\d*)(.*)/),l=j.verticalTrigger.match(/(\d*\.?\d*)(.*)/);let[,m,n]=l,o=!0;m||(console.warn(`${r} No numercial value entered for the 'verticalTrigger' setting.`),o=!1),"px"!==n&&"%"!==n&&(console.warn(`${r} The setting 'verticalTrigger' must be a percentage or pixel value.`),o=!1),"%"===n&&(100<m||0>m)?(console.warn(`${r} The 'verticalTrigger' setting value must be between 0 and 100 if using a percentage value.`),o=!1):"px"===n&&0>m&&(console.warn(`${r} The 'verticalTrigger' setting value must be above 0 if using a pixel value.`),o=!1),!1===o&&([,m,n]=k),j.verticalTrigger={unit:n,value:m},j.moveItems>j.visibleItems&&(console.warn(`${r} The value of "moveItems" (${j.moveItems}) is larger than the number of "visibleItems" (${j.visibleItems}). The value of "visibleItems" has been used instead.`),j.moveItems=j.visibleItems),j.startIndex>i.length-j.visibleItems&&i.length>j.visibleItems?(console.warn(`${r} The 'startIndex' setting must be between 0 and ${i.length-j.visibleItems} for this timeline. The value of ${i.length-j.visibleItems} has been used instead.`),j.startIndex=i.length-j.visibleItems):i.length<=j.visibleItems?(console.warn(`${r} The number of items in the timeline must exceed the number of visible items to use the 'startIndex' option.`),j.startIndex=0):0>j.startIndex&&(console.warn(`${r} The 'startIndex' setting must be between 0 and ${i.length-j.visibleItems} for this timeline. The value of 0 has been used instead.`),j.startIndex=0),q.push({timelineEl:a,wrap:g,scroller:h,items:i,settings:j})}),p(),window.addEventListener("resize",()=>{clearTimeout(s),s=setTimeout(()=>{const a=window.innerWidth;a!==t&&(p(),t=a)},250)})}window.jQuery&&(a=>{a.fn.timeline=function(a){return timeline(this,a),this}})(window.jQuery);