keys = [];
anyKeys = [];
userDetails = (userDetails || {});
userDetails.firstName = userDetails.firstName || ({"value":null}).value;
userDetails.lastName = userDetails.lastName || ({"value":null}).value;
userDetails.email = userDetails.email || ({"value":null}).value;
userDetails.phone = userDetails.phone || ({"value":null}).value;
userDetails.country = userDetails.country || ({"value":null}).value;
userDetails.birthDate = userDetails.birthDate || ({"value":null}).value;
$component('global').userDetails = userDetails;
resets = {};
restart = () => {
$db('shirah').write('saved-calculator-info-business', null).then(() => $$form($refs.removeCheckpointForm).submit());
};
resetDetails = () => {
let mapped = {};
Object.keys(resets).forEach((key) => (mapped[key] = resets[key]()));
setDetails(mapped);
};
resetDetail = (key) => {
const static = $static;
const value = ((key in $native(resets)) ? resets[key]() : null);
if (Array.isArray(value)){
if (Array.isArray(details[key]) && details[key].length == 0){
return;
}
$nextTick(() => (details[key] = value));
}
else{
details[key] = value;
}
static();
};
setDetails = (value) => {
const state = $component('global');
details = value;
state.calculatorDetails = null;
state.calculatorRecommendation = null;
};
resolveValue = (key, checkAny) => {
if (checkAny && anyKeys.includes(key)){
return 'any';
}
return (Array.isArray(details[key]) ? JSON.stringify(details[key]) : details[key]);
};
composeScenarioKey = (checkAny) => {
let scenarioKey = '';
keys.forEach((key) => {
if (key in $native(details) && ((Array.isArray(details[key]) && details[key].length != 0) || (!Array.isArray(details[key]) && details[key]))){
const value = resolveValue(key, checkAny);
scenarioKey = (scenarioKey ? `${scenarioKey}.` : scenarioKey);
scenarioKey += `${key}.${value}`;
}
});
return scenarioKey;
};
getResolvedUrl = () => {
return `/calculator/business/recommendations/${resolvedScenario}?email=${encodeURI(userDetails.email)}`;
};
getResolvedScenario = () => {
const activeKeys = keys.filter((key) => (key in $native(details) && ((Array.isArray(details[key]) && details[key].length != 0) || (!Array.isArray(details[key]) && details[key]))));
for (const scenario of scenarios){
let totalQuestions = Object.keys(scenario.questionsAndAnswers).length, matchedQuestions = 0;
for (const key of activeKeys){
if ((key in $native(scenario.questionsAndAnswers)) && (scenario.questionsAndAnswers[key] === 'any' || scenario.questionsAndAnswers[key] === details[key])){
matchedQuestions += 1;
}
else if (key in $native(scenario.questionsAndAnswers)){
matchedQuestions = 0;
break;
}
}
if (matchedQuestions == totalQuestions){
return scenario.value;
}
}
return null;
};
proceedToRecommendation = () => {
if (resolvedScenario){
const state = $component('global');
state.calculatorRecommendation = resolvedScenario;
state.calculatorDetails = details;
$nextTick(() => $$form($refs.checkpointForm).submit());
}
};
updateCalculatorSaveDisallowed = (disallowed) => {
if (!!disallowed != !!calculatorSaveDisallowed){
$db('shirah').write('calculator-save-disallowed', (calculatorSaveDisallowed = !!disallowed)).then(() => loadData());
}
};
userDetailsAreValid = () => {
const requiredKeys = ['firstName', 'lastName', 'email', 'phone', 'country', 'birthDate'];
for (const key of requiredKeys){
if (!(key in userDetails) || !userDetails[key]){
return false;
}
}
checkBirthDate();
if (!validBirthDate){
return false;
}
return true;
};
afterLoad = () => {
if (!userDetailsAreValid()){
return;
}
if (validEmail){
setProceed().then(() => proceedToRecommendation());
}
};
loadData = () => {
$db('shirah').read('saved-calculator-info-business').then((data) => {
if (!data){
ready = true;
$db('shirah').read('calculator-fields').then((fields) => {
loaded = true;
if (!fields){
return;
}
dbFields = fields;
userDetails.firstName = (userDetails.firstName || fields.userDetails.firstName);
userDetails.lastName = (userDetails.lastName || fields.userDetails.lastName);
userDetails.email = (userDetails.email || fields.userDetails.email);
userDetails.phone = (userDetails.phone || fields.userDetails.phone);
userDetails.country = (userDetails.country || fields.userDetails.country);
userDetails.birthDate = (userDetails.birthDate || fields.userDetails.birthDate);
afterLoad();
});
}
else{
calculatorSaveDisallowed = true;
loaded = true;
userDetails.firstName = userDetails.firstName || data.userDetails.firstName;
userDetails.lastName = userDetails.lastName || data.userDetails.lastName;
userDetails.email = userDetails.email || data.userDetails.email;
userDetails.phone = userDetails.phone || data.userDetails.phone;
userDetails.country = userDetails.country || data.userDetails.country;
userDetails.birthDate = userDetails.birthDate || data.userDetails.birthDate;
resolvedScenario = data.resolvedScenario;
afterLoad();
}
});
};
saveData = () => {
if (calculatorSaveDisallowed || !loaded){
return;
}
$db('shirah').write('calculator-fields', {
userDetails: $native(userDetails),
});
};
showVisibleTarge = () => {
showVisibleRequested = false;
visibleTarget && visibleTarget.scrollIntoView({
behavior: 'smooth',
block: 'end',
});
visibleIndex = -1;
visibleTarget = null;
};
setVisibleIndex = (index, target) => {
const static = $static;
if ((!visibleIndex && visibleIndex !== 0) || visibleIndex < index){
visibleIndex = index;
visibleTarget = target;
if (!showVisibleRequested){
showVisibleRequested = true;
$nextTick(() => showVisibleTarge());
}
}
static();
};
checkBirthDate = () => {
if (!loaded){
return;
}
const diff = (Date.now() - (userDetails.birthDate ? new Date(userDetails.birthDate) : Date.now())), ageDate = new Date(diff);
if (!(validBirthDate = $rel.ge((userDetails.age = Math.abs(ageDate.getUTCFullYear() - 1970)), 16))){
if (userDetails.birthDate !== $static(oldBirthDate)){
$alert.notify({
type: 'warning',
title: 'Invalid Date',
message: 'You must be 16 years or older to continue',
toast: true,
});
}
}
else{
details.age = ($rel.lt(userDetails.age, 30) ? '29' : '30');
}
oldBirthDate = userDetails.birthDate;
};
setProceed = (clicked) => {
if (proceed || proceeding || !clicked){
return Promise.resolve();
}
proceeding = true;
return new Promise((resolve) => {
afterUser = (data) => {
afterUser = null;
if ((data || {}).redirectUrl){
$component('modal').successCallback = () => {
proceeding = false;
proceed = true;
resolve();
};
$router.goto(data.redirectUrl);
}
else{
proceeding = false;
proceed = true;
resolve();
}
};
$$form($$scope(this.parentElement).userForm).submit();
});
};
validEmail = false;
oldValidEmail = validEmail;
$component('global').calculatorOptions = {};
userDetails && saveData();
resolvedScenario && setVisibleIndex(999, proceedButtonContainer);
emailCheckHandler = (isValid, hasPassword) => {
if (!(validEmail = (isValid || !hasPassword))){
oldValidEmail != validEmail && $alert.notify({
type: 'warning',
title: 'Account Exists',
message: `Account already exists.Please ${hasPassword ? 'sign in' : 'set your password'} to continue.`,
toast: true,
});
const email = encodeURI(userDetails.email);
authUrl = `modal://auth?email=${email}`;
passwordSet = hasPassword;
}
else{
authUrl = null;
if (loaded && isFirstCheck && userDetailsAreValid()){
setProceed().then(() => proceedToRecommendation());
}
}
isFirstCheck = false;
oldValidEmail = validEmail;
};
if ($static(oldEmail) !== userDetails.email){
oldEmail = userDetails.email;
userDetails.email && emailInput.validity.valid && $$form(emailForm).submit();
}
userDetails.birthDate;
checkBirthDate();
scenarios = [];
$nextTick(() => {
const joinedScenarios = {};
joinedScenarios[`status.${statusOptions[0]}.experience.any.industry.any.shared.any.assets.any.funds.299k`] = 'strategy-owner-insufficient';
joinedScenarios[`status.${statusOptions[0]}.experience.any.industry.any.shared.any.assets.any.funds.300k`] = 'strategy-owner';
joinedScenarios[`status.${statusOptions[0]}.experience.any.industry.any.shared.any.owners.any.assets.any.funds.299k`] = 'strategy-owner-insufficient';
joinedScenarios[`status.${statusOptions[0]}.experience.any.industry.any.shared.any.owners.any.assets.any.funds.300k`] = 'strategy-owner';
joinedScenarios[`status.${statusOptions[1]}.management_experience.any.industry.any.assets.any.funds.299k`] = 'strategy-management-insufficient';
joinedScenarios[`status.${statusOptions[1]}.management_experience.any.industry.any.any.assets.any.funds.300k`] = 'strategy-management';
joinedScenarios[`status.${statusOptions[2]}.startup_age.any.startup_industry.any.startup_shared.any.startup_assets.any.startup_funds.149k`] = 'strategy-startup-insufficient';
joinedScenarios[`status.${statusOptions[2]}.startup_age.any.startup_industry.any.startup_shared.any.startup_assets.any.startup_funds.150k`] = 'strategy-startup';
joinedScenarios[`status.${statusOptions[2]}.startup_age.any.startup_industry.any.startup_shared.any.startup_owners.any.startup_assets.any.startup_funds.149k`] = 'strategy-startup-insufficient';
joinedScenarios[`status.${statusOptions[2]}.startup_age.any.startup_industry.any.startup_shared.any.startup_owners.any.startup_assets.any.startup_funds.150k`] = 'strategy-startup';
joinedScenarios[`status.${statusOptions[3]}.self_employment_experience.any.self_employment_field.any.startup_assets.any.startup_funds.149k`] = 'strategy-self-insufficient';
joinedScenarios[`status.${statusOptions[3]}.self_employment_experience.any.self_employment_field.any.startup_assets.any.startup_funds.150k`] = 'strategy-self';
Object.entries(joinedScenarios).forEach(([key, value]) => {
const questionsAndAnswers = {}, questionAndAnswerPairs = key.split('.');
for (let i = 0; i < questionAndAnswerPairs.length; i += 2){
questionsAndAnswers[questionAndAnswerPairs[i]] = questionAndAnswerPairs[i + 1];
}
scenarios.push({
questionsAndAnswers,
value,
});
});
});
resetDetails();
resolvedScenario = getResolvedScenario();
if (oldResolvedScenario == resolvedScenario){
return;
}
oldResolvedScenario = resolvedScenario;
if (resolvedScenario){
$db('shirah').write('saved-calculator-info-business', {
resolvedScenario: resolvedScenario,
userDetails: $native(userDetails),
details: $native(details),
}).then(() => proceedToRecommendation());
}
else{
$db('shirah').write('saved-calculator-info-business', null);
}
$db('shirah').read('calculator-save-disallowed').then((disallowed) => {
calculatorSaveDisallowed = !!disallowed;
const state = $component('global');
if (state.calculatorRestart){
state.calculatorRestart = false;
state.userDetails = state.userDetails || {};
userDetails = userDetails || {};
userDetails.firstName = (userDetails.firstName || state.userDetails.firstName);
userDetails.lastName = (userDetails.lastName || state.userDetails.lastName);
userDetails.email = (userDetails.email || state.userDetails.email);
userDetails.phone = (userDetails.phone || state.userDetails.phone);
userDetails.country = (userDetails.country || state.userDetails.country);
userDetails.birthDate = (userDetails.birthDate || state.userDetails.birthDate);
restart();
}
!calculatorSaveDisallowed && !loaded && loadData();
});
Enter your email to continue
Before you get started, we require your email to ensure you can pick up from where you stop.
“Shirah has been an amazing partner on my journey of moving from Nigeria to Canada for studies. Honestly, I wasn’t sure how to get started with anything but after I went through Shirah’s Predictive Calculator, everything was clearer.”
Jasmin Nwankwo
keys.push('status');
statusOptions = [];
$component('global').calculatorOptions.statusOptions = statusOptions;
(details && (true)) && setVisibleIndex(0, this.parentElement);
keys.push('experience');
anyKeys.push('experience');
experienceOptions = [];
$component('global').calculatorOptions.experienceOptions = experienceOptions;
Please select which experience pertains to you
$scope.deselectAll = (except) => {
$$scope(this.parentElement).columns.forEach(column => ((column !== except) && ($$scope(column).checked = false)));
};
$parent.columns.push(this.parentElement);
statusOptions.push('Business Owner/Entrepreneur');
$parent.columns.push(this.parentElement);
statusOptions.push('Senior Manager, but willing to start/invest in a business in Canada');
$parent.columns.push(this.parentElement);
statusOptions.push('Tech Founder');
$parent.columns.push(this.parentElement);
statusOptions.push('Self employed Professional');
(details && (details.status === statusOptions[0])) && setVisibleIndex(1, this.parentElement);
keys.push('management_experience');
anyKeys.push('management_experience');
management_experienceOptions = [];
$component('global').calculatorOptions.management_experienceOptions = management_experienceOptions;
How many years of experience do you have running your business?
$scope.deselectAll = (except) => {
$$scope(this.parentElement).columns.forEach(column => ((column !== except) && ($$scope(column).checked = false)));
};
$parent.columns.push(this.parentElement);
experienceOptions.push('4');
$parent.columns.push(this.parentElement);
experienceOptions.push('5');
(details && (details.status === statusOptions[1])) && setVisibleIndex(2, this.parentElement);
keys.push('startup_age');
anyKeys.push('startup_age');
startup_ageOptions = [];
$component('global').calculatorOptions.startup_ageOptions = startup_ageOptions;
How many years of experience do you have in management capacity?
$scope.deselectAll = (except) => {
$$scope(this.parentElement).columns.forEach(column => ((column !== except) && ($$scope(column).checked = false)));
};
$parent.columns.push(this.parentElement);
management_experienceOptions.push('4');
$parent.columns.push(this.parentElement);
management_experienceOptions.push('5');
(details && (details.status === statusOptions[2])) && setVisibleIndex(3, this.parentElement);
keys.push('self_employment_experience');
anyKeys.push('self_employment_experience');
self_employment_experienceOptions = [];
$component('global').calculatorOptions.self_employment_experienceOptions = self_employment_experienceOptions;
How old is your startup or scaleup?
$scope.deselectAll = (except) => {
$$scope(this.parentElement).columns.forEach(column => ((column !== except) && ($$scope(column).checked = false)));
};
$parent.columns.push(this.parentElement);
startup_ageOptions.push('1');
$parent.columns.push(this.parentElement);
startup_ageOptions.push('2');
(details && (details.status === statusOptions[3])) && setVisibleIndex(4, this.parentElement);
keys.push('industry');
anyKeys.push('industry');
industryOptions = [];
$component('global').calculatorOptions.industryOptions = industryOptions;
How many years of self employment experience do you have?
$scope.deselectAll = (except) => {
$$scope(this.parentElement).columns.forEach(column => ((column !== except) && ($$scope(column).checked = false)));
};
$parent.columns.push(this.parentElement);
self_employment_experienceOptions.push('1');
$parent.columns.push(this.parentElement);
self_employment_experienceOptions.push('2');
resets.industry = () => [];
$scope.hide;
if (details && ($log.or(details.experience, details.management_experience)) && details['industry'] && details['industry'].length != 0){
nextHidden = !$scope.hide;
}
else if (details && ($log.or(details.experience, details.management_experience))){
nextHidden = false;
}
(details && ($log.or(details.experience, details.management_experience))) && setVisibleIndex(5, this.parentElement);
keys.push('startup_industry');
anyKeys.push('startup_industry');
startup_industryOptions = [];
$component('global').calculatorOptions.startup_industryOptions = startup_industryOptions;
What industry have you built your business endeavours in the last 10 years? (you can select more than one option)
$scope.deselectAll = (except) => {
$$scope(this.parentElement).columns.forEach(column => ((column !== except) && ($$scope(column).checked = false)));
};
$parent.columns.push(this.parentElement);
industryOptions.push('Manufacturing/Trading');
$parent.columns.push(this.parentElement);
industryOptions.push('Trading/Import/Export');
$parent.columns.push(this.parentElement);
industryOptions.push('Project Work (Builder/Construction etc.)');
$parent.columns.push(this.parentElement);
industryOptions.push('Wholesale/Retail Establishment');
$parent.columns.push(this.parentElement);
industryOptions.push('Agriculture and Related Sector');
$parent.columns.push(this.parentElement);
industryOptions.push('Consulting');
$parent.columns.push(this.parentElement);
industryOptions.push('Others');
resets.startup_industry = () => [];
$scope.hide;
if (details && (details.startup_age) && details['startup_industry'] && details['startup_industry'].length != 0){
nextHidden = !$scope.hide;
}
else if (details && (details.startup_age)){
nextHidden = false;
}
(details && (details.startup_age)) && setVisibleIndex(6, this.parentElement);
keys.push('self_employment_field');
anyKeys.push('self_employment_field');
self_employment_fieldOptions = [];
$component('global').calculatorOptions.self_employment_fieldOptions = self_employment_fieldOptions;
What industry is your Tech company in?
$scope.deselectAll = (except) => {
$$scope(this.parentElement).columns.forEach(column => ((column !== except) && ($$scope(column).checked = false)));
};
$parent.columns.push(this.parentElement);
startup_industryOptions.push('FinTech');
$parent.columns.push(this.parentElement);
startup_industryOptions.push('SaaS');
$parent.columns.push(this.parentElement);
startup_industryOptions.push('HealthTech');
$parent.columns.push(this.parentElement);
startup_industryOptions.push('EdTech');
$parent.columns.push(this.parentElement);
startup_industryOptions.push('Others');
resets.self_employment_field = () => [];
$scope.hide;
if (details && (details.self_employment_experience) && details['self_employment_field'] && details['self_employment_field'].length != 0){
nextHidden = !$scope.hide;
}
else if (details && (details.self_employment_experience)){
nextHidden = false;
}
(details && (details.self_employment_experience)) && setVisibleIndex(7, this.parentElement);
keys.push('shared');
anyKeys.push('shared');
sharedOptions = [];
$component('global').calculatorOptions.sharedOptions = sharedOptions;
What field do you have your experience over the last 5 years? (You can select more than one option)
$scope.deselectAll = (except) => {
$$scope(this.parentElement).columns.forEach(column => ((column !== except) && ($$scope(column).checked = false)));
};
$parent.columns.push(this.parentElement);
self_employment_fieldOptions.push('Librarians');
$parent.columns.push(this.parentElement);
self_employment_fieldOptions.push('Conservators and curators');
$parent.columns.push(this.parentElement);
self_employment_fieldOptions.push('Archivists');
$parent.columns.push(this.parentElement);
self_employment_fieldOptions.push('Authors and writers');
$parent.columns.push(this.parentElement);
self_employment_fieldOptions.push('Editors');
$parent.columns.push(this.parentElement);
self_employment_fieldOptions.push('Journalist');
(details && ($log.and(details.status === statusOptions[0], details.industry && details.industry.length != 0))) && setVisibleIndex(8, this.parentElement);
keys.push('startup_shared');
anyKeys.push('startup_shared');
startup_sharedOptions = [];
$component('global').calculatorOptions.startup_sharedOptions = startup_sharedOptions;
Is there more than one owner in your business?
$scope.deselectAll = (except) => {
$$scope(this.parentElement).columns.forEach(column => ((column !== except) && ($$scope(column).checked = false)));
};
$parent.columns.push(this.parentElement);
sharedOptions.push('yes');
$parent.columns.push(this.parentElement);
sharedOptions.push('no');
(details && ($log.and(details.startup_age, details.startup_industry && details.startup_industry.length != 0))) && setVisibleIndex(9, this.parentElement);
keys.push('owners');
anyKeys.push('owners');
ownersOptions = [];
$component('global').calculatorOptions.ownersOptions = ownersOptions;
Is there more than one founder in your startup/scaleup?
$scope.deselectAll = (except) => {
$$scope(this.parentElement).columns.forEach(column => ((column !== except) && ($$scope(column).checked = false)));
};
$parent.columns.push(this.parentElement);
startup_sharedOptions.push('yes');
$parent.columns.push(this.parentElement);
startup_sharedOptions.push('no');
(details && (details.shared === 'yes')) && setVisibleIndex(10, this.parentElement);
keys.push('startup_owners');
anyKeys.push('startup_owners');
startup_ownersOptions = [];
$component('global').calculatorOptions.startup_ownersOptions = startup_ownersOptions;
How many other business owners?
$scope.deselectAll = (except) => {
$$scope(this.parentElement).columns.forEach(column => ((column !== except) && ($$scope(column).checked = false)));
};
$parent.columns.push(this.parentElement);
ownersOptions.push('1');
$parent.columns.push(this.parentElement);
ownersOptions.push('2');
(details && (details.startup_shared === 'yes')) && setVisibleIndex(11, this.parentElement);
keys.push('assets');
anyKeys.push('assets');
assetsOptions = [];
$component('global').calculatorOptions.assetsOptions = assetsOptions;
How many co-founders do you have?
$scope.deselectAll = (except) => {
$$scope(this.parentElement).columns.forEach(column => ((column !== except) && ($$scope(column).checked = false)));
};
$parent.columns.push(this.parentElement);
startup_ownersOptions.push('1');
$parent.columns.push(this.parentElement);
startup_ownersOptions.push('2');
$parent.columns.push(this.parentElement);
startup_ownersOptions.push('3');
$parent.columns.push(this.parentElement);
startup_ownersOptions.push('4');
(details && ($log.or(details.shared === 'no', details.owners, $log.and(details.status === statusOptions[1], details.industry && details.industry.length != 0)))) && setVisibleIndex(12, this.parentElement);
keys.push('startup_assets');
anyKeys.push('startup_assets');
startup_assetsOptions = [];
$component('global').calculatorOptions.startup_assetsOptions = startup_assetsOptions;
Between you and your spouse (if applicable), please calculate the total value of your assets, including movable, immovable properties, cash in the bank, mutual funds, fixed deposits, etc. Please calculate in Canada dollars
$scope.deselectAll = (except) => {
$$scope(this.parentElement).columns.forEach(column => ((column !== except) && ($$scope(column).checked = false)));
};
$parent.columns.push(this.parentElement);
assetsOptions.push('299k');
$parent.columns.push(this.parentElement);
assetsOptions.push('300k');
(details && ($log.or(details.startup_shared === 'no', details.startup_owners, (details.self_employment_field && details.self_employment_field.length != 0)))) && setVisibleIndex(13, this.parentElement);
keys.push('funds');
fundsOptions = [];
$component('global').calculatorOptions.fundsOptions = fundsOptions;
Between you and your spouse (if applicable), please calculate the total value of your assets, including movable, immovable properties, cash in the bank, mutual funds, fixed deposits, etc. Please calculate in Canada dollars
$scope.deselectAll = (except) => {
$$scope(this.parentElement).columns.forEach(column => ((column !== except) && ($$scope(column).checked = false)));
};
$parent.columns.push(this.parentElement);
startup_assetsOptions.push('149k');
$parent.columns.push(this.parentElement);
startup_assetsOptions.push('150k');
(details && (details.assets)) && setVisibleIndex(14, this.parentElement);
keys.push('startup_funds');
startup_fundsOptions = [];
$component('global').calculatorOptions.startup_fundsOptions = startup_fundsOptions;
How much fund is available to invest in Canada from the total net-worth you reported above or business revenue or funds raised from investors?
$scope.deselectAll = (except) => {
$$scope(this.parentElement).columns.forEach(column => ((column !== except) && ($$scope(column).checked = false)));
};
$parent.columns.push(this.parentElement);
fundsOptions.push('299k');
$parent.columns.push(this.parentElement);
fundsOptions.push('300k');
(details && (details.startup_assets)) && setVisibleIndex(15, this.parentElement);
How much fund is available to invest in Canada from the total net-worth you reported above or business revenue or funds raised from investors?
$scope.deselectAll = (except) => {
$$scope(this.parentElement).columns.forEach(column => ((column !== except) && ($$scope(column).checked = false)));
};
$parent.columns.push(this.parentElement);
startup_fundsOptions.push('149k');
$parent.columns.push(this.parentElement);
startup_fundsOptions.push('150k');