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

/*
 * Copyright © 2023 Alain M. (https://github.com/alainm23/planify)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301 USA
 *
 * Authored by: Alain M. <alainmh23@gmail.com>
 */

#include <adwaita.h>
#include <glib-object.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gtk/gtk.h>
#include "planify.h"
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <gdk/gdk.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 WIDGETS_TYPE_MULTI_SELECT_TOOLBAR (widgets_multi_select_toolbar_get_type ())
#define WIDGETS_MULTI_SELECT_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIDGETS_TYPE_MULTI_SELECT_TOOLBAR, WidgetsMultiSelectToolbar))
#define WIDGETS_MULTI_SELECT_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIDGETS_TYPE_MULTI_SELECT_TOOLBAR, WidgetsMultiSelectToolbarClass))
#define WIDGETS_IS_MULTI_SELECT_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIDGETS_TYPE_MULTI_SELECT_TOOLBAR))
#define WIDGETS_IS_MULTI_SELECT_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIDGETS_TYPE_MULTI_SELECT_TOOLBAR))
#define WIDGETS_MULTI_SELECT_TOOLBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIDGETS_TYPE_MULTI_SELECT_TOOLBAR, WidgetsMultiSelectToolbarClass))

typedef struct _WidgetsMultiSelectToolbar WidgetsMultiSelectToolbar;
typedef struct _WidgetsMultiSelectToolbarClass WidgetsMultiSelectToolbarClass;
typedef struct _WidgetsMultiSelectToolbarPrivate WidgetsMultiSelectToolbarPrivate;

#define LAYOUTS_TYPE_ITEM_BASE (layouts_item_base_get_type ())
#define LAYOUTS_ITEM_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LAYOUTS_TYPE_ITEM_BASE, LayoutsItemBase))
#define LAYOUTS_ITEM_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LAYOUTS_TYPE_ITEM_BASE, LayoutsItemBaseClass))
#define LAYOUTS_IS_ITEM_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LAYOUTS_TYPE_ITEM_BASE))
#define LAYOUTS_IS_ITEM_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LAYOUTS_TYPE_ITEM_BASE))
#define LAYOUTS_ITEM_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LAYOUTS_TYPE_ITEM_BASE, LayoutsItemBaseClass))

typedef struct _LayoutsItemBase LayoutsItemBase;
typedef struct _LayoutsItemBaseClass LayoutsItemBaseClass;
enum  {
	WIDGETS_MULTI_SELECT_TOOLBAR_0_PROPERTY,
	WIDGETS_MULTI_SELECT_TOOLBAR_PROJECT_PROPERTY,
	WIDGETS_MULTI_SELECT_TOOLBAR_NUM_PROPERTIES
};
static GParamSpec* widgets_multi_select_toolbar_properties[WIDGETS_MULTI_SELECT_TOOLBAR_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block51Data Block51Data;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block52Data Block52Data;
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))

#define TYPE_PLANIFY (planify_get_type ())
#define PLANIFY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLANIFY, Planify))
#define PLANIFY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLANIFY, PlanifyClass))
#define IS_PLANIFY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLANIFY))
#define IS_PLANIFY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLANIFY))
#define PLANIFY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLANIFY, PlanifyClass))

typedef struct _Planify Planify;
typedef struct _PlanifyClass PlanifyClass;
typedef struct _PlanifyPrivate PlanifyPrivate;

#define TYPE_MAIN_WINDOW (main_window_get_type ())
#define MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WINDOW, MainWindow))
#define MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WINDOW, MainWindowClass))
#define IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WINDOW))
#define IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WINDOW))
#define MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WINDOW, MainWindowClass))

typedef struct _MainWindow MainWindow;
typedef struct _MainWindowClass MainWindowClass;

#define DIALOGS_PROJECT_PICKER_TYPE_PROJECT_PICKER (dialogs_project_picker_project_picker_get_type ())
#define DIALOGS_PROJECT_PICKER_PROJECT_PICKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIALOGS_PROJECT_PICKER_TYPE_PROJECT_PICKER, DialogsProjectPickerProjectPicker))
#define DIALOGS_PROJECT_PICKER_PROJECT_PICKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DIALOGS_PROJECT_PICKER_TYPE_PROJECT_PICKER, DialogsProjectPickerProjectPickerClass))
#define DIALOGS_PROJECT_PICKER_IS_PROJECT_PICKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIALOGS_PROJECT_PICKER_TYPE_PROJECT_PICKER))
#define DIALOGS_PROJECT_PICKER_IS_PROJECT_PICKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DIALOGS_PROJECT_PICKER_TYPE_PROJECT_PICKER))
#define DIALOGS_PROJECT_PICKER_PROJECT_PICKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DIALOGS_PROJECT_PICKER_TYPE_PROJECT_PICKER, DialogsProjectPickerProjectPickerClass))

typedef struct _DialogsProjectPickerProjectPicker DialogsProjectPickerProjectPicker;
typedef struct _DialogsProjectPickerProjectPickerClass DialogsProjectPickerProjectPickerClass;
enum  {
	WIDGETS_MULTI_SELECT_TOOLBAR_CLOSED_SIGNAL,
	WIDGETS_MULTI_SELECT_TOOLBAR_NUM_SIGNALS
};
static guint widgets_multi_select_toolbar_signals[WIDGETS_MULTI_SELECT_TOOLBAR_NUM_SIGNALS] = {0};

struct _WidgetsMultiSelectToolbar {
	AdwBin parent_instance;
	WidgetsMultiSelectToolbarPrivate * priv;
	GeeHashMap* items_selected;
	GeeHashMap* labels;
};

struct _WidgetsMultiSelectToolbarClass {
	AdwBinClass parent_class;
};

struct _WidgetsMultiSelectToolbarPrivate {
	ObjectsProject* _project;
	GtkLabel* size_label;
	WidgetsScheduleButton* schedule_button;
	GtkButton* move_button;
	WidgetsLabelPickerLabelButton* label_button;
	WidgetsPriorityButton* priority_button;
	GtkMenuButton* menu_button;
	WidgetsLoadingButton* done_button;
	WidgetsContextMenuMenuItem* complete_item;
	WidgetsContextMenuMenuItem* delete_item;
	GeeHashMap* _initial_labels;
};

struct _Block51Data {
	int _ref_count_;
	WidgetsMultiSelectToolbar* self;
	GeeArrayList* objects;
};

struct _Block52Data {
	int _ref_count_;
	WidgetsMultiSelectToolbar* self;
	GtkPopover* popover;
};

struct _Planify {
	AdwApplication parent_instance;
	PlanifyPrivate * priv;
	MainWindow* main_window;
};

struct _PlanifyClass {
	AdwApplicationClass parent_class;
};

static gint WidgetsMultiSelectToolbar_private_offset;
static gpointer widgets_multi_select_toolbar_parent_class = NULL;
VALA_EXTERN Planify* planify__instance;

VALA_EXTERN GType widgets_multi_select_toolbar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WidgetsMultiSelectToolbar, g_object_unref)
VALA_EXTERN GType layouts_item_base_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LayoutsItemBase, g_object_unref)
VALA_EXTERN WidgetsMultiSelectToolbar* widgets_multi_select_toolbar_new (ObjectsProject* project);
VALA_EXTERN WidgetsMultiSelectToolbar* widgets_multi_select_toolbar_construct (GType object_type,
                                                                   ObjectsProject* project);
static void widgets_multi_select_toolbar_update_items (WidgetsMultiSelectToolbar* self,
                                                GeeArrayList* objects);
static Block51Data* block51_data_ref (Block51Data* _data51_);
static void block51_data_unref (void * _userdata_);
VALA_EXTERN ObjectsProject* widgets_multi_select_toolbar_get_project (WidgetsMultiSelectToolbar* self);
static void ____lambda538_ (Block51Data* _data51_,
                     GObject* obj,
                     GAsyncResult* res);
static void _____lambda538__gasync_ready_callback (GObject* source_object,
                                            GAsyncResult* res,
                                            gpointer self);
static void widgets_multi_select_toolbar_unselect_all (WidgetsMultiSelectToolbar* self);
static void widgets_multi_select_toolbar_set_datetime (WidgetsMultiSelectToolbar* self,
                                                ObjectsDueDate* duedate);
VALA_EXTERN ObjectsItem* layouts_item_base_get_item (LayoutsItemBase* self);
static void widgets_multi_select_toolbar_set_priority (WidgetsMultiSelectToolbar* self,
                                                gint priority);
static void widgets_multi_select_toolbar_apply_label_changes (WidgetsMultiSelectToolbar* self,
                                                       GeeHashMap* new_labels);
static GtkPopover* widgets_multi_select_toolbar_build_menu_popover (WidgetsMultiSelectToolbar* self);
static Block52Data* block52_data_ref (Block52Data* _data52_);
static void block52_data_unref (void * _userdata_);
static void __lambda539_ (WidgetsMultiSelectToolbar* self);
VALA_EXTERN void layouts_item_base_checked_toggled (LayoutsItemBase* self,
                                        gboolean active,
                                        guint* time);
static void ___lambda539__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda540_ (Block52Data* _data52_);
static void ___lambda540__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda541_ (WidgetsMultiSelectToolbar* self);
VALA_EXTERN GType planify_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Planify, g_object_unref)
VALA_EXTERN GType main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MainWindow, g_object_unref)
static void __lambda542_ (WidgetsMultiSelectToolbar* self,
                   const gchar* response);
static void ___lambda542__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                              const gchar* response,
                                              gpointer self);
static void ___lambda541__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
VALA_EXTERN void layouts_item_base_select_row (LayoutsItemBase* self,
                                   gboolean active);
static void widgets_multi_select_toolbar_check_select_bar (WidgetsMultiSelectToolbar* self);
static void widgets_multi_select_toolbar_check_labels (WidgetsMultiSelectToolbar* self,
                                                ObjectsItem* item,
                                                gboolean active);
VALA_EXTERN void widgets_multi_select_toolbar_move (WidgetsMultiSelectToolbar* self,
                                        ObjectsProject* project);
static void widgets_multi_select_toolbar_set_project (WidgetsMultiSelectToolbar* self,
                                               ObjectsProject* value);
static GObject * widgets_multi_select_toolbar_constructor (GType type,
                                                    guint n_construct_properties,
                                                    GObjectConstructParam * construct_properties);
static void _widgets_multi_select_toolbar___lambda543_ (WidgetsMultiSelectToolbar* self,
                                                 GtkWidget* _row);
static void __widgets_multi_select_toolbar___lambda543__services_event_bus_select_item (ServicesEventBus* _sender,
                                                                                 GtkWidget* itemrow,
                                                                                 gpointer self);
static void _widgets_multi_select_toolbar___lambda544_ (WidgetsMultiSelectToolbar* self,
                                                 GtkWidget* _row);
static void __widgets_multi_select_toolbar___lambda544__services_event_bus_unselect_item (ServicesEventBus* _sender,
                                                                                   GtkWidget* itemrow,
                                                                                   gpointer self);
static void _widgets_multi_select_toolbar___lambda545_ (WidgetsMultiSelectToolbar* self);
static void __widgets_multi_select_toolbar___lambda545__services_event_bus_unselect_all (ServicesEventBus* _sender,
                                                                                  gpointer self);
static void _widgets_multi_select_toolbar___lambda546_ (WidgetsMultiSelectToolbar* self);
static void __widgets_multi_select_toolbar___lambda546__gtk_button_clicked (GtkButton* _sender,
                                                                     gpointer self);
static void _widgets_multi_select_toolbar___lambda547_ (WidgetsMultiSelectToolbar* self);
static void __widgets_multi_select_toolbar___lambda547__widgets_schedule_button_duedate_changed (WidgetsScheduleButton* _sender,
                                                                                          gpointer self);
static void _widgets_multi_select_toolbar___lambda548_ (WidgetsMultiSelectToolbar* self);
VALA_EXTERN GType dialogs_project_picker_project_picker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DialogsProjectPickerProjectPicker, g_object_unref)
VALA_EXTERN DialogsProjectPickerProjectPicker* dialogs_project_picker_project_picker_new_for_projects (void);
VALA_EXTERN DialogsProjectPickerProjectPicker* dialogs_project_picker_project_picker_construct_for_projects (GType object_type);
VALA_EXTERN void dialogs_project_picker_project_picker_set_project (DialogsProjectPickerProjectPicker* self,
                                                        ObjectsProject* value);
