@micromag/viewer-build 0.3.517 → 0.3.519

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/build/asset-manifest.json +6 -23
  2. package/build/index.html +1 -1
  3. package/build/static/js/175.42d3627e.js +2 -0
  4. package/build/static/js/{887.8a6921e5.js.LICENSE.txt → 175.42d3627e.js.LICENSE.txt} +0 -10
  5. package/build/static/js/main.5411c29e.js +2 -0
  6. package/build/static/js/runtime~main.3754c53b.js +1 -0
  7. package/package.json +6 -6
  8. package/build/static/js/104.e7b2f53b.chunk.js +0 -1
  9. package/build/static/js/119.409edb1a.chunk.js +0 -1
  10. package/build/static/js/139.4365a1df.chunk.js +0 -1
  11. package/build/static/js/165.a09e3185.chunk.js +0 -1
  12. package/build/static/js/177.d6cc3845.chunk.js +0 -1
  13. package/build/static/js/299.a106f35a.chunk.js +0 -1
  14. package/build/static/js/359.768ec35e.chunk.js +0 -1
  15. package/build/static/js/375.0bcd7609.chunk.js +0 -2
  16. package/build/static/js/375.0bcd7609.chunk.js.LICENSE.txt +0 -10
  17. package/build/static/js/462.307a7cd0.chunk.js +0 -1
  18. package/build/static/js/50.9da80c9d.chunk.js +0 -1
  19. package/build/static/js/526.efc3b856.chunk.js +0 -2
  20. package/build/static/js/526.efc3b856.chunk.js.LICENSE.txt +0 -10
  21. package/build/static/js/567.1a366653.chunk.js +0 -1
  22. package/build/static/js/595.27131768.chunk.js +0 -1
  23. package/build/static/js/626.c42d15c2.chunk.js +0 -2
  24. package/build/static/js/626.c42d15c2.chunk.js.LICENSE.txt +0 -1
  25. package/build/static/js/784.1708dd96.chunk.js +0 -1
  26. package/build/static/js/786.6bf1d59f.chunk.js +0 -1
  27. package/build/static/js/793.ed1b7b39.chunk.js +0 -1
  28. package/build/static/js/887.8a6921e5.js +0 -2
  29. package/build/static/js/main.b4414625.js +0 -2
  30. package/build/static/js/runtime~main.4d15fd3a.js +0 -1
  31. /package/build/static/js/{main.b4414625.js.LICENSE.txt → main.5411c29e.js.LICENSE.txt} +0 -0
