sanity-plugin-media 6.1.2 → 6.1.4

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
@@ -2173,20 +2173,21 @@ const ButtonAssetCopy = (t0) => {
2173
2173
  }), $[7] = asset.extension, $[8] = t0), t0;
2174
2174
  }, FormSubmitButton = (props) => {
2175
2175
  let $ = c(14), { disabled, isValid, lastUpdated, onClick } = props, content;
2176
- if (isValid) if (lastUpdated) {
2177
- let t0;
2178
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = /* @__PURE__ */ jsx("br", {}), $[0] = t0) : t0 = $[0];
2179
- let t1;
2180
- $[1] === lastUpdated ? t1 = $[2] : (t1 = format(new Date(lastUpdated), "PPp"), $[1] = lastUpdated, $[2] = t1);
2181
- let t2;
2182
- $[3] === t1 ? t2 = $[4] : (t2 = /* @__PURE__ */ jsxs(Fragment, { children: [
2183
- "Last updated",
2184
- t0,
2185
- " ",
2186
- t1
2187
- ] }), $[3] = t1, $[4] = t2), content = t2;
2188
- } else content = "No unpublished changes";
2189
- else content = "There are validation errors that need to be fixed before this document can be published";
2176
+ if (isValid) {
2177
+ if (lastUpdated) {
2178
+ let t0;
2179
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = /* @__PURE__ */ jsx("br", {}), $[0] = t0) : t0 = $[0];
2180
+ let t1;
2181
+ $[1] === lastUpdated ? t1 = $[2] : (t1 = format(new Date(lastUpdated), "PPp"), $[1] = lastUpdated, $[2] = t1);
2182
+ let t2;
2183
+ $[3] === t1 ? t2 = $[4] : (t2 = /* @__PURE__ */ jsxs(Fragment, { children: [
2184
+ "Last updated",
2185
+ t0,
2186
+ " ",
2187
+ t1
2188
+ ] }), $[3] = t1, $[4] = t2), content = t2;
2189
+ } else content = "No unpublished changes";
2190
+ } else content = "There are validation errors that need to be fixed before this document can be published";
2190
2191
  let t0;
2191
2192
  $[5] === Symbol.for("react.memo_cache_sentinel") ? (t0 = { maxWidth: "185px" }, $[5] = t0) : t0 = $[5];
2192
2193
  let t1;
@@ -2766,7 +2767,7 @@ function renderDefaultDetails(props) {
2766
2767
  return /* @__PURE__ */ jsx(Details, { ...props });
2767
2768
  }
2768
2769
  const DialogAssetEdit = (props) => {
2769
- let $ = c(149), { children, dialog: t0 } = props, { assetId, id, lastCreatedTag, lastRemovedTagIds } = t0, client = useVersionedClient(), scheme = useColorSchemeValue(), documentStore = useDocumentStore(), dispatch = useDispatch(), t1;
2770
+ let $ = c(150), { children, dialog: t0 } = props, { assetId, id, lastCreatedTag, lastRemovedTagIds } = t0, client = useVersionedClient(), scheme = useColorSchemeValue(), documentStore = useDocumentStore(), dispatch = useDispatch(), t1;
2770
2771
  $[0] === assetId ? t1 = $[1] : (t1 = (state) => selectAssetById(state, String(assetId)), $[0] = assetId, $[1] = t1);
2771
2772
  let assetItem = useTypedSelector(t1), tags = useTypedSelector(selectTags), assetUpdatedPrev = useRef(void 0), [assetSnapshot, setAssetSnapshot] = useState(assetItem?.asset), [tabSection, setTabSection] = useState("details"), currentAsset = assetItem ? assetItem?.asset : assetSnapshot, t2;
2772
2773
  $[2] === tags ? t2 = $[3] : (t2 = getTagSelectOptions(tags), $[2] = tags, $[3] = t2);
@@ -2905,7 +2906,7 @@ const DialogAssetEdit = (props) => {
2905
2906
  }).commit();
2906
2907
  }, $[44] = client, $[45] = currentAsset, $[46] = locales, $[47] = t20) : t20 = $[47];
