"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var get_absolute_url_exports = {};
__export(get_absolute_url_exports, {
  getAbsoluteUrl: () => getAbsoluteUrl
});
module.exports = __toCommonJS(get_absolute_url_exports);
var import_is_absolute_url = require("./is-absolute-url.js");
var import_media_url_consts = require("./media-url-consts.js");
const getAbsoluteUrl = (url, type) => {
  if ((0, import_is_absolute_url.isAbsoluteUrl)(url)) {
    return url;
  }
  let baseUrl, baseFolder;
  if (type === "image") {
    baseUrl = import_media_url_consts.WIX_MEDIA_BASE_URL;
    baseFolder = "media/";
  } else {
    baseUrl = import_media_url_consts.WIX_VIDEO_BASE_URL;
    baseFolder = "video/";
  }
  const pathWithFolder = url.startsWith(baseFolder) ? url : baseFolder + url;
  return baseUrl + pathWithFolder;
};
//# sourceMappingURL=get-absolute-url.js.map
