/* PreviewCard.c generated by valac 0.56.19, the Vala compiler
 * generated from PreviewCard.vala, do not modify */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gdk/gdk.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <adwaita.h>
#include <float.h>
#include <math.h>
#include <pango/pango.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define TUBA_WIDGETS_TYPE_PREVIEW_CARD (tuba_widgets_preview_card_get_type ())
#define TUBA_WIDGETS_PREVIEW_CARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_PREVIEW_CARD, TubaWidgetsPreviewCard))
#define TUBA_WIDGETS_PREVIEW_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_PREVIEW_CARD, TubaWidgetsPreviewCardClass))
#define TUBA_WIDGETS_IS_PREVIEW_CARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_PREVIEW_CARD))
#define TUBA_WIDGETS_IS_PREVIEW_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_PREVIEW_CARD))
#define TUBA_WIDGETS_PREVIEW_CARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_PREVIEW_CARD, TubaWidgetsPreviewCardClass))

typedef struct _TubaWidgetsPreviewCard TubaWidgetsPreviewCard;
typedef struct _TubaWidgetsPreviewCardClass TubaWidgetsPreviewCardClass;
typedef struct _TubaWidgetsPreviewCardPrivate TubaWidgetsPreviewCardPrivate;

#define TUBA_WIDGETS_TYPE_PREVIEW_CARD_INTERNAL (tuba_widgets_preview_card_internal_get_type ())
#define TUBA_WIDGETS_PREVIEW_CARD_INTERNAL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_PREVIEW_CARD_INTERNAL, TubaWidgetsPreviewCardInternal))
#define TUBA_WIDGETS_PREVIEW_CARD_INTERNAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_PREVIEW_CARD_INTERNAL, TubaWidgetsPreviewCardInternalClass))
#define TUBA_WIDGETS_IS_PREVIEW_CARD_INTERNAL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_PREVIEW_CARD_INTERNAL))
#define TUBA_WIDGETS_IS_PREVIEW_CARD_INTERNAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_PREVIEW_CARD_INTERNAL))
#define TUBA_WIDGETS_PREVIEW_CARD_INTERNAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_PREVIEW_CARD_INTERNAL, TubaWidgetsPreviewCardInternalClass))

typedef struct _TubaWidgetsPreviewCardInternal TubaWidgetsPreviewCardInternal;
typedef struct _TubaWidgetsPreviewCardInternalClass TubaWidgetsPreviewCardInternalClass;

#define TUBA_TYPE_ENTITY (tuba_entity_get_type ())
#define TUBA_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ENTITY, TubaEntity))
#define TUBA_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ENTITY, TubaEntityClass))
#define TUBA_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ENTITY))
#define TUBA_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ENTITY))
#define TUBA_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ENTITY, TubaEntityClass))

typedef struct _TubaEntity TubaEntity;
typedef struct _TubaEntityClass TubaEntityClass;

#define TUBA_API_PREVIEW_CARD_TYPE_AUTHOR_ENTITY (tuba_api_preview_card_author_entity_get_type ())
#define TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_PREVIEW_CARD_TYPE_AUTHOR_ENTITY, TubaAPIPreviewCardAuthorEntity))
#define TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_PREVIEW_CARD_TYPE_AUTHOR_ENTITY, TubaAPIPreviewCardAuthorEntityClass))
#define TUBA_API_PREVIEW_CARD_IS_AUTHOR_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_PREVIEW_CARD_TYPE_AUTHOR_ENTITY))
#define TUBA_API_PREVIEW_CARD_IS_AUTHOR_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_PREVIEW_CARD_TYPE_AUTHOR_ENTITY))
#define TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_PREVIEW_CARD_TYPE_AUTHOR_ENTITY, TubaAPIPreviewCardAuthorEntityClass))

typedef struct _TubaAPIPreviewCardAuthorEntity TubaAPIPreviewCardAuthorEntity;
typedef struct _TubaAPIPreviewCardAuthorEntityClass TubaAPIPreviewCardAuthorEntityClass;

#define TUBA_API_TYPE_ACCOUNT (tuba_api_account_get_type ())
#define TUBA_API_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccount))
#define TUBA_API_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))
#define TUBA_API_IS_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_IS_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))

typedef struct _TubaAPIAccount TubaAPIAccount;
typedef struct _TubaAPIAccountClass TubaAPIAccountClass;
enum  {
	TUBA_WIDGETS_PREVIEW_CARD_0_PROPERTY,
	TUBA_WIDGETS_PREVIEW_CARD_NUM_PROPERTIES
};
static GParamSpec* tuba_widgets_preview_card_properties[TUBA_WIDGETS_PREVIEW_CARD_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define TUBA_API_TYPE_PREVIEW_CARD (tuba_api_preview_card_get_type ())
#define TUBA_API_PREVIEW_CARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_PREVIEW_CARD, TubaAPIPreviewCard))
#define TUBA_API_PREVIEW_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_PREVIEW_CARD, TubaAPIPreviewCardClass))
#define TUBA_API_IS_PREVIEW_CARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_PREVIEW_CARD))
#define TUBA_API_IS_PREVIEW_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_PREVIEW_CARD))
#define TUBA_API_PREVIEW_CARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_PREVIEW_CARD, TubaAPIPreviewCardClass))

typedef struct _TubaAPIPreviewCard TubaAPIPreviewCard;
typedef struct _TubaAPIPreviewCardClass TubaAPIPreviewCardClass;
typedef struct _Block94Data Block94Data;
typedef void (*TubaHelperImageOnItemChangedFn) (GdkPaintable* data, gpointer user_data);
#define _g_uri_unref0(var) ((var == NULL) ? NULL : (var = (g_uri_unref (var), NULL)))
typedef struct _TubaWidgetsPreviewCardInternalPrivate TubaWidgetsPreviewCardInternalPrivate;
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))

#define TUBA_WIDGETS_TYPE_RICH_LABEL (tuba_widgets_rich_label_get_type ())
#define TUBA_WIDGETS_RICH_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_RICH_LABEL, TubaWidgetsRichLabel))
#define TUBA_WIDGETS_RICH_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_RICH_LABEL, TubaWidgetsRichLabelClass))
#define TUBA_WIDGETS_IS_RICH_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_RICH_LABEL))
#define TUBA_WIDGETS_IS_RICH_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_RICH_LABEL))
#define TUBA_WIDGETS_RICH_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_RICH_LABEL, TubaWidgetsRichLabelClass))

typedef struct _TubaWidgetsRichLabel TubaWidgetsRichLabel;
typedef struct _TubaWidgetsRichLabelClass TubaWidgetsRichLabelClass;

#define TUBA_TYPE_WIDGETIZABLE (tuba_widgetizable_get_type ())
#define TUBA_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_WIDGETIZABLE, TubaWidgetizable))
#define TUBA_IS_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_WIDGETIZABLE))
#define TUBA_WIDGETIZABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TUBA_TYPE_WIDGETIZABLE, TubaWidgetizableIface))

typedef struct _TubaWidgetizable TubaWidgetizable;
typedef struct _TubaWidgetizableIface TubaWidgetizableIface;

#define TUBA_TYPE_INSTANCE_ACCOUNT (tuba_instance_account_get_type ())
#define TUBA_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccount))
#define TUBA_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))
#define TUBA_IS_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_IS_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_INSTANCE_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))

typedef struct _TubaInstanceAccount TubaInstanceAccount;
typedef struct _TubaInstanceAccountClass TubaInstanceAccountClass;

#define TUBA_WIDGETS_PREVIEW_CARD_TYPE_AUTHOR_ROW (tuba_widgets_preview_card_author_row_get_type ())
#define TUBA_WIDGETS_PREVIEW_CARD_AUTHOR_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_PREVIEW_CARD_TYPE_AUTHOR_ROW, TubaWidgetsPreviewCardAuthorRow))
#define TUBA_WIDGETS_PREVIEW_CARD_AUTHOR_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_PREVIEW_CARD_TYPE_AUTHOR_ROW, TubaWidgetsPreviewCardAuthorRowClass))
#define TUBA_WIDGETS_PREVIEW_CARD_IS_AUTHOR_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_PREVIEW_CARD_TYPE_AUTHOR_ROW))
#define TUBA_WIDGETS_PREVIEW_CARD_IS_AUTHOR_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_PREVIEW_CARD_TYPE_AUTHOR_ROW))
#define TUBA_WIDGETS_PREVIEW_CARD_AUTHOR_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_PREVIEW_CARD_TYPE_AUTHOR_ROW, TubaWidgetsPreviewCardAuthorRowClass))