2907
2908
  let handleCleanupLocales = t20, t21;
2908
- $[48] !== assetItem?.asset || $[49] !== dispatch ? (t21 = (formData) => {
2909
+ $[48] !== assetItem?.asset || $[49] !== currentAsset || $[50] !== dispatch ? (t21 = (formData) => {
2909
2910
  if (!assetItem?.asset) return;
2910
2911
  let sanitizedFormData = sanitizeFormData(formData);
2911
2912
  formData.description === "" && (sanitizedFormData.description = ""), dispatch(assetsActions.updateRequest({
@@ -2915,27 +2916,28 @@ const DialogAssetEdit = (props) => {
2915
2916
  ...sanitizedFormData,
2916
2917
  opt: { media: {
2917
2918
  ...sanitizedFormData.opt.media,
2918
- tags: sanitizedFormData.opt.media.tags?.map(_temp7$1) || null
2919
+ tags: sanitizedFormData.opt.media.tags?.map(_temp7$1) || null,
2920
+ ...currentAsset?.opt?.media?.folder && { folder: currentAsset.opt.media.folder }
2919
2921
  } }
2920
2922
  }
2921
2923
  }));
2922
- }, $[48] = assetItem?.asset, $[49] = dispatch, $[50] = t21) : t21 = $[50], assetItem?.asset;
2924
+ }, $[48] = assetItem?.asset, $[49] = currentAsset, $[50] = dispatch, $[51] = t21) : t21 = $[51], assetItem?.asset;
2923
2925
  let onSubmit = t21, t22;
2924
- $[51] !== assetItem?.asset || $[52] !== client ? (t22 = () => {
2926
+ $[52] !== assetItem?.asset || $[53] !== client ? (t22 = () => {
2925
2927
  if (!assetItem?.asset) return;
2926
2928
  let subscriptionAsset = client.listen(groq`*[_id == $id]`, { id: assetItem?.asset._id }).subscribe(handleAssetUpdate);
2927
2929
  return () => {
2928
2930
  subscriptionAsset?.unsubscribe();
2929
2931
  };
2930
- }, $[51] = assetItem?.asset, $[52] = client, $[53] = t22) : t22 = $[53];
2932
+ }, $[52] = assetItem?.asset, $[53] = client, $[54] = t22) : t22 = $[54];
2931
2933
  let t23 = assetItem?.asset, t24;
2932
- $[54] !== client || $[55] !== t23 ? (t24 = [
2934
+ $[55] !== client || $[56] !== t23 ? (t24 = [
2933
2935
  t23,
2934
2936
  client,
2935
2937
  handleAssetUpdate
2936
- ], $[54] = client, $[55] = t23, $[56] = t24) : t24 = $[56], useEffect(t22, t24);
2938
+ ], $[55] = client, $[56] = t23, $[57] = t24) : t24 = $[57], useEffect(t22, t24);
2937
2939
  let t25, t26;