static void __lambda549_ (WidgetsMultiSelectToolbar* self,
                   const gchar* type,
                   const gchar* id);
static void ___lambda549__dialogs_project_picker_project_picker_changed (DialogsProjectPickerProjectPicker* _sender,
                                                                  const gchar* type,
                                                                  const gchar* id,
                                                                  gpointer self);
static void __widgets_multi_select_toolbar___lambda548__gtk_button_clicked (GtkButton* _sender,
                                                                     gpointer self);
static void _widgets_multi_select_toolbar___lambda550_ (WidgetsMultiSelectToolbar* self,
                                                 gboolean active);
static void __widgets_multi_select_toolbar___lambda550__widgets_label_picker_label_button_picker_opened (WidgetsLabelPickerLabelButton* _sender,
                                                                                                  gboolean active,
                                                                                                  gpointer self);
static void _widgets_multi_select_toolbar___lambda551_ (WidgetsMultiSelectToolbar* self,
                                                 GeeHashMap* new_labels);
static void __widgets_multi_select_toolbar___lambda551__widgets_label_picker_label_button_labels_changed (WidgetsLabelPickerLabelButton* _sender,
                                                                                                   GeeHashMap* labels,
                                                                                                   gpointer self);
static void _widgets_multi_select_toolbar___lambda552_ (WidgetsMultiSelectToolbar* self,
                                                 gint priority);
static void __widgets_multi_select_toolbar___lambda552__widgets_priority_button_changed (WidgetsPriorityButton* _sender,
                                                                                  gint priority,
                                                                                  gpointer self);
static void widgets_multi_select_toolbar_finalize (GObject * obj);
static GType widgets_multi_select_toolbar_get_type_once (void);
static void _vala_widgets_multi_select_toolbar_get_property (GObject * object,
                                                      guint property_id,
                                                      GValue * value,
                                                      GParamSpec * pspec);
static void _vala_widgets_multi_select_toolbar_set_property (GObject * object,
                                                      guint property_id,
                                                      const GValue * value,
                                                      GParamSpec * pspec);
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
widgets_multi_select_toolbar_get_instance_private (WidgetsMultiSelectToolbar* self)
{
	return G_STRUCT_MEMBER_P (self, WidgetsMultiSelectToolbar_private_offset);
}

WidgetsMultiSelectToolbar*
widgets_multi_select_toolbar_construct (GType object_type,
                                        ObjectsProject* project)
{
	WidgetsMultiSelectToolbar * self = NULL;
	g_return_val_if_fail (project != NULL, NULL);
	self = (WidgetsMultiSelectToolbar*) g_object_new (object_type, "project", project, "hexpand", TRUE, "valign", GTK_ALIGN_END, NULL);
	return self;
}

WidgetsMultiSelectToolbar*
widgets_multi_select_toolbar_new (ObjectsProject* project)
{
	return widgets_multi_select_toolbar_construct (WIDGETS_TYPE_MULTI_SELECT_TOOLBAR, project);
}

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

static Block51Data*
block51_data_ref (Block51Data* _data51_)
{
	g_atomic_int_inc (&_data51_->_ref_count_);
	return _data51_;
}

static void
block51_data_unref (void * _userdata_)
{
	Block51Data* _data51_;
	_data51_ = (Block51Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data51_->_ref_count_)) {
		WidgetsMultiSelectToolbar* self;
		self = _data51_->self;
		_g_object_unref0 (_data51_->objects);
		_g_object_unref0 (self);
		g_slice_free (Block51Data, _data51_);
	}
}

static void
____lambda538_ (Block51Data* _data51_,
                GObject* obj,
                GAsyncResult* res)
{
	WidgetsMultiSelectToolbar* self;
	ServicesTodoist* _tmp0_;
	ServicesTodoist* _tmp1_;
	WidgetsLoadingButton* _tmp10_;
	self = _data51_->self;
	g_return_if_fail (res != NULL);
	_tmp0_ = services_todoist_get_default ();
	_tmp1_ = _tmp0_;
	services_todoist_update_items_finish (_tmp1_, res);
	_g_object_unref0 (_tmp1_);
	{
		GeeArrayList* _item_list = NULL;
		gint _item_size = 0;
		GeeArrayList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _item_index = 0;
		_item_list = _data51_->objects;
		_tmp2_ = _item_list;
		_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_item_size = _tmp4_;
		_item_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			ObjectsItem* item = NULL;
			GeeArrayList* _tmp7_;
			gpointer _tmp8_;
			ObjectsItem* _tmp9_;
			_item_index = _item_index + 1;
			_tmp5_ = _item_index;
			_tmp6_ = _item_size;
			if (!(_tmp5_ < _tmp6_)) {
				break;
			}
			_tmp7_ = _item_list;
			_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, _item_index);
			item = (ObjectsItem*) _tmp8_;
			_tmp9_ = item;
			objects_item_update_local (_tmp9_);
			_g_object_unref0 (item);
		}
	}
	_tmp10_ = self->priv->done_button;
	widgets_loading_button_set_is_loading (_tmp10_, FALSE);
}

static void
_____lambda538__gasync_ready_callback (GObject* source_object,
                                       GAsyncResult* res,
                                       gpointer self)
{
	____lambda538_ (self, source_object, res);
	block51_data_unref (self);
}

static void
widgets_multi_select_toolbar_update_items (WidgetsMultiSelectToolbar* self,
                                           GeeArrayList* objects)
{
	Block51Data* _data51_;
	GeeArrayList* _tmp0_;
	gboolean _tmp1_ = FALSE;
	ObjectsProject* _tmp2_;
	SourceType _tmp3_;
	SourceType _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (objects != NULL);
	_data51_ = g_slice_new0 (Block51Data);
	_data51_->_ref_count_ = 1;
	_data51_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (objects);
	_g_object_unref0 (_data51_->objects);
	_data51_->objects = _tmp0_;
	_tmp2_ = self->priv->_project;
	_tmp3_ = objects_project_get_source_type (_tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_ == SOURCE_TYPE_LOCAL) {
		_tmp1_ = TRUE;
	} else {
		ObjectsProject* _tmp5_;
		SourceType _tmp6_;
		SourceType _tmp7_;
		_tmp5_ = self->priv->_project;
		_tmp6_ = objects_project_get_source_type (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp1_ = _tmp7_ == SOURCE_TYPE_CALDAV;
	}
	if (_tmp1_) {
		{
			GeeArrayList* _item_list = NULL;
			gint _item_size = 0;
			GeeArrayList* _tmp8_;
			gint _tmp9_;
			gint _tmp10_;
			gint _item_index = 0;
			_item_list = _data51_->objects;
			_tmp8_ = _item_list;
			_tmp9_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp8_);
			_tmp10_ = _tmp9_;
			_item_size = _tmp10_;
			_item_index = -1;
			while (TRUE) {
				gint _tmp11_;
				gint _tmp12_;
				ObjectsItem* item = NULL;
				GeeArrayList* _tmp13_;
				gpointer _tmp14_;
				ObjectsItem* _tmp15_;
				_item_index = _item_index + 1;
				_tmp11_ = _item_index;
				_tmp12_ = _item_size;
				if (!(_tmp11_ < _tmp12_)) {
					break;
				}
				_tmp13_ = _item_list;
				_tmp14_ = gee_abstract_list_get ((GeeAbstractList*) _tmp13_, _item_index);
				item = (ObjectsItem*) _tmp14_;
				_tmp15_ = item;
				objects_item_update_async (_tmp15_, "");
				_g_object_unref0 (item);
			}
		}
	} else {
		ObjectsProject* _tmp16_;
		SourceType _tmp17_;
		SourceType _tmp18_;
		_tmp16_ = self->priv->_project;
		_tmp17_ = objects_project_get_source_type (_tmp16_);
		_tmp18_ = _tmp17_;
		if (_tmp18_ == SOURCE_TYPE_TODOIST) {
			WidgetsLoadingButton* _tmp19_;
			ServicesTodoist* _tmp20_;
			ServicesTodoist* _tmp21_;
			_tmp19_ = self->priv->done_button;
			widgets_loading_button_set_is_loading (_tmp19_, TRUE);
			_tmp20_ = services_todoist_get_default ();
			_tmp21_ = _tmp20_;
			services_todoist_update_items (_tmp21_, _data51_->objects, _____lambda538__gasync_ready_callback, block51_data_ref (_data51_));
			_g_object_unref0 (_tmp21_);
		}
	}
	widgets_multi_select_toolbar_unselect_all (self);
	block51_data_unref (_data51_);
	_data51_ = NULL;
}

static void
widgets_multi_select_toolbar_set_datetime (WidgetsMultiSelectToolbar* self,
                                           ObjectsDueDate* duedate)
{
	GeeArrayList* objects = NULL;
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp21_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (duedate != NULL);
	_tmp0_ = gee_array_list_new (OBJECTS_TYPE_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	objects = _tmp0_;
	{
		GeeIterator* _key_it = NULL;
		GeeHashMap* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeSet* _tmp4_;
		GeeIterator* _tmp5_;
		GeeIterator* _tmp6_;
		_tmp1_ = self->items_selected;
		_tmp2_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_key_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_;
			gchar* key = NULL;
			GeeIterator* _tmp8_;
			gpointer _tmp9_;
			ObjectsItem* item = NULL;
			GeeHashMap* _tmp10_;
			const gchar* _tmp11_;
			gpointer _tmp12_;
			LayoutsItemBase* _tmp13_;
			ObjectsItem* _tmp14_;
			ObjectsItem* _tmp15_;
			ObjectsItem* _tmp16_;
			ObjectsItem* _tmp17_;
			ObjectsItem* _tmp18_;
			GeeArrayList* _tmp19_;
			ObjectsItem* _tmp20_;
			_tmp7_ = _key_it;
			if (!gee_iterator_next (_tmp7_)) {
				break;
			}
			_tmp8_ = _key_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			key = (gchar*) _tmp9_;
			_tmp10_ = self->items_selected;
			_tmp11_ = key;
			_tmp12_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp10_, _tmp11_);
			_tmp13_ = (LayoutsItemBase*) _tmp12_;
			_tmp14_ = layouts_item_base_get_item (_tmp13_);
			_tmp15_ = _tmp14_;
			_tmp16_ = _g_object_ref0 (_tmp15_);
			_tmp17_ = _tmp16_;
			_g_object_unref0 (_tmp13_);
			item = _tmp17_;
			_tmp18_ = item;
			objects_item_update_due (_tmp18_, duedate);
			_tmp19_ = objects;
			_tmp20_ = item;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp19_, _tmp20_);
			_g_object_unref0 (item);
			_g_free0 (key);
		}
		_g_object_unref0 (_key_it);
	}
	_tmp21_ = objects;
	widgets_multi_select_toolbar_update_items (self, _tmp21_);
	_g_object_unref0 (objects);
}

static void
widgets_multi_select_toolbar_set_priority (WidgetsMultiSelectToolbar* self,
                                           gint priority)
{
	GeeArrayList* objects = NULL;
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp24_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gee_array_list_new (OBJECTS_TYPE_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	objects = _tmp0_;
	{
		GeeIterator* _key_it = NULL;
		GeeHashMap* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeSet* _tmp4_;
		GeeIterator* _tmp5_;
		GeeIterator* _tmp6_;
		_tmp1_ = self->items_selected;
		_tmp2_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_key_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_;
			gchar* key = NULL;
			GeeIterator* _tmp8_;
			gpointer _tmp9_;
			ObjectsItem* item = NULL;
			GeeHashMap* _tmp10_;
			const gchar* _tmp11_;
			gpointer _tmp12_;
			LayoutsItemBase* _tmp13_;
			ObjectsItem* _tmp14_;
			ObjectsItem* _tmp15_;
			ObjectsItem* _tmp16_;
			ObjectsItem* _tmp17_;
			ObjectsItem* _tmp18_;
			gint _tmp19_;
			gint _tmp20_;
			_tmp7_ = _key_it;
			if (!gee_iterator_next (_tmp7_)) {
				break;
			}
			_tmp8_ = _key_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			key = (gchar*) _tmp9_;
			_tmp10_ = self->items_selected;
			_tmp11_ = key;
			_tmp12_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp10_, _tmp11_);
			_tmp13_ = (LayoutsItemBase*) _tmp12_;
			_tmp14_ = layouts_item_base_get_item (_tmp13_);
			_tmp15_ = _tmp14_;
			_tmp16_ = _g_object_ref0 (_tmp15_);
			_tmp17_ = _tmp16_;
			_g_object_unref0 (_tmp13_);
			item = _tmp17_;
			_tmp18_ = item;
			_tmp19_ = objects_item_get_priority (_tmp18_);
			_tmp20_ = _tmp19_;
			if (_tmp20_ != priority) {
				ObjectsItem* _tmp21_;
				GeeArrayList* _tmp22_;
				ObjectsItem* _tmp23_;
				_tmp21_ = item;
				objects_item_set_priority (_tmp21_, priority);
				_tmp22_ = objects;
				_tmp23_ = item;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp22_, _tmp23_);
			}
			_g_object_unref0 (item);
			_g_free0 (key);
		}
		_g_object_unref0 (_key_it);
	}
	_tmp24_ = objects;
	widgets_multi_select_toolbar_update_items (self, _tmp24_);
	_g_object_unref0 (objects);
}

