import { ResourcePermissionEngine } from "./ResourcePermissionEngine.js";
import { UUIDsEqual } from "@memberjunction/global";
export class ResourceData {
    constructor(data = null) {
        if (data) {
            this.ID = data.ID;
            this.Name = data.Name;
            this.ResourceTypeID = data.ResourceTypeID;
            this.ResourceRecordID = data.ResourceRecordID;
            this.Configuration = data.Configuration;
        }
    }
    /**
     * Returns the name of the resource type based on the ResourceTypeID
     */
    get ResourceType() {
        const rt = ResourcePermissionEngine.Instance.ResourceTypes.find(rt => UUIDsEqual(rt.ID, this.ResourceTypeID));
        return rt ? rt.Name : '';
    }
    get ResourceIcon() {
        const rt = ResourcePermissionEngine.Instance.ResourceTypes.find(rt => UUIDsEqual(rt.ID, this.ResourceTypeID));
        return rt && rt.Icon ? rt.Icon : '';
    }
}
//# sourceMappingURL=ResourceData.js.map