2938
- $[57] !== getValues || $[58] !== lastCreatedTag || $[59] !== setValue ? (t25 = () => {
2940
+ $[58] !== getValues || $[59] !== lastCreatedTag || $[60] !== setValue ? (t25 = () => {
2939
2941
  if (lastCreatedTag) {
2940
2942
  let updatedTags = (getValues("opt.media.tags") || []).concat([lastCreatedTag]);
2941
2943
  setValue("opt.media.tags", updatedTags, { shouldDirty: !0 });
@@ -2944,9 +2946,9 @@ const DialogAssetEdit = (props) => {
2944
2946
  getValues,
2945
2947
  lastCreatedTag,
2946
2948
  setValue
2947
- ], $[57] = getValues, $[58] = lastCreatedTag, $[59] = setValue, $[60] = t25, $[61] = t26) : (t25 = $[60], t26 = $[61]), useEffect(t25, t26);
2949
+ ], $[58] = getValues, $[59] = lastCreatedTag, $[60] = setValue, $[61] = t25, $[62] = t26) : (t25 = $[61], t26 = $[62]), useEffect(t25, t26);
2948
2950
  let t27, t28;
2949
- $[62] !== getValues || $[63] !== lastRemovedTagIds || $[64] !== setValue ? (t27 = () => {
2951
+ $[63] !== getValues || $[64] !== lastRemovedTagIds || $[65] !== setValue ? (t27 = () => {
2950
2952
  if (lastRemovedTagIds) {
2951
2953
  let updatedTags_0 = (getValues("opt.media.tags") || []).filter((tag_0) => !lastRemovedTagIds.includes(tag_0.value));
2952
2954
  setValue("opt.media.tags", updatedTags_0, { shouldDirty: !0 });
@@ -2955,19 +2957,19 @@ const DialogAssetEdit = (props) => {
2955
2957
  getValues,
2956
2958
  lastRemovedTagIds,
2957
2959
  setValue
2958
- ], $[62] = getValues, $[63] = lastRemovedTagIds, $[64] = setValue, $[65] = t27, $[66] = t28) : (t27 = $[65], t28 = $[66]), useEffect(t27, t28);
2960
+ ], $[63] = getValues, $[64] = lastRemovedTagIds, $[65] = setValue, $[66] = t27, $[67] = t28) : (t27 = $[66], t28 = $[67]), useEffect(t27, t28);
2959
2961
  let t29;
2960
- $[67] !== assetItem?.asset || $[68] !== generateDefaultValues || $[69] !== reset ? (t29 = () => {
2962
+ $[68] !== assetItem?.asset || $[69] !== generateDefaultValues || $[70] !== reset ? (t29 = () => {
2961
2963
  assetUpdatedPrev.current !== assetItem?.asset._updatedAt && reset(generateDefaultValues(assetItem?.asset)), assetUpdatedPrev.current = assetItem?.asset._updatedAt;
2962
- }, $[67] = assetItem?.asset, $[68] = generateDefaultValues, $[69] = reset, $[70] = t29) : t29 = $[70];
2964
+ }, $[68] = assetItem?.asset, $[69] = generateDefaultValues, $[70] = reset, $[71] = t29) : t29 = $[71];
2963
2965
  let t30 = assetItem?.asset, t31;
2964
- $[71] !== generateDefaultValues || $[72] !== reset || $[73] !== t30 ? (t31 = [
2966
+ $[72] !== generateDefaultValues || $[73] !== reset || $[74] !== t30 ? (t31 = [
2965
2967
  t30,
2966
2968
  generateDefaultValues,
2967
2969
  reset
2968
- ], $[71] = generateDefaultValues, $[72] = reset, $[73] = t30, $[74] = t31) : t31 = $[74], useEffect(t29, t31);
2970
+ ], $[72] = generateDefaultValues, $[73] = reset, $[74] = t30, $[75] = t31) : t31 = $[75], useEffect(t29, t31);
2969
2971
  let t32;
2970
- $[75] !== handleCleanupLocales || $[76] !== hasOrphanedLocales ? (t32 = hasOrphanedLocales && /* @__PURE__ */ jsx(Card, {
2972
+ $[76] !== handleCleanupLocales || $[77] !== hasOrphanedLocales ? (t32 = hasOrphanedLocales && /* @__PURE__ */ jsx(Card, {
2971
2973
  padding: 3,
2972
2974
  radius: 2,
2973
2975
  shadow: 1,
@@ -2987,42 +2989,42 @@ const DialogAssetEdit = (props) => {
2987
2989
  tone: "caution"
2988
2990
  })]
2989
2991
  })
2990
- }), $[75] = handleCleanupLocales, $[76] = hasOrphanedLocales, $[77] = t32) : t32 = $[77];
2992
+ }), $[76] = handleCleanupLocales, $[77] = hasOrphanedLocales, $[78] = t32) : t32 = $[78];
2991
2993
  let t33;
