@orangelogic/design-system 2.133.0 → 2.135.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 (232) hide show
  1. package/library/chunks/asset-link-format.BBWyY5fn.js +2627 -0
  2. package/library/chunks/{button.DYoFn504.js → button.3giRMk79.js} +2 -2
  3. package/library/chunks/{checkbox.uH0uF0OV.js → checkbox.B-2O517F.js} +3 -3
  4. package/library/chunks/{table.DuP4v5FN.js → color-swatch-group.DC6vIYo4.js} +3133 -2887
  5. package/library/chunks/{color-swatch.0zyBEfL_.js → color-swatch.g3FPUnxM.js} +2 -2
  6. package/library/chunks/{confirm-popover.DpVYvK20.js → confirm-popover.DtndPsMa.js} +3 -3
  7. package/library/chunks/{dialog.BwBD_hJi.js → dialog.BQq3xBeH.js} +2 -2
  8. package/library/chunks/directive-helpers.DEDMV45_.js +42 -0
  9. package/library/chunks/{document-viewer.BM716ovi.js → document-viewer.BQPJD2lJ.js} +8 -8
  10. package/library/chunks/{dom.BXeuEG1b.js → dom.acWb8KCK.js} +1 -1
  11. package/library/chunks/{dot-pagination.B70lV5Av.js → dot-pagination.DBk9Rz1e.js} +1 -1
  12. package/library/chunks/{endpoints.6E17hFiK.js → endpoints.tU0_RZ_7.js} +4 -4
  13. package/library/chunks/{file-on-demand.D-Ectby2.js → file-on-demand.Bnloo9Ui.js} +12 -12
  14. package/library/chunks/folder-select.DuG4dSPm.js +942 -0
  15. package/library/chunks/{form.3af0bYrm.js → form.K1XOtu3S.js} +1 -1
  16. package/library/chunks/{header.BMGvKrdP.js → header.Bpjw08j7.js} +1 -1
  17. package/library/chunks/{i18n.DoMIwXr2.js → i18n.DJikbkDK.js} +48 -12
  18. package/library/chunks/{icon-button.B-Jf9W3v.js → icon-button.xobY-9OH.js} +1 -1
  19. package/library/chunks/{iframe.Cdv6esyS.js → iframe.BkvxcywO.js} +1 -1
  20. package/library/chunks/{image.SLqIVjqc.js → image.KZRXIthe.js} +241 -229
  21. package/library/chunks/{input.CQNhMu4z.js → input.GUw7x9tK.js} +3 -3
  22. package/library/chunks/{keyed.C0rkKrxH.js → keyed.DdOUTIg-.js} +1 -1
  23. package/library/chunks/{live.SCz6M8Gs.js → live.DCegntDo.js} +1 -1
  24. package/library/chunks/{option.SCVixE2L.js → option.uHye0aDT.js} +1 -1
  25. package/library/chunks/{pagination.BFE6Nk3_.js → pagination.D8Hzwlan.js} +6 -6
  26. package/library/chunks/{ref.bzeTdX0K.js → ref.DktKp7fP.js} +1 -1
  27. package/library/chunks/{repeat.DbF2p5ae.js → repeat.CFjcER6_.js} +1 -1
  28. package/library/chunks/{resizable-component.styles.BVhOesNE.js → resizable-component.styles.CAfXABBc.js} +5 -5
  29. package/library/chunks/{string.CbnVBzsd.js → string.CjJ09HK3.js} +14 -11
  30. package/library/chunks/{tab-group.C-p2Dljr.js → tab-group.0_aOE22R.js} +5 -5
  31. package/library/chunks/toast.Bz-j7zP2.js +109 -0
  32. package/library/chunks/{tree.9PK8ifJd.js → tree.C14rLLol.js} +3 -3
  33. package/library/chunks/url.-WDYqplj.js +42 -0
  34. package/library/components/alert.js +2 -2
  35. package/library/components/asset-link-format.js +16 -2163
  36. package/library/components/atoms.js +49 -51
  37. package/library/components/audio.js +3 -3
  38. package/library/components/border-input-group.js +2 -2
  39. package/library/components/breadcrumb.js +1 -1
  40. package/library/components/button.js +3 -3
  41. package/library/components/checkbox.js +3 -3
  42. package/library/components/color-picker.js +4 -4
  43. package/library/components/color-swatch-group.js +6 -7
  44. package/library/components/color-swatch.js +3 -3
  45. package/library/components/confirm-popover.js +4 -4
  46. package/library/components/copy-button.js +1 -1
  47. package/library/components/corner-position-input-group.js +3 -3
  48. package/library/components/date-calendar.js +2 -2
  49. package/library/components/details.js +1 -1
  50. package/library/components/dialog.js +3 -3
  51. package/library/components/diff.js +1 -1
  52. package/library/components/document-viewer.js +4 -4
  53. package/library/components/dot-pagination.js +2 -2
  54. package/library/components/drawer.js +2 -2
  55. package/library/components/dropdown.js +2 -2
  56. package/library/components/dynamic-select.js +88 -85
  57. package/library/components/e-chart.js +1 -1
  58. package/library/components/element-clamp.js +2 -2
  59. package/library/components/file-on-demand.js +13 -13
  60. package/library/components/folder-select.js +5 -5
  61. package/library/components/format-bytes.js +1 -1
  62. package/library/components/format-date.js +1 -1
  63. package/library/components/format-number.js +1 -1
  64. package/library/components/format-time.js +1 -1
  65. package/library/components/header.js +2 -2
  66. package/library/components/icon-button.js +2 -2
  67. package/library/components/iframe.js +2 -2
  68. package/library/components/image-comparer.js +1 -1
  69. package/library/components/image.js +6 -5
  70. package/library/components/input.js +4 -4
  71. package/library/components/line-clamp.js +1 -1
  72. package/library/components/masonry.js +3 -3
  73. package/library/components/menu-item.js +2 -2
  74. package/library/components/menu.js +1 -1
  75. package/library/components/molecules.js +27 -29
  76. package/library/components/option.js +2 -2
  77. package/library/components/organisms.js +6 -6
  78. package/library/components/padding-input-group.js +2 -2
  79. package/library/components/pagination.js +7 -7
  80. package/library/components/popup.js +1 -1
  81. package/library/components/position-picker.js +1 -1
  82. package/library/components/progress-bar.js +1 -1
  83. package/library/components/progress-ring.js +1 -1
  84. package/library/components/radio-group.js +1 -1
  85. package/library/components/range.js +5 -5
  86. package/library/components/rating.js +2 -2
  87. package/library/components/relative-time.js +1 -1
  88. package/library/components/select.js +10 -7
  89. package/library/components/shadow-input-group.js +2 -2
  90. package/library/components/share-option-list.js +3 -3
  91. package/library/components/sidebar.js +1 -1
  92. package/library/components/size-input-group.js +3 -3
  93. package/library/components/spinner.js +1 -1
  94. package/library/components/split-panel.js +1 -1
  95. package/library/components/stepper-wizard.js +1 -1
  96. package/library/components/switch.js +2 -2
  97. package/library/components/tab-group.js +5 -5
  98. package/library/components/tab.js +2 -2
  99. package/library/components/tag.js +2 -2
  100. package/library/components/textarea.js +2 -2
  101. package/library/components/timecode.js +1 -1
  102. package/library/components/tooltip.js +1 -1
  103. package/library/components/tree-item.js +4 -4
  104. package/library/components/tree.js +2 -2
  105. package/library/components/typeface.js +2 -2
  106. package/library/components/types.js +46083 -43779
  107. package/library/components/video.js +3 -3
  108. package/library/package.json +3 -1
  109. package/library/packages/atoms/src/components/image/image.d.ts +3 -0
  110. package/library/packages/atoms/src/components/select/select.d.ts +6 -0
  111. package/library/packages/atoms/src/components/tab-group/tab-group.d.ts +1 -0
  112. package/library/packages/atoms/src/index.d.ts +0 -1
  113. package/library/packages/events/src/cx-folder-select-selection-seeded.d.ts +6 -0
  114. package/library/packages/events/src/cx-image-src-resolved.d.ts +9 -0
  115. package/library/packages/events/src/cx-pdf-viewer-annotation-draw-mode-change.d.ts +10 -0
  116. package/library/packages/events/src/cx-pdf-viewer-annotation-draw-params-change.d.ts +11 -0
  117. package/library/packages/events/src/cx-pdf-viewer-more-options-select.d.ts +8 -0
  118. package/library/packages/events/src/cx-pdf-viewer-toolbar-annotation-mode-change.d.ts +10 -0
  119. package/library/packages/events/src/cx-pdf-viewer-toolbar-annotation-params-change.d.ts +11 -0
  120. package/library/packages/events/src/cx-pdf-viewer-toolbar-click.d.ts +8 -0
  121. package/library/packages/events/src/cx-pdf-viewer-toolbar-page-change.d.ts +8 -0
  122. package/library/packages/events/src/cx-pdf-viewer-toolbar-scale-change.d.ts +8 -0
  123. package/library/packages/events/src/cx-pdf-viewer-toolbar-view-toggle.d.ts +11 -0
  124. package/library/packages/events/src/cx-pdf-viewer-view-on-asset-toggle.d.ts +11 -0
  125. package/library/packages/events/src/cx-video-src-resolved.d.ts +8 -0
  126. package/library/packages/events/src/events.d.ts +13 -0
  127. package/library/packages/hybrid/table-core/src/index.d.ts +3 -0
  128. package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/components/table-row-actions/table-row-actions-dropdown.d.ts +8 -8
  129. package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/components/table-row-actions/table-row-actions.d.ts +6 -5
  130. package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/components/table-toolbar/table-dropdown-filter.d.ts +4 -4
  131. package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/components/table-toolbar/table-group-by-dropdown.d.ts +4 -4
  132. package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/components/table-toolbar/table-saved-search-dropdown.d.ts +6 -5
  133. package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/components/table-toolbar/table-toolbar.d.ts +12 -12
  134. package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/table.d.ts +11 -11
  135. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/Clipboard/Clipboard.d.ts +1 -1
  136. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/Clipboard/extensions/extensions.d.ts +1 -1
  137. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/History/History.d.ts +1 -1
  138. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/History/extensions/extensions.d.ts +1 -1
  139. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/HoverMenu/HoverMenu.d.ts +1 -1
  140. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/Import/defaults/importers.d.ts +1 -1
  141. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/SelectRange/SelectRange.d.ts +4 -4
  142. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/SelectRange/extensions/extensions.d.ts +2 -2
  143. package/library/packages/molecules/src/asset-picker/asset-picker.d.ts +1 -1
  144. package/library/packages/molecules/src/dynamic-select/dynamic-select.d.ts +5 -0
  145. package/library/packages/molecules/src/folder-select/components/folder-select-tree-item/folder-select-tree-item.d.ts +32 -0
  146. package/library/packages/molecules/src/folder-select/folder-select.d.ts +20 -3
  147. package/library/packages/molecules/src/gallery-item/gallery-item.d.ts +5 -0
  148. package/library/packages/molecules/src/index.d.ts +1 -1
  149. package/library/packages/molecules/src/library-index.d.ts +0 -1
  150. package/library/packages/molecules/src/pdf-viewer-toolbar/components/index.d.ts +3 -0
  151. package/library/packages/molecules/src/pdf-viewer-toolbar/components/pdf-viewer-annotation-draw/pdf-viewer-annotation-draw.d.ts +92 -0
  152. package/library/packages/molecules/src/pdf-viewer-toolbar/components/pdf-viewer-more-options/pdf-viewer-more-options.d.ts +43 -0
  153. package/library/packages/molecules/src/pdf-viewer-toolbar/components/pdf-viewer-more-options/pdf-viewer-more-options.styles.d.ts +2 -0
  154. package/library/packages/molecules/src/pdf-viewer-toolbar/components/pdf-viewer-view-on-asset/pdf-viewer-view-on-asset.d.ts +42 -0
  155. package/library/packages/molecules/src/pdf-viewer-toolbar/components/pdf-viewer-view-on-asset/pdf-viewer-view-on-asset.styles.d.ts +2 -0
  156. package/library/packages/molecules/src/pdf-viewer-toolbar/pdf-viewer-toolbar.d.ts +101 -0
  157. package/library/packages/molecules/src/pdf-viewer-toolbar/pdf-viewer-toolbar.styles.d.ts +2 -0
  158. package/library/packages/organisms/src/bento-grid/bento-grid.d.ts +66 -0
  159. package/library/packages/organisms/src/color-swatch-group/color-swatch-group.constants.d.ts +1 -1
  160. package/library/packages/organisms/src/color-swatch-group/color-swatch-group.d.ts +1 -1
  161. package/library/packages/organisms/src/content-builder/components/color-swatch-picker/color-swatch-picker.constants.d.ts +1 -1
  162. package/library/packages/organisms/src/content-builder/components/color-swatch-picker/color-swatch-picker.d.ts +1 -1
  163. package/library/packages/organisms/src/content-builder/components/config-form/config-form-controller.d.ts +1 -0
  164. package/library/packages/organisms/src/content-builder/components/config-form/config-form.d.ts +2 -9
  165. package/library/packages/organisms/src/content-builder/configs/dam-view.d.ts +1 -7
  166. package/library/packages/organisms/src/content-builder/configs-controller.d.ts +2 -14
  167. package/library/packages/organisms/src/content-builder/styleController.d.ts +1 -1
  168. package/library/packages/organisms/src/dam-custom-toolbar-buttons-editor/dam-custom-toolbar-buttons-editor.d.ts +9 -1
  169. package/library/packages/organisms/src/dashboard-table/dashboard-table.d.ts +1 -1
  170. package/library/packages/organisms/src/index.d.ts +1 -0
  171. package/library/packages/{molecules → organisms}/src/list-editor/list-editor.d.ts +9 -3
  172. package/library/packages/organisms/src/list-editor/list-editor.styles.d.ts +2 -0
  173. package/library/packages/organisms/src/video-chapters-manager/video-chapters-manager.d.ts +1 -1
  174. package/library/packages/services/src/api/folder/folder.types.d.ts +9 -2
  175. package/library/packages/tools/src/fetch-asset/fetch-asset.d.ts +16 -0
  176. package/library/packages/types/src/content-builder.d.ts +1 -1
  177. package/library/packages/types/src/dam-view.d.ts +1 -0
  178. package/library/packages/types/src/folder-select.d.ts +8 -1
  179. package/library/packages/types/src/pdf-viewer-toolbar.d.ts +82 -0
  180. package/library/packages/utils/src/custom-element/i18n.d.ts +43 -7
  181. package/library/packages/utils/src/string/string.d.ts +1 -1
  182. package/library/packages/utils/src/url/url.d.ts +12 -2
  183. package/library/react-web-component.d.ts +514 -913
  184. package/library/utils.js +200 -199
  185. package/package.json +3 -1
  186. package/library/chunks/asset.CcxcYY9d.js +0 -469
  187. package/library/chunks/color-swatch-group.DlTVQ3Ul.js +0 -362
  188. package/library/chunks/directive-helpers.Dm4rc594.js +0 -37
  189. package/library/chunks/folder-select.DHV6f6TA.js +0 -884
  190. package/library/chunks/list-editor.BXY4UIAI.js +0 -1394
  191. package/library/chunks/responsive.Cf65FCWd.js +0 -17
  192. package/library/chunks/toast.D3AW3RWv.js +0 -94
  193. package/library/chunks/url.Cj9cIQXJ.js +0 -27
  194. package/library/components/list-editor.d.ts +0 -3
  195. package/library/components/list-editor.js +0 -33
  196. package/library/components/table.d.ts +0 -3
  197. package/library/components/table.js +0 -84
  198. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/components/index.d.ts +0 -0
  199. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/components/table-footer/table-footer.d.ts +0 -0
  200. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/components/table-footer/table-footer.styles.d.ts +0 -0
  201. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/components/table-row-actions/table-row-actions.styles.d.ts +0 -0
  202. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/components/table-toolbar/table-toolbar.styles.d.ts +0 -0
  203. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/controllers/ajax-facets/ajax-facet-data-controller.d.ts +0 -0
  204. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/controllers/ajax-facets/ajax-facet-filter-controller.d.ts +0 -0
  205. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/controllers/filter-controller.d.ts +0 -0
  206. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/controllers/select-all-controller.d.ts +0 -0
  207. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-alert.styles.d.ts +0 -0
  208. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-base.styles.d.ts +0 -0
  209. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-calcs.styles.d.ts +0 -0
  210. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-clickable-cell.styles.d.ts +0 -0
  211. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-data-tree.styles.d.ts +0 -0
  212. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-edit.styles.d.ts +0 -0
  213. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-footer.styles.d.ts +0 -0
  214. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-format.styles.d.ts +0 -0
  215. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-group-rows.styles.d.ts +0 -0
  216. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-header.styles.d.ts +0 -0
  217. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-hover-menu.styles.d.ts +0 -0
  218. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-move-rows.styles.d.ts +0 -0
  219. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-page.styles.d.ts +0 -0
  220. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-placeholder.styles.d.ts +0 -0
  221. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-popup.styles.d.ts +0 -0
  222. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-print.styles.d.ts +0 -0
  223. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-resize.styles.d.ts +0 -0
  224. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-responsive-layout.styles.d.ts +0 -0
  225. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-rows.styles.d.ts +0 -0
  226. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-rtl.styles.d.ts +0 -0
  227. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-select-range.styles.d.ts +0 -0
  228. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/styles/table-spreadsheet.styles.d.ts +0 -0
  229. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/table-data-loader.d.ts +0 -0
  230. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/table.styles.d.ts +0 -0
  231. /package/library/packages/{atoms/src/components → hybrid/table-core/src}/table/table.utils.d.ts +0 -0
  232. /package/library/packages/molecules/src/{list-editor/list-editor.styles.d.ts → pdf-viewer-toolbar/components/pdf-viewer-annotation-draw/pdf-viewer-annotation-draw.styles.d.ts} +0 -0