@@ -1,2 +0,0 @@
1
- /*! For license information please see 375.0bcd7609.chunk.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[375],{5181:function(t,e,n){n.d(e,{FK:function(){return y},Ob:function(){return H},XX:function(){return F},_3:function(){return g},fF:function(){return i},h:function(){return m},uA:function(){return b},v2:function(){return A}});var o,i,r,l,_,u,s,a={},p=[],c=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,f=Array.isArray;function d(t,e){for(var n in e)t[n]=e[n];return t}function h(t){var e=t.parentNode;e&&e.removeChild(t)}function m(t,e,n){var i,r,l,_={};for(l in e)"key"==l?i=e[l]:"ref"==l?r=e[l]:_[l]=e[l];if(arguments.length>2&&(_.children=arguments.length>3?o.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(l in t.defaultProps)void 0===_[l]&&(_[l]=t.defaultProps[l]);return v(t,_,i,r,null)}function v(t,e,n,o,l){var _={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==l?++r:l,__i:-1,__u:0};return null==l&&null!=i.vnode&&i.vnode(_),_}function g(){return{current:null}}function y(t){return t.children}function b(t,e){this.props=t,this.context=e}function x(t,e){if(null==e)return t.__?x(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?x(t):null}function w(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return w(t)}}function k(t){(!t.__d&&(t.__d=!0)&&l.push(t)&&!P.__r++||_!==i.debounceRendering)&&((_=i.debounceRendering)||u)(P)}function P(){var t,e,n,o,r,_,u,a,p;for(l.sort(s);t=l.shift();)t.__d&&(e=l.length,o=void 0,_=(r=(n=t).__v).__e,a=[],p=[],(u=n.__P)&&((o=d({},r)).__v=r.__v+1,i.vnode&&i.vnode(o),$(u,o,r,n.__n,void 0!==u.ownerSVGElement,32&r.__u?[_]:null,a,null==_?x(r):_,!!(32&r.__u),p),o.__v=r.__v,o.__.__k[o.__i]=o,I(a,o,p),o.__e!=_&&w(o)),l.length>e&&l.sort(s));P.__r=0}function E(t,e,n,o,i,r,l,_,u,s,c){var f,d,h,m,v,g=o&&o.__k||p,y=e.length;for(n.__d=u,S(n,e,g),u=n.__d,f=0;f<y;f++)null!=(h=n.__k[f])&&"boolean"!=typeof h&&"function"!=typeof h&&(d=-1===h.__i?a:g[h.__i]||a,h.__i=f,$(t,h,d,i,r,l,_,u,s,c),m=h.__e,h.ref&&d.ref!=h.ref&&(d.ref&&j(d.ref,null,h),c.push(h.ref,h.__c||m,h)),null==v&&null!=m&&(v=m),65536&h.__u||d.__k===h.__k?(m||d.__e!=u||(u=x(d)),u=T(h,u,t)):"function"==typeof h.type&&void 0!==h.__d?u=h.__d:m&&(u=m.nextSibling),h.__d=void 0,h.__u&=-196609);n.__d=u,n.__e=v}function S(t,e,n){var o,i,r,l,_,u=e.length,s=n.length,a=s,p=0;for(t.__k=[],o=0;o<u;o++)l=o+p,null!=(i=t.__k[o]=null==(i=e[o])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?v(null,i,null,null,null):f(i)?v(y,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?v(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=t,i.__b=t.__b+1,_=C(i,n,l,a),i.__i=_,r=null,-1!==_&&(a--,(r=n[_])&&(r.__u|=131072)),null==r||null===r.__v?(-1==_&&p--,"function"!=typeof i.type&&(i.__u|=65536)):_!==l&&(_===l+1?p++:_>l?a>u-l?p+=_-l:p--:_<l?_==l-1&&(p=_-l):p=0,_!==o+p&&(i.__u|=65536))):(r=n[l])&&null==r.key&&r.__e&&!(131072&r.__u)&&(r.__e==t.__d&&(t.__d=x(r)),z(r,r,!1),n[l]=null,a--);if(a)for(o=0;o<s;o++)null!=(r=n[o])&&!(131072&r.__u)&&(r.__e==t.__d&&(t.__d=x(r)),z(r,r))}function T(t,e,n){var o,i;if("function"==typeof t.type){for(o=t.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=t,e=T(o[i],e,n));return e}t.__e!=e&&(n.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8===e.nodeType);return e}function A(t,e){return e=e||[],null==t||"boolean"==typeof t||(f(t)?t.some((function(t){A(t,e)})):e.push(t)),e}function C(t,e,n,o){var i=t.key,r=t.type,l=n-1,_=n+1,u=e[n];if(null===u||u&&i==u.key&&r===u.type&&!(131072&u.__u))return n;if(o>(null==u||131072&u.__u?0:1))for(;l>=0||_<e.length;){if(l>=0){if((u=e[l])&&!(131072&u.__u)&&i==u.key&&r===u.type)return l;l--}if(_<e.length){if((u=e[_])&&!(131072&u.__u)&&i==u.key&&r===u.type)return _;_++}}return-1}function M(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||c.test(e)?n:n+"px"}function U(t,e,n,o,i){var r;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof o&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||M(t.style,e,"");if(n)for(e in n)o&&n[e]===o[e]||M(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])r=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t||"onFocusOut"===e||"onFocusIn"===e?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?o?n.u=o.u:(n.u=Date.now(),t.addEventListener(e,r?O:D,r)):t.removeEventListener(e,r?O:D,r);else{if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&"rowSpan"!==e&&"colSpan"!==e&&"role"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function D(t){if(this.l){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(i.event?i.event(t):t)}}function O(t){if(this.l)return this.l[t.type+!0](i.event?i.event(t):t)}function $(t,e,n,o,r,l,_,u,s,a){var p,c,h,m,v,g,x,w,k,P,S,T,A,C,M,U=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(s=!!(32&n.__u),l=[u=e.__e=n.__e]),(p=i.__b)&&p(e);t:if("function"==typeof U)try{if(w=e.props,k=(p=U.contextType)&&o[p.__c],P=p?k?k.props.value:p.__:o,n.__c?x=(c=e.__c=n.__c).__=c.__E:("prototype"in U&&U.prototype.render?e.__c=c=new U(w,P):(e.__c=c=new b(w,P),c.constructor=U,c.render=N),k&&k.sub(c),c.props=w,c.state||(c.state={}),c.context=P,c.__n=o,h=c.__d=!0,c.__h=[],c._sb=[]),null==c.__s&&(c.__s=c.state),null!=U.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=d({},c.__s)),d(c.__s,U.getDerivedStateFromProps(w,c.__s))),m=c.props,v=c.state,c.__v=e,h)null==U.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(null==U.getDerivedStateFromProps&&w!==m&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(w,P),!c.__e&&(null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(w,c.__s,P)||e.__v===n.__v)){for(e.__v!==n.__v&&(c.props=w,c.state=c.__s,c.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),S=0;S<c._sb.length;S++)c.__h.push(c._sb[S]);c._sb=[],c.__h.length&&_.push(c);break t}null!=c.componentWillUpdate&&c.componentWillUpdate(w,c.__s,P),null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(m,v,g)}))}if(c.context=P,c.props=w,c.__P=t,c.__e=!1,T=i.__r,A=0,"prototype"in U&&U.prototype.render){for(c.state=c.__s,c.__d=!1,T&&T(e),p=c.render(c.props,c.state,c.context),C=0;C<c._sb.length;C++)c.__h.push(c._sb[C]);c._sb=[]}else do{c.__d=!1,T&&T(e),p=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++A<25);c.state=c.__s,null!=c.getChildContext&&(o=d(d({},o),c.getChildContext())),h||null==c.getSnapshotBeforeUpdate||(g=c.getSnapshotBeforeUpdate(m,v)),E(t,f(M=null!=p&&p.type===y&&null==p.key?p.props.children:p)?M:[M],e,n,o,r,l,_,u,s,a),c.base=e.__e,e.__u&=-161,c.__h.length&&_.push(c),x&&(c.__E=c.__=null)}catch(t){e.__v=null,s||null!=l?(e.__e=u,e.__u|=s?160:32,l[l.indexOf(u)]=null):(e.__e=n.__e,e.__k=n.__k),i.__e(t,e,n)}else null==l&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=L(n.__e,e,n,o,r,l,_,s,a);(p=i.diffed)&&p(e)}function I(t,e,n){e.__d=void 0;for(var o=0;o<n.length;o++)j(n[o],n[++o],n[++o]);i.__c&&i.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){i.__e(t,e.__v)}}))}function L(t,e,n,i,r,l,_,u,s){var p,c,d,m,v,g,y,b=n.props,w=e.props,k=e.type;if("svg"===k&&(r=!0),null!=l)for(p=0;p<l.length;p++)if((v=l[p])&&"setAttribute"in v==!!k&&(k?v.localName===k:3===v.nodeType)){t=v,l[p]=null;break}if(null==t){if(null===k)return document.createTextNode(w);t=r?document.createElementNS("http://www.w3.org/2000/svg",k):document.createElement(k,w.is&&w),l=null,u=!1}if(null===k)b===w||u&&t.data===w||(t.data=w);else{if(l=l&&o.call(t.childNodes),b=n.props||a,!u&&null!=l)for(b={},p=0;p<t.attributes.length;p++)b[(v=t.attributes[p]).name]=v.value;for(p in b)v=b[p],"children"==p||("dangerouslySetInnerHTML"==p?d=v:"key"===p||p in w||U(t,p,null,v,r));for(p in w)v=w[p],"children"==p?m=v:"dangerouslySetInnerHTML"==p?c=v:"value"==p?g=v:"checked"==p?y=v:"key"===p||u&&"function"!=typeof v||b[p]===v||U(t,p,v,b[p],r);if(c)u||d&&(c.__html===d.__html||c.__html===t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(d&&(t.innerHTML=""),E(t,f(m)?m:[m],e,n,i,r&&"foreignObject"!==k,l,_,l?l[0]:n.__k&&x(n,0),u,s),null!=l)for(p=l.length;p--;)null!=l[p]&&h(l[p]);u||(p="value",void 0!==g&&(g!==t[p]||"progress"===k&&!g||"option"===k&&g!==b[p])&&U(t,p,g,b[p],!1),p="checked",void 0!==y&&y!==t[p]&&U(t,p,y,b[p],!1))}return t}function j(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){i.__e(t,n)}}function z(t,e,n){var o,r;if(i.unmount&&i.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||j(o,null,e)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){i.__e(t,e)}o.base=o.__P=null,t.__c=void 0}if(o=t.__k)for(r=0;r<o.length;r++)o[r]&&z(o[r],e,n||"function"!=typeof t.type);n||null==t.__e||h(t.__e),t.__=t.__e=t.__d=void 0}function N(t,e,n){return this.constructor(t,n)}function F(t,e,n){var r,l,_,u;i.__&&i.__(t,e),l=(r="function"==typeof n)?null:n&&n.__k||e.__k,_=[],u=[],$(e,t=(!r&&n||e).__k=m(y,null,[t]),l||a,a,void 0!==e.ownerSVGElement,!r&&n?[n]:l?null:e.firstChild?o.call(e.childNodes):null,_,!r&&n?n:l?l.__e:e.firstChild,r,u),I(_,t,u)}function H(t,e,n){var i,r,l,_,u=d({},t.props);for(l in t.type&&t.type.defaultProps&&(_=t.type.defaultProps),e)"key"==l?i=e[l]:"ref"==l?r=e[l]:u[l]=void 0===e[l]&&void 0!==_?_[l]:e[l];return arguments.length>2&&(u.children=arguments.length>3?o.call(arguments,2):n),v(t.type,u,i||t.key,r||t.ref,null)}o=p.slice,i={__e:function(t,e,n,o){for(var i,r,l;e=e.__;)if((i=e.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(t)),l=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(t,o||{}),l=i.__d),l)return i.__E=i}catch(e){t=e}throw t}},r=0,b.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof t&&(t=t(d({},n),this.props)),t&&d(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),k(this))},b.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),k(this))},b.prototype.render=y,l=[],u="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,s=function(t,e){return t.__v.__b-e.__v.__b},P.__r=0},2729:function(t,e,n){n.d(e,{A:function(){return i}});var o=n(9491);class i{constructor(t,e){this.uppy=t,this.opts=null!=e?e:{}}getPluginState(){const{plugins:t}=this.uppy.getState();return(null==t?void 0:t[this.id])||{}}setPluginState(t){if(!t)return;const{plugins:e}=this.uppy.getState();this.uppy.setState({plugins:{...e,[this.id]:{...e[this.id],...t}}})}setOptions(t){this.opts={...this.opts,...t},this.setPluginState(void 0),this.i18nInit()}i18nInit(){const t=new o.A([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.setPluginState(void 0)}addTarget(t){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(t){}afterUpdate(){}}},7496:function(t,e,n){n.d(e,{A:function(){return c}});var o=n(5181),i=n(1677),r=n(5533),l=n(2729);function _(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var u=0;function s(t){return"__private_"+u+++"_"+t}var a=s("updateUI");class p extends l.A{constructor(){super(...arguments),Object.defineProperty(this,a,{writable:!0,value:void 0})}getTargetPlugin(t){let e;if("function"==typeof(null==t?void 0:t.addTarget))e=t,e instanceof p||console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.",{cause:{targetPlugin:e,UIPlugin:p}}));else if("function"==typeof t){const n=t;this.uppy.iteratePlugins((t=>{t instanceof n&&(e=t)}))}return e}mount(t,e){const n=e.id,l=(u=t,void 0===s&&(s=document),"string"==typeof u?s.querySelector(u):(0,i.A)(u)?u:null);var u,s;if(l){this.isTargetDOMEl=!0;const e=document.createElement("div");return e.classList.add("uppy-Root"),_(this,a)[a]=function(t){let e,n=null;return function(){for(var o=arguments.length,i=new Array(o),r=0;r<o;r++)i[r]=arguments[r];return e=i,n||(n=Promise.resolve().then((()=>(n=null,t(...e))))),n}}((t=>{this.uppy.getPlugin(this.id)&&((0,o.XX)(this.render(t),e),this.afterUpdate())})),this.uppy.log(`Installing ${n} to a DOM element '${t}'`),this.opts.replaceTargetContent&&(l.innerHTML=""),(0,o.XX)(this.render(this.uppy.getState()),e),this.el=e,l.appendChild(e),e.dir=this.opts.direction||(0,r.A)(e)||"ltr",this.onMount(),this.el}const p=this.getTargetPlugin(t);if(p)return this.uppy.log(`Installing ${n} to ${p.id}`),this.parent=p,this.el=p.addTarget(e),this.onMount(),this.el;this.uppy.log(`Not installing ${n}`);let c=`Invalid target option given to ${n}.`;throw c+="function"==typeof t?" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":"If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(c)}render(t){throw new Error("Extend the render method to add your plugin to a DOM element")}update(t){var e,n;null!=this.el&&(null==(e=(n=_(this,a))[a])||e.call(n,t))}unmount(){var t;this.isTargetDOMEl&&(null==(t=this.el)||t.remove()),this.onUnmount()}onMount(){}onUnmount(){}}var c=p},9491:function(t,e,n){function o(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}n.d(e,{A:function(){return p}});var i=0;function r(t){return"__private_"+i+++"_"+t}function l(t,e,n){const o=[];return t.forEach((t=>"string"!=typeof t?o.push(t):e[Symbol.split](t).forEach(((t,e,i)=>{""!==t&&o.push(t),e<i.length-1&&o.push(n)})))),o}function _(t,e){const n=/\$/g;let o=[t];if(null==e)return o;for(const t of Object.keys(e))if("_"!==t){let i=e[t];"string"==typeof i&&(i=n[Symbol.replace](i,"$$$$")),o=l(o,new RegExp(`%\\{${t}\\}`,"g"),i)}return o}const u=t=>{throw new Error(`missing string: ${t}`)};var s=r("onMissingKey"),a=r("apply");class p{constructor(t,e){let{onMissingKey:n=u}=void 0===e?{}:e;Object.defineProperty(this,a,{value:c}),Object.defineProperty(this,s,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(t){return 1===t?0:1}},Array.isArray(t)?t.forEach(o(this,a)[a],this):o(this,a)[a](t),o(this,s)[s]=n}translate(t,e){return this.translateArray(t,e).join("")}translateArray(t,e){let n=this.locale.strings[t];if(null==n&&(o(this,s)[s](t),n=t),"object"==typeof n){if(e&&void 0!==e.smart_count)return _(n[this.locale.pluralize(e.smart_count)],e);throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if("string"!=typeof n)throw new Error("string was not a string");return _(n,e)}}function c(t){if(null==t||!t.strings)return;const e=this.locale;Object.assign(this.locale,{strings:{...e.strings,...t.strings},pluralize:t.pluralize||e.pluralize})}},5533:function(t,e){e.A=function(t){for(var e;t&&!t.dir;)t=t.parentNode;return null==(e=t)?void 0:e.dir}},1677:function(t,e,n){function o(t){return"object"==typeof t&&null!==t&&"nodeType"in t&&t.nodeType===Node.ELEMENT_NODE}n.d(e,{A:function(){return o}})},7544:function(t,e){e.A={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"}}}]);
@@ -1,10 +0,0 @@
1
- /**
2
- * Takes a string with placeholder variables like `%{smart_count} file selected`
3
- * and replaces it with values from options `{smart_count: 5}`
4
- *
5
- * @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE
6
- * taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299
7
- *
8
- * @param phrase that needs interpolation, with placeholders
9
- * @param options with values that will be used to replace placeholders
10
- */
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[462],{5462:function(e,t,s){s.r(t),s.d(t,{default:function(){return A}});var o=s(2729),r=s(590),i=s(4528);function a(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var n=0;function p(e){return"__private_"+n+++"_"+e}var d=p("aliveTimer"),l=p("isDone"),u=p("onTimedOut"),h=p("timeout"),c=class{constructor(e,t){Object.defineProperty(this,d,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:!1}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,h,{writable:!0,value:void 0}),a(this,h)[h]=e,a(this,u)[u]=t}progress(){a(this,l)[l]||a(this,h)[h]>0&&(clearTimeout(a(this,d)[d]),a(this,d)[d]=setTimeout(a(this,u)[u],a(this,h)[h]))}done(){a(this,l)[l]||(clearTimeout(a(this,d)[d]),a(this,d)[d]=void 0,a(this,l)[l]=!0)}},m=s(1422),y=s(6681),f=s(7853),w=s(8284),b={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function g(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var v=0;function E(e){return"__private_"+v+++"_"+e}function U(e,t){let s=t;return s||(s=new Error("Upload error")),"string"==typeof s&&(s=new Error(s)),s instanceof Error||(s=Object.assign(new Error("Upload error"),{data:s})),(0,f.A)(e)?(s=new y.A(s,e),s):(s.request=e,s)}function O(e){return e.data.slice(0,e.data.size,e.meta.type)}const F={formData:!0,fieldName:"file",method:"post",allowedMetaFields:null,responseUrlFieldName:"url",bundle:!1,headers:{},timeout:3e4,limit:5,withCredentials:!1,responseType:"",getResponseData(e){let t={};try{t=JSON.parse(e)}catch{}return t},getResponseError(e,t){let s=new Error("Upload error");return(0,f.A)(t)&&(s=new y.A(s,t)),s},validateStatus(e){return e>=200&&e<300}};var R=E("uploadLocalFile"),T=E("uploadBundle"),j=E("getCompanionClientArgs"),S=E("uploadFiles"),C=E("handleUpload");class A extends o.A{constructor(e,t){if(super(e,{...F,fieldName:t.bundle?"files[]":"file",...t}),Object.defineProperty(this,S,{value:P}),Object.defineProperty(this,j,{value:M}),Object.defineProperty(this,T,{value:x}),Object.defineProperty(this,R,{value:D}),Object.defineProperty(this,C,{writable:!0,value:async e=>{if(0===e.length)return void this.uppy.log("[XHRUpload] No files to upload!");0!==this.opts.limit||this.opts[m.$]||this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");const t=this.uppy.getFilesByIds(e),s=(0,w.Y)(t),o=(0,w.S)(s);if(this.uppy.emit("upload-start",o),this.opts.bundle){if(s.some((e=>e.isRemote)))throw new Error("Can’t upload remote files when the `bundle: true` option is set");if("function"==typeof this.opts.headers)throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await g(this,T)[T](s)}else await g(this,S)[S](s)}}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=b,this.i18nInit(),m.$ in this.opts?this.requests=this.opts[m.$]:this.requests=new m.i(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");if(this.opts.bundle&&"function"==typeof this.opts.headers)throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");if(void 0===(null==t?void 0:t.allowedMetaFields)&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.uploaderEvents=Object.create(null)}getOptions(e){const t=this.uppy.getState().xhrUpload,{headers:s}=this.opts,o={...this.opts,...t||{},...e.xhrUpload||{},headers:{}};return"function"==typeof s?o.headers=s(e):Object.assign(o.headers,this.opts.headers),t&&Object.assign(o.headers,t.headers),e.xhrUpload&&Object.assign(o.headers,e.xhrUpload.headers),o}addMetadata(e,t,s){(Array.isArray(s.allowedMetaFields)?s.allowedMetaFields:Object.keys(t)).forEach((s=>{const o=t[s];Array.isArray(o)?o.forEach((t=>e.append(s,t))):e.append(s,o)}))}createFormDataUpload(e,t){const s=new FormData;this.addMetadata(s,e.meta,t);const o=O(e);return e.name?s.append(t.fieldName,o,e.meta.name):s.append(t.fieldName,o),s}createBundledUpload(e,t){const s=new FormData,{meta:o}=this.uppy.getState();return this.addMetadata(s,o,t),e.forEach((e=>{const t=this.getOptions(e),o=O(e);e.name?s.append(t.fieldName,o,e.name):s.append(t.fieldName,o)})),s}install(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(g(this,C)[C])}uninstall(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(g(this,C)[C])}}async function D(e,t,s){const o=this.getOptions(e),a=Date.now();return this.uppy.log(`uploading ${t} of ${s}`),new Promise(((t,s)=>{const n=o.formData?this.createFormDataUpload(e,o):e.data,p=new XMLHttpRequest,d=new i.A(this.uppy);let l;this.uploaderEvents[e.id]=d;const u=new c(o.timeout,(()=>{const t=new Error(this.i18n("uploadStalled",{seconds:Math.ceil(o.timeout/1e3)}));this.uppy.emit("upload-stalled",t,[e])})),h=(0,r.A)();p.upload.addEventListener("loadstart",(()=>{this.uppy.log(`[XHRUpload] ${h} started`)})),p.upload.addEventListener("progress",(t=>{this.uppy.log(`[XHRUpload] ${h} progress: ${t.loaded} / ${t.total}`),u.progress(),t.lengthComputable&&this.uppy.emit("upload-progress",this.uppy.getFile(e.id),{uploader:this,uploadStarted:a,bytesUploaded:t.loaded,bytesTotal:t.total})})),p.addEventListener("load",(()=>{if(this.uppy.log(`[XHRUpload] ${h} finished`),u.done(),l.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),o.validateStatus(p.status,p.responseText,p)){const s=o.getResponseData(p.responseText,p),r=null==s?void 0:s[o.responseUrlFieldName],i={status:p.status,body:s,uploadURL:r};return this.uppy.emit("upload-success",this.uppy.getFile(e.id),i),r&&this.uppy.log(`Download ${e.name} from ${r}`),t(e)}const r=o.getResponseData(p.responseText,p),i=U(p,o.getResponseError(p.responseText,p)),a={status:p.status,body:r};return this.uppy.emit("upload-error",e,i,a),s(i)})),p.addEventListener("error",(()=>{this.uppy.log(`[XHRUpload] ${h} errored`),u.done(),l.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null);const t=U(p,o.getResponseError(p.responseText,p));return this.uppy.emit("upload-error",e,t),s(t)})),p.open(o.method.toUpperCase(),o.endpoint,!0),p.withCredentials=o.withCredentials,""!==o.responseType&&(p.responseType=o.responseType),l=this.requests.run((()=>{const t=this.getOptions(e);return Object.keys(t.headers).forEach((e=>{p.setRequestHeader(e,t.headers[e])})),p.send(n),()=>{u.done(),p.abort()}})),d.onFileRemove(e.id,(()=>{l.abort(),s(new Error("File removed"))})),d.onCancelAll(e.id,(e=>{let{reason:t}=e;"user"===t&&l.abort(),s(new Error("Upload cancelled"))}))}))}function x(e){return new Promise(((t,s)=>{const{endpoint:o}=this.opts,{method:r}=this.opts,i=Date.now(),a=this.uppy.getState().xhrUpload,n=this.createBundledUpload(e,{...this.opts,...a||{}}),p=new XMLHttpRequest,d=t=>{e.forEach((e=>{this.uppy.emit("upload-error",e,t)}))},l=new c(this.opts.timeout,(()=>{const t=new Error(this.i18n("uploadStalled",{seconds:Math.ceil(this.opts.timeout/1e3)}));this.uppy.emit("upload-stalled",t,e)}));p.upload.addEventListener("loadstart",(()=>{this.uppy.log("[XHRUpload] started uploading bundle"),l.progress()})),p.upload.addEventListener("progress",(t=>{l.progress(),t.lengthComputable&&e.forEach((e=>{this.uppy.emit("upload-progress",this.uppy.getFile(e.id),{uploader:this,uploadStarted:i,bytesUploaded:t.loaded/t.total*e.size,bytesTotal:e.size})}))})),p.addEventListener("load",(()=>{if(l.done(),this.opts.validateStatus(p.status,p.responseText,p)){const s=this.opts.getResponseData(p.responseText,p),o={status:p.status,body:s};return e.forEach((e=>{this.uppy.emit("upload-success",this.uppy.getFile(e.id),o)})),t()}const o=this.opts.getResponseError(p.responseText,p)||new y.A("Upload error",p);return d(o),s(o)})),p.addEventListener("error",(()=>{l.done();const e=this.opts.getResponseError(p.responseText,p)||new Error("Upload error");return d(e),s(e)})),this.uppy.on("cancel-all",(function(e){let{reason:t}=void 0===e?{}:e;"user"===t&&(l.done(),p.abort())})),p.open(r.toUpperCase(),o,!0),p.withCredentials=this.opts.withCredentials,""!==this.opts.responseType&&(p.responseType=this.opts.responseType);const u=this.opts.headers;Object.keys(u).forEach((e=>{p.setRequestHeader(e,u[e])})),p.send(n)}))}function M(e){var t;const s=this.getOptions(e),o=Array.isArray(s.allowedMetaFields)?s.allowedMetaFields:Object.keys(e.meta);return{...null==(t=e.remote)?void 0:t.body,protocol:"multipart",endpoint:s.endpoint,size:e.data.size,fieldname:s.fieldName,metadata:Object.fromEntries(o.map((t=>[t,e.meta[t]]))),httpMethod:s.method,useFormData:s.formData,headers:s.headers}}async function P(e){await Promise.allSettled(e.map(((t,s)=>{const o=s+1,r=e.length;if(t.isRemote){const e=()=>this.requests,s=new AbortController,o=e=>{e.id===t.id&&s.abort()};this.uppy.on("file-removed",o);const r=this.uppy.getRequestClientForFile(t).uploadRemoteFile(t,g(this,j)[j](t),{signal:s.signal,getQueue:e});return this.requests.wrapSyncFunction((()=>{this.uppy.off("file-removed",o)}),{priority:-1})(),r}return g(this,R)[R](t,o,r)})))}A.VERSION="3.6.4"},590:function(e,t,s){s.d(t,{A:function(){return o}});let o=(e=21)=>{let t="",s=e;for(;s--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[50],{6050:function(e,r,i){i.r(r);const s={strings:{},pluralize(e){return e<=1?0:1}};s.strings={addBulkFilesFailed:{0:"L’ajout de %{smart_count} fichier a échoué",1:"L’ajout de %{smart_count} fichiers a échoué"},addedNumFiles:"%{numFiles} fichier(s) ajouté(s)",addingMoreFiles:"Ajout de fichiers",addMore:"Ajouter d’autres",addMoreFiles:"Ajouter d’autres fichiers",allFilesFromFolderNamed:"Tous les fichiers du dossier %{name}",allowAccessDescription:"Pour prendre des photos ou enregistrer une vidéo, veuillez autoriser l’accès à votre caméra pour ce site.",allowAccessTitle:"Veuillez autoriser l’accès à votre caméra",authAborted:"Authentification interrompue",authenticateWith:"Se connecter à %{pluginName}",authenticateWithTitle:"Veuillez vous authentifier avec %{pluginName} pour sélectionner les fichiers",back:"Retour",browse:"naviguer",browseFiles:"naviguer",cancel:"Annuler",cancelUpload:"Annuler le téléversement",chooseFiles:"Choisir des fichiers",closeModal:"Fermer la fenêtre",companionError:"Connexion à Companion a échoué",companionUnauthorizeHint:"Pour vous déconnecter de votre compte %{provider}, veuillez aller à %{url}",complete:"Terminé",compressedX:"%{size} économisé(s) par la compression",compressingImages:"Compression des images…",connectedToInternet:"Connecté à Internet",copyLink:"Copier le lien",copyLinkToClipboardFallback:"Copier le lien ci-dessous",copyLinkToClipboardSuccess:"Lien copié",creatingAssembly:"Préparation du téléversement…",creatingAssemblyFailed:"Transloadit: Impossible de créer Assembly",dashboardTitle:"Téléverseur de fichiers",dashboardWindowTitle:"Fenêtre de téléversement de fichiers (Appuyez sur Échap pour fermer)",dataUploadedOfTotal:"%{complete} sur %{total}",done:"Terminé",dropHereOr:"Déposer les fichiers ici ou %{browse}",dropHint:"Déposez vos fichiers ici",dropPasteBoth:"Déposer les fichiers ici, coller ou %{browse}",dropPasteFiles:"Déposer les fichiers ici, coller ou %{browse}",dropPasteFolders:"Déposer les fichiers ici, coller ou %{browse}",dropPasteImportBoth:"Déposer les fichiers ici, coller, %{browse} ou importer de",dropPasteImportFiles:"Déposer les fichiers ici, coller, %{browse} ou importer de",dropPasteImportFolders:"Déposer les fichiers ici, coller, %{browse} ou importer de",editFile:"Modifier le fichier",editImage:"Modifier l’image",editFileWithFilename:"Modifier le fichier %{file}",editing:"Modification en cours de %{file}",emptyFolderAdded:"Aucun fichier n’a été ajouté depuis un dossier vide",encoding:"Traitement…",enterCorrectUrl:"Lien incorrect: Assurez-vous que vous entrez un lien direct vers le fichier",enterUrlToImport:"Entrez le lien pour importer un fichier",exceedsSize:"Ce fichier dépasse la taille maximale autorisée de %{size}",failedToFetch:"Companion a échoué à récupérer ce lien, assurez-vous qu’il est correct",failedToUpload:"Le téléversement de %{file} a échoué",fileSource:"Fichier source: %{name}",filesUploadedOfTotal:{0:"%{complete} sur %{smart_count} fichier téléversé",1:"%{complete} sur %{smart_count} fichiers téléversés"},filter:"Filtrer",finishEditingFile:"Terminer l’édition du fichier",folderAdded:{0:"%{smart_count} fichier ajouté de %{folder}",1:"%{smart_count} fichiers ajoutés de %{folder}"},generatingThumbnails:"Génération des vignettes…",import:"Importer",importFrom:"Importer de %{name}",loading:"Chargement…",logOut:"Déconnexion",micDisabled:"Accès au micro refusé par l’utilisateur",myDevice:"Mon Appareil",noDuplicates:'Impossible d’ajouter le fichier "%{fileName}", il existe déjà',noFilesFound:"Vous n’avez aucun fichier ou dossier ici",noInternetConnection:"Pas de connexion à Internet",noMoreFilesAllowed:"Impossible d’ajouter de nouveaux fichiers: en cours de chargement ",openFolderNamed:"Ouvrir %{name}",pause:"Pause",pauseUpload:"Mettre en pause le téléversement",paused:"En pause",poweredBy:"Propulsé par %{uppy}",processingXFiles:{0:"Traitement de %{smart_count} fichier",1:"Traitement de %{smart_count} fichiers"},recording:"Enregistrement",recordingLength:"Durée d’enregistrement %{recording_length}",recordingStoppedMaxSize:"L’enregistrement s’est arrété car la taille du fichier dépasse la limite",removeFile:"Effacer le fichier %{file}",resetFilter:"Réinitialiser filtre",resume:"Reprendre",resumeUpload:"Reprendre le téléversement",retry:"Réessayer",retryUpload:"Réessayer le téléversement",save:"Sauvegarder",saveChanges:"Sauvegarder les modifications",selectFileNamed:"Sélectionner le fichier %{name}",selectX:{0:"Sélectionner %{smart_count}",1:"Sélectionner %{smart_count}"},smile:"Souriez !",startRecording:"Commencer l’enregistrement vidéo",stopRecording:"Arrêter l’enregistrement vidéo",streamActive:"Stream actif",streamPassive:"Stream passif",submitRecordedFile:"Envoyer la vidéo enregistrée",takePicture:"Prendre une photo",timedOut:"Téléversement bloqué durant %{seconds} secondes, annulation.",unselectFileNamed:"Désélectionner le fichier %{name}",upload:"Téléverser",uploadComplete:"Téléversement terminé",uploadFailed:"Le téléversement a échoué",uploadPaused:"Téléversement mis en pause",uploadStalled:"Téléversement bloqué depuis %{seconds} secondes. Il est peut-être nécessaire de recommencer l’opération.",uploadXFiles:{0:"Téléverser %{smart_count} fichier",1:"Téléverser %{smart_count} fichiers"},uploadXNewFiles:{0:"Téléverser +%{smart_count} fichier",1:"Téléverser +%{smart_count} fichiers"},uploading:"Téléversement en cours",uploadingXFiles:{0:"Téléversement de %{smart_count} fichier",1:"Téléversement de %{smart_count} fichiers"},xFilesSelected:{0:"%{smart_count} fichier sélectionné",1:"%{smart_count} fichiers sélectionnés"},xMoreFilesAdded:{0:"%{smart_count} autre fichier ajouté",1:"%{smart_count} autres fichiers ajoutés"},xTimeLeft:"%{time} restantes",youCanOnlyUploadFileTypes:"Vous pouvez seulement téléverser: %{types}",youCanOnlyUploadX:{0:"Vous pouvez seulement téléverser %{smart_count} fichier",1:"Vous pouvez seulement téléverser %{smart_count} fichiers"},youHaveToAtLeastSelectX:{0:"Vous devez sélectionner au moins %{smart_count} fichier",1:"Vous devez sélectionner au moins %{smart_count} fichiers"}},"undefined"!=typeof Uppy&&(globalThis.Uppy.locales.fr_FR=s),r.default=s}}]);
@@ -1,2 +0,0 @@
1
- /*! For license information please see 526.efc3b856.chunk.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[526],{2729:function(t,e,i){i.d(e,{A:function(){return n}});var r=i(9491);class n{constructor(t,e){this.uppy=t,this.opts=null!=e?e:{}}getPluginState(){const{plugins:t}=this.uppy.getState();return(null==t?void 0:t[this.id])||{}}setPluginState(t){if(!t)return;const{plugins:e}=this.uppy.getState();this.uppy.setState({plugins:{...e,[this.id]:{...e[this.id],...t}}})}setOptions(t){this.opts={...this.opts,...t},this.setPluginState(void 0),this.i18nInit()}i18nInit(){const t=new r.A([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.setPluginState(void 0)}addTarget(t){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(t){}afterUpdate(){}}},4528:function(t,e,i){function r(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}i.d(e,{A:function(){return a}});var n=0;function s(t){return"__private_"+n+++"_"+t}var o=s("uppy"),u=s("events");class a{constructor(t){Object.defineProperty(this,o,{writable:!0,value:void 0}),Object.defineProperty(this,u,{writable:!0,value:[]}),r(this,o)[o]=t}on(t,e){return r(this,u)[u].push([t,e]),r(this,o)[o].on(t,e)}remove(){for(const[t,e]of r(this,u)[u].splice(0))r(this,o)[o].off(t,e)}onFilePause(t,e){this.on("upload-pause",((i,r)=>{t===i&&e(r)}))}onFileRemove(t,e){this.on("file-removed",(i=>{t===i.id&&e(i.id)}))}onPause(t,e){this.on("upload-pause",((i,r)=>{t===i&&e(r)}))}onRetry(t,e){this.on("upload-retry",(i=>{t===i&&e()}))}onRetryAll(t,e){this.on("retry-all",(()=>{r(this,o)[o].getFile(t)&&e()}))}onPauseAll(t,e){this.on("pause-all",(()=>{r(this,o)[o].getFile(t)&&e()}))}onCancelAll(t,e){var i=this;this.on("cancel-all",(function(){r(i,o)[o].getFile(t)&&e(...arguments)}))}onResumeAll(t,e){this.on("resume-all",(()=>{r(this,o)[o].getFile(t)&&e()}))}}},6681:function(t,e){class i extends Error{constructor(t,e){void 0===e&&(e=null),super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=t,this.isNetworkError=!0,this.request=e}}e.A=i},1422:function(t,e,i){function r(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}i.d(e,{$:function(){return S},i:function(){return P}});var n=0;function s(t){return"__private_"+n+++"_"+t}function o(t){if(null!=t){var e;const i=()=>this.abort(t.reason);t.addEventListener("abort",i,{once:!0});const r=()=>{t.removeEventListener("abort",i)};null==(e=this.then)||e.call(this,r,r)}return this}var u=s("activeRequests"),a=s("queuedHandlers"),l=s("paused"),h=s("pauseTimer"),c=s("downLimit"),p=s("upperLimit"),f=s("rateLimitingTimer"),d=s("call"),y=s("queueNext"),v=s("next"),b=s("queue"),m=s("dequeue"),w=s("resume"),g=s("increaseLimit");class P{constructor(t){Object.defineProperty(this,m,{value:E}),Object.defineProperty(this,b,{value:A}),Object.defineProperty(this,v,{value:_}),Object.defineProperty(this,y,{value:j}),Object.defineProperty(this,d,{value:O}),Object.defineProperty(this,u,{writable:!0,value:0}),Object.defineProperty(this,a,{writable:!0,value:[]}),Object.defineProperty(this,l,{writable:!0,value:!1}),Object.defineProperty(this,h,{writable:!0,value:void 0}),Object.defineProperty(this,c,{writable:!0,value:1}),Object.defineProperty(this,p,{writable:!0,value:void 0}),Object.defineProperty(this,f,{writable:!0,value:void 0}),Object.defineProperty(this,w,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,g,{writable:!0,value:()=>{if(r(this,l)[l])r(this,f)[f]=setTimeout(r(this,g)[g],0);else{r(this,c)[c]=this.limit,this.limit=Math.ceil((r(this,p)[p]+r(this,c)[c])/2);for(let t=r(this,c)[c];t<=this.limit;t++)r(this,y)[y]();r(this,p)[p]-r(this,c)[c]>3?r(this,f)[f]=setTimeout(r(this,g)[g],2e3):r(this,c)[c]=Math.floor(r(this,c)[c]/2)}}}),this.limit="number"!=typeof t||0===t?1/0:t}run(t,e){return!r(this,l)[l]&&r(this,u)[u]<this.limit?r(this,d)[d](t):r(this,b)[b](t,e)}wrapSyncFunction(t,e){var i=this;return function(){for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];const u=i.run((()=>(t(...n),queueMicrotask((()=>u.done())),()=>{})),e);return{abortOn:o,abort(){u.abort()}}}}wrapPromiseFunction(t,e){var i=this;return function(){for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];let u;const a=new Promise(((r,s)=>{u=i.run((()=>{let e,i;try{i=Promise.resolve(t(...n))}catch(t){i=Promise.reject(t)}return i.then((t=>{e?s(e):(u.done(),r(t))}),(t=>{e?s(e):(u.done(),s(t))})),t=>{e=function(t){return new Error("Cancelled",{cause:t})}(t)}}),e)}));return a.abort=t=>{u.abort(t)},a.abortOn=o,a}}resume(){r(this,l)[l]=!1,clearTimeout(r(this,h)[h]);for(let t=0;t<this.limit;t++)r(this,y)[y]()}pause(t){void 0===t&&(t=null),r(this,l)[l]=!0,clearTimeout(r(this,h)[h]),null!=t&&(r(this,h)[h]=setTimeout(r(this,w)[w],t))}rateLimit(t){clearTimeout(r(this,f)[f]),this.pause(t),this.limit>1&&Number.isFinite(this.limit)&&(r(this,p)[p]=this.limit-1,this.limit=r(this,c)[c],r(this,f)[f]=setTimeout(r(this,g)[g],t))}get isPaused(){return r(this,l)[l]}}function O(t){r(this,u)[u]+=1;let e,i=!1;try{e=t()}catch(t){throw r(this,u)[u]-=1,t}return{abort:t=>{i||(i=!0,r(this,u)[u]-=1,null==e||e(t),r(this,y)[y]())},done:()=>{i||(i=!0,r(this,u)[u]-=1,r(this,y)[y]())}}}function j(){queueMicrotask((()=>r(this,v)[v]()))}function _(){if(r(this,l)[l]||r(this,u)[u]>=this.limit)return;if(0===r(this,a)[a].length)return;const t=r(this,a)[a].shift();if(null==t)throw new Error("Invariant violation: next is null");const e=r(this,d)[d](t.fn);t.abort=e.abort,t.done=e.done}function A(t,e){const i={fn:t,priority:(null==e?void 0:e.priority)||0,abort:()=>{r(this,m)[m](i)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},n=r(this,a)[a].findIndex((t=>i.priority>t.priority));return-1===n?r(this,a)[a].push(i):r(this,a)[a].splice(n,0,i),i}function E(t){const e=r(this,a)[a].indexOf(t);-1!==e&&r(this,a)[a].splice(e,1)}const S=Symbol("__queue")},9491:function(t,e,i){function r(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}i.d(e,{A:function(){return c}});var n=0;function s(t){return"__private_"+n+++"_"+t}function o(t,e,i){const r=[];return t.forEach((t=>"string"!=typeof t?r.push(t):e[Symbol.split](t).forEach(((t,e,n)=>{""!==t&&r.push(t),e<n.length-1&&r.push(i)})))),r}function u(t,e){const i=/\$/g;let r=[t];if(null==e)return r;for(const t of Object.keys(e))if("_"!==t){let n=e[t];"string"==typeof n&&(n=i[Symbol.replace](n,"$$$$")),r=o(r,new RegExp(`%\\{${t}\\}`,"g"),n)}return r}const a=t=>{throw new Error(`missing string: ${t}`)};var l=s("onMissingKey"),h=s("apply");class c{constructor(t,e){let{onMissingKey:i=a}=void 0===e?{}:e;Object.defineProperty(this,h,{value:p}),Object.defineProperty(this,l,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(t){return 1===t?0:1}},Array.isArray(t)?t.forEach(r(this,h)[h],this):r(this,h)[h](t),r(this,l)[l]=i}translate(t,e){return this.translateArray(t,e).join("")}translateArray(t,e){let i=this.locale.strings[t];if(null==i&&(r(this,l)[l](t),i=t),"object"==typeof i){if(e&&void 0!==e.smart_count)return u(i[this.locale.pluralize(e.smart_count)],e);throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if("string"!=typeof i)throw new Error("string was not a string");return u(i,e)}}function p(t){if(null==t||!t.strings)return;const e=this.locale;Object.assign(this.locale,{strings:{...e.strings,...t.strings},pluralize:t.pluralize||e.pluralize})}},8284:function(t,e,i){function r(t){return t.filter((t=>!(t=>"error"in t&&!!t.error)(t)))}function n(t){return t.filter((t=>{var e;return!(null!=(e=t.progress)&&e.uploadStarted&&t.isRestored)}))}i.d(e,{S:function(){return n},Y:function(){return r}})},7853:function(t,e){e.A=function(t){return!!t&&(0!==t.readyState&&4!==t.readyState||0===t.status)}}}]);
@@ -1,10 +0,0 @@
1
- /**
2
- * Takes a string with placeholder variables like `%{smart_count} file selected`
3
- * and replaces it with values from options `{smart_count: 5}`
4
- *
5
- * @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE
6
- * taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299
7
- *
8
- * @param phrase that needs interpolation, with placeholders
9
- * @param options with values that will be used to replace placeholders
10
- */
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[567],{3567:function(A,s,i){i.r(s),i.d(s,{default:function(){return o}});var e=i(5786),a=i(7496),n=i(5144),t=i(5181),r={strings:{pluginNameInstagram:"Instagram"}};class o extends a.A{constructor(A,s){super(A,s),this.type="acquirer",this.files=[],this.storage=this.opts.storage||e.HM,this.id=this.opts.id||"Instagram",this.icon=()=>(0,t.h)("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},(0,t.h)("defs",null,(0,t.h)("path",{d:"M16.825 5l.483-.001.799.002c1.168.005 1.598.021 2.407.057 1.17.05 1.97.235 2.67.506.725.28 1.34.655 1.951 1.265.613.61.99 1.223 1.273 1.946.273.7.46 1.498.516 2.67l.025.552.008.205c.029.748.037 1.51.042 3.777l.001.846v.703l-.001.398a50.82 50.82 0 01-.058 2.588c-.05 1.17-.235 1.97-.506 2.67a5.394 5.394 0 01-1.265 1.951c-.61.613-1.222.99-1.946 1.273-.699.273-1.498.46-2.668.516-.243.012-.451.022-.656.03l-.204.007c-.719.026-1.512.034-3.676.038l-.847.001h-1.1a50.279 50.279 0 01-2.587-.059c-1.171-.05-1.971-.235-2.671-.506a5.394 5.394 0 01-1.951-1.265 5.385 5.385 0 01-1.272-1.946c-.274-.699-.46-1.498-.517-2.668a88.15 88.15 0 01-.03-.656l-.007-.205c-.026-.718-.034-1.512-.038-3.674v-2.129c.006-1.168.022-1.597.058-2.406.051-1.171.235-1.971.506-2.672a5.39 5.39 0 011.265-1.95 5.381 5.381 0 011.946-1.272c.699-.274 1.498-.462 2.669-.517l.656-.03.204-.007c.718-.026 1.511-.034 3.674-.038zm.678 1.981h-1.226l-.295.001c-2.307.005-3.016.013-3.777.043l-.21.009-.457.02c-1.072.052-1.654.232-2.042.383-.513.2-.879.44-1.263.825a3.413 3.413 0 00-.82 1.267c-.15.388-.33.97-.375 2.043a48.89 48.89 0 00-.056 2.482v.398 1.565c.006 2.937.018 3.285.073 4.444.05 1.073.231 1.654.382 2.043.2.512.44.878.825 1.263.386.383.753.621 1.267.82.388.15.97.328 2.043.374.207.01.388.017.563.024l.208.007a63.28 63.28 0 002.109.026h1.564c2.938-.006 3.286-.019 4.446-.073 1.071-.051 1.654-.232 2.04-.383.514-.2.88-.44 1.264-.825.384-.386.622-.753.82-1.266.15-.389.328-.971.375-2.044.039-.88.054-1.292.057-2.723v-1.15-.572c-.006-2.936-.019-3.284-.074-4.445-.05-1.071-.23-1.654-.382-2.04-.2-.515-.44-.88-.825-1.264a3.405 3.405 0 00-1.267-.82c-.388-.15-.97-.328-2.042-.375a48.987 48.987 0 00-2.535-.056zm-1.515 3.37a5.65 5.65 0 11.021 11.299 5.65 5.65 0 01-.02-11.3zm.004 1.982a3.667 3.667 0 10.015 7.334 3.667 3.667 0 00-.015-7.334zm5.865-3.536a1.32 1.32 0 11.005 2.64 1.32 1.32 0 01-.005-2.64z",id:"a"})),(0,t.h)("g",{fill:"none","fill-rule":"evenodd"},(0,t.h)("mask",{id:"b",fill:"#fff"},(0,t.h)("use",{xlinkHref:"#a"})),(0,t.h)("image",{mask:"url(#b)",x:"4",y:"4",width:"24",height:"24",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAYAAAAehFoBAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALKADAAQAAAABAAAALAAAAAD8buejAAALZklEQVRYCVWZC2LbNhAFCRKykvP0bD1506SxRKIzbwHJoU3jv5h9WICU3P7+6zlG2zZvr8s/rW1tN7U0rMll8aDYufdzbLfc1JHmpv3jpPy8tsO+3O2s/O6YMSjTl/qdCds4mIIG60m8vdq2Z+phm2V4vAb9+o7BbZeuoM0NyYazvTvbvlN1MGjHUAesZ/IWWOsCeF0BOwAK4ITR0WYd/QKHEPv2DEymmorZtiubjOHEMYEzXmC9GMxu+95Kz+kuwxjDBKb8iUoCAdqZoAeyALreW6ZNx9Y4Jz8cLwjTZOEoR+HU05k2RzgP2iafGgfZiEdZbEr94zpX/xkPtDtGAxF+LRcgTsp9CAZg0rnEnXmPqFshY5vLnVWxLXO/bah2sZQgBZppGSe8NbjNPN5kc/WbIYEn8U+jXCOezT4zfgS1eoVEhceVeK74Fe4N6CoYEoLWykzHsd+GMAUqdTTVvvqT1uWqB3lVCLb12/ORAe8/5Zu9mp7lqoEFUCAFDIxqz7i1bq2AY1U9jqq2QK/7DYl+1AeZlAFcEc+U/jkRUqsvCHQ/nyGvjrOl6EuZWRWVGCKUMCkntQ5o+u2AZ3OxakbTcoBZnY0xhgGCUM4Kp1xtBTnBnXM5ASRms/Fs7d9OpX8bXN45pibQY/ML1MmA5G9CINBuCpdftexr6i2c5qd9J441LNJm3zk1GVusJ7v6mPJ7HPxJR0Li/vg9O1XHTEgvsQoSgExU0NnlLF0paK+6d06aOMKE2nCKV0ofNw4WsWmLsWrv6lPLnhGpr9E137QkHOMB/jh/T8MOqOadXarR44zPBW5NvDccnBxVmdK81+7RQ5p6qnQoRDZPh9+xWj0N2XpqxX1HzMty9UlFnKya/h3gulziAsyxwkSmpTIPB8vagKLyktRdDuBEHNGZMm4oCFWgjq31WPHpaC93gGNqpOpP4Ez4spa+nMNvhTWcuPKAJ79fqIxVoUvdjEG9qSy2WhpQlz61yG/gnKEA25IrIOYK6DIsQs2EE9LR/sTKq38Nd1y/X//FXG0QDHkEqSz3EYVV2dhb00rgLPSDcqmrScs55NNOD2zVqKmYnYTFnkACp520dkW5vBxK99BVzr792/iZ+VVo92UkKU2oG5WFTb6mNiA1H2C8KC0E44qaQleR3EQvQNwLrECOVAiSwM5gpF7nvDND0lZvYuQ9JbZfqdTrqCgwMcVrRS0z9QkLu9NWmkgEHb8p2zDRylj9VWA3lXD2vObEdWpT3w5MiFqQ1W/lteG4eipastxv2w+TeTBP0ypK84HiOW9fUzLcjRDwCW2b2VxmnGSKTX6uRSwMnC9YX4l05Mh2uwI+QVWdWUOSTWd5Xjjf7/tPYk2stSh053XTGN5RJMCMSajMcS8Trn3j/E1ajthlxCkmJXVi47PSUsyyq+jyexsayQNuv5GVYJaszprNsQD3RkgYiy49kFl2JlJJxlf8Uu/lpkq7+aWqzEzjr5cTVpFaJvSVr8AKRtiTlVPFk5t1nO30W+o6jrbAk76kxFa/tX+dom4C1wDPk03gqCw8HTBSxx4FHxIA+mh2pM3rKu5SNqBAuOSZnHzsB9JwW7DV/ge8dlVsOh375PvH8YO8EALU1HuecIC6qQgXifNuSx9XAoLaoGIYDjkWFrawX1U1XrknuMFw7QBSPtg79XovmBvwqnDICrhClEO6wgKFj9vPqJWlthUvdgH1DOA8+wFMexzQc5BUS1d1IsdBSjEv4Fe1LgBO1CpFPTpV1JuPSFNt4y/trzbtaUfwBWwM3/6JsrL6MSQYwLKXAm9YJBxsM8992MblZ63Gami0+rnwOMyPykVpQsyl9eYNOfVC6kRBkwaop//LgcAKWivkHF791g0JK5kMmCgKPas2QRkUFQsuTvm6R1946Wg95k764ZRLW59yO5UVGsawwELupCfAbdCuAwvcz5Xk18rIVEdgSRBRgO77R206QdXHuA2goaGiCQ0GmUfN1JlmFayjv0IcKGkfYt4HAj0yuQBRGDjzuS/rTmAf29Gov1S+FF7QBayNcpoBOEsMt3vFcIUC7VxOnE+pxmkgqEzduzwsPykrjBszCusgdarsRIAL6CM/KqsqcAf1vj8P1TXFyN6e5G8ao48fjKfDQJYizIdIfb+Xwp6Z2fE2C7mUfUEzMKqSBp4VUV1A49Sz1M2LzVzahEfyHUAcQNltR0nADYkBvHXDZQo8H9dQvHF7qhjPtSolBJ0A/vaLwdRz5YFFGoWBy8E/4aKcjqimaUBXXnjBpzOZnMlIVXsTVEBBUa+dD0BR0xVopgAD70psY0KjMHpmHB2kApea9o23NS83mpsref5OZet4U/0CMhSEDpwnxB9lVKSfk5djllXRFPizQmKcqMpnyZ3ycPntf96Ym9ChzU8vCQnhgWZ2UuySArw+cVBG4gqNCS6YoSEEziRWVStKUpe4FfCd91V0XA/qgOJuF7FpGjjyQgsFoNDtibp8cm+cyXxbB6zh4pMUO4H06yzsv4E/A6rg/uRJRnMRmrhMDIhyOjABX9CMDFhBFxx19KujjqWeim5PwVFU6IBiewfyk7IPETcg52kjXN7nsbaoEykKf/cjUgVxpTZZVtnqFMgv4FHa8oSOisawinMLHfUBzJcK1j8BeqquedKDtgcgnA4bym4P6gBWYVM3W/pn41ku5L4RElFWtlk5SXHEThhOWDiIyVROlQNM+wyHimlgATI/PPIm4BB8qfqwHnhgL89gzs+Ww1xQb4821SZ/4IwOJiRqH/X9u7Hj08JLSZfawOQcpRzwgk1oBNzzcgLn1FBNHspMENik9OG4awIDaUjw9rKNT1KXPl9neua6sSbkgqfs/CNfBdNfDDhQuL4AKXEXeOgZID91eOiRUnEFOIA5rnTkBU0/IT05gByoq5KBJF4Hym4Pxh3UcxZ7HjdhEhKWURbhavNR9rjLBwk3ryDcrGzfvk9I69b1yhMGWQ4bqMwv/RMSplQkjjVKXzZX8wESVcuB7QG0YUCMjk/aOmWgc/vC4oMCVYfghIGP6MT1zpeUhM1rQzOnGxmFKwTCir1Xaj5vN7T7nDZvnbDGHbCKnwji2zofNsOvbold3zlUtKGosBun3PbJSrrReHEaCQVCIDEMaCCBs+P+AbybkbIhmbNecGwF+E5/L2ECuPKCWsUESQkKnyyJ93TGACk7OrAY9P8XG//fGCoM7DAEUGnj5Mw7aQfelySWOm9iPuFyvrL8rKQR6mM6qdCUDQsfNPVu4yv/HaPOT1e/yDaviMKmTkg/I/F7MUG9OlrmDrBLRVd3c8KBJlPEKoVRcIJuhoQAmZDUkPC00W5OI1dOpQ1F61kFNqr9SmFcaHdBheOaDHF6QZMOP6QyiZ804oj98wLiAMIgcWw4UDYkDAWfR+4d5s0zP2GgUZX04i+NeSgYGokvbDhIZYUWHgd9K8zZzir264NxZUFbsfM1jdqpV2naA48tx6hsvBSabE4IMtlcOGgq8PqCjoly2rw2soqy4RJWQtPZl6PUCU14ZUWENuZV2Honn3f+k6R6wrkqgTStyQ0bFY+XAaafMRFgUlVeXxXFUcpLEYfZz3FrVUzZrOOJK+4B/wnIZ8TGRvb9OB8EUM0w8uNYj/oa9iK9AMoy6gA72o02srMxpAPUD+EDnVEF7P5xw896VyAbFk8MgnpVpR3gfLnt/wECq3rYFvYLcKCpqvcI+/hVl8AumXDeApklDRRKJSS+KOaq1Rgg4igOYtiQK1hJy46TBtDjznDp3iqJff5j0/LfSZbYVdauqXccJ9W+czupp0sU9gMlqkQ52lU1E6tUwoDUukAD6YRpAwqDrAErzA8QCRvXm98KEep0xIdY1CN1ye27IP0IHvvYIW18qGz8S7VWUZuMkUOb3P8DHTl67ur/i1UAAAAASUVORK5CYII="}))),this.defaultLocale=r,this.i18nInit(),this.title=this.i18n("pluginNameInstagram"),this.opts.companionAllowedHosts=(0,e.cP)(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new e.Kq(A,{companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionKeysParams:this.opts.companionKeysParams,companionCookiesRule:this.opts.companionCookiesRule,provider:"instagram",pluginId:this.id,supportsRefreshToken:!1}),this.onFirstRender=this.onFirstRender.bind(this),this.render=this.render.bind(this)}install(){this.view=new n.gi(this,{provider:this.provider,viewType:"grid",showTitles:!1,showFilter:!1,showBreadcrumbs:!1});const{target:A}=this.opts;A&&this.mount(A,this)}uninstall(){this.view.tearDown(),this.unmount()}async onFirstRender(){await Promise.all([this.provider.fetchPreAuthToken(),this.view.getFolder("recent")])}render(A){return this.view.render(A)}}o.VERSION="3.3.0"}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[595],{8106:function(t){function e(t){if(t)return function(t){for(var s in e.prototype)t[s]=e.prototype[s];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function s(){this.off(t,s),e.apply(this,arguments)}return s.fn=e,this.on(t,s),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var s,i=this._callbacks["$"+t];if(!i)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var r=0;r<i.length;r++)if((s=i[r])===e||s.fn===e){i.splice(r,1);break}return 0===i.length&&delete this._callbacks["$"+t],this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),s=this._callbacks["$"+t],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(s){i=0;for(var r=(s=s.slice(0)).length;i<r;++i)s[i].apply(this,e)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}},8595:function(t,e,s){"use strict";s.r(e),s.d(e,{COMPANION_ALLOWED_HOSTS:function(){return wt},COMPANION_URL:function(){return Pt},default:function(){return Gt}});var i=s(9420),r=s(8396),a=s(1422),o=s(2729),l=s(4626),n=s(8106),u=s(6681),h=s(5945);function p(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var c=0;function d(t){return"__private_"+c+++"_"+t}const m="ASSEMBLY_EXECUTING",y="ASSEMBLY_COMPLETED",f=["ASSEMBLY_UPLOADING",m,y];function b(t,e){return f.indexOf(t)>=f.indexOf(e)}var g=d("rateLimitedQueue"),v=d("fetchWithNetworkError"),O=d("previousFetchStatusStillPending"),_=d("sse"),P=d("onFinished"),w=d("connectServerSentEvents"),A=d("onError"),E=d("beginPolling"),S=d("fetchStatus"),j=d("diffStatus");function F(){this.emit("finished"),this.close()}function R(){p(this,_)[_]=new EventSource(`${this.status.websocket_url}?assembly=${this.status.assembly_id}`),p(this,_)[_].addEventListener("open",(()=>{clearInterval(this.pollInterval),this.pollInterval=null})),p(this,_)[_].addEventListener("message",(t=>{"assembly_finished"===t.data&&p(this,P)[P](),"assembly_uploading_finished"===t.data&&this.emit("executing"),"assembly_upload_meta_data_extracted"===t.data&&(this.emit("metadata"),p(this,S)[S]({diff:!1}))})),p(this,_)[_].addEventListener("assembly_upload_finished",(t=>{const e=JSON.parse(t.data);this.emit("upload",e),this.status.uploads.push(e)})),p(this,_)[_].addEventListener("assembly_result_finished",(t=>{var e,s;const[i,r]=JSON.parse(t.data);this.emit("result",i,r),(null!=(s=(e=this.status.results)[i])?s:e[i]=[]).push(r)})),p(this,_)[_].addEventListener("assembly_execution_progress",(t=>{const e=JSON.parse(t.data);this.emit("execution-progress",e)})),p(this,_)[_].addEventListener("assembly_error",(t=>{try{p(this,A)[A](JSON.parse(t.data))}catch{p(this,A)[A](new Error(t.data))}p(this,S)[S]({diff:!1})}))}function k(t){this.emit("error",Object.assign(new Error(t.message),t)),this.close()}function I(){this.pollInterval=setInterval((()=>{p(this,S)[S]()}),2e3)}async function L(t){let{diff:e=!0}=void 0===t?{}:t;if(!(this.closed||p(this,g)[g].isPaused||p(this,O)[O]))try{p(this,O)[O]=!0;const t=await p(this,v)[v](this.status.assembly_ssl_url);if(p(this,O)[O]=!1,this.closed)return;if(429===t.status)return void p(this,g)[g].rateLimit(2e3);if(!t.ok)return void p(this,A)[A](new u.A(t.statusText));const s=await t.json();if(this.closed)return;this.emit("status",s),e?this.updateStatus(s):this.status=s}catch(t){p(this,A)[A](t)}}function N(t,e){const s=t.ok,r=e.ok;if(e.error&&!t.error)return p(this,A)[A](e);const a=b(r,m)&&!b(s,m);a&&this.emit("executing"),Object.keys(e.uploads).filter((e=>!(0,i.A)(t.uploads,e))).forEach((t=>{this.emit("upload",e.uploads[t])})),a&&this.emit("metadata"),Object.keys(e.results).forEach((s=>{const i=e.results[s],r=t.results[s];i.filter((t=>!r||!r.some((e=>e.id===t.id)))).forEach((t=>{this.emit("result",s,t)}))})),b(r,y)&&!b(s,y)&&this.emit("finished")}var U=class extends n{constructor(t,e){super(),Object.defineProperty(this,j,{value:N}),Object.defineProperty(this,S,{value:L}),Object.defineProperty(this,E,{value:I}),Object.defineProperty(this,A,{value:k}),Object.defineProperty(this,w,{value:R}),Object.defineProperty(this,P,{value:F}),Object.defineProperty(this,g,{writable:!0,value:void 0}),Object.defineProperty(this,v,{writable:!0,value:void 0}),Object.defineProperty(this,O,{writable:!0,value:!1}),Object.defineProperty(this,_,{writable:!0,value:void 0}),this.status=t,this.pollInterval=null,this.closed=!1,p(this,g)[g]=e,p(this,v)[v]=e.wrapPromiseFunction(h.A)}connect(){p(this,w)[w](),p(this,E)[E]()}update(){return p(this,S)[S]({diff:!0})}updateStatus(t){p(this,j)[j](this.status,t),this.status=t}close(){this.closed=!0,p(this,_)[_]&&(p(this,_)[_].close(),p(this,_)[_]=null),clearInterval(this.pollInterval),this.pollInterval=null}};function T(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var $=0;function x(t){return"__private_"+$+++"_"+t}const C="/assemblies";class D extends Error{constructor(t,e,s){super(t),this.details=e,this.assembly=s}}var M=x("headers"),W=x("fetchWithNetworkError"),J=x("fetchJSON"),B=x("reportError");class z{constructor(t){Object.defineProperty(this,J,{value:Q}),Object.defineProperty(this,M,{writable:!0,value:{}}),Object.defineProperty(this,W,{writable:!0,value:void 0}),Object.defineProperty(this,B,{writable:!0,value:(t,e)=>{if(!1===this.opts.errorReporting)throw t;const s={type:e.type};throw e.assembly&&(s.assembly=e.assembly.assembly_id,s.instance=e.assembly.instance),e.url&&(s.endpoint=e.url),this.submitError(t,s).catch((()=>{})),t}}),this.opts=t,null!=this.opts.client&&(T(this,M)[M]["Transloadit-Client"]=this.opts.client),T(this,W)[W]=this.opts.rateLimitedQueue.wrapPromiseFunction(h.A)}async createAssembly(t){let{params:e,fields:s,signature:i,expectedFiles:r}=t;const a=new FormData;a.append("params","string"==typeof e?e:JSON.stringify(e)),i&&a.append("signature",i),Object.keys(s).forEach((t=>{a.append(t,String(s[t]))})),a.append("num_expected_upload_files",String(r));const o=new URL(C,`${this.opts.service}`).href;return T(this,J)[J](o,{method:"POST",headers:T(this,M)[M],body:a}).catch((t=>T(this,B)[B](t,{url:o,type:"API_ERROR"})))}async reserveFile(t,e){const s=encodeURIComponent(e.size),i=`${t.assembly_ssl_url}/reserve_file?size=${s}`;return T(this,J)[J](i,{method:"POST",headers:T(this,M)[M]}).catch((s=>T(this,B)[B](s,{assembly:t,file:e,url:i,type:"API_ERROR"})))}async addFile(t,e){if(!e.uploadURL)return Promise.reject(new Error("File does not have an `uploadURL`."));const s=encodeURIComponent(e.size),i=encodeURIComponent(e.uploadURL),r=`size=${s}&filename=${encodeURIComponent(e.name)}&fieldname=file&s3Url=${i}`,a=`${t.assembly_ssl_url}/add_file?${r}`;return T(this,J)[J](a,{method:"POST",headers:T(this,M)[M]}).catch((s=>T(this,B)[B](s,{assembly:t,file:e,url:a,type:"API_ERROR"})))}async updateNumberOfFilesInAssembly(t,e){const s=new URL(t.assembly_ssl_url);s.pathname="/update_assemblies";const i=JSON.stringify({assembly_updates:[{assembly_id:t.assembly_id,num_expected_upload_files:e}]});return T(this,J)[J](s,{method:"POST",headers:T(this,M)[M],body:i}).catch((t=>T(this,B)[B](t,{url:s,type:"API_ERROR"})))}async cancelAssembly(t){const e=t.assembly_ssl_url;return T(this,J)[J](e,{method:"DELETE",headers:T(this,M)[M]}).catch((t=>T(this,B)[B](t,{url:e,type:"API_ERROR"})))}async getAssemblyStatus(t){return T(this,J)[J](t,{headers:T(this,M)[M]}).catch((e=>T(this,B)[B](e,{url:t,type:"STATUS_ERROR"})))}async submitError(t,e){let{endpoint:s,instance:i,assembly:r}=void 0===e?{}:e;const a=t.details?`${t.message} (${t.details})`:t.message;return T(this,J)[J]("https://transloaditstatus.com/client_error",{method:"POST",body:JSON.stringify({endpoint:s,instance:i,assembly_id:r,agent:"undefined"!=typeof navigator?navigator.userAgent:"",client:this.opts.client,error:a})})}}async function Q(){const t=await T(this,W)[W](...arguments);if(429===t.status)return this.opts.rateLimitedQueue.rateLimit(2e3),T(this,J)[J](...arguments);if(!t.ok){const e=new Error(t.statusText);return e.statusCode=t.status,`${arguments.length<=0?void 0:arguments[0]}`.endsWith(C)?t.json().then((t=>{if(!t.error)throw e;const s=new D(t.error,t.message,t);throw t.assembly_id&&(s.details+=` Assembly ID: ${t.assembly_id}`),s}),(t=>{throw t.cause=e,t})):Promise.reject(e)}return t.json()}function V(t){if(null==t)throw new Error("Transloadit: The `params` option is required.");if("string"==typeof t)try{t=JSON.parse(t)}catch(t){throw new r.A("Transloadit: The `params` option is a malformed JSON string.",{cause:t})}if(!t.auth||!t.auth.key)throw new Error("Transloadit: The `params.auth.key` option is required. You can find your Transloadit API key at https://transloadit.com/c/template-credentials")}function Y(t){const e=Object.create(null);for(const{fileIDs:s,options:i}of t.filter(Boolean)){const t=JSON.stringify(i);t in e?e[t].fileIDArrays.push(s):e[t]={options:i,fileIDArrays:[s]}}return Object.values(e).map((t=>{let{options:e,fileIDArrays:s}=t;return{options:e,fileIDs:s.flat(1)}}))}async function G(t,e){const s="function"==typeof e.assemblyOptions?await e.assemblyOptions(t,e):e.assemblyOptions;V(s.params);const{fields:i}=s;return Array.isArray(i)?s.fields=null==t?{}:Object.fromEntries(i.map((e=>[e,t.meta[e]]))):null==i&&(s.fields={}),s}var q=class{constructor(t,e){this.files=t,this.opts=e}async build(){const t=this.opts;return this.files.length>0?Promise.all(this.files.map((async e=>{if(null==e)return;const s=await G(e,t);return null!=e?{fileIDs:[e.id],options:s}:void 0}))).then(Y):t.alwaysRunAssembly?[{fileIDs:[],options:await G(null,t)}]:[]}};function H(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var X=0;function Z(t){return"__private_"+X+++"_"+t}var K=Z("assemblyIDs"),tt=Z("remaining"),et=Z("resolve"),st=Z("reject"),it=Z("uppy"),rt=Z("watching"),at=Z("onAssemblyComplete"),ot=Z("onAssemblyCancel"),lt=Z("onAssemblyError"),nt=Z("onImportError"),ut=Z("checkAllComplete"),ht=Z("removeListeners"),pt=Z("addListeners");function ct(t){return-1!==H(this,K)[K].indexOf(t)}function dt(){H(this,tt)[tt]-=1,0===H(this,tt)[tt]&&(H(this,ht)[ht](),H(this,et)[et]())}function mt(){H(this,it)[it].off("transloadit:complete",H(this,at)[at]),H(this,it)[it].off("transloadit:assembly-cancel",H(this,ot)[ot]),H(this,it)[it].off("transloadit:assembly-error",H(this,lt)[lt]),H(this,it)[it].off("transloadit:import-error",H(this,nt)[nt])}function yt(){H(this,it)[it].on("transloadit:complete",H(this,at)[at]),H(this,it)[it].on("transloadit:assembly-cancel",H(this,ot)[ot]),H(this,it)[it].on("transloadit:assembly-error",H(this,lt)[lt]),H(this,it)[it].on("transloadit:import-error",H(this,nt)[nt])}var ft=class extends n{constructor(t,e){super(),Object.defineProperty(this,pt,{value:yt}),Object.defineProperty(this,ht,{value:mt}),Object.defineProperty(this,ut,{value:dt}),Object.defineProperty(this,rt,{value:ct}),Object.defineProperty(this,K,{writable:!0,value:void 0}),Object.defineProperty(this,tt,{writable:!0,value:void 0}),Object.defineProperty(this,et,{writable:!0,value:void 0}),Object.defineProperty(this,st,{writable:!0,value:void 0}),Object.defineProperty(this,it,{writable:!0,value:void 0}),Object.defineProperty(this,at,{writable:!0,value:t=>{H(this,rt)[rt](t.assembly_id)&&(H(this,it)[it].log(`[Transloadit] AssemblyWatcher: Got Assembly finish ${t.assembly_id}`),this.emit("assembly-complete",t.assembly_id),H(this,ut)[ut]())}}),Object.defineProperty(this,ot,{writable:!0,value:t=>{H(this,rt)[rt](t.assembly_id)&&H(this,ut)[ut]()}}),Object.defineProperty(this,lt,{writable:!0,value:(t,e)=>{H(this,rt)[rt](t.assembly_id)&&(H(this,it)[it].log(`[Transloadit] AssemblyWatcher: Got Assembly error ${t.assembly_id}`),H(this,it)[it].log(e),this.emit("assembly-error",t.assembly_id,e),H(this,ut)[ut]())}}),Object.defineProperty(this,nt,{writable:!0,value:(t,e,s)=>{H(this,rt)[rt](t.assembly_id)&&H(this,lt)[lt](t,s)}}),H(this,it)[it]=t,H(this,K)[K]=e,H(this,tt)[tt]=e.length,this.promise=new Promise(((t,e)=>{H(this,et)[et]=t,H(this,st)[st]=e})),H(this,pt)[pt]()}},bt={strings:{creatingAssembly:"Preparing upload...",creatingAssemblyFailed:"Transloadit: Could not create Assembly",encoding:"Encoding..."}};function gt(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var vt=0;function Ot(t){return"__private_"+vt+++"_"+t}const _t=t=>e=>{const s=new r.A("Failed to send error to the client",{cause:e});console.error(s,t)},Pt="https://api2.transloadit.com/companion",wt=/\.transloadit\.com$/,At=/https?:\/\/api2(?:-\w+)?\.transloadit\.com\/companion/,Et={service:"https://api2.transloadit.com",errorReporting:!0,waitForEncoding:!1,waitForMetadata:!1,alwaysRunAssembly:!1,importFromUploadURLs:!1,signature:null,params:null,fields:null,getAssemblyOptions:null,limit:20,retryDelays:[7e3,1e4,15e3,2e4],clientName:null};var St=Ot("rateLimitedQueue"),jt=Ot("getClientVersion"),Ft=Ot("attachAssemblyMetadata"),Rt=Ot("createAssembly"),kt=Ot("createAssemblyWatcher"),It=Ot("shouldWaitAfterUpload"),Lt=Ot("reserveFiles"),Nt=Ot("onFileUploadURLAvailable"),Ut=Ot("findFile"),Tt=Ot("onFileUploadComplete"),$t=Ot("onResult"),xt=Ot("onAssemblyFinished"),Ct=Ot("cancelAssembly"),Dt=Ot("onCancelAll"),Mt=Ot("getPersistentData"),Wt=Ot("onRestored"),Jt=Ot("connectAssembly"),Bt=Ot("prepareUpload"),zt=Ot("afterUpload"),Qt=Ot("closeAssemblyIfExists"),Vt=Ot("onError"),Yt=Ot("onTusError");class Gt extends o.A{constructor(t,e){var s,r,o;super(t,{...Et,...e}),s=this,Object.defineProperty(this,Jt,{value:oe}),Object.defineProperty(this,Ct,{value:ae}),Object.defineProperty(this,xt,{value:re}),Object.defineProperty(this,$t,{value:ie}),Object.defineProperty(this,Tt,{value:se}),Object.defineProperty(this,Ut,{value:ee}),Object.defineProperty(this,Lt,{value:te}),Object.defineProperty(this,It,{value:Kt}),Object.defineProperty(this,kt,{value:Zt}),Object.defineProperty(this,Rt,{value:Xt}),Object.defineProperty(this,Ft,{value:Ht}),Object.defineProperty(this,jt,{value:qt}),Object.defineProperty(this,St,{writable:!0,value:void 0}),Object.defineProperty(this,Nt,{writable:!0,value:t=>{var e;const s=this.uppy.getFile(t.id);if(null==s||null==(e=s.transloadit)||!e.assembly)return;const{assemblies:i}=this.getPluginState(),r=i[s.transloadit.assembly];this.client.addFile(r,s).catch((t=>{this.uppy.log(t),this.uppy.emit("transloadit:import-error",r,s.id,t)}))}}),Object.defineProperty(this,Dt,{writable:!0,value:async function(t){let{reason:e}=void 0===t?{}:t;try{if("user"!==e)return;const{uploadsAssemblies:t}=s.getPluginState(),i=Object.values(t).flat(1).map((t=>s.getAssembly(t)));await Promise.all(i.map((t=>gt(s,Ct)[Ct](t))))}catch(t){s.uppy.log(t)}}}),Object.defineProperty(this,Mt,{writable:!0,value:t=>{const{assemblies:e,uploadsAssemblies:s}=this.getPluginState();t({[this.id]:{assemblies:e,uploadsAssemblies:s}})}}),Object.defineProperty(this,Wt,{writable:!0,value:t=>{const e=t&&t[this.id]?t[this.id]:{},s=e.assemblies||{},i=e.uploadsAssemblies||{};if(0===Object.keys(i).length)return;const r=t=>{const e={},s=[];for(const[i,r]of Object.entries(t)){r.uploads.forEach((t=>{const s=gt(this,Ut)[Ut](t);e[t.id]={id:s.id,assembly:i,uploadedFile:t}}));const t=this.getPluginState();Object.keys(r.results).forEach((e=>{for(const a of r.results[e]){const r=t.files[a.original_id];a.localId=r?r.id:null,s.push({id:a.id,result:a,stepName:e,assembly:i})}}))}this.setPluginState({assemblies:t,files:e,results:s,uploadsAssemblies:i})},a=()=>{const{assemblies:t,uploadsAssemblies:e}=this.getPluginState();Object.keys(e).forEach((t=>{const s=e[t];gt(this,kt)[kt](s,t)})),Object.keys(t).forEach((e=>{const s=new U(t[e],gt(this,St)[St]);gt(this,Jt)[Jt](s)}))},o=()=>{const{assemblies:t}=this.getPluginState();return Promise.all(Object.keys(t).map((t=>this.activeAssemblies[t].update())))};this.restored=Promise.resolve().then((()=>{r(s),a(),o()})),this.restored.then((()=>{this.restored=null}))}}),Object.defineProperty(this,Bt,{writable:!0,value:async(t,e)=>{const s=t.map((t=>this.uppy.getFile(t))),i=s.filter((t=>!t.error&&(this.uppy.emit("preprocess-progress",t,{mode:"indeterminate",message:this.i18n("creatingAssembly")}),!0))),r=async t=>{let{fileIDs:s,options:i}=t;try{const t=await gt(this,Rt)[Rt](s,e,i);return this.opts.importFromUploadURLs&&await gt(this,Lt)[Lt](t,s),s.forEach((t=>{const e=this.uppy.getFile(t);this.uppy.emit("preprocess-complete",e)})),t}catch(t){throw s.forEach((e=>{const s=this.uppy.getFile(e);this.uppy.emit("preprocess-complete",s),this.uppy.emit("upload-error",s,t)})),t}},{uploadsAssemblies:a}=this.getPluginState();this.setPluginState({uploadsAssemblies:{...a,[e]:[]}});const o=new q(i,this.opts);await o.build().then((t=>Promise.all(t.map(r)))).then((t=>{const s=t.filter(Boolean),i=s.map((t=>t.status.assembly_id));return gt(this,kt)[kt](i,e),Promise.all(s.map((t=>gt(this,Jt)[Jt](t))))})).catch((t=>{throw i.forEach((e=>{this.uppy.emit("preprocess-complete",e),this.uppy.emit("upload-error",e,t)})),t}))}}),Object.defineProperty(this,zt,{writable:!0,value:(t,e)=>{const s=t.map((t=>this.uppy.getFile(t))),r=s.filter((t=>!t.error)).map((t=>t.id)),a=this.getPluginState();if(this.restored)return this.restored.then((()=>gt(this,zt)[zt](r,e)));const o=a.uploadsAssemblies[e],l=()=>{o.forEach((t=>{this.activeAssemblies[t].close(),delete this.activeAssemblies[t]}))};if(!gt(this,It)[It]()){l();const t=o.map((t=>this.getAssembly(t)));return this.uppy.addResultData(e,{transloadit:t}),Promise.resolve()}return 0===o.length?(this.uppy.addResultData(e,{transloadit:[]}),Promise.resolve()):(s.filter((t=>!(0,i.A)(this.completedFiles,t.id))).forEach((t=>{this.uppy.emit("postprocess-progress",t,{mode:"indeterminate",message:this.i18n("encoding")})})),this.assemblyWatchers[e].promise.then((()=>{l();const t=o.map((t=>this.getAssembly(t))),s={...this.getPluginState().uploadsAssemblies};delete s[e],this.setPluginState({uploadsAssemblies:s}),this.uppy.addResultData(e,{transloadit:t})})))}}),Object.defineProperty(this,Qt,{writable:!0,value:t=>{var e;t&&(null==(e=this.activeAssemblies[t])||e.close())}}),Object.defineProperty(this,Vt,{writable:!0,value:t=>{this.client.submitError(t).catch(_t(t))}}),Object.defineProperty(this,Yt,{writable:!0,value:(t,e)=>{var s,i;if(gt(this,Qt)[Qt](null==t||null==(s=t.transloadit)?void 0:s.assembly),null!=e&&null!=(i=e.message)&&i.startsWith("tus: ")){var r;const t=null==(r=e.originalRequest)||null==(r=r.getUnderlyingObject())?void 0:r.responseURL;this.client.submitError(e,{endpoint:t}).catch(_t(e))}}}),this.type="uploader",this.id=this.opts.id||"Transloadit",this.defaultLocale=bt,null!=(r=this.opts).assemblyOptions||(r.assemblyOptions=null!=(o=this.opts.getAssemblyOptions)?o:{params:this.opts.params,signature:this.opts.signature,fields:this.opts.fields}),null!=(null==e?void 0:e.params)&&null==e.getAssemblyOptions&&null==e.assemblyOptions&&V(this.opts.assemblyOptions.params),gt(this,St)[St]=new a.i(this.opts.limit),this.i18nInit(),this.client=new z({service:this.opts.service,client:gt(this,jt)[jt](),errorReporting:this.opts.errorReporting,rateLimitedQueue:gt(this,St)[St]}),this.activeAssemblies={},this.assemblyWatchers={},this.completedFiles=Object.create(null)}install(){this.uppy.addPreProcessor(gt(this,Bt)[Bt]),this.uppy.addPostProcessor(gt(this,zt)[zt]),this.uppy.on("error",gt(this,Vt)[Vt]),this.uppy.on("cancel-all",gt(this,Dt)[Dt]),this.uppy.on("upload-error",gt(this,Yt)[Yt]),this.opts.importFromUploadURLs?this.uppy.on("upload-success",gt(this,Nt)[Nt]):this.uppy.use(l.default,{storeFingerprintForResuming:!1,allowedMetaFields:["assembly_url","filename","fieldname"],limit:this.opts.limit,rateLimitedQueue:gt(this,St)[St],retryDelays:this.opts.retryDelays}),this.uppy.on("restore:get-data",gt(this,Mt)[Mt]),this.uppy.on("restored",gt(this,Wt)[Wt]),this.setPluginState({assemblies:{},uploadsAssemblies:{},files:{},results:[]});const{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,individualCancellation:!1}})}uninstall(){this.uppy.removePreProcessor(gt(this,Bt)[Bt]),this.uppy.removePostProcessor(gt(this,zt)[zt]),this.uppy.off("error",gt(this,Vt)[Vt]),this.opts.importFromUploadURLs&&this.uppy.off("upload-success",gt(this,Nt)[Nt]);const{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,individualCancellation:!0}})}getAssembly(t){const{assemblies:e}=this.getPluginState();return e[t]}getAssemblyFiles(t){return this.uppy.getFiles().filter((e=>{var s;return(null==e||null==(s=e.transloadit)?void 0:s.assembly)===t}))}}function qt(){const t=[`uppy-core:${this.uppy.constructor.VERSION}`,`uppy-transloadit:${this.constructor.VERSION}`,`uppy-tus:${l.default.VERSION}`],e=(e,s)=>{const i=this.uppy.getPlugin(e);i&&t.push(`${s}:${i.constructor.VERSION}`)};return this.opts.importFromUploadURLs&&(e("XHRUpload","uppy-xhr-upload"),e("AwsS3","uppy-aws-s3"),e("AwsS3Multipart","uppy-aws-s3-multipart")),e("Dropbox","uppy-dropbox"),e("Box","uppy-box"),e("Facebook","uppy-facebook"),e("GoogleDrive","uppy-google-drive"),e("Instagram","uppy-instagram"),e("OneDrive","uppy-onedrive"),e("Zoom","uppy-zoom"),e("Url","uppy-url"),null!=this.opts.clientName&&t.push(this.opts.clientName),t.join(",")}function Ht(t,e){const s={...t.meta,assembly_url:e.assembly_url,filename:t.name,fieldname:"file"},i={...t.tus,endpoint:e.tus_url,addRequestId:!0};let{remote:r}=t;if(t.remote&&At.test(t.remote.companionUrl)){const s=e.companion_url.replace(/\/$/,""),i=t.remote.url.replace(t.remote.companionUrl,"").replace(/^\//,"");r={...t.remote,companionUrl:s,url:`${s}/${i}`}}const a={...t,transloadit:{assembly:e.assembly_id}};return this.opts.importFromUploadURLs||Object.assign(a,{meta:s,tus:i,remote:r}),a}function Xt(t,e,s){return this.uppy.log("[Transloadit] Create Assembly"),this.client.createAssembly({...s,expectedFiles:t.length}).then((async s=>{const i=this.uppy.getFiles().filter((e=>{let{id:s}=e;return t.includes(s)}));if(i.length!==t.length){if(0===i.length)return await this.client.cancelAssembly(s),null;await this.client.updateNumberOfFilesInAssembly(s,i.length)}const r=new U(s,gt(this,St)[St]),{status:a}=r,o=a.assembly_id,{assemblies:l,uploadsAssemblies:n}=this.getPluginState();this.setPluginState({assemblies:{...l,[o]:a},uploadsAssemblies:{...n,[e]:[...n[e],o]}});const u={};i.forEach((t=>{u[t.id]=gt(this,Ft)[Ft](t,a)})),this.uppy.setState({files:{...this.uppy.getState().files,...u}});const h=(t,e)=>{var i;if("ASSEMBLY_COMPLETED"!==(null==(i=r.status)?void 0:i.ok)){if("cancel-all"===e)r.close(),this.uppy.off("file-removed",h);else if(t.id in u){delete u[t.id];const e=Object.keys(u).length;0===e?(r.close(),gt(this,Ct)[Ct](s).catch((()=>{})),this.uppy.off("file-removed",h)):this.client.updateNumberOfFilesInAssembly(s,e).catch((()=>{}))}}else this.uppy.off("file-removed",h)};return this.uppy.on("file-removed",h),this.uppy.emit("transloadit:assembly-created",a,t),this.uppy.log(`[Transloadit] Created Assembly ${o}`),r})).catch((t=>{const e=new r.A(`${this.i18n("creatingAssemblyFailed")}: ${t.message}`,{cause:t});throw"details"in t&&(e.details=t.details),"assembly"in t&&(e.assembly=t.assembly),e}))}function Zt(t,e){const s=Array.isArray(t)?t:[t],i=new ft(this.uppy,s);i.on("assembly-complete",(t=>{this.getAssemblyFiles(t).forEach((t=>{this.completedFiles[t.id]=!0,this.uppy.emit("postprocess-complete",t)}))})),i.on("assembly-error",((t,e)=>{const s=this.getAssemblyFiles(t);s.forEach((t=>{this.uppy.emit("upload-error",t,e),this.uppy.emit("postprocess-complete",t)}));const i={...this.uppy.getState().files};s.forEach((t=>delete i[t.id].tus)),this.uppy.setState({files:i}),this.uppy.emit("error",e)})),this.assemblyWatchers[e]=i}function Kt(){return this.opts.waitForEncoding||this.opts.waitForMetadata}function te(t,e){return Promise.all(e.map((e=>{const s=this.uppy.getFile(e);return this.client.reserveFile(t.status,s)})))}function ee(t){const e=this.uppy.getFiles();for(let s=0;s<e.length;s++){const i=e[s];if(i.uploadURL===t.tus_upload_url)return i;if(i.tus&&i.tus.uploadUrl===t.tus_upload_url)return i;if(!t.is_tus_file&&i.name===t.name&&i.size===t.size)return i}}function se(t,e){const s=this.getPluginState(),i=gt(this,Ut)[Ut](e);i?(this.setPluginState({files:{...s.files,[e.id]:{assembly:t,id:i.id,uploadedFile:e}}}),this.uppy.emit("transloadit:upload",e,this.getAssembly(t))):this.uppy.log("[Transloadit] Couldn’t find the file, it was likely removed in the process")}function ie(t,e,s){const i=this.getPluginState(),r=i.files[s.original_id];s.localId=r?r.id:null;const a={result:s,stepName:e,id:s.id,assembly:t};this.setPluginState({results:[...i.results,a]}),this.uppy.emit("transloadit:result",e,s,this.getAssembly(t))}function re(t){const e=t.assembly_ssl_url;this.client.getAssemblyStatus(e).then((t=>{const e=t.assembly_id,s=this.getPluginState();this.setPluginState({assemblies:{...s.assemblies,[e]:t}}),this.uppy.emit("transloadit:complete",t)}))}async function ae(t){await this.client.cancelAssembly(t),this.uppy.emit("transloadit:assembly-cancelled",t)}function oe(t){const{status:e}=t,s=e.assembly_id;return this.activeAssemblies[s]=t,t.on("status",(t=>{const{assemblies:e}=this.getPluginState();this.setPluginState({assemblies:{...e,[s]:t}})})),t.on("upload",(t=>{gt(this,Tt)[Tt](s,t)})),t.on("error",(e=>{e.assembly=t.status,this.uppy.emit("transloadit:assembly-error",t.status,e)})),t.on("executing",(()=>{this.uppy.emit("transloadit:assembly-executing",t.status)})),t.on("execution-progress",(t=>{if(this.uppy.emit("transloadit:execution-progress",t),null!=t.progress_combined)for(const e of this.uppy.getFiles())this.uppy.emit("postprocess-progress",e,{mode:"determinate",value:t.progress_combined/100,message:this.i18n("encoding")})})),this.opts.waitForEncoding&&t.on("result",((t,e)=>{gt(this,$t)[$t](s,t,e)})),this.opts.waitForEncoding?t.on("finished",(()=>{gt(this,xt)[xt](t.status)})):this.opts.waitForMetadata&&t.on("metadata",(()=>{gt(this,xt)[xt](t.status)})),"ASSEMBLY_COMPLETE"===t.ok||t.connect(),t}Gt.VERSION="3.6.0",Gt.COMPANION=Pt,Gt.COMPANION_PATTERN=wt},8396:function(t,e,s){"use strict";var i=s(9420);class r extends Error{constructor(t,e){super(t),this.cause=null==e?void 0:e.cause,this.cause&&(0,i.A)(this.cause,"isNetworkError")?this.isNetworkError=this.cause.isNetworkError:this.isNetworkError=!1}}e.A=r},5945:function(t,e,s){"use strict";s.d(e,{A:function(){return r}});var i=s(6681);function r(){return fetch(...arguments).catch((t=>{throw"AbortError"===t.name?t:new i.A(t)}))}}}]);
@@ -1,2 +0,0 @@
1
- /*! For license information please see 626.c42d15c2.chunk.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[626],{1359:function(e,t){var r=Object.prototype.hasOwnProperty;function n(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function o(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var n,i,a=[];for(i in"string"!=typeof t&&(t="?"),e)if(r.call(e,i)){if((n=e[i])||null!=n&&!isNaN(n)||(n=""),i=o(i),n=o(n),null===i||null===n)continue;a.push(i+"="+n)}return a.length?t+a.join("&"):""},t.parse=function(e){for(var t,r=/([^=?#&]+)=?([^&]*)/g,o={};t=r.exec(e);){var i=n(t[1]),a=n(t[2]);null===i||null===a||i in o||(o[i]=a)}return o}},3062:function(e){e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},2225:function(e,t,r){var n=r(3062),o=r(1359),i=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,a=/[\n\r\t]/g,u=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,s=/:\d+$/,l=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,c=/^[a-zA-Z]:/;function f(e){return(e||"").toString().replace(i,"")}var p=[["#","hash"],["?","query"],function(e,t){return y(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function d(e){var t,n=("undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{}).location||{},o={},i=typeof(e=e||n);if("blob:"===e.protocol)o=new m(unescape(e.pathname),{});else if("string"===i)for(t in o=new m(e,{}),h)delete o[t];else if("object"===i){for(t in e)t in h||(o[t]=e[t]);void 0===o.slashes&&(o.slashes=u.test(e.href))}return o}function y(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function v(e,t){e=(e=f(e)).replace(a,""),t=t||{};var r,n=l.exec(e),o=n[1]?n[1].toLowerCase():"",i=!!n[2],u=!!n[3],s=0;return i?u?(r=n[2]+n[3]+n[4],s=n[2].length+n[3].length):(r=n[2]+n[4],s=n[2].length):u?(r=n[3]+n[4],s=n[3].length):r=n[4],"file:"===o?s>=2&&(r=r.slice(2)):y(o)?r=n[4]:o?i&&(r=r.slice(2)):s>=2&&y(t.protocol)&&(r=n[4]),{protocol:o,slashes:i||y(o),slashesCount:s,rest:r}}function m(e,t,r){if(e=(e=f(e)).replace(a,""),!(this instanceof m))return new m(e,t,r);var i,u,s,l,h,g,b=p.slice(),w=typeof t,_=this,S=0;for("object"!==w&&"string"!==w&&(r=t,t=null),r&&"function"!=typeof r&&(r=o.parse),i=!(u=v(e||"",t=d(t))).protocol&&!u.slashes,_.slashes=u.slashes||i&&t.slashes,_.protocol=u.protocol||t.protocol||"",e=u.rest,("file:"===u.protocol&&(2!==u.slashesCount||c.test(e))||!u.slashes&&(u.protocol||u.slashesCount<2||!y(_.protocol)))&&(b[3]=[/(.*)/,"pathname"]);S<b.length;S++)"function"!=typeof(l=b[S])?(s=l[0],g=l[1],s!=s?_[g]=e:"string"==typeof s?~(h="@"===s?e.lastIndexOf(s):e.indexOf(s))&&("number"==typeof l[2]?(_[g]=e.slice(0,h),e=e.slice(h+l[2])):(_[g]=e.slice(h),e=e.slice(0,h))):(h=s.exec(e))&&(_[g]=h[1],e=e.slice(0,h.index)),_[g]=_[g]||i&&l[3]&&t[g]||"",l[4]&&(_[g]=_[g].toLowerCase())):e=l(e,_);r&&(_.query=r(_.query)),i&&t.slashes&&"/"!==_.pathname.charAt(0)&&(""!==_.pathname||""!==t.pathname)&&(_.pathname=function(e,t){if(""===e)return t;for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),n=r.length,o=r[n-1],i=!1,a=0;n--;)"."===r[n]?r.splice(n,1):".."===r[n]?(r.splice(n,1),a++):a&&(0===n&&(i=!0),r.splice(n,1),a--);return i&&r.unshift(""),"."!==o&&".."!==o||r.push(""),r.join("/")}(_.pathname,t.pathname)),"/"!==_.pathname.charAt(0)&&y(_.protocol)&&(_.pathname="/"+_.pathname),n(_.port,_.protocol)||(_.host=_.hostname,_.port=""),_.username=_.password="",_.auth&&(~(h=_.auth.indexOf(":"))?(_.username=_.auth.slice(0,h),_.username=encodeURIComponent(decodeURIComponent(_.username)),_.password=_.auth.slice(h+1),_.password=encodeURIComponent(decodeURIComponent(_.password))):_.username=encodeURIComponent(decodeURIComponent(_.auth)),_.auth=_.password?_.username+":"+_.password:_.username),_.origin="file:"!==_.protocol&&y(_.protocol)&&_.host?_.protocol+"//"+_.host:"null",_.href=_.toString()}m.prototype={set:function(e,t,r){var i=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(r||o.parse)(t)),i[e]=t;break;case"port":i[e]=t,n(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,s.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!r;break;case"pathname":case"hash":if(t){var a="pathname"===e?"/":"#";i[e]=t.charAt(0)!==a?a+t:t}else i[e]=t;break;case"username":case"password":i[e]=encodeURIComponent(t);break;case"auth":var u=t.indexOf(":");~u?(i.username=t.slice(0,u),i.username=encodeURIComponent(decodeURIComponent(i.username)),i.password=t.slice(u+1),i.password=encodeURIComponent(decodeURIComponent(i.password))):i.username=encodeURIComponent(decodeURIComponent(t))}for(var l=0;l<p.length;l++){var c=p[l];c[4]&&(i[c[1]]=i[c[1]].toLowerCase())}return i.auth=i.password?i.username+":"+i.password:i.username,i.origin="file:"!==i.protocol&&y(i.protocol)&&i.host?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"==typeof e||(e=o.stringify);var t,r=this,n=r.host,i=r.protocol;i&&":"!==i.charAt(i.length-1)&&(i+=":");var a=i+(r.protocol&&r.slashes||y(r.protocol)?"//":"");return r.username?(a+=r.username,r.password&&(a+=":"+r.password),a+="@"):r.password?(a+=":"+r.password,a+="@"):"file:"!==r.protocol&&y(r.protocol)&&!n&&"/"!==r.pathname&&(a+="@"),(":"===n[n.length-1]||s.test(r.hostname)&&!r.port)&&(n+=":"),a+=n+r.pathname,(t="object"==typeof r.query?e(r.query):r.query)&&(a+="?"!==t.charAt(0)?"?"+t:t),r.hash&&(a+=r.hash),a}},m.extractProtocol=v,m.location=d,m.trimLeft=f,m.qs=o,e.exports=m},4626:function(e,t,r){r.r(t),r.d(t,{default:function(){return ot}});var n=r(2729);const o="function"==typeof Buffer,i=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),a=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),u=((e=>{let t={};e.forEach(((e,r)=>t[e]=r))})(a),String.fromCharCode.bind(String)),s=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_"))),l="function"==typeof btoa?e=>btoa(e):o?e=>Buffer.from(e,"binary").toString("base64"):e=>{let t,r,n,o,i="";const u=e.length%3;for(let u=0;u<e.length;){if((r=e.charCodeAt(u++))>255||(n=e.charCodeAt(u++))>255||(o=e.charCodeAt(u++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|o,i+=a[t>>18&63]+a[t>>12&63]+a[t>>6&63]+a[63&t]}return u?i.slice(0,u-3)+"===".substring(u):i},c=o?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(u.apply(null,e.subarray(r,r+4096)));return l(t.join(""))},f=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?u(192|t>>>6)+u(128|63&t):u(224|t>>>12&15)+u(128|t>>>6&63)+u(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return u(240|t>>>18&7)+u(128|t>>>12&63)+u(128|t>>>6&63)+u(128|63&t)},p=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,h=o?e=>Buffer.from(e,"utf8").toString("base64"):i?e=>c(i.encode(e)):e=>l(e.replace(p,f)),d=(e,t=!1)=>t?s(h(e)):h(e);var y=r(2225),v=r.n(y);function m(e){return m="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},m(e)}function g(e){var t="function"==typeof Map?new Map:void 0;return g=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;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,r)}function r(){return b(e,arguments,S(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),_(r,e)},g(e)}function b(e,t,r){return b=w()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&_(o,r.prototype),o},b.apply(null,arguments)}function w(){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 _(e,t){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_(e,t)}function S(e){return S=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},S(e)}var U=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&&_(e,t)}(i,e);var t,r,n,o=(r=i,n=w(),function(){var e,t=S(r);if(n){var o=S(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===m(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)}(this,e)});function i(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).originalRequest=n,t.originalResponse=a,t.causingError=r,null!=r&&(e+=", caused by ".concat(r.toString())),null!=n){var u=n.getHeader("X-Request-ID")||"n/a",s=n.getMethod(),l=n.getURL(),c=a?a.getStatus():"n/a",f=a?a.getBody()||"":"n/a";e+=", originated from request (method: ".concat(s,", url: ").concat(l,", response code: ").concat(c,", response text: ").concat(f,", request id: ").concat(u,")")}return t.message=e,t}return t=i,Object.defineProperty(t,"prototype",{writable:!1}),t}(g(Error)),P=U;function O(){O=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),u=new C(n||[]);return o(a,"_invoke",{value:x(e,r,u)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var _=Object.getPrototypeOf,S=_&&_(_(T([])));S&&S!==r&&n.call(S,a)&&(w=S);var U=b.prototype=m.prototype=Object.create(w);function P(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,u){var s=f(e[o],e,i);if("throw"!==s.type){var l=s.arg,c=l.value;return c&&"object"==R(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function x(t,r,n){var o=p;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var s=j(u,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?y:h,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function j(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,j(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(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 L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function T(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(R(t)+" is not iterable")}return g.prototype=b,o(U,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,s,"GeneratorFunction")),e.prototype=Object.create(U),e},t.awrap=function(e){return{__await:e}},P(E.prototype),l(E.prototype,u,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},P(U),l(U,s,"Generator"),l(U,a,(function(){return this})),l(U,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=T,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(L),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(s&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):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),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function E(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,o)}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);s=!0);}catch(e){l=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return j(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?j(e,t):void 0}}(e,t)||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 j(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function R(e){return R="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},R(e)}function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function L(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){C(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function C(e,t,r){return(t=q(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function T(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,q(n.key),n)}}function q(e){var t=function(e,t){if("object"!==R(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==R(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===R(t)?t:String(t)}var A={endpoint:null,uploadUrl:null,metadata:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:M,chunkSize:1/0,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null},D=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"resume"in r&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=r,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=t,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}var t,r,n;return t=e,r=[{key:"findPreviousUploads",value:function(){var e=this;return this.options.fingerprint(this.file,this.options).then((function(t){return e._urlStorage.findUploadsByFingerprint(t)}))}},{key:"resumeFromPreviousUpload",value:function(e){this.url=e.uploadUrl||null,this._parallelUploadUrls=e.parallelUploadUrls||null,this._urlStorageKey=e.urlStorageKey}},{key:"start",value:function(){var e=this,t=this.file;if(t)if(this.options.endpoint||this.options.uploadUrl||this.url){var r=this.options.retryDelays;if(null==r||"[object Array]"===Object.prototype.toString.call(r)){if(this.options.parallelUploads>1)for(var n=0,o=["uploadUrl","uploadSize","uploadLengthDeferred"];n<o.length;n++){var i=o[n];if(this.options[i])return void this._emitError(new Error("tus: cannot use the ".concat(i," option when parallelUploads is enabled")))}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1)return void this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length)return void this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"))}this.options.fingerprint(t,this.options).then((function(r){return null==r||"Calculated fingerprint: ".concat(r),e._fingerprint=r,e._source?e._source:e.options.fileReader.openFile(t,e.options.chunkSize)})).then((function(t){if(e._source=t,e.options.uploadLengthDeferred)e._size=null;else if(null!=e.options.uploadSize){if(e._size=Number(e.options.uploadSize),Number.isNaN(e._size))return void e._emitError(new Error("tus: cannot convert `uploadSize` option into a number"))}else if(e._size=e._source.size,null==e._size)return void e._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));e.options.parallelUploads>1||null!=e._parallelUploadUrls?e._startParallelUpload():e._startSingleUpload()})).catch((function(t){e._emitError(t)}))}else this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"))}else this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));else this._emitError(new Error("tus: no file or stream to upload provided"))}},{key:"_startParallelUpload",value:function(){var t,r=this,n=this._size,o=0;this._parallelUploads=[];var i=null!=this._parallelUploadUrls?this._parallelUploadUrls.length:this.options.parallelUploads,a=null!==(t=this.options.parallelUploadBoundaries)&&void 0!==t?t:function(e,t){for(var r=Math.floor(e/t),n=[],o=0;o<t;o++)n.push({start:r*o,end:r*(o+1)});return n[t-1].end=e,n}(this._source.size,i);this._parallelUploadUrls&&a.forEach((function(e,t){e.uploadUrl=r._parallelUploadUrls[t]||null})),this._parallelUploadUrls=new Array(a.length);var u,s=a.map((function(t,i){var u=0;return r._source.slice(t.start,t.end).then((function(s){var l=s.value;return new Promise((function(s,c){var f=L(L({},r.options),{},{uploadUrl:t.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:{},headers:L(L({},r.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:s,onError:c,onProgress:function(e){o=o-u+e,u=e,r._emitProgress(o,n)},onUploadUrlAvailable:function(){r._parallelUploadUrls[i]=p.url,r._parallelUploadUrls.filter((function(e){return Boolean(e)})).length===a.length&&r._saveUploadInUrlStorage()}}),p=new e(l,f);p.start(),r._parallelUploads.push(p)}))}))}));Promise.all(s).then((function(){(u=r._openRequest("POST",r.options.endpoint)).setHeader("Upload-Concat","final;".concat(r._parallelUploadUrls.join(" ")));var e=F(r.options.metadata);return""!==e&&u.setHeader("Upload-Metadata",e),r._sendRequest(u,null)})).then((function(e){if(z(e.getStatus(),200)){var t=e.getHeader("Location");null!=t?(r.url=G(r.options.endpoint,t),"Created upload at ".concat(r.url),r._emitSuccess()):r._emitHttpError(u,e,"tus: invalid or missing Location header")}else r._emitHttpError(u,e,"tus: unexpected response while creating upload")})).catch((function(e){r._emitError(e)}))}},{key:"_startSingleUpload",value:function(){return this._aborted=!1,null!=this.url?("Resuming upload from previous URL: ".concat(this.url),void this._resumeUpload()):null!=this.options.uploadUrl?("Resuming upload from provided URL: ".concat(this.options.uploadUrl),this.url=this.options.uploadUrl,void this._resumeUpload()):void this._createUpload()}},{key:"abort",value:function(t){var r=this;return null!=this._parallelUploads&&this._parallelUploads.forEach((function(e){e.abort(t)})),null!==this._req&&this._req.abort(),this._aborted=!0,null!=this._retryTimeout&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),t&&null!=this.url?e.terminate(this.url,this.options).then((function(){return r._removeFromUrlStorage()})):Promise.resolve()}},{key:"_emitHttpError",value:function(e,t,r,n){this._emitError(new P(r,n,e,t))}},{key:"_emitError",value:function(e){var t=this;if(!this._aborted){if(null!=this.options.retryDelays&&(null!=this._offset&&this._offset>this._offsetBeforeRetry&&(this._retryAttempt=0),B(e,this._retryAttempt,this.options))){var r=this.options.retryDelays[this._retryAttempt++];return this._offsetBeforeRetry=this._offset,void(this._retryTimeout=setTimeout((function(){t.start()}),r))}if("function"!=typeof this.options.onError)throw e;this.options.onError(e)}}},{key:"_emitSuccess",value:function(){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),"function"==typeof this.options.onSuccess&&this.options.onSuccess()}},{key:"_emitProgress",value:function(e,t){"function"==typeof this.options.onProgress&&this.options.onProgress(e,t)}},{key:"_emitChunkComplete",value:function(e,t,r){"function"==typeof this.options.onChunkComplete&&this.options.onChunkComplete(e,t,r)}},{key:"_createUpload",value:function(){var e=this;if(this.options.endpoint){var t=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?t.setHeader("Upload-Defer-Length",1):t.setHeader("Upload-Length",this._size);var r,n=F(this.options.metadata);""!==n&&t.setHeader("Upload-Metadata",n),this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,r=this._addChunkToRequest(t)):r=this._sendRequest(t,null),r.then((function(r){if(z(r.getStatus(),200)){var n=r.getHeader("Location");if(null!=n){if(e.url=G(e.options.endpoint,n),"Created upload at ".concat(e.url),"function"==typeof e.options.onUploadUrlAvailable&&e.options.onUploadUrlAvailable(),0===e._size)return e._emitSuccess(),void e._source.close();e._saveUploadInUrlStorage().then((function(){e.options.uploadDataDuringCreation?e._handleUploadResponse(t,r):(e._offset=0,e._performUpload())}))}else e._emitHttpError(t,r,"tus: invalid or missing Location header")}else e._emitHttpError(t,r,"tus: unexpected response while creating upload")})).catch((function(r){e._emitHttpError(t,null,"tus: failed to create upload",r)}))}else this._emitError(new Error("tus: unable to create upload because no endpoint is provided"))}},{key:"_resumeUpload",value:function(){var e=this,t=this._openRequest("HEAD",this.url);this._sendRequest(t,null).then((function(r){var n=r.getStatus();if(!z(n,200))return 423===n?void e._emitHttpError(t,r,"tus: upload is currently locked; retry later"):(z(n,400)&&e._removeFromUrlStorage(),e.options.endpoint?(e.url=null,void e._createUpload()):void e._emitHttpError(t,r,"tus: unable to resume upload (new upload cannot be created without an endpoint)"));var o=parseInt(r.getHeader("Upload-Offset"),10);if(Number.isNaN(o))e._emitHttpError(t,r,"tus: invalid or missing offset value");else{var i=parseInt(r.getHeader("Upload-Length"),10);!Number.isNaN(i)||e.options.uploadLengthDeferred?("function"==typeof e.options.onUploadUrlAvailable&&e.options.onUploadUrlAvailable(),e._saveUploadInUrlStorage().then((function(){if(o===i)return e._emitProgress(i,i),void e._emitSuccess();e._offset=o,e._performUpload()}))):e._emitHttpError(t,r,"tus: invalid or missing length value")}})).catch((function(r){e._emitHttpError(t,null,"tus: failed to resume upload",r)}))}},{key:"_performUpload",value:function(){var e,t=this;this._aborted||(this.options.overridePatchMethod?(e=this._openRequest("POST",this.url)).setHeader("X-HTTP-Method-Override","PATCH"):e=this._openRequest("PATCH",this.url),e.setHeader("Upload-Offset",this._offset),this._addChunkToRequest(e).then((function(r){z(r.getStatus(),200)?t._handleUploadResponse(e,r):t._emitHttpError(e,r,"tus: unexpected response while uploading chunk")})).catch((function(r){t._aborted||t._emitHttpError(e,null,"tus: failed to upload chunk at offset ".concat(t._offset),r)})))}},{key:"_addChunkToRequest",value:function(e){var t=this,r=this._offset,n=this._offset+this.options.chunkSize;return e.setProgressHandler((function(e){t._emitProgress(r+e,t._size)})),e.setHeader("Content-Type","application/offset+octet-stream"),(n===1/0||n>this._size)&&!this.options.uploadLengthDeferred&&(n=this._size),this._source.slice(r,n).then((function(r){var n=r.value,o=r.done,i=n&&n.size?n.size:0;t.options.uploadLengthDeferred&&o&&(t._size=t._offset+i,e.setHeader("Upload-Length",t._size));var a=t._offset+i;return!t.options.uploadLengthDeferred&&o&&a!==t._size?Promise.reject(new Error("upload was configured with a size of ".concat(t._size," bytes, but the source is done after ").concat(a," bytes"))):null===n?t._sendRequest(e):(t._emitProgress(t._offset,t._size),t._sendRequest(e,n))}))}},{key:"_handleUploadResponse",value:function(e,t){var r=parseInt(t.getHeader("Upload-Offset"),10);if(Number.isNaN(r))this._emitHttpError(e,t,"tus: invalid or missing offset value");else{if(this._emitProgress(r,this._size),this._emitChunkComplete(r-this._offset,r,this._size),this._offset=r,r===this._size)return this._emitSuccess(),void this._source.close();this._performUpload()}}},{key:"_openRequest",value:function(e,t){var r=H(e,t,this.options);return this._req=r,r}},{key:"_removeFromUrlStorage",value:function(){var e=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch((function(t){e._emitError(t)})),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var e=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||null!==this._urlStorageKey)return Promise.resolve();var t={size:this._size,metadata:this.options.metadata,creationTime:(new Date).toString()};return this._parallelUploads?t.parallelUploadUrls=this._parallelUploadUrls:t.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,t).then((function(t){e._urlStorageKey=t}))}},{key:"_sendRequest",value:function(e){return I(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,this.options)}}],n=[{key:"terminate",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=H("DELETE",t,r);return I(n,null,r).then((function(e){if(204!==e.getStatus())throw new P("tus: unexpected response while terminating upload",null,n,e)})).catch((function(o){if(o instanceof P||(o=new P("tus: failed to terminate upload",o,n,null)),!B(o,0,r))throw o;var i=r.retryDelays[0],a=r.retryDelays.slice(1),u=L(L({},r),{},{retryDelays:a});return new Promise((function(e){return setTimeout(e,i)})).then((function(){return e.terminate(t,u)}))}))}}],r&&T(t.prototype,r),n&&T(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function F(e){return Object.entries(e).map((function(e){var t=x(e,2),r=t[0],n=t[1];return"".concat(r," ").concat(d(String(n)))})).join(",")}function z(e,t){return e>=t&&e<t+100}function H(e,t,r){var n=r.httpStack.createRequest(e,t);n.setHeader("Tus-Resumable","1.0.0");var o=r.headers||{};if(Object.entries(o).forEach((function(e){var t=x(e,2),r=t[0],o=t[1];n.setHeader(r,o)})),r.addRequestId){var i="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}));n.setHeader("X-Request-ID",i)}return n}function I(e,t,r){return N.apply(this,arguments)}function N(){var e;return e=O().mark((function e(t,r,n){var o;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof n.onBeforeRequest){e.next=3;break}return e.next=3,n.onBeforeRequest(t);case 3:return e.next=5,t.send(r);case 5:if(o=e.sent,"function"!=typeof n.onAfterResponse){e.next=9;break}return e.next=9,n.onAfterResponse(t,o);case 9:return e.abrupt("return",o);case 10:case"end":return e.stop()}}),e)})),N=function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){E(i,n,o,a,u,"next",e)}function u(e){E(i,n,o,a,u,"throw",e)}a(void 0)}))},N.apply(this,arguments)}function B(e,t,r){return!(null==r.retryDelays||t>=r.retryDelays.length||null==e.originalRequest)&&(r&&"function"==typeof r.onShouldRetry?r.onShouldRetry(e,t,r):M(e))}function M(e){var t,r=e.originalResponse?e.originalResponse.getStatus():0;return(!z(r,400)||409===r||423===r)&&(t=!0,"undefined"!=typeof window&&"navigator"in window&&!1===window.navigator.onLine&&(t=!1),t)}function G(e,t){return new(v())(t,e).toString()}D.defaultOptions=A;var K=D;function X(e){return X="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},X(e)}function $(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Y(n.key),n)}}function Y(e){var t=function(e,t){if("object"!==X(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==X(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===X(t)?t:String(t)}var J=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,(r=[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(e){return Promise.resolve([])}},{key:"removeUpload",value:function(e){return Promise.resolve()}},{key:"addUpload",value:function(e,t){return Promise.resolve(null)}}])&&$(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Q(e){return Q="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},Q(e)}function Z(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,V(n.key),n)}}function V(e){var t=function(e,t){if("object"!==Q(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Q(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Q(t)?t:String(t)}var W=!1;try{W="localStorage"in window;var ee="tusSupport",te=localStorage.getItem(ee);localStorage.setItem(ee,te),null===te&&localStorage.removeItem(ee)}catch(e){if(e.code!==e.SECURITY_ERR&&e.code!==e.QUOTA_EXCEEDED_ERR)throw e;W=!1}var re=W,ne=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,r=[{key:"findAllUploads",value:function(){var e=this._findEntries("tus::");return Promise.resolve(e)}},{key:"findUploadsByFingerprint",value:function(e){var t=this._findEntries("tus::".concat(e,"::"));return Promise.resolve(t)}},{key:"removeUpload",value:function(e){return localStorage.removeItem(e),Promise.resolve()}},{key:"addUpload",value:function(e,t){var r=Math.round(1e12*Math.random()),n="tus::".concat(e,"::").concat(r);return localStorage.setItem(n,JSON.stringify(t)),Promise.resolve(n)}},{key:"_findEntries",value:function(e){for(var t=[],r=0;r<localStorage.length;r++){var n=localStorage.key(r);if(0===n.indexOf(e))try{var o=JSON.parse(localStorage.getItem(n));o.urlStorageKey=n,t.push(o)}catch(e){}}return t}}],r&&Z(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function oe(e){return oe="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},oe(e)}function ie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ae(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,se(n.key),n)}}function ue(e,t,r){return t&&ae(e.prototype,t),r&&ae(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function se(e){var t=function(e,t){if("object"!==oe(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==oe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===oe(t)?t:String(t)}var le=function(){function e(){ie(this,e)}return ue(e,[{key:"createRequest",value:function(e,t){return new ce(e,t)}},{key:"getName",value:function(){return"XHRHttpStack"}}]),e}(),ce=function(){function e(t,r){ie(this,e),this._xhr=new XMLHttpRequest,this._xhr.open(t,r,!0),this._method=t,this._url=r,this._headers={}}return ue(e,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(e,t){this._xhr.setRequestHeader(e,t),this._headers[e]=t}},{key:"getHeader",value:function(e){return this._headers[e]}},{key:"setProgressHandler",value:function(e){"upload"in this._xhr&&(this._xhr.upload.onprogress=function(t){t.lengthComputable&&e(t.loaded)})}},{key:"send",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return new Promise((function(r,n){e._xhr.onload=function(){r(new fe(e._xhr))},e._xhr.onerror=function(e){n(e)},e._xhr.send(t)}))}},{key:"abort",value:function(){return this._xhr.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._xhr}}]),e}(),fe=function(){function e(t){ie(this,e),this._xhr=t}return ue(e,[{key:"getStatus",value:function(){return this._xhr.status}},{key:"getHeader",value:function(e){return this._xhr.getResponseHeader(e)}},{key:"getBody",value:function(){return this._xhr.responseText}},{key:"getUnderlyingObject",value:function(){return this._xhr}}]),e}(),pe=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase()};function he(e){return new Promise((function(t,r){var n=new XMLHttpRequest;n.responseType="blob",n.onload=function(){var e=n.response;t(e)},n.onerror=function(e){r(e)},n.open("GET",e),n.send()}))}function de(e){return de="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},de(e)}function ye(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ve(n.key),n)}}function ve(e){var t=function(e,t){if("object"!==de(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==de(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===de(t)?t:String(t)}var me=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._file=t,this.size=t.size}var t,r;return t=e,(r=[{key:"slice",value:function(e,t){if("undefined"!=typeof window&&(void 0!==window.PhoneGap||void 0!==window.Cordova||void 0!==window.cordova))return r=this._file.slice(e,t),new Promise((function(e,t){var n=new FileReader;n.onload=function(){var t=new Uint8Array(n.result);e({value:t})},n.onerror=function(e){t(e)},n.readAsArrayBuffer(r)}));var r,n=this._file.slice(e,t),o=t>=this.size;return Promise.resolve({value:n,done:o})}},{key:"close",value:function(){}}])&&ye(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ge(e){return ge="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},ge(e)}function be(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,we(n.key),n)}}function we(e){var t=function(e,t){if("object"!==ge(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ge(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ge(t)?t:String(t)}function _e(e){return void 0===e?0:void 0!==e.size?e.size:e.length}var Se=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._buffer=void 0,this._bufferOffset=0,this._reader=t,this._done=!1}var t,r;return t=e,(r=[{key:"slice",value:function(e,t){return e<this._bufferOffset?Promise.reject(new Error("Requested data is before the reader's current offset")):this._readUntilEnoughDataOrDone(e,t)}},{key:"_readUntilEnoughDataOrDone",value:function(e,t){var r=this,n=t<=this._bufferOffset+_e(this._buffer);if(this._done||n){var o=this._getDataFromBuffer(e,t),i=null==o&&this._done;return Promise.resolve({value:o,done:i})}return this._reader.read().then((function(n){var o=n.value;return n.done?r._done=!0:void 0===r._buffer?r._buffer=o:r._buffer=function(e,t){if(e.concat)return e.concat(t);if(e instanceof Blob)return new Blob([e,t],{type:e.type});if(e.set){var r=new e.constructor(e.length+t.length);return r.set(e),r.set(t,e.length),r}throw new Error("Unknown data type")}(r._buffer,o),r._readUntilEnoughDataOrDone(e,t)}))}},{key:"_getDataFromBuffer",value:function(e,t){e>this._bufferOffset&&(this._buffer=this._buffer.slice(e-this._bufferOffset),this._bufferOffset=e);var r=0===_e(this._buffer);return this._done&&r?null:this._buffer.slice(0,t-e)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel()}}])&&be(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ue(e){return Ue="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},Ue(e)}function Pe(){Pe=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),u=new k(n||[]);return o(a,"_invoke",{value:E(e,r,u)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var _=Object.getPrototypeOf,S=_&&_(_(L([])));S&&S!==r&&n.call(S,a)&&(w=S);var U=b.prototype=m.prototype=Object.create(w);function P(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function r(o,i,a,u){var s=f(e[o],e,i);if("throw"!==s.type){var l=s.arg,c=l.value;return c&&"object"==Ue(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function E(t,r,n){var o=p;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var s=x(u,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?y:h,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function x(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,x(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function j(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 R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function L(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(Ue(t)+" is not iterable")}return g.prototype=b,o(U,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,s,"GeneratorFunction")),e.prototype=Object.create(U),e},t.awrap=function(e){return{__await:e}},P(O.prototype),l(O.prototype,u,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new O(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},P(U),l(U,s,"Generator"),l(U,a,(function(){return this})),l(U,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=L,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(s&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):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),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),R(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function Oe(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,o)}function Ee(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,xe(n.key),n)}}function xe(e){var t=function(e,t){if("object"!==Ue(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Ue(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ue(t)?t:String(t)}var je=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r,n,o;return t=e,r=[{key:"openFile",value:(n=Pe().mark((function e(t,r){var n;return Pe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!pe()||!t||void 0===t.uri){e.next=11;break}return e.prev=1,e.next=4,he(t.uri);case 4:return n=e.sent,e.abrupt("return",new me(n));case 8:throw e.prev=8,e.t0=e.catch(1),new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. ".concat(e.t0));case 11:if("function"!=typeof t.slice||void 0===t.size){e.next=13;break}return e.abrupt("return",Promise.resolve(new me(t)));case 13:if("function"!=typeof t.read){e.next=18;break}if(r=Number(r),Number.isFinite(r)){e.next=17;break}return e.abrupt("return",Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option")));case 17:return e.abrupt("return",Promise.resolve(new Se(t,r)));case 18:return e.abrupt("return",Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment")));case 19:case"end":return e.stop()}}),e,null,[[1,8]])})),o=function(){var e=this,t=arguments;return new Promise((function(r,o){var i=n.apply(e,t);function a(e){Oe(i,r,o,a,u,"next",e)}function u(e){Oe(i,r,o,a,u,"throw",e)}a(void 0)}))},function(e,t){return o.apply(this,arguments)})}],r&&Ee(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Re(e){return Re="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},Re(e)}function ke(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,De(n.key),n)}}function Le(e,t){return Le=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Le(e,t)}function Ce(e){return Ce=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ce(e)}function Te(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function qe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(r),!0).forEach((function(t){Ae(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Te(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ae(e,t,r){return(t=De(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function De(e){var t=function(e,t){if("object"!==Re(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==Re(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Re(t)?t:String(t)}var Fe=qe(qe({},K.defaultOptions),{},{httpStack:new le,fileReader:new je,urlStorage:re?new ne:new J,fingerprint:function(e,t){return pe()?Promise.resolve(function(e,t){var r=e.exif?function(e){var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t&=t;return t}(JSON.stringify(e.exif)):"noexif";return["tus-rn",e.name||"noname",e.size||"nosize",r,t.endpoint].join("/")}(e,t)):Promise.resolve(["tus-br",e.name,e.type,e.size,e.lastModified,t.endpoint].join("-"))}}),ze=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&&Le(e,t)}(a,e);var t,r,n,o,i=(n=a,o=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(){var e,t=Ce(n);if(o){var r=Ce(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Re(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)}(this,e)});function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),t=qe(qe({},Fe),t),i.call(this,e,t)}return t=a,r=[{key:"terminate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t=qe(qe({},Fe),t),K.terminate(e,t)}}],null&&ke(t.prototype,null),r&&ke(t,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(K),He=window,Ie=He.XMLHttpRequest,Ne=He.Blob,Be=(Ie&&Ne&&Ne.prototype.slice,r(4528)),Me=r(6681),Ge=r(7853),Ke=r(1422),Xe=r(9420),$e=r(8284);function Ye(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var Je=0;function Qe(e){return"__private_"+Je+++"_"+e}const Ze={endpoint:"",uploadUrl:null,metadata:{},uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,overridePatchMethod:!1,headers:{},addRequestId:!1,chunkSize:1/0,retryDelays:[100,1e3,3e3,5e3],parallelUploads:1,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1},Ve={limit:20,retryDelays:Ze.retryDelays,withCredentials:!1};var We=Qe("retryDelayIterator"),et=Qe("uploadLocalFile"),tt=Qe("getCompanionClientArgs"),rt=Qe("uploadFiles"),nt=Qe("handleUpload");class ot extends n.A{constructor(e,t){var r,n;if(super(e,{...Ve,...t}),Object.defineProperty(this,rt,{value:ut}),Object.defineProperty(this,tt,{value:at}),Object.defineProperty(this,et,{value:it}),Object.defineProperty(this,We,{writable:!0,value:void 0}),Object.defineProperty(this,nt,{writable:!0,value:async e=>{if(0===e.length)return void this.uppy.log("[Tus] No files to upload");0===this.opts.limit&&this.uppy.log("[Tus] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/tus/#limit-0","warning"),this.uppy.log("[Tus] Uploading...");const t=this.uppy.getFilesByIds(e);await Ye(this,rt)[rt](t)}}),this.type="uploader",this.id=this.opts.id||"Tus",void 0===(null==t?void 0:t.allowedMetaFields)&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");if("autoRetry"in t)throw new Error("The `autoRetry` option was deprecated and has been removed.");this.requests=null!=(r=this.opts.rateLimitedQueue)?r:new Ke.i(this.opts.limit),Ye(this,We)[We]=null==(n=this.opts.retryDelays)?void 0:n.values(),this.uploaders=Object.create(null),this.uploaderEvents=Object.create(null),this.handleResetProgress=this.handleResetProgress.bind(this)}handleResetProgress(){const e={...this.uppy.getState().files};Object.keys(e).forEach((t=>{var r;if(null!=(r=e[t])&&null!=(r=r.tus)&&r.uploadUrl){const r={...e[t].tus};delete r.uploadUrl,e[t]={...e[t],tus:r}}})),this.uppy.setState({files:e})}resetUploaderReferences(e,t){const r=this.uploaders[e];r&&(r.abort(),null!=t&&t.abort&&r.abort(!0),this.uploaders[e]=null),this.uploaderEvents[e]&&(this.uploaderEvents[e].remove(),this.uploaderEvents[e]=null)}onReceiveUploadUrl(e,t){const r=this.uppy.getFile(e.id);r&&(r.tus&&r.tus.uploadUrl===t||(this.uppy.log("[Tus] Storing upload url"),this.uppy.setFileState(r.id,{tus:{...r.tus,uploadUrl:t}})))}install(){this.uppy.setState({capabilities:{...this.uppy.getState().capabilities,resumableUploads:!0}}),this.uppy.addUploader(Ye(this,nt)[nt]),this.uppy.on("reset-progress",this.handleResetProgress)}uninstall(){this.uppy.setState({capabilities:{...this.uppy.getState().capabilities,resumableUploads:!1}}),this.uppy.removeUploader(Ye(this,nt)[nt])}}function it(e){var t=this;return this.resetUploaderReferences(e.id),new Promise(((r,n)=>{let o,i,a;const u={...this.opts,...e.tus||{}};"function"==typeof u.headers&&(u.headers=u.headers(e));const{onShouldRetry:s,onBeforeRequest:l,...c}=u,f={...Ze,...c};var p;f.fingerprint=(p=e,(e,t)=>{if("undefined"!=typeof window&&(void 0!==window.PhoneGap||void 0!==window.Cordova||void 0!==window.cordova)||"undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase())return Fe.fingerprint(e,t);const r=["tus",p.id,t.endpoint].join("-");return Promise.resolve(r)}),f.onBeforeRequest=async t=>{let r;if(t.getUnderlyingObject().withCredentials=!!u.withCredentials,"function"==typeof l&&(r=l(t,e)),(0,Xe.A)(o,"shouldBeRequeued")){if(!o.shouldBeRequeued)return Promise.reject();let t;const n=new Promise((e=>{t=e}));return o=this.requests.run((()=>(e.isPaused&&o.abort(),t(),()=>{}))),void await Promise.all([n,r])}return r},f.onError=t=>{var r;this.uppy.log(t);const i=null!=t.originalRequest?t.originalRequest.getUnderlyingObject():null;(0,Ge.A)(i)&&(t=new Me.A(t,i)),this.resetUploaderReferences(e.id),null==(r=o)||r.abort(),this.uppy.emit("upload-error",e,t),"function"==typeof u.onError&&u.onError(t),n(t)},f.onProgress=(t,r)=>{this.onReceiveUploadUrl(e,a.url),"function"==typeof u.onProgress&&u.onProgress(t,r),this.uppy.emit("upload-progress",this.uppy.getFile(e.id),{uploader:this,bytesUploaded:t,bytesTotal:r})},f.onSuccess=()=>{var t;const n={uploadURL:null!=(t=a.url)?t:void 0,status:200,body:{}};if(this.resetUploaderReferences(e.id),o.done(),this.uppy.emit("upload-success",this.uppy.getFile(e.id),n),a.url){const{name:e}=a.file;this.uppy.log(`Download ${e} from ${a.url}`)}"function"==typeof u.onSuccess&&u.onSuccess(),r(a)};const h=e=>{var t;const r=null==e||null==(t=e.originalResponse)?void 0:t.getStatus();if(429===r){if(!this.requests.isPaused){var n;const e=null==(n=Ye(this,We)[We])?void 0:n.next();if(null==e||e.done)return!1;this.requests.rateLimit(e.value)}}else{if(null!=r&&r>400&&r<500&&409!==r&&423!==r)return!1;"undefined"!=typeof navigator&&!1===navigator.onLine&&(this.requests.isPaused||(this.requests.pause(),window.addEventListener("online",(()=>{this.requests.resume()}),{once:!0})))}return o.abort(),o={shouldBeRequeued:!0,abort(){this.shouldBeRequeued=!1},done(){throw new Error("Cannot mark a queued request as done: this indicates a bug")},fn(){throw new Error("Cannot run a queued request: this indicates a bug")}},!0};f.onShouldRetry=null!=s?(e,t)=>s(e,t,u,h):h;const d=(e,t,r)=>{(0,Xe.A)(e,t)&&!(0,Xe.A)(e,r)&&(e[r]=e[t])},y={};(Array.isArray(u.allowedMetaFields)?u.allowedMetaFields:Object.keys(e.meta)).forEach((t=>{y[t]=String(e.meta[t])})),d(y,"type","filetype"),d(y,"name","filename"),f.metadata=y,a=new ze(e.data,f),this.uploaders[e.id]=a;const v=new Be.A(this.uppy);this.uploaderEvents[e.id]=v,i=()=>(e.isPaused||a.start(),()=>{}),a.findPreviousUploads().then((t=>{const r=t[0];r&&(this.uppy.log(`[Tus] Resuming upload of ${e.id} started at ${r.creationTime}`),a.resumeFromPreviousUpload(r))})),o=this.requests.run(i),v.onFileRemove(e.id,(t=>{o.abort(),this.resetUploaderReferences(e.id,{abort:!!a.url}),r(`upload ${t} was removed`)})),v.onPause(e.id,(e=>{o.abort(),e?a.abort():o=this.requests.run(i)})),v.onPauseAll(e.id,(()=>{o.abort(),a.abort()})),v.onCancelAll(e.id,(function(n){let{reason:i}=void 0===n?{}:n;"user"===i&&(o.abort(),t.resetUploaderReferences(e.id,{abort:!!a.url})),r(`upload ${e.id} was canceled`)})),v.onResumeAll(e.id,(()=>{o.abort(),e.error&&a.abort(),o=this.requests.run(i)}))})).catch((t=>{throw this.uppy.emit("upload-error",e,t),t}))}function at(e){var t;const r={...this.opts};return e.tus&&Object.assign(r,e.tus),{...null==(t=e.remote)?void 0:t.body,endpoint:r.endpoint,uploadUrl:r.uploadUrl,protocol:"tus",size:e.data.size,headers:r.headers,metadata:e.meta}}async function ut(e){const t=(0,$e.Y)(e),r=(0,$e.S)(t);this.uppy.emit("upload-start",r),await Promise.allSettled(t.map((e=>{if(e.isRemote){const t=()=>this.requests,r=new AbortController,n=t=>{t.id===e.id&&r.abort()};this.uppy.on("file-removed",n);const o=this.uppy.getRequestClientForFile(e).uploadRemoteFile(e,Ye(this,tt)[tt](e),{signal:r.signal,getQueue:t});return this.requests.wrapSyncFunction((()=>{this.uppy.off("file-removed",n)}),{priority:-1})(),o}return Ye(this,et)[et](e)})))}ot.VERSION="3.5.4"},9420:function(e,t,r){function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.d(t,{A:function(){return n}})}}]);
@@ -1 +0,0 @@
1
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[784],{5611:function(e){e.exports=s,e.exports.isMobile=s,e.exports.default=s;const t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,i=/CrOS/,o=/android|ipad|playbook|silk/i;function s(e){e||(e={});let s=e.ua;if(s||"undefined"==typeof navigator||(s=navigator.userAgent),s&&s.headers&&"string"==typeof s.headers["user-agent"]&&(s=s.headers["user-agent"]),"string"!=typeof s)return!1;let r=t.test(s)&&!i.test(s)||!!e.tablet&&o.test(s);return!r&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==s.indexOf("Macintosh")&&-1!==s.indexOf("Safari")&&(r=!0),r}},6784:function(e,t,i){i.r(t),i.d(t,{default:function(){return L}});var o=i(5181),s=i(7496);const r={__proto__:null,"audio/mp3":"mp3","audio/mp4":"mp4","audio/ogg":"ogg","audio/webm":"webm","image/gif":"gif","image/heic":"heic","image/heif":"heif","image/jpeg":"jpg","image/png":"png","image/svg+xml":"svg","video/mp4":"mp4","video/ogg":"ogv","video/quicktime":"mov","video/webm":"webm","video/x-matroska":"mkv","video/x-msvideo":"avi"};function n(e){return[e]=e.split(";",1),r[e]||null}var a=i(7544),c=i(5611);function d(){return(0,o.h)("svg",{"aria-hidden":"true",focusable:"false",fill:"#0097DC",width:"66",height:"55",viewBox:"0 0 66 55"},(0,o.h)("path",{d:"M57.3 8.433c4.59 0 8.1 3.51 8.1 8.1v29.7c0 4.59-3.51 8.1-8.1 8.1H8.7c-4.59 0-8.1-3.51-8.1-8.1v-29.7c0-4.59 3.51-8.1 8.1-8.1h9.45l4.59-7.02c.54-.54 1.35-1.08 2.16-1.08h16.2c.81 0 1.62.54 2.16 1.08l4.59 7.02h9.45zM33 14.64c-8.62 0-15.393 6.773-15.393 15.393 0 8.62 6.773 15.393 15.393 15.393 8.62 0 15.393-6.773 15.393-15.393 0-8.62-6.773-15.393-15.393-15.393zM33 40c-5.648 0-9.966-4.319-9.966-9.967 0-5.647 4.318-9.966 9.966-9.966s9.966 4.319 9.966 9.966C42.966 35.681 38.648 40 33 40z",fillRule:"evenodd"}))}function h(e){let{onSnapshot:t,i18n:i}=e;return(0,o.h)("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--picture",type:"button",title:i("takePicture"),"aria-label":i("takePicture"),onClick:t,"data-uppy-super-focusable":!0},d())}function u(e){let{recording:t,onStartRecording:i,onStopRecording:s,i18n:r}=e;return t?(0,o.h)("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:r("stopRecording"),"aria-label":r("stopRecording"),onClick:s,"data-uppy-super-focusable":!0},(0,o.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},(0,o.h)("rect",{x:"15",y:"15",width:"70",height:"70"}))):(0,o.h)("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:r("startRecording"),"aria-label":r("startRecording"),onClick:i,"data-uppy-super-focusable":!0},(0,o.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},(0,o.h)("circle",{cx:"50",cy:"50",r:"40"})))}function p(e){let{recordingLengthSeconds:t,i18n:i}=e;const s=(r=t,`${Math.floor(r/60)}:${String(r%60).padStart(2,"0")}`);var r;return(0,o.h)("span",{"aria-label":i("recordingLength",{recording_length:s})},s)}var l=function(e){let{onSubmit:t,i18n:i}=e;return(0,o.h)("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--submit",type:"button",title:i("submitRecordedFile"),"aria-label":i("submitRecordedFile"),onClick:t,"data-uppy-super-focusable":!0},(0,o.h)("svg",{width:"12",height:"9",viewBox:"0 0 12 9",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon"},(0,o.h)("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"})))},g=function(e){let{onDiscard:t,i18n:i}=e;return(0,o.h)("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--discard",type:"button",title:i("discardRecordedFile"),"aria-label":i("discardRecordedFile"),onClick:t,"data-uppy-super-focusable":!0},(0,o.h)("svg",{width:"13",height:"13",viewBox:"0 0 13 13",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon"},(0,o.h)("g",{fill:"#FFF",fillRule:"evenodd"},(0,o.h)("path",{d:"M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z"}),(0,o.h)("path",{d:"M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z"}))))};function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},m.apply(this,arguments)}function v(e,t){return e.includes(t)}class b extends o.uA{componentDidMount(){const{onFocus:e}=this.props;e()}componentWillUnmount(){const{onStop:e}=this.props;e()}render(){const{src:e,recordedVideo:t,recording:i,modes:s,supportsRecording:r,videoSources:n,showVideoSourceDropdown:a,showRecordingLength:c,onSubmit:d,i18n:b,mirror:f,onSnapshot:y,onStartRecording:w,onStopRecording:S,onDiscardRecordedVideo:R,recordingLengthSeconds:C}=this.props,k=!!t,P=!k&&r&&(v(s,"video-only")||v(s,"audio-only")||v(s,"video-audio")),M=!k&&v(s,"picture"),I=r&&c&&!k,T=a&&n&&n.length>1,x={playsInline:!0};return t?(x.muted=!1,x.controls=!0,x.src=t,this.videoElement&&(this.videoElement.srcObject=null)):(x.muted=!0,x.autoPlay=!0,x.srcObject=e),(0,o.h)("div",{className:"uppy uppy-Webcam-container"},(0,o.h)("div",{className:"uppy-Webcam-videoContainer"},(0,o.h)("video",m({ref:e=>this.videoElement=e,className:"uppy-Webcam-video "+(f?"uppy-Webcam-video--mirrored":"")},x))),(0,o.h)("div",{className:"uppy-Webcam-footer"},(0,o.h)("div",{className:"uppy-Webcam-videoSourceContainer"},T?function(e){let{currentDeviceId:t,videoSources:i,onChangeVideoSource:s}=e;return(0,o.h)("div",{className:"uppy-Webcam-videoSource"},(0,o.h)("select",{className:"uppy-u-reset uppy-Webcam-videoSource-select",onChange:e=>{s(e.target.value)}},i.map((e=>(0,o.h)("option",{key:e.deviceId,value:e.deviceId,selected:e.deviceId===t},e.label)))))}(this.props):null),(0,o.h)("div",{className:"uppy-Webcam-buttonContainer"},M&&(0,o.h)(h,{onSnapshot:y,i18n:b}),P&&(0,o.h)(u,{recording:i,onStartRecording:w,onStopRecording:S,i18n:b}),k&&(0,o.h)(l,{onSubmit:d,i18n:b}),k&&(0,o.h)(g,{onDiscard:R,i18n:b})),(0,o.h)("div",{className:"uppy-Webcam-recordingLength"},I&&(0,o.h)(p,{recordingLengthSeconds:C,i18n:b}))))}}var f=b;function y(e){let{icon:t,i18n:i,hasCamera:s}=e;return(0,o.h)("div",{className:"uppy-Webcam-permissons"},(0,o.h)("div",{className:"uppy-Webcam-permissonsIcon"},t()),(0,o.h)("h1",{className:"uppy-Webcam-title"},i(s?"allowAccessTitle":"noCameraTitle")),(0,o.h)("p",null,i(s?"allowAccessDescription":"noCameraDescription")))}var w={strings:{pluginNameCamera:"Camera",noCameraTitle:"Camera Not Available",noCameraDescription:"In order to take pictures or record video, please connect a camera device",recordingStoppedMaxSize:"Recording stopped because the file size is about to exceed the limit",submitRecordedFile:"Submit recorded file",discardRecordedFile:"Discard recorded file",smile:"Smile!",takePicture:"Take a picture",startRecording:"Begin video recording",stopRecording:"Stop video recording",recordingLength:"Recording length %{recording_length}",allowAccessTitle:"Please allow access to your camera",allowAccessDescription:"In order to take pictures or record video with your camera, please allow camera access for this site."}};function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},S.apply(this,arguments)}function R(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var C=0;function k(e){return"__private_"+C+++"_"+e}function P(e){return"."===e[0]?a.A[e.slice(1)]:e}function M(e){return/^video\/[^*]+$/.test(e)}function I(e){return/^image\/[^*]+$/.test(e)}function T(e,t){return e.includes(t)}const x={onBeforeSnapshot:()=>Promise.resolve(),countdown:!1,modes:["video-audio","video-only","audio-only","picture"],mirror:!0,showVideoSourceDropdown:!1,facingMode:"user",preferredImageMimeType:null,preferredVideoMimeType:null,showRecordingLength:!1,mobileNativeCamera:c({tablet:!0})};var V=k("enableMirror");class L extends s.A{constructor(e,t){super(e,{...x,...t}),Object.defineProperty(this,V,{writable:!0,value:void 0}),this.mediaDevices=navigator.mediaDevices,this.supportsUserMedia=!!this.mediaDevices,this.protocol=location.protocol.match(/https/i)?"https":"http",this.id=this.opts.id||"Webcam",this.type="acquirer",this.capturedMediaFile=null,this.icon=()=>(0,o.h)("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},(0,o.h)("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383",fillRule:"nonzero"})),this.defaultLocale=w,this.i18nInit(),this.title=this.i18n("pluginNameCamera"),R(this,V)[V]=this.opts.mirror,this.install=this.install.bind(this),this.setPluginState=this.setPluginState.bind(this),this.render=this.render.bind(this),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.takeSnapshot=this.takeSnapshot.bind(this),this.startRecording=this.startRecording.bind(this),this.stopRecording=this.stopRecording.bind(this),this.discardRecordedVideo=this.discardRecordedVideo.bind(this),this.submit=this.submit.bind(this),this.oneTwoThreeSmile=this.oneTwoThreeSmile.bind(this),this.focus=this.focus.bind(this),this.changeVideoSource=this.changeVideoSource.bind(this),this.webcamActive=!1,this.opts.countdown&&(this.opts.onBeforeSnapshot=this.oneTwoThreeSmile),this.setPluginState({hasCamera:!1,cameraReady:!1,cameraError:null,recordingLengthSeconds:0,videoSources:[],currentDeviceId:null})}setOptions(e){super.setOptions({...e,videoConstraints:{...this.opts.videoConstraints,...null==e?void 0:e.videoConstraints}})}hasCameraCheck(){return this.mediaDevices?this.mediaDevices.enumerateDevices().then((e=>e.some((e=>"videoinput"===e.kind)))):Promise.resolve(!1)}isAudioOnly(){return 1===this.opts.modes.length&&"audio-only"===this.opts.modes[0]}getConstraints(e){void 0===e&&(e=null);const t=-1!==this.opts.modes.indexOf("video-audio")||-1!==this.opts.modes.indexOf("audio-only"),i=!this.isAudioOnly()&&(-1!==this.opts.modes.indexOf("video-audio")||-1!==this.opts.modes.indexOf("video-only")||-1!==this.opts.modes.indexOf("picture")),o={...this.opts.videoConstraints||{facingMode:this.opts.facingMode},...e?{deviceId:e,facingMode:null}:{}};return{audio:t,video:!!i&&o}}start(e){var t;if(void 0===e&&(e=null),!this.supportsUserMedia)return Promise.reject(new Error("Webcam access not supported"));this.webcamActive=!0,this.opts.mirror&&(R(this,V)[V]=!0);const i=this.getConstraints(null==(t=e)?void 0:t.deviceId);this.hasCameraCheck().then((t=>(this.setPluginState({hasCamera:t}),this.mediaDevices.getUserMedia(i).then((t=>{this.stream=t;let i=null;const o=this.isAudioOnly()?t.getAudioTracks():t.getVideoTracks();e&&e.deviceId?o.forEach((t=>{t.getSettings().deviceId===e.deviceId&&(i=t.getSettings().deviceId)})):i=o[0].getSettings().deviceId,this.updateVideoSources(),this.setPluginState({currentDeviceId:i,cameraReady:!0})})).catch((e=>{this.setPluginState({cameraReady:!1,cameraError:e}),this.uppy.info(e.message,"error")})))))}getMediaRecorderOptions(){const e={};if(MediaRecorder.isTypeSupported){const{restrictions:t}=this.uppy.opts;let i=[];this.opts.preferredVideoMimeType?i=[this.opts.preferredVideoMimeType]:t.allowedFileTypes&&(i=t.allowedFileTypes.map(P).filter(M));const o=e=>MediaRecorder.isTypeSupported(e)&&n(e),s=i.filter(o);s.length>0&&(e.mimeType=s[0])}return e}startRecording(){this.recorder=new MediaRecorder(this.stream,this.getMediaRecorderOptions()),this.recordingChunks=[];let e=!1;this.recorder.addEventListener("dataavailable",(t=>{this.recordingChunks.push(t.data);const{restrictions:i}=this.uppy.opts;if(this.recordingChunks.length>1&&null!=i.maxFileSize&&!e){const t=this.recordingChunks.reduce(((e,t)=>e+t.size),0),o=(t-this.recordingChunks[0].size)/(this.recordingChunks.length-1)*3;t>Math.max(0,i.maxFileSize-o)&&(e=!0,this.uppy.info(this.i18n("recordingStoppedMaxSize"),"warning",4e3),this.stopRecording())}})),this.recorder.start(500),this.opts.showRecordingLength&&(this.recordingLengthTimer=setInterval((()=>{const e=this.getPluginState().recordingLengthSeconds;this.setPluginState({recordingLengthSeconds:e+1})}),1e3)),this.setPluginState({isRecording:!0})}stopRecording(){return new Promise((e=>{this.recorder.addEventListener("stop",(()=>{e()})),this.recorder.stop(),this.opts.showRecordingLength&&(clearInterval(this.recordingLengthTimer),this.setPluginState({recordingLengthSeconds:0}))})).then((()=>(this.setPluginState({isRecording:!1}),this.getVideo()))).then((e=>{try{this.capturedMediaFile=e,this.setPluginState({recordedVideo:URL.createObjectURL(e.data)}),R(this,V)[V]=!1}catch(e){e.isRestriction||this.uppy.log(e)}})).then((()=>{this.recordingChunks=null,this.recorder=null}),(e=>{throw this.recordingChunks=null,this.recorder=null,e}))}discardRecordedVideo(){this.setPluginState({recordedVideo:null}),this.opts.mirror&&(R(this,V)[V]=!0),this.capturedMediaFile=null}submit(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(e){e.isRestriction||this.uppy.log(e,"error")}}async stop(){if(this.stream){const e=this.stream.getAudioTracks(),t=this.stream.getVideoTracks();e.concat(t).forEach((e=>e.stop()))}this.recorder&&await new Promise((e=>{this.recorder.addEventListener("stop",e,{once:!0}),this.recorder.stop(),this.opts.showRecordingLength&&clearInterval(this.recordingLengthTimer)})),this.recordingChunks=null,this.recorder=null,this.webcamActive=!1,this.stream=null,this.setPluginState({recordedVideo:null,isRecording:!1,recordingLengthSeconds:0})}getVideoElement(){return this.el.querySelector(".uppy-Webcam-video")}oneTwoThreeSmile(){return new Promise(((e,t)=>{let i=this.opts.countdown;const o=setInterval((()=>{if(!this.webcamActive)return clearInterval(o),this.captureInProgress=!1,t(new Error("Webcam is not active"));i?(this.uppy.info(`${i}...`,"warning",800),i--):(clearInterval(o),this.uppy.info(this.i18n("smile"),"success",1500),setTimeout((()=>e()),1500))}),1e3)}))}takeSnapshot(){this.captureInProgress||(this.captureInProgress=!0,this.opts.onBeforeSnapshot().catch((e=>{const t="object"==typeof e?e.message:e;return this.uppy.info(t,"error",5e3),Promise.reject(new Error(`onBeforeSnapshot: ${t}`))})).then((()=>this.getImage())).then((e=>{this.captureInProgress=!1;try{this.uppy.addFile(e)}catch(e){e.isRestriction||this.uppy.log(e)}}),(e=>{throw this.captureInProgress=!1,e})))}getImage(){const e=this.getVideoElement();if(!e)return Promise.reject(new Error("No video element found, likely due to the Webcam tab being closed."));const t=e.videoWidth,i=e.videoHeight,o=document.createElement("canvas");o.width=t,o.height=i,o.getContext("2d").drawImage(e,0,0);const{restrictions:s}=this.uppy.opts;let r=[];this.opts.preferredImageMimeType?r=[this.opts.preferredImageMimeType]:s.allowedFileTypes&&(r=s.allowedFileTypes.map(P).filter(I));const a=r[0]||"image/jpeg",c=n(a)||"jpg",d=`cam-${Date.now()}.${c}`;return function(e,t,i){return new Promise((i=>{e.toBlob(i,t,undefined)}))}(o,a).then((e=>({source:this.id,name:d,data:new Blob([e],{type:a}),type:a})))}getVideo(){const e=this.recordingChunks.find((e=>{var t;return(null==(t=e.type)?void 0:t.length)>0})).type,t=n(e);if(!t)return Promise.reject(new Error(`Could not retrieve recording: Unsupported media type "${e}"`));const i=`webcam-${Date.now()}.${t}`,o=new Blob(this.recordingChunks,{type:e}),s={source:this.id,name:i,data:new Blob([o],{type:e}),type:e};return Promise.resolve(s)}focus(){this.opts.countdown&&setTimeout((()=>{this.uppy.info(this.i18n("smile"),"success",1500)}),1e3)}changeVideoSource(e){this.stop(),this.start({deviceId:e})}updateVideoSources(){this.mediaDevices.enumerateDevices().then((e=>{this.setPluginState({videoSources:e.filter((e=>"videoinput"===e.kind))})}))}render(){this.webcamActive||this.start();const e=this.getPluginState();return e.cameraReady&&e.hasCamera?(0,o.h)(f,S({},e,{onChangeVideoSource:this.changeVideoSource,onSnapshot:this.takeSnapshot,onStartRecording:this.startRecording,onStopRecording:this.stopRecording,onDiscardRecordedVideo:this.discardRecordedVideo,onSubmit:this.submit,onFocus:this.focus,onStop:this.stop,i18n:this.i18n,modes:this.opts.modes,showRecordingLength:this.opts.showRecordingLength,showVideoSourceDropdown:this.opts.showVideoSourceDropdown,supportsRecording:"function"==typeof MediaRecorder&&!!MediaRecorder.prototype&&"function"==typeof MediaRecorder.prototype.start,recording:e.isRecording,mirror:R(this,V)[V],src:this.stream})):(0,o.h)(y,{icon:d,i18n:this.i18n,hasCamera:e.hasCamera})}install(){const{mobileNativeCamera:e,modes:t,facingMode:i,videoConstraints:o}=this.opts,{target:s}=this.opts;var r;e&&s?null==(r=this.getTargetPlugin(s))||r.setOptions({showNativeVideoCameraButton:T(t,"video-only")||T(t,"video-audio"),showNativePhotoCameraButton:T(t,"picture"),nativeCameraFacingMode:(null==o?void 0:o.facingMode)||i}):(this.setPluginState({cameraReady:!1,recordingLengthSeconds:0}),s&&this.mount(s,this),this.mediaDevices&&(this.updateVideoSources(),this.mediaDevices.ondevicechange=()=>{if(this.updateVideoSources(),this.stream){let e=!0;const{videoSources:t,currentDeviceId:i}=this.getPluginState();t.forEach((t=>{i===t.deviceId&&(e=!1)})),e&&(this.stop(),this.start())}}))}uninstall(){this.stop(),this.unmount()}onUnmount(){this.stop()}}L.VERSION="3.4.0"}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[786],{9364:function(t,e,r){t.exports=r(1386)},1386:function(t,e,r){var o=r(3884);e.operation=function(t){var r=e.timeouts(t);return new o(r,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})},e.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var o=[],s=0;s<e.retries;s++)o.push(this.createTimeout(s,e));return t&&t.forever&&!o.length&&o.push(this.createTimeout(s,e)),o.sort((function(t,e){return t-e})),o},e.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,o=Math.round(r*Math.max(e.minTimeout,1)*Math.pow(e.factor,t));return Math.min(o,e.maxTimeout)},e.wrap=function(t,r,o){if(r instanceof Array&&(o=r,r=null),!o)for(var s in o=[],t)"function"==typeof t[s]&&o.push(s);for(var i=0;i<o.length;i++){var n=o[i],a=t[n];t[n]=function(o){var s=e.operation(r),i=Array.prototype.slice.call(arguments,1),n=i.pop();i.push((function(t){s.retry(t)||(t&&(arguments[0]=s.mainError()),n.apply(this,arguments))})),s.attempt((function(){o.apply(t,i)}))}.bind(t,a),t[n].options=r}}},3884:function(t){function e(t,e){"boolean"==typeof e&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}t.exports=e,e.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},e.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},e.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=(new Date).getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(void 0===r){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1)}var o=this;return this._timer=setTimeout((function(){o._attempts++,o._operationTimeoutCb&&(o._timeout=setTimeout((function(){o._operationTimeoutCb(o._attempts)}),o._operationTimeout),o._options.unref&&o._timeout.unref()),o._fn(o._attempts)}),r),this._options.unref&&this._timer.unref(),!0},e.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout((function(){r._operationTimeoutCb()}),r._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},e.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)},e.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)},e.prototype.start=e.prototype.try,e.prototype.errors=function(){return this._errors},e.prototype.attempts=function(){return this._attempts},e.prototype.mainError=function(){if(0===this._errors.length)return null;for(var t={},e=null,r=0,o=0;o<this._errors.length;o++){var s=this._errors[o],i=s.message,n=(t[i]||0)+1;t[i]=n,n>=r&&(e=s,r=n)}return e}},5786:function(t,e,r){"use strict";r.d(e,{Kq:function(){return L},cP:function(){return K},HM:function(){return o}});var o={};r.r(o),r.d(o,{getItem:function(){return D},removeItem:function(){return H},setItem:function(){return J}});class s extends Error{constructor(){super(...arguments),this.name="UserFacingApiError"}}var i=s,n=r(9364);const a=Object.prototype.toString,u=t=>"[object Error]"===a.call(t),p=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated"]);class h extends Error{constructor(t){super(),t instanceof Error?(this.originalError=t,({message:t}=t)):(this.originalError=new Error(t),this.originalError.stack=this.stack),this.name="AbortError",this.message=t}}const l=(t,e,r)=>{const o=r.retries-(e-1);return t.attemptNumber=e,t.retriesLeft=o,t};async function c(t,e){return new Promise(((r,o)=>{e={onFailedAttempt(){},retries:10,shouldRetry:()=>!0,...e};const s=n.operation(e),i=()=>{s.stop(),o(e.signal?.reason)};e.signal&&!e.signal.aborted&&e.signal.addEventListener("abort",i,{once:!0});const a=()=>{e.signal?.removeEventListener("abort",i),s.stop()};s.attempt((async i=>{try{const e=await t(i);a(),r(e)}catch(t){try{if(!(t instanceof Error))throw new TypeError(`Non-error was thrown: "${t}". You should only throw errors.`);if(t instanceof h)throw t.originalError;if(t instanceof TypeError&&!function(t){return!(!t||!u(t)||"TypeError"!==t.name||"string"!=typeof t.message)&&("Load failed"===t.message?void 0===t.stack:p.has(t.message))}(t))throw t;if(l(t,i,e),await e.shouldRetry(t)||(s.stop(),o(t)),await e.onFailedAttempt(t),!s.retry(t))throw s.mainError()}catch(t){l(t,i,e),a(),o(t)}}}))}))}var m=r(5945),d=r(8396),f=r(7331)((function(t,e,r){const{progress:o,bytesUploaded:s,bytesTotal:i}=e;o&&(t.uppy.log(`Upload progress: ${o}`),t.uppy.emit("upload-progress",r,{uploader:t,bytesUploaded:s,bytesTotal:i}))}),300,{leading:!0,trailing:!0});class y extends Error{constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}}var g=y;let w;function v(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var b=0;function T(t){return"__private_"+b+++"_"+t}class k extends Error{constructor(t){let{statusCode:e,message:r}=t;super(r),this.name="HttpError",this.statusCode=e}}var _=T("companionHeaders"),E=T("getUrl"),A=T("requestSocketToken"),$=T("awaitRemoteFileUpload");w=Symbol.for("uppy test: getCompanionHeaders");class P{constructor(t,e){Object.defineProperty(this,$,{value:S}),Object.defineProperty(this,E,{value:R}),Object.defineProperty(this,_,{writable:!0,value:void 0}),Object.defineProperty(this,A,{writable:!0,value:async t=>{var e;let{file:r,postBody:o,signal:s}=t;if(null==(null==(e=r.remote)?void 0:e.url))throw new Error("Cannot connect to an undefined URL");return(await this.post(r.remote.url,{...r.remote.body,...o},{signal:s})).token}}),this.uppy=t,this.opts=e,this.onReceiveResponse=this.onReceiveResponse.bind(this),v(this,_)[_]=null==e?void 0:e.companionHeaders}setCompanionHeaders(t){v(this,_)[_]=t}[w](){return v(this,_)[_]}get hostname(){const{companion:t}=this.uppy.getState(),e=this.opts.companionUrl;return(t&&t[e]?t[e]:e).replace(/\/$/,"")}async headers(t){return void 0===t&&(t=!1),{...{Accept:"application/json",...t?void 0:{"Content-Type":"application/json"}},...v(this,_)[_]}}onReceiveResponse(t){const{headers:e}=t,r=this.uppy.getState().companion||{},o=this.opts.companionUrl;e.has("i-am")&&e.get("i-am")!==r[o]&&this.uppy.setState({companion:{...r,[o]:e.get("i-am")}})}async request(t){let{path:e,method:r="GET",data:o,skipPostResponse:s,signal:n}=t;try{const t=await this.headers(!o),a=await(0,m.A)(v(this,E)[E](e),{method:r,signal:n,headers:t,credentials:this.opts.companionCookiesRule||"same-origin",body:o?JSON.stringify(o):null});return s||this.onReceiveResponse(a),await async function(t){if(401===t.status)throw new g;if(t.ok)return t.json();let e,r=`Failed request with status: ${t.status}. ${t.statusText}`;try{e=await t.json(),e.message&&(r=`${r} message: ${e.message}`),e.requestId&&(r=`${r} request-Id: ${e.requestId}`)}catch(t){throw new Error(r,{cause:t})}if(t.status>=400&&t.status<=499&&e.message)throw new i(e.message);throw new k({statusCode:t.status,message:r})}(a)}catch(t){if(t.isAuthError||"UserFacingApiError"===t.name||"AbortError"===t.name)throw t;throw new d.A(`Could not ${r} ${v(this,E)[E](e)}`,{cause:t})}}async get(t,e){return"boolean"==typeof e&&(e={skipPostResponse:e}),this.request({...e,path:t})}async post(t,e,r){return"boolean"==typeof r&&(r={skipPostResponse:r}),this.request({...r,path:t,method:"POST",data:e})}async delete(t,e,r){return"boolean"==typeof r&&(r={skipPostResponse:r}),this.request({...r,path:t,method:"DELETE",data:e})}async uploadRemoteFile(t,e,r){var o=this;try{const{signal:s,getQueue:i}=r||{};return await c((async()=>{var r;const n=null==(r=this.uppy.getFile(t.id))?void 0:r.serverToken;if(null!=n)return this.uppy.log(`Connecting to exiting websocket ${n}`),v(this,$)[$]({file:t,queue:i(),signal:s});const a=i().wrapPromiseFunction((async function(){try{return await v(o,A)[A](...arguments)}catch(t){if(t.isAuthError)throw new h(t);if(null==t.cause)throw t;const e=t.cause,r=()=>[408,409,429,418,423].includes(e.statusCode)||e.statusCode>=500&&e.statusCode<=599&&![501,505].includes(e.statusCode);if("HttpError"===e.name&&!r())throw new h(e);throw e}}),{priority:-1}),u=await a({file:t,postBody:e,signal:s}).abortOn(s);return this.uppy.getFile(t.id)?(this.uppy.setFileState(t.id,{serverToken:u}),v(this,$)[$]({file:this.uppy.getFile(t.id),queue:i(),signal:s})):void 0}),{retries:10,signal:s,onFailedAttempt:t=>this.uppy.log(`Retrying upload due to: ${t.message}`,"warning")})}catch(e){if("AbortError"===e.name)return;throw this.uppy.emit("upload-error",t,e),e}}}function R(t){return/^(https?:|)\/\//.test(t)?t:`${this.hostname}/${t}`}async function S(t){let e,{file:r,queue:o,signal:s}=t;const{capabilities:i}=this.uppy.getState();try{return await new Promise(((t,n)=>{const a=r.serverToken,u=function(t){var e;const r=null==(e=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(t))?void 0:e[1];return`${/^http:\/\//i.test(t)?"ws":"wss"}://${r}`}(r.remote.companionUrl);let p,h,l,{isPaused:m}=r;const d=(t,e)=>{var o;null!=p&&p.readyState===p.OPEN?p.send(JSON.stringify({action:t,payload:null!=e?e:{}})):this.uppy.log(`Cannot send "${t}" to socket ${r.id} because the socket state was ${String(null==(o=p)?void 0:o.readyState)}`,"warning")};function y(){i.resumableUploads&&d(m?"pause":"resume")}const g=async()=>{h&&h.abort(),h=new AbortController;const e=t=>{var e;this.uppy.setFileState(r.id,{serverToken:null}),null==(e=h)||null==e.abort||e.abort(),n(t)};function s(){clearTimeout(l),m||(l=setTimeout((()=>e(new Error("Timeout waiting for message from Companion socket"))),3e5))}try{await o.wrapPromiseFunction((async()=>{await c((async()=>new Promise(((o,i)=>{p=new WebSocket(`${u}/api/${a}`),s(),p.addEventListener("close",(()=>{p=void 0,i(new Error("Socket closed unexpectedly"))})),p.addEventListener("error",(t=>{var e;this.uppy.log(`Companion socket error ${JSON.stringify(t)}, closing socket`,"warning"),null==(e=p)||e.close()})),p.addEventListener("open",(()=>{y()})),p.addEventListener("message",(o=>{s();try{const{action:e,payload:s}=JSON.parse(o.data);switch(e){case"progress":f(this,s,this.uppy.getFile(r.id));break;case"success":{var i,n,a,u;const e=null==(i=s.response)?void 0:i.responseText;this.uppy.emit("upload-success",this.uppy.getFile(r.id),{uploadURL:s.url,status:null!=(n=null==(a=s.response)?void 0:a.status)?n:200,body:e?JSON.parse(e):void 0}),null==(u=h)||null==u.abort||u.abort(),t();break}case"error":{const{message:t}=s.error;throw Object.assign(new Error(t),{cause:s.error})}default:this.uppy.log(`Companion socket unknown action ${e}`,"warning")}}catch(t){e(t)}}));const n=()=>{this.uppy.log(`Closing socket ${r.id}`,"info"),clearTimeout(l),p&&p.close(),p=void 0};h.signal.addEventListener("abort",(()=>{n()}))}))),{retries:10,signal:h.signal,onFailedAttempt:()=>{h.signal.aborted||this.uppy.log(`Retrying websocket ${r.id}`,"info")}})}))().abortOn(h.signal)}catch(t){if(h.signal.aborted)return;e(t)}},w=t=>{var e;i.resumableUploads&&(m=t,p&&y(),t?null==(e=h)||null==e.abort||e.abort():g())},v=e=>{var o;i.individualCancellation&&e.id===r.id&&(d("cancel"),null==(o=h)||null==o.abort||o.abort(),this.uppy.log(`upload ${r.id} was removed`,"info"),t())},b=e=>{var o;let{reason:s}=e;"user"===s&&d("cancel"),null==(o=h)||null==o.abort||o.abort(),this.uppy.log(`upload ${r.id} was canceled`,"info"),t()},T=(t,e)=>{t===r.id&&w(e)},k=()=>w(!0),_=()=>w(!1);this.uppy.on("file-removed",v),this.uppy.on("cancel-all",b),this.uppy.on("upload-pause",T),this.uppy.on("pause-all",k),this.uppy.on("resume-all",_),e=()=>{this.uppy.off("file-removed",v),this.uppy.off("cancel-all",b),this.uppy.off("upload-pause",T),this.uppy.off("pause-all",k),this.uppy.off("resume-all",_)},s.addEventListener("abort",(()=>{var t;null==(t=h)||t.abort()})),g()}))}finally{null==e||e()}}function O(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}P.VERSION="3.8.0";var C=0;function x(t){return"__private_"+C+++"_"+t}function F(t){return"string"==typeof t?new RegExp(`^${t}$`):t instanceof RegExp?t:void 0}var q=x("refreshingTokenPromise"),U=x("getAuthToken"),N=x("getPlugin");class L extends P{constructor(t,e){var r;super(t,e),Object.defineProperty(this,N,{value:I}),Object.defineProperty(this,U,{value:j}),Object.defineProperty(this,q,{writable:!0,value:void 0}),this.provider=e.provider,this.id=this.provider,this.name=this.opts.name||(t=>this.id.split("-").map((t=>t.charAt(0).toUpperCase()+t.slice(1))).join(" "))(),this.pluginId=this.opts.pluginId,this.tokenKey=`companion-${this.pluginId}-auth-token`,this.companionKeysParams=this.opts.companionKeysParams,this.preAuthToken=null,this.supportsRefreshToken=null==(r=e.supportsRefreshToken)||r}async headers(){const[t,e]=await Promise.all([super.headers(),O(this,U)[U]()]),r={};return e&&(r["uppy-auth-token"]=e),this.companionKeysParams&&(r["uppy-credentials-params"]=btoa(JSON.stringify({params:this.companionKeysParams}))),{...t,...r}}onReceiveResponse(t){super.onReceiveResponse(t);const e=O(this,N)[N](),r=e.getPluginState().authenticated?401!==t.status:t.status<400;return e.setPluginState({authenticated:r}),t}async setAuthToken(t){return O(this,N)[N]().storage.setItem(this.tokenKey,t)}async removeAuthToken(){return O(this,N)[N]().storage.removeItem(this.tokenKey)}async ensurePreAuth(){if(this.companionKeysParams&&!this.preAuthToken&&(await this.fetchPreAuthToken(),!this.preAuthToken))throw new Error("Could not load authentication data required for third-party login. Please try again later.")}authQuery(t){return{}}authUrl(t){let{authFormData:e,query:r}=t;const o=new URLSearchParams({...r,state:btoa(JSON.stringify({origin:location.origin})),...this.authQuery({authFormData:e})});return this.preAuthToken&&o.set("uppyPreAuthToken",this.preAuthToken),`${this.hostname}/${this.id}/connect?${o}`}async loginSimpleAuth(t){let{uppyVersions:e,authFormData:r,signal:o}=t;const s=await this.post(`${this.id}/simple-auth`,{form:r},{qs:{uppyVersions:e},signal:o});this.setAuthToken(s.uppyAuthToken)}async loginOAuth(t){let{uppyVersions:e,authFormData:r,signal:o}=t;return await this.ensurePreAuth(),o.throwIfAborted(),new Promise(((t,s)=>{const i=this.authUrl({query:{uppyVersions:e},authFormData:r}),n=window.open(i,"_blank");let a;const u=e=>{if(e.source!==n){let t="";try{t=JSON.stringify(e.data)}catch(t){}return void this.uppy.log(`ignoring event from unknown source ${t}`,"warning")}const{companionAllowedHosts:r}=O(this,N)[N]().opts;if(o=e.origin,i=r,!(Array.isArray(i)?i.map(F):[F(i)]).some((t=>(null==t?void 0:t.test(o))||(null==t?void 0:t.test(`${o}/`)))))return void s(new Error(`rejecting event from ${e.origin} vs allowed pattern ${r}`));var o,i;const u="string"==typeof e.data?JSON.parse(e.data):e.data;if(u.error){const{uppy:t}=this,e=t.i18n("authAborted");return t.info({message:e},"warning",5e3),void s(new Error("auth aborted"))}u.token?(a(),t(this.setAuthToken(u.token))):s(new Error("did not receive token from auth window"))};a=()=>{null==n||n.close(),window.removeEventListener("message",u),o.removeEventListener("abort",a)},o.addEventListener("abort",a),window.addEventListener("message",u)}))}async login(t){let{uppyVersions:e,authFormData:r,signal:o}=t;return this.loginOAuth({uppyVersions:e,authFormData:r,signal:o})}refreshTokenUrl(){return`${this.hostname}/${this.id}/refresh-token`}fileUrl(t){return`${this.hostname}/${this.id}/get/${t}`}async request(){await O(this,q)[q];try{return await super.request(...arguments)}catch(t){if(!this.supportsRefreshToken)throw t;const e=await O(this,U)[U]();if(!t.isAuthError||!e)throw t;return null==O(this,q)[q]&&(O(this,q)[q]=(async()=>{try{this.uppy.log("[CompanionClient] Refreshing expired auth token","info");const t=await super.request({path:this.refreshTokenUrl(),method:"POST"});await this.setAuthToken(t.uppyAuthToken)}catch(e){throw e.isAuthError&&await this.removeAuthToken(),t}finally{O(this,q)[q]=void 0}})()),await O(this,q)[q],super.request(...arguments)}}async fetchPreAuthToken(){if(this.companionKeysParams)try{const t=await this.post(`${this.id}/preauth/`,{params:this.companionKeysParams});this.preAuthToken=t.token}catch(t){this.uppy.log(`[CompanionClient] unable to fetch preAuthToken ${t}`,"warning")}}list(t,e){return this.get(`${this.id}/list/${t||""}`,e)}async logout(t){const e=await this.get(`${this.id}/logout`,t);return await this.removeAuthToken(),e}}async function j(){return O(this,N)[N]().storage.getItem(this.tokenKey)}function I(){const t=this.uppy.getPlugin(this.pluginId);if(null==t)throw new Error("Plugin was nullish");return t}function K(t,e){if(t){if(!("string"==typeof t||Array.isArray(t)||t instanceof RegExp))throw new TypeError('The option "companionAllowedHosts" must be one of string, Array, RegExp');return t}return/^(?!https?:\/\/).*$/i.test(e)?`https://${e.replace(/^\/\//,"")}`:new URL(e).origin}function J(t,e){return new Promise((r=>{localStorage.setItem(t,e),r()}))}function D(t){return Promise.resolve(localStorage.getItem(t))}function H(t){return new Promise((e=>{localStorage.removeItem(t),e()}))}let V,M;r(2162),V=Symbol.for("uppy test: getSocket"),M=Symbol.for("uppy test: getQueued")},8396:function(t,e,r){"use strict";var o=r(9420);class s extends Error{constructor(t,e){super(t),this.cause=null==e?void 0:e.cause,this.cause&&(0,o.A)(this.cause,"isNetworkError")?this.isNetworkError=this.cause.isNetworkError:this.isNetworkError=!1}}e.A=s},6681:function(t,e){"use strict";class r extends Error{constructor(t,e){void 0===e&&(e=null),super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=t,this.isNetworkError=!0,this.request=e}}e.A=r},5945:function(t,e,r){"use strict";r.d(e,{A:function(){return s}});var o=r(6681);function s(){return fetch(...arguments).catch((t=>{throw"AbortError"===t.name?t:new o.A(t)}))}},9420:function(t,e,r){"use strict";function o(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.d(e,{A:function(){return o}})}}]);