;(function (window, document, $, moment, undefined){
'use strict';
var INTERVAL_NONE='none';
var INTERVAL_DAILY='daily';
var INTERVAL_MONTHLY='monthly';
function pad(number, width, pad){
var _number='' + number;
var _width=width||2;
var _pad=pad||'0';
return (_number.length >=width) ? _number:Array.apply(null, Array(_width - _number.length + 1)).join(_pad) + _number;
}
var CountDownTimer=(function (){
function Counter($element, expiredAtString, interval, invert){
var now=moment();
var expiredAt=moment(expiredAtString);
var _expiredAt;
this._$element=$element;
this._interval=interval;
this._invert   = !!invert;
switch (this._interval){
case INTERVAL_DAILY:
_expiredAt=expiredAt.clone();
_expiredAt.year(now.year());
_expiredAt.month(now.month());
_expiredAt.date(now.date());
break;
case INTERVAL_MONTHLY:
_expiredAt=expiredAt.clone();
_expiredAt.year(now.year());
_expiredAt.month(now.month());
break;
case INTERVAL_NONE:
default:
_expiredAt=expiredAt.clone();
break;
}
this._expiredAt=_expiredAt;
this._timerId=null;
}
Counter.prototype._updateTimer=function (timer){
var $itemDay=this._$element.find('[data-st-countdown-item-day]');
var $countDay=this._$element.find('[data-st-countdown-count-day]');
var $countHour=this._$element.find('[data-st-countdown-count-hour]');
var $countMinute=this._$element.find('[data-st-countdown-count-minute]');
var $countSecond=this._$element.find('[data-st-countdown-count-second]');
var $countMs=this._$element.find('[data-st-countdown-count-ms]');
if($itemDay.length){
if(timer.day > 0){
$itemDay.show();
}else{
$itemDay.hide();
}}
if($countDay.length){
$countDay.text(timer.day);
}
if($countHour.length){
$countHour.text(pad(timer.hour));
}
if($countMinute.length){
$countMinute.text(pad(timer.minute));
}
if($countSecond.length){
$countSecond.text(pad(timer.second));
}
if($countMs.length){
$countMs.text(pad(timer.ms));
}};
Counter.prototype.onTick=function (){
var now=moment();
var diff=this._expiredAt.diff(now);
var $expired=this._$element.find('[data-st-countdown-expired]');
var timer={
day:Math.max(0, Math.floor(diff / (24 * 60 * 60 * 1000))),
hour:Math.max(0, Math.floor((diff % (24 * 60 * 60 * 1000)) / (60 * 60 * 1000))),
minute: Math.max(0, Math.floor((diff % (24 * 60 * 60 * 1000)) / (60 * 1000)) % 60),
second: Math.max(0, Math.floor((diff % (24 * 60 * 60 * 1000)) / 1000) % 60 % 60),
ms:Math.max(0, Math.floor((diff % (24 * 60 * 60 * 1000)) / 10) % 100)
};
this._updateTimer(timer);
if(diff > 0){
this._$element.removeClass('is-expired')
.addClass('is-active');
if(this._invert){
$expired.show();
}else{
$expired.hide();
}
return true;
}
switch (this._interval){
case INTERVAL_DAILY:
this._expiredAt=this._expiredAt.clone().add(1, 'day');
return true;
case INTERVAL_MONTHLY:
this._expiredAt=this._expiredAt.clone().add(1, 'month');
return true;
case INTERVAL_NONE:
default:
this._$element.removeClass('is-active')
.addClass('is-expired');
if(this._invert){
$expired.hide();
}else{
$expired.show();
}
break;
}
return false;
};
Counter.prototype.initialize=function (){
var self=this;
(function tick(interval){
var nextTick;
clearTimeout(self._timerId);
nextTick=self.onTick();
if(nextTick){
self._timerId=setTimeout(function (){
tick(interval)
}, interval);
}}(10));
};
return Counter;
}());
function onReady(){
var timers=[];
$('[data-st-countdown]').each(function (){
var $element=$(this);
var expiredAt=$element.attr('data-st-countdown-expired-at');
var interval=$element.attr('data-st-countdown-interval')||INTERVAL_NONE;
var invert=($element.attr('data-st-countdown-invert')==='true');
if(typeof expiredAt==='undefined'){
return;
}
var timer=new CountDownTimer($element, expiredAt, interval, invert);
timers.push(timer);
timer.initialize();
});
return timers;
}
$(onReady);
}(window, window.document, jQuery, moment));
;(function (window, document, $, ST, undefined){
'use strict';
var LoadMore=(function (){
function LoadMore($element){
var self=this;
this._$element=$element;
this._$state=$();
this._handlers={
onClick: function (event){
self.onClick(event);
}};}
LoadMore.prototype.update=function (data){
var $html;
var $content;
var $target;
this._$element.data('st-load-more', data.options);
$html=$(data.html);
$content=$html.find('[data-st-load-more-content]')
.addBack()
.filter('[data-st-load-more-content]');
$content=$content.length ? $content.children():$html;
$target=$('[data-st-load-more-id="' + this._$element.attr('data-st-load-more-controls') + '"]');
if($target.length){
$target.append($content);
}
if(!data.has_next){
this.removeEventListeners();
this._$element.remove();
}};
LoadMore.prototype.onClick=function (event){
var self=this;
var data;
event.preventDefault();
event.stopImmediatePropagation();
self._$element.prop('disabled', true);
self._$state.addClass('is-loading');
data=self._$element.data('st-load-more');
$.ajax({
url:ST.ajax_url,
headers: {
'X-Requested-With': 'XMLHttpRequest'
},
type:'GET',
data:data
})
.done(function (response){
if(!response.success){
return;
}
self.update(response.data);
})
.fail(function (jqXHR, textStatus, errorThrown){
})
.always(function (){
self._$state.removeClass('is-loading');
self._$element.prop('disabled', false);
});
};
LoadMore.prototype.prepareStateImage=function (){
var state;
var $state;
var $img;
state=(this._$element.attr('data-st-load-more-loading-img')||'').trim();
if(state===''){
return;
}
$img=$('<img />', {src: state});
$state=$('<div></div>', {'class': 'load-more-state'})
.append($img);
this._$element.after($state);
this._$state=$state;
};
LoadMore.prototype.addEventListeners=function (){
this._$element.on('click', this._handlers.onClick);
};
LoadMore.prototype.removeEventListeners=function (){
this._$element.off('click', this._handlers.onClick);
};
LoadMore.prototype.initialize=function (){
this.prepareStateImage();
this.addEventListeners();
};
return LoadMore;
}());
function onReady(){
var loadMores=[];
$('[data-st-load-more]').each(function (){
var $element=$(this);
var loadMore=new LoadMore($element);
loadMores.push(loadMore);
loadMore.initialize();
});
}
$(onReady);
}(window, window.document, jQuery, ST));
(()=>{"use strict";var t={n:e=>{var s=e&&e.__esModule?()=>e.default:()=>e;return t.d(s,{a:s}),s},d:(e,s)=>{for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window.jQuery;var s=t.n(e);class i{constructor(t){this._$element=t,this._focusedIndex=0,this._handlers={onClickTab:this._onClickTab.bind(this),onKeydown:this._onKeydown.bind(this)}}$tabList(){return this._$element.children('[role="tablist"]')}$tabListItemByTab(t){return t.closest("[data-st-tabs-tab-list-item]")}$tab(){return this.$tabList().find('[role="tab"]')}$tabPanel(){return this._$element.children().children('[role="tabpanel"]')}changeTabs(t){const e=this.$tab().eq(t),s=this.$tabListItemByTab(e),i=this.$tab(),n=this.$tabListItemByTab(i),a=this.$tabPanel();i.attr("aria-selected",!1),n.removeClass("is-selected"),e.attr("aria-selected",!0),s.addClass("is-selected"),a.prop("hidden",!0),a.filter(`#${CSS.escape(e.attr("aria-controls"))}`).prop("hidden",!1)}_onClickTab(t){const e=s()(t.currentTarget),i=this.$tab().index(e);this.changeTabs(i)}_onKeydown(t){if("ArrowRight"!==t.key&&"ArrowLeft"!==t.key)return;const e=this.$tab();e.eq(this._focusedIndex).attr("tabindex",-1),"ArrowRight"===t.key?(this._focusedIndex++,this._focusedIndex>=e.length&&(this._focusedIndex=0)):"ArrowLeft"===t.key&&(this._focusedIndex--,this._focusedIndex<0&&(this._focusedIndex=e.length-1)),e.eq(this._focusedIndex).attr("tabindex",0).focus()}addEventListeners(){this.$tab().on("click",this._handlers.onClickTab),this.$tabList().on("keydown",this._handlers.onKeydown)}removeEventListeners(){this.$tab().off("click",this._handlers.onClickTab),this.$tabList().off("keydown",this._handlers.onKeydown)}initialize(){const t=this.$tab();this._focusedIndex=Math.max(0,t.index(t.filter('[aria-selected="true"]'))),this.addEventListeners()}}s()((function(){let t=[];s()("[data-st-tabs]").each(((e,n)=>{var a=s()(n),r=new i(a);t=[...t,r],r.initialize()}))}))})();
(function(){
var supportsPassive=false;
try {
var opts=Object.defineProperty({}, 'passive', {
get:function(){
supportsPassive=true;
}});
window.addEventListener('testPassive', null, opts);
window.removeEventListener('testPassive', null, opts);
} catch(e){}
function init(){
var input_begin='';
var keydowns={};
var lastKeyup=null;
var lastKeydown=null;
var keypresses=[];
var modifierKeys=[];
var correctionKeys=[];
var lastMouseup=null;
var lastMousedown=null;
var mouseclicks=[];
var mouseclickCoordinates=[];
var mousemoveTimer=null;
var lastMousemoveX=null;
var lastMousemoveY=null;
var mousemoveStart=null;
var mousemoves=[];
var touchmoveCountTimer=null;
var touchmoveCount=0;
var lastTouchEnd=null;
var lastTouchStart=null;
var touchEvents=[];
var scrollCountTimer=null;
var scrollCount=0;
var correctionKeyCodes=[ 'Backspace', 'Delete', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End', 'PageUp', 'PageDown' ];
var modifierKeyCodes=[ 'Shift', 'CapsLock' ];
var forms=document.querySelectorAll('form[method=post]');
for(var i=0; i < forms.length; i++){
var form=forms[i];
var formAction=form.getAttribute('action');
if(formAction){
if(formAction.indexOf('http://')==0||formAction.indexOf('https://')==0){
if(formAction.indexOf('http://' + window.location.hostname + '/')!=0&&formAction.indexOf('https://' + window.location.hostname + '/')!=0){
continue;
}}
}
form.addEventListener('submit', function (){
var ak_bkp=prepare_array_for_request(keypresses);
var ak_bmc=prepare_array_for_request(mouseclicks);
var ak_bte=prepare_array_for_request(touchEvents);
var ak_bmm=prepare_array_for_request(mousemoves);
var ak_bcc=prepare_array_for_request(mouseclickCoordinates);
var input_fields={
'bib': input_begin,
'bfs': Date.now(),
'bkpc': keypresses.length,
'bkp': ak_bkp,
'bmc': ak_bmc,
'bmcc': mouseclicks.length,
'bmk': modifierKeys.join(';'),
'bck': correctionKeys.join(';'),
'bmmc': mousemoves.length,
'btmc': touchmoveCount,
'bsc': scrollCount,
'bte': ak_bte,
'btec':touchEvents.length,
'bmm':ak_bmm,
'bcc':ak_bcc
};
var akismet_field_prefix='ak_';
if(this.getElementsByClassName){
var possible_akismet_containers=this.getElementsByClassName('akismet-fields-container');
for(var containerIndex=0; containerIndex < possible_akismet_containers.length; containerIndex++){
var container=possible_akismet_containers.item(containerIndex);
if(container.getAttribute('data-prefix') ){
akismet_field_prefix=container.getAttribute('data-prefix');
break;
}}
}
for(var field_name in input_fields){
var field=document.createElement('input');
field.setAttribute('type', 'hidden');
field.setAttribute('name', akismet_field_prefix + field_name);
field.setAttribute('value', input_fields[ field_name ]);
this.appendChild(field);
}}, supportsPassive ? { passive: true }:false);
form.addEventListener('keydown', function(e){
if(e.key in keydowns){
return;
}
var keydownTime=(new Date()).getTime();
keydowns[ e.key ]=[ keydownTime ];
if(! input_begin){
input_begin=keydownTime;
}
var lastKeyEvent=Math.max(lastKeydown, lastKeyup);
if(lastKeyEvent){
keydowns[ e.key ].push(keydownTime - lastKeyEvent);
}
lastKeydown=keydownTime;
}, supportsPassive ? { passive: true }:false);
form.addEventListener('keyup', function(e){
if(!(e.key in keydowns) ){
return;
}
var keyupTime=(new Date()).getTime();
if('TEXTAREA'===e.target.nodeName||'INPUT'===e.target.nodeName){
if(-1!==modifierKeyCodes.indexOf(e.key) ){
modifierKeys.push(keypresses.length - 1);
}else if(-1!==correctionKeyCodes.indexOf(e.key) ){
correctionKeys.push(keypresses.length - 1);
}else{
var keydownTime=keydowns[ e.key ][0];
var keypress=[];
keypress.push(keyupTime - keydownTime);
if(keydowns[ e.key ].length > 1){
keypress.push(keydowns[ e.key ][1]);
}
keypresses.push(keypress);
}}
delete keydowns[ e.key ];
lastKeyup=keyupTime;
}, supportsPassive ? { passive: true }:false);
form.addEventListener("focusin", function(e){
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
form.addEventListener("focusout", function(e){
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
}
document.addEventListener('mousedown', function(e){
lastMousedown=(new Date()).getTime();
var mouseclickCoordinate=[];
var rect=e.target.getBoundingClientRect();
var relativeX=e.clientX - rect.left;
var relativeY=e.clientY - rect.top;
mouseclickCoordinate.push(Math.round(relativeX) );
mouseclickCoordinate.push(Math.round(relativeY) );
mouseclickCoordinate.push(rect.width > 0 ? Math.round(relativeX / rect.width * 100):0);
mouseclickCoordinate.push(rect.height > 0 ? Math.round(relativeY / rect.height * 100):0);
mouseclickCoordinates.push(mouseclickCoordinate);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('mouseup', function(e){
if(! lastMousedown){
return;
}
var now=(new Date()).getTime();
var mouseclick=[];
mouseclick.push(now - lastMousedown);
if(lastMouseup){
mouseclick.push(lastMousedown - lastMouseup);
}
mouseclicks.push(mouseclick);
lastMouseup=now;
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
document.addEventListener('mousemove', function(e){
if(mousemoveTimer){
clearTimeout(mousemoveTimer);
mousemoveTimer=null;
}else{
mousemoveStart=(new Date()).getTime();
lastMousemoveX=e.offsetX;
lastMousemoveY=e.offsetY;
}
mousemoveTimer=setTimeout(function(theEvent, originalMousemoveStart){
var now=(new Date()).getTime() - 500;
var mousemove=[];
mousemove.push(now - originalMousemoveStart);
mousemove.push(Math.round(Math.sqrt(Math.pow(theEvent.offsetX - lastMousemoveX, 2) +
Math.pow(theEvent.offsetY - lastMousemoveY, 2)
)
)
);
if(mousemove[1] > 0){
mousemoves.push(mousemove);
}
mousemoveStart=null;
mousemoveTimer=null;
}, 500, e, mousemoveStart);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchmove', function(e){
if(touchmoveCountTimer){
clearTimeout(touchmoveCountTimer);
}
touchmoveCountTimer=setTimeout(function (){
touchmoveCount++;
}, 500);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchstart', function(e){
lastTouchStart=(new Date()).getTime();
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchend', function(e){
if(! lastTouchStart){
return;
}
var now=(new Date()).getTime();
var touchEvent=[];
touchEvent.push(now - lastTouchStart);
if(lastTouchEnd){
touchEvent.push(lastTouchStart - lastTouchEnd);
}
touchEvents.push(touchEvent);
lastTouchEnd=now;
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
document.addEventListener('scroll', function(e){
if(scrollCountTimer){
clearTimeout(scrollCountTimer);
}
scrollCountTimer=setTimeout(function (){
scrollCount++;
}, 500);
}, supportsPassive ? { passive: true }:false);
}
function prepare_array_for_request(a, limit){
if(! limit){
limit=100;
}
var rv='';
if(a.length > 0){
var random_starting_point=Math.max(0, Math.floor(Math.random() * a.length - limit) );
for(var i=0; i < limit&&i < a.length; i++){
var entry=a[ random_starting_point + i ];
rv +=entry.join(',') + ';';
}}
return rv;
}
if(document.readyState!=='loading'){
init();
}else{
document.addEventListener('DOMContentLoaded', init);
}})();