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

#include <adwaita.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include <json-glib/json-glib.h>
#include <libsoup/soup.h>
#include <gee.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_VIEWS_ADMIN_PAGE_TYPE_BASE (tuba_views_admin_page_base_get_type ())
#define TUBA_VIEWS_ADMIN_PAGE_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_ADMIN_PAGE_TYPE_BASE, TubaViewsAdminPageBase))
#define TUBA_VIEWS_ADMIN_PAGE_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_ADMIN_PAGE_TYPE_BASE, TubaViewsAdminPageBaseClass))
#define TUBA_VIEWS_ADMIN_PAGE_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_ADMIN_PAGE_TYPE_BASE))
#define TUBA_VIEWS_ADMIN_PAGE_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_ADMIN_PAGE_TYPE_BASE))
#define TUBA_VIEWS_ADMIN_PAGE_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_ADMIN_PAGE_TYPE_BASE, TubaViewsAdminPageBaseClass))

typedef struct _TubaViewsAdminPageBase TubaViewsAdminPageBase;
typedef struct _TubaViewsAdminPageBaseClass TubaViewsAdminPageBaseClass;
typedef struct _TubaViewsAdminPageBasePrivate TubaViewsAdminPageBasePrivate;

#define TUBA_VIEWS_ADMIN_PAGE_TYPE_DASHBOARD (tuba_views_admin_page_dashboard_get_type ())
#define TUBA_VIEWS_ADMIN_PAGE_DASHBOARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_ADMIN_PAGE_TYPE_DASHBOARD, TubaViewsAdminPageDashboard))
#define TUBA_VIEWS_ADMIN_PAGE_DASHBOARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_ADMIN_PAGE_TYPE_DASHBOARD, TubaViewsAdminPageDashboardClass))
#define TUBA_VIEWS_ADMIN_PAGE_IS_DASHBOARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_ADMIN_PAGE_TYPE_DASHBOARD))
#define TUBA_VIEWS_ADMIN_PAGE_IS_DASHBOARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_ADMIN_PAGE_TYPE_DASHBOARD))
#define TUBA_VIEWS_ADMIN_PAGE_DASHBOARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_ADMIN_PAGE_TYPE_DASHBOARD, TubaViewsAdminPageDashboardClass))

typedef struct _TubaViewsAdminPageDashboard TubaViewsAdminPageDashboard;
typedef struct _TubaViewsAdminPageDashboardClass TubaViewsAdminPageDashboardClass;
typedef struct _TubaViewsAdminPageDashboardPrivate TubaViewsAdminPageDashboardPrivate;
enum  {
	TUBA_VIEWS_ADMIN_PAGE_DASHBOARD_0_PROPERTY,
	TUBA_VIEWS_ADMIN_PAGE_DASHBOARD_NUM_PROPERTIES
};
static GParamSpec* tuba_views_admin_page_dashboard_properties[TUBA_VIEWS_ADMIN_PAGE_DASHBOARD_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))
typedef struct _Block84Data Block84Data;

#define TUBA_TYPE_REQUEST_V2 (tuba_request_v2_get_type ())
#define TUBA_REQUEST_V2(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_REQUEST_V2, TubaRequestV2))
#define TUBA_REQUEST_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_REQUEST_V2, TubaRequestV2Class))
#define TUBA_IS_REQUEST_V2(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_REQUEST_V2))
#define TUBA_IS_REQUEST_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_REQUEST_V2))
#define TUBA_REQUEST_V2_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_REQUEST_V2, TubaRequestV2Class))

typedef struct _TubaRequestV2 TubaRequestV2;
typedef struct _TubaRequestV2Class TubaRequestV2Class;
typedef enum  {
	TUBA_REQUEST_V2_METHOD_GET,
	TUBA_REQUEST_V2_METHOD_POST,
	TUBA_REQUEST_V2_METHOD_PUT,
	TUBA_REQUEST_V2_METHOD_DELETE,
	TUBA_REQUEST_V2_METHOD_PATCH
} TubaRequestV2Method;

#define TUBA_REQUEST_V2_TYPE_METHOD (tuba_request_v2_method_get_type ())

#define TUBA_TYPE_ACCOUNT_STORE (tuba_account_store_get_type ())
#define TUBA_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStore))
#define TUBA_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStoreClass))
#define TUBA_IS_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ACCOUNT_STORE))
#define TUBA_IS_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ACCOUNT_STORE))
#define TUBA_ACCOUNT_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStoreClass))

typedef struct _TubaAccountStore TubaAccountStore;
typedef struct _TubaAccountStoreClass TubaAccountStoreClass;

#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_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;

#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_TYPE_OOPSIE (tuba_oopsie_get_type ())
typedef void (*TubaNetworkNodeCallback) (JsonNode* node, gpointer user_data, GError** error);

#define TUBA_API_ADMIN_TYPE_DIMENSION (tuba_api_admin_dimension_get_type ())
#define TUBA_API_ADMIN_DIMENSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_ADMIN_TYPE_DIMENSION, TubaAPIAdminDimension))
#define TUBA_API_ADMIN_DIMENSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_ADMIN_TYPE_DIMENSION, TubaAPIAdminDimensionClass))
#define TUBA_API_ADMIN_IS_DIMENSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_ADMIN_TYPE_DIMENSION))
#define TUBA_API_ADMIN_IS_DIMENSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_ADMIN_TYPE_DIMENSION))
#define TUBA_API_ADMIN_DIMENSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_ADMIN_TYPE_DIMENSION, TubaAPIAdminDimensionClass))

typedef struct _TubaAPIAdminDimension TubaAPIAdminDimension;
typedef struct _TubaAPIAdminDimensionClass TubaAPIAdminDimensionClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _TubaViewsAdminPageDashboardPopulateStatRealData TubaViewsAdminPageDashboardPopulateStatRealData;
typedef struct _Block85Data Block85Data;
typedef struct _Block86Data Block86Data;

#define TUBA_API_ADMIN_DIMENSION_TYPE_DATA (tuba_api_admin_dimension_data_get_type ())
#define TUBA_API_ADMIN_DIMENSION_DATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_ADMIN_DIMENSION_TYPE_DATA, TubaAPIAdminDimensionData))
#define TUBA_API_ADMIN_DIMENSION_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_ADMIN_DIMENSION_TYPE_DATA, TubaAPIAdminDimensionDataClass))
#define TUBA_API_ADMIN_DIMENSION_IS_DATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_ADMIN_DIMENSION_TYPE_DATA))
#define TUBA_API_ADMIN_DIMENSION_IS_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_ADMIN_DIMENSION_TYPE_DATA))
#define TUBA_API_ADMIN_DIMENSION_DATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_ADMIN_DIMENSION_TYPE_DATA, TubaAPIAdminDimensionDataClass))