typedef struct _TubaWidgetsPreviewCardAuthorRow TubaWidgetsPreviewCardAuthorRow;
typedef struct _TubaWidgetsPreviewCardAuthorRowClass TubaWidgetsPreviewCardAuthorRowClass;
typedef struct _TubaWidgetsPreviewCardAuthorRowPrivate TubaWidgetsPreviewCardAuthorRowPrivate;
enum  {
	TUBA_WIDGETS_PREVIEW_CARD_AUTHOR_ROW_0_PROPERTY,
	TUBA_WIDGETS_PREVIEW_CARD_AUTHOR_ROW_NUM_PROPERTIES
};
static GParamSpec* tuba_widgets_preview_card_author_row_properties[TUBA_WIDGETS_PREVIEW_CARD_AUTHOR_ROW_NUM_PROPERTIES];

#define TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS (tuba_widgets_label_with_widgets_get_type ())
#define TUBA_WIDGETS_LABEL_WITH_WIDGETS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS, TubaWidgetsLabelWithWidgets))
#define TUBA_WIDGETS_LABEL_WITH_WIDGETS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS, TubaWidgetsLabelWithWidgetsClass))
#define TUBA_WIDGETS_IS_LABEL_WITH_WIDGETS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS))
#define TUBA_WIDGETS_IS_LABEL_WITH_WIDGETS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS))
#define TUBA_WIDGETS_LABEL_WITH_WIDGETS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS, TubaWidgetsLabelWithWidgetsClass))

typedef struct _TubaWidgetsLabelWithWidgets TubaWidgetsLabelWithWidgets;
typedef struct _TubaWidgetsLabelWithWidgetsClass TubaWidgetsLabelWithWidgetsClass;

#define TUBA_WIDGETS_TYPE_EMOJI_LABEL (tuba_widgets_emoji_label_get_type ())
#define TUBA_WIDGETS_EMOJI_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_EMOJI_LABEL, TubaWidgetsEmojiLabel))
#define TUBA_WIDGETS_EMOJI_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_EMOJI_LABEL, TubaWidgetsEmojiLabelClass))
#define TUBA_WIDGETS_IS_EMOJI_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_EMOJI_LABEL))
#define TUBA_WIDGETS_IS_EMOJI_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_EMOJI_LABEL))
#define TUBA_WIDGETS_EMOJI_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_EMOJI_LABEL, TubaWidgetsEmojiLabelClass))

typedef struct _TubaWidgetsEmojiLabel TubaWidgetsEmojiLabel;
typedef struct _TubaWidgetsEmojiLabelClass TubaWidgetsEmojiLabelClass;

struct _TubaWidgetsPreviewCard {
	GtkBox parent_instance;
	TubaWidgetsPreviewCardPrivate * priv;
	GtkButton* button;
};

struct _TubaWidgetsPreviewCardClass {
	GtkBoxClass parent_class;
};

struct _TubaWidgetsPreviewCardPrivate {
	TubaWidgetsPreviewCardInternal* box;
	GeeArrayList* verified_authors;
	gchar* author_url;
	TubaAPIAccount* author_account;
	GtkPopover* authors_popover;
};

struct _Block94Data {
	int _ref_count_;
	TubaWidgetsPreviewCard* self;
	GtkPicture* image;
};

struct _TubaWidgetsPreviewCardInternal {
	GtkBox parent_instance;
	TubaWidgetsPreviewCardInternalPrivate * priv;
	GtkLabel* author_label;
	GtkLabel* title_label;
	GtkLabel* description_label;
	GtkBox* internal_box;
};

struct _TubaWidgetsPreviewCardInternalClass {
	GtkBoxClass parent_class;
};

struct _TubaWidgetizableIface {
	GTypeInterface parent_iface;
	GtkWidget* (*to_widget) (TubaWidgetizable* self);
	void (*open) (TubaWidgetizable* self);
	void (*resolve_open) (TubaWidgetizable* self, TubaInstanceAccount* account);
};

struct _TubaWidgetsPreviewCardAuthorRow {
	GtkListBoxRow parent_instance;
	TubaWidgetsPreviewCardAuthorRowPrivate * priv;
};

struct _TubaWidgetsPreviewCardAuthorRowClass {
	GtkListBoxRowClass parent_class;
};

struct _TubaWidgetsPreviewCardAuthorRowPrivate {
	gchar* callback_url;
	TubaAPIAccount* callback_account;
};

static gint TubaWidgetsPreviewCard_private_offset;
static gpointer tuba_widgets_preview_card_parent_class = NULL;
static gint TubaWidgetsPreviewCardAuthorRow_private_offset;
static gpointer tuba_widgets_preview_card_author_row_parent_class = NULL;

VALA_EXTERN GType tuba_widgets_preview_card_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsPreviewCard, g_object_unref)
VALA_EXTERN GType tuba_widgets_preview_card_internal_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsPreviewCardInternal, g_object_unref)
VALA_EXTERN GType tuba_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaEntity, g_object_unref)
VALA_EXTERN GType tuba_api_preview_card_author_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIPreviewCardAuthorEntity, g_object_unref)
VALA_EXTERN GType tuba_api_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAccount, g_object_unref)
VALA_EXTERN GType tuba_api_preview_card_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIPreviewCard, g_object_unref)
VALA_EXTERN TubaWidgetsPreviewCard* tuba_widgets_preview_card_new (TubaAPIPreviewCard* card_obj);
VALA_EXTERN TubaWidgetsPreviewCard* tuba_widgets_preview_card_construct (GType object_type,
                                                             TubaAPIPreviewCard* card_obj);
VALA_EXTERN const gchar* tuba_api_preview_card_get_kind (TubaAPIPreviewCard* self);
VALA_EXTERN const gchar* tuba_api_preview_card_get_image (TubaAPIPreviewCard* self);
static Block94Data* block94_data_ref (Block94Data* _data94_);
static void block94_data_unref (void * _userdata_);
VALA_EXTERN void tuba_helper_image_request_paintable (const gchar* url,
                                          const gchar* blurhash,
                                          gboolean disable_cache,
                                          TubaHelperImageOnItemChangedFn cb,
                                          gpointer cb_target,
                                          GDestroyNotify cb_target_destroy_notify,
                                          GCancellable* cancellable);
VALA_EXTERN const gchar* tuba_api_preview_card_get_blurhash (TubaAPIPreviewCard* self);
static void ___lambda39_ (Block94Data* _data94_,
                   GdkPaintable* paintable);
static void ____lambda39__tuba_helper_image_on_item_changed_fn (GdkPaintable* data,
                                                         gpointer self);
VALA_EXTERN const gchar* tuba_api_preview_card_get_provider_name (TubaAPIPreviewCard* self);
VALA_EXTERN const gchar* tuba_api_preview_card_get_url (TubaAPIPreviewCard* self);
VALA_EXTERN const gchar* tuba_api_preview_card_get_title (TubaAPIPreviewCard* self);
VALA_EXTERN const gchar* tuba_api_preview_card_get_description (TubaAPIPreviewCard* self);
VALA_EXTERN GeeArrayList* tuba_api_preview_card_get_authors (TubaAPIPreviewCard* self);
VALA_EXTERN TubaAPIAccount* tuba_api_preview_card_author_entity_get_account (TubaAPIPreviewCardAuthorEntity* self);
VALA_EXTERN const gchar* tuba_api_account_get_display_name (TubaAPIAccount* self);
VALA_EXTERN GeeHashMap* tuba_api_account_get_emojis_map (TubaAPIAccount* self);
VALA_EXTERN GType tuba_widgets_rich_label_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsRichLabel, g_object_unref)
VALA_EXTERN TubaWidgetsRichLabel* tuba_widgets_rich_label_new_with_emojis (const gchar* text,
                                                               GeeHashMap* instance_emojis);
VALA_EXTERN TubaWidgetsRichLabel* tuba_widgets_rich_label_construct_with_emojis (GType object_type,
                                                                     const gchar* text,
                                                                     GeeHashMap* instance_emojis);
VALA_EXTERN void tuba_widgets_rich_label_set_use_markup (TubaWidgetsRichLabel* self,
                                             gboolean value);
VALA_EXTERN void tuba_widgets_rich_label_set_xalign (TubaWidgetsRichLabel* self,
                                         gfloat value);
static void tuba_widgets_preview_card_open_author (TubaWidgetsPreviewCard* self);
static void _tuba_widgets_preview_card_open_author_gtk_button_clicked (GtkButton* _sender,
                                                                gpointer self);
VALA_EXTERN const gchar* tuba_api_preview_card_author_entity_get_name (TubaAPIPreviewCardAuthorEntity* self);
VALA_EXTERN const gchar* tuba_api_preview_card_author_entity_get_url (TubaAPIPreviewCardAuthorEntity* self);
static void tuba_widgets_preview_card_open_authors (TubaWidgetsPreviewCard* self,
                                             GtkButton* btn);
static void _tuba_widgets_preview_card_open_authors_gtk_button_clicked (GtkButton* _sender,
                                                                 gpointer self);