static void
widgets_multi_select_toolbar_apply_label_changes (WidgetsMultiSelectToolbar* self,
                                                  GeeHashMap* new_labels)
{
	GeeHashMap* added = NULL;
	GeeHashMap* _tmp0_;
	GeeArrayList* removed = NULL;
	GeeArrayList* _tmp20_;
	gboolean _tmp37_ = FALSE;
	GeeHashMap* _tmp38_;
	gint _tmp39_;
	gint _tmp40_;
	GeeArrayList* objects = NULL;
	GeeArrayList* _tmp44_;
	GeeArrayList* _tmp91_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (new_labels != NULL);
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, OBJECTS_TYPE_LABEL, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	added = _tmp0_;
	{
		GeeIterator* _entry_it = NULL;
		GeeSet* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
		_tmp1_ = gee_abstract_map_get_entries ((GeeAbstractMap*) new_labels);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_entry_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp7_;
			gpointer _tmp8_;
			GeeHashMap* _tmp9_;
			GeeMapEntry* _tmp10_;
			gconstpointer _tmp11_;
			gconstpointer _tmp12_;
			_tmp6_ = _entry_it;
			if (!gee_iterator_next (_tmp6_)) {
				break;
			}
			_tmp7_ = _entry_it;
			_tmp8_ = gee_iterator_get (_tmp7_);
			entry = (GeeMapEntry*) _tmp8_;
			_tmp9_ = self->priv->_initial_labels;
			_tmp10_ = entry;
			_tmp11_ = gee_map_entry_get_key (_tmp10_);
			_tmp12_ = _tmp11_;
			if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp9_, (const gchar*) _tmp12_)) {
				GeeHashMap* _tmp13_;
				GeeMapEntry* _tmp14_;
				gconstpointer _tmp15_;
				gconstpointer _tmp16_;
				GeeMapEntry* _tmp17_;
				gconstpointer _tmp18_;
				gconstpointer _tmp19_;
				_tmp13_ = added;
				_tmp14_ = entry;
				_tmp15_ = gee_map_entry_get_key (_tmp14_);
				_tmp16_ = _tmp15_;
				_tmp17_ = entry;
				_tmp18_ = gee_map_entry_get_value (_tmp17_);
				_tmp19_ = _tmp18_;
				gee_abstract_map_set ((GeeAbstractMap*) _tmp13_, (const gchar*) _tmp16_, (ObjectsLabel*) _tmp19_);
			}
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	_tmp20_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
	removed = _tmp20_;
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp21_;
		GeeSet* _tmp22_;
		GeeSet* _tmp23_;
		GeeSet* _tmp24_;
		GeeIterator* _tmp25_;
		GeeIterator* _tmp26_;
		_tmp21_ = self->priv->_initial_labels;
		_tmp22_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp21_);
		_tmp23_ = _tmp22_;
		_tmp24_ = _tmp23_;
		_tmp25_ = gee_iterable_iterator ((GeeIterable*) _tmp24_);
		_tmp26_ = _tmp25_;
		_g_object_unref0 (_tmp24_);
		_entry_it = _tmp26_;
		while (TRUE) {
			GeeIterator* _tmp27_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp28_;
			gpointer _tmp29_;
			GeeMapEntry* _tmp30_;
			gconstpointer _tmp31_;
			gconstpointer _tmp32_;
			_tmp27_ = _entry_it;
			if (!gee_iterator_next (_tmp27_)) {
				break;
			}
			_tmp28_ = _entry_it;
			_tmp29_ = gee_iterator_get (_tmp28_);
			entry = (GeeMapEntry*) _tmp29_;
			_tmp30_ = entry;
			_tmp31_ = gee_map_entry_get_key (_tmp30_);
			_tmp32_ = _tmp31_;
			if (!gee_abstract_map_has_key ((GeeAbstractMap*) new_labels, (const gchar*) _tmp32_)) {
				GeeArrayList* _tmp33_;
				GeeMapEntry* _tmp34_;
				gconstpointer _tmp35_;
				gconstpointer _tmp36_;
				_tmp33_ = removed;
				_tmp34_ = entry;
				_tmp35_ = gee_map_entry_get_key (_tmp34_);
				_tmp36_ = _tmp35_;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp33_, (const gchar*) _tmp36_);
			}
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	_tmp38_ = added;
	_tmp39_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp38_);
	_tmp40_ = _tmp39_;
	if (_tmp40_ == 0) {
		GeeArrayList* _tmp41_;
		gint _tmp42_;
		gint _tmp43_;
		_tmp41_ = removed;
		_tmp42_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp41_);
		_tmp43_ = _tmp42_;
		_tmp37_ = _tmp43_ == 0;
	} else {
		_tmp37_ = FALSE;
	}
	if (_tmp37_) {
		_g_object_unref0 (removed);
		_g_object_unref0 (added);
		return;
	}
	_tmp44_ = gee_array_list_new (OBJECTS_TYPE_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	objects = _tmp44_;
	{
		GeeIterator* _key_it = NULL;
		GeeHashMap* _tmp45_;
		GeeSet* _tmp46_;
		GeeSet* _tmp47_;
		GeeSet* _tmp48_;
		GeeIterator* _tmp49_;
		GeeIterator* _tmp50_;
		_tmp45_ = self->items_selected;
		_tmp46_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _tmp45_);
		_tmp47_ = _tmp46_;
		_tmp48_ = _tmp47_;
		_tmp49_ = gee_iterable_iterator ((GeeIterable*) _tmp48_);
		_tmp50_ = _tmp49_;
		_g_object_unref0 (_tmp48_);
		_key_it = _tmp50_;
		while (TRUE) {
			GeeIterator* _tmp51_;
			gchar* key = NULL;
			GeeIterator* _tmp52_;
			gpointer _tmp53_;
			ObjectsItem* item = NULL;
			GeeHashMap* _tmp54_;
			const gchar* _tmp55_;
			gpointer _tmp56_;
			LayoutsItemBase* _tmp57_;
			ObjectsItem* _tmp58_;
			ObjectsItem* _tmp59_;
			ObjectsItem* _tmp60_;
			ObjectsItem* _tmp61_;
			GeeArrayList* _tmp89_;
			ObjectsItem* _tmp90_;
			_tmp51_ = _key_it;
			if (!gee_iterator_next (_tmp51_)) {
				break;
			}
			_tmp52_ = _key_it;
			_tmp53_ = gee_iterator_get (_tmp52_);
			key = (gchar*) _tmp53_;
			_tmp54_ = self->items_selected;
			_tmp55_ = key;
			_tmp56_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp54_, _tmp55_);
			_tmp57_ = (LayoutsItemBase*) _tmp56_;
			_tmp58_ = layouts_item_base_get_item (_tmp57_);
			_tmp59_ = _tmp58_;
			_tmp60_ = _g_object_ref0 (_tmp59_);
			_tmp61_ = _tmp60_;
			_g_object_unref0 (_tmp57_);
			item = _tmp61_;
			{
				GeeIterator* _entry_it = NULL;
				GeeHashMap* _tmp62_;
				GeeSet* _tmp63_;
				GeeSet* _tmp64_;
				GeeSet* _tmp65_;
				GeeIterator* _tmp66_;
				GeeIterator* _tmp67_;
				_tmp62_ = added;
				_tmp63_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp62_);
				_tmp64_ = _tmp63_;
				_tmp65_ = _tmp64_;
				_tmp66_ = gee_iterable_iterator ((GeeIterable*) _tmp65_);
				_tmp67_ = _tmp66_;
				_g_object_unref0 (_tmp65_);
				_entry_it = _tmp67_;
				while (TRUE) {
					GeeIterator* _tmp68_;
					GeeMapEntry* entry = NULL;
					GeeIterator* _tmp69_;
					gpointer _tmp70_;
					ObjectsItem* _tmp71_;
					GeeMapEntry* _tmp72_;
					gconstpointer _tmp73_;
					gconstpointer _tmp74_;
					ObjectsLabel* _tmp75_;
					ObjectsLabel* _tmp76_;
					_tmp68_ = _entry_it;
					if (!gee_iterator_next (_tmp68_)) {
						break;
					}
					_tmp69_ = _entry_it;
					_tmp70_ = gee_iterator_get (_tmp69_);
					entry = (GeeMapEntry*) _tmp70_;
					_tmp71_ = item;
					_tmp72_ = entry;
					_tmp73_ = gee_map_entry_get_value (_tmp72_);
					_tmp74_ = _tmp73_;
					_tmp75_ = objects_item_add_label_if_not_exists (_tmp71_, (ObjectsLabel*) _tmp74_);
					_tmp76_ = _tmp75_;
					_g_object_unref0 (_tmp76_);
					_g_object_unref0 (entry);
				}
				_g_object_unref0 (_entry_it);
			}
			{
				GeeArrayList* _label_id_list = NULL;
				GeeArrayList* _tmp77_;
				gint _label_id_size = 0;
				GeeArrayList* _tmp78_;
				gint _tmp79_;
				gint _tmp80_;
				gint _label_id_index = 0;
				_tmp77_ = removed;
				_label_id_list = _tmp77_;
				_tmp78_ = _label_id_list;
				_tmp79_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp78_);
				_tmp80_ = _tmp79_;
				_label_id_size = _tmp80_;
				_label_id_index = -1;
				while (TRUE) {
					gint _tmp81_;
					gint _tmp82_;
					gchar* label_id = NULL;
					GeeArrayList* _tmp83_;
					gpointer _tmp84_;
					ObjectsItem* _tmp85_;
					const gchar* _tmp86_;
					ObjectsLabel* _tmp87_;
					ObjectsLabel* _tmp88_;
					_label_id_index = _label_id_index + 1;
					_tmp81_ = _label_id_index;
					_tmp82_ = _label_id_size;
					if (!(_tmp81_ < _tmp82_)) {
						break;
					}
					_tmp83_ = _label_id_list;
					_tmp84_ = gee_abstract_list_get ((GeeAbstractList*) _tmp83_, _label_id_index);
					label_id = (gchar*) _tmp84_;
					_tmp85_ = item;
					_tmp86_ = label_id;
					_tmp87_ = objects_item_delete_item_label (_tmp85_, _tmp86_);
					_tmp88_ = _tmp87_;
					_g_object_unref0 (_tmp88_);
					_g_free0 (label_id);
				}
			}
			_tmp89_ = objects;
			_tmp90_ = item;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp89_, _tmp90_);
			_g_object_unref0 (item);
			_g_free0 (key);
		}
		_g_object_unref0 (_key_it);
	}
	_tmp91_ = objects;
	widgets_multi_select_toolbar_update_items (self, _tmp91_);
	_g_object_unref0 (objects);
	_g_object_unref0 (removed);
	_g_object_unref0 (added);
}

static Block52Data*
block52_data_ref (Block52Data* _data52_)
{
	g_atomic_int_inc (&_data52_->_ref_count_);
	return _data52_;
}

static void
block52_data_unref (void * _userdata_)
{
	Block52Data* _data52_;
	_data52_ = (Block52Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data52_->_ref_count_)) {
		WidgetsMultiSelectToolbar* self;
		self = _data52_->self;
		_g_object_unref0 (_data52_->popover);
		_g_object_unref0 (self);
		g_slice_free (Block52Data, _data52_);
	}
}