typedef struct _TubaAPIAdminDimensionData TubaAPIAdminDimensionData;
typedef struct _TubaAPIAdminDimensionDataClass TubaAPIAdminDimensionDataClass;
typedef struct _TubaViewsAdminPageDashboardDoDimensionRequestRealData TubaViewsAdminPageDashboardDoDimensionRequestRealData;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))

struct _TubaViewsAdminPageBase {
	AdwNavigationPage parent_instance;
	TubaViewsAdminPageBasePrivate * priv;
	AdwHeaderBar* headerbar;
	AdwToolbarView* toolbar_view;
};

struct _TubaViewsAdminPageBaseClass {
	AdwNavigationPageClass parent_class;
	void (*add_to_page) (TubaViewsAdminPageBase* self, AdwPreferencesGroup* group);
};

struct _TubaViewsAdminPageDashboard {
	TubaViewsAdminPageBase parent_instance;
	TubaViewsAdminPageDashboardPrivate * priv;
};

struct _TubaViewsAdminPageDashboardClass {
	TubaViewsAdminPageBaseClass parent_class;
};

struct _TubaViewsAdminPageDashboardPrivate {
	AdwPreferencesGroup* stats_group;
	gchar** titles;
	gint titles_length1;
	gint _titles_size_;
	gint requests;
};

struct _Block84Data {
	int _ref_count_;
	TubaViewsAdminPageDashboard* self;
	gchar* key;
	gchar* title;
	gint next_i;
	gpointer _async_data_;
};

typedef enum  {
	TUBA_OOPSIE_USER,
	TUBA_OOPSIE_PARSING,
	TUBA_OOPSIE_INSTANCE,
	TUBA_OOPSIE_INTERNAL,
	TUBA_OOPSIE_HTTP_401 = 401,
	TUBA_OOPSIE_HTTP_403 = 403,
	TUBA_OOPSIE_HTTP_404 = 404,
	TUBA_OOPSIE_HTTP_410 = 410,
	TUBA_OOPSIE_HTTP_422 = 422,
	TUBA_OOPSIE_HTTP_429 = 429,
	TUBA_OOPSIE_HTTP_500 = 500,
	TUBA_OOPSIE_HTTP_503 = 503
} TubaOopsie;
#define TUBA_OOPSIE tuba_oopsie_quark ()

struct _TubaViewsAdminPageDashboardPopulateStatRealData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaViewsAdminPageDashboard* self;
	gchar* key;
	gchar* title;
	gint next_i;
	Block84Data* _data84_;
	TubaRequestV2* req;
	TubaAccountStore* _tmp0_;
	TubaInstanceAccount* _tmp1_;
	TubaInstanceAccount* _tmp2_;
	TubaInstanceAccount* _tmp3_;
	TubaRequestV2* _tmp4_;
	TubaRequestV2* _tmp5_;
	JsonBuilder* _tmp6_;
	JsonBuilder* _tmp7_;
	GInputStream* in_stream;
	TubaRequestV2* _tmp8_;
	GInputStream* _tmp9_;
	JsonParser* parser;
	GInputStream* _tmp10_;
	JsonParser* _tmp11_;
	JsonParser* _tmp12_;
	GError* e;
	GError* _tmp13_;
	const gchar* _tmp14_;
	GError* _inner_error0_;
};

struct _Block85Data {
	int _ref_count_;
	TubaViewsAdminPageDashboard* self;
	gchar* key;
	gpointer _async_data_;
};

struct _Block86Data {
	int _ref_count_;
	Block85Data * _data85_;
	AdwPreferencesGroup* group;
};

struct _TubaViewsAdminPageDashboardDoDimensionRequestRealData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaViewsAdminPageDashboard* self;
	gchar* key;
	gchar* title;
	gint limit;
	Block85Data* _data85_;
	TubaRequestV2* req;
	TubaAccountStore* _tmp0_;
	TubaInstanceAccount* _tmp1_;
	TubaInstanceAccount* _tmp2_;
	TubaInstanceAccount* _tmp3_;
	TubaRequestV2* _tmp4_;
	TubaRequestV2* _tmp5_;
	JsonBuilder* _tmp6_;
	JsonBuilder* _tmp7_;
	Block86Data* _data86_;
	GInputStream* in_stream;
	TubaRequestV2* _tmp8_;
	GInputStream* _tmp9_;
	JsonParser* parser;
	GInputStream* _tmp10_;
	JsonParser* _tmp11_;
	AdwPreferencesGroup* _tmp12_;
	JsonParser* _tmp13_;
	GError* e;
	GError* _tmp14_;
	const gchar* _tmp15_;
	GError* _inner_error0_;
};

static gint TubaViewsAdminPageDashboard_private_offset;
static gpointer tuba_views_admin_page_dashboard_parent_class = NULL;
VALA_EXTERN TubaAccountStore* tuba_accounts;

VALA_EXTERN GType tuba_views_admin_page_base_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsAdminPageBase, g_object_unref)
VALA_EXTERN GType tuba_views_admin_page_dashboard_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsAdminPageDashboard, g_object_unref)
static void tuba_views_admin_page_dashboard_add_stat (TubaViewsAdminPageDashboard* self,
                                               AdwActionRow* row);
static void tuba_views_admin_page_dashboard_update_requests (TubaViewsAdminPageDashboard* self,
                                                      gint change);
VALA_EXTERN void tuba_views_admin_page_base_set_spinning (TubaViewsAdminPageBase* self,
                                              gboolean value);
static AdwPreferencesGroup* tuba_views_admin_page_dashboard_create_group (TubaViewsAdminPageDashboard* self,
                                                                   const gchar* title);
VALA_EXTERN void tuba_views_admin_page_base_add_to_page (TubaViewsAdminPageBase* self,
                                             AdwPreferencesGroup* group);
static void tuba_views_admin_page_dashboard_populate_stats (TubaViewsAdminPageDashboard* self,
                                                     gint i);
static void tuba_views_admin_page_dashboard_populate_stat (TubaViewsAdminPageDashboard* self,
                                                    const gchar* key,
                                                    const gchar* title,
                                                    gint next_i);