VALA_EXTERN GType tuba_instance_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaInstanceAccount, g_object_unref)
VALA_EXTERN GType tuba_widgetizable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetizable, g_object_unref)
VALA_EXTERN void tuba_widgetizable_open (TubaWidgetizable* self);
VALA_EXTERN void tuba_utils_host_open_url (const gchar* _uri,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_);
VALA_EXTERN gboolean tuba_utils_host_open_url_finish (GAsyncResult* _res_);
static void tuba_widgets_preview_card_on_author_row_activated (TubaWidgetsPreviewCard* self,
                                                        GtkListBoxRow* row);
static void _tuba_widgets_preview_card_on_author_row_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                                    GtkListBoxRow* row,
                                                                                    gpointer self);
static TubaWidgetsPreviewCardAuthorRow* tuba_widgets_preview_card_author_row_new (TubaAPIPreviewCardAuthorEntity* author_entity);
static TubaWidgetsPreviewCardAuthorRow* tuba_widgets_preview_card_author_row_construct (GType object_type,
                                                                                 TubaAPIPreviewCardAuthorEntity* author_entity);
static GType tuba_widgets_preview_card_author_row_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsPreviewCardAuthorRow, g_object_unref)
static void tuba_widgets_preview_card_clear_authors_popover (TubaWidgetsPreviewCard* self);
static void _tuba_widgets_preview_card_clear_authors_popover_gtk_popover_closed (GtkPopover* _sender,
                                                                          gpointer self);
static void tuba_widgets_preview_card_author_row_open (TubaWidgetsPreviewCardAuthorRow* self);
VALA_EXTERN GType tuba_widgets_label_with_widgets_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsLabelWithWidgets, g_object_unref)
VALA_EXTERN GType tuba_widgets_emoji_label_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsEmojiLabel, g_object_unref)
VALA_EXTERN TubaWidgetsEmojiLabel* tuba_widgets_emoji_label_new (const gchar* text,
                                                     GeeHashMap* emojis);
VALA_EXTERN TubaWidgetsEmojiLabel* tuba_widgets_emoji_label_construct (GType object_type,
                                                           const gchar* text,
                                                           GeeHashMap* emojis);
VALA_EXTERN void tuba_widgets_label_with_widgets_set_use_markup (TubaWidgetsLabelWithWidgets* self,
                                                     gboolean value);
VALA_EXTERN void tuba_widgets_emoji_label_set_instance_emojis (TubaWidgetsEmojiLabel* self,
                                                   GeeHashMap* value);
VALA_EXTERN void tuba_widgets_emoji_label_set_content (TubaWidgetsEmojiLabel* self,
                                           const gchar* value);
static void tuba_widgets_preview_card_author_row_finalize (GObject * obj);
static GType tuba_widgets_preview_card_author_row_get_type_once (void);
static void tuba_widgets_preview_card_finalize (GObject * obj);
static GType tuba_widgets_preview_card_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
tuba_widgets_preview_card_get_instance_private (TubaWidgetsPreviewCard* self)
{
	return G_STRUCT_MEMBER_P (self, TubaWidgetsPreviewCard_private_offset);
}

static Block94Data*
block94_data_ref (Block94Data* _data94_)
{
	g_atomic_int_inc (&_data94_->_ref_count_);
	return _data94_;
}

static void
block94_data_unref (void * _userdata_)
{
	Block94Data* _data94_;
	_data94_ = (Block94Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data94_->_ref_count_)) {
		TubaWidgetsPreviewCard* self;
		self = _data94_->self;
		_g_object_unref0 (_data94_->image);
		_g_object_unref0 (self);
		g_slice_free (Block94Data, _data94_);
	}
}

static void
___lambda39_ (Block94Data* _data94_,
              GdkPaintable* paintable)
{
	TubaWidgetsPreviewCard* self;
	GtkPicture* _tmp0_;
	self = _data94_->self;
	_tmp0_ = _data94_->image;
	gtk_picture_set_paintable (_tmp0_, paintable);
}

