diff --git a/CHANGELOG.md b/CHANGELOG.md index dd554f2..c5c0170 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## CHANGELOG +### Version 4.9.3 *2020-01-16* + ++ this release only fixes a missing entry in `package.json` + ### Version 4.9.2 *2020-01-15* + **updated** events `jspanelclosed` and `jspanelcloseduser` diff --git a/README.md b/README.md index a2eb933..ce554e6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![license MIT](https://img.shields.io/badge/license-MIT-blue.svg) [![npm version](https://badge.fury.io/js/jspanel4.svg)](https://badge.fury.io/js/jspanel4) [![npm](https://img.shields.io/npm/dt/express.svg)](https://www.npmjs.com/package/jspanel4) [![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/jsPanel/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link) -## [jsPanel 4.9.2 released 2020-01-15](#) +## [jsPanel 4.9.3 released 2020-01-16](#) diff --git a/bower.json b/bower.json index 7aefee0..c35e60a 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "jspanel4x", - "version": "4.9.2", + "version": "4.9.3", "authors": [ "Stefan Straesser (http://jspanel.de/)" ], diff --git a/dist/jspanel.js b/dist/jspanel.js index c96a4f8..e666cdc 100644 --- a/dist/jspanel.js +++ b/dist/jspanel.js @@ -12,7 +12,7 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var jsPanel = { - version: '4.9.2', + version: '4.9.3', date: '2020-01-14 14:00', ajaxAlwaysCallbacks: [], autopositionSpacing: 4, diff --git a/dist/jspanel.min.js b/dist/jspanel.min.js index 94cfcfe..5293489 100644 --- a/dist/jspanel.min.js +++ b/dist/jspanel.min.js @@ -1 +1 @@ -"use strict";function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t',maximize:'',normalize:'',minimize:'',smallify:''},idCounter:0,isIE:navigator.appVersion.match(/Trident/),pointerdown:"onpointerdown"in window?["pointerdown"]:"ontouchend"in window?["touchstart","mousedown"]:["mousedown"],pointermove:"onpointermove"in window?["pointermove"]:"ontouchend"in window?["touchmove","mousemove"]:["mousemove"],pointerup:"onpointerup"in window?["pointerup"]:"ontouchend"in window?["touchend","mouseup"]:["mouseup"],polyfills:(Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var t=Object(e),n=1;n=0&&n.item(t)!==o;);}while(t<0&&(o=o.parentElement));return o}),function(){if("function"==typeof window.CustomEvent)return!1;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}e.prototype=window.Event.prototype,window.CustomEvent=e}(),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){return tthis.length)&&-1!==this.indexOf(e,t)}),Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},void(Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');var n=Object(this),o=n.length>>>0;if(0===o)return!1;for(var a,r,i=0|t,s=Math.max(i>=0?i:o-Math.abs(i),0);s1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;o=i(l,s,e+1/3),a=i(l,s,e),r=i(l,s,e-1/3)}return[Math.round(255*o),Math.round(255*a),Math.round(255*r)]},rgbToHsl:function(e,t,n){e/=255,t/=255,n/=255;var o,a,r=Math.max(e,t,n),i=Math.min(e,t,n),s=(r+i)/2;if(r===i)o=a=0;else{var l=r-i;switch(a=s>.5?l/(2-r-i):l/(r+i),r){case e:o=(t-n)/l+(t=0&&(h=this.applyPositionAutopos(e,h,t)),(t.offsetX||t.offsetY)&&(h=this.applyPositionOffset(e,h,t)),(t.minLeft||t.minTop||t.maxLeft||t.maxTop)&&(h=this.applyPositionMinMax(e,h,t)),t.modify&&(h=this.applyPositionModify(e,h,t)),e.style.opacity=1,e},applyPositionAutopos:function(e,t,n){var o="".concat(n.my,"-").concat(n.autoposition.toLowerCase());e.classList.add(o);var a=Array.prototype.slice.call(document.querySelectorAll(".".concat(o))),r=a.indexOf(e);if(a.length>1){switch(n.autoposition){case"down":case"up":a.forEach(function(e,n){n>0&&n<=r&&(t.top=parseFloat(t.top)+a[--n].getBoundingClientRect().height+jsPanel.autopositionSpacing+"px")});break;case"right":a.forEach(function(e,n){n>0&&n<=r&&(t.left=parseFloat(t.left)+a[--n].getBoundingClientRect().width+jsPanel.autopositionSpacing+"px")});break;case"left":a.forEach(function(e,n){n>0&&n<=r&&(t.left=parseFloat(t.left)-a[--n].getBoundingClientRect().width+jsPanel.autopositionSpacing+"px")})}e.style.left=t.left,e.style.top=t.top}return{left:t.left,top:t.top}},applyPositionOffset:function(e,t,n){["offsetX","offsetY"].forEach(function(e){n[e]?("function"==typeof n[e]&&(n[e]=n[e].call(t,t,n)),!1===isNaN(n[e])&&(n[e]="".concat(n[e],"px"))):n[e]="0px"}),e.style.left="calc(".concat(e.style.left," + ").concat(n.offsetX,")"),e.style.top="calc(".concat(e.style.top," + ").concat(n.offsetY,")");var o=getComputedStyle(e);return{left:o.left,top:o.top}},applyPositionMinMax:function(e,t,n){if(["minLeft","minTop","maxLeft","maxTop"].forEach(function(e){n[e]&&("function"==typeof n[e]&&(n[e]=n[e].call(t,t,n)),(Number.isInteger(n[e])||n[e].match(/^\d+$/))&&(n[e]="".concat(n[e],"px")))}),n.minLeft){e.style.left=n.minLeft;var o=getComputedStyle(e).left;parseFloat(o)parseFloat(t.left)?e.style.left=t.left:t.left=r}if(n.maxTop){e.style.top=n.maxTop;var i=getComputedStyle(e).top;parseFloat(i)>parseFloat(t.top)?e.style.top=t.top:t.top=i}var s=getComputedStyle(e);return{left:s.left,top:s.top}},applyPositionModify:function(e,t,n){if(n.modify&&"function"==typeof n.modify){var o=n.modify.call(t,t,n);e.style.left=Number.isInteger(o.left)||o.left.match(/^\d+$/)?"".concat(o.left,"px"):o.left,e.style.top=Number.isInteger(o.top)||o.top.match(/^\d+$/)?"".concat(o.top,"px"):o.top}var a=getComputedStyle(e);return{left:a.left,top:a.top}},autopositionRemaining:function(e){var t;(["left-top-down","left-top-right","center-top-down","right-top-down","right-top-left","left-bottom-up","left-bottom-right","center-bottom-up","right-bottom-up","right-bottom-left"].forEach(function(n){e.classList.contains(n)&&(t=n)}),t)&&("window"===e.options.container?document.body:e.options.container).querySelectorAll(".".concat(t)).forEach(function(e){e.reposition()})},addScript:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text/javascript",n=arguments.length>2?arguments[2]:void 0;if(!document.querySelector('script[src="'.concat(e,'"]'))){var o=document.createElement("script");n&&(o.onload=n),o.src=e,o.type=t,document.head.appendChild(o)}},ajax:function ajax(obj,ajaxConfig){var objIsPanel;"object"===_typeof(obj)&&obj.classList.contains("jsPanel")?objIsPanel=!0:(objIsPanel=!1,"string"==typeof obj&&(obj=document.querySelector(obj)));var configDefaults={method:"GET",async:!0,user:"",pwd:"",done:function(){objIsPanel?obj.content.innerHTML=this.responseText:obj.innerHTML=this.responseText},autoresize:!0,autoreposition:!0},config;if("string"==typeof ajaxConfig)config=Object.assign({},configDefaults,{url:encodeURI(ajaxConfig),evalscripttags:!0});else{if("object"!==_typeof(ajaxConfig)||!ajaxConfig.url){if(this.errorReporting)try{throw new jsPanel.jsPanelError("XMLHttpRequest seems to miss the url parameter!")}catch(e){jsPanel.error(e)}return obj}config=Object.assign({},configDefaults,ajaxConfig),config.url=encodeURI(ajaxConfig.url),!1===config.async&&(config.timeout=0,config.withCredentials&&(config.withCredentials=void 0),config.responseType&&(config.responseType=void 0))}var xhr=new XMLHttpRequest;return xhr.onreadystatechange=function(){if(4===xhr.readyState){if(200===xhr.status){if(config.done.call(xhr,obj),config.evalscripttags){var scripttags=xhr.responseText.match(/]*>([\s\S]*?)<\/script>/gi);scripttags&&scripttags.forEach(function(tag){var js=tag.replace(/]*>/i,"").replace(/<\/script>/i,"").trim();eval(js)})}}else config.fail&&config.fail.call(xhr,obj);if(config.always&&config.always.call(xhr,obj),objIsPanel){var oContentSize=obj.options.contentSize;if("string"==typeof oContentSize&&oContentSize.match(/auto/i)){var parts=oContentSize.split(" "),sizes=Object.assign({},{width:parts[0],height:parts[1]});config.autoresize&&obj.resize(sizes),obj.classList.contains("jsPanel-contextmenu")||config.autoreposition&&obj.reposition()}else if("object"===_typeof(oContentSize)&&("auto"===oContentSize.width||"auto"===oContentSize.height)){var _sizes=Object.assign({},oContentSize);config.autoresize&&obj.resize(_sizes),obj.classList.contains("jsPanel-contextmenu")||config.autoreposition&&obj.reposition()}}jsPanel.ajaxAlwaysCallbacks.length&&jsPanel.ajaxAlwaysCallbacks.forEach(function(e){e.call(obj,obj)})}},xhr.open(config.method,config.url,config.async,config.user,config.pwd),xhr.timeout=config.timeout||0,config.withCredentials&&(xhr.withCredentials=config.withCredentials),config.responseType&&(xhr.responseType=config.responseType),config.beforeSend&&config.beforeSend.call(xhr),config.data?xhr.send(config.data):xhr.send(null),obj},createPanelTemplate:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=document.createElement("div");return t.className="jsPanel",t.style.left="0",t.style.top="0",e&&["close","maximize","normalize","minimize","smallify"].forEach(function(e){t.setAttribute("data-btn".concat(e),"enabled")}),t.innerHTML='
\n
\n \n
\n \n
\n
\n \n \n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
'),t},createMinimizedTemplate:function(){var e=document.createElement("div");return e.className="jsPanel-replacement",e.innerHTML='
\n
\n \n
\n \n
\n
\n \n \n \n
\n
\n
"),e},createSnapArea:function(e,t,n){var o=document.createElement("div"),a=e.parentElement;o.className="jsPanel-snap-area jsPanel-snap-area-".concat(t),"lt"===t||"rt"===t||"rb"===t||"lb"===t?(o.style.width=n+"px",o.style.height=n+"px"):"ct"===t||"cb"===t?o.style.height=n+"px":"lc"!==t&&"rc"!==t||(o.style.width=n+"px"),a!==document.body&&(o.style.position="absolute"),document.querySelector(".jsPanel-snap-area.jsPanel-snap-area-".concat(t))||e.parentElement.appendChild(o)},dragit:function(e){var t,n,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new CustomEvent("jspaneldragstart",{detail:e.id}),i=new CustomEvent("jspaneldrag",{detail:e.id}),s=new CustomEvent("jspaneldragstop",{detail:e.id});[r,i,s].forEach(function(t){t.panel=e});var l=function(e){var t=e.split("-");return t.forEach(function(e,n){t[n]=e.charAt(0).toUpperCase()+e.slice(1)}),"snap"+t.join("")},c=a.handles||this.defaults.dragit.handles,d=a.cursor||this.defaults.dragit.cursor;return e.querySelectorAll(c).forEach(function(c){c.style.touchAction="none",c.style.cursor=d,jsPanel.pointerdown.forEach(function(s){c.addEventListener(s,function(s){if(s.button&&s.button>0)return!1;if((o=Object.assign({},jsPanel.defaults.dragit,a)).disableOnMaximized&&"maximized"===e.status)return!1;if((o.containment||0===o.containment)&&(o.containment=jsPanel.pOcontainment(o.containment)),o.grid&&Array.isArray(o.grid)&&1===o.grid.length&&(o.grid[1]=o.grid[0]),o.snap&&("object"===_typeof(o.snap)?o.snap=Object.assign({},jsPanel.defaultSnapConfig,o.snap):o.snap=jsPanel.defaultSnapConfig),!s.target.closest(".jsPanel-ftr-btn")){e.controlbar.style.pointerEvents="none",e.content.style.pointerEvents="none",document.querySelectorAll("iframe").forEach(function(e){e.style.pointerEvents="none"});var l=window.getComputedStyle(e),c=parseFloat(l.left),d=parseFloat(l.top),p=parseFloat(l.width),h=parseFloat(l.height),f=s.touches?s.touches[0].clientX:s.clientX,u=s.touches?s.touches[0].clientY:s.clientY,m=e.parentElement,g=m.getBoundingClientRect(),b=window.getComputedStyle(m),y=e.getScaleFactor(),v=0;n=function(n){if(n.preventDefault(),!t){if(document.dispatchEvent(r),e.style.opacity=o.opacity,e.snapped&&o.snap.resizeToPreSnap&&e.currentData.beforeSnap){e.resize(e.currentData.beforeSnap.width+" "+e.currentData.beforeSnap.height),e.setControls([".jsPanel-btn-normalize"]);var a=e.getBoundingClientRect(),s=f-(a.left+a.width),l=a.width/2;s>-l&&(v=s+l)}if(e.front(),e.snapped=!1,"maximized"===e.status&&(e.setControls([".jsPanel-btn-normalize"]),e.status="normalized"),o.drop&&o.drop.dropZones){var w=o.drop.dropZones.map(function(e){return jsPanel.pOcontainer(e)}),j=[];w.forEach(function(e){e.length?e.forEach(function(e){j.push(e)}):j.push(e)}),j=j.filter(function(e,t,n){return n.indexOf(e)===t}),o.drop.dropZones=j}o.start.length&&jsPanel.processCallbacks(e,o.start,!1,{left:c,top:d,width:p,height:h},n)}var P,x,E,C,F,z,S,A,k,B;t=1;var T,L=n.touches?n.touches[0].clientX:n.clientX,R=n.touches?n.touches[0].clientY:n.clientY,D=window.getComputedStyle(e);if(m===document.body){var W=e.getBoundingClientRect();k=window.innerWidth-parseInt(b.borderLeftWidth,10)-parseInt(b.borderRightWidth,10)-(W.left+W.width),B=window.innerHeight-parseInt(b.borderTopWidth,10)-parseInt(b.borderBottomWidth,10)-(W.top+W.height)}else k=parseInt(b.width,10)-parseInt(b.borderLeftWidth,10)-parseInt(b.borderRightWidth,10)-(parseInt(D.left,10)+parseInt(D.width,10)),B=parseInt(b.height,10)-parseInt(b.borderTopWidth,10)-parseInt(b.borderBottomWidth,10)-(parseInt(D.top,10)+parseInt(D.height,10));P=parseFloat(D.left),E=parseFloat(D.top),F=k,S=B,o.snap&&("panel"===o.snap.trigger?(x=Math.pow(P,2),C=Math.pow(E,2),z=Math.pow(F,2),A=Math.pow(S,2)):"pointer"===o.snap.trigger&&("window"===e.options.container?(P=L,E=R,F=window.innerWidth-L,S=window.innerHeight-R,x=Math.pow(L,2),C=Math.pow(E,2),z=Math.pow(F,2),A=Math.pow(S,2)):(P=(T=e.overlaps(m,"paddingbox",n)).pointer.left,E=T.pointer.top,F=T.pointer.right,S=T.pointer.bottom,x=Math.pow(T.pointer.left,2),C=Math.pow(T.pointer.top,2),z=Math.pow(T.pointer.right,2),A=Math.pow(T.pointer.bottom,2))));var q=Math.sqrt(x+C),M=Math.sqrt(x+A),O=Math.sqrt(z+C),I=Math.sqrt(z+A),N=Math.abs(P-F)/2,H=Math.abs(E-S)/2,_=Math.sqrt(x+Math.pow(H,2)),X=Math.sqrt(C+Math.pow(N,2)),Y=Math.sqrt(z+Math.pow(H,2)),V=Math.sqrt(A+Math.pow(N,2));if(window.getSelection().removeAllRanges(),document.dispatchEvent(i),o.axis&&"x"!==o.axis||(e.style.left=c+(L-f)/y.x+v+"px"),o.axis&&"y"!==o.axis||(e.style.top=d+(R-u)/y.y+"px"),o.grid){var $=o.grid,Z=o.axis,U=$[0]*Math.round((c+(L-f))/$[0]),G=$[1]*Math.round((d+(R-u))/$[1]);Z&&"x"!==Z||(e.style.left="".concat(U,"px")),Z&&"y"!==Z||(e.style.top="".concat(G,"px"))}if(o.containment||0===o.containment){var J,K,Q=o.containment;if(e.options.container===document.body)J=window.innerWidth-parseFloat(D.width)-Q[1],K=window.innerHeight-parseFloat(D.height)-Q[2];else{var ee=parseFloat(b.borderLeftWidth)+parseFloat(b.borderRightWidth),te=parseFloat(b.borderTopWidth)+parseFloat(b.borderBottomWidth);J=g.width/y.x-parseFloat(D.width)-Q[1]-ee,K=g.height/y.y-parseFloat(D.height)-Q[2]-te}parseFloat(e.style.left)<=Q[3]&&(e.style.left=Q[3]+"px"),parseFloat(e.style.top)<=Q[0]&&(e.style.top=Q[0]+"px"),parseFloat(e.style.left)>=J&&(e.style.left=J+"px"),parseFloat(e.style.top)>=K&&(e.style.top=K+"px")}if(o.drag.length){var ne={left:P,top:E,right:F,bottom:S,width:parseFloat(D.width),height:parseFloat(D.height)};jsPanel.processCallbacks(e,o.drag,!1,ne,n)}if(o.snap){var oe=o.snap.sensitivity,ae=m===document.body?window.innerWidth/8:g.width/8,re=m===document.body?window.innerHeight/8:g.height/8;e.snappableTo=!1,jsPanel.removeSnapAreas(),q0&&T.pointer.top>0?(e.snappableTo="left-top",jsPanel.createSnapArea(e,"lt",oe)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="left-top",jsPanel.createSnapArea(e,"lt",oe))):M0&&T.pointer.bottom>0?(e.snappableTo="left-bottom",jsPanel.createSnapArea(e,"lb",oe)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="left-bottom",jsPanel.createSnapArea(e,"lb",oe))):O0&&T.pointer.top>0?(e.snappableTo="right-top",jsPanel.createSnapArea(e,"rt",oe)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="right-top",jsPanel.createSnapArea(e,"rt",oe))):I0&&T.pointer.bottom>0?(e.snappableTo="right-bottom",jsPanel.createSnapArea(e,"rb",oe)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="right-bottom",jsPanel.createSnapArea(e,"rb",oe))):E0?(e.snappableTo="center-top",jsPanel.createSnapArea(e,"ct",oe)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="center-top",jsPanel.createSnapArea(e,"ct",oe))):P0?(e.snappableTo="left-center",jsPanel.createSnapArea(e,"lc",oe)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="left-center",jsPanel.createSnapArea(e,"lc",oe))):F0?(e.snappableTo="right-center",jsPanel.createSnapArea(e,"rc",oe)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="right-center",jsPanel.createSnapArea(e,"rc",oe))):S0?(e.snappableTo="center-bottom",jsPanel.createSnapArea(e,"cb",oe)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="center-bottom",jsPanel.createSnapArea(e,"cb",oe)))}if(o.drop&&o.drop.dropZones){var ie=jsPanel.isIE?"msElementsFromPoint":"elementsFromPoint",se=document[ie](n.clientX,n.clientY);Array.isArray(se)||(se=Array.prototype.slice.call(se)),o.drop.dropZones.forEach(function(t){se.includes(t)&&(e.droppableTo=t)}),se.includes(e.droppableTo)||(e.droppableTo=!1)}},jsPanel.pointermove.forEach(function(e){document.addEventListener(e,n)}),window.addEventListener("mouseout",function(t){null===t.relatedTarget&&jsPanel.pointermove.forEach(function(t){document.removeEventListener(t,n,!1),e.style.opacity=1})},!1)}})}),jsPanel.pointerup.forEach(function(a){document.addEventListener(a,function(a){if(jsPanel.pointermove.forEach(function(e){document.removeEventListener(e,n)}),jsPanel.removeSnapAreas(),t){if(e.style.opacity=1,t=void 0,o.snap){switch(e.snappableTo){case"left-top":e.snap(o.snap.snapLeftTop);break;case"center-top":e.snap(o.snap.snapCenterTop);break;case"right-top":e.snap(o.snap.snapRightTop);break;case"right-center":e.snap(o.snap.snapRightCenter);break;case"right-bottom":e.snap(o.snap.snapRightBottom);break;case"center-bottom":e.snap(o.snap.snapCenterBottom);break;case"left-bottom":e.snap(o.snap.snapLeftBottom);break;case"left-center":e.snap(o.snap.snapLeftCenter)}o.snap.callback&&e.snappableTo&&"function"==typeof o.snap.callback&&(o.snap.callback.call(e,e),o.snap.repositionOnSnap&&!1!==o.snap[l(e.snappableTo)]&&e.repositionOnSnap(e.snappableTo)),e.snappableTo&&o.snap.repositionOnSnap&&o.snap[l(e.snappableTo)]&&e.repositionOnSnap(e.snappableTo)}if(e.droppableTo&&e.droppableTo!==e.parentElement){var r=e.parentElement;e.move(e.droppableTo),o.drop.callback&&o.drop.callback.call(e,e,e.droppableTo,r)}if(document.dispatchEvent(s),o.stop.length){var i=window.getComputedStyle(e),c={left:parseFloat(i.left),top:parseFloat(i.top),width:parseFloat(i.width),height:parseFloat(i.height)};jsPanel.processCallbacks(e,o.stop,!1,c,a)}e.saveCurrentPosition(),e.calcSizeFactors()}e.controlbar.style.pointerEvents="inherit",e.content.style.pointerEvents="inherit",document.querySelectorAll("iframe").forEach(function(e){e.style.pointerEvents="auto"})})}),a.disable&&(c.style.pointerEvents="none")}),e},emptyNode:function(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e},extend:function(e){if("[object Object]"===Object.prototype.toString.call(e))for(var t in e)e.hasOwnProperty(t)&&(this.extensions[t]=e[t])},fetch:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(obj){var confDefaults={bodyMethod:"text",evalscripttags:!0,autoresize:!0,autoreposition:!0,done:function(e,t){e.content.innerHTML=t}},conf="string"==typeof obj.options.contentFetch?Object.assign({resource:obj.options.contentFetch},confDefaults):Object.assign(confDefaults,obj.options.contentFetch),fetchInit=conf.fetchInit||{};if(!conf.resource){if(this.errorReporting)try{throw new jsPanel.jsPanelError("The Fetch request seems to miss the resource parameter")}catch(e){jsPanel.error(e)}return obj}conf.beforeSend&&conf.beforeSend.call(obj,obj),fetch(conf.resource,fetchInit).then(function(e){if(e.ok)return e[conf.bodyMethod]()}).then(function(response){if(conf.done.call(obj,obj,response),conf.evalscripttags){var scripttags=response.match(/]*>([\s\S]*?)<\/script>/gi);scripttags&&scripttags.forEach(function(tag){var js=tag.replace(/]*>/i,"").replace(/<\/script>/i,"").trim();eval(js)})}var oContentSize=obj.options.contentSize;if(conf.autoresize||conf.autoreposition)if("string"==typeof oContentSize&&oContentSize.match(/auto/i)){var parts=oContentSize.split(" "),sizes=Object.assign({},{width:parts[0],height:parts[1]});conf.autoresize&&obj.resize(sizes),obj.classList.contains("jsPanel-contextmenu")||conf.autoreposition&&obj.reposition()}else if("object"===_typeof(oContentSize)&&("auto"===oContentSize.width||"auto"===oContentSize.height)){var _sizes2=Object.assign({},oContentSize);conf.autoresize&&obj.resize(_sizes2),obj.classList.contains("jsPanel-contextmenu")||conf.autoreposition&&obj.reposition()}})}),getPanels:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return this.classList.contains("jsPanel-standard")};return Array.prototype.slice.call(document.querySelectorAll(".jsPanel")).filter(function(t){return e.call(t,t)}).sort(function(e,t){return t.style.zIndex-e.style.zIndex})},pOcontainer:function(e){if("window"===e)return document.body;if("string"==typeof e){var t=document.querySelectorAll(e);return!!(t.length&&t.length>0)&&t}return 1===e.nodeType?e:!!e.length&&e[0]},pOcontainment:function(e){var t=e;if("function"==typeof e&&(t=e()),"number"==typeof t)return[t,t,t,t];if(Array.isArray(t)){if(1===t.length)return[t[0],t[0],t[0],t[0]];if(2===t.length)return t.concat(t);3===t.length&&(t[3]=t[1])}return t},pOsize:function(e,t){var n=t||this.defaults.contentSize,o=e.parentElement;if("string"==typeof n){var a=n.trim().split(" ");(n={}).width=a[0],2===a.length?n.height=a[1]:n.height=a[0]}else n.width&&!n.height?n.height=n.width:n.height&&!n.width&&(n.width=n.height);if(String(n.width).match(/^[0-9.]+$/gi))n.width+="px";else if("string"==typeof n.width&&n.width.endsWith("%"))if(o===document.body)n.width=window.innerWidth*(parseFloat(n.width)/100)+"px";else{var r=window.getComputedStyle(o),i=parseFloat(r.borderLeftWidth)+parseFloat(r.borderRightWidth);n.width=(parseFloat(r.width)-i)*(parseFloat(n.width)/100)+"px"}else"function"==typeof n.width&&(n.width=n.width.call(e,e),"number"==typeof n.width?n.width+="px":"string"==typeof n.width&&n.width.match(/^[0-9.]+$/gi)&&(n.width+="px"));if(String(n.height).match(/^[0-9.]+$/gi))n.height+="px";else if("string"==typeof n.height&&n.height.endsWith("%"))if(o===document.body)n.height=window.innerHeight*(parseFloat(n.height)/100)+"px";else{var s=window.getComputedStyle(o),l=parseFloat(s.borderTopWidth)+parseFloat(s.borderBottomWidth);n.height=(parseFloat(s.height)-l)*(parseFloat(n.height)/100)+"px"}else"function"==typeof n.height&&(n.height=n.height.call(e,e),"number"==typeof n.height?n.height+="px":"string"==typeof n.height&&n.height.match(/^[0-9.]+$/gi)&&(n.height+="px"));return n},pOborder:function(e){e=e.trim();var t=new Array(3),n=e.match(/\s*(none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset)\s*/gi),o=e.match(/\s*(thin|medium|thick)|(\d*\.?\d+[a-zA-Z]{2,4})\s*/gi);return n?(t[1]=n[0].trim(),e=e.replace(t[1],"")):t[1]="solid",o?(t[0]=o[0].trim(),e=e.replace(t[0],"")):t[0]="medium",t[2]=e.trim(),t},pOheaderControls:function(e){if("string"==typeof e){var t={},n=e.toLowerCase(),o=n.match(/xl|lg|md|sm|xs/),a=n.match(/closeonly|none/);return o&&(t.size=o[0]),a&&(t=Object.assign({},t,{maximize:"remove",normalize:"remove",minimize:"remove",smallify:"remove"}),"none"===a[0]&&(t.close="remove")),Object.assign({},this.defaults.headerControls,t)}return Object.assign({},this.defaults.headerControls,e)},processCallbacks:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"some",o=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;if("function"==typeof t&&(t=[t]),n)return t[n](function(t){return t.call(e,e,o,a)});t.forEach(function(t){t.call(e,e,o,a)})},removeSnapAreas:function(){document.querySelectorAll(".jsPanel-snap-area").forEach(function(e){e.parentElement.removeChild(e)})},remClass:function(e,t){return t.split(" ").forEach(function(t){return e.classList.remove(t)}),e},resetZi:function(){this.zi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:jsPanel.ziBase;return{next:function(){return e++}}}(),Array.prototype.slice.call(document.querySelectorAll(".jsPanel-standard")).sort(function(e,t){return e.style.zIndex-t.style.zIndex}).forEach(function(e){e.style.zIndex=jsPanel.zi.next()})},resizeit:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new CustomEvent("jspanelresizestart",{detail:e.id}),o=new CustomEvent("jspanelresize",{detail:e.id}),a=new CustomEvent("jspanelresizestop",{detail:e.id});[n,o,a].forEach(function(t){t.panel=e});var r,i,s,l,c={};return c.handles=t.handles||jsPanel.defaults.resizeit.handles,c.handles.split(",").forEach(function(t){var n=document.createElement("DIV");n.className="jsPanel-resizeit-handle jsPanel-resizeit-".concat(t.trim()),n.style.zIndex=90,e.append(n)}),e.querySelectorAll(".jsPanel-resizeit-handle").forEach(function(a){jsPanel.pointerdown.forEach(function(d){a.addEventListener(d,function(a){if(a.preventDefault(),a.button&&a.button>0)return!1;var d=1;if(((c=Object.assign({},jsPanel.defaults.resizeit,t)).containment||0===c.containment)&&(c.containment=jsPanel.pOcontainment(c.containment)),c.aspectRatio&&!0===c.aspectRatio&&(c.aspectRatio="panel"),jsPanel.modifier){var p=jsPanel.modifier;"AltLeft"===p||"AltRight"===p?c.aspectRatio="content":"ControlLeft"===p||"ControlRight"===p?c.aspectRatio="panel":"ShiftLeft"!==p&&"ShiftRight"!==p||(d=2)}var h="function"==typeof c.maxWidth?c.maxWidth():c.maxWidth||1e4,f="function"==typeof c.maxHeight?c.maxHeight():c.maxHeight||1e4,u="function"==typeof c.minWidth?c.minWidth():c.minWidth,m="function"==typeof c.minHeight?c.minHeight():c.minHeight;e.content.style.pointerEvents="none",document.querySelectorAll("iframe").forEach(function(e){e.style.pointerEvents="none"});var g=e.parentElement,b=g.tagName.toLowerCase(),y=e.getBoundingClientRect(),v=g.getBoundingClientRect(),w=window.getComputedStyle(g,null),j=parseInt(w.borderLeftWidth,10),P=parseInt(w.borderTopWidth,10),x=w.getPropertyValue("position"),E=a.clientX||a.touches[0].clientX,C=a.clientY||a.touches[0].clientY,F=E/C,z=y.width,S=y.height,A=a.target.classList,k=e.getScaleFactor(),B=y.width/y.height,T=e.content.getBoundingClientRect(),L=T.width/T.height,R=e.header.getBoundingClientRect().height,D=e.footer.getBoundingClientRect().height||0,W=y.left,q=y.top,M=1e4,O=1e4,I=1e4,N=1e4;"body"!==b&&(W=y.left-v.left+g.scrollLeft,q=y.top-v.top+g.scrollTop),"body"===b&&c.containment?(M=document.documentElement.clientWidth-y.left,I=document.documentElement.clientHeight-y.top,O=y.width+y.left,N=y.height+y.top):c.containment&&("static"===x?(M=v.width-y.left+j,I=v.height+v.top-y.top+P,O=y.width+(y.left-v.left)-j,N=y.height+(y.top-v.top)-P):(M=g.clientWidth-(y.left-v.left)/k.x+j,I=g.clientHeight-(y.top-v.top)/k.y+P,O=(y.width+y.left-v.left)/k.x-j,N=e.clientHeight+(y.top-v.top)/k.y-P)),c.containment&&(O-=c.containment[3],N-=c.containment[0],M-=c.containment[1],I-=c.containment[2]);var H=window.getComputedStyle(e),_=parseFloat(H.width)-y.width,X=parseFloat(H.height)-y.height,Y=parseFloat(H.left)-y.left,V=parseFloat(H.top)-y.top;g!==document.body&&(Y+=v.left,V+=v.top);var $=parseInt(H.borderTopWidth,10),Z=parseInt(H.borderRightWidth,10),U=parseInt(H.borderBottomWidth,10),G=parseInt(H.borderLeftWidth,10);r=function(t){i||(document.dispatchEvent(n),c.start.length&&jsPanel.processCallbacks(e,c.start,!1,{width:z,height:S,left:W,top:q},t),e.front(),e.status="normalized",e.setControls([".jsPanel-btn-normalize"])),i=1,document.dispatchEvent(o);var a=t.touches?t.touches[0].clientX:t.clientX,r=t.touches?t.touches[0].clientY:t.clientY;A.contains("jsPanel-resizeit-e")?((s=z+(a-E)*d/k.x+_)>=M&&(s=M),s>=h&&(s=h),s<=u&&(s=u),e.style.width=s+"px",2===d&&(e.style.left=W-(a-E)+"px"),"content"===c.aspectRatio?(e.style.height=(s-Z-G)/L+R+D+$+U+"px",c.containment&&e.overlaps(g).bottom<=c.containment[2]&&(e.style.height=I+"px",e.style.width=I*L+"px")):"panel"===c.aspectRatio&&(e.style.height=s/B+"px",c.containment&&e.overlaps(g).bottom<=c.containment[2]&&(e.style.height=I+"px",e.style.width=I*B+"px"))):A.contains("jsPanel-resizeit-s")?((l=S+(r-C)*d/k.y+X)>=I&&(l=I),l>=f&&(l=f),l<=m&&(l=m),e.style.height=l+"px",2===d&&(e.style.top=q-(r-C)+"px"),"content"===c.aspectRatio?(e.style.width=(l-R-D-$-U)*L+$+U+"px",c.containment&&e.overlaps(g).right<=c.containment[1]&&(e.style.width=M+"px",e.style.height=M/L+"px")):"panel"===c.aspectRatio&&(e.style.width=l*B+"px",c.containment&&e.overlaps(g).right<=c.containment[1]&&(e.style.width=M+"px",e.style.height=M/B+"px"))):A.contains("jsPanel-resizeit-w")?((s=z+(E-a)*d/k.x+_)<=h&&s>=u&&s<=O&&(e.style.left=W+(a-E)/k.x+Y+"px"),s>=O&&(s=O),s>=h&&(s=h),s<=u&&(s=u),e.style.width=s+"px","content"===c.aspectRatio?(e.style.height=(s-Z-G)/L+R+D+$+U+"px",c.containment&&e.overlaps(g).bottom<=c.containment[2]&&(e.style.height=I+"px",e.style.width=I*L+"px")):"panel"===c.aspectRatio&&(e.style.height=s/B+"px",c.containment&&e.overlaps(g).bottom<=c.containment[2]&&(e.style.height=I+"px",e.style.width=I*B+"px"))):A.contains("jsPanel-resizeit-n")?((l=S+(C-r)*d/k.y+X)<=f&&l>=m&&l<=N&&(e.style.top=q+(r-C)/k.y+V+"px"),l>=N&&(l=N),l>=f&&(l=f),l<=m&&(l=m),e.style.height=l+"px","content"===c.aspectRatio?(e.style.width=(l-R-D-$-U)*L+$+U+"px",c.containment&&e.overlaps(g).right<=c.containment[1]&&(e.style.width=M+"px",e.style.height=M/L+"px")):"panel"===c.aspectRatio&&(e.style.width=l*B+"px",c.containment&&e.overlaps(g).right<=c.containment[1]&&(e.style.width=M+"px",e.style.height=M/B+"px"))):A.contains("jsPanel-resizeit-se")?((s=z+(a-E)*d/k.x+_)>=M&&(s=M),s>=h&&(s=h),s<=u&&(s=u),e.style.width=s+"px",2===d&&(e.style.left=W-(a-E)+"px"),c.aspectRatio&&(e.style.height=s/B+"px"),(l=S+(r-C)*d/k.y+X)>=I&&(l=I),l>=f&&(l=f),l<=m&&(l=m),e.style.height=l+"px",2===d&&(e.style.top=q-(r-C)+"px"),"content"===c.aspectRatio?(e.style.width=(l-R-D-$-U)*L+$+U+"px",c.containment&&e.overlaps(g).right<=c.containment[1]&&(e.style.width=M+"px",e.style.height=M/L+"px")):"panel"===c.aspectRatio&&(e.style.width=l*B+"px",c.containment&&e.overlaps(g).right<=c.containment[1]&&(e.style.width=M+"px",e.style.height=M/B+"px"))):A.contains("jsPanel-resizeit-sw")?((l=S+(r-C)*d/k.y+X)>=I&&(l=I),l>=f&&(l=f),l<=m&&(l=m),e.style.height=l+"px",2===d&&(e.style.top=q-(r-C)+"px"),c.aspectRatio&&(e.style.width=l*B+"px"),(s=z+(E-a)*d/k.x+_)<=h&&s>=u&&s<=O&&(e.style.left=W+(a-E)/k.x+Y+"px"),s>=O&&(s=O),s>=h&&(s=h),s<=u&&(s=u),e.style.width=s+"px","content"===c.aspectRatio?(e.style.height=(s-Z-G)/L+R+D+$+U+"px",c.containment&&e.overlaps(g).bottom<=c.containment[2]&&(e.style.height=I+"px",e.style.width=I*L+"px")):"panel"===c.aspectRatio&&(e.style.height=s/B+"px",c.containment&&e.overlaps(g).bottom<=c.containment[2]&&(e.style.height=I+"px",e.style.width=I*B+"px"))):A.contains("jsPanel-resizeit-ne")?((s=z+(a-E)*d/k.x+_)>=M&&(s=M),s>=h&&(s=h),s<=u&&(s=u),e.style.width=s+"px",2===d&&(e.style.left=W-(a-E)+"px"),c.aspectRatio&&(e.style.height=s/B+"px"),(l=S+(C-r)*d/k.y+X)<=f&&l>=m&&l<=N&&(e.style.top=q+(r-C)/k.y+V+"px"),l>=N&&(l=N),l>=f&&(l=f),l<=m&&(l=m),e.style.height=l+"px","content"===c.aspectRatio?(e.style.width=(l-R-D-$-U)*L+$+U+"px",c.containment&&e.overlaps(g).right<=c.containment[1]&&(e.style.width=M+"px",e.style.height=M/L+"px")):"panel"===c.aspectRatio&&(e.style.width=l*B+"px",c.containment&&e.overlaps(g).right<=c.containment[1]&&(e.style.width=M+"px",e.style.height=M/B+"px"))):A.contains("jsPanel-resizeit-nw")&&(c.aspectRatio&&A.contains("jsPanel-resizeit-nw")&&(r=(a=r*F)/F),(s=z+(E-a)*d/k.x+_)<=h&&s>=u&&s<=O&&(e.style.left=W+(a-E)/k.x+Y+"px"),s>=O&&(s=O),s>=h&&(s=h),s<=u&&(s=u),e.style.width=s+"px",c.aspectRatio&&(e.style.height=s/B+"px"),(l=S+(C-r)*d/k.y+X)<=f&&l>=m&&l<=N&&(e.style.top=q+(r-C)/k.y+V+"px"),l>=N&&(l=N),l>=f&&(l=f),l<=m&&(l=m),e.style.height=l+"px","content"===c.aspectRatio?e.style.width=(l-R-D-$-U)*L+$+U+"px":"panel"===c.aspectRatio&&(e.style.width=l*B+"px")),window.getSelection().removeAllRanges();var p=window.getComputedStyle(e),b={left:parseFloat(p.left),top:parseFloat(p.top),right:parseFloat(p.right),bottom:parseFloat(p.bottom),width:parseFloat(p.width),height:parseFloat(p.height)};c.resize.length&&jsPanel.processCallbacks(e,c.resize,!1,b,t)},jsPanel.pointermove.forEach(function(e){document.addEventListener(e,r,!1)}),window.addEventListener("mouseout",function(e){null===e.relatedTarget&&jsPanel.pointermove.forEach(function(e){document.removeEventListener(e,r,!1)})},!1)})})}),jsPanel.pointerup.forEach(function(t){document.addEventListener(t,function(t){if(jsPanel.pointermove.forEach(function(e){document.removeEventListener(e,r,!1)}),t.target.classList&&t.target.classList.contains("jsPanel-resizeit-handle")){var n,o,s=t.target.className;if(s.match(/jsPanel-resizeit-nw|jsPanel-resizeit-w|jsPanel-resizeit-sw/i)&&(n=!0),s.match(/jsPanel-resizeit-nw|jsPanel-resizeit-n|jsPanel-resizeit-ne/i)&&(o=!0),c.grid&&Array.isArray(c.grid)){1===c.grid.length&&(c.grid[1]=c.grid[0]);var l=parseFloat(e.style.width),d=parseFloat(e.style.height),p=l%c.grid[0],h=d%c.grid[1],f=parseFloat(e.style.left),u=parseFloat(e.style.top),m=f%c.grid[0],g=u%c.grid[1];p

'.concat(e.message,"

")})},create:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;jsPanel.zi||(jsPanel.zi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:jsPanel.ziBase;return{next:function(){return e++}}}()),t.config?delete(t=Object.assign({},this.defaults,t.config,t)).config:t=Object.assign({},this.defaults,t),t.id?"function"==typeof t.id&&(t.id=t.id()):t.id="jsPanel-".concat(jsPanel.idCounter+=1);var o=document.getElementById(t.id);if(null!==o){if(o.classList.contains("jsPanel")&&o.front(),this.errorReporting)try{throw new jsPanel.jsPanelError("◀ COULD NOT CREATE NEW JSPANEL ►
An element with the ID "+t.id+" already exists in the document.")}catch(e){jsPanel.error(e)}return!1}var a=this.pOcontainer(t.container);if("object"===_typeof(a)&&a.length&&a.length>0&&(a=a[0]),!a){if(this.errorReporting)try{throw new jsPanel.jsPanelError("◀ COULD NOT CREATE NEW JSPANEL ►
The container to append the panel to does not exist")}catch(e){jsPanel.error(e)}return!1}["onbeforeclose","onbeforemaximize","onbeforeminimize","onbeforenormalize","onbeforesmallify","onbeforeunsmallify","onclosed","onfronted","onmaximized","onminimized","onnormalized","onsmallified","onstatuschange","onunsmallified"].forEach(function(e){t[e]?"function"==typeof t[e]&&(t[e]=[t[e]]):t[e]=[]});var r=t.template?t.template:this.createPanelTemplate();r.options=t,r.closetimer=void 0,r.status="initialized",r.currentData={},r.header=r.querySelector(".jsPanel-hdr"),r.headerbar=r.header.querySelector(".jsPanel-headerbar"),r.titlebar=r.header.querySelector(".jsPanel-titlebar"),r.headerlogo=r.headerbar.querySelector(".jsPanel-headerlogo"),r.headertitle=r.headerbar.querySelector(".jsPanel-title"),r.controlbar=r.headerbar.querySelector(".jsPanel-controlbar"),r.headertoolbar=r.header.querySelector(".jsPanel-hdr-toolbar"),r.content=r.querySelector(".jsPanel-content"),r.footer=r.querySelector(".jsPanel-ftr"),r.snappableTo=!1,r.snapped=!1,r.droppableTo=!1,r.autocloseProgressbar=r.querySelector(".jsPanel-autoclose-progressbar");var i=new CustomEvent("jspanelloaded",{detail:t.id}),s=new CustomEvent("jspanelstatuschange",{detail:t.id}),l=new CustomEvent("jspanelbeforenormalize",{detail:t.id}),c=new CustomEvent("jspanelnormalized",{detail:t.id}),d=new CustomEvent("jspanelbeforemaximize",{detail:t.id}),p=new CustomEvent("jspanelmaximized",{detail:t.id}),h=new CustomEvent("jspanelbeforeminimize",{detail:t.id}),f=new CustomEvent("jspanelminimized",{detail:t.id}),u=new CustomEvent("jspanelbeforesmallify",{detail:t.id}),m=new CustomEvent("jspanelsmallified",{detail:t.id}),g=new CustomEvent("jspanelsmallifiedmax",{detail:t.id}),b=new CustomEvent("jspanelbeforeunsmallify",{detail:t.id}),y=new CustomEvent("jspanelfronted",{detail:t.id}),v=new CustomEvent("jspanelbeforeclose",{detail:t.id}),w=new CustomEvent("jspanelclosed",{detail:t.id}),j=new CustomEvent("jspanelcloseduser",{detail:t.id});[i,s,l,c,d,p,h,f,u,m,g,b,y,v,w,j].forEach(function(e){e.panel=r});var P=r.querySelector(".jsPanel-btn-close"),x=r.querySelector(".jsPanel-btn-maximize"),E=r.querySelector(".jsPanel-btn-normalize"),C=r.querySelector(".jsPanel-btn-smallify"),F=r.querySelector(".jsPanel-btn-minimize");"onpointerdown"in window&&r.controlbar.querySelectorAll(".jsPanel-btn").forEach(function(e){e.addEventListener("pointerdown",function(e){e.preventDefault()},!0)}),P&&jsPanel.pointerup.forEach(function(e){P.addEventListener(e,function(e){if(e.preventDefault(),e.button&&e.button>0)return!1;r.close(null,!0)})}),x&&jsPanel.pointerup.forEach(function(e){x.addEventListener(e,function(e){if(e.preventDefault(),e.button&&e.button>0)return!1;r.maximize()})}),E&&jsPanel.pointerup.forEach(function(e){E.addEventListener(e,function(e){if(e.preventDefault(),e.button&&e.button>0)return!1;r.normalize()})}),C&&jsPanel.pointerup.forEach(function(e){C.addEventListener(e,function(e){if(e.preventDefault(),e.button&&e.button>0)return!1;"normalized"===r.status||"maximized"===r.status?r.smallify():"smallified"!==r.status&&"smallifiedmax"!==r.status||r.unsmallify()})}),F&&jsPanel.pointerup.forEach(function(e){F.addEventListener(e,function(e){if(e.preventDefault(),e.button&&e.button>0)return!1;r.minimize()})});var z=jsPanel.extensions;for(var S in z)z.hasOwnProperty(S)&&(r[S]=z[S]);if(r.clearTheme=function(e){return jsPanel.themes.forEach(function(e){["panel","jsPanel-theme-".concat(e),"panel-".concat(e),"".concat(e,"-color")].forEach(function(e){r.classList.remove(e)}),r.header.classList.remove("jsPanel-theme-".concat(e))}),r.content.classList.remove("jsPanel-content-filled","jsPanel-content-filledlight"),r.header.classList.remove("jsPanel-hdr-light"),r.header.classList.remove("jsPanel-hdr-dark"),r.style.backgroundColor="",jsPanel.setStyle(r.headertoolbar,{boxShadow:"",width:"",marginLeft:"",borderTopColor:"transparent"}),jsPanel.setStyle(r.content,{background:"",borderTopColor:"transparent"}),r.header.style.background="",Array.prototype.slice.call(r.controlbar.querySelectorAll(".jsPanel-icon")).concat([r.headerlogo,r.headertitle,r.headertoolbar,r.content]).forEach(function(e){e.style.color=""}),e&&e.call(r,r),r},r.getThemeDetails=function(e){var t=e.toLowerCase(),n={color:!1,colors:!1,filling:!1},o=t.split("fill");if(n.color=o[0].trim().replace(/\s*/g,""),2===o.length)if(o[1].startsWith("edlight"))n.filling="filledlight";else if(o[1].startsWith("eddark"))n.filling="filleddark";else if(o[1].startsWith("ed"))n.filling="filled";else if(o[1].startsWith("color")){var a=o[1].split("color"),r=a[a.length-1].trim().replace(/\s*/g,"");jsPanel.colorNames[r]&&(r=jsPanel.colorNames[r]),r.match(/^([0-9a-f]{3}|[0-9a-f]{6})$/gi)&&(r="#"+r),n.filling=r}if(jsPanel.themes.some(function(e){return e===n.color.split(/\s/i)[0]})){var i=n.color.split(/\s/i)[0],s=document.createElement("button");s.className=i+"-bg",document.body.appendChild(s),n.color=getComputedStyle(s).backgroundColor.replace(/\s+/gi,""),document.body.removeChild(s),s=void 0}else if(n.color.startsWith("bootstrap-")){var l=n.color.indexOf("-"),c=document.createElement("button");c.className="btn btn"+n.color.slice(l),document.body.appendChild(c),n.color=getComputedStyle(c).backgroundColor.replace(/\s+/gi,""),document.body.removeChild(c),c=void 0}else if(n.color.startsWith("mdb-")){var d,p=n.color.indexOf("-")+1,h=document.createElement("span");d=n.color.endsWith("-dark")?(d=n.color.slice(p)).replace("-dark","-color-dark"):n.color.slice(p)+"-color",h.className=d,document.body.appendChild(h),n.color=getComputedStyle(h).backgroundColor.replace(/\s+/gi,""),document.body.removeChild(h),h=void 0}return n.colors=jsPanel.calcColors(n.color),n},r.applyColorTheme=function(e){if(r.style.backgroundColor=e.colors[0],r.header.style.backgroundColor=e.colors[0],r.header.style.color=e.colors[3],[".jsPanel-headerlogo",".jsPanel-title",".jsPanel-hdr-toolbar"].forEach(function(t){r.querySelector(t).style.color=e.colors[3]}),r.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(function(t){t.style.color=e.colors[3]}),"string"==typeof r.options.theme&&"filled"===e.filling&&(r.content.style.borderTop="#000000"===e.colors[3]?"1px solid rgba(0,0,0,0.15)":"1px solid rgba(255,255,255,0.15)"),"#000000"===e.colors[3]?r.header.classList.add("jsPanel-hdr-light"):r.header.classList.add("jsPanel-hdr-dark"),e.filling)switch(e.filling){case"filled":jsPanel.setStyle(r.content,{backgroundColor:e.colors[2],color:e.colors[3]});break;case"filledlight":r.content.style.backgroundColor=e.colors[1];break;case"filleddark":jsPanel.setStyle(r.content,{backgroundColor:e.colors[6],color:e.colors[7]});break;default:r.content.style.backgroundColor=e.filling,r.content.style.color=jsPanel.perceivedBrightness(e.filling)<=jsPanel.colorBrightnessThreshold?"#fff":"#000"}return r},r.applyCustomTheme=function(e){var t,n={bgPanel:"#fff",bgContent:"#fff",colorHeader:"#000",colorContent:"#000"},o=(t="object"===_typeof(e)?Object.assign(n,e):n).bgPanel,a=t.bgContent,i=t.colorHeader,s=t.colorContent;if(jsPanel.colorNames[o]?r.style.background="#"+jsPanel.colorNames[o]:r.style.background=o,jsPanel.colorNames[i]&&(i="#"+jsPanel.colorNames[i]),[".jsPanel-headerlogo",".jsPanel-title",".jsPanel-hdr-toolbar"].forEach(function(e){r.querySelector(e).style.color=i}),r.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(function(e){e.style.color=i}),jsPanel.colorNames[a]?r.content.style.background="#"+jsPanel.colorNames[a]:r.content.style.background=a,jsPanel.colorNames[s]?r.content.style.color="#"+jsPanel.colorNames[s]:r.content.style.color=s,jsPanel.perceivedBrightness(i)>jsPanel.colorBrightnessThreshold?r.header.classList.add("jsPanel-hdr-dark"):r.header.classList.add("jsPanel-hdr-light"),jsPanel.perceivedBrightness(s)>jsPanel.colorBrightnessThreshold?r.content.style.borderTop="1px solid rgba(255,255,255,0.15)":r.content.style.borderTop="1px solid rgba(0,0,0,0.15)",t.border){var l=t.border,c=l.lastIndexOf(" "),d=l.slice(++c);jsPanel.colorNames[d]&&(l=l.replace(d,"#"+jsPanel.colorNames[d])),r.style.border=l}return r},r.setBorder=function(e){var t=jsPanel.pOborder(e);return t[2].length?jsPanel.colorNames[t[2]]&&(t[2]="#"+jsPanel.colorNames[t[2]]):t[2]=r.style.backgroundColor,t=t.join(" "),r.style.border=t,r.options.border=t,r},r.setBorderRadius=function(e){"number"==typeof e&&(e+="px"),r.style.borderRadius=e;var t=getComputedStyle(r);return r.querySelector(".jsPanel-hdr")?(r.header.style.borderTopLeftRadius=t.borderTopLeftRadius,r.header.style.borderTopRightRadius=t.borderTopRightRadius):(r.content.style.borderTopLeftRadius=t.borderTopLeftRadius,r.content.style.borderTopRightRadius=t.borderTopRightRadius),r.querySelector(".jsPanel-ftr.active")?(r.footer.style.borderBottomRightRadius=t.borderBottomRightRadius,r.footer.style.borderBottomLeftRadius=t.borderBottomLeftRadius):(r.content.style.borderBottomRightRadius=t.borderBottomRightRadius,r.content.style.borderBottomLeftRadius=t.borderBottomLeftRadius),r},r.setTheme=function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.theme,o=arguments.length>1?arguments[1]:void 0;if("minimized"===r.status&&(e=!0,r.normalize()),r.clearTheme(),"object"===_typeof(n))t.border=void 0,r.applyCustomTheme(n);else{"none"===n&&(n="white");var a=r.getThemeDetails(n);r.applyColorTheme(a)}return e&&r.minimize(),o&&o.call(r,r),r},r.close=function(e,t){r.closetimer&&window.clearInterval(r.closetimer);var n=r.id,o=r.parentElement;if(document.dispatchEvent(v),r.options.onbeforeclose&&r.options.onbeforeclose.length>0&&!jsPanel.processCallbacks(r,r.options.onbeforeclose,"some",r.status,t))return r;r.options.animateOut?(r.options.animateIn&&jsPanel.remClass(r,r.options.animateIn),jsPanel.setClass(r,r.options.animateOut),r.addEventListener("animationend",function(a){a.stopPropagation(),o.removeChild(r),document.getElementById(n)?e&&e.call(r,n,r):(r.removeMinimizedReplacement(),t&&document.dispatchEvent(j),document.dispatchEvent(w),r.options.onclosed&&jsPanel.processCallbacks(r,r.options.onclosed,"every",t),jsPanel.autopositionRemaining(r),e&&e.call(n,n))})):(o.removeChild(r),document.getElementById(n)?e&&e.call(r,n,r):(r.removeMinimizedReplacement(),t&&document.dispatchEvent(j),document.dispatchEvent(w),r.options.onclosed&&jsPanel.processCallbacks(r,r.options.onclosed,"every",t),jsPanel.autopositionRemaining(r),e&&e.call(n,n)))},r.maximize=function(e,n){if(r.statusBefore=r.status,t.onbeforemaximize&&t.onbeforemaximize.length>0&&!jsPanel.processCallbacks(r,t.onbeforemaximize,"some",r.statusBefore))return r;document.dispatchEvent(d);var o=r.parentElement,a=jsPanel.pOcontainment(t.maximizedMargin);return o===document.body?(r.style.width=document.documentElement.clientWidth-a[1]-a[3]+"px",r.style.height=document.documentElement.clientHeight-a[0]-a[2]+"px",r.style.left=a[3]+"px",r.style.top=a[0]+"px",t.position.fixed||(r.style.left=window.pageXOffset+a[3]+"px",r.style.top=window.pageYOffset+a[0]+"px")):(r.style.width=o.clientWidth-a[1]-a[3]+"px",r.style.height=o.clientHeight-a[0]-a[2]+"px",r.style.left=a[3]+"px",r.style.top=a[0]+"px"),C.style.transform="unset",r.removeMinimizedReplacement(),r.status="maximized",r.setControls([".jsPanel-btn-maximize"]),n||r.front(),document.dispatchEvent(p),document.dispatchEvent(s),t.onstatuschange&&jsPanel.processCallbacks(r,t.onstatuschange,"every",r.statusBefore),e&&e.call(r,r,r.statusBefore),t.onmaximized&&jsPanel.processCallbacks(r,t.onmaximized,"every",r.statusBefore),r},r.minimize=function(e){if("minimized"===r.status)return r;if(r.statusBefore=r.status,t.onbeforeminimize&&t.onbeforeminimize.length>0&&!jsPanel.processCallbacks(r,t.onbeforeminimize,"some",r.statusBefore))return r;if(document.dispatchEvent(h),!document.getElementById("jsPanel-replacement-container")){var n=document.createElement("div");n.id="jsPanel-replacement-container",document.body.append(n)}if(r.style.left="-9999px",r.status="minimized",document.dispatchEvent(f),document.dispatchEvent(s),t.onstatuschange&&jsPanel.processCallbacks(r,t.onstatuschange,"every",r.statusBefore),t.minimizeTo){var o,a,i,l=r.createMinimizedReplacement();switch(t.minimizeTo){case"default":document.getElementById("jsPanel-replacement-container").append(l);break;case"parentpanel":(o=(i=(a=r.closest(".jsPanel-content").parentElement).querySelectorAll(".jsPanel-minimized-box"))[i.length-1]).append(l);break;case"parent":(o=(a=r.parentElement).querySelector(".jsPanel-minimized-container"))||((o=document.createElement("div")).className="jsPanel-minimized-container",a.append(o)),o.append(l);break;default:document.querySelector(t.minimizeTo).append(l)}}return e&&e.call(r,r,r.statusBefore),t.onminimized&&jsPanel.processCallbacks(r,t.onminimized,"every",r.statusBefore),r},r.normalize=function(e){return"normalized"===r.status?r:(r.statusBefore=r.status,t.onbeforenormalize&&t.onbeforenormalize.length>0&&!jsPanel.processCallbacks(r,t.onbeforenormalize,"some",r.statusBefore)?r:(document.dispatchEvent(l),r.style.width=r.currentData.width,r.style.height=r.currentData.height,r.snapped?r.snap(r.snapped,!0):(r.style.left=r.currentData.left,r.style.top=r.currentData.top),C.style.transform="unset",r.removeMinimizedReplacement(),r.status="normalized",r.setControls([".jsPanel-btn-normalize"]),r.front(),document.dispatchEvent(c),document.dispatchEvent(s),t.onstatuschange&&jsPanel.processCallbacks(r,t.onstatuschange,"every",r.statusBefore),e&&e.call(r,r,r.statusBefore),t.onnormalized&&jsPanel.processCallbacks(r,t.onnormalized,"every",r.statusBefore),r))},r.smallify=function(e){if("smallified"===r.status||"smallifiedmax"===r.status)return r;if(r.statusBefore=r.status,t.onbeforesmallify&&t.onbeforesmallify.length>0&&!jsPanel.processCallbacks(r,t.onbeforesmallify,"some",r.statusBefore))return r;document.dispatchEvent(u),r.style.overflow="hidden";var n=window.getComputedStyle(r),o=parseFloat(window.getComputedStyle(r.headerbar).height);r.style.height=parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth)+o+"px",C.style.transform="rotate(180deg)","normalized"===r.status?(r.setControls([".jsPanel-btn-normalize"]),r.status="smallified",document.dispatchEvent(m),document.dispatchEvent(s),t.onstatuschange&&jsPanel.processCallbacks(r,t.onstatuschange,"every",r.statusBefore)):"maximized"===r.status&&(r.setControls([".jsPanel-btn-maximize"]),r.status="smallifiedmax",document.dispatchEvent(g),document.dispatchEvent(s),t.onstatuschange&&jsPanel.processCallbacks(r,t.onstatuschange,"every",r.statusBefore));var a=r.querySelectorAll(".jsPanel-minimized-box");return a[a.length-1].style.display="none",e&&e.call(r,r,r.statusBefore),t.onsmallified&&jsPanel.processCallbacks(r,t.onsmallified,"every",r.statusBefore),r},r.unsmallify=function(e){if(r.statusBefore=r.status,"smallified"===r.status||"smallifiedmax"===r.status){if(t.onbeforeunsmallify&&t.onbeforeunsmallify.length>0&&!jsPanel.processCallbacks(r,t.onbeforeunsmallify,"some",r.statusBefore))return r;document.dispatchEvent(b),r.style.overflow="visible",r.front(),"smallified"===r.status?(r.style.height=r.currentData.height,r.setControls([".jsPanel-btn-normalize"]),r.status="normalized",document.dispatchEvent(c),document.dispatchEvent(s),t.onstatuschange&&jsPanel.processCallbacks(r,t.onstatuschange,"every",r.statusBefore)):"smallifiedmax"===r.status?r.maximize():"minimized"===r.status&&r.normalize(),C.style.transform="rotate(0deg)";var n=r.querySelectorAll(".jsPanel-minimized-box");n[n.length-1].style.display="flex",e&&e.call(r,r,r.statusBefore),t.onunsmallified&&jsPanel.processCallbacks(r,t.onunsmallified,"every",r.statusBefore)}return r},r.front=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("minimized"===r.status)"maximized"===r.statusBefore?r.maximize():r.normalize();else{var o=Array.prototype.slice.call(document.querySelectorAll(".jsPanel-standard")).map(function(e){return e.style.zIndex});Math.max.apply(Math,_toConsumableArray(o))>r.style.zIndex&&(r.style.zIndex=jsPanel.zi.next()),jsPanel.resetZi()}return document.dispatchEvent(y),e&&e.call(r,r),t.onfronted&&n&&jsPanel.processCallbacks(r,t.onfronted,"every",r.status),r},r.snap=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t||(r.currentData.beforeSnap={width:r.currentData.width,height:r.currentData.height}),e&&"function"==typeof e&&!t)e.call(r,r,r.snappableTo);else if(!1!==e){var n=[0,0];if(r.options.dragit.snap.containment&&r.options.dragit.containment){var o=jsPanel.pOcontainment(r.options.dragit.containment),a=r.snappableTo;a.startsWith("left")?n[0]=o[3]:a.startsWith("right")&&(n[0]=-o[1]),a.endsWith("top")?n[1]=o[0]:a.endsWith("bottom")&&(n[1]=-o[2])}r.reposition("".concat(r.snappableTo," ").concat(n[0]," ").concat(n[1]))}t||(r.snapped=r.snappableTo)},r.move=function(e,t){var n=r.overlaps(e,"paddingbox"),o=r.parentElement;return e.appendChild(r),r.options.container=e,r.style.left=n.left+"px",r.style.top=n.top+"px",r.saveCurrentDimensions(),r.saveCurrentPosition(),r.calcSizeFactors(),t&&t.call(r,r,e,o),r},r.closeChildpanels=function(e){return r.getChildpanels().forEach(function(e){return e.close()}),e&&e.call(r,r),r},r.getChildpanels=function(e){var t=r.content.querySelectorAll(".jsPanel");return e&&t.forEach(function(t,n,o){e.call(t,t,n,o)}),t},r.isChildpanel=function(e){var t=r.closest(".jsPanel-content"),n=t?t.parentElement:null;return e&&e.call(r,r,n),!!t&&n},r.contentRemove=function(e){return jsPanel.emptyNode(r.content),e&&e.call(r,r),r},r.createMinimizedReplacement=function(){var e=jsPanel.createMinimizedTemplate(),n=window.getComputedStyle(r.headertitle).color,o=window.getComputedStyle(r),a=t.iconfont,i=e.querySelector(".jsPanel-controlbar");return"auto-show-hide"!==r.options.header?jsPanel.setStyle(e,{backgroundColor:o.backgroundColor,backgroundPositionX:o.backgroundPositionX,backgroundPositionY:o.backgroundPositionY,backgroundRepeat:o.backgroundRepeat,backgroundAttachment:o.backgroundAttachment,backgroundImage:o.backgroundImage,backgroundSize:o.backgroundSize,backgroundOrigin:o.backgroundOrigin,backgroundClip:o.backgroundClip}):e.style.backgroundColor=window.getComputedStyle(r.header).backgroundColor,e.id=r.id+"-min",e.querySelector(".jsPanel-headerbar").replaceChild(r.headerlogo.cloneNode(!0),e.querySelector(".jsPanel-headerlogo")),e.querySelector(".jsPanel-titlebar").replaceChild(r.headertitle.cloneNode(!0),e.querySelector(".jsPanel-title")),e.querySelector(".jsPanel-titlebar").setAttribute("title",r.headertitle.textContent),e.querySelector(".jsPanel-title").style.color=n,i.style.color=n,i.querySelectorAll("button").forEach(function(e){e.style.color=n}),["jsPanel-hdr-dark","jsPanel-hdr-light"].forEach(function(t){r.header.classList.contains(t)&&e.querySelector(".jsPanel-hdr").classList.add(t)}),r.setIconfont(a,e),"onpointerdown"in window&&e.querySelectorAll(".jsPanel-btn").forEach(function(e){e.addEventListener("pointerdown",function(e){e.preventDefault()},!0)}),"enabled"===r.dataset.btnnormalize?jsPanel.pointerup.forEach(function(t){e.querySelector(".jsPanel-btn-normalize").addEventListener(t,function(){r.normalize()})}):i.querySelector(".jsPanel-btn-normalize").style.display="none","enabled"===r.dataset.btnmaximize?jsPanel.pointerup.forEach(function(t){e.querySelector(".jsPanel-btn-maximize").addEventListener(t,function(){r.maximize()})}):i.querySelector(".jsPanel-btn-maximize").style.display="none","enabled"===r.dataset.btnclose?jsPanel.pointerup.forEach(function(t){e.querySelector(".jsPanel-btn-close").addEventListener(t,function(){r.close(null,!0)})}):i.querySelector(".jsPanel-btn-close").style.display="none",e},r.removeMinimizedReplacement=function(){var e=document.getElementById("".concat(r.id,"-min"));e&&e.parentElement.removeChild(e)},r.dragit=function(e){var n=Object.assign({},jsPanel.defaults.dragit,t.dragit),o=r.querySelectorAll(n.handles);return"disable"===e?o.forEach(function(e){e.style.pointerEvents="none"}):o.forEach(function(e){e.style.pointerEvents="auto"}),r},r.resizeit=function(e){var t=r.querySelectorAll(".jsPanel-resizeit-handle");return"disable"===e?t.forEach(function(e){e.style.pointerEvents="none"}):t.forEach(function(e){e.style.pointerEvents="auto"}),r},r.getScaleFactor=function(){var e=r.getBoundingClientRect();return{x:e.width/r.offsetWidth,y:e.height/r.offsetHeight}},r.calcSizeFactors=function(){var e=window.getComputedStyle(r);if("window"===t.container)r.hf=parseFloat(e.left)/(window.innerWidth-parseFloat(e.width)),r.vf=parseFloat(e.top)/(window.innerHeight-parseFloat(e.height));else if(r.parentElement){var n=r.parentElement.getBoundingClientRect();r.hf=parseFloat(e.left)/(n.width-parseFloat(e.width)),r.vf=parseFloat(e.top)/(n.height-parseFloat(e.height))}},r.saveCurrentDimensions=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=window.getComputedStyle(r);r.currentData.width=t.width,"normalized"===r.status&&(r.currentData.height=t.height),e&&(r.style.height=t.height)},r.saveCurrentPosition=function(){var e=window.getComputedStyle(r);r.currentData.left=e.left,r.currentData.top=e.top},r.reposition=function(){for(var e,n=t.position,o=!0,a=arguments.length,i=new Array(a),s=0;so.left,u=a.topo.top;return{overlaps:f&&u,top:a.top-o.top-l.top,right:o.right-a.right-l.right,bottom:o.bottom-a.bottom-l.bottom,left:a.left-o.left-l.left,parentBorderWidth:l,panelRect:a,referenceRect:o,pointer:{clientX:c,clientY:d,left:p-l.left,top:h-l.top,right:o.width-p-l.right,bottom:o.height-h-l.bottom}}},r.setSize=function(){if(t.panelSize){var e=jsPanel.pOsize(r,t.panelSize);r.style.width=e.width,r.style.height=e.height}else if(t.contentSize){var n=jsPanel.pOsize(r,t.contentSize);r.content.style.width=n.width,r.content.style.height=n.height,r.style.width=n.width,r.content.style.width="100%"}return r},r.resize=function(){for(var e,t=window.getComputedStyle(r),n={width:t.width,height:t.height},o=!0,a=arguments.length,i=new Array(a),s=0;s1&&void 0!==arguments[1]?arguments[1]:"enable",n=arguments.length>2?arguments[2]:void 0,o=r.controlbar.querySelector(".jsPanel-btn-".concat(e));switch(t){case"disable":"removed"!==r.getAttribute("data-btn".concat(e))&&(r.setAttribute("data-btn".concat(e),"disabled"),o.style.pointerEvents="none",o.style.opacity=.4,o.style.cursor="default");break;case"hide":"removed"!==r.getAttribute("data-btn".concat(e))&&(r.setAttribute("data-btn".concat(e),"hidden"),o.style.display="none");break;case"show":"removed"!==r.getAttribute("data-btn".concat(e))&&(r.setAttribute("data-btn".concat(e),"enabled"),o.style.display="block",o.style.pointerEvents="auto",o.style.opacity=1,o.style.cursor="pointer");break;case"enable":"removed"!==r.getAttribute("data-btn".concat(e))&&("hidden"===r.getAttribute("data-btn".concat(e))&&(o.style.display="block"),r.setAttribute("data-btn".concat(e),"enabled"),o.style.pointerEvents="auto",o.style.opacity=1,o.style.cursor="pointer");break;case"remove":r.controlbar.removeChild(o),r.setAttribute("data-btn".concat(e),"removed")}return n&&n.call(r,r),r},r.setControlSize=function(e){var t=e.toLowerCase();r.controlbar.querySelectorAll(".jsPanel-btn").forEach(function(e){["jsPanel-btn-xl","jsPanel-btn-lg","jsPanel-btn-md","jsPanel-btn-sm","jsPanel-btn-xs"].forEach(function(t){e.classList.remove(t)}),e.classList.add("jsPanel-btn-".concat(t))}),"xl"===t?r.titlebar.style.fontSize="1.5rem":"lg"===t?r.titlebar.style.fontSize="1.25rem":"md"===t?r.titlebar.style.fontSize="1.05rem":"sm"===t?r.titlebar.style.fontSize=".9rem":"xs"===t&&(r.titlebar.style.fontSize=".8rem")},r.setHeaderControls=function(e){if(r.options.headerControls.add){var n=r.options.headerControls.add;Array.isArray(n)||(n=[n]),n.forEach(function(e){r.addControl(e)})}var o=[];r.controlbar.querySelectorAll(".jsPanel-btn").forEach(function(e){var t=e.className.match(/jsPanel-btn-[a-z0-9]{3,}/i)[0].substring(12);o.push(t)});var a=jsPanel.pOheaderControls(t.headerControls);return t.headerControls=a,o.forEach(function(e){a[e]&&r.setControlStatus(e,a[e])}),r.setControlSize(a.size),e&&e.call(r,r),r},r.setHeaderLogo=function(e,t){var n=[r.headerlogo],o=document.querySelector("#"+r.id+"-min");return o&&n.push(o.querySelector(".jsPanel-headerlogo")),"string"==typeof e?"<"!==e.substr(0,1)?n.forEach(function(t){jsPanel.emptyNode(t);var n=document.createElement("img");n.src=e,t.append(n)}):n.forEach(function(t){t.innerHTML=e}):n.forEach(function(t){jsPanel.emptyNode(t),t.append(e)}),r.headerlogo.childNodes.forEach(function(e){e.nodeName&&"IMG"===e.nodeName&&e.setAttribute("draggable","false")}),t&&t.call(r,r),r},r.setHeaderRemove=function(e){return r.removeChild(r.header),r.content.classList.add("jsPanel-content-noheader"),["close","maximize","normalize","minimize","smallify"].forEach(function(e){r.setAttribute("data-btn".concat(e),"removed")}),e&&e.call(r,r),r},r.setHeaderTitle=function(e,t){var n=[r.headertitle],o=document.querySelector("#"+r.id+"-min");return o&&n.push(o.querySelector(".jsPanel-title")),"string"==typeof e?n.forEach(function(t){t.innerHTML=e}):"function"==typeof e?n.forEach(function(t){jsPanel.emptyNode(t),t.innerHTML=e()}):n.forEach(function(t){jsPanel.emptyNode(t),t.append(e)}),t&&t.call(r,r),r},r.setIconfont=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,n=arguments.length>2?arguments[2]:void 0;if(!1!==e){var o,a;if("fa"===e||"far"===e||"fal"===e||"fas"===e||"fad"===e)o=["".concat(e," fa-window-close"),"".concat(e," fa-window-maximize"),"".concat(e," fa-window-restore"),"".concat(e," fa-window-minimize"),"".concat(e," fa-chevron-up")];else if("material-icons"===e)o=[e,e,e,e,e,e],a=["close","fullscreen","fullscreen_exit","call_received","expand_less"];else if(Array.isArray(e))o=["custom-control-icon ".concat(e[4]),"custom-control-icon ".concat(e[3]),"custom-control-icon ".concat(e[2]),"custom-control-icon ".concat(e[1]),"custom-control-icon ".concat(e[0])];else{if("bootstrap"!==e&&"glyphicon"!==e)return t;o=["glyphicon glyphicon-remove","glyphicon glyphicon-fullscreen","glyphicon glyphicon-resize-full","glyphicon glyphicon-minus","glyphicon glyphicon-chevron-up"]}t.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(function(e){jsPanel.emptyNode(e).innerHTML=""}),Array.prototype.slice.call(t.querySelectorAll(".jsPanel-controlbar .jsPanel-btn > span")).reverse().forEach(function(t,n){t.className=o[n],"material-icons"===e&&(t.textContent=a[n])})}return n&&n.call(t,t),t},r.addToolbar=function(e,t,n){if("header"===e?e=r.headertoolbar:"footer"===e&&(e=r.footer),"string"==typeof t)e.innerHTML=t;else if(Array.isArray(t))t.forEach(function(t){"string"==typeof t?e.innerHTML+=t:e.append(t)});else if("function"==typeof t){var o=t.call(r,r);"string"==typeof o?e.innerHTML=o:e.append(o)}else e.append(t);return e.classList.add("active"),n&&n.call(r,r),r},r.addCloseControl=function(){var e=document.createElement("button"),t=r.content.style.color;return e.classList.add("jsPanel-addCloseCtrl"),e.innerHTML=jsPanel.icons.close,e.style.color=t,r.options.rtl&&e.classList.add("rtl"),r.appendChild(e),jsPanel.pointerup.forEach(function(t){e.addEventListener(t,function(e){if(e.preventDefault(),e.button&&e.button>0)return!1;r.close(null,!0)})}),jsPanel.pointerdown.forEach(function(t){e.addEventListener(t,function(e){e.preventDefault()})}),r},r.addControl=function(e){if(!e.html)return r;e.position||(e.position=1);var n=r.controlbar.querySelectorAll(".jsPanel-btn").length,o=document.createElement("button");o.innerHTML=e.html,o.className="jsPanel-btn jsPanel-btn-".concat(e.name," jsPanel-btn-").concat(t.headerControls.size),o.style.color=r.header.style.color,e.position>n?r.controlbar.append(o):r.controlbar.insertBefore(o,r.querySelector(".jsPanel-controlbar .jsPanel-btn:nth-child(".concat(e.position,")")));var a=e.ariaLabel||e.name;return a&&o.setAttribute("aria-label",a),jsPanel.pointerup.forEach(function(t){o.addEventListener(t,function(t){if(t.preventDefault(),t.button&&t.button>0)return!1;e.handler.call(r,r,o)})}),e.afterInsert&&e.afterInsert.call(o,o),r},r.setRtl=function(){[r.header,r.content,r.footer].forEach(function(e){e.dir="rtl",t.rtl.lang&&(e.lang=t.rtl.lang)})},r.id=t.id,r.classList.add("jsPanel-"+t.paneltype),"standard"===t.paneltype&&(r.style.zIndex=this.zi.next()),a.append(r),r.front(!1,!1),r.setTheme(t.theme),t.boxShadow&&r.classList.add("jsPanel-depth-".concat(t.boxShadow)),t.header){if(t.headerLogo&&r.setHeaderLogo(t.headerLogo),r.setIconfont(t.iconfont),r.setHeaderTitle(t.headerTitle),r.setHeaderControls(),jsPanel.isIE){var A=[r.headerbar,r.controlbar];switch(r.options.headerControls.size){case"md":A.forEach(function(e){e.style.height="34px"});break;case"xs":A.forEach(function(e){e.style.height="26px"});break;case"sm":A.forEach(function(e){e.style.height="30px"});break;case"lg":A.forEach(function(e){e.style.height="38px"});break;case"xl":A.forEach(function(e){e.style.height="42px"})}}if("auto-show-hide"===t.header){var k="jsPanel-depth-"+t.boxShadow;r.header.style.opacity=0,r.style.backgroundColor="transparent",this.remClass(r,k),this.setClass(r.content,k),r.header.addEventListener("mouseenter",function(){r.header.style.opacity=1,jsPanel.setClass(r,k),jsPanel.remClass(r.content,k)}),r.header.addEventListener("mouseleave",function(){r.header.style.opacity=0,jsPanel.remClass(r,k),jsPanel.setClass(r.content,k)})}}else r.setHeaderRemove(),t.addCloseControl&&r.addCloseControl();if(t.headerToolbar&&r.addToolbar(r.headertoolbar,t.headerToolbar),t.footerToolbar&&r.addToolbar(r.footer,t.footerToolbar),t.border&&r.setBorder(t.border),t.borderRadius&&r.setBorderRadius(t.borderRadius),t.content&&("function"==typeof t.content?t.content.call(r,r):"string"==typeof t.content?r.content.innerHTML=t.content:r.content.append(t.content)),t.contentAjax&&this.ajax(r,t.contentAjax),t.contentFetch&&this.fetch(r),t.contentOverflow){var B=t.contentOverflow.split(" ");1===B.length?r.content.style.overflow=B[0]:2===B.length&&(r.content.style.overflowX=B[0],r.content.style.overflowY=B[1])}if(t.autoclose){"number"==typeof t.autoclose?t.autoclose={time:t.autoclose+"ms"}:"string"==typeof t.autoclose&&(t.autoclose={time:t.autoclose});var T=Object.assign({},jsPanel.defaultAutocloseConfig,t.autoclose);T.time&&"number"==typeof T.time&&(T.time+="ms");var L=r.autocloseProgressbar.querySelector("div");L.addEventListener("animationend",function(e){e.stopPropagation(),r.close()}),T.progressbar&&(r.autocloseProgressbar.style.height="3px",T.background?jsPanel.themes.indexOf(T.background)>-1?r.autocloseProgressbar.classList.add(T.background+"-bg"):jsPanel.colorNames[T.background]?r.autocloseProgressbar.style.background="#"+jsPanel.colorNames[T.background]:r.autocloseProgressbar.style.background=T.background:r.autocloseProgressbar.classList.add("success-bg")),L.style.animation="".concat(T.time," progressbar")}if(t.rtl&&r.setRtl(),r.setSize(),r.status="normalized",t.position?this.position(r,t.position):r.style.opacity=1,document.dispatchEvent(c),r.calcSizeFactors(),t.animateIn&&(r.addEventListener("animationend",function(){e.remClass(r,t.animateIn)}),this.setClass(r,t.animateIn)),t.syncMargins){var R=this.pOcontainment(t.maximizedMargin);t.dragit&&(t.dragit.containment=R,!0===t.dragit.snap?(t.dragit.snap=jsPanel.defaultSnapConfig,t.dragit.snap.containment=!0):t.dragit.snap&&(t.dragit.snap.containment=!0)),t.resizeit&&(t.resizeit.containment=R)}if(t.dragit?(["start","drag","stop"].forEach(function(e){t.dragit[e]?"function"==typeof t.dragit[e]&&(t.dragit[e]=[t.dragit[e]]):t.dragit[e]=[]}),this.dragit(r,t.dragit),r.addEventListener("jspaneldragstop",function(e){e.panel===r&&r.calcSizeFactors()},!1)):r.titlebar.style.cursor="default",t.resizeit){["start","resize","stop"].forEach(function(e){t.resizeit[e]?"function"==typeof t.resizeit[e]&&(t.resizeit[e]=[t.resizeit[e]]):t.resizeit[e]=[]}),this.resizeit(r,t.resizeit);var D=void 0;r.addEventListener("jspanelresizestart",function(e){e.panel===r&&(D=r.status)},!1),r.addEventListener("jspanelresizestop",function(e){e.panel===r&&("smallified"===D||"smallifiedmax"===D||"maximized"===D)&&parseFloat(r.style.height)>parseFloat(window.getComputedStyle(r.header).height)&&(r.setControls([".jsPanel-btn-normalize"]),r.status="normalized",document.dispatchEvent(c),document.dispatchEvent(s),t.onstatuschange&&jsPanel.processCallbacks(r,t.onstatuschange,"every"),r.calcSizeFactors())},!1)}if(r.saveCurrentDimensions(!0),r.saveCurrentPosition(),t.setStatus&&("smallifiedmax"===t.setStatus?r.maximize().smallify():"smallified"===t.setStatus?r.smallify():r[t.setStatus.substr(0,t.setStatus.length-1)]()),this.pointerdown.forEach(function(e){r.addEventListener(e,function(e){e.target.closest(".jsPanel-btn-close")||e.target.closest(".jsPanel-btn-minimize")||"standard"!==t.paneltype||r.front()},!1)}),t.onwindowresize){var W=t.onwindowresize;"window"===r.options.container&&window.addEventListener("resize",function(e){if(e.target===window){var t,n,o=r.status;"maximized"===o&&W?r.maximize(!1,!0):r.snapped&&"minimized"!==o?r.snap(r.snapped,!0):"normalized"===o||"smallified"===o||"maximized"===o?"function"==typeof W?W.call(r,e,r):(t=(window.innerWidth-r.offsetWidth)*r.hf,r.style.left=t<=0?0:t+"px",n=(window.innerHeight-r.offsetHeight)*r.vf,r.style.top=n<=0?0:n+"px"):"smallifiedmax"===o&&W&&r.maximize(!1,!0).smallify()}},!1)}if(t.onparentresize){var q=t.onparentresize,M=r.isChildpanel();if(M){var O=M.content,I=[];document.addEventListener("jspanelresize",function(e){if(e.panel===M){I[0]=O.offsetWidth,I[1]=O.offsetHeight;var t,n,o=r.status;"maximized"===o&&q?r.maximize():r.snapped&&"minimized"!==o?r.snap(r.snapped,!0):"normalized"===o||"smallified"===o||"maximized"===o?"function"==typeof q?q.call(r,r,{width:I[0],height:I[1]}):(t=(I[0]-r.offsetWidth)*r.hf,r.style.left=t<=0?0:t+"px",n=(I[1]-r.offsetHeight)*r.vf,r.style.top=n<=0?0:n+"px"):"smallifiedmax"===o&&q&&r.maximize().smallify()}},!1)}}return this.globalCallbacks&&(Array.isArray(this.globalCallbacks)?this.globalCallbacks.forEach(function(e){e.call(r,r)}):this.globalCallbacks.call(r,r)),t.callback&&(Array.isArray(t.callback)?t.callback.forEach(function(e){e.call(r,r)}):t.callback.call(r,r)),n&&n.call(r,r),document.dispatchEvent(i),r}};"undefined"!=typeof module&&(module.exports=jsPanel); \ No newline at end of file +"use strict";function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t',maximize:'',normalize:'',minimize:'',smallify:''},idCounter:0,isIE:navigator.appVersion.match(/Trident/),pointerdown:"onpointerdown"in window?["pointerdown"]:"ontouchend"in window?["touchstart","mousedown"]:["mousedown"],pointermove:"onpointermove"in window?["pointermove"]:"ontouchend"in window?["touchmove","mousemove"]:["mousemove"],pointerup:"onpointerup"in window?["pointerup"]:"ontouchend"in window?["touchend","mouseup"]:["mouseup"],polyfills:(Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var t=Object(e),n=1;n=0&&n.item(t)!==o;);}while(t<0&&(o=o.parentElement));return o}),function(){if("function"==typeof window.CustomEvent)return!1;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}e.prototype=window.Event.prototype,window.CustomEvent=e}(),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){return tthis.length)&&-1!==this.indexOf(e,t)}),Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},void(Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');var n=Object(this),o=n.length>>>0;if(0===o)return!1;for(var a,r,i=0|t,s=Math.max(i>=0?i:o-Math.abs(i),0);s1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;o=i(l,s,e+1/3),a=i(l,s,e),r=i(l,s,e-1/3)}return[Math.round(255*o),Math.round(255*a),Math.round(255*r)]},rgbToHsl:function(e,t,n){e/=255,t/=255,n/=255;var o,a,r=Math.max(e,t,n),i=Math.min(e,t,n),s=(r+i)/2;if(r===i)o=a=0;else{var l=r-i;switch(a=s>.5?l/(2-r-i):l/(r+i),r){case e:o=(t-n)/l+(t=0&&(h=this.applyPositionAutopos(e,h,t)),(t.offsetX||t.offsetY)&&(h=this.applyPositionOffset(e,h,t)),(t.minLeft||t.minTop||t.maxLeft||t.maxTop)&&(h=this.applyPositionMinMax(e,h,t)),t.modify&&(h=this.applyPositionModify(e,h,t)),e.style.opacity=1,e},applyPositionAutopos:function(e,t,n){var o="".concat(n.my,"-").concat(n.autoposition.toLowerCase());e.classList.add(o);var a=Array.prototype.slice.call(document.querySelectorAll(".".concat(o))),r=a.indexOf(e);if(a.length>1){switch(n.autoposition){case"down":case"up":a.forEach(function(e,n){n>0&&n<=r&&(t.top=parseFloat(t.top)+a[--n].getBoundingClientRect().height+jsPanel.autopositionSpacing+"px")});break;case"right":a.forEach(function(e,n){n>0&&n<=r&&(t.left=parseFloat(t.left)+a[--n].getBoundingClientRect().width+jsPanel.autopositionSpacing+"px")});break;case"left":a.forEach(function(e,n){n>0&&n<=r&&(t.left=parseFloat(t.left)-a[--n].getBoundingClientRect().width+jsPanel.autopositionSpacing+"px")})}e.style.left=t.left,e.style.top=t.top}return{left:t.left,top:t.top}},applyPositionOffset:function(e,t,n){["offsetX","offsetY"].forEach(function(e){n[e]?("function"==typeof n[e]&&(n[e]=n[e].call(t,t,n)),!1===isNaN(n[e])&&(n[e]="".concat(n[e],"px"))):n[e]="0px"}),e.style.left="calc(".concat(e.style.left," + ").concat(n.offsetX,")"),e.style.top="calc(".concat(e.style.top," + ").concat(n.offsetY,")");var o=getComputedStyle(e);return{left:o.left,top:o.top}},applyPositionMinMax:function(e,t,n){if(["minLeft","minTop","maxLeft","maxTop"].forEach(function(e){n[e]&&("function"==typeof n[e]&&(n[e]=n[e].call(t,t,n)),(Number.isInteger(n[e])||n[e].match(/^\d+$/))&&(n[e]="".concat(n[e],"px")))}),n.minLeft){e.style.left=n.minLeft;var o=getComputedStyle(e).left;parseFloat(o)parseFloat(t.left)?e.style.left=t.left:t.left=r}if(n.maxTop){e.style.top=n.maxTop;var i=getComputedStyle(e).top;parseFloat(i)>parseFloat(t.top)?e.style.top=t.top:t.top=i}var s=getComputedStyle(e);return{left:s.left,top:s.top}},applyPositionModify:function(e,t,n){if(n.modify&&"function"==typeof n.modify){var o=n.modify.call(t,t,n);e.style.left=Number.isInteger(o.left)||o.left.match(/^\d+$/)?"".concat(o.left,"px"):o.left,e.style.top=Number.isInteger(o.top)||o.top.match(/^\d+$/)?"".concat(o.top,"px"):o.top}var a=getComputedStyle(e);return{left:a.left,top:a.top}},autopositionRemaining:function(e){var t;(["left-top-down","left-top-right","center-top-down","right-top-down","right-top-left","left-bottom-up","left-bottom-right","center-bottom-up","right-bottom-up","right-bottom-left"].forEach(function(n){e.classList.contains(n)&&(t=n)}),t)&&("window"===e.options.container?document.body:e.options.container).querySelectorAll(".".concat(t)).forEach(function(e){e.reposition()})},addScript:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text/javascript",n=arguments.length>2?arguments[2]:void 0;if(!document.querySelector('script[src="'.concat(e,'"]'))){var o=document.createElement("script");n&&(o.onload=n),o.src=e,o.type=t,document.head.appendChild(o)}},ajax:function ajax(obj,ajaxConfig){var objIsPanel;"object"===_typeof(obj)&&obj.classList.contains("jsPanel")?objIsPanel=!0:(objIsPanel=!1,"string"==typeof obj&&(obj=document.querySelector(obj)));var configDefaults={method:"GET",async:!0,user:"",pwd:"",done:function(){objIsPanel?obj.content.innerHTML=this.responseText:obj.innerHTML=this.responseText},autoresize:!0,autoreposition:!0},config;if("string"==typeof ajaxConfig)config=Object.assign({},configDefaults,{url:encodeURI(ajaxConfig),evalscripttags:!0});else{if("object"!==_typeof(ajaxConfig)||!ajaxConfig.url){if(this.errorReporting)try{throw new jsPanel.jsPanelError("XMLHttpRequest seems to miss the url parameter!")}catch(e){jsPanel.error(e)}return obj}config=Object.assign({},configDefaults,ajaxConfig),config.url=encodeURI(ajaxConfig.url),!1===config.async&&(config.timeout=0,config.withCredentials&&(config.withCredentials=void 0),config.responseType&&(config.responseType=void 0))}var xhr=new XMLHttpRequest;return xhr.onreadystatechange=function(){if(4===xhr.readyState){if(200===xhr.status){if(config.done.call(xhr,obj),config.evalscripttags){var scripttags=xhr.responseText.match(/]*>([\s\S]*?)<\/script>/gi);scripttags&&scripttags.forEach(function(tag){var js=tag.replace(/]*>/i,"").replace(/<\/script>/i,"").trim();eval(js)})}}else config.fail&&config.fail.call(xhr,obj);if(config.always&&config.always.call(xhr,obj),objIsPanel){var oContentSize=obj.options.contentSize;if("string"==typeof oContentSize&&oContentSize.match(/auto/i)){var parts=oContentSize.split(" "),sizes=Object.assign({},{width:parts[0],height:parts[1]});config.autoresize&&obj.resize(sizes),obj.classList.contains("jsPanel-contextmenu")||config.autoreposition&&obj.reposition()}else if("object"===_typeof(oContentSize)&&("auto"===oContentSize.width||"auto"===oContentSize.height)){var _sizes=Object.assign({},oContentSize);config.autoresize&&obj.resize(_sizes),obj.classList.contains("jsPanel-contextmenu")||config.autoreposition&&obj.reposition()}}jsPanel.ajaxAlwaysCallbacks.length&&jsPanel.ajaxAlwaysCallbacks.forEach(function(e){e.call(obj,obj)})}},xhr.open(config.method,config.url,config.async,config.user,config.pwd),xhr.timeout=config.timeout||0,config.withCredentials&&(xhr.withCredentials=config.withCredentials),config.responseType&&(xhr.responseType=config.responseType),config.beforeSend&&config.beforeSend.call(xhr),config.data?xhr.send(config.data):xhr.send(null),obj},createPanelTemplate:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=document.createElement("div");return t.className="jsPanel",t.style.left="0",t.style.top="0",e&&["close","maximize","normalize","minimize","smallify"].forEach(function(e){t.setAttribute("data-btn".concat(e),"enabled")}),t.innerHTML='
\n
\n \n
\n \n
\n
\n \n \n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
'),t},createMinimizedTemplate:function(){var e=document.createElement("div");return e.className="jsPanel-replacement",e.innerHTML='
\n
\n \n
\n \n
\n
\n \n \n \n
\n
\n
"),e},createSnapArea:function(e,t,n){var o=document.createElement("div"),a=e.parentElement;o.className="jsPanel-snap-area jsPanel-snap-area-".concat(t),"lt"===t||"rt"===t||"rb"===t||"lb"===t?(o.style.width=n+"px",o.style.height=n+"px"):"ct"===t||"cb"===t?o.style.height=n+"px":"lc"!==t&&"rc"!==t||(o.style.width=n+"px"),a!==document.body&&(o.style.position="absolute"),document.querySelector(".jsPanel-snap-area.jsPanel-snap-area-".concat(t))||e.parentElement.appendChild(o)},dragit:function(e){var t,n,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new CustomEvent("jspaneldragstart",{detail:e.id}),i=new CustomEvent("jspaneldrag",{detail:e.id}),s=new CustomEvent("jspaneldragstop",{detail:e.id});[r,i,s].forEach(function(t){t.panel=e});var l=function(e){var t=e.split("-");return t.forEach(function(e,n){t[n]=e.charAt(0).toUpperCase()+e.slice(1)}),"snap"+t.join("")},c=a.handles||this.defaults.dragit.handles,d=a.cursor||this.defaults.dragit.cursor;return e.querySelectorAll(c).forEach(function(c){c.style.touchAction="none",c.style.cursor=d,jsPanel.pointerdown.forEach(function(s){c.addEventListener(s,function(s){if(s.button&&s.button>0)return!1;if((o=Object.assign({},jsPanel.defaults.dragit,a)).disableOnMaximized&&"maximized"===e.status)return!1;if((o.containment||0===o.containment)&&(o.containment=jsPanel.pOcontainment(o.containment)),o.grid&&Array.isArray(o.grid)&&1===o.grid.length&&(o.grid[1]=o.grid[0]),o.snap&&("object"===_typeof(o.snap)?o.snap=Object.assign({},jsPanel.defaultSnapConfig,o.snap):o.snap=jsPanel.defaultSnapConfig),!s.target.closest(".jsPanel-ftr-btn")){e.controlbar.style.pointerEvents="none",e.content.style.pointerEvents="none",document.querySelectorAll("iframe").forEach(function(e){e.style.pointerEvents="none"});var l=window.getComputedStyle(e),c=parseFloat(l.left),d=parseFloat(l.top),p=parseFloat(l.width),h=parseFloat(l.height),f=s.touches?s.touches[0].clientX:s.clientX,u=s.touches?s.touches[0].clientY:s.clientY,m=e.parentElement,g=m.getBoundingClientRect(),b=window.getComputedStyle(m),y=e.getScaleFactor(),v=0;n=function(n){if(n.preventDefault(),!t){if(document.dispatchEvent(r),e.style.opacity=o.opacity,e.snapped&&o.snap.resizeToPreSnap&&e.currentData.beforeSnap){e.resize(e.currentData.beforeSnap.width+" "+e.currentData.beforeSnap.height),e.setControls([".jsPanel-btn-normalize"]);var a=e.getBoundingClientRect(),s=f-(a.left+a.width),l=a.width/2;s>-l&&(v=s+l)}if(e.front(),e.snapped=!1,"maximized"===e.status&&(e.setControls([".jsPanel-btn-normalize"]),e.status="normalized"),o.drop&&o.drop.dropZones){var w=o.drop.dropZones.map(function(e){return jsPanel.pOcontainer(e)}),j=[];w.forEach(function(e){e.length?e.forEach(function(e){j.push(e)}):j.push(e)}),j=j.filter(function(e,t,n){return n.indexOf(e)===t}),o.drop.dropZones=j}o.start.length&&jsPanel.processCallbacks(e,o.start,!1,{left:c,top:d,width:p,height:h},n)}var P,x,E,C,F,z,S,A,k,B;t=1;var T,L=n.touches?n.touches[0].clientX:n.clientX,R=n.touches?n.touches[0].clientY:n.clientY,D=window.getComputedStyle(e);if(m===document.body){var W=e.getBoundingClientRect();k=window.innerWidth-parseInt(b.borderLeftWidth,10)-parseInt(b.borderRightWidth,10)-(W.left+W.width),B=window.innerHeight-parseInt(b.borderTopWidth,10)-parseInt(b.borderBottomWidth,10)-(W.top+W.height)}else k=parseInt(b.width,10)-parseInt(b.borderLeftWidth,10)-parseInt(b.borderRightWidth,10)-(parseInt(D.left,10)+parseInt(D.width,10)),B=parseInt(b.height,10)-parseInt(b.borderTopWidth,10)-parseInt(b.borderBottomWidth,10)-(parseInt(D.top,10)+parseInt(D.height,10));P=parseFloat(D.left),E=parseFloat(D.top),F=k,S=B,o.snap&&("panel"===o.snap.trigger?(x=Math.pow(P,2),C=Math.pow(E,2),z=Math.pow(F,2),A=Math.pow(S,2)):"pointer"===o.snap.trigger&&("window"===e.options.container?(P=L,E=R,F=window.innerWidth-L,S=window.innerHeight-R,x=Math.pow(L,2),C=Math.pow(E,2),z=Math.pow(F,2),A=Math.pow(S,2)):(P=(T=e.overlaps(m,"paddingbox",n)).pointer.left,E=T.pointer.top,F=T.pointer.right,S=T.pointer.bottom,x=Math.pow(T.pointer.left,2),C=Math.pow(T.pointer.top,2),z=Math.pow(T.pointer.right,2),A=Math.pow(T.pointer.bottom,2))));var q=Math.sqrt(x+C),M=Math.sqrt(x+A),O=Math.sqrt(z+C),I=Math.sqrt(z+A),N=Math.abs(P-F)/2,H=Math.abs(E-S)/2,_=Math.sqrt(x+Math.pow(H,2)),X=Math.sqrt(C+Math.pow(N,2)),Y=Math.sqrt(z+Math.pow(H,2)),V=Math.sqrt(A+Math.pow(N,2));if(window.getSelection().removeAllRanges(),document.dispatchEvent(i),o.axis&&"x"!==o.axis||(e.style.left=c+(L-f)/y.x+v+"px"),o.axis&&"y"!==o.axis||(e.style.top=d+(R-u)/y.y+"px"),o.grid){var $=o.grid,Z=o.axis,U=$[0]*Math.round((c+(L-f))/$[0]),G=$[1]*Math.round((d+(R-u))/$[1]);Z&&"x"!==Z||(e.style.left="".concat(U,"px")),Z&&"y"!==Z||(e.style.top="".concat(G,"px"))}if(o.containment||0===o.containment){var J,K,Q=o.containment;if(e.options.container===document.body)J=window.innerWidth-parseFloat(D.width)-Q[1],K=window.innerHeight-parseFloat(D.height)-Q[2];else{var ee=parseFloat(b.borderLeftWidth)+parseFloat(b.borderRightWidth),te=parseFloat(b.borderTopWidth)+parseFloat(b.borderBottomWidth);J=g.width/y.x-parseFloat(D.width)-Q[1]-ee,K=g.height/y.y-parseFloat(D.height)-Q[2]-te}parseFloat(e.style.left)<=Q[3]&&(e.style.left=Q[3]+"px"),parseFloat(e.style.top)<=Q[0]&&(e.style.top=Q[0]+"px"),parseFloat(e.style.left)>=J&&(e.style.left=J+"px"),parseFloat(e.style.top)>=K&&(e.style.top=K+"px")}if(o.drag.length){var ne={left:P,top:E,right:F,bottom:S,width:parseFloat(D.width),height:parseFloat(D.height)};jsPanel.processCallbacks(e,o.drag,!1,ne,n)}if(o.snap){var oe=o.snap.sensitivity,ae=m===document.body?window.innerWidth/8:g.width/8,re=m===document.body?window.innerHeight/8:g.height/8;e.snappableTo=!1,jsPanel.removeSnapAreas(),q0&&T.pointer.top>0?(e.snappableTo="left-top",jsPanel.createSnapArea(e,"lt",oe)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="left-top",jsPanel.createSnapArea(e,"lt",oe))):M0&&T.pointer.bottom>0?(e.snappableTo="left-bottom",jsPanel.createSnapArea(e,"lb",oe)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="left-bottom",jsPanel.createSnapArea(e,"lb",oe))):O0&&T.pointer.top>0?(e.snappableTo="right-top",jsPanel.createSnapArea(e,"rt",oe)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="right-top",jsPanel.createSnapArea(e,"rt",oe))):I0&&T.pointer.bottom>0?(e.snappableTo="right-bottom",jsPanel.createSnapArea(e,"rb",oe)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="right-bottom",jsPanel.createSnapArea(e,"rb",oe))):E0?(e.snappableTo="center-top",jsPanel.createSnapArea(e,"ct",oe)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="center-top",jsPanel.createSnapArea(e,"ct",oe))):P0?(e.snappableTo="left-center",jsPanel.createSnapArea(e,"lc",oe)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="left-center",jsPanel.createSnapArea(e,"lc",oe))):F0?(e.snappableTo="right-center",jsPanel.createSnapArea(e,"rc",oe)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="right-center",jsPanel.createSnapArea(e,"rc",oe))):S0?(e.snappableTo="center-bottom",jsPanel.createSnapArea(e,"cb",oe)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="center-bottom",jsPanel.createSnapArea(e,"cb",oe)))}if(o.drop&&o.drop.dropZones){var ie=jsPanel.isIE?"msElementsFromPoint":"elementsFromPoint",se=document[ie](n.clientX,n.clientY);Array.isArray(se)||(se=Array.prototype.slice.call(se)),o.drop.dropZones.forEach(function(t){se.includes(t)&&(e.droppableTo=t)}),se.includes(e.droppableTo)||(e.droppableTo=!1)}},jsPanel.pointermove.forEach(function(e){document.addEventListener(e,n)}),window.addEventListener("mouseout",function(t){null===t.relatedTarget&&jsPanel.pointermove.forEach(function(t){document.removeEventListener(t,n,!1),e.style.opacity=1})},!1)}})}),jsPanel.pointerup.forEach(function(a){document.addEventListener(a,function(a){if(jsPanel.pointermove.forEach(function(e){document.removeEventListener(e,n)}),jsPanel.removeSnapAreas(),t){if(e.style.opacity=1,t=void 0,o.snap){switch(e.snappableTo){case"left-top":e.snap(o.snap.snapLeftTop);break;case"center-top":e.snap(o.snap.snapCenterTop);break;case"right-top":e.snap(o.snap.snapRightTop);break;case"right-center":e.snap(o.snap.snapRightCenter);break;case"right-bottom":e.snap(o.snap.snapRightBottom);break;case"center-bottom":e.snap(o.snap.snapCenterBottom);break;case"left-bottom":e.snap(o.snap.snapLeftBottom);break;case"left-center":e.snap(o.snap.snapLeftCenter)}o.snap.callback&&e.snappableTo&&"function"==typeof o.snap.callback&&(o.snap.callback.call(e,e),o.snap.repositionOnSnap&&!1!==o.snap[l(e.snappableTo)]&&e.repositionOnSnap(e.snappableTo)),e.snappableTo&&o.snap.repositionOnSnap&&o.snap[l(e.snappableTo)]&&e.repositionOnSnap(e.snappableTo)}if(e.droppableTo&&e.droppableTo!==e.parentElement){var r=e.parentElement;e.move(e.droppableTo),o.drop.callback&&o.drop.callback.call(e,e,e.droppableTo,r)}if(document.dispatchEvent(s),o.stop.length){var i=window.getComputedStyle(e),c={left:parseFloat(i.left),top:parseFloat(i.top),width:parseFloat(i.width),height:parseFloat(i.height)};jsPanel.processCallbacks(e,o.stop,!1,c,a)}e.saveCurrentPosition(),e.calcSizeFactors()}e.controlbar.style.pointerEvents="inherit",e.content.style.pointerEvents="inherit",document.querySelectorAll("iframe").forEach(function(e){e.style.pointerEvents="auto"})})}),a.disable&&(c.style.pointerEvents="none")}),e},emptyNode:function(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e},extend:function(e){if("[object Object]"===Object.prototype.toString.call(e))for(var t in e)e.hasOwnProperty(t)&&(this.extensions[t]=e[t])},fetch:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(obj){var confDefaults={bodyMethod:"text",evalscripttags:!0,autoresize:!0,autoreposition:!0,done:function(e,t){e.content.innerHTML=t}},conf="string"==typeof obj.options.contentFetch?Object.assign({resource:obj.options.contentFetch},confDefaults):Object.assign(confDefaults,obj.options.contentFetch),fetchInit=conf.fetchInit||{};if(!conf.resource){if(this.errorReporting)try{throw new jsPanel.jsPanelError("The Fetch request seems to miss the resource parameter")}catch(e){jsPanel.error(e)}return obj}conf.beforeSend&&conf.beforeSend.call(obj,obj),fetch(conf.resource,fetchInit).then(function(e){if(e.ok)return e[conf.bodyMethod]()}).then(function(response){if(conf.done.call(obj,obj,response),conf.evalscripttags){var scripttags=response.match(/]*>([\s\S]*?)<\/script>/gi);scripttags&&scripttags.forEach(function(tag){var js=tag.replace(/]*>/i,"").replace(/<\/script>/i,"").trim();eval(js)})}var oContentSize=obj.options.contentSize;if(conf.autoresize||conf.autoreposition)if("string"==typeof oContentSize&&oContentSize.match(/auto/i)){var parts=oContentSize.split(" "),sizes=Object.assign({},{width:parts[0],height:parts[1]});conf.autoresize&&obj.resize(sizes),obj.classList.contains("jsPanel-contextmenu")||conf.autoreposition&&obj.reposition()}else if("object"===_typeof(oContentSize)&&("auto"===oContentSize.width||"auto"===oContentSize.height)){var _sizes2=Object.assign({},oContentSize);conf.autoresize&&obj.resize(_sizes2),obj.classList.contains("jsPanel-contextmenu")||conf.autoreposition&&obj.reposition()}})}),getPanels:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return this.classList.contains("jsPanel-standard")};return Array.prototype.slice.call(document.querySelectorAll(".jsPanel")).filter(function(t){return e.call(t,t)}).sort(function(e,t){return t.style.zIndex-e.style.zIndex})},pOcontainer:function(e){if("window"===e)return document.body;if("string"==typeof e){var t=document.querySelectorAll(e);return!!(t.length&&t.length>0)&&t}return 1===e.nodeType?e:!!e.length&&e[0]},pOcontainment:function(e){var t=e;if("function"==typeof e&&(t=e()),"number"==typeof t)return[t,t,t,t];if(Array.isArray(t)){if(1===t.length)return[t[0],t[0],t[0],t[0]];if(2===t.length)return t.concat(t);3===t.length&&(t[3]=t[1])}return t},pOsize:function(e,t){var n=t||this.defaults.contentSize,o=e.parentElement;if("string"==typeof n){var a=n.trim().split(" ");(n={}).width=a[0],2===a.length?n.height=a[1]:n.height=a[0]}else n.width&&!n.height?n.height=n.width:n.height&&!n.width&&(n.width=n.height);if(String(n.width).match(/^[0-9.]+$/gi))n.width+="px";else if("string"==typeof n.width&&n.width.endsWith("%"))if(o===document.body)n.width=window.innerWidth*(parseFloat(n.width)/100)+"px";else{var r=window.getComputedStyle(o),i=parseFloat(r.borderLeftWidth)+parseFloat(r.borderRightWidth);n.width=(parseFloat(r.width)-i)*(parseFloat(n.width)/100)+"px"}else"function"==typeof n.width&&(n.width=n.width.call(e,e),"number"==typeof n.width?n.width+="px":"string"==typeof n.width&&n.width.match(/^[0-9.]+$/gi)&&(n.width+="px"));if(String(n.height).match(/^[0-9.]+$/gi))n.height+="px";else if("string"==typeof n.height&&n.height.endsWith("%"))if(o===document.body)n.height=window.innerHeight*(parseFloat(n.height)/100)+"px";else{var s=window.getComputedStyle(o),l=parseFloat(s.borderTopWidth)+parseFloat(s.borderBottomWidth);n.height=(parseFloat(s.height)-l)*(parseFloat(n.height)/100)+"px"}else"function"==typeof n.height&&(n.height=n.height.call(e,e),"number"==typeof n.height?n.height+="px":"string"==typeof n.height&&n.height.match(/^[0-9.]+$/gi)&&(n.height+="px"));return n},pOborder:function(e){e=e.trim();var t=new Array(3),n=e.match(/\s*(none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset)\s*/gi),o=e.match(/\s*(thin|medium|thick)|(\d*\.?\d+[a-zA-Z]{2,4})\s*/gi);return n?(t[1]=n[0].trim(),e=e.replace(t[1],"")):t[1]="solid",o?(t[0]=o[0].trim(),e=e.replace(t[0],"")):t[0]="medium",t[2]=e.trim(),t},pOheaderControls:function(e){if("string"==typeof e){var t={},n=e.toLowerCase(),o=n.match(/xl|lg|md|sm|xs/),a=n.match(/closeonly|none/);return o&&(t.size=o[0]),a&&(t=Object.assign({},t,{maximize:"remove",normalize:"remove",minimize:"remove",smallify:"remove"}),"none"===a[0]&&(t.close="remove")),Object.assign({},this.defaults.headerControls,t)}return Object.assign({},this.defaults.headerControls,e)},processCallbacks:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"some",o=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;if("function"==typeof t&&(t=[t]),n)return t[n](function(t){return t.call(e,e,o,a)});t.forEach(function(t){t.call(e,e,o,a)})},removeSnapAreas:function(){document.querySelectorAll(".jsPanel-snap-area").forEach(function(e){e.parentElement.removeChild(e)})},remClass:function(e,t){return t.split(" ").forEach(function(t){return e.classList.remove(t)}),e},resetZi:function(){this.zi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:jsPanel.ziBase;return{next:function(){return e++}}}(),Array.prototype.slice.call(document.querySelectorAll(".jsPanel-standard")).sort(function(e,t){return e.style.zIndex-t.style.zIndex}).forEach(function(e){e.style.zIndex=jsPanel.zi.next()})},resizeit:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new CustomEvent("jspanelresizestart",{detail:e.id}),o=new CustomEvent("jspanelresize",{detail:e.id}),a=new CustomEvent("jspanelresizestop",{detail:e.id});[n,o,a].forEach(function(t){t.panel=e});var r,i,s,l,c={};return c.handles=t.handles||jsPanel.defaults.resizeit.handles,c.handles.split(",").forEach(function(t){var n=document.createElement("DIV");n.className="jsPanel-resizeit-handle jsPanel-resizeit-".concat(t.trim()),n.style.zIndex=90,e.append(n)}),e.querySelectorAll(".jsPanel-resizeit-handle").forEach(function(a){jsPanel.pointerdown.forEach(function(d){a.addEventListener(d,function(a){if(a.preventDefault(),a.button&&a.button>0)return!1;var d=1;if(((c=Object.assign({},jsPanel.defaults.resizeit,t)).containment||0===c.containment)&&(c.containment=jsPanel.pOcontainment(c.containment)),c.aspectRatio&&!0===c.aspectRatio&&(c.aspectRatio="panel"),jsPanel.modifier){var p=jsPanel.modifier;"AltLeft"===p||"AltRight"===p?c.aspectRatio="content":"ControlLeft"===p||"ControlRight"===p?c.aspectRatio="panel":"ShiftLeft"!==p&&"ShiftRight"!==p||(d=2)}var h="function"==typeof c.maxWidth?c.maxWidth():c.maxWidth||1e4,f="function"==typeof c.maxHeight?c.maxHeight():c.maxHeight||1e4,u="function"==typeof c.minWidth?c.minWidth():c.minWidth,m="function"==typeof c.minHeight?c.minHeight():c.minHeight;e.content.style.pointerEvents="none",document.querySelectorAll("iframe").forEach(function(e){e.style.pointerEvents="none"});var g=e.parentElement,b=g.tagName.toLowerCase(),y=e.getBoundingClientRect(),v=g.getBoundingClientRect(),w=window.getComputedStyle(g,null),j=parseInt(w.borderLeftWidth,10),P=parseInt(w.borderTopWidth,10),x=w.getPropertyValue("position"),E=a.clientX||a.touches[0].clientX,C=a.clientY||a.touches[0].clientY,F=E/C,z=y.width,S=y.height,A=a.target.classList,k=e.getScaleFactor(),B=y.width/y.height,T=e.content.getBoundingClientRect(),L=T.width/T.height,R=e.header.getBoundingClientRect().height,D=e.footer.getBoundingClientRect().height||0,W=y.left,q=y.top,M=1e4,O=1e4,I=1e4,N=1e4;"body"!==b&&(W=y.left-v.left+g.scrollLeft,q=y.top-v.top+g.scrollTop),"body"===b&&c.containment?(M=document.documentElement.clientWidth-y.left,I=document.documentElement.clientHeight-y.top,O=y.width+y.left,N=y.height+y.top):c.containment&&("static"===x?(M=v.width-y.left+j,I=v.height+v.top-y.top+P,O=y.width+(y.left-v.left)-j,N=y.height+(y.top-v.top)-P):(M=g.clientWidth-(y.left-v.left)/k.x+j,I=g.clientHeight-(y.top-v.top)/k.y+P,O=(y.width+y.left-v.left)/k.x-j,N=e.clientHeight+(y.top-v.top)/k.y-P)),c.containment&&(O-=c.containment[3],N-=c.containment[0],M-=c.containment[1],I-=c.containment[2]);var H=window.getComputedStyle(e),_=parseFloat(H.width)-y.width,X=parseFloat(H.height)-y.height,Y=parseFloat(H.left)-y.left,V=parseFloat(H.top)-y.top;g!==document.body&&(Y+=v.left,V+=v.top);var $=parseInt(H.borderTopWidth,10),Z=parseInt(H.borderRightWidth,10),U=parseInt(H.borderBottomWidth,10),G=parseInt(H.borderLeftWidth,10);r=function(t){i||(document.dispatchEvent(n),c.start.length&&jsPanel.processCallbacks(e,c.start,!1,{width:z,height:S,left:W,top:q},t),e.front(),e.status="normalized",e.setControls([".jsPanel-btn-normalize"])),i=1,document.dispatchEvent(o);var a=t.touches?t.touches[0].clientX:t.clientX,r=t.touches?t.touches[0].clientY:t.clientY;A.contains("jsPanel-resizeit-e")?((s=z+(a-E)*d/k.x+_)>=M&&(s=M),s>=h&&(s=h),s<=u&&(s=u),e.style.width=s+"px",2===d&&(e.style.left=W-(a-E)+"px"),"content"===c.aspectRatio?(e.style.height=(s-Z-G)/L+R+D+$+U+"px",c.containment&&e.overlaps(g).bottom<=c.containment[2]&&(e.style.height=I+"px",e.style.width=I*L+"px")):"panel"===c.aspectRatio&&(e.style.height=s/B+"px",c.containment&&e.overlaps(g).bottom<=c.containment[2]&&(e.style.height=I+"px",e.style.width=I*B+"px"))):A.contains("jsPanel-resizeit-s")?((l=S+(r-C)*d/k.y+X)>=I&&(l=I),l>=f&&(l=f),l<=m&&(l=m),e.style.height=l+"px",2===d&&(e.style.top=q-(r-C)+"px"),"content"===c.aspectRatio?(e.style.width=(l-R-D-$-U)*L+$+U+"px",c.containment&&e.overlaps(g).right<=c.containment[1]&&(e.style.width=M+"px",e.style.height=M/L+"px")):"panel"===c.aspectRatio&&(e.style.width=l*B+"px",c.containment&&e.overlaps(g).right<=c.containment[1]&&(e.style.width=M+"px",e.style.height=M/B+"px"))):A.contains("jsPanel-resizeit-w")?((s=z+(E-a)*d/k.x+_)<=h&&s>=u&&s<=O&&(e.style.left=W+(a-E)/k.x+Y+"px"),s>=O&&(s=O),s>=h&&(s=h),s<=u&&(s=u),e.style.width=s+"px","content"===c.aspectRatio?(e.style.height=(s-Z-G)/L+R+D+$+U+"px",c.containment&&e.overlaps(g).bottom<=c.containment[2]&&(e.style.height=I+"px",e.style.width=I*L+"px")):"panel"===c.aspectRatio&&(e.style.height=s/B+"px",c.containment&&e.overlaps(g).bottom<=c.containment[2]&&(e.style.height=I+"px",e.style.width=I*B+"px"))):A.contains("jsPanel-resizeit-n")?((l=S+(C-r)*d/k.y+X)<=f&&l>=m&&l<=N&&(e.style.top=q+(r-C)/k.y+V+"px"),l>=N&&(l=N),l>=f&&(l=f),l<=m&&(l=m),e.style.height=l+"px","content"===c.aspectRatio?(e.style.width=(l-R-D-$-U)*L+$+U+"px",c.containment&&e.overlaps(g).right<=c.containment[1]&&(e.style.width=M+"px",e.style.height=M/L+"px")):"panel"===c.aspectRatio&&(e.style.width=l*B+"px",c.containment&&e.overlaps(g).right<=c.containment[1]&&(e.style.width=M+"px",e.style.height=M/B+"px"))):A.contains("jsPanel-resizeit-se")?((s=z+(a-E)*d/k.x+_)>=M&&(s=M),s>=h&&(s=h),s<=u&&(s=u),e.style.width=s+"px",2===d&&(e.style.left=W-(a-E)+"px"),c.aspectRatio&&(e.style.height=s/B+"px"),(l=S+(r-C)*d/k.y+X)>=I&&(l=I),l>=f&&(l=f),l<=m&&(l=m),e.style.height=l+"px",2===d&&(e.style.top=q-(r-C)+"px"),"content"===c.aspectRatio?(e.style.width=(l-R-D-$-U)*L+$+U+"px",c.containment&&e.overlaps(g).right<=c.containment[1]&&(e.style.width=M+"px",e.style.height=M/L+"px")):"panel"===c.aspectRatio&&(e.style.width=l*B+"px",c.containment&&e.overlaps(g).right<=c.containment[1]&&(e.style.width=M+"px",e.style.height=M/B+"px"))):A.contains("jsPanel-resizeit-sw")?((l=S+(r-C)*d/k.y+X)>=I&&(l=I),l>=f&&(l=f),l<=m&&(l=m),e.style.height=l+"px",2===d&&(e.style.top=q-(r-C)+"px"),c.aspectRatio&&(e.style.width=l*B+"px"),(s=z+(E-a)*d/k.x+_)<=h&&s>=u&&s<=O&&(e.style.left=W+(a-E)/k.x+Y+"px"),s>=O&&(s=O),s>=h&&(s=h),s<=u&&(s=u),e.style.width=s+"px","content"===c.aspectRatio?(e.style.height=(s-Z-G)/L+R+D+$+U+"px",c.containment&&e.overlaps(g).bottom<=c.containment[2]&&(e.style.height=I+"px",e.style.width=I*L+"px")):"panel"===c.aspectRatio&&(e.style.height=s/B+"px",c.containment&&e.overlaps(g).bottom<=c.containment[2]&&(e.style.height=I+"px",e.style.width=I*B+"px"))):A.contains("jsPanel-resizeit-ne")?((s=z+(a-E)*d/k.x+_)>=M&&(s=M),s>=h&&(s=h),s<=u&&(s=u),e.style.width=s+"px",2===d&&(e.style.left=W-(a-E)+"px"),c.aspectRatio&&(e.style.height=s/B+"px"),(l=S+(C-r)*d/k.y+X)<=f&&l>=m&&l<=N&&(e.style.top=q+(r-C)/k.y+V+"px"),l>=N&&(l=N),l>=f&&(l=f),l<=m&&(l=m),e.style.height=l+"px","content"===c.aspectRatio?(e.style.width=(l-R-D-$-U)*L+$+U+"px",c.containment&&e.overlaps(g).right<=c.containment[1]&&(e.style.width=M+"px",e.style.height=M/L+"px")):"panel"===c.aspectRatio&&(e.style.width=l*B+"px",c.containment&&e.overlaps(g).right<=c.containment[1]&&(e.style.width=M+"px",e.style.height=M/B+"px"))):A.contains("jsPanel-resizeit-nw")&&(c.aspectRatio&&A.contains("jsPanel-resizeit-nw")&&(r=(a=r*F)/F),(s=z+(E-a)*d/k.x+_)<=h&&s>=u&&s<=O&&(e.style.left=W+(a-E)/k.x+Y+"px"),s>=O&&(s=O),s>=h&&(s=h),s<=u&&(s=u),e.style.width=s+"px",c.aspectRatio&&(e.style.height=s/B+"px"),(l=S+(C-r)*d/k.y+X)<=f&&l>=m&&l<=N&&(e.style.top=q+(r-C)/k.y+V+"px"),l>=N&&(l=N),l>=f&&(l=f),l<=m&&(l=m),e.style.height=l+"px","content"===c.aspectRatio?e.style.width=(l-R-D-$-U)*L+$+U+"px":"panel"===c.aspectRatio&&(e.style.width=l*B+"px")),window.getSelection().removeAllRanges();var p=window.getComputedStyle(e),b={left:parseFloat(p.left),top:parseFloat(p.top),right:parseFloat(p.right),bottom:parseFloat(p.bottom),width:parseFloat(p.width),height:parseFloat(p.height)};c.resize.length&&jsPanel.processCallbacks(e,c.resize,!1,b,t)},jsPanel.pointermove.forEach(function(e){document.addEventListener(e,r,!1)}),window.addEventListener("mouseout",function(e){null===e.relatedTarget&&jsPanel.pointermove.forEach(function(e){document.removeEventListener(e,r,!1)})},!1)})})}),jsPanel.pointerup.forEach(function(t){document.addEventListener(t,function(t){if(jsPanel.pointermove.forEach(function(e){document.removeEventListener(e,r,!1)}),t.target.classList&&t.target.classList.contains("jsPanel-resizeit-handle")){var n,o,s=t.target.className;if(s.match(/jsPanel-resizeit-nw|jsPanel-resizeit-w|jsPanel-resizeit-sw/i)&&(n=!0),s.match(/jsPanel-resizeit-nw|jsPanel-resizeit-n|jsPanel-resizeit-ne/i)&&(o=!0),c.grid&&Array.isArray(c.grid)){1===c.grid.length&&(c.grid[1]=c.grid[0]);var l=parseFloat(e.style.width),d=parseFloat(e.style.height),p=l%c.grid[0],h=d%c.grid[1],f=parseFloat(e.style.left),u=parseFloat(e.style.top),m=f%c.grid[0],g=u%c.grid[1];p

'.concat(e.message,"

")})},create:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;jsPanel.zi||(jsPanel.zi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:jsPanel.ziBase;return{next:function(){return e++}}}()),t.config?delete(t=Object.assign({},this.defaults,t.config,t)).config:t=Object.assign({},this.defaults,t),t.id?"function"==typeof t.id&&(t.id=t.id()):t.id="jsPanel-".concat(jsPanel.idCounter+=1);var o=document.getElementById(t.id);if(null!==o){if(o.classList.contains("jsPanel")&&o.front(),this.errorReporting)try{throw new jsPanel.jsPanelError("◀ COULD NOT CREATE NEW JSPANEL ►
An element with the ID "+t.id+" already exists in the document.")}catch(e){jsPanel.error(e)}return!1}var a=this.pOcontainer(t.container);if("object"===_typeof(a)&&a.length&&a.length>0&&(a=a[0]),!a){if(this.errorReporting)try{throw new jsPanel.jsPanelError("◀ COULD NOT CREATE NEW JSPANEL ►
The container to append the panel to does not exist")}catch(e){jsPanel.error(e)}return!1}["onbeforeclose","onbeforemaximize","onbeforeminimize","onbeforenormalize","onbeforesmallify","onbeforeunsmallify","onclosed","onfronted","onmaximized","onminimized","onnormalized","onsmallified","onstatuschange","onunsmallified"].forEach(function(e){t[e]?"function"==typeof t[e]&&(t[e]=[t[e]]):t[e]=[]});var r=t.template?t.template:this.createPanelTemplate();r.options=t,r.closetimer=void 0,r.status="initialized",r.currentData={},r.header=r.querySelector(".jsPanel-hdr"),r.headerbar=r.header.querySelector(".jsPanel-headerbar"),r.titlebar=r.header.querySelector(".jsPanel-titlebar"),r.headerlogo=r.headerbar.querySelector(".jsPanel-headerlogo"),r.headertitle=r.headerbar.querySelector(".jsPanel-title"),r.controlbar=r.headerbar.querySelector(".jsPanel-controlbar"),r.headertoolbar=r.header.querySelector(".jsPanel-hdr-toolbar"),r.content=r.querySelector(".jsPanel-content"),r.footer=r.querySelector(".jsPanel-ftr"),r.snappableTo=!1,r.snapped=!1,r.droppableTo=!1,r.autocloseProgressbar=r.querySelector(".jsPanel-autoclose-progressbar");var i=new CustomEvent("jspanelloaded",{detail:t.id}),s=new CustomEvent("jspanelstatuschange",{detail:t.id}),l=new CustomEvent("jspanelbeforenormalize",{detail:t.id}),c=new CustomEvent("jspanelnormalized",{detail:t.id}),d=new CustomEvent("jspanelbeforemaximize",{detail:t.id}),p=new CustomEvent("jspanelmaximized",{detail:t.id}),h=new CustomEvent("jspanelbeforeminimize",{detail:t.id}),f=new CustomEvent("jspanelminimized",{detail:t.id}),u=new CustomEvent("jspanelbeforesmallify",{detail:t.id}),m=new CustomEvent("jspanelsmallified",{detail:t.id}),g=new CustomEvent("jspanelsmallifiedmax",{detail:t.id}),b=new CustomEvent("jspanelbeforeunsmallify",{detail:t.id}),y=new CustomEvent("jspanelfronted",{detail:t.id}),v=new CustomEvent("jspanelbeforeclose",{detail:t.id}),w=new CustomEvent("jspanelclosed",{detail:t.id}),j=new CustomEvent("jspanelcloseduser",{detail:t.id});[i,s,l,c,d,p,h,f,u,m,g,b,y,v,w,j].forEach(function(e){e.panel=r});var P=r.querySelector(".jsPanel-btn-close"),x=r.querySelector(".jsPanel-btn-maximize"),E=r.querySelector(".jsPanel-btn-normalize"),C=r.querySelector(".jsPanel-btn-smallify"),F=r.querySelector(".jsPanel-btn-minimize");"onpointerdown"in window&&r.controlbar.querySelectorAll(".jsPanel-btn").forEach(function(e){e.addEventListener("pointerdown",function(e){e.preventDefault()},!0)}),P&&jsPanel.pointerup.forEach(function(e){P.addEventListener(e,function(e){if(e.preventDefault(),e.button&&e.button>0)return!1;r.close(null,!0)})}),x&&jsPanel.pointerup.forEach(function(e){x.addEventListener(e,function(e){if(e.preventDefault(),e.button&&e.button>0)return!1;r.maximize()})}),E&&jsPanel.pointerup.forEach(function(e){E.addEventListener(e,function(e){if(e.preventDefault(),e.button&&e.button>0)return!1;r.normalize()})}),C&&jsPanel.pointerup.forEach(function(e){C.addEventListener(e,function(e){if(e.preventDefault(),e.button&&e.button>0)return!1;"normalized"===r.status||"maximized"===r.status?r.smallify():"smallified"!==r.status&&"smallifiedmax"!==r.status||r.unsmallify()})}),F&&jsPanel.pointerup.forEach(function(e){F.addEventListener(e,function(e){if(e.preventDefault(),e.button&&e.button>0)return!1;r.minimize()})});var z=jsPanel.extensions;for(var S in z)z.hasOwnProperty(S)&&(r[S]=z[S]);if(r.clearTheme=function(e){return jsPanel.themes.forEach(function(e){["panel","jsPanel-theme-".concat(e),"panel-".concat(e),"".concat(e,"-color")].forEach(function(e){r.classList.remove(e)}),r.header.classList.remove("jsPanel-theme-".concat(e))}),r.content.classList.remove("jsPanel-content-filled","jsPanel-content-filledlight"),r.header.classList.remove("jsPanel-hdr-light"),r.header.classList.remove("jsPanel-hdr-dark"),r.style.backgroundColor="",jsPanel.setStyle(r.headertoolbar,{boxShadow:"",width:"",marginLeft:"",borderTopColor:"transparent"}),jsPanel.setStyle(r.content,{background:"",borderTopColor:"transparent"}),r.header.style.background="",Array.prototype.slice.call(r.controlbar.querySelectorAll(".jsPanel-icon")).concat([r.headerlogo,r.headertitle,r.headertoolbar,r.content]).forEach(function(e){e.style.color=""}),e&&e.call(r,r),r},r.getThemeDetails=function(e){var t=e.toLowerCase(),n={color:!1,colors:!1,filling:!1},o=t.split("fill");if(n.color=o[0].trim().replace(/\s*/g,""),2===o.length)if(o[1].startsWith("edlight"))n.filling="filledlight";else if(o[1].startsWith("eddark"))n.filling="filleddark";else if(o[1].startsWith("ed"))n.filling="filled";else if(o[1].startsWith("color")){var a=o[1].split("color"),r=a[a.length-1].trim().replace(/\s*/g,"");jsPanel.colorNames[r]&&(r=jsPanel.colorNames[r]),r.match(/^([0-9a-f]{3}|[0-9a-f]{6})$/gi)&&(r="#"+r),n.filling=r}if(jsPanel.themes.some(function(e){return e===n.color.split(/\s/i)[0]})){var i=n.color.split(/\s/i)[0],s=document.createElement("button");s.className=i+"-bg",document.body.appendChild(s),n.color=getComputedStyle(s).backgroundColor.replace(/\s+/gi,""),document.body.removeChild(s),s=void 0}else if(n.color.startsWith("bootstrap-")){var l=n.color.indexOf("-"),c=document.createElement("button");c.className="btn btn"+n.color.slice(l),document.body.appendChild(c),n.color=getComputedStyle(c).backgroundColor.replace(/\s+/gi,""),document.body.removeChild(c),c=void 0}else if(n.color.startsWith("mdb-")){var d,p=n.color.indexOf("-")+1,h=document.createElement("span");d=n.color.endsWith("-dark")?(d=n.color.slice(p)).replace("-dark","-color-dark"):n.color.slice(p)+"-color",h.className=d,document.body.appendChild(h),n.color=getComputedStyle(h).backgroundColor.replace(/\s+/gi,""),document.body.removeChild(h),h=void 0}return n.colors=jsPanel.calcColors(n.color),n},r.applyColorTheme=function(e){if(r.style.backgroundColor=e.colors[0],r.header.style.backgroundColor=e.colors[0],r.header.style.color=e.colors[3],[".jsPanel-headerlogo",".jsPanel-title",".jsPanel-hdr-toolbar"].forEach(function(t){r.querySelector(t).style.color=e.colors[3]}),r.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(function(t){t.style.color=e.colors[3]}),"string"==typeof r.options.theme&&"filled"===e.filling&&(r.content.style.borderTop="#000000"===e.colors[3]?"1px solid rgba(0,0,0,0.15)":"1px solid rgba(255,255,255,0.15)"),"#000000"===e.colors[3]?r.header.classList.add("jsPanel-hdr-light"):r.header.classList.add("jsPanel-hdr-dark"),e.filling)switch(e.filling){case"filled":jsPanel.setStyle(r.content,{backgroundColor:e.colors[2],color:e.colors[3]});break;case"filledlight":r.content.style.backgroundColor=e.colors[1];break;case"filleddark":jsPanel.setStyle(r.content,{backgroundColor:e.colors[6],color:e.colors[7]});break;default:r.content.style.backgroundColor=e.filling,r.content.style.color=jsPanel.perceivedBrightness(e.filling)<=jsPanel.colorBrightnessThreshold?"#fff":"#000"}return r},r.applyCustomTheme=function(e){var t,n={bgPanel:"#fff",bgContent:"#fff",colorHeader:"#000",colorContent:"#000"},o=(t="object"===_typeof(e)?Object.assign(n,e):n).bgPanel,a=t.bgContent,i=t.colorHeader,s=t.colorContent;if(jsPanel.colorNames[o]?r.style.background="#"+jsPanel.colorNames[o]:r.style.background=o,jsPanel.colorNames[i]&&(i="#"+jsPanel.colorNames[i]),[".jsPanel-headerlogo",".jsPanel-title",".jsPanel-hdr-toolbar"].forEach(function(e){r.querySelector(e).style.color=i}),r.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(function(e){e.style.color=i}),jsPanel.colorNames[a]?r.content.style.background="#"+jsPanel.colorNames[a]:r.content.style.background=a,jsPanel.colorNames[s]?r.content.style.color="#"+jsPanel.colorNames[s]:r.content.style.color=s,jsPanel.perceivedBrightness(i)>jsPanel.colorBrightnessThreshold?r.header.classList.add("jsPanel-hdr-dark"):r.header.classList.add("jsPanel-hdr-light"),jsPanel.perceivedBrightness(s)>jsPanel.colorBrightnessThreshold?r.content.style.borderTop="1px solid rgba(255,255,255,0.15)":r.content.style.borderTop="1px solid rgba(0,0,0,0.15)",t.border){var l=t.border,c=l.lastIndexOf(" "),d=l.slice(++c);jsPanel.colorNames[d]&&(l=l.replace(d,"#"+jsPanel.colorNames[d])),r.style.border=l}return r},r.setBorder=function(e){var t=jsPanel.pOborder(e);return t[2].length?jsPanel.colorNames[t[2]]&&(t[2]="#"+jsPanel.colorNames[t[2]]):t[2]=r.style.backgroundColor,t=t.join(" "),r.style.border=t,r.options.border=t,r},r.setBorderRadius=function(e){"number"==typeof e&&(e+="px"),r.style.borderRadius=e;var t=getComputedStyle(r);return r.querySelector(".jsPanel-hdr")?(r.header.style.borderTopLeftRadius=t.borderTopLeftRadius,r.header.style.borderTopRightRadius=t.borderTopRightRadius):(r.content.style.borderTopLeftRadius=t.borderTopLeftRadius,r.content.style.borderTopRightRadius=t.borderTopRightRadius),r.querySelector(".jsPanel-ftr.active")?(r.footer.style.borderBottomRightRadius=t.borderBottomRightRadius,r.footer.style.borderBottomLeftRadius=t.borderBottomLeftRadius):(r.content.style.borderBottomRightRadius=t.borderBottomRightRadius,r.content.style.borderBottomLeftRadius=t.borderBottomLeftRadius),r},r.setTheme=function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.theme,o=arguments.length>1?arguments[1]:void 0;if("minimized"===r.status&&(e=!0,r.normalize()),r.clearTheme(),"object"===_typeof(n))t.border=void 0,r.applyCustomTheme(n);else{"none"===n&&(n="white");var a=r.getThemeDetails(n);r.applyColorTheme(a)}return e&&r.minimize(),o&&o.call(r,r),r},r.close=function(e,t){r.closetimer&&window.clearInterval(r.closetimer);var n=r.id,o=r.parentElement;if(document.dispatchEvent(v),r.options.onbeforeclose&&r.options.onbeforeclose.length>0&&!jsPanel.processCallbacks(r,r.options.onbeforeclose,"some",r.status,t))return r;r.options.animateOut?(r.options.animateIn&&jsPanel.remClass(r,r.options.animateIn),jsPanel.setClass(r,r.options.animateOut),r.addEventListener("animationend",function(a){a.stopPropagation(),o.removeChild(r),document.getElementById(n)?e&&e.call(r,n,r):(r.removeMinimizedReplacement(),t&&document.dispatchEvent(j),document.dispatchEvent(w),r.options.onclosed&&jsPanel.processCallbacks(r,r.options.onclosed,"every",t),jsPanel.autopositionRemaining(r),e&&e.call(n,n))})):(o.removeChild(r),document.getElementById(n)?e&&e.call(r,n,r):(r.removeMinimizedReplacement(),t&&document.dispatchEvent(j),document.dispatchEvent(w),r.options.onclosed&&jsPanel.processCallbacks(r,r.options.onclosed,"every",t),jsPanel.autopositionRemaining(r),e&&e.call(n,n)))},r.maximize=function(e,n){if(r.statusBefore=r.status,t.onbeforemaximize&&t.onbeforemaximize.length>0&&!jsPanel.processCallbacks(r,t.onbeforemaximize,"some",r.statusBefore))return r;document.dispatchEvent(d);var o=r.parentElement,a=jsPanel.pOcontainment(t.maximizedMargin);return o===document.body?(r.style.width=document.documentElement.clientWidth-a[1]-a[3]+"px",r.style.height=document.documentElement.clientHeight-a[0]-a[2]+"px",r.style.left=a[3]+"px",r.style.top=a[0]+"px",t.position.fixed||(r.style.left=window.pageXOffset+a[3]+"px",r.style.top=window.pageYOffset+a[0]+"px")):(r.style.width=o.clientWidth-a[1]-a[3]+"px",r.style.height=o.clientHeight-a[0]-a[2]+"px",r.style.left=a[3]+"px",r.style.top=a[0]+"px"),C.style.transform="unset",r.removeMinimizedReplacement(),r.status="maximized",r.setControls([".jsPanel-btn-maximize"]),n||r.front(),document.dispatchEvent(p),document.dispatchEvent(s),t.onstatuschange&&jsPanel.processCallbacks(r,t.onstatuschange,"every",r.statusBefore),e&&e.call(r,r,r.statusBefore),t.onmaximized&&jsPanel.processCallbacks(r,t.onmaximized,"every",r.statusBefore),r},r.minimize=function(e){if("minimized"===r.status)return r;if(r.statusBefore=r.status,t.onbeforeminimize&&t.onbeforeminimize.length>0&&!jsPanel.processCallbacks(r,t.onbeforeminimize,"some",r.statusBefore))return r;if(document.dispatchEvent(h),!document.getElementById("jsPanel-replacement-container")){var n=document.createElement("div");n.id="jsPanel-replacement-container",document.body.append(n)}if(r.style.left="-9999px",r.status="minimized",document.dispatchEvent(f),document.dispatchEvent(s),t.onstatuschange&&jsPanel.processCallbacks(r,t.onstatuschange,"every",r.statusBefore),t.minimizeTo){var o,a,i,l=r.createMinimizedReplacement();switch(t.minimizeTo){case"default":document.getElementById("jsPanel-replacement-container").append(l);break;case"parentpanel":(o=(i=(a=r.closest(".jsPanel-content").parentElement).querySelectorAll(".jsPanel-minimized-box"))[i.length-1]).append(l);break;case"parent":(o=(a=r.parentElement).querySelector(".jsPanel-minimized-container"))||((o=document.createElement("div")).className="jsPanel-minimized-container",a.append(o)),o.append(l);break;default:document.querySelector(t.minimizeTo).append(l)}}return e&&e.call(r,r,r.statusBefore),t.onminimized&&jsPanel.processCallbacks(r,t.onminimized,"every",r.statusBefore),r},r.normalize=function(e){return"normalized"===r.status?r:(r.statusBefore=r.status,t.onbeforenormalize&&t.onbeforenormalize.length>0&&!jsPanel.processCallbacks(r,t.onbeforenormalize,"some",r.statusBefore)?r:(document.dispatchEvent(l),r.style.width=r.currentData.width,r.style.height=r.currentData.height,r.snapped?r.snap(r.snapped,!0):(r.style.left=r.currentData.left,r.style.top=r.currentData.top),C.style.transform="unset",r.removeMinimizedReplacement(),r.status="normalized",r.setControls([".jsPanel-btn-normalize"]),r.front(),document.dispatchEvent(c),document.dispatchEvent(s),t.onstatuschange&&jsPanel.processCallbacks(r,t.onstatuschange,"every",r.statusBefore),e&&e.call(r,r,r.statusBefore),t.onnormalized&&jsPanel.processCallbacks(r,t.onnormalized,"every",r.statusBefore),r))},r.smallify=function(e){if("smallified"===r.status||"smallifiedmax"===r.status)return r;if(r.statusBefore=r.status,t.onbeforesmallify&&t.onbeforesmallify.length>0&&!jsPanel.processCallbacks(r,t.onbeforesmallify,"some",r.statusBefore))return r;document.dispatchEvent(u),r.style.overflow="hidden";var n=window.getComputedStyle(r),o=parseFloat(window.getComputedStyle(r.headerbar).height);r.style.height=parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth)+o+"px",C.style.transform="rotate(180deg)","normalized"===r.status?(r.setControls([".jsPanel-btn-normalize"]),r.status="smallified",document.dispatchEvent(m),document.dispatchEvent(s),t.onstatuschange&&jsPanel.processCallbacks(r,t.onstatuschange,"every",r.statusBefore)):"maximized"===r.status&&(r.setControls([".jsPanel-btn-maximize"]),r.status="smallifiedmax",document.dispatchEvent(g),document.dispatchEvent(s),t.onstatuschange&&jsPanel.processCallbacks(r,t.onstatuschange,"every",r.statusBefore));var a=r.querySelectorAll(".jsPanel-minimized-box");return a[a.length-1].style.display="none",e&&e.call(r,r,r.statusBefore),t.onsmallified&&jsPanel.processCallbacks(r,t.onsmallified,"every",r.statusBefore),r},r.unsmallify=function(e){if(r.statusBefore=r.status,"smallified"===r.status||"smallifiedmax"===r.status){if(t.onbeforeunsmallify&&t.onbeforeunsmallify.length>0&&!jsPanel.processCallbacks(r,t.onbeforeunsmallify,"some",r.statusBefore))return r;document.dispatchEvent(b),r.style.overflow="visible",r.front(),"smallified"===r.status?(r.style.height=r.currentData.height,r.setControls([".jsPanel-btn-normalize"]),r.status="normalized",document.dispatchEvent(c),document.dispatchEvent(s),t.onstatuschange&&jsPanel.processCallbacks(r,t.onstatuschange,"every",r.statusBefore)):"smallifiedmax"===r.status?r.maximize():"minimized"===r.status&&r.normalize(),C.style.transform="rotate(0deg)";var n=r.querySelectorAll(".jsPanel-minimized-box");n[n.length-1].style.display="flex",e&&e.call(r,r,r.statusBefore),t.onunsmallified&&jsPanel.processCallbacks(r,t.onunsmallified,"every",r.statusBefore)}return r},r.front=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("minimized"===r.status)"maximized"===r.statusBefore?r.maximize():r.normalize();else{var o=Array.prototype.slice.call(document.querySelectorAll(".jsPanel-standard")).map(function(e){return e.style.zIndex});Math.max.apply(Math,_toConsumableArray(o))>r.style.zIndex&&(r.style.zIndex=jsPanel.zi.next()),jsPanel.resetZi()}return document.dispatchEvent(y),e&&e.call(r,r),t.onfronted&&n&&jsPanel.processCallbacks(r,t.onfronted,"every",r.status),r},r.snap=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t||(r.currentData.beforeSnap={width:r.currentData.width,height:r.currentData.height}),e&&"function"==typeof e&&!t)e.call(r,r,r.snappableTo);else if(!1!==e){var n=[0,0];if(r.options.dragit.snap.containment&&r.options.dragit.containment){var o=jsPanel.pOcontainment(r.options.dragit.containment),a=r.snappableTo;a.startsWith("left")?n[0]=o[3]:a.startsWith("right")&&(n[0]=-o[1]),a.endsWith("top")?n[1]=o[0]:a.endsWith("bottom")&&(n[1]=-o[2])}r.reposition("".concat(r.snappableTo," ").concat(n[0]," ").concat(n[1]))}t||(r.snapped=r.snappableTo)},r.move=function(e,t){var n=r.overlaps(e,"paddingbox"),o=r.parentElement;return e.appendChild(r),r.options.container=e,r.style.left=n.left+"px",r.style.top=n.top+"px",r.saveCurrentDimensions(),r.saveCurrentPosition(),r.calcSizeFactors(),t&&t.call(r,r,e,o),r},r.closeChildpanels=function(e){return r.getChildpanels().forEach(function(e){return e.close()}),e&&e.call(r,r),r},r.getChildpanels=function(e){var t=r.content.querySelectorAll(".jsPanel");return e&&t.forEach(function(t,n,o){e.call(t,t,n,o)}),t},r.isChildpanel=function(e){var t=r.closest(".jsPanel-content"),n=t?t.parentElement:null;return e&&e.call(r,r,n),!!t&&n},r.contentRemove=function(e){return jsPanel.emptyNode(r.content),e&&e.call(r,r),r},r.createMinimizedReplacement=function(){var e=jsPanel.createMinimizedTemplate(),n=window.getComputedStyle(r.headertitle).color,o=window.getComputedStyle(r),a=t.iconfont,i=e.querySelector(".jsPanel-controlbar");return"auto-show-hide"!==r.options.header?jsPanel.setStyle(e,{backgroundColor:o.backgroundColor,backgroundPositionX:o.backgroundPositionX,backgroundPositionY:o.backgroundPositionY,backgroundRepeat:o.backgroundRepeat,backgroundAttachment:o.backgroundAttachment,backgroundImage:o.backgroundImage,backgroundSize:o.backgroundSize,backgroundOrigin:o.backgroundOrigin,backgroundClip:o.backgroundClip}):e.style.backgroundColor=window.getComputedStyle(r.header).backgroundColor,e.id=r.id+"-min",e.querySelector(".jsPanel-headerbar").replaceChild(r.headerlogo.cloneNode(!0),e.querySelector(".jsPanel-headerlogo")),e.querySelector(".jsPanel-titlebar").replaceChild(r.headertitle.cloneNode(!0),e.querySelector(".jsPanel-title")),e.querySelector(".jsPanel-titlebar").setAttribute("title",r.headertitle.textContent),e.querySelector(".jsPanel-title").style.color=n,i.style.color=n,i.querySelectorAll("button").forEach(function(e){e.style.color=n}),["jsPanel-hdr-dark","jsPanel-hdr-light"].forEach(function(t){r.header.classList.contains(t)&&e.querySelector(".jsPanel-hdr").classList.add(t)}),r.setIconfont(a,e),"onpointerdown"in window&&e.querySelectorAll(".jsPanel-btn").forEach(function(e){e.addEventListener("pointerdown",function(e){e.preventDefault()},!0)}),"enabled"===r.dataset.btnnormalize?jsPanel.pointerup.forEach(function(t){e.querySelector(".jsPanel-btn-normalize").addEventListener(t,function(){r.normalize()})}):i.querySelector(".jsPanel-btn-normalize").style.display="none","enabled"===r.dataset.btnmaximize?jsPanel.pointerup.forEach(function(t){e.querySelector(".jsPanel-btn-maximize").addEventListener(t,function(){r.maximize()})}):i.querySelector(".jsPanel-btn-maximize").style.display="none","enabled"===r.dataset.btnclose?jsPanel.pointerup.forEach(function(t){e.querySelector(".jsPanel-btn-close").addEventListener(t,function(){r.close(null,!0)})}):i.querySelector(".jsPanel-btn-close").style.display="none",e},r.removeMinimizedReplacement=function(){var e=document.getElementById("".concat(r.id,"-min"));e&&e.parentElement.removeChild(e)},r.dragit=function(e){var n=Object.assign({},jsPanel.defaults.dragit,t.dragit),o=r.querySelectorAll(n.handles);return"disable"===e?o.forEach(function(e){e.style.pointerEvents="none"}):o.forEach(function(e){e.style.pointerEvents="auto"}),r},r.resizeit=function(e){var t=r.querySelectorAll(".jsPanel-resizeit-handle");return"disable"===e?t.forEach(function(e){e.style.pointerEvents="none"}):t.forEach(function(e){e.style.pointerEvents="auto"}),r},r.getScaleFactor=function(){var e=r.getBoundingClientRect();return{x:e.width/r.offsetWidth,y:e.height/r.offsetHeight}},r.calcSizeFactors=function(){var e=window.getComputedStyle(r);if("window"===t.container)r.hf=parseFloat(e.left)/(window.innerWidth-parseFloat(e.width)),r.vf=parseFloat(e.top)/(window.innerHeight-parseFloat(e.height));else if(r.parentElement){var n=r.parentElement.getBoundingClientRect();r.hf=parseFloat(e.left)/(n.width-parseFloat(e.width)),r.vf=parseFloat(e.top)/(n.height-parseFloat(e.height))}},r.saveCurrentDimensions=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=window.getComputedStyle(r);r.currentData.width=t.width,"normalized"===r.status&&(r.currentData.height=t.height),e&&(r.style.height=t.height)},r.saveCurrentPosition=function(){var e=window.getComputedStyle(r);r.currentData.left=e.left,r.currentData.top=e.top},r.reposition=function(){for(var e,n=t.position,o=!0,a=arguments.length,i=new Array(a),s=0;so.left,u=a.topo.top;return{overlaps:f&&u,top:a.top-o.top-l.top,right:o.right-a.right-l.right,bottom:o.bottom-a.bottom-l.bottom,left:a.left-o.left-l.left,parentBorderWidth:l,panelRect:a,referenceRect:o,pointer:{clientX:c,clientY:d,left:p-l.left,top:h-l.top,right:o.width-p-l.right,bottom:o.height-h-l.bottom}}},r.setSize=function(){if(t.panelSize){var e=jsPanel.pOsize(r,t.panelSize);r.style.width=e.width,r.style.height=e.height}else if(t.contentSize){var n=jsPanel.pOsize(r,t.contentSize);r.content.style.width=n.width,r.content.style.height=n.height,r.style.width=n.width,r.content.style.width="100%"}return r},r.resize=function(){for(var e,t=window.getComputedStyle(r),n={width:t.width,height:t.height},o=!0,a=arguments.length,i=new Array(a),s=0;s1&&void 0!==arguments[1]?arguments[1]:"enable",n=arguments.length>2?arguments[2]:void 0,o=r.controlbar.querySelector(".jsPanel-btn-".concat(e));switch(t){case"disable":"removed"!==r.getAttribute("data-btn".concat(e))&&(r.setAttribute("data-btn".concat(e),"disabled"),o.style.pointerEvents="none",o.style.opacity=.4,o.style.cursor="default");break;case"hide":"removed"!==r.getAttribute("data-btn".concat(e))&&(r.setAttribute("data-btn".concat(e),"hidden"),o.style.display="none");break;case"show":"removed"!==r.getAttribute("data-btn".concat(e))&&(r.setAttribute("data-btn".concat(e),"enabled"),o.style.display="block",o.style.pointerEvents="auto",o.style.opacity=1,o.style.cursor="pointer");break;case"enable":"removed"!==r.getAttribute("data-btn".concat(e))&&("hidden"===r.getAttribute("data-btn".concat(e))&&(o.style.display="block"),r.setAttribute("data-btn".concat(e),"enabled"),o.style.pointerEvents="auto",o.style.opacity=1,o.style.cursor="pointer");break;case"remove":r.controlbar.removeChild(o),r.setAttribute("data-btn".concat(e),"removed")}return n&&n.call(r,r),r},r.setControlSize=function(e){var t=e.toLowerCase();r.controlbar.querySelectorAll(".jsPanel-btn").forEach(function(e){["jsPanel-btn-xl","jsPanel-btn-lg","jsPanel-btn-md","jsPanel-btn-sm","jsPanel-btn-xs"].forEach(function(t){e.classList.remove(t)}),e.classList.add("jsPanel-btn-".concat(t))}),"xl"===t?r.titlebar.style.fontSize="1.5rem":"lg"===t?r.titlebar.style.fontSize="1.25rem":"md"===t?r.titlebar.style.fontSize="1.05rem":"sm"===t?r.titlebar.style.fontSize=".9rem":"xs"===t&&(r.titlebar.style.fontSize=".8rem")},r.setHeaderControls=function(e){if(r.options.headerControls.add){var n=r.options.headerControls.add;Array.isArray(n)||(n=[n]),n.forEach(function(e){r.addControl(e)})}var o=[];r.controlbar.querySelectorAll(".jsPanel-btn").forEach(function(e){var t=e.className.match(/jsPanel-btn-[a-z0-9]{3,}/i)[0].substring(12);o.push(t)});var a=jsPanel.pOheaderControls(t.headerControls);return t.headerControls=a,o.forEach(function(e){a[e]&&r.setControlStatus(e,a[e])}),r.setControlSize(a.size),e&&e.call(r,r),r},r.setHeaderLogo=function(e,t){var n=[r.headerlogo],o=document.querySelector("#"+r.id+"-min");return o&&n.push(o.querySelector(".jsPanel-headerlogo")),"string"==typeof e?"<"!==e.substr(0,1)?n.forEach(function(t){jsPanel.emptyNode(t);var n=document.createElement("img");n.src=e,t.append(n)}):n.forEach(function(t){t.innerHTML=e}):n.forEach(function(t){jsPanel.emptyNode(t),t.append(e)}),r.headerlogo.childNodes.forEach(function(e){e.nodeName&&"IMG"===e.nodeName&&e.setAttribute("draggable","false")}),t&&t.call(r,r),r},r.setHeaderRemove=function(e){return r.removeChild(r.header),r.content.classList.add("jsPanel-content-noheader"),["close","maximize","normalize","minimize","smallify"].forEach(function(e){r.setAttribute("data-btn".concat(e),"removed")}),e&&e.call(r,r),r},r.setHeaderTitle=function(e,t){var n=[r.headertitle],o=document.querySelector("#"+r.id+"-min");return o&&n.push(o.querySelector(".jsPanel-title")),"string"==typeof e?n.forEach(function(t){t.innerHTML=e}):"function"==typeof e?n.forEach(function(t){jsPanel.emptyNode(t),t.innerHTML=e()}):n.forEach(function(t){jsPanel.emptyNode(t),t.append(e)}),t&&t.call(r,r),r},r.setIconfont=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,n=arguments.length>2?arguments[2]:void 0;if(!1!==e){var o,a;if("fa"===e||"far"===e||"fal"===e||"fas"===e||"fad"===e)o=["".concat(e," fa-window-close"),"".concat(e," fa-window-maximize"),"".concat(e," fa-window-restore"),"".concat(e," fa-window-minimize"),"".concat(e," fa-chevron-up")];else if("material-icons"===e)o=[e,e,e,e,e,e],a=["close","fullscreen","fullscreen_exit","call_received","expand_less"];else if(Array.isArray(e))o=["custom-control-icon ".concat(e[4]),"custom-control-icon ".concat(e[3]),"custom-control-icon ".concat(e[2]),"custom-control-icon ".concat(e[1]),"custom-control-icon ".concat(e[0])];else{if("bootstrap"!==e&&"glyphicon"!==e)return t;o=["glyphicon glyphicon-remove","glyphicon glyphicon-fullscreen","glyphicon glyphicon-resize-full","glyphicon glyphicon-minus","glyphicon glyphicon-chevron-up"]}t.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(function(e){jsPanel.emptyNode(e).innerHTML=""}),Array.prototype.slice.call(t.querySelectorAll(".jsPanel-controlbar .jsPanel-btn > span")).reverse().forEach(function(t,n){t.className=o[n],"material-icons"===e&&(t.textContent=a[n])})}return n&&n.call(t,t),t},r.addToolbar=function(e,t,n){if("header"===e?e=r.headertoolbar:"footer"===e&&(e=r.footer),"string"==typeof t)e.innerHTML=t;else if(Array.isArray(t))t.forEach(function(t){"string"==typeof t?e.innerHTML+=t:e.append(t)});else if("function"==typeof t){var o=t.call(r,r);"string"==typeof o?e.innerHTML=o:e.append(o)}else e.append(t);return e.classList.add("active"),n&&n.call(r,r),r},r.addCloseControl=function(){var e=document.createElement("button"),t=r.content.style.color;return e.classList.add("jsPanel-addCloseCtrl"),e.innerHTML=jsPanel.icons.close,e.style.color=t,r.options.rtl&&e.classList.add("rtl"),r.appendChild(e),jsPanel.pointerup.forEach(function(t){e.addEventListener(t,function(e){if(e.preventDefault(),e.button&&e.button>0)return!1;r.close(null,!0)})}),jsPanel.pointerdown.forEach(function(t){e.addEventListener(t,function(e){e.preventDefault()})}),r},r.addControl=function(e){if(!e.html)return r;e.position||(e.position=1);var n=r.controlbar.querySelectorAll(".jsPanel-btn").length,o=document.createElement("button");o.innerHTML=e.html,o.className="jsPanel-btn jsPanel-btn-".concat(e.name," jsPanel-btn-").concat(t.headerControls.size),o.style.color=r.header.style.color,e.position>n?r.controlbar.append(o):r.controlbar.insertBefore(o,r.querySelector(".jsPanel-controlbar .jsPanel-btn:nth-child(".concat(e.position,")")));var a=e.ariaLabel||e.name;return a&&o.setAttribute("aria-label",a),jsPanel.pointerup.forEach(function(t){o.addEventListener(t,function(t){if(t.preventDefault(),t.button&&t.button>0)return!1;e.handler.call(r,r,o)})}),e.afterInsert&&e.afterInsert.call(o,o),r},r.setRtl=function(){[r.header,r.content,r.footer].forEach(function(e){e.dir="rtl",t.rtl.lang&&(e.lang=t.rtl.lang)})},r.id=t.id,r.classList.add("jsPanel-"+t.paneltype),"standard"===t.paneltype&&(r.style.zIndex=this.zi.next()),a.append(r),r.front(!1,!1),r.setTheme(t.theme),t.boxShadow&&r.classList.add("jsPanel-depth-".concat(t.boxShadow)),t.header){if(t.headerLogo&&r.setHeaderLogo(t.headerLogo),r.setIconfont(t.iconfont),r.setHeaderTitle(t.headerTitle),r.setHeaderControls(),jsPanel.isIE){var A=[r.headerbar,r.controlbar];switch(r.options.headerControls.size){case"md":A.forEach(function(e){e.style.height="34px"});break;case"xs":A.forEach(function(e){e.style.height="26px"});break;case"sm":A.forEach(function(e){e.style.height="30px"});break;case"lg":A.forEach(function(e){e.style.height="38px"});break;case"xl":A.forEach(function(e){e.style.height="42px"})}}if("auto-show-hide"===t.header){var k="jsPanel-depth-"+t.boxShadow;r.header.style.opacity=0,r.style.backgroundColor="transparent",this.remClass(r,k),this.setClass(r.content,k),r.header.addEventListener("mouseenter",function(){r.header.style.opacity=1,jsPanel.setClass(r,k),jsPanel.remClass(r.content,k)}),r.header.addEventListener("mouseleave",function(){r.header.style.opacity=0,jsPanel.remClass(r,k),jsPanel.setClass(r.content,k)})}}else r.setHeaderRemove(),t.addCloseControl&&r.addCloseControl();if(t.headerToolbar&&r.addToolbar(r.headertoolbar,t.headerToolbar),t.footerToolbar&&r.addToolbar(r.footer,t.footerToolbar),t.border&&r.setBorder(t.border),t.borderRadius&&r.setBorderRadius(t.borderRadius),t.content&&("function"==typeof t.content?t.content.call(r,r):"string"==typeof t.content?r.content.innerHTML=t.content:r.content.append(t.content)),t.contentAjax&&this.ajax(r,t.contentAjax),t.contentFetch&&this.fetch(r),t.contentOverflow){var B=t.contentOverflow.split(" ");1===B.length?r.content.style.overflow=B[0]:2===B.length&&(r.content.style.overflowX=B[0],r.content.style.overflowY=B[1])}if(t.autoclose){"number"==typeof t.autoclose?t.autoclose={time:t.autoclose+"ms"}:"string"==typeof t.autoclose&&(t.autoclose={time:t.autoclose});var T=Object.assign({},jsPanel.defaultAutocloseConfig,t.autoclose);T.time&&"number"==typeof T.time&&(T.time+="ms");var L=r.autocloseProgressbar.querySelector("div");L.addEventListener("animationend",function(e){e.stopPropagation(),r.close()}),T.progressbar&&(r.autocloseProgressbar.style.height="3px",T.background?jsPanel.themes.indexOf(T.background)>-1?r.autocloseProgressbar.classList.add(T.background+"-bg"):jsPanel.colorNames[T.background]?r.autocloseProgressbar.style.background="#"+jsPanel.colorNames[T.background]:r.autocloseProgressbar.style.background=T.background:r.autocloseProgressbar.classList.add("success-bg")),L.style.animation="".concat(T.time," progressbar")}if(t.rtl&&r.setRtl(),r.setSize(),r.status="normalized",t.position?this.position(r,t.position):r.style.opacity=1,document.dispatchEvent(c),r.calcSizeFactors(),t.animateIn&&(r.addEventListener("animationend",function(){e.remClass(r,t.animateIn)}),this.setClass(r,t.animateIn)),t.syncMargins){var R=this.pOcontainment(t.maximizedMargin);t.dragit&&(t.dragit.containment=R,!0===t.dragit.snap?(t.dragit.snap=jsPanel.defaultSnapConfig,t.dragit.snap.containment=!0):t.dragit.snap&&(t.dragit.snap.containment=!0)),t.resizeit&&(t.resizeit.containment=R)}if(t.dragit?(["start","drag","stop"].forEach(function(e){t.dragit[e]?"function"==typeof t.dragit[e]&&(t.dragit[e]=[t.dragit[e]]):t.dragit[e]=[]}),this.dragit(r,t.dragit),r.addEventListener("jspaneldragstop",function(e){e.panel===r&&r.calcSizeFactors()},!1)):r.titlebar.style.cursor="default",t.resizeit){["start","resize","stop"].forEach(function(e){t.resizeit[e]?"function"==typeof t.resizeit[e]&&(t.resizeit[e]=[t.resizeit[e]]):t.resizeit[e]=[]}),this.resizeit(r,t.resizeit);var D=void 0;r.addEventListener("jspanelresizestart",function(e){e.panel===r&&(D=r.status)},!1),r.addEventListener("jspanelresizestop",function(e){e.panel===r&&("smallified"===D||"smallifiedmax"===D||"maximized"===D)&&parseFloat(r.style.height)>parseFloat(window.getComputedStyle(r.header).height)&&(r.setControls([".jsPanel-btn-normalize"]),r.status="normalized",document.dispatchEvent(c),document.dispatchEvent(s),t.onstatuschange&&jsPanel.processCallbacks(r,t.onstatuschange,"every"),r.calcSizeFactors())},!1)}if(r.saveCurrentDimensions(!0),r.saveCurrentPosition(),t.setStatus&&("smallifiedmax"===t.setStatus?r.maximize().smallify():"smallified"===t.setStatus?r.smallify():r[t.setStatus.substr(0,t.setStatus.length-1)]()),this.pointerdown.forEach(function(e){r.addEventListener(e,function(e){e.target.closest(".jsPanel-btn-close")||e.target.closest(".jsPanel-btn-minimize")||"standard"!==t.paneltype||r.front()},!1)}),t.onwindowresize){var W=t.onwindowresize;"window"===r.options.container&&window.addEventListener("resize",function(e){if(e.target===window){var t,n,o=r.status;"maximized"===o&&W?r.maximize(!1,!0):r.snapped&&"minimized"!==o?r.snap(r.snapped,!0):"normalized"===o||"smallified"===o||"maximized"===o?"function"==typeof W?W.call(r,e,r):(t=(window.innerWidth-r.offsetWidth)*r.hf,r.style.left=t<=0?0:t+"px",n=(window.innerHeight-r.offsetHeight)*r.vf,r.style.top=n<=0?0:n+"px"):"smallifiedmax"===o&&W&&r.maximize(!1,!0).smallify()}},!1)}if(t.onparentresize){var q=t.onparentresize,M=r.isChildpanel();if(M){var O=M.content,I=[];document.addEventListener("jspanelresize",function(e){if(e.panel===M){I[0]=O.offsetWidth,I[1]=O.offsetHeight;var t,n,o=r.status;"maximized"===o&&q?r.maximize():r.snapped&&"minimized"!==o?r.snap(r.snapped,!0):"normalized"===o||"smallified"===o||"maximized"===o?"function"==typeof q?q.call(r,r,{width:I[0],height:I[1]}):(t=(I[0]-r.offsetWidth)*r.hf,r.style.left=t<=0?0:t+"px",n=(I[1]-r.offsetHeight)*r.vf,r.style.top=n<=0?0:n+"px"):"smallifiedmax"===o&&q&&r.maximize().smallify()}},!1)}}return this.globalCallbacks&&(Array.isArray(this.globalCallbacks)?this.globalCallbacks.forEach(function(e){e.call(r,r)}):this.globalCallbacks.call(r,r)),t.callback&&(Array.isArray(t.callback)?t.callback.forEach(function(e){e.call(r,r)}):t.callback.call(r,r)),n&&n.call(r,r),document.dispatchEvent(i),r}};"undefined"!=typeof module&&(module.exports=jsPanel); \ No newline at end of file diff --git a/es6module/jspanel.js b/es6module/jspanel.js index cdd1211..96290c2 100644 --- a/es6module/jspanel.js +++ b/es6module/jspanel.js @@ -1,7 +1,7 @@ /* jspanel.js - License MIT, copyright 2013 - 2020 Stefan Straesser (https://jspanel.de) */ 'use strict'; export const jsPanel = { - version: '4.9.2', + version: '4.9.3', date: '2020-01-14 14:00', ajaxAlwaysCallbacks: [], autopositionSpacing: 4, diff --git a/es6module/jspanel.min.js b/es6module/jspanel.min.js index 99869e6..05bc7b8 100644 --- a/es6module/jspanel.min.js +++ b/es6module/jspanel.min.js @@ -1 +1 @@ -"use strict";export const jsPanel={version:"4.9.2",date:"2020-01-14 14:00",ajaxAlwaysCallbacks:[],autopositionSpacing:4,closeOnEscape:void document.addEventListener("keydown",e=>{"Escape"!==e.key&&"Escape"!==e.code&&"Esc"!==e.key||jsPanel.getPanels(function(){return this.classList.contains("jsPanel")}).some(e=>!!e.options.closeOnEscape&&(e.close(null,!0),!0))},!1),defaults:{boxShadow:3,container:"window",contentSize:{width:"400px",height:"200px"},dragit:{cursor:"move",handles:".jsPanel-headerlogo, .jsPanel-titlebar, .jsPanel-ftr",opacity:.8,disableOnMaximized:!0},header:!0,headerTitle:"jsPanel",headerControls:{size:"md"},iconfont:void 0,maximizedMargin:0,minimizeTo:"default",paneltype:"standard",position:{my:"center",at:"center"},resizeit:{handles:"n, e, s, w, ne, se, sw, nw",minWidth:128,minHeight:38},theme:"default"},defaultAutocloseConfig:{time:"8s",progressbar:!0},defaultSnapConfig:{sensitivity:70,trigger:"panel",active:"both"},extensions:{},globalCallbacks:!1,icons:{close:'',maximize:'',normalize:'',minimize:'',smallify:''},idCounter:0,isIE:(()=>navigator.appVersion.match(/Trident/))(),pointerdown:"onpointerdown"in window?["pointerdown"]:"ontouchend"in window?["touchstart","mousedown"]:["mousedown"],pointermove:"onpointermove"in window?["pointermove"]:"ontouchend"in window?["touchmove","mousemove"]:["mousemove"],pointerup:"onpointerup"in window?["pointerup"]:"ontouchend"in window?["touchend","mouseup"]:["mouseup"],polyfills:(Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(null==e)throw new TypeError("Cannot convert first argument to object");let t=Object(e);for(let e=1;e=0&&n.item(t)!==o;);}while(t<0&&(o=o.parentElement));return o}),function(){if("function"==typeof window.CustomEvent)return!1;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};let n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}e.prototype=window.Event.prototype,window.CustomEvent=e}(),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){return tthis.length)&&-1!==this.indexOf(e,t)}),Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},void(Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');var n=Object(this),o=n.length>>>0;if(0===o)return!1;for(var a,s,r=0|t,i=Math.max(r>=0?r:o-Math.abs(r),0);i(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e),i=n<.5?n*(1+t):n+t-n*t,l=2*n-i;o=r(l,i,e+1/3),a=r(l,i,e),s=r(l,i,e-1/3)}return[Math.round(255*o),Math.round(255*a),Math.round(255*s)]},rgbToHsl(e,t,n){e/=255,t/=255,n/=255;let o,a,s=Math.max(e,t,n),r=Math.min(e,t,n),i=(s+r)/2;if(s===r)o=a=0;else{let l=s-r;switch(a=i>.5?l/(2-s-r):l/(s+r),s){case e:o=(t-n)/l+(t{(e=e.trim()).match(/(^|\s)(-?[0-9]*\.?[0-9]+)(\s|$)/)&&(l[t]=`${l[t]}px`.trim())}),n.offsetX=l[0].trim(),n.offsetY=l[1]?l[1].trim():l[0].trim()),(t=t.replace(s," ").trim()).length&&(n.of=t),n},position(e,t){if(!t)return e.style.opacity=1,e;t="string"==typeof t?Object.assign({},this.defaults.position,this.pOposition(t)):Object.assign({},this.defaults.position,t),["my","at","of"].forEach(n=>{"function"==typeof t[n]&&(t[n]=t[n].call(e,e))}),"window"===e.options.container&&(e.style.position="fixed"),"string"==typeof e?e=document.querySelector(e):Object.getPrototypeOf(e).jquery&&(e=e[0]);const n="window"===e.options.container?"window":e.parentElement,o=e.getBoundingClientRect(),a=e.parentElement.getBoundingClientRect(),s="window"===n?{left:0,top:0,width:document.documentElement.clientWidth,height:window.innerHeight}:{width:a.width,height:a.height,left:a.left,top:a.top},r="window"===n?{x:1,y:1}:{x:s.width/n.offsetWidth,y:s.height/n.offsetHeight},i="window"===n?{borderTopWidth:"0px",borderRightWidth:"0px",borderBottomWidth:"0px",borderLeftWidth:"0px"}:window.getComputedStyle(n);let l;s.width-=(parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth))*r.x,s.height-=(parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth))*r.y,l=t.of?"string"==typeof t.of?"window"===t.of?{borderTopWidth:"0px",borderRightWidth:"0px",borderBottomWidth:"0px",borderLeftWidth:"0px"}:document.querySelector(t.of).getBoundingClientRect():Object.getPrototypeOf(t.of).jquery?t.of[0].getBoundingClientRect():t.of.getBoundingClientRect():s;let c="0px";t.my.startsWith("left-")?t.at.startsWith("left-")?c=t.of?l.left-s.left-parseFloat(i.borderLeftWidth)+"px":"0px":t.at.startsWith("center")?c=t.of?l.left-s.left-parseFloat(i.borderLeftWidth)+l.width/2+"px":s.width/2+"px":t.at.startsWith("right-")&&(c=t.of?l.left-s.left-parseFloat(i.borderLeftWidth)+l.width+"px":s.width+"px"):t.my.startsWith("center")?t.at.startsWith("left-")?c=t.of?l.left-s.left-parseFloat(i.borderLeftWidth)-o.width/2+"px":-o.width/2+"px":t.at.startsWith("center")?c=t.of?l.left-s.left-parseFloat(i.borderLeftWidth)-(o.width-l.width)/2+"px":s.width/2-o.width/2+"px":t.at.startsWith("right-")&&(c=t.of?l.left-s.left-parseFloat(i.borderLeftWidth)+(l.width-o.width/2)+"px":s.width-o.width/2+"px"):t.my.startsWith("right-")&&(t.at.startsWith("left-")?c=t.of?l.left-s.left-parseFloat(i.borderLeftWidth)-o.width+"px":-o.width+"px":t.at.startsWith("center")?c=t.of?l.left-s.left-parseFloat(i.borderLeftWidth)-o.width+l.width/2+"px":s.width/2-o.width+"px":t.at.startsWith("right-")&&(c=t.of?l.left-s.left-parseFloat(i.borderLeftWidth)+l.width-o.width+"px":s.width-o.width+"px"));let d="0px";t.my.endsWith("-top")?t.at.endsWith("-top")?d=t.of?l.top-s.top-parseFloat(i.borderTopWidth)+"px":"0px":t.at.endsWith("center")?d=t.of?l.top-s.top-parseFloat(i.borderTopWidth)+l.height/2+"px":s.height/2+"px":t.at.endsWith("-bottom")&&(d=t.of?l.top-s.top-parseFloat(i.borderTopWidth)+l.height+"px":s.height+"px"):t.my.endsWith("center")?t.at.endsWith("-top")?d=t.of?l.top-s.top-parseFloat(i.borderTopWidth)-o.height/2+"px":-o.height/2+"px":t.at.endsWith("center")?d=t.of?l.top-s.top-parseFloat(i.borderTopWidth)-o.height/2+l.height/2+"px":s.height/2-o.height/2+"px":t.at.endsWith("-bottom")&&(d=t.of?l.top-s.top-parseFloat(i.borderTopWidth)-o.height/2+l.height+"px":s.height-o.height/2+"px"):t.my.endsWith("-bottom")&&(t.at.endsWith("-top")?d=t.of?l.top-s.top-parseFloat(i.borderTopWidth)-o.height+"px":-o.height+"px":t.at.endsWith("center")?d=t.of?l.top-s.top-parseFloat(i.borderTopWidth)-o.height+l.height/2+"px":s.height/2-o.height+"px":t.at.endsWith("-bottom")&&(d=t.of?l.top-s.top-parseFloat(i.borderTopWidth)-o.height+l.height+"px":s.height-o.height+"px")),e.style.left=1===r.x?c:parseFloat(c)/r.x+"px",e.style.top=1===r.y?d:parseFloat(d)/r.y+"px";let p=getComputedStyle(e),h={left:p.left,top:p.top};return t.autoposition&&t.my===t.at&&["left-top","center-top","right-top","left-bottom","center-bottom","right-bottom"].indexOf(t.my)>=0&&(h=this.applyPositionAutopos(e,h,t)),(t.offsetX||t.offsetY)&&(h=this.applyPositionOffset(e,h,t)),(t.minLeft||t.minTop||t.maxLeft||t.maxTop)&&(h=this.applyPositionMinMax(e,h,t)),t.modify&&(h=this.applyPositionModify(e,h,t)),e.style.opacity=1,e},applyPositionAutopos(e,t,n){const o=`${n.my}-${n.autoposition.toLowerCase()}`;e.classList.add(o);const a=Array.prototype.slice.call(document.querySelectorAll(`.${o}`)),s=a.indexOf(e);if(a.length>1){switch(n.autoposition){case"down":case"up":a.forEach((e,n)=>{n>0&&n<=s&&(t.top=parseFloat(t.top)+a[--n].getBoundingClientRect().height+jsPanel.autopositionSpacing+"px")});break;case"right":a.forEach((e,n)=>{n>0&&n<=s&&(t.left=parseFloat(t.left)+a[--n].getBoundingClientRect().width+jsPanel.autopositionSpacing+"px")});break;case"left":a.forEach((e,n)=>{n>0&&n<=s&&(t.left=parseFloat(t.left)-a[--n].getBoundingClientRect().width+jsPanel.autopositionSpacing+"px")})}e.style.left=t.left,e.style.top=t.top}return{left:t.left,top:t.top}},applyPositionOffset(e,t,n){["offsetX","offsetY"].forEach(e=>{n[e]?("function"==typeof n[e]&&(n[e]=n[e].call(t,t,n)),!1===isNaN(n[e])&&(n[e]=`${n[e]}px`)):n[e]="0px"}),e.style.left=`calc(${e.style.left} + ${n.offsetX})`,e.style.top=`calc(${e.style.top} + ${n.offsetY})`;const o=getComputedStyle(e);return{left:o.left,top:o.top}},applyPositionMinMax(e,t,n){if(["minLeft","minTop","maxLeft","maxTop"].forEach(e=>{n[e]&&("function"==typeof n[e]&&(n[e]=n[e].call(t,t,n)),(Number.isInteger(n[e])||n[e].match(/^\d+$/))&&(n[e]=`${n[e]}px`))}),n.minLeft){e.style.left=n.minLeft;let o=getComputedStyle(e).left;parseFloat(o)parseFloat(t.left)?e.style.left=t.left:t.left=o}if(n.maxTop){e.style.top=n.maxTop;let o=getComputedStyle(e).top;parseFloat(o)>parseFloat(t.top)?e.style.top=t.top:t.top=o}const o=getComputedStyle(e);return{left:o.left,top:o.top}},applyPositionModify(e,t,n){if(n.modify&&"function"==typeof n.modify){const o=n.modify.call(t,t,n);e.style.left=Number.isInteger(o.left)||o.left.match(/^\d+$/)?`${o.left}px`:o.left,e.style.top=Number.isInteger(o.top)||o.top.match(/^\d+$/)?`${o.top}px`:o.top}const o=getComputedStyle(e);return{left:o.left,top:o.top}},autopositionRemaining(e){let t;if(["left-top-down","left-top-right","center-top-down","right-top-down","right-top-left","left-bottom-up","left-bottom-right","center-bottom-up","right-bottom-up","right-bottom-left"].forEach(n=>{e.classList.contains(n)&&(t=n)}),t){("window"===e.options.container?document.body:e.options.container).querySelectorAll(`.${t}`).forEach(e=>{e.reposition()})}},addScript(e,t="text/javascript",n){if(!document.querySelector(`script[src="${e}"]`)){const o=document.createElement("script");n&&(o.onload=n),o.src=e,o.type=t,document.head.appendChild(o)}},ajax(obj,ajaxConfig){let objIsPanel;"object"==typeof obj&&obj.classList.contains("jsPanel")?objIsPanel=!0:(objIsPanel=!1,"string"==typeof obj&&(obj=document.querySelector(obj)));const configDefaults={method:"GET",async:!0,user:"",pwd:"",done:function(){objIsPanel?obj.content.innerHTML=this.responseText:obj.innerHTML=this.responseText},autoresize:!0,autoreposition:!0};let config;if("string"==typeof ajaxConfig)config=Object.assign({},configDefaults,{url:encodeURI(ajaxConfig),evalscripttags:!0});else{if("object"!=typeof ajaxConfig||!ajaxConfig.url){if(this.errorReporting)try{throw new jsPanel.jsPanelError("XMLHttpRequest seems to miss the url parameter!")}catch(e){jsPanel.error(e)}return obj}config=Object.assign({},configDefaults,ajaxConfig),config.url=encodeURI(ajaxConfig.url),!1===config.async&&(config.timeout=0,config.withCredentials&&(config.withCredentials=void 0),config.responseType&&(config.responseType=void 0))}const xhr=new XMLHttpRequest;return xhr.onreadystatechange=(()=>{if(4===xhr.readyState){if(200===xhr.status){if(config.done.call(xhr,obj),config.evalscripttags){const scripttags=xhr.responseText.match(/]*>([\s\S]*?)<\/script>/gi);scripttags&&scripttags.forEach(tag=>{const js=tag.replace(/]*>/i,"").replace(/<\/script>/i,"").trim();eval(js)})}}else config.fail&&config.fail.call(xhr,obj);if(config.always&&config.always.call(xhr,obj),objIsPanel){const e=obj.options.contentSize;if("string"==typeof e&&e.match(/auto/i)){const t=e.split(" "),n=Object.assign({},{width:t[0],height:t[1]});config.autoresize&&obj.resize(n),obj.classList.contains("jsPanel-contextmenu")||config.autoreposition&&obj.reposition()}else if("object"==typeof e&&("auto"===e.width||"auto"===e.height)){const t=Object.assign({},e);config.autoresize&&obj.resize(t),obj.classList.contains("jsPanel-contextmenu")||config.autoreposition&&obj.reposition()}}jsPanel.ajaxAlwaysCallbacks.length&&jsPanel.ajaxAlwaysCallbacks.forEach(e=>{e.call(obj,obj)})}}),xhr.open(config.method,config.url,config.async,config.user,config.pwd),xhr.timeout=config.timeout||0,config.withCredentials&&(xhr.withCredentials=config.withCredentials),config.responseType&&(xhr.responseType=config.responseType),config.beforeSend&&config.beforeSend.call(xhr),config.data?xhr.send(config.data):xhr.send(null),obj},createPanelTemplate(e=!0){const t=document.createElement("div");return t.className="jsPanel",t.style.left="0",t.style.top="0",e&&["close","maximize","normalize","minimize","smallify"].forEach(e=>{t.setAttribute(`data-btn${e}`,"enabled")}),t.innerHTML=`
\n
\n \n
\n \n
\n
\n \n \n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
`,t},createMinimizedTemplate(){const e=document.createElement("div");return e.className="jsPanel-replacement",e.innerHTML=`
\n
\n \n
\n \n
\n
\n \n \n \n
\n
\n
`,e},createSnapArea(e,t,n){const o=document.createElement("div"),a=e.parentElement;o.className=`jsPanel-snap-area jsPanel-snap-area-${t}`,"lt"===t||"rt"===t||"rb"===t||"lb"===t?(o.style.width=n+"px",o.style.height=n+"px"):"ct"===t||"cb"===t?o.style.height=n+"px":"lc"!==t&&"rc"!==t||(o.style.width=n+"px"),a!==document.body&&(o.style.position="absolute"),document.querySelector(`.jsPanel-snap-area.jsPanel-snap-area-${t}`)||e.parentElement.appendChild(o)},dragit(e,t={}){let n,o,a;const s=new CustomEvent("jspaneldragstart",{detail:e.id}),r=new CustomEvent("jspaneldrag",{detail:e.id}),i=new CustomEvent("jspaneldragstop",{detail:e.id});[s,r,i].forEach(t=>{t.panel=e});const l=e=>{let t=e.split("-");return t.forEach((e,n)=>{t[n]=e.charAt(0).toUpperCase()+e.slice(1)}),"snap"+t.join("")};let c=t.handles||this.defaults.dragit.handles,d=t.cursor||this.defaults.dragit.cursor;return e.querySelectorAll(c).forEach(c=>{c.style.touchAction="none",c.style.cursor=d,jsPanel.pointerdown.forEach(i=>{c.addEventListener(i,i=>{if(i.button&&i.button>0)return!1;if((a=Object.assign({},jsPanel.defaults.dragit,t)).disableOnMaximized&&"maximized"===e.status)return!1;if((a.containment||0===a.containment)&&(a.containment=jsPanel.pOcontainment(a.containment)),a.grid&&Array.isArray(a.grid)&&1===a.grid.length&&(a.grid[1]=a.grid[0]),a.snap&&("object"==typeof a.snap?a.snap=Object.assign({},jsPanel.defaultSnapConfig,a.snap):a.snap=jsPanel.defaultSnapConfig),i.target.closest(".jsPanel-ftr-btn"))return;e.controlbar.style.pointerEvents="none",e.content.style.pointerEvents="none",document.querySelectorAll("iframe").forEach(e=>{e.style.pointerEvents="none"});let l=window.getComputedStyle(e),c=parseFloat(l.left),d=parseFloat(l.top),p=parseFloat(l.width),h=parseFloat(l.height),f=i.touches?i.touches[0].clientX:i.clientX,m=i.touches?i.touches[0].clientY:i.clientY,g=e.parentElement,u=g.getBoundingClientRect(),b=window.getComputedStyle(g),y=e.getScaleFactor(),j=0;o=(t=>{if(t.preventDefault(),!n){if(document.dispatchEvent(s),e.style.opacity=a.opacity,e.snapped&&a.snap.resizeToPreSnap&&e.currentData.beforeSnap){e.resize(e.currentData.beforeSnap.width+" "+e.currentData.beforeSnap.height),e.setControls([".jsPanel-btn-normalize"]);let t=e.getBoundingClientRect(),n=f-(t.left+t.width),o=t.width/2;n>-o&&(j=n+o)}if(e.front(),e.snapped=!1,"maximized"===e.status&&(e.setControls([".jsPanel-btn-normalize"]),e.status="normalized"),a.drop&&a.drop.dropZones){let e=a.drop.dropZones.map(e=>jsPanel.pOcontainer(e)),t=[];e.forEach(function(e){e.length?e.forEach(function(e){t.push(e)}):t.push(e)}),t=t.filter(function(e,t,n){return n.indexOf(e)===t}),a.drop.dropZones=t}a.start.length&&jsPanel.processCallbacks(e,a.start,!1,{left:c,top:d,width:p,height:h},t)}let o,i,l,w,P,v,x,E,C,F;n=1;let z,S=t.touches?t.touches[0].clientX:t.clientX,A=t.touches?t.touches[0].clientY:t.clientY,k=window.getComputedStyle(e);if(g===document.body){let t=e.getBoundingClientRect();C=window.innerWidth-parseInt(b.borderLeftWidth,10)-parseInt(b.borderRightWidth,10)-(t.left+t.width),F=window.innerHeight-parseInt(b.borderTopWidth,10)-parseInt(b.borderBottomWidth,10)-(t.top+t.height)}else C=parseInt(b.width,10)-parseInt(b.borderLeftWidth,10)-parseInt(b.borderRightWidth,10)-(parseInt(k.left,10)+parseInt(k.width,10)),F=parseInt(b.height,10)-parseInt(b.borderTopWidth,10)-parseInt(b.borderBottomWidth,10)-(parseInt(k.top,10)+parseInt(k.height,10));o=parseFloat(k.left),l=parseFloat(k.top),P=C,x=F,a.snap&&("panel"===a.snap.trigger?(i=o**2,w=l**2,v=P**2,E=x**2):"pointer"===a.snap.trigger&&("window"===e.options.container?(o=S,i=S**2,w=(l=A)**2,v=(P=window.innerWidth-S)**2,E=(x=window.innerHeight-A)**2):(o=(z=e.overlaps(g,"paddingbox",t)).pointer.left,l=z.pointer.top,P=z.pointer.right,x=z.pointer.bottom,i=z.pointer.left**2,w=z.pointer.top**2,v=z.pointer.right**2,E=z.pointer.bottom**2)));let B=Math.sqrt(i+w),T=Math.sqrt(i+E),L=Math.sqrt(v+w),R=Math.sqrt(v+E),D=Math.abs(o-P)/2,W=Math.abs(l-x)/2,$=Math.sqrt(i+W**2),q=Math.sqrt(w+D**2),O=Math.sqrt(v+W**2),I=Math.sqrt(E+D**2);if(window.getSelection().removeAllRanges(),document.dispatchEvent(r),a.axis&&"x"!==a.axis||(e.style.left=c+(S-f)/y.x+j+"px"),a.axis&&"y"!==a.axis||(e.style.top=d+(A-m)/y.y+"px"),a.grid){let t=a.grid,n=a.axis,o=t[0]*Math.round((c+(S-f))/t[0]),s=t[1]*Math.round((d+(A-m))/t[1]);n&&"x"!==n||(e.style.left=`${o}px`),n&&"y"!==n||(e.style.top=`${s}px`)}if(a.containment||0===a.containment){let t,n,o=a.containment;if(e.options.container===document.body)t=window.innerWidth-parseFloat(k.width)-o[1],n=window.innerHeight-parseFloat(k.height)-o[2];else{let e=parseFloat(b.borderLeftWidth)+parseFloat(b.borderRightWidth),a=parseFloat(b.borderTopWidth)+parseFloat(b.borderBottomWidth);t=u.width/y.x-parseFloat(k.width)-o[1]-e,n=u.height/y.y-parseFloat(k.height)-o[2]-a}parseFloat(e.style.left)<=o[3]&&(e.style.left=o[3]+"px"),parseFloat(e.style.top)<=o[0]&&(e.style.top=o[0]+"px"),parseFloat(e.style.left)>=t&&(e.style.left=t+"px"),parseFloat(e.style.top)>=n&&(e.style.top=n+"px")}if(a.drag.length){let n={left:o,top:l,right:P,bottom:x,width:parseFloat(k.width),height:parseFloat(k.height)};jsPanel.processCallbacks(e,a.drag,!1,n,t)}if(a.snap){let t=a.snap.sensitivity,n=g===document.body?window.innerWidth/8:u.width/8,s=g===document.body?window.innerHeight/8:u.height/8;e.snappableTo=!1,jsPanel.removeSnapAreas(),B0&&z.pointer.top>0?(e.snappableTo="left-top",jsPanel.createSnapArea(e,"lt",t)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="left-top",jsPanel.createSnapArea(e,"lt",t))):T0&&z.pointer.bottom>0?(e.snappableTo="left-bottom",jsPanel.createSnapArea(e,"lb",t)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="left-bottom",jsPanel.createSnapArea(e,"lb",t))):L0&&z.pointer.top>0?(e.snappableTo="right-top",jsPanel.createSnapArea(e,"rt",t)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="right-top",jsPanel.createSnapArea(e,"rt",t))):R0&&z.pointer.bottom>0?(e.snappableTo="right-bottom",jsPanel.createSnapArea(e,"rb",t)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="right-bottom",jsPanel.createSnapArea(e,"rb",t))):l0?(e.snappableTo="center-top",jsPanel.createSnapArea(e,"ct",t)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="center-top",jsPanel.createSnapArea(e,"ct",t))):o0?(e.snappableTo="left-center",jsPanel.createSnapArea(e,"lc",t)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="left-center",jsPanel.createSnapArea(e,"lc",t))):P0?(e.snappableTo="right-center",jsPanel.createSnapArea(e,"rc",t)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="right-center",jsPanel.createSnapArea(e,"rc",t))):x0?(e.snappableTo="center-bottom",jsPanel.createSnapArea(e,"cb",t)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="center-bottom",jsPanel.createSnapArea(e,"cb",t)))}if(a.drop&&a.drop.dropZones){let n=jsPanel.isIE?"msElementsFromPoint":"elementsFromPoint",o=document[n](t.clientX,t.clientY);Array.isArray(o)||(o=Array.prototype.slice.call(o)),a.drop.dropZones.forEach(t=>{o.includes(t)&&(e.droppableTo=t)}),o.includes(e.droppableTo)||(e.droppableTo=!1)}}),jsPanel.pointermove.forEach(e=>{document.addEventListener(e,o)}),window.addEventListener("mouseout",t=>{null===t.relatedTarget&&jsPanel.pointermove.forEach(t=>{document.removeEventListener(t,o,!1),e.style.opacity=1})},!1)})}),jsPanel.pointerup.forEach(t=>{document.addEventListener(t,t=>{if(jsPanel.pointermove.forEach(e=>{document.removeEventListener(e,o)}),jsPanel.removeSnapAreas(),n){if(e.style.opacity=1,n=void 0,a.snap){switch(e.snappableTo){case"left-top":e.snap(a.snap.snapLeftTop);break;case"center-top":e.snap(a.snap.snapCenterTop);break;case"right-top":e.snap(a.snap.snapRightTop);break;case"right-center":e.snap(a.snap.snapRightCenter);break;case"right-bottom":e.snap(a.snap.snapRightBottom);break;case"center-bottom":e.snap(a.snap.snapCenterBottom);break;case"left-bottom":e.snap(a.snap.snapLeftBottom);break;case"left-center":e.snap(a.snap.snapLeftCenter)}a.snap.callback&&e.snappableTo&&"function"==typeof a.snap.callback&&(a.snap.callback.call(e,e),a.snap.repositionOnSnap&&!1!==a.snap[l(e.snappableTo)]&&e.repositionOnSnap(e.snappableTo)),e.snappableTo&&a.snap.repositionOnSnap&&a.snap[l(e.snappableTo)]&&e.repositionOnSnap(e.snappableTo)}if(e.droppableTo&&e.droppableTo!==e.parentElement){let t=e.parentElement;e.move(e.droppableTo),a.drop.callback&&a.drop.callback.call(e,e,e.droppableTo,t)}if(document.dispatchEvent(i),a.stop.length){let n=window.getComputedStyle(e),o={left:parseFloat(n.left),top:parseFloat(n.top),width:parseFloat(n.width),height:parseFloat(n.height)};jsPanel.processCallbacks(e,a.stop,!1,o,t)}e.saveCurrentPosition(),e.calcSizeFactors()}e.controlbar.style.pointerEvents="inherit",e.content.style.pointerEvents="inherit",document.querySelectorAll("iframe").forEach(e=>{e.style.pointerEvents="auto"})})}),t.disable&&(c.style.pointerEvents="none")}),e},emptyNode(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e},extend(e){if("[object Object]"===Object.prototype.toString.call(e))for(let t in e)e.hasOwnProperty(t)&&(this.extensions[t]=e[t])},fetch(obj){const confDefaults={bodyMethod:"text",evalscripttags:!0,autoresize:!0,autoreposition:!0,done:(e,t)=>{e.content.innerHTML=t}},conf="string"==typeof obj.options.contentFetch?Object.assign({resource:obj.options.contentFetch},confDefaults):Object.assign(confDefaults,obj.options.contentFetch),fetchInit=conf.fetchInit||{};if(!conf.resource){if(this.errorReporting)try{throw new jsPanel.jsPanelError("The Fetch request seems to miss the resource parameter")}catch(e){jsPanel.error(e)}return obj}conf.beforeSend&&conf.beforeSend.call(obj,obj),fetch(conf.resource,fetchInit).then(e=>{if(e.ok)return e[conf.bodyMethod]()}).then(response=>{if(conf.done.call(obj,obj,response),conf.evalscripttags){const scripttags=response.match(/]*>([\s\S]*?)<\/script>/gi);scripttags&&scripttags.forEach(tag=>{let js=tag.replace(/]*>/i,"").replace(/<\/script>/i,"").trim();eval(js)})}const oContentSize=obj.options.contentSize;if(conf.autoresize||conf.autoreposition)if("string"==typeof oContentSize&&oContentSize.match(/auto/i)){const e=oContentSize.split(" "),t=Object.assign({},{width:e[0],height:e[1]});conf.autoresize&&obj.resize(t),obj.classList.contains("jsPanel-contextmenu")||conf.autoreposition&&obj.reposition()}else if("object"==typeof oContentSize&&("auto"===oContentSize.width||"auto"===oContentSize.height)){const e=Object.assign({},oContentSize);conf.autoresize&&obj.resize(e),obj.classList.contains("jsPanel-contextmenu")||conf.autoreposition&&obj.reposition()}})},getPanels:(e=function(){return this.classList.contains("jsPanel-standard")})=>Array.prototype.slice.call(document.querySelectorAll(".jsPanel")).filter(t=>e.call(t,t)).sort((e,t)=>t.style.zIndex-e.style.zIndex),pOcontainer(e){if("window"===e)return document.body;if("string"==typeof e){let t=document.querySelectorAll(e);return!!(t.length&&t.length>0)&&t}return 1===e.nodeType?e:!!e.length&&e[0]},pOcontainment(e){let t=e;if("function"==typeof e&&(t=e()),"number"==typeof t)return[t,t,t,t];if(Array.isArray(t)){if(1===t.length)return[t[0],t[0],t[0],t[0]];if(2===t.length)return t.concat(t);3===t.length&&(t[3]=t[1])}return t},pOsize(e,t){let n=t||this.defaults.contentSize;const o=e.parentElement;if("string"==typeof n){const e=n.trim().split(" ");(n={}).width=e[0],2===e.length?n.height=e[1]:n.height=e[0]}else n.width&&!n.height?n.height=n.width:n.height&&!n.width&&(n.width=n.height);if(String(n.width).match(/^[0-9.]+$/gi))n.width+="px";else if("string"==typeof n.width&&n.width.endsWith("%"))if(o===document.body)n.width=window.innerWidth*(parseFloat(n.width)/100)+"px";else{const e=window.getComputedStyle(o),t=parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth);n.width=(parseFloat(e.width)-t)*(parseFloat(n.width)/100)+"px"}else"function"==typeof n.width&&(n.width=n.width.call(e,e),"number"==typeof n.width?n.width+="px":"string"==typeof n.width&&n.width.match(/^[0-9.]+$/gi)&&(n.width+="px"));if(String(n.height).match(/^[0-9.]+$/gi))n.height+="px";else if("string"==typeof n.height&&n.height.endsWith("%"))if(o===document.body)n.height=window.innerHeight*(parseFloat(n.height)/100)+"px";else{const e=window.getComputedStyle(o),t=parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth);n.height=(parseFloat(e.height)-t)*(parseFloat(n.height)/100)+"px"}else"function"==typeof n.height&&(n.height=n.height.call(e,e),"number"==typeof n.height?n.height+="px":"string"==typeof n.height&&n.height.match(/^[0-9.]+$/gi)&&(n.height+="px"));return n},pOborder(e){e=e.trim();const t=new Array(3),n=e.match(/\s*(none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset)\s*/gi),o=e.match(/\s*(thin|medium|thick)|(\d*\.?\d+[a-zA-Z]{2,4})\s*/gi);return n?(t[1]=n[0].trim(),e=e.replace(t[1],"")):t[1]="solid",o?(t[0]=o[0].trim(),e=e.replace(t[0],"")):t[0]="medium",t[2]=e.trim(),t},pOheaderControls(e){if("string"==typeof e){let t={},n=e.toLowerCase(),o=n.match(/xl|lg|md|sm|xs/),a=n.match(/closeonly|none/);return o&&(t.size=o[0]),a&&(t=Object.assign({},t,{maximize:"remove",normalize:"remove",minimize:"remove",smallify:"remove"}),"none"===a[0]&&(t.close="remove")),Object.assign({},this.defaults.headerControls,t)}return Object.assign({},this.defaults.headerControls,e)},processCallbacks(e,t,n="some",o,a){if("function"==typeof t&&(t=[t]),n)return t[n](t=>t.call(e,e,o,a));t.forEach(t=>{t.call(e,e,o,a)})},removeSnapAreas(){document.querySelectorAll(".jsPanel-snap-area").forEach(e=>{e.parentElement.removeChild(e)})},remClass:(e,t)=>(t.split(" ").forEach(t=>e.classList.remove(t)),e),resetZi(){this.zi=((e=jsPanel.ziBase)=>{let t=e;return{next:()=>t++}})(),Array.prototype.slice.call(document.querySelectorAll(".jsPanel-standard")).sort((e,t)=>e.style.zIndex-t.style.zIndex).forEach(e=>{e.style.zIndex=jsPanel.zi.next()})},resizeit(e,t={}){const n=new CustomEvent("jspanelresizestart",{detail:e.id}),o=new CustomEvent("jspanelresize",{detail:e.id}),a=new CustomEvent("jspanelresizestop",{detail:e.id});[n,o,a].forEach(t=>{t.panel=e});let s,r,i,l,c={};return c.handles=t.handles||jsPanel.defaults.resizeit.handles,c.handles.split(",").forEach(t=>{const n=document.createElement("DIV");n.className=`jsPanel-resizeit-handle jsPanel-resizeit-${t.trim()}`,n.style.zIndex=90,e.append(n)}),e.querySelectorAll(".jsPanel-resizeit-handle").forEach(a=>{jsPanel.pointerdown.forEach(function(d){a.addEventListener(d,a=>{if(a.preventDefault(),a.button&&a.button>0)return!1;let d=1;if(((c=Object.assign({},jsPanel.defaults.resizeit,t)).containment||0===c.containment)&&(c.containment=jsPanel.pOcontainment(c.containment)),c.aspectRatio&&!0===c.aspectRatio&&(c.aspectRatio="panel"),jsPanel.modifier){let e=jsPanel.modifier;"AltLeft"===e||"AltRight"===e?c.aspectRatio="content":"ControlLeft"===e||"ControlRight"===e?c.aspectRatio="panel":"ShiftLeft"!==e&&"ShiftRight"!==e||(d=2)}let p="function"==typeof c.maxWidth?c.maxWidth():c.maxWidth||1e4,h="function"==typeof c.maxHeight?c.maxHeight():c.maxHeight||1e4,f="function"==typeof c.minWidth?c.minWidth():c.minWidth,m="function"==typeof c.minHeight?c.minHeight():c.minHeight;e.content.style.pointerEvents="none",document.querySelectorAll("iframe").forEach(e=>{e.style.pointerEvents="none"});const g=e.parentElement,u=g.tagName.toLowerCase(),b=e.getBoundingClientRect(),y=g.getBoundingClientRect(),j=window.getComputedStyle(g,null),w=parseInt(j.borderLeftWidth,10),P=parseInt(j.borderTopWidth,10),v=j.getPropertyValue("position"),x=a.clientX||a.touches[0].clientX,E=a.clientY||a.touches[0].clientY,C=x/E,F=b.width,z=b.height,S=a.target.classList,A=e.getScaleFactor(),k=b.width/b.height,B=e.content.getBoundingClientRect(),T=B.width/B.height,L=e.header.getBoundingClientRect().height,R=e.footer.getBoundingClientRect().height||0;let D=b.left,W=b.top,$=1e4,q=1e4,O=1e4,I=1e4;"body"!==u&&(D=b.left-y.left+g.scrollLeft,W=b.top-y.top+g.scrollTop),"body"===u&&c.containment?($=document.documentElement.clientWidth-b.left,O=document.documentElement.clientHeight-b.top,q=b.width+b.left,I=b.height+b.top):c.containment&&("static"===v?($=y.width-b.left+w,O=y.height+y.top-b.top+P,q=b.width+(b.left-y.left)-w,I=b.height+(b.top-y.top)-P):($=g.clientWidth-(b.left-y.left)/A.x+w,O=g.clientHeight-(b.top-y.top)/A.y+P,q=(b.width+b.left-y.left)/A.x-w,I=e.clientHeight+(b.top-y.top)/A.y-P)),c.containment&&(q-=c.containment[3],I-=c.containment[0],$-=c.containment[1],O-=c.containment[2]);const M=window.getComputedStyle(e),N=parseFloat(M.width)-b.width,H=parseFloat(M.height)-b.height;let X=parseFloat(M.left)-b.left,Y=parseFloat(M.top)-b.top;g!==document.body&&(X+=y.left,Y+=y.top);let V=parseInt(M.borderTopWidth,10),Z=parseInt(M.borderRightWidth,10),U=parseInt(M.borderBottomWidth,10),_=parseInt(M.borderLeftWidth,10);s=(t=>{r||(document.dispatchEvent(n),c.start.length&&jsPanel.processCallbacks(e,c.start,!1,{width:F,height:z,left:D,top:W},t),e.front(),e.status="normalized",e.setControls([".jsPanel-btn-normalize"])),r=1,document.dispatchEvent(o);let a,s=t.touches?t.touches[0].clientX:t.clientX,u=t.touches?t.touches[0].clientY:t.clientY;S.contains("jsPanel-resizeit-e")?((i=F+(s-x)*d/A.x+N)>=$&&(i=$),i>=p&&(i=p),i<=f&&(i=f),e.style.width=i+"px",2===d&&(e.style.left=D-(s-x)+"px"),"content"===c.aspectRatio?(e.style.height=(i-Z-_)/T+L+R+V+U+"px",c.containment&&(a=e.overlaps(g)).bottom<=c.containment[2]&&(e.style.height=O+"px",e.style.width=O*T+"px")):"panel"===c.aspectRatio&&(e.style.height=i/k+"px",c.containment&&(a=e.overlaps(g)).bottom<=c.containment[2]&&(e.style.height=O+"px",e.style.width=O*k+"px"))):S.contains("jsPanel-resizeit-s")?((l=z+(u-E)*d/A.y+H)>=O&&(l=O),l>=h&&(l=h),l<=m&&(l=m),e.style.height=l+"px",2===d&&(e.style.top=W-(u-E)+"px"),"content"===c.aspectRatio?(e.style.width=(l-L-R-V-U)*T+V+U+"px",c.containment&&(a=e.overlaps(g)).right<=c.containment[1]&&(e.style.width=$+"px",e.style.height=$/T+"px")):"panel"===c.aspectRatio&&(e.style.width=l*k+"px",c.containment&&(a=e.overlaps(g)).right<=c.containment[1]&&(e.style.width=$+"px",e.style.height=$/k+"px"))):S.contains("jsPanel-resizeit-w")?((i=F+(x-s)*d/A.x+N)<=p&&i>=f&&i<=q&&(e.style.left=D+(s-x)/A.x+X+"px"),i>=q&&(i=q),i>=p&&(i=p),i<=f&&(i=f),e.style.width=i+"px","content"===c.aspectRatio?(e.style.height=(i-Z-_)/T+L+R+V+U+"px",c.containment&&(a=e.overlaps(g)).bottom<=c.containment[2]&&(e.style.height=O+"px",e.style.width=O*T+"px")):"panel"===c.aspectRatio&&(e.style.height=i/k+"px",c.containment&&(a=e.overlaps(g)).bottom<=c.containment[2]&&(e.style.height=O+"px",e.style.width=O*k+"px"))):S.contains("jsPanel-resizeit-n")?((l=z+(E-u)*d/A.y+H)<=h&&l>=m&&l<=I&&(e.style.top=W+(u-E)/A.y+Y+"px"),l>=I&&(l=I),l>=h&&(l=h),l<=m&&(l=m),e.style.height=l+"px","content"===c.aspectRatio?(e.style.width=(l-L-R-V-U)*T+V+U+"px",c.containment&&(a=e.overlaps(g)).right<=c.containment[1]&&(e.style.width=$+"px",e.style.height=$/T+"px")):"panel"===c.aspectRatio&&(e.style.width=l*k+"px",c.containment&&(a=e.overlaps(g)).right<=c.containment[1]&&(e.style.width=$+"px",e.style.height=$/k+"px"))):S.contains("jsPanel-resizeit-se")?((i=F+(s-x)*d/A.x+N)>=$&&(i=$),i>=p&&(i=p),i<=f&&(i=f),e.style.width=i+"px",2===d&&(e.style.left=D-(s-x)+"px"),c.aspectRatio&&(e.style.height=i/k+"px"),(l=z+(u-E)*d/A.y+H)>=O&&(l=O),l>=h&&(l=h),l<=m&&(l=m),e.style.height=l+"px",2===d&&(e.style.top=W-(u-E)+"px"),"content"===c.aspectRatio?(e.style.width=(l-L-R-V-U)*T+V+U+"px",c.containment&&(a=e.overlaps(g)).right<=c.containment[1]&&(e.style.width=$+"px",e.style.height=$/T+"px")):"panel"===c.aspectRatio&&(e.style.width=l*k+"px",c.containment&&(a=e.overlaps(g)).right<=c.containment[1]&&(e.style.width=$+"px",e.style.height=$/k+"px"))):S.contains("jsPanel-resizeit-sw")?((l=z+(u-E)*d/A.y+H)>=O&&(l=O),l>=h&&(l=h),l<=m&&(l=m),e.style.height=l+"px",2===d&&(e.style.top=W-(u-E)+"px"),c.aspectRatio&&(e.style.width=l*k+"px"),(i=F+(x-s)*d/A.x+N)<=p&&i>=f&&i<=q&&(e.style.left=D+(s-x)/A.x+X+"px"),i>=q&&(i=q),i>=p&&(i=p),i<=f&&(i=f),e.style.width=i+"px","content"===c.aspectRatio?(e.style.height=(i-Z-_)/T+L+R+V+U+"px",c.containment&&(a=e.overlaps(g)).bottom<=c.containment[2]&&(e.style.height=O+"px",e.style.width=O*T+"px")):"panel"===c.aspectRatio&&(e.style.height=i/k+"px",c.containment&&(a=e.overlaps(g)).bottom<=c.containment[2]&&(e.style.height=O+"px",e.style.width=O*k+"px"))):S.contains("jsPanel-resizeit-ne")?((i=F+(s-x)*d/A.x+N)>=$&&(i=$),i>=p&&(i=p),i<=f&&(i=f),e.style.width=i+"px",2===d&&(e.style.left=D-(s-x)+"px"),c.aspectRatio&&(e.style.height=i/k+"px"),(l=z+(E-u)*d/A.y+H)<=h&&l>=m&&l<=I&&(e.style.top=W+(u-E)/A.y+Y+"px"),l>=I&&(l=I),l>=h&&(l=h),l<=m&&(l=m),e.style.height=l+"px","content"===c.aspectRatio?(e.style.width=(l-L-R-V-U)*T+V+U+"px",c.containment&&(a=e.overlaps(g)).right<=c.containment[1]&&(e.style.width=$+"px",e.style.height=$/T+"px")):"panel"===c.aspectRatio&&(e.style.width=l*k+"px",c.containment&&(a=e.overlaps(g)).right<=c.containment[1]&&(e.style.width=$+"px",e.style.height=$/k+"px"))):S.contains("jsPanel-resizeit-nw")&&(c.aspectRatio&&S.contains("jsPanel-resizeit-nw")&&(u=(s=u*C)/C),(i=F+(x-s)*d/A.x+N)<=p&&i>=f&&i<=q&&(e.style.left=D+(s-x)/A.x+X+"px"),i>=q&&(i=q),i>=p&&(i=p),i<=f&&(i=f),e.style.width=i+"px",c.aspectRatio&&(e.style.height=i/k+"px"),(l=z+(E-u)*d/A.y+H)<=h&&l>=m&&l<=I&&(e.style.top=W+(u-E)/A.y+Y+"px"),l>=I&&(l=I),l>=h&&(l=h),l<=m&&(l=m),e.style.height=l+"px","content"===c.aspectRatio?e.style.width=(l-L-R-V-U)*T+V+U+"px":"panel"===c.aspectRatio&&(e.style.width=l*k+"px")),window.getSelection().removeAllRanges();const b=window.getComputedStyle(e),y={left:parseFloat(b.left),top:parseFloat(b.top),right:parseFloat(b.right),bottom:parseFloat(b.bottom),width:parseFloat(b.width),height:parseFloat(b.height)};c.resize.length&&jsPanel.processCallbacks(e,c.resize,!1,y,t)}),jsPanel.pointermove.forEach(e=>{document.addEventListener(e,s,!1)}),window.addEventListener("mouseout",e=>{null===e.relatedTarget&&jsPanel.pointermove.forEach(e=>{document.removeEventListener(e,s,!1)})},!1)})})}),jsPanel.pointerup.forEach(function(t){document.addEventListener(t,t=>{if(jsPanel.pointermove.forEach(e=>{document.removeEventListener(e,s,!1)}),t.target.classList&&t.target.classList.contains("jsPanel-resizeit-handle")){let n,o,a=t.target.className;if(a.match(/jsPanel-resizeit-nw|jsPanel-resizeit-w|jsPanel-resizeit-sw/i)&&(n=!0),a.match(/jsPanel-resizeit-nw|jsPanel-resizeit-n|jsPanel-resizeit-ne/i)&&(o=!0),c.grid&&Array.isArray(c.grid)){1===c.grid.length&&(c.grid[1]=c.grid[0]);const t=parseFloat(e.style.width),a=parseFloat(e.style.height),s=t%c.grid[0],r=a%c.grid[1],i=parseFloat(e.style.left),l=parseFloat(e.style.top),d=i%c.grid[0],p=l%c.grid[1];s{e.style.pointerEvents="auto"})},!1)}),t.disable&&e.querySelectorAll(".jsPanel-resizeit-handle").forEach(e=>{e.style.pointerEvents="none"}),e},setClass:(e,t)=>(t.split(" ").forEach(t=>e.classList.add(t)),e),setStyles(e,t){for(let n in t)n in e.style?e.style[n]=t[n]:e.style.setProperty(n,t[n]);return e},setStyle(e,t){return this.setStyles.call(e,e,t)},jsPanelError(e){this.prototype=new Error,this.message=e,this.name="jsPanel Error"},error(e){this.create({paneltype:"error",dragit:!1,resizeit:!1,theme:{bgPanel:"white",bgContent:"white",colorHeader:"rebeccapurple",colorContent:"#333",border:"2px solid rebeccapurple"},borderRadius:".33rem",headerControls:"closeonly xs",headerTitle:"⚠ jsPanel Error",contentSize:{width:"50%",height:"auto"},position:"center-top 0 5 down",animateIn:"jsPanelFadeIn",content:`

${e.message}

`})},create(e={},t){jsPanel.zi||(jsPanel.zi=((e=jsPanel.ziBase)=>{let t=e;return{next:()=>t++}})()),e.config?delete(e=Object.assign({},this.defaults,e.config,e)).config:e=Object.assign({},this.defaults,e),e.id?"function"==typeof e.id&&(e.id=e.id()):e.id=`jsPanel-${jsPanel.idCounter+=1}`;const n=document.getElementById(e.id);if(null!==n){if(n.classList.contains("jsPanel")&&n.front(),this.errorReporting)try{throw new jsPanel.jsPanelError("◀ COULD NOT CREATE NEW JSPANEL ►
An element with the ID "+e.id+" already exists in the document.")}catch(e){jsPanel.error(e)}return!1}let o=this.pOcontainer(e.container);if("object"==typeof o&&o.length&&o.length>0&&(o=o[0]),!o){if(this.errorReporting)try{throw new jsPanel.jsPanelError("◀ COULD NOT CREATE NEW JSPANEL ►
The container to append the panel to does not exist")}catch(e){jsPanel.error(e)}return!1}["onbeforeclose","onbeforemaximize","onbeforeminimize","onbeforenormalize","onbeforesmallify","onbeforeunsmallify","onclosed","onfronted","onmaximized","onminimized","onnormalized","onsmallified","onstatuschange","onunsmallified"].forEach(t=>{e[t]?"function"==typeof e[t]&&(e[t]=[e[t]]):e[t]=[]});const a=e.template?e.template:this.createPanelTemplate();a.options=e,a.closetimer=void 0,a.status="initialized",a.currentData={},a.header=a.querySelector(".jsPanel-hdr"),a.headerbar=a.header.querySelector(".jsPanel-headerbar"),a.titlebar=a.header.querySelector(".jsPanel-titlebar"),a.headerlogo=a.headerbar.querySelector(".jsPanel-headerlogo"),a.headertitle=a.headerbar.querySelector(".jsPanel-title"),a.controlbar=a.headerbar.querySelector(".jsPanel-controlbar"),a.headertoolbar=a.header.querySelector(".jsPanel-hdr-toolbar"),a.content=a.querySelector(".jsPanel-content"),a.footer=a.querySelector(".jsPanel-ftr"),a.snappableTo=!1,a.snapped=!1,a.droppableTo=!1,a.autocloseProgressbar=a.querySelector(".jsPanel-autoclose-progressbar");const s=new CustomEvent("jspanelloaded",{detail:e.id}),r=new CustomEvent("jspanelstatuschange",{detail:e.id}),i=new CustomEvent("jspanelbeforenormalize",{detail:e.id}),l=new CustomEvent("jspanelnormalized",{detail:e.id}),c=new CustomEvent("jspanelbeforemaximize",{detail:e.id}),d=new CustomEvent("jspanelmaximized",{detail:e.id}),p=new CustomEvent("jspanelbeforeminimize",{detail:e.id}),h=new CustomEvent("jspanelminimized",{detail:e.id}),f=new CustomEvent("jspanelbeforesmallify",{detail:e.id}),m=new CustomEvent("jspanelsmallified",{detail:e.id}),g=new CustomEvent("jspanelsmallifiedmax",{detail:e.id}),u=new CustomEvent("jspanelbeforeunsmallify",{detail:e.id}),b=new CustomEvent("jspanelfronted",{detail:e.id}),y=new CustomEvent("jspanelbeforeclose",{detail:e.id}),j=new CustomEvent("jspanelclosed",{detail:e.id}),w=new CustomEvent("jspanelcloseduser",{detail:e.id});[s,r,i,l,c,d,p,h,f,m,g,u,b,y,j,w].forEach(e=>{e.panel=a});const P=a.querySelector(".jsPanel-btn-close"),v=a.querySelector(".jsPanel-btn-maximize"),x=a.querySelector(".jsPanel-btn-normalize"),E=a.querySelector(".jsPanel-btn-smallify"),C=a.querySelector(".jsPanel-btn-minimize");"onpointerdown"in window&&a.controlbar.querySelectorAll(".jsPanel-btn").forEach(e=>{e.addEventListener("pointerdown",e=>{e.preventDefault()},!0)}),P&&jsPanel.pointerup.forEach(e=>{P.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;a.close(null,!0)})}),v&&jsPanel.pointerup.forEach(e=>{v.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;a.maximize()})}),x&&jsPanel.pointerup.forEach(e=>{x.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;a.normalize()})}),E&&jsPanel.pointerup.forEach(e=>{E.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;"normalized"===a.status||"maximized"===a.status?a.smallify():"smallified"!==a.status&&"smallifiedmax"!==a.status||a.unsmallify()})}),C&&jsPanel.pointerup.forEach(e=>{C.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;a.minimize()})});let F=jsPanel.extensions;for(let e in F)F.hasOwnProperty(e)&&(a[e]=F[e]);if(a.clearTheme=(e=>(jsPanel.themes.forEach(e=>{["panel",`jsPanel-theme-${e}`,`panel-${e}`,`${e}-color`].forEach(e=>{a.classList.remove(e)}),a.header.classList.remove(`jsPanel-theme-${e}`)}),a.content.classList.remove("jsPanel-content-filled","jsPanel-content-filledlight"),a.header.classList.remove("jsPanel-hdr-light"),a.header.classList.remove("jsPanel-hdr-dark"),a.style.backgroundColor="",jsPanel.setStyle(a.headertoolbar,{boxShadow:"",width:"",marginLeft:"",borderTopColor:"transparent"}),jsPanel.setStyle(a.content,{background:"",borderTopColor:"transparent"}),a.header.style.background="",Array.prototype.slice.call(a.controlbar.querySelectorAll(".jsPanel-icon")).concat([a.headerlogo,a.headertitle,a.headertoolbar,a.content]).forEach(e=>{e.style.color=""}),e&&e.call(a,a),a)),a.getThemeDetails=(e=>{const t=e.toLowerCase(),n={color:!1,colors:!1,filling:!1},o=t.split("fill");if(n.color=o[0].trim().replace(/\s*/g,""),2===o.length)if(o[1].startsWith("edlight"))n.filling="filledlight";else if(o[1].startsWith("eddark"))n.filling="filleddark";else if(o[1].startsWith("ed"))n.filling="filled";else if(o[1].startsWith("color")){let e=o[1].split("color"),t=e[e.length-1].trim().replace(/\s*/g,"");jsPanel.colorNames[t]&&(t=jsPanel.colorNames[t]),t.match(/^([0-9a-f]{3}|[0-9a-f]{6})$/gi)&&(t="#"+t),n.filling=t}if(jsPanel.themes.some(e=>e===n.color.split(/\s/i)[0])){let e=n.color.split(/\s/i)[0],t=document.createElement("button");t.className=e+"-bg",document.body.appendChild(t),n.color=getComputedStyle(t).backgroundColor.replace(/\s+/gi,""),document.body.removeChild(t),t=void 0}else if(n.color.startsWith("bootstrap-")){let e=n.color.indexOf("-"),t=document.createElement("button");t.className="btn btn"+n.color.slice(e),document.body.appendChild(t),n.color=getComputedStyle(t).backgroundColor.replace(/\s+/gi,""),document.body.removeChild(t),t=void 0}else if(n.color.startsWith("mdb-")){let e,t=n.color.indexOf("-")+1,o=document.createElement("span");e=n.color.endsWith("-dark")?(e=n.color.slice(t)).replace("-dark","-color-dark"):n.color.slice(t)+"-color",o.className=e,document.body.appendChild(o),n.color=getComputedStyle(o).backgroundColor.replace(/\s+/gi,""),document.body.removeChild(o),o=void 0}return n.colors=jsPanel.calcColors(n.color),n}),a.applyColorTheme=(e=>{if(a.style.backgroundColor=e.colors[0],a.header.style.backgroundColor=e.colors[0],a.header.style.color=e.colors[3],[".jsPanel-headerlogo",".jsPanel-title",".jsPanel-hdr-toolbar"].forEach(t=>{a.querySelector(t).style.color=e.colors[3]}),a.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(t=>{t.style.color=e.colors[3]}),"string"==typeof a.options.theme&&"filled"===e.filling&&(a.content.style.borderTop="#000000"===e.colors[3]?"1px solid rgba(0,0,0,0.15)":"1px solid rgba(255,255,255,0.15)"),"#000000"===e.colors[3]?a.header.classList.add("jsPanel-hdr-light"):a.header.classList.add("jsPanel-hdr-dark"),e.filling)switch(e.filling){case"filled":jsPanel.setStyle(a.content,{backgroundColor:e.colors[2],color:e.colors[3]});break;case"filledlight":a.content.style.backgroundColor=e.colors[1];break;case"filleddark":jsPanel.setStyle(a.content,{backgroundColor:e.colors[6],color:e.colors[7]});break;default:a.content.style.backgroundColor=e.filling,a.content.style.color=jsPanel.perceivedBrightness(e.filling)<=jsPanel.colorBrightnessThreshold?"#fff":"#000"}return a}),a.applyCustomTheme=(e=>{let t,n={bgPanel:"#fff",bgContent:"#fff",colorHeader:"#000",colorContent:"#000"},o=(t="object"==typeof e?Object.assign(n,e):n).bgPanel,s=t.bgContent,r=t.colorHeader,i=t.colorContent;if(jsPanel.colorNames[o]?a.style.background="#"+jsPanel.colorNames[o]:a.style.background=o,jsPanel.colorNames[r]&&(r="#"+jsPanel.colorNames[r]),[".jsPanel-headerlogo",".jsPanel-title",".jsPanel-hdr-toolbar"].forEach(e=>{a.querySelector(e).style.color=r}),a.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(e=>{e.style.color=r}),jsPanel.colorNames[s]?a.content.style.background="#"+jsPanel.colorNames[s]:a.content.style.background=s,jsPanel.colorNames[i]?a.content.style.color="#"+jsPanel.colorNames[i]:a.content.style.color=i,jsPanel.perceivedBrightness(r)>jsPanel.colorBrightnessThreshold?a.header.classList.add("jsPanel-hdr-dark"):a.header.classList.add("jsPanel-hdr-light"),jsPanel.perceivedBrightness(i)>jsPanel.colorBrightnessThreshold?a.content.style.borderTop="1px solid rgba(255,255,255,0.15)":a.content.style.borderTop="1px solid rgba(0,0,0,0.15)",t.border){let e=t.border,n=e.lastIndexOf(" "),o=e.slice(++n);jsPanel.colorNames[o]&&(e=e.replace(o,"#"+jsPanel.colorNames[o])),a.style.border=e}return a}),a.setBorder=(e=>{let t=jsPanel.pOborder(e);return t[2].length?jsPanel.colorNames[t[2]]&&(t[2]="#"+jsPanel.colorNames[t[2]]):t[2]=a.style.backgroundColor,t=t.join(" "),a.style.border=t,a.options.border=t,a}),a.setBorderRadius=(e=>{"number"==typeof e&&(e+="px"),a.style.borderRadius=e;const t=getComputedStyle(a);return a.querySelector(".jsPanel-hdr")?(a.header.style.borderTopLeftRadius=t.borderTopLeftRadius,a.header.style.borderTopRightRadius=t.borderTopRightRadius):(a.content.style.borderTopLeftRadius=t.borderTopLeftRadius,a.content.style.borderTopRightRadius=t.borderTopRightRadius),a.querySelector(".jsPanel-ftr.active")?(a.footer.style.borderBottomRightRadius=t.borderBottomRightRadius,a.footer.style.borderBottomLeftRadius=t.borderBottomLeftRadius):(a.content.style.borderBottomRightRadius=t.borderBottomRightRadius,a.content.style.borderBottomLeftRadius=t.borderBottomLeftRadius),a}),a.setTheme=((t=e.theme,n)=>{let o;if("minimized"===a.status&&(o=!0,a.normalize()),a.clearTheme(),"object"==typeof t)e.border=void 0,a.applyCustomTheme(t);else{"none"===t&&(t="white");let e=a.getThemeDetails(t);a.applyColorTheme(e)}return o&&a.minimize(),n&&n.call(a,a),a}),a.close=((e,t)=>{a.closetimer&&window.clearInterval(a.closetimer);const n=a.id,o=a.parentElement;if(document.dispatchEvent(y),a.options.onbeforeclose&&a.options.onbeforeclose.length>0&&!jsPanel.processCallbacks(a,a.options.onbeforeclose,"some",a.status,t))return a;a.options.animateOut?(a.options.animateIn&&jsPanel.remClass(a,a.options.animateIn),jsPanel.setClass(a,a.options.animateOut),a.addEventListener("animationend",s=>{s.stopPropagation(),o.removeChild(a),document.getElementById(n)?e&&e.call(a,n,a):(a.removeMinimizedReplacement(),t&&document.dispatchEvent(w),document.dispatchEvent(j),a.options.onclosed&&jsPanel.processCallbacks(a,a.options.onclosed,"every",t),jsPanel.autopositionRemaining(a),e&&e.call(n,n))})):(o.removeChild(a),document.getElementById(n)?e&&e.call(a,n,a):(a.removeMinimizedReplacement(),t&&document.dispatchEvent(w),document.dispatchEvent(j),a.options.onclosed&&jsPanel.processCallbacks(a,a.options.onclosed,"every",t),jsPanel.autopositionRemaining(a),e&&e.call(n,n)))}),a.maximize=((t,n)=>{if(a.statusBefore=a.status,e.onbeforemaximize&&e.onbeforemaximize.length>0&&!jsPanel.processCallbacks(a,e.onbeforemaximize,"some",a.statusBefore))return a;document.dispatchEvent(c);const o=a.parentElement,s=jsPanel.pOcontainment(e.maximizedMargin);return o===document.body?(a.style.width=document.documentElement.clientWidth-s[1]-s[3]+"px",a.style.height=document.documentElement.clientHeight-s[0]-s[2]+"px",a.style.left=s[3]+"px",a.style.top=s[0]+"px",e.position.fixed||(a.style.left=window.pageXOffset+s[3]+"px",a.style.top=window.pageYOffset+s[0]+"px")):(a.style.width=o.clientWidth-s[1]-s[3]+"px",a.style.height=o.clientHeight-s[0]-s[2]+"px",a.style.left=s[3]+"px",a.style.top=s[0]+"px"),E.style.transform="unset",a.removeMinimizedReplacement(),a.status="maximized",a.setControls([".jsPanel-btn-maximize"]),n||a.front(),document.dispatchEvent(d),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore),t&&t.call(a,a,a.statusBefore),e.onmaximized&&jsPanel.processCallbacks(a,e.onmaximized,"every",a.statusBefore),a}),a.minimize=(t=>{if("minimized"===a.status)return a;if(a.statusBefore=a.status,e.onbeforeminimize&&e.onbeforeminimize.length>0&&!jsPanel.processCallbacks(a,e.onbeforeminimize,"some",a.statusBefore))return a;if(document.dispatchEvent(p),!document.getElementById("jsPanel-replacement-container")){const e=document.createElement("div");e.id="jsPanel-replacement-container",document.body.append(e)}if(a.style.left="-9999px",a.status="minimized",document.dispatchEvent(h),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore),e.minimizeTo){let t,n,o,s=a.createMinimizedReplacement();switch(e.minimizeTo){case"default":document.getElementById("jsPanel-replacement-container").append(s);break;case"parentpanel":(t=(o=(n=a.closest(".jsPanel-content").parentElement).querySelectorAll(".jsPanel-minimized-box"))[o.length-1]).append(s);break;case"parent":(t=(n=a.parentElement).querySelector(".jsPanel-minimized-container"))||((t=document.createElement("div")).className="jsPanel-minimized-container",n.append(t)),t.append(s);break;default:document.querySelector(e.minimizeTo).append(s)}}return t&&t.call(a,a,a.statusBefore),e.onminimized&&jsPanel.processCallbacks(a,e.onminimized,"every",a.statusBefore),a}),a.normalize=(t=>"normalized"===a.status?a:(a.statusBefore=a.status,e.onbeforenormalize&&e.onbeforenormalize.length>0&&!jsPanel.processCallbacks(a,e.onbeforenormalize,"some",a.statusBefore)?a:(document.dispatchEvent(i),a.style.width=a.currentData.width,a.style.height=a.currentData.height,a.snapped?a.snap(a.snapped,!0):(a.style.left=a.currentData.left,a.style.top=a.currentData.top),E.style.transform="unset",a.removeMinimizedReplacement(),a.status="normalized",a.setControls([".jsPanel-btn-normalize"]),a.front(),document.dispatchEvent(l),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore),t&&t.call(a,a,a.statusBefore),e.onnormalized&&jsPanel.processCallbacks(a,e.onnormalized,"every",a.statusBefore),a))),a.smallify=(t=>{if("smallified"===a.status||"smallifiedmax"===a.status)return a;if(a.statusBefore=a.status,e.onbeforesmallify&&e.onbeforesmallify.length>0&&!jsPanel.processCallbacks(a,e.onbeforesmallify,"some",a.statusBefore))return a;document.dispatchEvent(f),a.style.overflow="hidden";const n=window.getComputedStyle(a),o=parseFloat(window.getComputedStyle(a.headerbar).height);a.style.height=parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth)+o+"px",E.style.transform="rotate(180deg)","normalized"===a.status?(a.setControls([".jsPanel-btn-normalize"]),a.status="smallified",document.dispatchEvent(m),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore)):"maximized"===a.status&&(a.setControls([".jsPanel-btn-maximize"]),a.status="smallifiedmax",document.dispatchEvent(g),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore));const s=a.querySelectorAll(".jsPanel-minimized-box");return s[s.length-1].style.display="none",t&&t.call(a,a,a.statusBefore),e.onsmallified&&jsPanel.processCallbacks(a,e.onsmallified,"every",a.statusBefore),a}),a.unsmallify=(t=>{if(a.statusBefore=a.status,"smallified"===a.status||"smallifiedmax"===a.status){if(e.onbeforeunsmallify&&e.onbeforeunsmallify.length>0&&!jsPanel.processCallbacks(a,e.onbeforeunsmallify,"some",a.statusBefore))return a;document.dispatchEvent(u),a.style.overflow="visible",a.front(),"smallified"===a.status?(a.style.height=a.currentData.height,a.setControls([".jsPanel-btn-normalize"]),a.status="normalized",document.dispatchEvent(l),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore)):"smallifiedmax"===a.status?a.maximize():"minimized"===a.status&&a.normalize(),E.style.transform="rotate(0deg)";const n=a.querySelectorAll(".jsPanel-minimized-box");n[n.length-1].style.display="flex",t&&t.call(a,a,a.statusBefore),e.onunsmallified&&jsPanel.processCallbacks(a,e.onunsmallified,"every",a.statusBefore)}return a}),a.front=((t,n=!0)=>{if("minimized"===a.status)"maximized"===a.statusBefore?a.maximize():a.normalize();else{const e=Array.prototype.slice.call(document.querySelectorAll(".jsPanel-standard")).map(e=>e.style.zIndex);Math.max(...e)>a.style.zIndex&&(a.style.zIndex=jsPanel.zi.next()),jsPanel.resetZi()}return document.dispatchEvent(b),t&&t.call(a,a),e.onfronted&&n&&jsPanel.processCallbacks(a,e.onfronted,"every",a.status),a}),a.snap=((e,t=!1)=>{if(t||(a.currentData.beforeSnap={width:a.currentData.width,height:a.currentData.height}),e&&"function"==typeof e&&!t)e.call(a,a,a.snappableTo);else if(!1!==e){const e=[0,0];if(a.options.dragit.snap.containment&&a.options.dragit.containment){const t=jsPanel.pOcontainment(a.options.dragit.containment),n=a.snappableTo;n.startsWith("left")?e[0]=t[3]:n.startsWith("right")&&(e[0]=-t[1]),n.endsWith("top")?e[1]=t[0]:n.endsWith("bottom")&&(e[1]=-t[2])}a.reposition(`${a.snappableTo} ${e[0]} ${e[1]}`)}t||(a.snapped=a.snappableTo)}),a.move=((e,t)=>{let n=a.overlaps(e,"paddingbox"),o=a.parentElement;return e.appendChild(a),a.options.container=e,a.style.left=n.left+"px",a.style.top=n.top+"px",a.saveCurrentDimensions(),a.saveCurrentPosition(),a.calcSizeFactors(),t&&t.call(a,a,e,o),a}),a.closeChildpanels=(e=>(a.getChildpanels().forEach(e=>e.close()),e&&e.call(a,a),a)),a.getChildpanels=(e=>{const t=a.content.querySelectorAll(".jsPanel");return e&&t.forEach((t,n,o)=>{e.call(t,t,n,o)}),t}),a.isChildpanel=(e=>{const t=a.closest(".jsPanel-content"),n=t?t.parentElement:null;return e&&e.call(a,a,n),!!t&&n}),a.contentRemove=(e=>(jsPanel.emptyNode(a.content),e&&e.call(a,a),a)),a.createMinimizedReplacement=(()=>{const t=jsPanel.createMinimizedTemplate(),n=window.getComputedStyle(a.headertitle).color,o=window.getComputedStyle(a),s=e.iconfont,r=t.querySelector(".jsPanel-controlbar");return"auto-show-hide"!==a.options.header?jsPanel.setStyle(t,{backgroundColor:o.backgroundColor,backgroundPositionX:o.backgroundPositionX,backgroundPositionY:o.backgroundPositionY,backgroundRepeat:o.backgroundRepeat,backgroundAttachment:o.backgroundAttachment,backgroundImage:o.backgroundImage,backgroundSize:o.backgroundSize,backgroundOrigin:o.backgroundOrigin,backgroundClip:o.backgroundClip}):t.style.backgroundColor=window.getComputedStyle(a.header).backgroundColor,t.id=a.id+"-min",t.querySelector(".jsPanel-headerbar").replaceChild(a.headerlogo.cloneNode(!0),t.querySelector(".jsPanel-headerlogo")),t.querySelector(".jsPanel-titlebar").replaceChild(a.headertitle.cloneNode(!0),t.querySelector(".jsPanel-title")),t.querySelector(".jsPanel-titlebar").setAttribute("title",a.headertitle.textContent),t.querySelector(".jsPanel-title").style.color=n,r.style.color=n,r.querySelectorAll("button").forEach(e=>{e.style.color=n}),["jsPanel-hdr-dark","jsPanel-hdr-light"].forEach(e=>{a.header.classList.contains(e)&&t.querySelector(".jsPanel-hdr").classList.add(e)}),a.setIconfont(s,t),"onpointerdown"in window&&t.querySelectorAll(".jsPanel-btn").forEach(e=>{e.addEventListener("pointerdown",e=>{e.preventDefault()},!0)}),"enabled"===a.dataset.btnnormalize?jsPanel.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-normalize").addEventListener(e,()=>{a.normalize()})}):r.querySelector(".jsPanel-btn-normalize").style.display="none","enabled"===a.dataset.btnmaximize?jsPanel.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-maximize").addEventListener(e,()=>{a.maximize()})}):r.querySelector(".jsPanel-btn-maximize").style.display="none","enabled"===a.dataset.btnclose?jsPanel.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-close").addEventListener(e,()=>{a.close(null,!0)})}):r.querySelector(".jsPanel-btn-close").style.display="none",t}),a.removeMinimizedReplacement=(()=>{const e=document.getElementById(`${a.id}-min`);e&&e.parentElement.removeChild(e)}),a.dragit=(t=>{const n=Object.assign({},jsPanel.defaults.dragit,e.dragit),o=a.querySelectorAll(n.handles);return"disable"===t?o.forEach(e=>{e.style.pointerEvents="none"}):o.forEach(e=>{e.style.pointerEvents="auto"}),a}),a.resizeit=(e=>{const t=a.querySelectorAll(".jsPanel-resizeit-handle");return"disable"===e?t.forEach(e=>{e.style.pointerEvents="none"}):t.forEach(e=>{e.style.pointerEvents="auto"}),a}),a.getScaleFactor=(()=>{const e=a.getBoundingClientRect();return{x:e.width/a.offsetWidth,y:e.height/a.offsetHeight}}),a.calcSizeFactors=(()=>{const t=window.getComputedStyle(a);if("window"===e.container)a.hf=parseFloat(t.left)/(window.innerWidth-parseFloat(t.width)),a.vf=parseFloat(t.top)/(window.innerHeight-parseFloat(t.height));else if(a.parentElement){let e=a.parentElement.getBoundingClientRect();a.hf=parseFloat(t.left)/(e.width-parseFloat(t.width)),a.vf=parseFloat(t.top)/(e.height-parseFloat(t.height))}}),a.saveCurrentDimensions=((e=!1)=>{const t=window.getComputedStyle(a);a.currentData.width=t.width,"normalized"===a.status&&(a.currentData.height=t.height),e&&(a.style.height=t.height)}),a.saveCurrentPosition=(()=>{const e=window.getComputedStyle(a);a.currentData.left=e.left,a.currentData.top=e.top}),a.reposition=((...t)=>{let n,o=e.position,s=!0;return t.forEach(e=>{"string"==typeof e||"object"==typeof e?o=e:"boolean"==typeof e?s=e:"function"==typeof e&&(n=e)}),jsPanel.position(a,o),s&&a.saveCurrentPosition(),n&&n.call(a,a),a}),a.repositionOnSnap=(t=>{let n="0",o="0",s=jsPanel.pOcontainment(e.dragit.containment);if(e.dragit.snap.containment)switch(t){case"left-top":n=s[3],o=s[0];break;case"right-top":n=-s[1],o=s[0];break;case"right-bottom":n=-s[1],o=-s[2];break;case"left-bottom":n=s[3],o=-s[2];break;case"center-top":n=s[3]/2-s[1]/2,o=s[0];break;case"center-bottom":n=s[3]/2-s[1]/2,o=-s[2];break;case"left-center":n=s[3],o=s[0]/2-s[2]/2;break;case"right-center":n=-s[1],o=s[0]/2-s[2]/2}jsPanel.position(a,t),jsPanel.setStyle(a,{left:`calc(${a.style.left} + ${n}px)`,top:`calc(${a.style.top} + ${o}px)`})}),a.overlaps=((e,t,n)=>{let o,s=a.getBoundingClientRect(),r=getComputedStyle(a.parentElement),i=a.getScaleFactor(),l={top:0,right:0,bottom:0,left:0},c=0,d=0,p=0,h=0;"window"!==a.options.container&&"paddingbox"===t&&(l.top=parseInt(r.borderTopWidth,10)*i.y,l.right=parseInt(r.borderRightWidth,10)*i.x,l.bottom=parseInt(r.borderBottomWidth,10)*i.y,l.left=parseInt(r.borderLeftWidth,10)*i.x),o="string"==typeof e?"window"===e?{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}:"parent"===e?a.parentElement.getBoundingClientRect():document.querySelector(e).getBoundingClientRect():e.getBoundingClientRect(),n&&(c=n.touches?n.touches[0].clientX:n.clientX,d=n.touches?n.touches[0].clientY:n.clientY,p=c-o.left,h=d-o.top);let f=s.lefto.left,m=s.topo.top;return{overlaps:f&&m,top:s.top-o.top-l.top,right:o.right-s.right-l.right,bottom:o.bottom-s.bottom-l.bottom,left:s.left-o.left-l.left,parentBorderWidth:l,panelRect:s,referenceRect:o,pointer:{clientX:c,clientY:d,left:p-l.left,top:h-l.top,right:o.width-p-l.right,bottom:o.height-h-l.bottom}}}),a.setSize=(()=>{if(e.panelSize){const t=jsPanel.pOsize(a,e.panelSize);a.style.width=t.width,a.style.height=t.height}else if(e.contentSize){const t=jsPanel.pOsize(a,e.contentSize);a.content.style.width=t.width,a.content.style.height=t.height,a.style.width=t.width,a.content.style.width="100%"}return a}),a.resize=((...e)=>{let t,n=window.getComputedStyle(a),o={width:n.width,height:n.height},s=!0;e.forEach(e=>{"string"==typeof e?o=e:"object"==typeof e?o=Object.assign(o,e):"boolean"==typeof e?s=e:"function"==typeof e&&(t=e)});let r=jsPanel.pOsize(a,o);a.style.width=r.width,a.style.height=r.height,s&&a.saveCurrentDimensions(),a.status="normalized";let i=a.controlbar.querySelector(".jsPanel-btn-smallify");return i&&(i.style.transform="rotate(0deg)"),t&&t.call(a,a),a.calcSizeFactors(),a}),a.setControls=((e,t)=>(a.header.querySelectorAll(".jsPanel-btn").forEach(e=>{const t=e.className.split("-"),n=t[t.length-1];"hidden"!==a.getAttribute(`data-btn${n}`)&&(e.style.display="block")}),e.forEach(e=>{const t=a.controlbar.querySelector(e);t&&(t.style.display="none")}),t&&t.call(a,a),a)),a.setControlStatus=((e,t="enable",n)=>{const o=a.controlbar.querySelector(`.jsPanel-btn-${e}`);switch(t){case"disable":"removed"!==a.getAttribute(`data-btn${e}`)&&(a.setAttribute(`data-btn${e}`,"disabled"),o.style.pointerEvents="none",o.style.opacity=.4,o.style.cursor="default");break;case"hide":"removed"!==a.getAttribute(`data-btn${e}`)&&(a.setAttribute(`data-btn${e}`,"hidden"),o.style.display="none");break;case"show":"removed"!==a.getAttribute(`data-btn${e}`)&&(a.setAttribute(`data-btn${e}`,"enabled"),o.style.display="block",o.style.pointerEvents="auto",o.style.opacity=1,o.style.cursor="pointer");break;case"enable":"removed"!==a.getAttribute(`data-btn${e}`)&&("hidden"===a.getAttribute(`data-btn${e}`)&&(o.style.display="block"),a.setAttribute(`data-btn${e}`,"enabled"),o.style.pointerEvents="auto",o.style.opacity=1,o.style.cursor="pointer");break;case"remove":a.controlbar.removeChild(o),a.setAttribute(`data-btn${e}`,"removed")}return n&&n.call(a,a),a}),a.setControlSize=(e=>{const t=e.toLowerCase();a.controlbar.querySelectorAll(".jsPanel-btn").forEach(e=>{["jsPanel-btn-xl","jsPanel-btn-lg","jsPanel-btn-md","jsPanel-btn-sm","jsPanel-btn-xs"].forEach(t=>{e.classList.remove(t)}),e.classList.add(`jsPanel-btn-${t}`)}),"xl"===t?a.titlebar.style.fontSize="1.5rem":"lg"===t?a.titlebar.style.fontSize="1.25rem":"md"===t?a.titlebar.style.fontSize="1.05rem":"sm"===t?a.titlebar.style.fontSize=".9rem":"xs"===t&&(a.titlebar.style.fontSize=".8rem")}),a.setHeaderControls=(t=>{if(a.options.headerControls.add){let e=a.options.headerControls.add;Array.isArray(e)||(e=[e]),e.forEach(e=>{a.addControl(e)})}let n=[];a.controlbar.querySelectorAll(".jsPanel-btn").forEach(e=>{let t=e.className.match(/jsPanel-btn-[a-z0-9]{3,}/i)[0].substring(12);n.push(t)});const o=jsPanel.pOheaderControls(e.headerControls);return e.headerControls=o,n.forEach(e=>{o[e]&&a.setControlStatus(e,o[e])}),a.setControlSize(o.size),t&&t.call(a,a),a}),a.setHeaderLogo=((e,t)=>{let n=[a.headerlogo],o=document.querySelector("#"+a.id+"-min");return o&&n.push(o.querySelector(".jsPanel-headerlogo")),"string"==typeof e?"<"!==e.substr(0,1)?n.forEach(t=>{jsPanel.emptyNode(t);let n=document.createElement("img");n.src=e,t.append(n)}):n.forEach(t=>{t.innerHTML=e}):n.forEach(t=>{jsPanel.emptyNode(t),t.append(e)}),a.headerlogo.childNodes.forEach(e=>{e.nodeName&&"IMG"===e.nodeName&&e.setAttribute("draggable","false")}),t&&t.call(a,a),a}),a.setHeaderRemove=(e=>(a.removeChild(a.header),a.content.classList.add("jsPanel-content-noheader"),["close","maximize","normalize","minimize","smallify"].forEach(e=>{a.setAttribute(`data-btn${e}`,"removed")}),e&&e.call(a,a),a)),a.setHeaderTitle=((e,t)=>{let n=[a.headertitle],o=document.querySelector("#"+a.id+"-min");return o&&n.push(o.querySelector(".jsPanel-title")),"string"==typeof e?n.forEach(t=>{t.innerHTML=e}):"function"==typeof e?n.forEach(t=>{jsPanel.emptyNode(t),t.innerHTML=e()}):n.forEach(t=>{jsPanel.emptyNode(t),t.append(e)}),t&&t.call(a,a),a}),a.setIconfont=((e=!1,t=a,n)=>{if(!1!==e){let n,o;if("fa"===e||"far"===e||"fal"===e||"fas"===e||"fad"===e)n=[`${e} fa-window-close`,`${e} fa-window-maximize`,`${e} fa-window-restore`,`${e} fa-window-minimize`,`${e} fa-chevron-up`];else if("material-icons"===e)n=[e,e,e,e,e,e],o=["close","fullscreen","fullscreen_exit","call_received","expand_less"];else if(Array.isArray(e))n=[`custom-control-icon ${e[4]}`,`custom-control-icon ${e[3]}`,`custom-control-icon ${e[2]}`,`custom-control-icon ${e[1]}`,`custom-control-icon ${e[0]}`];else{if("bootstrap"!==e&&"glyphicon"!==e)return t;n=["glyphicon glyphicon-remove","glyphicon glyphicon-fullscreen","glyphicon glyphicon-resize-full","glyphicon glyphicon-minus","glyphicon glyphicon-chevron-up"]}t.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(e=>{jsPanel.emptyNode(e).innerHTML=""}),Array.prototype.slice.call(t.querySelectorAll(".jsPanel-controlbar .jsPanel-btn > span")).reverse().forEach((t,a)=>{t.className=n[a],"material-icons"===e&&(t.textContent=o[a])})}return n&&n.call(t,t),t}),a.addToolbar=((e,t,n)=>{if("header"===e?e=a.headertoolbar:"footer"===e&&(e=a.footer),"string"==typeof t)e.innerHTML=t;else if(Array.isArray(t))t.forEach(t=>{"string"==typeof t?e.innerHTML+=t:e.append(t)});else if("function"==typeof t){let n=t.call(a,a);"string"==typeof n?e.innerHTML=n:e.append(n)}else e.append(t);return e.classList.add("active"),n&&n.call(a,a),a}),a.addCloseControl=(()=>{let e=document.createElement("button"),t=a.content.style.color;return e.classList.add("jsPanel-addCloseCtrl"),e.innerHTML=jsPanel.icons.close,e.style.color=t,a.options.rtl&&e.classList.add("rtl"),a.appendChild(e),jsPanel.pointerup.forEach(t=>{e.addEventListener(t,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;a.close(null,!0)})}),jsPanel.pointerdown.forEach(t=>{e.addEventListener(t,e=>{e.preventDefault()})}),a}),a.addControl=(t=>{if(!t.html)return a;t.position||(t.position=1);const n=a.controlbar.querySelectorAll(".jsPanel-btn").length;let o=document.createElement("button");o.innerHTML=t.html,o.className=`jsPanel-btn jsPanel-btn-${t.name} jsPanel-btn-${e.headerControls.size}`,o.style.color=a.header.style.color,t.position>n?a.controlbar.append(o):a.controlbar.insertBefore(o,a.querySelector(`.jsPanel-controlbar .jsPanel-btn:nth-child(${t.position})`));const s=t.ariaLabel||t.name;return s&&o.setAttribute("aria-label",s),jsPanel.pointerup.forEach(e=>{o.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;t.handler.call(a,a,o)})}),t.afterInsert&&t.afterInsert.call(o,o),a}),a.setRtl=(()=>{[a.header,a.content,a.footer].forEach(t=>{t.dir="rtl",e.rtl.lang&&(t.lang=e.rtl.lang)})}),a.id=e.id,a.classList.add("jsPanel-"+e.paneltype),"standard"===e.paneltype&&(a.style.zIndex=this.zi.next()),o.append(a),a.front(!1,!1),a.setTheme(e.theme),e.boxShadow&&a.classList.add(`jsPanel-depth-${e.boxShadow}`),e.header){if(e.headerLogo&&a.setHeaderLogo(e.headerLogo),a.setIconfont(e.iconfont),a.setHeaderTitle(e.headerTitle),a.setHeaderControls(),jsPanel.isIE){let e=[a.headerbar,a.controlbar];switch(a.options.headerControls.size){case"md":e.forEach(e=>{e.style.height="34px"});break;case"xs":e.forEach(e=>{e.style.height="26px"});break;case"sm":e.forEach(e=>{e.style.height="30px"});break;case"lg":e.forEach(e=>{e.style.height="38px"});break;case"xl":e.forEach(e=>{e.style.height="42px"})}}if("auto-show-hide"===e.header){let t="jsPanel-depth-"+e.boxShadow;a.header.style.opacity=0,a.style.backgroundColor="transparent",this.remClass(a,t),this.setClass(a.content,t),a.header.addEventListener("mouseenter",()=>{a.header.style.opacity=1,jsPanel.setClass(a,t),jsPanel.remClass(a.content,t)}),a.header.addEventListener("mouseleave",()=>{a.header.style.opacity=0,jsPanel.remClass(a,t),jsPanel.setClass(a.content,t)})}}else a.setHeaderRemove(),e.addCloseControl&&a.addCloseControl();if(e.headerToolbar&&a.addToolbar(a.headertoolbar,e.headerToolbar),e.footerToolbar&&a.addToolbar(a.footer,e.footerToolbar),e.border&&a.setBorder(e.border),e.borderRadius&&a.setBorderRadius(e.borderRadius),e.content&&("function"==typeof e.content?e.content.call(a,a):"string"==typeof e.content?a.content.innerHTML=e.content:a.content.append(e.content)),e.contentAjax&&this.ajax(a,e.contentAjax),e.contentFetch&&this.fetch(a),e.contentOverflow){const t=e.contentOverflow.split(" ");1===t.length?a.content.style.overflow=t[0]:2===t.length&&(a.content.style.overflowX=t[0],a.content.style.overflowY=t[1])}if(e.autoclose){"number"==typeof e.autoclose?e.autoclose={time:e.autoclose+"ms"}:"string"==typeof e.autoclose&&(e.autoclose={time:e.autoclose});let t=Object.assign({},jsPanel.defaultAutocloseConfig,e.autoclose);t.time&&"number"==typeof t.time&&(t.time+="ms");let n=a.autocloseProgressbar.querySelector("div");n.addEventListener("animationend",e=>{e.stopPropagation(),a.close()}),t.progressbar&&(a.autocloseProgressbar.style.height="3px",t.background?jsPanel.themes.indexOf(t.background)>-1?a.autocloseProgressbar.classList.add(t.background+"-bg"):jsPanel.colorNames[t.background]?a.autocloseProgressbar.style.background="#"+jsPanel.colorNames[t.background]:a.autocloseProgressbar.style.background=t.background:a.autocloseProgressbar.classList.add("success-bg")),n.style.animation=`${t.time} progressbar`}if(e.rtl&&a.setRtl(),a.setSize(),a.status="normalized",e.position?this.position(a,e.position):a.style.opacity=1,document.dispatchEvent(l),a.calcSizeFactors(),e.animateIn&&(a.addEventListener("animationend",()=>{this.remClass(a,e.animateIn)}),this.setClass(a,e.animateIn)),e.syncMargins){let t=this.pOcontainment(e.maximizedMargin);e.dragit&&(e.dragit.containment=t,!0===e.dragit.snap?(e.dragit.snap=jsPanel.defaultSnapConfig,e.dragit.snap.containment=!0):e.dragit.snap&&(e.dragit.snap.containment=!0)),e.resizeit&&(e.resizeit.containment=t)}if(e.dragit?(["start","drag","stop"].forEach(t=>{e.dragit[t]?"function"==typeof e.dragit[t]&&(e.dragit[t]=[e.dragit[t]]):e.dragit[t]=[]}),this.dragit(a,e.dragit),a.addEventListener("jspaneldragstop",e=>{e.panel===a&&a.calcSizeFactors()},!1)):a.titlebar.style.cursor="default",e.resizeit){["start","resize","stop"].forEach(t=>{e.resizeit[t]?"function"==typeof e.resizeit[t]&&(e.resizeit[t]=[e.resizeit[t]]):e.resizeit[t]=[]}),this.resizeit(a,e.resizeit);let t=void 0;a.addEventListener("jspanelresizestart",e=>{e.panel===a&&(t=a.status)},!1),a.addEventListener("jspanelresizestop",n=>{n.panel===a&&("smallified"===t||"smallifiedmax"===t||"maximized"===t)&&parseFloat(a.style.height)>parseFloat(window.getComputedStyle(a.header).height)&&(a.setControls([".jsPanel-btn-normalize"]),a.status="normalized",document.dispatchEvent(l),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every"),a.calcSizeFactors())},!1)}if(a.saveCurrentDimensions(!0),a.saveCurrentPosition(),e.setStatus&&("smallifiedmax"===e.setStatus?a.maximize().smallify():"smallified"===e.setStatus?a.smallify():a[e.setStatus.substr(0,e.setStatus.length-1)]()),this.pointerdown.forEach(t=>{a.addEventListener(t,t=>{t.target.closest(".jsPanel-btn-close")||t.target.closest(".jsPanel-btn-minimize")||"standard"!==e.paneltype||a.front()},!1)}),e.onwindowresize){let t=e.onwindowresize;"window"===a.options.container&&window.addEventListener("resize",e=>{if(e.target===window){let n,o,s=a.status;"maximized"===s&&t?a.maximize(!1,!0):a.snapped&&"minimized"!==s?a.snap(a.snapped,!0):"normalized"===s||"smallified"===s||"maximized"===s?"function"==typeof t?t.call(a,e,a):(n=(window.innerWidth-a.offsetWidth)*a.hf,a.style.left=n<=0?0:n+"px",o=(window.innerHeight-a.offsetHeight)*a.vf,a.style.top=o<=0?0:o+"px"):"smallifiedmax"===s&&t&&a.maximize(!1,!0).smallify()}},!1)}if(e.onparentresize){let t=e.onparentresize,n=a.isChildpanel();if(n){const e=n.content;let o=[];document.addEventListener("jspanelresize",s=>{if(s.panel===n){o[0]=e.offsetWidth,o[1]=e.offsetHeight;let n,s,r=a.status;"maximized"===r&&t?a.maximize():a.snapped&&"minimized"!==r?a.snap(a.snapped,!0):"normalized"===r||"smallified"===r||"maximized"===r?"function"==typeof t?t.call(a,a,{width:o[0],height:o[1]}):(n=(o[0]-a.offsetWidth)*a.hf,a.style.left=n<=0?0:n+"px",s=(o[1]-a.offsetHeight)*a.vf,a.style.top=s<=0?0:s+"px"):"smallifiedmax"===r&&t&&a.maximize().smallify()}},!1)}}return this.globalCallbacks&&(Array.isArray(this.globalCallbacks)?this.globalCallbacks.forEach(e=>{e.call(a,a)}):this.globalCallbacks.call(a,a)),e.callback&&(Array.isArray(e.callback)?e.callback.forEach(e=>{e.call(a,a)}):e.callback.call(a,a)),t&&t.call(a,a),document.dispatchEvent(s),a}}; \ No newline at end of file +"use strict";export const jsPanel={version:"4.9.3",date:"2020-01-14 14:00",ajaxAlwaysCallbacks:[],autopositionSpacing:4,closeOnEscape:void document.addEventListener("keydown",e=>{"Escape"!==e.key&&"Escape"!==e.code&&"Esc"!==e.key||jsPanel.getPanels(function(){return this.classList.contains("jsPanel")}).some(e=>!!e.options.closeOnEscape&&(e.close(null,!0),!0))},!1),defaults:{boxShadow:3,container:"window",contentSize:{width:"400px",height:"200px"},dragit:{cursor:"move",handles:".jsPanel-headerlogo, .jsPanel-titlebar, .jsPanel-ftr",opacity:.8,disableOnMaximized:!0},header:!0,headerTitle:"jsPanel",headerControls:{size:"md"},iconfont:void 0,maximizedMargin:0,minimizeTo:"default",paneltype:"standard",position:{my:"center",at:"center"},resizeit:{handles:"n, e, s, w, ne, se, sw, nw",minWidth:128,minHeight:38},theme:"default"},defaultAutocloseConfig:{time:"8s",progressbar:!0},defaultSnapConfig:{sensitivity:70,trigger:"panel",active:"both"},extensions:{},globalCallbacks:!1,icons:{close:'',maximize:'',normalize:'',minimize:'',smallify:''},idCounter:0,isIE:(()=>navigator.appVersion.match(/Trident/))(),pointerdown:"onpointerdown"in window?["pointerdown"]:"ontouchend"in window?["touchstart","mousedown"]:["mousedown"],pointermove:"onpointermove"in window?["pointermove"]:"ontouchend"in window?["touchmove","mousemove"]:["mousemove"],pointerup:"onpointerup"in window?["pointerup"]:"ontouchend"in window?["touchend","mouseup"]:["mouseup"],polyfills:(Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(null==e)throw new TypeError("Cannot convert first argument to object");let t=Object(e);for(let e=1;e=0&&n.item(t)!==o;);}while(t<0&&(o=o.parentElement));return o}),function(){if("function"==typeof window.CustomEvent)return!1;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};let n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}e.prototype=window.Event.prototype,window.CustomEvent=e}(),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){return tthis.length)&&-1!==this.indexOf(e,t)}),Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},void(Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');var n=Object(this),o=n.length>>>0;if(0===o)return!1;for(var a,s,r=0|t,i=Math.max(r>=0?r:o-Math.abs(r),0);i(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e),i=n<.5?n*(1+t):n+t-n*t,l=2*n-i;o=r(l,i,e+1/3),a=r(l,i,e),s=r(l,i,e-1/3)}return[Math.round(255*o),Math.round(255*a),Math.round(255*s)]},rgbToHsl(e,t,n){e/=255,t/=255,n/=255;let o,a,s=Math.max(e,t,n),r=Math.min(e,t,n),i=(s+r)/2;if(s===r)o=a=0;else{let l=s-r;switch(a=i>.5?l/(2-s-r):l/(s+r),s){case e:o=(t-n)/l+(t{(e=e.trim()).match(/(^|\s)(-?[0-9]*\.?[0-9]+)(\s|$)/)&&(l[t]=`${l[t]}px`.trim())}),n.offsetX=l[0].trim(),n.offsetY=l[1]?l[1].trim():l[0].trim()),(t=t.replace(s," ").trim()).length&&(n.of=t),n},position(e,t){if(!t)return e.style.opacity=1,e;t="string"==typeof t?Object.assign({},this.defaults.position,this.pOposition(t)):Object.assign({},this.defaults.position,t),["my","at","of"].forEach(n=>{"function"==typeof t[n]&&(t[n]=t[n].call(e,e))}),"window"===e.options.container&&(e.style.position="fixed"),"string"==typeof e?e=document.querySelector(e):Object.getPrototypeOf(e).jquery&&(e=e[0]);const n="window"===e.options.container?"window":e.parentElement,o=e.getBoundingClientRect(),a=e.parentElement.getBoundingClientRect(),s="window"===n?{left:0,top:0,width:document.documentElement.clientWidth,height:window.innerHeight}:{width:a.width,height:a.height,left:a.left,top:a.top},r="window"===n?{x:1,y:1}:{x:s.width/n.offsetWidth,y:s.height/n.offsetHeight},i="window"===n?{borderTopWidth:"0px",borderRightWidth:"0px",borderBottomWidth:"0px",borderLeftWidth:"0px"}:window.getComputedStyle(n);let l;s.width-=(parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth))*r.x,s.height-=(parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth))*r.y,l=t.of?"string"==typeof t.of?"window"===t.of?{borderTopWidth:"0px",borderRightWidth:"0px",borderBottomWidth:"0px",borderLeftWidth:"0px"}:document.querySelector(t.of).getBoundingClientRect():Object.getPrototypeOf(t.of).jquery?t.of[0].getBoundingClientRect():t.of.getBoundingClientRect():s;let c="0px";t.my.startsWith("left-")?t.at.startsWith("left-")?c=t.of?l.left-s.left-parseFloat(i.borderLeftWidth)+"px":"0px":t.at.startsWith("center")?c=t.of?l.left-s.left-parseFloat(i.borderLeftWidth)+l.width/2+"px":s.width/2+"px":t.at.startsWith("right-")&&(c=t.of?l.left-s.left-parseFloat(i.borderLeftWidth)+l.width+"px":s.width+"px"):t.my.startsWith("center")?t.at.startsWith("left-")?c=t.of?l.left-s.left-parseFloat(i.borderLeftWidth)-o.width/2+"px":-o.width/2+"px":t.at.startsWith("center")?c=t.of?l.left-s.left-parseFloat(i.borderLeftWidth)-(o.width-l.width)/2+"px":s.width/2-o.width/2+"px":t.at.startsWith("right-")&&(c=t.of?l.left-s.left-parseFloat(i.borderLeftWidth)+(l.width-o.width/2)+"px":s.width-o.width/2+"px"):t.my.startsWith("right-")&&(t.at.startsWith("left-")?c=t.of?l.left-s.left-parseFloat(i.borderLeftWidth)-o.width+"px":-o.width+"px":t.at.startsWith("center")?c=t.of?l.left-s.left-parseFloat(i.borderLeftWidth)-o.width+l.width/2+"px":s.width/2-o.width+"px":t.at.startsWith("right-")&&(c=t.of?l.left-s.left-parseFloat(i.borderLeftWidth)+l.width-o.width+"px":s.width-o.width+"px"));let d="0px";t.my.endsWith("-top")?t.at.endsWith("-top")?d=t.of?l.top-s.top-parseFloat(i.borderTopWidth)+"px":"0px":t.at.endsWith("center")?d=t.of?l.top-s.top-parseFloat(i.borderTopWidth)+l.height/2+"px":s.height/2+"px":t.at.endsWith("-bottom")&&(d=t.of?l.top-s.top-parseFloat(i.borderTopWidth)+l.height+"px":s.height+"px"):t.my.endsWith("center")?t.at.endsWith("-top")?d=t.of?l.top-s.top-parseFloat(i.borderTopWidth)-o.height/2+"px":-o.height/2+"px":t.at.endsWith("center")?d=t.of?l.top-s.top-parseFloat(i.borderTopWidth)-o.height/2+l.height/2+"px":s.height/2-o.height/2+"px":t.at.endsWith("-bottom")&&(d=t.of?l.top-s.top-parseFloat(i.borderTopWidth)-o.height/2+l.height+"px":s.height-o.height/2+"px"):t.my.endsWith("-bottom")&&(t.at.endsWith("-top")?d=t.of?l.top-s.top-parseFloat(i.borderTopWidth)-o.height+"px":-o.height+"px":t.at.endsWith("center")?d=t.of?l.top-s.top-parseFloat(i.borderTopWidth)-o.height+l.height/2+"px":s.height/2-o.height+"px":t.at.endsWith("-bottom")&&(d=t.of?l.top-s.top-parseFloat(i.borderTopWidth)-o.height+l.height+"px":s.height-o.height+"px")),e.style.left=1===r.x?c:parseFloat(c)/r.x+"px",e.style.top=1===r.y?d:parseFloat(d)/r.y+"px";let p=getComputedStyle(e),h={left:p.left,top:p.top};return t.autoposition&&t.my===t.at&&["left-top","center-top","right-top","left-bottom","center-bottom","right-bottom"].indexOf(t.my)>=0&&(h=this.applyPositionAutopos(e,h,t)),(t.offsetX||t.offsetY)&&(h=this.applyPositionOffset(e,h,t)),(t.minLeft||t.minTop||t.maxLeft||t.maxTop)&&(h=this.applyPositionMinMax(e,h,t)),t.modify&&(h=this.applyPositionModify(e,h,t)),e.style.opacity=1,e},applyPositionAutopos(e,t,n){const o=`${n.my}-${n.autoposition.toLowerCase()}`;e.classList.add(o);const a=Array.prototype.slice.call(document.querySelectorAll(`.${o}`)),s=a.indexOf(e);if(a.length>1){switch(n.autoposition){case"down":case"up":a.forEach((e,n)=>{n>0&&n<=s&&(t.top=parseFloat(t.top)+a[--n].getBoundingClientRect().height+jsPanel.autopositionSpacing+"px")});break;case"right":a.forEach((e,n)=>{n>0&&n<=s&&(t.left=parseFloat(t.left)+a[--n].getBoundingClientRect().width+jsPanel.autopositionSpacing+"px")});break;case"left":a.forEach((e,n)=>{n>0&&n<=s&&(t.left=parseFloat(t.left)-a[--n].getBoundingClientRect().width+jsPanel.autopositionSpacing+"px")})}e.style.left=t.left,e.style.top=t.top}return{left:t.left,top:t.top}},applyPositionOffset(e,t,n){["offsetX","offsetY"].forEach(e=>{n[e]?("function"==typeof n[e]&&(n[e]=n[e].call(t,t,n)),!1===isNaN(n[e])&&(n[e]=`${n[e]}px`)):n[e]="0px"}),e.style.left=`calc(${e.style.left} + ${n.offsetX})`,e.style.top=`calc(${e.style.top} + ${n.offsetY})`;const o=getComputedStyle(e);return{left:o.left,top:o.top}},applyPositionMinMax(e,t,n){if(["minLeft","minTop","maxLeft","maxTop"].forEach(e=>{n[e]&&("function"==typeof n[e]&&(n[e]=n[e].call(t,t,n)),(Number.isInteger(n[e])||n[e].match(/^\d+$/))&&(n[e]=`${n[e]}px`))}),n.minLeft){e.style.left=n.minLeft;let o=getComputedStyle(e).left;parseFloat(o)parseFloat(t.left)?e.style.left=t.left:t.left=o}if(n.maxTop){e.style.top=n.maxTop;let o=getComputedStyle(e).top;parseFloat(o)>parseFloat(t.top)?e.style.top=t.top:t.top=o}const o=getComputedStyle(e);return{left:o.left,top:o.top}},applyPositionModify(e,t,n){if(n.modify&&"function"==typeof n.modify){const o=n.modify.call(t,t,n);e.style.left=Number.isInteger(o.left)||o.left.match(/^\d+$/)?`${o.left}px`:o.left,e.style.top=Number.isInteger(o.top)||o.top.match(/^\d+$/)?`${o.top}px`:o.top}const o=getComputedStyle(e);return{left:o.left,top:o.top}},autopositionRemaining(e){let t;if(["left-top-down","left-top-right","center-top-down","right-top-down","right-top-left","left-bottom-up","left-bottom-right","center-bottom-up","right-bottom-up","right-bottom-left"].forEach(n=>{e.classList.contains(n)&&(t=n)}),t){("window"===e.options.container?document.body:e.options.container).querySelectorAll(`.${t}`).forEach(e=>{e.reposition()})}},addScript(e,t="text/javascript",n){if(!document.querySelector(`script[src="${e}"]`)){const o=document.createElement("script");n&&(o.onload=n),o.src=e,o.type=t,document.head.appendChild(o)}},ajax(obj,ajaxConfig){let objIsPanel;"object"==typeof obj&&obj.classList.contains("jsPanel")?objIsPanel=!0:(objIsPanel=!1,"string"==typeof obj&&(obj=document.querySelector(obj)));const configDefaults={method:"GET",async:!0,user:"",pwd:"",done:function(){objIsPanel?obj.content.innerHTML=this.responseText:obj.innerHTML=this.responseText},autoresize:!0,autoreposition:!0};let config;if("string"==typeof ajaxConfig)config=Object.assign({},configDefaults,{url:encodeURI(ajaxConfig),evalscripttags:!0});else{if("object"!=typeof ajaxConfig||!ajaxConfig.url){if(this.errorReporting)try{throw new jsPanel.jsPanelError("XMLHttpRequest seems to miss the url parameter!")}catch(e){jsPanel.error(e)}return obj}config=Object.assign({},configDefaults,ajaxConfig),config.url=encodeURI(ajaxConfig.url),!1===config.async&&(config.timeout=0,config.withCredentials&&(config.withCredentials=void 0),config.responseType&&(config.responseType=void 0))}const xhr=new XMLHttpRequest;return xhr.onreadystatechange=(()=>{if(4===xhr.readyState){if(200===xhr.status){if(config.done.call(xhr,obj),config.evalscripttags){const scripttags=xhr.responseText.match(/]*>([\s\S]*?)<\/script>/gi);scripttags&&scripttags.forEach(tag=>{const js=tag.replace(/]*>/i,"").replace(/<\/script>/i,"").trim();eval(js)})}}else config.fail&&config.fail.call(xhr,obj);if(config.always&&config.always.call(xhr,obj),objIsPanel){const e=obj.options.contentSize;if("string"==typeof e&&e.match(/auto/i)){const t=e.split(" "),n=Object.assign({},{width:t[0],height:t[1]});config.autoresize&&obj.resize(n),obj.classList.contains("jsPanel-contextmenu")||config.autoreposition&&obj.reposition()}else if("object"==typeof e&&("auto"===e.width||"auto"===e.height)){const t=Object.assign({},e);config.autoresize&&obj.resize(t),obj.classList.contains("jsPanel-contextmenu")||config.autoreposition&&obj.reposition()}}jsPanel.ajaxAlwaysCallbacks.length&&jsPanel.ajaxAlwaysCallbacks.forEach(e=>{e.call(obj,obj)})}}),xhr.open(config.method,config.url,config.async,config.user,config.pwd),xhr.timeout=config.timeout||0,config.withCredentials&&(xhr.withCredentials=config.withCredentials),config.responseType&&(xhr.responseType=config.responseType),config.beforeSend&&config.beforeSend.call(xhr),config.data?xhr.send(config.data):xhr.send(null),obj},createPanelTemplate(e=!0){const t=document.createElement("div");return t.className="jsPanel",t.style.left="0",t.style.top="0",e&&["close","maximize","normalize","minimize","smallify"].forEach(e=>{t.setAttribute(`data-btn${e}`,"enabled")}),t.innerHTML=`
\n
\n \n
\n \n
\n
\n \n \n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
`,t},createMinimizedTemplate(){const e=document.createElement("div");return e.className="jsPanel-replacement",e.innerHTML=`
\n
\n \n
\n \n
\n
\n \n \n \n
\n
\n
`,e},createSnapArea(e,t,n){const o=document.createElement("div"),a=e.parentElement;o.className=`jsPanel-snap-area jsPanel-snap-area-${t}`,"lt"===t||"rt"===t||"rb"===t||"lb"===t?(o.style.width=n+"px",o.style.height=n+"px"):"ct"===t||"cb"===t?o.style.height=n+"px":"lc"!==t&&"rc"!==t||(o.style.width=n+"px"),a!==document.body&&(o.style.position="absolute"),document.querySelector(`.jsPanel-snap-area.jsPanel-snap-area-${t}`)||e.parentElement.appendChild(o)},dragit(e,t={}){let n,o,a;const s=new CustomEvent("jspaneldragstart",{detail:e.id}),r=new CustomEvent("jspaneldrag",{detail:e.id}),i=new CustomEvent("jspaneldragstop",{detail:e.id});[s,r,i].forEach(t=>{t.panel=e});const l=e=>{let t=e.split("-");return t.forEach((e,n)=>{t[n]=e.charAt(0).toUpperCase()+e.slice(1)}),"snap"+t.join("")};let c=t.handles||this.defaults.dragit.handles,d=t.cursor||this.defaults.dragit.cursor;return e.querySelectorAll(c).forEach(c=>{c.style.touchAction="none",c.style.cursor=d,jsPanel.pointerdown.forEach(i=>{c.addEventListener(i,i=>{if(i.button&&i.button>0)return!1;if((a=Object.assign({},jsPanel.defaults.dragit,t)).disableOnMaximized&&"maximized"===e.status)return!1;if((a.containment||0===a.containment)&&(a.containment=jsPanel.pOcontainment(a.containment)),a.grid&&Array.isArray(a.grid)&&1===a.grid.length&&(a.grid[1]=a.grid[0]),a.snap&&("object"==typeof a.snap?a.snap=Object.assign({},jsPanel.defaultSnapConfig,a.snap):a.snap=jsPanel.defaultSnapConfig),i.target.closest(".jsPanel-ftr-btn"))return;e.controlbar.style.pointerEvents="none",e.content.style.pointerEvents="none",document.querySelectorAll("iframe").forEach(e=>{e.style.pointerEvents="none"});let l=window.getComputedStyle(e),c=parseFloat(l.left),d=parseFloat(l.top),p=parseFloat(l.width),h=parseFloat(l.height),f=i.touches?i.touches[0].clientX:i.clientX,m=i.touches?i.touches[0].clientY:i.clientY,g=e.parentElement,u=g.getBoundingClientRect(),b=window.getComputedStyle(g),y=e.getScaleFactor(),j=0;o=(t=>{if(t.preventDefault(),!n){if(document.dispatchEvent(s),e.style.opacity=a.opacity,e.snapped&&a.snap.resizeToPreSnap&&e.currentData.beforeSnap){e.resize(e.currentData.beforeSnap.width+" "+e.currentData.beforeSnap.height),e.setControls([".jsPanel-btn-normalize"]);let t=e.getBoundingClientRect(),n=f-(t.left+t.width),o=t.width/2;n>-o&&(j=n+o)}if(e.front(),e.snapped=!1,"maximized"===e.status&&(e.setControls([".jsPanel-btn-normalize"]),e.status="normalized"),a.drop&&a.drop.dropZones){let e=a.drop.dropZones.map(e=>jsPanel.pOcontainer(e)),t=[];e.forEach(function(e){e.length?e.forEach(function(e){t.push(e)}):t.push(e)}),t=t.filter(function(e,t,n){return n.indexOf(e)===t}),a.drop.dropZones=t}a.start.length&&jsPanel.processCallbacks(e,a.start,!1,{left:c,top:d,width:p,height:h},t)}let o,i,l,w,P,v,x,E,C,F;n=1;let z,S=t.touches?t.touches[0].clientX:t.clientX,A=t.touches?t.touches[0].clientY:t.clientY,k=window.getComputedStyle(e);if(g===document.body){let t=e.getBoundingClientRect();C=window.innerWidth-parseInt(b.borderLeftWidth,10)-parseInt(b.borderRightWidth,10)-(t.left+t.width),F=window.innerHeight-parseInt(b.borderTopWidth,10)-parseInt(b.borderBottomWidth,10)-(t.top+t.height)}else C=parseInt(b.width,10)-parseInt(b.borderLeftWidth,10)-parseInt(b.borderRightWidth,10)-(parseInt(k.left,10)+parseInt(k.width,10)),F=parseInt(b.height,10)-parseInt(b.borderTopWidth,10)-parseInt(b.borderBottomWidth,10)-(parseInt(k.top,10)+parseInt(k.height,10));o=parseFloat(k.left),l=parseFloat(k.top),P=C,x=F,a.snap&&("panel"===a.snap.trigger?(i=o**2,w=l**2,v=P**2,E=x**2):"pointer"===a.snap.trigger&&("window"===e.options.container?(o=S,i=S**2,w=(l=A)**2,v=(P=window.innerWidth-S)**2,E=(x=window.innerHeight-A)**2):(o=(z=e.overlaps(g,"paddingbox",t)).pointer.left,l=z.pointer.top,P=z.pointer.right,x=z.pointer.bottom,i=z.pointer.left**2,w=z.pointer.top**2,v=z.pointer.right**2,E=z.pointer.bottom**2)));let B=Math.sqrt(i+w),T=Math.sqrt(i+E),L=Math.sqrt(v+w),R=Math.sqrt(v+E),D=Math.abs(o-P)/2,W=Math.abs(l-x)/2,$=Math.sqrt(i+W**2),q=Math.sqrt(w+D**2),O=Math.sqrt(v+W**2),I=Math.sqrt(E+D**2);if(window.getSelection().removeAllRanges(),document.dispatchEvent(r),a.axis&&"x"!==a.axis||(e.style.left=c+(S-f)/y.x+j+"px"),a.axis&&"y"!==a.axis||(e.style.top=d+(A-m)/y.y+"px"),a.grid){let t=a.grid,n=a.axis,o=t[0]*Math.round((c+(S-f))/t[0]),s=t[1]*Math.round((d+(A-m))/t[1]);n&&"x"!==n||(e.style.left=`${o}px`),n&&"y"!==n||(e.style.top=`${s}px`)}if(a.containment||0===a.containment){let t,n,o=a.containment;if(e.options.container===document.body)t=window.innerWidth-parseFloat(k.width)-o[1],n=window.innerHeight-parseFloat(k.height)-o[2];else{let e=parseFloat(b.borderLeftWidth)+parseFloat(b.borderRightWidth),a=parseFloat(b.borderTopWidth)+parseFloat(b.borderBottomWidth);t=u.width/y.x-parseFloat(k.width)-o[1]-e,n=u.height/y.y-parseFloat(k.height)-o[2]-a}parseFloat(e.style.left)<=o[3]&&(e.style.left=o[3]+"px"),parseFloat(e.style.top)<=o[0]&&(e.style.top=o[0]+"px"),parseFloat(e.style.left)>=t&&(e.style.left=t+"px"),parseFloat(e.style.top)>=n&&(e.style.top=n+"px")}if(a.drag.length){let n={left:o,top:l,right:P,bottom:x,width:parseFloat(k.width),height:parseFloat(k.height)};jsPanel.processCallbacks(e,a.drag,!1,n,t)}if(a.snap){let t=a.snap.sensitivity,n=g===document.body?window.innerWidth/8:u.width/8,s=g===document.body?window.innerHeight/8:u.height/8;e.snappableTo=!1,jsPanel.removeSnapAreas(),B0&&z.pointer.top>0?(e.snappableTo="left-top",jsPanel.createSnapArea(e,"lt",t)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="left-top",jsPanel.createSnapArea(e,"lt",t))):T0&&z.pointer.bottom>0?(e.snappableTo="left-bottom",jsPanel.createSnapArea(e,"lb",t)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="left-bottom",jsPanel.createSnapArea(e,"lb",t))):L0&&z.pointer.top>0?(e.snappableTo="right-top",jsPanel.createSnapArea(e,"rt",t)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="right-top",jsPanel.createSnapArea(e,"rt",t))):R0&&z.pointer.bottom>0?(e.snappableTo="right-bottom",jsPanel.createSnapArea(e,"rb",t)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="right-bottom",jsPanel.createSnapArea(e,"rb",t))):l0?(e.snappableTo="center-top",jsPanel.createSnapArea(e,"ct",t)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="center-top",jsPanel.createSnapArea(e,"ct",t))):o0?(e.snappableTo="left-center",jsPanel.createSnapArea(e,"lc",t)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="left-center",jsPanel.createSnapArea(e,"lc",t))):P0?(e.snappableTo="right-center",jsPanel.createSnapArea(e,"rc",t)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="right-center",jsPanel.createSnapArea(e,"rc",t))):x0?(e.snappableTo="center-bottom",jsPanel.createSnapArea(e,"cb",t)):(e.snappableTo=!1,jsPanel.removeSnapAreas())):(e.snappableTo="center-bottom",jsPanel.createSnapArea(e,"cb",t)))}if(a.drop&&a.drop.dropZones){let n=jsPanel.isIE?"msElementsFromPoint":"elementsFromPoint",o=document[n](t.clientX,t.clientY);Array.isArray(o)||(o=Array.prototype.slice.call(o)),a.drop.dropZones.forEach(t=>{o.includes(t)&&(e.droppableTo=t)}),o.includes(e.droppableTo)||(e.droppableTo=!1)}}),jsPanel.pointermove.forEach(e=>{document.addEventListener(e,o)}),window.addEventListener("mouseout",t=>{null===t.relatedTarget&&jsPanel.pointermove.forEach(t=>{document.removeEventListener(t,o,!1),e.style.opacity=1})},!1)})}),jsPanel.pointerup.forEach(t=>{document.addEventListener(t,t=>{if(jsPanel.pointermove.forEach(e=>{document.removeEventListener(e,o)}),jsPanel.removeSnapAreas(),n){if(e.style.opacity=1,n=void 0,a.snap){switch(e.snappableTo){case"left-top":e.snap(a.snap.snapLeftTop);break;case"center-top":e.snap(a.snap.snapCenterTop);break;case"right-top":e.snap(a.snap.snapRightTop);break;case"right-center":e.snap(a.snap.snapRightCenter);break;case"right-bottom":e.snap(a.snap.snapRightBottom);break;case"center-bottom":e.snap(a.snap.snapCenterBottom);break;case"left-bottom":e.snap(a.snap.snapLeftBottom);break;case"left-center":e.snap(a.snap.snapLeftCenter)}a.snap.callback&&e.snappableTo&&"function"==typeof a.snap.callback&&(a.snap.callback.call(e,e),a.snap.repositionOnSnap&&!1!==a.snap[l(e.snappableTo)]&&e.repositionOnSnap(e.snappableTo)),e.snappableTo&&a.snap.repositionOnSnap&&a.snap[l(e.snappableTo)]&&e.repositionOnSnap(e.snappableTo)}if(e.droppableTo&&e.droppableTo!==e.parentElement){let t=e.parentElement;e.move(e.droppableTo),a.drop.callback&&a.drop.callback.call(e,e,e.droppableTo,t)}if(document.dispatchEvent(i),a.stop.length){let n=window.getComputedStyle(e),o={left:parseFloat(n.left),top:parseFloat(n.top),width:parseFloat(n.width),height:parseFloat(n.height)};jsPanel.processCallbacks(e,a.stop,!1,o,t)}e.saveCurrentPosition(),e.calcSizeFactors()}e.controlbar.style.pointerEvents="inherit",e.content.style.pointerEvents="inherit",document.querySelectorAll("iframe").forEach(e=>{e.style.pointerEvents="auto"})})}),t.disable&&(c.style.pointerEvents="none")}),e},emptyNode(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e},extend(e){if("[object Object]"===Object.prototype.toString.call(e))for(let t in e)e.hasOwnProperty(t)&&(this.extensions[t]=e[t])},fetch(obj){const confDefaults={bodyMethod:"text",evalscripttags:!0,autoresize:!0,autoreposition:!0,done:(e,t)=>{e.content.innerHTML=t}},conf="string"==typeof obj.options.contentFetch?Object.assign({resource:obj.options.contentFetch},confDefaults):Object.assign(confDefaults,obj.options.contentFetch),fetchInit=conf.fetchInit||{};if(!conf.resource){if(this.errorReporting)try{throw new jsPanel.jsPanelError("The Fetch request seems to miss the resource parameter")}catch(e){jsPanel.error(e)}return obj}conf.beforeSend&&conf.beforeSend.call(obj,obj),fetch(conf.resource,fetchInit).then(e=>{if(e.ok)return e[conf.bodyMethod]()}).then(response=>{if(conf.done.call(obj,obj,response),conf.evalscripttags){const scripttags=response.match(/]*>([\s\S]*?)<\/script>/gi);scripttags&&scripttags.forEach(tag=>{let js=tag.replace(/]*>/i,"").replace(/<\/script>/i,"").trim();eval(js)})}const oContentSize=obj.options.contentSize;if(conf.autoresize||conf.autoreposition)if("string"==typeof oContentSize&&oContentSize.match(/auto/i)){const e=oContentSize.split(" "),t=Object.assign({},{width:e[0],height:e[1]});conf.autoresize&&obj.resize(t),obj.classList.contains("jsPanel-contextmenu")||conf.autoreposition&&obj.reposition()}else if("object"==typeof oContentSize&&("auto"===oContentSize.width||"auto"===oContentSize.height)){const e=Object.assign({},oContentSize);conf.autoresize&&obj.resize(e),obj.classList.contains("jsPanel-contextmenu")||conf.autoreposition&&obj.reposition()}})},getPanels:(e=function(){return this.classList.contains("jsPanel-standard")})=>Array.prototype.slice.call(document.querySelectorAll(".jsPanel")).filter(t=>e.call(t,t)).sort((e,t)=>t.style.zIndex-e.style.zIndex),pOcontainer(e){if("window"===e)return document.body;if("string"==typeof e){let t=document.querySelectorAll(e);return!!(t.length&&t.length>0)&&t}return 1===e.nodeType?e:!!e.length&&e[0]},pOcontainment(e){let t=e;if("function"==typeof e&&(t=e()),"number"==typeof t)return[t,t,t,t];if(Array.isArray(t)){if(1===t.length)return[t[0],t[0],t[0],t[0]];if(2===t.length)return t.concat(t);3===t.length&&(t[3]=t[1])}return t},pOsize(e,t){let n=t||this.defaults.contentSize;const o=e.parentElement;if("string"==typeof n){const e=n.trim().split(" ");(n={}).width=e[0],2===e.length?n.height=e[1]:n.height=e[0]}else n.width&&!n.height?n.height=n.width:n.height&&!n.width&&(n.width=n.height);if(String(n.width).match(/^[0-9.]+$/gi))n.width+="px";else if("string"==typeof n.width&&n.width.endsWith("%"))if(o===document.body)n.width=window.innerWidth*(parseFloat(n.width)/100)+"px";else{const e=window.getComputedStyle(o),t=parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth);n.width=(parseFloat(e.width)-t)*(parseFloat(n.width)/100)+"px"}else"function"==typeof n.width&&(n.width=n.width.call(e,e),"number"==typeof n.width?n.width+="px":"string"==typeof n.width&&n.width.match(/^[0-9.]+$/gi)&&(n.width+="px"));if(String(n.height).match(/^[0-9.]+$/gi))n.height+="px";else if("string"==typeof n.height&&n.height.endsWith("%"))if(o===document.body)n.height=window.innerHeight*(parseFloat(n.height)/100)+"px";else{const e=window.getComputedStyle(o),t=parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth);n.height=(parseFloat(e.height)-t)*(parseFloat(n.height)/100)+"px"}else"function"==typeof n.height&&(n.height=n.height.call(e,e),"number"==typeof n.height?n.height+="px":"string"==typeof n.height&&n.height.match(/^[0-9.]+$/gi)&&(n.height+="px"));return n},pOborder(e){e=e.trim();const t=new Array(3),n=e.match(/\s*(none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset)\s*/gi),o=e.match(/\s*(thin|medium|thick)|(\d*\.?\d+[a-zA-Z]{2,4})\s*/gi);return n?(t[1]=n[0].trim(),e=e.replace(t[1],"")):t[1]="solid",o?(t[0]=o[0].trim(),e=e.replace(t[0],"")):t[0]="medium",t[2]=e.trim(),t},pOheaderControls(e){if("string"==typeof e){let t={},n=e.toLowerCase(),o=n.match(/xl|lg|md|sm|xs/),a=n.match(/closeonly|none/);return o&&(t.size=o[0]),a&&(t=Object.assign({},t,{maximize:"remove",normalize:"remove",minimize:"remove",smallify:"remove"}),"none"===a[0]&&(t.close="remove")),Object.assign({},this.defaults.headerControls,t)}return Object.assign({},this.defaults.headerControls,e)},processCallbacks(e,t,n="some",o,a){if("function"==typeof t&&(t=[t]),n)return t[n](t=>t.call(e,e,o,a));t.forEach(t=>{t.call(e,e,o,a)})},removeSnapAreas(){document.querySelectorAll(".jsPanel-snap-area").forEach(e=>{e.parentElement.removeChild(e)})},remClass:(e,t)=>(t.split(" ").forEach(t=>e.classList.remove(t)),e),resetZi(){this.zi=((e=jsPanel.ziBase)=>{let t=e;return{next:()=>t++}})(),Array.prototype.slice.call(document.querySelectorAll(".jsPanel-standard")).sort((e,t)=>e.style.zIndex-t.style.zIndex).forEach(e=>{e.style.zIndex=jsPanel.zi.next()})},resizeit(e,t={}){const n=new CustomEvent("jspanelresizestart",{detail:e.id}),o=new CustomEvent("jspanelresize",{detail:e.id}),a=new CustomEvent("jspanelresizestop",{detail:e.id});[n,o,a].forEach(t=>{t.panel=e});let s,r,i,l,c={};return c.handles=t.handles||jsPanel.defaults.resizeit.handles,c.handles.split(",").forEach(t=>{const n=document.createElement("DIV");n.className=`jsPanel-resizeit-handle jsPanel-resizeit-${t.trim()}`,n.style.zIndex=90,e.append(n)}),e.querySelectorAll(".jsPanel-resizeit-handle").forEach(a=>{jsPanel.pointerdown.forEach(function(d){a.addEventListener(d,a=>{if(a.preventDefault(),a.button&&a.button>0)return!1;let d=1;if(((c=Object.assign({},jsPanel.defaults.resizeit,t)).containment||0===c.containment)&&(c.containment=jsPanel.pOcontainment(c.containment)),c.aspectRatio&&!0===c.aspectRatio&&(c.aspectRatio="panel"),jsPanel.modifier){let e=jsPanel.modifier;"AltLeft"===e||"AltRight"===e?c.aspectRatio="content":"ControlLeft"===e||"ControlRight"===e?c.aspectRatio="panel":"ShiftLeft"!==e&&"ShiftRight"!==e||(d=2)}let p="function"==typeof c.maxWidth?c.maxWidth():c.maxWidth||1e4,h="function"==typeof c.maxHeight?c.maxHeight():c.maxHeight||1e4,f="function"==typeof c.minWidth?c.minWidth():c.minWidth,m="function"==typeof c.minHeight?c.minHeight():c.minHeight;e.content.style.pointerEvents="none",document.querySelectorAll("iframe").forEach(e=>{e.style.pointerEvents="none"});const g=e.parentElement,u=g.tagName.toLowerCase(),b=e.getBoundingClientRect(),y=g.getBoundingClientRect(),j=window.getComputedStyle(g,null),w=parseInt(j.borderLeftWidth,10),P=parseInt(j.borderTopWidth,10),v=j.getPropertyValue("position"),x=a.clientX||a.touches[0].clientX,E=a.clientY||a.touches[0].clientY,C=x/E,F=b.width,z=b.height,S=a.target.classList,A=e.getScaleFactor(),k=b.width/b.height,B=e.content.getBoundingClientRect(),T=B.width/B.height,L=e.header.getBoundingClientRect().height,R=e.footer.getBoundingClientRect().height||0;let D=b.left,W=b.top,$=1e4,q=1e4,O=1e4,I=1e4;"body"!==u&&(D=b.left-y.left+g.scrollLeft,W=b.top-y.top+g.scrollTop),"body"===u&&c.containment?($=document.documentElement.clientWidth-b.left,O=document.documentElement.clientHeight-b.top,q=b.width+b.left,I=b.height+b.top):c.containment&&("static"===v?($=y.width-b.left+w,O=y.height+y.top-b.top+P,q=b.width+(b.left-y.left)-w,I=b.height+(b.top-y.top)-P):($=g.clientWidth-(b.left-y.left)/A.x+w,O=g.clientHeight-(b.top-y.top)/A.y+P,q=(b.width+b.left-y.left)/A.x-w,I=e.clientHeight+(b.top-y.top)/A.y-P)),c.containment&&(q-=c.containment[3],I-=c.containment[0],$-=c.containment[1],O-=c.containment[2]);const M=window.getComputedStyle(e),N=parseFloat(M.width)-b.width,H=parseFloat(M.height)-b.height;let X=parseFloat(M.left)-b.left,Y=parseFloat(M.top)-b.top;g!==document.body&&(X+=y.left,Y+=y.top);let V=parseInt(M.borderTopWidth,10),Z=parseInt(M.borderRightWidth,10),U=parseInt(M.borderBottomWidth,10),_=parseInt(M.borderLeftWidth,10);s=(t=>{r||(document.dispatchEvent(n),c.start.length&&jsPanel.processCallbacks(e,c.start,!1,{width:F,height:z,left:D,top:W},t),e.front(),e.status="normalized",e.setControls([".jsPanel-btn-normalize"])),r=1,document.dispatchEvent(o);let a,s=t.touches?t.touches[0].clientX:t.clientX,u=t.touches?t.touches[0].clientY:t.clientY;S.contains("jsPanel-resizeit-e")?((i=F+(s-x)*d/A.x+N)>=$&&(i=$),i>=p&&(i=p),i<=f&&(i=f),e.style.width=i+"px",2===d&&(e.style.left=D-(s-x)+"px"),"content"===c.aspectRatio?(e.style.height=(i-Z-_)/T+L+R+V+U+"px",c.containment&&(a=e.overlaps(g)).bottom<=c.containment[2]&&(e.style.height=O+"px",e.style.width=O*T+"px")):"panel"===c.aspectRatio&&(e.style.height=i/k+"px",c.containment&&(a=e.overlaps(g)).bottom<=c.containment[2]&&(e.style.height=O+"px",e.style.width=O*k+"px"))):S.contains("jsPanel-resizeit-s")?((l=z+(u-E)*d/A.y+H)>=O&&(l=O),l>=h&&(l=h),l<=m&&(l=m),e.style.height=l+"px",2===d&&(e.style.top=W-(u-E)+"px"),"content"===c.aspectRatio?(e.style.width=(l-L-R-V-U)*T+V+U+"px",c.containment&&(a=e.overlaps(g)).right<=c.containment[1]&&(e.style.width=$+"px",e.style.height=$/T+"px")):"panel"===c.aspectRatio&&(e.style.width=l*k+"px",c.containment&&(a=e.overlaps(g)).right<=c.containment[1]&&(e.style.width=$+"px",e.style.height=$/k+"px"))):S.contains("jsPanel-resizeit-w")?((i=F+(x-s)*d/A.x+N)<=p&&i>=f&&i<=q&&(e.style.left=D+(s-x)/A.x+X+"px"),i>=q&&(i=q),i>=p&&(i=p),i<=f&&(i=f),e.style.width=i+"px","content"===c.aspectRatio?(e.style.height=(i-Z-_)/T+L+R+V+U+"px",c.containment&&(a=e.overlaps(g)).bottom<=c.containment[2]&&(e.style.height=O+"px",e.style.width=O*T+"px")):"panel"===c.aspectRatio&&(e.style.height=i/k+"px",c.containment&&(a=e.overlaps(g)).bottom<=c.containment[2]&&(e.style.height=O+"px",e.style.width=O*k+"px"))):S.contains("jsPanel-resizeit-n")?((l=z+(E-u)*d/A.y+H)<=h&&l>=m&&l<=I&&(e.style.top=W+(u-E)/A.y+Y+"px"),l>=I&&(l=I),l>=h&&(l=h),l<=m&&(l=m),e.style.height=l+"px","content"===c.aspectRatio?(e.style.width=(l-L-R-V-U)*T+V+U+"px",c.containment&&(a=e.overlaps(g)).right<=c.containment[1]&&(e.style.width=$+"px",e.style.height=$/T+"px")):"panel"===c.aspectRatio&&(e.style.width=l*k+"px",c.containment&&(a=e.overlaps(g)).right<=c.containment[1]&&(e.style.width=$+"px",e.style.height=$/k+"px"))):S.contains("jsPanel-resizeit-se")?((i=F+(s-x)*d/A.x+N)>=$&&(i=$),i>=p&&(i=p),i<=f&&(i=f),e.style.width=i+"px",2===d&&(e.style.left=D-(s-x)+"px"),c.aspectRatio&&(e.style.height=i/k+"px"),(l=z+(u-E)*d/A.y+H)>=O&&(l=O),l>=h&&(l=h),l<=m&&(l=m),e.style.height=l+"px",2===d&&(e.style.top=W-(u-E)+"px"),"content"===c.aspectRatio?(e.style.width=(l-L-R-V-U)*T+V+U+"px",c.containment&&(a=e.overlaps(g)).right<=c.containment[1]&&(e.style.width=$+"px",e.style.height=$/T+"px")):"panel"===c.aspectRatio&&(e.style.width=l*k+"px",c.containment&&(a=e.overlaps(g)).right<=c.containment[1]&&(e.style.width=$+"px",e.style.height=$/k+"px"))):S.contains("jsPanel-resizeit-sw")?((l=z+(u-E)*d/A.y+H)>=O&&(l=O),l>=h&&(l=h),l<=m&&(l=m),e.style.height=l+"px",2===d&&(e.style.top=W-(u-E)+"px"),c.aspectRatio&&(e.style.width=l*k+"px"),(i=F+(x-s)*d/A.x+N)<=p&&i>=f&&i<=q&&(e.style.left=D+(s-x)/A.x+X+"px"),i>=q&&(i=q),i>=p&&(i=p),i<=f&&(i=f),e.style.width=i+"px","content"===c.aspectRatio?(e.style.height=(i-Z-_)/T+L+R+V+U+"px",c.containment&&(a=e.overlaps(g)).bottom<=c.containment[2]&&(e.style.height=O+"px",e.style.width=O*T+"px")):"panel"===c.aspectRatio&&(e.style.height=i/k+"px",c.containment&&(a=e.overlaps(g)).bottom<=c.containment[2]&&(e.style.height=O+"px",e.style.width=O*k+"px"))):S.contains("jsPanel-resizeit-ne")?((i=F+(s-x)*d/A.x+N)>=$&&(i=$),i>=p&&(i=p),i<=f&&(i=f),e.style.width=i+"px",2===d&&(e.style.left=D-(s-x)+"px"),c.aspectRatio&&(e.style.height=i/k+"px"),(l=z+(E-u)*d/A.y+H)<=h&&l>=m&&l<=I&&(e.style.top=W+(u-E)/A.y+Y+"px"),l>=I&&(l=I),l>=h&&(l=h),l<=m&&(l=m),e.style.height=l+"px","content"===c.aspectRatio?(e.style.width=(l-L-R-V-U)*T+V+U+"px",c.containment&&(a=e.overlaps(g)).right<=c.containment[1]&&(e.style.width=$+"px",e.style.height=$/T+"px")):"panel"===c.aspectRatio&&(e.style.width=l*k+"px",c.containment&&(a=e.overlaps(g)).right<=c.containment[1]&&(e.style.width=$+"px",e.style.height=$/k+"px"))):S.contains("jsPanel-resizeit-nw")&&(c.aspectRatio&&S.contains("jsPanel-resizeit-nw")&&(u=(s=u*C)/C),(i=F+(x-s)*d/A.x+N)<=p&&i>=f&&i<=q&&(e.style.left=D+(s-x)/A.x+X+"px"),i>=q&&(i=q),i>=p&&(i=p),i<=f&&(i=f),e.style.width=i+"px",c.aspectRatio&&(e.style.height=i/k+"px"),(l=z+(E-u)*d/A.y+H)<=h&&l>=m&&l<=I&&(e.style.top=W+(u-E)/A.y+Y+"px"),l>=I&&(l=I),l>=h&&(l=h),l<=m&&(l=m),e.style.height=l+"px","content"===c.aspectRatio?e.style.width=(l-L-R-V-U)*T+V+U+"px":"panel"===c.aspectRatio&&(e.style.width=l*k+"px")),window.getSelection().removeAllRanges();const b=window.getComputedStyle(e),y={left:parseFloat(b.left),top:parseFloat(b.top),right:parseFloat(b.right),bottom:parseFloat(b.bottom),width:parseFloat(b.width),height:parseFloat(b.height)};c.resize.length&&jsPanel.processCallbacks(e,c.resize,!1,y,t)}),jsPanel.pointermove.forEach(e=>{document.addEventListener(e,s,!1)}),window.addEventListener("mouseout",e=>{null===e.relatedTarget&&jsPanel.pointermove.forEach(e=>{document.removeEventListener(e,s,!1)})},!1)})})}),jsPanel.pointerup.forEach(function(t){document.addEventListener(t,t=>{if(jsPanel.pointermove.forEach(e=>{document.removeEventListener(e,s,!1)}),t.target.classList&&t.target.classList.contains("jsPanel-resizeit-handle")){let n,o,a=t.target.className;if(a.match(/jsPanel-resizeit-nw|jsPanel-resizeit-w|jsPanel-resizeit-sw/i)&&(n=!0),a.match(/jsPanel-resizeit-nw|jsPanel-resizeit-n|jsPanel-resizeit-ne/i)&&(o=!0),c.grid&&Array.isArray(c.grid)){1===c.grid.length&&(c.grid[1]=c.grid[0]);const t=parseFloat(e.style.width),a=parseFloat(e.style.height),s=t%c.grid[0],r=a%c.grid[1],i=parseFloat(e.style.left),l=parseFloat(e.style.top),d=i%c.grid[0],p=l%c.grid[1];s{e.style.pointerEvents="auto"})},!1)}),t.disable&&e.querySelectorAll(".jsPanel-resizeit-handle").forEach(e=>{e.style.pointerEvents="none"}),e},setClass:(e,t)=>(t.split(" ").forEach(t=>e.classList.add(t)),e),setStyles(e,t){for(let n in t)n in e.style?e.style[n]=t[n]:e.style.setProperty(n,t[n]);return e},setStyle(e,t){return this.setStyles.call(e,e,t)},jsPanelError(e){this.prototype=new Error,this.message=e,this.name="jsPanel Error"},error(e){this.create({paneltype:"error",dragit:!1,resizeit:!1,theme:{bgPanel:"white",bgContent:"white",colorHeader:"rebeccapurple",colorContent:"#333",border:"2px solid rebeccapurple"},borderRadius:".33rem",headerControls:"closeonly xs",headerTitle:"⚠ jsPanel Error",contentSize:{width:"50%",height:"auto"},position:"center-top 0 5 down",animateIn:"jsPanelFadeIn",content:`

${e.message}

`})},create(e={},t){jsPanel.zi||(jsPanel.zi=((e=jsPanel.ziBase)=>{let t=e;return{next:()=>t++}})()),e.config?delete(e=Object.assign({},this.defaults,e.config,e)).config:e=Object.assign({},this.defaults,e),e.id?"function"==typeof e.id&&(e.id=e.id()):e.id=`jsPanel-${jsPanel.idCounter+=1}`;const n=document.getElementById(e.id);if(null!==n){if(n.classList.contains("jsPanel")&&n.front(),this.errorReporting)try{throw new jsPanel.jsPanelError("◀ COULD NOT CREATE NEW JSPANEL ►
An element with the ID "+e.id+" already exists in the document.")}catch(e){jsPanel.error(e)}return!1}let o=this.pOcontainer(e.container);if("object"==typeof o&&o.length&&o.length>0&&(o=o[0]),!o){if(this.errorReporting)try{throw new jsPanel.jsPanelError("◀ COULD NOT CREATE NEW JSPANEL ►
The container to append the panel to does not exist")}catch(e){jsPanel.error(e)}return!1}["onbeforeclose","onbeforemaximize","onbeforeminimize","onbeforenormalize","onbeforesmallify","onbeforeunsmallify","onclosed","onfronted","onmaximized","onminimized","onnormalized","onsmallified","onstatuschange","onunsmallified"].forEach(t=>{e[t]?"function"==typeof e[t]&&(e[t]=[e[t]]):e[t]=[]});const a=e.template?e.template:this.createPanelTemplate();a.options=e,a.closetimer=void 0,a.status="initialized",a.currentData={},a.header=a.querySelector(".jsPanel-hdr"),a.headerbar=a.header.querySelector(".jsPanel-headerbar"),a.titlebar=a.header.querySelector(".jsPanel-titlebar"),a.headerlogo=a.headerbar.querySelector(".jsPanel-headerlogo"),a.headertitle=a.headerbar.querySelector(".jsPanel-title"),a.controlbar=a.headerbar.querySelector(".jsPanel-controlbar"),a.headertoolbar=a.header.querySelector(".jsPanel-hdr-toolbar"),a.content=a.querySelector(".jsPanel-content"),a.footer=a.querySelector(".jsPanel-ftr"),a.snappableTo=!1,a.snapped=!1,a.droppableTo=!1,a.autocloseProgressbar=a.querySelector(".jsPanel-autoclose-progressbar");const s=new CustomEvent("jspanelloaded",{detail:e.id}),r=new CustomEvent("jspanelstatuschange",{detail:e.id}),i=new CustomEvent("jspanelbeforenormalize",{detail:e.id}),l=new CustomEvent("jspanelnormalized",{detail:e.id}),c=new CustomEvent("jspanelbeforemaximize",{detail:e.id}),d=new CustomEvent("jspanelmaximized",{detail:e.id}),p=new CustomEvent("jspanelbeforeminimize",{detail:e.id}),h=new CustomEvent("jspanelminimized",{detail:e.id}),f=new CustomEvent("jspanelbeforesmallify",{detail:e.id}),m=new CustomEvent("jspanelsmallified",{detail:e.id}),g=new CustomEvent("jspanelsmallifiedmax",{detail:e.id}),u=new CustomEvent("jspanelbeforeunsmallify",{detail:e.id}),b=new CustomEvent("jspanelfronted",{detail:e.id}),y=new CustomEvent("jspanelbeforeclose",{detail:e.id}),j=new CustomEvent("jspanelclosed",{detail:e.id}),w=new CustomEvent("jspanelcloseduser",{detail:e.id});[s,r,i,l,c,d,p,h,f,m,g,u,b,y,j,w].forEach(e=>{e.panel=a});const P=a.querySelector(".jsPanel-btn-close"),v=a.querySelector(".jsPanel-btn-maximize"),x=a.querySelector(".jsPanel-btn-normalize"),E=a.querySelector(".jsPanel-btn-smallify"),C=a.querySelector(".jsPanel-btn-minimize");"onpointerdown"in window&&a.controlbar.querySelectorAll(".jsPanel-btn").forEach(e=>{e.addEventListener("pointerdown",e=>{e.preventDefault()},!0)}),P&&jsPanel.pointerup.forEach(e=>{P.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;a.close(null,!0)})}),v&&jsPanel.pointerup.forEach(e=>{v.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;a.maximize()})}),x&&jsPanel.pointerup.forEach(e=>{x.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;a.normalize()})}),E&&jsPanel.pointerup.forEach(e=>{E.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;"normalized"===a.status||"maximized"===a.status?a.smallify():"smallified"!==a.status&&"smallifiedmax"!==a.status||a.unsmallify()})}),C&&jsPanel.pointerup.forEach(e=>{C.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;a.minimize()})});let F=jsPanel.extensions;for(let e in F)F.hasOwnProperty(e)&&(a[e]=F[e]);if(a.clearTheme=(e=>(jsPanel.themes.forEach(e=>{["panel",`jsPanel-theme-${e}`,`panel-${e}`,`${e}-color`].forEach(e=>{a.classList.remove(e)}),a.header.classList.remove(`jsPanel-theme-${e}`)}),a.content.classList.remove("jsPanel-content-filled","jsPanel-content-filledlight"),a.header.classList.remove("jsPanel-hdr-light"),a.header.classList.remove("jsPanel-hdr-dark"),a.style.backgroundColor="",jsPanel.setStyle(a.headertoolbar,{boxShadow:"",width:"",marginLeft:"",borderTopColor:"transparent"}),jsPanel.setStyle(a.content,{background:"",borderTopColor:"transparent"}),a.header.style.background="",Array.prototype.slice.call(a.controlbar.querySelectorAll(".jsPanel-icon")).concat([a.headerlogo,a.headertitle,a.headertoolbar,a.content]).forEach(e=>{e.style.color=""}),e&&e.call(a,a),a)),a.getThemeDetails=(e=>{const t=e.toLowerCase(),n={color:!1,colors:!1,filling:!1},o=t.split("fill");if(n.color=o[0].trim().replace(/\s*/g,""),2===o.length)if(o[1].startsWith("edlight"))n.filling="filledlight";else if(o[1].startsWith("eddark"))n.filling="filleddark";else if(o[1].startsWith("ed"))n.filling="filled";else if(o[1].startsWith("color")){let e=o[1].split("color"),t=e[e.length-1].trim().replace(/\s*/g,"");jsPanel.colorNames[t]&&(t=jsPanel.colorNames[t]),t.match(/^([0-9a-f]{3}|[0-9a-f]{6})$/gi)&&(t="#"+t),n.filling=t}if(jsPanel.themes.some(e=>e===n.color.split(/\s/i)[0])){let e=n.color.split(/\s/i)[0],t=document.createElement("button");t.className=e+"-bg",document.body.appendChild(t),n.color=getComputedStyle(t).backgroundColor.replace(/\s+/gi,""),document.body.removeChild(t),t=void 0}else if(n.color.startsWith("bootstrap-")){let e=n.color.indexOf("-"),t=document.createElement("button");t.className="btn btn"+n.color.slice(e),document.body.appendChild(t),n.color=getComputedStyle(t).backgroundColor.replace(/\s+/gi,""),document.body.removeChild(t),t=void 0}else if(n.color.startsWith("mdb-")){let e,t=n.color.indexOf("-")+1,o=document.createElement("span");e=n.color.endsWith("-dark")?(e=n.color.slice(t)).replace("-dark","-color-dark"):n.color.slice(t)+"-color",o.className=e,document.body.appendChild(o),n.color=getComputedStyle(o).backgroundColor.replace(/\s+/gi,""),document.body.removeChild(o),o=void 0}return n.colors=jsPanel.calcColors(n.color),n}),a.applyColorTheme=(e=>{if(a.style.backgroundColor=e.colors[0],a.header.style.backgroundColor=e.colors[0],a.header.style.color=e.colors[3],[".jsPanel-headerlogo",".jsPanel-title",".jsPanel-hdr-toolbar"].forEach(t=>{a.querySelector(t).style.color=e.colors[3]}),a.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(t=>{t.style.color=e.colors[3]}),"string"==typeof a.options.theme&&"filled"===e.filling&&(a.content.style.borderTop="#000000"===e.colors[3]?"1px solid rgba(0,0,0,0.15)":"1px solid rgba(255,255,255,0.15)"),"#000000"===e.colors[3]?a.header.classList.add("jsPanel-hdr-light"):a.header.classList.add("jsPanel-hdr-dark"),e.filling)switch(e.filling){case"filled":jsPanel.setStyle(a.content,{backgroundColor:e.colors[2],color:e.colors[3]});break;case"filledlight":a.content.style.backgroundColor=e.colors[1];break;case"filleddark":jsPanel.setStyle(a.content,{backgroundColor:e.colors[6],color:e.colors[7]});break;default:a.content.style.backgroundColor=e.filling,a.content.style.color=jsPanel.perceivedBrightness(e.filling)<=jsPanel.colorBrightnessThreshold?"#fff":"#000"}return a}),a.applyCustomTheme=(e=>{let t,n={bgPanel:"#fff",bgContent:"#fff",colorHeader:"#000",colorContent:"#000"},o=(t="object"==typeof e?Object.assign(n,e):n).bgPanel,s=t.bgContent,r=t.colorHeader,i=t.colorContent;if(jsPanel.colorNames[o]?a.style.background="#"+jsPanel.colorNames[o]:a.style.background=o,jsPanel.colorNames[r]&&(r="#"+jsPanel.colorNames[r]),[".jsPanel-headerlogo",".jsPanel-title",".jsPanel-hdr-toolbar"].forEach(e=>{a.querySelector(e).style.color=r}),a.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(e=>{e.style.color=r}),jsPanel.colorNames[s]?a.content.style.background="#"+jsPanel.colorNames[s]:a.content.style.background=s,jsPanel.colorNames[i]?a.content.style.color="#"+jsPanel.colorNames[i]:a.content.style.color=i,jsPanel.perceivedBrightness(r)>jsPanel.colorBrightnessThreshold?a.header.classList.add("jsPanel-hdr-dark"):a.header.classList.add("jsPanel-hdr-light"),jsPanel.perceivedBrightness(i)>jsPanel.colorBrightnessThreshold?a.content.style.borderTop="1px solid rgba(255,255,255,0.15)":a.content.style.borderTop="1px solid rgba(0,0,0,0.15)",t.border){let e=t.border,n=e.lastIndexOf(" "),o=e.slice(++n);jsPanel.colorNames[o]&&(e=e.replace(o,"#"+jsPanel.colorNames[o])),a.style.border=e}return a}),a.setBorder=(e=>{let t=jsPanel.pOborder(e);return t[2].length?jsPanel.colorNames[t[2]]&&(t[2]="#"+jsPanel.colorNames[t[2]]):t[2]=a.style.backgroundColor,t=t.join(" "),a.style.border=t,a.options.border=t,a}),a.setBorderRadius=(e=>{"number"==typeof e&&(e+="px"),a.style.borderRadius=e;const t=getComputedStyle(a);return a.querySelector(".jsPanel-hdr")?(a.header.style.borderTopLeftRadius=t.borderTopLeftRadius,a.header.style.borderTopRightRadius=t.borderTopRightRadius):(a.content.style.borderTopLeftRadius=t.borderTopLeftRadius,a.content.style.borderTopRightRadius=t.borderTopRightRadius),a.querySelector(".jsPanel-ftr.active")?(a.footer.style.borderBottomRightRadius=t.borderBottomRightRadius,a.footer.style.borderBottomLeftRadius=t.borderBottomLeftRadius):(a.content.style.borderBottomRightRadius=t.borderBottomRightRadius,a.content.style.borderBottomLeftRadius=t.borderBottomLeftRadius),a}),a.setTheme=((t=e.theme,n)=>{let o;if("minimized"===a.status&&(o=!0,a.normalize()),a.clearTheme(),"object"==typeof t)e.border=void 0,a.applyCustomTheme(t);else{"none"===t&&(t="white");let e=a.getThemeDetails(t);a.applyColorTheme(e)}return o&&a.minimize(),n&&n.call(a,a),a}),a.close=((e,t)=>{a.closetimer&&window.clearInterval(a.closetimer);const n=a.id,o=a.parentElement;if(document.dispatchEvent(y),a.options.onbeforeclose&&a.options.onbeforeclose.length>0&&!jsPanel.processCallbacks(a,a.options.onbeforeclose,"some",a.status,t))return a;a.options.animateOut?(a.options.animateIn&&jsPanel.remClass(a,a.options.animateIn),jsPanel.setClass(a,a.options.animateOut),a.addEventListener("animationend",s=>{s.stopPropagation(),o.removeChild(a),document.getElementById(n)?e&&e.call(a,n,a):(a.removeMinimizedReplacement(),t&&document.dispatchEvent(w),document.dispatchEvent(j),a.options.onclosed&&jsPanel.processCallbacks(a,a.options.onclosed,"every",t),jsPanel.autopositionRemaining(a),e&&e.call(n,n))})):(o.removeChild(a),document.getElementById(n)?e&&e.call(a,n,a):(a.removeMinimizedReplacement(),t&&document.dispatchEvent(w),document.dispatchEvent(j),a.options.onclosed&&jsPanel.processCallbacks(a,a.options.onclosed,"every",t),jsPanel.autopositionRemaining(a),e&&e.call(n,n)))}),a.maximize=((t,n)=>{if(a.statusBefore=a.status,e.onbeforemaximize&&e.onbeforemaximize.length>0&&!jsPanel.processCallbacks(a,e.onbeforemaximize,"some",a.statusBefore))return a;document.dispatchEvent(c);const o=a.parentElement,s=jsPanel.pOcontainment(e.maximizedMargin);return o===document.body?(a.style.width=document.documentElement.clientWidth-s[1]-s[3]+"px",a.style.height=document.documentElement.clientHeight-s[0]-s[2]+"px",a.style.left=s[3]+"px",a.style.top=s[0]+"px",e.position.fixed||(a.style.left=window.pageXOffset+s[3]+"px",a.style.top=window.pageYOffset+s[0]+"px")):(a.style.width=o.clientWidth-s[1]-s[3]+"px",a.style.height=o.clientHeight-s[0]-s[2]+"px",a.style.left=s[3]+"px",a.style.top=s[0]+"px"),E.style.transform="unset",a.removeMinimizedReplacement(),a.status="maximized",a.setControls([".jsPanel-btn-maximize"]),n||a.front(),document.dispatchEvent(d),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore),t&&t.call(a,a,a.statusBefore),e.onmaximized&&jsPanel.processCallbacks(a,e.onmaximized,"every",a.statusBefore),a}),a.minimize=(t=>{if("minimized"===a.status)return a;if(a.statusBefore=a.status,e.onbeforeminimize&&e.onbeforeminimize.length>0&&!jsPanel.processCallbacks(a,e.onbeforeminimize,"some",a.statusBefore))return a;if(document.dispatchEvent(p),!document.getElementById("jsPanel-replacement-container")){const e=document.createElement("div");e.id="jsPanel-replacement-container",document.body.append(e)}if(a.style.left="-9999px",a.status="minimized",document.dispatchEvent(h),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore),e.minimizeTo){let t,n,o,s=a.createMinimizedReplacement();switch(e.minimizeTo){case"default":document.getElementById("jsPanel-replacement-container").append(s);break;case"parentpanel":(t=(o=(n=a.closest(".jsPanel-content").parentElement).querySelectorAll(".jsPanel-minimized-box"))[o.length-1]).append(s);break;case"parent":(t=(n=a.parentElement).querySelector(".jsPanel-minimized-container"))||((t=document.createElement("div")).className="jsPanel-minimized-container",n.append(t)),t.append(s);break;default:document.querySelector(e.minimizeTo).append(s)}}return t&&t.call(a,a,a.statusBefore),e.onminimized&&jsPanel.processCallbacks(a,e.onminimized,"every",a.statusBefore),a}),a.normalize=(t=>"normalized"===a.status?a:(a.statusBefore=a.status,e.onbeforenormalize&&e.onbeforenormalize.length>0&&!jsPanel.processCallbacks(a,e.onbeforenormalize,"some",a.statusBefore)?a:(document.dispatchEvent(i),a.style.width=a.currentData.width,a.style.height=a.currentData.height,a.snapped?a.snap(a.snapped,!0):(a.style.left=a.currentData.left,a.style.top=a.currentData.top),E.style.transform="unset",a.removeMinimizedReplacement(),a.status="normalized",a.setControls([".jsPanel-btn-normalize"]),a.front(),document.dispatchEvent(l),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore),t&&t.call(a,a,a.statusBefore),e.onnormalized&&jsPanel.processCallbacks(a,e.onnormalized,"every",a.statusBefore),a))),a.smallify=(t=>{if("smallified"===a.status||"smallifiedmax"===a.status)return a;if(a.statusBefore=a.status,e.onbeforesmallify&&e.onbeforesmallify.length>0&&!jsPanel.processCallbacks(a,e.onbeforesmallify,"some",a.statusBefore))return a;document.dispatchEvent(f),a.style.overflow="hidden";const n=window.getComputedStyle(a),o=parseFloat(window.getComputedStyle(a.headerbar).height);a.style.height=parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth)+o+"px",E.style.transform="rotate(180deg)","normalized"===a.status?(a.setControls([".jsPanel-btn-normalize"]),a.status="smallified",document.dispatchEvent(m),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore)):"maximized"===a.status&&(a.setControls([".jsPanel-btn-maximize"]),a.status="smallifiedmax",document.dispatchEvent(g),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore));const s=a.querySelectorAll(".jsPanel-minimized-box");return s[s.length-1].style.display="none",t&&t.call(a,a,a.statusBefore),e.onsmallified&&jsPanel.processCallbacks(a,e.onsmallified,"every",a.statusBefore),a}),a.unsmallify=(t=>{if(a.statusBefore=a.status,"smallified"===a.status||"smallifiedmax"===a.status){if(e.onbeforeunsmallify&&e.onbeforeunsmallify.length>0&&!jsPanel.processCallbacks(a,e.onbeforeunsmallify,"some",a.statusBefore))return a;document.dispatchEvent(u),a.style.overflow="visible",a.front(),"smallified"===a.status?(a.style.height=a.currentData.height,a.setControls([".jsPanel-btn-normalize"]),a.status="normalized",document.dispatchEvent(l),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every",a.statusBefore)):"smallifiedmax"===a.status?a.maximize():"minimized"===a.status&&a.normalize(),E.style.transform="rotate(0deg)";const n=a.querySelectorAll(".jsPanel-minimized-box");n[n.length-1].style.display="flex",t&&t.call(a,a,a.statusBefore),e.onunsmallified&&jsPanel.processCallbacks(a,e.onunsmallified,"every",a.statusBefore)}return a}),a.front=((t,n=!0)=>{if("minimized"===a.status)"maximized"===a.statusBefore?a.maximize():a.normalize();else{const e=Array.prototype.slice.call(document.querySelectorAll(".jsPanel-standard")).map(e=>e.style.zIndex);Math.max(...e)>a.style.zIndex&&(a.style.zIndex=jsPanel.zi.next()),jsPanel.resetZi()}return document.dispatchEvent(b),t&&t.call(a,a),e.onfronted&&n&&jsPanel.processCallbacks(a,e.onfronted,"every",a.status),a}),a.snap=((e,t=!1)=>{if(t||(a.currentData.beforeSnap={width:a.currentData.width,height:a.currentData.height}),e&&"function"==typeof e&&!t)e.call(a,a,a.snappableTo);else if(!1!==e){const e=[0,0];if(a.options.dragit.snap.containment&&a.options.dragit.containment){const t=jsPanel.pOcontainment(a.options.dragit.containment),n=a.snappableTo;n.startsWith("left")?e[0]=t[3]:n.startsWith("right")&&(e[0]=-t[1]),n.endsWith("top")?e[1]=t[0]:n.endsWith("bottom")&&(e[1]=-t[2])}a.reposition(`${a.snappableTo} ${e[0]} ${e[1]}`)}t||(a.snapped=a.snappableTo)}),a.move=((e,t)=>{let n=a.overlaps(e,"paddingbox"),o=a.parentElement;return e.appendChild(a),a.options.container=e,a.style.left=n.left+"px",a.style.top=n.top+"px",a.saveCurrentDimensions(),a.saveCurrentPosition(),a.calcSizeFactors(),t&&t.call(a,a,e,o),a}),a.closeChildpanels=(e=>(a.getChildpanels().forEach(e=>e.close()),e&&e.call(a,a),a)),a.getChildpanels=(e=>{const t=a.content.querySelectorAll(".jsPanel");return e&&t.forEach((t,n,o)=>{e.call(t,t,n,o)}),t}),a.isChildpanel=(e=>{const t=a.closest(".jsPanel-content"),n=t?t.parentElement:null;return e&&e.call(a,a,n),!!t&&n}),a.contentRemove=(e=>(jsPanel.emptyNode(a.content),e&&e.call(a,a),a)),a.createMinimizedReplacement=(()=>{const t=jsPanel.createMinimizedTemplate(),n=window.getComputedStyle(a.headertitle).color,o=window.getComputedStyle(a),s=e.iconfont,r=t.querySelector(".jsPanel-controlbar");return"auto-show-hide"!==a.options.header?jsPanel.setStyle(t,{backgroundColor:o.backgroundColor,backgroundPositionX:o.backgroundPositionX,backgroundPositionY:o.backgroundPositionY,backgroundRepeat:o.backgroundRepeat,backgroundAttachment:o.backgroundAttachment,backgroundImage:o.backgroundImage,backgroundSize:o.backgroundSize,backgroundOrigin:o.backgroundOrigin,backgroundClip:o.backgroundClip}):t.style.backgroundColor=window.getComputedStyle(a.header).backgroundColor,t.id=a.id+"-min",t.querySelector(".jsPanel-headerbar").replaceChild(a.headerlogo.cloneNode(!0),t.querySelector(".jsPanel-headerlogo")),t.querySelector(".jsPanel-titlebar").replaceChild(a.headertitle.cloneNode(!0),t.querySelector(".jsPanel-title")),t.querySelector(".jsPanel-titlebar").setAttribute("title",a.headertitle.textContent),t.querySelector(".jsPanel-title").style.color=n,r.style.color=n,r.querySelectorAll("button").forEach(e=>{e.style.color=n}),["jsPanel-hdr-dark","jsPanel-hdr-light"].forEach(e=>{a.header.classList.contains(e)&&t.querySelector(".jsPanel-hdr").classList.add(e)}),a.setIconfont(s,t),"onpointerdown"in window&&t.querySelectorAll(".jsPanel-btn").forEach(e=>{e.addEventListener("pointerdown",e=>{e.preventDefault()},!0)}),"enabled"===a.dataset.btnnormalize?jsPanel.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-normalize").addEventListener(e,()=>{a.normalize()})}):r.querySelector(".jsPanel-btn-normalize").style.display="none","enabled"===a.dataset.btnmaximize?jsPanel.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-maximize").addEventListener(e,()=>{a.maximize()})}):r.querySelector(".jsPanel-btn-maximize").style.display="none","enabled"===a.dataset.btnclose?jsPanel.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-close").addEventListener(e,()=>{a.close(null,!0)})}):r.querySelector(".jsPanel-btn-close").style.display="none",t}),a.removeMinimizedReplacement=(()=>{const e=document.getElementById(`${a.id}-min`);e&&e.parentElement.removeChild(e)}),a.dragit=(t=>{const n=Object.assign({},jsPanel.defaults.dragit,e.dragit),o=a.querySelectorAll(n.handles);return"disable"===t?o.forEach(e=>{e.style.pointerEvents="none"}):o.forEach(e=>{e.style.pointerEvents="auto"}),a}),a.resizeit=(e=>{const t=a.querySelectorAll(".jsPanel-resizeit-handle");return"disable"===e?t.forEach(e=>{e.style.pointerEvents="none"}):t.forEach(e=>{e.style.pointerEvents="auto"}),a}),a.getScaleFactor=(()=>{const e=a.getBoundingClientRect();return{x:e.width/a.offsetWidth,y:e.height/a.offsetHeight}}),a.calcSizeFactors=(()=>{const t=window.getComputedStyle(a);if("window"===e.container)a.hf=parseFloat(t.left)/(window.innerWidth-parseFloat(t.width)),a.vf=parseFloat(t.top)/(window.innerHeight-parseFloat(t.height));else if(a.parentElement){let e=a.parentElement.getBoundingClientRect();a.hf=parseFloat(t.left)/(e.width-parseFloat(t.width)),a.vf=parseFloat(t.top)/(e.height-parseFloat(t.height))}}),a.saveCurrentDimensions=((e=!1)=>{const t=window.getComputedStyle(a);a.currentData.width=t.width,"normalized"===a.status&&(a.currentData.height=t.height),e&&(a.style.height=t.height)}),a.saveCurrentPosition=(()=>{const e=window.getComputedStyle(a);a.currentData.left=e.left,a.currentData.top=e.top}),a.reposition=((...t)=>{let n,o=e.position,s=!0;return t.forEach(e=>{"string"==typeof e||"object"==typeof e?o=e:"boolean"==typeof e?s=e:"function"==typeof e&&(n=e)}),jsPanel.position(a,o),s&&a.saveCurrentPosition(),n&&n.call(a,a),a}),a.repositionOnSnap=(t=>{let n="0",o="0",s=jsPanel.pOcontainment(e.dragit.containment);if(e.dragit.snap.containment)switch(t){case"left-top":n=s[3],o=s[0];break;case"right-top":n=-s[1],o=s[0];break;case"right-bottom":n=-s[1],o=-s[2];break;case"left-bottom":n=s[3],o=-s[2];break;case"center-top":n=s[3]/2-s[1]/2,o=s[0];break;case"center-bottom":n=s[3]/2-s[1]/2,o=-s[2];break;case"left-center":n=s[3],o=s[0]/2-s[2]/2;break;case"right-center":n=-s[1],o=s[0]/2-s[2]/2}jsPanel.position(a,t),jsPanel.setStyle(a,{left:`calc(${a.style.left} + ${n}px)`,top:`calc(${a.style.top} + ${o}px)`})}),a.overlaps=((e,t,n)=>{let o,s=a.getBoundingClientRect(),r=getComputedStyle(a.parentElement),i=a.getScaleFactor(),l={top:0,right:0,bottom:0,left:0},c=0,d=0,p=0,h=0;"window"!==a.options.container&&"paddingbox"===t&&(l.top=parseInt(r.borderTopWidth,10)*i.y,l.right=parseInt(r.borderRightWidth,10)*i.x,l.bottom=parseInt(r.borderBottomWidth,10)*i.y,l.left=parseInt(r.borderLeftWidth,10)*i.x),o="string"==typeof e?"window"===e?{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}:"parent"===e?a.parentElement.getBoundingClientRect():document.querySelector(e).getBoundingClientRect():e.getBoundingClientRect(),n&&(c=n.touches?n.touches[0].clientX:n.clientX,d=n.touches?n.touches[0].clientY:n.clientY,p=c-o.left,h=d-o.top);let f=s.lefto.left,m=s.topo.top;return{overlaps:f&&m,top:s.top-o.top-l.top,right:o.right-s.right-l.right,bottom:o.bottom-s.bottom-l.bottom,left:s.left-o.left-l.left,parentBorderWidth:l,panelRect:s,referenceRect:o,pointer:{clientX:c,clientY:d,left:p-l.left,top:h-l.top,right:o.width-p-l.right,bottom:o.height-h-l.bottom}}}),a.setSize=(()=>{if(e.panelSize){const t=jsPanel.pOsize(a,e.panelSize);a.style.width=t.width,a.style.height=t.height}else if(e.contentSize){const t=jsPanel.pOsize(a,e.contentSize);a.content.style.width=t.width,a.content.style.height=t.height,a.style.width=t.width,a.content.style.width="100%"}return a}),a.resize=((...e)=>{let t,n=window.getComputedStyle(a),o={width:n.width,height:n.height},s=!0;e.forEach(e=>{"string"==typeof e?o=e:"object"==typeof e?o=Object.assign(o,e):"boolean"==typeof e?s=e:"function"==typeof e&&(t=e)});let r=jsPanel.pOsize(a,o);a.style.width=r.width,a.style.height=r.height,s&&a.saveCurrentDimensions(),a.status="normalized";let i=a.controlbar.querySelector(".jsPanel-btn-smallify");return i&&(i.style.transform="rotate(0deg)"),t&&t.call(a,a),a.calcSizeFactors(),a}),a.setControls=((e,t)=>(a.header.querySelectorAll(".jsPanel-btn").forEach(e=>{const t=e.className.split("-"),n=t[t.length-1];"hidden"!==a.getAttribute(`data-btn${n}`)&&(e.style.display="block")}),e.forEach(e=>{const t=a.controlbar.querySelector(e);t&&(t.style.display="none")}),t&&t.call(a,a),a)),a.setControlStatus=((e,t="enable",n)=>{const o=a.controlbar.querySelector(`.jsPanel-btn-${e}`);switch(t){case"disable":"removed"!==a.getAttribute(`data-btn${e}`)&&(a.setAttribute(`data-btn${e}`,"disabled"),o.style.pointerEvents="none",o.style.opacity=.4,o.style.cursor="default");break;case"hide":"removed"!==a.getAttribute(`data-btn${e}`)&&(a.setAttribute(`data-btn${e}`,"hidden"),o.style.display="none");break;case"show":"removed"!==a.getAttribute(`data-btn${e}`)&&(a.setAttribute(`data-btn${e}`,"enabled"),o.style.display="block",o.style.pointerEvents="auto",o.style.opacity=1,o.style.cursor="pointer");break;case"enable":"removed"!==a.getAttribute(`data-btn${e}`)&&("hidden"===a.getAttribute(`data-btn${e}`)&&(o.style.display="block"),a.setAttribute(`data-btn${e}`,"enabled"),o.style.pointerEvents="auto",o.style.opacity=1,o.style.cursor="pointer");break;case"remove":a.controlbar.removeChild(o),a.setAttribute(`data-btn${e}`,"removed")}return n&&n.call(a,a),a}),a.setControlSize=(e=>{const t=e.toLowerCase();a.controlbar.querySelectorAll(".jsPanel-btn").forEach(e=>{["jsPanel-btn-xl","jsPanel-btn-lg","jsPanel-btn-md","jsPanel-btn-sm","jsPanel-btn-xs"].forEach(t=>{e.classList.remove(t)}),e.classList.add(`jsPanel-btn-${t}`)}),"xl"===t?a.titlebar.style.fontSize="1.5rem":"lg"===t?a.titlebar.style.fontSize="1.25rem":"md"===t?a.titlebar.style.fontSize="1.05rem":"sm"===t?a.titlebar.style.fontSize=".9rem":"xs"===t&&(a.titlebar.style.fontSize=".8rem")}),a.setHeaderControls=(t=>{if(a.options.headerControls.add){let e=a.options.headerControls.add;Array.isArray(e)||(e=[e]),e.forEach(e=>{a.addControl(e)})}let n=[];a.controlbar.querySelectorAll(".jsPanel-btn").forEach(e=>{let t=e.className.match(/jsPanel-btn-[a-z0-9]{3,}/i)[0].substring(12);n.push(t)});const o=jsPanel.pOheaderControls(e.headerControls);return e.headerControls=o,n.forEach(e=>{o[e]&&a.setControlStatus(e,o[e])}),a.setControlSize(o.size),t&&t.call(a,a),a}),a.setHeaderLogo=((e,t)=>{let n=[a.headerlogo],o=document.querySelector("#"+a.id+"-min");return o&&n.push(o.querySelector(".jsPanel-headerlogo")),"string"==typeof e?"<"!==e.substr(0,1)?n.forEach(t=>{jsPanel.emptyNode(t);let n=document.createElement("img");n.src=e,t.append(n)}):n.forEach(t=>{t.innerHTML=e}):n.forEach(t=>{jsPanel.emptyNode(t),t.append(e)}),a.headerlogo.childNodes.forEach(e=>{e.nodeName&&"IMG"===e.nodeName&&e.setAttribute("draggable","false")}),t&&t.call(a,a),a}),a.setHeaderRemove=(e=>(a.removeChild(a.header),a.content.classList.add("jsPanel-content-noheader"),["close","maximize","normalize","minimize","smallify"].forEach(e=>{a.setAttribute(`data-btn${e}`,"removed")}),e&&e.call(a,a),a)),a.setHeaderTitle=((e,t)=>{let n=[a.headertitle],o=document.querySelector("#"+a.id+"-min");return o&&n.push(o.querySelector(".jsPanel-title")),"string"==typeof e?n.forEach(t=>{t.innerHTML=e}):"function"==typeof e?n.forEach(t=>{jsPanel.emptyNode(t),t.innerHTML=e()}):n.forEach(t=>{jsPanel.emptyNode(t),t.append(e)}),t&&t.call(a,a),a}),a.setIconfont=((e=!1,t=a,n)=>{if(!1!==e){let n,o;if("fa"===e||"far"===e||"fal"===e||"fas"===e||"fad"===e)n=[`${e} fa-window-close`,`${e} fa-window-maximize`,`${e} fa-window-restore`,`${e} fa-window-minimize`,`${e} fa-chevron-up`];else if("material-icons"===e)n=[e,e,e,e,e,e],o=["close","fullscreen","fullscreen_exit","call_received","expand_less"];else if(Array.isArray(e))n=[`custom-control-icon ${e[4]}`,`custom-control-icon ${e[3]}`,`custom-control-icon ${e[2]}`,`custom-control-icon ${e[1]}`,`custom-control-icon ${e[0]}`];else{if("bootstrap"!==e&&"glyphicon"!==e)return t;n=["glyphicon glyphicon-remove","glyphicon glyphicon-fullscreen","glyphicon glyphicon-resize-full","glyphicon glyphicon-minus","glyphicon glyphicon-chevron-up"]}t.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(e=>{jsPanel.emptyNode(e).innerHTML=""}),Array.prototype.slice.call(t.querySelectorAll(".jsPanel-controlbar .jsPanel-btn > span")).reverse().forEach((t,a)=>{t.className=n[a],"material-icons"===e&&(t.textContent=o[a])})}return n&&n.call(t,t),t}),a.addToolbar=((e,t,n)=>{if("header"===e?e=a.headertoolbar:"footer"===e&&(e=a.footer),"string"==typeof t)e.innerHTML=t;else if(Array.isArray(t))t.forEach(t=>{"string"==typeof t?e.innerHTML+=t:e.append(t)});else if("function"==typeof t){let n=t.call(a,a);"string"==typeof n?e.innerHTML=n:e.append(n)}else e.append(t);return e.classList.add("active"),n&&n.call(a,a),a}),a.addCloseControl=(()=>{let e=document.createElement("button"),t=a.content.style.color;return e.classList.add("jsPanel-addCloseCtrl"),e.innerHTML=jsPanel.icons.close,e.style.color=t,a.options.rtl&&e.classList.add("rtl"),a.appendChild(e),jsPanel.pointerup.forEach(t=>{e.addEventListener(t,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;a.close(null,!0)})}),jsPanel.pointerdown.forEach(t=>{e.addEventListener(t,e=>{e.preventDefault()})}),a}),a.addControl=(t=>{if(!t.html)return a;t.position||(t.position=1);const n=a.controlbar.querySelectorAll(".jsPanel-btn").length;let o=document.createElement("button");o.innerHTML=t.html,o.className=`jsPanel-btn jsPanel-btn-${t.name} jsPanel-btn-${e.headerControls.size}`,o.style.color=a.header.style.color,t.position>n?a.controlbar.append(o):a.controlbar.insertBefore(o,a.querySelector(`.jsPanel-controlbar .jsPanel-btn:nth-child(${t.position})`));const s=t.ariaLabel||t.name;return s&&o.setAttribute("aria-label",s),jsPanel.pointerup.forEach(e=>{o.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;t.handler.call(a,a,o)})}),t.afterInsert&&t.afterInsert.call(o,o),a}),a.setRtl=(()=>{[a.header,a.content,a.footer].forEach(t=>{t.dir="rtl",e.rtl.lang&&(t.lang=e.rtl.lang)})}),a.id=e.id,a.classList.add("jsPanel-"+e.paneltype),"standard"===e.paneltype&&(a.style.zIndex=this.zi.next()),o.append(a),a.front(!1,!1),a.setTheme(e.theme),e.boxShadow&&a.classList.add(`jsPanel-depth-${e.boxShadow}`),e.header){if(e.headerLogo&&a.setHeaderLogo(e.headerLogo),a.setIconfont(e.iconfont),a.setHeaderTitle(e.headerTitle),a.setHeaderControls(),jsPanel.isIE){let e=[a.headerbar,a.controlbar];switch(a.options.headerControls.size){case"md":e.forEach(e=>{e.style.height="34px"});break;case"xs":e.forEach(e=>{e.style.height="26px"});break;case"sm":e.forEach(e=>{e.style.height="30px"});break;case"lg":e.forEach(e=>{e.style.height="38px"});break;case"xl":e.forEach(e=>{e.style.height="42px"})}}if("auto-show-hide"===e.header){let t="jsPanel-depth-"+e.boxShadow;a.header.style.opacity=0,a.style.backgroundColor="transparent",this.remClass(a,t),this.setClass(a.content,t),a.header.addEventListener("mouseenter",()=>{a.header.style.opacity=1,jsPanel.setClass(a,t),jsPanel.remClass(a.content,t)}),a.header.addEventListener("mouseleave",()=>{a.header.style.opacity=0,jsPanel.remClass(a,t),jsPanel.setClass(a.content,t)})}}else a.setHeaderRemove(),e.addCloseControl&&a.addCloseControl();if(e.headerToolbar&&a.addToolbar(a.headertoolbar,e.headerToolbar),e.footerToolbar&&a.addToolbar(a.footer,e.footerToolbar),e.border&&a.setBorder(e.border),e.borderRadius&&a.setBorderRadius(e.borderRadius),e.content&&("function"==typeof e.content?e.content.call(a,a):"string"==typeof e.content?a.content.innerHTML=e.content:a.content.append(e.content)),e.contentAjax&&this.ajax(a,e.contentAjax),e.contentFetch&&this.fetch(a),e.contentOverflow){const t=e.contentOverflow.split(" ");1===t.length?a.content.style.overflow=t[0]:2===t.length&&(a.content.style.overflowX=t[0],a.content.style.overflowY=t[1])}if(e.autoclose){"number"==typeof e.autoclose?e.autoclose={time:e.autoclose+"ms"}:"string"==typeof e.autoclose&&(e.autoclose={time:e.autoclose});let t=Object.assign({},jsPanel.defaultAutocloseConfig,e.autoclose);t.time&&"number"==typeof t.time&&(t.time+="ms");let n=a.autocloseProgressbar.querySelector("div");n.addEventListener("animationend",e=>{e.stopPropagation(),a.close()}),t.progressbar&&(a.autocloseProgressbar.style.height="3px",t.background?jsPanel.themes.indexOf(t.background)>-1?a.autocloseProgressbar.classList.add(t.background+"-bg"):jsPanel.colorNames[t.background]?a.autocloseProgressbar.style.background="#"+jsPanel.colorNames[t.background]:a.autocloseProgressbar.style.background=t.background:a.autocloseProgressbar.classList.add("success-bg")),n.style.animation=`${t.time} progressbar`}if(e.rtl&&a.setRtl(),a.setSize(),a.status="normalized",e.position?this.position(a,e.position):a.style.opacity=1,document.dispatchEvent(l),a.calcSizeFactors(),e.animateIn&&(a.addEventListener("animationend",()=>{this.remClass(a,e.animateIn)}),this.setClass(a,e.animateIn)),e.syncMargins){let t=this.pOcontainment(e.maximizedMargin);e.dragit&&(e.dragit.containment=t,!0===e.dragit.snap?(e.dragit.snap=jsPanel.defaultSnapConfig,e.dragit.snap.containment=!0):e.dragit.snap&&(e.dragit.snap.containment=!0)),e.resizeit&&(e.resizeit.containment=t)}if(e.dragit?(["start","drag","stop"].forEach(t=>{e.dragit[t]?"function"==typeof e.dragit[t]&&(e.dragit[t]=[e.dragit[t]]):e.dragit[t]=[]}),this.dragit(a,e.dragit),a.addEventListener("jspaneldragstop",e=>{e.panel===a&&a.calcSizeFactors()},!1)):a.titlebar.style.cursor="default",e.resizeit){["start","resize","stop"].forEach(t=>{e.resizeit[t]?"function"==typeof e.resizeit[t]&&(e.resizeit[t]=[e.resizeit[t]]):e.resizeit[t]=[]}),this.resizeit(a,e.resizeit);let t=void 0;a.addEventListener("jspanelresizestart",e=>{e.panel===a&&(t=a.status)},!1),a.addEventListener("jspanelresizestop",n=>{n.panel===a&&("smallified"===t||"smallifiedmax"===t||"maximized"===t)&&parseFloat(a.style.height)>parseFloat(window.getComputedStyle(a.header).height)&&(a.setControls([".jsPanel-btn-normalize"]),a.status="normalized",document.dispatchEvent(l),document.dispatchEvent(r),e.onstatuschange&&jsPanel.processCallbacks(a,e.onstatuschange,"every"),a.calcSizeFactors())},!1)}if(a.saveCurrentDimensions(!0),a.saveCurrentPosition(),e.setStatus&&("smallifiedmax"===e.setStatus?a.maximize().smallify():"smallified"===e.setStatus?a.smallify():a[e.setStatus.substr(0,e.setStatus.length-1)]()),this.pointerdown.forEach(t=>{a.addEventListener(t,t=>{t.target.closest(".jsPanel-btn-close")||t.target.closest(".jsPanel-btn-minimize")||"standard"!==e.paneltype||a.front()},!1)}),e.onwindowresize){let t=e.onwindowresize;"window"===a.options.container&&window.addEventListener("resize",e=>{if(e.target===window){let n,o,s=a.status;"maximized"===s&&t?a.maximize(!1,!0):a.snapped&&"minimized"!==s?a.snap(a.snapped,!0):"normalized"===s||"smallified"===s||"maximized"===s?"function"==typeof t?t.call(a,e,a):(n=(window.innerWidth-a.offsetWidth)*a.hf,a.style.left=n<=0?0:n+"px",o=(window.innerHeight-a.offsetHeight)*a.vf,a.style.top=o<=0?0:o+"px"):"smallifiedmax"===s&&t&&a.maximize(!1,!0).smallify()}},!1)}if(e.onparentresize){let t=e.onparentresize,n=a.isChildpanel();if(n){const e=n.content;let o=[];document.addEventListener("jspanelresize",s=>{if(s.panel===n){o[0]=e.offsetWidth,o[1]=e.offsetHeight;let n,s,r=a.status;"maximized"===r&&t?a.maximize():a.snapped&&"minimized"!==r?a.snap(a.snapped,!0):"normalized"===r||"smallified"===r||"maximized"===r?"function"==typeof t?t.call(a,a,{width:o[0],height:o[1]}):(n=(o[0]-a.offsetWidth)*a.hf,a.style.left=n<=0?0:n+"px",s=(o[1]-a.offsetHeight)*a.vf,a.style.top=s<=0?0:s+"px"):"smallifiedmax"===r&&t&&a.maximize().smallify()}},!1)}}return this.globalCallbacks&&(Array.isArray(this.globalCallbacks)?this.globalCallbacks.forEach(e=>{e.call(a,a)}):this.globalCallbacks.call(a,a)),e.callback&&(Array.isArray(e.callback)?e.callback.forEach(e=>{e.call(a,a)}):e.callback.call(a,a)),t&&t.call(a,a),document.dispatchEvent(s),a}}; \ No newline at end of file diff --git a/package.json b/package.json index b9e627b..ebe1a14 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jspanel4", - "version": "4.9.2", + "version": "4.9.3", "description": "A JavaScript library to create highly configurable multifunctional floating panels that can also be used as modal, tooltip, hint or contextmenu", "keywords": [ "jsPanel", diff --git a/source/jspanel.js b/source/jspanel.js index ef5a385..e77f388 100644 --- a/source/jspanel.js +++ b/source/jspanel.js @@ -1,7 +1,7 @@ /* jspanel.js - License MIT, copyright 2013 - 2020 Stefan Straesser (https://jspanel.de) */ 'use strict'; const jsPanel = { - version: '4.9.2', + version: '4.9.3', date: '2020-01-14 14:00', ajaxAlwaysCallbacks: [], autopositionSpacing: 4,