static void tuba_views_admin_page_dashboard_populate_stat_real (TubaViewsAdminPageDashboard* self,
                                                         const gchar* key,
                                                         const gchar* title,
                                                         gint next_i,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
static void tuba_views_admin_page_dashboard_populate_stat_real_finish (TubaViewsAdminPageDashboard* self,
                                                                GAsyncResult* _res_);
static void tuba_views_admin_page_dashboard_populate_stat_real_data_free (gpointer _data);
static gboolean tuba_views_admin_page_dashboard_populate_stat_real_co (TubaViewsAdminPageDashboardPopulateStatRealData* _data_);
static Block84Data* block84_data_ref (Block84Data* _data84_);
static void block84_data_unref (void * _userdata_);
VALA_EXTERN GType tuba_request_v2_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaRequestV2, g_object_unref)
VALA_EXTERN GType tuba_request_v2_method_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType tuba_account_store_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAccountStore, 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_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAccount, g_object_unref)
VALA_EXTERN GType tuba_instance_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaInstanceAccount, g_object_unref)
VALA_EXTERN TubaInstanceAccount* tuba_account_store_get_active (TubaAccountStore* self);
VALA_EXTERN TubaRequestV2* tuba_request_v2_new (const gchar* url,
                                    TubaRequestV2Method method);
VALA_EXTERN TubaRequestV2* tuba_request_v2_construct (GType object_type,
                                          const gchar* url,
                                          TubaRequestV2Method method);
VALA_EXTERN void tuba_request_v2_set_account (TubaRequestV2* self,
                                  TubaInstanceAccount* value);
VALA_EXTERN void tuba_request_v2_set_body_from_json (TubaRequestV2* self,
                                         JsonBuilder* json_builder);
static JsonBuilder* tuba_views_admin_page_dashboard_get_dimensions_body (const gchar* key,
                                                                  gint limit);
VALA_EXTERN void tuba_request_v2_exec (TubaRequestV2* self,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_);
VALA_EXTERN GQuark tuba_oopsie_quark (void);
VALA_EXTERN GType tuba_oopsie_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GInputStream* tuba_request_v2_exec_finish (TubaRequestV2* self,
                                           GAsyncResult* _res_,
                                           SoupMessageHeaders** response_headers,
                                           GError** error);
static void tuba_views_admin_page_dashboard_populate_stat_real_ready (GObject* source_object,
                                                               GAsyncResult* _res_,
                                                               gpointer _user_data_);
VALA_EXTERN void tuba_network_get_parser_from_inputstream_async (GInputStream* in_stream,
                                                     GCancellable* cancellable,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
VALA_EXTERN JsonParser* tuba_network_get_parser_from_inputstream_finish (GAsyncResult* _res_,
                                                             GError** error);
VALA_EXTERN void tuba_network_parse_array (JsonParser* parser,
                               TubaNetworkNodeCallback cb,
                               gpointer cb_target,
                               GDestroyNotify cb_target_destroy_notify,
                               GError** error);
static void ___lambda106_ (Block84Data* _data84_,
                    JsonNode* node,
                    GError** error);
VALA_EXTERN GType tuba_api_admin_dimension_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAdminDimension, g_object_unref)
VALA_EXTERN TubaAPIAdminDimension* tuba_api_admin_dimension_from (JsonNode* node,
                                                      GError** error);
VALA_EXTERN const gchar* tuba_api_admin_dimension_get_key (TubaAPIAdminDimension* self);
VALA_EXTERN const gchar* tuba_api_admin_dimension_get_total (TubaAPIAdminDimension* self);
static void ____lambda106__tuba_network_node_callback (JsonNode* node,
                                                gpointer self,
                                                GError** error);
VALA_EXTERN void tuba_views_admin_page_base_add_toast (TubaViewsAdminPageBase* self,
                                           const gchar* content,
                                           guint timeout);
static void tuba_views_admin_page_dashboard_do_dimension_request (TubaViewsAdminPageDashboard* self,
                                                           const gchar* key,
                                                           const gchar* title,
                                                           gint limit);
static void tuba_views_admin_page_dashboard_do_dimension_request_real (TubaViewsAdminPageDashboard* self,
                                                                const gchar* key,
                                                                const gchar* title,
                                                                gint limit,
                                                                GAsyncReadyCallback _callback_,
                                                                gpointer _user_data_);
static void tuba_views_admin_page_dashboard_do_dimension_request_real_finish (TubaViewsAdminPageDashboard* self,
                                                                       GAsyncResult* _res_);
static void tuba_views_admin_page_dashboard_do_dimension_request_real_data_free (gpointer _data);
static gboolean tuba_views_admin_page_dashboard_do_dimension_request_real_co (TubaViewsAdminPageDashboardDoDimensionRequestRealData* _data_);
static Block85Data* block85_data_ref (Block85Data* _data85_);
static void block85_data_unref (void * _userdata_);
static Block86Data* block86_data_ref (Block86Data* _data86_);
static void block86_data_unref (void * _userdata_);
static void tuba_views_admin_page_dashboard_do_dimension_request_real_ready (GObject* source_object,
                                                                      GAsyncResult* _res_,
                                                                      gpointer _user_data_);
static void ___lambda107_ (Block86Data* _data86_,
                    JsonNode* node,
                    GError** error);
VALA_EXTERN GType tuba_api_admin_dimension_data_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAdminDimensionData, g_object_unref)
VALA_EXTERN GeeArrayList* tuba_api_admin_dimension_get_data (TubaAPIAdminDimension* self);
VALA_EXTERN const gchar* tuba_api_admin_dimension_data_get_human_value (TubaAPIAdminDimensionData* self);
VALA_EXTERN const gchar* tuba_api_admin_dimension_data_get_value (TubaAPIAdminDimensionData* self);
VALA_EXTERN const gchar* tuba_api_admin_dimension_data_get_human_key (TubaAPIAdminDimensionData* self);
static void ____lambda107__tuba_network_node_callback (JsonNode* node,
                                                gpointer self,
                                                GError** error);
VALA_EXTERN TubaViewsAdminPageDashboard* tuba_views_admin_page_dashboard_new (void);
VALA_EXTERN TubaViewsAdminPageDashboard* tuba_views_admin_page_dashboard_construct (GType object_type);
VALA_EXTERN TubaViewsAdminPageBase* tuba_views_admin_page_base_new (void);
VALA_EXTERN TubaViewsAdminPageBase* tuba_views_admin_page_base_construct (GType object_type);
static GObject * tuba_views_admin_page_dashboard_constructor (GType type,
                                                       guint n_construct_properties,
                                                       GObjectConstructParam * construct_properties);
static void tuba_views_admin_page_dashboard_finalize (GObject * obj);
static GType tuba_views_admin_page_dashboard_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 const gchar* TUBA_VIEWS_ADMIN_PAGE_DASHBOARD_KEYS[5] = {"new_users", "active_users", "interactions", "opened_reports", "resolved_reports"};

