plutonium 0.26.0 → 0.26.2

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.
@@ -84,7 +84,7 @@ ${e}</tr>
84
84
  `}tablecell(e){let t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
85
85
  `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Ei(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let s=this.parser.parseInline(r),n=ef(e);if(n===null)return s;e=n;let o='<a href="'+e+'"';return t&&(o+=' title="'+Ei(t)+'"'),o+=">"+s+"</a>",o}image({href:e,title:t,text:r}){let s=ef(e);if(s===null)return Ei(r);e=s;let n=`<img src="${e}" alt="${r}"`;return t&&(n+=` title="${Ei(t)}"`),n+=">",n}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Ei(e.text)}},Cn=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},ui=class i{options;renderer;textRenderer;constructor(e){this.options=e||Hr,this.options.renderer=this.options.renderer||new Is,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Cn}static parse(e,t){return new i(t).parse(e)}static parseInline(e,t){return new i(t).parseInline(e)}parse(e,t=!0){let r="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let a=n,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){r+=l||"";continue}}let o=n;switch(o.type){case"space":{r+=this.renderer.space(o);continue}case"hr":{r+=this.renderer.hr(o);continue}case"heading":{r+=this.renderer.heading(o);continue}case"code":{r+=this.renderer.code(o);continue}case"table":{r+=this.renderer.table(o);continue}case"blockquote":{r+=this.renderer.blockquote(o);continue}case"list":{r+=this.renderer.list(o);continue}case"html":{r+=this.renderer.html(o);continue}case"paragraph":{r+=this.renderer.paragraph(o);continue}case"text":{let a=o,l=this.renderer.text(a);for(;s+1<e.length&&e[s+1].type==="text";)a=e[++s],l+=`
86
86
  `+this.renderer.text(a);t?r+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):r+=l;continue}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}parseInline(e,t=this.renderer){let r="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let a=this.options.extensions.renderers[n.type].call({parser:this},n);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){r+=a||"";continue}}let o=n;switch(o.type){case"escape":{r+=t.text(o);break}case"html":{r+=t.html(o);break}case"link":{r+=t.link(o);break}case"image":{r+=t.image(o);break}case"strong":{r+=t.strong(o);break}case"em":{r+=t.em(o);break}case"codespan":{r+=t.codespan(o);break}case"br":{r+=t.br(o);break}case"del":{r+=t.del(o);break}case"text":{r+=t.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},Ls=class{options;block;constructor(e){this.options=e||Hr}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?ci.lex:ci.lexInline}provideParser(){return this.block?ui.parse:ui.parseInline}},gu=class{defaults=vu();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ui;Renderer=Is;TextRenderer=Cn;Lexer=ci;Tokenizer=Ms;Hooks=Ls;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(let s of e)switch(r=r.concat(t.call(this,s)),s.type){case"table":{let n=s;for(let o of n.header)r=r.concat(this.walkTokens(o.tokens,t));for(let o of n.rows)for(let a of o)r=r.concat(this.walkTokens(a.tokens,t));break}case"list":{let n=s;r=r.concat(this.walkTokens(n.items,t));break}default:{let n=s;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(o=>{let a=n[o].flat(1/0);r=r.concat(this.walkTokens(a,t))}):n.tokens&&(r=r.concat(this.walkTokens(n.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let o=t.renderers[n.name];o?t.renderers[n.name]=function(...a){let l=n.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:t.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=t[n.level];o?o.unshift(n.tokenizer):t[n.level]=[n.tokenizer],n.start&&(n.level==="block"?t.startBlock?t.startBlock.push(n.start):t.startBlock=[n.start]:n.level==="inline"&&(t.startInline?t.startInline.push(n.start):t.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(t.childTokens[n.name]=n.childTokens)}),s.extensions=t),r.renderer){let n=this.defaults.renderer||new Is(this.defaults);for(let o in r.renderer){if(!(o in n))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let a=o,l=r.renderer[a],c=n[a];n[a]=(...d)=>{let f=l.apply(n,d);return f===!1&&(f=c.apply(n,d)),f||""}}s.renderer=n}if(r.tokenizer){let n=this.defaults.tokenizer||new Ms(this.defaults);for(let o in r.tokenizer){if(!(o in n))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let a=o,l=r.tokenizer[a],c=n[a];n[a]=(...d)=>{let f=l.apply(n,d);return f===!1&&(f=c.apply(n,d)),f}}s.tokenizer=n}if(r.hooks){let n=this.defaults.hooks||new Ls;for(let o in r.hooks){if(!(o in n))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let a=o,l=r.hooks[a],c=n[a];Ls.passThroughHooks.has(o)?n[a]=d=>{if(this.defaults.async)return Promise.resolve(l.call(n,d)).then(y=>c.call(n,y));let f=l.call(n,d);return c.call(n,f)}:n[a]=(...d)=>{let f=l.apply(n,d);return f===!1&&(f=c.apply(n,d)),f}}s.hooks=n}if(r.walkTokens){let n=this.defaults.walkTokens,o=r.walkTokens;s.walkTokens=function(a){let l=[];return l.push(o.call(this,a)),n&&(l=l.concat(n.call(this,a))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ci.lex(e,t??this.defaults)}parser(e,t){return ui.parse(e,t??this.defaults)}parseMarkdown(e){return(r,s)=>{let n={...s},o={...this.defaults,...n},a=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&n.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);let l=o.hooks?o.hooks.provideLexer():e?ci.lex:ci.lexInline,c=o.hooks?o.hooks.provideParser():e?ui.parse:ui.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(r):r).then(d=>l(d,o)).then(d=>o.hooks?o.hooks.processAllTokens(d):d).then(d=>o.walkTokens?Promise.all(this.walkTokens(d,o.walkTokens)).then(()=>d):d).then(d=>c(d,o)).then(d=>o.hooks?o.hooks.postprocess(d):d).catch(a);try{o.hooks&&(r=o.hooks.preprocess(r));let d=l(r,o);o.hooks&&(d=o.hooks.processAllTokens(d)),o.walkTokens&&this.walkTokens(d,o.walkTokens);let f=c(d,o);return o.hooks&&(f=o.hooks.postprocess(f)),f}catch(d){return a(d)}}}onError(e,t){return r=>{if(r.message+=`
87
- Please report this to https://github.com/markedjs/marked.`,e){let s="<p>An error occurred:</p><pre>"+Ei(r.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(r);throw r}}},zr=new gu;function me(i,e){return zr.parse(i,e)}me.options=me.setOptions=function(i){return zr.setOptions(i),me.defaults=zr.defaults,sf(me.defaults),me};me.getDefaults=vu;me.defaults=Hr;me.use=function(...i){return zr.use(...i),me.defaults=zr.defaults,sf(me.defaults),me};me.walkTokens=function(i,e){return zr.walkTokens(i,e)};me.parseInline=zr.parseInline;me.Parser=ui;me.parser=ui.parse;me.Renderer=Is;me.TextRenderer=Cn;me.Lexer=ci;me.lexer=ci.lex;me.Tokenizer=Ms;me.Hooks=Ls;me.parse=me;var R5=me.options,L5=me.setOptions,M5=me.use,I5=me.walkTokens,D5=me.parseInline;var N5=ui.parse,B5=ci.lex;var Pa=class extends ie{connect(){this.easyMDE=new EasyMDE(this.#e()),this.element.setAttribute("data-action","turbo:morph-element->easymde#reconnect")}disconnect(){this.easyMDE&&(this.easyMDE.toTextArea(),this.easyMDE=null)}reconnect(){this.disconnect(),this.connect()}#e(){let i={element:this.element,promptURLs:!0,spellChecker:!1,previewRender:e=>{let t=Rs.sanitize(e,{ALLOWED_TAGS:["strong","em","sub","sup","details","summary"],ALLOWED_ATTR:[]}),r=me(t);return Rs.sanitize(r,{USE_PROFILES:{html:!0}})}};return this.element.attributes.id.value&&(i.autosave={enabled:!0,uniqueId:this.element.attributes.id.value,delay:1e3}),i}};var Ca=class extends ie{connect(){let i={};if(document.querySelector('[data-controller="remote-modal"]')){this.dropdownContainer=document.createElement("div"),this.dropdownContainer.className="ss-dropdown-container";let t=this.element.parentNode;getComputedStyle(t).position==="static"&&(t.style.position="relative",this.modifiedSelectWrapper=t),this.element.parentNode.insertBefore(this.dropdownContainer,this.element.nextSibling),i.contentLocation=this.dropdownContainer,i.contentPosition="absolute",i.openPosition="auto"}this.slimSelect=new SlimSelect({select:this.element,settings:i}),this.handleDropdownPosition(),this.boundHandleDropdownOpen=this.handleDropdownOpen.bind(this),this.boundHandleDropdownClose=this.handleDropdownClose.bind(this),this.element.addEventListener("ss:open",this.boundHandleDropdownOpen),this.element.addEventListener("ss:close",this.boundHandleDropdownClose),this.setupAriaObserver(),this.element.setAttribute("data-action","turbo:morph-element->slim-select#reconnect")}handleDropdownPosition(){if(this.dropdownContainer){let i=()=>{let e=this.element.getBoundingClientRect(),t=window.innerHeight-e.bottom,r=e.top;t<200&&r>t?(this.dropdownContainer.style.top="auto",this.dropdownContainer.style.bottom="100%",this.dropdownContainer.style.borderRadius="0.375rem 0.375rem 0 0"):(this.dropdownContainer.style.bottom="auto",this.dropdownContainer.style.borderRadius="0 0 0.375rem 0.375rem")};setTimeout(i,0),window.addEventListener("resize",i),window.addEventListener("scroll",i),this.repositionDropdown=i}}handleDropdownOpen(){this.dropdownContainer&&(this.dropdownContainer.style.height="auto",this.dropdownContainer.style.overflow="visible",this.dropdownContainer.classList.add("ss-active"),document.querySelectorAll(".ss-dropdown-container").forEach(e=>{e!==this.dropdownContainer&&(e.style.zIndex="9999")}),this.dropdownContainer.style.zIndex="10000")}handleDropdownClose(){this.dropdownContainer&&this.dropdownContainer.classList.remove("ss-active")}setupAriaObserver(){if(this.element){this.ariaObserver=new MutationObserver(t=>{t.forEach(r=>{r.attributeName==="aria-expanded"&&(r.target.getAttribute("aria-expanded")==="true"?this.handleDropdownOpen():this.handleDropdownClose())})});let e=[this.element,this.element.parentNode.querySelector(".ss-main"),this.element.parentNode.querySelector("[aria-expanded]")].find(t=>t&&t.hasAttribute&&t.hasAttribute("aria-expanded"));e&&(this.ariaObserver.observe(e,{attributes:!0,attributeFilter:["aria-expanded"]}),e.getAttribute("aria-expanded")==="true"?this.handleDropdownOpen():this.handleDropdownClose())}}disconnect(){this.element&&(this.boundHandleDropdownOpen&&this.element.removeEventListener("ss:open",this.boundHandleDropdownOpen),this.boundHandleDropdownClose&&this.element.removeEventListener("ss:close",this.boundHandleDropdownClose)),this.ariaObserver&&(this.ariaObserver.disconnect(),this.ariaObserver=null),this.slimSelect&&(this.slimSelect.destroy(),this.slimSelect=null),this.repositionDropdown&&(window.removeEventListener("resize",this.repositionDropdown),window.removeEventListener("scroll",this.repositionDropdown),this.repositionDropdown=null),this.dropdownContainer&&this.dropdownContainer.parentNode&&(this.dropdownContainer.parentNode.removeChild(this.dropdownContainer),this.dropdownContainer=null),this.modifiedSelectWrapper&&(this.modifiedSelectWrapper.style.position="",this.modifiedSelectWrapper=null)}reconnect(){this.disconnect(),setTimeout(()=>this.connect(),10)}};var Fa=class extends ie{connect(){this.picker=new flatpickr(this.element,this.#e()),this.element.setAttribute("data-action","turbo:morph-element->flatpickr#reconnect")}disconnect(){this.picker&&(this.picker.destroy(),this.picker=null)}reconnect(){this.disconnect(),this.connect()}#e(){let i={altInput:!0};return this.element.attributes.type.value=="datetime-local"?i.enableTime=!0:this.element.attributes.type.value=="time"&&(i.enableTime=!0,i.noCalendar=!0),i}};var _a=class extends ie{static targets=["input"];connect(){}disconnect(){this.inputTargetDisconnected()}inputTargetConnected(){this.hasInputTarget&&(this.iti=window.intlTelInput(this.inputTarget,this.#e()),this.inputTarget.setAttribute("data-action","turbo:morph-element->intl-tel-input#reconnect"))}inputTargetDisconnected(){this.iti&&(this.iti.destroy(),this.iti=null)}reconnect(){this.inputTargetDisconnected(),this.inputTargetConnected()}#e(){return{strictMode:!0,hiddenInput:()=>({phone:this.inputTarget.attributes.name.value}),loadUtilsOnInit:"https://cdn.jsdelivr.net/npm/intl-tel-input@24.8.1/build/js/utils.js"}}};var Oa=class extends ie{static targets=["select"];navigate(i){let e=this.selectTarget.value,t=document.createElement("a");t.href=e,this.element.appendChild(t),t.click(),t.remove()}};var Ra=class extends ie{static targets=["btn","tab"];static values={defaultTab:String,activeClasses:String,inActiveClasses:String};connect(){this.activeClasses=this.hasActiveClassesValue?this.activeClassesValue.split(" "):[],this.inActiveClasses=this.hasInActiveClassesValue?this.inActiveClassesValue.split(" "):[],this.#e(this.defaultTabValue||this.btnTargets[0].id)}select(i){this.#e(i.currentTarget.id)}#e(i){let e=this.btnTargets.find(r=>r.id===i);if(!e){console.error(`Tab Button with id "${i}" not found`);return}let t=this.tabTargets.find(r=>r.id===e.dataset.target);if(!t){console.error(`Tab Panel with id "${e.dataset.target}" not found`);return}this.tabTargets.forEach(r=>{r.hidden=!0,r.setAttribute("aria-hidden","true")}),this.btnTargets.forEach(r=>{r.setAttribute("aria-selected","false"),r.setAttribute("tabindex","-1"),r.classList.remove(...this.activeClasses),r.classList.add(...this.inActiveClasses)}),e.setAttribute("aria-selected","true"),e.setAttribute("tabindex","0"),e.classList.remove(...this.inActiveClasses),e.classList.add(...this.activeClasses),t.hidden=!1,t.setAttribute("aria-hidden","false"),e!==document.activeElement&&e.focus()}};function La(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Vw=0;function gf(i){return"__private_"+Vw+++"_"+i}function jw(i,e,t){let r=[];return i.forEach(s=>typeof s!="string"?r.push(s):e[Symbol.split](s).forEach((n,o,a)=>{n!==""&&r.push(n),o<a.length-1&&r.push(t)})),r}function mf(i,e){let t=/\$/g,r="$$$$",s=[i];if(e==null)return s;for(let n of Object.keys(e))if(n!=="_"){let o=e[n];typeof o=="string"&&(o=t[Symbol.replace](o,r)),s=jw(s,new RegExp(`%\\{${n}\\}`,"g"),o)}return s}var Ww=i=>{throw new Error(`missing string: ${i}`)},_n=gf("onMissingKey"),On=gf("apply"),$r=class{constructor(e,t){let{onMissingKey:r=Ww}=t===void 0?{}:t;Object.defineProperty(this,On,{value:Gw}),Object.defineProperty(this,_n,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(s){return s===1?0:1}},Array.isArray(e)?e.forEach(La(this,On)[On],this):La(this,On)[On](e),La(this,_n)[_n]=r}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let r=this.locale.strings[e];if(r==null&&(La(this,_n)[_n](e),r=e),typeof r=="object"){if(t&&typeof t.smart_count<"u"){let n=this.locale.pluralize(t.smart_count);return mf(r[n],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof r!="string")throw new Error("string was not a string");return mf(r,t)}};function Gw(i){if(!(i!=null&&i.strings))return;let e=this.locale;Object.assign(this.locale,{strings:{...e.strings,...i.strings},pluralize:i.pluralize||e.pluralize})}var pm=Fe(bf(),1);var Kw="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var mr=(i=21)=>{let e="",t=i|0;for(;t--;)e+=Kw[Math.random()*64|0];return e};var fm=Fe(Zf(),1);function Ia(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var H1=0;function Qf(i){return"__private_"+H1+++"_"+i}var $1={version:"4.2.0"},qr=Qf("callbacks"),Fu=Qf("publish"),Da=class{constructor(){Object.defineProperty(this,Fu,{value:q1}),this.state={},Object.defineProperty(this,qr,{writable:!0,value:new Set})}getState(){return this.state}setState(e){let t={...this.state},r={...this.state,...e};this.state=r,Ia(this,Fu)[Fu](t,r,e)}subscribe(e){return Ia(this,qr)[qr].add(e),()=>{Ia(this,qr)[qr].delete(e)}}};function q1(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];Ia(this,qr)[qr].forEach(r=>{r(...e)})}Da.VERSION=$1.version;var Jf=Da;function Vr(i){let e=i.lastIndexOf(".");return e===-1||e===i.length-1?{name:i,extension:void 0}:{name:i.slice(0,e),extension:i.slice(e+1)}}var _u={__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"};function Ln(i){var e;if(i.type)return i.type;let t=i.name?(e=Vr(i.name).extension)==null?void 0:e.toLowerCase():null;return t&&t in _u?_u[t]:"application/octet-stream"}function V1(i){return i.charCodeAt(0).toString(32)}function em(i){let e="";return i.replace(/[^A-Z0-9]/gi,t=>(e+=`-${V1(t)}`,"/"))+e}function tm(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${em(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${em(i.meta.relativePath.toLowerCase())}`),i.data.size!==void 0&&(t+=`-${i.data.size}`),i.data.lastModified!==void 0&&(t+=`-${i.data.lastModified}`),t}function j1(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function Na(i,e){if(j1(i))return i.id;let t=Ln(i);return tm({...i,type:t},e)}function Ou(i){if(i==null&&typeof navigator<"u"&&(i=navigator.userAgent),!i)return!0;let e=/Edge\/(\d+\.\d+)/.exec(i);if(!e)return!0;let r=e[1].split(".",2),s=parseInt(r[0],10),n=parseInt(r[1],10);return s<15||s===15&&n<15063||s>18||s===18&&n>=18218}function Ru(i,e){return e.name?e.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}function Lu(i){return i<10?`0${i}`:i.toString()}function Ds(){let i=new Date,e=Lu(i.getHours()),t=Lu(i.getMinutes()),r=Lu(i.getSeconds());return`${e}:${t}:${r}`}var im={debug:()=>{},warn:()=>{},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${Ds()}]`,...e)}},rm={debug:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.debug(`[Uppy] [${Ds()}]`,...e)},warn:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.warn(`[Uppy] [${Ds()}]`,...e)},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${Ds()}]`,...e)}};var Mn=Fe(Ba(),1),um=Fe(cm(),1),hm={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]},Ct=class extends Error{constructor(e,t){var r;super(e),this.isRestriction=!0,this.isUserFacing=(r=t?.isUserFacing)!=null?r:!0,t!=null&&t.file&&(this.file=t.file)}},Ua=class{constructor(e,t){this.getI18n=t,this.getOpts=()=>{var r;let s=e();if(((r=s.restrictions)==null?void 0:r.allowedFileTypes)!=null&&!Array.isArray(s.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return s}}validateAggregateRestrictions(e,t){let{maxTotalFileSize:r,maxNumberOfFiles:s}=this.getOpts().restrictions;if(s&&e.filter(o=>!o.isGhost).length+t.length>s)throw new Ct(`${this.getI18n()("youCanOnlyUploadX",{smart_count:s})}`);if(r){let n=[...e,...t].reduce((o,a)=>{var l;return o+((l=a.size)!=null?l:0)},0);if(n>r)throw new Ct(this.getI18n()("aggregateExceedsSize",{sizeAllowed:(0,Mn.default)(r),size:(0,Mn.default)(n)}))}}validateSingleFile(e){let{maxFileSize:t,minFileSize:r,allowedFileTypes:s}=this.getOpts().restrictions;if(s&&!s.some(a=>a.includes("/")?e.type?(0,um.default)(e.type.replace(/;.*?$/,""),a):!1:a[0]==="."&&e.extension?e.extension.toLowerCase()===a.slice(1).toLowerCase():!1)){let a=s.join(", ");throw new Ct(this.getI18n()("youCanOnlyUploadFileTypes",{types:a}),{file:e})}if(t&&e.size!=null&&e.size>t){var n;throw new Ct(this.getI18n()("exceedsSize",{size:(0,Mn.default)(t),file:(n=e.name)!=null?n:this.getI18n()("unnamed")}),{file:e})}if(r&&e.size!=null&&e.size<r)throw new Ct(this.getI18n()("inferiorSize",{size:(0,Mn.default)(r)}),{file:e})}validate(e,t){t.forEach(r=>{this.validateSingleFile(r)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){let{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new Ct(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){var t;let r=new Ct(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:(t=e.name)!=null?t:this.getI18n()("unnamed")})),{requiredMetaFields:s}=this.getOpts().restrictions,n=[];for(let o of s)(!Object.hasOwn(e.meta,o)||e.meta[o]==="")&&n.push(o);return{missingFields:n,error:r}}};var dm={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed",pleaseWait:"Please wait"}};function W(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var K1=0;function xe(i){return"__private_"+K1+++"_"+i}var X1={version:"4.4.2"},za={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null},at=xe("plugins"),lt=xe("restricter"),In=xe("storeUnsubscribe"),Hi=xe("emitter"),jr=xe("preProcessors"),Wr=xe("uploaders"),Vi=xe("postProcessors"),Lt=xe("informAndEmit"),Hn=xe("checkRequiredMetaFieldsOnFile"),Mu=xe("checkRequiredMetaFields"),Dn=xe("assertNewUploadAllowed"),Nu=xe("transformFile"),Nn=xe("startIfAutoProceed"),Bn=xe("checkAndUpdateFileState"),Bu=xe("handleUploadProgress"),Un=xe("updateTotalProgress"),ji=xe("updateTotalProgressThrottled"),Uu=xe("calculateTotalProgress"),Iu=xe("addListeners"),hi=xe("updateOnlineStatus"),zn=xe("requestClientById"),$i=xe("createUpload"),Du=xe("getUpload"),Gr=xe("removeUpload"),qi=xe("runUpload"),Ha=class i{constructor(e){Object.defineProperty(this,qi,{value:cS}),Object.defineProperty(this,Gr,{value:lS}),Object.defineProperty(this,Du,{value:aS}),Object.defineProperty(this,$i,{value:oS}),Object.defineProperty(this,Iu,{value:nS}),Object.defineProperty(this,Uu,{value:sS}),Object.defineProperty(this,Un,{value:rS}),Object.defineProperty(this,Bn,{value:iS}),Object.defineProperty(this,Nn,{value:tS}),Object.defineProperty(this,Nu,{value:eS}),Object.defineProperty(this,Dn,{value:J1}),Object.defineProperty(this,Mu,{value:Q1}),Object.defineProperty(this,Hn,{value:Z1}),Object.defineProperty(this,Lt,{value:Y1}),Object.defineProperty(this,at,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,lt,{writable:!0,value:void 0}),Object.defineProperty(this,In,{writable:!0,value:void 0}),Object.defineProperty(this,Hi,{writable:!0,value:(0,pm.default)()}),Object.defineProperty(this,jr,{writable:!0,value:new Set}),Object.defineProperty(this,Wr,{writable:!0,value:new Set}),Object.defineProperty(this,Vi,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,Object.defineProperty(this,Bu,{writable:!0,value:(s,n)=>{let o=s?this.getFile(s.id):void 0;if(s==null||!o){this.log(`Not setting progress for a file that has been removed: ${s?.id}`);return}if(o.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${s.id}`);return}let a={bytesTotal:n.bytesTotal,percentage:n.bytesTotal!=null&&Number.isFinite(n.bytesTotal)&&n.bytesTotal>0?Math.round(n.bytesUploaded/n.bytesTotal*100):void 0};o.progress.uploadStarted!=null?this.setFileState(s.id,{progress:{...o.progress,...a,bytesUploaded:n.bytesUploaded}}):this.setFileState(s.id,{progress:{...o.progress,...a}}),W(this,ji)[ji]()}}),Object.defineProperty(this,ji,{writable:!0,value:(0,fm.default)(()=>W(this,Un)[Un](),500,{leading:!0,trailing:!0})}),Object.defineProperty(this,hi,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,zn,{writable:!0,value:new Map}),this.defaultLocale=dm;let t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:hm,meta:{},onBeforeFileAdded:(s,n)=>!Object.hasOwn(n,s.id),onBeforeUpload:s=>s,store:new Jf,logger:im,infoTimeout:5e3},r={...t,...e};this.opts={...r,restrictions:{...t.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=rm),this.log(`Using Core v${i.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...za,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:Ou(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),W(this,lt)[lt]=new Ua(()=>this.opts,()=>this.i18n),W(this,In)[In]=this.store.subscribe((s,n,o)=>{this.emit("state-update",s,n,o),this.updateAll(n)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),W(this,Iu)[Iu]()}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];W(this,Hi)[Hi].emit(e,...r)}on(e,t){return W(this,Hi)[Hi].on(e,t),this}once(e,t){return W(this,Hi)[Hi].once(e,t),this}off(e,t){return W(this,Hi)[Hi].off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){let t=this.getState().files;this.setState({files:{...t,...Object.fromEntries(Object.entries(e).map(r=>{let[s,n]=r;return[s,{...t[s],...n}]}))}})}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can\u2019t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){let e=r=>this.log(`Missing i18n string: ${r}`,"error"),t=new $r([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.locale=t.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e?.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(t=>{t.setOptions(e)}),this.setState(void 0)}resetProgress(){let e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},r=Object.create(null);Object.keys(t).forEach(s=>{r[s]={...t[s],progress:{...t[s].progress,...e},tus:void 0,transloadit:void 0}}),this.setState({files:r,...za})}clear(){let{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...za,files:{}})}addPreProcessor(e){W(this,jr)[jr].add(e)}removePreProcessor(e){return W(this,jr)[jr].delete(e)}addPostProcessor(e){W(this,Vi)[Vi].add(e)}removePostProcessor(e){return W(this,Vi)[Vi].delete(e)}addUploader(e){W(this,Wr)[Wr].add(e)}removeUploader(e){return W(this,Wr)[Wr].delete(e)}setMeta(e){let t={...this.getState().meta,...e},r={...this.getState().files};Object.keys(r).forEach(s=>{r[s]={...r[s],meta:{...r[s].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:r})}setFileMeta(e,t){let r={...this.getState().files};if(!r[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}let s={...r[e].meta,...t};r[e]={...r[e],meta:s},this.setState({files:r})}getFile(e){return this.getState().files[e]}getFiles(){let{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(t=>this.getFile(t))}getObjectOfFilesPerState(){let{files:e,totalProgress:t,error:r}=this.getState(),s=Object.values(e),n=[],o=[],a=[],l=[],c=[],d=[],f=[],y=[],v=[];for(let x of s){let{progress:P}=x;!P.uploadComplete&&P.uploadStarted&&(n.push(x),x.isPaused||y.push(x)),P.uploadStarted||o.push(x),(P.uploadStarted||P.preprocess||P.postprocess)&&a.push(x),P.uploadStarted&&l.push(x),x.isPaused&&c.push(x),P.uploadComplete&&d.push(x),x.error&&f.push(x),(P.preprocess||P.postprocess)&&v.push(x)}return{newFiles:o,startedFiles:a,uploadStartedFiles:l,pausedFiles:c,completeFiles:d,erroredFiles:f,inProgressFiles:n,inProgressNotPausedFiles:y,processingFiles:v,isUploadStarted:l.length>0,isAllComplete:t===100&&d.length===s.length&&v.length===0,isAllErrored:!!r&&f.length===s.length,isAllPaused:n.length!==0&&c.length===n.length,isUploadInProgress:n.length>0,isSomeGhost:s.some(x=>x.isGhost)}}validateRestrictions(e,t){t===void 0&&(t=this.getFiles());try{W(this,lt)[lt].validate(t,[e])}catch(r){return r}return null}validateSingleFile(e){try{W(this,lt)[lt].validateSingleFile(e)}catch(t){return t.message}return null}validateAggregateRestrictions(e){let t=this.getFiles();try{W(this,lt)[lt].validateAggregateRestrictions(t,e)}catch(r){return r.message}return null}checkIfFileAlreadyExists(e){let{files:t}=this.getState();return!!(t[e]&&!t[e].isGhost)}addFile(e){W(this,Dn)[Dn](e);let{nextFilesState:t,validFilesToAdd:r,errors:s}=W(this,Bn)[Bn]([e]),n=s.filter(a=>a.isRestriction);if(W(this,Lt)[Lt](n),s.length>0)throw s[0];this.setState({files:t});let[o]=r;return this.emit("file-added",o),this.emit("files-added",r),this.log(`Added file: ${o.name}, ${o.id}, mime type: ${o.type}`),W(this,Nn)[Nn](),o.id}addFiles(e){W(this,Dn)[Dn]();let{nextFilesState:t,validFilesToAdd:r,errors:s}=W(this,Bn)[Bn](e),n=s.filter(a=>a.isRestriction);W(this,Lt)[Lt](n);let o=s.filter(a=>!a.isRestriction);if(o.length>0){let a=`Multiple errors occurred while adding files:
87
+ Please report this to https://github.com/markedjs/marked.`,e){let s="<p>An error occurred:</p><pre>"+Ei(r.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(r);throw r}}},zr=new gu;function me(i,e){return zr.parse(i,e)}me.options=me.setOptions=function(i){return zr.setOptions(i),me.defaults=zr.defaults,sf(me.defaults),me};me.getDefaults=vu;me.defaults=Hr;me.use=function(...i){return zr.use(...i),me.defaults=zr.defaults,sf(me.defaults),me};me.walkTokens=function(i,e){return zr.walkTokens(i,e)};me.parseInline=zr.parseInline;me.Parser=ui;me.parser=ui.parse;me.Renderer=Is;me.TextRenderer=Cn;me.Lexer=ci;me.lexer=ci.lex;me.Tokenizer=Ms;me.Hooks=Ls;me.parse=me;var R5=me.options,L5=me.setOptions,M5=me.use,I5=me.walkTokens,D5=me.parseInline;var N5=ui.parse,B5=ci.lex;var Pa=class extends ie{connect(){this.easyMDE=new EasyMDE(this.#e()),this.element.setAttribute("data-action","turbo:morph-element->easymde#reconnect")}disconnect(){this.easyMDE&&(this.easyMDE.toTextArea(),this.easyMDE=null)}reconnect(){this.disconnect(),this.connect()}#e(){let i={element:this.element,promptURLs:!0,spellChecker:!1,previewRender:e=>{let t=Rs.sanitize(e,{ALLOWED_TAGS:["strong","em","sub","sup","details","summary"],ALLOWED_ATTR:[]}),r=me(t);return Rs.sanitize(r,{USE_PROFILES:{html:!0}})}};return this.element.attributes.id.value&&(i.autosave={enabled:!0,uniqueId:this.element.attributes.id.value,delay:1e3}),i}};var Ca=class extends ie{connect(){let i={};if(document.querySelector('[data-controller="remote-modal"]')){this.dropdownContainer=document.createElement("div"),this.dropdownContainer.className="ss-dropdown-container";let t=this.element.parentNode;getComputedStyle(t).position==="static"&&(t.style.position="relative",this.modifiedSelectWrapper=t),this.element.parentNode.insertBefore(this.dropdownContainer,this.element.nextSibling),i.contentLocation=this.dropdownContainer,i.contentPosition="absolute",i.openPosition="auto"}this.slimSelect=new SlimSelect({select:this.element,settings:i}),this.handleDropdownPosition(),this.boundHandleDropdownOpen=this.handleDropdownOpen.bind(this),this.boundHandleDropdownClose=this.handleDropdownClose.bind(this),this.element.addEventListener("ss:open",this.boundHandleDropdownOpen),this.element.addEventListener("ss:close",this.boundHandleDropdownClose),this.setupAriaObserver(),this.element.setAttribute("data-action","turbo:morph-element->slim-select#reconnect")}handleDropdownPosition(){if(this.dropdownContainer){let i=()=>{let e=this.element.getBoundingClientRect(),t=window.innerHeight-e.bottom,r=e.top;t<200&&r>t?(this.dropdownContainer.style.top="auto",this.dropdownContainer.style.bottom="100%",this.dropdownContainer.style.borderRadius="0.375rem 0.375rem 0 0"):(this.dropdownContainer.style.bottom="auto",this.dropdownContainer.style.borderRadius="0 0 0.375rem 0.375rem")};setTimeout(i,0),window.addEventListener("resize",i),window.addEventListener("scroll",i),this.repositionDropdown=i}}handleDropdownOpen(){this.dropdownContainer&&(this.dropdownContainer.style.height="auto",this.dropdownContainer.style.overflow="visible",this.dropdownContainer.classList.add("ss-active"),document.querySelectorAll(".ss-dropdown-container").forEach(e=>{e!==this.dropdownContainer&&(e.style.zIndex="9999")}),this.dropdownContainer.style.zIndex="10000")}handleDropdownClose(){this.dropdownContainer&&this.dropdownContainer.classList.remove("ss-active")}setupAriaObserver(){if(this.element){this.ariaObserver=new MutationObserver(t=>{t.forEach(r=>{r.attributeName==="aria-expanded"&&(r.target.getAttribute("aria-expanded")==="true"?this.handleDropdownOpen():this.handleDropdownClose())})});let e=[this.element,this.element.parentNode.querySelector(".ss-main"),this.element.parentNode.querySelector("[aria-expanded]")].find(t=>t&&t.hasAttribute&&t.hasAttribute("aria-expanded"));e&&(this.ariaObserver.observe(e,{attributes:!0,attributeFilter:["aria-expanded"]}),e.getAttribute("aria-expanded")==="true"?this.handleDropdownOpen():this.handleDropdownClose())}}disconnect(){this.element&&(this.boundHandleDropdownOpen&&this.element.removeEventListener("ss:open",this.boundHandleDropdownOpen),this.boundHandleDropdownClose&&this.element.removeEventListener("ss:close",this.boundHandleDropdownClose)),this.ariaObserver&&(this.ariaObserver.disconnect(),this.ariaObserver=null),this.slimSelect&&(this.slimSelect.destroy(),this.slimSelect=null),this.repositionDropdown&&(window.removeEventListener("resize",this.repositionDropdown),window.removeEventListener("scroll",this.repositionDropdown),this.repositionDropdown=null),this.dropdownContainer&&this.dropdownContainer.parentNode&&(this.dropdownContainer.parentNode.removeChild(this.dropdownContainer),this.dropdownContainer=null),this.modifiedSelectWrapper&&(this.modifiedSelectWrapper.style.position="",this.modifiedSelectWrapper=null)}reconnect(){this.disconnect(),setTimeout(()=>this.connect(),10)}};var Fa=class extends ie{connect(){this.modal=document.querySelector("[data-controller=remote-modal]"),this.picker=new flatpickr(this.element,this.#e()),this.element.setAttribute("data-action","turbo:morph-element->flatpickr#reconnect")}disconnect(){this.picker&&(this.picker.destroy(),this.picker=null)}reconnect(){this.disconnect(),this.connect()}#e(){let i={altInput:!0};return this.element.attributes.type.value=="datetime-local"?i.enableTime=!0:this.element.attributes.type.value=="time"&&(i.enableTime=!0,i.noCalendar=!0),this.modal&&(i.appendTo=this.modal),i}};var _a=class extends ie{static targets=["input"];connect(){}disconnect(){this.inputTargetDisconnected()}inputTargetConnected(){this.hasInputTarget&&(this.iti=window.intlTelInput(this.inputTarget,this.#e()),this.inputTarget.setAttribute("data-action","turbo:morph-element->intl-tel-input#reconnect"))}inputTargetDisconnected(){this.iti&&(this.iti.destroy(),this.iti=null)}reconnect(){this.inputTargetDisconnected(),this.inputTargetConnected()}#e(){return{strictMode:!0,hiddenInput:()=>({phone:this.inputTarget.attributes.name.value}),loadUtilsOnInit:"https://cdn.jsdelivr.net/npm/intl-tel-input@24.8.1/build/js/utils.js"}}};var Oa=class extends ie{static targets=["select"];navigate(i){let e=this.selectTarget.value,t=document.createElement("a");t.href=e,this.element.appendChild(t),t.click(),t.remove()}};var Ra=class extends ie{static targets=["btn","tab"];static values={defaultTab:String,activeClasses:String,inActiveClasses:String};connect(){this.activeClasses=this.hasActiveClassesValue?this.activeClassesValue.split(" "):[],this.inActiveClasses=this.hasInActiveClassesValue?this.inActiveClassesValue.split(" "):[],this.#e(this.defaultTabValue||this.btnTargets[0].id)}select(i){this.#e(i.currentTarget.id)}#e(i){let e=this.btnTargets.find(r=>r.id===i);if(!e){console.error(`Tab Button with id "${i}" not found`);return}let t=this.tabTargets.find(r=>r.id===e.dataset.target);if(!t){console.error(`Tab Panel with id "${e.dataset.target}" not found`);return}this.tabTargets.forEach(r=>{r.hidden=!0,r.setAttribute("aria-hidden","true")}),this.btnTargets.forEach(r=>{r.setAttribute("aria-selected","false"),r.setAttribute("tabindex","-1"),r.classList.remove(...this.activeClasses),r.classList.add(...this.inActiveClasses)}),e.setAttribute("aria-selected","true"),e.setAttribute("tabindex","0"),e.classList.remove(...this.inActiveClasses),e.classList.add(...this.activeClasses),t.hidden=!1,t.setAttribute("aria-hidden","false"),e!==document.activeElement&&e.focus()}};function La(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Vw=0;function gf(i){return"__private_"+Vw+++"_"+i}function jw(i,e,t){let r=[];return i.forEach(s=>typeof s!="string"?r.push(s):e[Symbol.split](s).forEach((n,o,a)=>{n!==""&&r.push(n),o<a.length-1&&r.push(t)})),r}function mf(i,e){let t=/\$/g,r="$$$$",s=[i];if(e==null)return s;for(let n of Object.keys(e))if(n!=="_"){let o=e[n];typeof o=="string"&&(o=t[Symbol.replace](o,r)),s=jw(s,new RegExp(`%\\{${n}\\}`,"g"),o)}return s}var Ww=i=>{throw new Error(`missing string: ${i}`)},_n=gf("onMissingKey"),On=gf("apply"),$r=class{constructor(e,t){let{onMissingKey:r=Ww}=t===void 0?{}:t;Object.defineProperty(this,On,{value:Gw}),Object.defineProperty(this,_n,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(s){return s===1?0:1}},Array.isArray(e)?e.forEach(La(this,On)[On],this):La(this,On)[On](e),La(this,_n)[_n]=r}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let r=this.locale.strings[e];if(r==null&&(La(this,_n)[_n](e),r=e),typeof r=="object"){if(t&&typeof t.smart_count<"u"){let n=this.locale.pluralize(t.smart_count);return mf(r[n],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof r!="string")throw new Error("string was not a string");return mf(r,t)}};function Gw(i){if(!(i!=null&&i.strings))return;let e=this.locale;Object.assign(this.locale,{strings:{...e.strings,...i.strings},pluralize:i.pluralize||e.pluralize})}var pm=Fe(bf(),1);var Kw="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var mr=(i=21)=>{let e="",t=i|0;for(;t--;)e+=Kw[Math.random()*64|0];return e};var fm=Fe(Zf(),1);function Ia(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var H1=0;function Qf(i){return"__private_"+H1+++"_"+i}var $1={version:"4.2.0"},qr=Qf("callbacks"),Fu=Qf("publish"),Da=class{constructor(){Object.defineProperty(this,Fu,{value:q1}),this.state={},Object.defineProperty(this,qr,{writable:!0,value:new Set})}getState(){return this.state}setState(e){let t={...this.state},r={...this.state,...e};this.state=r,Ia(this,Fu)[Fu](t,r,e)}subscribe(e){return Ia(this,qr)[qr].add(e),()=>{Ia(this,qr)[qr].delete(e)}}};function q1(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];Ia(this,qr)[qr].forEach(r=>{r(...e)})}Da.VERSION=$1.version;var Jf=Da;function Vr(i){let e=i.lastIndexOf(".");return e===-1||e===i.length-1?{name:i,extension:void 0}:{name:i.slice(0,e),extension:i.slice(e+1)}}var _u={__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"};function Ln(i){var e;if(i.type)return i.type;let t=i.name?(e=Vr(i.name).extension)==null?void 0:e.toLowerCase():null;return t&&t in _u?_u[t]:"application/octet-stream"}function V1(i){return i.charCodeAt(0).toString(32)}function em(i){let e="";return i.replace(/[^A-Z0-9]/gi,t=>(e+=`-${V1(t)}`,"/"))+e}function tm(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${em(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${em(i.meta.relativePath.toLowerCase())}`),i.data.size!==void 0&&(t+=`-${i.data.size}`),i.data.lastModified!==void 0&&(t+=`-${i.data.lastModified}`),t}function j1(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function Na(i,e){if(j1(i))return i.id;let t=Ln(i);return tm({...i,type:t},e)}function Ou(i){if(i==null&&typeof navigator<"u"&&(i=navigator.userAgent),!i)return!0;let e=/Edge\/(\d+\.\d+)/.exec(i);if(!e)return!0;let r=e[1].split(".",2),s=parseInt(r[0],10),n=parseInt(r[1],10);return s<15||s===15&&n<15063||s>18||s===18&&n>=18218}function Ru(i,e){return e.name?e.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}function Lu(i){return i<10?`0${i}`:i.toString()}function Ds(){let i=new Date,e=Lu(i.getHours()),t=Lu(i.getMinutes()),r=Lu(i.getSeconds());return`${e}:${t}:${r}`}var im={debug:()=>{},warn:()=>{},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${Ds()}]`,...e)}},rm={debug:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.debug(`[Uppy] [${Ds()}]`,...e)},warn:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.warn(`[Uppy] [${Ds()}]`,...e)},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${Ds()}]`,...e)}};var Mn=Fe(Ba(),1),um=Fe(cm(),1),hm={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]},Ct=class extends Error{constructor(e,t){var r;super(e),this.isRestriction=!0,this.isUserFacing=(r=t?.isUserFacing)!=null?r:!0,t!=null&&t.file&&(this.file=t.file)}},Ua=class{constructor(e,t){this.getI18n=t,this.getOpts=()=>{var r;let s=e();if(((r=s.restrictions)==null?void 0:r.allowedFileTypes)!=null&&!Array.isArray(s.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return s}}validateAggregateRestrictions(e,t){let{maxTotalFileSize:r,maxNumberOfFiles:s}=this.getOpts().restrictions;if(s&&e.filter(o=>!o.isGhost).length+t.length>s)throw new Ct(`${this.getI18n()("youCanOnlyUploadX",{smart_count:s})}`);if(r){let n=[...e,...t].reduce((o,a)=>{var l;return o+((l=a.size)!=null?l:0)},0);if(n>r)throw new Ct(this.getI18n()("aggregateExceedsSize",{sizeAllowed:(0,Mn.default)(r),size:(0,Mn.default)(n)}))}}validateSingleFile(e){let{maxFileSize:t,minFileSize:r,allowedFileTypes:s}=this.getOpts().restrictions;if(s&&!s.some(a=>a.includes("/")?e.type?(0,um.default)(e.type.replace(/;.*?$/,""),a):!1:a[0]==="."&&e.extension?e.extension.toLowerCase()===a.slice(1).toLowerCase():!1)){let a=s.join(", ");throw new Ct(this.getI18n()("youCanOnlyUploadFileTypes",{types:a}),{file:e})}if(t&&e.size!=null&&e.size>t){var n;throw new Ct(this.getI18n()("exceedsSize",{size:(0,Mn.default)(t),file:(n=e.name)!=null?n:this.getI18n()("unnamed")}),{file:e})}if(r&&e.size!=null&&e.size<r)throw new Ct(this.getI18n()("inferiorSize",{size:(0,Mn.default)(r)}),{file:e})}validate(e,t){t.forEach(r=>{this.validateSingleFile(r)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){let{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new Ct(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){var t;let r=new Ct(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:(t=e.name)!=null?t:this.getI18n()("unnamed")})),{requiredMetaFields:s}=this.getOpts().restrictions,n=[];for(let o of s)(!Object.hasOwn(e.meta,o)||e.meta[o]==="")&&n.push(o);return{missingFields:n,error:r}}};var dm={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed",pleaseWait:"Please wait"}};function W(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var K1=0;function xe(i){return"__private_"+K1+++"_"+i}var X1={version:"4.4.2"},za={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null},at=xe("plugins"),lt=xe("restricter"),In=xe("storeUnsubscribe"),Hi=xe("emitter"),jr=xe("preProcessors"),Wr=xe("uploaders"),Vi=xe("postProcessors"),Lt=xe("informAndEmit"),Hn=xe("checkRequiredMetaFieldsOnFile"),Mu=xe("checkRequiredMetaFields"),Dn=xe("assertNewUploadAllowed"),Nu=xe("transformFile"),Nn=xe("startIfAutoProceed"),Bn=xe("checkAndUpdateFileState"),Bu=xe("handleUploadProgress"),Un=xe("updateTotalProgress"),ji=xe("updateTotalProgressThrottled"),Uu=xe("calculateTotalProgress"),Iu=xe("addListeners"),hi=xe("updateOnlineStatus"),zn=xe("requestClientById"),$i=xe("createUpload"),Du=xe("getUpload"),Gr=xe("removeUpload"),qi=xe("runUpload"),Ha=class i{constructor(e){Object.defineProperty(this,qi,{value:cS}),Object.defineProperty(this,Gr,{value:lS}),Object.defineProperty(this,Du,{value:aS}),Object.defineProperty(this,$i,{value:oS}),Object.defineProperty(this,Iu,{value:nS}),Object.defineProperty(this,Uu,{value:sS}),Object.defineProperty(this,Un,{value:rS}),Object.defineProperty(this,Bn,{value:iS}),Object.defineProperty(this,Nn,{value:tS}),Object.defineProperty(this,Nu,{value:eS}),Object.defineProperty(this,Dn,{value:J1}),Object.defineProperty(this,Mu,{value:Q1}),Object.defineProperty(this,Hn,{value:Z1}),Object.defineProperty(this,Lt,{value:Y1}),Object.defineProperty(this,at,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,lt,{writable:!0,value:void 0}),Object.defineProperty(this,In,{writable:!0,value:void 0}),Object.defineProperty(this,Hi,{writable:!0,value:(0,pm.default)()}),Object.defineProperty(this,jr,{writable:!0,value:new Set}),Object.defineProperty(this,Wr,{writable:!0,value:new Set}),Object.defineProperty(this,Vi,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,Object.defineProperty(this,Bu,{writable:!0,value:(s,n)=>{let o=s?this.getFile(s.id):void 0;if(s==null||!o){this.log(`Not setting progress for a file that has been removed: ${s?.id}`);return}if(o.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${s.id}`);return}let a={bytesTotal:n.bytesTotal,percentage:n.bytesTotal!=null&&Number.isFinite(n.bytesTotal)&&n.bytesTotal>0?Math.round(n.bytesUploaded/n.bytesTotal*100):void 0};o.progress.uploadStarted!=null?this.setFileState(s.id,{progress:{...o.progress,...a,bytesUploaded:n.bytesUploaded}}):this.setFileState(s.id,{progress:{...o.progress,...a}}),W(this,ji)[ji]()}}),Object.defineProperty(this,ji,{writable:!0,value:(0,fm.default)(()=>W(this,Un)[Un](),500,{leading:!0,trailing:!0})}),Object.defineProperty(this,hi,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,zn,{writable:!0,value:new Map}),this.defaultLocale=dm;let t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:hm,meta:{},onBeforeFileAdded:(s,n)=>!Object.hasOwn(n,s.id),onBeforeUpload:s=>s,store:new Jf,logger:im,infoTimeout:5e3},r={...t,...e};this.opts={...r,restrictions:{...t.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=rm),this.log(`Using Core v${i.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...za,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:Ou(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),W(this,lt)[lt]=new Ua(()=>this.opts,()=>this.i18n),W(this,In)[In]=this.store.subscribe((s,n,o)=>{this.emit("state-update",s,n,o),this.updateAll(n)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),W(this,Iu)[Iu]()}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];W(this,Hi)[Hi].emit(e,...r)}on(e,t){return W(this,Hi)[Hi].on(e,t),this}once(e,t){return W(this,Hi)[Hi].once(e,t),this}off(e,t){return W(this,Hi)[Hi].off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){let t=this.getState().files;this.setState({files:{...t,...Object.fromEntries(Object.entries(e).map(r=>{let[s,n]=r;return[s,{...t[s],...n}]}))}})}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can\u2019t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){let e=r=>this.log(`Missing i18n string: ${r}`,"error"),t=new $r([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.locale=t.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e?.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(t=>{t.setOptions(e)}),this.setState(void 0)}resetProgress(){let e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},r=Object.create(null);Object.keys(t).forEach(s=>{r[s]={...t[s],progress:{...t[s].progress,...e},tus:void 0,transloadit:void 0}}),this.setState({files:r,...za})}clear(){let{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...za,files:{}})}addPreProcessor(e){W(this,jr)[jr].add(e)}removePreProcessor(e){return W(this,jr)[jr].delete(e)}addPostProcessor(e){W(this,Vi)[Vi].add(e)}removePostProcessor(e){return W(this,Vi)[Vi].delete(e)}addUploader(e){W(this,Wr)[Wr].add(e)}removeUploader(e){return W(this,Wr)[Wr].delete(e)}setMeta(e){let t={...this.getState().meta,...e},r={...this.getState().files};Object.keys(r).forEach(s=>{r[s]={...r[s],meta:{...r[s].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:r})}setFileMeta(e,t){let r={...this.getState().files};if(!r[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}let s={...r[e].meta,...t};r[e]={...r[e],meta:s},this.setState({files:r})}getFile(e){return this.getState().files[e]}getFiles(){let{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(t=>this.getFile(t))}getObjectOfFilesPerState(){let{files:e,totalProgress:t,error:r}=this.getState(),s=Object.values(e),n=[],o=[],a=[],l=[],c=[],d=[],f=[],y=[],v=[];for(let x of s){let{progress:P}=x;!P.uploadComplete&&P.uploadStarted&&(n.push(x),x.isPaused||y.push(x)),P.uploadStarted||o.push(x),(P.uploadStarted||P.preprocess||P.postprocess)&&a.push(x),P.uploadStarted&&l.push(x),x.isPaused&&c.push(x),P.uploadComplete&&d.push(x),x.error&&f.push(x),(P.preprocess||P.postprocess)&&v.push(x)}return{newFiles:o,startedFiles:a,uploadStartedFiles:l,pausedFiles:c,completeFiles:d,erroredFiles:f,inProgressFiles:n,inProgressNotPausedFiles:y,processingFiles:v,isUploadStarted:l.length>0,isAllComplete:t===100&&d.length===s.length&&v.length===0,isAllErrored:!!r&&f.length===s.length,isAllPaused:n.length!==0&&c.length===n.length,isUploadInProgress:n.length>0,isSomeGhost:s.some(x=>x.isGhost)}}validateRestrictions(e,t){t===void 0&&(t=this.getFiles());try{W(this,lt)[lt].validate(t,[e])}catch(r){return r}return null}validateSingleFile(e){try{W(this,lt)[lt].validateSingleFile(e)}catch(t){return t.message}return null}validateAggregateRestrictions(e){let t=this.getFiles();try{W(this,lt)[lt].validateAggregateRestrictions(t,e)}catch(r){return r.message}return null}checkIfFileAlreadyExists(e){let{files:t}=this.getState();return!!(t[e]&&!t[e].isGhost)}addFile(e){W(this,Dn)[Dn](e);let{nextFilesState:t,validFilesToAdd:r,errors:s}=W(this,Bn)[Bn]([e]),n=s.filter(a=>a.isRestriction);if(W(this,Lt)[Lt](n),s.length>0)throw s[0];this.setState({files:t});let[o]=r;return this.emit("file-added",o),this.emit("files-added",r),this.log(`Added file: ${o.name}, ${o.id}, mime type: ${o.type}`),W(this,Nn)[Nn](),o.id}addFiles(e){W(this,Dn)[Dn]();let{nextFilesState:t,validFilesToAdd:r,errors:s}=W(this,Bn)[Bn](e),n=s.filter(a=>a.isRestriction);W(this,Lt)[Lt](n);let o=s.filter(a=>!a.isRestriction);if(o.length>0){let a=`Multiple errors occurred while adding files:
88
88
  `;if(o.forEach(l=>{a+=`
89
89
  * ${l.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:o.length}),details:a},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(o,a);{let l=new Error(a);throw l.errors=o,l}}this.setState({files:t}),r.forEach(a=>{this.emit("file-added",a)}),this.emit("files-added",r),r.length>5?this.log(`Added batch of ${r.length} files`):Object.values(r).forEach(a=>{this.log(`Added file: ${a.name}
90
90
  id: ${a.id}