@uploadcare/file-uploader
Version:
Building blocks for Uploadcare products integration
7 lines • 320 kB
JavaScript
var UC=(function(exports){'use strict';/**
* @license
* Package: @uploadcare/file-uploader@1.28.0 (MIT)
* License: https://github.com/uploadcare/blob/main/LICENSE
* Built: 2026-04-03T13:57:53.160Z
*/
var Ms=Object.defineProperty;var gl=Object.getOwnPropertyDescriptor;var a=(r,i)=>Ms(r,"name",{value:i,configurable:true});var h=(r,i,t,e)=>{for(var o=e>1?void 0:e?gl(i,t):i,s=r.length-1,n;s>=0;s--)(n=r[s])&&(o=(e?n(i,t,o):n(o))||o);return e&&o&&Ms(i,t,o),o};var St=[],Zt=0,ki=4,Is=a(r=>{let i=[],t={get(){return t.lc||t.listen(()=>{})(),t.value},lc:0,listen(e){return t.lc=i.push(e),()=>{for(let s=Zt+ki;s<St.length;)St[s]===e?St.splice(s,ki):s+=ki;let o=i.indexOf(e);~o&&(i.splice(o,1),--t.lc||t.off());}},notify(e,o){let s=!St.length;for(let n of i)St.push(n,t.value,e,o);if(s){for(Zt=0;Zt<St.length;Zt+=ki)St[Zt](St[Zt+1],St[Zt+2],St[Zt+3]);St.length=0;}},off(){},set(e){let o=t.value;o!==e&&(t.value=e,t.notify(o));},subscribe(e){let o=t.listen(e);return e(t.value),o},value:r};return t},"atom");function Oi(r,i,t){let e=new Set(i).add(void 0);return r.listen((o,s,n)=>{e.has(n)&&t(o,s,n);})}a(Oi,"listenKeys");function eo(r,i,t){let e=Oi(r,i,t);return t(r.value),e}a(eo,"subscribeKeys");var io=a((r={})=>{let i=Is(r);return i.setKey=function(t,e){let o=i.value;typeof e>"u"&&t in i.value?(i.value={...i.value},delete i.value[t],i.notify(o,t)):i.value[t]!==e&&(i.value={...i.value,[t]:e},i.notify(o,t));},i},"map");var z=class r{static{a(this,"PubSub");}static{this.De=new Map;}constructor(i,t){this.Q=i,this.gt=t;}get id(){return this.Q}pub(i,t){i in this.gt.get()||console.warn(`PubSub#pub: Key "${String(i)}" not found`),this.gt.setKey(i,t);}sub(i,t,e=true){return (e?eo:Oi)(this.gt,[i],s=>{t(s[i]);})}read(i){return i in this.gt.get()||console.warn(`PubSub#read: Key "${String(i)}" not found`),this.gt.get()[i]}add(i,t,e=false){(!(i in this.gt.get())||e)&&this.gt.setKey(i,t);}has(i){return i in this.gt.get()}get store(){return this.gt.get()}static registerCtx(i,t){if(r.De.has(t))throw new Error(`PubSub: Context with id "${t}" already exists`);let e=io(i);return r.De.set(t,e),new r(t,e)}static deleteCtx(i){r.De.delete(i);}static getCtx(i){let t=r.De.get(i);return t?new r(i,t):null}static hasCtx(i){return r.De.has(i)}};var Mi=globalThis,Li=Mi.ShadowRoot&&(Mi.ShadyCSS===void 0||Mi.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Us=Symbol(),Ls=new WeakMap,Ii=class{static{a(this,"n");}constructor(i,t,e){if(this.zl=true,e!==Us)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=i,this.t=t;}get styleSheet(){let i=this.o,t=this.t;if(Li&&i===void 0){let e=t!==void 0&&t.length===1;e&&(i=Ls.get(t)),i===void 0&&((this.o=i=new CSSStyleSheet).replaceSync(this.cssText),e&&Ls.set(t,i));}return i}toString(){return this.cssText}},Ps=a(r=>new Ii(typeof r=="string"?r:r+"",void 0,Us),"r");var Rs=a((r,i)=>{if(Li)r.adoptedStyleSheets=i.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of i){let e=document.createElement("style"),o=Mi.litNonce;o!==void 0&&e.setAttribute("nonce",o),e.textContent=t.cssText,r.appendChild(e);}},"S"),ro=Li?r=>r:r=>r instanceof CSSStyleSheet?(i=>{let t="";for(let e of i.cssRules)t+=e.cssText;return Ps(t)})(r):r;var{is:yl,defineProperty:bl,getOwnPropertyDescriptor:wl,getOwnPropertyNames:Tl,getOwnPropertySymbols:El,getPrototypeOf:xl}=Object,Ui=globalThis,$s=Ui.trustedTypes,Cl=$s?$s.emptyScript:"",Sl=Ui.reactiveElementPolyfillSupport,Ye=a((r,i)=>r,"d"),Qe={toAttribute(r,i){switch(i){case Boolean:r=r?Cl:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r);}return r},fromAttribute(r,i){let t=r;switch(i){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r);}catch{t=null;}}return t}},Pi=a((r,i)=>!yl(r,i),"f"),Ds={attribute:true,type:String,converter:Qe,reflect:false,useDefault:false,hasChanged:Pi};Symbol.metadata??=Symbol("metadata"),Ui.litPropertyMetadata??=new WeakMap;var _t=class extends HTMLElement{static{a(this,"y");}static addInitializer(i){this.br(),(this.l??=[]).push(i);}static get observedAttributes(){return this.finalize(),this.vi&&[...this.vi.keys()]}static createProperty(i,t=Ds){if(t.state&&(t.attribute=false),this.br(),this.prototype.hasOwnProperty(i)&&((t=Object.create(t)).wrapped=true),this.elementProperties.set(i,t),!t.noAccessor){let e=Symbol(),o=this.getPropertyDescriptor(i,e,t);o!==void 0&&bl(this.prototype,i,o);}}static getPropertyDescriptor(i,t,e){let{get:o,set:s}=wl(this.prototype,i)??{get(){return this[t]},set(n){this[t]=n;}};return {get:o,set(n){let l=o?.call(this);s?.call(this,n),this.requestUpdate(i,l,e);},configurable:true,enumerable:true}}static getPropertyOptions(i){return this.elementProperties.get(i)??Ds}static br(){if(this.hasOwnProperty(Ye("elementProperties")))return;let i=xl(this);i.finalize(),i.l!==void 0&&(this.l=[...i.l]),this.elementProperties=new Map(i.elementProperties);}static finalize(){if(this.hasOwnProperty(Ye("finalized")))return;if(this.finalized=true,this.br(),this.hasOwnProperty(Ye("properties"))){let t=this.properties,e=[...Tl(t),...El(t)];for(let o of e)this.createProperty(o,t[o]);}let i=this[Symbol.metadata];if(i!==null){let t=litPropertyMetadata.get(i);if(t!==void 0)for(let[e,o]of t)this.elementProperties.set(e,o);}this.vi=new Map;for(let[t,e]of this.elementProperties){let o=this.wr(t,e);o!==void 0&&this.vi.set(o,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(i){let t=[];if(Array.isArray(i)){let e=new Set(i.flat(1/0).reverse());for(let o of e)t.unshift(ro(o));}else i!==void 0&&t.push(ro(i));return t}static wr(i,t){let e=t.attribute;return e===false?void 0:typeof e=="string"?e:typeof i=="string"?i.toLowerCase():void 0}constructor(){super(),this.yi=void 0,this.isUpdatePending=false,this.hasUpdated=false,this.ue=null,this.Hl();}Hl(){this.Tr=new Promise(i=>this.enableUpdating=i),this.jt=new Map,this.jl(),this.requestUpdate(),this.constructor.l?.forEach(i=>i(this));}addController(i){(this.Fe??=new Set).add(i),this.renderRoot!==void 0&&this.isConnected&&i.hostConnected?.();}removeController(i){this.Fe?.delete(i);}jl(){let i=new Map,t=this.constructor.elementProperties;for(let e of t.keys())this.hasOwnProperty(e)&&(i.set(e,this[e]),delete this[e]);i.size>0&&(this.yi=i);}createRenderRoot(){let i=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Rs(i,this.constructor.elementStyles),i}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this.Fe?.forEach(i=>i.hostConnected?.());}enableUpdating(i){}disconnectedCallback(){this.Fe?.forEach(i=>i.hostDisconnected?.());}attributeChangedCallback(i,t,e){this.Er(i,e);}Kl(i,t){let e=this.constructor.elementProperties.get(i),o=this.constructor.wr(i,e);if(o!==void 0&&e.reflect===true){let s=(e.converter?.toAttribute!==void 0?e.converter:Qe).toAttribute(t,e.type);this.ue=i,s==null?this.removeAttribute(o):this.setAttribute(o,s),this.ue=null;}}Er(i,t){let e=this.constructor,o=e.vi.get(i);if(o!==void 0&&this.ue!==o){let s=e.getPropertyOptions(o),n=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:Qe;this.ue=o;let l=n.fromAttribute(t,s.type);this[o]=l??this.xr?.get(o)??l,this.ue=null;}}requestUpdate(i,t,e,o=false,s){if(i!==void 0){let n=this.constructor;if(o===false&&(s=this[i]),e??=n.getPropertyOptions(i),!((e.hasChanged??Pi)(s,t)||e.useDefault&&e.reflect&&s===this.xr?.get(i)&&!this.hasAttribute(n.wr(i,e))))return;this.C(i,t,e);}this.isUpdatePending===false&&(this.Tr=this.Gl());}C(i,t,{useDefault:e,reflect:o,wrapped:s},n){e&&!(this.xr??=new Map).has(i)&&(this.xr.set(i,n??t??this[i]),s!==true||n!==void 0)||(this.jt.has(i)||(this.hasUpdated||e||(t=void 0),this.jt.set(i,t)),o===true&&this.ue!==i&&(this.bs??=new Set).add(i));}async Gl(){this.isUpdatePending=true;try{await this.Tr;}catch(t){Promise.reject(t);}let i=this.scheduleUpdate();return i!=null&&await i,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this.yi){for(let[o,s]of this.yi)this[o]=s;this.yi=void 0;}let e=this.constructor.elementProperties;if(e.size>0)for(let[o,s]of e){let{wrapped:n}=s,l=this[o];n!==true||this.jt.has(o)||l===void 0||this.C(o,void 0,s,l);}}let i=false,t=this.jt;try{i=this.shouldUpdate(t),i?(this.willUpdate(t),this.Fe?.forEach(e=>e.hostUpdate?.()),this.update(t)):this.Cr();}catch(e){throw i=false,this.Cr(),e}i&&this.ql(t);}willUpdate(i){}ql(i){this.Fe?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(i)),this.updated(i);}Cr(){this.jt=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.Tr}shouldUpdate(i){return true}update(i){this.bs&&=this.bs.forEach(t=>this.Kl(t,this[t])),this.Cr();}updated(i){}firstUpdated(i){}};_t.elementStyles=[],_t.shadowRootOptions={mode:"open"},_t[Ye("elementProperties")]=new Map,_t[Ye("finalized")]=new Map,Sl?.({ReactiveElement:_t}),(Ui.reactiveElementVersions??=[]).push("2.1.2");var so=globalThis,Fs=a(r=>r,"i"),Ri=so.trustedTypes,Vs=Ri?Ri.createPolicy("lit-html",{createHTML:a(r=>r,"createHTML")}):void 0,no="$lit$",Nt=`lit$${Math.random().toFixed(9).slice(2)}$`,ao="?"+Nt,Al=`<${ao}>`,he=document,ti=a(()=>he.createComment(""),"c"),ei=a(r=>r===null||typeof r!="object"&&typeof r!="function","a"),lo=Array.isArray,js=a(r=>lo(r)||typeof r?.[Symbol.iterator]=="function","d"),oo=`[ \f\r]`,Je=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_s=/-->/g,Ns=/>/g,de=RegExp(`>|${oo}(?:([^\\s"'>=/]+)(${oo}*=${oo}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),Bs=/'/g,zs=/"/g,Ks=/^(?:script|style|textarea|title)$/i,co=a(r=>(i,...t)=>({Kt:r,strings:i,values:t}),"x"),y=co(1);co(2);co(3);var tt=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),Hs=new WeakMap,pe=he.createTreeWalker(he,129);function Gs(r,i){if(!lo(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Vs!==void 0?Vs.createHTML(i):i}a(Gs,"V");var qs=a((r,i)=>{let t=r.length-1,e=[],o,s=i===2?"<svg>":i===3?"<math>":"",n=Je;for(let l=0;l<t;l++){let c=r[l],u,p,d=-1,m=0;for(;m<c.length&&(n.lastIndex=m,p=n.exec(c),p!==null);)m=n.lastIndex,n===Je?p[1]==="!--"?n=_s:p[1]!==void 0?n=Ns:p[2]!==void 0?(Ks.test(p[2])&&(o=RegExp("</"+p[2],"g")),n=de):p[3]!==void 0&&(n=de):n===de?p[0]===">"?(n=o??Je,d=-1):p[1]===void 0?d=-2:(d=n.lastIndex-p[2].length,u=p[1],n=p[3]===void 0?de:p[3]==='"'?zs:Bs):n===zs||n===Bs?n=de:n===_s||n===Ns?n=Je:(n=de,o=void 0);let f=n===de&&r[l+1].startsWith("/>")?" ":"";s+=n===Je?c+Al:d>=0?(e.push(u),c.slice(0,d)+no+c.slice(d)+Nt+f):c+Nt+(d===-2?l:f);}return [Gs(r,s+(r[t]||"<?>")+(i===2?"</svg>":i===3?"</math>":"")),e]},"N"),ii=class r{static{a(this,"S");}constructor({strings:i,Kt:t},e){let o;this.parts=[];let s=0,n=0,l=i.length-1,c=this.parts,[u,p]=qs(i,t);if(this.el=r.createElement(u,e),pe.currentNode=this.el.content,t===2||t===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes);}for(;(o=pe.nextNode())!==null&&c.length<l;){if(o.nodeType===1){if(o.hasAttributes())for(let d of o.getAttributeNames())if(d.endsWith(no)){let m=p[n++],f=o.getAttribute(d).split(Nt),v=/([.?@])?(.*)/.exec(m);c.push({type:1,index:s,name:v[2],strings:f,ctor:v[1]==="."?Di:v[1]==="?"?Fi:v[1]==="@"?Vi:fe}),o.removeAttribute(d);}else d.startsWith(Nt)&&(c.push({type:6,index:s}),o.removeAttribute(d));if(Ks.test(o.tagName)){let d=o.textContent.split(Nt),m=d.length-1;if(m>0){o.textContent=Ri?Ri.emptyScript:"";for(let f=0;f<m;f++)o.append(d[f],ti()),pe.nextNode(),c.push({type:2,index:++s});o.append(d[m],ti());}}}else if(o.nodeType===8)if(o.data===ao)c.push({type:2,index:s});else {let d=-1;for(;(d=o.data.indexOf(Nt,d+1))!==-1;)c.push({type:7,index:s}),d+=Nt.length-1;}s++;}}static createElement(i,t){let e=he.createElement("template");return e.innerHTML=i,e}};function me(r,i,t=r,e){if(i===tt)return i;let o=e!==void 0?t.Wl?.[e]:t.Zl,s=ei(i)?void 0:i.Sr;return o?.constructor!==s&&(o?.Ts?.(false),s===void 0?o=void 0:(o=new s(r),o.Ar(r,t,e)),e!==void 0?(t.Wl??=[])[e]=o:t.Zl=o),o!==void 0&&(i=me(r,o.Xl(r,i.values),o,e)),i}a(me,"M");var $i=class{static{a(this,"R");}constructor(i,t){this.Es=[],this.vt=void 0,this.xs=i,this.c=t;}get parentNode(){return this.c.parentNode}get W(){return this.c.W}u(i){let{el:{content:t},parts:e}=this.xs,o=(i?.creationScope??he).importNode(t,true);pe.currentNode=o;let s=pe.nextNode(),n=0,l=0,c=e[0];for(;c!==void 0;){if(n===c.index){let u;c.type===2?u=new ke(s,s.nextSibling,this,i):c.type===1?u=new c.ctor(s,c.name,c.strings,this,i):c.type===6&&(u=new _i(s,this,i)),this.Es.push(u),c=e[++l];}n!==c?.index&&(s=pe.nextNode(),n++);}return pe.currentNode=he,o}p(i){let t=0;for(let e of this.Es)e!==void 0&&(e.strings!==void 0?(e.yt(i,e,t),t+=e.strings.length-2):e.yt(i[t])),t++;}},ke=class r{static{a(this,"k");}get W(){return this.c?.W??this.Cs}constructor(i,t,e,o){this.type=2,this.i=R,this.vt=void 0,this.St=i,this.de=t,this.c=e,this.options=o,this.Cs=o?.isConnected??true;}get parentNode(){let i=this.St.parentNode,t=this.c;return t!==void 0&&i?.nodeType===11&&(i=t.parentNode),i}get startNode(){return this.St}get endNode(){return this.de}yt(i,t=this){i=me(this,i,t),ei(i)?i===R||i==null||i===""?(this.i!==R&&this.pe(),this.i=R):i!==this.i&&i!==tt&&this.Ss(i):i.Kt!==void 0?this.$(i):i.nodeType!==void 0?this.T(i):js(i)?this.k(i):this.Ss(i);}O(i){return this.St.parentNode.insertBefore(i,this.de)}T(i){this.i!==i&&(this.pe(),this.i=this.O(i));}Ss(i){this.i!==R&&ei(this.i)?this.St.nextSibling.data=i:this.T(he.createTextNode(i)),this.i=i;}$(i){let{values:t,Kt:e}=i,o=typeof e=="number"?this.Yl(i):(e.el===void 0&&(e.el=ii.createElement(Gs(e.h,e.h[0]),this.options)),e);if(this.i?.xs===o)this.i.p(t);else {let s=new $i(o,this),n=s.u(this.options);s.p(t),this.T(n),this.i=s;}}Yl(i){let t=Hs.get(i.strings);return t===void 0&&Hs.set(i.strings,t=new ii(i)),t}k(i){lo(this.i)||(this.i=[],this.pe());let t=this.i,e,o=0;for(let s of i)o===t.length?t.push(e=new r(this.O(ti()),this.O(ti()),this,this.options)):e=t[o],e.yt(s),o++;o<t.length&&(this.pe(e&&e.de.nextSibling,o),t.length=o);}pe(i=this.St.nextSibling,t){for(this.bi?.(false,true,t);i!==this.de;){let e=Fs(i).nextSibling;Fs(i).remove(),i=e;}}setConnected(i){this.c===void 0&&(this.Cs=i,this.bi?.(i));}},fe=class{static{a(this,"H");}get tagName(){return this.element.tagName}get W(){return this.c.W}constructor(i,t,e,o,s){this.type=1,this.i=R,this.vt=void 0,this.element=i,this.name=t,this.c=o,this.options=s,e.length>2||e[0]!==""||e[1]!==""?(this.i=Array(e.length-1).fill(new String),this.strings=e):this.i=R;}yt(i,t=this,e,o){let s=this.strings,n=false;if(s===void 0)i=me(this,i,t,0),n=!ei(i)||i!==this.i&&i!==tt,n&&(this.i=i);else {let l=i,c,u;for(i=s[0],c=0;c<s.length-1;c++)u=me(this,l[e+c],t,c),u===tt&&(u=this.i[c]),n||=!ei(u)||u!==this.i[c],u===R?i=R:i!==R&&(i+=(u??"")+s[c+1]),this.i[c]=u;}n&&!o&&this.j(i);}j(i){i===R?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,i??"");}},Di=class extends fe{static{a(this,"I");}constructor(){super(...arguments),this.type=3;}j(i){this.element[this.name]=i===R?void 0:i;}},Fi=class extends fe{static{a(this,"L");}constructor(){super(...arguments),this.type=4;}j(i){this.element.toggleAttribute(this.name,!!i&&i!==R);}},Vi=class extends fe{static{a(this,"z");}constructor(i,t,e,o,s){super(i,t,e,o,s),this.type=5;}yt(i,t=this){if((i=me(this,i,t,0)??R)===tt)return;let e=this.i,o=i===R&&e!==R||i.capture!==e.capture||i.once!==e.once||i.passive!==e.passive,s=i!==R&&(e===R||o);o&&this.element.removeEventListener(this.name,this,e),s&&this.element.addEventListener(this.name,this,i),this.i=i;}handleEvent(i){typeof this.i=="function"?this.i.call(this.options?.host??this.element,i):this.i.handleEvent(i);}},_i=class{static{a(this,"Z");}constructor(i,t,e){this.element=i,this.type=6,this.vt=void 0,this.c=t,this.options=e;}get W(){return this.c.W}yt(i){me(this,i);}},Ws={I:ke},kl=so.litHtmlPolyfillSupport;kl?.(ii,ke),(so.litHtmlVersions??=[]).push("3.3.2");var Zs=a((r,i,t)=>{let e=t?.renderBefore??i,o=e.Ql;if(o===void 0){let s=t?.renderBefore??null;e.Ql=o=new ke(i.insertBefore(ti(),s),s,void 0,t??{});}return o.yt(r),o},"D");var uo=globalThis,bt=class extends _t{static{a(this,"i");}constructor(){super(...arguments),this.renderOptions={host:this},this.kr=void 0;}createRenderRoot(){let i=super.createRenderRoot();return this.renderOptions.renderBefore??=i.firstChild,i}update(i){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(i),this.kr=Zs(t,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this.kr?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this.kr?.setConnected(false);}render(){return tt}};bt.np=true,bt.finalized=true,uo.litElementHydrateSupport?.({LitElement:bt});var Ol=uo.litElementPolyfillSupport;Ol?.({LitElement:bt});(uo.litElementVersions??=[]).push("4.2.2");var Ml=/\\([0-9a-fA-F]{1,6} ?)/g;function Il(r){return r.length<2?false:(r[0]==='"'||r[0]==="'")&&(r[r.length-1]==='"'||r[r.length-1]==="'")}a(Il,"hasLeadingTrailingQuotes");function Ll(r){let i=r;return (i[0]==='"'||i[0]==="'")&&(i=i.slice(1)),(i[i.length-1]==='"'||i[i.length-1]==="'")&&(i=i.slice(0,-1)),i}a(Ll,"trimQuotes");function Ul(r){let i="",t="";for(let e=0;e<r.length;e++){let o=r[e+1];r[e]==="\\"&&o==='"'?(i+='\\"',e++):r[e]==='"'&&t!=="\\"?i+='\\"':i+=r[e],t=r[e]??"";}return i}a(Ul,"escapeQuotes");function Xs(r){let i=r;Il(r)&&(i=Ll(i),i=i.replace(Ml,(t,e)=>String.fromCodePoint(parseInt(e.trim(),16))),i=i.replaceAll(`\\ `,"\\n"),i=Ul(i),i='"'+i+'"');try{return JSON.parse(i)}catch{return}}a(Xs,"parseCssPropertyValue");function Oe(r){class i extends r{constructor(){super(...arguments);this.As=null;this.Or=null;}static{a(this,"CssDataMixinClass");}getCssData(o,s=false){let n=this.As??Object.create(null);if(!Object.keys(n).includes(o)||!n[o]){this.Or||(this.Or=window.getComputedStyle(this));let l=this.Or.getPropertyValue(o).trim();try{n[o]=Xs(l);}catch(c){s||console.warn(`CSS Data error: ${o}`,c),n[o]=null;}}return this.As=n,n[o]}}return i}a(Oe,"CssDataMixin");function Ni(r){class i extends r{constructor(){super(...arguments);this.willYield=true;this.Gt={};this.qt=null;this.wi=false;}static{a(this,"LightDomMixinClass");}createRenderRoot(){return this}connectedCallback(){this.qt||(this.qt=Array.from(this.childNodes)),super.connectedCallback();}Jl(){if(this.wi)return;this.wi=true,this.Gt={};let o=Array.from(this.childNodes),s=o.length?o:this.qt??[];for(let n of s){let l=this.ks(n),c=this.Gt[l]??[];n instanceof Element&&(n.removeAttribute("slot"),n.removeAttribute("content-for")),c.push(n),this.Gt[l]=c;}this.qt=null;}ks(o){return o instanceof Comment&&o.nextSibling instanceof Element?this.ks(o.nextSibling):"contentFor"in o?o.contentFor||"":o instanceof Element&&o.hasAttribute("content-for")&&o.getAttribute("content-for")||""}tc(o){return !o.textContent||!o.textContent.trim()}ec(o){let s=this.Gt[o];return !s||s.every(n=>n instanceof Comment||n instanceof Text&&this.tc(n))}update(o){!this.hasUpdated&&this.willYield&&this.Jl(),super.update(o);}yield(o,s){if(o===""&&!this.Gt[o]&&!this.wi&&this.qt?.length){let l=[];for(let c of this.qt)c instanceof Element&&(c.removeAttribute("slot"),c.removeAttribute("content-for")),l.push(c);this.Gt[o]=l,this.wi=true,this.qt=null;}let n=this.Gt[o];return y` ${n} ${this.ec(o)?s:void 0} `}}return i}a(Ni,"LightDomMixin");function Me(r){class i extends r{static{a(this,"RegisterableElementMixinClass");}static reg(e){let o=this,s=window.customElements.get(e);if(s){s!==o&&console.warn([`Element with tag name "${e}" already registered.`,`You're trying to override it with another class "${this.name}".`,"This is most likely a mistake.","New element will not be registered."].join(` `));return}window.customElements.define(e,o);}}return i}a(Me,"RegisterableElementMixin");var Xt=class extends Event{static{a(this,"s");}constructor(i,t,e,o){super("context-request",{bubbles:true,composed:true}),this.context=i,this.contextTarget=t,this.callback=e,this.subscribe=o??false;}};var Ie=class{static{a(this,"s");}constructor(i,t,e,o){if(this.subscribe=false,this.provided=false,this.value=void 0,this.t=(s,n)=>{this.unsubscribe&&(this.unsubscribe!==n&&(this.provided=false,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=s,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=true,this.callback&&this.callback(s,n)),this.unsubscribe=n;},this.host=i,t.context!==void 0){let s=t;this.context=s.context,this.callback=s.callback,this.subscribe=s.subscribe??false;}else this.context=t,this.callback=e,this.subscribe=o??false;this.host.addController(this);}hostConnected(){this.dispatchRequest();}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0);}dispatchRequest(){this.host.dispatchEvent(new Xt(this.context,this.host,this.t,this.subscribe));}};var Bi=class{static{a(this,"s");}get value(){return this.o}set value(i){this.setValue(i);}setValue(i,t=false){let e=t||!Object.is(i,this.o);this.o=i,e&&this.updateObservers();}constructor(i){this.subscriptions=new Map,this.updateObservers=()=>{for(let[t,{disposer:e}]of this.subscriptions)t(this.o,e);},i!==void 0&&(this.value=i);}addCallback(i,t,e){if(!e)return void i(this.value);this.subscriptions.has(i)||this.subscriptions.set(i,{disposer:a(()=>{this.subscriptions.delete(i);},"disposer"),consumerHost:t});let{disposer:o}=this.subscriptions.get(i);i(this.value,o);}clearCallbacks(){this.subscriptions.clear();}};var po=class extends Event{static{a(this,"e");}constructor(i,t){super("context-provider",{bubbles:true,composed:true}),this.context=i,this.contextTarget=t;}},Le=class extends Bi{static{a(this,"i");}constructor(i,t,e){super(t.context!==void 0?t.initialValue:e),this.onContextRequest=o=>{if(o.context!==this.context)return;let s=o.contextTarget??o.composedPath()[0];s!==this.host&&(o.stopPropagation(),this.addCallback(o.callback,s,o.subscribe));},this.onProviderRequest=o=>{if(o.context!==this.context||(o.contextTarget??o.composedPath()[0])===this.host)return;let s=new Set;for(let[n,{consumerHost:l}]of this.subscriptions)s.has(n)||(s.add(n),l.dispatchEvent(new Xt(this.context,l,n,true)));o.stopPropagation();},this.host=i,t.context!==void 0?this.context=t.context:this.context=t,this.attachListeners(),this.host.addController?.(this);}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest);}hostConnected(){this.host.dispatchEvent(new po(this.context,this.host));}};var Rl={attribute:true,type:String,converter:Qe,reflect:false,hasChanged:Pi},$l=a((r=Rl,i,t)=>{let{kind:e,metadata:o}=t,s=globalThis.litPropertyMetadata.get(o);if(s===void 0&&globalThis.litPropertyMetadata.set(o,s=new Map),e==="setter"&&((r=Object.create(r)).wrapped=true),s.set(t.name,r),e==="accessor"){let{name:n}=t;return {set(l){let c=i.get.call(this);i.set.call(this,l),this.requestUpdate(n,c,r,true,l);},init(l){return l!==void 0&&this.C(n,void 0,r,l),l}}}if(e==="setter"){let{name:n}=t;return function(l){let c=this[n];i.call(this,l),this.requestUpdate(n,c,r,true,l);}}throw Error("Unsupported decorator location: "+e)},"r");function b(r){return (i,t)=>typeof t=="object"?$l(r,i,t):((e,o,s)=>{let n=o.hasOwnProperty(s);return o.constructor.createProperty(s,e),n?Object.getOwnPropertyDescriptor(o,s):void 0})(r,i,t)}a(b,"n");function g(r){return b({...r,state:true,attribute:false})}a(g,"r");function D(r,i){let t,e=a(((...o)=>{t&&clearTimeout(t),t=setTimeout(()=>r(...o),i);}),"debounced");return e.cancel=()=>{t&&clearTimeout(t);},e}a(D,"debounce");var Ys="ctx-name-context";function Hi(){return function(r){class i extends r{constructor(...o){super(...o);this.J=null;this.Ne=false;this.Mr=false;this.Ir=void 0;this.he=new Map;this.Ve=new Set;this.init$={};this.ctxOwner=false;this.Ti=void 0;this.Ei=false;this.ctxName=this.Pt;this.Rt=false;this.Ti=this.getAttribute("ctx-name")||void 0,this.ctxName=this.Pt,this.ic=new Ie(this,{context:Ys,callback:a(s=>{if(!s){console.error("SymbioteMixin: Received invalid ctx-name from context");return}this.Is=s,this.Ms();},"callback"),subscribe:true});}static{a(this,"SymbioteMixinClass");}static set template(o){console.error("Caution: static 'template' property is deprecated and has no effect. See https://github.com/uploadcare/file-uploader/releases/tag/v1.25.0 for details.");}get Os(){return this.Ti}set Os(o){let s=o??void 0;this.Ti!==s&&(this.Ti=s,this.Ms());}shouldUpdate(o){return this.Rt?super.shouldUpdate(o):false}get Pt(){return this.Os||this.Is||void 0}Ms(){if(this.ctxName=this.Pt,!(!this.ctxName||this.Ne)){if(this.isConnected){this.Lr();return}this.Ei=true;}}willUpdate(o){super.willUpdate(o),this.ctxName=this.Pt,this.ctxName&&(this.Ir?this.Ir.setValue(this.ctxName):this.Ir=new Le(this,{context:Ys,initialValue:this.ctxName}));}Ls(){if(!(!this.J||this.he.size===0)){for(let[o,{value:s,rewrite:n}]of this.he)this.J.add(o,s,n);this.he.clear();}}Us(){return !this.J&&this.Pt&&this.Ur(),this.J&&this.Ls(),this.J}xi(){let o=this.Us();if(!o)throw new Error("SymbioteMixin: Shared context is not initialized.");return o}Ur(){let o=this.init$,s=this.Pt;if(!s){console.error("SymbioteMixin: ctx-name is required for components with shared properties (*)");return}if(!this.J){this.J=z.getCtx(s)??z.registerCtx(o,s);for(let[n,l]of Object.entries(this.init$))this.J.add(n,l,this.ctxOwner);this.Ls();}}get $(){return this.Pt&&this.Ur(),new Proxy({},{get:a((o,s)=>{if(typeof s=="string")return this.J?.read(s)},"get"),set:a((o,s,n)=>(typeof s!="string"||this.J?.pub(s,n),true),"set")})}sub(o,s,n=true){let l=this.xi().sub(o,s,n);if(!l||typeof l!="function")return ()=>{};let c=l.bind(l),u=false,p=a(()=>{u||(u=true,c(),this.Ve.delete(p));},"trackedRemove");return this.Ve.add(p),p}pub(o,s){this.xi().pub(o,s);}set$(o){for(let[s,n]of Object.entries(o))this.pub(s,n);}get sharedCtx(){return this.xi()}has(o){return this.J?.has(o)??false}add(o,s,n=false){let l=this.Us();if(!l){if(!n&&this.he.has(o))return;this.he.set(o,{value:s,rewrite:n});return}this.he.delete(o),l.add(o,s,n);}add$(o,s=false){for(let[n,l]of Object.entries(o))this.add(n,l,s);}connectedCallback(){super.connectedCallback(),this.Ne?this.Rt&&this.Mr&&(this.Mr=false,this.initCallback()):this.ctxName?(this.Ei=false,this.Lr()):this.Ei&&this.Pt&&(this.Ei=false,this.Lr());}Lr(){if(this.Ne)return;this.Ne=true,this.Ur();let o=this.init$;if(Object.keys(o).length>0){let s=this.xi();for(let[n,l]of Object.entries(o))s.read(n)===void 0&&s.pub(n,l),this.sub(n,D(async()=>{this.isConnected&&(await this.updateComplete,this.requestUpdate());},0),false);}this.initCallback(),this.Rt=true,this.requestUpdate();}firstUpdated(o){super.firstUpdated(o);}disconnectedCallback(){this.rc(),super.disconnectedCallback(),this.Ne&&(this.Mr=true);}rc(){if(this.Ve.size!==0){for(let o of [...this.Ve])o();this.Ve.clear();}}initCallback(){}}return h([b({type:String,attribute:"ctx-name",noAccessor:true})],i.prototype,"Os",1),h([g()],i.prototype,"Is",2),h([g()],i.prototype,"ctxName",2),h([g()],i.prototype,"Rt",2),i}}a(Hi,"SymbioteMixin");var ho=class extends Me(Hi()(Oe(Ni(bt)))){static{a(this,"BaseComponent");}};var dt=class r{static{a(this,"UID");}static generateFastUid(){return `uid-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,11)}`}static generateRandomUUID(){let i=globalThis.crypto;return i&&typeof i.randomUUID=="function"?i.randomUUID():r.generateFastUid()}};var Dl=["UploaderBlock","ActivityBlock","Block","SolutionBlock"];function mo(r){for(let i in r){if(Dl.includes(i))continue;let t=[...i].reduce((e,o)=>(o.toUpperCase()===o&&(o=`-${o.toLowerCase()}`),e+=o,e),"");t.startsWith("-")&&(t=t.replace("-","")),t.startsWith("uc-")||(t=`uc-${t}`),r[i].reg&&r[i].reg(t);}}a(mo,"defineComponents");var fo="UC";function Fl(r,i=false){return new Promise((t,e)=>{if(typeof document!="object"){t(null);return}if(typeof window=="object"&&window[fo]){t(window[fo]);return}let o=document.createElement("script");o.async=true,o.src=r,o.onerror=()=>{e();},o.onload=()=>{let s=window[fo];i&&mo(s),t(s);},document.head.appendChild(o);})}a(Fl,"loadFileUploaderFrom");var ri={"locale-id":"en","social-source-lang":"en","upload-file":"Upload file","upload-files":"Upload files","choose-file":"Choose file","choose-files":"Choose files","drop-files-here":"Drop files here","drop-file-here":"Drop file here","select-file-source":"Select file source",selected:"Selected",upload:"Upload","add-more":"Add more",cancel:"Cancel","start-from-cancel":"Cancel",clear:"Clear","camera-shot":"Shot","upload-url":"Import","upload-url-placeholder":"Paste link here","edit-image":"Edit image","edit-detail":"Details",back:"Back",done:"Done",ok:"Ok","remove-from-list":"Remove",no:"No",yes:"Yes","confirm-your-action":"Confirm your action","are-you-sure":"Are you sure?","selected-count":"{{count}} of {{total}} selected","select-all":"Select all","deselect-all":"Deselect all","upload-error":"Upload error","validation-error":"Validation error","no-files":"No files selected",browse:"Browse","not-uploaded-yet":"Not uploaded yet...",file__one:"file",file__other:"files",error__one:"error",error__other:"errors","header-uploading":"Uploading {{count}} {{plural:file(count)}}","header-failed":"{{count}} {{plural:error(count)}}","header-succeed":"{{count}} {{plural:file(count)}} uploaded","header-total":"{{count}} {{plural:file(count)}} selected","src-type-local":"From device","src-type-from-url":"From link","src-type-camera":"Camera","src-type-mobile-video-camera":"Video","src-type-mobile-photo-camera":"Photo","src-type-draw":"Draw","src-type-facebook":"Facebook","src-type-dropbox":"Dropbox","src-type-gdrive":"Google Drive","src-type-ngdrive":"Google Drive","src-type-gphotos":"Google Photos","src-type-flickr":"Flickr","src-type-vk":"VK","src-type-evernote":"Evernote","src-type-box":"Box","src-type-onedrive":"OneDrive","src-type-huddle":"Huddle","src-type-other":"Other","caption-from-url":"Import from link","caption-camera":"Camera","caption-draw":"Draw","caption-edit-file":"Edit file","file-no-name":"No name...","toggle-fullscreen":"Toggle fullscreen","toggle-guides":"Toggle guides",rotate:"Rotate","flip-vertical":"Flip vertical","flip-horizontal":"Flip horizontal",apply:"Apply",brightness:"Brightness",contrast:"Contrast",saturation:"Saturation",exposure:"Exposure",gamma:"Gamma",vibrance:"Vibrance",warmth:"Warmth",enhance:"Enhance",original:"Original",resize:"Resize image",crop:"Crop","select-color":"Select color",text:"Text",draw:"Draw","cancel-edit":"Cancel edit","tab-view":"Preview","tab-details":"Details","file-name":"Name","file-size":"Size","cdn-url":"CDN URL","file-size-unknown":"Unknown","camera-permissions-denied":"Camera access denied","camera-permissions-prompt":"Please allow access to the camera","camera-permissions-request":"Request access","files-count-limit-error-title":"Files count limit overflow","files-count-limit-error-too-few":"You\u2019ve chosen {{total}} {{plural:file(total)}}. At least {{min}} {{plural:file(min)}} required.","files-count-limit-error-too-many":"You\u2019ve chosen too many files. {{max}} {{plural:file(max)}} is maximum.","files-max-size-limit-error":"File is too big. Max file size is {{maxFileSize}}.","has-validation-errors":"File validation error occurred. Please, check your files before upload.","images-only-accepted":"Only image files are accepted.","file-type-not-allowed":"Uploading of these file types is not allowed.","some-files-were-not-uploaded":"Some files were not uploaded.","file-item-edit-button":"Edit","file-item-remove-button":"Remove","a11y-editor-tab-filters":"Filters","a11y-editor-tab-tuning":"Tuning","a11y-editor-tab-crop":"Crop","a11y-activity-header-button-close":"Close",flip:"Flip",mirror:"Mirror","a11y-cloud-editor-apply-filter":"Apply {{name}} filter","a11y-cloud-editor-apply-crop":"Apply {{name}} operation","a11y-cloud-editor-apply-tuning":"Apply {{name}} tuning","a11y-cloud-editor-apply-aspect-ratio":"Apply operation {{name}} {{value}}",finished:"Finished",failed:"Failed",uploading:"Uploading",idle:"Idle","a11y-file-item-status":"File {{fileName}} in status {{status}}","waiting-for":"Waiting for {{source}}","queued-uploading":"Queued for upload","queued-validation":"Queued for validation",validation:"Validating","crop-to-shape":"Crop to {{value}}",custom:"Freeform","freeform-crop":"Freeform crop"};var go=new Map,Qs=new Map,Js=a((r,i)=>{go.has(r)&&console.log(`Locale ${r} is already defined. Overwriting...`);let t={...ri,...i};return go.set(r,t),t},"defineLocaleSync"),Vl=a((r,i)=>{Qs.set(r,i);},"defineLocaleAsync"),tn=a((r,i)=>{typeof i=="function"?Vl(r,i):Js(r,i);},"defineLocale"),en=a(async r=>{let i=go.get(r);if(!i){let t=Qs.get(r);if(!t)throw new Error(`Locale ${r} is not defined`);let e=await t();i=Js(r,e);}return i},"resolveLocaleDefinition");tn("en",ri);var U=a(r=>`*cfg/${r}`,"sharedConfigKey");var lt=a(r=>r?r.split(",").map(i=>i.trim()).filter(Boolean):[],"deserializeCsv"),Bt=a(r=>r.join(","),"serializeCsv");var rn=a(r=>{if(typeof r!="string"||!r)return "";let i=r.trim();return i.startsWith("-/")?i=i.slice(2):i.startsWith("/")&&(i=i.slice(1)),i.endsWith("/")&&(i=i.slice(0,i.length-1)),i},"normalizeCdnOperation"),ji=a((...r)=>r.filter(i=>typeof i=="string"&&!!i).map(i=>rn(i)).join("/-/"),"joinCdnOperations"),et=a((...r)=>{let i=ji(...r);return i?`-/${i}/`:""},"createCdnUrlModifiers");function Ki(r){let i=new URL(r),t=i.pathname+i.search+i.hash,e=t.lastIndexOf("http"),o=t.lastIndexOf("/"),s="";return e>=0?s=t.slice(e):o>=0&&(s=t.slice(o+1)),s}a(Ki,"extractFilename");function Gi(r){let i=new URL(r),{pathname:t}=i,e=t.indexOf("/"),o=t.indexOf("/",e+1);return t.substring(e+1,o)}a(Gi,"extractUuid");function vo(r){let i=on(r),t=new URL(i),e=t.pathname.indexOf("/-/");return e===-1?"":t.pathname.substring(e).slice(1)}a(vo,"extractCdnUrlModifiers");function yo(r){return vo(r).split("/-/").filter(Boolean).map(t=>rn(t))}a(yo,"extractOperations");function on(r){let i=new URL(r),t=Ki(r),e=sn(t)?nn(t).pathname:t;return i.pathname=i.pathname.replace(e,""),i.search="",i.hash="",i.toString()}a(on,"trimFilename");function sn(r){return r.startsWith("http")}a(sn,"isFileUrl");function nn(r){let i=new URL(r);return {pathname:`${i.origin}${i.pathname??""}`,search:i.search??"",hash:i.hash??""}}a(nn,"splitFileUrl");var G=a((r,i,t)=>{let e=new URL(on(r)),o=t??Ki(r),s=i??"";if(e.pathname.startsWith("//")&&(e.pathname=e.pathname.replace("//","/")),o&&sn(o)){let n=nn(o);e.pathname=`${e.pathname}${s}${n.pathname||""}`,e.search=n.search,e.hash=n.hash;}else e.pathname=`${e.pathname}${s}${o||""}`;return e.toString()},"createCdnUrl"),Yt=a((r,i)=>{let t=new URL(r);return t.pathname=`${i}/`,t.toString()},"createOriginalUrl");var q=a((r,i=",")=>r.trim().split(i).map(t=>t.trim()).filter(t=>t.length>0),"stringToArray");var oi=Object.freeze({brightness:0,exposure:0,gamma:100,contrast:0,saturation:0,vibrance:0,warmth:0,enhance:0,filter:0,rotate:0,mirror:false,flip:false,crop:void 0}),ln=["enhance","brightness","exposure","gamma","contrast","saturation","vibrance","warmth","filter","mirror","flip","rotate","crop"];function _l(r,i){if(typeof i=="number"){let t=i;return oi[r]!==t?`${r}/${t}`:""}if(typeof i=="boolean"){let t=i;return oi[r]!==t?`${r}`:""}if(r==="filter"&&i){let{name:t,amount:e}=i;return oi.filter===e?"":`${r}/${t}/${e}`}if(r==="crop"&&i){let{dimensions:t,coords:e}=i;return `${r}/${t.join("x")}/${e.join(",")}`}return ""}a(_l,"transformationToStr");function Qt(r){return ji(...ln.filter(i=>typeof r[i]<"u"&&r[i]!==null).map(i=>{let t=r[i];return _l(i,t)}).filter(i=>!!i))}a(Qt,"transformationsToOperations");var qi=ji("format/auto","progressive/yes"),zt=a(([r])=>typeof r<"u"?Number(r):void 0,"asNumber"),an=a(()=>true,"asBoolean"),Nl=a(([r,i])=>({name:r,amount:typeof i<"u"?Number(i):100}),"asFilter"),Bl=a(([r,i])=>{if(!/\d+x\d+/.test(r)||!/\d+,\d+/.test(i))throw new Error("Crop by aspect ratio, percentage or alignment shortcuts is not supported.");return {dimensions:q(r,"x").map(Number),coords:q(i).map(Number)}},"asCrop"),zl=Object.freeze({enhance:zt,brightness:zt,exposure:zt,gamma:zt,contrast:zt,saturation:zt,vibrance:zt,warmth:zt,filter:Nl,mirror:an,flip:an,rotate:zt,crop:a(r=>{let[i,t]=r,{dimensions:e,coords:o}=Bl([i,t]);return {dimensions:e,coords:o}},"crop")});function bo(r){let i={};for(let t of r){let[e,...o]=t.split("/");if(!e||!ln.includes(e))continue;let s=e,n=zl[s];try{let l=n(o);i[s]=l;}catch(l){console.warn([`Failed to parse URL operation "${t}". It will be ignored.`,l instanceof Error?`Error message: "${l.message}"`:l,"If you need this functionality, please feel free to open an issue at https://github.com/uploadcare/blocks/issues/new"].join(` `));}}return i}a(bo,"operationsToTransformations");var N=Object.freeze({CROP:"crop",TUNING:"tuning",FILTERS:"filters"}),it=Object.freeze([N.CROP,N.TUNING,N.FILTERS]),cn=Object.freeze(["brightness","exposure","gamma","contrast","saturation","vibrance","warmth","enhance"]),un=Object.freeze(["adaris","briaril","calarel","carris","cynarel","cyren","elmet","elonni","enzana","erydark","fenralan","ferand","galen","gavin","gethriel","iorill","iothari","iselva","jadis","lavra","misiara","namala","nerion","nethari","pamaya","sarnar","sedis","sewen","sorahel","sorlen","tarian","thellassan","varriel","varven","vevera","virkas","yedis","yllara","zatvel","zevcen"]),dn=Object.freeze(["rotate","mirror","flip"]),Ht=oi,At=Object.freeze({brightness:{zero:Ht.brightness,range:[-100,100],keypointsNumber:2},exposure:{zero:Ht.exposure,range:[-500,500],keypointsNumber:2},gamma:{zero:Ht.gamma,range:[0,1e3],keypointsNumber:2},contrast:{zero:Ht.contrast,range:[-100,500],keypointsNumber:2},saturation:{zero:Ht.saturation,range:[-100,500],keypointsNumber:1},vibrance:{zero:Ht.vibrance,range:[-100,500],keypointsNumber:1},warmth:{zero:Ht.warmth,range:[-100,100],keypointsNumber:1},enhance:{zero:Ht.enhance,range:[0,100],keypointsNumber:1},filter:{zero:Ht.filter,range:[0,100],keypointsNumber:1}});var si="https://ucarecdn.com",Hl="https://upload.uploadcare.com",jl="https://social.uploadcare.com",Kl="https://ucarecd.net",Gl={pubkey:"",multiple:true,multipleMin:0,multipleMax:Number.MAX_SAFE_INTEGER,confirmUpload:false,imgOnly:false,accept:"",externalSourcesPreferredTypes:"",externalSourcesEmbedCss:"",store:"auto",cameraMirror:false,cameraCapture:"",sourceList:"local, url, camera, dropbox, gdrive",topLevelOrigin:"",cloudImageEditorTabs:Bt(it),maxLocalFileSizeBytes:0,thumbSize:76,showEmptyList:false,useLocalImageEditor:false,useCloudImageEditor:true,removeCopyright:false,cropPreset:"",imageShrink:"",modalScrollLock:true,modalBackdropStrokes:false,sourceListWrap:true,remoteTabSessionKey:"",cdnCname:si,cdnCnamePrefixed:Kl,baseUrl:Hl,socialBaseUrl:jl,secureSignature:"",secureExpire:"",secureDeliveryProxy:"",retryThrottledRequestMaxTimes:3,retryNetworkErrorMaxTimes:3,multipartMinFileSize:26214400,multipartChunkSize:5242880,maxConcurrentRequests:10,multipartMaxConcurrentRequests:4,multipartMaxAttempts:3,checkForUrlDuplicates:false,saveUrlForRecurrentUploads:false,groupOutput:false,userAgentIntegration:"",debug:false,metadata:null,localeName:"en",localeDefinitionOverride:null,secureUploadsExpireThreshold:600*1e3,secureUploadsSignatureResolver:null,secureDeliveryProxyUrlResolver:null,iconHrefResolver:null,fileValidators:[],collectionValidators:[],validationTimeout:15*1e3,validationConcurrency:100,cameraModes:"photo, video",defaultCameraMode:null,enableAudioRecording:true,enableVideoRecording:null,maxVideoRecordingDuration:null,mediaRecorderOptions:null,filesViewMode:"list",gridShowFileNames:false,cloudImageEditorAutoOpen:false,cloudImageEditorMaskHref:null,testMode:false,qualityInsights:true,pasteScope:"local"},Q=Object.freeze(Gl);var Wi=a((r,i)=>(...t)=>{let e=r();if(!e.read(U("debug")))return;let o=t;if(typeof t?.[0]=="function"){let n=t[0];o=n();}let s=[e.id,i].filter(Boolean);console.log(`[${s.join("][")}]`,...o);},"createDebugPrinter");var Z=class{constructor(i){this.Pr=new Set;this.Wt=null;this.z=Wi(()=>this.r.ctx,this.constructor.name);this.r=i,this.e=i.ctx;}static{a(this,"SharedInstance");}addSub(i){this.Pr.add(i);}get Zt(){if(!this.Wt){let i={};this.Wt=new Proxy(i,{set:a(()=>{throw new Error("SharedInstance cfg proxy is read-only")},"set"),get:a((t,e)=>{if(typeof e!="string")return;let o=U(e);return this.r.ctx.has(o)?this.r.ctx.read(o):Q[e]},"get")});}return this.Wt}destroy(){for(let i of this.Pr)try{i();}catch{}this.Pr.clear();}},Lt=a((r,i,t=true)=>{let e=r.has(i),o=e?r.read(i):null;if(e&&o||!t)return o;throw new Error(`Unexpected error: shared instance for key "${String(i)}" is not available`)},"getSharedInstance"),pn=a(r=>({get ctx(){return r()},get modalManager(){return Lt(r(),"*modalManager",false)},get telemetryManager(){return Lt(r(),"*telemetryManager")},get localeManager(){return Lt(r(),"*localeManager")},get a11y(){return Lt(r(),"*a11y")},get blocksRegistry(){return Lt(r(),"*blocksRegistry")},get eventEmitter(){return Lt(r(),"*eventEmitter")},get uploadCollection(){return Lt(r(),"*uploadCollection")},get secureUploadsManager(){return Lt(r(),"*secureUploadsManager",false)},get api(){return Lt(r(),"*publicApi")},get validationManager(){return Lt(r(),"*validationManager")}}),"createSharedInstancesBag");var W=Object.freeze({ADD:"modal:add",DELETE:"modal:delete",OPEN:"modal:open",CLOSE:"modal:close",CLOSE_ALL:"modal:closeAll",DESTROY:"modal:destroy"}),Zi=class extends Z{constructor(){super(...arguments);this.Xt=new Map;this.bt=new Set;this.w=new Map;}static{a(this,"ModalManager");}registerModal(t,e){this.Xt.set(t,e),this.K(W.ADD,{id:t,modal:e});}deleteModal(t){let e=this.Xt.get(t);return e?(this.Xt.delete(t),this.bt.delete(t),this.K(W.DELETE,{id:t,modal:e}),true):false}open(t){let e=this.Xt.get(t);return e?(this.bt.add(t),this.K(W.OPEN,{modal:e,id:t}),true):(this.z(`Modal with ID "${t}" not found`),false)}close(t){let e=this.Xt.get(t);return !e||!this.bt.has(t)?(this.z(`Modal with ID "${t}" not found or not active`),false):(this.bt.delete(t),this.K(W.CLOSE,{id:t,modal:e}),true)}toggle(t){return this.Xt.has(t)?this.bt.has(t)?this.close(t):this.open(t):(this.z(`Modal with ID "${t}" not found`),false)}get hasActiveModals(){return this.bt.size>0}back(){if(this.bt.size===0)return this.z("No active modals to go back from"),false;let t=Array.from(this.bt).pop();return t?this.close(t):false}closeAll(){let t=this.bt.size;return this.bt.clear(),this.K(W.CLOSE_ALL,{}),t}subscribe(t,e){return this.w.has(t)||this.w.set(t,new Set),this.w.get(t)?.add(e),()=>this.unsubscribe(t,e)}unsubscribe(t,e){this.w.has(t)&&this.w.get(t)?.delete(e);}K(t,e){if(this.w.has(t))for(let o of this.w.get(t)??new Set)try{o(e);}catch(s){this.r.telemetryManager.sendEventError(s,"modal subscriber"),this.z("Error in modal subscriber:",s);}}destroy(){super.destroy(),this.closeAll(),this.Xt.clear(),this.w.clear(),this.K(W.DESTROY,{});}};var ni=a(r=>r.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)?.map(i=>i.toLowerCase()).join("-"),"toKebabCase");function hn(r){return Object.prototype.toString.call(r)==="[object Object]"}a(hn,"isObject");var ql=/\W|_/g;function Wl(r){return r.split(ql).map((i,t)=>i.charAt(0)[t>0?"toUpperCase":"toLowerCase"]()+i.slice(1)).join("")}a(Wl,"camelizeString");function mn(r,{ignoreKeys:i}={ignoreKeys:[]}){return Array.isArray(r)?r.map(t=>Kt(t,{ignoreKeys:i})):r}a(mn,"camelizeArrayItems");function Kt(r,{ignoreKeys:i}={ignoreKeys:[]}){if(Array.isArray(r))return mn(r,{ignoreKeys:i});if(!hn(r))return r;let t={};for(let e of Object.keys(r)){let o=r[e];if(i.includes(e)){t[e]=o;continue}hn(o)?o=Kt(o,{ignoreKeys:i}):Array.isArray(o)&&(o=mn(o,{ignoreKeys:i})),t[Wl(e)]=o;}return t}a(Kt,"camelizeKeys");var Zl=a(r=>new Promise(i=>setTimeout(i,r)),"delay");function Ao({libraryName:r,libraryVersion:i,userAgent:t,publicKey:e="",integration:o=""}){let s="JavaScript";if(typeof t=="string")return t;if(typeof t=="function")return t({publicKey:e,libraryName:r,libraryVersion:i,languageName:s,integration:o});let n=[r,i,e].filter(Boolean).join("/"),l=[s,o].filter(Boolean).join("; ");return `${n} (${l})`}a(Ao,"getUserAgent$1");var Xl={factor:2,time:100};function Yl(r,i=Xl){let t=0;function e(o){let s=Math.round(i.time*i.factor**t);return o({attempt:t,retry:a(l=>Zl(l??s).then(()=>(t+=1,e(o))),"retry")})}return a(e,"runAttempt"),e(r)}a(Yl,"retrier");var ge=class extends Error{static{a(this,"UploadcareError");}},Ue=class r extends ge{static{a(this,"NetworkError");}originalProgressEvent;constructor(i){super(),this.name="NetworkError",this.message="Network error",Object.setPrototypeOf(this,r.prototype),this.originalProgressEvent=i;}},Xi=a((r,i)=>{r&&(r.aborted?Promise.resolve().then(i):r.addEventListener("abort",()=>i(),{once:true}));},"onCancel"),Jt=class r extends ge{static{a(this,"CancelError");}isCancel=true;constructor(i="Request canceled"){super(i),this.name="CancelError",Object.setPrototypeOf(this,r.prototype);}},Ql=500,gn=a(({check:r,interval:i=Ql,timeout:t,signal:e})=>new Promise((o,s)=>{let n,l;Xi(e,()=>{n&&clearTimeout(n),s(new Jt("Poll cancelled"));}),t&&(l=setTimeout(()=>{n&&clearTimeout(n),s(new Jt("Timed out"));},t));let c=a(()=>{try{Promise.resolve(r(e)).then(u=>{u?(l&&clearTimeout(l),o(u)):n=setTimeout(c,i);}).catch(u=>{l&&clearTimeout(l),s(u);});}catch(u){l&&clearTimeout(l),s(u);}},"tick");n=setTimeout(c,0);}),"poll"),P={baseCDN:"https://ucarecdn.com",baseURL:"https://upload.uploadcare.com",retryThrottledRequestMaxTimes:1,retryNetworkErrorMaxTimes:3,multipartMinFileSize:25*1024*1024,multipartChunkSize:5*1024*1024,maxConcurrentRequests:4,pusherKey:"79ae88bd931ea68464d9"},Yi="application/octet-stream",vn="original",ee=a(({method:r,url:i,data:t,headers:e={},signal:o,onProgress:s})=>new Promise((n,l)=>{let c=new XMLHttpRequest,u=r?.toUpperCase()||"GET",p=false;c.open(u,i,true),e&&Object.entries(e).forEach(d=>{let[m,f]=d;typeof f<"u"&&!Array.isArray(f)&&c.setRequestHeader(m,f);}),c.responseType="text",Xi(o,()=>{p=true,c.abort(),l(new Jt);}),c.onload=()=>{if(c.status!=200)l(new Error(`Error ${c.status}: ${c.statusText}`));else {let d={method:u,url:i,data:t,headers:e||void 0,signal:o,onProgress:s},m=c.getAllResponseHeaders().trim().split(/[\r\n]+/),f={};m.forEach(function(T){let C=T.split(": "),x=C.shift(),A=C.join(": ");x&&typeof x<"u"&&(f[x]=A);});let v=c.response,w=c.status;n({request:d,data:v,headers:f,status:w});}},c.onerror=d=>{p||l(new Ue(d));},s&&typeof s=="function"&&(c.upload.onprogress=d=>{d.lengthComputable?s({isComputable:true,value:d.loaded/d.total}):s({isComputable:false});}),t?c.send(t):c.send();}),"request");function Jl(r,...i){return r}a(Jl,"identity");var tc=a(({name:r})=>r?[r]:[],"getFileOptions"),ec=Jl,ic=a(()=>new FormData,"getFormData"),yn=a(r=>false,"isBuffer"),Qi=a(r=>typeof Blob<"u"&&r instanceof Blob,"isBlob"),Ji=a(r=>typeof File<"u"&&r instanceof File,"isFile"),tr=a(r=>!!r&&typeof r=="object"&&!Array.isArray(r)&&"uri"in r&&typeof r.uri=="string","isReactNativeAsset"),Pe=a(r=>Qi(r)||Ji(r)||yn()||tr(r),"isFileData"),rc=a(r=>typeof r=="string"||typeof r=="number"||typeof r>"u","isSimpleValue"),oc=a(r=>!!r&&typeof r=="object"&&!Array.isArray(r),"isObjectValue"),sc=a(r=>!!r&&typeof r=="object"&&"data"in r&&Pe(r.data),"isFileValue");function bn(r,i,t){if(Array.isArray(t))for(let e of t)bn(r,`${i}[]`,e);else if(sc(t)){let{name:e,contentType:o}=t,s=ec(t.data,e,o??Yi),n=tc({name:e,contentType:o});r.push([i,s,...n]);}else if(oc(t))for(let[e,o]of Object.entries(t))typeof o<"u"&&r.push([`${i}[${e}]`,String(o)]);else rc(t)&&t&&r.push([i,t.toString()]);}a(bn,"collectParams");function nc(r){let i=[];for(let[t,e]of Object.entries(r))bn(i,t,e);return i}a(nc,"getFormDataParams");function er(r){let i=ic(),t=nc(r);for(let e of t){let[o,s,...n]=e;i.append(o,s,...n);}return i}a(er,"buildFormData");var rt=class r extends ge{static{a(this,"UploadError");}code;request;response;headers;constructor(i,t,e,o,s){super(),this.name="UploadError",this.message=i,this.code=t,this.request=e,this.response=o,this.headers=s,Object.setPrototypeOf(this,r.prototype);}},ac=a(r=>{let i=new URLSearchParams;for(let[t,e]of Object.entries(r))e&&typeof e=="object"&&!Array.isArray(e)?Object.entries(e).filter(o=>o[1]??false).forEach(o=>i.set(`${t}[${o[0]}]`,String(o[1]))):Array.isArray(e)?e.forEach(o=>{i.append(`${t}[]`,o);}):typeof e=="string"&&e?i.set(t,e):typeof e=="number"&&i.set(t,e.toString());return i.toString()},"buildSearchParams"),jt=a((r,i,t)=>{let e=new URL(r);return e.pathname=(e.pathname+i).replace("//","/"),t&&(e.search=ac(t)),e.toString()},"getUrl"),lc="6.18.4",cc="UploadcareUploadClient",uc=lc;function ye(r){return Ao({libraryName:cc,libraryVersion:uc,...r})}a(ye,"getUserAgent");var dc="RequestThrottledError",fn=15e3,pc=1e3;function hc(r){let{headers:i}=r||{};if(!i||typeof i["retry-after"]!="string")return fn;let t=parseInt(i["retry-after"],10);return Number.isFinite(t)?t*1e3:fn}a(hc,"getTimeoutFromThrottledRequest");function ie(r,i){let{retryThrottledRequestMaxTimes:t,retryNetworkErrorMaxTimes:e}=i;return Yl(({attempt:o,retry:s})=>r().catch(n=>{if("response"in n&&n?.code===dc&&o<t)return s(hc(n));if(n instanceof Ue&&o<e)return s((o+1)*pc);throw n}))}a(ie,"retryIfFailed");var wn=a(r=>{let i="";return (Qi(r)||Ji(r)||tr(r))&&(i=r.type),i||Yi},"getContentType"),Tn=a(r=>{let i="";return Ji(r)&&r.name?i=r.name:Qi(r)||yn()?i="":tr(r)&&r.name&&(i=r.name),i||vn},"getFileName");function ko(r){return typeof r>"u"||r==="auto"?"auto":r?"1":"0"}a(ko,"getStoreValue");function mc(r,{publicKey:i,fileName:t,contentType:e,baseURL:o=P.baseURL,secureSignature:s,secureExpire:n,store:l,signal:c,onProgress:u,source:p="local",integration:d,userAgent:m,retryThrottledRequestMaxTimes:f=P.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:v=P.retryNetworkErrorMaxTimes,metadata:w}){return ie(()=>ee({method:"POST",url:jt(o,"/base/",{jsonerrors:1}),headers:{"X-UC-User-Agent":ye