static inline gpointer
tuba_views_admin_page_dashboard_get_instance_private (TubaViewsAdminPageDashboard* self)
{
	return G_STRUCT_MEMBER_P (self, TubaViewsAdminPageDashboard_private_offset);
}

static void
tuba_views_admin_page_dashboard_add_stat (TubaViewsAdminPageDashboard* self,
                                          AdwActionRow* row)
{
	AdwPreferencesGroup* _tmp0_;
	AdwPreferencesGroup* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (row != NULL);
	_tmp0_ = self->priv->stats_group;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, TRUE);
	_tmp1_ = self->priv->stats_group;
	adw_preferences_group_add (_tmp1_, (GtkWidget*) row);
}

static void
tuba_views_admin_page_dashboard_update_requests (TubaViewsAdminPageDashboard* self,
                                                 gint change)
{
	g_return_if_fail (self != NULL);
	self->priv->requests = self->priv->requests + change;
	tuba_views_admin_page_base_set_spinning ((TubaViewsAdminPageBase*) self, self->priv->requests > 0);
}

static AdwPreferencesGroup*
tuba_views_admin_page_dashboard_create_group (TubaViewsAdminPageDashboard* self,
                                              const gchar* title)
{
	AdwPreferencesGroup* group = NULL;
	gchar* _tmp0_;
	AdwPreferencesGroup* _tmp1_ = NULL;
	AdwPreferencesGroup* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (title != NULL, NULL);
	_tmp0_ = g_strdup (title);
	_tmp1_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	adw_preferences_group_set_title (_tmp1_, _tmp0_);
	_g_free0 (_tmp0_);
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, FALSE);
	g_object_ref_sink (_tmp1_);
	group = _tmp1_;
	tuba_views_admin_page_base_add_to_page ((TubaViewsAdminPageBase*) self, group);
	result = group;
	return result;
}

static void
tuba_views_admin_page_dashboard_populate_stats (TubaViewsAdminPageDashboard* self,
                                                gint i)
{
	AdwPreferencesGroup* _tmp0_;
	gint next_i = 0;
	const gchar* _tmp2_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	const gchar* _tmp4_;
	g_return_if_fail (self != NULL);
	if (i >= G_N_ELEMENTS (TUBA_VIEWS_ADMIN_PAGE_DASHBOARD_KEYS)) {
		return;
	}
	_tmp0_ = self->priv->stats_group;
	if (_tmp0_ == NULL) {
		AdwPreferencesGroup* _tmp1_;
		_tmp1_ = tuba_views_admin_page_dashboard_create_group (self, _ ("Stats"));
		_g_object_unref0 (self->priv->stats_group);
		self->priv->stats_group = _tmp1_;
	}
	next_i = i + 1;
	_tmp2_ = TUBA_VIEWS_ADMIN_PAGE_DASHBOARD_KEYS[i];
	_tmp3_ = self->priv->titles;
	_tmp3__length1 = self->priv->titles_length1;
	_tmp4_ = _tmp3_[i];
	tuba_views_admin_page_dashboard_populate_stat (self, _tmp2_, _tmp4_, next_i);
}

static void
tuba_views_admin_page_dashboard_populate_stat (TubaViewsAdminPageDashboard* self,
                                               const gchar* key,
                                               const gchar* title,
                                               gint next_i)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (key != NULL);
	g_return_if_fail (title != NULL);
	tuba_views_admin_page_dashboard_update_requests (self, 1);
	tuba_views_admin_page_dashboard_populate_stat_real (self, key, title, next_i, NULL, NULL);
}

static void
tuba_views_admin_page_dashboard_populate_stat_real_data_free (gpointer _data)
{
	TubaViewsAdminPageDashboardPopulateStatRealData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (TubaViewsAdminPageDashboardPopulateStatRealData, _data_);
}

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

static void
tuba_views_admin_page_dashboard_populate_stat_real (TubaViewsAdminPageDashboard* self,
                                                    const gchar* key,
                                                    const gchar* title,
                                                    gint next_i,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_)
{
	TubaViewsAdminPageDashboardPopulateStatRealData* _data_;
	TubaViewsAdminPageDashboard* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (key != NULL);
	g_return_if_fail (title != NULL);
	_data_ = g_slice_new0 (TubaViewsAdminPageDashboardPopulateStatRealData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_views_admin_page_dashboard_populate_stat_real_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (key);
	_g_free0 (_data_->key);
	_data_->key = _tmp1_;
	_tmp2_ = g_strdup (title);
	_g_free0 (_data_->title);
	_data_->title = _tmp2_;
	_data_->next_i = next_i;
	tuba_views_admin_page_dashboard_populate_stat_real_co (_data_);
}

static void
tuba_views_admin_page_dashboard_populate_stat_real_finish (TubaViewsAdminPageDashboard* self,
                                                           GAsyncResult* _res_)
{
	TubaViewsAdminPageDashboardPopulateStatRealData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block84Data*
block84_data_ref (Block84Data* _data84_)
{
	g_atomic_int_inc (&_data84_->_ref_count_);
	return _data84_;
}

static void
block84_data_unref (void * _userdata_)
{
	Block84Data* _data84_;
	_data84_ = (Block84Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data84_->_ref_count_)) {
		TubaViewsAdminPageDashboard* self;
		self = _data84_->self;
		_g_free0 (_data84_->key);
		_g_free0 (_data84_->title);
		_g_object_unref0 (self);
		g_slice_free (Block84Data, _data84_);
	}
}

static void
tuba_views_admin_page_dashboard_populate_stat_real_ready (GObject* source_object,
                                                          GAsyncResult* _res_,
                                                          gpointer _user_data_)
{
	TubaViewsAdminPageDashboardPopulateStatRealData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_views_admin_page_dashboard_populate_stat_real_co (_data_);
}

static void
___lambda106_ (Block84Data* _data84_,
               JsonNode* node,
               GError** error)
{
	TubaViewsAdminPageDashboard* self;
	GError* _inner_error0_ = NULL;
	self = _data84_->self;
	g_return_if_fail (node != NULL);
	if (node != NULL) {
		TubaAPIAdminDimension* dimension = NULL;
		TubaAPIAdminDimension* _tmp0_;
		gboolean _tmp1_ = FALSE;
		TubaAPIAdminDimension* _tmp2_;
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		_tmp0_ = tuba_api_admin_dimension_from (node, &_inner_error0_);
		dimension = _tmp0_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_propagate_error (error, _inner_error0_);
			return;
		}
		_tmp2_ = dimension;
		_tmp3_ = tuba_api_admin_dimension_get_key (_tmp2_);
		_tmp4_ = _tmp3_;
		if (g_strcmp0 (_tmp4_, _data84_->key) == 0) {
			TubaAPIAdminDimension* _tmp5_;
			const gchar* _tmp6_;
			const gchar* _tmp7_;
			_tmp5_ = dimension;
			_tmp6_ = tuba_api_admin_dimension_get_total (_tmp5_);
			_tmp7_ = _tmp6_;
			_tmp1_ = _tmp7_ != NULL;
		} else {
			_tmp1_ = FALSE;
		}
		if (_tmp1_) {
			gchar* _tmp8_;
			TubaAPIAdminDimension* _tmp9_;
			const gchar* _tmp10_;
			const gchar* _tmp11_;
			gchar* _tmp12_;
			AdwActionRow* _tmp13_ = NULL;
			AdwActionRow* _tmp14_;
			_tmp8_ = g_strdup (_data84_->title);
			_tmp9_ = dimension;
			_tmp10_ = tuba_api_admin_dimension_get_total (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = g_strdup (_tmp11_);
			_tmp13_ = (AdwActionRow*) adw_action_row_new ();
			adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp13_, _tmp8_);
			_g_free0 (_tmp8_);
			adw_action_row_set_subtitle (_tmp13_, _tmp12_);
			_g_free0 (_tmp12_);
			adw_preferences_row_set_use_markup ((AdwPreferencesRow*) _tmp13_, FALSE);
			adw_action_row_set_subtitle_selectable (_tmp13_, TRUE);
			g_object_ref_sink (_tmp13_);
			_tmp14_ = _tmp13_;
			tuba_views_admin_page_dashboard_add_stat (self, _tmp14_);
			_g_object_unref0 (_tmp14_);
			if (_data84_->next_i > -1) {
				tuba_views_admin_page_dashboard_populate_stats (self, _data84_->next_i);
			}
		}
		_g_object_unref0 (dimension);
	}
}