static void
__lambda539_ (WidgetsMultiSelectToolbar* self)
{
	{
		GeeIterator* _key_it = NULL;
		GeeHashMap* _tmp0_;
		GeeSet* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
		_tmp0_ = self->items_selected;
		_tmp1_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_key_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			gchar* key = NULL;
			GeeIterator* _tmp7_;
			gpointer _tmp8_;
			GeeHashMap* _tmp9_;
			const gchar* _tmp10_;
			gpointer _tmp11_;
			LayoutsItemBase* _tmp12_;
			guint _tmp13_;
			_tmp6_ = _key_it;
			if (!gee_iterator_next (_tmp6_)) {
				break;
			}
			_tmp7_ = _key_it;
			_tmp8_ = gee_iterator_get (_tmp7_);
			key = (gchar*) _tmp8_;
			_tmp9_ = self->items_selected;
			_tmp10_ = key;
			_tmp11_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp9_, _tmp10_);
			_tmp12_ = (LayoutsItemBase*) _tmp11_;
			_tmp13_ = (guint) 0;
			layouts_item_base_checked_toggled (_tmp12_, TRUE, &_tmp13_);
			_g_object_unref0 (_tmp12_);
			_g_free0 (key);
		}
		_g_object_unref0 (_key_it);
	}
	widgets_multi_select_toolbar_unselect_all (self);
}

static void
___lambda539__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda539_ ((WidgetsMultiSelectToolbar*) self);
}

static void
__lambda540_ (Block52Data* _data52_)
{
	WidgetsMultiSelectToolbar* self;
	GString* text = NULL;
	GString* _tmp0_;
	GdkClipboard* clipboard = NULL;
	GdkDisplay* _tmp23_;
	GdkClipboard* _tmp24_;
	GdkClipboard* _tmp25_;
	GString* _tmp26_;
	const gchar* _tmp27_;
	ServicesEventBus* _tmp28_;
	ServicesEventBus* _tmp29_;
	Util* _tmp30_;
	Util* _tmp31_;
	GeeHashMap* _tmp32_;
	gint _tmp33_;
	gint _tmp34_;
	GeeHashMap* _tmp35_;
	gint _tmp36_;
	gint _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	AdwToast* _tmp40_;
	AdwToast* _tmp41_;
	self = _data52_->self;
	_tmp0_ = g_string_new ("");
	text = _tmp0_;
	{
		GeeIterator* _key_it = NULL;
		GeeHashMap* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeSet* _tmp4_;
		GeeIterator* _tmp5_;
		GeeIterator* _tmp6_;
		_tmp1_ = self->items_selected;
		_tmp2_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_key_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_;
			gchar* key = NULL;
			GeeIterator* _tmp8_;
			gpointer _tmp9_;
			ObjectsItem* item = NULL;
			GeeHashMap* _tmp10_;
			const gchar* _tmp11_;
			gpointer _tmp12_;
			LayoutsItemBase* _tmp13_;
			ObjectsItem* _tmp14_;
			ObjectsItem* _tmp15_;
			ObjectsItem* _tmp16_;
			ObjectsItem* _tmp17_;
			GString* _tmp18_;
			ObjectsItem* _tmp19_;
			gchar* _tmp20_;
			gchar* _tmp21_;
			GString* _tmp22_;
			_tmp7_ = _key_it;
			if (!gee_iterator_next (_tmp7_)) {
				break;
			}
			_tmp8_ = _key_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			key = (gchar*) _tmp9_;
			_tmp10_ = self->items_selected;
			_tmp11_ = key;
			_tmp12_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp10_, _tmp11_);
			_tmp13_ = (LayoutsItemBase*) _tmp12_;
			_tmp14_ = layouts_item_base_get_item (_tmp13_);
			_tmp15_ = _tmp14_;
			_tmp16_ = _g_object_ref0 (_tmp15_);
			_tmp17_ = _tmp16_;
			_g_object_unref0 (_tmp13_);
			item = _tmp17_;
			_tmp18_ = text;
			_tmp19_ = item;
			_tmp20_ = objects_item_to_clipboard_text (_tmp19_);
			_tmp21_ = _tmp20_;
			g_string_append (_tmp18_, _tmp21_);
			_g_free0 (_tmp21_);
			_tmp22_ = text;
			g_string_append (_tmp22_, "\n\n");
			_g_object_unref0 (item);
			_g_free0 (key);
		}
		_g_object_unref0 (_key_it);
	}
	_tmp23_ = gdk_display_get_default ();
	_tmp24_ = gdk_display_get_clipboard (_tmp23_);
	_tmp25_ = _g_object_ref0 (_tmp24_);
	clipboard = _tmp25_;
	_tmp26_ = text;
	_tmp27_ = _tmp26_->str;
	gdk_clipboard_set_text (clipboard, _tmp27_);
	_tmp28_ = services_event_bus_get_default ();
	_tmp29_ = _tmp28_;
	_tmp30_ = util_get_default ();
	_tmp31_ = _tmp30_;
	_tmp32_ = self->items_selected;
	_tmp33_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp32_);
	_tmp34_ = _tmp33_;
	_tmp35_ = self->items_selected;
	_tmp36_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp35_);
	_tmp37_ = _tmp36_;
	_tmp38_ = g_strdup_printf (ngettext ("%d task copied to clipboard", "%d tasks copied to clipboard", (gulong) _tmp34_), _tmp37_);
	_tmp39_ = _tmp38_;
	_tmp40_ = util_create_toast (_tmp31_, _tmp39_, (guint) 2, ADW_TOAST_PRIORITY_NORMAL);
	_tmp41_ = _tmp40_;
	g_signal_emit_by_name (_tmp29_, "send-toast", _tmp41_);
	_g_object_unref0 (_tmp41_);
	_g_free0 (_tmp39_);
	_g_object_unref0 (_tmp31_);
	_g_object_unref0 (_tmp29_);
	gtk_popover_popdown (_data52_->popover);
	_g_object_unref0 (clipboard);
	_g_string_free0 (text);
}

static void
___lambda540__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda540_ (self);
}

static void
__lambda542_ (WidgetsMultiSelectToolbar* self,
              const gchar* response)
{
	g_return_if_fail (response != NULL);
	if (g_strcmp0 (response, "delete") == 0) {
		{
			GeeIterator* _key_it = NULL;
			GeeHashMap* _tmp0_;
			GeeSet* _tmp1_;
			GeeSet* _tmp2_;
			GeeSet* _tmp3_;
			GeeIterator* _tmp4_;
			GeeIterator* _tmp5_;
			_tmp0_ = self->items_selected;
			_tmp1_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _tmp0_);
			_tmp2_ = _tmp1_;
			_tmp3_ = _tmp2_;
			_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
			_tmp5_ = _tmp4_;
			_g_object_unref0 (_tmp3_);
			_key_it = _tmp5_;
			while (TRUE) {
				GeeIterator* _tmp6_;
				gchar* key = NULL;
				GeeIterator* _tmp7_;
				gpointer _tmp8_;
				GeeHashMap* _tmp9_;
				const gchar* _tmp10_;
				gpointer _tmp11_;
				LayoutsItemBase* _tmp12_;
				ObjectsItem* _tmp13_;
				ObjectsItem* _tmp14_;
				_tmp6_ = _key_it;
				if (!gee_iterator_next (_tmp6_)) {
					break;
				}
				_tmp7_ = _key_it;
				_tmp8_ = gee_iterator_get (_tmp7_);
				key = (gchar*) _tmp8_;
				_tmp9_ = self->items_selected;
				_tmp10_ = key;
				_tmp11_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp9_, _tmp10_);
				_tmp12_ = (LayoutsItemBase*) _tmp11_;
				_tmp13_ = layouts_item_base_get_item (_tmp12_);
				_tmp14_ = _tmp13_;
				objects_item_delete_item (_tmp14_);
				_g_object_unref0 (_tmp12_);
				_g_free0 (key);
			}
			_g_object_unref0 (_key_it);
		}
		widgets_multi_select_toolbar_unselect_all (self);
	}
}

static void
___lambda542__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                         const gchar* response,
                                         gpointer self)
{
	__lambda542_ ((WidgetsMultiSelectToolbar*) self, response);
}

static void
__lambda541_ (WidgetsMultiSelectToolbar* self)
{
	gchar* title = NULL;
	gchar* _tmp0_;
	gchar* message = NULL;
	gchar* _tmp1_;
	GeeHashMap* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	AdwAlertDialog* dialog = NULL;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	AdwAlertDialog* _tmp21_;
	Planify* _tmp22_;
	MainWindow* _tmp23_;
	_tmp0_ = g_strdup (_ ("Delete To-Do"));
	title = _tmp0_;
	_tmp1_ = g_strdup (_ ("Are you sure you want to delete this to-do?"));
	message = _tmp1_;
	_tmp2_ = self->items_selected;
	_tmp3_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_ > 0) {
		GeeHashMap* _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		GeeHashMap* _tmp8_;
		gint _tmp9_;
		gint _tmp10_;
		gchar* _tmp11_;
		GeeHashMap* _tmp12_;
		gint _tmp13_;
		gint _tmp14_;
		GeeHashMap* _tmp15_;
		gint _tmp16_;
		gint _tmp17_;
		gchar* _tmp18_;
		_tmp5_ = self->items_selected;
		_tmp6_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = self->items_selected;
		_tmp9_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = g_strdup_printf (ngettext ("Delete %d To-Do", "Delete %d To-Dos", (gulong) _tmp7_), _tmp10_);
		_g_free0 (title);
		title = _tmp11_;
		_tmp12_ = self->items_selected;
		_tmp13_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = self->items_selected;
		_tmp16_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = g_strdup_printf (ngettext ("Are you sure you want to delete this %d to-do?", "Are you sure you want to delete these %d to-dos?", (gulong) _tmp14_), _tmp17_);
		_g_free0 (message);
		message = _tmp18_;
	}
	_tmp19_ = title;
	_tmp20_ = message;
	_tmp21_ = (AdwAlertDialog*) adw_alert_dialog_new (_tmp19_, _tmp20_);
	g_object_ref_sink (_tmp21_);
	dialog = _tmp21_;
	adw_alert_dialog_set_body_use_markup (dialog, TRUE);
	adw_alert_dialog_add_response (dialog, "cancel", _ ("Cancel"));
	adw_alert_dialog_add_response (dialog, "delete", _ ("Delete"));
	adw_alert_dialog_set_response_appearance (dialog, "delete", ADW_RESPONSE_DESTRUCTIVE);
	_tmp22_ = planify__instance;
	_tmp23_ = _tmp22_->main_window;
	adw_dialog_present ((AdwDialog*) dialog, (GtkWidget*) _tmp23_);
	g_signal_connect_object (dialog, "response", (GCallback) ___lambda542__adw_alert_dialog_response, self, 0);
	_g_object_unref0 (dialog);
	_g_free0 (message);
	_g_free0 (title);
}

static void
___lambda541__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda541_ ((WidgetsMultiSelectToolbar*) self);
}

