/* >>> file start: js/front-bundled/dist/videoUploader.js */
/*! For license information please see videoUploader.js.LICENSE.txt */
(()=>{"use strict";const t=function(){return Date.now().toString(36)+Math.random().toString(36).slice(2)};var e=5*Math.pow(1024,2),r=Math.pow(1024,3),n=["FilesAdded","FileUploaded","BeforeUpload","BeforeChunkUpload","ChunkUploaded","UploadComplete","UploadProgress","Error"],o=["avi","mp4","mov","3gp","wmv","mkv","webm"],i=new Promise((function(t){["complete","loaded","interactive"].includes(document.readyState)&&t(),document.addEventListener("DOMContentLoaded",(function(){t()}))}));function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,l=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(t,e)||f(t,e)||function(){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 u(){u=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},l=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),l=new M(n||[]);return o(a,"_invoke",{value:C(t,r,l)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",w={};function b(){}function g(){}function E(){}var O={};f(O,l,(function(){return this}));var L=Object.getPrototypeOf,S=L&&L(L(I([])));S&&S!==r&&n.call(S,l)&&(O=S);var j=E.prototype=b.prototype=Object.create(O);function k(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,l,u){var s=h(t[o],t,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==a(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,l,u)}),(function(t){r("throw",t,l,u)})):e.resolve(f).then((function(t){c.value=t,l(c)}),(function(t){return r("throw",t,l,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function C(e,r,n){var o=d;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var l=n.delegate;if(l){var u=P(l,n);if(u){if(u===w)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var s=h(e,r,n);if("normal"===s.type){if(o=n.done?m:v,s.arg===w)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=m,n.method="throw",n.arg=s.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),w;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,w;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,w):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,w)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[l];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(a(e)+" is not iterable")}return g.prototype=E,o(j,"constructor",{value:E,configurable:!0}),o(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,f(t,c,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},k(x.prototype),f(x.prototype,s,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(p(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(j),f(j,c,"Generator"),f(j,l,(function(){return this})),f(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(R),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return l.type="throw",l.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,w):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),w},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),w}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),w}},e}function s(t,e,r,n,o,i,a){try{var l=t[i](a),u=l.value}catch(t){return void r(t)}l.done?e(u):Promise.resolve(u).then(n,o)}function c(t){return function(t){if(Array.isArray(t))return p(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||f(t)||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 f(t,e){if(t){if("string"==typeof t)return p(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(t,e):void 0}}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function h(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function d(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?h(Object(r),!0).forEach((function(e){w(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function v(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,b(n.key),n)}}function y(t,e,r){return e&&v(t.prototype,e),r&&v(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function m(t,e,r){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,r)}function w(t,e,r){return(e=b(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function b(t){var e=function(t){if("object"!==a(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!==a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===a(e)?e:String(e)}function g(t,e,r){return function(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}(t,L(t,e,"set"),r),r}function E(t,e,r){return function(t,e){if(t!==e)throw new TypeError("Private static access of wrong provenance")}(t,e),function(t){if(void 0===t)throw new TypeError("attempted to get private static field before its declaration")}(r),S(t,r)}function O(t,e){return S(t,L(t,e,"get"))}function L(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function S(t,e){return e.get?e.get.call(t):e.value}var j=function(){},k={chunkSize:e,maxFileSize:r,maxRetries:2},x=new WeakMap,C=new WeakMap,P=new WeakMap,T=new WeakMap,R=new WeakMap,M=new WeakMap,I=new WeakMap,A=new WeakMap,_=new WeakMap,D=new WeakMap,U=new WeakMap,N=new WeakMap,F=new WeakMap,W=new WeakMap,z=new WeakMap,G=new WeakMap,H=new WeakMap,J=new WeakMap,V=new WeakMap,B=new WeakMap,Q=new WeakMap,X=y((function e(r){var i,a,f=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),m(this,x,{writable:!0,value:null}),m(this,C,{writable:!0,value:[]}),m(this,P,{writable:!0,value:{}}),m(this,T,{writable:!0,value:{fileInput:null}}),m(this,R,{writable:!0,value:{}}),m(this,M,{writable:!0,value:{}}),m(this,I,{writable:!0,value:null}),m(this,A,{writable:!0,value:{}}),m(this,_,{writable:!0,value:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=r.callbacks,i=void 0===o?{}:o,a=r.elements,l=void 0===a?{}:a,u=r.settings,s=void 0===u?{}:u,c=t(),p=E(e,e,Y).call(e,d(d({},e.defaultSettings),s));n.forEach((function(t){var e,r="".concat((e=t).charAt(0).toLowerCase()).concat(e.slice(1));O(f,P)[r]=i[r]||j})),g(f,I,c),g(f,R,p),O(f,G).call(f),O(f,D).call(f,"mimeTypes",(function(t){var r=t.type.startsWith("video"),n=t.name.split(".").at(-1).toLowerCase();return r&&O(f,R).extensions.includes(n)?t:(O(f,z).call(f,{code:e.errorCodes.FILE_EXTENSION_ERROR,message:LJ.ml("video_uploader.errors.file_extension",{filename:t.name,ext:n}),file:t}),null)})),O(f,D).call(f,"maxFileSize",(function(t){var r=t.size;return!r||r&&r<O(f,R).maxFileSize?t:(O(f,z).call(f,{code:e.errorCodes.FILE_SIZE_ERROR,message:LJ.ml("video_uploader.errors.file_size",{filename:t.name,size:t.size}),file:t}),null)})),Object.keys(l).forEach((function(t){if(Object.keys(O(f,T)).includes(t)){var e=l[t];"fileInput"===t&&O(f,W).call(f,e)}}))}}),m(this,D,{writable:!0,value:function(t,e){O(f,M)[t]=e}}),m(this,U,{writable:!0,value:function(t){for(var e=Object.values(O(f,M)),r=0;r<e.length;r+=1)if(!Boolean(e[r](t)))return null;return t}}),m(this,N,{writable:!0,value:function(r){var n=(!O(f,R).multiple&&r.length>1?r.slice(0,1):r).filter(O(f,U));if(n.length){var o=n.map((function(r){return{name:r.name,size:r.size,type:r.type,lastModifiedDate:r.lastModifiedDate,statusCode:e.statusCodes.QUEUED,uploadOffset:0,id:t(),getNative:function(){return r}}}));g(f,C,[].concat(c(O(f,C)),c(o))),O(f,P).filesAdded(f,o),O(f,T).fileInput&&(O(f,T).fileInput.value="")}}}),m(this,F,{writable:!0,value:function(t){var e=t.currentTarget.files;O(f,N).call(f,c(e))}}),m(this,W,{writable:!0,value:function(t){if(!(t instanceof HTMLInputElement)||"file"!==t.type)throw new Error("Incorrect file input node provided");var e=o.map((function(t){return".".concat(t)})).join();O(f,R).multiple?t.setAttribute("multiple",""):t.removeAttribute("multiple"),t.tabIndex=-1,t.setAttribute("accept",e),t.addEventListener("change",O(f,F)),O(f,T).fileInput=t}}),m(this,z,{writable:!0,value:function(t){O(f,P).error(f,t)}}),m(this,G,{writable:!0,value:function(){var t=new XMLHttpRequest;t.responseType="json",t.withCredentials=!1,g(f,A,{xhr:t,availableRetries:2})}}),m(this,H,{writable:!0,value:function(t,r){var n=f,o=t.start,i=O(n,A),a=i.availableRetries,l=i.xhr,u=r.id;a>0?(O(n,A).availableRetries-=1,O(n,Q).call(n,u,{uploadOffset:o}),setTimeout((function(){O(n,V).call(n,r)}),1e3)):(O(n,Q).call(n,u,{uploadOffset:0,statusCode:e.statusCodes.FAILED}),O(n,z).call(n,{code:e.errorCodes.UPLOAD_ERROR,message:LJ.ml("video_uploader.errors.http"),file:r,response:l.response,status:l.status,responseHeaders:l.getAllResponseHeaders()}),O(n,B).call(n))}}),m(this,J,{writable:!0,value:function(t,r){var n=t.blob,o=f,i=t.start,a=t.end,l=O(o,A).xhr,u=r.id,s=r.uploadOffset,c=O(o,R),p=c.endpoint,h=c.method;l.upload.onprogress=function(t){t.total&&(O(o,Q).call(o,u,{uploadOffset:Math.min(i+t.loaded,r.size)}),O(o,P).uploadProgress(o,r))},l.onload=function(){l.status<200||l.status>=400?O(o,H).call(o,t,r):(O(o,P).chunkUploaded(o,r,t,{total:n.size,response:l.response,status:l.status,responseHeaders:l.getAllResponseHeaders()}),a>=r.size?(O(o,Q).call(o,u,{statusCode:e.statusCodes.DONE,uploadOffset:r.size}),O(o,P).fileUploaded(o,r),O(o,B).call(o)):(O(o,Q).call(o,u,{uploadOffset:s+n.size}),O(o,P).uploadProgress(o,r),setTimeout((function(){O(o,V).call(o,r)}))))},l.onerror=function(){O(o,H).call(o,t,r)},l.onabort=function(){O(o,Q).call(o,u,{statusCode:e.statusCodes.STOPPED,uploadOffset:0})},l.open(h,p,!0),l.send(n)}}),m(this,V,{writable:!0,value:function(t){if(t.statusCode===e.statusCodes.UPLOADING&&O(f,x)!==e.statusCodes.STOPPED){var r=O(f,R).chunkSize,n=t.getNative(),o=t.uploadOffset,i=Math.min(o+r,t.size),a={blob:n.slice(o,i),start:o,end:i,number:Math.ceil(o/r)+1};O(f,P).beforeChunkUpload(f,t,a),O(f,J).call(f,a,t)}}}),m(this,B,{writable:!0,value:(i=u().mark((function t(){var r;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=O(f,C).find((function(t){return t.statusCode===e.statusCodes.QUEUED}))){t.next=5;break}return g(f,x,e.statusCodes.DONE),O(f,P).uploadComplete(f,O(f,C)),t.abrupt("return");case 5:O(f,P).beforeUpload(f,r),O(f,G).call(f),O(f,Q).call(f,r.id,{statusCode:e.statusCodes.UPLOADING}),O(f,V).call(f,r);case 9:case"end":return t.stop()}}),t)})),a=function(){var t=this,e=arguments;return new Promise((function(r,n){var o=i.apply(t,e);function a(t){s(o,r,n,a,l,"next",t)}function l(t){s(o,r,n,a,l,"throw",t)}a(void 0)}))},function(){return a.apply(this,arguments)})}),m(this,Q,{writable:!0,value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=O(f,C).find((function(e){return e.id===t}));r&&Object.entries(e).forEach((function(t){var e=l(t,2),n=e[0],o=e[1];r[n]=o}))}}),w(this,"patchSettings",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=E(e,e,Y).call(e,t);g(f,R,d(d({},O(f,R)),r))})),w(this,"patchFile",(function(t){var e=d({},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});["id","getNative","uploadOffset","statusCode"].forEach((function(t){delete e[t]})),O(f,Q).call(f,t,e)})),w(this,"getId",(function(){return O(f,I)})),w(this,"getSettings",(function(){return d({},O(f,R))})),w(this,"getFiles",(function(){return c(O(f,C))})),w(this,"getElements",(function(){return d({},e[O(f,I)].elements)})),w(this,"bindCallbackToEvent",(function(t,e){O(f,P)[t]=e})),w(this,"addFiles",(function(t){Array.isArray(t)&&t.length&&O(f,N).call(f,t)})),w(this,"removeFile",(function(t){t&&g(f,C,O(f,C).filter((function(e){return e.id!==t})))})),w(this,"removeFiles",(function(t){null!=t&&t.length&&t.forEach((function(t){f.removeFile(t)}))})),w(this,"clear",(function(){O(f,x)!==e.statusCodes.STARTED?(O(f,G).call(f),g(f,C,[])):f.stop()})),w(this,"start",(function(){O(f,x)!==e.statusCodes.STARTED&&(g(f,x,e.statusCodes.STARTED),O(f,B).call(f))})),w(this,"stop",(function(){if(O(f,x)===e.statusCodes.STARTED){var t=O(f,A).xhr;g(f,x,e.statusCodes.STOPPED),t.abort(),f.clear()}}));var p=r.callbacks,h=r.elements,v=void 0===h?{}:h,y=r.settings,b=void 0===y?{}:y;try{O(this,_).call(this,{callbacks:p,settings:b,elements:v})}catch(t){O(this,z).call(this,{code:e.errorCodes.INIT_ERROR,message:t.message})}}));w(X,"defaultSettings",Object.freeze(d({multiple:!1,method:"POST",extensions:o},k))),w(X,"statusCodes",Object.freeze({STOPPED:1,QUEUED:1,STARTED:2,UPLOADING:2,FAILED:4,DONE:5})),w(X,"errorCodes",Object.freeze({INIT_ERROR:100,UPLOAD_ERROR:200,FILE_SIZE_ERROR:300,FILE_EXTENSION_ERROR:301}));var Y={writable:!0,value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object.entries(t),r={};return e.forEach((function(t){var e=l(t,2),n=e[0],o=e[1],i=k[n];if(i&&o>i)return r[n]=i,void console.warn("VideoUploader/validateSettings: ".concat(o," is unexpected value for ").concat(n));r[n]=o})),r}};!function(){for(var t,e="LJ.Misc.VideoUploader".split("."),r=window;t=e.shift();)r[t]=r[t]||{},r=r[t]}(),LJ.Misc.VideoUploader=X,i.then((function(){var t=new CustomEvent("VideoUploader:codeReady");window.dispatchEvent(t)}))})();
/* <<< file end: js/front-bundled/dist/videoUploader.js */

//# map link was there [videoUploader.js.map]