2992
- $[78] !== formUpdating || $[79] !== handleDelete ? (t33 = /* @__PURE__ */ jsx(Button, {
2994
+ $[79] !== formUpdating || $[80] !== handleDelete ? (t33 = /* @__PURE__ */ jsx(Button, {
2993
2995
  disabled: formUpdating,
2994
2996
  fontSize: 1,
2995
2997
  mode: "bleed",
2996
2998
  onClick: handleDelete,
2997
2999
  text: "Delete",
2998
3000
  tone: "critical"
2999
- }), $[78] = formUpdating, $[79] = handleDelete, $[80] = t33) : t33 = $[80];
3001
+ }), $[79] = formUpdating, $[80] = handleDelete, $[81] = t33) : t33 = $[81];
3000
3002
  let t34 = formUpdating || !isDirty || !isValid || hasOrphanedLocales, t35 = currentAsset?._updatedAt, t36;
3001
- $[81] !== handleSubmit || $[82] !== onSubmit ? (t36 = handleSubmit(onSubmit), $[81] = handleSubmit, $[82] = onSubmit, $[83] = t36) : t36 = $[83];
3003
+ $[82] !== handleSubmit || $[83] !== onSubmit ? (t36 = handleSubmit(onSubmit), $[82] = handleSubmit, $[83] = onSubmit, $[84] = t36) : t36 = $[84];
3002
3004
  let t37;
3003
- $[84] !== isValid || $[85] !== t34 || $[86] !== t35 || $[87] !== t36 ? (t37 = /* @__PURE__ */ jsx(FormSubmitButton, {
3005
+ $[85] !== isValid || $[86] !== t34 || $[87] !== t35 || $[88] !== t36 ? (t37 = /* @__PURE__ */ jsx(FormSubmitButton, {
3004
3006
  disabled: t34,
3005
3007
  isValid,
3006
3008
  lastUpdated: t35,
3007
3009
  onClick: t36
3008
- }), $[84] = isValid, $[85] = t34, $[86] = t35, $[87] = t36, $[88] = t37) : t37 = $[88];
3010
+ }), $[85] = isValid, $[86] = t34, $[87] = t35, $[88] = t36, $[89] = t37) : t37 = $[89];
3009
3011
  let t38;
3010
- $[89] !== t33 || $[90] !== t37 ? (t38 = /* @__PURE__ */ jsxs(Flex, {
3012
+ $[90] !== t33 || $[91] !== t37 ? (t38 = /* @__PURE__ */ jsxs(Flex, {
3011
3013
  justify: "space-between",
3012
3014
  children: [t33, t37]
3013
- }), $[89] = t33, $[90] = t37, $[91] = t38) : t38 = $[91];
3015
+ }), $[90] = t33, $[91] = t37, $[92] = t38) : t38 = $[92];
3014
3016
  let t39;
3015
- $[92] !== t32 || $[93] !== t38 ? (t39 = /* @__PURE__ */ jsx(Box, {
3017
+ $[93] !== t32 || $[94] !== t38 ? (t39 = /* @__PURE__ */ jsx(Box, {
3016
3018
  padding: 3,
3017
3019
  children: /* @__PURE__ */ jsxs(Stack, {
3018
3020
  gap: 3,
3019
3021
  children: [t32, t38]
3020
3022
  })
3021
- }), $[92] = t32, $[93] = t38, $[94] = t39) : t39 = $[94];
3023
+ }), $[93] = t32, $[94] = t38, $[95] = t39) : t39 = $[95];
3022
3024
  let footer = t39;
3023
3025
  if (!currentAsset) return null;
3024
3026
  let t40 = !!currentFolderId && !currentFolderPath, t41;