static GtkPopover*
widgets_multi_select_toolbar_build_menu_popover (WidgetsMultiSelectToolbar* self)
{
	Block52Data* _data52_;
	WidgetsContextMenuMenuItem* _tmp0_;
	WidgetsContextMenuMenuItem* copy_item = NULL;
	WidgetsContextMenuMenuItem* _tmp1_;
	WidgetsContextMenuMenuItem* _tmp2_;
	WidgetsContextMenuMenuItem* _tmp3_;
	GtkBox* menu_box = NULL;
	GtkBox* _tmp4_;
	WidgetsContextMenuMenuItem* _tmp5_;
	WidgetsContextMenuMenuSeparator* _tmp6_;
	WidgetsContextMenuMenuSeparator* _tmp7_;
	WidgetsContextMenuMenuItem* _tmp8_;
	GtkWidget* _tmp9_;
	GtkPopover* _tmp10_ = NULL;
	WidgetsContextMenuMenuItem* _tmp11_;
	WidgetsContextMenuMenuItem* _tmp12_;
	GtkPopover* _tmp13_;
	GtkPopover* result;
	g_return_val_if_fail (self != NULL, NULL);
	_data52_ = g_slice_new0 (Block52Data);
	_data52_->_ref_count_ = 1;
	_data52_->self = g_object_ref (self);
	_tmp0_ = widgets_context_menu_menu_item_new (_ ("Mark as Completed"), "check-round-outline-symbolic");
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->complete_item);
	self->priv->complete_item = _tmp0_;
	_tmp1_ = widgets_context_menu_menu_item_new (_ ("Copy to Clipboard"), "edit-copy-symbolic");
	g_object_ref_sink (_tmp1_);
	copy_item = _tmp1_;
	_tmp2_ = widgets_context_menu_menu_item_new (_ ("Delete"), "user-trash-symbolic");
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->delete_item);
	self->priv->delete_item = _tmp2_;
	_tmp3_ = self->priv->delete_item;
	gtk_widget_add_css_class ((GtkWidget*) _tmp3_, "menu-item-danger");
	_tmp4_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp4_);
	menu_box = _tmp4_;
	gtk_widget_set_margin_bottom ((GtkWidget*) menu_box, 3);
	gtk_widget_set_margin_top ((GtkWidget*) menu_box, 3);
	_tmp5_ = self->priv->complete_item;
	gtk_box_append (menu_box, (GtkWidget*) _tmp5_);
	gtk_box_append (menu_box, (GtkWidget*) copy_item);
	_tmp6_ = widgets_context_menu_menu_separator_new ();
	g_object_ref_sink (_tmp6_);
	_tmp7_ = _tmp6_;
	gtk_box_append (menu_box, (GtkWidget*) _tmp7_);
	_g_object_unref0 (_tmp7_);
	_tmp8_ = self->priv->delete_item;
	gtk_box_append (menu_box, (GtkWidget*) _tmp8_);
	_tmp9_ = _g_object_ref0 ((GtkWidget*) menu_box);
	_tmp10_ = (GtkPopover*) gtk_popover_new ();
	gtk_popover_set_has_arrow (_tmp10_, FALSE);
	gtk_popover_set_child (_tmp10_, _tmp9_);
	_g_object_unref0 (_tmp9_);
	gtk_popover_set_position (_tmp10_, GTK_POS_TOP);
	g_object_ref_sink (_tmp10_);
	_data52_->popover = _tmp10_;
	_tmp11_ = self->priv->complete_item;
	g_signal_connect_object ((GtkButton*) _tmp11_, "clicked", (GCallback) ___lambda539__gtk_button_clicked, self, 0);
	g_signal_connect_data ((GtkButton*) copy_item, "clicked", (GCallback) ___lambda540__gtk_button_clicked, block52_data_ref (_data52_), (GClosureNotify) block52_data_unref, 0);
	_tmp12_ = self->priv->delete_item;
	g_signal_connect_object ((GtkButton*) _tmp12_, "clicked", (GCallback) ___lambda541__gtk_button_clicked, self, 0);
	_tmp13_ = _g_object_ref0 (_data52_->popover);
	result = _tmp13_;
	_g_object_unref0 (menu_box);
	_g_object_unref0 (copy_item);
	block52_data_unref (_data52_);
	_data52_ = NULL;
	return result;
}

static void
widgets_multi_select_toolbar_unselect_all (WidgetsMultiSelectToolbar* self)
{
	GeeHashMap* _tmp13_;
	GeeHashMap* _tmp14_;
	GtkLabel* _tmp15_;
	g_return_if_fail (self != NULL);
	{
		GeeIterator* _key_it = NULL;
		GeeHashMap* _tmp0_;
		GeeSet* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
		_tmp0_ = self->items_selected;
		_tmp1_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_key_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			gchar* key = NULL;
			GeeIterator* _tmp7_;
			gpointer _tmp8_;
			GeeHashMap* _tmp9_;
			const gchar* _tmp10_;
			gpointer _tmp11_;
			LayoutsItemBase* _tmp12_;
			_tmp6_ = _key_it;
			if (!gee_iterator_next (_tmp6_)) {
				break;
			}
			_tmp7_ = _key_it;
			_tmp8_ = gee_iterator_get (_tmp7_);
			key = (gchar*) _tmp8_;
			_tmp9_ = self->items_selected;
			_tmp10_ = key;
			_tmp11_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp9_, _tmp10_);
			_tmp12_ = (LayoutsItemBase*) _tmp11_;
			layouts_item_base_select_row (_tmp12_, FALSE);
			_g_object_unref0 (_tmp12_);
			_g_free0 (key);
		}
		_g_object_unref0 (_key_it);
	}
	_tmp13_ = self->items_selected;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp13_);
	_tmp14_ = self->labels;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp14_);
	_tmp15_ = self->priv->size_label;
	gtk_label_set_label (_tmp15_, "0");
	g_signal_emit (self, widgets_multi_select_toolbar_signals[WIDGETS_MULTI_SELECT_TOOLBAR_CLOSED_SIGNAL], 0);
}

static void
widgets_multi_select_toolbar_check_select_bar (WidgetsMultiSelectToolbar* self)
{
	gboolean active = FALSE;
	GeeHashMap* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	GtkLabel* _tmp17_;
	GeeHashMap* _tmp18_;
	gint _tmp19_;
	gint _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	WidgetsScheduleButton* _tmp23_;
	GtkButton* _tmp24_;
	WidgetsPriorityButton* _tmp25_;
	WidgetsLabelPickerLabelButton* _tmp26_;
	WidgetsContextMenuMenuItem* _tmp27_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->items_selected;
	_tmp1_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp0_);
	_tmp2_ = _tmp1_;
	active = _tmp2_ > 0;
	{
		GeeIterator* _item_base_it = NULL;
		GeeHashMap* _tmp3_;
		GeeCollection* _tmp4_;
		GeeCollection* _tmp5_;
		GeeCollection* _tmp6_;
		GeeIterator* _tmp7_;
		GeeIterator* _tmp8_;
		_tmp3_ = self->items_selected;
		_tmp4_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = _tmp5_;
		_tmp7_ = gee_iterable_iterator ((GeeIterable*) _tmp6_);
		_tmp8_ = _tmp7_;
		_g_object_unref0 (_tmp6_);
		_item_base_it = _tmp8_;
		while (TRUE) {
			GeeIterator* _tmp9_;
			LayoutsItemBase* item_base = NULL;
			GeeIterator* _tmp10_;
			gpointer _tmp11_;
			LayoutsItemBase* _tmp12_;
			ObjectsItem* _tmp13_;
			ObjectsItem* _tmp14_;
			gboolean _tmp15_;
			gboolean _tmp16_;
			_tmp9_ = _item_base_it;
			if (!gee_iterator_next (_tmp9_)) {
				break;
			}
			_tmp10_ = _item_base_it;
			_tmp11_ = gee_iterator_get (_tmp10_);
			item_base = (LayoutsItemBase*) _tmp11_;
			_tmp12_ = item_base;
			_tmp13_ = layouts_item_base_get_item (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = objects_item_get_checked (_tmp14_);
			_tmp16_ = _tmp15_;
			if (_tmp16_) {
				active = FALSE;
				_g_object_unref0 (item_base);
				break;
			}
			_g_object_unref0 (item_base);
		}
		_g_object_unref0 (_item_base_it);
	}
	_tmp17_ = self->priv->size_label;
	_tmp18_ = self->items_selected;
	_tmp19_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp18_);
	_tmp20_ = _tmp19_;
	_tmp21_ = g_strdup_printf ("%i", _tmp20_);
	_tmp22_ = _tmp21_;
	gtk_label_set_label (_tmp17_, _tmp22_);
	_g_free0 (_tmp22_);
	_tmp23_ = self->priv->schedule_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp23_, active);
	_tmp24_ = self->priv->move_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp24_, active);
	_tmp25_ = self->priv->priority_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp25_, active);
	_tmp26_ = self->priv->label_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp26_, active);
	_tmp27_ = self->priv->complete_item;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp27_, active);
}

static void
widgets_multi_select_toolbar_check_labels (WidgetsMultiSelectToolbar* self,
                                           ObjectsItem* item,
                                           gboolean active)
{
	GeeHashMap* _tmp0_;
	GeeArrayList* _labels = NULL;
	GeeArrayList* _tmp32_;
	WidgetsLabelPickerLabelButton* _tmp44_;
	GeeArrayList* _tmp45_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	_tmp0_ = self->labels;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp0_);
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeSet* _tmp4_;
		GeeIterator* _tmp5_;
		GeeIterator* _tmp6_;
		_tmp1_ = self->items_selected;
		_tmp2_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_entry_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp8_;
			gpointer _tmp9_;
			_tmp7_ = _entry_it;
			if (!gee_iterator_next (_tmp7_)) {
				break;
			}
			_tmp8_ = _entry_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			entry = (GeeMapEntry*) _tmp9_;
			{
				GeeArrayList* _label_list = NULL;
				GeeMapEntry* _tmp10_;
				gconstpointer _tmp11_;
				gconstpointer _tmp12_;
				ObjectsItem* _tmp13_;
				ObjectsItem* _tmp14_;
				GeeArrayList* _tmp15_;
				gint _label_size = 0;
				GeeArrayList* _tmp16_;
				gint _tmp17_;
				gint _tmp18_;
				gint _label_index = 0;
				_tmp10_ = entry;
				_tmp11_ = gee_map_entry_get_value (_tmp10_);
				_tmp12_ = _tmp11_;
				_tmp13_ = layouts_item_base_get_item ((LayoutsItemBase*) _tmp12_);
				_tmp14_ = _tmp13_;
				_tmp15_ = objects_item_get_labels_list (_tmp14_);
				_label_list = _tmp15_;
				_tmp16_ = _label_list;
				_tmp17_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp16_);
				_tmp18_ = _tmp17_;
				_label_size = _tmp18_;
				_label_index = -1;
				while (TRUE) {
					gint _tmp19_;
					gint _tmp20_;
					ObjectsLabel* label = NULL;
					GeeArrayList* _tmp21_;
					gpointer _tmp22_;
					GeeHashMap* _tmp23_;
					ObjectsLabel* _tmp24_;
					const gchar* _tmp25_;
					const gchar* _tmp26_;
					_label_index = _label_index + 1;
					_tmp19_ = _label_index;
					_tmp20_ = _label_size;
					if (!(_tmp19_ < _tmp20_)) {
						break;
					}
					_tmp21_ = _label_list;
					_tmp22_ = gee_abstract_list_get ((GeeAbstractList*) _tmp21_, _label_index);
					label = (ObjectsLabel*) _tmp22_;
					_tmp23_ = self->labels;
					_tmp24_ = label;
					_tmp25_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp24_);
					_tmp26_ = _tmp25_;
					if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp23_, _tmp26_)) {
						GeeHashMap* _tmp27_;
						ObjectsLabel* _tmp28_;
						const gchar* _tmp29_;
						const gchar* _tmp30_;
						ObjectsLabel* _tmp31_;
						_tmp27_ = self->labels;
						_tmp28_ = label;
						_tmp29_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp28_);
						_tmp30_ = _tmp29_;
						_tmp31_ = label;
						gee_abstract_map_set ((GeeAbstractMap*) _tmp27_, _tmp30_, _tmp31_);
					}
					_g_object_unref0 (label);
				}
				_g_object_unref0 (_label_list);
			}
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	_tmp32_ = gee_array_list_new (OBJECTS_TYPE_LABEL, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_labels = _tmp32_;
	{
		GeeIterator* _label_it = NULL;
		GeeHashMap* _tmp33_;
		GeeCollection* _tmp34_;
		GeeCollection* _tmp35_;
		GeeCollection* _tmp36_;
		GeeIterator* _tmp37_;
		GeeIterator* _tmp38_;
		_tmp33_ = self->labels;
		_tmp34_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp33_);
		_tmp35_ = _tmp34_;
		_tmp36_ = _tmp35_;
		_tmp37_ = gee_iterable_iterator ((GeeIterable*) _tmp36_);
		_tmp38_ = _tmp37_;
		_g_object_unref0 (_tmp36_);
		_label_it = _tmp38_;
		while (TRUE) {
			GeeIterator* _tmp39_;
			ObjectsLabel* label = NULL;
			GeeIterator* _tmp40_;
			gpointer _tmp41_;
			GeeArrayList* _tmp42_;
			ObjectsLabel* _tmp43_;
			_tmp39_ = _label_it;
			if (!gee_iterator_next (_tmp39_)) {
				break;
			}
			_tmp40_ = _label_it;
			_tmp41_ = gee_iterator_get (_tmp40_);
			label = (ObjectsLabel*) _tmp41_;
			_tmp42_ = _labels;
			_tmp43_ = label;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp42_, _tmp43_);
			_g_object_unref0 (label);
		}
		_g_object_unref0 (_label_it);
	}
	_tmp44_ = self->priv->label_button;
	_tmp45_ = _labels;
	widgets_label_picker_label_button_set_labels (_tmp44_, _tmp45_);
	_g_object_unref0 (_labels);
}