static void
____lambda39__tuba_helper_image_on_item_changed_fn (GdkPaintable* data,
                                                    gpointer self)
{
	___lambda39_ (self, data);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static gchar*
string_replace (const gchar* self,
                const gchar* old,
                const gchar* replacement)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	if ((*((gchar*) self)) == '\0') {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = (*((gchar*) old)) == '\0';
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
	}
	if (_tmp0_) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (self);
		result = _tmp2_;
		return result;
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp3_ = g_regex_escape_string (old, -1);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		regex = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp8_ = regex;
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp10_ = _tmp7_;
		_tmp7_ = NULL;
		result = _tmp10_;
		_g_free0 (_tmp7_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		g_clear_error (&_inner_error0_);
		g_assert_not_reached ();
	}
	__finally0:
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
	g_clear_error (&_inner_error0_);
	return NULL;
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static void
_tuba_widgets_preview_card_open_author_gtk_button_clicked (GtkButton* _sender,
                                                           gpointer self)
{
	tuba_widgets_preview_card_open_author ((TubaWidgetsPreviewCard*) self);
}

static void
_tuba_widgets_preview_card_open_authors_gtk_button_clicked (GtkButton* _sender,
                                                            gpointer self)
{
	tuba_widgets_preview_card_open_authors ((TubaWidgetsPreviewCard*) self, _sender);
}

TubaWidgetsPreviewCard*
tuba_widgets_preview_card_construct (GType object_type,
                                     TubaAPIPreviewCard* card_obj)
{
	TubaWidgetsPreviewCard * self = NULL;
	gboolean is_video = FALSE;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GtkWidget* image_widget = NULL;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	TubaWidgetsPreviewCardInternal* _tmp32_;
	GtkWidget* _tmp33_;
	gchar* author = NULL;
	const gchar* _tmp34_;
	const gchar* _tmp35_;
	gchar* _tmp36_;
	const gchar* _tmp37_;
	TubaWidgetsPreviewCardInternal* _tmp47_;
	GtkLabel* _tmp48_;
	const gchar* _tmp49_;
	const gchar* _tmp50_;
	const gchar* _tmp51_;
	const gchar* _tmp64_;
	const gchar* _tmp65_;
	gboolean _tmp74_ = FALSE;
	GeeArrayList* _tmp75_;
	GeeArrayList* _tmp76_;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (card_obj != NULL, NULL);
	self = (TubaWidgetsPreviewCard*) g_object_new (object_type, NULL);
	_tmp0_ = tuba_api_preview_card_get_kind (card_obj);
	_tmp1_ = _tmp0_;
	is_video = g_strcmp0 (_tmp1_, "video") == 0;
	_tmp2_ = tuba_api_preview_card_get_image (card_obj);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != NULL) {
		Block94Data* _data94_;
		gchar* _tmp4_;
		gchar** _tmp5_;
		GtkPicture* _tmp6_ = NULL;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		_data94_ = g_slice_new0 (Block94Data);
		_data94_->_ref_count_ = 1;
		_data94_->self = g_object_ref (self);
		_tmp4_ = g_strdup ("preview_card_v");
		_tmp5_ = g_new0 (gchar*, 1 + 1);
		_tmp5_[0] = _tmp4_;
		_tmp6_ = (GtkPicture*) gtk_picture_new ();
		g_object_set ((GtkWidget*) _tmp6_, "width-request", 25, NULL);
		gtk_picture_set_content_fit (_tmp6_, GTK_CONTENT_FIT_COVER);
		gtk_widget_set_css_classes ((GtkWidget*) _tmp6_, _tmp5_);
		_tmp5_ = (_vala_array_free (_tmp5_, 1, (GDestroyNotify) g_free), NULL);
		g_object_ref_sink (_tmp6_);
		_data94_->image = _tmp6_;
		_tmp7_ = tuba_api_preview_card_get_image (card_obj);
		_tmp8_ = _tmp7_;
		_tmp9_ = tuba_api_preview_card_get_blurhash (card_obj);
		_tmp10_ = _tmp9_;
		tuba_helper_image_request_paintable (_tmp8_, _tmp10_, FALSE, ____lambda39__tuba_helper_image_on_item_changed_fn, block94_data_ref (_data94_), block94_data_unref, NULL);
		if (is_video) {
			GtkOverlay* overlay = NULL;
			GtkPicture* _tmp11_;
			GtkWidget* _tmp12_;
			GtkOverlay* _tmp13_ = NULL;
			GtkOverlay* _tmp14_;
			gchar* _tmp15_;
			gchar* _tmp16_;
			gchar* _tmp17_;
			gchar** _tmp18_;
			gchar* _tmp19_;
			GtkImage* _tmp20_ = NULL;
			GtkImage* _tmp21_;
			GtkOverlay* _tmp22_;
			GtkWidget* _tmp23_;
			_tmp11_ = _data94_->image;
			_tmp12_ = _g_object_ref0 ((GtkWidget*) _tmp11_);
			_tmp13_ = (GtkOverlay*) gtk_overlay_new ();
			gtk_widget_set_vexpand ((GtkWidget*) _tmp13_, TRUE);
			gtk_widget_set_hexpand ((GtkWidget*) _tmp13_, TRUE);
			gtk_overlay_set_child (_tmp13_, _tmp12_);
			_g_object_unref0 (_tmp12_);
			g_object_ref_sink (_tmp13_);
			overlay = _tmp13_;
			_tmp14_ = overlay;
			_tmp15_ = g_strdup ("osd");
			_tmp16_ = g_strdup ("tuba-circular");
			_tmp17_ = g_strdup ("min-size-64");
			_tmp18_ = g_new0 (gchar*, 3 + 1);
			_tmp18_[0] = _tmp15_;
			_tmp18_[1] = _tmp16_;
			_tmp18_[2] = _tmp17_;
			_tmp19_ = g_strdup ("media-playback-start-symbolic");
			_tmp20_ = (GtkImage*) gtk_image_new ();
			gtk_widget_set_valign ((GtkWidget*) _tmp20_, GTK_ALIGN_CENTER);
			gtk_widget_set_halign ((GtkWidget*) _tmp20_, GTK_ALIGN_CENTER);
			gtk_widget_set_css_classes ((GtkWidget*) _tmp20_, _tmp18_);
			_tmp18_ = (_vala_array_free (_tmp18_, 3, (GDestroyNotify) g_free), NULL);
			g_object_set (_tmp20_, "icon-name", _tmp19_, NULL);
			_g_free0 (_tmp19_);
			gtk_image_set_icon_size (_tmp20_, GTK_ICON_SIZE_LARGE);
			g_object_ref_sink (_tmp20_);
			_tmp21_ = _tmp20_;
			gtk_overlay_add_overlay (_tmp14_, (GtkWidget*) _tmp21_);
			_g_object_unref0 (_tmp21_);
			_tmp22_ = overlay;
			_tmp23_ = _g_object_ref0 ((GtkWidget*) _tmp22_);
			_g_object_unref0 (image_widget);
			image_widget = _tmp23_;
			_g_object_unref0 (overlay);
		} else {
			GtkPicture* _tmp24_;
			GtkWidget* _tmp25_;
			_tmp24_ = _data94_->image;
			_tmp25_ = _g_object_ref0 ((GtkWidget*) _tmp24_);
			_g_object_unref0 (image_widget);
			image_widget = _tmp25_;
		}
		block94_data_unref (_data94_);
		_data94_ = NULL;
	} else {
		const gchar* _tmp26_ = NULL;
		gchar* _tmp27_;
		gchar** _tmp28_;
		GtkImage* _tmp29_ = NULL;
		TubaWidgetsPreviewCardInternal* _tmp30_;
		TubaWidgetsPreviewCardInternal* _tmp31_;
		if (is_video) {
			_tmp26_ = "media-playback-start-symbolic";
		} else {
			_tmp26_ = "tuba-earth-symbolic";
		}
		_tmp27_ = g_strdup ("preview_card_h");
		_tmp28_ = g_new0 (gchar*, 1 + 1);
		_tmp28_[0] = _tmp27_;
		_tmp29_ = (GtkImage*) gtk_image_new_from_icon_name (_tmp26_);
		gtk_widget_set_css_classes ((GtkWidget*) _tmp29_, _tmp28_);
		_tmp28_ = (_vala_array_free (_tmp28_, 1, (GDestroyNotify) g_free), NULL);
		gtk_image_set_icon_size (_tmp29_, GTK_ICON_SIZE_LARGE);
		g_object_set ((GtkWidget*) _tmp29_, "height-request", 70, NULL);
		g_object_set ((GtkWidget*) _tmp29_, "width-request", 70, NULL);
		g_object_ref_sink (_tmp29_);
		_g_object_unref0 (image_widget);
		image_widget = (GtkWidget*) _tmp29_;
		_tmp30_ = self->priv->box;
		gtk_orientable_set_orientation ((GtkOrientable*) _tmp30_, GTK_ORIENTATION_HORIZONTAL);
		_tmp31_ = self->priv->box;
		gtk_box_set_homogeneous ((GtkBox*) _tmp31_, FALSE);
	}
	_tmp32_ = self->priv->box;
	_tmp33_ = image_widget;
	gtk_box_prepend ((GtkBox*) _tmp32_, _tmp33_);
	_tmp34_ = tuba_api_preview_card_get_provider_name (card_obj);
	_tmp35_ = _tmp34_;
	_tmp36_ = g_strdup (_tmp35_);
	author = _tmp36_;
	_tmp37_ = author;
	if (g_strcmp0 (_tmp37_, "") == 0) {
		{
			GUri* uri = NULL;
			const gchar* _tmp38_;
			const gchar* _tmp39_;
			GUri* _tmp40_;
			gchar* host = NULL;
			GUri* _tmp41_;
			const gchar* _tmp42_;
			gchar* _tmp43_;
			const gchar* _tmp44_;
			_tmp38_ = tuba_api_preview_card_get_url (card_obj);
			_tmp39_ = _tmp38_;
			_tmp40_ = g_uri_parse (_tmp39_, G_URI_FLAGS_NONE, &_inner_error0_);
			uri = _tmp40_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_tmp41_ = uri;
			_tmp42_ = g_uri_get_host (_tmp41_);
			_tmp43_ = g_strdup (_tmp42_);
			host = _tmp43_;
			_tmp44_ = host;
			if (_tmp44_ != NULL) {
				const gchar* _tmp45_;
				gchar* _tmp46_;
				_tmp45_ = host;
				_tmp46_ = g_strdup (_tmp45_);
				_g_free0 (author);
				author = _tmp46_;
			}
			_g_free0 (host);
			_g_uri_unref0 (uri);
		}
		goto __finally0;
		__catch0_g_error:
		{
			g_clear_error (&_inner_error0_);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (author);
			_g_object_unref0 (image_widget);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp47_ = self->priv->box;
	_tmp48_ = _tmp47_->author_label;
	_tmp49_ = author;
	gtk_label_set_label (_tmp48_, _tmp49_);
	_tmp50_ = tuba_api_preview_card_get_title (card_obj);
	_tmp51_ = _tmp50_;
	if (g_strcmp0 (_tmp51_, "") != 0) {
		TubaWidgetsPreviewCardInternal* _tmp52_;
		GtkLabel* _tmp53_;
		TubaWidgetsPreviewCardInternal* _tmp54_;
		GtkLabel* _tmp55_;
		const gchar* _tmp56_;
		const gchar* _tmp57_;
		gchar* _tmp58_;
		gchar* _tmp59_;
		gchar* _tmp60_;
		gchar* _tmp61_;
		TubaWidgetsPreviewCardInternal* _tmp62_;
		GtkLabel* _tmp63_;
		_tmp52_ = self->priv->box;
		_tmp53_ = _tmp52_->title_label;
		_tmp54_ = self->priv->box;
		_tmp55_ = _tmp54_->title_label;
		_tmp56_ = tuba_api_preview_card_get_title (card_obj);
		_tmp57_ = _tmp56_;
		_tmp58_ = string_replace (_tmp57_, "\n", " ");
		_tmp59_ = _tmp58_;
		_tmp60_ = string_strip (_tmp59_);
		_tmp61_ = _tmp60_;
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp55_, _tmp61_);
		gtk_label_set_label (_tmp53_, _tmp61_);
		_g_free0 (_tmp61_);
		_g_free0 (_tmp59_);
		_tmp62_ = self->priv->box;
		_tmp63_ = _tmp62_->title_label;
		gtk_widget_set_visible ((GtkWidget*) _tmp63_, TRUE);
	}
	_tmp64_ = tuba_api_preview_card_get_description (card_obj);
	_tmp65_ = _tmp64_;
	if (g_strcmp0 (_tmp65_, "") != 0) {
		TubaWidgetsPreviewCardInternal* _tmp66_;
		GtkLabel* _tmp67_;
		TubaWidgetsPreviewCardInternal* _tmp68_;
		GtkLabel* _tmp69_;
		const gchar* _tmp70_;
		const gchar* _tmp71_;
		TubaWidgetsPreviewCardInternal* _tmp72_;
		GtkLabel* _tmp73_;
		_tmp66_ = self->priv->box;
		_tmp67_ = _tmp66_->description_label;
		_tmp68_ = self->priv->box;
		_tmp69_ = _tmp68_->description_label;
		_tmp70_ = tuba_api_preview_card_get_description (card_obj);
		_tmp71_ = _tmp70_;
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp69_, _tmp71_);
		gtk_label_set_label (_tmp67_, _tmp71_);
		_tmp72_ = self->priv->box;
		_tmp73_ = _tmp72_->description_label;
		gtk_widget_set_visible ((GtkWidget*) _tmp73_, TRUE);
	}
	_tmp75_ = tuba_api_preview_card_get_authors (card_obj);
	_tmp76_ = _tmp75_;
	if (_tmp76_ != NULL) {
		GeeArrayList* _tmp77_;
		GeeArrayList* _tmp78_;
		gint _tmp79_;
		gint _tmp80_;
		_tmp77_ = tuba_api_preview_card_get_authors (card_obj);
		_tmp78_ = _tmp77_;
		_tmp79_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp78_);
		_tmp80_ = _tmp79_;
		_tmp74_ = _tmp80_ > 0;
	} else {
		_tmp74_ = FALSE;
	}
	if (_tmp74_) {
		gboolean should_add = FALSE;
		GtkWidget* more_from_button = NULL;
		gchar* _tmp81_;
		gchar* _tmp82_;
		gchar* _tmp83_;
		gchar** _tmp84_;
		GtkButton* _tmp85_ = NULL;
		GeeArrayList* _tmp86_;
		GeeArrayList* _tmp87_;
		gint _tmp88_;
		gint _tmp89_;
		should_add = TRUE;
		_tmp81_ = g_strdup ("flat");
		_tmp82_ = g_strdup ("verified-author");
		_tmp83_ = g_strdup ("font-small");
		_tmp84_ = g_new0 (gchar*, 3 + 1);
		_tmp84_[0] = _tmp81_;
		_tmp84_[1] = _tmp82_;
		_tmp84_[2] = _tmp83_;
		_tmp85_ = (GtkButton*) gtk_button_new ();
		gtk_widget_set_halign ((GtkWidget*) _tmp85_, GTK_ALIGN_START);
		gtk_widget_set_css_classes ((GtkWidget*) _tmp85_, _tmp84_);
		_tmp84_ = (_vala_array_free (_tmp84_, 3, (GDestroyNotify) g_free), NULL);
		g_object_ref_sink (_tmp85_);
		more_from_button = (GtkWidget*) _tmp85_;
		_tmp86_ = tuba_api_preview_card_get_authors (card_obj);
		_tmp87_ = _tmp86_;
		_tmp88_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp87_);
		_tmp89_ = _tmp88_;
		if (_tmp89_ == 1) {
			TubaAPIPreviewCardAuthorEntity* verified_author = NULL;
			GeeArrayList* _tmp90_;
			GeeArrayList* _tmp91_;
			gpointer _tmp92_;
			TubaAPIPreviewCardAuthorEntity* _tmp93_;
			TubaAPIAccount* _tmp94_;
			TubaAPIAccount* _tmp95_;
			_tmp90_ = tuba_api_preview_card_get_authors (card_obj);
			_tmp91_ = _tmp90_;
			_tmp92_ = gee_abstract_list_get ((GeeAbstractList*) _tmp91_, 0);
			verified_author = (TubaAPIPreviewCardAuthorEntity*) _tmp92_;
			_tmp93_ = verified_author;
			_tmp94_ = tuba_api_preview_card_author_entity_get_account (_tmp93_);
			_tmp95_ = _tmp94_;
			if (_tmp95_ != NULL) {
				GtkWidget* _tmp96_;
				TubaAPIPreviewCardAuthorEntity* _tmp97_;
				TubaAPIAccount* _tmp98_;
				TubaAPIAccount* _tmp99_;
				const gchar* _tmp100_;
				const gchar* _tmp101_;
				gchar* _tmp102_;
				gchar* _tmp103_;
				TubaAPIPreviewCardAuthorEntity* _tmp104_;
				TubaAPIAccount* _tmp105_;
				TubaAPIAccount* _tmp106_;
				GeeHashMap* _tmp107_;
				GeeHashMap* _tmp108_;
				GeeHashMap* _tmp109_;
				TubaWidgetsRichLabel* _tmp110_ = NULL;
				TubaWidgetsRichLabel* _tmp111_;
				TubaAPIPreviewCardAuthorEntity* _tmp112_;
				TubaAPIAccount* _tmp113_;
				TubaAPIAccount* _tmp114_;
				TubaAPIAccount* _tmp115_;
				GtkWidget* _tmp116_;
				_tmp96_ = more_from_button;
				_tmp97_ = verified_author;
				_tmp98_ = tuba_api_preview_card_author_entity_get_account (_tmp97_);
				_tmp99_ = _tmp98_;
				_tmp100_ = tuba_api_account_get_display_name (_tmp99_);
				_tmp101_ = _tmp100_;
				_tmp102_ = g_strdup_printf (_ ("By %s"), _tmp101_);
				_tmp103_ = _tmp102_;
				_tmp104_ = verified_author;
				_tmp105_ = tuba_api_preview_card_author_entity_get_account (_tmp104_);
				_tmp106_ = _tmp105_;
				_tmp107_ = tuba_api_account_get_emojis_map (_tmp106_);
				_tmp108_ = _tmp107_;
				_tmp109_ = _tmp108_;
				_tmp110_ = tuba_widgets_rich_label_new_with_emojis (_tmp103_, _tmp109_);
				tuba_widgets_rich_label_set_use_markup (_tmp110_, FALSE);
				tuba_widgets_rich_label_set_xalign (_tmp110_, 0.0f);
				g_object_ref_sink (_tmp110_);
				_tmp111_ = _tmp110_;
				gtk_button_set_child (G_TYPE_CHECK_INSTANCE_CAST (_tmp96_, gtk_button_get_type (), GtkButton), (GtkWidget*) _tmp111_);
				_g_object_unref0 (_tmp111_);
				_g_object_unref0 (_tmp109_);
				_g_free0 (_tmp103_);
				_tmp112_ = verified_author;
				_tmp113_ = tuba_api_preview_card_author_entity_get_account (_tmp112_);
				_tmp114_ = _tmp113_;
				_tmp115_ = _g_object_ref0 (_tmp114_);
				_g_object_unref0 (self->priv->author_account);
				self->priv->author_account = _tmp115_;
				_tmp116_ = more_from_button;
				g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp116_, gtk_button_get_type (), GtkButton), "clicked", (GCallback) _tuba_widgets_preview_card_open_author_gtk_button_clicked, self, 0);
			} else {
				gboolean _tmp117_ = FALSE;
				TubaAPIPreviewCardAuthorEntity* _tmp118_;
				const gchar* _tmp119_;
				const gchar* _tmp120_;
				_tmp118_ = verified_author;
				_tmp119_ = tuba_api_preview_card_author_entity_get_name (_tmp118_);
				_tmp120_ = _tmp119_;
				if (_tmp120_ != NULL) {
					TubaAPIPreviewCardAuthorEntity* _tmp121_;
					const gchar* _tmp122_;
					const gchar* _tmp123_;
					_tmp121_ = verified_author;
					_tmp122_ = tuba_api_preview_card_author_entity_get_name (_tmp121_);
					_tmp123_ = _tmp122_;
					_tmp117_ = g_strcmp0 (_tmp123_, "") != 0;
				} else {
					_tmp117_ = FALSE;
				}
				if (_tmp117_) {
					GtkLabel* verified_author_label = NULL;
					TubaAPIPreviewCardAuthorEntity* _tmp124_;
					const gchar* _tmp125_;
					const gchar* _tmp126_;
					gchar* _tmp127_;
					gchar* _tmp128_;
					GtkLabel* _tmp129_ = NULL;
					GtkLabel* _tmp130_;
					gboolean _tmp131_ = FALSE;
					TubaAPIPreviewCardAuthorEntity* _tmp132_;
					const gchar* _tmp133_;
					const gchar* _tmp134_;
					_tmp124_ = verified_author;
					_tmp125_ = tuba_api_preview_card_author_entity_get_name (_tmp124_);
					_tmp126_ = _tmp125_;
					_tmp127_ = g_strdup_printf (_ ("By %s"), _tmp126_);
					_tmp128_ = _tmp127_;
					_tmp129_ = (GtkLabel*) gtk_label_new (_tmp128_);
					gtk_label_set_xalign (_tmp129_, 0.0f);
					gtk_label_set_wrap (_tmp129_, TRUE);
					gtk_label_set_wrap_mode (_tmp129_, PANGO_WRAP_WORD_CHAR);
					g_object_ref_sink (_tmp129_);
					_tmp130_ = _tmp129_;
					_g_free0 (_tmp128_);
					verified_author_label = _tmp130_;
					_tmp132_ = verified_author;
					_tmp133_ = tuba_api_preview_card_author_entity_get_url (_tmp132_);
					_tmp134_ = _tmp133_;
					if (_tmp134_ == NULL) {
						_tmp131_ = TRUE;
					} else {
						TubaAPIPreviewCardAuthorEntity* _tmp135_;
						const gchar* _tmp136_;
						const gchar* _tmp137_;
						_tmp135_ = verified_author;
						_tmp136_ = tuba_api_preview_card_author_entity_get_url (_tmp135_);
						_tmp137_ = _tmp136_;
						_tmp131_ = g_strcmp0 (_tmp137_, "") == 0;
					}
					if (_tmp131_) {
						GtkLabel* _tmp138_;
						GtkWidget* _tmp139_;
						GtkWidget* _tmp140_;
						GtkWidget* _tmp141_;
						GtkWidget* _tmp142_;
						_tmp138_ = verified_author_label;
						_tmp139_ = _g_object_ref0 ((GtkWidget*) _tmp138_);
						_g_object_unref0 (more_from_button);
						more_from_button = _tmp139_;
						_tmp140_ = more_from_button;
						gtk_widget_add_css_class (_tmp140_, "font-bold");
						_tmp141_ = more_from_button;
						gtk_widget_add_css_class (_tmp141_, "verified-author");
						_tmp142_ = more_from_button;
						gtk_widget_add_css_class (_tmp142_, "font-small");
					} else {
						TubaAPIPreviewCardAuthorEntity* _tmp143_;
						const gchar* _tmp144_;
						const gchar* _tmp145_;
						gchar* _tmp146_;
						GtkWidget* _tmp147_;
						GtkLabel* _tmp148_;
						GtkWidget* _tmp149_;
						_tmp143_ = verified_author;
						_tmp144_ = tuba_api_preview_card_author_entity_get_url (_tmp143_);
						_tmp145_ = _tmp144_;
						_tmp146_ = g_strdup (_tmp145_);
						_g_free0 (self->priv->author_url);
						self->priv->author_url = _tmp146_;
						_tmp147_ = more_from_button;
						_tmp148_ = verified_author_label;
						gtk_button_set_child (G_TYPE_CHECK_INSTANCE_CAST (_tmp147_, gtk_button_get_type (), GtkButton), (GtkWidget*) _tmp148_);
						_tmp149_ = more_from_button;
						g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp149_, gtk_button_get_type (), GtkButton), "clicked", (GCallback) _tuba_widgets_preview_card_open_author_gtk_button_clicked, self, 0);
					}
					_g_object_unref0 (verified_author_label);
				} else {
					should_add = FALSE;
				}
			}
			_g_object_unref0 (verified_author);
		} else {
			GtkWidget* _tmp150_;
			GeeArrayList* _tmp151_;
			GeeArrayList* _tmp152_;
			gint _tmp153_;
			gint _tmp154_;
			GeeArrayList* _tmp155_;
			GeeArrayList* _tmp156_;
			gint _tmp157_;
			gint _tmp158_;
			gchar* _tmp159_;
			gchar* _tmp160_;
			gchar* _tmp161_;
			gchar** _tmp162_;
			GtkLabel* _tmp163_ = NULL;
			GtkLabel* _tmp164_;
			GeeArrayList* _tmp165_;
			GeeArrayList* _tmp166_;
			GeeArrayList* _tmp167_;
			GtkWidget* _tmp168_;
			_tmp150_ = more_from_button;
			_tmp151_ = tuba_api_preview_card_get_authors (card_obj);
			_tmp152_ = _tmp151_;
			_tmp153_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp152_);
			_tmp154_ = _tmp153_;
			_tmp155_ = tuba_api_preview_card_get_authors (card_obj);
			_tmp156_ = _tmp155_;
			_tmp157_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp156_);
			_tmp158_ = _tmp157_;
			_tmp159_ = g_strdup_printf (ngettext ("See %d author", "See all %d authors", (gulong) _tmp154_), _tmp158_);
			_tmp160_ = _tmp159_;
			_tmp161_ = g_strdup ("font-bold");
			_tmp162_ = g_new0 (gchar*, 1 + 1);
			_tmp162_[0] = _tmp161_;
			_tmp163_ = (GtkLabel*) gtk_label_new (_tmp160_);
			gtk_label_set_xalign (_tmp163_, 0.0f);
			gtk_label_set_wrap (_tmp163_, TRUE);
			gtk_label_set_wrap_mode (_tmp163_, PANGO_WRAP_WORD_CHAR);
			gtk_widget_set_css_classes ((GtkWidget*) _tmp163_, _tmp162_);
			_tmp162_ = (_vala_array_free (_tmp162_, 1, (GDestroyNotify) g_free), NULL);
			g_object_ref_sink (_tmp163_);
			_tmp164_ = _tmp163_;
			gtk_button_set_child (G_TYPE_CHECK_INSTANCE_CAST (_tmp150_, gtk_button_get_type (), GtkButton), (GtkWidget*) _tmp164_);
			_g_object_unref0 (_tmp164_);
			_g_free0 (_tmp160_);
			_tmp165_ = tuba_api_preview_card_get_authors (card_obj);
			_tmp166_ = _tmp165_;
			_tmp167_ = _g_object_ref0 (_tmp166_);
			_g_object_unref0 (self->priv->verified_authors);
			self->priv->verified_authors = _tmp167_;
			_tmp168_ = more_from_button;
			g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp168_, gtk_button_get_type (), GtkButton), "clicked", (GCallback) _tuba_widgets_preview_card_open_authors_gtk_button_clicked, self, 0);
		}
		if (should_add) {
			GtkWidget* _tmp169_;
			_tmp169_ = more_from_button;
			gtk_box_append ((GtkBox*) self, _tmp169_);
		}
		_g_object_unref0 (more_from_button);
	}
	_g_free0 (author);
	_g_object_unref0 (image_widget);
	return self;
}