3025
- $[95] !== allTagOptions || $[96] !== assetTagOptions || $[97] !== control || $[98] !== creditLine || $[99] !== currentAsset || $[100] !== currentFolderPath || $[101] !== errors || $[102] !== formUpdating || $[103] !== handleChangeFolder || $[104] !== handleCreateTag || $[105] !== handleRemoveFolder || $[106] !== locales || $[107] !== register || $[108] !== setValue || $[109] !== t40 ? (t41 = {
3027
+ $[96] !== allTagOptions || $[97] !== assetTagOptions || $[98] !== control || $[99] !== creditLine || $[100] !== currentAsset || $[101] !== currentFolderPath || $[102] !== errors || $[103] !== formUpdating || $[104] !== handleChangeFolder || $[105] !== handleCreateTag || $[106] !== handleRemoveFolder || $[107] !== locales || $[108] !== register || $[109] !== setValue || $[110] !== t40 ? (t41 = {
3026
3028
  control,
3027
3029
  errors,
3028
3030
  formUpdating,
@@ -3038,21 +3040,21 @@ const DialogAssetEdit = (props) => {
3038
3040
  onRemoveFolder: handleRemoveFolder,
3039
3041
  creditLine,
3040
3042
  locales
3041
- }, $[95] = allTagOptions, $[96] = assetTagOptions, $[97] = control, $[98] = creditLine, $[99] = currentAsset, $[100] = currentFolderPath, $[101] = errors, $[102] = formUpdating, $[103] = handleChangeFolder, $[104] = handleCreateTag, $[105] = handleRemoveFolder, $[106] = locales, $[107] = register, $[108] = setValue, $[109] = t40, $[110] = t41) : t41 = $[110];
3043
+ }, $[96] = allTagOptions, $[97] = assetTagOptions, $[98] = control, $[99] = creditLine, $[100] = currentAsset, $[101] = currentFolderPath, $[102] = errors, $[103] = formUpdating, $[104] = handleChangeFolder, $[105] = handleCreateTag, $[106] = handleRemoveFolder, $[107] = locales, $[108] = register, $[109] = setValue, $[110] = t40, $[111] = t41) : t41 = $[111];
3042
3044
  let detailsProps = t41, t42;
3043
- $[111] === Symbol.for("react.memo_cache_sentinel") ? (t42 = [
3045
+ $[112] === Symbol.for("react.memo_cache_sentinel") ? (t42 = [
3044
3046
  "column-reverse",
3045
3047
  "column-reverse",
3046
3048
  "row-reverse"
3047
- ], $[111] = t42) : t42 = $[111];
3049
+ ], $[112] = t42) : t42 = $[112];
3048
3050
  let t43;
3049
- $[112] === Symbol.for("react.memo_cache_sentinel") ? (t43 = [
3051
+ $[113] === Symbol.for("react.memo_cache_sentinel") ? (t43 = [
3050
3052
  5,
3051
3053
  5,
3052
3054
  0
3053
- ], $[112] = t43) : t43 = $[112];
3055
+ ], $[113] = t43) : t43 = $[113];
3054
3056
  let t44;
3055
- $[113] !== CustomDetails || $[114] !== assetItem || $[115] !== detailsProps || $[116] !== formUpdating || $[117] !== handleSubmit || $[118] !== onSubmit || $[119] !== tabSection ? (t44 = (t45) => {
3057
+ $[114] !== CustomDetails || $[115] !== assetItem || $[116] !== detailsProps || $[117] !== formUpdating || $[118] !== handleSubmit || $[119] !== onSubmit || $[120] !== tabSection ? (t44 = (t45) => {
3056
3058
  let { isLoading, referringDocuments } = t45, uniqueReferringDocuments = getUniqueDocuments(referringDocuments);
3057
3059
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(TabList, {
3058
3060
  gap: 2,
@@ -3117,9 +3119,9 @@ const DialogAssetEdit = (props) => {
3117
3119
  })
3118
3120
  ]
3119
3121
  })] });
3120
- }, $[113] = CustomDetails, $[114] = assetItem, $[115] = detailsProps, $[116] = formUpdating, $[117] = handleSubmit, $[118] = onSubmit, $[119] = tabSection, $[120] = t44) : t44 = $[120];
3122
+ }, $[114] = CustomDetails, $[115] = assetItem, $[116] = detailsProps, $[117] = formUpdating, $[118] = handleSubmit, $[119] = onSubmit, $[120] = tabSection, $[121] = t44) : t44 = $[121];
3121
3123
  let t45;