static void
____lambda106__tuba_network_node_callback (JsonNode* node,
                                           gpointer self,
                                           GError** error)
{
	___lambda106_ (self, node, error);
}

static gboolean
tuba_views_admin_page_dashboard_populate_stat_real_co (TubaViewsAdminPageDashboardPopulateStatRealData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data84_ = g_slice_new0 (Block84Data);
	_data_->_data84_->_ref_count_ = 1;
	_data_->_data84_->self = g_object_ref (_data_->self);
	_g_free0 (_data_->_data84_->key);
	_data_->_data84_->key = _data_->key;
	_g_free0 (_data_->_data84_->title);
	_data_->_data84_->title = _data_->title;
	_data_->_data84_->next_i = _data_->next_i;
	_data_->_data84_->_async_data_ = _data_;
	_data_->_tmp0_ = tuba_accounts;
	_data_->_tmp1_ = tuba_account_store_get_active (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = _g_object_ref0 (_data_->_tmp2_);
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = tuba_request_v2_new ("/api/v1/admin/measures", TUBA_REQUEST_V2_METHOD_POST);
	tuba_request_v2_set_account (_data_->_tmp4_, _data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp3_);
	_data_->req = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->req;
	_data_->_tmp6_ = tuba_views_admin_page_dashboard_get_dimensions_body (_data_->_data84_->key, 0);
	_data_->_tmp7_ = _data_->_tmp6_;
	tuba_request_v2_set_body_from_json (_data_->_tmp5_, _data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp7_);
	{
		_data_->_tmp8_ = _data_->req;
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->_tmp8_, tuba_views_admin_page_dashboard_populate_stat_real_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp9_ = tuba_request_v2_exec_finish (_data_->_tmp8_, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->in_stream = _data_->_tmp9_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp10_ = _data_->in_stream;
		_data_->_state_ = 2;
		tuba_network_get_parser_from_inputstream_async (_data_->_tmp10_, NULL, tuba_views_admin_page_dashboard_populate_stat_real_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp11_ = tuba_network_get_parser_from_inputstream_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->parser = _data_->_tmp11_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->in_stream);
			goto __catch0_g_error;
		}
		_data_->_tmp12_ = _data_->parser;
		tuba_network_parse_array (_data_->_tmp12_, ____lambda106__tuba_network_node_callback, block84_data_ref (_data_->_data84_), block84_data_unref, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->parser);
			_g_object_unref0 (_data_->in_stream);
			goto __catch0_g_error;
		}
		_g_object_unref0 (_data_->parser);
		_g_object_unref0 (_data_->in_stream);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp13_ = _data_->e;
		_data_->_tmp14_ = _data_->_tmp13_->message;
		tuba_views_admin_page_base_add_toast ((TubaViewsAdminPageBase*) _data_->self, _data_->_tmp14_, (guint) 5);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->req);
		block84_data_unref (_data_->_data84_);
		_data_->_data84_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	tuba_views_admin_page_dashboard_update_requests (_data_->self, -1);
	_g_object_unref0 (_data_->req);
	block84_data_unref (_data_->_data84_);
	_data_->_data84_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
tuba_views_admin_page_dashboard_do_dimension_request (TubaViewsAdminPageDashboard* self,
                                                      const gchar* key,
                                                      const gchar* title,
                                                      gint limit)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (key != NULL);
	g_return_if_fail (title != NULL);
	tuba_views_admin_page_dashboard_update_requests (self, 1);
	tuba_views_admin_page_dashboard_do_dimension_request_real (self, key, title, limit, NULL, NULL);
}

static void
tuba_views_admin_page_dashboard_do_dimension_request_real_data_free (gpointer _data)
{
	TubaViewsAdminPageDashboardDoDimensionRequestRealData* _data_;
	_data_ = _data;
	_g_free0 (_data_->title);
	_g_object_unref0 (_data_->self);
	g_slice_free (TubaViewsAdminPageDashboardDoDimensionRequestRealData, _data_);
}

