diff --git a/VERSION b/VERSION index 834f26295..9f8d8a916 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.8.0 +2.8.3 diff --git a/changelist.md b/changelist.md index 51afe23de..924f01154 100644 --- a/changelist.md +++ b/changelist.md @@ -1,4 +1,16 @@ # GADS Changelist +-------- +**Version**: 2.8.3 +**Released**: 13-05-2026 + +# Fixes + +- Fix for error in JS logging +- Fix error in drag and drop +- Better error for when duplicate curval ID's are present + +# QoL Fixes + -------- **Version**: 2.8.2 **Released**: 01-05-2026 diff --git a/lib/GADS.pm b/lib/GADS.pm index 9592bb03b..64238c880 100644 --- a/lib/GADS.pm +++ b/lib/GADS.pm @@ -116,7 +116,7 @@ tie %{schema->storage->dbh->{CachedKids}}, 'Tie::Cache', 100; # required for that) GADS::DB->setup(schema); -our $VERSION = '0.1'; +our $VERSION = '2.8.3'; # set serializer => 'JSON'; set behind_proxy => config->{behind_proxy}; # XXX Why doesn't this work in config file diff --git a/package.json b/package.json index ed011cbd2..3fd55f1ce 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "@types/typeahead.js": "^0.11.6", "autoprefixer": "^10.5.0", "babel-loader": "^10.1.1", + "buffer": "^6.0.3", "clean-webpack-plugin": "^4.0.0", "copy-webpack-plugin": "^14.0.0", "core-js": "^3.49.0", diff --git a/public/js/site.js b/public/js/site.js index 2f665c294..f7af64049 100644 --- a/public/js/site.js +++ b/public/js/site.js @@ -1 +1 @@ -(()=>{var e,t,n={49616:(e,t,n)=>{"use strict";n.d(t,{Y:()=>AlertBase});class Hidable{constructor(){this.element=null}hide(){this.element&&this.element.remove()}}class AlertBase extends Hidable{constructor(e,t,n=!1){super(),this.message=e,this.type=t,this.transparent=n}render(){if(this.element)throw new Error("AlertBase.render() should not be called multiple times without resetting the element.");const e=document.createElement("div");e.classList.add("alert",`alert-${this.type}`),this.transparent&&e.classList.add("alert-no-bg");for(const t of this.message.split("\n")){const n=document.createElement("p");n.textContent=t,e.appendChild(n)}return this.element=e,e}}},27e3:(e,t,n)=>{"use strict";n.d(t,{Bt:()=>r,Rf:()=>a,kl:()=>s});var i=n(74692);const r=e=>{const t=i(e);t.hasClass("hidden")||(t.addClass("hidden"),t.attr("aria-hidden","true"),t.css("display","none"),t.css("visibility","hidden"))},s=e=>{const t=i(e);t.hasClass("hidden")&&(t.removeClass("hidden"),t.removeAttr("aria-hidden"),t.removeAttr("style"))},a=e=>{try{return e&&""!==e?"string"==typeof e?JSON.parse(e):e:{}}catch(e){return{}}}},68298:(e,t,n)=>{"use strict";async function i(e,t){const n=s(t,"encrypt"),i=crypto.getRandomValues(new Uint8Array(12)),r=(new TextEncoder).encode(e),a=crypto.subtle.encrypt({name:"AES-GCM",iv:i},await n,r),o=Array.from(i),l=Array.from(new Uint8Array(await a)),d=o.concat(l);return btoa(JSON.stringify(d))}async function r(e,t){const n=s(t,"decrypt"),i=JSON.parse(atob(e)),r=new Uint8Array(i.slice(0,12)),a=new Uint8Array(i.slice(12)),o=crypto.subtle.decrypt({name:"AES-GCM",iv:r},await n,a);return(new TextDecoder).decode(await o)}async function s(e,t){const n=(new TextEncoder).encode("salt"),i=new TextEncoder,r=crypto.subtle.importKey("raw",i.encode(e),"PBKDF2",!1,["deriveKey"]),s=crypto.subtle.deriveKey({name:"PBKDF2",salt:n,iterations:1e5,hash:"SHA-256"},await r,{name:"AES-GCM",length:256},!0,[t]);return await s}n.d(t,{A:()=>a});class EncryptedStorage{static instance(){return EncryptedStorage._instance||(EncryptedStorage._instance=new EncryptedStorage(i,r)),EncryptedStorage._instance}constructor(e,t,n){this.encrypt=e,this.decrypt=t,this.storage=n||window.localStorage}async setItem(e,t,n){const i=await this.encrypt(t,n);this.storage.setItem(e,i)}async getItem(e,t){const n=this.storage.getItem(e);return n?await this.decrypt(n,t):null}removeItem(e){this.storage.removeItem(e)}clear(){this.storage.clear()}key(e){return this.storage.key(e)}get length(){return this.storage.length}}class GadsStorage{constructor(){this.test=!1,this.enabled=!0,this.test&&console.log("Using localStorage"),this.storage=this.test?localStorage:EncryptedStorage.instance()}async getStorageKey(){if(window.test)return void(this.storageKey="test");const e=await fetch("/api/get_key"),t=await e.json();if(0!==t.error)throw new Error("Failed to get storage key");this.storageKey=t.key}async setItem(e,t){await this.getItem("recovering")||await this.getItem(e)!==t&&(this.storageKey||await this.getStorageKey(),await this.storage.setItem(e,t,this.storageKey))}async getItem(e){return this.storageKey||await this.getStorageKey(),await this.storage.getItem(e,this.storageKey)}removeItem(e){this.storage.removeItem(e)}clear(){this.storage.clear()}key(e){return this.storage.key(e)}get length(){return this.storage.length}}class NullStorage{constructor(){this.enabled=!1,this.length=0}setItem(){return Promise.resolve()}getItem(){return Promise.resolve(null)}removeItem(){}clear(){}key(){return null}}const a=class AppStorage{static CreateStorageInstance(){return crypto.subtle&&void 0!==crypto.subtle?new GadsStorage:new NullStorage}}.CreateStorageInstance()},40242:(e,t,n)=>{"use strict";n.d(t,{v:()=>r});var i=n(48329);const r=async e=>{const t={description:e,url:window.location.href},n=new i.d("/api/script_error","POST"),r=new MessageUploader(n);return await r.uploadMessage(t.description)};class MessageUploader{constructor(e){this.uploader=e}async uploadMessage(e){const t=document.body.dataset.csrf,n={description:e,url:window.location.href,csrf_token:t};try{return await this.uploader.upload(n)}catch(e){console.error("Failed to upload message:",e)}}}const s=(e,t,n,i,r)=>{let s=`Error: ${e}\nSource: ${t}\nLine: ${n}, Column: ${i}`;return r&&r?.stack&&(s+=`\nStack: ${r?.stack}`),s};window.onerror=function(e,t,n,i,a){if("localhost"===location.host&&console.error("Script error occurred:",e,t,n,i,a),"/api/script_error"===location.pathname||"/login"===location.pathname)return console.error("Script error occurred but not logged to avoid recursion."),void console.error(s(e,t,n,i,a));const o=s(e,t,n,i,a);r(o).catch((e=>{console.error("Failed to upload script error:",e)}))}},84573:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var i=n(68298),r=n(27e3);const s=class StorageProvider{get provider(){return this.storage}constructor(e,t=i.A){this.instance=e,this.storage=t}async setItem(e,t){let n=await this.storage.getItem(this.instance);n||(n="{}");const i=(0,r.Rf)(n);i[e]=t,await this.storage.setItem(this.instance,JSON.stringify(i))}async getItem(e){const t=await this.storage.getItem(this.instance);if(!t)return;return(0,r.Rf)(t)[e]||void 0}async getAll(){const e=await this.storage.getItem(this.instance);return e?(0,r.Rf)(e):{}}async clear(){this.storage.removeItem(this.instance)}async removeItem(e){const t=await this.storage.getItem(this.instance);if(!t)return;const n=(0,r.Rf)(t);delete n[e],await this.storage.setItem(this.instance,JSON.stringify(n))}}},48329:(e,t,n)=>{"use strict";n.d(t,{S:()=>r,d:()=>Uploader});var i=n(27e3);async function r(e,t,n="POST",i=(()=>{})){const r=new Uploader(e,n);return r.onProgress(i),r.upload(t)}class Uploader{constructor(e,t){this.url=e,this.method=t}onProgress(e){this.onProgressCallback=e}async upload(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open(this.method,this.url.toString()),r.onabort=()=>n("aborted"),r.onerror=()=>n("error"),r.upload.onprogress=e=>{e.lengthComputable||this.onProgressCallback?.(e.loaded,0),this.onProgressCallback?.(e.loaded,e.total)},r.onreadystatechange=()=>{4===r.readyState&&(200===r.status?t((0,i.Rf)(r.responseText)):n(r.responseText))},e instanceof FormData?r.send(e):(r.setRequestHeader("Content-Type","application/json"),r.send(JSON.stringify(e)))}))}}},56420:(e,t,n)=>{"use strict";n.d(t,{L:()=>r});var i=n(74692);const r=window.do_plot_json=function(e,t){((e,t)=>{const n=e.xlabels;let r={};const a="line"==t.type;r.highlighter={showMarker:a,tooltipContentEditor:(e,t,n,i)=>i._plotData[t][n][1]};const o=s();t.type in o?r.seriesDefaults=o[t.type]:r.seriesDefaults=o.default,"donut"!=t.type&&"pie"!=t.type&&(r.series=e.labels,r.axes={xaxis:{renderer:i.jqplot.CategoryAxisRenderer,ticks:n,label:t.x_axis_name,labelRenderer:i.jqplot.CanvasAxisLabelRenderer},yaxis:{label:t.y_axis_label,labelRenderer:i.jqplot.CanvasAxisLabelRenderer}},e.options.y_max&&(r.axes.yaxis.max=e.options.y_max),e.options.is_metric&&(r.axes.yaxis.tickOptions={formatString:"%d%"}),r.axesDefaults={tickRenderer:i.jqplot.CanvasAxisTickRenderer,tickOptions:{angle:-30,fontSize:"8pt"}}),r.stackSeries=t.stackseries,r.legend={renderer:i.jqplot.EnhancedLegendRenderer,show:t.showlegend,location:"ne",placement:"inside"},r.grid={background:"#ffffff",shadow:!1},i(`[data-chart-id=${t.id}]`).jqplot(e.points,r)})(e=JSON.parse(atob(e)),t=JSON.parse(atob(t)))},s=()=>({bar:{renderer:i.jqplot.BarRenderer,rendererOptions:{shadow:!1,fillToZero:!0,barMinWidth:10},pointLabels:{show:!1,hideZeros:!0}},donut:{renderer:i.jqplot.DonutRenderer,rendererOptions:{sliceMargin:3,showDataLabels:!0,dataLabels:"value",shadow:!1}},pie:{renderer:i.jqplot.PieRenderer,rendererOptions:{showDataLabels:!0,startAngle:-90,dataLabels:"value",shadow:!1}},default:{pointLabels:{show:!1}}})},28817:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var i=n(17527),r=n(97468);class Frame{constructor(e,t){this.object=e,this.step=e.data("config").step,this.number=e.data("config").frame,this.item=e.data("config").item||null,this.skip=e.data("config").skip||null,this.back=t,this.requiredFields=e.find("input[required]"),this.isValid=!0,this.error=[],this.buttons={next:e.find(".modal-footer .btn-js-next"),back:e.find(".modal-footer .btn-js-back"),skip:e.find(".modal-footer .btn-js-skip"),addNext:e.find(".modal-footer .btn-js-add-next"),invisible:e.find(".modal-footer .btn-js-add-next"),save:e.find(".modal-footer .btn-js-save")}}}var s=n(11977),a=n(74692);class ModalComponent extends i.uA{static get allowReinitialization(){return!0}constructor(e){super(e),this.el=a(this.element),this.isWizzard=this.el.hasClass("modal--wizzard"),this.isForm=this.el.hasClass("modal--form"),this.frames=this.el.find(".modal-frame"),this.typingTimer=null,this.wasInitialized||this.initModal()}initModal(){this.el.on("show.bs.modal",(()=>{if(r.y.addSubscriber(this),this.isWizzard){try{this.activateFrame(1,0)}catch(e){s.m.error(e),this.preventModalToOpen()}this.el.on("hide.bs.modal",(e=>{this.dataHasChanged()&&(confirm("Are you sure you want to close this popup? Any unsaved data will be lost.")||e.preventDefault())}))}(this.isWizzard||this.isForm)&&this.el.on("hidden.bs.modal",(()=>{this.el.off("hide.bs.modal"),r.y.close()})),this.hideContent(!0)}))}dataHasChanged(){const e=a(this.el).find("input, textarea");let t=!1;return e.each(((e,n)=>{if(a(n).val())if("hidden"!==a(n).attr("type")&&"checkbox"!==a(n).attr("type")&&"radio"!==a(n).attr("type")||"hidden"===a(n).attr("type")&&a(n).parents(".select").length){if(a(n).data("original-value")&&a(n).val().toString()!==a(n).data("original-value").toString()||!a(n).data("original-value"))return t=!0,!1}else if("hidden"!==a(n).attr("type")&&(a(n).data("original-value")&&a(n).prop("checked")&&a(n).val()!==a(n).data("original-value").toString()||!a(n).data("original-value")&&a(n).prop("checked")))return t=!0,!1})),t}hideContent(e){e?a("body").children().attr("aria-hidden",!0):a("body").children().removeAttr("aria-hidden")}preventModalToOpen(){const e=this.el.attr("id")||"";a(`.btn[data-target="#${e}"]`).on("click",(function(e){e.stopPropagation()}))}clearFields(e){a(e).find("input, textarea").each(((e,t)=>{const n=a(t);"radio"===n.attr("type")?n.prop("checked",!1):"checkbox"===n.attr("type")?n.is(":checked")&&n.trigger("click"):(n.data("restore-value")?n.val(n.data("restore-value")):n.val(""),a(t).removeData("original-value"),n.trigger("change")),n.is(":invalid")&&(n.attr("aria-invalid",!1),n.closest(".input").removeClass("input--invalid"))}))}clearFrames(e){e?a(e).each(((e,t)=>{const n=this.getFrameByNumber(t);n&&this.clearFields(n)})):this.frames.each(((e,t)=>{this.clearFields(t)}))}getFrameNumber(e){const t=a(e).data("config");if(t.frame&&!isNaN(t.frame))return t.frame}getFrameByNumber(e){let t=null;return this.frames.each(((n,i)=>{if(a(i).data("config").frame===e)return t=i,!1})),t}activateFrame(e,t,n){this.frames.each(((i,r)=>{const o=a(r).data("config");if(!o.frame||isNaN(o.frame))throw"activateFrame: frame is not a number!";if(this.unbindEventHandlers(a(r)),o.frame===e){try{this.frame=this.createFrame(r,t)}catch(e){s.m.error(e)}this.frame.object.removeClass("invisible"),this.frame.object.find(".alert").hide(),this.activateStep(this.frame.step),this.bindEventHandlers(),this.frame.requiredFields.length&&(this.frame.buttons.next&&this.setNextButtonState(!1),this.frame.buttons.invisible&&this.setInvisibleButtonState(!1)),n&&(this.clearFields(r),this.validateFrame())}else a(r).addClass("invisible")}))}createFrame(e,t){if(isNaN(a(e).data("config").step)||isNaN(a(e).data("config").frame))throw"createFrame: Parameter is not a number!";if(a(e).data("config").skip&&isNaN(a(e).data("config").skip))throw"createFrame: Skip parameter is not a number!";return new Frame(a(e),t)}bindEventHandlers(){this.frame.buttons.next.click((()=>{r.y.next(this.frame.object)})),this.frame.buttons.back.click((()=>{r.y.back(this.frame.object)})),this.frame.buttons.skip.click((()=>{this.frame.skip&&r.y.skip(this.frame.skip)})),this.frame.buttons.addNext.click((()=>{r.y.add(this.frame.object)})),this.frame.buttons.save.click((()=>{r.y.save()})),this.frame.requiredFields.bind("keyup.modalEvent",(e=>{this.handleKeyup(e)})),this.frame.requiredFields.bind("keydown.modalEvent",(()=>{this.handleKeydown()})),this.frame.requiredFields.bind("blur.modalEvent",(e=>{this.handleBlur(e)}))}handleKeyup(e){const t=e.target;clearTimeout(this.typingTimer),this.typingTimer=setTimeout((()=>{a(t).val()&&this.validateField(t)}),1e3)}handleKeydown(){clearTimeout(this.typingTimer)}handleBlur(e){const t=e.target;clearTimeout(this.typingTimer),a(t).val()&&this.validateField(t)}isValidField(e){return!a(e).is(":invalid")&&""!=a(e).val()}validateField(e){const t=this.isValidField(e);if(this.frame.error=[],!t){const t=a(e).closest(".input").find("label").html();this.frame.error.push(`${t} is invalid`)}this.setInputState(a(e),t),this.validateFrame()}validateFrame(){this.frame&&(this.frame.isValid=!0,this.frame.requiredFields.each(((e,t)=>{this.isValidField(a(t))||(this.frame.isValid=!1)})),this.setFrameState())}setInputState(e){e.is(":invalid")?(e.attr("aria-invalid",!0),e.closest(".input").addClass("input--invalid")):(e.attr("aria-invalid",!1),e.closest(".input").removeClass("input--invalid"))}setFrameState(){const e=this.frame.object.find(".alert");if(this.frame.buttons.next&&this.setNextButtonState(this.frame.isValid),this.frame.buttons.invisible&&this.setInvisibleButtonState(this.frame.isValid),!this.frame.isValid&&this.frame.error.length>0){const t="
There were problems with the following fields:
";let n="";a.each(this.frame.error,((e,t)=>{const i=a("").text(t).html();n+=`Error: ${n}
`),t.show(),this.el.animate({scrollTop:t.offset().top},500)}handleNext(){const e=this.frame.number+1;this.frames.length>=e&&this.activateFrame(e,this.frame.number)}handleBack(){this.frame.back>0&&this.activateFrame(this.frame.back,this.frame.back-1),this.validateFrame()}handleSkip(e){this.activateFrame(e,this.frame.number)}handleAdd(e){r.y.update(e),this.clearFields(e),this.validateFrame()}handleActivate(e,t){this.activateFrame(e,this.frame.number,t)}handleShow(e){a(e).modal("show")}handleClear(e){this.clearFrames(e)}handleValidate(){this.validateFrame()}handleClose(){this.clearFrames(),this.isWizzard&&(this.activateFrame(1,0,!0),this.el.data("config")&&this.el.data("config").id&&(this.el.data("config").id=null)),this.el.unbind("hide.bs.modal hidden.bs.modal"),r.y.unsubscribe(this)}}const o=ModalComponent},97468:(e,t,n)=>{"use strict";n.d(t,{y:()=>i});const i=new class Modal{constructor(){this.observers=[]}addSubscriber(e){this.observers.push(e)}unsubscribe(e){var t=this.observers.indexOf(e);this.observers.splice(t,1)}activate(e,t,n){this.observers.forEach((i=>i.handleActivate?.(e,t,n)))}add(e){this.observers.forEach((t=>t.handleAdd?.(e)))}back(e){this.observers.forEach((t=>t.handleBack?.(e)))}next(e){this.observers.forEach((t=>t.handleNext?.(e)))}show(e){this.observers.forEach((t=>t.handleShow?.(e)))}save(){this.observers.forEach((e=>e.handleSave?.()))}upload(e){this.observers.forEach((t=>t.handleUpload?.(e)))}clear(e){this.observers.forEach((t=>t.handleClear?.(e)))}close(){this.observers.forEach((e=>e.handleClose?.()))}skip(e){this.observers.forEach((t=>t.handleSkip?.(e)))}validate(){this.observers.forEach((e=>e.handleValidate?.()))}update(e){this.observers.forEach((t=>t.handleUpdate?.(e)))}}},22224:(e,t,n)=>{"use strict";n.d(t,{n:()=>a,o:()=>d});var i=n(74692);const r=function(e,t,n){const i=t+"px",r=e+n+"px";if(this.css({left:i,top:r}),document.body&&document.body.clientWidth&&this.get(0).getBoundingClientRect){const e=document.body.clientWidth-this.get(0).getBoundingClientRect().right;e<0&&this.css({left:t+e+"px"})}},s=function(e,t,n,i){t.attr("aria-expanded",n),t.toggleClass("expanded--permanent",n&&i);const s=t.data("label-expanded"),a=t.data("label-collapsed");a&&s&&t.text(n?s:a);const o=t.siblings(".expandable").first();if(o.toggleClass("expanded",n),o.hasClass("popover")){const e=t.offset();let n=e.top,i=e.left;const s=t.offsetParent();if(s){const e=s.offset();n-=e.top,i-=e.left}r.call(o,n,i,t.outerHeight()+6)}t.trigger(n?"expand":"collapse",o),e.stopPropagation()},a=function(e){const t=i(this),n=t.hasClass("expanded--permanent");s(e,t,!n,!0)},o=function(e){const t=i(this);"true"===t.attr("aria-expanded")||s(e,t,!0,!1)},l=function(e){const t=i(this),n="true"===t.attr("aria-expanded"),r=t.hasClass("expanded--permanent");n&&!r&&s(e,t,!1,!1)},d=function(e){i(".trigger[aria-expanded]",e).on("click keydown",(function(e){"click"!==e.type&&("keydown"!==e.type||13!==e.which&&32!==e.which)||(e.preventDefault(),a.call(this,e))})),i(".trigger[aria-expanded][data-expand-on-hover=true]",e).on("mouseover",o),i(".trigger[aria-expanded][data-expand-on-hover=true]",e).on("mouseout",l)}},96688:(e,t,n)=>{"use strict";n.d(t,{B:()=>i});const i=new class MoreLess{constructor(){this.observers=[]}addSubscriber(e){this.observers.push(e)}unsubscribe(e){var t=this.observers.indexOf(e);this.observers.splice(t,1)}reinitialize(){this.observers.forEach((e=>e.reInitMoreLess?.()))}}},63513:(e,t,n)=>{"use strict";n.d(t,{W:()=>i});const i=new class SidebarObservable{constructor(){this.observers=[]}addSubscriber(e){this.observers.push(e)}sideBarChange(){this.observers.forEach((e=>e.handleSideBarChange?.()))}}},30410:(e,t,n)=>{"use strict";n.d(t,{A:()=>pt});var i=n(17527);function r(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function s(e){return e instanceof r(e).Element||e instanceof Element}function a(e){return e instanceof r(e).HTMLElement||e instanceof HTMLElement}function o(e){return"undefined"!=typeof ShadowRoot&&(e instanceof r(e).ShadowRoot||e instanceof ShadowRoot)}var l=Math.max,d=Math.min,c=Math.round;function h(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function u(){return!/^((?!chrome|android).)*safari/i.test(h())}function f(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var i=e.getBoundingClientRect(),o=1,l=1;t&&a(e)&&(o=e.offsetWidth>0&&c(i.width)/e.offsetWidth||1,l=e.offsetHeight>0&&c(i.height)/e.offsetHeight||1);var d=(s(e)?r(e):window).visualViewport,h=!u()&&n,f=(i.left+(h&&d?d.offsetLeft:0))/o,p=(i.top+(h&&d?d.offsetTop:0))/l,g=i.width/o,m=i.height/l;return{width:g,height:m,top:p,right:f+g,bottom:p+m,left:f,x:f,y:p}}function p(e){var t=r(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function g(e){return e?(e.nodeName||"").toLowerCase():null}function m(e){return((s(e)?e.ownerDocument:e.document)||window.document).documentElement}function _(e){return f(m(e)).left+p(e).scrollLeft}function v(e){return r(e).getComputedStyle(e)}function y(e){var t=v(e),n=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function b(e,t,n){void 0===n&&(n=!1);var i,s,o=a(t),l=a(t)&&function(e){var t=e.getBoundingClientRect(),n=c(t.width)/e.offsetWidth||1,i=c(t.height)/e.offsetHeight||1;return 1!==n||1!==i}(t),d=m(t),h=f(e,l,n),u={scrollLeft:0,scrollTop:0},v={x:0,y:0};return(o||!o&&!n)&&(("body"!==g(t)||y(d))&&(u=(i=t)!==r(i)&&a(i)?{scrollLeft:(s=i).scrollLeft,scrollTop:s.scrollTop}:p(i)),a(t)?((v=f(t,!0)).x+=t.clientLeft,v.y+=t.clientTop):d&&(v.x=_(d))),{x:h.left+u.scrollLeft-v.x,y:h.top+u.scrollTop-v.y,width:h.width,height:h.height}}function w(e){var t=f(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function k(e){return"html"===g(e)?e:e.assignedSlot||e.parentNode||(o(e)?e.host:null)||m(e)}function x(e){return["html","body","#document"].indexOf(g(e))>=0?e.ownerDocument.body:a(e)&&y(e)?e:x(k(e))}function j(e,t){var n;void 0===t&&(t=[]);var i=x(e),s=i===(null==(n=e.ownerDocument)?void 0:n.body),a=r(i),o=s?[a].concat(a.visualViewport||[],y(i)?i:[]):i,l=t.concat(o);return s?l:l.concat(j(k(o)))}function C(e){return["table","td","th"].indexOf(g(e))>=0}function T(e){return a(e)&&"fixed"!==v(e).position?e.offsetParent:null}function E(e){for(var t=r(e),n=T(e);n&&C(n)&&"static"===v(n).position;)n=T(n);return n&&("html"===g(n)||"body"===g(n)&&"static"===v(n).position)?t:n||function(e){var t=/firefox/i.test(h());if(/Trident/i.test(h())&&a(e)&&"fixed"===v(e).position)return null;var n=k(e);for(o(n)&&(n=n.host);a(n)&&["html","body"].indexOf(g(n))<0;){var i=v(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||t}var D="top",S="bottom",A="right",O="left",N="auto",L=[D,S,A,O],M="start",I="end",P="clippingParents",F="viewport",$="popper",R="reference",q=L.reduce((function(e,t){return e.concat([t+"-"+M,t+"-"+I])}),[]),H=[].concat(L,[N]).reduce((function(e,t){return e.concat([t,t+"-"+M,t+"-"+I])}),[]),U=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function B(e){var t=new Map,n=new Set,i=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var i=t.get(e);i&&r(i)}})),i.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),i}var z={placement:"bottom",modifiers:[],strategy:"absolute"};function W(){for(var e=arguments.length,t=new Array(e),n=0;n-1)r&&r.push(s);else if(d=me(s),a=Se(h.appendChild(s),"script"),d&&Ae(a),n)for(c=0;s=a[c++];)Ee.test(s.type||"")&&n.push(s);return h}var Le=/^([^.]*)(?:\.(.+)|)/;function Me(){return!0}function Ie(){return!1}function Pe(e,t,n,i,r,s){var a,o;if("object"==typeof t){for(o in"string"!=typeof n&&(i=i||n,n=void 0),t)Pe(e,o,n,i,t[o],s);return e}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=Ie;else if(!r)return e;return 1===s&&(a=r,r=function(e){return C().off(e),a.apply(this,arguments)},r.guid=a.guid||(a.guid=C.guid++)),e.each((function(){C.event.add(this,t,r,i,n)}))}function Fe(e,t,n){n?(oe.set(e,t,!1),C.event.add(e,t,{namespace:!1,handler:function(e){var n,i=oe.get(this,t);if(1&e.isTrigger&&this[t]){if(i)(C.event.special[t]||{}).delegateType&&e.stopPropagation();else if(i=o.call(arguments),oe.set(this,t,i),this[t](),n=oe.get(this,t),oe.set(this,t,!1),i!==n)return e.stopImmediatePropagation(),e.preventDefault(),n}else i&&(oe.set(this,t,C.event.trigger(i[0],i.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Me)}})):void 0===oe.get(e,t)&&C.event.add(e,t,Me)}C.event={global:{},add:function(e,t,n,i,r){var s,a,o,l,d,c,h,u,f,p,g,m=oe.get(e);if(se(e))for(n.handler&&(n=(s=n).handler,r=s.selector),r&&C.find.matchesSelector(ge,r),n.guid||(n.guid=C.guid++),(l=m.events)||(l=m.events=Object.create(null)),(a=m.handle)||(a=m.handle=function(t){return void 0!==C&&C.event.triggered!==t.type?C.event.dispatch.apply(e,arguments):void 0}),d=(t=(t||"").match(Y)||[""]).length;d--;)f=g=(o=Le.exec(t[d])||[])[1],p=(o[2]||"").split(".").sort(),f&&(h=C.event.special[f]||{},f=(r?h.delegateType:h.bindType)||f,h=C.event.special[f]||{},c=C.extend({type:f,origType:g,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&C.expr.match.needsContext.test(r),namespace:p.join(".")},s),(u=l[f])||((u=l[f]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(e,i,p,a)||e.addEventListener&&e.addEventListener(f,a)),h.add&&(h.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),r?u.splice(u.delegateCount++,0,c):u.push(c),C.event.global[f]=!0)},remove:function(e,t,n,i,r){var s,a,o,l,d,c,h,u,f,p,g,m=oe.hasData(e)&&oe.get(e);if(m&&(l=m.events)){for(d=(t=(t||"").match(Y)||[""]).length;d--;)if(f=g=(o=Le.exec(t[d])||[])[1],p=(o[2]||"").split(".").sort(),f){for(h=C.event.special[f]||{},u=l[f=(i?h.delegateType:h.bindType)||f]||[],o=o[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=s=u.length;s--;)c=u[s],!r&&g!==c.origType||n&&n.guid!==c.guid||o&&!o.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(u.splice(s,1),c.selector&&u.delegateCount--,h.remove&&h.remove.call(e,c));a&&!u.length&&(h.teardown&&!1!==h.teardown.call(e,p,m.handle)||C.removeEvent(e,f,m.handle),delete l[f])}else for(f in l)C.event.remove(e,f+t[d],n,i,!0);C.isEmptyObject(l)&&oe.remove(e,"handle events")}},dispatch:function(e){var t,n,i,r,s,a,o=new Array(arguments.length),l=C.event.fix(e),d=(oe.get(this,"events")||Object.create(null))[l.type]||[],c=C.event.special[l.type]||{};for(o[0]=l,t=1;t