void
widgets_multi_select_toolbar_move (WidgetsMultiSelectToolbar* self,
                                   ObjectsProject* project)
{
	gint count = 0;
	GeeHashMap* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gchar* message = NULL;
	const gchar* _tmp42_;
	const gchar* _tmp43_;
	gchar* _tmp44_;
	ServicesEventBus* _tmp45_;
	ServicesEventBus* _tmp46_;
	Util* _tmp47_;
	Util* _tmp48_;
	AdwToast* _tmp49_;
	AdwToast* _tmp50_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (project != NULL);
	_tmp0_ = self->items_selected;
	_tmp1_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp0_);
	_tmp2_ = _tmp1_;
	count = _tmp2_;
	{
		GeeIterator* _key_it = NULL;
		GeeHashMap* _tmp3_;
		GeeSet* _tmp4_;
		GeeSet* _tmp5_;
		GeeSet* _tmp6_;
		GeeIterator* _tmp7_;
		GeeIterator* _tmp8_;
		_tmp3_ = self->items_selected;
		_tmp4_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = _tmp5_;
		_tmp7_ = gee_iterable_iterator ((GeeIterable*) _tmp6_);
		_tmp8_ = _tmp7_;
		_g_object_unref0 (_tmp6_);
		_key_it = _tmp8_;
		while (TRUE) {
			GeeIterator* _tmp9_;
			gchar* key = NULL;
			GeeIterator* _tmp10_;
			gpointer _tmp11_;
			ObjectsItem* item = NULL;
			GeeHashMap* _tmp12_;
			const gchar* _tmp13_;
			gpointer _tmp14_;
			LayoutsItemBase* _tmp15_;
			ObjectsItem* _tmp16_;
			ObjectsItem* _tmp17_;
			ObjectsItem* _tmp18_;
			ObjectsItem* _tmp19_;
			gchar* project_id = NULL;
			const gchar* _tmp20_;
			const gchar* _tmp21_;
			gchar* _tmp22_;
			ObjectsItem* _tmp23_;
			ObjectsProject* _tmp24_;
			ObjectsProject* _tmp25_;
			const gchar* _tmp26_;
			const gchar* _tmp27_;
			const gchar* _tmp28_;
			const gchar* _tmp29_;
			_tmp9_ = _key_it;
			if (!gee_iterator_next (_tmp9_)) {
				break;
			}
			_tmp10_ = _key_it;
			_tmp11_ = gee_iterator_get (_tmp10_);
			key = (gchar*) _tmp11_;
			_tmp12_ = self->items_selected;
			_tmp13_ = key;
			_tmp14_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp12_, _tmp13_);
			_tmp15_ = (LayoutsItemBase*) _tmp14_;
			_tmp16_ = layouts_item_base_get_item (_tmp15_);
			_tmp17_ = _tmp16_;
			_tmp18_ = _g_object_ref0 (_tmp17_);
			_tmp19_ = _tmp18_;
			_g_object_unref0 (_tmp15_);
			item = _tmp19_;
			_tmp20_ = objects_base_object_get_id ((ObjectsBaseObject*) project);
			_tmp21_ = _tmp20_;
			_tmp22_ = g_strdup (_tmp21_);
			project_id = _tmp22_;
			_tmp23_ = item;
			_tmp24_ = objects_item_get_project (_tmp23_);
			_tmp25_ = _tmp24_;
			_tmp26_ = objects_project_get_source_id (_tmp25_);
			_tmp27_ = _tmp26_;
			_tmp28_ = objects_project_get_source_id (project);
			_tmp29_ = _tmp28_;
			if (g_strcmp0 (_tmp27_, _tmp29_) != 0) {
				Util* _tmp30_;
				Util* _tmp31_;
				ObjectsItem* _tmp32_;
				_tmp30_ = util_get_default ();
				_tmp31_ = _tmp30_;
				_tmp32_ = item;
				util_move_backend_type_item (_tmp31_, _tmp32_, project, "", FALSE, NULL, NULL);
				_g_object_unref0 (_tmp31_);
			} else {
				gboolean _tmp33_ = FALSE;
				ObjectsItem* _tmp34_;
				const gchar* _tmp35_;
				const gchar* _tmp36_;
				const gchar* _tmp37_;
				_tmp34_ = item;
				_tmp35_ = objects_item_get_project_id (_tmp34_);
				_tmp36_ = _tmp35_;
				_tmp37_ = project_id;
				if (g_strcmp0 (_tmp36_, _tmp37_) != 0) {
					_tmp33_ = TRUE;
				} else {
					ObjectsItem* _tmp38_;
					const gchar* _tmp39_;
					const gchar* _tmp40_;
					_tmp38_ = item;
					_tmp39_ = objects_item_get_section_id (_tmp38_);
					_tmp40_ = _tmp39_;
					_tmp33_ = g_strcmp0 (_tmp40_, "") != 0;
				}
				if (_tmp33_) {
					ObjectsItem* _tmp41_;
					_tmp41_ = item;
					objects_item_move (_tmp41_, project, "", FALSE);
				}
			}
			_g_free0 (project_id);
			_g_object_unref0 (item);
			_g_free0 (key);
		}
		_g_object_unref0 (_key_it);
	}
	_tmp42_ = objects_base_object_get_name ((ObjectsBaseObject*) project);
	_tmp43_ = _tmp42_;
	_tmp44_ = g_strdup_printf (ngettext ("Task moved to %s", "%d tasks moved to %s", (gulong) count), count, _tmp43_);
	message = _tmp44_;
	_tmp45_ = services_event_bus_get_default ();
	_tmp46_ = _tmp45_;
	_tmp47_ = util_get_default ();
	_tmp48_ = _tmp47_;
	_tmp49_ = util_create_toast (_tmp48_, message, (guint) 2, ADW_TOAST_PRIORITY_NORMAL);
	_tmp50_ = _tmp49_;
	g_signal_emit_by_name (_tmp46_, "send-toast", _tmp50_);
	_g_object_unref0 (_tmp50_);
	_g_object_unref0 (_tmp48_);
	_g_object_unref0 (_tmp46_);
	widgets_multi_select_toolbar_unselect_all (self);
	_g_free0 (message);
}

ObjectsProject*
widgets_multi_select_toolbar_get_project (WidgetsMultiSelectToolbar* self)
{
	ObjectsProject* result;
	ObjectsProject* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_project;
	result = _tmp0_;
	return result;
}

static void
widgets_multi_select_toolbar_set_project (WidgetsMultiSelectToolbar* self,
                                          ObjectsProject* value)
{
	ObjectsProject* old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_multi_select_toolbar_get_project (self);
	if (old_value != value) {
		ObjectsProject* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_project);
		self->priv->_project = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, widgets_multi_select_toolbar_properties[WIDGETS_MULTI_SELECT_TOOLBAR_PROJECT_PROPERTY]);
	}
}

static void
_widgets_multi_select_toolbar___lambda543_ (WidgetsMultiSelectToolbar* self,
                                            GtkWidget* _row)
{
	LayoutsItemBase* row = NULL;
	LayoutsItemBase* _tmp0_;
	GeeHashMap* _tmp1_;
	LayoutsItemBase* _tmp2_;
	ObjectsItem* _tmp3_;
	ObjectsItem* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	LayoutsItemBase* _tmp22_;
	ObjectsItem* _tmp23_;
	ObjectsItem* _tmp24_;
	g_return_if_fail (_row != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_row, LAYOUTS_TYPE_ITEM_BASE, LayoutsItemBase));
	row = _tmp0_;
	_tmp1_ = self->items_selected;
	_tmp2_ = row;
	_tmp3_ = layouts_item_base_get_item (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp4_);
	_tmp6_ = _tmp5_;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp1_, _tmp6_)) {
		GeeHashMap* _tmp7_;
		LayoutsItemBase* _tmp8_;
		ObjectsItem* _tmp9_;
		ObjectsItem* _tmp10_;
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		LayoutsItemBase* _tmp13_;
		_tmp7_ = self->items_selected;
		_tmp8_ = row;
		_tmp9_ = layouts_item_base_get_item (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp10_);
		_tmp12_ = _tmp11_;
		gee_abstract_map_unset ((GeeAbstractMap*) _tmp7_, _tmp12_, NULL);
		_tmp13_ = row;
		layouts_item_base_select_row (_tmp13_, FALSE);
	} else {
		GeeHashMap* _tmp14_;
		LayoutsItemBase* _tmp15_;
		ObjectsItem* _tmp16_;
		ObjectsItem* _tmp17_;
		const gchar* _tmp18_;
		const gchar* _tmp19_;
		LayoutsItemBase* _tmp20_;
		LayoutsItemBase* _tmp21_;
		_tmp14_ = self->items_selected;
		_tmp15_ = row;
		_tmp16_ = layouts_item_base_get_item (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = row;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp14_, _tmp19_, _tmp20_);
		_tmp21_ = row;
		layouts_item_base_select_row (_tmp21_, TRUE);
	}
	_tmp22_ = row;
	_tmp23_ = layouts_item_base_get_item (_tmp22_);
	_tmp24_ = _tmp23_;
	widgets_multi_select_toolbar_check_labels (self, _tmp24_, TRUE);
	widgets_multi_select_toolbar_check_select_bar (self);
	_g_object_unref0 (row);
}

static void
__widgets_multi_select_toolbar___lambda543__services_event_bus_select_item (ServicesEventBus* _sender,
                                                                            GtkWidget* itemrow,
                                                                            gpointer self)
{
	_widgets_multi_select_toolbar___lambda543_ ((WidgetsMultiSelectToolbar*) self, itemrow);
}

static void
_widgets_multi_select_toolbar___lambda544_ (WidgetsMultiSelectToolbar* self,
                                            GtkWidget* _row)
{
	LayoutsItemBase* row = NULL;
	LayoutsItemBase* _tmp0_;
	GeeHashMap* _tmp1_;
	LayoutsItemBase* _tmp2_;
	ObjectsItem* _tmp3_;
	ObjectsItem* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	LayoutsItemBase* _tmp14_;
	ObjectsItem* _tmp15_;
	ObjectsItem* _tmp16_;
	g_return_if_fail (_row != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_row, LAYOUTS_TYPE_ITEM_BASE, LayoutsItemBase));
	row = _tmp0_;
	_tmp1_ = self->items_selected;
	_tmp2_ = row;
	_tmp3_ = layouts_item_base_get_item (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp4_);
	_tmp6_ = _tmp5_;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp1_, _tmp6_)) {
		GeeHashMap* _tmp7_;
		LayoutsItemBase* _tmp8_;
		ObjectsItem* _tmp9_;
		ObjectsItem* _tmp10_;
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		LayoutsItemBase* _tmp13_;
		_tmp7_ = self->items_selected;
		_tmp8_ = row;
		_tmp9_ = layouts_item_base_get_item (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp10_);
		_tmp12_ = _tmp11_;
		gee_abstract_map_unset ((GeeAbstractMap*) _tmp7_, _tmp12_, NULL);
		_tmp13_ = row;
		layouts_item_base_select_row (_tmp13_, FALSE);
	}
	_tmp14_ = row;
	_tmp15_ = layouts_item_base_get_item (_tmp14_);
	_tmp16_ = _tmp15_;
	widgets_multi_select_toolbar_check_labels (self, _tmp16_, FALSE);
	widgets_multi_select_toolbar_check_select_bar (self);
	_g_object_unref0 (row);
}

static void
__widgets_multi_select_toolbar___lambda544__services_event_bus_unselect_item (ServicesEventBus* _sender,
                                                                              GtkWidget* itemrow,
                                                                              gpointer self)
{
	_widgets_multi_select_toolbar___lambda544_ ((WidgetsMultiSelectToolbar*) self, itemrow);
}

