/* buttons-financial.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from buttons-financial.vala, do not modify */

/*
 * Copyright (C) 2008-2012 Robert Ancell
 *
 * 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. See http://www.gnu.org/copyleft/gpl.html the full text of the
 * license.
 */

#include <adwaita.h>
#include <glib-object.h>
#include "calculator.h"
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <glib.h>
#include <stdlib.h>
#include <string.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 TYPE_FINANCIAL_BUTTON_PANEL (financial_button_panel_get_type ())
#define FINANCIAL_BUTTON_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FINANCIAL_BUTTON_PANEL, FinancialButtonPanel))
#define FINANCIAL_BUTTON_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FINANCIAL_BUTTON_PANEL, FinancialButtonPanelClass))
#define IS_FINANCIAL_BUTTON_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FINANCIAL_BUTTON_PANEL))
#define IS_FINANCIAL_BUTTON_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FINANCIAL_BUTTON_PANEL))
#define FINANCIAL_BUTTON_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FINANCIAL_BUTTON_PANEL, FinancialButtonPanelClass))

typedef struct _FinancialButtonPanel FinancialButtonPanel;
typedef struct _FinancialButtonPanelClass FinancialButtonPanelClass;
typedef struct _FinancialButtonPanelPrivate FinancialButtonPanelPrivate;

#define TYPE_MATH_BUTTONS (math_buttons_get_type ())
#define MATH_BUTTONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MATH_BUTTONS, MathButtons))
#define MATH_BUTTONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MATH_BUTTONS, MathButtonsClass))
#define IS_MATH_BUTTONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MATH_BUTTONS))
#define IS_MATH_BUTTONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MATH_BUTTONS))
#define MATH_BUTTONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MATH_BUTTONS, MathButtonsClass))

typedef struct _MathButtons MathButtons;
typedef struct _MathButtonsClass MathButtonsClass;
enum  {
	FINANCIAL_BUTTON_PANEL_0_PROPERTY,
	FINANCIAL_BUTTON_PANEL_NUM_PROPERTIES
};
static GParamSpec* financial_button_panel_properties[FINANCIAL_BUTTON_PANEL_NUM_PROPERTIES];
typedef void (*GSimpleActionActivateCallback) (GSimpleAction* action, GVariant* parameter, gpointer user_data);
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define FINANCIAL_BUTTON_PANEL_TYPE_FINC_DIALOG (financial_button_panel_finc_dialog_get_type ())
typedef struct _FinancialButtonPanelFincDialog FinancialButtonPanelFincDialog;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block3Data Block3Data;

#define TYPE_MATH_POPOVER (math_popover_get_type ())
#define MATH_POPOVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MATH_POPOVER, MathPopover))
#define MATH_POPOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MATH_POPOVER, MathPopoverClass))
#define IS_MATH_POPOVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MATH_POPOVER))
#define IS_MATH_POPOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MATH_POPOVER))
#define MATH_POPOVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MATH_POPOVER, MathPopoverClass))

typedef struct _MathPopover MathPopover;
typedef struct _MathPopoverClass MathPopoverClass;

#define TYPE_MATH_VARIABLE_POPOVER (math_variable_popover_get_type ())
#define MATH_VARIABLE_POPOVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MATH_VARIABLE_POPOVER, MathVariablePopover))
#define MATH_VARIABLE_POPOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MATH_VARIABLE_POPOVER, MathVariablePopoverClass))
#define IS_MATH_VARIABLE_POPOVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MATH_VARIABLE_POPOVER))
#define IS_MATH_VARIABLE_POPOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MATH_VARIABLE_POPOVER))
#define MATH_VARIABLE_POPOVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MATH_VARIABLE_POPOVER, MathVariablePopoverClass))

typedef struct _MathVariablePopover MathVariablePopover;
typedef struct _MathVariablePopoverClass MathVariablePopoverClass;

#define TYPE_MATH_FUNCTION_POPOVER (math_function_popover_get_type ())
#define MATH_FUNCTION_POPOVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MATH_FUNCTION_POPOVER, MathFunctionPopover))
#define MATH_FUNCTION_POPOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MATH_FUNCTION_POPOVER, MathFunctionPopoverClass))
#define IS_MATH_FUNCTION_POPOVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MATH_FUNCTION_POPOVER))
#define IS_MATH_FUNCTION_POPOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MATH_FUNCTION_POPOVER))
#define MATH_FUNCTION_POPOVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MATH_FUNCTION_POPOVER, MathFunctionPopoverClass))

typedef struct _MathFunctionPopover MathFunctionPopover;
typedef struct _MathFunctionPopoverClass MathFunctionPopoverClass;
typedef enum  {
	BUTTON_MODE_BASIC,
	BUTTON_MODE_ADVANCED,
	BUTTON_MODE_FINANCIAL,
	BUTTON_MODE_PROGRAMMING,
	BUTTON_MODE_KEYBOARD,
	BUTTON_MODE_CONVERSION
} ButtonMode;

#define TYPE_BUTTON_MODE (button_mode_get_type ())

#define TYPE_MATH_CONVERTER (math_converter_get_type ())
#define MATH_CONVERTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MATH_CONVERTER, MathConverter))
#define MATH_CONVERTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MATH_CONVERTER, MathConverterClass))
#define IS_MATH_CONVERTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MATH_CONVERTER))
#define IS_MATH_CONVERTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MATH_CONVERTER))
#define MATH_CONVERTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MATH_CONVERTER, MathConverterClass))

typedef struct _MathConverter MathConverter;
typedef struct _MathConverterClass MathConverterClass;
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))

struct _FinancialButtonPanel {
	AdwBreakpointBin parent_instance;
	FinancialButtonPanelPrivate * priv;
};

struct _FinancialButtonPanelClass {
	AdwBreakpointBinClass parent_class;
};

struct _FinancialButtonPanelPrivate {
	MathButtons* buttons;
	MathEquation* equation;
	AdwCarousel* carousel;
	GtkWidget* carousel_dots;
	GtkWidget* math_box;
	GtkWidget* basic;
	GtkWidget* advanced;
	GtkWidget* finc_buttons;
	GtkButton* calc_numeric_point_button;
	GtkMenuButton* calc_memory_button;
	GtkMenuButton* calc_function_button;
	GtkButton* calc_inverse_modifier_button;
	GSimpleActionGroup* action_group;
};

struct _FinancialButtonPanelFincDialog {
	gchar* name;
	gchar** entry_names;
	gint entry_names_length1;
	gint _entry_names_size_;
};

struct _Block3Data {
	int _ref_count_;
	FinancialButtonPanel* self;
	gulong carousel_mapped;
};

static gint FinancialButtonPanel_private_offset;
static gpointer financial_button_panel_parent_class = NULL;
static FinancialButtonPanelFincDialog* financial_button_panel_finc_dialogs;
static gint financial_button_panel_finc_dialogs_length1;
static FinancialButtonPanelFincDialog* financial_button_panel_finc_dialogs = NULL;
static gint financial_button_panel_finc_dialogs_length1 = 0;
static gint _financial_button_panel_finc_dialogs_size_ = 0;

VALA_EXTERN GType financial_button_panel_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FinancialButtonPanel, g_object_unref)
VALA_EXTERN GType math_buttons_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MathButtons, g_object_unref)
static void financial_button_panel_on_launch_finc_dialog (FinancialButtonPanel* self,
                                                   GSimpleAction* action,
                                                   GVariant* param);
static void _financial_button_panel_on_launch_finc_dialog_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                     GVariant* parameter,
                                                                                     gpointer self);
static void financial_button_panel_on_currency_conversion (FinancialButtonPanel* self);
static void _financial_button_panel_on_currency_conversion_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                      GVariant* parameter,
                                                                                      gpointer self);
static GType financial_button_panel_finc_dialog_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static FinancialButtonPanelFincDialog* financial_button_panel_finc_dialog_dup (const FinancialButtonPanelFincDialog* self);
static void financial_button_panel_finc_dialog_free (FinancialButtonPanelFincDialog* self);
static void financial_button_panel_finc_dialog_copy (const FinancialButtonPanelFincDialog* self,
                                              FinancialButtonPanelFincDialog* dest);
