@uploadcare/file-uploader 1.27.0-alpha.0 → 1.27.0-alpha.1
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.
- package/dist/{CloudImageEditorActivity-HGSS7NV2.css → CloudImageEditorActivity-H7IY5ZRN.css} +2 -2
- package/dist/{CloudImageEditorActivity-HGSS7NV2.layered.css → CloudImageEditorActivity-H7IY5ZRN.layered.css} +2 -2
- package/dist/CloudImageEditorActivity-LKW4OYEK.js +1 -0
- package/dist/abstract/loadFileUploaderFrom.js +2 -2
- package/dist/chunk-BMGLMZ7T.js +7 -0
- package/dist/{chunk-TVCYFFRR.js → chunk-GVVHCZH5.js} +2 -2
- package/dist/chunk-JYWKOLXZ.js +7 -0
- package/dist/{chunk-BDD5ZPFI.js → chunk-PHLC56Y5.js} +2 -2
- package/dist/chunk-SX25NGUM.js +8 -0
- package/dist/chunk-SX25NGUM.js.LEGAL.txt +70 -0
- package/dist/{chunk-LNXFGGSC.js → chunk-TMF3R5Q2.js} +2 -2
- package/dist/{cloud-image-editor-PX6YZMOH.css → cloud-image-editor-ANNQTRKP.css} +2 -2
- package/dist/{cloud-image-editor-PX6YZMOH.layered.css → cloud-image-editor-ANNQTRKP.layered.css} +2 -2
- package/dist/cloud-image-editor-JGU7R22E.js +1 -0
- package/dist/{cloudImageEditorPlugin-WZCVZALK.css → cloudImageEditorPlugin-IUHTPZGK.css} +2 -2
- package/dist/{cloudImageEditorPlugin-WZCVZALK.layered.css → cloudImageEditorPlugin-IUHTPZGK.layered.css} +2 -2
- package/dist/{cloudImageEditorPlugin-BE5HU2W4.js → cloudImageEditorPlugin-TRD2OAR2.js} +4 -4
- package/dist/core.css +2 -2
- package/dist/core.js +5 -5
- package/dist/core.js.LEGAL.txt +8 -0
- package/dist/core.layered.css +2 -2
- package/dist/env.js +3 -3
- package/dist/index.css +2 -2
- package/dist/index.js +3 -3
- package/dist/index.layered.css +2 -2
- package/dist/index.ssr.js +1 -1
- package/dist/locales/file-uploader/ar.js +2 -2
- package/dist/locales/file-uploader/az.js +2 -2
- package/dist/locales/file-uploader/ca.js +2 -2
- package/dist/locales/file-uploader/cs.js +2 -2
- package/dist/locales/file-uploader/da.js +2 -2
- package/dist/locales/file-uploader/de.js +2 -2
- package/dist/locales/file-uploader/el.js +2 -2
- package/dist/locales/file-uploader/en.js +2 -2
- package/dist/locales/file-uploader/es.js +2 -2
- package/dist/locales/file-uploader/et.js +2 -2
- package/dist/locales/file-uploader/fi.js +2 -2
- package/dist/locales/file-uploader/fr.js +2 -2
- package/dist/locales/file-uploader/he.js +2 -2
- package/dist/locales/file-uploader/hy.js +2 -2
- package/dist/locales/file-uploader/is.js +2 -2
- package/dist/locales/file-uploader/it.js +2 -2
- package/dist/locales/file-uploader/ja.js +2 -2
- package/dist/locales/file-uploader/ka.js +2 -2
- package/dist/locales/file-uploader/kk.js +2 -2
- package/dist/locales/file-uploader/ko.js +2 -2
- package/dist/locales/file-uploader/lv.js +2 -2
- package/dist/locales/file-uploader/nb.js +2 -2
- package/dist/locales/file-uploader/nl.js +2 -2
- package/dist/locales/file-uploader/pl.js +2 -2
- package/dist/locales/file-uploader/pt.js +2 -2
- package/dist/locales/file-uploader/ro.js +2 -2
- package/dist/locales/file-uploader/ru.js +2 -2
- package/dist/locales/file-uploader/sk.js +2 -2
- package/dist/locales/file-uploader/sr.js +2 -2
- package/dist/locales/file-uploader/sv.js +2 -2
- package/dist/locales/file-uploader/tr.js +2 -2
- package/dist/locales/file-uploader/uk.js +2 -2
- package/dist/locales/file-uploader/vi.js +2 -2
- package/dist/locales/file-uploader/zh-TW.js +2 -2
- package/dist/locales/file-uploader/zh.js +2 -2
- package/package.json +1 -1
- package/web/file-uploader.iife.min.js +3 -3
- package/web/file-uploader.min.js +3 -3
- package/web/uc-basic.layered.min.css +2 -2
- package/web/uc-basic.min.css +2 -2
- package/web/uc-cloud-image-editor.layered.min.css +2 -2
- package/web/uc-cloud-image-editor.min.css +2 -2
- package/web/uc-cloud-image-editor.min.js +3 -3
- package/web/uc-file-uploader-inline.layered.min.css +2 -2
- package/web/uc-file-uploader-inline.min.css +2 -2
- package/web/uc-file-uploader-inline.min.js +3 -3
- package/web/uc-file-uploader-minimal.layered.min.css +2 -2
- package/web/uc-file-uploader-minimal.min.css +2 -2
- package/web/uc-file-uploader-minimal.min.js +3 -3
- package/web/uc-file-uploader-regular.layered.min.css +2 -2
- package/web/uc-file-uploader-regular.min.css +2 -2
- package/web/uc-file-uploader-regular.min.js +3 -3
- package/web/uc-img.min.js +3 -3
- package/dist/CloudImageEditorActivity-7EK7P3UP.js +0 -1
- package/dist/chunk-5OA6ZVWQ.js +0 -7
- package/dist/chunk-GCTQN3DZ.js +0 -7
- package/dist/chunk-NJ77GRVX.js +0 -8
- package/dist/cloud-image-editor-Q5333S7T.js +0 -1
package/dist/core.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export{b as Config,a as toKebabCase}from'./chunk-
|
|
1
|
+
export{b as Config,a as toKebabCase}from'./chunk-BMGLMZ7T.js';import {g as g$1,c as c$1,e as e$1,f as f$1,b as b$1,a as a$1,d}from'./chunk-JYWKOLXZ.js';export{f as ActivityBlock,c as ExternalUploadSource,e as UploadSource,g as UploaderBlock}from'./chunk-JYWKOLXZ.js';import {h,l,f,g,e,R as R$1,J as J$1,V,b,M,N,fa,L,y,ga,i,j,T as T$1,U as U$1,S,da,ba,aa,ea,c,ca,k,ja,E as E$1,C,A,u,K,p,s,t,r,ia,ha,W as W$1,X as X$1,ka,O}from'./chunk-SX25NGUM.js';export{R as Block,a as Data,$ as Icon,y as ModalEvents,M as PACKAGE_NAME,N as PACKAGE_VERSION,m as UID,n as defineLocale}from'./chunk-SX25NGUM.js';import {a as a$2}from'./chunk-PHLC56Y5.js';export{a as defineComponents}from'./chunk-PHLC56Y5.js';import'./chunk-TMF3R5Q2.js';import {a}from'./chunk-GVVHCZH5.js';/**
|
|
2
2
|
* @license
|
|
3
|
-
* Package: @uploadcare/file-uploader@1.27.0-alpha.
|
|
3
|
+
* Package: @uploadcare/file-uploader@1.27.0-alpha.1 (MIT)
|
|
4
4
|
* License: https://github.com/uploadcare/blob/main/LICENSE
|
|
5
|
-
* Built: 2026-02-
|
|
5
|
+
* Built: 2026-02-17T12:21:36.712Z
|
|
6
6
|
*/
|
|
7
|
-
var Se=class extends d(f$1()(b(c(LitElement)))){};var Le="UC";function Nt(n,s=false){return new Promise((e,t)=>{if(typeof document!="object"){e(null);return}if(typeof window=="object"&&window[Le]){e(window[Le]);return}let i=document.createElement("script");i.async=true,i.src=n,i.onerror=()=>{t();},i.onload=()=>{let r=window[Le];s&&a$2(r),e(r);},document.head.appendChild(i);})}var ct="<svg width='0' height='0' style='position:absolute'><symbol viewBox='0 0 24 24' id='uc-icon-about' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.152 14.12v.1h1.523v-.1c.007-.409.053-.752.138-1.028.086-.277.22-.517.405-.72.188-.202.434-.397.735-.586.32-.191.593-.412.82-.66.232-.249.41-.531.533-.847.125-.32.187-.678.187-1.076 0-.579-.137-1.085-.41-1.518a2.717 2.717 0 0 0-1.14-1.018c-.49-.245-1.062-.367-1.715-.367-.597 0-1.142.114-1.636.34-.49.228-.884.564-1.182 1.008-.299.44-.46.98-.485 1.619h1.62c.024-.377.118-.684.282-.922a1.48 1.48 0 0 1 .617-.532c.25-.114.51-.17.784-.17.301 0 .575.063.82.191.248.124.447.302.597.533.149.23.223.504.223.82 0 .263-.05.502-.149.72a1.91 1.91 0 0 1-.405.574 3.48 3.48 0 0 1-.575.453 4.22 4.22 0 0 0-.847.66c-.234.242-.415.558-.543.949-.125.39-.19.916-.197 1.577Zm.053 3.03c.21.206.46.31.75.31.196 0 .374-.049.534-.144a1.1 1.1 0 0 0 .383-.384c.1-.163.15-.343.15-.538a1 1 0 0 0-.32-.746 1.019 1.019 0 0 0-.746-.314c-.291 0-.542.105-.751.314-.21.206-.314.455-.314.746 0 .295.104.547.314.756ZM24 12c0 6.627-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0s12 5.373 12 12Zm-1.5 0c0 5.799-4.701 10.5-10.5 10.5S1.5 17.799 1.5 12 6.201 1.5 12 1.5 22.5 6.201 22.5 12Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-add' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12.75 21a.75.75 0 0 1-1.5 0v-8.25H3a.75.75 0 0 1 0-1.5h8.25V3a.75.75 0 0 1 1.5 0v8.25H21a.75.75 0 0 1 0 1.5h-8.25V21Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-arrow-down' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.5 23.03a.75.75 0 0 0 .999 0l9.29-8.276a.75.75 0 0 0-.998-1.12l-8.042 7.164V1.53a.75.75 0 0 0-1.5 0v19.267l-8.04-7.163a.75.75 0 0 0-.998 1.12z'/></symbol><symbol fill='none' viewBox='0 0 9 6' id='uc-icon-arrow-dropdown' xmlns='http://www.w3.org/2000/svg'><path stroke='currentColor' d='m1.5 1.667 3 2.666 3-2.666' opacity='.5'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-aspect-ratio' xmlns='http://www.w3.org/2000/svg'><path stroke='currentColor' d='M7.395 22.5H2.454v-5.25m14.824 5.25h4.94v-5.25m0-10.5V1.5h-4.94m-9.883 0H2.454v5.25'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-back' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M20.251 12a.75.75 0 0 1-.75.75H6.067l5.72 5.85a.75.75 0 1 1-1.072 1.05L4.136 12.92a1.292 1.292 0 0 1 0-1.842l6.579-6.728a.75.75 0 1 1 1.072 1.048l-5.72 5.851H19.5a.75.75 0 0 1 .75.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-badge-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13.6 18.4a1.6 1.6 0 1 1-3.2 0 1.6 1.6 0 0 1 3.2 0zM12 4.5A1.5 1.5 0 0 1 13.5 6v7a1.5 1.5 0 0 1-3 0V6A1.5 1.5 0 0 1 12 4.5z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-badge-success' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m10.5 18.204 7.6-8.183a1.5 1.5 0 0 0-2.2-2.042l-5.4 5.817-2.4-2.586a1.5 1.5 0 1 0-2.2 2.041l4.6 4.953Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-box' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M1.01 4.148a.75.75 0 0 1 .75.75v4.348a4.437 4.437 0 0 1 2.988-1.153c1.734 0 3.23.992 3.978 2.438a4.478 4.478 0 0 1 3.978-2.438c2.49 0 4.488 2.044 4.488 4.543 0 2.5-1.999 4.544-4.488 4.544a4.478 4.478 0 0 1-3.978-2.438 4.478 4.478 0 0 1-3.978 2.438C2.26 17.18.26 15.135.26 12.636V4.898a.75.75 0 0 1 .75-.75Zm.75 8.488c0 1.692 1.348 3.044 2.988 3.044s2.989-1.352 2.989-3.044c0-1.691-1.349-3.043-2.989-3.043S1.76 10.945 1.76 12.636Zm10.944-3.043c-1.64 0-2.988 1.352-2.988 3.043 0 1.692 1.348 3.044 2.988 3.044s2.988-1.352 2.988-3.044c0-1.69-1.348-3.043-2.988-3.043Zm4.328-1.23a.75.75 0 0 1 1.052.128l2.333 2.983 2.333-2.983a.75.75 0 0 1 1.181.924l-2.562 3.277 2.562 3.276a.75.75 0 1 1-1.181.924l-2.333-2.983-2.333 2.983a.75.75 0 1 1-1.181-.924l2.562-3.276-2.562-3.277a.75.75 0 0 1 .129-1.052Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.65 2.55a.75.75 0 0 1 .6-.3h7.5a.75.75 0 0 1 .6.3l2.025 2.7H21a3 3 0 0 1 3 3v10.5a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V8.25a3 3 0 0 1 3-3h2.625zm.975 1.2L6.6 6.45a.75.75 0 0 1-.6.3H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V8.25a1.5 1.5 0 0 0-1.5-1.5h-3a.75.75 0 0 1-.6-.3l-2.025-2.7zm3.375 6a3.375 3.375 0 1 0 0 6.75 3.375 3.375 0 0 0 0-6.75zm-4.875 3.375a4.875 4.875 0 1 1 9.75 0 4.875 4.875 0 0 1-9.75 0z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-camera-full' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M2 4.667a2 2 0 0 0-2 2V16a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6.667a2 2 0 0 0-2-2h-2.667l-2-2.667H6.667l-2 2.667H2Zm8 10a3.667 3.667 0 1 0 0-7.334 3.667 3.667 0 0 0 0 7.334Z' fill='currentColor'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-close' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M4.604 4.604a.75.75 0 0 1 1.06 0L12 10.939l6.335-6.335a.75.75 0 1 1 1.061 1.06L13.061 12l6.335 6.335a.75.75 0 1 1-1.06 1.061L12 13.061l-6.335 6.335a.75.75 0 0 1-1.061-1.06L10.939 12 4.604 5.665a.75.75 0 0 1 0-1.061z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-collapse' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M3.116 12a.75.75 0 0 1 .75-.75h16.268a.75.75 0 0 1 0 1.5H3.866a.75.75 0 0 1-.75-.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-default' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.501.392a.75.75 0 0 1 .998 0l6.704 5.972a.75.75 0 0 1-.998 1.12l-5.455-4.86v13.439a.75.75 0 0 1-1.5 0V2.625l-5.454 4.86a.75.75 0 1 1-.998-1.12zM.857 16.73a.75.75 0 0 1 .75.75v4.914h20.786v-4.914a.75.75 0 0 1 1.5 0v5.664a.75.75 0 0 1-.75.75H.857a.75.75 0 0 1-.75-.75v-5.664a.75.75 0 0 1 .75-.75z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-dropbox' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.019 1.92a.75.75 0 0 1 .806 0L12 5.219l5.176-3.297a.75.75 0 0 1 .806 0l5.577 3.553a.75.75 0 0 1 0 1.265l-4.574 2.914 4.574 2.914a.75.75 0 0 1 0 1.265l-5.577 3.554a.75.75 0 0 1-.806 0L12 14.089l-5.175 3.297a.75.75 0 0 1-.806 0L.44 13.833a.75.75 0 0 1 0-1.266l4.575-2.914L.44 6.74a.75.75 0 0 1 0-1.265zm.403 8.616L2.24 13.2l4.182 2.664 4.181-2.664zm6.975 2.664 4.182 2.664L21.76 13.2l-4.181-2.664zm2.776-3.547L12 12.311 7.828 9.653 12 6.995zm1.406-.882 4.181-2.664-4.181-2.664-4.182 2.664zm-6.976-2.664L6.422 3.443 2.24 6.107 6.422 8.77zM5.791 18.544a.75.75 0 0 1 1.035-.23l5.175 3.297 5.175-3.297a.75.75 0 1 1 .806 1.265l-5.578 3.554a.75.75 0 0 1-.806 0L6.02 19.579a.75.75 0 0 1-.23-1.035z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-edit-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M18.558 2.804a.78.78 0 0 0-.557.235l-.008.007-2.472 2.46 3.847 3.848 2.46-2.473.004-.003a.78.78 0 0 0 0-1.108l-.004-.003-2.712-2.728a.78.78 0 0 0-.558-.235Zm-.248 7.613-3.852-3.852-8.93 8.887-1.516 5.41 5.41-1.515 8.888-8.93Zm-.636-8.934a2.28 2.28 0 0 1 2.512.505l2.702 2.717.002.002a2.278 2.278 0 0 1 0 3.234l-.002.002-12.541 12.602a.75.75 0 0 1-.33.193l-6.884 1.928a.75.75 0 0 1-.925-.924l1.928-6.885a.75.75 0 0 1 .193-.33l12.603-12.54a2.28 2.28 0 0 1 .742-.504Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-evernote' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M9.804 2.27v-.048c.055-.263.313-.562.85-.562h.44c.142 0 .325.014.526.033.066.009.124.023.267.06l.13.032h.002c.319.079.515.275.644.482a1.461 1.461 0 0 1 .16.356l.004.012a.75.75 0 0 0 .603.577l1.191.207a1988.512 1988.512 0 0 0 2.332.402c.512.083 1.1.178 1.665.442.64.3 1.19.795 1.376 1.77.548 2.931.657 5.829.621 8a39.233 39.233 0 0 1-.125 2.602 17.518 17.518 0 0 1-.092.849.735.735 0 0 0-.024.112c-.378 2.705-1.269 3.796-2.04 4.27-.746.457-1.53.451-2.217.447h-.192c-.46 0-1.073-.23-1.581-.635-.518-.412-.763-.87-.763-1.217 0-.45.188-.688.355-.786.161-.095.436-.137.796.087a.75.75 0 1 0 .792-1.274c-.766-.476-1.64-.52-2.345-.108-.7.409-1.098 1.188-1.098 2.08 0 .996.634 1.84 1.329 2.392.704.56 1.638.96 2.515.96l.185.002c.667.009 1.874.025 3.007-.67 1.283-.786 2.314-2.358 2.733-5.276a4.213 4.213 0 0 0 .056-.335c.023-.184.051-.445.079-.772.055-.655.111-1.585.13-2.704.037-2.234-.074-5.239-.647-8.301v-.002c-.294-1.544-1.233-2.391-2.215-2.85-.777-.363-1.623-.496-2.129-.576a8.872 8.872 0 0 1-.25-.041l-.006-.001-1.99-.345-.761-.132a2.93 2.93 0 0 0-.182-.338A2.532 2.532 0 0 0 12.379.329l-.091-.023a3.967 3.967 0 0 0-.493-.103L11.769.2a7.846 7.846 0 0 0-.675-.04h-.44c-.733 0-1.368.284-1.795.742L2.416 7.431c-.468.428-.751 1.071-.751 1.81 0 .02 0 .041.003.062l.003.034c.017.21.038.468.096.796.107.715.275 1.47.391 1.994.029.13.055.245.075.342l.002.008c.258 1.141.641 1.94.978 2.466.168.263.323.456.444.589a2.808 2.808 0 0 0 .192.194c1.536 1.562 3.713 2.196 5.731 2.08.13-.005.35-.032.537-.073a2.627 2.627 0 0 0 .652-.24c.425-.26.75-.661.992-1.046.184-.294.342-.61.473-.915a3.8 3.8 0 0 0 .627.493 5.022 5.022 0 0 0 1.97.709l.023.002.018.003.11.016c.088.014.205.035.325.058l.056.014c.088.022.164.04.235.061a1.736 1.736 0 0 1 .145.048l.03.014c.765.34 1.302 1.09 1.302 1.871a.75.75 0 0 0 1.5 0c0-1.456-.964-2.69-2.18-3.235a3.595 3.595 0 0 0-.679-.217l-.063-.015a10.616 10.616 0 0 0-.606-.105l-.02-.003-.03-.003h-.002a3.542 3.542 0 0 1-1.331-.485c-.471-.298-.788-.692-.828-1.234a.75.75 0 0 0-1.48-.106l-.001.003-.004.017a8.23 8.23 0 0 1-.092.352 9.963 9.963 0 0 1-.298.892c-.132.34-.29.68-.47.966-.174.276-.339.454-.478.549a1.178 1.178 0 0 1-.221.072 1.949 1.949 0 0 1-.241.036h-.013l-.032.002c-1.684.1-3.423-.437-4.604-1.65a.746.746 0 0 0-.053-.05L4.84 14.6a1.348 1.348 0 0 1-.07-.073 2.99 2.99 0 0 1-.293-.392c-.242-.379-.558-1.014-.778-1.985a54.1 54.1 0 0 0-.083-.376 27.494 27.494 0 0 1-.367-1.872l-.003-.02a6.791 6.791 0 0 1-.08-.67c.004-.277.086-.475.2-.609l.067-.067a.63.63 0 0 1 .292-.145h.05c.18 0 1.095.055 2.013.115l1.207.08.534.037a.747.747 0 0 0 .052.002c.782 0 1.349-.206 1.759-.585l.005-.005c.553-.52.622-1.225.622-1.76V6.24l-.026-.565A774.97 774.97 0 0 1 9.885 4.4c-.042-.961-.081-1.939-.081-2.13ZM4.995 6.953a251.126 251.126 0 0 1 2.102.137l.508.035c.48-.004.646-.122.715-.185.07-.068.146-.209.147-.649l-.024-.548a791.69 791.69 0 0 1-.095-2.187L4.995 6.953Zm16.122 9.996Zm-5.479-5.323a.75.75 0 0 0 1.014.31 2.04 2.04 0 0 1 .304-.089 1.84 1.84 0 0 1 .544-.039c.215.023.321.06.37.085.033.016.039.026.047.04a.75.75 0 0 0 1.289-.767c-.337-.567-.906-.783-1.552-.85a3.334 3.334 0 0 0-1.002.062c-.27.056-.531.14-.705.234a.75.75 0 0 0-.31 1.014Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-expand' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m12 8.337-8.47 8.47a.75.75 0 0 1-1.06-1.06l8.605-8.606a1.29 1.29 0 0 1 1.85 0l8.605 8.605a.75.75 0 1 1-1.06 1.06L12 8.338Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-external-source-placeholder' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.341 3.27a10.5 10.5 0 0 1 5.834-1.77.75.75 0 0 0 0-1.5 12 12 0 1 0 12 12 .75.75 0 0 0-1.5 0A10.5 10.5 0 1 1 6.34 3.27Zm14.145 1.48a.75.75 0 1 0-1.06-1.062L9.925 13.19V7.95a.75.75 0 1 0-1.5 0V15c0 .414.336.75.75.75h7.05a.75.75 0 0 0 0-1.5h-5.24l9.501-9.5Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-facebook' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12 1.5C6.201 1.5 1.5 6.201 1.5 12c0 4.943 3.416 9.089 8.016 10.204v-6.108H7.383a.75.75 0 0 1-.75-.75v-3.281a.75.75 0 0 1 .75-.75h2.133V9.393c0-.958.225-2.511 1.38-3.65 1.194-1.177 3.174-1.718 6.254-1.056a.75.75 0 0 1 .592.733v2.754a.75.75 0 0 1-.75.75c-.692 0-1.203.026-1.584.082-.387.057-.578.137-.675.202-.109.073-.237.205-.237 1.029v1.078h2.39a.75.75 0 0 1 .742.866l-.516 3.281a.75.75 0 0 1-.74.634h-1.876v6.106C19.09 21.082 22.5 16.939 22.5 12c0-5.799-4.701-10.5-10.5-10.5zM0 12C0 5.373 5.373 0 12 0s12 5.373 12 12c0 5.995-4.395 10.961-10.138 11.856a.75.75 0 0 1-.866-.74v-7.77a.75.75 0 0 1 .75-.75h1.984l.28-1.781h-2.264a.75.75 0 0 1-.75-.75v-1.828c0-.829.089-1.729.9-2.274.363-.244.807-.37 1.293-.441a9.623 9.623 0 0 1 1.053-.086V6.04c-2.41-.405-3.645.132-4.293.771-.737.728-.933 1.793-.933 2.582v2.672a.75.75 0 0 1-.75.75H8.133v1.78h2.133a.75.75 0 0 1 .75.75v7.772a.75.75 0 0 1-.865.741C4.4 22.968 0 18 0 12z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M2.895 1.201c0-.473.383-.857.857-.857h8.4c.227 0 .445.09.606.251l8.4 8.4c.16.16.25.379.25.606v13.2a.857.857 0 0 1-.856.857h-16.8a.857.857 0 0 1-.857-.857zm1.714.857v19.886h15.085V10.458h-7.542a.857.857 0 0 1-.858-.857V2.058zm8.4 1.213 5.473 5.473H13.01z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-flickr' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M5.959 7.926c-2.298 0-4.14 1.834-4.14 4.073 0 2.241 1.842 4.075 4.14 4.075 2.302 0 4.145-1.834 4.145-4.075 0-2.238-1.843-4.073-4.145-4.073Zm-5.64 4.073c0-3.086 2.533-5.573 5.64-5.573 3.11 0 5.645 2.486 5.645 5.573 0 3.089-2.535 5.575-5.645 5.575-3.107 0-5.64-2.487-5.64-5.575Zm18.07-4.073c-2.301 0-4.144 1.835-4.144 4.073 0 2.24 1.843 4.075 4.145 4.075 2.299 0 4.141-1.834 4.141-4.075 0-2.239-1.842-4.073-4.141-4.073Zm-5.644 4.073c0-3.087 2.535-5.573 5.645-5.573 3.108 0 5.641 2.487 5.641 5.573 0 3.088-2.533 5.575-5.641 5.575-3.11 0-5.645-2.486-5.645-5.575Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-gdrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.736 1.818a.75.75 0 0 1 .647-.37h7.587a.75.75 0 0 1 .655.383l7.233 12.946a.75.75 0 0 1-.003.737l-3.794 6.66a.75.75 0 0 1-.651.378H4.59a.75.75 0 0 1-.651-.378l-3.794-6.66a.75.75 0 0 1 .005-.75zm.64 1.876L1.663 15.148l2.93 5.145 6.655-11.581zm3.736 6.526-2.398 4.173H14.5zm4.116 4.173h5.697L15.53 2.947H9.677zm5.685 1.5H8.852l-2.966 5.16h13.088z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-gphotos' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12.51 0c-.702 0-1.272.57-1.272 1.273V7.35A6.381 6.381 0 0 0 0 11.489c0 .703.57 1.273 1.273 1.273H7.35A6.381 6.381 0 0 0 11.488 24c.704 0 1.274-.57 1.274-1.273V16.65A6.381 6.381 0 0 0 24 12.51c0-.703-.57-1.273-1.273-1.273H16.65A6.381 6.381 0 0 0 12.511 0Zm.252 11.232V1.53a4.857 4.857 0 0 1 0 9.702Zm-1.53.006H1.53a4.857 4.857 0 0 1 9.702 0Zm1.536 1.524a4.857 4.857 0 0 0 9.702 0h-9.702Zm-6.136 4.857c0-2.598 2.04-4.72 4.606-4.85v9.7a4.857 4.857 0 0 1-4.606-4.85Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-huddle' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.204 2.002c-.252.23-.357.486-.357.67V21.07c0 .15.084.505.313.812.208.28.499.477.929.477.519 0 .796-.174.956-.365.178-.212.286-.535.286-.924v-.013l.117-6.58c.004-1.725 1.419-3.883 3.867-3.883 1.33 0 2.332.581 2.987 1.364.637.762.95 1.717.95 2.526v6.47c0 .392.11.751.305.995.175.22.468.41 1.008.41.52 0 .816-.198 1.002-.437.207-.266.31-.633.31-.969V14.04c0-2.81-1.943-5.108-4.136-5.422a5.971 5.971 0 0 0-3.183.41c-.912.393-1.538.96-1.81 1.489a.75.75 0 0 1-1.417-.344v-7.5c0-.587-.47-1.031-1.242-1.031-.315 0-.638.136-.885.36ZM5.194.892A2.844 2.844 0 0 1 7.09.142c1.328 0 2.742.867 2.742 2.53v5.607a6.358 6.358 0 0 1 1.133-.629 7.47 7.47 0 0 1 3.989-.516c3.056.436 5.425 3.482 5.425 6.906v6.914c0 .602-.177 1.313-.627 1.89-.47.605-1.204 1.016-2.186 1.016-.96 0-1.698-.37-2.179-.973-.46-.575-.633-1.294-.633-1.933v-6.469c0-.456-.19-1.071-.602-1.563-.394-.471-.986-.827-1.836-.827-1.447 0-2.367 1.304-2.367 2.39v.014l-.117 6.58c-.001.64-.177 1.333-.637 1.881-.48.57-1.2.9-2.105.9-.995 0-1.7-.5-2.132-1.081-.41-.552-.61-1.217-.61-1.708V2.672c0-.707.366-1.341.847-1.78Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-info' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11 9h2V7h-2m1 13c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m-1 15h2v-6h-2v6Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-local' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M3 3.75a1.5 1.5 0 0 0-1.5 1.5v13.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V9A1.5 1.5 0 0 0 21 7.5h-9a.75.75 0 0 1-.643-.364L9.325 3.75zm-3 1.5a3 3 0 0 1 3-3h6.75a.75.75 0 0 1 .643.364L12.425 6H21a3 3 0 0 1 3 3v9.75a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-microphone' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M7.5 4.781a4.5 4.5 0 0 1 9 0v6.469a4.5 4.5 0 1 1-9 0V4.781Zm4.5-3a3 3 0 0 0-3 3v6.469a3 3 0 1 0 6 0V4.781a3 3 0 0 0-3-3Zm-8.156 8.11a.75.75 0 0 1 .75.75 7.406 7.406 0 1 0 14.812 0 .75.75 0 0 1 1.5 0 8.907 8.907 0 0 1-8.156 8.875v2.703h3.258a.75.75 0 1 1 0 1.5H7.992a.75.75 0 0 1 0-1.5h3.258v-2.703a8.907 8.907 0 0 1-8.156-8.875.75.75 0 0 1 .75-.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-microphone-mute' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M7.5 4.781a4.5 4.5 0 0 1 9 0V6l3.524-3.524a.75.75 0 1 1 1.061 1.06L5.036 19.585a.75.75 0 0 1-1.06-1.06l1.656-1.657a8.88 8.88 0 0 1-2.538-6.227.75.75 0 0 1 1.5 0c0 2.009.8 3.83 2.1 5.166l1.771-1.772A4.483 4.483 0 0 1 7.5 11.25V4.781Zm2.037 8.182L15 7.5V4.781a3 3 0 1 0-6 0v6.469c0 .637.198 1.227.537 1.713Zm10.62-3.072a.75.75 0 0 1 .75.75 8.907 8.907 0 0 1-8.157 8.875v2.703h3.258a.75.75 0 1 1 0 1.5H7.992a.75.75 0 0 1 0-1.5h3.258v-2.703a8.855 8.855 0 0 1-3.035-.811.75.75 0 1 1 .638-1.358 7.406 7.406 0 0 0 10.553-6.707.75.75 0 0 1 .75-.75ZM15 10.81a.75.75 0 0 1 1.5 0v.439a4.5 4.5 0 0 1-5 4.473.75.75 0 1 1 .166-1.491A3 3 0 0 0 15 11.25v-.44Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-mobile-photo-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.65 2.55a.75.75 0 0 1 .6-.3h7.5a.75.75 0 0 1 .6.3l2.025 2.7H21a3 3 0 0 1 3 3v10.5a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V8.25a3 3 0 0 1 3-3h2.625zm.975 1.2L6.6 6.45a.75.75 0 0 1-.6.3H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V8.25a1.5 1.5 0 0 0-1.5-1.5h-3a.75.75 0 0 1-.6-.3l-2.025-2.7zm3.375 6a3.375 3.375 0 1 0 0 6.75 3.375 3.375 0 0 0 0-6.75zm-4.875 3.375a4.875 4.875 0 1 1 9.75 0 4.875 4.875 0 0 1-9.75 0z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-mobile-video-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M0 6.75a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v1.078L22.873 5A.75.75 0 0 1 24 5.648v12.704a.75.75 0 0 1-1.123.65L18 16.207v1.043a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V6.75Zm18 7.728 4.5 2.58V6.95L18 9.562v4.916ZM16.5 6.75a1.5 1.5 0 0 0-1.5-1.5H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h12a1.5 1.5 0 0 0 1.5-1.5V6.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-ngdrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.736 1.818a.75.75 0 0 1 .647-.37h7.587a.75.75 0 0 1 .655.383l7.233 12.946a.75.75 0 0 1-.003.737l-3.794 6.66a.75.75 0 0 1-.651.378H4.59a.75.75 0 0 1-.651-.378l-3.794-6.66a.75.75 0 0 1 .005-.75zm.64 1.876L1.663 15.148l2.93 5.145 6.655-11.581zm3.736 6.526-2.398 4.173H14.5zm4.116 4.173h5.697L15.53 2.947H9.677zm5.685 1.5H8.852l-2.966 5.16h13.088z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-onedrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13.616 4.147a7.689 7.689 0 0 0-7.642 3.285A6.299 6.299 0 0 0 1.455 17.3c.684.894 2.473 2.658 5.17 2.658h12.141c.95 0 1.882-.256 2.697-.743.815-.486 1.514-1.247 1.964-2.083a5.26 5.26 0 0 0-3.713-7.612 7.69 7.69 0 0 0-6.098-5.373ZM3.34 17.15c.674.63 1.761 1.308 3.284 1.308h12.142a3.76 3.76 0 0 0 2.915-1.383l-7.494-4.489L3.34 17.15Zm10.875-6.25 2.47-1.038a5.239 5.239 0 0 1 1.427-.389 6.19 6.19 0 0 0-10.3-1.952 6.338 6.338 0 0 1 2.118.813l4.285 2.567Zm4.55.033c-.512 0-1.019.104-1.489.307l-.006.003-1.414.594 6.521 3.906a3.76 3.76 0 0 0-3.357-4.8l-.254-.01ZM4.097 9.617A4.799 4.799 0 0 1 6.558 8.9c.9 0 1.84.25 2.587.713l3.4 2.037-10.17 4.28a4.799 4.799 0 0 1 1.721-6.312Z'/></symbol><symbol fill='none' viewBox='0 0 10 10' id='uc-icon-pause' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' d='M1 0h2.5v10H1zM6.5 0H9v10H6.5z'/></symbol><symbol fill='none' viewBox='0 0 10 10' id='uc-icon-play' xmlns='http://www.w3.org/2000/svg'><path d='m1 0 9 5-9 5V0Z' fill='currentColor'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-remove-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.955 3.3A2.969 2.969 0 0 0 8.998 6h5.914a2.97 2.97 0 0 0-2.957-2.7zM16.416 6a4.47 4.47 0 0 0-8.922 0h-2.32a.755.755 0 0 0-.111.008H3.075a.75.75 0 1 0 0 1.5h1.35V19.35a2.85 2.85 0 0 0 2.85 2.85h9.45a2.85 2.85 0 0 0 2.85-2.85V7.508h1.35a.75.75 0 0 0 0-1.5h-1.989A.754.754 0 0 0 18.825 6zM5.925 7.508V19.35a1.35 1.35 0 0 0 1.35 1.35h9.45a1.35 1.35 0 0 0 1.35-1.35V7.508z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-select' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m7 10 5 5 5-5H7Z'/></symbol><symbol fill='none' viewBox='0 0 20 20' id='uc-icon-square' xmlns='http://www.w3.org/2000/svg'><rect width='20' height='20' rx='4' fill='#fff'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-upload' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.501.392a.75.75 0 0 1 .998 0l6.704 5.972a.75.75 0 0 1-.998 1.12l-5.455-4.86v13.439a.75.75 0 0 1-1.5 0V2.625l-5.454 4.86a.75.75 0 1 1-.998-1.12zM.857 16.73a.75.75 0 0 1 .75.75v4.914h20.786v-4.914a.75.75 0 0 1 1.5 0v5.664a.75.75 0 0 1-.75.75H.857a.75.75 0 0 1-.75-.75v-5.664a.75.75 0 0 1 .75-.75z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-upload-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-url' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M19.11 3.67c-1.71-1.709-4.578-1.682-6.408.148l-2.22 2.22a.75.75 0 0 1-1.062-1.06l2.222-2.221C14.018.381 17.836.276 20.17 2.61l1.22 1.22c2.335 2.334 2.23 6.153-.147 8.529l-2.22 2.22a.75.75 0 0 1-1.062-1.06l2.222-2.221c1.83-1.83 1.856-4.698.147-6.408zm-3.36 4.58a.75.75 0 0 1 0 1.06l-6.439 6.44a.75.75 0 0 1-1.06-1.06l6.439-6.44a.75.75 0 0 1 1.06 0zM6.04 9.42a.75.75 0 0 1 0 1.061l-2.222 2.222c-1.83 1.83-1.856 4.698-.147 6.407l1.22 1.22c1.71 1.71 4.578 1.683 6.408-.147l2.221-2.221a.75.75 0 1 1 1.06 1.06l-2.22 2.222c-2.377 2.376-6.195 2.481-8.53.147l-1.22-1.22c-2.334-2.334-2.228-6.153.148-8.53l2.221-2.22a.75.75 0 0 1 1.06 0z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-video-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M0 6.75a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v1.078L22.873 5A.75.75 0 0 1 24 5.648v12.704a.75.75 0 0 1-1.123.65L18 16.207v1.043a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V6.75Zm18 7.728 4.5 2.58V6.95L18 9.562v4.916ZM16.5 6.75a1.5 1.5 0 0 0-1.5-1.5H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h12a1.5 1.5 0 0 0 1.5-1.5V6.75Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-video-camera-full' xmlns='http://www.w3.org/2000/svg'><path d='M2 3.333a2 2 0 0 0-2 2v9.334a2 2 0 0 0 2 2h10.938a2 2 0 0 0 2-2v-2.013L20 15.646V4.354l-5.063 3.03v-2.05a2 2 0 0 0-2-2H2Z' fill='currentColor'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-vk' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.341 3.27a10.5 10.5 0 0 1 5.834-1.77.75.75 0 0 0 0-1.5 12 12 0 1 0 12 12 .75.75 0 0 0-1.5 0A10.5 10.5 0 1 1 6.34 3.27Zm14.145 1.48a.75.75 0 1 0-1.06-1.062L9.925 13.19V7.95a.75.75 0 1 0-1.5 0V15c0 .414.336.75.75.75h7.05a.75.75 0 0 0 0-1.5h-5.24l9.501-9.5Z'/></symbol></svg>";var U=class extends D{constructor(){super(...arguments);this.init$=v(this);}static{this.styleAttrs=["uc-wgt-common"];}initCallback(){super.initCallback(),this.a11y?.registerBlock(this);}render(){return html`${unsafeSVG(ct)}`}};var dt=n=>[...new Set(n)];var F="--uc-img-",Pe="unresolved";var $e=!window.location.host.trim()||window.location.host.includes(":")||window.location.hostname.includes("localhost"),Ve=3e3,Ue=5e3,De=Object.freeze({PREVIEW:"PREVIEW",MAIN:"MAIN"});var jt="https://ucarecdn.com",j=Object.freeze({"dev-mode":{},pubkey:{},uuid:{},src:{},lazy:{default:1},intersection:{},breakpoints:{},"cdn-cname":{default:jt},"proxy-cname":{},"secure-delivery-proxy":{},"hi-res-support":{default:1},"ultra-res-support":{},format:{},"cdn-operations":{},progressive:{},quality:{},"is-background-for":{},"is-preview-blur":{default:1}});var de=class extends b(d(LitElement)){constructor(){super();this._state={};this._subscribers=new Map;this._isnObserver=null;this._observed=null;for(let e in j){let t=j[e];this._state[F+e]=t?.default||"";}}createRenderRoot(){return this}$$(e){return this._state[F+e]}set$$(e){for(let t in e){let i=F+t,r=e[t];this._state[i]=r,this._notify(i,r);}}sub$$(e,t){let i=F+e;this._subscribers.has(i)||this._subscribers.set(i,new Set),this._subscribers.get(i)?.add(t);let r=this._state[i];r!==null&&r!==""&&t(r);}_notify(e,t){this._subscribers.has(e)&&this._subscribers.get(e)?.forEach(i=>{t===null||t===""||i(t);});}analyticsParams(){return `-/@clib/${y$1}/${z}/uc-img/`}initAttributes(e){Array.from(this.attributes).forEach(t=>{let i=t;j[i.name]||e.setAttribute(i.name,i.value);});}initIntersection(e,t){let i={root:null,rootMargin:"0px"};this._isnObserver=new IntersectionObserver(r=>{r.forEach(o=>{o.isIntersecting&&(t(),this._isnObserver?.unobserve(e));});},i),this._isnObserver.observe(e),this._observed||(this._observed=new Set),this._observed.add(e);}connectedCallback(){super.connectedCallback(),this._initCssProperties();}_initCssProperties(){for(let e in j){let t=F+e,i=this.getCssData(t,true);i!=null&&(this._state[t]=i);}}disconnectedCallback(){super.disconnectedCallback(),this._isnObserver&&(this._observed?.forEach(e=>{this._isnObserver?.unobserve(e);}),this._isnObserver=null),this._subscribers.clear();}static get observedAttributes(){return Object.keys(j)}attributeChangedCallback(e,t,i){window.setTimeout(()=>{let r=F+e;this._state[r]=i,this._notify(r,i);});}};var ut=n=>Object.entries(n).filter(([s,e])=>e!==void 0&&e!=="").map(([s,e])=>s==="cdn-operations"||s==="analytics"?e:`${s}/${e}`);var he=class extends de{constructor(){super(...arguments);this._img=new Image;this._imgPreview=new Image;}_fmtAbs(e){return !e.includes("//")&&!$e&&(e=new URL(e,document.baseURI).href),e}_validateSize(e){if(!e)return;let t=e,i=t.match(/\d+/)?.[0],r=t.match(/[a-zA-Z]+/)?.[0];if(!i||!r)return;let o=parseInt(i,10);return Number(o)>Ue&&this._hasFormatJPG?Ue+r:Number(o)>Ve&&!this._hasFormatJPG?Ve+r:e}_getCdnModifiers(e,t){let i={format:this._getTypedCssValue("format"),quality:this._getTypedCssValue("quality"),resize:this._validateSize(e),blur:t,"cdn-operations":this._getTypedCssValue("cdn-operations")??void 0,analytics:this.analyticsParams()};return l(...ut(i))}_getTypedCssValue(e){let t=this.$$(e);if(t==null||typeof t=="string"||typeof t=="number"||typeof t=="boolean")return t}_getUrlBase(e="",t=""){let i=this.$$("src");if(i.startsWith("data:")||i.startsWith("blob:"))return i;if($e&&i&&!i.includes("//"))return this._proxyUrl(i);let r=this._getCdnModifiers(e,t),o=this.$$("cdn-cname"),l=o;if(i.startsWith(String(o)))return m(i,r);let c=this.$$("uuid");if(l&&c)return this._proxyUrl(m(n(l,c),r));if(c)return this._proxyUrl(m(n(l,c),r));let p=this.$$("proxy-cname");if(p)return this._proxyUrl(m(p,r,this._fmtAbs(i)));let u=this.$$("pubkey");if(u)return this._proxyUrl(m(`https://${u}.ucr.io/`,r,this._fmtAbs(i)))}_proxyUrl(e){let t=this.$$("secure-delivery-proxy");return t?A(t,{previewUrl:e},{transform:i=>window.encodeURIComponent(i)}):e}_getElSize(e,t=1,i=true){let r=e.getBoundingClientRect(),o=t*Math.round(r.width),l=i?"":t*Math.round(r.height);return o||l?`${o||""}x${l||""}`:null}_setupEventProxy(e){let t=r=>{r.stopPropagation();let o=new Event(r.type,r);this.dispatchEvent(o);},i=["load","error"];for(let r of i)e.addEventListener(r,t);}get img(){return this._hasPreviewImage||(this._setupConfigForImage({elNode:this._img}),this.appendChild(this._img)),this._img}get _currentImg(){return this._hasPreviewImage?{type:De.PREVIEW,img:this._imgPreview}:{type:De.MAIN,img:this.img}}get _hasPreviewImage(){return this.$$("is-preview-blur")}get _bgSelector(){return this.$$("is-background-for")}get _breakpoints(){let e=this.$$("breakpoints");if(e){let t=o(e);return dt(t.map(i=>parseInt(i,10)))}else return null}get _hasFormatJPG(){return this.$$("format").toLowerCase()==="jpeg"}_renderBg(e){let t=new Set;t.add(`url("${this._getUrlBase(this._getElSize(e))}") 1x`),this.$$("hi-res-support")&&t.add(`url("${this._getUrlBase(this._getElSize(e,2))}") ${2}x`),this.$$("ultra-res-support")&&t.add(`url("${this._getUrlBase(this._getElSize(e,3))}") ${3}x`);let i=`image-set(${[...t].join(", ")})`;e.style.setProperty("background-image",i),e.style.setProperty("background-image",`-webkit-${i}`);}_getSrcset(){let e=new Set;return this._breakpoints?this._breakpoints.forEach(t=>{e.add(`${this._getUrlBase(`${t}x`)} ${this._validateSize(`${t}w`)}`),this.$$("hi-res-support")&&e.add(`${this._getUrlBase(`${t*2}x`)} ${this._validateSize(`${t*2}w`)}`),this.$$("ultra-res-support")&&e.add(`${this._getUrlBase(`${t*3}x`)} ${this._validateSize(`${t*3}w`)}`);}):(e.add(`${this._getUrlBase(this._getElSize(this._currentImg.img))} 1x`),this.$$("hi-res-support")&&e.add(`${this._getUrlBase(this._getElSize(this._currentImg.img,2))} 2x`),this.$$("ultra-res-support")&&e.add(`${this._getUrlBase(this._getElSize(this._currentImg.img,3))} 3x`)),[...e].join()}_getSrc(){return this._getUrlBase()}get _srcUrlPreview(){return this._getUrlBase("100x","100")}_renderBackground(){let e=this._bgSelector;[...document.querySelectorAll(e)].forEach(t=>{this.$$("intersection")?this.initIntersection(t,()=>{this._renderBg(t);}):this._renderBg(t);});}_appendURL({elNode:e,src:t,srcset:i}){t&&(e.src=t),i&&(e.srcset=i);}_setupConfigForImage({elNode:e}){this._setupEventProxy(e),this.initAttributes(e);}_loaderImage({src:e,srcset:t,elNode:i}){return new Promise((r,o)=>{this._setupConfigForImage({elNode:i}),i.setAttribute(Pe,""),i.addEventListener("load",()=>{i.removeAttribute(Pe),r(i);}),i.addEventListener("error",()=>{o(false);}),this._appendURL({elNode:i,src:e,srcset:t});})}async _renderImage(){if(this.$$("intersection")){this._hasPreviewImage&&(this._setupConfigForImage({elNode:this._imgPreview}),this.appendChild(this._imgPreview)),this.initIntersection(this._currentImg.img,async()=>{this._hasPreviewImage&&(this._imgPreview.src=this._srcUrlPreview);try{await this._loaderImage({src:this._getSrc(),srcset:this._getSrcset(),elNode:this._img}),this._hasPreviewImage&&await this._imgPreview.remove(),this.appendChild(this._img);}catch{this._hasPreviewImage&&await this._imgPreview?.remove(),this.appendChild(this._img);}});return}try{this._hasPreviewImage&&(await this._loaderImage({src:this._srcUrlPreview,elNode:this._imgPreview}),this.appendChild(this._imgPreview)),await this._loaderImage({src:this._getSrc(),srcset:this._getSrcset(),elNode:this._img}),this._hasPreviewImage&&await this._imgPreview?.remove(),this.appendChild(this._img);}catch{this._hasPreviewImage&&await this._imgPreview?.remove(),this.appendChild(this._img);}}init(){this._bgSelector?this._renderBackground():this._renderImage();}};var Re=class extends he{connectedCallback(){super.connectedCallback(),this.sub$$("src",()=>{this.init();}),this.sub$$("uuid",()=>{this.init();}),this.sub$$("lazy",s=>{!this.$$("is-background-for")&&!this.$$("is-preview-blur")&&(this.img.loading=s?"lazy":"eager");});}};var Oe=null,J=class extends D{constructor(){super(...arguments);this.dialogEl=createRef();this.strokes=false;this.blockBodyScrolling=false;this.closeDialog=()=>{this.modalManager?.close(this.id),this.modalManager?.hasActiveModals||(document.body.style.overflow="",this.$["*currentActivity"]=null);};this._handleDialogClose=()=>{this.closeDialog();};this._handleDialogMouseDown=e=>{this._mouseDownTarget=e.target;};this._handleDialogMouseUp=e=>{let t=e.target;t===this.dialogEl.value&&t===this._mouseDownTarget&&this.closeDialog();};this._handleModalOpen=({id:e})=>{e===this.id?(Oe=e,this.show(),this.emit(x$1.MODAL_OPEN,{modalId:e},{debounce:true})):this.hide();};this._handleModalClose=({id:e})=>{e===this.id&&(this.hide(),this.emit(x$1.MODAL_CLOSE,{modalId:e,hasActiveModals:this.modalManager?.hasActiveModals},{debounce:true}));};this._handleModalCloseAll=e=>{this.hide(),Oe===this.id&&this.emit(x$1.MODAL_CLOSE,{modalId:Oe,hasActiveModals:this.modalManager?.hasActiveModals},{debounce:true});};}static{this.styleAttrs=[...super.styleAttrs,"uc-modal"];}show(){let e=this.dialogEl.value;typeof e.showModal=="function"?(this.setAttribute("aria-modal","true"),e.showModal()):e.setAttribute("open",""),this.cfg.modalScrollLock&&(document.body.style.overflow="hidden");}hide(){let e=this.dialogEl.value;e&&(typeof e.close=="function"?(this.setAttribute("aria-modal","false"),e.close()):e.removeAttribute("open"));}initCallback(){super.initCallback(),this.modalManager?.registerModal(this.id,this),this.subConfigValue("modalBackdropStrokes",e=>{e?this.setAttribute("strokes",""):this.removeAttribute("strokes");}),this.modalManager?.subscribe(s.OPEN,this._handleModalOpen),this.modalManager?.subscribe(s.CLOSE,this._handleModalClose),this.modalManager?.subscribe(s.CLOSE_ALL,this._handleModalCloseAll);}disconnectedCallback(){super.disconnectedCallback(),document.body.style.overflow="",this._mouseDownTarget=void 0,this.modalManager?.unsubscribe(s.OPEN,this._handleModalOpen),this.modalManager?.unsubscribe(s.CLOSE,this._handleModalClose),this.modalManager?.unsubscribe(s.CLOSE_ALL,this._handleModalCloseAll);}_handleDialogRef(e){this.dialogEl={value:e},this.dialogEl.value?.addEventListener("close",this._handleDialogClose),this.dialogEl.value?.addEventListener("mousedown",this._handleDialogMouseDown),this.dialogEl.value?.addEventListener("mouseup",this._handleDialogMouseUp);}render(){return html`<dialog ${ref(this._handleDialogRef)}>${this.yield("")}</dialog>`}};a([property({type:Boolean,noAccessor:true})],J.prototype,"strokes",2),a([property({type:Boolean,attribute:"block-body-scrolling",noAccessor:true})],J.prototype,"blockBodyScrolling",2);var me=class extends g{constructor(){super(...arguments);this._validationInputElement=null;this._dynamicInputsContainer=null;}get _inputName(){return this.nameAttrValue??this.ctxName}_createValidationInput(){let e=document.createElement("input");return e.type="text",e.name=this._inputName,e.required=this.cfg.multipleMin>0,e.tabIndex=-1,b$1(e,{opacity:0,height:0,width:0}),e}initCallback(){super.initCallback(),this._validationInputElement=this._createValidationInput(),this.appendChild(this._validationInputElement),this.sub("*collectionState",e=>{if(!e)return;if(!this._dynamicInputsContainer){let o=document.createElement("div");this.appendChild(o),this._dynamicInputsContainer=o;}if(!this._validationInputElement){let o=this._createValidationInput();this.appendChild(o),this._validationInputElement=o;}if(this._dynamicInputsContainer.innerHTML="",e.status==="uploading"||e.status==="idle"){this._validationInputElement.value="",this._validationInputElement.setCustomValidity("");return}if(e.status==="failed"){let o=e.errors[0]?.message;this._validationInputElement.value="",this._validationInputElement.setCustomValidity(o??"");return}let t=e.group?e.group:null;if(t){this._validationInputElement.value=t.cdnUrl??"",this._validationInputElement.setCustomValidity("");return}let i=e.allEntries.map(o=>o.cdnUrl).filter(o=>typeof o=="string");if(!this.cfg.multiple&&i.length===1&&i[0]){this._validationInputElement.value=i[0],this._validationInputElement.setCustomValidity("");return}this._validationInputElement.remove(),this._validationInputElement=null;let r=new DocumentFragment;for(let o of i){let l=document.createElement("input");l.type="hidden",l.name=`${this._inputName}[]`,l.value=o,r.appendChild(l);}this._dynamicInputsContainer.replaceChildren(r);},false);}};a([property({type:String,noAccessor:true,attribute:"name"})],me.prototype,"nameAttrValue",2);var He=class extends D{initCallback(){super.initCallback(),this.subConfigValue("removeCopyright",s=>{this.toggleAttribute("hidden",!!s);});}render(){return html`<a href="https://uploadcare.com/?utm_source=copyright&utm_medium=referral&utm_campaign=v4" target="_blank noopener" class="uc-credits" >Powered by Uploadcare</a >`}};var W=class extends D{constructor(){super(...arguments);this.hasFileName=false;this.value=0;this.visible=true;this._progressValue=0;this._fakeProgressLineRef=createRef();this._handleFakeProgressAnimation=()=>{let e=this._fakeProgressLineRef.value;if(e){if(!this.visible){e.classList.add("uc-fake-progress--hidden");return}this._progressValue>0&&e.classList.add("uc-fake-progress--hidden");}};}firstUpdated(e){super.firstUpdated(e),this._progressValue=this._normalizeProgressValue(this.value),this._updateProgressValueStyle(),this._fakeProgressLineRef.value?.addEventListener("animationiteration",this._handleFakeProgressAnimation);}updated(e){if(super.updated(e),e.has("value")){let t=this._normalizeProgressValue(this.value);if(!this.visible)this._progressValue=t;else {let i=Math.max(this._progressValue,t);i!==this._progressValue&&(this._progressValue=i,this._updateProgressValueStyle());}}e.has("visible")&&(this.classList.toggle("uc-progress-bar--hidden",!this.visible),this.visible?this._updateProgressValueStyle():this._progressValue=this._normalizeProgressValue(this.value));}disconnectedCallback(){super.disconnectedCallback(),this._fakeProgressLineRef.value?.removeEventListener("animationiteration",this._handleFakeProgressAnimation);}_normalizeProgressValue(e){return Number.isFinite(e)?Math.min(100,Math.max(0,e)):0}_updateProgressValueStyle(){this.visible&&this.style.setProperty("--l-progress-value",this._progressValue.toString());}render(){return html`<div ${ref(this._fakeProgressLineRef)} class="uc-fake-progress"></div><div class="uc-progress"></div>`}};a([property({type:Boolean,noAccessor:true})],W.prototype,"hasFileName",2),a([property({type:Number})],W.prototype,"value",2),a([property({type:Boolean,reflect:true})],W.prototype,"visible",2);var ee=class extends g{constructor(){super();this._visible=false;this._value=0;this.init$={...this.init$,"*commonProgress":0};}initCallback(){super.initCallback(),this._unobserveCollectionCb=this.uploadCollection.observeProperties(()=>{let e=this.uploadCollection.items().some(t=>this.uploadCollection.read(t)?.getValue("isUploading")??false);this._visible=e;}),this.sub("*commonProgress",e=>{this._value=e;});}updated(e){super.updated(e),e.has("visible")&&(this._visible?this.setAttribute("active",""):this.removeAttribute("active"));}disconnectedCallback(){super.disconnectedCallback(),this._unobserveCollectionCb?.(),this._unobserveCollectionCb=void 0;}render(){return html`<uc-progress-bar .value=${this._value} .visible=${this._visible}></uc-progress-bar>`}};a([state()],ee.prototype,"_visible",2),a([state()],ee.prototype,"_value",2);var G=class extends D{constructor(){super(...arguments);this.value="";this.disabled=false;this.options=[];this._handleChange=e=>{if(this.disabled){e.preventDefault(),e.stopPropagation();return}e.preventDefault(),e.stopPropagation();let t=e.currentTarget;t&&(this.value=t.value,this.dispatchEvent(new Event("change")));};}render(){return html`<select @change=${this._handleChange} .value=${this.value} ?disabled=${this.disabled}>${this.options.map(e=>html`<option value=${e.value}>${e.text}</option>`)}</select>`}};a([property({type:String,attribute:false})],G.prototype,"value",2),a([property({type:Boolean,reflect:true})],G.prototype,"disabled",2),a([property({type:Array,attribute:false})],G.prototype,"options",2);var q=class extends g{constructor(){super(...arguments);this.couldBeCtxOwner=true;this._iconName="default";this._srcTypeKey="";}willUpdate(e){super.willUpdate(e),e.has("source")&&this._applySource(this.source);}_applySource(e){if(!e){this._srcTypeKey="",this._iconName="default";return}let{label:t,icon:i,id:r}=e;this._srcTypeKey=t,this._iconName=i??r??"default";}activate(){this.source&&this.source.onClick();}render(){return html`<button type="button" @click=${this.activate}><uc-icon name=${this._iconName}></uc-icon><div class="uc-txt">${this.l10n(this._srcTypeKey)}</div></button>`}};a([property({attribute:false})],q.prototype,"source",2),a([state()],q.prototype,"_iconName",2),a([state()],q.prototype,"_srcTypeKey",2);var te=class extends g{constructor(){super(...arguments);this._rawSourceList=[];this._cameraModes=[];this._sources=[];this.wrap=false;}initCallback(){super.initCallback(),this.subConfigValue("sourceList",t=>{this._rawSourceList=o(t),this._updateSources();}),this.subConfigValue("cameraModes",t=>{this._cameraModes=j$1(t),this._updateSources();});let e=this._sharedInstancesBag.pluginManager;e?.onPluginsChange&&(this._unsubscribePlugins=e.onPluginsChange(()=>this._updateSources()));}updated(e){super.updated(e),this.cfg.sourceListWrap?this.style.removeProperty("display"):this.style.display="contents";}_updateSources(){let t=this._sharedInstancesBag.pluginManager?.snapshot().sources??[],i=new Map(t.map(o=>[o.id,o])),r=[];this._rawSourceList.forEach((o,l)=>{let c=this._expandSource(o);if(c.length!==1||c[0]!==o){for(let C of c){let v=this._makeBuiltInSourceConfig(C);v&&r.push(v);}return}let u=this._makeBuiltInSourceConfig(o);if(u){r.push(u);return}let g=i.get(o);g&&r.push(this._makePluginSourceConfig(g));}),this._sources=r;}_expandSource(e){return e==="instagram"?(console.error("Instagram source was removed because the Instagram Basic Display API hasn't been available since December 4, 2024. Official statement, see here: https://developers.facebook.com/blog/post/2024/09/04/update-on-instagram-basic-display-api/?locale=en_US"),[]):e==="camera"&&a$1.htmlMediaCapture?this._cameraModes.length?this._cameraModes.map(i=>`mobile-${i}-camera`):["mobile-photo-camera"]:[e]}_makeBuiltInSourceConfig(e){switch(e){case e$1.LOCAL:return {id:e,label:`src-type-${e}`,icon:e,onClick:()=>this.api.openSystemDialog()};case e$1.CAMERA:return {id:e,label:`src-type-${e}`,icon:e,onClick:()=>this._openActivity("camera")};case "draw":return {id:e,label:"src-type-draw",icon:"edit-draw",onClick:()=>this._openActivity("draw")};}if(Object.values(d$1).includes(e)){let t=e==="mobile-photo-camera";return {id:e,label:"src-type-camera",icon:e$1.CAMERA,onClick:()=>{if(a$1.htmlMediaCapture){this.api.openSystemDialog({captureCamera:true,modeCamera:t?"photo":"video"});return}this._openActivity("camera");}}}return Object.values(c$1).includes(e)?{id:e,label:`src-type-${e}`,icon:e,onClick:()=>this._openActivity("external",{externalSourceType:e})}:null}_makePluginSourceConfig(e){return {id:e.id,label:e.label,icon:e.icon,onClick:()=>e.onSelect()}}_openActivity(e,t={}){if(!e){this.modalManager?.closeAll(),this.set$({"*currentActivityParams":{},"*currentActivity":null});return}this.set$({"*currentActivityParams":t,"*currentActivity":e}),this.modalManager?.open(e);}render(){return html`${this._sources.map(e=>html`<uc-source-btn role="listitem" .source=${e}></uc-source-btn>`)}`}disconnectedCallback(){this._unsubscribePlugins?.(),this._unsubscribePlugins=void 0,super.disconnectedCallback();}};a([state()],te.prototype,"_sources",2),a([property({type:Boolean,attribute:"wrap",noAccessor:true})],te.prototype,"wrap",2);var Ne=class extends D{render(){return html`<div class="uc-spinner"></div>`}};function ze(n,s=40){if(n.type==="image/svg+xml")return URL.createObjectURL(n);let e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return Promise.reject(new Error("Canvas context not supported"));let i=new Image,r=new Promise((o,l)=>{i.onload=()=>{let c=i.height/i.width;c>1?(e.width=s,e.height=s*c):(e.height=s,e.width=s/c),t.fillStyle="rgb(240, 240, 240)",t.fillRect(0,0,e.width,e.height),t.drawImage(i,0,0,e.width,e.height),e.toBlob(p=>{if(!p){l();return}let u=URL.createObjectURL(p);o(u);});},i.onerror=c=>{l(c);};});return i.src=URL.createObjectURL(n),r}var K=class extends g{constructor(){super(...arguments);this._entrySubs=new Set;this.entry=null;}withEntry(e){return (...t)=>{let i=this.entry;if(!i){console.warn("No entry found");return}return e(i,...t)}}subEntry(e,t){this.withEntry((i,r,o)=>{let l=i.subscribe(r,c=>{this.isConnected&&o(c);});this._entrySubs.add(l);})(e,t);}reset(){for(let e of this._entrySubs)e();this._entrySubs=new Set,this.entry=null;}disconnectedCallback(){super.disconnectedCallback(),this._entrySubs=new Set;}};function ni(n){let s=new Blob([n],{type:"image/svg+xml"});return URL.createObjectURL(s)}function ve(n="hsl(209, 21%, 65%)",s=32,e=32){return ni(`<svg width="${s}" height="${e}" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" fill="${n}" d="M9.68848 8.70068C9.68848 8.42454 9.91233 8.20068 10.1885 8.20068H15.0885C15.2211 8.20068 15.3483 8.25336 15.442 8.34713L20.342 13.2471C20.4358 13.3409 20.4885 13.4681 20.4885 13.6007V21.3007C20.4885 21.5768 20.2646 21.8007 19.9885 21.8007H10.1885C9.91233 21.8007 9.68848 21.5768 9.68848 21.3007V8.70068ZM10.6885 9.20068V20.8007H19.4885V14.1007L15.0885 14.1007C14.8123 14.1007 14.5885 13.8768 14.5885 13.6007L14.5885 9.20068H10.6885ZM15.5885 9.90779L18.7814 13.1007L15.5885 13.1007L15.5885 9.90779Z"/></svg>`)}var di=3e3,Q=class extends K{constructor(){super(...arguments);this.badgeIcon="";this.uid="";this._thumbUrl="";this._renderedGridOnce=false;this._thumbRect=null;this._isIntersecting=false;this._firstViewMode=this.cfg.filesViewMode;this._generateThumbnail=this.withEntry(async(e,t=false)=>{let i=e.getValue("fileInfo"),r=e.getValue("isImage"),o=e.getValue("uuid"),l$1=e.getValue("thumbUrl"),c=this._calculateThumbSize(t);if(i&&r&&o){let u=await this.proxyUrl(m(n(this.cfg.cdnCname,o),l(e.getValue("cdnUrlModifiers"),"stretch/off",`scale_crop/${c}x${c}/center`)));if(l$1===u)return;let{promise:g}=L$1(u);g.then(()=>{e.setValue("thumbUrl",u),l$1?.startsWith("blob:")&&URL.revokeObjectURL(l$1);}).catch(async()=>{if(!l$1?.startsWith("blob:"))try{let C=e.getValue("file");if(!C)return;let v=await ze(C,c);e.setValue("thumbUrl",v);}catch(C){this.telemetryManager.sendEventError(C,"thumbnail generation. Failed to generate thumb from file");let v=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");e.setValue("thumbUrl",ve(v));}});return}if(e.getValue("thumbUrl"))return;let p=e.getValue("file");if(p?.type.includes("image"))try{let u=await ze(p,c);e.setValue("thumbUrl",u);}catch(u){this.telemetryManager.sendEventError(u,"thumbnail generation. Failed to generate thumb from file");let g=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");e.setValue("thumbUrl",ve(g));}else {let u=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");e.setValue("thumbUrl",ve(u));}});this._debouncedGenerateThumb=e(this._generateThumbnail.bind(this),100);}_calculateThumbSize(e=false){e&&(this._thumbRect=this.getBoundingClientRect());let t=Math.max(parseInt(String(this?._thumbRect?.height||0),10),parseInt(String(this?._thumbRect?.width||0),10),this.cfg.thumbSize);return window.devicePixelRatio>1&&(t*=window.devicePixelRatio),Math.min(t,di)}_decodeImage(e,t){return new Promise((i,r)=>{let o=new Image;o.decoding="async";let l=()=>{o&&(o.onload=null,o.onerror=null,o.src=K$1,t?.removeEventListener("abort",c),o=null);},c=()=>{l(),r(new DOMException("Aborted","AbortError"));};if(t){if(t.aborted){c();return}t.addEventListener("abort",c,{once:true});}let p=()=>{l(),i();},u=g=>{l(),r(g);};if(typeof o.decode=="function"){o.src=e,o.decode().then(p).catch(u);return}o.onload=p,o.onerror=u,o.src=e;})}_cancelPendingThumbUpdate(){this._pendingThumbUpdate?.cancel(),this._pendingThumbUpdate=void 0;}_scheduleThumbUpdate(e){if(this._cancelPendingThumbUpdate(),!e){this._thumbUrl&&(this._thumbUrl="");return}if(e===this._thumbUrl)return;let t=new AbortController,i={controller:t,cancel:()=>{t.abort(),i.rafId!==void 0&&window.cancelAnimationFrame(i.rafId);}};this._pendingThumbUpdate=i,this._decodeImage(e,t.signal).then(()=>{t.signal.aborted||(i.rafId=window.requestAnimationFrame(()=>{t.signal.aborted||(this._thumbUrl=e);}));}).catch(r=>{t.signal.aborted||r instanceof DOMException&&r.name==="AbortError"||console.warn("[Thumb] Failed to decode thumbnail image",r);});}_requestThumbGeneration(e=false){if(this.entry){if(e){this._generateThumbnail(true);return}this._isIntersecting&&this._debouncedGenerateThumb();}}firstUpdated(e){super.firstUpdated(e),this._bindToEntry();}updated(e){super.updated(e),e.has("uid")&&this._bindToEntry();}_observerCallback(e){let[t]=e;t&&(this._isIntersecting=t.isIntersecting,t.isIntersecting&&(this._thumbRect=t.boundingClientRect,this._requestThumbGeneration(),this._observer?.disconnect()),t.intersectionRatio===0&&this._debouncedGenerateThumb.cancel());}reset(){super.reset(),this._debouncedGenerateThumb.cancel(),this._cancelPendingThumbUpdate(),this._thumbUrl&&(this._thumbUrl="");}_bindToEntry(){let e=this.uid?.trim();if(!e){this.entry&&this.reset();return}let t=this.uploadCollection?.read(e);if(!t||t===this.entry)return;this.reset(),this.entry=t;let i=()=>{this._requestThumbGeneration();};this.subEntry("fileInfo",r=>{r?.isImage&&i();}),this.subEntry("thumbUrl",r=>{this._scheduleThumbUpdate(r??void 0);}),this.subEntry("cdnUrlModifiers",i),this._requestThumbGeneration(true);}initCallback(){super.initCallback(),this.subConfigValue("filesViewMode",e=>{e==="grid"&&!this._renderedGridOnce&&(this._firstViewMode==="list"&&this._requestThumbGeneration(true),this._renderedGridOnce=true);});}connectedCallback(){super.connectedCallback(),this._observer?.disconnect(),this._observer=new window.IntersectionObserver(this._observerCallback.bind(this),{threshold:.1}),this._observer.observe(this);}disconnectedCallback(){super.disconnectedCallback(),this._debouncedGenerateThumb.cancel(),this._cancelPendingThumbUpdate(),this._observer?.disconnect();}render(){return html`<div class="uc-thumb"><img class="uc-thumb__img" src=${this._thumbUrl||K$1} role="img" alt="Preview of uploaded image" ?hidden=${!this._thumbUrl} draggable="false" /><div class="uc-badge"><uc-icon name=${this.badgeIcon}></uc-icon></div></div>`}};a([property({type:String})],Q.prototype,"badgeIcon",2),a([property({attribute:false})],Q.prototype,"uid",2),a([state()],Q.prototype,"_thumbUrl",2);var Ze=class extends f$2{};var je=class extends f$2{constructor(){super(...arguments);this.historyTracked=true;this.activityType=f$2.activities.START_FROM;}initCallback(){super.initCallback(),this.registerActivity(this.activityType??"");}render(){return html`<div class="uc-content">${this.yield("")}</div>`}};var We=class extends g{constructor(){super(...arguments);this._unbindEventEmitter=null;}static{this.styleAttrs=["uc-wgt-common"];}static{this.EventType=x$1;}initCallback(){super.initCallback(),this._unbindEventEmitter=this.eventEmitter.bindTarget(this);}disconnectedCallback(){super.disconnectedCallback(),this._unbindEventEmitter?.();}};var pi=/^([0-9]+)x([0-9]+)(?:\s+(\d{1,2}|100)%)?$/i,bt=n=>{if(typeof n!="string")return false;let s=pi.exec(n.toLocaleLowerCase())??[];if(s.length===0)return false;let e=Number(s[1])*Number(s[2]),t=16384*16384;return e>t?(console.warn(`Shrinked size can not be larger than ${Math.floor(t/1e3/1e3)}MP. You have set ${s[1]}x${s[2]} (${Math.ceil(e/1e3/100)/10}MP).`),false):{quality:s[3]?Number(s[3])/100:void 0,size:e}};var x=Object.freeze({FINISHED:Symbol("FINISHED"),FAILED:Symbol("FAILED"),UPLOADING:Symbol("UPLOADING"),VALIDATION:Symbol("VALIDATION"),QUEUED_UPLOADING:Symbol("QUEUED-UPLOADING"),QUEUED_VALIDATION:Symbol("QUEUED-VALIDATION"),IDLE:Symbol("IDLE")}),y=class y extends K{constructor(){super(...arguments);this.couldBeCtxOwner=true;this._pauseRender=true;this.uid="";this._itemName="";this._errorText="";this._hint="";this._progressValue=0;this._progressVisible=false;this._badgeIcon="";this._isFinished=false;this._isFailed=false;this._isUploading=false;this._isFocused=false;this._showFileNames=false;this._ariaLabelStatusFile="";this._pluginFileActions=[];this._renderedOnce=false;this._handleRemove=()=>{this.telemetryManager.sendEvent({payload:{metadata:{event:"remove-file",node:this.tagName}}}),this.uid&&this.uploadCollection.hasItem(this.uid)&&this.uploadCollection.remove(this.uid);};this._handleUploadClick=()=>{this._upload();};this._debouncedCalculateState=e(()=>this._calculateState(),100);this._updateHintAndProgress=this.withEntry(M((e,t)=>{let i=e.getValue("errors")?.[0]?.message??"",r=e.getValue("source"),o=e.getValue("externalUrl"),l=t===x.FINISHED,c=t===x.UPLOADING,p=t===x.QUEUED_UPLOADING,u=t===x.QUEUED_VALIDATION,g=t===x.VALIDATION,C=e.getValue("fileName"),v="";i?v="":!l&&o&&r&&Object.values(c$1).includes(r)&&(v=this.l10n("waiting-for",{source:this.l10n(`src-type-${r}`)})),this._hint=v,this._errorText=i,this._progressVisible=c||p||u||g,this._progressValue=u||g?0:e.getValue("uploadProgress"),this._ariaLabelStatusFile=C?this.l10n("a11y-file-item-status",{fileName:C,status:this.l10n(t?.description?.toLocaleLowerCase()??"").toLocaleLowerCase()}):"";},100));this._upload=this.withEntry(async e=>{if(!this.uploadCollection.read(e.uid)||e.getValue("fileInfo")||e.getValue("isUploading")||e.getValue("errors").length>0||e.getValue("isValidationPending"))return;let t=this.cfg.multiple?this.cfg.multipleMax:1;if(!(t&&this.uploadCollection.size>t)){e.setMultipleValues({isUploading:true,errors:[],isQueuedForUploading:true}),this._debouncedCalculateState();try{let i=new AbortController;e.setValue("abortController",i);let r=async()=>{e.setValue("isQueuedForUploading",!1);let l=e.getValue("file");if(l instanceof File&&this.cfg.imageShrink)try{let g=bt(this.cfg.imageShrink);g?l=await shrinkFile(l,g):console.warn("Image shrink settings are invalid, skipping shrinking");}catch{}let c=l||e.getValue("externalUrl")||e.getValue("uuid");if(!c)throw new Error("No file input");let u={...await this.getUploadClientOptions(),fileName:e.getValue("fileName")??void 0,source:e.getValue("source")??void 0,onProgress:g=>{if(g.isComputable){let C=g.value*100;e.setValue("uploadProgress",C);}},signal:i.signal,metadata:await this.getMetadataFor(e.uid)};return this.debugPrint("upload options",c,u),uploadFile(c,u)},o=await this.$["*uploadQueue"].add(r);e.setMultipleValues({fileInfo:o,isQueuedForUploading:!1,isUploading:!1,fileName:o.originalFilename,fileSize:o.size,isImage:o.isImage??!1,mimeType:o.contentInfo?.mime?.mime??o.mimeType,uuid:o.uuid,cdnUrl:e.getValue("cdnUrl")??o.cdnUrl,cdnUrlModifiers:e.getValue("cdnUrlModifiers")??"",uploadProgress:100,source:e.getValue("source")??null}),e===this.entry&&this._debouncedCalculateState();}catch(i){this.telemetryManager.sendEventError(i,"file upload. Failed to upload file"),i instanceof CancelError&&i.isCancel?e.setMultipleValues({isUploading:false,uploadProgress:0}):i instanceof UploadcareError?e.setMultipleValues({isUploading:false,uploadProgress:0,uploadError:i}):(console.error("Unknown upload error",i),e.setMultipleValues({isUploading:false,uploadProgress:0,uploadError:new Error("Something went wrong",{cause:i})})),e===this.entry&&this._debouncedCalculateState();}}});}_calculateState(){let e=this.entry;if(!e)return;let t=x.IDLE;e.getValue("errors").length>0?t=x.FAILED:e.getValue("isQueuedForUploading")?t=x.QUEUED_UPLOADING:e.getValue("isQueuedForValidation")?t=x.QUEUED_VALIDATION:e.getValue("isValidationPending")?t=x.VALIDATION:e.getValue("isUploading")?t=x.UPLOADING:e.getValue("fileInfo")&&(t=x.FINISHED),this._handleState(e,t);}_handleState(e,t){t===x.FAILED?this._badgeIcon="badge-error":t===x.FINISHED&&(this._badgeIcon="badge-success"),t===x.UPLOADING&&(this._isFocused=false,this.removeAttribute("focused")),this._isFailed=t===x.FAILED,this._isUploading=t===x.UPLOADING,this._isFinished=t===x.FINISHED,this._updateHintAndProgress(t);}reset(){super.reset(),this._debouncedCalculateState.cancel();}_observerCallback(e){let[t]=e;t&&t.isIntersecting&&!this._renderedOnce&&(this._pauseRender=false,this._renderedOnce=true);}_handleEntryId(e){this.reset();let t=this.uploadCollection?.read(e);if(this.entry=t,!t){this._updatePluginFileActions();return}this.subEntry("isQueuedForValidation",()=>{this._debouncedCalculateState();}),this.subEntry("isValidationPending",()=>{this._debouncedCalculateState();}),this.subEntry("uploadProgress",()=>{this._debouncedCalculateState();}),this.subEntry("isQueuedForUploading",()=>{this._debouncedCalculateState();}),this.subEntry("fileName",i=>{this._itemName=i||t.getValue("externalUrl")||this.l10n("file-no-name"),this._debouncedCalculateState();}),this.subEntry("externalUrl",i=>{this._itemName=t.getValue("fileName")||i||this.l10n("file-no-name");}),this.subEntry("fileInfo",()=>{this._debouncedCalculateState();}),this.subEntry("errors",()=>this._debouncedCalculateState()),this.subEntry("isUploading",()=>this._debouncedCalculateState()),this.subEntry("fileSize",()=>this._debouncedCalculateState()),this.subEntry("mimeType",()=>this._debouncedCalculateState()),this.subEntry("isImage",()=>this._debouncedCalculateState()),this.subEntry("fileInfo",()=>this._updatePluginFileActions()),this.subEntry("isUploading",()=>this._updatePluginFileActions()),this.subEntry("errors",()=>this._updatePluginFileActions()),this._calculateState(),this._updatePluginFileActions();}_updateShowFileNames(e){if(this.cfg.filesViewMode==="list"){this._showFileNames=true;return}this._showFileNames=e;}willUpdate(e){super.willUpdate(e),e.has("uid")&&this._handleEntryId(this.uid);}_updatePluginFileActions(){let e=this._sharedInstancesBag.pluginManager;if(!e||!this.uid){this._pluginFileActions=[];return}let t=e.snapshot().fileActions,i=this.api.getOutputItem(this.uid);if(!i){this._pluginFileActions=[];return}this._pluginFileActions=t.filter(r=>{try{return r.shouldRender(i)}catch(o){return console.error(`Error in plugin file action shouldRender (${r.id}):`,o),false}});}_handlePluginFileAction(e){if(!this.uid)return;let t=this.api.getOutputItem(this.uid);if(t)try{e.onClick(t);}catch(i){console.error(`Error in plugin file action onClick (${e.id}):`,i);}}initCallback(){super.initCallback(),this._handleEntryId(this.uid),this.subConfigValue("filesViewMode",t=>{this._updateShowFileNames(this.cfg.gridShowFileNames),this.setAttribute("mode",t);}),this.subConfigValue("gridShowFileNames",t=>{this._updateShowFileNames(t);}),this.onclick=()=>{y.activeInstances.forEach(t=>{t===this?t.setAttribute("focused",""):t.removeAttribute("focused");});},this.sub("*uploadTrigger",t=>{this.entry&&!t.has(this.entry.uid)||setTimeout(()=>this.isConnected&&this._upload());});let e=this._sharedInstancesBag.pluginManager;e?.onPluginsChange&&(this._unsubscribePlugins=e.onPluginsChange(()=>this._updatePluginFileActions())),this._updatePluginFileActions(),y.activeInstances.add(this);}connectedCallback(){super.connectedCallback(),this._observer=new window.IntersectionObserver(this._observerCallback.bind(this),{threshold:[0,1]}),this._observer.observe(this);}disconnectedCallback(){this._unsubscribePlugins?.(),this._unsubscribePlugins=void 0,super.disconnectedCallback(),this._observer?.disconnect(),y.activeInstances.delete(this),this.reset();}static{this.activeInstances=new Set;}shouldUpdate(e){return this._pauseRender?false:super.shouldUpdate(e)}render(){return html`<div class="uc-inner" ?data-finished=${this._isFinished} ?data-uploading=${this._isUploading} ?data-failed=${this._isFailed} ?data-focused=${this._isFocused} ><uc-thumb .uid=${this.uid} .badgeIcon=${this._badgeIcon}></uc-thumb><div aria-atomic="true" aria-live="polite" class="uc-file-name-wrapper" aria-label=${this._ariaLabelStatusFile}><span class="uc-file-name" ?hidden=${!this._showFileNames}>${this._itemName}</span><span class="uc-file-error" ?hidden=${!this._errorText}>${this._errorText}</span><span class="uc-file-hint" ?hidden=${!this._hint}>${this._hint}</span></div><div class="uc-file-actions">${this._pluginFileActions.map(e=>html`<button type="button" @click=${()=>this._handlePluginFileAction(e)} title=${e.id} aria-label=${e.id} class="uc-plugin-action-btn uc-mini-btn" data-plugin-action-id=${e.id} ><uc-icon name=${e.icon}></uc-icon></button>`)}<button type="button" @click=${this._handleRemove} title=${this.l10n("file-item-remove-button")} aria-label=${this.l10n("file-item-remove-button")} class="uc-remove-btn uc-mini-btn" ><uc-icon name="remove-file"></uc-icon></button><button type="button" class="uc-upload-btn uc-mini-btn" @click=${this._handleUploadClick}><uc-icon name="upload"></uc-icon></button></div><uc-progress-bar class="uc-progress-bar" .value=${this._progressValue} .visible=${this._progressVisible} ?hasFileName=${this._showFileNames}></uc-progress-bar></div>`}};a([state()],y.prototype,"_pauseRender",2),a([property({attribute:false})],y.prototype,"uid",2),a([state()],y.prototype,"_itemName",2),a([state()],y.prototype,"_errorText",2),a([state()],y.prototype,"_hint",2),a([state()],y.prototype,"_progressValue",2),a([state()],y.prototype,"_progressVisible",2),a([state()],y.prototype,"_badgeIcon",2),a([state()],y.prototype,"_isFinished",2),a([state()],y.prototype,"_isFailed",2),a([state()],y.prototype,"_isUploading",2),a([state()],y.prototype,"_isFocused",2),a([state()],y.prototype,"_showFileNames",2),a([state()],y.prototype,"_ariaLabelStatusFile",2),a([state()],y.prototype,"_pluginFileActions",2);var Ge=y;function bi(n){return new Promise(s=>{typeof window.FileReader!="function"&&s(false);try{let e=new FileReader;e.onerror=()=>{s(!0);};let t=i=>{i.type!=="loadend"&&e.abort(),s(!1);};e.onloadend=t,e.onprogress=t,e.readAsDataURL(n);}catch{s(false);}})}function yi(n,s){return new Promise(e=>{let t=0,i=[],r=l=>{if(!l){console.warn("Unexpectedly received empty content entry",{scope:"drag-and-drop"}),e(null);return}l.isFile?(t++,l.file(c=>{t--;let p=new File([c],c.name,{type:c.type||s});i.push({type:"file",file:p,fullPath:l.fullPath}),t===0&&e(i);})):l.isDirectory&&o(l.createReader());},o=l=>{t++,l.readEntries(c=>{t--;for(let p of c)r(p);t===0&&e(i);});};r(n);})}function _t(n){let s=[],e=[];for(let t=0;t<n.items.length;t++){let i=n.items[t];if(i)if(i.kind==="file"){let r=i.type,o=i;if(typeof o.webkitGetAsEntry=="function"||typeof o.getAsEntry=="function"){let c=typeof o.webkitGetAsEntry=="function"?o.webkitGetAsEntry():o.getAsEntry?.();c&&e.push(yi(c,r).then(p=>{p&&s.push(...p);}));continue}let l=i.getAsFile();l&&e.push(bi(l).then(c=>{c||s.push({type:"file",file:l});}));}else i.kind==="string"&&/^text\/uri-list/.test(i.type)&&e.push(new Promise(r=>{i.getAsString(o=>{s.push({type:"url",url:o}),r();});}));}return Promise.all(e).then(()=>s)}var T=Object.freeze({ACTIVE:0,INACTIVE:1,NEAR:2,OVER:3}),wt=["focus"],_i=100,qe=new Map;function wi(n,s){let e=Math.max(Math.min(n[0],s.x+s.width),s.x),t=Math.max(Math.min(n[1],s.y+s.height),s.y);return Math.sqrt((n[0]-e)*(n[0]-e)+(n[1]-t)*(n[1]-t))}function Ke(n){let s=0,e=document.body,t=new Set,i=b=>{t.add(b);},r=T.INACTIVE,o=b=>{n.shouldIgnore()&&b!==T.INACTIVE||(r!==b&&t.forEach(z=>{z(b);}),r=b);},l=()=>s>0;i(b=>n.onChange(b));let c=()=>{s=0,o(T.INACTIVE);},p=()=>{s+=1,r===T.INACTIVE&&o(T.ACTIVE);},u=()=>{s-=1,l()||o(T.INACTIVE);},g=b=>{b.preventDefault(),s=0,o(T.INACTIVE);},C=b=>{if(n.shouldIgnore())return;l()||(s+=1);let z=[b.x,b.y],Te=n.element.getBoundingClientRect(),Me=Math.floor(wi(z,Te)),$t=Me<_i,Vt=b.composedPath().includes(n.element);qe.set(n.element,Me);let Je=Math.min(...qe.values())===Me;Vt&&Je?(b.preventDefault(),o(T.OVER)):o($t&&Je?T.NEAR:T.ACTIVE);},v=async b=>{if(n.shouldIgnore())return;b.preventDefault();let{dataTransfer:z}=b;if(!z)return;let Te=await _t(z);n.onItems(Te),o(T.INACTIVE);};return e.addEventListener("drop",g),e.addEventListener("dragleave",u),e.addEventListener("dragenter",p),e.addEventListener("dragover",C),n.element.addEventListener("drop",v),wt.forEach(b=>{window.addEventListener(b,c);}),()=>{qe.delete(n.element),e.removeEventListener("drop",g),e.removeEventListener("dragleave",u),e.removeEventListener("dragenter",p),e.removeEventListener("dragover",C),n.element.removeEventListener("drop",v),wt.forEach(b=>{window.removeEventListener(b,c);});}}var Qe=new Set,I=class extends g{constructor(){super(...arguments);this.single=false;this.ghost=false;this.disabled=false;this.clickable=false;this.withIcon=false;this.fullscreen=false;this.initflow=false;this._isEnabled=true;this._isVisible=true;this._destroyDropzone=null;this._destroyContentWrapperDropzone=null;this._contentWrapperRef=createRef();this._handleAreaInteraction=e=>{if(e instanceof KeyboardEvent){if(e.code!=="Space"&&e.code!=="Enter")return}else if(!(e instanceof MouseEvent))return;if(this.initflow){this.api.initFlow();return}this.api.openSystemDialog();};this._sourceListAllowsLocal=true;this._clickableListenersAttached=false;}static{this.styleAttrs=[...super.styleAttrs,"uc-drop-area"];}get _localizedText(){let e=this.text;return typeof e=="string"&&e.length>0?this.l10n(e)||e:this.l10n("drop-files-here")}isActive(){if(!this._isEnabled)return false;let e=this.getBoundingClientRect(),t=e.width>0&&e.height>0,i=e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth),r=window.getComputedStyle(this),o=r.visibility!=="hidden"&&r.display!=="none";return t&&o&&i}initCallback(){super.initCallback(),Qe.add(this),this._updateIsEnabled(),this._updateVisibility(),this._updateClickableListeners(),this._updateDragStateAttribute(T.INACTIVE),this._destroyDropzone=Ke({element:this,shouldIgnore:()=>this._shouldIgnore(),onChange:e=>{this._updateDragStateAttribute(e);},onItems:e=>{e.length&&(e.forEach(t=>{t.type==="url"?this.api.addFileFromUrl(t.url,{source:e$1.DROP_AREA}):t.type==="file"&&this.api.addFileFromObject(t.file,{source:e$1.DROP_AREA,fullPath:t.fullPath});}),this.uploadCollection.size&&(this.set$({"*currentActivity":f$2.activities.UPLOAD_LIST}),this.modalManager?.open(f$2.activities.UPLOAD_LIST)));}}),this.updateComplete.then(()=>this._setupContentWrapperDropzone()),this.subConfigValue("sourceList",e=>{let t=o(e);this._sourceListAllowsLocal=t.includes(e$1.LOCAL),this._updateIsEnabled(),this._updateVisibility();});}willUpdate(e){super.willUpdate(e),e.has("disabled")&&(this._updateIsEnabled(),this._updateVisibility());}updated(e){super.updated(e),e.has("clickable")&&this._updateClickableListeners();}_shouldIgnore(){if(!this._isEnabled||!this._couldHandleFiles())return true;if(!this.fullscreen)return false;let e=Qe;return e.size===0?false:[...e].filter(r=>r!==this).filter(r=>r.isActive()).length>0}_couldHandleFiles(){let e=this.cfg.multiple,t=this.cfg.multipleMax,i=this.uploadCollection.size;return !(e&&t&&i>=t||!e&&i>0)}_updateIsEnabled(){let e=this._sourceListAllowsLocal&&!this.disabled;this._isEnabled=e;}_updateVisibility(){let e=this._isEnabled||!this.querySelector("[data-default-slot]");this._isVisible=e,this.hidden=!e;}_updateDragStateAttribute(e){let t=Object.entries(T).find(([,i])=>i===e)?.[0].toLowerCase();t&&this.setAttribute("drag-state",t);}_setupContentWrapperDropzone(){if(this._destroyContentWrapperDropzone)return;let e=this._contentWrapperRef.value;e&&(this._destroyContentWrapperDropzone=Ke({element:e,onChange:t=>{let i=Object.entries(T).find(([,r])=>r===t)?.[0].toLowerCase();i&&e.setAttribute("drag-state",i);},onItems:()=>{},shouldIgnore:()=>this._shouldIgnore()}));}_updateClickableListeners(){this.clickable&&!this._clickableListenersAttached?(this.addEventListener("keydown",this._handleAreaInteraction),this.addEventListener("click",this._handleAreaInteraction),this._clickableListenersAttached=true):!this.clickable&&this._clickableListenersAttached&&(this.removeEventListener("keydown",this._handleAreaInteraction),this.removeEventListener("click",this._handleAreaInteraction),this._clickableListenersAttached=false);}disconnectedCallback(){super.disconnectedCallback(),Qe.delete(this),this._destroyDropzone?.(),this._destroyContentWrapperDropzone?.(),this._clickableListenersAttached&&(this.removeEventListener("keydown",this._handleAreaInteraction),this.removeEventListener("click",this._handleAreaInteraction),this._clickableListenersAttached=false);}render(){return html` ${this.yield("",html`<div data-default-slot hidden></div><div ${ref(this._contentWrapperRef)} class="uc-content-wrapper" ?hidden=${!this._isVisible}><div class="uc-icon-container" ?hidden=${!this.withIcon}><uc-icon name="default"></uc-icon><uc-icon name="arrow-down"></uc-icon></div><span class="uc-text">${this._localizedText}</span></div>`)} `}};a([property({type:Boolean,noAccessor:true})],I.prototype,"single",2),a([property({type:Boolean,noAccessor:true})],I.prototype,"ghost",2),a([property({type:Boolean,reflect:true})],I.prototype,"disabled",2),a([property({type:Boolean,reflect:true})],I.prototype,"clickable",2),a([property({type:Boolean,attribute:"with-icon",reflect:true})],I.prototype,"withIcon",2),a([property({type:Boolean,reflect:true})],I.prototype,"fullscreen",2),a([property({type:Boolean,reflect:true})],I.prototype,"initflow",2),a([property({type:String})],I.prototype,"text",2),a([state()],I.prototype,"_isEnabled",2),a([state()],I.prototype,"_isVisible",2);var P=class extends g{constructor(){super(...arguments);this.couldBeCtxOwner=true;this.historyTracked=true;this.activityType=f$2.activities.UPLOAD_LIST;this._doneBtnVisible=false;this._doneBtnEnabled=false;this._uploadBtnVisible=false;this._addMoreBtnVisible=false;this._addMoreBtnEnabled=false;this._commonErrorMessage=null;this._hasFiles=false;this._latestSummary=null;this._handleAdd=()=>{this.telemetryManager.sendEvent({eventType:w.ACTION_EVENT,payload:{metadata:{event:"add-more",node:this.tagName}}}),this.api.initFlow(true);};this._handleUpload=()=>{this.emit(x$1.UPLOAD_CLICK),this.api.uploadAll(),this._throttledHandleCollectionUpdate();};this._handleDone=()=>{this.emit(x$1.DONE_CLICK,this.api.getOutputCollectionState()),this.api.doneFlow();};this._handleCancel=()=>{this.telemetryManager.sendEvent({eventType:w.ACTION_EVENT,payload:{metadata:{event:"clear-all",node:this.tagName}}}),this.uploadCollection.clearAll();};this._throttledHandleCollectionUpdate=M(()=>{this.isConnected&&(this._updateUploadsState(),!this.couldOpenActivity&&this.$["*currentActivity"]===this.activityType&&this.historyBack(),this.cfg.confirmUpload||this.api.uploadAll());},300);}get _headerText(){return this._latestSummary?this._getHeaderText(this._latestSummary):""}_updateUploadsState(){let e=this.api.getOutputCollectionState(),t={total:e.totalCount,succeed:e.successCount,uploading:e.uploadingCount,failed:e.failedCount,validatingBeforeUploading:e.idleEntries.filter(v=>v.isValidationPending).length},i=!e.errors.some(v=>v.type==="TOO_MANY_FILES"||v.type==="TOO_FEW_FILES"),r=e.errors.some(v=>v.type==="TOO_MANY_FILES"),o=e.totalCount===(this.cfg.multiple?this.cfg.multipleMax:1),l=e.allEntries.some(v=>v.isValidationPending),c=t.failed===0&&e.errors.length===0&&!l,p=false,u=false,g=false;if(t.total-t.succeed-t.uploading-t.failed>0&&i&&c&&this.cfg.confirmUpload)p=true;else {u=true;let v=this.cfg.groupOutput?!!e.group:true;g=t.total===t.succeed&&i&&c&&v;}this._doneBtnVisible=u,this._doneBtnEnabled=g,this._uploadBtnVisible=p,this._addMoreBtnEnabled=t.total===0||!r&&!o,this._addMoreBtnVisible=!o||this.cfg.multiple,this._hasFiles=t.total>0,this._latestSummary=t;}_getHeaderText(e){let t=i=>{let r=e[i];return i==="uploading"&&(r+=e.validatingBeforeUploading),this.l10n(`header-${i}`,{count:r})};return e.uploading>0||e.validatingBeforeUploading>0?t("uploading"):e.failed>0?t("failed"):e.succeed>0?t("succeed"):t("total")}get couldOpenActivity(){return this.cfg.showEmptyList||this.uploadCollection.size>0}initCallback(){super.initCallback(),this.registerActivity(this.activityType),this.subConfigValue("multiple",this._throttledHandleCollectionUpdate),this.subConfigValue("multipleMin",this._throttledHandleCollectionUpdate),this.subConfigValue("multipleMax",this._throttledHandleCollectionUpdate),this.sub("*groupInfo",e=>{e&&this._throttledHandleCollectionUpdate();}),this.subConfigValue("filesViewMode",e=>{this.setAttribute("mode",e);}),this.sub("*currentActivity",e=>{!this.couldOpenActivity&&e===this.activityType&&(this.$["*currentActivity"]=this.initActivity);}),this.uploadCollection.observeProperties(this._throttledHandleCollectionUpdate),this.uploadCollection.observeCollection(this._throttledHandleCollectionUpdate),this.sub("*collectionErrors",e=>{let t=e.filter(i=>i.type!=="SOME_FILES_HAS_ERRORS")[0];if(!t){this._commonErrorMessage=null;return}this._commonErrorMessage=t.message;});}disconnectedCallback(){super.disconnectedCallback(),this.has("*uploadCollection")&&(this.uploadCollection.unobserveProperties(this._throttledHandleCollectionUpdate),this.uploadCollection.unobserveCollection(this._throttledHandleCollectionUpdate));}render(){return html`<uc-activity-header><span aria-live="polite" class="uc-header-text">${this._headerText}</span><button type="button" class="uc-mini-btn uc-close-btn" @click=${this.$["*closeModal"]} title=${this.l10n("a11y-activity-header-button-close")} aria-label=${this.l10n("a11y-activity-header-button-close")} ><uc-icon name="close"></uc-icon></button></uc-activity-header><div class="uc-no-files" ?hidden=${this._hasFiles}>${this.yield("empty",html`<span>${this.l10n("no-files")}</span>`)}</div><div class="uc-files"><div class="uc-files-wrapper">${repeat(this.$["*uploadList"]??[],({uid:e})=>e,({uid:e})=>html`<uc-file-item .uid=${e}></uc-file-item>`)}</div><button type="button" class="uc-add-more-btn uc-secondary-btn" @click=${this._handleAdd} ?disabled=${!this._addMoreBtnEnabled} ?hidden=${!this._addMoreBtnVisible} ><uc-icon name="add"></uc-icon><span>${this.l10n("add-more")}</span></button></div><div class="uc-common-error" ?hidden=${!this._commonErrorMessage} >${this._commonErrorMessage??""}</div><div class="uc-toolbar"><button type="button" class="uc-cancel-btn uc-secondary-btn" @click=${this._handleCancel}>${this.l10n("clear")}</button><div class="uc-toolbar-spacer"></div><button type="button" class="uc-add-more-btn uc-secondary-btn" ?hidden=${!this._addMoreBtnVisible} ?disabled=${!this._addMoreBtnEnabled} @click=${this._handleAdd} ><uc-icon name="add"></uc-icon><span>${this.l10n("add-more")}</span></button><button type="button" class="uc-upload-btn uc-primary-btn" ?hidden=${!this._uploadBtnVisible} @click=${this._handleUpload} >${this.l10n("upload")}</button><button type="button" class="uc-done-btn uc-primary-btn" ?hidden=${!this._doneBtnVisible} ?disabled=${!this._doneBtnEnabled} @click=${this._handleDone} >${this.l10n("done")}</button></div><uc-drop-area ghost></uc-drop-area>`}};a([state()],P.prototype,"_doneBtnVisible",2),a([state()],P.prototype,"_doneBtnEnabled",2),a([state()],P.prototype,"_uploadBtnVisible",2),a([state()],P.prototype,"_addMoreBtnVisible",2),a([state()],P.prototype,"_addMoreBtnEnabled",2),a([state()],P.prototype,"_commonErrorMessage",2),a([state()],P.prototype,"_hasFiles",2),a([state()],P.prototype,"_latestSummary",2);var ge=class extends g{constructor(){super(...arguments);this._formState={importDisabled:true};this._inputRef=createRef();this._handleInput=e=>{let t=e.target?.value??"";this._formState={importDisabled:!t};};this._handleUpload=e=>{e.preventDefault(),this.telemetryManager.sendEvent({eventType:w.ACTION_EVENT,payload:{metadata:{event:"upload-from-url",node:this.tagName}}});let i=this._inputRef.value?.value?.trim();i&&(this.api.addFileFromUrl(i,{source:e$1.URL}),this.$["*currentActivity"]=f$2.activities.UPLOAD_LIST,this.modalManager?.open(f$2.activities.UPLOAD_LIST));};}firstUpdated(){let e=this._inputRef.value;e&&(e.value="",e.focus());}render(){return html`<uc-activity-header><button type="button" class="uc-mini-btn" @click=${this.historyBack} title=${this.l10n("back")} aria-label=${this.l10n("back")}><uc-icon name="back"></uc-icon></button><div><uc-icon name="url"></uc-icon><span>${this.l10n("caption-from-url")}</span></div><button type="button" class="uc-mini-btn uc-close-btn" @click=${this.$["*closeModal"]} title=${this.l10n("a11y-activity-header-button-close")} aria-label=${this.l10n("a11y-activity-header-button-close")} ><uc-icon name="close"></uc-icon></button></uc-activity-header><form class="uc-content" @submit=${this._handleUpload}><label><input ${ref(this._inputRef)} placeholder="https://" class="uc-url-input" type="text" @input=${this._handleInput} /></label><button type="submit" class="uc-url-upload-btn uc-primary-btn" ?disabled=${this._formState.importDisabled} >${this.l10n("upload-url")}</button></form>`}};a([state()],ge.prototype,"_formState",2);var Et=()=>typeof navigator.permissions<"u";var Li={width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}},Pi=["camera","microphone"];function ye(n){let s=Math.floor(n/60).toString().padStart(2,"0"),e=Math.floor(n%60).toString().padStart(2,"0");return `${s}:${e}`}var Tt="image/jpeg",Mt="video/webm",f=class extends g{constructor(){super(...arguments);this.couldBeCtxOwner=true;this.activityType=f$2.activities.CAMERA;this._unsubPermissions=null;this._capturing=false;this._chunks=[];this._mediaRecorder=null;this._stream=null;this._selectedAudioId=null;this._selectedCameraId=null;this._activeTab=null;this._options={};this._canvas=null;this._ctx=null;this._cameraDevices=[];this._audioDevices=[];this._permissionResponses={};this._permissionCleanupFns=[];this._currentVideoSource=null;this._handlePreviewPlay=()=>{this._startTimeline(),this._currentTimelineIcon="pause";};this._handlePreviewPause=()=>{this._currentTimelineIcon="play",this._stopTimeline();};this._timerRef=createRef();this._lineRef=createRef();this._videoRef=createRef();this._switcherRef=createRef();this._startTime=0;this._elapsedTime=0;this._videoTransformCss=null;this._videoHidden=true;this._messageHidden=true;this._requestBtnHidden=Et();this._cameraSelectOptions=[];this._cameraSelectHidden=true;this._l10nMessage="";this._timerHidden=true;this._cameraHidden=true;this._cameraActionsHidden=true;this._audioSelectOptions=[];this._audioSelectHidden=true;this._audioSelectDisabled=true;this._audioToggleMicrophoneHidden=true;this._tabCameraHidden=true;this._tabVideoHidden=true;this._currentIcon="camera-full";this._currentTimelineIcon="play";this._toggleMicrophoneIcon="microphone";this._mutableClassButton="uc-shot-btn uc-camera-action";this._chooseActionWithCamera=()=>{if(this.telemetryManager.sendEvent({eventType:w.ACTION_EVENT,payload:{metadata:{event:"start-camera",node:this.tagName,tabId:this._activeTab}}}),this._activeTab===E.PHOTO&&this._shot(),this._activeTab===E.VIDEO){if(this._mediaRecorder?.state==="recording"){this._stopRecording();return}this._startRecording();}};this._handleCameraSelectChange=e=>{let t=e.target;t&&(this._selectedCameraId=t.value,this._capture());};this._handleAudioSelectChange=e=>{let t=e.target;t&&(this._selectedAudioId=t.value,this._capture());};this._handleRequestPermissions=()=>{this._capture();};this._handleStartCamera=()=>{this.telemetryManager.sendEvent({eventType:w.ACTION_EVENT,payload:{metadata:{event:"shot-camera",node:this.tagName,tabId:this._activeTab}}}),this._chooseActionWithCamera();};this._handleToggleRecording=()=>{this._toggleRecording();};this._handleToggleAudio=()=>{this._toggleEnableAudio();};this._handleRetake=()=>{this.telemetryManager.sendEvent({eventType:w.ACTION_EVENT,payload:{metadata:{event:"retake-camera",node:this.tagName,tabId:this._activeTab}}}),this._retake();};this._handleAccept=()=>{this.telemetryManager.sendEvent({eventType:w.ACTION_EVENT,payload:{metadata:{event:"accept-camera",node:this.tagName,tabId:this._activeTab}}}),this._accept();};this._handleClickTab=e=>{let i=e.currentTarget?.getAttribute("data-id");i&&this._handleActiveTab(i);};this._updateTimer=()=>{let e=Math.floor((performance.now()-this._startTime+this._elapsedTime)/1e3);if(typeof this.cfg.maxVideoRecordingDuration=="number"&&this.cfg.maxVideoRecordingDuration>0){let t=this.cfg.maxVideoRecordingDuration-e;if(t<=0){let r=this._timerRef.value;r&&(r.textContent=ye(t)),this._stopRecording();return}let i=this._timerRef.value;i&&(i.textContent=ye(t));}else {let t=this._timerRef.value;t&&(t.textContent=ye(e));}this._animationFrameId=requestAnimationFrame(this._updateTimer);};this._startTimer=()=>{this._startTime=performance.now(),this._elapsedTime=0,this._updateTimer();};this._stopTimer=()=>{this._animationFrameId&&cancelAnimationFrame(this._animationFrameId);};this._startTimeline=()=>{let e=this._videoRef.value;if(!e)return;let t=e.currentTime,i=e.duration||1,r=this._lineRef.value;r&&(r.style.transform=`scaleX(${t/i})`);let o=this._timerRef.value;o&&(o.textContent=ye(t)),this._animationFrameId=requestAnimationFrame(this._startTimeline);};this._stopTimeline=()=>{this._animationFrameId&&cancelAnimationFrame(this._animationFrameId);};this._animationFrameId=null;this._startRecording=()=>{try{this._chunks=[],this._options={...this.cfg.mediaRecorderOptions};let{mimeType:e}=this.cfg.mediaRecorderOptions||{};e&&MediaRecorder.isTypeSupported(e)?this._options.mimeType=e:MediaRecorder.isTypeSupported(Mt)?this._options.mimeType=Mt:this._options.mimeType="video/mp4",this._stream&&(this._mediaRecorder=new MediaRecorder(this._stream,this._options),this._mediaRecorder.start(),this._mediaRecorder.addEventListener("dataavailable",t=>{this._chunks.push(t.data);}),this._startTimer(),this.classList.add("uc-recording"),this._setCameraState(F$1.PLAY));}catch(e){console.error("Failed to start recording",e),this.telemetryManager.sendEventError(e,"camera recording. Failed to start recording");}};this._stopRecording=()=>{this._mediaRecorder?.addEventListener("stop",()=>{this._previewVideo(),this._stopTimer(),this._setCameraState(F$1.STOP);}),this._mediaRecorder?.stop(),this.classList.remove("uc-recording"),this.telemetryManager.sendEvent({eventType:w.ACTION_EVENT,payload:{metadata:{event:"stop-camera",node:this.tagName,tabId:this._activeTab}}});};this._toggleRecording=()=>{if(this._mediaRecorder?.state==="recording")return;let e=this._videoRef.value;e&&(!e.paused&&!e.ended&&e.readyState>2?e.pause():e.paused&&e.play());};this._toggleEnableAudio=()=>{this._stream?.getAudioTracks().forEach(e=>{e.enabled=!e.enabled,this._toggleMicrophoneIcon=e.enabled?"microphone":"microphone-mute",this._audioSelectDisabled=!e.enabled;});};this._previewVideo=()=>{try{let e=new Blob(this._chunks,{type:this._mediaRecorder?.mimeType}),t=URL.createObjectURL(e),i=this._videoRef.value;if(!i)return;i.muted=!1,i.volume=1,this._setVideoSource(null),i.src=t,this._attachPreviewListeners(i);}catch(e){console.error("Failed to preview video",e),this.telemetryManager.sendEventError(e,"camera previewing. Failed to preview video");}};this._retake=()=>{if(this._setCameraState(F$1.RETAKE),this._activeTab===E.VIDEO){this._setVideoSource(this._stream);let e=this._videoRef.value;e&&(e.muted=true);}this._videoRef.value?.play?.();};this._accept=()=>{if(this._setCameraState(F$1.ACCEPT),this._activeTab===E.PHOTO){this._canvas?.toBlob(r=>{if(!r)return;let o=this._createFile("camera","jpeg",Tt,r);this._toSend(o);},Tt);return}let e=new Blob(this._chunks,{type:this._mediaRecorder?.mimeType}),t=this._guessExtensionByMime(this._mediaRecorder?.mimeType),i=this._createFile("video",t,`video/${t}`,e);this._toSend(i),this._chunks=[];};this._handlePhoto=e=>{e===F$1.SHOT&&(this._tabVideoHidden=true,this._cameraHidden=true,this._tabCameraHidden=true,this._cameraActionsHidden=false,this._cameraSelectHidden=true),(e===F$1.RETAKE||e===F$1.ACCEPT)&&(this._tabVideoHidden=!this._cameraModes.includes(E.VIDEO),this._tabCameraHidden=!this._cameraModes.includes(E.PHOTO),this._cameraHidden=false,this._cameraActionsHidden=true,this._cameraSelectHidden=this._cameraDevices.length<=1);};this._handleVideo=e=>{e===F$1.PLAY&&(this._timerHidden=false,this._tabCameraHidden=true,this._cameraSelectHidden=true,this._audioSelectHidden=true,this._currentTimelineIcon="pause",this._currentIcon="square",this._mutableClassButton="uc-shot-btn uc-camera-action uc-stop-record"),e===F$1.STOP&&(this._timerHidden=false,this._cameraHidden=true,this._audioToggleMicrophoneHidden=true,this._cameraActionsHidden=false),(e===F$1.RETAKE||e===F$1.ACCEPT)&&(this._timerHidden=true,this._tabVideoHidden=!this._cameraModes.includes(E.VIDEO),this._tabCameraHidden=!this._cameraModes.includes(E.PHOTO),this._cameraHidden=false,this._cameraActionsHidden=true,this._audioToggleMicrophoneHidden=!this.cfg.enableAudioRecording,this._currentIcon="video-camera-full",this._mutableClassButton="uc-shot-btn uc-camera-action",this._audioSelectHidden=!this.cfg.enableAudioRecording||this._audioDevices.length<=1,this._cameraSelectHidden=this._cameraDevices.length<=1);};this._setCameraState=e=>{this._activeTab===E.PHOTO&&(e==="shot"||e==="retake"||e==="accept")&&this._handlePhoto(e),this._activeTab===E.VIDEO&&(e==="play"||e==="stop"||e==="retake"||e==="accept"||e==="pause"||e==="resume")&&this._handleVideo(e);};this._handleActiveTab=e=>{this._switcherRef.value?.querySelectorAll("button").forEach(i=>{i.classList.toggle("uc-active",i.getAttribute("data-id")===e);}),e===E.PHOTO&&(this._currentIcon="camera-full",this._audioSelectHidden=true,this._audioToggleMicrophoneHidden=true),e===E.VIDEO&&(this._currentTimelineIcon="play",this._currentIcon="video-camera-full",this._audioSelectHidden=!this.cfg.enableAudioRecording||this._audioDevices.length<=1,this._audioToggleMicrophoneHidden=!this.cfg.enableAudioRecording),this.telemetryManager.sendEvent({eventType:w.ACTION_EVENT,payload:{metadata:{event:"camera-tab-switch",node:this.tagName,tabId:e}}}),this._activeTab=e;};this._createFile=(e,t,i,r)=>{let o=Date.now(),l=`${e}-${o}.${t}`;return new File([r],l,{lastModified:o,type:i})};this._toSend=e=>{this.api.addFileFromObject(e,{source:e$1.CAMERA}),this.set$({"*currentActivity":f$2.activities.UPLOAD_LIST}),this.modalManager?.open(f$2.activities.UPLOAD_LIST);};this._setPermissionsState=e(e=>{this.classList.toggle("uc-initialized",e==="granted");let t=this._activeTab===E.VIDEO&&this.cfg.enableAudioRecording,i=this._activeTab===E.PHOTO?"camera-full":"video-camera-full";e==="granted"?(this._videoHidden=false,this._cameraHidden=false,this._tabCameraHidden=!this._cameraModes.includes(E.PHOTO),this._tabVideoHidden=!this._cameraModes.includes(E.VIDEO),this._messageHidden=true,this._timerHidden=true,this._currentIcon=i,this._audioToggleMicrophoneHidden=!t,this._audioSelectHidden=!t):e==="prompt"?(this._l10nMessage="camera-permissions-prompt",this._videoHidden=true,this._cameraHidden=true,this._tabCameraHidden=true,this._messageHidden=false,this._stopCapture()):(this._l10nMessage="camera-permissions-denied",this._videoHidden=true,this._messageHidden=false,this._tabCameraHidden=!this._cameraModes.includes(E.PHOTO),this._tabVideoHidden=!this._cameraModes.includes(E.VIDEO),this._cameraActionsHidden=true,this._mutableClassButton="uc-shot-btn uc-camera-action",this._stopCapture());},300);this._makeStreamInactive=()=>{if(!this._stream)return false;let e=this._stream?.getAudioTracks(),t=this._stream?.getVideoTracks();return e.forEach(i=>{i.stop();}),t.forEach(i=>{i.stop();}),true};this._stopCapture=()=>{this._capturing&&(this._videoRef.value&&(this._videoRef.value.volume=0),this._currentVideoSource?.getTracks?.()?.[0]?.stop(),this._detachPreviewListeners(this._videoRef.value),this._setVideoSource(null),this._makeStreamInactive(),this._stopTimer(),this._capturing=false);};this._capture=async()=>{let e={video:{...Li},audio:this.cfg.enableAudioRecording?{}:false};this._selectedCameraId&&(e.video={deviceId:{exact:this._selectedCameraId}}),this._selectedAudioId&&this.cfg.enableAudioRecording&&(e.audio={deviceId:{exact:this._selectedAudioId}}),this._videoRef.value&&(this._videoRef.value.volume=0);try{this._setPermissionsState("prompt"),this._stream=await navigator.mediaDevices.getUserMedia(e),this._stream.addEventListener("inactive",()=>{this._setPermissionsState("denied");}),this._setVideoSource(this._stream),this._capturing=!0,this._setPermissionsState("granted");}catch(t){this._setPermissionsState("denied"),console.log("Failed to capture camera",t),this.telemetryManager.sendEventError(t,"camera capturing. Failed to capture camera");}};this._handlePermissionsChange=()=>{this._capture();};this._permissionAccess=async()=>{try{this._teardownPermissionListeners();for(let e of Pi){let t=await navigator.permissions.query({name:e});this._permissionResponses[e]=t,t.addEventListener("change",this._handlePermissionsChange),this._permissionCleanupFns.push(()=>{t.removeEventListener("change",this._handlePermissionsChange);});}this._unsubPermissions=()=>{this._teardownPermissionListeners();};}catch(e){this._teardownPermissionListeners(),console.log("Failed to use permissions API. Fallback to manual request mode.",e),this.telemetryManager.sendEventError(e,"camera permissions. Failed to use permissions API"),this._capture();}};this._requestDeviceAccess=async()=>{try{await navigator.mediaDevices.getUserMedia({video:!0,audio:this.cfg.enableAudioRecording}),await this._getDevices(),navigator.mediaDevices.addEventListener("devicechange",this._getDevices);}catch(e){this.telemetryManager.sendEventError(e,"camera devices. Failed to get user media"),console.log("Failed to get user media",e);}};this._getDevices=async()=>{try{let e=await navigator.mediaDevices.enumerateDevices();this._cameraDevices=e.filter(t=>t.kind==="videoinput").map((t,i)=>({text:t.label.trim()||`${this.l10n("caption-camera")} ${i+1}`,value:t.deviceId})),this._audioDevices=this.cfg.enableAudioRecording?e.filter(t=>t.kind==="audioinput").map(t=>({text:t.label.trim(),value:t.deviceId})):[],this._cameraSelectOptions=this._cameraDevices,this._cameraSelectHidden=this._cameraDevices.length<=1,this._selectedCameraId=this._cameraDevices[0]?.value??null,this._audioSelectOptions=this._audioDevices,this._audioSelectHidden=!this.cfg.enableAudioRecording||this._audioDevices.length<=1,this._selectedAudioId=this._audioDevices[0]?.value??null;}catch(e){this.telemetryManager.sendEventError(e,"camera devices. Failed to get devices"),console.log("Failed to get devices",e);}};this._onActivate=async()=>{await this._permissionAccess(),await this._requestDeviceAccess(),await this._capture(),this._handleCameraModes(this._cameraModes);};this._onDeactivate=async()=>{this._unsubPermissions&&this._unsubPermissions(),window.chrome||this._setPermissionsState("denied"),this._stopCapture();};this._handleCameraModes=e=>{this._tabVideoHidden=!e.includes(E.VIDEO),this._tabCameraHidden=!e.includes(E.PHOTO);let t=e[0];t&&(!this._activeTab||!e.includes(this._activeTab))&&this._handleActiveTab(t);};}_attachPreviewListeners(e){this._detachPreviewListeners(e),e.addEventListener("play",this._handlePreviewPlay),e.addEventListener("pause",this._handlePreviewPause);}_detachPreviewListeners(e){e?.removeEventListener("play",this._handlePreviewPlay),e?.removeEventListener("pause",this._handlePreviewPause);}_setVideoSource(e){this._currentVideoSource!==e&&(this._currentVideoSource=e,this._applyVideoSource());}_applyVideoSource(){let e=this._videoRef.value;if(!e)return;let t=this._currentVideoSource??null;e.srcObject!==t&&(e.srcObject=t);}_shot(){if(this._setCameraState("shot"),this._canvas=document.createElement("canvas"),this._ctx=this._canvas.getContext("2d"),!this._ctx)throw new Error("Failed to get canvas context");let e=this._videoRef.value;if(!e)throw new Error("Video element not found");this._canvas.height=e.videoHeight,this._canvas.width=e.videoWidth,this.cfg.cameraMirror&&(this._ctx.translate(this._canvas.width,0),this._ctx.scale(-1,1)),this._ctx.drawImage(e,0,0),e.pause();}_guessExtensionByMime(e){let t={mp4:"mp4",ogg:"ogg",webm:"webm",quicktime:"mov","x-matroska":"mkv"};if(e==="")return "webm";if(e){let i=e.split("/");if(i?.[0]==="video"){let o=i.slice(1).join("/")?.split(";")[0];if(o&&t[o])return t[o]}}return "avi"}get _cameraModes(){return o(this.cfg.cameraModes).filter(e=>e===E.PHOTO||e===E.VIDEO)}_teardownPermissionListeners(){if(this._permissionCleanupFns.length!==0){for(let e of this._permissionCleanupFns)e();this._permissionCleanupFns=[],this._unsubPermissions=null;}}initCallback(){super.initCallback(),this.registerActivity(this.activityType,{onActivate:this._onActivate,onDeactivate:this._onDeactivate}),this.subConfigValue("cameraMirror",e=>{this._videoTransformCss=e?"scaleX(-1)":null;}),this.subConfigValue("enableAudioRecording",e=>{this._audioToggleMicrophoneHidden=!e,this._audioSelectDisabled=!e;}),this.subConfigValue("cameraModes",e=>{if(!this.isActivityActive)return;let t=j$1(e);this._handleCameraModes(t.filter(i=>i===E.PHOTO||i===E.VIDEO));});}firstUpdated(e){super.firstUpdated(e),this._applyVideoSource();}updated(e){super.updated(e),this._applyVideoSource();}_destroy(){this._teardownPermissionListeners(),navigator.mediaDevices?.removeEventListener("devicechange",this._getDevices),this._detachPreviewListeners(this._videoRef.value),this._setVideoSource(null);}disconnectedCallback(){super.disconnectedCallback(),this._destroy();}render(){return html`<uc-activity-header><button type="button" class="uc-mini-btn" @click=${this.$["*historyBack"]} title=${this.l10n("back")} ><uc-icon name="back"></uc-icon></button><div ?hidden=${!this._cameraSelectHidden}><uc-icon name="camera"></uc-icon><span>${this.l10n("caption-camera")}</span></div><uc-select class="uc-camera-select" .options=${this._cameraSelectOptions} ?hidden=${this._cameraSelectHidden} @change=${this._handleCameraSelectChange} ></uc-select><button type="button" class="uc-mini-btn uc-close-btn" @click=${this.$["*closeModal"]} title=${this.l10n("a11y-activity-header-button-close")} aria-label=${this.l10n("a11y-activity-header-button-close")} ><uc-icon name="close"></uc-icon></button></uc-activity-header><div class="uc-content"><video muted autoplay playsinline style=${styleMap({transform:this._videoTransformCss})} ?hidden=${this._videoHidden} ${ref(this._videoRef)} ></video><div class="uc-message-box" ?hidden=${this._messageHidden}><span>${this.l10n(this._l10nMessage)}</span><button type="button" @click=${this._handleRequestPermissions} ?hidden=${this._requestBtnHidden} >${this.l10n("camera-permissions-request")}</button></div></div><div class="uc-controls"><div ${ref(this._switcherRef)} class="uc-switcher" ?hidden=${!this._timerHidden}><button data-id="photo" type="button" class="uc-switch uc-mini-btn" @click=${this._handleClickTab} ?hidden=${this._tabCameraHidden} data-testid="tab-photo" ><uc-icon name="camera"></uc-icon></button><button data-id="video" type="button" class="uc-switch uc-mini-btn" @click=${this._handleClickTab} ?hidden=${this._tabVideoHidden} data-testid="tab-video" ><uc-icon name="video-camera"></uc-icon></button></div><button class="uc-secondary-btn uc-recording-timer" @click=${this._handleToggleRecording} ?hidden=${this._timerHidden} data-testid="recording-timer" ><uc-icon name=${this._currentTimelineIcon}></uc-icon><span ${ref(this._timerRef)}> 00:00 </span><span ${ref(this._lineRef)} class="uc-line"></span></button><div class="uc-camera-actions uc-camera-action" ?hidden=${this._cameraActionsHidden} ><button type="button" class="uc-secondary-btn" @click=${this._handleRetake}> Retake </button><button type="button" class="uc-primary-btn" @click=${this._handleAccept} data-testid="accept" > Accept </button></div><button type="button" data-testid="shot" @click=${this._handleStartCamera} class=${this._mutableClassButton} ?hidden=${this._cameraHidden} ><uc-icon name=${this._currentIcon}></uc-icon></button><div class="uc-select"><button type="button" class="uc-mini-btn uc-btn-microphone" @click=${this._handleToggleAudio} ?hidden=${this._audioToggleMicrophoneHidden} data-testid="toggle-microphone" ><uc-icon name=${this._toggleMicrophoneIcon}></uc-icon></button><uc-select class="uc-audio-select" .options=${this._audioSelectOptions} ?hidden=${this._audioSelectHidden} ?disabled=${this._audioSelectDisabled} @change=${this._handleAudioSelectChange} data-testid="audio-select" ></uc-select></div></div>`}};a([state()],f.prototype,"_videoTransformCss",2),a([state()],f.prototype,"_videoHidden",2),a([state()],f.prototype,"_messageHidden",2),a([state()],f.prototype,"_requestBtnHidden",2),a([state()],f.prototype,"_cameraSelectOptions",2),a([state()],f.prototype,"_cameraSelectHidden",2),a([state()],f.prototype,"_l10nMessage",2),a([state()],f.prototype,"_timerHidden",2),a([state()],f.prototype,"_cameraHidden",2),a([state()],f.prototype,"_cameraActionsHidden",2),a([state()],f.prototype,"_audioSelectOptions",2),a([state()],f.prototype,"_audioSelectHidden",2),a([state()],f.prototype,"_audioSelectDisabled",2),a([state()],f.prototype,"_audioToggleMicrophoneHidden",2),a([state()],f.prototype,"_tabCameraHidden",2),a([state()],f.prototype,"_tabVideoHidden",2),a([state()],f.prototype,"_currentIcon",2),a([state()],f.prototype,"_currentTimelineIcon",2),a([state()],f.prototype,"_toggleMicrophoneIcon",2),a([state()],f.prototype,"_mutableClassButton",2);var At=()=>{let n=globalThis.top??globalThis.parent??globalThis.self;try{return n.location.origin}catch(s){return console.warn("Unable to access top-level window location:",s),globalThis.location.origin}};var $i=n=>n.replace(/[\\-\\[]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),kt=(n,s="i")=>{let e=n.split("*").map($i);return new RegExp(`^${e.join(".+")}$`,s)};var Vi=["--uc-font-family","--uc-font-size","--uc-line-height","--uc-button-size","--uc-preview-size","--uc-input-size","--uc-padding","--uc-radius","--uc-transition","--uc-background","--uc-foreground","--uc-primary","--uc-primary-hover","--uc-primary-transparent","--uc-primary-foreground","--uc-secondary","--uc-secondary-hover","--uc-secondary-foreground","--uc-muted","--uc-muted-foreground","--uc-destructive","--uc-destructive-foreground","--uc-border"],Ui=(n,s)=>window.getComputedStyle(n).getPropertyValue(s).trim(),It=n=>{let s={};for(let e of Vi){let t=Ui(n,e);t&&(s[e]=t);}return s};var Di=["selected-files-change","toolbar-state-change"],Ri=n=>{if(!n||typeof n!="object"||!("type"in n))return false;let s=n.type;return !(typeof s!="string"||!Di.includes(s))},_e=class{constructor(s,e){this._handlerMap=new Map;this._handleMessage=s=>{if(s.source!==this._context)return;let e=s.data;if(!Ri(e))return;let t=this._handlerMap.get(e.type);if(t)for(let i of t)i(e);};this._context=s,this._getTargetOrigin=e,window.addEventListener("message",this._handleMessage);}on(s,e){let t=this._handlerMap.get(s)??new Set;this._handlerMap.has(s)||this._handlerMap.set(s,t),t.add(e);}send(s){let e=this._getTargetOrigin();this._context.postMessage(s,e);}destroy(){window.removeEventListener("message",this._handleMessage);}};function St(n){let s=[];for(let[e,t]of Object.entries(n))t==null||typeof t=="string"&&t.length===0||s.push(`${e}=${encodeURIComponent(t)}`);return s.join("&")}var Fi={[c$1.GDRIVE]:"ngdrive"},L=class extends g{constructor(){super(...arguments);this.couldBeCtxOwner=true;this.activityType=f$2.activities.EXTERNAL;this._iframeRef=createRef();this._latestSelectionSummary=null;this._selectedList=[];this._isSelectionReady=false;this._isDoneBtnEnabled=false;this._couldSelectAll=false;this._couldDeselectAll=false;this._showSelectionStatus=false;this._showDoneBtn=false;this._doneBtnTextClass="uc-hidden";this._toolbarVisible=true;this._handleDone=()=>{for(let e of this._selectedList){let t=this._extractUrlFromSelectedFile(e),{filename:i}=e,{externalSourceType:r}=this.activityParams;this.api.addFileFromUrl(t,{fileName:i,source:r});}this.$["*currentActivity"]=f$2.activities.UPLOAD_LIST,this.modalManager?.open(f$2.activities.UPLOAD_LIST);};this._handleCancel=()=>{this.historyBack();};this._handleSelectAll=()=>{this._messageBridge?.send({type:"select-all"});};this._handleDeselectAll=()=>{this._messageBridge?.send({type:"deselect-all"});};}get _counterText(){if(!this._latestSelectionSummary)return "";let{selectedCount:e,total:t}=this._latestSelectionSummary;return this.l10n("selected-count",{count:e,total:t})}get activityParams(){let e=super.activityParams;if("externalSourceType"in e)return e;throw new Error("External Source activity params not found")}initCallback(){super.initCallback(),this.registerActivity(this.activityType,{onActivate:()=>{let{externalSourceType:e}=this.activityParams;if(!e){this.modalManager?.close(this.$["*currentActivity"]),this.$["*currentActivity"]=null,console.error(`Param "externalSourceType" is required for activity "${this.activityType}"`);return}this._mountIframe();}}),this.sub("*currentActivityParams",()=>{this.isActivityActive&&(this._unmountIframe(),this._mountIframe());}),this.sub("*currentActivity",e=>{e!==this.activityType&&this._unmountIframe();}),this.subConfigValue("multiple",e=>{this._showSelectionStatus=e;}),this.subConfigValue("localeName",()=>{this._setupL10n();}),this.subConfigValue("externalSourcesEmbedCss",e=>{this._applyEmbedCss(e);});}_extractUrlFromSelectedFile(e){if(e.alternatives){let t=o(this.cfg.externalSourcesPreferredTypes);for(let i of t){let r=kt(i);for(let[o,l]of Object.entries(e.alternatives))if(r.test(o))return l}}return e.url}_handleToolbarStateChange(e){this._toolbarVisible=e.isVisible;}async _handleSelectedFilesChange(e){if(this.cfg.multiple!==e.isMultipleMode){console.error("Multiple mode mismatch");return}this._setSelectionSummary(e.selectedCount,e.total),this._doneBtnTextClass=e.isReady?"":"uc-hidden",this._isSelectionReady=e.isReady,this._isDoneBtnEnabled=e.isReady&&e.selectedFiles.length>0,this._showSelectionStatus=e.isMultipleMode&&e.total>0,this._couldSelectAll=e.selectedCount<e.total,this._couldDeselectAll=e.selectedCount===e.total,this._selectedList=e.selectedFiles??[],this._showDoneBtn=e.total>0;}_handleIframeLoad(){this._applyEmbedCss(this.cfg.externalSourcesEmbedCss),this._applyTheme(),this._setupL10n();}_applyTheme(){this._messageBridge?.send({type:"set-theme-definition",theme:It(this)});}_applyEmbedCss(e){this._messageBridge?.send({type:"set-embed-css",css:e});}_setupL10n(){this._messageBridge?.send({type:"set-locale-definition",localeDefinition:this.cfg.localeName});}_remoteUrl(){let{pubkey:e,remoteTabSessionKey:t,socialBaseUrl:i,multiple:r}=this.cfg,{externalSourceType:o}=this.activityParams,l=Fi[o]??o,p={lang:this.l10n("social-source-lang")?.split("-")?.[0]||"en",public_key:e,images_only:"false",session_key:t,wait_for_theme:true,multiple:r.toString(),origin:this.cfg.topLevelOrigin||At(),debug:this.cfg.debug},u=new URL(`/window4/${l}`,i);return u.search=St(p),u.toString()}_setSelectionSummary(e,t){this._latestSelectionSummary={selectedCount:e,total:t};}_mountIframe(){let e=document.createElement("iframe");e.src=this._remoteUrl(),e.marginHeight=0,e.marginWidth=0,e.frameBorder="0",e.allowTransparency=true,e.addEventListener("load",this._handleIframeLoad.bind(this)),e.addEventListener("load",this._handleIframeLoad.bind(this)),this._iframeRef.value&&(this._iframeRef.value.innerHTML="",this._iframeRef.value.appendChild(e)),e.contentWindow&&(this._messageBridge?.destroy(),this._messageBridge=new _e(e.contentWindow,()=>this.cfg.socialBaseUrl),this._messageBridge.on("selected-files-change",this._handleSelectedFilesChange.bind(this)),this._messageBridge.on("toolbar-state-change",this._handleToolbarStateChange.bind(this)),this._resetSelectionStatus());}_unmountIframe(){this._messageBridge?.destroy(),this._messageBridge=void 0,this._iframeRef.value&&(this._iframeRef.value.innerHTML=""),this._resetSelectionStatus();}_resetSelectionStatus(){this._selectedList=[],this._isSelectionReady=false,this._isDoneBtnEnabled=false,this._couldSelectAll=false,this._couldDeselectAll=false,this._showSelectionStatus=false,this._showDoneBtn=false,this._doneBtnTextClass="uc-hidden",this._latestSelectionSummary=null;}disconnectedCallback(){super.disconnectedCallback(),this._unmountIframe();}render(){return html`<uc-activity-header><button type="button" class="uc-mini-btn uc-close-btn" @click=${this.$["*historyBack"]} title=${this.l10n("a11y-activity-header-button-close")} aria-label=${this.l10n("a11y-activity-header-button-close")} ><uc-icon name="close"></uc-icon></button></uc-activity-header><div class="uc-content"><div ${ref(this._iframeRef)} class="uc-iframe-wrapper"></div><div class="uc-toolbar" ?hidden=${!this._toolbarVisible}><button type="button" class="uc-cancel-btn uc-secondary-btn" @click=${this._handleCancel}>${this.l10n("cancel")}</button><div class="uc-selection-status-box" ?hidden=${!this._showSelectionStatus}><span>${this._counterText}</span><button type="button" @click=${this._handleSelectAll} ?hidden=${!this._couldSelectAll}>${this.l10n("select-all")}</button><button type="button" @click=${this._handleDeselectAll} ?hidden=${!this._couldDeselectAll}>${this.l10n("deselect-all")}</button></div><button type="button" class="uc-done-btn uc-primary-btn" @click=${this._handleDone} ?disabled=${!this._isDoneBtnEnabled} ?hidden=${!this._showDoneBtn} ><uc-spinner ?hidden=${this._isSelectionReady}></uc-spinner><span class=${this._doneBtnTextClass}>${this.l10n("done")}</span></button></div></div>`}};a([state()],L.prototype,"_selectedList",2),a([state()],L.prototype,"_isSelectionReady",2),a([state()],L.prototype,"_isDoneBtnEnabled",2),a([state()],L.prototype,"_couldSelectAll",2),a([state()],L.prototype,"_couldDeselectAll",2),a([state()],L.prototype,"_showSelectionStatus",2),a([state()],L.prototype,"_showDoneBtn",2),a([state()],L.prototype,"_doneBtnTextClass",2),a([state()],L.prototype,"_toolbarVisible",2);var ie=class extends g{constructor(){super(...arguments);this.couldBeCtxOwner=true;this.dropzone=true;this._buttonTextKey="upload-file";this._handleClick=()=>{this.api.initFlow();};}static{this.styleAttrs=[...super.styleAttrs,"uc-simple-btn"];}initCallback(){super.initCallback(),this.subConfigValue("multiple",e=>{this._buttonTextKey=e?"upload-files":"upload-file";});}render(){return html`<uc-drop-area .disabled=${!this.dropzone}><button type="button" @click=${this._handleClick}><uc-icon name="upload"></uc-icon><span>${this.l10n(this._buttonTextKey)}</span>${this.yield("")}<div class="uc-visual-drop-area">${this.l10n("drop-files-here")}</div></button></uc-drop-area>`}};a([property({attribute:"dropzone",type:Boolean})],ie.prototype,"dropzone",2),a([state()],ie.prototype,"_buttonTextKey",2);var ae=class extends f$2{constructor(){super(...arguments);this.activityType=null;this._containerRef=createRef();}initCallback(){this.activityType=this.registration?.id??null,super.initCallback(),this._ensureRegistered();}willUpdate(e){super.willUpdate(e),e.has("registration")&&(this._ensureRegistered(),this.isActivityActive&&(this._disposeActivity(),this._renderActivity()));}_ensureRegistered(){this.registration&&(this._isActivityRegistered()||this.registerActivity(this.activityType??"",{onActivate:()=>this._renderActivity(),onDeactivate:()=>this._disposeActivity()}));}_renderActivity(){let e=this._containerRef.value;if(!e||!this.registration)return;this._disposeActivity();let t=this.$["*currentActivityParams"];this._dispose=this.registration.render(e,t)??void 0;}_disposeActivity(){this._dispose?.(),this._dispose=void 0;let e=this._containerRef.value;e&&e.replaceChildren();}disconnectedCallback(){this._disposeActivity(),super.disconnectedCallback();}render(){return html`<div style="display: contents;" ${ref(this._containerRef)}></div>`}};a([property({attribute:false})],ae.prototype,"registration",2);var Y=class extends D{constructor(){super(...arguments);this.mode="modal";this._activities=[];}initCallback(){super.initCallback();let e=this._sharedInstancesBag.pluginManager;e?.onPluginsChange&&(this._unsubscribePlugins=e.onPluginsChange(()=>this._syncActivities())),this._syncActivities();}_syncActivities(){let e=this._sharedInstancesBag.pluginManager;if(!e){this._activities=[];return}this._activities=e.snapshot().activities;}disconnectedCallback(){this._unsubscribePlugins?.(),this._unsubscribePlugins=void 0,super.disconnectedCallback();}render(){return this.mode==="inline"?html`${repeat(this._activities,e=>e.id,e=>html`<uc-plugin-activity-host .registration=${e}></uc-plugin-activity-host>`)}`:html`${repeat(this._activities,e=>e.id,e=>html`<uc-modal id=${e.id} strokes block-body-scrolling><uc-plugin-activity-host .registration=${e}></uc-plugin-activity-host></uc-modal>`)}`}};a([property({type:String})],Y.prototype,"mode",2),a([state()],Y.prototype,"_activities",2);var we=class extends U{constructor(){super();this.headless=false;this.init$={...this.init$,"*solution":this.tagName};}static{this.styleAttrs=[...super.styleAttrs,"uc-file-uploader-regular"];}initCallback(){super.initCallback(),this.telemetryManager.sendEvent({eventType:w.INIT_SOLUTION});}render(){return html` ${super.render()}<uc-simple-btn ?hidden=${this.headless}></uc-simple-btn><uc-modal id="start-from" strokes block-body-scrolling><uc-start-from><uc-drop-area with-icon clickable></uc-drop-area><uc-source-list role="list" wrap></uc-source-list><button type="button" class="uc-secondary-btn" @click=${this.$["*historyBack"]}>${this.l10n("start-from-cancel")}</button><uc-copyright></uc-copyright></uc-start-from></uc-modal><uc-modal id="upload-list" strokes block-body-scrolling><uc-upload-list></uc-upload-list></uc-modal><uc-modal id="camera" strokes block-body-scrolling><uc-camera-source></uc-camera-source></uc-modal><uc-modal id="url" strokes block-body-scrolling><uc-url-source></uc-url-source></uc-modal><uc-modal id="external" strokes block-body-scrolling><uc-external-source></uc-external-source></uc-modal><uc-plugin-activity-renderer mode="modal"></uc-plugin-activity-renderer>`}};a([property({type:Boolean})],we.prototype,"headless",2);var xe=class extends U{constructor(){super();this._couldCancel=false;this._handleCancel=()=>{if(this._couldHistoryBack){let e=this.$["*historyBack"];e?.();return}this._couldShowList&&(this.$["*currentActivity"]=f$2.activities.UPLOAD_LIST);};this.init$={...this.init$,"*solution":this.tagName};}static{this.styleAttrs=[...super.styleAttrs,"uc-file-uploader-inline"];}get _couldHistoryBack(){let e=this.$["*history"];return !e||e.length<=1?false:e[e.length-1]!==f$2.activities.START_FROM}get _couldShowList(){let e=this.$["*uploadList"];return this.cfg.showEmptyList||Array.isArray(e)&&e.length>0}_getInitActivity(){return this.getCssData("--cfg-init-activity")||f$2.activities.START_FROM}initCallback(){super.initCallback(),this.telemetryManager.sendEvent({eventType:w.INIT_SOLUTION});let e=this._getInitActivity();this.sub("*currentActivity",t=>{t||(this.$["*currentActivity"]=e);}),this.sub("*uploadList",t=>{Array.isArray(t)&&t.length>0&&this.$["*currentActivity"]===e&&(this.$["*currentActivity"]=f$2.activities.UPLOAD_LIST);}),this.sub("*history",()=>{this._couldCancel=this._couldHistoryBack||this._couldShowList;});}render(){return html` ${super.render()}<uc-start-from><uc-drop-area with-icon clickable></uc-drop-area><uc-source-list role="list" wrap></uc-source-list><button type="button" class="uc-cancel-btn uc-secondary-btn" @click=${this._handleCancel} ?hidden=${!this._couldCancel} >${this.l10n("start-from-cancel")}</button><uc-copyright></uc-copyright></uc-start-from><uc-upload-list></uc-upload-list><uc-camera-source></uc-camera-source><uc-url-source></uc-url-source><uc-external-source></uc-external-source><uc-plugin-activity-renderer mode="inline"></uc-plugin-activity-renderer>`}};a([state()],xe.prototype,"_couldCancel",2);var Xe="active",Ee="",N=class extends U{constructor(){super();this._singleUpload=false;this._isHiddenStartFrom=false;this._classUploadList=Ee;this._classStartFrom=Ee;this._handleModalOpen=e=>{e.id===f$2.activities.CLOUD_IMG_EDIT&&(this._classUploadList=Xe),this.$["*currentActivity"]===f$2.activities.UPLOAD_LIST&&(this._classUploadList=Xe,this._isHiddenStartFrom=true);let t=this.$["*uploadList"];(!t||t.length<=0)&&(this._classStartFrom=Xe);};this._handleModalClose=e=>{e.id===this.$["*currentActivity"]&&(this.$["*currentActivity"]=f$2.activities.UPLOAD_LIST,this._isHiddenStartFrom=false),e.id===f$2.activities.CLOUD_IMG_EDIT&&(this.$["*currentActivity"]=f$2.activities.UPLOAD_LIST);};this.init$={...this.init$,"*solution":this.tagName};}static{this.styleAttrs=[...super.styleAttrs,"uc-file-uploader-minimal"];}_getInitActivity(){return this.getCssData("--cfg-init-activity")||f$2.activities.START_FROM}initCallback(){super.initCallback(),this.telemetryManager.sendEvent({eventType:w.INIT_SOLUTION});let e=this._getInitActivity();this.sub("*currentActivity",t=>{t===f$2.activities.UPLOAD_LIST&&this.modalManager?.closeAll(),t||(this.$["*currentActivity"]=e);}),this.sub("*uploadList",t=>{Array.isArray(t)&&t.length>0?(this.$["*currentActivity"]=f$2.activities.UPLOAD_LIST,this._classStartFrom=Ee):(this._classUploadList=Ee,this._isHiddenStartFrom=false,this.$["*currentActivity"]=e);}),this.subConfigValue("confirmUpload",t=>{t!==false&&(this.cfg.confirmUpload=false);}),this.subConfigValue("filesViewMode",t=>{this.setAttribute("mode",t),this.subConfigValue("multiple",i=>{t==="grid"?(i?this.style.removeProperty("--uc-grid-col"):this.style.setProperty("--uc-grid-col","1"),this._singleUpload=!i):(this.style.removeProperty("--uc-grid-col"),this._singleUpload=false);});}),this.modalManager?.subscribe(s.OPEN,this._handleModalOpen),this.modalManager?.subscribe(s.CLOSE,this._handleModalClose);}disconnectedCallback(){super.disconnectedCallback(),this.modalManager?.unsubscribe(s.OPEN,this._handleModalOpen),this.modalManager?.unsubscribe(s.CLOSE,this._handleModalClose);}render(){return html` ${super.render()}<uc-start-from ?hidden=${this._isHiddenStartFrom} class=${this._classStartFrom}><uc-drop-area ?single=${this._singleUpload} initflow clickable tabindex="0" ><span>${this.l10n("choose-file")}</span></uc-drop-area><uc-copyright></uc-copyright></uc-start-from><uc-upload-list class=${this._classUploadList}></uc-upload-list><uc-modal id="start-from" strokes block-body-scrolling><uc-start-from><uc-drop-area with-icon clickable></uc-drop-area><uc-source-list role="list" wrap></uc-source-list><button type="button" class="uc-secondary-btn" @click=${this.$["*historyBack"]} >${this.l10n("start-from-cancel")}</button></uc-start-from></uc-modal><uc-modal id="camera" strokes block-body-scrolling><uc-camera-source></uc-camera-source></uc-modal><uc-modal id="url" strokes block-body-scrolling><uc-url-source></uc-url-source></uc-modal><uc-modal id="external" strokes block-body-scrolling><uc-external-source></uc-external-source></uc-modal><uc-plugin-activity-renderer mode="modal"></uc-plugin-activity-renderer>`}};a([state()],N.prototype,"_singleUpload",2),a([state()],N.prototype,"_isHiddenStartFrom",2),a([state()],N.prototype,"_classUploadList",2),a([state()],N.prototype,"_classStartFrom",2);
|
|
8
|
-
export{
|
|
7
|
+
var Ue=class extends h(l()(f(g(e)))){};var Re="UC";function ti(r,o=false){return new Promise((e,t)=>{if(typeof document!="object"){e(null);return}if(typeof window=="object"&&window[Re]){e(window[Re]);return}let i=document.createElement("script");i.async=true,i.src=r,i.onerror=()=>{t();},i.onload=()=>{let a=window[Re];o&&a$2(a),e(a);},document.head.appendChild(i);})}var At="<svg width='0' height='0' style='position:absolute'><symbol viewBox='0 0 24 24' id='uc-icon-about' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.152 14.12v.1h1.523v-.1c.007-.409.053-.752.138-1.028.086-.277.22-.517.405-.72.188-.202.434-.397.735-.586.32-.191.593-.412.82-.66.232-.249.41-.531.533-.847.125-.32.187-.678.187-1.076 0-.579-.137-1.085-.41-1.518a2.717 2.717 0 0 0-1.14-1.018c-.49-.245-1.062-.367-1.715-.367-.597 0-1.142.114-1.636.34-.49.228-.884.564-1.182 1.008-.299.44-.46.98-.485 1.619h1.62c.024-.377.118-.684.282-.922a1.48 1.48 0 0 1 .617-.532c.25-.114.51-.17.784-.17.301 0 .575.063.82.191.248.124.447.302.597.533.149.23.223.504.223.82 0 .263-.05.502-.149.72a1.91 1.91 0 0 1-.405.574 3.48 3.48 0 0 1-.575.453 4.22 4.22 0 0 0-.847.66c-.234.242-.415.558-.543.949-.125.39-.19.916-.197 1.577Zm.053 3.03c.21.206.46.31.75.31.196 0 .374-.049.534-.144a1.1 1.1 0 0 0 .383-.384c.1-.163.15-.343.15-.538a1 1 0 0 0-.32-.746 1.019 1.019 0 0 0-.746-.314c-.291 0-.542.105-.751.314-.21.206-.314.455-.314.746 0 .295.104.547.314.756ZM24 12c0 6.627-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0s12 5.373 12 12Zm-1.5 0c0 5.799-4.701 10.5-10.5 10.5S1.5 17.799 1.5 12 6.201 1.5 12 1.5 22.5 6.201 22.5 12Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-add' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12.75 21a.75.75 0 0 1-1.5 0v-8.25H3a.75.75 0 0 1 0-1.5h8.25V3a.75.75 0 0 1 1.5 0v8.25H21a.75.75 0 0 1 0 1.5h-8.25V21Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-arrow-down' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.5 23.03a.75.75 0 0 0 .999 0l9.29-8.276a.75.75 0 0 0-.998-1.12l-8.042 7.164V1.53a.75.75 0 0 0-1.5 0v19.267l-8.04-7.163a.75.75 0 0 0-.998 1.12z'/></symbol><symbol fill='none' viewBox='0 0 9 6' id='uc-icon-arrow-dropdown' xmlns='http://www.w3.org/2000/svg'><path stroke='currentColor' d='m1.5 1.667 3 2.666 3-2.666' opacity='.5'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-aspect-ratio' xmlns='http://www.w3.org/2000/svg'><path stroke='currentColor' d='M7.395 22.5H2.454v-5.25m14.824 5.25h4.94v-5.25m0-10.5V1.5h-4.94m-9.883 0H2.454v5.25'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-back' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M20.251 12a.75.75 0 0 1-.75.75H6.067l5.72 5.85a.75.75 0 1 1-1.072 1.05L4.136 12.92a1.292 1.292 0 0 1 0-1.842l6.579-6.728a.75.75 0 1 1 1.072 1.048l-5.72 5.851H19.5a.75.75 0 0 1 .75.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-badge-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13.6 18.4a1.6 1.6 0 1 1-3.2 0 1.6 1.6 0 0 1 3.2 0zM12 4.5A1.5 1.5 0 0 1 13.5 6v7a1.5 1.5 0 0 1-3 0V6A1.5 1.5 0 0 1 12 4.5z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-badge-success' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m10.5 18.204 7.6-8.183a1.5 1.5 0 0 0-2.2-2.042l-5.4 5.817-2.4-2.586a1.5 1.5 0 1 0-2.2 2.041l4.6 4.953Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-box' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M1.01 4.148a.75.75 0 0 1 .75.75v4.348a4.437 4.437 0 0 1 2.988-1.153c1.734 0 3.23.992 3.978 2.438a4.478 4.478 0 0 1 3.978-2.438c2.49 0 4.488 2.044 4.488 4.543 0 2.5-1.999 4.544-4.488 4.544a4.478 4.478 0 0 1-3.978-2.438 4.478 4.478 0 0 1-3.978 2.438C2.26 17.18.26 15.135.26 12.636V4.898a.75.75 0 0 1 .75-.75Zm.75 8.488c0 1.692 1.348 3.044 2.988 3.044s2.989-1.352 2.989-3.044c0-1.691-1.349-3.043-2.989-3.043S1.76 10.945 1.76 12.636Zm10.944-3.043c-1.64 0-2.988 1.352-2.988 3.043 0 1.692 1.348 3.044 2.988 3.044s2.988-1.352 2.988-3.044c0-1.69-1.348-3.043-2.988-3.043Zm4.328-1.23a.75.75 0 0 1 1.052.128l2.333 2.983 2.333-2.983a.75.75 0 0 1 1.181.924l-2.562 3.277 2.562 3.276a.75.75 0 1 1-1.181.924l-2.333-2.983-2.333 2.983a.75.75 0 1 1-1.181-.924l2.562-3.276-2.562-3.277a.75.75 0 0 1 .129-1.052Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.65 2.55a.75.75 0 0 1 .6-.3h7.5a.75.75 0 0 1 .6.3l2.025 2.7H21a3 3 0 0 1 3 3v10.5a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V8.25a3 3 0 0 1 3-3h2.625zm.975 1.2L6.6 6.45a.75.75 0 0 1-.6.3H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V8.25a1.5 1.5 0 0 0-1.5-1.5h-3a.75.75 0 0 1-.6-.3l-2.025-2.7zm3.375 6a3.375 3.375 0 1 0 0 6.75 3.375 3.375 0 0 0 0-6.75zm-4.875 3.375a4.875 4.875 0 1 1 9.75 0 4.875 4.875 0 0 1-9.75 0z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-camera-full' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M2 4.667a2 2 0 0 0-2 2V16a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6.667a2 2 0 0 0-2-2h-2.667l-2-2.667H6.667l-2 2.667H2Zm8 10a3.667 3.667 0 1 0 0-7.334 3.667 3.667 0 0 0 0 7.334Z' fill='currentColor'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-close' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M4.604 4.604a.75.75 0 0 1 1.06 0L12 10.939l6.335-6.335a.75.75 0 1 1 1.061 1.06L13.061 12l6.335 6.335a.75.75 0 1 1-1.06 1.061L12 13.061l-6.335 6.335a.75.75 0 0 1-1.061-1.06L10.939 12 4.604 5.665a.75.75 0 0 1 0-1.061z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-collapse' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M3.116 12a.75.75 0 0 1 .75-.75h16.268a.75.75 0 0 1 0 1.5H3.866a.75.75 0 0 1-.75-.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-default' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.501.392a.75.75 0 0 1 .998 0l6.704 5.972a.75.75 0 0 1-.998 1.12l-5.455-4.86v13.439a.75.75 0 0 1-1.5 0V2.625l-5.454 4.86a.75.75 0 1 1-.998-1.12zM.857 16.73a.75.75 0 0 1 .75.75v4.914h20.786v-4.914a.75.75 0 0 1 1.5 0v5.664a.75.75 0 0 1-.75.75H.857a.75.75 0 0 1-.75-.75v-5.664a.75.75 0 0 1 .75-.75z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-dropbox' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.019 1.92a.75.75 0 0 1 .806 0L12 5.219l5.176-3.297a.75.75 0 0 1 .806 0l5.577 3.553a.75.75 0 0 1 0 1.265l-4.574 2.914 4.574 2.914a.75.75 0 0 1 0 1.265l-5.577 3.554a.75.75 0 0 1-.806 0L12 14.089l-5.175 3.297a.75.75 0 0 1-.806 0L.44 13.833a.75.75 0 0 1 0-1.266l4.575-2.914L.44 6.74a.75.75 0 0 1 0-1.265zm.403 8.616L2.24 13.2l4.182 2.664 4.181-2.664zm6.975 2.664 4.182 2.664L21.76 13.2l-4.181-2.664zm2.776-3.547L12 12.311 7.828 9.653 12 6.995zm1.406-.882 4.181-2.664-4.181-2.664-4.182 2.664zm-6.976-2.664L6.422 3.443 2.24 6.107 6.422 8.77zM5.791 18.544a.75.75 0 0 1 1.035-.23l5.175 3.297 5.175-3.297a.75.75 0 1 1 .806 1.265l-5.578 3.554a.75.75 0 0 1-.806 0L6.02 19.579a.75.75 0 0 1-.23-1.035z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-edit-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M18.558 2.804a.78.78 0 0 0-.557.235l-.008.007-2.472 2.46 3.847 3.848 2.46-2.473.004-.003a.78.78 0 0 0 0-1.108l-.004-.003-2.712-2.728a.78.78 0 0 0-.558-.235Zm-.248 7.613-3.852-3.852-8.93 8.887-1.516 5.41 5.41-1.515 8.888-8.93Zm-.636-8.934a2.28 2.28 0 0 1 2.512.505l2.702 2.717.002.002a2.278 2.278 0 0 1 0 3.234l-.002.002-12.541 12.602a.75.75 0 0 1-.33.193l-6.884 1.928a.75.75 0 0 1-.925-.924l1.928-6.885a.75.75 0 0 1 .193-.33l12.603-12.54a2.28 2.28 0 0 1 .742-.504Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-evernote' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M9.804 2.27v-.048c.055-.263.313-.562.85-.562h.44c.142 0 .325.014.526.033.066.009.124.023.267.06l.13.032h.002c.319.079.515.275.644.482a1.461 1.461 0 0 1 .16.356l.004.012a.75.75 0 0 0 .603.577l1.191.207a1988.512 1988.512 0 0 0 2.332.402c.512.083 1.1.178 1.665.442.64.3 1.19.795 1.376 1.77.548 2.931.657 5.829.621 8a39.233 39.233 0 0 1-.125 2.602 17.518 17.518 0 0 1-.092.849.735.735 0 0 0-.024.112c-.378 2.705-1.269 3.796-2.04 4.27-.746.457-1.53.451-2.217.447h-.192c-.46 0-1.073-.23-1.581-.635-.518-.412-.763-.87-.763-1.217 0-.45.188-.688.355-.786.161-.095.436-.137.796.087a.75.75 0 1 0 .792-1.274c-.766-.476-1.64-.52-2.345-.108-.7.409-1.098 1.188-1.098 2.08 0 .996.634 1.84 1.329 2.392.704.56 1.638.96 2.515.96l.185.002c.667.009 1.874.025 3.007-.67 1.283-.786 2.314-2.358 2.733-5.276a4.213 4.213 0 0 0 .056-.335c.023-.184.051-.445.079-.772.055-.655.111-1.585.13-2.704.037-2.234-.074-5.239-.647-8.301v-.002c-.294-1.544-1.233-2.391-2.215-2.85-.777-.363-1.623-.496-2.129-.576a8.872 8.872 0 0 1-.25-.041l-.006-.001-1.99-.345-.761-.132a2.93 2.93 0 0 0-.182-.338A2.532 2.532 0 0 0 12.379.329l-.091-.023a3.967 3.967 0 0 0-.493-.103L11.769.2a7.846 7.846 0 0 0-.675-.04h-.44c-.733 0-1.368.284-1.795.742L2.416 7.431c-.468.428-.751 1.071-.751 1.81 0 .02 0 .041.003.062l.003.034c.017.21.038.468.096.796.107.715.275 1.47.391 1.994.029.13.055.245.075.342l.002.008c.258 1.141.641 1.94.978 2.466.168.263.323.456.444.589a2.808 2.808 0 0 0 .192.194c1.536 1.562 3.713 2.196 5.731 2.08.13-.005.35-.032.537-.073a2.627 2.627 0 0 0 .652-.24c.425-.26.75-.661.992-1.046.184-.294.342-.61.473-.915a3.8 3.8 0 0 0 .627.493 5.022 5.022 0 0 0 1.97.709l.023.002.018.003.11.016c.088.014.205.035.325.058l.056.014c.088.022.164.04.235.061a1.736 1.736 0 0 1 .145.048l.03.014c.765.34 1.302 1.09 1.302 1.871a.75.75 0 0 0 1.5 0c0-1.456-.964-2.69-2.18-3.235a3.595 3.595 0 0 0-.679-.217l-.063-.015a10.616 10.616 0 0 0-.606-.105l-.02-.003-.03-.003h-.002a3.542 3.542 0 0 1-1.331-.485c-.471-.298-.788-.692-.828-1.234a.75.75 0 0 0-1.48-.106l-.001.003-.004.017a8.23 8.23 0 0 1-.092.352 9.963 9.963 0 0 1-.298.892c-.132.34-.29.68-.47.966-.174.276-.339.454-.478.549a1.178 1.178 0 0 1-.221.072 1.949 1.949 0 0 1-.241.036h-.013l-.032.002c-1.684.1-3.423-.437-4.604-1.65a.746.746 0 0 0-.053-.05L4.84 14.6a1.348 1.348 0 0 1-.07-.073 2.99 2.99 0 0 1-.293-.392c-.242-.379-.558-1.014-.778-1.985a54.1 54.1 0 0 0-.083-.376 27.494 27.494 0 0 1-.367-1.872l-.003-.02a6.791 6.791 0 0 1-.08-.67c.004-.277.086-.475.2-.609l.067-.067a.63.63 0 0 1 .292-.145h.05c.18 0 1.095.055 2.013.115l1.207.08.534.037a.747.747 0 0 0 .052.002c.782 0 1.349-.206 1.759-.585l.005-.005c.553-.52.622-1.225.622-1.76V6.24l-.026-.565A774.97 774.97 0 0 1 9.885 4.4c-.042-.961-.081-1.939-.081-2.13ZM4.995 6.953a251.126 251.126 0 0 1 2.102.137l.508.035c.48-.004.646-.122.715-.185.07-.068.146-.209.147-.649l-.024-.548a791.69 791.69 0 0 1-.095-2.187L4.995 6.953Zm16.122 9.996Zm-5.479-5.323a.75.75 0 0 0 1.014.31 2.04 2.04 0 0 1 .304-.089 1.84 1.84 0 0 1 .544-.039c.215.023.321.06.37.085.033.016.039.026.047.04a.75.75 0 0 0 1.289-.767c-.337-.567-.906-.783-1.552-.85a3.334 3.334 0 0 0-1.002.062c-.27.056-.531.14-.705.234a.75.75 0 0 0-.31 1.014Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-expand' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m12 8.337-8.47 8.47a.75.75 0 0 1-1.06-1.06l8.605-8.606a1.29 1.29 0 0 1 1.85 0l8.605 8.605a.75.75 0 1 1-1.06 1.06L12 8.338Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-external-source-placeholder' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.341 3.27a10.5 10.5 0 0 1 5.834-1.77.75.75 0 0 0 0-1.5 12 12 0 1 0 12 12 .75.75 0 0 0-1.5 0A10.5 10.5 0 1 1 6.34 3.27Zm14.145 1.48a.75.75 0 1 0-1.06-1.062L9.925 13.19V7.95a.75.75 0 1 0-1.5 0V15c0 .414.336.75.75.75h7.05a.75.75 0 0 0 0-1.5h-5.24l9.501-9.5Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-facebook' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12 1.5C6.201 1.5 1.5 6.201 1.5 12c0 4.943 3.416 9.089 8.016 10.204v-6.108H7.383a.75.75 0 0 1-.75-.75v-3.281a.75.75 0 0 1 .75-.75h2.133V9.393c0-.958.225-2.511 1.38-3.65 1.194-1.177 3.174-1.718 6.254-1.056a.75.75 0 0 1 .592.733v2.754a.75.75 0 0 1-.75.75c-.692 0-1.203.026-1.584.082-.387.057-.578.137-.675.202-.109.073-.237.205-.237 1.029v1.078h2.39a.75.75 0 0 1 .742.866l-.516 3.281a.75.75 0 0 1-.74.634h-1.876v6.106C19.09 21.082 22.5 16.939 22.5 12c0-5.799-4.701-10.5-10.5-10.5zM0 12C0 5.373 5.373 0 12 0s12 5.373 12 12c0 5.995-4.395 10.961-10.138 11.856a.75.75 0 0 1-.866-.74v-7.77a.75.75 0 0 1 .75-.75h1.984l.28-1.781h-2.264a.75.75 0 0 1-.75-.75v-1.828c0-.829.089-1.729.9-2.274.363-.244.807-.37 1.293-.441a9.623 9.623 0 0 1 1.053-.086V6.04c-2.41-.405-3.645.132-4.293.771-.737.728-.933 1.793-.933 2.582v2.672a.75.75 0 0 1-.75.75H8.133v1.78h2.133a.75.75 0 0 1 .75.75v7.772a.75.75 0 0 1-.865.741C4.4 22.968 0 18 0 12z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M2.895 1.201c0-.473.383-.857.857-.857h8.4c.227 0 .445.09.606.251l8.4 8.4c.16.16.25.379.25.606v13.2a.857.857 0 0 1-.856.857h-16.8a.857.857 0 0 1-.857-.857zm1.714.857v19.886h15.085V10.458h-7.542a.857.857 0 0 1-.858-.857V2.058zm8.4 1.213 5.473 5.473H13.01z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-flickr' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M5.959 7.926c-2.298 0-4.14 1.834-4.14 4.073 0 2.241 1.842 4.075 4.14 4.075 2.302 0 4.145-1.834 4.145-4.075 0-2.238-1.843-4.073-4.145-4.073Zm-5.64 4.073c0-3.086 2.533-5.573 5.64-5.573 3.11 0 5.645 2.486 5.645 5.573 0 3.089-2.535 5.575-5.645 5.575-3.107 0-5.64-2.487-5.64-5.575Zm18.07-4.073c-2.301 0-4.144 1.835-4.144 4.073 0 2.24 1.843 4.075 4.145 4.075 2.299 0 4.141-1.834 4.141-4.075 0-2.239-1.842-4.073-4.141-4.073Zm-5.644 4.073c0-3.087 2.535-5.573 5.645-5.573 3.108 0 5.641 2.487 5.641 5.573 0 3.088-2.533 5.575-5.641 5.575-3.11 0-5.645-2.486-5.645-5.575Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-gdrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.736 1.818a.75.75 0 0 1 .647-.37h7.587a.75.75 0 0 1 .655.383l7.233 12.946a.75.75 0 0 1-.003.737l-3.794 6.66a.75.75 0 0 1-.651.378H4.59a.75.75 0 0 1-.651-.378l-3.794-6.66a.75.75 0 0 1 .005-.75zm.64 1.876L1.663 15.148l2.93 5.145 6.655-11.581zm3.736 6.526-2.398 4.173H14.5zm4.116 4.173h5.697L15.53 2.947H9.677zm5.685 1.5H8.852l-2.966 5.16h13.088z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-gphotos' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12.51 0c-.702 0-1.272.57-1.272 1.273V7.35A6.381 6.381 0 0 0 0 11.489c0 .703.57 1.273 1.273 1.273H7.35A6.381 6.381 0 0 0 11.488 24c.704 0 1.274-.57 1.274-1.273V16.65A6.381 6.381 0 0 0 24 12.51c0-.703-.57-1.273-1.273-1.273H16.65A6.381 6.381 0 0 0 12.511 0Zm.252 11.232V1.53a4.857 4.857 0 0 1 0 9.702Zm-1.53.006H1.53a4.857 4.857 0 0 1 9.702 0Zm1.536 1.524a4.857 4.857 0 0 0 9.702 0h-9.702Zm-6.136 4.857c0-2.598 2.04-4.72 4.606-4.85v9.7a4.857 4.857 0 0 1-4.606-4.85Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-huddle' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.204 2.002c-.252.23-.357.486-.357.67V21.07c0 .15.084.505.313.812.208.28.499.477.929.477.519 0 .796-.174.956-.365.178-.212.286-.535.286-.924v-.013l.117-6.58c.004-1.725 1.419-3.883 3.867-3.883 1.33 0 2.332.581 2.987 1.364.637.762.95 1.717.95 2.526v6.47c0 .392.11.751.305.995.175.22.468.41 1.008.41.52 0 .816-.198 1.002-.437.207-.266.31-.633.31-.969V14.04c0-2.81-1.943-5.108-4.136-5.422a5.971 5.971 0 0 0-3.183.41c-.912.393-1.538.96-1.81 1.489a.75.75 0 0 1-1.417-.344v-7.5c0-.587-.47-1.031-1.242-1.031-.315 0-.638.136-.885.36ZM5.194.892A2.844 2.844 0 0 1 7.09.142c1.328 0 2.742.867 2.742 2.53v5.607a6.358 6.358 0 0 1 1.133-.629 7.47 7.47 0 0 1 3.989-.516c3.056.436 5.425 3.482 5.425 6.906v6.914c0 .602-.177 1.313-.627 1.89-.47.605-1.204 1.016-2.186 1.016-.96 0-1.698-.37-2.179-.973-.46-.575-.633-1.294-.633-1.933v-6.469c0-.456-.19-1.071-.602-1.563-.394-.471-.986-.827-1.836-.827-1.447 0-2.367 1.304-2.367 2.39v.014l-.117 6.58c-.001.64-.177 1.333-.637 1.881-.48.57-1.2.9-2.105.9-.995 0-1.7-.5-2.132-1.081-.41-.552-.61-1.217-.61-1.708V2.672c0-.707.366-1.341.847-1.78Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-info' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11 9h2V7h-2m1 13c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m-1 15h2v-6h-2v6Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-local' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M3 3.75a1.5 1.5 0 0 0-1.5 1.5v13.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V9A1.5 1.5 0 0 0 21 7.5h-9a.75.75 0 0 1-.643-.364L9.325 3.75zm-3 1.5a3 3 0 0 1 3-3h6.75a.75.75 0 0 1 .643.364L12.425 6H21a3 3 0 0 1 3 3v9.75a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-microphone' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M7.5 4.781a4.5 4.5 0 0 1 9 0v6.469a4.5 4.5 0 1 1-9 0V4.781Zm4.5-3a3 3 0 0 0-3 3v6.469a3 3 0 1 0 6 0V4.781a3 3 0 0 0-3-3Zm-8.156 8.11a.75.75 0 0 1 .75.75 7.406 7.406 0 1 0 14.812 0 .75.75 0 0 1 1.5 0 8.907 8.907 0 0 1-8.156 8.875v2.703h3.258a.75.75 0 1 1 0 1.5H7.992a.75.75 0 0 1 0-1.5h3.258v-2.703a8.907 8.907 0 0 1-8.156-8.875.75.75 0 0 1 .75-.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-microphone-mute' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M7.5 4.781a4.5 4.5 0 0 1 9 0V6l3.524-3.524a.75.75 0 1 1 1.061 1.06L5.036 19.585a.75.75 0 0 1-1.06-1.06l1.656-1.657a8.88 8.88 0 0 1-2.538-6.227.75.75 0 0 1 1.5 0c0 2.009.8 3.83 2.1 5.166l1.771-1.772A4.483 4.483 0 0 1 7.5 11.25V4.781Zm2.037 8.182L15 7.5V4.781a3 3 0 1 0-6 0v6.469c0 .637.198 1.227.537 1.713Zm10.62-3.072a.75.75 0 0 1 .75.75 8.907 8.907 0 0 1-8.157 8.875v2.703h3.258a.75.75 0 1 1 0 1.5H7.992a.75.75 0 0 1 0-1.5h3.258v-2.703a8.855 8.855 0 0 1-3.035-.811.75.75 0 1 1 .638-1.358 7.406 7.406 0 0 0 10.553-6.707.75.75 0 0 1 .75-.75ZM15 10.81a.75.75 0 0 1 1.5 0v.439a4.5 4.5 0 0 1-5 4.473.75.75 0 1 1 .166-1.491A3 3 0 0 0 15 11.25v-.44Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-mobile-photo-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.65 2.55a.75.75 0 0 1 .6-.3h7.5a.75.75 0 0 1 .6.3l2.025 2.7H21a3 3 0 0 1 3 3v10.5a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V8.25a3 3 0 0 1 3-3h2.625zm.975 1.2L6.6 6.45a.75.75 0 0 1-.6.3H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V8.25a1.5 1.5 0 0 0-1.5-1.5h-3a.75.75 0 0 1-.6-.3l-2.025-2.7zm3.375 6a3.375 3.375 0 1 0 0 6.75 3.375 3.375 0 0 0 0-6.75zm-4.875 3.375a4.875 4.875 0 1 1 9.75 0 4.875 4.875 0 0 1-9.75 0z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-mobile-video-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M0 6.75a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v1.078L22.873 5A.75.75 0 0 1 24 5.648v12.704a.75.75 0 0 1-1.123.65L18 16.207v1.043a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V6.75Zm18 7.728 4.5 2.58V6.95L18 9.562v4.916ZM16.5 6.75a1.5 1.5 0 0 0-1.5-1.5H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h12a1.5 1.5 0 0 0 1.5-1.5V6.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-ngdrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.736 1.818a.75.75 0 0 1 .647-.37h7.587a.75.75 0 0 1 .655.383l7.233 12.946a.75.75 0 0 1-.003.737l-3.794 6.66a.75.75 0 0 1-.651.378H4.59a.75.75 0 0 1-.651-.378l-3.794-6.66a.75.75 0 0 1 .005-.75zm.64 1.876L1.663 15.148l2.93 5.145 6.655-11.581zm3.736 6.526-2.398 4.173H14.5zm4.116 4.173h5.697L15.53 2.947H9.677zm5.685 1.5H8.852l-2.966 5.16h13.088z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-onedrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13.616 4.147a7.689 7.689 0 0 0-7.642 3.285A6.299 6.299 0 0 0 1.455 17.3c.684.894 2.473 2.658 5.17 2.658h12.141c.95 0 1.882-.256 2.697-.743.815-.486 1.514-1.247 1.964-2.083a5.26 5.26 0 0 0-3.713-7.612 7.69 7.69 0 0 0-6.098-5.373ZM3.34 17.15c.674.63 1.761 1.308 3.284 1.308h12.142a3.76 3.76 0 0 0 2.915-1.383l-7.494-4.489L3.34 17.15Zm10.875-6.25 2.47-1.038a5.239 5.239 0 0 1 1.427-.389 6.19 6.19 0 0 0-10.3-1.952 6.338 6.338 0 0 1 2.118.813l4.285 2.567Zm4.55.033c-.512 0-1.019.104-1.489.307l-.006.003-1.414.594 6.521 3.906a3.76 3.76 0 0 0-3.357-4.8l-.254-.01ZM4.097 9.617A4.799 4.799 0 0 1 6.558 8.9c.9 0 1.84.25 2.587.713l3.4 2.037-10.17 4.28a4.799 4.799 0 0 1 1.721-6.312Z'/></symbol><symbol fill='none' viewBox='0 0 10 10' id='uc-icon-pause' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' d='M1 0h2.5v10H1zM6.5 0H9v10H6.5z'/></symbol><symbol fill='none' viewBox='0 0 10 10' id='uc-icon-play' xmlns='http://www.w3.org/2000/svg'><path d='m1 0 9 5-9 5V0Z' fill='currentColor'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-remove-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.955 3.3A2.969 2.969 0 0 0 8.998 6h5.914a2.97 2.97 0 0 0-2.957-2.7zM16.416 6a4.47 4.47 0 0 0-8.922 0h-2.32a.755.755 0 0 0-.111.008H3.075a.75.75 0 1 0 0 1.5h1.35V19.35a2.85 2.85 0 0 0 2.85 2.85h9.45a2.85 2.85 0 0 0 2.85-2.85V7.508h1.35a.75.75 0 0 0 0-1.5h-1.989A.754.754 0 0 0 18.825 6zM5.925 7.508V19.35a1.35 1.35 0 0 0 1.35 1.35h9.45a1.35 1.35 0 0 0 1.35-1.35V7.508z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-select' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m7 10 5 5 5-5H7Z'/></symbol><symbol fill='none' viewBox='0 0 20 20' id='uc-icon-square' xmlns='http://www.w3.org/2000/svg'><rect width='20' height='20' rx='4' fill='#fff'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-upload' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.501.392a.75.75 0 0 1 .998 0l6.704 5.972a.75.75 0 0 1-.998 1.12l-5.455-4.86v13.439a.75.75 0 0 1-1.5 0V2.625l-5.454 4.86a.75.75 0 1 1-.998-1.12zM.857 16.73a.75.75 0 0 1 .75.75v4.914h20.786v-4.914a.75.75 0 0 1 1.5 0v5.664a.75.75 0 0 1-.75.75H.857a.75.75 0 0 1-.75-.75v-5.664a.75.75 0 0 1 .75-.75z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-upload-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-url' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M19.11 3.67c-1.71-1.709-4.578-1.682-6.408.148l-2.22 2.22a.75.75 0 0 1-1.062-1.06l2.222-2.221C14.018.381 17.836.276 20.17 2.61l1.22 1.22c2.335 2.334 2.23 6.153-.147 8.529l-2.22 2.22a.75.75 0 0 1-1.062-1.06l2.222-2.221c1.83-1.83 1.856-4.698.147-6.408zm-3.36 4.58a.75.75 0 0 1 0 1.06l-6.439 6.44a.75.75 0 0 1-1.06-1.06l6.439-6.44a.75.75 0 0 1 1.06 0zM6.04 9.42a.75.75 0 0 1 0 1.061l-2.222 2.222c-1.83 1.83-1.856 4.698-.147 6.407l1.22 1.22c1.71 1.71 4.578 1.683 6.408-.147l2.221-2.221a.75.75 0 1 1 1.06 1.06l-2.22 2.222c-2.377 2.376-6.195 2.481-8.53.147l-1.22-1.22c-2.334-2.334-2.228-6.153.148-8.53l2.221-2.22a.75.75 0 0 1 1.06 0z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-video-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M0 6.75a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v1.078L22.873 5A.75.75 0 0 1 24 5.648v12.704a.75.75 0 0 1-1.123.65L18 16.207v1.043a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V6.75Zm18 7.728 4.5 2.58V6.95L18 9.562v4.916ZM16.5 6.75a1.5 1.5 0 0 0-1.5-1.5H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h12a1.5 1.5 0 0 0 1.5-1.5V6.75Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-video-camera-full' xmlns='http://www.w3.org/2000/svg'><path d='M2 3.333a2 2 0 0 0-2 2v9.334a2 2 0 0 0 2 2h10.938a2 2 0 0 0 2-2v-2.013L20 15.646V4.354l-5.063 3.03v-2.05a2 2 0 0 0-2-2H2Z' fill='currentColor'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-vk' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.341 3.27a10.5 10.5 0 0 1 5.834-1.77.75.75 0 0 0 0-1.5 12 12 0 1 0 12 12 .75.75 0 0 0-1.5 0A10.5 10.5 0 1 1 6.34 3.27Zm14.145 1.48a.75.75 0 1 0-1.06-1.062L9.925 13.19V7.95a.75.75 0 1 0-1.5 0V15c0 .414.336.75.75.75h7.05a.75.75 0 0 0 0-1.5h-5.24l9.501-9.5Z'/></symbol></svg>";var B=class extends R$1{constructor(){super(...arguments);this.init$=J$1(this);}static{this.styleAttrs=["uc-wgt-common"];}initCallback(){super.initCallback(),this.a11y?.registerBlock(this);}render(){return b`${V(At)}`}};var Et=r=>[...new Set(r)];var Z="--uc-img-",De="unresolved";var Oe=!window.location.host.trim()||window.location.host.includes(":")||window.location.hostname.includes("localhost"),He=3e3,Be=5e3,Fe=Object.freeze({PREVIEW:"PREVIEW",MAIN:"MAIN"});var ii="https://ucarecdn.com",Q=Object.freeze({"dev-mode":{},pubkey:{},uuid:{},src:{},lazy:{default:1},intersection:{},breakpoints:{},"cdn-cname":{default:ii},"proxy-cname":{},"secure-delivery-proxy":{},"hi-res-support":{default:1},"ultra-res-support":{},format:{},"cdn-operations":{},progressive:{},quality:{},"is-background-for":{},"is-preview-blur":{default:1}});var be=class extends f(h(e)){constructor(){super();this._state={};this._subscribers=new Map;this._isnObserver=null;this._observed=null;for(let e in Q){let t=Q[e];this._state[Z+e]=t?.default||"";}}createRenderRoot(){return this}$$(e){return this._state[Z+e]}set$$(e){for(let t in e){let i=Z+t,a=e[t];this._state[i]=a,this._notify(i,a);}}sub$$(e,t){let i=Z+e;this._subscribers.has(i)||this._subscribers.set(i,new Set),this._subscribers.get(i)?.add(t);let a=this._state[i];a!==null&&a!==""&&t(a);}_notify(e,t){this._subscribers.has(e)&&this._subscribers.get(e)?.forEach(i=>{t===null||t===""||i(t);});}analyticsParams(){return `-/@clib/${M}/${N}/uc-img/`}initAttributes(e){Array.from(this.attributes).forEach(t=>{let i=t;Q[i.name]||e.setAttribute(i.name,i.value);});}initIntersection(e,t){let i={root:null,rootMargin:"0px"};this._isnObserver=new IntersectionObserver(a=>{a.forEach(s=>{s.isIntersecting&&(t(),this._isnObserver?.unobserve(e));});},i),this._isnObserver.observe(e),this._observed||(this._observed=new Set),this._observed.add(e);}connectedCallback(){super.connectedCallback(),this._initCssProperties();}_initCssProperties(){for(let e in Q){let t=Z+e,i=this.getCssData(t,true);i!=null&&(this._state[t]=i);}}disconnectedCallback(){super.disconnectedCallback(),this._isnObserver&&(this._observed?.forEach(e=>{this._isnObserver?.unobserve(e);}),this._isnObserver=null),this._subscribers.clear();}static get observedAttributes(){return Object.keys(Q)}attributeChangedCallback(e,t,i){window.setTimeout(()=>{let a=Z+e;this._state[a]=i,this._notify(a,i);});}};var Ct=r=>Object.entries(r).filter(([o,e])=>e!==void 0&&e!=="").map(([o,e])=>o==="cdn-operations"||o==="analytics"?e:`${o}/${e}`);var we=class extends be{constructor(){super(...arguments);this._img=new Image;this._imgPreview=new Image;}_fmtAbs(e){return !e.includes("//")&&!Oe&&(e=new URL(e,document.baseURI).href),e}_validateSize(e){if(!e)return;let t=e,i=t.match(/\d+/)?.[0],a=t.match(/[a-zA-Z]+/)?.[0];if(!i||!a)return;let s=parseInt(i,10);return Number(s)>Be&&this._hasFormatJPG?Be+a:Number(s)>He&&!this._hasFormatJPG?He+a:e}_getCdnModifiers(e,t){let i={format:this._getTypedCssValue("format"),quality:this._getTypedCssValue("quality"),resize:this._validateSize(e),blur:t,"cdn-operations":this._getTypedCssValue("cdn-operations")??void 0,analytics:this.analyticsParams()};return r(...Ct(i))}_getTypedCssValue(e){let t=this.$$(e);if(t==null||typeof t=="string"||typeof t=="number"||typeof t=="boolean")return t}_getUrlBase(e="",t$1=""){let i=this.$$("src");if(i.startsWith("data:")||i.startsWith("blob:"))return i;if(Oe&&i&&!i.includes("//"))return this._proxyUrl(i);let a=this._getCdnModifiers(e,t$1),s$1=this.$$("cdn-cname"),l=s$1;if(i.startsWith(String(s$1)))return s(i,a);let d=this.$$("uuid");if(l&&d)return this._proxyUrl(s(t(l,d),a));if(d)return this._proxyUrl(s(t(l,d),a));let u=this.$$("proxy-cname");if(u)return this._proxyUrl(s(u,a,this._fmtAbs(i)));let p=this.$$("pubkey");if(p)return this._proxyUrl(s(`https://${p}.ucr.io/`,a,this._fmtAbs(i)))}_proxyUrl(e){let t=this.$$("secure-delivery-proxy");return t?O(t,{previewUrl:e},{transform:i=>window.encodeURIComponent(i)}):e}_getElSize(e,t=1,i=true){let a=e.getBoundingClientRect(),s=t*Math.round(a.width),l=i?"":t*Math.round(a.height);return s||l?`${s||""}x${l||""}`:null}_setupEventProxy(e){let t=a=>{a.stopPropagation();let s=new Event(a.type,a);this.dispatchEvent(s);},i=["load","error"];for(let a of i)e.addEventListener(a,t);}get img(){return this._hasPreviewImage||(this._setupConfigForImage({elNode:this._img}),this.appendChild(this._img)),this._img}get _currentImg(){return this._hasPreviewImage?{type:Fe.PREVIEW,img:this._imgPreview}:{type:Fe.MAIN,img:this.img}}get _hasPreviewImage(){return this.$$("is-preview-blur")}get _bgSelector(){return this.$$("is-background-for")}get _breakpoints(){let e=this.$$("breakpoints");if(e){let t=u(e);return Et(t.map(i=>parseInt(i,10)))}else return null}get _hasFormatJPG(){return this.$$("format").toLowerCase()==="jpeg"}_renderBg(e){let t=new Set;t.add(`url("${this._getUrlBase(this._getElSize(e))}") 1x`),this.$$("hi-res-support")&&t.add(`url("${this._getUrlBase(this._getElSize(e,2))}") ${2}x`),this.$$("ultra-res-support")&&t.add(`url("${this._getUrlBase(this._getElSize(e,3))}") ${3}x`);let i=`image-set(${[...t].join(", ")})`;e.style.setProperty("background-image",i),e.style.setProperty("background-image",`-webkit-${i}`);}_getSrcset(){let e=new Set;return this._breakpoints?this._breakpoints.forEach(t=>{e.add(`${this._getUrlBase(`${t}x`)} ${this._validateSize(`${t}w`)}`),this.$$("hi-res-support")&&e.add(`${this._getUrlBase(`${t*2}x`)} ${this._validateSize(`${t*2}w`)}`),this.$$("ultra-res-support")&&e.add(`${this._getUrlBase(`${t*3}x`)} ${this._validateSize(`${t*3}w`)}`);}):(e.add(`${this._getUrlBase(this._getElSize(this._currentImg.img))} 1x`),this.$$("hi-res-support")&&e.add(`${this._getUrlBase(this._getElSize(this._currentImg.img,2))} 2x`),this.$$("ultra-res-support")&&e.add(`${this._getUrlBase(this._getElSize(this._currentImg.img,3))} 3x`)),[...e].join()}_getSrc(){return this._getUrlBase()}get _srcUrlPreview(){return this._getUrlBase("100x","100")}_renderBackground(){let e=this._bgSelector;[...document.querySelectorAll(e)].forEach(t=>{this.$$("intersection")?this.initIntersection(t,()=>{this._renderBg(t);}):this._renderBg(t);});}_appendURL({elNode:e,src:t,srcset:i}){t&&(e.src=t),i&&(e.srcset=i);}_setupConfigForImage({elNode:e}){this._setupEventProxy(e),this.initAttributes(e);}_loaderImage({src:e,srcset:t,elNode:i}){return new Promise((a,s)=>{this._setupConfigForImage({elNode:i}),i.setAttribute(De,""),i.addEventListener("load",()=>{i.removeAttribute(De),a(i);}),i.addEventListener("error",()=>{s(false);}),this._appendURL({elNode:i,src:e,srcset:t});})}async _renderImage(){if(this.$$("intersection")){this._hasPreviewImage&&(this._setupConfigForImage({elNode:this._imgPreview}),this.appendChild(this._imgPreview)),this.initIntersection(this._currentImg.img,async()=>{this._hasPreviewImage&&(this._imgPreview.src=this._srcUrlPreview);try{await this._loaderImage({src:this._getSrc(),srcset:this._getSrcset(),elNode:this._img}),this._hasPreviewImage&&await this._imgPreview.remove(),this.appendChild(this._img);}catch{this._hasPreviewImage&&await this._imgPreview?.remove(),this.appendChild(this._img);}});return}try{this._hasPreviewImage&&(await this._loaderImage({src:this._srcUrlPreview,elNode:this._imgPreview}),this.appendChild(this._imgPreview)),await this._loaderImage({src:this._getSrc(),srcset:this._getSrcset(),elNode:this._img}),this._hasPreviewImage&&await this._imgPreview?.remove(),this.appendChild(this._img);}catch{this._hasPreviewImage&&await this._imgPreview?.remove(),this.appendChild(this._img);}}init(){this._bgSelector?this._renderBackground():this._renderImage();}};var Ne=class extends we{connectedCallback(){super.connectedCallback(),this.sub$$("src",()=>{this.init();}),this.sub$$("uuid",()=>{this.init();}),this.sub$$("lazy",o=>{!this.$$("is-background-for")&&!this.$$("is-preview-blur")&&(this.img.loading=o?"lazy":"eager");});}};var ze=null,ae=class extends R$1{constructor(){super(...arguments);this.dialogEl=fa();this.strokes=false;this.blockBodyScrolling=false;this.closeDialog=()=>{this.modalManager?.close(this.id),this.modalManager?.hasActiveModals||(document.body.style.overflow="",this.$["*currentActivity"]=null);};this._handleDialogClose=()=>{this.closeDialog();};this._handleDialogMouseDown=e=>{this._mouseDownTarget=e.target;};this._handleDialogMouseUp=e=>{let t=e.target;t===this.dialogEl.value&&t===this._mouseDownTarget&&this.closeDialog();};this._handleModalOpen=({id:e})=>{e===this.id?(ze=e,this.show(),this.emit(L.MODAL_OPEN,{modalId:e},{debounce:true})):this.hide();};this._handleModalClose=({id:e})=>{e===this.id&&(this.hide(),this.emit(L.MODAL_CLOSE,{modalId:e,hasActiveModals:this.modalManager?.hasActiveModals},{debounce:true}));};this._handleModalCloseAll=e=>{this.hide(),ze===this.id&&this.emit(L.MODAL_CLOSE,{modalId:ze,hasActiveModals:this.modalManager?.hasActiveModals},{debounce:true});};}static{this.styleAttrs=[...super.styleAttrs,"uc-modal"];}show(){let e=this.dialogEl.value;typeof e.showModal=="function"?(this.setAttribute("aria-modal","true"),e.showModal()):e.setAttribute("open",""),this.cfg.modalScrollLock&&(document.body.style.overflow="hidden");}hide(){let e=this.dialogEl.value;e&&(typeof e.close=="function"?(this.setAttribute("aria-modal","false"),e.close()):e.removeAttribute("open"));}initCallback(){super.initCallback(),this.modalManager?.registerModal(this.id,this),this.subConfigValue("modalBackdropStrokes",e=>{e?this.setAttribute("strokes",""):this.removeAttribute("strokes");}),this.modalManager?.subscribe(y.OPEN,this._handleModalOpen),this.modalManager?.subscribe(y.CLOSE,this._handleModalClose),this.modalManager?.subscribe(y.CLOSE_ALL,this._handleModalCloseAll);}disconnectedCallback(){super.disconnectedCallback(),document.body.style.overflow="",this._mouseDownTarget=void 0,this.modalManager?.unsubscribe(y.OPEN,this._handleModalOpen),this.modalManager?.unsubscribe(y.CLOSE,this._handleModalClose),this.modalManager?.unsubscribe(y.CLOSE_ALL,this._handleModalCloseAll);}_handleDialogRef(e){this.dialogEl={value:e},this.dialogEl.value?.addEventListener("close",this._handleDialogClose),this.dialogEl.value?.addEventListener("mousedown",this._handleDialogMouseDown),this.dialogEl.value?.addEventListener("mouseup",this._handleDialogMouseUp);}render(){return b`<dialog ${ga(this._handleDialogRef)}>${this.yield("")}</dialog>`}};a([i({type:Boolean,noAccessor:true})],ae.prototype,"strokes",2),a([i({type:Boolean,attribute:"block-body-scrolling",noAccessor:true})],ae.prototype,"blockBodyScrolling",2);var xe=class extends g$1{constructor(){super(...arguments);this._validationInputElement=null;this._dynamicInputsContainer=null;}get _inputName(){return this.nameAttrValue??this.ctxName}_createValidationInput(){let e=document.createElement("input");return e.type="text",e.name=this._inputName,e.required=this.cfg.multipleMin>0,e.tabIndex=-1,b$1(e,{opacity:0,height:0,width:0}),e}initCallback(){super.initCallback(),this._validationInputElement=this._createValidationInput(),this.appendChild(this._validationInputElement),this.sub("*collectionState",e=>{if(!e)return;if(!this._dynamicInputsContainer){let s=document.createElement("div");this.appendChild(s),this._dynamicInputsContainer=s;}if(!this._validationInputElement){let s=this._createValidationInput();this.appendChild(s),this._validationInputElement=s;}if(this._dynamicInputsContainer.innerHTML="",e.status==="uploading"||e.status==="idle"){this._validationInputElement.value="",this._validationInputElement.setCustomValidity("");return}if(e.status==="failed"){let s=e.errors[0]?.message;this._validationInputElement.value="",this._validationInputElement.setCustomValidity(s??"");return}let t=e.group?e.group:null;if(t){this._validationInputElement.value=t.cdnUrl??"",this._validationInputElement.setCustomValidity("");return}let i=e.allEntries.map(s=>s.cdnUrl).filter(s=>typeof s=="string");if(!this.cfg.multiple&&i.length===1&&i[0]){this._validationInputElement.value=i[0],this._validationInputElement.setCustomValidity("");return}this._validationInputElement.remove(),this._validationInputElement=null;let a=new DocumentFragment;for(let s of i){let l=document.createElement("input");l.type="hidden",l.name=`${this._inputName}[]`,l.value=s,a.appendChild(l);}this._dynamicInputsContainer.replaceChildren(a);},false);}};a([i({type:String,noAccessor:true,attribute:"name"})],xe.prototype,"nameAttrValue",2);var je=class extends R$1{initCallback(){super.initCallback(),this.subConfigValue("removeCopyright",o=>{this.toggleAttribute("hidden",!!o);});}render(){return b`<a href="https://uploadcare.com/?utm_source=copyright&utm_medium=referral&utm_campaign=v4" target="_blank noopener" class="uc-credits" >Powered by Uploadcare</a >`}};var Y=class extends R$1{constructor(){super(...arguments);this.hasFileName=false;this.value=0;this.visible=true;this._progressValue=0;this._fakeProgressLineRef=fa();this._handleFakeProgressAnimation=()=>{let e=this._fakeProgressLineRef.value;if(e){if(!this.visible){e.classList.add("uc-fake-progress--hidden");return}this._progressValue>0&&e.classList.add("uc-fake-progress--hidden");}};}firstUpdated(e){super.firstUpdated(e),this._progressValue=this._normalizeProgressValue(this.value),this._updateProgressValueStyle(),this._fakeProgressLineRef.value?.addEventListener("animationiteration",this._handleFakeProgressAnimation);}updated(e){if(super.updated(e),e.has("value")){let t=this._normalizeProgressValue(this.value);if(!this.visible)this._progressValue=t;else {let i=Math.max(this._progressValue,t);i!==this._progressValue&&(this._progressValue=i,this._updateProgressValueStyle());}}e.has("visible")&&(this.classList.toggle("uc-progress-bar--hidden",!this.visible),this.visible?this._updateProgressValueStyle():this._progressValue=this._normalizeProgressValue(this.value));}disconnectedCallback(){super.disconnectedCallback(),this._fakeProgressLineRef.value?.removeEventListener("animationiteration",this._handleFakeProgressAnimation);}_normalizeProgressValue(e){return Number.isFinite(e)?Math.min(100,Math.max(0,e)):0}_updateProgressValueStyle(){this.visible&&this.style.setProperty("--l-progress-value",this._progressValue.toString());}render(){return b`<div ${ga(this._fakeProgressLineRef)} class="uc-fake-progress"></div><div class="uc-progress"></div>`}};a([i({type:Boolean,noAccessor:true})],Y.prototype,"hasFileName",2),a([i({type:Number})],Y.prototype,"value",2),a([i({type:Boolean,reflect:true})],Y.prototype,"visible",2);var oe=class extends g$1{constructor(){super();this._visible=false;this._value=0;this.init$={...this.init$,"*commonProgress":0};}initCallback(){super.initCallback(),this._unobserveCollectionCb=this.uploadCollection.observeProperties(()=>{let e=this.uploadCollection.items().some(t=>this.uploadCollection.read(t)?.getValue("isUploading")??false);this._visible=e;}),this.sub("*commonProgress",e=>{this._value=e;});}updated(e){super.updated(e),e.has("visible")&&(this._visible?this.setAttribute("active",""):this.removeAttribute("active"));}disconnectedCallback(){super.disconnectedCallback(),this._unobserveCollectionCb?.(),this._unobserveCollectionCb=void 0;}render(){return b`<uc-progress-bar .value=${this._value} .visible=${this._visible}></uc-progress-bar>`}};a([j()],oe.prototype,"_visible",2),a([j()],oe.prototype,"_value",2);var X=class extends R$1{constructor(){super(...arguments);this.value="";this.disabled=false;this.options=[];this._handleChange=e=>{if(this.disabled){e.preventDefault(),e.stopPropagation();return}e.preventDefault(),e.stopPropagation();let t=e.currentTarget;t&&(this.value=t.value,this.dispatchEvent(new Event("change")));};}render(){return b`<select @change=${this._handleChange} .value=${this.value} ?disabled=${this.disabled}>${this.options.map(e=>b`<option value=${e.value}>${e.text}</option>`)}</select>`}};a([i({type:String,attribute:false})],X.prototype,"value",2),a([i({type:Boolean,reflect:true})],X.prototype,"disabled",2),a([i({type:Array,attribute:false})],X.prototype,"options",2);var J=class extends g$1{constructor(){super(...arguments);this.couldBeCtxOwner=true;this._iconName="default";this._srcTypeKey="";}willUpdate(e){super.willUpdate(e),e.has("source")&&this._applySource(this.source);}_applySource(e){if(!e){this._srcTypeKey="",this._iconName="default";return}let{label:t,icon:i,id:a}=e;this._srcTypeKey=t,this._iconName=i??a??"default";}activate(){this.source&&this.source.onClick();}render(){return b`<button type="button" @click=${this.activate}><uc-icon name=${this._iconName}></uc-icon><div class="uc-txt">${this.l10n(this._srcTypeKey)}</div></button>`}};a([i({attribute:false})],J.prototype,"source",2),a([j()],J.prototype,"_iconName",2),a([j()],J.prototype,"_srcTypeKey",2);var se=class extends g$1{constructor(){super(...arguments);this._rawSourceList=[];this._cameraModes=[];this._sources=[];this.wrap=false;}initCallback(){super.initCallback(),this.subConfigValue("sourceList",t=>{this._rawSourceList=u(t),this._updateSources();}),this.subConfigValue("cameraModes",t=>{this._cameraModes=p(t),this._updateSources();});let e=this._sharedInstancesBag.pluginManager;e?.onPluginsChange&&(this._unsubscribePlugins=e.onPluginsChange(()=>this._updateSources()));}updated(e){super.updated(e),this.cfg.sourceListWrap?this.style.removeProperty("display"):this.style.display="contents";}_updateSources(){let t=this._sharedInstancesBag.pluginManager?.snapshot().sources??[],i=new Map(t.map(s=>[s.id,s])),a=[];this._rawSourceList.forEach((s,l)=>{let d=this._expandSource(s);if(d.length!==1||d[0]!==s){for(let v of d){let g=this._makeBuiltInSourceConfig(v);g&&a.push(g);}return}let p=this._makeBuiltInSourceConfig(s);if(p){a.push(p);return}let h=i.get(s);h&&a.push(this._makePluginSourceConfig(h));}),this._sources=a;}_expandSource(e){return e==="instagram"?(console.error("Instagram source was removed because the Instagram Basic Display API hasn't been available since December 4, 2024. Official statement, see here: https://developers.facebook.com/blog/post/2024/09/04/update-on-instagram-basic-display-api/?locale=en_US"),[]):e==="camera"&&a$1.htmlMediaCapture?this._cameraModes.length?this._cameraModes.map(i=>`mobile-${i}-camera`):["mobile-photo-camera"]:[e]}_makeBuiltInSourceConfig(e){switch(e){case e$1.LOCAL:return {id:e,label:`src-type-${e}`,icon:e,onClick:()=>this.api.openSystemDialog()};case e$1.CAMERA:return {id:e,label:`src-type-${e}`,icon:e,onClick:()=>this._openActivity("camera")};case "draw":return {id:e,label:"src-type-draw",icon:"edit-draw",onClick:()=>this._openActivity("draw")};}if(Object.values(d).includes(e)){let t=e==="mobile-photo-camera";return {id:e,label:"src-type-camera",icon:e$1.CAMERA,onClick:()=>{if(a$1.htmlMediaCapture){this.api.openSystemDialog({captureCamera:true,modeCamera:t?"photo":"video"});return}this._openActivity("camera");}}}return Object.values(c$1).includes(e)?{id:e,label:`src-type-${e}`,icon:e,onClick:()=>this._openActivity("external",{externalSourceType:e})}:null}_makePluginSourceConfig(e){return {id:e.id,label:e.label,icon:e.icon,onClick:()=>e.onSelect()}}_openActivity(e,t={}){if(!e){this.modalManager?.closeAll(),this.set$({"*currentActivityParams":{},"*currentActivity":null});return}this.set$({"*currentActivityParams":t,"*currentActivity":e}),this.modalManager?.open(e);}render(){return b`${this._sources.map(e=>b`<uc-source-btn role="listitem" .source=${e}></uc-source-btn>`)}`}disconnectedCallback(){this._unsubscribePlugins?.(),this._unsubscribePlugins=void 0,super.disconnectedCallback();}};a([j()],se.prototype,"_sources",2),a([i({type:Boolean,attribute:"wrap",noAccessor:true})],se.prototype,"wrap",2);var Ze=class extends R$1{render(){return b`<div class="uc-spinner"></div>`}};function We(r,o=40){if(r.type==="image/svg+xml")return URL.createObjectURL(r);let e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return Promise.reject(new Error("Canvas context not supported"));let i=new Image,a=new Promise((s,l)=>{i.onload=()=>{let d=i.height/i.width;d>1?(e.width=o,e.height=o*d):(e.height=o,e.width=o/d),t.fillStyle="rgb(240, 240, 240)",t.fillRect(0,0,e.width,e.height),t.drawImage(i,0,0,e.width,e.height),e.toBlob(u=>{if(!u){l();return}let p=URL.createObjectURL(u);s(p);});},i.onerror=d=>{l(d);};});return i.src=URL.createObjectURL(r),a}var ee=class extends g$1{constructor(){super(...arguments);this._entrySubs=new Set;this.entry=null;}withEntry(e){return (...t)=>{let i=this.entry;if(!i){console.warn("No entry found");return}return e(i,...t)}}subEntry(e,t){this.withEntry((i,a,s)=>{let l=i.subscribe(a,d=>{this.isConnected&&s(d);});this._entrySubs.add(l);})(e,t);}reset(){for(let e of this._entrySubs)e();this._entrySubs=new Set,this.entry=null;}disconnectedCallback(){super.disconnectedCallback(),this._entrySubs=new Set;}};function ri(r){let o=new Blob([r],{type:"image/svg+xml"});return URL.createObjectURL(o)}function Ae(r="hsl(209, 21%, 65%)",o=32,e=32){return ri(`<svg width="${o}" height="${e}" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" fill="${r}" d="M9.68848 8.70068C9.68848 8.42454 9.91233 8.20068 10.1885 8.20068H15.0885C15.2211 8.20068 15.3483 8.25336 15.442 8.34713L20.342 13.2471C20.4358 13.3409 20.4885 13.4681 20.4885 13.6007V21.3007C20.4885 21.5768 20.2646 21.8007 19.9885 21.8007H10.1885C9.91233 21.8007 9.68848 21.5768 9.68848 21.3007V8.70068ZM10.6885 9.20068V20.8007H19.4885V14.1007L15.0885 14.1007C14.8123 14.1007 14.5885 13.8768 14.5885 13.6007L14.5885 9.20068H10.6885ZM15.5885 9.90779L18.7814 13.1007L15.5885 13.1007L15.5885 9.90779Z"/></svg>`)}var ai=3e3,te=class extends ee{constructor(){super(...arguments);this.badgeIcon="";this.uid="";this._thumbUrl="";this._renderedGridOnce=false;this._thumbRect=null;this._isIntersecting=false;this._firstViewMode=this.cfg.filesViewMode;this._generateThumbnail=this.withEntry(async(e,t$1=false)=>{let i=e.getValue("fileInfo"),a=e.getValue("isImage"),s$1=e.getValue("uuid"),l=e.getValue("thumbUrl"),d=this._calculateThumbSize(t$1);if(i&&a&&s$1){let p=await this.proxyUrl(s(t(this.cfg.cdnCname,s$1),r(e.getValue("cdnUrlModifiers"),"stretch/off",`scale_crop/${d}x${d}/center`)));if(l===p)return;let{promise:h}=ia(p);h.then(()=>{e.setValue("thumbUrl",p),l?.startsWith("blob:")&&URL.revokeObjectURL(l);}).catch(async()=>{if(!l?.startsWith("blob:"))try{let v=e.getValue("file");if(!v)return;let g=await We(v,d);e.setValue("thumbUrl",g);}catch(v){this.telemetryManager.sendEventError(v,"thumbnail generation. Failed to generate thumb from file");let g=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");e.setValue("thumbUrl",Ae(g));}});return}if(e.getValue("thumbUrl"))return;let u=e.getValue("file");if(u?.type.includes("image"))try{let p=await We(u,d);e.setValue("thumbUrl",p);}catch(p){this.telemetryManager.sendEventError(p,"thumbnail generation. Failed to generate thumb from file");let h=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");e.setValue("thumbUrl",Ae(h));}else {let p=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");e.setValue("thumbUrl",Ae(p));}});this._debouncedGenerateThumb=k(this._generateThumbnail.bind(this),100);}_calculateThumbSize(e=false){e&&(this._thumbRect=this.getBoundingClientRect());let t=Math.max(parseInt(String(this?._thumbRect?.height||0),10),parseInt(String(this?._thumbRect?.width||0),10),this.cfg.thumbSize);return window.devicePixelRatio>1&&(t*=window.devicePixelRatio),Math.min(t,ai)}_decodeImage(e,t){return new Promise((i,a)=>{let s=new Image;s.decoding="async";let l=()=>{s&&(s.onload=null,s.onerror=null,s.src=ha,t?.removeEventListener("abort",d),s=null);},d=()=>{l(),a(new DOMException("Aborted","AbortError"));};if(t){if(t.aborted){d();return}t.addEventListener("abort",d,{once:true});}let u=()=>{l(),i();},p=h=>{l(),a(h);};if(typeof s.decode=="function"){s.src=e,s.decode().then(u).catch(p);return}s.onload=u,s.onerror=p,s.src=e;})}_cancelPendingThumbUpdate(){this._pendingThumbUpdate?.cancel(),this._pendingThumbUpdate=void 0;}_scheduleThumbUpdate(e){if(this._cancelPendingThumbUpdate(),!e){this._thumbUrl&&(this._thumbUrl="");return}if(e===this._thumbUrl)return;let t=new AbortController,i={controller:t,cancel:()=>{t.abort(),i.rafId!==void 0&&window.cancelAnimationFrame(i.rafId);}};this._pendingThumbUpdate=i,this._decodeImage(e,t.signal).then(()=>{t.signal.aborted||(i.rafId=window.requestAnimationFrame(()=>{t.signal.aborted||(this._thumbUrl=e);}));}).catch(a=>{t.signal.aborted||a instanceof DOMException&&a.name==="AbortError"||console.warn("[Thumb] Failed to decode thumbnail image",a);});}_requestThumbGeneration(e=false){if(this.entry){if(e){this._generateThumbnail(true);return}this._isIntersecting&&this._debouncedGenerateThumb();}}firstUpdated(e){super.firstUpdated(e),this._bindToEntry();}updated(e){super.updated(e),e.has("uid")&&this._bindToEntry();}_observerCallback(e){let[t]=e;t&&(this._isIntersecting=t.isIntersecting,t.isIntersecting&&(this._thumbRect=t.boundingClientRect,this._requestThumbGeneration(),this._observer?.disconnect()),t.intersectionRatio===0&&this._debouncedGenerateThumb.cancel());}reset(){super.reset(),this._debouncedGenerateThumb.cancel(),this._cancelPendingThumbUpdate(),this._thumbUrl&&(this._thumbUrl="");}_bindToEntry(){let e=this.uid?.trim();if(!e){this.entry&&this.reset();return}let t=this.uploadCollection?.read(e);if(!t||t===this.entry)return;this.reset(),this.entry=t;let i=()=>{this._requestThumbGeneration();};this.subEntry("fileInfo",a=>{a?.isImage&&i();}),this.subEntry("thumbUrl",a=>{this._scheduleThumbUpdate(a??void 0);}),this.subEntry("cdnUrlModifiers",i),this._requestThumbGeneration(true);}initCallback(){super.initCallback(),this.subConfigValue("filesViewMode",e=>{e==="grid"&&!this._renderedGridOnce&&(this._firstViewMode==="list"&&this._requestThumbGeneration(true),this._renderedGridOnce=true);});}connectedCallback(){super.connectedCallback(),this._observer?.disconnect(),this._observer=new window.IntersectionObserver(this._observerCallback.bind(this),{threshold:.1}),this._observer.observe(this);}disconnectedCallback(){super.disconnectedCallback(),this._debouncedGenerateThumb.cancel(),this._cancelPendingThumbUpdate(),this._observer?.disconnect();}render(){return b`<div class="uc-thumb"><img class="uc-thumb__img" src=${this._thumbUrl||ha} role="img" alt="Preview of uploaded image" ?hidden=${!this._thumbUrl} draggable="false" /><div class="uc-badge"><uc-icon name=${this.badgeIcon}></uc-icon></div></div>`}};a([i({type:String})],te.prototype,"badgeIcon",2),a([i({attribute:false})],te.prototype,"uid",2),a([j()],te.prototype,"_thumbUrl",2);var qe=class extends f$1{};var Ge=class extends f$1{constructor(){super(...arguments);this.historyTracked=true;this.activityType=f$1.activities.START_FROM;}initCallback(){super.initCallback(),this.registerActivity(this.activityType??"");}render(){return b`<div class="uc-content">${this.yield("")}</div>`}};var Ke=class extends g$1{constructor(){super(...arguments);this._unbindEventEmitter=null;}static{this.styleAttrs=["uc-wgt-common"];}static{this.EventType=L;}initCallback(){super.initCallback(),this._unbindEventEmitter=this.eventEmitter.bindTarget(this);}disconnectedCallback(){super.disconnectedCallback(),this._unbindEventEmitter?.();}};var Tt=(r,o,e)=>{let t=new Map;for(let i=o;i<=e;i++)t.set(r[i],i);return t},ne=T$1(class extends U$1{constructor(r){if(super(r),r.type!==S.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,o,e){let t;e===void 0?e=o:o!==void 0&&(t=o);let i=[],a=[],s=0;for(let l of r)i[s]=t?t(l,s):s,a[s]=e(l,s),s++;return {values:a,keys:i}}render(r,o,e){return this.dt(r,o,e).values}update(r,[o,e,t]){let i=da(r),{values:a,keys:s}=this.dt(o,e,t);if(!Array.isArray(i))return this.ut=s,a;let l=this.ut??=[],d=[],u,p,h=0,v=i.length-1,g=0,f=a.length-1;for(;h<=v&&g<=f;)if(i[h]===null)h++;else if(i[v]===null)v--;else if(l[h]===s[g])d[g]=ba(i[h],a[g]),h++,g++;else if(l[v]===s[f])d[f]=ba(i[v],a[f]),v--,f--;else if(l[h]===s[f])d[f]=ba(i[h],a[f]),aa(r,d[f+1],i[h]),h++,f--;else if(l[v]===s[g])d[g]=ba(i[v],a[g]),aa(r,i[h],i[v]),v--,g++;else if(u===void 0&&(u=Tt(s,g,f),p=Tt(l,h,v)),u.has(l[h]))if(u.has(l[v])){let A=p.get(s[g]),O=A!==void 0?i[A]:null;if(O===null){let q=aa(r,i[h]);ba(q,a[g]),d[g]=q;}else d[g]=ba(O,a[g]),aa(r,i[h],O),i[A]=null;g++;}else ea(i[v]),v--;else ea(i[h]),h++;for(;g<=f;){let A=aa(r,d[f+1]);ba(A,a[g]),d[g++]=A;}for(;h<=v;){let A=i[h++];A!==null&&ea(A);}return this.ut=s,ca(r,d),c}});var Ce=()=>{let r=[];return {stack:r,promiseReadJpegChunks:e=>new Promise((t,i)=>{let a=2,s=(u,p)=>{let h=new FileReader;h.addEventListener("load",()=>{p(new DataView(h.result));}),h.addEventListener("error",v=>{i(`Reader error: ${v}`);}),h.readAsArrayBuffer(u);},l=()=>s(e.slice(a,a+128),u=>{let p,h,v;for(p=h=0,v=u.byteLength;v>=0?h<v:h>v;p=v>=0?++h:--h)if(u.getUint8(p)===255){a+=p;break}d();}),d=()=>{let u=a;return s(e.slice(a,a+=4),p=>{if(p.byteLength!==4||p.getUint8(0)!==255){i("Corrupted");return}let h=p.getUint8(1);if(h===218){t(true);return}let v=p.getUint16(2)-2;return s(e.slice(a,a+=v),g=>{if(g.byteLength!==v){i("Corrupted");return}r.push({startPos:u,length:v,marker:h,view:g}),l();})})};FileReader&&DataView||i("Not Support"),s(e.slice(0,2),u=>{u.getUint16(0)!==65496&&i("Not jpeg"),l();});})}},oi=async r=>{let o=[],{promiseReadJpegChunks:e,stack:t}=Ce();return await e(r),t.forEach(({marker:i,view:a})=>{i===226&&a.getUint32(0)===1229144927&&a.getUint32(4)===1347571526&&a.getUint32(8)===1229735168&&o.push(a);}),o},Mt=async(r,o,e)=>{{let t=[],i=[],{promiseReadJpegChunks:a,stack:s}=Ce();await a(r),s.forEach(u=>{if(u.marker===o)return t.push(u.startPos),i.push(u.length)});let l=[r.slice(0,2)];for(let u of e){let p=new DataView(new ArrayBuffer(4));p.setUint16(0,65280+o),p.setUint16(2,u.byteLength+2),l.push(p.buffer),l.push(u);}let d=2;for(let u=0;u<t.length;u++)t[u]>d&&l.push(r.slice(d,t[u])),d=t[u]+i[u]+4;return l.push(r.slice(d,r.size)),new Blob(l,{type:r.type})}};var St=(r,o)=>Mt(r,226,o.map(e=>e.buffer)),si=async r=>{try{return await St(r,[])}catch(o){throw new Error(`Failed to strip ICC profile: ${o}`)}},ni=(r,o,e)=>new Promise((t,i)=>{let a=s=>{if(!s){i("Failed to convert canvas to blob");return}t(s);};r.toBlob(a,o,e),r.width=r.height=1;}),le=()=>{let r=document.createElement("canvas"),o=r.getContext("2d");return {canvas:r,ctx:o}},li=r=>{let{ctx:e,canvas:t}=le();t.width=t.height=50,e.drawImage(r,0,0,50,50);let i=e.getImageData(0,0,50,50).data;t.width=t.height=1;for(let a=3;a<i.length;a+=4)if(i[a]<254)return true;return false},ci=async r=>{let o=null,{promiseReadJpegChunks:e,stack:t}=Ce();return await e(r),t.forEach(({marker:i,view:a})=>{if(!o&&i===225&&a.byteLength>=14&&a.getUint32(0)===1165519206&&a.getUint16(4)===0){o=a;return}}),o},di="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k=",Ee,ui=()=>new Promise(r=>{if(Ee!==void 0)r(Ee);else {let o=new Image;o.addEventListener("load",()=>{Ee=o.naturalWidth<o.naturalHeight,o.src="//:0",r(Ee);}),o.src=di;}}),pi=(r,o)=>{let e,t,i,a;if(!r||r.byteLength<14||r.getUint32(0)!==1165519206||r.getUint16(4)!==0)return;if(r.getUint16(6)===18761)t=true;else if(r.getUint16(6)===19789)t=false;else return;if(r.getUint16(8,t)!==42)return;i=8+r.getUint32(10,t);let s=r.getUint16(i-2,t);for(e=0,a=s;a>=0?e<a:e>a;a>=0?++e:--e){if(r.byteLength<i+10)return;r.getUint16(i,t)===274&&o(i+8,t),i+=12;}},hi=(r,o)=>{pi(r,(e,t)=>r.setUint16(e,o,t));},mi=async(r,o,e)=>(e&&hi(o,1),Mt(r,225,[o.buffer])),gi=(r,o)=>new Promise((e,t)=>{o&&(r.src=o),r.complete?e(r):(r.addEventListener("load",()=>{e(r);}),r.addEventListener("error",()=>{t(new Error("Failed to load image. Probably not an image."));}));}),vi=r=>gi(new Image,r),fi=[1,3],bi=[192,193,194,195,197,198,199,201,202,203,205,206,207],kt={squareSide:[Math.floor(Math.sqrt(5*1e3*1e3)),4096,8192,11180,10836,11402,14188,16384],dimension:[4096,8192,16384,32767,65535]},yi=async r=>{let o=false,{promiseReadJpegChunks:e,stack:t}=Ce();return await e(r).then(()=>(t.forEach(({marker:i,view:a})=>{if(!o&&bi.indexOf(i)>=0){let s=a.getUint8(5);fi.indexOf(s)<0&&(o=true);}}),o)).catch(()=>o)},It=(r,o)=>{let e={};return (...t)=>{let i=o(t,e);return i in e?e[i]:e[i]=r(...t)}},Lt=(r,o)=>{let[e]=r,t=Object.keys(o).map(i=>parseInt(i,10)).sort((i,a)=>i-a);for(let i=0;i<t.length;i++){let a=t[i],s=!!o[a];if(a>e&&s||a<e&&!s)return a}return e},z={R:55,G:110,B:165,A:255},_i=`rgba(${z.R}, ${z.G}, ${z.B}, ${z.A/255})`,Pt=(r,o)=>{try{let e=[r-1,o-1,1,1],{canvas:t,ctx:i}=le();t.width=1,t.height=1;let{canvas:a,ctx:s}=le();a.width=r,a.height=o,s&&(s.fillStyle=_i,s.fillRect(...e),i.drawImage(a,r-1,o-1,1,1,0,0,1,1));let l=i&&i.getImageData(0,0,1,1).data,d=!1;return l&&(d=l[0]===z.R&&l[1]===z.G&&l[2]===z.B&&l[3]===z.A),a.width=a.height=1,d}catch{return console.error(`Failed to test for max canvas size of ${r}x${o}.`),false}};function $t(r){return (...o)=>new Promise(e=>{setTimeout(()=>{let t=r(...o);e(t);},0);})}var wi=$t(It(Pt,Lt)),xi=$t(It(Pt,Lt)),Vt=async(r,o)=>{let e=kt.squareSide.find(s=>s*s>=r*o),t=kt.dimension.find(s=>s>=r&&s>=o);if(!e||!t)throw new Error("Not supported");let[i,a]=await Promise.all([wi(e,e),xi(t,1)]);if(i&&a)return true;throw new Error("Not supported")},Ut=async(r,o,e)=>{try{let{ctx:t,canvas:i}=le();return i.width=o,i.height=e,t.imageSmoothingQuality="high",t.drawImage(r,0,0,o,e),r instanceof HTMLImageElement&&(r.src="//:0"),r instanceof HTMLCanvasElement&&(r.width=r.height=1),i}catch(t){throw new Error("Canvas resize error",{cause:t})}},Ai=({img:r,targetW:o,targetH:e})=>Ut(r,o,e),Ei=function({sourceW:r,targetW:o,targetH:e,step:t}){let i=[],a=o,s=e;do i.push([a,s]),a=Math.round(a/t),s=Math.round(s/t);while(a<r*t);return i.reverse()},Ci=({img:r,sourceW:o,targetW:e,targetH:t,step:i})=>{let a=Ei({sourceW:o,targetW:e,targetH:t,step:i});return a.reduce((s,[l,d],u)=>s.then(p=>Vt(l,d).then(()=>Ut(p,l,d)).catch(()=>{if(u===a.length-1)throw new Error("Not supported");return p})),Promise.resolve(r))},Ti=()=>/iPad|iPhone|iPod/.test(navigator.platform)?true:navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),ki=navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),Qe=.71,Mi=(r,o)=>{if(r.width*Qe*r.height*Qe<o.size)throw new Error("Not required");let e=r.width,t=r.height,i=e/t,a=Math.floor(Math.sqrt(o.size*i)),s=Math.floor(o.size/Math.sqrt(o.size*i));return Vt(a,s).then(()=>{let{ctx:l}=le();return "imageSmoothingQuality"in l&&!Ti()&&!ki?Ai({img:r,targetW:a,targetH:s}):Ci({img:r,sourceW:e,targetW:a,targetH:s,step:Qe})}).catch(()=>Promise.reject("Not supported"))},Rt=async(r,o)=>{try{if(await yi(r))throw new Error("Should skipped");let t=await Promise.allSettled([ci(r),ui(),oi(r)]),a=!t.some(A=>A.status==="rejected"),[s,l,d]=t,u=await si(r).catch(()=>r),p=await vi(URL.createObjectURL(u));URL.revokeObjectURL(p.src);let h=await Mi(p,o),v="image/jpeg",g=o?.quality||.8;!a&&li(h)&&(v="image/png",g=void 0);let f=await ni(h,v,g);if(a&&s.status==="fulfilled"&&s.value){let A=s.value,O=l.status==="fulfilled"?l.value:!1;f=await mi(f,A,O);}return a&&d.status==="fulfilled"&&d.value.length>0&&(f=await St(f,d.value)),f}catch(e){let t;throw e instanceof Error&&(t=e.message),typeof e=="string"&&(t=e),new Error(`Failed to shrink image. ${t?`Message: "${t}".`:""}`,{cause:e})}};var Si=/^([0-9]+)x([0-9]+)(?:\s+(\d{1,2}|100)%)?$/i,Dt=r=>{if(typeof r!="string")return false;let o=Si.exec(r.toLocaleLowerCase())??[];if(o.length===0)return false;let e=Number(o[1])*Number(o[2]),t=16384*16384;return e>t?(console.warn(`Shrinked size can not be larger than ${Math.floor(t/1e3/1e3)}MP. You have set ${o[1]}x${o[2]} (${Math.ceil(e/1e3/100)/10}MP).`),false):{quality:o[3]?Number(o[3])/100:void 0,size:e}};var T=Object.freeze({FINISHED:Symbol("FINISHED"),FAILED:Symbol("FAILED"),UPLOADING:Symbol("UPLOADING"),VALIDATION:Symbol("VALIDATION"),QUEUED_UPLOADING:Symbol("QUEUED-UPLOADING"),QUEUED_VALIDATION:Symbol("QUEUED-VALIDATION"),IDLE:Symbol("IDLE")}),E=class E extends ee{constructor(){super(...arguments);this.couldBeCtxOwner=true;this._pauseRender=true;this.uid="";this._itemName="";this._errorText="";this._hint="";this._progressValue=0;this._progressVisible=false;this._badgeIcon="";this._isFinished=false;this._isFailed=false;this._isUploading=false;this._isFocused=false;this._showFileNames=false;this._ariaLabelStatusFile="";this._pluginFileActions=[];this._renderedOnce=false;this._handleRemove=()=>{this.telemetryManager.sendEvent({payload:{metadata:{event:"remove-file",node:this.tagName}}}),this.uid&&this.uploadCollection.hasItem(this.uid)&&this.uploadCollection.remove(this.uid);};this._handleUploadClick=()=>{this._upload();};this._debouncedCalculateState=k(()=>this._calculateState(),100);this._updateHintAndProgress=this.withEntry(ja((e,t)=>{let i=e.getValue("errors")?.[0]?.message??"",a=e.getValue("source"),s=e.getValue("externalUrl"),l=t===T.FINISHED,d=t===T.UPLOADING,u=t===T.QUEUED_UPLOADING,p=t===T.QUEUED_VALIDATION,h=t===T.VALIDATION,v=e.getValue("fileName"),g="";i?g="":!l&&s&&a&&Object.values(c$1).includes(a)&&(g=this.l10n("waiting-for",{source:this.l10n(`src-type-${a}`)})),this._hint=g,this._errorText=i,this._progressVisible=d||u||p||h,this._progressValue=p||h?0:e.getValue("uploadProgress"),this._ariaLabelStatusFile=v?this.l10n("a11y-file-item-status",{fileName:v,status:this.l10n(t?.description?.toLocaleLowerCase()??"").toLocaleLowerCase()}):"";},100));this._upload=this.withEntry(async e=>{if(!this.uploadCollection.read(e.uid)||e.getValue("fileInfo")||e.getValue("isUploading")||e.getValue("errors").length>0||e.getValue("isValidationPending"))return;let t=this.cfg.multiple?this.cfg.multipleMax:1;if(!(t&&this.uploadCollection.size>t)){e.setMultipleValues({isUploading:true,errors:[],isQueuedForUploading:true}),this._debouncedCalculateState();try{let i=new AbortController;e.setValue("abortController",i);let a=async()=>{e.setValue("isQueuedForUploading",!1);let l=e.getValue("file");if(l instanceof File&&this.cfg.imageShrink)try{let h=Dt(this.cfg.imageShrink);h?l=await Rt(l,h):console.warn("Image shrink settings are invalid, skipping shrinking");}catch{}let d=l||e.getValue("externalUrl")||e.getValue("uuid");if(!d)throw new Error("No file input");let p={...await this.getUploadClientOptions(),fileName:e.getValue("fileName")??void 0,source:e.getValue("source")??void 0,onProgress:h=>{if(h.isComputable){let v=h.value*100;e.setValue("uploadProgress",v);}},signal:i.signal,metadata:await this.getMetadataFor(e.uid)};return this.debugPrint("upload options",d,p),E$1(d,p)},s=await this.$["*uploadQueue"].add(a);e.setMultipleValues({fileInfo:s,isQueuedForUploading:!1,isUploading:!1,fileName:s.originalFilename,fileSize:s.size,isImage:s.isImage??!1,mimeType:s.contentInfo?.mime?.mime??s.mimeType,uuid:s.uuid,cdnUrl:e.getValue("cdnUrl")??s.cdnUrl,cdnUrlModifiers:e.getValue("cdnUrlModifiers")??"",uploadProgress:100,source:e.getValue("source")??null}),e===this.entry&&this._debouncedCalculateState();}catch(i){this.telemetryManager.sendEventError(i,"file upload. Failed to upload file"),i instanceof C&&i.isCancel?e.setMultipleValues({isUploading:false,uploadProgress:0}):i instanceof A?e.setMultipleValues({isUploading:false,uploadProgress:0,uploadError:i}):(console.error("Unknown upload error",i),e.setMultipleValues({isUploading:false,uploadProgress:0,uploadError:new Error("Something went wrong",{cause:i})})),e===this.entry&&this._debouncedCalculateState();}}});}_calculateState(){let e=this.entry;if(!e)return;let t=T.IDLE;e.getValue("errors").length>0?t=T.FAILED:e.getValue("isQueuedForUploading")?t=T.QUEUED_UPLOADING:e.getValue("isQueuedForValidation")?t=T.QUEUED_VALIDATION:e.getValue("isValidationPending")?t=T.VALIDATION:e.getValue("isUploading")?t=T.UPLOADING:e.getValue("fileInfo")&&(t=T.FINISHED),this._handleState(e,t);}_handleState(e,t){t===T.FAILED?this._badgeIcon="badge-error":t===T.FINISHED&&(this._badgeIcon="badge-success"),t===T.UPLOADING&&(this._isFocused=false,this.removeAttribute("focused")),this._isFailed=t===T.FAILED,this._isUploading=t===T.UPLOADING,this._isFinished=t===T.FINISHED,this._updateHintAndProgress(t);}reset(){super.reset(),this._debouncedCalculateState.cancel();}_observerCallback(e){let[t]=e;t&&t.isIntersecting&&!this._renderedOnce&&(this._pauseRender=false,this._renderedOnce=true);}_handleEntryId(e){this.reset();let t=this.uploadCollection?.read(e);if(this.entry=t,!t){this._updatePluginFileActions();return}this.subEntry("isQueuedForValidation",()=>{this._debouncedCalculateState();}),this.subEntry("isValidationPending",()=>{this._debouncedCalculateState();}),this.subEntry("uploadProgress",()=>{this._debouncedCalculateState();}),this.subEntry("isQueuedForUploading",()=>{this._debouncedCalculateState();}),this.subEntry("fileName",i=>{this._itemName=i||t.getValue("externalUrl")||this.l10n("file-no-name"),this._debouncedCalculateState();}),this.subEntry("externalUrl",i=>{this._itemName=t.getValue("fileName")||i||this.l10n("file-no-name");}),this.subEntry("fileInfo",()=>{this._debouncedCalculateState();}),this.subEntry("errors",()=>this._debouncedCalculateState()),this.subEntry("isUploading",()=>this._debouncedCalculateState()),this.subEntry("fileSize",()=>this._debouncedCalculateState()),this.subEntry("mimeType",()=>this._debouncedCalculateState()),this.subEntry("isImage",()=>this._debouncedCalculateState()),this.subEntry("fileInfo",()=>this._updatePluginFileActions()),this.subEntry("isUploading",()=>this._updatePluginFileActions()),this.subEntry("errors",()=>this._updatePluginFileActions()),this._calculateState(),this._updatePluginFileActions();}_updateShowFileNames(e){if(this.cfg.filesViewMode==="list"){this._showFileNames=true;return}this._showFileNames=e;}willUpdate(e){super.willUpdate(e),e.has("uid")&&this._handleEntryId(this.uid);}_updatePluginFileActions(){let e=this._sharedInstancesBag.pluginManager;if(!e||!this.uid){this._pluginFileActions=[];return}let t=e.snapshot().fileActions,i=this.api.getOutputItem(this.uid);if(!i){this._pluginFileActions=[];return}this._pluginFileActions=t.filter(a=>{try{return a.shouldRender(i)}catch(s){return console.error(`Error in plugin file action shouldRender (${a.id}):`,s),false}});}_handlePluginFileAction(e){if(!this.uid)return;let t=this.api.getOutputItem(this.uid);if(t)try{e.onClick(t);}catch(i){console.error(`Error in plugin file action onClick (${e.id}):`,i);}}initCallback(){super.initCallback(),this._handleEntryId(this.uid),this.subConfigValue("filesViewMode",t=>{this._updateShowFileNames(this.cfg.gridShowFileNames),this.setAttribute("mode",t);}),this.subConfigValue("gridShowFileNames",t=>{this._updateShowFileNames(t);}),this.onclick=()=>{E.activeInstances.forEach(t=>{t===this?t.setAttribute("focused",""):t.removeAttribute("focused");});},this.sub("*uploadTrigger",t=>{this.entry&&!t.has(this.entry.uid)||setTimeout(()=>this.isConnected&&this._upload());});let e=this._sharedInstancesBag.pluginManager;e?.onPluginsChange&&(this._unsubscribePlugins=e.onPluginsChange(()=>this._updatePluginFileActions())),this._updatePluginFileActions(),E.activeInstances.add(this);}connectedCallback(){super.connectedCallback(),this._observer=new window.IntersectionObserver(this._observerCallback.bind(this),{threshold:[0,1]}),this._observer.observe(this);}disconnectedCallback(){this._unsubscribePlugins?.(),this._unsubscribePlugins=void 0,super.disconnectedCallback(),this._observer?.disconnect(),E.activeInstances.delete(this),this.reset();}static{this.activeInstances=new Set;}shouldUpdate(e){return this._pauseRender?false:super.shouldUpdate(e)}render(){return b`<div class="uc-inner" ?data-finished=${this._isFinished} ?data-uploading=${this._isUploading} ?data-failed=${this._isFailed} ?data-focused=${this._isFocused} ><uc-thumb .uid=${this.uid} .badgeIcon=${this._badgeIcon}></uc-thumb><div aria-atomic="true" aria-live="polite" class="uc-file-name-wrapper" aria-label=${this._ariaLabelStatusFile}><span class="uc-file-name" ?hidden=${!this._showFileNames}>${this._itemName}</span><span class="uc-file-error" ?hidden=${!this._errorText}>${this._errorText}</span><span class="uc-file-hint" ?hidden=${!this._hint}>${this._hint}</span></div><div class="uc-file-actions">${this._pluginFileActions.map(e=>b`<button type="button" @click=${()=>this._handlePluginFileAction(e)} title=${e.id} aria-label=${e.id} class="uc-plugin-action-btn uc-mini-btn" data-plugin-action-id=${e.id} ><uc-icon name=${e.icon}></uc-icon></button>`)}<button type="button" @click=${this._handleRemove} title=${this.l10n("file-item-remove-button")} aria-label=${this.l10n("file-item-remove-button")} class="uc-remove-btn uc-mini-btn" ><uc-icon name="remove-file"></uc-icon></button><button type="button" class="uc-upload-btn uc-mini-btn" @click=${this._handleUploadClick}><uc-icon name="upload"></uc-icon></button></div><uc-progress-bar class="uc-progress-bar" .value=${this._progressValue} .visible=${this._progressVisible} ?hasFileName=${this._showFileNames}></uc-progress-bar></div>`}};a([j()],E.prototype,"_pauseRender",2),a([i({attribute:false})],E.prototype,"uid",2),a([j()],E.prototype,"_itemName",2),a([j()],E.prototype,"_errorText",2),a([j()],E.prototype,"_hint",2),a([j()],E.prototype,"_progressValue",2),a([j()],E.prototype,"_progressVisible",2),a([j()],E.prototype,"_badgeIcon",2),a([j()],E.prototype,"_isFinished",2),a([j()],E.prototype,"_isFailed",2),a([j()],E.prototype,"_isUploading",2),a([j()],E.prototype,"_isFocused",2),a([j()],E.prototype,"_showFileNames",2),a([j()],E.prototype,"_ariaLabelStatusFile",2),a([j()],E.prototype,"_pluginFileActions",2);var Ye=E;function Ii(r){return new Promise(o=>{typeof window.FileReader!="function"&&o(false);try{let e=new FileReader;e.onerror=()=>{o(!0);};let t=i=>{i.type!=="loadend"&&e.abort(),o(!1);};e.onloadend=t,e.onprogress=t,e.readAsDataURL(r);}catch{o(false);}})}function Li(r,o){return new Promise(e=>{let t=0,i=[],a=l=>{if(!l){console.warn("Unexpectedly received empty content entry",{scope:"drag-and-drop"}),e(null);return}l.isFile?(t++,l.file(d=>{t--;let u=new File([d],d.name,{type:d.type||o});i.push({type:"file",file:u,fullPath:l.fullPath}),t===0&&e(i);})):l.isDirectory&&s(l.createReader());},s=l=>{t++,l.readEntries(d=>{t--;for(let u of d)a(u);t===0&&e(i);});};a(r);})}function Ot(r){let o=[],e=[];for(let t=0;t<r.items.length;t++){let i=r.items[t];if(i)if(i.kind==="file"){let a=i.type,s=i;if(typeof s.webkitGetAsEntry=="function"||typeof s.getAsEntry=="function"){let d=typeof s.webkitGetAsEntry=="function"?s.webkitGetAsEntry():s.getAsEntry?.();d&&e.push(Li(d,a).then(u=>{u&&o.push(...u);}));continue}let l=i.getAsFile();l&&e.push(Ii(l).then(d=>{d||o.push({type:"file",file:l});}));}else i.kind==="string"&&/^text\/uri-list/.test(i.type)&&e.push(new Promise(a=>{i.getAsString(s=>{o.push({type:"url",url:s}),a();});}));}return Promise.all(e).then(()=>o)}var I=Object.freeze({ACTIVE:0,INACTIVE:1,NEAR:2,OVER:3}),Ht=["focus"],Pi=100,Xe=new Map;function $i(r,o){let e=Math.max(Math.min(r[0],o.x+o.width),o.x),t=Math.max(Math.min(r[1],o.y+o.height),o.y);return Math.sqrt((r[0]-e)*(r[0]-e)+(r[1]-t)*(r[1]-t))}function Je(r){let o=0,e=document.body,t=new Set,i=f=>{t.add(f);},a=I.INACTIVE,s=f=>{r.shouldIgnore()&&f!==I.INACTIVE||(a!==f&&t.forEach(A=>{A(f);}),a=f);},l=()=>o>0;i(f=>r.onChange(f));let d=()=>{o=0,s(I.INACTIVE);},u=()=>{o+=1,a===I.INACTIVE&&s(I.ACTIVE);},p=()=>{o-=1,l()||s(I.INACTIVE);},h=f=>{f.preventDefault(),o=0,s(I.INACTIVE);},v=f=>{if(r.shouldIgnore())return;l()||(o+=1);let A=[f.x,f.y],O=r.element.getBoundingClientRect(),q=Math.floor($i(A,O)),qt=q<Pi,Gt=f.composedPath().includes(r.element);Xe.set(r.element,q);let it=Math.min(...Xe.values())===q;Gt&&it?(f.preventDefault(),s(I.OVER)):s(qt&&it?I.NEAR:I.ACTIVE);},g=async f=>{if(r.shouldIgnore())return;f.preventDefault();let{dataTransfer:A}=f;if(!A)return;let O=await Ot(A);r.onItems(O),s(I.INACTIVE);};return e.addEventListener("drop",h),e.addEventListener("dragleave",p),e.addEventListener("dragenter",u),e.addEventListener("dragover",v),r.element.addEventListener("drop",g),Ht.forEach(f=>{window.addEventListener(f,d);}),()=>{Xe.delete(r.element),e.removeEventListener("drop",h),e.removeEventListener("dragleave",p),e.removeEventListener("dragenter",u),e.removeEventListener("dragover",v),r.element.removeEventListener("drop",g),Ht.forEach(f=>{window.removeEventListener(f,d);});}}var et=new Set,$=class extends g$1{constructor(){super(...arguments);this.single=false;this.ghost=false;this.disabled=false;this.clickable=false;this.withIcon=false;this.fullscreen=false;this.initflow=false;this._isEnabled=true;this._isVisible=true;this._destroyDropzone=null;this._destroyContentWrapperDropzone=null;this._contentWrapperRef=fa();this._handleAreaInteraction=e=>{if(e instanceof KeyboardEvent){if(e.code!=="Space"&&e.code!=="Enter")return}else if(!(e instanceof MouseEvent))return;if(this.initflow){this.api.initFlow();return}this.api.openSystemDialog();};this._sourceListAllowsLocal=true;this._clickableListenersAttached=false;}static{this.styleAttrs=[...super.styleAttrs,"uc-drop-area"];}get _localizedText(){let e=this.text;return typeof e=="string"&&e.length>0?this.l10n(e)||e:this.l10n("drop-files-here")}isActive(){if(!this._isEnabled)return false;let e=this.getBoundingClientRect(),t=e.width>0&&e.height>0,i=e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth),a=window.getComputedStyle(this),s=a.visibility!=="hidden"&&a.display!=="none";return t&&s&&i}initCallback(){super.initCallback(),et.add(this),this._updateIsEnabled(),this._updateVisibility(),this._updateClickableListeners(),this._updateDragStateAttribute(I.INACTIVE),this._destroyDropzone=Je({element:this,shouldIgnore:()=>this._shouldIgnore(),onChange:e=>{this._updateDragStateAttribute(e);},onItems:e=>{e.length&&(e.forEach(t=>{t.type==="url"?this.api.addFileFromUrl(t.url,{source:e$1.DROP_AREA}):t.type==="file"&&this.api.addFileFromObject(t.file,{source:e$1.DROP_AREA,fullPath:t.fullPath});}),this.uploadCollection.size&&(this.set$({"*currentActivity":f$1.activities.UPLOAD_LIST}),this.modalManager?.open(f$1.activities.UPLOAD_LIST)));}}),this.updateComplete.then(()=>this._setupContentWrapperDropzone()),this.subConfigValue("sourceList",e=>{let t=u(e);this._sourceListAllowsLocal=t.includes(e$1.LOCAL),this._updateIsEnabled(),this._updateVisibility();});}willUpdate(e){super.willUpdate(e),e.has("disabled")&&(this._updateIsEnabled(),this._updateVisibility());}updated(e){super.updated(e),e.has("clickable")&&this._updateClickableListeners();}_shouldIgnore(){if(!this._isEnabled||!this._couldHandleFiles())return true;if(!this.fullscreen)return false;let e=et;return e.size===0?false:[...e].filter(a=>a!==this).filter(a=>a.isActive()).length>0}_couldHandleFiles(){let e=this.cfg.multiple,t=this.cfg.multipleMax,i=this.uploadCollection.size;return !(e&&t&&i>=t||!e&&i>0)}_updateIsEnabled(){let e=this._sourceListAllowsLocal&&!this.disabled;this._isEnabled=e;}_updateVisibility(){let e=this._isEnabled||!this.querySelector("[data-default-slot]");this._isVisible=e,this.hidden=!e;}_updateDragStateAttribute(e){let t=Object.entries(I).find(([,i])=>i===e)?.[0].toLowerCase();t&&this.setAttribute("drag-state",t);}_setupContentWrapperDropzone(){if(this._destroyContentWrapperDropzone)return;let e=this._contentWrapperRef.value;e&&(this._destroyContentWrapperDropzone=Je({element:e,onChange:t=>{let i=Object.entries(I).find(([,a])=>a===t)?.[0].toLowerCase();i&&e.setAttribute("drag-state",i);},onItems:()=>{},shouldIgnore:()=>this._shouldIgnore()}));}_updateClickableListeners(){this.clickable&&!this._clickableListenersAttached?(this.addEventListener("keydown",this._handleAreaInteraction),this.addEventListener("click",this._handleAreaInteraction),this._clickableListenersAttached=true):!this.clickable&&this._clickableListenersAttached&&(this.removeEventListener("keydown",this._handleAreaInteraction),this.removeEventListener("click",this._handleAreaInteraction),this._clickableListenersAttached=false);}disconnectedCallback(){super.disconnectedCallback(),et.delete(this),this._destroyDropzone?.(),this._destroyContentWrapperDropzone?.(),this._clickableListenersAttached&&(this.removeEventListener("keydown",this._handleAreaInteraction),this.removeEventListener("click",this._handleAreaInteraction),this._clickableListenersAttached=false);}render(){return b` ${this.yield("",b`<div data-default-slot hidden></div><div ${ga(this._contentWrapperRef)} class="uc-content-wrapper" ?hidden=${!this._isVisible}><div class="uc-icon-container" ?hidden=${!this.withIcon}><uc-icon name="default"></uc-icon><uc-icon name="arrow-down"></uc-icon></div><span class="uc-text">${this._localizedText}</span></div>`)} `}};a([i({type:Boolean,noAccessor:true})],$.prototype,"single",2),a([i({type:Boolean,noAccessor:true})],$.prototype,"ghost",2),a([i({type:Boolean,reflect:true})],$.prototype,"disabled",2),a([i({type:Boolean,reflect:true})],$.prototype,"clickable",2),a([i({type:Boolean,attribute:"with-icon",reflect:true})],$.prototype,"withIcon",2),a([i({type:Boolean,reflect:true})],$.prototype,"fullscreen",2),a([i({type:Boolean,reflect:true})],$.prototype,"initflow",2),a([i({type:String})],$.prototype,"text",2),a([j()],$.prototype,"_isEnabled",2),a([j()],$.prototype,"_isVisible",2);var R=class extends g$1{constructor(){super(...arguments);this.couldBeCtxOwner=true;this.historyTracked=true;this.activityType=f$1.activities.UPLOAD_LIST;this._doneBtnVisible=false;this._doneBtnEnabled=false;this._uploadBtnVisible=false;this._addMoreBtnVisible=false;this._addMoreBtnEnabled=false;this._commonErrorMessage=null;this._hasFiles=false;this._latestSummary=null;this._handleAdd=()=>{this.telemetryManager.sendEvent({eventType:K.ACTION_EVENT,payload:{metadata:{event:"add-more",node:this.tagName}}}),this.api.initFlow(true);};this._handleUpload=()=>{this.emit(L.UPLOAD_CLICK),this.api.uploadAll(),this._throttledHandleCollectionUpdate();};this._handleDone=()=>{this.emit(L.DONE_CLICK,this.api.getOutputCollectionState()),this.api.doneFlow();};this._handleCancel=()=>{this.telemetryManager.sendEvent({eventType:K.ACTION_EVENT,payload:{metadata:{event:"clear-all",node:this.tagName}}}),this.uploadCollection.clearAll();};this._throttledHandleCollectionUpdate=ja(()=>{this.isConnected&&(this._updateUploadsState(),!this.couldOpenActivity&&this.$["*currentActivity"]===this.activityType&&this.historyBack(),this.cfg.confirmUpload||this.api.uploadAll());},300);}get _headerText(){return this._latestSummary?this._getHeaderText(this._latestSummary):""}_updateUploadsState(){let e=this.api.getOutputCollectionState(),t={total:e.totalCount,succeed:e.successCount,uploading:e.uploadingCount,failed:e.failedCount,validatingBeforeUploading:e.idleEntries.filter(g=>g.isValidationPending).length},i=!e.errors.some(g=>g.type==="TOO_MANY_FILES"||g.type==="TOO_FEW_FILES"),a=e.errors.some(g=>g.type==="TOO_MANY_FILES"),s=e.totalCount===(this.cfg.multiple?this.cfg.multipleMax:1),l=e.allEntries.some(g=>g.isValidationPending),d=t.failed===0&&e.errors.length===0&&!l,u=false,p=false,h=false;if(t.total-t.succeed-t.uploading-t.failed>0&&i&&d&&this.cfg.confirmUpload)u=true;else {p=true;let g=this.cfg.groupOutput?!!e.group:true;h=t.total===t.succeed&&i&&d&&g;}this._doneBtnVisible=p,this._doneBtnEnabled=h,this._uploadBtnVisible=u,this._addMoreBtnEnabled=t.total===0||!a&&!s,this._addMoreBtnVisible=!s||this.cfg.multiple,this._hasFiles=t.total>0,this._latestSummary=t;}_getHeaderText(e){let t=i=>{let a=e[i];return i==="uploading"&&(a+=e.validatingBeforeUploading),this.l10n(`header-${i}`,{count:a})};return e.uploading>0||e.validatingBeforeUploading>0?t("uploading"):e.failed>0?t("failed"):e.succeed>0?t("succeed"):t("total")}get couldOpenActivity(){return this.cfg.showEmptyList||this.uploadCollection.size>0}initCallback(){super.initCallback(),this.registerActivity(this.activityType),this.subConfigValue("multiple",this._throttledHandleCollectionUpdate),this.subConfigValue("multipleMin",this._throttledHandleCollectionUpdate),this.subConfigValue("multipleMax",this._throttledHandleCollectionUpdate),this.sub("*groupInfo",e=>{e&&this._throttledHandleCollectionUpdate();}),this.subConfigValue("filesViewMode",e=>{this.setAttribute("mode",e);}),this.sub("*currentActivity",e=>{!this.couldOpenActivity&&e===this.activityType&&(this.$["*currentActivity"]=this.initActivity);}),this.uploadCollection.observeProperties(this._throttledHandleCollectionUpdate),this.uploadCollection.observeCollection(this._throttledHandleCollectionUpdate),this.sub("*collectionErrors",e=>{let t=e.filter(i=>i.type!=="SOME_FILES_HAS_ERRORS")[0];if(!t){this._commonErrorMessage=null;return}this._commonErrorMessage=t.message;});}disconnectedCallback(){super.disconnectedCallback(),this.has("*uploadCollection")&&(this.uploadCollection.unobserveProperties(this._throttledHandleCollectionUpdate),this.uploadCollection.unobserveCollection(this._throttledHandleCollectionUpdate));}render(){return b`<uc-activity-header><span aria-live="polite" class="uc-header-text">${this._headerText}</span><button type="button" class="uc-mini-btn uc-close-btn" @click=${this.$["*closeModal"]} title=${this.l10n("a11y-activity-header-button-close")} aria-label=${this.l10n("a11y-activity-header-button-close")} ><uc-icon name="close"></uc-icon></button></uc-activity-header><div class="uc-no-files" ?hidden=${this._hasFiles}>${this.yield("empty",b`<span>${this.l10n("no-files")}</span>`)}</div><div class="uc-files"><div class="uc-files-wrapper">${ne(this.$["*uploadList"]??[],({uid:e})=>e,({uid:e})=>b`<uc-file-item .uid=${e}></uc-file-item>`)}</div><button type="button" class="uc-add-more-btn uc-secondary-btn" @click=${this._handleAdd} ?disabled=${!this._addMoreBtnEnabled} ?hidden=${!this._addMoreBtnVisible} ><uc-icon name="add"></uc-icon><span>${this.l10n("add-more")}</span></button></div><div class="uc-common-error" ?hidden=${!this._commonErrorMessage} >${this._commonErrorMessage??""}</div><div class="uc-toolbar"><button type="button" class="uc-cancel-btn uc-secondary-btn" @click=${this._handleCancel}>${this.l10n("clear")}</button><div class="uc-toolbar-spacer"></div><button type="button" class="uc-add-more-btn uc-secondary-btn" ?hidden=${!this._addMoreBtnVisible} ?disabled=${!this._addMoreBtnEnabled} @click=${this._handleAdd} ><uc-icon name="add"></uc-icon><span>${this.l10n("add-more")}</span></button><button type="button" class="uc-upload-btn uc-primary-btn" ?hidden=${!this._uploadBtnVisible} @click=${this._handleUpload} >${this.l10n("upload")}</button><button type="button" class="uc-done-btn uc-primary-btn" ?hidden=${!this._doneBtnVisible} ?disabled=${!this._doneBtnEnabled} @click=${this._handleDone} >${this.l10n("done")}</button></div><uc-drop-area ghost></uc-drop-area>`}};a([j()],R.prototype,"_doneBtnVisible",2),a([j()],R.prototype,"_doneBtnEnabled",2),a([j()],R.prototype,"_uploadBtnVisible",2),a([j()],R.prototype,"_addMoreBtnVisible",2),a([j()],R.prototype,"_addMoreBtnEnabled",2),a([j()],R.prototype,"_commonErrorMessage",2),a([j()],R.prototype,"_hasFiles",2),a([j()],R.prototype,"_latestSummary",2);var Te=class extends g$1{constructor(){super(...arguments);this._formState={importDisabled:true};this._inputRef=fa();this._handleInput=e=>{let t=e.target?.value??"";this._formState={importDisabled:!t};};this._handleUpload=e=>{e.preventDefault(),this.telemetryManager.sendEvent({eventType:K.ACTION_EVENT,payload:{metadata:{event:"upload-from-url",node:this.tagName}}});let i=this._inputRef.value?.value?.trim();i&&(this.api.addFileFromUrl(i,{source:e$1.URL}),this.$["*currentActivity"]=f$1.activities.UPLOAD_LIST,this.modalManager?.open(f$1.activities.UPLOAD_LIST));};}firstUpdated(){let e=this._inputRef.value;e&&(e.value="",e.focus());}render(){return b`<uc-activity-header><button type="button" class="uc-mini-btn" @click=${this.historyBack} title=${this.l10n("back")} aria-label=${this.l10n("back")}><uc-icon name="back"></uc-icon></button><div><uc-icon name="url"></uc-icon><span>${this.l10n("caption-from-url")}</span></div><button type="button" class="uc-mini-btn uc-close-btn" @click=${this.$["*closeModal"]} title=${this.l10n("a11y-activity-header-button-close")} aria-label=${this.l10n("a11y-activity-header-button-close")} ><uc-icon name="close"></uc-icon></button></uc-activity-header><form class="uc-content" @submit=${this._handleUpload}><label><input ${ga(this._inputRef)} placeholder="https://" class="uc-url-input" type="text" @input=${this._handleInput} /></label><button type="submit" class="uc-url-upload-btn uc-primary-btn" ?disabled=${this._formState.importDisabled} >${this.l10n("upload-url")}</button></form>`}};a([j()],Te.prototype,"_formState",2);var Bt=()=>typeof navigator.permissions<"u";var Vi={width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}},Ui=["camera","microphone"];function ke(r){let o=Math.floor(r/60).toString().padStart(2,"0"),e=Math.floor(r%60).toString().padStart(2,"0");return `${o}:${e}`}var Ft="image/jpeg",Nt="video/webm",x=class extends g$1{constructor(){super(...arguments);this.couldBeCtxOwner=true;this.activityType=f$1.activities.CAMERA;this._unsubPermissions=null;this._capturing=false;this._chunks=[];this._mediaRecorder=null;this._stream=null;this._selectedAudioId=null;this._selectedCameraId=null;this._activeTab=null;this._options={};this._canvas=null;this._ctx=null;this._cameraDevices=[];this._audioDevices=[];this._permissionResponses={};this._permissionCleanupFns=[];this._currentVideoSource=null;this._handlePreviewPlay=()=>{this._startTimeline(),this._currentTimelineIcon="pause";};this._handlePreviewPause=()=>{this._currentTimelineIcon="play",this._stopTimeline();};this._timerRef=fa();this._lineRef=fa();this._videoRef=fa();this._switcherRef=fa();this._startTime=0;this._elapsedTime=0;this._videoTransformCss=null;this._videoHidden=true;this._messageHidden=true;this._requestBtnHidden=Bt();this._cameraSelectOptions=[];this._cameraSelectHidden=true;this._l10nMessage="";this._timerHidden=true;this._cameraHidden=true;this._cameraActionsHidden=true;this._audioSelectOptions=[];this._audioSelectHidden=true;this._audioSelectDisabled=true;this._audioToggleMicrophoneHidden=true;this._tabCameraHidden=true;this._tabVideoHidden=true;this._currentIcon="camera-full";this._currentTimelineIcon="play";this._toggleMicrophoneIcon="microphone";this._mutableClassButton="uc-shot-btn uc-camera-action";this._chooseActionWithCamera=()=>{if(this.telemetryManager.sendEvent({eventType:K.ACTION_EVENT,payload:{metadata:{event:"start-camera",node:this.tagName,tabId:this._activeTab}}}),this._activeTab===W$1.PHOTO&&this._shot(),this._activeTab===W$1.VIDEO){if(this._mediaRecorder?.state==="recording"){this._stopRecording();return}this._startRecording();}};this._handleCameraSelectChange=e=>{let t=e.target;t&&(this._selectedCameraId=t.value,this._capture());};this._handleAudioSelectChange=e=>{let t=e.target;t&&(this._selectedAudioId=t.value,this._capture());};this._handleRequestPermissions=()=>{this._capture();};this._handleStartCamera=()=>{this.telemetryManager.sendEvent({eventType:K.ACTION_EVENT,payload:{metadata:{event:"shot-camera",node:this.tagName,tabId:this._activeTab}}}),this._chooseActionWithCamera();};this._handleToggleRecording=()=>{this._toggleRecording();};this._handleToggleAudio=()=>{this._toggleEnableAudio();};this._handleRetake=()=>{this.telemetryManager.sendEvent({eventType:K.ACTION_EVENT,payload:{metadata:{event:"retake-camera",node:this.tagName,tabId:this._activeTab}}}),this._retake();};this._handleAccept=()=>{this.telemetryManager.sendEvent({eventType:K.ACTION_EVENT,payload:{metadata:{event:"accept-camera",node:this.tagName,tabId:this._activeTab}}}),this._accept();};this._handleClickTab=e=>{let i=e.currentTarget?.getAttribute("data-id");i&&this._handleActiveTab(i);};this._updateTimer=()=>{let e=Math.floor((performance.now()-this._startTime+this._elapsedTime)/1e3);if(typeof this.cfg.maxVideoRecordingDuration=="number"&&this.cfg.maxVideoRecordingDuration>0){let t=this.cfg.maxVideoRecordingDuration-e;if(t<=0){let a=this._timerRef.value;a&&(a.textContent=ke(t)),this._stopRecording();return}let i=this._timerRef.value;i&&(i.textContent=ke(t));}else {let t=this._timerRef.value;t&&(t.textContent=ke(e));}this._animationFrameId=requestAnimationFrame(this._updateTimer);};this._startTimer=()=>{this._startTime=performance.now(),this._elapsedTime=0,this._updateTimer();};this._stopTimer=()=>{this._animationFrameId&&cancelAnimationFrame(this._animationFrameId);};this._startTimeline=()=>{let e=this._videoRef.value;if(!e)return;let t=e.currentTime,i=e.duration||1,a=this._lineRef.value;a&&(a.style.transform=`scaleX(${t/i})`);let s=this._timerRef.value;s&&(s.textContent=ke(t)),this._animationFrameId=requestAnimationFrame(this._startTimeline);};this._stopTimeline=()=>{this._animationFrameId&&cancelAnimationFrame(this._animationFrameId);};this._animationFrameId=null;this._startRecording=()=>{try{this._chunks=[],this._options={...this.cfg.mediaRecorderOptions};let{mimeType:e}=this.cfg.mediaRecorderOptions||{};e&&MediaRecorder.isTypeSupported(e)?this._options.mimeType=e:MediaRecorder.isTypeSupported(Nt)?this._options.mimeType=Nt:this._options.mimeType="video/mp4",this._stream&&(this._mediaRecorder=new MediaRecorder(this._stream,this._options),this._mediaRecorder.start(),this._mediaRecorder.addEventListener("dataavailable",t=>{this._chunks.push(t.data);}),this._startTimer(),this.classList.add("uc-recording"),this._setCameraState(X$1.PLAY));}catch(e){console.error("Failed to start recording",e),this.telemetryManager.sendEventError(e,"camera recording. Failed to start recording");}};this._stopRecording=()=>{this._mediaRecorder?.addEventListener("stop",()=>{this._previewVideo(),this._stopTimer(),this._setCameraState(X$1.STOP);}),this._mediaRecorder?.stop(),this.classList.remove("uc-recording"),this.telemetryManager.sendEvent({eventType:K.ACTION_EVENT,payload:{metadata:{event:"stop-camera",node:this.tagName,tabId:this._activeTab}}});};this._toggleRecording=()=>{if(this._mediaRecorder?.state==="recording")return;let e=this._videoRef.value;e&&(!e.paused&&!e.ended&&e.readyState>2?e.pause():e.paused&&e.play());};this._toggleEnableAudio=()=>{this._stream?.getAudioTracks().forEach(e=>{e.enabled=!e.enabled,this._toggleMicrophoneIcon=e.enabled?"microphone":"microphone-mute",this._audioSelectDisabled=!e.enabled;});};this._previewVideo=()=>{try{let e=new Blob(this._chunks,{type:this._mediaRecorder?.mimeType}),t=URL.createObjectURL(e),i=this._videoRef.value;if(!i)return;i.muted=!1,i.volume=1,this._setVideoSource(null),i.src=t,this._attachPreviewListeners(i);}catch(e){console.error("Failed to preview video",e),this.telemetryManager.sendEventError(e,"camera previewing. Failed to preview video");}};this._retake=()=>{if(this._setCameraState(X$1.RETAKE),this._activeTab===W$1.VIDEO){this._setVideoSource(this._stream);let e=this._videoRef.value;e&&(e.muted=true);}this._videoRef.value?.play?.();};this._accept=()=>{if(this._setCameraState(X$1.ACCEPT),this._activeTab===W$1.PHOTO){this._canvas?.toBlob(a=>{if(!a)return;let s=this._createFile("camera","jpeg",Ft,a);this._toSend(s);},Ft);return}let e=new Blob(this._chunks,{type:this._mediaRecorder?.mimeType}),t=this._guessExtensionByMime(this._mediaRecorder?.mimeType),i=this._createFile("video",t,`video/${t}`,e);this._toSend(i),this._chunks=[];};this._handlePhoto=e=>{e===X$1.SHOT&&(this._tabVideoHidden=true,this._cameraHidden=true,this._tabCameraHidden=true,this._cameraActionsHidden=false,this._cameraSelectHidden=true),(e===X$1.RETAKE||e===X$1.ACCEPT)&&(this._tabVideoHidden=!this._cameraModes.includes(W$1.VIDEO),this._tabCameraHidden=!this._cameraModes.includes(W$1.PHOTO),this._cameraHidden=false,this._cameraActionsHidden=true,this._cameraSelectHidden=this._cameraDevices.length<=1);};this._handleVideo=e=>{e===X$1.PLAY&&(this._timerHidden=false,this._tabCameraHidden=true,this._cameraSelectHidden=true,this._audioSelectHidden=true,this._currentTimelineIcon="pause",this._currentIcon="square",this._mutableClassButton="uc-shot-btn uc-camera-action uc-stop-record"),e===X$1.STOP&&(this._timerHidden=false,this._cameraHidden=true,this._audioToggleMicrophoneHidden=true,this._cameraActionsHidden=false),(e===X$1.RETAKE||e===X$1.ACCEPT)&&(this._timerHidden=true,this._tabVideoHidden=!this._cameraModes.includes(W$1.VIDEO),this._tabCameraHidden=!this._cameraModes.includes(W$1.PHOTO),this._cameraHidden=false,this._cameraActionsHidden=true,this._audioToggleMicrophoneHidden=!this.cfg.enableAudioRecording,this._currentIcon="video-camera-full",this._mutableClassButton="uc-shot-btn uc-camera-action",this._audioSelectHidden=!this.cfg.enableAudioRecording||this._audioDevices.length<=1,this._cameraSelectHidden=this._cameraDevices.length<=1);};this._setCameraState=e=>{this._activeTab===W$1.PHOTO&&(e==="shot"||e==="retake"||e==="accept")&&this._handlePhoto(e),this._activeTab===W$1.VIDEO&&(e==="play"||e==="stop"||e==="retake"||e==="accept"||e==="pause"||e==="resume")&&this._handleVideo(e);};this._handleActiveTab=e=>{this._switcherRef.value?.querySelectorAll("button").forEach(i=>{i.classList.toggle("uc-active",i.getAttribute("data-id")===e);}),e===W$1.PHOTO&&(this._currentIcon="camera-full",this._audioSelectHidden=true,this._audioToggleMicrophoneHidden=true),e===W$1.VIDEO&&(this._currentTimelineIcon="play",this._currentIcon="video-camera-full",this._audioSelectHidden=!this.cfg.enableAudioRecording||this._audioDevices.length<=1,this._audioToggleMicrophoneHidden=!this.cfg.enableAudioRecording),this.telemetryManager.sendEvent({eventType:K.ACTION_EVENT,payload:{metadata:{event:"camera-tab-switch",node:this.tagName,tabId:e}}}),this._activeTab=e;};this._createFile=(e,t,i,a)=>{let s=Date.now(),l=`${e}-${s}.${t}`;return new File([a],l,{lastModified:s,type:i})};this._toSend=e=>{this.api.addFileFromObject(e,{source:e$1.CAMERA}),this.set$({"*currentActivity":f$1.activities.UPLOAD_LIST}),this.modalManager?.open(f$1.activities.UPLOAD_LIST);};this._setPermissionsState=k(e=>{this.classList.toggle("uc-initialized",e==="granted");let t=this._activeTab===W$1.VIDEO&&this.cfg.enableAudioRecording,i=this._activeTab===W$1.PHOTO?"camera-full":"video-camera-full";e==="granted"?(this._videoHidden=false,this._cameraHidden=false,this._tabCameraHidden=!this._cameraModes.includes(W$1.PHOTO),this._tabVideoHidden=!this._cameraModes.includes(W$1.VIDEO),this._messageHidden=true,this._timerHidden=true,this._currentIcon=i,this._audioToggleMicrophoneHidden=!t,this._audioSelectHidden=!t):e==="prompt"?(this._l10nMessage="camera-permissions-prompt",this._videoHidden=true,this._cameraHidden=true,this._tabCameraHidden=true,this._messageHidden=false,this._stopCapture()):(this._l10nMessage="camera-permissions-denied",this._videoHidden=true,this._messageHidden=false,this._tabCameraHidden=!this._cameraModes.includes(W$1.PHOTO),this._tabVideoHidden=!this._cameraModes.includes(W$1.VIDEO),this._cameraActionsHidden=true,this._mutableClassButton="uc-shot-btn uc-camera-action",this._stopCapture());},300);this._makeStreamInactive=()=>{if(!this._stream)return false;let e=this._stream?.getAudioTracks(),t=this._stream?.getVideoTracks();return e.forEach(i=>{i.stop();}),t.forEach(i=>{i.stop();}),true};this._stopCapture=()=>{this._capturing&&(this._videoRef.value&&(this._videoRef.value.volume=0),this._currentVideoSource?.getTracks?.()?.[0]?.stop(),this._detachPreviewListeners(this._videoRef.value),this._setVideoSource(null),this._makeStreamInactive(),this._stopTimer(),this._capturing=false);};this._capture=async()=>{let e={video:{...Vi},audio:this.cfg.enableAudioRecording?{}:false};this._selectedCameraId&&(e.video={deviceId:{exact:this._selectedCameraId}}),this._selectedAudioId&&this.cfg.enableAudioRecording&&(e.audio={deviceId:{exact:this._selectedAudioId}}),this._videoRef.value&&(this._videoRef.value.volume=0);try{this._setPermissionsState("prompt"),this._stream=await navigator.mediaDevices.getUserMedia(e),this._stream.addEventListener("inactive",()=>{this._setPermissionsState("denied");}),this._setVideoSource(this._stream),this._capturing=!0,this._setPermissionsState("granted");}catch(t){this._setPermissionsState("denied"),console.log("Failed to capture camera",t),this.telemetryManager.sendEventError(t,"camera capturing. Failed to capture camera");}};this._handlePermissionsChange=()=>{this._capture();};this._permissionAccess=async()=>{try{this._teardownPermissionListeners();for(let e of Ui){let t=await navigator.permissions.query({name:e});this._permissionResponses[e]=t,t.addEventListener("change",this._handlePermissionsChange),this._permissionCleanupFns.push(()=>{t.removeEventListener("change",this._handlePermissionsChange);});}this._unsubPermissions=()=>{this._teardownPermissionListeners();};}catch(e){this._teardownPermissionListeners(),console.log("Failed to use permissions API. Fallback to manual request mode.",e),this.telemetryManager.sendEventError(e,"camera permissions. Failed to use permissions API"),this._capture();}};this._requestDeviceAccess=async()=>{try{await navigator.mediaDevices.getUserMedia({video:!0,audio:this.cfg.enableAudioRecording}),await this._getDevices(),navigator.mediaDevices.addEventListener("devicechange",this._getDevices);}catch(e){this.telemetryManager.sendEventError(e,"camera devices. Failed to get user media"),console.log("Failed to get user media",e);}};this._getDevices=async()=>{try{let e=await navigator.mediaDevices.enumerateDevices();this._cameraDevices=e.filter(t=>t.kind==="videoinput").map((t,i)=>({text:t.label.trim()||`${this.l10n("caption-camera")} ${i+1}`,value:t.deviceId})),this._audioDevices=this.cfg.enableAudioRecording?e.filter(t=>t.kind==="audioinput").map(t=>({text:t.label.trim(),value:t.deviceId})):[],this._cameraSelectOptions=this._cameraDevices,this._cameraSelectHidden=this._cameraDevices.length<=1,this._selectedCameraId=this._cameraDevices[0]?.value??null,this._audioSelectOptions=this._audioDevices,this._audioSelectHidden=!this.cfg.enableAudioRecording||this._audioDevices.length<=1,this._selectedAudioId=this._audioDevices[0]?.value??null;}catch(e){this.telemetryManager.sendEventError(e,"camera devices. Failed to get devices"),console.log("Failed to get devices",e);}};this._onActivate=async()=>{await this._permissionAccess(),await this._requestDeviceAccess(),await this._capture(),this._handleCameraModes(this._cameraModes);};this._onDeactivate=async()=>{this._unsubPermissions&&this._unsubPermissions(),window.chrome||this._setPermissionsState("denied"),this._stopCapture();};this._handleCameraModes=e=>{this._tabVideoHidden=!e.includes(W$1.VIDEO),this._tabCameraHidden=!e.includes(W$1.PHOTO);let t=e[0];t&&(!this._activeTab||!e.includes(this._activeTab))&&this._handleActiveTab(t);};}_attachPreviewListeners(e){this._detachPreviewListeners(e),e.addEventListener("play",this._handlePreviewPlay),e.addEventListener("pause",this._handlePreviewPause);}_detachPreviewListeners(e){e?.removeEventListener("play",this._handlePreviewPlay),e?.removeEventListener("pause",this._handlePreviewPause);}_setVideoSource(e){this._currentVideoSource!==e&&(this._currentVideoSource=e,this._applyVideoSource());}_applyVideoSource(){let e=this._videoRef.value;if(!e)return;let t=this._currentVideoSource??null;e.srcObject!==t&&(e.srcObject=t);}_shot(){if(this._setCameraState("shot"),this._canvas=document.createElement("canvas"),this._ctx=this._canvas.getContext("2d"),!this._ctx)throw new Error("Failed to get canvas context");let e=this._videoRef.value;if(!e)throw new Error("Video element not found");this._canvas.height=e.videoHeight,this._canvas.width=e.videoWidth,this.cfg.cameraMirror&&(this._ctx.translate(this._canvas.width,0),this._ctx.scale(-1,1)),this._ctx.drawImage(e,0,0),e.pause();}_guessExtensionByMime(e){let t={mp4:"mp4",ogg:"ogg",webm:"webm",quicktime:"mov","x-matroska":"mkv"};if(e==="")return "webm";if(e){let i=e.split("/");if(i?.[0]==="video"){let s=i.slice(1).join("/")?.split(";")[0];if(s&&t[s])return t[s]}}return "avi"}get _cameraModes(){return u(this.cfg.cameraModes).filter(e=>e===W$1.PHOTO||e===W$1.VIDEO)}_teardownPermissionListeners(){if(this._permissionCleanupFns.length!==0){for(let e of this._permissionCleanupFns)e();this._permissionCleanupFns=[],this._unsubPermissions=null;}}initCallback(){super.initCallback(),this.registerActivity(this.activityType,{onActivate:this._onActivate,onDeactivate:this._onDeactivate}),this.subConfigValue("cameraMirror",e=>{this._videoTransformCss=e?"scaleX(-1)":null;}),this.subConfigValue("enableAudioRecording",e=>{this._audioToggleMicrophoneHidden=!e,this._audioSelectDisabled=!e;}),this.subConfigValue("cameraModes",e=>{if(!this.isActivityActive)return;let t=p(e);this._handleCameraModes(t.filter(i=>i===W$1.PHOTO||i===W$1.VIDEO));});}firstUpdated(e){super.firstUpdated(e),this._applyVideoSource();}updated(e){super.updated(e),this._applyVideoSource();}_destroy(){this._teardownPermissionListeners(),navigator.mediaDevices?.removeEventListener("devicechange",this._getDevices),this._detachPreviewListeners(this._videoRef.value),this._setVideoSource(null);}disconnectedCallback(){super.disconnectedCallback(),this._destroy();}render(){return b`<uc-activity-header><button type="button" class="uc-mini-btn" @click=${this.$["*historyBack"]} title=${this.l10n("back")} ><uc-icon name="back"></uc-icon></button><div ?hidden=${!this._cameraSelectHidden}><uc-icon name="camera"></uc-icon><span>${this.l10n("caption-camera")}</span></div><uc-select class="uc-camera-select" .options=${this._cameraSelectOptions} ?hidden=${this._cameraSelectHidden} @change=${this._handleCameraSelectChange} ></uc-select><button type="button" class="uc-mini-btn uc-close-btn" @click=${this.$["*closeModal"]} title=${this.l10n("a11y-activity-header-button-close")} aria-label=${this.l10n("a11y-activity-header-button-close")} ><uc-icon name="close"></uc-icon></button></uc-activity-header><div class="uc-content"><video muted autoplay playsinline style=${ka({transform:this._videoTransformCss})} ?hidden=${this._videoHidden} ${ga(this._videoRef)} ></video><div class="uc-message-box" ?hidden=${this._messageHidden}><span>${this.l10n(this._l10nMessage)}</span><button type="button" @click=${this._handleRequestPermissions} ?hidden=${this._requestBtnHidden} >${this.l10n("camera-permissions-request")}</button></div></div><div class="uc-controls"><div ${ga(this._switcherRef)} class="uc-switcher" ?hidden=${!this._timerHidden}><button data-id="photo" type="button" class="uc-switch uc-mini-btn" @click=${this._handleClickTab} ?hidden=${this._tabCameraHidden} data-testid="tab-photo" ><uc-icon name="camera"></uc-icon></button><button data-id="video" type="button" class="uc-switch uc-mini-btn" @click=${this._handleClickTab} ?hidden=${this._tabVideoHidden} data-testid="tab-video" ><uc-icon name="video-camera"></uc-icon></button></div><button class="uc-secondary-btn uc-recording-timer" @click=${this._handleToggleRecording} ?hidden=${this._timerHidden} data-testid="recording-timer" ><uc-icon name=${this._currentTimelineIcon}></uc-icon><span ${ga(this._timerRef)}> 00:00 </span><span ${ga(this._lineRef)} class="uc-line"></span></button><div class="uc-camera-actions uc-camera-action" ?hidden=${this._cameraActionsHidden} ><button type="button" class="uc-secondary-btn" @click=${this._handleRetake}> Retake </button><button type="button" class="uc-primary-btn" @click=${this._handleAccept} data-testid="accept" > Accept </button></div><button type="button" data-testid="shot" @click=${this._handleStartCamera} class=${this._mutableClassButton} ?hidden=${this._cameraHidden} ><uc-icon name=${this._currentIcon}></uc-icon></button><div class="uc-select"><button type="button" class="uc-mini-btn uc-btn-microphone" @click=${this._handleToggleAudio} ?hidden=${this._audioToggleMicrophoneHidden} data-testid="toggle-microphone" ><uc-icon name=${this._toggleMicrophoneIcon}></uc-icon></button><uc-select class="uc-audio-select" .options=${this._audioSelectOptions} ?hidden=${this._audioSelectHidden} ?disabled=${this._audioSelectDisabled} @change=${this._handleAudioSelectChange} data-testid="audio-select" ></uc-select></div></div>`}};a([j()],x.prototype,"_videoTransformCss",2),a([j()],x.prototype,"_videoHidden",2),a([j()],x.prototype,"_messageHidden",2),a([j()],x.prototype,"_requestBtnHidden",2),a([j()],x.prototype,"_cameraSelectOptions",2),a([j()],x.prototype,"_cameraSelectHidden",2),a([j()],x.prototype,"_l10nMessage",2),a([j()],x.prototype,"_timerHidden",2),a([j()],x.prototype,"_cameraHidden",2),a([j()],x.prototype,"_cameraActionsHidden",2),a([j()],x.prototype,"_audioSelectOptions",2),a([j()],x.prototype,"_audioSelectHidden",2),a([j()],x.prototype,"_audioSelectDisabled",2),a([j()],x.prototype,"_audioToggleMicrophoneHidden",2),a([j()],x.prototype,"_tabCameraHidden",2),a([j()],x.prototype,"_tabVideoHidden",2),a([j()],x.prototype,"_currentIcon",2),a([j()],x.prototype,"_currentTimelineIcon",2),a([j()],x.prototype,"_toggleMicrophoneIcon",2),a([j()],x.prototype,"_mutableClassButton",2);var zt=()=>{let r=globalThis.top??globalThis.parent??globalThis.self;try{return r.location.origin}catch(o){return console.warn("Unable to access top-level window location:",o),globalThis.location.origin}};var Ri=r=>r.replace(/[\\-\\[]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),jt=(r,o="i")=>{let e=r.split("*").map(Ri);return new RegExp(`^${e.join(".+")}$`,o)};var Di=["--uc-font-family","--uc-font-size","--uc-line-height","--uc-button-size","--uc-preview-size","--uc-input-size","--uc-padding","--uc-radius","--uc-transition","--uc-background","--uc-foreground","--uc-primary","--uc-primary-hover","--uc-primary-transparent","--uc-primary-foreground","--uc-secondary","--uc-secondary-hover","--uc-secondary-foreground","--uc-muted","--uc-muted-foreground","--uc-destructive","--uc-destructive-foreground","--uc-border"],Oi=(r,o)=>window.getComputedStyle(r).getPropertyValue(o).trim(),Zt=r=>{let o={};for(let e of Di){let t=Oi(r,e);t&&(o[e]=t);}return o};var Hi=["selected-files-change","toolbar-state-change"],Bi=r=>{if(!r||typeof r!="object"||!("type"in r))return false;let o=r.type;return !(typeof o!="string"||!Hi.includes(o))},Me=class{constructor(o,e){this._handlerMap=new Map;this._handleMessage=o=>{if(o.source!==this._context)return;let e=o.data;if(!Bi(e))return;let t=this._handlerMap.get(e.type);if(t)for(let i of t)i(e);};this._context=o,this._getTargetOrigin=e,window.addEventListener("message",this._handleMessage);}on(o,e){let t=this._handlerMap.get(o)??new Set;this._handlerMap.has(o)||this._handlerMap.set(o,t),t.add(e);}send(o){let e=this._getTargetOrigin();this._context.postMessage(o,e);}destroy(){window.removeEventListener("message",this._handleMessage);}};function Wt(r){let o=[];for(let[e,t]of Object.entries(r))t==null||typeof t=="string"&&t.length===0||o.push(`${e}=${encodeURIComponent(t)}`);return o.join("&")}var Fi={[c$1.GDRIVE]:"ngdrive"},U=class extends g$1{constructor(){super(...arguments);this.couldBeCtxOwner=true;this.activityType=f$1.activities.EXTERNAL;this._iframeRef=fa();this._latestSelectionSummary=null;this._selectedList=[];this._isSelectionReady=false;this._isDoneBtnEnabled=false;this._couldSelectAll=false;this._couldDeselectAll=false;this._showSelectionStatus=false;this._showDoneBtn=false;this._doneBtnTextClass="uc-hidden";this._toolbarVisible=true;this._handleDone=()=>{for(let e of this._selectedList){let t=this._extractUrlFromSelectedFile(e),{filename:i}=e,{externalSourceType:a}=this.activityParams;this.api.addFileFromUrl(t,{fileName:i,source:a});}this.$["*currentActivity"]=f$1.activities.UPLOAD_LIST,this.modalManager?.open(f$1.activities.UPLOAD_LIST);};this._handleCancel=()=>{this.historyBack();};this._handleSelectAll=()=>{this._messageBridge?.send({type:"select-all"});};this._handleDeselectAll=()=>{this._messageBridge?.send({type:"deselect-all"});};}get _counterText(){if(!this._latestSelectionSummary)return "";let{selectedCount:e,total:t}=this._latestSelectionSummary;return this.l10n("selected-count",{count:e,total:t})}get activityParams(){let e=super.activityParams;if("externalSourceType"in e)return e;throw new Error("External Source activity params not found")}initCallback(){super.initCallback(),this.registerActivity(this.activityType,{onActivate:()=>{let{externalSourceType:e}=this.activityParams;if(!e){this.modalManager?.close(this.$["*currentActivity"]),this.$["*currentActivity"]=null,console.error(`Param "externalSourceType" is required for activity "${this.activityType}"`);return}this._mountIframe();}}),this.sub("*currentActivityParams",()=>{this.isActivityActive&&(this._unmountIframe(),this._mountIframe());}),this.sub("*currentActivity",e=>{e!==this.activityType&&this._unmountIframe();}),this.subConfigValue("multiple",e=>{this._showSelectionStatus=e;}),this.subConfigValue("localeName",()=>{this._setupL10n();}),this.subConfigValue("externalSourcesEmbedCss",e=>{this._applyEmbedCss(e);});}_extractUrlFromSelectedFile(e){if(e.alternatives){let t=u(this.cfg.externalSourcesPreferredTypes);for(let i of t){let a=jt(i);for(let[s,l]of Object.entries(e.alternatives))if(a.test(s))return l}}return e.url}_handleToolbarStateChange(e){this._toolbarVisible=e.isVisible;}async _handleSelectedFilesChange(e){if(this.cfg.multiple!==e.isMultipleMode){console.error("Multiple mode mismatch");return}this._setSelectionSummary(e.selectedCount,e.total),this._doneBtnTextClass=e.isReady?"":"uc-hidden",this._isSelectionReady=e.isReady,this._isDoneBtnEnabled=e.isReady&&e.selectedFiles.length>0,this._showSelectionStatus=e.isMultipleMode&&e.total>0,this._couldSelectAll=e.selectedCount<e.total,this._couldDeselectAll=e.selectedCount===e.total,this._selectedList=e.selectedFiles??[],this._showDoneBtn=e.total>0;}_handleIframeLoad(){this._applyEmbedCss(this.cfg.externalSourcesEmbedCss),this._applyTheme(),this._setupL10n();}_applyTheme(){this._messageBridge?.send({type:"set-theme-definition",theme:Zt(this)});}_applyEmbedCss(e){this._messageBridge?.send({type:"set-embed-css",css:e});}_setupL10n(){this._messageBridge?.send({type:"set-locale-definition",localeDefinition:this.cfg.localeName});}_remoteUrl(){let{pubkey:e,remoteTabSessionKey:t,socialBaseUrl:i,multiple:a}=this.cfg,{externalSourceType:s}=this.activityParams,l=Fi[s]??s,u={lang:this.l10n("social-source-lang")?.split("-")?.[0]||"en",public_key:e,images_only:"false",session_key:t,wait_for_theme:true,multiple:a.toString(),origin:this.cfg.topLevelOrigin||zt(),debug:this.cfg.debug},p=new URL(`/window4/${l}`,i);return p.search=Wt(u),p.toString()}_setSelectionSummary(e,t){this._latestSelectionSummary={selectedCount:e,total:t};}_mountIframe(){let e=document.createElement("iframe");e.src=this._remoteUrl(),e.marginHeight=0,e.marginWidth=0,e.frameBorder="0",e.allowTransparency=true,e.addEventListener("load",this._handleIframeLoad.bind(this)),e.addEventListener("load",this._handleIframeLoad.bind(this)),this._iframeRef.value&&(this._iframeRef.value.innerHTML="",this._iframeRef.value.appendChild(e)),e.contentWindow&&(this._messageBridge?.destroy(),this._messageBridge=new Me(e.contentWindow,()=>this.cfg.socialBaseUrl),this._messageBridge.on("selected-files-change",this._handleSelectedFilesChange.bind(this)),this._messageBridge.on("toolbar-state-change",this._handleToolbarStateChange.bind(this)),this._resetSelectionStatus());}_unmountIframe(){this._messageBridge?.destroy(),this._messageBridge=void 0,this._iframeRef.value&&(this._iframeRef.value.innerHTML=""),this._resetSelectionStatus();}_resetSelectionStatus(){this._selectedList=[],this._isSelectionReady=false,this._isDoneBtnEnabled=false,this._couldSelectAll=false,this._couldDeselectAll=false,this._showSelectionStatus=false,this._showDoneBtn=false,this._doneBtnTextClass="uc-hidden",this._latestSelectionSummary=null;}disconnectedCallback(){super.disconnectedCallback(),this._unmountIframe();}render(){return b`<uc-activity-header><button type="button" class="uc-mini-btn uc-close-btn" @click=${this.$["*historyBack"]} title=${this.l10n("a11y-activity-header-button-close")} aria-label=${this.l10n("a11y-activity-header-button-close")} ><uc-icon name="close"></uc-icon></button></uc-activity-header><div class="uc-content"><div ${ga(this._iframeRef)} class="uc-iframe-wrapper"></div><div class="uc-toolbar" ?hidden=${!this._toolbarVisible}><button type="button" class="uc-cancel-btn uc-secondary-btn" @click=${this._handleCancel}>${this.l10n("cancel")}</button><div class="uc-selection-status-box" ?hidden=${!this._showSelectionStatus}><span>${this._counterText}</span><button type="button" @click=${this._handleSelectAll} ?hidden=${!this._couldSelectAll}>${this.l10n("select-all")}</button><button type="button" @click=${this._handleDeselectAll} ?hidden=${!this._couldDeselectAll}>${this.l10n("deselect-all")}</button></div><button type="button" class="uc-done-btn uc-primary-btn" @click=${this._handleDone} ?disabled=${!this._isDoneBtnEnabled} ?hidden=${!this._showDoneBtn} ><uc-spinner ?hidden=${this._isSelectionReady}></uc-spinner><span class=${this._doneBtnTextClass}>${this.l10n("done")}</span></button></div></div>`}};a([j()],U.prototype,"_selectedList",2),a([j()],U.prototype,"_isSelectionReady",2),a([j()],U.prototype,"_isDoneBtnEnabled",2),a([j()],U.prototype,"_couldSelectAll",2),a([j()],U.prototype,"_couldDeselectAll",2),a([j()],U.prototype,"_showSelectionStatus",2),a([j()],U.prototype,"_showDoneBtn",2),a([j()],U.prototype,"_doneBtnTextClass",2),a([j()],U.prototype,"_toolbarVisible",2);var ce=class extends g$1{constructor(){super(...arguments);this.couldBeCtxOwner=true;this.dropzone=true;this._buttonTextKey="upload-file";this._handleClick=()=>{this.api.initFlow();};}static{this.styleAttrs=[...super.styleAttrs,"uc-simple-btn"];}initCallback(){super.initCallback(),this.subConfigValue("multiple",e=>{this._buttonTextKey=e?"upload-files":"upload-file";});}render(){return b`<uc-drop-area .disabled=${!this.dropzone}><button type="button" @click=${this._handleClick}><uc-icon name="upload"></uc-icon><span>${this.l10n(this._buttonTextKey)}</span>${this.yield("")}<div class="uc-visual-drop-area">${this.l10n("drop-files-here")}</div></button></uc-drop-area>`}};a([i({attribute:"dropzone",type:Boolean})],ce.prototype,"dropzone",2),a([j()],ce.prototype,"_buttonTextKey",2);var de=class extends f$1{constructor(){super(...arguments);this.activityType=null;this._containerRef=fa();}initCallback(){this.activityType=this.registration?.id??null,super.initCallback(),this._ensureRegistered();}willUpdate(e){super.willUpdate(e),e.has("registration")&&(this._ensureRegistered(),this.isActivityActive&&(this._disposeActivity(),this._renderActivity()));}_ensureRegistered(){this.registration&&(this._isActivityRegistered()||this.registerActivity(this.activityType??"",{onActivate:()=>this._renderActivity(),onDeactivate:()=>this._disposeActivity()}));}_renderActivity(){let e=this._containerRef.value;if(!e||!this.registration)return;this._disposeActivity();let t=this.$["*currentActivityParams"];this._dispose=this.registration.render(e,t)??void 0;}_disposeActivity(){this._dispose?.(),this._dispose=void 0;let e=this._containerRef.value;e&&e.replaceChildren();}disconnectedCallback(){this._disposeActivity(),super.disconnectedCallback();}render(){return b`<div style="display: contents;" ${ga(this._containerRef)}></div>`}};a([i({attribute:false})],de.prototype,"registration",2);var ie=class extends R$1{constructor(){super(...arguments);this.mode="modal";this._activities=[];}initCallback(){super.initCallback();let e=this._sharedInstancesBag.pluginManager;e?.onPluginsChange&&(this._unsubscribePlugins=e.onPluginsChange(()=>this._syncActivities())),this._syncActivities();}_syncActivities(){let e=this._sharedInstancesBag.pluginManager;if(!e){this._activities=[];return}this._activities=e.snapshot().activities;}disconnectedCallback(){this._unsubscribePlugins?.(),this._unsubscribePlugins=void 0,super.disconnectedCallback();}render(){return this.mode==="inline"?b`${ne(this._activities,e=>e.id,e=>b`<uc-plugin-activity-host .registration=${e}></uc-plugin-activity-host>`)}`:b`${ne(this._activities,e=>e.id,e=>b`<uc-modal id=${e.id} strokes block-body-scrolling><uc-plugin-activity-host .registration=${e}></uc-plugin-activity-host></uc-modal>`)}`}};a([i({type:String})],ie.prototype,"mode",2),a([j()],ie.prototype,"_activities",2);var Se=class extends B{constructor(){super();this.headless=false;this.init$={...this.init$,"*solution":this.tagName};}static{this.styleAttrs=[...super.styleAttrs,"uc-file-uploader-regular"];}initCallback(){super.initCallback(),this.telemetryManager.sendEvent({eventType:K.INIT_SOLUTION});}render(){return b` ${super.render()}<uc-simple-btn ?hidden=${this.headless}></uc-simple-btn><uc-modal id="start-from" strokes block-body-scrolling><uc-start-from><uc-drop-area with-icon clickable></uc-drop-area><uc-source-list role="list" wrap></uc-source-list><button type="button" class="uc-secondary-btn" @click=${this.$["*historyBack"]}>${this.l10n("start-from-cancel")}</button><uc-copyright></uc-copyright></uc-start-from></uc-modal><uc-modal id="upload-list" strokes block-body-scrolling><uc-upload-list></uc-upload-list></uc-modal><uc-modal id="camera" strokes block-body-scrolling><uc-camera-source></uc-camera-source></uc-modal><uc-modal id="url" strokes block-body-scrolling><uc-url-source></uc-url-source></uc-modal><uc-modal id="external" strokes block-body-scrolling><uc-external-source></uc-external-source></uc-modal><uc-plugin-activity-renderer mode="modal"></uc-plugin-activity-renderer>`}};a([i({type:Boolean})],Se.prototype,"headless",2);var Ie=class extends B{constructor(){super();this._couldCancel=false;this._handleCancel=()=>{if(this._couldHistoryBack){let e=this.$["*historyBack"];e?.();return}this._couldShowList&&(this.$["*currentActivity"]=f$1.activities.UPLOAD_LIST);};this.init$={...this.init$,"*solution":this.tagName};}static{this.styleAttrs=[...super.styleAttrs,"uc-file-uploader-inline"];}get _couldHistoryBack(){let e=this.$["*history"];return !e||e.length<=1?false:e[e.length-1]!==f$1.activities.START_FROM}get _couldShowList(){let e=this.$["*uploadList"];return this.cfg.showEmptyList||Array.isArray(e)&&e.length>0}_getInitActivity(){return this.getCssData("--cfg-init-activity")||f$1.activities.START_FROM}initCallback(){super.initCallback(),this.telemetryManager.sendEvent({eventType:K.INIT_SOLUTION});let e=this._getInitActivity();this.sub("*currentActivity",t=>{t||(this.$["*currentActivity"]=e);}),this.sub("*uploadList",t=>{Array.isArray(t)&&t.length>0&&this.$["*currentActivity"]===e&&(this.$["*currentActivity"]=f$1.activities.UPLOAD_LIST);}),this.sub("*history",()=>{this._couldCancel=this._couldHistoryBack||this._couldShowList;});}render(){return b` ${super.render()}<uc-start-from><uc-drop-area with-icon clickable></uc-drop-area><uc-source-list role="list" wrap></uc-source-list><button type="button" class="uc-cancel-btn uc-secondary-btn" @click=${this._handleCancel} ?hidden=${!this._couldCancel} >${this.l10n("start-from-cancel")}</button><uc-copyright></uc-copyright></uc-start-from><uc-upload-list></uc-upload-list><uc-camera-source></uc-camera-source><uc-url-source></uc-url-source><uc-external-source></uc-external-source><uc-plugin-activity-renderer mode="inline"></uc-plugin-activity-renderer>`}};a([j()],Ie.prototype,"_couldCancel",2);var tt="active",Le="",W=class extends B{constructor(){super();this._singleUpload=false;this._isHiddenStartFrom=false;this._classUploadList=Le;this._classStartFrom=Le;this._handleModalOpen=e=>{e.id===f$1.activities.CLOUD_IMG_EDIT&&(this._classUploadList=tt),this.$["*currentActivity"]===f$1.activities.UPLOAD_LIST&&(this._classUploadList=tt,this._isHiddenStartFrom=true);let t=this.$["*uploadList"];(!t||t.length<=0)&&(this._classStartFrom=tt);};this._handleModalClose=e=>{e.id===this.$["*currentActivity"]&&(this.$["*currentActivity"]=f$1.activities.UPLOAD_LIST,this._isHiddenStartFrom=false),e.id===f$1.activities.CLOUD_IMG_EDIT&&(this.$["*currentActivity"]=f$1.activities.UPLOAD_LIST);};this.init$={...this.init$,"*solution":this.tagName};}static{this.styleAttrs=[...super.styleAttrs,"uc-file-uploader-minimal"];}_getInitActivity(){return this.getCssData("--cfg-init-activity")||f$1.activities.START_FROM}initCallback(){super.initCallback(),this.telemetryManager.sendEvent({eventType:K.INIT_SOLUTION});let e=this._getInitActivity();this.sub("*currentActivity",t=>{t===f$1.activities.UPLOAD_LIST&&this.modalManager?.closeAll(),t||(this.$["*currentActivity"]=e);}),this.sub("*uploadList",t=>{Array.isArray(t)&&t.length>0?(this.$["*currentActivity"]=f$1.activities.UPLOAD_LIST,this._classStartFrom=Le):(this._classUploadList=Le,this._isHiddenStartFrom=false,this.$["*currentActivity"]=e);}),this.subConfigValue("confirmUpload",t=>{t!==false&&(this.cfg.confirmUpload=false);}),this.subConfigValue("filesViewMode",t=>{this.setAttribute("mode",t),this.subConfigValue("multiple",i=>{t==="grid"?(i?this.style.removeProperty("--uc-grid-col"):this.style.setProperty("--uc-grid-col","1"),this._singleUpload=!i):(this.style.removeProperty("--uc-grid-col"),this._singleUpload=false);});}),this.modalManager?.subscribe(y.OPEN,this._handleModalOpen),this.modalManager?.subscribe(y.CLOSE,this._handleModalClose);}disconnectedCallback(){super.disconnectedCallback(),this.modalManager?.unsubscribe(y.OPEN,this._handleModalOpen),this.modalManager?.unsubscribe(y.CLOSE,this._handleModalClose);}render(){return b` ${super.render()}<uc-start-from ?hidden=${this._isHiddenStartFrom} class=${this._classStartFrom}><uc-drop-area ?single=${this._singleUpload} initflow clickable tabindex="0" ><span>${this.l10n("choose-file")}</span></uc-drop-area><uc-copyright></uc-copyright></uc-start-from><uc-upload-list class=${this._classUploadList}></uc-upload-list><uc-modal id="start-from" strokes block-body-scrolling><uc-start-from><uc-drop-area with-icon clickable></uc-drop-area><uc-source-list role="list" wrap></uc-source-list><button type="button" class="uc-secondary-btn" @click=${this.$["*historyBack"]} >${this.l10n("start-from-cancel")}</button></uc-start-from></uc-modal><uc-modal id="camera" strokes block-body-scrolling><uc-camera-source></uc-camera-source></uc-modal><uc-modal id="url" strokes block-body-scrolling><uc-url-source></uc-url-source></uc-modal><uc-modal id="external" strokes block-body-scrolling><uc-external-source></uc-external-source></uc-modal><uc-plugin-activity-renderer mode="modal"></uc-plugin-activity-renderer>`}};a([j()],W.prototype,"_singleUpload",2),a([j()],W.prototype,"_isHiddenStartFrom",2),a([j()],W.prototype,"_classUploadList",2),a([j()],W.prototype,"_classStartFrom",2);/*! For license information please see core.js.LEGAL.txt */
|
|
8
|
+
export{qe as ActivityHeader,Ue as BaseComponent,x as CameraSource,je as Copyright,$ as DropArea,U as ExternalSource,Ye as FileItem,Ie as FileUploaderInline,W as FileUploaderMinimal,Se as FileUploaderRegular,xe as FormInput,Ne as Img,ae as Modal,de as PluginActivityHost,ie as PluginActivityRenderer,Y as ProgressBar,oe as ProgressBarCommon,X as Select,ce as SimpleBtn,B as SolutionBlock,J as SourceBtn,se as SourceList,Ze as Spinner,Ge as StartFrom,te as Thumb,Ke as UploadCtxProvider,R as UploadList,Te as UrlSource,ti as loadFileUploaderFrom};
|