@@ -1,2166 +1,19 @@
1
1
  import "./cropper.js";
2
- import { C as B } from "../chunks/button.DYoFn504.js";
3
- import _ from "./space.js";
4
- import { C as F } from "../chunks/typography.DJC_UXgs.js";
5
- import { n, C as W } from "../chunks/lib-cortex-element.CVMmyPMC.js";
6
- import { c as rt, d as ht } from "../chunks/asset.CcxcYY9d.js";
7
- import { c as E } from "../chunks/component.styles.CRO4Odto.js";
8
- import { U as a, T as l } from "../chunks/asset-link-format.QzzboHHE.js";
9
- import { c as N } from "../chunks/custom-element.L4WJXn1j.js";
10
- import { L as U } from "../chunks/i18n.DoMIwXr2.js";
11
- import { w } from "../chunks/watch.CThbualB.js";
12
- import { s as et, c as it } from "../chunks/number.B4PQLJIg.js";
13
- import { b as G } from "../chunks/transformation.c-RS37zA.js";
14
- import { i as O, x as m, E as nt } from "../chunks/lit-element.jLBm65_O.js";
15
- import { r as z } from "../chunks/state.CSDxrqLd.js";
16
- import { n as k } from "../chunks/when.Dr1es41R.js";
17
- import I from "./details.js";
18
- import lt from "./divider.js";
19
- import { C as L } from "../chunks/icon.DnBh6-56.js";
20
- import { C as K } from "../chunks/icon-button.B-Jf9W3v.js";
21
- import { C as J } from "../chunks/input.CQNhMu4z.js";
22
- import { C as X } from "../chunks/option.SCVixE2L.js";
23
- import Y from "./select.js";
24
- import { c as ct } from "../chunks/image.BzmclWBR.js";
25
- import { e as V } from "../chunks/query.BBf1UFkC.js";
26
- import { c as j } from "../chunks/repeat.DbF2p5ae.js";
27
- import { o as R } from "../chunks/style-map.llVFPd__.js";
28
- import st from "./tooltip.js";
29
- import pt from "./button-group.js";
30
- import { C as dt } from "../chunks/checkbox.uH0uF0OV.js";
31
- const ut = O`.asset-link-format__details{--header-padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__details::part(icon){width:var(--cx-font-size-3x-large);height:var(--cx-font-size-3x-large);background-color:var(--cx-color-neutral-100);border-radius:var(--cx-border-radius-large);color:var(--cx-color-neutral-600);font-size:var(--cx-font-size-large);justify-content:center;align-items:center;display:flex}.asset-link-format__details::part(input-label){color:var(--cx-color-neutral-400);margin-inline-start:var(--cx-spacing-small)}.asset-link-format__header{padding:var(--cx-spacing-medium)}.asset-link-format__section-header{padding:0 var(--cx-spacing-medium);border-top:var(--section-header-border-width,1px) solid var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-50)}.asset-link-format__undo,.asset-link-format__reset{--color:var(--cx-color-primary);--background-color:transparent}`, mt = O`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.crop__unit-select{width:120px}.crop__input-group{flex:1;display:flex}`;
32
- var gt = Object.defineProperty, ft = Object.getOwnPropertyDescriptor, x = (t, e, i, s) => {
33
- for (var o = s > 1 ? void 0 : s ? ft(e, i) : e, r = t.length - 1, h; r >= 0; r--)
34
- (h = t[r]) && (o = (s ? h(e, i, o) : h(o)) || o);
35
- return s && o && gt(e, i, o), o;
36
- };
37
- let u = class extends W {
38
- constructor() {
39
- super(...arguments), this.localize = new U(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.percentageWidth = 0, this.percentageHeight = 0, this.unit = a.Pixel, this.disabledApply = !1, this.canApply = !1, this.lastAppliedSetting = {
40
- [a.Pixel]: {
41
- height: 0,
42
- percentageHeight: 100,
43
- percentageWidth: 100,
44
- unit: a.Pixel,
45
- width: 0,
46
- x: 0,
47
- y: 0
48
- },
49
- [a.AspectRatio]: {
50
- height: 1,
51
- percentageHeight: 100,
52
- percentageWidth: 100,
53
- unit: a.AspectRatio,
54
- width: 1,
55
- x: 0,
56
- y: 0
57
- }
58
- }, this.loading = !1, this.cropModes = [], this.focusModes = [], this.focusMode = "manual", this.cropMode = "free", this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
59
- }
60
- get selectedMode() {
61
- return this.cropModes.find((t) => t.value === this.cropMode);
62
- }
63
- async handleCropModeChange() {
64
- if (typeof this.cropMode == "string" && /^\d+:\d+$/.test(this.cropMode)) {
65
- const [t, e] = this.cropMode.split(":").map(Number);
66
- this.aspectRatio = t / e;
67
- return;
68
- }
69
- if (this.keepAspectRatio) {
70
- if (this.unit === a.Pixel && this.width && this.height) {
71
- this.aspectRatio = this.width / this.height;
72
- return;
73
- } else if (this.unit === a.AspectRatio && this.ratioWidth && this.ratioHeight) {
74
- this.aspectRatio = this.ratioWidth / this.ratioHeight;
75
- return;
76
- }
77
- }
78
- if (this.maxWidth && this.maxHeight && Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight)) {
79
- this.aspectRatio = this.maxWidth / this.maxHeight;
80
- return;
81
- }
82
- this.aspectRatio = 1;
83
- }
84
- async handleOpenChange() {
85
- if (this.cropMode = "free", await this.updateComplete, !this.open) {
86
- if (!this.canApply)
87
- return;
88
- this.width = this.lastAppliedSetting[a.Pixel].width, this.height = this.lastAppliedSetting[a.Pixel].height, this.unit = a.Pixel, this.emit("cx-asset-link-format-crop-change", {
89
- detail: {
90
- height: this.lastAppliedSetting[a.Pixel].height,
91
- keepAspectRatio: this.keepAspectRatio,
92
- unit: a.Pixel,
93
- width: this.lastAppliedSetting[a.Pixel].width
94
- }
95
- });
96
- }
97
- }
98
- handleWidthChange(t) {
99
- if (!t.target.value) {
100
- this.invalidWidth = !0;
101
- return;
102
- }
103
- this.invalidWidth = !1;
104
- let e = Number(t.target.value);
105
- this.unit === a.Pixel && (e = Math.max(Math.min(e, this.maxWidth), 1)), t.target.value = e.toString();
106
- let i = this.unit === a.Pixel ? this.height : this.ratioHeight, s = !1;
107
- this.keepAspectRatio && (i = Math.round(e / this.aspectRatio), this.unit === a.Pixel && i > this.maxHeight && (i = this.maxHeight, s = !0)), this.invalidHeight = !1, this.emit("cx-asset-link-format-crop-change", {
108
- detail: {
109
- breakAspectRatio: s,
110
- height: i,
111
- keepAspectRatio: this.keepAspectRatio,
112
- unit: this.unit,
113
- width: e
114
- }
115
- });
116
- }
117
- handleHeightChange(t) {
118
- if (!t.target.value) {
119
- this.invalidHeight = !0;
120
- return;
121
- }
122
- this.invalidHeight = !1;
123
- let e = Number(t.target.value);
124
- this.unit === a.Pixel && (e = Math.max(Math.min(e, this.maxHeight), 1)), t.target.value = e.toString();
125
- let i = this.unit === a.Pixel ? this.width : this.ratioWidth, s = !1;
126
- this.keepAspectRatio && (i = Math.round(e * this.aspectRatio), this.unit === a.Pixel && i > this.maxWidth && (i = this.maxWidth, s = !0)), this.invalidWidth = !1, this.emit("cx-asset-link-format-crop-change", {
127
- detail: {
128
- breakAspectRatio: s,
129
- height: e,
130
- keepAspectRatio: this.keepAspectRatio,
131
- unit: this.unit,
132
- width: i
133
- }
134
- });
135
- }
136
- onCropModeChange(t) {
137
- const e = t.target.value, i = this.cropModes.find((s) => s.value === e)?.auto;
138
- if (e === "free")
139
- this.selectedMode?.auto && this.emit("cx-asset-link-format-crop-change", {
140
- detail: {
141
- height: this.lastAppliedSetting[a.Pixel].height,
142
- keepAspectRatio: !1,
143
- silent: !0,
144
- unit: a.Pixel,
145
- width: this.lastAppliedSetting[a.Pixel].width
146
- }
147
- });
148
- else if (!i) {
149
- const [s, o] = e.split(":").map(Number);
150
- if (this.unit === a.Pixel) {
151
- let r = s, h = o;
152
- Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: h, width: r } = ct(
153
- this.maxWidth,
154
- this.maxHeight,
155
- s,
156
- o
157
- )), this.emit("cx-asset-link-format-crop-change", {
158
- detail: {
159
- height: h,
160
- keepAspectRatio: !0,
161
- silent: !0,
162
- unit: a.Pixel,
163
- width: r
164
- }
165
- });
166
- } else
167
- this.emit("cx-asset-link-format-crop-change", {
168
- detail: {
169
- height: o,
170
- keepAspectRatio: !0,
171
- silent: !0,
172
- unit: a.AspectRatio,
173
- width: s
174
- }
175
- });
176
- }
177
- this.emit("cx-asset-link-format-crop-mode-change", {
178
- detail: {
179
- mode: e
180
- }
181
- });
182
- }
183
- onFocusModeChange(t) {
184
- const e = t.target.value;
185
- this.emit("cx-asset-link-format-crop-focus-mode-change", {
186
- detail: {
187
- mode: e
188
- }
189
- });
190
- }
191
- /**
192
- * Handles the change of the unit of measurement for the crop settings.
193
- * When the unit is changed to Aspect Ratio, it emits an event with the last applied settings for Aspect Ratio.
194
- * When the unit is changed to Pixels, it emits an event with the last applied settings for Pixels.
195
- * This allows the parent component to update the crop settings accordingly.
196
- */
197
- onUnitChange(t) {
198
- t.target.value === a.AspectRatio ? this.emit("cx-asset-link-format-crop-change", {
199
- detail: {
200
- height: this.lastAppliedSetting[a.AspectRatio].height,
201
- keepAspectRatio: this.keepAspectRatio,
202
- unit: a.AspectRatio,
203
- width: this.lastAppliedSetting[a.AspectRatio].width
204
- }
205
- }) : this.emit("cx-asset-link-format-crop-change", {
206
- detail: {
207
- height: this.lastAppliedSetting[a.Pixel].height,
208
- keepAspectRatio: this.keepAspectRatio,
209
- unit: a.Pixel,
210
- width: this.lastAppliedSetting[a.Pixel].width
211
- }
212
- }), this.emit("cx-asset-link-format-crop-mode-change", {
213
- detail: {
214
- mode: "free"
215
- }
216
- });
217
- }
218
- handleInputChange(t) {
219
- t.stopPropagation(), this.emit("cx-asset-link-format-crop-changed");
220
- }
221
- handleApply() {
222
- this.loading || this.emit("cx-asset-link-format-crop-apply", {
223
- detail: {
224
- height: this.height,
225
- unit: this.unit,
226
- width: this.width
227
- }
228
- });
229
- }
230
- /**
231
- * Handles showing the details section.
232
- * This method prevents the event from propagating if the target is not the base element, such as tooltips, select dropdowns, or other interactive elements inside the details.
233
- * This ensures that the details section is only shown when the user interacts with the base element.
234
- */
235
- onShowDetails(t) {
236
- t.target !== this.base && t.stopPropagation();
237
- }
238
- /**
239
- * Handles hiding the details section.
240
- * This method prevents the event from propagating if the target is not the base element, such as tooltips, select dropdowns, or other interactive elements inside the details.
241
- * This ensures that the details section is only hidden when the user interacts with the base element.
242
- */
243
- onHideDetails(t) {
244
- t.target !== this.base && t.stopPropagation();
245
- }
246
- handleAspectRatioClick() {
247
- this.keepAspectRatio && this.cropMode !== "free" && this.emit("cx-asset-link-format-crop-mode-change", {
248
- detail: {
249
- mode: "free"
250
- }
251
- }), this.emit("cx-asset-link-format-crop-change", {
252
- detail: {
253
- height: this.unit === a.Pixel ? this.height : this.ratioHeight,
254
- keepAspectRatio: !this.keepAspectRatio,
255
- unit: this.unit,
256
- width: this.unit === a.Pixel ? this.width : this.ratioWidth
257
- }
258
- });
259
- }
260
- render() {
261
- const t = this.cropModes.filter((i) => !i.auto), e = this.cropModes.filter((i) => i.auto);
262
- return m`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="crop"></cx-icon></div><cx-typography variant="body2">${this.localize.term("crop")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small"><cx-select data-testid="cx-asset-link-format-crop-mode" value=${this.cropMode} hoist style=${R({
263
- width: "100%"
264
- })} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${j(
265
- t,
266
- (i) => i.value,
267
- ({ label: i, value: s }) => m`<cx-option value=${s}>${i}</cx-option>`
268
- )}
269
- ${k(
270
- e.length > 0,
271
- () => m`<cx-divider></cx-divider><small>${this.localize.term("autoCropping")}</small>`
272
- )}
273
- ${j(
274
- e,
275
- (i) => i.value,
276
- ({ label: i, value: s }) => m`<cx-option value=${s}>${i}</cx-option>`
277
- )}</cx-select><cx-space spacing="small"><div class="crop__input-group"><cx-input data-testid="cx-asset-link-format-crop-width" placeholder=${this.localize.term("width")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === a.Pixel ? this.width.toString() : this.ratioWidth.toString()} @cx-change=${this.handleInputChange} @cx-input=${this.handleWidthChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
278
- W
279
- </cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-crop-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} @click=${this.handleAspectRatioClick} style=${R({
280
- color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
281
- })} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-crop-height" placeholder=${this.localize.term("height")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === a.Pixel ? this.height.toString() : this.ratioHeight.toString()} ?disabled=${this.loading} @cx-change=${this.handleInputChange} @cx-input=${this.handleHeightChange} required><cx-typography slot="prefix" variant="body3" part="input-label">
282
- H
283
- </cx-typography></cx-input></div><cx-select data-testid="cx-asset-link-format-crop-unit" value=${this.unit} hoist class="crop__unit-select" ?disabled=${this.loading} @cx-change=${this.onUnitChange}><cx-option value=${a.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${a.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select></cx-space>${k(
284
- this.focusModes.length > 0,
285
- () => m`<cx-select data-testid="cx-asset-link-format-crop-focus-mode" value=${this.focusMode} hoist style=${R({
286
- width: "100%"
287
- })} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${j(
288
- this.focusModes,
289
- (i) => i.value,
290
- ({ label: i, value: s }) => m`<cx-option value=${s}>${i}</cx-option>`
291
- )}</cx-select>`
292
- )}
293
- ${k(this.canApply, () => m`<cx-button data-testid="cx-asset-link-format-crop-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${R({
294
- marginLeft: "auto"
295
- })} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button>`)}</cx-space></cx-details>`;
296
- }
297
- };
298
- u.styles = [E, mt];
299
- u.dependencies = {
300
- "cx-button": B,
301
- "cx-details": I,
302
- "cx-divider": lt,
303
- "cx-icon": L,
304
- "cx-icon-button": K,
305
- "cx-input": J,
306
- "cx-option": X,
307
- "cx-select": Y,
308
- "cx-space": _,
309
- "cx-typography": F
310
- };
311
- x([
312
- V(".details")
313
- ], u.prototype, "base", 2);
314
- x([
315
- n({ reflect: !0, type: Boolean })
316
- ], u.prototype, "open", 2);
317
- x([
318
- n({ reflect: !0, type: Number })
319
- ], u.prototype, "width", 2);
320
- x([
321
- n({ reflect: !0, type: Number })
322
- ], u.prototype, "height", 2);
323
- x([
324
- n({ attribute: "max-width", reflect: !0, type: Number })
325
- ], u.prototype, "maxWidth", 2);
326
- x([
327
- n({ attribute: "max-height", reflect: !0, type: Number })
328
- ], u.prototype, "maxHeight", 2);
329
- x([
330
- n({ attribute: "ratio-width", reflect: !0, type: Number })
331
- ], u.prototype, "ratioWidth", 2);
332
- x([
333
- n({ attribute: "ratio-height", reflect: !0, type: Number })
334
- ], u.prototype, "ratioHeight", 2);
335
- x([
336
- n({ attribute: "percentage-width", reflect: !0, type: Number })
337
- ], u.prototype, "percentageWidth", 2);
338
- x([
339
- n({ attribute: "percentage-height", reflect: !0, type: Number })
340
- ], u.prototype, "percentageHeight", 2);
341
- x([
342
- n({ reflect: !0, type: String })
343
- ], u.prototype, "unit", 2);
344
- x([
345
- n({ attribute: "disabled-apply", reflect: !0, type: Boolean })
346
- ], u.prototype, "disabledApply", 2);
347
- x([
348
- n({ attribute: "can-apply", reflect: !0, type: Boolean })
349
- ], u.prototype, "canApply", 2);
350
- x([
351
- n({ attribute: "last-applied-setting", reflect: !1, type: Object })
352
- ], u.prototype, "lastAppliedSetting", 2);
353
- x([
354
- n({ reflect: !0, type: Boolean })
355
- ], u.prototype, "loading", 2);
356
- x([
357
- n({ attribute: "crop-modes", reflect: !1, type: Array })
358
- ], u.prototype, "cropModes", 2);
359
- x([
360
- n({ attribute: "focus-modes", reflect: !1, type: Object })
361
- ], u.prototype, "focusModes", 2);
362
- x([
363
- n({ attribute: "focus-mode", reflect: !0, type: String })
364
- ], u.prototype, "focusMode", 2);
365
- x([
366
- n({ attribute: "crop-mode", reflect: !0, type: String })
367
- ], u.prototype, "cropMode", 2);
368
- x([
369
- n({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
370
- ], u.prototype, "keepAspectRatio", 2);
371
- x([
372
- z()
373
- ], u.prototype, "invalidWidth", 2);
374
- x([
375
- z()
376
- ], u.prototype, "invalidHeight", 2);
377
- x([
378
- z()
379
- ], u.prototype, "aspectRatio", 2);
380
- x([
381
- w("cropMode", { waitUntilFirstUpdate: !0 }),
382
- w("maxWidth", { waitUntilFirstUpdate: !0 }),
383
- w("maxHeight", { waitUntilFirstUpdate: !0 }),
384
- w("keepAspectRatio")
385
- ], u.prototype, "handleCropModeChange", 1);
386
- x([
387
- w("open")
388
- ], u.prototype, "handleOpenChange", 1);
389
- u = x([
390
- N("cx-asset-link-format-crop")
391
- ], u);
392
- const xt = O`.extension{padding:var(--cx-spacing-small) var(--cx-spacing-medium);border:solid 1px var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-0);& cx-select{flex:1;width:100%}}`;
393
- var yt = Object.defineProperty, zt = Object.getOwnPropertyDescriptor, tt = (t, e, i, s) => {
394
- for (var o = s > 1 ? void 0 : s ? zt(e, i) : e, r = t.length - 1, h; r >= 0; r--)
395
- (h = t[r]) && (o = (s ? h(e, i, o) : h(o)) || o);
396
- return s && o && yt(e, i, o), o;
397
- };
398
- let T = class extends W {
399
- constructor() {
400
- super(...arguments), this.localize = new U(this), this.value = "", this.items = [];
401
- }
402
- handleExtensionChange(t) {
403
- const e = t.target.value;
404
- this.emit("cx-asset-link-format-extension-change", {
405
- detail: e
406
- });
407
- }
408
- render() {
409
- return m`<cx-space direction="vertical" spacing="small" class="extension"><cx-typography variant="body2">${this.localize.term("extension")}</cx-typography><cx-select data-label=${this.localize.term("extension")} data-testid="cx-asset-link-format-extension-select" value=${this.value} hoist @cx-change=${this.handleExtensionChange}>${j(
410
- this.items,
411
- (t) => t.value,
412
- (t) => m`<cx-option value=${t.value}>${t.displayName}</cx-option>`
413
- )}</cx-select></cx-space>`;
414
- }
415
- };
416
- T.styles = [E, xt];
417
- T.dependencies = {
418
- "cx-option": X,
419
- "cx-select": Y,
420
- "cx-space": _,
421
- "cx-typography": F
422
- };
423
- tt([
424
- n({ reflect: !0, type: String })
425
- ], T.prototype, "value", 2);
426
- tt([
427
- n({ reflect: !1, type: Array })
428
- ], T.prototype, "items", 2);
429
- T = tt([
430
- N("cx-asset-link-format-extension")
431
- ], T);
432
- const St = O`cx-details::part(base){border-bottom-width:0}`;
433
- var wt = Object.defineProperty, bt = Object.getOwnPropertyDescriptor, M = (t, e, i, s) => {
434
- for (var o = s > 1 ? void 0 : s ? bt(e, i) : e, r = t.length - 1, h; r >= 0; r--)
435
- (h = t[r]) && (o = (s ? h(e, i, o) : h(o)) || o);
436
- return s && o && wt(e, i, o), o;
437
- };
438
- let $ = class extends W {
439
- constructor() {
440
- super(...arguments), this.localize = new U(this), this.open = !1, this.value = "", this.items = [], this.loading = !1, this.scopedValue = "";
441
- }
442
- handleValueChange() {
443
- this.scopedValue = this.value;
444
- }
445
- handleOpenChange() {
446
- this.open || (this.scopedValue = this.value);
447
- }
448
- handleProxyChange(t) {
449
- const e = t.target.value;
450
- this.scopedValue = e;
451
- }
452
- /**
453
- * Handles the application of the selected proxy format.
454
- * This method emits a custom event with the selected proxy format when the "Apply" button is clicked.
455
- * It prevents further actions if the component is currently loading.
456
- */
457
- handleApply() {
458
- if (this.loading)
459
- return;
460
- const t = this.items.find(
461
- (e) => e.id === this.scopedValue
462
- );
463
- t && this.emit("cx-asset-link-format-proxy-change", {
464
- detail: t
465
- });
466
- }
467
- /**
468
- * Handles showing the details section.
469
- * This method prevents the event from propagating if the target is not the base element, such as tooltips, select dropdowns, or other interactive elements inside the details.
470
- * This ensures that the details section is only shown when the user interacts with the base element.
471
- */
472
- onShowDetails(t) {
473
- t.target !== this.base && t.stopPropagation();
474
- }
475
- /**
476
- * Handles hiding the details section.
477
- * This method prevents the event from propagating if the target is not the base element, such as tooltips, select dropdowns, or other interactive elements inside the details.
478
- * This ensures that the details section is only hidden when the user interacts with the base element.
479
- */
480
- onHideDetails(t) {
481
- t.target !== this.base && t.stopPropagation();
482
- }
483
- render() {
484
- return m`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="photo_size_select_large"></cx-icon></div><cx-typography variant="body2">${this.localize.term("format")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small" class="format"><cx-select data-label=${this.localize.term("imageFormat")} data-testid="cx-asset-link-format-proxy-select" value=${this.scopedValue} hoist @cx-change=${this.handleProxyChange} ?disabled=${this.loading}>${j(
485
- this.items,
486
- (t) => t.id,
487
- (t) => m`<cx-option value=${t.id}>${t.proxyLabel}</cx-option>`
488
- )}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${R({
489
- "margin-left": "auto"
490
- })} ?disabled=${this.scopedValue === this.value} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
491
- }
492
- };
493
- $.styles = [E, St];
494
- $.dependencies = {
495
- "cx-button": B,
496
- "cx-details": I,
497
- "cx-icon": L,
498
- "cx-option": X,
499
- "cx-select": Y,
500
- "cx-space": _,
501
- "cx-typography": F
502
- };
503
- M([
504
- V(".details")
505
- ], $.prototype, "base", 2);
506
- M([
507
- n({ reflect: !0, type: Boolean })
508
- ], $.prototype, "open", 2);
509
- M([
510
- n({ reflect: !0, type: String })
511
- ], $.prototype, "value", 2);
512
- M([
513
- n({ reflect: !1, type: Array })
514
- ], $.prototype, "items", 2);
515
- M([
516
- n({ reflect: !0, type: Boolean })
517
- ], $.prototype, "loading", 2);
518
- M([
519
- z()
520
- ], $.prototype, "scopedValue", 2);
521
- M([
522
- w("value")
523
- ], $.prototype, "handleValueChange", 1);
524
- M([
525
- w("open", { waitUntilFirstUpdate: !0 })
526
- ], $.prototype, "handleOpenChange", 1);
527
- $ = M([
528
- N("cx-asset-link-format-proxy")
529
- ], $);
530
- const vt = O`cx-details::part(base){border-bottom-width:0}`;
531
- var kt = Object.defineProperty, $t = Object.getOwnPropertyDescriptor, D = (t, e, i, s) => {
532
- for (var o = s > 1 ? void 0 : s ? $t(e, i) : e, r = t.length - 1, h; r >= 0; r--)
533
- (h = t[r]) && (o = (s ? h(e, i, o) : h(o)) || o);
534
- return s && o && kt(e, i, o), o;
535
- };
536
- let A = class extends W {
537
- constructor() {
538
- super(...arguments), this.localize = new U(this), this.open = !1, this.value = 100, this.loading = !1, this.canApply = !1, this.scopedValue = 100;
539
- }
540
- /**
541
- * A computed property that checks if the current quality value is invalid.
542
- * The value is considered invalid if it is not a number, less than 1, greater than 100, or equal to the current value.
543
- * @return {boolean} True if the value is invalid, false otherwise.
544
- */
545
- get invalidValue() {
546
- return isNaN(Number(this.scopedValue)) || Number(this.scopedValue) < 1 || Number(this.scopedValue) > 100 || this.value === this.scopedValue;
547
- }
548
- handleValueChange() {
549
- this.scopedValue = this.value;
550
- }
551
- handleQualityChange(t) {
552
- const e = t.target.value;
553
- this.scopedValue = Number(e), !this.canApply && !this.invalidValue && this.emit("cx-asset-link-format-quality-change", {
554
- detail: this.scopedValue
555
- });
556
- }
557
- /**
558
- * Handles the application of the input quality.
559
- * This method emits a custom event with the input quality when the "Apply" button is clicked.
560
- * It prevents further actions if the component is currently loading.
561
- */
562
- handleApply() {
563
- this.loading || this.emit("cx-asset-link-format-quality-change", {
564
- detail: Number(this.scopedValue)
565
- });
566
- }
567
- /**
568
- * Handles showing the details section.
569
- * This method prevents the event from propagating if the target is not the base element, such as tooltips, select dropdowns, or other interactive elements inside the details.
570
- * This ensures that the details section is only shown when the user interacts with the base element.
571
- */
572
- onShowDetails(t) {
573
- t.target !== this.base && t.stopPropagation();
574
- }
575
- /**
576
- * Handles hiding the details section.
577
- * This method prevents the event from propagating if the target is not the base element, such as tooltips, select dropdowns, or other interactive elements inside the details.
578
- * This ensures that the details section is only hidden when the user interacts with the base element.
579
- */
580
- onHideDetails(t) {
581
- t.target !== this.base && t.stopPropagation();
582
- }
583
- render() {
584
- return m`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div class="details__summary__icon"><div part="icon"><cx-icon name="blur_on"></cx-icon></div></div><cx-typography variant="body2">${this.localize.term("quality")}</cx-typography></cx-space><cx-space spacing="small"><cx-tooltip data-testid="cx-asset-link-format-quality-tooltip" content=${this.localize.term("qualityHelpText")} hoist><cx-input data-testid="cx-asset-link-format-quality" class="details__checkbox" mask="num" .maskBlocks=${{ num: { mask: Number, max: 100, min: 1 } }} value=${this.scopedValue.toString()} style=${R({
585
- flex: "1"
586
- })} @cx-input=${this.handleQualityChange}></cx-input></cx-tooltip>${k(this.canApply, () => m`<cx-button data-testid="cx-asset-link-format-quality-apply" variant="primary" ?disabled=${this.invalidValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button>`)}</cx-space></cx-details>`;
587
- }
588
- };
589
- A.styles = [E, vt];
590
- A.dependencies = {
591
- "cx-button": B,
592
- "cx-details": I,
593
- "cx-icon": L,
594
- "cx-input": J,
595
- "cx-space": _,
596
- "cx-tooltip": st,
597
- "cx-typography": F
598
- };
599
- D([
600
- V(".details")
601
- ], A.prototype, "base", 2);
602
- D([
603
- n({ reflect: !0, type: Boolean })
604
- ], A.prototype, "open", 2);
605
- D([
606
- n({ reflect: !0, type: Number })
607
- ], A.prototype, "value", 2);
608
- D([
609
- n({ reflect: !0, type: Boolean })
610
- ], A.prototype, "loading", 2);
611
- D([
612
- n({ attribute: "can-apply", reflect: !0, type: Boolean })
613
- ], A.prototype, "canApply", 2);
614
- D([
615
- z()
616
- ], A.prototype, "scopedValue", 2);
617
- D([
618
- w("value")
619
- ], A.prototype, "handleValueChange", 1);
620
- A = D([
621
- N("cx-asset-link-format-quality")
622
- ], A);
623
- const At = O`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.resize__unit-select{width:120px}.resize__input-group{flex:1;display:flex}`;
624
- var Ct = Object.defineProperty, Rt = Object.getOwnPropertyDescriptor, S = (t, e, i, s) => {
625
- for (var o = s > 1 ? void 0 : s ? Rt(e, i) : e, r = t.length - 1, h; r >= 0; r--)
626
- (h = t[r]) && (o = (s ? h(e, i, o) : h(o)) || o);
627
- return s && o && Ct(e, i, o), o;
628
- };
629
- let y = class extends W {
630
- constructor() {
631
- super(...arguments), this.localize = new U(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.unit = a.Pixel, this.lastAppliedSetting = {
632
- [a.Pixel]: { height: 0, width: 0 },
633
- [a.AspectRatio]: { height: 1, width: 1 }
634
- }, this.loading = !1, this.canApply = !1, this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
635
- }
636
- /**
637
- * A computed property that checks if the current resize settings match the last applied settings.
638
- * This is used to disable the apply button when no changes have been made.
639
- * @returns {boolean} True if the current settings match the last applied settings, false otherwise.
640
- */
641
- get disabledApply() {
642
- return this.lastAppliedSetting[this.unit].width === this.width && this.lastAppliedSetting[this.unit].height === this.height;
643
- }
644
- async handleCropModeChange() {
645
- if (this.keepAspectRatio) {
646
- if (this.unit === a.Pixel && this.width && this.height) {
647
- this.aspectRatio = this.width / this.height;
648
- return;
649
- } else if (this.unit === a.AspectRatio && this.ratioWidth && this.ratioHeight) {
650
- this.aspectRatio = this.ratioWidth / this.ratioHeight;
651
- return;
652
- }
653
- }
654
- if (this.maxWidth && this.maxHeight && Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight)) {
655
- this.aspectRatio = this.maxWidth / this.maxHeight;
656
- return;
657
- }
658
- this.aspectRatio = 1;
659
- }
660
- async handleOpenChange() {
661
- if (await this.updateComplete, !this.open) {
662
- if (!this.canApply)
663
- return;
664
- this.width = this.lastAppliedSetting[a.Pixel].width, this.height = this.lastAppliedSetting[a.Pixel].height, this.unit = a.Pixel, this.emit("cx-asset-link-format-resize-change", {
665
- detail: {
666
- height: this.lastAppliedSetting[a.Pixel].height,
667
- keepAspectRatio: this.keepAspectRatio,
668
- unit: a.Pixel,
669
- width: this.lastAppliedSetting[a.Pixel].width
670
- }
671
- });
672
- }
673
- }
674
- handleWidthChange(t) {
675
- if (!t.target.value) {
676
- this.invalidWidth = !0;
677
- return;
678
- }
679
- this.invalidWidth = !1;
680
- let e = Number(t.target.value);
681
- this.unit === a.Pixel && (e = Math.max(Math.min(e, this.maxWidth), 1)), t.target.value = e.toString();
682
- let i = this.unit === a.Pixel ? this.height : this.ratioHeight;
683
- this.keepAspectRatio && (i = Math.min(
684
- Math.round(e / this.aspectRatio),
685
- this.maxHeight
686
- ), this.invalidHeight = !1), this.emit("cx-asset-link-format-resize-change", {
687
- detail: {
688
- height: i,
689
- keepAspectRatio: this.keepAspectRatio,
690
- unit: this.unit,
691
- width: e
692
- }
693
- });
694
- }
695
- handleHeightChange(t) {
696
- if (!t.target.value) {
697
- this.invalidHeight = !0;
698
- return;
699
- }
700
- this.invalidHeight = !1;
701
- let e = Number(t.target.value);
702
- this.unit === a.Pixel && (e = Math.max(Math.min(e, this.maxHeight), 1)), t.target.value = e.toString();
703
- let i = this.unit === a.Pixel ? this.width : this.ratioWidth;
704
- this.keepAspectRatio && (i = Math.min(
705
- Math.round(e * this.aspectRatio),
706
- this.maxWidth
707
- ), this.invalidWidth = !1), this.emit("cx-asset-link-format-resize-change", {
708
- detail: {
709
- height: e,
710
- keepAspectRatio: this.keepAspectRatio,
711
- unit: this.unit,
712
- width: i
713
- }
714
- });
715
- }
716
- onUnitChange(t) {
717
- t.target.value === a.AspectRatio ? this.emit("cx-asset-link-format-resize-change", {
718
- detail: {
719
- height: this.lastAppliedSetting[a.AspectRatio].height,
720
- keepAspectRatio: this.keepAspectRatio,
721
- unit: a.AspectRatio,
722
- width: this.lastAppliedSetting[a.AspectRatio].width
723
- }
724
- }) : this.emit("cx-asset-link-format-resize-change", {
725
- detail: {
726
- height: this.lastAppliedSetting[a.Pixel].height,
727
- keepAspectRatio: this.keepAspectRatio,
728
- unit: a.Pixel,
729
- width: this.lastAppliedSetting[a.Pixel].width
730
- }
731
- });
732
- }
733
- handleApply() {
734
- this.loading || this.emit("cx-asset-link-format-resize-apply", {
735
- detail: {
736
- height: this.height,
737
- unit: this.unit,
738
- width: this.width
739
- }
740
- });
741
- }
742
- /**
743
- * Handles showing the details section.
744
- * This method prevents the event from propagating if the target is not the base element, such as tooltips, select dropdowns, or other interactive elements inside the details.
745
- * This ensures that the details section is only shown when the user interacts with the base element.
746
- */
747
- onShowDetails(t) {
748
- t.target !== this.base && t.stopPropagation();
749
- }
750
- /**
751
- * Handles hiding the details section.
752
- * This method prevents the event from propagating if the target is not the base element, such as tooltips, select dropdowns, or other interactive elements inside the details.
753
- * This ensures that the details section is only hidden when the user interacts with the base element.
754
- */
755
- onHideDetails(t) {
756
- t.target !== this.base && t.stopPropagation();
757
- }
758
- handleAspectRatioClick() {
759
- this.emit("cx-asset-link-format-resize-change", {
760
- detail: {
761
- height: this.unit === a.Pixel ? this.height : this.ratioHeight,
762
- keepAspectRatio: !this.keepAspectRatio,
763
- unit: this.unit,
764
- width: this.unit === a.Pixel ? this.width : this.ratioWidth
765
- }
766
- });
767
- }
768
- render() {
769
- return m`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="aspect_ratio"></cx-icon></div><cx-typography variant="body2">${this.localize.term("resize")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small"><cx-space spacing="small"><div class="resize__input-group"><cx-input data-testid="cx-asset-link-format-resize-width" placeholder=${this.localize.term("width")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === a.Pixel ? this.width.toString() : this.ratioWidth.toString()} @cx-input=${this.handleWidthChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
770
- W
771
- </cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-resize-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} @click=${this.handleAspectRatioClick} style=${R({
772
- color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
773
- })} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-resize-height" placeholder=${this.localize.term("height")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === a.Pixel ? this.height.toString() : this.ratioHeight.toString()} @cx-input=${this.handleHeightChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
774
- H
775
- </cx-typography></cx-input></div><cx-select data-testid="cx-asset-link-format-resize-unit" value=${this.unit} hoist class="resize__unit-select" @cx-change=${this.onUnitChange}><cx-option value=${a.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${a.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select></cx-space>${k(this.canApply, () => m`<cx-button data-testid="cx-asset-link-format-resize-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${R({
776
- marginLeft: "auto"
777
- })} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button>`)}</cx-space></cx-details>`;
778
- }
779
- };
780
- y.styles = [E, At];
781
- y.dependencies = {
782
- "cx-button": B,
783
- "cx-details": I,
784
- "cx-icon": L,
785
- "cx-icon-button": K,
786
- "cx-input": J,
787
- "cx-option": X,
788
- "cx-select": Y,
789
- "cx-space": _,
790
- "cx-typography": F
791
- };
792
- S([
793
- V(".details")
794
- ], y.prototype, "base", 2);
795
- S([
796
- n({ reflect: !0, type: Boolean })
797
- ], y.prototype, "open", 2);
798
- S([
799
- n({ reflect: !0, type: Number })
800
- ], y.prototype, "width", 2);
801
- S([
802
- n({ reflect: !0, type: Number })
803
- ], y.prototype, "height", 2);
804
- S([
805
- n({ attribute: "max-width", reflect: !0, type: Number })
806
- ], y.prototype, "maxWidth", 2);
807
- S([
808
- n({ attribute: "max-height", reflect: !0, type: Number })
809
- ], y.prototype, "maxHeight", 2);
810
- S([
811
- n({ attribute: "ratio-width", reflect: !0, type: Number })
812
- ], y.prototype, "ratioWidth", 2);
813
- S([
814
- n({ attribute: "ratio-height", reflect: !0, type: Number })
815
- ], y.prototype, "ratioHeight", 2);
816
- S([
817
- n({ reflect: !0, type: String })
818
- ], y.prototype, "unit", 2);
819
- S([
820
- n({ attribute: "last-applied-setting", reflect: !1, type: Object })
821
- ], y.prototype, "lastAppliedSetting", 2);
822
- S([
823
- n({ reflect: !0, type: Boolean })
824
- ], y.prototype, "loading", 2);
825
- S([
826
- n({ attribute: "can-apply", reflect: !0, type: Boolean })
827
- ], y.prototype, "canApply", 2);
828
- S([
829
- n({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
830
- ], y.prototype, "keepAspectRatio", 2);
831
- S([
832
- z()
833
- ], y.prototype, "invalidWidth", 2);
834
- S([
835
- z()
836
- ], y.prototype, "invalidHeight", 2);
837
- S([
838
- z()
839
- ], y.prototype, "aspectRatio", 2);
840
- S([
841
- w("cropMode", { waitUntilFirstUpdate: !0 }),
842
- w("maxWidth", { waitUntilFirstUpdate: !0 }),
843
- w("maxHeight", { waitUntilFirstUpdate: !0 }),
844
- w("keepAspectRatio")
845
- ], y.prototype, "handleCropModeChange", 1);
846
- S([
847
- w("open")
848
- ], y.prototype, "handleOpenChange", 1);
849
- y = S([
850
- N("cx-asset-link-format-resize")
851
- ], y);
852
- const Mt = O`cx-details::part(base){border-bottom-width:0}`;
853
- var Pt = Object.defineProperty, Ht = Object.getOwnPropertyDescriptor, q = (t, e, i, s) => {
854
- for (var o = s > 1 ? void 0 : s ? Ht(e, i) : e, r = t.length - 1, h; r >= 0; r--)
855
- (h = t[r]) && (o = (s ? h(e, i, o) : h(o)) || o);
856
- return s && o && Pt(e, i, o), o;
857
- };
858
- let C = class extends W {
859
- constructor() {
860
- super(...arguments), this.localize = new U(this), this.open = !1, this.value = 0, this.defaultValue = 0, this.loading = !1, this.canApply = !1;
861
- }
862
- handleOpenChange() {
863
- if (!this.open) {
864
- if (!this.canApply)
865
- return;
866
- this.emit("cx-asset-link-format-rotation-change", {
867
- detail: 0
868
- });
869
- }
870
- }
871
- handleRotationChange(t) {
872
- const e = t.target.value, i = et(Number(e));
873
- (Number(e) > 360 || Number(e) < -360) && (t.target.value = i.toString()), this.emit("cx-asset-link-format-rotation-change", {
874
- detail: i
875
- });
876
- }
877
- handleButtonClick(t) {
878
- this.emit("cx-asset-link-format-rotation-change", {
879
- detail: et(t)
880
- });
881
- }
882
- handleClockwiseClick() {
883
- this.handleButtonClick(this.value + 90);
884
- }
885
- handleCounterClockwiseClick() {
886
- this.handleButtonClick(this.value - 90);
887
- }
888
- /**
889
- * Handles the application of the input rotation.
890
- * This method emits a custom event with the input rotation when the "Apply" button is clicked.
891
- * It prevents further actions if the component is currently loading.
892
- */
893
- handleApply() {
894
- this.value === 360 || this.value === -360 || this.loading || this.emit("cx-asset-link-format-rotation-apply", {
895
- detail: this.value
896
- });
897
- }
898
- render() {
899
- return m`<cx-details class="details" ?open=${this.open}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="rotate_90_degrees_cw"></cx-icon></div><cx-typography variant="body2">Rotate</cx-typography></cx-space><cx-space spacing="small"><cx-button-group label=${this.localize.term("history")}><cx-icon-button data-testid="cx-asset-link-format-rotation-ccw" name="rotate_90_degrees_ccw" label=${this.localize.term("undo")} outline size="small" ?disabled=${this.loading || this.value === -360} @click=${this.handleCounterClockwiseClick}></cx-icon-button><cx-icon-button data-testid="cx-asset-link-format-rotation-cw" name="rotate_90_degrees_cw" label=${this.localize.term("redo")} outline size="small" ?disabled=${this.loading || this.value === 360} @click=${this.handleClockwiseClick}></cx-icon-button></cx-button-group><cx-input data-testid="cx-asset-link-format-rotation" value=${(this.value + this.defaultValue).toString()} placeholder="0" mask="num" .maskBlocks=${{ num: { mask: Number, max: 360, min: -360, signed: !0 } }} ?disabled=${this.loading} style=${R({
900
- flex: "none",
901
- width: "80px"
902
- })} @cx-input=${this.handleRotationChange}></cx-input>${k(this.canApply, () => m`<cx-button data-testid="cx-asset-link-format-rotation-apply" variant="primary" ?disabled=${this.value === 0} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button>`)}</cx-space></cx-details>`;
903
- }
904
- };
905
- C.styles = [E, Mt];
906
- C.dependencies = {
907
- "cx-button": B,
908
- "cx-button-group": pt,
909
- "cx-details": I,
910
- "cx-icon": L,
911
- "cx-icon-button": K,
912
- "cx-space": _,
913
- "cx-typography": F
914
- };
915
- q([
916
- V(".details")
917
- ], C.prototype, "base", 2);
918
- q([
919
- n({ reflect: !0, type: Boolean })
920
- ], C.prototype, "open", 2);
921
- q([
922
- n({ reflect: !0, type: Number })
923
- ], C.prototype, "value", 2);
924
- q([
925
- n({ attribute: "default-value", reflect: !0, type: Number })
926
- ], C.prototype, "defaultValue", 2);
927
- q([
928
- n({ reflect: !0, type: Boolean })
929
- ], C.prototype, "loading", 2);
930
- q([
931
- n({ attribute: "can-apply", reflect: !0, type: Boolean })
932
- ], C.prototype, "canApply", 2);
933
- q([
934
- w("open", { waitUntilFirstUpdate: !0 })
935
- ], C.prototype, "handleOpenChange", 1);
936
- C = q([
937
- N("cx-asset-link-format-rotation")
938
- ], C);
939
- const _t = O`cx-details::part(base){border-bottom-width:0}`;
940
- var Ft = Object.defineProperty, Wt = Object.getOwnPropertyDescriptor, Z = (t, e, i, s) => {
941
- for (var o = s > 1 ? void 0 : s ? Wt(e, i) : e, r = t.length - 1, h; r >= 0; r--)
942
- (h = t[r]) && (o = (s ? h(e, i, o) : h(o)) || o);
943
- return s && o && Ft(e, i, o), o;
944
- };
945
- let H = class extends W {
946
- constructor() {
947
- super(...arguments), this.localize = new U(this), this.open = !1, this.value = !1;
948
- }
949
- handleApply(t) {
950
- this.emit("cx-asset-link-format-metadata-change", {
951
- detail: t.target.checked
952
- });
953
- }
954
- /**
955
- * Handles showing the details section.
956
- * This method prevents the event from propagating if the target is not the base element, such as tooltips, select dropdowns, or other interactive elements inside the details.
957
- * This ensures that the details section is only shown when the user interacts with the base element.
958
- */
959
- onShowDetails(t) {
960
- t.target !== this.base && t.stopPropagation();
961
- }
962
- /**
963
- * Handles hiding the details section.
964
- * This method prevents the event from propagating if the target is not the base element, such as tooltips, select dropdowns, or other interactive elements inside the details.
965
- * This ensures that the details section is only hidden when the user interacts with the base element.
966
- */
967
- onHideDetails(t) {
968
- t.target !== this.base && t.stopPropagation();
969
- }
970
- render() {
971
- return m`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div class="details__summary__icon"><div part="icon"><cx-icon name="short_text"></cx-icon></div></div><cx-typography variant="body2">${this.localize.term("metadata")}</cx-typography></cx-space><cx-space spacing="small"><cx-tooltip data-testid="cx-asset-link-format-metadata-tooltip" content=${this.localize.term("metadataHelpText")} hoist><cx-checkbox data-testid="cx-asset-link-format-metadata" class="details__checkbox" ?checked=${this.value} @cx-change=${this.handleApply}>${this.localize.term("preserveMetadata")}</cx-checkbox></cx-tooltip></cx-space></cx-details>`;
972
- }
973
- };
974
- H.styles = [E, _t];
975
- H.dependencies = {
976
- "cx-button": B,
977
- "cx-checkbox": dt,
978
- "cx-details": I,
979
- "cx-icon": L,
980
- "cx-space": _,
981
- "cx-tooltip": st,
982
- "cx-typography": F
983
- };
984
- Z([
985
- V(".details")
986
- ], H.prototype, "base", 2);
987
- Z([
988
- n({ reflect: !0, type: Boolean })
989
- ], H.prototype, "open", 2);
990
- Z([
991
- n({ reflect: !0, type: Boolean })
992
- ], H.prototype, "value", 2);
993
- H = Z([
994
- N("cx-asset-link-format-metadata")
995
- ], H);
996
- var Et = Object.defineProperty, Nt = Object.getOwnPropertyDescriptor, p = (t, e, i, s) => {
997
- for (var o = s > 1 ? void 0 : s ? Nt(e, i) : e, r = t.length - 1, h; r >= 0; r--)
998
- (h = t[r]) && (o = (s ? h(e, i, o) : h(o)) || o);
999
- return s && o && Et(e, i, o), o;
1000
- };
1001
- let c = class extends W {
1002
- constructor() {
1003
- super(), this.localize = new U(this), this.baseUrl = void 0, this.token = void 0, this.asset = void 0, this.cropModes = [
1004
- {
1005
- label: "Free",
1006
- value: "free"
1007
- },
1008
- {
1009
- label: "Widescreen (16:9)",
1010
- value: "16:9"
1011
- },
1012
- {
1013
- label: "Phone (9:16)",
1014
- value: "9:16"
1015
- },
1016
- {
1017
- label: "Presentation (4:3)",
1018
- value: "4:3"
1019
- },
1020
- {
1021
- label: "Square (1:1)",
1022
- value: "1:1"
1023
- },
1024
- {
1025
- label: "Landscape (3:2)",
1026
- value: "3:2"
1027
- },
1028
- {
1029
- label: "Portrait (2:3)",
1030
- value: "2:3"
1031
- },
1032
- {
1033
- auto: !0,
1034
- disabledSize: !0,
1035
- label: "Azure AI",
1036
- value: "AzureAI"
1037
- }
1038
- ], this.focusModes = [
1039
- {
1040
- label: "Manual focus",
1041
- value: "manual"
1042
- },
1043
- {
1044
- label: "Center focus",
1045
- value: "center"
1046
- },
1047
- {
1048
- auto: !0,
1049
- label: "Optical focus",
1050
- value: "Optical"
1051
- },
1052
- {
1053
- auto: !0,
1054
- label: "Google AI",
1055
- value: "GoogleAI"
1056
- },
1057
- {
1058
- auto: !0,
1059
- label: "Smart Swatch",
1060
- value: "SmartSwatch"
1061
- }
1062
- ], this.extensions = [], this.proxies = void 0, this.forCropper = void 0, this.useSession = "", this.transformations = [], this.selectedProxy = "", this.defaultProxy = "", this.useCustomExtension = !1, this.noMetadata = !1, this.noFormat = !1, this.noCrop = !1, this.noResize = !1, this.noRotate = !1, this.lastImageSize = {
1063
- height: 0,
1064
- width: 0
1065
- }, this.hideHeader = !1, this.canReset = !1, this.queryElement = null, this.activeSetting = "cx-asset-link-format-proxy", this.selectedFormat = void 0, this.resizeSize = {
1066
- height: 0,
1067
- keepAspectRatio: !0,
1068
- ratioHeight: 1,
1069
- ratioWidth: 1,
1070
- unit: a.Pixel,
1071
- width: 0
1072
- }, this.cropSize = {
1073
- cropMode: "free",
1074
- focusMode: "manual",
1075
- height: 0,
1076
- keepAspectRatio: !0,
1077
- percentageHeight: 0,
1078
- percentageWidth: 0,
1079
- ratioHeight: 1,
1080
- ratioWidth: 1,
1081
- unit: a.Pixel,
1082
- width: 0,
1083
- x: 0,
1084
- y: 0
1085
- }, this.rotation = 0, this.defaultSize = {
1086
- height: 0,
1087
- width: 0
1088
- }, this.cropperElement = null, this.parameters = [], this.loading = !1, this.lastAction = void 0, this.frozenIndex = void 0, this.preResetTransformations = void 0, this.apiGetTransformAssetLink = rt, this.apiGetCropFocusMode = ht, this.onCropComplete = this.onCropComplete.bind(this), this.onCropDragStart = this.onCropDragStart.bind(this);
1089
- }
1090
- /** True when there are transformations beyond the frozen index (i.e. user has added new ones). */
1091
- get hasUnfrozenTransformations() {
1092
- return !(this.transformations.length === 0 || this.frozenIndex !== void 0 && this.frozenIndex >= this.transformations.length - 1);
1093
- }
1094
- /**
1095
- * Checks if the crop apply button should be disabled.
1096
- * This is determined by comparing the current crop size with the last crop size.
1097
- * If the current crop size is equal to the last crop size, the button is disabled.
1098
- * @return {boolean} - Returns true if the crop apply button should be disabled, false otherwise.
1099
- */
1100
- get disabledCropApply() {
1101
- const t = [
1102
- "height",
1103
- "percentageHeight",
1104
- "percentageWidth",
1105
- "unit",
1106
- "width",
1107
- "x",
1108
- "y"
1109
- ];
1110
- for (const e of t)
1111
- if (this.cropSize[e] !== this.lastCropSize[this.cropSize.unit][e])
1112
- return !1;
1113
- return !0;
1114
- }
1115
- /**
1116
- * Returns the list of formats available for the asset link.
1117
- * This is derived from the `proxies` property, filtering out any proxies that have a `cdnName`.
1118
- */
1119
- get formats() {
1120
- return this.proxies?.filter((t) => !t.cdnName) || [];
1121
- }
1122
- get imageSize() {
1123
- return {
1124
- height: this.selectedFormat?.height ?? 0,
1125
- width: this.selectedFormat?.width ?? 0
1126
- };
1127
- }
1128
- /**
1129
- * Returns the last crop size based on the transformations applied to the asset link.
1130
- * This is calculated by iterating through the transformations and applying the last crop, resize, or rotate transformation to the default size of the asset.
1131
- * It returns an object with the last crop size in both pixel and aspect ratio units.
1132
- */
1133
- get lastCropSize() {
1134
- const t = it(
1135
- this.lastImageSize.width,
1136
- this.lastImageSize.height
1137
- );
1138
- return {
1139
- [a.AspectRatio]: {
1140
- height: t.height,
1141
- percentageHeight: 100,
1142
- percentageWidth: 100,
1143
- unit: a.AspectRatio,
1144
- width: t.width,
1145
- x: 0,
1146
- y: 0
1147
- },
1148
- [a.Pixel]: {
1149
- height: this.lastImageSize.height,
1150
- percentageHeight: 100,
1151
- percentageWidth: 100,
1152
- unit: a.Pixel,
1153
- width: this.lastImageSize.width,
1154
- x: 0,
1155
- y: 0
1156
- }
1157
- };
1158
- }
1159
- /**
1160
- * Returns the last resize size based on the transformations applied to the asset link.
1161
- * This is calculated by iterating through the transformations and applying the last crop, resize, or rotate transformation to the default size of the asset.
1162
- * It returns an object with the last resize size in both pixel and aspect ratio units.
1163
- */
1164
- get lastResizeSize() {
1165
- const t = it(
1166
- this.lastImageSize.width,
1167
- this.lastImageSize.height
1168
- );
1169
- return {
1170
- [a.AspectRatio]: {
1171
- height: t.height,
1172
- unit: a.AspectRatio,
1173
- width: t.width
1174
- },
1175
- [a.Pixel]: {
1176
- height: this.lastImageSize.height,
1177
- unit: a.Pixel,
1178
- width: this.lastImageSize.width
1179
- }
1180
- };
1181
- }
1182
- /**
1183
- * Returns the transformation string for the asset link.
1184
- */
1185
- get transformationString() {
1186
- return G({
1187
- asset: this.asset,
1188
- baseUrl: "",
1189
- parameters: this.parameters,
1190
- transformations: this.transformations,
1191
- useSession: this.useSession
1192
- }).replace(/\/t\//g, "");
1193
- }
1194
- runConnectedCallback() {
1195
- this.hasUpdated && (this.handleCropperSelectorChange(), this.cropperElement && (this.cropperElement.addEventListener(
1196
- "cx-cropper-crop-complete",
1197
- this.onCropComplete
1198
- ), this.cropperElement.addEventListener(
1199
- "cx-cropper-crop-drag-start",
1200
- this.onCropDragStart
1201
- )));
1202
- }
1203
- disconnectedCallback() {
1204
- super.disconnectedCallback(), this.cropperElement && (this.cropperElement.removeEventListener(
1205
- "cx-cropper-crop-complete",
1206
- this.onCropComplete
1207
- ), this.cropperElement.removeEventListener(
1208
- "cx-cropper-crop-drag-start",
1209
- this.onCropDragStart
1210
- ));
1211
- }
1212
- updated(t) {
1213
- if ((t.has("forCropper") || t.has("queryElement")) && this.handleCropperSelectorChange(), t.has("asset") && this.handleAssetChange(), t.has("proxies") && this.handleProxiesChange(), t.has("activeSetting") && this.handleActiveSettingChange(), t.has("selectedFormat") && this.handleSelectedFormatChange(), t.has("resizeSize") && this.handleResizeSizeChange(), t.has("cropSize") && this.handleCropSizeChange(), t.has("rotation") && this.handleRotationChange(), t.has("cropperElement") && this.handleCropperElementChange(), t.has("selectedFormat")) {
1214
- if (!this.asset || !this.selectedFormat || this.selectedFormat.extension === t.get("selectedFormat")?.extension)
1215
- return;
1216
- const e = this.proxies?.find(
1217
- (s) => s.id === this.selectedProxy
1218
- );
1219
- this.loading = !0, this.apiGetTransformAssetLink({
1220
- assetId: this.asset.id,
1221
- extension: this.asset.extension,
1222
- format: e?.proxyName ?? "",
1223
- siteUrl: this.baseUrl,
1224
- token: this.token,
1225
- transformations: this.transformationString
1226
- }).then((s) => {
1227
- this.loading = !1, !(!s?.relativePath || !this.selectedFormat) && (this.lastAction === l.Rotate && (this.rotation = 0), this.lastAction = void 0, this.lastImageSize = {
1228
- height: s.height,
1229
- width: s.width
1230
- }, this.selectedFormat = {
1231
- ...this.selectedFormat,
1232
- height: s.height,
1233
- url: this.baseUrl && this.baseUrl.length > 0 ? `${this.baseUrl}/${s.relativePath}` : s.relativePath,
1234
- width: s.width
1235
- /**
1236
- * For local development uses the base URL to construct the full URL.
1237
- * url: `${this.baseUrl}/${response.relativePath}`,
1238
- */
1239
- });
1240
- });
1241
- const i = G({
1242
- asset: this.asset,
1243
- baseUrl: "",
1244
- extension: this.selectedFormat.extension,
1245
- parameters: this.parameters,
1246
- transformations: this.transformations,
1247
- useSession: this.useSession
1248
- });
1249
- this.emit("cx-asset-link-format-change", {
1250
- detail: i
1251
- });
1252
- }
1253
- }
1254
- getCropSize() {
1255
- return this.cropSize;
1256
- }
1257
- setActiveSetting(t) {
1258
- this.activeSetting = t;
1259
- }
1260
- freezeTransformations() {
1261
- this.frozenIndex = this.transformations.length - 1;
1262
- }
1263
- upsertTransformation(t) {
1264
- const e = this.transformations.findIndex((i) => i.key === t.key);
1265
- if (e >= 0) {
1266
- const i = [...this.transformations];
1267
- i[e] = t, this.transformations = i;
1268
- } else
1269
- this.transformations = [...this.transformations, t];
1270
- }
1271
- async handleTransformationsChange() {
1272
- if (await this.updateComplete, !this.asset) {
1273
- this.emit("cx-asset-link-format-change", {
1274
- detail: G({
1275
- asset: this.asset,
1276
- baseUrl: "",
1277
- options: {
1278
- omitZeroXY: !0
1279
- },
1280
- parameters: this.parameters,
1281
- transformations: this.transformations,
1282
- useSession: this.useSession
1283
- }).replace(/\/t\//g, "")
1284
- });
1285
- const r = this.transformations.findLast(
1286
- (f) => f.key === l.Crop && f.value.width && f.value.height
1287
- );
1288
- if (r) {
1289
- const { focusMode: f, height: v, unit: P, width: Q, x: at = 0, y: ot = 0 } = r.value;
1290
- this.cropSize = {
1291
- ...this.cropSize,
1292
- cropMode: "free",
1293
- focusMode: f ?? "manual",
1294
- height: v,
1295
- percentageHeight: 100,
1296
- percentageWidth: 100,
1297
- unit: P ?? a.Pixel,
1298
- width: Q,
1299
- x: at,
1300
- y: ot
1301
- };
1302
- } else
1303
- this.cropSize = {
1304
- ...this.cropSize,
1305
- cropMode: "free",
1306
- focusMode: "manual",
1307
- height: 0,
1308
- percentageHeight: 0,
1309
- percentageWidth: 0,
1310
- unit: a.Pixel,
1311
- width: 0,
1312
- x: 0,
1313
- y: 0
1314
- };
1315
- const h = this.transformations.findLast(
1316
- (f) => f.key === l.Resize && (f.value.width || f.value.height)
1317
- );
1318
- if (h) {
1319
- const { height: f = 0, unit: v, width: P = 0 } = h.value;
1320
- this.resizeSize = {
1321
- ...this.resizeSize,
1322
- height: f,
1323
- unit: v ?? a.Pixel,
1324
- width: P
1325
- };
1326
- } else
1327
- this.resizeSize = {
1328
- ...this.resizeSize,
1329
- height: 0,
1330
- unit: a.Pixel,
1331
- width: 0
1332
- };
1333
- const d = this.transformations.findLast(
1334
- (f) => f.key === l.Rotate
1335
- );
1336
- this.rotation = d?.value.rotation ?? 0;
1337
- const g = this.transformations.findLast((f) => f.key === l.Quality)?.value.quality ?? 100, b = this.transformations.some(
1338
- (f) => f.key === l.Metadata
1339
- );
1340
- this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata: b, quality: g } : this.selectedFormat = {
1341
- extension: "",
1342
- height: 0,
1343
- keepMetadata: b,
1344
- originalUrl: "",
1345
- quality: g,
1346
- rotation: 0,
1347
- url: "",
1348
- width: 0,
1349
- x: 0,
1350
- y: 0
1351
- };
1352
- return;
1353
- }
1354
- if (!this.selectedFormat)
1355
- return;
1356
- const t = this.proxies?.find(
1357
- (r) => r.id === this.selectedProxy
1358
- );
1359
- this.loading = !0;
1360
- const e = await this.apiGetTransformAssetLink({
1361
- assetId: this.asset.id,
1362
- extension: this.selectedFormat.extension,
1363
- format: t?.proxyName ?? "",
1364
- siteUrl: this.baseUrl,
1365
- token: this.token,
1366
- transformations: this.transformationString
1367
- });
1368
- if (this.loading = !1, !e?.relativePath || !this.selectedFormat)
1369
- return;
1370
- this.lastImageSize = {
1371
- height: e.height,
1372
- width: e.width
1373
- }, this.resizeSize = {
1374
- height: e.height,
1375
- keepAspectRatio: !0,
1376
- ratioHeight: 1,
1377
- ratioWidth: 1,
1378
- unit: a.Pixel,
1379
- width: e.width
1380
- }, this.cropSize = {
1381
- cropMode: "free",
1382
- focusMode: "manual",
1383
- height: e.height,
1384
- keepAspectRatio: this.cropSize.keepAspectRatio,
1385
- percentageHeight: 100,
1386
- percentageWidth: 100,
1387
- ratioHeight: 1,
1388
- ratioWidth: 1,
1389
- unit: a.Pixel,
1390
- width: e.width,
1391
- x: 0,
1392
- y: 0
1393
- }, this.lastAction === l.Rotate && (this.rotation = 0), this.lastAction = void 0;
1394
- const i = this.transformations.some(
1395
- (r) => r.key === l.Metadata
1396
- ), s = this.transformations.findLast(
1397
- (r) => r.key === l.Quality
1398
- );
1399
- this.selectedFormat = {
1400
- ...this.selectedFormat,
1401
- height: e.height,
1402
- keepMetadata: i,
1403
- quality: s?.value?.quality ?? this.selectedFormat.quality,
1404
- url: this.baseUrl && this.baseUrl.length > 0 ? `${this.baseUrl}/${e.relativePath}` : e.relativePath,
1405
- width: e.width
1406
- /**
1407
- * For local development uses the base URL to construct the full URL.
1408
- * url: `${this.baseUrl}/${response.relativePath}`,
1409
- */
1410
- };
1411
- const o = G({
1412
- asset: this.asset,
1413
- baseUrl: "",
1414
- extension: this.selectedFormat.extension,
1415
- parameters: this.parameters,
1416
- transformations: this.transformations,
1417
- useSession: this.useSession
1418
- });
1419
- this.emit("cx-asset-link-format-change", {
1420
- detail: o
1421
- });
1422
- }
1423
- handleCropperElementChange() {
1424
- this.cropperElement && (this.cropperElement.resizer = this.resizeSize, this.cropperElement.cropper = this.cropSize, this.cropperElement.rotation = this.rotation, this.cropperElement.disabled = this.activeSetting !== "cx-asset-link-format-crop", this.cropperElement.addEventListener(
1425
- "cx-cropper-crop-complete",
1426
- this.onCropComplete
1427
- ), this.cropperElement.addEventListener(
1428
- "cx-cropper-crop-drag-start",
1429
- this.onCropDragStart
1430
- ), this.cropperElement.loadable = !0);
1431
- }
1432
- handleCropperSelectorChange() {
1433
- this.forCropper && (this.queryElement ? this.cropperElement = this.queryElement.querySelector(`#${this.forCropper}`) : this.cropperElement = document.getElementById(this.forCropper));
1434
- }
1435
- handleAssetChange() {
1436
- if (!this.asset)
1437
- return;
1438
- this.freezeTransformations(), this.asset.width && this.asset.height && (this.defaultSize = {
1439
- height: Number.parseInt(this.asset.height, 10),
1440
- width: Number.parseInt(this.asset.width, 10)
1441
- });
1442
- const t = this.transformations.findLast(
1443
- (e) => e.key === l.Quality
1444
- );
1445
- this.selectedFormat = {
1446
- extension: this.asset.extension,
1447
- height: this.defaultSize.height,
1448
- keepMetadata: !1,
1449
- originalUrl: this.asset.originalUrl,
1450
- quality: t?.value?.quality || 100,
1451
- rotation: 0,
1452
- url: this.asset.imageUrl,
1453
- width: this.defaultSize.width,
1454
- x: 0,
1455
- y: 0
1456
- }, this.resizeSize = {
1457
- ...this.resizeSize,
1458
- height: this.defaultSize.height,
1459
- width: this.defaultSize.width
1460
- }, this.cropSize = {
1461
- cropMode: "free",
1462
- focusMode: "manual",
1463
- height: this.defaultSize.height,
1464
- keepAspectRatio: !0,
1465
- percentageHeight: 100,
1466
- percentageWidth: 100,
1467
- ratioHeight: 1,
1468
- ratioWidth: 1,
1469
- unit: a.Pixel,
1470
- width: this.defaultSize.width,
1471
- x: 0,
1472
- y: 0
1473
- }, this.selectedProxy || (this.selectedProxy = this.proxies && this.proxies.length > 0 ? this.proxies[0].id : "");
1474
- }
1475
- handleProxiesChange() {
1476
- !this.proxies || this.proxies.length === 0 || (!this.selectedProxy || !this.proxies.some((t) => t.id === this.selectedProxy)) && (this.selectedProxy = this.proxies[0].id);
1477
- }
1478
- async handleSelectedProxyChange(t) {
1479
- if (!this.asset || !this.selectedProxy)
1480
- return;
1481
- const e = this.proxies?.find(
1482
- (s) => s.id === this.selectedProxy
1483
- );
1484
- if (!e || !this.selectedFormat)
1485
- return;
1486
- e.proxyName === "TRX" && (e.formatHeight = Number(this.asset.height), e.formatWidth = Number(this.asset.width));
1487
- const i = this.proxies?.find((s) => s.id === t);
1488
- i && (this.asset && i.proxyName === "TRX" && (i.formatHeight = Number(this.asset.height), i.formatWidth = Number(this.asset.width)), this.transformations = this.transformations.map((s) => {
1489
- if (s.key === l.Crop) {
1490
- const o = s.value, r = o.width / i.formatWidth * e.formatWidth, h = o.height / i.formatHeight * e.formatHeight, d = o.x / i.formatWidth * e.formatWidth, g = o.y / i.formatHeight * e.formatHeight;
1491
- return {
1492
- ...s,
1493
- value: {
1494
- ...s.value,
1495
- height: h,
1496
- width: r,
1497
- x: d,
1498
- y: g
1499
- }
1500
- };
1501
- }
1502
- if (s.key === l.Resize) {
1503
- const o = s.value, r = o.width / i.formatWidth * e.formatWidth, h = o.height / i.formatHeight * e.formatHeight;
1504
- return {
1505
- ...s,
1506
- value: {
1507
- height: h,
1508
- width: r
1509
- }
1510
- };
1511
- }
1512
- return s;
1513
- })), this.defaultSize = {
1514
- height: e.formatHeight || this.defaultSize.height,
1515
- width: e.formatWidth || this.defaultSize.width
1516
- }, this.selectedFormat = {
1517
- ...this.selectedFormat,
1518
- height: this.defaultSize.height,
1519
- width: this.defaultSize.width
1520
- }, await this.updateComplete, this.cropSize = {
1521
- cropMode: "free",
1522
- focusMode: "manual",
1523
- height: this.lastCropSize[a.Pixel].height,
1524
- keepAspectRatio: !0,
1525
- percentageHeight: 100,
1526
- percentageWidth: 100,
1527
- ratioHeight: 1,
1528
- ratioWidth: 1,
1529
- unit: a.Pixel,
1530
- width: this.lastCropSize[a.Pixel].width,
1531
- x: 0,
1532
- y: 0
1533
- }, this.resizeSize = {
1534
- height: this.lastResizeSize[a.Pixel].height,
1535
- keepAspectRatio: !0,
1536
- ratioHeight: 1,
1537
- ratioWidth: 1,
1538
- unit: a.Pixel,
1539
- width: this.lastResizeSize[a.Pixel].width
1540
- };
1541
- }
1542
- handleLoadingChange() {
1543
- this.cropperElement && (this.cropperElement.loading = this.loading);
1544
- }
1545
- handleSelectedFormatChange() {
1546
- !this.cropperElement || !this.selectedFormat?.url || (this.cropperElement.image = this.selectedFormat);
1547
- }
1548
- handleResizeSizeChange() {
1549
- this.cropperElement && (this.cropperElement.resizer = this.resizeSize);
1550
- }
1551
- handleCropSizeChange() {
1552
- this.cropperElement && (this.cropperElement.cropper = this.cropSize);
1553
- }
1554
- handleRotationChange() {
1555
- this.cropperElement && (this.cropperElement.rotation = this.rotation);
1556
- }
1557
- handleActiveSettingChange() {
1558
- this.cropperElement && (this.resizeSize = {
1559
- height: this.lastResizeSize[a.Pixel].height,
1560
- keepAspectRatio: !0,
1561
- ratioHeight: 1,
1562
- ratioWidth: 1,
1563
- unit: a.Pixel,
1564
- width: this.lastResizeSize[a.Pixel].width
1565
- }, this.cropperElement.disabled = this.activeSetting !== "cx-asset-link-format-crop");
1566
- }
1567
- async handleRequestAutoCropSuggestion({
1568
- cropMode: t,
1569
- focusMode: e,
1570
- height: i,
1571
- keepAspectRatio: s,
1572
- percentageHeight: o,
1573
- percentageWidth: r,
1574
- ratioHeight: h,
1575
- ratioWidth: d,
1576
- unit: g,
1577
- useCropMode: b,
1578
- width: f
1579
- }) {
1580
- if (!this.selectedFormat?.url || e === "manual")
1581
- return;
1582
- this.loading = !0, this.lastAction = l.Crop;
1583
- const v = await this.apiGetCropFocusMode({
1584
- autoCropMode: e,
1585
- cropHeight: i,
1586
- cropWidth: f,
1587
- imageUrl: this.selectedFormat.url
1588
- });
1589
- if (v) {
1590
- let P = o, Q = r;
1591
- i || (P = v.height * 100 / this.selectedFormat.height), f || (Q = v.width * 100 / this.selectedFormat.width), this.cropSize = {
1592
- ...this.cropSize,
1593
- height: v.height,
1594
- percentageHeight: P ?? this.cropSize.percentageHeight,
1595
- percentageWidth: Q ?? this.cropSize.percentageWidth,
1596
- width: v.width,
1597
- x: v.x * 100 / this.selectedFormat.width,
1598
- y: v.y * 100 / this.selectedFormat.height,
1599
- ...b ? {
1600
- cropMode: e,
1601
- focusMode: "manual",
1602
- keepAspectRatio: !1
1603
- } : {
1604
- cropMode: t ?? this.cropSize.cropMode,
1605
- focusMode: e
1606
- },
1607
- keepAspectRatio: s ?? this.cropSize.keepAspectRatio,
1608
- ratioHeight: h ?? this.cropSize.ratioHeight,
1609
- ratioWidth: d ?? this.cropSize.ratioWidth,
1610
- unit: g ?? this.cropSize.unit
1611
- };
1612
- }
1613
- this.loading = !1, this.lastAction = void 0;
1614
- }
1615
- async onCropComplete(t) {
1616
- const { croppedArea: e } = t.detail, {
1617
- height: i,
1618
- width: s,
1619
- x: o,
1620
- y: r
1621
- } = e;
1622
- if (s === 0 || i === 0)
1623
- return;
1624
- const h = this.cropSize.percentageWidth !== s, d = this.cropSize.percentageHeight !== i;
1625
- let g = this.cropSize.height, b = this.cropSize.width;
1626
- h && (b = Math.round(s * this.selectedFormat.width / 100)), d && (g = Math.round(
1627
- i * this.selectedFormat.height / 100
1628
- ));
1629
- const f = this.cropSize.focusMode;
1630
- this.focusModes.find(
1631
- (P) => P.value === f
1632
- )?.auto && this.selectedFormat?.url && this.cropperElement ? await this.handleRequestAutoCropSuggestion({
1633
- focusMode: f,
1634
- height: g,
1635
- percentageHeight: i,
1636
- percentageWidth: s,
1637
- width: b
1638
- }) : this.cropSize = {
1639
- ...this.cropSize,
1640
- height: g,
1641
- percentageHeight: i,
1642
- percentageWidth: s,
1643
- width: b,
1644
- x: o,
1645
- y: r
1646
- };
1647
- }
1648
- onCropDragStart() {
1649
- let t = this.cropSize.cropMode;
1650
- const e = this.cropModes.find(
1651
- (i) => i.value === t
1652
- )?.auto;
1653
- (this.cropSize.focusMode !== "manual" || e) && (e && (t = "free"), this.cropSize = {
1654
- ...this.cropSize,
1655
- cropMode: t,
1656
- focusMode: "manual"
1657
- });
1658
- }
1659
- onDetailsShow(t) {
1660
- const e = t.target;
1661
- e.shadowRoot?.querySelector(".details") && (this.activeSetting = e.localName);
1662
- }
1663
- onDetailsHide(t) {
1664
- this.activeSetting === t.target.localName && (this.activeSetting = "");
1665
- }
1666
- onProxyChange(t) {
1667
- const e = t.detail;
1668
- this.lastAction = l.Proxy, this.selectedProxy = e.id;
1669
- }
1670
- async onCropModeChange(t) {
1671
- const { mode: e } = t.detail;
1672
- if (this.cropModes.find((s) => s.value === e)?.auto)
1673
- await this.handleRequestAutoCropSuggestion({
1674
- focusMode: e,
1675
- useCropMode: !0
1676
- });
1677
- else {
1678
- const s = this.focusModes.find(
1679
- (g) => g.value === this.cropSize.focusMode
1680
- )?.auto;
1681
- let o = this.cropSize.keepAspectRatio, r = this.cropSize.focusMode, h = this.cropSize.x, d = this.cropSize.y;
1682
- e === "free" ? (o = !1, r = "manual") : this.cropSize.unit === a.Pixel && !s && (h = 0, d = 0), s ? await this.handleRequestAutoCropSuggestion({
1683
- cropMode: e,
1684
- focusMode: r,
1685
- height: this.cropSize.height,
1686
- keepAspectRatio: o,
1687
- width: this.cropSize.width
1688
- }) : this.cropSize = {
1689
- ...this.cropSize,
1690
- cropMode: e,
1691
- focusMode: r,
1692
- keepAspectRatio: o,
1693
- x: h,
1694
- y: d
1695
- }, this.asset || (e && e !== "free" ? this.upsertTransformation({
1696
- key: l.Crop,
1697
- value: {
1698
- mode: e
1699
- }
1700
- }) : this.transformations = this.transformations.filter(
1701
- (g) => g.key !== l.Crop
1702
- ));
1703
- }
1704
- }
1705
- onCropFocusModeChange(t) {
1706
- const { mode: e } = t.detail, i = this.focusModes.find((s) => s.value === e)?.auto;
1707
- if (i && this.selectedFormat?.url ? this.handleRequestAutoCropSuggestion({
1708
- focusMode: e,
1709
- height: this.cropSize.height,
1710
- width: this.cropSize.width
1711
- }) : this.cropSize = {
1712
- ...this.cropSize,
1713
- focusMode: e
1714
- }, !this.asset) {
1715
- const { height: s, unit: o, width: r, x: h, y: d } = this.cropSize;
1716
- (s || r) && this.upsertTransformation({
1717
- key: l.Crop,
1718
- value: {
1719
- focusMode: e,
1720
- height: s,
1721
- isFocusModeAuto: i ?? !1,
1722
- unit: o,
1723
- width: r,
1724
- x: h,
1725
- y: d
1726
- }
1727
- });
1728
- }
1729
- }
1730
- async onCropChange(t) {
1731
- const e = this.cropSize.unit;
1732
- if (t.detail.unit === a.AspectRatio) {
1733
- const i = t.detail.width / t.detail.height, s = Math.min(
1734
- Math.max(Math.round(this.cropSize.height * i), 0),
1735
- this.resizeSize.width
1736
- ), o = Math.min(
1737
- Math.max(Math.round(s / i), 0),
1738
- this.resizeSize.height
1739
- ), r = o * 100 / this.selectedFormat.height, h = s * 100 / this.selectedFormat.width;
1740
- let d = this.cropSize.x, g = this.cropSize.y;
1741
- d + h > 100 && (d = 100 - h), g + r > 100 && (g = 100 - r);
1742
- let b = this.cropSize.cropMode;
1743
- this.cropModes.find(
1744
- (v) => v.value === b
1745
- )?.auto && (b = "free"), t.detail.silent ? (this.cropSize.height = o, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = r, this.cropSize.percentageWidth = h, this.cropSize.ratioHeight = t.detail.height, this.cropSize.ratioWidth = t.detail.width, this.cropSize.unit = a.AspectRatio, this.cropSize.width = s) : this.cropSize = {
1746
- ...this.cropSize,
1747
- cropMode: b,
1748
- height: o,
1749
- keepAspectRatio: t.detail.keepAspectRatio,
1750
- percentageHeight: r,
1751
- percentageWidth: h,
1752
- ratioHeight: t.detail.height,
1753
- ratioWidth: t.detail.width,
1754
- unit: a.AspectRatio,
1755
- width: s,
1756
- x: d,
1757
- y: g
1758
- };
1759
- } else {
1760
- const i = this.selectedFormat ? t.detail.height * 100 / this.selectedFormat.height : 100, s = this.selectedFormat ? t.detail.width * 100 / this.selectedFormat.width : 100;
1761
- let o = this.cropSize.x, r = this.cropSize.y;
1762
- o + s > 100 && (o = 100 - s), r + i > 100 && (r = 100 - i);
1763
- let h = this.cropSize.cropMode;
1764
- const d = this.cropModes.find(
1765
- (g) => g.value === h
1766
- )?.auto;
1767
- (t.detail.breakAspectRatio || d) && (h = "free"), t.detail.silent ? (this.cropSize.cropMode = h, this.cropSize.height = t.detail.height, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = i, this.cropSize.percentageWidth = s, this.cropSize.unit = a.Pixel, this.cropSize.width = t.detail.width, this.cropSize.x = o, this.cropSize.y = r) : this.cropSize = {
1768
- ...this.cropSize,
1769
- cropMode: h,
1770
- height: t.detail.height,
1771
- keepAspectRatio: t.detail.keepAspectRatio,
1772
- percentageHeight: i,
1773
- percentageWidth: s,
1774
- unit: a.Pixel,
1775
- width: t.detail.width,
1776
- x: o,
1777
- y: r
1778
- };
1779
- }
1780
- if (e !== this.cropSize.unit && (this.cropSize = {
1781
- ...this.cropSize,
1782
- cropMode: "free"
1783
- }, this.onCropChanged()), !this.asset && !t.detail.silent) {
1784
- const { focusMode: i, height: s, unit: o, width: r, x: h, y: d } = this.cropSize, g = this.focusModes.find(
1785
- (b) => b.value === i
1786
- )?.auto ?? !1;
1787
- (s || r) && this.upsertTransformation({
1788
- key: l.Crop,
1789
- value: {
1790
- focusMode: i,
1791
- height: s,
1792
- isFocusModeAuto: g,
1793
- unit: o,
1794
- width: r,
1795
- x: h,
1796
- y: d
1797
- }
1798
- });
1799
- }
1800
- }
1801
- async onCropChanged() {
1802
- this.focusModes.find(
1803
- (e) => e.value === this.cropSize.focusMode
1804
- )?.auto && await this.handleRequestAutoCropSuggestion({
1805
- focusMode: this.cropSize.focusMode,
1806
- height: this.cropSize.height,
1807
- width: this.cropSize.width
1808
- });
1809
- }
1810
- onCropApply(t) {
1811
- const { height: e, mode: i, unit: s, width: o } = t.detail;
1812
- if (this.preResetTransformations = void 0, this.lastAction = l.Crop, !this.cropperElement || !this.selectedFormat)
1813
- return;
1814
- const r = this.cropSize.focusMode, h = this.focusModes.find(
1815
- (d) => d.value === r
1816
- )?.auto ?? !1;
1817
- if (e && o && s) {
1818
- let d = o, g = e;
1819
- if (s === a.AspectRatio && (d = this.cropSize.percentageWidth * this.selectedFormat.width / 100, g = this.cropSize.percentageHeight * this.selectedFormat.height / 100), i)
1820
- this.transformations = [
1821
- ...this.transformations,
1822
- {
1823
- key: l.Crop,
1824
- value: {
1825
- focusMode: r,
1826
- height: g,
1827
- isFocusModeAuto: h,
1828
- mode: i,
1829
- width: d
1830
- }
1831
- }
1832
- ];
1833
- else {
1834
- const b = this.cropSize.x / 100 * this.selectedFormat.width, f = this.cropSize.y / 100 * this.selectedFormat.height;
1835
- this.transformations = [
1836
- ...this.transformations,
1837
- {
1838
- key: l.Crop,
1839
- value: {
1840
- focusMode: r,
1841
- height: g,
1842
- isFocusModeAuto: h,
1843
- unit: s,
1844
- width: d,
1845
- x: b,
1846
- y: f
1847
- }
1848
- }
1849
- ];
1850
- }
1851
- } else i && (this.transformations = [
1852
- ...this.transformations,
1853
- {
1854
- key: l.Crop,
1855
- value: {
1856
- focusMode: r,
1857
- isFocusModeAuto: h,
1858
- mode: i
1859
- }
1860
- }
1861
- ]);
1862
- }
1863
- onResizeChange(t) {
1864
- if (t.detail.unit === a.AspectRatio) {
1865
- const e = t.detail.width / t.detail.height, i = Math.max(
1866
- Math.round(this.lastResizeSize[a.Pixel].height * e),
1867
- 0
1868
- ), s = Math.max(Math.round(i / e), 0);
1869
- this.resizeSize = {
1870
- ...this.resizeSize,
1871
- height: s,
1872
- keepAspectRatio: t.detail.keepAspectRatio,
1873
- ratioHeight: t.detail.height,
1874
- ratioWidth: t.detail.width,
1875
- unit: t.detail.unit,
1876
- width: i
1877
- };
1878
- } else
1879
- this.resizeSize = {
1880
- ...this.resizeSize,
1881
- height: Math.max(t.detail.height, 0),
1882
- keepAspectRatio: t.detail.keepAspectRatio,
1883
- unit: t.detail.unit,
1884
- width: Math.max(t.detail.width, 0)
1885
- };
1886
- if (!this.asset) {
1887
- const { height: e, unit: i, width: s } = this.resizeSize;
1888
- (e || s) && this.upsertTransformation({
1889
- key: l.Resize,
1890
- value: {
1891
- height: e,
1892
- unit: i,
1893
- width: s
1894
- }
1895
- });
1896
- }
1897
- }
1898
- onResizeApply(t) {
1899
- if (!this.selectedFormat)
1900
- return;
1901
- const { height: e, unit: i, width: s } = t.detail;
1902
- this.preResetTransformations = void 0, this.lastAction = l.Resize;
1903
- const o = this.selectedFormat.width || this.defaultSize.width, r = this.selectedFormat.height || this.defaultSize.height;
1904
- let h = s, d = e;
1905
- this.resizeSize.unit !== i ? (h = o, d = r) : i === a.AspectRatio && (h = Math.round(s / e * r), d = r), this.transformations = [
1906
- ...this.transformations,
1907
- {
1908
- key: l.Resize,
1909
- value: {
1910
- height: d,
1911
- unit: i,
1912
- width: h
1913
- }
1914
- }
1915
- ];
1916
- }
1917
- onRotationChange(t) {
1918
- this.rotation = t.detail, this.asset || (this.rotation ? this.upsertTransformation({
1919
- key: l.Rotate,
1920
- value: {
1921
- rotation: this.rotation
1922
- }
1923
- }) : this.transformations = this.transformations.filter(
1924
- (e) => e.key !== l.Rotate
1925
- ));
1926
- }
1927
- onRotationApply(t) {
1928
- if (!this.selectedFormat)
1929
- return;
1930
- const e = t.detail;
1931
- this.preResetTransformations = void 0, this.lastAction = l.Rotate, this.transformations = [
1932
- ...this.transformations,
1933
- {
1934
- key: l.Rotate,
1935
- value: {
1936
- rotation: e
1937
- }
1938
- }
1939
- ];
1940
- }
1941
- onQualityChange(t) {
1942
- const e = t.detail;
1943
- this.selectedFormat && (this.selectedFormat.quality = e), this.preResetTransformations = void 0, this.lastAction = l.Quality;
1944
- const i = {
1945
- key: l.Quality,
1946
- value: {
1947
- quality: e
1948
- }
1949
- };
1950
- this.asset ? this.transformations = [...this.transformations, i] : this.upsertTransformation(i);
1951
- }
1952
- onMetadataChange(t) {
1953
- const e = t.detail;
1954
- if (this.preResetTransformations = void 0, this.selectedFormat && (this.selectedFormat = {
1955
- ...this.selectedFormat,
1956
- keepMetadata: e
1957
- }), !this.asset) {
1958
- e ? this.upsertTransformation({
1959
- key: l.Metadata,
1960
- value: {
1961
- keepMetadata: e
1962
- }
1963
- }) : this.transformations = this.transformations.filter(
1964
- (i) => i.key !== l.Metadata
1965
- );
1966
- return;
1967
- }
1968
- e ? this.transformations = [
1969
- ...this.transformations.filter(
1970
- (i) => i.key !== l.Metadata
1971
- ),
1972
- {
1973
- key: l.Metadata,
1974
- value: {
1975
- keepMetadata: e
1976
- }
1977
- }
1978
- ] : this.transformations = this.transformations.filter(
1979
- (i) => i.key !== l.Metadata
1980
- );
1981
- }
1982
- onExtensionChange(t) {
1983
- const e = t.detail;
1984
- this.selectedFormat && (this.selectedFormat = {
1985
- ...this.selectedFormat,
1986
- extension: e
1987
- });
1988
- }
1989
- syncQuality() {
1990
- const t = this.transformations.findLast(
1991
- (e) => e.key === l.Quality
1992
- )?.value?.quality;
1993
- this.selectedFormat && (this.selectedFormat = {
1994
- ...this.selectedFormat,
1995
- quality: t ?? 100
1996
- });
1997
- }
1998
- handleUndo() {
1999
- !this.hasUnfrozenTransformations && this.preResetTransformations !== void 0 ? (this.transformations = this.preResetTransformations, this.preResetTransformations = void 0) : this.transformations = this.transformations.slice(0, -1), this.syncQuality();
2000
- }
2001
- handleReset() {
2002
- this.preResetTransformations = [...this.transformations];
2003
- const t = !!this.defaultProxy && !!this.proxies?.some((e) => e.id === this.defaultProxy);
2004
- this.selectedProxy = t ? this.defaultProxy : this.selectedProxy || this.proxies?.[0]?.id || "", this.transformations = [], this.frozenIndex = -1, this.syncQuality();
2005
- }
2006
- render() {
2007
- return m`<div class="asset-link-format" @cx-show=${this.onDetailsShow} @cx-hide=${this.onDetailsHide}>${k(
2008
- !this.hideHeader,
2009
- () => m`<cx-space class="asset-link-format__section-header" direction="horizontal" spacing="small" align-items="center" justify-content="space-between"><cx-typography variant="body3">${this.localize.term("transformations")}</cx-typography><cx-space direction="horizontal" spacing="3x-small" align-items="center"><cx-button class="asset-link-format__undo" variant="custom" ?disabled=${!this.hasUnfrozenTransformations && this.preResetTransformations === void 0} @click=${this.handleUndo}>${this.localize.term("undo")}</cx-button>${k(this.canReset, () => m`<cx-button class="asset-link-format__reset" variant="custom" ?disabled=${this.transformations.length === 0} @click=${this.handleReset}>${this.localize.term("reset")}</cx-button>`)}</cx-space></cx-space>`,
2010
- () => nt
2011
- )}
2012
- ${k(
2013
- !this.noFormat,
2014
- () => m`<cx-asset-link-format-proxy class="asset-link-format__details" value=${this.selectedProxy || this.proxies?.[0]?.id || ""} ?open=${this.activeSetting === "cx-asset-link-format-proxy"} .items=${this.formats} ?loading=${this.loading && this.lastAction === l.Proxy} @cx-asset-link-format-proxy-change=${this.onProxyChange}></cx-asset-link-format-proxy>`
2015
- )}
2016
- ${k(
2017
- !this.noCrop,
2018
- () => m`<cx-asset-link-format-crop class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-crop"} ?disabled-apply=${this.disabledCropApply} ?can-apply=${!!this.asset} ?loading=${this.loading && this.lastAction === l.Crop} ?keep-aspect-ratio=${this.cropSize.keepAspectRatio} focus-mode=${this.cropSize.focusMode} crop-mode=${this.cropSize.cropMode} width=${this.cropSize.width} height=${this.cropSize.height} max-width=${this.asset ? this.lastResizeSize[a.Pixel].width : 1 / 0} max-height=${this.asset ? this.lastResizeSize[a.Pixel].height : 1 / 0} percentage-width=${this.cropSize.percentageWidth} percentage-height=${this.cropSize.percentageHeight} ratio-width=${this.cropSize.ratioWidth} ratio-height=${this.cropSize.ratioHeight} unit=${this.cropSize.unit} .lastAppliedSetting=${this.lastCropSize} .cropModes=${this.cropModes} .focusModes=${this.focusModes} @cx-asset-link-format-crop-mode-change=${this.onCropModeChange} @cx-asset-link-format-crop-focus-mode-change=${this.onCropFocusModeChange} @cx-asset-link-format-crop-change=${this.onCropChange} @cx-asset-link-format-crop-changed=${this.onCropChanged} @cx-asset-link-format-crop-apply=${this.onCropApply}></cx-asset-link-format-crop>`
2019
- )}
2020
- ${k(
2021
- !this.noResize,
2022
- () => m`<cx-asset-link-format-resize class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-resize"} ?can-apply=${!!this.asset} ?loading=${this.loading && this.lastAction === l.Resize} ?keep-aspect-ratio=${this.resizeSize.keepAspectRatio} width=${this.resizeSize.width} height=${this.resizeSize.height} max-width=${this.asset ? this.imageSize.width : 1 / 0} max-height=${this.asset ? this.imageSize.height : 1 / 0} ratio-width=${this.resizeSize.ratioWidth} ratio-height=${this.resizeSize.ratioHeight} unit=${this.resizeSize.unit} .lastAppliedSetting=${this.lastResizeSize} @cx-asset-link-format-resize-change=${this.onResizeChange} @cx-asset-link-format-resize-apply=${this.onResizeApply}></cx-asset-link-format-resize>`
2023
- )}
2024
- ${k(
2025
- !this.noRotate,
2026
- () => m`<cx-asset-link-format-rotation class="asset-link-format__details" ?loading=${this.loading && this.lastAction === l.Rotate} ?can-apply=${!!this.asset} ?open=${this.activeSetting === "cx-asset-link-format-rotation"} default-value=${this.selectedFormat?.rotation ?? 0} value=${this.rotation} @cx-asset-link-format-rotation-change=${this.onRotationChange} @cx-asset-link-format-rotation-apply=${this.onRotationApply}></cx-asset-link-format-rotation>`
2027
- )}<cx-asset-link-format-quality class="asset-link-format__details" ?can-apply=${!!this.asset} ?loading=${this.loading && this.lastAction === l.Quality} ?open=${this.activeSetting === "cx-asset-link-format-quality"} value=${this.selectedFormat?.quality ?? 100} @cx-asset-link-format-quality-change=${this.onQualityChange}></cx-asset-link-format-quality>${k(
2028
- !this.noMetadata,
2029
- () => m`<cx-asset-link-format-metadata class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-metadata"} .value=${this.selectedFormat?.keepMetadata ?? !1} @cx-asset-link-format-metadata-change=${this.onMetadataChange}></cx-asset-link-format-metadata>`
2030
- )}
2031
- ${k(
2032
- this.useCustomExtension,
2033
- () => m`<cx-asset-link-format-extension .items=${this.extensions} value=${this.selectedFormat?.extension ?? ""} @cx-asset-link-format-extension-change=${this.onExtensionChange}></cx-asset-link-format-extension>`
2034
- )}</div>`;
2035
- }
2036
- };
2037
- c.styles = [E, ut];
2038
- c.dependencies = {
2039
- "cx-asset-link-format-crop": u,
2040
- "cx-asset-link-format-extension": T,
2041
- "cx-asset-link-format-metadata": H,
2042
- "cx-asset-link-format-proxy": $,
2043
- "cx-asset-link-format-quality": A,
2044
- "cx-asset-link-format-resize": y,
2045
- "cx-asset-link-format-rotation": C,
2046
- "cx-button": B,
2047
- "cx-space": _,
2048
- "cx-typography": F
2049
- };
2050
- p([
2051
- n({ attribute: "base-url", type: String })
2052
- ], c.prototype, "baseUrl", 2);
2053
- p([
2054
- n({ attribute: "token", type: String })
2055
- ], c.prototype, "token", 2);
2056
- p([
2057
- n({ reflect: !1, type: Object })
2058
- ], c.prototype, "asset", 2);
2059
- p([
2060
- n({ attribute: "crop-modes", reflect: !1, type: Array })
2061
- ], c.prototype, "cropModes", 2);
2062
- p([
2063
- n({ attribute: "focus-modes", reflect: !1, type: Object })
2064
- ], c.prototype, "focusModes", 2);
2065
- p([
2066
- n({ reflect: !1, type: Array })
2067
- ], c.prototype, "extensions", 2);
2068
- p([
2069
- n({ reflect: !1, type: Array })
2070
- ], c.prototype, "proxies", 2);
2071
- p([
2072
- n({ attribute: "for-cropper", reflect: !0, type: String })
2073
- ], c.prototype, "forCropper", 2);
2074
- p([
2075
- n({ attribute: "use-session", reflect: !0, type: String })
2076
- ], c.prototype, "useSession", 2);
2077
- p([
2078
- n({ reflect: !1, type: Array })
2079
- ], c.prototype, "transformations", 2);
2080
- p([
2081
- n({ attribute: "selected-proxy", reflect: !0, type: String })
2082
- ], c.prototype, "selectedProxy", 2);
2083
- p([
2084
- n({ attribute: "default-proxy", reflect: !0, type: String })
2085
- ], c.prototype, "defaultProxy", 2);
2086
- p([
2087
- n({ attribute: "use-custom-extension", reflect: !0, type: Boolean })
2088
- ], c.prototype, "useCustomExtension", 2);
2089
- p([
2090
- n({ attribute: "no-metadata", reflect: !0, type: Boolean })
2091
- ], c.prototype, "noMetadata", 2);
2092
- p([
2093
- n({ attribute: "no-format", reflect: !0, type: Boolean })
2094
- ], c.prototype, "noFormat", 2);
2095
- p([
2096
- n({ attribute: "no-crop", reflect: !0, type: Boolean })
2097
- ], c.prototype, "noCrop", 2);
2098
- p([
2099
- n({ attribute: "no-resize", reflect: !0, type: Boolean })
2100
- ], c.prototype, "noResize", 2);
2101
- p([
2102
- n({ attribute: "no-rotate", reflect: !0, type: Boolean })
2103
- ], c.prototype, "noRotate", 2);
2104
- p([
2105
- n({ attribute: "last-image-size", reflect: !1, type: Object })
2106
- ], c.prototype, "lastImageSize", 2);
2107
- p([
2108
- n({ attribute: "hide-header", reflect: !1, type: Boolean })
2109
- ], c.prototype, "hideHeader", 2);
2110
- p([
2111
- n({ attribute: "can-reset", type: Boolean })
2112
- ], c.prototype, "canReset", 2);
2113
- p([
2114
- n({ attribute: !1, reflect: !1, type: Object })
2115
- ], c.prototype, "queryElement", 2);
2116
- p([
2117
- z()
2118
- ], c.prototype, "activeSetting", 2);
2119
- p([
2120
- z()
2121
- ], c.prototype, "selectedFormat", 2);
2122
- p([
2123
- z()
2124
- ], c.prototype, "resizeSize", 2);
2125
- p([
2126
- z()
2127
- ], c.prototype, "cropSize", 2);
2128
- p([
2129
- z()
2130
- ], c.prototype, "rotation", 2);
2131
- p([
2132
- z()
2133
- ], c.prototype, "defaultSize", 2);
2134
- p([
2135
- z()
2136
- ], c.prototype, "cropperElement", 2);
2137
- p([
2138
- z()
2139
- ], c.prototype, "parameters", 2);
2140
- p([
2141
- z()
2142
- ], c.prototype, "loading", 2);
2143
- p([
2144
- z()
2145
- ], c.prototype, "lastAction", 2);
2146
- p([
2147
- z()
2148
- ], c.prototype, "frozenIndex", 2);
2149
- p([
2150
- z()
2151
- ], c.prototype, "preResetTransformations", 2);
2152
- p([
2153
- w("transformations")
2154
- ], c.prototype, "handleTransformationsChange", 1);
2155
- p([
2156
- w("selectedProxy")
2157
- ], c.prototype, "handleSelectedProxyChange", 1);
2158
- p([
2159
- w("loading")
2160
- ], c.prototype, "handleLoadingChange", 1);
2161
- c = p([
2162
- N("cx-asset-link-format")
2163
- ], c);
2
+ import "../chunks/button.3giRMk79.js";
3
+ import "./space.js";
4
+ import "../chunks/typography.DJC_UXgs.js";
5
+ import "../chunks/lib-cortex-element.CVMmyPMC.js";
6
+ import { C as g } from "../chunks/asset-link-format.BBWyY5fn.js";
7
+ import "../chunks/component.styles.CRO4Odto.js";
8
+ import "../chunks/asset-link-format.QzzboHHE.js";
9
+ import "../chunks/custom-element.L4WJXn1j.js";
10
+ import "../chunks/i18n.DJikbkDK.js";
11
+ import "../chunks/watch.CThbualB.js";
12
+ import "../chunks/number.B4PQLJIg.js";
13
+ import "../chunks/transformation.c-RS37zA.js";
14
+ import "../chunks/lit-element.jLBm65_O.js";
15
+ import "../chunks/state.CSDxrqLd.js";
16
+ import "../chunks/when.Dr1es41R.js";
2164
17
  export {
2165
- c as default
18
+ g as default
2166
19
  };