diff --git a/assets/claim/js/claim.js b/assets/claim/js/claim.js index cb6723b8..100250b8 100644 --- a/assets/claim/js/claim.js +++ b/assets/claim/js/claim.js @@ -1,6 +1,6 @@ (function () { const src = - 'https://cdn.jsdelivr.net/gh/bcgov/nr-af-pods@dev/powerpod/releases/powerpod-1.2.2.min.js'; + 'https://cdn.jsdelivr.net/gh/bcgov/nr-af-pods@dev/powerpod/releases/powerpod-1.2.3.min.js'; const script = document.createElement('script'); script.setAttribute('async', ''); script.src = src; diff --git a/powerpod/package.json b/powerpod/package.json index d928836e..47489d9a 100644 --- a/powerpod/package.json +++ b/powerpod/package.json @@ -1,7 +1,7 @@ { "name": "powerpod", "type": "module", - "version": "1.2.2", + "version": "1.2.3", "description": "Powerpod is a jQuery plugin that enhances functionality of Power Pages components.", "main": "dist/powerpod", "scripts": { diff --git a/powerpod/releases/powerpod-1.2.3.min.js b/powerpod/releases/powerpod-1.2.3.min.js new file mode 100644 index 00000000..e5e589e7 --- /dev/null +++ b/powerpod/releases/powerpod-1.2.3.min.js @@ -0,0 +1,479 @@ +/*! +* powerpod 1.2.2 +* https://github.com/bcgov/nr-af-pods/powerpod +* +* @license GPLv3 for open source use only +* +* Copyright (C) 2024 https://github.com/bcgov/nr-af-pods/powerpod - A project by Mihai Listov +*/ +!function(a,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(a="undefined"!=typeof globalThis?globalThis:a||self).powerpod=i()}(this,(function(){"use strict";function ownKeys(a,i){var d=Object.keys(a);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(a);i&&(p=p.filter((function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable}))),d.push.apply(d,p)}return d}function _objectSpread2(a){for(var i=1;i=0;--u){var g=this.tryEntries[u],h=g.completion;if("root"===g.tryLoc)return handle("end");if(g.tryLoc<=this.prev){var f=p.call(g,"catchLoc"),m=p.call(g,"finallyLoc");if(f&&m){if(this.prev=0;--d){var u=this.tryEntries[d];if(u.tryLoc<=this.prev&&p.call(u,"finallyLoc")&&this.prev=0;--i){var d=this.tryEntries[i];if(d.finallyLoc===a)return this.complete(d.completion,d.afterLoc),resetTryEntry(d),q}},catch:function(a){for(var i=this.tryEntries.length-1;i>=0;--i){var d=this.tryEntries[i];if(d.tryLoc===a){var p=d.completion;if("throw"===p.type){var u=p.arg;resetTryEntry(d)}return u}}throw new Error("illegal catch attempt")},delegateYield:function(i,d,p){return this.delegate={iterator:values(i),resultName:d,nextLoc:p},"next"===this.method&&(this.arg=a),q}},i}function _typeof(a){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function asyncGeneratorStep(a,i,d,p,u,g,h){try{var f=a[g](h),m=f.value}catch(a){return void d(a)}f.done?i(m):Promise.resolve(m).then(p,u)}function _asyncToGenerator(a){return function(){var i=this,d=arguments;return new Promise((function(p,u){var g=a.apply(i,d);function _next(a){asyncGeneratorStep(g,p,u,_next,_throw,"next",a)}function _throw(a){asyncGeneratorStep(g,p,u,_next,_throw,"throw",a)}_next(void 0)}))}}function _defineProperty(a,i,d){return(i=function _toPropertyKey(a){var i=function _toPrimitive(a,i){if("object"!=typeof a||!a)return a;var d=a[Symbol.toPrimitive];if(void 0!==d){var p=d.call(a,i||"default");if("object"!=typeof p)return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===i?String:Number)(a)}(a,"string");return"symbol"==typeof i?i:String(i)}(i))in a?Object.defineProperty(a,i,{value:d,enumerable:!0,configurable:!0,writable:!0}):a[i]=d,a}function _extends(){return _extends=Object.assign?Object.assign.bind():function(a){for(var i=1;i=0||(u[d]=a[d]);return u}(a,i);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(a);for(p=0;p=0||Object.prototype.propertyIsEnumerable.call(a,d)&&(u[d]=a[d])}return u}function _slicedToArray(a,i){return function _arrayWithHoles(a){if(Array.isArray(a))return a}(a)||function _iterableToArrayLimit(a,i){var d=null==a?null:"undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(null!=d){var p,u,g,h,f=[],m=!0,v=!1;try{if(g=(d=d.call(a)).next,0===i){if(Object(d)!==d)return;m=!1}else for(;!(m=(p=g.call(d)).done)&&(f.push(p.value),f.length!==i);m=!0);}catch(a){v=!0,u=a}finally{try{if(!m&&null!=d.return&&(h=d.return(),Object(h)!==h))return}finally{if(v)throw u}}return f}}(a,i)||_unsupportedIterableToArray(a,i)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _toConsumableArray(a){return function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}(a)||function _iterableToArray(a){if("undefined"!=typeof Symbol&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}(a)||_unsupportedIterableToArray(a)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(a,i){if(a){if("string"==typeof a)return _arrayLikeToArray(a,i);var d=Object.prototype.toString.call(a).slice(8,-1);return"Object"===d&&a.constructor&&(d=a.constructor.name),"Map"===d||"Set"===d?Array.from(a):"Arguments"===d||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?_arrayLikeToArray(a,i):void 0}}function _arrayLikeToArray(a,i){(null==i||i>a.length)&&(i=a.length);for(var d=0,p=new Array(i);d0&&void 0!==arguments[0]?arguments[0]:null;return{info:function info(i){var d=i.fn,p=void 0===d?null:d,u=i.message,g=i.data;return log({namespace:a,fn:p,level:E,message:u,data:void 0===g?null:g})},error:function error(i){var d=i.fn,p=void 0===d?null:d,u=i.message,g=i.data;return log({namespace:a,fn:p,level:j,message:u,data:void 0===g?null:g})},warn:function warn(i){var d=i.fn,p=void 0===d?null:d,u=i.message,g=i.data;return log({namespace:a,fn:p,level:D,message:u,data:void 0===g?null:g})}}}function validateDemographicInfoRequiredFields(){var a=validateStepFields("DemographicInfoStep",!0),i=function validateDemographicPercentages(){var a=0,i=0,d=0,p=document.querySelector("#quartech_firstnationssharepercentage"),u=$(p).val(),g=parseFloat(u);a+=!!g&&g;var h=document.querySelector("#quartech_inukinuitsharepercentage"),f=$(h).val(),m=parseFloat(f);a+=!!m&&m;var v=document.querySelector("#quartech_mtissharepercentage"),y=$(v).val(),w=parseFloat(y);a+=!!w&&w;var _=document.querySelector("#quartech_indigenoussharepercentage"),q=$(_).val(),T=parseFloat(q);a+=!!T&&T;var A=document.querySelector("#quartech_womensharepercentage"),O=$(A).val(),E=parseFloat(O);i+=!!E&&E;var D=document.querySelector("#quartech_youth40orundersharepercentage"),j=$(D).val(),z=parseFloat(j);d+=!!z&&z;var U=document.querySelector("#quartech_nonindiginousnonwomennonyouthshare"),B=$(U).val(),G=parseFloat(B);a+=!!G&&G,i+=!!G&&G,d+=!!G&&G;var Q=document.querySelector("#quartech_unabletoansweridentifysharepercentage"),W=$(Q).val(),J=parseFloat(W);i+=!!J&&J,d+=!!J&&J;var K="",Y="Please check your answers. The total of shares held by",Z="should NOT add up to more than 100%";return(a+=!!J&&J)>100&&(K+="
".concat(Y,' Indigenous owners + Not-Indigenous/Not-Women/Not-Youth + Unable to answer ').concat(Z,"
")),i>100&&(K+="
".concat(Y,' Women owners + Not-Indigenous/Not-Women/Not-Youth + Unable to answer ').concat(Z,"
")),d>100&&(K+="
".concat(Y,' Youth owners + Not-Indigenous/Not-Women/Not-Youth owners + Unable to answer ').concat(Z,"
")),K}();displayValidationErrors(a=a.concat(i))}_defineProperty(_defineProperty(_defineProperty({},E,10),D,20),j,90);var z=["programId","beforeSend","onSuccess"],U=["programId","beforeSend","onSuccess"],B=["onSuccess"],G=["searchStr","onSuccess"],Q=["topicSourceId"],W=["topicId"],J=["id"],K=Logger("common/fetch");O.fetch={getEnvVarsData:getEnvVarsData,getApplicationFormData:getApplicationFormData,getClaimFormData:getClaimFormData,getMunicipalData:getMunicipalData,getExpenseTypeData:getExpenseTypeData,getOrgbookAutocompleteData:getOrgbookAutocompleteData,getOrgbookTopicData:function getOrgbookTopicData(a){return _getOrgbookTopicData.apply(this,arguments)},getOrgbookCredentialsData:function getOrgbookCredentialsData(a){return _getOrgbookCredentialsData.apply(this,arguments)},getDocuments:getDocuments};var Y={get_env_vars_data:"/_api/environmentvariabledefinitions?$filter=contains(schemaname,'quartech_')&$select=schemaname,environmentvariabledefinitionid&$expand=environmentvariabledefinition_environmentvariablevalue($select=value)",get_application_form_data:function get_application_form_data(a){return"/_api/msgov_programs(".concat(a,")?$select=msgov_programid, quartech_disabledchefsdemographicinfo, msgov_programname, quartech_applicantportalprogramname, quartech_applicantportalprogramstreamjsonconfig, quartech_portalapplicationpagetitle, quartech_portalapplicationpagesubtitle, quartech_portalapplicationpagedescription, quartech_programabbreviation, quartech_programemailaddress, quartech_portalappactivityinfohiddenfields, quartech_portalappprojectdeschiddenfields, quartech_portalappfieldsdisplaynamesmapping, quartech_typesofbusinesstodisplay, quartech_applicantportalapplicationformconfigjson, quartech_activitiestypestodisplay&$expand=quartech_ApplicantPortalConfig($select=quartech_name,quartech_configdata)")},get_claim_form_data:function get_claim_form_data(a){return"/_api/msgov_programs(".concat(a,")?$select=msgov_programid, msgov_programname, quartech_applicantportalprogramname, quartech_claimformheaderhtmlcontent, quartech_applicantportalclaimformjson, quartech_applicantportalprogramstreamjsonconfig, quartech_portalapplicationpagetitle, quartech_portalapplicationpagesubtitle, quartech_portalapplicationpagedescription, quartech_programabbreviation, quartech_programemailaddress, quartech_portalappactivityinfohiddenfields, quartech_portalappprojectdeschiddenfields, quartech_portalappfieldsdisplaynamesmapping, quartech_typesofbusinesstodisplay, quartech_applicantportalapplicationformconfigjson, quartech_activitiestypestodisplay&$expand=quartech_ApplicantPortalConfig($select=quartech_name,quartech_configdata)")},get_municipal_data:"/_api/quartech_municipals?$select=quartech_name,quartech_municipalid&$expand=quartech_RegionalDistrict($select=quartech_name,quartech_regionaldistrictid,_quartech_censusofagricultureregion_value)",get_expense_type_data:"/_api/quartech_expensetypes?$select=quartech_expensetypeid,quartech_expensetype",get_documents:function get_documents(a){return"/_api/annotations?$filter=_objectid_value%20eq%20".concat(a,"&$select=filename,filesize,modifiedon,subject,isdocument,objecttypecode")},get_orgbook_autocomplete_data:"https://orgbook.gov.bc.ca/api/v3/search/autocomplete",get_orgbook_topic_data:"https://orgbook.gov.bc.ca/api/v4/search/topic",get_orgbook_credentials_data:function get_orgbook_credentials_data(a){return"https://orgbook.gov.bc.ca/api/v4/topic/".concat(a,"/credential-set")}},Z={json:"application/json; charset=utf-8"},X={json:"json"},ee=function setODataHeaders(a){a.setRequestHeader("Accept","application/json"),a.setRequestHeader("OData-MaxVersion","4.0"),a.setRequestHeader("OData-Version","4.0"),a.setRequestHeader("Prefer",'odata.include-annotations="*"')},ne={};function fetch(a){return _fetch.apply(this,arguments)}function _fetch(){return(_fetch=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(a){var i,d,p,u,g,h,f,m,v,y,w,_,q,T,A,O,E,D,j,z,U,B,G;return _regeneratorRuntime().wrap((function _callee$(Q){for(;;)switch(Q.prev=Q.next){case 0:if(i=a.method,d=void 0===i?"GET":i,p=a.url,u=a.beforeSend,g=a.onSuccess,h=a.onError,f=a.async,m=void 0===f||f,v=a.data,y=void 0===v?{}:v,w=a.datatype,_=a.contentType,q=a.includeODataHeaders,T=void 0!==q&&q,A=a.skipCache,O=void 0!==A&&A,E=a.returnData,D=void 0!==E&&E,j=JSON.stringify(a),O||!ne[j]){Q.next=8;break}if(z=ne[j],U=z.data,B=z.textStatus,G=z.xhr,K.info({fn:fetch,message:"returning cached data for url: ".concat(p),data:{data:U,params:a}}),!D){Q.next=7;break}return Q.abrupt("return",Promise.resolve(U));case 7:return Q.abrupt("return",Promise.resolve(g(U,B,G)));case 8:return Q.abrupt("return",$.ajax({method:d,url:p,contentType:_,datatype:w,data:y,async:m,beforeSend:function beforeSend(a){T&&ee(a),u&&"function"==typeof u&&u()},success:function success(i,d,u){O||(ne[j]={data:i,textStatus:d,xhr:u}),D?K.info({fn:fetch,message:"skipping onSuccess handler call: ".concat(p),data:{data:i,params:a}}):g&&"function"==typeof g&&g(i,d,u)},error:function error(a,i,d){K.error({fn:fetch,message:null==a?void 0:a.responseText,data:{xhr:a,textStatus:i,errorThrown:d}}),h&&"function"==typeof h&&h(a,i,d)}}).then((function(i){if(D&&i)return K.info({fn:fetch,message:"returning data for url: ".concat(p),data:{data:i,params:a}}),Promise.resolve(i)})));case 9:case"end":return Q.stop()}}),_callee)})))).apply(this,arguments)}function getEnvVarsData(){return _getEnvVarsData.apply(this,arguments)}function _getEnvVarsData(){return _getEnvVarsData=_asyncToGenerator(_regeneratorRuntime().mark((function _callee2(){var a,i,d=arguments;return _regeneratorRuntime().wrap((function _callee2$(p){for(;;)switch(p.prev=p.next){case 0:return i=_extends({},(_objectDestructuringEmpty(a=d.length>0&&void 0!==d[0]?d[0]:{}),a)),p.abrupt("return",fetch(_objectSpread2({url:Y.get_env_vars_data,contentType:Z.json,datatype:X.json,includeODataHeaders:!0,async:!1,returnData:!0},i)));case 2:case"end":return p.stop()}}),_callee2)}))),_getEnvVarsData.apply(this,arguments)}function getApplicationFormData(a){return _getApplicationFormData.apply(this,arguments)}function _getApplicationFormData(){return(_getApplicationFormData=_asyncToGenerator(_regeneratorRuntime().mark((function _callee3(a){var i,d,p,u;return _regeneratorRuntime().wrap((function _callee3$(g){for(;;)switch(g.prev=g.next){case 0:return i=a.programId,d=a.beforeSend,p=a.onSuccess,u=_objectWithoutProperties(a,z),g.abrupt("return",fetch(_objectSpread2({url:Y.get_application_form_data(i),contentType:Z.json,datatype:X.json,includeODataHeaders:!0,async:!1,beforeSend:d,onSuccess:p},u)));case 2:case"end":return g.stop()}}),_callee3)})))).apply(this,arguments)}function getClaimFormData(a){return _getClaimFormData.apply(this,arguments)}function _getClaimFormData(){return(_getClaimFormData=_asyncToGenerator(_regeneratorRuntime().mark((function _callee4(a){var i,d,p,u;return _regeneratorRuntime().wrap((function _callee4$(g){for(;;)switch(g.prev=g.next){case 0:if(i=a.programId,d=a.beforeSend,p=a.onSuccess,u=_objectWithoutProperties(a,U),i){g.next=4;break}return K.error({fn:getClaimFormData,message:"Missing required params",data:{programId:i}}),g.abrupt("return");case 4:return g.abrupt("return",fetch(_objectSpread2({url:Y.get_claim_form_data(i),contentType:Z.json,datatype:X.json,includeODataHeaders:!0,async:!1,beforeSend:d,onSuccess:p},u)));case 5:case"end":return g.stop()}}),_callee4)})))).apply(this,arguments)}function getMunicipalData(a){return _getMunicipalData.apply(this,arguments)}function _getMunicipalData(){return(_getMunicipalData=_asyncToGenerator(_regeneratorRuntime().mark((function _callee5(a){var i,d,p;return _regeneratorRuntime().wrap((function _callee5$(u){for(;;)switch(u.prev=u.next){case 0:return i=a.onSuccess,d=void 0===i?null:i,p=_objectWithoutProperties(a,B),u.abrupt("return",fetch(_objectSpread2({url:Y.get_municipal_data,contentType:Z.json,datatype:X.json,includeODataHeaders:!0,async:!1,onSuccess:d},p)));case 2:case"end":return u.stop()}}),_callee5)})))).apply(this,arguments)}function getExpenseTypeData(){return _getExpenseTypeData.apply(this,arguments)}function _getExpenseTypeData(){return _getExpenseTypeData=_asyncToGenerator(_regeneratorRuntime().mark((function _callee6(){var a,i,d=arguments;return _regeneratorRuntime().wrap((function _callee6$(p){for(;;)switch(p.prev=p.next){case 0:return i=_extends({},(_objectDestructuringEmpty(a=d.length>0&&void 0!==d[0]?d[0]:{}),a)),p.abrupt("return",fetch(_objectSpread2({url:Y.get_expense_type_data,contentType:Z.json,datatype:X.json,includeODataHeaders:!0,async:!1,returnData:!0},i)));case 2:case"end":return p.stop()}}),_callee6)}))),_getExpenseTypeData.apply(this,arguments)}function getOrgbookAutocompleteData(a){return _getOrgbookAutocompleteData.apply(this,arguments)}function _getOrgbookAutocompleteData(){return(_getOrgbookAutocompleteData=_asyncToGenerator(_regeneratorRuntime().mark((function _callee7(a){var i,d,p;return _regeneratorRuntime().wrap((function _callee7$(u){for(;;)switch(u.prev=u.next){case 0:return i=a.searchStr,d=a.onSuccess,p=_objectWithoutProperties(a,G),u.abrupt("return",fetch(_objectSpread2({url:Y.get_orgbook_autocomplete_data,data:{q:i,inactive:"false",revoked:"false",latest:"true"},onSuccess:d},p)));case 2:case"end":return u.stop()}}),_callee7)})))).apply(this,arguments)}function _getOrgbookTopicData(){return(_getOrgbookTopicData=_asyncToGenerator(_regeneratorRuntime().mark((function _callee8(a){var i,d;return _regeneratorRuntime().wrap((function _callee8$(p){for(;;)switch(p.prev=p.next){case 0:return i=a.topicSourceId,d=_objectWithoutProperties(a,Q),p.abrupt("return",fetch(_objectSpread2({url:Y.get_orgbook_topic_data,data:{q:i}},d)));case 2:case"end":return p.stop()}}),_callee8)})))).apply(this,arguments)}function _getOrgbookCredentialsData(){return(_getOrgbookCredentialsData=_asyncToGenerator(_regeneratorRuntime().mark((function _callee9(a){var i,d;return _regeneratorRuntime().wrap((function _callee9$(p){for(;;)switch(p.prev=p.next){case 0:return i=a.topicId,d=_objectWithoutProperties(a,W),p.abrupt("return",fetch(_objectSpread2({url:Y.get_orgbook_credentials_data(i)},d)));case 2:case"end":return p.stop()}}),_callee9)})))).apply(this,arguments)}function getDocuments(a){return _getDocuments.apply(this,arguments)}function _getDocuments(){return(_getDocuments=_asyncToGenerator(_regeneratorRuntime().mark((function _callee10(a){var i,d;return _regeneratorRuntime().wrap((function _callee10$(p){for(;;)switch(p.prev=p.next){case 0:return i=a.id,d=_objectWithoutProperties(a,J),p.abrupt("return",fetch(_objectSpread2({url:Y.get_documents(i)},d)));case 2:case"end":return p.stop()}}),_callee10)})))).apply(this,arguments)}const te=Logger("common/env");function getEnv(){const{host:i}=a.location,d=Object.keys(p).find((a=>p[a]===i));if(d)return te.info({fn:getEnv,message:`successfully determined current env: ${d}`}),d;te.error({fn:getEnv,message:"Unable to determine current env",data:{host:i,Hosts:p}})}async function getEnvVars(){const a=await getEnvVarsData();if(a){const i=function processEnvVarsData(a){const i=null==a?void 0:a.value;if(null==i?void 0:i.length){return i.reduce(((a,i)=>{var d,p;return{...a,[i.schemaname]:null===(p=null===(d=i.environmentvariabledefinition_environmentvariablevalue)||void 0===d?void 0:d[0])||void 0===p?void 0:p.value}}),{})}}(a);return te.info({fn:getEnvVars,message:"successfully extracted env vars:",data:i}),Promise.resolve(i)}let i="failed to extract env vars from data";return te.warn({fn:getEnvVars,message:i,data:a}),Promise.reject(new Error(i))}O.env={getEnvVars:getEnvVars,getEnv:getEnv};var oe=Logger("common/config");function getGlobalConfigData(){var a,i=localStorage.getItem("programData"),d=null===(a=JSON.parse(i))||void 0===a||null===(a=a.quartech_ApplicantPortalConfig)||void 0===a?void 0:a.quartech_configdata,p=JSON.parse(d);return oe.info({fn:getApplicationConfigData,message:"successfully fetched global config data from storage",data:p}),p}function getClaimConfigData(){var a,i=localStorage.getItem("programData"),d=null===(a=JSON.parse(i))||void 0===a?void 0:a.quartech_applicantportalclaimformjson;if(d){var p=JSON.parse(d);return oe.info({fn:getApplicationConfigData,message:"successfully fetched claim config data from storage",data:p}),p}oe.error({fn:getClaimConfigData,message:"Failed to get Claim config data, check quartech_applicantportalclaimformjson for the program in MS Dynamics.",data:{programData:i,configDataJSON:d}})}function getApplicationConfigData(a){var i,d=localStorage.getItem("programData"),p=null===(i=JSON.parse(d))||void 0===i?void 0:i.quartech_applicantportalapplicationformconfigjson,u=JSON.parse(p);return oe.info({fn:getApplicationConfigData,message:"successfully fetched application config data from storage",data:u}),u}O.config={getGlobalConfigData:getGlobalConfigData,getClaimConfigData:getClaimConfigData,getApplicationConfigData:getApplicationConfigData};const ae=new Logger("common/program");function getProgramId(){var a,d;if(null===(a=O.program)||void 0===a?void 0:a.programId){const a=null===(d=O.program)||void 0===d?void 0:d.programId;return ae.info({fn:getProgramId,message:`Cached programId found, returning ${a}`}),a}ae.info({fn:getProgramId,message:"attempting to get program id from URL path",data:{readyState:i.readyState}});const p=new URLSearchParams(i.location.search).get("programid");p&&ae.info({fn:getProgramId,message:`Success! Found program id in URL path ${p}`,data:{readyState:i.readyState,programIdParam:p}});const u=$("#quartech_program"),g=null==u?void 0:u.val();if(g?ae.info({fn:getProgramId,message:`Success! Found program id in hidden #quartech_program element ${g}`,data:{readyState:i.readyState,hiddenProgramElement:u,programId:g}}):ae.warn({fn:getProgramId,message:`Could not find program id in hidden #quartech_program element ${g}`,data:{readyState:i.readyState,hiddenProgramElement:u,programId:g}}),g&&p&&g!=p){ae.warn({fn:getProgramId,message:"Program id in URL path differs from program id found in element, fixing url path",data:{readyState:i.readyState,programIdParam:p,programIdHiddenValue:g}});let a=i.location.href.replace(p,g);location.replace(a)}const h=g||p;return h||ae.error({fn:getProgramId,message:"Could not find program id in either coding section or url params. Check that HTML content is present in Portal Management."}),O.program.programId=h,h}function getProgramAbbreviation(){var a;const i=localStorage.getItem("programData");return null===(a=JSON.parse(i))||void 0===a?void 0:a.quartech_programabbreviation}function getCurrentStep(){var a;let i=m.Unknown;const d=function htmlDecode(a){var i;return null===(i=(new DOMParser).parseFromString(a,"text/html").documentElement.textContent)||void 0===i?void 0:i.replace(/[^\x00-\x7F]/g,"")}($("div > ol > li.list-group-item.active").html());return d&&0!==d.length?(i=null!==(a=Object.keys(v).find((a=>{const i=v[a];return ae.info({fn:getCurrentStep,message:`Trying to find formStep for activeTabName: ${d}`,data:{TabDisplayNames:v,formStep:a,tabDisplayName:i}}),i===d||i.includes(d)})))&&void 0!==a?a:i,ae.info({fn:getCurrentStep,message:`Validating current step ${i}`,data:{activeTabName:d,TabDisplayNames:v}}),i&&i!==m.Unknown&&Object.values(m).includes(i)?(ae.info({fn:getCurrentStep,message:`Successfully found current step ${i}`}),i):(i&&i!==m.Unknown||ae.error({fn:getCurrentStep,message:"Unable to determine current step",data:{activeStep:i,activeTabName:d,TabDisplayNames:v,FormStep:m}}),m.Unknown)):(ae.error({fn:getCurrentStep,message:"Failed to get activeTabName",data:{activeTabName:d}}),i)}function getProgramData(){const a=localStorage.getItem("programData");return JSON.parse(a)}O.program={programId:null,getProgramId:getProgramId,getProgramAbbreviation:getProgramAbbreviation,getCurrentStep:getCurrentStep};var re=new Logger("common/tabs");function hideTabs(a){a&&a.length||re.warn({fn:hideTabs,message:"Hide tabs called with empty data"});var i=[];a&&(i=a.split(",")),re.info({fn:hideTabs,message:"Attempting to hide tabs...",data:{hiddenTabsNames:a,tabsToHide:i}}),i.forEach((function(a){if(a){var i=getTabElement({name:a});i&&i.style&&(i.style.display="none",re.info({fn:hideTabs,message:"Successfully hid tab for given tabName: ".concat(a)}))}}))}function getTabElement(a){var i=a.displayName,d=a.name;if(i||d){if(!i&&d){var p=Object.values(y).findIndex((function(a){return a.includes(d)}));if(!p)return void re.error({fn:getTabElement,message:"Could not find form step index for name: ".concat(d)});var u=Object.keys(y)[p];i=v[u]}if(i){var g=$("ol.progress li").filter((function(){return $(this).text().includes(i)}));if(g&&g.length){if(1===g.length)return g[0];re.error({fn:setTabName,message:"Matched multiple elements for one given tab",data:{displayName:i,name:d}})}else re.warn({fn:getTabElement,message:"Could not find tab element",data:{name:i}})}else re.error({fn:getTabElement,message:"Unable to find display name for tab name: ".concat(d)})}else re.error({fn:getTabElement,message:"Need at least one param displayName or name to find tab element"})}function setTabName(a,i){if(a&&i)if(Object.values(m).includes(a)){var d=v[a];if(d){var p=getTabElement({displayName:d});p&&(p.innerHTML=i,re.info({fn:setTabName,message:"Successfully updated tab name from ".concat(a," to ").concat(i)}))}else re.warn({fn:setTabName,message:"Could not find original tab display name"})}else re.warn({fn:setTabName,message:"Invalid section name passed, name: ".concat(a,", displayName: ").concat(i)});else re.warn({fn:setTabName,message:"Missing required params of name or displayName"})}function setHeadings(a,i){a&&i&&null!=i&&i.length?i.forEach((function(a){var i=a.name,d=a.displayName;i&&d?setHeadingName(i,d):re.error({fn:setHeadings,message:"Failed to set heading, missing params",data:{name:i,displayName:d}})})):re.error({fn:setHeadings,message:"Missing required sectionName or headings",data:{sectionName:a,headings:i}})}function setHeadingName(a,i){var d=$("fieldset legend h3").filter((function(){return $(this).text().includes(a)}));d&&d.length?d.length>1?re.error({fn:setHeadingName,message:"Matched more than one heading, could not update header",data:{name:a,displayName:i,headerElements:d}}):(d[0].innerHTML=i,re.info({fn:setTabName,message:"Successfully updated header from ".concat(a," to ").concat(i)})):re.warn({fn:setTabName,message:"Could not find header element to rename",data:{name:a,displayName:i}})}var ie=new Logger("common/sections");function configureSections(a){a&&a.length||ie.warn({fn:configureSections,message:"Configure sections called with empty data"}),a.forEach((function(a){var i=a.name,d=a.displayName,p=a.headings;i?(d&&setTabName(i,d),p&&p.length&&setHeadings(i,p),ie.info({fn:configureSections,message:"Successfully configured section for name: ".concat(i),data:{section:a}})):ie.error({fn:configureSections,message:"Could not find section name"})}))}O.fields={loading:!0,getFieldsBySectionApplication:getFieldsBySectionApplication,getFieldsBySectionClaim:getFieldsBySectionClaim};var le=Logger("common/fields");function getFieldsBySectionApplication(a){var i,d,p,u,g=arguments.length>1&&void 0!==arguments[1]&&arguments[1],h=getProgramAbbreviation();if(!g){var f=localStorage.getItem("fieldsData-".concat(h,"-").concat(a));if(f)return JSON.parse(f)}var v=function getGlobalFieldsConfig(){var a;return le.info({fn:getGlobalConfigData,data:getGlobalConfigData()}),null===(a=getGlobalConfigData())||void 0===a||null===(a=a.FieldsConfig)||void 0===a||null===(a=a.programs)||void 0===a?void 0:a.find((function(a){return"ALL"===a.name}))}();le.info({fn:getFieldsBySectionApplication,message:"globalConfigData:",data:v});var y=getApplicationConfigData();le.info({fn:getFieldsBySectionApplication,message:"applicationConfigData:",data:y});var w=null==v?void 0:v.sections,_=null==y?void 0:y.sections;configureSections(_);var q=y.hiddenSteps;q&&hideTabs(q);var T=null==_?void 0:_.find((function(i){return i.name===a})),A=w.find((function(i){return i.name===a})),$=[];if(T||A){if(T&&null!==(i=T.fields)&&void 0!==i&&i.length){if(null!==(d=T.fields)&&void 0!==d&&d.length){var E;(E=$).push.apply(E,_toConsumableArray(T.fields))}}else le.warn({fn:getFieldsBySectionApplication,message:"no applicationSection section found by sectionName: ".concat(a),data:{sectionName:a,forceRefresh:g,globalSections:w,applicationSections:_}});return A&&null!==(p=A.fields)&&void 0!==p&&p.length?null!==(u=A.fields)&&void 0!==u&&u.length&&($=function mergeFieldArrays(a,i,d){for(var p={},u=0,g=[].concat(_toConsumableArray(i),_toConsumableArray(a));u1&&void 0!==arguments[1]&&arguments[1],p=getProgramAbbreviation();if(!d){var u=localStorage.getItem("fieldsData-".concat(p,"-").concat(a));if(u)return JSON.parse(u)}var g=getClaimConfigData();le.info({fn:getFieldsBySectionClaim,message:"claimConfigData:",data:g});var h=null==g?void 0:g.sections,f=null==h?void 0:h.find((function(i){return i.name===a}));if(f&&null!=f&&null!==(i=f.fields)&&void 0!==i&&i.length){var m=f.fields;return m.forEach((function(a){le.info({fn:getFieldsBySectionClaim,message:"showing field name: ".concat(a.name)}),showFieldRow(a.name)})),localStorage.setItem("fieldsData-".concat(p,"-").concat(a),JSON.stringify(m)),le.info({fn:getFieldsBySectionClaim,message:"fieldsData:",data:m}),m}le.warn({fn:getFieldsBySectionClaim,message:"no configuration section found by sectionName: ".concat(a),data:{sectionName:a,forceRefresh:d,claimSections:h}})}var se=Logger("common/validation");function validateRequiredFields(){var a=getCurrentStep();a!==m.DemographicInfo?validateStepFields(a):validateDemographicInfoRequiredFields()}function validateStepFields(a,i){a||(a=getCurrentStep());var d,p="";if(!(d=getOptions$1().form===h.Application?getFieldsBySectionApplication(a):getFieldsBySectionClaim(a)))return"";se.info({fn:validateStepFields,message:"loop through fields to get validation errors",data:{validationErrorHtml:p}});for(var u=function _loop(){var a=d[g],i=a.name,u=a.required,h=a.elementType,f=a.validation;if(u){var m;(m=h?validateRequiredField(i,h):validateRequiredField(i))&&m.length&&(p=p.concat(m))}if("numeric"===(null==f?void 0:f.type)){var v=f.value,y=f.comparison,w=function validateNumericFieldValue(a,i,d,p){var u=document.querySelector("#".concat(a));if(u){if(""===u.value&&!p)return"";var g=parseFloat(u.value.replace(/,/g,"").replace("$","")),h=$("#".concat(a,"_label")).text(),f='
"'.concat(h,'" Please enter a valid number');switch(d){case"greaterThan":return g>i&&""!==g?"":"".concat(f,". The value must be greater than ").concat(i,".
");case"lessThan":return g");case"equalTo":return g!==i||""===g?"".concat(f,". The value must be equal to ").concat(i,"."):"";case"greaterThanOrEqualTo":return g>=i&&""!==g?"":"".concat(f,". The value must be greater than or equal to ").concat(i,".");case"lessThanOrEqualTo":return g<=i&&""!==g?"":"".concat(f,". The value must be less than or equal to ").concat(i,".");default:return"Invalid operator"}}}(i,v,y);w&&w.length&&(p=p.concat(w))}if("length"===(null==f?void 0:f.type)){var _=f.value,q=f.comparison,T=f.forceRequired,A=f.postfix,O=f.overrideDisplayValue,E=function validateFieldLength(a,i,d){var p=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,g=arguments.length>5&&void 0!==arguments[5]?arguments[5]:void 0;if(!$("#".concat(a,"_label")).is(":visible"))return"";var h=document.querySelector("#".concat(a));if(h){if(""===h.value&&!p)return"";var f=h.value.length,m=' Please enter a valid length';switch(d){case"greaterThan":return f>i&&""!==f?"":"".concat(m,". The length must be greater than ").concat(null!=g?g:i).concat(u?" ".concat(u):"",".");case"lessThan":return f");case"equalTo":return f!==i||""===f?"".concat(m,". The length must be equal to ").concat(null!=g?g:i).concat(u?" ".concat(u):"","."):"";case"greaterThanOrEqualTo":return f>=i&&""!==f?"":"".concat(m,". The length must be greater than or equal to ").concat(null!=g?g:i).concat(u?" ".concat(u):"",".");case"lessThanOrEqualTo":return f<=i&&""!==f?"":"".concat(m,". The length must be less than or equal to ").concat(null!=g?g:i).concat(u?" ".concat(u):"",".");default:return"Invalid operator"}}}(i,_,q,T,A,O);if(se.info({fn:validateStepFields,message:"Generate length validation error html...",data:{validationErrorHtml:p}}),E&&E.length>0){$("#".concat(i,"_error_message")).html(E),$("#".concat(i)).on("focusout",(function(){$("#".concat(i,"_error_message")).css({display:""}),$("#".concat(i)).css({border:"1px solid #e5636c"})}));var D=$("#".concat(i,"_label")).text(),j='"'.concat(D,'"');p=p.concat("
".concat(j).concat(E,"
")),se.info({fn:validateStepFields,message:"Done generating length validation error html...",data:{validationErrorHtml:p}})}else se.info({fn:validateStepFields,message:"Nothing to display for length validation error html...",data:{validationErrorHtml:p}}),$("#".concat(i)).off("focusout"),$("#".concat(i,"_error_message")).css({display:"none"}),$("#".concat(i)).css({border:""})}},g=0;gYou must select YES to either "Is the consultant registered with the BC Institute of Agrologists (BCIA)?" OR "If the consultant is NOT registered with the BC Institute of Agrologists (BCIA), is the consultant a Chartered Professional Accountant (CPA)?" The consultant must be registered with BCIA or CPA.':"":""}();p=p.concat(m)}}if(i)return se.info({fn:validateStepFields,message:"returning string",data:p}),p;se.info({fn:validateStepFields,message:"Done! Displaying validation error html",data:{validationErrorHtml:p}}),O.validation.errorHtml!==p?displayValidationErrors(p):se.info({fn:validateStepFields,message:"No need to display new error, same as old one.",data:{storedErrorHtml:O.validation.errorHtml,validationErrorHtml:p}})}function validateRequiredField(a){var i,d,p,u,g,h,m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f.Input,v=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"IS REQUIRED";if(se.info({fn:validateRequiredField,message:"Start validating required fieldName: ".concat(a," of elemType: ").concat(m)}),!(null===(i=$("#".concat(a,"_label")))||void 0===i?void 0:i.is(":visible")))return se.warn({fn:validateRequiredField,message:"Validate called on not visible fieldName: ".concat(a," of elemType: ").concat(m)}),"";var y="",w=!0;switch(m){case f.FileInput:w=0===(null===(d=$("#".concat(a,"_AttachFile")))||void 0===d||null===(d=d.val())||void 0===d?void 0:d.length)&&0===(null===(p=$("#".concat(a)))||void 0===p||null===(p=p.val())||void 0===p?void 0:p.length);break;case f.MultiOptionSet:w=0==(null===(u=$("li[id*='".concat(a,"-selected-item-']")))||void 0===u?void 0:u.length);break;case f.DropdownSelect:w=0==(null===(g=document.querySelector("#".concat(a)))||void 0===g||null===(g=g.value)||void 0===g?void 0:g.length);break;case f.SingleOptionSet:case f.DatePicker:default:w=""==(null===(h=$("#".concat(a)))||void 0===h?void 0:h.val())}if(se.info({fn:validateRequiredField,message:"Required field fieldName: ".concat(a,", isEmptyField: ").concat(w)}),w){se.info({fn:validateRequiredField,message:"Required field fieldName: ".concat(a," is empty! Set validation error message")});var _=$("#".concat(a,"_label")).text();y='
"'.concat(_,'" ').concat(v,"
")}return y}function validateEmailAddressField(a){var i=document.querySelector("#".concat(a)),d=document.querySelector("#".concat(a,"_error_message"));if(i){if(!d){var p=document.createElement("div");if(p.id="".concat(a,"_error_message"),p.className="error_message",p.style="display:none;",$("#".concat(a)).parent().append(p),!(d=document.querySelector("#".concat(a,"_error_message"))))return}var u=/^\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b$/i;$(i).on("keyup keydown",(function(){var a=i.value;a&&u.test(a)?($(i).css({border:""}),$(d).css({display:"none"})):($(i).css({border:"1px solid #e5636c"}),$(d).html("Email: must be a valid email."),$(d).css({display:""}))}))}}function displayValidationErrors(a){var i=$("#error_messages_div");if(se.info({fn:displayValidationErrors,message:"displaying validation errors",data:{validationErrorHtml:a}}),0==i.length){(i=document.createElement("div")).id="error_messages_div";var d=$("#NextButton").parent().parent();d.prepend(i),d.attr("id","actions_div")}else i=i[0];""==a?(i.innerHTML="",i.style="display:none;",$("#NextButton").prop("disabled",!1)):(i.innerHTML=a+"
",i.style="display:block;",$("#NextButton").prop("disabled",!0)),O.validation.errorHtml=a}function addValidationCheck(a,i){var p;null!=i&&i.intervalBased&&getEnv()===d.PROD?setInterval((function(){O.validation.enableIntervalBased&&validateStepFields()}),1e3):$("input[id*='".concat(a,"']")).on(null!==(p=null==i?void 0:i.event)&&void 0!==p?p:"onchange",(function(){validateStepFields()}))}function setInputMaxLength(a,i){$("#".concat(a)).attr("maxlength",i)}function setFieldReadOnly(a){$("#".concat(a)).attr("readonly",!0),$("#".concat(a)).on("mousedown",(function(a){a.preventDefault(),this.blur(),window.focus()})),$("#".concat(a)).attr("style","background-color: #eee !important")}O.fieldValidation={validateRequiredFields:validateRequiredFields};var de=new Logger("common/html");function getControlType(a){var i=a.querySelector("div.control"),d=null==i?void 0:i.querySelector("input[id*=quartech_], textarea[id*=quartech_], select[id*=quartech_]");if(d){var p=d.tagName.toLowerCase(),u=d.getAttribute("class");return d.getAttribute("type"),"input"===p&&null!=u&&u.includes("money")?f.CurrencyInput:"input"===p&&null!=u&&u.includes("text")?f.Input:"input"===p&&null!=u&&u.includes("datetime")?f.DatePicker:"textarea"===p&&null!=u&&u.includes("textarea")?f.TextArea:"select"===p&&null!=u&&u.includes("picklist")?f.DropdownSelect:"input"===p&&"checkbox"===d.type?f.Checkbox:(de.error({fn:getControlType,message:"Could not determine control type",data:{tr:a,control:d,tag:p,classes:u}}),f.Unknown)}de.error({fn:getControlType,message:"Could not find form control element",data:{tr:a,control:d}})}function getControlValue(a){var i=a.tr,d=a.rawValue,p=void 0!==d&&d,u=getControlType(i);de.info({fn:getControlValue,message:"Attempting to get control value for type: ".concat(u,", rawValue: ").concat(p)});var g,h,m,v=i.querySelector(".control");if(u===f.CurrencyInput){var y,w=null==v||null===(y=v.querySelector("input"))||void 0===y?void 0:y.value;return p?w:"$".concat(w)}if(u===f.Input)return null==v||null===(g=v.querySelector("input"))||void 0===g?void 0:g.value;if(u===f.DatePicker)return null==v||null===(h=v.querySelector("div > .datetimepicker > input"))||void 0===h?void 0:h.value;if(u===f.TextArea)return null==v||null===(m=v.querySelector("textarea").value)||void 0===m?void 0:m.replace(/\n/g," ");if(u===f.DropdownSelect){var _=null==v?void 0:v.querySelector("select");if(p)return _.value;var q=null==_?void 0:_.selectedIndex,T=_.options[q];return T.textContent||T.innerText}if(u===f.Checkbox){var A,$=null==v||null===(A=v.querySelector("input"))||void 0===A?void 0:A.checked;return p?$:$?"Yes":"No"}return null}function onDocumentReadyState(a){de.info({fn:onDocumentReadyState,message:"checking document readyState: ".concat(i.readyState)}),"complete"===i.readyState?a():i.addEventListener("readystatechange",(function(){"complete"===i.readyState&&(de.info({fn:onDocumentReadyState,message:"document ready!"}),a())}))}function showFieldRow(a){var i,d,p=document.querySelector("#".concat(a,"_label"));if(p){var u=p.closest("tr");if(u){null===(i=$(u))||void 0===i||i.css({display:""});var g=u.closest("fieldset");null===(d=$(g))||void 0===d||d.css({display:""})}}}function addHtmlToTabDiv(a,d){var p=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",u=i.querySelector("div[data-name='".concat(a,"']"));if(u){var g=i.createElement("div");g.setAttribute("quartechHtml","true"),g.innerHTML=d,"top"===p?u.prepend(g):u.append(g)}else de.error({fn:addHtmlToTabDiv,message:"Unable to add to tab div of tabDataName: ".concat(a,", could not find tab div")})}function addHtmlToSection(a,d){var p=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",u=i.querySelector("table[data-name='".concat(a,"'] > tbody"));if(u){var g=i.createElement("tr"),h=document.createElement("td");h.setAttribute("colspan","2"),h.setAttribute("quartechHtml","true"),h.innerHTML=d,g.appendChild(h),"top"===p?u.prepend(g):"bottom"===p&&u.append(g)}else de.error({fn:addHtmlToSection,message:"Unable to add to section of tableDataName: ".concat(a,", could not find section")})}function addTextAboveField(a,i){addHtmlToField(a,i,"top")}function addTextBelowField(a,i){addHtmlToField(a,i,"bottom")}function addHtmlToField(a,i){var d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",p=$("#".concat(a)).closest("tr");if(p){var u=crypto.randomUUID();"top"===d?$("")).insertBefore(p):"bottom"===d&&$("")).insertAfter(p);var g=$('tr[data-uuid="'.concat(u,'"]'));g&&null!=g&&g.length||de.error({fn:addHtmlToField,message:"Failed to create new row"});var h=document.createElement("td");h.setAttribute("colspan","2"),h.setAttribute("quartechHtml","true"),h.innerHTML=i,g.append(h)}}function observeChanges(a,i){var d=(null==a?void 0:a.id)||"";if(de.info({fn:observeChanges,message:"observing changes...",data:{id:d,element:a}}),a){i?i():validateRequiredFields();var p=new MutationObserver((function(p,u){de.info({fn:observeChanges,message:"Change observed",data:{id:d,element:a}}),i?i(p):validateRequiredFields()}));a&&a.nodeType===Node.ELEMENT_NODE&&p.observe(a,{attributes:!0,childList:!0,characterData:!0})}else de.error({fn:observeChanges,message:"failed to observe changes, null element",data:{id:d,element:a}})}function observeIframeChanges(a,i,d){de.info({fn:observeIframeChanges,message:"observing iframe changes...",data:{fieldNameToPass:i,fieldNameToObserve:d}});var p=document.querySelector('fieldset[aria-label="Coding Section (DO NOT REMOVE)"] iframe');null!=p&&p.nodeType&&observeChanges($(p)[0],(function(){a(i);var p=document.querySelector('fieldset[aria-label="Coding Section (DO NOT REMOVE)"] iframe'),u=null!=p&&p.contentDocument?null==p?void 0:p.contentDocument:null==p?void 0:p.contentWindow.document;null!=u&&u.nodeType&&observeChanges(u,(function(){var p=document.querySelector('fieldset[aria-label="Coding Section (DO NOT REMOVE)"] iframe'),u=p.contentDocument?p.contentDocument:p.contentWindow.document;a(i);var g=null==u?void 0:u.getElementById(d);null!=g&&g.nodeType&&observeChanges(g,(function(){a(i)}))}))}))}function hideFieldByFieldName(a,i){var d=arguments.length>2&&void 0!==arguments[2]&&arguments[2],p=document.querySelector("#".concat(a,"_label"));if(p){var u=p.closest("tr"),g=document.querySelector("#".concat(a));u&&g&&($(u).css({display:"none"}),$("#".concat(a,"_label")).parent().removeClass("required"),localStorage.removeItem("shouldRequire_".concat(a)),i&&i(),$(g).off("change"),d||$(g).val(""))}}function hideQuestion(a){$("#".concat(a)).css("display","none"),$("#".concat(a)).val("");var i=document.querySelector("#".concat(a,"_label")).closest("tr");$(i).css({display:"none"}),validateRequiredFields()}function showOrHideAndReturnValue(a,i){var d=$("#".concat(a)),p=$("#".concat(i)),u=parseFloat(d.val().replace(/,/g,""));return isNaN(u)&&(u=0),0==u?(p.val(""),p.closest("td").css("display","none"),d.closest("td").attr("colspan","2")):(p.closest("td").css("display","block"),p.closest("td").attr("colspan","1"),d.closest("td").attr("colspan","1")),u}function setFieldValue(a,i){var d=document.querySelector("#".concat(a));if(d){d.value=i;var p=new Event("change");d.dispatchEvent(p)}}function combineElementsIntoOneRowNew(a){var i,d=$("#".concat(a)),p=$("#".concat(a,"_label")),u=d.closest("td"),g=p.closest("td");if(u.is(g)){null===(i=d.closest("table.section").find("colgroup"))||void 0===i||i.remove();var h=d.closest("div.control"),f=d.closest("tr"),m=u.clone();m.attr("colspan","1"),f.append(m),h.remove(),m.find("div.info").remove()}else de.warn({fn:combineElementsIntoOneRowNew,message:"Skipping... elements must've already been combined, since label and input are in different cells",data:{name:a,inputElement:d,labelElement:p,inputTd:u,labelTd:g}})}function combineElementsIntoOneRow(a,i){var d=$("#".concat(i)).closest("td"),p=d.clone();p.attr("colspan","1"),d.remove();var u=$("#".concat(a));u.closest("td").attr("colspan","1"),u.closest("tr").append(p)}function hideFieldsAndSections(){var a=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];a?de.info({fn:hideFieldsAndSections,message:"Hiding fields and sections"}):de.info({fn:hideFieldsAndSections,message:"Unhiding fields and sections"}),function hideFields(){var a=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];document.querySelectorAll('tr:has([id$="_label"])').forEach((function(i){i.style&&(i.style.display=a?"none":"")}))}(a),function hideFieldSets(){var a=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];document.querySelectorAll("fieldset[aria-label]").forEach((function(i){i.style&&(i.style.display=a?"none":"")}))}(a)}function getFieldNameLabel(a){var d,p=null===(d=i.getElementById("".concat(a,"_label")))||void 0===d?void 0:d.textContent;return p||de.error({fn:getFieldNameLabel,message:"Could not find label text for fieldName: ".concat(a)}),p}function deepExtend(a){a=a||{};for(var i=1,d=arguments.length;i1&&void 0!==arguments[1]?arguments[1]:null,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(a&&null!==(d=be.sourcemap)&&void 0!==d&&d[a]){var g=be.sourcemap[a];if(function isScriptAdded(a){var d;if(a&&null!==(d=be.sourcemap)&&void 0!==d&&d[a]){var p=be.sourcemap[a];return Boolean(i.querySelector('script[src="'+p+'"]'))}}(a)){if(function isScriptFullyLoaded(a){return a in be.loadmap&&be.loadmap[a]}(a))return fe.warn({fn:useScript,message:"Script already loaded. Skipping: ".concat(a)}),void(p&&(fe.warn({fn:useScript,message:"Script already loaded. Calling onload for: ".concat(a)}),p()));var h,f;p?(fe.warn({fn:useScript,message:"Script still loading, adding to call stack: ".concat(a),data:be}),be.callstack=_objectSpread2(_objectSpread2({},be.callstack?be.callstack:{}),{},_defineProperty({},a,[].concat(_toConsumableArray(null!==(h=be.callstack)&&void 0!==h&&h[a]?null===(f=be.callstack)||void 0===f?void 0:f[a]:[]),[p])))):fe.warn({fn:useScript,message:"Script still loading: ".concat(a)})}else{var m=i.createElement("script");m.setAttribute("async",""),m.src=g,i.head.appendChild(m),p&&"function"==typeof p&&(be.callstack=_objectSpread2(_defineProperty({},a,[p]),be.callstack)),m.onload=function(){var i,d;fe.info({fn:useScript,message:"script onload successfully called ".concat(a),data:be}),function markScriptFullyLoaded(a){be.loadmap[a]=!0}(a),null!==(i=be.callstack)&&void 0!==i&&i[a]&&(null===(d=be.callstack)||void 0===d||d[a].forEach((function(a){return a()})),be.callstack=_objectSpread2(_objectSpread2({},be.callstack?be.callstack:{}),{},_defineProperty({},a,[])))},m.onerror=function(){fe.error({fn:useScript,message:"Failed to load: ".concat(a)}),u&&"function"==typeof u&&u()}}}}var ve=new Logger("common/form");function getFormId(){var a;if(null!==(a=O.form)&&void 0!==a&&a.id){var d,p=null===(d=O.form)||void 0===d?void 0:d.id;return ve.info({fn:getFormId,message:"Cached form submission id found, returning ".concat(p)}),p}var u,g=new URLSearchParams(i.location.search),h=g.get("id");if(!h){if(ve.info({fn:getFormId,message:"Could not find current form submission id from url params, try finding liquid form element..."}),!(u=document.querySelector("form#liquid_form")))return void ve.error({fn:getFormId,message:"Unable to find liquid form element, unable to retrieve app/claim submission id!"});var f=u.getAttribute("action");if(!f)return void ve.error({fn:getCurrentSubmissionId,message:"Unable to retrieve action attribute from liquid form element",data:{formElement:u}});var m=/id=([a-f\d-]+)/i.exec(f);h=m?m[1]:null}if(h)return ve.info({fn:getFormId,message:"Successfully retrieved form submission id from url params: ".concat(h)}),O.form.id=h,h;ve.error({fn:getFormId,message:"Unable to retrieve form submission id from either url or form element",data:{params:g,formElement:u}})}function addFormDataOnClickHandler(){var a=document.getElementById("NextButton");null==a||a.addEventListener("click",formDataOnClickHandler)}function formDataOnClickHandler(a){var i,d=Date.now();null==a||a.stopImmediatePropagation(),null==a||a.preventDefault(),generateFormJson()?null==a||null===(i=a.target)||void 0===i||i.onclick():ve.error({fn:formDataOnClickHandler,message:"Failed to generate form json data!"});var p=Date.now()-d;ve.info({fn:formDataOnClickHandler,message:"Generating form data json took ".concat(p," ms")})}function generateFormJson(){var a=document.querySelector("#EntityFormView"),i=a.querySelectorAll('textarea[id*="quartech_wordtemplatedata"]');if(!i||!i.length)return ve.info({fn:generateFormJson,message:"No need to generate form json if no word template field exists"}),!0;var d=null==a?void 0:a.querySelectorAll("fieldset"),p=null==a?void 0:a.querySelector(".tab");if(!(a&&d&&null!=d&&d.length&&p))return ve.error({fn:generateFormJson,message:"Unable to generate form JSON, could not find required elements"}),!1;var u=p.getAttribute("data-name");if(!u)return ve.error({fn:generateFormJson,message:"Failed to get tab data-name",data:{tabDivElement:p}}),!1;ve.info({fn:generateFormJson,message:"Processing fieldSet array for tabDataName: ".concat(u)});var g={};return d.forEach((function(a){var i,d,p=null===(i=a.querySelector("h3"))||void 0===i?void 0:i.textContent,h=a.querySelector("table"),f=null==h?void 0:h.getAttribute("data-name");if(f&&f.toLowerCase().includes("codingsection"))ve.info({fn:generateFormJson,message:"Skipping coding section..."});else if("none"!==(null===(d=a.style)||void 0===d?void 0:d.display)){var m=null==h?void 0:h.querySelectorAll("tbody > tr");f&&p&&m&&m.length||ve.error({fn:generateFormJson,message:"Unable to generate form JSON, could not find required section elements",data:{tabDataName:u}}),ve.info({fn:generateFormJson,message:"Processing tr array for sectionId: ".concat(f,", displayName: ").concat(p)});var v="".concat(f,"QuestionAnswerList");g[f]=_defineProperty({displayName:p},v,[]),m.forEach((function(a){if(function isHiddenRow(a){var i;return"none"===(null==a||null===(i=a.style)||void 0===i?void 0:i.display)}(a))ve.info({fn:generateFormJson,message:"Skipping hidden row",data:{tr:a}});else if(function isEmptyRow(a){var i,d=a.querySelector("td");return!(d&&"true"!==(null==d?void 0:d.getAttribute("quartechHtml"))&&(null==d||!d.getAttribute("class").includes("zero-cell"))&&0!==(null===(i=d.children)||void 0===i?void 0:i.length))}(a))ve.info({fn:generateFormJson,message:"Skipping empty row",data:{tr:a}});else{var i=getControlType(a),d=function getInfoValue(a){var i,d=a.querySelector(".info");return null==d||null===(i=d.querySelector("label"))||void 0===i?void 0:i.textContent}(a);ve.info({fn:generateFormJson,message:"For controlType: ".concat(i,"; found questionText: ").concat(d,", try finding answerText next..."),data:{tr:a}});var p=getControlValue({tr:a});if(ve.info({fn:generateFormJson,message:"Converting form row to JSON...",data:{tr:a,questionText:d,answerText:p}}),d)if(d.toLowerCase().includes("eligible expenses"))ve.info({fn:generateFormJson,message:"Skipping Eligible Expenses question/answer",data:{questionText:d,answerText:p,tr:a}});else{var u="".concat(f,"Question"),h="".concat(f,"Answer");g[f][v].push(_defineProperty(_defineProperty({},u,d),h,p))}else ve.error({fn:generateFormJson,message:"Could not find question text",data:{tr:a}})}}))}else ve.info({fn:generateFormJson,message:"Skipping hidden section...",data:{fieldset:a}})})),ve.info({fn:generateFormJson,message:"Setting word template field data",data:{formJsonObj:g,wordTemplateDataElement:i[0]}}),i[0].value=JSON.stringify(g),!0}O.form={generateFormJson:generateFormJson,getFormId:getFormId,id:null};var ye=Logger("common/loading");function hideLoadingAnimation(){ye.info({fn:hideLoadingAnimation,message:"attempting to hide loading animation..."});var a,d=i.getElementById("loader");d?(ye.info({fn:hideLoadingAnimation,message:"loader found & finished loading, removing element"}),null===(a=d.parentNode)||void 0===a||a.removeChild(d)):ye.warn({fn:hideLoadingAnimation,message:"loader not found!"});var p,u=i.getElementById("loader-style");u?(ye.info({fn:hideLoadingAnimation,message:"loaderStyle found & finished loading, removing element"}),null===(p=u.parentNode)||void 0===p||p.removeChild(u)):ye.warn({fn:hideLoadingAnimation,message:"loaderStyle not found!"})}var xe=new Logger("application/steps/deliverablesBudget");function setOnKeypressBudgetInput(a){$("#".concat(a)).on("change keyup blur",(function(){calculateEstimatedActivityBudget()}))}function getCurrencyFieldValue(a){var i=$("#".concat(a));if(i){var d=String(i.val()),p=parseFloat(d.replace(/,/g,""));return isNaN(p)&&(p=0),p}xe.error({fn:getCurrencyFieldValue,message:"Unable to find element for valueElementId: ".concat(a)})}function setOnKeypressTotalProjectInput(a){$("#".concat(a)).on("change keyup blur",(function(){!function calculateTotalProjectCost(){var a,i,d,p,u=(null!==(a=getCurrencyFieldValue("quartech_totalfundingrequiredfromtheprogram"))&&void 0!==a?a:0)+(null!==(i=getCurrencyFieldValue("quartech_inkindcontribution"))&&void 0!==i?i:0)+(null!==(d=getCurrencyFieldValue("quartech_cashcontribution"))&&void 0!==d?d:0)+(null!==(p=getCurrencyFieldValue("quartech_totalgstfromquotes"))&&void 0!==p?p:0),g=_e.format(u);$("#quartech_totalprojectcost").val(g.replace("CA$",""))}()}))}function setOnKeypressTotalAddedIncomeAndReducedCosts(a){$("#".concat(a)).on("change keyup blur",(function(){!function calculateTotalAddedIncomeAndReducedCosts(){var a,i,d=(null!==(a=getCurrencyFieldValue("quartech_totaladdedincome"))&&void 0!==a?a:0)+(null!==(i=getCurrencyFieldValue("quartech_totalreducedcost"))&&void 0!==i?i:0),p=_e.format(d);$("#quartech_totaladdedincomeandreducedcosts").val(p.replace("CA$","")),calculateNetChangeInProfit()}()}))}function setOnKeypressTotalAddedCostsAndReducedIncome(a){$("#".concat(a)).on("change keyup blur",(function(){!function calculateTotalAddedCostsAndReducedIncome(){var a,i,d=(null!==(a=getCurrencyFieldValue("quartech_totaladdedcost"))&&void 0!==a?a:0)+(null!==(i=getCurrencyFieldValue("quartech_totalreducedincome"))&&void 0!==i?i:0),p=_e.format(d);$("#quartech_totaladdedcostsandreducedincome").val(p.replace("CA$","")),calculateNetChangeInProfit()}()}))}function calculateNetChangeInProfit(){var a,i,d=(null!==(a=getCurrencyFieldValue("quartech_totaladdedincomeandreducedcosts"))&&void 0!==a?a:0)-(null!==(i=getCurrencyFieldValue("quartech_totaladdedcostsandreducedincome"))&&void 0!==i?i:0),p=_e.format(d);$("#quartech_netchangeinprofit").val(p.replace("CA$",""))}function calculateEstimatedActivityBudget(){var a=parseFloat($("#quartech_smefee").val().replace(/,/g,""));isNaN(a)&&(a=0);var i=a+showOrHideAndReturnValue("quartech_smetravelairfareparkingetc","quartech_pleasedescribemodeoftravelifapplicable")+showOrHideAndReturnValue("quartech_smeaccommodation","quartech_pleasedescribeaccommodationwherewillthesme")+showOrHideAndReturnValue("quartech_facilityequipmenttechnologyrental","quartech_pleasedescribeequipmentrequiredifapplicable")+showOrHideAndReturnValue("quartech_advertisingcommunications","quartech_pleasedescribewhatformsofadvertisingcommunic")+showOrHideAndReturnValue("quartech_administrationcosts","quartech_pleasedescribetheadministrativecoststobeinc")+showOrHideAndReturnValue("quartech_othercost","quartech_pleaseexplainotherifapplicable"),d=i-showOrHideAndReturnValue("quartech_costsharecontributioncashorinkinddonation","quartech_pleaseexplainwhotheotherpartnersareandwha"),p=_e.format(i);$("#quartech_estimatedbudgettotalactivitycost").val(p.replace("CA$",""));var u=_e.format(d);$("#quartech_totalfundingrequiredfromtheprogram").val(u.replace("CA$",""))}var we=Logger("common/currency"),_e=new Intl.NumberFormat("en-US",{style:"currency",currency:"CAD",maximumFractionDigits:2});function customizeCurrencyInput(a){var i=a.inputId,d=a.skipCalculatingBudget,p=void 0!==d&&d,u=a.maxDigits,g=void 0===u?10:u,h=a.limitInputValue,f=void 0===h?void 0:h,m=a.hideDollarSign,v=void 0!==m&&m;a.emptyInitialValue;var y=a.allowNegatives,w=void 0!==y&&y,_=$("#".concat(i));if(!document.querySelector("#".concat(i,"_span_currency_label"))&&!_.val()&&!v){_.parent().addClass("input-group");var q=document.createElement("span");q.id="".concat(i,"_span_currency_label"),q.innerText="$",q.className="input-group-addon",_.parent().prepend(q)}_.on("keydown",(function(a){var i,d=_.val(),p=a.which;if(we.info({fn:customizeCurrencyInput,message:"KEYDOWN ACTION: Detected pressedKeyCode: ".concat(p)}),p<=40&&p>=37)we.info({fn:customizeCurrencyInput,message:"KEYDOWN ACTION: Arrow keys pressed, allowing default event behaviour"});else{var u,g=null===(i=document.getElementById(_[0].id))||void 0===i?void 0:i.selectionStart;if(190===p&&"."===d.charAt(g))return null===(u=document.getElementById(_[0].id))||void 0===u||u.setSelectionRange(g+1,g+1),void a.preventDefault();if(46===p){var h,f,m=d.charAt(g);if("0"===m&&0===g)return null===(h=document.getElementById(_[0].id))||void 0===h||h.setSelectionRange(g+1,g+1),void a.preventDefault();if("."===m||","===m)return null===(f=document.getElementById(_[0].id))||void 0===f||f.setSelectionRange(g+1,g+1),void a.preventDefault();var v=!1;if(we.info({fn:customizeCurrencyInput,message:"DELETE ACTION: Attempting to detect if decimal place",data:{currentInputCursor:g,inputValueLength:null==d?void 0:d.length}}),g>=d.length-2&&(v=!0),v&&g!==d.length){var y;we.info({fn:customizeCurrencyInput,message:"DELETE ACTION: Decimal place input detected",data:{inputValue:d}});var w=d.substring(0,g)+"0"+d.substring(g+1);return _.val(w),null===(y=document.getElementById(_[0].id))||void 0===y||y.setSelectionRange(g+1,g+1),a.preventDefault(),void we.info({fn:customizeCurrencyInput,message:"DELETE ACTION: Decimal place value updated",data:{inputValue:d,newValue:w}})}}if(8===p){var q,T=d.charAt(g-1);if("."===T||","===T)return null===(q=document.getElementById(_[0].id))||void 0===q||q.setSelectionRange(g-1,g-1),void a.preventDefault();if(g>=d.length-2){var A,$=d.substring(0,g-1)+"0"+d.substring(g);return _.val($),null===(A=document.getElementById(_[0].id))||void 0===A||A.setSelectionRange(g-1,g-1),void a.preventDefault()}}}})),_.on("focusin",(function(a){$(this).data("val",$(this).val())})),_.on("input",(function(a){handleNewValueEntered($(this),p)})),_.on("keypress",(function(a){var i=a.which;if(i>=48&&i<=57||45===i&&w){var d,u=_.val(),h=u.includes("-"),m=null===(d=document.getElementById(_[0].id))||void 0===d?void 0:d.selectionStart;if(i>=49&&i<=57&&"0.00"===u&&0===m){var v,y=u.split("");return y[0]=String.fromCharCode(i),y=y.join(""),_.val(y),null===(v=document.getElementById(_[0].id))||void 0===v||v.setSelectionRange(m+1,m+1),void a.preventDefault()}if((u.length>0&&!h||u.length>1&&h)&&u.length===m)return void a.preventDefault();if(45===i&&w){if(0!==m||u.includes("-"))return void a.preventDefault();if(0===m){var q=parseFloat(u.replace(/,/g,""));q&&0!=q?(_.val("-".concat(q.toFixed(2))),document.getElementById(_[0].id).setSelectionRange(0,0),handleNewValueEntered(_,p),a.preventDefault()):""!=u&&"0.00"!==u||_.val("-")}return void a.preventDefault()}if(f){var T=parseFloat(u.replace(/,/g,"")),A=parseFloat(f.replace(/,/g,""));isNaN(T)&&(T=0),T>A&&_.val(f)}var $=g;if(u.length,h&&($+=1),m>0&&u.length-2>0&&m>=u.length-2){var O;we.info({fn:customizeCurrencyInput,message:"KEYDOWN ACTION: Decimal input detected",data:{inputValue:u}});var E=u.split("");return E[m]=String.fromCharCode(i),E=E.join(""),_.val(E),null===(O=document.getElementById(_[0].id))||void 0===O||O.setSelectionRange(m+1,m+1),a.preventDefault(),a.stopImmediatePropagation(),void we.info({fn:customizeCurrencyInput,message:"KEYDOWN ACTION: Decimal input detected... set new value",data:{newVal:E}})}if(u.length<=$)return}a.preventDefault()}))}function handleNewValueEntered(a){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],d=a.val(),p=d.includes("-"),u=d.replace(/,/g,"").replace("$","").replaceAll("-","");isNaN(u)&&(u=0);var g=_e.format(u);if(g){we.info({fn:handleNewValueEntered,message:"newAmountWithCurrencyFormat: ".concat(g)});var h=document.getElementById(a[0].id).selectionStart,f=g.replace("CA$","");a.val("".concat(p?"-":"").concat(f)),i||calculateEstimatedActivityBudget();var m=!1;d.length>a.data("val").length&&(m=!0);var v=(a.data("val").match(/,/g)||[]).length;(a.val().match(/,/g)||[]).length!==v&&(m?h++:h-1>=0?h--:h=0),document.getElementById(a[0].id).setSelectionRange(h,h)}a.data("val",a.val())}var Se=Logger("common/masking"),qe={CRA:"CRA",PostalCode:"PostalCode",PhoneNumber:"PhoneNumber",Number:"Number",Email:"Email"},ke={CRA:"000000000",PostalCode:"S0S 0S0",PhoneNumber:"(000) 000-0000"};function maskInput(a,i){Se.info({fn:maskInput,message:"applying mask input to fieldName: ".concat(a," of type: ").concat(i)}),Object.keys(qe).includes(i)?useScript(me.jquerymask,(function(){var d,p,u;switch(i){case qe.CRA:case qe.PostalCode:case qe.PhoneNumber:null===(d=$("#".concat(a)))||void 0===d||d.mask(ke[i]);break;case qe.Email:null===(p=$("#".concat(a)))||void 0===p||p.mask("A",{translation:{A:{pattern:/[\w@\-.+]/,recursive:!0}}});break;case qe.Number:null===(u=$("#".concat(a)))||void 0===u||u.mask("Z#",{translation:{Z:{pattern:/[1-9]/}}});break;default:return void Se.error({fn:maskInput,message:"did NOT apply masking to fieldName: ".concat(a," of type: ").concat(i)})}Se.info({fn:maskInput,message:"successfully applied mask input to fieldName: ".concat(a," of type: ").concat(i)})})):Se.error({fn:maskInput,message:"unsupported mask, cannot mask input for fieldName: ".concat(a," and type: ").concat(i)})}function setupTooltip(a){var i=a.name,d=a.tooltipText,p=a.tooltipTargetElementId;if(d){var u=$("#".concat(null!=p?p:i));u.attr("data-content",d),u.attr("data-placement","bottom"),u.attr("data-html","true"),u.attr("data-trigger","hover"),u.attr("data-original-title",""),u.popover({trigger:"manual",html:!0,animation:!1}).on("mouseenter",(function(){var a=this;$(this).popover("show"),$(".popover").on("mouseleave",(function(){$(a).popover("hide")}))})).on("mouseleave",(function(){var a=this;setTimeout((function(){$(".popover:hover").length||$(a).popover("hide")}),300)}))}}var Ce=Logger("common/fieldConfiguration");function configureFields(){var a,i=getCurrentStep();if(Ce.info({fn:configureFields,message:"configuring fields for step: ".concat(i,"...")}),a=getOptions$1().form===h.Application?getFieldsBySectionApplication(i):getFieldsBySectionClaim(i)){Ce.info({fn:configureFields,message:"configuring fields...",data:{stepName:i,fields:a}});for(var d=0;d"))}var te,oe;if(E&&$("#".concat(u,"_label")).css("font-weight","bold"),G&&(null===(te=$("#".concat(u,"_label")))||void 0===te||te.css("display","none")),m&&(g?setRequiredField(u,g):setRequiredField(u)),v&&addValidationCheck(u,v),y&&hideFieldByFieldName(u,validateStepFields(i),J),A&&setInputMaxLength(u,A),Q&&setFieldReadOnly(u),"email"===w?(maskInput(u,qe.Email),validateEmailAddressField(u)):"currency"===w?customizeCurrencyInput(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({inputId:u},void 0!==B?{skipCalculatingBudget:B}:{skipCalculatingBudget:!0}),q?{maxDigits:q}:{maxDigits:13}),T&&{emptyInitialValue:T}),_&&{allowNegatives:_})):"percentage"===w?customizeCurrencyInput({inputId:u,skipCalculatingBudget:!0,maxDigits:5,limitInputValue:"100.00",hideDollarSign:!0}):"number"===w?($("#".concat(u)).attr("type","number"),_||($("#".concat(u)).attr("min","0"),$("#".concat(u)).attr("oninput","this.value = !!this.value && Math.abs(this.value) >= 0 ? Math.abs(this.value) : null"))):"cra"===w?maskInput(u,qe.CRA):"phoneNumber"===w?maskInput(u,qe.PhoneNumber):"postalCode"===w&&maskInput(u,qe.PostalCode),g===f.FileInput)null===(oe=$("#".concat(u,"_AttachFile")))||void 0===oe||oe.attr("accept",null!=K?K:".csv,.doc,.docx,.odt,.pdf,.xls,.xlsx,.ods,.gif,.jpeg,.jpg,.png,.svg,.tif");Y&&initializeVisibleIf(u,m,Y)}}var ae;setupCanadaPostAddressComplete(a),setDynamicallyRequiredFields(i)}}function setupCanadaPostAddressComplete(a){var d={key:"kb98-fz49-gp47-dk74"},p=["quartech_businesssuitenumberoptional","quartech_businessstreetnumber","quartech_businessstreet","quartech_businesscity","quartech_businessprovinceterritory","quartech_businesspostalcode"],u=p.every((function(i){return a.some((function(a){return a.name===i}))}));Ce.info({fn:setupCanadaPostAddressComplete,message:"Checked if all addresscomplete fields exist in fields data: allCpFieldsPresent: ".concat(u),data:{cpFieldNames:p,fields:a,allCpFieldsPresent:u}}),u?useScript("canadapost",(function(){var a=window.pca;Ce.info({fn:setupCanadaPostAddressComplete,message:"Starting to setup canadapost addresscomplete",data:{pca:a,options:d}});var p=[{element:"quartech_businesssuitenumberoptional",field:"SubBuilding",mode:a.fieldMode.DEFAULT},{element:"quartech_businessstreetnumber",field:"BuildingNumber",mode:a.fieldMode.DEFAULT},{element:"quartech_businessstreet",field:"Street",mode:a.fieldMode.POPULATE},{element:"quartech_businesscity",field:"City",mode:a.fieldMode.POPULATE},{element:"quartech_businessprovinceterritory",field:"ProvinceName",mode:a.fieldMode.POPULATE},{element:"quartech_businesspostalcode",field:"PostalCode",mode:a.fieldMode.POPULATE}],u=i.createElement("script");u.setAttribute("type","text/javascript"),u.innerHTML="\n var fields = ".concat(JSON.stringify(p),",\n options = ").concat(JSON.stringify(d),",\n control = new pca.Address(fields, options);\n "),i.head.appendChild(u),Ce.info({fn:setupCanadaPostAddressComplete,message:"Successfully configured canadapost addresscomplete"})})):Ce.info({fn:setupCanadaPostAddressComplete,message:"Canadapost addresscomplete fields not found, no need to load script"})}function setRequiredField(a){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f.Input,d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Required field";Ce.info({fn:setRequiredField,message:"Start configuring required fieldName: ".concat(a,", elemType: ").concat(i)}),$("#".concat(a,"_label")).parent().addClass("required"),$("#".concat(a)).attr("required",!0);var p=document.createElement("div");switch(p.id="".concat(a,"_error_message"),p.className="error_message",p.style="display:none;",p.innerHTML="".concat(d,""),$("#".concat(a)).parent().append(p),i){case f.FileInput:var u=$("#".concat(a)),g=$("input[id=".concat(a,"_AttachFile]"));Ce.info({fn:setRequiredField,message:"observe changes on file input element",data:{attachFileField:g,textareaField:u,fieldName:a}}),observeChanges(g),null==g||g.on("blur input",(function(){validateRequiredFields()})),null==u||u.on("change",(function(){validateRequiredFields()}));break;case f.DatePicker:Ce.info({fn:setRequiredField,message:"Configuring required datepicker element for fieldName: ".concat(a)});var h=$("input[id=".concat(a,"_datepicker_description]")).parent()[0];Ce.info({fn:setRequiredField,message:"observe changes on datepicker element",data:{datePickerElement:h}}),observeChanges(h),$("#".concat(a,"_datepicker_description")).on("blur input",(function(){validateRequiredFields()}));break;case f.SingleOptionSet:case f.MultiOptionSet:$("input[id*='".concat(a,"']")).on("change",(function(){validateRequiredFields(),Ce.info({fn:setRequiredField,message:"Q3 updated... validateRequiredFields..."})}));break;case f.DropdownSelect:$("select[id*='".concat(a,"']")).on("change",(function(){validateRequiredFields()}));break;default:$("#".concat(a)).on("change keyup",(function(a){validateRequiredFields()}))}}function setDynamicallyRequiredFields(a){var i;(i=getOptions$1().form===h.Application?getFieldsBySectionApplication(a):getFieldsBySectionClaim(a))&&Object.keys(localStorage).filter((function(a){return a.startsWith("shouldRequire_")})).forEach((function(a){var d=a.replace("shouldRequire_",""),p=i.find((function(a){return a.name===d}));p&&p.elementType?setRequiredField(d,p.elementType):setRequiredField(d)}))}var Fe=new Logger("common/fieldConditionalLogic");function initializeVisibleIf(a,i,d){var p=d.fieldName,u=d.selectedValue;p&&void 0!==u?(Fe.info({fn:initializeVisibleIf,message:"Starting to configure dynamic field using visibleIf",data:{name:a,dependentSelectedValue:u,dependentFieldName:p,disableRequiredProp:!i}}),showFieldRow(a),initOnChange_DependentRequiredField({requiredFieldTag:a,dependentOnElementTag:p,dependentOnValue:u,disableRequiredProp:!i}),Fe.info({fn:initializeVisibleIf,message:"Successfully initialized dynamic field with name: ".concat(a),data:{dependentSelectedValue:u,dependentFieldName:p,required:i}})):Fe.error({fn:initializeVisibleIf,message:"Dynamically configured visibleIf field missing fieldName or selectedValue",data:{name:a,dependentFieldName:p,dependentSelectedValue:u}})}function initOnChange_DependentRequiredField(a){var i=a.dependentOnValue,d=a.dependentOnValueArray,p=a.dependentOnElementTag,u=a.requiredFieldTag,g=a.overrideTruthyClause,h=void 0===g?void 0:g,f=a.validationFunc,m=a.setRequiredFieldsFunc,v=a.disableRequiredProp,y=void 0!==v&&v,w=a.customFunc,_=document.querySelector("#".concat(p));_?(setupDependentRequiredField({dependentOnValue:i,dependentOnValueArray:d,dependentOnElementTag:p,requiredFieldTag:u,overrideTruthyClause:h,validationFunc:f,setRequiredFieldsFunc:m,disableRequiredProp:y,customFunc:w}),$(_).on("change",(function(){setupDependentRequiredField({dependentOnValue:i,dependentOnValueArray:d,dependentOnElementTag:p,requiredFieldTag:u,overrideTruthyClause:h,validationFunc:f,setRequiredFieldsFunc:m,disableRequiredProp:y,customFunc:w})}))):Fe.error({fn:initOnChange_DependentRequiredField,message:"Could not find field for dependentOnElementTag: ".concat(p)})}function setupDependentRequiredField(a){var i=a.dependentOnValue,d=a.dependentOnValueArray,p=void 0===d?[]:d,u=a.dependentOnElementTag,g=a.requiredFieldTag,h=a.overrideTruthyClause,f=void 0===h?void 0:h,m=a.validationFunc,v=a.setRequiredFieldsFunc,y=a.disableRequiredProp,w=void 0!==y&&y,_=a.customFunc,q=document.querySelector("#".concat(u));if(q){var T=getControlValue({tr:q.closest("tr"),rawValue:!0});Fe.info({fn:setupDependentRequiredField,message:"Setting up dependent field dependentOnElementTag: ".concat(u," with value: ").concat(T)}),null!=f?(Fe.info({fn:setupDependentRequiredField,message:"Overriding truthy clause overrideTruthyClause: ".concat(f),data:{dependentOnElementTag:u,input:T}}),shouldRequireDependentField(!0===f?{shouldBeRequired:!0,requiredFieldTag:g,validationFunc:m,setRequiredFieldsFunc:v,disableRequiredProp:w,customFunc:_}:{shouldBeRequired:!1,requiredFieldTag:g,validationFunc:m,setRequiredFieldsFunc:v,disableRequiredProp:w,customFunc:_})):T===i||T==="".concat(i)||p.includes(T)?(Fe.info({fn:setupDependentRequiredField,message:"Value matches visibleIf condition",data:{dependentOnElementTag:u,input:T,dependentOnValue:i,dependentOnValueArray:p,requiredFieldTag:g}}),shouldRequireDependentField({shouldBeRequired:!0,requiredFieldTag:g,validationFunc:m,setRequiredFieldsFunc:v,disableRequiredProp:w,customFunc:_})):(Fe.info({fn:setupDependentRequiredField,message:"Value DOES NOT match visibleIf condition",data:{dependentOnElementTag:u,input:T,dependentOnValue:i,dependentOnValueArray:p,requiredFieldTag:g}}),shouldRequireDependentField({shouldBeRequired:!1,requiredFieldTag:g,validationFunc:m,setRequiredFieldsFunc:v,disableRequiredProp:w,customFunc:_}))}else Fe.error({fn:setupDependentRequiredField,message:"Could not find field for dependentOnElementTag: ".concat(u)})}function shouldRequireDependentField(a){var i,d=a.shouldBeRequired,p=a.requiredFieldTag,u=a.validationFunc,g=void 0===u?validateStepFields:u,h=a.setRequiredFieldsFunc,f=void 0===h?setDynamicallyRequiredFields:h,m=a.disableRequiredProp,v=a.customFunc,y=document.querySelector("#".concat(p,"_label")),w=null==y?void 0:y.closest("tr"),_=document.querySelector("#".concat(p));y&&w&&_?(d?(Fe.info({fn:shouldRequireDependentField,message:"Setting dynamic field to visible requiredFieldTag: ".concat(p)}),$(w).css({display:""}),m||(localStorage.setItem("shouldRequire_".concat(p),!0),f&&f(getCurrentStep()),g&&(g(getCurrentStep()),$(_).change((function(){g(getCurrentStep())}))))):(Fe.info({fn:shouldRequireDependentField,message:"Setting dynamic field to hidden requiredFieldTag: ".concat(p)}),$(w).css({display:"none"}),m||($("#".concat(p,"_label")).parent().removeClass("required"),localStorage.removeItem("shouldRequire_".concat(p)),f&&f(getCurrentStep()),g&&g(getCurrentStep()),$(_).off("change")),null===(i=$("#".concat(p,"_name")))||void 0===i||i.val(""),$(_).val("")),v&&v()):Fe.error({fn:shouldRequireDependentField,message:"Failed to find required elements",data:{requiredFieldTag:p,requiredFieldLabelElement:y,requiredFieldRow:w,requiredFieldInputElement:_}})}var Te=Logger("application/steps/applicantInfo");function initOnChange_PreviouslyReceivedKttpFunding(){var a=$("#quartech_hasthisorganizationreceivedkttpfundingin");hideShow_for_PreviouslyReceivedKttpFunding(a.val()),Te.info({fn:initOnChange_PreviouslyReceivedKttpFunding,message:"initOnChange_PreviouslyReceivedKttpFunding called."}),a.on("change",(function(){var a=$(this).val();Te.info({fn:initOnChange_PreviouslyReceivedKttpFunding,message:"Selected Value: ".concat(a)}),hideShow_for_PreviouslyReceivedKttpFunding(a)}))}function hideShow_for_PreviouslyReceivedKttpFunding(a){var i="none";a===w&&(i="table-row"),$("#quartech_ifyespleaseexplainwhenandforwhichactivity").parent().parent().parent().css("display",i)}function initOnChange_OrganizationReceivedFundingFromBC(){var a=$("#quartech_hasthisorganizationreceivedfundingfrmother");hideShow_for_OrganizationReceivedFundingFromBC(a.val()),Te.info({fn:initOnChange_OrganizationReceivedFundingFromBC,message:"initOnChange_OrganizationReceivedFundingFromBC called."}),a.on("change",(function(){var a=$(this).val();Te.info({fn:initOnChange_OrganizationReceivedFundingFromBC,message:"Selected Value: ".concat(a)}),hideShow_for_OrganizationReceivedFundingFromBC(a)}))}function hideShow_for_OrganizationReceivedFundingFromBC(a){var i="none";a===w&&(i="table-row"),$("#quartech_ifyespleaseexplainwhenandfromwhichprogram").parent().parent().parent().css("display",i)}function initOnChange_IsCollaboratingWithOtherOrganizationQuestion(){var a=$("#quartech_areyoucollaboratingwithanyotherorg");hideShow_for_CollaboratingWithOtherOrgsControl(a.val()),Te.info({fn:initOnChange_IsCollaboratingWithOtherOrganizationQuestion,message:"initOnChange_IsCollaboratingWithOtherOrganizationQuestion called."}),a.on("change",(function(){var a=$(this).val();Te.info({fn:initOnChange_IsCollaboratingWithOtherOrganizationQuestion,message:"Selected Value: ".concat(a)}),hideShow_for_CollaboratingWithOtherOrgsControl(a)}))}function hideShow_for_CollaboratingWithOtherOrgsControl(a){var i="none";a===w&&(i="table-row"),$("#quartech_ifyespleaseprovidelegalbusinessorganization").parent().parent().parent().css("display",i),$("#quartech_ifyespleaseprovideacontactname").parent().parent().parent().css("display",i),$("#quartech_ifyespleaseprovideabriefbackgroundoutlinin").parent().parent().parent().css("display",i)}function initOnChange_ActivityOverMultipleDays(){var a=$("#quartech_doestheactivitytakeplaceovermultipleday");hideShow_for_ActivityOverMultipleDays(a.val()),Te.info({fn:initOnChange_ActivityOverMultipleDays,message:"initOnChange_ActivityOverMultipleDays called."}),a.on("change",(function(){var a=$(this).val();Te.info({fn:initOnChange_ActivityOverMultipleDays,message:"Selected Value: ".concat(a)}),hideShow_for_ActivityOverMultipleDays(a)}))}function hideShow_for_ActivityOverMultipleDays(a){var i="none";a===w?i="table-row":$("#quartech_ifyespleaseprovidetheadditionaldates").val(""),$("#quartech_ifyespleaseprovidetheadditionaldates").parent().parent().parent().css("display",i)}function initOnChange_AdaptedEventForAdultLearning(){var a=$("#quartech_theprocessoflearningandprocessingknowledge");hideShow_for_AdaptedEventForAdultLearning(a.val()),Te.info({fn:initOnChange_AdaptedEventForAdultLearning,message:"initOnChange_AdaptedEventForAdultLearning called."}),a.on("change",(function(){var a=$(this).val();Te.info({fn:initOnChange_AdaptedEventForAdultLearning,message:"Selected Value: ".concat(a)}),hideShow_for_AdaptedEventForAdultLearning(a)}))}function hideShow_for_AdaptedEventForAdultLearning(a){var i="none";a===w?i="table-row":$("#quartech_ifyespleasedescribehowtheproposedactivitie").val(""),$("#quartech_ifyespleasedescribehowtheproposedactivitie").parent().parent().parent().css("display",i)}function getTopic(a){$.ajax({url:"https://orgbook.gov.bc.ca/api/v4/search/topic",data:{q:a.topic_source_id}}).done((function(i){getTopicCredentials(i.total&&i.results.find((function(i){return i.source_id===a.topic_source_id}))||null)})).fail((function(a){Te.error({fn:getTopic,message:"Unable to get topic",data:a})}))}function getTopicCredentials(a){a&&a.id&&$.ajax({url:"https://orgbook.gov.bc.ca/api/v4/topic/"+a.id+"/credential-set"}).done((function(a){!function updateBusinessNumberField(a,i){var d=i.find((function(a){return"business_number.registries.ca"===a.credential_type.description})),p=document.querySelector("#quartech_businessregistrationnumber");if(p&&d){var u=d.attributes.find((function(a){return"business_number"===a.type}));p.value=u&&u.value||"",$(p).trigger("change")}}(0,a&&a.length&&a.reduce((function(a,i){return a.concat(i.credentials.filter((function(a){return a.id===i.latest_credential_id})))}),[]).filter((function(a){return!a.revoked})))})).fail((function(a){Te.error({fn:getTopicCredentials,message:"Unable to get topic credentials",data:a})}))}function setShowOrHideTipNotice(){showOrHideTipNotice(),$("#quartech_tipreportenrolled").on("change",(function(){showOrHideTipNotice()})),$("#quartech_agriprogramsubscriber").on("change",(function(){showOrHideTipNotice()}))}function showOrHideTipNotice(){var a,i,d=null===(a=document.querySelector("#quartech_agriprogramsubscriber"))||void 0===a?void 0:a.value,p=null===(i=document.querySelector("#quartech_tipreportenrolled"))||void 0===i?void 0:i.value,u=document.querySelector("#tipReportNotice");u&&("255550001"!==d||"255550002"!==p&&"255550000"!==p?$(u).css({display:"none"}):$(u).css({display:""}))}function processLocationData(a){return(null==a?void 0:a.value).reduce(((a,i)=>{const{quartech_name:d,quartech_RegionalDistrict:p}=i,{quartech_name:u}=null!=p?p:{quartech_name:"Other"};return a[u]?a[u].push(d):a[u]=[d],a}),{})}O.locations={processLocationData:processLocationData};var Ae=Logger("application/steps/project");function initOnChange_ActiviyOpenToPublic(){var a=$("#quartech_willthisactivitybeopentotheentirepublic");hideShow_WhyActiviyNotOpenToPublic(a.val()),Ae.info({fn:initOnChange_ActiviyOpenToPublic,message:"initOnChange_ActiviyOpenToPublic called."}),a.on("change",(function(){var a=$(this).val();Ae.info({fn:initOnChange_ActiviyOpenToPublic,message:"Selected Value: ".concat(a)}),hideShow_WhyActiviyNotOpenToPublic(a)}))}function hideShow_WhyActiviyNotOpenToPublic(a){a===w?($("#quartech_allactivitiesmustbeopentothepublicplease").parent().parent().css("display","none"),$("#quartech_allactivitiesmustbeopentothepublicplease").val("")):$("#quartech_allactivitiesmustbeopentothepublicplease").parent().parent().css("display","grid")}function setProjectStepRequiredFields(){configureFields();var a=getProgramAbbreviation();if(a&&a.includes("KTTP")){var i;initOnChange_DependentRequiredField({dependentOnValue:w,dependentOnElementTag:"quartech_hasthisorganizationreceivedkttpfundingin",requiredFieldTag:"quartech_ifyespleaseexplainwhenandforwhichactivity"}),initOnChange_DependentRequiredField({dependentOnValue:w,dependentOnElementTag:"quartech_hasthisorganizationreceivedfundingfrmother",requiredFieldTag:"quartech_ifyespleaseexplainwhenandfromwhichprogram"}),initOnChange_DependentRequiredField({dependentOnValue:w,dependentOnElementTag:"quartech_areyoucollaboratingwithanyotherorg",requiredFieldTag:"quartech_ifyespleaseprovidelegalbusinessorganization",shouldBeRequired:!1}),initOnChange_DependentRequiredField({dependentOnValue:w,dependentOnElementTag:"quartech_areyoucollaboratingwithanyotherorg",requiredFieldTag:"quartech_ifyespleaseprovideacontactname",shouldBeRequired:!1}),initOnChange_DependentRequiredField({dependentOnValue:w,dependentOnElementTag:"quartech_areyoucollaboratingwithanyotherorg",requiredFieldTag:"quartech_ifyespleaseprovideabriefbackgroundoutlinin",shouldBeRequired:!1}),initOnChange_DependentRequiredField({dependentOnValue:w,dependentOnElementTag:"quartech_areyouapplyingforatraceabilityknowledget",requiredFieldTag:"quartech_ifyespleaseexplainthetraceabilityactivityt"}),initOnChange_DependentRequiredField({dependentOnValue:w,dependentOnElementTag:"quartech_doestheactivitytakeplaceovermultipleday",requiredFieldTag:"quartech_ifyespleaseprovidetheadditionaldates"}),initOnChange_DependentRequiredField({dependentOnValue:_,dependentOnElementTag:"quartech_willthisactivitybeopentotheentirepublic",requiredFieldTag:"quartech_allactivitiesmustbeopentothepublicplease"}),initOnChange_DependentRequiredField({dependentOnValue:q,dependentOnElementTag:"quartech_pleaseselectthemostapplicableactivitytype",requiredFieldTag:"quartech_ifotherpleasedescribeyouractivitytype"});var d=document.querySelector("#quartech_prioritytopics_i");initOnChange_DependentRequiredField((null===(i=document.querySelector("#quartech_prioritytopics_i"))||void 0===i?void 0:i.querySelector('li[aria-label="Other for Priority Topic(s)"]'))?{dependentOnElementTag:"quartech_prioritytopics_i",requiredFieldTag:"quartech_otherprioritytopic",overrideTruthyClause:!0}:{dependentOnElementTag:"quartech_prioritytopics_i",requiredFieldTag:"quartech_otherprioritytopic",overrideTruthyClause:!1});var p=new MutationObserver((function(a){var i;null!==(i=document.querySelector("#quartech_prioritytopics_i"))&&void 0!==i&&i.querySelector('li[aria-label="Other for Priority Topic(s)"]')?$("#quartech_otherprioritytopic_label").is(":visible")||initOnChange_DependentRequiredField({dependentOnElementTag:"quartech_prioritytopics_i",requiredFieldTag:"quartech_otherprioritytopic",overrideTruthyClause:!0}):initOnChange_DependentRequiredField({dependentOnElementTag:"quartech_prioritytopics_i",requiredFieldTag:"quartech_otherprioritytopic",overrideTruthyClause:!1})}));d&&d.nodeType===Node.ELEMENT_NODE&&p.observe(d,{attributes:!0,childList:!0,characterData:!0}),initOnChange_DependentRequiredField({dependentOnValue:q,dependentOnElementTag:"quartech_activitypurpose",requiredFieldTag:"quartech_ifotherpleasedescribetheactivitypurpose"}),initOnChange_DependentRequiredField({dependentOnValue:w,dependentOnElementTag:"quartech_theprocessoflearningandprocessingknowledge",requiredFieldTag:"quartech_adulteducationandknowlegetransferdescript"})}if(a&&"NEFBA"===a){document.querySelector("#quartech_businessgoals_note")||addTextAboveField("quartech_businessgoals","
Note: Reimbursement for program costs will not be distributed unless you submit a complete new or updated business plan by March 1, 2024.

"),initOnChange_DependentRequiredField({dependentOnValue:"255550000",dependentOnElementTag:"quartech_completingcategory",requiredFieldTag:"quartech_stepstocompletethebusinessplan"}),initOnChange_DependentRequiredField({dependentOnValue:"255550001",dependentOnElementTag:"quartech_completingcategory",requiredFieldTag:"quartech_businessconsultantinformation"}),document.querySelector("#quartech_bciaregisteredconsultant_note")||addTextAboveField("quartech_bciaregisteredconsultant","
Note: The consultant must be registered with BCIA or as a CPA. Please select another consultant if they are not registered with either. See the Program Guide for more information.

"),document.querySelector("#quartech_nefba_project_step_note")||$("#EntityFormView > div.tab.clearfix > div > div").append('\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
');var u=document.querySelector("#quartech_completingcategory").value,g="255550001";u===g?(shouldRequireDependentField({shouldBeRequired:!0,requiredFieldTag:"quartech_bciaregisteredconsultant"}),setBciaOnChange()):(shouldRequireDependentField({shouldBeRequired:!1,requiredFieldTag:"quartech_bciaregisteredconsultant"}),shouldRequireDependentField({shouldBeRequired:!1,requiredFieldTag:"quartech_cpaconsultant"}),$("#quartech_bciaregisteredconsultant").off("change")),$("#quartech_completingcategory").on("change",(function(){document.querySelector("#quartech_completingcategory").value===g?(shouldRequireDependentField({shouldBeRequired:!0,requiredFieldTag:"quartech_bciaregisteredconsultant"}),setBciaOnChange()):(shouldRequireDependentField({shouldBeRequired:!1,requiredFieldTag:"quartech_bciaregisteredconsultant"}),shouldRequireDependentField({shouldBeRequired:!1,requiredFieldTag:"quartech_cpaconsultant"}),$("#quartech_bciaregisteredconsultant").off("change"))}))}if(a.includes("ABPP")||"NEFBA"===a){var h=$('fieldset[aria-label="Organization Information"]');h&&h.css("display","none");var f=$('fieldset[aria-label="Collaborating Organization Information"]');f&&f.css("display","none");var m=$('fieldset[aria-label="Activity Information"]');m&&m.css("display","none")}if(a&&a.includes("ABPP")){var v="ABPP1"===a?"event/training":"project";document.querySelector("#activityStartDateNotice")||addTextBelowField("quartech_whenistheprojectstartdate",'
\n Your '.concat(v," may have a delayed start date. However, all ").concat(v,"s must be submitted 90 days after the start date, unless an extension of the ").concat(v," has been granted by the Program Manager. Applications to extend any ").concat(v," will be considered on a case-by-case basis.\n
")),"ABPP2"===a&&(document.querySelector("#activityEndDateNotice")||addTextBelowField("quartech_activityenddate",'
\n Consultants must submit the '.concat(v," report to the Applicant for review and feedback at least two weeks prior to the ").concat(v," end date. Revisions requested by the Applicant must be completed by the Consultant and approved by the Applicant prior to the final submission to the program.\n
")))}"ABBP1"===getProgramAbbreviation()&&($('fieldset[aria-label="Program Category"]').css("display","none"),$('fieldset[aria-label="Consultant Information"]').css("display","none")),"ABPP2"===getProgramAbbreviation()&&(document.querySelector("#consultantNotice")||addTextAboveField("quartech_consultantcompanyname",'
\n **Please note that the Ministry reserves the right to refuse projects submitted with consultants who are not considered to be in good standing with the Ministry. Applications with unacceptable consultants listed will be held or waitlisted and the applicants will be given an opportunity to find an acceptable consultant. \n
'),document.querySelector("#moreThan10PercentNotice")||addTextBelowField("quartech_consultantcompletingoverlimit",'
\n **Please note that supporting consultants may not complete more than 40% of the proposed project. \n
'))}function setBciaOnChange(){$("#quartech_bciaregisteredconsultant").on("change",(function(){"255550002"===document.querySelector("#quartech_bciaregisteredconsultant").value?shouldRequireDependentField({shouldBeRequired:!0,requiredFieldTag:"quartech_cpaconsultant",setRequiredFieldsFunc:setProjectStepRequiredFields}):(shouldRequireDependentField({shouldBeRequired:!1,requiredFieldTag:"quartech_cpaconsultant",setRequiredFieldsFunc:setProjectStepRequiredFields}),$("#quartech_cpaconsultant").off("change"))}))}function setSingleOrGroupApplicant(){if(document.querySelector("#quartech_singleorgroupapplication").value===T){shouldRequireDependentField({shouldBeRequired:!0,requiredFieldTag:"quartech_coapplicatntsnames",setRequiredFieldsFunc:setProjectStepRequiredFields,disableRequiredProp:!0});var a=document.querySelector("#groupApplicationNotice");a?$(a).css({display:""}):addTextAboveField("quartech_coapplicatntsnames",'
\n If applying for a group project, please ensure all participants submit their own applications and indicate co-applicants as part of the application process.\n
')}else{shouldRequireDependentField({shouldBeRequired:!1,requiredFieldTag:"quartech_coapplicatntsnames",setRequiredFieldsFunc:setProjectStepRequiredFields,disableRequiredProp:!0});var i=document.querySelector("#groupApplicationNotice");i&&$(i).css({display:"none"})}}function setupChosen(){Ae.info({fn:setupChosen,message:"setting up chosen..."}),$(".chosen-select").chosen(),$(".chosen-select-deselect").chosen({allow_single_deselect:!0});var a=$("#quartech_venuelocationcitytownetcoronlinesoftwar").val();if(a){var i=a.split(", ");$(".chosen-select").val(i),$(".chosen-select").trigger("chosen:updated")}var d=document.getElementById("quartech_venuelocationcitytownetcoronlinesoftwar").closest("tr"),p=new MutationObserver((function(a){var i;"none"===(null==d||null===(i=d.style)||void 0===i?void 0:i.display)&&($(".chosen-select").val([]),$(".chosen-select").trigger("chosen:updated"))}));d&&d.nodeType===Node.ELEMENT_NODE&&p.observe(d,{attributes:!0,attributeFilter:["style"]}),$(".chosen-select").on("change",(function(){setFieldValue("quartech_venuelocationcitytownetcoronlinesoftwar",$(".chosen-select").val().join(", "))})),setupTooltip({name:"quartech_venuelocationcitytownetcoronlinesoftwar",tooltipText:"Project locations in addition to what you have provided in the question above",tooltipTargetElementId:"additionalLocationControl_chosen"}),Ae.info({fn:setupChosen,message:"successfully setup chosen..."})}function setShowOrHideEnvFarmPlanNotice(){showOrHideEnvFarmPlanNotice(),$("#quartech_tipreportenrolled").on("change",(function(){showOrHideEnvFarmPlanNotice()}))}function showOrHideEnvFarmPlanNotice(){var a,i=null===(a=document.querySelector("#quartech_statementofcompletionfromefpp"))||void 0===a?void 0:a.value,d=document.querySelector("#envFarmPlanNotice");d&&("255550001"===i?$(d).css({display:""}):$(d).css({display:"none"}))}var $e=Logger("application/steps/demographicInfo");function customizeDemographicInfoStep(a){$e.info({fn:customizeDemographicInfoStep,message:"Start customizing demographic info step, quartech_disabledchefsdemographicinfo: ".concat(null==a?void 0:a.quartech_disabledchefsdemographicinfo)}),configureFields(),null!=a&&a.quartech_disabledchefsdemographicinfo?(function addDemographicDataDescriptionOldVersionForABPP(){var a=document.createElement("div"),i=function getProgramEmailAddress(){var a;const i=localStorage.getItem("programData");return null===(a=JSON.parse(i))||void 0===a?void 0:a.quartech_programemailaddress}();a.innerHTML="

The Province of British Columbia supports inclusive and increased representation of underrepresented groups. By providing the information below, you are helping to improve the delivery of programming. At this time, the questions focus on three identity groups, and do not cover all potential groups who are underrepresented in the agriculture sector. We plan to expand the focus to other underrepresented groups in future.

"+'

Your personal information is collected under section 26(c) and 26(e) of the Freedom of Information and Protection of Privacy Act for the purposes of evaluating applications and for the planning and evaluating of the S-CAP Ministry Program. The demographic information you provide is voluntary and will not be used to assess your eligibility for this program. Each individual understands the purposes of the collection, use, and disclosure of their demographic personal information. The information you provide will be shared with the federal government to fulfill the provincial obligations under the Sustainable Canadian Agricultural Partnership (S-CAP) bilateral agreement. It may be combined with other survey or administrative data sources and used for statistical, research and evaluation purposes. If any information is published, your responses will be combined with the responses of others so that you cannot be identified. If you have any questions about the collection of your information, please contact the program manager at ').concat(i,".

")+'

Required Field *

',$("[data-name='DemographicData_Tab1']").parent().prepend(a)}(),function addViewExampleTo_Q1a(){var a=document.createElement("div");a.innerHTML='\n
\n
\n \n
\n
\n As an example, a company has 4 owners:\n
✍ 1 owner identifies as First Nation and a woman and owns 10% of the business.\n
✍ 1 owner identifies as a youth (40 or younger) and as Indigenous but the applicant is not aware of which specific Indigenous group this owner identifies with. This owner owns 50% of the business.\n
✍ 2 identify as non-Indigenous men over 40 and each owns 10% of the business.\n
✍ In this case, you would enter 10% for \'First Nations\', 10% for \'women\', 50% for \'youth\', 50% for \'Indigenous - not specified\', and 20% for \'none of the above groups\'. The numbers could add up to more than 100% - that\'s fine!\n
\n
\n
\n
\n
\n ',$("[data-name='Q1a_Section']").parent().prepend(a)}(),initOnChange_Question1_SoleProprietorshipOrGeneralPartnership(),initOnChange_Question2_Re_GoverningBoard(),initOnChange_Question2b_Re_OrganizationType(),function initOnChange_Question4_DoesYourOrganizationTargetAnyGroups(){var a,i="#quartech_doesyourorganizationtargetanyofthegroups_Container",d=$(i).find(".msos-option"),p=$(i).find("li>>input.msos-checkbox"),u=null===(a=d.filter((function(a){return d[a].innerText.includes("None")})))||void 0===a?void 0:a[0];$(u).on("click",(function(){var a=p.filter((function(a){return p[a].checked&&!p[a].ariaLabel.includes("None")}));a.length>0&&a.trigger("change",!1)}));var g=d.filter((function(a){return!d[a].innerText.includes("None")}));$(g).on("click",(function(){var a=p.filter((function(a){return p[a].checked&&p[a].ariaLabel.includes("None")}));a.length>0&&a.trigger("change",!1)}))}(),function addDemographicInfoPercentageColumnTitle(){$("#EntityFormView > div.tab.clearfix > div > div > fieldset:nth-child(3) > table > tbody").prepend('
Percentage of business shares owned
')}()):function showChefsIntegration(){(function addDemographicDataDescription(){var a=document.createElement("div");a.innerHTML="

Demographic Data Collection

\n

The Province of British Columbia supports inclusive and increased representation of underrepresented groups. By participating in the survey below, you are helping to improve the delivery of programming. At this time, the questions focus on three identity groups (Indigenous, women and youth), and do not cover all potential groups who are underrepresented in the agriculture sector. We plan to expand the focus to other underrepresented groups in future.

\n

The survey is conducted independently of the funding program to which you are applying, and your survey responses will not be included in your funding application. If you wish to save a copy of your survey responses, you will have the option of emailing it to yourself upon completion. Please see the top of the survey form for instructions on how to receive a copy by email.

",$("[data-name='DemographicData_Tab1']").parent().prepend(a)})(),function hideAllStepSections(){$("fieldset > table").parent().css("display","none")}(),$("[data-name='DemographicInfoChefsSubmissionSection']").parent().css("display","block"),addDemographicInfoChefsIframe()}()}function initOnChange_Question1_SoleProprietorshipOrGeneralPartnership(){var a=$("#quartech_question1reownerproprietorshiporparnership");hideShow_for_Question1_SoleProprietorshipOrGeneralPartnership(a.val()),$e.info({fn:initOnChange_Question1_SoleProprietorshipOrGeneralPartnership,message:"initOnChangeQuestion1 called."}),a.on("change",(function(){var a=$(this).val();$e.info({fn:initOnChange_Question1_SoleProprietorshipOrGeneralPartnership,message:"Selected Value: ".concat(a)}),hideShow_for_Question1_SoleProprietorshipOrGeneralPartnership(a)}))}function hideShow_for_Question1_SoleProprietorshipOrGeneralPartnership(a){var i="none",d="none",p="none";a===w?(i="block",d="none",p="none",$("#quartech_question2regoverningboard").prop("selectedIndex",0),$("#quartech_question2breorganizationtype").prop("selectedIndex",0),$("#quartech_numberofmembersofthegoverningbody").val(""),$("#quartech_numberofmembersofthegoverningbody").parent().parent().parent().css("display","none"),$("[data-name='Q2c_Section']").parent().css("display","none"),clearQuestion2dAnswers(),$(".msos-selecteditems-container ul li").remove()):a===_?(i="none",d="block",p="block",clearQuestion1abcAnswers()):(clearQuestion1abcAnswers(),$("#quartech_question2regoverningboard").prop("selectedIndex",0),$("#quartech_question2breorganizationtype").prop("selectedIndex",0),$("#quartech_numberofmembersofthegoverningbody").val(""),clearQuestion2dAnswers(),$("#quartech_numberofmembersofthegoverningbody").parent().parent().parent().css("display","none"),$("[data-name='Q2c_Section']").parent().css("display","none"),$(".msos-selecteditems-container ul li").remove()),$("[data-name='Q1a_Section']").parent().css("display",i),$("[data-name='Q1b_Q1c_Section']").parent().css("display",i),$("#quartech_question2breorganizationtype").parent().parent().parent().css("display","none"),$("#quartech_numberofmembersofthegoverningbody").parent().parent().parent().css("display","none"),$("[data-name='Q2_Section']").parent().css("display",d),$("[data-name='Q3_section']").parent().css("display",p),validateDemographicInfoRequiredFields()}function clearQuestion1abcAnswers(){$("#quartech_firstnationssharepercentage").val(""),$("#quartech_inukinuitsharepercentage").val(""),$("#quartech_mtissharepercentage").val(""),$("#quartech_indigenoussharepercentage").val(""),$("#quartech_womensharepercentage").val(""),$("#quartech_youth40orundersharepercentage").val(""),$("#quartech_nonindiginousnonwomennonyouthshare").val(""),$("#quartech_unabletoansweridentifysharepercentage").val(""),$("#quartech_newagricultureentrantssharepercentage").val(""),$("#quartech_declinetoidentifypercentageshares").prop("checked",!1),$("#quartech_percentagesharesownedbynewentrants").val(""),$("#quartech_commentsondemographicsofbusinessowners").val("")}function clearQuestion2dAnswers(){$("#quartech_firstnationsgoverningbodymembers").val(""),$("#quartech_inukinuitgoverningbodymembers").val(""),$("#quartech_mtisgoverningbodymembers").val(""),$("#quartech_indigenousnotspecifiedgoverningbodymember").val(""),$("#quartech_womengoverningbodymembers").val(""),$("#quartech_youthgoverningbodymembers").val(""),$("#quartech_nonindiginousnonwomennonyouthgovbodymbrs").val(""),$("#quartech_question2dgoverningbodymembersunabletoanswer").val(""),$("#quartech_declinetoidentifygoverningbodymember").prop("checked",!1)}function initOnChange_Question2_Re_GoverningBoard(){var a=$("#quartech_question2regoverningboard");hideShow_for_Question2_Re_GoverningBoard(a.val()),$e.info({fn:initOnChange_Question2_Re_GoverningBoard,message:"initOnChange_Question2_Re_GoverningBoard called."}),a.on("change",(function(){var a=$(this).val();$e.info({fn:initOnChange_Question2_Re_GoverningBoard,message:"Selected Value: ".concat(a)}),hideShow_for_Question2_Re_GoverningBoard(a)}))}function hideShow_for_Question2_Re_GoverningBoard(a){var i="none";a===w?i="table-row":($("#quartech_question2breorganizationtype").prop("selectedIndex",0),$("#quartech_numberofmembersofthegoverningbody").val(""),clearQuestion2dAnswers()),$("#quartech_question2breorganizationtype").parent().parent().parent().css("display",i),$("#quartech_numberofmembersofthegoverningbody").parent().parent().parent().css("display","none"),$("[data-name='Q2c_Section']").parent().css("display","none"),validateDemographicInfoRequiredFields()}function initOnChange_Question2b_Re_OrganizationType(){var a=$("#quartech_question2breorganizationtype");hideShow_for_Question2b_Re_OrganizationType(a.val()),$e.info({fn:initOnChange_Question2b_Re_OrganizationType,message:"initOnChange_Question2b_Re_OrganizationType called."}),a.on("change",(function(){var a=$(this).val();$e.info({fn:initOnChange_Question2b_Re_OrganizationType,message:"Selected Value: ".concat(a)}),hideShow_for_Question2b_Re_OrganizationType(a)}))}function hideShow_for_Question2b_Re_OrganizationType(a){var i="none",d="none";a===_?(d="block",i="table-row"):clearQuestion2dAnswers(),$("#quartech_numberofmembersofthegoverningbody").parent().parent().parent().css("display",i),$("[data-name='Q2c_Section']").parent().css("display",d),validateDemographicInfoRequiredFields()}function addDemographicInfoChefsIframe(){return _addDemographicInfoChefsIframe.apply(this,arguments)}function _addDemographicInfoChefsIframe(){return(_addDemographicInfoChefsIframe=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(){var a,i,d,p,u,g,h;return _regeneratorRuntime().wrap((function _callee$(f){for(;;)switch(f.prev=f.next){case 0:if(null===(a=$("#quartech_chefssubmissionid"))||void 0===a||null===(a=a.closest("tr"))||void 0===a||a.css({display:"none"}),setFieldReadOnly("quartech_chefsconfirmationid"),d=null===(i=$("#quartech_chefssubmissionid"))||void 0===i?void 0:i.val(),p="",!d){f.next=8;break}p="https://submit.digital.gov.bc.ca/app/form/success?s=".concat(d),f.next=15;break;case 8:return f.next=10,getEnvVars();case 10:u=f.sent,(g=u.quartech_ChefsDemographicDataFormId)||alert("Bad config: Applicant Portal Config should contain the ChefsDemographicDataFormId element"),p="https://submit.digital.gov.bc.ca/app/form/submit?f=".concat(g),window.addEventListener("message",(function(a){if("https://submit.digital.gov.bc.ca"==a.origin&&a.data.indexOf("submissionId")>-1){var i=JSON.parse(a.data);$e.info({fn:addDemographicInfoChefsIframe,message:"received submissionId: "+i.submissionId}),$("#quartech_chefssubmissionid").val(i.submissionId),setFieldValue("quartech_chefsconfirmationid",i.submissionId.substring(0,8).toUpperCase())}}));case 15:(h=document.createElement("div")).innerHTML="
'),$("#quartech_chefsconfirmationid_label").parent().parent().prepend(h);case 19:case"end":return f.stop()}}),_callee)})))).apply(this,arguments)}var Oe=new Logger("steps/documents");function customizeDocumentsStep$1(){Oe.info({fn:customizeDocumentsStep$1,message:"Start customizing documents step"}),configureFields();var a=getProgramAbbreviation();if(Oe.info({fn:customizeDocumentsStep$1,message:"Configuring documents label for programAbbreviation: ".concat(a)}),a&&a.includes("ABPP")){var i="";"ABPP1"===a&&(i="\n
\n

\n
    \n
  • Event/training budget (if not outlined in Deliverables & Budget tab)
  • \n
  • \n Verification of the last year of farming income (T2042, T1273, or Schedule 125 - \n Farm Revenue) detailing sales by commodity revenue code) or business income \n if applying as a food processor\n
  • \n
  • Direct Deposit Application (template available on program webpage)
  • \n
\n
\n "),"ABPP2"===a&&(i='\n
\n

\n
    \n
  • Project budget
  • \n
  • \n Consultant resume\n
  • \n
  • Supporting consultant resume (if applicable)
  • \n
  • Verification of the last year of farming income
  • \n
  • Direct Deposit Application (template available on program webpage)
  • \n
\n
\n ');var d=document.querySelector("#quartech_relatedquotesandplans_label");Oe.info({fn:customizeDocumentsStep$1,message:"Setting documents label html for fileUploadLabel: ".concat(d)}),$(d).after(i)}}function addNewAppSystemNotice(){var a,i=document.createElement("div");i.id="new_app_system_notice_div",i.style="float: left;";var d=null===(a=getGlobalConfigData())||void 0===a?void 0:a.SystemNotice;i.innerHTML=d,$("#NextButton").parent().parent().parent().append(i)}var Ee=Logger("application/application");function updatePageForSelectedProgram$1(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(a||(a=getProgramId()),!a&&"complete"!==i.readyState)return Ee.info({fn:updatePageForSelectedProgram$1,message:"Could not find programid, retry when DOM readyState is comlete",data:{readyState:i.readyState}}),void onDocumentReadyState((function(){updatePageForSelectedProgram$1()}));var d=getCurrentStep();if(!a||"UnknownStep"===d)return hideLoadingAnimation(),void Ee.error({fn:updatePageForSelectedProgram$1,message:"Missing programid, or unknown current step",data:{programid:a,currentStep:d}});Ee.info({fn:updatePageForSelectedProgram$1,message:"Retrieving Program data for the selected programid querystring: ".concat(a)}),getApplicationFormData({programId:a,beforeSend:function beforeSend(){Ee.info({fn:updatePageForSelectedProgram$1,message:"clear any cached data from previous page loads"}),localStorage.clear()},onSuccess:function onSuccess(a,i,d){a&&(Ee.info({fn:updatePageForSelectedProgram$1,message:"Retrieved Program data:",data:a}),localStorage.setItem("programData",JSON.stringify(a)),Ee.info({fn:updatePageForSelectedProgram$1,message:"Update application page with the program data."}),updateFormStepForSelectedProgram(a),hideLoadingAnimation(),validateRequiredFields(),addFormDataOnClickHandler())}})}function updateFormStepForSelectedProgram(a){Ee.info({fn:updateFormStepForSelectedProgram,message:"Begin updating form step for program"}),function populateContentForSelectedProgramStream$1(a){$("#page-title").text(a.quartech_portalapplicationpagetitle),$("#page-subtitle").text(a.quartech_portalapplicationpagesubtitle),$("#page-description").html(a.quartech_portalapplicationpagedescription),$("#quartech_program").val()||function populateProgramLookup(a,i){$("#quartech_program").val(a),$("#quartech_program_name").val(i),$("#quartech_program_entityname").val("msgov_program")}(a.msgov_programid,a.msgov_programname)}(a);var i=getProgramAbbreviation();switch(i&&"NEFBA"===i?($("div[id*='ProgressIndicator'] li:contains('Deliverables & Budget')").css("display","none"),$("div[id*='ProgressIndicator'] li:contains('Documents')").css("display","none")):i&&i.includes("KTTP")&&($("div[id*='ProgressIndicator'] li:contains('Documents')").css("display","none"),$("div[id*='ProgressIndicator'] li:contains('Eligibility')").css("display","none")),getCurrentStep()){case m.ApplicantInfo:!function customizeApplicantInfoStep$1(){!function setupApplicantInfoStepFields(){configureFields();var a=getProgramAbbreviation();a&&"NEFBA"===a&&(initOnChange_DependentRequiredField({dependentOnValue:"255550001",dependentOnElementTag:"quartech_fillingfarmingincomeontaxreturn",requiredFieldTag:"quartech_firstyearclaimedfarmingincome"}),initOnChange_DependentRequiredField({dependentOnValue:"255550000",dependentOnElementTag:"quartech_fillingfarmingincomeontaxreturn",requiredFieldTag:"quartech_firstyearfarmoperationgeneratingrevenue"})),a&&a.includes("ABPP")&&(document.querySelector("#tipReportNotice")||addTextBelowField("quartech_tipreportenrolled",'
\n The TIP report is a free, simplified cash-basis farm financial analysis, which provides you with a cost of production (COP) report to compare your own farm’s current year (income and expenses) to your previous 5-year average and to benchmarks with other farms of similar type and income range: Towards Increased Profits (TIP) report - Province of British Columbia (gov.bc.ca)​.\n
'),initOnChange_DependentRequiredField({dependentOnValue:"255550001",dependentOnElementTag:"quartech_agriprogramsubscriber",requiredFieldTag:"quartech_tipreportenrolled",customFunc:setShowOrHideTipNotice}),setShowOrHideTipNotice()),a&&(a.includes("ABPP")||"NEFBA"===a||"NEFBA2"===a)&&(addTextAboveField("quartech_indigenousapplicant","
The Province is committed to supporting the success of Indigenous businesses in the agriculture and food sector. We understand that Indigenous businesses may have distinct characteristics reflecting regulatory, operational, cultural, and other factors. We aim for flexibility in our program delivery to reduce barriers and ensure the accessibility of our programs. If you are interested in applying to the Program but have questions about the application process or eligibility criteria, please contact Program staff at Agribusiness@gov.bc.ca

"),initOnChange_DependentRequiredField({dependentOnValue:"255550001",dependentOnElementTag:"quartech_recipienttype",requiredFieldTag:"quartech_commodity"}),initOnChange_DependentRequiredField({dependentOnValue:"255550001",dependentOnElementTag:"quartech_recipienttype",requiredFieldTag:"quartech_othercommoditiesproducedharvested",disableRequiredProp:!0}),initOnChange_DependentRequiredField({dependentOnValue:"255550002",dependentOnElementTag:"quartech_recipienttype",requiredFieldTag:"quartech_primarilyprocess"}),initOnChange_DependentRequiredField({dependentOnValue:"255550002",dependentOnElementTag:"quartech_recipienttype",requiredFieldTag:"quartech_otherproductsprocessed",disableRequiredProp:!0})),$("#quartech_recipienttype").on("change",(function(){$("#quartech_commodity_name").val(""),$("#quartech_primarilyprocess_name").val(""),$("#quartech_othercommoditiesproducedharvested_i .msos-selecteditems-container ul li").remove(),$("#quartech_otherproductsprocessed_i .msos-selecteditems-container ul li").remove()}))}(),initOnChange_PreviouslyReceivedKttpFunding(),initOnChange_OrganizationReceivedFundingFromBC(),initOnChange_IsCollaboratingWithOtherOrganizationQuestion(),initOnChange_ActivityOverMultipleDays(),initOnChange_AdaptedEventForAdultLearning(),function initOrgNameAutocomplete(){var a=document.querySelector("#quartech_legalbusinessororganizationname");a&&useScript("jqueryui",(function(){$(a).autocomplete({source:function source(a,i){getOrgbookAutocompleteData({searchStr:a.term,onSuccess:function onSuccess(a){var d=a.total?a.results:[];i(d)}})},minLength:2,select:function select(a,i){$("#quartech_nocragstnumber").prop("checked")||getTopic(i.item)}})}))}(),function customizeTypesOfBusinessOrganization(){(function hideTypesOfBusinessOrganization(){var a,i=null===(a=getProgramData())||void 0===a?void 0:a.quartech_typesofbusinesstodisplay;if(i){var d=JSON.parse(i);d&&$("#quartech_recipienttype option").each((function(){var a=this.value;""!=a&&null==d[a]&&(this.hidden=!0)}))}})(),function addTooltipsToTypesOfBusinessOrganization(){var a,i=null===(a=getGlobalConfigData())||void 0===a?void 0:a.TypeOfBusiness_ToolTips;i&&$("#quartech_recipienttype option").each((function(){var a=this.value,d=i[a];d&&(this.title=d.Tooltip)}))}()}(),getProgramAbbreviation().includes("ABPP")&&function customizeApplicantInfoStepForABPP(){addTextAboveField("quartech_businessdescription",'
\n
Please provide a brief description of your business e.g.,
\n
    \n
  • For Primary Producer - farm size in production in units such as acres, metres squared, and number and type of animals, marketing channels (farm gate, wholesale, retail/use of social media)
  • \n
  • OR For Processor - size of processing area in units such as square feet or metres, number and type of B.C. products used and/or produced, marketing channels (direct, wholesale, retail/use of social media)
  • \n
\n
')}(),"NEFBA"===getProgramAbbreviation()&&function customizeApplicantInfoStepForNEFBA(){var a=$('fieldset[aria-label="Business Overview"]');a&&a.css("display","none")}()}();break;case m.Eligibility:!function customizeEligibilityStep(){!function setupEligibilityStepFields(){configureFields();var a=getProgramAbbreviation();a&&"NEFBA2"===a&&(addHtmlToSection("eligibilitySection",'See program guide for the Phase 2 eligibility requirements: program guide

',"top"),document.querySelector("#envFarmPlanNotice")||addHtmlToSection("eligibilitySection",'\n
\n

Environmental Farm Plan Program

\n \n Participation in the EFP program is free and confidential. Applicants are encouraged to start the EFP process as soon as possible.\n \n
\n ',"bottom"),initOnChange_DependentRequiredField({dependentOnValue:"255550001",dependentOnElementTag:"quartech_statementofcompletionfromefpp",requiredFieldTag:"quartech_commitmenttoefp",customFunc:setShowOrHideEnvFarmPlanNotice}),setShowOrHideEnvFarmPlanNotice()),a&&(a.includes("ABPP")||"NEFBA"===a)&&addHtmlToSection("eligibilitySection","Please answer the following questions to confirm your eligibility for the program.
Note that applicants may be audited and must be able to demonstrate the validity of information provided in this application form.

","top"),a&&a.includes("ABPP")&&(initOnChange_DependentRequiredField({dependentOnValue:w,dependentOnElementTag:"quartech_abppsupportoverlimit",requiredFieldTag:"quartech_abppsupportoverlimitdetail"}),initOnChange_DependentRequiredField({dependentOnValue:w,dependentOnElementTag:"quartech_supportreceivedduringscap",requiredFieldTag:"quartech_supportduringscapdetails"})),a&&"NEFBA"===a&&initOnChange_DependentRequiredField({dependentOnValue:"255550001",dependentOnElementTag:"quartech_bcregisteredbusinessentity",requiredFieldTag:"quartech_committedbizregistrationbeforecompletion"})}()}();break;case m.Project:!function customizeProjectStep(a){setProjectStepRequiredFields(),function setProjectStepDependentRequiredFields(){var a,i=getProgramAbbreviation();i.includes("KTTP")&&(initOnChange_DependentRequiredField({dependentOnValue:A,dependentOnElementTag:"quartech_naicsindustry",requiredFieldTag:"quartech_ifotherpleasedescribecommodity"}),initOnChange_DependentRequiredField({dependentOnValueArray:["255550001","255550002"],dependentOnElementTag:"quartech_eventtype",requiredFieldTag:"quartech_projectlocation"}),initOnChange_DependentRequiredField({dependentOnValue:"255550001",dependentOnElementTag:"quartech_projecttakesplaceinotherplaces",requiredFieldTag:"quartech_venuelocationcitytownetcoronlinesoftwar"})),"ABPP2"===i&&(initOnChange_DependentRequiredField({dependentOnValue:w,dependentOnElementTag:"quartech_useofsupportingconsultant",requiredFieldTag:"quartech_consultantcompletingoverlimit"}),initOnChange_DependentRequiredField({dependentOnValue:w,dependentOnElementTag:"quartech_useofsupportingconsultant",requiredFieldTag:"quartech_supportingconsultantcompanyname"}),initOnChange_DependentRequiredField({dependentOnValue:w,dependentOnElementTag:"quartech_useofsupportingconsultant",requiredFieldTag:"quartech_supportingconsultantfullname"}),initOnChange_DependentRequiredField({dependentOnValue:w,dependentOnElementTag:"quartech_useofsupportingconsultant",requiredFieldTag:"quartech_supportingconsultantpositiontitle"}),initOnChange_DependentRequiredField({dependentOnValue:w,dependentOnElementTag:"quartech_useofsupportingconsultant",requiredFieldTag:"quartech_supportingconsultantrationale"}),setSingleOrGroupApplicant(),document.querySelector("#quartech_singleorgroupapplication")&&function setSingleOrGroupApplicantOnChange(){$("#quartech_singleorgroupapplication").on("change",(function(){setSingleOrGroupApplicant()}))}());var d=document.querySelector("#quartech_inordertocontinuouslyimprovecommunications_i");(null===(a=document.querySelector("#quartech_inordertocontinuouslyimprovecommunications_i"))||void 0===a?void 0:a.querySelector('li[aria-label="Other for In order to continuously improve communications"]'))?initOnChange_DependentRequiredField({dependentOnElementTag:"quartech_inordertocontinuouslyimprovecommunications_i",overrideTruthyClause:!0,requiredFieldTag:"quartech_ifotherpleasedescribe"}):initOnChange_DependentRequiredField({dependentOnElementTag:"quartech_inordertocontinuouslyimprovecommunications_i",overrideTruthyClause:!1,requiredFieldTag:"quartech_ifotherpleasedescribe"});var p=new MutationObserver((function(a){var i;null!==(i=document.querySelector("#quartech_inordertocontinuouslyimprovecommunications_i"))&&void 0!==i&&i.querySelector('li[aria-label="Other for In order to continuously improve communications"]')?$("#quartech_ifotherpleasedescribe_label").is(":visible")||initOnChange_DependentRequiredField({dependentOnElementTag:"quartech_inordertocontinuouslyimprovecommunications_i",overrideTruthyClause:!0,requiredFieldTag:"quartech_ifotherpleasedescribe"}):initOnChange_DependentRequiredField({dependentOnElementTag:"quartech_inordertocontinuouslyimprovecommunications_i",overrideTruthyClause:!1,requiredFieldTag:"quartech_ifotherpleasedescribe"})}));d&&d.nodeType===Node.ELEMENT_NODE&&p.observe(d,{attributes:!0,childList:!0,characterData:!0})}(),function displayLabelsForProjectStep(a){var i=JSON.parse(a.quartech_portalappfieldsdisplaynamesmapping);if(i)for(var d=0,p=Object.entries(i);d\n \n \n '),$("#".concat(d)).css({display:"none"}),Object.keys(p).forEach((function(a){var i=$('');p[a].forEach((function(a){$('