static void
_widgets_multi_select_toolbar___lambda545_ (WidgetsMultiSelectToolbar* self)
{
	widgets_multi_select_toolbar_unselect_all (self);
}

static void
__widgets_multi_select_toolbar___lambda545__services_event_bus_unselect_all (ServicesEventBus* _sender,
                                                                             gpointer self)
{
	_widgets_multi_select_toolbar___lambda545_ ((WidgetsMultiSelectToolbar*) self);
}

static void
_widgets_multi_select_toolbar___lambda546_ (WidgetsMultiSelectToolbar* self)
{
	widgets_multi_select_toolbar_unselect_all (self);
}

static void
__widgets_multi_select_toolbar___lambda546__gtk_button_clicked (GtkButton* _sender,
                                                                gpointer self)
{
	_widgets_multi_select_toolbar___lambda546_ ((WidgetsMultiSelectToolbar*) self);
}

static void
_widgets_multi_select_toolbar___lambda547_ (WidgetsMultiSelectToolbar* self)
{
	WidgetsScheduleButton* _tmp0_;
	ObjectsDueDate* _tmp1_;
	ObjectsDueDate* _tmp2_;
	_tmp0_ = self->priv->schedule_button;
	_tmp1_ = widgets_schedule_button_get_duedate (_tmp0_);
	_tmp2_ = _tmp1_;
	widgets_multi_select_toolbar_set_datetime (self, _tmp2_);
}

static void
__widgets_multi_select_toolbar___lambda547__widgets_schedule_button_duedate_changed (WidgetsScheduleButton* _sender,
                                                                                     gpointer self)
{
	_widgets_multi_select_toolbar___lambda547_ ((WidgetsMultiSelectToolbar*) self);
}

static void
__lambda549_ (WidgetsMultiSelectToolbar* self,
              const gchar* type,
              const gchar* id)
{
	ServicesStore* _tmp0_;
	ObjectsProject* _tmp1_;
	ObjectsProject* _tmp2_;
	g_return_if_fail (type != NULL);
	g_return_if_fail (id != NULL);
	_tmp0_ = services_store_instance ();
	_tmp1_ = services_store_get_project (_tmp0_, id);
	_tmp2_ = _tmp1_;
	widgets_multi_select_toolbar_move (self, _tmp2_);
	_g_object_unref0 (_tmp2_);
}

static void
___lambda549__dialogs_project_picker_project_picker_changed (DialogsProjectPickerProjectPicker* _sender,
                                                             const gchar* type,
                                                             const gchar* id,
                                                             gpointer self)
{
	__lambda549_ ((WidgetsMultiSelectToolbar*) self, type, id);
}

static void
_widgets_multi_select_toolbar___lambda548_ (WidgetsMultiSelectToolbar* self)
{
	DialogsProjectPickerProjectPicker* dialog = NULL;
	DialogsProjectPickerProjectPicker* _tmp0_;
	DialogsProjectPickerProjectPicker* _tmp1_;
	ObjectsProject* _tmp2_;
	DialogsProjectPickerProjectPicker* _tmp3_;
	DialogsProjectPickerProjectPicker* _tmp4_;
	Planify* _tmp5_;
	MainWindow* _tmp6_;
	_tmp0_ = dialogs_project_picker_project_picker_new_for_projects ();
	g_object_ref_sink (_tmp0_);
	dialog = _tmp0_;
	_tmp1_ = dialog;
	_tmp2_ = self->priv->_project;
	dialogs_project_picker_project_picker_set_project (_tmp1_, _tmp2_);
	_tmp3_ = dialog;
	g_signal_connect_object (_tmp3_, "changed", (GCallback) ___lambda549__dialogs_project_picker_project_picker_changed, self, 0);
	_tmp4_ = dialog;
	_tmp5_ = planify__instance;
	_tmp6_ = _tmp5_->main_window;
	adw_dialog_present ((AdwDialog*) _tmp4_, (GtkWidget*) _tmp6_);
	_g_object_unref0 (dialog);
}

static void
__widgets_multi_select_toolbar___lambda548__gtk_button_clicked (GtkButton* _sender,
                                                                gpointer self)
{
	_widgets_multi_select_toolbar___lambda548_ ((WidgetsMultiSelectToolbar*) self);
}

static void
_widgets_multi_select_toolbar___lambda550_ (WidgetsMultiSelectToolbar* self,
                                            gboolean active)
{
	if (active) {
		GeeHashMap* _tmp0_;
		_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, OBJECTS_TYPE_LABEL, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
		_g_object_unref0 (self->priv->_initial_labels);
		self->priv->_initial_labels = _tmp0_;
		{
			GeeIterator* _entry_it = NULL;
			GeeHashMap* _tmp1_;
			GeeSet* _tmp2_;
			GeeSet* _tmp3_;
			GeeSet* _tmp4_;
			GeeIterator* _tmp5_;
			GeeIterator* _tmp6_;
			_tmp1_ = self->labels;
			_tmp2_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp1_);
			_tmp3_ = _tmp2_;
			_tmp4_ = _tmp3_;
			_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
			_tmp6_ = _tmp5_;
			_g_object_unref0 (_tmp4_);
			_entry_it = _tmp6_;
			while (TRUE) {
				GeeIterator* _tmp7_;
				GeeMapEntry* entry = NULL;
				GeeIterator* _tmp8_;
				gpointer _tmp9_;
				GeeHashMap* _tmp10_;
				GeeMapEntry* _tmp11_;
				gconstpointer _tmp12_;
				gconstpointer _tmp13_;
				GeeMapEntry* _tmp14_;
				gconstpointer _tmp15_;
				gconstpointer _tmp16_;
				_tmp7_ = _entry_it;
				if (!gee_iterator_next (_tmp7_)) {
					break;
				}
				_tmp8_ = _entry_it;
				_tmp9_ = gee_iterator_get (_tmp8_);
				entry = (GeeMapEntry*) _tmp9_;
				_tmp10_ = self->priv->_initial_labels;
				_tmp11_ = entry;
				_tmp12_ = gee_map_entry_get_key (_tmp11_);
				_tmp13_ = _tmp12_;
				_tmp14_ = entry;
				_tmp15_ = gee_map_entry_get_value (_tmp14_);
				_tmp16_ = _tmp15_;
				gee_abstract_map_set ((GeeAbstractMap*) _tmp10_, (const gchar*) _tmp13_, (ObjectsLabel*) _tmp16_);
				_g_object_unref0 (entry);
			}
			_g_object_unref0 (_entry_it);
		}
	}
}

static void
__widgets_multi_select_toolbar___lambda550__widgets_label_picker_label_button_picker_opened (WidgetsLabelPickerLabelButton* _sender,
                                                                                             gboolean active,
                                                                                             gpointer self)
{
	_widgets_multi_select_toolbar___lambda550_ ((WidgetsMultiSelectToolbar*) self, active);
}

static void
_widgets_multi_select_toolbar___lambda551_ (WidgetsMultiSelectToolbar* self,
                                            GeeHashMap* new_labels)
{
	g_return_if_fail (new_labels != NULL);
	widgets_multi_select_toolbar_apply_label_changes (self, new_labels);
}

static void
__widgets_multi_select_toolbar___lambda551__widgets_label_picker_label_button_labels_changed (WidgetsLabelPickerLabelButton* _sender,
                                                                                              GeeHashMap* labels,
                                                                                              gpointer self)
{
	_widgets_multi_select_toolbar___lambda551_ ((WidgetsMultiSelectToolbar*) self, labels);
}

static void
_widgets_multi_select_toolbar___lambda552_ (WidgetsMultiSelectToolbar* self,
                                            gint priority)
{
	widgets_multi_select_toolbar_set_priority (self, priority);
}

static void
__widgets_multi_select_toolbar___lambda552__widgets_priority_button_changed (WidgetsPriorityButton* _sender,
                                                                             gint priority,
                                                                             gpointer self)
{
	_widgets_multi_select_toolbar___lambda552_ ((WidgetsMultiSelectToolbar*) self, priority);
}