static void
tuba_views_admin_page_dashboard_do_dimension_request_real (TubaViewsAdminPageDashboard* self,
                                                           const gchar* key,
                                                           const gchar* title,
                                                           gint limit,
                                                           GAsyncReadyCallback _callback_,
                                                           gpointer _user_data_)
{
	TubaViewsAdminPageDashboardDoDimensionRequestRealData* _data_;
	TubaViewsAdminPageDashboard* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (key != NULL);
	g_return_if_fail (title != NULL);
	_data_ = g_slice_new0 (TubaViewsAdminPageDashboardDoDimensionRequestRealData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_views_admin_page_dashboard_do_dimension_request_real_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (key);
	_g_free0 (_data_->key);
	_data_->key = _tmp1_;
	_tmp2_ = g_strdup (title);
	_g_free0 (_data_->title);
	_data_->title = _tmp2_;
	_data_->limit = limit;
	tuba_views_admin_page_dashboard_do_dimension_request_real_co (_data_);
}

static void
tuba_views_admin_page_dashboard_do_dimension_request_real_finish (TubaViewsAdminPageDashboard* self,
                                                                  GAsyncResult* _res_)
{
	TubaViewsAdminPageDashboardDoDimensionRequestRealData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block85Data*
block85_data_ref (Block85Data* _data85_)
{
	g_atomic_int_inc (&_data85_->_ref_count_);
	return _data85_;
}

static void
block85_data_unref (void * _userdata_)
{
	Block85Data* _data85_;
	_data85_ = (Block85Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data85_->_ref_count_)) {
		TubaViewsAdminPageDashboard* self;
		self = _data85_->self;
		_g_free0 (_data85_->key);
		_g_object_unref0 (self);
		g_slice_free (Block85Data, _data85_);
	}
}

static Block86Data*
block86_data_ref (Block86Data* _data86_)
{
	g_atomic_int_inc (&_data86_->_ref_count_);
	return _data86_;
}

static void
block86_data_unref (void * _userdata_)
{
	Block86Data* _data86_;
	_data86_ = (Block86Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data86_->_ref_count_)) {
		TubaViewsAdminPageDashboard* self;
		self = _data86_->_data85_->self;
		_g_object_unref0 (_data86_->group);
		block85_data_unref (_data86_->_data85_);
		_data86_->_data85_ = NULL;
		g_slice_free (Block86Data, _data86_);
	}
}

static void
tuba_views_admin_page_dashboard_do_dimension_request_real_ready (GObject* source_object,
                                                                 GAsyncResult* _res_,
                                                                 gpointer _user_data_)
{
	TubaViewsAdminPageDashboardDoDimensionRequestRealData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_views_admin_page_dashboard_do_dimension_request_real_co (_data_);
}

static void
___lambda107_ (Block86Data* _data86_,
               JsonNode* node,
               GError** error)
{
	Block85Data* _data85_;
	TubaViewsAdminPageDashboard* self;
	GError* _inner_error0_ = NULL;
	_data85_ = _data86_->_data85_;
	self = _data85_->self;
	g_return_if_fail (node != NULL);
	if (node != NULL) {
		TubaAPIAdminDimension* dimension = NULL;
		TubaAPIAdminDimension* _tmp0_;
		gboolean _tmp1_ = FALSE;
		gboolean _tmp2_ = FALSE;
		TubaAPIAdminDimension* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		_tmp0_ = tuba_api_admin_dimension_from (node, &_inner_error0_);
		dimension = _tmp0_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_propagate_error (error, _inner_error0_);
			return;
		}
		_tmp3_ = dimension;
		_tmp4_ = tuba_api_admin_dimension_get_key (_tmp3_);
		_tmp5_ = _tmp4_;
		if (g_strcmp0 (_tmp5_, _data85_->key) == 0) {
			TubaAPIAdminDimension* _tmp6_;
			GeeArrayList* _tmp7_;
			GeeArrayList* _tmp8_;
			_tmp6_ = dimension;
			_tmp7_ = tuba_api_admin_dimension_get_data (_tmp6_);
			_tmp8_ = _tmp7_;
			_tmp2_ = _tmp8_ != NULL;
		} else {
			_tmp2_ = FALSE;
		}
		if (_tmp2_) {
			TubaAPIAdminDimension* _tmp9_;
			GeeArrayList* _tmp10_;
			GeeArrayList* _tmp11_;
			gint _tmp12_;
			gint _tmp13_;
			_tmp9_ = dimension;
			_tmp10_ = tuba_api_admin_dimension_get_data (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp11_);
			_tmp13_ = _tmp12_;
			_tmp1_ = _tmp13_ > 0;
		} else {
			_tmp1_ = FALSE;
		}
		if (_tmp1_) {
			{
				GeeArrayList* _entry_list = NULL;
				TubaAPIAdminDimension* _tmp14_;
				GeeArrayList* _tmp15_;
				GeeArrayList* _tmp16_;
				gint _entry_size = 0;
				GeeArrayList* _tmp17_;
				gint _tmp18_;
				gint _tmp19_;
				gint _entry_index = 0;
				_tmp14_ = dimension;
				_tmp15_ = tuba_api_admin_dimension_get_data (_tmp14_);
				_tmp16_ = _tmp15_;
				_entry_list = _tmp16_;
				_tmp17_ = _entry_list;
				_tmp18_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp17_);
				_tmp19_ = _tmp18_;
				_entry_size = _tmp19_;
				_entry_index = -1;
				while (TRUE) {
					gint _tmp20_;
					gint _tmp21_;
					TubaAPIAdminDimensionData* entry = NULL;
					GeeArrayList* _tmp22_;
					gpointer _tmp23_;
					const gchar* _tmp24_ = NULL;
					TubaAPIAdminDimensionData* _tmp25_;
					const gchar* _tmp26_;
					const gchar* _tmp27_;
					AdwPreferencesGroup* _tmp34_;
					TubaAPIAdminDimensionData* _tmp35_;
					const gchar* _tmp36_;
					const gchar* _tmp37_;
					gchar* _tmp38_;
					gchar* _tmp39_;
					AdwActionRow* _tmp40_ = NULL;
					AdwActionRow* _tmp41_;
					AdwPreferencesGroup* _tmp42_;
					_entry_index = _entry_index + 1;
					_tmp20_ = _entry_index;
					_tmp21_ = _entry_size;
					if (!(_tmp20_ < _tmp21_)) {
						break;
					}
					_tmp22_ = _entry_list;
					_tmp23_ = gee_abstract_list_get ((GeeAbstractList*) _tmp22_, _entry_index);
					entry = (TubaAPIAdminDimensionData*) _tmp23_;
					_tmp25_ = entry;
					_tmp26_ = tuba_api_admin_dimension_data_get_human_value (_tmp25_);
					_tmp27_ = _tmp26_;
					if (_tmp27_ != NULL) {
						TubaAPIAdminDimensionData* _tmp28_;
						const gchar* _tmp29_;
						const gchar* _tmp30_;
						_tmp28_ = entry;
						_tmp29_ = tuba_api_admin_dimension_data_get_human_value (_tmp28_);
						_tmp30_ = _tmp29_;
						_tmp24_ = _tmp30_;
					} else {
						TubaAPIAdminDimensionData* _tmp31_;
						const gchar* _tmp32_;
						const gchar* _tmp33_;
						_tmp31_ = entry;
						_tmp32_ = tuba_api_admin_dimension_data_get_value (_tmp31_);
						_tmp33_ = _tmp32_;
						_tmp24_ = _tmp33_;
					}
					_tmp34_ = _data86_->group;
					_tmp35_ = entry;
					_tmp36_ = tuba_api_admin_dimension_data_get_human_key (_tmp35_);
					_tmp37_ = _tmp36_;
					_tmp38_ = g_strdup (_tmp37_);
					_tmp39_ = g_strdup (_tmp24_);
					_tmp40_ = (AdwActionRow*) adw_action_row_new ();
					adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp40_, _tmp38_);
					_g_free0 (_tmp38_);
					adw_action_row_set_subtitle (_tmp40_, _tmp39_);
					_g_free0 (_tmp39_);
					adw_preferences_row_set_use_markup ((AdwPreferencesRow*) _tmp40_, FALSE);
					adw_action_row_set_subtitle_selectable (_tmp40_, TRUE);
					g_object_ref_sink (_tmp40_);
					_tmp41_ = _tmp40_;
					adw_preferences_group_add (_tmp34_, (GtkWidget*) _tmp41_);
					_g_object_unref0 (_tmp41_);
					_tmp42_ = _data86_->group;
					gtk_widget_set_visible ((GtkWidget*) _tmp42_, TRUE);
					_g_object_unref0 (entry);
				}
			}
		}
		_g_object_unref0 (dimension);
	}
}