static void financial_button_panel_finc_dialog_destroy (FinancialButtonPanelFincDialog* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (FinancialButtonPanelFincDialog, financial_button_panel_finc_dialog_destroy)
VALA_EXTERN FinancialButtonPanel* financial_button_panel_new (MathButtons* buttons);
VALA_EXTERN FinancialButtonPanel* financial_button_panel_construct (GType object_type,
                                                        MathButtons* buttons);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
VALA_EXTERN MathEquation* math_buttons_get_equation (MathButtons* self);
static void financial_button_panel_correct_text_direction (FinancialButtonPanel* self);
VALA_EXTERN MathVariablePopover* math_variable_popover_new (MathEquation* equation);
VALA_EXTERN MathVariablePopover* math_variable_popover_construct (GType object_type,
                                                      MathEquation* equation);
VALA_EXTERN GType math_popover_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MathPopover, g_object_unref)
VALA_EXTERN GType math_variable_popover_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MathVariablePopover, g_object_unref)
VALA_EXTERN MathFunctionPopover* math_function_popover_new (MathEquation* equation);
VALA_EXTERN MathFunctionPopover* math_function_popover_construct (GType object_type,
                                                      MathEquation* equation);
VALA_EXTERN GType math_function_popover_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MathFunctionPopover, g_object_unref)
static void financial_button_panel_load_finc_dialog (FinancialButtonPanel* self,
                                              const gchar* name,
                                              gchar** entry_names,
                                              gint entry_names_length1,
                                              FinancialDialog function);
static void __lambda33_ (FinancialButtonPanel* self);
static void ___lambda33__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
static void __lambda34_ (Block3Data* _data3_);
static void ___lambda34__gtk_widget_map (GtkWidget* _sender,
                                  gpointer self);
static gpointer financial_button_panel_get_object (FinancialButtonPanel* self,
                                            GType t_type,
                                            GBoxedCopyFunc t_dup_func,
                                            GDestroyNotify t_destroy_func,
                                            const gchar* name);
static void financial_button_panel_finc_calculate_cb (FinancialButtonPanel* self,
                                               GtkButton* calculate_button);
static void _financial_button_panel_finc_calculate_cb_gtk_button_clicked (GtkButton* _sender,
                                                                   gpointer self);
static void financial_button_panel_finc_activate_cb (FinancialButtonPanel* self,
                                              AdwEntryRow* entry);
static void _financial_button_panel_finc_activate_cb_adw_entry_row_entry_activated (AdwEntryRow* _sender,
                                                                             gpointer self);
static void financial_button_panel_finc_leave_focus_cb (FinancialButtonPanel* self,
                                                 GtkEventControllerFocus* controller);
static void _financial_button_panel_finc_leave_focus_cb_gtk_event_controller_focus_leave (GtkEventControllerFocus* _sender,
                                                                                   gpointer self);
VALA_EXTERN GType button_mode_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void math_buttons_set_mode (MathButtons* self,
                            ButtonMode value);
VALA_EXTERN GType math_converter_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MathConverter, g_object_unref)
VALA_EXTERN MathConverter* math_buttons_get_converter (MathButtons* self);
VALA_EXTERN void math_converter_set_category (MathConverter* self,
                                  const gchar* category);
static gchar** _vala_array_dup1 (gchar** self,
                          gssize length);
static gboolean _vala_string_array_contains (gchar* * stack,
                                      gssize stack_length,
                                      const gchar* needle);
static gchar** _vala_array_dup2 (gchar** self,
                          gssize length);
static void financial_button_panel_finalize (GObject * obj);
static GType financial_button_panel_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 GActionEntry FINANCIAL_BUTTON_PANEL_action_entries[2] = {{"launch-finc-dialog", _financial_button_panel_on_launch_finc_dialog_gsimple_action_activate_callback, "s"}, {"currency-conversion", _financial_button_panel_on_currency_conversion_gsimple_action_activate_callback}};

static inline gpointer
financial_button_panel_get_instance_private (FinancialButtonPanel* self)
{
	return G_STRUCT_MEMBER_P (self, FinancialButtonPanel_private_offset);
}

static void
_financial_button_panel_on_launch_finc_dialog_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                GVariant* parameter,
                                                                                gpointer self)
{
	financial_button_panel_on_launch_finc_dialog ((FinancialButtonPanel*) self, action, parameter);
}

static void
_financial_button_panel_on_currency_conversion_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                 GVariant* parameter,
                                                                                 gpointer self)
{
	financial_button_panel_on_currency_conversion ((FinancialButtonPanel*) self);
}

static Block3Data*
block3_data_ref (Block3Data* _data3_)
{
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}

static void
block3_data_unref (void * _userdata_)
{
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		FinancialButtonPanel* self;
		self = _data3_->self;
		_g_object_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}

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

static gchar*
g_unichar_to_string (gunichar self)
{
	gchar* str = NULL;
	gchar* _tmp0_;
	gchar* result;
	_tmp0_ = g_new0 (gchar, 7);
	str = (gchar*) _tmp0_;
	g_unichar_to_utf8 (self, str);
	result = str;
	return result;
}

static void
__lambda33_ (FinancialButtonPanel* self)
{
	AdwCarousel* _tmp0_;
	AdwCarousel* _tmp1_;
	GtkWidget* _tmp2_;
	_tmp0_ = self->priv->carousel;
	_tmp1_ = self->priv->carousel;
	_tmp2_ = adw_carousel_get_nth_page (_tmp1_, (guint) 1);
	adw_carousel_scroll_to (_tmp0_, _tmp2_, FALSE);
}

static void
___lambda33__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda33_ ((FinancialButtonPanel*) self);
}

static void
__lambda34_ (Block3Data* _data3_)
{
	FinancialButtonPanel* self;
	AdwCarousel* _tmp0_;
	AdwCarousel* _tmp1_;
	GtkWidget* _tmp2_;
	AdwCarousel* _tmp3_;
	self = _data3_->self;
	_tmp0_ = self->priv->carousel;
	_tmp1_ = self->priv->carousel;
	_tmp2_ = adw_carousel_get_nth_page (_tmp1_, (guint) 1);
	adw_carousel_scroll_to (_tmp0_, _tmp2_, FALSE);
	_tmp3_ = self->priv->carousel;
	g_signal_handler_disconnect ((GObject*) _tmp3_, _data3_->carousel_mapped);
}

static void
___lambda34__gtk_widget_map (GtkWidget* _sender,
                             gpointer self)
{
	__lambda34_ (self);
}