static GObject *
widgets_multi_select_toolbar_constructor (GType type,
                                          guint n_construct_properties,
                                          GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WidgetsMultiSelectToolbar * self;
	gchar* _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar** _tmp5_;
	GtkLabel* _tmp6_ = NULL;
	WidgetsScheduleButton* _tmp7_ = NULL;
	gchar* _tmp8_;
	GtkButton* _tmp9_ = NULL;
	GtkButton* _tmp10_;
	ObjectsProject* _tmp11_;
	ObjectsSource* _tmp12_;
	ObjectsSource* _tmp13_;
	ObjectsSource* _tmp14_;
	WidgetsLabelPickerLabelButton* _tmp15_ = NULL;
	WidgetsPriorityButton* _tmp16_ = NULL;
	WidgetsPriorityButton* _tmp17_;
	gchar* _tmp18_;
	gchar** _tmp19_;
	gchar* _tmp20_;
	GtkPopover* _tmp21_;
	GtkMenuButton* _tmp22_ = NULL;
	gchar* _tmp23_;
	gchar** _tmp24_;
	WidgetsLoadingButton* _tmp25_ = NULL;
	GtkBox* content_box = NULL;
	GtkBox* _tmp26_ = NULL;
	GtkBox* _tmp27_;
	GtkLabel* _tmp28_;
	GtkBox* _tmp29_;
	WidgetsScheduleButton* _tmp30_;
	GtkBox* _tmp31_;
	GtkButton* _tmp32_;
	GtkBox* _tmp33_;
	WidgetsLabelPickerLabelButton* _tmp34_;
	GtkBox* _tmp35_;
	WidgetsPriorityButton* _tmp36_;
	GtkBox* _tmp37_;
	GtkMenuButton* _tmp38_;
	GtkBox* _tmp39_;
	WidgetsLoadingButton* _tmp40_;
	GtkBox* _tmp41_;
	ServicesEventBus* _tmp42_;
	ServicesEventBus* _tmp43_;
	ServicesEventBus* _tmp44_;
	ServicesEventBus* _tmp45_;
	ServicesEventBus* _tmp46_;
	ServicesEventBus* _tmp47_;
	WidgetsLoadingButton* _tmp48_;
	WidgetsScheduleButton* _tmp49_;
	GtkButton* _tmp50_;
	WidgetsLabelPickerLabelButton* _tmp51_;
	WidgetsLabelPickerLabelButton* _tmp52_;
	WidgetsPriorityButton* _tmp53_;
	parent_class = G_OBJECT_CLASS (widgets_multi_select_toolbar_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_TYPE_MULTI_SELECT_TOOLBAR, WidgetsMultiSelectToolbar);
	_tmp0_ = g_strdup ("sidebar");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = 1;
	gtk_widget_set_css_classes ((GtkWidget*) self, _tmp2_);
	_tmp2_ = (_vala_array_free (_tmp2_, _tmp2__length1, (GDestroyNotify) g_free), NULL);
	_tmp3_ = g_strdup ("font-bold");
	_tmp4_ = g_strdup ("card");
	_tmp5_ = g_new0 (gchar*, 2 + 1);
	_tmp5_[0] = _tmp3_;
	_tmp5_[1] = _tmp4_;
	_tmp6_ = (GtkLabel*) gtk_label_new ("0");
	gtk_widget_set_css_classes ((GtkWidget*) _tmp6_, _tmp5_);
	_tmp5_ = (_vala_array_free (_tmp5_, 2, (GDestroyNotify) g_free), NULL);
	g_object_set ((GtkWidget*) _tmp6_, "width-request", 32, NULL);
	g_object_set ((GtkWidget*) _tmp6_, "height-request", 24, NULL);
	gtk_widget_set_valign ((GtkWidget*) _tmp6_, GTK_ALIGN_CENTER);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp6_, 6);
	g_object_ref_sink (_tmp6_);
	_g_object_unref0 (self->priv->size_label);
	self->priv->size_label = _tmp6_;
	_tmp7_ = widgets_schedule_button_new (_ ("Date"));
	gtk_widget_set_sensitive ((GtkWidget*) _tmp7_, FALSE);
	widgets_schedule_button_set_visible_clear_button (_tmp7_, FALSE);
	widgets_schedule_button_set_visible_no_date (_tmp7_, TRUE);
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->priv->schedule_button);
	self->priv->schedule_button = _tmp7_;
	_tmp8_ = g_strdup (_ ("Move to Project"));
	_tmp9_ = (GtkButton*) gtk_button_new_from_icon_name ("arrow3-right-symbolic");
	gtk_widget_set_sensitive ((GtkWidget*) _tmp9_, FALSE);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp9_, _tmp8_);
	_g_free0 (_tmp8_);
	g_object_ref_sink (_tmp9_);
	_g_object_unref0 (self->priv->move_button);
	self->priv->move_button = _tmp9_;
	_tmp10_ = self->priv->move_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp10_, "flat");
	_tmp11_ = self->priv->_project;
	_tmp12_ = objects_project_get_source (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = _g_object_ref0 (_tmp13_);
	_tmp15_ = widgets_label_picker_label_button_new ();
	gtk_widget_set_sensitive ((GtkWidget*) _tmp15_, FALSE);
	widgets_label_picker_label_button_set_source (_tmp15_, _tmp14_);
	_g_object_unref0 (_tmp14_);
	g_object_ref_sink (_tmp15_);
	_g_object_unref0 (self->priv->label_button);
	self->priv->label_button = _tmp15_;
	_tmp16_ = widgets_priority_button_new ();
	gtk_widget_set_sensitive ((GtkWidget*) _tmp16_, FALSE);
	g_object_ref_sink (_tmp16_);
	_g_object_unref0 (self->priv->priority_button);
	self->priv->priority_button = _tmp16_;
	_tmp17_ = self->priv->priority_button;
	widgets_priority_button_set_priority (_tmp17_, CONSTANTS_PRIORITY_4);
	_tmp18_ = g_strdup ("flat");
	_tmp19_ = g_new0 (gchar*, 1 + 1);
	_tmp19_[0] = _tmp18_;
	_tmp20_ = g_strdup ("view-more-symbolic");
	_tmp21_ = widgets_multi_select_toolbar_build_menu_popover (self);
	_tmp22_ = (GtkMenuButton*) gtk_menu_button_new ();
	gtk_widget_set_css_classes ((GtkWidget*) _tmp22_, _tmp19_);
	_tmp19_ = (_vala_array_free (_tmp19_, 1, (GDestroyNotify) g_free), NULL);
	gtk_widget_set_valign ((GtkWidget*) _tmp22_, GTK_ALIGN_CENTER);
	gtk_widget_set_halign ((GtkWidget*) _tmp22_, GTK_ALIGN_CENTER);
	gtk_menu_button_set_icon_name (_tmp22_, _tmp20_);
	_g_free0 (_tmp20_);
	gtk_menu_button_set_popover (_tmp22_, _tmp21_);
	_g_object_unref0 (_tmp21_);
	g_object_ref_sink (_tmp22_);
	_g_object_unref0 (self->priv->menu_button);
	self->priv->menu_button = _tmp22_;
	_tmp23_ = g_strdup ("suggested-action");
	_tmp24_ = g_new0 (gchar*, 1 + 1);
	_tmp24_[0] = _tmp23_;
	_tmp25_ = widgets_loading_button_new_with_label (_ ("Done"));
	gtk_widget_set_valign ((GtkWidget*) _tmp25_, GTK_ALIGN_CENTER);
	gtk_widget_set_halign ((GtkWidget*) _tmp25_, GTK_ALIGN_CENTER);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp25_, 12);
	g_object_set ((GtkWidget*) _tmp25_, "width-request", 100, NULL);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp25_, _tmp24_);
	_tmp24_ = (_vala_array_free (_tmp24_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp25_);
	_g_object_unref0 (self->priv->done_button);
	self->priv->done_button = _tmp25_;
	_tmp26_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	gtk_widget_set_valign ((GtkWidget*) _tmp26_, GTK_ALIGN_CENTER);
	gtk_widget_set_halign ((GtkWidget*) _tmp26_, GTK_ALIGN_CENTER);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp26_, 9);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp26_, 9);
	g_object_ref_sink (_tmp26_);
	content_box = _tmp26_;
	_tmp27_ = content_box;
	_tmp28_ = self->priv->size_label;
	gtk_box_append (_tmp27_, (GtkWidget*) _tmp28_);
	_tmp29_ = content_box;
	_tmp30_ = self->priv->schedule_button;
	gtk_box_append (_tmp29_, (GtkWidget*) _tmp30_);
	_tmp31_ = content_box;
	_tmp32_ = self->priv->move_button;
	gtk_box_append (_tmp31_, (GtkWidget*) _tmp32_);
	_tmp33_ = content_box;
	_tmp34_ = self->priv->label_button;
	gtk_box_append (_tmp33_, (GtkWidget*) _tmp34_);
	_tmp35_ = content_box;
	_tmp36_ = self->priv->priority_button;
	gtk_box_append (_tmp35_, (GtkWidget*) _tmp36_);
	_tmp37_ = content_box;
	_tmp38_ = self->priv->menu_button;
	gtk_box_append (_tmp37_, (GtkWidget*) _tmp38_);
	_tmp39_ = content_box;
	_tmp40_ = self->priv->done_button;
	gtk_box_append (_tmp39_, (GtkWidget*) _tmp40_);
	_tmp41_ = content_box;
	adw_bin_set_child ((AdwBin*) self, (GtkWidget*) _tmp41_);
	_tmp42_ = services_event_bus_get_default ();
	_tmp43_ = _tmp42_;
	g_signal_connect_object (_tmp43_, "select-item", (GCallback) __widgets_multi_select_toolbar___lambda543__services_event_bus_select_item, self, 0);
	_g_object_unref0 (_tmp43_);
	_tmp44_ = services_event_bus_get_default ();
	_tmp45_ = _tmp44_;
	g_signal_connect_object (_tmp45_, "unselect-item", (GCallback) __widgets_multi_select_toolbar___lambda544__services_event_bus_unselect_item, self, 0);
	_g_object_unref0 (_tmp45_);
	_tmp46_ = services_event_bus_get_default ();
	_tmp47_ = _tmp46_;
	g_signal_connect_object (_tmp47_, "unselect-all", (GCallback) __widgets_multi_select_toolbar___lambda545__services_event_bus_unselect_all, self, 0);
	_g_object_unref0 (_tmp47_);
	_tmp48_ = self->priv->done_button;
	g_signal_connect_object ((GtkButton*) _tmp48_, "clicked", (GCallback) __widgets_multi_select_toolbar___lambda546__gtk_button_clicked, self, 0);
	_tmp49_ = self->priv->schedule_button;
	g_signal_connect_object (_tmp49_, "duedate-changed", (GCallback) __widgets_multi_select_toolbar___lambda547__widgets_schedule_button_duedate_changed, self, 0);
	_tmp50_ = self->priv->move_button;
	g_signal_connect_object (_tmp50_, "clicked", (GCallback) __widgets_multi_select_toolbar___lambda548__gtk_button_clicked, self, 0);
	_tmp51_ = self->priv->label_button;
	g_signal_connect_object (_tmp51_, "picker-opened", (GCallback) __widgets_multi_select_toolbar___lambda550__widgets_label_picker_label_button_picker_opened, self, 0);
	_tmp52_ = self->priv->label_button;
	g_signal_connect_object (_tmp52_, "labels-changed", (GCallback) __widgets_multi_select_toolbar___lambda551__widgets_label_picker_label_button_labels_changed, self, 0);
	_tmp53_ = self->priv->priority_button;
	g_signal_connect_object (_tmp53_, "changed", (GCallback) __widgets_multi_select_toolbar___lambda552__widgets_priority_button_changed, self, 0);
	_g_object_unref0 (content_box);
	return obj;
}

static void
widgets_multi_select_toolbar_class_init (WidgetsMultiSelectToolbarClass * klass,
                                         gpointer klass_data)
{
	widgets_multi_select_toolbar_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WidgetsMultiSelectToolbar_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_widgets_multi_select_toolbar_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_widgets_multi_select_toolbar_set_property;
	G_OBJECT_CLASS (klass)->constructor = widgets_multi_select_toolbar_constructor;
	G_OBJECT_CLASS (klass)->finalize = widgets_multi_select_toolbar_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_MULTI_SELECT_TOOLBAR_PROJECT_PROPERTY, widgets_multi_select_toolbar_properties[WIDGETS_MULTI_SELECT_TOOLBAR_PROJECT_PROPERTY] = g_param_spec_object ("project", "project", "project", OBJECTS_TYPE_PROJECT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	widgets_multi_select_toolbar_signals[WIDGETS_MULTI_SELECT_TOOLBAR_CLOSED_SIGNAL] = g_signal_new ("closed", WIDGETS_TYPE_MULTI_SELECT_TOOLBAR, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
widgets_multi_select_toolbar_instance_init (WidgetsMultiSelectToolbar * self,
                                            gpointer klass)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	GeeHashMap* _tmp2_;
	self->priv = widgets_multi_select_toolbar_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, LAYOUTS_TYPE_ITEM_BASE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->items_selected = _tmp0_;
	_tmp1_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, OBJECTS_TYPE_LABEL, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->labels = _tmp1_;
	_tmp2_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, OBJECTS_TYPE_LABEL, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->_initial_labels = _tmp2_;
}

static void
widgets_multi_select_toolbar_finalize (GObject * obj)
{
	WidgetsMultiSelectToolbar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_TYPE_MULTI_SELECT_TOOLBAR, WidgetsMultiSelectToolbar);
	_g_object_unref0 (self->priv->_project);
	_g_object_unref0 (self->priv->size_label);
	_g_object_unref0 (self->priv->schedule_button);
	_g_object_unref0 (self->priv->move_button);
	_g_object_unref0 (self->priv->label_button);
	_g_object_unref0 (self->priv->priority_button);
	_g_object_unref0 (self->priv->menu_button);
	_g_object_unref0 (self->priv->done_button);
	_g_object_unref0 (self->priv->complete_item);
	_g_object_unref0 (self->priv->delete_item);
	_g_object_unref0 (self->items_selected);
	_g_object_unref0 (self->labels);
	_g_object_unref0 (self->priv->_initial_labels);
	G_OBJECT_CLASS (widgets_multi_select_toolbar_parent_class)->finalize (obj);
}

static GType
widgets_multi_select_toolbar_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WidgetsMultiSelectToolbarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) widgets_multi_select_toolbar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WidgetsMultiSelectToolbar), 0, (GInstanceInitFunc) widgets_multi_select_toolbar_instance_init, NULL };
	GType widgets_multi_select_toolbar_type_id;
	widgets_multi_select_toolbar_type_id = g_type_register_static (adw_bin_get_type (), "WidgetsMultiSelectToolbar", &g_define_type_info, 0);
	WidgetsMultiSelectToolbar_private_offset = g_type_add_instance_private (widgets_multi_select_toolbar_type_id, sizeof (WidgetsMultiSelectToolbarPrivate));
	return widgets_multi_select_toolbar_type_id;
}

GType
widgets_multi_select_toolbar_get_type (void)
{
	static volatile gsize widgets_multi_select_toolbar_type_id__once = 0;
	if (g_once_init_enter (&widgets_multi_select_toolbar_type_id__once)) {
		GType widgets_multi_select_toolbar_type_id;
		widgets_multi_select_toolbar_type_id = widgets_multi_select_toolbar_get_type_once ();
		g_once_init_leave (&widgets_multi_select_toolbar_type_id__once, widgets_multi_select_toolbar_type_id);
	}
	return widgets_multi_select_toolbar_type_id__once;
}

static void
_vala_widgets_multi_select_toolbar_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec)
{
	WidgetsMultiSelectToolbar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_TYPE_MULTI_SELECT_TOOLBAR, WidgetsMultiSelectToolbar);
	switch (property_id) {
		case WIDGETS_MULTI_SELECT_TOOLBAR_PROJECT_PROPERTY:
		g_value_set_object (value, widgets_multi_select_toolbar_get_project (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_widgets_multi_select_toolbar_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec)
{
	WidgetsMultiSelectToolbar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_TYPE_MULTI_SELECT_TOOLBAR, WidgetsMultiSelectToolbar);
	switch (property_id) {
		case WIDGETS_MULTI_SELECT_TOOLBAR_PROJECT_PROPERTY:
		widgets_multi_select_toolbar_set_project (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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);
}

