'use strict';
import { supportedImageExtensions, supportedVideoExtensions, supportedImageTypes, supportedVideoTypes } from '../constants/file-loader-data-types.js';
import { getNewUuid } from '../uuids.js';
import { fileExtensionsWithoutDot } from '../../base-repo/app-constants/internal-system-constants.js';

var __defProp=Object['defineProperty'],__name=(_0xc7e8d9,_0x5dafad)=>__defProp(_0xc7e8d9,'name',{'value':_0x5dafad,'configurable':!![]});function generateFileName(_0x20c9ae){return getNewUuid()+'.'+getExtension(_0x20c9ae['name']);}__name(generateFileName,'generateFileName');function getExtension(_0x15548e){return _0x15548e['slice'](_0x15548e['lastIndexOf']('.')+(0xc6e+-0x2*0xeb1+-0x10f5*-0x1));}__name(getExtension,'getExtension');function getContentTypeByExtension(_0x10d13c){const _0x5edabf=_0x10d13c['startsWith']('.')?_0x10d13c['slice'](0x13aa+-0x4*-0x14f+0x18e5*-0x1):_0x10d13c;let _0xfd028c;const _0x3c7107=supportedImageExtensions['findIndex'](_0x564c5f=>_0x564c5f===_0x5edabf||_0x564c5f===fileExtensionsWithoutDot['jpeg']&&_0x5edabf===fileExtensionsWithoutDot['jpg']),_0x58d7ec=supportedVideoExtensions['findIndex'](_0x26f3aa=>_0x26f3aa['toLowerCase']()===_0x5edabf);if(_0x3c7107!==-(-0xc70+-0x1*-0x11ff+-0x58e))_0xfd028c=supportedImageTypes[_0x3c7107];else _0x58d7ec!==-(-0xb00+0xfa9+-0x4a8)&&(_0xfd028c=supportedVideoTypes[_0x58d7ec]);return _0xfd028c;}__name(getContentTypeByExtension,'getContentTypeByExtension');

export { generateFileName, getContentTypeByExtension, getExtension };
