2 lines
149 KiB
JavaScript
2 lines
149 KiB
JavaScript
/*! For license information please see dashboard.e01d5ec9.js.LICENSE.txt */
|
|
(self.webpackChunk=self.webpackChunk||[]).push([[165],{94180:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=94180,e.exports=t},10690:(e,t,n)=>{"use strict";n.d(t,{Z:()=>qe});n(21249),n(57327),n(41539),n(91038),n(78783),n(89554),n(54747),n(26699),n(32023),n(69826),n(92222),n(66992),n(70189),n(33948),n(26541),n(68304),n(24812),n(30489),n(38478),n(19601),n(88674),n(74916),n(15306),n(9653),n(12419),n(78011),n(69070),n(96649),n(96078),n(82526),n(41817),n(79753),n(32165),n(47042),n(68309);var i,r,o,a,s,l,u,c,d=n(6599),h=n(24183),f=n.n(h);function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function m(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,o=void 0,o=function(e,t){if("object"!==p(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==p(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===p(o)?o:String(o)),i)}var r,o}function b(e,t){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},b(e,t)}function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=C(e);if(t){var r=C(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return E(this,n)}}function E(e,t){if(t&&("object"===p(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return k(e)}function k(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},C(e)}function A(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)}var S=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}(u,e);var t,n,r,l=w(u);function u(){var e;return g(this,u),e=l.apply(this,arguments),i.add(k(e)),e.isObserving=!1,e.hasLoadedChoicesPreviously=!1,e.originalOptions=[],e}return t=u,(n=[{key:"initialize",value:function(){var e=this;this.mutationObserver||(this.mutationObserver=new MutationObserver((function(t){e.onMutations(t)})))}},{key:"connect",value:function(){this.selectElement&&(this.originalOptions=this.createOptionsDataStructure(this.selectElement)),this.initializeTomSelect()}},{key:"initializeTomSelect",value:function(){this.selectElement&&this.selectElement.setAttribute("data-skip-morph",""),this.urlValue?this.tomSelect=A(this,i,"m",s).call(this,this.urlValue,this.hasMinCharactersValue?this.minCharactersValue:null):this.optionsAsHtmlValue?this.tomSelect=A(this,i,"m",a).call(this):(this.tomSelect=A(this,i,"m",o).call(this),this.startMutationObserver())}},{key:"disconnect",value:function(){this.stopMutationObserver();var e=[];this.selectElement&&(e=this.selectElement.multiple?Array.from(this.selectElement.options).filter((function(e){return e.selected})).map((function(e){return e.value})):[this.selectElement.value]),this.tomSelect.destroy(),this.selectElement&&(this.selectElement.multiple?Array.from(this.selectElement.options).forEach((function(t){t.selected=e.includes(t.value)})):this.selectElement.value=e[0])}},{key:"getMaxOptions",value:function(){return this.selectElement?this.selectElement.options.length:50}},{key:"selectElement",get:function(){return this.element instanceof HTMLSelectElement?this.element:null}},{key:"formElement",get:function(){if(!(this.element instanceof HTMLInputElement||this.element instanceof HTMLSelectElement))throw new Error("Autocomplete Stimulus controller can only be used on an <input> or <select>.");return this.element}},{key:"dispatchEvent",value:function(e,t){this.dispatch(e,{detail:t,prefix:"autocomplete"})}},{key:"preload",get:function(){return this.hasPreloadValue?"false"!=this.preloadValue&&("true"==this.preloadValue||this.preloadValue):"focus"}},{key:"resetTomSelect",value:function(){if(this.tomSelect){this.dispatchEvent("before-reset",{tomSelect:this.tomSelect}),this.stopMutationObserver();var e=this.element.innerHTML,t=this.tomSelect.getValue();this.tomSelect.destroy(),this.element.innerHTML=e,this.initializeTomSelect(),this.tomSelect.setValue(t),this.startMutationObserver()}}},{key:"changeTomSelectDisabledState",value:function(e){this.stopMutationObserver(),e?this.tomSelect.disable():this.tomSelect.enable(),this.startMutationObserver()}},{key:"startMutationObserver",value:function(){!this.isObserving&&this.mutationObserver&&(this.mutationObserver.observe(this.element,{childList:!0,subtree:!0,attributes:!0,characterData:!0,attributeOldValue:!0}),this.isObserving=!0)}},{key:"stopMutationObserver",value:function(){this.isObserving&&this.mutationObserver&&(this.mutationObserver.disconnect(),this.isObserving=!1)}},{key:"onMutations",value:function(e){var t=this,n=!1,i=!1;e.forEach((function(e){switch(e.type){case"attributes":if(e.target===t.element&&"disabled"===e.attributeName){n=!0;break}if(e.target===t.element&&"multiple"===e.attributeName){t.element.hasAttribute("multiple")!==("multiple"===e.oldValue)&&(i=!0);break}}}));var r=this.selectElement?this.createOptionsDataStructure(this.selectElement):[];this.areOptionsEquivalent(r)&&!i||(this.originalOptions=r,this.resetTomSelect()),n&&this.changeTomSelectDisabledState(this.formElement.disabled)}},{key:"createOptionsDataStructure",value:function(e){return Array.from(e.options).map((function(e){var t=e.closest("optgroup");return{value:e.value,text:e.text,group:t?t.label:null}}))}},{key:"areOptionsEquivalent",value:function(e){var t=this.originalOptions.filter((function(e){return""!==e.value})),n=e.filter((function(e){return""!==e.value})),i=this.originalOptions.find((function(e){return""===e.value})),r=e.find((function(e){return""===e.value}));if(i&&r&&i.text!==r.text)return!1;if(t.length!==n.length)return!1;var o=function(e){return"".concat(e.value,"-").concat(e.text,"-").concat(e.group)},a=new Set(t.map(o)),s=new Set(n.map(o));return a.size===s.size&&m(a).every((function(e){return s.has(e)}))}}])&&y(t.prototype,n),r&&y(t,r),Object.defineProperty(t,"prototype",{writable:!1}),u}(d.Qr);i=new WeakSet,r=function(){var e=this,t={},n=!this.selectElement||this.selectElement.multiple;this.formElement.disabled||n||(t.clear_button={title:""}),n&&(t.remove_button={title:""}),this.urlValue&&(t.virtual_scroll={});var r={render:{no_results:function(){return'<div class="no-results">'.concat(e.noResultsFoundTextValue,"</div>")}},plugins:t,onItemAdd:function(){e.tomSelect.setTextboxValue("")},closeAfterSelect:!0};return this.selectElement||this.urlValue||(r.shouldLoad=function(){return!1}),A(this,i,"m",u).call(this,r,this.tomSelectOptionsValue)},o=function(){var e=A(this,i,"m",u).call(this,A(this,i,"m",r).call(this),{maxOptions:this.getMaxOptions()});return A(this,i,"m",c).call(this,e)},a=function(){var e=this,t=A(this,i,"m",u).call(this,A(this,i,"m",r).call(this),{maxOptions:this.getMaxOptions(),score:function(t){var n=e.tomSelect.getScoreFunction(t);return function(t){return n(Object.assign(Object.assign({},t),{text:A(e,i,"m",l).call(e,t.text)}))}},render:{item:function(e){return"<div>".concat(e.text,"</div>")},option:function(e){return"<div>".concat(e.text,"</div>")}}});return A(this,i,"m",c).call(this,t)},s=function(e,t){var n=this,o=A(this,i,"m",u).call(this,A(this,i,"m",r).call(this),{firstUrl:function(t){var n=e.includes("?")?"&":"?";return"".concat(e).concat(n,"query=").concat(encodeURIComponent(t))},load:function(e,t){var n=this,i=this.getUrl(e);fetch(i).then((function(e){return e.json()})).then((function(i){n.setNextUrl(e,i.next_page),t(i.results.options||i.results,i.results.optgroups||[])})).catch((function(){return t([],[])}))},shouldLoad:function(e){return null!==t?e.length>=t:!!n.hasLoadedChoicesPreviously||(e.length>0&&(n.hasLoadedChoicesPreviously=!0),e.length>=3)},optgroupField:"group_by",score:function(e){return function(e){return 1}},render:{option:function(e){return"<div>".concat(e.text,"</div>")},item:function(e){return"<div>".concat(e.text,"</div>")},loading_more:function(){return'<div class="loading-more-results">'.concat(n.loadingMoreTextValue,"</div>")},no_more_results:function(){return'<div class="no-more-results">'.concat(n.noMoreResultsTextValue,"</div>")},no_results:function(){return'<div class="no-results">'.concat(n.noResultsFoundTextValue,"</div>")}},preload:this.preload});return A(this,i,"m",c).call(this,o)},l=function(e){return e.replace(/(<([^>]+)>)/gi,"")},u=function(e,t){return Object.assign(Object.assign({},e),t)},c=function(e){var t={options:e};this.dispatchEvent("pre-connect",t);var n=new(f())(this.formElement,e),i={tomSelect:n,options:e};return this.dispatchEvent("connect",i),n},S.values={url:String,optionsAsHtml:Boolean,loadingMoreText:String,noResultsFoundText:String,noMoreResultsText:String,minCharacters:Number,tomSelectOptions:Object,preload:String};n(73210),n(69600),n(82772),n(4129),n(51532),n(32564),n(26833),n(40561),n(69720),n(4723),n(47941),n(74819),n(41637),n(85827),n(83710),n(39714),n(91058),n(44048),n(9494),n(64765),n(60285),n(72443),n(39341),n(73706),n(10408),n(65069);function T(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&L(e,t)}function O(e){var t=_();return function(){var n,i=P(e);if(t){var r=P(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return x(this,n)}}function x(e,t){if(t&&("object"===j(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function M(e){var t="function"==typeof Map?new Map:void 0;return M=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return F(e,arguments,P(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),L(i,e)},M(e)}function F(e,t,n){return F=_()?Reflect.construct.bind():function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&L(r,n.prototype),r},F.apply(null,arguments)}function _(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function L(e,t){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},L(e,t)}function P(e){return P=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},P(e)}function j(e){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},j(e)}function N(){N=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var o=t&&t.prototype instanceof h?t:h,a=Object.create(o.prototype),s=new S(r||[]);return i(a,"_invoke",{value:E(e,n,s)}),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var d={};function h(){}function f(){}function p(){}var m={};l(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(T([])));g&&g!==t&&n.call(g,o)&&(m=g);var y=p.prototype=h.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function r(i,o,a,s){var l=c(e[i],e,o);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==j(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function E(e,t,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return O()}for(n.method=r,n.arg=o;;){var a=n.delegate;if(a){var s=k(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var l=c(e,t,n);if("normal"===l.type){if(i=n.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i="completed",n.method="throw",n.arg=l.arg)}}}function k(e,t){var n=t.method,i=e.iterator[n];if(void 0===i)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,k(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var r=c(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function T(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,r=function t(){for(;++i<e.length;)if(n.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:O}}function O(){return{value:void 0,done:!0}}return f.prototype=p,i(y,"constructor",{value:p,configurable:!0}),i(p,"constructor",{value:f,configurable:!0}),f.displayName=l(p,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,a,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var a=new w(u(t,n,i,r),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(y),l(y,s,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},e.values=T,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return a.type="throw",a.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;A(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:T(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function I(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function D(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){I(o,i,r,a,s,"next",e)}function s(e){I(o,i,r,a,s,"throw",e)}a(void 0)}))}}function R(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=V(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function U(e,t){return H(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return s}}(e,t)||V(e,t)||z()}function z(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function H(e){if(Array.isArray(e))return e}function q(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,o=void 0,o=function(e,t){if("object"!==j(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==j(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===j(o)?o:String(o)),i)}var r,o}function B(e,t,n){return t&&$(e.prototype,t),n&&$(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function W(e){return function(e){if(Array.isArray(e))return Q(e)}(e)||G(e)||V(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(e,t){if(e){if("string"==typeof e)return Q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Q(e,t):void 0}}function G(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function X(e){var t=[];if(!e)return t;for(var n="",i="",r=[],o=[],a="action",s=function(){if(n)return n;if(0===t.length)throw new Error("Could not find any directives");return t[t.length-1].action},l=function(){t.push({action:n,args:r,modifiers:o,getString:function(){return e}}),n="",i="",r=[],o=[],a="action"},u=function(){r.push(i.trim()),i=""},c=function(){if(r.length>1)throw new Error('The modifier "'.concat(n,'()" does not support multiple arguments.'));o.push({name:n,value:r.length>0?r[0]:null}),n="",r=[],a="action"},d=0;d<e.length;d++){var h=e[d];switch(a){case"action":if("("===h){a="arguments";break}if(" "===h){n&&l();break}if("|"===h){c();break}n+=h;break;case"arguments":if(")"===h){u(),a="after_arguments";break}if(","===h){u();break}i+=h;break;case"after_arguments":if("|"===h){c();break}if(" "!==h)throw new Error("Missing space after ".concat(s(),"()"));l()}}switch(a){case"action":case"after_arguments":n&&l();break;default:throw new Error('Did you forget to add a closing ")" after "'.concat(n,'"?'))}return t}function Y(e){var t=[];return e.forEach((function(e){var n;t.push.apply(t,W((n=e,n.replace(/[\s]+/g," ").trim()).split(" ")))})),t}function J(e){return e.replace(/\[]$/,"").split("[").map((function(e){return e.replace("]","")})).join(".")}function K(e){return e.innerHTML?e.outerHTML.slice(0,e.outerHTML.indexOf(e.innerHTML)):e.outerHTML}var Z=new WeakMap,ee=new Map,te=function(e){var t=[];return ee.forEach((function(n,i){if(e!==i&&e.element.contains(i.element)){var r=!1;ee.forEach((function(e,t){r||t!==i&&t.element.contains(i.element)&&(r=!0)})),t.push(i)}})),t};function ne(e,t){if(e instanceof HTMLInputElement){if("checkbox"===e.type){var n=oe(e,!1);if(null!==n){var i=t.get(n.action);if(Array.isArray(i))return le(e,i);if(Object(i)===i)return le(e,Object.values(i))}return e.hasAttribute("value")?e.checked?e.getAttribute("value"):null:e.checked}return ue(e)}return e instanceof HTMLSelectElement?e.multiple?Array.from(e.selectedOptions).map((function(e){return e.value})):e.value:e.dataset.value?e.dataset.value:"value"in e?e.value:e.hasAttribute("value")?e.getAttribute("value"):null}function ie(e,t){if(e instanceof HTMLInputElement){if("file"===e.type)return;if("radio"===e.type)return void(e.checked=e.value==t);if("checkbox"===e.type){if(Array.isArray(t)){var n=!1;t.forEach((function(t){t==e.value&&(n=!0)})),e.checked=n}else e.hasAttribute("value")?e.checked=e.value==t:e.checked=t;return}}if(e instanceof HTMLSelectElement){var i=[].concat(t).map((function(e){return e+""}));Array.from(e.options).forEach((function(e){e.selected=i.includes(e.value)}))}else t=void 0===t?"":t,e.value=t}function re(e){if(!e.dataset.model)return[];var t=X(e.dataset.model);return t.forEach((function(t){if(t.args.length>0)throw new Error('The data-model="'.concat(e.dataset.model,'" format is invalid: it does not support passing arguments to the model.'));t.action=J(t.action)})),t}function oe(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=re(e);if(n.length>0)return n[0];if(e.getAttribute("name")){var i=e.closest("form");if(i&&"model"in i.dataset){var r=X(i.dataset.model||"*"),o=r[0];if(o.args.length>0)throw new Error('The data-model="'.concat(i.dataset.model,'" format is invalid: it does not support passing arguments to the model.'));return o.action=J(e.getAttribute("name")),o}}if(!t)return null;throw new Error('Cannot determine the model name for "'.concat(K(e),'": the element must either have a "data-model" (or "name" attribute living inside a <form data-model="*">).'))}function ae(e,t){if(t.element===e)return!0;if(!t.element.contains(e))return!1;var n=!1;return te(t).forEach((function(t){n||(t.element===e||t.element.contains(e))&&(n=!0)})),!n}function se(e){var t=e.cloneNode(!0);if(!(t instanceof HTMLElement))throw new Error("Could not clone element");return t}var le=function(e,t){var n=W(t),i=ue(e),r=t.indexOf(i);return e.checked?(-1===r&&n.push(i),n):(r>-1&&n.splice(r,1),n)},ue=function(e){return e.dataset.value?e.dataset.value:e.value};var ce=function(e,t){for(var n=JSON.parse(JSON.stringify(e)),i=n,r=t.split("."),o=0;o<r.length-1;o++)i=i[r[o]];return{currentLevelData:i,finalData:n,finalKey:r[r.length-1],parts:r}},de=function(){function e(t){q(this,e),this.props={},this.dirtyProps={},this.pendingProps={},this.updatedPropsFromParent={},this.props=t}return B(e,[{key:"get",value:function(e){var t=J(e);return void 0!==this.dirtyProps[t]?this.dirtyProps[t]:void 0!==this.pendingProps[t]?this.pendingProps[t]:void 0!==this.props[t]?this.props[t]:function(e,t){var n=ce(e,t),i=n.currentLevelData,r=n.finalKey;if(void 0!==i)return i[r]}(this.props,t)}},{key:"has",value:function(e){return void 0!==this.get(e)}},{key:"set",value:function(e,t){var n=J(e);return this.get(n)!==t&&(this.dirtyProps[n]=t,!0)}},{key:"getOriginalProps",value:function(){return Object.assign({},this.props)}},{key:"getDirtyProps",value:function(){return Object.assign({},this.dirtyProps)}},{key:"getUpdatedPropsFromParent",value:function(){return Object.assign({},this.updatedPropsFromParent)}},{key:"flushDirtyPropsToPending",value:function(){this.pendingProps=Object.assign({},this.dirtyProps),this.dirtyProps={}}},{key:"reinitializeAllProps",value:function(e){this.props=e,this.updatedPropsFromParent={},this.pendingProps={}}},{key:"pushPendingPropsBackToDirty",value:function(){this.dirtyProps=Object.assign(Object.assign({},this.pendingProps),this.dirtyProps),this.pendingProps={}}},{key:"storeNewPropsFromParent",value:function(e){for(var t=!1,n=0,i=Object.entries(e);n<i.length;n++){var r=U(i[n],2),o=r[0],a=r[1];this.get(o)!==a&&(t=!0)}return t&&(this.updatedPropsFromParent=e),t}}]),e}(),he=function(){var e=new Set,t={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:u,afterNodeAdded:u,beforeNodeMorphed:u,afterNodeMorphed:u,beforeNodeRemoved:u,afterNodeRemoved:u,beforeAttributeUpdated:u},head:{style:"merge",shouldPreserve:function(e){return"true"===e.getAttribute("im-preserve")},shouldReAppend:function(e){return"true"===e.getAttribute("im-re-append")},shouldRemove:u,afterHeadMorphed:u}};function n(e,t,i){if(i.head.block){var a=e.querySelector("head"),s=t.querySelector("head");if(a&&s){var u=l(s,a,i);return void Promise.all(u).then((function(){n(e,t,Object.assign(i,{head:{block:!1,ignore:!0}}))}))}}if("innerHTML"===i.morphStyle)return o(t,e,i),e.children;if("outerHTML"===i.morphStyle||null==i.morphStyle){var c=function(e,t,n){var i,r=i=e.firstChild,o=0;for(;i;){var a=y(i,t,n);a>o&&(r=i,o=a),i=i.nextSibling}return r}(t,e,i),d=null==c?void 0:c.previousSibling,h=null==c?void 0:c.nextSibling,f=r(e,c,i);return c?function(e,t,n){var i=[],r=[];for(;null!=e;)i.push(e),e=e.previousSibling;for(;i.length>0;){var o=i.pop();r.push(o),t.parentElement.insertBefore(o,t)}r.push(t);for(;null!=n;)i.push(n),r.push(n),n=n.nextSibling;for(;i.length>0;)t.parentElement.insertBefore(i.pop(),t.nextSibling);return r}(d,f,h):[]}throw"Do not understand how to morph style "+i.morphStyle}function i(e,t){return t.ignoreActiveValue&&e===document.activeElement}function r(e,t,n){if(!n.ignoreActive||e!==document.activeElement)return null==t?!1===n.callbacks.beforeNodeRemoved(e)?e:(e.remove(),n.callbacks.afterNodeRemoved(e),null):h(e,t)?(!1===n.callbacks.beforeNodeMorphed(e,t)||(e instanceof HTMLHeadElement&&n.head.ignore||(e instanceof HTMLHeadElement&&"morph"!==n.head.style?l(t,e,n):(!function(e,t,n){var r=e.nodeType;if(1===r){var o,l=e.attributes,u=t.attributes,c=R(l);try{for(c.s();!(o=c.n()).done;){var d=o.value;a(d.name,t,"update",n)||t.getAttribute(d.name)!==d.value&&t.setAttribute(d.name,d.value)}}catch(e){c.e(e)}finally{c.f()}for(var h=u.length-1;0<=h;h--){var f=u[h];a(f.name,t,"remove",n)||(e.hasAttribute(f.name)||t.removeAttribute(f.name))}}8!==r&&3!==r||t.nodeValue!==e.nodeValue&&(t.nodeValue=e.nodeValue);i(t,n)||function(e,t,n){if(e instanceof HTMLInputElement&&t instanceof HTMLInputElement&&"file"!==e.type){var i=e.value,r=t.value;s(e,t,"checked",n),s(e,t,"disabled",n),e.hasAttribute("value")?i!==r&&(a("value",t,"update",n)||(t.setAttribute("value",i),t.value=i)):a("value",t,"remove",n)||(t.value="",t.removeAttribute("value"))}else if(e instanceof HTMLOptionElement)s(e,t,"selected",n);else if(e instanceof HTMLTextAreaElement&&t instanceof HTMLTextAreaElement){var o=e.value,l=t.value;if(a("value",t,"update",n))return;o!==l&&(t.value=o),t.firstChild&&t.firstChild.nodeValue!==o&&(t.firstChild.nodeValue=o)}}(e,t,n)}(t,e,n),i(e,n)||o(t,e,n))),n.callbacks.afterNodeMorphed(e,t)),e):!1===n.callbacks.beforeNodeRemoved(e)||!1===n.callbacks.beforeNodeAdded(t)?e:(e.parentElement.replaceChild(t,e),n.callbacks.afterNodeAdded(t),n.callbacks.afterNodeRemoved(e),t)}function o(e,t,n){for(var i,o=e.firstChild,a=t.firstChild;o;)if(o=(i=o).nextSibling,null!=a)if(d(i,a,n))r(a,i,n),a=a.nextSibling,k(n,i);else{var s=p(e,t,i,a,n);if(s)a=f(a,s,n),r(s,i,n),k(n,i);else{var l=m(e,t,i,a,n);if(l)a=f(a,l,n),r(l,i,n),k(n,i);else{if(!1===n.callbacks.beforeNodeAdded(i))return;t.insertBefore(i,a),n.callbacks.afterNodeAdded(i),k(n,i)}}}else{if(!1===n.callbacks.beforeNodeAdded(i))return;t.appendChild(i),n.callbacks.afterNodeAdded(i),k(n,i)}for(;null!==a;){var u=a;a=a.nextSibling,b(u,n)}}function a(e,t,n,i){return!("value"!==e||!i.ignoreActiveValue||t!==document.activeElement)||!1===i.callbacks.beforeAttributeUpdated(e,t,n)}function s(e,t,n,i){if(e[n]!==t[n]){var r=a(n,t,"update",i);r||(t[n]=e[n]),e[n]?r||t.setAttribute(n,e[n]):a(n,t,"remove",i)||t.removeAttribute(n)}}function l(e,t,n){var i,r=[],o=[],a=[],s=[],l=n.head.style,u=new Map,c=R(e.children);try{for(c.s();!(i=c.n()).done;){var d=i.value;u.set(d.outerHTML,d)}}catch(e){c.e(e)}finally{c.f()}var h,f=R(t.children);try{for(f.s();!(h=f.n()).done;){var p=h.value,m=u.has(p.outerHTML),v=n.head.shouldReAppend(p),g=n.head.shouldPreserve(p);m||g?v?o.push(p):(u.delete(p.outerHTML),a.push(p)):"append"===l?v&&(o.push(p),s.push(p)):!1!==n.head.shouldRemove(p)&&o.push(p)}}catch(e){f.e(e)}finally{f.f()}s.push.apply(s,W(u.values()));for(var y=[],b=function(){var e=E[w],i=document.createRange().createContextualFragment(e.outerHTML).firstChild;if(!1!==n.callbacks.beforeNodeAdded(i)){if(i.href||i.src){var o=null,a=new Promise((function(e){o=e}));i.addEventListener("load",(function(){o()})),y.push(a)}t.appendChild(i),n.callbacks.afterNodeAdded(i),r.push(i)}},w=0,E=s;w<E.length;w++)b();for(var k=0,C=o;k<C.length;k++){var A=C[k];!1!==n.callbacks.beforeNodeRemoved(A)&&(t.removeChild(A),n.callbacks.afterNodeRemoved(A))}return n.head.afterHeadMorphed(t,{added:r,kept:a,removed:o}),y}function u(){}function c(e,n,i){return{target:e,newContent:n,config:i=function(e){var n={};return Object.assign(n,t),Object.assign(n,e),n.callbacks={},Object.assign(n.callbacks,t.callbacks),Object.assign(n.callbacks,e.callbacks),n.head={},Object.assign(n.head,t.head),Object.assign(n.head,e.head),n}(i),morphStyle:i.morphStyle,ignoreActive:i.ignoreActive,ignoreActiveValue:i.ignoreActiveValue,idMap:S(e,n),deadIds:new Set,callbacks:i.callbacks,head:i.head}}function d(e,t,n){return null!=e&&null!=t&&(e.nodeType===t.nodeType&&e.tagName===t.tagName&&(""!==e.id&&e.id===t.id||C(n,e,t)>0))}function h(e,t){return null!=e&&null!=t&&(e.nodeType===t.nodeType&&e.tagName===t.tagName)}function f(e,t,n){for(;e!==t;){var i=e;e=e.nextSibling,b(i,n)}return k(n,t),t.nextSibling}function p(e,t,n,i,r){var o=C(r,n,t);if(o>0)for(var a=i,s=0;null!=a;){if(d(n,a,r))return a;if((s+=C(r,a,e))>o)return null;a=a.nextSibling}return null}function m(e,t,n,i,r){for(var o=i,a=n.nextSibling,s=0;null!=o;){if(C(r,o,e)>0)return null;if(h(n,o))return o;if(h(a,o)&&(s++,a=a.nextSibling,s>=2))return null;o=o.nextSibling}return o}function v(e){var t=new DOMParser,n=e.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");if(n.match(/<\/html>/)||n.match(/<\/head>/)||n.match(/<\/body>/)){var i=t.parseFromString(e,"text/html");if(n.match(/<\/html>/))return i.generatedByIdiomorph=!0,i;var r=i.firstChild;return r?(r.generatedByIdiomorph=!0,r):null}var o=t.parseFromString("<body><template>"+e+"</template></body>","text/html").body.querySelector("template").content;return o.generatedByIdiomorph=!0,o}function g(e){if(null==e)return document.createElement("div");if(e.generatedByIdiomorph)return e;if(e instanceof Node){var t=document.createElement("div");return t.append(e),t}for(var n=document.createElement("div"),i=0,r=W(e);i<r.length;i++){var o=r[i];n.append(o)}return n}function y(e,t,n){return h(e,t)?.5+C(n,e,t):0}function b(e,t){k(t,e),!1!==t.callbacks.beforeNodeRemoved(e)&&(e.remove(),t.callbacks.afterNodeRemoved(e))}function w(e,t){return!e.deadIds.has(t)}function E(t,n,i){return(t.idMap.get(i)||e).has(n)}function k(t,n){var i,r=R(t.idMap.get(n)||e);try{for(r.s();!(i=r.n()).done;){var o=i.value;t.deadIds.add(o)}}catch(e){r.e(e)}finally{r.f()}}function C(t,n,i){var r,o=0,a=R(t.idMap.get(n)||e);try{for(a.s();!(r=a.n()).done;){var s=r.value;w(t,s)&&E(t,s,i)&&++o}}catch(e){a.e(e)}finally{a.f()}return o}function A(e,t){var n,i=e.parentElement,r=R(e.querySelectorAll("[id]"));try{for(r.s();!(n=r.n()).done;)for(var o=n.value,a=o;a!==i&&null!=a;){var s=t.get(a);null==s&&(s=new Set,t.set(a,s)),s.add(o.id),a=a.parentElement}}catch(e){r.e(e)}finally{r.f()}}function S(e,t){var n=new Map;return A(e,n),A(t,n),n}return{morph:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e instanceof Document&&(e=e.documentElement),"string"==typeof t&&(t=v(t));var r=g(t),o=c(e,r,i);return n(e,r,o)},defaults:t}}();function fe(e){e instanceof HTMLInputElement&&"file"===e.type||("value"in e?e.setAttribute("value",e.value):e.hasAttribute("value")&&e.setAttribute("value","")),Array.from(e.children).forEach((function(e){fe(e)}))}var pe=function(){function e(t,n){var i=this;q(this,e),this.elementEventListeners=[{event:"input",callback:function(e){return i.handleInputEvent(e)}}],this.component=t,this.modelElementResolver=n,this.unsyncedInputs=new me}return B(e,[{key:"activate",value:function(){var e=this;this.elementEventListeners.forEach((function(t){var n=t.event,i=t.callback;e.component.element.addEventListener(n,i)}))}},{key:"deactivate",value:function(){var e=this;this.elementEventListeners.forEach((function(t){var n=t.event,i=t.callback;e.component.element.removeEventListener(n,i)}))}},{key:"markModelAsSynced",value:function(e){this.unsyncedInputs.markModelAsSynced(e)}},{key:"handleInputEvent",value:function(e){var t=e.target;t&&this.updateModelFromElement(t)}},{key:"updateModelFromElement",value:function(e){if(ae(e,this.component)){if(!(e instanceof HTMLElement))throw new Error("Could not update model for non HTMLElement");var t=this.modelElementResolver.getModelName(e);this.unsyncedInputs.add(e,t)}}},{key:"getUnsyncedInputs",value:function(){return this.unsyncedInputs.allUnsyncedInputs()}},{key:"getUnsyncedModels",value:function(){return Array.from(this.unsyncedInputs.getUnsyncedModelNames())}},{key:"resetUnsyncedFields",value:function(){this.unsyncedInputs.resetUnsyncedFields()}}]),e}(),me=function(){function e(){q(this,e),this.unsyncedNonModelFields=[],this.unsyncedModelNames=[],this.unsyncedModelFields=new Map}return B(e,[{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return this.unsyncedModelFields.set(t,e),void(this.unsyncedModelNames.includes(t)||this.unsyncedModelNames.push(t));this.unsyncedNonModelFields.push(e)}},{key:"resetUnsyncedFields",value:function(){var e=this;this.unsyncedModelFields.forEach((function(t,n){e.unsyncedModelNames.includes(n)||e.unsyncedModelFields.delete(n)}))}},{key:"allUnsyncedInputs",value:function(){return[].concat(W(this.unsyncedNonModelFields),W(this.unsyncedModelFields.values()))}},{key:"markModelAsSynced",value:function(e){var t=this.unsyncedModelNames.indexOf(e);-1!==t&&this.unsyncedModelNames.splice(t,1)}},{key:"getUnsyncedModelNames",value:function(){return this.unsyncedModelNames}}]),e}(),ve=function(){function e(){q(this,e),this.hooks=new Map}return B(e,[{key:"register",value:function(e,t){var n=this.hooks.get(e)||[];n.push(t),this.hooks.set(e,n)}},{key:"unregister",value:function(e,t){var n=this.hooks.get(e)||[],i=n.indexOf(t);-1!==i&&(n.splice(i,1),this.hooks.set(e,n))}},{key:"triggerHook",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var r=this.hooks.get(e)||[];r.forEach((function(e){return e.apply(void 0,n)}))}}]),e}(),ge=function(){function e(t){q(this,e),this.response=t}var t;return B(e,[{key:"getBody",value:(t=D(N().mark((function e(){return N().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.body){e.next=4;break}return e.next=3,this.response.text();case 3:this.body=e.sent;case 4:return e.abrupt("return",this.body);case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),ye=function(){function e(){q(this,e),this.changedItems=new Map,this.removedItems=new Map}return B(e,[{key:"setItem",value:function(e,t,n){if(this.removedItems.has(e)){var i=this.removedItems.get(e);if(this.removedItems.delete(e),i.original===t)return}if(this.changedItems.has(e)){var r=this.changedItems.get(e);return r.original===t?void this.changedItems.delete(e):void this.changedItems.set(e,{original:r.original,new:t})}this.changedItems.set(e,{original:n,new:t})}},{key:"removeItem",value:function(e,t){var n=t;if(this.changedItems.has(e)&&(n=this.changedItems.get(e).original,this.changedItems.delete(e),null===n))return;this.removedItems.has(e)||this.removedItems.set(e,{original:n})}},{key:"getChangedItems",value:function(){return Array.from(this.changedItems,(function(e){var t=U(e,2);return{name:t[0],value:t[1].new}}))}},{key:"getRemovedItems",value:function(){return Array.from(this.removedItems.keys())}},{key:"isEmpty",value:function(){return 0===this.changedItems.size&&0===this.removedItems.size}}]),e}(),be=function(){function e(){q(this,e),this.addedClasses=new Set,this.removedClasses=new Set,this.styleChanges=new ye,this.attributeChanges=new ye}return B(e,[{key:"addClass",value:function(e){this.removedClasses.delete(e)||this.addedClasses.add(e)}},{key:"removeClass",value:function(e){this.addedClasses.delete(e)||this.removedClasses.add(e)}},{key:"addStyle",value:function(e,t,n){this.styleChanges.setItem(e,t,n)}},{key:"removeStyle",value:function(e,t){this.styleChanges.removeItem(e,t)}},{key:"addAttribute",value:function(e,t,n){this.attributeChanges.setItem(e,t,n)}},{key:"removeAttribute",value:function(e,t){this.attributeChanges.removeItem(e,t)}},{key:"getAddedClasses",value:function(){return W(this.addedClasses)}},{key:"getRemovedClasses",value:function(){return W(this.removedClasses)}},{key:"getChangedStyles",value:function(){return this.styleChanges.getChangedItems()}},{key:"getRemovedStyles",value:function(){return this.styleChanges.getRemovedItems()}},{key:"getChangedAttributes",value:function(){return this.attributeChanges.getChangedItems()}},{key:"getRemovedAttributes",value:function(){return this.attributeChanges.getRemovedItems()}},{key:"applyToElement",value:function(e){var t,n;(t=e.classList).add.apply(t,W(this.addedClasses)),(n=e.classList).remove.apply(n,W(this.removedClasses)),this.styleChanges.getChangedItems().forEach((function(t){e.style.setProperty(t.name,t.value)})),this.styleChanges.getRemovedItems().forEach((function(t){e.style.removeProperty(t)})),this.attributeChanges.getChangedItems().forEach((function(t){e.setAttribute(t.name,t.value)})),this.attributeChanges.getRemovedItems().forEach((function(t){e.removeAttribute(t)}))}},{key:"isEmpty",value:function(){return 0===this.addedClasses.size&&0===this.removedClasses.size&&this.styleChanges.isEmpty()&&this.attributeChanges.isEmpty()}}]),e}(),we=function(){function e(t,n){q(this,e),this.changedElements=new WeakMap,this.changedElementsCount=0,this.addedElements=[],this.removedElements=[],this.isStarted=!1,this.element=t,this.shouldTrackChangeCallback=n,this.mutationObserver=new MutationObserver(this.onMutations.bind(this))}return B(e,[{key:"start",value:function(){this.isStarted||(this.mutationObserver.observe(this.element,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0}),this.isStarted=!0)}},{key:"stop",value:function(){this.isStarted&&(this.mutationObserver.disconnect(),this.isStarted=!1)}},{key:"getChangedElement",value:function(e){return this.changedElements.has(e)?this.changedElements.get(e):null}},{key:"getAddedElements",value:function(){return this.addedElements}},{key:"wasElementAdded",value:function(e){return this.addedElements.includes(e)}},{key:"handlePendingChanges",value:function(){this.onMutations(this.mutationObserver.takeRecords())}},{key:"onMutations",value:function(e){var t,n=new WeakMap,i=R(e);try{for(i.s();!(t=i.n()).done;){var r=t.value,o=r.target;if(this.shouldTrackChangeCallback(o)&&!this.isElementAddedByTranslation(o)){var a,s=!1,l=R(this.addedElements);try{for(l.s();!(a=l.n()).done;){if(a.value.contains(o)){s=!0;break}}}catch(e){l.e(e)}finally{l.f()}if(!s)switch(r.type){case"childList":this.handleChildListMutation(r);break;case"attributes":n.has(o)||n.set(o,[]),n.get(o).includes(r.attributeName)||(this.handleAttributeMutation(r),n.set(o,[].concat(W(n.get(o)),[r.attributeName])))}}}}catch(e){i.e(e)}finally{i.f()}}},{key:"handleChildListMutation",value:function(e){var t=this;e.addedNodes.forEach((function(e){e instanceof Element&&(t.removedElements.includes(e)?t.removedElements.splice(t.removedElements.indexOf(e),1):t.isElementAddedByTranslation(e)||t.addedElements.push(e))})),e.removedNodes.forEach((function(e){e instanceof Element&&(t.addedElements.includes(e)?t.addedElements.splice(t.addedElements.indexOf(e),1):t.removedElements.push(e))}))}},{key:"handleAttributeMutation",value:function(e){var t=e.target;this.changedElements.has(t)||(this.changedElements.set(t,new be),this.changedElementsCount++);var n=this.changedElements.get(t);switch(e.attributeName){case"class":this.handleClassAttributeMutation(e,n);break;case"style":this.handleStyleAttributeMutation(e,n);break;default:this.handleGenericAttributeMutation(e,n)}n.isEmpty()&&(this.changedElements.delete(t),this.changedElementsCount--)}},{key:"handleClassAttributeMutation",value:function(e,t){var n=e.target,i=e.oldValue,r=i?i.split(" "):[];r.forEach((function(e,t){var n=e.trim();""!==n?r[t]=n:r.splice(t,1)}));var o=[].slice.call(n.classList),a=o.filter((function(e){return!r.includes(e)})),s=r.filter((function(e){return!o.includes(e)}));a.forEach((function(e){t.addClass(e)})),s.forEach((function(e){t.removeClass(e)}))}},{key:"handleStyleAttributeMutation",value:function(e,t){var n=e.target,i=e.oldValue||"",r=this.extractStyles(i),o=n.getAttribute("style")||"",a=this.extractStyles(o),s=Object.keys(a).filter((function(e){return void 0===r[e]||r[e]!==a[e]})),l=Object.keys(r).filter((function(e){return!a[e]}));s.forEach((function(e){t.addStyle(e,a[e],void 0===r[e]?null:r[e])})),l.forEach((function(e){t.removeStyle(e,r[e])}))}},{key:"handleGenericAttributeMutation",value:function(e,t){var n=e.attributeName,i=e.target,r=e.oldValue,o=i.getAttribute(n);if(r===n&&(r=""),o===n&&(o=""),i.hasAttribute(n))o!==r&&t.addAttribute(n,i.getAttribute(n),e.oldValue);else{if(null===r)return;t.removeAttribute(n,e.oldValue)}}},{key:"extractStyles",value:function(e){var t={};return e.split(";").forEach((function(e){var n=e.split(":");if(1!==n.length){var i=n[0].trim();t[i]=n.slice(1).join(":").trim()}})),t}},{key:"isElementAddedByTranslation",value:function(e){return"FONT"===e.tagName&&"vertical-align: inherit;"===e.getAttribute("style")}}]),e}(),Ee=function(){function e(t,n,i,r,o,a,s){var l=this;q(this,e),this.fingerprint="",this.defaultDebounce=150,this.backendRequest=null,this.pendingActions=[],this.pendingFiles={},this.isRequestPending=!1,this.requestDebounceTimeout=null,this.element=t,this.name=n,this.backend=a,this.elementDriver=s,this.id=o,this.listeners=new Map,r.forEach((function(e){var t;l.listeners.has(e.event)||l.listeners.set(e.event,[]),null===(t=l.listeners.get(e.event))||void 0===t||t.push(e.action)})),this.valueStore=new de(i),this.unsyncedInputsTracker=new pe(this,s),this.hooks=new ve,this.resetPromise(),this.externalMutationTracker=new we(this.element,(function(e){return ae(e,l)})),this.externalMutationTracker.start()}return B(e,[{key:"addPlugin",value:function(e){e.attachToComponent(this)}},{key:"connect",value:function(){var e;e=this,Z.set(e.element,e),ee.set(e,e.name),this.hooks.triggerHook("connect",this),this.unsyncedInputsTracker.activate(),this.externalMutationTracker.start()}},{key:"disconnect",value:function(){var e;e=this,Z.delete(e.element),ee.delete(e),this.hooks.triggerHook("disconnect",this),this.clearRequestDebounceTimeout(),this.unsyncedInputsTracker.deactivate(),this.externalMutationTracker.stop()}},{key:"on",value:function(e,t){this.hooks.register(e,t)}},{key:"off",value:function(e,t){this.hooks.unregister(e,t)}},{key:"set",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=this.nextRequestPromise,o=J(e);if(!this.valueStore.has(o))throw new Error('Invalid model name "'.concat(e,'".'));var a=this.valueStore.set(o,t);return this.hooks.triggerHook("model:set",e,t,this),this.unsyncedInputsTracker.markModelAsSynced(o),n&&a&&this.debouncedStartRequest(i),r}},{key:"getData",value:function(e){var t=J(e);if(!this.valueStore.has(t))throw new Error('Invalid model "'.concat(e,'".'));return this.valueStore.get(t)}},{key:"action",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.nextRequestPromise;return this.pendingActions.push({name:e,args:t}),this.debouncedStartRequest(n),i}},{key:"files",value:function(e,t){this.pendingFiles[e]=t}},{key:"render",value:function(){var e=this.nextRequestPromise;return this.tryStartingRequest(),e}},{key:"getUnsyncedModels",value:function(){return this.unsyncedInputsTracker.getUnsyncedModels()}},{key:"emit",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return this.performEmit(e,t,!1,n)}},{key:"emitUp",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return this.performEmit(e,t,!0,n)}},{key:"emitSelf",value:function(e,t){return this.doEmit(e,t)}},{key:"performEmit",value:function(e,t,n,i){(function(e,t,n){var i=[];return ee.forEach((function(r,o){(!t||e!==o&&o.element.contains(e.element))&&(n&&r!==n||i.push(o))})),i})(this,n,i).forEach((function(n){n.doEmit(e,t)}))}},{key:"doEmit",value:function(e,t){var n=this;this.listeners.has(e)&&(this.listeners.get(e)||[]).forEach((function(e){n.action(e,t,1)}))}},{key:"isTurboEnabled",value:function(){return"undefined"!=typeof Turbo&&!this.element.closest('[data-turbo="false"]')}},{key:"tryStartingRequest",value:function(){this.backendRequest?this.isRequestPending=!0:this.performRequest()}},{key:"performRequest",value:function(){var e=this,t=this.nextRequestPromiseResolve;this.resetPromise(),this.unsyncedInputsTracker.resetUnsyncedFields();for(var n={},i=0,r=Object.entries(this.pendingFiles);i<r.length;i++){var o=U(r[i],2),a=o[0],s=o[1];s.files&&(n[a]=s.files)}var l={props:this.valueStore.getOriginalProps(),actions:this.pendingActions,updated:this.valueStore.getDirtyProps(),children:{},updatedPropsFromParent:this.valueStore.getUpdatedPropsFromParent(),files:n};this.hooks.triggerHook("request:started",l),this.backendRequest=this.backend.makeRequest(l.props,l.actions,l.updated,l.children,l.updatedPropsFromParent,l.files),this.hooks.triggerHook("loading.state:started",this.element,this.backendRequest),this.pendingActions=[],this.valueStore.flushDirtyPropsToPending(),this.isRequestPending=!1,this.backendRequest.promise.then(function(){var n=D(N().mark((function n(i){var r,o,a,s,l,u;return N().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=new ge(i),n.next=3,r.getBody();case 3:for(o=n.sent,a=0,s=Object.values(e.pendingFiles);a<s.length;a++)s[a].value="";if("application/vnd.live-component+html"===(l=r.response.headers).get("Content-Type")||l.get("X-Live-Redirect")){n.next=14;break}return u={displayError:!0},e.valueStore.pushPendingPropsBackToDirty(),e.hooks.triggerHook("response:error",r,u),u.displayError&&e.renderError(o),e.backendRequest=null,t(r),n.abrupt("return",i);case 14:return e.processRerender(o,r),e.backendRequest=null,t(r),e.isRequestPending&&(e.isRequestPending=!1,e.performRequest()),n.abrupt("return",i);case 19:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}())}},{key:"processRerender",value:function(e,t){var n=this,i={shouldRender:!0};if(this.hooks.triggerHook("render:started",e,t,i),i.shouldRender)if(t.response.headers.get("Location"))this.isTurboEnabled()?Turbo.visit(t.response.headers.get("Location")):window.location.href=t.response.headers.get("Location")||"";else{this.hooks.triggerHook("loading.state:finished",this.element);var r,o,a,s,l,u,c,d,h,f={};Object.keys(this.valueStore.getDirtyProps()).forEach((function(e){f[e]=n.valueStore.get(e)}));try{if(r=function(e){var t=document.createElement("template");if(e=e.trim(),t.innerHTML=e,t.content.childElementCount>1)throw new Error("Component HTML contains ".concat(t.content.childElementCount," elements, but only 1 root element is allowed."));var n=t.content.firstElementChild;if(!n)throw new Error("Child not found");if(!(n instanceof HTMLElement))throw new Error("Created element is not an HTMLElement: ".concat(e.trim()));return n}(e),!r.matches("[data-controller~=live]"))throw new Error("A live component template must contain a single root controller element.")}catch(e){throw console.error("There was a problem with the '".concat(this.name,"' component HTML returned:"),{id:this.id}),e}this.externalMutationTracker.handlePendingChanges(),this.externalMutationTracker.stop(),o=this.element,a=r,s=this.unsyncedInputsTracker.getUnsyncedInputs(),l=function(e){return ne(e,n.valueStore)},u=this.externalMutationTracker,c=[],d=new Map,h=function(e,t){var n=d.get(e);if(!(n instanceof HTMLElement))throw new Error("Original element with id ".concat(e," not found"));if(c.push(e),!t)return null;var i=se(n);return n.replaceWith(i),i},a.querySelectorAll("[data-live-preserve]").forEach((function(e){var t=e.id;if(!t)throw new Error("The data-live-preserve attribute requires an id attribute to be set on the element");var n=o.querySelector("#".concat(t));if(!(n instanceof HTMLElement))throw new Error('The element with id "'.concat(t,'" was not found in the original HTML'));e.removeAttribute("data-live-preserve"),d.set(t,n),function(e,t){for(var n=0;n<e.attributes.length;n++){var i=e.attributes[n];t.setAttribute(i.name,i.value)}}(e,n)})),he.morph(o,a,{callbacks:{beforeNodeMorphed:function(e,t){if(!(e instanceof Element&&t instanceof Element))return!0;if(e===o)return!0;if(e.id&&d.has(e.id)){if(e.id===t.id)return!1;var n=h(e.id,!0);if(!n)throw new Error("missing clone");return he.morph(n,t),!1}if(e instanceof HTMLElement&&t instanceof HTMLElement){if(void 0!==e.__x){if(!window.Alpine)throw new Error("Unable to access Alpine.js though the global window.Alpine variable. Please make sure Alpine.js is loaded before Symfony UX LiveComponent.");if("function"!=typeof window.Alpine.morph)throw new Error("Unable to access Alpine.js morph function. Please make sure the Alpine.js Morph plugin is installed and loaded, see https://alpinejs.dev/plugins/morph for more information.");window.Alpine.morph(e.__x,t)}if(u.wasElementAdded(e))return e.insertAdjacentElement("afterend",t),!1;s.includes(e)&&ie(t,l(e)),e===document.activeElement&&e!==document.body&&null!==oe(e,!1)&&ie(t,l(e));var i=u.getChangedElement(e);if(i&&i.applyToElement(t),"OPTION"!==e.nodeName.toUpperCase()&&e.isEqualNode(t)){var r=se(e);fe(r);var a=se(t);if(fe(a),r.isEqualNode(a))return!1}}return e.hasAttribute("data-skip-morph")||e.id&&e.id!==t.id?(e.innerHTML=t.innerHTML,!0):!(e.parentElement&&e.parentElement.hasAttribute("data-skip-morph")||e.hasAttribute("data-live-ignore"))},beforeNodeRemoved:function(e){return!(e instanceof HTMLElement&&(e.id&&d.has(e.id)?(h(e.id,!1),0):u.wasElementAdded(e)||e.hasAttribute("data-live-ignore")))}}}),c.forEach((function(e){var t=o.querySelector("#".concat(e)),n=d.get(e);if(!(t instanceof HTMLElement&&n instanceof HTMLElement))throw new Error("Missing elements.");t.replaceWith(n)})),this.externalMutationTracker.start();var p=this.elementDriver.getComponentProps();this.valueStore.reinitializeAllProps(p);var m=this.elementDriver.getEventsToEmit(),v=this.elementDriver.getBrowserEventsToDispatch();Object.keys(f).forEach((function(e){n.valueStore.set(e,f[e])})),m.forEach((function(e){var t=e.event,i=e.data,r=e.target,o=e.componentName;"up"!==r?"self"!==r?n.emit(t,i,o):n.emitSelf(t,i):n.emitUp(t,i,o)})),v.forEach((function(e){var t=e.event,i=e.payload;n.element.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:!0}))})),this.hooks.triggerHook("render:finished",this)}}},{key:"calculateDebounce",value:function(e){return!0===e?this.defaultDebounce:!1===e?0:e}},{key:"clearRequestDebounceTimeout",value:function(){this.requestDebounceTimeout&&(clearTimeout(this.requestDebounceTimeout),this.requestDebounceTimeout=null)}},{key:"debouncedStartRequest",value:function(e){var t=this;this.clearRequestDebounceTimeout(),this.requestDebounceTimeout=window.setTimeout((function(){t.render()}),this.calculateDebounce(e))}},{key:"renderError",value:function(e){var t=document.getElementById("live-component-error");t?t.innerHTML="":((t=document.createElement("div")).id="live-component-error",t.style.padding="50px",t.style.backgroundColor="rgba(0, 0, 0, .5)",t.style.zIndex="100000",t.style.position="fixed",t.style.top="0px",t.style.bottom="0px",t.style.left="0px",t.style.right="0px",t.style.display="flex",t.style.flexDirection="column");var n=document.createElement("iframe");n.style.borderRadius="5px",n.style.flexGrow="1",t.appendChild(n),document.body.prepend(t),document.body.style.overflow="hidden",n.contentWindow&&(n.contentWindow.document.open(),n.contentWindow.document.write(e),n.contentWindow.document.close());var i=function(e){e&&(e.outerHTML=""),document.body.style.overflow="visible"};t.addEventListener("click",(function(){return i(t)})),t.setAttribute("tabindex","0"),t.addEventListener("keydown",(function(e){"Escape"===e.key&&i(t)})),t.focus()}},{key:"resetPromise",value:function(){var e=this;this.nextRequestPromise=new Promise((function(t){e.nextRequestPromiseResolve=t}))}},{key:"_updateFromParentProps",value:function(e){this.valueStore.storeNewPropsFromParent(e)&&this.render()}}]),e}();var ke=function(){function e(t,n,i){var r=this;q(this,e),this.isResolved=!1,this.promise=t,this.promise.then((function(e){return r.isResolved=!0,e})),this.actions=n,this.updatedModels=i}return B(e,[{key:"containsOneOfActions",value:function(e){return this.actions.filter((function(t){return e.includes(t)})).length>0}},{key:"areAnyModelsUpdated",value:function(e){return this.updatedModels.filter((function(t){return e.includes(t)})).length>0}}]),e}(),Ce=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"post",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;q(this,e),this.url=t,this.method=n,this.csrfToken=i}return B(e,[{key:"buildRequest",value:function(e,t,n,i,r,o){var a=this.url.split("?"),s=U(a,1)[0],l=U(a,2)[1],u=new URLSearchParams(l||""),c={headers:{Accept:"application/vnd.live-component+html","X-Requested-With":"XMLHttpRequest"}},d=Object.entries(o).reduce((function(e,t){return e+t.length}),0),h=Object.keys(i).length>0;if(0===t.length&&0===d&&"get"===this.method&&this.willDataFitInUrl(JSON.stringify(e),JSON.stringify(n),u,JSON.stringify(i),JSON.stringify(r)))u.set("props",JSON.stringify(e)),u.set("updated",JSON.stringify(n)),Object.keys(r).length>0&&u.set("propsFromParent",JSON.stringify(r)),h&&u.set("children",JSON.stringify(i)),c.method="GET";else{c.method="POST";var f={props:e,updated:n};Object.keys(r).length>0&&(f.propsFromParent=r),h&&(f.children=i),this.csrfToken&&(t.length||d)&&(c.headers["X-CSRF-TOKEN"]=this.csrfToken),t.length>0&&(1===t.length?(f.args=t[0].args,s+="/".concat(encodeURIComponent(t[0].name))):(s+="/_batch",f.actions=t));var p=new FormData;p.append("data",JSON.stringify(f));for(var m=0,v=Object.entries(o);m<v.length;m++)for(var g=U(v[m],2),y=g[0],b=g[1],w=b.length,E=0;E<w;++E)p.append(y,b[E]);c.body=p}var k=u.toString();return{url:"".concat(s).concat(k.length>0?"?".concat(k):""),fetchOptions:c}}},{key:"willDataFitInUrl",value:function(e,t,n,i,r){return(new URLSearchParams(e+t+i+r).toString()+n.toString()).length<1500}}]),e}(),Ae=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"post",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;q(this,e),this.requestBuilder=new Ce(t,n,i)}return B(e,[{key:"makeRequest",value:function(e,t,n,i,r,o){var a=this.requestBuilder.buildRequest(e,t,n,i,r,o),s=a.url,l=a.fetchOptions;return new ke(fetch(s,l),t.map((function(e){return e.name})),Object.keys(n))}}]),e}(),Se=function(){function e(t){q(this,e),this.controller=t}return B(e,[{key:"getModelName",value:function(e){var t=oe(e,!1);return t?t.action:null}},{key:"getComponentProps",value:function(){return this.controller.propsValue}},{key:"getEventsToEmit",value:function(){return this.controller.eventsToEmitValue}},{key:"getBrowserEventsToDispatch",value:function(){return this.controller.eventsToDispatchValue}}]),e}(),Te=function(){function e(){q(this,e)}return B(e,[{key:"attachToComponent",value:function(e){var t=this;e.on("loading.state:started",(function(n,i){t.startLoading(e,n,i)})),e.on("loading.state:finished",(function(n){t.finishLoading(e,n)})),this.finishLoading(e,e.element)}},{key:"startLoading",value:function(e,t,n){this.handleLoadingToggle(e,!0,t,n)}},{key:"finishLoading",value:function(e,t){this.handleLoadingToggle(e,!1,t,null)}},{key:"handleLoadingToggle",value:function(e,t,n,i){var r=this;t?this.addAttributes(n,["busy"]):this.removeAttributes(n,["busy"]),this.getLoadingDirectives(e,n).forEach((function(e){var n=e.element,o=e.directives;t?r.addAttributes(n,["data-live-is-loading"]):r.removeAttributes(n,["data-live-is-loading"]),o.forEach((function(e){r.handleLoadingDirective(n,t,e,i)}))}))}},{key:"handleLoadingDirective",value:function(e,t,n,i){var r=this,o=Oe(n.action,t),a=[],s=[],l=0,u=new Map;if(u.set("delay",(function(e){t&&(l=e.value?parseInt(e.value):200)})),u.set("action",(function(e){if(!e.value)throw new Error('The "action" in data-loading must have an action name - e.g. action(foo). It\'s missing for "'.concat(n.getString(),'"'));a.push(e.value)})),u.set("model",(function(e){if(!e.value)throw new Error('The "model" in data-loading must have an action name - e.g. model(foo). It\'s missing for "'.concat(n.getString(),'"'));s.push(e.value)})),n.modifiers.forEach((function(e){var t;if(!u.has(e.name))throw new Error('Unknown modifier "'.concat(e.name,'" used in data-loading="').concat(n.getString(),'". Available modifiers are: ').concat(Array.from(u.keys()).join(", "),"."));(null!==(t=u.get(e.name))&&void 0!==t?t:function(){})(e)})),(!(t&&a.length>0&&i)||i.containsOneOfActions(a))&&(!(t&&s.length>0&&i)||i.areAnyModelsUpdated(s))){var c;switch(o){case"show":c=function(){return r.showElement(e)};break;case"hide":c=function(){return r.hideElement(e)};break;case"addClass":c=function(){return r.addClass(e,n.args)};break;case"removeClass":c=function(){return r.removeClass(e,n.args)};break;case"addAttribute":c=function(){return r.addAttributes(e,n.args)};break;case"removeAttribute":c=function(){return r.removeAttributes(e,n.args)};break;default:throw new Error('Unknown data-loading action "'.concat(o,'"'))}l?window.setTimeout((function(){i&&!i.isResolved&&c()}),l):c()}}},{key:"getLoadingDirectives",value:function(e,t){var n=[],i=W(Array.from(t.querySelectorAll("[data-loading]")));return i=i.filter((function(t){return ae(t,e)})),t.hasAttribute("data-loading")&&(i=[t].concat(W(i))),i.forEach((function(e){if(!(e instanceof HTMLElement||e instanceof SVGElement))throw new Error("Invalid Element Type");var t=X(e.dataset.loading||"show");n.push({element:e,directives:t})})),n}},{key:"showElement",value:function(e){e.style.display="revert"}},{key:"hideElement",value:function(e){e.style.display="none"}},{key:"addClass",value:function(e,t){var n;(n=e.classList).add.apply(n,W(Y(t)))}},{key:"removeClass",value:function(e,t){var n;(n=e.classList).remove.apply(n,W(Y(t))),0===e.classList.length&&e.removeAttribute("class")}},{key:"addAttributes",value:function(e,t){t.forEach((function(t){e.setAttribute(t,"")}))}},{key:"removeAttributes",value:function(e,t){t.forEach((function(t){e.removeAttribute(t)}))}}]),e}(),Oe=function(e,t){switch(e){case"show":return t?"show":"hide";case"hide":return t?"hide":"show";case"addClass":return t?"addClass":"removeClass";case"removeClass":return t?"removeClass":"addClass";case"addAttribute":return t?"addAttribute":"removeAttribute";case"removeAttribute":return t?"removeAttribute":"addAttribute"}throw new Error('Unknown data-loading action "'.concat(e,'"'))},xe=function(){function e(){q(this,e)}return B(e,[{key:"attachToComponent",value:function(e){var t=this;e.on("model:set",(function(n){t.handleModelSet(n,e.valueStore)}))}},{key:"handleModelSet",value:function(e,t){if(t.has("validatedFields")){var n=W(t.get("validatedFields"));n.includes(e)||n.push(e),t.set("validatedFields",n)}}}]),e}(),Me=function(){function e(){q(this,e),this.isConnected=!1}return B(e,[{key:"attachToComponent",value:function(e){var t=this;e.on("render:started",(function(e,n,i){t.isConnected||(i.shouldRender=!1)})),e.on("connect",(function(){t.isConnected=!0})),e.on("disconnect",(function(){t.isConnected=!1}))}}]),e}(),Fe=function(){function e(t){q(this,e),this.isPollingActive=!0,this.pollingIntervals=[],this.component=t}return B(e,[{key:"addPoll",value:function(e,t){this.polls.push({actionName:e,duration:t}),this.isPollingActive&&this.initiatePoll(e,t)}},{key:"startAllPolling",value:function(){var e=this;this.isPollingActive||(this.isPollingActive=!0,this.polls.forEach((function(t){var n=t.actionName,i=t.duration;e.initiatePoll(n,i)})))}},{key:"stopAllPolling",value:function(){this.isPollingActive=!1,this.pollingIntervals.forEach((function(e){clearInterval(e)}))}},{key:"clearPolling",value:function(){this.stopAllPolling(),this.polls=[],this.startAllPolling()}},{key:"initiatePoll",value:function(e,t){var n,i=this;n="$render"===e?function(){i.component.render()}:function(){i.component.action(e,{},0)};var r=setInterval((function(){n()}),t);this.pollingIntervals.push(r)}}]),e}(),_e=function(){function e(){q(this,e)}return B(e,[{key:"attachToComponent",value:function(e){var t=this;this.element=e.element,this.pollingDirector=new Fe(e),this.initializePolling(),e.on("connect",(function(){t.pollingDirector.startAllPolling()})),e.on("disconnect",(function(){t.pollingDirector.stopAllPolling()})),e.on("render:finished",(function(){t.initializePolling()}))}},{key:"addPoll",value:function(e,t){this.pollingDirector.addPoll(e,t)}},{key:"clearPolling",value:function(){this.pollingDirector.clearPolling()}},{key:"initializePolling",value:function(){var e=this;if(this.clearPolling(),void 0!==this.element.dataset.poll){var t=this.element.dataset.poll;X(t||"$render").forEach((function(n){var i=2e3;n.modifiers.forEach((function(e){if("delay"===e.name)e.value&&(i=parseInt(e.value));else console.warn('Unknown modifier "'.concat(e.name,'" in data-poll "').concat(t,'".'))})),e.addPoll(n.action,i)}))}}}]),e}(),Le=function(){function e(){q(this,e)}return B(e,[{key:"attachToComponent",value:function(e){var t=this;this.synchronizeValueOfModelFields(e),e.on("render:finished",(function(){t.synchronizeValueOfModelFields(e)}))}},{key:"synchronizeValueOfModelFields",value:function(e){e.element.querySelectorAll("[data-model]").forEach((function(t){if(!(t instanceof HTMLElement))throw new Error("Invalid element using data-model.");if(!(t instanceof HTMLFormElement)&&ae(t,e)){var n=oe(t);if(n){var i=n.action;e.getUnsyncedModels().includes(i)||(e.valueStore.has(i)&&ie(t,e.valueStore.get(i)),t instanceof HTMLSelectElement&&!t.multiple&&e.valueStore.set(i,ne(t,e.valueStore)))}}}))}}]),e}();function Pe(e){var t=!0,n=null,i=!1;e.modifiers.forEach((function(r){switch(r.name){case"on":if(!r.value)throw new Error('The "on" modifier in '.concat(e.getString()," requires a value - e.g. on(change)."));if(!["input","change"].includes(r.value))throw new Error('The "on" modifier in '.concat(e.getString(),' only accepts the arguments "input" or "change".'));n=r.value;break;case"norender":t=!1;break;case"debounce":i=!r.value||parseInt(r.value);break;default:throw new Error('Unknown modifier "'.concat(r.name,'" in data-model="').concat(e.getString(),'".'))}}));var r=U(e.action.split(":"),2);return{modelName:r[0],innerModelName:r[1]||null,shouldRender:t,debounce:i,targetEventName:n}}function je(e){if(null===e||""===e||void 0===e||Array.isArray(e)&&0===e.length)return!0;if("object"!==j(e))return!1;for(var t=0,n=Object.keys(e);t<n.length;t++){if(!je(e[n[t]]))return!1}return!0}function Ne(e){if(""===(e=e.replace("?","")))return{};var t=function e(t,n,i){var r,o=t.split("."),a=H(r=o)||G(r)||V(r)||z(),s=a[0],l=a[1],u=a.slice(2);if(!l)return i[t]=n;void 0===i[s]&&(i[s]=Number.isNaN(Number.parseInt(l))?{}:[]),e([l].concat(W(u)).join("."),n,i[s])},n=e.split("&").map((function(e){return e.split("=")})),i={};return n.forEach((function(e){var n=U(e,2),r=n[0],o=n[1];if(o=decodeURIComponent(o.replace(/\+/g,"%20")),r.includes("[")){if(""===o)return;var a=r.replace(/\[/g,".").replace(/]/g,"");t(a,o,i)}else i[r]=o})),i}var Ie=function(e){T(n,e);var t=O(n);function n(){return q(this,n),t.apply(this,arguments)}return B(n,[{key:"has",value:function(e){var t=this.getData();return Object.keys(t).includes(e)}},{key:"set",value:function(e,t){var n=this.getData();n[e]=t,this.setData(n)}},{key:"get",value:function(e){return this.getData()[e]}},{key:"remove",value:function(e){var t=this.getData();delete t[e],this.setData(t)}},{key:"getData",value:function(){return this.search?Ne(this.search):{}}},{key:"setData",value:function(e){this.search=function(e){var t=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Object.entries(t).forEach((function(t){var r=U(t,2),o=r[0],a=r[1],s=""===i?o:"".concat(i,"[").concat(o,"]");""===i&&je(a)?n[s]="":null!==a&&("object"===j(a)?n=Object.assign(Object.assign({},n),e(a,n,s)):n[s]=encodeURIComponent(a).replace(/%20/g,"+").replace(/%2C/g,","))})),n}(e);return Object.entries(t).map((function(e){var t=U(e,2),n=t[0],i=t[1];return"".concat(n,"=").concat(i)})).join("&")}(e)}}]),n}(M(URL)),De=function(){function e(){q(this,e)}return B(e,null,[{key:"replace",value:function(e){history.replaceState(history.state,"",e)}}]),e}(),Re=function(){function e(t){q(this,e),this.mapping=t}return B(e,[{key:"attachToComponent",value:function(e){var t=this;e.on("render:finished",(function(e){var n=new Ie(window.location.href),i=n.toString();Object.entries(t.mapping).forEach((function(t){var i=U(t,2),r=i[0],o=i[1],a=e.valueStore.get(r);n.set(o.name,a)})),i!==n.toString()&&De.replace(n)}))}}]),e}(),Ue=function(){function e(t){q(this,e),this.parentModelBindings=[],this.component=t;var n=re(this.component.element);this.parentModelBindings=n.map(Pe)}return B(e,[{key:"attachToComponent",value:function(e){var t=this;e.on("request:started",(function(e){e.children=t.getChildrenFingerprints()})),e.on("model:set",(function(e,n){t.notifyParentModelChange(e,n)}))}},{key:"getChildrenFingerprints",value:function(){var e={};return this.getChildren().forEach((function(t){if(!t.id)throw new Error("missing id");e[t.id]={fingerprint:t.fingerprint,tag:t.element.tagName.toLowerCase()}})),e}},{key:"notifyParentModelChange",value:function(e,t){var n=function(e){for(var t=e.element.parentElement;t;){var n=Z.get(t);if(n)return n;t=t.parentElement}return null}(this.component);n&&this.parentModelBindings.forEach((function(i){(i.innerModelName||"value")===e&&n.set(i.modelName,t,i.shouldRender,i.debounce)}))}},{key:"getChildren",value:function(){return te(this.component)}}]),e}(),ze=function(){function e(){q(this,e),this.intersectionObserver=null}return B(e,[{key:"attachToComponent",value:function(e){var t,n=this;"lazy"===(null===(t=e.element.attributes.getNamedItem("loading"))||void 0===t?void 0:t.value)&&(e.on("connect",(function(){n.getObserver().observe(e.element)})),e.on("disconnect",(function(){var t;null===(t=n.intersectionObserver)||void 0===t||t.unobserve(e.element)})))}},{key:"getObserver",value:function(){return this.intersectionObserver||(this.intersectionObserver=new IntersectionObserver((function(e,t){e.forEach((function(e){e.isIntersecting&&(e.target.dispatchEvent(new CustomEvent("live:appear")),t.unobserve(e.target))}))}))),this.intersectionObserver}}]),e}(),He=function(e){T(n,e);var t=O(n);function n(){var e;return q(this,n),(e=t.apply(this,arguments)).pendingActionTriggerModelElement=null,e.elementEventListeners=[{event:"input",callback:function(t){return e.handleInputEvent(t)}},{event:"change",callback:function(t){return e.handleChangeEvent(t)}}],e.pendingFiles={},e}return B(n,[{key:"initialize",value:function(){this.mutationObserver=new MutationObserver(this.onMutations.bind(this)),this.createComponent()}},{key:"connect",value:function(){this.connectComponent(),this.mutationObserver.observe(this.element,{attributes:!0})}},{key:"disconnect",value:function(){this.disconnectComponent(),this.mutationObserver.disconnect()}},{key:"update",value:function(e){if("input"===e.type||"change"===e.type)throw new Error('Since LiveComponents 2.3, you no longer need data-action="live#update" on form elements. Found on element: '.concat(K(e.currentTarget)));this.updateModelFromElementEvent(e.currentTarget,null)}},{key:"action",value:function(e){var t=this,n=e.params;if(!n.action)throw new Error("No action name provided on element: ".concat(K(e.currentTarget),'. Did you forget to add the "data-live-action-param" attribute?'));var i=n.action,r=Object.assign({},n);delete r.action;var o=X(i),a=!1;o.forEach((function(n){var o={},s=new Map;s.set("stop",(function(){e.stopPropagation()})),s.set("self",(function(){e.target,e.currentTarget})),s.set("debounce",(function(e){a=!e.value||parseInt(e.value)})),s.set("files",(function(e){e.value?t.pendingFiles[e.value]&&(o[e.value]=t.pendingFiles[e.value]):o=t.pendingFiles})),n.modifiers.forEach((function(e){var t;s.has(e.name)?(null!==(t=s.get(e.name))&&void 0!==t?t:function(){})(e):console.warn("Unknown modifier ".concat(e.name,' in action "').concat(i,'". Available modifiers are: ').concat(Array.from(s.keys()).join(", "),"."))}));for(var l=0,u=Object.entries(o);l<u.length;l++){var c=U(u[l],2),d=c[0],h=c[1];h.files&&t.component.files(d,h),delete t.pendingFiles[d]}t.component.action(n.action,r,a),oe(e.currentTarget,!1)&&(t.pendingActionTriggerModelElement=e.currentTarget)}))}},{key:"$render",value:function(){return this.component.render()}},{key:"emit",value:function(e){var t=this;this.getEmitDirectives(e).forEach((function(e){var n=e.name,i=e.data,r=e.nameMatch;t.component.emit(n,i,r)}))}},{key:"emitUp",value:function(e){var t=this;this.getEmitDirectives(e).forEach((function(e){var n=e.name,i=e.data,r=e.nameMatch;t.component.emitUp(n,i,r)}))}},{key:"emitSelf",value:function(e){var t=this;this.getEmitDirectives(e).forEach((function(e){var n=e.name,i=e.data;t.component.emitSelf(n,i)}))}},{key:"$updateModel",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return this.component.set(e,t,n,i)}},{key:"propsUpdatedFromParentValueChanged",value:function(){this.component._updateFromParentProps(this.propsUpdatedFromParentValue)}},{key:"fingerprintValueChanged",value:function(){this.component.fingerprint=this.fingerprintValue}},{key:"getEmitDirectives",value:function(e){var t=e.params;if(!t.event)throw new Error("No event name provided on element: ".concat(K(e.currentTarget),'. Did you forget to add the "data-live-event-param" attribute?'));var n=t.event,i=Object.assign({},t);delete i.event;var r=X(n),o=[];return r.forEach((function(e){var t=null;e.modifiers.forEach((function(e){if("name"!==e.name)throw new Error("Unknown modifier ".concat(e.name,' in event "').concat(n,'".'));t=e.value})),o.push({name:e.action,data:i,nameMatch:t})})),o}},{key:"createComponent",value:function(){var e,t=this,i=this.element.id||null;this.component=new Ee(this.element,this.nameValue,this.propsValue,this.listenersValue,i,n.backendFactory(this),new Se(this)),this.proxiedComponent=(e=this.component,new Proxy(e,{get:function(e,t){if(t in e||"string"!=typeof t){if("function"==typeof e[t]){var n=e[t];return function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return n.apply(e,i)}}return Reflect.get(e,t)}return e.valueStore.has(t)?e.getData(t):function(n){return e.action.apply(e,[t,n])}},set:function(e,t,n){return t in e?(e[t]=n,!0):(e.set(t,n),!0)}})),this.element.__component=this.proxiedComponent,this.hasDebounceValue&&(this.component.defaultDebounce=this.debounceValue),[new Te,new ze,new xe,new Me,new _e,new Le,new Re(this.queryMappingValue),new Ue(this.component)].forEach((function(e){t.component.addPlugin(e)}))}},{key:"connectComponent",value:function(){var e=this;this.component.connect(),this.mutationObserver.observe(this.element,{attributes:!0}),this.elementEventListeners.forEach((function(t){var n=t.event,i=t.callback;e.component.element.addEventListener(n,i)})),this.dispatchEvent("connect")}},{key:"disconnectComponent",value:function(){var e=this;this.component.disconnect(),this.elementEventListeners.forEach((function(t){var n=t.event,i=t.callback;e.component.element.removeEventListener(n,i)})),this.dispatchEvent("disconnect")}},{key:"handleInputEvent",value:function(e){var t=e.target;t&&this.updateModelFromElementEvent(t,"input")}},{key:"handleChangeEvent",value:function(e){var t=e.target;t&&this.updateModelFromElementEvent(t,"change")}},{key:"updateModelFromElementEvent",value:function(e,t){var n;if(ae(e,this.component)){if(!(e instanceof HTMLElement))throw new Error("Could not update model for non HTMLElement");if(e instanceof HTMLInputElement&&"file"===e.type){var i=e.name;(null===(n=e.files)||void 0===n?void 0:n.length)?this.pendingFiles[i]=e:this.pendingFiles[i]&&delete this.pendingFiles[i]}var r=oe(e,!1);if(r){var o=Pe(r);if(o.targetEventName||(o.targetEventName="input"),this.pendingActionTriggerModelElement===e&&(o.shouldRender=!1),"change"===t&&"input"===o.targetEventName&&(o.targetEventName="change"),!t||o.targetEventName===t){!1===o.debounce&&("input"===o.targetEventName?o.debounce=!0:o.debounce=0);var a=ne(e,this.component.valueStore);this.component.set(o.modelName,a,o.shouldRender,o.debounce)}}}}},{key:"dispatchEvent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t.controller=this,t.component=this.proxiedComponent,this.dispatch(e,{detail:t,prefix:"live",cancelable:i,bubbles:n})}},{key:"onMutations",value:function(e){var t=this;e.forEach((function(e){"attributes"===e.type&&"id"===e.attributeName&&t.element.id!==t.component.id&&(t.disconnectComponent(),t.createComponent(),t.connectComponent())}))}}]),n}(d.Qr);He.values={name:String,url:String,props:{type:Object,default:{}},propsUpdatedFromParent:{type:Object,default:{}},csrf:String,listeners:{type:Array,default:[]},eventsToEmit:{type:Array,default:[]},eventsToDispatch:{type:Array,default:[]},debounce:{type:Number,default:150},fingerprint:{type:String,default:""},requestMethod:{type:String,default:"post"},queryMapping:{type:Object,default:{}}},He.backendFactory=function(e){return new Ae(e.urlValue,e.requestMethodValue,e.csrfValue)};const qe={"symfony--ux-autocomplete--autocomplete":S,live:He}},92579:(e,t,n)=>{"use strict";var i=n(73395),r=n(42192);n(38616),n(71258),n(48469),n(85478),n(72213),n(68656),n(56071),(0,r.x)(n(94180));n.g.$=n.g.jQuery=window.jQuery=n(19755),n(516),n.g.bootstrap=n(43734),n.g.bs5Utils=new i.Z,n(62583),n(59036),n.g.Raphael=n(67079),n(72031),n(11055),n(31561),n(21464),n(29121),n.g.Dropzone=n(59036),n.g.cargobay={},n.g.cargobay.general=n(83678),n.g.cargobay.toggle=n(75782),n.g.psc={},n.g.psc.ajaxModal=n(82378),n.g.psc.mediaChooser=n(56071),n.g.psc.app=n(69759),n.g.psc.order=n(77713),n.g.psc.product=n(60331),n.g.psc.app.init()},69759:(e,t,n)=>{var i;n(69826),n(41539),void 0===(i=function(){return{init:function(){psc.ajaxModal.init(),psc.mediaChooser.init(),psc.order.init(),psc.product.init(),"function"==typeof bootstrapApp&&bootstrapApp()}}}.call(t,n,t,e))||(e.exports=i),$((function(){$('[data-bs-toggle="tooltip"]').click((function(e){var t=this;return bs5Utils.Toast.show({type:"primary",icon:'<i class="far fa-check-circle fa-lg me-2"></i>',title:$(this).html(),content:$(this).data("bs-html"),buttons:[{text:"Copy to clipboard",class:"btn btn-sm btn-warning",handler:function(){navigator.clipboard.writeText($(t).data("bs-html"))}}],delay:0,dismissible:!0}),console.log(this),!0})),$('a[data-bs-toggle="tab"]').on("shown.bs.tab",(function(e){$(e.target).parent().parent().parent().attr("id")&&"doc"==$(e.target).parent().parent().parent().attr("id")?localStorage.setItem("lastTabDoc",$(this).attr("href")):localStorage.setItem("lastTab",$(this).attr("href"))}));var e=localStorage.getItem("lastTab");e&&$('[href="'+e+'"]').tab("show");var t=localStorage.getItem("lastTabDoc");t&&$('[href="'+t+'"]').tab("show"),$(".nav li ul").parent().find("a").click((function(){$(this).parent().find("ul").toggle()})),$('input[data-bs-toggle="toggle"], input.ajaxToogle').change((function(){$.getJSON($(this).data("url"))})),$("select.multiple").multiselect({submitAllLeft:!1,submitAllRight:!0,search:{left:'<input type="text" name="q" class="form-control" placeholder="Search..." />',right:'<input type="text" name="q" class="form-control" placeholder="Search..." />'},fireSearch:function(e){return e.length>1}}),$(".summernote").summernote({height:400,toolbar:[["style",["style"]],["font",["bold","italic","underline","clear"]],["fontname",["fontname"]],["color",["color"]],["para",["ul","ol","paragraph"]],["height",["height"]],["table",["table"]],["insert",["link","hr"]],["view",["fullscreen","codeview"]],["help",["help"]],["media",["media"]]]})}))},59036:function(e,t,n){e=n.nmd(e),n(47042),n(40561),n(74916),n(73210),n(68309),n(32564),n(15306),n(66992),n(41539),n(78783),n(33948),n(60285),n(41637),n(88674),n(89554),n(54747),n(82772),n(4723),function(){var t,n,i,r,o,a,s,l,u=[].slice,c={}.hasOwnProperty;s=function(){},n=function(){function e(){}return e.prototype.addEventListener=e.prototype.on,e.prototype.on=function(e,t){return this._callbacks=this._callbacks||{},this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t),this},e.prototype.emit=function(){var e,t,n,i,r;if(n=arguments[0],e=2<=arguments.length?u.call(arguments,1):[],this._callbacks=this._callbacks||{},t=this._callbacks[n])for(i=0,r=t.length;i<r;i++)t[i].apply(this,e);return this},e.prototype.removeListener=e.prototype.off,e.prototype.removeAllListeners=e.prototype.off,e.prototype.removeEventListener=e.prototype.off,e.prototype.off=function(e,t){var n,i,r,o;if(!this._callbacks||0===arguments.length)return this._callbacks={},this;if(!(n=this._callbacks[e]))return this;if(1===arguments.length)return delete this._callbacks[e],this;for(i=r=0,o=n.length;r<o;i=++r)if(n[i]===t){n.splice(i,1);break}return this},e}(),t=function(e){var t,i;function r(e,n){var i,o,a;if(this.element=e,this.version=r.version,this.defaultOptions.previewTemplate=this.defaultOptions.previewTemplate.replace(/\n*/g,""),this.clickableElements=[],this.listeners=[],this.files=[],"string"==typeof this.element&&(this.element=document.querySelector(this.element)),!this.element||null==this.element.nodeType)throw new Error("Invalid dropzone element.");if(this.element.dropzone)throw new Error("Dropzone already attached.");if(r.instances.push(this),this.element.dropzone=this,i=null!=(a=r.optionsForElement(this.element))?a:{},this.options=t({},this.defaultOptions,i,null!=n?n:{}),this.options.forceFallback||!r.isBrowserSupported())return this.options.fallback.call(this);if(null==this.options.url&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw new Error("No URL provided.");if(this.options.acceptedFiles&&this.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");this.options.acceptedMimeTypes&&(this.options.acceptedFiles=this.options.acceptedMimeTypes,delete this.options.acceptedMimeTypes),this.options.method=this.options.method.toUpperCase(),(o=this.getExistingFallback())&&o.parentNode&&o.parentNode.removeChild(o),!1!==this.options.previewsContainer&&(this.options.previewsContainer?this.previewsContainer=r.getElement(this.options.previewsContainer,"previewsContainer"):this.previewsContainer=this.element),this.options.clickable&&(!0===this.options.clickable?this.clickableElements=[this.element]:this.clickableElements=r.getElements(this.options.clickable,"clickable")),this.init()}return function(e,t){for(var n in t)c.call(t,n)&&(e[n]=t[n]);function i(){this.constructor=e}i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype}(r,e),r.prototype.Emitter=n,r.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],r.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,parallelUploads:2,uploadMultiple:!1,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,filesizeBase:1e3,maxFiles:null,params:{},clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,hiddenInputContainer:"body",capture:null,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",accept:function(e,t){return t()},init:function(){return s},forceFallback:!1,fallback:function(){var e,t,n,i,o,a;for(this.element.className=this.element.className+" dz-browser-not-supported",i=0,o=(a=this.element.getElementsByTagName("div")).length;i<o;i++)e=a[i],/(^| )dz-message($| )/.test(e.className)&&(t=e,e.className="dz-message");return t||(t=r.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(t)),(n=t.getElementsByTagName("span")[0])&&(null!=n.textContent?n.textContent=this.options.dictFallbackMessage:null!=n.innerText&&(n.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(e){var t,n,i;return t={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},n=e.width/e.height,t.optWidth=this.options.thumbnailWidth,t.optHeight=this.options.thumbnailHeight,null==t.optWidth&&null==t.optHeight?(t.optWidth=t.srcWidth,t.optHeight=t.srcHeight):null==t.optWidth?t.optWidth=n*t.optHeight:null==t.optHeight&&(t.optHeight=1/n*t.optWidth),i=t.optWidth/t.optHeight,e.height<t.optHeight||e.width<t.optWidth?(t.trgHeight=t.srcHeight,t.trgWidth=t.srcWidth):n>i?(t.srcHeight=e.height,t.srcWidth=t.srcHeight*i):(t.srcWidth=e.width,t.srcHeight=t.srcWidth/i),t.srcX=(e.width-t.srcWidth)/2,t.srcY=(e.height-t.srcHeight)/2,t},drop:function(e){return this.element.classList.remove("dz-drag-hover")},dragstart:s,dragend:function(e){return this.element.classList.remove("dz-drag-hover")},dragenter:function(e){return this.element.classList.add("dz-drag-hover")},dragover:function(e){return this.element.classList.add("dz-drag-hover")},dragleave:function(e){return this.element.classList.remove("dz-drag-hover")},paste:s,reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(e){var t,n,i,o,a,s,l,u,c,d,h,f,p;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){for(e.previewElement=r.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement),i=0,s=(c=e.previewElement.querySelectorAll("[data-dz-name]")).length;i<s;i++)c[i].textContent=e.name;for(o=0,l=(d=e.previewElement.querySelectorAll("[data-dz-size]")).length;o<l;o++)d[o].innerHTML=this.filesize(e.size);for(this.options.addRemoveLinks&&(e._removeLink=r.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>'+this.options.dictRemoveFile+"</a>"),e.previewElement.appendChild(e._removeLink)),p=this,t=function(t){return t.preventDefault(),t.stopPropagation(),e.status===r.UPLOADING?r.confirm(p.options.dictCancelUploadConfirmation,(function(){return p.removeFile(e)})):p.options.dictRemoveFileConfirmation?r.confirm(p.options.dictRemoveFileConfirmation,(function(){return p.removeFile(e)})):p.removeFile(e)},f=[],a=0,u=(h=e.previewElement.querySelectorAll("[data-dz-remove]")).length;a<u;a++)n=h[a],f.push(n.addEventListener("click",t));return f}},removedfile:function(e){var t;return e.previewElement&&null!=(t=e.previewElement)&&t.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(e,t){var n,i,r,o;if(e.previewElement){for(e.previewElement.classList.remove("dz-file-preview"),i=0,r=(o=e.previewElement.querySelectorAll("[data-dz-thumbnail]")).length;i<r;i++)(n=o[i]).alt=e.name,n.src=t;return setTimeout((function(){return e.previewElement.classList.add("dz-image-preview")}),1)}},error:function(e,t){var n,i,r,o,a;if(e.previewElement){for(e.previewElement.classList.add("dz-error"),"String"!=typeof t&&t.error&&(t=t.error),a=[],i=0,r=(o=e.previewElement.querySelectorAll("[data-dz-errormessage]")).length;i<r;i++)n=o[i],a.push(n.textContent=t);return a}},errormultiple:s,processing:function(e){if(e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink))return e._removeLink.textContent=this.options.dictCancelUpload},processingmultiple:s,uploadprogress:function(e,t,n){var i,r,o,a,s;if(e.previewElement){for(s=[],r=0,o=(a=e.previewElement.querySelectorAll("[data-dz-uploadprogress]")).length;r<o;r++)"PROGRESS"===(i=a[r]).nodeName?s.push(i.value=t):s.push(i.style.width=t+"%");return s}},totaluploadprogress:s,sending:s,sendingmultiple:s,success:function(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple:s,canceled:function(e){return this.emit("error",e,"Upload canceled.")},canceledmultiple:s,complete:function(e){if(e._removeLink&&(e._removeLink.textContent=this.options.dictRemoveFile),e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple:s,maxfilesexceeded:s,maxfilesreached:s,queuecomplete:s,addedfiles:s,previewTemplate:'<div class="dz-preview dz-file-preview">\n <div class="dz-image"><img data-dz-thumbnail /></div>\n <div class="dz-details">\n <div class="dz-size"><span data-dz-size></span></div>\n <div class="dz-filename"><span data-dz-name></span></div>\n </div>\n <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>\n <div class="dz-error-message"><span data-dz-errormessage></span></div>\n <div class="dz-success-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <title>Check</title>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF" sketch:type="MSShapeGroup"></path>\n </g>\n </svg>\n </div>\n <div class="dz-error-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <title>Error</title>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <g id="Check-+-Oval-2" sketch:type="MSLayerGroup" stroke="#747474" stroke-opacity="0.198794158" fill="#FFFFFF" fill-opacity="0.816519475">\n <path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" sketch:type="MSShapeGroup"></path>\n </g>\n </g>\n </svg>\n </div>\n</div>'},t=function(){var e,t,n,i,r,o,a;for(i=arguments[0],o=0,a=(n=2<=arguments.length?u.call(arguments,1):[]).length;o<a;o++)for(e in t=n[o])r=t[e],i[e]=r;return i},r.prototype.getAcceptedFiles=function(){var e,t,n,i,r;for(r=[],t=0,n=(i=this.files).length;t<n;t++)(e=i[t]).accepted&&r.push(e);return r},r.prototype.getRejectedFiles=function(){var e,t,n,i,r;for(r=[],t=0,n=(i=this.files).length;t<n;t++)(e=i[t]).accepted||r.push(e);return r},r.prototype.getFilesWithStatus=function(e){var t,n,i,r,o;for(o=[],n=0,i=(r=this.files).length;n<i;n++)(t=r[n]).status===e&&o.push(t);return o},r.prototype.getQueuedFiles=function(){return this.getFilesWithStatus(r.QUEUED)},r.prototype.getUploadingFiles=function(){return this.getFilesWithStatus(r.UPLOADING)},r.prototype.getAddedFiles=function(){return this.getFilesWithStatus(r.ADDED)},r.prototype.getActiveFiles=function(){var e,t,n,i,o;for(o=[],t=0,n=(i=this.files).length;t<n;t++)(e=i[t]).status!==r.UPLOADING&&e.status!==r.QUEUED||o.push(e);return o},r.prototype.init=function(){var e,t,n,i,o,a,s,l;for("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(r.createElement('<div class="dz-default dz-message"><span>'+this.options.dictDefaultMessage+"</span></div>")),this.clickableElements.length&&(l=this,n=function(){return l.hiddenFileInput&&l.hiddenFileInput.parentNode.removeChild(l.hiddenFileInput),l.hiddenFileInput=document.createElement("input"),l.hiddenFileInput.setAttribute("type","file"),(null==l.options.maxFiles||l.options.maxFiles>1)&&l.hiddenFileInput.setAttribute("multiple","multiple"),l.hiddenFileInput.className="dz-hidden-input",null!=l.options.acceptedFiles&&l.hiddenFileInput.setAttribute("accept",l.options.acceptedFiles),null!=l.options.capture&&l.hiddenFileInput.setAttribute("capture",l.options.capture),l.hiddenFileInput.style.visibility="hidden",l.hiddenFileInput.style.position="absolute",l.hiddenFileInput.style.top="0",l.hiddenFileInput.id="upload",l.hiddenFileInput.style.left="0",l.hiddenFileInput.style.height="0",l.hiddenFileInput.style.width="0",document.querySelector(l.options.hiddenInputContainer).appendChild(l.hiddenFileInput),l.hiddenFileInput.addEventListener("change",(function(){var e,t,i,r;if((t=l.hiddenFileInput.files).length)for(i=0,r=t.length;i<r;i++)e=t[i],l.addFile(e);return l.emit("addedfiles",t),n()}))},n()),this.URL=null!=(a=window.URL)?a:window.webkitURL,i=0,o=(s=this.events).length;i<o;i++)e=s[i],this.on(e,this.options[e]);return this.on("uploadprogress",function(e){return function(){return e.updateTotalUploadProgress()}}(this)),this.on("removedfile",function(e){return function(){return e.updateTotalUploadProgress()}}(this)),this.on("canceled",function(e){return function(t){return e.emit("complete",t)}}(this)),this.on("complete",function(e){return function(t){if(0===e.getAddedFiles().length&&0===e.getUploadingFiles().length&&0===e.getQueuedFiles().length)return setTimeout((function(){return e.emit("queuecomplete")}),0)}}(this)),t=function(e){return e.stopPropagation(),e.preventDefault?e.preventDefault():e.returnValue=!1},this.listeners=[{element:this.element,events:{dragstart:function(e){return function(t){return e.emit("dragstart",t)}}(this),dragenter:function(e){return function(n){return t(n),e.emit("dragenter",n)}}(this),dragover:function(e){return function(n){var i;try{i=n.dataTransfer.effectAllowed}catch(e){}return n.dataTransfer.dropEffect="move"===i||"linkMove"===i?"move":"copy",t(n),e.emit("dragover",n)}}(this),dragleave:function(e){return function(t){return e.emit("dragleave",t)}}(this),drop:function(e){return function(n){return t(n),e.drop(n)}}(this),dragend:function(e){return function(t){return e.emit("dragend",t)}}(this)}}],this.clickableElements.forEach(function(e){return function(t){return e.listeners.push({element:t,events:{click:function(n){return(t!==e.element||n.target===e.element||r.elementInside(n.target,e.element.querySelector(".dz-message")))&&e.hiddenFileInput.click(),!0}}})}}(this)),this.enable(),this.options.init.call(this)},r.prototype.destroy=function(){var e;return this.disable(),this.removeAllFiles(!0),(null!=(e=this.hiddenFileInput)?e.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,r.instances.splice(r.instances.indexOf(this),1)},r.prototype.updateTotalUploadProgress=function(){var e,t,n,i,r,o,a;if(n=0,t=0,this.getActiveFiles().length){for(r=0,o=(a=this.getActiveFiles()).length;r<o;r++)n+=(e=a[r]).upload.bytesSent,t+=e.upload.total;i=100*n/t}else i=100;return this.emit("totaluploadprogress",i,t,n)},r.prototype._getParamName=function(e){return"function"==typeof this.options.paramName?this.options.paramName(e):this.options.paramName+(this.options.uploadMultiple?"["+e+"]":"")},r.prototype.getFallbackForm=function(){var e,t,n,i;return(e=this.getExistingFallback())?e:(n='<div class="dz-fallback">',this.options.dictFallbackText&&(n+="<p>"+this.options.dictFallbackText+"</p>"),n+='<input type="file" name="'+this._getParamName(0)+'" '+(this.options.uploadMultiple?'multiple="multiple"':void 0)+' /><input type="submit" value="Upload!"></div>',t=r.createElement(n),"FORM"!==this.element.tagName?(i=r.createElement('<form action="'+this.options.url+'" enctype="multipart/form-data" method="'+this.options.method+'"></form>')).appendChild(t):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=i?i:t)},r.prototype.getExistingFallback=function(){var e,t,n,i,r,o;for(t=function(e){var t,n,i;for(n=0,i=e.length;n<i;n++)if(t=e[n],/(^| )fallback($| )/.test(t.className))return t},i=0,r=(o=["div","form"]).length;i<r;i++)if(n=o[i],e=t(this.element.getElementsByTagName(n)))return e},r.prototype.setupEventListeners=function(){var e,t,n,i,r,o,a;for(a=[],i=0,r=(o=this.listeners).length;i<r;i++)e=o[i],a.push(function(){var i,r;for(t in r=[],i=e.events)n=i[t],r.push(e.element.addEventListener(t,n,!1));return r}());return a},r.prototype.removeEventListeners=function(){var e,t,n,i,r,o,a;for(a=[],i=0,r=(o=this.listeners).length;i<r;i++)e=o[i],a.push(function(){var i,r;for(t in r=[],i=e.events)n=i[t],r.push(e.element.removeEventListener(t,n,!1));return r}());return a},r.prototype.disable=function(){var e,t,n,i,r;for(this.clickableElements.forEach((function(e){return e.classList.remove("dz-clickable")})),this.removeEventListeners(),r=[],t=0,n=(i=this.files).length;t<n;t++)e=i[t],r.push(this.cancelUpload(e));return r},r.prototype.enable=function(){return this.clickableElements.forEach((function(e){return e.classList.add("dz-clickable")})),this.setupEventListeners()},r.prototype.filesize=function(e){var t,n,i,r,o,a,s;if(n=0,i="b",e>0){for(t=a=0,s=(o=["TB","GB","MB","KB","b"]).length;a<s;t=++a)if(r=o[t],e>=Math.pow(this.options.filesizeBase,4-t)/10){n=e/Math.pow(this.options.filesizeBase,4-t),i=r;break}n=Math.round(10*n)/10}return"<strong>"+n+"</strong> "+i},r.prototype._updateMaxFilesReachedClass=function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")},r.prototype.drop=function(e){var t,n;e.dataTransfer&&(this.emit("drop",e),t=e.dataTransfer.files,this.emit("addedfiles",t),t.length&&((n=e.dataTransfer.items)&&n.length&&null!=n[0].webkitGetAsEntry?this._addFilesFromItems(n):this.handleFiles(t)))},r.prototype.paste=function(e){var t,n;if(null!=(null!=e&&null!=(n=e.clipboardData)?n.items:void 0))return this.emit("paste",e),(t=e.clipboardData.items).length?this._addFilesFromItems(t):void 0},r.prototype.handleFiles=function(e){var t,n,i,r;for(r=[],n=0,i=e.length;n<i;n++)t=e[n],r.push(this.addFile(t));return r},r.prototype._addFilesFromItems=function(e){var t,n,i,r,o;for(o=[],i=0,r=e.length;i<r;i++)null!=(n=e[i]).webkitGetAsEntry&&(t=n.webkitGetAsEntry())?t.isFile?o.push(this.addFile(n.getAsFile())):t.isDirectory?o.push(this._addFilesFromDirectory(t,t.name)):o.push(void 0):null!=n.getAsFile&&(null==n.kind||"file"===n.kind)?o.push(this.addFile(n.getAsFile())):o.push(void 0);return o},r.prototype._addFilesFromDirectory=function(e,t){var n,i,r;return n=e.createReader(),r=this,i=function(e){var n,i,o;for(i=0,o=e.length;i<o;i++)(n=e[i]).isFile?n.file((function(e){if(!r.options.ignoreHiddenFiles||"."!==e.name.substring(0,1))return e.fullPath=t+"/"+e.name,r.addFile(e)})):n.isDirectory&&r._addFilesFromDirectory(n,t+"/"+n.name)},n.readEntries(i,(function(e){return"undefined"!=typeof console&&null!==console&&"function"==typeof console.log?console.log(e):void 0}))},r.prototype.accept=function(e,t){return e.size>1024*this.options.maxFilesize*1024?t(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):r.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(t(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,t):t(this.options.dictInvalidFileType)},r.prototype.addFile=function(e){return e.upload={progress:0,total:e.size,bytesSent:0},this.files.push(e),e.status=r.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,(t=this,function(n){return n?(e.accepted=!1,t._errorProcessing([e],n)):(e.accepted=!0,t.options.autoQueue&&t.enqueueFile(e)),t._updateMaxFilesReachedClass()}));var t},r.prototype.enqueueFiles=function(e){var t,n,i;for(n=0,i=e.length;n<i;n++)t=e[n],this.enqueueFile(t);return null},r.prototype.enqueueFile=function(e){if(e.status!==r.ADDED||!0!==e.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(e.status=r.QUEUED,this.options.autoProcessQueue)return setTimeout((t=this,function(){return t.processQueue()}),0);var t},r.prototype._thumbnailQueue=[],r.prototype._processingThumbnail=!1,r.prototype._enqueueThumbnail=function(e){if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1024*this.options.maxThumbnailFilesize*1024)return this._thumbnailQueue.push(e),setTimeout((t=this,function(){return t._processThumbnailQueue()}),0);var t},r.prototype._processThumbnailQueue=function(){var e;if(!this._processingThumbnail&&0!==this._thumbnailQueue.length)return this._processingThumbnail=!0,this.createThumbnail(this._thumbnailQueue.shift(),(e=this,function(){return e._processingThumbnail=!1,e._processThumbnailQueue()}))},r.prototype.removeFile=function(e){if(e.status===r.UPLOADING&&this.cancelUpload(e),this.files=l(this.files,e),this.emit("removedfile",e),0===this.files.length)return this.emit("reset")},r.prototype.removeAllFiles=function(e){var t,n,i,o;for(null==e&&(e=!1),n=0,i=(o=this.files.slice()).length;n<i;n++)((t=o[n]).status!==r.UPLOADING||e)&&this.removeFile(t);return null},r.prototype.createThumbnail=function(e,t){var n,i;return(n=new FileReader).onload=(i=this,function(){return"image/svg+xml"===e.type?(i.emit("thumbnail",e,n.result),void(null!=t&&t())):i.createThumbnailFromUrl(e,n.result,t)}),n.readAsDataURL(e)},r.prototype.createThumbnailFromUrl=function(e,t,n,i){var r,o;return r=document.createElement("img"),i&&(r.crossOrigin=i),r.onload=(o=this,function(){var t,i,s,l,u,c,d,h;if(e.width=r.width,e.height=r.height,null==(s=o.options.resize.call(o,e)).trgWidth&&(s.trgWidth=s.optWidth),null==s.trgHeight&&(s.trgHeight=s.optHeight),i=(t=document.createElement("canvas")).getContext("2d"),t.width=s.trgWidth,t.height=s.trgHeight,a(i,r,null!=(u=s.srcX)?u:0,null!=(c=s.srcY)?c:0,s.srcWidth,s.srcHeight,null!=(d=s.trgX)?d:0,null!=(h=s.trgY)?h:0,s.trgWidth,s.trgHeight),l=t.toDataURL("image/png"),o.emit("thumbnail",e,l),null!=n)return n()}),null!=n&&(r.onerror=n),r.src=t},r.prototype.processQueue=function(){var e,t,n,i;if(t=this.options.parallelUploads,e=n=this.getUploadingFiles().length,!(n>=t)&&(i=this.getQueuedFiles()).length>0){if(this.options.uploadMultiple)return this.processFiles(i.slice(0,t-n));for(;e<t;){if(!i.length)return;this.processFile(i.shift()),e++}}},r.prototype.processFile=function(e){return this.processFiles([e])},r.prototype.processFiles=function(e){var t,n,i;for(n=0,i=e.length;n<i;n++)(t=e[n]).processing=!0,t.status=r.UPLOADING,this.emit("processing",t);return this.options.uploadMultiple&&this.emit("processingmultiple",e),this.uploadFiles(e)},r.prototype._getFilesWithXhr=function(e){var t;return function(){var n,i,r,o;for(o=[],n=0,i=(r=this.files).length;n<i;n++)(t=r[n]).xhr===e&&o.push(t);return o}.call(this)},r.prototype.cancelUpload=function(e){var t,n,i,o,a,s,l;if(e.status===r.UPLOADING){for(i=0,a=(n=this._getFilesWithXhr(e.xhr)).length;i<a;i++)(t=n[i]).status=r.CANCELED;for(e.xhr.abort(),o=0,s=n.length;o<s;o++)t=n[o],this.emit("canceled",t);this.options.uploadMultiple&&this.emit("canceledmultiple",n)}else(l=e.status)!==r.ADDED&&l!==r.QUEUED||(e.status=r.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));if(this.options.autoProcessQueue)return this.processQueue()},i=function(){var e,t;return t=arguments[0],e=2<=arguments.length?u.call(arguments,1):[],"function"==typeof t?t.apply(this,e):t},r.prototype.uploadFile=function(e){return this.uploadFiles([e])},r.prototype.uploadFiles=function(e){var n,o,a,s,l,u,c,d,h,f,p,m,v,g,y,b,w,E,k,C,A,S,T,O,x,M,F,_,L,P,j,N,I,D;for(E=new XMLHttpRequest,k=0,T=e.length;k<T;k++)(n=e[k]).xhr=E;for(s in m=i(this.options.method,e),b=i(this.options.url,e),E.open(m,b,!0),E.withCredentials=!!this.options.withCredentials,g=null,D=this,a=function(){var t,i,r;for(r=[],t=0,i=e.length;t<i;t++)n=e[t],r.push(D._errorProcessing(e,g||D.options.dictResponseError.replace("{{statusCode}}",E.status),E));return r},y=function(t){return function(i){var r,o,a,s,l,u,c,d,h;if(null!=i)for(o=100*i.loaded/i.total,a=0,u=e.length;a<u;a++)(n=e[a]).upload={progress:o,total:i.total,bytesSent:i.loaded};else{for(r=!0,o=100,s=0,c=e.length;s<c;s++)100===(n=e[s]).upload.progress&&n.upload.bytesSent===n.upload.total||(r=!1),n.upload.progress=o,n.upload.bytesSent=n.upload.total;if(r)return}for(h=[],l=0,d=e.length;l<d;l++)n=e[l],h.push(t.emit("uploadprogress",n,o,n.upload.bytesSent));return h}}(this),E.onload=function(t){return function(n){var i;if(e[0].status!==r.CANCELED&&4===E.readyState){if(g=E.responseText,E.getResponseHeader("content-type")&&~E.getResponseHeader("content-type").indexOf("application/json"))try{g=JSON.parse(g)}catch(e){n=e,g="Invalid JSON response from server."}return y(),200<=(i=E.status)&&i<300?t._finished(e,g,n):a()}}}(this),E.onerror=function(){if(e[0].status!==r.CANCELED)return a()},(null!=(_=E.upload)?_:E).onprogress=y,u={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"},this.options.headers&&t(u,this.options.headers),u)(l=u[s])&&E.setRequestHeader(s,l);if(o=new FormData,this.options.params)for(p in L=this.options.params)w=L[p],o.append(p,w);for(C=0,O=e.length;C<O;C++)n=e[C],this.emit("sending",n,E,o);if(this.options.uploadMultiple&&this.emit("sendingmultiple",e,E,o),"FORM"===this.element.tagName)for(A=0,x=(P=this.element.querySelectorAll("input, textarea, select, button")).length;A<x;A++)if(h=(d=P[A]).getAttribute("name"),f=d.getAttribute("type"),"SELECT"===d.tagName&&d.hasAttribute("multiple"))for(S=0,M=(j=d.options).length;S<M;S++)(v=j[S]).selected&&o.append(h,v.value);else(!f||"checkbox"!==(N=f.toLowerCase())&&"radio"!==N||d.checked)&&o.append(h,d.value);for(c=F=0,I=e.length-1;0<=I?F<=I:F>=I;c=0<=I?++F:--F)o.append(this._getParamName(c),e[c],e[c].name);return this.submitRequest(E,o,e)},r.prototype.submitRequest=function(e,t,n){return e.send(t)},r.prototype._finished=function(e,t,n){var i,o,a;for(o=0,a=e.length;o<a;o++)(i=e[o]).status=r.SUCCESS,this.emit("success",i,t,n),this.emit("complete",i);if(this.options.uploadMultiple&&(this.emit("successmultiple",e,t,n),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()},r.prototype._errorProcessing=function(e,t,n){var i,o,a;for(o=0,a=e.length;o<a;o++)(i=e[o]).status=r.ERROR,this.emit("error",i,t,n),this.emit("complete",i);if(this.options.uploadMultiple&&(this.emit("errormultiple",e,t,n),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()},r}(n),t.version="4.2.0",t.options={},t.optionsForElement=function(e){return e.getAttribute("id")?t.options[i(e.getAttribute("id"))]:void 0},t.instances=[],t.forElement=function(e){if("string"==typeof e&&(e=document.querySelector(e)),null==(null!=e?e.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return e.dropzone},t.autoDiscover=!0,t.discover=function(){var e,n,i,r,o,a;for(document.querySelectorAll?i=document.querySelectorAll(".dropzone"):(i=[],e=function(e){var t,n,r,o;for(o=[],n=0,r=e.length;n<r;n++)t=e[n],/(^| )dropzone($| )/.test(t.className)?o.push(i.push(t)):o.push(void 0);return o},e(document.getElementsByTagName("div")),e(document.getElementsByTagName("form"))),a=[],r=0,o=i.length;r<o;r++)n=i[r],!1!==t.optionsForElement(n)?a.push(new t(n)):a.push(void 0);return a},t.blacklistedBrowsers=[/opera.*Macintosh.*version\/12/i],t.isBrowserSupported=function(){var e,n,i,r;if(e=!0,window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a"))for(n=0,i=(r=t.blacklistedBrowsers).length;n<i;n++)r[n].test(navigator.userAgent)&&(e=!1);else e=!1;else e=!1;return e},l=function(e,t){var n,i,r,o;for(o=[],i=0,r=e.length;i<r;i++)(n=e[i])!==t&&o.push(n);return o},i=function(e){return e.replace(/[\-_](\w)/g,(function(e){return e.charAt(1).toUpperCase()}))},t.createElement=function(e){var t;return(t=document.createElement("div")).innerHTML=e,t.childNodes[0]},t.elementInside=function(e,t){if(e===t)return!0;for(;e=e.parentNode;)if(e===t)return!0;return!1},t.getElement=function(e,t){var n;if("string"==typeof e?n=document.querySelector(e):null!=e.nodeType&&(n=e),null==n)throw new Error("Invalid `"+t+"` option provided. Please provide a CSS selector or a plain HTML element.");return n},t.getElements=function(e,t){var n,i,r,o,a,s,l;if(e instanceof Array){i=[];try{for(r=0,a=e.length;r<a;r++)n=e[r],i.push(this.getElement(n,t))}catch(e){e,i=null}}else if("string"==typeof e)for(i=[],o=0,s=(l=document.querySelectorAll(e)).length;o<s;o++)n=l[o],i.push(n);else null!=e.nodeType&&(i=[e]);if(null==i||!i.length)throw new Error("Invalid `"+t+"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");return i},t.confirm=function(e,t,n){return window.confirm(e)?t():null!=n?n():void 0},t.isValidFile=function(e,t){var n,i,r,o,a;if(!t)return!0;for(t=t.split(","),n=(i=e.type).replace(/\/.*$/,""),o=0,a=t.length;o<a;o++)if("."===(r=(r=t[o]).trim()).charAt(0)){if(-1!==e.name.toLowerCase().indexOf(r.toLowerCase(),e.name.length-r.length))return!0}else if(/\/\*$/.test(r)){if(n===r.replace(/\/.*$/,""))return!0}else if(i===r)return!0;return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(e){return this.each((function(){return new t(this,e)}))}),null!==e?e.exports=t:window.Dropzone=t,t.ADDED="added",t.QUEUED="queued",t.ACCEPTED=t.QUEUED,t.UPLOADING="uploading",t.PROCESSING=t.UPLOADING,t.CANCELED="canceled",t.ERROR="error",t.SUCCESS="success",o=function(e){var t,n,i,r,o,a,s,l;for(e.naturalWidth,o=e.naturalHeight,(t=document.createElement("canvas")).width=1,t.height=o,(n=t.getContext("2d")).drawImage(e,0,0),i=n.getImageData(0,0,1,o).data,l=0,r=o,a=o;a>l;)0===i[4*(a-1)+3]?r=a:l=a,a=r+l>>1;return 0===(s=a/o)?1:s},a=function(e,t,n,i,r,a,s,l,u,c){var d;return d=o(t),e.drawImage(t,n,i,r,a,s,l,u,c/d)},r=function(e,t){var n,i,r,o,a,s,l,u,c;if(r=!1,c=!0,i=e.document,u=i.documentElement,n=i.addEventListener?"addEventListener":"attachEvent",l=i.addEventListener?"removeEventListener":"detachEvent",s=i.addEventListener?"":"on",o=function(n){if("readystatechange"!==n.type||"complete"===i.readyState)return("load"===n.type?e:i)[l](s+n.type,o,!1),!r&&(r=!0)?t.call(e,n.type||n):void 0},a=function(){try{u.doScroll("left")}catch(e){return e,void setTimeout(a,50)}return o("poll")},"complete"!==i.readyState){if(i.createEventObject&&u.doScroll){try{c=!e.frameElement}catch(e){}c&&a()}return i[n](s+"DOMContentLoaded",o,!1),i[n](s+"readystatechange",o,!1),e[n](s+"load",o,!1)}},t._autoDiscoverFunction=function(){if(t.autoDiscover)return t.discover()},r(window,t._autoDiscoverFunction)}.call(this)},77713:(e,t,n)=>{var i;n(92222),n(68309),n(69600),n(21249),n(69826),n(41539),void 0===(i=function(){var e=function(e,t){var n=e.uuid,i=e.basketField1,r=e.customerInfo,o=e.basketField2,a=e.pos,s=e.price,l=e.product,u=e.status;e.allNet;return'\n <div style="'.concat(psc.order.get_pos_bg_color(u),'" class="row ').concat(psc.order.get_pos_bg_color_class(u),'" id="row-').concat(n,'">\n <div class="col-1 p-1">').concat(a,'</div>\n <div class="col-4 p-1">\n ').concat(function(e){return e.originalProduct?'<a href="/apps/backend/product/edit/index/'.concat(e.originalProduct.uuid,'">').concat(e.originalProduct.title,"</a>"):'<a href="/apps/backend/product/edit/index/'.concat(e.uuid,'">').concat(e.title,"</a>")}(l),"\n <br/>ArtNr intern: ").concat(l.nrIntern,"<br/>\n ").concat(psc.order.get_special_product_options(l.specialProductTypeObject),'</div>\n <div class="col-1 p-1">Auflage: ').concat(s.count,'</div>\n <div class="col-1 p-1">Kunden Info: ').concat(r,'</div>\n <div class="col-1 p-1">').concat(i,'</div>\n <div class="col-1 p-1">').concat(o,'</div>\n <div class="col-1 p-1 text-end">').concat(new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(s.allNet/100)," <strong>(").concat(new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(s.allGross/100),')</strong></div>\n <div class="col-2 p-2 text-end"><div class="btn-group btn-group-sm w-100">\n <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\n ').concat(psc.order.get_pos_status(u).internalName,'\n </button>\n <div class="dropdown-menu">\n ').concat(psc.order.get_pos_status_loop(t,n),'\n </div>\n </div></div>\n <div class="col-1 p-1"></div>\n </div>\n ')},t=function(e,t){e.uuid;var n=e.basketField1,i=e.customerInfo,r=e.basketField2,o=e.pos,a=e.price,s=e.product,l=e.status;e.allNet;return'\n <tr style="'.concat(psc.order.get_pos_bg_color(l),'" class="').concat(psc.order.get_pos_bg_color_class(l),'">\n <td>-</td>\n <td></td>\n <td>').concat(o,'</td>\n <td colspan="4">').concat(function(e){return e.originalProduct?'<a href="/apps/backend/product/edit/index/'.concat(e.originalProduct.uuid,'">').concat(e.originalProduct.title,"</a>"):'<a href="/apps/backend/product/edit/index/'.concat(e.uuid,'">').concat(e.title,"</a>")}(s),"<br/>ArtNr intern: ").concat(s.nrIntern,"<br/>\n ").concat(psc.order.get_special_product_options(s.specialProductTypeObject),"</td>\n <td>Auflage: ").concat(a.count,"</td>\n <td>Kunden Info: ").concat(i,"</td>\n <td>").concat(n,"</td>\n <td>").concat(r,'</td>\n <td></td>\n <td class="text-end">').concat(new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(a.allNet/100)," <strong>(").concat(new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(a.allGross/100),")</strong></td>\n <td>").concat(psc.order.get_pos_status(l).internalName,"</td>\n <td></td>\n </tr>\n ")};return{init:function(){this.load_status(),this.bind_buttons()},get_special_product_options:function(e){return 6!=e.typ?"":"<table>"+e.options.map((function(e){if("hidden"!=e.type)return function(e){return"\n <tr><td>".concat(e.name,"</td><td>").concat(e.value,"</td></tr>\n ")}(e)})).join("")+"</table>"},load_status:function(){""!=jwt_token&&$.ajax({url:"/apps/api/system/status",contentType:"application/json",headers:{Authorization:"Bearer "+jwt_token},method:"GET",success:function(e){psc.order.status_order=e.order,psc.order.status_pos=e.position}})},bind_buttons:function(){$(".toogle_list_detail_view").off(),$(".toogle_list_detail_view").on("click",(function(){var e=$(this).data().uuid;$("#rows-"+e+" > div").length>0?$("#rows-"+e).html(""):psc.order.load_detail(e)})),$(".toogle_list_simple_detail_view").off(),$(".toogle_list_simple_detail_view").on("click",(function(){var e=$(this).data().uuid;$("#rows-"+e+" > tr").length>0?$("#rows-"+e).html(""):psc.order.load_detail(e,!0)}))},load_detail:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];$.ajax({url:"/apps/api/order/getonebyuuid",contentType:"application/json",headers:{Authorization:"Bearer "+jwt_token},method:"POST",data:JSON.stringify({uuid:e}),success:function(n){psc.order.build_details(e,n,t)}})},build_details:function(n,i){var r=this,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o?$("#rows-"+i.uuid).html(i.positions.map((function(e){return t(e)})).join("")):($("#rows-"+i.uuid).html(i.positions.map((function(t){return e(t,n)})).join("")),i.positions.map((function(e){return r.loadPluginDetails(e)}))),this.bind_status_buttons()},loadPluginDetails:function(e){$.ajax({url:"/apps/api/position/getpluginlistdetails/"+e.uuid,contentType:"application/json",headers:{Authorization:"Bearer "+jwt_token},method:"GET",success:function(t){$("#row-"+e.uuid).append(t.html)}})},bind_status_buttons:function(){$(".switch_pos").off(),$(".switch_pos").on("click",(function(){var e=$(this).data().orderUuid,t=$(this).data().posUuid,n=$(this).data().status;$.ajax({url:"/apps/api/position/status/change",contentType:"application/json",headers:{Authorization:"Bearer "+jwt_token},data:JSON.stringify({position:t,status:n}),method:"POST",success:function(t){$("#rows-"+e).html(""),psc.order.load_detail(e)}})}))},get_pos_bg_color:function(e){var t=psc.order.status_pos.find((function(t){return t.code==e}));if(t&&""!=t.color)return"background-color: "+t.color},get_pos_status:function(e){var t=psc.order.status_pos.find((function(t){return t.code==e}));return t||{internalName:"notFound"}},get_pos_bg_color_class:function(e){return 170==e?"bg-lightdark":200==e||210==e?"bg-lightsuccess":"bg-lightdanger"},get_pos_status_loop:function(e,t){return psc.order.status_pos.map((function(n){return function(e,t,n){return'\n <button type="button" class="dropdown-item switch_pos" data-order-uuid="'.concat(t,'" data-pos-uuid="').concat(n,'" data-status="').concat(e.code,'">').concat(e.internalName,"</button>\n ")}(n,e,t)})).join("")}}}.call(t,n,t,e))||(e.exports=i)},60331:(e,t,n)=>{var i;void 0===(i=function(){return{init:function(){set=n(20528),set.init()}}}.call(t,n,t,e))||(e.exports=i)},20528:(e,t,n)=>{var i;void 0===(i=function(){function e(t){$(".product_set_table > tbody").empty(),$.each(t.products,(function(e,t){$(".product_set_table > tbody").append("<tr><td>"+t.title+'</td><td><button type="button" data-uuid='+t.uuid+' class="btn btn-danger btn-sm product_set_delete_button"><span class="fa fa-trash"></span></button></td></tr>')})),$(".product_set_delete_button").click((function(){$("#overlay_loading").fadeIn(),$.ajax({url:"/apps/api/product/"+productUuid+"/set",contentType:"application/json",headers:{Authorization:"Bearer "+jwt_token},method:"DELETE",data:JSON.stringify({product:{uuid:$(this).data("uuid")}}),success:function(t){e(t)}})})),$("#overlay_loading").fadeOut()}return{init:function(){$(".product_set_add_button").length>0&&(this.initAddButton(),this.loadTable())},initAddButton:function(){$(".product_set_add_button").click((function(){$("#overlay_loading").fadeIn(),$.ajax({url:"/apps/api/product/"+productUuid+"/set",contentType:"application/json",headers:{Authorization:"Bearer "+jwt_token},method:"PUT",data:JSON.stringify({product:{uuid:$(this).data("uuid")}}),success:function(t){e(t)}})}))},loadTable:function(){$("#overlay_loading").fadeIn(),$.ajax({url:"/apps/api/product/"+productUuid+"/set",contentType:"application/json",headers:{Authorization:"Bearer "+jwt_token},method:"GET",success:function(t){e(t)}})}}}.call(t,n,t,e))||(e.exports=i)},31561:(e,t,n)=>{var i,r,o;r=[n(19755)],void 0===(o="function"==typeof(i=function(e){e.extend(e.summernote.plugins,{media:function(t){var n=e.summernote.ui;t.memo("button.media",(function(){return n.button({contents:'<i class="fa fa-images"/> Media',tooltip:"Media",click:function(){mediaBundleBrowser(t.$note.attr("id"))}}).render()}))}})})?i.apply(t,r):i)||(e.exports=o)},62583:function(e,t,n){var i,r;function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}n(74916),n(82772),n(89554),n(41539),n(54747),n(47042),n(73210),n(24603),n(39714),n(69600),n(15306),n(78011),n(68304),n(83710),n(54678),n(69070),n(40561),n(32165),n(66992),n(78783),n(33948),n(82526),n(41817),n(79753),n(38880),n(30489),n(32564),n(24812),n(21249),i=function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e){var t=e.getBoundingClientRect(),n={};for(var i in t)n[i]=t[i];if(e.ownerDocument!==document){var o=e.ownerDocument.defaultView.frameElement;if(o){var a=r(o);n.top+=a.top,n.bottom+=a.top,n.left+=a.left,n.right+=a.left}}return n}function a(e){var t=(getComputedStyle(e)||{}).position,n=[];if("fixed"===t)return[e];for(var i=e;(i=i.parentNode)&&i&&1===i.nodeType;){var r=void 0;try{r=getComputedStyle(i)}catch(e){}if(null==r)return n.push(i),n;var o=r,a=o.overflow,s=o.overflowX,l=o.overflowY;/(auto|scroll)/.test(a+l+s)&&("absolute"!==t||["relative","absolute","fixed"].indexOf(r.position)>=0)&&n.push(i)}return n.push(e.ownerDocument.body),e.ownerDocument!==document&&n.push(e.ownerDocument.defaultView),n}function s(){T&&document.body.removeChild(T),T=null}function l(e){var t=void 0;e===document?(t=document,e=document.documentElement):t=e.ownerDocument;var n=t.documentElement,i=r(e),o=M();return i.top-=o.top,i.left-=o.left,void 0===i.width&&(i.width=document.body.scrollWidth-i.left-i.right),void 0===i.height&&(i.height=document.body.scrollHeight-i.top-i.bottom),i.top=i.top-n.clientTop,i.left=i.left-n.clientLeft,i.right=t.body.clientWidth-i.width-i.left,i.bottom=t.body.clientHeight-i.height-i.top,i}function u(e){return e.offsetParent||document.documentElement}function c(){var e=document.createElement("div");e.style.width="100%",e.style.height="200px";var t=document.createElement("div");d(t.style,{position:"absolute",top:0,left:0,pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),t.appendChild(e),document.body.appendChild(t);var n=e.offsetWidth;t.style.overflow="scroll";var i=e.offsetWidth;n===i&&(i=t.clientWidth),document.body.removeChild(t);var r=n-i;return{width:r,height:r}}function d(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=[];return Array.prototype.push.apply(t,arguments),t.slice(1).forEach((function(t){if(t)for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])})),e}function h(e,t){if(void 0!==e.classList)t.split(" ").forEach((function(t){t.trim()&&e.classList.remove(t)}));else{var n=new RegExp("(^| )"+t.split(" ").join("|")+"( |$)","gi"),i=m(e).replace(n," ");v(e,i)}}function f(e,t){if(void 0!==e.classList)t.split(" ").forEach((function(t){t.trim()&&e.classList.add(t)}));else{h(e,t);var n=m(e)+" "+t;v(e,n)}}function p(e,t){if(void 0!==e.classList)return e.classList.contains(t);var n=m(e);return new RegExp("(^| )"+t+"( |$)","gi").test(n)}function m(e){return e.className instanceof e.ownerDocument.defaultView.SVGAnimatedString?e.className.baseVal:e.className}function v(e,t){e.setAttribute("class",t)}function g(e,t,n){n.forEach((function(n){-1===t.indexOf(n)&&p(e,n)&&h(e,n)})),t.forEach((function(t){p(e,t)||f(e,t)}))}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+o(t));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function b(e,t){var n=arguments.length<=2||void 0===arguments[2]?1:arguments[2];return e+n>=t&&t>=e-n}function w(){return"undefined"!=typeof performance&&void 0!==performance.now?performance.now():+new Date}function E(){for(var e={top:0,left:0},t=arguments.length,n=Array(t),i=0;t>i;i++)n[i]=arguments[i];return n.forEach((function(t){var n=t.top,i=t.left;"string"==typeof n&&(n=parseFloat(n,10)),"string"==typeof i&&(i=parseFloat(i,10)),e.top+=n,e.left+=i})),e}function k(e,t){return"string"==typeof e.left&&-1!==e.left.indexOf("%")&&(e.left=parseFloat(e.left,10)/100*t.width),"string"==typeof e.top&&-1!==e.top.indexOf("%")&&(e.top=parseFloat(e.top,10)/100*t.height),e}function C(e,t){return"scrollParent"===t?t=e.scrollParents[0]:"window"===t&&(t=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),t===document&&(t=t.documentElement),void 0!==t.nodeType&&function(){var e=t,n=l(t),i=n,r=getComputedStyle(t);if(t=[i.left,i.top,n.width+i.left,n.height+i.top],e.ownerDocument!==document){var o=e.ownerDocument.defaultView;t[0]+=o.pageXOffset,t[1]+=o.pageYOffset,t[2]+=o.pageXOffset,t[3]+=o.pageYOffset}Q.forEach((function(e,n){"Top"===(e=e[0].toUpperCase()+e.substr(1))||"Left"===e?t[n]+=parseFloat(r["border"+e+"Width"]):t[n]-=parseFloat(r["border"+e+"Width"])}))}(),t}var A=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),S=void 0;void 0===S&&(S={modules:[]});var T=null,O=function(){var e=0;return function(){return++e}}(),x={},M=function(){var e=T;e||((e=document.createElement("div")).setAttribute("data-tether-id",O()),d(e.style,{top:0,left:0,position:"absolute"}),document.body.appendChild(e),T=e);var t=e.getAttribute("data-tether-id");return void 0===x[t]&&(x[t]=r(e),_((function(){delete x[t]}))),x[t]},F=[],_=function(e){F.push(e)},L=function(){for(var e=void 0;e=F.pop();)e()},P=function(){function e(){i(this,e)}return A(e,[{key:"on",value:function(e,t,n){var i=!(arguments.length<=3||void 0===arguments[3])&&arguments[3];void 0===this.bindings&&(this.bindings={}),void 0===this.bindings[e]&&(this.bindings[e]=[]),this.bindings[e].push({handler:t,ctx:n,once:i})}},{key:"once",value:function(e,t,n){this.on(e,t,n,!0)}},{key:"off",value:function(e,t){if(void 0!==this.bindings&&void 0!==this.bindings[e])if(void 0===t)delete this.bindings[e];else for(var n=0;n<this.bindings[e].length;)this.bindings[e][n].handler===t?this.bindings[e].splice(n,1):++n}},{key:"trigger",value:function(e){if(void 0!==this.bindings&&this.bindings[e]){for(var t=0,n=arguments.length,i=Array(n>1?n-1:0),r=1;n>r;r++)i[r-1]=arguments[r];for(;t<this.bindings[e].length;){var o=this.bindings[e][t],a=o.handler,s=o.ctx,l=o.once,u=s;void 0===u&&(u=this),a.apply(u,i),l?this.bindings[e].splice(t,1):++t}}}}]),e}();S.Utils={getActualBoundingClientRect:r,getScrollParents:a,getBounds:l,getOffsetParent:u,extend:d,addClass:f,removeClass:h,hasClass:p,updateClasses:g,defer:_,flush:L,uniqueId:O,Evented:P,getScrollBarSize:c,removeUtilElements:s};var j=function(){function e(e,t){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);i=!0);}catch(e){r=!0,o=e}finally{try{!i&&s.return&&s.return()}finally{if(r)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),N=(A=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),function(e,t,n){for(var i=!0;i;){var r=e,o=t,a=n;i=!1,null===r&&(r=Function.prototype);var s=Object.getOwnPropertyDescriptor(r,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;if(void 0===l)return;return l.call(a)}var u=Object.getPrototypeOf(r);if(null===u)return;e=u,t=o,n=a,i=!0,s=u=void 0}});if(void 0===S)throw new Error("You must include the utils.js file before tether.js");var a=(X=S.Utils).getScrollParents,u=(l=X.getBounds,X.getOffsetParent),f=(d=X.extend,X.addClass),h=X.removeClass,c=(g=X.updateClasses,_=X.defer,L=X.flush,X.getScrollBarSize),s=X.removeUtilElements,I=function(){if("undefined"==typeof document)return"";for(var e=document.createElement("div"),t=["transform","WebkitTransform","OTransform","MozTransform","msTransform"],n=0;n<t.length;++n){var i=t[n];if(void 0!==e.style[i])return i}}(),D=[],R=function(){D.forEach((function(e){e.position(!1)})),L()};!function(){var e=null,t=null,n=null,i=function i(){return void 0!==t&&t>16?(t=Math.min(t-16,250),void(n=setTimeout(i,250))):void(void 0!==e&&w()-e<10||(null!=n&&(clearTimeout(n),n=null),e=w(),R(),t=w()-e))};"undefined"!=typeof window&&void 0!==window.addEventListener&&["resize","scroll","touchmove"].forEach((function(e){window.addEventListener(e,i)}))}();var U={center:"center",left:"right",right:"left"},z={middle:"middle",top:"bottom",bottom:"top"},H={top:0,left:0,middle:"50%",center:"50%",bottom:"100%",right:"100%"},q=function(e,t){var n=e.left,i=e.top;return"auto"===n&&(n=U[t.left]),"auto"===i&&(i=z[t.top]),{left:n,top:i}},$=function(e){var t=e.left,n=e.top;return void 0!==H[e.left]&&(t=H[e.left]),void 0!==H[e.top]&&(n=H[e.top]),{left:t,top:n}},B=function(e){var t=e.split(" "),n=j(t,2);return{top:n[0],left:n[1]}},W=B,V=function(e){function t(e){var n=this;i(this,t),N(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this.position=this.position.bind(this),D.push(this),this.history=[],this.setOptions(e,!1),S.modules.forEach((function(e){void 0!==e.initialize&&e.initialize.call(n)})),this.position()}return y(t,e),A(t,[{key:"getClass",value:function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=this.options.classes;return void 0!==t&&t[e]?this.options.classes[e]:this.options.classPrefix?this.options.classPrefix+"-"+e:e}},{key:"setOptions",value:function(e){var t=this,n=arguments.length<=1||void 0===arguments[1]||arguments[1],i={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether"};this.options=d(i,e);var r=this.options,o=r.element,s=r.target,l=r.targetModifier;if(this.element=o,this.target=s,this.targetModifier=l,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),["element","target"].forEach((function(e){if(void 0===t[e])throw new Error("Tether Error: Both element and target must be defined");void 0!==t[e].jquery?t[e]=t[e][0]:"string"==typeof t[e]&&(t[e]=document.querySelector(t[e]))})),f(this.element,this.getClass("element")),!1!==this.options.addTargetClasses&&f(this.target,this.getClass("target")),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");this.targetAttachment=W(this.options.targetAttachment),this.attachment=W(this.options.attachment),this.offset=B(this.options.offset),this.targetOffset=B(this.options.targetOffset),void 0!==this.scrollParents&&this.disable(),"scroll-handle"===this.targetModifier?this.scrollParents=[this.target]:this.scrollParents=a(this.target),!1!==this.options.enabled&&this.enable(n)}},{key:"getTargetBounds",value:function(){if(void 0===this.targetModifier)return l(this.target);if("visible"===this.targetModifier)return this.target===document.body?{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth}:((o={height:(e=l(this.target)).height,width:e.width,top:e.top,left:e.left}).height=Math.min(o.height,e.height-(pageYOffset-e.top)),o.height=Math.min(o.height,e.height-(e.top+e.height-(pageYOffset+innerHeight))),o.height=Math.min(innerHeight,o.height),o.height-=2,o.width=Math.min(o.width,e.width-(pageXOffset-e.left)),o.width=Math.min(o.width,e.width-(e.left+e.width-(pageXOffset+innerWidth))),o.width=Math.min(innerWidth,o.width),o.width-=2,o.top<pageYOffset&&(o.top=pageYOffset),o.left<pageXOffset&&(o.left=pageXOffset),o);if("scroll-handle"===this.targetModifier){var e=void 0,t=this.target;t===document.body?(t=document.documentElement,e={left:pageXOffset,top:pageYOffset,height:innerHeight,width:innerWidth}):e=l(t);var n=getComputedStyle(t),i=0;(t.scrollWidth>t.clientWidth||[n.overflow,n.overflowX].indexOf("scroll")>=0||this.target!==document.body)&&(i=15);var r=e.height-parseFloat(n.borderTopWidth)-parseFloat(n.borderBottomWidth)-i,o={width:15,height:.975*r*(r/t.scrollHeight),left:e.left+e.width-parseFloat(n.borderLeftWidth)-15},a=0;408>r&&this.target===document.body&&(a=-11e-5*Math.pow(r,2)-.00727*r+22.58),this.target!==document.body&&(o.height=Math.max(o.height,24));var s=this.target.scrollTop/(t.scrollHeight-r);return o.top=s*(r-o.height-a)+e.top+parseFloat(n.borderTopWidth),this.target===document.body&&(o.height=Math.max(o.height,24)),o}}},{key:"clearCache",value:function(){this._cache={}}},{key:"cache",value:function(e,t){return void 0===this._cache&&(this._cache={}),void 0===this._cache[e]&&(this._cache[e]=t.call(this)),this._cache[e]}},{key:"enable",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]||arguments[0];!1!==this.options.addTargetClasses&&f(this.target,this.getClass("enabled")),f(this.element,this.getClass("enabled")),this.enabled=!0,this.scrollParents.forEach((function(t){t!==e.target.ownerDocument&&t.addEventListener("scroll",e.position)})),t&&this.position()}},{key:"disable",value:function(){var e=this;h(this.target,this.getClass("enabled")),h(this.element,this.getClass("enabled")),this.enabled=!1,void 0!==this.scrollParents&&this.scrollParents.forEach((function(t){t.removeEventListener("scroll",e.position)}))}},{key:"destroy",value:function(){var e=this;this.disable(),D.forEach((function(t,n){t===e&&D.splice(n,1)})),0===D.length&&s()}},{key:"updateAttachClasses",value:function(e,t){var n=this;e=e||this.attachment,t=t||this.targetAttachment;var i=["left","top","bottom","right","middle","center"];void 0!==this._addAttachClasses&&this._addAttachClasses.length&&this._addAttachClasses.splice(0,this._addAttachClasses.length),void 0===this._addAttachClasses&&(this._addAttachClasses=[]);var r=this._addAttachClasses;e.top&&r.push(this.getClass("element-attached")+"-"+e.top),e.left&&r.push(this.getClass("element-attached")+"-"+e.left),t.top&&r.push(this.getClass("target-attached")+"-"+t.top),t.left&&r.push(this.getClass("target-attached")+"-"+t.left);var o=[];i.forEach((function(e){o.push(n.getClass("element-attached")+"-"+e),o.push(n.getClass("target-attached")+"-"+e)})),_((function(){void 0!==n._addAttachClasses&&(g(n.element,n._addAttachClasses,o),!1!==n.options.addTargetClasses&&g(n.target,n._addAttachClasses,o),delete n._addAttachClasses)}))}},{key:"position",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]||arguments[0];if(this.enabled){this.clearCache();var n=q(this.targetAttachment,this.attachment);this.updateAttachClasses(this.attachment,n);var i=this.cache("element-bounds",(function(){return l(e.element)})),r=i.width,a=i.height;if(0===r&&0===a&&void 0!==this.lastSize){var s=this.lastSize;r=s.width,a=s.height}else this.lastSize={width:r,height:a};var d=this.cache("target-bounds",(function(){return e.getTargetBounds()})),h=d,f=k($(this.attachment),{width:r,height:a}),p=k($(n),h),m=k(this.offset,{width:r,height:a}),v=k(this.targetOffset,h);f=E(f,m),p=E(p,v);for(var g=d.left+p.left-f.left,y=d.top+p.top-f.top,b=0;b<S.modules.length;++b){var w=S.modules[b].position.call(this,{left:g,top:y,targetAttachment:n,targetPos:d,elementPos:i,offset:f,targetOffset:p,manualOffset:m,manualTargetOffset:v,scrollbarSize:O,attachment:this.attachment});if(!1===w)return!1;void 0!==w&&"object"==o(w)&&(y=w.top,g=w.left)}var C={page:{top:y,left:g},viewport:{top:y-pageYOffset,bottom:pageYOffset-y-a+innerHeight,left:g-pageXOffset,right:pageXOffset-g-r+innerWidth}},A=this.target.ownerDocument,T=A.defaultView,O=void 0;return A.body.scrollWidth>T.innerWidth&&(O=this.cache("scrollbar-size",c),C.viewport.bottom-=O.height),A.body.scrollHeight>T.innerHeight&&(O=this.cache("scrollbar-size",c),C.viewport.right-=O.width),(-1===["","static"].indexOf(A.body.style.position)||-1===["","static"].indexOf(A.body.parentElement.style.position))&&(C.page.bottom=A.body.scrollHeight-y-a,C.page.right=A.body.scrollWidth-g-r),void 0!==this.options.optimizations&&!1!==this.options.optimizations.moveElement&&void 0===this.targetModifier&&function(){var t=e.cache("target-offsetparent",(function(){return u(e.target)})),n=e.cache("target-offsetparent-bounds",(function(){return l(t)})),i=getComputedStyle(t),r=n,o={};if(["Top","Left","Bottom","Right"].forEach((function(e){o[e.toLowerCase()]=parseFloat(i["border"+e+"Width"])})),n.right=A.body.scrollWidth-n.left-r.width+o.right,n.bottom=A.body.scrollHeight-n.top-r.height+o.bottom,C.page.top>=n.top+o.top&&C.page.bottom>=n.bottom&&C.page.left>=n.left+o.left&&C.page.right>=n.right){var a=t.scrollTop,s=t.scrollLeft;C.offset={top:C.page.top-n.top+a-o.top,left:C.page.left-n.left+s-o.left}}}(),this.move(C),this.history.unshift(C),this.history.length>3&&this.history.pop(),t&&L(),!0}}},{key:"move",value:function(e){var t=this;if(void 0!==this.element.parentNode){var n={};for(var i in e)for(var r in n[i]={},e[i]){for(var o=!1,a=0;a<this.history.length;++a){var s=this.history[a];if(void 0!==s[i]&&!b(s[i][r],e[i][r])){o=!0;break}}o||(n[i][r]=!0)}var l={top:"",left:"",right:"",bottom:""},c=function(e,n){if(!1!==(void 0!==t.options.optimizations?t.options.optimizations.gpu:null)){var i=void 0,r=void 0;e.top?(l.top=0,i=n.top):(l.bottom=0,i=-n.bottom),e.left?(l.left=0,r=n.left):(l.right=0,r=-n.right),l[I]="translateX("+Math.round(r)+"px) translateY("+Math.round(i)+"px)","msTransform"!==I&&(l[I]+=" translateZ(0)")}else e.top?l.top=n.top+"px":l.bottom=n.bottom+"px",e.left?l.left=n.left+"px":l.right=n.right+"px"},h=!1;if((n.page.top||n.page.bottom)&&(n.page.left||n.page.right)?(l.position="absolute",c(n.page,e.page)):(n.viewport.top||n.viewport.bottom)&&(n.viewport.left||n.viewport.right)?(l.position="fixed",c(n.viewport,e.viewport)):void 0!==n.offset&&n.offset.top&&n.offset.left?function(){l.position="absolute";var i=t.cache("target-offsetparent",(function(){return u(t.target)}));u(t.element)!==i&&_((function(){t.element.parentNode.removeChild(t.element),i.appendChild(t.element)})),c(n.offset,e.offset),h=!0}():(l.position="absolute",c({top:!0,left:!0},e.page)),!h){for(var f=!0,p=this.element.parentNode;p&&1===p.nodeType&&"BODY"!==p.tagName;){if("static"!==getComputedStyle(p).position){f=!1;break}p=p.parentNode}f||(this.element.parentNode.removeChild(this.element),this.element.ownerDocument.body.appendChild(this.element))}var m={},v=!1;for(var r in l){var g=l[r];this.element.style[r]!==g&&(v=!0,m[r]=g)}v&&_((function(){d(t.element.style,m)}))}}}]),t}(P);V.modules=[],S.position=R;var G=d(V,S),d=(j=function(){function e(e,t){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);i=!0);}catch(e){r=!0,o=e}finally{try{!i&&s.return&&s.return()}finally{if(r)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=(X=S.Utils).getBounds,X.extend),Q=(g=X.updateClasses,_=X.defer,["left","top","right","bottom"]);S.modules.push({position:function(e){var t=this,n=e.top,i=e.left,r=e.targetAttachment;if(!this.options.constraints)return!0;var o=this.cache("element-bounds",(function(){return l(t.element)})),a=o.height,s=o.width;if(0===s&&0===a&&void 0!==this.lastSize){var u=this.lastSize;s=u.width,a=u.height}var c=this.cache("target-bounds",(function(){return t.getTargetBounds()})),h=c.height,f=c.width,p=[this.getClass("pinned"),this.getClass("out-of-bounds")];this.options.constraints.forEach((function(e){var t=e.outOfBoundsClass,n=e.pinnedClass;t&&p.push(t),n&&p.push(n)})),p.forEach((function(e){["left","top","right","bottom"].forEach((function(t){p.push(e+"-"+t)}))}));var m=[],v=d({},r),y=d({},this.attachment);return this.options.constraints.forEach((function(e){var o=e.to,l=e.attachment,u=e.pin;void 0===l&&(l="");var c=void 0,d=void 0;if(l.indexOf(" ")>=0){var p=l.split(" "),g=j(p,2);d=g[0],c=g[1]}else c=d=l;var b=C(t,o);("target"===d||"both"===d)&&(n<b[1]&&"top"===v.top&&(n+=h,v.top="bottom"),n+a>b[3]&&"bottom"===v.top&&(n-=h,v.top="top")),"together"===d&&("top"===v.top&&("bottom"===y.top&&n<b[1]?(n+=h,v.top="bottom",n+=a,y.top="top"):"top"===y.top&&n+a>b[3]&&n-(a-h)>=b[1]&&(n-=a-h,v.top="bottom",y.top="bottom")),"bottom"===v.top&&("top"===y.top&&n+a>b[3]?(n-=h,v.top="top",n-=a,y.top="bottom"):"bottom"===y.top&&n<b[1]&&n+(2*a-h)<=b[3]&&(n+=a-h,v.top="top",y.top="top")),"middle"===v.top&&(n+a>b[3]&&"top"===y.top?(n-=a,y.top="bottom"):n<b[1]&&"bottom"===y.top&&(n+=a,y.top="top"))),("target"===c||"both"===c)&&(i<b[0]&&"left"===v.left&&(i+=f,v.left="right"),i+s>b[2]&&"right"===v.left&&(i-=f,v.left="left")),"together"===c&&(i<b[0]&&"left"===v.left?"right"===y.left?(i+=f,v.left="right",i+=s,y.left="left"):"left"===y.left&&(i+=f,v.left="right",i-=s,y.left="right"):i+s>b[2]&&"right"===v.left?"left"===y.left?(i-=f,v.left="left",i-=s,y.left="right"):"right"===y.left&&(i-=f,v.left="left",i+=s,y.left="left"):"center"===v.left&&(i+s>b[2]&&"left"===y.left?(i-=s,y.left="right"):i<b[0]&&"right"===y.left&&(i+=s,y.left="left"))),("element"===d||"both"===d)&&(n<b[1]&&"bottom"===y.top&&(n+=a,y.top="top"),n+a>b[3]&&"top"===y.top&&(n-=a,y.top="bottom")),("element"===c||"both"===c)&&(i<b[0]&&("right"===y.left?(i+=s,y.left="left"):"center"===y.left&&(i+=s/2,y.left="left")),i+s>b[2]&&("left"===y.left?(i-=s,y.left="right"):"center"===y.left&&(i-=s/2,y.left="right"))),"string"==typeof u?u=u.split(",").map((function(e){return e.trim()})):!0===u&&(u=["top","left","right","bottom"]),u=u||[];var w=[],E=[];n<b[1]&&(u.indexOf("top")>=0?(n=b[1],w.push("top")):E.push("top")),n+a>b[3]&&(u.indexOf("bottom")>=0?(n=b[3]-a,w.push("bottom")):E.push("bottom")),i<b[0]&&(u.indexOf("left")>=0?(i=b[0],w.push("left")):E.push("left")),i+s>b[2]&&(u.indexOf("right")>=0?(i=b[2]-s,w.push("right")):E.push("right")),w.length&&function(){var e=void 0;e=void 0!==t.options.pinnedClass?t.options.pinnedClass:t.getClass("pinned"),m.push(e),w.forEach((function(t){m.push(e+"-"+t)}))}(),E.length&&function(){var e=void 0;e=void 0!==t.options.outOfBoundsClass?t.options.outOfBoundsClass:t.getClass("out-of-bounds"),m.push(e),E.forEach((function(t){m.push(e+"-"+t)}))}(),(w.indexOf("left")>=0||w.indexOf("right")>=0)&&(y.left=v.left=!1),(w.indexOf("top")>=0||w.indexOf("bottom")>=0)&&(y.top=v.top=!1),(v.top!==r.top||v.left!==r.left||y.top!==t.attachment.top||y.left!==t.attachment.left)&&(t.updateAttachClasses(y,v),t.trigger("update",{attachment:y,targetAttachment:v}))})),_((function(){!1!==t.options.addTargetClasses&&g(t.target,m,p),g(t.element,m,p)})),{top:n,left:i}}});var X,l=(X=S.Utils).getBounds,g=X.updateClasses;return _=X.defer,S.modules.push({position:function(e){var t=this,n=e.top,i=e.left,r=this.cache("element-bounds",(function(){return l(t.element)})),o=r.height,a=r.width,s=this.getTargetBounds(),u=n+o,c=i+a,d=[];n<=s.bottom&&u>=s.top&&["left","right"].forEach((function(e){var t=s[e];(t===i||t===c)&&d.push(e)})),i<=s.right&&c>=s.left&&["top","bottom"].forEach((function(e){var t=s[e];(t===n||t===u)&&d.push(e)}));var h=[],f=[],p=["left","top","right","bottom"];return h.push(this.getClass("abutted")),p.forEach((function(e){h.push(t.getClass("abutted")+"-"+e)})),d.length&&f.push(this.getClass("abutted")),d.forEach((function(e){f.push(t.getClass("abutted")+"-"+e)})),_((function(){!1!==t.options.addTargetClasses&&g(t.target,f,h),g(t.element,f,h)})),!0}}),j=function(){function e(e,t){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);i=!0);}catch(e){r=!0,o=e}finally{try{!i&&s.return&&s.return()}finally{if(r)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),S.modules.push({position:function(e){var t=e.top,n=e.left;if(this.options.shift){var i=this.options.shift;"function"==typeof this.options.shift&&(i=this.options.shift.call(this,{top:t,left:n}));var r=void 0,o=void 0;if("string"==typeof i){(i=i.split(" "))[1]=i[1]||i[0];var a=j(i,2);r=a[0],o=a[1],r=parseFloat(r,10),o=parseFloat(o,10)}else r=i.top,o=i.left;return{top:t+=r,left:n+=o}}}}),G},void 0===(r="function"==typeof i?i.call(t,n,t,e):i)||(e.exports=r)},82378:(e,t,n)=>{var i;n(69826),n(41539),void 0===(i=function(){return{init:function(){$(document).on("show.bs.modal",".js-ajax-modal",this.initModals)},initModals:function(e){var t=$(this);if(!t.data("loaded")){var n=$(e.relatedTarget).data("link");t.data("loaded",!0),t.find(".js-ajax-modal-body").append('<iframe class="ajax-modal__body__iframe" frameborder="0" src="'+n+'" width="100%" height="100%" scrolling="auto"></iframe>')}},resetAjaxModals:function(){$(".js-ajax-modal").off("show.bs.modal",this.initModals),$(".js-ajax-modal").on("show.bs.modal",this.initModals)}}}.call(t,n,t,e))||(e.exports=i)},83678:(e,t,n)=>{var i;n(32564),void 0===(i=function(){return function(e){var t=this.general;t.debounce=function(e,t,n){var i;return function(){var r=this,o=arguments,a=function(){i=null,n||e.apply(r,o)},s=n&&!i;clearTimeout(i),i=setTimeout(a,t),s&&e.apply(r,o)}},t.easeInOutQuad=function(e,t,n,i){return 1>(e/=i/2)?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t},t.animate=function(e,t,n,i,r,o){e&&(window.requestAnimationFrame((function(){e.style[t]=r}),o),e.style[t]=i)}}}.call(t,n,t,e))||(e.exports=i)},75782:(e,t,n)=>{var i;n(89554),n(41539),void 0===(i=function(){return function(e,t){var n,i,r,o,a,s=0,l="js-toggle-btn",u="toggle-btn--active",c="toggle-item--active";n=function(e,t,n){for(var i=t.split(" "),r=0,o=i.length;o>r;r++)e.addEventListener(i[r],n,!1)},i=function(){[].forEach.call(document.querySelectorAll("."+l),(function(e){n(e,"click touchstart mousedown",(function(e){e.preventDefault()})),n(e,"touchend mouseup",(function(t){var n=document.querySelectorAll(e.getAttribute("data-target"))[0],i=n.querySelectorAll(".toggle-item__content")[0],d=i.offsetHeight,h=n.classList.contains(c),f=e.getAttribute("data-hide-others");if(s=null!==e.getAttribute("data-duration")?e.getAttribute("data-duration"):150,h)o(e,n);else{if(f){var p=e.getAttribute("data-target"),m=e.getAttribute("data-level");[].forEach.call(document.querySelectorAll("."+l+'[data-level="'+m+'"]'),(function(e){var t=e.getAttribute("data-target");p!==t&&e.classList.contains(u)&&a(e,document.querySelectorAll(t)[0])}))}r(e,n,i,d)}}))}))},r=function(e,t,n,i){cargobay.general.animate(t,"height","px",i,"auto",s),e.classList.add(u),t.classList.add(c)},o=function(e,t,n,i){cargobay.general.animate(t,"height","px",0,i,s),e.classList.remove(u),t.classList.remove(c)},a=function(e,t){e.classList.remove(u),t.style.height=0,t.classList.remove(c)},i()}}.call(t,n,t,e))||(e.exports=i)},56071:(e,t,n)=>{var i;n(69826),n(41539),n(24603),n(74916),n(39714),n(4723),n(64765),void 0===(i=function(){return{init:function(){this.urlChooser(),this.initDelBtn()},initDelBtn:function(){$("body").on("click",".js-media-chooser-del-preview-btn",(function(e){var t=$(this),n=t.data("linked-id"),i=$("#"+n+"-widget"),r=$("#"+n);t.parent().find(".media-chooser__preview").remove(),$(".media-thumbnail__icon").remove(),i.removeClass("media-chooser--choosen"),r.val("")}))},urlChooser:function(){$("body").on("click",".js-url-chooser-link-select",(function(e){e.preventDefault();var t=$(this),n=t.data("slug"),i=t.data("id"),r=t.closest("nav").data("replace-url");itemUrl=n||"",itemId=i,$.ajax({url:r,type:"GET",data:{text:itemUrl},success:function(e){replacedUrl=e.text,$("#url-chooser__selection-preview").text("Selection: "+replacedUrl)}})})),$("body").on("click",".js-url-chooser-media-select",(function(e){e.preventDefault();var t=$(this),n=t.data("path"),i=t.data("thumb-path"),r=t.data("id"),o=t.data("title"),a=t.data("cke"),s=t.closest(".thumbnail-wrapper").data("replace-url");(itemUrl=n,itemId=r,itemTitle=o,itemThumbPath=i,a)?psc.mediaChooser.saveMediaChooserModal(!0):$(window.frameElement).closest(".js-ajax-modal").data("media-chooser")?psc.mediaChooser.saveMediaChooserModal(!1):$.ajax({url:s,type:"GET",data:{text:itemUrl},success:function(e){replacedUrl=e.text}}).done((function(){psc.mediaChooser.saveUrlChooserModal(!1)}))})),$("#cancel-url-chooser-modal").on("click",(function(){if($(this).data("cke"))window.close();else{var e=$(window.frameElement).closest(".js-ajax-modal").attr("id");parent.$("#"+e).modal("hide")}})),$(document).on("click","#save-url-chooser-modal",(function(){var e=$(this).data("cke");psc.mediaChooser.saveUrlChooserModal(e)}))},saveUrlChooserModal:function(e){if(e){var t=getUrlParam("CKEditorFuncNum");window.opener.CKEDITOR.tools.callFunction(t,itemUrl),window.close()}else{var n=$(window.frameElement).closest(".js-ajax-modal"),i=n.data("linked-input-id"),r=n.attr("id");parent.$("#"+i).val(itemUrl).change(),parent.$("#"+i).parent().find(".js-urlchooser-value").val(replacedUrl),parent.$("#"+r).modal("hide")}},saveMediaChooserModal:function(e){if(e){var t=getUrlParam("CKEditorFuncNum");window.opener.CKEDITOR.tools.callFunction(t,itemUrl),window.close()}else{var n=$(window.frameElement).closest(".js-ajax-modal"),i=n.data("linked-input-id"),r=n.attr("id");parent.$("#"+i).val(itemId).change();var o=parent.$("#"+i+"-widget"),a=parent.$("#"+i+"__preview__img"),s=parent.$("#"+i+"__preview__title");if(o.addClass("media-chooser--choosen"),s.html(itemTitle),""===itemThumbPath)s.parent().prepend('<i class="fa fa-file-o media-thumbnail__icon"></i>');else a.attr("src",itemThumbPath);parent.$("#"+r).modal("hide")}},getUrlParam:function(e){var t=new RegExp("(?:[?&]|&)"+e+"=([^&]+)","i"),n=window.location.search.match(t);return n&&n.length>1?n[1]:""}}}.call(t,n,t,e))||(e.exports=i)}},e=>{e.O(0,[560,858],(()=>{return t=92579,e(e.s=t);var t}));e.O()}]); |