function _ts_decorate(decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function _ts_metadata(k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
}
import { Entity, Column, Index, OneToOne, JoinColumn, PrimaryColumn } from "typeorm";
import { ffVisibility, notificationTypes } from "../../types.js";
import { id } from "../id.js";
import { User } from "./user.js";
import { Page } from "./page.js";
export let UserProfile = class UserProfile {
    userId;
    user;
    location;
    birthday;
    description;
    fields;
    mentions;
    lang;
    url;
    email;
    emailVerifyCode;
    emailVerified;
    emailNotificationTypes;
    publicReactions;
    ffVisibility;
    twoFactorTempSecret;
    twoFactorSecret;
    twoFactorEnabled;
    securityKeysAvailable;
    usePasswordLessLogin;
    password;
    moderationNote;
    // TODO: そのうち消す
    clientData;
    // TODO: そのうち消す
    room;
    autoAcceptFollowed;
    noCrawle;
    preventAiLearning;
    alwaysMarkNsfw;
    carefulBot;
    injectFeaturedNote;
    receiveAnnouncementEmail;
    pinnedPageId;
    pinnedPage;
    integrations;
    enableWordMute;
    mutedWords;
    mutedInstances;
    mutingNotificationTypes;
    pronouns;
    //#region Denormalized fields
    userHost;
    //#endregion
    constructor(data){
        if (data == null) return;
        for (const [k, v] of Object.entries(data)){
            this[k] = v;
        }
    }
};
_ts_decorate([
    PrimaryColumn(id()),
    _ts_metadata("design:type", Object)
], UserProfile.prototype, "userId", void 0);
_ts_decorate([
    OneToOne((type)=>User, {
        onDelete: "CASCADE"
    }),
    JoinColumn(),
    _ts_metadata("design:type", Object)
], UserProfile.prototype, "user", void 0);
_ts_decorate([
    Column("varchar", {
        length: 128,
        nullable: true,
        comment: "The location of the User."
    }),
    _ts_metadata("design:type", Object)
], UserProfile.prototype, "location", void 0);
_ts_decorate([
    Column("char", {
        length: 10,
        nullable: true,
        comment: "The birthday (YYYY-MM-DD) of the User."
    }),
    _ts_metadata("design:type", Object)
], UserProfile.prototype, "birthday", void 0);
_ts_decorate([
    Column("varchar", {
        length: 2048,
        nullable: true,
        comment: "The description (bio) of the User."
    }),
    _ts_metadata("design:type", Object)
], UserProfile.prototype, "description", void 0);
_ts_decorate([
    Column("jsonb", {
        default: []
    }),
    _ts_metadata("design:type", Array)
], UserProfile.prototype, "fields", void 0);
_ts_decorate([
    Column("jsonb", {
        default: []
    }),
    _ts_metadata("design:type", typeof IMentionedRemoteUsers === "undefined" ? Object : IMentionedRemoteUsers)
], UserProfile.prototype, "mentions", void 0);
_ts_decorate([
    Column("varchar", {
        length: 32,
        nullable: true
    }),
    _ts_metadata("design:type", Object)
], UserProfile.prototype, "lang", void 0);
_ts_decorate([
    Column("varchar", {
        length: 512,
        nullable: true,
        comment: "Remote URL of the user."
    }),
    _ts_metadata("design:type", Object)
], UserProfile.prototype, "url", void 0);
_ts_decorate([
    Column("varchar", {
        length: 128,
        nullable: true,
        comment: "The email address of the User."
    }),
    _ts_metadata("design:type", Object)
], UserProfile.prototype, "email", void 0);
_ts_decorate([
    Column("varchar", {
        length: 128,
        nullable: true
    }),
    _ts_metadata("design:type", Object)
], UserProfile.prototype, "emailVerifyCode", void 0);
_ts_decorate([
    Column("boolean", {
        default: false
    }),
    _ts_metadata("design:type", Boolean)
], UserProfile.prototype, "emailVerified", void 0);
_ts_decorate([
    Column("jsonb", {
        default: [
            "follow",
            "receiveFollowRequest",
            "groupInvited"
        ]
    }),
    _ts_metadata("design:type", Array)
], UserProfile.prototype, "emailNotificationTypes", void 0);
_ts_decorate([
    Column("boolean", {
        default: false
    }),
    _ts_metadata("design:type", Boolean)
], UserProfile.prototype, "publicReactions", void 0);
_ts_decorate([
    Column("enum", {
        enum: ffVisibility,
        default: "public"
    }),
    _ts_metadata("design:type", Object)
], UserProfile.prototype, "ffVisibility", void 0);
_ts_decorate([
    Column("varchar", {
        length: 128,
        nullable: true
    }),
    _ts_metadata("design:type", Object)
], UserProfile.prototype, "twoFactorTempSecret", void 0);
_ts_decorate([
    Column("varchar", {
        length: 128,
        nullable: true
    }),
    _ts_metadata("design:type", Object)
], UserProfile.prototype, "twoFactorSecret", void 0);
_ts_decorate([
    Column("boolean", {
        default: false
    }),
    _ts_metadata("design:type", Boolean)
], UserProfile.prototype, "twoFactorEnabled", void 0);
_ts_decorate([
    Column("boolean", {
        default: false
    }),
    _ts_metadata("design:type", Boolean)
], UserProfile.prototype, "securityKeysAvailable", void 0);
_ts_decorate([
    Column("boolean", {
        default: false
    }),
    _ts_metadata("design:type", Boolean)
], UserProfile.prototype, "usePasswordLessLogin", void 0);
_ts_decorate([
    Column("varchar", {
        length: 128,
        nullable: true,
        comment: "The password hash of the User. It will be null if the origin of the user is local."
    }),
    _ts_metadata("design:type", Object)
], UserProfile.prototype, "password", void 0);
_ts_decorate([
    Column("varchar", {
        length: 8192,
        default: ""
    }),
    _ts_metadata("design:type", Object)
], UserProfile.prototype, "moderationNote", void 0);
_ts_decorate([
    Column("jsonb", {
        default: {},
        comment: "The client-specific data of the User."
    }),
    _ts_metadata("design:type", typeof Record === "undefined" ? Object : Record)
], UserProfile.prototype, "clientData", void 0);
_ts_decorate([
    Column("jsonb", {
        default: {},
        comment: "The room data of the User."
    }),
    _ts_metadata("design:type", typeof Record === "undefined" ? Object : Record)
], UserProfile.prototype, "room", void 0);
_ts_decorate([
    Column("boolean", {
        default: false
    }),
    _ts_metadata("design:type", Boolean)
], UserProfile.prototype, "autoAcceptFollowed", void 0);
_ts_decorate([
    Column("boolean", {
        default: false,
        comment: "Whether reject index by crawler."
    }),
    _ts_metadata("design:type", Boolean)
], UserProfile.prototype, "noCrawle", void 0);
_ts_decorate([
    Column("boolean", {
        default: true
    }),
    _ts_metadata("design:type", Boolean)
], UserProfile.prototype, "preventAiLearning", void 0);
_ts_decorate([
    Column("boolean", {
        default: false
    }),
    _ts_metadata("design:type", Boolean)
], UserProfile.prototype, "alwaysMarkNsfw", void 0);
_ts_decorate([
    Column("boolean", {
        default: false
    }),
    _ts_metadata("design:type", Boolean)
], UserProfile.prototype, "carefulBot", void 0);
_ts_decorate([
    Column("boolean", {
        default: true
    }),
    _ts_metadata("design:type", Boolean)
], UserProfile.prototype, "injectFeaturedNote", void 0);
_ts_decorate([
    Column("boolean", {
        default: true
    }),
    _ts_metadata("design:type", Boolean)
], UserProfile.prototype, "receiveAnnouncementEmail", void 0);
_ts_decorate([
    Column({
        ...id(),
        nullable: true
    }),
    _ts_metadata("design:type", Object)
], UserProfile.prototype, "pinnedPageId", void 0);
_ts_decorate([
    OneToOne((type)=>Page, {
        onDelete: "SET NULL"
    }),
    JoinColumn(),
    _ts_metadata("design:type", Object)
], UserProfile.prototype, "pinnedPage", void 0);
_ts_decorate([
    Column("jsonb", {
        default: {}
    }),
    _ts_metadata("design:type", typeof Record === "undefined" ? Object : Record)
], UserProfile.prototype, "integrations", void 0);
_ts_decorate([
    Index(),
    Column("boolean", {
        default: false,
        select: false
    }),
    _ts_metadata("design:type", Boolean)
], UserProfile.prototype, "enableWordMute", void 0);
_ts_decorate([
    Column("jsonb", {
        default: []
    }),
    _ts_metadata("design:type", Array)
], UserProfile.prototype, "mutedWords", void 0);
_ts_decorate([
    Column("jsonb", {
        default: [],
        comment: "List of instances muted by the user."
    }),
    _ts_metadata("design:type", Array)
], UserProfile.prototype, "mutedInstances", void 0);
_ts_decorate([
    Column("enum", {
        enum: notificationTypes,
        array: true,
        default: []
    }),
    _ts_metadata("design:type", Array)
], UserProfile.prototype, "mutingNotificationTypes", void 0);
_ts_decorate([
    Column("jsonb", {
        default: {},
        comment: "Language map of user pronouns"
    }),
    _ts_metadata("design:type", typeof Record === "undefined" ? Object : Record)
], UserProfile.prototype, "pronouns", void 0);
_ts_decorate([
    Index(),
    Column("varchar", {
        length: 512,
        nullable: true,
        comment: "[Denormalized]"
    }),
    _ts_metadata("design:type", Object)
], UserProfile.prototype, "userHost", void 0);
UserProfile = _ts_decorate([
    Entity(),
    _ts_metadata("design:type", Function),
    _ts_metadata("design:paramtypes", [
        typeof Partial === "undefined" ? Object : Partial
    ])
], UserProfile);