static void
____lambda107__tuba_network_node_callback (JsonNode* node,
                                           gpointer self,
                                           GError** error)
{
	___lambda107_ (self, node, error);
}

static gboolean
tuba_views_admin_page_dashboard_do_dimension_request_real_co (TubaViewsAdminPageDashboardDoDimensionRequestRealData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data85_ = g_slice_new0 (Block85Data);
	_data_->_data85_->_ref_count_ = 1;
	_data_->_data85_->self = g_object_ref (_data_->self);
	_g_free0 (_data_->_data85_->key);
	_data_->_data85_->key = _data_->key;
	_data_->_data85_->_async_data_ = _data_;
	_data_->_tmp0_ = tuba_accounts;
	_data_->_tmp1_ = tuba_account_store_get_active (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = _g_object_ref0 (_data_->_tmp2_);
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = tuba_request_v2_new ("/api/v1/admin/dimensions", TUBA_REQUEST_V2_METHOD_POST);
	tuba_request_v2_set_account (_data_->_tmp4_, _data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp3_);
	_data_->req = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->req;
	_data_->_tmp6_ = tuba_views_admin_page_dashboard_get_dimensions_body (_data_->_data85_->key, _data_->limit);
	_data_->_tmp7_ = _data_->_tmp6_;
	tuba_request_v2_set_body_from_json (_data_->_tmp5_, _data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp7_);
	{
		_data_->_data86_ = g_slice_new0 (Block86Data);
		_data_->_data86_->_ref_count_ = 1;
		_data_->_data86_->_data85_ = block85_data_ref (_data_->_data85_);
		_data_->_tmp8_ = _data_->req;
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->_tmp8_, tuba_views_admin_page_dashboard_do_dimension_request_real_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp9_ = tuba_request_v2_exec_finish (_data_->_tmp8_, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->in_stream = _data_->_tmp9_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			block86_data_unref (_data_->_data86_);
			_data_->_data86_ = NULL;
			goto __catch0_g_error;
		}
		_data_->_tmp10_ = _data_->in_stream;
		_data_->_state_ = 2;
		tuba_network_get_parser_from_inputstream_async (_data_->_tmp10_, NULL, tuba_views_admin_page_dashboard_do_dimension_request_real_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp11_ = tuba_network_get_parser_from_inputstream_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->parser = _data_->_tmp11_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->in_stream);
			block86_data_unref (_data_->_data86_);
			_data_->_data86_ = NULL;
			goto __catch0_g_error;
		}
		_data_->_tmp12_ = tuba_views_admin_page_dashboard_create_group (_data_->self, _data_->title);
		_data_->_data86_->group = _data_->_tmp12_;
		_data_->_tmp13_ = _data_->parser;
		tuba_network_parse_array (_data_->_tmp13_, ____lambda107__tuba_network_node_callback, block86_data_ref (_data_->_data86_), block86_data_unref, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->parser);
			_g_object_unref0 (_data_->in_stream);
			block86_data_unref (_data_->_data86_);
			_data_->_data86_ = NULL;
			goto __catch0_g_error;
		}
		_g_object_unref0 (_data_->parser);
		_g_object_unref0 (_data_->in_stream);
		block86_data_unref (_data_->_data86_);
		_data_->_data86_ = NULL;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp14_ = _data_->e;
		_data_->_tmp15_ = _data_->_tmp14_->message;
		tuba_views_admin_page_base_add_toast ((TubaViewsAdminPageBase*) _data_->self, _data_->_tmp15_, (guint) 5);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->req);
		block85_data_unref (_data_->_data85_);
		_data_->_data85_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	tuba_views_admin_page_dashboard_update_requests (_data_->self, -1);
	_g_object_unref0 (_data_->req);
	block85_data_unref (_data_->_data85_);
	_data_->_data85_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static JsonBuilder*