TubaWidgetsPreviewCard*
tuba_widgets_preview_card_new (TubaAPIPreviewCard* card_obj)
{
	return tuba_widgets_preview_card_construct (TUBA_WIDGETS_TYPE_PREVIEW_CARD, card_obj);
}

static void
tuba_widgets_preview_card_open_author (TubaWidgetsPreviewCard* self)
{
	TubaAPIAccount* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->author_account;
	if (_tmp0_ != NULL) {
		TubaAPIAccount* _tmp1_;
		_tmp1_ = self->priv->author_account;
		tuba_widgetizable_open ((TubaWidgetizable*) _tmp1_);
	} else {
		gboolean _tmp2_ = FALSE;
		const gchar* _tmp3_;
		_tmp3_ = self->priv->author_url;
		if (_tmp3_ != NULL) {
			const gchar* _tmp4_;
			_tmp4_ = self->priv->author_url;
			_tmp2_ = g_strcmp0 (_tmp4_, "") != 0;
		} else {
			_tmp2_ = FALSE;
		}
		if (_tmp2_) {
			const gchar* _tmp5_;
			_tmp5_ = self->priv->author_url;
			tuba_utils_host_open_url (_tmp5_, NULL, NULL);
		}
	}
}

static void
_tuba_widgets_preview_card_on_author_row_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                               GtkListBoxRow* row,
                                                                               gpointer self)
{
	tuba_widgets_preview_card_on_author_row_activated ((TubaWidgetsPreviewCard*) self, row);
}