3122
- $[121] !== currentAsset._id || $[122] !== documentStore || $[123] !== t44 ? (t45 = /* @__PURE__ */ jsx(Box, {
3124
+ $[122] !== currentAsset._id || $[123] !== documentStore || $[124] !== t44 ? (t45 = /* @__PURE__ */ jsx(Box, {
3123
3125
  flex: 1,
3124
3126
  marginTop: t43,
3125
3127
  padding: 4,
@@ -3128,13 +3130,13 @@ const DialogAssetEdit = (props) => {
3128
3130
  id: currentAsset._id,
3129
3131
  children: t44
3130
3132
  })
3131
- }), $[121] = currentAsset._id, $[122] = documentStore, $[123] = t44, $[124] = t45) : t45 = $[124];
3133
+ }), $[122] = currentAsset._id, $[123] = documentStore, $[124] = t44, $[125] = t45) : t45 = $[125];
3132
3134
  let t46;
3133
- $[125] === Symbol.for("react.memo_cache_sentinel") ? (t46 = { aspectRatio: "1" }, $[125] = t46) : t46 = $[125];
3135
+ $[126] === Symbol.for("react.memo_cache_sentinel") ? (t46 = { aspectRatio: "1" }, $[126] = t46) : t46 = $[126];
3134
3136
  let t47;
3135
- $[126] === currentAsset ? t47 = $[127] : (t47 = isFileAsset(currentAsset) && /* @__PURE__ */ jsx(FileAssetPreview, { asset: currentAsset }), $[126] = currentAsset, $[127] = t47);
3137
+ $[127] === currentAsset ? t47 = $[128] : (t47 = isFileAsset(currentAsset) && /* @__PURE__ */ jsx(FileAssetPreview, { asset: currentAsset }), $[127] = currentAsset, $[128] = t47);
3136
3138
  let t48;
3137
- $[128] !== currentAsset || $[129] !== scheme ? (t48 = isImageAsset(currentAsset) && /* @__PURE__ */ jsx(Image$1, {
3139
+ $[129] !== currentAsset || $[130] !== scheme ? (t48 = isImageAsset(currentAsset) && /* @__PURE__ */ jsx(Image$1, {
3138
3140
  draggable: !1,
3139
3141
  $scheme: scheme,
3140
3142
  $showCheckerboard: !currentAsset?.metadata?.isOpaque,
@@ -3142,33 +3144,33 @@ const DialogAssetEdit = (props) => {
3142
3144
  height: 600,
3143
3145
  width: 600
3144
3146
  })
3145
- }), $[128] = currentAsset, $[129] = scheme, $[130] = t48) : t48 = $[130];
3147
+ }), $[129] = currentAsset, $[130] = scheme, $[131] = t48) : t48 = $[131];
3146
3148
  let t49;
3147
- $[131] !== t47 || $[132] !== t48 ? (t49 = /* @__PURE__ */ jsxs(Box, {
3149
+ $[132] !== t47 || $[133] !== t48 ? (t49 = /* @__PURE__ */ jsxs(Box, {
3148
3150
  style: t46,
3149
3151
  children: [t47, t48]
3150
- }), $[131] = t47, $[132] = t48, $[133] = t49) : t49 = $[133];
3152
+ }), $[132] = t47, $[133] = t48, $[134] = t49) : t49 = $[134];
3151
3153
  let t50;
3152
- $[134] !== assetItem || $[135] !== currentAsset ? (t50 = currentAsset && /* @__PURE__ */ jsx(Box, {
3154
+ $[135] !== assetItem || $[136] !== currentAsset ? (t50 = currentAsset && /* @__PURE__ */ jsx(Box, {
3153
3155
  marginTop: 4,
3154
3156
  children: /* @__PURE__ */ jsx(AssetMetadata, {
3155
3157
  asset: currentAsset,
3156
3158
  item: assetItem
3157
3159
  })
3158
- }), $[134] = assetItem, $[135] = currentAsset, $[136] = t50) : t50 = $[136];
3160
+ }), $[135] = assetItem, $[136] = currentAsset, $[137] = t50) : t50 = $[137];
3159
3161
  let t51;
