@panneau/medias 4.0.58 → 4.0.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
+ import { c } from 'react/compiler-runtime';
1
2
  import classNames from 'classnames';
2
- import { use, createContext, useState, useCallback, useEffect } from 'react';
3
+ import { use, createContext, useState, useEffect } from 'react';
3
4
  import { FormattedMessage } from 'react-intl';
4
5
  import { useFieldComponent, usePanneauResource } from '@panneau/core/contexts';
5
6
  import { useForm, useQuery } from '@panneau/core/hooks';
@@ -7,7 +8,6 @@ import Button from '@panneau/element-button';
7
8
  import Form from '@panneau/element-form';
8
9
  import FormStatus from '@panneau/element-form-status';
9
10
  import UploadField from '@panneau/field-upload';
10
- import { c } from 'react/compiler-runtime';
11
11
  import ImageDisplay from '@panneau/display-image';
12
12
  import MediaPlayer from '@panneau/element-media-player';
13
13
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -33,20 +33,20 @@ function MediasApiProvider(t0) {
33
33
  } = t0;
34
34
  const providedApi = t1 === undefined ? null : t1;
35
35
  const previousApi = useMediasApi();
36
- const api = providedApi || previousApi;
37
- let t2;
38
- if ($[0] !== api || $[1] !== children) {
39
- t2 = /*#__PURE__*/jsx(MediasApiContext, {
40
- value: api,
36
+ const t2 = providedApi || previousApi;
37
+ let t3;
38
+ if ($[0] !== children || $[1] !== t2) {
39
+ t3 = /*#__PURE__*/jsx(MediasApiContext, {
40
+ value: t2,
41
41
  children: children
42
42
  });
43
- $[0] = api;
44
- $[1] = children;
45
- $[2] = t2;
43
+ $[0] = children;
44
+ $[1] = t2;
45
+ $[2] = t3;
46
46
  } else {
47
- t2 = $[2];
47
+ t3 = $[2];
48
48
  }
49
- return t2;
49
+ return t3;
50
50
  }
51
51
 
52
52
  function useMedias(t0, t1, t2, t3) {
@@ -272,50 +272,16 @@ function useMediaUpdate() {
272
272
  return t1;
273
273
  }
274
274
 
275
- function useMediaDelete() {
276
- const $ = c(5);
277
- const [deleting, setDeleting] = useState(false);
278
- const api = useMediasApi();
279
- let t0;
280
- if ($[0] !== api) {
281
- t0 = (id, data) => {
282
- setDeleting(true);
283
- return api.delete(id, data).then(response => {
284
- setDeleting(false);
285
- return response;
286
- });
287
- };
288
- $[0] = api;
289
- $[1] = t0;
290
- } else {
291
- t0 = $[1];
292
- }
293
- const mediaDelete = t0;
294
- let t1;
295
- if ($[2] !== deleting || $[3] !== mediaDelete) {
296
- t1 = {
297
- mediaDelete,
298
- deleting
299
- };
300
- $[2] = deleting;
301
- $[3] = mediaDelete;
302
- $[4] = t1;
303
- } else {
304
- t1 = $[4];
305
- }
306
- return t1;
307
- }
308
-
309
- function useMediaTrash() {
275
+ function useMediaDestroy() {
310
276
  const $ = c(5);
311
- const [trashing, setTrashing] = useState(false);
277
+ const [destroying, setDestroying] = useState(false);
312
278
  const api = useMediasApi();
313
279
  let t0;
314
280
  if ($[0] !== api) {
315
281
  t0 = (id, data) => {
316
- setTrashing(true);
317
- return api.trash(id, data).then(response => {
318
- setTrashing(false);
282
+ setDestroying(true);
283
+ return api.destroy(id, data).then(response => {
284
+ setDestroying(false);
319
285
  return response;
320
286
  });
321
287
  };
@@ -324,15 +290,15 @@ function useMediaTrash() {
324
290
  } else {
325
291
  t0 = $[1];
326
292
  }
327
- const mediaTrash = t0;
293
+ const mediaDestroy = t0;
328
294
  let t1;
329
- if ($[2] !== mediaTrash || $[3] !== trashing) {
295
+ if ($[2] !== destroying || $[3] !== mediaDestroy) {
330
296
  t1 = {
331
- mediaTrash,
332
- trashing
297
+ mediaDestroy,
298
+ destroying
333
299
  };
334
- $[2] = mediaTrash;
335
- $[3] = trashing;
300
+ $[2] = destroying;
301
+ $[3] = mediaDestroy;
336
302
  $[4] = t1;
337
303
  } else {
338
304
  t1 = $[4];
@@ -600,73 +566,101 @@ var defaultFields = [{
600
566
  }]
601
567
  }];
602
568
 
603
- function MediaForm({
604
- value: initialValue = null,
605
- fields: initialFields = defaultFields,
606
- onChange = null,
607
- onSave = null,
608
- onReplace = null,
609
- onDelete = null,
610
- onClose = null,
611
- withDelete = false,
612
- withTrash = false,
613
- withReplace = false,
614
- className = null,
615
- children = null
616
- }) {
617
- const FieldsComponent = useFieldComponent('fields');
569
+ function MediaForm(t0) {
570
+ const $ = c(92);
571
+ const {
572
+ value: t1,
573
+ fields: t2,
574
+ onChange: t3,
575
+ onSave: t4,
576
+ onReplace: t5,
577
+ onDelete: t6,
578
+ onClose: t7,
579
+ withDelete: t8,
580
+ withTrash: t9,
581
+ withReplace: t10,
582
+ className: t11,
583
+ children: t12
584
+ } = t0;
585
+ const initialValue = t1 === undefined ? null : t1;
586
+ const initialFields = t2 === undefined ? defaultFields : t2;
587
+ const onChange = t3 === undefined ? null : t3;
588
+ const onSave = t4 === undefined ? null : t4;
589
+ const onReplace = t5 === undefined ? null : t5;
590
+ const onDelete = t6 === undefined ? null : t6;
591
+ const onClose = t7 === undefined ? null : t7;
592
+ const withDelete = t8 === undefined ? false : t8;
593
+ const withTrash = t9 === undefined ? false : t9;
594
+ const withReplace = t10 === undefined ? false : t10;
595
+ const className = t11 === undefined ? null : t11;
596
+ const children = t12 === undefined ? null : t12;
597
+ const FieldsComponent = useFieldComponent("fields");
618
598
  const {
619
599
  update,
620
600
  updating
621
601
  } = useMediaUpdate();
622
602
  const {
623
- mediaTrash,
624
- trashing
625
- } = useMediaTrash();
626
- const {
627
- mediaDelete,
628
- deleting
629
- } = useMediaDelete();
603
+ mediaDestroy,
604
+ destroying
605
+ } = useMediaDestroy();
630
606
  const {
631
607
  mediaReplace,
632
608
  replacing
633
609
  } = useMediaReplace();
634
610
  const [changed, setChanged] = useState(false);
635
- const disabled = updating || deleting || trashing || initialValue === null;
611
+ const disabled = updating || destroying || initialValue === null;
612
+ let t13;
613
+ if ($[0] !== initialValue) {
614
+ t13 = initialValue || {};
615
+ $[0] = initialValue;
616
+ $[1] = t13;
617
+ } else {
618
+ t13 = $[1];
619
+ }
636
620
  const {
637
- name = null,
638
- type = null,
639
- deletedAt = null
640
- } = initialValue || {};
641
- const onChangeMedia = useCallback(newValue => {
642
- if (onChange !== null) {
643
- onChange(newValue);
644
- }
645
- setChanged(true);
646
- }, [onChange, setChanged]);
647
- const onMediaSaved = useCallback(newValue_0 => {
648
- if (onSave !== null) {
649
- onSave(newValue_0);
650
- }
651
- setChanged(false);
652
- }, [onChange, setChanged]);
653
- const onDeleteMedia = useCallback(() => {
654
- const {
655
- id = null
656
- } = initialValue || {};
657
- if (withTrash && deletedAt !== null) {
658
- mediaTrash(id, initialValue).then(() => {
659
- if (onDelete !== null) {
660
- onDelete();
661
- }
662
- setChanged(false);
663
- if (onClose !== null) {
664
- onClose();
665
- }
666
- });
667
- } else {
668
- // Destroy
669
- mediaDelete(id, initialValue).then(() => {
621
+ name: t14,
622
+ type: t15,
623
+ deletedAt: t16
624
+ } = t13;
625
+ const name = t14 === undefined ? null : t14;
626
+ const type = t15 === undefined ? null : t15;
627
+ const deletedAt = t16 === undefined ? null : t16;
628
+ let t17;
629
+ if ($[2] !== onChange) {
630
+ t17 = newValue => {
631
+ if (onChange !== null) {
632
+ onChange(newValue);
633
+ }
634
+ setChanged(true);
635
+ };
636
+ $[2] = onChange;
637
+ $[3] = t17;
638
+ } else {
639
+ t17 = $[3];
640
+ }
641
+ const onChangeMedia = t17;
642
+ let t18;
643
+ if ($[4] !== onSave) {
644
+ t18 = newValue_0 => {
645
+ if (onSave !== null) {
646
+ onSave(newValue_0);
647
+ }
648
+ setChanged(false);
649
+ };
650
+ $[4] = onSave;
651
+ $[5] = t18;
652
+ } else {
653
+ t18 = $[5];
654
+ }
655
+ const onMediaSaved = t18;
656
+ let t19;
657
+ if ($[6] !== initialValue || $[7] !== mediaDestroy || $[8] !== onClose || $[9] !== onDelete) {
658
+ t19 = () => {
659
+ const {
660
+ id: t20
661
+ } = initialValue || {};
662
+ const id = t20 === undefined ? null : t20;
663
+ mediaDestroy(id, initialValue).then(() => {
670
664
  if (onDelete !== null) {
671
665
  onDelete();
672
666
  }
@@ -675,15 +669,61 @@ function MediaForm({
675
669
  onClose();
676
670
  }
677
671
  });
678
- }
679
- }, [initialValue, mediaDelete, mediaTrash, deletedAt, setChanged, onDelete, withTrash]);
680
- const onUploadComplete = useCallback(data => {
681
- const {
682
- id: id_0 = null
683
- } = initialValue || {};
684
- mediaReplace(id_0, data).then(onReplace);
685
- }, [initialValue, onReplace]);
686
- const postForm = useCallback((action, data_0) => initialValue !== null ? update(initialValue.id, data_0) : Promise.resolve(null), [initialValue, update]);
672
+ };
673
+ $[6] = initialValue;
674
+ $[7] = mediaDestroy;
675
+ $[8] = onClose;
676
+ $[9] = onDelete;
677
+ $[10] = t19;
678
+ } else {
679
+ t19 = $[10];
680
+ }
681
+ const onDeleteMedia = t19;
682
+ let t20;
683
+ if ($[11] !== initialValue || $[12] !== mediaReplace || $[13] !== onReplace) {
684
+ t20 = data => {
685
+ const {
686
+ id: t21
687
+ } = initialValue || {};
688
+ const id_0 = t21 === undefined ? null : t21;
689
+ mediaReplace(id_0, data).then(onReplace);
690
+ };
691
+ $[11] = initialValue;
692
+ $[12] = mediaReplace;
693
+ $[13] = onReplace;
694
+ $[14] = t20;
695
+ } else {
696
+ t20 = $[14];
697
+ }
698
+ const onUploadComplete = t20;
699
+ let t21;
700
+ if ($[15] !== initialValue || $[16] !== update) {
701
+ t21 = (action, data_0) => initialValue !== null ? update(initialValue.id, data_0) : Promise.resolve(null);
702
+ $[15] = initialValue;
703
+ $[16] = update;
704
+ $[17] = t21;
705
+ } else {
706
+ t21 = $[17];
707
+ }
708
+ const postForm = t21;
709
+ let t22;
710
+ if ($[18] !== initialFields || $[19] !== initialValue || $[20] !== onChangeMedia || $[21] !== onMediaSaved || $[22] !== postForm) {
711
+ t22 = {
712
+ fields: initialFields,
713
+ postForm,
714
+ onComplete: onMediaSaved,
715
+ value: initialValue,
716
+ setValue: onChangeMedia
717
+ };
718
+ $[18] = initialFields;
719
+ $[19] = initialValue;
720
+ $[20] = onChangeMedia;
721
+ $[21] = onMediaSaved;
722
+ $[22] = postForm;
723
+ $[23] = t22;
724
+ } else {
725
+ t22 = $[23];
726
+ }
687
727
  const {
688
728
  value,
689
729
  setValue,
@@ -691,114 +731,295 @@ function MediaForm({
691
731
  onSubmit,
692
732
  status,
693
733
  generalError
694
- } = useForm({
695
- fields: initialFields,
696
- postForm,
697
- onComplete: onMediaSaved,
698
- value: initialValue,
699
- setValue: onChangeMedia,
700
- disabled: updating
701
- });
702
- return /*#__PURE__*/jsxs("div", {
703
- className: classNames(['text-body', {
704
- [className]: className !== null
705
- }]),
706
- children: [/*#__PURE__*/jsxs("nav", {
734
+ } = useForm(t22);
735
+ const t23 = className !== null;
736
+ let t24;
737
+ if ($[24] !== className || $[25] !== t23) {
738
+ t24 = classNames(["text-body", {
739
+ [className]: t23
740
+ }]);
741
+ $[24] = className;
742
+ $[25] = t23;
743
+ $[26] = t24;
744
+ } else {
745
+ t24 = $[26];
746
+ }
747
+ let t25;
748
+ if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
749
+ t25 = {
750
+ maxWidth: "66%"
751
+ };
752
+ $[27] = t25;
753
+ } else {
754
+ t25 = $[27];
755
+ }
756
+ let t26;
757
+ if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
758
+ t26 = /*#__PURE__*/jsx(FormattedMessage, {
759
+ id: "8NyYTH"
760
+ });
761
+ $[28] = t26;
762
+ } else {
763
+ t26 = $[28];
764
+ }
765
+ let t27;
766
+ if ($[29] !== onClose) {
767
+ t27 = /*#__PURE__*/jsx("div", {
768
+ className: "me-3 mb-0",
769
+ children: /*#__PURE__*/jsx(Button, {
770
+ theme: "secondary",
771
+ outline: true,
772
+ onClick: onClose,
773
+ icon: "arrow-left",
774
+ children: t26
775
+ })
776
+ });
777
+ $[29] = onClose;
778
+ $[30] = t27;
779
+ } else {
780
+ t27 = $[30];
781
+ }
782
+ let t28;
783
+ if ($[31] !== name) {
784
+ t28 = /*#__PURE__*/jsx("h4", {
785
+ className: "d-inline text-truncate mb-0",
786
+ children: name
787
+ });
788
+ $[31] = name;
789
+ $[32] = t28;
790
+ } else {
791
+ t28 = $[32];
792
+ }
793
+ let t29;
794
+ if ($[33] !== type) {
795
+ t29 = /*#__PURE__*/jsx("span", {
796
+ className: "mx-2",
797
+ children: type
798
+ });
799
+ $[33] = type;
800
+ $[34] = t29;
801
+ } else {
802
+ t29 = $[34];
803
+ }
804
+ let t30;
805
+ if ($[35] !== t27 || $[36] !== t28 || $[37] !== t29) {
806
+ t30 = /*#__PURE__*/jsxs("div", {
807
+ className: "d-flex align-items-end justify-content-start mb-1",
808
+ style: t25,
809
+ children: [t27, t28, t29]
810
+ });
811
+ $[35] = t27;
812
+ $[36] = t28;
813
+ $[37] = t29;
814
+ $[38] = t30;
815
+ } else {
816
+ t30 = $[38];
817
+ }
818
+ let t31;
819
+ if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
820
+ t31 = classNames("d-flex", "justify-content-between", "align-items-center", "gap-1");
821
+ $[39] = t31;
822
+ } else {
823
+ t31 = $[39];
824
+ }
825
+ let t32;
826
+ if ($[40] !== destroying || $[41] !== onUploadComplete || $[42] !== replacing || $[43] !== type || $[44] !== updating || $[45] !== withReplace) {
827
+ t32 = withReplace ? /*#__PURE__*/jsx(UploadField, {
828
+ className: "w-auto text-nowrap",
829
+ withButton: true,
830
+ withoutMedia: true,
831
+ types: [type],
832
+ outline: false,
833
+ closeAfterFinish: true,
834
+ disabled: destroying || updating || replacing,
835
+ addButtonLabel: /*#__PURE__*/jsx(FormattedMessage, {
836
+ id: "GxOBVL"
837
+ }),
838
+ onChange: onUploadComplete
839
+ }) : null;
840
+ $[40] = destroying;
841
+ $[41] = onUploadComplete;
842
+ $[42] = replacing;
843
+ $[43] = type;
844
+ $[44] = updating;
845
+ $[45] = withReplace;
846
+ $[46] = t32;
847
+ } else {
848
+ t32 = $[46];
849
+ }
850
+ let t33;
851
+ if ($[47] !== deletedAt || $[48] !== destroying || $[49] !== onDeleteMedia || $[50] !== replacing || $[51] !== updating || $[52] !== withDelete || $[53] !== withTrash) {
852
+ t33 = withDelete ? /*#__PURE__*/jsx(Button, {
853
+ className: "me-2 mb-1 mt-1",
854
+ theme: "danger",
855
+ icon: withTrash && deletedAt !== null ? "trash-fill" : "trash",
856
+ iconPosition: "right",
857
+ onClick: onDeleteMedia,
858
+ disabled: destroying || updating || replacing,
859
+ children: withTrash && deletedAt === null ? /*#__PURE__*/jsx(FormattedMessage, {
860
+ id: "PSlT7H"
861
+ }) : /*#__PURE__*/jsx(FormattedMessage, {
862
+ id: "Bhu3B2"
863
+ })
864
+ }) : null;
865
+ $[47] = deletedAt;
866
+ $[48] = destroying;
867
+ $[49] = onDeleteMedia;
868
+ $[50] = replacing;
869
+ $[51] = updating;
870
+ $[52] = withDelete;
871
+ $[53] = withTrash;
872
+ $[54] = t33;
873
+ } else {
874
+ t33 = $[54];
875
+ }
876
+ let t34;
877
+ if ($[55] !== changed || $[56] !== destroying || $[57] !== onSave || $[58] !== onSubmit || $[59] !== updating) {
878
+ t34 = onSave !== null ? /*#__PURE__*/jsx(Button, {
879
+ className: "mb-1 mt-1",
880
+ theme: "primary",
881
+ icon: changed ? "check" : "check",
882
+ iconPosition: "right",
883
+ onClick: onSubmit,
884
+ disabled: !changed || updating || destroying,
885
+ children: /*#__PURE__*/jsx(FormattedMessage, {
886
+ id: "R1HYj0"
887
+ })
888
+ }) : null;
889
+ $[55] = changed;
890
+ $[56] = destroying;
891
+ $[57] = onSave;
892
+ $[58] = onSubmit;
893
+ $[59] = updating;
894
+ $[60] = t34;
895
+ } else {
896
+ t34 = $[60];
897
+ }
898
+ let t35;
899
+ if ($[61] !== t32 || $[62] !== t33 || $[63] !== t34) {
900
+ t35 = /*#__PURE__*/jsxs("div", {
901
+ className: t31,
902
+ children: [t32, t33, t34]
903
+ });
904
+ $[61] = t32;
905
+ $[62] = t33;
906
+ $[63] = t34;
907
+ $[64] = t35;
908
+ } else {
909
+ t35 = $[64];
910
+ }
911
+ let t36;
912
+ if ($[65] !== t30 || $[66] !== t35) {
913
+ t36 = /*#__PURE__*/jsxs("nav", {
707
914
  className: "navbar d-flex w-100 align-items-end justify-content-between border-bottom mb-3",
708
- children: [/*#__PURE__*/jsxs("div", {
709
- className: "d-flex align-items-end justify-content-start mb-1",
710
- style: {
711
- maxWidth: '66%'
712
- },
713
- children: [/*#__PURE__*/jsx("div", {
714
- className: "me-3 mb-0",
715
- children: /*#__PURE__*/jsx(Button, {
716
- theme: "secondary",
717
- outline: true,
718
- onClick: onClose,
719
- icon: "arrow-left",
720
- children: /*#__PURE__*/jsx(FormattedMessage, {
721
- id: "8NyYTH"
722
- })
723
- })
724
- }), /*#__PURE__*/jsx("h4", {
725
- className: "d-inline text-truncate mb-0",
726
- children: name
727
- }), /*#__PURE__*/jsx("span", {
728
- className: "mx-2",
729
- children: type
730
- })]
731
- }), /*#__PURE__*/jsxs("div", {
732
- className: classNames('d-flex', 'justify-content-between', 'align-items-center', 'gap-1'),
733
- children: [withReplace ? /*#__PURE__*/jsx(UploadField, {
734
- className: "w-auto text-nowrap",
735
- withButton: true,
736
- withoutMedia: true,
737
- types: [type],
738
- outline: false,
739
- closeAfterFinish: true,
740
- disabled: deleting || trashing || updating || replacing,
741
- addButtonLabel: /*#__PURE__*/jsx(FormattedMessage, {
742
- id: "GxOBVL"
743
- }),
744
- onChange: onUploadComplete
745
- }) : null, withDelete ? /*#__PURE__*/jsx(Button, {
746
- className: "me-2 mb-1 mt-1",
747
- theme: "danger",
748
- icon: withTrash && deletedAt !== null ? 'trash-fill' : 'trash',
749
- iconPosition: "right",
750
- onClick: onDeleteMedia,
751
- disabled: deleting || trashing || updating || replacing,
752
- children: withTrash && deletedAt === null ? /*#__PURE__*/jsx(FormattedMessage, {
753
- id: "PSlT7H"
754
- }) : /*#__PURE__*/jsx(FormattedMessage, {
755
- id: "Bhu3B2"
756
- })
757
- }) : null, onSave !== null ? /*#__PURE__*/jsx(Button, {
758
- className: "mb-1 mt-1",
759
- theme: "primary",
760
- icon: changed ? 'check' : 'check',
761
- iconPosition: "right",
762
- onClick: onSubmit,
763
- disabled: !changed || updating || deleting || trashing,
764
- children: /*#__PURE__*/jsx(FormattedMessage, {
765
- id: "R1HYj0"
766
- })
767
- }) : null]
768
- })]
769
- }), /*#__PURE__*/jsxs("div", {
915
+ children: [t30, t35]
916
+ });
917
+ $[65] = t30;
918
+ $[66] = t35;
919
+ $[67] = t36;
920
+ } else {
921
+ t36 = $[67];
922
+ }
923
+ let t37;
924
+ if ($[68] !== value) {
925
+ t37 = /*#__PURE__*/jsx("div", {
926
+ className: "position-relative w-100",
927
+ children: /*#__PURE__*/jsx("div", {
928
+ className: styles.mediaFrame,
929
+ children: /*#__PURE__*/jsx(MediaFrame, {
930
+ value: value
931
+ })
932
+ })
933
+ });
934
+ $[68] = value;
935
+ $[69] = t37;
936
+ } else {
937
+ t37 = $[69];
938
+ }
939
+ let t38;
940
+ if ($[70] !== children || $[71] !== t37) {
941
+ t38 = /*#__PURE__*/jsxs("div", {
942
+ className: "col-md-6",
943
+ children: [t37, children]
944
+ });
945
+ $[70] = children;
946
+ $[71] = t37;
947
+ $[72] = t38;
948
+ } else {
949
+ t38 = $[72];
950
+ }
951
+ let t39;
952
+ if ($[73] !== FieldsComponent || $[74] !== disabled || $[75] !== fields || $[76] !== setValue || $[77] !== value) {
953
+ t39 = /*#__PURE__*/jsx(Form, {
954
+ withoutActions: true,
955
+ children: /*#__PURE__*/jsx(FieldsComponent, {
956
+ fields: fields,
957
+ value: value,
958
+ onChange: setValue,
959
+ disabled: disabled
960
+ })
961
+ });
962
+ $[73] = FieldsComponent;
963
+ $[74] = disabled;
964
+ $[75] = fields;
965
+ $[76] = setValue;
966
+ $[77] = value;
967
+ $[78] = t39;
968
+ } else {
969
+ t39 = $[78];
970
+ }
971
+ let t40;
972
+ if ($[79] !== generalError || $[80] !== status) {
973
+ t40 = generalError !== null && status !== null ? /*#__PURE__*/jsx("div", {
974
+ className: "mt-5",
975
+ children: /*#__PURE__*/jsx(FormStatus, {
976
+ status: status
977
+ })
978
+ }) : null;
979
+ $[79] = generalError;
980
+ $[80] = status;
981
+ $[81] = t40;
982
+ } else {
983
+ t40 = $[81];
984
+ }
985
+ let t41;
986
+ if ($[82] !== t39 || $[83] !== t40) {
987
+ t41 = /*#__PURE__*/jsxs("div", {
988
+ className: "col-md-6",
989
+ children: [t39, t40]
990
+ });
991
+ $[82] = t39;
992
+ $[83] = t40;
993
+ $[84] = t41;
994
+ } else {
995
+ t41 = $[84];
996
+ }
997
+ let t42;
998
+ if ($[85] !== t38 || $[86] !== t41) {
999
+ t42 = /*#__PURE__*/jsxs("div", {
770
1000
  className: "row",
771
- children: [/*#__PURE__*/jsxs("div", {
772
- className: "col-md-6",
773
- children: [/*#__PURE__*/jsx("div", {
774
- className: "position-relative w-100",
775
- children: /*#__PURE__*/jsx("div", {
776
- className: styles.mediaFrame,
777
- children: /*#__PURE__*/jsx(MediaFrame, {
778
- value: value
779
- })
780
- })
781
- }), children]
782
- }), /*#__PURE__*/jsxs("div", {
783
- className: "col-md-6",
784
- children: [/*#__PURE__*/jsx(Form, {
785
- onChange: onChangeMedia,
786
- withoutActions: true,
787
- children: /*#__PURE__*/jsx(FieldsComponent, {
788
- fields: fields,
789
- value: value,
790
- onChange: setValue,
791
- disabled: disabled
792
- })
793
- }), generalError !== null && status !== null ? /*#__PURE__*/jsx("div", {
794
- className: "mt-5",
795
- children: /*#__PURE__*/jsx(FormStatus, {
796
- status: status
797
- })
798
- }) : null]
799
- })]
800
- })]
801
- });
1001
+ children: [t38, t41]
1002
+ });
1003
+ $[85] = t38;
1004
+ $[86] = t41;
1005
+ $[87] = t42;
1006
+ } else {
1007
+ t42 = $[87];
1008
+ }
1009
+ let t43;
1010
+ if ($[88] !== t24 || $[89] !== t36 || $[90] !== t42) {
1011
+ t43 = /*#__PURE__*/jsxs("div", {
1012
+ className: t24,
1013
+ children: [t36, t42]
1014
+ });
1015
+ $[88] = t24;
1016
+ $[89] = t36;
1017
+ $[90] = t42;
1018
+ $[91] = t43;
1019
+ } else {
1020
+ t43 = $[91];
1021
+ }
1022
+ return t43;
802
1023
  }
803
1024
 
804
1025
  const MediaContext = /*#__PURE__*/createContext(null);
@@ -999,7 +1220,7 @@ const DEFAULT_LAYOUTS = [{
999
1220
  }];
1000
1221
  const DEFAULT_UPPY_CONFIG = {};
1001
1222
  function MediasBrowser(t0) {
1002
- const $ = c(162);
1223
+ const $ = c(158);
1003
1224
  const {
1004
1225
  items: t1,
1005
1226
  extraItems: t2,
@@ -1162,13 +1383,9 @@ function MediasBrowser(t0) {
1162
1383
  }
1163
1384
  const trashed = t41 === undefined ? null : t41;
1164
1385
  const {
1165
- mediaTrash,
1166
- trashing
1167
- } = useMediaTrash();
1168
- const {
1169
- mediaDelete,
1170
- deleting
1171
- } = useMediaDelete();
1386
+ mediaDestroy,
1387
+ destroying
1388
+ } = useMediaDestroy();
1172
1389
  const {
1173
1390
  mediaRestore
1174
1391
  } = useMediaRestore();
@@ -1356,8 +1573,8 @@ function MediasBrowser(t0) {
1356
1573
  }
1357
1574
  const onDeleteMedia = t62;
1358
1575
  let t63;
1359
- if ($[49] !== mediaDelete || $[50] !== mediaTrash || $[51] !== onSelectionChange || $[52] !== reload || $[53] !== selectedItems || $[54] !== showTrashed || $[55] !== withTrash) {
1360
- t63 = id => (!showTrashed && withTrash ? mediaTrash(id) : mediaDelete(id)).then(() => {
1576
+ if ($[49] !== mediaDestroy || $[50] !== onSelectionChange || $[51] !== reload || $[52] !== selectedItems) {
1577
+ t63 = id => mediaDestroy(id).then(() => {
1361
1578
  const newSelectedItems = (selectedItems || []).filter(t64 => {
1362
1579
  const {
1363
1580
  id: t65
@@ -1369,22 +1586,19 @@ function MediasBrowser(t0) {
1369
1586
  onSelectionChange(newSelectedItems.length > 0 ? newSelectedItems : null);
1370
1587
  }
1371
1588
  }).then(() => reload());
1372
- $[49] = mediaDelete;
1373
- $[50] = mediaTrash;
1374
- $[51] = onSelectionChange;
1375
- $[52] = reload;
1376
- $[53] = selectedItems;
1377
- $[54] = showTrashed;
1378
- $[55] = withTrash;
1379
- $[56] = t63;
1589
+ $[49] = mediaDestroy;
1590
+ $[50] = onSelectionChange;
1591
+ $[51] = reload;
1592
+ $[52] = selectedItems;
1593
+ $[53] = t63;
1380
1594
  } else {
1381
- t63 = $[56];
1595
+ t63 = $[53];
1382
1596
  }
1383
1597
  const onTrashMedia = t63;
1384
1598
  const [uploadedMedias, setUploadedMedias] = useState(null);
1385
1599
  const [uploadProcessing, setUploadProcessing] = useState(false);
1386
1600
  let t64;
1387
- if ($[57] !== multipleSelection || $[58] !== onQueryReset || $[59] !== onSelectionChange || $[60] !== reload || $[61] !== uploadedMedias) {
1601
+ if ($[54] !== multipleSelection || $[55] !== onQueryReset || $[56] !== onSelectionChange || $[57] !== reload || $[58] !== uploadedMedias) {
1388
1602
  t64 = newMedias => {
1389
1603
  const uploadedNewMedias = (Array.isArray(newMedias) ? [...newMedias, ...(uploadedMedias || [])] : [newMedias, ...(uploadedMedias || [])]).filter(_temp);
1390
1604
  setUploadedMedias(uploadedNewMedias);
@@ -1396,18 +1610,18 @@ function MediasBrowser(t0) {
1396
1610
  setUploadedMedias(null);
1397
1611
  }
1398
1612
  };
1399
- $[57] = multipleSelection;
1400
- $[58] = onQueryReset;
1401
- $[59] = onSelectionChange;
1402
- $[60] = reload;
1403
- $[61] = uploadedMedias;
1404
- $[62] = t64;
1613
+ $[54] = multipleSelection;
1614
+ $[55] = onQueryReset;
1615
+ $[56] = onSelectionChange;
1616
+ $[57] = reload;
1617
+ $[58] = uploadedMedias;
1618
+ $[59] = t64;
1405
1619
  } else {
1406
- t64 = $[62];
1620
+ t64 = $[59];
1407
1621
  }
1408
1622
  const onUploadedMediaChanged = t64;
1409
1623
  let t65;
1410
- if ($[63] !== onMediaUploaded || $[64] !== onUploadedMediaChanged || $[65] !== showTrashed) {
1624
+ if ($[60] !== onMediaUploaded || $[61] !== onUploadedMediaChanged || $[62] !== showTrashed) {
1411
1625
  t65 = t66 => {
1412
1626
  const medias = t66 === undefined ? null : t66;
1413
1627
  if (showTrashed) {
@@ -1429,31 +1643,31 @@ function MediasBrowser(t0) {
1429
1643
  onUploadedMediaChanged(rawMedias);
1430
1644
  }
1431
1645
  };
1432
- $[63] = onMediaUploaded;
1433
- $[64] = onUploadedMediaChanged;
1434
- $[65] = showTrashed;
1435
- $[66] = t65;
1646
+ $[60] = onMediaUploaded;
1647
+ $[61] = onUploadedMediaChanged;
1648
+ $[62] = showTrashed;
1649
+ $[63] = t65;
1436
1650
  } else {
1437
- t65 = $[66];
1651
+ t65 = $[63];
1438
1652
  }
1439
1653
  const onUploadComplete = t65;
1440
1654
  let t66;
1441
- if ($[67] !== onPageChange) {
1655
+ if ($[64] !== onPageChange) {
1442
1656
  t66 = (e, t67) => {
1443
1657
  const pageNumber = t67 === undefined ? null : t67;
1444
1658
  e.preventDefault();
1445
1659
  e.stopPropagation();
1446
1660
  onPageChange(pageNumber);
1447
1661
  };
1448
- $[67] = onPageChange;
1449
- $[68] = t66;
1662
+ $[64] = onPageChange;
1663
+ $[65] = t66;
1450
1664
  } else {
1451
- t66 = $[68];
1665
+ t66 = $[65];
1452
1666
  }
1453
1667
  const onClickPage = t66;
1454
1668
  const t67 = loading && pages !== null;
1455
1669
  let t68;
1456
- if ($[69] !== baseUrl || $[70] !== lastPage || $[71] !== multipleSelection || $[72] !== onClickPage || $[73] !== onSelectionChange || $[74] !== page || $[75] !== query || $[76] !== selectable || $[77] !== selectedItems || $[78] !== t67 || $[79] !== total) {
1670
+ if ($[66] !== baseUrl || $[67] !== lastPage || $[68] !== multipleSelection || $[69] !== onClickPage || $[70] !== onSelectionChange || $[71] !== page || $[72] !== query || $[73] !== selectable || $[74] !== selectedItems || $[75] !== t67 || $[76] !== total) {
1457
1671
  t68 = /*#__PURE__*/jsx(Pagination, {
1458
1672
  page: page,
1459
1673
  lastPage: lastPage,
@@ -1469,25 +1683,25 @@ function MediasBrowser(t0) {
1469
1683
  withPreviousNext: true,
1470
1684
  alwaysShowButtons: true
1471
1685
  });
1472
- $[69] = baseUrl;
1473
- $[70] = lastPage;
1474
- $[71] = multipleSelection;
1475
- $[72] = onClickPage;
1476
- $[73] = onSelectionChange;
1477
- $[74] = page;
1478
- $[75] = query;
1479
- $[76] = selectable;
1480
- $[77] = selectedItems;
1481
- $[78] = t67;
1482
- $[79] = total;
1483
- $[80] = t68;
1484
- } else {
1485
- t68 = $[80];
1686
+ $[66] = baseUrl;
1687
+ $[67] = lastPage;
1688
+ $[68] = multipleSelection;
1689
+ $[69] = onClickPage;
1690
+ $[70] = onSelectionChange;
1691
+ $[71] = page;
1692
+ $[72] = query;
1693
+ $[73] = selectable;
1694
+ $[74] = selectedItems;
1695
+ $[75] = t67;
1696
+ $[76] = total;
1697
+ $[77] = t68;
1698
+ } else {
1699
+ t68 = $[77];
1486
1700
  }
1487
1701
  const pagination = t68;
1488
1702
  const hidePagination = loaded && !loading && total === 0;
1489
1703
  let t69;
1490
- if ($[81] !== filters || $[82] !== onClickTrash || $[83] !== showTrashed || $[84] !== uploadProcessing || $[85] !== withTrash) {
1704
+ if ($[78] !== filters || $[79] !== onClickTrash || $[80] !== showTrashed || $[81] !== uploadProcessing || $[82] !== withTrash) {
1491
1705
  t69 = withTrash ? (filters || []).concat([{
1492
1706
  name: "trashed",
1493
1707
  component: "button",
@@ -1498,37 +1712,37 @@ function MediasBrowser(t0) {
1498
1712
  disabled: uploadProcessing,
1499
1713
  onClick: onClickTrash
1500
1714
  }]) : filters;
1501
- $[81] = filters;
1502
- $[82] = onClickTrash;
1503
- $[83] = showTrashed;
1504
- $[84] = uploadProcessing;
1505
- $[85] = withTrash;
1506
- $[86] = t69;
1715
+ $[78] = filters;
1716
+ $[79] = onClickTrash;
1717
+ $[80] = showTrashed;
1718
+ $[81] = uploadProcessing;
1719
+ $[82] = withTrash;
1720
+ $[83] = t69;
1507
1721
  } else {
1508
- t69 = $[86];
1722
+ t69 = $[83];
1509
1723
  }
1510
1724
  let finalFilters = t69;
1511
1725
  if (types !== null && finalFilters !== null) {
1512
1726
  let t70;
1513
- if ($[87] !== finalFilters) {
1727
+ if ($[84] !== finalFilters) {
1514
1728
  t70 = finalFilters || [];
1515
- $[87] = finalFilters;
1516
- $[88] = t70;
1729
+ $[84] = finalFilters;
1730
+ $[85] = t70;
1517
1731
  } else {
1518
- t70 = $[88];
1732
+ t70 = $[85];
1519
1733
  }
1520
1734
  let t71;
1521
- if ($[89] !== t70) {
1735
+ if ($[86] !== t70) {
1522
1736
  t71 = t70.map(_temp3);
1523
- $[89] = t70;
1524
- $[90] = t71;
1737
+ $[86] = t70;
1738
+ $[87] = t71;
1525
1739
  } else {
1526
- t71 = $[90];
1740
+ t71 = $[87];
1527
1741
  }
1528
1742
  finalFilters = t71;
1529
1743
  }
1530
1744
  let t70;
1531
- if ($[91] !== canDelete || $[92] !== canEdit || $[93] !== columns || $[94] !== mediaRestore || $[95] !== reload || $[96] !== showTrashed || $[97] !== withTrash) {
1745
+ if ($[88] !== canDelete || $[89] !== canEdit || $[90] !== columns || $[91] !== mediaRestore || $[92] !== reload || $[93] !== showTrashed || $[94] !== withTrash) {
1532
1746
  const partialColumns = withTrash && showTrashed ? (columns || []).map(column => {
1533
1747
  const {
1534
1748
  id: t71
@@ -1567,7 +1781,7 @@ function MediasBrowser(t0) {
1567
1781
  return column;
1568
1782
  }) : columns;
1569
1783
  let t73;
1570
- if ($[99] !== canDelete || $[100] !== canEdit) {
1784
+ if ($[96] !== canDelete || $[97] !== canEdit) {
1571
1785
  t73 = column_0 => {
1572
1786
  const {
1573
1787
  id: t74
@@ -1589,38 +1803,38 @@ function MediasBrowser(t0) {
1589
1803
  }
1590
1804
  return column_0;
1591
1805
  };
1592
- $[99] = canDelete;
1593
- $[100] = canEdit;
1594
- $[101] = t73;
1806
+ $[96] = canDelete;
1807
+ $[97] = canEdit;
1808
+ $[98] = t73;
1595
1809
  } else {
1596
- t73 = $[101];
1810
+ t73 = $[98];
1597
1811
  }
1598
1812
  t70 = (partialColumns || []).map(t73).filter(_temp5);
1599
- $[91] = canDelete;
1600
- $[92] = canEdit;
1601
- $[93] = columns;
1602
- $[94] = mediaRestore;
1603
- $[95] = reload;
1604
- $[96] = showTrashed;
1605
- $[97] = withTrash;
1606
- $[98] = t70;
1813
+ $[88] = canDelete;
1814
+ $[89] = canEdit;
1815
+ $[90] = columns;
1816
+ $[91] = mediaRestore;
1817
+ $[92] = reload;
1818
+ $[93] = showTrashed;
1819
+ $[94] = withTrash;
1820
+ $[95] = t70;
1607
1821
  } else {
1608
- t70 = $[98];
1822
+ t70 = $[95];
1609
1823
  }
1610
1824
  const finalColumns = t70;
1611
1825
  const showOnTopQuery = types === null ? query : queryWithoutTypes;
1612
1826
  let t71;
1613
- if ($[102] !== showOnTopQuery || $[103] !== trashed) {
1827
+ if ($[99] !== showOnTopQuery || $[100] !== trashed) {
1614
1828
  t71 = showOnTopQuery !== null && !trashed ? Object.keys(showOnTopQuery).length > 0 : false;
1615
- $[102] = showOnTopQuery;
1616
- $[103] = trashed;
1617
- $[104] = t71;
1829
+ $[99] = showOnTopQuery;
1830
+ $[100] = trashed;
1831
+ $[101] = t71;
1618
1832
  } else {
1619
- t71 = $[104];
1833
+ t71 = $[101];
1620
1834
  }
1621
1835
  const hasQueryItem = t71;
1622
1836
  let t72;
1623
- if ($[105] !== allItems || $[106] !== extraItems || $[107] !== hasQueryItem || $[108] !== items || $[109] !== page || $[110] !== showTrashed || $[111] !== uploadProcessing || $[112] !== uploadedMedias || $[113] !== withStickySelection) {
1837
+ if ($[102] !== allItems || $[103] !== extraItems || $[104] !== hasQueryItem || $[105] !== items || $[106] !== page || $[107] !== showTrashed || $[108] !== uploadProcessing || $[109] !== uploadedMedias || $[110] !== withStickySelection) {
1624
1838
  t72 = withStickySelection && (extraItems !== null || uploadedMedias !== null || uploadProcessing === true) ? uniqBy([...(uploadProcessing ? [{
1625
1839
  id: "-",
1626
1840
  loading: true,
@@ -1639,22 +1853,22 @@ function MediasBrowser(t0) {
1639
1853
  return otherId === itemId_0;
1640
1854
  }) || item_1 || null;
1641
1855
  }).filter(_temp6) || [] : []), ...(items || [])], _temp7) : items;
1642
- $[105] = allItems;
1643
- $[106] = extraItems;
1644
- $[107] = hasQueryItem;
1645
- $[108] = items;
1646
- $[109] = page;
1647
- $[110] = showTrashed;
1648
- $[111] = uploadProcessing;
1649
- $[112] = uploadedMedias;
1650
- $[113] = withStickySelection;
1651
- $[114] = t72;
1652
- } else {
1653
- t72 = $[114];
1856
+ $[102] = allItems;
1857
+ $[103] = extraItems;
1858
+ $[104] = hasQueryItem;
1859
+ $[105] = items;
1860
+ $[106] = page;
1861
+ $[107] = showTrashed;
1862
+ $[108] = uploadProcessing;
1863
+ $[109] = uploadedMedias;
1864
+ $[110] = withStickySelection;
1865
+ $[111] = t72;
1866
+ } else {
1867
+ t72 = $[111];
1654
1868
  }
1655
1869
  const finalItems = t72;
1656
1870
  let t73;
1657
- if ($[115] !== canUpload || $[116] !== currentMedia || $[117] !== deleting || $[118] !== fields || $[119] !== filters || $[120] !== filtersClassName || $[121] !== finalColumns || $[122] !== finalFilters || $[123] !== finalItems || $[124] !== formChildren || $[125] !== hasLayouts || $[126] !== hidePagination || $[127] !== layout || $[128] !== layouts || $[129] !== loaded || $[130] !== loading || $[131] !== multipleSelection || $[132] !== onClickLayout || $[133] !== onCloseMedia || $[134] !== onDeleteMedia || $[135] !== onOpenMedia || $[136] !== onQueryChange || $[137] !== onQueryReset || $[138] !== onReplaceMedia || $[139] !== onSaveMedia || $[140] !== onSelectionChange || $[141] !== onTrashMedia || $[142] !== onUploadComplete || $[143] !== pagination || $[144] !== query || $[145] !== queryWithoutTypes || $[146] !== selectable || $[147] !== selectedItems || $[148] !== setCurrentMedia || $[149] !== showTrashed || $[150] !== theme || $[151] !== trashing || $[152] !== types || $[153] !== uploadProcessing || $[154] !== uppyConfig || $[155] !== withDelete || $[156] !== withReplace || $[157] !== withTrash) {
1871
+ if ($[112] !== canUpload || $[113] !== currentMedia || $[114] !== destroying || $[115] !== fields || $[116] !== filters || $[117] !== filtersClassName || $[118] !== finalColumns || $[119] !== finalFilters || $[120] !== finalItems || $[121] !== formChildren || $[122] !== hasLayouts || $[123] !== hidePagination || $[124] !== layout || $[125] !== layouts || $[126] !== loaded || $[127] !== loading || $[128] !== multipleSelection || $[129] !== onClickLayout || $[130] !== onCloseMedia || $[131] !== onDeleteMedia || $[132] !== onOpenMedia || $[133] !== onQueryChange || $[134] !== onQueryReset || $[135] !== onReplaceMedia || $[136] !== onSaveMedia || $[137] !== onSelectionChange || $[138] !== onTrashMedia || $[139] !== onUploadComplete || $[140] !== pagination || $[141] !== query || $[142] !== queryWithoutTypes || $[143] !== selectable || $[144] !== selectedItems || $[145] !== setCurrentMedia || $[146] !== showTrashed || $[147] !== theme || $[148] !== types || $[149] !== uploadProcessing || $[150] !== uppyConfig || $[151] !== withDelete || $[152] !== withReplace || $[153] !== withTrash) {
1658
1872
  t73 = currentMedia !== null ? /*#__PURE__*/jsx(MediaForm, {
1659
1873
  value: currentMedia,
1660
1874
  fields: fields,
@@ -1743,7 +1957,7 @@ function MediasBrowser(t0) {
1743
1957
  getDeletePropsFromValue: () => ({
1744
1958
  href: null,
1745
1959
  withConfirmation: true,
1746
- disabled: trashing || deleting,
1960
+ disabled: destroying,
1747
1961
  icon: showTrashed ? "trash-fill" : "trash",
1748
1962
  action: ids_0 => onTrashMedia(ids_0[0])
1749
1963
  }),
@@ -1759,64 +1973,63 @@ function MediasBrowser(t0) {
1759
1973
  children: pagination
1760
1974
  }) : null]
1761
1975
  });
1762
- $[115] = canUpload;
1763
- $[116] = currentMedia;
1764
- $[117] = deleting;
1765
- $[118] = fields;
1766
- $[119] = filters;
1767
- $[120] = filtersClassName;
1768
- $[121] = finalColumns;
1769
- $[122] = finalFilters;
1770
- $[123] = finalItems;
1771
- $[124] = formChildren;
1772
- $[125] = hasLayouts;
1773
- $[126] = hidePagination;
1774
- $[127] = layout;
1775
- $[128] = layouts;
1776
- $[129] = loaded;
1777
- $[130] = loading;
1778
- $[131] = multipleSelection;
1779
- $[132] = onClickLayout;
1780
- $[133] = onCloseMedia;
1781
- $[134] = onDeleteMedia;
1782
- $[135] = onOpenMedia;
1783
- $[136] = onQueryChange;
1784
- $[137] = onQueryReset;
1785
- $[138] = onReplaceMedia;
1786
- $[139] = onSaveMedia;
1787
- $[140] = onSelectionChange;
1788
- $[141] = onTrashMedia;
1789
- $[142] = onUploadComplete;
1790
- $[143] = pagination;
1791
- $[144] = query;
1792
- $[145] = queryWithoutTypes;
1793
- $[146] = selectable;
1794
- $[147] = selectedItems;
1795
- $[148] = setCurrentMedia;
1796
- $[149] = showTrashed;
1797
- $[150] = theme;
1798
- $[151] = trashing;
1799
- $[152] = types;
1800
- $[153] = uploadProcessing;
1801
- $[154] = uppyConfig;
1802
- $[155] = withDelete;
1803
- $[156] = withReplace;
1804
- $[157] = withTrash;
1805
- $[158] = t73;
1806
- } else {
1807
- t73 = $[158];
1976
+ $[112] = canUpload;
1977
+ $[113] = currentMedia;
1978
+ $[114] = destroying;
1979
+ $[115] = fields;
1980
+ $[116] = filters;
1981
+ $[117] = filtersClassName;
1982
+ $[118] = finalColumns;
1983
+ $[119] = finalFilters;
1984
+ $[120] = finalItems;
1985
+ $[121] = formChildren;
1986
+ $[122] = hasLayouts;
1987
+ $[123] = hidePagination;
1988
+ $[124] = layout;
1989
+ $[125] = layouts;
1990
+ $[126] = loaded;
1991
+ $[127] = loading;
1992
+ $[128] = multipleSelection;
1993
+ $[129] = onClickLayout;
1994
+ $[130] = onCloseMedia;
1995
+ $[131] = onDeleteMedia;
1996
+ $[132] = onOpenMedia;
1997
+ $[133] = onQueryChange;
1998
+ $[134] = onQueryReset;
1999
+ $[135] = onReplaceMedia;
2000
+ $[136] = onSaveMedia;
2001
+ $[137] = onSelectionChange;
2002
+ $[138] = onTrashMedia;
2003
+ $[139] = onUploadComplete;
2004
+ $[140] = pagination;
2005
+ $[141] = query;
2006
+ $[142] = queryWithoutTypes;
2007
+ $[143] = selectable;
2008
+ $[144] = selectedItems;
2009
+ $[145] = setCurrentMedia;
2010
+ $[146] = showTrashed;
2011
+ $[147] = theme;
2012
+ $[148] = types;
2013
+ $[149] = uploadProcessing;
2014
+ $[150] = uppyConfig;
2015
+ $[151] = withDelete;
2016
+ $[152] = withReplace;
2017
+ $[153] = withTrash;
2018
+ $[154] = t73;
2019
+ } else {
2020
+ t73 = $[154];
1808
2021
  }
1809
2022
  let t74;
1810
- if ($[159] !== className || $[160] !== t73) {
2023
+ if ($[155] !== className || $[156] !== t73) {
1811
2024
  t74 = /*#__PURE__*/jsx("div", {
1812
2025
  className: className,
1813
2026
  children: t73
1814
2027
  });
1815
- $[159] = className;
1816
- $[160] = t73;
1817
- $[161] = t74;
2028
+ $[155] = className;
2029
+ $[156] = t73;
2030
+ $[157] = t74;
1818
2031
  } else {
1819
- t74 = $[161];
2032
+ t74 = $[157];
1820
2033
  }
1821
2034
  return t74;
1822
2035
  }
@@ -2075,29 +2288,29 @@ function MediasResourceBrowser(t0) {
2075
2288
  const args = t9;
2076
2289
  return api.resources.get(resource, ...args);
2077
2290
  },
2078
- getTrashed: (...t10) => {
2291
+ find: (...t10) => {
2079
2292
  const args_0 = t10;
2080
- return api.resources.getTrashed(resource, ...args_0);
2293
+ return api.resources.find(resource, ...args_0);
2081
2294
  },
2082
- find: (...t11) => {
2295
+ create: (...t11) => {
2083
2296
  const args_1 = t11;
2084
- return api.resources.find(resource, ...args_1);
2297
+ return api.resources.store(resource, ...args_1);
2085
2298
  },
2086
- create: (...t12) => {
2299
+ update: (...t12) => {
2087
2300
  const args_2 = t12;
2088
- return api.resources.store(resource, ...args_2);
2301
+ return api.resources.update(resource, ...args_2);
2089
2302
  },
2090
- update: (...t13) => {
2303
+ destroy: (...t13) => {
2091
2304
  const args_3 = t13;
2092
- return api.resources.update(resource, ...args_3);
2305
+ return api.resources.destroy(resource, ...args_3);
2093
2306
  },
2094
- trash: (...t14) => {
2307
+ getTrashed: (query, page, count) => api.resources.get(resource, {
2308
+ ...query,
2309
+ trashed: true
2310
+ }, page, count),
2311
+ restore: (...t14) => {
2095
2312
  const args_4 = t14;
2096
- return api.resources.trash(resource, ...args_4);
2097
- },
2098
- delete: (...t15) => {
2099
- const args_5 = t15;
2100
- return api.resources.destroy(resource, ...args_5);
2313
+ return api.resources.restore(resource, ...args_4);
2101
2314
  }
2102
2315
  };
2103
2316
  $[7] = api;
@@ -2212,29 +2425,25 @@ function MediasResourcePicker(t0) {
2212
2425
  const args = t9;
2213
2426
  return api.resources.get(resource, ...args);
2214
2427
  },
2215
- getTrashed: (...t10) => {
2428
+ getTrashed: (query, page, count) => api.resources.get(resource, {
2429
+ ...query,
2430
+ trashed: true
2431
+ }, page, count),
2432
+ find: (...t10) => {
2216
2433
  const args_0 = t10;
2217
- return api.resources.getTrashed(resource, ...args_0);
2434
+ return api.resources.find(resource, ...args_0);
2218
2435
  },
2219
- find: (...t11) => {
2436
+ create: (...t11) => {
2220
2437
  const args_1 = t11;
2221
- return api.resources.find(resource, ...args_1);
2438
+ return api.resources.store(resource, ...args_1);
2222
2439
  },
2223
- create: (...t12) => {
2440
+ update: (...t12) => {
2224
2441
  const args_2 = t12;
2225
- return api.resources.store(resource, ...args_2);
2442
+ return api.resources.update(resource, ...args_2);
2226
2443
  },
2227
- update: (...t13) => {
2444
+ destroy: (...t13) => {
2228
2445
  const args_3 = t13;
2229
- return api.resources.update(resource, ...args_3);
2230
- },
2231
- trash: (...t14) => {
2232
- const args_4 = t14;
2233
- return api.resources.trash(resource, ...args_4);
2234
- },
2235
- delete: (...t15) => {
2236
- const args_5 = t15;
2237
- return api.resources.destroy(resource, ...args_5);
2446
+ return api.resources.destroy(resource, ...args_3);
2238
2447
  }
2239
2448
  };
2240
2449
  $[7] = api;
@@ -2295,4 +2504,4 @@ function MediasResourcePicker(t0) {
2295
2504
  return t12;
2296
2505
  }
2297
2506
 
2298
- export { MediaForm, MediaProvider, MediasApiProvider, MediasBrowser, MediasBrowserContainer, MediasPicker, MediasPickerContainer, MediasResourceBrowser, MediasResourcePicker, defaultColumns as columns, defaultFields as fields, defaultFilters as filters, useCurrentMedia, useMedia, useMediaCreate, useMediaDelete, useMediaReplace, useMediaRestore, useMediaTrash, useMediaUpdate, useMedias, useMediasApi };
2507
+ export { MediaForm, MediaProvider, MediasApiProvider, MediasBrowser, MediasBrowserContainer, MediasPicker, MediasPickerContainer, MediasResourceBrowser, MediasResourcePicker, defaultColumns as columns, defaultFields as fields, defaultFilters as filters, useCurrentMedia, useMedia, useMediaCreate, useMediaDestroy, useMediaReplace, useMediaRestore, useMediaUpdate, useMedias, useMediasApi };