(function (global) {
  global.ARQ = global.ARQ || {};
  ARQ.guards = {
    isProtectedProjectPath: function (relPath) {
      if (!relPath) return true;
      var p = String(relPath).replace(/\\/g, '/');
      var prefixes = ARQ.PROTECTED_PREFIXES || [];
      for (var i = 0; i < prefixes.length; i++) {
        if (p.indexOf(prefixes[i]) !== -1) return true;
      }
      if (p.indexOf('reserved_projects') === 0 && (p === 'reserved_projects' || p === 'reserved_projects/')) {
        return true;
      }
      return false;
    },
    canDeleteLayer: function (layer) {
      if (!layer) return false;
      if (layer.es_capa_base) return false;
      return true;
    },
    canDrawOnLayer: function (layer) {
      if (!layer || !layer.visible) return false;
      if (layer.bloqueada) return false;
      return true;
    },
  };
})(typeof window !== 'undefined' ? window : this);