tuba_views_admin_page_dashboard_get_dimensions_body (const gchar* key,
                                                     gint limit)
{
	GDateTime* now = NULL;
	GDateTime* _tmp0_;
	GDateTime* end = NULL;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	JsonBuilder* builder = NULL;
	JsonBuilder* _tmp4_;
	JsonBuilder* _tmp5_;
	JsonBuilder* _tmp6_;
	JsonBuilder* _tmp7_;
	GDateTime* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	JsonBuilder* _tmp11_;
	JsonBuilder* _tmp12_;
	JsonBuilder* _tmp13_;
	JsonBuilder* _tmp14_;
	JsonBuilder* _tmp17_;
	JsonBuilder* _tmp18_;
	GDateTime* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	JsonBuilder* _tmp22_;
	JsonBuilder* result;
	g_return_val_if_fail (key != NULL, NULL);
	_tmp0_ = g_date_time_new_now_local ();
	now = _tmp0_;
	_tmp1_ = g_date_time_new_now_local ();
	end = _tmp1_;
	_tmp2_ = now;
	_tmp3_ = g_date_time_add_days (_tmp2_, -29);
	_g_date_time_unref0 (now);
	now = _tmp3_;
	_tmp4_ = json_builder_new ();
	builder = _tmp4_;
	_tmp5_ = builder;
	json_builder_begin_object (_tmp5_);
	_tmp6_ = builder;
	json_builder_set_member_name (_tmp6_, "start_at");
	_tmp7_ = builder;
	_tmp8_ = now;
	_tmp9_ = g_date_time_format (_tmp8_, "%F");
	_tmp10_ = _tmp9_;
	json_builder_add_string_value (_tmp7_, _tmp10_);
	_g_free0 (_tmp10_);
	_tmp11_ = builder;
	json_builder_set_member_name (_tmp11_, "keys");
	_tmp12_ = builder;
	json_builder_begin_array (_tmp12_);
	_tmp13_ = builder;
	json_builder_add_string_value (_tmp13_, key);
	_tmp14_ = builder;
	json_builder_end_array (_tmp14_);
	if (limit > 0) {
		JsonBuilder* _tmp15_;
		JsonBuilder* _tmp16_;
		_tmp15_ = builder;
		json_builder_set_member_name (_tmp15_, "limit");
		_tmp16_ = builder;
		json_builder_add_int_value (_tmp16_, (gint64) limit);
	}
	_tmp17_ = builder;
	json_builder_set_member_name (_tmp17_, "end_at");
	_tmp18_ = builder;
	_tmp19_ = end;
	_tmp20_ = g_date_time_format (_tmp19_, "%F");
	_tmp21_ = _tmp20_;
	json_builder_add_string_value (_tmp18_, _tmp21_);
	_g_free0 (_tmp21_);
	_tmp22_ = builder;
	json_builder_end_object (_tmp22_);
	result = builder;
	_g_date_time_unref0 (end);
	_g_date_time_unref0 (now);
	return result;
}

TubaViewsAdminPageDashboard*
tuba_views_admin_page_dashboard_construct (GType object_type)
{
	TubaViewsAdminPageDashboard * self = NULL;
	self = (TubaViewsAdminPageDashboard*) tuba_views_admin_page_base_construct (object_type);
	return self;
}

TubaViewsAdminPageDashboard*
tuba_views_admin_page_dashboard_new (void)
{
	return tuba_views_admin_page_dashboard_construct (TUBA_VIEWS_ADMIN_PAGE_TYPE_DASHBOARD);
}

static GObject *
tuba_views_admin_page_dashboard_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaViewsAdminPageDashboard * self;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar** _tmp5_;
	parent_class = G_OBJECT_CLASS (tuba_views_admin_page_dashboard_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_VIEWS_ADMIN_PAGE_TYPE_DASHBOARD, TubaViewsAdminPageDashboard);
	adw_navigation_page_set_title ((AdwNavigationPage*) self, _ ("Dashboard"));
	_tmp0_ = g_strdup (_ ("New Users"));
	_tmp1_ = g_strdup (_ ("Active Users"));
	_tmp2_ = g_strdup (_ ("Interactions"));
	_tmp3_ = g_strdup (_ ("Reports Opened"));
	_tmp4_ = g_strdup (_ ("Reports Resolved"));
	_tmp5_ = g_new0 (gchar*, 5 + 1);
	_tmp5_[0] = _tmp0_;
	_tmp5_[1] = _tmp1_;
	_tmp5_[2] = _tmp2_;
	_tmp5_[3] = _tmp3_;
	_tmp5_[4] = _tmp4_;
	self->priv->titles = (_vala_array_free (self->priv->titles, self->priv->titles_length1, (GDestroyNotify) g_free), NULL);
	self->priv->titles = _tmp5_;
	self->priv->titles_length1 = 5;
	self->priv->_titles_size_ = self->priv->titles_length1;
	tuba_views_admin_page_dashboard_populate_stats (self, 0);
	tuba_views_admin_page_dashboard_do_dimension_request (self, "sources", _ ("Sign-up Sources"), 8);
	tuba_views_admin_page_dashboard_do_dimension_request (self, "languages", _ ("Top Active Languages"), 8);
	tuba_views_admin_page_dashboard_do_dimension_request (self, "servers", _ ("Top Active Servers"), 8);
	tuba_views_admin_page_dashboard_do_dimension_request (self, "software_versions", _ ("Software"), 4);
	tuba_views_admin_page_dashboard_do_dimension_request (self, "space_usage", _ ("Space Usage"), 4);
	return obj;
}

static void
tuba_views_admin_page_dashboard_class_init (TubaViewsAdminPageDashboardClass * klass,
                                            gpointer klass_data)
{
	tuba_views_admin_page_dashboard_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaViewsAdminPageDashboard_private_offset);
	G_OBJECT_CLASS (klass)->constructor = tuba_views_admin_page_dashboard_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_views_admin_page_dashboard_finalize;
}

static void
tuba_views_admin_page_dashboard_instance_init (TubaViewsAdminPageDashboard * self,
                                               gpointer klass)
{
	self->priv = tuba_views_admin_page_dashboard_get_instance_private (self);
	self->priv->stats_group = NULL;
	self->priv->requests = 0;
}

static void
tuba_views_admin_page_dashboard_finalize (GObject * obj)
{
	TubaViewsAdminPageDashboard * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_VIEWS_ADMIN_PAGE_TYPE_DASHBOARD, TubaViewsAdminPageDashboard);
	_g_object_unref0 (self->priv->stats_group);
	self->priv->titles = (_vala_array_free (self->priv->titles, self->priv->titles_length1, (GDestroyNotify) g_free), NULL);
	G_OBJECT_CLASS (tuba_views_admin_page_dashboard_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_views_admin_page_dashboard_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaViewsAdminPageDashboardClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_views_admin_page_dashboard_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaViewsAdminPageDashboard), 0, (GInstanceInitFunc) tuba_views_admin_page_dashboard_instance_init, NULL };
	GType tuba_views_admin_page_dashboard_type_id;
	tuba_views_admin_page_dashboard_type_id = g_type_register_static (TUBA_VIEWS_ADMIN_PAGE_TYPE_BASE, "TubaViewsAdminPageDashboard", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaViewsAdminPageDashboard_private_offset = g_type_add_instance_private (tuba_views_admin_page_dashboard_type_id, sizeof (TubaViewsAdminPageDashboardPrivate));
	return tuba_views_admin_page_dashboard_type_id;
}

GType
tuba_views_admin_page_dashboard_get_type (void)
{
	static GType tuba_views_admin_page_dashboard_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_views_admin_page_dashboard_type_id__once)) {
		GType tuba_views_admin_page_dashboard_type_id;
		tuba_views_admin_page_dashboard_type_id = tuba_views_admin_page_dashboard_get_type_once ();
		g_once_init_leave_pointer (&tuba_views_admin_page_dashboard_type_id__once, tuba_views_admin_page_dashboard_type_id);
	}
	return tuba_views_admin_page_dashboard_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);
}

