@ckeditor/ckeditor5-uploadcare 0.0.0-nightly-next-20251217.0 → 0.0.0-nightly-20251218.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/build/uploadcare.js +1 -1
  2. package/dist/index.js +3 -3
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/be.js +1 -1
  12. package/dist/translations/be.umd.js +1 -1
  13. package/dist/translations/bg.js +1 -1
  14. package/dist/translations/bg.umd.js +1 -1
  15. package/dist/translations/bn.js +1 -1
  16. package/dist/translations/bn.umd.js +1 -1
  17. package/dist/translations/bs.js +1 -1
  18. package/dist/translations/bs.umd.js +1 -1
  19. package/dist/translations/ca.js +1 -1
  20. package/dist/translations/ca.umd.js +1 -1
  21. package/dist/translations/cs.js +1 -1
  22. package/dist/translations/cs.umd.js +1 -1
  23. package/dist/translations/da.js +1 -1
  24. package/dist/translations/da.umd.js +1 -1
  25. package/dist/translations/de-ch.js +1 -1
  26. package/dist/translations/de-ch.umd.js +1 -1
  27. package/dist/translations/de.js +1 -1
  28. package/dist/translations/de.umd.js +1 -1
  29. package/dist/translations/el.js +1 -1
  30. package/dist/translations/el.umd.js +1 -1
  31. package/dist/translations/en-au.js +1 -1
  32. package/dist/translations/en-au.umd.js +1 -1
  33. package/dist/translations/en-gb.js +1 -1
  34. package/dist/translations/en-gb.umd.js +1 -1
  35. package/dist/translations/en.js +1 -1
  36. package/dist/translations/en.umd.js +1 -1
  37. package/dist/translations/eo.js +1 -1
  38. package/dist/translations/eo.umd.js +1 -1
  39. package/dist/translations/es-co.js +1 -1
  40. package/dist/translations/es-co.umd.js +1 -1
  41. package/dist/translations/es.js +1 -1
  42. package/dist/translations/es.umd.js +1 -1
  43. package/dist/translations/et.js +1 -1
  44. package/dist/translations/et.umd.js +1 -1
  45. package/dist/translations/eu.js +1 -1
  46. package/dist/translations/eu.umd.js +1 -1
  47. package/dist/translations/fa.js +1 -1
  48. package/dist/translations/fa.umd.js +1 -1
  49. package/dist/translations/fi.js +1 -1
  50. package/dist/translations/fi.umd.js +1 -1
  51. package/dist/translations/fr.js +1 -1
  52. package/dist/translations/fr.umd.js +1 -1
  53. package/dist/translations/gl.js +1 -1
  54. package/dist/translations/gl.umd.js +1 -1
  55. package/dist/translations/gu.js +1 -1
  56. package/dist/translations/gu.umd.js +1 -1
  57. package/dist/translations/he.js +1 -1
  58. package/dist/translations/he.umd.js +1 -1
  59. package/dist/translations/hi.js +1 -1
  60. package/dist/translations/hi.umd.js +1 -1
  61. package/dist/translations/hr.js +1 -1
  62. package/dist/translations/hr.umd.js +1 -1
  63. package/dist/translations/hu.js +1 -1
  64. package/dist/translations/hu.umd.js +1 -1
  65. package/dist/translations/hy.js +1 -1
  66. package/dist/translations/hy.umd.js +1 -1
  67. package/dist/translations/id.js +1 -1
  68. package/dist/translations/id.umd.js +1 -1
  69. package/dist/translations/it.js +1 -1
  70. package/dist/translations/it.umd.js +1 -1
  71. package/dist/translations/ja.js +1 -1
  72. package/dist/translations/ja.umd.js +1 -1
  73. package/dist/translations/jv.js +1 -1
  74. package/dist/translations/jv.umd.js +1 -1
  75. package/dist/translations/kk.js +1 -1
  76. package/dist/translations/kk.umd.js +1 -1
  77. package/dist/translations/km.js +1 -1
  78. package/dist/translations/km.umd.js +1 -1
  79. package/dist/translations/kn.js +1 -1
  80. package/dist/translations/kn.umd.js +1 -1
  81. package/dist/translations/ko.js +1 -1
  82. package/dist/translations/ko.umd.js +1 -1
  83. package/dist/translations/ku.js +1 -1
  84. package/dist/translations/ku.umd.js +1 -1
  85. package/dist/translations/lt.js +1 -1
  86. package/dist/translations/lt.umd.js +1 -1
  87. package/dist/translations/lv.js +1 -1
  88. package/dist/translations/lv.umd.js +1 -1
  89. package/dist/translations/ms.js +1 -1
  90. package/dist/translations/ms.umd.js +1 -1
  91. package/dist/translations/nb.js +1 -1
  92. package/dist/translations/nb.umd.js +1 -1
  93. package/dist/translations/ne.js +1 -1
  94. package/dist/translations/ne.umd.js +1 -1
  95. package/dist/translations/nl.js +1 -1
  96. package/dist/translations/nl.umd.js +1 -1
  97. package/dist/translations/no.js +1 -1
  98. package/dist/translations/no.umd.js +1 -1
  99. package/dist/translations/oc.js +1 -1
  100. package/dist/translations/oc.umd.js +1 -1
  101. package/dist/translations/pl.js +1 -1
  102. package/dist/translations/pl.umd.js +1 -1
  103. package/dist/translations/pt-br.js +1 -1
  104. package/dist/translations/pt-br.umd.js +1 -1
  105. package/dist/translations/pt.js +1 -1
  106. package/dist/translations/pt.umd.js +1 -1
  107. package/dist/translations/ro.js +1 -1
  108. package/dist/translations/ro.umd.js +1 -1
  109. package/dist/translations/ru.js +1 -1
  110. package/dist/translations/ru.umd.js +1 -1
  111. package/dist/translations/si.js +1 -1
  112. package/dist/translations/si.umd.js +1 -1
  113. package/dist/translations/sk.js +1 -1
  114. package/dist/translations/sk.umd.js +1 -1
  115. package/dist/translations/sl.js +1 -1
  116. package/dist/translations/sl.umd.js +1 -1
  117. package/dist/translations/sq.js +1 -1
  118. package/dist/translations/sq.umd.js +1 -1
  119. package/dist/translations/sr-latn.js +1 -1
  120. package/dist/translations/sr-latn.umd.js +1 -1
  121. package/dist/translations/sr.js +1 -1
  122. package/dist/translations/sr.umd.js +1 -1
  123. package/dist/translations/sv.js +1 -1
  124. package/dist/translations/sv.umd.js +1 -1
  125. package/dist/translations/th.js +1 -1
  126. package/dist/translations/th.umd.js +1 -1
  127. package/dist/translations/ti.js +1 -1
  128. package/dist/translations/ti.umd.js +1 -1
  129. package/dist/translations/tk.js +1 -1
  130. package/dist/translations/tk.umd.js +1 -1
  131. package/dist/translations/tr.js +1 -1
  132. package/dist/translations/tr.umd.js +1 -1
  133. package/dist/translations/tt.js +1 -1
  134. package/dist/translations/tt.umd.js +1 -1
  135. package/dist/translations/ug.js +1 -1
  136. package/dist/translations/ug.umd.js +1 -1
  137. package/dist/translations/uk.js +1 -1
  138. package/dist/translations/uk.umd.js +1 -1
  139. package/dist/translations/ur.js +1 -1
  140. package/dist/translations/ur.umd.js +1 -1
  141. package/dist/translations/uz.js +1 -1
  142. package/dist/translations/uz.umd.js +1 -1
  143. package/dist/translations/vi.js +1 -1
  144. package/dist/translations/vi.umd.js +1 -1
  145. package/dist/translations/zh-cn.js +1 -1
  146. package/dist/translations/zh-cn.umd.js +1 -1
  147. package/dist/translations/zh.js +1 -1
  148. package/dist/translations/zh.umd.js +1 -1
  149. package/package.json +9 -9
  150. package/src/index.js +1 -1
  151. package/src/ui/uploadcarecontroller.js +2 -2
  152. package/src/ui/uploadcareformview.js +1 -1
  153. package/src/uploadcare.js +1 -1
  154. package/src/uploadcarecommand.js +1 -1
  155. package/src/uploadcareconfig.js +1 -1
  156. package/src/uploadcareediting.js +1 -1
  157. package/src/uploadcareimageedit/ui/uploadcareimageeditcontroller.js +2 -2
  158. package/src/uploadcareimageedit/ui/uploadcareimageeditformeditingview.js +1 -1
  159. package/src/uploadcareimageedit/ui/uploadcareimageeditformerrorview.js +1 -1
  160. package/src/uploadcareimageedit/ui/uploadcareimageeditformloadingview.js +1 -1
  161. package/src/uploadcareimageedit/ui/uploadcareimageeditformview.js +1 -1
  162. package/src/uploadcareimageedit/uploadcareimageeditcommand.js +1 -1
  163. package/src/uploadcareimageedit/uploadcareimageeditediting.js +1 -1
  164. package/src/uploadcareimageedit/uploadcareimageeditui.js +1 -1
  165. package/src/uploadcareimageedit/uploadcareimagereplacecommand.js +1 -1
  166. package/src/uploadcareimageedit.js +1 -1
  167. package/src/uploadcareui.js +1 -1
  168. package/src/uploadcareuploadadapter.js +1 -1
  169. package/src/utils/common-translations.js +1 -1
  170. package/src/utils/dialogfocusmanagerview.js +1 -1
  171. package/src/utils/editingutils.js +1 -1
  172. package/src/utils/isancestor.js +1 -1
  173. package/src/utils/uploadutils.js +1 -1
@@ -2,4 +2,4 @@
2
2
  /*!
3
3
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
4
4
  * For licensing, see LICENSE.md.
5
- */(()=>{var t={102:t=>{"use strict";var e={};t.exports=function(t,r){var i=function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(r)}},106:t=>{"use strict";t.exports=function(t){return t[1]}},123:t=>{"use strict";t.exports=function(t,e){Object.keys(e).forEach(function(r){t.setAttribute(r,e[r])})}},184:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var i=r(106),o=r.n(i),n=r(779),a=r.n(n)()(o());a.push([t.id,':root{--ck-image-processing-highlight-color:#f9fafa;--ck-image-processing-background-color:#e3e5e8}.ck.ck-editor__editable .image-inline.image-processing picture,.ck.ck-editor__editable .image.image-processing picture{display:block;height:100%;position:relative;width:100%}.ck.ck-editor__editable .image-inline.image-processing picture:before,.ck.ck-editor__editable .image.image-processing picture:before{animation:ck-image-processing-animation 2s linear infinite;background:linear-gradient(90deg,var(--ck-image-processing-background-color),var(--ck-image-processing-highlight-color),var(--ck-image-processing-background-color));background-size:200% 100%;content:"";height:100%;left:0;position:absolute;top:0;width:100%;z-index:1}.ck.ck-editor__editable .image-inline.image-processing picture img,.ck.ck-editor__editable .image.image-processing picture img{height:100%}.ck.ck-editor__editable .image-inline.image-processing-blur,.ck.ck-editor__editable .image.image-processing-blur{clip-path:inset(0);filter:blur(1.6rem)}@keyframes ck-image-processing-animation{0%{background-position:200% 0}to{background-position:-200% 0}}',""]);const s=a},237:t=>{"use strict";t.exports=CKEditor5.dll},260:(t,e,r)=>{t.exports=r(237)("./src/upload.js")},297:t=>{"use strict";var e,r=(e=[],function(t,r){return e[t]=r,e.filter(Boolean).join("\n")});function i(t,e,i,o){var n;if(i)n="";else{n="",o.supports&&(n+="@supports (".concat(o.supports,") {")),o.media&&(n+="@media ".concat(o.media," {"));var a=void 0!==o.layer;a&&(n+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),n+=o.css,a&&(n+="}"),o.media&&(n+="}"),o.supports&&(n+="}")}if(t.styleSheet)t.styleSheet.cssText=r(e,n);else{var s=document.createTextNode(n),c=t.childNodes;c[e]&&t.removeChild(c[e]),c.length?t.insertBefore(s,c[e]):t.appendChild(s)}}var o={singleton:null,singletonCounter:0};t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=o.singletonCounter++,r=o.singleton||(o.singleton=t.insertStyleElement(t));return{update:function(t){i(r,e,!1,t)},remove:function(t){i(r,e,!0,t)}}}},311:(t,e,r)=>{t.exports=r(237)("./src/ui.js")},355:(t,e,r)=>{t.exports=r(237)("./src/icons.js")},387:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var i=r(106),o=r.n(i),n=r(779),a=r.n(n)()(o());a.push([t.id,".ck-uploadcare-theme{--uc-font-size:13px;--uc-radius:2px;--uc-padding:0.9em;--uc-primary-oklch-light:54.45% 0.182 263.76;--uc-foreground-light:#333;--uc-secondary-foreground-light:#333;--uc-muted-foreground-light:#333;--uc-border-light:#ccced1}",""]);const s=a},474:t=>{"use strict";t.exports=function(t,e){return e||(e={}),t?(t=String(t.__esModule?t.default:t),/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]|(%20)/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t):t}},584:(t,e,r)=>{t.exports=r(237)("./src/utils.js")},621:(t,e,r)=>{"use strict";r.d(e,{A:()=>h});var i=r(106),o=r.n(i),n=r(779),a=r.n(n),s=r(474),c=r.n(s),l=new URL(r(659),r.b),u=a()(o()),d=c()(l);u.push([t.id,`@keyframes fake-progress-animation{0%{transform:translate(-100%)}to{transform:translate(calc(100/var(--l-fake-progress-width)*100*1%))}}@keyframes uc-spinner-keyframes{0%{transform:rotate(0)}to{transform:rotate(1turn)}}uc-activity-header:not(#\\#){color:var(--uc-foreground);display:flex;font-size:1em;font-weight:500;gap:var(--uc-padding);justify-content:space-between;padding:var(--uc-padding)}uc-activity-header:not(#\\#)>*{align-items:center;display:flex}uc-camera-source:not(#\\#){background-color:var(--uc-background);border-radius:var(--uc-radius);display:flex;flex-direction:column;height:100%;max-height:100%;overflow:hidden;position:relative;width:100%}[uc-modal]:not(#\\#)>dialog:has(uc-camera-source[active]){height:100%;width:100%}uc-camera-source:not(.uc-initialized):not(#\\#) .uc-controls{display:none}uc-camera-source:not(#\\#) video{background-color:var(--uc-muted);border-radius:var(--uc-radius);display:block;max-height:100%;object-fit:contain;object-position:center center;width:100%}uc-camera-source:not(#\\#) .uc-toolbar{background-color:var(--uc-background);bottom:0;display:flex;justify-content:space-between;padding:var(--uc-padding);position:absolute;width:100%}uc-camera-source:not(#\\#) .uc-content{display:flex;flex:1;height:100%;justify-content:center;overflow:hidden;padding:var(--uc-padding);padding-top:0;width:100%}uc-camera-source:not(#\\#) .uc-message-box{display:flex;flex-direction:column;grid-gap:40px;align-items:center;color:var(--uc-foreground);justify-content:center;padding:40px 40px 0}uc-camera-source:not(#\\#) .uc-message-box button{background-color:var(--uc-primary);color:var(--uc-primary-foreground)}uc-camera-source:not(#\\#) .uc-shot-btn{background-color:var(--uc-primary-light);border-radius:50%;color:var(--uc-background);height:58px;opacity:.85;transition:bottom var(--uc-transition),opacity var(--uc-transition),transform var(--uc-transition);width:58px}uc-camera-source:not(#\\#) .uc-shot-btn:hover{opacity:1;transform:scale(1.05)}uc-camera-source:not(#\\#) .uc-shot-btn:active{opacity:1;transform:scale(1)}uc-camera-source:not(#\\#) .uc-shot-btn[disabled]{bottom:-80px}uc-camera-source:not(#\\#) .uc-shot-btn uc-icon svg{height:20px;width:20px}uc-camera-source:not(#\\#) .uc-controls{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between;min-height:74px;padding:0 var(--uc-padding) var(--uc-padding);position:relative}uc-camera-source:not(#\\#) .uc-switcher{display:flex;gap:calc(var(--uc-padding)/2)}uc-camera-source:not(#\\#) .uc-switch.uc-active{background-color:var(--uc-secondary)}uc-camera-source:not(#\\#) .uc-camera-actions{align-items:center;display:flex;gap:5px;justify-content:center}uc-camera-source:not(#\\#) .uc-stop-record{background-color:var(--uc-destructive-foreground-light);opacity:1}:where(uc-camera-source:is(.uc-recording)):not(#\\#) .uc-recording-timer uc-icon{display:none}:where(uc-camera-source:is(.uc-recording)):not(#\\#) .uc-recording-timer{pointer-events:none}uc-camera-source:not(#\\#) .uc-recording-timer{overflow:hidden;position:relative;z-index:1}:where(uc-camera-source):not(#\\#) .uc-recording-timer uc-icon{height:10px;margin-right:10px;width:10px}uc-camera-source:not(#\\#) .uc-recording-timer .uc-line{background-color:var(--uc-foreground-light);bottom:0;content:"";height:2px;left:0;position:absolute;right:0;transform:scaleX(0);transform-origin:left;transition:transform var(--uc-transition)}uc-camera-source:not(#\\#) .uc-btn-microphone{z-index:1}uc-camera-source:not(#\\#) .uc-select{display:flex}uc-camera-source:not(#\\#) .uc-audio-select{width:98px}uc-camera-source:not(#\\#) .uc-audio-select select{width:100%}uc-camera-source:not(#\\#) .uc-camera-action{inset:0 var(--uc-padding) var(--uc-padding);margin:0 auto;position:absolute}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#){--color-primary-accent:var(--uc-primary);--color-text-base:var(--uc-foreground);--color-text-accent-contrast:var(--uc-background);--color-fill-contrast:var(--uc-background);--color-modal-backdrop:oklch(0 0 0/.1);--color-image-background:var(--uc-muted);--color-focus-ring:var(--color-primary-accent);--color-crop-guides:var(--uc-foreground);--font-size-ui:var(--uc-font-size);--size-touch-area:var(--uc-button-size);--size-panel-heading:calc(var(--uc-button-size) + var(--uc-padding)*2);--size-ui-min-width:130px;--size-line-width:1px;--size-modal-width:650px;--size-icon:calc(var(--uc-button-size)/2);--border-radius-editor:var(--uc-radius);--border-radius-thumb:var(--uc-radius);--border-radius-ui:var(--uc-radius);--border-radius-base:var(--uc-radius);--cldtr-gap-min:5px;--cldtr-gap-mid-1:10px;--cldtr-gap-mid-2:15px;--cldtr-gap-max:20px;--transition-duration-2:var(--transition-duration-all,.2s);--transition-duration-3:var(--transition-duration-all,.3s);--transition-duration-4:var(--transition-duration-all,.4s);--transition-duration-5:var(--transition-duration-all,.5s);--modal-header-opacity:1;--modal-header-height:var(--size-panel-heading);--modal-toolbar-height:var(--size-panel-heading);--transparent-pixel:url(${d});display:block;height:100%;max-height:100%;width:100%}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) :is([can-handle-paste]:hover,[can-handle-paste]:focus){--can-handle-paste:"true"}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) :is([tabindex][focus-visible],[tabindex]:hover,[with-effects][focus-visible],[with-effects]:hover){--filter-effect:var(--hover-filter)!important;--opacity-effect:var(--hover-opacity)!important;--color-effect:var(--hover-color-rgb)!important;--background-effect:var(--hover-background)!important}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) :is([tabindex]:active,[with-effects]:active){--filter-effect:var(--down-filter)!important;--opacity-effect:var(--down-opacity)!important;--color-effect:var(--down-color-rgb)!important;--background-effect:var(--down-background)!important}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) :is([tabindex][active],[with-effects][active]){--filter-effect:var(--active-filter)!important;--opacity-effect:var(--active-opacity)!important;--color-effect:var(--active-color-rgb)!important;--background-effect:var(--active-background)!important}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) [hidden-scrollbar]::-webkit-scrollbar{display:none}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) [hidden-scrollbar]{-ms-overflow-style:none;scrollbar-width:none}[uc-cloud-image-editor].uc-editor_ON:not(#\\#):not(#\\#):not(#\\#){--modal-header-opacity:0;--modal-header-height:0px;--modal-toolbar-height:calc(var(--size-panel-heading)*2)}[uc-cloud-image-editor].uc-editor_OFF:not(#\\#):not(#\\#):not(#\\#){--modal-header-opacity:1;--modal-header-height:var(--size-panel-heading);--modal-toolbar-height:var(--size-panel-heading)}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper{--l-min-img-height:var(--modal-toolbar-height);--l-max-img-height:100%;--l-edit-button-width:120px;--l-toolbar-horizontal-padding:var(--cldtr-gap-mid-1);display:grid;grid-template-rows:minmax(var(--l-min-img-height),var(--l-max-img-height)) minmax(var(--modal-toolbar-height),auto);height:100%;overflow:hidden;overflow-y:auto;position:relative}@media only screen and (max-width:800px){[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper{--l-edit-button-width:70px;--l-toolbar-horizontal-padding:var(--cldtr-gap-min)}}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport{align-items:center;display:flex;justify-content:center;overflow:hidden}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-image_container>.uc-image{--viewer-image-opacity:1;background-color:var(--color-image-background);box-sizing:border-box;display:block;height:100%;left:0;object-fit:scale-down;opacity:var(--viewer-image-opacity);pointer-events:auto;position:absolute;top:0;transform:scale(1);user-select:none;width:100%;z-index:10}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-image_container>.uc-image.uc-image_visible_viewer{transition:opacity var(--transition-duration-3) ease-in-out,transform var(--transition-duration-4)}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-image_container>.uc-image.uc-image_hidden_to_cropper{--viewer-image-opacity:0;background-image:var(--transparent-pixel);pointer-events:none;transform:scale(1);transition:transform var(--transition-duration-4),opacity var(--transition-duration-3) step-end}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-image_container>.uc-image.uc-image_hidden_effects{--viewer-image-opacity:0;pointer-events:none;transform:scale(1);transition:opacity var(--transition-duration-3) cubic-bezier(.5,0,1,1),transform var(--transition-duration-4)}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-image_container{background-color:var(--color-image-background);display:block;height:100%;position:relative;transition:var(--transition-duration-3);width:100%}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-toolbar{position:relative;transition:.3s}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-toolbar>.uc-toolbar_content{background-color:var(--color-fill-contrast);bottom:0;box-sizing:border-box;height:var(--modal-toolbar-height);left:0;min-height:var(--size-panel-heading);position:absolute;width:100%}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-toolbar>.uc-toolbar_content.uc-toolbar_content__viewer{align-items:center;display:flex;height:var(--size-panel-heading);justify-content:space-between;padding-left:var(--l-toolbar-horizontal-padding);padding-right:var(--l-toolbar-horizontal-padding)}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-toolbar>.uc-toolbar_content.uc-toolbar_content__editor{display:flex}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-info_pan{position:absolute;user-select:none}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-file_type_outer{display:flex;max-width:120px;position:absolute;transform:translate(-40px);user-select:none;z-index:2}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-file_type_outer>.uc-file_type{padding:4px .8em}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-network_problems_splash{background-color:var(--color-fill-contrast);display:flex;flex-direction:column;height:100%;position:absolute;width:100%;z-index:4}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-network_problems_splash>.uc-network_problems_content{align-items:center;display:flex;flex:1;flex-direction:column;justify-content:center}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-network_problems_splash>.uc-network_problems_content>.uc-network_problems_icon{align-items:center;background-color:var(--uc-muted);border-radius:50%;color:var(--uc-foreground);display:flex;height:40px;justify-content:center;width:40px}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-network_problems_splash>.uc-network_problems_content>.uc-network_problems_text{color:var(--uc-foreground);font-size:var(--font-size-ui);margin-top:var(--cldtr-gap-max)}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-network_problems_splash>.uc-network_problems_footer{align-items:center;display:flex;height:var(--size-panel-heading);justify-content:center}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#)>.uc-svg{border-top-left-radius:var(--border-radius-base);border-top-right-radius:var(--border-radius-base);height:100%;left:0;opacity:inherit;position:absolute;top:0;transition:var(--transition-duration-3);width:100%;z-index:2}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#)>.uc-thumb{--idle-color-rgb:var(--color-text-base);--hover-color-rgb:var(--color-primary-accent);--focus-color-rgb:var(--color-primary-accent);--down-color-rgb:var(--color-primary-accent);--color-effect:var(--idle-color-rgb);color:var(--color-effect);transition:color var(--transition-duration-3),opacity var(--transition-duration-3)}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-thumb--visible{opacity:1;pointer-events:auto}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-thumb--hidden{opacity:0;pointer-events:none}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-guides{transition:var(--transition-duration-3)}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-guides--hidden{opacity:0}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-guides--semi-hidden{opacity:.2}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-guides--visible{opacity:1}uc-editor-aspect-ratio-button-control:not(#\\#):not(#\\#):not(#\\#),uc-editor-button-control:not(#\\#):not(#\\#):not(#\\#),uc-editor-crop-button-control:not(#\\#):not(#\\#):not(#\\#),uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#),uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#),uc-editor-operation-control:not(#\\#):not(#\\#):not(#\\#){--l-base-min-width:var(--uc-button-size);--l-base-height:var(--uc-button-size);--opacity-effect:var(--idle-opacity);--color-effect:var(--idle-color-rgb);--background-effect:var(--idle-background);--filter-effect:var(--idle-filter);--idle-color-rgb:var(--uc-secondary-foreground);--idle-opacity:1;--idle-filter:1;--idle-background:var(--uc-secondary);--hover-color-rgb:var(--uc-secondary-foreground);--hover-opacity:1;--hover-filter:.8;--hover-background:var(--uc-secondary-hover);--down-color-rgb:var(--hover-color-rgb);--down-opacity:1;--down-filter:.6;--down-background:var(--uc-secondary);border-radius:var(--uc-radius)}uc-editor-aspect-ratio-button-control:not(#\\#):not(#\\#):not(#\\#)>button,uc-editor-button-control:not(#\\#):not(#\\#):not(#\\#)>button,uc-editor-crop-button-control:not(#\\#):not(#\\#):not(#\\#)>button,uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>button,uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button,uc-editor-operation-control:not(#\\#):not(#\\#):not(#\\#)>button{all:unset;align-items:center;color:var(--color-effect);cursor:pointer;display:grid;grid-template-columns:var(--l-base-min-width) auto;grid-template-rows:100%;height:var(--l-base-height);opacity:var(--opacity-effect);position:relative;transition:var(--l-width-transition)}uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button{grid-template-columns:auto var(--l-base-min-width)}uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button>uc-icon{margin-left:var(--cldtr-gap-mid-1);width:10px}:where(uc-editor-button-control,uc-editor-crop-button-control,uc-editor-aspect-ratio-button-control,uc-editor-freeform-button-control,uc-editor-filter-control,uc-editor-operation-control):not(#\\#):not(#\\#):not(#\\#)>uc-icon>svg{height:var(--size-icon);width:var(--size-icon)}uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>uc-icon.uc-original-icon>svg{height:100%;width:100%}uc-editor-aspect-ratio-button-control.uc-active:not(#\\#):not(#\\#):not(#\\#),uc-editor-button-control.uc-active:not(#\\#):not(#\\#):not(#\\#),uc-editor-crop-button-control.uc-active:not(#\\#):not(#\\#):not(#\\#),uc-editor-filter-control.uc-active:not(#\\#):not(#\\#):not(#\\#),uc-editor-freeform-button-control.uc-active:not(#\\#):not(#\\#):not(#\\#),uc-editor-operation-control.uc-active:not(#\\#):not(#\\#):not(#\\#){--idle-color-rgb:var(--uc-primary-foreground);--idle-background:var(--uc-primary);--idle-opacity:1;--hover-color-rgb:var(--uc-primary-foreground);--hover-background:var(--uc-primary);--hover-opacity:1}uc-editor-filter-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#) .uc-preview[loaded]{opacity:1}uc-editor-filter-control.uc-active:not(#\\#):not(#\\#):not(#\\#) .uc-preview{opacity:0}uc-editor-aspect-ratio-button-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#),uc-editor-button-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#),uc-editor-crop-button-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#),uc-editor-filter-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#),uc-editor-freeform-button-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#),uc-editor-operation-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#){--idle-color-rgb:var(--uc-secondary-foreground)}:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-aspect-ratio-button-control.uc-not_active,:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-button-control.uc-not_active,:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-crop-button-control.uc-not_active,:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-filter-control.uc-not_active,:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-freeform-button-control.uc-not_active,:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-operation-control.uc-not_active{--idle-background:transparent;--hover-background:var(--uc-secondary);outline:1px solid var(--uc-border);outline-offset:-1px}uc-editor-aspect-ratio-button-control:not(#\\#):not(#\\#):not(#\\#)>button:before,uc-editor-button-control:not(#\\#):not(#\\#):not(#\\#)>button:before,uc-editor-crop-button-control:not(#\\#):not(#\\#):not(#\\#)>button:before,uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>button:before,uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button:before,uc-editor-operation-control:not(#\\#):not(#\\#):not(#\\#)>button:before{background-color:var(--background-effect);border-radius:var(--border-radius-editor);content:"";height:100%;left:0;position:absolute;right:0;transition:var(--transition-duration-3);width:100%;z-index:-1}uc-editor-aspect-ratio-button-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title,uc-editor-button-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title,uc-editor-crop-button-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title,uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title,uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title,uc-editor-operation-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title{font-size:.7em;letter-spacing:1.004px;padding-right:var(--cldtr-gap-mid-1);text-transform:uppercase}uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title{padding-left:var(--cldtr-gap-mid-1);padding-right:0}uc-editor-aspect-ratio-button-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon,uc-editor-button-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon,uc-editor-crop-button-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon,uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon,uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon,uc-editor-operation-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon{pointer-events:none}uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-preview{background-repeat:no-repeat;background-size:contain;border-radius:var(--border-radius-editor);filter:brightness(var(--filter-effect));height:var(--l-base-height);left:0;opacity:0;position:absolute;right:0;transition:var(--transition-duration-3);width:100%;z-index:-1}uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>.uc-original-icon{color:var(--color-effect);opacity:.3}uc-editor-image-cropper:not(#\\#):not(#\\#):not(#\\#){color:var(--color-crop-guides);display:block;height:100%;left:0;opacity:0;pointer-events:none;position:absolute;top:0;touch-action:none;width:100%;z-index:10}uc-editor-image-cropper.uc-active_from_editor:not(#\\#):not(#\\#):not(#\\#),uc-editor-image-cropper.uc-active_from_viewer:not(#\\#):not(#\\#):not(#\\#){opacity:1;pointer-events:auto;transform:scale(1) translate(0);transition:transform var(--transition-duration-4) cubic-bezier(.37,0,.63,1) .4s,opacity var(--transition-duration-3)}uc-editor-image-cropper.uc-inactive_to_editor:not(#\\#):not(#\\#):not(#\\#){opacity:0;pointer-events:none;transition:transform var(--transition-duration-4) cubic-bezier(.37,0,.63,1),opacity var(--transition-duration-3) calc(var(--transition-duration-3) + .05s)}uc-editor-image-cropper:not(#\\#):not(#\\#):not(#\\#)>.uc-canvas{z-index:1}uc-editor-image-cropper:not(#\\#):not(#\\#):not(#\\#)>.uc-canvas,uc-editor-image-fader:not(#\\#):not(#\\#):not(#\\#){display:block;height:100%;left:0;position:absolute;top:0;width:100%}uc-editor-image-fader.uc-active_from_viewer:not(#\\#):not(#\\#):not(#\\#){opacity:1;pointer-events:auto;transform:scale(1);transition:transform var(--transition-duration-4),opacity var(--transition-duration-3) step-start;z-index:3}uc-editor-image-fader.uc-active_from_cropper:not(#\\#):not(#\\#):not(#\\#){opacity:1;pointer-events:auto;transform:scale(1);transition:transform var(--transition-duration-4),opacity var(--transition-duration-3) step-end;z-index:3}uc-editor-image-fader.uc-inactive_to_cropper:not(#\\#):not(#\\#):not(#\\#){opacity:0;pointer-events:none;transform:scale(1);transition:transform var(--transition-duration-4),opacity var(--transition-duration-3) step-end;z-index:3}uc-editor-image-fader:not(#\\#):not(#\\#):not(#\\#) .uc-fader-image{content-visibility:auto;display:block;height:100%;left:0;object-fit:scale-down;position:absolute;top:0;transform:scale(1);user-select:none;width:100%}uc-editor-image-fader:not(#\\#):not(#\\#):not(#\\#) .uc-fader-image--preview{background-color:var(--color-image-background);border-top-left-radius:var(--border-radius-base);border-top-right-radius:var(--border-radius-base);opacity:0;transform:scale(1);transition:var(--transition-duration-3)}uc-editor-scroller:not(#\\#):not(#\\#):not(#\\#){align-items:center;display:flex;height:100%;overflow-x:scroll;width:100%}uc-editor-slider:not(#\\#):not(#\\#):not(#\\#){align-items:center;display:flex;height:var(--size-panel-heading);justify-content:center;width:100%}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#){height:100%;position:relative;width:100%}@media only screen and (max-width:600px){uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#){--l-tab-gap:var(--cldtr-gap-mid-1);--l-slider-padding:var(--uc-padding);--l-controls-padding:var(--uc-padding)}}@media only screen and (min-width:601px){uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#){--l-tab-gap:var(--cldtr-gap-max);--l-slider-padding:var(--uc-padding);--l-controls-padding:var(--uc-padding)}}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container{height:100%;overflow:hidden;position:relative;width:100%}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar{background-color:var(--color-fill-contrast);display:grid;grid-template-rows:1fr 1fr;height:100%;position:absolute;transition:opacity var(--transition-duration-3) ease-in-out,transform var(--transition-duration-3) ease-in-out,visibility var(--transition-duration-3) ease-in-out;width:100%}.uc-sub-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-list-aspect-ratio-container>.uc-list-aspect-ratio{align-items:center;display:grid;gap:6px;grid-auto-flow:column;height:var(--size-panel-heading);justify-content:center}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar.uc-sub-toolbar--visible{opacity:1;pointer-events:auto;transform:translateY(0)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar.uc-sub-toolbar--top-hidden{opacity:0;pointer-events:none;transform:translateY(100%)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar.uc-sub-toolbar--bottom-hidden{opacity:0;pointer-events:none;transform:translateY(-100%)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row{align-items:center;display:flex;justify-content:space-between;padding-left:var(--l-controls-padding);padding-right:var(--l-controls-padding)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles{display:grid;grid-auto-flow:column;position:relative;grid-gap:0 var(--l-tab-gap);align-items:center;height:100%}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles>.uc-tab-toggles_indicator{background-color:var(--uc-secondary-foreground);bottom:0;height:2px;left:0;position:absolute;transform:translate(0);transition:transform var(--transition-duration-3);width:var(--size-touch-area)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row{position:relative}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content{content-visibility:auto;display:flex;height:100%;left:0;opacity:0;overflow:hidden;position:absolute;top:0;width:100%}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content.uc-tab-content--visible{opacity:1;pointer-events:auto}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content.uc-tab-content--hidden{opacity:0;pointer-events:none}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles>.uc-tab-toggle.uc-tab-toggle--visible{display:contents}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles.uc-tab-toggles--hidden,uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles>.uc-tab-toggle.uc-tab-toggle--hidden{display:none}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles>.uc-tab-toggle>uc-btn-ui{width:var(--uc-button-size)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles>.uc-tab-toggle>uc-btn-ui>uc-icon>svg{height:var(--size-icon);width:var(--size-icon)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content .uc-controls-list_align{box-sizing:border-box;display:grid;grid-template-areas:". inner .";grid-template-columns:1fr auto 1fr;min-width:100%;padding-left:var(--uc-padding)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content .uc-controls-list_inner{display:grid;gap:6px;grid-area:inner;grid-auto-flow:column}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content .uc-controls-list_inner:last-child{padding-right:var(--uc-padding)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-controls-list_last-item{margin-right:var(--cldtr-gap-max)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-info-tooltip_container{align-items:flex-start;display:flex;height:100%;justify-content:center;position:absolute;width:100%}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-info-tooltip_wrapper{display:flex;flex-direction:column;height:100%;justify-content:flex-end;pointer-events:none;position:absolute;top:calc(-100% - var(--cldtr-gap-mid-2))}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-info-tooltip{background-color:var(--color-text-accent-contrast);border-radius:var(--border-radius-editor);color:var(--color-text-base);font-size:.7em;letter-spacing:1px;opacity:0;padding:3px 6px;text-transform:uppercase;transform:translateY(100%);transition:var(--transition-duration-3);z-index:3}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-info-tooltip_visible{opacity:1;transform:translateY(0)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-slider{padding-left:var(--l-slider-padding);padding-right:var(--l-slider-padding)}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#)>button{--filter-effect:var(--idle-brightness);--opacity-effect:var(--idle-opacity);--color-effect:var(--idle-color-rgb);--background-effect:var(--idle-background);--l-transition-effect:var( --css-transition,color var(--transition-duration-2),background-color var(--transition-duration-2),filter var(--transition-duration-2) );all:unset;align-items:center;background-color:var(--background-effect);border-radius:var(--uc-radius);box-sizing:var(--css-box-sizing,border-box);color:var(--color-effect);cursor:pointer;display:inline-flex;filter:brightness(var(--filter-effect));font-size:1em;height:var(--css-height,var(--uc-button-size));opacity:var(--opacity-effect);padding-left:var(--css-padding-left,14px);padding-right:var(--css-padding-right,14px);transition:var(--l-transition-effect);user-select:none}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#)>button>uc-icon{pointer-events:none}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-text{white-space:nowrap}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-icon{align-items:center;color:var(--color-effect);display:flex;filter:brightness(var(--filter-effect));justify-content:center;transition:var(--l-transition-effect)}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-icon_left{margin-left:0;margin-right:var(--cldtr-gap-mid-1)}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-icon_right{margin-left:var(--cldtr-gap-mid-1);margin-right:0}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-icon_single{margin-left:0;margin-right:0}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-icon_hidden{display:none;margin:0}uc-btn-ui.uc-primary:not(#\\#):not(#\\#):not(#\\#)>button{--idle-color-rgb:var(--uc-primary-foreground);--idle-brightness:1;--idle-opacity:1;--idle-background:var(--uc-primary);--hover-color-rgb:var(--uc-primary-foreground);--hover-brightness:1;--hover-opacity:1;--hover-background:var(--uc-primary-hover);--down-color-rgb:var(--uc-primary-foreground);--down-brightness:.75;--down-opacity:1;--down-background:var(--uc-primary);--active-color-rgb:var(--uc-primary-foreground);--active-brightness:1;--active-opacity:1;--active-background:var(--uc-primary)}uc-btn-ui.uc-primary-icon:not(#\\#):not(#\\#):not(#\\#)>button{--idle-color-rgb:var(--uc-primary);--idle-brightness:1;--idle-opacity:1;--idle-background:transparent;--hover-color-rgb:var(--uc-primary);--hover-brightness:1;--hover-opacity:1;--hover-background:var(--uc-primary-transparent);--down-color-rgb:var(--uc-primary);--down-brightness:.75;--down-opacity:1;--down-background:var(--uc-primary-transparent);--active-color-rgb:var(--uc-primary-foreground);--active-brightness:1;--active-opacity:1;--active-background:var(--uc-primary);padding:0;width:var(--uc-button-size)}uc-btn-ui.uc-secondary:not(#\\#):not(#\\#):not(#\\#)>button{--idle-color-rgb:var(--uc-secondary-foreground);--idle-brightness:1;--idle-opacity:1;--idle-background:var(--uc-secondary);--hover-color-rgb:var(--uc-secondary-foreground);--hover-brightness:1;--hover-opacity:1;--hover-background:var(--uc-secondary-hover);--down-color-rgb:var(--uc-secondary-foreground);--down-brightness:1;--down-opacity:1;--down-background:var(--uc-secondary-hover);--active-color-rgb:var(--uc-secondary-foreground);--active-brightness:1;--active-opacity:1;--active-background:transparent}:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-btn-ui.uc-secondary>button{border:1px solid var(--uc-border)}uc-btn-ui.uc-secondary-icon:not(#\\#):not(#\\#):not(#\\#)>button,uc-btn-ui.uc-tab:not(#\\#):not(#\\#):not(#\\#)>button{--idle-color-rgb:var(--uc-secondary-foreground);--idle-brightness:1;--idle-opacity:1;--idle-background:transparent;--hover-color-rgb:var(--uc-secondary-foreground);--hover-brightness:1;--hover-opacity:1;--hover-background:var(--uc-secondary);--down-color-rgb:var(--uc-secondary-foreground);--down-brightness:1;--down-opacity:1;--down-background:var(--uc-secondary);--active-color-rgb:var(--uc-secondary-foreground);--active-brightness:1;--active-opacity:1;--active-background:transparent;padding:0;width:var(--uc-button-size)}uc-btn-ui.uc-default:not(#\\#):not(#\\#):not(#\\#)>button{--idle-color-rgb:var(--uc-secondary-foreground);--idle-brightness:1;--idle-opacity:1;--idle-background:var(--uc-secondary);--hover-color-rgb:var(--uc-secondary-foreground);--hover-brightness:1;--hover-opacity:1;--hover-background:var(--uc-secondary-hover);--down-color-rgb:var(--uc-secondary-foreground);--down-brightness:.75;--down-opacity:1;--down-background:var(--uc-secondary);--active-color-rgb:var(--uc-primary);--active-brightness:1;--active-opacity:1;--active-background:var(--uc-primary-transparent)}:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-btn-ui.uc-default>button{--idle-background:transparent;--hover-background:var(--uc-secondary);--active-background:var(--uc-foreground);--active-color-rgb:var(--uc-background)}uc-line-loader-ui:not(#\\#):not(#\\#):not(#\\#){height:2px;left:0;opacity:.5;position:absolute;top:0;width:100%;z-index:9999}uc-line-loader-ui:not(#\\#):not(#\\#):not(#\\#) .uc-inner{height:100%;max-width:200px;width:25%}uc-line-loader-ui:not(#\\#):not(#\\#):not(#\\#) .uc-line{background-color:var(--uc-primary);height:100%;transform:translate(-101%);transition:transform 1s;width:100%}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#){--l-thumb-size:24px;--l-zero-dot-size:5px;--l-zero-dot-offset:2px;--idle-color-rgb:var(--uc-foreground);--hover-color-rgb:var(--uc-primary);--down-color-rgb:var(--uc-primary);--color-effect:var(--idle-color-rgb);--l-color:var(--color-effect);align-items:center;display:flex;height:calc(var(--l-thumb-size) + (var(--l-zero-dot-size) + var(--l-zero-dot-offset))*2);justify-content:center;position:relative;width:100%}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-thumb{background-color:var(--l-color);border-radius:50%;height:var(--l-thumb-size);left:0;opacity:1;position:absolute;transform:translate(0);transition:opacity var(--transition-duration-2),background-color var(--transition-duration-2);width:var(--l-thumb-size)}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-steps{align-items:center;box-sizing:border-box;display:flex;height:100%;justify-content:space-between;padding-left:calc(var(--l-thumb-size)/2);padding-right:calc(var(--l-thumb-size)/2);position:absolute;width:100%}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-border-step{border-right:1px solid var(--uc-foreground);height:10px;opacity:1;transition:border-color var(--transition-duration-2);width:0}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-minor-step{border-right:1px solid var(--uc-foreground);height:4px;opacity:.6;transition:border-color var(--transition-duration-2);width:0}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-zero-dot{background-color:var(--color-primary-accent);border-radius:50%;height:var(--l-zero-dot-size);left:calc(var(--l-thumb-size)/2 - var(--l-zero-dot-size)/2);opacity:0;position:absolute;top:calc(100% - var(--l-zero-dot-offset)*2);transition:var(--transition-duration-3);width:var(--l-zero-dot-size)}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-input{cursor:pointer;height:100%;margin:0;opacity:0;position:absolute;width:calc(100% - 10px)}uc-presence-toggle.uc-transition:not(#\\#):not(#\\#):not(#\\#){transition:opacity var(--transition-duration-3),visibility var(--transition-duration-3)}uc-presence-toggle.uc-visible:not(#\\#):not(#\\#):not(#\\#){opacity:1;pointer-events:inherit}uc-presence-toggle.uc-hidden:not(#\\#):not(#\\#):not(#\\#){opacity:0;pointer-events:none}uc-presence-toggle.uc-initial:not(#\\#):not(#\\#):not(#\\#){display:none!important;transition:none!important}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) [role=button]:focus-visible,[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) button:focus-visible{outline:1px auto Highlight;outline:1px auto -webkit-focus-ring-color}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) .uc-cloud-mask{pointer-events:none}[uc-aspect-ratio-freeform]:not(#\\#):not(#\\#):not(#\\#) button{display:flex}[uc-aspect-ratio-freeform]:not(#\\#):not(#\\#):not(#\\#) uc-icon{display:none}[uc-aspect-ratio-freeform]:not(#\\#):not(#\\#):not(#\\#) .uc-title{padding-left:var(--cldtr-gap-mid-1)}:where(uc-editor-freeform-button-control,uc-editor-aspect-ratio-button-control:last-of-type):not(#\\#):not(#\\#):not(#\\#){margin-right:calc(var(--cldtr-gap-mid-1)*3)}:where([uc-cloud-image-editor]):not(#\\#):not(#\\#):not(#\\#) uc-icon{display:flex;height:100%;justify-content:center;width:100%}:where([uc-cloud-image-editor]):not(#\\#):not(#\\#):not(#\\#) uc-icon svg{height:calc(var(--uc-button-size)/2);width:calc(var(--uc-button-size)/2)}uc-cloud-image-editor-activity:not(#\\#){background-color:var(--uc-background);display:flex;height:100%;overflow:hidden;position:relative;width:100%}[uc-modal]:not(#\\#)>dialog:has(uc-cloud-image-editor-activity[active]){height:100%;width:100%}uc-config:not(#\\#){display:none}uc-copyright:not(#\\#){display:flex;justify-content:center;width:100%}uc-copyright:not(#\\#) .uc-credits{all:unset;background-color:var(--uc-background);border-radius:6px;bottom:12px;color:var(--uc-muted-foreground);cursor:pointer;font-size:12px;font-weight:400;opacity:.9;padding:2px 5px;position:absolute;transition:opacity var(--uc-transition),background-color var(--uc-transition)}uc-copyright:not(#\\#) .uc-credits:focus-visible{outline:1px auto Highlight;outline:1px auto -webkit-focus-ring-color}uc-copyright:not(#\\#) .uc-credits:hover{background-color:var(--uc-muted);opacity:1}:where([uc-drop-area]):not(#\\#){border:1px dashed var(--uc-border);border-radius:calc(var(--uc-radius)*1.75);overflow:hidden;padding:2px;transition:border var(--uc-transition),border-radius var(--uc-transition)}:where([uc-drop-area]):not(#\\#),:where([uc-drop-area]):not(#\\#) .uc-content-wrapper{align-items:center;display:flex;height:100%;justify-content:center;width:100%}:where([uc-drop-area]):not(#\\#) .uc-text{color:var(--uc-muted-foreground);margin:var(--uc-padding);position:relative;transition:color var(--uc-transition)}:where([uc-drop-area])[ghost][drag-state=inactive]:not(#\\#){display:none}:where([uc-drop-area])[ghost]:not([fullscreen]):is([drag-state=active],[drag-state=near],[drag-state=over]):not(#\\#){background:var(--uc-background)}:where([uc-drop-area]):is([drag-state=active],[drag-state=near],[drag-state=over],:hover):not(#\\#){background:var(--uc-primary-transparent);border-color:var(--uc-primary-transparent)}:where(.uc-contrast):not(#\\#) :where([uc-drop-area]):is([drag-state=active],[drag-state=near],[drag-state=over],:hover){background:transparent;border-color:var(--uc-foreground);border-style:solid;border-width:2px;color:var(--uc-foreground)}:where([uc-drop-area]):is([drag-state=active],[drag-state=near]):not(#\\#){opacity:1}:where([uc-drop-area])[drag-state=over]:not(#\\#){border-color:var(--uc-primary);opacity:1}:where([uc-drop-area])[with-icon]:not(#\\#){min-height:180px}:where([uc-drop-area])[with-icon]:not(#\\#) .uc-content-wrapper{display:flex;flex-direction:column}:where([uc-drop-area])[with-icon]:not(#\\#) .uc-text{color:var(--uc-foreground);font-size:1.1em;font-weight:500}:where([uc-drop-area])[with-icon]:not(#\\#) .uc-icon-container{background-color:var(--uc-muted);border-radius:50%;color:var(--uc-foreground);height:64px;margin:var(--uc-padding);overflow:hidden;position:relative;transition:color var(--uc-transition),background-color var(--uc-transition);width:64px}:where([uc-drop-area])[with-icon]:not(#\\#) uc-icon{height:32px;left:calc(50% - 16px);position:absolute;top:calc(50% - 16px);transition:transform var(--uc-transition);width:32px}:where([uc-drop-area])[with-icon]:not(#\\#) uc-icon:last-child{transform:translateY(48px)}:where(.uc-contrast):not(#\\#) :where([uc-drop-area])[with-icon]:hover .uc-icon-container,:where(.uc-contrast):not(#\\#) :where([uc-drop-area])[with-icon]:hover .uc-text{color:var(--uc-foreground)}:where([uc-drop-area])[with-icon]:hover:not(#\\#) .uc-icon-container{background-color:var(--uc-primary-transparent)}:where(.uc-contrast):not(#\\#) :where([uc-drop-area])[with-icon]:hover .uc-icon-container{background-color:var(--uc-muted)}:where([uc-drop-area])[with-icon]:not(#\\#)>.uc-content-wrapper:is([drag-state=active],[drag-state=near],[drag-state=over]) .uc-icon-container{background-color:var(--uc-primary);color:var(--uc-primary-foreground)}:where([uc-drop-area])[with-icon]:not(#\\#)>.uc-content-wrapper:is([drag-state=active],[drag-state=near],[drag-state=over]) .uc-text{color:var(--uc-foreground)}:where(.uc-contrast):not(#\\#) :where([uc-drop-area])[with-icon]>.uc-content-wrapper:is([drag-state=active],[drag-state=near],[drag-state=over]) .uc-text{color:var(--uc-foreground)}:where([uc-drop-area])[with-icon]:not(#\\#)>.uc-content-wrapper:is([drag-state=active],[drag-state=near],[drag-state=over]) uc-icon:first-child{transform:translateY(-48px)}:where([uc-drop-area])[with-icon]:not(#\\#)>.uc-content-wrapper:is([drag-state=active],[drag-state=near],[drag-state=over]) uc-icon:last-child{transform:translateY(0)}:where([uc-drop-area])[with-icon]:not(#\\#)>.uc-content-wrapper[drag-state=near] uc-icon:last-child{transform:scale(1.3)}:where([uc-drop-area])[with-icon]:not(#\\#)>.uc-content-wrapper[drag-state=over] uc-icon:last-child{transform:scale(1.5)}:where([uc-drop-area])[fullscreen]:not(#\\#){align-items:center;display:flex;height:calc(100vh - var(--uc-padding)*2);inset:0;justify-content:center;margin:var(--uc-padding);position:fixed;width:calc(100vw - var(--uc-padding)*2);z-index:2147483647}:where([uc-drop-area])[fullscreen]:not(#\\#) .uc-content-wrapper{background-color:var(--uc-background);border-radius:calc(var(--uc-radius)*1.75);box-shadow:var(--uc-dialog-shadow);color:var(--uc-foreground);height:180px;max-width:calc(var(--uc-dialog-width)*.8);transition:color var(--uc-transition),background-color var(--uc-transition),box-shadow var(--uc-transition),border-radius var(--uc-transition),transform var(--uc-transition);width:100%}:where([uc-drop-area])[with-icon][fullscreen][drag-state=active]:not(#\\#)>.uc-content-wrapper,:where([uc-drop-area])[with-icon][fullscreen][drag-state=near]:not(#\\#)>.uc-content-wrapper{opacity:0;transform:translateY(10px)}:where([uc-drop-area])[with-icon][fullscreen][drag-state=over]:not(#\\#)>.uc-content-wrapper{opacity:1;transform:translateY(0)}:is(:where([uc-drop-area])[with-icon][fullscreen]):not(#\\#)>.uc-content-wrapper uc-icon:first-child{transform:translateY(-48px)}:where([uc-drop-area])[clickable]:not(#\\#){cursor:pointer}uc-external-source:not(#\\#){background-color:var(--uc-background);display:flex;flex-direction:column;height:100%;overflow:hidden;position:relative;width:100%}[uc-modal]:not(#\\#)>dialog:has(uc-external-source[active]){height:100%;width:100%}uc-external-source:not(#\\#)>.uc-content{display:grid;flex:1;grid-template-rows:1fr min-content;position:relative}uc-external-source:not(#\\#) iframe{border:none;display:block;height:100%;width:100%}uc-external-source:not(#\\#) .uc-iframe-wrapper{overflow:hidden}uc-external-source:not(#\\#) .uc-toolbar{display:flex;width:100%;grid-gap:var(--uc-padding);align-items:center;border-top:1px solid var(--uc-border);justify-content:space-between;padding:var(--uc-padding)}uc-external-source:not(#\\#) .uc-back-btn{padding-left:0}uc-external-source:not(#\\#) .uc-selection-status-box{align-items:center;color:var(--uc-foreground);display:flex;flex-direction:column;justify-content:center}uc-external-source:not(#\\#) .uc-selection-status-box button{background:none;color:var(--uc-primary);height:auto;padding:0}uc-external-source:not(#\\#) .uc-selection-status-box button:hover{text-decoration:underline}uc-external-source:not(#\\#) uc-activity-header{justify-content:flex-end;left:0;pointer-events:none;position:absolute;right:0;top:0;width:100%;z-index:1}uc-external-source:not(#\\#) uc-activity-header .uc-close-btn{pointer-events:auto}uc-external-source:not(#\\#) .uc-done-btn>span.uc-hidden{pointer-events:none;visibility:hidden}uc-external-source:not(#\\#) .uc-done-btn>uc-spinner{align-items:center;display:flex;height:100%;justify-content:center;position:absolute;width:100%}uc-file-item:not(#\\#){--uc-file-item-gap:4px;--uc-file-item-height:calc(var(--uc-preview-size) + var(--uc-padding)*2 + var(--uc-file-item-gap));display:block;min-height:var(--uc-file-item-height);overflow:hidden}uc-file-item:last-of-type:not(#\\#){--uc-file-item-gap:0}uc-file-item:not(#\\#)>.uc-inner{align-items:center;background-color:var(--uc-muted);border-radius:var(--uc-radius);display:grid;font-size:.925em;gap:2px;grid-template-columns:var(--uc-preview-size) 1fr max-content;margin-bottom:var(--uc-file-item-gap);overflow:hidden;padding:var(--uc-padding);position:relative;transition:background-color var(--uc-transition)}uc-file-item:not(#\\#)>.uc-inner[focused]{background-color:transparent}uc-file-item:not(#\\#)>.uc-inner[uploading] .uc-edit-btn{display:none}uc-file-item:not(#\\#)>:where(.uc-inner[failed],.uc-inner[limit-overflow]){background-color:var(--uc-destructive)}uc-file-item:not(#\\#) .uc-thumb{background-color:var(--uc-secondary);background-position:50%;background-repeat:no-repeat;background-size:cover;border-radius:var(--uc-radius);display:inline-flex;height:var(--uc-preview-size);position:relative;width:var(--uc-preview-size)}uc-file-item:not(#\\#) .uc-file-name-wrapper{align-items:flex-start;color:var(--uc-muted-foreground);display:flex;flex-direction:column;justify-content:center;max-width:100%;overflow:hidden;padding-left:var(--uc-padding);padding-right:var(--uc-padding);text-align:left}uc-file-item:not(#\\#) .uc-file-name{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}uc-file-item:not(#\\#) .uc-file-error{color:var(--uc-destructive-foreground);display:none;font-size:.85em;z-index:2}uc-file-item:not(#\\#) button.uc-edit-btn,uc-file-item:not(#\\#) button.uc-remove-btn{color:var(--uc-muted-foreground)}uc-file-item:not(#\\#) button svg{pointer-events:none}uc-file-item:not(#\\#) button.uc-upload-btn{display:none}uc-file-item:not(#\\#) .uc-badge{align-items:center;background-color:var(--uc-foreground);border-radius:50%;bottom:2px;color:var(--uc-background);display:flex;height:14px;justify-content:center;opacity:0;position:absolute;right:2px;transform:scale(.3);transition:opacity var(--uc-transition),transform var(--uc-transition);width:14px}uc-file-item:not(#\\#)>.uc-inner:where([failed],[limit-overflow],[finished]) .uc-badge{opacity:1;transform:scale(1)}uc-file-item:not(#\\#)>.uc-inner:where([failed],[limit-overflow]) .uc-badge{background-color:var(--uc-destructive-foreground)}uc-file-item:not(#\\#)>.uc-inner:where([failed],[limit-overflow]) .uc-file-error{display:block}uc-file-item:not(#\\#) .uc-badge uc-icon,uc-file-item:not(#\\#) .uc-badge uc-icon svg{height:100%;width:100%}uc-file-item:not(#\\#) .uc-progress-bar{height:2px;opacity:.7;top:calc(100% - 2px)}:where(.uc-contrast):not(#\\#) uc-file-item .uc-progress-bar{opacity:1}uc-file-item:not(#\\#) .uc-file-actions{align-items:center;display:flex;gap:2px;justify-content:center}uc-file-item[mode=grid]:not(#\\#){min-height:auto;overflow:visible}uc-file-item[mode=grid]:not(#\\#) .uc-inner{background-color:transparent;border-radius:0;grid-template-columns:1fr;grid-template-rows:1fr max-content;height:100%;margin-bottom:0;padding:0}uc-file-item[mode=grid]:not(#\\#) .uc-inner[failed] .uc-badge{display:none}uc-file-item[mode=grid]:not(#\\#) .uc-thumb{height:100%;width:100%}uc-file-item[mode=grid]:not(#\\#) .uc-badge{bottom:var(--uc-padding);right:var(--uc-padding)}uc-file-item[mode=grid]:not(#\\#) .uc-file-name-wrapper{padding:0}uc-file-item[mode=grid]:not(#\\#) .uc-file-name:not([hidden])+.uc-file-error{bottom:calc(var(--uc-padding) + var(--uc-font-size))}uc-file-item[mode=grid]:not(#\\#) .uc-file-error{background-color:var(--uc-destructive-foreground);bottom:var(--uc-padding);color:var(--uc-background)}uc-file-item[mode=grid]:not(#\\#) .uc-file-error,uc-file-item[mode=grid]:not(#\\#) .uc-file-hint{border-radius:var(--uc-radius);left:var(--uc-padding);padding:calc(var(--uc-padding)/2) var(--uc-padding);position:absolute;right:var(--uc-padding)}uc-file-item[mode=grid]:not(#\\#) .uc-file-hint{background-color:var(--uc-background);bottom:calc(var(--uc-padding)*2);color:var(--uc-foreground)}uc-file-item[mode=grid]:not(#\\#) .uc-file-actions{position:absolute;right:var(--uc-padding);top:var(--uc-padding)}uc-file-item[mode=grid]:not(#\\#) button{background-color:var(--uc-background)}uc-file-item[mode=grid]:not(#\\#) button:hover{background-color:var(--uc-muted)}uc-file-item[mode=grid]:not(#\\#):not(#\\#):not(#\\#):not(#\\#):not(#\\#) .uc-progress-bar{height:4px!important;top:auto!important}uc-file-item[mode=grid]:not(#\\#) .uc-progress-bar{background-color:var(--uc-background);border-radius:var(--uc-radius);bottom:var(--uc-padding);left:var(--uc-padding);right:var(--uc-padding);transition:background-color .3s,opacity .3s;width:auto;z-index:1}uc-file-item[mode=grid]:not(#\\#) .uc-progress-bar :is(.uc-fake-progress,.uc-progress){background-color:var(--uc-primary)}uc-file-item[mode=grid]:not(#\\#) .uc-progress-bar[hasfilename]{bottom:calc(var(--uc-padding) + var(--uc-font-size))}uc-icon:not(#\\#){align-items:center;display:inline-flex;height:var(--uc-button-size);justify-content:center;width:var(--uc-button-size)}uc-icon:not(#\\#) svg{height:calc(var(--uc-button-size)/2);overflow:visible;width:calc(var(--uc-button-size)/2)}@supports selector(dialog::backdrop){:where([uc-modal]):not(#\\#)>dialog::backdrop{background-color:#0000001a}:where([uc-modal])[strokes]:not(#\\#)>dialog::backdrop{background-image:var(--modal-backdrop-background-image)}}:where([uc-modal]):not(#\\#)>dialog[open]{opacity:1;transform:translateY(0);visibility:visible}:where([uc-modal]):not(#\\#)>dialog:not([open]){opacity:0;transform:translateY(20px);visibility:hidden}:where([uc-modal]):not(#\\#)>dialog{background-color:var(--uc-background);border:0;border-radius:calc(var(--uc-radius)*1.75);box-shadow:var(--uc-dialog-shadow);display:flex;flex-direction:column;margin:auto;max-height:min(calc(100% - var(--uc-padding)*2),var(--uc-dialog-max-height));max-width:min(calc(100% - var(--uc-padding)*2),var(--uc-dialog-max-width));min-height:var(--uc-button-size);overflow:hidden;padding:0;transition:transform .4s ease,opacity .4s ease;width:min(var(--uc-dialog-width),100%)}:where(.uc-contrast):not(#\\#) :where([uc-modal])>dialog{outline:1px solid var(--uc-border)}uc-progress-bar:not(#\\#){--l-progress-value:0;bottom:0;height:100%;left:0;opacity:1;overflow:hidden;pointer-events:none;position:absolute;top:0;transition:opacity .3s;width:100%}uc-progress-bar.uc-progress-bar--hidden:not(#\\#){opacity:0}uc-progress-bar:not(#\\#) .uc-progress{background-color:var(--uc-primary);height:100%;opacity:1;position:absolute;transform:translate(0);transition:width .6s,opacity .3s;width:calc(var(--l-progress-value)*1%)}uc-progress-bar:not(#\\#) .uc-progress--hidden{opacity:0}uc-progress-bar:not(#\\#) .uc-fake-progress{--l-fake-progress-width:30;animation:fake-progress-animation 1s ease-in-out infinite;background-color:var(--uc-primary);height:100%;opacity:1;position:absolute;transition:opacity .3s;width:calc(var(--l-fake-progress-width)*1%);z-index:1}uc-progress-bar:not(#\\#) .uc-fake-progress--hidden{animation:none;opacity:0}uc-progress-bar-common:not(#\\#){background-color:var(--uc-background);bottom:0;display:block;height:10px;left:0;position:fixed;right:0;transition:opacity .3s;z-index:10000}uc-progress-bar-common:not([active]):not(#\\#){opacity:0;pointer-events:none}uc-select:not(#\\#){display:inline-flex}uc-select:not(#\\#) select{align-items:center;background-color:var(--uc-secondary);border:none;border-radius:var(--uc-radius);color:var(--uc-secondary-foreground);cursor:pointer;display:inline-flex;font-family:inherit;font-size:1em;height:var(--uc-button-size);justify-content:center;padding:0 14px;position:relative;transition:background-color var(--uc-transition);user-select:none;white-space:nowrap}:where([uc-simple-btn]):not(#\\#){display:inline-flex;position:relative}:where([uc-simple-btn]):not(#\\#) button{background-color:var(--uc-simple-btn);color:var(--uc-simple-btn-foreground);font-family:var(--uc-simple-btn-font-family);font-size:var(--uc-simple-btn-font-size);gap:.5em;height:auto;padding:var(--uc-simple-btn-padding)}:where([uc-simple-btn]):not(#\\#) button uc-icon{height:auto;width:auto}:where([uc-simple-btn]):not(#\\#) button uc-icon svg{height:.9em;width:.9em}:where([uc-simple-btn]):not(#\\#) button:hover{background-color:var(--uc-simple-btn-hover)}:where([uc-simple-btn]):not(#\\#)>uc-drop-area{display:contents}:where([uc-simple-btn]):not(#\\#) .uc-visual-drop-area{align-items:center;background-color:transparent;border:1px dashed var(--uc-simple-btn-foreground);border-radius:inherit;color:transparent;display:flex;font-size:var(--uc-simple-btn-font-size);height:100%;justify-content:center;left:0;opacity:0;padding:var(--uc-simple-btn-padding);position:absolute;top:0;transition:opacity var(--uc-transition);width:100%}:where([uc-simple-btn]):not(#\\#)>uc-drop-area[drag-state=active] .uc-visual-drop-area{opacity:1}:where([uc-simple-btn]):not(#\\#)>uc-drop-area[drag-state=inactive] .uc-visual-drop-area{opacity:0}:where([uc-simple-btn]):not(#\\#)>uc-drop-area[drag-state=near] .uc-visual-drop-area{opacity:1}:where([uc-simple-btn]):not(#\\#)>uc-drop-area[drag-state=over] .uc-visual-drop-area{opacity:1}uc-source-btn:not(#\\#)>button{align-items:center;background-color:unset;border-radius:var(--uc-radius);color:var(--uc-foreground);cursor:pointer;display:flex;height:unset;margin-bottom:2px;padding:2px var(--uc-padding);transition:background-color var(--uc-transition),color var(--uc-transition);user-select:none;width:100%}uc-source-btn:last-child:not(#\\#)>button{margin-bottom:0}uc-source-btn:not(#\\#)>button:hover{background-color:var(--uc-primary-transparent)}:where(.uc-contrast):not(#\\#) uc-source-btn>button:hover{background-color:var(--uc-secondary);color:var(--uc-foreground)}uc-source-btn:not(#\\#) uc-icon{display:inline-flex;flex-grow:1;justify-content:center;margin-right:var(--uc-padding);min-width:var(--uc-button-size);opacity:.8}:where(.uc-contrast):not(#\\#) uc-source-btn uc-icon{opacity:1}uc-source-btn:not(#\\#) .uc-txt{align-items:center;border:none;box-sizing:border-box;display:flex;height:var(--uc-button-size);padding:0;white-space:nowrap;width:100%}.uc-spinner:not(#\\#){animation:uc-spinner-keyframes .4s linear infinite;border-color:currentcolor transparent transparent currentcolor;border-radius:50%;border-style:solid;border-width:2px;height:1em;width:1em}uc-start-from:not(#\\#){display:block;overflow-y:auto}uc-start-from:not(#\\#) .uc-content{background-color:var(--uc-background);display:grid;gap:calc(var(--uc-padding)*2);grid-auto-flow:row;height:100%;padding:calc(var(--uc-padding)*2);width:100%}[uc-modal]:not(#\\#)>dialog:has(uc-start-from[active]){width:var(--uc-dialog-width)}[uc-modal]:not(#\\#) uc-start-from uc-drop-area{border-radius:var(--uc-radius)}@media only screen and (max-width:430px){[uc-modal]:not(#\\#) uc-start-from uc-drop-area{display:none}}uc-thumb:not(#\\#){height:100%;width:100%}uc-upload-list:not(#\\#){background-color:var(--uc-background);display:flex;flex-direction:column;height:max-content;overflow:hidden;position:relative;transition:opacity var(--uc-transition);width:100%}uc-upload-list:not(#\\#) .uc-no-files{height:32px;padding:20px}uc-upload-list:not(#\\#) .uc-files{display:block;flex:1;min-height:32px;overflow:auto;padding:0 var(--uc-padding)}uc-upload-list:not(#\\#) .uc-files-wrapper{display:contents}uc-upload-list:not(#\\#) .uc-toolbar{background-color:var(--uc-background);display:flex;gap:4px;justify-content:space-between;padding:var(--uc-padding)}uc-upload-list:not(#\\#) .uc-toolbar-spacer{flex:1}uc-upload-list:not(#\\#) uc-drop-area{border-radius:var(--uc-radius);height:calc(100% - var(--uc-padding)*2);left:0;margin:var(--uc-padding);position:absolute;top:0;width:calc(100% - var(--uc-padding)*2)}uc-upload-list:not(#\\#) uc-activity-header>.uc-header-text{padding:0 var(--uc-padding)}uc-upload-list:not(#\\#) .uc-common-error{align-items:center;background-color:var(--uc-destructive);border-radius:var(--uc-radius);color:var(--uc-destructive-foreground);display:flex;font-size:.925em;justify-content:center;margin:4px var(--uc-padding) 0 var(--uc-padding);padding:var(--uc-padding)}uc-upload-list:not(#\\#) .uc-add-more-btn uc-icon{display:none}uc-upload-list[mode=grid]:not(#\\#) .uc-files{display:flex;flex-wrap:wrap;gap:var(--uc-grid-gap)}uc-upload-list:not(#\\#) .uc-files .uc-add-more-btn,uc-upload-list[mode=grid]:not(#\\#) uc-file-item{aspect-ratio:var(--uc-grid-aspect-ratio);flex:0 0 calc((100% - var(--uc-grid-gap)*(var(--uc-grid-col) - 1))/var(--uc-grid-col));height:var(--uc-grid-preview-image-height);max-width:calc((100% - var(--uc-grid-gap)*(var(--uc-grid-col) - 1))/var(--uc-grid-col))}uc-upload-list:not(#\\#) .uc-files .uc-add-more-btn{display:none}uc-url-source:not(#\\#){background-color:var(--uc-background);display:block}uc-url-source:not(#\\#)>.uc-content{display:grid;grid-gap:4px;grid-template-columns:1fr min-content;padding:var(--uc-padding);padding-top:0}uc-url-source:not(#\\#) .uc-url-input{display:flex}[uc-file-uploader-inline]:not(#\\#):not(#\\#):not(#\\#) uc-start-from{container-type:inline-size;height:100%}[uc-file-uploader-inline]:not(#\\#):not(#\\#):not(#\\#){--cfg-done-activity:"start-from";--cfg-init-activity:"start-from";flex:1}[uc-file-uploader-inline]:not(#\\#):not(#\\#):not(#\\#) uc-activity-header:after{content:"";height:var(--uc-button-size);width:var(--uc-button-size)}[uc-file-uploader-inline]:not(#\\#):not(#\\#):not(#\\#) uc-activity-header .uc-close-btn{display:none}[uc-file-uploader-inline]:not(#\\#):not(#\\#):not(#\\#) uc-copyright .uc-credits{position:static}@container (min-width: 500px){[uc-file-uploader-inline]:not(#\\#):not(#\\#):not(#\\#) uc-start-from .uc-content{grid-template-columns:1fr max-content;height:100%}[uc-file-uploader-inline]:not(#\\#):not(#\\#):not(#\\#) uc-start-from uc-copyright{grid-column:2}[uc-file-uploader-inline]:not(#\\#):not(#\\#):not(#\\#) uc-start-from uc-drop-area{grid-row:span 3}[uc-file-uploader-inline]:not(#\\#):not(#\\#):not(#\\#) uc-start-from:has(uc-copyright[hidden]) uc-drop-area{grid-row:span 2}[uc-file-uploader-inline]:not(#\\#):not(#\\#):not(#\\#) uc-start-from:has(.uc-cancel-btn[hidden]) uc-drop-area{grid-row:span 2}[uc-file-uploader-inline]:not(#\\#):not(#\\#):not(#\\#) uc-start-from:has(uc-copyright[hidden]):has(.uc-cancel-btn[hidden]) uc-drop-area{grid-row:span 1}}:where([uc-file-uploader-minimal]):not(#\\#):not(#\\#):not(#\\#){--cfg-init-activity:"start-from";--cfg-done-activity:"upload-list";display:block;position:relative}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#)>uc-start-from .uc-content{align-items:center;background-color:transparent;display:flex;flex-direction:column;gap:4px;overflow:hidden;padding:0}:where([uc-file-uploader-minimal]>uc-start-from uc-drop-area):not(#\\#):not(#\\#):not(#\\#){align-items:center;background-color:var(--uc-muted);border-radius:calc(var(--uc-radius)*1.75);display:flex;justify-content:center;min-height:calc(var(--uc-preview-size) + var(--uc-padding)*2 + 8px);padding:0;position:relative;text-align:center;width:100%}:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) :where([uc-file-uploader-minimal]>uc-start-from uc-drop-area){background-color:transparent}:where([uc-file-uploader-minimal]>uc-start-from uc-drop-area):not(#\\#):not(#\\#):not(#\\#):before{background-color:var(--uc-background);content:"";height:100%;position:absolute;width:100%;z-index:-1}:where([uc-file-uploader-minimal]:has([single])>uc-start-from uc-drop-area):not(#\\#):not(#\\#):not(#\\#){aspect-ratio:var(--uc-grid-aspect-ratio)}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list uc-activity-header{display:none}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list>.uc-toolbar{background-color:transparent}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list{background-color:var(--uc-background);border:1px dashed var(--uc-border);border-radius:calc(var(--uc-radius)*1.75);height:unset;padding:4px;width:100%}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-files{padding:0}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-toolbar{display:block;padding:0}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-toolbar .uc-cancel-btn,[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-toolbar .uc-done-btn,[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-toolbar .uc-upload-btn{display:none}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-toolbar .uc-add-more-btn{height:calc(var(--uc-preview-size) + var(--uc-padding)*2);margin-top:4px;width:100%}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-toolbar .uc-add-more-btn>span,[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-toolbar .uc-add-more-btn[disabled]{display:none}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-toolbar .uc-add-more-btn>uc-icon{display:flex}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-file-item uc-progress-bar{height:100%!important;top:0!important}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-file-item uc-progress-bar .uc-fake-progress,[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-file-item uc-progress-bar .uc-progress{background-color:var(--uc-primary-transparent);border-radius:var(--uc-radius)}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list uc-drop-area{border-radius:calc(var(--uc-radius)*1.75);height:100%;margin:0;width:100%}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-common-error{margin:4px 0 0}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-copyright .uc-credits{position:static}[uc-file-uploader-minimal][mode=grid]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-toolbar .uc-add-more-btn{display:none}[uc-file-uploader-minimal][mode=grid]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-files .uc-add-more-btn{display:flex}[uc-file-uploader-minimal][mode=grid]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-files .uc-add-more-btn>span{display:none}[uc-file-uploader-minimal][mode=grid]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-files .uc-add-more-btn>uc-icon{display:flex}:where([uc-wgt-common]){--cfg-init-activity:"start-from";--cfg-done-activity:""}:where([uc-wgt-common]){--uc-font-family:system-ui;--uc-font-size:14px;--uc-line-height:normal;--uc-simple-btn-font-family:system-ui;--uc-simple-btn-font-size:14px;--uc-button-size:32px;--uc-preview-size:32px;--uc-padding:10px;--uc-radius:8px;--uc-transition:.2s ease;--uc-dialog-width:430px;--uc-dialog-max-width:920px;--uc-dialog-max-height:675px;--uc-simple-btn-padding:7px 14px;--uc-grid-col:3;--uc-grid-preview-image-height:auto;--uc-grid-gap:calc(var(--uc-padding)/2);--uc-grid-aspect-ratio:1/1;--uc-background:var(--uc-background-light);--uc-foreground:var(--uc-foreground-light);--uc-primary:var(--uc-primary-light);--uc-primary-hover:var(--uc-primary-hover-light);--uc-primary-transparent:var(--uc-primary-transparent-light);--uc-primary-foreground:var(--uc-primary-foreground-light);--uc-secondary:var(--uc-secondary-light);--uc-secondary-hover:var(--uc-secondary-hover-light);--uc-secondary-foreground:var(--uc-secondary-foreground-light);--uc-muted:var(--uc-muted-light);--uc-muted-foreground:var(--uc-muted-foreground-light);--uc-destructive:var(--uc-destructive-light);--uc-destructive-foreground:var(--uc-destructive-foreground-light);--uc-border:var(--uc-border-light);--uc-dialog-shadow:var(--uc-dialog-shadow-light);--uc-simple-btn:var(--uc-simple-btn-light);--uc-simple-btn-hover:var(--uc-simple-btn-hover-light);--uc-simple-btn-foreground:var(--uc-simple-btn-foreground-light)}@supports not (color:oklch(0% 0 0)){:where([uc-wgt-common]){--uc-primary-rgb-light:23 75 215;--uc-primary-light:rgb(var(--uc-primary-rgb-light));--uc-primary-hover-light:rgb(var(--uc-primary-rgb-light)/90%);--uc-primary-transparent-light:rgb(var(--uc-primary-rgb-light)/10%);--uc-background-light:#fff;--uc-foreground-light:#181818;--uc-primary-foreground-light:#fff;--uc-secondary-light:hsla(0,0%,9%,.05);--uc-secondary-hover-light:hsla(0,0%,9%,.08);--uc-secondary-foreground-light:#181818;--uc-muted-light:#f5f5f5;--uc-muted-foreground-light:#717171;--uc-destructive-light:rgb(232 19 20/5%);--uc-destructive-foreground-light:#e81314;--uc-border-light:#e4e4e8;--uc-dialog-shadow-light:0px 6px 20px rgba(0,0,0,.1);--uc-simple-btn-light:#ebebeb;--uc-simple-btn-hover-light:#e4e4e4;--uc-simple-btn-foreground-light:#181818;--uc-primary-rgb-dark:87 154 255;--uc-primary-dark:rgb(var(--uc-primary-rgb-dark));--uc-primary-hover-dark:rgb(var(--uc-primary-rgb-dark)/90%);--uc-primary-transparent-dark:rgb(var(--uc-primary-rgb-dark)/7%);--uc-background-dark:#1b1b1b;--uc-foreground-dark:#e1e1e1;--uc-primary-foreground-dark:#000;--uc-secondary-dark:hsla(0,0%,88%,.07);--uc-secondary-hover-dark:hsla(0,0%,88%,.1);--uc-secondary-foreground-dark:#e1e1e1;--uc-muted-dark:#242424;--uc-muted-foreground-dark:#989898;--uc-destructive-dark:rgba(244,90,79,.1);--uc-destructive-foreground-dark:#f45a4f;--uc-border-dark:#3d3d3d;--uc-dialog-shadow-dark:0px 6px 20px rgba(0,0,0,.25);--uc-simple-btn-dark:#242424;--uc-simple-btn-hover-dark:#2b2b2b;--uc-simple-btn-foreground-dark:#fff}}@supports (color:oklch(0% 0 0)){:where([uc-wgt-common]){--uc-primary-oklch-light:47% .22 264;--uc-primary-light:oklch(var(--uc-primary-oklch-light));--uc-primary-hover-light:oklch(var(--uc-primary-oklch-light)/90%);--uc-primary-transparent-light:oklch(var(--uc-primary-oklch-light)/7%);--uc-background-light:oklch(100% 0 0);--uc-foreground-light:oklch(21% 0 0);--uc-primary-foreground-light:oklch(100% 0 0);--uc-secondary-light:oklch(21% 0 0/.05);--uc-secondary-hover-light:oklch(21% 0 0/.08);--uc-secondary-foreground-light:oklch(21% 0 0);--uc-muted-light:oklch(97% 0 0);--uc-muted-foreground-light:oklch(40% 0 0);--uc-destructive-light:oklch(59% .235 28.5/.05);--uc-destructive-foreground-light:oklch(59% .235 28.5);--uc-border-light:oklch(92% 0 0);--uc-dialog-shadow-light:0px 6px 20px oklch(0% 0 0/.1);--uc-simple-btn-light:oklch(94% 0 0);--uc-simple-btn-hover-light:oklch(92% 0 0);--uc-simple-btn-foreground-light:oklch(20% 0 0);--uc-primary-oklch-dark:69% .1768 258.4;--uc-primary-dark:oklch(var(--uc-primary-oklch-dark));--uc-primary-hover-dark:oklch(var(--uc-primary-oklch-dark)/90%);--uc-primary-transparent-dark:oklch(var(--uc-primary-oklch-dark)/7%);--uc-background-dark:oklch(22% 0 0);--uc-foreground-dark:oklch(91% 0 0);--uc-primary-foreground-dark:oklch(0% 0 0);--uc-secondary-dark:oklch(91% 0 0/.07);--uc-secondary-hover-dark:oklch(91% 0 0/.1);--uc-secondary-foreground-dark:oklch(91% 0 0);--uc-muted-dark:oklch(26% 0 0);--uc-muted-foreground-dark:oklch(68% 0 0);--uc-destructive-dark:oklch(67% .191 27.5/.1);--uc-destructive-foreground-dark:oklch(67% .191 27.5);--uc-border-dark:oklch(36% 0 0);--uc-dialog-shadow-dark:0px 6px 20px oklch(0% 0 0/.25);--uc-simple-btn-dark:oklch(26% 0 0);--uc-simple-btn-hover-dark:oklch(29% 0 0);--uc-simple-btn-foreground-dark:oklch(100% 0 0)}}@media only screen and (max-height:600px){:where([uc-wgt-common]){--uc-dialog-max-height:100%}}@media only screen and (max-width:680px){:where([uc-wgt-common]){--uc-grid-col:2}}@media only screen and (max-width:430px){:where([uc-wgt-common]){--uc-dialog-max-width:100vw;--uc-dialog-max-height:var(--uploadcare-blocks-window-height);--uc-grid-col:1}}@media (prefers-color-scheme:light){:where([uc-wgt-common]){--uc-background:var(--uc-background-light);--uc-foreground:var(--uc-foreground-light);--uc-primary:var(--uc-primary-light);--uc-primary-hover:var(--uc-primary-hover-light);--uc-primary-transparent:var(--uc-primary-transparent-light);--uc-primary-foreground:var(--uc-primary-foreground-light);--uc-secondary:var(--uc-secondary-light);--uc-secondary-hover:var(--uc-secondary-hover-light);--uc-secondary-foreground:var(--uc-secondary-foreground-light);--uc-muted:var(--uc-muted-light);--uc-muted-foreground:var(--uc-muted-foreground-light);--uc-destructive:var(--uc-destructive-light);--uc-destructive-foreground:var(--uc-destructive-foreground-light);--uc-border:var(--uc-border-light);--uc-dialog-shadow:var(--uc-dialog-shadow-light);--uc-simple-btn:var(--uc-simple-btn-light);--uc-simple-btn-hover:var(--uc-simple-btn-hover-light);--uc-simple-btn-foreground:var(--uc-simple-btn-foreground-light)}}@media (prefers-color-scheme:dark){:where([uc-wgt-common]){--uc-background:var(--uc-background-dark);--uc-foreground:var(--uc-foreground-dark);--uc-primary:var(--uc-primary-dark);--uc-primary-hover:var(--uc-primary-hover-dark);--uc-primary-transparent:var(--uc-primary-transparent-dark);--uc-primary-foreground:var(--uc-primary-foreground-dark);--uc-secondary:var(--uc-secondary-dark);--uc-secondary-hover:var(--uc-secondary-hover-dark);--uc-secondary-foreground:var(--uc-secondary-foreground-dark);--uc-muted:var(--uc-muted-dark);--uc-muted-foreground:var(--uc-muted-foreground-dark);--uc-destructive:var(--uc-destructive-dark);--uc-destructive-foreground:var(--uc-destructive-foreground-dark);--uc-border:var(--uc-border-dark);--uc-dialog-shadow:var(--uc-dialog-shadow-dark);--uc-simple-btn:var(--uc-simple-btn-dark);--uc-simple-btn-hover:var(--uc-simple-btn-hover-dark);--uc-simple-btn-foreground:var(--uc-simple-btn-foreground-dark)}}:where(.uc-light){--uc-background:var(--uc-background-light);--uc-foreground:var(--uc-foreground-light);--uc-primary:var(--uc-primary-light);--uc-primary-hover:var(--uc-primary-hover-light);--uc-primary-transparent:var(--uc-primary-transparent-light);--uc-primary-foreground:var(--uc-primary-foreground-light);--uc-secondary:var(--uc-secondary-light);--uc-secondary-hover:var(--uc-secondary-hover-light);--uc-secondary-foreground:var(--uc-secondary-foreground-light);--uc-muted:var(--uc-muted-light);--uc-muted-foreground:var(--uc-muted-foreground-light);--uc-destructive:var(--uc-destructive-light);--uc-destructive-foreground:var(--uc-destructive-foreground-light);--uc-border:var(--uc-border-light);--uc-dialog-shadow:var(--uc-dialog-shadow-light);--uc-simple-btn:var(--uc-simple-btn-light);--uc-simple-btn-hover:var(--uc-simple-btn-hover-light);--uc-simple-btn-foreground:var(--uc-simple-btn-foreground-light)}:where(.uc-dark){--uc-background:var(--uc-background-dark);--uc-foreground:var(--uc-foreground-dark);--uc-primary:var(--uc-primary-dark);--uc-primary-hover:var(--uc-primary-hover-dark);--uc-primary-transparent:var(--uc-primary-transparent-dark);--uc-primary-foreground:var(--uc-primary-foreground-dark);--uc-secondary:var(--uc-secondary-dark);--uc-secondary-hover:var(--uc-secondary-hover-dark);--uc-secondary-foreground:var(--uc-secondary-foreground-dark);--uc-muted:var(--uc-muted-dark);--uc-muted-foreground:var(--uc-muted-foreground-dark);--uc-destructive:var(--uc-destructive-dark);--uc-destructive-foreground:var(--uc-destructive-foreground-dark);--uc-border:var(--uc-border-dark);--uc-dialog-shadow:var(--uc-dialog-shadow-dark);--uc-simple-btn:var(--uc-simple-btn-dark);--uc-simple-btn-hover:var(--uc-simple-btn-hover-dark);--uc-simple-btn-foreground:var(--uc-simple-btn-foreground-dark)}:where(.uc-purple){--uc-primary-oklch-light:47% .22 300;--uc-primary-oklch-dark:69% .1768 300}:where(.uc-red){--uc-primary-oklch-light:47% .21 21;--uc-primary-oklch-dark:71% .1768 21}:where(.uc-orange){--uc-primary-oklch-light:47% .1376 51.88;--uc-primary-oklch-dark:69% .1768 51.88}:where(.uc-green){--uc-primary-oklch-light:45% .14 130;--uc-primary-oklch-dark:69% .1768 130}:where(.uc-turquoise){--uc-primary-oklch-light:45% .0854 174;--uc-primary-oklch-dark:69% .1768 174}:where(.uc-gray){--uc-primary-oklch-light:10% 0 0;--uc-primary-oklch-dark:97% 0 0}:where(.uc-contrast){--uc-border-light:oklch(50% 0 0);--uc-border-dark:oklch(50% 0 0);--uc-muted-light:oklch(98% 0 0);--uc-muted-dark:oklch(16% 0 0);--uc-muted-foreground-light:oklch(20% 0 0);--uc-muted-foreground-dark:oklch(80% 0 0);--uc-background-light:oklch(100% 0 0);--uc-foreground-light:oklch(0% 0 0);--uc-background-dark:oklch(10% 0 0);--uc-foreground-dark:oklch(100% 0 0)}:where([uc-wgt-common]){color:var(--uc-foreground);font-family:var(--uc-font-family);font-size:var(--uc-font-size);line-height:var(--uc-line-height)}:where([uc-wgt-common]) *{box-sizing:border-box}:where([uc-wgt-common]) button{align-items:center;border:none;border-radius:var(--uc-radius);cursor:pointer;display:flex;font-family:inherit;font-size:1em;height:var(--uc-button-size);justify-content:center;padding-left:14px;padding-right:14px;transition:background-color var(--uc-transition);user-select:none;white-space:nowrap}:where([uc-wgt-common]) button:focus-visible{outline-offset:2px}:where([uc-wgt-common]) button.uc-primary-btn{background-color:var(--uc-primary);color:var(--uc-primary-foreground)}:where([uc-wgt-common]) button.uc-primary-btn:hover{background-color:var(--uc-primary-hover)}:where([uc-wgt-common]) button.uc-secondary-btn{background-color:var(--uc-secondary);color:var(--uc-secondary-foreground)}:where([uc-wgt-common]) button.uc-secondary-btn:hover{background-color:var(--uc-secondary-hover)}:where([uc-wgt-common].uc-contrast) button.uc-secondary-btn{border:1px solid var(--uc-border)}:where([uc-wgt-common]) button.uc-mini-btn{background-color:transparent;color:var(--uc-secondary-foreground);height:var(--uc-button-size);padding:0}:where([uc-wgt-common]) button.uc-mini-btn:hover{background-color:var(--uc-secondary)}:where([uc-wgt-common]) :is(button[disabled],button.uc-primary-btn[disabled],button.uc-secondary-btn[disabled]){opacity:.5;pointer-events:none}:where([uc-wgt-common]) a{color:var(--uc-primary);text-decoration:none}:where([uc-wgt-common]) a[disabled]{pointer-events:none}:where([uc-wgt-common]) input[type=text]{background-color:var(--uc-background);border:1px solid var(--uc-border);border-radius:var(--uc-radius);color:var(--uc-foreground);display:flex;font-family:inherit;font-size:1em;height:var(--uc-button-size);outline:1px solid transparent;padding-left:10px;padding-right:10px;transition:border-color var(--uc-transition),outline-color var(--uc-transition);width:100%}:where([uc-wgt-common]) input[type=text]::placeholder{color:var(--uc-muted-foreground)}:where([uc-wgt-common]) input[type=text]:focus{border-color:var(--uc-primary-hover);outline-color:var(--uc-primary-hover)}:where([uc-wgt-common]) input[disabled]{opacity:.6;pointer-events:none}:where([uc-wgt-common]) select[disabled],:where([uc-wgt-common]) uc-select[disabled]{opacity:.6;pointer-events:none}:where([uc-wgt-common]):not(#\\#):not(#\\#) [hidden]{display:none}:where([uc-wgt-common]):not(#\\#):not(#\\#) [activity]:not([active],.active){display:none}:where([uc-wgt-common]):not(#\\#):not(#\\#) dialog:not([open]) [activity]{display:none}:where([uc-wgt-common]):not(#\\#):not(#\\#):not(#\\#):not(#\\#) uc-source-btn[type]{all:unset}`,""]);const h=u},659:t=>{"use strict";t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="},741:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},779:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var r="",i=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),i&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),i&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r}).join("")},e.i=function(t,r,i,o,n){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(i)for(var s=0;s<this.length;s++){var c=this[s][0];null!=c&&(a[c]=!0)}for(var l=0;l<t.length;l++){var u=[].concat(t[l]);i&&a[u[0]]||(void 0!==n&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=n),r&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=r):u[2]=r),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),e.push(u))}},e}},782:(t,e,r)=>{t.exports=r(237)("./src/core.js")},908:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var i=r(106),o=r.n(i),n=r(779),a=r.n(n)()(o());a.push([t.id,":root{--ck-uploadcare-form-view-width:700px;--ck-uploadcare-external-source-view-height:350px;--ck-uploadcare-color-image-background:oklch(0.97 0 0);--ck-uploadcare-color-icon-error:#db3700;--ck-uploadcare-color-skeleton:#fafafa}.ck .ck-uploadcare-form{max-width:100%;width:var(--ck-uploadcare-form-view-width)}.ck .ck-uploadcare-form .ck-uploadcare-form__loading .ck-uploadcare-form__loading-spinner{align-items:center;background-color:var(--ck-uploadcare-color-image-background);display:flex;flex-direction:column;height:var(--ck-uploadcare-external-source-view-height);justify-content:center;width:100%}.ck .ck-uploadcare-form .ck-uploadcare-form__loading .ck-uploadcare-form__loading-spinner .ck-spinner-container{margin-bottom:10px}.ck .ck-uploadcare-form .ck-uploadcare-form__error .ck-uploadcare-form__error-contents{align-items:center;background-color:var(--ck-uploadcare-color-image-background);display:flex;flex-direction:column;gap:5px;height:var(--ck-uploadcare-external-source-view-height);justify-content:center;width:100%}.ck .ck-uploadcare-form .ck-uploadcare-form__error .ck-uploadcare-form__error-contents h3{font-weight:700;margin:0;padding:0}.ck .ck-uploadcare-form .ck-uploadcare-form__error .ck-uploadcare-form__error-contents .ck-icon{color:var(--ck-uploadcare-color-icon-error)}.ck .ck-uploadcare-form .ck-uploadcare-form__error .ck-uploadcare-form__error-contents .ck-button{margin-top:10px}.ck .ck-uploadcare-form .ck-uploadcare-form__skeleton{height:115px;width:100%}.ck .ck-uploadcare-form .ck-uploadcare-form__skeleton div{align-items:center;box-sizing:border-box;display:flex;flex-direction:row;height:50%;justify-content:center;min-width:100%}.ck .ck-uploadcare-form .ck-uploadcare-form__skeleton div span{background-color:var(--ck-uploadcare-color-skeleton);display:block;height:32px;width:32px}.ck .ck-uploadcare-form .ck-uploadcare-form__skeleton div+div{gap:20px}.ck .ck-uploadcare-form .ck-uploadcare-form__skeleton div+div span:first-child{left:8px;position:absolute;width:80px}.ck .ck-uploadcare-form .ck-uploadcare-form__skeleton div+div span:last-child{position:absolute;right:8px;width:80px}.ck .ck-uploadcare-form .ck-uploadcare-form__skeleton div:first-child{gap:4px}.ck .ck-uploadcare-form .mini-btn{display:none}.ck .ck-uploadcare-form .uc-viewport{height:var(--ck-uploadcare-external-source-view-height)}.ck .ck-uploadcare-form .uc-primary-btn,.ck .ck-uploadcare-form .uc-secondary-btn,.ck .ck-uploadcare-form uc-btn-ui button{min-height:var(--ck-ui-component-min-height);min-width:var(--ck-ui-component-min-height);padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}.ck .ck-uploadcare-form .uc-primary-btn,.ck .ck-uploadcare-form uc-btn-ui.uc-primary button{background:var(--ck-color-button-action-background)}.ck .ck-uploadcare-form .uc-primary-btn:not(.ck-disabled):hover,.ck .ck-uploadcare-form uc-btn-ui.uc-primary button:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck .ck-uploadcare-form .uc-primary-btn:not(.ck-disabled):active,.ck .ck-uploadcare-form uc-btn-ui.uc-primary button:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background)}.ck .ck-uploadcare-form .uc-primary-btn.ck-disabled,.ck .ck-uploadcare-form uc-btn-ui.uc-primary button.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck .ck-uploadcare-form .uc-secondary-btn,.ck .ck-uploadcare-form uc-btn-ui.uc-secondary button{background:var(--ck-color-button-default-background)}.ck .ck-uploadcare-form .uc-secondary-btn:not(.ck-disabled):hover,.ck .ck-uploadcare-form uc-btn-ui.uc-secondary button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck .ck-uploadcare-form .uc-secondary-btn:not(.ck-disabled):active,.ck .ck-uploadcare-form uc-btn-ui.uc-secondary button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background)}.ck .ck-uploadcare-form .uc-secondary-btn.ck-disabled,.ck .ck-uploadcare-form uc-btn-ui.uc-secondary button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck .ck-uploadcare-form uc-upload-list .uc-toolbar{gap:var(--ck-spacing-large)}.ck .ck-uploadcare-form uc-upload-list .uc-files{max-height:var(--ck-uploadcare-external-source-view-height);overflow-y:auto;padding-top:var(--ck-spacing-large)}.ck .ck-uploadcare-form .uc-content{gap:var(--ck-spacing-large);padding:var(--ck-spacing-large)}.ck .ck-uploadcare-form .uc-content>.uc-iframe-wrapper{height:var(--ck-uploadcare-external-source-view-height)}.ck .ck-uploadcare-form .uc-content>.uc-toolbar{padding:var(--ck-spacing-large) 0 0}.ck .ck-uploadcare-form uc-start-from .uc-content{gap:0}.ck .ck-uploadcare-form uc-file-item>.uc-inner{font-size:1em}.ck .ck-uploadcare-form uc-file-item>.uc-inner:where([finished]) .uc-badge{background:var(--ck-color-button-action-active-background)}.ck .ck-uploadcare-form uc-external-source .uc-cancel-btn{pointer-events:none;visibility:hidden}.ck .ck-uploadcare-form uc-activity-header,.ck .ck-uploadcare-form uc-source-list{display:none}.ck .ck-uploadcare-form uc-cloud-image-editor-block [icon=closeMax] .uc-icon_left{transform:rotate(90deg)}",""]);const s=a},929:t=>{"use strict";var e=[];function r(t){for(var r=-1,i=0;i<e.length;i++)if(e[i].identifier===t){r=i;break}return r}function i(t,i){for(var n={},a=[],s=0;s<t.length;s++){var c=t[s],l=i.base?c[0]+i.base:c[0],u=n[l]||0,d="".concat(l," ").concat(u);n[l]=u+1;var h=r(d),p={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==h)e[h].references++,e[h].updater(p);else{var g=o(p,i);i.byIndex=s,e.splice(s,0,{identifier:d,updater:g,references:1})}a.push(d)}return a}function o(t,e){var r=e.domAPI(e);r.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;r.update(t=e)}else r.remove()}}t.exports=function(t,o){var n=i(t=t||[],o=o||{});return function(t){t=t||[];for(var a=0;a<n.length;a++){var s=r(n[a]);e[s].references--}for(var c=i(t,o),l=0;l<n.length;l++){var u=r(n[l]);0===e[u].references&&(e[u].updater(),e.splice(u,1))}n=c}}},947:(t,e,r)=>{"use strict";r.d(e,{A:()=>h});var i=r(106),o=r.n(i),n=r(779),a=r.n(n),s=r(474),c=r.n(s),l=new URL(r(659),r.b),u=a()(o()),d=c()(l);u.push([t.id,`:where([uc-wgt-common]){--uc-font-family:system-ui;--uc-font-size:14px;--uc-line-height:normal;--uc-simple-btn-font-family:system-ui;--uc-simple-btn-font-size:14px;--uc-button-size:32px;--uc-preview-size:32px;--uc-padding:10px;--uc-radius:8px;--uc-transition:.2s ease;--uc-dialog-width:430px;--uc-dialog-max-width:920px;--uc-dialog-max-height:675px;--uc-simple-btn-padding:7px 14px;--uc-grid-col:3;--uc-grid-preview-image-height:auto;--uc-grid-gap:calc(var(--uc-padding)/2);--uc-grid-aspect-ratio:1/1;--uc-background:var(--uc-background-light);--uc-foreground:var(--uc-foreground-light);--uc-primary:var(--uc-primary-light);--uc-primary-hover:var(--uc-primary-hover-light);--uc-primary-transparent:var(--uc-primary-transparent-light);--uc-primary-foreground:var(--uc-primary-foreground-light);--uc-secondary:var(--uc-secondary-light);--uc-secondary-hover:var(--uc-secondary-hover-light);--uc-secondary-foreground:var(--uc-secondary-foreground-light);--uc-muted:var(--uc-muted-light);--uc-muted-foreground:var(--uc-muted-foreground-light);--uc-destructive:var(--uc-destructive-light);--uc-destructive-foreground:var(--uc-destructive-foreground-light);--uc-border:var(--uc-border-light);--uc-dialog-shadow:var(--uc-dialog-shadow-light);--uc-simple-btn:var(--uc-simple-btn-light);--uc-simple-btn-hover:var(--uc-simple-btn-hover-light);--uc-simple-btn-foreground:var(--uc-simple-btn-foreground-light)}@supports not (color:oklch(0% 0 0)){:where([uc-wgt-common]){--uc-primary-rgb-light:23 75 215;--uc-primary-light:rgb(var(--uc-primary-rgb-light));--uc-primary-hover-light:rgb(var(--uc-primary-rgb-light)/90%);--uc-primary-transparent-light:rgb(var(--uc-primary-rgb-light)/10%);--uc-background-light:#fff;--uc-foreground-light:#181818;--uc-primary-foreground-light:#fff;--uc-secondary-light:hsla(0,0%,9%,.05);--uc-secondary-hover-light:hsla(0,0%,9%,.08);--uc-secondary-foreground-light:#181818;--uc-muted-light:#f5f5f5;--uc-muted-foreground-light:#717171;--uc-destructive-light:rgb(232 19 20/5%);--uc-destructive-foreground-light:#e81314;--uc-border-light:#e4e4e8;--uc-dialog-shadow-light:0px 6px 20px rgba(0,0,0,.1);--uc-simple-btn-light:#ebebeb;--uc-simple-btn-hover-light:#e4e4e4;--uc-simple-btn-foreground-light:#181818;--uc-primary-rgb-dark:87 154 255;--uc-primary-dark:rgb(var(--uc-primary-rgb-dark));--uc-primary-hover-dark:rgb(var(--uc-primary-rgb-dark)/90%);--uc-primary-transparent-dark:rgb(var(--uc-primary-rgb-dark)/7%);--uc-background-dark:#1b1b1b;--uc-foreground-dark:#e1e1e1;--uc-primary-foreground-dark:#000;--uc-secondary-dark:hsla(0,0%,88%,.07);--uc-secondary-hover-dark:hsla(0,0%,88%,.1);--uc-secondary-foreground-dark:#e1e1e1;--uc-muted-dark:#242424;--uc-muted-foreground-dark:#989898;--uc-destructive-dark:rgba(244,90,79,.1);--uc-destructive-foreground-dark:#f45a4f;--uc-border-dark:#3d3d3d;--uc-dialog-shadow-dark:0px 6px 20px rgba(0,0,0,.25);--uc-simple-btn-dark:#242424;--uc-simple-btn-hover-dark:#2b2b2b;--uc-simple-btn-foreground-dark:#fff}}@supports (color:oklch(0% 0 0)){:where([uc-wgt-common]){--uc-primary-oklch-light:47% .22 264;--uc-primary-light:oklch(var(--uc-primary-oklch-light));--uc-primary-hover-light:oklch(var(--uc-primary-oklch-light)/90%);--uc-primary-transparent-light:oklch(var(--uc-primary-oklch-light)/7%);--uc-background-light:oklch(100% 0 0);--uc-foreground-light:oklch(21% 0 0);--uc-primary-foreground-light:oklch(100% 0 0);--uc-secondary-light:oklch(21% 0 0/.05);--uc-secondary-hover-light:oklch(21% 0 0/.08);--uc-secondary-foreground-light:oklch(21% 0 0);--uc-muted-light:oklch(97% 0 0);--uc-muted-foreground-light:oklch(40% 0 0);--uc-destructive-light:oklch(59% .235 28.5/.05);--uc-destructive-foreground-light:oklch(59% .235 28.5);--uc-border-light:oklch(92% 0 0);--uc-dialog-shadow-light:0px 6px 20px oklch(0% 0 0/.1);--uc-simple-btn-light:oklch(94% 0 0);--uc-simple-btn-hover-light:oklch(92% 0 0);--uc-simple-btn-foreground-light:oklch(20% 0 0);--uc-primary-oklch-dark:69% .1768 258.4;--uc-primary-dark:oklch(var(--uc-primary-oklch-dark));--uc-primary-hover-dark:oklch(var(--uc-primary-oklch-dark)/90%);--uc-primary-transparent-dark:oklch(var(--uc-primary-oklch-dark)/7%);--uc-background-dark:oklch(22% 0 0);--uc-foreground-dark:oklch(91% 0 0);--uc-primary-foreground-dark:oklch(0% 0 0);--uc-secondary-dark:oklch(91% 0 0/.07);--uc-secondary-hover-dark:oklch(91% 0 0/.1);--uc-secondary-foreground-dark:oklch(91% 0 0);--uc-muted-dark:oklch(26% 0 0);--uc-muted-foreground-dark:oklch(68% 0 0);--uc-destructive-dark:oklch(67% .191 27.5/.1);--uc-destructive-foreground-dark:oklch(67% .191 27.5);--uc-border-dark:oklch(36% 0 0);--uc-dialog-shadow-dark:0px 6px 20px oklch(0% 0 0/.25);--uc-simple-btn-dark:oklch(26% 0 0);--uc-simple-btn-hover-dark:oklch(29% 0 0);--uc-simple-btn-foreground-dark:oklch(100% 0 0)}}@media only screen and (max-height:600px){:where([uc-wgt-common]){--uc-dialog-max-height:100%}}@media only screen and (max-width:680px){:where([uc-wgt-common]){--uc-grid-col:2}}@media only screen and (max-width:430px){:where([uc-wgt-common]){--uc-dialog-max-width:100vw;--uc-dialog-max-height:var(--uploadcare-blocks-window-height);--uc-grid-col:1}}@media (prefers-color-scheme:light){:where([uc-wgt-common]){--uc-background:var(--uc-background-light);--uc-foreground:var(--uc-foreground-light);--uc-primary:var(--uc-primary-light);--uc-primary-hover:var(--uc-primary-hover-light);--uc-primary-transparent:var(--uc-primary-transparent-light);--uc-primary-foreground:var(--uc-primary-foreground-light);--uc-secondary:var(--uc-secondary-light);--uc-secondary-hover:var(--uc-secondary-hover-light);--uc-secondary-foreground:var(--uc-secondary-foreground-light);--uc-muted:var(--uc-muted-light);--uc-muted-foreground:var(--uc-muted-foreground-light);--uc-destructive:var(--uc-destructive-light);--uc-destructive-foreground:var(--uc-destructive-foreground-light);--uc-border:var(--uc-border-light);--uc-dialog-shadow:var(--uc-dialog-shadow-light);--uc-simple-btn:var(--uc-simple-btn-light);--uc-simple-btn-hover:var(--uc-simple-btn-hover-light);--uc-simple-btn-foreground:var(--uc-simple-btn-foreground-light)}}@media (prefers-color-scheme:dark){:where([uc-wgt-common]){--uc-background:var(--uc-background-dark);--uc-foreground:var(--uc-foreground-dark);--uc-primary:var(--uc-primary-dark);--uc-primary-hover:var(--uc-primary-hover-dark);--uc-primary-transparent:var(--uc-primary-transparent-dark);--uc-primary-foreground:var(--uc-primary-foreground-dark);--uc-secondary:var(--uc-secondary-dark);--uc-secondary-hover:var(--uc-secondary-hover-dark);--uc-secondary-foreground:var(--uc-secondary-foreground-dark);--uc-muted:var(--uc-muted-dark);--uc-muted-foreground:var(--uc-muted-foreground-dark);--uc-destructive:var(--uc-destructive-dark);--uc-destructive-foreground:var(--uc-destructive-foreground-dark);--uc-border:var(--uc-border-dark);--uc-dialog-shadow:var(--uc-dialog-shadow-dark);--uc-simple-btn:var(--uc-simple-btn-dark);--uc-simple-btn-hover:var(--uc-simple-btn-hover-dark);--uc-simple-btn-foreground:var(--uc-simple-btn-foreground-dark)}}:where(.uc-light){--uc-background:var(--uc-background-light);--uc-foreground:var(--uc-foreground-light);--uc-primary:var(--uc-primary-light);--uc-primary-hover:var(--uc-primary-hover-light);--uc-primary-transparent:var(--uc-primary-transparent-light);--uc-primary-foreground:var(--uc-primary-foreground-light);--uc-secondary:var(--uc-secondary-light);--uc-secondary-hover:var(--uc-secondary-hover-light);--uc-secondary-foreground:var(--uc-secondary-foreground-light);--uc-muted:var(--uc-muted-light);--uc-muted-foreground:var(--uc-muted-foreground-light);--uc-destructive:var(--uc-destructive-light);--uc-destructive-foreground:var(--uc-destructive-foreground-light);--uc-border:var(--uc-border-light);--uc-dialog-shadow:var(--uc-dialog-shadow-light);--uc-simple-btn:var(--uc-simple-btn-light);--uc-simple-btn-hover:var(--uc-simple-btn-hover-light);--uc-simple-btn-foreground:var(--uc-simple-btn-foreground-light)}:where(.uc-dark){--uc-background:var(--uc-background-dark);--uc-foreground:var(--uc-foreground-dark);--uc-primary:var(--uc-primary-dark);--uc-primary-hover:var(--uc-primary-hover-dark);--uc-primary-transparent:var(--uc-primary-transparent-dark);--uc-primary-foreground:var(--uc-primary-foreground-dark);--uc-secondary:var(--uc-secondary-dark);--uc-secondary-hover:var(--uc-secondary-hover-dark);--uc-secondary-foreground:var(--uc-secondary-foreground-dark);--uc-muted:var(--uc-muted-dark);--uc-muted-foreground:var(--uc-muted-foreground-dark);--uc-destructive:var(--uc-destructive-dark);--uc-destructive-foreground:var(--uc-destructive-foreground-dark);--uc-border:var(--uc-border-dark);--uc-dialog-shadow:var(--uc-dialog-shadow-dark);--uc-simple-btn:var(--uc-simple-btn-dark);--uc-simple-btn-hover:var(--uc-simple-btn-hover-dark);--uc-simple-btn-foreground:var(--uc-simple-btn-foreground-dark)}:where(.uc-purple){--uc-primary-oklch-light:47% .22 300;--uc-primary-oklch-dark:69% .1768 300}:where(.uc-red){--uc-primary-oklch-light:47% .21 21;--uc-primary-oklch-dark:71% .1768 21}:where(.uc-orange){--uc-primary-oklch-light:47% .1376 51.88;--uc-primary-oklch-dark:69% .1768 51.88}:where(.uc-green){--uc-primary-oklch-light:45% .14 130;--uc-primary-oklch-dark:69% .1768 130}:where(.uc-turquoise){--uc-primary-oklch-light:45% .0854 174;--uc-primary-oklch-dark:69% .1768 174}:where(.uc-gray){--uc-primary-oklch-light:10% 0 0;--uc-primary-oklch-dark:97% 0 0}:where(.uc-contrast){--uc-border-light:oklch(50% 0 0);--uc-border-dark:oklch(50% 0 0);--uc-muted-light:oklch(98% 0 0);--uc-muted-dark:oklch(16% 0 0);--uc-muted-foreground-light:oklch(20% 0 0);--uc-muted-foreground-dark:oklch(80% 0 0);--uc-background-light:oklch(100% 0 0);--uc-foreground-light:oklch(0% 0 0);--uc-background-dark:oklch(10% 0 0);--uc-foreground-dark:oklch(100% 0 0)}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#){--color-primary-accent:var(--uc-primary);--color-text-base:var(--uc-foreground);--color-text-accent-contrast:var(--uc-background);--color-fill-contrast:var(--uc-background);--color-modal-backdrop:oklch(0 0 0/.1);--color-image-background:var(--uc-muted);--color-focus-ring:var(--color-primary-accent);--color-crop-guides:var(--uc-foreground);--font-size-ui:var(--uc-font-size);--size-touch-area:var(--uc-button-size);--size-panel-heading:calc(var(--uc-button-size) + var(--uc-padding)*2);--size-ui-min-width:130px;--size-line-width:1px;--size-modal-width:650px;--size-icon:calc(var(--uc-button-size)/2);--border-radius-editor:var(--uc-radius);--border-radius-thumb:var(--uc-radius);--border-radius-ui:var(--uc-radius);--border-radius-base:var(--uc-radius);--cldtr-gap-min:5px;--cldtr-gap-mid-1:10px;--cldtr-gap-mid-2:15px;--cldtr-gap-max:20px;--transition-duration-2:var(--transition-duration-all,.2s);--transition-duration-3:var(--transition-duration-all,.3s);--transition-duration-4:var(--transition-duration-all,.4s);--transition-duration-5:var(--transition-duration-all,.5s);--modal-header-opacity:1;--modal-header-height:var(--size-panel-heading);--modal-toolbar-height:var(--size-panel-heading);--transparent-pixel:url(${d});display:block;height:100%;max-height:100%;width:100%}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) :is([can-handle-paste]:hover,[can-handle-paste]:focus){--can-handle-paste:"true"}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) :is([tabindex][focus-visible],[tabindex]:hover,[with-effects][focus-visible],[with-effects]:hover){--filter-effect:var(--hover-filter)!important;--opacity-effect:var(--hover-opacity)!important;--color-effect:var(--hover-color-rgb)!important;--background-effect:var(--hover-background)!important}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) :is([tabindex]:active,[with-effects]:active){--filter-effect:var(--down-filter)!important;--opacity-effect:var(--down-opacity)!important;--color-effect:var(--down-color-rgb)!important;--background-effect:var(--down-background)!important}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) :is([tabindex][active],[with-effects][active]){--filter-effect:var(--active-filter)!important;--opacity-effect:var(--active-opacity)!important;--color-effect:var(--active-color-rgb)!important;--background-effect:var(--active-background)!important}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) [hidden-scrollbar]::-webkit-scrollbar{display:none}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) [hidden-scrollbar]{-ms-overflow-style:none;scrollbar-width:none}[uc-cloud-image-editor].uc-editor_ON:not(#\\#):not(#\\#):not(#\\#){--modal-header-opacity:0;--modal-header-height:0px;--modal-toolbar-height:calc(var(--size-panel-heading)*2)}[uc-cloud-image-editor].uc-editor_OFF:not(#\\#):not(#\\#):not(#\\#){--modal-header-opacity:1;--modal-header-height:var(--size-panel-heading);--modal-toolbar-height:var(--size-panel-heading)}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper{--l-min-img-height:var(--modal-toolbar-height);--l-max-img-height:100%;--l-edit-button-width:120px;--l-toolbar-horizontal-padding:var(--cldtr-gap-mid-1);display:grid;grid-template-rows:minmax(var(--l-min-img-height),var(--l-max-img-height)) minmax(var(--modal-toolbar-height),auto);height:100%;overflow:hidden;overflow-y:auto;position:relative}@media only screen and (max-width:800px){[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper{--l-edit-button-width:70px;--l-toolbar-horizontal-padding:var(--cldtr-gap-min)}}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport{align-items:center;display:flex;justify-content:center;overflow:hidden}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-image_container>.uc-image{--viewer-image-opacity:1;background-color:var(--color-image-background);box-sizing:border-box;display:block;height:100%;left:0;object-fit:scale-down;opacity:var(--viewer-image-opacity);pointer-events:auto;position:absolute;top:0;transform:scale(1);user-select:none;width:100%;z-index:10}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-image_container>.uc-image.uc-image_visible_viewer{transition:opacity var(--transition-duration-3) ease-in-out,transform var(--transition-duration-4)}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-image_container>.uc-image.uc-image_hidden_to_cropper{--viewer-image-opacity:0;background-image:var(--transparent-pixel);pointer-events:none;transform:scale(1);transition:transform var(--transition-duration-4),opacity var(--transition-duration-3) step-end}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-image_container>.uc-image.uc-image_hidden_effects{--viewer-image-opacity:0;pointer-events:none;transform:scale(1);transition:opacity var(--transition-duration-3) cubic-bezier(.5,0,1,1),transform var(--transition-duration-4)}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-image_container{background-color:var(--color-image-background);display:block;height:100%;position:relative;transition:var(--transition-duration-3);width:100%}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-toolbar{position:relative;transition:.3s}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-toolbar>.uc-toolbar_content{background-color:var(--color-fill-contrast);bottom:0;box-sizing:border-box;height:var(--modal-toolbar-height);left:0;min-height:var(--size-panel-heading);position:absolute;width:100%}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-toolbar>.uc-toolbar_content.uc-toolbar_content__viewer{align-items:center;display:flex;height:var(--size-panel-heading);justify-content:space-between;padding-left:var(--l-toolbar-horizontal-padding);padding-right:var(--l-toolbar-horizontal-padding)}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-toolbar>.uc-toolbar_content.uc-toolbar_content__editor{display:flex}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-info_pan{position:absolute;user-select:none}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-file_type_outer{display:flex;max-width:120px;position:absolute;transform:translate(-40px);user-select:none;z-index:2}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-file_type_outer>.uc-file_type{padding:4px .8em}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-network_problems_splash{background-color:var(--color-fill-contrast);display:flex;flex-direction:column;height:100%;position:absolute;width:100%;z-index:4}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-network_problems_splash>.uc-network_problems_content{align-items:center;display:flex;flex:1;flex-direction:column;justify-content:center}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-network_problems_splash>.uc-network_problems_content>.uc-network_problems_icon{align-items:center;background-color:var(--uc-muted);border-radius:50%;color:var(--uc-foreground);display:flex;height:40px;justify-content:center;width:40px}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-network_problems_splash>.uc-network_problems_content>.uc-network_problems_text{color:var(--uc-foreground);font-size:var(--font-size-ui);margin-top:var(--cldtr-gap-max)}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-network_problems_splash>.uc-network_problems_footer{align-items:center;display:flex;height:var(--size-panel-heading);justify-content:center}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#)>.uc-svg{border-top-left-radius:var(--border-radius-base);border-top-right-radius:var(--border-radius-base);height:100%;left:0;opacity:inherit;position:absolute;top:0;transition:var(--transition-duration-3);width:100%;z-index:2}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#)>.uc-thumb{--idle-color-rgb:var(--color-text-base);--hover-color-rgb:var(--color-primary-accent);--focus-color-rgb:var(--color-primary-accent);--down-color-rgb:var(--color-primary-accent);--color-effect:var(--idle-color-rgb);color:var(--color-effect);transition:color var(--transition-duration-3),opacity var(--transition-duration-3)}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-thumb--visible{opacity:1;pointer-events:auto}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-thumb--hidden{opacity:0;pointer-events:none}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-guides{transition:var(--transition-duration-3)}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-guides--hidden{opacity:0}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-guides--semi-hidden{opacity:.2}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-guides--visible{opacity:1}uc-editor-aspect-ratio-button-control:not(#\\#):not(#\\#):not(#\\#),uc-editor-button-control:not(#\\#):not(#\\#):not(#\\#),uc-editor-crop-button-control:not(#\\#):not(#\\#):not(#\\#),uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#),uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#),uc-editor-operation-control:not(#\\#):not(#\\#):not(#\\#){--l-base-min-width:var(--uc-button-size);--l-base-height:var(--uc-button-size);--opacity-effect:var(--idle-opacity);--color-effect:var(--idle-color-rgb);--background-effect:var(--idle-background);--filter-effect:var(--idle-filter);--idle-color-rgb:var(--uc-secondary-foreground);--idle-opacity:1;--idle-filter:1;--idle-background:var(--uc-secondary);--hover-color-rgb:var(--uc-secondary-foreground);--hover-opacity:1;--hover-filter:.8;--hover-background:var(--uc-secondary-hover);--down-color-rgb:var(--hover-color-rgb);--down-opacity:1;--down-filter:.6;--down-background:var(--uc-secondary);border-radius:var(--uc-radius)}uc-editor-aspect-ratio-button-control:not(#\\#):not(#\\#):not(#\\#)>button,uc-editor-button-control:not(#\\#):not(#\\#):not(#\\#)>button,uc-editor-crop-button-control:not(#\\#):not(#\\#):not(#\\#)>button,uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>button,uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button,uc-editor-operation-control:not(#\\#):not(#\\#):not(#\\#)>button{all:unset;align-items:center;color:var(--color-effect);cursor:pointer;display:grid;grid-template-columns:var(--l-base-min-width) auto;grid-template-rows:100%;height:var(--l-base-height);opacity:var(--opacity-effect);position:relative;transition:var(--l-width-transition)}uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button{grid-template-columns:auto var(--l-base-min-width)}uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button>uc-icon{margin-left:var(--cldtr-gap-mid-1);width:10px}:where(uc-editor-button-control,uc-editor-crop-button-control,uc-editor-aspect-ratio-button-control,uc-editor-freeform-button-control,uc-editor-filter-control,uc-editor-operation-control):not(#\\#):not(#\\#):not(#\\#)>uc-icon>svg{height:var(--size-icon);width:var(--size-icon)}uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>uc-icon.uc-original-icon>svg{height:100%;width:100%}uc-editor-aspect-ratio-button-control.uc-active:not(#\\#):not(#\\#):not(#\\#),uc-editor-button-control.uc-active:not(#\\#):not(#\\#):not(#\\#),uc-editor-crop-button-control.uc-active:not(#\\#):not(#\\#):not(#\\#),uc-editor-filter-control.uc-active:not(#\\#):not(#\\#):not(#\\#),uc-editor-freeform-button-control.uc-active:not(#\\#):not(#\\#):not(#\\#),uc-editor-operation-control.uc-active:not(#\\#):not(#\\#):not(#\\#){--idle-color-rgb:var(--uc-primary-foreground);--idle-background:var(--uc-primary);--idle-opacity:1;--hover-color-rgb:var(--uc-primary-foreground);--hover-background:var(--uc-primary);--hover-opacity:1}uc-editor-filter-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#) .uc-preview[loaded]{opacity:1}uc-editor-filter-control.uc-active:not(#\\#):not(#\\#):not(#\\#) .uc-preview{opacity:0}uc-editor-aspect-ratio-button-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#),uc-editor-button-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#),uc-editor-crop-button-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#),uc-editor-filter-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#),uc-editor-freeform-button-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#),uc-editor-operation-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#){--idle-color-rgb:var(--uc-secondary-foreground)}:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-aspect-ratio-button-control.uc-not_active,:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-button-control.uc-not_active,:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-crop-button-control.uc-not_active,:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-filter-control.uc-not_active,:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-freeform-button-control.uc-not_active,:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-operation-control.uc-not_active{--idle-background:transparent;--hover-background:var(--uc-secondary);outline:1px solid var(--uc-border);outline-offset:-1px}uc-editor-aspect-ratio-button-control:not(#\\#):not(#\\#):not(#\\#)>button:before,uc-editor-button-control:not(#\\#):not(#\\#):not(#\\#)>button:before,uc-editor-crop-button-control:not(#\\#):not(#\\#):not(#\\#)>button:before,uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>button:before,uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button:before,uc-editor-operation-control:not(#\\#):not(#\\#):not(#\\#)>button:before{background-color:var(--background-effect);border-radius:var(--border-radius-editor);content:"";height:100%;left:0;position:absolute;right:0;transition:var(--transition-duration-3);width:100%;z-index:-1}uc-editor-aspect-ratio-button-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title,uc-editor-button-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title,uc-editor-crop-button-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title,uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title,uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title,uc-editor-operation-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title{font-size:.7em;letter-spacing:1.004px;padding-right:var(--cldtr-gap-mid-1);text-transform:uppercase}uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title{padding-left:var(--cldtr-gap-mid-1);padding-right:0}uc-editor-aspect-ratio-button-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon,uc-editor-button-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon,uc-editor-crop-button-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon,uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon,uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon,uc-editor-operation-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon{pointer-events:none}uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-preview{background-repeat:no-repeat;background-size:contain;border-radius:var(--border-radius-editor);filter:brightness(var(--filter-effect));height:var(--l-base-height);left:0;opacity:0;position:absolute;right:0;transition:var(--transition-duration-3);width:100%;z-index:-1}uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>.uc-original-icon{color:var(--color-effect);opacity:.3}uc-editor-image-cropper:not(#\\#):not(#\\#):not(#\\#){color:var(--color-crop-guides);display:block;height:100%;left:0;opacity:0;pointer-events:none;position:absolute;top:0;touch-action:none;width:100%;z-index:10}uc-editor-image-cropper.uc-active_from_editor:not(#\\#):not(#\\#):not(#\\#),uc-editor-image-cropper.uc-active_from_viewer:not(#\\#):not(#\\#):not(#\\#){opacity:1;pointer-events:auto;transform:scale(1) translate(0);transition:transform var(--transition-duration-4) cubic-bezier(.37,0,.63,1) .4s,opacity var(--transition-duration-3)}uc-editor-image-cropper.uc-inactive_to_editor:not(#\\#):not(#\\#):not(#\\#){opacity:0;pointer-events:none;transition:transform var(--transition-duration-4) cubic-bezier(.37,0,.63,1),opacity var(--transition-duration-3) calc(var(--transition-duration-3) + .05s)}uc-editor-image-cropper:not(#\\#):not(#\\#):not(#\\#)>.uc-canvas{z-index:1}uc-editor-image-cropper:not(#\\#):not(#\\#):not(#\\#)>.uc-canvas,uc-editor-image-fader:not(#\\#):not(#\\#):not(#\\#){display:block;height:100%;left:0;position:absolute;top:0;width:100%}uc-editor-image-fader.uc-active_from_viewer:not(#\\#):not(#\\#):not(#\\#){opacity:1;pointer-events:auto;transform:scale(1);transition:transform var(--transition-duration-4),opacity var(--transition-duration-3) step-start;z-index:3}uc-editor-image-fader.uc-active_from_cropper:not(#\\#):not(#\\#):not(#\\#){opacity:1;pointer-events:auto;transform:scale(1);transition:transform var(--transition-duration-4),opacity var(--transition-duration-3) step-end;z-index:3}uc-editor-image-fader.uc-inactive_to_cropper:not(#\\#):not(#\\#):not(#\\#){opacity:0;pointer-events:none;transform:scale(1);transition:transform var(--transition-duration-4),opacity var(--transition-duration-3) step-end;z-index:3}uc-editor-image-fader:not(#\\#):not(#\\#):not(#\\#) .uc-fader-image{content-visibility:auto;display:block;height:100%;left:0;object-fit:scale-down;position:absolute;top:0;transform:scale(1);user-select:none;width:100%}uc-editor-image-fader:not(#\\#):not(#\\#):not(#\\#) .uc-fader-image--preview{background-color:var(--color-image-background);border-top-left-radius:var(--border-radius-base);border-top-right-radius:var(--border-radius-base);opacity:0;transform:scale(1);transition:var(--transition-duration-3)}uc-editor-scroller:not(#\\#):not(#\\#):not(#\\#){align-items:center;display:flex;height:100%;overflow-x:scroll;width:100%}uc-editor-slider:not(#\\#):not(#\\#):not(#\\#){align-items:center;display:flex;height:var(--size-panel-heading);justify-content:center;width:100%}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#){height:100%;position:relative;width:100%}@media only screen and (max-width:600px){uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#){--l-tab-gap:var(--cldtr-gap-mid-1);--l-slider-padding:var(--uc-padding);--l-controls-padding:var(--uc-padding)}}@media only screen and (min-width:601px){uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#){--l-tab-gap:var(--cldtr-gap-max);--l-slider-padding:var(--uc-padding);--l-controls-padding:var(--uc-padding)}}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container{height:100%;overflow:hidden;position:relative;width:100%}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar{background-color:var(--color-fill-contrast);display:grid;grid-template-rows:1fr 1fr;height:100%;position:absolute;transition:opacity var(--transition-duration-3) ease-in-out,transform var(--transition-duration-3) ease-in-out,visibility var(--transition-duration-3) ease-in-out;width:100%}.uc-sub-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-list-aspect-ratio-container>.uc-list-aspect-ratio{align-items:center;display:grid;gap:6px;grid-auto-flow:column;height:var(--size-panel-heading);justify-content:center}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar.uc-sub-toolbar--visible{opacity:1;pointer-events:auto;transform:translateY(0)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar.uc-sub-toolbar--top-hidden{opacity:0;pointer-events:none;transform:translateY(100%)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar.uc-sub-toolbar--bottom-hidden{opacity:0;pointer-events:none;transform:translateY(-100%)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row{align-items:center;display:flex;justify-content:space-between;padding-left:var(--l-controls-padding);padding-right:var(--l-controls-padding)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles{display:grid;grid-auto-flow:column;position:relative;grid-gap:0 var(--l-tab-gap);align-items:center;height:100%}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles>.uc-tab-toggles_indicator{background-color:var(--uc-secondary-foreground);bottom:0;height:2px;left:0;position:absolute;transform:translate(0);transition:transform var(--transition-duration-3);width:var(--size-touch-area)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row{position:relative}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content{content-visibility:auto;display:flex;height:100%;left:0;opacity:0;overflow:hidden;position:absolute;top:0;width:100%}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content.uc-tab-content--visible{opacity:1;pointer-events:auto}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content.uc-tab-content--hidden{opacity:0;pointer-events:none}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles>.uc-tab-toggle.uc-tab-toggle--visible{display:contents}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles.uc-tab-toggles--hidden,uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles>.uc-tab-toggle.uc-tab-toggle--hidden{display:none}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles>.uc-tab-toggle>uc-btn-ui{width:var(--uc-button-size)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles>.uc-tab-toggle>uc-btn-ui>uc-icon>svg{height:var(--size-icon);width:var(--size-icon)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content .uc-controls-list_align{box-sizing:border-box;display:grid;grid-template-areas:". inner .";grid-template-columns:1fr auto 1fr;min-width:100%;padding-left:var(--uc-padding)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content .uc-controls-list_inner{display:grid;gap:6px;grid-area:inner;grid-auto-flow:column}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content .uc-controls-list_inner:last-child{padding-right:var(--uc-padding)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-controls-list_last-item{margin-right:var(--cldtr-gap-max)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-info-tooltip_container{align-items:flex-start;display:flex;height:100%;justify-content:center;position:absolute;width:100%}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-info-tooltip_wrapper{display:flex;flex-direction:column;height:100%;justify-content:flex-end;pointer-events:none;position:absolute;top:calc(-100% - var(--cldtr-gap-mid-2))}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-info-tooltip{background-color:var(--color-text-accent-contrast);border-radius:var(--border-radius-editor);color:var(--color-text-base);font-size:.7em;letter-spacing:1px;opacity:0;padding:3px 6px;text-transform:uppercase;transform:translateY(100%);transition:var(--transition-duration-3);z-index:3}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-info-tooltip_visible{opacity:1;transform:translateY(0)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-slider{padding-left:var(--l-slider-padding);padding-right:var(--l-slider-padding)}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#)>button{--filter-effect:var(--idle-brightness);--opacity-effect:var(--idle-opacity);--color-effect:var(--idle-color-rgb);--background-effect:var(--idle-background);--l-transition-effect:var( --css-transition,color var(--transition-duration-2),background-color var(--transition-duration-2),filter var(--transition-duration-2) );all:unset;align-items:center;background-color:var(--background-effect);border-radius:var(--uc-radius);box-sizing:var(--css-box-sizing,border-box);color:var(--color-effect);cursor:pointer;display:inline-flex;filter:brightness(var(--filter-effect));font-size:1em;height:var(--css-height,var(--uc-button-size));opacity:var(--opacity-effect);padding-left:var(--css-padding-left,14px);padding-right:var(--css-padding-right,14px);transition:var(--l-transition-effect);user-select:none}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#)>button>uc-icon{pointer-events:none}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-text{white-space:nowrap}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-icon{align-items:center;color:var(--color-effect);display:flex;filter:brightness(var(--filter-effect));justify-content:center;transition:var(--l-transition-effect)}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-icon_left{margin-left:0;margin-right:var(--cldtr-gap-mid-1)}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-icon_right{margin-left:var(--cldtr-gap-mid-1);margin-right:0}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-icon_single{margin-left:0;margin-right:0}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-icon_hidden{display:none;margin:0}uc-btn-ui.uc-primary:not(#\\#):not(#\\#):not(#\\#)>button{--idle-color-rgb:var(--uc-primary-foreground);--idle-brightness:1;--idle-opacity:1;--idle-background:var(--uc-primary);--hover-color-rgb:var(--uc-primary-foreground);--hover-brightness:1;--hover-opacity:1;--hover-background:var(--uc-primary-hover);--down-color-rgb:var(--uc-primary-foreground);--down-brightness:.75;--down-opacity:1;--down-background:var(--uc-primary);--active-color-rgb:var(--uc-primary-foreground);--active-brightness:1;--active-opacity:1;--active-background:var(--uc-primary)}uc-btn-ui.uc-primary-icon:not(#\\#):not(#\\#):not(#\\#)>button{--idle-color-rgb:var(--uc-primary);--idle-brightness:1;--idle-opacity:1;--idle-background:transparent;--hover-color-rgb:var(--uc-primary);--hover-brightness:1;--hover-opacity:1;--hover-background:var(--uc-primary-transparent);--down-color-rgb:var(--uc-primary);--down-brightness:.75;--down-opacity:1;--down-background:var(--uc-primary-transparent);--active-color-rgb:var(--uc-primary-foreground);--active-brightness:1;--active-opacity:1;--active-background:var(--uc-primary);padding:0;width:var(--uc-button-size)}uc-btn-ui.uc-secondary:not(#\\#):not(#\\#):not(#\\#)>button{--idle-color-rgb:var(--uc-secondary-foreground);--idle-brightness:1;--idle-opacity:1;--idle-background:var(--uc-secondary);--hover-color-rgb:var(--uc-secondary-foreground);--hover-brightness:1;--hover-opacity:1;--hover-background:var(--uc-secondary-hover);--down-color-rgb:var(--uc-secondary-foreground);--down-brightness:1;--down-opacity:1;--down-background:var(--uc-secondary-hover);--active-color-rgb:var(--uc-secondary-foreground);--active-brightness:1;--active-opacity:1;--active-background:transparent}:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-btn-ui.uc-secondary>button{border:1px solid var(--uc-border)}uc-btn-ui.uc-secondary-icon:not(#\\#):not(#\\#):not(#\\#)>button,uc-btn-ui.uc-tab:not(#\\#):not(#\\#):not(#\\#)>button{--idle-color-rgb:var(--uc-secondary-foreground);--idle-brightness:1;--idle-opacity:1;--idle-background:transparent;--hover-color-rgb:var(--uc-secondary-foreground);--hover-brightness:1;--hover-opacity:1;--hover-background:var(--uc-secondary);--down-color-rgb:var(--uc-secondary-foreground);--down-brightness:1;--down-opacity:1;--down-background:var(--uc-secondary);--active-color-rgb:var(--uc-secondary-foreground);--active-brightness:1;--active-opacity:1;--active-background:transparent;padding:0;width:var(--uc-button-size)}uc-btn-ui.uc-default:not(#\\#):not(#\\#):not(#\\#)>button{--idle-color-rgb:var(--uc-secondary-foreground);--idle-brightness:1;--idle-opacity:1;--idle-background:var(--uc-secondary);--hover-color-rgb:var(--uc-secondary-foreground);--hover-brightness:1;--hover-opacity:1;--hover-background:var(--uc-secondary-hover);--down-color-rgb:var(--uc-secondary-foreground);--down-brightness:.75;--down-opacity:1;--down-background:var(--uc-secondary);--active-color-rgb:var(--uc-primary);--active-brightness:1;--active-opacity:1;--active-background:var(--uc-primary-transparent)}:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-btn-ui.uc-default>button{--idle-background:transparent;--hover-background:var(--uc-secondary);--active-background:var(--uc-foreground);--active-color-rgb:var(--uc-background)}uc-line-loader-ui:not(#\\#):not(#\\#):not(#\\#){height:2px;left:0;opacity:.5;position:absolute;top:0;width:100%;z-index:9999}uc-line-loader-ui:not(#\\#):not(#\\#):not(#\\#) .uc-inner{height:100%;max-width:200px;width:25%}uc-line-loader-ui:not(#\\#):not(#\\#):not(#\\#) .uc-line{background-color:var(--uc-primary);height:100%;transform:translate(-101%);transition:transform 1s;width:100%}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#){--l-thumb-size:24px;--l-zero-dot-size:5px;--l-zero-dot-offset:2px;--idle-color-rgb:var(--uc-foreground);--hover-color-rgb:var(--uc-primary);--down-color-rgb:var(--uc-primary);--color-effect:var(--idle-color-rgb);--l-color:var(--color-effect);align-items:center;display:flex;height:calc(var(--l-thumb-size) + (var(--l-zero-dot-size) + var(--l-zero-dot-offset))*2);justify-content:center;position:relative;width:100%}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-thumb{background-color:var(--l-color);border-radius:50%;height:var(--l-thumb-size);left:0;opacity:1;position:absolute;transform:translate(0);transition:opacity var(--transition-duration-2),background-color var(--transition-duration-2);width:var(--l-thumb-size)}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-steps{align-items:center;box-sizing:border-box;display:flex;height:100%;justify-content:space-between;padding-left:calc(var(--l-thumb-size)/2);padding-right:calc(var(--l-thumb-size)/2);position:absolute;width:100%}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-border-step{border-right:1px solid var(--uc-foreground);height:10px;opacity:1;transition:border-color var(--transition-duration-2);width:0}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-minor-step{border-right:1px solid var(--uc-foreground);height:4px;opacity:.6;transition:border-color var(--transition-duration-2);width:0}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-zero-dot{background-color:var(--color-primary-accent);border-radius:50%;height:var(--l-zero-dot-size);left:calc(var(--l-thumb-size)/2 - var(--l-zero-dot-size)/2);opacity:0;position:absolute;top:calc(100% - var(--l-zero-dot-offset)*2);transition:var(--transition-duration-3);width:var(--l-zero-dot-size)}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-input{cursor:pointer;height:100%;margin:0;opacity:0;position:absolute;width:calc(100% - 10px)}uc-presence-toggle.uc-transition:not(#\\#):not(#\\#):not(#\\#){transition:opacity var(--transition-duration-3),visibility var(--transition-duration-3)}uc-presence-toggle.uc-visible:not(#\\#):not(#\\#):not(#\\#){opacity:1;pointer-events:inherit}uc-presence-toggle.uc-hidden:not(#\\#):not(#\\#):not(#\\#){opacity:0;pointer-events:none}uc-presence-toggle.uc-initial:not(#\\#):not(#\\#):not(#\\#){display:none!important;transition:none!important}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) [role=button]:focus-visible,[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) button:focus-visible{outline:1px auto Highlight;outline:1px auto -webkit-focus-ring-color}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) .uc-cloud-mask{pointer-events:none}[uc-aspect-ratio-freeform]:not(#\\#):not(#\\#):not(#\\#) button{display:flex}[uc-aspect-ratio-freeform]:not(#\\#):not(#\\#):not(#\\#) uc-icon{display:none}[uc-aspect-ratio-freeform]:not(#\\#):not(#\\#):not(#\\#) .uc-title{padding-left:var(--cldtr-gap-mid-1)}:where(uc-editor-freeform-button-control,uc-editor-aspect-ratio-button-control:last-of-type):not(#\\#):not(#\\#):not(#\\#){margin-right:calc(var(--cldtr-gap-mid-1)*3)}:where([uc-cloud-image-editor]):not(#\\#):not(#\\#):not(#\\#) uc-icon{display:flex;height:100%;justify-content:center;width:100%}:where([uc-cloud-image-editor]):not(#\\#):not(#\\#):not(#\\#) uc-icon svg{height:calc(var(--uc-button-size)/2);width:calc(var(--uc-button-size)/2)}uc-config:not(#\\#){display:none}uc-icon:not(#\\#){align-items:center;display:inline-flex;height:var(--uc-button-size);justify-content:center;width:var(--uc-button-size)}uc-icon:not(#\\#) svg{height:calc(var(--uc-button-size)/2);overflow:visible;width:calc(var(--uc-button-size)/2)}`,""]);const h=u}},e={};function r(i){var o=e[i];if(void 0!==o)return o.exports;var n=e[i]={id:i,exports:{}};return t[i](n,n.exports,r),n.exports}r.m=t,r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.b="undefined"!=typeof document&&document.baseURI||self.location.href;var i={};(()=>{"use strict";r.r(i),r.d(i,{Uploadcare:()=>xc,UploadcareCommand:()=>nt,UploadcareEditing:()=>be,UploadcareImageEdit:()=>Qc,UploadcareImageEditCommand:()=>Uc,UploadcareImageEditEditing:()=>qc,UploadcareImageEditUI:()=>Wc,UploadcareUI:()=>$,UploadcareUploadAdapter:()=>he});var t={};r.r(t),r.d(t,{ActivityBlock:()=>tn,ActivityHeader:()=>ua,BaseComponent:()=>Ne,Block:()=>Yo,BtnUi:()=>ja,CameraSource:()=>ba,CloudImageEditor:()=>mc,CloudImageEditorActivity:()=>Za,CloudImageEditorBlock:()=>ka,Config:()=>fs,Copyright:()=>vs,CropFrame:()=>xa,Data:()=>we,DropArea:()=>As,EditorAspectRatioButtonControl:()=>Ta,EditorCropButtonControl:()=>Aa,EditorFilterControl:()=>Oa,EditorFreeformButtonControl:()=>Ea,EditorImageCropper:()=>Pa,EditorImageFader:()=>Da,EditorOperationControl:()=>Fa,EditorScroller:()=>Va,EditorSlider:()=>$a,EditorToolbar:()=>Ba,ExternalSource:()=>Ns,ExternalUploadSource:()=>wn,FileItem:()=>Vs,FileUploaderInline:()=>bc,FileUploaderMinimal:()=>vc,FileUploaderRegular:()=>yc,FormInput:()=>Bs,Icon:()=>js,Img:()=>Qs,LineLoaderUi:()=>Ha,Modal:()=>tc,ModalEvents:()=>Ho,PACKAGE_NAME:()=>Ko,PACKAGE_VERSION:()=>Go,PresenceToggle:()=>Wa,ProgressBar:()=>ec,ProgressBarCommon:()=>rc,Select:()=>ic,SimpleBtn:()=>oc,SliderUi:()=>Xa,SolutionBlock:()=>nn,SourceBtn:()=>nc,SourceList:()=>ac,Spinner:()=>sc,StartFrom:()=>cc,Thumb:()=>dc,UID:()=>xe,UploadCtxProvider:()=>hc,UploadList:()=>pc,UploadSource:()=>kn,UploaderBlock:()=>la,UrlSource:()=>gc,defineComponents:()=>en,defineLocale:()=>No,loadFileUploaderFrom:()=>on,toKebabCase:()=>Ya});var e,o,n,a=r(782),s=r(355),c=r(311);function l(t,e){var r=u();return(l=function(t,e){return r[t-=175]})(t,e)}function u(){var t=["facebook","gdrive","227783aVRDQY","URL","GDrive","Local","url","5VDueUN","GPhotos","2kBsCLR","OneDrive","Facebook","dropbox","2276346SboEGk","Dropbox","751980lvkUBY","217LmNiIk","8319660hAoBXW","1209771RbQvPc","11368fDYneO","gphotos","onedrive","749044dRYmpj","local"];return(u=function(){return t})()}function d(t,r,i){const o=t.t,n=t.t;switch(r){case e.Local:return{text:n("Insert"===i?"Upload from computer":"Replace from computer"),shortText:n("From computer")};case e.URL:return{text:"Insert"===i?n("Insert via URL"):o("Replace via URL"),shortText:n("Via URL")};case e.Dropbox:return{text:o("Insert"===i?"Insert with Dropbox":"Replace with Dropbox"),shortText:o("With Dropbox")};case e.Facebook:return{text:o("Insert"===i?"Insert with Facebook":"Replace with Facebook"),shortText:o("With Facebook")};case e.GDrive:return{text:o("Insert"===i?"Insert with Google Drive":"Replace with Google Drive"),shortText:o("With Google Drive")};case e.GPhotos:return{text:o("Insert"===i?"Insert with Google Photos":"Replace with Google Photos"),shortText:o("With Google Photos")};case e.OneDrive:return{text:o("Insert"===i?"Insert with OneDrive":"Replace with OneDrive"),shortText:o("With OneDrive")};default:return r}}!function(t){for(var e=l,r=t();;)try{if(251761===-parseInt(e(189))/1*(parseInt(e(196))/2)+-parseInt(e(178))/3+parseInt(e(185))/4+parseInt(e(194))/5*(-parseInt(e(176))/6)+-parseInt(e(179))/7*(parseInt(e(182))/8)+parseInt(e(181))/9+parseInt(e(180))/10)break;r.push(r.shift())}catch(t){r.push(r.shift())}}(u),(o=e||(e={}))[(n=l)(192)]=n(186),o[n(190)]=n(193),o[n(177)]=n(175),o[n(191)]=n(188),o[n(198)]=n(187),o[n(195)]=n(183),o[n(197)]=n(184);var h=r(929),p=r.n(h),g=r(297),m=r.n(g),b=r(102),f=r.n(b),v=r(123),y=r.n(v),w=r(741),_=r.n(w),k=r(621),x={attributes:{"data-cke":!0}};x.setAttributes=y(),x.insert=f().bind(null,"head"),x.domAPI=m(),x.insertStyleElement=_();p()(k.A,x);k.A&&k.A.locals&&k.A.locals;var C=r(387),E={attributes:{"data-cke":!0}};E.setAttributes=y(),E.insert=f().bind(null,"head"),E.domAPI=m(),E.insertStyleElement=_();p()(C.A,E);C.A&&C.A.locals&&C.A.locals;var T=r(184),A={attributes:{"data-cke":!0}};A.setAttributes=y(),A.insert=f().bind(null,"head"),A.domAPI=m(),A.insertStyleElement=_();p()(T.A,A);T.A&&T.A.locals&&T.A.locals;const I=S;function S(t,e){const r=M();return(S=function(t,e){return r[t-=137]})(t,e)}function M(){const t=["registerIntegration","forEach","uploadcareLicenseKeyDomainLimit","31EPBraj","type","uploadcareLicenseKeyNotAllowed","GPhotos","url","isOfficialPlugin","execute","_getIntegrationKey","upload","isPremiumPlugin","207CXBfwS","Uploadcare","push","uploadcareLicenseKeyExpired","uploadcareLicenseKeyEvaluationLimit","_normalizeConfigSourceList","uploadcareLicenseKeyInvalid","91ppuyTC","13330ZkJlBa","_createToolbarButton","isEnabled","705COjMdo","licenseKey","withText","config","assetManager","plugins","2172UjdvHP","featureNotAllowed","locale","UploadcareUI","entries","URL","GDrive","16716fvNKHy","Local","Dropbox","get","destroy","afterInit","_createButton","bind","domainLimit","map","ImageInsertUI","89118Vordch","label","init","has","Insert","OneDrive","usageLimit","_licenseKeyCheckInterval","uploadcareLicenseKeyTrialLimit","text","1843544zJKtav","7711YaYTjy","Facebook","editor","uploadcare.uploader.sourceList","Replace","trialLimit","commands","shortText","_showLicenseError","uploadcareLicenseKeyValid","1128XOsQBU","isImageSelected","reduce","tooltip","_createDropdownButtons","evaluationLimit","uploadcare","_createMenuBarButtons","uploadcareLicenseKeyUsageLimit","invalid","expired","pluginName","550068fEoPnE","icon"];return(M=function(){return t})()}!function(t){const e=S,r=t();for(;;)try{if(150186===-parseInt(e(181))/1*(-parseInt(e(215))/2)+-parseInt(e(176))/3+parseInt(e(208))/4*(parseInt(e(202))/5)+parseInt(e(143))/6*(parseInt(e(198))/7)+-parseInt(e(153))/8+parseInt(e(191))/9*(-parseInt(e(199))/10)+-parseInt(e(154))/11*(-parseInt(e(164))/12))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(M);class $ extends a.Plugin{[I(203)];[I(150)];static get[I(175)](){return I(211)}static get[I(186)](){return!0}static get[I(190)](){return!0}[I(145)](){const t=I;this[t(203)]=this[t(156)][t(205)][t(218)](t(203));const e=this[t(156)];this[t(150)]=setInterval(()=>{const r=t;let i;for(const t in e){const o=t,n=e[o];if(r(163)==n||r(197)==n||r(194)==n||r(180)==n||r(183)==n||r(195)==n||r(151)==n||r(172)==n){delete e[o],i=n,clearInterval(this[r(150)]),this[r(150)]=void 0;break}}r(197)==i&&e[r(162)](r(173)),r(194)==i&&e[r(162)](r(174)),r(180)==i&&e[r(162)](r(140)),r(183)==i&&e[r(162)](r(209),r(192)),r(195)==i&&e[r(162)](r(169)),r(151)==i&&e[r(162)](r(159)),r(172)==i&&e[r(162)](r(149))},1e3)}[I(137)](){const t=I,{editor:e}=this,r=e[t(160)][t(218)](t(170));if(!r)return;const i=this[t(196)](e[t(205)][t(218)](t(157)))[t(166)]((e,r)=>{const i=t,o=this[i(188)](r[i(182)]);return e[o]||(e[o]=[]),e[o][i(193)](r),e},{});e[t(207)][t(146)](t(142))&&e[t(160)][t(218)](t(170))&&Object[t(212)](i)[t(179)](([i,o])=>{const n=t;e[n(207)][n(218)](n(142))[n(178)]({name:i,observable:()=>r,buttonViewCreator:()=>this[n(200)](o),formViewCreator:()=>this[n(168)](o),menuBarButtonViewCreator:()=>this[n(171)](o),override:n(206)!==i})})}[I(219)](){const t=I;super[t(219)](),this[t(150)]&&clearInterval(this[t(150)])}[I(196)](t){const r=I,{locale:i}=this[r(156)];return t[r(141)](t=>{const o=r,n=d(i,t,o(147));switch(t){case e[o(216)]:return{icon:s.IconUploadcareImageUpload,type:e[o(216)],...n};case e[o(213)]:return{icon:s.IconUploadcareLink,type:e[o(213)],...n};case e[o(217)]:return{icon:s.IconDropbox,type:e[o(217)],...n};case e[o(155)]:return{icon:s.IconFacebook,type:e[o(155)],...n};case e[o(214)]:return{icon:s.IconGoogleDrive,type:e[o(214)],...n};case e[o(184)]:return{icon:s.IconGooglePhotos,type:e[o(184)],...n};case e[o(148)]:return{icon:s.IconOneDrive,type:e[o(148)],...n}}})}[I(188)](t){const r=I;switch(t){case e[r(216)]:return r(189);case e[r(213)]:return r(185);default:return r(206)}}[I(138)](t,e){const r=I,i=this[r(156)],o=new t(i[r(210)]),n=i[r(160)][r(218)](r(170));return o[r(139)](r(201)).to(n),o.on(r(187),()=>{n[r(187)](e)}),o}[I(200)](t){const e=I,{locale:r}=this[e(156)],i=this[e(156)][e(207)][e(218)](e(142)),o=t[0],n=this[e(138)](c.ButtonView,o[e(182)]);return n[e(177)]=o[e(177)],n[e(139)](e(144)).to(i,e(165),t=>d(r,o[e(182)],e(t?158:147))[e(152)]),n[e(167)]=!0,n}[I(168)](t){const e=I,{locale:r}=this[e(156)],i=this[e(156)][e(207)][e(218)](e(142));return t[e(141)](t=>{const o=e,n=this[o(138)](c.ButtonView,t[o(182)]);return n[o(204)]=!0,n[o(177)]=t[o(177)],n[o(139)](o(144)).to(i,o(165),e=>d(r,t[o(182)],o(e?158:147))[o(152)]),n})}[I(171)](t){const e=I;return t[e(141)](t=>{const r=e,i=this[r(138)](c.MenuBarMenuListItemButtonView,t[r(182)]);return i[r(177)]=t[r(177)],i[r(144)]=t[r(161)],i})}}var L=r(584),O=r(908),R={attributes:{"data-cke":!0}};R.setAttributes=y(),R.insert=f().bind(null,"head"),R.domAPI=m(),R.insertStyleElement=_();p()(O.A,R);O.A&&O.A.locals&&O.A.locals;var U=N;function P(){var t=["focusCycler","456aBgPAM","4990NEVVlW","814575DbXIiF","focusTracker","fire","true","44786fKDhqJ","1244064kgQFxV","70370jevMqN","createCollection","forwardCycle","1456458WzNseW","bindTemplate","div","8262mIFWWj","33BsFsxL","4852RSyyGf","getFocusableElement"];return(P=function(){return t})()}function N(t,e){var r=P();return(N=function(t,e){return r[t-=109]})(t,e)}!function(t){for(var e=N,r=t();;)try{if(203150===parseInt(e(116))/1+-parseInt(e(124))/2*(-parseInt(e(123))/3)+-parseInt(e(115))/4+-parseInt(e(110))/5+-parseInt(e(119))/6+-parseInt(e(114))/7*(-parseInt(e(127))/8)+-parseInt(e(122))/9*(-parseInt(e(109))/10))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(P);class z extends c.View{[U(111)];[U(126)];constructor(t){var e=U;super(t),this[e(111)]=new L.FocusTracker,this[e(126)]=new c.FocusCycler({focusables:this[e(117)](),focusTracker:this[e(111)]})}[U(125)](){var t=U;return{tag:t(121),attributes:{"aria-hidden":t(113),tabindex:"0"},on:{focus:this[t(120)].to(()=>{var e=t;this[e(126)][e(112)](e(118))})}}}}var D=V;function F(){var t=["10048210pNDetN","ck-reset_all-excluded","ck-uploadcare-theme","div","focus","element","945839tnimou","getFocusableElement","1509XILLBo","6867688RNjhuM","681750KMGcfR","24eZgCkp","uc-file-uploader-inline","uc-light","2mDsCWx","uploader-","1460718QyHPDq","ck-uploadcare-form","setTemplate","9644iBIBtO","3855150HiqeNT"];return(F=function(){return t})()}function V(t,e){var r=F();return(V=function(t,e){return r[t-=219]})(t,e)}!function(t){for(var e=V,r=t();;)try{if(905536===-parseInt(e(230))/1*(-parseInt(e(238))/2)+-parseInt(e(232))/3*(-parseInt(e(222))/4)+-parseInt(e(234))/5+-parseInt(e(235))/6*(parseInt(e(219))/7)+-parseInt(e(233))/8+-parseInt(e(223))/9+parseInt(e(224))/10)break;r.push(r.shift())}catch(t){r.push(r.shift())}}(F);class B extends z{constructor(t,e){var r=V;super(t),this[r(221)]({tag:r(227),attributes:{class:["ck",r(225),r(220)],tabindex:"-1"},children:[{tag:r(236),attributes:{class:[r(237),r(226)],"ctx-name":r(239)+e}},this[r(231)]()]})}[D(228)](){var t=D;this[t(229)][t(228)]()}}function j(t,e){const r=q();return(j=function(t,e){return r[t-=380]})(t,e)}function H(t,e){const r=j,i=[320,480,768,1024,1200,1600,1920,2400][r(409)](t=>t<=e)[r(427)](e=>t[r(436)](/\/$/,"")+r(415)+e+r(381)+e+"w");return{imageFallbackUrl:t,imageSources:[{srcset:i[r(429)](", "),sizes:r(396)+e+r(406)+e+"px",type:r(395)}]}}function q(){const t=["origin","height","8386532imVAye","some","replace","plugins","hasAttribute","x/ ","addClass","toViewElement","uploadcareImageId","43138854aHCnQA","6QYyZkN","removeStyle","image-processing","imageInline","get","match","236VOUAmi","change","getAttribute","image/webp","(max-width: ","1016BzYmGj","listenTo","domConverter","isArray","1922754UKQnxu","ImageUtils","stopListening","editing","setStyle","px) 100vw, ","79353WkjYeb","src","filter","document","aspect-ratio","load","viewToDom","26577UKNzHz","/-/resize/","location","element","mapper","removeClass","1FIscQb","4707185wvcJZz","width","findViewImgElement","view","baseURI","4350350LIqKpl","map","function","join","imageBlock","window"];return(q=function(){return t})()}function K(t,e,r){const i=t[j(391)](/\/crop\/(\d+)x(\d+)\//);return{width:i?parseInt(i[1],10):e,height:i?parseInt(i[2],10):r}}function G(t,e){const r=j,i=new((0,L.DomEmitterMixin)()),o=t[r(437)][r(390)](r(402)),n=t[r(404)][r(418)][r(383)](e),a=o[r(423)](n),s=t[r(404)][r(424)][r(399)][r(413)](a),c=e[r(394)](r(422)),l=e[r(394)](r(433)),u=r(388);t[r(404)][r(424)][r(393)](t=>{const e=r;t[e(382)](u,n),t[e(405)](e(411),c+"/"+l,a)}),i[r(398)](s,r(412),()=>{const e=r;i[e(403)](s,e(412)),t[e(404)][e(424)][e(393)](t=>{const r=e;t[r(419)](u,n),t[r(387)](r(411),a)})})}function W(t){const e=j;if(Array[e(400)](t)){const r=t[e(427)](W);return t=>r[e(435)](e=>e(t))}if(e(432)==t){const t=L.global[e(431)][e(416)][e(432)];return r=>new URL(r,L.global[e(410)][e(425)])[e(432)]==t}return e(428)==typeof t?t:t instanceof RegExp?r=>!(!r[e(391)](t)&&!r[e(436)](/^https?:\/\//,"")[e(391)](t)):()=>!1}function X(){var t=["4VkxiQt","2977920mLoYOU","4302AbkNIk","5744MhVTXo","27112TTQZnV","140PkpKyl","1737933GrxKPU","39FCTatw","includes","18363554ZtZlcl","11976BzaFcc","target","1626688AQFHeO"];return(X=function(){return t})()}function Z(t,e){var r=X();return(Z=function(t,e){return r[t-=248]})(t,e)}function Y(t,e){var r=Z;return(0,L.getAncestors)(t[r(256)])[r(253)](e)}!function(t){const e=j,r=t();for(;;)try{if(658781===parseInt(e(420))/1*(-parseInt(e(401))/2)+parseInt(e(414))/3*(parseInt(e(392))/4)+-parseInt(e(421))/5+-parseInt(e(386))/6*(parseInt(e(434))/7)+-parseInt(e(397))/8*(parseInt(e(407))/9)+parseInt(e(426))/10+parseInt(e(385))/11)break;r.push(r.shift())}catch(t){r.push(r.shift())}}(q),function(t){for(var e=Z,r=t();;)try{if(895103===parseInt(e(252))/1*(-parseInt(e(249))/2)+parseInt(e(251))/3*(-parseInt(e(258))/4)+-parseInt(e(250))/5*(-parseInt(e(255))/6)+parseInt(e(257))/7+-parseInt(e(248))/8*(-parseInt(e(260))/9)+-parseInt(e(259))/10+parseInt(e(254))/11)break;r.push(r.shift())}catch(t){r.push(r.shift())}}(X);const Q=J;function J(t,e){const r=tt();return(J=function(t,e){return r[t-=248]})(t,e)}function tt(){const t=["setAttribute","image","removeAllFiles","EDITOR_TOP_CENTER","insertImage","change","_api","getLastPosition","length","imageInline","40810naQYxk","9312309ExRsqL","setSelection","4XKWAVT","_insertAsset","focus","imageInfo","getOutputCollectionState","ucContextId","Local","isOpen","linkHref","Insert","addEventListener","allEntries","execute","6062245ZAiHzk","selection","done-click","element","getSelectedElement","hide","idle","7307848KRPEGk","50vCuliC","width","_formView","_initListeners","document","4213hsjRng","plugins","source-list","removeSelectionAttribute","show","_editor","view","configElement","_type","setCurrentActivity","_initDialog","Replace","2505387nbbeIg","model","_dialog","uploadCare","status","_editing","editing","text","_insertImage","stopDelegating","2946CwMsgT","get","attributes","stopListening","ctxElement","destroy","initFlow","9ZxovEy","getAPI","doneFlow","uuid","detail","imageBlock","208990GmNEtP"];return(tt=function(){return t})()}!function(t){const e=J,r=t();for(;;)try{if(874496===-parseInt(e(250))/1*(parseInt(e(256))/2)+-parseInt(e(308))/3*(parseInt(e(270))/4)+-parseInt(e(291))/5*(-parseInt(e(318))/6)+-parseInt(e(283))/7+parseInt(e(290))/8+parseInt(e(268))/9+parseInt(e(267))/10*(parseInt(e(296))/11))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(tt);class et extends((0,L.ObservableMixin)()){[Q(301)];[Q(310)];[Q(313)];[Q(263)];[Q(304)]=null;[Q(293)]=null;constructor(t,e,r){const i=Q;super(),this[i(301)]=t,this[i(313)]=e,this[i(310)]=t[i(297)][i(319)](c.Dialog),this[i(263)]=e[i(322)][i(251)](),this[i(304)]=r,this[i(313)][i(303)][i(257)](i(298),this[i(304)]),this[i(306)](),this[i(294)](),this[i(263)][i(249)]()}[Q(248)](){const t=Q;this[t(293)]&&(this[t(293)][t(248)](),this[t(293)]=null),this[t(263)]&&this[t(263)][t(252)](),this[t(321)](),this[t(317)]()}[Q(306)](){const t=Q,{locale:e,model:r}=this[t(301)],i=r[t(295)][t(284)][t(287)](),o=i&&(i.is(t(286),t(255))||i.is(t(286),t(266)));this[t(293)]=new B(e,this[t(313)][t(275)]),this[t(310)][t(300)]({id:t(311),icon:s.IconUploadcareImageUpload,title:d(e,this[t(304)],t(o?307:279))[t(315)],content:this[t(293)],position:c.DialogViewPosition[t(260)],isModal:!0,onShow:()=>{const e=t;this[e(293)][e(272)]()},onHide:()=>{const e=t;this[e(263)][e(259)](),this[e(301)][e(314)][e(302)][e(272)](),this[e(248)]()},keystrokeHandlerOptions:{filter:e=>!Y(e,this[t(293)][t(286)])}})}[Q(294)](){const t=Q;this[t(313)][t(322)][t(280)](t(285),()=>{const e=t,{allEntries:r}=this[e(263)][e(274)]();this[e(301)][e(309)][e(262)](t=>{const i=e,o=r[i(265)];for(const e of r){const n=e===r[o-1],{cdnUrl:a,fileInfo:s}=e;if(!a||!s)continue;const{width:c,height:l}=s[i(273)],u=K(a,c,l),d=H(a,u[i(292)]),h={id:s[i(253)],type:i(258),attributes:{imageDimension:u,...d}};this[i(271)](h,n,t)}}),this[e(310)][e(288)]()}),this[t(313)][t(322)][t(280)](t(262),r=>{const i=t;i(289)===r[i(254)][i(312)]&&!r[i(254)][i(281)][i(265)]&&this[i(310)][i(277)]&&(this[i(304)]===e[i(276)]?this[i(263)][i(305)](e[i(276)]):this[i(263)][i(249)]())})}[Q(271)](t,e,r){const i=Q,o=this[i(301)][i(309)][i(295)][i(284)],n=o[i(287)](),a=!(!n||!n.is(i(286),i(266)));r[i(299)](i(278)),this[i(316)](t,a),e||r[i(269)](o[i(264)]())}[Q(316)](t,e){const r=Q,i=this[r(301)],{imageDimension:o,imageFallbackUrl:n,imageSources:a}=t[r(320)];i[r(282)](r(261),{imageType:e?r(266):null,source:{uploadcareImageId:t.id,src:n,sources:a,...o}})}}var rt=ot;function it(){var t=["insertImage","refresh","366714PRfIXR","get","2171031bjaTWA","plugins","96OQejdT","editor","7GeMQzu","9959030RRftve","execute","_editing","263727sgQqaf","commands","8VcPntW","_controller","24840PLjSJN","978073nvlRam","destroy","11HUTALf","requires","_checkEnabled","isEnabled","2529874kFgJWp"];return(it=function(){return t})()}function ot(t,e){var r=it();return(ot=function(t,e){return r[t-=498]})(t,e)}!function(t){for(var e=ot,r=t();;)try{if(733084===parseInt(e(504))/1+parseInt(e(510))/2+-parseInt(e(515))/3+-parseInt(e(517))/4*(-parseInt(e(503))/5)+-parseInt(e(513))/6*(-parseInt(e(519))/7)+-parseInt(e(501))/8*(-parseInt(e(499))/9)+-parseInt(e(520))/10*(parseInt(e(506))/11))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(it);class nt extends a.Command{[rt(498)];[rt(502)]=null;static get[rt(507)](){return[c.Dialog,be]}constructor(t){var e=rt;super(t),this[e(498)]=t[e(516)][e(514)](be)}[rt(512)](){var t=rt;this[t(509)]=this[t(508)]()}[rt(521)](t){var e=rt;this[e(502)]&&(this[e(502)][e(505)](),this[e(502)]=null),this[e(502)]=new et(this[e(518)],this[e(498)],t)}[rt(508)](){var t=rt;return this[t(518)][t(500)][t(514)](t(511))[t(509)]}}var at=r(260);function st(t){return"[object Object]"===Object.prototype.toString.call(t)}const ct=/\W|_/g;function lt(t){return t.split(ct).map((t,e)=>t.charAt(0)[e>0?"toUpperCase":"toLowerCase"]()+t.slice(1)).join("")}function ut(t,{ignoreKeys:e}={ignoreKeys:[]}){return Array.isArray(t)?t.map(t=>dt(t,{ignoreKeys:e})):t}function dt(t,{ignoreKeys:e}={ignoreKeys:[]}){if(Array.isArray(t))return ut(t,{ignoreKeys:e});if(!st(t))return t;const r={};for(const i of Object.keys(t)){let o=t[i];e.includes(i)?r[i]=o:(st(o)?o=dt(o,{ignoreKeys:e}):Array.isArray(o)&&(o=ut(o,{ignoreKeys:e})),r[lt(i)]=o)}return r}const ht={factor:2,time:100};function pt(t,e=ht){let r=0;return function t(i){const o=Math.round(e.time*e.factor**r);return i({attempt:r,retry:e=>(t=>new Promise(e=>setTimeout(e,t)))(e??o).then(()=>(r+=1,t(i)))})}(t)}class gt extends Error{}class mt extends gt{originalProgressEvent;constructor(t){super(),this.name="NetworkError",this.message="Network error",Object.setPrototypeOf(this,mt.prototype),this.originalProgressEvent=t}}const bt=(t,e)=>{t&&(t.aborted?Promise.resolve().then(e):t.addEventListener("abort",()=>e(),{once:!0}))};class ft extends gt{isCancel=!0;constructor(t="Request canceled"){super(t),this.name="CancelError",Object.setPrototypeOf(this,ft.prototype)}}const vt=({check:t,interval:e=500,timeout:r,signal:i})=>new Promise((o,n)=>{let a,s;bt(i,()=>{a&&clearTimeout(a),n(new ft("Poll cancelled"))}),r&&(s=setTimeout(()=>{a&&clearTimeout(a),n(new ft("Timed out"))},r));const c=()=>{try{Promise.resolve(t(i)).then(t=>{t?(s&&clearTimeout(s),o(t)):a=setTimeout(c,e)}).catch(t=>{s&&clearTimeout(s),n(t)})}catch(t){s&&clearTimeout(s),n(t)}};a=setTimeout(c,0)}),yt={baseCDN:"https://ucarecdn.com",baseURL:"https://upload.uploadcare.com",maxContentLength:52428800,retryThrottledRequestMaxTimes:1,retryNetworkErrorMaxTimes:3,multipartMinFileSize:26214400,multipartChunkSize:5242880,multipartMinLastPartSize:1048576,maxConcurrentRequests:4,pollingTimeoutMilliseconds:1e4,pusherKey:"79ae88bd931ea68464d9"},wt="application/octet-stream",_t="original",kt=({method:t,url:e,data:r,headers:i={},signal:o,onProgress:n})=>new Promise((a,s)=>{const c=new XMLHttpRequest,l=t?.toUpperCase()||"GET";let u=!1;c.open(l,e,!0),i&&Object.entries(i).forEach(t=>{const[e,r]=t;void 0!==r&&!Array.isArray(r)&&c.setRequestHeader(e,r)}),c.responseType="text",bt(o,()=>{u=!0,c.abort(),s(new ft)}),c.onload=()=>{if(200!=c.status)s(new Error(`Error ${c.status}: ${c.statusText}`));else{const t={method:l,url:e,data:r,headers:i||void 0,signal:o,onProgress:n},s=c.getAllResponseHeaders().trim().split(/[\r\n]+/),u={};s.forEach(function(t){const e=t.split(": "),r=e.shift(),i=e.join(": ");r&&void 0!==r&&(u[r]=i)});const d=c.response,h=c.status;a({request:t,data:d,headers:u,status:h})}},c.onerror=t=>{u||s(new mt(t))},n&&"function"==typeof n&&(c.upload.onprogress=t=>{t.lengthComputable?n({isComputable:!0,value:t.loaded/t.total}):n({isComputable:!1})}),r?c.send(r):c.send()});const xt=function(t,...e){return t};const Ct=t=>"undefined"!=typeof Blob&&t instanceof Blob,Et=t=>"undefined"!=typeof File&&t instanceof File,Tt=t=>!!t&&"object"==typeof t&&!Array.isArray(t)&&"uri"in t&&"string"==typeof t.uri,At=t=>Ct(t)||Et(t)||Tt(t);function It(t,e,r){if(Array.isArray(r))for(const i of r)It(t,`${e}[]`,i);else if((i=r)&&"object"==typeof i&&"data"in i&&At(i.data)){const{name:i,contentType:o}=r,n=xt(r.data,i,o??wt),a=(({name:t})=>t?[t]:[])({name:i,contentType:o});t.push([e,n,...a])}else if((t=>!!t&&"object"==typeof t&&!Array.isArray(t))(r))for(const[i,o]of Object.entries(r))void 0!==o&&t.push([`${e}[${i}]`,String(o)]);else(t=>"string"==typeof t||"number"==typeof t||void 0===t)(r)&&r&&t.push([e,r.toString()]);var i}function St(t){const e=new FormData,r=function(t){const e=[];for(const[r,i]of Object.entries(t))It(e,r,i);return e}(t);for(const t of r){const[r,i,...o]=t;e.append(r,i,...o)}return e}class Mt extends gt{code;request;response;headers;constructor(t,e,r,i,o){super(),this.name="UploadError",this.message=t,this.code=e,this.request=r,this.response=i,this.headers=o,Object.setPrototypeOf(this,Mt.prototype)}}const $t=(t,e,r)=>{const i=new URL(t);return i.pathname=(i.pathname+e).replace("//","/"),r&&(i.search=(t=>{const e=new URLSearchParams;for(const[r,i]of Object.entries(t))i&&"object"==typeof i&&!Array.isArray(i)?Object.entries(i).filter(t=>t[1]??!1).forEach(t=>e.set(`${r}[${t[0]}]`,String(t[1]))):Array.isArray(i)?i.forEach(t=>{e.append(`${r}[]`,t)}):"string"==typeof i&&i?e.set(r,i):"number"==typeof i&&e.set(r,i.toString());return e.toString()})(r)),i.toString()};function Lt(t){return function({libraryName:t,libraryVersion:e,userAgent:r,publicKey:i="",integration:o=""}){const n="JavaScript";return"string"==typeof r?r:"function"==typeof r?r({publicKey:i,libraryName:t,libraryVersion:e,languageName:n,integration:o}):`${[t,e,i].filter(Boolean).join("/")} (${[n,o].filter(Boolean).join("; ")})`}({libraryName:"UploadcareUploadClient",libraryVersion:"6.14.3",...t})}function Ot(t,e){const{retryThrottledRequestMaxTimes:r,retryNetworkErrorMaxTimes:i}=e;return pt(({attempt:e,retry:o})=>t().catch(t=>{if("response"in t&&"RequestThrottledError"===t?.code&&e<r)return o(function(t){const{headers:e}=t||{};if(!e||"string"!=typeof e["retry-after"])return 15e3;const r=parseInt(e["retry-after"],10);return Number.isFinite(r)?1e3*r:15e3}(t));if(t instanceof mt&&e<i)return o(1e3*(e+1));throw t}))}const Rt=t=>{let e="";return(Ct(t)||Et(t)||Tt(t))&&(e=t.type),e||wt},Ut=t=>{let e="";return Et(t)&&t.name?e=t.name:Ct(t)?e="":Tt(t)&&t.name&&(e=t.name),e||_t};function Pt(t){return void 0===t||"auto"===t?"auto":t?"1":"0"}function Nt(t,{publicKey:e,fileName:r,contentType:i,baseURL:o=yt.baseURL,secureSignature:n,secureExpire:a,store:s,signal:c,onProgress:l,source:u="local",integration:d,userAgent:h,retryThrottledRequestMaxTimes:p=yt.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:g=yt.retryNetworkErrorMaxTimes,metadata:m}){return Ot(()=>kt({method:"POST",url:$t(o,"/base/",{jsonerrors:1}),headers:{"X-UC-User-Agent":Lt({publicKey:e,integration:d,userAgent:h})},data:St({file:{data:t,name:r||Ut(t),contentType:i||Rt(t)},UPLOADCARE_PUB_KEY:e,UPLOADCARE_STORE:Pt(s),signature:n,expire:a,source:u,metadata:m}),signal:c,onProgress:l}).then(({data:t,headers:e,request:r})=>{const i=dt(JSON.parse(t));if("error"in i)throw new Mt(i.error.content,i.error.errorCode,r,i,e);return i}),{retryNetworkErrorMaxTimes:g,retryThrottledRequestMaxTimes:p})}var zt,Dt;function Ft(t,{publicKey:e,baseURL:r=yt.baseURL,store:i,fileName:o,checkForUrlDuplicates:n,saveUrlForRecurrentUploads:a,secureSignature:s,secureExpire:c,source:l="url",signal:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p=yt.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:g=yt.retryNetworkErrorMaxTimes,metadata:m}){return Ot(()=>kt({method:"POST",headers:{"X-UC-User-Agent":Lt({publicKey:e,integration:d,userAgent:h})},url:$t(r,"/from_url/",{jsonerrors:1,pub_key:e,source_url:t,store:Pt(i),filename:o,check_URL_duplicates:n?1:void 0,save_URL_duplicates:a?1:void 0,signature:s,expire:c,source:l,metadata:m}),signal:u}).then(({data:t,headers:e,request:r})=>{const i=dt(JSON.parse(t));if("error"in i)throw new Mt(i.error.content,i.error.errorCode,r,i,e);return i}),{retryNetworkErrorMaxTimes:g,retryThrottledRequestMaxTimes:p})}!function(t){t.Token="token",t.FileInfo="file_info"}(zt||(zt={})),function(t){t.Unknown="unknown",t.Waiting="waiting",t.Progress="progress",t.Error="error",t.Success="success"}(Dt||(Dt={}));function Vt(t,{publicKey:e,baseURL:r=yt.baseURL,signal:i,integration:o,userAgent:n,retryThrottledRequestMaxTimes:a=yt.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:s=yt.retryNetworkErrorMaxTimes}={}){return Ot(()=>kt({method:"GET",headers:e?{"X-UC-User-Agent":Lt({publicKey:e,integration:o,userAgent:n})}:void 0,url:$t(r,"/from_url/status/",{jsonerrors:1,token:t}),signal:i}).then(({data:t,headers:e,request:r})=>{const i=dt(JSON.parse(t));if("error"in i&&!(t=>"status"in t&&t.status===Dt.Error)(i))throw new Mt(i.error.content,i.error.errorCode,r,i,e);return i}),{retryNetworkErrorMaxTimes:s,retryThrottledRequestMaxTimes:a})}function Bt(t,{publicKey:e,baseURL:r=yt.baseURL,signal:i,source:o,integration:n,userAgent:a,retryThrottledRequestMaxTimes:s=yt.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:c=yt.retryNetworkErrorMaxTimes}){return Ot(()=>kt({method:"GET",headers:{"X-UC-User-Agent":Lt({publicKey:e,integration:n,userAgent:a})},url:$t(r,"/info/",{jsonerrors:1,pub_key:e,file_id:t,source:o}),signal:i}).then(({data:t,headers:e,request:r})=>{const i=dt(JSON.parse(t));if("error"in i)throw new Mt(i.error.content,i.error.errorCode,r,i,e);return i}),{retryThrottledRequestMaxTimes:s,retryNetworkErrorMaxTimes:c})}function jt(t,{publicKey:e,contentType:r,fileName:i,multipartChunkSize:o=yt.multipartChunkSize,baseURL:n="",secureSignature:a,secureExpire:s,store:c,signal:l,source:u="local",integration:d,userAgent:h,retryThrottledRequestMaxTimes:p=yt.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:g=yt.retryNetworkErrorMaxTimes,metadata:m}){return Ot(()=>kt({method:"POST",url:$t(n,"/multipart/start/",{jsonerrors:1}),headers:{"X-UC-User-Agent":Lt({publicKey:e,integration:d,userAgent:h})},data:St({filename:i||_t,size:t,content_type:r||wt,part_size:o,UPLOADCARE_STORE:Pt(c),UPLOADCARE_PUB_KEY:e,signature:a,expire:s,source:u,metadata:m}),signal:l}).then(({data:t,headers:e,request:r})=>{const i=dt(JSON.parse(t));if("error"in i)throw new Mt(i.error.content,i.error.errorCode,r,i,e);return i.parts=Object.keys(i.parts).map(t=>i.parts[Number(t)]),i}),{retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g})}function Ht(t,e,{contentType:r,signal:i,onProgress:o,retryThrottledRequestMaxTimes:n=yt.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:a=yt.retryNetworkErrorMaxTimes}){return Ot(()=>kt({method:"PUT",url:e,data:t,onProgress:o,signal:i,headers:{"Content-Type":r||wt}}).then(t=>(o&&o({isComputable:!0,value:1}),t)).then(({status:t})=>({code:t})),{retryThrottledRequestMaxTimes:n,retryNetworkErrorMaxTimes:a})}function qt(t,{publicKey:e,baseURL:r=yt.baseURL,source:i="local",signal:o,integration:n,userAgent:a,retryThrottledRequestMaxTimes:s=yt.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:c=yt.retryNetworkErrorMaxTimes}){return Ot(()=>kt({method:"POST",url:$t(r,"/multipart/complete/",{jsonerrors:1}),headers:{"X-UC-User-Agent":Lt({publicKey:e,integration:n,userAgent:a})},data:St({uuid:t,UPLOADCARE_PUB_KEY:e,source:i}),signal:o}).then(({data:t,headers:e,request:r})=>{const i=dt(JSON.parse(t));if("error"in i)throw new Mt(i.error.content,i.error.errorCode,r,i,e);return i}),{retryThrottledRequestMaxTimes:s,retryNetworkErrorMaxTimes:c})}function Kt(t,{publicKey:e,baseURL:r,source:i,integration:o,userAgent:n,retryThrottledRequestMaxTimes:a,retryNetworkErrorMaxTimes:s,signal:c,onProgress:l}){return vt({check:c=>Bt(t,{publicKey:e,baseURL:r,signal:c,source:i,integration:o,userAgent:n,retryThrottledRequestMaxTimes:a,retryNetworkErrorMaxTimes:s}).then(t=>t.isReady?t:(l&&l({isComputable:!0,value:1}),!1)),signal:c})}class Gt{uuid;name;size;isStored;isImage;mimeType;cdnUrl;s3Url;originalFilename;imageInfo;videoInfo;contentInfo;metadata;s3Bucket;defaultEffects=null;constructor(t,{baseCDN:e=yt.baseCDN,fileName:r}={}){const{uuid:i,s3Bucket:o}=t,n=$t(e,`${i}/`),a=o?$t(`https://${o}.s3.amazonaws.com/`,`${i}/${t.filename}`):null;this.uuid=i,this.name=r||t.filename,this.size=t.size,this.isStored=t.isStored,this.isImage=t.isImage,this.mimeType=t.mimeType,this.cdnUrl=n,this.originalFilename=t.originalFilename,this.imageInfo=t.imageInfo,this.videoInfo=t.videoInfo,this.contentInfo=t.contentInfo,this.metadata=t.metadata||null,this.s3Bucket=o||null,this.s3Url=a,function(t){return"defaultEffects"in t}(t)&&(this.defaultEffects=t.defaultEffects)}}const Wt=(t,{signal:e}={})=>{let r=null,i=null;const o=t.map(()=>new AbortController);return bt(e,()=>{o.forEach(t=>t.abort())}),Promise.all(t.map((t,e)=>{const n=(t=>()=>{i=t,o.forEach((e,r)=>r!==t&&e.abort())})(e);return Promise.resolve().then(()=>t({stopRace:n,signal:o[e].signal})).then(t=>(n(),t)).catch(t=>(r=t,null))})).then(t=>{if(null===i)throw r;return t[i]})};var Xt=window.WebSocket;class Zt{events=Object.create({});emit(t,e){this.events[t]?.forEach(t=>t(e))}on(t,e){this.events[t]=this.events[t]||[],this.events[t].push(e)}off(t,e){this.events[t]=e?this.events[t].filter(t=>t!==e):[]}}class Yt{key;disconnectTime;ws=void 0;queue=[];isConnected=!1;subscribers=0;emmitter=new Zt;disconnectTimeoutId=null;constructor(t,e=3e4){this.key=t,this.disconnectTime=e}connect(){if(this.disconnectTimeoutId&&clearTimeout(this.disconnectTimeoutId),!this.isConnected&&!this.ws){const t=`wss://ws.pusherapp.com/app/${this.key}?protocol=5&client=js&version=1.12.2`;this.ws=new Xt(t),this.ws.addEventListener("error",t=>{this.emmitter.emit("error",new Error(t.message))}),this.emmitter.on("connected",()=>{this.isConnected=!0,this.queue.forEach(t=>this.send(t.event,t.data)),this.queue=[]}),this.ws.addEventListener("message",t=>{const e=JSON.parse(t.data.toString());switch(e.event){case"pusher:connection_established":this.emmitter.emit("connected",void 0);break;case"pusher:ping":this.send("pusher:pong",{});break;case"progress":case"success":case"fail":this.emmitter.emit(e.channel,((t,e)=>"success"===t?{status:Dt.Success,...e}:"progress"===t?{status:Dt.Progress,...e}:{status:Dt.Error,...e})(e.event,JSON.parse(e.data)))}})}}disconnect(){const t=()=>{this.ws?.close(),this.ws=void 0,this.isConnected=!1};this.disconnectTime?this.disconnectTimeoutId=setTimeout(()=>{t()},this.disconnectTime):t()}send(t,e){const r=JSON.stringify({event:t,data:e});this.ws?.send(r)}subscribe(t,e){this.subscribers+=1,this.connect();const r=`task-status-${t}`,i={event:"pusher:subscribe",data:{channel:r}};this.emmitter.on(r,e),this.isConnected?this.send(i.event,i.data):this.queue.push(i)}unsubscribe(t){this.subscribers-=1;const e=`task-status-${t}`,r={event:"pusher:unsubscribe",data:{channel:e}};this.emmitter.off(e),this.isConnected?this.send(r.event,r.data):this.queue=this.queue.filter(t=>t.data.channel!==e),0===this.subscribers&&this.disconnect()}onError(t){return this.emmitter.on("error",t),()=>this.emmitter.off("error",t)}}let Qt=null;const Jt=t=>{if(!Qt){const e="undefined"==typeof window?0:3e4;Qt=new Yt(t,e)}return Qt};const te=(t,{publicKey:e,fileName:r,baseURL:i,baseCDN:o,checkForUrlDuplicates:n,saveUrlForRecurrentUploads:a,secureSignature:s,secureExpire:c,store:l,signal:u,onProgress:d,source:h,integration:p,userAgent:g,retryThrottledRequestMaxTimes:m,pusherKey:b=yt.pusherKey,metadata:f})=>{return Promise.resolve((v=b,void Jt(v).connect())).then(()=>Ft(t,{publicKey:e,fileName:r,baseURL:i,checkForUrlDuplicates:n,saveUrlForRecurrentUploads:a,secureSignature:s,secureExpire:c,store:l,signal:u,source:h,integration:p,userAgent:g,retryThrottledRequestMaxTimes:m,metadata:f})).catch(t=>{const e=Jt(b);return e?.disconnect(),Promise.reject(t)}).then(t=>t.type===zt.FileInfo?t:Wt([({signal:r})=>function({token:t,publicKey:e,baseURL:r,integration:i,userAgent:o,retryThrottledRequestMaxTimes:n,retryNetworkErrorMaxTimes:a,onProgress:s,signal:c}){return vt({check:c=>Vt(t,{publicKey:e,baseURL:r,integration:i,userAgent:o,retryThrottledRequestMaxTimes:n,retryNetworkErrorMaxTimes:a,signal:c}).then(e=>{switch(e.status){case Dt.Error:return new Mt(e.error,e.errorCode);case Dt.Waiting:return!1;case Dt.Unknown:return new Mt(`Token "${t}" was not found.`);case Dt.Progress:return s&&("unknown"===e.total?s({isComputable:!1}):s({isComputable:!0,value:e.done/e.total})),!1;case Dt.Success:return s&&s({isComputable:!0,value:e.done/e.total}),e;default:throw new Error("Unknown status")}}),signal:c})}({token:t.token,publicKey:e,baseURL:i,integration:p,userAgent:g,retryThrottledRequestMaxTimes:m,onProgress:d,signal:r}),({signal:e})=>(({token:t,pusherKey:e,signal:r,onProgress:i})=>new Promise((o,n)=>{const a=Jt(e),s=a.onError(n),c=()=>{s(),a.unsubscribe(t)};bt(r,()=>{c(),n(new ft("pusher cancelled"))}),a.subscribe(t,t=>{switch(t.status){case Dt.Progress:i&&("unknown"===t.total?i({isComputable:!1}):i({isComputable:!0,value:t.done/t.total}));break;case Dt.Success:c(),i&&i({isComputable:!0,value:t.done/t.total}),o(t);break;case Dt.Error:c(),n(new Mt(t.msg,t.error_code))}})}))({token:t.token,pusherKey:b,signal:e,onProgress:d})],{signal:u})).then(t=>{if(t instanceof Mt)throw t;return t}).then(t=>Kt(t.uuid,{publicKey:e,baseURL:i,integration:p,userAgent:g,retryThrottledRequestMaxTimes:m,onProgress:d,signal:u})).then(t=>new Gt(t,{baseCDN:o}));var v},ee=new WeakMap,re=async t=>{if(Et(t)||Ct(t))return t.size;if(Tt(t)){return(await(async t=>{if(ee.has(t))return ee.get(t);const e=await fetch(t.uri).then(t=>t.blob());return ee.set(t,e),e})(t)).size}throw new Error("Unknown file type. Cannot determine file size.")},ie=t=>{const e=new RegExp("[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}");return!At(t)&&e.test(t)},oe=t=>{const e=new RegExp("^(?:\\w+:)?\\/\\/([^\\s\\.]+\\.\\S{2}|localhost[\\:?\\d]*)\\S*$");return!At(t)&&e.test(t)},ne=async(t,e,r)=>i=>((t,e,r,i)=>{const o=i*e,n=Math.min(o+i,r);return t.slice(o,n)})(t,i,e,r),ae=async(t,{publicKey:e,fileName:r,fileSize:i,baseURL:o,secureSignature:n,secureExpire:a,store:s,signal:c,onProgress:l,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,contentType:m,multipartChunkSize:b=yt.multipartChunkSize,maxConcurrentRequests:f=yt.maxConcurrentRequests,baseCDN:v,metadata:y})=>{const w=i??await re(t);let _;const k=(t,e)=>{if(!l)return;_||(_=Array(t).fill(0));return r=>{var i;r.isComputable&&(_[e]=r.value,l({isComputable:!0,value:(i=_,i.reduce((t,e)=>t+e,0)/t)}))}};return m||=Rt(t),jt(w,{publicKey:e,contentType:m,fileName:r||Ut(t),baseURL:o,secureSignature:n,secureExpire:a,store:s,signal:c,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,metadata:y,multipartChunkSize:b}).then(async({uuid:r,parts:i})=>{const o=await ne(t,w,b);return Promise.all([r,(n=f,a=i.map((t,r)=>()=>((t,e,{publicKey:r,contentType:i,onProgress:o,signal:n,integration:a,retryThrottledRequestMaxTimes:s,retryNetworkErrorMaxTimes:c})=>Ht(t,e,{publicKey:r,contentType:i,onProgress:o,signal:n,integration:a,retryThrottledRequestMaxTimes:s,retryNetworkErrorMaxTimes:c}))(o(r),t,{publicKey:e,contentType:m,onProgress:k(i.length,r),signal:c,integration:d,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g})),new Promise((t,e)=>{const r=[];let i=!1,o=a.length;const s=[...a],c=()=>{const n=a.length-s.length,l=s.shift();l&&l().then(e=>{i||(r[n]=e,o-=1,o?c():t(r))}).catch(t=>{i=!0,e(t)})};for(let t=0;t<n;t++)c()}))]);var n,a}).then(([t])=>qt(t,{publicKey:e,baseURL:o,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g})).then(t=>t.isReady?t:Kt(t.uuid,{publicKey:e,baseURL:o,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,onProgress:l,signal:c})).then(t=>new Gt(t,{baseCDN:v}))};async function se(t,{publicKey:e,fileName:r,baseURL:i=yt.baseURL,secureSignature:o,secureExpire:n,store:a,signal:s,onProgress:c,source:l,integration:u,userAgent:d,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,contentType:g,multipartMinFileSize:m,multipartChunkSize:b,maxConcurrentRequests:f,baseCDN:v=yt.baseCDN,checkForUrlDuplicates:y,saveUrlForRecurrentUploads:w,pusherKey:_,metadata:k}){if(At(t)){const y=await re(t);return((t,e=yt.multipartMinFileSize)=>t>=e)(y,m)?ae(t,{publicKey:e,contentType:g,multipartChunkSize:b,fileSize:y,fileName:r,baseURL:i,secureSignature:o,secureExpire:n,store:a,signal:s,onProgress:c,source:l,integration:u,userAgent:d,maxConcurrentRequests:f,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,baseCDN:v,metadata:k}):((t,{publicKey:e,fileName:r,baseURL:i,secureSignature:o,secureExpire:n,store:a,contentType:s,signal:c,onProgress:l,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,baseCDN:m,metadata:b})=>Nt(t,{publicKey:e,fileName:r,contentType:s,baseURL:i,secureSignature:o,secureExpire:n,store:a,signal:c,onProgress:l,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,metadata:b}).then(({file:t})=>Kt(t,{publicKey:e,baseURL:i,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,onProgress:l,signal:c})).then(t=>new Gt(t,{baseCDN:m})))(t,{publicKey:e,fileName:r,contentType:g,baseURL:i,secureSignature:o,secureExpire:n,store:a,signal:s,onProgress:c,source:l,integration:u,userAgent:d,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,baseCDN:v,metadata:k})}if(oe(t))return te(t,{publicKey:e,fileName:r,baseURL:i,baseCDN:v,checkForUrlDuplicates:y,saveUrlForRecurrentUploads:w,secureSignature:o,secureExpire:n,store:a,signal:s,onProgress:c,source:l,integration:u,userAgent:d,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,pusherKey:_,metadata:k});if(ie(t))return((t,{publicKey:e,fileName:r,baseURL:i,signal:o,onProgress:n,source:a,integration:s,userAgent:c,retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:u,baseCDN:d})=>Bt(t,{publicKey:e,baseURL:i,signal:o,source:a,integration:s,userAgent:c,retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:u}).then(t=>new Gt(t,{baseCDN:d,fileName:r})).then(t=>(n&&n({isComputable:!0,value:1}),t)))(t,{publicKey:e,fileName:r,baseURL:i,signal:s,onProgress:c,source:l,integration:u,userAgent:d,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,baseCDN:v});throw new TypeError(`File uploading from "${t}" is not supported`)}function ce(t,e){var r=le();return(ce=function(t,e){return r[t-=304]})(t,e)}function le(){var t=["2250768kgfoPB","10340BBscXP","969621azyyPw","16UjapJD","13684MGJhfw","1487544xBLRwP","3783ReRKCp","getInfo","294DiWMnQ","upload","9HExrYz","2219JzOdNh","464430rZXLlb","15324hfkeSP"];return(le=function(){return t})()}var ue=ce;!function(t){for(var e=ce,r=t();;)try{if(942889===-parseInt(e(310))/1+parseInt(e(316))/2*(-parseInt(e(314))/3)+-parseInt(e(311))/4*(parseInt(e(306))/5)+-parseInt(e(307))/6*(-parseInt(e(305))/7)+parseInt(e(313))/8*(parseInt(e(304))/9)+parseInt(e(309))/10*(parseInt(e(312))/11)+parseInt(e(308))/12)break;r.push(r.shift())}catch(t){r.push(r.shift())}}(le);class de{static[ue(317)]({file:t,...e}){return se(t,e)}static[ue(315)](t,e){return Bt(t,e)}}class he extends a.Plugin{static get requires(){return["ImageUploadEditing","ImageUploadProgress",at.FileRepository,be]}static get pluginName(){return"UploadcareUploadAdapter"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}async afterInit(){const t=this.editor;t.config.get("uploadcare")&&(t.plugins.get(at.FileRepository).createUploadAdapter=e=>new pe(e,t),t.plugins.get("ImageUploadEditing").on("uploadComplete",(e,{imageElement:r,data:i})=>{t.model.change(t=>{t.setAttribute("uploadcareImageId",i.uploadcareImageId,r)})}))}}class pe{loader;editor;controller;constructor(t,e){this.loader=t,this.editor=e,this.controller=new AbortController}async upload(){const t=this.editor.t,e=await this.loader.file;return de.upload({file:e,publicKey:this.editor.config.get("uploadcare.pubkey"),baseURL:this.editor.config.get("uploadcare.uploader.baseUrl"),baseCDN:this.editor.config.get("uploadcare.uploader.cdnCname"),signal:this.controller.signal,onProgress:t=>{t&&t.isComputable&&(this.loader.uploadTotal=1,this.loader.uploaded=t.value)}}).then(async t=>{const{imageFallbackUrl:e,imageSources:r}=H(t.cdnUrl,t.imageInfo.width);return{uploadcareImageId:t.uuid,default:e,sources:r}}).catch(()=>{const r=t("Cannot upload file:")+" "+e.name+".";return Promise.reject(r)})}abort(){this.controller.abort()}}const ge=me;function me(t,e){const r=fe();return(me=function(t,e){return r[t-=392]})(t,e)}!function(t){const e=me,r=t();for(;;)try{if(354152===-parseInt(e(447))/1+-parseInt(e(429))/2+-parseInt(e(451))/3*(-parseInt(e(403))/4)+parseInt(e(426))/5*(-parseInt(e(395))/6)+parseInt(e(464))/7*(parseInt(e(452))/8)+-parseInt(e(439))/9+parseInt(e(407))/10)break;r.push(r.shift())}catch(t){r.push(r.shift())}}(fe);class be extends a.Plugin{[ge(400)]=null;[ge(438)]=null;static get[ge(459)](){return ge(419)}static get[ge(468)](){return[ge(444),he,c.Dialog]}static get[ge(431)](){return!0}static get[ge(469)](){return!0}[ge(406)];get[ge(475)](){return this[ge(400)]}get[ge(458)](){return this[ge(438)]}constructor(t){const e=ge;super(t),this[e(406)]=(0,L.uid)()}[ge(394)](){const t=ge,e=this[t(437)];e[t(393)][t(402)](t(413),new nt(e))}[ge(409)](){const t=ge;this[t(412)](),this[t(422)](),this[t(414)](),this[t(423)](),this[t(410)](),this[t(441)](this[t(437)],t(440),()=>{const e=t;this[e(400)]&&(this[e(400)][e(474)](),this[e(400)]=null),this[e(438)]&&(this[e(438)][e(474)](),this[e(438)]=null);const r=L.global[e(465)][e(418)](e(408));r&&r[e(474)]()}),async function(t){const e=g([104,103,80,54,56,112,113,99,55,79,66,74,120,57,117,51,122,114,72,97,116,89,85,88,102,48,52,84,100,86,107,77,70,109,119,67,115,53,83,68,65,118,106,50,49,105,87,81,71,101,90,75,76,121,82,108,69,78,110,111,73,98]),r=window[g([68,97,116,101])][g([110,111,119])](),i=t[g([101,100,105,116,111,114])],o=new(window[g([80,114,111,109,105,115,101])])(t=>{i[g([111,110,99,101])](g([114,101,97,100,121]),t)}),n={[g([107,116,121])]:g([69,67]),[g([117,115,101])]:g([115,105,103]),[g([99,114,118])]:g([80,45,50,53,54]),[g([120])]:g([105,67,106,79,67,118,68,70,73,54,108,81,72,72,84,49,56,106,86,119,82,102,107,102,72,81,50,97,95,77,121,109,84,51,53,76,81,86,111,70,83,65,73]),[g([121])]:g([107,88,73,121,74,52,101,118,116,67,69,70,82,109,120,75,83,85,112,75,57,102,68,87,52,53,57,118,88,79,118,86,114,104,102,54,117,81,65,101,79,105,111]),[g([97,108,103])]:g([69,83,50,53,54])},a=i[g([99,111,110,102,105,103])][g([103,101,116])](g([108,105,99,101,110,115,101,75,101,121]));function s(t){const e=[new(window[g([80,114,111,109,105,115,101])])(t=>setTimeout(t,605900)),o[g([116,104,101,110])](()=>new(window[g([80,114,111,109,105,115,101])])(t=>{let e=0;i[g([109,111,100,101,108])][g([111,110])](g([97,112,112,108,121,79,112,101,114,97,116,105,111,110]),(r,i)=>{i[0][g([105,115,68,111,99,117,109,101,110,116,79,112,101,114,97,116,105,111,110])]&&e++,504==e&&(t(),r[g([111,102,102])]())})}))];return window[g([80,114,111,109,105,115,101])][g([114,97,99,101])](e)[g([116,104,101,110])](()=>t)}function c(t){return t[g([115,116,97,114,116,115,87,105,116,104])](g([101,121]))?JSON[g([112,97,114,115,101])](l(t)):null}function l(t){return window[g([97,116,111,98])](t[g([114,101,112,108,97,99,101])](/-/g,g([43]))[g([114,101,112,108,97,99,101])](/_/g,g([47])))}function u(t){let e=5381;function r(t){for(let r=0;r<t[g([108,101,110,103,116,104])];r++){const i=t[g([99,104,97,114,67,111,100,101,65,116])](r);e=(e<<5)+e+i,e&=e}}return function t(e){Array[g([105,115,65,114,114,97,121])](e)?e[g([102,111,114,69,97,99,104])](t):e&&typeof e==g([111,98,106,101,99,116])?Object[g([101,110,116,114,105,101,115])](e)[g([115,111,114,116])]()[g([102,111,114,69,97,99,104])](([e,i])=>{r(e),t(i)}):r(window[g([83,116,114,105,110,103])](e))}(t),e>>>0}function d(t){return t[g([116,111,83,116,114,105,110,103])](16)[g([112,97,100,83,116,97,114,116])](8,g([48]))}function h(t){return t[g([115,112,108,105,116])]("")[g([114,101,118,101,114,115,101])]()[g([106,111,105,110])]("")}function p(){}function g(t){const e=me;return t[e(463)](t=>String[e(442)](t))[e(397)]("")}!function(t){const r=function(){const t=window[g([83,116,114,105,110,103])](window[g([112,101,114,102,111,114,109,97,110,99,101])][g([110,111,119])]())[g([114,101,112,108,97,99,101])](g([46]),"");let r=g([104]);for(let i=0;i<t[g([108,101,110,103,116,104])];i+=2){let o=window[g([112,97,114,115,101,73,110,116])](t[g([115,117,98,115,116,114,105,110,103])](i,i+2));o>=e[g([108,101,110,103,116,104])]&&(o-=e[g([108,101,110,103,116,104])]),r+=e[o]}return r}();i[r]=g([117,112,108,111,97,100,99,97,114,101,76,105,99,101,110,115,101,75,101,121])+t,t!=g([86,97,108,105,100])&&async function(){await o,i[g([109,111,100,101,108])][g([99,104,97,110,103,101])]=p,i[g([109,111,100,101,108])][g([101,110,113,117,101,117,101,67,104,97,110,103,101])]=p,i[g([101,110,97,98,108,101,82,101,97,100,79,110,108,121,77,111,100,101])](g([109,111,100,101,108]))}()}(await async function(){let t,e=null,p=null;try{return a==g([71,80,76])?g([78,111,116,65,108,108,111,119,101,100]):(t=function(){const t=a[g([115,112,108,105,116])](g([46]));return 3!=t[g([108,101,110,103,116,104])]?null:e(t[1]);function e(t){const e=c(t);return e&&r()?e:null;function r(){const t=e[g([106,116,105])],r=window[g([112,97,114,115,101,73,110,116])](t[g([115,117,98,115,116,114,105,110,103])](t[g([108,101,110,103,116,104])]-8),16),i={...e,[g([106,116,105])]:t[g([115,117,98,115,116,114,105,110,103])](0,t[g([108,101,110,103,116,104])]-8)};return delete i[g([118,99])],u(i)==r}}}(),t?(t[g([117,115,97,103,101,69,110,100,112,111,105,110,116])]&&(p=function(t,e){return new(window[g([80,114,111,109,105,115,101])])(s=>{if(n())return s(g([86,97,108,105,100]));a(),i[g([100,101,99,111,114,97,116,101])](g([95,115,101,110,100,85,115,97,103,101,82,101,113,117,101,115,116]));let c=!1;const l=(0,L.uid)();function p(t){return!!t&&(typeof t===g([111,98,106,101,99,116])||typeof t===g([102,117,110,99,116,105,111,110]))&&typeof t[g([116,104,101,110])]===g([102,117,110,99,116,105,111,110])&&typeof t[g([99,97,116,99,104])]===g([102,117,110,99,116,105,111,110])}function m(i){c(i)[g([116,104,101,110])](t=>t&&t[g([115,116,97,116,117,115])]==g([111,107])?d(u(l+e))!=t[g([118,101,114,105,102,105,99,97,116,105,111,110])]?g([85,115,97,103,101,76,105,109,105,116]):g([86,97,108,105,100]):g([85,115,97,103,101,76,105,109,105,116]))[g([116,104,101,110])](t=>(n(),t),()=>{const t=a();return null==t?(n(),g([86,97,108,105,100])):g(r-t>6048e5?[85,115,97,103,101,76,105,109,105,116]:[86,97,108,105,100])})[g([116,104,101,110])](s)[g([99,97,116,99,104])](()=>{s(g([85,115,97,103,101,76,105,109,105,116]))});const o=36e5;function n(){const e=g([108,108,99,116,45])+d(u(t)),i=h(d(window[g([77,97,116,104])][g([99,101,105,108])](r/o)));window[g([108,111,99,97,108,83,116,111,114,97,103,101])][g([115,101,116,73,116,101,109])](e,i)}function a(){const e=g([108,108,99,116,45])+d(u(t)),r=window[g([108,111,99,97,108,83,116,111,114,97,103,101])][g([103,101,116,73,116,101,109])](e);return r?window[g([112,97,114,115,101,73,110,116])](h(r),16)*o:null}function c(t){return new(window[g([80,114,111,109,105,115,101])])((e,r)=>{t[g([116,104,101,110])](e,r),window[g([115,101,116,84,105,109,101,111,117,116])](r,12e4)})}}i[g([111,110])](g([95,115,101,110,100,85,115,97,103,101,82,101,113,117,101,115,116]),(e,r)=>{if(r[0]!=t)return s(g([85,115,97,103,101,76,105,109,105,116]));r[1]={...r[1],[g([114,101,113,117,101,115,116,73,100])]:l}},{[g([112,114,105,111,114,105,116,121])]:g([104,105,103,104])}),i[g([111,110])](g([95,115,101,110,100,85,115,97,103,101,82,101,113,117,101,115,116]),t=>{p(t[g([114,101,116,117,114,110])])&&(c=!0,m(t[g([114,101,116,117,114,110])]))},{[g([112,114,105,111,114,105,116,121])]:g([108,111,119])}),o[g([116,104,101,110])](()=>{c||s(g([85,115,97,103,101,76,105,109,105,116]))})});function n(){return i[g([101,100,105,116,105,110,103])][g([118,105,101,119])][g([95,111,118,101,114,108,97,121,77,111,100,101,72,105,110,116])]==g([97,117,116,111])}function a(){i[g([101,100,105,116,105,110,103])][g([118,105,101,119])][g([95,111,118,101,114,108,97,121,77,111,100,101,72,105,110,116])]=g([97,117,116,111])}}(t[g([117,115,97,103,101,69,110,100,112,111,105,110,116])],t[g([106,116,105])])),await async function(){let t=!0;try{const i=a[g([115,112,108,105,116])](g([46])),[o,n,s]=i;return e(o),await r(o,n,s),t}catch{return!1}function e(e){const r=c(e);r&&r[g([97,108,103])]==g([69,83,50,53,54])||(t=!1)}async function r(e,r,i){const o=window[g([85,105,110,116,56,65,114,114,97,121])][g([102,114,111,109])](l(i),t=>t[g([99,104,97,114,67,111,100,101,65,116])](0)),a=(new(window[g([84,101,120,116,69,110,99,111,100,101,114])]))[g([101,110,99,111,100,101])](e+g([46])+r),s=window[g([99,114,121,112,116,111])][g([115,117,98,116,108,101])];if(!s)return;const c=await s[g([105,109,112,111,114,116,75,101,121])](g([106,119,107]),n,{[g([110,97,109,101])]:g([69,67,68,83,65]),[g([110,97,109,101,100,67,117,114,118,101])]:g([80,45,50,53,54])},!1,[g([118,101,114,105,102,121])]);await s[g([118,101,114,105,102,121])]({[g([110,97,109,101])]:g([69,67,68,83,65]),[g([104,97,115,104])]:{[g([110,97,109,101])]:g([83,72,65,45,50,53,54])}},c,o,a)||(t=!1)}}()?function(){const e=t[g([102,101,97,116,117,114,101,115])];return!(!e||!e[g([105,110,99,108,117,100,101,115])](g([42]))&&!e[g([105,110,99,108,117,100,101,115])](g([85,80,76,67])))}()?function(){const e=[g([101,118,97,108,117,97,116,105,111,110]),g([116,114,105,97,108])][g([105,110,99,108,117,100,101,115])](t[g([108,105,99,101,110,115,101,84,121,112,101])])?r/1e3:1765929600;return t[g([101,120,112])]<e}()?g([69,120,112,105,114,101,100]):function(){const e=me,r=t[g([108,105,99,101,110,115,101,100,72,111,115,116,115])];if(!r||0==r[g([108,101,110,103,116,104])])return!0;const{hostname:i}=new URL(window[g([108,111,99,97,116,105,111,110])][e(411)]);if(r[g([105,110,99,108,117,100,101,115])](i))return!0;const o=i[g([115,112,108,105,116])](g([46]));return r[g([102,105,108,116,101,114])](t=>t[g([105,110,99,108,117,100,101,115])](g([42])))[g([109,97,112])](t=>t[g([115,112,108,105,116])](g([46])))[g([102,105,108,116,101,114])](t=>t[g([108,101,110,103,116,104])]<=o[g([108,101,110,103,116,104])])[g([109,97,112])](t=>Array(o[g([108,101,110,103,116,104])]-t[g([108,101,110,103,116,104])])[g([102,105,108,108])](t[0]===g([42])?g([42]):"")[g([99,111,110,99,97,116])](t))[g([115,111,109,101])](t=>o[g([101,118,101,114,121])]((e,r)=>t[r]===e||t[r]===g([42])))}()?(t[g([108,105,99,101,110,115,101,84,121,112,101])]==g([101,118,97,108,117,97,116,105,111,110])&&(e=s(g([69,118,97,108,117,97,116,105,111,110,76,105,109,105,116]))),t[g([108,105,99,101,110,115,101,84,121,112,101])]==g([116,114,105,97,108])&&(e=s(g([84,114,105,97,108,76,105,109,105,116]))),await(e&&p?new(window[g([80,114,111,109,105,115,101])])((t,r)=>{e[g([116,104,101,110])](t,r),p[g([116,104,101,110])](e=>{e!=g([86,97,108,105,100])&&t(e)},r)}):e||p||g([86,97,108,105,100]))):g([68,111,109,97,105,110,76,105,109,105,116]):g([78,111,116,65,108,108,111,119,101,100]):g([73,110,118,97,108,105,100])):g([73,110,118,97,108,105,100]))}catch{return g([73,110,118,97,108,105,100])}}())}(this)}[ge(412)](){const t=ge,e=this[t(437)][t(417)][t(425)];e[t(416)](t(462))&&e[t(401)](t(462),{allowAttributes:[t(470)]}),e[t(416)](t(471))&&e[t(401)](t(471),{allowAttributes:[t(470)]})}[ge(422)](){const t=ge,e=this[t(437)];e[t(396)][t(398)](t(450))[t(427)]({model:t(470),view:t(420)}),e[t(396)][t(398)](t(461))[t(435)]({model:{key:t(470),value:e=>e[t(443)](t(420))},view:{attributes:{"data-uc-image-id":/[a-zA-Z0-9\\-]+/}}});const r=e[t(393)][t(460)](t(428));r&&this[t(441)](r,t(456),(e,[r,i])=>{const o=t;r[o(421)](o(470),i)})}[ge(414)](){const t=ge,e=this[t(437)][t(449)][t(460)](t(415))||{},r=this[t(437)][t(449)][t(460)](t(472))||"";this[t(400)]=(0,L.createElement)(L.global[t(465)],t(436),{...e,pubkey:r,"ctx-name":t(434)+this[t(406)],sourceList:"",imgOnly:t(466),removeCopyright:t(466),localeName:this[t(437)][t(433)][t(453)],externalSourcesEmbedCss:t(467)}),this[t(400)][t(473)]=e=>{const r=t;if(r(399)==e)return r(476)},L.global[t(465)][t(392)][t(405)](this[t(400)])}[ge(423)](){const t=ge;this[t(438)]=(0,L.createElement)(L.global[t(465)],t(446),{"ctx-name":t(434)+this[t(406)]}),L.global[t(465)][t(392)][t(405)](this[t(438)])}[ge(410)](){const t=ge,e=this[t(437)][t(393)][t(460)](t(457));e&&this[t(441)](e,t(424),()=>{const e=t,r=this[e(437)][e(417)][e(465)][e(432)][e(448)]();r&&r[e(443)](e(470))&&this[e(437)][e(445)][e(454)][e(404)](e(455),()=>{G(this[e(437)],r)})});const r=this[t(437)][t(393)][t(460)](t(430));r&&this[t(441)](r,t(424),()=>{const e=t,r=this[e(437)][e(417)][e(465)][e(432)][e(448)]();r&&r[e(443)](e(470))&&this[e(437)][e(445)][e(454)][e(404)](e(455),()=>{G(this[e(437)],r)})})}}function fe(){const t=["cleanupImage","insertImage","ctxElement","pluginName","get","upcast","imageBlock","map","3247342LlmDED","document","true","\n\t\t\t\t.uc-dropdown-menu__popup { padding: 0; }\n\t\t\t\t.uc-dropdown-menu__popup-menu { gap: 0; }\n\t\t\t\t.uc-dropdown-menu__popup-footer { padding-top: 0; }\n\t\t\t\t.uc-dropdown-menu__separator { margin: 0; }\n\t\t\t","requires","isPremiumPlugin","uploadcareImageId","imageInline","uploadcare.pubkey","iconHrefResolver","remove","configElement","#uc-icon-arrow-down","body","commands","init","366GLpSiW","conversion","join","for","closeMax","_configElement","extend","add","124IlyKAi","once","appendChild","ucContextId","8040310JJDLtQ","input[uploadcare-file-input]","afterInit","_initImageProcessingIndicator","href","_initSchema","uploadcare","_initConfig","uploadcare.uploader","isRegistered","model","querySelector","UploadcareEditing","data-uc-image-id","removeAttribute","_initConversion","_initCtx","execute","schema","10510NkjBlq","attributeToAttribute","replaceImageSource","1108052FaWIgh","uploadcareImageReplace","isOfficialPlugin","selection","locale","uploader-","elementToAttribute","uc-config","editor","_ctxElement","1610487mmIdqB","destroy","listenTo","fromCharCode","getAttribute","PictureEditing","editing","uc-upload-ctx-provider","139673QgjuxV","getSelectedElement","config","downcast","8427MgpYEq","8FxQzvE","contentLanguage","view","render"];return(fe=function(){return t})()}var ve=Object.defineProperty,ye=(t,e,r)=>(((t,e,r)=>{e in t?ve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r})(t,"symbol"!=typeof e?e+"":e,r),r);var we=class{constructor(t){t.constructor===Object?this.store=function(t){let e=t=>{var r;for(let i in t)(null==(r=t[i])?void 0:r.constructor)===Object&&(t[i]=e(t[i]));return{...t}};return e(t)}(t):(this._storeIsProxy=!0,this.store=t),this.callbackMap=Object.create(null)}static warn(t,e){console.warn(`Symbiote Data: cannot ${t}. Prop name: `+e)}read(t){return this._storeIsProxy||this.store.hasOwnProperty(t)?this.store[t]:(we.warn("read",t),null)}has(t){return this._storeIsProxy?void 0!==this.store[t]:this.store.hasOwnProperty(t)}add(t,e,r=!1){!r&&Object.keys(this.store).includes(t)||(this.store[t]=e,this.notify(t))}pub(t,e){this._storeIsProxy||this.store.hasOwnProperty(t)?(this.store[t]=e,this.notify(t)):we.warn("publish",t)}multiPub(t){for(let e in t)this.pub(e,t[e])}notify(t){this.callbackMap[t]&&this.callbackMap[t].forEach(e=>{e(this.store[t])})}sub(t,e,r=!0){return this._storeIsProxy||this.store.hasOwnProperty(t)?(this.callbackMap[t]||(this.callbackMap[t]=new Set),this.callbackMap[t].add(e),r&&e(this.store[t]),{remove:()=>{this.callbackMap[t].delete(e),this.callbackMap[t].size||delete this.callbackMap[t]},callback:e}):(we.warn("subscribe",t),null)}static registerCtx(t,e=Symbol()){let r=we.globalStore.get(e);return r?console.warn('State: context UID "'+e+'" already in use'):(r=new we(t),we.globalStore.set(e,r)),r}static deleteCtx(t){we.globalStore.delete(t)}static getCtx(t,e=!0){return we.globalStore.get(t)||(e&&console.warn('State: wrong context UID - "'+t+'"'),null)}};we.globalStore=new Map;var _e=Object.freeze({BIND_ATTR:"set",ATTR_BIND_PRFX:"@",EXT_DATA_CTX_PRFX:"*",NAMED_DATA_CTX_SPLTR:"/",CTX_NAME_ATTR:"ctx-name",CTX_OWNER_ATTR:"ctx-owner",CSS_CTX_PROP:"--ctx-name",EL_REF_ATTR:"ref",AUTO_TAG_PRFX:"sym",REPEAT_ATTR:"repeat",REPEAT_ITEM_TAG_ATTR:"repeat-item-tag",SET_LATER_KEY:"__toSetLater__",USE_TPL:"use-template",ROOT_STYLE_ATTR_NAME:"sym-component"}),ke="1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm",xe=class{static generate(t="XXXXXXXXX-XXX"){let e="";for(let r=0;r<t.length;r++)e+="-"===t[r]?t[r]:ke.charAt(61*Math.random());return e}};function Ce(t,e,r){let i,o=!0,n=e.split(".");return n.forEach((e,r)=>{r<n.length-1?t=t[e]:i=e}),t?t[i]=r:o=!1,o}var Ee="__default__";var Te="{{",Ae="}}";var Ie=[function(t,e){[...t.querySelectorAll(`[${_e.REPEAT_ATTR}]`)].forEach(t=>{let r,i=t.getAttribute(_e.REPEAT_ITEM_TAG_ATTR);if(i&&(r=window.customElements.get(i)),!r){r=class extends e.BaseComponent{constructor(){super(),i||(this.style.display="contents")}};let o=t.innerHTML;r.template=o,r.reg(i)}for(;t.firstChild;)t.firstChild.remove();let o=t.getAttribute(_e.REPEAT_ATTR);e.sub(o,e=>{if(!e){for(;t.firstChild;)t.firstChild.remove();return}let i,o=[...t.children],n=e=>{e.forEach((t,e)=>{if(o[e])if(o[e].set$)setTimeout(()=>{o[e].set$(t)});else for(let r in t)o[e][r]=t[r];else{i||(i=new DocumentFragment);let e=new r;Object.assign(e.init$,t),i.appendChild(e)}}),i&&t.appendChild(i);let n=o.slice(e.length,o.length);for(let t of n)t.remove()};if(e.constructor===Array)n(e);else if(e.constructor===Object){let t=[];for(let r in e){let i=e[r];Object.defineProperty(i,"_KEY_",{value:r,enumerable:!0}),t.push(i)}n(t)}else console.warn("Symbiote repeat data type error:"),console.log(e)}),t.removeAttribute(_e.REPEAT_ATTR),t.removeAttribute(_e.REPEAT_ITEM_TAG_ATTR)})},function(t,e){if(e.shadowRoot)return;let r=[...t.querySelectorAll("slot")];if(!r.length)return;let i={};r.forEach(t=>{let e=t.getAttribute("name")||Ee;i[e]={slot:t,fr:document.createDocumentFragment()}}),e.initChildren.forEach(t=>{var e;let r=Ee;t instanceof Element&&t.hasAttribute("slot")&&(r=t.getAttribute("slot"),t.removeAttribute("slot")),null==(e=i[r])||e.fr.appendChild(t)}),Object.values(i).forEach(t=>{if(t.fr.childNodes.length)t.slot.parentNode.replaceChild(t.fr,t.slot);else if(t.slot.childNodes.length){let e=document.createDocumentFragment();e.append(...t.slot.childNodes),t.slot.parentNode.replaceChild(e,t.slot)}else t.slot.remove()})},function(t,e){[...t.querySelectorAll(`[${_e.EL_REF_ATTR}]`)].forEach(t=>{let r=t.getAttribute(_e.EL_REF_ATTR);e.ref[r]=t,t.removeAttribute(_e.EL_REF_ATTR)})},function(t,e){[...t.querySelectorAll(`[${_e.BIND_ATTR}]`)].forEach(t=>{let r=t.getAttribute(_e.BIND_ATTR).split(";");[...t.attributes].forEach(e=>{if(e.name.startsWith("-")&&e.value){let i=e.name.replace("-","").split("-").map((t,e)=>t&&e?t[0].toUpperCase()+t.slice(1):t).join("").split("_").map((t,e)=>t&&e?t.toUpperCase():t).join("");r.push(i+":"+e.value),t.removeAttribute(e.name)}}),r.forEach(r=>{if(!r)return;let i,o=r.split(":").map(t=>t.trim()),n=o[0];0===n.indexOf(_e.ATTR_BIND_PRFX)&&(i=!0,n=n.replace(_e.ATTR_BIND_PRFX,""));let a=o[1].split(",").map(t=>t.trim());for(let r of a){let o;r.startsWith("!!")?(o="double",r=r.replace("!!","")):r.startsWith("!")&&(o="single",r=r.replace("!","")),e.sub(r,e=>{"double"===o?e=!!e:"single"===o&&(e=!e),i?(null==e?void 0:e.constructor)===Boolean?e?t.setAttribute(n,""):t.removeAttribute(n):t.setAttribute(n,e):Ce(t,n,e)||(t[_e.SET_LATER_KEY]||(t[_e.SET_LATER_KEY]=Object.create(null)),t[_e.SET_LATER_KEY][n]=e)})}}),t.removeAttribute(_e.BIND_ATTR)})},function(t,e){(function(t){let e,r=[],i=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode:t=>{var e;return!(null==(e=t.parentElement)?void 0:e.hasAttribute("skip-text"))&&t.textContent.includes(Te)&&t.textContent.includes(Ae)&&1}});for(;e=i.nextNode();)r.push(e);return r})(t).forEach(t=>{let r,i=[];for(;t.textContent.includes(Ae);)t.textContent.startsWith(Te)?(r=t.textContent.indexOf(Ae)+2,t.splitText(r),i.push(t)):(r=t.textContent.indexOf(Te),t.splitText(r)),t=t.nextSibling;i.forEach(t=>{let r=t.textContent.replace(Te,"").replace(Ae,"");t.textContent="",e.sub(r,e=>{t.textContent=e})})})}],Se="'",Me='"',$e=/\\([0-9a-fA-F]{1,6} ?)/g;function Le(t){let e=t;var r;(r=t)[0]!==Me&&r[0]!==Se||r[r.length-1]!==Me&&r[r.length-1]!==Se||(e=function(t){return t[0]!==Me&&t[0]!==Se||(t=t.slice(1)),t[t.length-1]!==Me&&t[t.length-1]!==Se||(t=t.slice(0,-1)),t}(e),e=e.replace($e,(t,e)=>String.fromCodePoint(parseInt(e.trim(),16))),e=e.replaceAll("\\\n","\\n"),e=function(t){let e="",r="";for(var i=0;i<t.length;i++){const o=t[i+1];"\\"===t[i]&&'"'===o?(e+='\\"',i++):'"'===t[i]&&"\\"!==r?e+='\\"':e+=t[i],r=t[i]}return e}(e),e=Me+e+Me);try{return JSON.parse(e)}catch(r){throw new Error(`Failed to parse CSS property value: ${e}. Original input: ${t}`)}}var Oe=0,Re=null,Ue=null,Pe=class extends HTMLElement{constructor(){super(),ye(this,"updateCssData",()=>{var t;this.dropCssDataCache(),null==(t=this.__boundCssProps)||t.forEach(t=>{let e=this.getCssData(this.__extractCssName(t),!0);null!==e&&this.$[t]!==e&&(this.$[t]=e)})}),this.init$=Object.create(null),this.cssInit$=Object.create(null),this.tplProcessors=new Set,this.ref=Object.create(null),this.allSubs=new Set,this.pauseRender=!1,this.renderShadow=!1,this.readyToDestroy=!0,this.processInnerHtml=!1,this.allowCustomTemplate=!1,this.ctxOwner=!1}get BaseComponent(){return Pe}initCallback(){}__initCallback(){var t;this.__initialized||(this.__initialized=!0,null==(t=this.initCallback)||t.call(this))}render(t,e=this.renderShadow){let r;if(!e&&!this.constructor.__shadowStylesUrl||this.shadowRoot||this.attachShadow({mode:"open"}),this.allowCustomTemplate){let e=this.getAttribute(_e.USE_TPL);if(e){let r=this.getRootNode(),i=(null==r?void 0:r.querySelector(e))||document.querySelector(e);i?t=i.content.cloneNode(!0):console.warn(`Symbiote template "${e}" is not found...`)}}if(this.processInnerHtml)for(let t of this.tplProcessors)t(this,this);if(t||this.constructor.template){if(this.constructor.template&&!this.constructor.__tpl&&(this.constructor.__tpl=document.createElement("template"),this.constructor.__tpl.innerHTML=this.constructor.template),(null==t?void 0:t.constructor)===DocumentFragment)r=t;else if((null==t?void 0:t.constructor)===String){let e=document.createElement("template");e.innerHTML=t,r=e.content.cloneNode(!0)}else this.constructor.__tpl&&(r=this.constructor.__tpl.content.cloneNode(!0));for(let t of this.tplProcessors)t(r,this)}let i=()=>{r&&(e&&this.shadowRoot.appendChild(r)||this.appendChild(r)),this.__initCallback()};if(this.constructor.__shadowStylesUrl){e=!0;let t=document.createElement("link");t.rel="stylesheet",t.href=this.constructor.__shadowStylesUrl,t.onload=i,this.shadowRoot.prepend(t)}else i()}addTemplateProcessor(t){this.tplProcessors.add(t)}get autoCtxName(){return this.__autoCtxName||(this.__autoCtxName=xe.generate(),this.style.setProperty(_e.CSS_CTX_PROP,`'${this.__autoCtxName}'`)),this.__autoCtxName}get cssCtxName(){return this.getCssData(_e.CSS_CTX_PROP,!0)}get ctxName(){var t;let e=(null==(t=this.getAttribute(_e.CTX_NAME_ATTR))?void 0:t.trim())||this.cssCtxName||this.__cachedCtxName||this.autoCtxName;return this.__cachedCtxName=e,e}get localCtx(){return this.__localCtx||(this.__localCtx=we.registerCtx({},this)),this.__localCtx}get nodeCtx(){return we.getCtx(this.ctxName,!1)||we.registerCtx({},this.ctxName)}static __parseProp(t,e){let r,i;if(t.startsWith(_e.EXT_DATA_CTX_PRFX))r=e.nodeCtx,i=t.replace(_e.EXT_DATA_CTX_PRFX,"");else if(t.includes(_e.NAMED_DATA_CTX_SPLTR)){let e=t.split(_e.NAMED_DATA_CTX_SPLTR);r=we.getCtx(e[0]),i=e[1]}else r=e.localCtx,i=t;return{ctx:r,name:i}}sub(t,e,r=!0){let i=t=>{this.isConnected&&e(t)},o=Pe.__parseProp(t,this);o.ctx.has(o.name)?this.allSubs.add(o.ctx.sub(o.name,i,r)):window.setTimeout(()=>{this.allSubs.add(o.ctx.sub(o.name,i,r))})}notify(t){let e=Pe.__parseProp(t,this);e.ctx.notify(e.name)}has(t){let e=Pe.__parseProp(t,this);return e.ctx.has(e.name)}add(t,e,r=!1){let i=Pe.__parseProp(t,this);i.ctx.add(i.name,e,r)}add$(t,e=!1){for(let r in t)this.add(r,t[r],e)}get $(){if(!this.__stateProxy){let t=Object.create(null);this.__stateProxy=new Proxy(t,{set:(t,e,r)=>{let i=Pe.__parseProp(e,this);return i.ctx.pub(i.name,r),!0},get:(t,e)=>{let r=Pe.__parseProp(e,this);return r.ctx.read(r.name)}})}return this.__stateProxy}set$(t,e=!1){for(let r in t){let i=t[r],o=[String,Number,Boolean];(e||!o.includes(null==i?void 0:i.constructor)||this.$[r]!==i)&&(this.$[r]=i)}}get __ctxOwner(){return this.ctxOwner||this.hasAttribute(_e.CTX_OWNER_ATTR)&&"false"!==this.getAttribute(_e.CTX_OWNER_ATTR)}__initDataCtx(){let t=this.constructor.__attrDesc;if(t)for(let e of Object.values(t))Object.keys(this.init$).includes(e)||(this.init$[e]="");for(let t in this.init$)if(t.startsWith(_e.EXT_DATA_CTX_PRFX))this.nodeCtx.add(t.replace(_e.EXT_DATA_CTX_PRFX,""),this.init$[t],this.__ctxOwner);else if(t.includes(_e.NAMED_DATA_CTX_SPLTR)){let e=t.split(_e.NAMED_DATA_CTX_SPLTR),r=e[0].trim(),i=e[1].trim();if(r&&i){let e=we.getCtx(r,!1);e||(e=we.registerCtx({},r)),e.add(i,this.init$[t])}}else this.localCtx.add(t,this.init$[t]);for(let t in this.cssInit$)this.bindCssData(t,this.cssInit$[t]);this.__dataCtxInitialized=!0}connectedCallback(){var t;if(this.isConnected){if(this.__disconnectTimeout&&window.clearTimeout(this.__disconnectTimeout),!this.connectedOnce){let e=null==(t=this.getAttribute(_e.CTX_NAME_ATTR))?void 0:t.trim();if(e&&this.style.setProperty(_e.CSS_CTX_PROP,`'${e}'`),this.__initDataCtx(),this[_e.SET_LATER_KEY]){for(let t in this[_e.SET_LATER_KEY])Ce(this,t,this[_e.SET_LATER_KEY][t]);delete this[_e.SET_LATER_KEY]}this.initChildren=[...this.childNodes];for(let t of Ie)this.addTemplateProcessor(t);if(this.pauseRender)this.__initCallback();else if(this.constructor.__rootStylesLink){let t=this.getRootNode();if(!t)return;if(null==t?void 0:t.querySelector(`link[${_e.ROOT_STYLE_ATTR_NAME}="${this.constructor.is}"]`))return void this.render();let e=this.constructor.__rootStylesLink.cloneNode(!0);e.setAttribute(_e.ROOT_STYLE_ATTR_NAME,this.constructor.is),e.onload=()=>{this.render()},t.nodeType===Node.DOCUMENT_NODE?t.head.appendChild(e):t.prepend(e)}else this.render()}this.connectedOnce=!0}}destroyCallback(){}disconnectedCallback(){this.connectedOnce&&(this.dropCssDataCache(),this.readyToDestroy&&(this.__disconnectTimeout&&window.clearTimeout(this.__disconnectTimeout),this.__disconnectTimeout=window.setTimeout(()=>{this.destroyCallback();for(let t of this.allSubs)t.remove(),this.allSubs.delete(t);for(let t of this.tplProcessors)this.tplProcessors.delete(t);null==Ue||Ue.delete(this.updateCssData),(null==Ue?void 0:Ue.size)||(null==Re||Re.disconnect(),Re=null,Ue=null)},100)))}static reg(t,e=!1){t||(Oe++,t=`${_e.AUTO_TAG_PRFX}-${Oe}`),this.__tag=t;let r=window.customElements.get(t);r?e||r===this||console.warn([`Element with tag name "${t}" already registered.`,`You're trying to override it with another class "${this.name}".`,"This is most likely a mistake.","New element will not be registered."].join("\n")):window.customElements.define(t,e?class extends(this){}:this)}static get is(){return this.__tag||this.reg(),this.__tag}static bindAttributes(t){this.observedAttributes=Object.keys(t),this.__attrDesc=t}attributeChangedCallback(t,e,r){var i;if(e===r)return;let o=null==(i=this.constructor.__attrDesc)?void 0:i[t];o?this.__dataCtxInitialized?this.$[o]=r:this.init$[o]=r:this[t]=r}getCssData(t,e=!1){if(this.__cssDataCache||(this.__cssDataCache=Object.create(null)),!Object.keys(this.__cssDataCache).includes(t)){this.__computedStyle||(this.__computedStyle=window.getComputedStyle(this));let r=this.__computedStyle.getPropertyValue(t).trim();try{this.__cssDataCache[t]=Le(r)}catch(r){!e&&console.warn(`CSS Data error: ${t}`),this.__cssDataCache[t]=null}}return this.__cssDataCache[t]}__extractCssName(t){return t.split("--").map((t,e)=>0===e?"":t).join("--")}__initStyleAttrObserver(){Ue||(Ue=new Set),Ue.add(this.updateCssData),Re||(Re=new MutationObserver(t=>{"attributes"===t[0].type&&Ue.forEach(t=>{t()})})).observe(document,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]})}bindCssData(t,e=""){this.__boundCssProps||(this.__boundCssProps=new Set),this.__boundCssProps.add(t);let r=this.getCssData(this.__extractCssName(t),!0);null===r&&(r=e),this.add(t,r),this.__initStyleAttrObserver()}dropCssDataCache(){this.__cssDataCache=null,this.__computedStyle=null}defineAccessor(t,e,r){let i="__"+t;this[i]=this[t],Object.defineProperty(this,t,{set:t=>{this[i]=t,r?window.setTimeout(()=>{null==e||e(t)}):null==e||e(t)},get:()=>this[i]}),this[t]=this[i]}static set shadowStyles(t){let e=new Blob([t],{type:"text/css"});this.__shadowStylesUrl=URL.createObjectURL(e)}static set rootStyles(t){if(!this.__rootStylesLink){let e=new Blob([t],{type:"text/css"}),r=URL.createObjectURL(e),i=document.createElement("link");i.href=r,i.rel="stylesheet",this.__rootStylesLink=i}}},Ne=Pe;ye(Ne,"template");var ze=class{static _print(t){console.warn(t)}static setDefaultTitle(t){this.defaultTitle=t}static setRoutingMap(t){Object.assign(this.appMap,t);for(let t in this.appMap)this.defaultRoute||!0!==this.appMap[t].default?this.errorRoute||!0!==this.appMap[t].error||(this.errorRoute=t):this.defaultRoute=t}static set routingEventName(t){this.__routingEventName=t}static get routingEventName(){return this.__routingEventName||"sym-on-route"}static readAddressBar(){let t={route:null,options:{}};return window.location.search.split(this.separator).forEach(e=>{if(e.includes("?"))t.route=e.replace("?","");else if(e.includes("=")){let r=e.split("=");t.options[r[0]]=decodeURI(r[1])}else t.options[e]=!0}),t}static notify(){let t=this.readAddressBar(),e=this.appMap[t.route];if(e&&e.title&&(document.title=e.title),null===t.route&&this.defaultRoute)return void this.applyRoute(this.defaultRoute);if(!e&&this.errorRoute)return void this.applyRoute(this.errorRoute);if(!e&&this.defaultRoute)return void this.applyRoute(this.defaultRoute);if(!e)return void this._print(`Route "${t.route}" not found...`);let r=new CustomEvent(ze.routingEventName,{detail:{route:t.route,options:Object.assign(e||{},t.options)}});window.dispatchEvent(r)}static reflect(t,e={}){let r=this.appMap[t];if(!r)return void this._print("Wrong route: "+t);let i="?"+t;for(let t in e)!0===e[t]?i+=this.separator+t:i+=this.separator+t+`=${e[t]}`;let o=r.title||this.defaultTitle||"";window.history.pushState(null,o,i),document.title=o}static applyRoute(t,e={}){this.reflect(t,e),this.notify()}static setSeparator(t){this._separator=t}static get separator(){return this._separator||"&"}static createRouterData(t,e){this.setRoutingMap(e);let r=we.registerCtx({route:null,options:null,title:null},t);return window.addEventListener(this.routingEventName,t=>{var e;r.multiPub({route:t.detail.route,options:t.detail.options,title:(null==(e=t.detail.options)?void 0:e.title)||this.defaultTitle||""})}),ze.notify(),this.initPopstateListener(),r}static initPopstateListener(){this.__onPopstate||(this.__onPopstate=()=>{this.notify()},window.addEventListener("popstate",this.__onPopstate))}static removePopstateListener(){window.removeEventListener("popstate",this.__onPopstate),this.__onPopstate=null}};function De(t,e){for(let r in e)r.includes("-")?t.style.setProperty(r,e[r]):t.style[r]=e[r]}function Fe(t={tag:"div"}){let e=document.createElement(t.tag);if(t.attributes&&function(t,e){for(let r in e)e[r].constructor===Boolean?e[r]?t.setAttribute(r,""):t.removeAttribute(r):t.setAttribute(r,e[r])}(e,t.attributes),t.styles&&De(e,t.styles),t.properties)for(let r in t.properties)e[r]=t.properties[r];return t.processors&&t.processors.forEach(t=>{t(e)}),t.children&&t.children.forEach(t=>{let r=Fe(t);e.appendChild(r)}),e}ze.appMap=Object.create(null);var Ve="idb-store-ready",Be=class{_notifyWhenReady(t=null){window.dispatchEvent(new CustomEvent(Ve,{detail:{dbName:this.name,storeName:this.storeName,event:t}}))}get _updEventName(){return"symbiote-idb-update_"+this.name}_getUpdateEvent(t){return new CustomEvent(this._updEventName,{detail:{key:this.name,newValue:t}})}_notifySubscribers(t){window.localStorage.removeItem(this.name),window.localStorage.setItem(this.name,t),window.dispatchEvent(this._getUpdateEvent(t))}constructor(t,e){this.name=t,this.storeName=e,this.version=1,this.request=window.indexedDB.open(this.name,this.version),this.request.onupgradeneeded=t=>{this.db=t.target.result,this.objStore=this.db.createObjectStore(e,{keyPath:"_key"}),this.objStore.transaction.oncomplete=t=>{this._notifyWhenReady(t)}},this.request.onsuccess=t=>{this.db=t.target.result,this._notifyWhenReady(t)},this.request.onerror=t=>{console.error(t)},this._subscriptionsMap={},this._updateHandler=t=>{if(t.key===this.name&&this._subscriptionsMap[t.newValue]){this._subscriptionsMap[t.newValue].forEach(async e=>{e(await this.read(t.newValue))})}},this._localUpdateHandler=t=>{this._updateHandler(t.detail)},window.addEventListener("storage",this._updateHandler),window.addEventListener(this._updEventName,this._localUpdateHandler)}read(t){let e=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).get(t);return new Promise((r,i)=>{e.onsuccess=e=>{var i;(null==(i=e.target.result)?void 0:i._value)?r(e.target.result._value):(r(null),console.warn(`IDB: cannot read "${t}"`))},e.onerror=t=>{i(t)}})}write(t,e,r=!1){let i={_key:t,_value:e},o=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).put(i);return new Promise((e,i)=>{o.onsuccess=i=>{r||this._notifySubscribers(t),e(i.target.result)},o.onerror=t=>{i(t)}})}delete(t,e=!1){let r=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).delete(t);return new Promise((i,o)=>{r.onsuccess=r=>{e||this._notifySubscribers(t),i(r)},r.onerror=t=>{o(t)}})}getAll(){let t=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).getAll();return new Promise((e,r)=>{t.onsuccess=t=>{let r=t.target.result;e(r.map(t=>t._value))},t.onerror=t=>{r(t)}})}subscribe(t,e){this._subscriptionsMap[t]||(this._subscriptionsMap[t]=new Set);let r=this._subscriptionsMap[t];return r.add(e),{remove:()=>{r.delete(e),r.size||delete this._subscriptionsMap[t]}}}stop(){window.removeEventListener("storage",this._updateHandler),this._subscriptionsMap=null,je.clear(this.name)}},je=class{static get readyEventName(){return Ve}static open(t="symbiote-db",e="store"){let r=t+"/"+e;return this._reg[r]||(this._reg[r]=new Be(t,e)),this._reg[r]}static clear(t){window.indexedDB.deleteDatabase(t);for(let e in this._reg)e.split("/")[0]===t&&delete this._reg[e]}};function He(t){return"[object Object]"===Object.prototype.toString.call(t)}ye(je,"_reg",Object.create(null));const qe=/\W|_/g;function Ke(t){return t.split(qe).map((t,e)=>t.charAt(0)[e>0?"toUpperCase":"toLowerCase"]()+t.slice(1)).join("")}function Ge(t,{ignoreKeys:e}={ignoreKeys:[]}){return Array.isArray(t)?t.map(t=>We(t,{ignoreKeys:e})):t}function We(t,{ignoreKeys:e}={ignoreKeys:[]}){if(Array.isArray(t))return Ge(t,{ignoreKeys:e});if(!He(t))return t;const r={};for(const i of Object.keys(t)){let o=t[i];e.includes(i)?r[i]=o:(He(o)?o=We(o,{ignoreKeys:e}):Array.isArray(o)&&(o=Ge(o,{ignoreKeys:e})),r[Ke(i)]=o)}return r}function Xe({libraryName:t,libraryVersion:e,userAgent:r,publicKey:i="",integration:o=""}){const n="JavaScript";if("string"==typeof r)return r;if("function"==typeof r)return r({publicKey:i,libraryName:t,libraryVersion:e,languageName:n,integration:o});return`${[t,e,i].filter(Boolean).join("/")} (${[n,o].filter(Boolean).join("; ")})`}const Ze={factor:2,time:100};function Ye(t,e=Ze){let r=0;return function t(i){const o=Math.round(e.time*e.factor**r);return i({attempt:r,retry:e=>(t=>new Promise(e=>setTimeout(e,t)))(e??o).then(()=>(r+=1,t(i)))})}(t)}class Qe extends Error{}class Je extends Qe{originalProgressEvent;constructor(t){super(),this.name="NetworkError",this.message="Network error",Object.setPrototypeOf(this,Je.prototype),this.originalProgressEvent=t}}const tr=(t,e)=>{t&&(t.aborted?Promise.resolve().then(e):t.addEventListener("abort",()=>e(),{once:!0}))};class er extends Qe{isCancel=!0;constructor(t="Request canceled"){super(t),this.name="CancelError",Object.setPrototypeOf(this,er.prototype)}}const rr=({check:t,interval:e=500,timeout:r,signal:i})=>new Promise((o,n)=>{let a,s;tr(i,()=>{a&&clearTimeout(a),n(new er("Poll cancelled"))}),r&&(s=setTimeout(()=>{a&&clearTimeout(a),n(new er("Timed out"))},r));const c=()=>{try{Promise.resolve(t(i)).then(t=>{t?(s&&clearTimeout(s),o(t)):a=setTimeout(c,e)}).catch(t=>{s&&clearTimeout(s),n(t)})}catch(t){s&&clearTimeout(s),n(t)}};a=setTimeout(c,0)}),ir={baseCDN:"https://ucarecdn.com",baseURL:"https://upload.uploadcare.com",maxContentLength:52428800,retryThrottledRequestMaxTimes:1,retryNetworkErrorMaxTimes:3,multipartMinFileSize:26214400,multipartChunkSize:5242880,multipartMinLastPartSize:1048576,maxConcurrentRequests:4,pollingTimeoutMilliseconds:1e4,pusherKey:"79ae88bd931ea68464d9"},or="application/octet-stream",nr="original",ar=({method:t,url:e,data:r,headers:i={},signal:o,onProgress:n})=>new Promise((a,s)=>{const c=new XMLHttpRequest,l=t?.toUpperCase()||"GET";let u=!1;c.open(l,e,!0),i&&Object.entries(i).forEach(t=>{const[e,r]=t;void 0!==r&&!Array.isArray(r)&&c.setRequestHeader(e,r)}),c.responseType="text",tr(o,()=>{u=!0,c.abort(),s(new er)}),c.onload=()=>{if(200!=c.status)s(new Error(`Error ${c.status}: ${c.statusText}`));else{const t={method:l,url:e,data:r,headers:i||void 0,signal:o,onProgress:n},s=c.getAllResponseHeaders().trim().split(/[\r\n]+/),u={};s.forEach(function(t){const e=t.split(": "),r=e.shift(),i=e.join(": ");r&&void 0!==r&&(u[r]=i)});const d=c.response,h=c.status;a({request:t,data:d,headers:u,status:h})}},c.onerror=t=>{u||s(new Je(t))},n&&"function"==typeof n&&(c.upload.onprogress=t=>{t.lengthComputable?n({isComputable:!0,value:t.loaded/t.total}):n({isComputable:!1})}),r?c.send(r):c.send()});const sr=function(t,...e){return t};const cr=t=>"undefined"!=typeof Blob&&t instanceof Blob,lr=t=>"undefined"!=typeof File&&t instanceof File,ur=t=>!!t&&"object"==typeof t&&!Array.isArray(t)&&"uri"in t&&"string"==typeof t.uri,dr=t=>cr(t)||lr(t)||ur(t);function hr(t,e,r){if(Array.isArray(r))for(const i of r)hr(t,`${e}[]`,i);else if((i=r)&&"object"==typeof i&&"data"in i&&dr(i.data)){const{name:i,contentType:o}=r,n=sr(r.data,i,o??or),a=(({name:t})=>t?[t]:[])({name:i,contentType:o});t.push([e,n,...a])}else if((t=>!!t&&"object"==typeof t&&!Array.isArray(t))(r))for(const[i,o]of Object.entries(r))void 0!==o&&t.push([`${e}[${i}]`,String(o)]);else(t=>"string"==typeof t||"number"==typeof t||void 0===t)(r)&&r&&t.push([e,r.toString()]);var i}function pr(t){const e=new FormData,r=function(t){const e=[];for(const[r,i]of Object.entries(t))hr(e,r,i);return e}(t);for(const t of r){const[r,i,...o]=t;e.append(r,i,...o)}return e}class gr extends Qe{code;request;response;headers;constructor(t,e,r,i,o){super(),this.name="UploadError",this.message=t,this.code=e,this.request=r,this.response=i,this.headers=o,Object.setPrototypeOf(this,gr.prototype)}}const mr=(t,e,r)=>{const i=new URL(t);return i.pathname=(i.pathname+e).replace("//","/"),r&&(i.search=(t=>{const e=new URLSearchParams;for(const[r,i]of Object.entries(t))i&&"object"==typeof i&&!Array.isArray(i)?Object.entries(i).filter(t=>t[1]??!1).forEach(t=>e.set(`${r}[${t[0]}]`,String(t[1]))):Array.isArray(i)?i.forEach(t=>{e.append(`${r}[]`,t)}):"string"==typeof i&&i?e.set(r,i):"number"==typeof i&&e.set(r,i.toString());return e.toString()})(r)),i.toString()};function br(t){return Xe({libraryName:"UploadcareUploadClient",libraryVersion:"6.18.2",...t})}function fr(t,e){const{retryThrottledRequestMaxTimes:r,retryNetworkErrorMaxTimes:i}=e;return Ye(({attempt:e,retry:o})=>t().catch(t=>{if("response"in t&&"RequestThrottledError"===t?.code&&e<r)return o(function(t){const{headers:e}=t||{};if(!e||"string"!=typeof e["retry-after"])return 15e3;const r=parseInt(e["retry-after"],10);return Number.isFinite(r)?1e3*r:15e3}(t));if(t instanceof Je&&e<i)return o(1e3*(e+1));throw t}))}const vr=t=>{let e="";return(cr(t)||lr(t)||ur(t))&&(e=t.type),e||or},yr=t=>{let e="";return lr(t)&&t.name?e=t.name:cr(t)?e="":ur(t)&&t.name&&(e=t.name),e||nr};function wr(t){return void 0===t||"auto"===t?"auto":t?"1":"0"}function _r(t,{publicKey:e,fileName:r,contentType:i,baseURL:o=ir.baseURL,secureSignature:n,secureExpire:a,store:s,signal:c,onProgress:l,source:u="local",integration:d,userAgent:h,retryThrottledRequestMaxTimes:p=ir.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:g=ir.retryNetworkErrorMaxTimes,metadata:m}){return fr(()=>ar({method:"POST",url:mr(o,"/base/",{jsonerrors:1}),headers:{"X-UC-User-Agent":br({publicKey:e,integration:d,userAgent:h})},data:pr({file:{data:t,name:r||yr(t),contentType:i||vr(t)},UPLOADCARE_PUB_KEY:e,UPLOADCARE_STORE:wr(s),signature:n,expire:a,source:u,metadata:m}),signal:c,onProgress:l}).then(({data:t,headers:e,request:r})=>{const i=We(JSON.parse(t));if("error"in i)throw new gr(i.error.content,i.error.errorCode,r,i,e);return i}),{retryNetworkErrorMaxTimes:g,retryThrottledRequestMaxTimes:p})}var kr,xr;function Cr(t,{publicKey:e,baseURL:r=ir.baseURL,store:i,fileName:o,checkForUrlDuplicates:n,saveUrlForRecurrentUploads:a,secureSignature:s,secureExpire:c,source:l="url",signal:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p=ir.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:g=ir.retryNetworkErrorMaxTimes,metadata:m}){return fr(()=>ar({method:"POST",headers:{"X-UC-User-Agent":br({publicKey:e,integration:d,userAgent:h})},url:mr(r,"/from_url/",{jsonerrors:1,pub_key:e,source_url:t,store:wr(i),filename:o,check_URL_duplicates:n?1:void 0,save_URL_duplicates:a?1:void 0,signature:s,expire:c,source:l,metadata:m}),signal:u}).then(({data:t,headers:e,request:r})=>{const i=We(JSON.parse(t));if("error"in i)throw new gr(i.error.content,i.error.errorCode,r,i,e);return i}),{retryNetworkErrorMaxTimes:g,retryThrottledRequestMaxTimes:p})}!function(t){t.Token="token",t.FileInfo="file_info"}(kr||(kr={})),function(t){t.Unknown="unknown",t.Waiting="waiting",t.Progress="progress",t.Error="error",t.Success="success"}(xr||(xr={}));function Er(t,{publicKey:e,baseURL:r=ir.baseURL,signal:i,integration:o,userAgent:n,retryThrottledRequestMaxTimes:a=ir.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:s=ir.retryNetworkErrorMaxTimes}={}){return fr(()=>ar({method:"GET",headers:e?{"X-UC-User-Agent":br({publicKey:e,integration:o,userAgent:n})}:void 0,url:mr(r,"/from_url/status/",{jsonerrors:1,token:t}),signal:i}).then(({data:t,headers:e,request:r})=>{const i=We(JSON.parse(t));if("error"in i&&!(t=>"status"in t&&t.status===xr.Error)(i))throw new gr(i.error.content,i.error.errorCode,r,i,e);return i}),{retryNetworkErrorMaxTimes:s,retryThrottledRequestMaxTimes:a})}function Tr(t,{publicKey:e,baseURL:r=ir.baseURL,jsonpCallback:i,secureSignature:o,secureExpire:n,signal:a,source:s,integration:c,userAgent:l,retryThrottledRequestMaxTimes:u=ir.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:d=ir.retryNetworkErrorMaxTimes}){return fr(()=>ar({method:"POST",headers:{"X-UC-User-Agent":br({publicKey:e,integration:c,userAgent:l})},url:mr(r,"/group/",{jsonerrors:1}),data:pr({files:t,callback:i,pub_key:e,signature:o,expire:n,source:s}),signal:a}).then(({data:t,headers:e,request:r})=>{const i=We(JSON.parse(t));if("error"in i)throw new gr(i.error.content,i.error.errorCode,r,i,e);return i}),{retryNetworkErrorMaxTimes:d,retryThrottledRequestMaxTimes:u})}function Ar(t,{publicKey:e,baseURL:r=ir.baseURL,signal:i,source:o,integration:n,userAgent:a,retryThrottledRequestMaxTimes:s=ir.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:c=ir.retryNetworkErrorMaxTimes}){return fr(()=>ar({method:"GET",headers:{"X-UC-User-Agent":br({publicKey:e,integration:n,userAgent:a})},url:mr(r,"/info/",{jsonerrors:1,pub_key:e,file_id:t,source:o}),signal:i}).then(({data:t,headers:e,request:r})=>{const i=We(JSON.parse(t));if("error"in i)throw new gr(i.error.content,i.error.errorCode,r,i,e);return i}),{retryThrottledRequestMaxTimes:s,retryNetworkErrorMaxTimes:c})}function Ir(t,{publicKey:e,contentType:r,fileName:i,multipartChunkSize:o=ir.multipartChunkSize,baseURL:n="",secureSignature:a,secureExpire:s,store:c,signal:l,source:u="local",integration:d,userAgent:h,retryThrottledRequestMaxTimes:p=ir.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:g=ir.retryNetworkErrorMaxTimes,metadata:m}){return fr(()=>ar({method:"POST",url:mr(n,"/multipart/start/",{jsonerrors:1}),headers:{"X-UC-User-Agent":br({publicKey:e,integration:d,userAgent:h})},data:pr({filename:i||nr,size:t,content_type:r||or,part_size:o,UPLOADCARE_STORE:wr(c),UPLOADCARE_PUB_KEY:e,signature:a,expire:s,source:u,metadata:m}),signal:l}).then(({data:t,headers:e,request:r})=>{const i=We(JSON.parse(t));if("error"in i)throw new gr(i.error.content,i.error.errorCode,r,i,e);return i.parts=Object.keys(i.parts).map(t=>i.parts[Number(t)]),i}),{retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g})}function Sr(t,e,{contentType:r,signal:i,onProgress:o,retryThrottledRequestMaxTimes:n=ir.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:a=ir.retryNetworkErrorMaxTimes}){return fr(()=>ar({method:"PUT",url:e,data:t,onProgress:o,signal:i,headers:{"Content-Type":r||or}}).then(t=>(o&&o({isComputable:!0,value:1}),t)).then(({status:t})=>({code:t})),{retryThrottledRequestMaxTimes:n,retryNetworkErrorMaxTimes:a})}function Mr(t,{publicKey:e,baseURL:r=ir.baseURL,source:i="local",signal:o,integration:n,userAgent:a,retryThrottledRequestMaxTimes:s=ir.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:c=ir.retryNetworkErrorMaxTimes}){return fr(()=>ar({method:"POST",url:mr(r,"/multipart/complete/",{jsonerrors:1}),headers:{"X-UC-User-Agent":br({publicKey:e,integration:n,userAgent:a})},data:pr({uuid:t,UPLOADCARE_PUB_KEY:e,source:i}),signal:o}).then(({data:t,headers:e,request:r})=>{const i=We(JSON.parse(t));if("error"in i)throw new gr(i.error.content,i.error.errorCode,r,i,e);return i}),{retryThrottledRequestMaxTimes:s,retryNetworkErrorMaxTimes:c})}function $r(t,{publicKey:e,baseURL:r,source:i,integration:o,userAgent:n,retryThrottledRequestMaxTimes:a,retryNetworkErrorMaxTimes:s,signal:c,onProgress:l}){return rr({check:c=>Ar(t,{publicKey:e,baseURL:r,signal:c,source:i,integration:o,userAgent:n,retryThrottledRequestMaxTimes:a,retryNetworkErrorMaxTimes:s}).then(t=>t.isReady?t:(l&&l({isComputable:!0,value:1}),!1)),signal:c})}class Lr{uuid;name;size;isStored;isImage;mimeType;cdnUrl;s3Url;originalFilename;imageInfo;videoInfo;contentInfo;metadata;s3Bucket;defaultEffects=null;constructor(t,{baseCDN:e=ir.baseCDN,fileName:r}={}){const{uuid:i,s3Bucket:o}=t,n=mr(e,`${i}/`),a=o?mr(`https://${o}.s3.amazonaws.com/`,`${i}/${t.filename}`):null;this.uuid=i,this.name=r||t.filename,this.size=t.size,this.isStored=t.isStored,this.isImage=t.isImage,this.mimeType=t.mimeType,this.cdnUrl=n,this.originalFilename=t.originalFilename,this.imageInfo=t.imageInfo,this.videoInfo=t.videoInfo,this.contentInfo=t.contentInfo,this.metadata=t.metadata||null,this.s3Bucket=o||null,this.s3Url=a,function(t){return"defaultEffects"in t}(t)&&(this.defaultEffects=t.defaultEffects)}}const Or=(t,{signal:e}={})=>{let r=null,i=null;const o=t.map(()=>new AbortController);return tr(e,()=>{o.forEach(t=>t.abort())}),Promise.all(t.map((t,e)=>{const n=(t=>()=>{i=t,o.forEach((e,r)=>r!==t&&e.abort())})(e);return Promise.resolve().then(()=>t({stopRace:n,signal:o[e].signal})).then(t=>(n(),t)).catch(t=>(r=t,null))})).then(t=>{if(null===i)throw r;return t[i]})};var Rr=window.WebSocket;class Ur{events=Object.create({});emit(t,e){this.events[t]?.forEach(t=>t(e))}on(t,e){this.events[t]=this.events[t]||[],this.events[t].push(e)}off(t,e){this.events[t]=e?this.events[t].filter(t=>t!==e):[]}}class Pr{key;disconnectTime;ws=void 0;queue=[];isConnected=!1;subscribers=0;emmitter=new Ur;disconnectTimeoutId=null;constructor(t,e=3e4){this.key=t,this.disconnectTime=e}connect(){if(this.disconnectTimeoutId&&clearTimeout(this.disconnectTimeoutId),!this.isConnected&&!this.ws){const t=`wss://ws.pusherapp.com/app/${this.key}?protocol=5&client=js&version=1.12.2`;this.ws=new Rr(t),this.ws.addEventListener("error",t=>{this.emmitter.emit("error",new Error(t.message))}),this.emmitter.on("connected",()=>{this.isConnected=!0,this.queue.forEach(t=>this.send(t.event,t.data)),this.queue=[]}),this.ws.addEventListener("message",t=>{const e=JSON.parse(t.data.toString());switch(e.event){case"pusher:connection_established":this.emmitter.emit("connected",void 0);break;case"pusher:ping":this.send("pusher:pong",{});break;case"progress":case"success":case"fail":this.emmitter.emit(e.channel,((t,e)=>"success"===t?{status:xr.Success,...e}:"progress"===t?{status:xr.Progress,...e}:{status:xr.Error,...e})(e.event,JSON.parse(e.data)))}})}}disconnect(){const t=()=>{this.ws?.close(),this.ws=void 0,this.isConnected=!1};this.disconnectTime?this.disconnectTimeoutId=setTimeout(()=>{t()},this.disconnectTime):t()}send(t,e){const r=JSON.stringify({event:t,data:e});this.ws?.send(r)}subscribe(t,e){this.subscribers+=1,this.connect();const r=`task-status-${t}`,i={event:"pusher:subscribe",data:{channel:r}};this.emmitter.on(r,e),this.isConnected?this.send(i.event,i.data):this.queue.push(i)}unsubscribe(t){this.subscribers-=1;const e=`task-status-${t}`,r={event:"pusher:unsubscribe",data:{channel:e}};this.emmitter.off(e),this.isConnected?this.send(r.event,r.data):this.queue=this.queue.filter(t=>t.data.channel!==e),0===this.subscribers&&this.disconnect()}onError(t){return this.emmitter.on("error",t),()=>this.emmitter.off("error",t)}}let Nr=null;const zr=t=>{if(!Nr){const e="undefined"==typeof window?0:3e4;Nr=new Pr(t,e)}return Nr};const Dr=(t,{publicKey:e,fileName:r,baseURL:i,baseCDN:o,checkForUrlDuplicates:n,saveUrlForRecurrentUploads:a,secureSignature:s,secureExpire:c,store:l,signal:u,onProgress:d,source:h,integration:p,userAgent:g,retryThrottledRequestMaxTimes:m,pusherKey:b=ir.pusherKey,metadata:f})=>{return Promise.resolve((v=b,void zr(v).connect())).then(()=>Cr(t,{publicKey:e,fileName:r,baseURL:i,checkForUrlDuplicates:n,saveUrlForRecurrentUploads:a,secureSignature:s,secureExpire:c,store:l,signal:u,source:h,integration:p,userAgent:g,retryThrottledRequestMaxTimes:m,metadata:f})).catch(t=>{const e=zr(b);return e?.disconnect(),Promise.reject(t)}).then(t=>t.type===kr.FileInfo?t:Or([({signal:r})=>function({token:t,publicKey:e,baseURL:r,integration:i,userAgent:o,retryThrottledRequestMaxTimes:n,retryNetworkErrorMaxTimes:a,onProgress:s,signal:c}){return rr({check:c=>Er(t,{publicKey:e,baseURL:r,integration:i,userAgent:o,retryThrottledRequestMaxTimes:n,retryNetworkErrorMaxTimes:a,signal:c}).then(e=>{switch(e.status){case xr.Error:return new gr(e.error,e.errorCode);case xr.Waiting:return!1;case xr.Unknown:return new gr(`Token "${t}" was not found.`);case xr.Progress:return s&&("unknown"===e.total?s({isComputable:!1}):s({isComputable:!0,value:e.done/e.total})),!1;case xr.Success:return s&&s({isComputable:!0,value:e.done/e.total}),e;default:throw new Error("Unknown status")}}),signal:c})}({token:t.token,publicKey:e,baseURL:i,integration:p,userAgent:g,retryThrottledRequestMaxTimes:m,onProgress:d,signal:r}),({signal:e})=>(({token:t,pusherKey:e,signal:r,onProgress:i})=>new Promise((o,n)=>{const a=zr(e),s=a.onError(n),c=()=>{s(),a.unsubscribe(t)};tr(r,()=>{c(),n(new er("pusher cancelled"))}),a.subscribe(t,t=>{switch(t.status){case xr.Progress:i&&("unknown"===t.total?i({isComputable:!1}):i({isComputable:!0,value:t.done/t.total}));break;case xr.Success:c(),i&&i({isComputable:!0,value:t.done/t.total}),o(t);break;case xr.Error:c(),n(new gr(t.msg,t.error_code))}})}))({token:t.token,pusherKey:b,signal:e,onProgress:d})],{signal:u})).then(t=>{if(t instanceof gr)throw t;return t}).then(t=>$r(t.uuid,{publicKey:e,baseURL:i,integration:p,userAgent:g,retryThrottledRequestMaxTimes:m,onProgress:d,signal:u})).then(t=>new Lr(t,{baseCDN:o}));var v},Fr=new WeakMap,Vr=async t=>{if(lr(t)||cr(t))return t.size;if(ur(t)){return(await(async t=>{if(Fr.has(t))return Fr.get(t);const e=await fetch(t.uri).then(t=>t.blob());return Fr.set(t,e),e})(t)).size}throw new Error("Unknown file type. Cannot determine file size.")},Br=t=>{const e=new RegExp("[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}");return!dr(t)&&e.test(t)},jr=t=>{const e=new RegExp("^(?:\\w+:)?\\/\\/([^\\s\\.]+\\.\\S{2}|localhost[\\:?\\d]*)\\S*$");return!dr(t)&&e.test(t)},Hr=async(t,e,r)=>i=>((t,e,r,i)=>{const o=i*e,n=Math.min(o+i,r);return t.slice(o,n)})(t,i,e,r),qr=async(t,{publicKey:e,fileName:r,fileSize:i,baseURL:o,secureSignature:n,secureExpire:a,store:s,signal:c,onProgress:l,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,contentType:m,multipartChunkSize:b=ir.multipartChunkSize,maxConcurrentRequests:f=ir.maxConcurrentRequests,baseCDN:v,metadata:y})=>{const w=i??await Vr(t);let _;const k=(t,e)=>{if(!l)return;_||(_=Array(t).fill(0));return r=>{var i;r.isComputable&&(_[e]=r.value,l({isComputable:!0,value:(i=_,i.reduce((t,e)=>t+e,0)/t)}))}};return m||=vr(t),Ir(w,{publicKey:e,contentType:m,fileName:r||yr(t),baseURL:o,secureSignature:n,secureExpire:a,store:s,signal:c,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,metadata:y,multipartChunkSize:b}).then(async({uuid:r,parts:i})=>{const o=await Hr(t,w,b);return Promise.all([r,(n=f,a=i.map((t,r)=>()=>((t,e,{publicKey:r,contentType:i,onProgress:o,signal:n,integration:a,retryThrottledRequestMaxTimes:s,retryNetworkErrorMaxTimes:c})=>Sr(t,e,{publicKey:r,contentType:i,onProgress:o,signal:n,integration:a,retryThrottledRequestMaxTimes:s,retryNetworkErrorMaxTimes:c}))(o(r),t,{publicKey:e,contentType:m,onProgress:k(i.length,r),signal:c,integration:d,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g})),new Promise((t,e)=>{const r=[];let i=!1,o=a.length;const s=[...a],c=()=>{const n=a.length-s.length,l=s.shift();l&&l().then(e=>{i||(r[n]=e,o-=1,o?c():t(r))}).catch(t=>{i=!0,e(t)})};for(let t=0;t<n;t++)c()}))]);var n,a}).then(([t])=>Mr(t,{publicKey:e,baseURL:o,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g})).then(t=>t.isReady?t:$r(t.uuid,{publicKey:e,baseURL:o,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,onProgress:l,signal:c})).then(t=>new Lr(t,{baseCDN:v}))};async function Kr(t,{publicKey:e,fileName:r,baseURL:i=ir.baseURL,secureSignature:o,secureExpire:n,store:a,signal:s,onProgress:c,source:l,integration:u,userAgent:d,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,contentType:g,multipartMinFileSize:m,multipartChunkSize:b,maxConcurrentRequests:f,baseCDN:v=ir.baseCDN,checkForUrlDuplicates:y,saveUrlForRecurrentUploads:w,pusherKey:_,metadata:k}){if(dr(t)){const y=await Vr(t);return((t,e=ir.multipartMinFileSize)=>t>=e)(y,m)?qr(t,{publicKey:e,contentType:g,multipartChunkSize:b,fileSize:y,fileName:r,baseURL:i,secureSignature:o,secureExpire:n,store:a,signal:s,onProgress:c,source:l,integration:u,userAgent:d,maxConcurrentRequests:f,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,baseCDN:v,metadata:k}):((t,{publicKey:e,fileName:r,baseURL:i,secureSignature:o,secureExpire:n,store:a,contentType:s,signal:c,onProgress:l,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,baseCDN:m,metadata:b})=>_r(t,{publicKey:e,fileName:r,contentType:s,baseURL:i,secureSignature:o,secureExpire:n,store:a,signal:c,onProgress:l,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,metadata:b}).then(({file:t})=>$r(t,{publicKey:e,baseURL:i,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,onProgress:l,signal:c})).then(t=>new Lr(t,{baseCDN:m})))(t,{publicKey:e,fileName:r,contentType:g,baseURL:i,secureSignature:o,secureExpire:n,store:a,signal:s,onProgress:c,source:l,integration:u,userAgent:d,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,baseCDN:v,metadata:k})}if(jr(t))return Dr(t,{publicKey:e,fileName:r,baseURL:i,baseCDN:v,checkForUrlDuplicates:y,saveUrlForRecurrentUploads:w,secureSignature:o,secureExpire:n,store:a,signal:s,onProgress:c,source:l,integration:u,userAgent:d,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,pusherKey:_,metadata:k});if(Br(t))return((t,{publicKey:e,fileName:r,baseURL:i,signal:o,onProgress:n,source:a,integration:s,userAgent:c,retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:u,baseCDN:d})=>Ar(t,{publicKey:e,baseURL:i,signal:o,source:a,integration:s,userAgent:c,retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:u}).then(t=>new Lr(t,{baseCDN:d,fileName:r})).then(t=>(n&&n({isComputable:!0,value:1}),t)))(t,{publicKey:e,fileName:r,baseURL:i,signal:s,onProgress:c,source:l,integration:u,userAgent:d,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,baseCDN:v});throw new TypeError(`File uploading from "${t}" is not supported`)}class Gr{uuid;filesCount;totalSize;isStored;isImage;cdnUrl;files;createdAt;storedAt=null;constructor(t,{baseCDN:e=ir.baseCDN}={}){this.uuid=t.id,this.filesCount=t.filesCount;const r=t.files.filter(Boolean);this.totalSize=Object.values(r).reduce((t,e)=>t+e.size,0),this.isStored=!!t.datetimeStored,this.isImage=!!Object.values(r).filter(t=>t.isImage).length,this.cdnUrl=t.cdnUrl,this.files=r.map(t=>new Lr(t,{baseCDN:e})),this.createdAt=t.datetimeCreated,this.storedAt=t.datetimeStored}}function Wr(t,{publicKey:e,fileName:r,baseURL:i=ir.baseURL,secureSignature:o,secureExpire:n,store:a,signal:s,onProgress:c,source:l,integration:u,userAgent:d,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,contentType:g,multipartChunkSize:m=ir.multipartChunkSize,baseCDN:b=ir.baseCDN,checkForUrlDuplicates:f,saveUrlForRecurrentUploads:v,jsonpCallback:y}){if(!(t=>{for(const e of t)if(!dr(e))return!1;return!0})(t)&&!(t=>{for(const e of t)if(!jr(e))return!1;return!0})(t)&&!(t=>{for(const e of t)if(!Br(e))return!1;return!0})(t))throw new TypeError(`Group uploading from "${t}" is not supported`);let w,_=!0;const k=t.length,x=(t,e)=>{if(!c)return;w||(w=Array(t).fill(0));return r=>{if(!r.isComputable||!_)return _=!1,void c({isComputable:!1});var i;w[e]=r.value,c({isComputable:!0,value:(i=w,i.reduce((t,e)=>t+e)/t)})}};return Promise.all(t.map((t,c)=>dr(t)||jr(t)?Kr(t,{publicKey:e,fileName:r,baseURL:i,secureSignature:o,secureExpire:n,store:a,signal:s,onProgress:x(k,c),source:l,integration:u,userAgent:d,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,contentType:g,multipartChunkSize:m,baseCDN:b,checkForUrlDuplicates:f,saveUrlForRecurrentUploads:v}).then(t=>t.uuid):t)).then(t=>Tr(t,{publicKey:e,baseURL:i,jsonpCallback:y,secureSignature:o,secureExpire:n,signal:s,source:l,integration:u,userAgent:d,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p}).then(t=>new Gr(t,{baseCDN:b})).then(t=>(c&&c({isComputable:!0,value:1}),t)))}class Xr{_concurrency=1;_pending=[];_running=0;_resolvers=new Map;_rejectors=new Map;constructor(t){this._concurrency=t}run(){const t=this._concurrency-this._running;for(let e=0;e<t;e++){const t=this._pending.shift();if(!t)return;const e=this._resolvers.get(t),r=this._rejectors.get(t);if(!e||!r)throw new Error("Unexpected behavior: resolver or rejector is undefined");this._running+=1,t().finally(()=>{this._resolvers.delete(t),this._rejectors.delete(t),this._running-=1,this.run()}).then(t=>e(t)).catch(t=>r(t))}}add(t,{autoRun:e}={autoRun:!0}){return new Promise((r,i)=>{this._resolvers.set(t,r),this._rejectors.set(t,i),this._pending.push(t),e&&this.run()})}get pending(){return this._pending.length}get running(){return this._running}set concurrency(t){this._concurrency=t,this.run()}get concurrency(){return this._concurrency}}const Zr={button:["toolbar"],checkbox:["toolbar"],menuitem:["menu","menubar"],option:["listbox"],tab:["tablist"]};function Yr(t,e){e.tabIndex=0,e.focus(),t.tabIndex=-1}function Qr(t){let e=t.role||t.type||t.tagName;if(!e)return null;let r=Zr[e.toLowerCase()];if(!r)return null;for(let e of r){let r=t.closest(`[role=${e}]`);if(r)return r}}function Jr(t,e){return"toolbar"===e.role?function(t){let e=[...t.querySelectorAll("*")];return e.filter(t=>"button"===t.role||"button"===t.type||"checkbox"===t.role||"checkbox"===t.type)}(e):e.querySelectorAll(`[role=${t.role}]`)}function ti(t){return e=>{let r=!1,i=t?.searchDelayMs||300,o=0,n="";function a(t){let r=Qr(t.target);if(!r)return void s();let a=Jr(t.target,r),c=Array.from(a).indexOf(t.target),l="ArrowDown",u="ArrowUp";if(function(t){let e=t.getAttribute("aria-orientation");if("vertical"===e)return!1;if("horizontal"===e)return!0;let r=t.role;return"menubar"===r||"tablist"===r||"toolbar"===r}(r)&&("rtl"===e.document.dir?(l="ArrowLeft",u="ArrowRight"):(l="ArrowRight",u="ArrowLeft")),t.key===l)t.preventDefault(),Yr(t.target,a[c+1]||a[0]);else if(t.key===u)t.preventDefault(),Yr(t.target,a[c-1]||a[a.length-1]);else if("Home"===t.key)t.preventDefault(),Yr(t.target,a[0]);else if("End"===t.key)t.preventDefault(),Yr(t.target,a[a.length-1]);else if(1===t.key.length&&"tablist"!==r.role){let e=Date.now();e-o<=i?n+=t.key.toLowerCase():n=t.key.toLowerCase(),o=e;let r=Array.from(a).find(t=>t.textContent?.trim()?.toLowerCase()?.startsWith(n));r&&(t.preventDefault(),Yr(t.target,r))}}function s(){r=!1,e.removeEventListener("keydown",a)}function c(t){let i=Qr(t.target);if(i){r||(r=!0,e.addEventListener("keydown",a));let o=Jr(t.target,i);for(let e of o)e!==t.target&&e.setAttribute("tabindex",-1)}else r&&s()}function l(t){t.relatedTarget&&t.relatedTarget!==e.document||s()}function u(t){let e=Qr(t.target);if(e){let r=Jr(t.target,e);for(let e of r)e!==t.target&&e.setAttribute("tabindex",-1);t.target.setAttribute("tabindex",0)}}return e.addEventListener("click",u),e.addEventListener("focusin",c),e.addEventListener("focusout",l),()=>{s(),e.removeEventListener("click",u),e.removeEventListener("focusin",c),e.removeEventListener("focusout",l)}}}function ei(t){let e,r,i=t.split(" ");function o(t){"Enter"!==t.key||"BUTTON"!==t.target.tagName&&"A"!==t.target.tagName||(n(),t.target.classList.add(...i),e=t.target,r=t.target)}function n(){e&&e.classList.remove(...i),r=null}function a(t){0===t.clientX&&0===t.clientY&&r!==t.target&&(n(),t.target.classList.add(...i),e=t.target)}return t=>(t.addEventListener("click",a),t.addEventListener("keydown",o),t.addEventListener("keyup",n),()=>{t.removeEventListener("click",a),t.removeEventListener("keydown",o),t.removeEventListener("keyup",n)})}function ri(){return t=>{let e=[];function r(){let i=e.pop();if(!i)return void t.document.activeElement.blur();let o=i.deref();o&&o.isConnected?o.focus():r()}let i,o=0;function n(r){clearInterval(i);let n=r.getAttribute("aria-controls");i=setInterval(()=>{if(o++>50)return void clearInterval(i);let r=t.document.getElementById(n);if(r){let o=r.querySelector('a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])');o&&(clearInterval(i),r.dispatchEvent(new t.CustomEvent("keyuxJump",{bubbles:!0})),function(r){let i=t.document.activeElement;i&&i!==t.document.body&&e.push(new WeakRef(i)),r.focus({focusVisible:!0})}(o))}},50)}function a(t){t.target.getAttribute("aria-controls")&&"Enter"===t.key&&n(t.target),"Escape"===t.key&&r()}return t.addEventListener("keydown",a),()=>{t.removeEventListener("keydown",a)}}}function ii(t){return Array.isArray(t)?t.map(t=>"object"==typeof t&&null!==t?ii(t):t):"object"!=typeof t||null===t?t:Object.fromEntries(Object.entries(t).map(([t,e])=>{const r=function(t){return t.replace(/[A-Z]/g,t=>`_${t.toLowerCase()}`).replace(/__/g,"_")}(t);return"object"==typeof e&&null!==e?[r,ii(e)]:[r,e]}))}function oi(t){return{ok:!1,error:t}}class ni{constructor(t="https://tlm.uploadcare.com/api/"){this.baseUrl=t}async base(t,e={}){const r=`${this.baseUrl}${t}`;try{const t=await fetch(r,e);if(!t.ok)return oi(new Error(`Got non-200 response from "${r}". Status: ${t.status.toString()}`));try{const e=await t.json();return{ok:!0,value:e}}catch(t){return oi(new Error(`Error parsing JSON from "${r}". Error: ${t}`))}}catch(t){return oi(new Error(`Error fetching data from "${r}". Error: ${t}`))}}async post(t,e,r={}){return await this.base(t,{...r,method:"POST",body:JSON.stringify(ii(e)),headers:{"Content-Type":"application/json",...r.headers||{}}})}async get(t,e={}){return await this.base(t,{method:"GET",...e})}}class ai extends ni{constructor(){super()}async sendEvent(t,e){const r=await(async(t,e)=>({success:!0,data:e}))(0,t);if(!r.success)throw console.error("TelemetryAPIService: events: body is invalid",r.error),new Error("TelemetryAPIService: events: body is invalid");return this.post("v1/events",t,e)}}const si=t=>{if(t<=0n)return"0";let e="";for(;t>0n;){e="0123456789abcdefghijklmnopqrstuvwxyz"[Number(t%36n)]+e,t/=36n}return e},ci=async t=>{const e=await(async t=>{const e=(new TextEncoder).encode(t),r=await window.crypto.subtle.digest("SHA-256",e),i=Array.from(new Uint8Array(r)).map(t=>t.toString(16).padStart(2,"0")).join("");return BigInt(`0x${i}`)})(t);return si(e).slice(0,10)},li=async(t,e)=>((t,e)=>{const r=new URL(e);return r.hostname=`${t}.${r.hostname}`,r.toString().replace(/\/$/,"")})(await ci(t),e),ui=()=>{const t=[];return{stack:t,promiseReadJpegChunks:e=>new Promise((r,i)=>{let o=2;const n=(t,e)=>{const r=new FileReader;r.addEventListener("load",()=>{e(new DataView(r.result))}),r.addEventListener("error",t=>{i(`Reader error: ${t}`)}),r.readAsArrayBuffer(t)},a=()=>n(e.slice(o,o+128),t=>{let e,r,i;for(e=r=0,i=t.byteLength;i>=0?r<i:r>i;e=i>=0?++r:--r)if(255===t.getUint8(e)){o+=e;break}s()}),s=()=>{const s=o;return n(e.slice(o,o+=4),c=>{if(4!==c.byteLength||255!==c.getUint8(0))return void i("Corrupted");const l=c.getUint8(1);if(218===l)return void r(!0);const u=c.getUint16(2)-2;return n(e.slice(o,o+=u),e=>{e.byteLength===u?(t.push({startPos:s,length:u,marker:l,view:e}),a()):i("Corrupted")})})};FileReader&&DataView||i("Not Support"),n(e.slice(0,2),t=>{65496!==t.getUint16(0)&&i("Not jpeg"),a()})})}},di=async t=>{const e=[],{promiseReadJpegChunks:r,stack:i}=ui();return await r(t),i.forEach(({marker:t,view:r})=>{226===t&&1229144927===r.getUint32(0)&&1347571526===r.getUint32(4)&&1229735168===r.getUint32(8)&&e.push(r)}),e},hi=async(t,e,r)=>{{const i=[],o=[],{promiseReadJpegChunks:n,stack:a}=ui();await n(t),a.forEach(t=>{if(t.marker===e)return i.push(t.startPos),o.push(t.length)});const s=[t.slice(0,2)];for(const t of r){const r=new DataView(new ArrayBuffer(4));r.setUint16(0,65280+e),r.setUint16(2,t.byteLength+2),s.push(r.buffer),s.push(t)}let c=2;for(let e=0;e<i.length;e++)i[e]>c&&s.push(t.slice(c,i[e])),c=i[e]+o[e]+4;return s.push(t.slice(c,t.size)),new Blob(s,{type:t.type})}},pi=(t,e)=>hi(t,226,e.map(t=>t.buffer)),gi=()=>{const t=document.createElement("canvas"),e=t.getContext("2d");return{canvas:t,ctx:e}},mi=async t=>{let e=null;const{promiseReadJpegChunks:r,stack:i}=ui();return await r(t),i.forEach(({marker:t,view:r})=>{!e&&225===t&&r.byteLength>=14&&1165519206===r.getUint32(0)&&0===r.getUint16(4)&&(e=r)}),e};let bi;const fi=t=>((t,e)=>new Promise((r,i)=>{e&&(t.src=e),t.complete?r(t):(t.addEventListener("load",()=>{r(t)}),t.addEventListener("error",()=>{i(new Error("Failed to load image. Probably not an image."))}))}))(new Image,t),vi=[1,3],yi=[192,193,194,195,197,198,199,201,202,203,205,206,207],wi={squareSide:[Math.floor(Math.sqrt(5e6)),4096,8192,11180,10836,11402,14188,16384],dimension:[4096,8192,16384,32767,65535]},_i=(t,e)=>{const r={};return(...i)=>{const o=e(i,r);return o in r?r[o]:r[o]=t(...i)}},ki=(t,e)=>{const[r]=t,i=Object.keys(e).map(t=>parseInt(t,10)).sort((t,e)=>t-e);for(let t=0;t<i.length;t++){const o=i[t],n=!!e[o];if(o>r&&n)return o;if(o<r&&!n)return o}return r},xi=55,Ci=110,Ei=165,Ti=255,Ai=`rgba(${xi}, ${Ci}, ${Ei}, ${Ti/255})`,Ii=(t,e)=>{try{const r=[t-1,e-1,1,1],{canvas:i,ctx:o}=gi();i.width=1,i.height=1;const{canvas:n,ctx:a}=gi();n.width=t,n.height=e,a&&(a.fillStyle=Ai,a.fillRect(...r),o.drawImage(n,t-1,e-1,1,1,0,0,1,1));const s=o&&o.getImageData(0,0,1,1).data;let c=!1;return s&&(c=s[0]===xi&&s[1]===Ci&&s[2]===Ei&&s[3]===Ti),n.width=n.height=1,c}catch(r){return console.error(`Failed to test for max canvas size of ${t}x${e}.`),!1}};function Si(t){return(...e)=>new Promise(r=>{setTimeout(()=>{const i=t(...e);r(i)},0)})}const Mi=Si(_i(Ii,ki)),$i=Si(_i(Ii,ki)),Li=async(t,e)=>{const r=wi.squareSide.find(r=>r*r>=t*e),i=wi.dimension.find(r=>r>=t&&r>=e);if(!r||!i)throw new Error("Not supported");const[o,n]=await Promise.all([Mi(r,r),$i(i,1)]);if(o&&n)return!0;throw new Error("Not supported")},Oi=async(t,e,r)=>{try{const{ctx:i,canvas:o}=gi();return o.width=e,o.height=r,i.imageSmoothingQuality="high",i.drawImage(t,0,0,e,r),t instanceof HTMLImageElement&&(t.src="//:0"),t instanceof HTMLCanvasElement&&(t.width=t.height=1),o}catch(t){throw new Error("Canvas resize error",{cause:t})}},Ri=({img:t,sourceW:e,targetW:r,targetH:i,step:o})=>{const n=function({sourceW:t,targetW:e,targetH:r,step:i}){const o=[];let n=e,a=r;do{o.push([n,a]),n=Math.round(n/i),a=Math.round(a/i)}while(n<t*i);return o.reverse()}({sourceW:e,targetW:r,targetH:i,step:o});return n.reduce((t,[e,r],i)=>t.then(t=>Li(e,r).then(()=>Oi(t,e,r)).catch(()=>{if(i===n.length-1)throw new Error("Not supported");return t})),Promise.resolve(t))},Ui=navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),Pi=.71,Ni=(t,e)=>{if(t.width*Pi*t.height*Pi<e.size)throw new Error("Not required");const r=t.width,i=t.height,o=r/i,n=Math.floor(Math.sqrt(e.size*o)),a=Math.floor(e.size/Math.sqrt(e.size*o));return Li(n,a).then(()=>{const{ctx:e}=gi();return"imageSmoothingQuality"in e&&!(/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform))&&!Ui?(({img:t,targetW:e,targetH:r})=>Oi(t,e,r))({img:t,targetW:n,targetH:a}):Ri({img:t,sourceW:r,targetW:n,targetH:a,step:Pi})}).catch(()=>Promise.reject("Not supported"))},zi=async(t,e)=>{try{if(await(async t=>{let e=!1;const{promiseReadJpegChunks:r,stack:i}=ui();return await r(t).then(()=>(i.forEach(({marker:t,view:r})=>{if(!e&&yi.indexOf(t)>=0){const t=r.getUint8(5);vi.indexOf(t)<0&&(e=!0)}}),e)).catch(()=>e)})(t))throw new Error("Should skipped");const r=await Promise.allSettled([mi(t),new Promise(t=>{if(void 0!==bi)t(bi);else{const e=new Image;e.addEventListener("load",()=>{bi=e.naturalWidth<e.naturalHeight,e.src="//:0",t(bi)}),e.src="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k="}}),di(t)]),i=!r.some(t=>"rejected"===t.status),[o,n,a]=r,s=await(async t=>{try{return await pi(t,[])}catch(t){throw new Error(`Failed to strip ICC profile: ${t}`)}})(t).catch(()=>t),c=await fi(URL.createObjectURL(s));URL.revokeObjectURL(c.src);const l=await Ni(c,e);let u="image/jpeg",d=e?.quality||.8;!i&&(t=>{const{ctx:e,canvas:r}=gi();r.width=r.height=50,e.drawImage(t,0,0,50,50);const i=e.getImageData(0,0,50,50).data;r.width=r.height=1;for(let t=3;t<i.length;t+=4)if(i[t]<254)return!0;return!1})(l)&&(u="image/png",d=void 0);let h=await((t,e,r)=>new Promise((i,o)=>{t.toBlob(t=>{t?i(t):o("Failed to convert canvas to blob")},e,r),t.width=t.height=1}))(l,u,d);if(i&&"fulfilled"===o.status&&o.value){const t=o.value,e="fulfilled"===n.status&&n.value;h=await(async(t,e,r)=>(r&&((t,e)=>{((t,e)=>{let r,i,o,n;if(t&&!(t.byteLength<14)&&1165519206===t.getUint32(0)&&0===t.getUint16(4)){if(18761===t.getUint16(6))i=!0;else{if(19789!==t.getUint16(6))return;i=!1}if(42===t.getUint16(8,i))for(o=8+t.getUint32(10,i),r=0,n=t.getUint16(o-2,i);n>=0?r<n:r>n;n>=0?++r:--r){if(t.byteLength<o+10)return;274===t.getUint16(o,i)&&e(o+8,i),o+=12}}})(t,(r,i)=>t.setUint16(r,e,i))})(e,1),hi(t,225,[e.buffer])))(h,t,e)}return i&&"fulfilled"===a.status&&a.value.length>0&&(h=await pi(h,a.value)),h}catch(t){let e;throw t instanceof Error&&(e=t.message),"string"==typeof t&&(e=t),new Error("Failed to shrink image. "+(e?`Message: "${e}".`:""),{cause:t})}};var Di=Object.freeze({INIT_SOLUTION:"init-solution",CHANGE_CONFIG:"change-config",ACTION_EVENT:"action-event",ERROR_EVENT:"error-event"}),Fi=Object.freeze({FILE_ADDED:"file-added",FILE_REMOVED:"file-removed",FILE_UPLOAD_START:"file-upload-start",FILE_UPLOAD_PROGRESS:"file-upload-progress",FILE_UPLOAD_SUCCESS:"file-upload-success",FILE_UPLOAD_FAILED:"file-upload-failed",FILE_URL_CHANGED:"file-url-changed",MODAL_OPEN:"modal-open",MODAL_CLOSE:"modal-close",DONE_CLICK:"done-click",UPLOAD_CLICK:"upload-click",ACTIVITY_CHANGE:"activity-change",COMMON_UPLOAD_START:"common-upload-start",COMMON_UPLOAD_PROGRESS:"common-upload-progress",COMMON_UPLOAD_SUCCESS:"common-upload-success",COMMON_UPLOAD_FAILED:"common-upload-failed",CHANGE:"change",GROUP_CREATED:"group-created"}),Vi=class{_timeoutStore=new Map;_targets=new Set;_debugPrint=null;constructor(t){this._debugPrint=t}bindTarget(t){this._targets.add(t)}unbindTarget(t){this._targets.delete(t)}_dispatch(t,e){for(const r of this._targets)r.dispatchEvent(new CustomEvent(t,{detail:e}));this._debugPrint?.(()=>{const r=e&&"object"==typeof e?{...e}:e;return[`event "${t}"`,r]})}emit(t,e,r={}){const{debounce:i}=r;if("number"!=typeof i&&!i)return void this._dispatch(t,"function"==typeof e?e():e);this._timeoutStore.has(t)&&window.clearTimeout(this._timeoutStore.get(t));const o="number"==typeof i?i:20,n=window.setTimeout(()=>{this._dispatch(t,"function"==typeof e?e():e),this._timeoutStore.delete(t)},o);this._timeoutStore.set(t,n)}};function Bi(t,e){let r;const i=(...i)=>{r&&clearTimeout(r),r=setTimeout(()=>t(...i),e)};return i.cancel=()=>{r&&clearTimeout(r)},i}var ji=t=>t?t.split(",").map(t=>t.trim()).filter(Boolean):[],Hi=t=>t.join(","),qi=t=>{if("string"!=typeof t||!t)return"";let e=t.trim();return e.startsWith("-/")?e=e.slice(2):e.startsWith("/")&&(e=e.slice(1)),e.endsWith("/")&&(e=e.slice(0,e.length-1)),e},Ki=(...t)=>t.filter(t=>"string"==typeof t&&!!t).map(t=>qi(t)).join("/-/"),Gi=(...t)=>{const e=Ki(...t);return e?`-/${e}/`:""};function Wi(t){const e=new URL(t),r=e.pathname+e.search+e.hash,i=r.lastIndexOf("http"),o=r.lastIndexOf("/");let n="";return i>=0?n=r.slice(i):o>=0&&(n=r.slice(o+1)),n}function Xi(t){const e=new URL(t),{pathname:r}=e,i=r.indexOf("/"),o=r.indexOf("/",i+1);return r.substring(i+1,o)}function Zi(t){const e=Qi(t),r=new URL(e),i=r.pathname.indexOf("/-/");if(-1===i)return"";return r.pathname.substring(i).slice(1)}function Yi(t){return Zi(t).split("/-/").filter(Boolean).map(t=>qi(t))}function Qi(t){const e=new URL(t),r=Wi(t),i=Ji(r)?to(r).pathname:r;return e.pathname=e.pathname.replace(i,""),e.search="",e.hash="",e.toString()}function Ji(t){return t.startsWith("http")}function to(t){const e=new URL(t);return{pathname:`${e.origin}${e.pathname??""}`,search:e.search??"",hash:e.hash??""}}var eo=(t,e,r)=>{const i=new URL(Qi(t)),o=r??Wi(t),n=e??"";if(i.pathname.startsWith("//")&&(i.pathname=i.pathname.replace("//","/")),o&&Ji(o)){const t=to(o);i.pathname=`${i.pathname}${n}${t.pathname||""}`,i.search=t.search,i.hash=t.hash}else i.pathname=`${i.pathname}${n}${o||""}`;return i.toString()},ro=(t,e)=>{const r=new URL(t);return r.pathname=`${e}/`,r.toString()},io=(t,e=",")=>t.trim().split(e).map(t=>t.trim()).filter(t=>t.length>0),oo=Object.freeze({brightness:0,exposure:0,gamma:100,contrast:0,saturation:0,vibrance:0,warmth:0,enhance:0,filter:0,rotate:0,mirror:!1,flip:!1,crop:void 0}),no=["enhance","brightness","exposure","gamma","contrast","saturation","vibrance","warmth","filter","mirror","flip","rotate","crop"];function ao(t){return Ki(...no.filter(e=>void 0!==t[e]&&null!==t[e]).map(e=>function(t,e){if("number"==typeof e){const r=e;return oo[t]!==r?`${t}/${r}`:""}if("boolean"==typeof e){const r=e;return oo[t]!==r?`${t}`:""}if("filter"===t&&e){const{name:r,amount:i}=e;return oo.filter===i?"":`${t}/${r}/${i}`}if("crop"===t&&e){const{dimensions:r,coords:i}=e;return`${t}/${r.join("x")}/${i.join(",")}`}return""}(e,t[e])).filter(t=>!!t))}var so=Ki("format/auto","progressive/yes"),co=([t])=>void 0!==t?Number(t):void 0,lo=()=>!0,uo=Object.freeze({enhance:co,brightness:co,exposure:co,gamma:co,contrast:co,saturation:co,vibrance:co,warmth:co,filter:([t,e])=>({name:t,amount:void 0!==e?Number(e):100}),mirror:lo,flip:lo,rotate:co,crop:t=>{const[e,r]=t,{dimensions:i,coords:o}=(([t,e])=>{if(!/\d+x\d+/.test(t)||!/\d+,\d+/.test(e))throw new Error("Crop by aspect ratio, percentage or alignment shortcuts is not supported.");return{dimensions:io(t,"x").map(Number),coords:io(e).map(Number)}})([e,r]);return{dimensions:i,coords:o}}});function ho(t){const e={};for(const r of t){const[t,...i]=r.split("/");if(!t||!no.includes(t))continue;const o=t,n=uo[o];try{const t=n(i);e[o]=t}catch(t){console.warn([`Failed to parse URL operation "${r}". It will be ignored.`,t instanceof Error?`Error message: "${t.message}"`:t,"If you need this functionality, please feel free to open an issue at https://github.com/uploadcare/blocks/issues/new"].join("\n"))}}return e}var po=Object.freeze({CROP:"crop",TUNING:"tuning",FILTERS:"filters"}),go=Object.freeze([po.CROP,po.TUNING,po.FILTERS]),mo=Object.freeze(["brightness","exposure","gamma","contrast","saturation","vibrance","warmth","enhance"]),bo=Object.freeze(["adaris","briaril","calarel","carris","cynarel","cyren","elmet","elonni","enzana","erydark","fenralan","ferand","galen","gavin","gethriel","iorill","iothari","iselva","jadis","lavra","misiara","namala","nerion","nethari","pamaya","sarnar","sedis","sewen","sorahel","sorlen","tarian","thellassan","varriel","varven","vevera","virkas","yedis","yllara","zatvel","zevcen"]),fo=Object.freeze(["rotate","mirror","flip"]),vo=oo,yo=Object.freeze({brightness:{zero:vo.brightness,range:[-100,100],keypointsNumber:2},exposure:{zero:vo.exposure,range:[-500,500],keypointsNumber:2},gamma:{zero:vo.gamma,range:[0,1e3],keypointsNumber:2},contrast:{zero:vo.contrast,range:[-100,500],keypointsNumber:2},saturation:{zero:vo.saturation,range:[-100,500],keypointsNumber:1},vibrance:{zero:vo.vibrance,range:[-100,500],keypointsNumber:1},warmth:{zero:vo.warmth,range:[-100,100],keypointsNumber:1},enhance:{zero:vo.enhance,range:[0,100],keypointsNumber:1},filter:{zero:vo.filter,range:[0,100],keypointsNumber:1}}),wo="https://ucarecdn.com",_o={pubkey:"",multiple:!0,multipleMin:0,multipleMax:Number.MAX_SAFE_INTEGER,confirmUpload:!1,imgOnly:!1,accept:"",externalSourcesPreferredTypes:"",externalSourcesEmbedCss:"",store:"auto",cameraMirror:!1,cameraCapture:"",sourceList:"local, url, camera, dropbox, gdrive",topLevelOrigin:"",cloudImageEditorTabs:Hi(go),maxLocalFileSizeBytes:0,thumbSize:76,showEmptyList:!1,useLocalImageEditor:!1,useCloudImageEditor:!0,removeCopyright:!1,cropPreset:"",imageShrink:"",modalScrollLock:!0,modalBackdropStrokes:!1,sourceListWrap:!0,remoteTabSessionKey:"",cdnCname:wo,cdnCnamePrefixed:"https://ucarecd.net",baseUrl:"https://upload.uploadcare.com",socialBaseUrl:"https://social.uploadcare.com",secureSignature:"",secureExpire:"",secureDeliveryProxy:"",retryThrottledRequestMaxTimes:10,retryNetworkErrorMaxTimes:3,multipartMinFileSize:26214400,multipartChunkSize:5242880,maxConcurrentRequests:10,multipartMaxConcurrentRequests:4,multipartMaxAttempts:3,checkForUrlDuplicates:!1,saveUrlForRecurrentUploads:!1,groupOutput:!1,userAgentIntegration:"",debug:!1,metadata:null,localeName:"en",localeDefinitionOverride:null,secureUploadsExpireThreshold:6e5,secureUploadsSignatureResolver:null,secureDeliveryProxyUrlResolver:null,iconHrefResolver:null,fileValidators:[],collectionValidators:[],validationTimeout:15e3,validationConcurrency:100,cameraModes:"photo, video",defaultCameraMode:null,enableAudioRecording:!0,enableVideoRecording:null,maxVideoRecordingDuration:null,mediaRecorderOptions:null,filesViewMode:"list",gridShowFileNames:!1,cloudImageEditorAutoOpen:!1,cloudImageEditorMaskHref:null,testMode:!1,qualityInsights:!0},ko=Object.freeze(_o),xo=(t,e)=>new Intl.PluralRules(t).select(e),Co=t=>t,Eo="{{",To="}}",Ao="plural:";function Io(t,e={},r={}){const{openToken:i=Eo,closeToken:o=To,transform:n=Co}=r;for(const r in e){const a=e[r],s=null!=a?a.toString():void 0,c="string"==typeof s?n(s):String(s);t=t.replaceAll(i+r+o,c)}return t}var So="--uploadcare-blocks-window-height",Mo=class t{static clientsRegistry=new Set;static flush=Bi(()=>{document.documentElement.style.setProperty(So,`${window.innerHeight}px`)},100);static registerClient(e){0===t.clientsRegistry.size&&t.attachTracker(),t.clientsRegistry.add(e)}static unregisterClient(e){t.clientsRegistry.delete(e),0===t.clientsRegistry.size&&t.detachTracker()}static attachTracker(){window.addEventListener("resize",t.flush,{passive:!0,capture:!0}),t.flush()}static detachTracker(){window.removeEventListener("resize",t.flush,{capture:!0}),document.documentElement.style.removeProperty(So)}},$o=t=>({"*currentActivity":null,"*currentActivityParams":{},"*history":[],"*historyBack":null,"*closeModal":()=>{t.modalManager?.close(t.$["*currentActivity"]),t.set$({"*currentActivity":null})}}),Lo=t=>({...$o(t),"*commonProgress":0,"*uploadList":[],"*uploadQueue":new Xr(1),"*collectionErrors":[],"*collectionState":null,"*groupInfo":null,"*uploadTrigger":new Set,"*secureUploadsManager":null}),Oo={"locale-id":"en","social-source-lang":"en","upload-file":"Upload file","upload-files":"Upload files","choose-file":"Choose file","choose-files":"Choose files","drop-files-here":"Drop files here","select-file-source":"Select file source",selected:"Selected",upload:"Upload","add-more":"Add more",cancel:"Cancel","start-from-cancel":"Cancel",clear:"Clear","camera-shot":"Shot","upload-url":"Import","upload-url-placeholder":"Paste link here","edit-image":"Edit image","edit-detail":"Details",back:"Back",done:"Done",ok:"Ok","remove-from-list":"Remove",no:"No",yes:"Yes","confirm-your-action":"Confirm your action","are-you-sure":"Are you sure?","selected-count":"{{count}} of {{total}} selected","select-all":"Select all","deselect-all":"Deselect all","upload-error":"Upload error","validation-error":"Validation error","no-files":"No files selected",browse:"Browse","not-uploaded-yet":"Not uploaded yet...",file__one:"file",file__other:"files",error__one:"error",error__other:"errors","header-uploading":"Uploading {{count}} {{plural:file(count)}}","header-failed":"{{count}} {{plural:error(count)}}","header-succeed":"{{count}} {{plural:file(count)}} uploaded","header-total":"{{count}} {{plural:file(count)}} selected","src-type-local":"From device","src-type-from-url":"From link","src-type-camera":"Camera","src-type-mobile-video-camera":"Video","src-type-mobile-photo-camera":"Photo","src-type-draw":"Draw","src-type-facebook":"Facebook","src-type-dropbox":"Dropbox","src-type-gdrive":"Google Drive","src-type-ngdrive":"Google Drive","src-type-gphotos":"Google Photos","src-type-flickr":"Flickr","src-type-vk":"VK","src-type-evernote":"Evernote","src-type-box":"Box","src-type-onedrive":"OneDrive","src-type-huddle":"Huddle","src-type-other":"Other","caption-from-url":"Import from link","caption-camera":"Camera","caption-draw":"Draw","caption-edit-file":"Edit file","file-no-name":"No name...","toggle-fullscreen":"Toggle fullscreen","toggle-guides":"Toggle guides",rotate:"Rotate","flip-vertical":"Flip vertical","flip-horizontal":"Flip horizontal",apply:"Apply",brightness:"Brightness",contrast:"Contrast",saturation:"Saturation",exposure:"Exposure",gamma:"Gamma",vibrance:"Vibrance",warmth:"Warmth",enhance:"Enhance",original:"Original",resize:"Resize image",crop:"Crop","select-color":"Select color",text:"Text",draw:"Draw","cancel-edit":"Cancel edit","tab-view":"Preview","tab-details":"Details","file-name":"Name","file-size":"Size","cdn-url":"CDN URL","file-size-unknown":"Unknown","camera-permissions-denied":"Camera access denied","camera-permissions-prompt":"Please allow access to the camera","camera-permissions-request":"Request access","files-count-limit-error-title":"Files count limit overflow","files-count-limit-error-too-few":"You’ve chosen {{total}} {{plural:file(total)}}. At least {{min}} {{plural:file(min)}} required.","files-count-limit-error-too-many":"You’ve chosen too many files. {{max}} {{plural:file(max)}} is maximum.","files-max-size-limit-error":"File is too big. Max file size is {{maxFileSize}}.","has-validation-errors":"File validation error occurred. Please, check your files before upload.","images-only-accepted":"Only image files are accepted.","file-type-not-allowed":"Uploading of these file types is not allowed.","some-files-were-not-uploaded":"Some files were not uploaded.","file-item-edit-button":"Edit","file-item-remove-button":"Remove","a11y-editor-tab-filters":"Filters","a11y-editor-tab-tuning":"Tuning","a11y-editor-tab-crop":"Crop","a11y-activity-header-button-close":"Close",flip:"Flip",mirror:"Mirror","a11y-cloud-editor-apply-filter":"Apply {{name}} filter","a11y-cloud-editor-apply-crop":"Apply {{name}} operation","a11y-cloud-editor-apply-tuning":"Apply {{name}} tuning","a11y-cloud-editor-apply-aspect-ratio":"Apply operation {{name}} {{value}}",finished:"Finished",failed:"Failed",uploading:"Uploading",idle:"Idle","a11y-file-item-status":"File {{fileName}} in status {{status}}","waiting-for":"Waiting for {{source}}","queued-uploading":"Queued for upload","queued-validation":"Queued for validation",validation:"Validating","crop-to-shape":"Crop to {{value}}",custom:"Freeform","freeform-crop":"Freeform crop"},Ro=new Map,Uo=new Map,Po=(t,e)=>{Ro.has(t)&&console.log(`Locale ${t} is already defined. Overwriting...`),Ro.set(t,{...Oo,...e})},No=(t,e)=>{"function"==typeof e?((t,e)=>{Uo.set(t,e)})(t,e):Po(t,e)};No("en",Oo);var zo=t=>`*l10n/${t}`,Do=class{_blockInstance=null;_localeName="";_callbacks=new Set;_boundBlocks=new Map;constructor(t){this._blockInstance=t;for(const[t,e]of Object.entries(Oo)){const r=!this._blockInstance.has(zo(t))||!this._blockInstance.$[zo(t)];this._blockInstance.add(zo(t),e,r)}setTimeout(()=>{t.subConfigValue("localeName",async t=>{if(!this._blockInstance||!t)return;this._localeName=t;const e=await(async t=>{if(!Ro.has(t)){if(!Uo.has(t))throw new Error(`Locale ${t} is not defined`);const e=Uo.get(t),r=await e();Po(t,r)}return Ro.get(t)})(t);if("en"!==t&&this._localeName!==t)return;const r=this._blockInstance.cfg.localeDefinitionOverride?.[t];for(const[t,i]of Object.entries(e)){const e=r?.[t];this._blockInstance.add(zo(t),e??i,!0);for(const t of this._callbacks)t()}}),t.subConfigValue("localeDefinitionOverride",t=>{if(!t)return;const e=t[this._localeName];if(e)for(const[t,r]of Object.entries(e)){this._blockInstance?.add(zo(t),r,!0);for(const t of this._callbacks)t()}})})}onLocaleChange(t){const e=Bi(t,0);return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}bindL10n(t,e,r){t.$[e]=r(),this._boundBlocks.has(t)||this._boundBlocks.set(t,new Map),this._boundBlocks.get(t)?.get(e)?.();const i=this.onLocaleChange(()=>{t.$[e]=r()});this._boundBlocks.get(t)?.set(e,i)}destroyL10nBindings(t){const e=this._boundBlocks.get(t);if(e){for(const t of e.values())t();this._boundBlocks.delete(t)}}destroy(){this._callbacks.clear()}};function Fo(t,e){[...t.querySelectorAll("[l10n]")].forEach(t=>{const r=t.getAttribute("l10n");if(!r)return;const i=r.split(";");for(const r of i)r&&Vo(t,r,e)})}var Vo=(t,e,r)=>{let i="textContent",o=!1;if(e.includes(":")){const t=e.split(":");if(2!==t.length)return void console.warn(`l10n attribute value should be in format "property:key" or "key". Found: ${e}`);const r=t;i=r[0],e=r[1],i.startsWith("@")&&(i=i.slice(1),o=!0)}const n=e;r.has(n)&&r.sub(n,e=>{if(!e)return;r.l10nProcessorSubs.has(n)||r.l10nProcessorSubs.set(n,new Set);const o=r.l10nProcessorSubs.get(n);o?.forEach(t=>{t.remove(),o.delete(t),r.allSubs.delete(t)});const a=zo(e).replace("*","");r.nodeCtx.has(a)||r.nodeCtx.add(a,e);const s=r.nodeCtx.sub(a,()=>{t[i]=r.l10n(e)});o?.add(s),r.allSubs.add(s),t.removeAttribute("l10n")});const a=zo(e);r.has(a)||r.add(a,""),r.sub(a,()=>{o?t.setAttribute(i,r.l10n(e)):t[i]=r.l10n(e)}),t.removeAttribute("l10n")},Bo=class{_listeners=new Map;_scope=[];addEventListener(t,e){const r=t=>{const r=t.target;r instanceof Node&&this._scope.some(t=>t===r||t.contains(r))&&e(t)};this._listeners.set(e,r),window.addEventListener(t,r)}removeEventListener(t,e){const r=this._listeners.get(e);r&&window.removeEventListener(t,r),this._listeners.delete(e)}get CustomEvent(){return window.CustomEvent}get document(){return window.document}get navigator(){return window.navigator}registerScope(t){this._scope.push(t)}destroy(){this._scope=[];for(const t of this._listeners.values())window.removeEventListener("keydown",t),window.removeEventListener("keyup",t);this._listeners.clear()}},jo=class{_destroyKeyUX;_scopedWindow;constructor(){this._scopedWindow=new Bo,this._destroyKeyUX=function(t,e){let r=e.map(e=>e(t));return()=>{r.forEach(t=>t())}}(this._scopedWindow,[ti(),ei("is-pressed"),ri(),t=>{let e,r;function i(t){if("true"===t.target.getAttribute("aria-hidden")){e=t.target,e.setAttribute("aria-hidden","false"),r=e.hidden,r&&(e.hidden=!1);let i=t.target.querySelector('a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])');i&&(i.tabIndex=0)}}function o(t){!e||!e.contains(t.target)||t.relatedTarget&&e.contains(t.relatedTarget)||(t.target.tabIndex=-1,e.setAttribute("aria-hidden","true"),r&&(e.hidden=!0),e=null)}return t.addEventListener("keyuxJump",i),t.addEventListener("focusout",o),()=>{t.removeEventListener("keyuxJump",i),t.removeEventListener("focusout",o)}}])}registerBlock(t){this._scopedWindow.registerScope(t)}destroy(){this._destroyKeyUX?.(),this._scopedWindow.destroy()}},Ho=Object.freeze({ADD:"modal:add",DELETE:"modal:delete",OPEN:"modal:open",CLOSE:"modal:close",CLOSE_ALL:"modal:closeAll",DESTROY:"modal:destroy"}),qo=class{_modals=new Map;_activeModals=new Set;_subscribers=new Map;_block;constructor(t){this._block=t}_debugPrint(...t){this._block.debugPrint("[modal-manager]",...t)}registerModal(t,e){this._modals.set(t,e),this._notify(Ho.ADD,{id:t,modal:e})}deleteModal(t){if(!this._modals.has(t))return!1;const e=this._modals.get(t);return this._modals.delete(t),this._activeModals.delete(t),this._notify(Ho.DELETE,{id:t,modal:e}),!0}open(t){if(!this._modals.has(t))return this._debugPrint(`Modal with ID "${t}" not found`),!1;const e=this._modals.get(t);return this._activeModals.add(t),this._notify(Ho.OPEN,{modal:e,id:t}),!0}close(t){if(!this._modals.has(t)||!this._activeModals.has(t))return this._debugPrint(`Modal with ID "${t}" not found or not active`),!1;const e=this._modals.get(t);return this._activeModals.delete(t),this._notify(Ho.CLOSE,{id:t,modal:e}),!0}toggle(t){return this._modals.has(t)?this._activeModals.has(t)?this.close(t):this.open(t):(this._debugPrint(`Modal with ID "${t}" not found`),!1)}get hasActiveModals(){return this._activeModals.size>0}back(){if(0===this._activeModals.size)return this._debugPrint("No active modals to go back from"),!1;const t=Array.from(this._activeModals).pop();return!!t&&this.close(t)}closeAll(){const t=this._activeModals.size;return this._activeModals.clear(),this._notify(Ho.CLOSE_ALL,{}),t}subscribe(t,e){return this._subscribers.has(t)||this._subscribers.set(t,new Set),this._subscribers.get(t)?.add(e),()=>this.unsubscribe(t,e)}unsubscribe(t,e){this._subscribers.has(t)&&this._subscribers.get(t)?.delete(e)}_notify(t,e){if(this._subscribers.has(t))for(const r of this._subscribers.get(t)??new Set)try{r(e)}catch(t){this._block.telemetryManager.sendEventError(t,"modal subscriber"),this._debugPrint("Error in modal subscriber:",t)}}destroy(){this.closeAll(),this._modals.clear(),this._subscribers.clear(),this._notify(Ho.DESTROY,{})}},Ko="blocks",Go="1.24.5",Wo=class{_sessionId=crypto.randomUUID();_telemetryInstance;_block;_config=structuredClone(ko);_initialized=!1;_lastPayload=null;_queue;constructor(t){this._block=t,this._telemetryInstance=new ai,this._queue=new Xr(10);for(const t of Object.keys(this._config))this._block.subConfigValue(t,e=>{this._initialized&&this._config[t]!==e&&this.sendEvent({eventType:Di.CHANGE_CONFIG}),this._setConfig(t,e)})}_init(t){t!==Di.INIT_SOLUTION||this._initialized||(this._initialized=!0)}_setConfig(t,e){this._config[t]!==e&&(this._config[t]=e)}_formattingPayload(t){const e=t.payload?{...t.payload}:{};e.activity&&(e.activity=void 0);const r={...t};return t.eventType!==Di.INIT_SOLUTION&&t.eventType!==Di.CHANGE_CONFIG||(r.config=this._config),{...r,appVersion:Go,appName:Ko,sessionId:this._sessionId,component:this._solution,activity:this._activity,projectPubkey:this._config.pubkey,userAgent:navigator.userAgent,eventType:r.eventType??"",eventTimestamp:this._timestamp,payload:{location:this._location,...e}}}_excludedEvents(t){return!(!t||![Fi.CHANGE,Fi.COMMON_UPLOAD_PROGRESS,Fi.FILE_ADDED,Fi.FILE_REMOVED,Fi.FILE_UPLOAD_START,Fi.FILE_UPLOAD_PROGRESS,Fi.FILE_UPLOAD_SUCCESS,Fi.FILE_UPLOAD_FAILED].includes(t))}sendEvent(t){const e=this._formattingPayload({eventType:t.eventType,payload:t.payload,config:t.config});this._init(t.eventType);if(this._excludedEvents(t.eventType))return;this._lastPayload&&this._checkObj(this._lastPayload,e)||this._queue.add(async()=>{this._lastPayload=e,await this._telemetryInstance.sendEvent(e)})}sendEventError(t,e="unknown"){this.sendEvent({eventType:Di.ERROR_EVENT,payload:{metadata:{event:"error",text:`Error in ${e}`,error:t.message}}})}sendEventCloudImageEditor(t,e,r={}){this.sendEvent({eventType:Di.ACTION_EVENT,payload:{metadata:{tabId:e,node:t.currentTarget?.tagName,event:t.type,...r}}})}_checkObj(t,e){if(JSON.stringify(t)===JSON.stringify(e))return!0;if("object"!=typeof t||"object"!=typeof e||null==t||null==e)return!1;const r=Object.keys(t),i=Object.keys(e);if(r.length!==i.length)return!1;for(const i of r){if(!Object.hasOwn(e,i))return!1;if(!this._checkObj(t[i],e[i]))return!1}return!0}get _timestamp(){return Date.now()}get _solution(){if(!this._block.has("*solution"))return null;const t=this._block.$["*solution"];return t?t.toLowerCase():null}get _activity(){return this._block.has("*currentActivity")?this._block.$["*currentActivity"]??null:null}get _location(){return location.origin}},Xo=t=>`*cfg/${t}`;function Zo(t,e){const r=t.querySelectorAll("[data-testid]");if(0===r.length)return;const i=new WeakMap;for(const t of r){const e=t.getAttribute("data-testid");e&&i.set(t,e)}e.subConfigValue("testMode",t=>{if(!t){for(const t of r)t.removeAttribute("data-testid");return}const o=e.testId;for(const t of r){const e=i.get(t);e&&t.setAttribute("data-testid",`${o}--${e}`)}})}var Yo=class extends Ne{__cfgProxy;l10nProcessorSubs=new Map;static StateConsumerScope=null;static styleAttrs=[];requireCtxName=!1;activityType=null;init$={};l10n(t,e={}){if(!t)return"";const r=this.$[zo(t)]||t,i=function(t){const e=[];let r=t.indexOf(Eo);for(;-1!==r;){const i=t.indexOf(To,r);if(-1===i)break;const o=t.substring(r+2,i);if(o.startsWith(Ao)){const n=t.substring(r+2,i).replace(Ao,""),a=n.substring(0,n.indexOf("(")),s=n.substring(n.indexOf("(")+1,n.indexOf(")"));e.push({variable:o,pluralKey:a,countVariable:s})}r=t.indexOf(Eo,i)}return e}(r);for(const t of i)e[t.variable]=this.pluralize(t.pluralKey,Number(e[t.countVariable]));return Io(r,e)}pluralize(t,e){const r=this.l10n("locale-id")||"en",i=xo(r,e);return this.l10n(`${t}__${i}`)}bindL10n(t,e){this.localeManager?.bindL10n(this,t,e)}constructor(){super(),this.addTemplateProcessor(Fo),this.addTemplateProcessor(Zo)}emit(t,e,r){const i=this.has("*eventEmitter")?this.$["*eventEmitter"]:void 0;i&&(i.emit(t,e,r),this.telemetryManager.sendEvent({eventType:t,payload:"function"==typeof e?e():e}))}hasBlockInCtx(t){for(const e of this.blocksRegistry)if(t(e))return!0;return!1}setOrAddState(t,e){this.add$({[t]:e},!0)}connectedCallback(){this.constructor.styleAttrs.forEach(t=>{this.setAttribute(t,"")}),this.hasAttribute("retpl")&&(this.constructor.template=null,this.processInnerHtml=!0),this.requireCtxName?(({element:t,attribute:e,onSuccess:r,onTimeout:i,timeout:o=300})=>{const n=t.getAttribute(e);if(null!==n)return void r(n);const a=new MutationObserver(t=>{const e=t[t.length-1];e&&c(e)});a.observe(t,{attributes:!0,attributeFilter:[e]});const s=window.setTimeout(()=>{a.disconnect(),i()},o),c=i=>{const o=t.getAttribute(e);"attributes"===i.type&&i.attributeName===e&&null!==o&&(window.clearTimeout(s),a.disconnect(),r(o))}})({element:this,attribute:"ctx-name",onSuccess:()=>{super.connectedCallback()},onTimeout:()=>{console.error("Attribute `ctx-name` is required and it is not set.")}}):super.connectedCallback(),Mo.registerClient(this)}disconnectedCallback(){super.disconnectedCallback(),Mo.unregisterClient(this)}initCallback(){this.has("*blocksRegistry")||this.add("*blocksRegistry",new Set);this.$["*blocksRegistry"].add(this),this.has("*eventEmitter")||this.add("*eventEmitter",new Vi(this.debugPrint.bind(this))),this.has("*localeManager")||this.add("*localeManager",new Do(this)),this.cfg.qualityInsights&&!this.has("*telemetryManager")&&this.add("*telemetryManager",new Wo(this)),this.has("*a11y")||this.add("*a11y",new jo),this.has("*modalManager")||this.add("*modalManager",new qo(this)),this.sub(zo("locale-id"),t=>{const e=(t=>{const e=new Intl.Locale(t);let r="ltr";const i=e.getTextInfo?.().direction;return i?r=i:e.textInfo?.direction&&(r=e.textInfo.direction),r})(t);this.style.direction="ltr"===e?"":e}),this.subConfigValue("testMode",t=>{t&&this.testId?this.setAttribute("data-testid",this.testId):this.removeAttribute("data-testid")})}get testId(){return window.customElements.getName(this.constructor)}get modalManager(){return this.has("*modalManager")?this.$["*modalManager"]:void 0}get telemetryManager(){return this.cfg.qualityInsights?this.has("*telemetryManager")&&this.$["*telemetryManager"]:{sendEvent:()=>{},sendEventCloudImageEditor:()=>{},sendEventError:()=>{}}}get localeManager(){return this.has("*localeManager")?this.$["*localeManager"]:null}get a11y(){return this.has("*a11y")?this.$["*a11y"]:null}get blocksRegistry(){return this.$["*blocksRegistry"]}destroyCallback(){super.destroyCallback();const t=this.blocksRegistry;t?.delete(this),this.localeManager?.destroyL10nBindings(this),this.l10nProcessorSubs=new Map,we.deleteCtx(this),0===t?.size&&setTimeout(()=>{this.destroyCtxCallback()},0)}destroyCtxCallback(){we.deleteCtx(this.ctxName),this.localeManager?.destroy(),this.modalManager?.destroy()}async proxyUrl(t){if(this.cfg.secureDeliveryProxy&&this.cfg.secureDeliveryProxyUrlResolver&&console.warn("Both secureDeliveryProxy and secureDeliveryProxyUrlResolver are set. The secureDeliveryProxyUrlResolver will be used."),this.cfg.secureDeliveryProxyUrlResolver)try{return await this.cfg.secureDeliveryProxyUrlResolver(t,{uuid:Xi(t),cdnUrlModifiers:Zi(t),fileName:Wi(t)})}catch(e){return console.error("Failed to resolve secure delivery proxy URL. Falling back to the default URL.",e),this.telemetryManager.sendEventError(e,"secureDeliveryProxyUrlResolver. Failed to resolve secure delivery proxy URL. Falling back to the default URL."),t}return this.cfg.secureDeliveryProxy?Io(this.cfg.secureDeliveryProxy,{previewUrl:t},{transform:t=>window.encodeURIComponent(t)}):t}get cfg(){if(!this.__cfgProxy){const t=Object.create(null);this.__cfgProxy=new Proxy(t,{set:(t,e,r)=>{if("string"!=typeof e)return!1;const i=Xo(e);return this.has(i)||this.add(i,ko[e]),this.$[i]=r,!0},get:(t,e)=>{const r=Xo(e);return this.has(r)||this.add(r,ko[e]),this.$[Xo(e)]}})}return this.__cfgProxy}subConfigValue(t,e){const r=Xo(t);this.has(r)||this.add(r,ko[t]),this.sub(r,e)}debugPrint(...t){if(!this.cfg.debug)return;let e=t;if("function"==typeof t?.[0]){e=(0,t[0])()}console.log(`[${this.ctxName}]`,...e)}static reg(t){t?t.startsWith("uc-")&&super.reg(t):super.reg()}},Qo="active",Jo="___ACTIVITY_IS_ACTIVE___",tn=class t extends Yo{historyTracked=!1;[Jo];init$=$o(this);_debouncedHistoryFlush=Bi(this._historyFlush.bind(this),10);_deactivate(){const e=t._activityCallbacks.get(this);this[Jo]=!1,this.removeAttribute(Qo),e?.deactivateCallback?.()}_activate(){const e=t._activityCallbacks.get(this);this.$["*historyBack"]=this.historyBack.bind(this),this[Jo]=!0,this.setAttribute(Qo,""),e?.activateCallback?.(),this._debouncedHistoryFlush(),this.emit(Fi.ACTIVITY_CHANGE,{activity:this.activityType})}initCallback(){super.initCallback(),this.activityType&&(this.hasAttribute("activity")||this.setAttribute("activity",this.activityType),this.sub("*currentActivity",t=>{try{this.activityType!==t&&this[Jo]?this._deactivate():this.activityType!==t||this[Jo]||this._activate()}catch(t){this.telemetryManager.sendEventError(t,`activity "${this.activityType}"`),console.error(`Error in activity "${this.activityType}". `,t),this.$["*currentActivity"]=this.$["*history"][this.$["*history"].length-1]??null}t||(this.$["*history"]=[])}))}_historyFlush(){let t=this.$["*history"];t&&(t.length>10&&(t=t.slice(t.length-11,t.length-1)),this.historyTracked&&t[t.length-1]!==this.activityType&&t.push(this.activityType),this.$["*history"]=t)}_isActivityRegistered(){return!!this.activityType&&t._activityCallbacks.has(this)}static _activityCallbacks=new Map;static activities;get isActivityActive(){return!!this[Jo]}get couldOpenActivity(){return!0}registerActivity(e,r={}){const{onActivate:i,onDeactivate:o}=r;t._activityCallbacks.set(this,{activateCallback:i,deactivateCallback:o})}unregisterActivity(){this.isActivityActive&&this._deactivate(),t._activityCallbacks.delete(this)}destroyCallback(){super.destroyCallback(),this._isActivityRegistered()&&this.unregisterActivity();const e=this.$["*currentActivity"];!![...this.blocksRegistry].find(r=>r instanceof t&&r.activityType===e)||(this.$["*currentActivity"]=null,this.modalManager?.closeAll())}get activityKey(){return this.ctxName+this.activityType}get activityParams(){return this.$["*currentActivityParams"]}get initActivity(){return this.getCssData("--cfg-init-activity")}get doneActivity(){return this.getCssData("--cfg-done-activity")}historyBack(){const t=this.$["*history"];if(t){let e=t.pop();for(;e===this.activityType;)e=t.pop();let r=!!e;if(e){const t=[...this.blocksRegistry].find(t=>t.activityType===e);r=t?.couldOpenActivity??!1}e=r?e:void 0,e&&this.modalManager?.open(e),this.$["*currentActivity"]=e,this.$["*history"]=t,e||this.modalManager?.closeAll()}}};function en(t){for(const e in t){let r=[...e].reduce((t,e)=>(e.toUpperCase()===e&&(e=`-${e.toLowerCase()}`),t+=e),"");r.startsWith("-")&&(r=r.replace("-","")),r.startsWith("uc-")||(r=`uc-${r}`),t[e].reg&&t[e].reg(r)}}tn.activities=Object.freeze({START_FROM:"start-from",CAMERA:"camera",DRAW:"draw",UPLOAD_LIST:"upload-list",URL:"url",CLOUD_IMG_EDIT:"cloud-image-edit",EXTERNAL:"external"});var rn="UC";function on(t,e=!1){return new Promise((r,i)=>{if("object"!=typeof document)return void r(null);if("object"==typeof window&&window[rn])return void r(window[rn]);const o=document.createElement("script");o.async=!0,o.src=t,o.onerror=()=>{i()},o.onload=()=>{const t=window[rn];e&&en(t),r(t)},document.head.appendChild(o)})}var nn=class extends Yo{static styleAttrs=["uc-wgt-common"];requireCtxName=!0;init$=(t=>({...Lo(t),"*solution":null}))(this);static _template="";initCallback(){super.initCallback(),this.a11y?.registerBlock(this)}static set template(t){this._template="<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>"+t+"<slot></slot>"}static get template(){return this._template}},an=1.5,sn=100/3;function cn(t,e){for(const[r,i]of Object.entries(e))t.setAttributeNS(null,r,i.toString())}function ln(t,e={}){const r=document.createElementNS("http://www.w3.org/2000/svg",t);return cn(r,e),r}function un(t,e,r){const{x:i,y:o,width:n,height:a}=t,s=e.includes("w")?0:1,c=e.includes("n")?0:1,l=0===s?-1:1,u=0===c?-1:1,d=[i+s*n+an*l,o+c*a+an*u-24*r*u],h=[i+s*n+an*l,o+c*a+an*u],p=[i+s*n-24*r*l+an*l,o+c*a+an*u];return{d:`M ${d[0]} ${d[1]} L ${h[0]} ${h[1]} L ${p[0]} ${p[1]}`,center:[h[0],h[1]]}}function dn(t,e,r){const{x:i,y:o,width:n,height:a}=t,s="n"===e||"s"===e,c=s?.5:"w"===e?0:1,l="w"===e||"e"===e?.5:"n"===e?0:1,u="w"===e?-1:"e"===e?1:0,d="n"===e?-1:"s"===e?1:0;let h,p;s?(h=[i+c*n-34*r/2,o+l*a+an*d],p=[i+c*n+34*r/2,o+l*a+an*d]):(h=[i+c*n+an*u,o+l*a-34*r/2],p=[i+c*n+an*u,o+l*a+34*r/2]);return{d:`M ${h[0]} ${h[1]} L ${p[0]} ${p[1]}`,center:[(h[0]+p[0])/2,(h[1]+p[1])/2]}}function hn(t,e){let{x:r}=t,{y:i}=t;return t.x<e.x?r=e.x:t.x+t.width>e.x+e.width&&(r=e.x+e.width-t.width),t.y<e.y?i=e.y:t.y+t.height>e.y+e.height&&(i=e.y+e.height-t.height),{...t,x:r,y:i}}function pn({direction:t,...e}){switch(t){case"n":return function({rect:t,delta:e,aspectRatio:r,imageBox:i}){const[,o]=e;let{y:n,width:a,height:s}=t;n+=o,s-=o,r&&(a=s*r);let c=t.x+t.width/2-a/2;return n<=i.y&&(n=i.y,s=t.y+t.height-n,r&&(a=s*r,c=t.x+t.width/2-a/2)),c<=i.x&&(c=i.x,n=t.y+t.height-s),c+a>=i.x+i.width&&(c=Math.max(i.x,i.x+i.width-a),a=i.x+i.width-c,r&&(s=a/r),n=t.y+t.height-s),s<1&&(s=1,r&&(a=s*r,c=t.x+t.width/2-a/2),n=t.y+t.height-s),a<1&&(a=1,r&&(s=a/r,c=t.x+t.width/2-a/2),n=t.y+t.height-s),{x:c,y:n,width:a,height:s}}(e);case"w":return function({rect:t,delta:e,aspectRatio:r,imageBox:i}){const[o]=e;let{x:n,width:a,height:s}=t;n+=o,a-=o,r&&(s=a/r);let c=t.y+t.height/2-s/2;return n<=i.x&&(n=i.x,a=t.x+t.width-n,r&&(s=a/r,c=t.y+t.height/2-s/2)),c<=i.y&&(c=i.y,n=t.x+t.width-a),c+s>=i.y+i.height&&(c=Math.max(i.y,i.y+i.height-s),s=i.y+i.height-c,r&&(a=s*r),n=t.x+t.width-a),s<1&&(s=1,r&&(a=s*r),c=t.y+t.height/2-s/2,n=t.x+t.width-a),a<1&&(a=1,r&&(s=a/r),c=t.y+t.height/2-s/2,n=t.x+t.width-a),{x:n,y:c,width:a,height:s}}(e);case"s":return function({rect:t,delta:e,aspectRatio:r,imageBox:i}){const[,o]=e;let{y:n,width:a,height:s}=t;s+=o,r&&(a=s*r);let c=t.x+t.width/2-a/2;return n+s>=i.y+i.height&&(s=i.y+i.height-n,r&&(a=s*r),c=t.x+t.width/2-a/2),c<=i.x&&(c=i.x,n=t.y),c+a>=i.x+i.width&&(c=Math.max(i.x,i.x+i.width-a),a=i.x+i.width-c,r&&(s=a/r),n=t.y),s<1&&(s=1,r&&(a=s*r),c=t.x+t.width/2-a/2),a<1&&(a=1,r&&(s=a/r),c=t.x+t.width/2-a/2),{x:c,y:n,width:a,height:s}}(e);case"e":return function({rect:t,delta:e,aspectRatio:r,imageBox:i}){const[o]=e;let{x:n,width:a,height:s}=t;a+=o,r&&(s=a/r);let c=t.y+t.height/2-s/2;return n+a>=i.x+i.width&&(a=i.x+i.width-n,r&&(s=a/r),c=t.y+t.height/2-s/2),c<=i.y&&(c=i.y,n=t.x),c+s>=i.y+i.height&&(c=Math.max(i.y,i.y+i.height-s),s=i.y+i.height-c,r&&(a=s*r),n=t.x),s<1&&(s=1,r&&(a=s*r),c=t.y+t.height/2-s/2),a<1&&(a=1,r&&(s=a/r),c=t.y+t.height/2-s/2),{x:n,y:c,width:a,height:s}}(e);case"nw":return function({rect:t,delta:e,aspectRatio:r,imageBox:i}){let[o,n]=e,{x:a,y:s,width:c,height:l}=t;return a+o<i.x&&(o=i.x-a),s+n<i.y&&(n=i.y-s),a+=o,c-=o,s+=n,l-=n,r&&Math.abs(c/l)>r?(n=c/r-l,l+=n,s-=n,s<=i.y&&(l-=i.y-s,c=l*r,a=t.x+t.width-c,s=i.y)):r&&(o=l*r-c,c+=o,a-=o,a<=i.x&&(c-=i.x-a,l=c/r,a=i.x,s=t.y+t.height-l)),l<1&&(l=1,r&&(c=l*r),a=t.x+t.width-c,s=t.y+t.height-l),c<1&&(c=1,r&&(l=c/r),a=t.x+t.width-c,s=t.y+t.height-l),{x:a,y:s,width:c,height:l}}(e);case"ne":return function({rect:t,delta:e,aspectRatio:r,imageBox:i}){let[o,n]=e,{x:a,y:s,width:c,height:l}=t;return a+c+o>i.x+i.width&&(o=i.x+i.width-a-c),s+n<i.y&&(n=i.y-s),c+=o,s+=n,l-=n,r&&Math.abs(c/l)>r?(n=c/r-l,l+=n,s-=n,s<=i.y&&(l-=i.y-s,c=l*r,a=t.x,s=i.y)):r&&(o=l*r-c,c+=o,a+c>=i.x+i.width&&(c=i.x+i.width-a,l=c/r,a=i.x+i.width-c,s=t.y+t.height-l)),l<1&&(l=1,r&&(c=l*r),s=t.y+t.height-l),c<1&&(c=1,r&&(l=c/r),s=t.y+t.height-l),{x:a,y:s,width:c,height:l}}(e);case"sw":return function({rect:t,delta:e,aspectRatio:r,imageBox:i}){let[o,n]=e,{x:a,y:s,width:c,height:l}=t;return a+o<i.x&&(o=i.x-a),s+l+n>i.y+i.height&&(n=i.y+i.height-s-l),a+=o,c-=o,l+=n,r&&Math.abs(c/l)>r?(n=c/r-l,l+=n,s+l>=i.y+i.height&&(l=i.y+i.height-s,c=l*r,a=t.x+t.width-c,s=i.y+i.height-l)):r&&(o=l*r-c,c+=o,a-=o,a<=i.x&&(c-=i.x-a,l=c/r,a=i.x,s=t.y)),l<1&&(l=1,r&&(c=l*r),a=t.x+t.width-c),c<1&&(c=1,r&&(l=c/r),a=t.x+t.width-c),{x:a,y:s,width:c,height:l}}(e);case"se":return function({rect:t,delta:e,aspectRatio:r,imageBox:i}){let[o,n]=e,{x:a,y:s,width:c,height:l}=t;return a+c+o>i.x+i.width&&(o=i.x+i.width-a-c),s+l+n>i.y+i.height&&(n=i.y+i.height-s-l),c+=o,l+=n,r&&Math.abs(c/l)>r?(n=c/r-l,l+=n,s+l>=i.y+i.height&&(l=i.y+i.height-s,c=l*r,a=t.x,s=i.y+i.height-l)):r&&(o=l*r-c,c+=o,a+c>=i.x+i.width&&(c=i.x+i.width-a,l=c/r,a=i.x+i.width-c,s=t.y)),l<1&&(l=1,r&&(c=l*r)),c<1&&(c=1,r&&(l=c/r)),{x:a,y:s,width:c,height:l}}(e);default:return e.rect}}function gn({width:t,height:e},r){const i=r/90%2!=0;return{width:i?e:t,height:i?t:e}}function mn(t,e,r){let i,o;t/e>r?(i=Math.round(e*r),o=e):(i=t,o=Math.round(t/r));const n=Math.round((t-i)/2),a=Math.round((e-o)/2);return n+i>t&&(i=t-n),a+o>e&&(o=e-a),{x:n,y:a,width:i,height:o}}function bn(t){return{x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width),height:Math.round(t.height)}}function fn(t,e,r){return Math.min(Math.max(t,e),r)}var vn=["free"],yn=t=>{const e=io(t);if(!e||0===e.length)return[];const r=[];for(const t of e){const e=t.trim();if(!e)continue;const i=e.indexOf(":");if(-1===i&&!vn.includes(e)){console.warn(`Invalid crop preset: ${e}`);continue}const o=Number(e.slice(0,i)),n=Number(e.slice(i+1));!(!Number.isFinite(o)||!Number.isFinite(n)||o<=0||n<=0)||vn.includes(e)?r.push({id:xe.generate(),type:"aspect-ratio",width:vn.includes(e)?0:o,height:vn.includes(e)?0:n,hasFreeform:vn.includes(e)}):console.warn(`Invalid crop preset: ${e}`)}return r},wn=Object.freeze({FACEBOOK:"facebook",DROPBOX:"dropbox",GDRIVE:"gdrive",GPHOTOS:"gphotos",FLICKR:"flickr",VK:"vk",EVERNOTE:"evernote",BOX:"box",ONEDRIVE:"onedrive",HUDDLE:"huddle"}),_n=Object.freeze({MOBILE_VIDEO_CAMERA:"mobile-video-camera",MOBILE_PHOTO_CAMERA:"mobile-photo-camera"}),kn=Object.freeze({LOCAL:"local",DROP_AREA:"drop-area",CAMERA:"camera",EXTERNAL:"external",API:"js-api",URL:"url",DRAW:"draw",..._n,...wn});function xn(t){return Xe({...t,libraryName:Ko,libraryVersion:Go})}var Cn=t=>"number"!=typeof t?0:Math.floor(t/1e3),En=class{_block;_secureToken=null;constructor(t){this._block=t}_debugPrint(...t){this._block.debugPrint("[secure-uploads]",...t)}async getSecureToken(){const{secureSignature:t,secureExpire:e,secureUploadsSignatureResolver:r}=this._block.cfg;if((t||e)&&r&&console.warn("Both secureSignature/secureExpire and secureUploadsSignatureResolver are set. secureUploadsSignatureResolver will be used."),r){if(!this._secureToken||((t,{threshold:e})=>{const{secureExpire:r}=t,i=Cn(Date.now()),o=Number(r);return i+Cn(e)>=o})(this._secureToken,{threshold:this._block.cfg.secureUploadsExpireThreshold})){this._secureToken?this._debugPrint("Secure signature is expired. Resolving a new one..."):this._debugPrint("Secure signature is not set yet.");try{const t=await r();t?t.secureSignature&&t.secureExpire?(this._debugPrint("Secure signature resolved:",t),this._debugPrint("Secure signature will expire in",new Date(1e3*Number(t.secureExpire)).toISOString()),this._secureToken=t):console.error("Secure signature resolver returned an invalid result:",t):(this._debugPrint("Secure signature resolver returned nothing."),this._secureToken=null)}catch(t){console.error("Secure signature resolving failed. Falling back to the previous one.",t),this._block.telemetryManager.sendEventError(t,"secureUploadsSignatureResolver. Secure signature resolving failed. Falling back to the previous one.")}}return this._secureToken}return t&&e?(this._debugPrint("Secure signature and expire are set. Using them...",{secureSignature:t,secureExpire:e}),{secureSignature:t,secureExpire:e}):null}},Tn=(t,e)=>{if(t.failedCount>0)return{type:"SOME_FILES_HAS_ERRORS",message:e.l10n("some-files-were-not-uploaded")}},An=(t,e)=>{const r=t.totalCount,i=e.cfg.multiple?e.cfg.multipleMin:0,o=e.cfg.multiple?e.cfg.multipleMax:1;if(i&&r<i){return{type:"TOO_FEW_FILES",message:e.l10n("files-count-limit-error-too-few",{min:i,max:o,total:r}),payload:{total:r,min:i,max:o}}}if(o&&r>o){return{type:"TOO_MANY_FILES",message:e.l10n("files-count-limit-error-too-many",{min:i,max:o,total:r}),payload:{total:r,min:i,max:o}}}},In={safariDesktop:(()=>{const t=navigator.userAgent;return/Macintosh|Windows/.test(t)&&/Version\/[\d.]+.*Safari/.test(t)&&!/Chrome|Chromium|Edg|OPR/.test(t)})()},Sn={htmlMediaCapture:"capture"in document.createElement("input")},Mn="image/*",$n="video/*",Ln=In.safariDesktop?[Mn]:[Mn,...["image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/avif","image/avif-sequence",".heif",".heifs",".heic",".heics",".avif",".avifs"]],On=t=>t?t.filter(t=>"string"==typeof t).flatMap(t=>io(t)):[],Rn=(t,e)=>e.some(e=>{if(e.endsWith("*")){const r=e.replace("*","");return t.startsWith(r)}return t===e}),Un=t=>{const e=t?.type;return!!e&&Rn(e,Ln)},Pn=(t,e)=>{const r=e.cfg.imgOnly,i=e.cfg.accept,o=On([...r?Ln:[],i]);if(!o.length)return;const n=t.mimeType,a=t.name;if(!n||!a)return;const s=Rn(n,o),c=((t,e)=>e.some(e=>!!e.startsWith(".")&&t.toLowerCase().endsWith(e.toLowerCase())))(a,o);return s||c?void 0:{type:"FORBIDDEN_FILE_TYPE",message:e.l10n("file-type-not-allowed"),payload:{entry:t}}},Nn=(t,e)=>{const r=e.cfg.imgOnly,i=t.isImage;if(r&&!i&&(t.fileInfo||!t.externalUrl)&&(t.fileInfo||t.mimeType))return{type:"NOT_AN_IMAGE",message:e.l10n("images-only-accepted"),payload:{entry:t}}},zn=1e3,Dn=Object.freeze({AUTO:"auto",BYTE:"byte",KB:"kb",MB:"mb",GB:"gb",TB:"tb",PB:"pb"}),Fn=t=>Math.ceil(100*t)/100,Vn=(t,e=Dn.AUTO)=>{const r=e===Dn.AUTO;if(e===Dn.BYTE||r&&t<1e3){return`${t} ${"one"===xo("en-US",t)?"byte":"bytes"}`}return e===Dn.KB||r&&t<1e6?`${Fn(t/1e3)} KB`:e===Dn.MB||r&&t<zn**3?`${Fn(t/1e6)} MB`:e===Dn.GB||r&&t<zn**4?`${Fn(t/zn**3)} GB`:e===Dn.TB||r&&t<zn**5?`${Fn(t/zn**4)} TB`:`${Fn(t/zn**5)} PB`},Bn=(t,e)=>{const r=e.cfg.maxLocalFileSizeBytes,i=t.size;if(r&&i&&i>r)return{type:"FILE_SIZE_EXCEEDED",message:e.l10n("files-max-size-limit-error",{maxFileSize:Vn(r)}),payload:{entry:t}}},jn=(t,e)=>{const{internalId:r}=t,i=e._uploadCollection.read(r),o=i?.getValue("uploadError");if(!o)return;if(o instanceof gr)return{type:"UPLOAD_ERROR",message:o.message,payload:{entry:t,error:o}};if(o instanceof Je)return{type:"NETWORK_ERROR",message:o.message,payload:{entry:t,error:o}};const n=o instanceof Error?o:new Error("Unknown error",{cause:o});return{type:"UNKNOWN_ERROR",message:n.message,payload:{entry:t,error:n}}},Hn="File validator execution has failed",qn="File validator execution has timed out",Kn="Collection validator execution has failed",Gn="Missing message. We recommend adding message: value.",Wn=t=>"function"==typeof t?{runOn:"change",validator:t}:t,Xn=class{_blockInstance;_uploadCollection;_commonFileValidators=[Nn,Pn,Bn,jn];_commonCollectionValidators=[An,Tn];_queue=new Xr(20);_runQueueDebounced=Bi(()=>{this._queue.run()},500);_entryValidationState=new Map;constructor(t){this._blockInstance=t,this._uploadCollection=this._blockInstance.uploadCollection;const e=()=>{this.runFileValidators("change"),this.runCollectionValidators()};this._blockInstance.subConfigValue("maxLocalFileSizeBytes",e),this._blockInstance.subConfigValue("multipleMin",e),this._blockInstance.subConfigValue("multipleMax",e),this._blockInstance.subConfigValue("multiple",e),this._blockInstance.subConfigValue("imgOnly",e),this._blockInstance.subConfigValue("accept",e),this._blockInstance.subConfigValue("validationConcurrency",t=>{this._queue.concurrency=t})}runFileValidators(t,e){const r=e??this._uploadCollection.items();for(const e of r){const r=this._uploadCollection.read(e);r&&this._runFileValidatorsForEntry(r,t)}}runCollectionValidators(){const t=this._blockInstance.api.getOutputCollectionState(),e=[];for(const r of[...this._commonCollectionValidators,...this._blockInstance.cfg.collectionValidators])try{const i=r(t,this._blockInstance.api);if(!i)continue;i&&(e.push(this._addCustomTypeToValidationError(i)),i.message||console.warn(Gn))}catch(t){console.warn(Kn,t)}this._blockInstance.$["*collectionErrors"]=e,e.length>0&&this._blockInstance.emit(Fi.COMMON_UPLOAD_FAILED,()=>this._blockInstance.api.getOutputCollectionState(),{debounce:!0})}cleanupValidationForEntry(t){const e=this._entryValidationState.get(t.uid);e&&(e.abortController?.abort(),this._entryValidationState.delete(t.uid))}async _runFileValidatorsForEntry(t,e){const r=this._getValidatorDescriptorsForEntry(t,e);if(0===r.length)return;t.setMultipleValues({isQueuedForValidation:!0,isValidationPending:!0});const i=this._blockInstance.api.getOutputItem(t.uid),o=this._getEntryValidationState(t);o.promise&&await o.promise;const{promise:n,resolve:a}=(()=>{let t=()=>{},e=()=>{};return{promise:new Promise((r,i)=>{t=r,e=i}),resolve:t,reject:e}})();o.promise=n;const s=new AbortController;o.abortController=s;const c=this._blockInstance.cfg.validationTimeout,l=this._getValidatorDescriptors(),u=new Set(r.map(t=>t.validator)),d=[];for(const t of l)if(!u.has(t.validator)){const e=o.lastErrorThrownByValidator.get(t.validator);e&&d.push(e)}const h=r.map(t=>async()=>{if(!this._blockInstance.isConnected)return;const e=setTimeout(()=>{o.skippedValidators.add(t.validator),s.abort(),console.warn(qn)},c);try{const e=await t.validator(i,this._blockInstance.api,{signal:s.signal});if(!e||s.signal.aborted)return void o.lastErrorThrownByValidator.set(t.validator,void 0);const r=this._addCustomTypeToValidationError(e);o.lastErrorThrownByValidator.set(t.validator,r),d.push(r),e.message||console.warn(Gn)}catch(e){s.signal.aborted||(o.skippedValidators.add(t.validator),console.warn(Hn,e),this._blockInstance.telemetryManager.sendEventError(e,`file validator. ${Hn}`))}finally{clearTimeout(e),"change"!==t.runOn&&o.skippedValidators.add(t.validator)}});if(this._runQueueDebounced(),await this._queue.add(async()=>{t.setValue("isQueuedForValidation",!1),await Promise.all(h.map(t=>t())).catch(()=>{})},{autoRun:!1}),s.signal.aborted)return t.setMultipleValues({isQueuedForValidation:!1,isValidationPending:!1}),void a();t.setMultipleValues({isValidationPending:!1,isQueuedForValidation:!1,errors:d}),a()}_addCustomTypeToValidationError(t){return{...t,type:t.type??"CUSTOM_ERROR"}}_getEntryValidationState(t){const e=this._entryValidationState.get(t.uid);if(e)return e;const r={abortController:void 0,skippedValidators:new WeakSet,promise:void 0,lastErrorThrownByValidator:new WeakMap};return this._entryValidationState.set(t.uid,r),r}_getValidatorDescriptors(){return[...this._commonFileValidators,...this._blockInstance.cfg.fileValidators].map(Wn)}_getValidatorDescriptorsForEntry(t,e){const r=this._getEntryValidationState(t);return this._getValidatorDescriptors().filter(t=>!r.skippedValidators.has(t.validator)).filter(t=>t.runOn===e)}},Zn="[Typed State] Wrong property name: ",Yn=class{__typedSchema;__ctxId;__schema;__data;constructor(t,e){this.__typedSchema=t,this.__ctxId=e||xe.generate(),this.__schema=Object.keys(t).reduce((e,r)=>(t[r]&&(e[r]=t[r].value),e),{}),this.__data=we.registerCtx(this.__schema,this.__ctxId)}get uid(){return this.__ctxId}setValue(t,e){if(!Object.hasOwn(this.__typedSchema,t)||!this.__typedSchema[t])return void console.warn(Zn+t);const r=this.__typedSchema[t],i=e?.constructor===r.type,o=e instanceof r.type,n=r.nullable&&null===e;i||o||n?this.__data.pub(t,e):console.warn("[Typed State] Wrong property type: "+t)}setMultipleValues(t){for(const[e,r]of Object.entries(t))this.setValue(e,r)}getValue(t){return Object.hasOwn(this.__typedSchema,t)||console.warn(Zn+t),this.__data.read(t)}subscribe(t,e){return this.__data.sub(t,e)}remove(){we.deleteCtx(this.__ctxId)}},Qn=class{__typedSchema;__ctxId;__data;__watchList;__subsMap=Object.create(null);__propertyObservers=new Set;__collectionObservers=new Set;__items=new Set;__removed=new Set;__added=new Set;__observeTimeout;__notifyTimeout;__notifyObservers;constructor(t){this.__typedSchema=t.typedSchema,this.__ctxId=t.ctxName||xe.generate(),this.__data=we.registerCtx({},this.__ctxId),this.__watchList=t.watchList||[];let e=Object.create(null);this.__notifyObservers=(t,r)=>{this.__observeTimeout&&window.clearTimeout(this.__observeTimeout),e[t]||(e[t]=new Set),e[t].add(r),this.__observeTimeout=window.setTimeout(()=>{0!==Object.keys(e).length&&(this.__propertyObservers.forEach(t=>{t({...e})}),e=Object.create(null))})},t.handler&&this.observeCollection(t.handler)}notify(){this.__notifyTimeout&&window.clearTimeout(this.__notifyTimeout),this.__notifyTimeout=window.setTimeout(()=>{const t=new Set(this.__added),e=new Set(this.__removed);this.__added.clear(),this.__removed.clear();for(const r of this.__collectionObservers)r?.([...this.__items],t,e)})}observeCollection(t){return this.__collectionObservers.add(t),this.__items.size>0&&this.notify(),()=>{this.unobserveCollection(t)}}unobserveCollection(t){this.__collectionObservers.delete(t)}add(t){const e=new Yn(this.__typedSchema);for(const[r,i]of Object.entries(t))void 0!==i&&e.setValue(r,i);return this.__items.add(e.uid),this.notify(),this.__data.add(e.uid,e),this.__added.add(e),this.__watchList.forEach(t=>{this.__subsMap[e.uid]||(this.__subsMap[e.uid]=[]),this.__subsMap[e.uid]?.push(e.subscribe(t,()=>{this.__notifyObservers(t,e.uid)}))}),e.uid}read(t){return this.__data.read(t)}readProp(t,e){const r=this.read(t);return r?r.getValue(e):(console.warn(`Item with id ${t} not found`),null)}publishProp(t,e,r){const i=this.read(t);i?i.setValue(e,r):console.warn(`Item with id ${t} not found`)}remove(t){const e=this.read(t);e&&this.__removed.add(e),this.__items.delete(t),this.notify(),this.__data.pub(t,null),delete this.__subsMap[t]}clearAll(){this.__items.forEach(t=>{this.remove(t)})}observeProperties(t){return this.__propertyObservers.add(t),()=>{this.unobserveProperties(t)}}unobserveProperties(t){this.__propertyObservers.delete(t)}findItems(t){const e=[];return this.__items.forEach(r=>{const i=this.read(r);i&&t(i)&&e.push(r)}),e}items(){return[...this.__items]}get size(){return this.__items.size}destroy(){we.deleteCtx(this.__ctxId),this.__propertyObservers=new Set,this.__collectionObservers=new Set;for(const t in this.__subsMap)this.__subsMap[t]?.forEach(t=>{t.remove()}),delete this.__subsMap[t]}},Jn=Object.freeze({PHOTO:"photo",VIDEO:"video"}),ta=Object.freeze({IDLE:"idle",SHOT:"shot",PLAY:"play",PAUSE:"pause",RESUME:"resume",STOP:"stop",RETAKE:"retake",ACCEPT:"accept"}),ea=t=>({isVideoRecordingEnabled:ji(t.cameraModes).includes(Jn.VIDEO),isPhotoEnabled:ji(t.cameraModes).includes(Jn.PHOTO)}),ra=new RegExp(`^/?(${/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/i.source})(?:/(-/(?:[^/]+/)+)?([^/]*))?$`,"i");function ia(t){const e=new Map;return(...r)=>{const i=JSON.stringify(r);if(e.has(i))return e.get(i);const o=t(...r);return e.set(i,o),o}}var oa=new Set;function na(t){oa.has(t)||(oa.add(t),console.warn(t))}function aa(t){const e={},r={progress:()=>t.$["*commonProgress"],errors:()=>t.$["*collectionErrors"],group:()=>t.$["*groupInfo"],totalCount:()=>t.uploadCollection.size,failedCount:()=>e.failedEntries.length,successCount:()=>e.successEntries.length,uploadingCount:()=>e.uploadingEntries.length,status:()=>e.isFailed?"failed":e.isUploading?"uploading":e.isSuccess?"success":"idle",isSuccess:()=>e.allEntries.length>0&&0===e.errors.length&&e.successEntries.length===e.allEntries.length,isUploading:()=>e.allEntries.some(t=>"uploading"===t.status),isFailed:()=>e.errors.length>0||e.failedEntries.length>0,allEntries:()=>t.getOutputData(),successEntries:()=>e.allEntries.filter(t=>"success"===t.status),failedEntries:()=>e.allEntries.filter(t=>"failed"===t.status),uploadingEntries:()=>e.allEntries.filter(t=>"uploading"===t.status),idleEntries:()=>e.allEntries.filter(t=>"idle"===t.status)},i=function(t){let e=!1;return setTimeout(()=>{e=!0},0),r=>(...i)=>(e&&na(t),r(...i))}("You're trying to access the OutputCollectionState asynchronously. In this case, the data you retrieve will be newer than it was when the OutputCollectionState was created or when the event was dispatched. If you want to retain the state at a specific moment in time, you should use the spread operator like this: `{...outputCollectionState}` or `{...e.detail}`");for(const[t,o]of Object.entries(r)){const r=t,n=ia(i(o));Object.defineProperty(e,r,{get:n,enumerable:!0})}return e}var sa=class{_ctx;constructor(t){this._ctx=t}get _uploadCollection(){return this._ctx.uploadCollection}get cfg(){return this._ctx.cfg}get l10n(){return this._ctx.l10n.bind(this._ctx)}addFileFromUrl=(t,{silent:e,fileName:r,source:i}={})=>{const o=this._uploadCollection.add({externalUrl:t,fileName:r??null,silent:e??!1,source:i??kn.API});return this.getOutputItem(o)};addFileFromUuid=(t,{silent:e,fileName:r,source:i}={})=>{const o=this._uploadCollection.add({uuid:t,fileName:r??null,silent:e??!1,source:i??kn.API});return this.getOutputItem(o)};addFileFromCdnUrl=(t,{silent:e,fileName:r,source:i}={})=>{const o=(({url:t,cdnBase:e})=>{const r=new URL(e),i=new URL(wo),o=new URL(t);if(r.host!==o.host&&i.host!==o.host)return null;const n=ra.exec(o.pathname);if(!n)return null;const[,a,s,c]=n;return a?{uuid:a,cdnUrlModifiers:s||"",filename:c||null}:null})({url:t,cdnBase:this.cfg.cdnCname});if(!o)throw new Error("Invalid CDN URL");const n=this._uploadCollection.add({uuid:o.uuid,cdnUrl:t,cdnUrlModifiers:o.cdnUrlModifiers,fileName:r??o.filename??null,silent:e??!1,source:i??kn.API});return this.getOutputItem(n)};addFileFromObject=(t,{silent:e,fileName:r,source:i,fullPath:o}={})=>{const n=this._uploadCollection.add({file:t,isImage:Un(t),mimeType:t.type,fileName:r??t.name,fileSize:t.size,silent:e??!1,source:i??kn.API,fullPath:o??null});return this.getOutputItem(n)};removeFileByInternalId=t=>{if(!this._uploadCollection.read(t))throw new Error(`File with internalId ${t} not found`);this._uploadCollection.remove(t)};removeAllFiles(){this._uploadCollection.clearAll()}uploadAll=()=>{const t=this._uploadCollection.items().filter(t=>{const e=this._uploadCollection.read(t);return!!e&&!(e.getValue("isRemoved")||e.getValue("isUploading")||e.getValue("fileInfo")||0!==e.getValue("errors").length||e.getValue("isValidationPending")||e.getValue("isQueuedForValidation"))});0!==t.length&&(this._ctx.$["*uploadTrigger"]=new Set(t),this._ctx.emit(Fi.COMMON_UPLOAD_START,this.getOutputCollectionState()))};openSystemDialog=(t={})=>{const e=Hi(On([this.cfg.accept??"",...this.cfg.imgOnly?Ln:[]])),r="uploadcare-file-input",i=document.createElement("input");if(i.setAttribute(r,""),De(i,{opacity:0,height:0,width:0,visibility:"hidden",position:"absolute",top:0,left:0}),i.type="file",i.multiple=this.cfg.multiple,t.captureCamera){i.capture=this.cfg.cameraCapture;const{isPhotoEnabled:e,isVideoRecordingEnabled:r}=ea(this.cfg);t.modeCamera===Jn.PHOTO&&e?i.accept=Mn:t.modeCamera===Jn.VIDEO&&r?i.accept=$n:i.accept=[Mn,r&&$n].filter(Boolean).join(",")}else i.accept=e;i.addEventListener("change",()=>{i.files&&([...i.files].forEach(e=>{this.addFileFromObject(e,{source:t.captureCamera?kn.CAMERA:kn.LOCAL})}),this._ctx.modalManager?.open(tn.activities.UPLOAD_LIST),this._ctx.$["*currentActivity"]=tn.activities.UPLOAD_LIST,i.remove())},{once:!0}),document.querySelectorAll(`[${r}]`).forEach(t=>{t.remove()}),document.body.appendChild(i),i.dispatchEvent(new MouseEvent("click"))};getOutputItem(t){const e=we.getCtx(t).store,r=e.fileInfo,i=e.isRemoved?"removed":e.errors.length>0?"failed":e.fileInfo?"success":e.isUploading?"uploading":"idle";return{uuid:r?.uuid??e.uuid??null,internalId:t,name:r?.originalFilename??e.fileName,size:r?.size??e.fileSize,isImage:r?.isImage??e.isImage,mimeType:r?.mimeType??e.mimeType,file:e.file,externalUrl:e.externalUrl,cdnUrlModifiers:e.cdnUrlModifiers,cdnUrl:e.cdnUrl??r?.cdnUrl??null,fullPath:e.fullPath,uploadProgress:e.uploadProgress,fileInfo:r??null,metadata:e.metadata??r?.metadata??null,isSuccess:"success"===i,isUploading:"uploading"===i,isFailed:"failed"===i,isRemoved:"removed"===i,isValidationPending:e.isValidationPending,errors:e.errors,status:i,source:e?.source}}getOutputCollectionState(){return aa(this._ctx)}initFlow=(t=!1)=>{if(this._uploadCollection.size>0&&!t)this._ctx.modalManager?.open(tn.activities.UPLOAD_LIST),this._ctx.set$({"*currentActivity":tn.activities.UPLOAD_LIST});else if(1===this._sourceList?.length){const t=this._sourceList[0];if("local"===t)return this._ctx.$["*currentActivity"]=tn.activities.UPLOAD_LIST,void this.openSystemDialog();if("camera"===t&&Sn.htmlMediaCapture){const{isPhotoEnabled:t,isVideoRecordingEnabled:e}=ea(this.cfg);if(t&&e)return void this._ctx.set$({"*currentActivity":tn.activities.START_FROM});if(t||e)return void this.openSystemDialog({captureCamera:!0,modeCamera:t?Jn.PHOTO:Jn.VIDEO});this.openSystemDialog({captureCamera:!0,modeCamera:Jn.PHOTO})}const e=[...this._ctx.$["*blocksRegistry"]].find(e=>"type"in e&&e.type===t);e?.activate(),this._ctx.$["*currentActivity"]&&this._ctx.modalManager?.open(this._ctx.$["*currentActivity"])}else this._ctx.modalManager?.open(tn.activities.START_FROM),this._ctx.set$({"*currentActivity":tn.activities.START_FROM})};doneFlow=()=>{this._ctx.set$({"*currentActivity":this._ctx.doneActivity,"*history":this._ctx.doneActivity?[this._ctx.doneActivity]:[]}),this._ctx.$["*currentActivity"]||this._ctx.modalManager?.closeAll()};setCurrentActivity=(t,...e)=>{this._ctx.hasBlockInCtx(e=>e.activityType===t)?this._ctx.set$({"*currentActivityParams":e??{},"*currentActivity":t}):console.warn(`Activity type "${t}" not found in the context`)};getCurrentActivity=()=>this._ctx.$["*currentActivity"];setModalState=t=>{!t||this._ctx.$["*currentActivity"]?t?this._ctx.modalManager?.open(this._ctx.$["*currentActivity"]):(this._ctx.modalManager?.close(this._ctx.$["*currentActivity"]),this._ctx.$["*currentActivity"]=null):console.warn('Can\'t open modal without current activity. Please use "setCurrentActivity" method first.')};get _sourceList(){let t=[];return this.cfg.sourceList&&(t=io(this.cfg.sourceList)),t}},ca=Object.freeze({file:Object.freeze({type:File,value:null,nullable:!0}),externalUrl:Object.freeze({type:String,value:null,nullable:!0}),fileName:Object.freeze({type:String,value:null,nullable:!0}),fileSize:Object.freeze({type:Number,value:null,nullable:!0}),lastModified:Object.freeze({type:Number,value:Date.now()}),uploadProgress:Object.freeze({type:Number,value:0}),uuid:Object.freeze({type:String,value:null,nullable:!0}),isImage:Object.freeze({type:Boolean,value:!1}),mimeType:Object.freeze({type:String,value:null,nullable:!0}),ctxName:Object.freeze({type:String,value:null,nullable:!0}),cdnUrl:Object.freeze({type:String,value:null,nullable:!0}),cdnUrlModifiers:Object.freeze({type:String,value:null,nullable:!0}),fileInfo:Object.freeze({type:Lr,value:null,nullable:!0}),isUploading:Object.freeze({type:Boolean,value:!1}),abortController:Object.freeze({type:AbortController,value:null,nullable:!0}),thumbUrl:Object.freeze({type:String,value:null,nullable:!0}),silent:Object.freeze({type:Boolean,value:!1}),source:Object.freeze({type:String,value:null,nullable:!0}),fullPath:Object.freeze({type:String,value:null,nullable:!0}),metadata:Object.freeze({type:Object,value:null,nullable:!0}),errors:Object.freeze({type:Array,value:[]}),uploadError:Object.freeze({type:Error,value:null,nullable:!0}),isRemoved:Object.freeze({type:Boolean,value:!1}),isQueuedForUploading:Object.freeze({type:Boolean,value:!1}),isValidationPending:Object.freeze({type:Boolean,value:!1}),isQueuedForValidation:Object.freeze({type:Boolean,value:!1})}),la=class t extends tn{static extSrcList;static sourceTypes;couldBeCtxOwner=!1;isCtxOwner=!1;_unobserveCollection;_unobserveCollectionProperties;init$=Lo(this);get hasCtxOwner(){return this.hasBlockInCtx(e=>e instanceof t&&(e.isCtxOwner&&e.isConnected&&e!==this))}initCallback(){if(super.initCallback(),!this.has("*uploadCollection")){const t=new Qn({typedSchema:ca,watchList:["uploadProgress","uploadError","fileInfo","errors","cdnUrl","isUploading","isValidationPending"]});this.add("*uploadCollection",t)}this.has("*publicApi")||this.add("*publicApi",new sa(this)),this.has("*validationManager")||this.add("*validationManager",new Xn(this)),!this.hasCtxOwner&&this.couldBeCtxOwner&&this._initCtxOwner()}get validationManager(){if(!this.has("*validationManager"))throw new Error("Unexpected error: ValidationManager is not initialized");return this.$["*validationManager"]}get api(){if(!this.has("*publicApi"))throw new Error("Unexpected error: UploaderPublicApi is not initialized");return this.$["*publicApi"]}getAPI(){return this.api}get uploadCollection(){if(!this.has("*uploadCollection"))throw new Error("Unexpected error: TypedCollection is not initialized");return this.$["*uploadCollection"]}destroyCtxCallback(){this.uploadCollection.destroy(),this.$["*uploadCollection"]=null,super.destroyCtxCallback()}disconnectedCallback(){super.disconnectedCallback(),this.isCtxOwner&&this._unobserveUploadCollection()}connectedCallback(){super.connectedCallback(),this.isCtxOwner&&this._observeUploadCollection()}destroyCallback(){super.destroyCallback(),this._flushOutputItems.cancel()}_initCtxOwner(){this.isCtxOwner=!0,this._observeUploadCollection(),this.subConfigValue("maxConcurrentRequests",t=>{this.$["*uploadQueue"].concurrency=Number(t)||1}),this.$["*secureUploadsManager"]||(this.$["*secureUploadsManager"]=new En(this))}_observeUploadCollection(){this._unobserveUploadCollection(),this._unobserveCollection=this.uploadCollection.observeCollection(this._handleCollectionUpdate),this._unobserveCollectionProperties=this.uploadCollection.observeProperties(this._handleCollectionPropertiesUpdate)}_unobserveUploadCollection(){this._unobserveCollectionProperties?.(),this._unobserveCollection?.(),this._unobserveCollectionProperties=void 0,this._unobserveCollection=void 0}async _createGroup(t){const e=await this.getUploadClientOptions(),r=t.allEntries.map(t=>t.uuid+(t.cdnUrlModifiers?`/${t.cdnUrlModifiers}`:"")),i=new AbortController,o=await Wr(r,{...e,signal:i.signal});if(this.$["*collectionState"]!==t)return void i.abort();this.$["*groupInfo"]=o;const n=this.api.getOutputCollectionState();this.emit(Fi.GROUP_CREATED,n),this.emit(Fi.CHANGE,()=>this.api.getOutputCollectionState(),{debounce:!0}),this.$["*collectionState"]=n}_flushOutputItems=Bi(async()=>{if(this.getOutputData().length!==this.uploadCollection.size)return;const t=this.api.getOutputCollectionState();this.$["*collectionState"]=t,this.emit(Fi.CHANGE,()=>this.api.getOutputCollectionState(),{debounce:!0}),this.cfg.groupOutput&&t.totalCount>0&&"success"===t.status&&this._createGroup(t)},300);_handleCollectionUpdate=(t,e,r)=>{(e.size||r.size)&&(this.$["*groupInfo"]=null),this.validationManager.runFileValidators("add",[...e].map(t=>t.uid));for(const t of e)t.getValue("silent")||this.emit(Fi.FILE_ADDED,this.api.getOutputItem(t.uid));this.validationManager.runCollectionValidators();for(const t of r){this.$["*uploadTrigger"].delete(t.uid),this.validationManager.cleanupValidationForEntry(t),t.getValue("abortController")?.abort(),t.setMultipleValues({isRemoved:!0,abortController:null,isUploading:!1,uploadProgress:0});const e=t?.getValue("thumbUrl");e&&URL.revokeObjectURL(e),this.emit(Fi.FILE_REMOVED,this.api.getOutputItem(t.uid))}this.$["*uploadList"]=t.map(t=>({uid:t})),this._flushCommonUploadProgress(),this._flushOutputItems()};_handleCollectionPropertiesUpdate=t=>{this._flushOutputItems();const e=this.uploadCollection,r=[...new Set(Object.entries(t).filter(([t])=>["uploadError","fileInfo","cdnUrl","cdnUrlModifiers"].includes(t)).flatMap(([,t])=>[...t]))];if(r.length>0&&setTimeout(()=>{const e=r.filter(e=>t.fileInfo?.has(e)&&!!we.getCtx(e).store.fileInfo);e.length>0&&this.validationManager.runFileValidators("upload",e),this.validationManager.runFileValidators("change",r)}),t.uploadProgress){for(const e of t.uploadProgress){const{isUploading:t,silent:r}=we.getCtx(e).store;t&&!r&&this.emit(Fi.FILE_UPLOAD_PROGRESS,this.api.getOutputItem(e))}this._flushCommonUploadProgress()}if(t.isUploading)for(const e of t.isUploading){const{isUploading:t,silent:r}=we.getCtx(e).store;t&&!r&&this.emit(Fi.FILE_UPLOAD_START,this.api.getOutputItem(e))}if(t.fileInfo){for(const e of t.fileInfo){const{fileInfo:t,silent:r}=we.getCtx(e).store;t&&!r&&this.emit(Fi.FILE_UPLOAD_SUCCESS,this.api.getOutputItem(e))}this.cfg.cropPreset&&this.setInitialCrop(),this.cfg.cloudImageEditorAutoOpen&&this.openCloudImageEditor()}if(t.errors){this.validationManager.runCollectionValidators();for(const e of t.errors){const{errors:t}=we.getCtx(e).store;t.length>0&&(this.emit(Fi.FILE_UPLOAD_FAILED,this.api.getOutputItem(e)),this.emit(Fi.COMMON_UPLOAD_FAILED,()=>this.api.getOutputCollectionState(),{debounce:!0}))}const r=e.findItems(t=>!!t.getValue("fileInfo")),i=e.findItems(t=>t.getValue("errors").length>0);e.size>0&&0===i.length&&e.size===r.length&&0===this.$["*collectionErrors"].length&&this.emit(Fi.COMMON_UPLOAD_SUCCESS,this.api.getOutputCollectionState())}if(t.cdnUrl){[...t.cdnUrl].filter(t=>!!this.uploadCollection.read(t)?.getValue("cdnUrl")).forEach(t=>{this.emit(Fi.FILE_URL_CHANGED,this.api.getOutputItem(t))}),this.$["*groupInfo"]=null}};_flushCommonUploadProgress=()=>{let t=0;const e=[...this.$["*uploadTrigger"]].filter(t=>!!this.uploadCollection.read(t));e.forEach(e=>{const r=this.uploadCollection.readProp(e,"uploadProgress");"number"==typeof r&&(t+=r)});const r=e.length?Math.round(t/e.length):0;this.$["*commonProgress"]!==r&&(this.$["*commonProgress"]=r,this.emit(Fi.COMMON_UPLOAD_PROGRESS,this.api.getOutputCollectionState()))};openCloudImageEditor(){const[t]=this.uploadCollection.findItems(t=>!!t.getValue("fileInfo")&&t.getValue("isImage")).map(t=>this.uploadCollection.read(t));t&&1===this.uploadCollection.size&&this.cfg.useCloudImageEditor&&this.hasBlockInCtx(t=>t.activityType===tn.activities.CLOUD_IMG_EDIT)&&(this.$["*currentActivityParams"]={internalId:t.uid},this.$["*currentActivity"]=tn.activities.CLOUD_IMG_EDIT,this.modalManager?.open(tn.activities.CLOUD_IMG_EDIT))}setInitialCrop(){const t=yn(this.cfg.cropPreset);if(t){const[e]=t,r=this.uploadCollection.findItems(t=>!!t.getValue("fileInfo")&&t.getValue("isImage")&&!t.getValue("cdnUrlModifiers")?.includes("/crop/")).map(t=>this.uploadCollection.read(t)).filter(Boolean);for(const t of r){const r=t.getValue("fileInfo");if(!r||!r.imageInfo){console.warn("Failed to get image info for entry",t.uid);continue}const{width:i,height:o}=r.imageInfo,n=mn(i,o,"number"==typeof e?.width&&"number"==typeof e?.height&&e.width>0&&e.height>0?e.width/e.height:1),a=Gi(`crop/${n.width}x${n.height}/${n.x},${n.y}`,"preview"),s=t.getValue("cdnUrl");s?(t.setMultipleValues({cdnUrlModifiers:a,cdnUrl:eo(s,a)}),1===this.uploadCollection.size&&this.cfg.useCloudImageEditor&&this.hasBlockInCtx(t=>t.activityType===tn.activities.CLOUD_IMG_EDIT)&&(this.$["*currentActivityParams"]={internalId:t.uid},this.$["*currentActivity"]=tn.activities.CLOUD_IMG_EDIT,this.modalManager?.open(tn.activities.CLOUD_IMG_EDIT))):console.warn("Failed to get cdnUrl for entry",t.uid)}}}async getMetadataFor(t){const e=this.cfg.metadata||void 0;if("function"==typeof e){const r=this.api.getOutputItem(t);return await e(r)}return e}async getUploadClientOptions(){const t=this.$["*secureUploadsManager"],e=await t.getSecureToken().catch(()=>null);return{store:this.cfg.store,publicKey:this.cfg.pubkey,baseCDN:this.cfg.cdnCname,baseURL:this.cfg.baseUrl,userAgent:xn,integration:this.cfg.userAgentIntegration,secureSignature:e?.secureSignature,secureExpire:e?.secureExpire,retryThrottledRequestMaxTimes:this.cfg.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:this.cfg.retryNetworkErrorMaxTimes,multipartMinFileSize:this.cfg.multipartMinFileSize,multipartChunkSize:this.cfg.multipartChunkSize,maxConcurrentRequests:this.cfg.multipartMaxConcurrentRequests,multipartMaxAttempts:this.cfg.multipartMaxAttempts,checkForUrlDuplicates:!!this.cfg.checkForUrlDuplicates,saveUrlForRecurrentUploads:!!this.cfg.saveUrlForRecurrentUploads}}getOutputData(){return this.uploadCollection.items().map(t=>this.api.getOutputItem(t))}};la.extSrcList=Object.freeze({...wn}),la.sourceTypes=Object.freeze({...kn});var ua=class extends tn{},da={width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}},ha=["camera","microphone"];function pa(t){return`${Math.floor(t/60).toString().padStart(2,"0")}:${Math.floor(t%60).toString().padStart(2,"0")}`}var ga="image/jpeg",ma="video/webm",ba=class extends la{couldBeCtxOwner=!0;activityType=tn.activities.CAMERA;_unsubPermissions=null;_capturing=!1;_chunks=[];_mediaRecorder=null;_stream=null;_selectedAudioId=null;_selectedCameraId=null;_activeTab=null;_options={};_canvas=null;_ctx=null;_cameraDevices=[];_audioDevices=[];_permissionResponses={};constructor(){super(),this.init$={...this.init$,video:null,videoTransformCss:null,videoHidden:!0,messageHidden:!0,requestBtnHidden:void 0!==navigator.permissions,cameraSelectOptions:null,cameraSelectHidden:!0,l10nMessage:"",switcher:null,panels:null,timer:null,timerHidden:!0,cameraHidden:!0,cameraActionsHidden:!0,audioSelectOptions:null,audioSelectHidden:!0,audioSelectDisabled:!0,audioToggleMicrophoneHidden:!0,tabCameraHidden:!0,tabVideoHidden:!0,currentIcon:"camera-full",currentTimelineIcon:"play",toggleMicrophoneIcon:"microphone",_startTime:0,_elapsedTime:0,_animationFrameId:null,mutableClassButton:"uc-shot-btn uc-camera-action",onCameraSelectChange:t=>{const e=t.target;e&&(this._selectedCameraId=e.value,this._capture())},onAudioSelectChange:t=>{const e=t.target;e&&(this._selectedAudioId=e.value,this._capture())},onCancel:()=>{this.historyBack()},onShot:()=>{this.telemetryManager.sendEvent({eventType:Di.ACTION_EVENT,payload:{metadata:{event:"shot-camera",node:this.tagName,tabId:this._activeTab}}}),this._shot()},onRequestPermissions:()=>this._capture(),onStartCamera:()=>{this.telemetryManager.sendEvent({eventType:Di.ACTION_EVENT,payload:{metadata:{event:"start-camera",node:this.tagName,tabId:this._activeTab}}}),this._chooseActionWithCamera()},onStartRecording:()=>this._startRecording(),onStopRecording:()=>this._stopRecording(),onToggleRecording:()=>this._toggleRecording(),onToggleAudio:()=>this._toggleEnableAudio(),onRetake:()=>{this.telemetryManager.sendEvent({eventType:Di.ACTION_EVENT,payload:{metadata:{event:"retake-camera",node:this.tagName,tabId:this._activeTab}}}),this._retake()},onAccept:()=>{this.telemetryManager.sendEvent({eventType:Di.ACTION_EVENT,payload:{metadata:{event:"accept-camera",node:this.tagName,tabId:this._activeTab}}}),this._accept()},onClickTab:t=>{const e=t.currentTarget,r=e?.getAttribute("data-id");r&&this._handleActiveTab(r)}}}_chooseActionWithCamera=()=>{if(this._activeTab===Jn.PHOTO&&this._shot(),this._activeTab===Jn.VIDEO){if("recording"===this._mediaRecorder?.state)return void this._stopRecording();this._startRecording()}};_updateTimer=()=>{const t=Math.floor((performance.now()-this.$._startTime+this.$._elapsedTime)/1e3);if("number"==typeof this.cfg.maxVideoRecordingDuration&&this.cfg.maxVideoRecordingDuration>0){const e=this.cfg.maxVideoRecordingDuration-t;if(e<=0){const t=this.ref.timer;return t&&(t.textContent=pa(e)),void this._stopRecording()}const r=this.ref.timer;r&&(r.textContent=pa(e))}else{const e=this.ref.timer;e&&(e.textContent=pa(t))}this._animationFrameId=requestAnimationFrame(this._updateTimer)};_startTimer=()=>{this.$._startTime=performance.now(),this.$._elapsedTime=0,this._updateTimer()};_stopTimer=()=>{this._animationFrameId&&cancelAnimationFrame(this._animationFrameId)};_startTimeline=()=>{const t=this.ref.video;if(!t)return;const e=t.currentTime,r=t.duration||1,i=this.ref.line;i&&(i.style.transform=`scaleX(${e/r})`);const o=this.ref.timer;o&&(o.textContent=pa(e)),this._animationFrameId=requestAnimationFrame(this._startTimeline)};_stopTimeline=()=>{this._animationFrameId&&cancelAnimationFrame(this._animationFrameId)};_animationFrameId=null;_startRecording=()=>{try{this._chunks=[],this._options={...this.cfg.mediaRecorderOptions};const{mimeType:t}=this.cfg.mediaRecorderOptions||{};t&&MediaRecorder.isTypeSupported(t)?this._options.mimeType=t:MediaRecorder.isTypeSupported(ma)?this._options.mimeType=ma: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(ta.PLAY))}catch(t){console.error("Failed to start recording",t),this.telemetryManager.sendEventError(t,"camera recording. Failed to start recording")}};_stopRecording=()=>{this._mediaRecorder?.addEventListener("stop",()=>{this._previewVideo(),this._stopTimer(),this._setCameraState(ta.STOP)}),this._mediaRecorder?.stop(),this.classList.remove("uc-recording"),this.telemetryManager.sendEvent({eventType:Di.ACTION_EVENT,payload:{metadata:{event:"stop-camera",node:this.tagName,tabId:this._activeTab}}})};_toggleRecording=()=>{"recording"!==this._mediaRecorder?.state&&(!this.ref.video.paused&&!this.ref.video.ended&&this.ref.video.readyState>2?this.ref.video.pause():this.ref.video.paused&&this.ref.video.play())};_toggleEnableAudio=()=>{this._stream?.getAudioTracks().forEach(t=>{t.enabled=!t.enabled,this.$.toggleMicrophoneIcon=t.enabled?"microphone":"microphone-mute",this.$.audioSelectDisabled=!t.enabled})};_previewVideo=()=>{try{const t=new Blob(this._chunks,{type:this._mediaRecorder?.mimeType}),e=URL.createObjectURL(t),r=this.ref.video;if(!r)return;r.muted=!1,r.volume=1,this.$.video=null,r.src=e,r.addEventListener("play",()=>{this._startTimeline(),this.set$({currentTimelineIcon:"pause"})}),r.addEventListener("pause",()=>{this.set$({currentTimelineIcon:"play"}),this._stopTimeline()})}catch(t){console.error("Failed to preview video",t),this.telemetryManager.sendEventError(t,"camera previewing. Failed to preview video")}};_retake=()=>{if(this._setCameraState(ta.RETAKE),this._activeTab===Jn.VIDEO){this.$.video=this._stream;const t=this.ref.video;t&&(t.muted=!0)}this.ref.video?.play?.()};_accept=()=>{if(this._setCameraState(ta.ACCEPT),this._activeTab===Jn.PHOTO)return void this._canvas?.toBlob(t=>{if(!t)return;const e=this._createFile("camera","jpeg",ga,t);this._toSend(e)},ga);const t=new Blob(this._chunks,{type:this._mediaRecorder?.mimeType}),e=this._guessExtensionByMime(this._mediaRecorder?.mimeType),r=this._createFile("video",e,`video/${e}`,t);this._toSend(r),this._chunks=[]};_handlePhoto=t=>{t===ta.SHOT&&this.set$({tabVideoHidden:!0,cameraHidden:!0,tabCameraHidden:!0,cameraActionsHidden:!1,cameraSelectHidden:!0}),t!==ta.RETAKE&&t!==ta.ACCEPT||this.set$({tabVideoHidden:!this._cameraModes.includes(Jn.VIDEO),tabCameraHidden:!this._cameraModes.includes(Jn.PHOTO),cameraHidden:!1,cameraActionsHidden:!0,cameraSelectHidden:this._cameraDevices.length<=1})};_handleVideo=t=>{t===ta.PLAY&&this.set$({timerHidden:!1,tabCameraHidden:!0,cameraSelectHidden:!0,audioSelectHidden:!0,currentTimelineIcon:"pause",currentIcon:"square",mutableClassButton:"uc-shot-btn uc-camera-action uc-stop-record"}),t===ta.STOP&&this.set$({timerHidden:!1,cameraHidden:!0,audioToggleMicrophoneHidden:!0,cameraActionsHidden:!1}),t!==ta.RETAKE&&t!==ta.ACCEPT||this.set$({timerHidden:!0,tabVideoHidden:!this._cameraModes.includes(Jn.VIDEO),tabCameraHidden:!this._cameraModes.includes(Jn.PHOTO),cameraHidden:!1,cameraActionsHidden:!0,audioToggleMicrophoneHidden:!this.cfg.enableAudioRecording,currentIcon:"video-camera-full",mutableClassButton:"uc-shot-btn uc-camera-action",audioSelectHidden:!this.cfg.enableAudioRecording||this._audioDevices.length<=1,cameraSelectHidden:this._cameraDevices.length<=1})};_setCameraState=t=>{this._activeTab!==Jn.PHOTO||"shot"!==t&&"retake"!==t&&"accept"!==t||this._handlePhoto(t),this._activeTab!==Jn.VIDEO||"play"!==t&&"stop"!==t&&"retake"!==t&&"accept"!==t&&"pause"!==t&&"resume"!==t||this._handleVideo(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");this._canvas.height=this.ref.video.videoHeight,this._canvas.width=this.ref.video.videoWidth,this.cfg.cameraMirror&&(this._ctx.translate(this._canvas.width,0),this._ctx.scale(-1,1)),this._ctx.drawImage(this.ref.video,0,0),this.ref.video.pause()}_handleActiveTab=t=>{const e=this.ref.switcher;e?.querySelectorAll("button").forEach(e=>{e.classList.toggle("uc-active",e.getAttribute("data-id")===t)}),t===Jn.PHOTO&&this.set$({currentIcon:"camera-full",audioSelectHidden:!0,audioToggleMicrophoneHidden:!0}),t===Jn.VIDEO&&this.set$({currentTimelineIcon:"play",currentIcon:"video-camera-full",audioSelectHidden:!this.cfg.enableAudioRecording||this._audioDevices.length<=1,audioToggleMicrophoneHidden:!this.cfg.enableAudioRecording}),this.telemetryManager.sendEvent({eventType:Di.ACTION_EVENT,payload:{metadata:{event:"camera-tab-switch",node:this.tagName,tabId:t}}}),this._activeTab=t};_createFile=(t,e,r,i)=>{const o=Date.now();return new File([i],`${t}-${o}.${e}`,{lastModified:o,type:r})};_guessExtensionByMime(t){const e={mp4:"mp4",ogg:"ogg",webm:"webm",quicktime:"mov","x-matroska":"mkv"};if(""===t)return"webm";if(t){const r=t.split("/");if("video"===r?.[0]){const t=r.slice(1).join("/"),i=t?.split(";")[0];if(i&&e[i])return e[i]}}return"avi"}_toSend=t=>{this.api.addFileFromObject(t,{source:kn.CAMERA}),this.set$({"*currentActivity":tn.activities.UPLOAD_LIST}),this.modalManager?.open(tn.activities.UPLOAD_LIST)};get _cameraModes(){return io(this.cfg.cameraModes).filter(t=>t===Jn.PHOTO||t===Jn.VIDEO)}_setPermissionsState=Bi(t=>{this.classList.toggle("uc-initialized","granted"===t);const e=this._activeTab===Jn.VIDEO&&this.cfg.enableAudioRecording,r=this._activeTab===Jn.PHOTO?"camera-full":"video-camera-full";"granted"===t?this.set$({videoHidden:!1,cameraHidden:!1,tabCameraHidden:!this._cameraModes.includes(Jn.PHOTO),tabVideoHidden:!this._cameraModes.includes(Jn.VIDEO),messageHidden:!0,timerHidden:!0,currentIcon:r,audioToggleMicrophoneHidden:!e,audioSelectHidden:!e}):"prompt"===t?(this.$.l10nMessage="camera-permissions-prompt",this.set$({videoHidden:!0,cameraHidden:!0,tabCameraHidden:!0,messageHidden:!1}),this._stopCapture()):(this.$.l10nMessage="camera-permissions-denied",this.set$({videoHidden:!0,messageHidden:!1,tabCameraHidden:!this._cameraModes.includes(Jn.PHOTO),tabVideoHidden:!this._cameraModes.includes(Jn.VIDEO),cameraActionsHidden:!0,mutableClassButton:"uc-shot-btn uc-camera-action"}),this._stopCapture())},300);_makeStreamInactive=()=>{if(!this._stream)return!1;const t=this._stream?.getAudioTracks(),e=this._stream?.getVideoTracks();return t.forEach(t=>{t.stop()}),e.forEach(t=>{t.stop()}),!0};_stopCapture=()=>{if(this._capturing){this.ref.video.volume=0;const t=this.$.video?.getTracks?.();t?.[0]?.stop(),this.$.video=null,this._makeStreamInactive(),this._stopTimer(),this._capturing=!1}};_capture=async()=>{const t={video:{...da},audio:!!this.cfg.enableAudioRecording&&{}};this._selectedCameraId&&(t.video={deviceId:{exact:this._selectedCameraId}}),this._selectedAudioId&&this.cfg.enableAudioRecording&&(t.audio={deviceId:{exact:this._selectedAudioId}}),this.ref.video&&(this.ref.video.volume=0);try{this._setPermissionsState("prompt"),this._stream=await navigator.mediaDevices.getUserMedia(t),this._stream.addEventListener("inactive",()=>{this._setPermissionsState("denied")}),this.$.video=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")}};_handlePermissionsChange=()=>{this._capture()};_permissionAccess=async()=>{try{for(const t of ha){const e=await navigator.permissions.query({name:t});this._permissionResponses[t]=e,e.addEventListener("change",this._handlePermissionsChange)}}catch(t){console.log("Failed to use permissions API. Fallback to manual request mode.",t),this.telemetryManager.sendEventError(t,"camera permissions. Failed to use permissions API"),this._capture()}};_getPermission=()=>{};_requestDeviceAccess=async()=>{try{await navigator.mediaDevices.getUserMedia({video:!0,audio:this.cfg.enableAudioRecording}),await this._getDevices(),navigator.mediaDevices.addEventListener("devicechange",this._getDevices)}catch(t){this.telemetryManager.sendEventError(t,"camera devices. Failed to get user media"),console.log("Failed to get user media",t)}};_getDevices=async()=>{try{const t=await navigator.mediaDevices.enumerateDevices();this._cameraDevices=t.filter(t=>"videoinput"===t.kind).map((t,e)=>({text:t.label.trim()||`${this.l10n("caption-camera")} ${e+1}`,value:t.deviceId})),this._audioDevices=this.cfg.enableAudioRecording?t.filter(t=>"audioinput"===t.kind).map(t=>({text:t.label.trim(),value:t.deviceId})):[],this._cameraDevices.length>1&&this.set$({cameraSelectOptions:this._cameraDevices,cameraSelectHidden:!1}),this._selectedCameraId=this._cameraDevices[0]?.value??null,this._audioDevices.length>1&&this.set$({audioSelectOptions:this._audioDevices,audioSelectHidden:!1}),this._selectedAudioId=this._audioDevices[0]?.value??null}catch(t){this.telemetryManager.sendEventError(t,"camera devices. Failed to get devices"),console.log("Failed to get devices",t)}};_onActivate=async()=>{await this._permissionAccess(),await this._requestDeviceAccess(),await this._capture(),this._handleCameraModes(this._cameraModes)};_onDeactivate=async()=>{this._unsubPermissions&&this._unsubPermissions();Boolean(window.chrome)||this._setPermissionsState("denied"),this._stopCapture()};_handleCameraModes=t=>{this.$.tabVideoHidden=!t.includes(Jn.VIDEO),this.$.tabCameraHidden=!t.includes(Jn.PHOTO);const e=t[0];!e||this._activeTab&&t.includes(this._activeTab)||this._handleActiveTab(e)};initCallback(){super.initCallback(),this.registerActivity(this.activityType,{onActivate:this._onActivate,onDeactivate:this._onDeactivate}),this.subConfigValue("cameraMirror",t=>{this.$.videoTransformCss=t?"scaleX(-1)":null}),this.subConfigValue("enableAudioRecording",t=>{this.$.audioToggleMicrophoneHidden=!t,this.$.audioSelectDisabled=!t}),this.subConfigValue("cameraModes",t=>{if(!this.isActivityActive)return;const e=ji(t);this._handleCameraModes(e.filter(t=>t===Jn.PHOTO||t===Jn.VIDEO))})}_destroy(){for(const t of ha)this._permissionResponses[t]?.removeEventListener("change",this._handlePermissionsChange);navigator.mediaDevices?.removeEventListener("devicechange",this._getDevices)}async destroyCallback(){super.destroyCallback(),this._destroy()}};ba.template='\n <uc-activity-header>\n <button\n type="button"\n class="uc-mini-btn"\n set="onclick: *historyBack"\n l10n="@title:back"\n >\n <uc-icon name="back"></uc-icon>\n </button>\n <div set="@hidden: !cameraSelectHidden">\n <uc-icon name="camera"></uc-icon>\n <span l10n="caption-camera"></span>\n </div>\n <uc-select\n class="uc-camera-select"\n set="$.options: cameraSelectOptions; @hidden: cameraSelectHidden; onchange: onCameraSelectChange"\n >\n </uc-select>\n <button\n type="button"\n class="uc-mini-btn uc-close-btn"\n set="onclick: *closeModal"\n l10n="@title:a11y-activity-header-button-close;@aria-label:a11y-activity-header-button-close"\n >\n <uc-icon name="close"></uc-icon>\n </button>\n </uc-activity-header>\n <div class="uc-content">\n <video\n muted\n autoplay\n playsinline\n set="srcObject: video; style.transform: videoTransformCss; @hidden: videoHidden"\n ref="video"\n ></video>\n <div class="uc-message-box" set="@hidden: messageHidden">\n <span l10n="l10nMessage"></span>\n <button\n type="button"\n set="onclick: onRequestPermissions; @hidden: requestBtnHidden"\n l10n="camera-permissions-request"\n ></button>\n </div>\n </div>\n\n <div class="uc-controls">\n <div ref="switcher" class="uc-switcher" set="@hidden:!timerHidden">\n <button\n data-id="photo"\n type="button"\n class="uc-switch uc-mini-btn"\n set="onclick: onClickTab; @hidden: tabCameraHidden"\n >\n <uc-icon name="camera"></uc-icon>\n </button>\n <button\n data-id="video"\n type="button"\n class="uc-switch uc-mini-btn"\n set="onclick: onClickTab; @hidden: tabVideoHidden"\n >\n <uc-icon name="video-camera"></uc-icon>\n </button>\n </div>\n\n <button\n class="uc-secondary-btn uc-recording-timer"\n set="@hidden:timerHidden; onclick: onToggleRecording"\n >\n <uc-icon set="@name: currentTimelineIcon"></uc-icon>\n <span ref="timer"> 00:00 </span>\n <span ref="line" class="uc-line"></span>\n </button>\n\n <div\n class="uc-camera-actions uc-camera-action"\n set="@hidden: cameraActionsHidden"\n >\n <button type="button" class="uc-secondary-btn" set="onclick: onRetake">\n Retake\n </button>\n <button\n type="button"\n class="uc-primary-btn"\n set="onclick: onAccept"\n data-testid="accept"\n >\n Accept\n </button>\n </div>\n\n <button\n type="button"\n class="uc-shot-btn uc-camera-action"\n data-testid="shot"\n set="onclick: onStartCamera; @class: mutableClassButton; @hidden: cameraHidden;"\n >\n <uc-icon set="@name: currentIcon"></uc-icon>\n </button>\n\n <div class="uc-select">\n <button\n class="uc-mini-btn uc-btn-microphone"\n set="onclick: onToggleAudio; @hidden: audioToggleMicrophoneHidden;"\n >\n <uc-icon set="@name:toggleMicrophoneIcon"></uc-icon>\n </button>\n\n <uc-select\n class="uc-audio-select"\n set="$.options: audioSelectOptions; onchange: onAudioSelectChange; @hidden: audioSelectHidden; @disabled: audioSelectDisabled"\n >\n </uc-select>\n </div>\n </div>\n';var fa="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";function va(...t){return t.reduce((t,e)=>{if("string"==typeof e)return t[e]=!0,t;for(const r of Object.keys(e))t[r]=e[r];return t},{})}function ya(...t){const e=va(...t);return Object.keys(e).reduce((t,r)=>(e[r]&&t.push(r),t),[]).join(" ")}var wa=t=>go.includes(t);var _a=`\n <svg width='0' height='0' style='position:absolute'><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'/><symbol viewBox='0 0 20 20' id='uc-icon-brightness' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M15 10a5 5 0 0 1-5 5m5-5a5 5 0 0 0-5-5m5 5h-5m0 5a5 5 0 0 1 0-10m0 10V5m0 15v-3M2.93 2.929 5.05 5.05M0 10h3m-.07 7.071 2.12-2.121M10 0v3m7.07 14.071-2.12-2.121M20 10h-3m.07-7.071L14.95 5.05m-.626 2.45H10m4.324 5H10'/></symbol><symbol fill='currentColor' viewBox='0 0 20 20' id='uc-icon-closeMax' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='M8.232 10 3.585 5.353l1.768-1.768L10 8.232l4.648-4.647 1.767 1.768L11.768 10l4.647 4.648-1.767 1.767L10 11.768l-4.647 4.647-1.768-1.767L8.232 10Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-contrast' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M2 10a8 8 0 1 0 16 0 8 8 0 1 0-16 0m8-8v16m8-8h-8m7.598 2.5H10m6.24 2.5H10m7.6-7.5H10M16.242 5H10'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-crop' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M20 14H7.005C6.45 14 6 13.55 6 12.995V0M0 6h13.067c.515 0 .933.418.933.933V20M14.5.4 13 2l1.5 1.6M13 2h2a3 3 0 0 1 3 3v2M5.5 19.6 7 18l-1.5-1.6M7 18H5a3 3 0 0 1-3-3v-2'/></symbol><symbol fill='currentColor' viewBox='0 0 20 20' id='uc-icon-done' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='m18.057 6.333-9.365 9.125a1.25 1.25 0 0 1-1.768-.023L1.92 10.296l1.791-1.744 4.132 4.243 8.47-8.253 1.744 1.79Z' clip-rule='evenodd'/></symbol><symbol fill='currentColor' viewBox='0 0 25 24' id='uc-icon-edit-file' xmlns='http://www.w3.org/2000/svg'><path 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 20 20' id='uc-icon-enhance' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M19 13h-2m0 0a4 4 0 0 1-4-4m4 4a4 4 0 0 0-4 4m0-8V7m0 2a4 4 0 0 1-4 4m-2 0h2m0 0a4 4 0 0 1 4 4m0 0v2M8 8.5H6.5m0 0a2 2 0 0 1-2-2m2 2a2 2 0 0 0-2 2m0-4V5m0 1.5a2 2 0 0 1-2 2M1 8.5h1.5m0 0a2 2 0 0 1 2 2m0 0V12M12 3h-1m0 0a1 1 0 0 1-1-1m1 1a1 1 0 0 0-1 1m0-2V1m0 1a1 1 0 0 1-1 1M8 3h1m0 0a1 1 0 0 1 1 1m0 0v1'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-exposure' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M10 20v-3M2.93 2.929 5.05 5.05M0 10h3m-.07 7.071 2.12-2.121M10 0v3m7.07 14.071-2.12-2.121M20 10h-3m.07-7.071L14.95 5.05M5 10a5 5 0 1 0 10 0 5 5 0 1 0-10 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-filters' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M4.5 6.5a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0m-3.5 6a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0m7 0a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-flip' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M19.6 5 18 3.5 16.4 5m3.2 10L18 16.5 16.4 15M18 3.523v12.954M3.3 8.5h10.654c.301 0 .415-.395.159-.554L3.459 1.286A.3.3 0 0 0 3 1.542V8.2a.3.3 0 0 0 .3.3zm0 3h10.654c.301 0 .415.395.159.554l-10.654 6.66A.3.3 0 0 1 3 18.458v-6.66a.3.3 0 0 1 .3-.3z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-gamma' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M17 3C9 6 2.5 11.5 2.5 17.5m0 0h1m-1 0v-1m14 1h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3-14v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-mirror' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M5 .4 3.5 2 5 3.6M15 .4 16.5 2 15 3.6M3.52 2h12.957M8.5 16.7V6.046c0-.301-.394-.415-.554-.159L1.287 16.541a.3.3 0 0 0 .255.459H8.2a.3.3 0 0 0 .3-.3zm3 0V6.046c0-.301.395-.415.555-.159l6.659 10.654a.3.3 0 0 1-.255.459H11.8a.3.3 0 0 1-.3-.3z'/></symbol><symbol viewBox='0 0 40 40' id='uc-icon-original' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.5' d='M0 40 40 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-rotate' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M13.5.4 12 2l1.5 1.6M12.023 2H14.4A3.6 3.6 0 0 1 18 5.6V8M4 17h9a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-sad' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M2 17c4.418-4 11.582-4 16 0M16.5 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-11 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-saturation' xmlns='http://www.w3.org/2000/svg'><defs><linearGradient id='ruc-icon-id__a' x1='10.001' y1='1' x2='10.001' y2='19' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient></defs><circle cx='10.001' cy='10' r='9' transform='rotate(90 10 10)' fill='url(#ruc-icon-id__a)'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-slider' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M0 10h11m0 0a2 2 0 1 0 4 0m-4 0a2 2 0 1 1 4 0m0 0h5'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-tuning' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M8 10h11M1 10h4M1 4.5h11m3 0h4m-18 11h11m3 0h4m-7-11a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0M5 10a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0m7 5.5a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-vibrance' xmlns='http://www.w3.org/2000/svg'><path d='M2.125 5.64A8.96 8.96 0 0 0 1.001 10a8.96 8.96 0 0 0 1.124 4.36V5.64z' fill='url(#uuc-icon-id__a)'/><path d='M2.875 15.499V4.502a9.053 9.053 0 0 1 1.75-1.72v14.437a9.05 9.05 0 0 1-1.75-1.72z' fill='url(#uuc-icon-id__b)'/><path d='M5.375 17.722c.548.33 1.134.601 1.75.809V1.469a8.956 8.956 0 0 0-1.75.81v15.443z' fill='url(#uuc-icon-id__c)'/><path d='M7.875 1.253v17.495c.564.136 1.15.22 1.75.244V1.008a9 9 0 0 0-1.75.245z' fill='url(#uuc-icon-id__d)'/><path d='M10.375 1.008v17.984a9 9 0 0 0 1.75-.244V1.252a9 9 0 0 0-1.75-.244z' fill='url(#uuc-icon-id__e)'/><path d='M12.875 1.469V18.53a8.957 8.957 0 0 0 1.75-.808V2.277a8.957 8.957 0 0 0-1.75-.808z' fill='url(#uuc-icon-id__f)'/><path d='M15.375 2.78v14.44a9.053 9.053 0 0 0 1.75-1.72v-11a9.054 9.054 0 0 0-1.75-1.72z' fill='url(#uuc-icon-id__g)'/><path d='M17.875 5.638v8.724A8.959 8.959 0 0 0 19.001 10a8.96 8.96 0 0 0-1.126-4.362z' fill='url(#uuc-icon-id__h)'/><defs><linearGradient id='uuc-icon-id__a' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='uuc-icon-id__b' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='uuc-icon-id__c' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='uuc-icon-id__d' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='uuc-icon-id__e' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='uuc-icon-id__f' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='uuc-icon-id__g' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='uuc-icon-id__h' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient></defs></symbol><symbol viewBox='0 0 20 20' id='uc-icon-warmth' xmlns='http://www.w3.org/2000/svg'><path d='m7.5 13.05.429.42.171-.175v-.244h-.6zm5 0h-.6v.245l.172.175.428-.42zM8.1 3.5c0-1.05.85-1.9 1.9-1.9V.4a3.1 3.1 0 0 0-3.1 3.1h1.2zm0 9.55V3.5H6.9v9.55h1.2zm-1 2.45c0-.79.315-1.506.829-2.03l-.858-.84A4.088 4.088 0 0 0 5.9 15.5h1.2zm2.9 2.9a2.9 2.9 0 0 1-2.9-2.9H5.9a4.1 4.1 0 0 0 4.1 4.1v-1.2zm2.9-2.9a2.9 2.9 0 0 1-2.9 2.9v1.2a4.1 4.1 0 0 0 4.1-4.1h-1.2zm-.829-2.03c.514.524.829 1.24.829 2.03h1.2c0-1.117-.447-2.13-1.171-2.87l-.858.84zM11.9 3.5v9.55h1.2V3.5h-1.2zM10 1.6c1.05 0 1.9.85 1.9 1.9h1.2A3.1 3.1 0 0 0 10 .4v1.2z' fill='currentColor'/><path d='M10 14V8' stroke='currentColor' stroke-width='1.2' stroke-linecap='round'/><path d='M14 3h3m-3 3h3m-3 3h3m-8 6.5a1 1 0 1 0 2 0 1 1 0 1 0-2 0' stroke='currentColor' stroke-width='1.2'/></symbol></svg>\n <div class="uc-wrapper uc-wrapper_desktop">\n <uc-presence-toggle class="uc-network_problems_splash" set="visible: presence.networkProblems;">\n <div class="uc-network_problems_content">\n <div class="uc-network_problems_icon">\n <uc-icon name="sad"></uc-icon>\n </div>\n <div class="uc-network_problems_text">Network error</div>\n </div>\n <div class="uc-network_problems_footer">\n <uc-btn-ui theme="primary" text="Retry" set="onclick: *on.retryNetwork"></uc-btn-ui>\n </div>\n </uc-presence-toggle>\n <div class="uc-viewport">\n <div class="uc-file_type_outer">\n <div class="uc-file_type">{{fileType}}</div>\n </div>\n <div class="uc-image_container" ref="img-container-el">\n <img src="${fa}" class="uc-image uc-image_visible_from_editor" ref="img-el" />\n <uc-editor-image-cropper ref="cropper-el"></uc-editor-image-cropper>\n <uc-editor-image-fader ref="fader-el"></uc-editor-image-fader>\n </div>\n <div class="uc-info_pan">{{msg}}</div>\n </div>\n <div class="uc-toolbar">\n <uc-line-loader-ui set="active: showLoader"></uc-line-loader-ui>\n <div class="uc-toolbar_content uc-toolbar_content__editor">\n <uc-editor-toolbar></uc-editor-toolbar>\n </div>\n </div>\n </div>\n`,ka=class extends Yo{ctxOwner=!0;static styleAttrs=["uc-cloud-image-editor"];_debouncedShowLoader=Bi(this._showLoader.bind(this),300);constructor(){var t;super(),this.init$={...this.init$,...(t=this,{"*originalUrl":null,"*faderEl":null,"*cropperEl":null,"*imgEl":null,"*imgContainerEl":null,"*networkProblems":!1,"*imageSize":null,"*editorTransformations":{},"*cropPresetList":[],"*currentAspectRatio":null,"*tabList":go,"*tabId":po.CROP,entry:null,extension:null,editorMode:!1,modalCaption:"",isImage:!1,msg:"",src:fa,fileType:"",showLoader:!1,uuid:null,cdnUrl:null,cropPreset:"",tabs:Hi([...go]),"presence.networkProblems":!1,"presence.modalCaption":!0,"presence.editorToolbar":!1,"presence.viewerToolbar":!0,"*on.retryNetwork":()=>{const e=t.querySelectorAll("img");for(const t of e){const e=t.src;t.src=fa,t.src=e}t.$["*networkProblems"]=!1},"*on.apply":e=>{if(!e)return;const r=t.$["*originalUrl"],i=Gi(ao(e),"preview"),o={originalUrl:r,cdnUrlModifiers:i,cdnUrl:eo(r,i),transformations:e};t.dispatchEvent(new CustomEvent("apply",{detail:o,bubbles:!0,composed:!0})),t.remove()},"*on.cancel":()=>{t.remove(),t.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))}})}}_showLoader(t){this.$.showLoader=t}_waitForSize(){return new Promise((t,e)=>{const r=window.setTimeout(()=>{e(new Error("[cloud-image-editor] timeout waiting for non-zero container size"))},3e3),i=new ResizeObserver(e=>{const[o]=e;o&&o.contentRect.width>0&&o.contentRect.height>0&&(window.clearTimeout(r),i.disconnect(),window.setTimeout(()=>t(),0))});i.observe(this)})}initCallback(){super.initCallback(),this.$["*faderEl"]=this.ref["fader-el"],this.$["*cropperEl"]=this.ref["cropper-el"],this.$["*imgContainerEl"]=this.ref["img-container-el"],this.initEditor()}async updateImage(){if(this.isConnected){if(await this._waitForSize(),this.$.cdnUrl){const t=this.$.cdnUrl,e=Xi(t),r=ro(t,e);if(r===this.$["*originalUrl"])return;this.$["*originalUrl"]=r;const i=ho(Yi(t));this.$["*editorTransformations"]=i}else{if(!this.$.uuid)throw new Error("No UUID nor CDN URL provided");{const t=ro(this.cfg.cdnCname,this.$.uuid);if(t===this.$["*originalUrl"])return;this.$["*originalUrl"]=t,this.$["*editorTransformations"]={}}}this.$["*tabId"]===po.CROP?this.$["*cropperEl"]?.deactivate({reset:!0}):this.$["*faderEl"]?.deactivate();try{const t=this.$["*originalUrl"],e=await this.proxyUrl(eo(t,Gi("json"))),r=await fetch(e).then(t=>t.json()),{width:i,height:o}=r;this.$["*imageSize"]={width:i,height:o},this.$["*tabId"]===po.CROP?this.$["*cropperEl"]?.activate(this.$["*imageSize"]):this.$["*faderEl"]?.activate({url:t})}catch(t){t&&(this.telemetryManager.sendEventError(t,"cloud editor image. Failed to load image info"),console.error("Failed to load image info",t))}}}async initEditor(){try{await this._waitForSize()}catch(t){return void(this.isConnected&&console.error(t.message))}this.ref["img-el"].addEventListener("load",()=>{this._debouncedShowLoader(!1),this.$.src!==fa&&(this.$["*networkProblems"]=!1)}),this.ref["img-el"].addEventListener("error",()=>{this._debouncedShowLoader(!1),this.$["*networkProblems"]=!0}),this.sub("src",t=>{const e=this.ref["img-el"];e.src!==t&&(e.src=t||fa)}),this.sub("tabs",t=>{this.$["*tabList"]=(t=>{if(!t)return go;const e=ji(t).filter(wa);return 0===e.length?go:e})(t)}),this.sub("*tabId",t=>{this.ref["img-el"].className=ya("uc-image",{"uc-image_hidden_to_cropper":t===po.CROP,"uc-image_hidden_effects":t!==po.CROP})}),this.classList.add("uc-editor_ON"),this.sub("*networkProblems",t=>{this.$["presence.networkProblems"]=t,this.$["presence.modalCaption"]=!t}),this.sub("*editorTransformations",t=>{if(0===Object.keys(t).length)return;const e=this.$["*originalUrl"],r=Gi(ao(t),"preview"),i={originalUrl:e,cdnUrlModifiers:r,cdnUrl:eo(e,r),transformations:t};this.dispatchEvent(new CustomEvent("change",{detail:i,bubbles:!0,composed:!0}))},!1),this.sub("uuid",t=>t&&this.updateImage()),this.sub("cdnUrl",t=>t&&this.updateImage()),this.sub("cropPreset",t=>{const e=yn(t);let r=null;if(this.$.cdnUrl){const t=ho(Yi(this.$.cdnUrl));if(Array.isArray(t?.crop?.dimensions)){const[i,o]=t.crop.dimensions;r=((t,e,r,i=.1)=>{const o=t/e;let n=null,a=1/0;for(const t of r){const[e,r]=[t.width,t.height],i=e/r,s=Math.abs(o-i);s<a&&(a=s,n=t)}if(n){const[t,e]=[n.width,n.height],r=t/e;if(Math.abs(o-r)/r>i)return null}return n})(i,o,e,.1)}}this.$["*cropPresetList"]=e,this.$["*currentAspectRatio"]=r??e?.[0]??null})}};ka.template=_a,ka.bindAttributes({uuid:"uuid","cdn-url":"cdnUrl","crop-preset":"cropPreset",tabs:"tabs"});var xa=class extends Yo{_handlePointerUp;_handlePointerMove;_handleSvgPointerMove;_backdropMaskId=`backdrop-mask-${xe.generate()}`;_backdropMask;_backdropMaskInner;_frameThumbs;_frameGuides;_draggingThumb;_hoverThumb;_dragStartPoint;_dragStartCrop;_frameImage;_guidesHidden=!1;constructor(){super(),this.init$={...this.init$,dragging:!1},this._handlePointerUp=this._handlePointerUp_.bind(this),this._handlePointerMove=this._handlePointerMove_.bind(this),this._handleSvgPointerMove=this._handleSvgPointerMove_.bind(this)}_shouldThumbBeDisabled(t){const e=this.$["*imageBox"];if(!e)return!1;if(""===t&&e.height<=1&&e.width<=1)return!0;const r=e.height<=1&&(t.includes("n")||t.includes("s")),i=e.width<=1&&(t.includes("e")||t.includes("w"));return r||i}_createBackdrop(){const t=this.$["*cropBox"];if(!t)return;const{x:e,y:r,width:i,height:o}=t,n=this.ref["svg-el"],a=ln("mask",{id:this._backdropMaskId}),s=ln("rect",{x:0,y:0,width:"100%",height:"100%",fill:"white"}),c=ln("rect",{x:e,y:r,width:i,height:o,fill:"black"});a.appendChild(s),a.appendChild(c);const l=ln("rect",{x:0,y:0,width:"100%",height:"100%",fill:"var(--color-image-background)","fill-opacity":.85,mask:`url(#${this._backdropMaskId})`});n.appendChild(l),n.appendChild(a),this._backdropMask=a,this._backdropMaskInner=c}_resizeBackdrop(){this._backdropMask&&(this._backdropMask.style.display="none",window.requestAnimationFrame(()=>{this._backdropMask&&(this._backdropMask.style.display="block")}))}_updateBackdrop(){const t=this.$["*cropBox"];if(!t)return;const{x:e,y:r,width:i,height:o}=t;this._backdropMaskInner&&cn(this._backdropMaskInner,{x:e,y:r,width:i,height:o})}_updateFrame(){const t=this.$["*cropBox"];if(t&&this._frameGuides&&this._frameThumbs){for(const e of Object.values(this._frameThumbs)){if(!e)continue;const{direction:r,pathNode:i,interactionNode:o,groupNode:n}=e,a=""===r,s=2===r.length,{x:c,y:l,width:u,height:d}=t;if(a){cn(o,{x:c,y:l,width:u,height:d})}else{const e=fn(Math.min(u,d)/82/2,0,1),n=s?un(t,r,e):dn(t,r,e),a=n.center;if(!a)continue;const c=Math.max(24*fn(Math.min(u,d)/24/3,0,1),6);cn(o,{x:a[0]-c,y:a[1]-c,width:2*c,height:2*c}),cn(i,{d:n.d})}const h=this._shouldThumbBeDisabled(r);n.setAttribute("class",ya("uc-thumb",{"uc-thumb--hidden":h,"uc-thumb--visible":!h}))}cn(this._frameGuides,{x:t.x-.5,y:t.y-.5,width:t.width+1,height:t.height+1})}}_createThumb(t,e){const r=ln("g");r.classList.add("uc-thumb"),r.setAttribute("with-effects","");const i=ln("rect",{fill:"transparent"}),o=ln("path",{stroke:"currentColor",fill:"none","stroke-width":3});r.appendChild(o),r.appendChild(i),t[e]={direction:e,pathNode:o,interactionNode:i,groupNode:r},""===e&&(r.style.cursor="move"),i.addEventListener("pointerdown",this._handlePointerDown.bind(this,e))}_createThumbs(){const t={};for(let e=0;e<3;e++)for(let r=0;r<3;r++){const i=`${["n","","s"][e]}${["w","","e"][r]}`;""!==i&&this._createThumb(t,i)}return this._createThumb(t,""),t}_createGuides(){const t=ln("svg"),e=ln("rect",{x:0,y:0,width:"100%",height:"100%",fill:"none",stroke:"currentColor","stroke-width":1,"stroke-opacity":.5});t.appendChild(e);for(let e=1;e<=2;e++){const r=ln("line",{x1:sn*e+"%",y1:"0%",x2:sn*e+"%",y2:"100%",stroke:"currentColor","stroke-width":1,"stroke-opacity":.3});t.appendChild(r)}for(let e=1;e<=2;e++){const r=ln("line",{x1:"0%",y1:sn*e+"%",x2:"100%",y2:sn*e+"%",stroke:"currentColor","stroke-width":1,"stroke-opacity":.3});t.appendChild(r)}return t.classList.add("uc-guides","uc-guides--semi-hidden"),t}_createFrame(){const t=this.ref["svg-el"],e=document.createDocumentFragment(),r=this._createGuides();e.appendChild(r);const i=this._createThumbs();for(const{groupNode:t}of Object.values(i))e.appendChild(t);t.appendChild(e),this._frameThumbs=i,this._frameGuides=r}_handlePointerDown(t,e){if(!this._frameThumbs)return;const r=this._frameThumbs[t];if(!r)return;if(this._shouldThumbBeDisabled(t))return;const i=this.$["*cropBox"],o=this.ref["svg-el"],{x:n,y:a}=o.getBoundingClientRect(),s=e.x-n,c=e.y-a;this.$.dragging=!0,this._draggingThumb=r,this._dragStartPoint=[s,c],this._dragStartCrop={...i}}_handlePointerUp_(t){this._updateCursor(),this.$.dragging&&(t.stopPropagation(),t.preventDefault(),this.$.dragging=!1)}_handlePointerMove_(t){if(!this.$.dragging||!this._dragStartPoint||!this._draggingThumb)return;t.stopPropagation(),t.preventDefault();const e=this.ref["svg-el"],{x:r,y:i}=e.getBoundingClientRect(),o=t.x-r,n=t.y-i,a=o-this._dragStartPoint[0],s=n-this._dragStartPoint[1],{direction:c}=this._draggingThumb,l=this._calcCropBox(c,[a,s]);l&&(this.$["*cropBox"]=l)}_calcCropBox(t,e){const[r,i]=e,o=this.$["*imageBox"];let n=this._dragStartCrop??this.$["*cropBox"];const a=this.$["*currentAspectRatio"],s=a?a.width/a.height:void 0;if(n=""===t?function({rect:t,delta:[e,r],imageBox:i}){return hn({...t,x:t.x+e,y:t.y+r},i)}({rect:n,delta:[r,i],imageBox:o}):pn({rect:n,delta:[r,i],direction:t,aspectRatio:s,imageBox:o}),Object.values(n).every(t=>Number.isFinite(t)&&t>=0))return hn(bn(n),o);console.error("CropFrame is trying to create invalid rectangle",{payload:n})}_handleSvgPointerMove_(t){if(!this._frameThumbs)return;const e=Object.values(this._frameThumbs).find(e=>{if(!e)return!1;if(this._shouldThumbBeDisabled(e.direction))return!1;const r=e.interactionNode.getBoundingClientRect(),i=function(t,[e,r]){return t.x<=e&&e<=t.x+t.width&&t.y<=r&&r<=t.y+t.height}({x:r.x,y:r.y,width:r.width,height:r.height},[t.x,t.y]);return i});this._hoverThumb=e,this._updateCursor()}_updateCursor(){const t=this._hoverThumb;var e;this.ref["svg-el"].style.cursor=t?""===(e=t.direction)?"move":["e","w"].includes(e)?"ew-resize":["n","s"].includes(e)?"ns-resize":["nw","se"].includes(e)?"nwse-resize":"nesw-resize":"initial"}_createMask(t){if(this._frameImage)return void this._frameImage.setAttribute("href",t);const e=this.ref["svg-el"],r=document.createDocumentFragment(),i=ln("image",{href:t});i.setAttribute("class","uc-cloud-mask"),r.appendChild(i),e.appendChild(r),this._frameImage=i}_updateMask(){const t=this.$["*cropBox"];if(!t||!this._frameImage)return;const{x:e,y:r,width:i,height:o}=t;cn(this._frameImage,{x:e,y:r,height:o,width:i})}_render(){this._updateBackdrop(),this._updateFrame(),this._updateMask()}toggleThumbs(t){if(this._frameThumbs)for(const e of Object.values(this._frameThumbs)){if(!e)continue;const{groupNode:r}=e;r.setAttribute("class",ya("uc-thumb",{"uc-thumb--hidden":!t,"uc-thumb--visible":t}))}}initCallback(){super.initCallback(),this._createBackdrop(),this._createFrame(),this.sub("*imageBox",()=>{this._resizeBackdrop(),window.requestAnimationFrame(()=>{this._render()})}),this.sub("*cropBox",t=>{t&&(this._guidesHidden=t.height<=1||t.width<=1,window.requestAnimationFrame(()=>{this._render()}))}),this.subConfigValue("cloudImageEditorMaskHref",t=>{t&&this._createMask(t)}),this.sub("dragging",t=>{this._frameGuides&&this._frameGuides.setAttribute("class",ya({"uc-guides--hidden":this._guidesHidden,"uc-guides--visible":!this._guidesHidden&&t,"uc-guides--semi-hidden":!this._guidesHidden&&!t}))});this.ref["svg-el"].addEventListener("pointermove",this._handleSvgPointerMove,!0),document.addEventListener("pointermove",this._handlePointerMove,!0),document.addEventListener("pointerup",this._handlePointerUp,!0)}destroyCallback(){super.destroyCallback();this.ref["svg-el"].removeEventListener("pointermove",this._handleSvgPointerMove,!0),document.removeEventListener("pointermove",this._handlePointerMove),document.removeEventListener("pointerup",this._handlePointerUp)}};xa.template=' <svg class="uc-svg" ref="svg-el" xmlns="http://www.w3.org/2000/svg"></svg> ';var Ca=class extends Yo{_titleEl;constructor(){super(),this.init$={...this.init$,active:!1,title:"",icon:"","on.click":null,"title-prop":""}}initCallback(){super.initCallback(),this._titleEl=this.ref["title-el"],this.sub("title",t=>{const e=this._titleEl;e&&(e.style.display=t?"block":"none")}),this.sub("active",t=>{this.className=ya({"uc-active":t,"uc-not_active":!t})}),this.sub("on.click",t=>{this.onclick=t??null})}};Ca.template='\n <button role="option" type="button" set="@aria-label:title-prop;" l10n="@title:title-prop;">\n <uc-icon ref="icon-el" set="@name: icon;"></uc-icon>\n <div class="uc-title" ref="title-el">{{title}}</div>\n </button>\n';var Ea=class extends Ca{initCallback(){super.initCallback(),this.$.icon="arrow-dropdown",this.$["on.click"]=this.handleClick.bind(this),this.sub("*currentAspectRatio",t=>{this.$.title=t.hasFreeform?this.l10n("freeform-crop"):this.l10n("crop-to-shape",{value:`${t.width}:${t.height}`}),this.bindL10n("title-prop",()=>this.$.title)})}handleClick(){this.$["*showListAspectRatio"]=!0}};Ea.template=' \n <button role="option" type="button" set="@aria-label:title-prop;" l10n="@title:title-prop;">\n <div class="uc-title" ref="title-el">{{title}}</div>\n <uc-icon ref="icon-el" set="@name: icon;"></uc-icon>\n </button> \n';var Ta=class extends Ca{constructor(){super(),this.init$={...this.init$,active:!1,once:!1}}initCallback(){super.initCallback(),this.defineAccessor("aspectRatio",t=>{if(!t)return;const e=!!t.hasFreeform;this.$.title=e?this.l10n("custom"):`${t.width}:${t.height}`,e||this._renderRectBasedOnAspectRatio(t),e&&this.setAttribute("uc-aspect-ratio-freeform",""),this._aspectRatio=t,this.bindL10n("title-prop",()=>this.l10n("a11y-cloud-editor-apply-aspect-ratio",{name:e?this.l10n("custom").toLowerCase():this.l10n("crop-to-shape",{value:`${t.width}:${t.height}`}).toLowerCase(),value:""}))}),this.sub("*currentAspectRatio",t=>{this.$.active=t&&t.id===this._aspectRatio?.id||t?.width===this._aspectRatio?.width&&t?.height===this._aspectRatio?.height}),this.$["on.click"]=this.handleClick.bind(this)}handleClick(){const t=this.$["*currentAspectRatio"];t?.id!==this._aspectRatio?.id&&(this.$["*currentAspectRatio"]=this._aspectRatio)}_renderRectBasedOnAspectRatio(t){const{width:e,height:r}=(t=>{let e=12,r=12;return t.width/t.height>=1?(e=12,r=Math.round(12*t.height/t.width)):(r=12,e=Math.round(12*t.width/t.height)),{width:e,height:r}})(t),i=ln("rect",{"stroke-linejoin":"round",fill:"none",stroke:"currentColor","stroke-width":1.2,"fill-rule":"evenodd",x:(16-e)/2,y:(16-r)/2,rx:2,width:e,height:r}),o=this.ref["icon-el"]?.ref?.svg;o&&(o.innerHTML="",o.appendChild(i))}_aspectRatio};var Aa=class extends Ca{_operation=void 0;initCallback(){super.initCallback(),this.defineAccessor("operation",t=>{t&&(this._operation=t,this.$.icon=t,this.bindL10n("title-prop",()=>this.l10n("a11y-cloud-editor-apply-crop",{name:this.l10n(t).toLowerCase()})))}),this.$["on.click"]=t=>{if(!this._operation)return;const e=this.$["*cropperEl"],r=e.getValue(this._operation),i=function(t,e){if("rotate"===t)return function(t){let e=t+90;return e=e>=360?0:e,e}("number"==typeof e?e:0);if("mirror"===t||"flip"===t)return!e;throw new Error(`Unsupported operation: ${t}`)}(this._operation,r);this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{operation:this._operation,next:i,prev:r}),e.setValue(this._operation,i)}}};function Ia(t){const e=new Image;return{promise:new Promise((r,i)=>{e.src=t,e.onload=()=>r(),e.onerror=t=>i(t)}),image:e,cancel:()=>{0===e.naturalWidth&&(e.src=fa)}}}function Sa(t){const e=[];for(const r of t){const t=Ia(r);e.push(t)}const r=e.map(t=>t.image);return{promise:Promise.allSettled(e.map(t=>t.promise)),images:r,cancel:()=>{e.forEach(t=>{t.cancel()})}}}var Ma="original",$a=class extends Yo{_operation="filter";_filter;_originalUrl="";constructor(){super(),this.init$={...this.init$,disabled:!1,min:0,max:100,value:0,defaultValue:0,zero:0,"on.input":t=>{const e=this.$["*faderEl"];e?.set(t),this.$.value=t}}}setOperation(t,e){this._operation=t,this._filter=e,this._initializeValues();const r=this.$["*faderEl"],i=this._originalUrl||this.$["*originalUrl"];r&&i&&r.activate({url:i,operation:this._operation,value:this._filter===Ma?void 0:this.$.value,filter:this._filter===Ma?void 0:this._filter,fromViewer:!1})}_initializeValues(){const t=this._operation,{range:e,zero:r}=yo[t],[i,o]=e;this.$.min=i,this.$.max=o,this.$.zero=r;const n=this.$["*editorTransformations"][t];if("filter"===t){let t=Number(o);const e=n;if(e){const{name:r,amount:i}=e;t=r===this._filter?i:o}return this.$.value=t,void(this.$.defaultValue=t)}const a=void 0!==n?n:r;this.$.value=a,this.$.defaultValue=a}apply(){const t={...this.$["*editorTransformations"]};"filter"===this._operation?this._filter&&this._filter!==Ma?t.filter={name:this._filter,amount:this.$.value}:delete t.filter:t[this._operation]=this.$.value,this.$["*editorTransformations"]=t}cancel(){const t=this.$["*faderEl"];t?.deactivate({hide:!1})}initCallback(){super.initCallback(),this.sub("*originalUrl",t=>{this._originalUrl=t}),this.sub("value",t=>{const e=`${this._filter??this._operation} ${t}`;this.$["*operationTooltip"]=e})}};function La(t){const e=t.match(/^([A-Za-z]+)\s+(\d+)$/);if(!e)return null;const[,r,i]=e;return r&&void 0!==i?{filter:r,value:Number(i)}:null}$a.template='\n <uc-slider-ui\n ref="slider-el"\n set="disabled: disabled; min: min; max: max; defaultValue: defaultValue; zero: zero; onInput: on.input;"\n ></uc-slider-ui>\n';var Oa=class extends Ca{_operation="";_filter="";_originalUrl="";_observer;_cancelPreload;constructor(){super(),this.init$={...this.init$,active:!1,title:"",icon:"",isOriginal:!1,iconSize:"20","on.click":null}}_previewSrc(){const t=parseInt(window.getComputedStyle(this).getPropertyValue("--l-base-min-width"),10),e=window.devicePixelRatio,r=Math.ceil(e*t),i=e>=2?"lightest":"normal",o={...this.$["*editorTransformations"]};return o[this._operation]=this._filter!==Ma?{name:this._filter,amount:100}:void 0,eo(this._originalUrl,Gi(so,ao(o),`quality/${i}`,`scale_crop/${r}x${r}/center`))}async _observerCallback(t,e){const r=t[0];if(r?.isIntersecting){const t=await this.proxyUrl(this._previewSrc()),r=this.ref["preview-el"],{promise:i,cancel:o}=Ia(t);this._cancelPreload=o,i.catch(t=>{this.$["*networkProblems"]=!0,console.error("Failed to load image",{error:t})}).finally(()=>{r.style.backgroundImage=`url(${t})`,r.setAttribute("loaded",""),e.unobserve(this)})}else this._cancelPreload?.()}initCallback(){super.initCallback(),this.$["on.click"]=t=>{if(this.$.active){if(!this.$.isOriginal){this.$["*sliderEl"].setOperation(this._operation,this._filter),this.$["*showSlider"]=!0}}else{const t=this.$["*sliderEl"];t.setOperation(this._operation,this._filter),t.apply()}this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{operation:La(this.$["*operationTooltip"])}),this.$["*currentFilter"]=this._filter},this.defineAccessor("filter",t=>{this._operation="filter",this._filter=t,this.$.isOriginal=t===Ma,this.$.icon=this.$.isOriginal?"original":"slider",this.bindL10n("title-prop",()=>this.l10n("a11y-cloud-editor-apply-filter",{name:t.toLowerCase()}))}),this._observer=new window.IntersectionObserver(this._observerCallback.bind(this),{threshold:[0,1]});const t=this.$["*originalUrl"];if(this._originalUrl=t,this.$.isOriginal){this.ref["icon-el"].classList.add("uc-original-icon")}else this._observer.observe(this);this.sub("*currentFilter",t=>{this.$.active=t&&t===this._filter}),this.sub("isOriginal",t=>{this.$.iconSize=t?40:20}),this.sub("active",t=>{if(this.$.isOriginal)return;this.ref["icon-el"].style.opacity=t?"1":"0";const e=this.ref["preview-el"];t?e.style.opacity="0":e.style.backgroundImage&&(e.style.opacity="1")}),this.sub("*networkProblems",async t=>{if(!t){const t=await this.proxyUrl(this._previewSrc()),e=this.ref["preview-el"];e.style.backgroundImage&&(e.style.backgroundImage="none",e.style.backgroundImage=`url(${t})`)}})}destroyCallback(){super.destroyCallback(),this._observer?.disconnect(),this._cancelPreload?.()}};Oa.template='\n <button type="button" role="option" l10n="@title:title-prop;@aria-label:title-prop">\n <div class="uc-preview" ref="preview-el"></div>\n <uc-icon ref="icon-el" set="@name: icon; @size: iconSize;"></uc-icon>\n </button>\n';var Ra=(t,e)=>{let r,i=!1,o=0;const n=(...n)=>{i?(r&&clearTimeout(r),r=setTimeout(()=>{Date.now()-o>=e&&(t(...n),o=Date.now())},Math.max(e-(Date.now()-o),0))):(t(...n),o=Date.now(),i=!0)};return Object.defineProperty(n,"cancel",{configurable:!1,writable:!1,enumerable:!1,value:()=>{r&&clearTimeout(r)}}),n};function Ua(t,e,r){const i=window.devicePixelRatio,o=Math.min(Math.ceil(e*i),3e3),n=i>=2?"lightest":"normal";return eo(t,Gi(so,ao(r),`quality/${n}`,`stretch/off/-/resize/${o}x`,`@clib/${Ko}/${Go}/uc-cloud-image-editor/`))}var Pa=class extends Yo{ctxOwner=!0;_commitDebounced;_handleResizeThrottled;_imageSize={width:0,height:0};_canvas;_ctx=null;_isActive=!1;_observer;_cancelPreload;constructor(){super(),this.init$={...this.init$,image:null,"*padding":20,"*operations":{rotate:0,mirror:!1,flip:!1},"*imageBox":{x:0,y:0,width:0,height:0},"*cropBox":{x:0,y:0,width:0,height:0}},this._commitDebounced=Bi(this._commit.bind(this),300),this._handleResizeThrottled=Ra(this._handleResize.bind(this),100)}_handleResize(){this.isConnected&&this._isActive&&(this._initCanvas(),this._syncTransformations(),this._alignImage(),this._alignCrop(),this._draw())}_syncTransformations(){const t=function(t,e){const r={};for(const i of e){const e=t[i];(Object.hasOwn(t,i)||void 0!==e)&&(r[i]=e)}return r}(this.$["*editorTransformations"],Object.keys(this.$["*operations"])),e={...this.$["*operations"],...t};this.$["*operations"]=e}_initCanvas(){const t=this.ref["canvas-el"],e=t.getContext("2d"),r=this.offsetWidth,i=this.offsetHeight,o=window.devicePixelRatio;t.style.width=`${r}px`,t.style.height=`${i}px`,t.width=r*o,t.height=i*o,e?.scale(o,o),this._canvas=t,this._ctx=e}_alignImage(){if(!this._isActive||!this.$.image)return;const t=this.$.image,e=this.$["*padding"],r=this.$["*operations"],{rotate:i}=r,o=this.offsetWidth,n=this.offsetHeight,a=gn({width:t.naturalWidth,height:t.naturalHeight},i);let s;if(a.width>o-2*e||a.height>n-2*e){const t=a.width/a.height;if(t>o/n){const r=o-2*e,i=r/t;s={x:0+e,y:e+(n-2*e)/2-i/2,width:r,height:i}}else{const r=n-2*e,i=r*t;s={x:e+(o-2*e)/2-i/2,y:0+e,width:i,height:r}}}else{const{width:t,height:r}=a;s={x:e+(o-2*e)/2-t/2,y:e+(n-2*e)/2-r/2,width:t,height:r}}this.$["*imageBox"]=bn(s)}_alignCrop(){let t=this.$["*cropBox"];const e=this.$["*imageBox"],r=this.$["*operations"],{rotate:i}=r,o=this.$["*editorTransformations"].crop,{width:n,x:a,y:s}=e;if(o){const{dimensions:[r,c],coords:[l,u]}=o,{width:d}=gn(this._imageSize,i),h=n/d;t=hn(bn({x:a+l*h,y:s+u*h,width:r*h,height:c*h}),e)}const c=this.$["*currentAspectRatio"],l=c?c.width/c.height:void 0;if(p=e,!((h=t).x>=p.x&&h.y>=p.y&&h.x+h.width<=p.x+p.width&&h.y+h.height<=p.y+p.height)||l&&(u=t,d=l,!(Math.abs(u.width/u.height-d)<.1))){const r=e.width/e.height;let i=e.width,o=e.height;l&&(r>l?i=Math.min(e.height*l,e.width):o=Math.min(e.width/l,e.height)),t={x:e.x+e.width/2-i/2,y:e.y+e.height/2-o/2,width:i,height:o}}var u,d,h,p;this.$["*cropBox"]=hn(bn(t),e)}_drawImage(){const t=this._ctx;if(!t)return;const e=this.$.image,r=this.$["*imageBox"],i=this.$["*operations"],{mirror:o,flip:n,rotate:a}=i,s=gn({width:r.width,height:r.height},a);t.save(),t.translate(r.x+r.width/2,r.y+r.height/2),t.rotate(a*Math.PI*-1/180),t.scale(o?-1:1,n?-1:1),t.drawImage(e,-s.width/2,-s.height/2,s.width,s.height),t.restore()}_draw(){if(!(this._isActive&&this.$.image&&this._canvas&&this._ctx))return;const t=this._canvas;this._ctx.clearRect(0,0,t.width,t.height),this._drawImage()}_animateIn({fromViewer:t}){this.$.image&&(this.ref["frame-el"].toggleThumbs(!0),this._transitionToImage(),setTimeout(()=>{this.className=ya({"uc-active_from_viewer":t,"uc-active_from_editor":!t,"uc-inactive_to_editor":!1})}))}_getCropDimensions(){const t=this.$["*cropBox"],e=this.$["*imageBox"],r=this.$["*operations"],{rotate:i}=r,{width:o,height:n}=e,{width:a,height:s}=gn(this._imageSize,i),{width:c,height:l}=t,u=o/a,d=n/s;return[fn(Math.round(c/u),1,a),fn(Math.round(l/d),1,s)]}_getCropTransformation(){const t=this.$["*cropBox"],e=this.$["*imageBox"],r=this.$["*operations"],{rotate:i}=r,{width:o,height:n,x:a,y:s}=e,{width:c,height:l}=gn(this._imageSize,i),{x:u,y:d}=t,h=o/c,p=n/l,g=this._getCropDimensions(),m={dimensions:g,coords:[fn(Math.round((u-a)/h),0,c-g[0]),fn(Math.round((d-s)/p),0,l-g[1])]};if(function(t){if(!t)return!0;const e=[({dimensions:t,coords:e})=>[...t,...e].every(t=>Number.isInteger(t)&&Number.isFinite(t)),({dimensions:t,coords:e})=>t.every(t=>t>0)&&e.every(t=>t>=0)];return e.every(e=>e(t))}(m)){if(g[0]!==c||g[1]!==l)return m}else console.error("Cropper is trying to create invalid crop object",{payload:m})}_commit(){if(!this.isConnected||!this._imageSize)return;const t=this.$["*operations"],{rotate:e,mirror:r,flip:i}=t,o=this._getCropTransformation(),n={...this.$["*editorTransformations"],crop:o,rotate:e,mirror:r,flip:i};this.$["*editorTransformations"]=n}setValue(t,e){this.$["*operations"]={...this.$["*operations"],[t]:e},this._isActive&&(this._alignImage(),this._alignCrop(),this._draw())}getValue(t){return this.$["*operations"][t]}async activate(t,{fromViewer:e}={}){if(!this._isActive){this._isActive=!0,this._imageSize=t,this.removeEventListener("transitionend",this._reset);try{const t=this.$["*originalUrl"],r=this.$["*editorTransformations"];this.$.image=await this._waitForImage(t,r),this._syncTransformations(),this._animateIn({fromViewer:e})}catch(t){console.error("Failed to activate cropper",{error:t}),this.telemetryManager.sendEventError(t,"cloud editor image. Failed to activate cropper")}this._observer=new ResizeObserver(t=>{const[e]=t;if(!e)return;e.contentRect.width>0&&e.contentRect.height>0&&this._isActive&&this.$.image&&this._handleResizeThrottled()}),this._observer.observe(this)}}deactivate({reset:t=!1}={}){this._isActive&&(!t&&this._commit(),this._isActive=!1,this._transitionToCrop(),this.className=ya({"uc-active_from_viewer":!1,"uc-active_from_editor":!1,"uc-inactive_to_editor":!0}),this.ref["frame-el"].toggleThumbs(!1),this.addEventListener("transitionend",this._reset,{once:!0}),this._observer?.disconnect())}_transitionToCrop(){const t=this._getCropDimensions(),e=this.$["*cropBox"],r=Math.min(this.offsetWidth,t[0])/e.width,i=Math.min(this.offsetHeight,t[1])/e.height,o=Math.min(r,i),n=e.x+e.width/2,a=e.y+e.height/2;this.style.transform=`scale(${o}) translate(${(this.offsetWidth/2-n)/o}px, ${(this.offsetHeight/2-a)/o}px)`,this.style.transformOrigin=`${n}px ${a}px`}_transitionToImage(){const t=this.$["*cropBox"],e=t.x+t.width/2,r=t.y+t.height/2;this.style.transform="scale(1)",this.style.transformOrigin=`${e}px ${r}px`}_reset(){this._isActive||(this.$.image=null)}async _waitForImage(t,e){const r=this.offsetWidth;e={...e,crop:void 0,rotate:void 0,flip:void 0,mirror:void 0};const i=await this.proxyUrl(Ua(t,r,e)),{promise:o,cancel:n,image:a}=Ia(i),s=this._handleImageLoading(i);return a.addEventListener("load",s,{once:!0}),a.addEventListener("error",s,{once:!0}),this._cancelPreload?.(),this._cancelPreload=n,o.then(()=>a).catch(t=>(console.error("Failed to load image",{error:t}),this.$["*networkProblems"]=!0,a))}_handleImageLoading(t){const e="crop",r=this.$["*loadingOperations"];let i=r.get(e);return i||(i=new Map,r.set(e,i)),i.get(t)||(i.set(t,!0),this.$["*loadingOperations"]=r),()=>{const i=r.get(e);i?.has(t)&&(i.delete(t),this.$["*loadingOperations"]=r)}}initCallback(){super.initCallback(),this.sub("*imageBox",()=>{this._draw()}),this.sub("*cropBox",()=>{this.$.image&&this._commitDebounced()}),this.sub("*currentAspectRatio",()=>{this._alignCrop()}),setTimeout(()=>{this.sub("*networkProblems",t=>{t||this._isActive&&this.activate(this._imageSize,{fromViewer:!1})})},0)}destroyCallback(){super.destroyCallback(),this._observer?.disconnect()}};function Na(t,e,r){const i=r-1,o=new Array(r);for(let r=i;r>=0;r-=1)o[r]=Math.ceil((r*e+(i-r)*t)/i);return o}function za(t,e){const r=yo[t].keypointsNumber,{range:i,zero:o}=yo[t];return[...new Set([...Na(i[0],o,r+1),...Na(o,i[1],r+1),o,e])].sort((t,e)=>t-e)}Pa.template='\n <canvas class="uc-canvas" ref="canvas-el"></canvas>\n <uc-crop-frame ref="frame-el"></uc-crop-frame>\n';var Da=class extends Yo{_isActive=!1;_hidden=!0;_operation="initial";_filter;_value;_transformations={};_keypoints=[];_container;_previewImage;_cancelLastImages;_cancelBatchPreload;_url;_fromViewer;_raf=0;_addKeypointDebounced=Bi(this._addKeypoint.bind(this),600);constructor(){super(),this.classList.add("uc-inactive_to_cropper")}_handleImageLoading(t){const e=this._operation,r=this.$["*loadingOperations"];r.has(e)||r.set(e,new Map);const i=r.get(e);return i&&!i.get(t)&&(i.set(t,!0),this.$["*loadingOperations"]=r),()=>{const i=r.get(e);i?.has(t)&&(i.delete(t),this.$["*loadingOperations"]=r)}}_flush(){window.cancelAnimationFrame(this._raf),this._raf=window.requestAnimationFrame(()=>{for(const t of this._keypoints){const{image:e}=t;e&&(e.style.opacity=t.opacity.toString(),e.style.zIndex=t.zIndex.toString())}})}_imageSrc({url:t=this._url,filter:e=this._filter??void 0,operation:r,value:i}={}){if(!t)throw new Error("URL is not defined");const o={...this._transformations};r&&("filter"===r?e&&"number"==typeof i&&(o.filter={name:e,amount:i}):"number"==typeof i&&(o[r]=i));const n=this.offsetWidth;return this.proxyUrl(Ua(t,n,o))}async _constructKeypoint(t,e){return{src:await this._imageSrc({operation:t,value:e}),image:void 0,opacity:0,zIndex:0,value:e}}_isSame(t,e){return this._operation===t&&this._filter===e}async _addKeypoint(t,e,r){const i=()=>!this._isSame(t,e)||this._value!==r||!!this._keypoints.find(t=>t.value===r);if(i())return;const o=await this._constructKeypoint(t,r),n=new Image;n.src=o.src;const a=this._handleImageLoading(o.src);n.addEventListener("load",a,{once:!0}),n.addEventListener("error",a,{once:!0}),o.image=n,n.classList.add("uc-fader-image"),n.addEventListener("load",()=>{if(i())return;const e=this._keypoints;let a=e.findIndex(t=>t.value>r);-1===a&&(a=e.length);const s=e[a],c=s?.image,l=this._container;!l||c&&!l.contains(c)||(e.splice(a,0,o),c&&l.insertBefore(n,c),this._update(t,r))},{once:!0}),n.addEventListener("error",()=>{this.$["*networkProblems"]=!0},{once:!0})}set(t){const e="string"==typeof t?parseInt(t,10):t;(function(t){return"string"==typeof t&&t in yo})(this._operation)&&Number.isFinite(e)&&(this._update(this._operation,e),this._addKeypointDebounced(this._operation,this._filter,e))}_update(t,e){this._operation=t,this._value=e;const{zero:r}=yo[t],i=this._keypoints.map(t=>t.value),o=function(t,e,r){const i=function(t){const e=[];for(let r=0;r<t.length-1;r+=1){const i=t[r],o=t[r+1];"number"==typeof i&&"number"==typeof o&&e.push([i,o])}return e}(t).find(([t,r])=>t<=e&&e<=r);if(!i)return t.map(()=>0);const[o,n]=i;return t.map(t=>{const i=Math.abs(o-n)||1,a=Math.abs(e-o)/i;return o===t?e>r?1:1-a:n===t?e>=r?a:1:0})}(i,e,r),n=function(t,e){return t.map((r,i)=>r<e?t.length-i:i)}(i,r);this._keypoints.forEach((t,e)=>{const r=o[e],i=n[e];"number"==typeof r&&(t.opacity=r),"number"==typeof i&&(t.zIndex=i)}),this._flush()}_createPreviewImage(){const t=new Image;return t.classList.add("uc-fader-image","uc-fader-image--preview"),t.style.opacity="0",t}async _initNodes(){const t=document.createDocumentFragment();this._previewImage=this._previewImage||this._createPreviewImage();const e=this._previewImage;this.contains(e)||t.appendChild(e);const r=document.createElement("div");t.appendChild(r);const i=this._keypoints.map(t=>t.src),{images:o,promise:n,cancel:a}=Sa(i);o.forEach(t=>{const e=this._handleImageLoading(t.src);t.addEventListener("load",e),t.addEventListener("error",e)}),this._cancelLastImages=()=>{a(),this._cancelLastImages=void 0};const s=this._operation,c=this._filter;await n,this._isActive&&this._isSame(s,c)&&(this._container?.remove(),this._container=r,this._keypoints.forEach((t,e)=>{const r=o[e];r&&(r.classList.add("uc-fader-image"),t.image=r,this._container?.appendChild(r))}),this.appendChild(t),this._flush())}async setTransformations(t){if(this._transformations=t,this._previewImage){const t=await this._imageSrc(),e=this._handleImageLoading(t);this._previewImage.src=t,this._previewImage.addEventListener("load",e,{once:!0}),this._previewImage.addEventListener("error",e,{once:!0}),this._previewImage.style.opacity="1",this._previewImage.addEventListener("error",()=>{this.$["*networkProblems"]=!0},{once:!0})}}async preload({url:t,filter:e,operation:r,value:i}){if(!r||"number"!=typeof i)return;this._cancelBatchPreload?.();const o=za(r,i),n=await Promise.all(o.map(i=>this._imageSrc({url:t,filter:e,operation:r,value:i}))),{cancel:a}=Sa(n);this._cancelBatchPreload=a}_setOriginalSrc(t){const e=this._previewImage||this._createPreviewImage();if(this.contains(e)||this.appendChild(e),this._previewImage=e,e.src===t)return e.style.opacity="1",e.style.transform="scale(1)",void(this.className=ya({"uc-active_from_viewer":this._fromViewer,"uc-active_from_cropper":!this._fromViewer,"uc-inactive_to_cropper":!1}));e.style.opacity="0";const r=this._handleImageLoading(t);e.addEventListener("error",r,{once:!0}),e.src=t,e.addEventListener("load",()=>{r(),e&&(e.style.opacity="1",e.style.transform="scale(1)",this.className=ya({"uc-active_from_viewer":this._fromViewer,"uc-active_from_cropper":!this._fromViewer,"uc-inactive_to_cropper":!1}))},{once:!0}),e.addEventListener("error",()=>{this.$["*networkProblems"]=!0},{once:!0})}async activate({url:t,operation:e,value:r,filter:i,fromViewer:o}){this._isActive=!0,this._hidden=!1,this._url=t,this._operation=e??"initial",this._value=r,this._filter=i,this._fromViewer=o;if("number"!=typeof r&&!i){const t=await this._imageSrc({operation:e,value:r});return this._setOriginalSrc(t),void this._container?.remove()}e&&"number"==typeof r&&(this._keypoints=await Promise.all(za(e,r).map(t=>this._constructKeypoint(e,t))),this._update(e,r),this._initNodes())}deactivate({hide:t=!0}={}){this._isActive=!1,this._cancelLastImages?.(),this._cancelBatchPreload?.(),t&&!this._hidden?(this._hidden=!0,this._previewImage&&(this._previewImage.style.transform="scale(1)"),this.className=ya({"uc-active_from_viewer":!1,"uc-active_from_cropper":!1,"uc-inactive_to_cropper":!0}),this.addEventListener("transitionend",()=>{this._container?.remove()},{once:!0})):this._container?.remove()}},Fa=class extends Ca{_operation="";initCallback(){super.initCallback(),this.$["on.click"]=t=>{this.$["*sliderEl"].setOperation(this._operation),this.$["*showSlider"]=!0,this.$["*currentOperation"]=this._operation,this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{operation:La(this.$["*operationTooltip"])})},this.defineAccessor("operation",t=>{t&&(this._operation=t,this.$.icon=t,this.bindL10n("title-prop",()=>this.l10n("a11y-cloud-editor-apply-tuning",{name:this.l10n(t).toLowerCase()})),this.bindL10n("title",()=>this.l10n(t)))}),this.sub("*editorTransformations",t=>{if(!this._operation)return;const{zero:e}=yo[this._operation],r=t[this._operation],i=void 0!==r&&r!==e;this.$.active=i})}},Va=class extends Yo{initCallback(){super.initCallback(),this.addEventListener("wheel",t=>{t.preventDefault();const{deltaY:e,deltaX:r}=t;Math.abs(r)>1?this.scrollLeft+=r:this.scrollLeft+=e},{passive:!1}),this.addEventListener("scroll",()=>{},{passive:!0})}};Va.template=" <slot></slot> ";var Ba=class extends Yo{_debouncedShowLoader;_cancelPreload;_updateInfoTooltip;constructor(){super(),this.init$={...this.init$,"*sliderEl":null,"*listAspectRatioEl":null,"*loadingOperations":new Map,"*showSlider":!1,"*showListAspectRatio":!1,hideSliderOrList:!1,"*currentFilter":Ma,"*currentOperation":null,showLoader:!1,filters:bo,colorOperations:mo,cropOperations:fo,"*operationTooltip":null,"presence.mainToolbar":!0,"presence.subToolbar":!1,"presence.tabToggles":!0,"presence.tabContent.crop":!1,"presence.tabContent.tuning":!1,"presence.tabContent.filters":!1,"presence.tabToggle.crop":!0,"presence.tabToggle.tuning":!0,"presence.tabToggle.filters":!0,"presence.subTopToolbarStyles":{hidden:"uc-sub-toolbar--top-hidden",visible:"uc-sub-toolbar--visible"},"presence.subBottomToolbarStyles":{hidden:"uc-sub-toolbar--bottom-hidden",visible:"uc-sub-toolbar--visible"},"presence.tabContentStyles":{hidden:"uc-tab-content--hidden",visible:"uc-tab-content--visible"},"presence.tabToggleStyles":{hidden:"uc-tab-toggle--hidden",visible:"uc-tab-toggle--visible"},"presence.tabTogglesStyles":{hidden:"uc-tab-toggles--hidden",visible:"uc-tab-toggles--visible"},"on.cancel":t=>{this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{action:"cancel"}),this._cancelPreload?.();(0,this.$["*on.cancel"])()},"on.apply":t=>{this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{action:"apply"});(0,this.$["*on.apply"])(this.$["*editorTransformations"])},"on.applySlider":t=>{this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{action:"apply-slider",operation:La(this.$["*operationTooltip"])});this.ref["slider-el"].apply(),this._onSliderClose()},"on.cancelSlider":t=>{this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{action:"cancel-slider"});this.ref["slider-el"].cancel(),this._onSliderClose()},"on.clickTab":t=>{const e=t.currentTarget,r=e?.getAttribute("data-id");r&&(this.telemetryManager.sendEventCloudImageEditor(t,r),this._activateTab(r,{fromViewer:!1}))},tab_role:"tab",[`tab_${po.TUNING}`]:`tab_${po.TUNING}`,[`tab_${po.CROP}`]:`tab_${po.CROP}`,[`tab_${po.FILTERS}`]:`tab_${po.FILTERS}`,cancel:"cancel",apply:"apply","a11y-editor-tab-filters":"a11y-editor-tab-filters","a11y-editor-tab-tuning":"a11y-editor-tab-tuning","a11y-editor-tab-crop":"a11y-editor-tab-crop"},this._debouncedShowLoader=Bi(this._showLoader.bind(this),500),this._updateInfoTooltip=Bi(this._updateInfoTooltipHandler.bind(this),0)}_onSliderClose(){if(this.$["*showSlider"]=!1,this.$["*tabId"]===po.CROP&&(this.$["*showListAspectRatio"]=!1),this.$["*tabId"]===po.TUNING){this.ref["tooltip-el"].classList.toggle("uc-info-tooltip_visible",!1)}}_createOperationControl(t){const e=new Fa;return e.operation=t,e}_createFilterControl(t){const e=new Oa;return e.filter=t,e}_createToggleControl(t){const e=new Aa;return e.operation=t,e}_createAspectRatioControl(t){const e=new Ta;return e.aspectRatio=t,e}_createFreeformControl(){return new Ea}_clearListAspectRatio(){const t=this.$["*listAspectRatioEl"];t&&(t.innerHTML="")}_renderControlsList(t){const e=this.ref[`controls-list-${t}`],r=document.createDocumentFragment();if(this._clearListAspectRatio(),t===po.CROP){const t=this.$["*cropPresetList"],e=t.length>=3;if(e){const t=this._createFreeformControl();r.appendChild(t)}for(const i of t){const t=this._createAspectRatioControl(i);if(r.appendChild(t),e){const e=this.$["*listAspectRatioEl"];e?.appendChild(t)}}for(const t of this.$.cropOperations){const e=this._createToggleControl(t);r.appendChild(e)}}else if(t===po.FILTERS){const t=this.$.filters;[Ma,...t].forEach(t=>{const e=this._createFilterControl(t);r.appendChild(e)})}else if(t===po.TUNING)for(const t of this.$.colorOperations){const e=this._createOperationControl(t);r.appendChild(e)}[...r.children].forEach((t,e)=>{e===r.childNodes.length-1&&t.classList.add("uc-controls-list_last-item")}),e.innerHTML="",e.appendChild(r)}_activateTab(t,{fromViewer:e}={}){this.$["*tabId"]=t;const r=this.$["*faderEl"],i=this.$["*cropperEl"];t===po.CROP?(r?.deactivate(),i?.activate(this.$["*imageSize"],{fromViewer:e})):(r?.activate({url:this.$["*originalUrl"],fromViewer:e}),i?.deactivate());for(const e of go){const r=e===t;this.ref[`tab-toggle-${e}`].active=r,r?(this._renderControlsList(t),this._syncTabIndicator()):this._unmountTabControls(e),this.$[`presence.tabContent.${e}`]=r}}_unmountTabControls(t){const e=this.ref[`controls-list-${t}`];e&&(e.innerHTML="")}_syncTabIndicator(){const t=this.ref[`tab-toggle-${this.$["*tabId"]}`];this.ref["tabs-indicator"].style.transform=`translateX(${t.offsetLeft}px)`}async _preloadEditedImage(){if(this.$["*imgContainerEl"]&&this.$["*originalUrl"]){const t=this.$["*imgContainerEl"].offsetWidth,e=await this.proxyUrl(Ua(this.$["*originalUrl"],t,this.$["*editorTransformations"]));this._cancelPreload?.();const{cancel:r}=Sa([e]);this._cancelPreload=()=>{r(),this._cancelPreload=void 0}}}_showLoader(t){this.$.showLoader=t}_updateInfoTooltipHandler(){const t=this.$["*editorTransformations"],e=this.$["*currentOperation"];let r="",i=!1;if(this.$["*tabId"]===po.FILTERS)if(i=!0,this.$["*currentFilter"]&&t?.filter?.name===this.$["*currentFilter"]){const e=t?.filter?.amount||100;r=`${this.$["*currentFilter"]} ${e}`}else r=this.l10n(Ma);else if(this.$["*tabId"]===po.TUNING&&e){i=!0;const o=t?.[e]||yo[e].zero;r=`${this.l10n(e)} ${o}`}i&&(this.$["*operationTooltip"]=r),this.ref["tooltip-el"].classList.toggle("uc-info-tooltip_visible",i)}initCallback(){super.initCallback(),this.$["*sliderEl"]=this.ref["slider-el"],this.$["*listAspectRatioEl"]=this.ref["list-el"],this.sub("*imageSize",t=>{t&&setTimeout(()=>{this._activateTab(this.$["*tabId"],{fromViewer:!0})},0)}),this.sub("*editorTransformations",t=>{const e=t?.filter?.name;this.$["*currentFilter"]!==e&&(this.$["*currentFilter"]=e)}),this.sub("*currentFilter",()=>{this._updateInfoTooltip()}),this.sub("*currentOperation",()=>{this._updateInfoTooltip()}),this.sub("*tabId",()=>{this._updateInfoTooltip()}),this.sub("*originalUrl",()=>{this.$["*faderEl"]?.deactivate()}),this.sub("*editorTransformations",t=>{this._preloadEditedImage(),this.$["*faderEl"]?.setTransformations(t)}),this.sub("*loadingOperations",t=>{let e=!1;for(const[,r]of t.entries()){if(e)break;for(const[,t]of r.entries())if(t){e=!0;break}}this._debouncedShowLoader(e)}),this.sub("*showSlider",t=>{this.$["presence.subToolbar"]=t,this.$["presence.mainToolbar"]=!t,this.$.hideSliderOrList=!0}),this.sub("*showListAspectRatio",t=>{this.$["presence.subToolbar"]=t,this.$["presence.mainToolbar"]=!t,this.$.hideSliderOrList=!1}),this.sub("*tabList",t=>{this.$["presence.tabToggles"]=t.length>1;for(const e of go){this.$[`presence.tabToggle.${e}`]=t.includes(e);this.ref[`tab-toggle-${e}`].style.gridColumn=`${t.indexOf(e)+1}`}if(!t.includes(this.$["*tabId"])&&t.length>0){const[e]=t;e&&this._activateTab(e,{fromViewer:!1})}}),this._updateInfoTooltip()}destroyCallback(){this.$["*showSlider"]=!1,this.$["*showListAspectRatio"]=!1}};Ba.template=`\n <uc-line-loader-ui set="active: showLoader"></uc-line-loader-ui>\n <div class="uc-info-tooltip_container">\n <div class="uc-info-tooltip_wrapper">\n <div ref="tooltip-el" class="uc-info-tooltip uc-info-tooltip_hidden">{{*operationTooltip}}</div>\n </div>\n </div>\n <div class="uc-toolbar-container">\n <uc-presence-toggle\n role="tablist"\n class="uc-sub-toolbar"\n set="visible: presence.mainToolbar; styles: presence.subTopToolbarStyles"\n >\n <div class="uc-tab-content-row">${go.map(function(t){return`\n <uc-presence-toggle\n id="tab_${t}"\n class="uc-tab-content"\n set="visible: presence.tabContent.${t}; styles: presence.tabContentStyles"\n >\n <uc-editor-scroller hidden-scrollbar>\n <div class="uc-controls-list_align">\n <div\n role="listbox"\n aria-orientation="horizontal"\n class="uc-controls-list_inner"\n ref="controls-list-${t}"\n ></div>\n </div>\n </uc-editor-scroller>\n </uc-presence-toggle>\n `}).join("")}</div>\n <div class="uc-controls-row">\n <uc-presence-toggle\n class="uc-tab-toggles"\n set="visible: presence.tabToggles; styles: presence.tabTogglesStyles"\n >\n <div ref="tabs-indicator" class="uc-tab-toggles_indicator"></div>\n ${go.map(function(t){return`\n <uc-presence-toggle\n class="uc-tab-toggle"\n set="visible: presence.tabToggle.${t}; styles: presence.tabToggleStyles;"\n >\n <uc-btn-ui\n theme="tab"\n ref="tab-toggle-${t}"\n data-id="${t}"\n icon="${t}"\n set="onclick: on.clickTab; aria-role:tab_role; aria-controls:tab_${t}; title-prop: a11y-editor-tab-${t}"\n >\n </uc-btn-ui>\n </uc-presence-toggle>\n `}).join("")}\n </uc-presence-toggle>\n <uc-btn-ui style="order: -1" theme="secondary-icon" icon="closeMax" set="onclick: on.cancel; title-prop:cancel">\n </uc-btn-ui>\n <uc-btn-ui theme="primary-icon" icon="done" set="onclick: on.apply; title-prop:apply"> </uc-btn-ui>\n </div>\n </uc-presence-toggle>\n <uc-presence-toggle\n class="uc-sub-toolbar"\n set="visible: presence.subToolbar; styles: presence.subBottomToolbarStyles"\n >\n <div class="uc-slider" set="@hidden:!hideSliderOrList">\n <uc-editor-slider ref="slider-el"></uc-editor-slider>\n </div>\n\n <div set="@hidden:hideSliderOrList" class="uc-list-aspect-ratio-container">\n <div class="uc-list-aspect-ratio" ref="list-el"></div>\n </div>\n <div class="uc-controls-row">\n <uc-btn-ui theme="secondary" set="onclick: on.cancelSlider" l10n="@text:cancel"> </uc-btn-ui>\n <uc-btn-ui theme="primary" set="onclick: on.applySlider" l10n="@text:apply"> </uc-btn-ui>\n </div>\n </uc-presence-toggle>\n </div>\n`;var ja=class extends Yo{_iconReversed=!1;_iconSingle=!1;_iconHidden=!1;constructor(){super(),this.init$={...this.init$,text:"",icon:"",iconCss:this._iconCss(),theme:null,"aria-role":"","aria-controls":"","title-prop":""},this.defineAccessor("active",t=>{t?this.setAttribute("active",""):this.removeAttribute("active")})}_iconCss(){return ya("uc-icon",{"uc-icon_left":!this._iconReversed,"uc-icon_right":this._iconReversed,"uc-icon_hidden":this._iconHidden,"uc-icon_single":this._iconSingle})}initCallback(){super.initCallback(),this.sub("icon",t=>{this._iconSingle=!this.$.text,this._iconHidden=!t,this.$.iconCss=this._iconCss()}),this.sub("theme",t=>{t&&"custom"!==t&&(this.className=`uc-${t}`)}),this.sub("text",()=>{this._iconSingle=!1}),this.hasAttribute("theme")||this.setAttribute("theme","default"),this.defineAccessor("aria-role",t=>{this.$["aria-role"]=t||""}),this.defineAccessor("aria-controls",t=>{this.$["aria-controls"]=t||""}),this.defineAccessor("title-prop",t=>{this.$["title-prop"]=t||""})}set reverse(t){this.hasAttribute("reverse")?(this.style.flexDirection="row-reverse",this._iconReversed=!0):(this._iconReversed=!1,this.style.flexDirection="")}};ja.bindAttributes({text:"text",icon:"icon",reverse:"reverse",theme:"theme"}),ja.template='\n <button\n type="button"\n set="@role:aria-role; @aria-controls: aria-controls; @aria-label:title-prop"\n l10n="@title:title-prop;"\n >\n <uc-icon set="className: iconCss; @name: icon; @hidden: !icon"></uc-icon>\n <div class="uc-text">{{text}}</div>\n </button>\n';var Ha=class extends Yo{_active=!1;_handleTransitionEndRight=()=>{const t=this.ref["line-el"];t.style.transition="initial",t.style.opacity="0",t.style.transform="translateX(-101%)",this._active&&this._start()};initCallback(){super.initCallback(),this.defineAccessor("active",t=>{"boolean"==typeof t&&(t?this._start():this._stop())})}_start(){this._active=!0;const{width:t}=this.getBoundingClientRect(),e=this.ref["line-el"];e.style.transition="transform 1s",e.style.opacity="1",e.style.transform=`translateX(${t}px)`,e.addEventListener("transitionend",this._handleTransitionEndRight,{once:!0})}_stop(){this._active=!1}};Ha.template='\n <div class="uc-inner">\n <div class="uc-line" ref="line-el"></div>\n </div>\n';var qa="uc-transition",Ka="uc-visible",Ga="uc-hidden",Wa=class extends Yo{_visible=!1;_visibleStyle=Ka;_hiddenStyle=Ga;_externalTransitions=!1;constructor(){super(),this.defineAccessor("styles",t=>{t&&(this._externalTransitions=!0,this._visibleStyle=t.visible??Ka,this._hiddenStyle=t.hidden??Ga)}),this.defineAccessor("visible",t=>{"boolean"==typeof t&&(this._visible=t,this._handleVisible())})}_handleVisible(){this.style.visibility=this._visible?"inherit":"hidden",function(t,...e){const r=va(...e);for(const e of Object.keys(r))t.classList.toggle(e,Boolean(r[e]))}(this,{[qa]:!this._externalTransitions,[this._visibleStyle]:this._visible,[this._hiddenStyle]:!this._visible}),this.setAttribute("aria-hidden",this._visible?"false":"true")}initCallback(){super.initCallback(),this.classList.toggle("uc-initial",!0),this._externalTransitions||this.classList.add(qa),this._handleVisible(),setTimeout(()=>{this.classList.toggle("uc-initial",!1)},0)}};Wa.template="<slot></slot> ";var Xa=class extends Yo{_observer;_thumbSize=0;_zero=0;_zeroDotEl;_stepsCount;constructor(){super(),this.init$={...this.init$,disabled:!1,min:0,max:100,onInput:null,onChange:null,defaultValue:0,"on.sliderInput":()=>{const t=Number.parseInt(this._inputEl().value,10);this._updateValue(t),this.$.onInput?.(t)},"on.sliderChange":()=>{const t=Number.parseInt(this._inputEl().value,10);this.$.onChange?.(t)}},this.setAttribute("with-effects","")}initCallback(){super.initCallback(),this.defineAccessor("disabled",t=>{this.$.disabled=t}),this.defineAccessor("min",t=>{this.$.min=t}),this.defineAccessor("max",t=>{this.$.max=t}),this.defineAccessor("defaultValue",t=>{this.$.defaultValue=t;this._inputEl().value=String(t),this._updateValue(t)}),this.defineAccessor("zero",t=>{this._zero=t}),this.defineAccessor("onInput",t=>{t&&(this.$.onInput=t)}),this.defineAccessor("onChange",t=>{t&&(this.$.onChange=t)}),this._updateSteps(),this._observer=new ResizeObserver(()=>{this._updateSteps();const t=Number.parseInt(this._inputEl().value,10);this._updateValue(t)}),this._observer.observe(this),this._thumbSize=Number.parseInt(window.getComputedStyle(this).getPropertyValue("--l-thumb-size"),10),setTimeout(()=>{const t=Number.parseInt(this._inputEl().value,10);this._updateValue(t)},0),this.sub("disabled",t=>{const e=this._inputEl();t?e.setAttribute("disabled","disabled"):e.removeAttribute("disabled")});const t=this._inputEl();t.addEventListener("focus",()=>{this.style.setProperty("--color-effect","var(--hover-color-rgb)")}),t.addEventListener("blur",()=>{this.style.setProperty("--color-effect","var(--idle-color-rgb)")})}_inputEl(){return this.ref["input-el"]}_thumbEl(){return this.ref["thumb-el"]}_stepsEl(){return this.ref["steps-el"]}_updateValue(t){this._updateZeroDot(t);const{width:e}=this.getBoundingClientRect(),r=100/(this.$.max-this.$.min)*(t-this.$.min)*(e-this._thumbSize)/100;window.requestAnimationFrame(()=>{this._thumbEl().style.transform=`translateX(${r}px)`})}_updateZeroDot(t){if(!this._zeroDotEl)return;this._zeroDotEl.style.opacity=t===this._zero?"0":"1";const{width:e}=this.getBoundingClientRect(),r=100/(this.$.max-this.$.min)*(this._zero-this.$.min)*(e-this._thumbSize)/100;window.requestAnimationFrame(()=>{this._zeroDotEl&&(this._zeroDotEl.style.transform=`translateX(${r}px)`)})}_updateSteps(){const t=this._stepsEl(),{width:e}=t.getBoundingClientRect(),r=Math.ceil(e/2),i=Math.ceil(r/15)-2;if(this._stepsCount===i)return;const o=document.createDocumentFragment(),n=document.createElement("div"),a=document.createElement("div");n.className="uc-minor-step",a.className="uc-border-step",o.appendChild(a);for(let t=0;t<i;t+=1)o.appendChild(n.cloneNode());o.appendChild(a.cloneNode());for(let t=0;t<i;t+=1)o.appendChild(n.cloneNode());o.appendChild(a.cloneNode());const s=document.createElement("div");s.className="uc-zero-dot",o.appendChild(s),this._zeroDotEl=s,t.innerHTML="",t.appendChild(o),this._stepsCount=i}destroyCallback(){super.destroyCallback(),this._observer?.disconnect()}};Xa.template='\n <div class="uc-steps" ref="steps-el"></div>\n <div ref="thumb-el" class="uc-thumb"></div>\n <input\n class="uc-input"\n type="range"\n ref="input-el"\n set="oninput: on.sliderInput; onchange: on.sliderChange; @min: min; @max: max; @value: defaultValue;"\n />\n';var Za=class extends la{couldBeCtxOwner=!0;activityType=tn.activities.CLOUD_IMG_EDIT;_entry;_instance;get activityParams(){const t=super.activityParams;if("internalId"in t)return t;throw new Error("Cloud Image Editor activity params not found")}initCallback(){super.initCallback(),this.registerActivity(this.activityType,{onActivate:()=>this.mountEditor(),onDeactivate:()=>this.unmountEditor()}),this.subConfigValue("cropPreset",t=>{this._instance&&this._instance.getAttribute("crop-preset")!==t&&this._instance.setAttribute("crop-preset",t)}),this.subConfigValue("cloudImageEditorTabs",t=>{this._instance&&this._instance.getAttribute("tabs")!==t&&this._instance.setAttribute("tabs",t)})}handleApply(t){if(!this._entry)return;const e=t.detail;this._entry.setMultipleValues({cdnUrl:e.cdnUrl,cdnUrlModifiers:e.cdnUrlModifiers}),this.modalManager?.close(tn.activities.CLOUD_IMG_EDIT),this.historyBack()}handleCancel(){this.modalManager?.close(tn.activities.CLOUD_IMG_EDIT),this.historyBack()}mountEditor(){const{internalId:t}=this.activityParams,e=this.uploadCollection.read(t);if(!e)throw new Error(`Entry with internalId "${t}" not found`);this._entry=e;const r=this._entry.getValue("cdnUrl");if(!r)throw new Error(`Entry with internalId "${t}" hasn't uploaded yet`);const i=new ka,o=this.cfg.cropPreset,n=this.cfg.cloudImageEditorTabs;i.setAttribute("ctx-name",this.ctxName),i.setAttribute("cdn-url",r),o&&i.setAttribute("crop-preset",o),n&&i.setAttribute("tabs",n),i.addEventListener("apply",t=>{const e=t;this.handleApply(e),this.debugPrint('editor event "apply"',e.detail)}),i.addEventListener("cancel",t=>{const e=t;this.handleCancel(),this.debugPrint('editor event "cancel"',e.detail)}),i.addEventListener("change",t=>{const e=t;this.debugPrint('editor event "change"',e.detail)}),this.innerHTML="",this.appendChild(i),this._instance=i}unmountEditor(){this._instance=void 0,this._entry=void 0,this.innerHTML=""}},Ya=t=>t.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)?.map(t=>t.toLowerCase()).join("-"),Qa=[{test:t=>!!t.accept&&!!t.imgOnly,message:"There could be a mistake.\nBoth `accept` and `imgOnly` parameters are set.\nThe value of `accept` will be concatenated with the internal image mime types list."},{test:t=>null!==t.enableVideoRecording,message:"The `enableVideoRecording` parameter is deprecated and will be removed in the next major release.\nPlease use the `cameraModes` parameter instead."},{test:t=>null!==t.defaultCameraMode,message:"The `defaultCameraMode` parameter is deprecated and will be removed in the next major release.\nPlease use the `cameraModes` parameter instead."}],Ja=Bi(t=>{for(const{test:e,message:r}of Qa)e(t)&&na(r)},0),ts=t=>t instanceof Promise||Boolean(t&&"object"==typeof t&&"then"in t&&"function"==typeof t.then),es=[{key:"cameraModes",deps:["enableVideoRecording"],fn:({cameraModes:t,enableVideoRecording:e})=>{if(null===e)return t;let r=ji(t);return e&&!r.includes("video")?r=r.concat("video"):e||(r=r.filter(t=>"video"!==t)),Hi(r)}},{key:"cameraModes",deps:["defaultCameraMode"],fn:({cameraModes:t,defaultCameraMode:e})=>{if(null===e)return t;let r=ji(t);return r=r.sort((t,r)=>t===e?-1:r===e?1:0),Hi(r)}},{key:"cdnCname",deps:["pubkey","cdnCnamePrefixed"],fn:({pubkey:t,cdnCname:e,cdnCnamePrefixed:r})=>t&&(e===wo||((t,e)=>{try{const r=new URL(t),i=new URL(e);return r.hostname.endsWith(i.hostname)}catch{return!1}})(e,r))?li(t,r):e}],rs=({key:t,setValue:e,getValue:r,computationControllers:i})=>{for(const o of es)if(o.deps.includes(t)){const t={[o.key]:r(o.key)};for(const e of o.deps)t[e]=r(e);const n=new AbortController;let a;i.get(o.key)?.abort(),i.set(o.key,n);try{a=o.fn(t,{signal:n.signal})}catch(t){return i.get(o.key)===n&&i.delete(o.key),void console.error(`Failed to compute value for "${o.key}"`,t)}ts(a)?a.then(t=>{n.signal.aborted||e(o.key,t)}).catch(t=>{n.signal.aborted||console.error(`Failed to compute value for "${o.key}"`,t)}).finally(()=>{i.get(o.key)===n&&i.delete(o.key)}):e(o.key,a)}},is=t=>String(t),os=t=>{const e=Number(t);if(Number.isNaN(e))throw new Error(`Invalid number: "${t}"`);return e},ns=t=>{if(null==t)return!1;if("boolean"==typeof t)return t;if("true"===t)return!0;if(""===t)return!0;if("false"===t)return!1;throw new Error(`Invalid boolean: "${t}"`)},as=t=>{if("object"==typeof t)return t;throw new Error("Invalid value. Must be an object.")},ss=t=>{if("function"==typeof t)return t;throw new Error("Invalid value. Must be a function.")},cs=t=>{if(Array.isArray(t))return t;throw new Error("Must be an array.")},ls={pubkey:is,multiple:ns,multipleMin:os,multipleMax:os,confirmUpload:ns,imgOnly:ns,accept:is,externalSourcesPreferredTypes:is,externalSourcesEmbedCss:is,store:t=>"auto"===t?t:ns(t),cameraMirror:ns,cameraCapture:t=>{const e=is(t);if("user"!==e&&"environment"!==e&&""!==e)throw new Error(`Invalid value: "${e}"`);return e},sourceList:is,topLevelOrigin:is,maxLocalFileSizeBytes:os,thumbSize:os,showEmptyList:ns,useLocalImageEditor:ns,useCloudImageEditor:ns,cloudImageEditorTabs:is,removeCopyright:ns,cropPreset:is,imageShrink:is,modalScrollLock:ns,modalBackdropStrokes:ns,sourceListWrap:ns,remoteTabSessionKey:is,cdnCname:is,cdnCnamePrefixed:is,baseUrl:is,socialBaseUrl:is,secureSignature:is,secureExpire:is,secureDeliveryProxy:is,retryThrottledRequestMaxTimes:os,retryNetworkErrorMaxTimes:os,multipartMinFileSize:os,multipartChunkSize:os,maxConcurrentRequests:os,multipartMaxConcurrentRequests:os,multipartMaxAttempts:os,checkForUrlDuplicates:ns,saveUrlForRecurrentUploads:ns,groupOutput:ns,userAgentIntegration:is,debug:ns,localeName:is,metadata:t=>{if("object"==typeof t&&!Array.isArray(t))return t;if("function"==typeof t)return t;throw new Error("Invalid metadata value. Must be an object or function.")},secureUploadsExpireThreshold:os,localeDefinitionOverride:t=>as(t),secureUploadsSignatureResolver:t=>ss(t),secureDeliveryProxyUrlResolver:t=>ss(t),iconHrefResolver:t=>ss(t),fileValidators:cs,collectionValidators:cs,validationTimeout:os,validationConcurrency:os,cameraModes:t=>{const e=is(t),r=ji(e);if(r.some(t=>!Object.values(Jn).includes(t)))throw new Error(`Invalid value: "${JSON.stringify(r)}"`);return e},defaultCameraMode:t=>{const e=is(t);if(!Object.values(Jn).includes(e))throw new Error(`Invalid value: "${e}"`);return e},enableAudioRecording:ns,enableVideoRecording:ns,mediaRecorderOptions:as,maxVideoRecordingDuration:os,filesViewMode:t=>{const e=is(t);if(["grid","list"].includes(e))return e;throw new Error(`Invalid value: "${e}"`)},gridShowFileNames:ns,cloudImageEditorAutoOpen:ns,cloudImageEditorMaskHref:is,testMode:ns,qualityInsights:ns},us=[...new Set(["debug",...Object.keys(ko)])],ds=["metadata","localeDefinitionOverride","secureUploadsSignatureResolver","secureDeliveryProxyUrlResolver","iconHrefResolver","fileValidators","collectionValidators","mediaRecorderOptions"],hs=t=>ds.includes(t),ps=us.filter(t=>!hs(t)),gs={...Object.fromEntries(ps.map(t=>[Ya(t),t])),...Object.fromEntries(ps.map(t=>[t.toLowerCase(),t]))},ms={...Object.fromEntries(ps.map(t=>[Ya(t),Xo(t)])),...Object.fromEntries(ps.map(t=>[t.toLowerCase(),Xo(t)]))},bs=t=>`__${t}`,fs=class extends Yo{requireCtxName=!0;constructor(){super(),this.init$={...this.init$,...Object.fromEntries(Object.entries(ko).map(([t,e])=>[Xo(t),e])),computationControllers:new Map}}_flushValueToAttribute(t,e){if(!hs(t)){const r=[...new Set([Ya(t),t.toLowerCase()])];for(const t of r)null==e?this.removeAttribute(t):this.getAttribute(t)!==e.toString()&&this.setAttribute(t,e.toString())}}_flushValueToState(t,e){this.$[Xo(t)]!==e&&(this.$[Xo(t)]=null==e?ko[t]:e)}_setValue(t,e){const r=this,i=((t,e)=>{if(null!=e)try{return ls[t](e)}catch(e){return console.error(`Invalid value for config key "${t}".`,e),ko[t]}})(t,e),o=bs(t);r[o]!==i&&(this._assertSameValueDifferentReference(t,r[o],i),r[o]=i,this._flushValueToAttribute(t,i),this._flushValueToState(t,i),this.debugPrint(`[uc-config] "${t}"`,i),Ja(this.cfg))}_getValue(t){return this[bs(t)]??this.$[Xo(t)]}_assertSameValueDifferentReference(t,e,r){this.cfg.debug&&r!==e&&"object"==typeof r&&"object"==typeof e&&JSON.stringify(r)===JSON.stringify(e)&&(console.warn(`[uc-config] Option "${t}" value is the same as the previous one but the reference is different`),console.warn("[uc-config] You should avoid changing the reference of the object to prevent unnecessary calculations"),console.warn(`[uc-config] "${t}" previous value:`,e),console.warn(`[uc-config] "${t}" new value:`,r))}initCallback(){super.initCallback();const t=this;for(const t of ps)this.sub(Xo(t),e=>{this._setValue(t,e)},!1);for(const e of us){const r=t[e]??this.$[Xo(e)];r!==ko[e]&&this._setValue(e,r),Object.defineProperty(this,e,{set:t=>{this._setValue(e,t)},get:()=>this._getValue(e)})}for(const t of us)this.sub(Xo(t),()=>{rs({key:t,setValue:this._setValue.bind(this),getValue:this._getValue.bind(this),computationControllers:this.computationControllers})})}attributeChangedCallback(t,e,r){if(e===r)return;const i=this,o=gs[t];o&&(i[o]=r)}get computationControllers(){return this.$.computationControllers}};fs.bindAttributes(ms);for(const t of us)fs.prototype[t]=void 0;var vs=class extends Yo{initCallback(){super.initCallback(),this.subConfigValue("removeCopyright",t=>{this.toggleAttribute("hidden",!!t)})}static template='\n <a\n href="https://uploadcare.com/?utm_source=copyright&utm_medium=referral&utm_campaign=v4"\n target="_blank noopener"\n class="uc-credits"\n >Powered by Uploadcare</a\n >\n '};function ys(t){return new Promise(e=>{"function"!=typeof window.FileReader&&e(!1);try{const r=new FileReader;r.onerror=()=>{e(!0)};const i=t=>{"loadend"!==t.type&&r.abort(),e(!1)};r.onloadend=i,r.onprogress=i,r.readAsDataURL(t)}catch{e(!1)}})}function ws(t,e){return new Promise(r=>{let i=0;const o=[],n=t=>{if(!t)return console.warn("Unexpectedly received empty content entry",{scope:"drag-and-drop"}),void r(null);t.isFile?(i++,t.file(n=>{i--;const a=new File([n],n.name,{type:n.type||e});o.push({type:"file",file:a,fullPath:t.fullPath}),0===i&&r(o)})):t.isDirectory&&a(t.createReader())},a=t=>{i++,t.readEntries(t=>{i--;for(const e of t)n(e);0===i&&r(o)})};n(t)})}var _s=Object.freeze({ACTIVE:0,INACTIVE:1,NEAR:2,OVER:3}),ks=["focus"],xs=new Map;function Cs(t){let e=0;const r=document.body,i=new Set;let o=_s.INACTIVE;const n=e=>{t.shouldIgnore()&&e!==_s.INACTIVE||(o!==e&&i.forEach(t=>{t(e)}),o=e)},a=()=>e>0;var s;s=e=>t.onChange(e),i.add(s);const c=()=>{e=0,n(_s.INACTIVE)},l=()=>{e+=1,o===_s.INACTIVE&&n(_s.ACTIVE)},u=()=>{e-=1,a()||n(_s.INACTIVE)},d=t=>{t.preventDefault(),e=0,n(_s.INACTIVE)},h=r=>{if(t.shouldIgnore())return;a()||(e+=1);const i=[r.x,r.y],o=t.element.getBoundingClientRect(),s=Math.floor(function(t,e){const r=Math.max(Math.min(t[0],e.x+e.width),e.x),i=Math.max(Math.min(t[1],e.y+e.height),e.y);return Math.sqrt((t[0]-r)*(t[0]-r)+(t[1]-i)*(t[1]-i))}(i,o)),c=s<100,l=r.composedPath().includes(t.element);xs.set(t.element,s);const u=Math.min(...xs.values())===s;l&&u?(r.preventDefault(),n(_s.OVER)):n(c&&u?_s.NEAR:_s.ACTIVE)},p=async e=>{if(t.shouldIgnore())return;e.preventDefault();const{dataTransfer:r}=e;if(!r)return;const i=await function(t){const e=[],r=[];for(let i=0;i<t.items.length;i++){const o=t.items[i];if(o)if("file"===o.kind){const t=o.type,i=o;if("function"==typeof i.webkitGetAsEntry||"function"==typeof i.getAsEntry){const o="function"==typeof i.webkitGetAsEntry?i.webkitGetAsEntry():i.getAsEntry?.();o&&r.push(ws(o,t).then(t=>{t&&e.push(...t)}));continue}const n=o.getAsFile();n&&r.push(ys(n).then(t=>{t||e.push({type:"file",file:n})}))}else"string"===o.kind&&/^text\/uri-list/.test(o.type)&&r.push(new Promise(t=>{o.getAsString(r=>{e.push({type:"url",url:r}),t()})}))}return Promise.all(r).then(()=>e)}(r);t.onItems(i),n(_s.INACTIVE)};return r.addEventListener("drop",d),r.addEventListener("dragleave",u),r.addEventListener("dragenter",l),r.addEventListener("dragover",h),t.element.addEventListener("drop",p),ks.forEach(t=>{window.addEventListener(t,c)}),()=>{xs.delete(t.element),r.removeEventListener("drop",d),r.removeEventListener("dragleave",u),r.removeEventListener("dragenter",l),r.removeEventListener("dragover",h),t.element.removeEventListener("drop",p),ks.forEach(t=>{window.removeEventListener(t,c)})}}var Es="uc-drop-area",Ts=`${Es}/registry`,As=class extends la{static styleAttrs=[...super.styleAttrs,"uc-drop-area"];_destroyDropzone=null;_destroyContentWrapperDropzone=null;_onAreaClicked=null;constructor(){super(),this.init$={...this.init$,state:_s.INACTIVE,withIcon:!1,isClickable:!1,isFullscreen:!1,isEnabled:!0,isVisible:!0,isInitFlow:!1,text:"",[Ts]:new Set}}isActive(){if(!this.$.isEnabled)return!1;const t=this.getBoundingClientRect(),e=t.width>0&&t.height>0,r=t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth),i=window.getComputedStyle(this),o="hidden"!==i.visibility&&"none"!==i.display;return e&&o&&r}initCallback(){super.initCallback(),this.bindL10n("text",()=>this.l10n("drop-files-here"));this.$[Ts].add(this),this.defineAccessor("disabled",t=>{this.set$({isEnabled:!ns(t)})}),this.defineAccessor("clickable",t=>{this.set$({isClickable:ns(t)})}),this.defineAccessor("initflow",t=>{this.set$({isInitFlow:ns(t)})}),this.defineAccessor("with-icon",t=>{this.set$({withIcon:ns(t)})}),this.defineAccessor("fullscreen",t=>{this.set$({isFullscreen:ns(t)})}),this.defineAccessor("text",t=>{"string"==typeof t?this.bindL10n("text",()=>this.l10n(t)||t):this.bindL10n("text",()=>this.l10n("drop-files-here"))}),this._destroyDropzone=Cs({element:this,shouldIgnore:()=>this._shouldIgnore(),onChange:t=>{this.$.state=t},onItems:t=>{t.length&&(t.forEach(t=>{"url"===t.type?this.api.addFileFromUrl(t.url,{source:kn.DROP_AREA}):"file"===t.type&&this.api.addFileFromObject(t.file,{source:kn.DROP_AREA,fullPath:t.fullPath})}),this.uploadCollection.size&&(this.modalManager?.open(tn.activities.UPLOAD_LIST),this.set$({"*currentActivity":tn.activities.UPLOAD_LIST})))}});const t=this.ref["content-wrapper"];if(t&&(this._destroyContentWrapperDropzone=Cs({element:t,onChange:e=>{const r=Object.entries(_s).find(([,t])=>t===e)?.[0].toLowerCase();r&&t.setAttribute("drag-state",r)},onItems:()=>{},shouldIgnore:()=>this._shouldIgnore()})),this.sub("state",t=>{const e=Object.entries(_s).find(([,e])=>e===t)?.[0].toLowerCase();e&&this.setAttribute("drag-state",e)}),this.subConfigValue("sourceList",t=>{const e=io(t);this.$.isEnabled=e.includes(kn.LOCAL),this.$.isVisible=this.$.isEnabled||!this.querySelector("[data-default-slot]")}),this.sub("isVisible",t=>{this.toggleAttribute("hidden",!t)}),this.sub("isClickable",t=>{this.toggleAttribute("clickable",t)}),this.$.isClickable){const t=t=>{if(t instanceof KeyboardEvent){if("Space"===t.code||"Enter"===t.code){if(this.$.isInitFlow)return void this.api.initFlow();this.api.openSystemDialog()}}else if(t instanceof MouseEvent){if(this.$.isInitFlow)return void this.api.initFlow();this.api.openSystemDialog()}};this._onAreaClicked=t,this.addEventListener("keydown",t),this.addEventListener("click",t)}}_shouldIgnore(){if(!this.$.isEnabled)return!0;if(!this._couldHandleFiles())return!0;if(!this.$.isFullscreen)return!1;const t=this.$[Ts];if(0===t.size)return!1;return[...t].filter(t=>t!==this).filter(t=>t.isActive()).length>0}_couldHandleFiles(){const t=this.cfg.multiple,e=this.cfg.multipleMax,r=this.uploadCollection.size;return!(t&&e&&r>=e)&&!(!t&&r>0)}destroyCallback(){super.destroyCallback();const t=this.$[Ts];t.delete(this),0===t.size&&we.deleteCtx(Es),this._destroyDropzone?.(),this._destroyContentWrapperDropzone?.(),this._onAreaClicked&&(this.removeEventListener("keydown",this._onAreaClicked),this.removeEventListener("click",this._onAreaClicked),this._onAreaClicked=null)}};As.template='\n <slot>\n <div data-default-slot hidden></div>\n <div ref="content-wrapper" class="uc-content-wrapper" set="@hidden: !isVisible">\n <div class="uc-icon-container" set="@hidden: !withIcon">\n <uc-icon name="default"></uc-icon>\n <uc-icon name="arrow-down"></uc-icon>\n </div>\n <span class="uc-text">{{text}}</span>\n </div>\n </slot>\n',As.bindAttributes({"with-icon":null,clickable:null,text:null,fullscreen:null,disabled:null,initflow:null});var Is=()=>{const t=globalThis.top??globalThis.parent??globalThis.self;try{return t.location.origin}catch(t){return console.warn("Unable to access top-level window location:",t),globalThis.location.origin}},Ss=t=>t.replace(/[\\-\\[]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),Ms=(t,e="i")=>{const r=t.split("*").map(Ss);return new RegExp(`^${r.join(".+")}$`,e)},$s=["--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"],Ls=(t,e)=>window.getComputedStyle(t).getPropertyValue(e).trim(),Os=t=>{const e={};for(const r of $s){const i=Ls(t,r);i&&(e[r]=i)}return e},Rs=["selected-files-change","toolbar-state-change"],Us=class{_handlerMap=new Map;_context;_getTargetOrigin;constructor(t,e){this._context=t,this._getTargetOrigin=e,window.addEventListener("message",this._handleMessage)}_handleMessage=t=>{if(t.source!==this._context)return;const e=t.data;if(!(t=>{if(!t)return!1;if("object"!=typeof t)return!1;if(!("type"in t))return!1;const e=t.type;return"string"==typeof e&&!!Rs.includes(e)})(e))return;const r=this._handlerMap.get(e.type);if(r)for(const t of r)t(e)};on(t,e){const r=this._handlerMap.get(t)??new Set;this._handlerMap.has(t)||this._handlerMap.set(t,r),r.add(e)}send(t){const e=this._getTargetOrigin();this._context.postMessage(t,e)}destroy(){window.removeEventListener("message",this._handleMessage)}};var Ps={[wn.GDRIVE]:"ngdrive"},Ns=class extends la{couldBeCtxOwner=!0;activityType=tn.activities.EXTERNAL;_messageBridge;constructor(){super(),this.init$={...this.init$,activityIcon:"",activityCaption:"",selectedList:[],total:0,isSelectionReady:!1,isDoneBtnEnabled:!1,couldSelectAll:!1,couldDeselectAll:!1,showSelectionStatus:!1,showDoneBtn:!1,counterText:"",doneBtnTextClass:"uc-hidden",toolbarVisible:!0,onDone:()=>{for(const t of this.$.selectedList){const e=this.extractUrlFromSelectedFile(t),{filename:r}=t,{externalSourceType:i}=this.activityParams;this.api.addFileFromUrl(e,{fileName:r,source:i})}this.$["*currentActivity"]=tn.activities.UPLOAD_LIST,this.modalManager?.open(tn.activities.UPLOAD_LIST)},onCancel:()=>{this.historyBack()},onSelectAll:()=>{this._messageBridge?.send({type:"select-all"})},onDeselectAll:()=>{this._messageBridge?.send({type:"deselect-all"})}}}get activityParams(){const t=super.activityParams;if("externalSourceType"in t)return t;throw new Error("External Source activity params not found")}initCallback(){super.initCallback(),this.registerActivity(this.activityType,{onActivate:()=>{const{externalSourceType:t}=this.activityParams;if(!t)return this.modalManager?.close(this.$["*currentActivity"]),this.$["*currentActivity"]=null,void console.error(`Param "externalSourceType" is required for activity "${this.activityType}"`);this.set$({activityCaption:`${t[0]?.toUpperCase()}${t?.slice(1)}`,activityIcon:t}),this.mountIframe()}}),this.sub("*currentActivityParams",t=>{this.isActivityActive&&(this.unmountIframe(),this.mountIframe())}),this.sub("*currentActivity",t=>{t!==this.activityType&&this.unmountIframe()}),this.subConfigValue("multiple",t=>{this.$.showSelectionStatus=t}),this.subConfigValue("localeName",t=>{this.setupL10n()}),this.subConfigValue("externalSourcesEmbedCss",t=>{this.applyEmbedCss(t)})}extractUrlFromSelectedFile(t){if(t.alternatives){const e=io(this.cfg.externalSourcesPreferredTypes);for(const r of e){const e=Ms(r);for(const[r,i]of Object.entries(t.alternatives))if(e.test(r))return i}}return t.url}handleToolbarStateChange(t){this.set$({toolbarVisible:t.isVisible})}async handleSelectedFilesChange(t){this.cfg.multiple===t.isMultipleMode?(this.bindL10n("counterText",()=>this.l10n("selected-count",{count:t.selectedCount,total:t.total})),this.set$({doneBtnTextClass:t.isReady?"":"uc-hidden",isSelectionReady:t.isReady,isDoneBtnEnabled:t.isReady&&t.selectedFiles.length>0,showSelectionStatus:t.isMultipleMode&&t.total>0,couldSelectAll:t.selectedCount<t.total,couldDeselectAll:t.selectedCount===t.total,selectedList:t.selectedFiles,showDoneBtn:t.total>0})):console.error("Multiple mode mismatch")}handleIframeLoad(){this.applyEmbedCss(this.cfg.externalSourcesEmbedCss),this.applyTheme(),this.setupL10n()}applyTheme(){this._messageBridge?.send({type:"set-theme-definition",theme:Os(this)})}applyEmbedCss(t){this._messageBridge?.send({type:"set-embed-css",css:t})}setupL10n(){this._messageBridge?.send({type:"set-locale-definition",localeDefinition:this.cfg.localeName})}remoteUrl(){const{pubkey:t,remoteTabSessionKey:e,socialBaseUrl:r,multiple:i}=this.cfg,{externalSourceType:o}=this.activityParams,n=Ps[o]??o,a={lang:this.l10n("social-source-lang")?.split("-")?.[0]||"en",public_key:t,images_only:(!1).toString(),session_key:e,wait_for_theme:!0,multiple:i.toString(),origin:this.cfg.topLevelOrigin||Is(),debug:this.cfg.debug},s=new URL(`/window4/${n}`,r);return s.search=function(t){const e=[];for(const[r,i]of Object.entries(t))null==i||"string"==typeof i&&0===i.length||e.push(`${r}=${encodeURIComponent(i)}`);return e.join("&")}(a),s.toString()}mountIframe(){const t=Fe({tag:"iframe",attributes:{src:this.remoteUrl(),marginheight:0,marginwidth:0,frameborder:0,allowTransparency:!0}});t.addEventListener("load",this.handleIframeLoad.bind(this)),this.ref.iframeWrapper.innerHTML="",this.ref.iframeWrapper.appendChild(t),t.contentWindow&&(this._messageBridge?.destroy(),this._messageBridge=new Us(t.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.ref.iframeWrapper.innerHTML="",this.resetSelectionStatus()}resetSelectionStatus(){this.set$({selectedList:[],total:0,isDoneBtnEnabled:!1,couldSelectAll:!1,couldDeselectAll:!1,showSelectionStatus:!1,showDoneBtn:!1})}};Ns.template='\n <uc-activity-header>\n <button\n type="button"\n class="uc-mini-btn uc-close-btn"\n set="onclick: *historyBack"\n l10n="@title:a11y-activity-header-button-close;@aria-label:a11y-activity-header-button-close"\n >\n <uc-icon name="close"></uc-icon>\n </button>\n </uc-activity-header>\n <div class="uc-content">\n <div ref="iframeWrapper" class="uc-iframe-wrapper"></div>\n <div class="uc-toolbar" set="@hidden: !toolbarVisible">\n <button type="button" class="uc-cancel-btn uc-secondary-btn" set="onclick: onCancel" l10n="cancel"></button>\n <div set="@hidden: !showSelectionStatus" class="uc-selection-status-box">\n <span>{{counterText}}</span>\n <button type="button" set="onclick: onSelectAll; @hidden: !couldSelectAll" l10n="select-all"></button>\n <button type="button" set="onclick: onDeselectAll; @hidden: !couldDeselectAll" l10n="deselect-all"></button>\n </div>\n <button\n type="button"\n class="uc-done-btn uc-primary-btn"\n set="onclick: onDone; @disabled: !isDoneBtnEnabled; @hidden: !showDoneBtn"\n >\n <uc-spinner set="@hidden: isSelectionReady"></uc-spinner>\n <span l10n="done" set="@class: doneBtnTextClass"></span>\n </button>\n </div>\n </div>\n';var zs=/^([0-9]+)x([0-9]+)(?:\s+(\d{1,2}|100)%)?$/i,Ds=class extends la{_entrySubs=new Set;_entry=null;_withEntry(t){return(...e)=>{const r=this._entry;if(r)return t(r,...e);console.warn("No entry found")}}_subEntry(t,e){this._withEntry((t,e,r)=>{const i=t.subscribe(e,t=>{this.isConnected&&r(t)});this._entrySubs.add(i)})(t,e)}_reset(){for(const t of this._entrySubs)t.remove();this._entrySubs=new Set,this._entry=null}disconnectedCallback(){super.disconnectedCallback(),this._entrySubs=new Set}},Fs=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")}),Vs=class t extends Ds{couldBeCtxOwner=!0;pauseRender=!0;_renderedOnce=!1;_observer;_isIntersecting=!1;_thumbRect;constructor(){super(),this.init$={...this.init$,uid:"",itemName:"",errorText:"",hint:"",thumbUrl:"",progressValue:0,progressVisible:!1,badgeIcon:"",isFinished:!1,isFailed:!1,isUploading:!1,isFocused:!1,isEditable:!1,showFileNames:!1,state:Fs.IDLE,ariaLabelStatusFile:"",onEdit:this._withEntry(t=>{this.telemetryManager.sendEvent({eventType:Di.ACTION_EVENT,payload:{metadata:{event:"edit-file",node:this.tagName}}}),this.$["*currentActivityParams"]={internalId:t.uid},this.modalManager?.open(tn.activities.CLOUD_IMG_EDIT),this.$["*currentActivity"]=tn.activities.CLOUD_IMG_EDIT}),onRemove:()=>{this.telemetryManager.sendEvent({eventType:Di.ACTION_EVENT,payload:{metadata:{event:"remove-file",node:this.tagName}}}),this.uploadCollection.remove(this.$.uid)},onUpload:()=>{this.upload()}}}_calculateState=this._withEntry(t=>{let e=Fs.IDLE;t.getValue("errors").length>0?e=Fs.FAILED:t.getValue("isQueuedForUploading")?e=Fs.QUEUED_UPLOADING:t.getValue("isQueuedForValidation")?e=Fs.QUEUED_VALIDATION:t.getValue("isValidationPending")?e=Fs.VALIDATION:t.getValue("isUploading")?e=Fs.UPLOADING:t.getValue("fileInfo")&&(e=Fs.FINISHED),this.$.state=e});_debouncedCalculateState=Bi(this._calculateState.bind(this),100);_updateHintAndProgress=this._withEntry(Ra((t,e)=>{const r=t.getValue("errors")?.[0]?.message,i=t.getValue("source"),o=t.getValue("externalUrl"),n=e===Fs.FINISHED,a=e===Fs.UPLOADING,s=e===Fs.QUEUED_UPLOADING,c=e===Fs.QUEUED_VALIDATION,l=e===Fs.VALIDATION,u=t.getValue("fileName");let d="";r?d="":!n&&o&&i&&Object.values(wn).includes(i)&&(d=this.l10n("waiting-for",{source:this.l10n(`src-type-${i}`)})),this.set$({hint:d,errorText:r,progressVisible:a||s||c||l,progressValue:c||l?0:t.getValue("uploadProgress"),ariaLabelStatusFile:u&&this.l10n("a11y-file-item-status",{fileName:u,status:this.l10n(e?.description?.toLocaleLowerCase()??"").toLocaleLowerCase()})})},100));_handleState=this._withEntry((t,e)=>{e===Fs.FAILED?this.$.badgeIcon="badge-error":e===Fs.FINISHED&&(this.$.badgeIcon="badge-success"),e===Fs.UPLOADING&&(this.$.isFocused=!1),this.set$({isFailed:e===Fs.FAILED,isUploading:e===Fs.UPLOADING,isFinished:e===Fs.FINISHED,isEditable:this.cfg.useCloudImageEditor&&t.getValue("isImage")&&t.getValue("cdnUrl")}),this._updateHintAndProgress(e)});_reset(){super._reset(),this._debouncedCalculateState.cancel()}_observerCallback(t){const[e]=t;e&&(this._isIntersecting=e.isIntersecting,this._thumbRect=e.boundingClientRect,e.isIntersecting&&!this._renderedOnce&&(this.render(),this._renderedOnce=!0))}_handleEntryId(t){this._reset();const e=this.uploadCollection?.read(t);this._entry=e,e&&(this._subEntry("isQueuedForValidation",()=>{this._debouncedCalculateState()}),this._subEntry("isValidationPending",()=>{this._debouncedCalculateState()}),this._subEntry("uploadProgress",()=>{this._debouncedCalculateState()}),this._subEntry("isQueuedForUploading",()=>{this._debouncedCalculateState()}),this._subEntry("fileName",t=>{this.$.itemName=t||e.getValue("externalUrl")||this.l10n("file-no-name"),this._debouncedCalculateState()}),this._subEntry("externalUrl",t=>{this.$.itemName=e.getValue("fileName")||t||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()))}_updateShowFileNames(t){"list"===this.cfg.filesViewMode?this.$.showFileNames=!0:this.$.showFileNames=t}initCallback(){super.initCallback(),this.sub("uid",t=>{this._handleEntryId(t)}),this.sub("state",t=>{this._handleState(t)}),this.subConfigValue("useCloudImageEditor",()=>this._debouncedCalculateState()),this.subConfigValue("filesViewMode",t=>{this._updateShowFileNames(this.cfg.gridShowFileNames),this.setAttribute("mode",t)}),this.subConfigValue("gridShowFileNames",t=>{this._updateShowFileNames(t)}),this.onclick=()=>{t.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())}),t.activeInstances.add(this)}destroyCallback(){super.destroyCallback(),t.activeInstances.delete(this),this._reset()}connectedCallback(){super.connectedCallback(),this._observer=new window.IntersectionObserver(this._observerCallback.bind(this),{threshold:[0,1]}),this._observer.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}_settingsOfShrink(){return(t=>{if("string"!=typeof t)return!1;const e=zs.exec(t.toLocaleLowerCase())??[];if(0===e.length)return!1;const r=Number(e[1])*Number(e[2]);return r>268435456?(console.warn(`Shrinked size can not be larger than ${Math.floor(268.435456)}MP. You have set ${e[1]}x${e[2]} (${Math.ceil(r/1e3/100)/10}MP).`),!1):{quality:e[3]?Number(e[3])/100:void 0,size:r}})(this.cfg.imageShrink)}async _processShrink(t){const e=this._settingsOfShrink();return e?await zi(t,e):(console.warn("Image shrink settings are invalid, skipping shrinking"),t)}upload=this._withEntry(async t=>{if(!this.uploadCollection.read(t.uid))return;if(t.getValue("fileInfo")||t.getValue("isUploading")||t.getValue("errors").length>0||t.getValue("isValidationPending"))return;const e=this.cfg.multiple?this.cfg.multipleMax:1;if(!(e&&this.uploadCollection.size>e)){t.setMultipleValues({isUploading:!0,errors:[],isQueuedForUploading:!0}),this._debouncedCalculateState();try{const e=new AbortController;t.setValue("abortController",e);const r=async()=>{t.setValue("isQueuedForUploading",!1);let r=t.getValue("file");if(r instanceof File&&this.cfg.imageShrink)try{r=await this._processShrink(r)}catch{}const i=r||t.getValue("externalUrl")||t.getValue("uuid");if(!i)throw new Error("No file input");const o={...await this.getUploadClientOptions(),fileName:t.getValue("fileName")??void 0,source:t.getValue("source")??void 0,onProgress:e=>{if(e.isComputable){const r=100*e.value;t.setValue("uploadProgress",r)}},signal:e.signal,metadata:await this.getMetadataFor(t.uid)};return this.debugPrint("upload options",i,o),Kr(i,o)},i=await this.$["*uploadQueue"].add(r);t.setMultipleValues({fileInfo:i,isQueuedForUploading:!1,isUploading:!1,fileName:i.originalFilename,fileSize:i.size,isImage:i.isImage??!1,mimeType:i.contentInfo?.mime?.mime??i.mimeType,uuid:i.uuid,cdnUrl:t.getValue("cdnUrl")??i.cdnUrl,cdnUrlModifiers:t.getValue("cdnUrlModifiers")??"",uploadProgress:100,source:t.getValue("source")??null}),t===this._entry&&this._debouncedCalculateState()}catch(e){this.telemetryManager.sendEventError(e,"file upload. Failed to upload file"),e instanceof er&&e.isCancel?t.setMultipleValues({isUploading:!1,uploadProgress:0}):e instanceof Qe?t.setMultipleValues({isUploading:!1,uploadProgress:0,uploadError:e}):(console.error("Unknown upload error",e),t.setMultipleValues({isUploading:!1,uploadProgress:0,uploadError:new Error("Something went wrong",{cause:e})})),t===this._entry&&this._debouncedCalculateState()}}});static template='\n <div class="uc-inner" set="@finished: isFinished; @uploading: isUploading; @failed: isFailed; @focused: isFocused">\n <uc-thumb set="uid:uid;badgeIcon:badgeIcon"></uc-thumb>\n\n <div aria-atomic="true" aria-live="polite" class="uc-file-name-wrapper" set="@aria-label:ariaLabelStatusFile;">\n <span class="uc-file-name" set="@hidden: !showFileNames">{{itemName}}</span>\n <span class="uc-file-error" set="@hidden: !errorText;">{{errorText}}</span>\n <span class="uc-file-hint" set="@hidden: !hint">{{hint}}</span>\n </div>\n <div class="uc-file-actions">\n <button\n type="button"\n l10n="@title:file-item-edit-button;@aria-label:file-item-edit-button"\n class="uc-edit-btn uc-mini-btn"\n set="onclick: onEdit; @hidden: !isEditable"\n >\n <uc-icon name="edit-file"></uc-icon>\n </button>\n <button\n type="button"\n l10n="@title:file-item-remove-button;@aria-label:file-item-remove-button"\n class="uc-remove-btn uc-mini-btn"\n set="onclick: onRemove;"\n >\n <uc-icon name="remove-file"></uc-icon>\n </button>\n <button type="button" class="uc-upload-btn uc-mini-btn" set="onclick: onUpload;">\n <uc-icon name="upload"></uc-icon>\n </button>\n </div>\n <uc-progress-bar\n class="uc-progress-bar"\n set="value: progressValue; visible: progressVisible; @hasFileName: showFileNames;"\n >\n </uc-progress-bar>\n </div>\n';static activeInstances=new Set},Bs=class extends la{requireCtxName=!0;_validationInputElement=null;_dynamicInputsContainer=null;_createValidationInput(){const t=document.createElement("input");return t.type="text",t.name=this.ctxName,t.required=this.cfg.multipleMin>0,t.tabIndex=-1,De(t,{opacity:0,height:0,width:0}),t}initCallback(){super.initCallback(),this._validationInputElement=this._createValidationInput(),this.appendChild(this._validationInputElement),this.sub("*collectionState",t=>{{if(!this._dynamicInputsContainer){const t=document.createElement("div");this.appendChild(t),this._dynamicInputsContainer=t}if(!this._validationInputElement){const t=this._createValidationInput();this.appendChild(t),this._validationInputElement=t}if(this._dynamicInputsContainer.innerHTML="","uploading"===t.status||"idle"===t.status)return this._validationInputElement.value="",void this._validationInputElement.setCustomValidity("");if("failed"===t.status){const e=t.errors[0]?.message;return this._validationInputElement.value="",void this._validationInputElement.setCustomValidity(e??"")}const e=t.group?t.group:null;if(e)return this._validationInputElement.value=e.cdnUrl??"",void this._validationInputElement.setCustomValidity("");const r=t.allEntries.map(t=>t.cdnUrl).filter(t=>"string"==typeof t);if(!this.cfg.multiple&&1===r.length&&r[0])return this._validationInputElement.value=r[0],void this._validationInputElement.setCustomValidity("");this._validationInputElement.remove(),this._validationInputElement=null;const i=new DocumentFragment;for(const t of r){const e=document.createElement("input");e.type="hidden",e.name=`${this.ctxName}[]`,e.value=t,i.appendChild(e)}this._dynamicInputsContainer.replaceChildren(i)}},!1)}},js=class extends Yo{constructor(){super(),this.init$={...this.init$,name:"",href:""}}initCallback(){super.initCallback(),this.sub("name",t=>{if(!t)return;let e=`#uc-icon-${t}`;this.subConfigValue("iconHrefResolver",r=>{if(r){const i=r(t);e=i??e}this.$.href=e})}),this.setAttribute("aria-hidden","true")}};js.template='\n <svg ref="svg" xmlns="http://www.w3.org/2000/svg">\n <use set="@href: href;"></use>\n </svg>\n',js.bindAttributes({name:"name"});var Hs="--uc-img-",qs="unresolved",Ks=!window.location.host.trim()||window.location.host.includes(":")||window.location.hostname.includes("localhost"),Gs=Object.freeze({PREVIEW:"PREVIEW",MAIN:"MAIN"}),Ws=Object.freeze({"dev-mode":{},pubkey:{},uuid:{},src:{},lazy:{default:1},intersection:{},breakpoints:{},"cdn-cname":{default:"https://ucarecdn.com"},"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}}),Xs=Object.create(null);for(const t in Ws)Xs[Hs+t]=Ws[t]?.default||"";var Zs=class extends Ne{cssInit$=Xs;$$(t){return this.$[Hs+t]}set$$(t){for(const e in t)this.$[Hs+e]=t[e]}sub$$(t,e){this.sub(Hs+t,t=>{null!==t&&""!==t&&e(t)})}analyticsParams(){return`-/@clib/${Ko}/${Go}/uc-img/`}initAttributes(t){[...this.attributes].forEach(e=>{Ws[e.name]||t.setAttribute(e.name,e.value)})}initIntersection(t,e){this._isnObserver=new IntersectionObserver(r=>{r.forEach(r=>{r.isIntersecting&&(e(),this._isnObserver.unobserve(t))})},{root:null,rootMargin:"0px"}),this._isnObserver.observe(t),this._observed||(this._observed=new Set),this._observed.add(t)}destroyCallback(){super.destroyCallback(),this._isnObserver&&(this._observed.forEach(t=>{this._isnObserver.unobserve(t)}),this._isnObserver=null),we.deleteCtx(this)}static get observedAttributes(){return Object.keys(Ws)}attributeChangedCallback(t,e,r){window.setTimeout(()=>{this.$[Hs+t]=r})}},Ys=class extends Zs{_img=new Image;_imgPreview=new Image;_fmtAbs(t){return!t.includes("//")&&!Ks&&(t=new URL(t,document.baseURI).href),t}_validateSize(t){if(""!==t?.trim()){const e=t.match(/\d+/)[0],r=t.match(/[a-zA-Z]+/)[0],i=parseInt(e,10);if(Number(i)>5e3&&this.hasFormatJPG)return 5e3+r;if(Number(i)>3e3&&!this.hasFormatJPG)return 3e3+r}return t}_getCdnModifiers(t,e){const r={format:this.$$("format"),quality:this.$$("quality"),resize:this._validateSize(t),blur:e,"cdn-operations":this.$$("cdn-operations"),analytics:this.analyticsParams()};return Gi(...(t=>Object.entries(t).filter(([t,e])=>void 0!==e&&""!==e).map(([t,e])=>"cdn-operations"===t||"analytics"===t?e:`${t}/${e}`))(r))}_getUrlBase(t="",e=""){if(this.$$("src").startsWith("data:")||this.$$("src").startsWith("blob:"))return this.$$("src");if(Ks&&this.$$("src")&&!this.$$("src").includes("//"))return this._proxyUrl(this.$$("src"));const r=this._getCdnModifiers(t,e);return this.$$("src").startsWith(this.$$("cdn-cname"))?eo(this.$$("src"),r):this.$$("cdn-cname")&&this.$$("uuid")||this.$$("uuid")?this._proxyUrl(eo(ro(this.$$("cdn-cname"),this.$$("uuid")),r)):this.$$("proxy-cname")?this._proxyUrl(eo(this.$$("proxy-cname"),r,this._fmtAbs(this.$$("src")))):this.$$("pubkey")?this._proxyUrl(eo(`https://${this.$$("pubkey")}.ucr.io/`,r,this._fmtAbs(this.$$("src")))):void 0}_proxyUrl(t){return this.$$("secure-delivery-proxy")?Io(this.$$("secure-delivery-proxy"),{previewUrl:t},{transform:t=>window.encodeURIComponent(t)}):t}_getElSize(t,e=1,r=!0){const i=t.getBoundingClientRect(),o=e*Math.round(i.width),n=r?"":e*Math.round(i.height);return o||n?`${o||""}x${n||""}`:null}_setupEventProxy(t){const e=t=>{t.stopPropagation();const e=new Event(t.type,t);this.dispatchEvent(e)},r=["load","error"];for(const i of r)t.addEventListener(i,e)}get img(){return this.hasPreviewImage||(this._setupConfigForImage({elNode:this._img}),this.appendChild(this._img)),this._img}get currentImg(){return this.hasPreviewImage?{type:Gs.PREVIEW,img:this._imgPreview}:{type:Gs.MAIN,img:this.img}}get hasPreviewImage(){return this.$$("is-preview-blur")}get bgSelector(){return this.$$("is-background-for")}get breakpoints(){if(this.$$("breakpoints")){const e=io(this.$$("breakpoints"));return t=e.map(t=>parseInt(t,10)),[...new Set(t)]}return null;var t}get hasFormatJPG(){return"jpeg"===this.$$("format").toLowerCase()}renderBg(t){const e=new Set;e.add(`url("${this._getUrlBase(this._getElSize(t))}") 1x`),this.$$("hi-res-support")&&e.add(`url("${this._getUrlBase(this._getElSize(t,2))}") 2x`),this.$$("ultra-res-support")&&e.add(`url("${this._getUrlBase(this._getElSize(t,3))}") 3x`);const r=`image-set(${[...e].join(", ")})`;t.style.setProperty("background-image",r),t.style.setProperty("background-image","-webkit-"+r)}getSrcset(){const t=new Set;return this.breakpoints?this.breakpoints.forEach(e=>{t.add(this._getUrlBase(e+"x")+` ${this._validateSize(e+"w")}`),this.$$("hi-res-support")&&t.add(this._getUrlBase(2*e+"x")+` ${this._validateSize(2*e+"w")}`),this.$$("ultra-res-support")&&t.add(this._getUrlBase(3*e+"x")+` ${this._validateSize(3*e+"w")}`)}):(t.add(this._getUrlBase(this._getElSize(this.currentImg.img))+" 1x"),this.$$("hi-res-support")&&t.add(this._getUrlBase(this._getElSize(this.currentImg.img,2))+" 2x"),this.$$("ultra-res-support")&&t.add(this._getUrlBase(this._getElSize(this.currentImg.img,3))+" 3x")),[...t].join()}getSrc(){return this._getUrlBase()}get srcUrlPreview(){return this._getUrlBase("100x","100")}renderBackground(){[...document.querySelectorAll(this.bgSelector)].forEach(t=>{this.$$("intersection")?this.initIntersection(t,()=>{this.renderBg(t)}):this.renderBg(t)})}_appendURL({elNode:t,src:e,srcset:r}){e&&(t.src=e),r&&(t.srcset=r)}_setupConfigForImage({elNode:t}){this._setupEventProxy(t),this.initAttributes(t)}loaderImage({src:t,srcset:e,elNode:r}){return new Promise((i,o)=>{this._setupConfigForImage({elNode:r}),r.setAttribute(qs,""),r.addEventListener("load",()=>{r.removeAttribute(qs),i(r)}),r.addEventListener("error",()=>{o(!1)}),this._appendURL({elNode:r,src:t,srcset:e})})}async renderImage(){if(this.$$("intersection"))return this.hasPreviewImage&&(this._setupConfigForImage({elNode:this._imgPreview}),this.appendChild(this._imgPreview)),void 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(t){this.hasPreviewImage&&await(this._imgPreview?.remove()),this.appendChild(this._img)}});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(t){this.hasPreviewImage&&await(this._imgPreview?.remove()),this.appendChild(this._img)}}init(){this.bgSelector?this.renderBackground():this.renderImage()}},Qs=class extends Ys{initCallback(){super.initCallback(),this.sub$$("src",()=>{this.init()}),this.sub$$("uuid",()=>{this.init()}),this.sub$$("lazy",t=>{this.$$("is-background-for")||this.$$("is-preview-blur")||(this.img.loading=t?"lazy":"eager")})}},Js=null,tc=class extends Yo{static styleAttrs=[...super.styleAttrs,"uc-modal"];static StateConsumerScope="modal";_mouseDownTarget;handleModalOpen;handleModalClose;handleModalCloseAll;constructor(){super(),this.init$={...this.init$,closeClicked:this._handleDialogClose}}_handleBackdropClick=()=>{this._closeDialog()};_closeDialog=()=>{this.modalManager?.close(this.id),this.modalManager?.hasActiveModals||(document.body.style.overflow="")};_handleDialogClose=()=>{this._closeDialog()};_handleDialogMouseDown=t=>{this._mouseDownTarget=t.target};_handleDialogMouseUp=t=>{const e=t.target;e===this.ref.dialog&&e===this._mouseDownTarget&&this._closeDialog()};show(){const t=this.ref.dialog;"function"==typeof t.showModal?(this.setAttribute("aria-modal","true"),t.showModal()):t.setAttribute("open",""),this.cfg.modalScrollLock&&(document.body.style.overflow="hidden")}hide(){const t=this.ref.dialog;"function"==typeof t.close?(this.setAttribute("aria-modal","false"),t.close()):t.removeAttribute("open")}_handleModalOpen({id:t}){t===this.id?(Js=t,this.show(),this.emit(Fi.MODAL_OPEN,{modalId:t},{debounce:!0})):this.hide()}_handleModalClose({id:t}){t===this.id&&(this.hide(),this.emit(Fi.MODAL_CLOSE,{modalId:t,hasActiveModals:this.modalManager?.hasActiveModals},{debounce:!0}))}_handleModalCloseAll(t){this.hide(),Js===this.id&&this.emit(Fi.MODAL_CLOSE,{modalId:Js,hasActiveModals:this.modalManager?.hasActiveModals},{debounce:!0})}initCallback(){super.initCallback(),this.modalManager?.registerModal(this.id,this);const t=this.ref.dialog;t.addEventListener("close",this._handleDialogClose),t.addEventListener("mousedown",this._handleDialogMouseDown),t.addEventListener("mouseup",this._handleDialogMouseUp),this.subConfigValue("modalBackdropStrokes",t=>{t?this.setAttribute("strokes",""):this.removeAttribute("strokes")}),this.handleModalOpen=this._handleModalOpen.bind(this),this.handleModalClose=this._handleModalClose.bind(this),this.handleModalCloseAll=this._handleModalCloseAll.bind(this),this.modalManager?.subscribe(Ho.OPEN,this.handleModalOpen),this.modalManager?.subscribe(Ho.CLOSE,this.handleModalClose),this.modalManager?.subscribe(Ho.CLOSE_ALL,this.handleModalCloseAll)}destroyCallback(){super.destroyCallback(),document.body.style.overflow="",this._mouseDownTarget=void 0;const t=this.ref.dialog;t.removeEventListener("close",this._handleDialogClose),t.removeEventListener("mousedown",this._handleDialogMouseDown),t.removeEventListener("mouseup",this._handleDialogMouseUp),this.modalManager?.unsubscribe(Ho.OPEN,this.handleModalOpen),this.modalManager?.unsubscribe(Ho.CLOSE,this.handleModalClose),this.modalManager?.unsubscribe(Ho.CLOSE_ALL,this.handleModalCloseAll)}};tc.template='\n <dialog ref="dialog">\n <slot></slot>\n </dialog>\n';var ec=class extends Yo{_value=0;_visible=!0;constructor(){super(),this.init$={...this.init$,width:0,opacity:0}}initCallback(){super.initCallback();this.ref.fakeProgressLine.addEventListener("animationiteration",()=>{const t=this.ref.fakeProgressLine;this._visible?this._value>0&&t.classList.add("uc-fake-progress--hidden"):t.classList.add("uc-fake-progress--hidden")}),this.defineAccessor("value",t=>{null!=t&&(this._value=t,this._visible&&this.style.setProperty("--l-progress-value",this._value.toString()))}),this.defineAccessor("visible",t=>{this._visible=t,this.classList.toggle("uc-progress-bar--hidden",!t)})}};ec.template='\n <div ref="fakeProgressLine" class="uc-fake-progress"></div>\n <div ref="realProgressLine" class="uc-progress"></div>\n';var rc=class extends la{_unobserveCollectionCb;constructor(){super(),this.init$={...this.init$,visible:!1,value:0,"*commonProgress":0}}initCallback(){super.initCallback(),this._unobserveCollectionCb=this.uploadCollection.observeProperties(()=>{const t=this.uploadCollection.items().some(t=>{const e=this.uploadCollection.read(t);return e?.getValue("isUploading")??!1});this.$.visible=t}),this.sub("visible",t=>{t?this.setAttribute("active",""):this.removeAttribute("active")}),this.sub("*commonProgress",t=>{this.$.value=t})}destroyCallback(){super.destroyCallback(),this._unobserveCollectionCb?.(),this._unobserveCollectionCb=void 0}};rc.template=' <uc-progress-bar set="visible: visible; value: value"></uc-progress-bar> ';var ic=class extends Yo{constructor(){super(),this.init$={...this.init$,currentText:"",options:[],selectHtml:"",onSelect:t=>{t.preventDefault(),t.stopPropagation();const e=this.ref.select;this.value=e.value,this.$.currentText=this.$.options.find(t=>t.value===this.value)?.text||"",this.dispatchEvent(new Event("change"))}}}initCallback(){super.initCallback(),this.sub("options",t=>{this.$.currentText=t?.[0]?.text||"";let e="";t?.forEach(t=>{e+=`<option value="${t.value}">${t.text}</option>`}),this.$.selectHtml=e})}};ic.template=' <select ref="select" set="innerHTML: selectHtml; onchange: onSelect"></select> ';var oc=class extends la{static styleAttrs=[...super.styleAttrs,"uc-simple-btn"];couldBeCtxOwner=!0;constructor(){super(),this.init$={...this.init$,withDropZone:!0,onClick:()=>{this.api.initFlow()},"button-text":""}}initCallback(){super.initCallback(),this.defineAccessor("dropzone",t=>{void 0!==t&&(this.$.withDropZone=ns(t))}),this.subConfigValue("multiple",t=>{this.$["button-text"]=t?"upload-files":"upload-file"})}};oc.template='\n <uc-drop-area set="@disabled: !withDropZone">\n <button type="button" set="onclick: onClick">\n <uc-icon name="upload"></uc-icon>\n <span l10n="button-text"></span>\n <slot></slot>\n <div class="uc-visual-drop-area" l10n="drop-files-here"></div>\n </button>\n </uc-drop-area>\n',oc.bindAttributes({dropzone:null});var nc=class extends la{couldBeCtxOwner=!0;type=void 0;_registeredTypes={};constructor(){super(),this.init$={...this.init$,iconName:"default","src-type":""}}initTypes(){this.registerType({type:kn.LOCAL,activate:()=>(this.api.openSystemDialog(),!1)}),this.registerType({type:kn.URL,activity:tn.activities.URL,textKey:"from-url"}),this.registerType({type:kn.CAMERA,activity:tn.activities.CAMERA,activate:()=>{const t=Sn.htmlMediaCapture;return t&&this.api.openSystemDialog({captureCamera:!0}),!t}}),this.registerType({type:"draw",activity:tn.activities.DRAW,icon:"edit-draw"});for(const t of Object.values(_n))this.registerType({type:t,activity:tn.activities.CAMERA,activate:()=>{const e=Sn.htmlMediaCapture;return e&&this.api.openSystemDialog({captureCamera:!0,modeCamera:"mobile-photo-camera"===t?Jn.PHOTO:Jn.VIDEO}),!e}});for(const t of Object.values(wn))this.registerType({type:t,activity:tn.activities.EXTERNAL,activityParams:{externalSourceType:t}})}initCallback(){super.initCallback(),this.initTypes(),this.defineAccessor("type",t=>{t&&this.applyType(t)})}registerType(t){this._registeredTypes[t.type]=t}getType(t){return this._registeredTypes[t]}activate(){if(!this.type)return;const t=this._registeredTypes[this.type];if(!t)return;const{activity:e,activate:r,activityParams:i={}}=t;(r?r():!!e)&&e&&(this.modalManager?.open(e),this.set$({"*currentActivityParams":i,"*currentActivity":e}))}applyType(t){const e=this._registeredTypes[t];if(!e)return void console.warn(`Unsupported source type: ${t}`);const{textKey:r=t,icon:i=t}=e;this.$["src-type"]=`src-type-${r}`,this.$.iconName=i,this.onclick=()=>{this.activate()}}};nc.template='\n <button type="button">\n <uc-icon set="@name: iconName"></uc-icon>\n <div class="uc-txt" l10n="src-type"></div>\n </button>\n',nc.bindAttributes({type:null});var ac=class extends Yo{initCallback(){super.initCallback(),this.subConfigValue("sourceList",t=>{const e=io(t);let r="";e.forEach(t=>{"instagram"!==t?"camera"===t&&Sn.htmlMediaCapture?this.subConfigValue("cameraModes",t=>{const e=ji(t);e.forEach(t=>{r+=`<uc-source-btn role="listitem" type="mobile-${t}-camera"></uc-source-btn>`}),0===e.length&&(r+='<uc-source-btn role="listitem" type="mobile-photo-camera"></uc-source-btn>')}):r+=`<uc-source-btn role="listitem" type="${t}"></uc-source-btn>`: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")}),this.cfg.sourceListWrap?this.innerHTML=r:this.outerHTML=r})}},sc=class extends Ne{};sc.template=' <div class="uc-spinner"></div> ';var cc=class extends tn{historyTracked=!0;activityType=tn.activities.START_FROM;initCallback(){super.initCallback(),this.registerActivity(this.activityType??"")}};function lc(t,e=40){if("image/svg+xml"===t.type)return URL.createObjectURL(t);const r=document.createElement("canvas"),i=r.getContext("2d");if(!i)return Promise.reject(new Error("Canvas context not supported"));const o=new Image,n=new Promise((t,n)=>{o.onload=()=>{const a=o.height/o.width;a>1?(r.width=e,r.height=e*a):(r.height=e,r.width=e/a),i.fillStyle="rgb(240, 240, 240)",i.fillRect(0,0,r.width,r.height),i.drawImage(o,0,0,r.width,r.height),r.toBlob(e=>{if(!e)return void n();const r=URL.createObjectURL(e);t(r)})},o.onerror=t=>{n(t)}});return o.src=URL.createObjectURL(t),n}function uc(t="hsl(209, 21%, 65%)",e=32,r=32){return function(t){const e=new Blob([t],{type:"image/svg+xml"});return URL.createObjectURL(e)}(`\n <svg width="${e}" height="${r}" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" fill="${t}" 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"/>\n </svg>\n `)}cc.template=' <div class="uc-content"><slot></slot></div> ';var dc=class extends Ds{_renderedGridOnce=!1;_thumbRect=null;_isIntersecting=!1;_firstViewMode=this.cfg.filesViewMode;_observer;constructor(){super(),this.init$={...this.init$,thumbUrl:"",badgeIcon:"",uid:""}}_calculateThumbSize(t=!1){t&&(this._thumbRect=this.getBoundingClientRect());let e=Math.max(parseInt(String(this?._thumbRect?.height||0),10),parseInt(String(this?._thumbRect?.width||0),10),this.cfg.thumbSize);return window.devicePixelRatio>1&&(e*=window.devicePixelRatio),Math.min(e,3e3)}_generateThumbnail=this._withEntry(async(t,e=!1)=>{const r=t.getValue("fileInfo"),i=t.getValue("isImage"),o=t.getValue("uuid"),n=t.getValue("thumbUrl"),a=this._calculateThumbSize(e);if(r&&i&&o){const e=await this.proxyUrl(eo(ro(this.cfg.cdnCname,o),Gi(t.getValue("cdnUrlModifiers"),"stretch/off",`scale_crop/${a}x${a}/center`)));if(n===e)return;const{promise:r}=Ia(e);return void r.then(()=>{t.setValue("thumbUrl",e),n?.startsWith("blob:")&&URL.revokeObjectURL(n)}).catch(async()=>{if(!n?.startsWith("blob:"))try{const e=t.getValue("file");if(!e)return;const r=await lc(e,a);t.setValue("thumbUrl",r)}catch(e){this.telemetryManager.sendEventError(e,"thumbnail generation. Failed to generate thumb from file");const r=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");t.setValue("thumbUrl",uc(r))}})}if(t.getValue("thumbUrl"))return;const s=t.getValue("file");if(s?.type.includes("image"))try{const e=await lc(s,a);t.setValue("thumbUrl",e)}catch(e){this.telemetryManager.sendEventError(e,"thumbnail generation. Failed to generate thumb from file");const r=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");t.setValue("thumbUrl",uc(r))}else{const e=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");t.setValue("thumbUrl",uc(e))}});_debouncedGenerateThumb=Bi(this._generateThumbnail.bind(this),100);_observerCallback(t){const[e]=t;e&&(this._isIntersecting=e.isIntersecting,e.isIntersecting&&(this._thumbRect=e.boundingClientRect,this._debouncedGenerateThumb(),this._observer?.disconnect()),0===e.intersectionRatio&&this._debouncedGenerateThumb.cancel())}_reset(){super._reset(),this._debouncedGenerateThumb.cancel()}_handleEntryId(t){this._reset();const e=this.uploadCollection?.read(t);this._entry=e,e&&(this._subEntry("fileInfo",t=>{t?.isImage&&this._isIntersecting&&this._debouncedGenerateThumb()}),this._subEntry("thumbUrl",t=>{this.$.thumbUrl=t?`url(${t})`:""}),this._subEntry("cdnUrlModifiers",()=>{this._isIntersecting&&this._debouncedGenerateThumb()}),this._isIntersecting&&this._debouncedGenerateThumb())}initCallback(){super.initCallback(),this.defineAccessor("badgeIcon",t=>{this.$.badgeIcon=t}),this.defineAccessor("uid",t=>{this.set$({uid:t})}),this.sub("uid",t=>{this._handleEntryId(t)}),this.subConfigValue("filesViewMode",t=>{"grid"!==t||this._renderedGridOnce||("list"===this._firstViewMode&&this._debouncedGenerateThumb(!0),this._renderedGridOnce=!0)}),this.setAttribute("role","img")}connectedCallback(){super.connectedCallback(),this._observer=new window.IntersectionObserver(this._observerCallback.bind(this),{threshold:.1}),this._observer.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this._entrySubs=new Set,this._debouncedGenerateThumb.cancel(),this._observer?.disconnect()}};dc.template='\n <div class="uc-thumb" set="style.backgroundImage: thumbUrl">\n <div class="uc-badge">\n <uc-icon set="@name: badgeIcon"></uc-icon>\n </div>\n </div>\n',dc.bindAttributes({badgeIcon:null,uid:null});var hc=class extends la{static styleAttrs=["uc-wgt-common"];static EventType=Fi;requireCtxName=!0;initCallback(){super.initCallback(),this.$["*eventEmitter"].bindTarget(this)}destroyCallback(){super.destroyCallback(),this.$["*eventEmitter"].unbindTarget(this)}},pc=class extends la{couldBeCtxOwner=!0;historyTracked=!0;activityType=tn.activities.UPLOAD_LIST;constructor(){super(),this.init$={...this.init$,doneBtnVisible:!1,doneBtnEnabled:!1,uploadBtnVisible:!1,addMoreBtnVisible:!1,addMoreBtnEnabled:!1,headerText:"",commonErrorMessage:"",hasFiles:!1,onAdd:()=>{this.telemetryManager.sendEvent({eventType:Di.ACTION_EVENT,payload:{metadata:{event:"add-more",node:this.tagName}}}),this.api.initFlow(!0)},onUpload:()=>{this.emit(Fi.UPLOAD_CLICK),this.api.uploadAll(),this._throttledHandleCollectionUpdate()},onDone:()=>{this.emit(Fi.DONE_CLICK,this.api.getOutputCollectionState()),this.api.doneFlow()},onCancel:()=>{this.telemetryManager.sendEvent({eventType:Di.ACTION_EVENT,payload:{metadata:{event:"clear-all",node:this.tagName}}}),this.uploadCollection.clearAll()}}}_throttledHandleCollectionUpdate=Ra(()=>{this.isConnected&&(this._updateUploadsState(),this.couldOpenActivity||this.$["*currentActivity"]!==this.activityType||this.historyBack(),this.cfg.confirmUpload||this.api.uploadAll())},300);_updateUploadsState(){const t=this.api.getOutputCollectionState(),e={total:t.totalCount,succeed:t.successCount,uploading:t.uploadingCount,failed:t.failedCount,validatingBeforeUploading:t.idleEntries.filter(t=>t.isValidationPending).length},r=!t.errors.some(t=>"TOO_MANY_FILES"===t.type||"TOO_FEW_FILES"===t.type),i=t.errors.some(t=>"TOO_MANY_FILES"===t.type),o=t.totalCount===(this.cfg.multiple?this.cfg.multipleMax:1),n=t.allEntries.some(t=>t.isValidationPending),a=0===e.failed&&0===t.errors.length&&!n;let s=!1,c=!1,l=!1;if(e.total-e.succeed-e.uploading-e.failed>0&&r&&a)s=!0;else{c=!0;const i=!this.cfg.groupOutput||!!t.group;l=e.total===e.succeed&&r&&a&&i}this.set$({doneBtnVisible:c,doneBtnEnabled:l,uploadBtnVisible:s,addMoreBtnEnabled:0===e.total||!i&&!o,addMoreBtnVisible:!o||this.cfg.multiple,hasFiles:e.total>0}),this.bindL10n("headerText",()=>this._getHeaderText(e))}_getHeaderText(t){const e=e=>{let r=t[e];return"uploading"===e&&(r+=t.validatingBeforeUploading),this.l10n(`header-${e}`,{count:r})};return t.uploading>0||t.validatingBeforeUploading>0?e("uploading"):t.failed>0?e("failed"):t.succeed>0?e("succeed"):e("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",t=>{t&&this._throttledHandleCollectionUpdate()}),this.subConfigValue("filesViewMode",t=>{this.setAttribute("mode",t)}),this.sub("*currentActivity",t=>{this.couldOpenActivity||t!==this.activityType||(this.$["*currentActivity"]=this.initActivity)}),this.uploadCollection.observeProperties(this._throttledHandleCollectionUpdate),this.uploadCollection.observeCollection(this._throttledHandleCollectionUpdate),this.sub("*collectionErrors",t=>{const e=t.filter(t=>"SOME_FILES_HAS_ERRORS"!==t.type)[0];e?this.set$({commonErrorMessage:e.message}):this.set$({commonErrorMessage:null})})}destroyCallback(){super.destroyCallback(),this.uploadCollection.unobserveProperties(this._throttledHandleCollectionUpdate),this.uploadCollection.unobserveCollection(this._throttledHandleCollectionUpdate)}};pc.template='\n <uc-activity-header>\n <span aria-live="polite" class="uc-header-text">{{headerText}}</span>\n <button\n type="button"\n class="uc-mini-btn uc-close-btn"\n set="onclick: *closeModal"\n l10n="@title:a11y-activity-header-button-close;@aria-label:a11y-activity-header-button-close"\n >\n <uc-icon name="close"></uc-icon>\n </button>\n </uc-activity-header>\n\n <div class="uc-no-files" set="@hidden: hasFiles">\n <slot name="empty"><span l10n="no-files"></span></slot>\n </div>\n\n <div class="uc-files">\n <div class="uc-files-wrapper" repeat="*uploadList" repeat-item-tag="uc-file-item"></div>\n <button\n type="button"\n class="uc-add-more-btn uc-secondary-btn"\n set="onclick: onAdd; @disabled: !addMoreBtnEnabled; @hidden: !addMoreBtnVisible"\n >\n <uc-icon name="add"></uc-icon><span l10n="add-more"></span>\n </button>\n </div>\n\n <div class="uc-common-error" set="@hidden: !commonErrorMessage; textContent: commonErrorMessage;"></div>\n\n <div class="uc-toolbar">\n <button type="button" class="uc-cancel-btn uc-secondary-btn" set="onclick: onCancel;" l10n="clear"></button>\n <div class="uc-toolbar-spacer"></div>\n <button\n type="button"\n class="uc-add-more-btn uc-secondary-btn"\n set="onclick: onAdd; @disabled: !addMoreBtnEnabled; @hidden: !addMoreBtnVisible"\n >\n <uc-icon name="add"></uc-icon><span l10n="add-more"></span>\n </button>\n <button\n type="button"\n class="uc-upload-btn uc-primary-btn"\n set="@hidden: !uploadBtnVisible; onclick: onUpload;"\n l10n="upload"\n ></button>\n <button\n type="button"\n class="uc-done-btn uc-primary-btn"\n set="@hidden: !doneBtnVisible; onclick: onDone; @disabled: !doneBtnEnabled"\n l10n="done"\n ></button>\n </div>\n\n <uc-drop-area ghost></uc-drop-area>\n';var gc=class extends la{couldBeCtxOwner=!0;activityType=tn.activities.URL;constructor(){super(),this.init$={...this.init$,importDisabled:!0,onUpload:t=>{t.preventDefault(),this.telemetryManager.sendEvent({eventType:Di.ACTION_EVENT,payload:{metadata:{event:"upload-from-url",node:this.tagName}}});const e=this.ref.input.value;this.api.addFileFromUrl(e,{source:kn.URL}),this.modalManager?.open(tn.activities.UPLOAD_LIST),this.$["*currentActivity"]=tn.activities.UPLOAD_LIST},onCancel:()=>{this.historyBack()},onInput:t=>{const e=t.target?.value??"";this.set$({importDisabled:!e})}}}initCallback(){super.initCallback(),this.registerActivity(this.activityType??"",{onActivate:()=>{const t=this.ref.input;t.value="",t.focus()}})}};gc.template='\n <uc-activity-header>\n <button type="button" class="uc-mini-btn" set="onclick: *historyBack" l10n="@title:back;@aria-label:back">\n <uc-icon name="back"></uc-icon>\n </button>\n <div>\n <uc-icon name="url"></uc-icon>\n <span l10n="caption-from-url"></span>\n </div>\n <button\n type="button"\n class="uc-mini-btn uc-close-btn"\n set="onclick: *closeModal"\n l10n="@title:a11y-activity-header-button-close;@aria-label:a11y-activity-header-button-close"\n >\n <uc-icon name="close"></uc-icon>\n </button>\n </uc-activity-header>\n <form class="uc-content">\n <label>\n <input placeholder="https://" class="uc-url-input" type="text" ref="input" set="oninput: onInput" />\n </label>\n <button\n type="submit"\n class="uc-url-upload-btn uc-primary-btn"\n set="onclick: onUpload; @disabled: importDisabled"\n l10n="upload-url"\n ></button>\n </form>\n';var mc=class extends ka{static styleAttrs=[...super.styleAttrs,"uc-wgt-common"];constructor(){super(),this.init$={...this.init$,"*solution":this.tagName}}initCallback(){super.initCallback(),this.telemetryManager.sendEvent({eventType:Di.INIT_SOLUTION}),this.a11y?.registerBlock(this)}},bc=class extends nn{static styleAttrs=[...super.styleAttrs,"uc-file-uploader-inline"];constructor(){super(),this.init$={...this.init$,couldCancel:!1,"*solution":this.tagName,cancel:()=>{if(this.couldHistoryBack){const t=this.$["*historyBack"];return void t?.()}this.couldShowList&&(this.$["*currentActivity"]=tn.activities.UPLOAD_LIST)}}}get couldHistoryBack(){const t=this.$["*history"];return!(!t||t.length<=1)&&t[t.length-1]!==tn.activities.START_FROM}get couldShowList(){const t=this.$["*uploadList"];return this.cfg.showEmptyList||Array.isArray(t)&&t.length>0}initCallback(){super.initCallback(),this.telemetryManager.sendEvent({eventType:Di.INIT_SOLUTION});const t=this.ref.uBlock;t&&(this.sub("*currentActivity",e=>{e||(this.$["*currentActivity"]=t.initActivity||tn.activities.START_FROM)}),this.sub("*uploadList",e=>{Array.isArray(e)&&e.length>0&&this.$["*currentActivity"]===(t.initActivity||tn.activities.START_FROM)&&(this.$["*currentActivity"]=tn.activities.UPLOAD_LIST)}),this.sub("*history",()=>{this.$.couldCancel=this.couldHistoryBack||this.couldShowList}))}};bc.template='\n <uc-start-from>\n <uc-drop-area with-icon clickable></uc-drop-area>\n <uc-source-list role="list" wrap></uc-source-list>\n <button\n type="button"\n l10n="start-from-cancel"\n class="uc-cancel-btn uc-secondary-btn"\n set="onclick: cancel; @hidden: !couldCancel"\n ></button>\n <uc-copyright></uc-copyright>\n </uc-start-from>\n <uc-upload-list ref="uBlock"></uc-upload-list>\n <uc-camera-source></uc-camera-source>\n <uc-url-source></uc-url-source>\n <uc-external-source></uc-external-source>\n <uc-cloud-image-editor-activity></uc-cloud-image-editor-activity>\n';var fc="active",vc=class extends nn{static styleAttrs=[...super.styleAttrs,"uc-file-uploader-minimal"];handleModalOpen;handleModalClose;constructor(){super(),this.init$={...this.init$,singleUpload:!1,isHiddenStartFrom:!1,classUploadList:"",classStartFrom:"","*solution":this.tagName}}_handleModalOpen(t){t.id===tn.activities.CLOUD_IMG_EDIT&&this.set$({classUploadList:fc}),this.$["*currentActivity"]===tn.activities.UPLOAD_LIST&&this.set$({classUploadList:fc,isHiddenStartFrom:!0});const e=this.$["*uploadList"];(!e||e.length<=0)&&this.set$({classStartFrom:fc})}_handleModalClose(t){t.id===this.$["*currentActivity"]&&(this.$["*currentActivity"]=tn.activities.UPLOAD_LIST,this.set$({isHiddenStartFrom:!1})),t.id===tn.activities.CLOUD_IMG_EDIT&&(this.$["*currentActivity"]=tn.activities.UPLOAD_LIST)}initCallback(){super.initCallback(),this.telemetryManager.sendEvent({eventType:Di.INIT_SOLUTION});const t=this.ref.uBlock;t&&(this.sub("*currentActivity",e=>{e===tn.activities.UPLOAD_LIST&&this.modalManager?.closeAll(),e||(this.$["*currentActivity"]=t.initActivity||tn.activities.START_FROM)}),this.sub("*uploadList",e=>{Array.isArray(e)&&e.length>0?(this.$["*currentActivity"]=tn.activities.UPLOAD_LIST,this.set$({classStartFrom:""})):(this.set$({classUploadList:"",isHiddenStartFrom:!1}),this.$["*currentActivity"]=t.initActivity||tn.activities.START_FROM)}),this.subConfigValue("confirmUpload",t=>{!1!==t&&(this.cfg.confirmUpload=!1)}),this.subConfigValue("filesViewMode",t=>{this.setAttribute("mode",t),this.subConfigValue("multiple",e=>{"grid"===t?(e?this.style.removeProperty("--uc-grid-col"):this.style.setProperty("--uc-grid-col","1"),this.$.singleUpload=!e):(this.style.removeProperty("--uc-grid-col"),this.$.singleUpload=!1)})}),this.handleModalOpen=t=>{this._handleModalOpen(t)},this.handleModalClose=t=>{this._handleModalClose(t)},this.modalManager?.subscribe(Ho.OPEN,this.handleModalOpen),this.modalManager?.subscribe(Ho.CLOSE,this.handleModalClose))}destroyCallback(){super.destroyCallback(),this.modalManager?.unsubscribe(Ho.OPEN,this.handleModalOpen),this.modalManager?.unsubscribe(Ho.CLOSE,this.handleModalClose)}};vc.template='\n <uc-start-from set="@hidden: isHiddenStartFrom; @class:classStartFrom">\n <uc-drop-area set="@single:singleUpload;" initflow clickable tabindex="0" l10n="choose-file"></uc-drop-area>\n <uc-copyright></uc-copyright>\n </uc-start-from>\n <uc-upload-list set="@class:classUploadList" ref="uBlock"></uc-upload-list>\n\n <uc-modal id="start-from" strokes block-body-scrolling>\n <uc-start-from>\n <uc-drop-area with-icon clickable></uc-drop-area>\n <uc-source-list role="list" wrap></uc-source-list>\n <button type="button" l10n="start-from-cancel" class="uc-secondary-btn" set="onclick: *historyBack"></button>\n </uc-start-from>\n </uc-modal>\n\n <uc-modal id="camera" strokes block-body-scrolling>\n <uc-camera-source></uc-camera-source>\n </uc-modal>\n\n <uc-modal id="url" strokes block-body-scrolling>\n <uc-url-source></uc-url-source>\n </uc-modal>\n\n <uc-modal id="external" strokes block-body-scrolling>\n <uc-external-source></uc-external-source>\n </uc-modal>\n\n <uc-modal id="cloud-image-edit" strokes block-body-scrolling>\n <uc-cloud-image-editor-activity></uc-cloud-image-editor-activity>\n </uc-modal>\n';var yc=class extends nn{static styleAttrs=[...super.styleAttrs,"uc-file-uploader-regular"];constructor(){super();const t={...this.init$,isHidden:!1,"*solution":this.tagName};this.init$=t}initCallback(){super.initCallback(),this.telemetryManager.sendEvent({eventType:Di.INIT_SOLUTION}),this.defineAccessor("headless",t=>{this.set$({isHidden:ns(t)})})}};yc.template='\n <uc-simple-btn set="@hidden: isHidden"></uc-simple-btn>\n\n <uc-modal id="start-from" strokes block-body-scrolling>\n <uc-start-from>\n <uc-drop-area with-icon clickable></uc-drop-area>\n <uc-source-list role="list" wrap></uc-source-list>\n <button type="button" l10n="start-from-cancel" class="uc-secondary-btn" set="onclick: *historyBack"></button>\n <uc-copyright></uc-copyright>\n </uc-start-from>\n </uc-modal>\n\n <uc-modal id="upload-list" strokes block-body-scrolling>\n <uc-upload-list></uc-upload-list>\n </uc-modal>\n\n <uc-modal id="camera" strokes block-body-scrolling>\n <uc-camera-source></uc-camera-source>\n </uc-modal>\n\n <uc-modal id="url" strokes block-body-scrolling>\n <uc-url-source></uc-url-source>\n </uc-modal>\n\n <uc-modal id="external" strokes block-body-scrolling>\n <uc-external-source></uc-external-source>\n </uc-modal>\n\n <uc-modal id="cloud-image-edit" strokes block-body-scrolling>\n <uc-cloud-image-editor-activity></uc-cloud-image-editor-activity>\n </uc-modal>\n',yc.bindAttributes({headless:null});const wc=kc;function _c(){const t=["485254WrDxXr","uploadcare.uploader.sourceList","323603seiVZJ","isOfficialPlugin","config","contentLanguage","_defineLocale","requires","8zyCIgE","40Abqbdd","286746nEHAhS","pluginName","editor","182460ijwScG","436100PLrLiL","get","isPremiumPlugin","defineLocale","uploadcare.locale","Uploadcare","defineComponents","define","locale","Local","104Luasfl","2936844djrunN","URL","40tuXuIE","207570OnogoQ"];return(_c=function(){return t})()}function kc(t,e){const r=_c();return(kc=function(t,e){return r[t-=356]})(t,e)}!function(t){const e=kc,r=t();for(;;)try{if(351585===-parseInt(e(377))/1+-parseInt(e(362))/2+-parseInt(e(358))/3*(parseInt(e(356))/4)+-parseInt(e(357))/5*(-parseInt(e(361))/6)+parseInt(e(379))/7*(parseInt(e(372))/8)+parseInt(e(373))/9+-parseInt(e(375))/10*(-parseInt(e(376))/11))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(_c);class xc extends a.Plugin{static get[wc(384)](){return[be,$]}static get[wc(359)](){return wc(367)}static get[wc(380)](){return!0}static get[wc(364)](){return!0}constructor(r){const i=wc;super(r),r[i(381)][i(369)](i(378),[e[i(371)],e[i(374)]]),t[i(368)](t),this[i(383)]()}[wc(383)](){const e=wc,r=this[e(360)][e(381)][e(363)](e(366)),i=this[e(360)][e(370)][e(382)];r&&t[e(365)](i,r)}}class Cc extends c.View{constructor(t){super(t);const e=t.t,r=this.bindTemplate,i=new c.SpinnerView;i.isVisible=!0,this.setTemplate({tag:"div",attributes:{class:["ck-uploadcare-form__loading"],tabindex:"-1"},children:[{tag:"div",attributes:{class:["ck-uploadcare-form__loading-spinner"]},children:[i,{text:r.to("imageUploadProgress",t=>e("Loading image...")+" ("+(t||0)+"%)")}]},{tag:"div",attributes:{class:["ck-uploadcare-form__skeleton"]},children:[{tag:"div",children:[{tag:"span"},{tag:"span"},{tag:"span"}]},{tag:"div",children:[{tag:"span"},{tag:"span"},{tag:"span"},{tag:"span"},{tag:"span"}]}]}]})}}class Ec extends c.View{constructor(t){super(t);const e=t.t;this.set("errorType",null);const r=new c.ButtonView(t);r.label=e({id:"Try again (Uploadcare)",string:"Try again"}),r.withText=!0,r.class="ck-button-action",r.on("execute",()=>{this.fire("retry")}),r.bind("isVisible").to(this,"errorType",t=>"NotFound"!==t);const i=new c.IconView;i.content=s.IconError,i.extendTemplate({attributes:{style:{width:"50px",height:"50px"}}});const o=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck-uploadcare-form__error"],tabindex:"-1"},children:[{tag:"div",attributes:{class:["ck-uploadcare-form__error-contents"]},children:[i,{tag:"h3",attributes:{style:{fontWeight:"bold"}},children:[{text:e("Unable to load")}]},{text:o.to("errorType",t=>e("NotFound"!==t?"We were unable to load the image due to network connection issues.":"The image was not found. Its source may have been removed."))},r]},{tag:"div",attributes:{class:["ck-uploadcare-form__skeleton"]},children:[{tag:"div",children:[{tag:"span"},{tag:"span"},{tag:"span"}]},{tag:"div",children:[{tag:"span"},{tag:"span"},{tag:"span"},{tag:"span"},{tag:"span"}]}]}]})}}function Tc(){const t=["uc-light","8083350zxOjRl","3323386hzGodH","image-edit","1260262vChyqX","8vDLtCr","ck-uploadcare-theme","imageSrc","1132611QLCEbv","setTemplate","585784PEcNYi","uc-cloud-image-editor","bindTemplate","set","4299148PDEJLE","965100DPkvON"];return(Tc=function(){return t})()}function Ac(t,e){const r=Tc();return(Ac=function(t,e){return r[t-=235]})(t,e)}!function(t){const e=Ac,r=t();for(;;)try{if(966907===parseInt(e(246))/1+-parseInt(e(244))/2+-parseInt(e(250))/3*(-parseInt(e(247))/4)+-parseInt(e(241))/5+parseInt(e(243))/6+-parseInt(e(240))/7+parseInt(e(236))/8)break;r.push(r.shift())}catch(t){r.push(r.shift())}}(Tc);class Ic extends c.View{constructor(t,e){const r=Ac;super(t);const i=this[r(238)];this[r(239)](r(249),""),this[r(235)]({tag:r(237),attributes:{...e,class:[r(242),r(248)],"ctx-name":r(245),"cdn-url":i.to(r(249))}})}}const Sc=$c;function Mc(){const t=["add","addEventListener","status","ready","30aiTHfT","_errorView","3000432tfRaCh","observe","10894860EIyUvt","change:status","7546545TeosRD","_focusableView","filter","render","once","uploading","fire","74304IlhgFE","cdnUrl","_addUploadcareImageEditorListeners","474288YsBJfO","21339ytWaoc","_setView","set","nodeName","element","focus","addedNodes","1823728SPtgLK","_loadingView","uc-cloud-image-editor","getFocusableElement","112vhmolh","toLowerCase","_items","28MdUoLd","length","target","cancel","ck-reset_all-excluded","_waitForImageEditorComponent","retry","apply","div","addMany","querySelector","detail","ck-uploadcare-form","setTemplate","disconnect","clear","createCollection","_editingView","error","_addErrorViewListeners"];return(Mc=function(){return t})()}function $c(t,e){const r=Mc();return($c=function(t,e){return r[t-=134]})(t,e)}!function(t){const e=$c,r=t();for(;;)try{if(658637===parseInt(e(136))/1*(parseInt(e(147))/2)+-parseInt(e(176))/3+-parseInt(e(135))/4*(parseInt(e(174))/5)+parseInt(e(187))/6+parseInt(e(150))/7*(parseInt(e(143))/8)+-parseInt(e(180))/9+parseInt(e(178))/10)break;r.push(r.shift())}catch(t){r.push(r.shift())}}(Mc);class Lc extends z{[Sc(149)];[Sc(144)];[Sc(175)];[Sc(167)];[Sc(181)];constructor(t,e,r){const i=Sc;super(t),this[i(149)]=this[i(166)](),this[i(144)]=new Cc(t),this[i(175)]=new Ec(t),this[i(167)]=new Ic(t,r),this[i(181)]=new c.View(t),this[i(181)][i(163)](this[i(146)]()),this[i(138)](i(172),e),this[i(163)]({tag:i(158),attributes:{class:["ck",i(154),i(162)],tabindex:"-1"},children:this[i(149)]}),this[i(137)](),this[i(184)](i(183),()=>{const t=i;this[t(155)](this[t(140)],e=>{this[t(134)](e)})}),this.on(i(179),()=>{this[i(137)]()}),this[i(169)]()}[Sc(141)](){const t=Sc;this[t(140)][t(141)]()}[Sc(137)](){const t=Sc;switch(this[t(149)][t(165)](),this[t(172)]){case t(185):this[t(149)][t(170)](this[t(144)]);break;case t(168):this[t(149)][t(170)](this[t(175)]);break;case t(173):this[t(149)][t(159)]([this[t(167)],this[t(181)]])}}[Sc(155)](t,e){const r=Sc,i=r(145),o=t[r(160)](i);if(o)return e(o);const n=new MutationObserver(o=>{const a=r,s=o[a(182)](e=>e[a(152)]===t&&e[a(142)][a(151)]>0&&e[a(142)][0][a(139)][a(148)]()===i);s[a(151)]&&(n[a(164)](),e(s[0][a(142)][0]))});n[r(177)](t,{childList:!0,subtree:!0})}[Sc(134)](t){const e=Sc;t[e(171)](e(157),t=>{const r=e;this[r(186)](r(157),{imageSrc:t[r(161)][r(188)]})}),t[e(171)](e(153),()=>{const t=e;this[t(186)](t(153))})}[Sc(169)](){const t=Sc;this[t(175)].on(t(156),()=>{const e=t;this[e(186)](e(156))})}}class Oc extends((0,L.ObservableMixin)()){_editor;_dialog;_imageElement;_imageCache;_controller;_attributes;constructor(t,e,r){super(),this._editor=t,this._dialog=e,this._imageElement=r,this._imageCache=this._editor.plugins.get("UploadcareImageEditUI").imageCache,this._attributes=this._editor.config.get("uploadcare.editor")||{},this.set({isActive:!0,imageStatus:"ready",imageErrorType:null,imageId:null,imageSrc:null,imageDimension:null,imageUploadProgress:null}),this._prepareImage(),this._showDialog()}destroy(){this.isActive=!1,this.stopListening(),this.stopDelegating(),"uploading"===this.imageStatus&&this._controller&&this._controller.abort()}async _prepareImage(){const t=this._imageElement,e=t.getAttribute("uploadcareImageId"),r=t.getAttribute("src");if(e)await this._loadImageInfo(e,r);else if(this._imageCache.has(r)){const t=this._imageCache.get(r);this.imageStatus="ready",this.imageErrorType=null,this.imageSrc=t.url,this.imageDimension=t.dimension,this.imageId=t.id}else this.imageStatus="uploading",this.imageUploadProgress=0,this._controller=new AbortController,await this._uploadImage(this._imageElement,this._controller)}_showDialog(){const{locale:t}=this._editor,e=t.t,r=new Lc(t,this.imageStatus,this._attributes);r.bind("status").to(this,"imageStatus"),r._loadingView.bind("imageUploadProgress").to(this,"imageUploadProgress"),r._editingView.bind("imageSrc").to(this,"imageSrc"),r._errorView.bind("errorType").to(this,"imageErrorType"),this._addEditViewListeners(r,this._imageElement),this._dialog.show({id:"uploadcareImageEdit",icon:s.IconUploadcareImageEdit,title:e({id:"Edit Image (Uploadcare)",string:"Edit image"}),content:r,position:c.DialogViewPosition.EDITOR_TOP_CENTER,isModal:!0,onShow:()=>{r.focus()},onHide:()=>{r.destroy(),this.destroy()},keystrokeHandlerOptions:{filter:t=>!Y(t,r.element)}})}_loadImageInfo(t,e){return de.getInfo(t,{publicKey:this._editor.config.get("uploadcare.pubkey"),baseURL:this._editor.config.get("uploadcare.uploader.baseUrl")}).then(r=>{const{width:i,height:o}=r.imageInfo;this.imageStatus="ready",this.imageErrorType=null,this.imageSrc=e,this.imageDimension={width:i,height:o},this.imageId=t}).catch(t=>{this.imageStatus="error",this.imageErrorType="FileNotFoundError"===t.code?"NotFound":"Network",this.imageSrc=null,this.imageDimension=null,this.imageId=null,this.imageUploadProgress=null})}_uploadImage(t,e){return this._getImageAsFile(t).then(t=>de.upload({publicKey:this._editor.config.get("uploadcare.pubkey"),baseURL:this._editor.config.get("uploadcare.uploader.baseUrl"),baseCDN:this._editor.config.get("uploadcare.uploader.cdnCname"),signal:e.signal,file:t,onProgress:t=>{t&&t.isComputable&&(this.imageUploadProgress=Math.ceil(100*t.value))}})).then(e=>{const{width:r,height:i}=e.imageInfo;this.imageStatus="ready",this.imageErrorType=null,this.imageSrc=e.cdnUrl,this.imageDimension={width:r,height:i},this.imageId=e.uuid,this.imageUploadProgress=null;const o=t.getAttribute("src");this._imageCache.set(o,{id:e.uuid,url:e.cdnUrl,dimension:this.imageDimension})}).catch(t=>{this.imageStatus="error",this.imageErrorType="FileNotFoundError"===t.code?"NotFound":"Network",this.imageSrc=null,this.imageDimension=null,this.imageId=null,this.imageUploadProgress=null})}_addEditViewListeners(t,e){t.on("apply",(t,r)=>{this._replaceImage(e,r.imageSrc,this.imageId),this._dialog.hide()}),t.on("retry",()=>{this.imageStatus="uploading",this.imageUploadProgress=0,this._controller=new AbortController,this._uploadImage(this._imageElement,this._controller)}),t.on("cancel",()=>{this._dialog.hide()})}_replaceImage(t,e,r){const i=this._editor,{width:o,height:n}=K(e,this.imageDimension.width,this.imageDimension.height),{imageFallbackUrl:a,imageSources:s}=H(e,o);i.model.change(e=>{if("$graveyard"===t.root.rootName){i.execute("insertImage",{imageType:t.is("element","imageInline")?"imageInline":null,source:{...Object.fromEntries(t.getAttributes()),uploadcareImageId:r,src:a,sources:s,width:o,height:n}});const c=t.getChildren();t=i.model.document.selection.getSelectedElement();for(const r of c)e.append(e.cloneElement(r),t)}else e.setSelection(t,"on"),i.execute("uploadcareImageReplace",{...Object.fromEntries(t.getAttributes()),uploadcareImageId:r,src:a,sources:s,width:o,height:n},t);e.setSelection(t,"on")})}async _getImageAsFile(t){const e=L.global.window,r=L.global.document.location.href,i=new e.URL(t.getAttribute("src"),r);if("data:"===i.protocol){const t=i.href.split(","),r=t[0].match(/:(.*?);/)[1],o=r.split("/")[1],n=e.atob(t[t.length-1]);let a=n.length;const s=new e.Uint8Array(a);for(;a--;)s[a]=n.charCodeAt(a);return new e.File([s],"image."+o,{type:r})}const o=i.href.split("/"),n=o[o.length-1],a=n.split(".")[1];return e.fetch(i.href).then(t=>t.clone().blob()).then(t=>new e.File([t],n,{type:"image/"+a}))}}const Rc=Pc;!function(t){const e=Pc,r=t();for(;;)try{if(330780===parseInt(e(367))/1+parseInt(e(362))/2*(-parseInt(e(372))/3)+parseInt(e(369))/4*(-parseInt(e(370))/5)+-parseInt(e(361))/6*(parseInt(e(354))/7)+parseInt(e(374))/8*(-parseInt(e(352))/9)+-parseInt(e(350))/10*(parseInt(e(382))/11)+parseInt(e(368))/12)break;r.push(r.shift())}catch(t){r.push(r.shift())}}(Nc);class Uc extends a.Command{[Rc(360)];static get[Rc(381)](){return[c.Dialog]}[Rc(364)];constructor(t){const e=Rc;super(t),this[e(360)]=void 0,this[e(364)]=function(t){const e=j,r=W(t);return t=>!(!t||!t.is(e(417),e(430))&&!t.is(e(417),e(389)))&&(!!t[e(380)](e(384))||!!t[e(380)](e(408))&&r(t[e(394)](e(408))))}(t[e(379)][e(356)](e(358))||[]),this[e(355)]({isActive:!1})}[Rc(376)](){const t=Rc,e=this[t(378)][t(365)][t(371)][t(373)][t(359)]();this[t(375)]=this[t(364)](e)}[Rc(383)](){const t=Rc;this[t(360)]&&(this[t(353)](t(363)),this[t(360)]=void 0);const e=this[t(378)][t(365)][t(371)][t(373)][t(359)]();e&&(e.is(t(366),t(351))||e.is(t(366),t(357)))&&(this[t(360)]=new Oc(this[t(378)],this[t(378)][t(380)][t(356)](c.Dialog),e),this[t(377)](t(363)).to(this[t(360)],t(363)))}}function Pc(t,e){const r=Nc();return(Pc=function(t,e){return r[t-=350]})(t,e)}function Nc(){const t=["refresh","bind","editor","config","plugins","requires","957qdlIdI","execute","46580vPADvL","imageBlock","1824318ZkfFtk","unbind","7dwiMiL","set","get","imageInline","uploadcare.allowExternalImagesEditing","getSelectedElement","imageEditController","1744602eNJFcq","407254MdiaNQ","isActive","_isEditable","model","element","423099AyJfRi","19586136BzrHoe","4kerOUj","1074505nUzsFu","document","9dXRSeh","selection","8icEXxg","isEnabled"];return(Nc=function(){return t})()}function zc(t,e){const r=Vc();return(zc=function(t,e){return r[t-=443]})(t,e)}const Dc=zc;!function(t){const e=zc,r=t();for(;;)try{if(337701===-parseInt(e(456))/1*(-parseInt(e(460))/2)+parseInt(e(459))/3*(parseInt(e(462))/4)+parseInt(e(463))/5*(parseInt(e(458))/6)+parseInt(e(453))/7*(-parseInt(e(448))/8)+parseInt(e(470))/9*(parseInt(e(449))/10)+parseInt(e(472))/11*(-parseInt(e(468))/12)+parseInt(e(445))/13*(-parseInt(e(451))/14))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(Vc);class Fc extends a.Command{[Dc(443)](){const t=Dc,e=this[t(450)][t(466)][t(469)][t(464)][t(454)]();this[t(455)]=Boolean(e&&(e.is(t(457),t(467))||e.is(t(457),t(446))))}[Dc(465)](t){const e=Dc,r=this[e(450)][e(466)][e(469)][e(464)][e(454)]();this[e(450)][e(466)][e(471)](i=>{const o=e;i[o(461)](t,r),i[o(444)](o(452),r),i[o(444)](o(447),r)})}}function Vc(){const t=["8635uzcFpL","refresh","removeAttribute","13JNmizD","imageInline","sizes","326464emEnLc","1454580KivIuq","editor","15687098UmpmRk","srcset","7EKmVph","getSelectedElement","isEnabled","1CZsrgo","element","637110lTOUZB","3pQCPGB","577228gKrZkq","setAttributes","1145020JeFEVa","20pdfNRc","selection","execute","model","imageBlock","1260TxSsHH","document","36zjrmsU","change"];return(Vc=function(){return t})()}const Bc=jc;function jc(t,e){const r=Hc();return(jc=function(t,e){return r[t-=193]})(t,e)}function Hc(){const t=["728895PXDDsb","add","420170ankSsU","91EJOVFt","ImageEditing","pluginName","uploadcareImageReplace","12qiqQrZ","init","354174mIOjFU","368LufFoH","1815786LdvoCq","12202MZsUsJ","ImageUtils","24bsmWoo","UploadcareImageEditEditing","requires","111811VyremA","134DCvBWA","isOfficialPlugin","commands","uploadcareImageEdit","627708Wodbhn","44pYakjW","isPremiumPlugin"];return(Hc=function(){return t})()}!function(t){const e=jc,r=t();for(;;)try{if(503225===parseInt(e(214))/1*(parseInt(e(208))/2)+parseInt(e(205))/3*(parseInt(e(210))/4)+parseInt(e(196))/5*(-parseInt(e(203))/6)+parseInt(e(213))/7*(-parseInt(e(206))/8)+parseInt(e(207))/9+-parseInt(e(198))/10*(-parseInt(e(194))/11)+-parseInt(e(193))/12*(parseInt(e(199))/13))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(Hc);class qc extends a.Plugin{static get[Bc(201)](){return Bc(211)}static get[Bc(212)](){const t=Bc;return[be,c.Notification,t(209),t(200)]}static get[Bc(215)](){return!0}static get[Bc(195)](){return!0}[Bc(204)](){const t=Bc,{editor:e}=this;e[t(216)][t(197)](t(217),new Uc(e)),e[t(216)][t(197)](t(202),new Fc(e))}}var Kc=r(947),Gc={attributes:{"data-cke":!0}};Gc.setAttributes=y(),Gc.insert=f().bind(null,"head"),Gc.domAPI=m(),Gc.insertStyleElement=_();p()(Kc.A,Gc);Kc.A&&Kc.A.locals&&Kc.A.locals;class Wc extends a.Plugin{_imageCache=new Map;static get pluginName(){return"UploadcareImageEditUI"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}get imageCache(){return this._imageCache}init(){const t=this.editor;t.ui.componentFactory.add("uploadcareImageEdit",e=>{const r=t.commands.get("uploadcareImageEdit"),i=new c.ButtonView(e),o=e.t;return i.set({icon:s.IconUploadcareImageEdit,tooltip:!0,label:o({id:"Edit Image (Uploadcare)",string:"Edit image"})}),i.bind("isEnabled").to(r),i.bind("isOn").to(r,"isActive"),this.listenTo(i,"execute",()=>{t.execute("uploadcareImageEdit"),t.editing.view.focus()}),i}),this._initConfig()}_initConfig(){const t=(0,L.createElement)(document,"uc-config",{"ctx-name":"image-edit",removeCopyright:"true",localeName:this.editor.locale.contentLanguage});document.body.appendChild(t),this.listenTo(this.editor,"destroy",()=>{t.remove()})}}var Xc=Yc;function Zc(){var t=["201146urFWbM","296157tRGEju","1321119RXqniP","isPremiumPlugin","5228XfOqaS","210xXiAiR","485WkBTxu","UploadcareImageEdit","148494zblQSt","252493UXQNgS","requires","4sMEjdM","pluginName","21VZjLdn","isOfficialPlugin","2199264jJhGFm"];return(Zc=function(){return t})()}function Yc(t,e){var r=Zc();return(Yc=function(t,e){return r[t-=404]})(t,e)}!function(t){for(var e=Yc,r=t();;)try{if(141510===parseInt(e(418))/1+parseInt(e(404))/2*(parseInt(e(410))/3)+-parseInt(e(413))/4*(parseInt(e(415))/5)+parseInt(e(417))/6*(parseInt(e(406))/7)+parseInt(e(408))/8+-parseInt(e(411))/9+parseInt(e(414))/10*(-parseInt(e(409))/11))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(Zc);class Qc extends a.Plugin{static get[Xc(405)](){return Xc(416)}static get[Xc(419)](){return[qc,Wc]}static get[Xc(407)](){return!0}static get[Xc(412)](){return!0}}function Jc(t,e){var r=tl();return(Jc=function(t,e){return r[t-=153]})(t,e)}function tl(){var t=["280KWHQJB","347132ayPpqB","7rXxhZb","284655OExKzR","51472ckkJDg","181819nLWwvr","1772816yMldWX","8345JCQljR","4cWJEnA","1435482QzYbud","798zrylWA"];return(tl=function(){return t})()}!function(t){for(var e=Jc,r=t();;)try{if(113056===parseInt(e(163))/1+-parseInt(e(160))/2+-parseInt(e(162))/3*(-parseInt(e(156))/4)+parseInt(e(155))/5*(parseInt(e(158))/6)+-parseInt(e(161))/7*(-parseInt(e(154))/8)+parseInt(e(157))/9+-parseInt(e(159))/10*(parseInt(e(153))/11))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(tl)})(),(window.CKEditor5=window.CKEditor5||{}).uploadcare=i})();
5
+ */(()=>{var t={102:t=>{"use strict";var e={};t.exports=function(t,r){var i=function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(r)}},106:t=>{"use strict";t.exports=function(t){return t[1]}},123:t=>{"use strict";t.exports=function(t,e){Object.keys(e).forEach(function(r){t.setAttribute(r,e[r])})}},184:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var i=r(106),o=r.n(i),n=r(779),a=r.n(n)()(o());a.push([t.id,':root{--ck-image-processing-highlight-color:#f9fafa;--ck-image-processing-background-color:#e3e5e8}.ck.ck-editor__editable .image-inline.image-processing picture,.ck.ck-editor__editable .image.image-processing picture{display:block;height:100%;position:relative;width:100%}.ck.ck-editor__editable .image-inline.image-processing picture:before,.ck.ck-editor__editable .image.image-processing picture:before{animation:ck-image-processing-animation 2s linear infinite;background:linear-gradient(90deg,var(--ck-image-processing-background-color),var(--ck-image-processing-highlight-color),var(--ck-image-processing-background-color));background-size:200% 100%;content:"";height:100%;left:0;position:absolute;top:0;width:100%;z-index:1}.ck.ck-editor__editable .image-inline.image-processing picture img,.ck.ck-editor__editable .image.image-processing picture img{height:100%}.ck.ck-editor__editable .image-inline.image-processing-blur,.ck.ck-editor__editable .image.image-processing-blur{clip-path:inset(0);filter:blur(1.6rem)}@keyframes ck-image-processing-animation{0%{background-position:200% 0}to{background-position:-200% 0}}',""]);const s=a},237:t=>{"use strict";t.exports=CKEditor5.dll},260:(t,e,r)=>{t.exports=r(237)("./src/upload.js")},297:t=>{"use strict";var e,r=(e=[],function(t,r){return e[t]=r,e.filter(Boolean).join("\n")});function i(t,e,i,o){var n;if(i)n="";else{n="",o.supports&&(n+="@supports (".concat(o.supports,") {")),o.media&&(n+="@media ".concat(o.media," {"));var a=void 0!==o.layer;a&&(n+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),n+=o.css,a&&(n+="}"),o.media&&(n+="}"),o.supports&&(n+="}")}if(t.styleSheet)t.styleSheet.cssText=r(e,n);else{var s=document.createTextNode(n),c=t.childNodes;c[e]&&t.removeChild(c[e]),c.length?t.insertBefore(s,c[e]):t.appendChild(s)}}var o={singleton:null,singletonCounter:0};t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=o.singletonCounter++,r=o.singleton||(o.singleton=t.insertStyleElement(t));return{update:function(t){i(r,e,!1,t)},remove:function(t){i(r,e,!0,t)}}}},311:(t,e,r)=>{t.exports=r(237)("./src/ui.js")},355:(t,e,r)=>{t.exports=r(237)("./src/icons.js")},387:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var i=r(106),o=r.n(i),n=r(779),a=r.n(n)()(o());a.push([t.id,".ck-uploadcare-theme{--uc-font-size:13px;--uc-radius:2px;--uc-padding:0.9em;--uc-primary-oklch-light:54.45% 0.182 263.76;--uc-foreground-light:#333;--uc-secondary-foreground-light:#333;--uc-muted-foreground-light:#333;--uc-border-light:#ccced1}",""]);const s=a},474:t=>{"use strict";t.exports=function(t,e){return e||(e={}),t?(t=String(t.__esModule?t.default:t),/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]|(%20)/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t):t}},584:(t,e,r)=>{t.exports=r(237)("./src/utils.js")},621:(t,e,r)=>{"use strict";r.d(e,{A:()=>h});var i=r(106),o=r.n(i),n=r(779),a=r.n(n),s=r(474),c=r.n(s),l=new URL(r(659),r.b),u=a()(o()),d=c()(l);u.push([t.id,`@keyframes fake-progress-animation{0%{transform:translate(-100%)}to{transform:translate(calc(100/var(--l-fake-progress-width)*100*1%))}}@keyframes uc-spinner-keyframes{0%{transform:rotate(0)}to{transform:rotate(1turn)}}uc-activity-header:not(#\\#){color:var(--uc-foreground);display:flex;font-size:1em;font-weight:500;gap:var(--uc-padding);justify-content:space-between;padding:var(--uc-padding)}uc-activity-header:not(#\\#)>*{align-items:center;display:flex}uc-camera-source:not(#\\#){background-color:var(--uc-background);border-radius:var(--uc-radius);display:flex;flex-direction:column;height:100%;max-height:100%;overflow:hidden;position:relative;width:100%}[uc-modal]:not(#\\#)>dialog:has(uc-camera-source[active]){height:100%;width:100%}uc-camera-source:not(.uc-initialized):not(#\\#) .uc-controls{display:none}uc-camera-source:not(#\\#) video{background-color:var(--uc-muted);border-radius:var(--uc-radius);display:block;max-height:100%;object-fit:contain;object-position:center center;width:100%}uc-camera-source:not(#\\#) .uc-toolbar{background-color:var(--uc-background);bottom:0;display:flex;justify-content:space-between;padding:var(--uc-padding);position:absolute;width:100%}uc-camera-source:not(#\\#) .uc-content{display:flex;flex:1;height:100%;justify-content:center;overflow:hidden;padding:var(--uc-padding);padding-top:0;width:100%}uc-camera-source:not(#\\#) .uc-message-box{display:flex;flex-direction:column;grid-gap:40px;align-items:center;color:var(--uc-foreground);justify-content:center;padding:40px 40px 0}uc-camera-source:not(#\\#) .uc-message-box button{background-color:var(--uc-primary);color:var(--uc-primary-foreground)}uc-camera-source:not(#\\#) .uc-shot-btn{background-color:var(--uc-primary-light);border-radius:50%;color:var(--uc-background);height:58px;opacity:.85;transition:bottom var(--uc-transition),opacity var(--uc-transition),transform var(--uc-transition);width:58px}uc-camera-source:not(#\\#) .uc-shot-btn:hover{opacity:1;transform:scale(1.05)}uc-camera-source:not(#\\#) .uc-shot-btn:active{opacity:1;transform:scale(1)}uc-camera-source:not(#\\#) .uc-shot-btn[disabled]{bottom:-80px}uc-camera-source:not(#\\#) .uc-shot-btn uc-icon svg{height:20px;width:20px}uc-camera-source:not(#\\#) .uc-controls{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between;min-height:74px;padding:0 var(--uc-padding) var(--uc-padding);position:relative}uc-camera-source:not(#\\#) .uc-switcher{display:flex;gap:calc(var(--uc-padding)/2)}uc-camera-source:not(#\\#) .uc-switch.uc-active{background-color:var(--uc-secondary)}uc-camera-source:not(#\\#) .uc-camera-actions{align-items:center;display:flex;gap:5px;justify-content:center}uc-camera-source:not(#\\#) .uc-stop-record{background-color:var(--uc-destructive-foreground-light);opacity:1}:where(uc-camera-source:is(.uc-recording)):not(#\\#) .uc-recording-timer uc-icon{display:none}:where(uc-camera-source:is(.uc-recording)):not(#\\#) .uc-recording-timer{pointer-events:none}uc-camera-source:not(#\\#) .uc-recording-timer{overflow:hidden;position:relative;z-index:1}:where(uc-camera-source):not(#\\#) .uc-recording-timer uc-icon{height:10px;margin-right:10px;width:10px}uc-camera-source:not(#\\#) .uc-recording-timer .uc-line{background-color:var(--uc-foreground-light);bottom:0;content:"";height:2px;left:0;position:absolute;right:0;transform:scaleX(0);transform-origin:left;transition:transform var(--uc-transition)}uc-camera-source:not(#\\#) .uc-btn-microphone{z-index:1}uc-camera-source:not(#\\#) .uc-select{display:flex}uc-camera-source:not(#\\#) .uc-audio-select{width:98px}uc-camera-source:not(#\\#) .uc-audio-select select{width:100%}uc-camera-source:not(#\\#) .uc-camera-action{inset:0 var(--uc-padding) var(--uc-padding);margin:0 auto;position:absolute}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#){--color-primary-accent:var(--uc-primary);--color-text-base:var(--uc-foreground);--color-text-accent-contrast:var(--uc-background);--color-fill-contrast:var(--uc-background);--color-modal-backdrop:oklch(0 0 0/.1);--color-image-background:var(--uc-muted);--color-focus-ring:var(--color-primary-accent);--color-crop-guides:var(--uc-foreground);--font-size-ui:var(--uc-font-size);--size-touch-area:var(--uc-button-size);--size-panel-heading:calc(var(--uc-button-size) + var(--uc-padding)*2);--size-ui-min-width:130px;--size-line-width:1px;--size-modal-width:650px;--size-icon:calc(var(--uc-button-size)/2);--border-radius-editor:var(--uc-radius);--border-radius-thumb:var(--uc-radius);--border-radius-ui:var(--uc-radius);--border-radius-base:var(--uc-radius);--cldtr-gap-min:5px;--cldtr-gap-mid-1:10px;--cldtr-gap-mid-2:15px;--cldtr-gap-max:20px;--transition-duration-2:var(--transition-duration-all,.2s);--transition-duration-3:var(--transition-duration-all,.3s);--transition-duration-4:var(--transition-duration-all,.4s);--transition-duration-5:var(--transition-duration-all,.5s);--modal-header-opacity:1;--modal-header-height:var(--size-panel-heading);--modal-toolbar-height:var(--size-panel-heading);--transparent-pixel:url(${d});display:block;height:100%;max-height:100%;width:100%}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) :is([can-handle-paste]:hover,[can-handle-paste]:focus){--can-handle-paste:"true"}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) :is([tabindex][focus-visible],[tabindex]:hover,[with-effects][focus-visible],[with-effects]:hover){--filter-effect:var(--hover-filter)!important;--opacity-effect:var(--hover-opacity)!important;--color-effect:var(--hover-color-rgb)!important;--background-effect:var(--hover-background)!important}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) :is([tabindex]:active,[with-effects]:active){--filter-effect:var(--down-filter)!important;--opacity-effect:var(--down-opacity)!important;--color-effect:var(--down-color-rgb)!important;--background-effect:var(--down-background)!important}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) :is([tabindex][active],[with-effects][active]){--filter-effect:var(--active-filter)!important;--opacity-effect:var(--active-opacity)!important;--color-effect:var(--active-color-rgb)!important;--background-effect:var(--active-background)!important}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) [hidden-scrollbar]::-webkit-scrollbar{display:none}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) [hidden-scrollbar]{-ms-overflow-style:none;scrollbar-width:none}[uc-cloud-image-editor].uc-editor_ON:not(#\\#):not(#\\#):not(#\\#){--modal-header-opacity:0;--modal-header-height:0px;--modal-toolbar-height:calc(var(--size-panel-heading)*2)}[uc-cloud-image-editor].uc-editor_OFF:not(#\\#):not(#\\#):not(#\\#){--modal-header-opacity:1;--modal-header-height:var(--size-panel-heading);--modal-toolbar-height:var(--size-panel-heading)}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper{--l-min-img-height:var(--modal-toolbar-height);--l-max-img-height:100%;--l-edit-button-width:120px;--l-toolbar-horizontal-padding:var(--cldtr-gap-mid-1);display:grid;grid-template-rows:minmax(var(--l-min-img-height),var(--l-max-img-height)) minmax(var(--modal-toolbar-height),auto);height:100%;overflow:hidden;overflow-y:auto;position:relative}@media only screen and (max-width:800px){[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper{--l-edit-button-width:70px;--l-toolbar-horizontal-padding:var(--cldtr-gap-min)}}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport{align-items:center;display:flex;justify-content:center;overflow:hidden}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-image_container>.uc-image{--viewer-image-opacity:1;background-color:var(--color-image-background);box-sizing:border-box;display:block;height:100%;left:0;object-fit:scale-down;opacity:var(--viewer-image-opacity);pointer-events:auto;position:absolute;top:0;transform:scale(1);user-select:none;width:100%;z-index:10}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-image_container>.uc-image.uc-image_visible_viewer{transition:opacity var(--transition-duration-3) ease-in-out,transform var(--transition-duration-4)}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-image_container>.uc-image.uc-image_hidden_to_cropper{--viewer-image-opacity:0;background-image:var(--transparent-pixel);pointer-events:none;transform:scale(1);transition:transform var(--transition-duration-4),opacity var(--transition-duration-3) step-end}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-image_container>.uc-image.uc-image_hidden_effects{--viewer-image-opacity:0;pointer-events:none;transform:scale(1);transition:opacity var(--transition-duration-3) cubic-bezier(.5,0,1,1),transform var(--transition-duration-4)}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-image_container{background-color:var(--color-image-background);display:block;height:100%;position:relative;transition:var(--transition-duration-3);width:100%}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-toolbar{position:relative;transition:.3s}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-toolbar>.uc-toolbar_content{background-color:var(--color-fill-contrast);bottom:0;box-sizing:border-box;height:var(--modal-toolbar-height);left:0;min-height:var(--size-panel-heading);position:absolute;width:100%}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-toolbar>.uc-toolbar_content.uc-toolbar_content__viewer{align-items:center;display:flex;height:var(--size-panel-heading);justify-content:space-between;padding-left:var(--l-toolbar-horizontal-padding);padding-right:var(--l-toolbar-horizontal-padding)}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-toolbar>.uc-toolbar_content.uc-toolbar_content__editor{display:flex}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-info_pan{position:absolute;user-select:none}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-file_type_outer{display:flex;max-width:120px;position:absolute;transform:translate(-40px);user-select:none;z-index:2}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-file_type_outer>.uc-file_type{padding:4px .8em}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-network_problems_splash{background-color:var(--color-fill-contrast);display:flex;flex-direction:column;height:100%;position:absolute;width:100%;z-index:4}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-network_problems_splash>.uc-network_problems_content{align-items:center;display:flex;flex:1;flex-direction:column;justify-content:center}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-network_problems_splash>.uc-network_problems_content>.uc-network_problems_icon{align-items:center;background-color:var(--uc-muted);border-radius:50%;color:var(--uc-foreground);display:flex;height:40px;justify-content:center;width:40px}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-network_problems_splash>.uc-network_problems_content>.uc-network_problems_text{color:var(--uc-foreground);font-size:var(--font-size-ui);margin-top:var(--cldtr-gap-max)}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-network_problems_splash>.uc-network_problems_footer{align-items:center;display:flex;height:var(--size-panel-heading);justify-content:center}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#)>.uc-svg{border-top-left-radius:var(--border-radius-base);border-top-right-radius:var(--border-radius-base);height:100%;left:0;opacity:inherit;position:absolute;top:0;transition:var(--transition-duration-3);width:100%;z-index:2}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#)>.uc-thumb{--idle-color-rgb:var(--color-text-base);--hover-color-rgb:var(--color-primary-accent);--focus-color-rgb:var(--color-primary-accent);--down-color-rgb:var(--color-primary-accent);--color-effect:var(--idle-color-rgb);color:var(--color-effect);transition:color var(--transition-duration-3),opacity var(--transition-duration-3)}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-thumb--visible{opacity:1;pointer-events:auto}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-thumb--hidden{opacity:0;pointer-events:none}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-guides{transition:var(--transition-duration-3)}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-guides--hidden{opacity:0}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-guides--semi-hidden{opacity:.2}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-guides--visible{opacity:1}uc-editor-aspect-ratio-button-control:not(#\\#):not(#\\#):not(#\\#),uc-editor-button-control:not(#\\#):not(#\\#):not(#\\#),uc-editor-crop-button-control:not(#\\#):not(#\\#):not(#\\#),uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#),uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#),uc-editor-operation-control:not(#\\#):not(#\\#):not(#\\#){--l-base-min-width:var(--uc-button-size);--l-base-height:var(--uc-button-size);--opacity-effect:var(--idle-opacity);--color-effect:var(--idle-color-rgb);--background-effect:var(--idle-background);--filter-effect:var(--idle-filter);--idle-color-rgb:var(--uc-secondary-foreground);--idle-opacity:1;--idle-filter:1;--idle-background:var(--uc-secondary);--hover-color-rgb:var(--uc-secondary-foreground);--hover-opacity:1;--hover-filter:.8;--hover-background:var(--uc-secondary-hover);--down-color-rgb:var(--hover-color-rgb);--down-opacity:1;--down-filter:.6;--down-background:var(--uc-secondary);border-radius:var(--uc-radius)}uc-editor-aspect-ratio-button-control:not(#\\#):not(#\\#):not(#\\#)>button,uc-editor-button-control:not(#\\#):not(#\\#):not(#\\#)>button,uc-editor-crop-button-control:not(#\\#):not(#\\#):not(#\\#)>button,uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>button,uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button,uc-editor-operation-control:not(#\\#):not(#\\#):not(#\\#)>button{all:unset;align-items:center;color:var(--color-effect);cursor:pointer;display:grid;grid-template-columns:var(--l-base-min-width) auto;grid-template-rows:100%;height:var(--l-base-height);opacity:var(--opacity-effect);position:relative;transition:var(--l-width-transition)}uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button{grid-template-columns:auto var(--l-base-min-width)}uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button>uc-icon{margin-left:var(--cldtr-gap-mid-1);width:10px}:where(uc-editor-button-control,uc-editor-crop-button-control,uc-editor-aspect-ratio-button-control,uc-editor-freeform-button-control,uc-editor-filter-control,uc-editor-operation-control):not(#\\#):not(#\\#):not(#\\#)>uc-icon>svg{height:var(--size-icon);width:var(--size-icon)}uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>uc-icon.uc-original-icon>svg{height:100%;width:100%}uc-editor-aspect-ratio-button-control.uc-active:not(#\\#):not(#\\#):not(#\\#),uc-editor-button-control.uc-active:not(#\\#):not(#\\#):not(#\\#),uc-editor-crop-button-control.uc-active:not(#\\#):not(#\\#):not(#\\#),uc-editor-filter-control.uc-active:not(#\\#):not(#\\#):not(#\\#),uc-editor-freeform-button-control.uc-active:not(#\\#):not(#\\#):not(#\\#),uc-editor-operation-control.uc-active:not(#\\#):not(#\\#):not(#\\#){--idle-color-rgb:var(--uc-primary-foreground);--idle-background:var(--uc-primary);--idle-opacity:1;--hover-color-rgb:var(--uc-primary-foreground);--hover-background:var(--uc-primary);--hover-opacity:1}uc-editor-filter-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#) .uc-preview[loaded]{opacity:1}uc-editor-filter-control.uc-active:not(#\\#):not(#\\#):not(#\\#) .uc-preview{opacity:0}uc-editor-aspect-ratio-button-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#),uc-editor-button-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#),uc-editor-crop-button-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#),uc-editor-filter-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#),uc-editor-freeform-button-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#),uc-editor-operation-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#){--idle-color-rgb:var(--uc-secondary-foreground)}:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-aspect-ratio-button-control.uc-not_active,:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-button-control.uc-not_active,:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-crop-button-control.uc-not_active,:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-filter-control.uc-not_active,:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-freeform-button-control.uc-not_active,:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-operation-control.uc-not_active{--idle-background:transparent;--hover-background:var(--uc-secondary);outline:1px solid var(--uc-border);outline-offset:-1px}uc-editor-aspect-ratio-button-control:not(#\\#):not(#\\#):not(#\\#)>button:before,uc-editor-button-control:not(#\\#):not(#\\#):not(#\\#)>button:before,uc-editor-crop-button-control:not(#\\#):not(#\\#):not(#\\#)>button:before,uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>button:before,uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button:before,uc-editor-operation-control:not(#\\#):not(#\\#):not(#\\#)>button:before{background-color:var(--background-effect);border-radius:var(--border-radius-editor);content:"";height:100%;left:0;position:absolute;right:0;transition:var(--transition-duration-3);width:100%;z-index:-1}uc-editor-aspect-ratio-button-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title,uc-editor-button-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title,uc-editor-crop-button-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title,uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title,uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title,uc-editor-operation-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title{font-size:.7em;letter-spacing:1.004px;padding-right:var(--cldtr-gap-mid-1);text-transform:uppercase}uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title{padding-left:var(--cldtr-gap-mid-1);padding-right:0}uc-editor-aspect-ratio-button-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon,uc-editor-button-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon,uc-editor-crop-button-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon,uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon,uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon,uc-editor-operation-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon{pointer-events:none}uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-preview{background-repeat:no-repeat;background-size:contain;border-radius:var(--border-radius-editor);filter:brightness(var(--filter-effect));height:var(--l-base-height);left:0;opacity:0;position:absolute;right:0;transition:var(--transition-duration-3);width:100%;z-index:-1}uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>.uc-original-icon{color:var(--color-effect);opacity:.3}uc-editor-image-cropper:not(#\\#):not(#\\#):not(#\\#){color:var(--color-crop-guides);display:block;height:100%;left:0;opacity:0;pointer-events:none;position:absolute;top:0;touch-action:none;width:100%;z-index:10}uc-editor-image-cropper.uc-active_from_editor:not(#\\#):not(#\\#):not(#\\#),uc-editor-image-cropper.uc-active_from_viewer:not(#\\#):not(#\\#):not(#\\#){opacity:1;pointer-events:auto;transform:scale(1) translate(0);transition:transform var(--transition-duration-4) cubic-bezier(.37,0,.63,1) .4s,opacity var(--transition-duration-3)}uc-editor-image-cropper.uc-inactive_to_editor:not(#\\#):not(#\\#):not(#\\#){opacity:0;pointer-events:none;transition:transform var(--transition-duration-4) cubic-bezier(.37,0,.63,1),opacity var(--transition-duration-3) calc(var(--transition-duration-3) + .05s)}uc-editor-image-cropper:not(#\\#):not(#\\#):not(#\\#)>.uc-canvas{z-index:1}uc-editor-image-cropper:not(#\\#):not(#\\#):not(#\\#)>.uc-canvas,uc-editor-image-fader:not(#\\#):not(#\\#):not(#\\#){display:block;height:100%;left:0;position:absolute;top:0;width:100%}uc-editor-image-fader.uc-active_from_viewer:not(#\\#):not(#\\#):not(#\\#){opacity:1;pointer-events:auto;transform:scale(1);transition:transform var(--transition-duration-4),opacity var(--transition-duration-3) step-start;z-index:3}uc-editor-image-fader.uc-active_from_cropper:not(#\\#):not(#\\#):not(#\\#){opacity:1;pointer-events:auto;transform:scale(1);transition:transform var(--transition-duration-4),opacity var(--transition-duration-3) step-end;z-index:3}uc-editor-image-fader.uc-inactive_to_cropper:not(#\\#):not(#\\#):not(#\\#){opacity:0;pointer-events:none;transform:scale(1);transition:transform var(--transition-duration-4),opacity var(--transition-duration-3) step-end;z-index:3}uc-editor-image-fader:not(#\\#):not(#\\#):not(#\\#) .uc-fader-image{content-visibility:auto;display:block;height:100%;left:0;object-fit:scale-down;position:absolute;top:0;transform:scale(1);user-select:none;width:100%}uc-editor-image-fader:not(#\\#):not(#\\#):not(#\\#) .uc-fader-image--preview{background-color:var(--color-image-background);border-top-left-radius:var(--border-radius-base);border-top-right-radius:var(--border-radius-base);opacity:0;transform:scale(1);transition:var(--transition-duration-3)}uc-editor-scroller:not(#\\#):not(#\\#):not(#\\#){align-items:center;display:flex;height:100%;overflow-x:scroll;width:100%}uc-editor-slider:not(#\\#):not(#\\#):not(#\\#){align-items:center;display:flex;height:var(--size-panel-heading);justify-content:center;width:100%}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#){height:100%;position:relative;width:100%}@media only screen and (max-width:600px){uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#){--l-tab-gap:var(--cldtr-gap-mid-1);--l-slider-padding:var(--uc-padding);--l-controls-padding:var(--uc-padding)}}@media only screen and (min-width:601px){uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#){--l-tab-gap:var(--cldtr-gap-max);--l-slider-padding:var(--uc-padding);--l-controls-padding:var(--uc-padding)}}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container{height:100%;overflow:hidden;position:relative;width:100%}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar{background-color:var(--color-fill-contrast);display:grid;grid-template-rows:1fr 1fr;height:100%;position:absolute;transition:opacity var(--transition-duration-3) ease-in-out,transform var(--transition-duration-3) ease-in-out,visibility var(--transition-duration-3) ease-in-out;width:100%}.uc-sub-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-list-aspect-ratio-container>.uc-list-aspect-ratio{align-items:center;display:grid;gap:6px;grid-auto-flow:column;height:var(--size-panel-heading);justify-content:center}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar.uc-sub-toolbar--visible{opacity:1;pointer-events:auto;transform:translateY(0)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar.uc-sub-toolbar--top-hidden{opacity:0;pointer-events:none;transform:translateY(100%)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar.uc-sub-toolbar--bottom-hidden{opacity:0;pointer-events:none;transform:translateY(-100%)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row{align-items:center;display:flex;justify-content:space-between;padding-left:var(--l-controls-padding);padding-right:var(--l-controls-padding)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles{display:grid;grid-auto-flow:column;position:relative;grid-gap:0 var(--l-tab-gap);align-items:center;height:100%}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles>.uc-tab-toggles_indicator{background-color:var(--uc-secondary-foreground);bottom:0;height:2px;left:0;position:absolute;transform:translate(0);transition:transform var(--transition-duration-3);width:var(--size-touch-area)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row{position:relative}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content{content-visibility:auto;display:flex;height:100%;left:0;opacity:0;overflow:hidden;position:absolute;top:0;width:100%}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content.uc-tab-content--visible{opacity:1;pointer-events:auto}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content.uc-tab-content--hidden{opacity:0;pointer-events:none}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles>.uc-tab-toggle.uc-tab-toggle--visible{display:contents}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles.uc-tab-toggles--hidden,uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles>.uc-tab-toggle.uc-tab-toggle--hidden{display:none}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles>.uc-tab-toggle>uc-btn-ui{width:var(--uc-button-size)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles>.uc-tab-toggle>uc-btn-ui>uc-icon>svg{height:var(--size-icon);width:var(--size-icon)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content .uc-controls-list_align{box-sizing:border-box;display:grid;grid-template-areas:". inner .";grid-template-columns:1fr auto 1fr;min-width:100%;padding-left:var(--uc-padding)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content .uc-controls-list_inner{display:grid;gap:6px;grid-area:inner;grid-auto-flow:column}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content .uc-controls-list_inner:last-child{padding-right:var(--uc-padding)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-controls-list_last-item{margin-right:var(--cldtr-gap-max)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-info-tooltip_container{align-items:flex-start;display:flex;height:100%;justify-content:center;position:absolute;width:100%}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-info-tooltip_wrapper{display:flex;flex-direction:column;height:100%;justify-content:flex-end;pointer-events:none;position:absolute;top:calc(-100% - var(--cldtr-gap-mid-2))}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-info-tooltip{background-color:var(--color-text-accent-contrast);border-radius:var(--border-radius-editor);color:var(--color-text-base);font-size:.7em;letter-spacing:1px;opacity:0;padding:3px 6px;text-transform:uppercase;transform:translateY(100%);transition:var(--transition-duration-3);z-index:3}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-info-tooltip_visible{opacity:1;transform:translateY(0)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-slider{padding-left:var(--l-slider-padding);padding-right:var(--l-slider-padding)}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#)>button{--filter-effect:var(--idle-brightness);--opacity-effect:var(--idle-opacity);--color-effect:var(--idle-color-rgb);--background-effect:var(--idle-background);--l-transition-effect:var( --css-transition,color var(--transition-duration-2),background-color var(--transition-duration-2),filter var(--transition-duration-2) );all:unset;align-items:center;background-color:var(--background-effect);border-radius:var(--uc-radius);box-sizing:var(--css-box-sizing,border-box);color:var(--color-effect);cursor:pointer;display:inline-flex;filter:brightness(var(--filter-effect));font-size:1em;height:var(--css-height,var(--uc-button-size));opacity:var(--opacity-effect);padding-left:var(--css-padding-left,14px);padding-right:var(--css-padding-right,14px);transition:var(--l-transition-effect);user-select:none}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#)>button>uc-icon{pointer-events:none}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-text{white-space:nowrap}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-icon{align-items:center;color:var(--color-effect);display:flex;filter:brightness(var(--filter-effect));justify-content:center;transition:var(--l-transition-effect)}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-icon_left{margin-left:0;margin-right:var(--cldtr-gap-mid-1)}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-icon_right{margin-left:var(--cldtr-gap-mid-1);margin-right:0}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-icon_single{margin-left:0;margin-right:0}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-icon_hidden{display:none;margin:0}uc-btn-ui.uc-primary:not(#\\#):not(#\\#):not(#\\#)>button{--idle-color-rgb:var(--uc-primary-foreground);--idle-brightness:1;--idle-opacity:1;--idle-background:var(--uc-primary);--hover-color-rgb:var(--uc-primary-foreground);--hover-brightness:1;--hover-opacity:1;--hover-background:var(--uc-primary-hover);--down-color-rgb:var(--uc-primary-foreground);--down-brightness:.75;--down-opacity:1;--down-background:var(--uc-primary);--active-color-rgb:var(--uc-primary-foreground);--active-brightness:1;--active-opacity:1;--active-background:var(--uc-primary)}uc-btn-ui.uc-primary-icon:not(#\\#):not(#\\#):not(#\\#)>button{--idle-color-rgb:var(--uc-primary);--idle-brightness:1;--idle-opacity:1;--idle-background:transparent;--hover-color-rgb:var(--uc-primary);--hover-brightness:1;--hover-opacity:1;--hover-background:var(--uc-primary-transparent);--down-color-rgb:var(--uc-primary);--down-brightness:.75;--down-opacity:1;--down-background:var(--uc-primary-transparent);--active-color-rgb:var(--uc-primary-foreground);--active-brightness:1;--active-opacity:1;--active-background:var(--uc-primary);padding:0;width:var(--uc-button-size)}uc-btn-ui.uc-secondary:not(#\\#):not(#\\#):not(#\\#)>button{--idle-color-rgb:var(--uc-secondary-foreground);--idle-brightness:1;--idle-opacity:1;--idle-background:var(--uc-secondary);--hover-color-rgb:var(--uc-secondary-foreground);--hover-brightness:1;--hover-opacity:1;--hover-background:var(--uc-secondary-hover);--down-color-rgb:var(--uc-secondary-foreground);--down-brightness:1;--down-opacity:1;--down-background:var(--uc-secondary-hover);--active-color-rgb:var(--uc-secondary-foreground);--active-brightness:1;--active-opacity:1;--active-background:transparent}:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-btn-ui.uc-secondary>button{border:1px solid var(--uc-border)}uc-btn-ui.uc-secondary-icon:not(#\\#):not(#\\#):not(#\\#)>button,uc-btn-ui.uc-tab:not(#\\#):not(#\\#):not(#\\#)>button{--idle-color-rgb:var(--uc-secondary-foreground);--idle-brightness:1;--idle-opacity:1;--idle-background:transparent;--hover-color-rgb:var(--uc-secondary-foreground);--hover-brightness:1;--hover-opacity:1;--hover-background:var(--uc-secondary);--down-color-rgb:var(--uc-secondary-foreground);--down-brightness:1;--down-opacity:1;--down-background:var(--uc-secondary);--active-color-rgb:var(--uc-secondary-foreground);--active-brightness:1;--active-opacity:1;--active-background:transparent;padding:0;width:var(--uc-button-size)}uc-btn-ui.uc-default:not(#\\#):not(#\\#):not(#\\#)>button{--idle-color-rgb:var(--uc-secondary-foreground);--idle-brightness:1;--idle-opacity:1;--idle-background:var(--uc-secondary);--hover-color-rgb:var(--uc-secondary-foreground);--hover-brightness:1;--hover-opacity:1;--hover-background:var(--uc-secondary-hover);--down-color-rgb:var(--uc-secondary-foreground);--down-brightness:.75;--down-opacity:1;--down-background:var(--uc-secondary);--active-color-rgb:var(--uc-primary);--active-brightness:1;--active-opacity:1;--active-background:var(--uc-primary-transparent)}:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-btn-ui.uc-default>button{--idle-background:transparent;--hover-background:var(--uc-secondary);--active-background:var(--uc-foreground);--active-color-rgb:var(--uc-background)}uc-line-loader-ui:not(#\\#):not(#\\#):not(#\\#){height:2px;left:0;opacity:.5;position:absolute;top:0;width:100%;z-index:9999}uc-line-loader-ui:not(#\\#):not(#\\#):not(#\\#) .uc-inner{height:100%;max-width:200px;width:25%}uc-line-loader-ui:not(#\\#):not(#\\#):not(#\\#) .uc-line{background-color:var(--uc-primary);height:100%;transform:translate(-101%);transition:transform 1s;width:100%}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#){--l-thumb-size:24px;--l-zero-dot-size:5px;--l-zero-dot-offset:2px;--idle-color-rgb:var(--uc-foreground);--hover-color-rgb:var(--uc-primary);--down-color-rgb:var(--uc-primary);--color-effect:var(--idle-color-rgb);--l-color:var(--color-effect);align-items:center;display:flex;height:calc(var(--l-thumb-size) + (var(--l-zero-dot-size) + var(--l-zero-dot-offset))*2);justify-content:center;position:relative;width:100%}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-thumb{background-color:var(--l-color);border-radius:50%;height:var(--l-thumb-size);left:0;opacity:1;position:absolute;transform:translate(0);transition:opacity var(--transition-duration-2),background-color var(--transition-duration-2);width:var(--l-thumb-size)}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-steps{align-items:center;box-sizing:border-box;display:flex;height:100%;justify-content:space-between;padding-left:calc(var(--l-thumb-size)/2);padding-right:calc(var(--l-thumb-size)/2);position:absolute;width:100%}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-border-step{border-right:1px solid var(--uc-foreground);height:10px;opacity:1;transition:border-color var(--transition-duration-2);width:0}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-minor-step{border-right:1px solid var(--uc-foreground);height:4px;opacity:.6;transition:border-color var(--transition-duration-2);width:0}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-zero-dot{background-color:var(--color-primary-accent);border-radius:50%;height:var(--l-zero-dot-size);left:calc(var(--l-thumb-size)/2 - var(--l-zero-dot-size)/2);opacity:0;position:absolute;top:calc(100% - var(--l-zero-dot-offset)*2);transition:var(--transition-duration-3);width:var(--l-zero-dot-size)}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-input{cursor:pointer;height:100%;margin:0;opacity:0;position:absolute;width:calc(100% - 10px)}uc-presence-toggle.uc-transition:not(#\\#):not(#\\#):not(#\\#){transition:opacity var(--transition-duration-3),visibility var(--transition-duration-3)}uc-presence-toggle.uc-visible:not(#\\#):not(#\\#):not(#\\#){opacity:1;pointer-events:inherit}uc-presence-toggle.uc-hidden:not(#\\#):not(#\\#):not(#\\#){opacity:0;pointer-events:none}uc-presence-toggle.uc-initial:not(#\\#):not(#\\#):not(#\\#){display:none!important;transition:none!important}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) [role=button]:focus-visible,[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) button:focus-visible{outline:1px auto Highlight;outline:1px auto -webkit-focus-ring-color}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) .uc-cloud-mask{pointer-events:none}[uc-aspect-ratio-freeform]:not(#\\#):not(#\\#):not(#\\#) button{display:flex}[uc-aspect-ratio-freeform]:not(#\\#):not(#\\#):not(#\\#) uc-icon{display:none}[uc-aspect-ratio-freeform]:not(#\\#):not(#\\#):not(#\\#) .uc-title{padding-left:var(--cldtr-gap-mid-1)}:where(uc-editor-freeform-button-control,uc-editor-aspect-ratio-button-control:last-of-type):not(#\\#):not(#\\#):not(#\\#){margin-right:calc(var(--cldtr-gap-mid-1)*3)}:where([uc-cloud-image-editor]):not(#\\#):not(#\\#):not(#\\#) uc-icon{display:flex;height:100%;justify-content:center;width:100%}:where([uc-cloud-image-editor]):not(#\\#):not(#\\#):not(#\\#) uc-icon svg{height:calc(var(--uc-button-size)/2);width:calc(var(--uc-button-size)/2)}uc-cloud-image-editor-activity:not(#\\#){background-color:var(--uc-background);display:flex;height:100%;overflow:hidden;position:relative;width:100%}[uc-modal]:not(#\\#)>dialog:has(uc-cloud-image-editor-activity[active]){height:100%;width:100%}uc-config:not(#\\#){display:none}uc-copyright:not(#\\#){display:flex;justify-content:center;width:100%}uc-copyright:not(#\\#) .uc-credits{all:unset;background-color:var(--uc-background);border-radius:6px;bottom:12px;color:var(--uc-muted-foreground);cursor:pointer;font-size:12px;font-weight:400;opacity:.9;padding:2px 5px;position:absolute;transition:opacity var(--uc-transition),background-color var(--uc-transition)}uc-copyright:not(#\\#) .uc-credits:focus-visible{outline:1px auto Highlight;outline:1px auto -webkit-focus-ring-color}uc-copyright:not(#\\#) .uc-credits:hover{background-color:var(--uc-muted);opacity:1}:where([uc-drop-area]):not(#\\#){border:1px dashed var(--uc-border);border-radius:calc(var(--uc-radius)*1.75);overflow:hidden;padding:2px;transition:border var(--uc-transition),border-radius var(--uc-transition)}:where([uc-drop-area]):not(#\\#),:where([uc-drop-area]):not(#\\#) .uc-content-wrapper{align-items:center;display:flex;height:100%;justify-content:center;width:100%}:where([uc-drop-area]):not(#\\#) .uc-text{color:var(--uc-muted-foreground);margin:var(--uc-padding);position:relative;transition:color var(--uc-transition)}:where([uc-drop-area])[ghost][drag-state=inactive]:not(#\\#){display:none}:where([uc-drop-area])[ghost]:not([fullscreen]):is([drag-state=active],[drag-state=near],[drag-state=over]):not(#\\#){background:var(--uc-background)}:where([uc-drop-area]):is([drag-state=active],[drag-state=near],[drag-state=over],:hover):not(#\\#){background:var(--uc-primary-transparent);border-color:var(--uc-primary-transparent)}:where(.uc-contrast):not(#\\#) :where([uc-drop-area]):is([drag-state=active],[drag-state=near],[drag-state=over],:hover){background:transparent;border-color:var(--uc-foreground);border-style:solid;border-width:2px;color:var(--uc-foreground)}:where([uc-drop-area]):is([drag-state=active],[drag-state=near]):not(#\\#){opacity:1}:where([uc-drop-area])[drag-state=over]:not(#\\#){border-color:var(--uc-primary);opacity:1}:where([uc-drop-area])[with-icon]:not(#\\#){min-height:180px}:where([uc-drop-area])[with-icon]:not(#\\#) .uc-content-wrapper{display:flex;flex-direction:column}:where([uc-drop-area])[with-icon]:not(#\\#) .uc-text{color:var(--uc-foreground);font-size:1.1em;font-weight:500}:where([uc-drop-area])[with-icon]:not(#\\#) .uc-icon-container{background-color:var(--uc-muted);border-radius:50%;color:var(--uc-foreground);height:64px;margin:var(--uc-padding);overflow:hidden;position:relative;transition:color var(--uc-transition),background-color var(--uc-transition);width:64px}:where([uc-drop-area])[with-icon]:not(#\\#) uc-icon{height:32px;left:calc(50% - 16px);position:absolute;top:calc(50% - 16px);transition:transform var(--uc-transition);width:32px}:where([uc-drop-area])[with-icon]:not(#\\#) uc-icon:last-child{transform:translateY(48px)}:where(.uc-contrast):not(#\\#) :where([uc-drop-area])[with-icon]:hover .uc-icon-container,:where(.uc-contrast):not(#\\#) :where([uc-drop-area])[with-icon]:hover .uc-text{color:var(--uc-foreground)}:where([uc-drop-area])[with-icon]:hover:not(#\\#) .uc-icon-container{background-color:var(--uc-primary-transparent)}:where(.uc-contrast):not(#\\#) :where([uc-drop-area])[with-icon]:hover .uc-icon-container{background-color:var(--uc-muted)}:where([uc-drop-area])[with-icon]:not(#\\#)>.uc-content-wrapper:is([drag-state=active],[drag-state=near],[drag-state=over]) .uc-icon-container{background-color:var(--uc-primary);color:var(--uc-primary-foreground)}:where([uc-drop-area])[with-icon]:not(#\\#)>.uc-content-wrapper:is([drag-state=active],[drag-state=near],[drag-state=over]) .uc-text{color:var(--uc-foreground)}:where(.uc-contrast):not(#\\#) :where([uc-drop-area])[with-icon]>.uc-content-wrapper:is([drag-state=active],[drag-state=near],[drag-state=over]) .uc-text{color:var(--uc-foreground)}:where([uc-drop-area])[with-icon]:not(#\\#)>.uc-content-wrapper:is([drag-state=active],[drag-state=near],[drag-state=over]) uc-icon:first-child{transform:translateY(-48px)}:where([uc-drop-area])[with-icon]:not(#\\#)>.uc-content-wrapper:is([drag-state=active],[drag-state=near],[drag-state=over]) uc-icon:last-child{transform:translateY(0)}:where([uc-drop-area])[with-icon]:not(#\\#)>.uc-content-wrapper[drag-state=near] uc-icon:last-child{transform:scale(1.3)}:where([uc-drop-area])[with-icon]:not(#\\#)>.uc-content-wrapper[drag-state=over] uc-icon:last-child{transform:scale(1.5)}:where([uc-drop-area])[fullscreen]:not(#\\#){align-items:center;display:flex;height:calc(100vh - var(--uc-padding)*2);inset:0;justify-content:center;margin:var(--uc-padding);position:fixed;width:calc(100vw - var(--uc-padding)*2);z-index:2147483647}:where([uc-drop-area])[fullscreen]:not(#\\#) .uc-content-wrapper{background-color:var(--uc-background);border-radius:calc(var(--uc-radius)*1.75);box-shadow:var(--uc-dialog-shadow);color:var(--uc-foreground);height:180px;max-width:calc(var(--uc-dialog-width)*.8);transition:color var(--uc-transition),background-color var(--uc-transition),box-shadow var(--uc-transition),border-radius var(--uc-transition),transform var(--uc-transition);width:100%}:where([uc-drop-area])[with-icon][fullscreen][drag-state=active]:not(#\\#)>.uc-content-wrapper,:where([uc-drop-area])[with-icon][fullscreen][drag-state=near]:not(#\\#)>.uc-content-wrapper{opacity:0;transform:translateY(10px)}:where([uc-drop-area])[with-icon][fullscreen][drag-state=over]:not(#\\#)>.uc-content-wrapper{opacity:1;transform:translateY(0)}:is(:where([uc-drop-area])[with-icon][fullscreen]):not(#\\#)>.uc-content-wrapper uc-icon:first-child{transform:translateY(-48px)}:where([uc-drop-area])[clickable]:not(#\\#){cursor:pointer}uc-external-source:not(#\\#){background-color:var(--uc-background);display:flex;flex-direction:column;height:100%;overflow:hidden;position:relative;width:100%}[uc-modal]:not(#\\#)>dialog:has(uc-external-source[active]){height:100%;width:100%}uc-external-source:not(#\\#)>.uc-content{display:grid;flex:1;grid-template-rows:1fr min-content;position:relative}uc-external-source:not(#\\#) iframe{border:none;display:block;height:100%;width:100%}uc-external-source:not(#\\#) .uc-iframe-wrapper{overflow:hidden}uc-external-source:not(#\\#) .uc-toolbar{display:flex;width:100%;grid-gap:var(--uc-padding);align-items:center;border-top:1px solid var(--uc-border);justify-content:space-between;padding:var(--uc-padding)}uc-external-source:not(#\\#) .uc-back-btn{padding-left:0}uc-external-source:not(#\\#) .uc-selection-status-box{align-items:center;color:var(--uc-foreground);display:flex;flex-direction:column;justify-content:center}uc-external-source:not(#\\#) .uc-selection-status-box button{background:none;color:var(--uc-primary);height:auto;padding:0}uc-external-source:not(#\\#) .uc-selection-status-box button:hover{text-decoration:underline}uc-external-source:not(#\\#) uc-activity-header{justify-content:flex-end;left:0;pointer-events:none;position:absolute;right:0;top:0;width:100%;z-index:1}uc-external-source:not(#\\#) uc-activity-header .uc-close-btn{pointer-events:auto}uc-external-source:not(#\\#) .uc-done-btn>span.uc-hidden{pointer-events:none;visibility:hidden}uc-external-source:not(#\\#) .uc-done-btn>uc-spinner{align-items:center;display:flex;height:100%;justify-content:center;position:absolute;width:100%}uc-file-item:not(#\\#){--uc-file-item-gap:4px;--uc-file-item-height:calc(var(--uc-preview-size) + var(--uc-padding)*2 + var(--uc-file-item-gap));display:block;min-height:var(--uc-file-item-height);overflow:hidden}uc-file-item:last-of-type:not(#\\#){--uc-file-item-gap:0}uc-file-item:not(#\\#)>.uc-inner{align-items:center;background-color:var(--uc-muted);border-radius:var(--uc-radius);display:grid;font-size:.925em;gap:2px;grid-template-columns:var(--uc-preview-size) 1fr max-content;margin-bottom:var(--uc-file-item-gap);overflow:hidden;padding:var(--uc-padding);position:relative;transition:background-color var(--uc-transition)}uc-file-item:not(#\\#)>.uc-inner[focused]{background-color:transparent}uc-file-item:not(#\\#)>.uc-inner[uploading] .uc-edit-btn{display:none}uc-file-item:not(#\\#)>:where(.uc-inner[failed],.uc-inner[limit-overflow]){background-color:var(--uc-destructive)}uc-file-item:not(#\\#) .uc-thumb{background-color:var(--uc-secondary);background-position:50%;background-repeat:no-repeat;background-size:cover;border-radius:var(--uc-radius);display:inline-flex;height:var(--uc-preview-size);position:relative;width:var(--uc-preview-size)}uc-file-item:not(#\\#) .uc-file-name-wrapper{align-items:flex-start;color:var(--uc-muted-foreground);display:flex;flex-direction:column;justify-content:center;max-width:100%;overflow:hidden;padding-left:var(--uc-padding);padding-right:var(--uc-padding);text-align:left}uc-file-item:not(#\\#) .uc-file-name{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}uc-file-item:not(#\\#) .uc-file-error{color:var(--uc-destructive-foreground);display:none;font-size:.85em;z-index:2}uc-file-item:not(#\\#) button.uc-edit-btn,uc-file-item:not(#\\#) button.uc-remove-btn{color:var(--uc-muted-foreground)}uc-file-item:not(#\\#) button svg{pointer-events:none}uc-file-item:not(#\\#) button.uc-upload-btn{display:none}uc-file-item:not(#\\#) .uc-badge{align-items:center;background-color:var(--uc-foreground);border-radius:50%;bottom:2px;color:var(--uc-background);display:flex;height:14px;justify-content:center;opacity:0;position:absolute;right:2px;transform:scale(.3);transition:opacity var(--uc-transition),transform var(--uc-transition);width:14px}uc-file-item:not(#\\#)>.uc-inner:where([failed],[limit-overflow],[finished]) .uc-badge{opacity:1;transform:scale(1)}uc-file-item:not(#\\#)>.uc-inner:where([failed],[limit-overflow]) .uc-badge{background-color:var(--uc-destructive-foreground)}uc-file-item:not(#\\#)>.uc-inner:where([failed],[limit-overflow]) .uc-file-error{display:block}uc-file-item:not(#\\#) .uc-badge uc-icon,uc-file-item:not(#\\#) .uc-badge uc-icon svg{height:100%;width:100%}uc-file-item:not(#\\#) .uc-progress-bar{height:2px;opacity:.7;top:calc(100% - 2px)}:where(.uc-contrast):not(#\\#) uc-file-item .uc-progress-bar{opacity:1}uc-file-item:not(#\\#) .uc-file-actions{align-items:center;display:flex;gap:2px;justify-content:center}uc-file-item[mode=grid]:not(#\\#){min-height:auto;overflow:visible}uc-file-item[mode=grid]:not(#\\#) .uc-inner{background-color:transparent;border-radius:0;grid-template-columns:1fr;grid-template-rows:1fr max-content;height:100%;margin-bottom:0;padding:0}uc-file-item[mode=grid]:not(#\\#) .uc-inner[failed] .uc-badge{display:none}uc-file-item[mode=grid]:not(#\\#) .uc-thumb{height:100%;width:100%}uc-file-item[mode=grid]:not(#\\#) .uc-badge{bottom:var(--uc-padding);right:var(--uc-padding)}uc-file-item[mode=grid]:not(#\\#) .uc-file-name-wrapper{padding:0}uc-file-item[mode=grid]:not(#\\#) .uc-file-name:not([hidden])+.uc-file-error{bottom:calc(var(--uc-padding) + var(--uc-font-size))}uc-file-item[mode=grid]:not(#\\#) .uc-file-error{background-color:var(--uc-destructive-foreground);bottom:var(--uc-padding);color:var(--uc-background)}uc-file-item[mode=grid]:not(#\\#) .uc-file-error,uc-file-item[mode=grid]:not(#\\#) .uc-file-hint{border-radius:var(--uc-radius);left:var(--uc-padding);padding:calc(var(--uc-padding)/2) var(--uc-padding);position:absolute;right:var(--uc-padding)}uc-file-item[mode=grid]:not(#\\#) .uc-file-hint{background-color:var(--uc-background);bottom:calc(var(--uc-padding)*2);color:var(--uc-foreground)}uc-file-item[mode=grid]:not(#\\#) .uc-file-actions{position:absolute;right:var(--uc-padding);top:var(--uc-padding)}uc-file-item[mode=grid]:not(#\\#) button{background-color:var(--uc-background)}uc-file-item[mode=grid]:not(#\\#) button:hover{background-color:var(--uc-muted)}uc-file-item[mode=grid]:not(#\\#):not(#\\#):not(#\\#):not(#\\#):not(#\\#) .uc-progress-bar{height:4px!important;top:auto!important}uc-file-item[mode=grid]:not(#\\#) .uc-progress-bar{background-color:var(--uc-background);border-radius:var(--uc-radius);bottom:var(--uc-padding);left:var(--uc-padding);right:var(--uc-padding);transition:background-color .3s,opacity .3s;width:auto;z-index:1}uc-file-item[mode=grid]:not(#\\#) .uc-progress-bar :is(.uc-fake-progress,.uc-progress){background-color:var(--uc-primary)}uc-file-item[mode=grid]:not(#\\#) .uc-progress-bar[hasfilename]{bottom:calc(var(--uc-padding) + var(--uc-font-size))}uc-icon:not(#\\#){align-items:center;display:inline-flex;height:var(--uc-button-size);justify-content:center;width:var(--uc-button-size)}uc-icon:not(#\\#) svg{height:calc(var(--uc-button-size)/2);overflow:visible;width:calc(var(--uc-button-size)/2)}@supports selector(dialog::backdrop){:where([uc-modal]):not(#\\#)>dialog::backdrop{background-color:#0000001a}:where([uc-modal])[strokes]:not(#\\#)>dialog::backdrop{background-image:var(--modal-backdrop-background-image)}}:where([uc-modal]):not(#\\#)>dialog[open]{opacity:1;transform:translateY(0);visibility:visible}:where([uc-modal]):not(#\\#)>dialog:not([open]){opacity:0;transform:translateY(20px);visibility:hidden}:where([uc-modal]):not(#\\#)>dialog{background-color:var(--uc-background);border:0;border-radius:calc(var(--uc-radius)*1.75);box-shadow:var(--uc-dialog-shadow);display:flex;flex-direction:column;margin:auto;max-height:min(calc(100% - var(--uc-padding)*2),var(--uc-dialog-max-height));max-width:min(calc(100% - var(--uc-padding)*2),var(--uc-dialog-max-width));min-height:var(--uc-button-size);overflow:hidden;padding:0;transition:transform .4s ease,opacity .4s ease;width:min(var(--uc-dialog-width),100%)}:where(.uc-contrast):not(#\\#) :where([uc-modal])>dialog{outline:1px solid var(--uc-border)}uc-progress-bar:not(#\\#){--l-progress-value:0;bottom:0;height:100%;left:0;opacity:1;overflow:hidden;pointer-events:none;position:absolute;top:0;transition:opacity .3s;width:100%}uc-progress-bar.uc-progress-bar--hidden:not(#\\#){opacity:0}uc-progress-bar:not(#\\#) .uc-progress{background-color:var(--uc-primary);height:100%;opacity:1;position:absolute;transform:translate(0);transition:width .6s,opacity .3s;width:calc(var(--l-progress-value)*1%)}uc-progress-bar:not(#\\#) .uc-progress--hidden{opacity:0}uc-progress-bar:not(#\\#) .uc-fake-progress{--l-fake-progress-width:30;animation:fake-progress-animation 1s ease-in-out infinite;background-color:var(--uc-primary);height:100%;opacity:1;position:absolute;transition:opacity .3s;width:calc(var(--l-fake-progress-width)*1%);z-index:1}uc-progress-bar:not(#\\#) .uc-fake-progress--hidden{animation:none;opacity:0}uc-progress-bar-common:not(#\\#){background-color:var(--uc-background);bottom:0;display:block;height:10px;left:0;position:fixed;right:0;transition:opacity .3s;z-index:10000}uc-progress-bar-common:not([active]):not(#\\#){opacity:0;pointer-events:none}uc-select:not(#\\#){display:inline-flex}uc-select:not(#\\#) select{align-items:center;background-color:var(--uc-secondary);border:none;border-radius:var(--uc-radius);color:var(--uc-secondary-foreground);cursor:pointer;display:inline-flex;font-family:inherit;font-size:1em;height:var(--uc-button-size);justify-content:center;padding:0 14px;position:relative;transition:background-color var(--uc-transition);user-select:none;white-space:nowrap}:where([uc-simple-btn]):not(#\\#){display:inline-flex;position:relative}:where([uc-simple-btn]):not(#\\#) button{background-color:var(--uc-simple-btn);color:var(--uc-simple-btn-foreground);font-family:var(--uc-simple-btn-font-family);font-size:var(--uc-simple-btn-font-size);gap:.5em;height:auto;padding:var(--uc-simple-btn-padding)}:where([uc-simple-btn]):not(#\\#) button uc-icon{height:auto;width:auto}:where([uc-simple-btn]):not(#\\#) button uc-icon svg{height:.9em;width:.9em}:where([uc-simple-btn]):not(#\\#) button:hover{background-color:var(--uc-simple-btn-hover)}:where([uc-simple-btn]):not(#\\#)>uc-drop-area{display:contents}:where([uc-simple-btn]):not(#\\#) .uc-visual-drop-area{align-items:center;background-color:transparent;border:1px dashed var(--uc-simple-btn-foreground);border-radius:inherit;color:transparent;display:flex;font-size:var(--uc-simple-btn-font-size);height:100%;justify-content:center;left:0;opacity:0;padding:var(--uc-simple-btn-padding);position:absolute;top:0;transition:opacity var(--uc-transition);width:100%}:where([uc-simple-btn]):not(#\\#)>uc-drop-area[drag-state=active] .uc-visual-drop-area{opacity:1}:where([uc-simple-btn]):not(#\\#)>uc-drop-area[drag-state=inactive] .uc-visual-drop-area{opacity:0}:where([uc-simple-btn]):not(#\\#)>uc-drop-area[drag-state=near] .uc-visual-drop-area{opacity:1}:where([uc-simple-btn]):not(#\\#)>uc-drop-area[drag-state=over] .uc-visual-drop-area{opacity:1}uc-source-btn:not(#\\#)>button{align-items:center;background-color:unset;border-radius:var(--uc-radius);color:var(--uc-foreground);cursor:pointer;display:flex;height:unset;margin-bottom:2px;padding:2px var(--uc-padding);transition:background-color var(--uc-transition),color var(--uc-transition);user-select:none;width:100%}uc-source-btn:last-child:not(#\\#)>button{margin-bottom:0}uc-source-btn:not(#\\#)>button:hover{background-color:var(--uc-primary-transparent)}:where(.uc-contrast):not(#\\#) uc-source-btn>button:hover{background-color:var(--uc-secondary);color:var(--uc-foreground)}uc-source-btn:not(#\\#) uc-icon{display:inline-flex;flex-grow:1;justify-content:center;margin-right:var(--uc-padding);min-width:var(--uc-button-size);opacity:.8}:where(.uc-contrast):not(#\\#) uc-source-btn uc-icon{opacity:1}uc-source-btn:not(#\\#) .uc-txt{align-items:center;border:none;box-sizing:border-box;display:flex;height:var(--uc-button-size);padding:0;white-space:nowrap;width:100%}.uc-spinner:not(#\\#){animation:uc-spinner-keyframes .4s linear infinite;border-color:currentcolor transparent transparent currentcolor;border-radius:50%;border-style:solid;border-width:2px;height:1em;width:1em}uc-start-from:not(#\\#){display:block;overflow-y:auto}uc-start-from:not(#\\#) .uc-content{background-color:var(--uc-background);display:grid;gap:calc(var(--uc-padding)*2);grid-auto-flow:row;height:100%;padding:calc(var(--uc-padding)*2);width:100%}[uc-modal]:not(#\\#)>dialog:has(uc-start-from[active]){width:var(--uc-dialog-width)}[uc-modal]:not(#\\#) uc-start-from uc-drop-area{border-radius:var(--uc-radius)}@media only screen and (max-width:430px){[uc-modal]:not(#\\#) uc-start-from uc-drop-area{display:none}}uc-thumb:not(#\\#){height:100%;width:100%}uc-upload-list:not(#\\#){background-color:var(--uc-background);display:flex;flex-direction:column;height:max-content;overflow:hidden;position:relative;transition:opacity var(--uc-transition);width:100%}uc-upload-list:not(#\\#) .uc-no-files{height:32px;padding:20px}uc-upload-list:not(#\\#) .uc-files{display:block;flex:1;min-height:32px;overflow:auto;padding:0 var(--uc-padding)}uc-upload-list:not(#\\#) .uc-files-wrapper{display:contents}uc-upload-list:not(#\\#) .uc-toolbar{background-color:var(--uc-background);display:flex;gap:4px;justify-content:space-between;padding:var(--uc-padding)}uc-upload-list:not(#\\#) .uc-toolbar-spacer{flex:1}uc-upload-list:not(#\\#) uc-drop-area{border-radius:var(--uc-radius);height:calc(100% - var(--uc-padding)*2);left:0;margin:var(--uc-padding);position:absolute;top:0;width:calc(100% - var(--uc-padding)*2)}uc-upload-list:not(#\\#) uc-activity-header>.uc-header-text{padding:0 var(--uc-padding)}uc-upload-list:not(#\\#) .uc-common-error{align-items:center;background-color:var(--uc-destructive);border-radius:var(--uc-radius);color:var(--uc-destructive-foreground);display:flex;font-size:.925em;justify-content:center;margin:4px var(--uc-padding) 0 var(--uc-padding);padding:var(--uc-padding)}uc-upload-list:not(#\\#) .uc-add-more-btn uc-icon{display:none}uc-upload-list[mode=grid]:not(#\\#) .uc-files{display:flex;flex-wrap:wrap;gap:var(--uc-grid-gap)}uc-upload-list:not(#\\#) .uc-files .uc-add-more-btn,uc-upload-list[mode=grid]:not(#\\#) uc-file-item{aspect-ratio:var(--uc-grid-aspect-ratio);flex:0 0 calc((100% - var(--uc-grid-gap)*(var(--uc-grid-col) - 1))/var(--uc-grid-col));height:var(--uc-grid-preview-image-height);max-width:calc((100% - var(--uc-grid-gap)*(var(--uc-grid-col) - 1))/var(--uc-grid-col))}uc-upload-list:not(#\\#) .uc-files .uc-add-more-btn{display:none}uc-url-source:not(#\\#){background-color:var(--uc-background);display:block}uc-url-source:not(#\\#)>.uc-content{display:grid;grid-gap:4px;grid-template-columns:1fr min-content;padding:var(--uc-padding);padding-top:0}uc-url-source:not(#\\#) .uc-url-input{display:flex}[uc-file-uploader-inline]:not(#\\#):not(#\\#):not(#\\#) uc-start-from{container-type:inline-size;height:100%}[uc-file-uploader-inline]:not(#\\#):not(#\\#):not(#\\#){--cfg-done-activity:"start-from";--cfg-init-activity:"start-from";flex:1}[uc-file-uploader-inline]:not(#\\#):not(#\\#):not(#\\#) uc-activity-header:after{content:"";height:var(--uc-button-size);width:var(--uc-button-size)}[uc-file-uploader-inline]:not(#\\#):not(#\\#):not(#\\#) uc-activity-header .uc-close-btn{display:none}[uc-file-uploader-inline]:not(#\\#):not(#\\#):not(#\\#) uc-copyright .uc-credits{position:static}@container (min-width: 500px){[uc-file-uploader-inline]:not(#\\#):not(#\\#):not(#\\#) uc-start-from .uc-content{grid-template-columns:1fr max-content;height:100%}[uc-file-uploader-inline]:not(#\\#):not(#\\#):not(#\\#) uc-start-from uc-copyright{grid-column:2}[uc-file-uploader-inline]:not(#\\#):not(#\\#):not(#\\#) uc-start-from uc-drop-area{grid-row:span 3}[uc-file-uploader-inline]:not(#\\#):not(#\\#):not(#\\#) uc-start-from:has(uc-copyright[hidden]) uc-drop-area{grid-row:span 2}[uc-file-uploader-inline]:not(#\\#):not(#\\#):not(#\\#) uc-start-from:has(.uc-cancel-btn[hidden]) uc-drop-area{grid-row:span 2}[uc-file-uploader-inline]:not(#\\#):not(#\\#):not(#\\#) uc-start-from:has(uc-copyright[hidden]):has(.uc-cancel-btn[hidden]) uc-drop-area{grid-row:span 1}}:where([uc-file-uploader-minimal]):not(#\\#):not(#\\#):not(#\\#){--cfg-init-activity:"start-from";--cfg-done-activity:"upload-list";display:block;position:relative}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#)>uc-start-from .uc-content{align-items:center;background-color:transparent;display:flex;flex-direction:column;gap:4px;overflow:hidden;padding:0}:where([uc-file-uploader-minimal]>uc-start-from uc-drop-area):not(#\\#):not(#\\#):not(#\\#){align-items:center;background-color:var(--uc-muted);border-radius:calc(var(--uc-radius)*1.75);display:flex;justify-content:center;min-height:calc(var(--uc-preview-size) + var(--uc-padding)*2 + 8px);padding:0;position:relative;text-align:center;width:100%}:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) :where([uc-file-uploader-minimal]>uc-start-from uc-drop-area){background-color:transparent}:where([uc-file-uploader-minimal]>uc-start-from uc-drop-area):not(#\\#):not(#\\#):not(#\\#):before{background-color:var(--uc-background);content:"";height:100%;position:absolute;width:100%;z-index:-1}:where([uc-file-uploader-minimal]:has([single])>uc-start-from uc-drop-area):not(#\\#):not(#\\#):not(#\\#){aspect-ratio:var(--uc-grid-aspect-ratio)}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list uc-activity-header{display:none}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list>.uc-toolbar{background-color:transparent}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list{background-color:var(--uc-background);border:1px dashed var(--uc-border);border-radius:calc(var(--uc-radius)*1.75);height:unset;padding:4px;width:100%}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-files{padding:0}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-toolbar{display:block;padding:0}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-toolbar .uc-cancel-btn,[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-toolbar .uc-done-btn,[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-toolbar .uc-upload-btn{display:none}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-toolbar .uc-add-more-btn{height:calc(var(--uc-preview-size) + var(--uc-padding)*2);margin-top:4px;width:100%}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-toolbar .uc-add-more-btn>span,[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-toolbar .uc-add-more-btn[disabled]{display:none}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-toolbar .uc-add-more-btn>uc-icon{display:flex}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-file-item uc-progress-bar{height:100%!important;top:0!important}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-file-item uc-progress-bar .uc-fake-progress,[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-file-item uc-progress-bar .uc-progress{background-color:var(--uc-primary-transparent);border-radius:var(--uc-radius)}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list uc-drop-area{border-radius:calc(var(--uc-radius)*1.75);height:100%;margin:0;width:100%}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-common-error{margin:4px 0 0}[uc-file-uploader-minimal]:not(#\\#):not(#\\#):not(#\\#) uc-copyright .uc-credits{position:static}[uc-file-uploader-minimal][mode=grid]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-toolbar .uc-add-more-btn{display:none}[uc-file-uploader-minimal][mode=grid]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-files .uc-add-more-btn{display:flex}[uc-file-uploader-minimal][mode=grid]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-files .uc-add-more-btn>span{display:none}[uc-file-uploader-minimal][mode=grid]:not(#\\#):not(#\\#):not(#\\#) uc-upload-list .uc-files .uc-add-more-btn>uc-icon{display:flex}:where([uc-wgt-common]){--cfg-init-activity:"start-from";--cfg-done-activity:""}:where([uc-wgt-common]){--uc-font-family:system-ui;--uc-font-size:14px;--uc-line-height:normal;--uc-simple-btn-font-family:system-ui;--uc-simple-btn-font-size:14px;--uc-button-size:32px;--uc-preview-size:32px;--uc-padding:10px;--uc-radius:8px;--uc-transition:.2s ease;--uc-dialog-width:430px;--uc-dialog-max-width:920px;--uc-dialog-max-height:675px;--uc-simple-btn-padding:7px 14px;--uc-grid-col:3;--uc-grid-preview-image-height:auto;--uc-grid-gap:calc(var(--uc-padding)/2);--uc-grid-aspect-ratio:1/1;--uc-background:var(--uc-background-light);--uc-foreground:var(--uc-foreground-light);--uc-primary:var(--uc-primary-light);--uc-primary-hover:var(--uc-primary-hover-light);--uc-primary-transparent:var(--uc-primary-transparent-light);--uc-primary-foreground:var(--uc-primary-foreground-light);--uc-secondary:var(--uc-secondary-light);--uc-secondary-hover:var(--uc-secondary-hover-light);--uc-secondary-foreground:var(--uc-secondary-foreground-light);--uc-muted:var(--uc-muted-light);--uc-muted-foreground:var(--uc-muted-foreground-light);--uc-destructive:var(--uc-destructive-light);--uc-destructive-foreground:var(--uc-destructive-foreground-light);--uc-border:var(--uc-border-light);--uc-dialog-shadow:var(--uc-dialog-shadow-light);--uc-simple-btn:var(--uc-simple-btn-light);--uc-simple-btn-hover:var(--uc-simple-btn-hover-light);--uc-simple-btn-foreground:var(--uc-simple-btn-foreground-light)}@supports not (color:oklch(0% 0 0)){:where([uc-wgt-common]){--uc-primary-rgb-light:23 75 215;--uc-primary-light:rgb(var(--uc-primary-rgb-light));--uc-primary-hover-light:rgb(var(--uc-primary-rgb-light)/90%);--uc-primary-transparent-light:rgb(var(--uc-primary-rgb-light)/10%);--uc-background-light:#fff;--uc-foreground-light:#181818;--uc-primary-foreground-light:#fff;--uc-secondary-light:hsla(0,0%,9%,.05);--uc-secondary-hover-light:hsla(0,0%,9%,.08);--uc-secondary-foreground-light:#181818;--uc-muted-light:#f5f5f5;--uc-muted-foreground-light:#717171;--uc-destructive-light:rgb(232 19 20/5%);--uc-destructive-foreground-light:#e81314;--uc-border-light:#e4e4e8;--uc-dialog-shadow-light:0px 6px 20px rgba(0,0,0,.1);--uc-simple-btn-light:#ebebeb;--uc-simple-btn-hover-light:#e4e4e4;--uc-simple-btn-foreground-light:#181818;--uc-primary-rgb-dark:87 154 255;--uc-primary-dark:rgb(var(--uc-primary-rgb-dark));--uc-primary-hover-dark:rgb(var(--uc-primary-rgb-dark)/90%);--uc-primary-transparent-dark:rgb(var(--uc-primary-rgb-dark)/7%);--uc-background-dark:#1b1b1b;--uc-foreground-dark:#e1e1e1;--uc-primary-foreground-dark:#000;--uc-secondary-dark:hsla(0,0%,88%,.07);--uc-secondary-hover-dark:hsla(0,0%,88%,.1);--uc-secondary-foreground-dark:#e1e1e1;--uc-muted-dark:#242424;--uc-muted-foreground-dark:#989898;--uc-destructive-dark:rgba(244,90,79,.1);--uc-destructive-foreground-dark:#f45a4f;--uc-border-dark:#3d3d3d;--uc-dialog-shadow-dark:0px 6px 20px rgba(0,0,0,.25);--uc-simple-btn-dark:#242424;--uc-simple-btn-hover-dark:#2b2b2b;--uc-simple-btn-foreground-dark:#fff}}@supports (color:oklch(0% 0 0)){:where([uc-wgt-common]){--uc-primary-oklch-light:47% .22 264;--uc-primary-light:oklch(var(--uc-primary-oklch-light));--uc-primary-hover-light:oklch(var(--uc-primary-oklch-light)/90%);--uc-primary-transparent-light:oklch(var(--uc-primary-oklch-light)/7%);--uc-background-light:oklch(100% 0 0);--uc-foreground-light:oklch(21% 0 0);--uc-primary-foreground-light:oklch(100% 0 0);--uc-secondary-light:oklch(21% 0 0/.05);--uc-secondary-hover-light:oklch(21% 0 0/.08);--uc-secondary-foreground-light:oklch(21% 0 0);--uc-muted-light:oklch(97% 0 0);--uc-muted-foreground-light:oklch(40% 0 0);--uc-destructive-light:oklch(59% .235 28.5/.05);--uc-destructive-foreground-light:oklch(59% .235 28.5);--uc-border-light:oklch(92% 0 0);--uc-dialog-shadow-light:0px 6px 20px oklch(0% 0 0/.1);--uc-simple-btn-light:oklch(94% 0 0);--uc-simple-btn-hover-light:oklch(92% 0 0);--uc-simple-btn-foreground-light:oklch(20% 0 0);--uc-primary-oklch-dark:69% .1768 258.4;--uc-primary-dark:oklch(var(--uc-primary-oklch-dark));--uc-primary-hover-dark:oklch(var(--uc-primary-oklch-dark)/90%);--uc-primary-transparent-dark:oklch(var(--uc-primary-oklch-dark)/7%);--uc-background-dark:oklch(22% 0 0);--uc-foreground-dark:oklch(91% 0 0);--uc-primary-foreground-dark:oklch(0% 0 0);--uc-secondary-dark:oklch(91% 0 0/.07);--uc-secondary-hover-dark:oklch(91% 0 0/.1);--uc-secondary-foreground-dark:oklch(91% 0 0);--uc-muted-dark:oklch(26% 0 0);--uc-muted-foreground-dark:oklch(68% 0 0);--uc-destructive-dark:oklch(67% .191 27.5/.1);--uc-destructive-foreground-dark:oklch(67% .191 27.5);--uc-border-dark:oklch(36% 0 0);--uc-dialog-shadow-dark:0px 6px 20px oklch(0% 0 0/.25);--uc-simple-btn-dark:oklch(26% 0 0);--uc-simple-btn-hover-dark:oklch(29% 0 0);--uc-simple-btn-foreground-dark:oklch(100% 0 0)}}@media only screen and (max-height:600px){:where([uc-wgt-common]){--uc-dialog-max-height:100%}}@media only screen and (max-width:680px){:where([uc-wgt-common]){--uc-grid-col:2}}@media only screen and (max-width:430px){:where([uc-wgt-common]){--uc-dialog-max-width:100vw;--uc-dialog-max-height:var(--uploadcare-blocks-window-height);--uc-grid-col:1}}@media (prefers-color-scheme:light){:where([uc-wgt-common]){--uc-background:var(--uc-background-light);--uc-foreground:var(--uc-foreground-light);--uc-primary:var(--uc-primary-light);--uc-primary-hover:var(--uc-primary-hover-light);--uc-primary-transparent:var(--uc-primary-transparent-light);--uc-primary-foreground:var(--uc-primary-foreground-light);--uc-secondary:var(--uc-secondary-light);--uc-secondary-hover:var(--uc-secondary-hover-light);--uc-secondary-foreground:var(--uc-secondary-foreground-light);--uc-muted:var(--uc-muted-light);--uc-muted-foreground:var(--uc-muted-foreground-light);--uc-destructive:var(--uc-destructive-light);--uc-destructive-foreground:var(--uc-destructive-foreground-light);--uc-border:var(--uc-border-light);--uc-dialog-shadow:var(--uc-dialog-shadow-light);--uc-simple-btn:var(--uc-simple-btn-light);--uc-simple-btn-hover:var(--uc-simple-btn-hover-light);--uc-simple-btn-foreground:var(--uc-simple-btn-foreground-light)}}@media (prefers-color-scheme:dark){:where([uc-wgt-common]){--uc-background:var(--uc-background-dark);--uc-foreground:var(--uc-foreground-dark);--uc-primary:var(--uc-primary-dark);--uc-primary-hover:var(--uc-primary-hover-dark);--uc-primary-transparent:var(--uc-primary-transparent-dark);--uc-primary-foreground:var(--uc-primary-foreground-dark);--uc-secondary:var(--uc-secondary-dark);--uc-secondary-hover:var(--uc-secondary-hover-dark);--uc-secondary-foreground:var(--uc-secondary-foreground-dark);--uc-muted:var(--uc-muted-dark);--uc-muted-foreground:var(--uc-muted-foreground-dark);--uc-destructive:var(--uc-destructive-dark);--uc-destructive-foreground:var(--uc-destructive-foreground-dark);--uc-border:var(--uc-border-dark);--uc-dialog-shadow:var(--uc-dialog-shadow-dark);--uc-simple-btn:var(--uc-simple-btn-dark);--uc-simple-btn-hover:var(--uc-simple-btn-hover-dark);--uc-simple-btn-foreground:var(--uc-simple-btn-foreground-dark)}}:where(.uc-light){--uc-background:var(--uc-background-light);--uc-foreground:var(--uc-foreground-light);--uc-primary:var(--uc-primary-light);--uc-primary-hover:var(--uc-primary-hover-light);--uc-primary-transparent:var(--uc-primary-transparent-light);--uc-primary-foreground:var(--uc-primary-foreground-light);--uc-secondary:var(--uc-secondary-light);--uc-secondary-hover:var(--uc-secondary-hover-light);--uc-secondary-foreground:var(--uc-secondary-foreground-light);--uc-muted:var(--uc-muted-light);--uc-muted-foreground:var(--uc-muted-foreground-light);--uc-destructive:var(--uc-destructive-light);--uc-destructive-foreground:var(--uc-destructive-foreground-light);--uc-border:var(--uc-border-light);--uc-dialog-shadow:var(--uc-dialog-shadow-light);--uc-simple-btn:var(--uc-simple-btn-light);--uc-simple-btn-hover:var(--uc-simple-btn-hover-light);--uc-simple-btn-foreground:var(--uc-simple-btn-foreground-light)}:where(.uc-dark){--uc-background:var(--uc-background-dark);--uc-foreground:var(--uc-foreground-dark);--uc-primary:var(--uc-primary-dark);--uc-primary-hover:var(--uc-primary-hover-dark);--uc-primary-transparent:var(--uc-primary-transparent-dark);--uc-primary-foreground:var(--uc-primary-foreground-dark);--uc-secondary:var(--uc-secondary-dark);--uc-secondary-hover:var(--uc-secondary-hover-dark);--uc-secondary-foreground:var(--uc-secondary-foreground-dark);--uc-muted:var(--uc-muted-dark);--uc-muted-foreground:var(--uc-muted-foreground-dark);--uc-destructive:var(--uc-destructive-dark);--uc-destructive-foreground:var(--uc-destructive-foreground-dark);--uc-border:var(--uc-border-dark);--uc-dialog-shadow:var(--uc-dialog-shadow-dark);--uc-simple-btn:var(--uc-simple-btn-dark);--uc-simple-btn-hover:var(--uc-simple-btn-hover-dark);--uc-simple-btn-foreground:var(--uc-simple-btn-foreground-dark)}:where(.uc-purple){--uc-primary-oklch-light:47% .22 300;--uc-primary-oklch-dark:69% .1768 300}:where(.uc-red){--uc-primary-oklch-light:47% .21 21;--uc-primary-oklch-dark:71% .1768 21}:where(.uc-orange){--uc-primary-oklch-light:47% .1376 51.88;--uc-primary-oklch-dark:69% .1768 51.88}:where(.uc-green){--uc-primary-oklch-light:45% .14 130;--uc-primary-oklch-dark:69% .1768 130}:where(.uc-turquoise){--uc-primary-oklch-light:45% .0854 174;--uc-primary-oklch-dark:69% .1768 174}:where(.uc-gray){--uc-primary-oklch-light:10% 0 0;--uc-primary-oklch-dark:97% 0 0}:where(.uc-contrast){--uc-border-light:oklch(50% 0 0);--uc-border-dark:oklch(50% 0 0);--uc-muted-light:oklch(98% 0 0);--uc-muted-dark:oklch(16% 0 0);--uc-muted-foreground-light:oklch(20% 0 0);--uc-muted-foreground-dark:oklch(80% 0 0);--uc-background-light:oklch(100% 0 0);--uc-foreground-light:oklch(0% 0 0);--uc-background-dark:oklch(10% 0 0);--uc-foreground-dark:oklch(100% 0 0)}:where([uc-wgt-common]){color:var(--uc-foreground);font-family:var(--uc-font-family);font-size:var(--uc-font-size);line-height:var(--uc-line-height)}:where([uc-wgt-common]) *{box-sizing:border-box}:where([uc-wgt-common]) button{align-items:center;border:none;border-radius:var(--uc-radius);cursor:pointer;display:flex;font-family:inherit;font-size:1em;height:var(--uc-button-size);justify-content:center;padding-left:14px;padding-right:14px;transition:background-color var(--uc-transition);user-select:none;white-space:nowrap}:where([uc-wgt-common]) button:focus-visible{outline-offset:2px}:where([uc-wgt-common]) button.uc-primary-btn{background-color:var(--uc-primary);color:var(--uc-primary-foreground)}:where([uc-wgt-common]) button.uc-primary-btn:hover{background-color:var(--uc-primary-hover)}:where([uc-wgt-common]) button.uc-secondary-btn{background-color:var(--uc-secondary);color:var(--uc-secondary-foreground)}:where([uc-wgt-common]) button.uc-secondary-btn:hover{background-color:var(--uc-secondary-hover)}:where([uc-wgt-common].uc-contrast) button.uc-secondary-btn{border:1px solid var(--uc-border)}:where([uc-wgt-common]) button.uc-mini-btn{background-color:transparent;color:var(--uc-secondary-foreground);height:var(--uc-button-size);padding:0}:where([uc-wgt-common]) button.uc-mini-btn:hover{background-color:var(--uc-secondary)}:where([uc-wgt-common]) :is(button[disabled],button.uc-primary-btn[disabled],button.uc-secondary-btn[disabled]){opacity:.5;pointer-events:none}:where([uc-wgt-common]) a{color:var(--uc-primary);text-decoration:none}:where([uc-wgt-common]) a[disabled]{pointer-events:none}:where([uc-wgt-common]) input[type=text]{background-color:var(--uc-background);border:1px solid var(--uc-border);border-radius:var(--uc-radius);color:var(--uc-foreground);display:flex;font-family:inherit;font-size:1em;height:var(--uc-button-size);outline:1px solid transparent;padding-left:10px;padding-right:10px;transition:border-color var(--uc-transition),outline-color var(--uc-transition);width:100%}:where([uc-wgt-common]) input[type=text]::placeholder{color:var(--uc-muted-foreground)}:where([uc-wgt-common]) input[type=text]:focus{border-color:var(--uc-primary-hover);outline-color:var(--uc-primary-hover)}:where([uc-wgt-common]) input[disabled]{opacity:.6;pointer-events:none}:where([uc-wgt-common]) select[disabled],:where([uc-wgt-common]) uc-select[disabled]{opacity:.6;pointer-events:none}:where([uc-wgt-common]):not(#\\#):not(#\\#) [hidden]{display:none}:where([uc-wgt-common]):not(#\\#):not(#\\#) [activity]:not([active],.active){display:none}:where([uc-wgt-common]):not(#\\#):not(#\\#) dialog:not([open]) [activity]{display:none}:where([uc-wgt-common]):not(#\\#):not(#\\#):not(#\\#):not(#\\#) uc-source-btn[type]{all:unset}`,""]);const h=u},659:t=>{"use strict";t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="},741:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},779:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var r="",i=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),i&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),i&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r}).join("")},e.i=function(t,r,i,o,n){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(i)for(var s=0;s<this.length;s++){var c=this[s][0];null!=c&&(a[c]=!0)}for(var l=0;l<t.length;l++){var u=[].concat(t[l]);i&&a[u[0]]||(void 0!==n&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=n),r&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=r):u[2]=r),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),e.push(u))}},e}},782:(t,e,r)=>{t.exports=r(237)("./src/core.js")},908:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var i=r(106),o=r.n(i),n=r(779),a=r.n(n)()(o());a.push([t.id,":root{--ck-uploadcare-form-view-width:700px;--ck-uploadcare-external-source-view-height:350px;--ck-uploadcare-color-image-background:oklch(0.97 0 0);--ck-uploadcare-color-icon-error:#db3700;--ck-uploadcare-color-skeleton:#fafafa}.ck .ck-uploadcare-form{max-width:100%;width:var(--ck-uploadcare-form-view-width)}.ck .ck-uploadcare-form .ck-uploadcare-form__loading .ck-uploadcare-form__loading-spinner{align-items:center;background-color:var(--ck-uploadcare-color-image-background);display:flex;flex-direction:column;height:var(--ck-uploadcare-external-source-view-height);justify-content:center;width:100%}.ck .ck-uploadcare-form .ck-uploadcare-form__loading .ck-uploadcare-form__loading-spinner .ck-spinner-container{margin-bottom:10px}.ck .ck-uploadcare-form .ck-uploadcare-form__error .ck-uploadcare-form__error-contents{align-items:center;background-color:var(--ck-uploadcare-color-image-background);display:flex;flex-direction:column;gap:5px;height:var(--ck-uploadcare-external-source-view-height);justify-content:center;width:100%}.ck .ck-uploadcare-form .ck-uploadcare-form__error .ck-uploadcare-form__error-contents h3{font-weight:700;margin:0;padding:0}.ck .ck-uploadcare-form .ck-uploadcare-form__error .ck-uploadcare-form__error-contents .ck-icon{color:var(--ck-uploadcare-color-icon-error)}.ck .ck-uploadcare-form .ck-uploadcare-form__error .ck-uploadcare-form__error-contents .ck-button{margin-top:10px}.ck .ck-uploadcare-form .ck-uploadcare-form__skeleton{height:115px;width:100%}.ck .ck-uploadcare-form .ck-uploadcare-form__skeleton div{align-items:center;box-sizing:border-box;display:flex;flex-direction:row;height:50%;justify-content:center;min-width:100%}.ck .ck-uploadcare-form .ck-uploadcare-form__skeleton div span{background-color:var(--ck-uploadcare-color-skeleton);display:block;height:32px;width:32px}.ck .ck-uploadcare-form .ck-uploadcare-form__skeleton div+div{gap:20px}.ck .ck-uploadcare-form .ck-uploadcare-form__skeleton div+div span:first-child{left:8px;position:absolute;width:80px}.ck .ck-uploadcare-form .ck-uploadcare-form__skeleton div+div span:last-child{position:absolute;right:8px;width:80px}.ck .ck-uploadcare-form .ck-uploadcare-form__skeleton div:first-child{gap:4px}.ck .ck-uploadcare-form .mini-btn{display:none}.ck .ck-uploadcare-form .uc-viewport{height:var(--ck-uploadcare-external-source-view-height)}.ck .ck-uploadcare-form .uc-primary-btn,.ck .ck-uploadcare-form .uc-secondary-btn,.ck .ck-uploadcare-form uc-btn-ui button{min-height:var(--ck-ui-component-min-height);min-width:var(--ck-ui-component-min-height);padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}.ck .ck-uploadcare-form .uc-primary-btn,.ck .ck-uploadcare-form uc-btn-ui.uc-primary button{background:var(--ck-color-button-action-background)}.ck .ck-uploadcare-form .uc-primary-btn:not(.ck-disabled):hover,.ck .ck-uploadcare-form uc-btn-ui.uc-primary button:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck .ck-uploadcare-form .uc-primary-btn:not(.ck-disabled):active,.ck .ck-uploadcare-form uc-btn-ui.uc-primary button:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background)}.ck .ck-uploadcare-form .uc-primary-btn.ck-disabled,.ck .ck-uploadcare-form uc-btn-ui.uc-primary button.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck .ck-uploadcare-form .uc-secondary-btn,.ck .ck-uploadcare-form uc-btn-ui.uc-secondary button{background:var(--ck-color-button-default-background)}.ck .ck-uploadcare-form .uc-secondary-btn:not(.ck-disabled):hover,.ck .ck-uploadcare-form uc-btn-ui.uc-secondary button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck .ck-uploadcare-form .uc-secondary-btn:not(.ck-disabled):active,.ck .ck-uploadcare-form uc-btn-ui.uc-secondary button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background)}.ck .ck-uploadcare-form .uc-secondary-btn.ck-disabled,.ck .ck-uploadcare-form uc-btn-ui.uc-secondary button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck .ck-uploadcare-form uc-upload-list .uc-toolbar{gap:var(--ck-spacing-large)}.ck .ck-uploadcare-form uc-upload-list .uc-files{max-height:var(--ck-uploadcare-external-source-view-height);overflow-y:auto;padding-top:var(--ck-spacing-large)}.ck .ck-uploadcare-form .uc-content{gap:var(--ck-spacing-large);padding:var(--ck-spacing-large)}.ck .ck-uploadcare-form .uc-content>.uc-iframe-wrapper{height:var(--ck-uploadcare-external-source-view-height)}.ck .ck-uploadcare-form .uc-content>.uc-toolbar{padding:var(--ck-spacing-large) 0 0}.ck .ck-uploadcare-form uc-start-from .uc-content{gap:0}.ck .ck-uploadcare-form uc-file-item>.uc-inner{font-size:1em}.ck .ck-uploadcare-form uc-file-item>.uc-inner:where([finished]) .uc-badge{background:var(--ck-color-button-action-active-background)}.ck .ck-uploadcare-form uc-external-source .uc-cancel-btn{pointer-events:none;visibility:hidden}.ck .ck-uploadcare-form uc-activity-header,.ck .ck-uploadcare-form uc-source-list{display:none}.ck .ck-uploadcare-form uc-cloud-image-editor-block [icon=closeMax] .uc-icon_left{transform:rotate(90deg)}",""]);const s=a},929:t=>{"use strict";var e=[];function r(t){for(var r=-1,i=0;i<e.length;i++)if(e[i].identifier===t){r=i;break}return r}function i(t,i){for(var n={},a=[],s=0;s<t.length;s++){var c=t[s],l=i.base?c[0]+i.base:c[0],u=n[l]||0,d="".concat(l," ").concat(u);n[l]=u+1;var h=r(d),p={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==h)e[h].references++,e[h].updater(p);else{var g=o(p,i);i.byIndex=s,e.splice(s,0,{identifier:d,updater:g,references:1})}a.push(d)}return a}function o(t,e){var r=e.domAPI(e);r.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;r.update(t=e)}else r.remove()}}t.exports=function(t,o){var n=i(t=t||[],o=o||{});return function(t){t=t||[];for(var a=0;a<n.length;a++){var s=r(n[a]);e[s].references--}for(var c=i(t,o),l=0;l<n.length;l++){var u=r(n[l]);0===e[u].references&&(e[u].updater(),e.splice(u,1))}n=c}}},947:(t,e,r)=>{"use strict";r.d(e,{A:()=>h});var i=r(106),o=r.n(i),n=r(779),a=r.n(n),s=r(474),c=r.n(s),l=new URL(r(659),r.b),u=a()(o()),d=c()(l);u.push([t.id,`:where([uc-wgt-common]){--uc-font-family:system-ui;--uc-font-size:14px;--uc-line-height:normal;--uc-simple-btn-font-family:system-ui;--uc-simple-btn-font-size:14px;--uc-button-size:32px;--uc-preview-size:32px;--uc-padding:10px;--uc-radius:8px;--uc-transition:.2s ease;--uc-dialog-width:430px;--uc-dialog-max-width:920px;--uc-dialog-max-height:675px;--uc-simple-btn-padding:7px 14px;--uc-grid-col:3;--uc-grid-preview-image-height:auto;--uc-grid-gap:calc(var(--uc-padding)/2);--uc-grid-aspect-ratio:1/1;--uc-background:var(--uc-background-light);--uc-foreground:var(--uc-foreground-light);--uc-primary:var(--uc-primary-light);--uc-primary-hover:var(--uc-primary-hover-light);--uc-primary-transparent:var(--uc-primary-transparent-light);--uc-primary-foreground:var(--uc-primary-foreground-light);--uc-secondary:var(--uc-secondary-light);--uc-secondary-hover:var(--uc-secondary-hover-light);--uc-secondary-foreground:var(--uc-secondary-foreground-light);--uc-muted:var(--uc-muted-light);--uc-muted-foreground:var(--uc-muted-foreground-light);--uc-destructive:var(--uc-destructive-light);--uc-destructive-foreground:var(--uc-destructive-foreground-light);--uc-border:var(--uc-border-light);--uc-dialog-shadow:var(--uc-dialog-shadow-light);--uc-simple-btn:var(--uc-simple-btn-light);--uc-simple-btn-hover:var(--uc-simple-btn-hover-light);--uc-simple-btn-foreground:var(--uc-simple-btn-foreground-light)}@supports not (color:oklch(0% 0 0)){:where([uc-wgt-common]){--uc-primary-rgb-light:23 75 215;--uc-primary-light:rgb(var(--uc-primary-rgb-light));--uc-primary-hover-light:rgb(var(--uc-primary-rgb-light)/90%);--uc-primary-transparent-light:rgb(var(--uc-primary-rgb-light)/10%);--uc-background-light:#fff;--uc-foreground-light:#181818;--uc-primary-foreground-light:#fff;--uc-secondary-light:hsla(0,0%,9%,.05);--uc-secondary-hover-light:hsla(0,0%,9%,.08);--uc-secondary-foreground-light:#181818;--uc-muted-light:#f5f5f5;--uc-muted-foreground-light:#717171;--uc-destructive-light:rgb(232 19 20/5%);--uc-destructive-foreground-light:#e81314;--uc-border-light:#e4e4e8;--uc-dialog-shadow-light:0px 6px 20px rgba(0,0,0,.1);--uc-simple-btn-light:#ebebeb;--uc-simple-btn-hover-light:#e4e4e4;--uc-simple-btn-foreground-light:#181818;--uc-primary-rgb-dark:87 154 255;--uc-primary-dark:rgb(var(--uc-primary-rgb-dark));--uc-primary-hover-dark:rgb(var(--uc-primary-rgb-dark)/90%);--uc-primary-transparent-dark:rgb(var(--uc-primary-rgb-dark)/7%);--uc-background-dark:#1b1b1b;--uc-foreground-dark:#e1e1e1;--uc-primary-foreground-dark:#000;--uc-secondary-dark:hsla(0,0%,88%,.07);--uc-secondary-hover-dark:hsla(0,0%,88%,.1);--uc-secondary-foreground-dark:#e1e1e1;--uc-muted-dark:#242424;--uc-muted-foreground-dark:#989898;--uc-destructive-dark:rgba(244,90,79,.1);--uc-destructive-foreground-dark:#f45a4f;--uc-border-dark:#3d3d3d;--uc-dialog-shadow-dark:0px 6px 20px rgba(0,0,0,.25);--uc-simple-btn-dark:#242424;--uc-simple-btn-hover-dark:#2b2b2b;--uc-simple-btn-foreground-dark:#fff}}@supports (color:oklch(0% 0 0)){:where([uc-wgt-common]){--uc-primary-oklch-light:47% .22 264;--uc-primary-light:oklch(var(--uc-primary-oklch-light));--uc-primary-hover-light:oklch(var(--uc-primary-oklch-light)/90%);--uc-primary-transparent-light:oklch(var(--uc-primary-oklch-light)/7%);--uc-background-light:oklch(100% 0 0);--uc-foreground-light:oklch(21% 0 0);--uc-primary-foreground-light:oklch(100% 0 0);--uc-secondary-light:oklch(21% 0 0/.05);--uc-secondary-hover-light:oklch(21% 0 0/.08);--uc-secondary-foreground-light:oklch(21% 0 0);--uc-muted-light:oklch(97% 0 0);--uc-muted-foreground-light:oklch(40% 0 0);--uc-destructive-light:oklch(59% .235 28.5/.05);--uc-destructive-foreground-light:oklch(59% .235 28.5);--uc-border-light:oklch(92% 0 0);--uc-dialog-shadow-light:0px 6px 20px oklch(0% 0 0/.1);--uc-simple-btn-light:oklch(94% 0 0);--uc-simple-btn-hover-light:oklch(92% 0 0);--uc-simple-btn-foreground-light:oklch(20% 0 0);--uc-primary-oklch-dark:69% .1768 258.4;--uc-primary-dark:oklch(var(--uc-primary-oklch-dark));--uc-primary-hover-dark:oklch(var(--uc-primary-oklch-dark)/90%);--uc-primary-transparent-dark:oklch(var(--uc-primary-oklch-dark)/7%);--uc-background-dark:oklch(22% 0 0);--uc-foreground-dark:oklch(91% 0 0);--uc-primary-foreground-dark:oklch(0% 0 0);--uc-secondary-dark:oklch(91% 0 0/.07);--uc-secondary-hover-dark:oklch(91% 0 0/.1);--uc-secondary-foreground-dark:oklch(91% 0 0);--uc-muted-dark:oklch(26% 0 0);--uc-muted-foreground-dark:oklch(68% 0 0);--uc-destructive-dark:oklch(67% .191 27.5/.1);--uc-destructive-foreground-dark:oklch(67% .191 27.5);--uc-border-dark:oklch(36% 0 0);--uc-dialog-shadow-dark:0px 6px 20px oklch(0% 0 0/.25);--uc-simple-btn-dark:oklch(26% 0 0);--uc-simple-btn-hover-dark:oklch(29% 0 0);--uc-simple-btn-foreground-dark:oklch(100% 0 0)}}@media only screen and (max-height:600px){:where([uc-wgt-common]){--uc-dialog-max-height:100%}}@media only screen and (max-width:680px){:where([uc-wgt-common]){--uc-grid-col:2}}@media only screen and (max-width:430px){:where([uc-wgt-common]){--uc-dialog-max-width:100vw;--uc-dialog-max-height:var(--uploadcare-blocks-window-height);--uc-grid-col:1}}@media (prefers-color-scheme:light){:where([uc-wgt-common]){--uc-background:var(--uc-background-light);--uc-foreground:var(--uc-foreground-light);--uc-primary:var(--uc-primary-light);--uc-primary-hover:var(--uc-primary-hover-light);--uc-primary-transparent:var(--uc-primary-transparent-light);--uc-primary-foreground:var(--uc-primary-foreground-light);--uc-secondary:var(--uc-secondary-light);--uc-secondary-hover:var(--uc-secondary-hover-light);--uc-secondary-foreground:var(--uc-secondary-foreground-light);--uc-muted:var(--uc-muted-light);--uc-muted-foreground:var(--uc-muted-foreground-light);--uc-destructive:var(--uc-destructive-light);--uc-destructive-foreground:var(--uc-destructive-foreground-light);--uc-border:var(--uc-border-light);--uc-dialog-shadow:var(--uc-dialog-shadow-light);--uc-simple-btn:var(--uc-simple-btn-light);--uc-simple-btn-hover:var(--uc-simple-btn-hover-light);--uc-simple-btn-foreground:var(--uc-simple-btn-foreground-light)}}@media (prefers-color-scheme:dark){:where([uc-wgt-common]){--uc-background:var(--uc-background-dark);--uc-foreground:var(--uc-foreground-dark);--uc-primary:var(--uc-primary-dark);--uc-primary-hover:var(--uc-primary-hover-dark);--uc-primary-transparent:var(--uc-primary-transparent-dark);--uc-primary-foreground:var(--uc-primary-foreground-dark);--uc-secondary:var(--uc-secondary-dark);--uc-secondary-hover:var(--uc-secondary-hover-dark);--uc-secondary-foreground:var(--uc-secondary-foreground-dark);--uc-muted:var(--uc-muted-dark);--uc-muted-foreground:var(--uc-muted-foreground-dark);--uc-destructive:var(--uc-destructive-dark);--uc-destructive-foreground:var(--uc-destructive-foreground-dark);--uc-border:var(--uc-border-dark);--uc-dialog-shadow:var(--uc-dialog-shadow-dark);--uc-simple-btn:var(--uc-simple-btn-dark);--uc-simple-btn-hover:var(--uc-simple-btn-hover-dark);--uc-simple-btn-foreground:var(--uc-simple-btn-foreground-dark)}}:where(.uc-light){--uc-background:var(--uc-background-light);--uc-foreground:var(--uc-foreground-light);--uc-primary:var(--uc-primary-light);--uc-primary-hover:var(--uc-primary-hover-light);--uc-primary-transparent:var(--uc-primary-transparent-light);--uc-primary-foreground:var(--uc-primary-foreground-light);--uc-secondary:var(--uc-secondary-light);--uc-secondary-hover:var(--uc-secondary-hover-light);--uc-secondary-foreground:var(--uc-secondary-foreground-light);--uc-muted:var(--uc-muted-light);--uc-muted-foreground:var(--uc-muted-foreground-light);--uc-destructive:var(--uc-destructive-light);--uc-destructive-foreground:var(--uc-destructive-foreground-light);--uc-border:var(--uc-border-light);--uc-dialog-shadow:var(--uc-dialog-shadow-light);--uc-simple-btn:var(--uc-simple-btn-light);--uc-simple-btn-hover:var(--uc-simple-btn-hover-light);--uc-simple-btn-foreground:var(--uc-simple-btn-foreground-light)}:where(.uc-dark){--uc-background:var(--uc-background-dark);--uc-foreground:var(--uc-foreground-dark);--uc-primary:var(--uc-primary-dark);--uc-primary-hover:var(--uc-primary-hover-dark);--uc-primary-transparent:var(--uc-primary-transparent-dark);--uc-primary-foreground:var(--uc-primary-foreground-dark);--uc-secondary:var(--uc-secondary-dark);--uc-secondary-hover:var(--uc-secondary-hover-dark);--uc-secondary-foreground:var(--uc-secondary-foreground-dark);--uc-muted:var(--uc-muted-dark);--uc-muted-foreground:var(--uc-muted-foreground-dark);--uc-destructive:var(--uc-destructive-dark);--uc-destructive-foreground:var(--uc-destructive-foreground-dark);--uc-border:var(--uc-border-dark);--uc-dialog-shadow:var(--uc-dialog-shadow-dark);--uc-simple-btn:var(--uc-simple-btn-dark);--uc-simple-btn-hover:var(--uc-simple-btn-hover-dark);--uc-simple-btn-foreground:var(--uc-simple-btn-foreground-dark)}:where(.uc-purple){--uc-primary-oklch-light:47% .22 300;--uc-primary-oklch-dark:69% .1768 300}:where(.uc-red){--uc-primary-oklch-light:47% .21 21;--uc-primary-oklch-dark:71% .1768 21}:where(.uc-orange){--uc-primary-oklch-light:47% .1376 51.88;--uc-primary-oklch-dark:69% .1768 51.88}:where(.uc-green){--uc-primary-oklch-light:45% .14 130;--uc-primary-oklch-dark:69% .1768 130}:where(.uc-turquoise){--uc-primary-oklch-light:45% .0854 174;--uc-primary-oklch-dark:69% .1768 174}:where(.uc-gray){--uc-primary-oklch-light:10% 0 0;--uc-primary-oklch-dark:97% 0 0}:where(.uc-contrast){--uc-border-light:oklch(50% 0 0);--uc-border-dark:oklch(50% 0 0);--uc-muted-light:oklch(98% 0 0);--uc-muted-dark:oklch(16% 0 0);--uc-muted-foreground-light:oklch(20% 0 0);--uc-muted-foreground-dark:oklch(80% 0 0);--uc-background-light:oklch(100% 0 0);--uc-foreground-light:oklch(0% 0 0);--uc-background-dark:oklch(10% 0 0);--uc-foreground-dark:oklch(100% 0 0)}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#){--color-primary-accent:var(--uc-primary);--color-text-base:var(--uc-foreground);--color-text-accent-contrast:var(--uc-background);--color-fill-contrast:var(--uc-background);--color-modal-backdrop:oklch(0 0 0/.1);--color-image-background:var(--uc-muted);--color-focus-ring:var(--color-primary-accent);--color-crop-guides:var(--uc-foreground);--font-size-ui:var(--uc-font-size);--size-touch-area:var(--uc-button-size);--size-panel-heading:calc(var(--uc-button-size) + var(--uc-padding)*2);--size-ui-min-width:130px;--size-line-width:1px;--size-modal-width:650px;--size-icon:calc(var(--uc-button-size)/2);--border-radius-editor:var(--uc-radius);--border-radius-thumb:var(--uc-radius);--border-radius-ui:var(--uc-radius);--border-radius-base:var(--uc-radius);--cldtr-gap-min:5px;--cldtr-gap-mid-1:10px;--cldtr-gap-mid-2:15px;--cldtr-gap-max:20px;--transition-duration-2:var(--transition-duration-all,.2s);--transition-duration-3:var(--transition-duration-all,.3s);--transition-duration-4:var(--transition-duration-all,.4s);--transition-duration-5:var(--transition-duration-all,.5s);--modal-header-opacity:1;--modal-header-height:var(--size-panel-heading);--modal-toolbar-height:var(--size-panel-heading);--transparent-pixel:url(${d});display:block;height:100%;max-height:100%;width:100%}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) :is([can-handle-paste]:hover,[can-handle-paste]:focus){--can-handle-paste:"true"}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) :is([tabindex][focus-visible],[tabindex]:hover,[with-effects][focus-visible],[with-effects]:hover){--filter-effect:var(--hover-filter)!important;--opacity-effect:var(--hover-opacity)!important;--color-effect:var(--hover-color-rgb)!important;--background-effect:var(--hover-background)!important}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) :is([tabindex]:active,[with-effects]:active){--filter-effect:var(--down-filter)!important;--opacity-effect:var(--down-opacity)!important;--color-effect:var(--down-color-rgb)!important;--background-effect:var(--down-background)!important}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) :is([tabindex][active],[with-effects][active]){--filter-effect:var(--active-filter)!important;--opacity-effect:var(--active-opacity)!important;--color-effect:var(--active-color-rgb)!important;--background-effect:var(--active-background)!important}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) [hidden-scrollbar]::-webkit-scrollbar{display:none}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) [hidden-scrollbar]{-ms-overflow-style:none;scrollbar-width:none}[uc-cloud-image-editor].uc-editor_ON:not(#\\#):not(#\\#):not(#\\#){--modal-header-opacity:0;--modal-header-height:0px;--modal-toolbar-height:calc(var(--size-panel-heading)*2)}[uc-cloud-image-editor].uc-editor_OFF:not(#\\#):not(#\\#):not(#\\#){--modal-header-opacity:1;--modal-header-height:var(--size-panel-heading);--modal-toolbar-height:var(--size-panel-heading)}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper{--l-min-img-height:var(--modal-toolbar-height);--l-max-img-height:100%;--l-edit-button-width:120px;--l-toolbar-horizontal-padding:var(--cldtr-gap-mid-1);display:grid;grid-template-rows:minmax(var(--l-min-img-height),var(--l-max-img-height)) minmax(var(--modal-toolbar-height),auto);height:100%;overflow:hidden;overflow-y:auto;position:relative}@media only screen and (max-width:800px){[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper{--l-edit-button-width:70px;--l-toolbar-horizontal-padding:var(--cldtr-gap-min)}}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport{align-items:center;display:flex;justify-content:center;overflow:hidden}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-image_container>.uc-image{--viewer-image-opacity:1;background-color:var(--color-image-background);box-sizing:border-box;display:block;height:100%;left:0;object-fit:scale-down;opacity:var(--viewer-image-opacity);pointer-events:auto;position:absolute;top:0;transform:scale(1);user-select:none;width:100%;z-index:10}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-image_container>.uc-image.uc-image_visible_viewer{transition:opacity var(--transition-duration-3) ease-in-out,transform var(--transition-duration-4)}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-image_container>.uc-image.uc-image_hidden_to_cropper{--viewer-image-opacity:0;background-image:var(--transparent-pixel);pointer-events:none;transform:scale(1);transition:transform var(--transition-duration-4),opacity var(--transition-duration-3) step-end}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-image_container>.uc-image.uc-image_hidden_effects{--viewer-image-opacity:0;pointer-events:none;transform:scale(1);transition:opacity var(--transition-duration-3) cubic-bezier(.5,0,1,1),transform var(--transition-duration-4)}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-image_container{background-color:var(--color-image-background);display:block;height:100%;position:relative;transition:var(--transition-duration-3);width:100%}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-toolbar{position:relative;transition:.3s}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-toolbar>.uc-toolbar_content{background-color:var(--color-fill-contrast);bottom:0;box-sizing:border-box;height:var(--modal-toolbar-height);left:0;min-height:var(--size-panel-heading);position:absolute;width:100%}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-toolbar>.uc-toolbar_content.uc-toolbar_content__viewer{align-items:center;display:flex;height:var(--size-panel-heading);justify-content:space-between;padding-left:var(--l-toolbar-horizontal-padding);padding-right:var(--l-toolbar-horizontal-padding)}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-toolbar>.uc-toolbar_content.uc-toolbar_content__editor{display:flex}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-info_pan{position:absolute;user-select:none}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-file_type_outer{display:flex;max-width:120px;position:absolute;transform:translate(-40px);user-select:none;z-index:2}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-viewport>.uc-file_type_outer>.uc-file_type{padding:4px .8em}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-network_problems_splash{background-color:var(--color-fill-contrast);display:flex;flex-direction:column;height:100%;position:absolute;width:100%;z-index:4}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-network_problems_splash>.uc-network_problems_content{align-items:center;display:flex;flex:1;flex-direction:column;justify-content:center}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-network_problems_splash>.uc-network_problems_content>.uc-network_problems_icon{align-items:center;background-color:var(--uc-muted);border-radius:50%;color:var(--uc-foreground);display:flex;height:40px;justify-content:center;width:40px}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-network_problems_splash>.uc-network_problems_content>.uc-network_problems_text{color:var(--uc-foreground);font-size:var(--font-size-ui);margin-top:var(--cldtr-gap-max)}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#)>.uc-wrapper>.uc-network_problems_splash>.uc-network_problems_footer{align-items:center;display:flex;height:var(--size-panel-heading);justify-content:center}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#)>.uc-svg{border-top-left-radius:var(--border-radius-base);border-top-right-radius:var(--border-radius-base);height:100%;left:0;opacity:inherit;position:absolute;top:0;transition:var(--transition-duration-3);width:100%;z-index:2}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#)>.uc-thumb{--idle-color-rgb:var(--color-text-base);--hover-color-rgb:var(--color-primary-accent);--focus-color-rgb:var(--color-primary-accent);--down-color-rgb:var(--color-primary-accent);--color-effect:var(--idle-color-rgb);color:var(--color-effect);transition:color var(--transition-duration-3),opacity var(--transition-duration-3)}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-thumb--visible{opacity:1;pointer-events:auto}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-thumb--hidden{opacity:0;pointer-events:none}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-guides{transition:var(--transition-duration-3)}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-guides--hidden{opacity:0}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-guides--semi-hidden{opacity:.2}uc-crop-frame:not(#\\#):not(#\\#):not(#\\#) .uc-guides--visible{opacity:1}uc-editor-aspect-ratio-button-control:not(#\\#):not(#\\#):not(#\\#),uc-editor-button-control:not(#\\#):not(#\\#):not(#\\#),uc-editor-crop-button-control:not(#\\#):not(#\\#):not(#\\#),uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#),uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#),uc-editor-operation-control:not(#\\#):not(#\\#):not(#\\#){--l-base-min-width:var(--uc-button-size);--l-base-height:var(--uc-button-size);--opacity-effect:var(--idle-opacity);--color-effect:var(--idle-color-rgb);--background-effect:var(--idle-background);--filter-effect:var(--idle-filter);--idle-color-rgb:var(--uc-secondary-foreground);--idle-opacity:1;--idle-filter:1;--idle-background:var(--uc-secondary);--hover-color-rgb:var(--uc-secondary-foreground);--hover-opacity:1;--hover-filter:.8;--hover-background:var(--uc-secondary-hover);--down-color-rgb:var(--hover-color-rgb);--down-opacity:1;--down-filter:.6;--down-background:var(--uc-secondary);border-radius:var(--uc-radius)}uc-editor-aspect-ratio-button-control:not(#\\#):not(#\\#):not(#\\#)>button,uc-editor-button-control:not(#\\#):not(#\\#):not(#\\#)>button,uc-editor-crop-button-control:not(#\\#):not(#\\#):not(#\\#)>button,uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>button,uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button,uc-editor-operation-control:not(#\\#):not(#\\#):not(#\\#)>button{all:unset;align-items:center;color:var(--color-effect);cursor:pointer;display:grid;grid-template-columns:var(--l-base-min-width) auto;grid-template-rows:100%;height:var(--l-base-height);opacity:var(--opacity-effect);position:relative;transition:var(--l-width-transition)}uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button{grid-template-columns:auto var(--l-base-min-width)}uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button>uc-icon{margin-left:var(--cldtr-gap-mid-1);width:10px}:where(uc-editor-button-control,uc-editor-crop-button-control,uc-editor-aspect-ratio-button-control,uc-editor-freeform-button-control,uc-editor-filter-control,uc-editor-operation-control):not(#\\#):not(#\\#):not(#\\#)>uc-icon>svg{height:var(--size-icon);width:var(--size-icon)}uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>uc-icon.uc-original-icon>svg{height:100%;width:100%}uc-editor-aspect-ratio-button-control.uc-active:not(#\\#):not(#\\#):not(#\\#),uc-editor-button-control.uc-active:not(#\\#):not(#\\#):not(#\\#),uc-editor-crop-button-control.uc-active:not(#\\#):not(#\\#):not(#\\#),uc-editor-filter-control.uc-active:not(#\\#):not(#\\#):not(#\\#),uc-editor-freeform-button-control.uc-active:not(#\\#):not(#\\#):not(#\\#),uc-editor-operation-control.uc-active:not(#\\#):not(#\\#):not(#\\#){--idle-color-rgb:var(--uc-primary-foreground);--idle-background:var(--uc-primary);--idle-opacity:1;--hover-color-rgb:var(--uc-primary-foreground);--hover-background:var(--uc-primary);--hover-opacity:1}uc-editor-filter-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#) .uc-preview[loaded]{opacity:1}uc-editor-filter-control.uc-active:not(#\\#):not(#\\#):not(#\\#) .uc-preview{opacity:0}uc-editor-aspect-ratio-button-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#),uc-editor-button-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#),uc-editor-crop-button-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#),uc-editor-filter-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#),uc-editor-freeform-button-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#),uc-editor-operation-control.uc-not_active:not(#\\#):not(#\\#):not(#\\#){--idle-color-rgb:var(--uc-secondary-foreground)}:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-aspect-ratio-button-control.uc-not_active,:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-button-control.uc-not_active,:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-crop-button-control.uc-not_active,:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-filter-control.uc-not_active,:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-freeform-button-control.uc-not_active,:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-editor-operation-control.uc-not_active{--idle-background:transparent;--hover-background:var(--uc-secondary);outline:1px solid var(--uc-border);outline-offset:-1px}uc-editor-aspect-ratio-button-control:not(#\\#):not(#\\#):not(#\\#)>button:before,uc-editor-button-control:not(#\\#):not(#\\#):not(#\\#)>button:before,uc-editor-crop-button-control:not(#\\#):not(#\\#):not(#\\#)>button:before,uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>button:before,uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button:before,uc-editor-operation-control:not(#\\#):not(#\\#):not(#\\#)>button:before{background-color:var(--background-effect);border-radius:var(--border-radius-editor);content:"";height:100%;left:0;position:absolute;right:0;transition:var(--transition-duration-3);width:100%;z-index:-1}uc-editor-aspect-ratio-button-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title,uc-editor-button-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title,uc-editor-crop-button-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title,uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title,uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title,uc-editor-operation-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title{font-size:.7em;letter-spacing:1.004px;padding-right:var(--cldtr-gap-mid-1);text-transform:uppercase}uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-title{padding-left:var(--cldtr-gap-mid-1);padding-right:0}uc-editor-aspect-ratio-button-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon,uc-editor-button-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon,uc-editor-crop-button-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon,uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon,uc-editor-freeform-button-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon,uc-editor-operation-control:not(#\\#):not(#\\#):not(#\\#)>button uc-icon{pointer-events:none}uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>button .uc-preview{background-repeat:no-repeat;background-size:contain;border-radius:var(--border-radius-editor);filter:brightness(var(--filter-effect));height:var(--l-base-height);left:0;opacity:0;position:absolute;right:0;transition:var(--transition-duration-3);width:100%;z-index:-1}uc-editor-filter-control:not(#\\#):not(#\\#):not(#\\#)>.uc-original-icon{color:var(--color-effect);opacity:.3}uc-editor-image-cropper:not(#\\#):not(#\\#):not(#\\#){color:var(--color-crop-guides);display:block;height:100%;left:0;opacity:0;pointer-events:none;position:absolute;top:0;touch-action:none;width:100%;z-index:10}uc-editor-image-cropper.uc-active_from_editor:not(#\\#):not(#\\#):not(#\\#),uc-editor-image-cropper.uc-active_from_viewer:not(#\\#):not(#\\#):not(#\\#){opacity:1;pointer-events:auto;transform:scale(1) translate(0);transition:transform var(--transition-duration-4) cubic-bezier(.37,0,.63,1) .4s,opacity var(--transition-duration-3)}uc-editor-image-cropper.uc-inactive_to_editor:not(#\\#):not(#\\#):not(#\\#){opacity:0;pointer-events:none;transition:transform var(--transition-duration-4) cubic-bezier(.37,0,.63,1),opacity var(--transition-duration-3) calc(var(--transition-duration-3) + .05s)}uc-editor-image-cropper:not(#\\#):not(#\\#):not(#\\#)>.uc-canvas{z-index:1}uc-editor-image-cropper:not(#\\#):not(#\\#):not(#\\#)>.uc-canvas,uc-editor-image-fader:not(#\\#):not(#\\#):not(#\\#){display:block;height:100%;left:0;position:absolute;top:0;width:100%}uc-editor-image-fader.uc-active_from_viewer:not(#\\#):not(#\\#):not(#\\#){opacity:1;pointer-events:auto;transform:scale(1);transition:transform var(--transition-duration-4),opacity var(--transition-duration-3) step-start;z-index:3}uc-editor-image-fader.uc-active_from_cropper:not(#\\#):not(#\\#):not(#\\#){opacity:1;pointer-events:auto;transform:scale(1);transition:transform var(--transition-duration-4),opacity var(--transition-duration-3) step-end;z-index:3}uc-editor-image-fader.uc-inactive_to_cropper:not(#\\#):not(#\\#):not(#\\#){opacity:0;pointer-events:none;transform:scale(1);transition:transform var(--transition-duration-4),opacity var(--transition-duration-3) step-end;z-index:3}uc-editor-image-fader:not(#\\#):not(#\\#):not(#\\#) .uc-fader-image{content-visibility:auto;display:block;height:100%;left:0;object-fit:scale-down;position:absolute;top:0;transform:scale(1);user-select:none;width:100%}uc-editor-image-fader:not(#\\#):not(#\\#):not(#\\#) .uc-fader-image--preview{background-color:var(--color-image-background);border-top-left-radius:var(--border-radius-base);border-top-right-radius:var(--border-radius-base);opacity:0;transform:scale(1);transition:var(--transition-duration-3)}uc-editor-scroller:not(#\\#):not(#\\#):not(#\\#){align-items:center;display:flex;height:100%;overflow-x:scroll;width:100%}uc-editor-slider:not(#\\#):not(#\\#):not(#\\#){align-items:center;display:flex;height:var(--size-panel-heading);justify-content:center;width:100%}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#){height:100%;position:relative;width:100%}@media only screen and (max-width:600px){uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#){--l-tab-gap:var(--cldtr-gap-mid-1);--l-slider-padding:var(--uc-padding);--l-controls-padding:var(--uc-padding)}}@media only screen and (min-width:601px){uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#){--l-tab-gap:var(--cldtr-gap-max);--l-slider-padding:var(--uc-padding);--l-controls-padding:var(--uc-padding)}}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container{height:100%;overflow:hidden;position:relative;width:100%}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar{background-color:var(--color-fill-contrast);display:grid;grid-template-rows:1fr 1fr;height:100%;position:absolute;transition:opacity var(--transition-duration-3) ease-in-out,transform var(--transition-duration-3) ease-in-out,visibility var(--transition-duration-3) ease-in-out;width:100%}.uc-sub-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-list-aspect-ratio-container>.uc-list-aspect-ratio{align-items:center;display:grid;gap:6px;grid-auto-flow:column;height:var(--size-panel-heading);justify-content:center}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar.uc-sub-toolbar--visible{opacity:1;pointer-events:auto;transform:translateY(0)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar.uc-sub-toolbar--top-hidden{opacity:0;pointer-events:none;transform:translateY(100%)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar.uc-sub-toolbar--bottom-hidden{opacity:0;pointer-events:none;transform:translateY(-100%)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row{align-items:center;display:flex;justify-content:space-between;padding-left:var(--l-controls-padding);padding-right:var(--l-controls-padding)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles{display:grid;grid-auto-flow:column;position:relative;grid-gap:0 var(--l-tab-gap);align-items:center;height:100%}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles>.uc-tab-toggles_indicator{background-color:var(--uc-secondary-foreground);bottom:0;height:2px;left:0;position:absolute;transform:translate(0);transition:transform var(--transition-duration-3);width:var(--size-touch-area)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row{position:relative}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content{content-visibility:auto;display:flex;height:100%;left:0;opacity:0;overflow:hidden;position:absolute;top:0;width:100%}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content.uc-tab-content--visible{opacity:1;pointer-events:auto}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content.uc-tab-content--hidden{opacity:0;pointer-events:none}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles>.uc-tab-toggle.uc-tab-toggle--visible{display:contents}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles.uc-tab-toggles--hidden,uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles>.uc-tab-toggle.uc-tab-toggle--hidden{display:none}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles>.uc-tab-toggle>uc-btn-ui{width:var(--uc-button-size)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-controls-row>.uc-tab-toggles>.uc-tab-toggle>uc-btn-ui>uc-icon>svg{height:var(--size-icon);width:var(--size-icon)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content .uc-controls-list_align{box-sizing:border-box;display:grid;grid-template-areas:". inner .";grid-template-columns:1fr auto 1fr;min-width:100%;padding-left:var(--uc-padding)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content .uc-controls-list_inner{display:grid;gap:6px;grid-area:inner;grid-auto-flow:column}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#)>.uc-toolbar-container>.uc-sub-toolbar>.uc-tab-content-row>.uc-tab-content .uc-controls-list_inner:last-child{padding-right:var(--uc-padding)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-controls-list_last-item{margin-right:var(--cldtr-gap-max)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-info-tooltip_container{align-items:flex-start;display:flex;height:100%;justify-content:center;position:absolute;width:100%}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-info-tooltip_wrapper{display:flex;flex-direction:column;height:100%;justify-content:flex-end;pointer-events:none;position:absolute;top:calc(-100% - var(--cldtr-gap-mid-2))}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-info-tooltip{background-color:var(--color-text-accent-contrast);border-radius:var(--border-radius-editor);color:var(--color-text-base);font-size:.7em;letter-spacing:1px;opacity:0;padding:3px 6px;text-transform:uppercase;transform:translateY(100%);transition:var(--transition-duration-3);z-index:3}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-info-tooltip_visible{opacity:1;transform:translateY(0)}uc-editor-toolbar:not(#\\#):not(#\\#):not(#\\#) .uc-slider{padding-left:var(--l-slider-padding);padding-right:var(--l-slider-padding)}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#)>button{--filter-effect:var(--idle-brightness);--opacity-effect:var(--idle-opacity);--color-effect:var(--idle-color-rgb);--background-effect:var(--idle-background);--l-transition-effect:var( --css-transition,color var(--transition-duration-2),background-color var(--transition-duration-2),filter var(--transition-duration-2) );all:unset;align-items:center;background-color:var(--background-effect);border-radius:var(--uc-radius);box-sizing:var(--css-box-sizing,border-box);color:var(--color-effect);cursor:pointer;display:inline-flex;filter:brightness(var(--filter-effect));font-size:1em;height:var(--css-height,var(--uc-button-size));opacity:var(--opacity-effect);padding-left:var(--css-padding-left,14px);padding-right:var(--css-padding-right,14px);transition:var(--l-transition-effect);user-select:none}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#)>button>uc-icon{pointer-events:none}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-text{white-space:nowrap}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-icon{align-items:center;color:var(--color-effect);display:flex;filter:brightness(var(--filter-effect));justify-content:center;transition:var(--l-transition-effect)}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-icon_left{margin-left:0;margin-right:var(--cldtr-gap-mid-1)}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-icon_right{margin-left:var(--cldtr-gap-mid-1);margin-right:0}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-icon_single{margin-left:0;margin-right:0}uc-btn-ui:not(#\\#):not(#\\#):not(#\\#) .uc-icon_hidden{display:none;margin:0}uc-btn-ui.uc-primary:not(#\\#):not(#\\#):not(#\\#)>button{--idle-color-rgb:var(--uc-primary-foreground);--idle-brightness:1;--idle-opacity:1;--idle-background:var(--uc-primary);--hover-color-rgb:var(--uc-primary-foreground);--hover-brightness:1;--hover-opacity:1;--hover-background:var(--uc-primary-hover);--down-color-rgb:var(--uc-primary-foreground);--down-brightness:.75;--down-opacity:1;--down-background:var(--uc-primary);--active-color-rgb:var(--uc-primary-foreground);--active-brightness:1;--active-opacity:1;--active-background:var(--uc-primary)}uc-btn-ui.uc-primary-icon:not(#\\#):not(#\\#):not(#\\#)>button{--idle-color-rgb:var(--uc-primary);--idle-brightness:1;--idle-opacity:1;--idle-background:transparent;--hover-color-rgb:var(--uc-primary);--hover-brightness:1;--hover-opacity:1;--hover-background:var(--uc-primary-transparent);--down-color-rgb:var(--uc-primary);--down-brightness:.75;--down-opacity:1;--down-background:var(--uc-primary-transparent);--active-color-rgb:var(--uc-primary-foreground);--active-brightness:1;--active-opacity:1;--active-background:var(--uc-primary);padding:0;width:var(--uc-button-size)}uc-btn-ui.uc-secondary:not(#\\#):not(#\\#):not(#\\#)>button{--idle-color-rgb:var(--uc-secondary-foreground);--idle-brightness:1;--idle-opacity:1;--idle-background:var(--uc-secondary);--hover-color-rgb:var(--uc-secondary-foreground);--hover-brightness:1;--hover-opacity:1;--hover-background:var(--uc-secondary-hover);--down-color-rgb:var(--uc-secondary-foreground);--down-brightness:1;--down-opacity:1;--down-background:var(--uc-secondary-hover);--active-color-rgb:var(--uc-secondary-foreground);--active-brightness:1;--active-opacity:1;--active-background:transparent}:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-btn-ui.uc-secondary>button{border:1px solid var(--uc-border)}uc-btn-ui.uc-secondary-icon:not(#\\#):not(#\\#):not(#\\#)>button,uc-btn-ui.uc-tab:not(#\\#):not(#\\#):not(#\\#)>button{--idle-color-rgb:var(--uc-secondary-foreground);--idle-brightness:1;--idle-opacity:1;--idle-background:transparent;--hover-color-rgb:var(--uc-secondary-foreground);--hover-brightness:1;--hover-opacity:1;--hover-background:var(--uc-secondary);--down-color-rgb:var(--uc-secondary-foreground);--down-brightness:1;--down-opacity:1;--down-background:var(--uc-secondary);--active-color-rgb:var(--uc-secondary-foreground);--active-brightness:1;--active-opacity:1;--active-background:transparent;padding:0;width:var(--uc-button-size)}uc-btn-ui.uc-default:not(#\\#):not(#\\#):not(#\\#)>button{--idle-color-rgb:var(--uc-secondary-foreground);--idle-brightness:1;--idle-opacity:1;--idle-background:var(--uc-secondary);--hover-color-rgb:var(--uc-secondary-foreground);--hover-brightness:1;--hover-opacity:1;--hover-background:var(--uc-secondary-hover);--down-color-rgb:var(--uc-secondary-foreground);--down-brightness:.75;--down-opacity:1;--down-background:var(--uc-secondary);--active-color-rgb:var(--uc-primary);--active-brightness:1;--active-opacity:1;--active-background:var(--uc-primary-transparent)}:where(.uc-contrast):not(#\\#):not(#\\#):not(#\\#) uc-btn-ui.uc-default>button{--idle-background:transparent;--hover-background:var(--uc-secondary);--active-background:var(--uc-foreground);--active-color-rgb:var(--uc-background)}uc-line-loader-ui:not(#\\#):not(#\\#):not(#\\#){height:2px;left:0;opacity:.5;position:absolute;top:0;width:100%;z-index:9999}uc-line-loader-ui:not(#\\#):not(#\\#):not(#\\#) .uc-inner{height:100%;max-width:200px;width:25%}uc-line-loader-ui:not(#\\#):not(#\\#):not(#\\#) .uc-line{background-color:var(--uc-primary);height:100%;transform:translate(-101%);transition:transform 1s;width:100%}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#){--l-thumb-size:24px;--l-zero-dot-size:5px;--l-zero-dot-offset:2px;--idle-color-rgb:var(--uc-foreground);--hover-color-rgb:var(--uc-primary);--down-color-rgb:var(--uc-primary);--color-effect:var(--idle-color-rgb);--l-color:var(--color-effect);align-items:center;display:flex;height:calc(var(--l-thumb-size) + (var(--l-zero-dot-size) + var(--l-zero-dot-offset))*2);justify-content:center;position:relative;width:100%}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-thumb{background-color:var(--l-color);border-radius:50%;height:var(--l-thumb-size);left:0;opacity:1;position:absolute;transform:translate(0);transition:opacity var(--transition-duration-2),background-color var(--transition-duration-2);width:var(--l-thumb-size)}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-steps{align-items:center;box-sizing:border-box;display:flex;height:100%;justify-content:space-between;padding-left:calc(var(--l-thumb-size)/2);padding-right:calc(var(--l-thumb-size)/2);position:absolute;width:100%}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-border-step{border-right:1px solid var(--uc-foreground);height:10px;opacity:1;transition:border-color var(--transition-duration-2);width:0}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-minor-step{border-right:1px solid var(--uc-foreground);height:4px;opacity:.6;transition:border-color var(--transition-duration-2);width:0}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-zero-dot{background-color:var(--color-primary-accent);border-radius:50%;height:var(--l-zero-dot-size);left:calc(var(--l-thumb-size)/2 - var(--l-zero-dot-size)/2);opacity:0;position:absolute;top:calc(100% - var(--l-zero-dot-offset)*2);transition:var(--transition-duration-3);width:var(--l-zero-dot-size)}uc-slider-ui:not(#\\#):not(#\\#):not(#\\#) .uc-input{cursor:pointer;height:100%;margin:0;opacity:0;position:absolute;width:calc(100% - 10px)}uc-presence-toggle.uc-transition:not(#\\#):not(#\\#):not(#\\#){transition:opacity var(--transition-duration-3),visibility var(--transition-duration-3)}uc-presence-toggle.uc-visible:not(#\\#):not(#\\#):not(#\\#){opacity:1;pointer-events:inherit}uc-presence-toggle.uc-hidden:not(#\\#):not(#\\#):not(#\\#){opacity:0;pointer-events:none}uc-presence-toggle.uc-initial:not(#\\#):not(#\\#):not(#\\#){display:none!important;transition:none!important}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) [role=button]:focus-visible,[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) button:focus-visible{outline:1px auto Highlight;outline:1px auto -webkit-focus-ring-color}[uc-cloud-image-editor]:not(#\\#):not(#\\#):not(#\\#) .uc-cloud-mask{pointer-events:none}[uc-aspect-ratio-freeform]:not(#\\#):not(#\\#):not(#\\#) button{display:flex}[uc-aspect-ratio-freeform]:not(#\\#):not(#\\#):not(#\\#) uc-icon{display:none}[uc-aspect-ratio-freeform]:not(#\\#):not(#\\#):not(#\\#) .uc-title{padding-left:var(--cldtr-gap-mid-1)}:where(uc-editor-freeform-button-control,uc-editor-aspect-ratio-button-control:last-of-type):not(#\\#):not(#\\#):not(#\\#){margin-right:calc(var(--cldtr-gap-mid-1)*3)}:where([uc-cloud-image-editor]):not(#\\#):not(#\\#):not(#\\#) uc-icon{display:flex;height:100%;justify-content:center;width:100%}:where([uc-cloud-image-editor]):not(#\\#):not(#\\#):not(#\\#) uc-icon svg{height:calc(var(--uc-button-size)/2);width:calc(var(--uc-button-size)/2)}uc-config:not(#\\#){display:none}uc-icon:not(#\\#){align-items:center;display:inline-flex;height:var(--uc-button-size);justify-content:center;width:var(--uc-button-size)}uc-icon:not(#\\#) svg{height:calc(var(--uc-button-size)/2);overflow:visible;width:calc(var(--uc-button-size)/2)}`,""]);const h=u}},e={};function r(i){var o=e[i];if(void 0!==o)return o.exports;var n=e[i]={id:i,exports:{}};return t[i](n,n.exports,r),n.exports}r.m=t,r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.b="undefined"!=typeof document&&document.baseURI||self.location.href;var i={};(()=>{"use strict";r.r(i),r.d(i,{Uploadcare:()=>xc,UploadcareCommand:()=>nt,UploadcareEditing:()=>fe,UploadcareImageEdit:()=>Yc,UploadcareImageEditCommand:()=>Nc,UploadcareImageEditEditing:()=>qc,UploadcareImageEditUI:()=>Wc,UploadcareUI:()=>$,UploadcareUploadAdapter:()=>he});var t={};r.r(t),r.d(t,{ActivityBlock:()=>tn,ActivityHeader:()=>ua,BaseComponent:()=>Ne,Block:()=>Yo,BtnUi:()=>ja,CameraSource:()=>ba,CloudImageEditor:()=>mc,CloudImageEditorActivity:()=>Xa,CloudImageEditorBlock:()=>ka,Config:()=>fs,Copyright:()=>vs,CropFrame:()=>xa,Data:()=>we,DropArea:()=>As,EditorAspectRatioButtonControl:()=>Ta,EditorCropButtonControl:()=>Aa,EditorFilterControl:()=>Oa,EditorFreeformButtonControl:()=>Ea,EditorImageCropper:()=>Pa,EditorImageFader:()=>za,EditorOperationControl:()=>Va,EditorScroller:()=>Fa,EditorSlider:()=>$a,EditorToolbar:()=>Ba,ExternalSource:()=>Ns,ExternalUploadSource:()=>wn,FileItem:()=>Fs,FileUploaderInline:()=>bc,FileUploaderMinimal:()=>vc,FileUploaderRegular:()=>yc,FormInput:()=>Bs,Icon:()=>js,Img:()=>Js,LineLoaderUi:()=>Ha,Modal:()=>tc,ModalEvents:()=>Ho,PACKAGE_NAME:()=>Ko,PACKAGE_VERSION:()=>Go,PresenceToggle:()=>Wa,ProgressBar:()=>ec,ProgressBarCommon:()=>rc,Select:()=>ic,SimpleBtn:()=>oc,SliderUi:()=>Za,SolutionBlock:()=>nn,SourceBtn:()=>nc,SourceList:()=>ac,Spinner:()=>sc,StartFrom:()=>cc,Thumb:()=>dc,UID:()=>xe,UploadCtxProvider:()=>hc,UploadList:()=>pc,UploadSource:()=>kn,UploaderBlock:()=>la,UrlSource:()=>gc,defineComponents:()=>en,defineLocale:()=>No,loadFileUploaderFrom:()=>on,toKebabCase:()=>Ya});var e,o,n,a=r(782),s=r(355),c=r(311);function l(t,e){var r=u();return(l=function(t,e){return r[t-=197]})(t,e)}function u(){var t=["Dropbox","80ZNVxsg","1482252IfYYZy","415rRTiKE","url","2703172qrtwTZ","onedrive","gdrive","2949489LoGJrp","5135809QuaIOT","2729040nTdbOD","GPhotos","OneDrive","4FNSapp","local","facebook","266212RkCjoN","36138BOgGVx","URL","gphotos","Local","GDrive","dropbox","Facebook"];return(u=function(){return t})()}function d(t,r,i){const o=t.t,n=t.t;switch(r){case e.Local:return{text:n("Insert"===i?"Upload from computer":"Replace from computer"),shortText:n("From computer")};case e.URL:return{text:"Insert"===i?n("Insert via URL"):o("Replace via URL"),shortText:n("Via URL")};case e.Dropbox:return{text:o("Insert"===i?"Insert with Dropbox":"Replace with Dropbox"),shortText:o("With Dropbox")};case e.Facebook:return{text:o("Insert"===i?"Insert with Facebook":"Replace with Facebook"),shortText:o("With Facebook")};case e.GDrive:return{text:o("Insert"===i?"Insert with Google Drive":"Replace with Google Drive"),shortText:o("With Google Drive")};case e.GPhotos:return{text:o("Insert"===i?"Insert with Google Photos":"Replace with Google Photos"),shortText:o("With Google Photos")};case e.OneDrive:return{text:o("Insert"===i?"Insert with OneDrive":"Replace with OneDrive"),shortText:o("With OneDrive")};default:return r}}!function(t){for(var e=l,r=t();;)try{if(409589===parseInt(e(213))/1*(parseInt(e(216))/2)+-parseInt(e(202))/3+-parseInt(e(205))/4+-parseInt(e(203))/5*(parseInt(e(217))/6)+-parseInt(e(209))/7+-parseInt(e(210))/8+parseInt(e(208))/9*(parseInt(e(201))/10))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(u),(o=e||(e={}))[(n=l)(220)]=n(214),o[n(218)]=n(204),o[n(200)]=n(198),o[n(197)]=n(207),o[n(199)]=n(215),o[n(211)]=n(219),o[n(212)]=n(206);var h=r(929),p=r.n(h),g=r(297),m=r.n(g),b=r(102),f=r.n(b),v=r(123),y=r.n(v),w=r(741),_=r.n(w),k=r(621),x={attributes:{"data-cke":!0}};x.setAttributes=y(),x.insert=f().bind(null,"head"),x.domAPI=m(),x.insertStyleElement=_();p()(k.A,x);k.A&&k.A.locals&&k.A.locals;var C=r(387),E={attributes:{"data-cke":!0}};E.setAttributes=y(),E.insert=f().bind(null,"head"),E.domAPI=m(),E.insertStyleElement=_();p()(C.A,E);C.A&&C.A.locals&&C.A.locals;var T=r(184),A={attributes:{"data-cke":!0}};A.setAttributes=y(),A.insert=f().bind(null,"head"),A.domAPI=m(),A.insertStyleElement=_();p()(T.A,A);T.A&&T.A.locals&&T.A.locals;const I=S;function S(t,e){const r=M();return(S=function(t,e){return r[t-=331]})(t,e)}function M(){const t=["2420doXQgZ","uploadcareLicenseKeyEvaluationLimit","uploadcareLicenseKeyValid","reduce","_createButton","tooltip","uploadcare.uploader.sourceList","get","text","2nEPlXb","isEnabled","ImageInsertUI","_createMenuBarButtons","uploadcareLicenseKeyNotAllowed","77sTHEvi","has","isPremiumPlugin","61558CWXtom","356945pXUUfI","plugins","_createDropdownButtons","Facebook","OneDrive","shortText","type","domainLimit","pluginName","label","usageLimit","entries","Insert","withText","299007RhXqbM","Replace","30qInIJT","GDrive","_licenseKeyCheckInterval","uploadcareLicenseKeyInvalid","bind","url","licenseKey","_createToolbarButton","evaluationLimit","push","forEach","uploadcareLicenseKeyTrialLimit","_getIntegrationKey","map","UploadcareUI","232JHIfvj","154540pYDWKm","isOfficialPlugin","98856MozUeO","editor","execute","trialLimit","expired","_showLicenseError","invalid","upload","GPhotos","afterInit","icon","registerIntegration","uploadcareLicenseKeyDomainLimit","Uploadcare","_normalizeConfigSourceList","URL","destroy","1893132DUBVvq","Dropbox","config","locale","uploadcareLicenseKeyExpired","uploadcareLicenseKeyUsageLimit","init","isImageSelected","assetManager","uploadcare","Local","5931qKTxzw","featureNotAllowed","commands"];return(M=function(){return t})()}!function(t){const e=S,r=t();for(;;)try{if(184261===-parseInt(e(386))/1*(parseInt(e(377))/2)+parseInt(e(400))/3+-parseInt(e(335))/4*(parseInt(e(402))/5)+-parseInt(e(337))/6+-parseInt(e(385))/7*(parseInt(e(334))/8)+parseInt(e(365))/9*(-parseInt(e(368))/10)+-parseInt(e(382))/11*(-parseInt(e(354))/12))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(M);class $ extends a.Plugin{[I(408)];[I(404)];static get[I(394)](){return I(333)}static get[I(336)](){return!0}static get[I(384)](){return!0}[I(360)](){const t=I;this[t(408)]=this[t(338)][t(356)][t(375)](t(408));const e=this[t(338)];this[t(404)]=setInterval(()=>{const r=t;let i;for(const t in e){const o=t,n=e[o];if(r(370)==n||r(405)==n||r(358)==n||r(349)==n||r(381)==n||r(369)==n||r(413)==n||r(359)==n){delete e[o],i=n,clearInterval(this[r(404)]),this[r(404)]=void 0;break}}r(405)==i&&e[r(342)](r(343)),r(358)==i&&e[r(342)](r(341)),r(349)==i&&e[r(342)](r(393)),r(381)==i&&e[r(342)](r(366),r(350)),r(369)==i&&e[r(342)](r(410)),r(413)==i&&e[r(342)](r(340)),r(359)==i&&e[r(342)](r(396))},1e3)}[I(346)](){const t=I,{editor:e}=this,r=e[t(367)][t(375)](t(363));if(!r)return;const i=this[t(351)](e[t(356)][t(375)](t(374)))[t(371)]((e,r)=>{const i=t,o=this[i(331)](r[i(392)]);return e[o]||(e[o]=[]),e[o][i(411)](r),e},{});e[t(387)][t(383)](t(379))&&e[t(367)][t(375)](t(363))&&Object[t(397)](i)[t(412)](([i,o])=>{const n=t;e[n(387)][n(375)](n(379))[n(348)]({name:i,observable:()=>r,buttonViewCreator:()=>this[n(409)](o),formViewCreator:()=>this[n(388)](o),menuBarButtonViewCreator:()=>this[n(380)](o),override:n(362)!==i})})}[I(353)](){const t=I;super[t(353)](),this[t(404)]&&clearInterval(this[t(404)])}[I(351)](t){const r=I,{locale:i}=this[r(338)];return t[r(332)](t=>{const o=r,n=d(i,t,o(398));switch(t){case e[o(364)]:return{icon:s.IconUploadcareImageUpload,type:e[o(364)],...n};case e[o(352)]:return{icon:s.IconUploadcareLink,type:e[o(352)],...n};case e[o(355)]:return{icon:s.IconDropbox,type:e[o(355)],...n};case e[o(389)]:return{icon:s.IconFacebook,type:e[o(389)],...n};case e[o(403)]:return{icon:s.IconGoogleDrive,type:e[o(403)],...n};case e[o(345)]:return{icon:s.IconGooglePhotos,type:e[o(345)],...n};case e[o(390)]:return{icon:s.IconOneDrive,type:e[o(390)],...n}}})}[I(331)](t){const r=I;switch(t){case e[r(364)]:return r(344);case e[r(352)]:return r(407);default:return r(362)}}[I(372)](t,e){const r=I,i=this[r(338)],o=new t(i[r(357)]),n=i[r(367)][r(375)](r(363));return o[r(406)](r(378)).to(n),o.on(r(339),()=>{n[r(339)](e)}),o}[I(409)](t){const e=I,{locale:r}=this[e(338)],i=this[e(338)][e(387)][e(375)](e(379)),o=t[0],n=this[e(372)](c.ButtonView,o[e(392)]);return n[e(347)]=o[e(347)],n[e(406)](e(395)).to(i,e(361),t=>d(r,o[e(392)],e(t?401:398))[e(376)]),n[e(373)]=!0,n}[I(388)](t){const e=I,{locale:r}=this[e(338)],i=this[e(338)][e(387)][e(375)](e(379));return t[e(332)](t=>{const o=e,n=this[o(372)](c.ButtonView,t[o(392)]);return n[o(399)]=!0,n[o(347)]=t[o(347)],n[o(406)](o(395)).to(i,o(361),e=>d(r,t[o(392)],o(e?401:398))[o(376)]),n})}[I(380)](t){const e=I;return t[e(332)](t=>{const r=e,i=this[r(372)](c.MenuBarMenuListItemButtonView,t[r(392)]);return i[r(347)]=t[r(347)],i[r(395)]=t[r(391)],i})}}var L=r(584),O=r(908),U={attributes:{"data-cke":!0}};U.setAttributes=y(),U.insert=f().bind(null,"head"),U.domAPI=m(),U.insertStyleElement=_();p()(O.A,U);O.A&&O.A.locals&&O.A.locals;var R=N;function P(){var t=["2081757SWoEpc","bindTemplate","fire","5yxUVPh","div","60LIyiBh","3962596BbEroF","focusCycler","getFocusableElement","focusTracker","3849264fdiMXm","2683988zqDcVr","589890WzRxDa","true","7Qlhpox","12hOLbJa","createCollection","26667zFZQqD","5120NZxEfC","10107rKQFZL","forwardCycle"];return(P=function(){return t})()}function N(t,e){var r=P();return(N=function(t,e){return r[t-=120]})(t,e)}!function(t){for(var e=N,r=t();;)try{if(468395===-parseInt(e(132))/1*(parseInt(e(130))/2)+-parseInt(e(136))/3+parseInt(e(126))/4*(-parseInt(e(139))/5)+parseInt(e(127))/6*(parseInt(e(129))/7)+-parseInt(e(125))/8+parseInt(e(134))/9*(parseInt(e(133))/10)+-parseInt(e(121))/11*(-parseInt(e(120))/12))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(P);class D extends c.View{[R(124)];[R(122)];constructor(t){var e=R;super(t),this[e(124)]=new L.FocusTracker,this[e(122)]=new c.FocusCycler({focusables:this[e(131)](),focusTracker:this[e(124)]})}[R(123)](){var t=R;return{tag:t(140),attributes:{"aria-hidden":t(128),tabindex:"0"},on:{focus:this[t(137)].to(()=>{var e=t;this[e(122)][e(138)](e(135))})}}}}function z(){var t=["3pEhPEh","div","ck-uploadcare-form","setTemplate","29803689UULkYV","ck-uploadcare-theme","uc-light","72247dFtsmk","1239472KgVEyT","uc-file-uploader-inline","501719yiDkDx","element","getFocusableElement","11901088SgoGlq","10gHDPsL","174qQJcPl","ck-reset_all-excluded","focus","661325ZFoPSG","uploader-","2700056mWXRhS"];return(z=function(){return t})()}function V(t,e){var r=z();return(V=function(t,e){return r[t-=297]})(t,e)}var F=V;!function(t){for(var e=V,r=t();;)try{if(945870===-parseInt(e(304))/1+-parseInt(e(302))/2*(parseInt(e(315))/3)+parseInt(e(314))/4+-parseInt(e(312))/5+parseInt(e(309))/6*(-parseInt(e(301))/7)+-parseInt(e(307))/8+parseInt(e(298))/9*(parseInt(e(308))/10))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(z);class B extends D{constructor(t,e){var r=V;super(t),this[r(297)]({tag:r(316),attributes:{class:["ck",r(310),r(317)],tabindex:"-1"},children:[{tag:r(303),attributes:{class:[r(300),r(299)],"ctx-name":r(313)+e}},this[r(306)]()]})}[F(311)](){var t=F;this[t(305)][t(311)]()}}function j(t,e){const r=H,i=[320,480,768,1024,1200,1600,1920,2400][r(441)](t=>t<=e)[r(450)](e=>t[r(429)](/\/$/,"")+r(471)+e+r(430)+e+"w");return{imageFallbackUrl:t,imageSources:[{srcset:i[r(459)](", "),sizes:r(437)+e+r(433)+e+"px",type:r(418)}]}}function H(t,e){const r=G();return(H=function(t,e){return r[t-=416]})(t,e)}function q(t,e,r){const i=t[H(469)](/\/crop\/(\d+)x(\d+)\//);return{width:i?parseInt(i[1],10):e,height:i?parseInt(i[2],10):r}}function K(t,e){const r=H,i=new((0,L.DomEmitterMixin)()),o=t[r(434)][r(422)](r(420)),n=t[r(465)][r(438)][r(463)](e),a=o[r(461)](n),s=t[r(465)][r(451)][r(427)][r(446)](a),c=e[r(428)](r(462)),l=e[r(428)](r(457)),u=r(455);t[r(465)][r(451)][r(453)](t=>{const e=r;t[e(421)](u,n),t[e(442)](e(449),c+"/"+l,a)}),i[r(467)](s,r(470),()=>{const e=r;i[e(435)](s,e(470)),t[e(465)][e(451)][e(453)](t=>{const r=e;t[r(423)](u,n),t[r(445)](r(449),a)})})}function G(){const t=["toViewElement","104265eXCAja","editing","78zGBulL","listenTo","isArray","match","load","/-/resize/","origin","4382BkdnfJ","image/webp","document","ImageUtils","addClass","get","removeClass","310016EORZAm","some","function","domConverter","getAttribute","replace","x/ ","imageInline","location","px) 100vw, ","plugins","stopListening","element","(max-width: ","mapper","225981nPJBVh","baseURI","filter","setStyle","uploadcareImageId","window","removeStyle","viewToDom","imageBlock","200INnXGU","aspect-ratio","map","view","122650GobnuA","change","src","image-processing","hasAttribute","height","800070GVItMm","join","31172rooMWy","findViewImgElement","width"];return(G=function(){return t})()}function W(t){const e=H;if(Array[e(468)](t)){const r=t[e(450)](W);return t=>r[e(425)](e=>e(t))}if(e(416)==t){const t=L.global[e(444)][e(432)][e(416)];return r=>new URL(r,L.global[e(419)][e(440)])[e(416)]==t}return e(426)==typeof t?t:t instanceof RegExp?r=>!(!r[e(469)](t)&&!r[e(429)](/^https?:\/\//,"")[e(469)](t)):()=>!1}function Z(t,e){var r=X();return(Z=function(t,e){return r[t-=388]})(t,e)}function X(){var t=["810570shyFRW","11702776ONftHC","6312690rNGqeN","includes","770595dtQNha","7ZFPxzv","253184DmoYWN","target","9xsadoZ","1920120vHzqdT","150872tBJysF"];return(X=function(){return t})()}function Y(t,e){var r=Z;return(0,L.getAncestors)(t[r(396)])[r(392)](e)}function J(){const t=["source-list","352BZZjhm","getAPI","addEventListener","done-click","Insert","_initListeners","15YukUoF","531647onNUjg","EDITOR_TOP_CENTER","element","_dialog","editing","Local","hide","insertImage","_editing","_insertAsset","getLastPosition","103604AgqExj","33OhyycX","setSelection","detail","3112473rVKAmJ","155925Onvchq","stopDelegating","stopListening","ctxElement","doneFlow","ucContextId","linkHref","imageInline","imageInfo","_insertImage","initFlow","getSelectedElement","_initDialog","view","_editor","uploadCare","removeSelectionAttribute","status","selection","width","show","6780zVeeZi","length","setAttribute","execute","removeAllFiles","document","text","attributes","uuid","Replace","configElement","11341yUWFwZ","model","get","_formView","image","idle","imageBlock","_type","destroy","allEntries","1497744aiSjKk","getOutputCollectionState","change","_api","isOpen","plugins","focus","setCurrentActivity","7528660dGZKoA","2cDFBuw"];return(J=function(){return t})()}!function(t){const e=H,r=t();for(;;)try{if(105419===parseInt(e(460))/1+-parseInt(e(452))/2+parseInt(e(439))/3+-parseInt(e(424))/4+-parseInt(e(458))/5+parseInt(e(466))/6*(parseInt(e(417))/7)+parseInt(e(448))/8*(parseInt(e(464))/9))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(G),function(t){for(var e=Z,r=t();;)try{if(532759===parseInt(e(395))/1+-parseInt(e(388))/2+parseInt(e(389))/3+-parseInt(e(398))/4+parseInt(e(393))/5+-parseInt(e(391))/6*(parseInt(e(394))/7)+parseInt(e(390))/8*(parseInt(e(397))/9))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(X);const Q=tt;function tt(t,e){const r=J();return(tt=function(t,e){return r[t-=219]})(t,e)}!function(t){const e=tt,r=t();for(;;)try{if(507596===parseInt(e(274))/1*(parseInt(e(265))/2)+-parseInt(e(286))/3*(parseInt(e(285))/4)+-parseInt(e(273))/5*(-parseInt(e(256))/6)+parseInt(e(289))/7+-parseInt(e(267))/8*(parseInt(e(290))/9)+-parseInt(e(264))/10+parseInt(e(246))/11*(parseInt(e(235))/12))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(J);class et extends((0,L.ObservableMixin)()){[Q(228)];[Q(277)];[Q(282)];[Q(259)];[Q(253)]=null;[Q(249)]=null;constructor(t,e,r){const i=Q;super(),this[i(228)]=t,this[i(282)]=e,this[i(277)]=t[i(261)][i(248)](c.Dialog),this[i(259)]=e[i(293)][i(268)](),this[i(253)]=r,this[i(282)][i(245)][i(237)](i(266),this[i(253)]),this[i(226)](),this[i(272)](),this[i(259)][i(224)]()}[Q(254)](){const t=Q;this[t(249)]&&(this[t(249)][t(254)](),this[t(249)]=null),this[t(259)]&&this[t(259)][t(294)](),this[t(292)](),this[t(291)]()}[Q(226)](){const t=Q,{locale:e,model:r}=this[t(228)],i=r[t(240)][t(232)][t(225)](),o=i&&(i.is(t(276),t(252))||i.is(t(276),t(221)));this[t(249)]=new B(e,this[t(282)][t(219)]),this[t(277)][t(234)]({id:t(229),icon:s.IconUploadcareImageUpload,title:d(e,this[t(253)],t(o?244:271))[t(241)],content:this[t(249)],position:c.DialogViewPosition[t(275)],isModal:!0,onShow:()=>{const e=t;this[e(249)][e(262)]()},onHide:()=>{const e=t;this[e(259)][e(239)](),this[e(228)][e(278)][e(227)][e(262)](),this[e(254)]()},keystrokeHandlerOptions:{filter:e=>!Y(e,this[t(249)][t(276)])}})}[Q(272)](){const t=Q;this[t(282)][t(293)][t(269)](t(270),()=>{const e=t,{allEntries:r}=this[e(259)][e(257)]();this[e(228)][e(247)][e(258)](t=>{const i=e,o=r[i(236)];for(const e of r){const n=e===r[o-1],{cdnUrl:a,fileInfo:s}=e;if(!a||!s)continue;const{width:c,height:l}=s[i(222)],u=q(a,c,l),d=j(a,u[i(233)]),h={id:s[i(243)],type:i(250),attributes:{imageDimension:u,...d}};this[i(283)](h,n,t)}}),this[e(277)][e(280)]()}),this[t(282)][t(293)][t(269)](t(258),r=>{const i=t;i(251)===r[i(288)][i(231)]&&!r[i(288)][i(255)][i(236)]&&this[i(277)][i(260)]&&(this[i(253)]===e[i(279)]?this[i(259)][i(263)](e[i(279)]):this[i(259)][i(224)]())})}[Q(283)](t,e,r){const i=Q,o=this[i(228)][i(247)][i(240)][i(232)],n=o[i(225)](),a=!(!n||!n.is(i(276),i(221)));r[i(230)](i(220)),this[i(223)](t,a),e||r[i(287)](o[i(284)]())}[Q(223)](t,e){const r=Q,i=this[r(228)],{imageDimension:o,imageFallbackUrl:n,imageSources:a}=t[r(242)];i[r(238)](r(281),{imageType:e?r(221):null,source:{uploadcareImageId:t.id,src:n,sources:a,...o}})}}var rt=it;function it(t,e){var r=ot();return(it=function(t,e){return r[t-=155]})(t,e)}function ot(){var t=["884550ocgvJD","10168gqTWWc","destroy","6pIxHHi","420004gZEtjv","execute","4CtTjBP","1488535mGLAtX","248010yHkzmB","get","requires","insertImage","1486059BuTtCI","refresh","editor","4509pPGodx","_controller","isEnabled","commands","plugins","_checkEnabled","553920AGWbFI","_editing"];return(ot=function(){return t})()}!function(t){for(var e=it,r=t();;)try{if(366614===-parseInt(e(161))/1+parseInt(e(167))/2+-parseInt(e(175))/3*(-parseInt(e(169))/4)+-parseInt(e(170))/5*(parseInt(e(166))/6)+-parseInt(e(171))/7+parseInt(e(164))/8*(parseInt(e(155))/9)+-parseInt(e(163))/10)break;r.push(r.shift())}catch(t){r.push(r.shift())}}(ot);class nt extends a.Command{[rt(162)];[rt(156)]=null;static get[rt(173)](){return[c.Dialog,fe]}constructor(t){var e=rt;super(t),this[e(162)]=t[e(159)][e(172)](fe)}[rt(176)](){var t=rt;this[t(157)]=this[t(160)]()}[rt(168)](t){var e=rt;this[e(156)]&&(this[e(156)][e(165)](),this[e(156)]=null),this[e(156)]=new et(this[e(177)],this[e(162)],t)}[rt(160)](){var t=rt;return this[t(177)][t(158)][t(172)](t(174))[t(157)]}}var at=r(260);function st(t){return"[object Object]"===Object.prototype.toString.call(t)}const ct=/\W|_/g;function lt(t){return t.split(ct).map((t,e)=>t.charAt(0)[e>0?"toUpperCase":"toLowerCase"]()+t.slice(1)).join("")}function ut(t,{ignoreKeys:e}={ignoreKeys:[]}){return Array.isArray(t)?t.map(t=>dt(t,{ignoreKeys:e})):t}function dt(t,{ignoreKeys:e}={ignoreKeys:[]}){if(Array.isArray(t))return ut(t,{ignoreKeys:e});if(!st(t))return t;const r={};for(const i of Object.keys(t)){let o=t[i];e.includes(i)?r[i]=o:(st(o)?o=dt(o,{ignoreKeys:e}):Array.isArray(o)&&(o=ut(o,{ignoreKeys:e})),r[lt(i)]=o)}return r}const ht={factor:2,time:100};function pt(t,e=ht){let r=0;return function t(i){const o=Math.round(e.time*e.factor**r);return i({attempt:r,retry:e=>(t=>new Promise(e=>setTimeout(e,t)))(e??o).then(()=>(r+=1,t(i)))})}(t)}class gt extends Error{}class mt extends gt{originalProgressEvent;constructor(t){super(),this.name="NetworkError",this.message="Network error",Object.setPrototypeOf(this,mt.prototype),this.originalProgressEvent=t}}const bt=(t,e)=>{t&&(t.aborted?Promise.resolve().then(e):t.addEventListener("abort",()=>e(),{once:!0}))};class ft extends gt{isCancel=!0;constructor(t="Request canceled"){super(t),this.name="CancelError",Object.setPrototypeOf(this,ft.prototype)}}const vt=({check:t,interval:e=500,timeout:r,signal:i})=>new Promise((o,n)=>{let a,s;bt(i,()=>{a&&clearTimeout(a),n(new ft("Poll cancelled"))}),r&&(s=setTimeout(()=>{a&&clearTimeout(a),n(new ft("Timed out"))},r));const c=()=>{try{Promise.resolve(t(i)).then(t=>{t?(s&&clearTimeout(s),o(t)):a=setTimeout(c,e)}).catch(t=>{s&&clearTimeout(s),n(t)})}catch(t){s&&clearTimeout(s),n(t)}};a=setTimeout(c,0)}),yt={baseCDN:"https://ucarecdn.com",baseURL:"https://upload.uploadcare.com",maxContentLength:52428800,retryThrottledRequestMaxTimes:1,retryNetworkErrorMaxTimes:3,multipartMinFileSize:26214400,multipartChunkSize:5242880,multipartMinLastPartSize:1048576,maxConcurrentRequests:4,pollingTimeoutMilliseconds:1e4,pusherKey:"79ae88bd931ea68464d9"},wt="application/octet-stream",_t="original",kt=({method:t,url:e,data:r,headers:i={},signal:o,onProgress:n})=>new Promise((a,s)=>{const c=new XMLHttpRequest,l=t?.toUpperCase()||"GET";let u=!1;c.open(l,e,!0),i&&Object.entries(i).forEach(t=>{const[e,r]=t;void 0!==r&&!Array.isArray(r)&&c.setRequestHeader(e,r)}),c.responseType="text",bt(o,()=>{u=!0,c.abort(),s(new ft)}),c.onload=()=>{if(200!=c.status)s(new Error(`Error ${c.status}: ${c.statusText}`));else{const t={method:l,url:e,data:r,headers:i||void 0,signal:o,onProgress:n},s=c.getAllResponseHeaders().trim().split(/[\r\n]+/),u={};s.forEach(function(t){const e=t.split(": "),r=e.shift(),i=e.join(": ");r&&void 0!==r&&(u[r]=i)});const d=c.response,h=c.status;a({request:t,data:d,headers:u,status:h})}},c.onerror=t=>{u||s(new mt(t))},n&&"function"==typeof n&&(c.upload.onprogress=t=>{t.lengthComputable?n({isComputable:!0,value:t.loaded/t.total}):n({isComputable:!1})}),r?c.send(r):c.send()});const xt=function(t,...e){return t};const Ct=t=>"undefined"!=typeof Blob&&t instanceof Blob,Et=t=>"undefined"!=typeof File&&t instanceof File,Tt=t=>!!t&&"object"==typeof t&&!Array.isArray(t)&&"uri"in t&&"string"==typeof t.uri,At=t=>Ct(t)||Et(t)||Tt(t);function It(t,e,r){if(Array.isArray(r))for(const i of r)It(t,`${e}[]`,i);else if((i=r)&&"object"==typeof i&&"data"in i&&At(i.data)){const{name:i,contentType:o}=r,n=xt(r.data,i,o??wt),a=(({name:t})=>t?[t]:[])({name:i,contentType:o});t.push([e,n,...a])}else if((t=>!!t&&"object"==typeof t&&!Array.isArray(t))(r))for(const[i,o]of Object.entries(r))void 0!==o&&t.push([`${e}[${i}]`,String(o)]);else(t=>"string"==typeof t||"number"==typeof t||void 0===t)(r)&&r&&t.push([e,r.toString()]);var i}function St(t){const e=new FormData,r=function(t){const e=[];for(const[r,i]of Object.entries(t))It(e,r,i);return e}(t);for(const t of r){const[r,i,...o]=t;e.append(r,i,...o)}return e}class Mt extends gt{code;request;response;headers;constructor(t,e,r,i,o){super(),this.name="UploadError",this.message=t,this.code=e,this.request=r,this.response=i,this.headers=o,Object.setPrototypeOf(this,Mt.prototype)}}const $t=(t,e,r)=>{const i=new URL(t);return i.pathname=(i.pathname+e).replace("//","/"),r&&(i.search=(t=>{const e=new URLSearchParams;for(const[r,i]of Object.entries(t))i&&"object"==typeof i&&!Array.isArray(i)?Object.entries(i).filter(t=>t[1]??!1).forEach(t=>e.set(`${r}[${t[0]}]`,String(t[1]))):Array.isArray(i)?i.forEach(t=>{e.append(`${r}[]`,t)}):"string"==typeof i&&i?e.set(r,i):"number"==typeof i&&e.set(r,i.toString());return e.toString()})(r)),i.toString()};function Lt(t){return function({libraryName:t,libraryVersion:e,userAgent:r,publicKey:i="",integration:o=""}){const n="JavaScript";return"string"==typeof r?r:"function"==typeof r?r({publicKey:i,libraryName:t,libraryVersion:e,languageName:n,integration:o}):`${[t,e,i].filter(Boolean).join("/")} (${[n,o].filter(Boolean).join("; ")})`}({libraryName:"UploadcareUploadClient",libraryVersion:"6.14.3",...t})}function Ot(t,e){const{retryThrottledRequestMaxTimes:r,retryNetworkErrorMaxTimes:i}=e;return pt(({attempt:e,retry:o})=>t().catch(t=>{if("response"in t&&"RequestThrottledError"===t?.code&&e<r)return o(function(t){const{headers:e}=t||{};if(!e||"string"!=typeof e["retry-after"])return 15e3;const r=parseInt(e["retry-after"],10);return Number.isFinite(r)?1e3*r:15e3}(t));if(t instanceof mt&&e<i)return o(1e3*(e+1));throw t}))}const Ut=t=>{let e="";return(Ct(t)||Et(t)||Tt(t))&&(e=t.type),e||wt},Rt=t=>{let e="";return Et(t)&&t.name?e=t.name:Ct(t)?e="":Tt(t)&&t.name&&(e=t.name),e||_t};function Pt(t){return void 0===t||"auto"===t?"auto":t?"1":"0"}function Nt(t,{publicKey:e,fileName:r,contentType:i,baseURL:o=yt.baseURL,secureSignature:n,secureExpire:a,store:s,signal:c,onProgress:l,source:u="local",integration:d,userAgent:h,retryThrottledRequestMaxTimes:p=yt.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:g=yt.retryNetworkErrorMaxTimes,metadata:m}){return Ot(()=>kt({method:"POST",url:$t(o,"/base/",{jsonerrors:1}),headers:{"X-UC-User-Agent":Lt({publicKey:e,integration:d,userAgent:h})},data:St({file:{data:t,name:r||Rt(t),contentType:i||Ut(t)},UPLOADCARE_PUB_KEY:e,UPLOADCARE_STORE:Pt(s),signature:n,expire:a,source:u,metadata:m}),signal:c,onProgress:l}).then(({data:t,headers:e,request:r})=>{const i=dt(JSON.parse(t));if("error"in i)throw new Mt(i.error.content,i.error.errorCode,r,i,e);return i}),{retryNetworkErrorMaxTimes:g,retryThrottledRequestMaxTimes:p})}var Dt,zt;function Vt(t,{publicKey:e,baseURL:r=yt.baseURL,store:i,fileName:o,checkForUrlDuplicates:n,saveUrlForRecurrentUploads:a,secureSignature:s,secureExpire:c,source:l="url",signal:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p=yt.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:g=yt.retryNetworkErrorMaxTimes,metadata:m}){return Ot(()=>kt({method:"POST",headers:{"X-UC-User-Agent":Lt({publicKey:e,integration:d,userAgent:h})},url:$t(r,"/from_url/",{jsonerrors:1,pub_key:e,source_url:t,store:Pt(i),filename:o,check_URL_duplicates:n?1:void 0,save_URL_duplicates:a?1:void 0,signature:s,expire:c,source:l,metadata:m}),signal:u}).then(({data:t,headers:e,request:r})=>{const i=dt(JSON.parse(t));if("error"in i)throw new Mt(i.error.content,i.error.errorCode,r,i,e);return i}),{retryNetworkErrorMaxTimes:g,retryThrottledRequestMaxTimes:p})}!function(t){t.Token="token",t.FileInfo="file_info"}(Dt||(Dt={})),function(t){t.Unknown="unknown",t.Waiting="waiting",t.Progress="progress",t.Error="error",t.Success="success"}(zt||(zt={}));function Ft(t,{publicKey:e,baseURL:r=yt.baseURL,signal:i,integration:o,userAgent:n,retryThrottledRequestMaxTimes:a=yt.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:s=yt.retryNetworkErrorMaxTimes}={}){return Ot(()=>kt({method:"GET",headers:e?{"X-UC-User-Agent":Lt({publicKey:e,integration:o,userAgent:n})}:void 0,url:$t(r,"/from_url/status/",{jsonerrors:1,token:t}),signal:i}).then(({data:t,headers:e,request:r})=>{const i=dt(JSON.parse(t));if("error"in i&&!(t=>"status"in t&&t.status===zt.Error)(i))throw new Mt(i.error.content,i.error.errorCode,r,i,e);return i}),{retryNetworkErrorMaxTimes:s,retryThrottledRequestMaxTimes:a})}function Bt(t,{publicKey:e,baseURL:r=yt.baseURL,signal:i,source:o,integration:n,userAgent:a,retryThrottledRequestMaxTimes:s=yt.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:c=yt.retryNetworkErrorMaxTimes}){return Ot(()=>kt({method:"GET",headers:{"X-UC-User-Agent":Lt({publicKey:e,integration:n,userAgent:a})},url:$t(r,"/info/",{jsonerrors:1,pub_key:e,file_id:t,source:o}),signal:i}).then(({data:t,headers:e,request:r})=>{const i=dt(JSON.parse(t));if("error"in i)throw new Mt(i.error.content,i.error.errorCode,r,i,e);return i}),{retryThrottledRequestMaxTimes:s,retryNetworkErrorMaxTimes:c})}function jt(t,{publicKey:e,contentType:r,fileName:i,multipartChunkSize:o=yt.multipartChunkSize,baseURL:n="",secureSignature:a,secureExpire:s,store:c,signal:l,source:u="local",integration:d,userAgent:h,retryThrottledRequestMaxTimes:p=yt.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:g=yt.retryNetworkErrorMaxTimes,metadata:m}){return Ot(()=>kt({method:"POST",url:$t(n,"/multipart/start/",{jsonerrors:1}),headers:{"X-UC-User-Agent":Lt({publicKey:e,integration:d,userAgent:h})},data:St({filename:i||_t,size:t,content_type:r||wt,part_size:o,UPLOADCARE_STORE:Pt(c),UPLOADCARE_PUB_KEY:e,signature:a,expire:s,source:u,metadata:m}),signal:l}).then(({data:t,headers:e,request:r})=>{const i=dt(JSON.parse(t));if("error"in i)throw new Mt(i.error.content,i.error.errorCode,r,i,e);return i.parts=Object.keys(i.parts).map(t=>i.parts[Number(t)]),i}),{retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g})}function Ht(t,e,{contentType:r,signal:i,onProgress:o,retryThrottledRequestMaxTimes:n=yt.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:a=yt.retryNetworkErrorMaxTimes}){return Ot(()=>kt({method:"PUT",url:e,data:t,onProgress:o,signal:i,headers:{"Content-Type":r||wt}}).then(t=>(o&&o({isComputable:!0,value:1}),t)).then(({status:t})=>({code:t})),{retryThrottledRequestMaxTimes:n,retryNetworkErrorMaxTimes:a})}function qt(t,{publicKey:e,baseURL:r=yt.baseURL,source:i="local",signal:o,integration:n,userAgent:a,retryThrottledRequestMaxTimes:s=yt.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:c=yt.retryNetworkErrorMaxTimes}){return Ot(()=>kt({method:"POST",url:$t(r,"/multipart/complete/",{jsonerrors:1}),headers:{"X-UC-User-Agent":Lt({publicKey:e,integration:n,userAgent:a})},data:St({uuid:t,UPLOADCARE_PUB_KEY:e,source:i}),signal:o}).then(({data:t,headers:e,request:r})=>{const i=dt(JSON.parse(t));if("error"in i)throw new Mt(i.error.content,i.error.errorCode,r,i,e);return i}),{retryThrottledRequestMaxTimes:s,retryNetworkErrorMaxTimes:c})}function Kt(t,{publicKey:e,baseURL:r,source:i,integration:o,userAgent:n,retryThrottledRequestMaxTimes:a,retryNetworkErrorMaxTimes:s,signal:c,onProgress:l}){return vt({check:c=>Bt(t,{publicKey:e,baseURL:r,signal:c,source:i,integration:o,userAgent:n,retryThrottledRequestMaxTimes:a,retryNetworkErrorMaxTimes:s}).then(t=>t.isReady?t:(l&&l({isComputable:!0,value:1}),!1)),signal:c})}class Gt{uuid;name;size;isStored;isImage;mimeType;cdnUrl;s3Url;originalFilename;imageInfo;videoInfo;contentInfo;metadata;s3Bucket;defaultEffects=null;constructor(t,{baseCDN:e=yt.baseCDN,fileName:r}={}){const{uuid:i,s3Bucket:o}=t,n=$t(e,`${i}/`),a=o?$t(`https://${o}.s3.amazonaws.com/`,`${i}/${t.filename}`):null;this.uuid=i,this.name=r||t.filename,this.size=t.size,this.isStored=t.isStored,this.isImage=t.isImage,this.mimeType=t.mimeType,this.cdnUrl=n,this.originalFilename=t.originalFilename,this.imageInfo=t.imageInfo,this.videoInfo=t.videoInfo,this.contentInfo=t.contentInfo,this.metadata=t.metadata||null,this.s3Bucket=o||null,this.s3Url=a,function(t){return"defaultEffects"in t}(t)&&(this.defaultEffects=t.defaultEffects)}}const Wt=(t,{signal:e}={})=>{let r=null,i=null;const o=t.map(()=>new AbortController);return bt(e,()=>{o.forEach(t=>t.abort())}),Promise.all(t.map((t,e)=>{const n=(t=>()=>{i=t,o.forEach((e,r)=>r!==t&&e.abort())})(e);return Promise.resolve().then(()=>t({stopRace:n,signal:o[e].signal})).then(t=>(n(),t)).catch(t=>(r=t,null))})).then(t=>{if(null===i)throw r;return t[i]})};var Zt=window.WebSocket;class Xt{events=Object.create({});emit(t,e){this.events[t]?.forEach(t=>t(e))}on(t,e){this.events[t]=this.events[t]||[],this.events[t].push(e)}off(t,e){this.events[t]=e?this.events[t].filter(t=>t!==e):[]}}class Yt{key;disconnectTime;ws=void 0;queue=[];isConnected=!1;subscribers=0;emmitter=new Xt;disconnectTimeoutId=null;constructor(t,e=3e4){this.key=t,this.disconnectTime=e}connect(){if(this.disconnectTimeoutId&&clearTimeout(this.disconnectTimeoutId),!this.isConnected&&!this.ws){const t=`wss://ws.pusherapp.com/app/${this.key}?protocol=5&client=js&version=1.12.2`;this.ws=new Zt(t),this.ws.addEventListener("error",t=>{this.emmitter.emit("error",new Error(t.message))}),this.emmitter.on("connected",()=>{this.isConnected=!0,this.queue.forEach(t=>this.send(t.event,t.data)),this.queue=[]}),this.ws.addEventListener("message",t=>{const e=JSON.parse(t.data.toString());switch(e.event){case"pusher:connection_established":this.emmitter.emit("connected",void 0);break;case"pusher:ping":this.send("pusher:pong",{});break;case"progress":case"success":case"fail":this.emmitter.emit(e.channel,((t,e)=>"success"===t?{status:zt.Success,...e}:"progress"===t?{status:zt.Progress,...e}:{status:zt.Error,...e})(e.event,JSON.parse(e.data)))}})}}disconnect(){const t=()=>{this.ws?.close(),this.ws=void 0,this.isConnected=!1};this.disconnectTime?this.disconnectTimeoutId=setTimeout(()=>{t()},this.disconnectTime):t()}send(t,e){const r=JSON.stringify({event:t,data:e});this.ws?.send(r)}subscribe(t,e){this.subscribers+=1,this.connect();const r=`task-status-${t}`,i={event:"pusher:subscribe",data:{channel:r}};this.emmitter.on(r,e),this.isConnected?this.send(i.event,i.data):this.queue.push(i)}unsubscribe(t){this.subscribers-=1;const e=`task-status-${t}`,r={event:"pusher:unsubscribe",data:{channel:e}};this.emmitter.off(e),this.isConnected?this.send(r.event,r.data):this.queue=this.queue.filter(t=>t.data.channel!==e),0===this.subscribers&&this.disconnect()}onError(t){return this.emmitter.on("error",t),()=>this.emmitter.off("error",t)}}let Jt=null;const Qt=t=>{if(!Jt){const e="undefined"==typeof window?0:3e4;Jt=new Yt(t,e)}return Jt};const te=(t,{publicKey:e,fileName:r,baseURL:i,baseCDN:o,checkForUrlDuplicates:n,saveUrlForRecurrentUploads:a,secureSignature:s,secureExpire:c,store:l,signal:u,onProgress:d,source:h,integration:p,userAgent:g,retryThrottledRequestMaxTimes:m,pusherKey:b=yt.pusherKey,metadata:f})=>{return Promise.resolve((v=b,void Qt(v).connect())).then(()=>Vt(t,{publicKey:e,fileName:r,baseURL:i,checkForUrlDuplicates:n,saveUrlForRecurrentUploads:a,secureSignature:s,secureExpire:c,store:l,signal:u,source:h,integration:p,userAgent:g,retryThrottledRequestMaxTimes:m,metadata:f})).catch(t=>{const e=Qt(b);return e?.disconnect(),Promise.reject(t)}).then(t=>t.type===Dt.FileInfo?t:Wt([({signal:r})=>function({token:t,publicKey:e,baseURL:r,integration:i,userAgent:o,retryThrottledRequestMaxTimes:n,retryNetworkErrorMaxTimes:a,onProgress:s,signal:c}){return vt({check:c=>Ft(t,{publicKey:e,baseURL:r,integration:i,userAgent:o,retryThrottledRequestMaxTimes:n,retryNetworkErrorMaxTimes:a,signal:c}).then(e=>{switch(e.status){case zt.Error:return new Mt(e.error,e.errorCode);case zt.Waiting:return!1;case zt.Unknown:return new Mt(`Token "${t}" was not found.`);case zt.Progress:return s&&("unknown"===e.total?s({isComputable:!1}):s({isComputable:!0,value:e.done/e.total})),!1;case zt.Success:return s&&s({isComputable:!0,value:e.done/e.total}),e;default:throw new Error("Unknown status")}}),signal:c})}({token:t.token,publicKey:e,baseURL:i,integration:p,userAgent:g,retryThrottledRequestMaxTimes:m,onProgress:d,signal:r}),({signal:e})=>(({token:t,pusherKey:e,signal:r,onProgress:i})=>new Promise((o,n)=>{const a=Qt(e),s=a.onError(n),c=()=>{s(),a.unsubscribe(t)};bt(r,()=>{c(),n(new ft("pusher cancelled"))}),a.subscribe(t,t=>{switch(t.status){case zt.Progress:i&&("unknown"===t.total?i({isComputable:!1}):i({isComputable:!0,value:t.done/t.total}));break;case zt.Success:c(),i&&i({isComputable:!0,value:t.done/t.total}),o(t);break;case zt.Error:c(),n(new Mt(t.msg,t.error_code))}})}))({token:t.token,pusherKey:b,signal:e,onProgress:d})],{signal:u})).then(t=>{if(t instanceof Mt)throw t;return t}).then(t=>Kt(t.uuid,{publicKey:e,baseURL:i,integration:p,userAgent:g,retryThrottledRequestMaxTimes:m,onProgress:d,signal:u})).then(t=>new Gt(t,{baseCDN:o}));var v},ee=new WeakMap,re=async t=>{if(Et(t)||Ct(t))return t.size;if(Tt(t)){return(await(async t=>{if(ee.has(t))return ee.get(t);const e=await fetch(t.uri).then(t=>t.blob());return ee.set(t,e),e})(t)).size}throw new Error("Unknown file type. Cannot determine file size.")},ie=t=>{const e=new RegExp("[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}");return!At(t)&&e.test(t)},oe=t=>{const e=new RegExp("^(?:\\w+:)?\\/\\/([^\\s\\.]+\\.\\S{2}|localhost[\\:?\\d]*)\\S*$");return!At(t)&&e.test(t)},ne=async(t,e,r)=>i=>((t,e,r,i)=>{const o=i*e,n=Math.min(o+i,r);return t.slice(o,n)})(t,i,e,r),ae=async(t,{publicKey:e,fileName:r,fileSize:i,baseURL:o,secureSignature:n,secureExpire:a,store:s,signal:c,onProgress:l,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,contentType:m,multipartChunkSize:b=yt.multipartChunkSize,maxConcurrentRequests:f=yt.maxConcurrentRequests,baseCDN:v,metadata:y})=>{const w=i??await re(t);let _;const k=(t,e)=>{if(!l)return;_||(_=Array(t).fill(0));return r=>{var i;r.isComputable&&(_[e]=r.value,l({isComputable:!0,value:(i=_,i.reduce((t,e)=>t+e,0)/t)}))}};return m||=Ut(t),jt(w,{publicKey:e,contentType:m,fileName:r||Rt(t),baseURL:o,secureSignature:n,secureExpire:a,store:s,signal:c,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,metadata:y,multipartChunkSize:b}).then(async({uuid:r,parts:i})=>{const o=await ne(t,w,b);return Promise.all([r,(n=f,a=i.map((t,r)=>()=>((t,e,{publicKey:r,contentType:i,onProgress:o,signal:n,integration:a,retryThrottledRequestMaxTimes:s,retryNetworkErrorMaxTimes:c})=>Ht(t,e,{publicKey:r,contentType:i,onProgress:o,signal:n,integration:a,retryThrottledRequestMaxTimes:s,retryNetworkErrorMaxTimes:c}))(o(r),t,{publicKey:e,contentType:m,onProgress:k(i.length,r),signal:c,integration:d,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g})),new Promise((t,e)=>{const r=[];let i=!1,o=a.length;const s=[...a],c=()=>{const n=a.length-s.length,l=s.shift();l&&l().then(e=>{i||(r[n]=e,o-=1,o?c():t(r))}).catch(t=>{i=!0,e(t)})};for(let t=0;t<n;t++)c()}))]);var n,a}).then(([t])=>qt(t,{publicKey:e,baseURL:o,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g})).then(t=>t.isReady?t:Kt(t.uuid,{publicKey:e,baseURL:o,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,onProgress:l,signal:c})).then(t=>new Gt(t,{baseCDN:v}))};async function se(t,{publicKey:e,fileName:r,baseURL:i=yt.baseURL,secureSignature:o,secureExpire:n,store:a,signal:s,onProgress:c,source:l,integration:u,userAgent:d,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,contentType:g,multipartMinFileSize:m,multipartChunkSize:b,maxConcurrentRequests:f,baseCDN:v=yt.baseCDN,checkForUrlDuplicates:y,saveUrlForRecurrentUploads:w,pusherKey:_,metadata:k}){if(At(t)){const y=await re(t);return((t,e=yt.multipartMinFileSize)=>t>=e)(y,m)?ae(t,{publicKey:e,contentType:g,multipartChunkSize:b,fileSize:y,fileName:r,baseURL:i,secureSignature:o,secureExpire:n,store:a,signal:s,onProgress:c,source:l,integration:u,userAgent:d,maxConcurrentRequests:f,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,baseCDN:v,metadata:k}):((t,{publicKey:e,fileName:r,baseURL:i,secureSignature:o,secureExpire:n,store:a,contentType:s,signal:c,onProgress:l,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,baseCDN:m,metadata:b})=>Nt(t,{publicKey:e,fileName:r,contentType:s,baseURL:i,secureSignature:o,secureExpire:n,store:a,signal:c,onProgress:l,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,metadata:b}).then(({file:t})=>Kt(t,{publicKey:e,baseURL:i,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,onProgress:l,signal:c})).then(t=>new Gt(t,{baseCDN:m})))(t,{publicKey:e,fileName:r,contentType:g,baseURL:i,secureSignature:o,secureExpire:n,store:a,signal:s,onProgress:c,source:l,integration:u,userAgent:d,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,baseCDN:v,metadata:k})}if(oe(t))return te(t,{publicKey:e,fileName:r,baseURL:i,baseCDN:v,checkForUrlDuplicates:y,saveUrlForRecurrentUploads:w,secureSignature:o,secureExpire:n,store:a,signal:s,onProgress:c,source:l,integration:u,userAgent:d,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,pusherKey:_,metadata:k});if(ie(t))return((t,{publicKey:e,fileName:r,baseURL:i,signal:o,onProgress:n,source:a,integration:s,userAgent:c,retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:u,baseCDN:d})=>Bt(t,{publicKey:e,baseURL:i,signal:o,source:a,integration:s,userAgent:c,retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:u}).then(t=>new Gt(t,{baseCDN:d,fileName:r})).then(t=>(n&&n({isComputable:!0,value:1}),t)))(t,{publicKey:e,fileName:r,baseURL:i,signal:s,onProgress:c,source:l,integration:u,userAgent:d,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,baseCDN:v});throw new TypeError(`File uploading from "${t}" is not supported`)}var ce=le;function le(t,e){var r=de();return(le=function(t,e){return r[t-=114]})(t,e)}!function(t){for(var e=le,r=t();;)try{if(937328===parseInt(e(121))/1+parseInt(e(114))/2*(-parseInt(e(123))/3)+parseInt(e(125))/4*(parseInt(e(118))/5)+parseInt(e(115))/6+parseInt(e(117))/7+parseInt(e(116))/8*(-parseInt(e(124))/9)+-parseInt(e(119))/10)break;r.push(r.shift())}catch(t){r.push(r.shift())}}(de);class ue{static[ce(120)]({file:t,...e}){return se(t,e)}static[ce(122)](t,e){return Bt(t,e)}}function de(){var t=["662918dkMoTT","9511638UGjjuf","8MraDta","10310440ELqAEa","955mzXIlD","15217210putujC","upload","1038905ZVetFC","getInfo","9uzlNay","7317801hMpMzC","3548Gpeduz"];return(de=function(){return t})()}class he extends a.Plugin{static get requires(){return["ImageUploadEditing","ImageUploadProgress",at.FileRepository,fe]}static get pluginName(){return"UploadcareUploadAdapter"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}async afterInit(){const t=this.editor;t.config.get("uploadcare")&&(t.plugins.get(at.FileRepository).createUploadAdapter=e=>new pe(e,t),t.plugins.get("ImageUploadEditing").on("uploadComplete",(e,{imageElement:r,data:i})=>{t.model.change(t=>{t.setAttribute("uploadcareImageId",i.uploadcareImageId,r)})}))}}class pe{loader;editor;controller;constructor(t,e){this.loader=t,this.editor=e,this.controller=new AbortController}async upload(){const t=this.editor.t,e=await this.loader.file;return ue.upload({file:e,publicKey:this.editor.config.get("uploadcare.pubkey"),baseURL:this.editor.config.get("uploadcare.uploader.baseUrl"),baseCDN:this.editor.config.get("uploadcare.uploader.cdnCname"),signal:this.controller.signal,onProgress:t=>{t&&t.isComputable&&(this.loader.uploadTotal=1,this.loader.uploaded=t.value)}}).then(async t=>{const{imageFallbackUrl:e,imageSources:r}=j(t.cdnUrl,t.imageInfo.width);return{uploadcareImageId:t.uuid,default:e,sources:r}}).catch(()=>{const r=t("Cannot upload file:")+" "+e.name+".";return Promise.reject(r)})}abort(){this.controller.abort()}}const ge=me;function me(t,e){const r=be();return(me=function(t,e){return r[t-=299]})(t,e)}function be(){const t=["querySelector","_initSchema","selection","locale","closeMax","63LkmQpk","2888187DypGJN","editing","map","input[uploadcare-file-input]","_ctxElement","attributeToAttribute","27109eMjWMz","2839011JUTbAt","uc-upload-ctx-provider","config","document","replaceImageSource","downcast","view","get","getSelectedElement","extend","cleanupImage","insertImage","execute","contentLanguage","uploadcareImageId","schema","uploadcare.uploader","once","272020noYLXz","ucContextId","\n\t\t\t\t.uc-dropdown-menu__popup { padding: 0; }\n\t\t\t\t.uc-dropdown-menu__popup-menu { gap: 0; }\n\t\t\t\t.uc-dropdown-menu__popup-footer { padding-top: 0; }\n\t\t\t\t.uc-dropdown-menu__separator { margin: 0; }\n\t\t\t","data-uc-image-id","true","appendChild","pluginName","isRegistered","_initCtx","render","2778032VNGWoA","listenTo","imageInline","upcast","uploader-","iconHrefResolver","afterInit","href","add","join","init","for","22hKokSG","UploadcareEditing","uc-config","uploadcareImageReplace","configElement","_initImageProcessingIndicator","isPremiumPlugin","uploadcare.pubkey","getAttribute","destroy","_initConfig","conversion","editor","isOfficialPlugin","remove","ctxElement","PictureEditing","requires","#uc-icon-arrow-down","3499344PwovGV","elementToAttribute","608312iuGhrm","commands","removeAttribute","uploadcare","_initConversion","imageBlock","model","5pStrXq","_configElement","fromCharCode","body"];return(be=function(){return t})()}!function(t){const e=me,r=t();for(;;)try{if(482117===-parseInt(e(382))/1*(parseInt(e(338))/2)+parseInt(e(376))/3+parseInt(e(359))/4*(parseInt(e(366))/5)+-parseInt(e(357))/6+parseInt(e(383))/7+-parseInt(e(326))/8+parseInt(e(375))/9*(parseInt(e(316))/10))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(be);class fe extends a.Plugin{[ge(367)]=null;[ge(380)]=null;static get[ge(322)](){return ge(339)}static get[ge(355)](){return[ge(354),he,c.Dialog]}static get[ge(351)](){return!0}static get[ge(344)](){return!0}[ge(317)];get[ge(342)](){return this[ge(367)]}get[ge(353)](){return this[ge(380)]}constructor(t){const e=ge;super(t),this[e(317)]=(0,L.uid)()}[ge(336)](){const t=ge,e=this[t(350)];e[t(360)][t(334)](t(362),new nt(e))}[ge(332)](){const t=ge;this[t(371)](),this[t(363)](),this[t(348)](),this[t(324)](),this[t(343)](),this[t(327)](this[t(350)],t(347),()=>{const e=t;this[e(367)]&&(this[e(367)][e(352)](),this[e(367)]=null),this[e(380)]&&(this[e(380)][e(352)](),this[e(380)]=null);const r=L.global[e(301)][e(370)](e(379));r&&r[e(352)]()}),async function(t){const e=g([104,103,80,54,56,112,113,99,55,79,66,74,120,57,117,51,122,114,72,97,116,89,85,88,102,48,52,84,100,86,107,77,70,109,119,67,115,53,83,68,65,118,106,50,49,105,87,81,71,101,90,75,76,121,82,108,69,78,110,111,73,98]),r=window[g([68,97,116,101])][g([110,111,119])](),i=t[g([101,100,105,116,111,114])],o=new(window[g([80,114,111,109,105,115,101])])(t=>{i[g([111,110,99,101])](g([114,101,97,100,121]),t)}),n={[g([107,116,121])]:g([69,67]),[g([117,115,101])]:g([115,105,103]),[g([99,114,118])]:g([80,45,50,53,54]),[g([120])]:g([105,67,106,79,67,118,68,70,73,54,108,81,72,72,84,49,56,106,86,119,82,102,107,102,72,81,50,97,95,77,121,109,84,51,53,76,81,86,111,70,83,65,73]),[g([121])]:g([107,88,73,121,74,52,101,118,116,67,69,70,82,109,120,75,83,85,112,75,57,102,68,87,52,53,57,118,88,79,118,86,114,104,102,54,117,81,65,101,79,105,111]),[g([97,108,103])]:g([69,83,50,53,54])},a=i[g([99,111,110,102,105,103])][g([103,101,116])](g([108,105,99,101,110,115,101,75,101,121]));function s(t){const e=[new(window[g([80,114,111,109,105,115,101])])(t=>setTimeout(t,605900)),o[g([116,104,101,110])](()=>new(window[g([80,114,111,109,105,115,101])])(t=>{let e=0;i[g([109,111,100,101,108])][g([111,110])](g([97,112,112,108,121,79,112,101,114,97,116,105,111,110]),(r,i)=>{i[0][g([105,115,68,111,99,117,109,101,110,116,79,112,101,114,97,116,105,111,110])]&&e++,504==e&&(t(),r[g([111,102,102])]())})}))];return window[g([80,114,111,109,105,115,101])][g([114,97,99,101])](e)[g([116,104,101,110])](()=>t)}function c(t){return t[g([115,116,97,114,116,115,87,105,116,104])](g([101,121]))?JSON[g([112,97,114,115,101])](l(t)):null}function l(t){return window[g([97,116,111,98])](t[g([114,101,112,108,97,99,101])](/-/g,g([43]))[g([114,101,112,108,97,99,101])](/_/g,g([47])))}function u(t){let e=5381;function r(t){for(let r=0;r<t[g([108,101,110,103,116,104])];r++){const i=t[g([99,104,97,114,67,111,100,101,65,116])](r);e=(e<<5)+e+i,e&=e}}return function t(e){Array[g([105,115,65,114,114,97,121])](e)?e[g([102,111,114,69,97,99,104])](t):e&&typeof e==g([111,98,106,101,99,116])?Object[g([101,110,116,114,105,101,115])](e)[g([115,111,114,116])]()[g([102,111,114,69,97,99,104])](([e,i])=>{r(e),t(i)}):r(window[g([83,116,114,105,110,103])](e))}(t),e>>>0}function d(t){return t[g([116,111,83,116,114,105,110,103])](16)[g([112,97,100,83,116,97,114,116])](8,g([48]))}function h(t){return t[g([115,112,108,105,116])]("")[g([114,101,118,101,114,115,101])]()[g([106,111,105,110])]("")}function p(){}function g(t){const e=me;return t[e(378)](t=>String[e(368)](t))[e(335)]("")}!function(t){const r=function(){const t=window[g([83,116,114,105,110,103])](window[g([112,101,114,102,111,114,109,97,110,99,101])][g([110,111,119])]())[g([114,101,112,108,97,99,101])](g([46]),"");let r=g([104]);for(let i=0;i<t[g([108,101,110,103,116,104])];i+=2){let o=window[g([112,97,114,115,101,73,110,116])](t[g([115,117,98,115,116,114,105,110,103])](i,i+2));o>=e[g([108,101,110,103,116,104])]&&(o-=e[g([108,101,110,103,116,104])]),r+=e[o]}return r}();i[r]=g([117,112,108,111,97,100,99,97,114,101,76,105,99,101,110,115,101,75,101,121])+t,t!=g([86,97,108,105,100])&&async function(){await o,i[g([109,111,100,101,108])][g([99,104,97,110,103,101])]=p,i[g([109,111,100,101,108])][g([101,110,113,117,101,117,101,67,104,97,110,103,101])]=p,i[g([101,110,97,98,108,101,82,101,97,100,79,110,108,121,77,111,100,101])](g([109,111,100,101,108]))}()}(await async function(){let t,e=null,p=null;try{return a==g([71,80,76])?g([78,111,116,65,108,108,111,119,101,100]):(t=function(){const t=a[g([115,112,108,105,116])](g([46]));return 3!=t[g([108,101,110,103,116,104])]?null:e(t[1]);function e(t){const e=c(t);return e&&r()?e:null;function r(){const t=e[g([106,116,105])],r=window[g([112,97,114,115,101,73,110,116])](t[g([115,117,98,115,116,114,105,110,103])](t[g([108,101,110,103,116,104])]-8),16),i={...e,[g([106,116,105])]:t[g([115,117,98,115,116,114,105,110,103])](0,t[g([108,101,110,103,116,104])]-8)};return delete i[g([118,99])],u(i)==r}}}(),t?(t[g([117,115,97,103,101,69,110,100,112,111,105,110,116])]&&(p=function(t,e){return new(window[g([80,114,111,109,105,115,101])])(s=>{if(n())return s(g([86,97,108,105,100]));a(),i[g([100,101,99,111,114,97,116,101])](g([95,115,101,110,100,85,115,97,103,101,82,101,113,117,101,115,116]));let c=!1;const l=(0,L.uid)();function p(t){return!!t&&(typeof t===g([111,98,106,101,99,116])||typeof t===g([102,117,110,99,116,105,111,110]))&&typeof t[g([116,104,101,110])]===g([102,117,110,99,116,105,111,110])&&typeof t[g([99,97,116,99,104])]===g([102,117,110,99,116,105,111,110])}function m(i){c(i)[g([116,104,101,110])](t=>t&&t[g([115,116,97,116,117,115])]==g([111,107])?d(u(l+e))!=t[g([118,101,114,105,102,105,99,97,116,105,111,110])]?g([85,115,97,103,101,76,105,109,105,116]):g([86,97,108,105,100]):g([85,115,97,103,101,76,105,109,105,116]))[g([116,104,101,110])](t=>(n(),t),()=>{const t=a();return null==t?(n(),g([86,97,108,105,100])):g(r-t>6048e5?[85,115,97,103,101,76,105,109,105,116]:[86,97,108,105,100])})[g([116,104,101,110])](s)[g([99,97,116,99,104])](()=>{s(g([85,115,97,103,101,76,105,109,105,116]))});const o=36e5;function n(){const e=g([108,108,99,116,45])+d(u(t)),i=h(d(window[g([77,97,116,104])][g([99,101,105,108])](r/o)));window[g([108,111,99,97,108,83,116,111,114,97,103,101])][g([115,101,116,73,116,101,109])](e,i)}function a(){const e=g([108,108,99,116,45])+d(u(t)),r=window[g([108,111,99,97,108,83,116,111,114,97,103,101])][g([103,101,116,73,116,101,109])](e);return r?window[g([112,97,114,115,101,73,110,116])](h(r),16)*o:null}function c(t){return new(window[g([80,114,111,109,105,115,101])])((e,r)=>{t[g([116,104,101,110])](e,r),window[g([115,101,116,84,105,109,101,111,117,116])](r,12e4)})}}i[g([111,110])](g([95,115,101,110,100,85,115,97,103,101,82,101,113,117,101,115,116]),(e,r)=>{if(r[0]!=t)return s(g([85,115,97,103,101,76,105,109,105,116]));r[1]={...r[1],[g([114,101,113,117,101,115,116,73,100])]:l}},{[g([112,114,105,111,114,105,116,121])]:g([104,105,103,104])}),i[g([111,110])](g([95,115,101,110,100,85,115,97,103,101,82,101,113,117,101,115,116]),t=>{p(t[g([114,101,116,117,114,110])])&&(c=!0,m(t[g([114,101,116,117,114,110])]))},{[g([112,114,105,111,114,105,116,121])]:g([108,111,119])}),o[g([116,104,101,110])](()=>{c||s(g([85,115,97,103,101,76,105,109,105,116]))})});function n(){return i[g([101,100,105,116,105,110,103])][g([118,105,101,119])][g([95,111,118,101,114,108,97,121,77,111,100,101,72,105,110,116])]==g([97,117,116,111])}function a(){i[g([101,100,105,116,105,110,103])][g([118,105,101,119])][g([95,111,118,101,114,108,97,121,77,111,100,101,72,105,110,116])]=g([97,117,116,111])}}(t[g([117,115,97,103,101,69,110,100,112,111,105,110,116])],t[g([106,116,105])])),await async function(){let t=!0;try{const i=a[g([115,112,108,105,116])](g([46])),[o,n,s]=i;return e(o),await r(o,n,s),t}catch{return!1}function e(e){const r=c(e);r&&r[g([97,108,103])]==g([69,83,50,53,54])||(t=!1)}async function r(e,r,i){const o=window[g([85,105,110,116,56,65,114,114,97,121])][g([102,114,111,109])](l(i),t=>t[g([99,104,97,114,67,111,100,101,65,116])](0)),a=(new(window[g([84,101,120,116,69,110,99,111,100,101,114])]))[g([101,110,99,111,100,101])](e+g([46])+r),s=window[g([99,114,121,112,116,111])][g([115,117,98,116,108,101])];if(!s)return;const c=await s[g([105,109,112,111,114,116,75,101,121])](g([106,119,107]),n,{[g([110,97,109,101])]:g([69,67,68,83,65]),[g([110,97,109,101,100,67,117,114,118,101])]:g([80,45,50,53,54])},!1,[g([118,101,114,105,102,121])]);await s[g([118,101,114,105,102,121])]({[g([110,97,109,101])]:g([69,67,68,83,65]),[g([104,97,115,104])]:{[g([110,97,109,101])]:g([83,72,65,45,50,53,54])}},c,o,a)||(t=!1)}}()?function(){const e=t[g([102,101,97,116,117,114,101,115])];return!(!e||!e[g([105,110,99,108,117,100,101,115])](g([42]))&&!e[g([105,110,99,108,117,100,101,115])](g([85,80,76,67])))}()?function(){const e=[g([101,118,97,108,117,97,116,105,111,110]),g([116,114,105,97,108])][g([105,110,99,108,117,100,101,115])](t[g([108,105,99,101,110,115,101,84,121,112,101])])?r/1e3:1766016e3;return t[g([101,120,112])]<e}()?g([69,120,112,105,114,101,100]):function(){const e=me,r=t[g([108,105,99,101,110,115,101,100,72,111,115,116,115])];if(!r||0==r[g([108,101,110,103,116,104])])return!0;const{hostname:i}=new URL(window[g([108,111,99,97,116,105,111,110])][e(333)]);if(r[g([105,110,99,108,117,100,101,115])](i))return!0;const o=i[g([115,112,108,105,116])](g([46]));return r[g([102,105,108,116,101,114])](t=>t[g([105,110,99,108,117,100,101,115])](g([42])))[g([109,97,112])](t=>t[g([115,112,108,105,116])](g([46])))[g([102,105,108,116,101,114])](t=>t[g([108,101,110,103,116,104])]<=o[g([108,101,110,103,116,104])])[g([109,97,112])](t=>Array(o[g([108,101,110,103,116,104])]-t[g([108,101,110,103,116,104])])[g([102,105,108,108])](t[0]===g([42])?g([42]):"")[g([99,111,110,99,97,116])](t))[g([115,111,109,101])](t=>o[g([101,118,101,114,121])]((e,r)=>t[r]===e||t[r]===g([42])))}()?(t[g([108,105,99,101,110,115,101,84,121,112,101])]==g([101,118,97,108,117,97,116,105,111,110])&&(e=s(g([69,118,97,108,117,97,116,105,111,110,76,105,109,105,116]))),t[g([108,105,99,101,110,115,101,84,121,112,101])]==g([116,114,105,97,108])&&(e=s(g([84,114,105,97,108,76,105,109,105,116]))),await(e&&p?new(window[g([80,114,111,109,105,115,101])])((t,r)=>{e[g([116,104,101,110])](t,r),p[g([116,104,101,110])](e=>{e!=g([86,97,108,105,100])&&t(e)},r)}):e||p||g([86,97,108,105,100]))):g([68,111,109,97,105,110,76,105,109,105,116]):g([78,111,116,65,108,108,111,119,101,100]):g([73,110,118,97,108,105,100])):g([73,110,118,97,108,105,100]))}catch{return g([73,110,118,97,108,105,100])}}())}(this)}[ge(371)](){const t=ge,e=this[t(350)][t(365)][t(313)];e[t(323)](t(364))&&e[t(307)](t(364),{allowAttributes:[t(312)]}),e[t(323)](t(328))&&e[t(307)](t(328),{allowAttributes:[t(312)]})}[ge(363)](){const t=ge,e=this[t(350)];e[t(349)][t(337)](t(303))[t(381)]({model:t(312),view:t(319)}),e[t(349)][t(337)](t(329))[t(358)]({model:{key:t(312),value:e=>e[t(346)](t(319))},view:{attributes:{"data-uc-image-id":/[a-zA-Z0-9\\-]+/}}});const r=e[t(360)][t(305)](t(302));r&&this[t(327)](r,t(308),(e,[r,i])=>{const o=t;r[o(361)](o(312),i)})}[ge(348)](){const t=ge,e=this[t(350)][t(300)][t(305)](t(314))||{},r=this[t(350)][t(300)][t(305)](t(345))||"";this[t(367)]=(0,L.createElement)(L.global[t(301)],t(340),{...e,pubkey:r,"ctx-name":t(330)+this[t(317)],sourceList:"",imgOnly:t(320),removeCopyright:t(320),localeName:this[t(350)][t(373)][t(311)],externalSourcesEmbedCss:t(318)}),this[t(367)][t(331)]=e=>{const r=t;if(r(374)==e)return r(356)},L.global[t(301)][t(369)][t(321)](this[t(367)])}[ge(324)](){const t=ge;this[t(380)]=(0,L.createElement)(L.global[t(301)],t(299),{"ctx-name":t(330)+this[t(317)]}),L.global[t(301)][t(369)][t(321)](this[t(380)])}[ge(343)](){const t=ge,e=this[t(350)][t(360)][t(305)](t(309));e&&this[t(327)](e,t(310),()=>{const e=t,r=this[e(350)][e(365)][e(301)][e(372)][e(306)]();r&&r[e(346)](e(312))&&this[e(350)][e(377)][e(304)][e(315)](e(325),()=>{K(this[e(350)],r)})});const r=this[t(350)][t(360)][t(305)](t(341));r&&this[t(327)](r,t(310),()=>{const e=t,r=this[e(350)][e(365)][e(301)][e(372)][e(306)]();r&&r[e(346)](e(312))&&this[e(350)][e(377)][e(304)][e(315)](e(325),()=>{K(this[e(350)],r)})})}}var ve=Object.defineProperty,ye=(t,e,r)=>(((t,e,r)=>{e in t?ve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r})(t,"symbol"!=typeof e?e+"":e,r),r);var we=class{constructor(t){t.constructor===Object?this.store=function(t){let e=t=>{var r;for(let i in t)(null==(r=t[i])?void 0:r.constructor)===Object&&(t[i]=e(t[i]));return{...t}};return e(t)}(t):(this._storeIsProxy=!0,this.store=t),this.callbackMap=Object.create(null)}static warn(t,e){console.warn(`Symbiote Data: cannot ${t}. Prop name: `+e)}read(t){return this._storeIsProxy||this.store.hasOwnProperty(t)?this.store[t]:(we.warn("read",t),null)}has(t){return this._storeIsProxy?void 0!==this.store[t]:this.store.hasOwnProperty(t)}add(t,e,r=!1){!r&&Object.keys(this.store).includes(t)||(this.store[t]=e,this.notify(t))}pub(t,e){this._storeIsProxy||this.store.hasOwnProperty(t)?(this.store[t]=e,this.notify(t)):we.warn("publish",t)}multiPub(t){for(let e in t)this.pub(e,t[e])}notify(t){this.callbackMap[t]&&this.callbackMap[t].forEach(e=>{e(this.store[t])})}sub(t,e,r=!0){return this._storeIsProxy||this.store.hasOwnProperty(t)?(this.callbackMap[t]||(this.callbackMap[t]=new Set),this.callbackMap[t].add(e),r&&e(this.store[t]),{remove:()=>{this.callbackMap[t].delete(e),this.callbackMap[t].size||delete this.callbackMap[t]},callback:e}):(we.warn("subscribe",t),null)}static registerCtx(t,e=Symbol()){let r=we.globalStore.get(e);return r?console.warn('State: context UID "'+e+'" already in use'):(r=new we(t),we.globalStore.set(e,r)),r}static deleteCtx(t){we.globalStore.delete(t)}static getCtx(t,e=!0){return we.globalStore.get(t)||(e&&console.warn('State: wrong context UID - "'+t+'"'),null)}};we.globalStore=new Map;var _e=Object.freeze({BIND_ATTR:"set",ATTR_BIND_PRFX:"@",EXT_DATA_CTX_PRFX:"*",NAMED_DATA_CTX_SPLTR:"/",CTX_NAME_ATTR:"ctx-name",CTX_OWNER_ATTR:"ctx-owner",CSS_CTX_PROP:"--ctx-name",EL_REF_ATTR:"ref",AUTO_TAG_PRFX:"sym",REPEAT_ATTR:"repeat",REPEAT_ITEM_TAG_ATTR:"repeat-item-tag",SET_LATER_KEY:"__toSetLater__",USE_TPL:"use-template",ROOT_STYLE_ATTR_NAME:"sym-component"}),ke="1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm",xe=class{static generate(t="XXXXXXXXX-XXX"){let e="";for(let r=0;r<t.length;r++)e+="-"===t[r]?t[r]:ke.charAt(61*Math.random());return e}};function Ce(t,e,r){let i,o=!0,n=e.split(".");return n.forEach((e,r)=>{r<n.length-1?t=t[e]:i=e}),t?t[i]=r:o=!1,o}var Ee="__default__";var Te="{{",Ae="}}";var Ie=[function(t,e){[...t.querySelectorAll(`[${_e.REPEAT_ATTR}]`)].forEach(t=>{let r,i=t.getAttribute(_e.REPEAT_ITEM_TAG_ATTR);if(i&&(r=window.customElements.get(i)),!r){r=class extends e.BaseComponent{constructor(){super(),i||(this.style.display="contents")}};let o=t.innerHTML;r.template=o,r.reg(i)}for(;t.firstChild;)t.firstChild.remove();let o=t.getAttribute(_e.REPEAT_ATTR);e.sub(o,e=>{if(!e){for(;t.firstChild;)t.firstChild.remove();return}let i,o=[...t.children],n=e=>{e.forEach((t,e)=>{if(o[e])if(o[e].set$)setTimeout(()=>{o[e].set$(t)});else for(let r in t)o[e][r]=t[r];else{i||(i=new DocumentFragment);let e=new r;Object.assign(e.init$,t),i.appendChild(e)}}),i&&t.appendChild(i);let n=o.slice(e.length,o.length);for(let t of n)t.remove()};if(e.constructor===Array)n(e);else if(e.constructor===Object){let t=[];for(let r in e){let i=e[r];Object.defineProperty(i,"_KEY_",{value:r,enumerable:!0}),t.push(i)}n(t)}else console.warn("Symbiote repeat data type error:"),console.log(e)}),t.removeAttribute(_e.REPEAT_ATTR),t.removeAttribute(_e.REPEAT_ITEM_TAG_ATTR)})},function(t,e){if(e.shadowRoot)return;let r=[...t.querySelectorAll("slot")];if(!r.length)return;let i={};r.forEach(t=>{let e=t.getAttribute("name")||Ee;i[e]={slot:t,fr:document.createDocumentFragment()}}),e.initChildren.forEach(t=>{var e;let r=Ee;t instanceof Element&&t.hasAttribute("slot")&&(r=t.getAttribute("slot"),t.removeAttribute("slot")),null==(e=i[r])||e.fr.appendChild(t)}),Object.values(i).forEach(t=>{if(t.fr.childNodes.length)t.slot.parentNode.replaceChild(t.fr,t.slot);else if(t.slot.childNodes.length){let e=document.createDocumentFragment();e.append(...t.slot.childNodes),t.slot.parentNode.replaceChild(e,t.slot)}else t.slot.remove()})},function(t,e){[...t.querySelectorAll(`[${_e.EL_REF_ATTR}]`)].forEach(t=>{let r=t.getAttribute(_e.EL_REF_ATTR);e.ref[r]=t,t.removeAttribute(_e.EL_REF_ATTR)})},function(t,e){[...t.querySelectorAll(`[${_e.BIND_ATTR}]`)].forEach(t=>{let r=t.getAttribute(_e.BIND_ATTR).split(";");[...t.attributes].forEach(e=>{if(e.name.startsWith("-")&&e.value){let i=e.name.replace("-","").split("-").map((t,e)=>t&&e?t[0].toUpperCase()+t.slice(1):t).join("").split("_").map((t,e)=>t&&e?t.toUpperCase():t).join("");r.push(i+":"+e.value),t.removeAttribute(e.name)}}),r.forEach(r=>{if(!r)return;let i,o=r.split(":").map(t=>t.trim()),n=o[0];0===n.indexOf(_e.ATTR_BIND_PRFX)&&(i=!0,n=n.replace(_e.ATTR_BIND_PRFX,""));let a=o[1].split(",").map(t=>t.trim());for(let r of a){let o;r.startsWith("!!")?(o="double",r=r.replace("!!","")):r.startsWith("!")&&(o="single",r=r.replace("!","")),e.sub(r,e=>{"double"===o?e=!!e:"single"===o&&(e=!e),i?(null==e?void 0:e.constructor)===Boolean?e?t.setAttribute(n,""):t.removeAttribute(n):t.setAttribute(n,e):Ce(t,n,e)||(t[_e.SET_LATER_KEY]||(t[_e.SET_LATER_KEY]=Object.create(null)),t[_e.SET_LATER_KEY][n]=e)})}}),t.removeAttribute(_e.BIND_ATTR)})},function(t,e){(function(t){let e,r=[],i=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode:t=>{var e;return!(null==(e=t.parentElement)?void 0:e.hasAttribute("skip-text"))&&t.textContent.includes(Te)&&t.textContent.includes(Ae)&&1}});for(;e=i.nextNode();)r.push(e);return r})(t).forEach(t=>{let r,i=[];for(;t.textContent.includes(Ae);)t.textContent.startsWith(Te)?(r=t.textContent.indexOf(Ae)+2,t.splitText(r),i.push(t)):(r=t.textContent.indexOf(Te),t.splitText(r)),t=t.nextSibling;i.forEach(t=>{let r=t.textContent.replace(Te,"").replace(Ae,"");t.textContent="",e.sub(r,e=>{t.textContent=e})})})}],Se="'",Me='"',$e=/\\([0-9a-fA-F]{1,6} ?)/g;function Le(t){let e=t;var r;(r=t)[0]!==Me&&r[0]!==Se||r[r.length-1]!==Me&&r[r.length-1]!==Se||(e=function(t){return t[0]!==Me&&t[0]!==Se||(t=t.slice(1)),t[t.length-1]!==Me&&t[t.length-1]!==Se||(t=t.slice(0,-1)),t}(e),e=e.replace($e,(t,e)=>String.fromCodePoint(parseInt(e.trim(),16))),e=e.replaceAll("\\\n","\\n"),e=function(t){let e="",r="";for(var i=0;i<t.length;i++){const o=t[i+1];"\\"===t[i]&&'"'===o?(e+='\\"',i++):'"'===t[i]&&"\\"!==r?e+='\\"':e+=t[i],r=t[i]}return e}(e),e=Me+e+Me);try{return JSON.parse(e)}catch(r){throw new Error(`Failed to parse CSS property value: ${e}. Original input: ${t}`)}}var Oe=0,Ue=null,Re=null,Pe=class extends HTMLElement{constructor(){super(),ye(this,"updateCssData",()=>{var t;this.dropCssDataCache(),null==(t=this.__boundCssProps)||t.forEach(t=>{let e=this.getCssData(this.__extractCssName(t),!0);null!==e&&this.$[t]!==e&&(this.$[t]=e)})}),this.init$=Object.create(null),this.cssInit$=Object.create(null),this.tplProcessors=new Set,this.ref=Object.create(null),this.allSubs=new Set,this.pauseRender=!1,this.renderShadow=!1,this.readyToDestroy=!0,this.processInnerHtml=!1,this.allowCustomTemplate=!1,this.ctxOwner=!1}get BaseComponent(){return Pe}initCallback(){}__initCallback(){var t;this.__initialized||(this.__initialized=!0,null==(t=this.initCallback)||t.call(this))}render(t,e=this.renderShadow){let r;if(!e&&!this.constructor.__shadowStylesUrl||this.shadowRoot||this.attachShadow({mode:"open"}),this.allowCustomTemplate){let e=this.getAttribute(_e.USE_TPL);if(e){let r=this.getRootNode(),i=(null==r?void 0:r.querySelector(e))||document.querySelector(e);i?t=i.content.cloneNode(!0):console.warn(`Symbiote template "${e}" is not found...`)}}if(this.processInnerHtml)for(let t of this.tplProcessors)t(this,this);if(t||this.constructor.template){if(this.constructor.template&&!this.constructor.__tpl&&(this.constructor.__tpl=document.createElement("template"),this.constructor.__tpl.innerHTML=this.constructor.template),(null==t?void 0:t.constructor)===DocumentFragment)r=t;else if((null==t?void 0:t.constructor)===String){let e=document.createElement("template");e.innerHTML=t,r=e.content.cloneNode(!0)}else this.constructor.__tpl&&(r=this.constructor.__tpl.content.cloneNode(!0));for(let t of this.tplProcessors)t(r,this)}let i=()=>{r&&(e&&this.shadowRoot.appendChild(r)||this.appendChild(r)),this.__initCallback()};if(this.constructor.__shadowStylesUrl){e=!0;let t=document.createElement("link");t.rel="stylesheet",t.href=this.constructor.__shadowStylesUrl,t.onload=i,this.shadowRoot.prepend(t)}else i()}addTemplateProcessor(t){this.tplProcessors.add(t)}get autoCtxName(){return this.__autoCtxName||(this.__autoCtxName=xe.generate(),this.style.setProperty(_e.CSS_CTX_PROP,`'${this.__autoCtxName}'`)),this.__autoCtxName}get cssCtxName(){return this.getCssData(_e.CSS_CTX_PROP,!0)}get ctxName(){var t;let e=(null==(t=this.getAttribute(_e.CTX_NAME_ATTR))?void 0:t.trim())||this.cssCtxName||this.__cachedCtxName||this.autoCtxName;return this.__cachedCtxName=e,e}get localCtx(){return this.__localCtx||(this.__localCtx=we.registerCtx({},this)),this.__localCtx}get nodeCtx(){return we.getCtx(this.ctxName,!1)||we.registerCtx({},this.ctxName)}static __parseProp(t,e){let r,i;if(t.startsWith(_e.EXT_DATA_CTX_PRFX))r=e.nodeCtx,i=t.replace(_e.EXT_DATA_CTX_PRFX,"");else if(t.includes(_e.NAMED_DATA_CTX_SPLTR)){let e=t.split(_e.NAMED_DATA_CTX_SPLTR);r=we.getCtx(e[0]),i=e[1]}else r=e.localCtx,i=t;return{ctx:r,name:i}}sub(t,e,r=!0){let i=t=>{this.isConnected&&e(t)},o=Pe.__parseProp(t,this);o.ctx.has(o.name)?this.allSubs.add(o.ctx.sub(o.name,i,r)):window.setTimeout(()=>{this.allSubs.add(o.ctx.sub(o.name,i,r))})}notify(t){let e=Pe.__parseProp(t,this);e.ctx.notify(e.name)}has(t){let e=Pe.__parseProp(t,this);return e.ctx.has(e.name)}add(t,e,r=!1){let i=Pe.__parseProp(t,this);i.ctx.add(i.name,e,r)}add$(t,e=!1){for(let r in t)this.add(r,t[r],e)}get $(){if(!this.__stateProxy){let t=Object.create(null);this.__stateProxy=new Proxy(t,{set:(t,e,r)=>{let i=Pe.__parseProp(e,this);return i.ctx.pub(i.name,r),!0},get:(t,e)=>{let r=Pe.__parseProp(e,this);return r.ctx.read(r.name)}})}return this.__stateProxy}set$(t,e=!1){for(let r in t){let i=t[r],o=[String,Number,Boolean];(e||!o.includes(null==i?void 0:i.constructor)||this.$[r]!==i)&&(this.$[r]=i)}}get __ctxOwner(){return this.ctxOwner||this.hasAttribute(_e.CTX_OWNER_ATTR)&&"false"!==this.getAttribute(_e.CTX_OWNER_ATTR)}__initDataCtx(){let t=this.constructor.__attrDesc;if(t)for(let e of Object.values(t))Object.keys(this.init$).includes(e)||(this.init$[e]="");for(let t in this.init$)if(t.startsWith(_e.EXT_DATA_CTX_PRFX))this.nodeCtx.add(t.replace(_e.EXT_DATA_CTX_PRFX,""),this.init$[t],this.__ctxOwner);else if(t.includes(_e.NAMED_DATA_CTX_SPLTR)){let e=t.split(_e.NAMED_DATA_CTX_SPLTR),r=e[0].trim(),i=e[1].trim();if(r&&i){let e=we.getCtx(r,!1);e||(e=we.registerCtx({},r)),e.add(i,this.init$[t])}}else this.localCtx.add(t,this.init$[t]);for(let t in this.cssInit$)this.bindCssData(t,this.cssInit$[t]);this.__dataCtxInitialized=!0}connectedCallback(){var t;if(this.isConnected){if(this.__disconnectTimeout&&window.clearTimeout(this.__disconnectTimeout),!this.connectedOnce){let e=null==(t=this.getAttribute(_e.CTX_NAME_ATTR))?void 0:t.trim();if(e&&this.style.setProperty(_e.CSS_CTX_PROP,`'${e}'`),this.__initDataCtx(),this[_e.SET_LATER_KEY]){for(let t in this[_e.SET_LATER_KEY])Ce(this,t,this[_e.SET_LATER_KEY][t]);delete this[_e.SET_LATER_KEY]}this.initChildren=[...this.childNodes];for(let t of Ie)this.addTemplateProcessor(t);if(this.pauseRender)this.__initCallback();else if(this.constructor.__rootStylesLink){let t=this.getRootNode();if(!t)return;if(null==t?void 0:t.querySelector(`link[${_e.ROOT_STYLE_ATTR_NAME}="${this.constructor.is}"]`))return void this.render();let e=this.constructor.__rootStylesLink.cloneNode(!0);e.setAttribute(_e.ROOT_STYLE_ATTR_NAME,this.constructor.is),e.onload=()=>{this.render()},t.nodeType===Node.DOCUMENT_NODE?t.head.appendChild(e):t.prepend(e)}else this.render()}this.connectedOnce=!0}}destroyCallback(){}disconnectedCallback(){this.connectedOnce&&(this.dropCssDataCache(),this.readyToDestroy&&(this.__disconnectTimeout&&window.clearTimeout(this.__disconnectTimeout),this.__disconnectTimeout=window.setTimeout(()=>{this.destroyCallback();for(let t of this.allSubs)t.remove(),this.allSubs.delete(t);for(let t of this.tplProcessors)this.tplProcessors.delete(t);null==Re||Re.delete(this.updateCssData),(null==Re?void 0:Re.size)||(null==Ue||Ue.disconnect(),Ue=null,Re=null)},100)))}static reg(t,e=!1){t||(Oe++,t=`${_e.AUTO_TAG_PRFX}-${Oe}`),this.__tag=t;let r=window.customElements.get(t);r?e||r===this||console.warn([`Element with tag name "${t}" already registered.`,`You're trying to override it with another class "${this.name}".`,"This is most likely a mistake.","New element will not be registered."].join("\n")):window.customElements.define(t,e?class extends(this){}:this)}static get is(){return this.__tag||this.reg(),this.__tag}static bindAttributes(t){this.observedAttributes=Object.keys(t),this.__attrDesc=t}attributeChangedCallback(t,e,r){var i;if(e===r)return;let o=null==(i=this.constructor.__attrDesc)?void 0:i[t];o?this.__dataCtxInitialized?this.$[o]=r:this.init$[o]=r:this[t]=r}getCssData(t,e=!1){if(this.__cssDataCache||(this.__cssDataCache=Object.create(null)),!Object.keys(this.__cssDataCache).includes(t)){this.__computedStyle||(this.__computedStyle=window.getComputedStyle(this));let r=this.__computedStyle.getPropertyValue(t).trim();try{this.__cssDataCache[t]=Le(r)}catch(r){!e&&console.warn(`CSS Data error: ${t}`),this.__cssDataCache[t]=null}}return this.__cssDataCache[t]}__extractCssName(t){return t.split("--").map((t,e)=>0===e?"":t).join("--")}__initStyleAttrObserver(){Re||(Re=new Set),Re.add(this.updateCssData),Ue||(Ue=new MutationObserver(t=>{"attributes"===t[0].type&&Re.forEach(t=>{t()})})).observe(document,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]})}bindCssData(t,e=""){this.__boundCssProps||(this.__boundCssProps=new Set),this.__boundCssProps.add(t);let r=this.getCssData(this.__extractCssName(t),!0);null===r&&(r=e),this.add(t,r),this.__initStyleAttrObserver()}dropCssDataCache(){this.__cssDataCache=null,this.__computedStyle=null}defineAccessor(t,e,r){let i="__"+t;this[i]=this[t],Object.defineProperty(this,t,{set:t=>{this[i]=t,r?window.setTimeout(()=>{null==e||e(t)}):null==e||e(t)},get:()=>this[i]}),this[t]=this[i]}static set shadowStyles(t){let e=new Blob([t],{type:"text/css"});this.__shadowStylesUrl=URL.createObjectURL(e)}static set rootStyles(t){if(!this.__rootStylesLink){let e=new Blob([t],{type:"text/css"}),r=URL.createObjectURL(e),i=document.createElement("link");i.href=r,i.rel="stylesheet",this.__rootStylesLink=i}}},Ne=Pe;ye(Ne,"template");var De=class{static _print(t){console.warn(t)}static setDefaultTitle(t){this.defaultTitle=t}static setRoutingMap(t){Object.assign(this.appMap,t);for(let t in this.appMap)this.defaultRoute||!0!==this.appMap[t].default?this.errorRoute||!0!==this.appMap[t].error||(this.errorRoute=t):this.defaultRoute=t}static set routingEventName(t){this.__routingEventName=t}static get routingEventName(){return this.__routingEventName||"sym-on-route"}static readAddressBar(){let t={route:null,options:{}};return window.location.search.split(this.separator).forEach(e=>{if(e.includes("?"))t.route=e.replace("?","");else if(e.includes("=")){let r=e.split("=");t.options[r[0]]=decodeURI(r[1])}else t.options[e]=!0}),t}static notify(){let t=this.readAddressBar(),e=this.appMap[t.route];if(e&&e.title&&(document.title=e.title),null===t.route&&this.defaultRoute)return void this.applyRoute(this.defaultRoute);if(!e&&this.errorRoute)return void this.applyRoute(this.errorRoute);if(!e&&this.defaultRoute)return void this.applyRoute(this.defaultRoute);if(!e)return void this._print(`Route "${t.route}" not found...`);let r=new CustomEvent(De.routingEventName,{detail:{route:t.route,options:Object.assign(e||{},t.options)}});window.dispatchEvent(r)}static reflect(t,e={}){let r=this.appMap[t];if(!r)return void this._print("Wrong route: "+t);let i="?"+t;for(let t in e)!0===e[t]?i+=this.separator+t:i+=this.separator+t+`=${e[t]}`;let o=r.title||this.defaultTitle||"";window.history.pushState(null,o,i),document.title=o}static applyRoute(t,e={}){this.reflect(t,e),this.notify()}static setSeparator(t){this._separator=t}static get separator(){return this._separator||"&"}static createRouterData(t,e){this.setRoutingMap(e);let r=we.registerCtx({route:null,options:null,title:null},t);return window.addEventListener(this.routingEventName,t=>{var e;r.multiPub({route:t.detail.route,options:t.detail.options,title:(null==(e=t.detail.options)?void 0:e.title)||this.defaultTitle||""})}),De.notify(),this.initPopstateListener(),r}static initPopstateListener(){this.__onPopstate||(this.__onPopstate=()=>{this.notify()},window.addEventListener("popstate",this.__onPopstate))}static removePopstateListener(){window.removeEventListener("popstate",this.__onPopstate),this.__onPopstate=null}};function ze(t,e){for(let r in e)r.includes("-")?t.style.setProperty(r,e[r]):t.style[r]=e[r]}function Ve(t={tag:"div"}){let e=document.createElement(t.tag);if(t.attributes&&function(t,e){for(let r in e)e[r].constructor===Boolean?e[r]?t.setAttribute(r,""):t.removeAttribute(r):t.setAttribute(r,e[r])}(e,t.attributes),t.styles&&ze(e,t.styles),t.properties)for(let r in t.properties)e[r]=t.properties[r];return t.processors&&t.processors.forEach(t=>{t(e)}),t.children&&t.children.forEach(t=>{let r=Ve(t);e.appendChild(r)}),e}De.appMap=Object.create(null);var Fe="idb-store-ready",Be=class{_notifyWhenReady(t=null){window.dispatchEvent(new CustomEvent(Fe,{detail:{dbName:this.name,storeName:this.storeName,event:t}}))}get _updEventName(){return"symbiote-idb-update_"+this.name}_getUpdateEvent(t){return new CustomEvent(this._updEventName,{detail:{key:this.name,newValue:t}})}_notifySubscribers(t){window.localStorage.removeItem(this.name),window.localStorage.setItem(this.name,t),window.dispatchEvent(this._getUpdateEvent(t))}constructor(t,e){this.name=t,this.storeName=e,this.version=1,this.request=window.indexedDB.open(this.name,this.version),this.request.onupgradeneeded=t=>{this.db=t.target.result,this.objStore=this.db.createObjectStore(e,{keyPath:"_key"}),this.objStore.transaction.oncomplete=t=>{this._notifyWhenReady(t)}},this.request.onsuccess=t=>{this.db=t.target.result,this._notifyWhenReady(t)},this.request.onerror=t=>{console.error(t)},this._subscriptionsMap={},this._updateHandler=t=>{if(t.key===this.name&&this._subscriptionsMap[t.newValue]){this._subscriptionsMap[t.newValue].forEach(async e=>{e(await this.read(t.newValue))})}},this._localUpdateHandler=t=>{this._updateHandler(t.detail)},window.addEventListener("storage",this._updateHandler),window.addEventListener(this._updEventName,this._localUpdateHandler)}read(t){let e=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).get(t);return new Promise((r,i)=>{e.onsuccess=e=>{var i;(null==(i=e.target.result)?void 0:i._value)?r(e.target.result._value):(r(null),console.warn(`IDB: cannot read "${t}"`))},e.onerror=t=>{i(t)}})}write(t,e,r=!1){let i={_key:t,_value:e},o=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).put(i);return new Promise((e,i)=>{o.onsuccess=i=>{r||this._notifySubscribers(t),e(i.target.result)},o.onerror=t=>{i(t)}})}delete(t,e=!1){let r=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).delete(t);return new Promise((i,o)=>{r.onsuccess=r=>{e||this._notifySubscribers(t),i(r)},r.onerror=t=>{o(t)}})}getAll(){let t=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).getAll();return new Promise((e,r)=>{t.onsuccess=t=>{let r=t.target.result;e(r.map(t=>t._value))},t.onerror=t=>{r(t)}})}subscribe(t,e){this._subscriptionsMap[t]||(this._subscriptionsMap[t]=new Set);let r=this._subscriptionsMap[t];return r.add(e),{remove:()=>{r.delete(e),r.size||delete this._subscriptionsMap[t]}}}stop(){window.removeEventListener("storage",this._updateHandler),this._subscriptionsMap=null,je.clear(this.name)}},je=class{static get readyEventName(){return Fe}static open(t="symbiote-db",e="store"){let r=t+"/"+e;return this._reg[r]||(this._reg[r]=new Be(t,e)),this._reg[r]}static clear(t){window.indexedDB.deleteDatabase(t);for(let e in this._reg)e.split("/")[0]===t&&delete this._reg[e]}};function He(t){return"[object Object]"===Object.prototype.toString.call(t)}ye(je,"_reg",Object.create(null));const qe=/\W|_/g;function Ke(t){return t.split(qe).map((t,e)=>t.charAt(0)[e>0?"toUpperCase":"toLowerCase"]()+t.slice(1)).join("")}function Ge(t,{ignoreKeys:e}={ignoreKeys:[]}){return Array.isArray(t)?t.map(t=>We(t,{ignoreKeys:e})):t}function We(t,{ignoreKeys:e}={ignoreKeys:[]}){if(Array.isArray(t))return Ge(t,{ignoreKeys:e});if(!He(t))return t;const r={};for(const i of Object.keys(t)){let o=t[i];e.includes(i)?r[i]=o:(He(o)?o=We(o,{ignoreKeys:e}):Array.isArray(o)&&(o=Ge(o,{ignoreKeys:e})),r[Ke(i)]=o)}return r}function Ze({libraryName:t,libraryVersion:e,userAgent:r,publicKey:i="",integration:o=""}){const n="JavaScript";if("string"==typeof r)return r;if("function"==typeof r)return r({publicKey:i,libraryName:t,libraryVersion:e,languageName:n,integration:o});return`${[t,e,i].filter(Boolean).join("/")} (${[n,o].filter(Boolean).join("; ")})`}const Xe={factor:2,time:100};function Ye(t,e=Xe){let r=0;return function t(i){const o=Math.round(e.time*e.factor**r);return i({attempt:r,retry:e=>(t=>new Promise(e=>setTimeout(e,t)))(e??o).then(()=>(r+=1,t(i)))})}(t)}class Je extends Error{}class Qe extends Je{originalProgressEvent;constructor(t){super(),this.name="NetworkError",this.message="Network error",Object.setPrototypeOf(this,Qe.prototype),this.originalProgressEvent=t}}const tr=(t,e)=>{t&&(t.aborted?Promise.resolve().then(e):t.addEventListener("abort",()=>e(),{once:!0}))};class er extends Je{isCancel=!0;constructor(t="Request canceled"){super(t),this.name="CancelError",Object.setPrototypeOf(this,er.prototype)}}const rr=({check:t,interval:e=500,timeout:r,signal:i})=>new Promise((o,n)=>{let a,s;tr(i,()=>{a&&clearTimeout(a),n(new er("Poll cancelled"))}),r&&(s=setTimeout(()=>{a&&clearTimeout(a),n(new er("Timed out"))},r));const c=()=>{try{Promise.resolve(t(i)).then(t=>{t?(s&&clearTimeout(s),o(t)):a=setTimeout(c,e)}).catch(t=>{s&&clearTimeout(s),n(t)})}catch(t){s&&clearTimeout(s),n(t)}};a=setTimeout(c,0)}),ir={baseCDN:"https://ucarecdn.com",baseURL:"https://upload.uploadcare.com",maxContentLength:52428800,retryThrottledRequestMaxTimes:1,retryNetworkErrorMaxTimes:3,multipartMinFileSize:26214400,multipartChunkSize:5242880,multipartMinLastPartSize:1048576,maxConcurrentRequests:4,pollingTimeoutMilliseconds:1e4,pusherKey:"79ae88bd931ea68464d9"},or="application/octet-stream",nr="original",ar=({method:t,url:e,data:r,headers:i={},signal:o,onProgress:n})=>new Promise((a,s)=>{const c=new XMLHttpRequest,l=t?.toUpperCase()||"GET";let u=!1;c.open(l,e,!0),i&&Object.entries(i).forEach(t=>{const[e,r]=t;void 0!==r&&!Array.isArray(r)&&c.setRequestHeader(e,r)}),c.responseType="text",tr(o,()=>{u=!0,c.abort(),s(new er)}),c.onload=()=>{if(200!=c.status)s(new Error(`Error ${c.status}: ${c.statusText}`));else{const t={method:l,url:e,data:r,headers:i||void 0,signal:o,onProgress:n},s=c.getAllResponseHeaders().trim().split(/[\r\n]+/),u={};s.forEach(function(t){const e=t.split(": "),r=e.shift(),i=e.join(": ");r&&void 0!==r&&(u[r]=i)});const d=c.response,h=c.status;a({request:t,data:d,headers:u,status:h})}},c.onerror=t=>{u||s(new Qe(t))},n&&"function"==typeof n&&(c.upload.onprogress=t=>{t.lengthComputable?n({isComputable:!0,value:t.loaded/t.total}):n({isComputable:!1})}),r?c.send(r):c.send()});const sr=function(t,...e){return t};const cr=t=>"undefined"!=typeof Blob&&t instanceof Blob,lr=t=>"undefined"!=typeof File&&t instanceof File,ur=t=>!!t&&"object"==typeof t&&!Array.isArray(t)&&"uri"in t&&"string"==typeof t.uri,dr=t=>cr(t)||lr(t)||ur(t);function hr(t,e,r){if(Array.isArray(r))for(const i of r)hr(t,`${e}[]`,i);else if((i=r)&&"object"==typeof i&&"data"in i&&dr(i.data)){const{name:i,contentType:o}=r,n=sr(r.data,i,o??or),a=(({name:t})=>t?[t]:[])({name:i,contentType:o});t.push([e,n,...a])}else if((t=>!!t&&"object"==typeof t&&!Array.isArray(t))(r))for(const[i,o]of Object.entries(r))void 0!==o&&t.push([`${e}[${i}]`,String(o)]);else(t=>"string"==typeof t||"number"==typeof t||void 0===t)(r)&&r&&t.push([e,r.toString()]);var i}function pr(t){const e=new FormData,r=function(t){const e=[];for(const[r,i]of Object.entries(t))hr(e,r,i);return e}(t);for(const t of r){const[r,i,...o]=t;e.append(r,i,...o)}return e}class gr extends Je{code;request;response;headers;constructor(t,e,r,i,o){super(),this.name="UploadError",this.message=t,this.code=e,this.request=r,this.response=i,this.headers=o,Object.setPrototypeOf(this,gr.prototype)}}const mr=(t,e,r)=>{const i=new URL(t);return i.pathname=(i.pathname+e).replace("//","/"),r&&(i.search=(t=>{const e=new URLSearchParams;for(const[r,i]of Object.entries(t))i&&"object"==typeof i&&!Array.isArray(i)?Object.entries(i).filter(t=>t[1]??!1).forEach(t=>e.set(`${r}[${t[0]}]`,String(t[1]))):Array.isArray(i)?i.forEach(t=>{e.append(`${r}[]`,t)}):"string"==typeof i&&i?e.set(r,i):"number"==typeof i&&e.set(r,i.toString());return e.toString()})(r)),i.toString()};function br(t){return Ze({libraryName:"UploadcareUploadClient",libraryVersion:"6.18.2",...t})}function fr(t,e){const{retryThrottledRequestMaxTimes:r,retryNetworkErrorMaxTimes:i}=e;return Ye(({attempt:e,retry:o})=>t().catch(t=>{if("response"in t&&"RequestThrottledError"===t?.code&&e<r)return o(function(t){const{headers:e}=t||{};if(!e||"string"!=typeof e["retry-after"])return 15e3;const r=parseInt(e["retry-after"],10);return Number.isFinite(r)?1e3*r:15e3}(t));if(t instanceof Qe&&e<i)return o(1e3*(e+1));throw t}))}const vr=t=>{let e="";return(cr(t)||lr(t)||ur(t))&&(e=t.type),e||or},yr=t=>{let e="";return lr(t)&&t.name?e=t.name:cr(t)?e="":ur(t)&&t.name&&(e=t.name),e||nr};function wr(t){return void 0===t||"auto"===t?"auto":t?"1":"0"}function _r(t,{publicKey:e,fileName:r,contentType:i,baseURL:o=ir.baseURL,secureSignature:n,secureExpire:a,store:s,signal:c,onProgress:l,source:u="local",integration:d,userAgent:h,retryThrottledRequestMaxTimes:p=ir.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:g=ir.retryNetworkErrorMaxTimes,metadata:m}){return fr(()=>ar({method:"POST",url:mr(o,"/base/",{jsonerrors:1}),headers:{"X-UC-User-Agent":br({publicKey:e,integration:d,userAgent:h})},data:pr({file:{data:t,name:r||yr(t),contentType:i||vr(t)},UPLOADCARE_PUB_KEY:e,UPLOADCARE_STORE:wr(s),signature:n,expire:a,source:u,metadata:m}),signal:c,onProgress:l}).then(({data:t,headers:e,request:r})=>{const i=We(JSON.parse(t));if("error"in i)throw new gr(i.error.content,i.error.errorCode,r,i,e);return i}),{retryNetworkErrorMaxTimes:g,retryThrottledRequestMaxTimes:p})}var kr,xr;function Cr(t,{publicKey:e,baseURL:r=ir.baseURL,store:i,fileName:o,checkForUrlDuplicates:n,saveUrlForRecurrentUploads:a,secureSignature:s,secureExpire:c,source:l="url",signal:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p=ir.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:g=ir.retryNetworkErrorMaxTimes,metadata:m}){return fr(()=>ar({method:"POST",headers:{"X-UC-User-Agent":br({publicKey:e,integration:d,userAgent:h})},url:mr(r,"/from_url/",{jsonerrors:1,pub_key:e,source_url:t,store:wr(i),filename:o,check_URL_duplicates:n?1:void 0,save_URL_duplicates:a?1:void 0,signature:s,expire:c,source:l,metadata:m}),signal:u}).then(({data:t,headers:e,request:r})=>{const i=We(JSON.parse(t));if("error"in i)throw new gr(i.error.content,i.error.errorCode,r,i,e);return i}),{retryNetworkErrorMaxTimes:g,retryThrottledRequestMaxTimes:p})}!function(t){t.Token="token",t.FileInfo="file_info"}(kr||(kr={})),function(t){t.Unknown="unknown",t.Waiting="waiting",t.Progress="progress",t.Error="error",t.Success="success"}(xr||(xr={}));function Er(t,{publicKey:e,baseURL:r=ir.baseURL,signal:i,integration:o,userAgent:n,retryThrottledRequestMaxTimes:a=ir.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:s=ir.retryNetworkErrorMaxTimes}={}){return fr(()=>ar({method:"GET",headers:e?{"X-UC-User-Agent":br({publicKey:e,integration:o,userAgent:n})}:void 0,url:mr(r,"/from_url/status/",{jsonerrors:1,token:t}),signal:i}).then(({data:t,headers:e,request:r})=>{const i=We(JSON.parse(t));if("error"in i&&!(t=>"status"in t&&t.status===xr.Error)(i))throw new gr(i.error.content,i.error.errorCode,r,i,e);return i}),{retryNetworkErrorMaxTimes:s,retryThrottledRequestMaxTimes:a})}function Tr(t,{publicKey:e,baseURL:r=ir.baseURL,jsonpCallback:i,secureSignature:o,secureExpire:n,signal:a,source:s,integration:c,userAgent:l,retryThrottledRequestMaxTimes:u=ir.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:d=ir.retryNetworkErrorMaxTimes}){return fr(()=>ar({method:"POST",headers:{"X-UC-User-Agent":br({publicKey:e,integration:c,userAgent:l})},url:mr(r,"/group/",{jsonerrors:1}),data:pr({files:t,callback:i,pub_key:e,signature:o,expire:n,source:s}),signal:a}).then(({data:t,headers:e,request:r})=>{const i=We(JSON.parse(t));if("error"in i)throw new gr(i.error.content,i.error.errorCode,r,i,e);return i}),{retryNetworkErrorMaxTimes:d,retryThrottledRequestMaxTimes:u})}function Ar(t,{publicKey:e,baseURL:r=ir.baseURL,signal:i,source:o,integration:n,userAgent:a,retryThrottledRequestMaxTimes:s=ir.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:c=ir.retryNetworkErrorMaxTimes}){return fr(()=>ar({method:"GET",headers:{"X-UC-User-Agent":br({publicKey:e,integration:n,userAgent:a})},url:mr(r,"/info/",{jsonerrors:1,pub_key:e,file_id:t,source:o}),signal:i}).then(({data:t,headers:e,request:r})=>{const i=We(JSON.parse(t));if("error"in i)throw new gr(i.error.content,i.error.errorCode,r,i,e);return i}),{retryThrottledRequestMaxTimes:s,retryNetworkErrorMaxTimes:c})}function Ir(t,{publicKey:e,contentType:r,fileName:i,multipartChunkSize:o=ir.multipartChunkSize,baseURL:n="",secureSignature:a,secureExpire:s,store:c,signal:l,source:u="local",integration:d,userAgent:h,retryThrottledRequestMaxTimes:p=ir.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:g=ir.retryNetworkErrorMaxTimes,metadata:m}){return fr(()=>ar({method:"POST",url:mr(n,"/multipart/start/",{jsonerrors:1}),headers:{"X-UC-User-Agent":br({publicKey:e,integration:d,userAgent:h})},data:pr({filename:i||nr,size:t,content_type:r||or,part_size:o,UPLOADCARE_STORE:wr(c),UPLOADCARE_PUB_KEY:e,signature:a,expire:s,source:u,metadata:m}),signal:l}).then(({data:t,headers:e,request:r})=>{const i=We(JSON.parse(t));if("error"in i)throw new gr(i.error.content,i.error.errorCode,r,i,e);return i.parts=Object.keys(i.parts).map(t=>i.parts[Number(t)]),i}),{retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g})}function Sr(t,e,{contentType:r,signal:i,onProgress:o,retryThrottledRequestMaxTimes:n=ir.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:a=ir.retryNetworkErrorMaxTimes}){return fr(()=>ar({method:"PUT",url:e,data:t,onProgress:o,signal:i,headers:{"Content-Type":r||or}}).then(t=>(o&&o({isComputable:!0,value:1}),t)).then(({status:t})=>({code:t})),{retryThrottledRequestMaxTimes:n,retryNetworkErrorMaxTimes:a})}function Mr(t,{publicKey:e,baseURL:r=ir.baseURL,source:i="local",signal:o,integration:n,userAgent:a,retryThrottledRequestMaxTimes:s=ir.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:c=ir.retryNetworkErrorMaxTimes}){return fr(()=>ar({method:"POST",url:mr(r,"/multipart/complete/",{jsonerrors:1}),headers:{"X-UC-User-Agent":br({publicKey:e,integration:n,userAgent:a})},data:pr({uuid:t,UPLOADCARE_PUB_KEY:e,source:i}),signal:o}).then(({data:t,headers:e,request:r})=>{const i=We(JSON.parse(t));if("error"in i)throw new gr(i.error.content,i.error.errorCode,r,i,e);return i}),{retryThrottledRequestMaxTimes:s,retryNetworkErrorMaxTimes:c})}function $r(t,{publicKey:e,baseURL:r,source:i,integration:o,userAgent:n,retryThrottledRequestMaxTimes:a,retryNetworkErrorMaxTimes:s,signal:c,onProgress:l}){return rr({check:c=>Ar(t,{publicKey:e,baseURL:r,signal:c,source:i,integration:o,userAgent:n,retryThrottledRequestMaxTimes:a,retryNetworkErrorMaxTimes:s}).then(t=>t.isReady?t:(l&&l({isComputable:!0,value:1}),!1)),signal:c})}class Lr{uuid;name;size;isStored;isImage;mimeType;cdnUrl;s3Url;originalFilename;imageInfo;videoInfo;contentInfo;metadata;s3Bucket;defaultEffects=null;constructor(t,{baseCDN:e=ir.baseCDN,fileName:r}={}){const{uuid:i,s3Bucket:o}=t,n=mr(e,`${i}/`),a=o?mr(`https://${o}.s3.amazonaws.com/`,`${i}/${t.filename}`):null;this.uuid=i,this.name=r||t.filename,this.size=t.size,this.isStored=t.isStored,this.isImage=t.isImage,this.mimeType=t.mimeType,this.cdnUrl=n,this.originalFilename=t.originalFilename,this.imageInfo=t.imageInfo,this.videoInfo=t.videoInfo,this.contentInfo=t.contentInfo,this.metadata=t.metadata||null,this.s3Bucket=o||null,this.s3Url=a,function(t){return"defaultEffects"in t}(t)&&(this.defaultEffects=t.defaultEffects)}}const Or=(t,{signal:e}={})=>{let r=null,i=null;const o=t.map(()=>new AbortController);return tr(e,()=>{o.forEach(t=>t.abort())}),Promise.all(t.map((t,e)=>{const n=(t=>()=>{i=t,o.forEach((e,r)=>r!==t&&e.abort())})(e);return Promise.resolve().then(()=>t({stopRace:n,signal:o[e].signal})).then(t=>(n(),t)).catch(t=>(r=t,null))})).then(t=>{if(null===i)throw r;return t[i]})};var Ur=window.WebSocket;class Rr{events=Object.create({});emit(t,e){this.events[t]?.forEach(t=>t(e))}on(t,e){this.events[t]=this.events[t]||[],this.events[t].push(e)}off(t,e){this.events[t]=e?this.events[t].filter(t=>t!==e):[]}}class Pr{key;disconnectTime;ws=void 0;queue=[];isConnected=!1;subscribers=0;emmitter=new Rr;disconnectTimeoutId=null;constructor(t,e=3e4){this.key=t,this.disconnectTime=e}connect(){if(this.disconnectTimeoutId&&clearTimeout(this.disconnectTimeoutId),!this.isConnected&&!this.ws){const t=`wss://ws.pusherapp.com/app/${this.key}?protocol=5&client=js&version=1.12.2`;this.ws=new Ur(t),this.ws.addEventListener("error",t=>{this.emmitter.emit("error",new Error(t.message))}),this.emmitter.on("connected",()=>{this.isConnected=!0,this.queue.forEach(t=>this.send(t.event,t.data)),this.queue=[]}),this.ws.addEventListener("message",t=>{const e=JSON.parse(t.data.toString());switch(e.event){case"pusher:connection_established":this.emmitter.emit("connected",void 0);break;case"pusher:ping":this.send("pusher:pong",{});break;case"progress":case"success":case"fail":this.emmitter.emit(e.channel,((t,e)=>"success"===t?{status:xr.Success,...e}:"progress"===t?{status:xr.Progress,...e}:{status:xr.Error,...e})(e.event,JSON.parse(e.data)))}})}}disconnect(){const t=()=>{this.ws?.close(),this.ws=void 0,this.isConnected=!1};this.disconnectTime?this.disconnectTimeoutId=setTimeout(()=>{t()},this.disconnectTime):t()}send(t,e){const r=JSON.stringify({event:t,data:e});this.ws?.send(r)}subscribe(t,e){this.subscribers+=1,this.connect();const r=`task-status-${t}`,i={event:"pusher:subscribe",data:{channel:r}};this.emmitter.on(r,e),this.isConnected?this.send(i.event,i.data):this.queue.push(i)}unsubscribe(t){this.subscribers-=1;const e=`task-status-${t}`,r={event:"pusher:unsubscribe",data:{channel:e}};this.emmitter.off(e),this.isConnected?this.send(r.event,r.data):this.queue=this.queue.filter(t=>t.data.channel!==e),0===this.subscribers&&this.disconnect()}onError(t){return this.emmitter.on("error",t),()=>this.emmitter.off("error",t)}}let Nr=null;const Dr=t=>{if(!Nr){const e="undefined"==typeof window?0:3e4;Nr=new Pr(t,e)}return Nr};const zr=(t,{publicKey:e,fileName:r,baseURL:i,baseCDN:o,checkForUrlDuplicates:n,saveUrlForRecurrentUploads:a,secureSignature:s,secureExpire:c,store:l,signal:u,onProgress:d,source:h,integration:p,userAgent:g,retryThrottledRequestMaxTimes:m,pusherKey:b=ir.pusherKey,metadata:f})=>{return Promise.resolve((v=b,void Dr(v).connect())).then(()=>Cr(t,{publicKey:e,fileName:r,baseURL:i,checkForUrlDuplicates:n,saveUrlForRecurrentUploads:a,secureSignature:s,secureExpire:c,store:l,signal:u,source:h,integration:p,userAgent:g,retryThrottledRequestMaxTimes:m,metadata:f})).catch(t=>{const e=Dr(b);return e?.disconnect(),Promise.reject(t)}).then(t=>t.type===kr.FileInfo?t:Or([({signal:r})=>function({token:t,publicKey:e,baseURL:r,integration:i,userAgent:o,retryThrottledRequestMaxTimes:n,retryNetworkErrorMaxTimes:a,onProgress:s,signal:c}){return rr({check:c=>Er(t,{publicKey:e,baseURL:r,integration:i,userAgent:o,retryThrottledRequestMaxTimes:n,retryNetworkErrorMaxTimes:a,signal:c}).then(e=>{switch(e.status){case xr.Error:return new gr(e.error,e.errorCode);case xr.Waiting:return!1;case xr.Unknown:return new gr(`Token "${t}" was not found.`);case xr.Progress:return s&&("unknown"===e.total?s({isComputable:!1}):s({isComputable:!0,value:e.done/e.total})),!1;case xr.Success:return s&&s({isComputable:!0,value:e.done/e.total}),e;default:throw new Error("Unknown status")}}),signal:c})}({token:t.token,publicKey:e,baseURL:i,integration:p,userAgent:g,retryThrottledRequestMaxTimes:m,onProgress:d,signal:r}),({signal:e})=>(({token:t,pusherKey:e,signal:r,onProgress:i})=>new Promise((o,n)=>{const a=Dr(e),s=a.onError(n),c=()=>{s(),a.unsubscribe(t)};tr(r,()=>{c(),n(new er("pusher cancelled"))}),a.subscribe(t,t=>{switch(t.status){case xr.Progress:i&&("unknown"===t.total?i({isComputable:!1}):i({isComputable:!0,value:t.done/t.total}));break;case xr.Success:c(),i&&i({isComputable:!0,value:t.done/t.total}),o(t);break;case xr.Error:c(),n(new gr(t.msg,t.error_code))}})}))({token:t.token,pusherKey:b,signal:e,onProgress:d})],{signal:u})).then(t=>{if(t instanceof gr)throw t;return t}).then(t=>$r(t.uuid,{publicKey:e,baseURL:i,integration:p,userAgent:g,retryThrottledRequestMaxTimes:m,onProgress:d,signal:u})).then(t=>new Lr(t,{baseCDN:o}));var v},Vr=new WeakMap,Fr=async t=>{if(lr(t)||cr(t))return t.size;if(ur(t)){return(await(async t=>{if(Vr.has(t))return Vr.get(t);const e=await fetch(t.uri).then(t=>t.blob());return Vr.set(t,e),e})(t)).size}throw new Error("Unknown file type. Cannot determine file size.")},Br=t=>{const e=new RegExp("[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}");return!dr(t)&&e.test(t)},jr=t=>{const e=new RegExp("^(?:\\w+:)?\\/\\/([^\\s\\.]+\\.\\S{2}|localhost[\\:?\\d]*)\\S*$");return!dr(t)&&e.test(t)},Hr=async(t,e,r)=>i=>((t,e,r,i)=>{const o=i*e,n=Math.min(o+i,r);return t.slice(o,n)})(t,i,e,r),qr=async(t,{publicKey:e,fileName:r,fileSize:i,baseURL:o,secureSignature:n,secureExpire:a,store:s,signal:c,onProgress:l,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,contentType:m,multipartChunkSize:b=ir.multipartChunkSize,maxConcurrentRequests:f=ir.maxConcurrentRequests,baseCDN:v,metadata:y})=>{const w=i??await Fr(t);let _;const k=(t,e)=>{if(!l)return;_||(_=Array(t).fill(0));return r=>{var i;r.isComputable&&(_[e]=r.value,l({isComputable:!0,value:(i=_,i.reduce((t,e)=>t+e,0)/t)}))}};return m||=vr(t),Ir(w,{publicKey:e,contentType:m,fileName:r||yr(t),baseURL:o,secureSignature:n,secureExpire:a,store:s,signal:c,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,metadata:y,multipartChunkSize:b}).then(async({uuid:r,parts:i})=>{const o=await Hr(t,w,b);return Promise.all([r,(n=f,a=i.map((t,r)=>()=>((t,e,{publicKey:r,contentType:i,onProgress:o,signal:n,integration:a,retryThrottledRequestMaxTimes:s,retryNetworkErrorMaxTimes:c})=>Sr(t,e,{publicKey:r,contentType:i,onProgress:o,signal:n,integration:a,retryThrottledRequestMaxTimes:s,retryNetworkErrorMaxTimes:c}))(o(r),t,{publicKey:e,contentType:m,onProgress:k(i.length,r),signal:c,integration:d,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g})),new Promise((t,e)=>{const r=[];let i=!1,o=a.length;const s=[...a],c=()=>{const n=a.length-s.length,l=s.shift();l&&l().then(e=>{i||(r[n]=e,o-=1,o?c():t(r))}).catch(t=>{i=!0,e(t)})};for(let t=0;t<n;t++)c()}))]);var n,a}).then(([t])=>Mr(t,{publicKey:e,baseURL:o,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g})).then(t=>t.isReady?t:$r(t.uuid,{publicKey:e,baseURL:o,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,onProgress:l,signal:c})).then(t=>new Lr(t,{baseCDN:v}))};async function Kr(t,{publicKey:e,fileName:r,baseURL:i=ir.baseURL,secureSignature:o,secureExpire:n,store:a,signal:s,onProgress:c,source:l,integration:u,userAgent:d,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,contentType:g,multipartMinFileSize:m,multipartChunkSize:b,maxConcurrentRequests:f,baseCDN:v=ir.baseCDN,checkForUrlDuplicates:y,saveUrlForRecurrentUploads:w,pusherKey:_,metadata:k}){if(dr(t)){const y=await Fr(t);return((t,e=ir.multipartMinFileSize)=>t>=e)(y,m)?qr(t,{publicKey:e,contentType:g,multipartChunkSize:b,fileSize:y,fileName:r,baseURL:i,secureSignature:o,secureExpire:n,store:a,signal:s,onProgress:c,source:l,integration:u,userAgent:d,maxConcurrentRequests:f,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,baseCDN:v,metadata:k}):((t,{publicKey:e,fileName:r,baseURL:i,secureSignature:o,secureExpire:n,store:a,contentType:s,signal:c,onProgress:l,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,baseCDN:m,metadata:b})=>_r(t,{publicKey:e,fileName:r,contentType:s,baseURL:i,secureSignature:o,secureExpire:n,store:a,signal:c,onProgress:l,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,metadata:b}).then(({file:t})=>$r(t,{publicKey:e,baseURL:i,source:u,integration:d,userAgent:h,retryThrottledRequestMaxTimes:p,retryNetworkErrorMaxTimes:g,onProgress:l,signal:c})).then(t=>new Lr(t,{baseCDN:m})))(t,{publicKey:e,fileName:r,contentType:g,baseURL:i,secureSignature:o,secureExpire:n,store:a,signal:s,onProgress:c,source:l,integration:u,userAgent:d,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,baseCDN:v,metadata:k})}if(jr(t))return zr(t,{publicKey:e,fileName:r,baseURL:i,baseCDN:v,checkForUrlDuplicates:y,saveUrlForRecurrentUploads:w,secureSignature:o,secureExpire:n,store:a,signal:s,onProgress:c,source:l,integration:u,userAgent:d,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,pusherKey:_,metadata:k});if(Br(t))return((t,{publicKey:e,fileName:r,baseURL:i,signal:o,onProgress:n,source:a,integration:s,userAgent:c,retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:u,baseCDN:d})=>Ar(t,{publicKey:e,baseURL:i,signal:o,source:a,integration:s,userAgent:c,retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:u}).then(t=>new Lr(t,{baseCDN:d,fileName:r})).then(t=>(n&&n({isComputable:!0,value:1}),t)))(t,{publicKey:e,fileName:r,baseURL:i,signal:s,onProgress:c,source:l,integration:u,userAgent:d,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,baseCDN:v});throw new TypeError(`File uploading from "${t}" is not supported`)}class Gr{uuid;filesCount;totalSize;isStored;isImage;cdnUrl;files;createdAt;storedAt=null;constructor(t,{baseCDN:e=ir.baseCDN}={}){this.uuid=t.id,this.filesCount=t.filesCount;const r=t.files.filter(Boolean);this.totalSize=Object.values(r).reduce((t,e)=>t+e.size,0),this.isStored=!!t.datetimeStored,this.isImage=!!Object.values(r).filter(t=>t.isImage).length,this.cdnUrl=t.cdnUrl,this.files=r.map(t=>new Lr(t,{baseCDN:e})),this.createdAt=t.datetimeCreated,this.storedAt=t.datetimeStored}}function Wr(t,{publicKey:e,fileName:r,baseURL:i=ir.baseURL,secureSignature:o,secureExpire:n,store:a,signal:s,onProgress:c,source:l,integration:u,userAgent:d,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,contentType:g,multipartChunkSize:m=ir.multipartChunkSize,baseCDN:b=ir.baseCDN,checkForUrlDuplicates:f,saveUrlForRecurrentUploads:v,jsonpCallback:y}){if(!(t=>{for(const e of t)if(!dr(e))return!1;return!0})(t)&&!(t=>{for(const e of t)if(!jr(e))return!1;return!0})(t)&&!(t=>{for(const e of t)if(!Br(e))return!1;return!0})(t))throw new TypeError(`Group uploading from "${t}" is not supported`);let w,_=!0;const k=t.length,x=(t,e)=>{if(!c)return;w||(w=Array(t).fill(0));return r=>{if(!r.isComputable||!_)return _=!1,void c({isComputable:!1});var i;w[e]=r.value,c({isComputable:!0,value:(i=w,i.reduce((t,e)=>t+e)/t)})}};return Promise.all(t.map((t,c)=>dr(t)||jr(t)?Kr(t,{publicKey:e,fileName:r,baseURL:i,secureSignature:o,secureExpire:n,store:a,signal:s,onProgress:x(k,c),source:l,integration:u,userAgent:d,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p,contentType:g,multipartChunkSize:m,baseCDN:b,checkForUrlDuplicates:f,saveUrlForRecurrentUploads:v}).then(t=>t.uuid):t)).then(t=>Tr(t,{publicKey:e,baseURL:i,jsonpCallback:y,secureSignature:o,secureExpire:n,signal:s,source:l,integration:u,userAgent:d,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:p}).then(t=>new Gr(t,{baseCDN:b})).then(t=>(c&&c({isComputable:!0,value:1}),t)))}class Zr{_concurrency=1;_pending=[];_running=0;_resolvers=new Map;_rejectors=new Map;constructor(t){this._concurrency=t}run(){const t=this._concurrency-this._running;for(let e=0;e<t;e++){const t=this._pending.shift();if(!t)return;const e=this._resolvers.get(t),r=this._rejectors.get(t);if(!e||!r)throw new Error("Unexpected behavior: resolver or rejector is undefined");this._running+=1,t().finally(()=>{this._resolvers.delete(t),this._rejectors.delete(t),this._running-=1,this.run()}).then(t=>e(t)).catch(t=>r(t))}}add(t,{autoRun:e}={autoRun:!0}){return new Promise((r,i)=>{this._resolvers.set(t,r),this._rejectors.set(t,i),this._pending.push(t),e&&this.run()})}get pending(){return this._pending.length}get running(){return this._running}set concurrency(t){this._concurrency=t,this.run()}get concurrency(){return this._concurrency}}const Xr={button:["toolbar"],checkbox:["toolbar"],menuitem:["menu","menubar"],option:["listbox"],tab:["tablist"]};function Yr(t,e){e.tabIndex=0,e.focus(),t.tabIndex=-1}function Jr(t){let e=t.role||t.type||t.tagName;if(!e)return null;let r=Xr[e.toLowerCase()];if(!r)return null;for(let e of r){let r=t.closest(`[role=${e}]`);if(r)return r}}function Qr(t,e){return"toolbar"===e.role?function(t){let e=[...t.querySelectorAll("*")];return e.filter(t=>"button"===t.role||"button"===t.type||"checkbox"===t.role||"checkbox"===t.type)}(e):e.querySelectorAll(`[role=${t.role}]`)}function ti(t){return e=>{let r=!1,i=t?.searchDelayMs||300,o=0,n="";function a(t){let r=Jr(t.target);if(!r)return void s();let a=Qr(t.target,r),c=Array.from(a).indexOf(t.target),l="ArrowDown",u="ArrowUp";if(function(t){let e=t.getAttribute("aria-orientation");if("vertical"===e)return!1;if("horizontal"===e)return!0;let r=t.role;return"menubar"===r||"tablist"===r||"toolbar"===r}(r)&&("rtl"===e.document.dir?(l="ArrowLeft",u="ArrowRight"):(l="ArrowRight",u="ArrowLeft")),t.key===l)t.preventDefault(),Yr(t.target,a[c+1]||a[0]);else if(t.key===u)t.preventDefault(),Yr(t.target,a[c-1]||a[a.length-1]);else if("Home"===t.key)t.preventDefault(),Yr(t.target,a[0]);else if("End"===t.key)t.preventDefault(),Yr(t.target,a[a.length-1]);else if(1===t.key.length&&"tablist"!==r.role){let e=Date.now();e-o<=i?n+=t.key.toLowerCase():n=t.key.toLowerCase(),o=e;let r=Array.from(a).find(t=>t.textContent?.trim()?.toLowerCase()?.startsWith(n));r&&(t.preventDefault(),Yr(t.target,r))}}function s(){r=!1,e.removeEventListener("keydown",a)}function c(t){let i=Jr(t.target);if(i){r||(r=!0,e.addEventListener("keydown",a));let o=Qr(t.target,i);for(let e of o)e!==t.target&&e.setAttribute("tabindex",-1)}else r&&s()}function l(t){t.relatedTarget&&t.relatedTarget!==e.document||s()}function u(t){let e=Jr(t.target);if(e){let r=Qr(t.target,e);for(let e of r)e!==t.target&&e.setAttribute("tabindex",-1);t.target.setAttribute("tabindex",0)}}return e.addEventListener("click",u),e.addEventListener("focusin",c),e.addEventListener("focusout",l),()=>{s(),e.removeEventListener("click",u),e.removeEventListener("focusin",c),e.removeEventListener("focusout",l)}}}function ei(t){let e,r,i=t.split(" ");function o(t){"Enter"!==t.key||"BUTTON"!==t.target.tagName&&"A"!==t.target.tagName||(n(),t.target.classList.add(...i),e=t.target,r=t.target)}function n(){e&&e.classList.remove(...i),r=null}function a(t){0===t.clientX&&0===t.clientY&&r!==t.target&&(n(),t.target.classList.add(...i),e=t.target)}return t=>(t.addEventListener("click",a),t.addEventListener("keydown",o),t.addEventListener("keyup",n),()=>{t.removeEventListener("click",a),t.removeEventListener("keydown",o),t.removeEventListener("keyup",n)})}function ri(){return t=>{let e=[];function r(){let i=e.pop();if(!i)return void t.document.activeElement.blur();let o=i.deref();o&&o.isConnected?o.focus():r()}let i,o=0;function n(r){clearInterval(i);let n=r.getAttribute("aria-controls");i=setInterval(()=>{if(o++>50)return void clearInterval(i);let r=t.document.getElementById(n);if(r){let o=r.querySelector('a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])');o&&(clearInterval(i),r.dispatchEvent(new t.CustomEvent("keyuxJump",{bubbles:!0})),function(r){let i=t.document.activeElement;i&&i!==t.document.body&&e.push(new WeakRef(i)),r.focus({focusVisible:!0})}(o))}},50)}function a(t){t.target.getAttribute("aria-controls")&&"Enter"===t.key&&n(t.target),"Escape"===t.key&&r()}return t.addEventListener("keydown",a),()=>{t.removeEventListener("keydown",a)}}}function ii(t){return Array.isArray(t)?t.map(t=>"object"==typeof t&&null!==t?ii(t):t):"object"!=typeof t||null===t?t:Object.fromEntries(Object.entries(t).map(([t,e])=>{const r=function(t){return t.replace(/[A-Z]/g,t=>`_${t.toLowerCase()}`).replace(/__/g,"_")}(t);return"object"==typeof e&&null!==e?[r,ii(e)]:[r,e]}))}function oi(t){return{ok:!1,error:t}}class ni{constructor(t="https://tlm.uploadcare.com/api/"){this.baseUrl=t}async base(t,e={}){const r=`${this.baseUrl}${t}`;try{const t=await fetch(r,e);if(!t.ok)return oi(new Error(`Got non-200 response from "${r}". Status: ${t.status.toString()}`));try{const e=await t.json();return{ok:!0,value:e}}catch(t){return oi(new Error(`Error parsing JSON from "${r}". Error: ${t}`))}}catch(t){return oi(new Error(`Error fetching data from "${r}". Error: ${t}`))}}async post(t,e,r={}){return await this.base(t,{...r,method:"POST",body:JSON.stringify(ii(e)),headers:{"Content-Type":"application/json",...r.headers||{}}})}async get(t,e={}){return await this.base(t,{method:"GET",...e})}}class ai extends ni{constructor(){super()}async sendEvent(t,e){const r=await(async(t,e)=>({success:!0,data:e}))(0,t);if(!r.success)throw console.error("TelemetryAPIService: events: body is invalid",r.error),new Error("TelemetryAPIService: events: body is invalid");return this.post("v1/events",t,e)}}const si=t=>{if(t<=0n)return"0";let e="";for(;t>0n;){e="0123456789abcdefghijklmnopqrstuvwxyz"[Number(t%36n)]+e,t/=36n}return e},ci=async t=>{const e=await(async t=>{const e=(new TextEncoder).encode(t),r=await window.crypto.subtle.digest("SHA-256",e),i=Array.from(new Uint8Array(r)).map(t=>t.toString(16).padStart(2,"0")).join("");return BigInt(`0x${i}`)})(t);return si(e).slice(0,10)},li=async(t,e)=>((t,e)=>{const r=new URL(e);return r.hostname=`${t}.${r.hostname}`,r.toString().replace(/\/$/,"")})(await ci(t),e),ui=()=>{const t=[];return{stack:t,promiseReadJpegChunks:e=>new Promise((r,i)=>{let o=2;const n=(t,e)=>{const r=new FileReader;r.addEventListener("load",()=>{e(new DataView(r.result))}),r.addEventListener("error",t=>{i(`Reader error: ${t}`)}),r.readAsArrayBuffer(t)},a=()=>n(e.slice(o,o+128),t=>{let e,r,i;for(e=r=0,i=t.byteLength;i>=0?r<i:r>i;e=i>=0?++r:--r)if(255===t.getUint8(e)){o+=e;break}s()}),s=()=>{const s=o;return n(e.slice(o,o+=4),c=>{if(4!==c.byteLength||255!==c.getUint8(0))return void i("Corrupted");const l=c.getUint8(1);if(218===l)return void r(!0);const u=c.getUint16(2)-2;return n(e.slice(o,o+=u),e=>{e.byteLength===u?(t.push({startPos:s,length:u,marker:l,view:e}),a()):i("Corrupted")})})};FileReader&&DataView||i("Not Support"),n(e.slice(0,2),t=>{65496!==t.getUint16(0)&&i("Not jpeg"),a()})})}},di=async t=>{const e=[],{promiseReadJpegChunks:r,stack:i}=ui();return await r(t),i.forEach(({marker:t,view:r})=>{226===t&&1229144927===r.getUint32(0)&&1347571526===r.getUint32(4)&&1229735168===r.getUint32(8)&&e.push(r)}),e},hi=async(t,e,r)=>{{const i=[],o=[],{promiseReadJpegChunks:n,stack:a}=ui();await n(t),a.forEach(t=>{if(t.marker===e)return i.push(t.startPos),o.push(t.length)});const s=[t.slice(0,2)];for(const t of r){const r=new DataView(new ArrayBuffer(4));r.setUint16(0,65280+e),r.setUint16(2,t.byteLength+2),s.push(r.buffer),s.push(t)}let c=2;for(let e=0;e<i.length;e++)i[e]>c&&s.push(t.slice(c,i[e])),c=i[e]+o[e]+4;return s.push(t.slice(c,t.size)),new Blob(s,{type:t.type})}},pi=(t,e)=>hi(t,226,e.map(t=>t.buffer)),gi=()=>{const t=document.createElement("canvas"),e=t.getContext("2d");return{canvas:t,ctx:e}},mi=async t=>{let e=null;const{promiseReadJpegChunks:r,stack:i}=ui();return await r(t),i.forEach(({marker:t,view:r})=>{!e&&225===t&&r.byteLength>=14&&1165519206===r.getUint32(0)&&0===r.getUint16(4)&&(e=r)}),e};let bi;const fi=t=>((t,e)=>new Promise((r,i)=>{e&&(t.src=e),t.complete?r(t):(t.addEventListener("load",()=>{r(t)}),t.addEventListener("error",()=>{i(new Error("Failed to load image. Probably not an image."))}))}))(new Image,t),vi=[1,3],yi=[192,193,194,195,197,198,199,201,202,203,205,206,207],wi={squareSide:[Math.floor(Math.sqrt(5e6)),4096,8192,11180,10836,11402,14188,16384],dimension:[4096,8192,16384,32767,65535]},_i=(t,e)=>{const r={};return(...i)=>{const o=e(i,r);return o in r?r[o]:r[o]=t(...i)}},ki=(t,e)=>{const[r]=t,i=Object.keys(e).map(t=>parseInt(t,10)).sort((t,e)=>t-e);for(let t=0;t<i.length;t++){const o=i[t],n=!!e[o];if(o>r&&n)return o;if(o<r&&!n)return o}return r},xi=55,Ci=110,Ei=165,Ti=255,Ai=`rgba(${xi}, ${Ci}, ${Ei}, ${Ti/255})`,Ii=(t,e)=>{try{const r=[t-1,e-1,1,1],{canvas:i,ctx:o}=gi();i.width=1,i.height=1;const{canvas:n,ctx:a}=gi();n.width=t,n.height=e,a&&(a.fillStyle=Ai,a.fillRect(...r),o.drawImage(n,t-1,e-1,1,1,0,0,1,1));const s=o&&o.getImageData(0,0,1,1).data;let c=!1;return s&&(c=s[0]===xi&&s[1]===Ci&&s[2]===Ei&&s[3]===Ti),n.width=n.height=1,c}catch(r){return console.error(`Failed to test for max canvas size of ${t}x${e}.`),!1}};function Si(t){return(...e)=>new Promise(r=>{setTimeout(()=>{const i=t(...e);r(i)},0)})}const Mi=Si(_i(Ii,ki)),$i=Si(_i(Ii,ki)),Li=async(t,e)=>{const r=wi.squareSide.find(r=>r*r>=t*e),i=wi.dimension.find(r=>r>=t&&r>=e);if(!r||!i)throw new Error("Not supported");const[o,n]=await Promise.all([Mi(r,r),$i(i,1)]);if(o&&n)return!0;throw new Error("Not supported")},Oi=async(t,e,r)=>{try{const{ctx:i,canvas:o}=gi();return o.width=e,o.height=r,i.imageSmoothingQuality="high",i.drawImage(t,0,0,e,r),t instanceof HTMLImageElement&&(t.src="//:0"),t instanceof HTMLCanvasElement&&(t.width=t.height=1),o}catch(t){throw new Error("Canvas resize error",{cause:t})}},Ui=({img:t,sourceW:e,targetW:r,targetH:i,step:o})=>{const n=function({sourceW:t,targetW:e,targetH:r,step:i}){const o=[];let n=e,a=r;do{o.push([n,a]),n=Math.round(n/i),a=Math.round(a/i)}while(n<t*i);return o.reverse()}({sourceW:e,targetW:r,targetH:i,step:o});return n.reduce((t,[e,r],i)=>t.then(t=>Li(e,r).then(()=>Oi(t,e,r)).catch(()=>{if(i===n.length-1)throw new Error("Not supported");return t})),Promise.resolve(t))},Ri=navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),Pi=.71,Ni=(t,e)=>{if(t.width*Pi*t.height*Pi<e.size)throw new Error("Not required");const r=t.width,i=t.height,o=r/i,n=Math.floor(Math.sqrt(e.size*o)),a=Math.floor(e.size/Math.sqrt(e.size*o));return Li(n,a).then(()=>{const{ctx:e}=gi();return"imageSmoothingQuality"in e&&!(/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform))&&!Ri?(({img:t,targetW:e,targetH:r})=>Oi(t,e,r))({img:t,targetW:n,targetH:a}):Ui({img:t,sourceW:r,targetW:n,targetH:a,step:Pi})}).catch(()=>Promise.reject("Not supported"))},Di=async(t,e)=>{try{if(await(async t=>{let e=!1;const{promiseReadJpegChunks:r,stack:i}=ui();return await r(t).then(()=>(i.forEach(({marker:t,view:r})=>{if(!e&&yi.indexOf(t)>=0){const t=r.getUint8(5);vi.indexOf(t)<0&&(e=!0)}}),e)).catch(()=>e)})(t))throw new Error("Should skipped");const r=await Promise.allSettled([mi(t),new Promise(t=>{if(void 0!==bi)t(bi);else{const e=new Image;e.addEventListener("load",()=>{bi=e.naturalWidth<e.naturalHeight,e.src="//:0",t(bi)}),e.src="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k="}}),di(t)]),i=!r.some(t=>"rejected"===t.status),[o,n,a]=r,s=await(async t=>{try{return await pi(t,[])}catch(t){throw new Error(`Failed to strip ICC profile: ${t}`)}})(t).catch(()=>t),c=await fi(URL.createObjectURL(s));URL.revokeObjectURL(c.src);const l=await Ni(c,e);let u="image/jpeg",d=e?.quality||.8;!i&&(t=>{const{ctx:e,canvas:r}=gi();r.width=r.height=50,e.drawImage(t,0,0,50,50);const i=e.getImageData(0,0,50,50).data;r.width=r.height=1;for(let t=3;t<i.length;t+=4)if(i[t]<254)return!0;return!1})(l)&&(u="image/png",d=void 0);let h=await((t,e,r)=>new Promise((i,o)=>{t.toBlob(t=>{t?i(t):o("Failed to convert canvas to blob")},e,r),t.width=t.height=1}))(l,u,d);if(i&&"fulfilled"===o.status&&o.value){const t=o.value,e="fulfilled"===n.status&&n.value;h=await(async(t,e,r)=>(r&&((t,e)=>{((t,e)=>{let r,i,o,n;if(t&&!(t.byteLength<14)&&1165519206===t.getUint32(0)&&0===t.getUint16(4)){if(18761===t.getUint16(6))i=!0;else{if(19789!==t.getUint16(6))return;i=!1}if(42===t.getUint16(8,i))for(o=8+t.getUint32(10,i),r=0,n=t.getUint16(o-2,i);n>=0?r<n:r>n;n>=0?++r:--r){if(t.byteLength<o+10)return;274===t.getUint16(o,i)&&e(o+8,i),o+=12}}})(t,(r,i)=>t.setUint16(r,e,i))})(e,1),hi(t,225,[e.buffer])))(h,t,e)}return i&&"fulfilled"===a.status&&a.value.length>0&&(h=await pi(h,a.value)),h}catch(t){let e;throw t instanceof Error&&(e=t.message),"string"==typeof t&&(e=t),new Error("Failed to shrink image. "+(e?`Message: "${e}".`:""),{cause:t})}};var zi=Object.freeze({INIT_SOLUTION:"init-solution",CHANGE_CONFIG:"change-config",ACTION_EVENT:"action-event",ERROR_EVENT:"error-event"}),Vi=Object.freeze({FILE_ADDED:"file-added",FILE_REMOVED:"file-removed",FILE_UPLOAD_START:"file-upload-start",FILE_UPLOAD_PROGRESS:"file-upload-progress",FILE_UPLOAD_SUCCESS:"file-upload-success",FILE_UPLOAD_FAILED:"file-upload-failed",FILE_URL_CHANGED:"file-url-changed",MODAL_OPEN:"modal-open",MODAL_CLOSE:"modal-close",DONE_CLICK:"done-click",UPLOAD_CLICK:"upload-click",ACTIVITY_CHANGE:"activity-change",COMMON_UPLOAD_START:"common-upload-start",COMMON_UPLOAD_PROGRESS:"common-upload-progress",COMMON_UPLOAD_SUCCESS:"common-upload-success",COMMON_UPLOAD_FAILED:"common-upload-failed",CHANGE:"change",GROUP_CREATED:"group-created"}),Fi=class{_timeoutStore=new Map;_targets=new Set;_debugPrint=null;constructor(t){this._debugPrint=t}bindTarget(t){this._targets.add(t)}unbindTarget(t){this._targets.delete(t)}_dispatch(t,e){for(const r of this._targets)r.dispatchEvent(new CustomEvent(t,{detail:e}));this._debugPrint?.(()=>{const r=e&&"object"==typeof e?{...e}:e;return[`event "${t}"`,r]})}emit(t,e,r={}){const{debounce:i}=r;if("number"!=typeof i&&!i)return void this._dispatch(t,"function"==typeof e?e():e);this._timeoutStore.has(t)&&window.clearTimeout(this._timeoutStore.get(t));const o="number"==typeof i?i:20,n=window.setTimeout(()=>{this._dispatch(t,"function"==typeof e?e():e),this._timeoutStore.delete(t)},o);this._timeoutStore.set(t,n)}};function Bi(t,e){let r;const i=(...i)=>{r&&clearTimeout(r),r=setTimeout(()=>t(...i),e)};return i.cancel=()=>{r&&clearTimeout(r)},i}var ji=t=>t?t.split(",").map(t=>t.trim()).filter(Boolean):[],Hi=t=>t.join(","),qi=t=>{if("string"!=typeof t||!t)return"";let e=t.trim();return e.startsWith("-/")?e=e.slice(2):e.startsWith("/")&&(e=e.slice(1)),e.endsWith("/")&&(e=e.slice(0,e.length-1)),e},Ki=(...t)=>t.filter(t=>"string"==typeof t&&!!t).map(t=>qi(t)).join("/-/"),Gi=(...t)=>{const e=Ki(...t);return e?`-/${e}/`:""};function Wi(t){const e=new URL(t),r=e.pathname+e.search+e.hash,i=r.lastIndexOf("http"),o=r.lastIndexOf("/");let n="";return i>=0?n=r.slice(i):o>=0&&(n=r.slice(o+1)),n}function Zi(t){const e=new URL(t),{pathname:r}=e,i=r.indexOf("/"),o=r.indexOf("/",i+1);return r.substring(i+1,o)}function Xi(t){const e=Ji(t),r=new URL(e),i=r.pathname.indexOf("/-/");if(-1===i)return"";return r.pathname.substring(i).slice(1)}function Yi(t){return Xi(t).split("/-/").filter(Boolean).map(t=>qi(t))}function Ji(t){const e=new URL(t),r=Wi(t),i=Qi(r)?to(r).pathname:r;return e.pathname=e.pathname.replace(i,""),e.search="",e.hash="",e.toString()}function Qi(t){return t.startsWith("http")}function to(t){const e=new URL(t);return{pathname:`${e.origin}${e.pathname??""}`,search:e.search??"",hash:e.hash??""}}var eo=(t,e,r)=>{const i=new URL(Ji(t)),o=r??Wi(t),n=e??"";if(i.pathname.startsWith("//")&&(i.pathname=i.pathname.replace("//","/")),o&&Qi(o)){const t=to(o);i.pathname=`${i.pathname}${n}${t.pathname||""}`,i.search=t.search,i.hash=t.hash}else i.pathname=`${i.pathname}${n}${o||""}`;return i.toString()},ro=(t,e)=>{const r=new URL(t);return r.pathname=`${e}/`,r.toString()},io=(t,e=",")=>t.trim().split(e).map(t=>t.trim()).filter(t=>t.length>0),oo=Object.freeze({brightness:0,exposure:0,gamma:100,contrast:0,saturation:0,vibrance:0,warmth:0,enhance:0,filter:0,rotate:0,mirror:!1,flip:!1,crop:void 0}),no=["enhance","brightness","exposure","gamma","contrast","saturation","vibrance","warmth","filter","mirror","flip","rotate","crop"];function ao(t){return Ki(...no.filter(e=>void 0!==t[e]&&null!==t[e]).map(e=>function(t,e){if("number"==typeof e){const r=e;return oo[t]!==r?`${t}/${r}`:""}if("boolean"==typeof e){const r=e;return oo[t]!==r?`${t}`:""}if("filter"===t&&e){const{name:r,amount:i}=e;return oo.filter===i?"":`${t}/${r}/${i}`}if("crop"===t&&e){const{dimensions:r,coords:i}=e;return`${t}/${r.join("x")}/${i.join(",")}`}return""}(e,t[e])).filter(t=>!!t))}var so=Ki("format/auto","progressive/yes"),co=([t])=>void 0!==t?Number(t):void 0,lo=()=>!0,uo=Object.freeze({enhance:co,brightness:co,exposure:co,gamma:co,contrast:co,saturation:co,vibrance:co,warmth:co,filter:([t,e])=>({name:t,amount:void 0!==e?Number(e):100}),mirror:lo,flip:lo,rotate:co,crop:t=>{const[e,r]=t,{dimensions:i,coords:o}=(([t,e])=>{if(!/\d+x\d+/.test(t)||!/\d+,\d+/.test(e))throw new Error("Crop by aspect ratio, percentage or alignment shortcuts is not supported.");return{dimensions:io(t,"x").map(Number),coords:io(e).map(Number)}})([e,r]);return{dimensions:i,coords:o}}});function ho(t){const e={};for(const r of t){const[t,...i]=r.split("/");if(!t||!no.includes(t))continue;const o=t,n=uo[o];try{const t=n(i);e[o]=t}catch(t){console.warn([`Failed to parse URL operation "${r}". It will be ignored.`,t instanceof Error?`Error message: "${t.message}"`:t,"If you need this functionality, please feel free to open an issue at https://github.com/uploadcare/blocks/issues/new"].join("\n"))}}return e}var po=Object.freeze({CROP:"crop",TUNING:"tuning",FILTERS:"filters"}),go=Object.freeze([po.CROP,po.TUNING,po.FILTERS]),mo=Object.freeze(["brightness","exposure","gamma","contrast","saturation","vibrance","warmth","enhance"]),bo=Object.freeze(["adaris","briaril","calarel","carris","cynarel","cyren","elmet","elonni","enzana","erydark","fenralan","ferand","galen","gavin","gethriel","iorill","iothari","iselva","jadis","lavra","misiara","namala","nerion","nethari","pamaya","sarnar","sedis","sewen","sorahel","sorlen","tarian","thellassan","varriel","varven","vevera","virkas","yedis","yllara","zatvel","zevcen"]),fo=Object.freeze(["rotate","mirror","flip"]),vo=oo,yo=Object.freeze({brightness:{zero:vo.brightness,range:[-100,100],keypointsNumber:2},exposure:{zero:vo.exposure,range:[-500,500],keypointsNumber:2},gamma:{zero:vo.gamma,range:[0,1e3],keypointsNumber:2},contrast:{zero:vo.contrast,range:[-100,500],keypointsNumber:2},saturation:{zero:vo.saturation,range:[-100,500],keypointsNumber:1},vibrance:{zero:vo.vibrance,range:[-100,500],keypointsNumber:1},warmth:{zero:vo.warmth,range:[-100,100],keypointsNumber:1},enhance:{zero:vo.enhance,range:[0,100],keypointsNumber:1},filter:{zero:vo.filter,range:[0,100],keypointsNumber:1}}),wo="https://ucarecdn.com",_o={pubkey:"",multiple:!0,multipleMin:0,multipleMax:Number.MAX_SAFE_INTEGER,confirmUpload:!1,imgOnly:!1,accept:"",externalSourcesPreferredTypes:"",externalSourcesEmbedCss:"",store:"auto",cameraMirror:!1,cameraCapture:"",sourceList:"local, url, camera, dropbox, gdrive",topLevelOrigin:"",cloudImageEditorTabs:Hi(go),maxLocalFileSizeBytes:0,thumbSize:76,showEmptyList:!1,useLocalImageEditor:!1,useCloudImageEditor:!0,removeCopyright:!1,cropPreset:"",imageShrink:"",modalScrollLock:!0,modalBackdropStrokes:!1,sourceListWrap:!0,remoteTabSessionKey:"",cdnCname:wo,cdnCnamePrefixed:"https://ucarecd.net",baseUrl:"https://upload.uploadcare.com",socialBaseUrl:"https://social.uploadcare.com",secureSignature:"",secureExpire:"",secureDeliveryProxy:"",retryThrottledRequestMaxTimes:10,retryNetworkErrorMaxTimes:3,multipartMinFileSize:26214400,multipartChunkSize:5242880,maxConcurrentRequests:10,multipartMaxConcurrentRequests:4,multipartMaxAttempts:3,checkForUrlDuplicates:!1,saveUrlForRecurrentUploads:!1,groupOutput:!1,userAgentIntegration:"",debug:!1,metadata:null,localeName:"en",localeDefinitionOverride:null,secureUploadsExpireThreshold:6e5,secureUploadsSignatureResolver:null,secureDeliveryProxyUrlResolver:null,iconHrefResolver:null,fileValidators:[],collectionValidators:[],validationTimeout:15e3,validationConcurrency:100,cameraModes:"photo, video",defaultCameraMode:null,enableAudioRecording:!0,enableVideoRecording:null,maxVideoRecordingDuration:null,mediaRecorderOptions:null,filesViewMode:"list",gridShowFileNames:!1,cloudImageEditorAutoOpen:!1,cloudImageEditorMaskHref:null,testMode:!1,qualityInsights:!0},ko=Object.freeze(_o),xo=(t,e)=>new Intl.PluralRules(t).select(e),Co=t=>t,Eo="{{",To="}}",Ao="plural:";function Io(t,e={},r={}){const{openToken:i=Eo,closeToken:o=To,transform:n=Co}=r;for(const r in e){const a=e[r],s=null!=a?a.toString():void 0,c="string"==typeof s?n(s):String(s);t=t.replaceAll(i+r+o,c)}return t}var So="--uploadcare-blocks-window-height",Mo=class t{static clientsRegistry=new Set;static flush=Bi(()=>{document.documentElement.style.setProperty(So,`${window.innerHeight}px`)},100);static registerClient(e){0===t.clientsRegistry.size&&t.attachTracker(),t.clientsRegistry.add(e)}static unregisterClient(e){t.clientsRegistry.delete(e),0===t.clientsRegistry.size&&t.detachTracker()}static attachTracker(){window.addEventListener("resize",t.flush,{passive:!0,capture:!0}),t.flush()}static detachTracker(){window.removeEventListener("resize",t.flush,{capture:!0}),document.documentElement.style.removeProperty(So)}},$o=t=>({"*currentActivity":null,"*currentActivityParams":{},"*history":[],"*historyBack":null,"*closeModal":()=>{t.modalManager?.close(t.$["*currentActivity"]),t.set$({"*currentActivity":null})}}),Lo=t=>({...$o(t),"*commonProgress":0,"*uploadList":[],"*uploadQueue":new Zr(1),"*collectionErrors":[],"*collectionState":null,"*groupInfo":null,"*uploadTrigger":new Set,"*secureUploadsManager":null}),Oo={"locale-id":"en","social-source-lang":"en","upload-file":"Upload file","upload-files":"Upload files","choose-file":"Choose file","choose-files":"Choose files","drop-files-here":"Drop files here","select-file-source":"Select file source",selected:"Selected",upload:"Upload","add-more":"Add more",cancel:"Cancel","start-from-cancel":"Cancel",clear:"Clear","camera-shot":"Shot","upload-url":"Import","upload-url-placeholder":"Paste link here","edit-image":"Edit image","edit-detail":"Details",back:"Back",done:"Done",ok:"Ok","remove-from-list":"Remove",no:"No",yes:"Yes","confirm-your-action":"Confirm your action","are-you-sure":"Are you sure?","selected-count":"{{count}} of {{total}} selected","select-all":"Select all","deselect-all":"Deselect all","upload-error":"Upload error","validation-error":"Validation error","no-files":"No files selected",browse:"Browse","not-uploaded-yet":"Not uploaded yet...",file__one:"file",file__other:"files",error__one:"error",error__other:"errors","header-uploading":"Uploading {{count}} {{plural:file(count)}}","header-failed":"{{count}} {{plural:error(count)}}","header-succeed":"{{count}} {{plural:file(count)}} uploaded","header-total":"{{count}} {{plural:file(count)}} selected","src-type-local":"From device","src-type-from-url":"From link","src-type-camera":"Camera","src-type-mobile-video-camera":"Video","src-type-mobile-photo-camera":"Photo","src-type-draw":"Draw","src-type-facebook":"Facebook","src-type-dropbox":"Dropbox","src-type-gdrive":"Google Drive","src-type-ngdrive":"Google Drive","src-type-gphotos":"Google Photos","src-type-flickr":"Flickr","src-type-vk":"VK","src-type-evernote":"Evernote","src-type-box":"Box","src-type-onedrive":"OneDrive","src-type-huddle":"Huddle","src-type-other":"Other","caption-from-url":"Import from link","caption-camera":"Camera","caption-draw":"Draw","caption-edit-file":"Edit file","file-no-name":"No name...","toggle-fullscreen":"Toggle fullscreen","toggle-guides":"Toggle guides",rotate:"Rotate","flip-vertical":"Flip vertical","flip-horizontal":"Flip horizontal",apply:"Apply",brightness:"Brightness",contrast:"Contrast",saturation:"Saturation",exposure:"Exposure",gamma:"Gamma",vibrance:"Vibrance",warmth:"Warmth",enhance:"Enhance",original:"Original",resize:"Resize image",crop:"Crop","select-color":"Select color",text:"Text",draw:"Draw","cancel-edit":"Cancel edit","tab-view":"Preview","tab-details":"Details","file-name":"Name","file-size":"Size","cdn-url":"CDN URL","file-size-unknown":"Unknown","camera-permissions-denied":"Camera access denied","camera-permissions-prompt":"Please allow access to the camera","camera-permissions-request":"Request access","files-count-limit-error-title":"Files count limit overflow","files-count-limit-error-too-few":"You’ve chosen {{total}} {{plural:file(total)}}. At least {{min}} {{plural:file(min)}} required.","files-count-limit-error-too-many":"You’ve chosen too many files. {{max}} {{plural:file(max)}} is maximum.","files-max-size-limit-error":"File is too big. Max file size is {{maxFileSize}}.","has-validation-errors":"File validation error occurred. Please, check your files before upload.","images-only-accepted":"Only image files are accepted.","file-type-not-allowed":"Uploading of these file types is not allowed.","some-files-were-not-uploaded":"Some files were not uploaded.","file-item-edit-button":"Edit","file-item-remove-button":"Remove","a11y-editor-tab-filters":"Filters","a11y-editor-tab-tuning":"Tuning","a11y-editor-tab-crop":"Crop","a11y-activity-header-button-close":"Close",flip:"Flip",mirror:"Mirror","a11y-cloud-editor-apply-filter":"Apply {{name}} filter","a11y-cloud-editor-apply-crop":"Apply {{name}} operation","a11y-cloud-editor-apply-tuning":"Apply {{name}} tuning","a11y-cloud-editor-apply-aspect-ratio":"Apply operation {{name}} {{value}}",finished:"Finished",failed:"Failed",uploading:"Uploading",idle:"Idle","a11y-file-item-status":"File {{fileName}} in status {{status}}","waiting-for":"Waiting for {{source}}","queued-uploading":"Queued for upload","queued-validation":"Queued for validation",validation:"Validating","crop-to-shape":"Crop to {{value}}",custom:"Freeform","freeform-crop":"Freeform crop"},Uo=new Map,Ro=new Map,Po=(t,e)=>{Uo.has(t)&&console.log(`Locale ${t} is already defined. Overwriting...`),Uo.set(t,{...Oo,...e})},No=(t,e)=>{"function"==typeof e?((t,e)=>{Ro.set(t,e)})(t,e):Po(t,e)};No("en",Oo);var Do=t=>`*l10n/${t}`,zo=class{_blockInstance=null;_localeName="";_callbacks=new Set;_boundBlocks=new Map;constructor(t){this._blockInstance=t;for(const[t,e]of Object.entries(Oo)){const r=!this._blockInstance.has(Do(t))||!this._blockInstance.$[Do(t)];this._blockInstance.add(Do(t),e,r)}setTimeout(()=>{t.subConfigValue("localeName",async t=>{if(!this._blockInstance||!t)return;this._localeName=t;const e=await(async t=>{if(!Uo.has(t)){if(!Ro.has(t))throw new Error(`Locale ${t} is not defined`);const e=Ro.get(t),r=await e();Po(t,r)}return Uo.get(t)})(t);if("en"!==t&&this._localeName!==t)return;const r=this._blockInstance.cfg.localeDefinitionOverride?.[t];for(const[t,i]of Object.entries(e)){const e=r?.[t];this._blockInstance.add(Do(t),e??i,!0);for(const t of this._callbacks)t()}}),t.subConfigValue("localeDefinitionOverride",t=>{if(!t)return;const e=t[this._localeName];if(e)for(const[t,r]of Object.entries(e)){this._blockInstance?.add(Do(t),r,!0);for(const t of this._callbacks)t()}})})}onLocaleChange(t){const e=Bi(t,0);return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}bindL10n(t,e,r){t.$[e]=r(),this._boundBlocks.has(t)||this._boundBlocks.set(t,new Map),this._boundBlocks.get(t)?.get(e)?.();const i=this.onLocaleChange(()=>{t.$[e]=r()});this._boundBlocks.get(t)?.set(e,i)}destroyL10nBindings(t){const e=this._boundBlocks.get(t);if(e){for(const t of e.values())t();this._boundBlocks.delete(t)}}destroy(){this._callbacks.clear()}};function Vo(t,e){[...t.querySelectorAll("[l10n]")].forEach(t=>{const r=t.getAttribute("l10n");if(!r)return;const i=r.split(";");for(const r of i)r&&Fo(t,r,e)})}var Fo=(t,e,r)=>{let i="textContent",o=!1;if(e.includes(":")){const t=e.split(":");if(2!==t.length)return void console.warn(`l10n attribute value should be in format "property:key" or "key". Found: ${e}`);const r=t;i=r[0],e=r[1],i.startsWith("@")&&(i=i.slice(1),o=!0)}const n=e;r.has(n)&&r.sub(n,e=>{if(!e)return;r.l10nProcessorSubs.has(n)||r.l10nProcessorSubs.set(n,new Set);const o=r.l10nProcessorSubs.get(n);o?.forEach(t=>{t.remove(),o.delete(t),r.allSubs.delete(t)});const a=Do(e).replace("*","");r.nodeCtx.has(a)||r.nodeCtx.add(a,e);const s=r.nodeCtx.sub(a,()=>{t[i]=r.l10n(e)});o?.add(s),r.allSubs.add(s),t.removeAttribute("l10n")});const a=Do(e);r.has(a)||r.add(a,""),r.sub(a,()=>{o?t.setAttribute(i,r.l10n(e)):t[i]=r.l10n(e)}),t.removeAttribute("l10n")},Bo=class{_listeners=new Map;_scope=[];addEventListener(t,e){const r=t=>{const r=t.target;r instanceof Node&&this._scope.some(t=>t===r||t.contains(r))&&e(t)};this._listeners.set(e,r),window.addEventListener(t,r)}removeEventListener(t,e){const r=this._listeners.get(e);r&&window.removeEventListener(t,r),this._listeners.delete(e)}get CustomEvent(){return window.CustomEvent}get document(){return window.document}get navigator(){return window.navigator}registerScope(t){this._scope.push(t)}destroy(){this._scope=[];for(const t of this._listeners.values())window.removeEventListener("keydown",t),window.removeEventListener("keyup",t);this._listeners.clear()}},jo=class{_destroyKeyUX;_scopedWindow;constructor(){this._scopedWindow=new Bo,this._destroyKeyUX=function(t,e){let r=e.map(e=>e(t));return()=>{r.forEach(t=>t())}}(this._scopedWindow,[ti(),ei("is-pressed"),ri(),t=>{let e,r;function i(t){if("true"===t.target.getAttribute("aria-hidden")){e=t.target,e.setAttribute("aria-hidden","false"),r=e.hidden,r&&(e.hidden=!1);let i=t.target.querySelector('a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])');i&&(i.tabIndex=0)}}function o(t){!e||!e.contains(t.target)||t.relatedTarget&&e.contains(t.relatedTarget)||(t.target.tabIndex=-1,e.setAttribute("aria-hidden","true"),r&&(e.hidden=!0),e=null)}return t.addEventListener("keyuxJump",i),t.addEventListener("focusout",o),()=>{t.removeEventListener("keyuxJump",i),t.removeEventListener("focusout",o)}}])}registerBlock(t){this._scopedWindow.registerScope(t)}destroy(){this._destroyKeyUX?.(),this._scopedWindow.destroy()}},Ho=Object.freeze({ADD:"modal:add",DELETE:"modal:delete",OPEN:"modal:open",CLOSE:"modal:close",CLOSE_ALL:"modal:closeAll",DESTROY:"modal:destroy"}),qo=class{_modals=new Map;_activeModals=new Set;_subscribers=new Map;_block;constructor(t){this._block=t}_debugPrint(...t){this._block.debugPrint("[modal-manager]",...t)}registerModal(t,e){this._modals.set(t,e),this._notify(Ho.ADD,{id:t,modal:e})}deleteModal(t){if(!this._modals.has(t))return!1;const e=this._modals.get(t);return this._modals.delete(t),this._activeModals.delete(t),this._notify(Ho.DELETE,{id:t,modal:e}),!0}open(t){if(!this._modals.has(t))return this._debugPrint(`Modal with ID "${t}" not found`),!1;const e=this._modals.get(t);return this._activeModals.add(t),this._notify(Ho.OPEN,{modal:e,id:t}),!0}close(t){if(!this._modals.has(t)||!this._activeModals.has(t))return this._debugPrint(`Modal with ID "${t}" not found or not active`),!1;const e=this._modals.get(t);return this._activeModals.delete(t),this._notify(Ho.CLOSE,{id:t,modal:e}),!0}toggle(t){return this._modals.has(t)?this._activeModals.has(t)?this.close(t):this.open(t):(this._debugPrint(`Modal with ID "${t}" not found`),!1)}get hasActiveModals(){return this._activeModals.size>0}back(){if(0===this._activeModals.size)return this._debugPrint("No active modals to go back from"),!1;const t=Array.from(this._activeModals).pop();return!!t&&this.close(t)}closeAll(){const t=this._activeModals.size;return this._activeModals.clear(),this._notify(Ho.CLOSE_ALL,{}),t}subscribe(t,e){return this._subscribers.has(t)||this._subscribers.set(t,new Set),this._subscribers.get(t)?.add(e),()=>this.unsubscribe(t,e)}unsubscribe(t,e){this._subscribers.has(t)&&this._subscribers.get(t)?.delete(e)}_notify(t,e){if(this._subscribers.has(t))for(const r of this._subscribers.get(t)??new Set)try{r(e)}catch(t){this._block.telemetryManager.sendEventError(t,"modal subscriber"),this._debugPrint("Error in modal subscriber:",t)}}destroy(){this.closeAll(),this._modals.clear(),this._subscribers.clear(),this._notify(Ho.DESTROY,{})}},Ko="blocks",Go="1.24.5",Wo=class{_sessionId=crypto.randomUUID();_telemetryInstance;_block;_config=structuredClone(ko);_initialized=!1;_lastPayload=null;_queue;constructor(t){this._block=t,this._telemetryInstance=new ai,this._queue=new Zr(10);for(const t of Object.keys(this._config))this._block.subConfigValue(t,e=>{this._initialized&&this._config[t]!==e&&this.sendEvent({eventType:zi.CHANGE_CONFIG}),this._setConfig(t,e)})}_init(t){t!==zi.INIT_SOLUTION||this._initialized||(this._initialized=!0)}_setConfig(t,e){this._config[t]!==e&&(this._config[t]=e)}_formattingPayload(t){const e=t.payload?{...t.payload}:{};e.activity&&(e.activity=void 0);const r={...t};return t.eventType!==zi.INIT_SOLUTION&&t.eventType!==zi.CHANGE_CONFIG||(r.config=this._config),{...r,appVersion:Go,appName:Ko,sessionId:this._sessionId,component:this._solution,activity:this._activity,projectPubkey:this._config.pubkey,userAgent:navigator.userAgent,eventType:r.eventType??"",eventTimestamp:this._timestamp,payload:{location:this._location,...e}}}_excludedEvents(t){return!(!t||![Vi.CHANGE,Vi.COMMON_UPLOAD_PROGRESS,Vi.FILE_ADDED,Vi.FILE_REMOVED,Vi.FILE_UPLOAD_START,Vi.FILE_UPLOAD_PROGRESS,Vi.FILE_UPLOAD_SUCCESS,Vi.FILE_UPLOAD_FAILED].includes(t))}sendEvent(t){const e=this._formattingPayload({eventType:t.eventType,payload:t.payload,config:t.config});this._init(t.eventType);if(this._excludedEvents(t.eventType))return;this._lastPayload&&this._checkObj(this._lastPayload,e)||this._queue.add(async()=>{this._lastPayload=e,await this._telemetryInstance.sendEvent(e)})}sendEventError(t,e="unknown"){this.sendEvent({eventType:zi.ERROR_EVENT,payload:{metadata:{event:"error",text:`Error in ${e}`,error:t.message}}})}sendEventCloudImageEditor(t,e,r={}){this.sendEvent({eventType:zi.ACTION_EVENT,payload:{metadata:{tabId:e,node:t.currentTarget?.tagName,event:t.type,...r}}})}_checkObj(t,e){if(JSON.stringify(t)===JSON.stringify(e))return!0;if("object"!=typeof t||"object"!=typeof e||null==t||null==e)return!1;const r=Object.keys(t),i=Object.keys(e);if(r.length!==i.length)return!1;for(const i of r){if(!Object.hasOwn(e,i))return!1;if(!this._checkObj(t[i],e[i]))return!1}return!0}get _timestamp(){return Date.now()}get _solution(){if(!this._block.has("*solution"))return null;const t=this._block.$["*solution"];return t?t.toLowerCase():null}get _activity(){return this._block.has("*currentActivity")?this._block.$["*currentActivity"]??null:null}get _location(){return location.origin}},Zo=t=>`*cfg/${t}`;function Xo(t,e){const r=t.querySelectorAll("[data-testid]");if(0===r.length)return;const i=new WeakMap;for(const t of r){const e=t.getAttribute("data-testid");e&&i.set(t,e)}e.subConfigValue("testMode",t=>{if(!t){for(const t of r)t.removeAttribute("data-testid");return}const o=e.testId;for(const t of r){const e=i.get(t);e&&t.setAttribute("data-testid",`${o}--${e}`)}})}var Yo=class extends Ne{__cfgProxy;l10nProcessorSubs=new Map;static StateConsumerScope=null;static styleAttrs=[];requireCtxName=!1;activityType=null;init$={};l10n(t,e={}){if(!t)return"";const r=this.$[Do(t)]||t,i=function(t){const e=[];let r=t.indexOf(Eo);for(;-1!==r;){const i=t.indexOf(To,r);if(-1===i)break;const o=t.substring(r+2,i);if(o.startsWith(Ao)){const n=t.substring(r+2,i).replace(Ao,""),a=n.substring(0,n.indexOf("(")),s=n.substring(n.indexOf("(")+1,n.indexOf(")"));e.push({variable:o,pluralKey:a,countVariable:s})}r=t.indexOf(Eo,i)}return e}(r);for(const t of i)e[t.variable]=this.pluralize(t.pluralKey,Number(e[t.countVariable]));return Io(r,e)}pluralize(t,e){const r=this.l10n("locale-id")||"en",i=xo(r,e);return this.l10n(`${t}__${i}`)}bindL10n(t,e){this.localeManager?.bindL10n(this,t,e)}constructor(){super(),this.addTemplateProcessor(Vo),this.addTemplateProcessor(Xo)}emit(t,e,r){const i=this.has("*eventEmitter")?this.$["*eventEmitter"]:void 0;i&&(i.emit(t,e,r),this.telemetryManager.sendEvent({eventType:t,payload:"function"==typeof e?e():e}))}hasBlockInCtx(t){for(const e of this.blocksRegistry)if(t(e))return!0;return!1}setOrAddState(t,e){this.add$({[t]:e},!0)}connectedCallback(){this.constructor.styleAttrs.forEach(t=>{this.setAttribute(t,"")}),this.hasAttribute("retpl")&&(this.constructor.template=null,this.processInnerHtml=!0),this.requireCtxName?(({element:t,attribute:e,onSuccess:r,onTimeout:i,timeout:o=300})=>{const n=t.getAttribute(e);if(null!==n)return void r(n);const a=new MutationObserver(t=>{const e=t[t.length-1];e&&c(e)});a.observe(t,{attributes:!0,attributeFilter:[e]});const s=window.setTimeout(()=>{a.disconnect(),i()},o),c=i=>{const o=t.getAttribute(e);"attributes"===i.type&&i.attributeName===e&&null!==o&&(window.clearTimeout(s),a.disconnect(),r(o))}})({element:this,attribute:"ctx-name",onSuccess:()=>{super.connectedCallback()},onTimeout:()=>{console.error("Attribute `ctx-name` is required and it is not set.")}}):super.connectedCallback(),Mo.registerClient(this)}disconnectedCallback(){super.disconnectedCallback(),Mo.unregisterClient(this)}initCallback(){this.has("*blocksRegistry")||this.add("*blocksRegistry",new Set);this.$["*blocksRegistry"].add(this),this.has("*eventEmitter")||this.add("*eventEmitter",new Fi(this.debugPrint.bind(this))),this.has("*localeManager")||this.add("*localeManager",new zo(this)),this.cfg.qualityInsights&&!this.has("*telemetryManager")&&this.add("*telemetryManager",new Wo(this)),this.has("*a11y")||this.add("*a11y",new jo),this.has("*modalManager")||this.add("*modalManager",new qo(this)),this.sub(Do("locale-id"),t=>{const e=(t=>{const e=new Intl.Locale(t);let r="ltr";const i=e.getTextInfo?.().direction;return i?r=i:e.textInfo?.direction&&(r=e.textInfo.direction),r})(t);this.style.direction="ltr"===e?"":e}),this.subConfigValue("testMode",t=>{t&&this.testId?this.setAttribute("data-testid",this.testId):this.removeAttribute("data-testid")})}get testId(){return window.customElements.getName(this.constructor)}get modalManager(){return this.has("*modalManager")?this.$["*modalManager"]:void 0}get telemetryManager(){return this.cfg.qualityInsights?this.has("*telemetryManager")&&this.$["*telemetryManager"]:{sendEvent:()=>{},sendEventCloudImageEditor:()=>{},sendEventError:()=>{}}}get localeManager(){return this.has("*localeManager")?this.$["*localeManager"]:null}get a11y(){return this.has("*a11y")?this.$["*a11y"]:null}get blocksRegistry(){return this.$["*blocksRegistry"]}destroyCallback(){super.destroyCallback();const t=this.blocksRegistry;t?.delete(this),this.localeManager?.destroyL10nBindings(this),this.l10nProcessorSubs=new Map,we.deleteCtx(this),0===t?.size&&setTimeout(()=>{this.destroyCtxCallback()},0)}destroyCtxCallback(){we.deleteCtx(this.ctxName),this.localeManager?.destroy(),this.modalManager?.destroy()}async proxyUrl(t){if(this.cfg.secureDeliveryProxy&&this.cfg.secureDeliveryProxyUrlResolver&&console.warn("Both secureDeliveryProxy and secureDeliveryProxyUrlResolver are set. The secureDeliveryProxyUrlResolver will be used."),this.cfg.secureDeliveryProxyUrlResolver)try{return await this.cfg.secureDeliveryProxyUrlResolver(t,{uuid:Zi(t),cdnUrlModifiers:Xi(t),fileName:Wi(t)})}catch(e){return console.error("Failed to resolve secure delivery proxy URL. Falling back to the default URL.",e),this.telemetryManager.sendEventError(e,"secureDeliveryProxyUrlResolver. Failed to resolve secure delivery proxy URL. Falling back to the default URL."),t}return this.cfg.secureDeliveryProxy?Io(this.cfg.secureDeliveryProxy,{previewUrl:t},{transform:t=>window.encodeURIComponent(t)}):t}get cfg(){if(!this.__cfgProxy){const t=Object.create(null);this.__cfgProxy=new Proxy(t,{set:(t,e,r)=>{if("string"!=typeof e)return!1;const i=Zo(e);return this.has(i)||this.add(i,ko[e]),this.$[i]=r,!0},get:(t,e)=>{const r=Zo(e);return this.has(r)||this.add(r,ko[e]),this.$[Zo(e)]}})}return this.__cfgProxy}subConfigValue(t,e){const r=Zo(t);this.has(r)||this.add(r,ko[t]),this.sub(r,e)}debugPrint(...t){if(!this.cfg.debug)return;let e=t;if("function"==typeof t?.[0]){e=(0,t[0])()}console.log(`[${this.ctxName}]`,...e)}static reg(t){t?t.startsWith("uc-")&&super.reg(t):super.reg()}},Jo="active",Qo="___ACTIVITY_IS_ACTIVE___",tn=class t extends Yo{historyTracked=!1;[Qo];init$=$o(this);_debouncedHistoryFlush=Bi(this._historyFlush.bind(this),10);_deactivate(){const e=t._activityCallbacks.get(this);this[Qo]=!1,this.removeAttribute(Jo),e?.deactivateCallback?.()}_activate(){const e=t._activityCallbacks.get(this);this.$["*historyBack"]=this.historyBack.bind(this),this[Qo]=!0,this.setAttribute(Jo,""),e?.activateCallback?.(),this._debouncedHistoryFlush(),this.emit(Vi.ACTIVITY_CHANGE,{activity:this.activityType})}initCallback(){super.initCallback(),this.activityType&&(this.hasAttribute("activity")||this.setAttribute("activity",this.activityType),this.sub("*currentActivity",t=>{try{this.activityType!==t&&this[Qo]?this._deactivate():this.activityType!==t||this[Qo]||this._activate()}catch(t){this.telemetryManager.sendEventError(t,`activity "${this.activityType}"`),console.error(`Error in activity "${this.activityType}". `,t),this.$["*currentActivity"]=this.$["*history"][this.$["*history"].length-1]??null}t||(this.$["*history"]=[])}))}_historyFlush(){let t=this.$["*history"];t&&(t.length>10&&(t=t.slice(t.length-11,t.length-1)),this.historyTracked&&t[t.length-1]!==this.activityType&&t.push(this.activityType),this.$["*history"]=t)}_isActivityRegistered(){return!!this.activityType&&t._activityCallbacks.has(this)}static _activityCallbacks=new Map;static activities;get isActivityActive(){return!!this[Qo]}get couldOpenActivity(){return!0}registerActivity(e,r={}){const{onActivate:i,onDeactivate:o}=r;t._activityCallbacks.set(this,{activateCallback:i,deactivateCallback:o})}unregisterActivity(){this.isActivityActive&&this._deactivate(),t._activityCallbacks.delete(this)}destroyCallback(){super.destroyCallback(),this._isActivityRegistered()&&this.unregisterActivity();const e=this.$["*currentActivity"];!![...this.blocksRegistry].find(r=>r instanceof t&&r.activityType===e)||(this.$["*currentActivity"]=null,this.modalManager?.closeAll())}get activityKey(){return this.ctxName+this.activityType}get activityParams(){return this.$["*currentActivityParams"]}get initActivity(){return this.getCssData("--cfg-init-activity")}get doneActivity(){return this.getCssData("--cfg-done-activity")}historyBack(){const t=this.$["*history"];if(t){let e=t.pop();for(;e===this.activityType;)e=t.pop();let r=!!e;if(e){const t=[...this.blocksRegistry].find(t=>t.activityType===e);r=t?.couldOpenActivity??!1}e=r?e:void 0,e&&this.modalManager?.open(e),this.$["*currentActivity"]=e,this.$["*history"]=t,e||this.modalManager?.closeAll()}}};function en(t){for(const e in t){let r=[...e].reduce((t,e)=>(e.toUpperCase()===e&&(e=`-${e.toLowerCase()}`),t+=e),"");r.startsWith("-")&&(r=r.replace("-","")),r.startsWith("uc-")||(r=`uc-${r}`),t[e].reg&&t[e].reg(r)}}tn.activities=Object.freeze({START_FROM:"start-from",CAMERA:"camera",DRAW:"draw",UPLOAD_LIST:"upload-list",URL:"url",CLOUD_IMG_EDIT:"cloud-image-edit",EXTERNAL:"external"});var rn="UC";function on(t,e=!1){return new Promise((r,i)=>{if("object"!=typeof document)return void r(null);if("object"==typeof window&&window[rn])return void r(window[rn]);const o=document.createElement("script");o.async=!0,o.src=t,o.onerror=()=>{i()},o.onload=()=>{const t=window[rn];e&&en(t),r(t)},document.head.appendChild(o)})}var nn=class extends Yo{static styleAttrs=["uc-wgt-common"];requireCtxName=!0;init$=(t=>({...Lo(t),"*solution":null}))(this);static _template="";initCallback(){super.initCallback(),this.a11y?.registerBlock(this)}static set template(t){this._template="<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>"+t+"<slot></slot>"}static get template(){return this._template}},an=1.5,sn=100/3;function cn(t,e){for(const[r,i]of Object.entries(e))t.setAttributeNS(null,r,i.toString())}function ln(t,e={}){const r=document.createElementNS("http://www.w3.org/2000/svg",t);return cn(r,e),r}function un(t,e,r){const{x:i,y:o,width:n,height:a}=t,s=e.includes("w")?0:1,c=e.includes("n")?0:1,l=0===s?-1:1,u=0===c?-1:1,d=[i+s*n+an*l,o+c*a+an*u-24*r*u],h=[i+s*n+an*l,o+c*a+an*u],p=[i+s*n-24*r*l+an*l,o+c*a+an*u];return{d:`M ${d[0]} ${d[1]} L ${h[0]} ${h[1]} L ${p[0]} ${p[1]}`,center:[h[0],h[1]]}}function dn(t,e,r){const{x:i,y:o,width:n,height:a}=t,s="n"===e||"s"===e,c=s?.5:"w"===e?0:1,l="w"===e||"e"===e?.5:"n"===e?0:1,u="w"===e?-1:"e"===e?1:0,d="n"===e?-1:"s"===e?1:0;let h,p;s?(h=[i+c*n-34*r/2,o+l*a+an*d],p=[i+c*n+34*r/2,o+l*a+an*d]):(h=[i+c*n+an*u,o+l*a-34*r/2],p=[i+c*n+an*u,o+l*a+34*r/2]);return{d:`M ${h[0]} ${h[1]} L ${p[0]} ${p[1]}`,center:[(h[0]+p[0])/2,(h[1]+p[1])/2]}}function hn(t,e){let{x:r}=t,{y:i}=t;return t.x<e.x?r=e.x:t.x+t.width>e.x+e.width&&(r=e.x+e.width-t.width),t.y<e.y?i=e.y:t.y+t.height>e.y+e.height&&(i=e.y+e.height-t.height),{...t,x:r,y:i}}function pn({direction:t,...e}){switch(t){case"n":return function({rect:t,delta:e,aspectRatio:r,imageBox:i}){const[,o]=e;let{y:n,width:a,height:s}=t;n+=o,s-=o,r&&(a=s*r);let c=t.x+t.width/2-a/2;return n<=i.y&&(n=i.y,s=t.y+t.height-n,r&&(a=s*r,c=t.x+t.width/2-a/2)),c<=i.x&&(c=i.x,n=t.y+t.height-s),c+a>=i.x+i.width&&(c=Math.max(i.x,i.x+i.width-a),a=i.x+i.width-c,r&&(s=a/r),n=t.y+t.height-s),s<1&&(s=1,r&&(a=s*r,c=t.x+t.width/2-a/2),n=t.y+t.height-s),a<1&&(a=1,r&&(s=a/r,c=t.x+t.width/2-a/2),n=t.y+t.height-s),{x:c,y:n,width:a,height:s}}(e);case"w":return function({rect:t,delta:e,aspectRatio:r,imageBox:i}){const[o]=e;let{x:n,width:a,height:s}=t;n+=o,a-=o,r&&(s=a/r);let c=t.y+t.height/2-s/2;return n<=i.x&&(n=i.x,a=t.x+t.width-n,r&&(s=a/r,c=t.y+t.height/2-s/2)),c<=i.y&&(c=i.y,n=t.x+t.width-a),c+s>=i.y+i.height&&(c=Math.max(i.y,i.y+i.height-s),s=i.y+i.height-c,r&&(a=s*r),n=t.x+t.width-a),s<1&&(s=1,r&&(a=s*r),c=t.y+t.height/2-s/2,n=t.x+t.width-a),a<1&&(a=1,r&&(s=a/r),c=t.y+t.height/2-s/2,n=t.x+t.width-a),{x:n,y:c,width:a,height:s}}(e);case"s":return function({rect:t,delta:e,aspectRatio:r,imageBox:i}){const[,o]=e;let{y:n,width:a,height:s}=t;s+=o,r&&(a=s*r);let c=t.x+t.width/2-a/2;return n+s>=i.y+i.height&&(s=i.y+i.height-n,r&&(a=s*r),c=t.x+t.width/2-a/2),c<=i.x&&(c=i.x,n=t.y),c+a>=i.x+i.width&&(c=Math.max(i.x,i.x+i.width-a),a=i.x+i.width-c,r&&(s=a/r),n=t.y),s<1&&(s=1,r&&(a=s*r),c=t.x+t.width/2-a/2),a<1&&(a=1,r&&(s=a/r),c=t.x+t.width/2-a/2),{x:c,y:n,width:a,height:s}}(e);case"e":return function({rect:t,delta:e,aspectRatio:r,imageBox:i}){const[o]=e;let{x:n,width:a,height:s}=t;a+=o,r&&(s=a/r);let c=t.y+t.height/2-s/2;return n+a>=i.x+i.width&&(a=i.x+i.width-n,r&&(s=a/r),c=t.y+t.height/2-s/2),c<=i.y&&(c=i.y,n=t.x),c+s>=i.y+i.height&&(c=Math.max(i.y,i.y+i.height-s),s=i.y+i.height-c,r&&(a=s*r),n=t.x),s<1&&(s=1,r&&(a=s*r),c=t.y+t.height/2-s/2),a<1&&(a=1,r&&(s=a/r),c=t.y+t.height/2-s/2),{x:n,y:c,width:a,height:s}}(e);case"nw":return function({rect:t,delta:e,aspectRatio:r,imageBox:i}){let[o,n]=e,{x:a,y:s,width:c,height:l}=t;return a+o<i.x&&(o=i.x-a),s+n<i.y&&(n=i.y-s),a+=o,c-=o,s+=n,l-=n,r&&Math.abs(c/l)>r?(n=c/r-l,l+=n,s-=n,s<=i.y&&(l-=i.y-s,c=l*r,a=t.x+t.width-c,s=i.y)):r&&(o=l*r-c,c+=o,a-=o,a<=i.x&&(c-=i.x-a,l=c/r,a=i.x,s=t.y+t.height-l)),l<1&&(l=1,r&&(c=l*r),a=t.x+t.width-c,s=t.y+t.height-l),c<1&&(c=1,r&&(l=c/r),a=t.x+t.width-c,s=t.y+t.height-l),{x:a,y:s,width:c,height:l}}(e);case"ne":return function({rect:t,delta:e,aspectRatio:r,imageBox:i}){let[o,n]=e,{x:a,y:s,width:c,height:l}=t;return a+c+o>i.x+i.width&&(o=i.x+i.width-a-c),s+n<i.y&&(n=i.y-s),c+=o,s+=n,l-=n,r&&Math.abs(c/l)>r?(n=c/r-l,l+=n,s-=n,s<=i.y&&(l-=i.y-s,c=l*r,a=t.x,s=i.y)):r&&(o=l*r-c,c+=o,a+c>=i.x+i.width&&(c=i.x+i.width-a,l=c/r,a=i.x+i.width-c,s=t.y+t.height-l)),l<1&&(l=1,r&&(c=l*r),s=t.y+t.height-l),c<1&&(c=1,r&&(l=c/r),s=t.y+t.height-l),{x:a,y:s,width:c,height:l}}(e);case"sw":return function({rect:t,delta:e,aspectRatio:r,imageBox:i}){let[o,n]=e,{x:a,y:s,width:c,height:l}=t;return a+o<i.x&&(o=i.x-a),s+l+n>i.y+i.height&&(n=i.y+i.height-s-l),a+=o,c-=o,l+=n,r&&Math.abs(c/l)>r?(n=c/r-l,l+=n,s+l>=i.y+i.height&&(l=i.y+i.height-s,c=l*r,a=t.x+t.width-c,s=i.y+i.height-l)):r&&(o=l*r-c,c+=o,a-=o,a<=i.x&&(c-=i.x-a,l=c/r,a=i.x,s=t.y)),l<1&&(l=1,r&&(c=l*r),a=t.x+t.width-c),c<1&&(c=1,r&&(l=c/r),a=t.x+t.width-c),{x:a,y:s,width:c,height:l}}(e);case"se":return function({rect:t,delta:e,aspectRatio:r,imageBox:i}){let[o,n]=e,{x:a,y:s,width:c,height:l}=t;return a+c+o>i.x+i.width&&(o=i.x+i.width-a-c),s+l+n>i.y+i.height&&(n=i.y+i.height-s-l),c+=o,l+=n,r&&Math.abs(c/l)>r?(n=c/r-l,l+=n,s+l>=i.y+i.height&&(l=i.y+i.height-s,c=l*r,a=t.x,s=i.y+i.height-l)):r&&(o=l*r-c,c+=o,a+c>=i.x+i.width&&(c=i.x+i.width-a,l=c/r,a=i.x+i.width-c,s=t.y)),l<1&&(l=1,r&&(c=l*r)),c<1&&(c=1,r&&(l=c/r)),{x:a,y:s,width:c,height:l}}(e);default:return e.rect}}function gn({width:t,height:e},r){const i=r/90%2!=0;return{width:i?e:t,height:i?t:e}}function mn(t,e,r){let i,o;t/e>r?(i=Math.round(e*r),o=e):(i=t,o=Math.round(t/r));const n=Math.round((t-i)/2),a=Math.round((e-o)/2);return n+i>t&&(i=t-n),a+o>e&&(o=e-a),{x:n,y:a,width:i,height:o}}function bn(t){return{x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width),height:Math.round(t.height)}}function fn(t,e,r){return Math.min(Math.max(t,e),r)}var vn=["free"],yn=t=>{const e=io(t);if(!e||0===e.length)return[];const r=[];for(const t of e){const e=t.trim();if(!e)continue;const i=e.indexOf(":");if(-1===i&&!vn.includes(e)){console.warn(`Invalid crop preset: ${e}`);continue}const o=Number(e.slice(0,i)),n=Number(e.slice(i+1));!(!Number.isFinite(o)||!Number.isFinite(n)||o<=0||n<=0)||vn.includes(e)?r.push({id:xe.generate(),type:"aspect-ratio",width:vn.includes(e)?0:o,height:vn.includes(e)?0:n,hasFreeform:vn.includes(e)}):console.warn(`Invalid crop preset: ${e}`)}return r},wn=Object.freeze({FACEBOOK:"facebook",DROPBOX:"dropbox",GDRIVE:"gdrive",GPHOTOS:"gphotos",FLICKR:"flickr",VK:"vk",EVERNOTE:"evernote",BOX:"box",ONEDRIVE:"onedrive",HUDDLE:"huddle"}),_n=Object.freeze({MOBILE_VIDEO_CAMERA:"mobile-video-camera",MOBILE_PHOTO_CAMERA:"mobile-photo-camera"}),kn=Object.freeze({LOCAL:"local",DROP_AREA:"drop-area",CAMERA:"camera",EXTERNAL:"external",API:"js-api",URL:"url",DRAW:"draw",..._n,...wn});function xn(t){return Ze({...t,libraryName:Ko,libraryVersion:Go})}var Cn=t=>"number"!=typeof t?0:Math.floor(t/1e3),En=class{_block;_secureToken=null;constructor(t){this._block=t}_debugPrint(...t){this._block.debugPrint("[secure-uploads]",...t)}async getSecureToken(){const{secureSignature:t,secureExpire:e,secureUploadsSignatureResolver:r}=this._block.cfg;if((t||e)&&r&&console.warn("Both secureSignature/secureExpire and secureUploadsSignatureResolver are set. secureUploadsSignatureResolver will be used."),r){if(!this._secureToken||((t,{threshold:e})=>{const{secureExpire:r}=t,i=Cn(Date.now()),o=Number(r);return i+Cn(e)>=o})(this._secureToken,{threshold:this._block.cfg.secureUploadsExpireThreshold})){this._secureToken?this._debugPrint("Secure signature is expired. Resolving a new one..."):this._debugPrint("Secure signature is not set yet.");try{const t=await r();t?t.secureSignature&&t.secureExpire?(this._debugPrint("Secure signature resolved:",t),this._debugPrint("Secure signature will expire in",new Date(1e3*Number(t.secureExpire)).toISOString()),this._secureToken=t):console.error("Secure signature resolver returned an invalid result:",t):(this._debugPrint("Secure signature resolver returned nothing."),this._secureToken=null)}catch(t){console.error("Secure signature resolving failed. Falling back to the previous one.",t),this._block.telemetryManager.sendEventError(t,"secureUploadsSignatureResolver. Secure signature resolving failed. Falling back to the previous one.")}}return this._secureToken}return t&&e?(this._debugPrint("Secure signature and expire are set. Using them...",{secureSignature:t,secureExpire:e}),{secureSignature:t,secureExpire:e}):null}},Tn=(t,e)=>{if(t.failedCount>0)return{type:"SOME_FILES_HAS_ERRORS",message:e.l10n("some-files-were-not-uploaded")}},An=(t,e)=>{const r=t.totalCount,i=e.cfg.multiple?e.cfg.multipleMin:0,o=e.cfg.multiple?e.cfg.multipleMax:1;if(i&&r<i){return{type:"TOO_FEW_FILES",message:e.l10n("files-count-limit-error-too-few",{min:i,max:o,total:r}),payload:{total:r,min:i,max:o}}}if(o&&r>o){return{type:"TOO_MANY_FILES",message:e.l10n("files-count-limit-error-too-many",{min:i,max:o,total:r}),payload:{total:r,min:i,max:o}}}},In={safariDesktop:(()=>{const t=navigator.userAgent;return/Macintosh|Windows/.test(t)&&/Version\/[\d.]+.*Safari/.test(t)&&!/Chrome|Chromium|Edg|OPR/.test(t)})()},Sn={htmlMediaCapture:"capture"in document.createElement("input")},Mn="image/*",$n="video/*",Ln=In.safariDesktop?[Mn]:[Mn,...["image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/avif","image/avif-sequence",".heif",".heifs",".heic",".heics",".avif",".avifs"]],On=t=>t?t.filter(t=>"string"==typeof t).flatMap(t=>io(t)):[],Un=(t,e)=>e.some(e=>{if(e.endsWith("*")){const r=e.replace("*","");return t.startsWith(r)}return t===e}),Rn=t=>{const e=t?.type;return!!e&&Un(e,Ln)},Pn=(t,e)=>{const r=e.cfg.imgOnly,i=e.cfg.accept,o=On([...r?Ln:[],i]);if(!o.length)return;const n=t.mimeType,a=t.name;if(!n||!a)return;const s=Un(n,o),c=((t,e)=>e.some(e=>!!e.startsWith(".")&&t.toLowerCase().endsWith(e.toLowerCase())))(a,o);return s||c?void 0:{type:"FORBIDDEN_FILE_TYPE",message:e.l10n("file-type-not-allowed"),payload:{entry:t}}},Nn=(t,e)=>{const r=e.cfg.imgOnly,i=t.isImage;if(r&&!i&&(t.fileInfo||!t.externalUrl)&&(t.fileInfo||t.mimeType))return{type:"NOT_AN_IMAGE",message:e.l10n("images-only-accepted"),payload:{entry:t}}},Dn=1e3,zn=Object.freeze({AUTO:"auto",BYTE:"byte",KB:"kb",MB:"mb",GB:"gb",TB:"tb",PB:"pb"}),Vn=t=>Math.ceil(100*t)/100,Fn=(t,e=zn.AUTO)=>{const r=e===zn.AUTO;if(e===zn.BYTE||r&&t<1e3){return`${t} ${"one"===xo("en-US",t)?"byte":"bytes"}`}return e===zn.KB||r&&t<1e6?`${Vn(t/1e3)} KB`:e===zn.MB||r&&t<Dn**3?`${Vn(t/1e6)} MB`:e===zn.GB||r&&t<Dn**4?`${Vn(t/Dn**3)} GB`:e===zn.TB||r&&t<Dn**5?`${Vn(t/Dn**4)} TB`:`${Vn(t/Dn**5)} PB`},Bn=(t,e)=>{const r=e.cfg.maxLocalFileSizeBytes,i=t.size;if(r&&i&&i>r)return{type:"FILE_SIZE_EXCEEDED",message:e.l10n("files-max-size-limit-error",{maxFileSize:Fn(r)}),payload:{entry:t}}},jn=(t,e)=>{const{internalId:r}=t,i=e._uploadCollection.read(r),o=i?.getValue("uploadError");if(!o)return;if(o instanceof gr)return{type:"UPLOAD_ERROR",message:o.message,payload:{entry:t,error:o}};if(o instanceof Qe)return{type:"NETWORK_ERROR",message:o.message,payload:{entry:t,error:o}};const n=o instanceof Error?o:new Error("Unknown error",{cause:o});return{type:"UNKNOWN_ERROR",message:n.message,payload:{entry:t,error:n}}},Hn="File validator execution has failed",qn="File validator execution has timed out",Kn="Collection validator execution has failed",Gn="Missing message. We recommend adding message: value.",Wn=t=>"function"==typeof t?{runOn:"change",validator:t}:t,Zn=class{_blockInstance;_uploadCollection;_commonFileValidators=[Nn,Pn,Bn,jn];_commonCollectionValidators=[An,Tn];_queue=new Zr(20);_runQueueDebounced=Bi(()=>{this._queue.run()},500);_entryValidationState=new Map;constructor(t){this._blockInstance=t,this._uploadCollection=this._blockInstance.uploadCollection;const e=()=>{this.runFileValidators("change"),this.runCollectionValidators()};this._blockInstance.subConfigValue("maxLocalFileSizeBytes",e),this._blockInstance.subConfigValue("multipleMin",e),this._blockInstance.subConfigValue("multipleMax",e),this._blockInstance.subConfigValue("multiple",e),this._blockInstance.subConfigValue("imgOnly",e),this._blockInstance.subConfigValue("accept",e),this._blockInstance.subConfigValue("validationConcurrency",t=>{this._queue.concurrency=t})}runFileValidators(t,e){const r=e??this._uploadCollection.items();for(const e of r){const r=this._uploadCollection.read(e);r&&this._runFileValidatorsForEntry(r,t)}}runCollectionValidators(){const t=this._blockInstance.api.getOutputCollectionState(),e=[];for(const r of[...this._commonCollectionValidators,...this._blockInstance.cfg.collectionValidators])try{const i=r(t,this._blockInstance.api);if(!i)continue;i&&(e.push(this._addCustomTypeToValidationError(i)),i.message||console.warn(Gn))}catch(t){console.warn(Kn,t)}this._blockInstance.$["*collectionErrors"]=e,e.length>0&&this._blockInstance.emit(Vi.COMMON_UPLOAD_FAILED,()=>this._blockInstance.api.getOutputCollectionState(),{debounce:!0})}cleanupValidationForEntry(t){const e=this._entryValidationState.get(t.uid);e&&(e.abortController?.abort(),this._entryValidationState.delete(t.uid))}async _runFileValidatorsForEntry(t,e){const r=this._getValidatorDescriptorsForEntry(t,e);if(0===r.length)return;t.setMultipleValues({isQueuedForValidation:!0,isValidationPending:!0});const i=this._blockInstance.api.getOutputItem(t.uid),o=this._getEntryValidationState(t);o.promise&&await o.promise;const{promise:n,resolve:a}=(()=>{let t=()=>{},e=()=>{};return{promise:new Promise((r,i)=>{t=r,e=i}),resolve:t,reject:e}})();o.promise=n;const s=new AbortController;o.abortController=s;const c=this._blockInstance.cfg.validationTimeout,l=this._getValidatorDescriptors(),u=new Set(r.map(t=>t.validator)),d=[];for(const t of l)if(!u.has(t.validator)){const e=o.lastErrorThrownByValidator.get(t.validator);e&&d.push(e)}const h=r.map(t=>async()=>{if(!this._blockInstance.isConnected)return;const e=setTimeout(()=>{o.skippedValidators.add(t.validator),s.abort(),console.warn(qn)},c);try{const e=await t.validator(i,this._blockInstance.api,{signal:s.signal});if(!e||s.signal.aborted)return void o.lastErrorThrownByValidator.set(t.validator,void 0);const r=this._addCustomTypeToValidationError(e);o.lastErrorThrownByValidator.set(t.validator,r),d.push(r),e.message||console.warn(Gn)}catch(e){s.signal.aborted||(o.skippedValidators.add(t.validator),console.warn(Hn,e),this._blockInstance.telemetryManager.sendEventError(e,`file validator. ${Hn}`))}finally{clearTimeout(e),"change"!==t.runOn&&o.skippedValidators.add(t.validator)}});if(this._runQueueDebounced(),await this._queue.add(async()=>{t.setValue("isQueuedForValidation",!1),await Promise.all(h.map(t=>t())).catch(()=>{})},{autoRun:!1}),s.signal.aborted)return t.setMultipleValues({isQueuedForValidation:!1,isValidationPending:!1}),void a();t.setMultipleValues({isValidationPending:!1,isQueuedForValidation:!1,errors:d}),a()}_addCustomTypeToValidationError(t){return{...t,type:t.type??"CUSTOM_ERROR"}}_getEntryValidationState(t){const e=this._entryValidationState.get(t.uid);if(e)return e;const r={abortController:void 0,skippedValidators:new WeakSet,promise:void 0,lastErrorThrownByValidator:new WeakMap};return this._entryValidationState.set(t.uid,r),r}_getValidatorDescriptors(){return[...this._commonFileValidators,...this._blockInstance.cfg.fileValidators].map(Wn)}_getValidatorDescriptorsForEntry(t,e){const r=this._getEntryValidationState(t);return this._getValidatorDescriptors().filter(t=>!r.skippedValidators.has(t.validator)).filter(t=>t.runOn===e)}},Xn="[Typed State] Wrong property name: ",Yn=class{__typedSchema;__ctxId;__schema;__data;constructor(t,e){this.__typedSchema=t,this.__ctxId=e||xe.generate(),this.__schema=Object.keys(t).reduce((e,r)=>(t[r]&&(e[r]=t[r].value),e),{}),this.__data=we.registerCtx(this.__schema,this.__ctxId)}get uid(){return this.__ctxId}setValue(t,e){if(!Object.hasOwn(this.__typedSchema,t)||!this.__typedSchema[t])return void console.warn(Xn+t);const r=this.__typedSchema[t],i=e?.constructor===r.type,o=e instanceof r.type,n=r.nullable&&null===e;i||o||n?this.__data.pub(t,e):console.warn("[Typed State] Wrong property type: "+t)}setMultipleValues(t){for(const[e,r]of Object.entries(t))this.setValue(e,r)}getValue(t){return Object.hasOwn(this.__typedSchema,t)||console.warn(Xn+t),this.__data.read(t)}subscribe(t,e){return this.__data.sub(t,e)}remove(){we.deleteCtx(this.__ctxId)}},Jn=class{__typedSchema;__ctxId;__data;__watchList;__subsMap=Object.create(null);__propertyObservers=new Set;__collectionObservers=new Set;__items=new Set;__removed=new Set;__added=new Set;__observeTimeout;__notifyTimeout;__notifyObservers;constructor(t){this.__typedSchema=t.typedSchema,this.__ctxId=t.ctxName||xe.generate(),this.__data=we.registerCtx({},this.__ctxId),this.__watchList=t.watchList||[];let e=Object.create(null);this.__notifyObservers=(t,r)=>{this.__observeTimeout&&window.clearTimeout(this.__observeTimeout),e[t]||(e[t]=new Set),e[t].add(r),this.__observeTimeout=window.setTimeout(()=>{0!==Object.keys(e).length&&(this.__propertyObservers.forEach(t=>{t({...e})}),e=Object.create(null))})},t.handler&&this.observeCollection(t.handler)}notify(){this.__notifyTimeout&&window.clearTimeout(this.__notifyTimeout),this.__notifyTimeout=window.setTimeout(()=>{const t=new Set(this.__added),e=new Set(this.__removed);this.__added.clear(),this.__removed.clear();for(const r of this.__collectionObservers)r?.([...this.__items],t,e)})}observeCollection(t){return this.__collectionObservers.add(t),this.__items.size>0&&this.notify(),()=>{this.unobserveCollection(t)}}unobserveCollection(t){this.__collectionObservers.delete(t)}add(t){const e=new Yn(this.__typedSchema);for(const[r,i]of Object.entries(t))void 0!==i&&e.setValue(r,i);return this.__items.add(e.uid),this.notify(),this.__data.add(e.uid,e),this.__added.add(e),this.__watchList.forEach(t=>{this.__subsMap[e.uid]||(this.__subsMap[e.uid]=[]),this.__subsMap[e.uid]?.push(e.subscribe(t,()=>{this.__notifyObservers(t,e.uid)}))}),e.uid}read(t){return this.__data.read(t)}readProp(t,e){const r=this.read(t);return r?r.getValue(e):(console.warn(`Item with id ${t} not found`),null)}publishProp(t,e,r){const i=this.read(t);i?i.setValue(e,r):console.warn(`Item with id ${t} not found`)}remove(t){const e=this.read(t);e&&this.__removed.add(e),this.__items.delete(t),this.notify(),this.__data.pub(t,null),delete this.__subsMap[t]}clearAll(){this.__items.forEach(t=>{this.remove(t)})}observeProperties(t){return this.__propertyObservers.add(t),()=>{this.unobserveProperties(t)}}unobserveProperties(t){this.__propertyObservers.delete(t)}findItems(t){const e=[];return this.__items.forEach(r=>{const i=this.read(r);i&&t(i)&&e.push(r)}),e}items(){return[...this.__items]}get size(){return this.__items.size}destroy(){we.deleteCtx(this.__ctxId),this.__propertyObservers=new Set,this.__collectionObservers=new Set;for(const t in this.__subsMap)this.__subsMap[t]?.forEach(t=>{t.remove()}),delete this.__subsMap[t]}},Qn=Object.freeze({PHOTO:"photo",VIDEO:"video"}),ta=Object.freeze({IDLE:"idle",SHOT:"shot",PLAY:"play",PAUSE:"pause",RESUME:"resume",STOP:"stop",RETAKE:"retake",ACCEPT:"accept"}),ea=t=>({isVideoRecordingEnabled:ji(t.cameraModes).includes(Qn.VIDEO),isPhotoEnabled:ji(t.cameraModes).includes(Qn.PHOTO)}),ra=new RegExp(`^/?(${/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/i.source})(?:/(-/(?:[^/]+/)+)?([^/]*))?$`,"i");function ia(t){const e=new Map;return(...r)=>{const i=JSON.stringify(r);if(e.has(i))return e.get(i);const o=t(...r);return e.set(i,o),o}}var oa=new Set;function na(t){oa.has(t)||(oa.add(t),console.warn(t))}function aa(t){const e={},r={progress:()=>t.$["*commonProgress"],errors:()=>t.$["*collectionErrors"],group:()=>t.$["*groupInfo"],totalCount:()=>t.uploadCollection.size,failedCount:()=>e.failedEntries.length,successCount:()=>e.successEntries.length,uploadingCount:()=>e.uploadingEntries.length,status:()=>e.isFailed?"failed":e.isUploading?"uploading":e.isSuccess?"success":"idle",isSuccess:()=>e.allEntries.length>0&&0===e.errors.length&&e.successEntries.length===e.allEntries.length,isUploading:()=>e.allEntries.some(t=>"uploading"===t.status),isFailed:()=>e.errors.length>0||e.failedEntries.length>0,allEntries:()=>t.getOutputData(),successEntries:()=>e.allEntries.filter(t=>"success"===t.status),failedEntries:()=>e.allEntries.filter(t=>"failed"===t.status),uploadingEntries:()=>e.allEntries.filter(t=>"uploading"===t.status),idleEntries:()=>e.allEntries.filter(t=>"idle"===t.status)},i=function(t){let e=!1;return setTimeout(()=>{e=!0},0),r=>(...i)=>(e&&na(t),r(...i))}("You're trying to access the OutputCollectionState asynchronously. In this case, the data you retrieve will be newer than it was when the OutputCollectionState was created or when the event was dispatched. If you want to retain the state at a specific moment in time, you should use the spread operator like this: `{...outputCollectionState}` or `{...e.detail}`");for(const[t,o]of Object.entries(r)){const r=t,n=ia(i(o));Object.defineProperty(e,r,{get:n,enumerable:!0})}return e}var sa=class{_ctx;constructor(t){this._ctx=t}get _uploadCollection(){return this._ctx.uploadCollection}get cfg(){return this._ctx.cfg}get l10n(){return this._ctx.l10n.bind(this._ctx)}addFileFromUrl=(t,{silent:e,fileName:r,source:i}={})=>{const o=this._uploadCollection.add({externalUrl:t,fileName:r??null,silent:e??!1,source:i??kn.API});return this.getOutputItem(o)};addFileFromUuid=(t,{silent:e,fileName:r,source:i}={})=>{const o=this._uploadCollection.add({uuid:t,fileName:r??null,silent:e??!1,source:i??kn.API});return this.getOutputItem(o)};addFileFromCdnUrl=(t,{silent:e,fileName:r,source:i}={})=>{const o=(({url:t,cdnBase:e})=>{const r=new URL(e),i=new URL(wo),o=new URL(t);if(r.host!==o.host&&i.host!==o.host)return null;const n=ra.exec(o.pathname);if(!n)return null;const[,a,s,c]=n;return a?{uuid:a,cdnUrlModifiers:s||"",filename:c||null}:null})({url:t,cdnBase:this.cfg.cdnCname});if(!o)throw new Error("Invalid CDN URL");const n=this._uploadCollection.add({uuid:o.uuid,cdnUrl:t,cdnUrlModifiers:o.cdnUrlModifiers,fileName:r??o.filename??null,silent:e??!1,source:i??kn.API});return this.getOutputItem(n)};addFileFromObject=(t,{silent:e,fileName:r,source:i,fullPath:o}={})=>{const n=this._uploadCollection.add({file:t,isImage:Rn(t),mimeType:t.type,fileName:r??t.name,fileSize:t.size,silent:e??!1,source:i??kn.API,fullPath:o??null});return this.getOutputItem(n)};removeFileByInternalId=t=>{if(!this._uploadCollection.read(t))throw new Error(`File with internalId ${t} not found`);this._uploadCollection.remove(t)};removeAllFiles(){this._uploadCollection.clearAll()}uploadAll=()=>{const t=this._uploadCollection.items().filter(t=>{const e=this._uploadCollection.read(t);return!!e&&!(e.getValue("isRemoved")||e.getValue("isUploading")||e.getValue("fileInfo")||0!==e.getValue("errors").length||e.getValue("isValidationPending")||e.getValue("isQueuedForValidation"))});0!==t.length&&(this._ctx.$["*uploadTrigger"]=new Set(t),this._ctx.emit(Vi.COMMON_UPLOAD_START,this.getOutputCollectionState()))};openSystemDialog=(t={})=>{const e=Hi(On([this.cfg.accept??"",...this.cfg.imgOnly?Ln:[]])),r="uploadcare-file-input",i=document.createElement("input");if(i.setAttribute(r,""),ze(i,{opacity:0,height:0,width:0,visibility:"hidden",position:"absolute",top:0,left:0}),i.type="file",i.multiple=this.cfg.multiple,t.captureCamera){i.capture=this.cfg.cameraCapture;const{isPhotoEnabled:e,isVideoRecordingEnabled:r}=ea(this.cfg);t.modeCamera===Qn.PHOTO&&e?i.accept=Mn:t.modeCamera===Qn.VIDEO&&r?i.accept=$n:i.accept=[Mn,r&&$n].filter(Boolean).join(",")}else i.accept=e;i.addEventListener("change",()=>{i.files&&([...i.files].forEach(e=>{this.addFileFromObject(e,{source:t.captureCamera?kn.CAMERA:kn.LOCAL})}),this._ctx.modalManager?.open(tn.activities.UPLOAD_LIST),this._ctx.$["*currentActivity"]=tn.activities.UPLOAD_LIST,i.remove())},{once:!0}),document.querySelectorAll(`[${r}]`).forEach(t=>{t.remove()}),document.body.appendChild(i),i.dispatchEvent(new MouseEvent("click"))};getOutputItem(t){const e=we.getCtx(t).store,r=e.fileInfo,i=e.isRemoved?"removed":e.errors.length>0?"failed":e.fileInfo?"success":e.isUploading?"uploading":"idle";return{uuid:r?.uuid??e.uuid??null,internalId:t,name:r?.originalFilename??e.fileName,size:r?.size??e.fileSize,isImage:r?.isImage??e.isImage,mimeType:r?.mimeType??e.mimeType,file:e.file,externalUrl:e.externalUrl,cdnUrlModifiers:e.cdnUrlModifiers,cdnUrl:e.cdnUrl??r?.cdnUrl??null,fullPath:e.fullPath,uploadProgress:e.uploadProgress,fileInfo:r??null,metadata:e.metadata??r?.metadata??null,isSuccess:"success"===i,isUploading:"uploading"===i,isFailed:"failed"===i,isRemoved:"removed"===i,isValidationPending:e.isValidationPending,errors:e.errors,status:i,source:e?.source}}getOutputCollectionState(){return aa(this._ctx)}initFlow=(t=!1)=>{if(this._uploadCollection.size>0&&!t)this._ctx.modalManager?.open(tn.activities.UPLOAD_LIST),this._ctx.set$({"*currentActivity":tn.activities.UPLOAD_LIST});else if(1===this._sourceList?.length){const t=this._sourceList[0];if("local"===t)return this._ctx.$["*currentActivity"]=tn.activities.UPLOAD_LIST,void this.openSystemDialog();if("camera"===t&&Sn.htmlMediaCapture){const{isPhotoEnabled:t,isVideoRecordingEnabled:e}=ea(this.cfg);if(t&&e)return void this._ctx.set$({"*currentActivity":tn.activities.START_FROM});if(t||e)return void this.openSystemDialog({captureCamera:!0,modeCamera:t?Qn.PHOTO:Qn.VIDEO});this.openSystemDialog({captureCamera:!0,modeCamera:Qn.PHOTO})}const e=[...this._ctx.$["*blocksRegistry"]].find(e=>"type"in e&&e.type===t);e?.activate(),this._ctx.$["*currentActivity"]&&this._ctx.modalManager?.open(this._ctx.$["*currentActivity"])}else this._ctx.modalManager?.open(tn.activities.START_FROM),this._ctx.set$({"*currentActivity":tn.activities.START_FROM})};doneFlow=()=>{this._ctx.set$({"*currentActivity":this._ctx.doneActivity,"*history":this._ctx.doneActivity?[this._ctx.doneActivity]:[]}),this._ctx.$["*currentActivity"]||this._ctx.modalManager?.closeAll()};setCurrentActivity=(t,...e)=>{this._ctx.hasBlockInCtx(e=>e.activityType===t)?this._ctx.set$({"*currentActivityParams":e??{},"*currentActivity":t}):console.warn(`Activity type "${t}" not found in the context`)};getCurrentActivity=()=>this._ctx.$["*currentActivity"];setModalState=t=>{!t||this._ctx.$["*currentActivity"]?t?this._ctx.modalManager?.open(this._ctx.$["*currentActivity"]):(this._ctx.modalManager?.close(this._ctx.$["*currentActivity"]),this._ctx.$["*currentActivity"]=null):console.warn('Can\'t open modal without current activity. Please use "setCurrentActivity" method first.')};get _sourceList(){let t=[];return this.cfg.sourceList&&(t=io(this.cfg.sourceList)),t}},ca=Object.freeze({file:Object.freeze({type:File,value:null,nullable:!0}),externalUrl:Object.freeze({type:String,value:null,nullable:!0}),fileName:Object.freeze({type:String,value:null,nullable:!0}),fileSize:Object.freeze({type:Number,value:null,nullable:!0}),lastModified:Object.freeze({type:Number,value:Date.now()}),uploadProgress:Object.freeze({type:Number,value:0}),uuid:Object.freeze({type:String,value:null,nullable:!0}),isImage:Object.freeze({type:Boolean,value:!1}),mimeType:Object.freeze({type:String,value:null,nullable:!0}),ctxName:Object.freeze({type:String,value:null,nullable:!0}),cdnUrl:Object.freeze({type:String,value:null,nullable:!0}),cdnUrlModifiers:Object.freeze({type:String,value:null,nullable:!0}),fileInfo:Object.freeze({type:Lr,value:null,nullable:!0}),isUploading:Object.freeze({type:Boolean,value:!1}),abortController:Object.freeze({type:AbortController,value:null,nullable:!0}),thumbUrl:Object.freeze({type:String,value:null,nullable:!0}),silent:Object.freeze({type:Boolean,value:!1}),source:Object.freeze({type:String,value:null,nullable:!0}),fullPath:Object.freeze({type:String,value:null,nullable:!0}),metadata:Object.freeze({type:Object,value:null,nullable:!0}),errors:Object.freeze({type:Array,value:[]}),uploadError:Object.freeze({type:Error,value:null,nullable:!0}),isRemoved:Object.freeze({type:Boolean,value:!1}),isQueuedForUploading:Object.freeze({type:Boolean,value:!1}),isValidationPending:Object.freeze({type:Boolean,value:!1}),isQueuedForValidation:Object.freeze({type:Boolean,value:!1})}),la=class t extends tn{static extSrcList;static sourceTypes;couldBeCtxOwner=!1;isCtxOwner=!1;_unobserveCollection;_unobserveCollectionProperties;init$=Lo(this);get hasCtxOwner(){return this.hasBlockInCtx(e=>e instanceof t&&(e.isCtxOwner&&e.isConnected&&e!==this))}initCallback(){if(super.initCallback(),!this.has("*uploadCollection")){const t=new Jn({typedSchema:ca,watchList:["uploadProgress","uploadError","fileInfo","errors","cdnUrl","isUploading","isValidationPending"]});this.add("*uploadCollection",t)}this.has("*publicApi")||this.add("*publicApi",new sa(this)),this.has("*validationManager")||this.add("*validationManager",new Zn(this)),!this.hasCtxOwner&&this.couldBeCtxOwner&&this._initCtxOwner()}get validationManager(){if(!this.has("*validationManager"))throw new Error("Unexpected error: ValidationManager is not initialized");return this.$["*validationManager"]}get api(){if(!this.has("*publicApi"))throw new Error("Unexpected error: UploaderPublicApi is not initialized");return this.$["*publicApi"]}getAPI(){return this.api}get uploadCollection(){if(!this.has("*uploadCollection"))throw new Error("Unexpected error: TypedCollection is not initialized");return this.$["*uploadCollection"]}destroyCtxCallback(){this.uploadCollection.destroy(),this.$["*uploadCollection"]=null,super.destroyCtxCallback()}disconnectedCallback(){super.disconnectedCallback(),this.isCtxOwner&&this._unobserveUploadCollection()}connectedCallback(){super.connectedCallback(),this.isCtxOwner&&this._observeUploadCollection()}destroyCallback(){super.destroyCallback(),this._flushOutputItems.cancel()}_initCtxOwner(){this.isCtxOwner=!0,this._observeUploadCollection(),this.subConfigValue("maxConcurrentRequests",t=>{this.$["*uploadQueue"].concurrency=Number(t)||1}),this.$["*secureUploadsManager"]||(this.$["*secureUploadsManager"]=new En(this))}_observeUploadCollection(){this._unobserveUploadCollection(),this._unobserveCollection=this.uploadCollection.observeCollection(this._handleCollectionUpdate),this._unobserveCollectionProperties=this.uploadCollection.observeProperties(this._handleCollectionPropertiesUpdate)}_unobserveUploadCollection(){this._unobserveCollectionProperties?.(),this._unobserveCollection?.(),this._unobserveCollectionProperties=void 0,this._unobserveCollection=void 0}async _createGroup(t){const e=await this.getUploadClientOptions(),r=t.allEntries.map(t=>t.uuid+(t.cdnUrlModifiers?`/${t.cdnUrlModifiers}`:"")),i=new AbortController,o=await Wr(r,{...e,signal:i.signal});if(this.$["*collectionState"]!==t)return void i.abort();this.$["*groupInfo"]=o;const n=this.api.getOutputCollectionState();this.emit(Vi.GROUP_CREATED,n),this.emit(Vi.CHANGE,()=>this.api.getOutputCollectionState(),{debounce:!0}),this.$["*collectionState"]=n}_flushOutputItems=Bi(async()=>{if(this.getOutputData().length!==this.uploadCollection.size)return;const t=this.api.getOutputCollectionState();this.$["*collectionState"]=t,this.emit(Vi.CHANGE,()=>this.api.getOutputCollectionState(),{debounce:!0}),this.cfg.groupOutput&&t.totalCount>0&&"success"===t.status&&this._createGroup(t)},300);_handleCollectionUpdate=(t,e,r)=>{(e.size||r.size)&&(this.$["*groupInfo"]=null),this.validationManager.runFileValidators("add",[...e].map(t=>t.uid));for(const t of e)t.getValue("silent")||this.emit(Vi.FILE_ADDED,this.api.getOutputItem(t.uid));this.validationManager.runCollectionValidators();for(const t of r){this.$["*uploadTrigger"].delete(t.uid),this.validationManager.cleanupValidationForEntry(t),t.getValue("abortController")?.abort(),t.setMultipleValues({isRemoved:!0,abortController:null,isUploading:!1,uploadProgress:0});const e=t?.getValue("thumbUrl");e&&URL.revokeObjectURL(e),this.emit(Vi.FILE_REMOVED,this.api.getOutputItem(t.uid))}this.$["*uploadList"]=t.map(t=>({uid:t})),this._flushCommonUploadProgress(),this._flushOutputItems()};_handleCollectionPropertiesUpdate=t=>{this._flushOutputItems();const e=this.uploadCollection,r=[...new Set(Object.entries(t).filter(([t])=>["uploadError","fileInfo","cdnUrl","cdnUrlModifiers"].includes(t)).flatMap(([,t])=>[...t]))];if(r.length>0&&setTimeout(()=>{const e=r.filter(e=>t.fileInfo?.has(e)&&!!we.getCtx(e).store.fileInfo);e.length>0&&this.validationManager.runFileValidators("upload",e),this.validationManager.runFileValidators("change",r)}),t.uploadProgress){for(const e of t.uploadProgress){const{isUploading:t,silent:r}=we.getCtx(e).store;t&&!r&&this.emit(Vi.FILE_UPLOAD_PROGRESS,this.api.getOutputItem(e))}this._flushCommonUploadProgress()}if(t.isUploading)for(const e of t.isUploading){const{isUploading:t,silent:r}=we.getCtx(e).store;t&&!r&&this.emit(Vi.FILE_UPLOAD_START,this.api.getOutputItem(e))}if(t.fileInfo){for(const e of t.fileInfo){const{fileInfo:t,silent:r}=we.getCtx(e).store;t&&!r&&this.emit(Vi.FILE_UPLOAD_SUCCESS,this.api.getOutputItem(e))}this.cfg.cropPreset&&this.setInitialCrop(),this.cfg.cloudImageEditorAutoOpen&&this.openCloudImageEditor()}if(t.errors){this.validationManager.runCollectionValidators();for(const e of t.errors){const{errors:t}=we.getCtx(e).store;t.length>0&&(this.emit(Vi.FILE_UPLOAD_FAILED,this.api.getOutputItem(e)),this.emit(Vi.COMMON_UPLOAD_FAILED,()=>this.api.getOutputCollectionState(),{debounce:!0}))}const r=e.findItems(t=>!!t.getValue("fileInfo")),i=e.findItems(t=>t.getValue("errors").length>0);e.size>0&&0===i.length&&e.size===r.length&&0===this.$["*collectionErrors"].length&&this.emit(Vi.COMMON_UPLOAD_SUCCESS,this.api.getOutputCollectionState())}if(t.cdnUrl){[...t.cdnUrl].filter(t=>!!this.uploadCollection.read(t)?.getValue("cdnUrl")).forEach(t=>{this.emit(Vi.FILE_URL_CHANGED,this.api.getOutputItem(t))}),this.$["*groupInfo"]=null}};_flushCommonUploadProgress=()=>{let t=0;const e=[...this.$["*uploadTrigger"]].filter(t=>!!this.uploadCollection.read(t));e.forEach(e=>{const r=this.uploadCollection.readProp(e,"uploadProgress");"number"==typeof r&&(t+=r)});const r=e.length?Math.round(t/e.length):0;this.$["*commonProgress"]!==r&&(this.$["*commonProgress"]=r,this.emit(Vi.COMMON_UPLOAD_PROGRESS,this.api.getOutputCollectionState()))};openCloudImageEditor(){const[t]=this.uploadCollection.findItems(t=>!!t.getValue("fileInfo")&&t.getValue("isImage")).map(t=>this.uploadCollection.read(t));t&&1===this.uploadCollection.size&&this.cfg.useCloudImageEditor&&this.hasBlockInCtx(t=>t.activityType===tn.activities.CLOUD_IMG_EDIT)&&(this.$["*currentActivityParams"]={internalId:t.uid},this.$["*currentActivity"]=tn.activities.CLOUD_IMG_EDIT,this.modalManager?.open(tn.activities.CLOUD_IMG_EDIT))}setInitialCrop(){const t=yn(this.cfg.cropPreset);if(t){const[e]=t,r=this.uploadCollection.findItems(t=>!!t.getValue("fileInfo")&&t.getValue("isImage")&&!t.getValue("cdnUrlModifiers")?.includes("/crop/")).map(t=>this.uploadCollection.read(t)).filter(Boolean);for(const t of r){const r=t.getValue("fileInfo");if(!r||!r.imageInfo){console.warn("Failed to get image info for entry",t.uid);continue}const{width:i,height:o}=r.imageInfo,n=mn(i,o,"number"==typeof e?.width&&"number"==typeof e?.height&&e.width>0&&e.height>0?e.width/e.height:1),a=Gi(`crop/${n.width}x${n.height}/${n.x},${n.y}`,"preview"),s=t.getValue("cdnUrl");s?(t.setMultipleValues({cdnUrlModifiers:a,cdnUrl:eo(s,a)}),1===this.uploadCollection.size&&this.cfg.useCloudImageEditor&&this.hasBlockInCtx(t=>t.activityType===tn.activities.CLOUD_IMG_EDIT)&&(this.$["*currentActivityParams"]={internalId:t.uid},this.$["*currentActivity"]=tn.activities.CLOUD_IMG_EDIT,this.modalManager?.open(tn.activities.CLOUD_IMG_EDIT))):console.warn("Failed to get cdnUrl for entry",t.uid)}}}async getMetadataFor(t){const e=this.cfg.metadata||void 0;if("function"==typeof e){const r=this.api.getOutputItem(t);return await e(r)}return e}async getUploadClientOptions(){const t=this.$["*secureUploadsManager"],e=await t.getSecureToken().catch(()=>null);return{store:this.cfg.store,publicKey:this.cfg.pubkey,baseCDN:this.cfg.cdnCname,baseURL:this.cfg.baseUrl,userAgent:xn,integration:this.cfg.userAgentIntegration,secureSignature:e?.secureSignature,secureExpire:e?.secureExpire,retryThrottledRequestMaxTimes:this.cfg.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:this.cfg.retryNetworkErrorMaxTimes,multipartMinFileSize:this.cfg.multipartMinFileSize,multipartChunkSize:this.cfg.multipartChunkSize,maxConcurrentRequests:this.cfg.multipartMaxConcurrentRequests,multipartMaxAttempts:this.cfg.multipartMaxAttempts,checkForUrlDuplicates:!!this.cfg.checkForUrlDuplicates,saveUrlForRecurrentUploads:!!this.cfg.saveUrlForRecurrentUploads}}getOutputData(){return this.uploadCollection.items().map(t=>this.api.getOutputItem(t))}};la.extSrcList=Object.freeze({...wn}),la.sourceTypes=Object.freeze({...kn});var ua=class extends tn{},da={width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}},ha=["camera","microphone"];function pa(t){return`${Math.floor(t/60).toString().padStart(2,"0")}:${Math.floor(t%60).toString().padStart(2,"0")}`}var ga="image/jpeg",ma="video/webm",ba=class extends la{couldBeCtxOwner=!0;activityType=tn.activities.CAMERA;_unsubPermissions=null;_capturing=!1;_chunks=[];_mediaRecorder=null;_stream=null;_selectedAudioId=null;_selectedCameraId=null;_activeTab=null;_options={};_canvas=null;_ctx=null;_cameraDevices=[];_audioDevices=[];_permissionResponses={};constructor(){super(),this.init$={...this.init$,video:null,videoTransformCss:null,videoHidden:!0,messageHidden:!0,requestBtnHidden:void 0!==navigator.permissions,cameraSelectOptions:null,cameraSelectHidden:!0,l10nMessage:"",switcher:null,panels:null,timer:null,timerHidden:!0,cameraHidden:!0,cameraActionsHidden:!0,audioSelectOptions:null,audioSelectHidden:!0,audioSelectDisabled:!0,audioToggleMicrophoneHidden:!0,tabCameraHidden:!0,tabVideoHidden:!0,currentIcon:"camera-full",currentTimelineIcon:"play",toggleMicrophoneIcon:"microphone",_startTime:0,_elapsedTime:0,_animationFrameId:null,mutableClassButton:"uc-shot-btn uc-camera-action",onCameraSelectChange:t=>{const e=t.target;e&&(this._selectedCameraId=e.value,this._capture())},onAudioSelectChange:t=>{const e=t.target;e&&(this._selectedAudioId=e.value,this._capture())},onCancel:()=>{this.historyBack()},onShot:()=>{this.telemetryManager.sendEvent({eventType:zi.ACTION_EVENT,payload:{metadata:{event:"shot-camera",node:this.tagName,tabId:this._activeTab}}}),this._shot()},onRequestPermissions:()=>this._capture(),onStartCamera:()=>{this.telemetryManager.sendEvent({eventType:zi.ACTION_EVENT,payload:{metadata:{event:"start-camera",node:this.tagName,tabId:this._activeTab}}}),this._chooseActionWithCamera()},onStartRecording:()=>this._startRecording(),onStopRecording:()=>this._stopRecording(),onToggleRecording:()=>this._toggleRecording(),onToggleAudio:()=>this._toggleEnableAudio(),onRetake:()=>{this.telemetryManager.sendEvent({eventType:zi.ACTION_EVENT,payload:{metadata:{event:"retake-camera",node:this.tagName,tabId:this._activeTab}}}),this._retake()},onAccept:()=>{this.telemetryManager.sendEvent({eventType:zi.ACTION_EVENT,payload:{metadata:{event:"accept-camera",node:this.tagName,tabId:this._activeTab}}}),this._accept()},onClickTab:t=>{const e=t.currentTarget,r=e?.getAttribute("data-id");r&&this._handleActiveTab(r)}}}_chooseActionWithCamera=()=>{if(this._activeTab===Qn.PHOTO&&this._shot(),this._activeTab===Qn.VIDEO){if("recording"===this._mediaRecorder?.state)return void this._stopRecording();this._startRecording()}};_updateTimer=()=>{const t=Math.floor((performance.now()-this.$._startTime+this.$._elapsedTime)/1e3);if("number"==typeof this.cfg.maxVideoRecordingDuration&&this.cfg.maxVideoRecordingDuration>0){const e=this.cfg.maxVideoRecordingDuration-t;if(e<=0){const t=this.ref.timer;return t&&(t.textContent=pa(e)),void this._stopRecording()}const r=this.ref.timer;r&&(r.textContent=pa(e))}else{const e=this.ref.timer;e&&(e.textContent=pa(t))}this._animationFrameId=requestAnimationFrame(this._updateTimer)};_startTimer=()=>{this.$._startTime=performance.now(),this.$._elapsedTime=0,this._updateTimer()};_stopTimer=()=>{this._animationFrameId&&cancelAnimationFrame(this._animationFrameId)};_startTimeline=()=>{const t=this.ref.video;if(!t)return;const e=t.currentTime,r=t.duration||1,i=this.ref.line;i&&(i.style.transform=`scaleX(${e/r})`);const o=this.ref.timer;o&&(o.textContent=pa(e)),this._animationFrameId=requestAnimationFrame(this._startTimeline)};_stopTimeline=()=>{this._animationFrameId&&cancelAnimationFrame(this._animationFrameId)};_animationFrameId=null;_startRecording=()=>{try{this._chunks=[],this._options={...this.cfg.mediaRecorderOptions};const{mimeType:t}=this.cfg.mediaRecorderOptions||{};t&&MediaRecorder.isTypeSupported(t)?this._options.mimeType=t:MediaRecorder.isTypeSupported(ma)?this._options.mimeType=ma: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(ta.PLAY))}catch(t){console.error("Failed to start recording",t),this.telemetryManager.sendEventError(t,"camera recording. Failed to start recording")}};_stopRecording=()=>{this._mediaRecorder?.addEventListener("stop",()=>{this._previewVideo(),this._stopTimer(),this._setCameraState(ta.STOP)}),this._mediaRecorder?.stop(),this.classList.remove("uc-recording"),this.telemetryManager.sendEvent({eventType:zi.ACTION_EVENT,payload:{metadata:{event:"stop-camera",node:this.tagName,tabId:this._activeTab}}})};_toggleRecording=()=>{"recording"!==this._mediaRecorder?.state&&(!this.ref.video.paused&&!this.ref.video.ended&&this.ref.video.readyState>2?this.ref.video.pause():this.ref.video.paused&&this.ref.video.play())};_toggleEnableAudio=()=>{this._stream?.getAudioTracks().forEach(t=>{t.enabled=!t.enabled,this.$.toggleMicrophoneIcon=t.enabled?"microphone":"microphone-mute",this.$.audioSelectDisabled=!t.enabled})};_previewVideo=()=>{try{const t=new Blob(this._chunks,{type:this._mediaRecorder?.mimeType}),e=URL.createObjectURL(t),r=this.ref.video;if(!r)return;r.muted=!1,r.volume=1,this.$.video=null,r.src=e,r.addEventListener("play",()=>{this._startTimeline(),this.set$({currentTimelineIcon:"pause"})}),r.addEventListener("pause",()=>{this.set$({currentTimelineIcon:"play"}),this._stopTimeline()})}catch(t){console.error("Failed to preview video",t),this.telemetryManager.sendEventError(t,"camera previewing. Failed to preview video")}};_retake=()=>{if(this._setCameraState(ta.RETAKE),this._activeTab===Qn.VIDEO){this.$.video=this._stream;const t=this.ref.video;t&&(t.muted=!0)}this.ref.video?.play?.()};_accept=()=>{if(this._setCameraState(ta.ACCEPT),this._activeTab===Qn.PHOTO)return void this._canvas?.toBlob(t=>{if(!t)return;const e=this._createFile("camera","jpeg",ga,t);this._toSend(e)},ga);const t=new Blob(this._chunks,{type:this._mediaRecorder?.mimeType}),e=this._guessExtensionByMime(this._mediaRecorder?.mimeType),r=this._createFile("video",e,`video/${e}`,t);this._toSend(r),this._chunks=[]};_handlePhoto=t=>{t===ta.SHOT&&this.set$({tabVideoHidden:!0,cameraHidden:!0,tabCameraHidden:!0,cameraActionsHidden:!1,cameraSelectHidden:!0}),t!==ta.RETAKE&&t!==ta.ACCEPT||this.set$({tabVideoHidden:!this._cameraModes.includes(Qn.VIDEO),tabCameraHidden:!this._cameraModes.includes(Qn.PHOTO),cameraHidden:!1,cameraActionsHidden:!0,cameraSelectHidden:this._cameraDevices.length<=1})};_handleVideo=t=>{t===ta.PLAY&&this.set$({timerHidden:!1,tabCameraHidden:!0,cameraSelectHidden:!0,audioSelectHidden:!0,currentTimelineIcon:"pause",currentIcon:"square",mutableClassButton:"uc-shot-btn uc-camera-action uc-stop-record"}),t===ta.STOP&&this.set$({timerHidden:!1,cameraHidden:!0,audioToggleMicrophoneHidden:!0,cameraActionsHidden:!1}),t!==ta.RETAKE&&t!==ta.ACCEPT||this.set$({timerHidden:!0,tabVideoHidden:!this._cameraModes.includes(Qn.VIDEO),tabCameraHidden:!this._cameraModes.includes(Qn.PHOTO),cameraHidden:!1,cameraActionsHidden:!0,audioToggleMicrophoneHidden:!this.cfg.enableAudioRecording,currentIcon:"video-camera-full",mutableClassButton:"uc-shot-btn uc-camera-action",audioSelectHidden:!this.cfg.enableAudioRecording||this._audioDevices.length<=1,cameraSelectHidden:this._cameraDevices.length<=1})};_setCameraState=t=>{this._activeTab!==Qn.PHOTO||"shot"!==t&&"retake"!==t&&"accept"!==t||this._handlePhoto(t),this._activeTab!==Qn.VIDEO||"play"!==t&&"stop"!==t&&"retake"!==t&&"accept"!==t&&"pause"!==t&&"resume"!==t||this._handleVideo(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");this._canvas.height=this.ref.video.videoHeight,this._canvas.width=this.ref.video.videoWidth,this.cfg.cameraMirror&&(this._ctx.translate(this._canvas.width,0),this._ctx.scale(-1,1)),this._ctx.drawImage(this.ref.video,0,0),this.ref.video.pause()}_handleActiveTab=t=>{const e=this.ref.switcher;e?.querySelectorAll("button").forEach(e=>{e.classList.toggle("uc-active",e.getAttribute("data-id")===t)}),t===Qn.PHOTO&&this.set$({currentIcon:"camera-full",audioSelectHidden:!0,audioToggleMicrophoneHidden:!0}),t===Qn.VIDEO&&this.set$({currentTimelineIcon:"play",currentIcon:"video-camera-full",audioSelectHidden:!this.cfg.enableAudioRecording||this._audioDevices.length<=1,audioToggleMicrophoneHidden:!this.cfg.enableAudioRecording}),this.telemetryManager.sendEvent({eventType:zi.ACTION_EVENT,payload:{metadata:{event:"camera-tab-switch",node:this.tagName,tabId:t}}}),this._activeTab=t};_createFile=(t,e,r,i)=>{const o=Date.now();return new File([i],`${t}-${o}.${e}`,{lastModified:o,type:r})};_guessExtensionByMime(t){const e={mp4:"mp4",ogg:"ogg",webm:"webm",quicktime:"mov","x-matroska":"mkv"};if(""===t)return"webm";if(t){const r=t.split("/");if("video"===r?.[0]){const t=r.slice(1).join("/"),i=t?.split(";")[0];if(i&&e[i])return e[i]}}return"avi"}_toSend=t=>{this.api.addFileFromObject(t,{source:kn.CAMERA}),this.set$({"*currentActivity":tn.activities.UPLOAD_LIST}),this.modalManager?.open(tn.activities.UPLOAD_LIST)};get _cameraModes(){return io(this.cfg.cameraModes).filter(t=>t===Qn.PHOTO||t===Qn.VIDEO)}_setPermissionsState=Bi(t=>{this.classList.toggle("uc-initialized","granted"===t);const e=this._activeTab===Qn.VIDEO&&this.cfg.enableAudioRecording,r=this._activeTab===Qn.PHOTO?"camera-full":"video-camera-full";"granted"===t?this.set$({videoHidden:!1,cameraHidden:!1,tabCameraHidden:!this._cameraModes.includes(Qn.PHOTO),tabVideoHidden:!this._cameraModes.includes(Qn.VIDEO),messageHidden:!0,timerHidden:!0,currentIcon:r,audioToggleMicrophoneHidden:!e,audioSelectHidden:!e}):"prompt"===t?(this.$.l10nMessage="camera-permissions-prompt",this.set$({videoHidden:!0,cameraHidden:!0,tabCameraHidden:!0,messageHidden:!1}),this._stopCapture()):(this.$.l10nMessage="camera-permissions-denied",this.set$({videoHidden:!0,messageHidden:!1,tabCameraHidden:!this._cameraModes.includes(Qn.PHOTO),tabVideoHidden:!this._cameraModes.includes(Qn.VIDEO),cameraActionsHidden:!0,mutableClassButton:"uc-shot-btn uc-camera-action"}),this._stopCapture())},300);_makeStreamInactive=()=>{if(!this._stream)return!1;const t=this._stream?.getAudioTracks(),e=this._stream?.getVideoTracks();return t.forEach(t=>{t.stop()}),e.forEach(t=>{t.stop()}),!0};_stopCapture=()=>{if(this._capturing){this.ref.video.volume=0;const t=this.$.video?.getTracks?.();t?.[0]?.stop(),this.$.video=null,this._makeStreamInactive(),this._stopTimer(),this._capturing=!1}};_capture=async()=>{const t={video:{...da},audio:!!this.cfg.enableAudioRecording&&{}};this._selectedCameraId&&(t.video={deviceId:{exact:this._selectedCameraId}}),this._selectedAudioId&&this.cfg.enableAudioRecording&&(t.audio={deviceId:{exact:this._selectedAudioId}}),this.ref.video&&(this.ref.video.volume=0);try{this._setPermissionsState("prompt"),this._stream=await navigator.mediaDevices.getUserMedia(t),this._stream.addEventListener("inactive",()=>{this._setPermissionsState("denied")}),this.$.video=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")}};_handlePermissionsChange=()=>{this._capture()};_permissionAccess=async()=>{try{for(const t of ha){const e=await navigator.permissions.query({name:t});this._permissionResponses[t]=e,e.addEventListener("change",this._handlePermissionsChange)}}catch(t){console.log("Failed to use permissions API. Fallback to manual request mode.",t),this.telemetryManager.sendEventError(t,"camera permissions. Failed to use permissions API"),this._capture()}};_getPermission=()=>{};_requestDeviceAccess=async()=>{try{await navigator.mediaDevices.getUserMedia({video:!0,audio:this.cfg.enableAudioRecording}),await this._getDevices(),navigator.mediaDevices.addEventListener("devicechange",this._getDevices)}catch(t){this.telemetryManager.sendEventError(t,"camera devices. Failed to get user media"),console.log("Failed to get user media",t)}};_getDevices=async()=>{try{const t=await navigator.mediaDevices.enumerateDevices();this._cameraDevices=t.filter(t=>"videoinput"===t.kind).map((t,e)=>({text:t.label.trim()||`${this.l10n("caption-camera")} ${e+1}`,value:t.deviceId})),this._audioDevices=this.cfg.enableAudioRecording?t.filter(t=>"audioinput"===t.kind).map(t=>({text:t.label.trim(),value:t.deviceId})):[],this._cameraDevices.length>1&&this.set$({cameraSelectOptions:this._cameraDevices,cameraSelectHidden:!1}),this._selectedCameraId=this._cameraDevices[0]?.value??null,this._audioDevices.length>1&&this.set$({audioSelectOptions:this._audioDevices,audioSelectHidden:!1}),this._selectedAudioId=this._audioDevices[0]?.value??null}catch(t){this.telemetryManager.sendEventError(t,"camera devices. Failed to get devices"),console.log("Failed to get devices",t)}};_onActivate=async()=>{await this._permissionAccess(),await this._requestDeviceAccess(),await this._capture(),this._handleCameraModes(this._cameraModes)};_onDeactivate=async()=>{this._unsubPermissions&&this._unsubPermissions();Boolean(window.chrome)||this._setPermissionsState("denied"),this._stopCapture()};_handleCameraModes=t=>{this.$.tabVideoHidden=!t.includes(Qn.VIDEO),this.$.tabCameraHidden=!t.includes(Qn.PHOTO);const e=t[0];!e||this._activeTab&&t.includes(this._activeTab)||this._handleActiveTab(e)};initCallback(){super.initCallback(),this.registerActivity(this.activityType,{onActivate:this._onActivate,onDeactivate:this._onDeactivate}),this.subConfigValue("cameraMirror",t=>{this.$.videoTransformCss=t?"scaleX(-1)":null}),this.subConfigValue("enableAudioRecording",t=>{this.$.audioToggleMicrophoneHidden=!t,this.$.audioSelectDisabled=!t}),this.subConfigValue("cameraModes",t=>{if(!this.isActivityActive)return;const e=ji(t);this._handleCameraModes(e.filter(t=>t===Qn.PHOTO||t===Qn.VIDEO))})}_destroy(){for(const t of ha)this._permissionResponses[t]?.removeEventListener("change",this._handlePermissionsChange);navigator.mediaDevices?.removeEventListener("devicechange",this._getDevices)}async destroyCallback(){super.destroyCallback(),this._destroy()}};ba.template='\n <uc-activity-header>\n <button\n type="button"\n class="uc-mini-btn"\n set="onclick: *historyBack"\n l10n="@title:back"\n >\n <uc-icon name="back"></uc-icon>\n </button>\n <div set="@hidden: !cameraSelectHidden">\n <uc-icon name="camera"></uc-icon>\n <span l10n="caption-camera"></span>\n </div>\n <uc-select\n class="uc-camera-select"\n set="$.options: cameraSelectOptions; @hidden: cameraSelectHidden; onchange: onCameraSelectChange"\n >\n </uc-select>\n <button\n type="button"\n class="uc-mini-btn uc-close-btn"\n set="onclick: *closeModal"\n l10n="@title:a11y-activity-header-button-close;@aria-label:a11y-activity-header-button-close"\n >\n <uc-icon name="close"></uc-icon>\n </button>\n </uc-activity-header>\n <div class="uc-content">\n <video\n muted\n autoplay\n playsinline\n set="srcObject: video; style.transform: videoTransformCss; @hidden: videoHidden"\n ref="video"\n ></video>\n <div class="uc-message-box" set="@hidden: messageHidden">\n <span l10n="l10nMessage"></span>\n <button\n type="button"\n set="onclick: onRequestPermissions; @hidden: requestBtnHidden"\n l10n="camera-permissions-request"\n ></button>\n </div>\n </div>\n\n <div class="uc-controls">\n <div ref="switcher" class="uc-switcher" set="@hidden:!timerHidden">\n <button\n data-id="photo"\n type="button"\n class="uc-switch uc-mini-btn"\n set="onclick: onClickTab; @hidden: tabCameraHidden"\n >\n <uc-icon name="camera"></uc-icon>\n </button>\n <button\n data-id="video"\n type="button"\n class="uc-switch uc-mini-btn"\n set="onclick: onClickTab; @hidden: tabVideoHidden"\n >\n <uc-icon name="video-camera"></uc-icon>\n </button>\n </div>\n\n <button\n class="uc-secondary-btn uc-recording-timer"\n set="@hidden:timerHidden; onclick: onToggleRecording"\n >\n <uc-icon set="@name: currentTimelineIcon"></uc-icon>\n <span ref="timer"> 00:00 </span>\n <span ref="line" class="uc-line"></span>\n </button>\n\n <div\n class="uc-camera-actions uc-camera-action"\n set="@hidden: cameraActionsHidden"\n >\n <button type="button" class="uc-secondary-btn" set="onclick: onRetake">\n Retake\n </button>\n <button\n type="button"\n class="uc-primary-btn"\n set="onclick: onAccept"\n data-testid="accept"\n >\n Accept\n </button>\n </div>\n\n <button\n type="button"\n class="uc-shot-btn uc-camera-action"\n data-testid="shot"\n set="onclick: onStartCamera; @class: mutableClassButton; @hidden: cameraHidden;"\n >\n <uc-icon set="@name: currentIcon"></uc-icon>\n </button>\n\n <div class="uc-select">\n <button\n class="uc-mini-btn uc-btn-microphone"\n set="onclick: onToggleAudio; @hidden: audioToggleMicrophoneHidden;"\n >\n <uc-icon set="@name:toggleMicrophoneIcon"></uc-icon>\n </button>\n\n <uc-select\n class="uc-audio-select"\n set="$.options: audioSelectOptions; onchange: onAudioSelectChange; @hidden: audioSelectHidden; @disabled: audioSelectDisabled"\n >\n </uc-select>\n </div>\n </div>\n';var fa="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";function va(...t){return t.reduce((t,e)=>{if("string"==typeof e)return t[e]=!0,t;for(const r of Object.keys(e))t[r]=e[r];return t},{})}function ya(...t){const e=va(...t);return Object.keys(e).reduce((t,r)=>(e[r]&&t.push(r),t),[]).join(" ")}var wa=t=>go.includes(t);var _a=`\n <svg width='0' height='0' style='position:absolute'><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'/><symbol viewBox='0 0 20 20' id='uc-icon-brightness' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M15 10a5 5 0 0 1-5 5m5-5a5 5 0 0 0-5-5m5 5h-5m0 5a5 5 0 0 1 0-10m0 10V5m0 15v-3M2.93 2.929 5.05 5.05M0 10h3m-.07 7.071 2.12-2.121M10 0v3m7.07 14.071-2.12-2.121M20 10h-3m.07-7.071L14.95 5.05m-.626 2.45H10m4.324 5H10'/></symbol><symbol fill='currentColor' viewBox='0 0 20 20' id='uc-icon-closeMax' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='M8.232 10 3.585 5.353l1.768-1.768L10 8.232l4.648-4.647 1.767 1.768L11.768 10l4.647 4.648-1.767 1.767L10 11.768l-4.647 4.647-1.768-1.767L8.232 10Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-contrast' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M2 10a8 8 0 1 0 16 0 8 8 0 1 0-16 0m8-8v16m8-8h-8m7.598 2.5H10m6.24 2.5H10m7.6-7.5H10M16.242 5H10'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-crop' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M20 14H7.005C6.45 14 6 13.55 6 12.995V0M0 6h13.067c.515 0 .933.418.933.933V20M14.5.4 13 2l1.5 1.6M13 2h2a3 3 0 0 1 3 3v2M5.5 19.6 7 18l-1.5-1.6M7 18H5a3 3 0 0 1-3-3v-2'/></symbol><symbol fill='currentColor' viewBox='0 0 20 20' id='uc-icon-done' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='m18.057 6.333-9.365 9.125a1.25 1.25 0 0 1-1.768-.023L1.92 10.296l1.791-1.744 4.132 4.243 8.47-8.253 1.744 1.79Z' clip-rule='evenodd'/></symbol><symbol fill='currentColor' viewBox='0 0 25 24' id='uc-icon-edit-file' xmlns='http://www.w3.org/2000/svg'><path 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 20 20' id='uc-icon-enhance' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M19 13h-2m0 0a4 4 0 0 1-4-4m4 4a4 4 0 0 0-4 4m0-8V7m0 2a4 4 0 0 1-4 4m-2 0h2m0 0a4 4 0 0 1 4 4m0 0v2M8 8.5H6.5m0 0a2 2 0 0 1-2-2m2 2a2 2 0 0 0-2 2m0-4V5m0 1.5a2 2 0 0 1-2 2M1 8.5h1.5m0 0a2 2 0 0 1 2 2m0 0V12M12 3h-1m0 0a1 1 0 0 1-1-1m1 1a1 1 0 0 0-1 1m0-2V1m0 1a1 1 0 0 1-1 1M8 3h1m0 0a1 1 0 0 1 1 1m0 0v1'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-exposure' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M10 20v-3M2.93 2.929 5.05 5.05M0 10h3m-.07 7.071 2.12-2.121M10 0v3m7.07 14.071-2.12-2.121M20 10h-3m.07-7.071L14.95 5.05M5 10a5 5 0 1 0 10 0 5 5 0 1 0-10 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-filters' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M4.5 6.5a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0m-3.5 6a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0m7 0a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-flip' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M19.6 5 18 3.5 16.4 5m3.2 10L18 16.5 16.4 15M18 3.523v12.954M3.3 8.5h10.654c.301 0 .415-.395.159-.554L3.459 1.286A.3.3 0 0 0 3 1.542V8.2a.3.3 0 0 0 .3.3zm0 3h10.654c.301 0 .415.395.159.554l-10.654 6.66A.3.3 0 0 1 3 18.458v-6.66a.3.3 0 0 1 .3-.3z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-gamma' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M17 3C9 6 2.5 11.5 2.5 17.5m0 0h1m-1 0v-1m14 1h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3-14v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-mirror' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M5 .4 3.5 2 5 3.6M15 .4 16.5 2 15 3.6M3.52 2h12.957M8.5 16.7V6.046c0-.301-.394-.415-.554-.159L1.287 16.541a.3.3 0 0 0 .255.459H8.2a.3.3 0 0 0 .3-.3zm3 0V6.046c0-.301.395-.415.555-.159l6.659 10.654a.3.3 0 0 1-.255.459H11.8a.3.3 0 0 1-.3-.3z'/></symbol><symbol viewBox='0 0 40 40' id='uc-icon-original' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.5' d='M0 40 40 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-rotate' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M13.5.4 12 2l1.5 1.6M12.023 2H14.4A3.6 3.6 0 0 1 18 5.6V8M4 17h9a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-sad' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M2 17c4.418-4 11.582-4 16 0M16.5 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-11 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-saturation' xmlns='http://www.w3.org/2000/svg'><defs><linearGradient id='ruc-icon-id__a' x1='10.001' y1='1' x2='10.001' y2='19' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient></defs><circle cx='10.001' cy='10' r='9' transform='rotate(90 10 10)' fill='url(#ruc-icon-id__a)'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-slider' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M0 10h11m0 0a2 2 0 1 0 4 0m-4 0a2 2 0 1 1 4 0m0 0h5'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-tuning' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M8 10h11M1 10h4M1 4.5h11m3 0h4m-18 11h11m3 0h4m-7-11a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0M5 10a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0m7 5.5a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-vibrance' xmlns='http://www.w3.org/2000/svg'><path d='M2.125 5.64A8.96 8.96 0 0 0 1.001 10a8.96 8.96 0 0 0 1.124 4.36V5.64z' fill='url(#uuc-icon-id__a)'/><path d='M2.875 15.499V4.502a9.053 9.053 0 0 1 1.75-1.72v14.437a9.05 9.05 0 0 1-1.75-1.72z' fill='url(#uuc-icon-id__b)'/><path d='M5.375 17.722c.548.33 1.134.601 1.75.809V1.469a8.956 8.956 0 0 0-1.75.81v15.443z' fill='url(#uuc-icon-id__c)'/><path d='M7.875 1.253v17.495c.564.136 1.15.22 1.75.244V1.008a9 9 0 0 0-1.75.245z' fill='url(#uuc-icon-id__d)'/><path d='M10.375 1.008v17.984a9 9 0 0 0 1.75-.244V1.252a9 9 0 0 0-1.75-.244z' fill='url(#uuc-icon-id__e)'/><path d='M12.875 1.469V18.53a8.957 8.957 0 0 0 1.75-.808V2.277a8.957 8.957 0 0 0-1.75-.808z' fill='url(#uuc-icon-id__f)'/><path d='M15.375 2.78v14.44a9.053 9.053 0 0 0 1.75-1.72v-11a9.054 9.054 0 0 0-1.75-1.72z' fill='url(#uuc-icon-id__g)'/><path d='M17.875 5.638v8.724A8.959 8.959 0 0 0 19.001 10a8.96 8.96 0 0 0-1.126-4.362z' fill='url(#uuc-icon-id__h)'/><defs><linearGradient id='uuc-icon-id__a' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='uuc-icon-id__b' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='uuc-icon-id__c' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='uuc-icon-id__d' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='uuc-icon-id__e' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='uuc-icon-id__f' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='uuc-icon-id__g' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='uuc-icon-id__h' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient></defs></symbol><symbol viewBox='0 0 20 20' id='uc-icon-warmth' xmlns='http://www.w3.org/2000/svg'><path d='m7.5 13.05.429.42.171-.175v-.244h-.6zm5 0h-.6v.245l.172.175.428-.42zM8.1 3.5c0-1.05.85-1.9 1.9-1.9V.4a3.1 3.1 0 0 0-3.1 3.1h1.2zm0 9.55V3.5H6.9v9.55h1.2zm-1 2.45c0-.79.315-1.506.829-2.03l-.858-.84A4.088 4.088 0 0 0 5.9 15.5h1.2zm2.9 2.9a2.9 2.9 0 0 1-2.9-2.9H5.9a4.1 4.1 0 0 0 4.1 4.1v-1.2zm2.9-2.9a2.9 2.9 0 0 1-2.9 2.9v1.2a4.1 4.1 0 0 0 4.1-4.1h-1.2zm-.829-2.03c.514.524.829 1.24.829 2.03h1.2c0-1.117-.447-2.13-1.171-2.87l-.858.84zM11.9 3.5v9.55h1.2V3.5h-1.2zM10 1.6c1.05 0 1.9.85 1.9 1.9h1.2A3.1 3.1 0 0 0 10 .4v1.2z' fill='currentColor'/><path d='M10 14V8' stroke='currentColor' stroke-width='1.2' stroke-linecap='round'/><path d='M14 3h3m-3 3h3m-3 3h3m-8 6.5a1 1 0 1 0 2 0 1 1 0 1 0-2 0' stroke='currentColor' stroke-width='1.2'/></symbol></svg>\n <div class="uc-wrapper uc-wrapper_desktop">\n <uc-presence-toggle class="uc-network_problems_splash" set="visible: presence.networkProblems;">\n <div class="uc-network_problems_content">\n <div class="uc-network_problems_icon">\n <uc-icon name="sad"></uc-icon>\n </div>\n <div class="uc-network_problems_text">Network error</div>\n </div>\n <div class="uc-network_problems_footer">\n <uc-btn-ui theme="primary" text="Retry" set="onclick: *on.retryNetwork"></uc-btn-ui>\n </div>\n </uc-presence-toggle>\n <div class="uc-viewport">\n <div class="uc-file_type_outer">\n <div class="uc-file_type">{{fileType}}</div>\n </div>\n <div class="uc-image_container" ref="img-container-el">\n <img src="${fa}" class="uc-image uc-image_visible_from_editor" ref="img-el" />\n <uc-editor-image-cropper ref="cropper-el"></uc-editor-image-cropper>\n <uc-editor-image-fader ref="fader-el"></uc-editor-image-fader>\n </div>\n <div class="uc-info_pan">{{msg}}</div>\n </div>\n <div class="uc-toolbar">\n <uc-line-loader-ui set="active: showLoader"></uc-line-loader-ui>\n <div class="uc-toolbar_content uc-toolbar_content__editor">\n <uc-editor-toolbar></uc-editor-toolbar>\n </div>\n </div>\n </div>\n`,ka=class extends Yo{ctxOwner=!0;static styleAttrs=["uc-cloud-image-editor"];_debouncedShowLoader=Bi(this._showLoader.bind(this),300);constructor(){var t;super(),this.init$={...this.init$,...(t=this,{"*originalUrl":null,"*faderEl":null,"*cropperEl":null,"*imgEl":null,"*imgContainerEl":null,"*networkProblems":!1,"*imageSize":null,"*editorTransformations":{},"*cropPresetList":[],"*currentAspectRatio":null,"*tabList":go,"*tabId":po.CROP,entry:null,extension:null,editorMode:!1,modalCaption:"",isImage:!1,msg:"",src:fa,fileType:"",showLoader:!1,uuid:null,cdnUrl:null,cropPreset:"",tabs:Hi([...go]),"presence.networkProblems":!1,"presence.modalCaption":!0,"presence.editorToolbar":!1,"presence.viewerToolbar":!0,"*on.retryNetwork":()=>{const e=t.querySelectorAll("img");for(const t of e){const e=t.src;t.src=fa,t.src=e}t.$["*networkProblems"]=!1},"*on.apply":e=>{if(!e)return;const r=t.$["*originalUrl"],i=Gi(ao(e),"preview"),o={originalUrl:r,cdnUrlModifiers:i,cdnUrl:eo(r,i),transformations:e};t.dispatchEvent(new CustomEvent("apply",{detail:o,bubbles:!0,composed:!0})),t.remove()},"*on.cancel":()=>{t.remove(),t.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))}})}}_showLoader(t){this.$.showLoader=t}_waitForSize(){return new Promise((t,e)=>{const r=window.setTimeout(()=>{e(new Error("[cloud-image-editor] timeout waiting for non-zero container size"))},3e3),i=new ResizeObserver(e=>{const[o]=e;o&&o.contentRect.width>0&&o.contentRect.height>0&&(window.clearTimeout(r),i.disconnect(),window.setTimeout(()=>t(),0))});i.observe(this)})}initCallback(){super.initCallback(),this.$["*faderEl"]=this.ref["fader-el"],this.$["*cropperEl"]=this.ref["cropper-el"],this.$["*imgContainerEl"]=this.ref["img-container-el"],this.initEditor()}async updateImage(){if(this.isConnected){if(await this._waitForSize(),this.$.cdnUrl){const t=this.$.cdnUrl,e=Zi(t),r=ro(t,e);if(r===this.$["*originalUrl"])return;this.$["*originalUrl"]=r;const i=ho(Yi(t));this.$["*editorTransformations"]=i}else{if(!this.$.uuid)throw new Error("No UUID nor CDN URL provided");{const t=ro(this.cfg.cdnCname,this.$.uuid);if(t===this.$["*originalUrl"])return;this.$["*originalUrl"]=t,this.$["*editorTransformations"]={}}}this.$["*tabId"]===po.CROP?this.$["*cropperEl"]?.deactivate({reset:!0}):this.$["*faderEl"]?.deactivate();try{const t=this.$["*originalUrl"],e=await this.proxyUrl(eo(t,Gi("json"))),r=await fetch(e).then(t=>t.json()),{width:i,height:o}=r;this.$["*imageSize"]={width:i,height:o},this.$["*tabId"]===po.CROP?this.$["*cropperEl"]?.activate(this.$["*imageSize"]):this.$["*faderEl"]?.activate({url:t})}catch(t){t&&(this.telemetryManager.sendEventError(t,"cloud editor image. Failed to load image info"),console.error("Failed to load image info",t))}}}async initEditor(){try{await this._waitForSize()}catch(t){return void(this.isConnected&&console.error(t.message))}this.ref["img-el"].addEventListener("load",()=>{this._debouncedShowLoader(!1),this.$.src!==fa&&(this.$["*networkProblems"]=!1)}),this.ref["img-el"].addEventListener("error",()=>{this._debouncedShowLoader(!1),this.$["*networkProblems"]=!0}),this.sub("src",t=>{const e=this.ref["img-el"];e.src!==t&&(e.src=t||fa)}),this.sub("tabs",t=>{this.$["*tabList"]=(t=>{if(!t)return go;const e=ji(t).filter(wa);return 0===e.length?go:e})(t)}),this.sub("*tabId",t=>{this.ref["img-el"].className=ya("uc-image",{"uc-image_hidden_to_cropper":t===po.CROP,"uc-image_hidden_effects":t!==po.CROP})}),this.classList.add("uc-editor_ON"),this.sub("*networkProblems",t=>{this.$["presence.networkProblems"]=t,this.$["presence.modalCaption"]=!t}),this.sub("*editorTransformations",t=>{if(0===Object.keys(t).length)return;const e=this.$["*originalUrl"],r=Gi(ao(t),"preview"),i={originalUrl:e,cdnUrlModifiers:r,cdnUrl:eo(e,r),transformations:t};this.dispatchEvent(new CustomEvent("change",{detail:i,bubbles:!0,composed:!0}))},!1),this.sub("uuid",t=>t&&this.updateImage()),this.sub("cdnUrl",t=>t&&this.updateImage()),this.sub("cropPreset",t=>{const e=yn(t);let r=null;if(this.$.cdnUrl){const t=ho(Yi(this.$.cdnUrl));if(Array.isArray(t?.crop?.dimensions)){const[i,o]=t.crop.dimensions;r=((t,e,r,i=.1)=>{const o=t/e;let n=null,a=1/0;for(const t of r){const[e,r]=[t.width,t.height],i=e/r,s=Math.abs(o-i);s<a&&(a=s,n=t)}if(n){const[t,e]=[n.width,n.height],r=t/e;if(Math.abs(o-r)/r>i)return null}return n})(i,o,e,.1)}}this.$["*cropPresetList"]=e,this.$["*currentAspectRatio"]=r??e?.[0]??null})}};ka.template=_a,ka.bindAttributes({uuid:"uuid","cdn-url":"cdnUrl","crop-preset":"cropPreset",tabs:"tabs"});var xa=class extends Yo{_handlePointerUp;_handlePointerMove;_handleSvgPointerMove;_backdropMaskId=`backdrop-mask-${xe.generate()}`;_backdropMask;_backdropMaskInner;_frameThumbs;_frameGuides;_draggingThumb;_hoverThumb;_dragStartPoint;_dragStartCrop;_frameImage;_guidesHidden=!1;constructor(){super(),this.init$={...this.init$,dragging:!1},this._handlePointerUp=this._handlePointerUp_.bind(this),this._handlePointerMove=this._handlePointerMove_.bind(this),this._handleSvgPointerMove=this._handleSvgPointerMove_.bind(this)}_shouldThumbBeDisabled(t){const e=this.$["*imageBox"];if(!e)return!1;if(""===t&&e.height<=1&&e.width<=1)return!0;const r=e.height<=1&&(t.includes("n")||t.includes("s")),i=e.width<=1&&(t.includes("e")||t.includes("w"));return r||i}_createBackdrop(){const t=this.$["*cropBox"];if(!t)return;const{x:e,y:r,width:i,height:o}=t,n=this.ref["svg-el"],a=ln("mask",{id:this._backdropMaskId}),s=ln("rect",{x:0,y:0,width:"100%",height:"100%",fill:"white"}),c=ln("rect",{x:e,y:r,width:i,height:o,fill:"black"});a.appendChild(s),a.appendChild(c);const l=ln("rect",{x:0,y:0,width:"100%",height:"100%",fill:"var(--color-image-background)","fill-opacity":.85,mask:`url(#${this._backdropMaskId})`});n.appendChild(l),n.appendChild(a),this._backdropMask=a,this._backdropMaskInner=c}_resizeBackdrop(){this._backdropMask&&(this._backdropMask.style.display="none",window.requestAnimationFrame(()=>{this._backdropMask&&(this._backdropMask.style.display="block")}))}_updateBackdrop(){const t=this.$["*cropBox"];if(!t)return;const{x:e,y:r,width:i,height:o}=t;this._backdropMaskInner&&cn(this._backdropMaskInner,{x:e,y:r,width:i,height:o})}_updateFrame(){const t=this.$["*cropBox"];if(t&&this._frameGuides&&this._frameThumbs){for(const e of Object.values(this._frameThumbs)){if(!e)continue;const{direction:r,pathNode:i,interactionNode:o,groupNode:n}=e,a=""===r,s=2===r.length,{x:c,y:l,width:u,height:d}=t;if(a){cn(o,{x:c,y:l,width:u,height:d})}else{const e=fn(Math.min(u,d)/82/2,0,1),n=s?un(t,r,e):dn(t,r,e),a=n.center;if(!a)continue;const c=Math.max(24*fn(Math.min(u,d)/24/3,0,1),6);cn(o,{x:a[0]-c,y:a[1]-c,width:2*c,height:2*c}),cn(i,{d:n.d})}const h=this._shouldThumbBeDisabled(r);n.setAttribute("class",ya("uc-thumb",{"uc-thumb--hidden":h,"uc-thumb--visible":!h}))}cn(this._frameGuides,{x:t.x-.5,y:t.y-.5,width:t.width+1,height:t.height+1})}}_createThumb(t,e){const r=ln("g");r.classList.add("uc-thumb"),r.setAttribute("with-effects","");const i=ln("rect",{fill:"transparent"}),o=ln("path",{stroke:"currentColor",fill:"none","stroke-width":3});r.appendChild(o),r.appendChild(i),t[e]={direction:e,pathNode:o,interactionNode:i,groupNode:r},""===e&&(r.style.cursor="move"),i.addEventListener("pointerdown",this._handlePointerDown.bind(this,e))}_createThumbs(){const t={};for(let e=0;e<3;e++)for(let r=0;r<3;r++){const i=`${["n","","s"][e]}${["w","","e"][r]}`;""!==i&&this._createThumb(t,i)}return this._createThumb(t,""),t}_createGuides(){const t=ln("svg"),e=ln("rect",{x:0,y:0,width:"100%",height:"100%",fill:"none",stroke:"currentColor","stroke-width":1,"stroke-opacity":.5});t.appendChild(e);for(let e=1;e<=2;e++){const r=ln("line",{x1:sn*e+"%",y1:"0%",x2:sn*e+"%",y2:"100%",stroke:"currentColor","stroke-width":1,"stroke-opacity":.3});t.appendChild(r)}for(let e=1;e<=2;e++){const r=ln("line",{x1:"0%",y1:sn*e+"%",x2:"100%",y2:sn*e+"%",stroke:"currentColor","stroke-width":1,"stroke-opacity":.3});t.appendChild(r)}return t.classList.add("uc-guides","uc-guides--semi-hidden"),t}_createFrame(){const t=this.ref["svg-el"],e=document.createDocumentFragment(),r=this._createGuides();e.appendChild(r);const i=this._createThumbs();for(const{groupNode:t}of Object.values(i))e.appendChild(t);t.appendChild(e),this._frameThumbs=i,this._frameGuides=r}_handlePointerDown(t,e){if(!this._frameThumbs)return;const r=this._frameThumbs[t];if(!r)return;if(this._shouldThumbBeDisabled(t))return;const i=this.$["*cropBox"],o=this.ref["svg-el"],{x:n,y:a}=o.getBoundingClientRect(),s=e.x-n,c=e.y-a;this.$.dragging=!0,this._draggingThumb=r,this._dragStartPoint=[s,c],this._dragStartCrop={...i}}_handlePointerUp_(t){this._updateCursor(),this.$.dragging&&(t.stopPropagation(),t.preventDefault(),this.$.dragging=!1)}_handlePointerMove_(t){if(!this.$.dragging||!this._dragStartPoint||!this._draggingThumb)return;t.stopPropagation(),t.preventDefault();const e=this.ref["svg-el"],{x:r,y:i}=e.getBoundingClientRect(),o=t.x-r,n=t.y-i,a=o-this._dragStartPoint[0],s=n-this._dragStartPoint[1],{direction:c}=this._draggingThumb,l=this._calcCropBox(c,[a,s]);l&&(this.$["*cropBox"]=l)}_calcCropBox(t,e){const[r,i]=e,o=this.$["*imageBox"];let n=this._dragStartCrop??this.$["*cropBox"];const a=this.$["*currentAspectRatio"],s=a?a.width/a.height:void 0;if(n=""===t?function({rect:t,delta:[e,r],imageBox:i}){return hn({...t,x:t.x+e,y:t.y+r},i)}({rect:n,delta:[r,i],imageBox:o}):pn({rect:n,delta:[r,i],direction:t,aspectRatio:s,imageBox:o}),Object.values(n).every(t=>Number.isFinite(t)&&t>=0))return hn(bn(n),o);console.error("CropFrame is trying to create invalid rectangle",{payload:n})}_handleSvgPointerMove_(t){if(!this._frameThumbs)return;const e=Object.values(this._frameThumbs).find(e=>{if(!e)return!1;if(this._shouldThumbBeDisabled(e.direction))return!1;const r=e.interactionNode.getBoundingClientRect(),i=function(t,[e,r]){return t.x<=e&&e<=t.x+t.width&&t.y<=r&&r<=t.y+t.height}({x:r.x,y:r.y,width:r.width,height:r.height},[t.x,t.y]);return i});this._hoverThumb=e,this._updateCursor()}_updateCursor(){const t=this._hoverThumb;var e;this.ref["svg-el"].style.cursor=t?""===(e=t.direction)?"move":["e","w"].includes(e)?"ew-resize":["n","s"].includes(e)?"ns-resize":["nw","se"].includes(e)?"nwse-resize":"nesw-resize":"initial"}_createMask(t){if(this._frameImage)return void this._frameImage.setAttribute("href",t);const e=this.ref["svg-el"],r=document.createDocumentFragment(),i=ln("image",{href:t});i.setAttribute("class","uc-cloud-mask"),r.appendChild(i),e.appendChild(r),this._frameImage=i}_updateMask(){const t=this.$["*cropBox"];if(!t||!this._frameImage)return;const{x:e,y:r,width:i,height:o}=t;cn(this._frameImage,{x:e,y:r,height:o,width:i})}_render(){this._updateBackdrop(),this._updateFrame(),this._updateMask()}toggleThumbs(t){if(this._frameThumbs)for(const e of Object.values(this._frameThumbs)){if(!e)continue;const{groupNode:r}=e;r.setAttribute("class",ya("uc-thumb",{"uc-thumb--hidden":!t,"uc-thumb--visible":t}))}}initCallback(){super.initCallback(),this._createBackdrop(),this._createFrame(),this.sub("*imageBox",()=>{this._resizeBackdrop(),window.requestAnimationFrame(()=>{this._render()})}),this.sub("*cropBox",t=>{t&&(this._guidesHidden=t.height<=1||t.width<=1,window.requestAnimationFrame(()=>{this._render()}))}),this.subConfigValue("cloudImageEditorMaskHref",t=>{t&&this._createMask(t)}),this.sub("dragging",t=>{this._frameGuides&&this._frameGuides.setAttribute("class",ya({"uc-guides--hidden":this._guidesHidden,"uc-guides--visible":!this._guidesHidden&&t,"uc-guides--semi-hidden":!this._guidesHidden&&!t}))});this.ref["svg-el"].addEventListener("pointermove",this._handleSvgPointerMove,!0),document.addEventListener("pointermove",this._handlePointerMove,!0),document.addEventListener("pointerup",this._handlePointerUp,!0)}destroyCallback(){super.destroyCallback();this.ref["svg-el"].removeEventListener("pointermove",this._handleSvgPointerMove,!0),document.removeEventListener("pointermove",this._handlePointerMove),document.removeEventListener("pointerup",this._handlePointerUp)}};xa.template=' <svg class="uc-svg" ref="svg-el" xmlns="http://www.w3.org/2000/svg"></svg> ';var Ca=class extends Yo{_titleEl;constructor(){super(),this.init$={...this.init$,active:!1,title:"",icon:"","on.click":null,"title-prop":""}}initCallback(){super.initCallback(),this._titleEl=this.ref["title-el"],this.sub("title",t=>{const e=this._titleEl;e&&(e.style.display=t?"block":"none")}),this.sub("active",t=>{this.className=ya({"uc-active":t,"uc-not_active":!t})}),this.sub("on.click",t=>{this.onclick=t??null})}};Ca.template='\n <button role="option" type="button" set="@aria-label:title-prop;" l10n="@title:title-prop;">\n <uc-icon ref="icon-el" set="@name: icon;"></uc-icon>\n <div class="uc-title" ref="title-el">{{title}}</div>\n </button>\n';var Ea=class extends Ca{initCallback(){super.initCallback(),this.$.icon="arrow-dropdown",this.$["on.click"]=this.handleClick.bind(this),this.sub("*currentAspectRatio",t=>{this.$.title=t.hasFreeform?this.l10n("freeform-crop"):this.l10n("crop-to-shape",{value:`${t.width}:${t.height}`}),this.bindL10n("title-prop",()=>this.$.title)})}handleClick(){this.$["*showListAspectRatio"]=!0}};Ea.template=' \n <button role="option" type="button" set="@aria-label:title-prop;" l10n="@title:title-prop;">\n <div class="uc-title" ref="title-el">{{title}}</div>\n <uc-icon ref="icon-el" set="@name: icon;"></uc-icon>\n </button> \n';var Ta=class extends Ca{constructor(){super(),this.init$={...this.init$,active:!1,once:!1}}initCallback(){super.initCallback(),this.defineAccessor("aspectRatio",t=>{if(!t)return;const e=!!t.hasFreeform;this.$.title=e?this.l10n("custom"):`${t.width}:${t.height}`,e||this._renderRectBasedOnAspectRatio(t),e&&this.setAttribute("uc-aspect-ratio-freeform",""),this._aspectRatio=t,this.bindL10n("title-prop",()=>this.l10n("a11y-cloud-editor-apply-aspect-ratio",{name:e?this.l10n("custom").toLowerCase():this.l10n("crop-to-shape",{value:`${t.width}:${t.height}`}).toLowerCase(),value:""}))}),this.sub("*currentAspectRatio",t=>{this.$.active=t&&t.id===this._aspectRatio?.id||t?.width===this._aspectRatio?.width&&t?.height===this._aspectRatio?.height}),this.$["on.click"]=this.handleClick.bind(this)}handleClick(){const t=this.$["*currentAspectRatio"];t?.id!==this._aspectRatio?.id&&(this.$["*currentAspectRatio"]=this._aspectRatio)}_renderRectBasedOnAspectRatio(t){const{width:e,height:r}=(t=>{let e=12,r=12;return t.width/t.height>=1?(e=12,r=Math.round(12*t.height/t.width)):(r=12,e=Math.round(12*t.width/t.height)),{width:e,height:r}})(t),i=ln("rect",{"stroke-linejoin":"round",fill:"none",stroke:"currentColor","stroke-width":1.2,"fill-rule":"evenodd",x:(16-e)/2,y:(16-r)/2,rx:2,width:e,height:r}),o=this.ref["icon-el"]?.ref?.svg;o&&(o.innerHTML="",o.appendChild(i))}_aspectRatio};var Aa=class extends Ca{_operation=void 0;initCallback(){super.initCallback(),this.defineAccessor("operation",t=>{t&&(this._operation=t,this.$.icon=t,this.bindL10n("title-prop",()=>this.l10n("a11y-cloud-editor-apply-crop",{name:this.l10n(t).toLowerCase()})))}),this.$["on.click"]=t=>{if(!this._operation)return;const e=this.$["*cropperEl"],r=e.getValue(this._operation),i=function(t,e){if("rotate"===t)return function(t){let e=t+90;return e=e>=360?0:e,e}("number"==typeof e?e:0);if("mirror"===t||"flip"===t)return!e;throw new Error(`Unsupported operation: ${t}`)}(this._operation,r);this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{operation:this._operation,next:i,prev:r}),e.setValue(this._operation,i)}}};function Ia(t){const e=new Image;return{promise:new Promise((r,i)=>{e.src=t,e.onload=()=>r(),e.onerror=t=>i(t)}),image:e,cancel:()=>{0===e.naturalWidth&&(e.src=fa)}}}function Sa(t){const e=[];for(const r of t){const t=Ia(r);e.push(t)}const r=e.map(t=>t.image);return{promise:Promise.allSettled(e.map(t=>t.promise)),images:r,cancel:()=>{e.forEach(t=>{t.cancel()})}}}var Ma="original",$a=class extends Yo{_operation="filter";_filter;_originalUrl="";constructor(){super(),this.init$={...this.init$,disabled:!1,min:0,max:100,value:0,defaultValue:0,zero:0,"on.input":t=>{const e=this.$["*faderEl"];e?.set(t),this.$.value=t}}}setOperation(t,e){this._operation=t,this._filter=e,this._initializeValues();const r=this.$["*faderEl"],i=this._originalUrl||this.$["*originalUrl"];r&&i&&r.activate({url:i,operation:this._operation,value:this._filter===Ma?void 0:this.$.value,filter:this._filter===Ma?void 0:this._filter,fromViewer:!1})}_initializeValues(){const t=this._operation,{range:e,zero:r}=yo[t],[i,o]=e;this.$.min=i,this.$.max=o,this.$.zero=r;const n=this.$["*editorTransformations"][t];if("filter"===t){let t=Number(o);const e=n;if(e){const{name:r,amount:i}=e;t=r===this._filter?i:o}return this.$.value=t,void(this.$.defaultValue=t)}const a=void 0!==n?n:r;this.$.value=a,this.$.defaultValue=a}apply(){const t={...this.$["*editorTransformations"]};"filter"===this._operation?this._filter&&this._filter!==Ma?t.filter={name:this._filter,amount:this.$.value}:delete t.filter:t[this._operation]=this.$.value,this.$["*editorTransformations"]=t}cancel(){const t=this.$["*faderEl"];t?.deactivate({hide:!1})}initCallback(){super.initCallback(),this.sub("*originalUrl",t=>{this._originalUrl=t}),this.sub("value",t=>{const e=`${this._filter??this._operation} ${t}`;this.$["*operationTooltip"]=e})}};function La(t){const e=t.match(/^([A-Za-z]+)\s+(\d+)$/);if(!e)return null;const[,r,i]=e;return r&&void 0!==i?{filter:r,value:Number(i)}:null}$a.template='\n <uc-slider-ui\n ref="slider-el"\n set="disabled: disabled; min: min; max: max; defaultValue: defaultValue; zero: zero; onInput: on.input;"\n ></uc-slider-ui>\n';var Oa=class extends Ca{_operation="";_filter="";_originalUrl="";_observer;_cancelPreload;constructor(){super(),this.init$={...this.init$,active:!1,title:"",icon:"",isOriginal:!1,iconSize:"20","on.click":null}}_previewSrc(){const t=parseInt(window.getComputedStyle(this).getPropertyValue("--l-base-min-width"),10),e=window.devicePixelRatio,r=Math.ceil(e*t),i=e>=2?"lightest":"normal",o={...this.$["*editorTransformations"]};return o[this._operation]=this._filter!==Ma?{name:this._filter,amount:100}:void 0,eo(this._originalUrl,Gi(so,ao(o),`quality/${i}`,`scale_crop/${r}x${r}/center`))}async _observerCallback(t,e){const r=t[0];if(r?.isIntersecting){const t=await this.proxyUrl(this._previewSrc()),r=this.ref["preview-el"],{promise:i,cancel:o}=Ia(t);this._cancelPreload=o,i.catch(t=>{this.$["*networkProblems"]=!0,console.error("Failed to load image",{error:t})}).finally(()=>{r.style.backgroundImage=`url(${t})`,r.setAttribute("loaded",""),e.unobserve(this)})}else this._cancelPreload?.()}initCallback(){super.initCallback(),this.$["on.click"]=t=>{if(this.$.active){if(!this.$.isOriginal){this.$["*sliderEl"].setOperation(this._operation,this._filter),this.$["*showSlider"]=!0}}else{const t=this.$["*sliderEl"];t.setOperation(this._operation,this._filter),t.apply()}this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{operation:La(this.$["*operationTooltip"])}),this.$["*currentFilter"]=this._filter},this.defineAccessor("filter",t=>{this._operation="filter",this._filter=t,this.$.isOriginal=t===Ma,this.$.icon=this.$.isOriginal?"original":"slider",this.bindL10n("title-prop",()=>this.l10n("a11y-cloud-editor-apply-filter",{name:t.toLowerCase()}))}),this._observer=new window.IntersectionObserver(this._observerCallback.bind(this),{threshold:[0,1]});const t=this.$["*originalUrl"];if(this._originalUrl=t,this.$.isOriginal){this.ref["icon-el"].classList.add("uc-original-icon")}else this._observer.observe(this);this.sub("*currentFilter",t=>{this.$.active=t&&t===this._filter}),this.sub("isOriginal",t=>{this.$.iconSize=t?40:20}),this.sub("active",t=>{if(this.$.isOriginal)return;this.ref["icon-el"].style.opacity=t?"1":"0";const e=this.ref["preview-el"];t?e.style.opacity="0":e.style.backgroundImage&&(e.style.opacity="1")}),this.sub("*networkProblems",async t=>{if(!t){const t=await this.proxyUrl(this._previewSrc()),e=this.ref["preview-el"];e.style.backgroundImage&&(e.style.backgroundImage="none",e.style.backgroundImage=`url(${t})`)}})}destroyCallback(){super.destroyCallback(),this._observer?.disconnect(),this._cancelPreload?.()}};Oa.template='\n <button type="button" role="option" l10n="@title:title-prop;@aria-label:title-prop">\n <div class="uc-preview" ref="preview-el"></div>\n <uc-icon ref="icon-el" set="@name: icon; @size: iconSize;"></uc-icon>\n </button>\n';var Ua=(t,e)=>{let r,i=!1,o=0;const n=(...n)=>{i?(r&&clearTimeout(r),r=setTimeout(()=>{Date.now()-o>=e&&(t(...n),o=Date.now())},Math.max(e-(Date.now()-o),0))):(t(...n),o=Date.now(),i=!0)};return Object.defineProperty(n,"cancel",{configurable:!1,writable:!1,enumerable:!1,value:()=>{r&&clearTimeout(r)}}),n};function Ra(t,e,r){const i=window.devicePixelRatio,o=Math.min(Math.ceil(e*i),3e3),n=i>=2?"lightest":"normal";return eo(t,Gi(so,ao(r),`quality/${n}`,`stretch/off/-/resize/${o}x`,`@clib/${Ko}/${Go}/uc-cloud-image-editor/`))}var Pa=class extends Yo{ctxOwner=!0;_commitDebounced;_handleResizeThrottled;_imageSize={width:0,height:0};_canvas;_ctx=null;_isActive=!1;_observer;_cancelPreload;constructor(){super(),this.init$={...this.init$,image:null,"*padding":20,"*operations":{rotate:0,mirror:!1,flip:!1},"*imageBox":{x:0,y:0,width:0,height:0},"*cropBox":{x:0,y:0,width:0,height:0}},this._commitDebounced=Bi(this._commit.bind(this),300),this._handleResizeThrottled=Ua(this._handleResize.bind(this),100)}_handleResize(){this.isConnected&&this._isActive&&(this._initCanvas(),this._syncTransformations(),this._alignImage(),this._alignCrop(),this._draw())}_syncTransformations(){const t=function(t,e){const r={};for(const i of e){const e=t[i];(Object.hasOwn(t,i)||void 0!==e)&&(r[i]=e)}return r}(this.$["*editorTransformations"],Object.keys(this.$["*operations"])),e={...this.$["*operations"],...t};this.$["*operations"]=e}_initCanvas(){const t=this.ref["canvas-el"],e=t.getContext("2d"),r=this.offsetWidth,i=this.offsetHeight,o=window.devicePixelRatio;t.style.width=`${r}px`,t.style.height=`${i}px`,t.width=r*o,t.height=i*o,e?.scale(o,o),this._canvas=t,this._ctx=e}_alignImage(){if(!this._isActive||!this.$.image)return;const t=this.$.image,e=this.$["*padding"],r=this.$["*operations"],{rotate:i}=r,o=this.offsetWidth,n=this.offsetHeight,a=gn({width:t.naturalWidth,height:t.naturalHeight},i);let s;if(a.width>o-2*e||a.height>n-2*e){const t=a.width/a.height;if(t>o/n){const r=o-2*e,i=r/t;s={x:0+e,y:e+(n-2*e)/2-i/2,width:r,height:i}}else{const r=n-2*e,i=r*t;s={x:e+(o-2*e)/2-i/2,y:0+e,width:i,height:r}}}else{const{width:t,height:r}=a;s={x:e+(o-2*e)/2-t/2,y:e+(n-2*e)/2-r/2,width:t,height:r}}this.$["*imageBox"]=bn(s)}_alignCrop(){let t=this.$["*cropBox"];const e=this.$["*imageBox"],r=this.$["*operations"],{rotate:i}=r,o=this.$["*editorTransformations"].crop,{width:n,x:a,y:s}=e;if(o){const{dimensions:[r,c],coords:[l,u]}=o,{width:d}=gn(this._imageSize,i),h=n/d;t=hn(bn({x:a+l*h,y:s+u*h,width:r*h,height:c*h}),e)}const c=this.$["*currentAspectRatio"],l=c?c.width/c.height:void 0;if(p=e,!((h=t).x>=p.x&&h.y>=p.y&&h.x+h.width<=p.x+p.width&&h.y+h.height<=p.y+p.height)||l&&(u=t,d=l,!(Math.abs(u.width/u.height-d)<.1))){const r=e.width/e.height;let i=e.width,o=e.height;l&&(r>l?i=Math.min(e.height*l,e.width):o=Math.min(e.width/l,e.height)),t={x:e.x+e.width/2-i/2,y:e.y+e.height/2-o/2,width:i,height:o}}var u,d,h,p;this.$["*cropBox"]=hn(bn(t),e)}_drawImage(){const t=this._ctx;if(!t)return;const e=this.$.image,r=this.$["*imageBox"],i=this.$["*operations"],{mirror:o,flip:n,rotate:a}=i,s=gn({width:r.width,height:r.height},a);t.save(),t.translate(r.x+r.width/2,r.y+r.height/2),t.rotate(a*Math.PI*-1/180),t.scale(o?-1:1,n?-1:1),t.drawImage(e,-s.width/2,-s.height/2,s.width,s.height),t.restore()}_draw(){if(!(this._isActive&&this.$.image&&this._canvas&&this._ctx))return;const t=this._canvas;this._ctx.clearRect(0,0,t.width,t.height),this._drawImage()}_animateIn({fromViewer:t}){this.$.image&&(this.ref["frame-el"].toggleThumbs(!0),this._transitionToImage(),setTimeout(()=>{this.className=ya({"uc-active_from_viewer":t,"uc-active_from_editor":!t,"uc-inactive_to_editor":!1})}))}_getCropDimensions(){const t=this.$["*cropBox"],e=this.$["*imageBox"],r=this.$["*operations"],{rotate:i}=r,{width:o,height:n}=e,{width:a,height:s}=gn(this._imageSize,i),{width:c,height:l}=t,u=o/a,d=n/s;return[fn(Math.round(c/u),1,a),fn(Math.round(l/d),1,s)]}_getCropTransformation(){const t=this.$["*cropBox"],e=this.$["*imageBox"],r=this.$["*operations"],{rotate:i}=r,{width:o,height:n,x:a,y:s}=e,{width:c,height:l}=gn(this._imageSize,i),{x:u,y:d}=t,h=o/c,p=n/l,g=this._getCropDimensions(),m={dimensions:g,coords:[fn(Math.round((u-a)/h),0,c-g[0]),fn(Math.round((d-s)/p),0,l-g[1])]};if(function(t){if(!t)return!0;const e=[({dimensions:t,coords:e})=>[...t,...e].every(t=>Number.isInteger(t)&&Number.isFinite(t)),({dimensions:t,coords:e})=>t.every(t=>t>0)&&e.every(t=>t>=0)];return e.every(e=>e(t))}(m)){if(g[0]!==c||g[1]!==l)return m}else console.error("Cropper is trying to create invalid crop object",{payload:m})}_commit(){if(!this.isConnected||!this._imageSize)return;const t=this.$["*operations"],{rotate:e,mirror:r,flip:i}=t,o=this._getCropTransformation(),n={...this.$["*editorTransformations"],crop:o,rotate:e,mirror:r,flip:i};this.$["*editorTransformations"]=n}setValue(t,e){this.$["*operations"]={...this.$["*operations"],[t]:e},this._isActive&&(this._alignImage(),this._alignCrop(),this._draw())}getValue(t){return this.$["*operations"][t]}async activate(t,{fromViewer:e}={}){if(!this._isActive){this._isActive=!0,this._imageSize=t,this.removeEventListener("transitionend",this._reset);try{const t=this.$["*originalUrl"],r=this.$["*editorTransformations"];this.$.image=await this._waitForImage(t,r),this._syncTransformations(),this._animateIn({fromViewer:e})}catch(t){console.error("Failed to activate cropper",{error:t}),this.telemetryManager.sendEventError(t,"cloud editor image. Failed to activate cropper")}this._observer=new ResizeObserver(t=>{const[e]=t;if(!e)return;e.contentRect.width>0&&e.contentRect.height>0&&this._isActive&&this.$.image&&this._handleResizeThrottled()}),this._observer.observe(this)}}deactivate({reset:t=!1}={}){this._isActive&&(!t&&this._commit(),this._isActive=!1,this._transitionToCrop(),this.className=ya({"uc-active_from_viewer":!1,"uc-active_from_editor":!1,"uc-inactive_to_editor":!0}),this.ref["frame-el"].toggleThumbs(!1),this.addEventListener("transitionend",this._reset,{once:!0}),this._observer?.disconnect())}_transitionToCrop(){const t=this._getCropDimensions(),e=this.$["*cropBox"],r=Math.min(this.offsetWidth,t[0])/e.width,i=Math.min(this.offsetHeight,t[1])/e.height,o=Math.min(r,i),n=e.x+e.width/2,a=e.y+e.height/2;this.style.transform=`scale(${o}) translate(${(this.offsetWidth/2-n)/o}px, ${(this.offsetHeight/2-a)/o}px)`,this.style.transformOrigin=`${n}px ${a}px`}_transitionToImage(){const t=this.$["*cropBox"],e=t.x+t.width/2,r=t.y+t.height/2;this.style.transform="scale(1)",this.style.transformOrigin=`${e}px ${r}px`}_reset(){this._isActive||(this.$.image=null)}async _waitForImage(t,e){const r=this.offsetWidth;e={...e,crop:void 0,rotate:void 0,flip:void 0,mirror:void 0};const i=await this.proxyUrl(Ra(t,r,e)),{promise:o,cancel:n,image:a}=Ia(i),s=this._handleImageLoading(i);return a.addEventListener("load",s,{once:!0}),a.addEventListener("error",s,{once:!0}),this._cancelPreload?.(),this._cancelPreload=n,o.then(()=>a).catch(t=>(console.error("Failed to load image",{error:t}),this.$["*networkProblems"]=!0,a))}_handleImageLoading(t){const e="crop",r=this.$["*loadingOperations"];let i=r.get(e);return i||(i=new Map,r.set(e,i)),i.get(t)||(i.set(t,!0),this.$["*loadingOperations"]=r),()=>{const i=r.get(e);i?.has(t)&&(i.delete(t),this.$["*loadingOperations"]=r)}}initCallback(){super.initCallback(),this.sub("*imageBox",()=>{this._draw()}),this.sub("*cropBox",()=>{this.$.image&&this._commitDebounced()}),this.sub("*currentAspectRatio",()=>{this._alignCrop()}),setTimeout(()=>{this.sub("*networkProblems",t=>{t||this._isActive&&this.activate(this._imageSize,{fromViewer:!1})})},0)}destroyCallback(){super.destroyCallback(),this._observer?.disconnect()}};function Na(t,e,r){const i=r-1,o=new Array(r);for(let r=i;r>=0;r-=1)o[r]=Math.ceil((r*e+(i-r)*t)/i);return o}function Da(t,e){const r=yo[t].keypointsNumber,{range:i,zero:o}=yo[t];return[...new Set([...Na(i[0],o,r+1),...Na(o,i[1],r+1),o,e])].sort((t,e)=>t-e)}Pa.template='\n <canvas class="uc-canvas" ref="canvas-el"></canvas>\n <uc-crop-frame ref="frame-el"></uc-crop-frame>\n';var za=class extends Yo{_isActive=!1;_hidden=!0;_operation="initial";_filter;_value;_transformations={};_keypoints=[];_container;_previewImage;_cancelLastImages;_cancelBatchPreload;_url;_fromViewer;_raf=0;_addKeypointDebounced=Bi(this._addKeypoint.bind(this),600);constructor(){super(),this.classList.add("uc-inactive_to_cropper")}_handleImageLoading(t){const e=this._operation,r=this.$["*loadingOperations"];r.has(e)||r.set(e,new Map);const i=r.get(e);return i&&!i.get(t)&&(i.set(t,!0),this.$["*loadingOperations"]=r),()=>{const i=r.get(e);i?.has(t)&&(i.delete(t),this.$["*loadingOperations"]=r)}}_flush(){window.cancelAnimationFrame(this._raf),this._raf=window.requestAnimationFrame(()=>{for(const t of this._keypoints){const{image:e}=t;e&&(e.style.opacity=t.opacity.toString(),e.style.zIndex=t.zIndex.toString())}})}_imageSrc({url:t=this._url,filter:e=this._filter??void 0,operation:r,value:i}={}){if(!t)throw new Error("URL is not defined");const o={...this._transformations};r&&("filter"===r?e&&"number"==typeof i&&(o.filter={name:e,amount:i}):"number"==typeof i&&(o[r]=i));const n=this.offsetWidth;return this.proxyUrl(Ra(t,n,o))}async _constructKeypoint(t,e){return{src:await this._imageSrc({operation:t,value:e}),image:void 0,opacity:0,zIndex:0,value:e}}_isSame(t,e){return this._operation===t&&this._filter===e}async _addKeypoint(t,e,r){const i=()=>!this._isSame(t,e)||this._value!==r||!!this._keypoints.find(t=>t.value===r);if(i())return;const o=await this._constructKeypoint(t,r),n=new Image;n.src=o.src;const a=this._handleImageLoading(o.src);n.addEventListener("load",a,{once:!0}),n.addEventListener("error",a,{once:!0}),o.image=n,n.classList.add("uc-fader-image"),n.addEventListener("load",()=>{if(i())return;const e=this._keypoints;let a=e.findIndex(t=>t.value>r);-1===a&&(a=e.length);const s=e[a],c=s?.image,l=this._container;!l||c&&!l.contains(c)||(e.splice(a,0,o),c&&l.insertBefore(n,c),this._update(t,r))},{once:!0}),n.addEventListener("error",()=>{this.$["*networkProblems"]=!0},{once:!0})}set(t){const e="string"==typeof t?parseInt(t,10):t;(function(t){return"string"==typeof t&&t in yo})(this._operation)&&Number.isFinite(e)&&(this._update(this._operation,e),this._addKeypointDebounced(this._operation,this._filter,e))}_update(t,e){this._operation=t,this._value=e;const{zero:r}=yo[t],i=this._keypoints.map(t=>t.value),o=function(t,e,r){const i=function(t){const e=[];for(let r=0;r<t.length-1;r+=1){const i=t[r],o=t[r+1];"number"==typeof i&&"number"==typeof o&&e.push([i,o])}return e}(t).find(([t,r])=>t<=e&&e<=r);if(!i)return t.map(()=>0);const[o,n]=i;return t.map(t=>{const i=Math.abs(o-n)||1,a=Math.abs(e-o)/i;return o===t?e>r?1:1-a:n===t?e>=r?a:1:0})}(i,e,r),n=function(t,e){return t.map((r,i)=>r<e?t.length-i:i)}(i,r);this._keypoints.forEach((t,e)=>{const r=o[e],i=n[e];"number"==typeof r&&(t.opacity=r),"number"==typeof i&&(t.zIndex=i)}),this._flush()}_createPreviewImage(){const t=new Image;return t.classList.add("uc-fader-image","uc-fader-image--preview"),t.style.opacity="0",t}async _initNodes(){const t=document.createDocumentFragment();this._previewImage=this._previewImage||this._createPreviewImage();const e=this._previewImage;this.contains(e)||t.appendChild(e);const r=document.createElement("div");t.appendChild(r);const i=this._keypoints.map(t=>t.src),{images:o,promise:n,cancel:a}=Sa(i);o.forEach(t=>{const e=this._handleImageLoading(t.src);t.addEventListener("load",e),t.addEventListener("error",e)}),this._cancelLastImages=()=>{a(),this._cancelLastImages=void 0};const s=this._operation,c=this._filter;await n,this._isActive&&this._isSame(s,c)&&(this._container?.remove(),this._container=r,this._keypoints.forEach((t,e)=>{const r=o[e];r&&(r.classList.add("uc-fader-image"),t.image=r,this._container?.appendChild(r))}),this.appendChild(t),this._flush())}async setTransformations(t){if(this._transformations=t,this._previewImage){const t=await this._imageSrc(),e=this._handleImageLoading(t);this._previewImage.src=t,this._previewImage.addEventListener("load",e,{once:!0}),this._previewImage.addEventListener("error",e,{once:!0}),this._previewImage.style.opacity="1",this._previewImage.addEventListener("error",()=>{this.$["*networkProblems"]=!0},{once:!0})}}async preload({url:t,filter:e,operation:r,value:i}){if(!r||"number"!=typeof i)return;this._cancelBatchPreload?.();const o=Da(r,i),n=await Promise.all(o.map(i=>this._imageSrc({url:t,filter:e,operation:r,value:i}))),{cancel:a}=Sa(n);this._cancelBatchPreload=a}_setOriginalSrc(t){const e=this._previewImage||this._createPreviewImage();if(this.contains(e)||this.appendChild(e),this._previewImage=e,e.src===t)return e.style.opacity="1",e.style.transform="scale(1)",void(this.className=ya({"uc-active_from_viewer":this._fromViewer,"uc-active_from_cropper":!this._fromViewer,"uc-inactive_to_cropper":!1}));e.style.opacity="0";const r=this._handleImageLoading(t);e.addEventListener("error",r,{once:!0}),e.src=t,e.addEventListener("load",()=>{r(),e&&(e.style.opacity="1",e.style.transform="scale(1)",this.className=ya({"uc-active_from_viewer":this._fromViewer,"uc-active_from_cropper":!this._fromViewer,"uc-inactive_to_cropper":!1}))},{once:!0}),e.addEventListener("error",()=>{this.$["*networkProblems"]=!0},{once:!0})}async activate({url:t,operation:e,value:r,filter:i,fromViewer:o}){this._isActive=!0,this._hidden=!1,this._url=t,this._operation=e??"initial",this._value=r,this._filter=i,this._fromViewer=o;if("number"!=typeof r&&!i){const t=await this._imageSrc({operation:e,value:r});return this._setOriginalSrc(t),void this._container?.remove()}e&&"number"==typeof r&&(this._keypoints=await Promise.all(Da(e,r).map(t=>this._constructKeypoint(e,t))),this._update(e,r),this._initNodes())}deactivate({hide:t=!0}={}){this._isActive=!1,this._cancelLastImages?.(),this._cancelBatchPreload?.(),t&&!this._hidden?(this._hidden=!0,this._previewImage&&(this._previewImage.style.transform="scale(1)"),this.className=ya({"uc-active_from_viewer":!1,"uc-active_from_cropper":!1,"uc-inactive_to_cropper":!0}),this.addEventListener("transitionend",()=>{this._container?.remove()},{once:!0})):this._container?.remove()}},Va=class extends Ca{_operation="";initCallback(){super.initCallback(),this.$["on.click"]=t=>{this.$["*sliderEl"].setOperation(this._operation),this.$["*showSlider"]=!0,this.$["*currentOperation"]=this._operation,this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{operation:La(this.$["*operationTooltip"])})},this.defineAccessor("operation",t=>{t&&(this._operation=t,this.$.icon=t,this.bindL10n("title-prop",()=>this.l10n("a11y-cloud-editor-apply-tuning",{name:this.l10n(t).toLowerCase()})),this.bindL10n("title",()=>this.l10n(t)))}),this.sub("*editorTransformations",t=>{if(!this._operation)return;const{zero:e}=yo[this._operation],r=t[this._operation],i=void 0!==r&&r!==e;this.$.active=i})}},Fa=class extends Yo{initCallback(){super.initCallback(),this.addEventListener("wheel",t=>{t.preventDefault();const{deltaY:e,deltaX:r}=t;Math.abs(r)>1?this.scrollLeft+=r:this.scrollLeft+=e},{passive:!1}),this.addEventListener("scroll",()=>{},{passive:!0})}};Fa.template=" <slot></slot> ";var Ba=class extends Yo{_debouncedShowLoader;_cancelPreload;_updateInfoTooltip;constructor(){super(),this.init$={...this.init$,"*sliderEl":null,"*listAspectRatioEl":null,"*loadingOperations":new Map,"*showSlider":!1,"*showListAspectRatio":!1,hideSliderOrList:!1,"*currentFilter":Ma,"*currentOperation":null,showLoader:!1,filters:bo,colorOperations:mo,cropOperations:fo,"*operationTooltip":null,"presence.mainToolbar":!0,"presence.subToolbar":!1,"presence.tabToggles":!0,"presence.tabContent.crop":!1,"presence.tabContent.tuning":!1,"presence.tabContent.filters":!1,"presence.tabToggle.crop":!0,"presence.tabToggle.tuning":!0,"presence.tabToggle.filters":!0,"presence.subTopToolbarStyles":{hidden:"uc-sub-toolbar--top-hidden",visible:"uc-sub-toolbar--visible"},"presence.subBottomToolbarStyles":{hidden:"uc-sub-toolbar--bottom-hidden",visible:"uc-sub-toolbar--visible"},"presence.tabContentStyles":{hidden:"uc-tab-content--hidden",visible:"uc-tab-content--visible"},"presence.tabToggleStyles":{hidden:"uc-tab-toggle--hidden",visible:"uc-tab-toggle--visible"},"presence.tabTogglesStyles":{hidden:"uc-tab-toggles--hidden",visible:"uc-tab-toggles--visible"},"on.cancel":t=>{this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{action:"cancel"}),this._cancelPreload?.();(0,this.$["*on.cancel"])()},"on.apply":t=>{this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{action:"apply"});(0,this.$["*on.apply"])(this.$["*editorTransformations"])},"on.applySlider":t=>{this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{action:"apply-slider",operation:La(this.$["*operationTooltip"])});this.ref["slider-el"].apply(),this._onSliderClose()},"on.cancelSlider":t=>{this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{action:"cancel-slider"});this.ref["slider-el"].cancel(),this._onSliderClose()},"on.clickTab":t=>{const e=t.currentTarget,r=e?.getAttribute("data-id");r&&(this.telemetryManager.sendEventCloudImageEditor(t,r),this._activateTab(r,{fromViewer:!1}))},tab_role:"tab",[`tab_${po.TUNING}`]:`tab_${po.TUNING}`,[`tab_${po.CROP}`]:`tab_${po.CROP}`,[`tab_${po.FILTERS}`]:`tab_${po.FILTERS}`,cancel:"cancel",apply:"apply","a11y-editor-tab-filters":"a11y-editor-tab-filters","a11y-editor-tab-tuning":"a11y-editor-tab-tuning","a11y-editor-tab-crop":"a11y-editor-tab-crop"},this._debouncedShowLoader=Bi(this._showLoader.bind(this),500),this._updateInfoTooltip=Bi(this._updateInfoTooltipHandler.bind(this),0)}_onSliderClose(){if(this.$["*showSlider"]=!1,this.$["*tabId"]===po.CROP&&(this.$["*showListAspectRatio"]=!1),this.$["*tabId"]===po.TUNING){this.ref["tooltip-el"].classList.toggle("uc-info-tooltip_visible",!1)}}_createOperationControl(t){const e=new Va;return e.operation=t,e}_createFilterControl(t){const e=new Oa;return e.filter=t,e}_createToggleControl(t){const e=new Aa;return e.operation=t,e}_createAspectRatioControl(t){const e=new Ta;return e.aspectRatio=t,e}_createFreeformControl(){return new Ea}_clearListAspectRatio(){const t=this.$["*listAspectRatioEl"];t&&(t.innerHTML="")}_renderControlsList(t){const e=this.ref[`controls-list-${t}`],r=document.createDocumentFragment();if(this._clearListAspectRatio(),t===po.CROP){const t=this.$["*cropPresetList"],e=t.length>=3;if(e){const t=this._createFreeformControl();r.appendChild(t)}for(const i of t){const t=this._createAspectRatioControl(i);if(r.appendChild(t),e){const e=this.$["*listAspectRatioEl"];e?.appendChild(t)}}for(const t of this.$.cropOperations){const e=this._createToggleControl(t);r.appendChild(e)}}else if(t===po.FILTERS){const t=this.$.filters;[Ma,...t].forEach(t=>{const e=this._createFilterControl(t);r.appendChild(e)})}else if(t===po.TUNING)for(const t of this.$.colorOperations){const e=this._createOperationControl(t);r.appendChild(e)}[...r.children].forEach((t,e)=>{e===r.childNodes.length-1&&t.classList.add("uc-controls-list_last-item")}),e.innerHTML="",e.appendChild(r)}_activateTab(t,{fromViewer:e}={}){this.$["*tabId"]=t;const r=this.$["*faderEl"],i=this.$["*cropperEl"];t===po.CROP?(r?.deactivate(),i?.activate(this.$["*imageSize"],{fromViewer:e})):(r?.activate({url:this.$["*originalUrl"],fromViewer:e}),i?.deactivate());for(const e of go){const r=e===t;this.ref[`tab-toggle-${e}`].active=r,r?(this._renderControlsList(t),this._syncTabIndicator()):this._unmountTabControls(e),this.$[`presence.tabContent.${e}`]=r}}_unmountTabControls(t){const e=this.ref[`controls-list-${t}`];e&&(e.innerHTML="")}_syncTabIndicator(){const t=this.ref[`tab-toggle-${this.$["*tabId"]}`];this.ref["tabs-indicator"].style.transform=`translateX(${t.offsetLeft}px)`}async _preloadEditedImage(){if(this.$["*imgContainerEl"]&&this.$["*originalUrl"]){const t=this.$["*imgContainerEl"].offsetWidth,e=await this.proxyUrl(Ra(this.$["*originalUrl"],t,this.$["*editorTransformations"]));this._cancelPreload?.();const{cancel:r}=Sa([e]);this._cancelPreload=()=>{r(),this._cancelPreload=void 0}}}_showLoader(t){this.$.showLoader=t}_updateInfoTooltipHandler(){const t=this.$["*editorTransformations"],e=this.$["*currentOperation"];let r="",i=!1;if(this.$["*tabId"]===po.FILTERS)if(i=!0,this.$["*currentFilter"]&&t?.filter?.name===this.$["*currentFilter"]){const e=t?.filter?.amount||100;r=`${this.$["*currentFilter"]} ${e}`}else r=this.l10n(Ma);else if(this.$["*tabId"]===po.TUNING&&e){i=!0;const o=t?.[e]||yo[e].zero;r=`${this.l10n(e)} ${o}`}i&&(this.$["*operationTooltip"]=r),this.ref["tooltip-el"].classList.toggle("uc-info-tooltip_visible",i)}initCallback(){super.initCallback(),this.$["*sliderEl"]=this.ref["slider-el"],this.$["*listAspectRatioEl"]=this.ref["list-el"],this.sub("*imageSize",t=>{t&&setTimeout(()=>{this._activateTab(this.$["*tabId"],{fromViewer:!0})},0)}),this.sub("*editorTransformations",t=>{const e=t?.filter?.name;this.$["*currentFilter"]!==e&&(this.$["*currentFilter"]=e)}),this.sub("*currentFilter",()=>{this._updateInfoTooltip()}),this.sub("*currentOperation",()=>{this._updateInfoTooltip()}),this.sub("*tabId",()=>{this._updateInfoTooltip()}),this.sub("*originalUrl",()=>{this.$["*faderEl"]?.deactivate()}),this.sub("*editorTransformations",t=>{this._preloadEditedImage(),this.$["*faderEl"]?.setTransformations(t)}),this.sub("*loadingOperations",t=>{let e=!1;for(const[,r]of t.entries()){if(e)break;for(const[,t]of r.entries())if(t){e=!0;break}}this._debouncedShowLoader(e)}),this.sub("*showSlider",t=>{this.$["presence.subToolbar"]=t,this.$["presence.mainToolbar"]=!t,this.$.hideSliderOrList=!0}),this.sub("*showListAspectRatio",t=>{this.$["presence.subToolbar"]=t,this.$["presence.mainToolbar"]=!t,this.$.hideSliderOrList=!1}),this.sub("*tabList",t=>{this.$["presence.tabToggles"]=t.length>1;for(const e of go){this.$[`presence.tabToggle.${e}`]=t.includes(e);this.ref[`tab-toggle-${e}`].style.gridColumn=`${t.indexOf(e)+1}`}if(!t.includes(this.$["*tabId"])&&t.length>0){const[e]=t;e&&this._activateTab(e,{fromViewer:!1})}}),this._updateInfoTooltip()}destroyCallback(){this.$["*showSlider"]=!1,this.$["*showListAspectRatio"]=!1}};Ba.template=`\n <uc-line-loader-ui set="active: showLoader"></uc-line-loader-ui>\n <div class="uc-info-tooltip_container">\n <div class="uc-info-tooltip_wrapper">\n <div ref="tooltip-el" class="uc-info-tooltip uc-info-tooltip_hidden">{{*operationTooltip}}</div>\n </div>\n </div>\n <div class="uc-toolbar-container">\n <uc-presence-toggle\n role="tablist"\n class="uc-sub-toolbar"\n set="visible: presence.mainToolbar; styles: presence.subTopToolbarStyles"\n >\n <div class="uc-tab-content-row">${go.map(function(t){return`\n <uc-presence-toggle\n id="tab_${t}"\n class="uc-tab-content"\n set="visible: presence.tabContent.${t}; styles: presence.tabContentStyles"\n >\n <uc-editor-scroller hidden-scrollbar>\n <div class="uc-controls-list_align">\n <div\n role="listbox"\n aria-orientation="horizontal"\n class="uc-controls-list_inner"\n ref="controls-list-${t}"\n ></div>\n </div>\n </uc-editor-scroller>\n </uc-presence-toggle>\n `}).join("")}</div>\n <div class="uc-controls-row">\n <uc-presence-toggle\n class="uc-tab-toggles"\n set="visible: presence.tabToggles; styles: presence.tabTogglesStyles"\n >\n <div ref="tabs-indicator" class="uc-tab-toggles_indicator"></div>\n ${go.map(function(t){return`\n <uc-presence-toggle\n class="uc-tab-toggle"\n set="visible: presence.tabToggle.${t}; styles: presence.tabToggleStyles;"\n >\n <uc-btn-ui\n theme="tab"\n ref="tab-toggle-${t}"\n data-id="${t}"\n icon="${t}"\n set="onclick: on.clickTab; aria-role:tab_role; aria-controls:tab_${t}; title-prop: a11y-editor-tab-${t}"\n >\n </uc-btn-ui>\n </uc-presence-toggle>\n `}).join("")}\n </uc-presence-toggle>\n <uc-btn-ui style="order: -1" theme="secondary-icon" icon="closeMax" set="onclick: on.cancel; title-prop:cancel">\n </uc-btn-ui>\n <uc-btn-ui theme="primary-icon" icon="done" set="onclick: on.apply; title-prop:apply"> </uc-btn-ui>\n </div>\n </uc-presence-toggle>\n <uc-presence-toggle\n class="uc-sub-toolbar"\n set="visible: presence.subToolbar; styles: presence.subBottomToolbarStyles"\n >\n <div class="uc-slider" set="@hidden:!hideSliderOrList">\n <uc-editor-slider ref="slider-el"></uc-editor-slider>\n </div>\n\n <div set="@hidden:hideSliderOrList" class="uc-list-aspect-ratio-container">\n <div class="uc-list-aspect-ratio" ref="list-el"></div>\n </div>\n <div class="uc-controls-row">\n <uc-btn-ui theme="secondary" set="onclick: on.cancelSlider" l10n="@text:cancel"> </uc-btn-ui>\n <uc-btn-ui theme="primary" set="onclick: on.applySlider" l10n="@text:apply"> </uc-btn-ui>\n </div>\n </uc-presence-toggle>\n </div>\n`;var ja=class extends Yo{_iconReversed=!1;_iconSingle=!1;_iconHidden=!1;constructor(){super(),this.init$={...this.init$,text:"",icon:"",iconCss:this._iconCss(),theme:null,"aria-role":"","aria-controls":"","title-prop":""},this.defineAccessor("active",t=>{t?this.setAttribute("active",""):this.removeAttribute("active")})}_iconCss(){return ya("uc-icon",{"uc-icon_left":!this._iconReversed,"uc-icon_right":this._iconReversed,"uc-icon_hidden":this._iconHidden,"uc-icon_single":this._iconSingle})}initCallback(){super.initCallback(),this.sub("icon",t=>{this._iconSingle=!this.$.text,this._iconHidden=!t,this.$.iconCss=this._iconCss()}),this.sub("theme",t=>{t&&"custom"!==t&&(this.className=`uc-${t}`)}),this.sub("text",()=>{this._iconSingle=!1}),this.hasAttribute("theme")||this.setAttribute("theme","default"),this.defineAccessor("aria-role",t=>{this.$["aria-role"]=t||""}),this.defineAccessor("aria-controls",t=>{this.$["aria-controls"]=t||""}),this.defineAccessor("title-prop",t=>{this.$["title-prop"]=t||""})}set reverse(t){this.hasAttribute("reverse")?(this.style.flexDirection="row-reverse",this._iconReversed=!0):(this._iconReversed=!1,this.style.flexDirection="")}};ja.bindAttributes({text:"text",icon:"icon",reverse:"reverse",theme:"theme"}),ja.template='\n <button\n type="button"\n set="@role:aria-role; @aria-controls: aria-controls; @aria-label:title-prop"\n l10n="@title:title-prop;"\n >\n <uc-icon set="className: iconCss; @name: icon; @hidden: !icon"></uc-icon>\n <div class="uc-text">{{text}}</div>\n </button>\n';var Ha=class extends Yo{_active=!1;_handleTransitionEndRight=()=>{const t=this.ref["line-el"];t.style.transition="initial",t.style.opacity="0",t.style.transform="translateX(-101%)",this._active&&this._start()};initCallback(){super.initCallback(),this.defineAccessor("active",t=>{"boolean"==typeof t&&(t?this._start():this._stop())})}_start(){this._active=!0;const{width:t}=this.getBoundingClientRect(),e=this.ref["line-el"];e.style.transition="transform 1s",e.style.opacity="1",e.style.transform=`translateX(${t}px)`,e.addEventListener("transitionend",this._handleTransitionEndRight,{once:!0})}_stop(){this._active=!1}};Ha.template='\n <div class="uc-inner">\n <div class="uc-line" ref="line-el"></div>\n </div>\n';var qa="uc-transition",Ka="uc-visible",Ga="uc-hidden",Wa=class extends Yo{_visible=!1;_visibleStyle=Ka;_hiddenStyle=Ga;_externalTransitions=!1;constructor(){super(),this.defineAccessor("styles",t=>{t&&(this._externalTransitions=!0,this._visibleStyle=t.visible??Ka,this._hiddenStyle=t.hidden??Ga)}),this.defineAccessor("visible",t=>{"boolean"==typeof t&&(this._visible=t,this._handleVisible())})}_handleVisible(){this.style.visibility=this._visible?"inherit":"hidden",function(t,...e){const r=va(...e);for(const e of Object.keys(r))t.classList.toggle(e,Boolean(r[e]))}(this,{[qa]:!this._externalTransitions,[this._visibleStyle]:this._visible,[this._hiddenStyle]:!this._visible}),this.setAttribute("aria-hidden",this._visible?"false":"true")}initCallback(){super.initCallback(),this.classList.toggle("uc-initial",!0),this._externalTransitions||this.classList.add(qa),this._handleVisible(),setTimeout(()=>{this.classList.toggle("uc-initial",!1)},0)}};Wa.template="<slot></slot> ";var Za=class extends Yo{_observer;_thumbSize=0;_zero=0;_zeroDotEl;_stepsCount;constructor(){super(),this.init$={...this.init$,disabled:!1,min:0,max:100,onInput:null,onChange:null,defaultValue:0,"on.sliderInput":()=>{const t=Number.parseInt(this._inputEl().value,10);this._updateValue(t),this.$.onInput?.(t)},"on.sliderChange":()=>{const t=Number.parseInt(this._inputEl().value,10);this.$.onChange?.(t)}},this.setAttribute("with-effects","")}initCallback(){super.initCallback(),this.defineAccessor("disabled",t=>{this.$.disabled=t}),this.defineAccessor("min",t=>{this.$.min=t}),this.defineAccessor("max",t=>{this.$.max=t}),this.defineAccessor("defaultValue",t=>{this.$.defaultValue=t;this._inputEl().value=String(t),this._updateValue(t)}),this.defineAccessor("zero",t=>{this._zero=t}),this.defineAccessor("onInput",t=>{t&&(this.$.onInput=t)}),this.defineAccessor("onChange",t=>{t&&(this.$.onChange=t)}),this._updateSteps(),this._observer=new ResizeObserver(()=>{this._updateSteps();const t=Number.parseInt(this._inputEl().value,10);this._updateValue(t)}),this._observer.observe(this),this._thumbSize=Number.parseInt(window.getComputedStyle(this).getPropertyValue("--l-thumb-size"),10),setTimeout(()=>{const t=Number.parseInt(this._inputEl().value,10);this._updateValue(t)},0),this.sub("disabled",t=>{const e=this._inputEl();t?e.setAttribute("disabled","disabled"):e.removeAttribute("disabled")});const t=this._inputEl();t.addEventListener("focus",()=>{this.style.setProperty("--color-effect","var(--hover-color-rgb)")}),t.addEventListener("blur",()=>{this.style.setProperty("--color-effect","var(--idle-color-rgb)")})}_inputEl(){return this.ref["input-el"]}_thumbEl(){return this.ref["thumb-el"]}_stepsEl(){return this.ref["steps-el"]}_updateValue(t){this._updateZeroDot(t);const{width:e}=this.getBoundingClientRect(),r=100/(this.$.max-this.$.min)*(t-this.$.min)*(e-this._thumbSize)/100;window.requestAnimationFrame(()=>{this._thumbEl().style.transform=`translateX(${r}px)`})}_updateZeroDot(t){if(!this._zeroDotEl)return;this._zeroDotEl.style.opacity=t===this._zero?"0":"1";const{width:e}=this.getBoundingClientRect(),r=100/(this.$.max-this.$.min)*(this._zero-this.$.min)*(e-this._thumbSize)/100;window.requestAnimationFrame(()=>{this._zeroDotEl&&(this._zeroDotEl.style.transform=`translateX(${r}px)`)})}_updateSteps(){const t=this._stepsEl(),{width:e}=t.getBoundingClientRect(),r=Math.ceil(e/2),i=Math.ceil(r/15)-2;if(this._stepsCount===i)return;const o=document.createDocumentFragment(),n=document.createElement("div"),a=document.createElement("div");n.className="uc-minor-step",a.className="uc-border-step",o.appendChild(a);for(let t=0;t<i;t+=1)o.appendChild(n.cloneNode());o.appendChild(a.cloneNode());for(let t=0;t<i;t+=1)o.appendChild(n.cloneNode());o.appendChild(a.cloneNode());const s=document.createElement("div");s.className="uc-zero-dot",o.appendChild(s),this._zeroDotEl=s,t.innerHTML="",t.appendChild(o),this._stepsCount=i}destroyCallback(){super.destroyCallback(),this._observer?.disconnect()}};Za.template='\n <div class="uc-steps" ref="steps-el"></div>\n <div ref="thumb-el" class="uc-thumb"></div>\n <input\n class="uc-input"\n type="range"\n ref="input-el"\n set="oninput: on.sliderInput; onchange: on.sliderChange; @min: min; @max: max; @value: defaultValue;"\n />\n';var Xa=class extends la{couldBeCtxOwner=!0;activityType=tn.activities.CLOUD_IMG_EDIT;_entry;_instance;get activityParams(){const t=super.activityParams;if("internalId"in t)return t;throw new Error("Cloud Image Editor activity params not found")}initCallback(){super.initCallback(),this.registerActivity(this.activityType,{onActivate:()=>this.mountEditor(),onDeactivate:()=>this.unmountEditor()}),this.subConfigValue("cropPreset",t=>{this._instance&&this._instance.getAttribute("crop-preset")!==t&&this._instance.setAttribute("crop-preset",t)}),this.subConfigValue("cloudImageEditorTabs",t=>{this._instance&&this._instance.getAttribute("tabs")!==t&&this._instance.setAttribute("tabs",t)})}handleApply(t){if(!this._entry)return;const e=t.detail;this._entry.setMultipleValues({cdnUrl:e.cdnUrl,cdnUrlModifiers:e.cdnUrlModifiers}),this.modalManager?.close(tn.activities.CLOUD_IMG_EDIT),this.historyBack()}handleCancel(){this.modalManager?.close(tn.activities.CLOUD_IMG_EDIT),this.historyBack()}mountEditor(){const{internalId:t}=this.activityParams,e=this.uploadCollection.read(t);if(!e)throw new Error(`Entry with internalId "${t}" not found`);this._entry=e;const r=this._entry.getValue("cdnUrl");if(!r)throw new Error(`Entry with internalId "${t}" hasn't uploaded yet`);const i=new ka,o=this.cfg.cropPreset,n=this.cfg.cloudImageEditorTabs;i.setAttribute("ctx-name",this.ctxName),i.setAttribute("cdn-url",r),o&&i.setAttribute("crop-preset",o),n&&i.setAttribute("tabs",n),i.addEventListener("apply",t=>{const e=t;this.handleApply(e),this.debugPrint('editor event "apply"',e.detail)}),i.addEventListener("cancel",t=>{const e=t;this.handleCancel(),this.debugPrint('editor event "cancel"',e.detail)}),i.addEventListener("change",t=>{const e=t;this.debugPrint('editor event "change"',e.detail)}),this.innerHTML="",this.appendChild(i),this._instance=i}unmountEditor(){this._instance=void 0,this._entry=void 0,this.innerHTML=""}},Ya=t=>t.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)?.map(t=>t.toLowerCase()).join("-"),Ja=[{test:t=>!!t.accept&&!!t.imgOnly,message:"There could be a mistake.\nBoth `accept` and `imgOnly` parameters are set.\nThe value of `accept` will be concatenated with the internal image mime types list."},{test:t=>null!==t.enableVideoRecording,message:"The `enableVideoRecording` parameter is deprecated and will be removed in the next major release.\nPlease use the `cameraModes` parameter instead."},{test:t=>null!==t.defaultCameraMode,message:"The `defaultCameraMode` parameter is deprecated and will be removed in the next major release.\nPlease use the `cameraModes` parameter instead."}],Qa=Bi(t=>{for(const{test:e,message:r}of Ja)e(t)&&na(r)},0),ts=t=>t instanceof Promise||Boolean(t&&"object"==typeof t&&"then"in t&&"function"==typeof t.then),es=[{key:"cameraModes",deps:["enableVideoRecording"],fn:({cameraModes:t,enableVideoRecording:e})=>{if(null===e)return t;let r=ji(t);return e&&!r.includes("video")?r=r.concat("video"):e||(r=r.filter(t=>"video"!==t)),Hi(r)}},{key:"cameraModes",deps:["defaultCameraMode"],fn:({cameraModes:t,defaultCameraMode:e})=>{if(null===e)return t;let r=ji(t);return r=r.sort((t,r)=>t===e?-1:r===e?1:0),Hi(r)}},{key:"cdnCname",deps:["pubkey","cdnCnamePrefixed"],fn:({pubkey:t,cdnCname:e,cdnCnamePrefixed:r})=>t&&(e===wo||((t,e)=>{try{const r=new URL(t),i=new URL(e);return r.hostname.endsWith(i.hostname)}catch{return!1}})(e,r))?li(t,r):e}],rs=({key:t,setValue:e,getValue:r,computationControllers:i})=>{for(const o of es)if(o.deps.includes(t)){const t={[o.key]:r(o.key)};for(const e of o.deps)t[e]=r(e);const n=new AbortController;let a;i.get(o.key)?.abort(),i.set(o.key,n);try{a=o.fn(t,{signal:n.signal})}catch(t){return i.get(o.key)===n&&i.delete(o.key),void console.error(`Failed to compute value for "${o.key}"`,t)}ts(a)?a.then(t=>{n.signal.aborted||e(o.key,t)}).catch(t=>{n.signal.aborted||console.error(`Failed to compute value for "${o.key}"`,t)}).finally(()=>{i.get(o.key)===n&&i.delete(o.key)}):e(o.key,a)}},is=t=>String(t),os=t=>{const e=Number(t);if(Number.isNaN(e))throw new Error(`Invalid number: "${t}"`);return e},ns=t=>{if(null==t)return!1;if("boolean"==typeof t)return t;if("true"===t)return!0;if(""===t)return!0;if("false"===t)return!1;throw new Error(`Invalid boolean: "${t}"`)},as=t=>{if("object"==typeof t)return t;throw new Error("Invalid value. Must be an object.")},ss=t=>{if("function"==typeof t)return t;throw new Error("Invalid value. Must be a function.")},cs=t=>{if(Array.isArray(t))return t;throw new Error("Must be an array.")},ls={pubkey:is,multiple:ns,multipleMin:os,multipleMax:os,confirmUpload:ns,imgOnly:ns,accept:is,externalSourcesPreferredTypes:is,externalSourcesEmbedCss:is,store:t=>"auto"===t?t:ns(t),cameraMirror:ns,cameraCapture:t=>{const e=is(t);if("user"!==e&&"environment"!==e&&""!==e)throw new Error(`Invalid value: "${e}"`);return e},sourceList:is,topLevelOrigin:is,maxLocalFileSizeBytes:os,thumbSize:os,showEmptyList:ns,useLocalImageEditor:ns,useCloudImageEditor:ns,cloudImageEditorTabs:is,removeCopyright:ns,cropPreset:is,imageShrink:is,modalScrollLock:ns,modalBackdropStrokes:ns,sourceListWrap:ns,remoteTabSessionKey:is,cdnCname:is,cdnCnamePrefixed:is,baseUrl:is,socialBaseUrl:is,secureSignature:is,secureExpire:is,secureDeliveryProxy:is,retryThrottledRequestMaxTimes:os,retryNetworkErrorMaxTimes:os,multipartMinFileSize:os,multipartChunkSize:os,maxConcurrentRequests:os,multipartMaxConcurrentRequests:os,multipartMaxAttempts:os,checkForUrlDuplicates:ns,saveUrlForRecurrentUploads:ns,groupOutput:ns,userAgentIntegration:is,debug:ns,localeName:is,metadata:t=>{if("object"==typeof t&&!Array.isArray(t))return t;if("function"==typeof t)return t;throw new Error("Invalid metadata value. Must be an object or function.")},secureUploadsExpireThreshold:os,localeDefinitionOverride:t=>as(t),secureUploadsSignatureResolver:t=>ss(t),secureDeliveryProxyUrlResolver:t=>ss(t),iconHrefResolver:t=>ss(t),fileValidators:cs,collectionValidators:cs,validationTimeout:os,validationConcurrency:os,cameraModes:t=>{const e=is(t),r=ji(e);if(r.some(t=>!Object.values(Qn).includes(t)))throw new Error(`Invalid value: "${JSON.stringify(r)}"`);return e},defaultCameraMode:t=>{const e=is(t);if(!Object.values(Qn).includes(e))throw new Error(`Invalid value: "${e}"`);return e},enableAudioRecording:ns,enableVideoRecording:ns,mediaRecorderOptions:as,maxVideoRecordingDuration:os,filesViewMode:t=>{const e=is(t);if(["grid","list"].includes(e))return e;throw new Error(`Invalid value: "${e}"`)},gridShowFileNames:ns,cloudImageEditorAutoOpen:ns,cloudImageEditorMaskHref:is,testMode:ns,qualityInsights:ns},us=[...new Set(["debug",...Object.keys(ko)])],ds=["metadata","localeDefinitionOverride","secureUploadsSignatureResolver","secureDeliveryProxyUrlResolver","iconHrefResolver","fileValidators","collectionValidators","mediaRecorderOptions"],hs=t=>ds.includes(t),ps=us.filter(t=>!hs(t)),gs={...Object.fromEntries(ps.map(t=>[Ya(t),t])),...Object.fromEntries(ps.map(t=>[t.toLowerCase(),t]))},ms={...Object.fromEntries(ps.map(t=>[Ya(t),Zo(t)])),...Object.fromEntries(ps.map(t=>[t.toLowerCase(),Zo(t)]))},bs=t=>`__${t}`,fs=class extends Yo{requireCtxName=!0;constructor(){super(),this.init$={...this.init$,...Object.fromEntries(Object.entries(ko).map(([t,e])=>[Zo(t),e])),computationControllers:new Map}}_flushValueToAttribute(t,e){if(!hs(t)){const r=[...new Set([Ya(t),t.toLowerCase()])];for(const t of r)null==e?this.removeAttribute(t):this.getAttribute(t)!==e.toString()&&this.setAttribute(t,e.toString())}}_flushValueToState(t,e){this.$[Zo(t)]!==e&&(this.$[Zo(t)]=null==e?ko[t]:e)}_setValue(t,e){const r=this,i=((t,e)=>{if(null!=e)try{return ls[t](e)}catch(e){return console.error(`Invalid value for config key "${t}".`,e),ko[t]}})(t,e),o=bs(t);r[o]!==i&&(this._assertSameValueDifferentReference(t,r[o],i),r[o]=i,this._flushValueToAttribute(t,i),this._flushValueToState(t,i),this.debugPrint(`[uc-config] "${t}"`,i),Qa(this.cfg))}_getValue(t){return this[bs(t)]??this.$[Zo(t)]}_assertSameValueDifferentReference(t,e,r){this.cfg.debug&&r!==e&&"object"==typeof r&&"object"==typeof e&&JSON.stringify(r)===JSON.stringify(e)&&(console.warn(`[uc-config] Option "${t}" value is the same as the previous one but the reference is different`),console.warn("[uc-config] You should avoid changing the reference of the object to prevent unnecessary calculations"),console.warn(`[uc-config] "${t}" previous value:`,e),console.warn(`[uc-config] "${t}" new value:`,r))}initCallback(){super.initCallback();const t=this;for(const t of ps)this.sub(Zo(t),e=>{this._setValue(t,e)},!1);for(const e of us){const r=t[e]??this.$[Zo(e)];r!==ko[e]&&this._setValue(e,r),Object.defineProperty(this,e,{set:t=>{this._setValue(e,t)},get:()=>this._getValue(e)})}for(const t of us)this.sub(Zo(t),()=>{rs({key:t,setValue:this._setValue.bind(this),getValue:this._getValue.bind(this),computationControllers:this.computationControllers})})}attributeChangedCallback(t,e,r){if(e===r)return;const i=this,o=gs[t];o&&(i[o]=r)}get computationControllers(){return this.$.computationControllers}};fs.bindAttributes(ms);for(const t of us)fs.prototype[t]=void 0;var vs=class extends Yo{initCallback(){super.initCallback(),this.subConfigValue("removeCopyright",t=>{this.toggleAttribute("hidden",!!t)})}static template='\n <a\n href="https://uploadcare.com/?utm_source=copyright&utm_medium=referral&utm_campaign=v4"\n target="_blank noopener"\n class="uc-credits"\n >Powered by Uploadcare</a\n >\n '};function ys(t){return new Promise(e=>{"function"!=typeof window.FileReader&&e(!1);try{const r=new FileReader;r.onerror=()=>{e(!0)};const i=t=>{"loadend"!==t.type&&r.abort(),e(!1)};r.onloadend=i,r.onprogress=i,r.readAsDataURL(t)}catch{e(!1)}})}function ws(t,e){return new Promise(r=>{let i=0;const o=[],n=t=>{if(!t)return console.warn("Unexpectedly received empty content entry",{scope:"drag-and-drop"}),void r(null);t.isFile?(i++,t.file(n=>{i--;const a=new File([n],n.name,{type:n.type||e});o.push({type:"file",file:a,fullPath:t.fullPath}),0===i&&r(o)})):t.isDirectory&&a(t.createReader())},a=t=>{i++,t.readEntries(t=>{i--;for(const e of t)n(e);0===i&&r(o)})};n(t)})}var _s=Object.freeze({ACTIVE:0,INACTIVE:1,NEAR:2,OVER:3}),ks=["focus"],xs=new Map;function Cs(t){let e=0;const r=document.body,i=new Set;let o=_s.INACTIVE;const n=e=>{t.shouldIgnore()&&e!==_s.INACTIVE||(o!==e&&i.forEach(t=>{t(e)}),o=e)},a=()=>e>0;var s;s=e=>t.onChange(e),i.add(s);const c=()=>{e=0,n(_s.INACTIVE)},l=()=>{e+=1,o===_s.INACTIVE&&n(_s.ACTIVE)},u=()=>{e-=1,a()||n(_s.INACTIVE)},d=t=>{t.preventDefault(),e=0,n(_s.INACTIVE)},h=r=>{if(t.shouldIgnore())return;a()||(e+=1);const i=[r.x,r.y],o=t.element.getBoundingClientRect(),s=Math.floor(function(t,e){const r=Math.max(Math.min(t[0],e.x+e.width),e.x),i=Math.max(Math.min(t[1],e.y+e.height),e.y);return Math.sqrt((t[0]-r)*(t[0]-r)+(t[1]-i)*(t[1]-i))}(i,o)),c=s<100,l=r.composedPath().includes(t.element);xs.set(t.element,s);const u=Math.min(...xs.values())===s;l&&u?(r.preventDefault(),n(_s.OVER)):n(c&&u?_s.NEAR:_s.ACTIVE)},p=async e=>{if(t.shouldIgnore())return;e.preventDefault();const{dataTransfer:r}=e;if(!r)return;const i=await function(t){const e=[],r=[];for(let i=0;i<t.items.length;i++){const o=t.items[i];if(o)if("file"===o.kind){const t=o.type,i=o;if("function"==typeof i.webkitGetAsEntry||"function"==typeof i.getAsEntry){const o="function"==typeof i.webkitGetAsEntry?i.webkitGetAsEntry():i.getAsEntry?.();o&&r.push(ws(o,t).then(t=>{t&&e.push(...t)}));continue}const n=o.getAsFile();n&&r.push(ys(n).then(t=>{t||e.push({type:"file",file:n})}))}else"string"===o.kind&&/^text\/uri-list/.test(o.type)&&r.push(new Promise(t=>{o.getAsString(r=>{e.push({type:"url",url:r}),t()})}))}return Promise.all(r).then(()=>e)}(r);t.onItems(i),n(_s.INACTIVE)};return r.addEventListener("drop",d),r.addEventListener("dragleave",u),r.addEventListener("dragenter",l),r.addEventListener("dragover",h),t.element.addEventListener("drop",p),ks.forEach(t=>{window.addEventListener(t,c)}),()=>{xs.delete(t.element),r.removeEventListener("drop",d),r.removeEventListener("dragleave",u),r.removeEventListener("dragenter",l),r.removeEventListener("dragover",h),t.element.removeEventListener("drop",p),ks.forEach(t=>{window.removeEventListener(t,c)})}}var Es="uc-drop-area",Ts=`${Es}/registry`,As=class extends la{static styleAttrs=[...super.styleAttrs,"uc-drop-area"];_destroyDropzone=null;_destroyContentWrapperDropzone=null;_onAreaClicked=null;constructor(){super(),this.init$={...this.init$,state:_s.INACTIVE,withIcon:!1,isClickable:!1,isFullscreen:!1,isEnabled:!0,isVisible:!0,isInitFlow:!1,text:"",[Ts]:new Set}}isActive(){if(!this.$.isEnabled)return!1;const t=this.getBoundingClientRect(),e=t.width>0&&t.height>0,r=t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth),i=window.getComputedStyle(this),o="hidden"!==i.visibility&&"none"!==i.display;return e&&o&&r}initCallback(){super.initCallback(),this.bindL10n("text",()=>this.l10n("drop-files-here"));this.$[Ts].add(this),this.defineAccessor("disabled",t=>{this.set$({isEnabled:!ns(t)})}),this.defineAccessor("clickable",t=>{this.set$({isClickable:ns(t)})}),this.defineAccessor("initflow",t=>{this.set$({isInitFlow:ns(t)})}),this.defineAccessor("with-icon",t=>{this.set$({withIcon:ns(t)})}),this.defineAccessor("fullscreen",t=>{this.set$({isFullscreen:ns(t)})}),this.defineAccessor("text",t=>{"string"==typeof t?this.bindL10n("text",()=>this.l10n(t)||t):this.bindL10n("text",()=>this.l10n("drop-files-here"))}),this._destroyDropzone=Cs({element:this,shouldIgnore:()=>this._shouldIgnore(),onChange:t=>{this.$.state=t},onItems:t=>{t.length&&(t.forEach(t=>{"url"===t.type?this.api.addFileFromUrl(t.url,{source:kn.DROP_AREA}):"file"===t.type&&this.api.addFileFromObject(t.file,{source:kn.DROP_AREA,fullPath:t.fullPath})}),this.uploadCollection.size&&(this.modalManager?.open(tn.activities.UPLOAD_LIST),this.set$({"*currentActivity":tn.activities.UPLOAD_LIST})))}});const t=this.ref["content-wrapper"];if(t&&(this._destroyContentWrapperDropzone=Cs({element:t,onChange:e=>{const r=Object.entries(_s).find(([,t])=>t===e)?.[0].toLowerCase();r&&t.setAttribute("drag-state",r)},onItems:()=>{},shouldIgnore:()=>this._shouldIgnore()})),this.sub("state",t=>{const e=Object.entries(_s).find(([,e])=>e===t)?.[0].toLowerCase();e&&this.setAttribute("drag-state",e)}),this.subConfigValue("sourceList",t=>{const e=io(t);this.$.isEnabled=e.includes(kn.LOCAL),this.$.isVisible=this.$.isEnabled||!this.querySelector("[data-default-slot]")}),this.sub("isVisible",t=>{this.toggleAttribute("hidden",!t)}),this.sub("isClickable",t=>{this.toggleAttribute("clickable",t)}),this.$.isClickable){const t=t=>{if(t instanceof KeyboardEvent){if("Space"===t.code||"Enter"===t.code){if(this.$.isInitFlow)return void this.api.initFlow();this.api.openSystemDialog()}}else if(t instanceof MouseEvent){if(this.$.isInitFlow)return void this.api.initFlow();this.api.openSystemDialog()}};this._onAreaClicked=t,this.addEventListener("keydown",t),this.addEventListener("click",t)}}_shouldIgnore(){if(!this.$.isEnabled)return!0;if(!this._couldHandleFiles())return!0;if(!this.$.isFullscreen)return!1;const t=this.$[Ts];if(0===t.size)return!1;return[...t].filter(t=>t!==this).filter(t=>t.isActive()).length>0}_couldHandleFiles(){const t=this.cfg.multiple,e=this.cfg.multipleMax,r=this.uploadCollection.size;return!(t&&e&&r>=e)&&!(!t&&r>0)}destroyCallback(){super.destroyCallback();const t=this.$[Ts];t.delete(this),0===t.size&&we.deleteCtx(Es),this._destroyDropzone?.(),this._destroyContentWrapperDropzone?.(),this._onAreaClicked&&(this.removeEventListener("keydown",this._onAreaClicked),this.removeEventListener("click",this._onAreaClicked),this._onAreaClicked=null)}};As.template='\n <slot>\n <div data-default-slot hidden></div>\n <div ref="content-wrapper" class="uc-content-wrapper" set="@hidden: !isVisible">\n <div class="uc-icon-container" set="@hidden: !withIcon">\n <uc-icon name="default"></uc-icon>\n <uc-icon name="arrow-down"></uc-icon>\n </div>\n <span class="uc-text">{{text}}</span>\n </div>\n </slot>\n',As.bindAttributes({"with-icon":null,clickable:null,text:null,fullscreen:null,disabled:null,initflow:null});var Is=()=>{const t=globalThis.top??globalThis.parent??globalThis.self;try{return t.location.origin}catch(t){return console.warn("Unable to access top-level window location:",t),globalThis.location.origin}},Ss=t=>t.replace(/[\\-\\[]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),Ms=(t,e="i")=>{const r=t.split("*").map(Ss);return new RegExp(`^${r.join(".+")}$`,e)},$s=["--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"],Ls=(t,e)=>window.getComputedStyle(t).getPropertyValue(e).trim(),Os=t=>{const e={};for(const r of $s){const i=Ls(t,r);i&&(e[r]=i)}return e},Us=["selected-files-change","toolbar-state-change"],Rs=class{_handlerMap=new Map;_context;_getTargetOrigin;constructor(t,e){this._context=t,this._getTargetOrigin=e,window.addEventListener("message",this._handleMessage)}_handleMessage=t=>{if(t.source!==this._context)return;const e=t.data;if(!(t=>{if(!t)return!1;if("object"!=typeof t)return!1;if(!("type"in t))return!1;const e=t.type;return"string"==typeof e&&!!Us.includes(e)})(e))return;const r=this._handlerMap.get(e.type);if(r)for(const t of r)t(e)};on(t,e){const r=this._handlerMap.get(t)??new Set;this._handlerMap.has(t)||this._handlerMap.set(t,r),r.add(e)}send(t){const e=this._getTargetOrigin();this._context.postMessage(t,e)}destroy(){window.removeEventListener("message",this._handleMessage)}};var Ps={[wn.GDRIVE]:"ngdrive"},Ns=class extends la{couldBeCtxOwner=!0;activityType=tn.activities.EXTERNAL;_messageBridge;constructor(){super(),this.init$={...this.init$,activityIcon:"",activityCaption:"",selectedList:[],total:0,isSelectionReady:!1,isDoneBtnEnabled:!1,couldSelectAll:!1,couldDeselectAll:!1,showSelectionStatus:!1,showDoneBtn:!1,counterText:"",doneBtnTextClass:"uc-hidden",toolbarVisible:!0,onDone:()=>{for(const t of this.$.selectedList){const e=this.extractUrlFromSelectedFile(t),{filename:r}=t,{externalSourceType:i}=this.activityParams;this.api.addFileFromUrl(e,{fileName:r,source:i})}this.$["*currentActivity"]=tn.activities.UPLOAD_LIST,this.modalManager?.open(tn.activities.UPLOAD_LIST)},onCancel:()=>{this.historyBack()},onSelectAll:()=>{this._messageBridge?.send({type:"select-all"})},onDeselectAll:()=>{this._messageBridge?.send({type:"deselect-all"})}}}get activityParams(){const t=super.activityParams;if("externalSourceType"in t)return t;throw new Error("External Source activity params not found")}initCallback(){super.initCallback(),this.registerActivity(this.activityType,{onActivate:()=>{const{externalSourceType:t}=this.activityParams;if(!t)return this.modalManager?.close(this.$["*currentActivity"]),this.$["*currentActivity"]=null,void console.error(`Param "externalSourceType" is required for activity "${this.activityType}"`);this.set$({activityCaption:`${t[0]?.toUpperCase()}${t?.slice(1)}`,activityIcon:t}),this.mountIframe()}}),this.sub("*currentActivityParams",t=>{this.isActivityActive&&(this.unmountIframe(),this.mountIframe())}),this.sub("*currentActivity",t=>{t!==this.activityType&&this.unmountIframe()}),this.subConfigValue("multiple",t=>{this.$.showSelectionStatus=t}),this.subConfigValue("localeName",t=>{this.setupL10n()}),this.subConfigValue("externalSourcesEmbedCss",t=>{this.applyEmbedCss(t)})}extractUrlFromSelectedFile(t){if(t.alternatives){const e=io(this.cfg.externalSourcesPreferredTypes);for(const r of e){const e=Ms(r);for(const[r,i]of Object.entries(t.alternatives))if(e.test(r))return i}}return t.url}handleToolbarStateChange(t){this.set$({toolbarVisible:t.isVisible})}async handleSelectedFilesChange(t){this.cfg.multiple===t.isMultipleMode?(this.bindL10n("counterText",()=>this.l10n("selected-count",{count:t.selectedCount,total:t.total})),this.set$({doneBtnTextClass:t.isReady?"":"uc-hidden",isSelectionReady:t.isReady,isDoneBtnEnabled:t.isReady&&t.selectedFiles.length>0,showSelectionStatus:t.isMultipleMode&&t.total>0,couldSelectAll:t.selectedCount<t.total,couldDeselectAll:t.selectedCount===t.total,selectedList:t.selectedFiles,showDoneBtn:t.total>0})):console.error("Multiple mode mismatch")}handleIframeLoad(){this.applyEmbedCss(this.cfg.externalSourcesEmbedCss),this.applyTheme(),this.setupL10n()}applyTheme(){this._messageBridge?.send({type:"set-theme-definition",theme:Os(this)})}applyEmbedCss(t){this._messageBridge?.send({type:"set-embed-css",css:t})}setupL10n(){this._messageBridge?.send({type:"set-locale-definition",localeDefinition:this.cfg.localeName})}remoteUrl(){const{pubkey:t,remoteTabSessionKey:e,socialBaseUrl:r,multiple:i}=this.cfg,{externalSourceType:o}=this.activityParams,n=Ps[o]??o,a={lang:this.l10n("social-source-lang")?.split("-")?.[0]||"en",public_key:t,images_only:(!1).toString(),session_key:e,wait_for_theme:!0,multiple:i.toString(),origin:this.cfg.topLevelOrigin||Is(),debug:this.cfg.debug},s=new URL(`/window4/${n}`,r);return s.search=function(t){const e=[];for(const[r,i]of Object.entries(t))null==i||"string"==typeof i&&0===i.length||e.push(`${r}=${encodeURIComponent(i)}`);return e.join("&")}(a),s.toString()}mountIframe(){const t=Ve({tag:"iframe",attributes:{src:this.remoteUrl(),marginheight:0,marginwidth:0,frameborder:0,allowTransparency:!0}});t.addEventListener("load",this.handleIframeLoad.bind(this)),this.ref.iframeWrapper.innerHTML="",this.ref.iframeWrapper.appendChild(t),t.contentWindow&&(this._messageBridge?.destroy(),this._messageBridge=new Rs(t.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.ref.iframeWrapper.innerHTML="",this.resetSelectionStatus()}resetSelectionStatus(){this.set$({selectedList:[],total:0,isDoneBtnEnabled:!1,couldSelectAll:!1,couldDeselectAll:!1,showSelectionStatus:!1,showDoneBtn:!1})}};Ns.template='\n <uc-activity-header>\n <button\n type="button"\n class="uc-mini-btn uc-close-btn"\n set="onclick: *historyBack"\n l10n="@title:a11y-activity-header-button-close;@aria-label:a11y-activity-header-button-close"\n >\n <uc-icon name="close"></uc-icon>\n </button>\n </uc-activity-header>\n <div class="uc-content">\n <div ref="iframeWrapper" class="uc-iframe-wrapper"></div>\n <div class="uc-toolbar" set="@hidden: !toolbarVisible">\n <button type="button" class="uc-cancel-btn uc-secondary-btn" set="onclick: onCancel" l10n="cancel"></button>\n <div set="@hidden: !showSelectionStatus" class="uc-selection-status-box">\n <span>{{counterText}}</span>\n <button type="button" set="onclick: onSelectAll; @hidden: !couldSelectAll" l10n="select-all"></button>\n <button type="button" set="onclick: onDeselectAll; @hidden: !couldDeselectAll" l10n="deselect-all"></button>\n </div>\n <button\n type="button"\n class="uc-done-btn uc-primary-btn"\n set="onclick: onDone; @disabled: !isDoneBtnEnabled; @hidden: !showDoneBtn"\n >\n <uc-spinner set="@hidden: isSelectionReady"></uc-spinner>\n <span l10n="done" set="@class: doneBtnTextClass"></span>\n </button>\n </div>\n </div>\n';var Ds=/^([0-9]+)x([0-9]+)(?:\s+(\d{1,2}|100)%)?$/i,zs=class extends la{_entrySubs=new Set;_entry=null;_withEntry(t){return(...e)=>{const r=this._entry;if(r)return t(r,...e);console.warn("No entry found")}}_subEntry(t,e){this._withEntry((t,e,r)=>{const i=t.subscribe(e,t=>{this.isConnected&&r(t)});this._entrySubs.add(i)})(t,e)}_reset(){for(const t of this._entrySubs)t.remove();this._entrySubs=new Set,this._entry=null}disconnectedCallback(){super.disconnectedCallback(),this._entrySubs=new Set}},Vs=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")}),Fs=class t extends zs{couldBeCtxOwner=!0;pauseRender=!0;_renderedOnce=!1;_observer;_isIntersecting=!1;_thumbRect;constructor(){super(),this.init$={...this.init$,uid:"",itemName:"",errorText:"",hint:"",thumbUrl:"",progressValue:0,progressVisible:!1,badgeIcon:"",isFinished:!1,isFailed:!1,isUploading:!1,isFocused:!1,isEditable:!1,showFileNames:!1,state:Vs.IDLE,ariaLabelStatusFile:"",onEdit:this._withEntry(t=>{this.telemetryManager.sendEvent({eventType:zi.ACTION_EVENT,payload:{metadata:{event:"edit-file",node:this.tagName}}}),this.$["*currentActivityParams"]={internalId:t.uid},this.modalManager?.open(tn.activities.CLOUD_IMG_EDIT),this.$["*currentActivity"]=tn.activities.CLOUD_IMG_EDIT}),onRemove:()=>{this.telemetryManager.sendEvent({eventType:zi.ACTION_EVENT,payload:{metadata:{event:"remove-file",node:this.tagName}}}),this.uploadCollection.remove(this.$.uid)},onUpload:()=>{this.upload()}}}_calculateState=this._withEntry(t=>{let e=Vs.IDLE;t.getValue("errors").length>0?e=Vs.FAILED:t.getValue("isQueuedForUploading")?e=Vs.QUEUED_UPLOADING:t.getValue("isQueuedForValidation")?e=Vs.QUEUED_VALIDATION:t.getValue("isValidationPending")?e=Vs.VALIDATION:t.getValue("isUploading")?e=Vs.UPLOADING:t.getValue("fileInfo")&&(e=Vs.FINISHED),this.$.state=e});_debouncedCalculateState=Bi(this._calculateState.bind(this),100);_updateHintAndProgress=this._withEntry(Ua((t,e)=>{const r=t.getValue("errors")?.[0]?.message,i=t.getValue("source"),o=t.getValue("externalUrl"),n=e===Vs.FINISHED,a=e===Vs.UPLOADING,s=e===Vs.QUEUED_UPLOADING,c=e===Vs.QUEUED_VALIDATION,l=e===Vs.VALIDATION,u=t.getValue("fileName");let d="";r?d="":!n&&o&&i&&Object.values(wn).includes(i)&&(d=this.l10n("waiting-for",{source:this.l10n(`src-type-${i}`)})),this.set$({hint:d,errorText:r,progressVisible:a||s||c||l,progressValue:c||l?0:t.getValue("uploadProgress"),ariaLabelStatusFile:u&&this.l10n("a11y-file-item-status",{fileName:u,status:this.l10n(e?.description?.toLocaleLowerCase()??"").toLocaleLowerCase()})})},100));_handleState=this._withEntry((t,e)=>{e===Vs.FAILED?this.$.badgeIcon="badge-error":e===Vs.FINISHED&&(this.$.badgeIcon="badge-success"),e===Vs.UPLOADING&&(this.$.isFocused=!1),this.set$({isFailed:e===Vs.FAILED,isUploading:e===Vs.UPLOADING,isFinished:e===Vs.FINISHED,isEditable:this.cfg.useCloudImageEditor&&t.getValue("isImage")&&t.getValue("cdnUrl")}),this._updateHintAndProgress(e)});_reset(){super._reset(),this._debouncedCalculateState.cancel()}_observerCallback(t){const[e]=t;e&&(this._isIntersecting=e.isIntersecting,this._thumbRect=e.boundingClientRect,e.isIntersecting&&!this._renderedOnce&&(this.render(),this._renderedOnce=!0))}_handleEntryId(t){this._reset();const e=this.uploadCollection?.read(t);this._entry=e,e&&(this._subEntry("isQueuedForValidation",()=>{this._debouncedCalculateState()}),this._subEntry("isValidationPending",()=>{this._debouncedCalculateState()}),this._subEntry("uploadProgress",()=>{this._debouncedCalculateState()}),this._subEntry("isQueuedForUploading",()=>{this._debouncedCalculateState()}),this._subEntry("fileName",t=>{this.$.itemName=t||e.getValue("externalUrl")||this.l10n("file-no-name"),this._debouncedCalculateState()}),this._subEntry("externalUrl",t=>{this.$.itemName=e.getValue("fileName")||t||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()))}_updateShowFileNames(t){"list"===this.cfg.filesViewMode?this.$.showFileNames=!0:this.$.showFileNames=t}initCallback(){super.initCallback(),this.sub("uid",t=>{this._handleEntryId(t)}),this.sub("state",t=>{this._handleState(t)}),this.subConfigValue("useCloudImageEditor",()=>this._debouncedCalculateState()),this.subConfigValue("filesViewMode",t=>{this._updateShowFileNames(this.cfg.gridShowFileNames),this.setAttribute("mode",t)}),this.subConfigValue("gridShowFileNames",t=>{this._updateShowFileNames(t)}),this.onclick=()=>{t.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())}),t.activeInstances.add(this)}destroyCallback(){super.destroyCallback(),t.activeInstances.delete(this),this._reset()}connectedCallback(){super.connectedCallback(),this._observer=new window.IntersectionObserver(this._observerCallback.bind(this),{threshold:[0,1]}),this._observer.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}_settingsOfShrink(){return(t=>{if("string"!=typeof t)return!1;const e=Ds.exec(t.toLocaleLowerCase())??[];if(0===e.length)return!1;const r=Number(e[1])*Number(e[2]);return r>268435456?(console.warn(`Shrinked size can not be larger than ${Math.floor(268.435456)}MP. You have set ${e[1]}x${e[2]} (${Math.ceil(r/1e3/100)/10}MP).`),!1):{quality:e[3]?Number(e[3])/100:void 0,size:r}})(this.cfg.imageShrink)}async _processShrink(t){const e=this._settingsOfShrink();return e?await Di(t,e):(console.warn("Image shrink settings are invalid, skipping shrinking"),t)}upload=this._withEntry(async t=>{if(!this.uploadCollection.read(t.uid))return;if(t.getValue("fileInfo")||t.getValue("isUploading")||t.getValue("errors").length>0||t.getValue("isValidationPending"))return;const e=this.cfg.multiple?this.cfg.multipleMax:1;if(!(e&&this.uploadCollection.size>e)){t.setMultipleValues({isUploading:!0,errors:[],isQueuedForUploading:!0}),this._debouncedCalculateState();try{const e=new AbortController;t.setValue("abortController",e);const r=async()=>{t.setValue("isQueuedForUploading",!1);let r=t.getValue("file");if(r instanceof File&&this.cfg.imageShrink)try{r=await this._processShrink(r)}catch{}const i=r||t.getValue("externalUrl")||t.getValue("uuid");if(!i)throw new Error("No file input");const o={...await this.getUploadClientOptions(),fileName:t.getValue("fileName")??void 0,source:t.getValue("source")??void 0,onProgress:e=>{if(e.isComputable){const r=100*e.value;t.setValue("uploadProgress",r)}},signal:e.signal,metadata:await this.getMetadataFor(t.uid)};return this.debugPrint("upload options",i,o),Kr(i,o)},i=await this.$["*uploadQueue"].add(r);t.setMultipleValues({fileInfo:i,isQueuedForUploading:!1,isUploading:!1,fileName:i.originalFilename,fileSize:i.size,isImage:i.isImage??!1,mimeType:i.contentInfo?.mime?.mime??i.mimeType,uuid:i.uuid,cdnUrl:t.getValue("cdnUrl")??i.cdnUrl,cdnUrlModifiers:t.getValue("cdnUrlModifiers")??"",uploadProgress:100,source:t.getValue("source")??null}),t===this._entry&&this._debouncedCalculateState()}catch(e){this.telemetryManager.sendEventError(e,"file upload. Failed to upload file"),e instanceof er&&e.isCancel?t.setMultipleValues({isUploading:!1,uploadProgress:0}):e instanceof Je?t.setMultipleValues({isUploading:!1,uploadProgress:0,uploadError:e}):(console.error("Unknown upload error",e),t.setMultipleValues({isUploading:!1,uploadProgress:0,uploadError:new Error("Something went wrong",{cause:e})})),t===this._entry&&this._debouncedCalculateState()}}});static template='\n <div class="uc-inner" set="@finished: isFinished; @uploading: isUploading; @failed: isFailed; @focused: isFocused">\n <uc-thumb set="uid:uid;badgeIcon:badgeIcon"></uc-thumb>\n\n <div aria-atomic="true" aria-live="polite" class="uc-file-name-wrapper" set="@aria-label:ariaLabelStatusFile;">\n <span class="uc-file-name" set="@hidden: !showFileNames">{{itemName}}</span>\n <span class="uc-file-error" set="@hidden: !errorText;">{{errorText}}</span>\n <span class="uc-file-hint" set="@hidden: !hint">{{hint}}</span>\n </div>\n <div class="uc-file-actions">\n <button\n type="button"\n l10n="@title:file-item-edit-button;@aria-label:file-item-edit-button"\n class="uc-edit-btn uc-mini-btn"\n set="onclick: onEdit; @hidden: !isEditable"\n >\n <uc-icon name="edit-file"></uc-icon>\n </button>\n <button\n type="button"\n l10n="@title:file-item-remove-button;@aria-label:file-item-remove-button"\n class="uc-remove-btn uc-mini-btn"\n set="onclick: onRemove;"\n >\n <uc-icon name="remove-file"></uc-icon>\n </button>\n <button type="button" class="uc-upload-btn uc-mini-btn" set="onclick: onUpload;">\n <uc-icon name="upload"></uc-icon>\n </button>\n </div>\n <uc-progress-bar\n class="uc-progress-bar"\n set="value: progressValue; visible: progressVisible; @hasFileName: showFileNames;"\n >\n </uc-progress-bar>\n </div>\n';static activeInstances=new Set},Bs=class extends la{requireCtxName=!0;_validationInputElement=null;_dynamicInputsContainer=null;_createValidationInput(){const t=document.createElement("input");return t.type="text",t.name=this.ctxName,t.required=this.cfg.multipleMin>0,t.tabIndex=-1,ze(t,{opacity:0,height:0,width:0}),t}initCallback(){super.initCallback(),this._validationInputElement=this._createValidationInput(),this.appendChild(this._validationInputElement),this.sub("*collectionState",t=>{{if(!this._dynamicInputsContainer){const t=document.createElement("div");this.appendChild(t),this._dynamicInputsContainer=t}if(!this._validationInputElement){const t=this._createValidationInput();this.appendChild(t),this._validationInputElement=t}if(this._dynamicInputsContainer.innerHTML="","uploading"===t.status||"idle"===t.status)return this._validationInputElement.value="",void this._validationInputElement.setCustomValidity("");if("failed"===t.status){const e=t.errors[0]?.message;return this._validationInputElement.value="",void this._validationInputElement.setCustomValidity(e??"")}const e=t.group?t.group:null;if(e)return this._validationInputElement.value=e.cdnUrl??"",void this._validationInputElement.setCustomValidity("");const r=t.allEntries.map(t=>t.cdnUrl).filter(t=>"string"==typeof t);if(!this.cfg.multiple&&1===r.length&&r[0])return this._validationInputElement.value=r[0],void this._validationInputElement.setCustomValidity("");this._validationInputElement.remove(),this._validationInputElement=null;const i=new DocumentFragment;for(const t of r){const e=document.createElement("input");e.type="hidden",e.name=`${this.ctxName}[]`,e.value=t,i.appendChild(e)}this._dynamicInputsContainer.replaceChildren(i)}},!1)}},js=class extends Yo{constructor(){super(),this.init$={...this.init$,name:"",href:""}}initCallback(){super.initCallback(),this.sub("name",t=>{if(!t)return;let e=`#uc-icon-${t}`;this.subConfigValue("iconHrefResolver",r=>{if(r){const i=r(t);e=i??e}this.$.href=e})}),this.setAttribute("aria-hidden","true")}};js.template='\n <svg ref="svg" xmlns="http://www.w3.org/2000/svg">\n <use set="@href: href;"></use>\n </svg>\n',js.bindAttributes({name:"name"});var Hs="--uc-img-",qs="unresolved",Ks=!window.location.host.trim()||window.location.host.includes(":")||window.location.hostname.includes("localhost"),Gs=Object.freeze({PREVIEW:"PREVIEW",MAIN:"MAIN"}),Ws=Object.freeze({"dev-mode":{},pubkey:{},uuid:{},src:{},lazy:{default:1},intersection:{},breakpoints:{},"cdn-cname":{default:"https://ucarecdn.com"},"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}}),Zs=Object.create(null);for(const t in Ws)Zs[Hs+t]=Ws[t]?.default||"";var Xs=class extends Ne{cssInit$=Zs;$$(t){return this.$[Hs+t]}set$$(t){for(const e in t)this.$[Hs+e]=t[e]}sub$$(t,e){this.sub(Hs+t,t=>{null!==t&&""!==t&&e(t)})}analyticsParams(){return`-/@clib/${Ko}/${Go}/uc-img/`}initAttributes(t){[...this.attributes].forEach(e=>{Ws[e.name]||t.setAttribute(e.name,e.value)})}initIntersection(t,e){this._isnObserver=new IntersectionObserver(r=>{r.forEach(r=>{r.isIntersecting&&(e(),this._isnObserver.unobserve(t))})},{root:null,rootMargin:"0px"}),this._isnObserver.observe(t),this._observed||(this._observed=new Set),this._observed.add(t)}destroyCallback(){super.destroyCallback(),this._isnObserver&&(this._observed.forEach(t=>{this._isnObserver.unobserve(t)}),this._isnObserver=null),we.deleteCtx(this)}static get observedAttributes(){return Object.keys(Ws)}attributeChangedCallback(t,e,r){window.setTimeout(()=>{this.$[Hs+t]=r})}},Ys=class extends Xs{_img=new Image;_imgPreview=new Image;_fmtAbs(t){return!t.includes("//")&&!Ks&&(t=new URL(t,document.baseURI).href),t}_validateSize(t){if(""!==t?.trim()){const e=t.match(/\d+/)[0],r=t.match(/[a-zA-Z]+/)[0],i=parseInt(e,10);if(Number(i)>5e3&&this.hasFormatJPG)return 5e3+r;if(Number(i)>3e3&&!this.hasFormatJPG)return 3e3+r}return t}_getCdnModifiers(t,e){const r={format:this.$$("format"),quality:this.$$("quality"),resize:this._validateSize(t),blur:e,"cdn-operations":this.$$("cdn-operations"),analytics:this.analyticsParams()};return Gi(...(t=>Object.entries(t).filter(([t,e])=>void 0!==e&&""!==e).map(([t,e])=>"cdn-operations"===t||"analytics"===t?e:`${t}/${e}`))(r))}_getUrlBase(t="",e=""){if(this.$$("src").startsWith("data:")||this.$$("src").startsWith("blob:"))return this.$$("src");if(Ks&&this.$$("src")&&!this.$$("src").includes("//"))return this._proxyUrl(this.$$("src"));const r=this._getCdnModifiers(t,e);return this.$$("src").startsWith(this.$$("cdn-cname"))?eo(this.$$("src"),r):this.$$("cdn-cname")&&this.$$("uuid")||this.$$("uuid")?this._proxyUrl(eo(ro(this.$$("cdn-cname"),this.$$("uuid")),r)):this.$$("proxy-cname")?this._proxyUrl(eo(this.$$("proxy-cname"),r,this._fmtAbs(this.$$("src")))):this.$$("pubkey")?this._proxyUrl(eo(`https://${this.$$("pubkey")}.ucr.io/`,r,this._fmtAbs(this.$$("src")))):void 0}_proxyUrl(t){return this.$$("secure-delivery-proxy")?Io(this.$$("secure-delivery-proxy"),{previewUrl:t},{transform:t=>window.encodeURIComponent(t)}):t}_getElSize(t,e=1,r=!0){const i=t.getBoundingClientRect(),o=e*Math.round(i.width),n=r?"":e*Math.round(i.height);return o||n?`${o||""}x${n||""}`:null}_setupEventProxy(t){const e=t=>{t.stopPropagation();const e=new Event(t.type,t);this.dispatchEvent(e)},r=["load","error"];for(const i of r)t.addEventListener(i,e)}get img(){return this.hasPreviewImage||(this._setupConfigForImage({elNode:this._img}),this.appendChild(this._img)),this._img}get currentImg(){return this.hasPreviewImage?{type:Gs.PREVIEW,img:this._imgPreview}:{type:Gs.MAIN,img:this.img}}get hasPreviewImage(){return this.$$("is-preview-blur")}get bgSelector(){return this.$$("is-background-for")}get breakpoints(){if(this.$$("breakpoints")){const e=io(this.$$("breakpoints"));return t=e.map(t=>parseInt(t,10)),[...new Set(t)]}return null;var t}get hasFormatJPG(){return"jpeg"===this.$$("format").toLowerCase()}renderBg(t){const e=new Set;e.add(`url("${this._getUrlBase(this._getElSize(t))}") 1x`),this.$$("hi-res-support")&&e.add(`url("${this._getUrlBase(this._getElSize(t,2))}") 2x`),this.$$("ultra-res-support")&&e.add(`url("${this._getUrlBase(this._getElSize(t,3))}") 3x`);const r=`image-set(${[...e].join(", ")})`;t.style.setProperty("background-image",r),t.style.setProperty("background-image","-webkit-"+r)}getSrcset(){const t=new Set;return this.breakpoints?this.breakpoints.forEach(e=>{t.add(this._getUrlBase(e+"x")+` ${this._validateSize(e+"w")}`),this.$$("hi-res-support")&&t.add(this._getUrlBase(2*e+"x")+` ${this._validateSize(2*e+"w")}`),this.$$("ultra-res-support")&&t.add(this._getUrlBase(3*e+"x")+` ${this._validateSize(3*e+"w")}`)}):(t.add(this._getUrlBase(this._getElSize(this.currentImg.img))+" 1x"),this.$$("hi-res-support")&&t.add(this._getUrlBase(this._getElSize(this.currentImg.img,2))+" 2x"),this.$$("ultra-res-support")&&t.add(this._getUrlBase(this._getElSize(this.currentImg.img,3))+" 3x")),[...t].join()}getSrc(){return this._getUrlBase()}get srcUrlPreview(){return this._getUrlBase("100x","100")}renderBackground(){[...document.querySelectorAll(this.bgSelector)].forEach(t=>{this.$$("intersection")?this.initIntersection(t,()=>{this.renderBg(t)}):this.renderBg(t)})}_appendURL({elNode:t,src:e,srcset:r}){e&&(t.src=e),r&&(t.srcset=r)}_setupConfigForImage({elNode:t}){this._setupEventProxy(t),this.initAttributes(t)}loaderImage({src:t,srcset:e,elNode:r}){return new Promise((i,o)=>{this._setupConfigForImage({elNode:r}),r.setAttribute(qs,""),r.addEventListener("load",()=>{r.removeAttribute(qs),i(r)}),r.addEventListener("error",()=>{o(!1)}),this._appendURL({elNode:r,src:t,srcset:e})})}async renderImage(){if(this.$$("intersection"))return this.hasPreviewImage&&(this._setupConfigForImage({elNode:this._imgPreview}),this.appendChild(this._imgPreview)),void 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(t){this.hasPreviewImage&&await(this._imgPreview?.remove()),this.appendChild(this._img)}});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(t){this.hasPreviewImage&&await(this._imgPreview?.remove()),this.appendChild(this._img)}}init(){this.bgSelector?this.renderBackground():this.renderImage()}},Js=class extends Ys{initCallback(){super.initCallback(),this.sub$$("src",()=>{this.init()}),this.sub$$("uuid",()=>{this.init()}),this.sub$$("lazy",t=>{this.$$("is-background-for")||this.$$("is-preview-blur")||(this.img.loading=t?"lazy":"eager")})}},Qs=null,tc=class extends Yo{static styleAttrs=[...super.styleAttrs,"uc-modal"];static StateConsumerScope="modal";_mouseDownTarget;handleModalOpen;handleModalClose;handleModalCloseAll;constructor(){super(),this.init$={...this.init$,closeClicked:this._handleDialogClose}}_handleBackdropClick=()=>{this._closeDialog()};_closeDialog=()=>{this.modalManager?.close(this.id),this.modalManager?.hasActiveModals||(document.body.style.overflow="")};_handleDialogClose=()=>{this._closeDialog()};_handleDialogMouseDown=t=>{this._mouseDownTarget=t.target};_handleDialogMouseUp=t=>{const e=t.target;e===this.ref.dialog&&e===this._mouseDownTarget&&this._closeDialog()};show(){const t=this.ref.dialog;"function"==typeof t.showModal?(this.setAttribute("aria-modal","true"),t.showModal()):t.setAttribute("open",""),this.cfg.modalScrollLock&&(document.body.style.overflow="hidden")}hide(){const t=this.ref.dialog;"function"==typeof t.close?(this.setAttribute("aria-modal","false"),t.close()):t.removeAttribute("open")}_handleModalOpen({id:t}){t===this.id?(Qs=t,this.show(),this.emit(Vi.MODAL_OPEN,{modalId:t},{debounce:!0})):this.hide()}_handleModalClose({id:t}){t===this.id&&(this.hide(),this.emit(Vi.MODAL_CLOSE,{modalId:t,hasActiveModals:this.modalManager?.hasActiveModals},{debounce:!0}))}_handleModalCloseAll(t){this.hide(),Qs===this.id&&this.emit(Vi.MODAL_CLOSE,{modalId:Qs,hasActiveModals:this.modalManager?.hasActiveModals},{debounce:!0})}initCallback(){super.initCallback(),this.modalManager?.registerModal(this.id,this);const t=this.ref.dialog;t.addEventListener("close",this._handleDialogClose),t.addEventListener("mousedown",this._handleDialogMouseDown),t.addEventListener("mouseup",this._handleDialogMouseUp),this.subConfigValue("modalBackdropStrokes",t=>{t?this.setAttribute("strokes",""):this.removeAttribute("strokes")}),this.handleModalOpen=this._handleModalOpen.bind(this),this.handleModalClose=this._handleModalClose.bind(this),this.handleModalCloseAll=this._handleModalCloseAll.bind(this),this.modalManager?.subscribe(Ho.OPEN,this.handleModalOpen),this.modalManager?.subscribe(Ho.CLOSE,this.handleModalClose),this.modalManager?.subscribe(Ho.CLOSE_ALL,this.handleModalCloseAll)}destroyCallback(){super.destroyCallback(),document.body.style.overflow="",this._mouseDownTarget=void 0;const t=this.ref.dialog;t.removeEventListener("close",this._handleDialogClose),t.removeEventListener("mousedown",this._handleDialogMouseDown),t.removeEventListener("mouseup",this._handleDialogMouseUp),this.modalManager?.unsubscribe(Ho.OPEN,this.handleModalOpen),this.modalManager?.unsubscribe(Ho.CLOSE,this.handleModalClose),this.modalManager?.unsubscribe(Ho.CLOSE_ALL,this.handleModalCloseAll)}};tc.template='\n <dialog ref="dialog">\n <slot></slot>\n </dialog>\n';var ec=class extends Yo{_value=0;_visible=!0;constructor(){super(),this.init$={...this.init$,width:0,opacity:0}}initCallback(){super.initCallback();this.ref.fakeProgressLine.addEventListener("animationiteration",()=>{const t=this.ref.fakeProgressLine;this._visible?this._value>0&&t.classList.add("uc-fake-progress--hidden"):t.classList.add("uc-fake-progress--hidden")}),this.defineAccessor("value",t=>{null!=t&&(this._value=t,this._visible&&this.style.setProperty("--l-progress-value",this._value.toString()))}),this.defineAccessor("visible",t=>{this._visible=t,this.classList.toggle("uc-progress-bar--hidden",!t)})}};ec.template='\n <div ref="fakeProgressLine" class="uc-fake-progress"></div>\n <div ref="realProgressLine" class="uc-progress"></div>\n';var rc=class extends la{_unobserveCollectionCb;constructor(){super(),this.init$={...this.init$,visible:!1,value:0,"*commonProgress":0}}initCallback(){super.initCallback(),this._unobserveCollectionCb=this.uploadCollection.observeProperties(()=>{const t=this.uploadCollection.items().some(t=>{const e=this.uploadCollection.read(t);return e?.getValue("isUploading")??!1});this.$.visible=t}),this.sub("visible",t=>{t?this.setAttribute("active",""):this.removeAttribute("active")}),this.sub("*commonProgress",t=>{this.$.value=t})}destroyCallback(){super.destroyCallback(),this._unobserveCollectionCb?.(),this._unobserveCollectionCb=void 0}};rc.template=' <uc-progress-bar set="visible: visible; value: value"></uc-progress-bar> ';var ic=class extends Yo{constructor(){super(),this.init$={...this.init$,currentText:"",options:[],selectHtml:"",onSelect:t=>{t.preventDefault(),t.stopPropagation();const e=this.ref.select;this.value=e.value,this.$.currentText=this.$.options.find(t=>t.value===this.value)?.text||"",this.dispatchEvent(new Event("change"))}}}initCallback(){super.initCallback(),this.sub("options",t=>{this.$.currentText=t?.[0]?.text||"";let e="";t?.forEach(t=>{e+=`<option value="${t.value}">${t.text}</option>`}),this.$.selectHtml=e})}};ic.template=' <select ref="select" set="innerHTML: selectHtml; onchange: onSelect"></select> ';var oc=class extends la{static styleAttrs=[...super.styleAttrs,"uc-simple-btn"];couldBeCtxOwner=!0;constructor(){super(),this.init$={...this.init$,withDropZone:!0,onClick:()=>{this.api.initFlow()},"button-text":""}}initCallback(){super.initCallback(),this.defineAccessor("dropzone",t=>{void 0!==t&&(this.$.withDropZone=ns(t))}),this.subConfigValue("multiple",t=>{this.$["button-text"]=t?"upload-files":"upload-file"})}};oc.template='\n <uc-drop-area set="@disabled: !withDropZone">\n <button type="button" set="onclick: onClick">\n <uc-icon name="upload"></uc-icon>\n <span l10n="button-text"></span>\n <slot></slot>\n <div class="uc-visual-drop-area" l10n="drop-files-here"></div>\n </button>\n </uc-drop-area>\n',oc.bindAttributes({dropzone:null});var nc=class extends la{couldBeCtxOwner=!0;type=void 0;_registeredTypes={};constructor(){super(),this.init$={...this.init$,iconName:"default","src-type":""}}initTypes(){this.registerType({type:kn.LOCAL,activate:()=>(this.api.openSystemDialog(),!1)}),this.registerType({type:kn.URL,activity:tn.activities.URL,textKey:"from-url"}),this.registerType({type:kn.CAMERA,activity:tn.activities.CAMERA,activate:()=>{const t=Sn.htmlMediaCapture;return t&&this.api.openSystemDialog({captureCamera:!0}),!t}}),this.registerType({type:"draw",activity:tn.activities.DRAW,icon:"edit-draw"});for(const t of Object.values(_n))this.registerType({type:t,activity:tn.activities.CAMERA,activate:()=>{const e=Sn.htmlMediaCapture;return e&&this.api.openSystemDialog({captureCamera:!0,modeCamera:"mobile-photo-camera"===t?Qn.PHOTO:Qn.VIDEO}),!e}});for(const t of Object.values(wn))this.registerType({type:t,activity:tn.activities.EXTERNAL,activityParams:{externalSourceType:t}})}initCallback(){super.initCallback(),this.initTypes(),this.defineAccessor("type",t=>{t&&this.applyType(t)})}registerType(t){this._registeredTypes[t.type]=t}getType(t){return this._registeredTypes[t]}activate(){if(!this.type)return;const t=this._registeredTypes[this.type];if(!t)return;const{activity:e,activate:r,activityParams:i={}}=t;(r?r():!!e)&&e&&(this.modalManager?.open(e),this.set$({"*currentActivityParams":i,"*currentActivity":e}))}applyType(t){const e=this._registeredTypes[t];if(!e)return void console.warn(`Unsupported source type: ${t}`);const{textKey:r=t,icon:i=t}=e;this.$["src-type"]=`src-type-${r}`,this.$.iconName=i,this.onclick=()=>{this.activate()}}};nc.template='\n <button type="button">\n <uc-icon set="@name: iconName"></uc-icon>\n <div class="uc-txt" l10n="src-type"></div>\n </button>\n',nc.bindAttributes({type:null});var ac=class extends Yo{initCallback(){super.initCallback(),this.subConfigValue("sourceList",t=>{const e=io(t);let r="";e.forEach(t=>{"instagram"!==t?"camera"===t&&Sn.htmlMediaCapture?this.subConfigValue("cameraModes",t=>{const e=ji(t);e.forEach(t=>{r+=`<uc-source-btn role="listitem" type="mobile-${t}-camera"></uc-source-btn>`}),0===e.length&&(r+='<uc-source-btn role="listitem" type="mobile-photo-camera"></uc-source-btn>')}):r+=`<uc-source-btn role="listitem" type="${t}"></uc-source-btn>`: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")}),this.cfg.sourceListWrap?this.innerHTML=r:this.outerHTML=r})}},sc=class extends Ne{};sc.template=' <div class="uc-spinner"></div> ';var cc=class extends tn{historyTracked=!0;activityType=tn.activities.START_FROM;initCallback(){super.initCallback(),this.registerActivity(this.activityType??"")}};function lc(t,e=40){if("image/svg+xml"===t.type)return URL.createObjectURL(t);const r=document.createElement("canvas"),i=r.getContext("2d");if(!i)return Promise.reject(new Error("Canvas context not supported"));const o=new Image,n=new Promise((t,n)=>{o.onload=()=>{const a=o.height/o.width;a>1?(r.width=e,r.height=e*a):(r.height=e,r.width=e/a),i.fillStyle="rgb(240, 240, 240)",i.fillRect(0,0,r.width,r.height),i.drawImage(o,0,0,r.width,r.height),r.toBlob(e=>{if(!e)return void n();const r=URL.createObjectURL(e);t(r)})},o.onerror=t=>{n(t)}});return o.src=URL.createObjectURL(t),n}function uc(t="hsl(209, 21%, 65%)",e=32,r=32){return function(t){const e=new Blob([t],{type:"image/svg+xml"});return URL.createObjectURL(e)}(`\n <svg width="${e}" height="${r}" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" fill="${t}" 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"/>\n </svg>\n `)}cc.template=' <div class="uc-content"><slot></slot></div> ';var dc=class extends zs{_renderedGridOnce=!1;_thumbRect=null;_isIntersecting=!1;_firstViewMode=this.cfg.filesViewMode;_observer;constructor(){super(),this.init$={...this.init$,thumbUrl:"",badgeIcon:"",uid:""}}_calculateThumbSize(t=!1){t&&(this._thumbRect=this.getBoundingClientRect());let e=Math.max(parseInt(String(this?._thumbRect?.height||0),10),parseInt(String(this?._thumbRect?.width||0),10),this.cfg.thumbSize);return window.devicePixelRatio>1&&(e*=window.devicePixelRatio),Math.min(e,3e3)}_generateThumbnail=this._withEntry(async(t,e=!1)=>{const r=t.getValue("fileInfo"),i=t.getValue("isImage"),o=t.getValue("uuid"),n=t.getValue("thumbUrl"),a=this._calculateThumbSize(e);if(r&&i&&o){const e=await this.proxyUrl(eo(ro(this.cfg.cdnCname,o),Gi(t.getValue("cdnUrlModifiers"),"stretch/off",`scale_crop/${a}x${a}/center`)));if(n===e)return;const{promise:r}=Ia(e);return void r.then(()=>{t.setValue("thumbUrl",e),n?.startsWith("blob:")&&URL.revokeObjectURL(n)}).catch(async()=>{if(!n?.startsWith("blob:"))try{const e=t.getValue("file");if(!e)return;const r=await lc(e,a);t.setValue("thumbUrl",r)}catch(e){this.telemetryManager.sendEventError(e,"thumbnail generation. Failed to generate thumb from file");const r=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");t.setValue("thumbUrl",uc(r))}})}if(t.getValue("thumbUrl"))return;const s=t.getValue("file");if(s?.type.includes("image"))try{const e=await lc(s,a);t.setValue("thumbUrl",e)}catch(e){this.telemetryManager.sendEventError(e,"thumbnail generation. Failed to generate thumb from file");const r=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");t.setValue("thumbUrl",uc(r))}else{const e=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");t.setValue("thumbUrl",uc(e))}});_debouncedGenerateThumb=Bi(this._generateThumbnail.bind(this),100);_observerCallback(t){const[e]=t;e&&(this._isIntersecting=e.isIntersecting,e.isIntersecting&&(this._thumbRect=e.boundingClientRect,this._debouncedGenerateThumb(),this._observer?.disconnect()),0===e.intersectionRatio&&this._debouncedGenerateThumb.cancel())}_reset(){super._reset(),this._debouncedGenerateThumb.cancel()}_handleEntryId(t){this._reset();const e=this.uploadCollection?.read(t);this._entry=e,e&&(this._subEntry("fileInfo",t=>{t?.isImage&&this._isIntersecting&&this._debouncedGenerateThumb()}),this._subEntry("thumbUrl",t=>{this.$.thumbUrl=t?`url(${t})`:""}),this._subEntry("cdnUrlModifiers",()=>{this._isIntersecting&&this._debouncedGenerateThumb()}),this._isIntersecting&&this._debouncedGenerateThumb())}initCallback(){super.initCallback(),this.defineAccessor("badgeIcon",t=>{this.$.badgeIcon=t}),this.defineAccessor("uid",t=>{this.set$({uid:t})}),this.sub("uid",t=>{this._handleEntryId(t)}),this.subConfigValue("filesViewMode",t=>{"grid"!==t||this._renderedGridOnce||("list"===this._firstViewMode&&this._debouncedGenerateThumb(!0),this._renderedGridOnce=!0)}),this.setAttribute("role","img")}connectedCallback(){super.connectedCallback(),this._observer=new window.IntersectionObserver(this._observerCallback.bind(this),{threshold:.1}),this._observer.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this._entrySubs=new Set,this._debouncedGenerateThumb.cancel(),this._observer?.disconnect()}};dc.template='\n <div class="uc-thumb" set="style.backgroundImage: thumbUrl">\n <div class="uc-badge">\n <uc-icon set="@name: badgeIcon"></uc-icon>\n </div>\n </div>\n',dc.bindAttributes({badgeIcon:null,uid:null});var hc=class extends la{static styleAttrs=["uc-wgt-common"];static EventType=Vi;requireCtxName=!0;initCallback(){super.initCallback(),this.$["*eventEmitter"].bindTarget(this)}destroyCallback(){super.destroyCallback(),this.$["*eventEmitter"].unbindTarget(this)}},pc=class extends la{couldBeCtxOwner=!0;historyTracked=!0;activityType=tn.activities.UPLOAD_LIST;constructor(){super(),this.init$={...this.init$,doneBtnVisible:!1,doneBtnEnabled:!1,uploadBtnVisible:!1,addMoreBtnVisible:!1,addMoreBtnEnabled:!1,headerText:"",commonErrorMessage:"",hasFiles:!1,onAdd:()=>{this.telemetryManager.sendEvent({eventType:zi.ACTION_EVENT,payload:{metadata:{event:"add-more",node:this.tagName}}}),this.api.initFlow(!0)},onUpload:()=>{this.emit(Vi.UPLOAD_CLICK),this.api.uploadAll(),this._throttledHandleCollectionUpdate()},onDone:()=>{this.emit(Vi.DONE_CLICK,this.api.getOutputCollectionState()),this.api.doneFlow()},onCancel:()=>{this.telemetryManager.sendEvent({eventType:zi.ACTION_EVENT,payload:{metadata:{event:"clear-all",node:this.tagName}}}),this.uploadCollection.clearAll()}}}_throttledHandleCollectionUpdate=Ua(()=>{this.isConnected&&(this._updateUploadsState(),this.couldOpenActivity||this.$["*currentActivity"]!==this.activityType||this.historyBack(),this.cfg.confirmUpload||this.api.uploadAll())},300);_updateUploadsState(){const t=this.api.getOutputCollectionState(),e={total:t.totalCount,succeed:t.successCount,uploading:t.uploadingCount,failed:t.failedCount,validatingBeforeUploading:t.idleEntries.filter(t=>t.isValidationPending).length},r=!t.errors.some(t=>"TOO_MANY_FILES"===t.type||"TOO_FEW_FILES"===t.type),i=t.errors.some(t=>"TOO_MANY_FILES"===t.type),o=t.totalCount===(this.cfg.multiple?this.cfg.multipleMax:1),n=t.allEntries.some(t=>t.isValidationPending),a=0===e.failed&&0===t.errors.length&&!n;let s=!1,c=!1,l=!1;if(e.total-e.succeed-e.uploading-e.failed>0&&r&&a)s=!0;else{c=!0;const i=!this.cfg.groupOutput||!!t.group;l=e.total===e.succeed&&r&&a&&i}this.set$({doneBtnVisible:c,doneBtnEnabled:l,uploadBtnVisible:s,addMoreBtnEnabled:0===e.total||!i&&!o,addMoreBtnVisible:!o||this.cfg.multiple,hasFiles:e.total>0}),this.bindL10n("headerText",()=>this._getHeaderText(e))}_getHeaderText(t){const e=e=>{let r=t[e];return"uploading"===e&&(r+=t.validatingBeforeUploading),this.l10n(`header-${e}`,{count:r})};return t.uploading>0||t.validatingBeforeUploading>0?e("uploading"):t.failed>0?e("failed"):t.succeed>0?e("succeed"):e("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",t=>{t&&this._throttledHandleCollectionUpdate()}),this.subConfigValue("filesViewMode",t=>{this.setAttribute("mode",t)}),this.sub("*currentActivity",t=>{this.couldOpenActivity||t!==this.activityType||(this.$["*currentActivity"]=this.initActivity)}),this.uploadCollection.observeProperties(this._throttledHandleCollectionUpdate),this.uploadCollection.observeCollection(this._throttledHandleCollectionUpdate),this.sub("*collectionErrors",t=>{const e=t.filter(t=>"SOME_FILES_HAS_ERRORS"!==t.type)[0];e?this.set$({commonErrorMessage:e.message}):this.set$({commonErrorMessage:null})})}destroyCallback(){super.destroyCallback(),this.uploadCollection.unobserveProperties(this._throttledHandleCollectionUpdate),this.uploadCollection.unobserveCollection(this._throttledHandleCollectionUpdate)}};pc.template='\n <uc-activity-header>\n <span aria-live="polite" class="uc-header-text">{{headerText}}</span>\n <button\n type="button"\n class="uc-mini-btn uc-close-btn"\n set="onclick: *closeModal"\n l10n="@title:a11y-activity-header-button-close;@aria-label:a11y-activity-header-button-close"\n >\n <uc-icon name="close"></uc-icon>\n </button>\n </uc-activity-header>\n\n <div class="uc-no-files" set="@hidden: hasFiles">\n <slot name="empty"><span l10n="no-files"></span></slot>\n </div>\n\n <div class="uc-files">\n <div class="uc-files-wrapper" repeat="*uploadList" repeat-item-tag="uc-file-item"></div>\n <button\n type="button"\n class="uc-add-more-btn uc-secondary-btn"\n set="onclick: onAdd; @disabled: !addMoreBtnEnabled; @hidden: !addMoreBtnVisible"\n >\n <uc-icon name="add"></uc-icon><span l10n="add-more"></span>\n </button>\n </div>\n\n <div class="uc-common-error" set="@hidden: !commonErrorMessage; textContent: commonErrorMessage;"></div>\n\n <div class="uc-toolbar">\n <button type="button" class="uc-cancel-btn uc-secondary-btn" set="onclick: onCancel;" l10n="clear"></button>\n <div class="uc-toolbar-spacer"></div>\n <button\n type="button"\n class="uc-add-more-btn uc-secondary-btn"\n set="onclick: onAdd; @disabled: !addMoreBtnEnabled; @hidden: !addMoreBtnVisible"\n >\n <uc-icon name="add"></uc-icon><span l10n="add-more"></span>\n </button>\n <button\n type="button"\n class="uc-upload-btn uc-primary-btn"\n set="@hidden: !uploadBtnVisible; onclick: onUpload;"\n l10n="upload"\n ></button>\n <button\n type="button"\n class="uc-done-btn uc-primary-btn"\n set="@hidden: !doneBtnVisible; onclick: onDone; @disabled: !doneBtnEnabled"\n l10n="done"\n ></button>\n </div>\n\n <uc-drop-area ghost></uc-drop-area>\n';var gc=class extends la{couldBeCtxOwner=!0;activityType=tn.activities.URL;constructor(){super(),this.init$={...this.init$,importDisabled:!0,onUpload:t=>{t.preventDefault(),this.telemetryManager.sendEvent({eventType:zi.ACTION_EVENT,payload:{metadata:{event:"upload-from-url",node:this.tagName}}});const e=this.ref.input.value;this.api.addFileFromUrl(e,{source:kn.URL}),this.modalManager?.open(tn.activities.UPLOAD_LIST),this.$["*currentActivity"]=tn.activities.UPLOAD_LIST},onCancel:()=>{this.historyBack()},onInput:t=>{const e=t.target?.value??"";this.set$({importDisabled:!e})}}}initCallback(){super.initCallback(),this.registerActivity(this.activityType??"",{onActivate:()=>{const t=this.ref.input;t.value="",t.focus()}})}};gc.template='\n <uc-activity-header>\n <button type="button" class="uc-mini-btn" set="onclick: *historyBack" l10n="@title:back;@aria-label:back">\n <uc-icon name="back"></uc-icon>\n </button>\n <div>\n <uc-icon name="url"></uc-icon>\n <span l10n="caption-from-url"></span>\n </div>\n <button\n type="button"\n class="uc-mini-btn uc-close-btn"\n set="onclick: *closeModal"\n l10n="@title:a11y-activity-header-button-close;@aria-label:a11y-activity-header-button-close"\n >\n <uc-icon name="close"></uc-icon>\n </button>\n </uc-activity-header>\n <form class="uc-content">\n <label>\n <input placeholder="https://" class="uc-url-input" type="text" ref="input" set="oninput: onInput" />\n </label>\n <button\n type="submit"\n class="uc-url-upload-btn uc-primary-btn"\n set="onclick: onUpload; @disabled: importDisabled"\n l10n="upload-url"\n ></button>\n </form>\n';var mc=class extends ka{static styleAttrs=[...super.styleAttrs,"uc-wgt-common"];constructor(){super(),this.init$={...this.init$,"*solution":this.tagName}}initCallback(){super.initCallback(),this.telemetryManager.sendEvent({eventType:zi.INIT_SOLUTION}),this.a11y?.registerBlock(this)}},bc=class extends nn{static styleAttrs=[...super.styleAttrs,"uc-file-uploader-inline"];constructor(){super(),this.init$={...this.init$,couldCancel:!1,"*solution":this.tagName,cancel:()=>{if(this.couldHistoryBack){const t=this.$["*historyBack"];return void t?.()}this.couldShowList&&(this.$["*currentActivity"]=tn.activities.UPLOAD_LIST)}}}get couldHistoryBack(){const t=this.$["*history"];return!(!t||t.length<=1)&&t[t.length-1]!==tn.activities.START_FROM}get couldShowList(){const t=this.$["*uploadList"];return this.cfg.showEmptyList||Array.isArray(t)&&t.length>0}initCallback(){super.initCallback(),this.telemetryManager.sendEvent({eventType:zi.INIT_SOLUTION});const t=this.ref.uBlock;t&&(this.sub("*currentActivity",e=>{e||(this.$["*currentActivity"]=t.initActivity||tn.activities.START_FROM)}),this.sub("*uploadList",e=>{Array.isArray(e)&&e.length>0&&this.$["*currentActivity"]===(t.initActivity||tn.activities.START_FROM)&&(this.$["*currentActivity"]=tn.activities.UPLOAD_LIST)}),this.sub("*history",()=>{this.$.couldCancel=this.couldHistoryBack||this.couldShowList}))}};bc.template='\n <uc-start-from>\n <uc-drop-area with-icon clickable></uc-drop-area>\n <uc-source-list role="list" wrap></uc-source-list>\n <button\n type="button"\n l10n="start-from-cancel"\n class="uc-cancel-btn uc-secondary-btn"\n set="onclick: cancel; @hidden: !couldCancel"\n ></button>\n <uc-copyright></uc-copyright>\n </uc-start-from>\n <uc-upload-list ref="uBlock"></uc-upload-list>\n <uc-camera-source></uc-camera-source>\n <uc-url-source></uc-url-source>\n <uc-external-source></uc-external-source>\n <uc-cloud-image-editor-activity></uc-cloud-image-editor-activity>\n';var fc="active",vc=class extends nn{static styleAttrs=[...super.styleAttrs,"uc-file-uploader-minimal"];handleModalOpen;handleModalClose;constructor(){super(),this.init$={...this.init$,singleUpload:!1,isHiddenStartFrom:!1,classUploadList:"",classStartFrom:"","*solution":this.tagName}}_handleModalOpen(t){t.id===tn.activities.CLOUD_IMG_EDIT&&this.set$({classUploadList:fc}),this.$["*currentActivity"]===tn.activities.UPLOAD_LIST&&this.set$({classUploadList:fc,isHiddenStartFrom:!0});const e=this.$["*uploadList"];(!e||e.length<=0)&&this.set$({classStartFrom:fc})}_handleModalClose(t){t.id===this.$["*currentActivity"]&&(this.$["*currentActivity"]=tn.activities.UPLOAD_LIST,this.set$({isHiddenStartFrom:!1})),t.id===tn.activities.CLOUD_IMG_EDIT&&(this.$["*currentActivity"]=tn.activities.UPLOAD_LIST)}initCallback(){super.initCallback(),this.telemetryManager.sendEvent({eventType:zi.INIT_SOLUTION});const t=this.ref.uBlock;t&&(this.sub("*currentActivity",e=>{e===tn.activities.UPLOAD_LIST&&this.modalManager?.closeAll(),e||(this.$["*currentActivity"]=t.initActivity||tn.activities.START_FROM)}),this.sub("*uploadList",e=>{Array.isArray(e)&&e.length>0?(this.$["*currentActivity"]=tn.activities.UPLOAD_LIST,this.set$({classStartFrom:""})):(this.set$({classUploadList:"",isHiddenStartFrom:!1}),this.$["*currentActivity"]=t.initActivity||tn.activities.START_FROM)}),this.subConfigValue("confirmUpload",t=>{!1!==t&&(this.cfg.confirmUpload=!1)}),this.subConfigValue("filesViewMode",t=>{this.setAttribute("mode",t),this.subConfigValue("multiple",e=>{"grid"===t?(e?this.style.removeProperty("--uc-grid-col"):this.style.setProperty("--uc-grid-col","1"),this.$.singleUpload=!e):(this.style.removeProperty("--uc-grid-col"),this.$.singleUpload=!1)})}),this.handleModalOpen=t=>{this._handleModalOpen(t)},this.handleModalClose=t=>{this._handleModalClose(t)},this.modalManager?.subscribe(Ho.OPEN,this.handleModalOpen),this.modalManager?.subscribe(Ho.CLOSE,this.handleModalClose))}destroyCallback(){super.destroyCallback(),this.modalManager?.unsubscribe(Ho.OPEN,this.handleModalOpen),this.modalManager?.unsubscribe(Ho.CLOSE,this.handleModalClose)}};vc.template='\n <uc-start-from set="@hidden: isHiddenStartFrom; @class:classStartFrom">\n <uc-drop-area set="@single:singleUpload;" initflow clickable tabindex="0" l10n="choose-file"></uc-drop-area>\n <uc-copyright></uc-copyright>\n </uc-start-from>\n <uc-upload-list set="@class:classUploadList" ref="uBlock"></uc-upload-list>\n\n <uc-modal id="start-from" strokes block-body-scrolling>\n <uc-start-from>\n <uc-drop-area with-icon clickable></uc-drop-area>\n <uc-source-list role="list" wrap></uc-source-list>\n <button type="button" l10n="start-from-cancel" class="uc-secondary-btn" set="onclick: *historyBack"></button>\n </uc-start-from>\n </uc-modal>\n\n <uc-modal id="camera" strokes block-body-scrolling>\n <uc-camera-source></uc-camera-source>\n </uc-modal>\n\n <uc-modal id="url" strokes block-body-scrolling>\n <uc-url-source></uc-url-source>\n </uc-modal>\n\n <uc-modal id="external" strokes block-body-scrolling>\n <uc-external-source></uc-external-source>\n </uc-modal>\n\n <uc-modal id="cloud-image-edit" strokes block-body-scrolling>\n <uc-cloud-image-editor-activity></uc-cloud-image-editor-activity>\n </uc-modal>\n';var yc=class extends nn{static styleAttrs=[...super.styleAttrs,"uc-file-uploader-regular"];constructor(){super();const t={...this.init$,isHidden:!1,"*solution":this.tagName};this.init$=t}initCallback(){super.initCallback(),this.telemetryManager.sendEvent({eventType:zi.INIT_SOLUTION}),this.defineAccessor("headless",t=>{this.set$({isHidden:ns(t)})})}};function wc(t,e){const r=kc();return(wc=function(t,e){return r[t-=205]})(t,e)}yc.template='\n <uc-simple-btn set="@hidden: isHidden"></uc-simple-btn>\n\n <uc-modal id="start-from" strokes block-body-scrolling>\n <uc-start-from>\n <uc-drop-area with-icon clickable></uc-drop-area>\n <uc-source-list role="list" wrap></uc-source-list>\n <button type="button" l10n="start-from-cancel" class="uc-secondary-btn" set="onclick: *historyBack"></button>\n <uc-copyright></uc-copyright>\n </uc-start-from>\n </uc-modal>\n\n <uc-modal id="upload-list" strokes block-body-scrolling>\n <uc-upload-list></uc-upload-list>\n </uc-modal>\n\n <uc-modal id="camera" strokes block-body-scrolling>\n <uc-camera-source></uc-camera-source>\n </uc-modal>\n\n <uc-modal id="url" strokes block-body-scrolling>\n <uc-url-source></uc-url-source>\n </uc-modal>\n\n <uc-modal id="external" strokes block-body-scrolling>\n <uc-external-source></uc-external-source>\n </uc-modal>\n\n <uc-modal id="cloud-image-edit" strokes block-body-scrolling>\n <uc-cloud-image-editor-activity></uc-cloud-image-editor-activity>\n </uc-modal>\n',yc.bindAttributes({headless:null});const _c=wc;function kc(){const t=["354045FFYPRp","define","2509416Wwlsad","config","defineLocale","locale","isOfficialPlugin","URL","_defineLocale","176490gqiHuO","4161096GIfBfg","6220VjSmjt","5ohtWuE","1180eNVLSU","get","requires","Uploadcare","isPremiumPlugin","uploadcare.locale","editor","uploadcare.uploader.sourceList","483nvSwqM","defineComponents","contentLanguage","187nUOyDV","9XeUUrO","pluginName","628708pcjdTs","Local"];return(kc=function(){return t})()}!function(t){const e=wc,r=t();for(;;)try{if(784514===parseInt(e(212))/1+parseInt(e(210))/2+-parseInt(e(233))/3*(-parseInt(e(223))/4)+-parseInt(e(224))/5*(-parseInt(e(221))/6)+parseInt(e(214))/7+-parseInt(e(222))/8*(parseInt(e(208))/9)+-parseInt(e(225))/10*(parseInt(e(207))/11))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(kc);class xc extends a.Plugin{static get[_c(227)](){return[fe,$]}static get[_c(209)](){return _c(228)}static get[_c(218)](){return!0}static get[_c(229)](){return!0}constructor(r){const i=_c;super(r),r[i(215)][i(213)](i(232),[e[i(211)],e[i(219)]]),t[i(205)](t),this[i(220)]()}[_c(220)](){const e=_c,r=this[e(231)][e(215)][e(226)](e(230)),i=this[e(231)][e(217)][e(206)];r&&t[e(216)](i,r)}}class Cc extends c.View{constructor(t){super(t);const e=t.t,r=this.bindTemplate,i=new c.SpinnerView;i.isVisible=!0,this.setTemplate({tag:"div",attributes:{class:["ck-uploadcare-form__loading"],tabindex:"-1"},children:[{tag:"div",attributes:{class:["ck-uploadcare-form__loading-spinner"]},children:[i,{text:r.to("imageUploadProgress",t=>e("Loading image...")+" ("+(t||0)+"%)")}]},{tag:"div",attributes:{class:["ck-uploadcare-form__skeleton"]},children:[{tag:"div",children:[{tag:"span"},{tag:"span"},{tag:"span"}]},{tag:"div",children:[{tag:"span"},{tag:"span"},{tag:"span"},{tag:"span"},{tag:"span"}]}]}]})}}class Ec extends c.View{constructor(t){super(t);const e=t.t;this.set("errorType",null);const r=new c.ButtonView(t);r.label=e({id:"Try again (Uploadcare)",string:"Try again"}),r.withText=!0,r.class="ck-button-action",r.on("execute",()=>{this.fire("retry")}),r.bind("isVisible").to(this,"errorType",t=>"NotFound"!==t);const i=new c.IconView;i.content=s.IconError,i.extendTemplate({attributes:{style:{width:"50px",height:"50px"}}});const o=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck-uploadcare-form__error"],tabindex:"-1"},children:[{tag:"div",attributes:{class:["ck-uploadcare-form__error-contents"]},children:[i,{tag:"h3",attributes:{style:{fontWeight:"bold"}},children:[{text:e("Unable to load")}]},{text:o.to("errorType",t=>e("NotFound"!==t?"We were unable to load the image due to network connection issues.":"The image was not found. Its source may have been removed."))},r]},{tag:"div",attributes:{class:["ck-uploadcare-form__skeleton"]},children:[{tag:"div",children:[{tag:"span"},{tag:"span"},{tag:"span"}]},{tag:"div",children:[{tag:"span"},{tag:"span"},{tag:"span"},{tag:"span"},{tag:"span"}]}]}]})}}function Tc(t,e){const r=Ic();return(Tc=function(t,e){return r[t-=295]})(t,e)}!function(t){const e=Tc,r=t();for(;;)try{if(303383===parseInt(e(304))/1+-parseInt(e(297))/2*(-parseInt(e(302))/3)+parseInt(e(299))/4+parseInt(e(311))/5*(-parseInt(e(310))/6)+parseInt(e(295))/7+-parseInt(e(303))/8*(parseInt(e(296))/9)+-parseInt(e(306))/10)break;r.push(r.shift())}catch(t){r.push(r.shift())}}(Ic);class Ac extends c.View{constructor(t,e){const r=Tc;super(t);const i=this[r(309)];this[r(300)](r(298),""),this[r(301)]({tag:r(308),attributes:{...e,class:[r(305),r(307)],"ctx-name":r(312),"cdn-url":i.to(r(298))}})}}function Ic(){const t=["uc-cloud-image-editor","bindTemplate","1013562ASJABT","5MqJHTF","image-edit","2938810DZcEKV","2232MvhTem","2rxBkdE","imageSrc","2250532eMGRVa","set","setTemplate","1689591eiXpLe","14408YBdHWt","234448iLYghX","uc-light","8611500xJGQiZ","ck-uploadcare-theme"];return(Ic=function(){return t})()}const Sc=Mc;function Mc(t,e){const r=Lc();return(Mc=function(t,e){return r[t-=421]})(t,e)}!function(t){const e=Mc,r=t();for(;;)try{if(968877===parseInt(e(444))/1+-parseInt(e(454))/2*(parseInt(e(448))/3)+parseInt(e(423))/4+parseInt(e(462))/5*(parseInt(e(476))/6)+parseInt(e(472))/7+-parseInt(e(450))/8*(-parseInt(e(427))/9)+-parseInt(e(465))/10*(parseInt(e(428))/11))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(Lc);class $c extends D{[Sc(471)];[Sc(464)];[Sc(446)];[Sc(457)];[Sc(460)];constructor(t,e,r){const i=Sc;super(t),this[i(471)]=this[i(437)](),this[i(464)]=new Cc(t),this[i(446)]=new Ec(t),this[i(457)]=new Ac(t,r),this[i(460)]=new c.View(t),this[i(460)][i(435)](this[i(445)]()),this[i(442)](i(430),e),this[i(435)]({tag:i(439),attributes:{class:["ck",i(469),i(470)],tabindex:"-1"},children:this[i(471)]}),this[i(431)](),this[i(429)](i(436),()=>{const t=i;this[t(451)](this[t(455)],e=>{this[t(425)](e)})}),this.on(i(458),()=>{this[i(431)]()}),this[i(434)]()}[Sc(466)](){const t=Sc;this[t(455)][t(466)]()}[Sc(431)](){const t=Sc;switch(this[t(471)][t(447)](),this[t(430)]){case t(452):this[t(471)][t(468)](this[t(464)]);break;case t(432):this[t(471)][t(468)](this[t(446)]);break;case t(473):this[t(471)][t(443)]([this[t(457)],this[t(460)]])}}[Sc(451)](t,e){const r=Sc,i=r(424),o=t[r(433)](i);if(o)return e(o);const n=new MutationObserver(o=>{const a=r,s=o[a(474)](e=>e[a(421)]===t&&e[a(456)][a(463)]>0&&e[a(456)][0][a(475)][a(440)]()===i);s[a(463)]&&(n[a(438)](),e(s[0][a(456)][0]))});n[r(459)](t,{childList:!0,subtree:!0})}[Sc(425)](t){const e=Sc;t[e(426)](e(422),t=>{const r=e;this[r(453)](r(422),{imageSrc:t[r(449)][r(467)]})}),t[e(426)](e(461),()=>{const t=e;this[t(453)](t(461))})}[Sc(434)](){const t=Sc;this[t(446)].on(t(441),()=>{const e=t;this[e(453)](e(441))})}}function Lc(){const t=["cdnUrl","add","ck-reset_all-excluded","ck-uploadcare-form","_items","5339978rjkUoD","ready","filter","nodeName","6kTALKG","target","apply","3481824UAPVTd","uc-cloud-image-editor","_addUploadcareImageEditorListeners","addEventListener","2364597rhOobp","10051129YDbnOS","once","status","_setView","error","querySelector","_addErrorViewListeners","setTemplate","render","createCollection","disconnect","div","toLowerCase","retry","set","addMany","809742GuyIVz","getFocusableElement","_errorView","clear","6CUsJcI","detail","56jkMUKE","_waitForImageEditorComponent","uploading","fire","641898ixxrlV","element","addedNodes","_editingView","change:status","observe","_focusableView","cancel","4917740WzXofY","length","_loadingView","40Mhuzfc","focus"];return(Lc=function(){return t})()}class Oc extends((0,L.ObservableMixin)()){_editor;_dialog;_imageElement;_imageCache;_controller;_attributes;constructor(t,e,r){super(),this._editor=t,this._dialog=e,this._imageElement=r,this._imageCache=this._editor.plugins.get("UploadcareImageEditUI").imageCache,this._attributes=this._editor.config.get("uploadcare.editor")||{},this.set({isActive:!0,imageStatus:"ready",imageErrorType:null,imageId:null,imageSrc:null,imageDimension:null,imageUploadProgress:null}),this._prepareImage(),this._showDialog()}destroy(){this.isActive=!1,this.stopListening(),this.stopDelegating(),"uploading"===this.imageStatus&&this._controller&&this._controller.abort()}async _prepareImage(){const t=this._imageElement,e=t.getAttribute("uploadcareImageId"),r=t.getAttribute("src");if(e)await this._loadImageInfo(e,r);else if(this._imageCache.has(r)){const t=this._imageCache.get(r);this.imageStatus="ready",this.imageErrorType=null,this.imageSrc=t.url,this.imageDimension=t.dimension,this.imageId=t.id}else this.imageStatus="uploading",this.imageUploadProgress=0,this._controller=new AbortController,await this._uploadImage(this._imageElement,this._controller)}_showDialog(){const{locale:t}=this._editor,e=t.t,r=new $c(t,this.imageStatus,this._attributes);r.bind("status").to(this,"imageStatus"),r._loadingView.bind("imageUploadProgress").to(this,"imageUploadProgress"),r._editingView.bind("imageSrc").to(this,"imageSrc"),r._errorView.bind("errorType").to(this,"imageErrorType"),this._addEditViewListeners(r,this._imageElement),this._dialog.show({id:"uploadcareImageEdit",icon:s.IconUploadcareImageEdit,title:e({id:"Edit Image (Uploadcare)",string:"Edit image"}),content:r,position:c.DialogViewPosition.EDITOR_TOP_CENTER,isModal:!0,onShow:()=>{r.focus()},onHide:()=>{r.destroy(),this.destroy()},keystrokeHandlerOptions:{filter:t=>!Y(t,r.element)}})}_loadImageInfo(t,e){return ue.getInfo(t,{publicKey:this._editor.config.get("uploadcare.pubkey"),baseURL:this._editor.config.get("uploadcare.uploader.baseUrl")}).then(r=>{const{width:i,height:o}=r.imageInfo;this.imageStatus="ready",this.imageErrorType=null,this.imageSrc=e,this.imageDimension={width:i,height:o},this.imageId=t}).catch(t=>{this.imageStatus="error",this.imageErrorType="FileNotFoundError"===t.code?"NotFound":"Network",this.imageSrc=null,this.imageDimension=null,this.imageId=null,this.imageUploadProgress=null})}_uploadImage(t,e){return this._getImageAsFile(t).then(t=>ue.upload({publicKey:this._editor.config.get("uploadcare.pubkey"),baseURL:this._editor.config.get("uploadcare.uploader.baseUrl"),baseCDN:this._editor.config.get("uploadcare.uploader.cdnCname"),signal:e.signal,file:t,onProgress:t=>{t&&t.isComputable&&(this.imageUploadProgress=Math.ceil(100*t.value))}})).then(e=>{const{width:r,height:i}=e.imageInfo;this.imageStatus="ready",this.imageErrorType=null,this.imageSrc=e.cdnUrl,this.imageDimension={width:r,height:i},this.imageId=e.uuid,this.imageUploadProgress=null;const o=t.getAttribute("src");this._imageCache.set(o,{id:e.uuid,url:e.cdnUrl,dimension:this.imageDimension})}).catch(t=>{this.imageStatus="error",this.imageErrorType="FileNotFoundError"===t.code?"NotFound":"Network",this.imageSrc=null,this.imageDimension=null,this.imageId=null,this.imageUploadProgress=null})}_addEditViewListeners(t,e){t.on("apply",(t,r)=>{this._replaceImage(e,r.imageSrc,this.imageId),this._dialog.hide()}),t.on("retry",()=>{this.imageStatus="uploading",this.imageUploadProgress=0,this._controller=new AbortController,this._uploadImage(this._imageElement,this._controller)}),t.on("cancel",()=>{this._dialog.hide()})}_replaceImage(t,e,r){const i=this._editor,{width:o,height:n}=q(e,this.imageDimension.width,this.imageDimension.height),{imageFallbackUrl:a,imageSources:s}=j(e,o);i.model.change(e=>{if("$graveyard"===t.root.rootName){i.execute("insertImage",{imageType:t.is("element","imageInline")?"imageInline":null,source:{...Object.fromEntries(t.getAttributes()),uploadcareImageId:r,src:a,sources:s,width:o,height:n}});const c=t.getChildren();t=i.model.document.selection.getSelectedElement();for(const r of c)e.append(e.cloneElement(r),t)}else e.setSelection(t,"on"),i.execute("uploadcareImageReplace",{...Object.fromEntries(t.getAttributes()),uploadcareImageId:r,src:a,sources:s,width:o,height:n},t);e.setSelection(t,"on")})}async _getImageAsFile(t){const e=L.global.window,r=L.global.document.location.href,i=new e.URL(t.getAttribute("src"),r);if("data:"===i.protocol){const t=i.href.split(","),r=t[0].match(/:(.*?);/)[1],o=r.split("/")[1],n=e.atob(t[t.length-1]);let a=n.length;const s=new e.Uint8Array(a);for(;a--;)s[a]=n.charCodeAt(a);return new e.File([s],"image."+o,{type:r})}const o=i.href.split("/"),n=o[o.length-1],a=n.split(".")[1];return e.fetch(i.href).then(t=>t.clone().blob()).then(t=>new e.File([t],n,{type:"image/"+a}))}}function Uc(t,e){const r=Pc();return(Uc=function(t,e){return r[t-=455]})(t,e)}const Rc=Uc;function Pc(){const t=["849jqAeMK","document","676XSVtqk","refresh","isActive","requires","6707195GBKokK","1502874QeNXih","69622NUtBMw","5RCVvUn","imageEditController","484cSVVdP","unbind","model","6OBwvii","editor","30csiDiL","selection","set","4120328ErOmZQ","getSelectedElement","imageInline","2642525becQpP","7ckCPRy","imageBlock","plugins","96132seTkJD","get","element","_isEditable","isEnabled","config","uploadcare.allowExternalImagesEditing","bind","execute"];return(Pc=function(){return t})()}!function(t){const e=Uc,r=t();for(;;)try{if(309889===-parseInt(e(471))/1*(parseInt(e(470))/2)+-parseInt(e(462))/3*(parseInt(e(473))/4)+parseInt(e(484))/5*(parseInt(e(476))/6)+parseInt(e(485))/7*(parseInt(e(481))/8)+-parseInt(e(469))/9*(-parseInt(e(478))/10)+-parseInt(e(468))/11+-parseInt(e(488))/12*(parseInt(e(464))/13))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(Pc);class Nc extends a.Command{[Rc(472)];static get[Rc(467)](){return[c.Dialog]}[Rc(456)];constructor(t){const e=Rc;super(t),this[e(472)]=void 0,this[e(456)]=function(t){const e=H,r=W(t);return t=>!(!t||!t.is(e(436),e(447))&&!t.is(e(436),e(431)))&&(!!t[e(456)](e(443))||!!t[e(456)](e(454))&&r(t[e(428)](e(454))))}(t[e(458)][e(489)](e(459))||[]),this[e(480)]({isActive:!1})}[Rc(465)](){const t=Rc,e=this[t(477)][t(475)][t(463)][t(479)][t(482)]();this[t(457)]=this[t(456)](e)}[Rc(461)](){const t=Rc;this[t(472)]&&(this[t(474)](t(466)),this[t(472)]=void 0);const e=this[t(477)][t(475)][t(463)][t(479)][t(482)]();e&&(e.is(t(455),t(486))||e.is(t(455),t(483)))&&(this[t(472)]=new Oc(this[t(477)],this[t(477)][t(487)][t(489)](c.Dialog),e),this[t(460)](t(466)).to(this[t(472)],t(466)))}}function Dc(t,e){const r=Vc();return(Dc=function(t,e){return r[t-=218]})(t,e)}const zc=Dc;function Vc(){const t=["imageInline","isEnabled","change","3329455fqtyVU","2004702CgxuWa","imageBlock","setAttributes","2278437vtUiGY","element","editor","3068060hHuGFE","document","refresh","model","1482432bowqGR","execute","selection","sizes","20904920LykHgs","srcset","getSelectedElement","107809mddUTJ","6ebPlCz","removeAttribute"];return(Vc=function(){return t})()}!function(t){const e=Dc,r=t();for(;;)try{if(384015===-parseInt(e(241))/1*(-parseInt(e(218))/2)+parseInt(e(224))/3+parseInt(e(230))/4+parseInt(e(223))/5+parseInt(e(234))/6+parseInt(e(227))/7+-parseInt(e(238))/8)break;r.push(r.shift())}catch(t){r.push(r.shift())}}(Vc);class Fc extends a.Command{[zc(232)](){const t=zc,e=this[t(229)][t(233)][t(231)][t(236)][t(240)]();this[t(221)]=Boolean(e&&(e.is(t(228),t(225))||e.is(t(228),t(220))))}[zc(235)](t){const e=zc,r=this[e(229)][e(233)][e(231)][e(236)][e(240)]();this[e(229)][e(233)][e(222)](i=>{const o=e;i[o(226)](t,r),i[o(219)](o(239),r),i[o(219)](o(237),r)})}}function Bc(){const t=["requires","add","5AuqiDS","927Kxfpmb","106968Dsobqr","14744sBtMdm","ImageUtils","pluginName","isOfficialPlugin","22WJSvCN","uploadcareImageEdit","init","isPremiumPlugin","495668NIWUob","ImageEditing","uploadcareImageReplace","29995lEvVGv","commands","UploadcareImageEditEditing","2354300lwUULt","74892WGptbf","826572EiGlNm","14cWoBQU"];return(Bc=function(){return t})()}const jc=Hc;function Hc(t,e){const r=Bc();return(Hc=function(t,e){return r[t-=476]})(t,e)}!function(t){const e=Hc,r=t();for(;;)try{if(159042===-parseInt(e(498))/1+-parseInt(e(495))/2+parseInt(e(479))/3+parseInt(e(486))/4*(parseInt(e(484))/5)+-parseInt(e(480))/6*(parseInt(e(481))/7)+parseInt(e(487))/8*(parseInt(e(485))/9)+parseInt(e(478))/10*(parseInt(e(491))/11))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(Bc);class qc extends a.Plugin{static get[jc(489)](){return jc(477)}static get[jc(482)](){const t=jc;return[fe,c.Notification,t(488),t(496)]}static get[jc(490)](){return!0}static get[jc(494)](){return!0}[jc(493)](){const t=jc,{editor:e}=this;e[t(476)][t(483)](t(492),new Nc(e)),e[t(476)][t(483)](t(497),new Fc(e))}}var Kc=r(947),Gc={attributes:{"data-cke":!0}};Gc.setAttributes=y(),Gc.insert=f().bind(null,"head"),Gc.domAPI=m(),Gc.insertStyleElement=_();p()(Kc.A,Gc);Kc.A&&Kc.A.locals&&Kc.A.locals;class Wc extends a.Plugin{_imageCache=new Map;static get pluginName(){return"UploadcareImageEditUI"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}get imageCache(){return this._imageCache}init(){const t=this.editor;t.ui.componentFactory.add("uploadcareImageEdit",e=>{const r=t.commands.get("uploadcareImageEdit"),i=new c.ButtonView(e),o=e.t;return i.set({icon:s.IconUploadcareImageEdit,tooltip:!0,label:o({id:"Edit Image (Uploadcare)",string:"Edit image"})}),i.bind("isEnabled").to(r),i.bind("isOn").to(r,"isActive"),this.listenTo(i,"execute",()=>{t.execute("uploadcareImageEdit"),t.editing.view.focus()}),i}),this._initConfig()}_initConfig(){const t=(0,L.createElement)(document,"uc-config",{"ctx-name":"image-edit",removeCopyright:"true",localeName:this.editor.locale.contentLanguage});document.body.appendChild(t),this.listenTo(this.editor,"destroy",()=>{t.remove()})}}var Zc=Xc;function Xc(t,e){var r=Jc();return(Xc=function(t,e){return r[t-=311]})(t,e)}!function(t){for(var e=Xc,r=t();;)try{if(900536===parseInt(e(315))/1+parseInt(e(323))/2*(parseInt(e(321))/3)+parseInt(e(317))/4+parseInt(e(314))/5*(-parseInt(e(325))/6)+-parseInt(e(316))/7*(parseInt(e(327))/8)+-parseInt(e(312))/9*(parseInt(e(313))/10)+parseInt(e(324))/11*(parseInt(e(318))/12))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(Jc);class Yc extends a.Plugin{static get[Zc(319)](){return Zc(320)}static get[Zc(326)](){return[qc,Wc]}static get[Zc(322)](){return!0}static get[Zc(311)](){return!0}}function Jc(){var t=["940HNeyjg","171878LzzApd","462VURiBH","4846228PMVJaB","59964XTOaWs","pluginName","UploadcareImageEdit","1368726wOyitF","isOfficialPlugin","4kJhLqD","8393GbalJk","57114NTEnNr","requires","209240YWsaJD","isPremiumPlugin","342lpBmfQ","445340MXhAGp"];return(Jc=function(){return t})()}function Qc(){var t=["9ZKKgOo","3477176tDkZGz","6WBENaj","145iviCVf","366670uPrxKj","5044032KoEkgb","701396RfSBhr","115348aHSmIB","539316mIhZjk","130757NGyVjk","517oqExxR"];return(Qc=function(){return t})()}function tl(t,e){var r=Qc();return(tl=function(t,e){return r[t-=415]})(t,e)}!function(t){for(var e=tl,r=t();;)try{if(430738===-parseInt(e(419))/1+-parseInt(e(416))/2*(parseInt(e(423))/3)+parseInt(e(417))/4*(-parseInt(e(424))/5)+parseInt(e(418))/6+parseInt(e(415))/7+-parseInt(e(422))/8*(parseInt(e(421))/9)+-parseInt(e(425))/10*(-parseInt(e(420))/11))break;r.push(r.shift())}catch(t){r.push(r.shift())}}(Qc)})(),(window.CKEditor5=window.CKEditor5||{}).uploadcare=i})();