FinancialButtonPanel*
financial_button_panel_construct (GType object_type,
                                  MathButtons* buttons)
{
	FinancialButtonPanel * self = NULL;
	Block3Data* _data3_;
	MathButtons* _tmp0_;
	MathEquation* _tmp1_;
	MathEquation* _tmp2_;
	MathEquation* _tmp3_;
	GSimpleActionGroup* _tmp4_;
	GSimpleActionGroup* _tmp5_;
	GtkButton* _tmp6_;
	MathEquation* _tmp7_;
	Serializer* _tmp8_;
	Serializer* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	GtkMenuButton* _tmp12_;
	MathEquation* _tmp13_;
	MathVariablePopover* _tmp14_;
	MathVariablePopover* _tmp15_;
	GtkMenuButton* _tmp16_;
	MathEquation* _tmp17_;
	MathFunctionPopover* _tmp18_;
	MathFunctionPopover* _tmp19_;
	gint i = 0;
	FinancialButtonPanelFincDialog* _tmp20_;
	gint _tmp20__length1;
	AdwCarousel* _tmp28_;
	gulong _tmp29_;
	GtkButton* _tmp30_;
	g_return_val_if_fail (buttons != NULL, NULL);
	_data3_ = g_slice_new0 (Block3Data);
	_data3_->_ref_count_ = 1;
	self = (FinancialButtonPanel*) g_object_new (object_type, NULL);
	_data3_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (buttons);
	_g_object_unref0 (self->priv->buttons);
	self->priv->buttons = _tmp0_;
	_tmp1_ = math_buttons_get_equation (buttons);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_g_object_unref0 (self->priv->equation);
	self->priv->equation = _tmp3_;
	_tmp4_ = self->priv->action_group;
	g_action_map_add_action_entries ((GActionMap*) _tmp4_, FINANCIAL_BUTTON_PANEL_action_entries, (gint) G_N_ELEMENTS (FINANCIAL_BUTTON_PANEL_action_entries), self);
	_tmp5_ = self->priv->action_group;
	gtk_widget_insert_action_group ((GtkWidget*) self, "cal", (GActionGroup*) _tmp5_);
	financial_button_panel_correct_text_direction (self);
	_tmp6_ = self->priv->calc_numeric_point_button;
	_tmp7_ = self->priv->equation;
	_tmp8_ = math_equation_get_serializer (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = g_unichar_to_string (serializer_get_radix (_tmp9_));
	_tmp11_ = _tmp10_;
	gtk_button_set_label (_tmp6_, _tmp11_);
	_g_free0 (_tmp11_);
	_tmp12_ = self->priv->calc_memory_button;
	_tmp13_ = self->priv->equation;
	_tmp14_ = math_variable_popover_new (_tmp13_);
	g_object_ref_sink (_tmp14_);
	_tmp15_ = _tmp14_;
	gtk_menu_button_set_popover (_tmp12_, (GtkPopover*) _tmp15_);
	_g_object_unref0 (_tmp15_);
	_tmp16_ = self->priv->calc_function_button;
	_tmp17_ = self->priv->equation;
	_tmp18_ = math_function_popover_new (_tmp17_);
	g_object_ref_sink (_tmp18_);
	_tmp19_ = _tmp18_;
	gtk_menu_button_set_popover (_tmp16_, (GtkPopover*) _tmp19_);
	_g_object_unref0 (_tmp19_);
	i = 0;
	_tmp20_ = financial_button_panel_finc_dialogs;
	_tmp20__length1 = financial_button_panel_finc_dialogs_length1;
	{
		FinancialButtonPanelFincDialog* dialog_collection = NULL;
		gint dialog_collection_length1 = 0;
		gint _dialog_collection_size_ = 0;
		gint dialog_it = 0;
		dialog_collection = _tmp20_;
		dialog_collection_length1 = _tmp20__length1;
		for (dialog_it = 0; dialog_it < dialog_collection_length1; dialog_it = dialog_it + 1) {
			FinancialButtonPanelFincDialog _tmp21_;
			FinancialButtonPanelFincDialog _tmp22_ = {0};
			FinancialButtonPanelFincDialog dialog = {0};
			_tmp21_ = dialog_collection[dialog_it];
			financial_button_panel_finc_dialog_copy (&_tmp21_, &_tmp22_);
			dialog = _tmp22_;
			{
				FinancialButtonPanelFincDialog _tmp23_;
				const gchar* _tmp24_;
				FinancialButtonPanelFincDialog _tmp25_;
				gchar** _tmp26_;
				gint _tmp26__length1;
				gint _tmp27_;
				_tmp23_ = dialog;
				_tmp24_ = _tmp23_.name;
				_tmp25_ = dialog;
				_tmp26_ = _tmp25_.entry_names;
				_tmp26__length1 = _tmp25_.entry_names_length1;
				financial_button_panel_load_finc_dialog (self, _tmp24_, _tmp26_, (gint) _tmp26__length1, i);
				_tmp27_ = i;
				i = _tmp27_ + 1;
				financial_button_panel_finc_dialog_destroy (&dialog);
			}
		}
	}
	g_signal_connect_object ((GObject*) buttons, "notify::mode", (GCallback) ___lambda33__g_object_notify, self, 0);
	_data3_->carousel_mapped = (gulong) 0;
	_tmp28_ = self->priv->carousel;
	_tmp29_ = g_signal_connect_data ((GtkWidget*) _tmp28_, "map", (GCallback) ___lambda34__gtk_widget_map, block3_data_ref (_data3_), (GClosureNotify) block3_data_unref, 0);
	_data3_->carousel_mapped = _tmp29_;
	_tmp30_ = self->priv->calc_inverse_modifier_button;
	g_object_bind_property_with_closures ((GObject*) buttons, "inverse", (GObject*) _tmp30_, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	block3_data_unref (_data3_);
	_data3_ = NULL;
	return self;
}

FinancialButtonPanel*
financial_button_panel_new (MathButtons* buttons)
{
	return financial_button_panel_construct (TYPE_FINANCIAL_BUTTON_PANEL, buttons);
}

static void
financial_button_panel_correct_text_direction (FinancialButtonPanel* self)
{
	AdwCarousel* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GtkWidget* _tmp3_;
	GtkWidget* _tmp4_;
	GtkWidget* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->carousel;
	gtk_widget_set_direction ((GtkWidget*) _tmp0_, GTK_TEXT_DIR_LTR);
	_tmp1_ = self->priv->carousel_dots;
	gtk_widget_set_direction (_tmp1_, GTK_TEXT_DIR_LTR);
	_tmp2_ = self->priv->math_box;
	gtk_widget_set_direction (_tmp2_, GTK_TEXT_DIR_LTR);
	_tmp3_ = self->priv->basic;
	gtk_widget_set_direction (_tmp3_, GTK_TEXT_DIR_LTR);
	_tmp4_ = self->priv->advanced;
	gtk_widget_set_direction (_tmp4_, GTK_TEXT_DIR_LTR);
	_tmp5_ = self->priv->finc_buttons;
	gtk_widget_set_direction (_tmp5_, GTK_TEXT_DIR_LTR);
}

static void
_financial_button_panel_finc_calculate_cb_gtk_button_clicked (GtkButton* _sender,
                                                              gpointer self)
{
	financial_button_panel_finc_calculate_cb ((FinancialButtonPanel*) self, _sender);
}

static void
_financial_button_panel_finc_activate_cb_adw_entry_row_entry_activated (AdwEntryRow* _sender,
                                                                        gpointer self)
{
	financial_button_panel_finc_activate_cb ((FinancialButtonPanel*) self, _sender);
}

static void
_financial_button_panel_finc_leave_focus_cb_gtk_event_controller_focus_leave (GtkEventControllerFocus* _sender,
                                                                              gpointer self)
{
	financial_button_panel_finc_leave_focus_cb ((FinancialButtonPanel*) self, _sender);
}

static void
financial_button_panel_load_finc_dialog (FinancialButtonPanel* self,
                                         const gchar* name,
                                         gchar** entry_names,
                                         gint entry_names_length1,
                                         FinancialDialog function)
{
	AdwDialog* dialog = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gpointer _tmp2_;
	AdwDialog* _tmp3_;
	AdwDialog* _tmp4_;
	const gchar* _tmp5_;
	gpointer _tmp6_;
	GtkButton* calculate_button = NULL;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gpointer _tmp11_;
	GtkButton* _tmp12_;
	GtkButton* _tmp13_;
	AdwDialog* _tmp14_;
	AdwDialog* _tmp15_;
	GtkButton* _tmp16_;
	GtkButton* _tmp17_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	_tmp0_ = g_strconcat (name, "_dialog", NULL);
	_tmp1_ = _tmp0_;
	_tmp2_ = financial_button_panel_get_object (self, adw_dialog_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
	_tmp3_ = (AdwDialog*) _tmp2_;
	_g_free0 (_tmp1_);
	dialog = _tmp3_;
	_tmp4_ = dialog;
	_tmp5_ = entry_names[0];
	_tmp6_ = financial_button_panel_get_object (self, adw_entry_row_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp5_);
	g_object_set_data_full ((GObject*) _tmp4_, "first-entry", (AdwEntryRow*) _tmp6_, g_object_unref);
	_tmp7_ = g_strconcat ("button_", name, NULL);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_strconcat (_tmp8_, "_calculate", NULL);
	_tmp10_ = _tmp9_;
	_tmp11_ = financial_button_panel_get_object (self, gtk_button_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp10_);
	_tmp12_ = (GtkButton*) _tmp11_;
	_g_free0 (_tmp10_);
	_g_free0 (_tmp8_);
	calculate_button = _tmp12_;
	_tmp13_ = calculate_button;
	_tmp14_ = dialog;
	_tmp15_ = _g_object_ref0 (_tmp14_);
	g_object_set_data_full ((GObject*) _tmp13_, "dialog", _tmp15_, g_object_unref);
	_tmp16_ = calculate_button;
	g_object_set_data_full ((GObject*) _tmp16_, "finc-function", (gpointer) ((gintptr) function), NULL);
	_tmp17_ = calculate_button;
	g_signal_connect_object (_tmp17_, "clicked", (GCallback) _financial_button_panel_finc_calculate_cb_gtk_button_clicked, self, 0);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp18_ = FALSE;
			_tmp18_ = TRUE;
			while (TRUE) {
				AdwEntryRow* entry = NULL;
				const gchar* _tmp20_;
				gpointer _tmp21_;
				AdwEntryRow* _tmp28_;
				GtkEventControllerFocus* focus_controller = NULL;
				GtkEventControllerFocus* _tmp29_;
				GtkEventControllerFocus* _tmp30_;
				AdwEntryRow* _tmp31_;
				GtkEventControllerFocus* _tmp32_;
				GtkEventController* _tmp33_;
				if (!_tmp18_) {
					gint _tmp19_;
					_tmp19_ = i;
					i = _tmp19_ + 1;
				}
				_tmp18_ = FALSE;
				if (!(i < entry_names_length1)) {
					break;
				}
				_tmp20_ = entry_names[i];
				_tmp21_ = financial_button_panel_get_object (self, adw_entry_row_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp20_);
				entry = (AdwEntryRow*) _tmp21_;
				if (i != (entry_names_length1 - 1)) {
					AdwEntryRow* _tmp22_;
					const gchar* _tmp23_;
					gpointer _tmp24_;
					_tmp22_ = entry;
					_tmp23_ = entry_names[i + 1];
					_tmp24_ = financial_button_panel_get_object (self, adw_entry_row_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp23_);
					g_object_set_data_full ((GObject*) _tmp22_, "next-entry", (AdwEntryRow*) _tmp24_, g_object_unref);
				} else {
					AdwEntryRow* _tmp25_;
					GtkButton* _tmp26_;
					GtkButton* _tmp27_;
					_tmp25_ = entry;
					_tmp26_ = calculate_button;
					_tmp27_ = _g_object_ref0 (_tmp26_);
					g_object_set_data_full ((GObject*) _tmp25_, "calculate-button", _tmp27_, g_object_unref);
				}
				_tmp28_ = entry;
				g_signal_connect_object (_tmp28_, "entry-activated", (GCallback) _financial_button_panel_finc_activate_cb_adw_entry_row_entry_activated, self, 0);
				_tmp29_ = (GtkEventControllerFocus*) gtk_event_controller_focus_new ();
				focus_controller = _tmp29_;
				_tmp30_ = focus_controller;
				g_signal_connect_object (_tmp30_, "leave", (GCallback) _financial_button_panel_finc_leave_focus_cb_gtk_event_controller_focus_leave, self, 0);
				_tmp31_ = entry;
				_tmp32_ = focus_controller;
				_tmp33_ = _g_object_ref0 ((GtkEventController*) _tmp32_);
				gtk_widget_add_controller ((GtkWidget*) _tmp31_, _tmp33_);
				_g_object_unref0 (focus_controller);
				_g_object_unref0 (entry);
			}
		}
	}
	_g_object_unref0 (calculate_button);
	_g_object_unref0 (dialog);
}

static void
financial_button_panel_on_launch_finc_dialog (FinancialButtonPanel* self,
                                              GSimpleAction* action,
                                              GVariant* param)
{
	AdwDialog* dialog = NULL;
	const gchar* _tmp0_;
	gpointer _tmp1_;
	AdwEntryRow* first_entry = NULL;
	AdwDialog* _tmp2_;
	gconstpointer _tmp3_;
	AdwEntryRow* _tmp4_;
	AdwDialog* _tmp13_;
	AdwEntryRow* _tmp14_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	_tmp0_ = g_variant_get_string (param, NULL);
	_tmp1_ = financial_button_panel_get_object (self, adw_dialog_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
	dialog = (AdwDialog*) _tmp1_;
	_tmp2_ = dialog;
	_tmp3_ = g_object_get_data ((GObject*) _tmp2_, "first-entry");
	_tmp4_ = _g_object_ref0 ((AdwEntryRow*) _tmp3_);
	first_entry = _tmp4_;
	{
		AdwEntryRow* entry = NULL;
		AdwEntryRow* _tmp5_;
		AdwEntryRow* _tmp6_;
		_tmp5_ = first_entry;
		_tmp6_ = _g_object_ref0 (_tmp5_);
		entry = _tmp6_;
		{
			gboolean _tmp7_ = FALSE;
			_tmp7_ = TRUE;
			while (TRUE) {
				AdwEntryRow* _tmp11_;
				AdwEntryRow* _tmp12_;
				if (!_tmp7_) {
					AdwEntryRow* _tmp8_;
					gconstpointer _tmp9_;
					AdwEntryRow* _tmp10_;
					_tmp8_ = entry;
					_tmp9_ = g_object_get_data ((GObject*) _tmp8_, "next-entry");
					_tmp10_ = _g_object_ref0 ((AdwEntryRow*) _tmp9_);
					_g_object_unref0 (entry);
					entry = _tmp10_;
				}
				_tmp7_ = FALSE;
				_tmp11_ = entry;
				if (!(_tmp11_ != NULL)) {
					break;
				}
				_tmp12_ = entry;
				gtk_editable_set_text ((GtkEditable*) _tmp12_, "0");
			}
		}
		_g_object_unref0 (entry);
	}
	_tmp13_ = dialog;
	adw_dialog_present (_tmp13_, (GtkWidget*) self);
	_tmp14_ = first_entry;
	gtk_widget_grab_focus ((GtkWidget*) _tmp14_);
	_g_object_unref0 (first_entry);
	_g_object_unref0 (dialog);
}

static void
financial_button_panel_on_currency_conversion (FinancialButtonPanel* self)
{
	MathButtons* _tmp0_;
	MathButtons* _tmp1_;
	MathConverter* _tmp2_;
	MathConverter* _tmp3_;
	MathButtons* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->buttons;
	math_buttons_set_mode (_tmp0_, BUTTON_MODE_CONVERSION);
	_tmp1_ = self->priv->buttons;
	_tmp2_ = math_buttons_get_converter (_tmp1_);
	_tmp3_ = _tmp2_;
	math_converter_set_category (_tmp3_, "currency");
	_tmp4_ = self->priv->buttons;
	g_signal_emit_by_name (_tmp4_, "currency-conversion");
}

static gchar**
_vala_array_dup1 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

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

static void
financial_button_panel_finc_calculate_cb (FinancialButtonPanel* self,
                                          GtkButton* calculate_button)
{
	gconstpointer _tmp0_;
	FinancialDialog function = 0;
	gconstpointer _tmp1_;
	gchar** entries = NULL;
	FinancialButtonPanelFincDialog* _tmp2_;
	gint _tmp2__length1;
	FinancialButtonPanelFincDialog _tmp3_;
	gchar** _tmp4_;
	gint _tmp4__length1;
	gchar** _tmp5_;
	gint _tmp5__length1;
	gint entries_length1;
	gint _entries_size_;
	Number* arg[4] = {0};
	Number* _tmp6_;
	Number* _tmp7_;
	Number* _tmp8_;
	Number* _tmp9_;
	Number* _tmp10_[4] = {0};
	gchar* radix = NULL;
	MathEquation* _tmp11_;
	Serializer* _tmp12_;
	Serializer* _tmp13_;
	gchar* _tmp14_;
	MathEquation* _tmp28_;
	Number* _tmp29_;
	Number* _tmp30_;
	Number* _tmp31_;
	Number* _tmp32_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (calculate_button != NULL);
	_tmp0_ = g_object_get_data ((GObject*) calculate_button, "dialog");
	adw_dialog_close ((AdwDialog*) _tmp0_);
	_tmp1_ = g_object_get_data ((GObject*) calculate_button, "finc-function");
	function = (FinancialDialog) ((gintptr) _tmp1_);
	_tmp2_ = financial_button_panel_finc_dialogs;
	_tmp2__length1 = financial_button_panel_finc_dialogs_length1;
	_tmp3_ = _tmp2_[function];
	_tmp4_ = _tmp3_.entry_names;
	_tmp4__length1 = _tmp3_.entry_names_length1;
	_tmp5_ = (_tmp4_ != NULL) ? _vala_array_dup1 (_tmp4_, _tmp4__length1) : _tmp4_;
	_tmp5__length1 = _tmp4__length1;
	entries = _tmp5_;
	entries_length1 = _tmp5__length1;
	_entries_size_ = entries_length1;
	_tmp6_ = number_new_integer ((gint64) 0, (gint64) 0);
	_tmp7_ = number_new_integer ((gint64) 0, (gint64) 0);
	_tmp8_ = number_new_integer ((gint64) 0, (gint64) 0);
	_tmp9_ = number_new_integer ((gint64) 0, (gint64) 0);
	_tmp10_[0] = _tmp6_;
	_tmp10_[1] = _tmp7_;
	_tmp10_[2] = _tmp8_;
	_tmp10_[3] = _tmp9_;
	memcpy (arg, _tmp10_, 4 * sizeof (Number*));
	_tmp11_ = self->priv->equation;
	_tmp12_ = math_equation_get_serializer (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = g_unichar_to_string (serializer_get_radix (_tmp13_));
	radix = _tmp14_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp15_ = FALSE;
			_tmp15_ = TRUE;
			while (TRUE) {
				gchar** _tmp17_;
				gint _tmp17__length1;
				AdwEntryRow* entry = NULL;
				gchar** _tmp18_;
				gint _tmp18__length1;
				const gchar* _tmp19_;
				gpointer _tmp20_;
				AdwEntryRow* _tmp21_;
				const gchar* _tmp22_;
				const gchar* _tmp23_;
				const gchar* _tmp24_;
				gchar* _tmp25_;
				gchar* _tmp26_;
				Number* _tmp27_;
				if (!_tmp15_) {
					gint _tmp16_;
					_tmp16_ = i;
					i = _tmp16_ + 1;
				}
				_tmp15_ = FALSE;
				_tmp17_ = entries;
				_tmp17__length1 = entries_length1;
				if (!(i < _tmp17__length1)) {
					break;
				}
				_tmp18_ = entries;
				_tmp18__length1 = entries_length1;
				_tmp19_ = _tmp18_[i];
				_tmp20_ = financial_button_panel_get_object (self, adw_entry_row_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp19_);
				entry = (AdwEntryRow*) _tmp20_;
				_tmp21_ = entry;
				_tmp22_ = gtk_editable_get_text ((GtkEditable*) _tmp21_);
				_tmp23_ = _tmp22_;
				_tmp24_ = radix;
				_tmp25_ = string_replace (_tmp23_, _tmp24_, ".");
				_tmp26_ = _tmp25_;
				_tmp27_ = mp_set_from_string (_tmp26_, 10, TRUE);
				_g_object_unref0 (arg[i]);
				arg[i] = _tmp27_;
				_g_free0 (_tmp26_);
				_g_object_unref0 (entry);
			}
		}
	}
	_tmp28_ = self->priv->equation;
	_tmp29_ = arg[0];
	_tmp30_ = arg[1];
	_tmp31_ = arg[2];
	_tmp32_ = arg[3];
	do_finc_expression (_tmp28_, function, _tmp29_, _tmp30_, _tmp31_, _tmp32_);
	_g_free0 (radix);
	_vala_array_destroy (arg, 4, (GDestroyNotify) g_object_unref);
	entries = (_vala_array_free (entries, entries_length1, (GDestroyNotify) g_free), NULL);
}

static void
financial_button_panel_finc_activate_cb (FinancialButtonPanel* self,
                                         AdwEntryRow* entry)
{
	AdwEntryRow* next_entry = NULL;
	gconstpointer _tmp0_;
	AdwEntryRow* _tmp1_;
	AdwEntryRow* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (entry != NULL);
	_tmp0_ = g_object_get_data ((GObject*) entry, "next-entry");
	_tmp1_ = _g_object_ref0 ((AdwEntryRow*) _tmp0_);
	next_entry = _tmp1_;
	_tmp2_ = next_entry;
	if (_tmp2_ == NULL) {
		GtkButton* calculate_button = NULL;
		gconstpointer _tmp3_;
		GtkButton* _tmp4_;
		GtkButton* _tmp5_;
		_tmp3_ = g_object_get_data ((GObject*) entry, "calculate-button");
		_tmp4_ = _g_object_ref0 ((GtkButton*) _tmp3_);
		calculate_button = _tmp4_;
		_tmp5_ = calculate_button;
		financial_button_panel_finc_calculate_cb (self, _tmp5_);
		_g_object_unref0 (calculate_button);
	} else {
		AdwEntryRow* _tmp6_;
		_tmp6_ = next_entry;
		gtk_widget_grab_focus ((GtkWidget*) _tmp6_);
	}
	_g_object_unref0 (next_entry);
}

static gboolean
_vala_string_array_contains (gchar* * stack,
                             gssize stack_length,
                             const gchar* needle)
{
	gssize i;
	for (i = 0; i < stack_length; i++) {
		if (g_strcmp0 (stack[i], needle) == 0) {
			return TRUE;
		}
	}
	return FALSE;
}

static void
financial_button_panel_finc_leave_focus_cb (FinancialButtonPanel* self,
                                            GtkEventControllerFocus* controller)
{
	AdwEntryRow* entry = NULL;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	AdwEntryRow* _tmp2_;
	gchar* radix = NULL;
	MathEquation* _tmp3_;
	Serializer* _tmp4_;
	Serializer* _tmp5_;
	gchar* _tmp6_;
	gchar* text = NULL;
	AdwEntryRow* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	gchar** sign_radix = NULL;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar** _tmp19_;
	gint sign_radix_length1;
	gint _sign_radix_size_;
	gboolean _tmp20_ = FALSE;
	gboolean _tmp21_ = FALSE;
	const gchar* _tmp22_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (controller != NULL);
	_tmp0_ = gtk_event_controller_get_widget ((GtkEventController*) controller);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, adw_entry_row_get_type (), AdwEntryRow));
	entry = _tmp2_;
	_tmp3_ = self->priv->equation;
	_tmp4_ = math_equation_get_serializer (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_unichar_to_string (serializer_get_radix (_tmp5_));
	radix = _tmp6_;
	_tmp7_ = entry;
	_tmp8_ = gtk_editable_get_text ((GtkEditable*) _tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = radix;
	_tmp11_ = string_replace (_tmp9_, _tmp10_, ".");
	text = _tmp11_;
	_tmp12_ = g_strdup ("+");
	_tmp13_ = g_strdup ("-");
	_tmp14_ = g_strdup ("−");
	_tmp15_ = g_strdup (".");
	_tmp16_ = g_strdup ("+.");
	_tmp17_ = g_strdup ("-.");
	_tmp18_ = g_strdup ("−.");
	_tmp19_ = g_new0 (gchar*, 7 + 1);
	_tmp19_[0] = _tmp12_;
	_tmp19_[1] = _tmp13_;
	_tmp19_[2] = _tmp14_;
	_tmp19_[3] = _tmp15_;
	_tmp19_[4] = _tmp16_;
	_tmp19_[5] = _tmp17_;
	_tmp19_[6] = _tmp18_;
	sign_radix = _tmp19_;
	sign_radix_length1 = 7;
	_sign_radix_size_ = sign_radix_length1;
	_tmp22_ = text;
	if (g_strcmp0 (_tmp22_, "") == 0) {
		_tmp21_ = TRUE;
	} else {
		const gchar* _tmp23_;
		gchar** _tmp24_;
		gint _tmp24__length1;
		_tmp23_ = text;
		_tmp24_ = sign_radix;
		_tmp24__length1 = sign_radix_length1;
		_tmp21_ = _vala_string_array_contains (_tmp24_, _tmp24__length1, _tmp23_);
	}
	if (_tmp21_) {
		_tmp20_ = TRUE;
	} else {
		const gchar* _tmp25_;
		Number* _tmp26_;
		Number* _tmp27_;
		_tmp25_ = text;
		_tmp26_ = mp_set_from_string (_tmp25_, 10, TRUE);
		_tmp27_ = _tmp26_;
		_tmp20_ = _tmp27_ == NULL;
		_g_object_unref0 (_tmp27_);
	}
	if (_tmp20_) {
		AdwEntryRow* _tmp28_;
		_tmp28_ = entry;
		gtk_editable_set_text ((GtkEditable*) _tmp28_, "0");
	}
	sign_radix = (_vala_array_free (sign_radix, sign_radix_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (text);
	_g_free0 (radix);
	_g_object_unref0 (entry);
}

static gpointer
financial_button_panel_get_object (FinancialButtonPanel* self,
                                   GType t_type,
                                   GBoxedCopyFunc t_dup_func,
                                   GDestroyNotify t_destroy_func,
                                   const gchar* name)
{
	GObject* _tmp0_;
	gpointer _tmp1_;
	gpointer result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = gtk_widget_get_template_child ((GtkWidget*) self, TYPE_FINANCIAL_BUTTON_PANEL, name);
	_tmp1_ = ((((gconstpointer) _tmp0_) != NULL) && (t_dup_func != NULL)) ? t_dup_func ((gpointer) ((gconstpointer) _tmp0_)) : ((gpointer) ((gconstpointer) _tmp0_));
	result = _tmp1_;
	return result;
}

static gchar**
_vala_array_dup2 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static void
financial_button_panel_finc_dialog_copy (const FinancialButtonPanelFincDialog* self,
                                         FinancialButtonPanelFincDialog* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	gchar** _tmp3_;
	gint _tmp3__length1;
	_tmp0_ = (*self).name;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).name);
	(*dest).name = _tmp1_;
	_tmp2_ = (*self).entry_names;
	_tmp2__length1 = (*self).entry_names_length1;
	_tmp3_ = (_tmp2_ != NULL) ? _vala_array_dup2 (_tmp2_, _tmp2__length1) : _tmp2_;
	_tmp3__length1 = _tmp2__length1;
	(*dest).entry_names = (_vala_array_free ((*dest).entry_names, (*dest).entry_names_length1, (GDestroyNotify) g_free), NULL);
	(*dest).entry_names = _tmp3_;
	(*dest).entry_names_length1 = _tmp3__length1;
	(*dest)._entry_names_size_ = (*dest).entry_names_length1;
}

static void
financial_button_panel_finc_dialog_destroy (FinancialButtonPanelFincDialog* self)
{
	_g_free0 ((*self).name);
	(*self).entry_names = (_vala_array_free ((*self).entry_names, (*self).entry_names_length1, (GDestroyNotify) g_free), NULL);
}

static FinancialButtonPanelFincDialog*
financial_button_panel_finc_dialog_dup (const FinancialButtonPanelFincDialog* self)
{
	FinancialButtonPanelFincDialog* dup;
	dup = g_new0 (FinancialButtonPanelFincDialog, 1);
	financial_button_panel_finc_dialog_copy (self, dup);
	return dup;
}

static void
financial_button_panel_finc_dialog_free (FinancialButtonPanelFincDialog* self)
{
	financial_button_panel_finc_dialog_destroy (self);
	g_free (self);
}

 G_GNUC_NO_INLINE static GType
financial_button_panel_finc_dialog_get_type_once (void)
{
	GType financial_button_panel_finc_dialog_type_id;
	financial_button_panel_finc_dialog_type_id = g_boxed_type_register_static ("FinancialButtonPanelFincDialog", (GBoxedCopyFunc) financial_button_panel_finc_dialog_dup, (GBoxedFreeFunc) financial_button_panel_finc_dialog_free);
	return financial_button_panel_finc_dialog_type_id;
}

static GType
financial_button_panel_finc_dialog_get_type (void)
{
	static gsize financial_button_panel_finc_dialog_type_id__once = 0;
	if (g_once_init_enter (&financial_button_panel_finc_dialog_type_id__once)) {
		GType financial_button_panel_finc_dialog_type_id;
		financial_button_panel_finc_dialog_type_id = financial_button_panel_finc_dialog_get_type_once ();
		g_once_init_leave (&financial_button_panel_finc_dialog_type_id__once, financial_button_panel_finc_dialog_type_id);
	}
	return financial_button_panel_finc_dialog_type_id__once;
}

static void
financial_button_panel_class_init (FinancialButtonPanelClass * klass,
                                   gpointer klass_data)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar** _tmp4_;
	FinancialButtonPanelFincDialog _tmp5_ = {0};
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar** _tmp10_;
	FinancialButtonPanelFincDialog _tmp11_ = {0};
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar** _tmp16_;
	FinancialButtonPanelFincDialog _tmp17_ = {0};
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gchar** _tmp21_;
	FinancialButtonPanelFincDialog _tmp22_ = {0};
	gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	gchar** _tmp27_;
	FinancialButtonPanelFincDialog _tmp28_ = {0};
	gchar* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	gchar** _tmp33_;
	FinancialButtonPanelFincDialog _tmp34_ = {0};
	gchar* _tmp35_;
	gchar* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	gchar** _tmp39_;
	FinancialButtonPanelFincDialog _tmp40_ = {0};
	gchar* _tmp41_;
	gchar* _tmp42_;
	gchar* _tmp43_;
	gchar* _tmp44_;
	gchar** _tmp45_;
	FinancialButtonPanelFincDialog _tmp46_ = {0};
	gchar* _tmp47_;
	gchar* _tmp48_;
	gchar* _tmp49_;
	gchar* _tmp50_;
	gchar* _tmp51_;
	gchar** _tmp52_;
	FinancialButtonPanelFincDialog _tmp53_ = {0};
	gchar* _tmp54_;
	gchar* _tmp55_;
	gchar* _tmp56_;
	gchar* _tmp57_;
	gchar** _tmp58_;
	FinancialButtonPanelFincDialog _tmp59_ = {0};
	FinancialButtonPanelFincDialog* _tmp60_;
	FinancialButtonPanelFincDialog* _tmp61_;
	gint _tmp61__length1;
	financial_button_panel_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FinancialButtonPanel_private_offset);
	G_OBJECT_CLASS (klass)->finalize = financial_button_panel_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/calculator/buttons-financial.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "carousel", FALSE, FinancialButtonPanel_private_offset + G_STRUCT_OFFSET (FinancialButtonPanelPrivate, carousel));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "carousel_dots", FALSE, FinancialButtonPanel_private_offset + G_STRUCT_OFFSET (FinancialButtonPanelPrivate, carousel_dots));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "math_box", FALSE, FinancialButtonPanel_private_offset + G_STRUCT_OFFSET (FinancialButtonPanelPrivate, math_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "basic", FALSE, FinancialButtonPanel_private_offset + G_STRUCT_OFFSET (FinancialButtonPanelPrivate, basic));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "advanced", FALSE, FinancialButtonPanel_private_offset + G_STRUCT_OFFSET (FinancialButtonPanelPrivate, advanced));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "finc_buttons", FALSE, FinancialButtonPanel_private_offset + G_STRUCT_OFFSET (FinancialButtonPanelPrivate, finc_buttons));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "calc_numeric_point_button", FALSE, FinancialButtonPanel_private_offset + G_STRUCT_OFFSET (FinancialButtonPanelPrivate, calc_numeric_point_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "calc_memory_button", FALSE, FinancialButtonPanel_private_offset + G_STRUCT_OFFSET (FinancialButtonPanelPrivate, calc_memory_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "calc_function_button", FALSE, FinancialButtonPanel_private_offset + G_STRUCT_OFFSET (FinancialButtonPanelPrivate, calc_function_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "calc_inverse_modifier_button", FALSE, FinancialButtonPanel_private_offset + G_STRUCT_OFFSET (FinancialButtonPanelPrivate, calc_inverse_modifier_button));
	_tmp0_ = g_strdup ("ctrm");
	_tmp1_ = g_strdup ("ctrm_pint");
	_tmp2_ = g_strdup ("ctrm_fv");
	_tmp3_ = g_strdup ("ctrm_pv");
	_tmp4_ = g_new0 (gchar*, 3 + 1);
	_tmp4_[0] = _tmp1_;
	_tmp4_[1] = _tmp2_;
	_tmp4_[2] = _tmp3_;
	memset (&_tmp5_, 0, sizeof (FinancialButtonPanelFincDialog));
	_g_free0 (_tmp5_.name);
	_tmp5_.name = _tmp0_;
	_tmp5_.entry_names = (_vala_array_free (_tmp5_.entry_names, _tmp5_.entry_names_length1, (GDestroyNotify) g_free), NULL);
	_tmp5_.entry_names = _tmp4_;
	_tmp5_.entry_names_length1 = 3;
	_tmp5_._entry_names_size_ = _tmp5_.entry_names_length1;
	_tmp6_ = g_strdup ("ddb");
	_tmp7_ = g_strdup ("ddb_cost");
	_tmp8_ = g_strdup ("ddb_life");
	_tmp9_ = g_strdup ("ddb_period");
	_tmp10_ = g_new0 (gchar*, 3 + 1);
	_tmp10_[0] = _tmp7_;
	_tmp10_[1] = _tmp8_;
	_tmp10_[2] = _tmp9_;
	memset (&_tmp11_, 0, sizeof (FinancialButtonPanelFincDialog));
	_g_free0 (_tmp11_.name);
	_tmp11_.name = _tmp6_;
	_tmp11_.entry_names = (_vala_array_free (_tmp11_.entry_names, _tmp11_.entry_names_length1, (GDestroyNotify) g_free), NULL);
	_tmp11_.entry_names = _tmp10_;
	_tmp11_.entry_names_length1 = 3;
	_tmp11_._entry_names_size_ = _tmp11_.entry_names_length1;
	_tmp12_ = g_strdup ("fv");
	_tmp13_ = g_strdup ("fv_pmt");
	_tmp14_ = g_strdup ("fv_pint");
	_tmp15_ = g_strdup ("fv_n");
	_tmp16_ = g_new0 (gchar*, 3 + 1);
	_tmp16_[0] = _tmp13_;
	_tmp16_[1] = _tmp14_;
	_tmp16_[2] = _tmp15_;
	memset (&_tmp17_, 0, sizeof (FinancialButtonPanelFincDialog));
	_g_free0 (_tmp17_.name);
	_tmp17_.name = _tmp12_;
	_tmp17_.entry_names = (_vala_array_free (_tmp17_.entry_names, _tmp17_.entry_names_length1, (GDestroyNotify) g_free), NULL);
	_tmp17_.entry_names = _tmp16_;
	_tmp17_.entry_names_length1 = 3;
	_tmp17_._entry_names_size_ = _tmp17_.entry_names_length1;
	_tmp18_ = g_strdup ("gpm");
	_tmp19_ = g_strdup ("gpm_cost");
	_tmp20_ = g_strdup ("gpm_margin");
	_tmp21_ = g_new0 (gchar*, 2 + 1);
	_tmp21_[0] = _tmp19_;
	_tmp21_[1] = _tmp20_;
	memset (&_tmp22_, 0, sizeof (FinancialButtonPanelFincDialog));
	_g_free0 (_tmp22_.name);
	_tmp22_.name = _tmp18_;
	_tmp22_.entry_names = (_vala_array_free (_tmp22_.entry_names, _tmp22_.entry_names_length1, (GDestroyNotify) g_free), NULL);
	_tmp22_.entry_names = _tmp21_;
	_tmp22_.entry_names_length1 = 2;
	_tmp22_._entry_names_size_ = _tmp22_.entry_names_length1;
	_tmp23_ = g_strdup ("pmt");
	_tmp24_ = g_strdup ("pmt_prin");
	_tmp25_ = g_strdup ("pmt_pint");
	_tmp26_ = g_strdup ("pmt_n");
	_tmp27_ = g_new0 (gchar*, 3 + 1);
	_tmp27_[0] = _tmp24_;
	_tmp27_[1] = _tmp25_;
	_tmp27_[2] = _tmp26_;
	memset (&_tmp28_, 0, sizeof (FinancialButtonPanelFincDialog));
	_g_free0 (_tmp28_.name);
	_tmp28_.name = _tmp23_;
	_tmp28_.entry_names = (_vala_array_free (_tmp28_.entry_names, _tmp28_.entry_names_length1, (GDestroyNotify) g_free), NULL);
	_tmp28_.entry_names = _tmp27_;
	_tmp28_.entry_names_length1 = 3;
	_tmp28_._entry_names_size_ = _tmp28_.entry_names_length1;
	_tmp29_ = g_strdup ("pv");
	_tmp30_ = g_strdup ("pv_pmt");
	_tmp31_ = g_strdup ("pv_pint");
	_tmp32_ = g_strdup ("pv_n");
	_tmp33_ = g_new0 (gchar*, 3 + 1);
	_tmp33_[0] = _tmp30_;
	_tmp33_[1] = _tmp31_;
	_tmp33_[2] = _tmp32_;
	memset (&_tmp34_, 0, sizeof (FinancialButtonPanelFincDialog));
	_g_free0 (_tmp34_.name);
	_tmp34_.name = _tmp29_;
	_tmp34_.entry_names = (_vala_array_free (_tmp34_.entry_names, _tmp34_.entry_names_length1, (GDestroyNotify) g_free), NULL);
	_tmp34_.entry_names = _tmp33_;
	_tmp34_.entry_names_length1 = 3;
	_tmp34_._entry_names_size_ = _tmp34_.entry_names_length1;
	_tmp35_ = g_strdup ("rate");
	_tmp36_ = g_strdup ("rate_fv");
	_tmp37_ = g_strdup ("rate_pv");
	_tmp38_ = g_strdup ("rate_n");
	_tmp39_ = g_new0 (gchar*, 3 + 1);
	_tmp39_[0] = _tmp36_;
	_tmp39_[1] = _tmp37_;
	_tmp39_[2] = _tmp38_;
	memset (&_tmp40_, 0, sizeof (FinancialButtonPanelFincDialog));
	_g_free0 (_tmp40_.name);
	_tmp40_.name = _tmp35_;
	_tmp40_.entry_names = (_vala_array_free (_tmp40_.entry_names, _tmp40_.entry_names_length1, (GDestroyNotify) g_free), NULL);
	_tmp40_.entry_names = _tmp39_;
	_tmp40_.entry_names_length1 = 3;
	_tmp40_._entry_names_size_ = _tmp40_.entry_names_length1;
	_tmp41_ = g_strdup ("sln");
	_tmp42_ = g_strdup ("sln_cost");
	_tmp43_ = g_strdup ("sln_salvage");
	_tmp44_ = g_strdup ("sln_life");
	_tmp45_ = g_new0 (gchar*, 3 + 1);
	_tmp45_[0] = _tmp42_;
	_tmp45_[1] = _tmp43_;
	_tmp45_[2] = _tmp44_;
	memset (&_tmp46_, 0, sizeof (FinancialButtonPanelFincDialog));
	_g_free0 (_tmp46_.name);
	_tmp46_.name = _tmp41_;
	_tmp46_.entry_names = (_vala_array_free (_tmp46_.entry_names, _tmp46_.entry_names_length1, (GDestroyNotify) g_free), NULL);
	_tmp46_.entry_names = _tmp45_;
	_tmp46_.entry_names_length1 = 3;
	_tmp46_._entry_names_size_ = _tmp46_.entry_names_length1;
	_tmp47_ = g_strdup ("syd");
	_tmp48_ = g_strdup ("syd_cost");
	_tmp49_ = g_strdup ("syd_salvage");
	_tmp50_ = g_strdup ("syd_life");
	_tmp51_ = g_strdup ("syd_period");
	_tmp52_ = g_new0 (gchar*, 4 + 1);
	_tmp52_[0] = _tmp48_;
	_tmp52_[1] = _tmp49_;
	_tmp52_[2] = _tmp50_;
	_tmp52_[3] = _tmp51_;
	memset (&_tmp53_, 0, sizeof (FinancialButtonPanelFincDialog));
	_g_free0 (_tmp53_.name);
	_tmp53_.name = _tmp47_;
	_tmp53_.entry_names = (_vala_array_free (_tmp53_.entry_names, _tmp53_.entry_names_length1, (GDestroyNotify) g_free), NULL);
	_tmp53_.entry_names = _tmp52_;
	_tmp53_.entry_names_length1 = 4;
	_tmp53_._entry_names_size_ = _tmp53_.entry_names_length1;
	_tmp54_ = g_strdup ("term");
	_tmp55_ = g_strdup ("term_pmt");
	_tmp56_ = g_strdup ("term_fv");
	_tmp57_ = g_strdup ("term_pint");
	_tmp58_ = g_new0 (gchar*, 3 + 1);
	_tmp58_[0] = _tmp55_;
	_tmp58_[1] = _tmp56_;
	_tmp58_[2] = _tmp57_;
	memset (&_tmp59_, 0, sizeof (FinancialButtonPanelFincDialog));
	_g_free0 (_tmp59_.name);
	_tmp59_.name = _tmp54_;
	_tmp59_.entry_names = (_vala_array_free (_tmp59_.entry_names, _tmp59_.entry_names_length1, (GDestroyNotify) g_free), NULL);
	_tmp59_.entry_names = _tmp58_;
	_tmp59_.entry_names_length1 = 3;
	_tmp59_._entry_names_size_ = _tmp59_.entry_names_length1;
	_tmp60_ = g_new0 (FinancialButtonPanelFincDialog, 10);
	_tmp60_[0] = _tmp5_;
	_tmp60_[1] = _tmp11_;
	_tmp60_[2] = _tmp17_;
	_tmp60_[3] = _tmp22_;
	_tmp60_[4] = _tmp28_;
	_tmp60_[5] = _tmp34_;
	_tmp60_[6] = _tmp40_;
	_tmp60_[7] = _tmp46_;
	_tmp60_[8] = _tmp53_;
	_tmp60_[9] = _tmp59_;
	financial_button_panel_finc_dialogs = _tmp60_;
	financial_button_panel_finc_dialogs_length1 = 10;
	_financial_button_panel_finc_dialogs_size_ = financial_button_panel_finc_dialogs_length1;
	_tmp61_ = financial_button_panel_finc_dialogs;
	_tmp61__length1 = financial_button_panel_finc_dialogs_length1;
	{
		FinancialButtonPanelFincDialog* dialog_collection = NULL;
		gint dialog_collection_length1 = 0;
		gint _dialog_collection_size_ = 0;
		gint dialog_it = 0;
		dialog_collection = _tmp61_;
		dialog_collection_length1 = _tmp61__length1;
		for (dialog_it = 0; dialog_it < dialog_collection_length1; dialog_it = dialog_it + 1) {
			FinancialButtonPanelFincDialog _tmp62_;
			FinancialButtonPanelFincDialog _tmp63_ = {0};
			FinancialButtonPanelFincDialog dialog = {0};
			_tmp62_ = dialog_collection[dialog_it];
			financial_button_panel_finc_dialog_copy (&_tmp62_, &_tmp63_);
			dialog = _tmp63_;
			{
				FinancialButtonPanelFincDialog _tmp64_;
				const gchar* _tmp65_;
				gchar* _tmp66_;
				gchar* _tmp67_;
				FinancialButtonPanelFincDialog _tmp68_;
				const gchar* _tmp69_;
				gchar* _tmp70_;
				gchar* _tmp71_;
				gchar* _tmp72_;
				gchar* _tmp73_;
				FinancialButtonPanelFincDialog _tmp74_;
				gchar** _tmp75_;
				gint _tmp75__length1;
				_tmp64_ = dialog;
				_tmp65_ = _tmp64_.name;
				_tmp66_ = g_strconcat (_tmp65_, "_dialog", NULL);
				_tmp67_ = _tmp66_;
				gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), _tmp67_, TRUE, (gssize) 0);
				_g_free0 (_tmp67_);
				_tmp68_ = dialog;
				_tmp69_ = _tmp68_.name;
				_tmp70_ = g_strconcat ("button_", _tmp69_, NULL);
				_tmp71_ = _tmp70_;
				_tmp72_ = g_strconcat (_tmp71_, "_calculate", NULL);
				_tmp73_ = _tmp72_;
				gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), _tmp73_, TRUE, (gssize) 0);
				_g_free0 (_tmp73_);
				_g_free0 (_tmp71_);
				_tmp74_ = dialog;
				_tmp75_ = _tmp74_.entry_names;
				_tmp75__length1 = _tmp74_.entry_names_length1;
				{
					gchar** entry_name_collection = NULL;
					gint entry_name_collection_length1 = 0;
					gint _entry_name_collection_size_ = 0;
					gint entry_name_it = 0;
					entry_name_collection = _tmp75_;
					entry_name_collection_length1 = _tmp75__length1;
					for (entry_name_it = 0; entry_name_it < entry_name_collection_length1; entry_name_it = entry_name_it + 1) {
						gchar* _tmp76_;
						gchar* entry_name = NULL;
						_tmp76_ = g_strdup (entry_name_collection[entry_name_it]);
						entry_name = _tmp76_;
						{
							const gchar* _tmp77_;
							_tmp77_ = entry_name;
							gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), _tmp77_, TRUE, (gssize) 0);
							_g_free0 (entry_name);
						}
					}
				}
				financial_button_panel_finc_dialog_destroy (&dialog);
			}
		}
	}
}

