"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["common-BaseTreeViewController"],{1838:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"BaseTreeViewController\": () => (/* binding */ BaseTreeViewController)\n/* harmony export */ });\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass BaseTreeViewController extends BaseViewController {\n\tsetSelectLayout( column_start_from ) {\n\t\tvar $this = this;\n\n\t\tvar grid;\n\t\tif ( !Global.isSet( this.grid ) ) {\n\t\t\tgrid = $( this.el ).find( '#grid' );\n\n\t\t\tgrid.attr( 'id', this.ui_id + '_grid' ); //Grid's id is ScriptName + _grid\n\n\t\t\tgrid = $( this.el ).find( '#' + this.ui_id + '_grid' );\n\t\t}\n\n\t\tvar column_info_array = [];\n\n\t\tif ( !this.select_layout ) { //Set to defalt layout if no layout at all\n\t\t\tthis.select_layout = { id: '' };\n\t\t\tthis.select_layout.data = { filter_data: {}, filter_sort: {} };\n\t\t\tthis.select_layout.data.display_columns = this.default_display_columns;\n\t\t}\n\t\tvar layout_data = this.select_layout.data;\n\n\t\tif ( layout_data.display_columns.length < 1 ) {\n\t\t\tlayout_data.display_columns = this.default_display_columns;\n\t\t}\n\n\t\tvar display_columns = this.buildDisplayColumns( layout_data.display_columns );\n\t\t//Set Data Grid on List view\n\t\tvar len = display_columns.length;\n\n\t\tvar start_from = 0;\n\n\t\tif ( Global.isSet( column_start_from ) && column_start_from > 0 ) {\n\t\t\tstart_from = column_start_from;\n\t\t}\n\n\t\tvar view_column_data = display_columns[0];\n\n\t\tvar column_info = {\n\t\t\tname: view_column_data.value,\n\t\t\tindex: view_column_data.value,\n\t\t\tlabel: $this.grid_table_name,\n\t\t\twidth: 100,\n\t\t\tsortable: false,\n\t\t\ttitle: false\n\t\t};\n\n\t\tcolumn_info_array.push( column_info );\n\n\t\tif ( this.grid ) {\n\t\t\tthis.grid.jqGrid( 'GridUnload' );\n\t\t\tthis.grid = null;\n\t\t}\n\n\t\tthis.grid = new TTGrid( this.ui_id + '_grid', {\n\t\t\tmultiselect: false,\n\t\t\twinMultiSelect: false,\n\t\t\ttree_mode: true,\n\t\t\tonSelectRow: $.proxy( this.onGridSelectRow, this )\n\t\t}, column_info_array );\n\n\t\tthis.bindGridColumnEvents();\n\n\t\tthis.setGridHeaderStyle(); //Set Sort Style\n\n\t\tthis.filter_data = this.select_layout.data.filter_data;\n\n\t\tthis.showGridBorders();\n\n\t\t$this.setGridSize();\n\t}\n\n\tsearch( set_default_menu, page_action, page_number ) {\n\t\tvar $this = this;\n\n\t\tif ( !Global.isSet( set_default_menu ) ) {\n\t\t\tset_default_menu = true;\n\t\t}\n\n\t\tvar filter = {};\n\t\tfilter.filter_data = {};\n\t\tfilter.filter_sort = {};\n\t\tfilter.filter_columns = this.getFilterColumnsFromDisplayColumns();\n\t\tfilter.filter_items_per_page = 0; // Default to 0 to load user preference defined\n\n\t\tif ( this.sub_view_mode && this.parent_key ) {\n\t\t\tthis.select_layout.data.filter_data[this.parent_key] = this.parent_value;\n\n\t\t\t//If sub view controller set custom filters, get it\n\t\t\tif ( Global.isSet( this.getSubViewFilter ) ) {\n\n\t\t\t\tthis.select_layout.data.filter_data = this.getSubViewFilter( this.select_layout.data.filter_data );\n\n\t\t\t}\n\t\t}\n\n\t\tthis.last_select_ids = this.getGridSelectIdArray();\n\t\t//select_layout will not be null, it's set in setSelectLayout function\n\t\tfilter.filter_data = Global.convertLayoutFilterToAPIFilter( this.select_layout );\n\t\tfilter.filter_sort = this.select_layout.data.filter_sort;\n\n\t\tthis.api['get' + this.api.key_name]( filter, false, false, {\n\t\t\tonResult: function( result ) {\n\n\t\t\t\tvar result_data = result.getResult();\n\n\t\t\t\tresult_data = Global.buildTreeRecord( result_data );\n\n\t\t\t\t$this.grid_current_page_items = result_data; // For tree mode only\n\n\t\t\t\tif ( !Global.isArray( result_data ) ) {\n\t\t\t\t\t$this.showNoResultCover();\n\t\t\t\t} else {\n\t\t\t\t\t$this.removeNoResultCover();\n\t\t\t\t}\n\n\t\t\t\t$this.reSetGridTreeData( result_data );\n\n\t\t\t\t$this.setGridSize();\n\n\t\t\t\tProgressBar.closeOverlay(); //Add this in initData\n\t\t\t\tif ( set_default_menu ) {\n\t\t\t\t\t$this.setDefaultMenu();\n\t\t\t\t}\n\n\t\t\t\tif ( LocalCacheData.paging_type === 0 ) {\n\t\t\t\t\tif ( !$this.pager_data || $this.pager_data.is_last_page ) {\n\t\t\t\t\t\t$this.paging_widget.css( 'display', 'none' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this.paging_widget.css( 'display', 'block' );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this.reSelectLastSelectItems();\n\t\t\t\t$this.autoOpenEditViewIfNecessary();\n\t\t\t\t$this.searchDone();\n\t\t\t}\n\t\t} );\n\t}\n\n\tsetDefaultMenu( doNotSetFocus ) {\n\t\tvar selected_row = this.getSelectedItem();\n\t\tvar context_menu_array = ContextMenuManager.getMenuModelByMenuId( this.determineContextMenuMountAttributes().id );\n\n\t\t//If selected root group, disable all context menu icons other than add. Otherwise blank view opens that might be difficult for user to exit when clicking edit or view.\n\t\tif ( selected_row !== null && selected_row.id == TTUUID.zero_id ) {\n\t\t\tvar len = context_menu_array.length;\n\n\t\t\tvar grid_selected_id_array = this.getGridSelectIdArray();\n\n\t\t\tvar grid_selected_length = grid_selected_id_array.length;\n\n\t\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\t\tlet context_btn = context_menu_array[i];\n\t\t\t\tlet id = context_menu_array[i].id;\n\n\t\t\t\tif ( id == 'add' ) {\n\t\t\t\t\tthis.setDefaultMenuAddIcon( context_btn, grid_selected_length );\n\t\t\t\t} else {\n\t\t\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tsuper.setDefaultMenu( doNotSetFocus );\n\t}\n\n\tonEditClick( record_id, noRefreshUI ) {\n\t\tif ( record_id === TTUUID.zero_id ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tsuper.onEditClick( record_id, noRefreshUI );\n\t}\n\n\treSetGridTreeData( val ) {\n\t\tvar $this = this;\n\n\t\tvar col_model = this.grid.getGridParam( 'colModel' );\n\t\tthis.grid.grid.jqGrid( 'GridUnload' );\n\t\tthis.grid = null;\n\n\t\tthis.grid = new TTGrid( this.ui_id + '_grid', {\n\t\t\tmultiselect: false,\n\t\t\twinMultiSelect: false,\n\t\t\tdatastr: val,\n\t\t\tdatatype: 'jsonstring',\n\t\t\tsortable: false,\n\t\t\tonSelectRow: function( id ) {\n\t\t\t\t$( '#ribbon_view_container .context-menu:visible a' ).click();\n\t\t\t\t$this.grid_select_id_array = [id];\n\t\t\t\t$this.setDefaultMenu();\n\n\t\t\t},\n\t\t\tondblClickRow: function() {\n\t\t\t\t//Do not open root group item as it cannot be edited and produces weird results if opened.\n\t\t\t\tif ( $this.getEditSelectedRecordId() !== TTUUID.zero_id ) {\n\t\t\t\t\t$this.onGridDblClickRow();\n\t\t\t\t}\n\t\t\t},\n\t\t\tgridview: true,\n\t\t\ttreeGrid: true,\n\t\t\ttreeGridModel: 'adjacency',\n\t\t\ttreedatatype: 'local',\n\t\t\tExpandColumn: 'name',\n\t\t}, col_model );\n\t}\n\n\tgetGridSelectIdArray() {\n\t\tvar result = [];\n\t\tresult = this.grid_select_id_array;\n\n\t\treturn result;\n\t}\n\n\tinitLayout() {\n\t\tvar $this = this;\n\t\tthis.real_this = this.constructor.__super__; // this seems first entry point. needed where view controller is extended twice, Base->Tree-View, used with onViewClick _super\n\n\t\t$this.getDefaultDisplayColumns( function() {\n\t\t\t$this.setSelectLayout();\n\t\t\t$this.search();\n\t\t} );\n\t}\n\n\tgetAllColumns( callBack ) {\n\t\tvar $this = this;\n\n\t\tthis.api.getOptions( 'columns', {\n\t\t\tonResult: function( columns_result ) {\n\n\t\t\t\tvar columns_result_data = columns_result.getResult();\n\t\t\t\t$this.all_columns = Global.buildColumnArray( columns_result_data );\n\n\t\t\t\tif ( callBack ) {\n\t\t\t\t\tcallBack();\n\t\t\t\t}\n\n\t\t\t}\n\t\t} );\n\t}\n\n\tsetCurrentEditRecordData() {\n\t\t//Set current edit record data to all widgets\n\t\tfor ( var key in this.current_edit_record ) {\n\t\t\tvar widget = this.edit_view_ui_dic[key];\n\t\t\tif ( Global.isSet( widget ) ) {\n\t\t\t\tswitch ( key ) {\n\t\t\t\t\tcase 'parent_id':\n\t\t\t\t\t\twidget.setSourceData( this.grid_current_page_items );\n\t\t\t\t\t\twidget.setValue( this.current_edit_record[key] );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\twidget.setValue( this.current_edit_record[key] );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\tthis.collectUIDataToCurrentEditRecord();\n\t\tthis.setEditViewDataDone();\n\t}\n\n\tsetEditViewData() {\n\t\tvar $this = this;\n\n\t\tthis.is_changed = false;\n\n\t\tif ( !this.edit_only_mode ) {\n\n\t\t\tvar navigation_div = this.edit_view.find( '.navigation-div' );\n\n\t\t\tif ( Global.isSet( this.current_edit_record.id ) && this.current_edit_record.id ) {\n\t\t\t\tnavigation_div.css( 'display', 'block' );\n\t\t\t\t//Set Navigation Awesomebox\n\n\t\t\t\t//init navigation only when open edit view\n\t\t\t\tif ( !this.navigation.getSourceData() ) {\n\t\t\t\t\tthis.navigation.setSourceData( this.grid_current_page_items.filter( grid_item => grid_item.id !== TTUUID.zero_id ) );\n\n\t\t\t\t\tvar default_args = {};\n\t\t\t\t\tdefault_args.filter_data = Global.convertLayoutFilterToAPIFilter( this.select_layout );\n\t\t\t\t\tdefault_args.filter_sort = this.select_layout.data.filter_sort;\n\t\t\t\t\tthis.navigation.setDefaultArgs( default_args );\n\t\t\t\t}\n\n\t\t\t\tthis.navigation.setValue( this.current_edit_record );\n\n\t\t\t} else {\n\t\t\t\tnavigation_div.css( 'display', 'none' );\n\t\t\t}\n\t\t}\n\n\t\tfor ( var key in this.edit_view_ui_dic ) {\n\n\t\t\t//Set all UI field to current edit reocrd, we need validate all UI fielld when save and validate\n\t\t\tif ( !Global.isSet( $this.current_edit_record[key] ) && !this.is_mass_editing ) {\n\t\t\t\t$this.current_edit_record[key] = false;\n\t\t\t}\n\n\t\t}\n\n\t\tthis.setNavigationArrowsStatus();\n\t\tthis.setNavigationArrowsEnabled();\n\n\t\t// Create this function alone because of the column value of view is different from each other, some columns need to be handle specially. and easily to rewrite this function in sub-class.\n\n\t\tthis.setCurrentEditRecordData();\n\n\t\t//Init *Please save this record before modifying any related data* box\n\t\tthis.edit_view.find( '.save-and-continue-div' ).SaveAndContinueBox( { related_view_controller: this } );\n\t\tthis.edit_view.find( '.save-and-continue-div' ).css( 'display', 'none' );\n\n\t\tif ( this.edit_view_tab.tabs( 'option', 'active' ) === 1 ) {\n\t\t\tif ( this.current_edit_record.id ) {\n\t\t\t\tthis.edit_view_tab.find( '#tab_audit' ).find( '.first-column-sub-view' ).css( 'display', 'block' );\n\t\t\t\tthis.initSubLogView( 'tab_audit' );\n\t\t\t} else {\n\t\t\t\tthis.edit_view_tab.find( '#tab_audit' ).find( '.first-column-sub-view' ).css( 'display', 'none' );\n\t\t\t\tthis.edit_view.find( '.save-and-continue-div' ).css( 'display', 'block' );\n\t\t\t}\n\t\t}\n\t\tthis.switchToProperTab();\n\t}\n\n\taddIdFieldToNavigation( array ) {\n\t\t$.each( array, function( key, item ) {\n\t\t\t$( item ).each( function( i_key, i_item ) {\n\t\t\t\ti_item.id = i_item._id_;\n\t\t\t} );\n\t\t} );\n\n\t\treturn array;\n\t}\n\n\tdoViewAPICall( filter ) {\n\t\treturn super.doViewAPICall( filter, [filter, false, false] );\n\t}\n\n\thandleViewAPICallbackResult( result ) {\n\t\treturn this.handleAPICallbackResult( result );\n\t}\n\n\thandleAPICallbackResult( result ) {\n\t\tvar result_data = result.getResult();\n\t\tvar record_id = this.getCurrentSelectedRecord();\n\t\tresult_data = Global.getParentIdByTreeRecord( Global.buildTreeRecord( result_data ), record_id );\n\t\tresult_data = result_data[0];\n\t\tresult_data.id = record_id;\n\n\t\tsuper.handleViewAPICallbackResult( result_data );\n\t}\n\n\thandleEditAPICallbackResult( result ) {\n\t\treturn this.handleAPICallbackResult( result );\n\t}\n\n\tonDeleteDone( result ) {\n\t\tthis.grid_select_id_array = [];\n\t\tthis.setDefaultMenu();\n\t\tthis.removeDeletedRows();\n\t}\n\n\tonSaveDone( result ) {\n\t\tthis.grid_select_id_array = [];\n\t}\n\n\tdoEditAPICall( filter ) {\n\t\treturn super.doEditAPICall( filter, [filter, false, false] );\n\t}\n\n\t_continueDoCopyAsNew() {\n\t\tvar $this = this;\n\t\tthis.setCurrentEditViewState( 'new' );\n\t\tLocalCacheData.current_doing_context_action = 'copy_as_new';\n\n\t\tif ( Global.isSet( this.edit_view ) ) {\n\n\t\t\tthis.current_edit_record.id = '';\n\t\t\tvar navigation_div = this.edit_view.find( '.navigation-div' );\n\t\t\tnavigation_div.css( 'display', 'none' );\n\t\t\tthis.setEditMenu();\n\t\t\tthis.setTabStatus();\n\t\t\tthis.is_changed = false;\n\t\t\tProgressBar.closeOverlay();\n\n\t\t} else {\n\t\t\tvar filter = {};\n\t\t\tvar grid_selected_id_array = this.getGridSelectIdArray();\n\t\t\tvar grid_selected_length = grid_selected_id_array.length;\n\n\t\t\tif ( grid_selected_length > 0 ) {\n\t\t\t\tvar selectedId = grid_selected_id_array[0];\n\t\t\t} else {\n\t\t\t\tTAlertManager.showAlert( $.i18n._( 'No selected record' ) );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfilter.filter_data = {};\n\n\t\t\tthis.api['get' + this.api.key_name]( filter, false, false, {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\tvar result_data = result.getResult();\n\t\t\t\t\tresult_data = Global.buildTreeRecord( result_data );\n\t\t\t\t\tresult_data = Global.getParentIdByTreeRecord( result_data, selectedId );\n\n\t\t\t\t\tif ( !result_data ) {\n\t\t\t\t\t\tTAlertManager.showAlert( $.i18n._( 'Record does not exist' ) );\n\t\t\t\t\t\t$this.onCancelClick();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this.openEditView(); // Put it here is to avoid if the selected one is not existed in data or have deleted by other pragram. in this case, the edit view should not be opend.\n\n\t\t\t\t\tresult_data = result_data[0];\n\t\t\t\t\tif ( $this.sub_view_mode && $this.parent_key ) {\n\t\t\t\t\t\tresult_data[$this.parent_key] = $this.parent_value;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this.current_edit_record = result_data;\n\t\t\t\t\t$this.current_edit_record.id = '';\n\n\t\t\t\t\t$this.initEditView();\n\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\tbuildEditViewUI() {\n\t\tvar $this = this;\n\n\t\t// #VueContextMenu# After we add the edit_view to the page in initEditViewUI(), add the context menu (Vue needs a valid id in dom)\n\t\tif( ContextMenuManager.getMenu( this.determineContextMenuMountAttributes().id ) === undefined ) {\n\t\t\tthis.buildContextMenu();\n\t\t} else {\n\t\t\tDebug.Warn( 'Context Menu ('+ this.determineContextMenuMountAttributes().id +') already exists for: '+ this.viewId, 'BaseTreeViewController.js', 'BaseTreeViewController', 'buildEditViewUI', 10 );\n\t\t}\n\n\t\t//No navigation when edit only mode\n\t\tif ( !this.edit_only_mode ) {\n\t\t\tvar navigation_div = this.edit_view.find( '.navigation-div' );\n\t\t\tvar label = navigation_div.find( '.navigation-label' );\n\n\t\t\tvar navigation_widget_div = navigation_div.find( '.navigation-widget-div' );\n\n\t\t\tthis.navigation = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\t\tlabel.text( this.navigation_label );\n\n\t\t\tnavigation_widget_div.append( this.navigation );\n\t\t}\n\n\t\tthis.edit_view_close_icon = this.edit_view.find( '.close-icon' );\n\t\tthis.edit_view_close_icon.hide();\n\t\tthis.edit_view_close_icon.click( function() {\n\t\t\t$this.onCloseIconClick();\n\t\t} );\n\n\t\tvar tab_model = Array();\n\t\ttab_model[this.primary_tab_key] = { 'label': this.primary_tab_label };\n\t\ttab_model['tab_audit'] = {\n\t\t\t'label': $.i18n._( 'Audit' ),\n\t\t\t'init_callback': 'initSubLogView',\n\t\t\t'display_on_mass_edit': false,\n\t\t\t'display_on_add': false\n\t\t};\n\t\tthis.setTabModel( tab_model );\n\n\t\tthis.navigation.AComboBox( {\n\t\t\tid: this.script_name + '_navigation',\n\t\t\ttree_mode: true,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_tree_column',\n\t\t\tnavigation_mode: true,\n\t\t\tshow_search_inputs: false,\n\t\t\ton_tree_grid_row_select: function( id, tree_mode_collapse ) {\n\t\t\t\t$this.onTreeGridNavigationRowSelect( id, tree_mode_collapse );\n\t\t\t}\n\t\t} );\n\n\t\tvar left_click = navigation_div.find( '.left-click' );\n\t\tvar right_click = navigation_div.find( '.right-click' );\n\t\tleft_click.attr( 'src', Global.getRealImagePath( 'images/left_arrow.svg' ) );\n\t\tright_click.attr( 'src', Global.getRealImagePath( 'images/right_arrow.svg' ) );\n\n\t\tthis.setNavigation();\n\n\t\t//Tab 0 start\n\t\tvar tab_group = this.edit_view_tab.find( '#' + this.primary_tab_key );\n\n\t\tvar tab_group_column1 = tab_group.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_group_column1 );\n\n\t\t//Parent\n\t\t//Group\n\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\tform_item_input.AComboBox( {\n\t\t\ttree_mode: true,\n\t\t\tallow_multiple_selection: false,\n\t\t\tshow_search_inputs: false,\n\t\t\tlayout_name: 'global_tree_column',\n\t\t\tset_empty: true,\n\t\t\tfield: 'parent_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Parent' ), form_item_input, tab_group_column1, '' );\n\n\t\t//Name\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'name', width: '100%' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Name' ), form_item_input, tab_group_column1, '' );\n\n\t\tform_item_input.parent().width( '45%' );\n\t}\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTgzOC5qcyIsIm1hcHBpbmdzIjoiOzs7OztBQUFPO0FBQ1A7QUFDQTs7QUFFQTtBQUNBO0FBQ0EsVUFBVSxDQUFDOztBQUVYLDZDQUE2Qzs7QUFFN0MsVUFBVSxDQUFDO0FBQ1g7O0FBRUE7O0FBRUEsK0JBQStCO0FBQy9CLDBCQUEwQjtBQUMxQiwrQkFBK0IsZUFBZTtBQUM5QztBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGdCQUFnQixDQUFDO0FBQ2pCLEdBQUc7O0FBRUg7O0FBRUEsNkJBQTZCOztBQUU3Qjs7QUFFQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0Esb0NBQW9DOztBQUVwQztBQUNBOztBQUVBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBOztBQUVBOztBQUVBLGlEQUFpRDs7QUFFakQ7QUFDQTtBQUNBLE1B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