3160
- $[137] !== t49 || $[138] !== t50 ? (t51 = /* @__PURE__ */ jsxs(Box, {
3162
+ $[138] !== t49 || $[139] !== t50 ? (t51 = /* @__PURE__ */ jsxs(Box, {
3161
3163
  flex: 1,
3162
3164
  padding: 4,
3163
3165
  children: [t49, t50]
3164
- }), $[137] = t49, $[138] = t50, $[139] = t51) : t51 = $[139];
3166
+ }), $[138] = t49, $[139] = t50, $[140] = t51) : t51 = $[140];
3165
3167
  let t52;
3166
- $[140] !== t45 || $[141] !== t51 ? (t52 = /* @__PURE__ */ jsxs(Flex, {
3168
+ $[141] !== t45 || $[142] !== t51 ? (t52 = /* @__PURE__ */ jsxs(Flex, {
3167
3169
  direction: t42,
3168
3170
  children: [t45, t51]
3169
- }), $[140] = t45, $[141] = t51, $[142] = t52) : t52 = $[142];
3171
+ }), $[141] = t45, $[142] = t51, $[143] = t52) : t52 = $[143];
3170
3172
  let t53;
3171
- return $[143] !== children || $[144] !== footer || $[145] !== handleClose || $[146] !== id || $[147] !== t52 ? (t53 = /* @__PURE__ */ jsxs(Dialog$1, {
3173
+ return $[144] !== children || $[145] !== footer || $[146] !== handleClose || $[147] !== id || $[148] !== t52 ? (t53 = /* @__PURE__ */ jsxs(Dialog$1, {
3172
3174
  animate: !0,
3173
3175
  footer,
3174
3176
  header: "Asset details",
@@ -3176,7 +3178,7 @@ const DialogAssetEdit = (props) => {
3176
3178
  onClose: handleClose,
3177
3179
  width: 3,
3178
3180
  children: [t52, children]
3179
- }), $[143] = children, $[144] = footer, $[145] = handleClose, $[146] = id, $[147] = t52, $[148] = t53) : t53 = $[148], t53;
3181
+ }), $[144] = children, $[145] = footer, $[146] = handleClose, $[147] = id, $[148] = t52, $[149] = t53) : t53 = $[149], t53;
3180
3182
  };
3181
3183
  function _temp$35(v) {
3182
3184
  return v;
@@ -7064,16 +7066,18 @@ function _temp2$5(state_0) {
7064
7066
  const TableHeaderItem = (props) => {
7065
7067
  let $ = c(26), { field, title } = props, dispatch = useDispatch(), order = useTypedSelector(_temp$8), isActive = order.field === field, t0;
7066
7068
  $[0] !== dispatch || $[1] !== field || $[2] !== isActive || $[3] !== order.direction || $[4] !== title ? (t0 = () => {
7067
- if (!(!field || !title)) if (isActive) {
7068
- let direction = order.direction === "asc" ? "desc" : "asc";
7069
- dispatch(assetsActions.orderSet({ order: {
7069
+ if (!(!field || !title)) {
7070
+ if (isActive) {
7071
+ let direction = order.direction === "asc" ? "desc" : "asc";
7072
+ dispatch(assetsActions.orderSet({ order: {
7073
+ field,
7074
+ direction
7075
+ } }));
7076
+ } else dispatch(assetsActions.orderSet({ order: {
7070
7077
  field,
7071
- direction
7078
+ direction: "asc"
7072
7079
  } }));
7073
- } else dispatch(assetsActions.orderSet({ order: {
7074
- field,
7075
- direction: "asc"
7076
- } }));
7080
+ }
7077
7081
  }, $[0] = dispatch, $[1] = field, $[2] = isActive, $[3] = order.direction, $[4] = title, $[5] = t0) : t0 = $[5];
7078
7082
  let handleClick = t0, t1 = !field, t2 = field ? handleClick : void 0, t3 = field ? "pointer" : "default", t4;
7079
7083
  $[6] === t3 ? t4 = $[7] : (t4 = {