/** * boxplusx: a versatile lightweight pop-up window engine * @author Levente Hunyadi * @version 1.0 * @remarks Copyright (C) 2009-2021 Levente Hunyadi * @remarks Licensed under GNU/GPLv3, see https://www.gnu.org/licenses/gpl-3.0.html * @see https://hunyadi.info.hu/projects/boxplusx **/ ;(function(){'use strict';function n(a){let b={};1<a.length&&a.substr(1).split("&").forEach(c=>{let d=c.indexOf("="),e=0<=d?c.substr(d+1):"";b[decodeURIComponent(0<=d?c.substr(0,d):c)]=decodeURIComponent(e)});return b}function p(a){let b=document.createElement("a");b.href=a;a=b.hash.indexOf("!");return{protocol:b.protocol,host:b.host,hostname:b.hostname,port:b.port,pathname:b.pathname,search:b.search,N:n(b.search),hash:b.hash,id:b.hash.substr(1,(0<=a?a:b.hash.length)-1),M:n(b.hash.substr(Math.max(0,a)))}} function aa(a){a=p(a);let b=p(location.href);return a.protocol===b.protocol&&a.host===b.host&&a.pathname===b.pathname&&a.search===b.search}function ba(){var a={rel:"0",controls:"1",O:"0"};return Object.keys(a).map(b=>encodeURIComponent(b)+"="+encodeURIComponent(a[b]||"")).join("&")};function ca(a){return 0<=["input","select","textarea"].indexOf(a.tagName.toLowerCase())};var ea=class{constructor(a,b){this.h=!1;this.j=this.i=0;this.g=b;a.addEventListener("mousedown",c=>{if(!ca(c.target)){var d=window.getComputedStyle(this.g);if(0<=da.indexOf(d.overflowX)||0<=da.indexOf(d.overflowY))this.i=c.clientX,this.j=c.clientY,this.h=!0,c.preventDefault()}});a.addEventListener("mouseup",()=>{this.h=!1});a.addEventListener("mouseout",()=>{this.h=!1});a.addEventListener("mousemove",c=>{this.h&&(this.g.scrollLeft-=c.clientX-this.i,this.g.scrollTop-=c.clientY-this.j,this.i=c.clientX, this.j=c.clientY)})}},da=["auto","scroll"];var fa=class extends Number{constructor(a,b){super(a/b);this.numerator=a;this.denominator=b}toString(){return`${this.numerator}/${this.denominator}`}};function ha(a){return/\.jpe?g$/i.test(a)?new Promise(b=>{let c=new XMLHttpRequest;c.open("get",a);c.responseType="blob";c.onload=()=>{b(ia(c.response))};c.onerror=()=>{b(-1)};c.send()}):Promise.resolve(-2)} function ia(a){return new Promise(b=>{let c=new FileReader;c.onload=()=>{var d=new DataView(c.result);if(65496!=d.getUint16(0))return b(-2);let e=d.byteLength,f=2;for(;f<e;){var h=d.getUint16(f);f+=2;if(65505==h){if(1165519206!=d.getUint32(f+=2))break;h=18761==d.getUint16(f+=6);f+=d.getUint32(f+4,h);let g=d.getUint16(f,h);f+=2;for(let l=0;l<g;l++)if(274==d.getUint16(f+12*l,h))return d=d.getUint16(f+12*l+8,h),b(d)}else if(65280!=(h&65280))break;else f+=d.getUint16(f)}return b(-1)};c.readAsArrayBuffer(a)})} function ja(a,b=!1){return new Promise(c=>{let d=a.src;if(/^file:/.test(d))return c({orientation:-1});let e=window.EXIF;b&&e?e.getData(a,()=>{let f=0,h={},g=Object.assign({},a.iptcdata,a.exifdata);if(0<Object.keys(g).length){Object.keys(g).forEach(k=>{var m=g[k];if("thumbnail"==k&&void 0!==m){if(m=m.blob,void 0!==m){let v=document.createElement("img");v.src=URL.createObjectURL(m);g[k]=v}}else void 0!==m&&void 0!==m.numerator&&void 0!==m.denominator&&(g[k]=new fa(m.numerator,m.denominator))});h=g; let l=g.Orientation;l&&(f=+l)}c({orientation:f,metadata:h})}):ha(d).then(f=>{c({orientation:f})})})};function na(a){w(a);0<a.duration&&(a.h=window.setTimeout(a.i,a.duration))}function w(a){a.h&&(window.clearTimeout(a.h),a.h=void 0)}var oa=class{constructor(a,b){this.active=!1;this.i=a;this.duration=b}get g(){return this.active}set g(a){this.active=a}start(){this.active=!0;na(this)}stop(){this.active=!1;w(this)}};var pa=class{constructor(a,b){this.h=this.g=0;this.actions=b;a.addEventListener("touchstart",c=>{this.g=c.changedTouches[0].pageX;this.actions.start&&this.actions.start()});a.addEventListener("touchend",c=>{let d=(new Date).getTime(),e=d-this.h;0<e&&500>e?c.preventDefault():(c=c.changedTouches[0].pageX,50<=c-this.g?this.actions.right():50<=this.g-c&&this.actions.left());this.h=d})}};function qa(a){return("0"+a.toString(16)).slice(-2)}function x(a,b){return b?b.uid==a.uid:!1}function ra(a,b){if(x(a,history.state))b!=a.h&&history.pushState({uid:a.uid,item:b},"");else{var c=new Uint8Array(16);window.crypto.getRandomValues(c);c=Array.from(c,qa).join("");a.uid=c;window.addEventListener("popstate",a.g);history.pushState({uid:a.uid,item:b},"")}} function sa(a){x(a,history.state)?(history.go(-1),window.setTimeout(()=>{sa(a)},0)):(a.uid=void 0,history.pushState(null,""),history.go(-1))}var ta=class{constructor(a){this.g=b=>{let c=void 0;x(this,b.state)&&(c=b.state.item);a(c)}}get h(){return history.state.item}};var z;const ua={id:void 0,slideshow:0,autostart:!1,loop:!1,preferredWidth:800,preferredHeight:600,useDevicePixelRatio:!0,navigation:"bottom",controls:"below",captions:"below",contextmenu:!0,metadata:!1,dir:"ltr",history:!1};function*va(a){var b=/\b(\S+)\s+([\d.]+x)\b/g;let c;for(;c=b.exec(a);)yield c}function wa(a,b){return parseInt(null!==a&&void 0!==a?a:"",10)||b}function xa(a){return"true"===a||!!parseInt(null!==a&&void 0!==a?a:"",10)} function ya(a){a=a||{};for(const b in JSON.parse(JSON.stringify(ua)))Object.prototype.hasOwnProperty.call(a,b)||(a[b]=ua[b]);return a}function C(a,b){a.classList.toggle("boxplusx-hidden",!b)}function D(a){return!a.classList.contains("boxplusx-hidden")}function E(a,b,c){let d=document.createElement("div");d.classList.add("boxplusx-"+a);C(d,!b);c&&d.append(...c);return d}function F(a){return a.map(b=>E(b))} function za(a){return a.map(b=>{var c="",d="";if(b instanceof HTMLAnchorElement){var e=b.dataset,f=e.title;void 0!==f?c=f:(f=b.querySelector("img"),null!==f&&(f=f.getAttribute("alt"),null!==f&&(c=f)));e=e.summary;void 0!==e?d=e:(e=b.getAttribute("title"),null!==e&&(d=e));c===d&&(d="")}let {title:h,description:g}={title:c,description:d};c="";let l;if(b instanceof HTMLAnchorElement){c=b.href;var k=b.dataset;l=k.poster;k=k.srcset}d=b.dataset.download;let m;b=b.getElementsByTagName("img");0<b.length&& (m=b[0]);return{url:c,image:m,poster:l,srcset:k,title:h,description:g,download:d}})}function I(a,b,c){for(const d of Object.getOwnPropertyNames(c)){const e=c[d];J(a,d,f=>{f.addEventListener(b,e,!1)})}}function K(a){L(a,-N(a,a.i),0)}function Aa(a){const b=O(a);L(a,0,b-(b- -N(a,a.i)))}function Ba(a){const b=O(a);L(a,b,b- -N(a,a.i))} function P(a,b){var c;const d=a.s[b];a.m=b;a.G&&ra(a.G,b);var e=window.getComputedStyle(a.h);const f=e.getPropertyValue("width"),h=e.getPropertyValue("height");w(a.slideshow);C(a.F,!0);let g=d.title,l=d.description;e=d.url;const k=p(e),m=k.pathname,v=Object.assign({},k.N,k.M);a.preferredWidth=wa(v.width,a.g.preferredWidth);a.preferredHeight=wa(v.height,a.g.preferredHeight);a.L=xa(v.fullscreen);if(aa(e))(e=k.id?k.id:null!==(c=v.target)&&void 0!==c?c:"")?(e=document.getElementById(e))?(Q(a,e.cloneNode(!0), g,l),R(a,5),S(a,2,f,h)):U(a):U(a);else if(/\.(gif|jpe?g|png|svg|webp)$/i.test(m)){let q=document.createElement("img");if(c=d.srcset)q.srcset=c;q.addEventListener("load",()=>{ja(q,a.g.metadata).then(r=>{let G=document.createDocumentFragment();var A=document.createElement("div");let T=document.createElement("div");0<r.orientation&&T.classList.add("boxplusx-orientation-"+r.orientation);var t=T.style;t.setProperty("background-image",'url("'+q.src+'")');if(q.srcset){var u=va(q.srcset);u=Array.from(u,H=> 'url("'+H[1]+'") '+H[2]).join();t.setProperty("background-image","-webkit-image-set("+u+")")}var y=a.g.useDevicePixelRatio?window.devicePixelRatio||1:1;u=Math.floor(q.naturalHeight/y);y=Math.floor(q.naturalWidth/y);!CSS.supports("image-orientation","from-image")&&5<=r.orientation&&8>=r.orientation?(a.preferredWidth=u,a.preferredHeight=y,t.setProperty("width",100*y/u+"%"),t.setProperty("height",100*u/y+"%")):(a.preferredWidth=y,a.preferredHeight=u,t.removeProperty("width"),t.removeProperty("height")); a.u||(t=A.style,t.setProperty("width",a.preferredWidth+"px"),t.setProperty("height",a.preferredHeight+"px"));A.appendChild(T);G.appendChild(A);if(void 0!==r.metadata){let H=r.metadata;r=E("detail",!0);let ka=document.createElement("table");A=Object.keys(H);A.sort();A.forEach(B=>{let M=H[B];if(void 0!==M){let la=document.createElement("tr"),ma=document.createElement("td");ma.innerText=B;B=document.createElement("td");M instanceof HTMLElement?B.append(M):B.innerText=M.toString();la.append(ma,B);ka.appendChild(la)}}); r.appendChild(ka);G.appendChild(r)}Q(a,G,g,l);a.C.style.setProperty("max-width",a.preferredWidth+"px");R(a,2);S(a,a.u?1:3,f,h)})},!1);q.addEventListener("error",()=>{U(a)},!1);q.src=e;b<a.s.length-1&&(e=a.s[b+1].url,b=p(e),/\.(gif|jpe?g|png|svg|webp)$/i.test(b.pathname)&&(document.createElement("img").src=e))}else if(/\.(mov|mpe?g|mp4|ogg|webm)$/i.test(m)){let q=document.createElement("video"),r=E("play"),G=E("video",!1,[q,r]);q.addEventListener("loadedmetadata",()=>{Q(a,G,g,l);R(a,3);a.preferredWidth= q.videoWidth;a.preferredHeight=q.videoHeight;S(a,1,f,h)},!1);q.addEventListener("error",()=>U(a),!1);q.src=e;if(e=d.poster)q.poster=e;r.addEventListener("click",function(){C(r,!1);q.controls=!0;q.play()})}else/\.pdf$/.test(m)?(b=document.createElement("embed"),b.src=e,b.type="application/pdf",Q(a,b,g,l),R(a,4),S(a,1,f,h)):(b=/^https?:\/\/(?:www\.)youtu(?:\.be|be\.com)\/(?:embed\/|watch\?v=|v\/|)([-_0-9A-Z]{11,})/i.exec(e),null!==b?Ca(a,"https://www.youtube.com/embed/"+b[1]+"?"+ba(),g,l):Ca(a,e,g, l))}function Da(a){if(1===a.D){let b=a.h.style;Ea(a,1E3,function(c){b.setProperty("max-width",c/10+"%")})}else if(3===a.D||2===a.D){let b=a.j.style;b.removeProperty("max-height");let c=Ea(a,window.innerHeight,function(d){b.setProperty("height",d+"px")});b.removeProperty("height");b.setProperty("max-height",Math.min(c,a.preferredHeight)+"px")}} function Fa(a){if(D(a.v)){for(var b=0;b<a.i.childNodes.length;++b)a.i.childNodes[b].classList.remove("boxplusx-current");var c=O(a),d=a.i.childNodes[a.m];d.classList.add("boxplusx-current");b=-N(a,a.i);const e=N(a,d);c=Math.min(c,e);b>c&&(b=c);d=Math.max(0,e-a.v.offsetWidth+d.offsetWidth);b<d&&(b=d);L(a,b,0)}} function V(a){C(a.B,(a.preferredWidth>a.o.clientWidth||a.preferredHeight>a.o.clientHeight)&&!Ga(a.H));a.B.classList.toggle("boxplusx-collapse",!a.u);a.B.classList.toggle("boxplusx-expand",a.u)} function W(a){let b=a.m,c=0==b,d=a.s,e=b>=d.length-1,f=a.g.loop&&!(c&&e),h=0<a.g.slideshow;J(a,"previous",g=>{C(g,f||!c)});J(a,"next",g=>{C(g,f||!e)});J(a,"start",g=>{C(g,h&&!a.slideshow.g&&!e)});J(a,"stop",g=>{C(g,h&&a.slideshow.g)});J(a,"download",g=>{C(g,void 0!==d[b].download)});J(a,"metadata",g=>{C(g,a.g.metadata&&!!a.h.querySelector(".boxplusx-detail"))})}function J(a,b,c){a.h.querySelectorAll(".boxplusx-"+b).forEach(d=>{c(d)})}function Ga(a){switch(a){case 1:case 2:return!1}return!0} function R(a,b){function c(e){switch(e){case 1:return"unavailable";case 2:return"image";case 3:return"video";case 4:return"embed";case 5:return"document";case 6:return"frame";case 0:return"none"}}let d=a.j.classList;d.remove("boxplusx-"+c(a.H));d.remove("boxplusx-interactive");a.H=b;d.add("boxplusx-"+c(b));Ga(b)&&d.add("boxplusx-interactive")}function X(a){a.h.classList.remove("boxplusx-animation");a=a.h.style;a.removeProperty("width");a.removeProperty("height")} function Y(a){for(var b=a.j;b.hasChildNodes();)b.removeChild(b.lastChild);b=a.h.style;let c=a.I.style,d=a.j.style;c.removeProperty("padding-top");c.removeProperty("width");d.removeProperty("width");b.removeProperty("max-width");d.removeProperty("max-height");a.K.innerHTML="";a.J.innerHTML=""} function S(a,b,c,d){a.D=b;var e=window.getComputedStyle(a.h);c=c||e.getPropertyValue("width");d=d||e.getPropertyValue("height");X(a);C(a.A,!0);var f=a.o.classList;f.remove("boxplusx-fixedaspect");f.remove("boxplusx-draggable");0===b||1===b?(b=a.I.style,a.L?b.setProperty("width","100vw"):b.setProperty("width",a.preferredWidth+"px"),b.setProperty("padding-top",100*a.preferredHeight/a.preferredWidth+"%"),f.add("boxplusx-fixedaspect")):3===b?f.add("boxplusx-draggable"):2===b&&(b=a.j.style,b.setProperty("width", a.preferredWidth+"px"),b.setProperty("max-height",a.preferredHeight+"px"));Da(a);b=e.getPropertyValue("width");f=e.getPropertyValue("height");const h=e.getPropertyValue("max-width");let g=a.h.style,l=()=>{if(D(a.l)){g.setProperty("max-width",h);X(a);C(a.F,!1);a.m>=a.s.length-1&&a.slideshow.stop();W(a);C(a.A,!0);Fa(a);V(a);var k=a.slideshow;k.active&&na(k)}};c!=b||d!=f?(C(a.A,!1),g.removeProperty("max-width"),g.setProperty("width",c),g.setProperty("height",d),a.h.classList.add("boxplusx-animation"), e=Math.max.apply(null,e.getPropertyValue("transition-duration").split(",").map(function(k){let m=parseFloat(k);return/\ds$/.test(k)?1E3*m:m})),window.setTimeout(l,e)):l();g.setProperty("width",b);g.setProperty("height",f)}function Ea(a,b,c){var d=0;let e=g=>{c(g);return a.h.offsetHeight};const f=a.l.clientHeight;var h=e(b);if(h<=f)return b;h=e(d);if(h>=f)return c(b),b;for(let g=1;10>g;++g){h=(d+b)/2|0;let l=e(h);l<f?(d=h,h=l):(b=h,h=l)}c(d);return d} function Q(a,b,c,d){Y(a);a.j.appendChild(b);a.C.style.removeProperty("max-width");a.K.innerHTML=c;a.J.innerHTML=d}function U(a){Y(a);R(a,1);S(a,1)}function Ca(a,b,c,d){let e=document.createElement("iframe");e.width=""+a.preferredWidth;e.height=""+a.preferredHeight;e.allow="fullscreen";e.src=b;Q(a,e,c,d);let f=!1;e.addEventListener("load",()=>{f||(f=!0,R(a,6),S(a,1))},!1)} function N(a,b){switch(a.g.dir){case "rtl":return b.offsetParent.offsetWidth-b.offsetWidth-b.offsetLeft;case "ltr":return b.offsetLeft}}function O(a){return Math.max(a.i.offsetWidth-a.v.offsetWidth,0)}function L(a,b,c){let d=a.i.style;d.setProperty("rtl"==a.g.dir?"right":"left",-b+"px");d.setProperty("transition-duration",0<c?5*c+"ms":"")} var Z=z=class{constructor(a){this.s=[];this.m=0;this.D=1;this.H=0;this.u=!0;this.L=!1;this.g=ya(a);this.I=E("aspect");this.j=E("content");this.B=E("expander");this.i=E("navbar");this.v=E("navigation",!1,[this.i].concat(F(["rewind","forward"])));this.o=E("viewport",!1,[this.I,this.j,this.B].concat(F(["previous","next"])));a=E("controls",!1,F("previous next close start stop download metadata".split(" ")));this.K=E("title");this.J=E("description");this.C=E("caption",!1,[this.K,this.J]);var b=E("wrapper", !1,[this.o,this.v]);b=E("wrapper",!1,[b,a]);this.A=E("wrapper",!0,[b,this.C]);this.F=E("progress",!0);this.h=E("dialog",!1,[this.A,this.F]);this.l=E("container",!0,[this.h]);this.g.id&&(this.l.id=this.g.id);this.C.classList.add("boxplusx-"+this.g.captions);a.classList.add("boxplusx-"+this.g.controls);this.v.classList.add("boxplusx-"+this.g.navigation);document.body.appendChild(this.l);this.preferredWidth=this.g.preferredWidth;this.preferredHeight=this.g.preferredHeight;this.l.addEventListener("click", d=>{d.target===this.l&&this.close()},!1);I(this,"click",{previous:()=>{this.previous()},next:()=>{this.next()},close:()=>{this.close()},start:()=>{this.start()},stop:()=>{this.stop()},metadata:()=>{this.metadata()},download:()=>{this.download()},rewind:()=>{K(this)},forward:()=>{K(this)}});I(this,"mouseover",{rewind:()=>{Aa(this)},forward:()=>{Ba(this)}});I(this,"mouseout",{rewind:()=>{K(this)},forward:()=>{K(this)}});this.g.contextmenu||this.h.addEventListener("contextmenu",d=>{d.preventDefault()}); this.l.dir=this.g.dir;new ea(this.o,this.j);this.slideshow=new oa(()=>{this.next()},this.g.slideshow);a=()=>{if(this.preferredWidth>this.o.clientWidth||this.preferredHeight>this.o.clientHeight)this.u=!this.u,P(this,this.m)};this.B.addEventListener("click",a);this.o.addEventListener("dblclick",a);this.j.addEventListener("mousewheel",d=>{var e="hidden"!=window.getComputedStyle(this.j).overflowY;let f=this.j.scrollHeight-this.j.clientHeight;if(e&&0<f){e=this.j.scrollTop;let h=d.deltaY;(e===f&&0<h||0=== e&&0>h)&&d.preventDefault()}});let c=new Map;c.set(27,()=>{this.close()});c.set(36,()=>{this.first()});c.set(35,()=>{this.last()});a=()=>{this.previous()};b=()=>{this.next()};switch(this.g.dir){case "ltr":c.set(37,a);c.set(39,b);break;case "rtl":c.set(39,a),c.set(37,b)}window.addEventListener("keydown",d=>{if(D(this.l)&&!ca(d.target)){var e=c.get(d.which||d.keyCode);e&&(e(),d.preventDefault())}},!1);new pa(this.o,{right:()=>{this.u&&this.previous()},left:()=>{this.u&&this.next()}});new pa(this.i, {start:()=>{K(this)},right:()=>{Aa(this)},left:()=>{Ba(this)}});window.addEventListener("resize",()=>{D(this.l)&&(Da(this),Fa(this),V(this))});this.g.history&&(this.G=new ta(d=>{void 0!==d?P(this,d):this.close()}))}bind(a){let b=za(Array.from(a)),c=d=>{this.open(b,d)};a.forEach((d,e)=>{d.addEventListener("click",f=>{f.preventDefault();c(e)},!1)});return c}open(a,b){this.s=a;const c=1<a.length&&"hidden"!=this.g.navigation;C(this.v,c);c&&a.forEach((d,e)=>{let f=E("aspect"),h=E("navimage"),g=E("navitem", !1,[f,h]),l=!0;g.addEventListener("touchstart",()=>{this.i.style.getPropertyValue("transition-duration")&&(l=!1)});g.addEventListener("click",()=>{l&&this.navigate(e);l=!0});let k=d.image;k&&(d=()=>{let m=f.style;k.naturalWidth&&k.naturalHeight&&(m.setProperty("width",k.naturalWidth+"px"),m.setProperty("padding-top",100*k.naturalHeight/k.naturalWidth+"%"));k.src&&h.style.setProperty("background-image",'url("'+k.src+'")')},k.src&&k.complete?d():(k.addEventListener("load",d),k.preloader&&k.preloader.load())); h.innerText=e+1+"";this.i.appendChild(g)});this.show(b)}show(a){this.g.autostart&&0<this.g.slideshow&&(this.slideshow.g=!0);C(this.l,!0);C(this.F,!0);P(this,a)}close(){this.slideshow.stop();this.m=0;if(this.G){var a=this.G;window.removeEventListener("popstate",a.g);sa(a)}this.u=!0;this.L=!1;V(this);X(this);Y(this);R(this,0);for(a=this.i;a.hasChildNodes();)a.removeChild(a.lastChild);C(this.A,!1);C(this.l,!1)}navigate(a){a!=this.m&&P(this,a)}first(){this.navigate(0)}previous(){const a=this.m;0<a?this.navigate(a- 1):this.g.loop&&this.last()}next(){const a=this.m;a<this.s.length-1?this.navigate(a+1):this.g.loop&&this.first()}last(){this.navigate(this.s.length-1)}start(){this.slideshow.start();0<this.g.slideshow&&W(this)}stop(){this.slideshow.stop();0<this.g.slideshow&&W(this)}metadata(){let a=this.h.querySelector(".boxplusx-detail");a&&C(a,!D(a))}download(){const a=this.s[this.m].download;if(void 0!==a){let b=document.createElement("a");b.href=a;document.body.appendChild(b);b.click();document.body.removeChild(b)}}static discover(a, b,c){b=null!==b&&void 0!==b?b:"boxplusx";let d=new z(c);const e=new Map;document.querySelectorAll("a[href][rel^="+b+"]:not([rel="+b+"])").forEach(f=>{let h=f.getAttribute("rel");if(h){var g=e.get(h);void 0===g&&(g=[],e.set(h,g));g.push(f)}});e.forEach(f=>{d.bind(f)});[].filter.call(document.querySelectorAll("a[href][rel="+b+"]"),f=>{d.bind([f])});a||[].filter.call(document.querySelectorAll("a[href]:not([rel^="+b+"])"),f=>/\.(gif|jpe?g|mov|mpe?g|ogg|png|svg|web[mp])$/i.test(f.pathname)&&!f.target).forEach(f=> {d.bind([f])})}};Z=z=function(a,b,c,d){var e=arguments.length,f=3>e?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,h;if("object"===typeof Reflect&&Reflect&&"function"===typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var g=a.length-1;0<=g;g--)if(h=a[g])f=(3>e?h(f):3<e?h(b,c,f):h(b,c))||f;return 3<e&&f&&Object.defineProperty(b,c,f),f}([function(){}],Z);window.BoxPlusXDialog=Z;}).call(this);