4 lines
89 KiB
Text
4 lines
89 KiB
Text
function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _wrapRegExp(){_wrapRegExp=function(e,t){return new o(e,void 0,t)};var n=RegExp.prototype,l=new WeakMap;function o(e,t,r){t=RegExp(e,t);return l.set(t,r||l.get(e)),_setPrototypeOf(t,o.prototype)}function a(n,e){var a=l.get(e);return Object.keys(a).reduce(function(e,t){var r=a[t];if("number"==typeof r)e[t]=n[r];else{for(var o=0;void 0===n[r[o]]&&o+1<r.length;)o++;e[t]=n[r[o]]}return e},Object.create(null))}return _inherits(o,RegExp),o.prototype.exec=function(e){var t,e=n.exec.call(this,e);return e&&(e.groups=a(e,this),t=e.indices)&&(t.groups=a(t,this)),e},o.prototype[Symbol.replace]=function(e,t){var r,o;return"string"==typeof t?(r=l.get(this),n[Symbol.replace].call(this,e,t.replace(/\$<([^>]+)>/g,function(e,t){t=r[t];return"$"+(Array.isArray(t)?t.join("$"):t)}))):"function"==typeof t?(o=this,n[Symbol.replace].call(this,e,function(){var e=arguments;return"object"!=_typeof(e[e.length-1])&&(e=[].slice.call(e)).push(a(e,o)),t.apply(this,e)})):n[Symbol.replace].call(this,e,t)},_wrapRegExp.apply(this,arguments)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o,n,a,l,i=[],s=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(o=a.call(r)).done)&&(i.push(o.value),i.length!==t);s=!0);}catch(e){c=!0,n=e}finally{try{if(!s&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(c)throw n}}return i}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}document.addEventListener("DOMContentLoaded",function(){var e;e=function(){function r(e){var t=this,r=(this.parentContainer=null,this.matrixContainer=null,this.mainTable=null,this.id=null,function(e){var e=e.getAttribute("id");return e?(e=(null==(e=e.match(_wrapRegExp(/^wptb\x2Dtable\x2Did\x2D(\d+)$/,{id:1})))?void 0:e.groups).id,parseInt(e,10)):null});if(!e.classList.contains("wptb-table-container"))throw new Error("invalid table top level container");e=(t.parentContainer=e).querySelector(".wptb-table-container-matrix");if(!e)throw new Error("invalid matrix container");if(t.matrixContainer=e,!(e=t.matrixContainer.querySelector("table.wptb-preview-table")))throw new Error("invalid table element");t.mainTable=e,t.mainTable&&(t.id=r(t.matrixContainer))}var e=new function(){var t=[];this.getTableObjects=function(){return t},this.init=function(){Array.from(document.querySelectorAll(".wptb-table-container")).map(function(e){t.push(new r(e))})}};return e.init(),e},(self||global)["WptbFrontendBase"]=e()}),function(e,t,r){"undefined"!=typeof module&&"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?module.exports=r():t[e]=r()}("WPTB_ExtraStyles",self||global,function(){return new function(){function o(e){var t,r,o,n,a=e.dataset.wptbExtraStyles;a&&(a=atob(a),t=e.getAttribute("class").match(/wptb-element-main-table_setting-(?:startedid-)?(\d+)/),n="wptb-extra-styles-"+(t=_slicedToArray(t,2)[1]),(o=null==(r=l.baseDocument.querySelector("head"))?void 0:r.querySelector("#".concat(n)))||((o=document.createElement("style")).type="text/css",o.id=n,e.dataset.disableThemeStyles&&l.currentMode===l.modes.frontEnd||l.currentMode===l.modes.block?(e.insertAdjacentElement("beforebegin",o),l.currentMode===l.modes.frontEnd&&l.generalStyles&&s(l.generalStyles,e)):r.appendChild(o)),n=".wptb-element-main-table_setting-".concat(t),e=i(n,a),o.innerHTML="",o.appendChild(document.createTextNode(e)))}var l=this,n=(this.modes={builder:"builder",frontEnd:"frontEnd",block:"block"},this.baseDocument=document,this.currentMode=this.modes.builder,this.generalStyles="",_defineProperty(_defineProperty(_defineProperty({},this.modes.builder,".wptb-table-setup .wptb-preview-table"),this.modes.block,".wptb-block-table-setup .wptb-preview-table"),this.modes.frontEnd,".wptb-table-container .wptb-preview-table")),t=function(e){return e.replaceAll(/(\r?\n)|(\/\*.+?\*\/)|(\s*!important)/g,"").replaceAll(";"," !important;")},i=function(r,e){var e=t(e).split("}"),o=[];return e.map(function(e){var t=new RegExp(/(.+?)\{/g).exec(e);t&&(r===t[1].trim()?o.push(e):o.push(e.replace(t[1],"".concat(r," ").concat(t[1]))))}),"".concat(o.join("}"),"}")},s=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,r=document.createElement("style"),t=(r.type="text/css",r.id="wptb-general-styles",t?t.insertAdjacentElement("beforebegin",r):(l.currentMode===l.modes.block?l.baseDocument:l.baseDocument.querySelector("head")).appendChild(r),i(e.parentPrefix,e.styles));r.appendChild(document.createTextNode(t))};this.applyStyles=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:l.modes.frontEnd,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:document,r=(l.baseDocument=r,l.currentMode=e,l.generalStyles=t,Array.from(l.baseDocument.querySelectorAll(n[e])));r&&r.map(o),e!==l.modes.frontEnd&&e!==l.modes.block||!t||s(t)}}}),function(e,t,r){"undefined"!=typeof module&&"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?module.exports=r():t[e]=r()}("WPTB_Logger",self||global,function(){var t={normal:"#48BB78"};return{prepareMessage:function(e){return"%c WP Table Builder %c {message} ".replace("{message}",e)},prepareMessageStyle:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"normal",e=t[e]?e:"normal";return"background-color: {bgColor} ; padding: 3px; color: #FFF; border-radius: 0 5px 5px 0;".replace("{bgColor}",t[e])},log:function(e){console.log(this.prepareMessage(e),"border-radius:5px 0 0 5px; background-color: #3299D1; padding: 3px; color: #FFF; font-weight: bold;",this.prepareMessageStyle("normal"))}}});var WPTB_CutGlueTable={cutTableHorizontally:function(e,t){if(t&&t.rows[e])for(var r=0;r<e;r++)for(var o=t.rows[r].children,n=0;n<o.length;n++)if(1<o[n].rowSpan&&o[n].rowSpan>e-r){for(var a=o[n].rowSpan-e+r,l=(o[n].rowSpan=e-r,o[n].dataset.sameCellBeforeDivision||(o[n].dataset.sameCellBeforeDivision="r"+r+"c"+n),void 0),l=t.hasOwnProperty("wptbCell")?(l=new t.wptbCell(t.mark)).getDOMElement():document.createElement("td"),i=o[n].getAttribute("style"),i=(l.setAttribute("style",i),l.colSpan=o[n].colSpan,l.rowSpan=a,l.dataset.sameCellBeforeDivision=o[n].dataset.sameCellBeforeDivision,o[n].dataset.xIndex),s=parseInt(i)+parseInt(o[n].colSpan),c=void 0;!c&&s<t.maxCols;)c=t.rows[e].querySelector('[data-x-index="'+s+'"]'),s++;t.rows[e].insertBefore(l,c),WPTB_RecalculateIndexes(t)}},glueTableHorizontally:function(e){if(e){for(var t=_toConsumableArray(e.getElementsByTagName("td")),r=0;r<t.length;r++)if(t[r].hasAttribute("data-same-cell-before-division"))for(var o=t[r].dataset.sameCellBeforeDivision,n=e.querySelectorAll('[data-same-cell-before-division="'+o+'"]'),a=0;a<n.length;a++)if(n[a]&&n[a+1]&&n[a].parentNode&&n[a+1].parentNode&&!n[a].parentNode.classList.contains("wptb-row-moving")&&!n[a+1].parentNode.classList.contains("wptb-row-moving")&&n[a+1].dataset.yIndex==parseInt(n[a].dataset.yIndex)+parseInt(n[a].rowSpan)){n[a].rowSpan+=n[a+1].rowSpan;for(var l=_toConsumableArray(n[a+1].children),i=0;i<l.length;i++)n[a].appendChild(l[i]);n[a+1].parentNode.removeChild(n[a+1])}WPTB_RecalculateIndexes(e)}},cutTableVertically:function(e,t){for(var r=0;r<t.rows.length;r++){if(e<t.maxCols&&0!=e&&!t.rows[r].querySelector('[data-x-index="'+e+'"]'))for(var o,n,a=t.rows[r].children,l=void 0,i=a.length,s=void 0,c=0;c<i;c++)if(1<a[c].colSpan&&parseInt(a[c].dataset.xIndex)<e&&parseInt(a[c].dataset.xIndex)+parseInt(a[c].colSpan)>e){l=t.hasOwnProperty("wptbCell")?(l=new t.wptbCell(t.mark)).getDOMElement():document.createElement("td"),o=a[c].rowSpan,n=a[c].colSpan,a[c].colSpan=e-a[c].dataset.xIndex,n=n-a[c].colSpan,a[c].dataset.sameCellBeforeDivision||(a[c].dataset.sameCellBeforeDivision="r"+r+"c"+c);var d=a[c].getAttribute("style"),d=(l.setAttribute("style",d),t.querySelector('[data-x-index="'+e+'"]')),d=(d&&(l.style.width=d.style.width),t.querySelector('[data-y-index="'+r+'"]'));d&&(l.style.height=d.style.height),s=a[c+1]||null,t.rows[r].insertBefore(l,s),l.colSpan=n,l.rowSpan=o,l.dataset.sameCellBeforeDivision=a[c].dataset.sameCellBeforeDivision,r+=o-1;break}WPTB_RecalculateIndexes(t)}},glueTableVertically:function(e){if(e){for(var t=_toConsumableArray(e.getElementsByTagName("td")),r=0;r<t.length;r++)if(t[r].hasAttribute("data-same-cell-before-division"))for(var o=t[r].dataset.sameCellBeforeDivision,n=_toConsumableArray(e.querySelectorAll('[data-same-cell-before-division="'+o+'"]')),a=null,l=0;l<n.length;l++)if(n[l]&&n[l+1]&&!n[l].classList.contains("wptb-column-moving")&&!n[l+1].classList.contains("wptb-column-moving")&&n[l+1].dataset.xIndex==parseInt(n[l].dataset.xIndex)+parseInt(n[l].colSpan)){n[a=null==a?l:a].colSpan+=n[l+1].colSpan;for(var i=_toConsumableArray(n[l+1].children),s=0;s<i.length;s++)n[a].appendChild(i[s]);n[l+1].parentNode.removeChild(n[l+1])}WPTB_RecalculateIndexes(e)}}},WPTB_GetDirectionAfterReconstruction=function(o,n,a,r,l){var i=0,s=o.maxCols,e={},c=[];return l&&l.getDirective(o)?e.switch=function(e){var t=l.getDirective(o),r="desktop";return e&&e.detail&&(r=e.detail.sizeRangeId),c=[n,1],"desktop"!==r?t.hasOwnProperty("modeOptions")&&(e=t.responsiveMode,(t=t.modeOptions[e]).hasOwnProperty("topRowAsHeader")&&t.topRowAsHeader.hasOwnProperty(r)&&t.topRowAsHeader[r]?t.hasOwnProperty("cellStackDirection")&&t.cellStackDirection.hasOwnProperty(r)&&("row"===t.cellStackDirection[r]?(c=[a,2],i=s-1):"column"===t.cellStackDirection[r]&&t.hasOwnProperty("cellsPerRow")&&(i=t.cellsPerRow[r])):i=0):i=0,{type:c,itemsPerHeader:i}}:e.switch=function(e){var t;return c=[n,1],o.classList.contains("wptb-mobile-view-active")?(o.classList.contains("wptb-table-preview-head")&&(c=[a,2])===r&&(i=s-1),t=o.parentNode.parentNode.querySelector(".wptb-preview-table-mobile"),{type:c,itemsPerHeader:i,newTable:t}):{type:c,itemsPerHeader:i}},e};function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,t,r){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=r():t[e]=r()}("WPTB_SortableTable",self||global,function(){return function(){var U=this.table=(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).table,a=(WPTB_RecalculateIndexes(U),this);function t(e,t,r){var o,n,a;"TD"===e.target.tagName&&(o=null==e.offsetX?e.layerX:e.offsetX,n=null==e.offsetY?e.layerY:e.offsetY,a=!1,a="vertical"===t&&e.target.clientWidth-o<=35||"horizontal"===t&&o<=35||a)&&(e.target.clientHeight-35)/2<n&&(e.target.clientHeight+35)/2>n?r.classList.add("sortable-hover"):r.classList.remove("sortable-hover")}function c(e){t(e,"vertical",this)}function d(e){t(e,"horizontal",this)}function u(){this.classList.remove("sortable-hover")}function r(e,t){if(e.target&&"TD"===e.target.tagName&&!U.parentNode.classList.contains("wptb-preview-table-manage-cells")){var r=e.currentTarget,o=!1;if("vertical"===t&&e.target.dataset.hasOwnProperty("sortedVertical")){var n=[],a=[];if(this.itemsPerHeader&&this.itemsPerHeader<r.rows.length){WPTB_RecalculateIndexes(r);for(var l=_toConsumableArray(r.rows),i=r.querySelector("tbody")?r.querySelector("tbody"):r,s=0;s<l.length;s++)s<e.target.dataset.yIndex?(n.push(l[s]),i.removeChild(l[s])):s>parseInt(e.target.dataset.yIndex,10)+this.itemsPerHeader&&(a.push(l[s]),i.removeChild(l[s]));WPTB_RecalculateIndexes(r)}var c,d,u=r.querySelectorAll('[data-x-index="'.concat(e.target.dataset.xIndex,'"]'));(u=_toConsumableArray(u)).map(function(e){c=(c=parseInt(e.rowSpan,10))||1,d=e.dataset.yIndex,WPTB_CutGlueTable.cutTableHorizontally(d,r),d+=c,WPTB_CutGlueTable.cutTableHorizontally(d,r)});for(var M,p=[],W=0,z=[],b=0;b<u.length;b++){var f=Q(e,r,u,b,W,"vertical");if(f&&f.hasOwnProperty("i"))u=f.tds,b=f.i;else{for(var y=(u=f?f.tds:u)[b],m=(m=parseInt(y.rowSpan,10))||1,W=parseInt(y.dataset.yIndex,10)+m,f=Z(y),h=[],g=0;g<m;g++)h.push(r.rows[parseInt(y.dataset.yIndex,10)+g]),z.push(parseInt(y.dataset.yIndex,10)+g);0<y.dataset.yIndex?p.push({rowsTd:h,value:f}):M=h}}var D=X(e,"sortedVertical");if(!D)return;if(p.length&&p.sort(function(e,t){return J(D,e,t)}),p.unshift({rowsTd:M}),p.length<r.rows.length)for(var N,w=0;w<r.rows.length;w++)-1<z.indexOf(w)||((N=[]).push(r.rows[w]),p.push({rowsTd:N}));var v,H,q,S=r.querySelector("tbody");S.innerHTML="",p.map(function(e){e.rowsTd.map(function(e){S.appendChild(e)})}),n.length&&(v=r.querySelector("tbody")?r.querySelector("tbody"):r)&&(H=v.querySelector("tr"),n.map(function(e){v.insertBefore(e,H)})),a.length&&(q=r.querySelector("tbody")?r.querySelector("tbody"):r,S)&&a.map(function(e){q.appendChild(e)}),WPTB_RecalculateIndexes(r),WPTB_CutGlueTable.glueTableHorizontally(r),o=!0}else if("horizontal"===t&&"0"===e.target.dataset.xIndex){var C,T,A=r.querySelectorAll('[data-y-index="'.concat(e.target.dataset.yIndex,'"]'));(A=_toConsumableArray(A)).map(function(e){C=(C=parseInt(e.colSpan,10))||1,T=e.dataset.xIndex,WPTB_CutGlueTable.cutTableVertically(T,r),T+=C,WPTB_CutGlueTable.cutTableVertically(T,r)});for(var F,x=[],V=0,_=0;_<A.length;_++){var E=Q(e,r,A,_,V,"horizontal");if(E&&E.hasOwnProperty("i"))A=E.tds,_=E.i;else{for(var k=(A=E?E.tds:A)[_],R=(R=parseInt(k.colSpan,10))||1,V=parseInt(k.dataset.xIndex,10)+R,E=Z(k),P=[],O=0;O<R;O++){var K=_toConsumableArray(r.querySelectorAll('[data-x-index="'.concat(parseInt(k.dataset.xIndex,10)+O,'"]')));P.push(K)}0<k.dataset.xIndex?x.push({columnsTd:P,value:E}):F=P}}var $=X(e,"sortedHorizontal");if(!$)return;if(x.length&&x.sort(function(e,t){return J($,e,t)}),x.unshift({columnsTd:F}),x.length<r.maxCols)for(var G=r.maxCols-x.length,I=0;I<G;I++){var Y=_toConsumableArray(r.querySelectorAll('[data-x-index="'.concat(parseInt(r.maxCols,10)-parseInt(G,10)+I,'"]')));x.push({columnsTd:[Y]})}for(var j=0;j<r.rows.length;j++)r.rows[j].innerHTML="";x.map(function(e){e.columnsTd.map(function(e){e.map(function(e){r.rows[e.dataset.yIndex].appendChild(e)})})}),WPTB_RecalculateIndexes(r),WPTB_CutGlueTable.glueTableVertically(r),o=!0}if(o){for(var L=_toConsumableArray(r.getElementsByTagName("td")),B=0;B<L.length;B++)L[B].hasAttribute("data-same-cell-before-division")&&L[B].removeAttribute("data-same-cell-before-division");r.hasOwnProperty("tableSM")&&(new(r.tableSM())).tableStateSet(),this.reassignElementsStyles("td"),this.reassignElementsStyles("tr")}}}function X(e,t){return!(!e.currentTarget||!e.currentTarget.classList.contains("wptb-preview-table")&&!e.currentTarget.classList.contains("wptb-preview-table-mobile"))&&(e.target.dataset[t]&&"ask"!==e.target.dataset[t]?e.target.dataset[t]="ask":e.target.dataset[t]="desk",e.target.dataset[t])}function J(e,t,r){var o=0<arguments.length&&void 0!==e?e:"ask",n=(1<arguments.length?t:void 0).value,a=(2<arguments.length?r:void 0).value;return parseInt(n)&&parseInt(a)&&(n=parseInt(n),a=parseInt(a)),"ask"===o?n<a?-1:n===a?0:1:n<a?1:n===a?0:-1}function Z(e){for(var t=e.querySelectorAll(".wptb-text-container"),t=_toConsumableArray(t),r="",o=0;o<t.length;o++)r+=t[o].innerText,o!==t.length-1&&(r+=" ");return r}function Q(e,t,r,o,n,a){var l,i,s,c,d,u,p,b=r[o],f=!1;if("vertical"===a?(i="colSpan",s="data-y-index",c="yIndex",d="xIndex",u="rowSpan",p=t.rows.length):"horizontal"===a&&(i="rowSpan",s="data-x-index",c="xIndex",d="yIndex",u="colSpan",p=t.maxCols),0<b.dataset[c]-n)for(var y=t.querySelectorAll("[".concat(s,'="').concat(n,'"]')),m=0;m<y.length;m++)if(l=(l=y[m][i])||1,y[m].dataset[d]<e.target.dataset[d]&&parseInt(y[m].dataset[d],10)+parseInt(l,10)>e.target.dataset[d]){r.splice(o,0,y[m]),f=!0,o--;break}if(f)return{tds:r,i:o};a=(a=parseInt(b[u],10))||1;if(o==r.length-1&&parseInt(b.dataset[c],10)+a<p){y=t.querySelectorAll("[".concat(s,'="').concat(parseInt(b.dataset[c],10)+a,'"]'));for(var h=0;h<y.length;h++)if(l=(l=y[h][i])||1,y[h].dataset[d]<e.target.dataset[d]&&parseInt(y[h].dataset[d],10)+parseInt(l,10)>e.target.dataset[d]){r.push(y[h]),f=!0;break}}return!!f&&{tds:r}}return this.itemsPerHeader=0,this.tableMaxCols=U.maxCols,this.cellsStylesScheme={},this.rowsStylesScheme={},this.sortModeSwitcher=function(e,t){t&&(this.sortModeSwitcher("horizontal",!1),this.sortModeSwitcher("vertical",!1)),"vertical"===e?(this.table.removeEventListener("click",this.sortableTableVerticalStart,!1),t?(this.sortingCellMouseMoveSwitcher("vertical",!0),this.table.addEventListener("click",this.sortableTableVerticalStart,!1),this.table.dataset.wptbSortableTableVertical="1",this.createTableElementsStylesScheme("td"),this.createTableElementsStylesScheme("tr")):(this.sortingCellMouseMoveSwitcher("vertical",!1),delete this.table.dataset.wptbSortableTableVertical)):"horizontal"===e&&(this.table.removeEventListener("click",this.sortableTableHorizontalStart,!1),t?(this.sortingCellMouseMoveSwitcher("horizontal",!0),this.table.addEventListener("click",this.sortableTableHorizontalStart,!1),this.table.dataset.wptbSortableTableHorizontal="1",this.createTableElementsStylesScheme("td"),this.createTableElementsStylesScheme("tr")):(this.sortingCellMouseMoveSwitcher("horizontal",!1),delete this.table.dataset.wptbSortableTableHorizontal))},this.tableObjectChange=function(){var e=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];return this.table.classList.contains("wptb-mobile-view-active")&&e?this.table=U.parentNode.parentNode.querySelector(".wptb-preview-table-mobile"):this.table.classList.contains("wptb-preview-table-mobile")&&!e&&(this.table=U.parentNode.querySelector(".wptb-preview-table")),this.table},this.createTableElementsStylesScheme=function(e){this.tableObjectChange();var t=this.table.querySelectorAll(e);if(t.length)for(var r=0;r<t.length;r++){var o=t[r],n=window.getComputedStyle(o,null).getPropertyValue("background-color"),a="";"td"===e?(a=o.dataset.xIndex+"-"+o.dataset.yIndex,this.cellsStylesScheme[a]={backgroundColor:n}):"tr"===e&&(a=String(r),this.rowsStylesScheme[a]={backgroundColor:n})}this.tableObjectChange(!1)},this.reassignElementsStyles=function(e){this.tableObjectChange();var t,r=this.table.querySelectorAll(e);if("td"===e?t=this.cellsStylesScheme:"tr"===e&&(t=this.rowsStylesScheme),r.length)for(var o=0;o<r.length;o++){var n=r[o],a="";if("td"===e?a=n.dataset.xIndex+"-"+n.dataset.yIndex:"tr"===e&&(a=o),t.hasOwnProperty(a)){var l,i=t[a];for(l in i)n.style[l]=i[l]}}this.tableObjectChange(!1)},this.sortableTableInitialization=function(e){var t,r,o,n;this.table.dataset.wptbSortableTableVertical&&"1"===this.table.dataset.wptbSortableTableVertical?(t="vertical",r="horizontal"):this.table.dataset.wptbSortableTableHorizontal&&"1"===this.table.dataset.wptbSortableTableHorizontal&&(t="horizontal",r="vertical"),t&&"string"==typeof t&&r&&"string"==typeof r&&(o=WPTB_GetDirectionAfterReconstruction(this.table,t,r,"vertical",e),"object"===_typeof(o))&&o.hasOwnProperty("switch")&&((n=function(e){var t,e=o.switch(e);"object"===_typeof(e)&&(this.itemsPerHeader=e.itemsPerHeader,e.hasOwnProperty("newTable")?(t=this.table,this.table=e.newTable,this.sortModeSwitcher(e.type[0],!0),this.table=t):this.sortModeSwitcher(e.type[0],!0))}).call(a),this.table.addEventListener("table:rebuilt",function(e){n.call(a,e)},!1))},this.sortingCellMouseMoveSwitcher=function(e,t){var r=this;function o(e,t,r){e.removeEventListener("mousemove",t,!1),e.removeEventListener("mouseleave",u,!1),r&&(e.addEventListener("mousemove",t,!1),e.addEventListener("mouseleave",u,!1))}function n(e,t,r){r?e.dataset[t]&&"desk-disabled"===e.dataset[t]?e.dataset[t]="desk":e.dataset[t]="ask":"ask"===e.dataset[t]?e.dataset[t]="ask-disabled":"desk"===e.dataset[t]&&(e.dataset[t]="desk-disabled")}var a=this.table.querySelectorAll("td");if(a.length&&(a=_toConsumableArray(a)).map(function(e){o(e,c,!1),n(e,"sortedVertical",!1),o(e,d,!1),n(e,"sortedHorizontal",!1)}),t)if("vertical"===e)for(var l=this.table.rows.length,i=0;0<l;){var s=this.table.querySelectorAll('[data-y-index="'.concat(i,'"]'));(s=_toConsumableArray(s)).map(function(e){o(e,c,t),n(e,"sortedVertical",t)}),this.itemsPerHeader?(l-=this.itemsPerHeader+1,i+=this.itemsPerHeader+1):l=0}else"horizontal"===e&&(a=this.table.querySelectorAll('[data-x-index="0"]'),(a=_toConsumableArray(a)).map(function(e){2<r.table.querySelectorAll('[data-y-index="'.concat(e.dataset.yIndex,'"]')).length&&(o(e,d,t),n(e,"sortedHorizontal",t))}))},this.sortableTableVerticalStart=function(e){r.call(a,e,"vertical")},this.sortableTableHorizontalStart=function(e){r.call(a,e,"horizontal")},this}});var WPTB_RecalculateIndexes=function(e){for(var t,r=e.getElementsByTagName("tr"),o=0,n=0,a=[],l=0;l<r.length;l++){t=r[l].getElementsByTagName("td"),null==a[l]&&(a[l]=[]);for(var i=0,s=0;s<t.length;s++){if(null!=a[l][s])for(var c=0;c<100;c++){if(null==a[l][i]){a[l][i]=t[s],t[s].dataset.xIndex=i;break}i++}else a[l][s]=t[s],t[s].dataset.xIndex=i;if(t[s].dataset.yIndex=l,1<t[s].colSpan)for(var d=1;d<t[s].colSpan;d++)a[l][++i]="tdDummy";if(1<t[s].rowSpan)for(var u=1;u<t[s].rowSpan;u++){null==a[l+u]&&(a[l+u]=[]);for(var p=0;p<t[s].colSpan;p++)a[l+u][i-t[s].colSpan+1+p]="tdDummy"}i++}t.length>o&&(o=t.length),0==l&&(n=i)}e.columns=o,e.maxCols=n};function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o,n,a,l,i=[],s=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(o=a.call(r)).done)&&(i.push(o.value),i.length!==t);s=!0);}catch(e){c=!0,n=e}finally{try{if(!s&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(c)throw n}}return i}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function ownKeys(t,e){var r,o=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,r)),o}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(t,e){var r,o=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,r)),o}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function ownKeys(t,e){var r,o=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,r)),o}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,t,r){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=r():t[e]=r()}("WPTB_ResponsiveFrontend",self||global,function(){function s(e,t){var r=1<arguments.length&&void 0!==t?t:"log";if("undefined"!=typeof process&&"development"===process.env.NODE_ENV){if(!console[r])throw new Error("no logging type found with given type value of [".concat(r,"]"));console[r]("[WPTB]: ".concat(e))}}function R(e){var c=this,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return this.element=e,this.referenceObject=t,this.mergedRenderStatus=!0,this.mergedCells={row:[],column:[]},this.getMergedRenderStatus=function(){return c.mergedRenderStatus},this.setMergedRenderStatus=function(e){c.mergedRenderStatus=e},this.addToMergedCells=function(e,t){c.mergedCells[e].push(t)},this.isReference=function(){return null!==c.referenceObject},this.isReference()&&(this.element=e.cloneNode(!0)),this.modifications={},this.spans={row:1,col:1},this.remainingSpans={row:0,col:0},this.cacheSpanValues=function(){Object.keys(c.spans).map(function(e){var t;Object.prototype.hasOwnProperty.call(c.spans,e)&&(t=c.spans[e],c.spans[e]=c.element.getAttribute("".concat(e,"Span"))||t)})},this.cacheSpanValues(),this.getSpan=function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1]?c.getElement().getAttribute("".concat(e,"Span")):c.spans[e];if(t)return t;throw new Error("no span value found with the given type of [".concat(e,"]"))},this.getRemainingSpans=function(e){return c.remainingSpans[e]},this.setRemainingSpans=function(e,t){c.remainingSpans[e]=t},this.getElement=function(){return c.element},this.createCellElement=function(){return document.createElement("td")},e||(this.element=this.createCellElement()),this.setAttribute=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]&&arguments[2],o=3<arguments.length&&void 0!==arguments[3]?arguments[3]:",",n=c.getElement()[e],a=("function"!=typeof n&&"object"!==_typeof(n)||(n=c.getElement().getAttribute(e)),n=c.modifications[e]?c.modifications[e].default:n);r?a+="".concat(a).concat(o).concat(t):a=t,c.modifications[e]={value:a,default:n},c.getElement()[e]=a},this.setSpan=function(e,t){if(c.isReference()){if(!c.getMergedRenderStatus())return!1;var r=c.referenceObject.getRemainingSpans(e);if(0===r)return!1;var o=r-t<0?r:t,n=r-o;if(c.referenceObject.setRemainingSpans(e,n),c.setAttribute("".concat(e,"Span"),o),0!=n)for(var n=c.referenceObject.mergedCells[e].length-r+1,a=n+o-1,l=n;l<a;l+=1)c.mergedCells[e][l].setMergedRenderStatus(!1)}else{var i=c.getSpan(e)-t<0?c.getSpan(e):t;c.setAttribute("".concat(e,"Span"),i),c.setRemainingSpans(e,c.getSpan(e)-i);for(var s=0;s<i-1;s+=1)c.mergedCells[e]&&c.mergedCells[e][s]&&c.mergedCells[e][s].setMergedRenderStatus(!1)}return!0},this.resetAttribute=function(e){c.modifications[e]&&(c.getElement()[e]=c.modifications[e].default,c.modifications[e]=void 0)},this.resetAllAttributes=function(){Object.keys(c.modifications).map(function(e){Object.prototype.hasOwnProperty.call(c.modifications,e)&&c.resetAttribute(e)})},{getElement:this.getElement,el:this.element,setAttribute:this.setAttribute,resetAllAttributes:this.resetAllAttributes,getSpan:this.getSpan,setSpan:this.setSpan,getRemainingSpans:this.getRemainingSpans,setRemainingSpans:this.setRemainingSpans,isReference:this.isReference,addToMergedCells:this.addToMergedCells,mergedCells:this.mergedCells,setMergedRenderStatus:this.setMergedRenderStatus,getMergedRenderStatus:this.getMergedRenderStatus}}function t(e){var u=this;return this.tableElement=e,this.parsedTable=[],this.rowCache=[],this.originals={rows:[]},this.rowColors={header:null,even:null,odd:null},this.addToParsed=function(e,t,r){u.parsedTable[e]||(u.parsedTable[e]=[]),u.parsedTable[e][t]=r},this.parseTable=function(){var e=Array.from(u.tableElement.querySelectorAll("tr"));e.filter(function(e){return"true"!==e.dataset.wptbResponsiveIgnore}).map(function(e,c){u.originals.rows.push(e);var e=Array.from(e.querySelectorAll("td")),d=0;e.map(function(e,t){var r=new R(e),o=(u.addToParsed(c,d,r),d+=1,r.getSpan(R.spanTypes.row)),n=r.getSpan(R.spanTypes.column);if(1<o)for(var a=1;a<o;a+=1){var l=new R(e,r);r.addToMergedCells("row",l),u.addToParsed(c+a,t,l)}if(1<n)for(var i=1;i<n;i+=1){var s=new R(e,r);r.addToMergedCells("column",s),u.addToParsed(c,d,s),d+=1}})}),u.parseRowColors(e)},this.parseRowColors=function(e){(!e||e.length<=0)&&s("no rows are found to parse their colors","error");for(var t=u.tableElement.dataset.wptbHeaderBackgroundColor,r=u.tableElement.dataset.wptbEvenRowBackgroundColor,o=u.tableElement.dataset.wptbOddRowBackgroundColor,n=(u.rowColors.header=void 0!==t?t:""===e[0].style.backgroundColor?null:e[0].style.backgroundColor,1<=e.length/3?0:1===e.length?2:(e.length-1)%2),a=0;a<n;a+=1){var l=document.createElement("tr");u.tableElement.querySelector("tbody").appendChild(l),e.push(l)}u.rowColors.even=r||getComputedStyle(e[1]).backgroundColor,u.rowColors.odd=r?o:getComputedStyle(e[2]).backgroundColor;for(var i=0;i<n;i+=1)e[e.length-(i+1)].remove()},this.addRow=function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,o=(Array.isArray(e)||(e=[e]),u.tableElement.querySelector("tbody")),r=t?u.originals.rows[r]:((t=document.createRange()).setStart(o,0),t.createContextualFragment('<tr class="'.concat(e.join(" "),'"></tr>')).childNodes[0]);return o.appendChild(r),u.rowCache.push(r),{el:r,id:u.rowCache.length-1}},this.clearTable=function(){u.rowCache=[],u.tableElement.querySelector("tbody").innerHTML=""},this.getRow=function(e){return u.rowCache[e]||(s("no row with id [".concat(e,"] found in the cache."),"warn"),null)},this.maxRows=function(){return u.parsedTable.length},this.maxColumns=function(e){return e?u.parsedTable[0].length:u.parsedTable.reduce(function(e,t){return e=t.length>e?t.length:e},0)},this.getCell=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]&&arguments[2];try{if(u.parsedTable[e][t])return r?u.parsedTable[e][t]:u.parsedTable[e][t].el}catch(e){}return s("no cell found at the given address of [".concat(e,"-").concat(t,"]"),"warn"),null},this.getCellsAtRow=function(e){for(var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],r=[],o=0;o<u.maxColumns();o+=1){var n=u.getCell(e,o,t);n&&r.push(n)}return r},this.appendToRow=function(e,t,r){r=u.getRow(r),e=u.getCell(e,t,!0);return e&&r&&r.appendChild(e.getElement()),e},this.appendElementToRow=function(e,t){t=u.getRow(t);e&&t&&t.appendChild(e)},this.appendObjectToRow=function(e,t){t=u.getRow(t);e&&t&&t.appendChild(e.getElement())},this.getParsedTable=function(){return u.parsedTable},this.parseTable(),{maxRows:this.maxRows,maxColumns:this.maxColumns,addRow:this.addRow,clearTable:this.clearTable,getCell:this.getCell,appendToRow:this.appendToRow,appendElementToRow:this.appendElementToRow,appendObjectToRow:this.appendObjectToRow,getCellsAtRow:this.getCellsAtRow,el:this.tableElement,rowColors:this.rowColors,getParsedTable:this.getParsedTable}}var r={query:".wptb-preview-table",defaultClasses:["wptb-plugin-responsive-base"],bindToResize:!(R.spanTypes={row:"row",column:"col"})};return function(){function O(e){var t,r=!1;return e.style.backgroundColor&&(t=new RegExp(/^rgba\(\s?0\s?,\s?0\s?,\s?0\s?,\s?0\s?\)$/g),r=null!==e.style.backgroundColor.match(t)),r}function s(e,t){var r;e.dataset.wptbHorizontalScrollStatus&&(r=e.parentNode,t?(t=e.dataset.wptbTableContainerMaxWidth,r.style.width="".concat(t,"px")):r.style.width="")}function c(e){return!!e&&e.responsiveEnabled}function d(e,t){var r;return"desktop"!==(t=I.calculateRangeId(t,e.breakpoints))&&(r=e.responsiveMode,(e=e.modeOptions[r]).disabled)&&!e.disabled[t]}function o(e){var t=document.body.clientWidth,r=I.getDirective(e);if(r&&r.relativeWidth)switch(r.relativeWidth){case"window":t=document.body.clientWidth;break;case"container":t=e.parentNode.parentNode.parentNode.clientWidth;break;default:t=document.body.clientWidth}return t}var I=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.options=_objectSpread(_objectSpread({},r),e),this.elements=Array.from(document.querySelectorAll(this.options.query)),this.elementObjects=this.elements.map(function(e){return{el:e,tableObject:new t(e)}}),this.bindRebuildToResize=function(){window.addEventListener("resize",function(){I.rebuildTables()})},this.getDirective=function(e){e=e.dataset.wptbResponsiveDirectives;return e?JSON.parse(atob(e)):null},this.addDefaultClasses=function(e){e.classList.add(I.options.defaultClasses)},this.removeDefaultClasses=function(e){e.classList.remove(I.options.defaultClasses)},this.autoBuild=function(e,t,r,o){var n=r.cellStackDirection[t],a=r.topRowAsHeader[t],l=r.cellsPerRow[t],i=!!r.staticTopRow&&r.staticTopRow[t],r=(void 0===r.repeatMergedHeader||!0===r.repeatMergedHeader[t])&&!!a&&(!r.repeatMergedHeader||r.repeatMergedHeader[t]);o.clearTable(),"desktop"===t?(s(e,!0),I.buildDefault(o),I.removeDefaultClasses(e)):(s(e,!1),I.autoDirectionBuild(o,n,a,i,l,r),I.addDefaultClasses(e))},this.autoDirectionBuild=function(o,e){var t=2<arguments.length&&void 0!==arguments[2]&&arguments[2],r=3<arguments.length&&void 0!==arguments[3]&&arguments[3],n=4<arguments.length&&void 0!==arguments[4]?arguments[4]:1,a=!(5<arguments.length&&void 0!==arguments[5])||arguments[5],l=o.maxRows(),i=o.maxColumns(),s="row"===e;if(t)I.headerBuild(o,e,n,a);else if(s){var c=[],d=0;r&&(0<(t=o.getCellsAtRow(0,!0).filter(function(e){return!e.isReference()})).length&&(d+=1),t.map(function(e){var t,r=o.addRow("wptb-row");o.appendObjectToRow(e,r.id),e.el.style.backgroundColor&&!O(e.el)||(t=o.rowColors.header||getComputedStyle(r.el).backgroundColor,e.setAttribute("style","background-color: ".concat(t),!0,";")),r.el.style.backgroundColor="#ffffff00",e.setAttribute("colSpan",n)}));for(var u=d;u<l;u+=1)o.getCellsAtRow(u,!0).forEach(function(e){e.isReference()||c.push(e)});for(var p=c.length,b=0,f=0;b<p;b+=n,f+=1){for(var y=o.addRow("wptb-row"),m=0;m<n;m+=1){var h,g=c[b+m];g&&(o.appendElementToRow(g.getElement(),y.id),g.resetAllAttributes(),g.setAttribute("style","width: 100% !important",!0,";"),g.setAttribute("colSpan",1),g.setAttribute("rowSpan",1),g.el.style.backgroundColor&&!O(g.el)||(h=o.rowColors[(d+f)%2==0?"odd":"even"],g.el.style.backgroundColor=h||getComputedStyle(y.el).backgroundColor))}y.el.style.backgroundColor="#ffffff00"}}else{var w=[],v=0;r&&(0<(a=o.getCellsAtRow(0,!0).filter(function(e){return!e.isReference()})).length&&(v+=1),a.map(function(e){var t=o.addRow("wptb-row");o.appendObjectToRow(e,t.id),e.el.style.backgroundColor&&!O(e.el)||(e.el.style.backgroundColor=o.rowColors.header||getComputedStyle(t.el).backgroundColor),t.el.style.backgroundColor="#ffffff00",e.setAttribute("colSpan",n)}));for(var S=0;S<i;S+=1)for(var C=v;C<l;C+=1){var T=o.getCell(C,S,!0);T&&!T.isReference()&&w.push(T)}for(var A=w.length,x=0,_=0;x<A;x+=n,_+=1){for(var E=o.addRow("wptb-row"),k=0;k<n;k+=1){var R,P=w[x+k];P&&(o.appendElementToRow(P.getElement(),E.id),P.resetAllAttributes(),P.setAttribute("style","width: 100% !important",!0,";"),P.setAttribute("colSpan",1),P.setAttribute("rowSpan",1),P.el.style.backgroundColor&&!O(P.el)||(R=o.rowColors[(v+_)%2==0?"odd":"even"],P.el.style.backgroundColor=R||getComputedStyle(E.el).backgroundColor))}E.el.style.backgroundColor="#ffffff00"}}},this.headerBuild=function(r,e){var t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,o=!(3<arguments.length&&void 0!==arguments[3])||arguments[3],n=r.getCellsAtRow(0,!0).map(function(e){return e.resetAllAttributes(),e.el.style.backgroundColor&&!O(e.el)||e.setAttribute("style","background-color: ".concat(r.rowColors.header),!0,";"),e}),a="column"===e,l=r.maxRows(),i=r.maxColumns(),s="3px solid gray";if(a)for(var c=0===(c=Math.ceil((l-1)/t))?1:c,d=1,u=0;u<c;u+=1){!function(){var e=0<arguments.length&&void 0!==arguments[0]&&arguments[0],t=r.addRow("wptb-row");e&&(t.el.style.borderTop=s),n.map(function(e){e=e.el.cloneNode(!0);r.appendElementToRow(e,t.id),e.style.backgroundColor&&!O(e)||(e.style.backgroundColor="".concat(getComputedStyle(t.el).backgroundColor),e.style.backgroundColor&&(e.style.backgroundColor+=" !important"))}),t.el.style.backgroundColor="#ffffff00"}(0<u);for(var p=0;p<t&&!(l<=d);p+=1){var b=r.addRow("wptb-row");b.el.style.backgroundColor="#ffffff00";for(var f=0;f<i;f+=1){var y,m,h=r.getCell(d,f,!0);h&&(h.resetAllAttributes(),m=!0,y=h.getSpan(R.spanTypes.row),h.getSpan(R.spanTypes.column),1<y&&(y=Math.min(y,t-p),m=h.setSpan(R.spanTypes.row,y),h.setMergedRenderStatus(!0)),m)&&(h.el.style.backgroundColor&&!O(h.el)||h.setAttribute("style","background-color: ".concat(r.rowColors[p%2==0?"even":"odd"]),!0,";"),r.appendObjectToRow(h,b.id))}d+=1}}else for(var g=0===(g=Math.ceil((l-1)/t))?1:g,w=1,v=0;v<g;v+=1){for(var S=0;S<i;S+=1){var C,T=r.addRow("wptb-row");0<v&&0===S&&(T.el.style.borderTop=s),!o&&0!==v||(C=r.getCell(0,S,!0)).isReference()||((C=C.el.cloneNode(!0)).style.backgroundColor="".concat(r.rowColors.header," !important"),r.appendElementToRow(C,T.id),C.style.backgroundColor&&!O(C)||(C.style.backgroundColor="".concat(getComputedStyle(T.el).backgroundColor),C.style.backgroundColor&&(C.style.backgroundColor+=" !important")),o?C.setAttribute("rowSpan",C.getAttribute("colSpan")):C.setAttribute("rowSpan",i*g),C.setAttribute("colSpan",1)),T.el.style.backgroundColor="#ffffff00";for(var A=0;A<t&&!(l<=w+A);A+=1){var x,_,E,k=r.getCell(w+A,S,!0);k&&(k.resetAllAttributes(),x=!0,_=k.getSpan(R.spanTypes.row),E=k.getSpan(R.spanTypes.column),(1<_||1<E)&&(E=Math.min(_,t-A),x=k.setSpan(R.spanTypes.row,E),_=k.el.getAttribute("rowSpan"),E=k.el.getAttribute("colSpan"),k.setAttribute("rowSpan",E),k.setAttribute("colSpan",_),k.setMergedRenderStatus(!0)),x)&&(E=1===t?w%2==0?"even":"odd":(w+A+v)%2==0?"even":"odd",k.el.style.backgroundColor&&!O(k.el)||k.setAttribute("style","background-color: ".concat(r.rowColors[E]),!0,";"),r.appendObjectToRow(k,T.id))}}w+=t}},this.buildDefault=function(e){for(var t=e.maxRows(),r=e.maxColumns(),o=0;o<t;o+=1)for(var n=e.addRow("",!0,o).id,a=0;a<r;a+=1){var l=e.getCell(o,a,!0);l&&!l.isReference()&&(l.resetAllAttributes(),e.appendElementToRow(l.getElement(),n))}},this.calculateRangeId=function(t,r){var e=Object.keys(r).sort(function(e,t){return r[e].width-r[t].width}),o=e[0];return e.map(function(e){t>=r[e].width&&(o=e)}),o},this.rebuildTable=function(e,t,r){var o=I.getDirective(e);if(o&&c(o)){var n=o.responsiveMode,a=I["".concat(n,"Build")],l=(t=t||e.getBoundingClientRect().width,I.calculateRangeId(t,o.breakpoints));if(!a)throw new Error("No build mode named as [".concat(n,"] found."));var i=o.modeOptions[n],t=(d(o,t)?a.call(I,e,l,i,r):(r.clearTable(),I.buildDefault(r),I.removeDefaultClasses(e)),WPTB_RecalculateIndexes(e),new CustomEvent("table:rebuilt",{detail:{sizeRangeId:l,topRowAsHeader:o.modeOptions[n].topRowAsHeader}}));e.dispatchEvent(t),a=l,(i=e)&&a&&(i.dataset.wptbBreakpoint=a)}},this.rebuildTables=function(r){I.elementObjects.map(function(e){var t=r;r||(t=o(e.el)),I.rebuildTable(e.el,t,e.tableObject)})},this.calculateRangeIdFromTable=function(e){var t=I.getDirective(e),e=o(e);return I.calculateRangeId(e,t.breakpoints)},this.isResponsiveEnabledForCurrentBreakpoint=function(e){var t=I.getDirective(e);return t&&c(t)&&d(t,o(e))},this.options.bindToResize&&this.bindRebuildToResize(),this.getTableElementObject=function(t){var e=I.elementObjects.filter(function(e){e=e.el.parentNode,e=new RegExp(/^wptb-table-id-(\d+)$/).exec(e.getAttribute("id"));return e&&e[1]&&Number.parseInt(e[1],10)===t});return _slicedToArray(e,1)[0]},this.markRowForResponsive=function(e,t){e.dataset.wptbResponsiveIgnore=JSON.stringify(t)},{rebuildTables:this.rebuildTables,rebuildTable:this.rebuildTable,getDirective:this.getDirective,calculateRangeId:this.calculateRangeId,calculateRangeIdFromTable:this.calculateRangeIdFromTable,isResponsiveEnabledForCurrentBreakpoint:this.isResponsiveEnabledForCurrentBreakpoint,getTableElementObject:this.getTableElementObject,markRowForResponsive:this.markRowForResponsive,calculateInnerSize:o,TableObject:t}}}),function(e,t,r){t[e]=r()}("WPTB_StylePass",self||global,function(){return new function(){var l=this;this.options={stylesheets:{}},this.insertShadowRoot=function(e,t){var r=t.parentNode,o=Array.from(r.children),n=o.indexOf(t),a=0<n-1?null:o[n-1],o=n+1>=o.length?null:o[n+1];l.prepareAllStylesheets(l.options.stylesheets,e.shadowRoot),l.borrowFromTheme(t),e.shadowRoot.appendChild(t),a?a.insertAdjacentElement("afterend",e):o?o.insertAdjacentElement("beforebegin",e):r.appendChild(e)},this.borrowFromTheme=function(e){var e=e.querySelector("table"),t=getComputedStyle(e).fontFamily;e.style.fontFamily=t},this.init=function(e){l.options=_objectSpread(_objectSpread({},l.options),e);e=Array.from(document.querySelectorAll("div .wptb-table-container"));0<e.length&&e.map(l.setupStylePass)},this.checkTableEligibility=function(e){e=e.querySelector("table");return!!e&&(l.options.settings.disableThemeStylesForAll||e.dataset.disableThemeStyles)},this.setupStylePass=function(e){var t,r,o;l.checkTableEligibility(e)&&((t=document.createElement("div")).classList.add("wptb-shadow-root-container"),r=(o=e.querySelector("table")).dataset.wptbTableContainerMaxWidth,o=o.dataset.wptbHorizontalScrollStatus,r&&!o&&(t.style.maxWidth="".concat(r,"px")),t.attachShadow({mode:"open"}),l.insertShadowRoot(t,e))},this.prepareAllStylesheets=function(r,o){Object.keys(r).map(function(t){if(Object.prototype.hasOwnProperty.call(r,t))switch(t){case"create":Object.keys(r[t]).map(function(e){Object.prototype.hasOwnProperty.call(r[t],e)&&l.prepareStylesheet(e,r[t][e],o)});break;case"copy":r[t].map(function(e){l.copyStylesheet(e,o)})}})},this.copyStylesheet=function(e,t){e=document.querySelector(e);e&&t.appendChild(e.cloneNode(!0))},this.prepareStylesheet=function(e,t,r){var o=document.createElement("link");o.setAttribute("id",e),o.setAttribute("href",t),o.setAttribute("rel","stylesheet"),o.setAttribute("media","all"),r.appendChild(o)}}}),function(e,t,r){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=r():t[e]=r()}("WPTB_LazyLoad",self||global,function(){function o(e){function t(e){var t=l(e);if(t){for(var r=arguments.length,o=new Array(1<r?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];t.apply(a,o)}}var a=this,r=_objectSpread(_objectSpread({},{name:"",speed:8,step:10,hooks:{},direction:"left",perspective:1e3,flashColor:"#FFFFFF"}),e),o="wptb-lazy-load-styles",l=(this.getOptions=function(){return _objectSpread({},r)},this.calculateDuration=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:.1,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;return Math.max(e,t)-Math.abs(t-e)/r.step*r.speed},this.calculateAnimationDirection=function(){var e=["X","Y"],t=0<arguments.length&&void 0!==arguments[0]&&arguments[0]?1:0;return["left","right"].includes(r.direction)?e[(0+t)%2]:e[(1+t)%2]},this.calculateDirectionConstant=function(){return(0<arguments.length&&void 0!==arguments[0]&&arguments[0]?-1:1)*(["left","up"].includes(a.getOptions().direction)?1:-1)},function(e){if(Object.prototype.hasOwnProperty.call(r.hooks,e)){e=r.hooks[e];if("function"==typeof e)return e}return null});this.getBufferElement=function(e){return e.parentNode.querySelector(".".concat("wptb-lazy-load-buffer-element"))},this.removeBufferElement=function(e){var t,e=a.getBufferElement(e);e&&((t=e.parentNode).removeChild(e),t.classList.remove("wptb-lazy-load-buffer-element-container"))},this.addStylesheet=function(e,t){var r=t.querySelector('style[id="'.concat(o,'"]')),t=(r||((r=t.createElement("style")).id=o,r.type="text/css",t.head.appendChild(r)),document.createTextNode(e));r.innerHTML="",r.appendChild(t)},this.beforeAnimation=function(e){t("beforeAnimation",e)},this.animate=function(e){t("animate",e)},this.afterAnimation=function(e){t("afterAnimation",e),delete a}}function e(r){this.getAnimation=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return r[e]?new o(_objectSpread(_objectSpread({},r[e]),t)):new o({})}}var s={none:{hooks:{animate:function(e){this.removeBufferElement(e)}}},slideIn:{hooks:{beforeAnimation:function(e){e.parentNode.style.overflow="hidden",e.style.transform="translate".concat(this.calculateAnimationDirection(),"(").concat(100*this.calculateDirectionConstant(),"%)")},animate:function(e){this.removeBufferElement(e),e.style.transition="transform ".concat(this.calculateDuration(),"s ease-out"),e.style.transform="translate".concat(this.calculateAnimationDirection(),"(0)")}}},growSling:{hooks:{beforeAnimation:function(e){e.style.transform="scale(0.1)"},animate:function(e){this.removeBufferElement(e),e.style.transition="transform ".concat(this.calculateDuration(),"s cubic-bezier(0.68, -0.55, 0.27, 1.55)"),e.style.transform="scale(1)"}}},flash:{hooks:{beforeAnimation:function(e){var t=document.createElement("div"),t=(t.classList.add("wptb-flash-element"),e.parentNode.classList.add("wptb-lazy-load-buffer-element-container"),e.insertAdjacentElement("afterend",t),"@keyframes wptb-flash {0% {opacity:1;}100% {opacity: 0;}} .wptb-flash-element {position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; background-color: ".concat(this.getOptions().flashColor,"}.wptb-flash-animation {animation: wptb-flash ").concat(this.calculateDuration(),"s forwards ease-out}"));this.addStylesheet(t,e.ownerDocument)},animate:function(t){this.removeBufferElement(t);var r=t.parentNode.querySelector(".wptb-flash-element");r&&(t.parentNode.classList.add("wptb-lazy-load-buffer-element-container"),r.addEventListener("animationend",function(e){"wptb-flash"===e.animationName&&(t.parentNode.classList.remove("wptb-lazy-load-buffer-element-container"),r.remove())}),r.classList.add("wptb-flash-animation"))}}},flip:{hooks:{beforeAnimation:function(e){var t=e.parentNode,t=(t.classList.add("wptb-lazy-load-card-container"),null!=(t=t.parentNode)&&t.classList.add("wptb-lazy-load-perspective-base"),e.classList.add("wptb-lazy-load-card-back","wptb-lazy-load-hidden-backface"),this.getBufferElement(e).classList.add("wptb-lazy-load-hidden-backface","wptb-lazy-load-card-front"),this.calculateAnimationDirection(!0)),r="".concat(180*this.calculateDirectionConstant(!0),"deg"),t=".wptb-lazy-load-perspective-base{perspective: ".concat(this.getOptions().perspective,"px;} .wptb-lazy-load-card-container{ transform-style: preserve-3d; transition: transform ").concat(this.calculateDuration(),"s ease-out; } .wptb-lazy-load-card-container[data-wptb-card-flip='true']{transform: rotate").concat(t,"(").concat(r,")} [data-wptb-card-flip='true'] .wptb-lazy-load-card-front svg{ animation: none !important; opacity: 0.2;} .wptb-lazy-load-card-back { transform: rotate").concat(t,"(").concat(r,")} .wptb-lazy-load-hidden-backface{backface-visibility: hidden;}");this.addStylesheet(t,e.ownerDocument)},animate:function(t){var r=this,o=t.parentNode;o.addEventListener("transitionend",function(e){"transform"===e.propertyName&&r.removeBufferElement(t),o.classList.remove("wptb-lazy-load-card-container","wptb-lazy-load-flip"),o.parentNode.classList.remove("wptb-lazy-load-perspective-base"),t.classList.remove("wptb-lazy-load-card-back","wptb-lazy-load-hidden-backface")}),o.dataset.wptbCardFlip="true"}}}};return new function(){function r(e,l){var t,i=2<arguments.length&&void 0!==arguments[2]&&arguments[2],s=3<arguments.length&&void 0!==arguments[3]&&arguments[3];e.filter(function(e){return"false"===e.dataset.wptbLazyLoadStatus}).map(function(e){var t,r,o,n,a;i&&(t=e,(o=document.createElement("div")).classList.add(d),o.style.backgroundColor=c.backgroundColor,c.iconSvg&&(o.innerHTML='<div class="wptb-lazy-load-buffer-icon-wrapper wptb-plugin-filter-box-shadow-md">'.concat(c.iconSvg,"</div>"),r=o.querySelector("svg"),(a=o.querySelector(".wptb-lazy-load-buffer-icon-wrapper")).style.width="".concat(c.iconSize,"px"),a.style.height="".concat(c.iconSize,"px"),a.dataset.wptbLazyLoadIconAnimation=c.iconAnimation,r)&&(r.style.fill=c.iconColor),t.insertAdjacentElement("afterend",o),t.parentNode.classList.add(u),p.beforeAnimation(t)),(!c.forceMode||s)&&(n=e,a=l,c.forceMode||b(n,a))&&(n.dataset.wptbLazyLoadStatus="true",n.addEventListener("load",c.delay?function(){setTimeout(function(){f({target:n})},1e3*c.delay)}:f),n.src=n.dataset.wptbLazyLoadTarget)}),t=window.scrollY,a.lastYPosition=t}function o(){return window.innerHeight}function t(){var e=Array.from(document.querySelectorAll(".wptb-preview-table")),t=Array.from(document.querySelectorAll(".wptb-shadow-root-container")).reduce(function(e,t){t=t.shadowRoot.querySelector(".wptb-preview-table");return t&&e.push(t),e},[]),e=[].concat(e,_toConsumableArray(t));l.push.apply(l,_toConsumableArray(e.reduce(function(e,t){t=Array.from(t.querySelectorAll(".wptb-lazy-load-img"));return e.push.apply(e,t),e},[]))),r(l,o(),!0),c.forceMode||window.addEventListener("scroll",function(){r(l,o())},{passive:!0})}var n={forceMode:!1},c={},a={lastYPosition:0},l=[],d="wptb-lazy-load-buffer-element",u="wptb-lazy-load-buffer-element-container",i=new e(s),p=null,b=function(e,t){var e=e.parentNode.getBoundingClientRect(),r=e.top,o=e.height,e=e.bottom,n=c.visibilityPercentage,r=0<=window.scrollY-a.lastYPosition?r+o*(n/100):e-o*(n/100);return 0<=r&&r<=t},f=function(e){e=e.target;p.animate(e),e.removeEventListener("load",f),p.afterAnimation(e)};this.forceLoadImages=function(){r(l,null,!1,!0)},this.init=function(e){e&&"object"===_typeof(e)&&(c=_objectSpread(_objectSpread({},n),e)).enabled&&(p=i.getAnimation(c.imageLoadAnimation,_objectSpread({speed:c.imageLoadAnimationSpeed,direction:c.imageLoadAnimationDirection,perspective:c.imageLoadAnimationPerspective},c)),t())}}}),function(e,t,r){t[e]=r()}("WPTB_ScrollManager",self||global,function(){return function(e){function t(e){var t=e.parentNode.parentNode,e=e.parentNode,r=(t.dataset.wptbHorizontalScrollStatus="true",t.style.maxWidth);t.style.maxWidth="",e.style.width=r}var r=e.frontendCalculationStatus;this.init=function(){var e=Array.from(document.querySelectorAll("table[data-wptb-horizontal-scroll-status=true]"));r&&e.map(t)}}}),document.addEventListener("DOMContentLoaded",function(){var F=document.getElementsByClassName("wptb-table-container");function e(){for(var e=0;e<F.length;e++){var t=F[e],r=!0,o=t.getElementsByClassName("wptb-preview-table"),n=t.getElementsByClassName("wptb-table-container-matrix");if(0<o.length&&0<n.length){o=o[0],n=n[0];if(o.style.display="table",o.dataset.wptbTableAlignment&&(a=o.dataset.wptbTableAlignment,t.offsetWidth<o.offsetWidth?o.style.float=null:o.style.float="center"==a?null:a,t.style.float="center"==a?null:a),1==o.dataset.reconstraction&&1==o.dataset.wptbAdaptiveTable){var a=t.offsetWidth,l=o.offsetWidth,i=void 0,s=o.rows;0<s.length&&(i=s[0].querySelectorAll("td").length);var s=!1,c=void 0;if((!o.classList.contains("wptb-table-preview-head")||2<i)&&1<i)if(a<l){if(t.style.overflow="unset",n&&!n.classList.contains("wptb-matrix-hide")&&(n.classList.add("wptb-matrix-hide"),s=!0),o.classList.add("wptb-mobile-view-active"),o.rows&&i){var d=Math.floor(a/(l/i));if(d<1&&(d=1),0<t.getElementsByClassName("wptb-preview-table-mobile").length&&((c=t.getElementsByClassName("wptb-preview-table-mobile")[0]).classList.remove("wptb-mobile-hide"),(l=c.dataset.wholeColumnsInContainer)==d&&o.classList.contains("wptb-table-preview-head")||l==d&&!o.classList.contains("wptb-table-preview-head")&&(480<a||1==c.column)?r=!1:c.parentNode.removeChild(c)),r){var l=document.createElement("table"),u=document.createElement("tbody"),r=(l.appendChild(u),l.classList.add("wptb-preview-table-mobile"),o.className.match(/wptb-element-main(.+)-(\d+)/i)),p=(r&&Array.isArray(r)&&l.classList.add(r[0]),o.rows.length),b=void 0,f=!1;if(o.classList.contains("wptb-table-preview-head")){var y=p-1,m=void 0;if(d<p)for(var h=0;h<y;h++){if(0==(b=y%(m=(m=d-1-h)<=0?1:m))){f=!0;break}if(0<m&&m<=6&&m-2*b<0&&b<m){f=!0;break}if(6<m&&m<=12&&m-1.8*b<0&&b<m){f=!0;break}if(12<m&&m<=18&&m-1.6*b<0&&b<m){f=!0;break}}else m=y,f=!(b=0);if(f)for(var M=void 0,M=0<m?i*Math.ceil(y/m):i,g=(Math.floor((M-1)/i),void 0),w=0;w<M;w++){var v=Math.floor(w/i),S=document.createElement("tr"),C=o.rows[0].children[w-v*i].cloneNode(!0),T=void 0,W=window.getComputedStyle(o.rows[0]);C.style.backgroundColor||(C.style.backgroundColor=W.backgroundColor),C.style.width=null,C.style.height=null,C.removeAttribute("data-wptb-css-td-auto-width"),(g=window.getComputedStyle(o.querySelector("td"))).borderTopColor?C.style.borderColor=g.borderTopColor:C.style.borderColor=g.borderBottomColor,0<v&&w%i==0&&(C.style.borderTopWidth="5px"),S.appendChild(C);for(var z,A=m*v+1;A<m*(v+1)+1;A++)A<o.rows.length?(T=o.rows[A].children[w-v*i].cloneNode(!0),z=window.getComputedStyle(o.rows[A]),T.style.backgroundColor||(T.style.backgroundColor=z.backgroundColor),T.style.width=null,T.style.height=null,T.removeAttribute("data-wptb-css-td-auto-width")):((T=document.createElement("td")).style.borderWidth="0px",T.style.background="#fff"),(g=window.getComputedStyle(o.querySelector("td"))).borderTopColor?T.style.borderColor=g.borderTopColor:T.style.borderColor=g.borderBottomColor,0<v&&w%i==0&&(T.style.borderTopWidth="5px"),S.appendChild(T);u.appendChild(S)}}else{var x=void 0;if(480<a)for(var _=0;_<i;_++){if(0==(b=i%(x=0==(x=d-_)?1:x))){f=!0;break}if(0<x&&x<=6&&x-2*b<=0&&b<x){f=!0;break}if(6<x&&x<=12&&x-1.8*b<=0&&b<x){f=!0;break}if(12<x&&x<=18&&x-1.6*b<=0&&b<x){f=!0;break}}else f=!(b=0),l.column=x=1;var D=Math.ceil(i/x),N=D*p;if(f)for(var E=0;E<N;E++){var k=Math.floor(E/p),R=document.createElement("tr"),H=void 0,P=void 0,H=k!=D-1||0==b?(P=k*x,x*(1+k)):(P=i-b,i),O=o.rows[E-k*p];R.classList=O.classList,R.style.backgroundColor=O.style.backgroundColor;for(var I=P;I<H;I++){var q,j=O.children[I].cloneNode(!0);j.style.backgroundColor||(q=window.getComputedStyle(O),j.style.backgroundColor=q.backgroundColor),j.style.width=null,j.style.height=null,j.removeAttribute("data-wptb-css-td-auto-width"),R.appendChild(j)}u.appendChild(R)}}l.dataset.wholeColumnsInContainer=d;var L=l.querySelectorAll("[srcset]");if(0<L.length)for(var B=0;B<L.length;B++)L[B].removeAttribute("srcset");t.appendChild(c=l),s=!0}}}else n&&n.classList.contains("wptb-matrix-hide")&&(n.classList.remove("wptb-matrix-hide"),s=!0,o.classList.remove("wptb-mobile-view-active"),(c=t.querySelector(".wptb-preview-table-mobile"))&&t.getElementsByClassName("wptb-preview-table-mobile")[0].classList.add("wptb-mobile-hide"),t.style.overflow="auto");else o.style.minWidth="auto";WPTB_RecalculateIndexes(o),s&&(WPTB_RecalculateIndexes(c),r=new CustomEvent("table:rebuilt",{detail:!0,bubbles:!0}),o.dispatchEvent(r))}}}}function t(){function e(){var t=v[S],r=(t.classList.add("wptb-table-container-".concat(S)),t.getElementsByClassName("wptb-preview-table"));if(0<r.length){!(r=r[0]).dataset.wptbTableContainerMaxWidth||r.dataset.wptbTableHorizontalScrollStatus||t.dataset.wptbHorizontalScrollStatus||(t.style.maxWidth="".concat(r.dataset.wptbTableContainerMaxWidth,"px")),r.classList.remove("wptb-table-preview-static-indic"),r.mergingСellsHorizontally=!1;for(var e=r.querySelectorAll("td"),o=0;o<e.length;o++)1<e[o].colSpan&&(r.mergingСellsHorizontally=!0);function n(){var e=t.offsetWidth;m<e?g?(r.style.minWidth="100%",r.mergingСellsHorizontally?(r.style.width="auto",a=(a=(e-h)/g)-f-y,w=!0):r.style.width="100%"):(r.style.width="auto",r.style.minWidth=null,r.style.maxWidth="".concat(m,"px")):(r.style.maxWidth=null,r.style.minWidth="".concat(r.dataset.wptbTableTdsSumMaxWidth,"px"),r.style.width="auto",a=r.dataset.wptbTdWidthAuto||"100",w=!0)}var a,l,i,s,c=t.offsetWidth,d=r.querySelector("td"),d=window.getComputedStyle(d,null),u=d.getPropertyValue("border-left-width"),p=d.getPropertyValue("border-right-width"),b=d.getPropertyValue("padding-left"),d=d.getPropertyValue("padding-left"),f=parseFloat(b,10)+parseFloat(d,10),y=parseFloat(u,10)+parseFloat(p,10),m=r.dataset.wptbTableTdsSumMaxWidth,h=r.dataset.wptbFixedWidthSize,g=r.dataset.wptbCellsWidthAutoCount,w=!1;c<=0?(l=function(e){var e=getComputedStyle(e),t=e.display,e=e.visibility;return"none"!==t||"visible"===e},(b=(i=function(e){var e=e.parentNode,t=l(e),r=e.nodeName.toLowerCase();return t||"body"===r?"body"===r?null:e:i(e)})(t))&&(s=new MutationObserver(function(e){try{e.map(function(e){var t=l(e.target),e=e.target.getBoundingClientRect().width;if(t&&0<e)throw n(),s.disconnect(),new Error("get out of iteration")})}catch(e){}})).observe(b,{attributes:!0,childList:!1,subtree:!1})):n();d=document.head;d&&(u=d.querySelector("style[data-wptb-td-auto-width-".concat(S,'="true"]')))&&d.removeChild(u),w&&((p=document.createElement("style")).setAttribute("data-wptb-td-auto-width-".concat(S),!0),p.innerHTML=".wptb-table-container-".concat(S," table td[data-wptb-css-td-auto-width=true]{width:").concat(a,"px}"),d)&&d.appendChild(p)}}for(var v=document.getElementsByClassName("wptb-table-container"),S=0;S<v.length;S++)e()}d=".wptb-preview-table .wptb-button",Array.from(document.querySelectorAll(d)).map(function(t){t.addEventListener("mouseenter",function(e){e=e.target;e.dataset.wptbElementHoverBgColor&&(e.style.backgroundColor=e.dataset.wptbElementHoverBgColor),e.dataset.wptbElementHoverTextColor&&(e.style.color=e.dataset.wptbElementHoverTextColor),e.dataset.wptbElementHoverScale&&(e.style.transform="scale(".concat(t.dataset.wptbElementHoverScale,")"))}),t.addEventListener("mouseleave",function(e){e=e.target;e.dataset.wptbElementHoverBgColor&&(e.style.backgroundColor=e.dataset.wptbElementBgColor),e.dataset.wptbElementHoverTextColor&&(e.style.color=e.dataset.wptbElementColor),e.dataset.wptbElementHoverScale&&(e.style.transform="scale(1)")})}),t(),e(),window.addEventListener("resize",function(){t(),e()});for(var r=document.getElementsByClassName("wptb-ph-element"),o=0;o<r.length;o++){var n,a,l=r[o];l.classList.contains("wptb-list-item-container")&&(l.classList.remove("wptb-list-item-container"),l.classList.add("wptb-list-container")),l.classList.contains("wptb-button-container")&&(a=l.className.match(/wptb-size-([A-Z]+)/i))&&Array.isArray(a)&&(n=(a=a[0]).toLowerCase(),l.classList.remove(a),a=l.querySelector(".wptb-button-wrapper"))&&a.classList.add(n)}var i=new WPTB_ResponsiveFrontend({query:".wptb-preview-table",bindToResize:!0});(self||global).wptbResponsiveFrontendInstance=i;for(var s=document.querySelectorAll(".wptb-preview-table"),c=0;c<s.length;c+=1)new WPTB_SortableTable({table:s[c]}).sortableTableInitialization(i);var d=new CustomEvent("responsive:front",{detail:{responsiveFront:i}});document.dispatchEvent(d),new WPTB_ScrollManager(WptbFrontendData.scrollManager).init(),WPTB_ExtraStyles.applyStyles(WPTB_ExtraStyles.modes.frontEnd,WptbFrontendData.generalStyles),i.rebuildTables(),WPTB_LazyLoad.init(WptbFrontendData.lazyLoad),WptbFrontendBase.getTableObjects().map(function(e){e=e.mainTable;Array.from(e.querySelectorAll(".wptb-text_icon_element-container")).map(function(e){e.setAttribute("contenteditable",!1)})}),WptbFrontendBase.getTableObjects().map(function(e){e=e.mainTable;Array.from(e.querySelectorAll(".wptb-badge-container")).map(function(e){e.setAttribute("contenteditable",!1)})}),WPTB_StylePass.init(WptbFrontendData.stylePass)});
|
||
//# sourceMappingURL=wp-table-builder-frontend.js.map
|
||
;
|
||
!function(){"use strict";var e,t={noop:function(){},texturize:function(e){return(e=(e=(e=(e+="").replace(/'/g,"’").replace(/'/g,"’")).replace(/"/g,"”").replace(/"/g,"”").replace(/"/g,"”").replace(/[\u201D]/g,"”")).replace(/([\w]+)=&#[\d]+;(.+?)&#[\d]+;/g,'$1="$2"')).trim()},applyReplacements:function(e,t){if(e)return t?e.replace(/{(\d+)}/g,(function(e,r){return void 0!==t[r]?t[r]:e})):e},getBackgroundImage:function(e){var t=document.createElement("canvas"),r=t.getContext&&t.getContext("2d");if(e){r.filter="blur(20px) ",r.drawImage(e,0,0);var o=t.toDataURL("image/png");return t=null,o}}},r=function(){function e(e,t){return Element.prototype.matches?e.matches(t):Element.prototype.msMatchesSelector?e.msMatchesSelector(t):void 0}function r(e,t,r,o){if(!e)return o();e.style.removeProperty("display"),e.style.opacity=t,e.style.pointerEvents="none";var a=function(i,n){var l=(performance.now()-i)/n;l<1?(e.style.opacity=t+(r-t)*l,requestAnimationFrame((()=>a(i,n)))):(e.style.opacity=r,e.style.removeProperty("pointer-events"),o())};requestAnimationFrame((function(){requestAnimationFrame((function(){a(performance.now(),200)}))}))}return{closest:function(t,r){if(t.closest)return t.closest(r);var o=t;do{if(e(o,r))return o;o=o.parentElement||o.parentNode}while(null!==o&&1===o.nodeType);return null},matches:e,hide:function(e){e&&(e.style.display="none")},show:function(e){e&&(e.style.display="block")},fadeIn:function(e,o){r(e,0,1,o=o||t.noop)},fadeOut:function(e,o){o=o||t.noop,r(e,1,0,(function(){e&&(e.style.display="none"),o()}))},scrollToElement:function(e,t,r){if(!e||!t)return r?r():void 0;var o=t.querySelector(".jp-carousel-info-extra");o&&(o.style.minHeight=window.innerHeight-64+"px");var a=!0,i=Date.now(),n=t.scrollTop,l=Math.max(0,e.offsetTop-Math.max(0,window.innerHeight-function(e){var t=e.querySelector(".jp-carousel-info-footer"),r=e.querySelector(".jp-carousel-info-extra"),o=e.querySelector(".jp-carousel-info-content-wrapper");if(t&&r&&o){var a=window.getComputedStyle(r),i=parseInt(a.paddingTop,10)+parseInt(a.paddingBottom,10);return i=isNaN(i)?0:i,o.offsetHeight+t.offsetHeight+i}return 0}(t)))-t.scrollTop;function s(){a=!1}l=Math.min(l,t.scrollHeight-window.innerHeight),t.addEventListener("wheel",s),function e(){var c,u=Date.now(),d=(c=(u-i)/300)<.5?2*c*c:1-Math.pow(-2*c+2,2)/2,p=(d=d>1?1:d)*l;if(t.scrollTop=n+p,u<=i+300&&a)return requestAnimationFrame(e);r&&r(),o&&(o.style.minHeight=""),a=!1,t.removeEventListener("wheel",s)}()},getJSONAttribute:function(e,t){if(e&&e.hasAttribute(t))try{return JSON.parse(e.getAttribute(t))}catch{return}},convertToPlainText:function(e){var t=document.createElement("div");return t.textContent=e,t.innerHTML},stripHTML:function(e){return e.replace(/<[^>]*>?/gm,"")},emitEvent:function(e,t,r){var o;try{o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r||null})}catch{(o=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,r||null)}e.dispatchEvent(o)},isTouch:function(){return"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch}}}();function o(){var o,a,i,n,l="",s=!1,c="div.gallery, div.tiled-gallery, ul.wp-block-gallery, ul.blocks-gallery-grid, figure.wp-block-gallery.has-nested-images, div.wp-block-jetpack-tiled-gallery, a.single-image-gallery",u=".gallery-item, .tiled-gallery-item, .blocks-gallery-item, .tiled-gallery__item",d=u+", .wp-block-image",p={},m="undefined"!=typeof wpcom&&wpcom.carousel&&wpcom.carousel.stat?wpcom.carousel.stat:t.noop,g="undefined"!=typeof wpcom&&wpcom.carousel&&wpcom.carousel.pageview?wpcom.carousel.pageview:t.noop;function h(t){if(!s)switch(t.which){case 38:t.preventDefault(),p.overlay.scrollTop-=100;break;case 40:t.preventDefault(),p.overlay.scrollTop+=100;break;case 39:t.preventDefault(),e.slideNext();break;case 37:case 8:t.preventDefault(),e.slidePrev();break;case 27:t.preventDefault(),L()}}function f(){s=!0}function v(){s=!1}function y(e){e.role="button",e.tabIndex=0,e.ariaLabel=jetpackCarouselStrings.image_label}function w(){p.overlay||(p.overlay=document.querySelector(".jp-carousel-overlay"),p.container=p.overlay.querySelector(".jp-carousel-wrap"),p.gallery=p.container.querySelector(".jp-carousel"),p.info=p.overlay.querySelector(".jp-carousel-info"),p.caption=p.info.querySelector(".jp-carousel-caption"),p.commentField=p.overlay.querySelector("#jp-carousel-comment-form-comment-field"),p.emailField=p.overlay.querySelector("#jp-carousel-comment-form-email-field"),p.authorField=p.overlay.querySelector("#jp-carousel-comment-form-author-field"),p.urlField=p.overlay.querySelector("#jp-carousel-comment-form-url-field"),window.innerWidth<=760&&Math.round(window.innerWidth/760*110)<40&&r.isTouch(),[p.commentField,p.emailField,p.authorField,p.urlField].forEach((function(e){e&&(e.addEventListener("focus",f),e.addEventListener("blur",v))})),p.overlay.addEventListener("click",(function(e){var t,o,a=e.target,i=!!r.closest(a,".jp-carousel-close-hint"),n=!!window.matchMedia("(max-device-width: 760px)").matches;a===p.overlay?n||L():i?L():a.classList.contains("jp-carousel-image-download")?m("download_original_click"):a.classList.contains("jp-carousel-comment-login")?(t=p.currentSlide,o=t?t.attrs.attachmentId:"0",window.location.href=jetpackCarouselStrings.login_url+"%23jp-carousel-"+o):r.closest(a,"#jp-carousel-comment-form-container")?function(e){var t=e.target,o=r.getJSONAttribute(p.container,"data-carousel-extra")||{},a=p.currentSlide.attrs.attachmentId,i=document.querySelector("#jp-carousel-comment-form-submit-and-info-wrapper"),n=document.querySelector("#jp-carousel-comment-form-spinner"),l=document.querySelector("#jp-carousel-comment-form-button-submit"),s=document.querySelector("#jp-carousel-comment-form");if(p.commentField&&p.commentField.getAttribute("id")===t.getAttribute("id"))f(),r.show(i);else if(r.matches(t,'input[type="submit"]')){e.preventDefault(),e.stopPropagation(),r.show(n),s.classList.add("jp-carousel-is-disabled");var c={action:"post_attachment_comment",nonce:jetpackCarouselStrings.nonce,blog_id:o.blog_id,id:a,comment:p.commentField.value};if(!c.comment.length)return void j(jetpackCarouselStrings.no_comment_text,!1);if(1!==Number(jetpackCarouselStrings.is_logged_in)&&(c.email=p.emailField.value,c.author=p.authorField.value,c.url=p.urlField.value,1===Number(jetpackCarouselStrings.require_name_email))){if(!c.email.length||!c.email.match("@"))return void j(jetpackCarouselStrings.no_comment_email,!1);if(!c.author.length)return void j(jetpackCarouselStrings.no_comment_author,!1)}var u=new XMLHttpRequest;u.open("POST",jetpackCarouselStrings.ajaxurl,!0),u.setRequestHeader("X-Requested-With","XMLHttpRequest"),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),u.onreadystatechange=function(){if(this.readyState===XMLHttpRequest.DONE&&this.status>=200&&this.status<300){var e;try{e=JSON.parse(this.response)}catch{return void j(jetpackCarouselStrings.comment_post_error,!1)}"approved"===e.comment_status?j(jetpackCarouselStrings.comment_approved,!0):"unapproved"===e.comment_status?j(jetpackCarouselStrings.comment_unapproved,!0):j(jetpackCarouselStrings.comment_post_error,!1),H(),A(a),l.value=jetpackCarouselStrings.post_comment,r.hide(n),s.classList.remove("jp-carousel-is-disabled")}else j(jetpackCarouselStrings.comment_post_error,!1)};var d=[];for(var m in c)if(m){var g=encodeURIComponent(m)+"="+encodeURIComponent(c[m]);d.push(g.replace(/%20/g,"+"))}var h=d.join("&");u.send(h)}}(e):(r.closest(a,".jp-carousel-photo-icons-container")||a.classList.contains("jp-carousel-photo-title"))&&function(e){e.preventDefault();var t=e.target,o=p.info.querySelector(".jp-carousel-info-extra"),a=p.info.querySelector(".jp-carousel-image-meta"),i=p.info.querySelector(".jp-carousel-comments-wrapper"),n=p.info.querySelector(".jp-carousel-icon-info"),l=p.info.querySelector(".jp-carousel-icon-comments");function s(){l&&l.classList.remove("jp-carousel-selected"),n.classList.toggle("jp-carousel-selected"),i&&i.classList.remove("jp-carousel-show"),a&&(a.classList.toggle("jp-carousel-show"),a.classList.contains("jp-carousel-show")?o.classList.add("jp-carousel-show"):o.classList.remove("jp-carousel-show"))}function c(){n&&n.classList.remove("jp-carousel-selected"),l.classList.toggle("jp-carousel-selected"),a&&a.classList.remove("jp-carousel-show"),i&&(i.classList.toggle("jp-carousel-show"),i.classList.contains("jp-carousel-show")?o.classList.add("jp-carousel-show"):o.classList.remove("jp-carousel-show"))}(r.closest(t,".jp-carousel-icon-info")||t.classList.contains("jp-carousel-photo-title"))&&(a&&a.classList.contains("jp-carousel-show")?r.scrollToElement(p.overlay,p.overlay,s):(s(),r.scrollToElement(p.info,p.overlay))),r.closest(t,".jp-carousel-icon-comments")&&(i&&i.classList.contains("jp-carousel-show")?r.scrollToElement(p.overlay,p.overlay,c):(c(),r.scrollToElement(p.info,p.overlay)))}(e)})),window.addEventListener("keydown",h),p.overlay.addEventListener("jp_carousel.afterOpen",(function(){v(),p.slides.length<=1||(p.slides.length<=5?r.show(p.info.querySelector(".jp-swiper-pagination")):r.show(p.info.querySelector(".jp-carousel-pagination")))})),p.overlay.addEventListener("jp_carousel.beforeClose",(function(){f(),document.documentElement.style.removeProperty("height"),e&&e.enable(),r.hide(p.info.querySelector(".jp-swiper-pagination")),r.hide(p.info.querySelector(".jp-carousel-pagination"))})),p.overlay.addEventListener("jp_carousel.afterClose",(function(){window.history.pushState?history.pushState("",document.title,window.location.pathname+window.location.search):window.location.href="",l="",p.isOpen=!1})),p.overlay.addEventListener("touchstart",(function(e){e.touches.length>1&&e.preventDefault()})))}function j(e,t){var o=p.overlay.querySelector("#jp-carousel-comment-post-results"),a="jp-carousel-comment-post-"+(t?"success":"error");o.innerHTML='<span class="'+a+'">'+e+"</span>",r.hide(p.overlay.querySelector("#jp-carousel-comment-form-spinner")),p.overlay.querySelector("#jp-carousel-comment-form").classList.remove("jp-carousel-is-disabled"),r.show(o)}function b(){var e=document.querySelectorAll("a img[data-attachment-id]");Array.prototype.forEach.call(e,(function(e){var t=e.parentElement,o=t.parentElement;if(!o.classList.contains("gallery-icon")&&!r.closest(o,u)&&t.hasAttribute("href")){var a=!1;t.getAttribute("href").split("?")[0]===e.getAttribute("data-orig-file").split("?")[0]&&1===Number(jetpackCarouselStrings.single_image_gallery_media_file)&&(a=!0),t.getAttribute("href")===e.getAttribute("data-permalink")&&(a=!0),a&&(y(e),t.classList.add("single-image-gallery"),t.setAttribute("data-carousel-extra",JSON.stringify({blog_id:Number(jetpackCarouselStrings.blog_id)})))}}))}function S(o){(!o||o<0||o>p.slides.length)&&(o=0),p.currentSlide=p.slides[o];var a,i,n=p.currentSlide,s=n.attrs.attachmentId;!function(e){var t=e.el,r=e.attrs,o=t.querySelector("img");if(!o.hasAttribute("data-loaded")){var a=!!r.previewImage,i=r.thumbSize;!a||i&&t.offsetWidth>i.width?o.src=r.src:o.src=r.previewImage,o.setAttribute("itemprop","image"),o.setAttribute("data-loaded",1)}}(p.slides[o]),1!==Number(jetpackCarouselStrings.display_background_image)||p.slides[o].backgroundImage||function(t){var r=t.el;e&&e.slides&&(r=e.slides[e.activeIndex]);var o=t.attrs.originalElement;o.complete&&0!==o.naturalHeight?E(t,r,o):o.onload=function(){E(t,r,o)}}(p.slides[o]),r.hide(p.caption),function(e){var t,o,a,i,n="",l="",s="";if(t=p.overlay.querySelector(".jp-carousel-photo-caption"),o=p.overlay.querySelector(".jp-carousel-caption"),a=p.overlay.querySelector(".jp-carousel-photo-title"),i=p.overlay.querySelector(".jp-carousel-photo-description"),r.hide(t),r.hide(o),r.hide(a),r.hide(i),n=q(e.caption)||"",l=q(e.title)||"",s=q(e.desc)||"",(n||l||s)&&(n&&(t.innerHTML=n,o.innerHTML=n,r.show(t),r.show(o)),r.stripHTML(n)===r.stripHTML(l)&&(l=""),r.stripHTML(n)===r.stripHTML(s)&&(s=""),r.stripHTML(l)===r.stripHTML(s)&&(s=""),s&&(i.innerHTML=s,r.show(i),l||n||(t.innerHTML=r.stripHTML(s),r.show(t))),l)){var c=r.stripHTML(l);a.innerHTML=c,n||(t.innerHTML=c,o.innerHTML=c,r.show(t)),r.show(a)}}({caption:n.attrs.caption,title:n.attrs.title,desc:n.attrs.desc}),function(e){if(!e||1!==Number(jetpackCarouselStrings.display_exif))return!1;var t=p.info.querySelector(".jp-carousel-image-meta ul.jp-carousel-image-exif"),r="";for(var o in e){var a=e[o],i=jetpackCarouselStrings.meta_data||[];if(0!==parseFloat(a)&&a.length&&-1!==i.indexOf(o)){switch(o){case"focal_length":a+="mm";break;case"shutter_speed":a=k(a);break;case"aperture":a="f/"+a}r+="<li><h5>"+jetpackCarouselStrings[o]+"</h5>"+a+"</li>"}}t.innerHTML=r,t.style.removeProperty("display")}(p.slides[o].attrs.imageMeta),function(e){if(!e)return!1;var r,o=[e.attrs.origWidth,e.attrs.origHeight],a=document.createElement("a");a.href=e.attrs.src.replace(/\?.+$/,""),r=null!==a.hostname.match(/^i[\d]{1}\.wp\.com$/i)?a.href:e.attrs.origFile.replace(/\?.+$/,"");var i=p.info.querySelector(".jp-carousel-download-text"),n=p.info.querySelector(".jp-carousel-image-download");i.innerHTML=t.applyReplacements(jetpackCarouselStrings.download_original,o),n.setAttribute("href",r),n.style.removeProperty("display")}(n),1===Number(jetpackCarouselStrings.display_comments)&&(a=p.slides[o].attrs.commentsOpened,i=p.container.querySelector(".jp-carousel-comment-form-container"),1===parseInt(a,10)?r.fadeIn(i):r.fadeOut(i),A(s),r.hide(p.info.querySelector("#jp-carousel-comment-post-results")));var c=p.info.querySelector(".jp-carousel-pagination");if(c&&p.slides.length>5){var u=o+1;c.innerHTML="<span>"+u+" / "+p.slides.length+"</span>"}jetpackCarouselStrings.stats&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?"+jetpackCarouselStrings.stats+"&post="+encodeURIComponent(s)+"&rand="+Math.random()),g(s),window.location.hash=l="#jp-carousel-"+s}function L(){document.body.style.overflow=a,document.documentElement.style.overflow=i,H(),f(),r.emitEvent(p.overlay,"jp_carousel.beforeClose"),window.scrollTo(window.scrollX||window.pageXOffset||0,n||0),e.destroy(),p.isOpen=!1,p.slides=[],p.currentSlide=void 0,p.gallery.innerHTML="",r.fadeOut(p.overlay,(function(){r.emitEvent(p.overlay,"jp_carousel.afterClose")}))}function x(e,t,r){var o,a=r?e.replace(/.*=([\d]+%2C[\d]+).*$/,"$1"):e.replace(/.*-([\d]+x[\d]+)\..+$/,"$1");return"9999"===(o=a!==e?r?a.split("%2C"):a.split("x"):[t,0])[0]&&(o[0]="0"),"9999"===o[1]&&(o[1]="0"),o}function k(e){return e>=1?Math.round(10*e)/10+"s":"1/"+Math.round(1/e)+"s"}function q(e){return!e.match(" ")&&e.match("_")?"":e}function A(e,t){var a=void 0===t,i=p.info.querySelector(".jp-carousel-icon-comments .jp-carousel-has-comments-indicator");if(i.classList.remove("jp-carousel-show"),clearInterval(o),e){(!t||t<1)&&(t=0);var n=p.info.querySelector(".jp-carousel-comments"),l=p.info.querySelector("#jp-carousel-comments-loading");r.show(l),a&&(r.hide(n),n.innerHTML="");var s=new XMLHttpRequest,c=jetpackCarouselStrings.ajaxurl+"?action=get_attachment_comments&nonce="+jetpackCarouselStrings.nonce+"&id="+e+"&offset="+t;s.open("GET",c),s.setRequestHeader("X-Requested-With","XMLHttpRequest");var u=function(){r.fadeIn(n),r.fadeOut(l)};s.onload=function(){if(p.currentSlide&&p.currentSlide.attrs.attachmentId===e){var c,d=s.status>=200&&s.status<300;try{c=JSON.parse(s.responseText)}catch{}if(!d||!c||!Array.isArray(c))return u();a&&(n.innerHTML="");for(var m=0;m<c.length;m++){var g=c[m],h=document.createElement("div");h.classList.add("jp-carousel-comment"),h.setAttribute("id","jp-carousel-comment-"+g.id),h.innerHTML='<div class="comment-gravatar">'+g.gravatar_markup+'</div><div class="comment-content"><div class="comment-author">'+g.author_markup+'</div><div class="comment-date">'+g.date_gmt+"</div>"+g.content+"</div>",n.appendChild(h),clearInterval(o),o=setInterval((function(){p.container.scrollTop+150>window.innerHeight&&(A(e,t+10),clearInterval(o))}),300)}c.length>0&&(r.show(n),i.innerText=c.length,i.classList.add("jp-carousel-show")),r.hide(l)}},s.onerror=u,s.send()}}function E(e,r,o){var a=t.getBackgroundImage(o);e.backgroundImage=a,r.style.backgroundImage="url("+a+")",r.style.backgroundSize="cover"}function H(){p.commentField&&(p.commentField.value="")}function T(e,o){p.slides=[];var a={width:window.innerWidth,height:window.innerHeight-64};0!==o&&null!==e[o].getAttribute("data-gallery-src")&&((new Image).src=e[o].getAttribute("data-gallery-src"));var i=!!r.closest(e[0],".tiled-gallery.type-rectangular");Array.prototype.forEach.call(e,(function(e,o){var n=r.closest(e,"a"),l=e.getAttribute("data-orig-file")||e.getAttribute("src-orig"),s=e.getAttribute("data-attachment-id")||e.getAttribute("data-id")||"0",c=document.querySelector('img[data-attachment-id="'+s+'"] + figcaption');c=c?c.innerHTML:e.getAttribute("data-image-caption");var u={originalElement:e,attachmentId:s,commentsOpened:e.getAttribute("data-comments-opened")||"0",imageMeta:r.getJSONAttribute(e,"data-image-meta")||{},title:e.getAttribute("data-image-title")||"",desc:e.getAttribute("data-image-description")||"",mediumFile:e.getAttribute("data-medium-file")||"",largeFile:e.getAttribute("data-large-file")||"",origFile:l||"",thumbSize:{width:e.naturalWidth,height:e.naturalHeight},caption:c||"",permalink:n&&n.getAttribute("href"),src:l||e.getAttribute("src")||""},d=r.closest(e,".tiled-gallery-item"),m=d&&d.querySelector(".tiled-gallery-caption"),g=m&&m.innerHTML;g&&(u.caption=g);var h=function(e){var t=e.getAttribute("data-orig-size")||"";if(t){var r=t.split(",");return{width:parseInt(r[0],10),height:parseInt(r[1],10)}}return{width:e.getAttribute("data-original-width")||e.getAttribute("width")||void 0,height:e.getAttribute("data-original-height")||e.getAttribute("height")||void 0}}(e);if(u.origWidth=h.width||u.thumbSize.width,u.origHeight=h.height||u.thumbSize.height,"undefined"!=typeof wpcom&&wpcom.carousel&&wpcom.carousel.generateImgSrc?u.src=wpcom.carousel.generateImgSrc(e,a):u.src=function(e){if("object"!=typeof e&&(e={}),void 0===e.origFile)return"";if(void 0===e.origWidth||void 0===e.maxWidth)return e.origFile;if(void 0===e.mediumFile||void 0===e.largeFile)return e.origFile;var t=document.createElement("a");t.href=e.largeFile;var r=/^i[0-2]\.wp\.com$/i.test(t.hostname),o=x(e.largeFile,e.origWidth,r),a=parseInt(o[0],10),i=parseInt(o[1],10);if(e.origMaxWidth=e.maxWidth,e.origMaxHeight=e.maxHeight,void 0!==window.devicePixelRatio&&window.devicePixelRatio>1&&(e.maxWidth=e.maxWidth*window.devicePixelRatio,e.maxHeight=e.maxHeight*window.devicePixelRatio),a>=e.maxWidth||i>=e.maxHeight)return e.largeFile;var n=x(e.mediumFile,e.origWidth,r),l=parseInt(n[0],10),s=parseInt(n[1],10);if(l>=e.maxWidth||s>=e.maxHeight)return e.mediumFile;if(r){var c=e.largeFile.lastIndexOf("?"),u=e.largeFile;return-1!==c&&(u=e.largeFile.substring(0,c),(e.origWidth>e.maxWidth||e.origHeight>e.maxHeight)&&(e.origMaxWidth=2*e.maxWidth,e.origMaxHeight=2*e.maxHeight,u+="?fit="+e.origMaxWidth+"%2C"+e.origMaxHeight)),u}return e.origFile}({origFile:u.src,origWidth:u.origWidth,origHeight:u.origHeight,maxWidth:a.width,maxHeight:a.height,mediumFile:u.mediumFile,largeFile:u.largeFile}),e.setAttribute("data-gallery-src",u.src),"0"!==u.attachmentId){u.title=t.texturize(u.title),u.desc=t.texturize(u.desc),u.caption=t.texturize(u.caption);var f=new Image;f.src=u.src;var v=document.createElement("div");v.classList.add("swiper-slide"),v.setAttribute("itemprop","associatedMedia"),v.setAttribute("itemscope",""),v.setAttribute("itemtype","https://schema.org/ImageObject");var y=document.createElement("div");y.classList.add("swiper-zoom-container"),p.gallery.appendChild(v),v.appendChild(y),y.appendChild(f),v.setAttribute("data-attachment-id",u.attachmentId),v.setAttribute("data-permalink",u.permalink),v.setAttribute("data-orig-file",u.origFile),i&&(u.previewImage=u.src);var w={el:v,attrs:u,index:o};p.slides.push(w)}}))}function _(e,t){if(!window.Swiper670){var o=document.querySelector("#jp-carousel-loading-overlay");r.show(o);var a=document.createElement("script");return a.id="jetpack-carousel-swiper-js",a.src=window.jetpackSwiperLibraryPath.url,a.async=!0,a.onload=function(){r.hide(o),C(e,t)},a.onerror=function(){r.hide(o)},void document.head.appendChild(a)}C(e,t)}function C(t,o){var l,s={imgSelector:".gallery-item [data-attachment-id], .tiled-gallery-item [data-attachment-id], img[data-attachment-id], img[data-id]",startIndex:0},c=r.getJSONAttribute(t,"data-carousel-extra");if(!c)return;const u=t.querySelectorAll(s.imgSelector);if(u.length&&(w(),!p.isOpen)){for(var d in p.isOpen=!0,a=getComputedStyle(document.body).overflow,document.body.style.overflow="hidden",i=getComputedStyle(document.documentElement).overflow,document.documentElement.style.overflow="hidden",n=window.scrollY||window.pageYOffset||0,p.container.setAttribute("data-carousel-extra",JSON.stringify(c)),m(["open","view_image"]),o||{})s[d]=o[d];-1===s.startIndex&&(s.startIndex=0),r.emitEvent(p.overlay,"jp_carousel.beforeOpen"),p.gallery.innerHTML="",p.overlay.style.opacity=1,p.overlay.style.display="block",T(u,s.startIndex),(e=new window.Swiper670(".jp-carousel-swiper-container",{centeredSlides:!0,zoom:!0,loop:p.slides.length>1,enabled:p.slides.length>1,pagination:{el:".jp-swiper-pagination",clickable:!0},navigation:{nextEl:".jp-swiper-button-next",prevEl:".jp-swiper-button-prev"},initialSlide:s.startIndex,on:{init:function(){S(s.startIndex)}},preventClicks:!1,preventClicksPropagation:!1,preventInteractionOnTransition:!r.isTouch(),threshold:5})).on("slideChange",(function(e){S(0===e.activeIndex?p.slides.length-1:e.activeIndex===p.slides.length+1?0:e.activeIndex-1),p.overlay.classList.remove("jp-carousel-hide-controls")})),e.on("zoomChange",(function(e,t){t>1&&p.overlay.classList.add("jp-carousel-hide-controls"),1===t&&p.overlay.classList.remove("jp-carousel-hide-controls")})),e.on("doubleTap",(function(e){if(clearTimeout(l),1===e.zoom.scale)var t=setTimeout((function(){p.overlay.classList.remove("jp-carousel-hide-controls"),clearTimeout(t)}),150)})),e.on("tap",(function(){e.zoom.scale>1&&(l=setTimeout((function(){p.overlay.classList.toggle("jp-carousel-hide-controls")}),150))})),r.fadeIn(p.overlay,(function(){r.emitEvent(p.overlay,"jp_carousel.afterOpen")}))}}function I(e){if("click"!==e.type){if("keydown"===e.type){const t=document.activeElement.parentElement,r=t&&t.classList.contains("tiled-gallery__item");" "!==e.key&&"Enter"!==e.key||!r||F(e)}}else F(e)}function M(e){var t=e.parentElement,o=t.parentElement,a=null;return o&&o.classList.contains("wp-block-image")?a=t.getAttribute("href"):t&&t.classList.contains("wp-block-image")&&t.querySelector(":scope > a")&&(a=t.querySelector(":scope > a").getAttribute("href")),!(a&&a.split("?")[0]!==e.getAttribute("data-orig-file").split("?")[0]&&a!==e.getAttribute("data-permalink")||t.classList.contains("gallery-caption")||r.matches(t,"figcaption"))}function F(e){if(window.CSS&&window.CSS.supports&&window.CSS.supports("display","grid")){var t,o=e.target,a=r.closest(o,c);if(a){if(!(t=a)||!t.getAttribute("data-carousel-extra"))return;if(!M(o))return;document.documentElement.style.height="auto",e.preventDefault(),e.stopPropagation();var i=r.closest(o,d),n=Array.prototype.indexOf.call(a.querySelectorAll(d),i);_(a,{startIndex:n})}}}document.body.addEventListener("click",I),document.body.addEventListener("keydown",I),document.querySelectorAll(u+"img").forEach((function(e){M(e)&&y(e)})),1===Number(jetpackCarouselStrings.single_image_gallery)&&(b(),document.body.addEventListener("is.post-load",(function(){b()}))),window.addEventListener("hashchange",(function(){var t=/jp-carousel-(\d+)/;if(window.location.hash&&t.test(window.location.hash)){if(window.location.hash!==l||!p.isOpen)if(window.location.hash&&p.gallery&&!p.isOpen&&history.back)history.back();else{l=window.location.hash;for(var r,o,a=window.location.hash.match(t),i=parseInt(a[1],10),n=document.querySelectorAll(c),s=0;s<n.length;s++){for(var u,d=n[s],m=d.querySelectorAll("img"),g=0;g<m.length;g++)if(parseInt(m[g].getAttribute("data-attachment-id"),10)===i||parseInt(m[g].getAttribute("data-id"),10)===i){u=g;break}if(void 0!==u){r=d,o=u,p.isOpen?(S(o),e.slideTo(o+1)):_(r,{startIndex:o});break}}}}else p.isOpen&&L()})),window.location.hash&&r.emitEvent(window,"hashchange")}"loading"!==document.readyState?o():document.addEventListener("DOMContentLoaded",o)}();;
|