static void
_tuba_widgets_preview_card_clear_authors_popover_gtk_popover_closed (GtkPopover* _sender,
                                                                     gpointer self)
{
	tuba_widgets_preview_card_clear_authors_popover ((TubaWidgetsPreviewCard*) self);
}

static void
tuba_widgets_preview_card_open_authors (TubaWidgetsPreviewCard* self,
                                        GtkButton* btn)
{
	GtkPopover* _tmp0_;
	GtkListBox* listbox = NULL;
	gchar* _tmp1_;
	gchar** _tmp2_;
	GtkListBox* _tmp3_ = NULL;
	GtkListBox* _tmp4_;
	GtkListBox* _tmp28_;
	GtkWidget* _tmp29_;
	GtkScrolledWindow* _tmp30_ = NULL;
	GtkPopover* _tmp31_ = NULL;
	GtkPopover* _tmp32_;
	GtkPopover* _tmp33_;
	GtkPopover* _tmp34_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (btn != NULL);
	_tmp0_ = self->priv->authors_popover;
	if (_tmp0_ != NULL) {
		return;
	}
	_tmp1_ = g_strdup ("background-none");
	_tmp2_ = g_new0 (gchar*, 1 + 1);
	_tmp2_[0] = _tmp1_;
	_tmp3_ = (GtkListBox*) gtk_list_box_new ();
	gtk_list_box_set_selection_mode (_tmp3_, GTK_SELECTION_NONE);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp3_, _tmp2_);
	_tmp2_ = (_vala_array_free (_tmp2_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp3_);
	listbox = _tmp3_;
	_tmp4_ = listbox;
	g_signal_connect_object (_tmp4_, "row-activated", (GCallback) _tuba_widgets_preview_card_on_author_row_activated_gtk_list_box_row_activated, self, 0);
	{
		GeeArrayList* _author_list = NULL;
		GeeArrayList* _tmp5_;
		gint _author_size = 0;
		GeeArrayList* _tmp6_;
		gint _tmp7_;
		gint _tmp8_;
		gint _author_index = 0;
		_tmp5_ = self->priv->verified_authors;
		_author_list = _tmp5_;
		_tmp6_ = _author_list;
		_tmp7_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp6_);
		_tmp8_ = _tmp7_;
		_author_size = _tmp8_;
		_author_index = -1;
		while (TRUE) {
			gint _tmp9_;
			gint _tmp10_;
			TubaAPIPreviewCardAuthorEntity* author = NULL;
			GeeArrayList* _tmp11_;
			gpointer _tmp12_;
			gboolean _tmp13_ = FALSE;
			TubaAPIPreviewCardAuthorEntity* _tmp14_;
			TubaAPIAccount* _tmp15_;
			TubaAPIAccount* _tmp16_;
			_author_index = _author_index + 1;
			_tmp9_ = _author_index;
			_tmp10_ = _author_size;
			if (!(_tmp9_ < _tmp10_)) {
				break;
			}
			_tmp11_ = _author_list;
			_tmp12_ = gee_abstract_list_get ((GeeAbstractList*) _tmp11_, _author_index);
			author = (TubaAPIPreviewCardAuthorEntity*) _tmp12_;
			_tmp14_ = author;
			_tmp15_ = tuba_api_preview_card_author_entity_get_account (_tmp14_);
			_tmp16_ = _tmp15_;
			if (_tmp16_ != NULL) {
				_tmp13_ = TRUE;
			} else {
				gboolean _tmp17_ = FALSE;
				TubaAPIPreviewCardAuthorEntity* _tmp18_;
				const gchar* _tmp19_;
				const gchar* _tmp20_;
				_tmp18_ = author;
				_tmp19_ = tuba_api_preview_card_author_entity_get_name (_tmp18_);
				_tmp20_ = _tmp19_;
				if (_tmp20_ != NULL) {
					TubaAPIPreviewCardAuthorEntity* _tmp21_;
					const gchar* _tmp22_;
					const gchar* _tmp23_;
					_tmp21_ = author;
					_tmp22_ = tuba_api_preview_card_author_entity_get_name (_tmp21_);
					_tmp23_ = _tmp22_;
					_tmp17_ = g_strcmp0 (_tmp23_, "") != 0;
				} else {
					_tmp17_ = FALSE;
				}
				_tmp13_ = _tmp17_;
			}
			if (_tmp13_) {
				GtkListBox* _tmp24_;
				TubaAPIPreviewCardAuthorEntity* _tmp25_;
				TubaWidgetsPreviewCardAuthorRow* _tmp26_;
				TubaWidgetsPreviewCardAuthorRow* _tmp27_;
				_tmp24_ = listbox;
				_tmp25_ = author;
				_tmp26_ = tuba_widgets_preview_card_author_row_new (_tmp25_);
				g_object_ref_sink (_tmp26_);
				_tmp27_ = _tmp26_;
				gtk_list_box_append (_tmp24_, (GtkWidget*) _tmp27_);
				_g_object_unref0 (_tmp27_);
			}
			_g_object_unref0 (author);
		}
	}
	_tmp28_ = listbox;
	_tmp29_ = _g_object_ref0 ((GtkWidget*) _tmp28_);
	_tmp30_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	gtk_scrolled_window_set_child (_tmp30_, _tmp29_);
	_g_object_unref0 (_tmp29_);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp30_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp30_, TRUE);
	g_object_set (_tmp30_, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	gtk_scrolled_window_set_max_content_height (_tmp30_, 500);
	g_object_set ((GtkWidget*) _tmp30_, "width-request", 360, NULL);
	gtk_scrolled_window_set_propagate_natural_height (_tmp30_, TRUE);
	g_object_ref_sink (_tmp30_);
	_tmp31_ = (GtkPopover*) gtk_popover_new ();
	gtk_popover_set_child (_tmp31_, (GtkWidget*) _tmp30_);
	_g_object_unref0 (_tmp30_);
	g_object_ref_sink (_tmp31_);
	_g_object_unref0 (self->priv->authors_popover);
	self->priv->authors_popover = _tmp31_;
	_tmp32_ = self->priv->authors_popover;
	g_signal_connect_object (_tmp32_, "closed", (GCallback) _tuba_widgets_preview_card_clear_authors_popover_gtk_popover_closed, self, 0);
	_tmp33_ = self->priv->authors_popover;
	gtk_widget_set_parent ((GtkWidget*) _tmp33_, (GtkWidget*) btn);
	_tmp34_ = self->priv->authors_popover;
	gtk_popover_popup (_tmp34_);
	_g_object_unref0 (listbox);
}