static void
financial_button_panel_instance_init (FinancialButtonPanel * self,
                                      gpointer klass)
{
	GSimpleActionGroup* _tmp0_;
	self->priv = financial_button_panel_get_instance_private (self);
	_tmp0_ = g_simple_action_group_new ();
	self->priv->action_group = _tmp0_;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
financial_button_panel_finalize (GObject * obj)
{
	FinancialButtonPanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_FINANCIAL_BUTTON_PANEL, FinancialButtonPanel);
	_g_object_unref0 (self->priv->buttons);
	_g_object_unref0 (self->priv->equation);
	_g_object_unref0 (self->priv->action_group);
	G_OBJECT_CLASS (financial_button_panel_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
financial_button_panel_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FinancialButtonPanelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) financial_button_panel_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FinancialButtonPanel), 0, (GInstanceInitFunc) financial_button_panel_instance_init, NULL };
	GType financial_button_panel_type_id;
	financial_button_panel_type_id = g_type_register_static (adw_breakpoint_bin_get_type (), "FinancialButtonPanel", &g_define_type_info, 0);
	FinancialButtonPanel_private_offset = g_type_add_instance_private (financial_button_panel_type_id, sizeof (FinancialButtonPanelPrivate));
	return financial_button_panel_type_id;
}

GType
financial_button_panel_get_type (void)
{
	static gsize financial_button_panel_type_id__once = 0;
	if (g_once_init_enter (&financial_button_panel_type_id__once)) {
		GType financial_button_panel_type_id;
		financial_button_panel_type_id = financial_button_panel_get_type_once ();
		g_once_init_leave (&financial_button_panel_type_id__once, financial_button_panel_type_id);
	}
	return financial_button_panel_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);
}

