"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["quick_punch-punch-QuickPunchViewController","quick_punch-QuickPunchBaseViewController","quick_punch-header-HeaderViewController"],{7194:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"g\": () => (/* binding */ IndexViewController)\n/* harmony export */ });\n/* unused harmony export ApplicationRouter */\n/* harmony import */ var _views_quick_punch_header_HeaderViewController__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5196);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\nclass ApplicationRouter extends Backbone.Router {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tcontroller: null,\n\t\t\theaderView: null,\n\t\t\troutes: {\n\t\t\t\t'': 'onViewChange',\n\t\t\t\t'!:viewName': 'onViewChange',\n\t\t\t\t'*notFound': 'notFound'\n\t\t\t}\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tloadView( view_id ) {\n\t\tGlobal.loadViewSource( view_id, view_id + 'View.html', function( result ) {\n\t\t\tvar template = _.template( result );\n\t\t\tGlobal.contentContainer().html( template );\n\n\t\t\tLocalCacheData.current_open_view_id = view_id;\n\n\t\t\tGlobal.trackView( view_id );\n\t\t} );\n\t}\n\n\treloadView( view_id ) {\n\t\t//error: Uncaught ReferenceError: XXXXViewController is not defined ininterface/html5/#!m=TimeSheet line 3\n\t\t// Happens when quickly click on context menu and network is slow.\n\t\tif ( eval( 'typeof '+ view_id + 'ViewController' ) === 'function' ) { //Was ES5: window[view_id + 'ViewController'] &&\n\t\t\tthis.loadView( view_id );\n\t\t}\n\t}\n\n\tnotFound( url ) {\n\t\tvar new_url = Global.getBaseURL();\n\n\t\tGlobal.setURLToBrowser( new_url + '#!m=QuickPunchLogin' );\n\t}\n\n\t/* jshint ignore:start */\n\tonViewChange( viewName ) {\n\t\tvar $this = this;\n\t\tvar args = {};\n\t\tvar view_id;\n\n\t\tif ( Global.needReloadBrowser ) {\n\t\t\tGlobal.needReloadBrowser = false;\n\t\t\twindow.location.reload();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( viewName ) {\n\t\t\targs = Global.buildArgDic( viewName.split( '&' ) );\n\t\t}\n\t\tif ( viewName && viewName.indexOf( 'm=' ) >= 0 && viewName.indexOf( 'QuickPunch' ) >= 0 ) {\n\t\t\tview_id = Global.sanitizeViewId( args.m );\n\t\t} else {\n\t\t\tview_id = 'QuickPunchLogin';\n\t\t\tGlobal.setURLToBrowser( Global.getBaseURL() + '#!m=QuickPunchLogin' );\n\t\t}\n\n\t\tLocalCacheData.fullUrlParameterStr = viewName;\n\n\t\tLocalCacheData.setAllURLArgs( args );\n\t\tvar reg = new RegExp( '^[0-9]*$' );\n\t\tvar timeout_count;\n\t\ttimeout_count = 0;\n\t\t// $('link[title=\"application css\"]').prop('disabled', true);\n\t\tif ( LocalCacheData.loadViewRequiredJSReady ) {\n\t\t\tshowRibbonMenuAndLoadView();\n\t\t} else {\n\t\t\tvar auto_login_timer = setInterval( function() {\n\t\t\t\tif ( timeout_count == 100 ) {\n\t\t\t\t\tclearInterval( auto_login_timer );\n\t\t\t\t}\n\t\t\t\ttimeout_count = timeout_count + 1;\n\t\t\t\tif ( LocalCacheData.loadViewRequiredJSReady ) {\n\t\t\t\t\tshowRibbonMenuAndLoadView();\n\t\t\t\t\tclearInterval( auto_login_timer );\n\t\t\t\t}\n\t\t\t}, 600 );\n\t\t}\n\n\t\tfunction showRibbonMenuAndLoadView() {\n\t\t\t$( 'body' ).removeClass( 'login-bg' );\n\t\t\t// Global.loadStyleSheet( '../theme/default/css/quickPunch.css' + '?v=' + APIGlobal.pre_login_data.application_build ); // #2844 quickpunch css will now be loaded at start.\n\t\t\tif ( !$this.headerView ) {\n\t\t\t\t$this.headerView = new _views_quick_punch_header_HeaderViewController__WEBPACK_IMPORTED_MODULE_0__.HeaderViewController();\n\t\t\t\t$( '#topContainer' ).html( $this.headerView.el );\n\t\t\t}\n\t\t\tloadViewController();\n\t\t}\n\n\t\tfunction loadViewController() {\n\t\t\tGlobal.loadViewSource( view_id, view_id + 'ViewController.js', function() {\n\t\t\t\t/* jshint ignore:start */\n\t\t\t\tvar view_controller = eval( 'new ' + view_id + 'ViewController(); ' );\n\t\t\t\tGlobal.trackView( view_id );\n\t\t\t\t/* jshint ignore:end */\n\n\t\t\t\t// Only show the top and bottom containers until after the view html is loaded, otherwise the download app links flash up at the top of the page, where the login header should be.\n\t\t\t\t// TODO: Improve this with Vue to be smoother and more structured, rather than trial and error.\n\t\t\t\tGlobal.topContainer().css( 'display', 'block' );\n\t\t\t\tGlobal.bottomContainer().css( 'display', 'block' );\n\t\t\t} );\n\t\t}\n\t}\n\n\t/* jshint ignore:end */\n\n\tcleanAnySubViewUI() {\n\t\tvar children = Global.contentContainer().children();\n\n\t\tif ( children.length > 1 ) {\n\t\t\tfor ( var i = 1; i < children.length; i++ ) {\n\t\t\t\t// Object doesn't support property or method 'remove', Not sure why, add try catch to ingore this error since this should no harm\n\t\t\t\ttry {\n\n\t\t\t\t\tif ( $( children[i] ).attr( 'id' ) === LocalCacheData.current_open_primary_controller.ui_id ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchildren[i].remove();\n\t\t\t\t\t}\n\n\t\t\t\t} catch ( e ) {\n\t\t\t\t\t//Do nothing\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}\n\n\tsetContentDivHeight() {\n\t\tGlobal.contentContainer().removeClass( 'content-container' );\n\t\tGlobal.contentContainer().addClass( 'content-container-after-login' );\n\t\tGlobal.topContainer().addClass( 'top-container-after-login' );\n\n\t}\n\n\taddTopMenu() {\n\t\tGlobal.loadScript( 'global/widgets/top_menu/TopMenuController.js' );\n\t\tif ( TopMenuController ) {\n\t\t\tTopMenuController.loadView();\n\t\t}\n\n\t}\n\n\tremoveCurrentView( callBack ) {\n\t\tif ( LocalCacheData.current_open_edit_only_controller ) {\n\t\t\tclean( LocalCacheData.current_open_edit_only_controller );\n\t\t\tLocalCacheData.current_open_edit_only_controller = null;\n\t\t}\n\n\t\tif ( LocalCacheData.current_open_primary_controller ) {\n\t\t\tif ( LocalCacheData.current_open_primary_controller.edit_view ) {\n\t\t\t\tclean( LocalCacheData.current_open_primary_controller );\n\t\t\t}\n\t\t\tGlobal.contentContainer().empty();\n\t\t\tLocalCacheData.current_open_primary_controller.cleanWhenUnloadView( callBack );\n\t\t} else {\n\n\t\t\tif ( Global.isSet( callBack ) ) {\n\t\t\t\tcallBack();\n\t\t\t}\n\t\t}\n\n\t\tfunction clean( viewController ) {\n\t\t\tviewController.clearErrorTips();\n\t\t\t// Cannot read property 'remove' of null in interface/html5/IndexController.js?v=9.0.0-20151016-153057 line 439\n\t\t\tif ( viewController.edit_view ) {\n\t\t\t\tviewController.edit_view.remove();\n\t\t\t}\n\t\t\tviewController.sub_log_view_controller = null;\n\t\t\tviewController.edit_view_ui_dic = {};\n\t\t\tviewController.edit_view_ui_validation_field_dic = {};\n\t\t\tviewController.edit_view_form_item_dic = {};\n\t\t\tviewController.edit_view_error_ui_dic = {};\n\t\t\tLocalCacheData.current_doing_context_action = '';\n\t\t}\n\t}\n}\n\nclass IndexViewController extends Backbone.View {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: 'body', //So we can add event listener for all elements\n\t\t\trouter: null,\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinitialize( options ) {\n\t\tIndexViewController.instance = this;\n\t\tthis.router = new ApplicationRouter();\n\t\t//Set title in index.php instead.\n\t\t//$( 'title' ).html( '' );\n\t\tthis.router.controller = this;\n\t\t//Error: Backbone.history has already been started in interface/html5/framework/backbone/backbone-min.js?v=9.0.1-20151022-162110 line 28\n\t\tif ( !Backbone.History.started ) {\n\t\t\tBackbone.history.start();\n\t\t}\n\t}\n}\n\nIndexViewController.instance = null;//# sourceURL=[module]\n//# sourceMappingURL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UxMDIyLTE2MjExMCBsaW5lIDI4XG5cdFx0aWYgKCAhQmFja2JvbmUuSGlzdG9yeS5zdGFydGVkICkge1xuXHRcdFx0QmFja2JvbmUuaGlzdG9yeS5zdGFydCgpO1xuXHRcdH1cblx0fVxufVxuXG5JbmRleFZpZXdDb250cm9sbGVyLmluc3RhbmNlID0gbnVsbDsiXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///7194\n")},9942:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"QuickPunchBaseViewController\": () => (/* binding */ QuickPunchBaseViewController)\n/* harmony export */ });\n/* harmony import */ var _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6739);\n/* provided dependency */ var _ = __webpack_require__(9050);\n\n\nclass QuickPunchBaseViewController extends _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__.TTBackboneView {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {} );\n\n\t\tsuper( options );\n\t}\n\n\t// getRequiredFiles() {\n\t// \t//override in child class\n\t// \treturn [];\n\t// }\n\n\t/**\n\t * When changing this function, you need to look for all occurences of this function because it was needed in several bases\n\t * BaseViewController, HomeViewController, BaseWizardController, QuickPunchBaseViewControler\n\t *\n\t * @returns {Array}\n\t */\n\t// filterRequiredFiles() {\n\t// \tvar retval = [];\n\t// \tvar required_files;\n\t//\n\t// \tif ( typeof this._required_files == 'object' ) {\n\t// \t\trequired_files = this._required_files;\n\t// \t} else {\n\t// \t\trequired_files = this.getRequiredFiles();\n\t// \t}\n\t//\n\t// \tif ( required_files && required_files[0] ) {\n\t// \t\tretval = required_files;\n\t// \t} else {\n\t// \t\tfor ( var edition_id in required_files ) {\n\t// \t\t\tif ( Global.getProductEdition() >= edition_id ) {\n\t// \t\t\t\tretval = retval.concat( required_files[edition_id] );\n\t// \t\t\t}\n\t// \t\t}\n\t// \t}\n\t//\n\t// \tDebug.Arr( retval, 'RETVAL', 'BaseViewController.js', 'BaseViewController', 'filterRequiredFiles', 10 );\n\t// \treturn retval;\n\t// }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTk0Mi5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7QUFBd0Q7O0FBRWpELDJDQUEyQyxpRUFBYztBQUNoRSwyQkFBMkI7QUFDM0IsRUFBRSxDQUFDLHVCQUF1Qjs7QUFFMUI7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGNBQWM7QUFDZDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLE9BQU87QUFDUDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsT0FBTztBQUNQO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9pbnRlcmZhY2UvaHRtbDUvdmlld3MvcXVpY2tfcHVuY2gvUXVpY2tQdW5jaEJhc2VWaWV3Q29udHJvbGxlci5qcz9kZTNlIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFRUQmFja2JvbmVWaWV3IH0gZnJvbSAnQC92aWV3cy9UVEJhY2tib25lVmlldyc7XG5cbmV4cG9ydCBjbGFzcyBRdWlja1B1bmNoQmFzZVZpZXdDb250cm9sbGVyIGV4dGVuZHMgVFRCYWNrYm9uZVZpZXcge1xuXHRjb25zdHJ1Y3Rvciggb3B0aW9ucyA9IHt9ICkge1xuXHRcdF8uZGVmYXVsdHMoIG9wdGlvbnMsIHt9ICk7XG5cblx0XHRzdXBlciggb3B0aW9ucyApO1xuXHR9XG5cblx0Ly8gZ2V0Um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HQvLyBcdFx0XHRpZiAoIEdsb2JhbC5nZXRQcm9kdWN0RWRpdGlvbigpID49IGVkaXRpb25faWQgKSB7XG5cdC8vIFx0XHRcdFx0cmV0dmFsID0gcmV0dmFsLmNvbmNhdCggcmVxdWlyZWRfZmlsZXNbZWRpdGlvbl9pZF0gKTtcblx0Ly8gXHRcdFx0fVxuXHQvLyBcdFx0fVxuXHQvLyBcdH1cblx0Ly9cblx0Ly8gXHREZWJ1Zy5BcnIoIHJldHZhbCwgJ1JFVFZBTCcsICdCYXNlVmlld0NvbnRyb2xsZXIuanMnLCAnQmFzZVZpZXdDb250cm9sbGVyJywgJ2ZpbHRlclJlcXVpcmVkRmlsZXMnLCAxMCApO1xuXHQvLyBcdHJldHVybiByZXR2YWw7XG5cdC8vIH1cbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///9942\n")},5196:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"HeaderViewController\": () => (/* binding */ HeaderViewController)\n/* harmony export */ });\n/* harmony import */ var _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6739);\n/* harmony import */ var _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);\n/* provided dependency */ var _ = __webpack_require__(9050);\n\n\n\nclass HeaderViewController extends _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__.TTBackboneView {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {} );\n\n\t\tsuper( options );\n\t}\n\n\tinitialize( options ) {\n\t\tsuper.initialize( options );\n\t\tvar tpl = Global.loadWidget( 'views/quick_punch/header/HeaderView.html' );\n\t\tif ( tpl ) { //JS Exception: Uncaught TypeError: Cannot read property 'replace' of undefined\n\t\t\tthis.tpl = _.template( tpl );\n\t\t}\n\t\tthis.render();\n\t}\n\n\trender() {\n\t\tvar url = _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_1__/* .ServiceCaller.getURLByObjectType */ .n.getURLByObjectType( 'primary_company_logo' );\n\t\tif ( this.tpl ) {\n\t\t\tthis.setElement( this.tpl( { company_logo: url } ) );\n\t\t}\n\t}\n\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTE5Ni5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQXdEO0FBQ0M7O0FBRWxELG1DQUFtQyxpRUFBYztBQUN4RCwyQkFBMkI7QUFDM0IsRUFBRSxDQUFDLHVCQUF1Qjs7QUFFMUI7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxlQUFlO0FBQ2YsY0FBYyxDQUFDO0FBQ2Y7QUFDQTtBQUNBOztBQUVBO0FBQ0EsWUFBWSxpSEFBZ0M7QUFDNUM7QUFDQSxnQ0FBZ0Msb0JBQW9CO0FBQ3BEO0FBQ0E7O0FBRUEiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9pbnRlcmZhY2UvaHRtbDUvdmlld3MvcXVpY2tfcHVuY2gvaGVhZGVyL0hlYWRlclZpZXdDb250cm9sbGVyLmpzPzgzMmUiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgVFRCYWNrYm9uZVZpZXcgfSBmcm9tICdAL3ZpZXdzL1RUQmFja2JvbmVWaWV3JztcbmltcG9ydCB7IFNlcnZpY2VDYWxsZXIgfSBmcm9tICdAL3NlcnZpY2VzL1NlcnZpY2VDYWxsZXInO1xuXG5leHBvcnQgY2xhc3MgSGVhZGVyVmlld0NvbnRyb2xsZXIgZXh0ZW5kcyBUVEJhY2tib25lVmlldyB7XG5cdGNvbnN0cnVjdG9yKCBvcHRpb25zID0ge30gKSB7XG5cdFx0Xy5kZWZhdWx0cyggb3B0aW9ucywge30gKTtcblxuXHRcdHN1cGVyKCBvcHRpb25zICk7XG5cdH1cblxuXHRpbml0aWFsaXplKCBvcHRpb25zICkge1xuXHRcdHN1cGVyLmluaXRpYWxpemUoIG9wdGlvbnMgKTtcblx0XHR2YXIgdHBsID0gR2xvYmFsLmxvYWRXaWRnZXQoICd2aWV3cy9xdWlja19wdW5jaC9oZWFkZXIvSGVhZGVyVmlldy5odG1sJyApO1xuXHRcdGlmICggdHBsICkgeyAvL0pTIEV4Y2VwdGlvbjogVW5jYXVnaHQgVHlwZUVycm9yOiBDYW5ub3QgcmVhZCBwcm9wZXJ0eSAncmVwbGFjZScgb2YgdW5kZWZpbmVkXG5cdFx0XHR0aGlzLnRwbCA9IF8udGVtcGxhdGUoIHRwbCApO1xuXHRcdH1cblx0XHR0aGlzLnJlbmRlcigpO1xuXHR9XG5cblx0cmVuZGVyKCkge1xuXHRcdHZhciB1cmwgPSBTZXJ2aWNlQ2FsbGVyLmdldFVSTEJ5T2JqZWN0VHlwZSggJ3ByaW1hcnlfY29tcGFueV9sb2dvJyApO1xuXHRcdGlmICggdGhpcy50cGwgKSB7XG5cdFx0XHR0aGlzLnNldEVsZW1lbnQoIHRoaXMudHBsKCB7IGNvbXBhbnlfbG9nbzogdXJsIH0gKSApO1xuXHRcdH1cblx0fVxuXG59XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///5196\n")},3e3:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"QuickPunchModalController\": () => (/* binding */ QuickPunchModalController),\n/* harmony export */ \"QuickPunchViewController\": () => (/* binding */ QuickPunchViewController)\n/* harmony export */ });\n/* harmony import */ var _views_quick_punch_QuickPunchBaseViewController__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9942);\n/* harmony import */ var _quick_punch_IndexController__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7194);\n/* harmony import */ var _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7526);\n/* harmony import */ var _global_TAlertManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9239);\n/* harmony import */ var _global_TTUUID__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4936);\n/* harmony import */ var _global_Global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9490);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\n\n\n\n\n\nclass QuickPunchViewController extends _views_quick_punch_QuickPunchBaseViewController__WEBPACK_IMPORTED_MODULE_0__.QuickPunchBaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\ttype_array: null,\n\t\t\tstatus_array: null,\n\t\t\tbranch_array: null,\n\t\t\tdepartment_array: null,\n\t\t\tjob_array: null,\n\t\t\tjob_item_array: null,\n\t\t\tpunch_tag_array: null,\n\n\t\t\tjob_api: null,\n\t\t\tjob_item_api: null,\n\t\t\tpunch_tag_api: null,\n\n\t\t\tdefault_punch_tag: [],\n\t\t\tprevious_punch_tag_selection: [],\n\n\t\t\told_type_status: {},\n\n\t\t\tshow_job_ui: false,\n\t\t\tshow_job_item_ui: false,\n\t\t\tshow_punch_tag_ui: false,\n\t\t\tshow_branch_ui: false,\n\t\t\tshow_department_ui: false,\n\t\t\tshow_good_quantity_ui: false,\n\t\t\tshow_bad_quantity_ui: false,\n\t\t\tshow_transfer_ui: false,\n\t\t\tshow_node_ui: false,\n\t\t\tel: '#quick_punch_container',\n\t\t\tevents: {\n\t\t\t\t'change input[type=\"text\"]': 'onFormItemChange',\n\t\t\t\t'change input[type=\"number\"]': 'onFormItemChange',\n\t\t\t\t'change input[type=\"checkbox\"]': 'onFormItemChange',\n\t\t\t\t'change select.form-control': 'onFormItemChange',\n\t\t\t\t'change textarea.form-control': 'onFormItemChange'\n\t\t\t}\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinitialize( options ) {\n\t\tsuper.initialize( options );\n\n\t\tif ( !LocalCacheData.getPunchLoginUser() ) {\n\t\t\t_quick_punch_IndexController__WEBPACK_IMPORTED_MODULE_1__/* .IndexViewController.instance.router.navigate */ .g.instance.router.navigate( 'QuickPunchLogin', true );\n\t\t\treturn false;\n\t\t}\n\t\tthis.current_edit_record = null;\n\t\tthis.edit_view_error_ui_dic = {};\n\t\tthis.permission_id = 'punch';\n\t\tthis.custom_fields = [];\n\n\t\tthis.api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_2__/* .TTAPI.APIPunch */ .y.APIPunch;\n\t\tthis.branch_api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_2__/* .TTAPI.APIBranch */ .y.APIBranch;\n\t\tthis.department_api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_2__/* .TTAPI.APIDepartment */ .y.APIDepartment;\n\t\tthis.custom_field_api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_2__/* .TTAPI.APICustomField */ .y.APICustomField;\n\t\tif ( ( _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.getProductEdition */ .x.getProductEdition() >= 20 ) ) {\n\t\t\tthis.job_api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_2__/* .TTAPI.APIJob */ .y.APIJob;\n\t\t\tthis.job_item_api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_2__/* .TTAPI.APIJobItem */ .y.APIJobItem;\n\t\t\tthis.punch_tag_api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_2__/* .TTAPI.APIPunchTag */ .y.APIPunchTag;\n\t\t}\n\t\tthis.company_api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_2__/* .TTAPI.APICompany */ .y.APICompany;\n\t\tthis.api_station = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_2__/* .TTAPI.APIStation */ .y.APIStation;\n\t\tthis.current_user_api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_2__/* .TTAPI.APIAuthentication */ .y.APIAuthentication;\n\t\tthis.initPermission();\n\t\tProgressBar.showOverlay();\n\n\t\tTTPromise.add( 'QuickPunch', 'CurrentEditRecordComplete' );\n\n\t\tthis.initOptions();\n\t\tthis.getUserPunch();\n\n\t\tvar $this = this;\n\t\tthis.getCustomFields( function() {\n\t\t\tTTPromise.wait( 'QuickPunch', 'CurrentEditRecordComplete', function() {\n\t\t\t\t$this.render();\n\t\t\t} );\n\t\t} );\n\t}\n\n\tinitPermission() {\n\t\tif ( this.jobUIValidate() ) {\n\t\t\tthis.show_job_ui = true;\n\t\t} else {\n\t\t\tthis.show_job_ui = false;\n\t\t}\n\n\t\tif ( this.jobItemUIValidate() ) {\n\t\t\tthis.show_job_item_ui = true;\n\t\t} else {\n\t\t\tthis.show_job_item_ui = false;\n\t\t}\n\n\t\tif ( this.punchTagUIValidate() ) {\n\t\t\tthis.show_punch_tag_ui = true;\n\t\t} else {\n\t\t\tthis.show_punch_tag_ui = false;\n\t\t}\n\n\t\tif ( this.branchUIValidate() ) {\n\t\t\tthis.show_branch_ui = true;\n\t\t} else {\n\t\t\tthis.show_branch_ui = false;\n\t\t}\n\n\t\tif ( this.departmentUIValidate() ) {\n\t\t\tthis.show_department_ui = true;\n\t\t} else {\n\t\t\tthis.show_department_ui = false;\n\t\t}\n\n\t\tif ( this.goodQuantityUIValidate() ) {\n\t\t\tthis.show_good_quantity_ui = true;\n\t\t} else {\n\t\t\tthis.show_good_quantity_ui = false;\n\t\t}\n\n\t\tif ( this.badQuantityUIValidate() ) {\n\t\t\tthis.show_bad_quantity_ui = true;\n\t\t} else {\n\t\t\tthis.show_bad_quantity_ui = false;\n\t\t}\n\n\t\tif ( this.transferUIValidate() ) {\n\t\t\tthis.show_transfer_ui = true;\n\t\t} else {\n\t\t\tthis.show_transfer_ui = false;\n\t\t}\n\n\t\tif ( this.noteUIValidate() ) {\n\t\t\tthis.show_node_ui = true;\n\t\t} else {\n\t\t\tthis.show_node_ui = false;\n\t\t}\n\n\t\t// Error: Uncaught TypeError: (intermediate value).isBranchAndDepartmentAndJobAndJobItemAndPunchTagEnabled is not a function on line 207\n\t\tif ( this.company_api && _.isFunction( this.company_api.isBranchAndDepartmentAndJobAndJobItemAndPunchTagEnabled ) ) {\n\t\t\tvar $this = this;\n\t\t\tthis.company_api.isBranchAndDepartmentAndJobAndJobItemAndPunchTagEnabled( {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t//tried to fix Unable to get property 'getResult' of undefined or null reference, added if(!result)\n\t\t\t\t\tif ( !result ) {\n\t\t\t\t\t\t$this.show_branch_ui = false;\n\t\t\t\t\t\t$this.show_department_ui = false;\n\t\t\t\t\t\t$this.show_job_ui = false;\n\t\t\t\t\t\t$this.show_job_item_ui = false;\n\t\t\t\t\t\t$this.show_punch_tag_ui = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = result.getResult();\n\t\t\t\t\t\tif ( !result.branch ) {\n\t\t\t\t\t\t\t$this.show_branch_ui = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( !result.department ) {\n\t\t\t\t\t\t\t$this.show_department_ui = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( !result.job ) {\n\t\t\t\t\t\t\t$this.show_job_ui = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( !result.job_item ) {\n\t\t\t\t\t\t\t$this.show_job_item_ui = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( !result.punch_tag ) {\n\t\t\t\t\t\t\t$this.punch_tag_ui = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\tjobUIValidate() {\n\t\tif ( PermissionManager.validate( 'job', 'enabled' ) &&\n\t\t\tPermissionManager.validate( 'punch', 'edit_job' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tjobItemUIValidate() {\n\t\tif ( PermissionManager.validate( 'job', 'enabled' ) &&\n\t\t\tPermissionManager.validate( 'punch', 'edit_job_item' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpunchTagUIValidate() {\n\t\tif ( PermissionManager.validate( 'punch', 'edit_punch_tag' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tbranchUIValidate() {\n\t\tif ( PermissionManager.validate( 'punch', 'edit_branch' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tdepartmentUIValidate() {\n\t\tif ( PermissionManager.validate( 'punch', 'edit_department' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tgoodQuantityUIValidate() {\n\t\tif ( PermissionManager.validate( 'job', 'enabled' ) &&\n\t\t\tPermissionManager.validate( 'punch', 'edit_quantity' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tbadQuantityUIValidate() {\n\t\tif ( PermissionManager.validate( 'job', 'enabled' ) &&\n\t\t\tPermissionManager.validate( 'punch', 'edit_bad_quantity' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\ttransferUIValidate() {\n\t\tif ( PermissionManager.validate( 'punch', 'edit_transfer' ) || PermissionManager.validate( 'punch', 'default_transfer' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tnoteUIValidate() {\n\t\tif ( PermissionManager.validate( 'punch', 'edit_note' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpreRender( callBack ) {\n\t\tvar $this = this;\n\t\tTTPromise.wait( 'QuickPunch_options', null, function() {\n\t\t\t$this.setSourceData( 'status_id', $this.status_array, true );\n\t\t\t$this.setSourceData( 'type_id', $this.type_array, true );\n\t\t\t$this.setSourceData( 'branch_id', $this.branch_array, true );\n\t\t\t$this.setSourceData( 'department_id', $this.department_array, true );\n\t\t\t$this.setSourceData( 'job_id', $this.job_array, true );\n\t\t\t$this.setSourceData( 'job_item_id', $this.job_item_array, true );\n\t\t\t$this.setSourceData( 'punch_tag_id', $this.punch_tag_array, true );\n\n\t\t\t$this.custom_fields.forEach( ( custom_field ) => {\n\t\t\t\tif ( custom_field.type_id == 2100 || custom_field.type_id == 2110 ) {\n\t\t\t\t\t$this.setSourceData( custom_field.field, custom_field.meta_data.validation.multi_select_items, true );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\t_global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.contentContainer */ .x.contentContainer().html( $this.$el );\n\n\t\t\tif ( ( _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.getProductEdition */ .x.getProductEdition() >= 20 ) ) {\n\t\t\t\t//Set defaults for punch tags.\n\t\t\t\t$this.$( 'select[name=\"punch_tag_id\"]' ).val( $this.current_edit_record.punch_tag_id );\n\t\t\t\t$this.setPunchTagQuickSearchManualIds( $this.current_edit_record.punch_tag_id );\n\t\t\t}\n\n\t\t\tTTPromise.wait( null, null, function() {\n\t\t\t\tvar field = $this.getFirstAvailableField();\n\t\t\t\tfield.setAttribute( 'tab-start', '' );\n\t\t\t\tfield.focus();\n\t\t\t\tvar quick_punch_success_controller = new QuickPunchModalController( {\n\t\t\t\t\tel: $this.el,\n\t\t\t\t\t_timedRedirect: 10,\n\t\t\t\t\tis_modal: false,\n\t\t\t\t\t_delegateCallback: function() {\n\t\t\t\t\t\t$this.onSaveClick();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} );\n\t\t} );\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\n\t\tvar user = LocalCacheData.getPunchLoginUser();\n\t\tvar args = {};\n\t\targs.filter_columns = {\n\t\t\tid: true,\n\t\t\tname: true\n\t\t};\n\t\tTTPromise.add( 'QuickPunch_options', 'Status' );\n\t\tTTPromise.add( 'QuickPunch_options', 'Type' );\n\t\tTTPromise.add( 'QuickPunch_options', 'Branch' );\n\t\tTTPromise.add( 'QuickPunch_options', 'Department' );\n\t\tthis.api.getOptions( 'status', {\n\t\t\tonResult: function( result ) {\n\t\t\t\t$this.status_array = result.getResult();\n\t\t\t\tTTPromise.resolve( 'QuickPunch_options', 'Status' );\n\t\t\t}\n\t\t} );\n\t\tthis.api.getOptions( 'type', {\n\t\t\tonResult: function( result ) {\n\t\t\t\t$this.type_array = result.getResult();\n\t\t\t\tTTPromise.resolve( 'QuickPunch_options', 'Type' );\n\t\t\t}\n\t\t} );\n\n\t\tvar $this = this;\n\t\tTTPromise.wait( 'QuickPunch', 'CurrentEditRecordComplete', function() {\n\t\t\t//Branch and Department require the current record to be set to create the proper filter data.\n\n\t\t\tif ( ( _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.getProductEdition */ .x.getProductEdition() >= 20 ) ) {\n\t\t\t\targs.filter_data = { status_id: 10, include_id: $this.current_edit_record.branch_id, user_id: user.id };\n\t\t\t} else {\n\t\t\t\targs.filter_data = { status_id: 10 };\n\t\t\t}\n\t\t\t$this.branch_api.getBranch( args, true, {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t$this.branch_array = result.getResult();\n\n\t\t\t\t\tTTPromise.resolve( 'QuickPunch_options', 'Branch' );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tif ( ( _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.getProductEdition */ .x.getProductEdition() >= 20 ) ) {\n\t\t\t\targs.filter_data = { status_id: 10, include_id: $this.current_edit_record.department_id, user_id: user.id, branch_id: $this.current_edit_record.branch_id };\n\t\t\t} else {\n\t\t\t\targs.filter_data = { status_id: 10 };\n\t\t\t}\n\t\t\t$this.department_api.getDepartment( args, true, {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t$this.department_array = result.getResult();\n\t\t\t\t\tTTPromise.resolve( 'QuickPunch_options', 'Department' );\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\n\t\tif ( ( _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.getProductEdition */ .x.getProductEdition() >= 20 ) ) {\n\t\t\tTTPromise.add( 'QuickPunch_options', 'Job' );\n\t\t\tTTPromise.add( 'QuickPunch_options', 'JobItem' );\n\t\t\tTTPromise.add( 'QuickPunch_options', 'PunchTag' );\n\n\t\t\tvar $this = this;\n\t\t\tTTPromise.wait( 'QuickPunch', 'CurrentEditRecordComplete', function() {\n\t\t\t\targs.filter_data = {\n\t\t\t\t\tstatus_id: 10,\n\t\t\t\t\tuser_id: user.id,\n\t\t\t\t\tpunch_branch_id: $this.current_edit_record.branch_id,\n\t\t\t\t\tpunch_department_id: $this.current_edit_record.department_id\n\t\t\t\t};\n\t\t\t\targs.filter_columns.manual_id = args.filter_columns.default_item_id = true;\n\t\t\t\t$this.job_api.getJob( args, true, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t$this.job_array = result.getResult();\n\t\t\t\t\t\tTTPromise.resolve( 'QuickPunch_options', 'Job' );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\targs.filter_data = { status_id: 10, job_id: $this.current_edit_record.job_id };\n\t\t\t\targs.filter_columns.default_item_id = false;\n\t\t\t\t$this.job_item_api.getJobItem( args, true, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t$this.job_item_array = result.getResult();\n\t\t\t\t\t\tTTPromise.resolve( 'QuickPunch_options', 'JobItem' );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\tvar punch_tag_args = {};\n\t\t\t\tpunch_tag_args.filter_data = $this.getPunchTagFilterData();\n\t\t\t\t$this.punch_tag_api.getPunchTag( punch_tag_args, true, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t$this.punch_tag_array = result.getResult();\n\t\t\t\t\t\tTTPromise.resolve( 'QuickPunch_options', 'PunchTag' );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} );\n\t\t}\n\t}\n\n\tgetFirstAvailableField() {\n\t\treturn _.min( this.$( 'input[tabindex], select[tabindex], textarea[tabindex]' ), function( el ) {\n\t\t\tif ( $( el ).attr( 'tabindex' ) ) {\n\t\t\t\treturn parseInt( $( el ).attr( 'tabindex' ) );\n\t\t\t}\n\t\t} );\n\t}\n\n\tgetCustomFields( callBack ) {\n\t\tvar $this = this;\n\t\t//text, textarea, currency, integer, decimal, time unit, single/multi-select dropdown\n\t\tvar filter = {\n\t\t\tfilter_data: {\n\t\t\t\tparent_table: 'punch_control',\n\t\t\t\ttype_id: [\n\t\t\t\t\t100, //Text\n\t\t\t\t\t110, //Textarea\n\t\t\t\t\t400, //Integer\n\t\t\t\t\t410, //Decimal\n\t\t\t\t\t420, //Currency\n\t\t\t\t\t500, //Checkbox\n\t\t\t\t\t1100, //Time\n\t\t\t\t\t1300, //Time Unit\n\t\t\t\t\t2100, //Single-select\n\t\t\t\t\t2110, //Multi-select\n\t\t\t\t]\n\t\t\t}\n\t\t};\n\t\tthis.custom_field_api.getCustomField( filter, true, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tvar res_data = result.getResult();\n\t\t\t\tif ( Array.isArray( res_data ) && res_data.length > 0 ) {\n\t\t\t\t\tTTPromise.wait( 'QuickPunch', 'CurrentEditRecordComplete', function() {\n\t\t\t\t\t\tres_data.forEach( ( custom_field ) => {\n\t\t\t\t\t\t\tvar permission = PermissionManager.getPermissionData();\n\t\t\t\t\t\t\t//Permissions are for the non-'_id' custom fields.\n\t\t\t\t\t\t\tlet custom_field_id_parsed_suffix = custom_field.id.replace( '_id', '' );\n\t\t\t\t\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.isSet */ .x.isSet( permission[$this.permission_id]['edit_custom_field-' + custom_field_id_parsed_suffix] ) ) {\n\t\t\t\t\t\t\t\tif ( PermissionManager.validate( $this.permission_id, 'edit_custom_field-' + custom_field_id_parsed_suffix ) === true ) {\n\t\t\t\t\t\t\t\t\t$this.custom_fields.push( {\n\t\t\t\t\t\t\t\t\t\tfield: 'custom_field-' + custom_field.id,\n\t\t\t\t\t\t\t\t\t\tlabel: custom_field.name,\n\t\t\t\t\t\t\t\t\t\tvalue: $this.current_edit_record['custom_field-' + custom_field.id],\n\t\t\t\t\t\t\t\t\t\ttype_id: custom_field.type_id,\n\t\t\t\t\t\t\t\t\t\tmeta_data: custom_field.meta_data\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\tcallBack();\n\t\t\t}\n\t\t} );\n\t}\n\n\trender() {\n\t\tvar $this = this;\n\t\tvar row = _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.loadWidget */ .x.loadWidget( 'views/quick_punch/punch/QuickPunchView.html' );\n\n\t\t//#2571 exception: null is not an object (evaluating 'this.current_edit_record['first_name']')\n\t\t//cancel when error case is hit\n\t\tif ( !this.current_edit_record ) {\n\t\t\tthis.onCancelClick();\n\t\t}\n\n\t\tthis.setElement( _.template( row )( {\n\t\t\tshow_job_ui: this.show_job_ui,\n\t\t\tshow_job_item_ui: this.show_job_item_ui,\n\t\t\tshow_punch_tag_ui: this.show_punch_tag_ui,\n\t\t\tshow_branch_ui: this.show_branch_ui,\n\t\t\tshow_department_ui: this.show_department_ui,\n\t\t\tshow_good_quantity_ui: this.show_good_quantity_ui,\n\t\t\tshow_bad_quantity_ui: this.show_bad_quantity_ui,\n\t\t\tshow_transfer_ui: this.show_transfer_ui,\n\t\t\tshow_node_ui: this.show_node_ui,\n\t\t\tfirst_name: this.current_edit_record['first_name'],\n\t\t\tlast_name: this.current_edit_record['last_name'],\n\t\t\tpunch_time: this.current_edit_record['punch_time'],\n\t\t\tpunch_date: this.current_edit_record['punch_date'],\n\t\t\ttransfer: this.current_edit_record['transfer'],\n\t\t\tquantity: this.current_edit_record['quantity'],\n\t\t\tbad_quantity: this.current_edit_record['bad_quantity'],\n\t\t\tnote: this.current_edit_record['note'],\n\t\t\tcustom_fields: this.custom_fields\n\t\t} ) );\n\t\tthis.save_btn = this.$( '#save_btn' );\n\t\tthis.save_btn.on( 'click', function() {\n\t\t\t$this.onSaveClick();\n\t\t} );\n\t\tthis.cancel_btn = this.$( '#cancel_btn' );\n\t\tthis.cancel_btn.on( 'click', function() {\n\t\t\t$this.onCancelClick();\n\t\t} );\n\n\t\tthis.preRender();\n\n\t\t//this.initOptions();\n\t\t$( document ).off( 'keydown' ).on( 'keydown', function( event ) {\n\t\t\tvar attrs = event.target.attributes;\n\t\t\tif ( event.keyCode === 13 && $( event.target ).attr( 'id' ) != 'cancel_btn' ) {\n\t\t\t\tif ( $this.save_btn.attr( 'disabled' ) == 'disabled' ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( event.target.name == 'note' ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t$this.onSaveClick();\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn;\n\t\t\t} else if ( ( event.keyCode === 13 || event.keyCode === 32 ) && $( event.target ).attr( 'id' ) == 'cancel_btn' ) {\n\t\t\t\t$this.onCancelClick();\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( event.keyCode === 9 && event.shiftKey ) {\n\t\t\t\t//ensure the first editable item is selected.\n\t\t\t\tif ( $( event.target ).parents( '.form-group' ).index() == $( $( '.quick-punch-form-container select,input,textarea' )[0] ).parents( '.form-group' ).index() ) {\n\n\t\t\t\t\t$( '#cancel_btn' ).focus();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( attrs['tab-end'] && event.shiftKey === false ) {\n\t\t\t\tvar button = $this.$( 'input[tab-start]', $this.$el );\n\t\t\t\tif ( button.length > 0 ) { //Uncaught TypeError: Cannot read property 'focus' of undefined\n\t\t\t\t\tbutton[0].focus();\n\t\t\t\t}\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t} );\n\t\treturn this;\n\t}\n\n\tgetUserPunch() {\n\t\tvar $this = this;\n\n\t\tvar station_id = _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.getStationID */ .x.getStationID();\n\n\t\tif ( station_id ) {\n\t\t\tthis.api_station.getCurrentStation( station_id, '10', {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\tdoNext( result );\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\tthis.api_station.getCurrentStation( '', '10', {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\tdoNext( result );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tfunction doNext( result ) {\n\t\t\tif ( !$this.api || typeof $this.api['getUserPunch'] !== 'function' ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar res_data = result.getResult();\n\t\t\t// setCookie( 'StationID', res_data );\n\t\t\t_global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.setStationID */ .x.setStationID( res_data );\n\t\t}\n\n\t\t$this.api.getUserPunch( {\n\t\t\tonResult: function( result ) {\n\t\t\t\tvar result_data = result.getResult();\n\t\t\t\tif ( !result.isValid() ) {\n\t\t\t\t\t$this.showErrorAlert( result, function() {\n\t\t\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t\t\t$this.doLogout();\n\t\t\t\t\t\t}, 5000 );\n\t\t\t\t\t} );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.isSet */ .x.isSet( result_data ) ) {\n\t\t\t\t\t$this.current_edit_record = result_data;\n\t\t\t\t\t$this.old_type_status.status_id = result_data.status_id;\n\t\t\t\t\t$this.old_type_status.type_id = result_data.type_id;\n\t\t\t\t\tTTPromise.resolve( 'QuickPunch', 'CurrentEditRecordComplete' );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\tshowErrorAlert( result, callback ) {\n\t\tvar error_list = result.getDetails() ? result.getDetails()[0] : {};\n\t\tif ( error_list && error_list.hasOwnProperty( 'error' ) ) {\n\t\t\terror_list = error_list.error;\n\t\t}\n\t\tvar container = $( '
' ).addClass( 'text-center' );\n\t\t\tvar error_string;\n\t\t\tif ( _.isArray( error_list[key] ) ) {\n\t\t\t\terror_string = error_list[key][0];\n\t\t\t} else {\n\t\t\t\terror_string = error_list[key];\n\t\t\t}\n\t\t\terror_obj.text( $.i18n._( error_string ) );\n\t\t\tcontainer.append( error_obj );\n\t\t}\n\t\tif ( _.size( error_list ) > 0 ) {\n\t\t\t_global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.contentContainer */ .x.contentContainer().html( container );\n\t\t}\n\t\tcallback();\n\t}\n\n\tonFormItemChange( e, doNotValidate ) {\n\t\tvar key = e.currentTarget.name;\n\t\tvar c_value = $( e.currentTarget ).val();\n\t\tthis.current_edit_record[key] = c_value;\n\t\tswitch ( key ) {\n\t\t\tcase 'job_id':\n\t\t\t\tif ( ( _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.getProductEdition */ .x.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tvar manual_id = $( $( e.currentTarget ).find( 'option[value=\\'' + c_value + '\\']' ) ).attr( 'manual_id' );\n\t\t\t\t\tthis.$( 'input[name=\"job_quick_search\"]' ).val( manual_id ? manual_id : '' );\n\t\t\t\t\tthis.setJobItemValueWhenJobChanged( c_value );\n\t\t\t\t\tthis.setPunchTagValuesWhenCriteriaChanged( this.getPunchTagFilterData(), 'punch_tag_id' );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'job_item_id':\n\t\t\t\tif ( ( _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.getProductEdition */ .x.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tvar manual_id = $( $( e.currentTarget ).find( 'option[value=\\'' + c_value + '\\']' ) ).attr( 'manual_id' );\n\t\t\t\t\tthis.$( 'input[name=\"job_item_quick_search\"]' ).val( manual_id ? manual_id : '' );\n\t\t\t\t\tthis.setPunchTagValuesWhenCriteriaChanged( this.getPunchTagFilterData(), 'punch_tag_id' );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'punch_tag_id':\n\t\t\t\tif ( ( _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.getProductEdition */ .x.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tvar selected_punch_tags = [...e.target.selectedOptions].map( element => element.getAttribute( 'manual_id' ) ).join();\n\t\t\t\t\tthis.$( 'input[name=\"punch_tag_quick_search\"]' ).val( selected_punch_tags );\n\n\t\t\t\t\tthis.previous_punch_tag_selection = c_value;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'transfer':\n\t\t\t\tvar c_value;\n\t\t\t\tif ( $( e.currentTarget ).is( ':checked' ) ) {\n\t\t\t\t\tc_value = true;\n\t\t\t\t} else {\n\t\t\t\t\tc_value = false;\n\t\t\t\t}\n\t\t\t\tthis.current_edit_record[key] = c_value;\n\t\t\t\tthis.onTransferChanged( c_value );\n\t\t\t\tbreak;\n\t\t\tcase 'branch_id':\n\t\t\t\tif ( ( _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.getProductEdition */ .x.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tthis.setDepartmentValueWhenBranchChanged( c_value );\n\t\t\t\t\tthis.setJobValueWhenCriteriaChanged();\n\t\t\t\t\tthis.setPunchTagValuesWhenCriteriaChanged( this.getPunchTagFilterData(), 'punch_tag_id' );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'user_id':\n\t\t\tcase 'department_id':\n\t\t\t\tif ( ( _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.getProductEdition */ .x.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tthis.setJobValueWhenCriteriaChanged( c_value );\n\t\t\t\t\tthis.setPunchTagValuesWhenCriteriaChanged( this.getPunchTagFilterData(), 'punch_tag_id' );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'job_quick_search':\n\t\t\tcase 'job_item_quick_search':\n\t\t\t\tif ( ( _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.getProductEdition */ .x.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tthis.onJobQuickSearch( key, c_value );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'punch_tag_quick_search':\n\t\t\t\tif ( ( _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.getProductEdition */ .x.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tthis.onPunchTagQuickSearch( key, c_value );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif ( key.includes( 'custom_field-' ) ) {\n\t\t\t\t\tthis.onCustomFieldChange( key, c_value, e );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\tif ( !doNotValidate ) {\n\t\t\tthis.validate();\n\t\t}\n\t}\n\n\tonCustomFieldChange( key, value, e ) {\n\t\tlet custom_field = this.custom_fields.find( custom_field => custom_field.field === key );\n\n\t\tif ( custom_field ) {\n\t\t\tswitch ( parseInt( custom_field.type_id ) ) {\n\t\t\t\tcase 500:\n\t\t\t\t\tif ( $( e.currentTarget ).is( ':checked' ) ) {\n\t\t\t\t\t\tvalue = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalue = false;\n\t\t\t\t\t}\n\t\t\t\t\tthis.current_edit_record[key] = value;\n\t\t\t}\n\t\t}\n\t}\n\n\tvalidate() {\n\t\tvar $this = this;\n\t\tthis.api.setUserPunch( this.current_edit_record, true, {\n\t\t\tonResult: function( result ) {\n\t\t\t\t$this.validateResult( result );\n\t\t\t}\n\t\t} );\n\t}\n\n\tvalidateResult( result ) {\n\t\tvar $this = this;\n\t\tif ( !result.isValid() ) {\n\t\t\t$this.setErrorTips( result );\n\t\t}\n\t}\n\n\tsetErrorTips( result ) {\n\t\tthis.clearErrorTips( true );\n\t\tvar error_list = {};\n\t\tvar no_obj_error_string = '';\n\t\tif ( result.getDetails() ) {\n\t\t\terror_list = result.getDetails()[0];\n\t\t} else {\n\t\t\tvar error = result.getDescription();\n\t\t\t_global_TAlertManager__WEBPACK_IMPORTED_MODULE_3__/* .TAlertManager.showAlert */ .K.showAlert( error, 'Error' );\n\t\t\tthis.save_btn.removeAttr( 'disabled' );\n\t\t\treturn;\n\t\t}\n\t\tif ( error_list && error_list.hasOwnProperty( 'error' ) ) {\n\t\t\terror_list = error_list.error;\n\t\t}\n\t\tfor ( var key in error_list ) {\n\t\t\tif ( !error_list.hasOwnProperty( key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvar field_obj;\n\t\t\tvar error_string;\n\t\t\tswitch ( key ) {\n\t\t\t\t// case 'time_stamp':\n\t\t\t\t// field_obj = this.$('p[name=\"punch_time\"]');\n\t\t\t\t// break;\n\t\t\t\t// case 'lic_obj':\n\t\t\t\t// field_obj = this.$('p[name=\"user_full_name\"]');\n\t\t\t\t// break;\n\t\t\t\tdefault:\n\t\t\t\t\tif ( this.$( 'input[name=\"' + key + '\"]' )[0] ) {\n\t\t\t\t\t\tfield_obj = this.$( 'input[name=\"' + key + '\"]' );\n\t\t\t\t\t} else if ( this.$( 'select[name=\"' + key + '\"]' )[0] ) {\n\t\t\t\t\t\tfield_obj = this.$( 'select[name=\"' + key + '\"]' );\n\t\t\t\t\t} else if ( this.$( 'textarea[name=\"' + key + '\"]' )[0] ) {\n\t\t\t\t\t\tfield_obj = this.$( 'textarea[name=\"' + key + '\"]' );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( _.isArray( error_list[key] ) ) {\n\t\t\t\terror_string = error_list[key][0];\n\t\t\t} else {\n\t\t\t\terror_string = error_list[key];\n\t\t\t}\n\t\t\tif ( field_obj ) {\n\t\t\t\tthis.showErrorTips( field_obj, error_string );\n\t\t\t\tthis.edit_view_error_ui_dic[key] = field_obj;\n\t\t\t} else {\n\t\t\t\tno_obj_error_string += error_string + '';\n\t\t\t}\n\t\t}\n\t\tif ( _.size( this.edit_view_error_ui_dic ) > 0 ) {\n\t\t\tthis.save_btn.removeAttr( 'disabled' );\n\t\t\tvar focus_obj = _.min( this.edit_view_error_ui_dic, function( item ) {\n\t\t\t\tif ( item.attr( 'tabindex' ) ) {\n\t\t\t\t\treturn parseInt( item.attr( 'tabindex' ) );\n\t\t\t\t}\n\t\t\t} );\n\t\t\tif ( typeof focus_obj.focus !== 'undefined' ) {\n\t\t\t\tfocus_obj.focus();\n\t\t\t} else {\n\t\t\t\tvar field = this.getFirstAvailableField();\n\t\t\t\tfield.focus();\n\t\t\t}\n\t\t}\n\t\tif ( no_obj_error_string != '' ) {\n\t\t\tthis.save_btn.removeAttr( 'disabled' );\n\t\t\t_global_TAlertManager__WEBPACK_IMPORTED_MODULE_3__/* .TAlertManager.showAlert */ .K.showAlert( no_obj_error_string, 'Error' );\n\t\t}\n\t}\n\n\tshowErrorTips( field_obj, error_msg ) {\n\t\tfield_obj.addClass( 'error-tip' );\n\t\tfield_obj.attr( 'data-original-title', error_msg );\n\t\tfield_obj.tooltip( {\n\t\t\t// title: error_msg,\n\t\t\tcontainer: 'body',\n\t\t\ttrigger: 'hover focus'\n\t\t\t// placement: 'right'\n\t\t\t// delay: { \"show\": 0, \"hide\": 0 }\n\t\t} );\n\t\tfield_obj.tooltip( 'show' );\n\t\t// field_obj.tooltip('show');\n\t}\n\n\tclearErrorTips( clear_all, destroy ) {\n\t\tfor ( var key in this.edit_view_error_ui_dic ) {\n\t\t\tif ( this.edit_view_error_ui_dic[key].val() !== '' || clear_all ) {\n\t\t\t\tthis.edit_view_error_ui_dic[key].removeClass( 'error-tip' );\n\t\t\t\tthis.edit_view_error_ui_dic[key].attr( 'data-original-title', '' );\n\t\t\t}\n\t\t\tif ( destroy ) {\n\t\t\t\tthis.edit_view_error_ui_dic[key].tooltip( 'dispose' );\n\t\t\t}\n\t\t}\n\t\tthis.edit_view_error_ui_dic = {};\n\t}\n\n\tonJobQuickSearch( key, value ) {\n\t\tvar args = {};\n\t\tvar $this = this;\n\t\targs.filter_columns = {\n\t\t\tid: true,\n\t\t\tname: true,\n\t\t\tmanual_id: true\n\t\t};\n\t\tif ( key === 'job_quick_search' ) {\n\t\t\targs.filter_data = { manual_id: value, user_id: this.current_edit_record.user_id, status_id: '10' };\n\t\t\targs.filter_columns.default_item_id = true;\n\t\t\tthis.job_api.getJob( args, {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\tvar result_data = result.getResult();\n\t\t\t\t\tif ( result_data.length > 0 ) {\n\t\t\t\t\t\t$this.$( 'select[name=\"job_id\"]' ).val( result_data[0].id );\n\t\t\t\t\t\t$this.current_edit_record.job_id = result_data[0].id;\n\t\t\t\t\t\t$this.setJobItemValueWhenJobChanged( result_data[0].id );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this.$( 'select[name=\"job_id\"]' ).val( '' );\n\t\t\t\t\t\t$this.current_edit_record.job_id = false;\n\t\t\t\t\t\t$this.setJobItemValueWhenJobChanged( null );\n\t\t\t\t\t}\n\t\t\t\t\t// $this.$( 'select[name=\"job_id\"]' ).selectpicker('refresh');\n\t\t\t\t}\n\t\t\t} );\n\t\t} else if ( key === 'job_item_quick_search' ) {\n\t\t\targs.filter_data = { manual_id: value, job_id: this.current_edit_record.job_id, status_id: '10' };\n\t\t\tthis.job_item_api.getJobItem( args, {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\tvar result_data = result.getResult();\n\t\t\t\t\tif ( result_data.length > 0 ) {\n\t\t\t\t\t\t$this.$( 'select[name=\"job_item_id\"]' ).val( result_data[0].id );\n\t\t\t\t\t\t$this.current_edit_record.job_item_id = result_data[0].id;\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this.$( 'select[name=\"job_item_id\"]' ).val( '' );\n\t\t\t\t\t\t$this.current_edit_record.job_item_id = false;\n\t\t\t\t\t}\n\t\t\t\t\t// $this.$( 'select[name=\"job_item_id\"]' ).selectpicker('refresh');\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\tonTransferChanged( value ) {\n\t\tif ( value ) {\n\n\t\t\tthis.$( 'select[name=\"type_id\"]' ).attr( 'disabled', true );\n\t\t\tthis.$( 'select[name=\"status_id\"]' ).attr( 'disabled', true );\n\n\t\t\tthis.old_type_status.type_id = this.$( 'select[name=\"type_id\"]' ).val();\n\t\t\tthis.old_type_status.status_id = this.$( 'select[name=\"status_id\"]' ).val();\n\n\t\t\tthis.$( 'select[name=\"type_id\"]' ).val( 10 );\n\t\t\tthis.$( 'select[name=\"status_id\"]' ).val( 10 );\n\n\t\t\tthis.current_edit_record.type_id = 10;\n\t\t\tthis.current_edit_record.status_id = 10;\n\n\t\t} else {\n\t\t\tthis.$( 'select[name=\"type_id\"]' ).removeAttr( 'disabled' );\n\t\t\tthis.$( 'select[name=\"status_id\"]' ).removeAttr( 'disabled' );\n\n\t\t\tif ( this.old_type_status.hasOwnProperty( 'type_id' ) ) {\n\t\t\t\tthis.$( 'select[name=\"type_id\"]' ).val( this.old_type_status.type_id );\n\t\t\t\tthis.$( 'select[name=\"status_id\"]' ).val( this.old_type_status.status_id );\n\n\t\t\t\tthis.current_edit_record.type_id = this.old_type_status.type_id;\n\t\t\t\tthis.current_edit_record.status_id = this.old_type_status.status_id;\n\t\t\t}\n\t\t}\n\t}\n\n\tsetJobItemValueWhenJobChanged( job, job_item_id_col_name, filter_data ) {\n\t\tif ( !this.show_job_item_ui ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar $this = this;\n\t\tif ( job_item_id_col_name == undefined ) {\n\t\t\tjob_item_id_col_name = 'job_item_id';\n\t\t}\n\t\tif ( filter_data == undefined ) {\n\t\t\tfilter_data = { status_id: 10, job_id: job };\n\t\t}\n\t\tvar args = {};\n\t\targs.filter_data = filter_data;\n\t\targs.filter_columns = {\n\t\t\tid: true,\n\t\t\tname: true,\n\t\t\tmanual_id: true\n\t\t};\n\t\tvar job_item_widget = $this.$( 'select[name=\"' + job_item_id_col_name + '\"]' );\n\t\tvar current_job_item_id = job_item_widget.val();\n\n\t\tif ( _global_TTUUID__WEBPACK_IMPORTED_MODULE_4__/* .TTUUID.isUUID */ .d.isUUID( current_job_item_id ) && current_job_item_id != _global_TTUUID__WEBPACK_IMPORTED_MODULE_4__/* .TTUUID.zero_id */ .d.zero_id && current_job_item_id != _global_TTUUID__WEBPACK_IMPORTED_MODULE_4__/* .TTUUID.not_exist_id */ .d.not_exist_id ) {\n\t\t\tvar new_arg = _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.clone */ .x.clone( args );\n\t\t\tnew_arg.filter_data.job_id = job;\n\t\t\t$this.job_item_api.getJobItem( new_arg, {\n\t\t\t\tonResult: function( task_result ) {\n\t\t\t\t\tvar data = task_result.getResult();\n\t\t\t\t\tif ( Array.isArray( data ) && data.length > 0 && data.some( ( job_item ) => job_item.id === current_job_item_id ) ) {\n\t\t\t\t\t\t$this.current_edit_record[job_item_id_col_name] = current_job_item_id;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetDefaultData( job_item_id_col_name );\n\t\t\t\t\t}\n\t\t\t\t\t$this.setSourceData( job_item_id_col_name, data, true );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t} else {\n\t\t\tsetDefaultData( job_item_id_col_name );\n\t\t\t$this.job_item_api.getJobItem( args, true, {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t$this.setSourceData( job_item_id_col_name, result.getResult(), true );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tfunction setDefaultData( job_item_id_col_name ) {\n\t\t\tif ( job_item_id_col_name == undefined ) {\n\t\t\t\tjob_item_id_col_name = 'job_item_id';\n\t\t\t}\n\t\t\tif ( $this.current_edit_record.job_id ) {\n\t\t\t\t// job_item_widget.val( $this.$('select[name=\"job_id\"] option[value=\"'+ job +'\"]').attr('default_item_id') );\n\t\t\t\tvar default_item_id = $this.$( 'select[name=\"job_id\"] option[value=\"' + job + '\"]' ).attr( 'default_item_id' );\n\t\t\t\t$this.current_edit_record[job_item_id_col_name] = default_item_id;\n\t\t\t\tif ( default_item_id === false || default_item_id === 0 || default_item_id === _global_TTUUID__WEBPACK_IMPORTED_MODULE_4__/* .TTUUID.zero_id */ .d.zero_id ) {\n\t\t\t\t\t$this.$( 'input[name=\"job_item_quick_search\"]' ).val( '' );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tjob_item_widget.val( '' );\n\t\t\t\t$this.current_edit_record[job_item_id_col_name] = false;\n\t\t\t\t$this.$( 'input[name=\"job_item_quick_search\"]' ).val( '' );\n\t\t\t}\n\t\t}\n\t}\n\n\tsetJobValueWhenCriteriaChanged() {\n\t\tif ( !this.show_job_ui ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar $this = this;\n\t\tvar job_id_col_name = 'job_id';\n\t\tvar user = LocalCacheData.getPunchLoginUser();\n\t\tvar filter_data = {\n\t\t\tstatus_id: 10,\n\t\t\tuser_id: user.id,\n\t\t\tpunch_branch_id: this.current_edit_record.branch_id,\n\t\t\tpunch_department_id: this.current_edit_record.department_id\n\t\t};\n\t\tvar args = {};\n\t\targs.filter_data = filter_data;\n\t\targs.filter_columns = {\n\t\t\tid: true,\n\t\t\tname: true,\n\t\t\tmanual_id: true,\n\t\t};\n\t\tvar job_widget = $this.$( 'select[name=\"' + job_id_col_name + '\"]' );\n\t\tvar current_job_id = job_widget.val();\n\n\t\tif ( _global_TTUUID__WEBPACK_IMPORTED_MODULE_4__/* .TTUUID.isUUID */ .d.isUUID( current_job_id ) && current_job_id != _global_TTUUID__WEBPACK_IMPORTED_MODULE_4__/* .TTUUID.zero_id */ .d.zero_id && current_job_id != _global_TTUUID__WEBPACK_IMPORTED_MODULE_4__/* .TTUUID.not_exist_id */ .d.not_exist_id ) {\n\t\t\tvar new_arg = _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.clone */ .x.clone( args );\n\t\t\t$this.job_api.getJob( new_arg, {\n\t\t\t\tonResult: function( task_result ) {\n\t\t\t\t\tvar data = task_result.getResult();\n\t\t\t\t\tif ( Array.isArray( data ) && data.length > 0 && data.some( ( job ) => job.id === current_job_id ) ) {\n\t\t\t\t\t\t$this.current_edit_record[job_id_col_name] = current_job_id;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetDefaultData( job_id_col_name );\n\t\t\t\t\t}\n\t\t\t\t\t$this.setSourceData( job_id_col_name, data, true );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t} else {\n\t\t\tsetDefaultData( job_id_col_name );\n\t\t\t$this.job_api.getJob( args, true, {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t$this.setSourceData( job_id_col_name, result.getResult(), true );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tfunction setDefaultData( job_id_col_name ) {\n\t\t\t$this.current_edit_record[job_id_col_name] = false;\n\t\t\t$this.$( 'input[name=\"job_quick_search\"]' ).val( '' );\n\t\t}\n\t}\n\n\tsetDepartmentValueWhenBranchChanged( branch ) {\n\t\tif ( !this.show_department_ui ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar $this = this;\n\t\tvar department_id_col_name = 'department_id';\n\t\tvar user = LocalCacheData.getPunchLoginUser();\n\t\tvar filter_data = { status_id: 10, user_id: user.id, branch_id: branch };\n\t\tvar args = {};\n\t\targs.filter_data = filter_data;\n\t\targs.filter_columns = {\n\t\t\tid: true,\n\t\t\tname: true\n\t\t};\n\t\tvar department_widget = $this.$( 'select[name=\"' + department_id_col_name + '\"]' );\n\t\tvar current_department_id = department_widget.val();\n\n\t\tif ( _global_TTUUID__WEBPACK_IMPORTED_MODULE_4__/* .TTUUID.isUUID */ .d.isUUID( current_department_id ) && current_department_id != _global_TTUUID__WEBPACK_IMPORTED_MODULE_4__/* .TTUUID.zero_id */ .d.zero_id && current_department_id != _global_TTUUID__WEBPACK_IMPORTED_MODULE_4__/* .TTUUID.not_exist_id */ .d.not_exist_id ) {\n\t\t\tvar new_arg = _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.clone */ .x.clone( args );\n\t\t\tnew_arg.filter_data.branch_id = branch;\n\t\t\t$this.department_api.getDepartment( new_arg, {\n\t\t\t\tonResult: function( task_result ) {\n\t\t\t\t\tvar data = task_result.getResult();\n\t\t\t\t\tif ( Array.isArray( data ) && data.length > 0 && data.some( ( department ) => department.id === current_department_id ) ) {\n\t\t\t\t\t\t$this.current_edit_record[department_id_col_name] = current_department_id;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetDefaultData( department_id_col_name );\n\t\t\t\t\t}\n\t\t\t\t\t$this.setSourceData( department_id_col_name, data, true );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t} else {\n\t\t\tsetDefaultData( department_id_col_name );\n\t\t\t$this.department_api.getDepartment( args, true, {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t$this.setSourceData( department_id_col_name, result.getResult(), true );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tfunction setDefaultData( department_id_col_name ) {\n\t\t\t$this.current_edit_record[department_id_col_name] = false;\n\t\t}\n\t}\n\n\tsetPunchTagValuesWhenCriteriaChanged( filter_data, punch_tag_id_col_name ) {\n\t\tif ( !this.show_punch_tag_ui ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar $this = this;\n\n\t\tif ( !$this.current_edit_record ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar punch_tag_widget = $this.$( 'select[name=\"' + punch_tag_id_col_name + '\"]' );\n\t\tvar current_punch_tag_ids = punch_tag_widget.val();\n\n\t\tvar args = {};\n\t\targs.filter_data = filter_data;\n\n\t\tvar new_arg = _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.clone */ .x.clone( args );\n\n\t\tnew_arg.manual_id = current_punch_tag_ids;\n\t\t$this.punch_tag_api.getPunchTag( new_arg, {\n\t\t\tonResult: function( punch_tag_result ) {\n\t\t\t\tif ( !$this.current_edit_record ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar data = punch_tag_result.getResult();\n\n\t\t\t\t$this.setSourceData( 'punch_tag_id', data, true );\n\n\t\t\t\tif ( data.length > 0 ) {\n\t\t\t\t\tif ( current_punch_tag_ids !== _global_TTUUID__WEBPACK_IMPORTED_MODULE_4__/* .TTUUID.zero_id */ .d.zero_id && current_punch_tag_ids.length > 0 && $this.shouldUpdatePunchTags( current_punch_tag_ids, data ) ) {\n\t\t\t\t\t\t//Merge in users last selected punch tags in case they switched back to that selection.\n\t\t\t\t\t\t//Example: They have selected a New York branch punch tag but switch their selection to a different branch\n\t\t\t\t\t\t//and then back to New York. In that case we should reselect the New York punch tag.\n\t\t\t\t\t\tcurrent_punch_tag_ids = _.union( current_punch_tag_ids, $this.previous_punch_tag_selection );\n\t\t\t\t\t\t//Compare current selected punch tags and the list of punch tags from the API and remove invalid punch tags.\n\t\t\t\t\t\tvar intersected_values = current_punch_tag_ids.filter( punch_tag_id => data.some( punch_tag => punch_tag_id === punch_tag.id ) );\n\n\t\t\t\t\t\t$this.$( 'select[name=\"punch_tag_id\"]' ).val( intersected_values );\n\t\t\t\t\t\t$this.current_edit_record[punch_tag_id_col_name] = intersected_values;\n\n\t\t\t\t\t\t//Update manual IDs in punch_tag_quick_search.\n\t\t\t\t\t\tvar punch_tag_manual_ids = data.filter( punch_tag => intersected_values.includes( punch_tag.id ) ).map( ( { manual_id } ) => manual_id );\n\t\t\t\t\t\t$this.$( 'input[name=\"punch_tag_quick_search\"]' ).val( punch_tag_manual_ids.join() );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tsetDefaultData( punch_tag_id_col_name );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\tfunction setDefaultData( punch_tag_id_col_name ) {\n\t\t\tif ( $this.current_edit_record.hasOwnProperty( punch_tag_id_col_name ) ) {\n\t\t\t\t$this.$( 'select[name=\"punch_tag_id\"]' ).val( $this.default_punch_tag );\n\t\t\t\t$this.current_edit_record[punch_tag_id_col_name] = $this.default_punch_tag;\n\n\t\t\t\tif ( $this.default_punch_tag.length === 0 ) {\n\t\t\t\t\t$this.$( 'input[name=\"punch_tag_quick_search\"]' ).val( '' );\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t$this.current_edit_record[punch_tag_id_col_name] = false;\n\t\t\t\t$this.$( 'input[name=\"punch_tag_quick_search\"]' ).val( '' );\n\t\t\t}\n\t\t}\n\t}\n\n\tshouldUpdatePunchTags( current_punch_tag_ids, data ) {\n\t\t//If the current selected punch tags and previously user selected punch tags do not match we should check and update.\n\t\tif ( this.previous_punch_tag_selection.every( punch_tag => current_punch_tag_ids.includes( punch_tag ) ) === false ) {\n\t\t\treturn true;\n\t\t}\n\t\t//If the data returned from the API does not contain every currently selected punch tag then we need to remove invalid tags.\n\t\tif ( current_punch_tag_ids.every( punch_tag_id => data.some( punch_tag => punch_tag.id === punch_tag_id ) ) === false ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tsetPunchTagQuickSearchManualIds( punch_tag_ids ) {\n\t\tif ( !punch_tag_ids || !this.show_punch_tag_ui || ( Array.isArray( punch_tag_ids ) === true && punch_tag_ids.length === 0 ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar $this = this;\n\t\tvar args = {};\n\t\targs.filter_data = { id: punch_tag_ids };\n\t\tthis.punch_tag_api.getPunchTag( args, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tvar data = result.getResult();\n\t\t\t\tvar manual_ids = [];\n\n\t\t\t\tfor ( var i = 0; i < data.length; i++ ) {\n\t\t\t\t\tmanual_ids.push( data[i].manual_id );\n\t\t\t\t}\n\n\t\t\t\t$this.$( 'input[name=\"punch_tag_quick_search\"]' ).val( manual_ids.join() );\n\t\t\t}\n\t\t} );\n\t}\n\n\tonPunchTagQuickSearch( key, value ) {\n\t\tvar args = {};\n\t\tvar $this = this;\n\t\targs.filter_columns = {\n\t\t\tid: true,\n\t\t\tname: true,\n\t\t\tmanual_id: true\n\t\t};\n\n\t\targs.filter_data = this.getPunchTagFilterData();\n\t\targs.filter_data.manual_id = value.split( ',' );\n\t\tthis.punch_tag_api.getPunchTag( args, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tvar result_data = result.getResult();\n\t\t\t\tif ( result_data.length > 0 ) {\n\t\t\t\t\t$this.$( 'select[name=\"punch_tag_id\"]' ).val( result_data.map( punch_tag => punch_tag.id ) );\n\t\t\t\t\t$this.current_edit_record.punch_tag_id = result_data.map( punch_tag => punch_tag.id );\n\t\t\t\t} else {\n\t\t\t\t\t$this.$( 'select[name=\"punch_tag_id\"]' ).val( '' );\n\t\t\t\t\t$this.current_edit_record.punch_tag_id = false;\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\tsetSourceData( field, source_data, set_empty ) {\n\t\tvar $this = this;\n\t\tvar field_selector = 'select[name=\"' + field + '\"]';\n\t\tif ( $( this.$el ).find( field_selector ) && $( this.$el ).find( field_selector )[0] ) {\n\t\t\t$( this.$el ).find( field_selector ).empty();\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t\tif ( _.size( source_data ) == 0 ) {\n\t\t\tset_empty = true;\n\t\t}\n\t\tif ( set_empty === true ) {\n\t\t\tvar $field = $( $this.$el ).find( field_selector );\n\t\t\tswitch ( field ) {\n\t\t\t\tcase 'status_id':\n\t\t\t\tcase 'type_id':\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$field.append( $( '' ).prop( 'value', '0' ).text( '-- ' + $.i18n._( 'None' ) + ' --' ) ).attr( 'selected', 'selected' );\n\t\t\t\t// $($this.$el).find(field_selector).selectpicker();\n\t\t\t}\n\t\t}\n\t\tif ( _.size( source_data ) > 0 ) {\n\t\t\tif ( _.isArray( source_data ) ) {\n\t\t\t\t_.each( source_data, function( option ) {\n\t\t\t\t\tlet label = '';\n\t\t\t\t\tif ( option.hasOwnProperty( 'name' ) ) {\n\t\t\t\t\t\tlabel = option.name;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlabel = option.label;\n\t\t\t\t\t}\n\t\t\t\t\tvar optionEl = $( '' ).prop( 'value', option.id ).text( label );\n\t\t\t\t\tif ( field == 'job_id' || field == 'job_item_id' || field == 'punch_tag_id' ) {\n\t\t\t\t\t\toptionEl.attr( 'manual_id', option.manual_id );\n\t\t\t\t\t}\n\t\t\t\t\tif ( field == 'job_id' ) {\n\t\t\t\t\t\toptionEl.attr( 'default_item_id', option.default_item_id );\n\t\t\t\t\t}\n\t\t\t\t\t$( $this.$el ).find( field_selector ).append( optionEl );\n\t\t\t\t\tif ( $this.current_edit_record[field] == option.id ) {\n\t\t\t\t\t\t$( $this.$el ).find( field_selector ).val( option.id );\n\t\t\t\t\t\tif ( field == 'job_id' ) {\n\t\t\t\t\t\t\t$this.$( 'input[name=\"job_quick_search\"]' ).val( option.manual_id );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( field == 'job_item_id' ) {\n\t\t\t\t\t\t\t$this.$( 'input[name=\"job_item_quick_search\"]' ).val( option.manual_id );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\t$.each( source_data, function( value, label ) {\n\t\t\t\t\t$( $this.$el ).find( field_selector ).append( $( '' ).prop( 'value', value ).text( label ) );\n\t\t\t\t\tif ( field == 'status_id' || field == 'type_id' ) {\n\t\t\t\t\t\tif ( $this.current_edit_record.transfer == true ) {\n\t\t\t\t\t\t\t$this.current_edit_record[field] = 10;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( $this.current_edit_record[field] == value ) {\n\t\t\t\t\t\t$( $this.$el ).find( field_selector ).val( value );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t\t// $this.$($this.el).find(field_selector).selectpicker('refresh');\n\t\t} else {\n\t\t\tswitch ( field ) {\n\t\t\t\tcase 'branch_id':\n\t\t\t\tcase 'department_id':\n\t\t\t\t\t$( $this.$el ).find( 'div.' + field ).hide();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'job_id':\n\t\t\t\t\t$( $this.$el ).find( 'div.' + field ).hide();\n\t\t\t\t\t$( $this.$el ).find( 'div.job_item_id' ).hide();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'punch_tag_id':\n\t\t\t\t\t$( $this.$el ).find( 'div.' + field ).hide();\n\t\t\t\t\t$( $this.$el ).find( 'div.punch_tag_id' ).hide();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tonCancelClick() {\n\t\twindow.history.back();\n\t}\n\n\tonSaveClick() {\n\t\tvar $this = this;\n\t\tvar record = this.current_edit_record;\n\t\tthis.save_btn.attr( 'disabled', 'disabled' );\n\t\tthis.clearErrorTips( true, true );\n\n\t\tthis.api.setIsIdempotent( true ); //Force to idempotent API call to avoid duplicate network requests from causing errors displayed to the user.\n\t\tthis.api.setUserPunch( record, false, false, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tif ( result.isValid() ) {\n\t\t\t\t\tvar result_data = result.getResult();\n\t\t\t\t\tvar quick_punch_success_controller = new QuickPunchModalController( {\n\t\t\t\t\t\tel: _.template( _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.loadWidget */ .x.loadWidget( 'views/quick_punch/punch/QuickPunchSuccessView.html' ) )( {\n\t\t\t\t\t\t\tuser_full_name: $this.current_edit_record['first_name'] + ' ' + $this.current_edit_record['last_name'],\n\t\t\t\t\t\t\tlabel: $this.current_edit_record['status_id'] == 10 ? $.i18n._( 'In' ) : $.i18n._( 'Out' ),\n\t\t\t\t\t\t\treturn_date: $this.current_edit_record['time_stamp'],\n\t\t\t\t\t\t\tis_mobile: ( _.isUndefined( window.is_mobile ) == false )\n\t\t\t\t\t\t} ),\n\t\t\t\t\t\t_timedRedirect: 5,\n\t\t\t\t\t\tis_modal: true,\n\t\t\t\t\t\t_delegateCallback: function() {\n\t\t\t\t\t\t\t$this.doLogout();\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\t$this.setErrorTips( result );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\tdoLogout() {\n\t\t//Don't wait for result of logout in case of slow or disconnected internet. Just clear local cookies and move on.\n\t\tthis.current_user_api.Logout( {\n\t\t\tonResult: function() {\n\t\t\t}\n\t\t} );\n\n\t\t_global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.setAnalyticDimensions */ .x.setAnalyticDimensions();\n\n\t\t//A bare \"if\" wrapped around lh_inst doesn't work here for some reason.\n\t\tif ( typeof ( lh_inst ) != 'undefined' ) {\n\t\t\t//stop the update loop for live chat with support\n\t\t\tclearTimeout( lh_inst.timeoutStatuscheck );\n\t\t}\n\t\tdeleteCookie( 'SessionID-QP' );\n\t\tLocalCacheData.setPunchLoginUser( null );\n\t\tLocalCacheData.setCurrentCompany( null );\n\t\tsessionStorage.clear();\n\t\tif ( window.location.href === _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.getBaseURL */ .x.getBaseURL() + '#!m=QuickPunchLogin' ) {\n\t\t\t_quick_punch_IndexController__WEBPACK_IMPORTED_MODULE_1__/* .IndexViewController.instance.router.reloadView */ .g.instance.router.reloadView( 'QuickPunchLogin' );\n\t\t} else {\n\t\t\t_global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.setURLToBrowser */ .x.setURLToBrowser( _global_Global__WEBPACK_IMPORTED_MODULE_5__/* .Global.getBaseURL */ .x.getBaseURL() + '#!m=QuickPunchLogin' );\n\t\t}\n\t}\n\n\tgetPunchTagFilterData() {\n\t\tvar filter_data = {\n\t\t\tstatus_id: 10,\n\t\t\tuser_id: this.current_edit_record.user_id,\n\t\t\tbranch_id: this.current_edit_record.branch_id,\n\t\t\tdepartment_id: this.current_edit_record.department_id,\n\t\t\tjob_id: this.current_edit_record.job_id,\n\t\t\tjob_item_id: this.current_edit_record.job_item_id,\n\t\t};\n\n\t\treturn filter_data;\n\t}\n\n}\n\nclass QuickPunchModalController extends Backbone.View { //Must extend Backbone.View rather than TTBackbone otherwise Quick Punch success modal fails.\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\ttimed_redirect_time: 0\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinitialize( options ) {\n\t\t//super.initialize( options );\n\t\tvar $this = this;\n\t\tthis._delegateCallback = options._delegateCallback || null;\n\t\tthis._timedRedirect = options._timedRedirect;\n\t\tthis.is_modal = options.is_modal;\n\t\tthis.render();\n\n\t\t//Back button or Forward button\n\t\twindow.onpopstate = function() {\n\t\t\tclearTimeout( $this.timer );\n\t\t};\n\t}\n\n\trender() {\n\t\tvar $this = this;\n\t\t$( document ).off( 'keyup' ).on( 'keyup', function() {\n\t\t\t$this.stopTimedRedirect();\n\t\t} );\n\n\t\t//must use core Javascript as the jquery function did not catch the event properly and did not stop the timer when opening selects.\n\t\t// $(document).on('mouseup', function () {\n\t\t// \t$this.stopTimedRedirect();\n\t\t// });\n\t\t$( document ).off( 'mousedown' ).on( 'mousedown', function() {\n\t\t\t$this.stopTimedRedirect();\n\t\t} );\n\t\tif ( this.is_modal ) {\n\t\t\t$( this.el ).on( 'hidden.bs.modal', function() {\n\t\t\t\t$this.remove();\n\t\t\t\t$this.delegateCallback();\n\t\t\t} );\n\t\t\t$( this.el ).on( 'shown.bs.modal', function() {\n\t\t\t\t$this.timedRedirect( $this._timedRedirect );\n\t\t\t} );\n\t\t\t$( 'body' ).append( $( this.el ).modal( {\n\t\t\t\tbackdrop: 'static',\n\t\t\t\tshow: true\n\t\t\t} ) );\n\t\t} else {\n\t\t\t$this.timedRedirect( $this._timedRedirect );\n\t\t}\n\t\treturn this;\n\t}\n\n\tdelegateCallback() {\n\t\tif ( this._delegateCallback ) {\n\t\t\tthis._delegateCallback();\n\t\t}\n\t}\n\n\tstopTimedRedirect() {\n\t\tif ( this.is_modal === false ) {\n\t\t\tthis._delegateCallback = null;\n\t\t}\n\t\tthis.removeTimedRedirect();\n\t}\n\n\tupdateTimedRedirect( time ) {\n\t\tif ( time != 'undefined' && time > 0 ) {\n\t\t\tthis.timed_redirect_time = time;\n\t\t}\n\t}\n\n\tremoveTimedRedirect() {\n\t\tclearTimeout( this.timer );\n\t\tif ( this.is_modal ) {\n\t\t\tthis.$el.modal( 'hide' );\n\t\t} else {\n\t\t\tthis.$( '#timedRedirect' ).remove();\n\t\t\tthis.delegateCallback();\n\t\t}\n\t}\n\n\ttimedRedirect( time ) {\n\t\tvar $this = this;\n\t\tthis.updateTimedRedirect( time );\n\t\tif ( this.timed_redirect_time > 0 ) {\n\t\t\tthis.$( '#timedRedirect' ).html( '( ' + this.timed_redirect_time + ' )' );\n\t\t\tthis.timed_redirect_time--;\n\t\t\tthis.timer = setTimeout( function() {\n\t\t\t\t$this.timedRedirect( null );\n\t\t\t}, 1000 );\n\t\t} else if ( this.timed_redirect_time == 0 ) {\n\t\t\tthis.removeTimedRedirect();\n\t\t}\n\t}\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzAwMC5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7O0FBQWdHO0FBQzVCO0FBQ2Y7QUFDRTtBQUNkO0FBQ0E7O0FBRWxDLHVDQUF1Qyx5R0FBNEI7QUFDMUUsMkJBQTJCO0FBQzNCLEVBQUUsQ0FBQztBQUNIO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBLHNCQUFzQjs7QUFFdEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLElBQUk7O0FBRUo7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0EsR0FBRyx3SUFBNEM7QUFDL0M7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBLGFBQWEseUZBQWM7QUF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