static void
tuba_widgets_preview_card_clear_authors_popover (TubaWidgetsPreviewCard* self)
{
	GtkPopover* _tmp0_;
	GtkPopover* _tmp1_;
	GtkPopover* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->authors_popover;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->authors_popover;
	gtk_widget_unparent ((GtkWidget*) _tmp1_);
	_tmp2_ = self->priv->authors_popover;
	g_object_run_dispose ((GObject*) _tmp2_);
	_g_object_unref0 (self->priv->authors_popover);
	self->priv->authors_popover = NULL;
}

static void
tuba_widgets_preview_card_on_author_row_activated (TubaWidgetsPreviewCard* self,
                                                   GtkListBoxRow* row)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (row != NULL);
	tuba_widgets_preview_card_clear_authors_popover (self);
	tuba_widgets_preview_card_author_row_open (G_TYPE_CHECK_INSTANCE_CAST (row, TUBA_WIDGETS_PREVIEW_CARD_TYPE_AUTHOR_ROW, TubaWidgetsPreviewCardAuthorRow));
}

static inline gpointer
tuba_widgets_preview_card_author_row_get_instance_private (TubaWidgetsPreviewCardAuthorRow* self)
{
	return G_STRUCT_MEMBER_P (self, TubaWidgetsPreviewCardAuthorRow_private_offset);
}

static TubaWidgetsPreviewCardAuthorRow*
tuba_widgets_preview_card_author_row_construct (GType object_type,
                                                TubaAPIPreviewCardAuthorEntity* author_entity)
{
	TubaWidgetsPreviewCardAuthorRow * self = NULL;
	TubaAPIAccount* _tmp0_;
	TubaAPIAccount* _tmp1_;
	g_return_val_if_fail (author_entity != NULL, NULL);
	self = (TubaWidgetsPreviewCardAuthorRow*) g_object_new (object_type, NULL);
	_tmp0_ = tuba_api_preview_card_author_entity_get_account (author_entity);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		TubaWidgetsEmojiLabel* widget = NULL;
		TubaWidgetsEmojiLabel* _tmp2_ = NULL;
		TubaWidgetsEmojiLabel* _tmp3_;
		TubaAPIAccount* _tmp4_;
		TubaAPIAccount* _tmp5_;
		GeeHashMap* _tmp6_;
		GeeHashMap* _tmp7_;
		GeeHashMap* _tmp8_;
		TubaWidgetsEmojiLabel* _tmp9_;
		TubaAPIAccount* _tmp10_;
		TubaAPIAccount* _tmp11_;
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		TubaWidgetsEmojiLabel* _tmp14_;
		TubaAPIAccount* _tmp15_;
		TubaAPIAccount* _tmp16_;
		TubaAPIAccount* _tmp17_;
		TubaAPIAccount* _tmp18_;
		_tmp2_ = tuba_widgets_emoji_label_new (NULL, NULL);
		tuba_widgets_label_with_widgets_set_use_markup ((TubaWidgetsLabelWithWidgets*) _tmp2_, FALSE);
		gtk_widget_set_margin_top ((GtkWidget*) _tmp2_, 8);
		gtk_widget_set_margin_start ((GtkWidget*) _tmp2_, 8);
		gtk_widget_set_margin_end ((GtkWidget*) _tmp2_, 8);
		gtk_widget_set_margin_bottom ((GtkWidget*) _tmp2_, 8);
		g_object_ref_sink (_tmp2_);
		widget = _tmp2_;
		_tmp3_ = widget;
		_tmp4_ = tuba_api_preview_card_author_entity_get_account (author_entity);
		_tmp5_ = _tmp4_;
		_tmp6_ = tuba_api_account_get_emojis_map (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = _tmp7_;
		tuba_widgets_emoji_label_set_instance_emojis (_tmp3_, _tmp8_);
		_g_object_unref0 (_tmp8_);
		_tmp9_ = widget;
		_tmp10_ = tuba_api_preview_card_author_entity_get_account (author_entity);
		_tmp11_ = _tmp10_;
		_tmp12_ = tuba_api_account_get_display_name (_tmp11_);
		_tmp13_ = _tmp12_;
		tuba_widgets_emoji_label_set_content (_tmp9_, _tmp13_);
		_tmp14_ = widget;
		gtk_list_box_row_set_child ((GtkListBoxRow*) self, (GtkWidget*) _tmp14_);
		_tmp15_ = tuba_api_preview_card_author_entity_get_account (author_entity);
		_tmp16_ = _tmp15_;
		_tmp17_ = _g_object_ref0 (_tmp16_);
		_g_object_unref0 (self->priv->callback_account);
		self->priv->callback_account = _tmp17_;
		_tmp18_ = self->priv->callback_account;
		gtk_list_box_row_set_activatable ((GtkListBoxRow*) self, _tmp18_ != NULL);
		_g_object_unref0 (widget);
	} else {
		GtkLabel* widget = NULL;
		const gchar* _tmp19_;
		const gchar* _tmp20_;
		GtkLabel* _tmp21_ = NULL;
		GtkLabel* _tmp22_;
		const gchar* _tmp23_;
		const gchar* _tmp24_;
		gchar* _tmp25_;
		gboolean _tmp26_ = FALSE;
		const gchar* _tmp27_;
		_tmp19_ = tuba_api_preview_card_author_entity_get_name (author_entity);
		_tmp20_ = _tmp19_;
		_tmp21_ = (GtkLabel*) gtk_label_new (_tmp20_);
		gtk_label_set_xalign (_tmp21_, 0.0f);
		gtk_label_set_wrap (_tmp21_, TRUE);
		gtk_label_set_wrap_mode (_tmp21_, PANGO_WRAP_WORD_CHAR);
		gtk_widget_set_margin_top ((GtkWidget*) _tmp21_, 8);
		gtk_widget_set_margin_start ((GtkWidget*) _tmp21_, 8);
		gtk_widget_set_margin_end ((GtkWidget*) _tmp21_, 8);
		gtk_widget_set_margin_bottom ((GtkWidget*) _tmp21_, 8);
		g_object_ref_sink (_tmp21_);
		widget = _tmp21_;
		_tmp22_ = widget;
		gtk_list_box_row_set_child ((GtkListBoxRow*) self, (GtkWidget*) _tmp22_);
		_tmp23_ = tuba_api_preview_card_author_entity_get_url (author_entity);
		_tmp24_ = _tmp23_;
		_tmp25_ = g_strdup (_tmp24_);
		_g_free0 (self->priv->callback_url);
		self->priv->callback_url = _tmp25_;
		_tmp27_ = self->priv->callback_url;
		if (_tmp27_ != NULL) {
			const gchar* _tmp28_;
			_tmp28_ = self->priv->callback_url;
			_tmp26_ = g_strcmp0 (_tmp28_, "") != 0;
		} else {
			_tmp26_ = FALSE;
		}
		gtk_list_box_row_set_activatable ((GtkListBoxRow*) self, _tmp26_);
		_g_object_unref0 (widget);
	}
	return self;
}

