"use strict";Object.defineProperty(exports, "__esModule", {value: true});

var _chunkAGGKOHRFjs = require('./chunk-AGGKOHRF.js');

// tmp-babel/profiles/common/utils.js
var _utils = require('@baseapp-frontend/utils');
function _typeof(o) {
  "@babel/helpers - typeof";
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof(o);
}
function ownKeys(e, r) {
  var t = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e, r2).enumerable;
    })), t.push.apply(t, o);
  }
  return t;
}
function _objectSpread(e) {
  for (var r = 1; r < arguments.length; r++) {
    var t = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
      _defineProperty(e, r2, t[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
      Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
    });
  }
  return e;
}
function _defineProperty(e, r, t) {
  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e;
}
function _toPropertyKey(t) {
  var i = _toPrimitive(t, "string");
  return "symbol" == _typeof(i) ? i : i + "";
}
function _toPrimitive(t, r) {
  if ("object" != _typeof(t) || !t) return t;
  var e = t[Symbol.toPrimitive];
  if (void 0 !== e) {
    var i = e.call(t, r || "default");
    if ("object" != _typeof(i)) return i;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t);
}
var DEFAULT_PHONE_NUMBER_COUNTRY_CODE = "+1";
var getProfileDefaultValues = function getProfileDefaultValues2(_ref) {
  var _profile$owner$phoneN, _profile$owner, _profile$image$url, _profile$image, _profile$bannerImage$, _profile$bannerImage, _profile$urlPath$path, _profile$urlPath, _profile$biography;
  var profile = _ref.profile, _ref$removeSlashInUse = _ref.removeSlashInUsername, removeSlashInUsername = _ref$removeSlashInUse === void 0 ? true : _ref$removeSlashInUse;
  var formattedProfile = _objectSpread(_objectSpread({}, profile), {}, {
    phoneNumber: (_profile$owner$phoneN = profile === null || profile === void 0 || (_profile$owner = profile.owner) === null || _profile$owner === void 0 ? void 0 : _profile$owner.phoneNumber) !== null && _profile$owner$phoneN !== void 0 ? _profile$owner$phoneN : DEFAULT_PHONE_NUMBER_COUNTRY_CODE,
    image: (_profile$image$url = profile === null || profile === void 0 || (_profile$image = profile.image) === null || _profile$image === void 0 ? void 0 : _profile$image.url) !== null && _profile$image$url !== void 0 ? _profile$image$url : "",
    bannerImage: (_profile$bannerImage$ = profile === null || profile === void 0 || (_profile$bannerImage = profile.bannerImage) === null || _profile$bannerImage === void 0 ? void 0 : _profile$bannerImage.url) !== null && _profile$bannerImage$ !== void 0 ? _profile$bannerImage$ : "",
    urlPath: (_profile$urlPath$path = profile === null || profile === void 0 || (_profile$urlPath = profile.urlPath) === null || _profile$urlPath === void 0 ? void 0 : _profile$urlPath.path) !== null && _profile$urlPath$path !== void 0 ? _profile$urlPath$path : "",
    biography: (_profile$biography = profile === null || profile === void 0 ? void 0 : profile.biography) !== null && _profile$biography !== void 0 ? _profile$biography : ""
  });
  if (removeSlashInUsername) {
    var _formattedProfile$url;
    formattedProfile.urlPath = (_formattedProfile$url = formattedProfile.urlPath) === null || _formattedProfile$url === void 0 ? void 0 : _formattedProfile$url.replace("/", "");
  }
  var defaultValues = _utils.getInitialValues.call(void 0, {
    current: formattedProfile,
    initial: _chunkAGGKOHRFjs.DEFAULT_PROFILE_FORM_VALUES
  });
  return defaultValues;
};
var getImageUrl = function getImageUrl2(image) {
  if (typeof image === "string") return image;
  if (image instanceof Blob) return URL.createObjectURL(image);
  return "";
};





exports.DEFAULT_PHONE_NUMBER_COUNTRY_CODE = DEFAULT_PHONE_NUMBER_COUNTRY_CODE; exports.getProfileDefaultValues = getProfileDefaultValues; exports.getImageUrl = getImageUrl;
//# sourceMappingURL=chunk-WO63JU7B.js.map