static TubaWidgetsPreviewCardAuthorRow*
tuba_widgets_preview_card_author_row_new (TubaAPIPreviewCardAuthorEntity* author_entity)
{
	return tuba_widgets_preview_card_author_row_construct (TUBA_WIDGETS_PREVIEW_CARD_TYPE_AUTHOR_ROW, author_entity);
}

static void
tuba_widgets_preview_card_author_row_open (TubaWidgetsPreviewCardAuthorRow* self)
{
	TubaAPIAccount* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->callback_account;
	if (_tmp0_ != NULL) {
		TubaAPIAccount* _tmp1_;
		_tmp1_ = self->priv->callback_account;
		tuba_widgetizable_open ((TubaWidgetizable*) _tmp1_);
	} else {
		gboolean _tmp2_ = FALSE;
		const gchar* _tmp3_;
		_tmp3_ = self->priv->callback_url;
		if (_tmp3_ != NULL) {
			const gchar* _tmp4_;
			_tmp4_ = self->priv->callback_url;
			_tmp2_ = g_strcmp0 (_tmp4_, "") != 0;
		} else {
			_tmp2_ = FALSE;
		}
		if (_tmp2_) {
			const gchar* _tmp5_;
			_tmp5_ = self->priv->callback_url;
			tuba_utils_host_open_url (_tmp5_, NULL, NULL);
		}
	}
}

static void
tuba_widgets_preview_card_author_row_class_init (TubaWidgetsPreviewCardAuthorRowClass * klass,
                                                 gpointer klass_data)
{
	tuba_widgets_preview_card_author_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaWidgetsPreviewCardAuthorRow_private_offset);
	G_OBJECT_CLASS (klass)->finalize = tuba_widgets_preview_card_author_row_finalize;
}

static void
tuba_widgets_preview_card_author_row_instance_init (TubaWidgetsPreviewCardAuthorRow * self,
                                                    gpointer klass)
{
	self->priv = tuba_widgets_preview_card_author_row_get_instance_private (self);
	self->priv->callback_url = NULL;
	self->priv->callback_account = NULL;
}

static void
tuba_widgets_preview_card_author_row_finalize (GObject * obj)
{
	TubaWidgetsPreviewCardAuthorRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_PREVIEW_CARD_TYPE_AUTHOR_ROW, TubaWidgetsPreviewCardAuthorRow);
	_g_free0 (self->priv->callback_url);
	_g_object_unref0 (self->priv->callback_account);
	G_OBJECT_CLASS (tuba_widgets_preview_card_author_row_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_widgets_preview_card_author_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaWidgetsPreviewCardAuthorRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_widgets_preview_card_author_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaWidgetsPreviewCardAuthorRow), 0, (GInstanceInitFunc) tuba_widgets_preview_card_author_row_instance_init, NULL };
	GType tuba_widgets_preview_card_author_row_type_id;
	tuba_widgets_preview_card_author_row_type_id = g_type_register_static (gtk_list_box_row_get_type (), "TubaWidgetsPreviewCardAuthorRow", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaWidgetsPreviewCardAuthorRow_private_offset = g_type_add_instance_private (tuba_widgets_preview_card_author_row_type_id, sizeof (TubaWidgetsPreviewCardAuthorRowPrivate));
	return tuba_widgets_preview_card_author_row_type_id;
}

static GType
tuba_widgets_preview_card_author_row_get_type (void)
{
	static GType tuba_widgets_preview_card_author_row_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_widgets_preview_card_author_row_type_id__once)) {
		GType tuba_widgets_preview_card_author_row_type_id;
		tuba_widgets_preview_card_author_row_type_id = tuba_widgets_preview_card_author_row_get_type_once ();
		g_once_init_leave_pointer (&tuba_widgets_preview_card_author_row_type_id__once, tuba_widgets_preview_card_author_row_type_id);
	}
	return tuba_widgets_preview_card_author_row_type_id__once;
}

static void
tuba_widgets_preview_card_class_init (TubaWidgetsPreviewCardClass * klass,
                                      gpointer klass_data)
{
	tuba_widgets_preview_card_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaWidgetsPreviewCard_private_offset);
	G_OBJECT_CLASS (klass)->finalize = tuba_widgets_preview_card_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/dev/geopjr/Tuba/ui/widgets/preview_card.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "button", FALSE, G_STRUCT_OFFSET (TubaWidgetsPreviewCard, button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "box", FALSE, TubaWidgetsPreviewCard_private_offset + G_STRUCT_OFFSET (TubaWidgetsPreviewCardPrivate, box));
	g_type_ensure (TUBA_WIDGETS_TYPE_PREVIEW_CARD_INTERNAL);
}

static void
tuba_widgets_preview_card_instance_init (TubaWidgetsPreviewCard * self,
                                         gpointer klass)
{
	self->priv = tuba_widgets_preview_card_get_instance_private (self);
	self->priv->verified_authors = NULL;
	self->priv->author_url = NULL;
	self->priv->author_account = NULL;
	self->priv->authors_popover = NULL;
	g_type_ensure (TUBA_WIDGETS_TYPE_PREVIEW_CARD_INTERNAL);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
tuba_widgets_preview_card_finalize (GObject * obj)
{
	TubaWidgetsPreviewCard * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_TYPE_PREVIEW_CARD, TubaWidgetsPreviewCard);
	g_debug ("PreviewCard.vala:4: Destroying PreviewCard");
	_g_object_unref0 (self->priv->verified_authors);
	_g_free0 (self->priv->author_url);
	_g_object_unref0 (self->priv->author_account);
	_g_object_unref0 (self->priv->authors_popover);
	G_OBJECT_CLASS (tuba_widgets_preview_card_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_widgets_preview_card_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaWidgetsPreviewCardClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_widgets_preview_card_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaWidgetsPreviewCard), 0, (GInstanceInitFunc) tuba_widgets_preview_card_instance_init, NULL };
	GType tuba_widgets_preview_card_type_id;
	tuba_widgets_preview_card_type_id = g_type_register_static (gtk_box_get_type (), "TubaWidgetsPreviewCard", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaWidgetsPreviewCard_private_offset = g_type_add_instance_private (tuba_widgets_preview_card_type_id, sizeof (TubaWidgetsPreviewCardPrivate));
	return tuba_widgets_preview_card_type_id;
}

GType
tuba_widgets_preview_card_get_type (void)
{
	static GType tuba_widgets_preview_card_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_widgets_preview_card_type_id__once)) {
		GType tuba_widgets_preview_card_type_id;
		tuba_widgets_preview_card_type_id = tuba_widgets_preview_card_get_type_once ();
		g_once_init_leave_pointer (&tuba_widgets_preview_card_type_id__once, tuba_widgets_preview_card_type_id);
	}
	return tuba_widgets_preview_card_type_id__once;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

