{"version":3,"sources":["webpack:///./src/services/grant-directory-service.ts","webpack:///./src/shared/utils/scroll-into-view.ts","webpack:///./node_modules/clamp-js/clamp.js","webpack:///./node_modules/readmore-js/readmore.js","webpack:///./assets/images/accountSelectionList.png","webpack:///./src/shared/utils/responsive-layout-service.ts","webpack:///./assets/images/appNav.png","webpack:///./assets/images/appNavBottom.png","webpack:///./assets/video/introduction.mp4","webpack:///./assets/images/recoverPass.png","webpack:///./assets/images/enterUID.png","webpack:///./assets/images/confirmEmail.png","webpack:///./assets/video/manageProfileAccess.mp4","webpack:///./assets/images/changeprofile.png","webpack:///./assets/images/profileSelection.png","webpack:///./assets/images/profileLocation.png","webpack:///./assets/video/createOrgProfile.mp4","webpack:///./assets/images/orgUserAccess.png","webpack:///./assets/images/orgUserList.png","webpack:///./assets/video/orgUserAccess.mp4","webpack:///./assets/video/joinOrg.mp4","webpack:///./assets/images/grantSearch.png","webpack:///./assets/images/grantsNav.png","webpack:///./assets/images/grantsNavHeader.png","webpack:///./assets/images/viewApp.png","webpack:///./assets/images/editApplicationMenu.png","webpack:///./src/services/slugify-service.ts","webpack:///./src/grants/search.ts?ef67","webpack:///./src/grants/view.ts?1d55","webpack:///./src/grants/apply/apply.ts","webpack:///./src/grants/apply/apply.html","webpack:///./src/grants/controls/search-filter-panel.ts","webpack:///./src/grants/controls/search-filter-panel.html","webpack:///./src/grants/enquire/enquire-modal.ts","webpack:///./src/grants/enquire/enquire-modal.html","webpack:///./src/grants/preview/preview.ts","webpack:///./src/grants/preview/preview.html","webpack:///./src/grants/preview/warning-modal.ts","webpack:///./src/grants/preview/warning-modal.html","webpack:///./src/grants/router.ts","webpack:///./src/grants/router.html","webpack:///./src/grants/search.ts","webpack:///./src/grants/search.html","webpack:///./src/grants/view.ts","webpack:///./src/grants/view.html","webpack:///./src/help/help.ts","webpack:///./src/help/help.html","webpack:///./src/help/help/FAQ.ts","webpack:///./src/help/help/FAQ.html","webpack:///./src/help/help/applyForGrant/applyForGrant.ts","webpack:///./src/help/help/applyForGrant/applyForGrant.html","webpack:///./src/help/help/applyForGrant/applyForGrantLanding.ts","webpack:///./src/help/help/applyForGrant/applyForGrantLanding.html","webpack:///./src/help/help/applyForGrant/grantEnquiry.ts","webpack:///./src/help/help/applyForGrant/grantEnquiry.html","webpack:///./src/help/help/applyForGrant/grantSearch.ts","webpack:///./src/help/help/applyForGrant/grantSearch.html","webpack:///./src/help/help/applyForGrant/grantSubscription.ts","webpack:///./src/help/help/applyForGrant/grantSubscription.html","webpack:///./src/help/help/compHelp/compHelp.ts","webpack:///./src/help/help/compHelp/compHelp.html","webpack:///./src/help/help/introduction.ts","webpack:///./src/help/help/introduction.html","webpack:///./src/help/help/manageGrant/applicationManagement.ts","webpack:///./src/help/help/manageGrant/applicationManagement.html","webpack:///./src/help/help/manageGrant/correspondence.ts","webpack:///./src/help/help/manageGrant/correspondence.html","webpack:///./src/help/help/manageGrant/manageGrantLanding.ts","webpack:///./src/help/help/manageGrant/manageGrantLanding.html","webpack:///./src/help/help/manageGrant/reporting.ts","webpack:///./src/help/help/manageGrant/reporting.html","webpack:///./src/help/help/manageGrant/roi.ts","webpack:///./src/help/help/manageGrant/roi.html","webpack:///./src/help/help/manageGrant/viewAwarded.ts","webpack:///./src/help/help/manageGrant/viewAwarded.html","webpack:///./src/help/help/setup/createOrgProfile.ts","webpack:///./src/help/help/setup/createOrgProfile.html","webpack:///./src/help/help/setup/joinAnOrg.ts","webpack:///./src/help/help/setup/joinAnOrg.html","webpack:///./src/help/help/setup/manageProfileAccess.ts","webpack:///./src/help/help/setup/manageProfileAccess.html","webpack:///./src/help/help/setup/orgUserAccess.ts","webpack:///./src/help/help/setup/orgUserAccess.html","webpack:///./src/help/help/setup/setupLanding.ts","webpack:///./src/help/help/setup/setupLanding.html","webpack:///./src/shared/controls/grants-directory/grant-card-view.ts","webpack:///./src/shared/controls/grants-directory/grant-card-view.html","webpack:///./src/shared/controls/grants-directory/grant-detail-view.ts","webpack:///./src/shared/controls/grants-directory/grant-detail-view.html","webpack:///./src/shared/controls/grants-directory/grant-summary-view.ts","webpack:///./src/shared/controls/grants-directory/grant-summary-view.html","webpack:///./src/welcome.ts","webpack:///./src/welcome.html"],"names":["requestHandler","profileService","authManager","router","getApplyCheck","contentId","roundId","this","getActiveProfile","then","profile","query","profileType","profileIdentifier","get","getGrantById","grantId","getGrantByIdOrSlug","identifier","getApplyCheckByIdOrSlug","contentIdentifier","roundIdentifier","hasOldUrl","slug","type","latestSlug","Constants","SlugType","PublicContent","navigateToRoute","ExternalPageRoutes","GrantsDetail","GrantRound","getMostRecentGrants","post","searchGrants","searchRequest","grantEnquiry","enquiry","GrantDirectoryService","scrollIntoViewExternal","element","offset","document","body","clientWidth","align","top","topOffset","options","truncationHTMLContainer","win","window","opt","clamp","useNativeClamp","splitOnChars","animate","truncationChar","truncationHTML","sty","style","originalText","innerHTML","supportsNativeClamp","clampValue","isCSSValue","indexOf","computeStyle","elem","prop","getComputedStyle","el","pseudo","getPropertyValue","re","test","replace","arguments","toUpperCase","currentStyle","getMaxLines","height","availHeight","clientHeight","lineHeight","getLineHeight","Math","max","floor","lh","parseInt","createElement","chunks","lastChunk","clampedText","clmp","slice","splitChar","getLastChild","lastChild","children","length","Array","prototype","call","pop","nodeValue","parentNode","removeChild","applyEllipsis","str","overflow","textOverflow","webkitBoxOrient","display","webkitLineClamp","truncate","target","maxHeight","shift","split","join","setTimeout","$","defaults","speed","collapsedHeight","heightMargin","moreLink","lessLink","embedCSS","blockCSS","startOpen","beforeToggle","afterToggle","cssEmbedded","uniqueIdCounter","setBoxHeights","clone","css","width","insertAfter","expandedHeight","outerHeight","cssMaxHeight","defaultHeight","data","remove","func","wait","immediate","timeout","resizeBoxes","each","current","isExpanded","attr","context","args","later","apply","callNow","clearTimeout","Readmore","extend","selector","styles","d","u","styleSheet","cssText","appendChild","createTextNode","getElementsByTagName","_defaults","_name","init","addEventListener","attachEvent","id","prefix","String","uniqueId","useLink","after","on","_this","event","toggle","trigger","preventDefault","$element","newHeight","newLink","expanded","off","replaceWith","destroy","next","removeData","fn","readmore","instance","module","exports","eventAggregator","that","resize","refreshValue","value","querySelector","publish","DeviceLayoutChangedEvent","ResponsiveLayoutService","grantDirectoryService","permanentRedirect","contentSlug","getContentSlug","isNumber","n","isNaN","parseFloat","SlugifyService","cb","require","applicationFormService","applicationService","dialogService","notifier","confirm","logger","organisationService","modelchecker","isSaving","canDeactivate","isLoggedIn","checkUnchanged","formInstance","oldFormInstance","canActivate","params","routeConfig","navigationInstruction","promises","push","activeProfile","getAccount","account","content","getAvailableOrganisationByGrantAndRoundIdentifier","availableOrganisationProfiles","Promise","all","isValid","warning","loggedInWithCorrectProfileCheck","isNew","checkResult","applyingOrganisationId","organisationId","applyingOrganisationBusinessId","businessId","applyingRegisteredTrainingOrganisationId","registeredTrainingOrganisationId","result","redirectUrl","isIndividual","successful","warnings","model","publicContentId","grantRoundSlug","generateApplyUrl","generate","activate","isPreview","getBlankApplicationBySlugOrId","application","applicationForm","formTemplate","catch","error","previousPage","navigate","hasOwnProperty","errors","forEach","e","attached","JSON","parse","stringify","findSystemQuestionTemplate","code","temp","concat","steps","map","x","sections","y","questions","find","systemQuestion","findQuestionAnswer","questionId","sectionGroups","questionGroups","q","templateQuestionId","save","validateForSave","valid","Error","organisationBusinessId","applicationId","createApplicationBySlug","info","Apply","namePrefix","collapsed","disabled","toggleCollapse","collapsedChanged","newValue","oldValue","slideToggle","SearchFilterPanel","Element","label","dialogController","dataService","controllerFactory","recaptchaEnabled","loggedIn","getRecaptchaKey","recaptchaSiteKey","enabled","setupValidation","ensure","m","contactEmail","required","email","contactName","matches","withMessage","maxLength","contactPhone","recaptchaResponse","when","submit","isBusy","controller","validate","ok","onVerified","response","Enquire","formService","isSubmitting","p","console","log","formId","as","showIndividualPreview","showOrganisationPreview","detached","closeAll","getIndividualFormTemplate","getNewIndividualForm","getOrganisationFormTemplate","getNewOrganisationForm","open","viewModel","saved","submitted","Preview","WarningModal","configureRouter","config","name","GrantsSearch","route","nav","title","moduleId","settings","breadcrumb","auth","parent","Detail","bindingEngine","selectedAgencies","selectedCategories","selectedBeneficiaries","selectedWhoCanApply","selectedContentTypes","selectedGrantsAvailable","benes","page","pageSize","sortFilter","grantsList","whoCanApply","contentTypes","PublicContentType","Applicant","ThirdPartyApplicant","ThirdPartySupplier","grantsAvailable","getAgencies","agencies","sort","a","b","description","localeCompare","getCategoryByLevel","categories","getBeneficiaries","beneficiaries","beneficiaryId","agency","category","term","search","c","doSearch","menu","MmenuLight","offCanvasElement","drawer","offcanvas","position","collectionObserver","subscribe","clearAllFilters","removePill","pill","thingToRemove","source","index","splice","openFilter","pageChanged","newVal","oldVal","undefined","keywordSearchElement","pageSizeChanged","sortFilterChanged","sortClosingSoon","sortOpeningSoon","sortNewlyListed","filter","publicContentTypes","sortColumn","sortDirection","SortDirection","Desc","keywords","Asc","w","individualsCanApply","nonProfitCanApply","forProfitCanApply","g","applicationsOpenFrom","format","add","res","results","totalRecords","i","SearchPill","Search","slugify","canView","canEdit","grantSearchRoute","supplierLink","invitation","determineActivationStrategy","supplierContentId","supplierContentIdentifier","setMetaInformation","navModel","grantName","userDetails","notFound","setArticle","deactivate","setKeywords","descriptionElm","setAttribute","mainDescriptionString","descriptionString","overviewHtml","getAttribute","htmlIn","reg","RegExp","keys","elm","getElementById","setup","googleArticleScriptElem","innerText","googleBreadcrumbScriptElem","location","origin","Date","toISOString","enquire","enquireBusy","getIndividualProfile","resolve","profiles","contactModel","profileUserFullname","emailAddress","mobilePhoneNumber","contactType","contactOrganisation","profileDisplayName","rejectOnCancel","whenClosed","output","success","profileInterstitial","orgProfileType","FormProfileType","Organisation","indProfileType","Individual","otherProfileType","currentProfileName","singleExistingApplication","existingApplications","canPotentiallyApplyNow","nonConcurrentAndStillProcessing","applyNow","ProfileSelect","redirect","currentInstruction","parentInstruction","fragment","queryString","supplierPublicContentId","GrantDetailsView","Help","FAQ","ApplyForGrant","ApplyForGrantLanding","GrantEnquiry","GrantSearch","GrantSubscription","CompHelp","Introduction","ApplicationManagement","Correspondence","ManageGrantLanding","Reporting","ROI","ViewAwarded","CreateOrgProfile","JoinAnOrg","ManageProfileAccess","OrgUserAccess","SetupLanding","agencySpan","overviewElement","startIndex","endIndex","substr","isIndividualEligible","isOrganisationEligible","showGlobalMaxFunding","globalFundingMax","returnString","defaultBindingMode","twoWay","GrantCardView","publicContentType","GrantDetailView","GrantSummaryView","grantsDirectoryService","responsiveLayoutService","featuredGrantService","rows","routeGrantsDirectory","latestGrantsPage","latestGrantsPageSize","latestGrantsCarouselDirectionClass","grants","getFeaturedGrant","featuredGrants","adjustPageSizeBasedOnDeviceWidth","screenSize","searchParams","selectedCategory","selectedAgency","searchTerm","generateGrantUrl","latestGrants","latestGrantsNextPage","latestGrantsPreviousPage","Welcome"],"mappings":"0oBAUA,aACI,WAAoBA,EAAiDC,EAAwCC,EAA2CC,GAApI,KAAAH,iBAAiD,KAAAC,iBAAwC,KAAAC,cAA2C,KAAAC,SAmE5J,OAjEI,YAAAC,cAAA,SAAcC,EAAmBC,GAAjC,WACI,OAAOC,KAAKN,eAAeO,mBAAmBC,MAAK,SAACC,GAChD,IAAIC,EAAQ,YAAYL,EAIxB,OAHe,MAAXI,GAA0C,gBAAvBA,EAAQE,cAC3BD,EAAWA,EAAK,mBAAmBD,EAAQG,mBAExC,EAAKb,eAAec,IAAmC,UAAUT,EAAS,eAAeM,OAIxG,YAAAI,aAAA,SAAaC,GAAb,WACI,OAAOT,KAAKN,eAAeO,mBAAmBC,MAAK,SAAAC,GAC/C,IAAIC,EAAQ,GAIZ,OAHe,MAAXD,GAA0C,gBAAvBA,EAAQE,cAC3BD,EAAQ,mBAAmBD,EAAQG,mBAEhC,EAAKb,eAAec,IAAyD,UAAUE,EAAUL,OAIhH,YAAAM,mBAAA,SAAmBC,GAAnB,WACI,OAAOX,KAAKN,eAAeO,mBAAmBC,MAAK,SAAAC,GAC/C,IAAIC,EAAQ,GAIZ,OAHe,MAAXD,GAA0C,gBAAvBA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AK2kB,iBAAmB,EAAK3kB,KAAK2kB,iBAAmB3kB,KAAK4kB,qBAAwB5kB,KAAK4kB,qBAAuB,EAEtHY,EAAe,GACVnI,EAAIhC,EAAOgC,EAAIrd,KAAK8kB,OAAO/e,QAAUsX,EAAIhC,EAAQrb,KAAK4kB,qBAAsBvH,IACjFmI,EAAa1W,KAAK9O,KAAK8kB,OAAOzH,IAElC,OAAOmI,G,gCAGX,YAAAC,qBAAA,WACQzlB,KAAK8kB,QAAU9kB,KAAK8kB,OAAO/e,OAAS/F,KAAK2kB,iBAAmB3kB,KAAK4kB,uBACjE5kB,KAAK6kB,mCAAqC,eAC1C7kB,KAAK2kB,iBAAmB3kB,KAAK2kB,iBAAmB,IAIxD,YAAAe,yBAAA,WACQ1lB,KAAK2kB,iBAAmB,IACxB3kB,KAAK6kB,mCAAqC,cAC1C7kB,KAAK2kB,iBAAmB3kB,KAAK2kB,iBAAmB,IAKxD,sBAAI,uCAAwB,C,IAA5B,WAEI,SAAI3kB,KAAK8kB,QAAU9kB,KAAK8kB,OAAO/e,QAAU/F,KAAK2kB,iBAAmB3kB,KAAK4kB,uB,gCAO1E,sBAAI,2CAA4B,C,IAAhC,WACI,OAAO5kB,KAAK2kB,iBAAmB,G,gCAInC,sBAAI,iCAAkB,C,IAAtB,WACI,OAAO3kB,KAAKglB,gBAAkBhlB,KAAKglB,eAAejf,OAAS,G,gCA/GjD,GAAb,c,gEACa,GAAb,c,oEACa,GAAb,c,kFAgED,GADC,YAAa,SAAU,mBAAoB,wB,qFA+B5C,GADC,YAAa,SAAU,mBAAoB,wB,iGAU5C,GADC,YAAa,SAAU,mBAAoB,wB,qGAM5C,GADC,YAAa,kB,2FAzHL4f,EAAO,GADnB,I,uBAiBwD,IACnB,IACL,IACiB,IACH,IACL,OArB7BA,GAAb,I,iDCdAtZ,EAAOC,QAAU","file":"assets/js/grants-directory.38c4f3b1f6c9ea004621.chunk.js","sourcesContent":["import { RequestHandler } from \"./request-handler\"\r\nimport { autoinject } from \"aurelia-framework\";\r\n\r\nimport { ProfileService } from \"services/profile-service\";\r\nimport { AuthManager } from \"auth/auth-manager\";\r\nimport { Dto } from \"project/project\";\r\nimport { SharedDto } from \"project/project-shared\";\r\nimport { Router } from \"aurelia-router\";\r\n\r\n@autoinject\r\nexport class GrantDirectoryService {\r\n constructor(private requestHandler: RequestHandler, private readonly profileService: ProfileService, private authManager: AuthManager, private readonly router: Router) { }\r\n\r\n getApplyCheck(contentId: number, roundId: number): Promise {\r\n return this.profileService.getActiveProfile().then((profile) => {\r\n let query = `?roundId=${roundId}`;\r\n if (profile != null && profile.profileType == \"Organisation\") {\r\n query = `${query}&organisationId=${profile.profileIdentifier}`\r\n }\r\n return this.requestHandler.get(`grants/${contentId}/apply-check${query}`);\r\n });\r\n }\r\n\r\n getGrantById(grantId: number): Promise {\r\n return this.profileService.getActiveProfile().then(profile => {\r\n let query = '';\r\n if (profile != null && profile.profileType == \"Organisation\") {\r\n query = `?organisationId=${profile.profileIdentifier}`\r\n }\r\n return this.requestHandler.get(`grants/${grantId}${query}`);\r\n });\r\n }\r\n\r\n getGrantByIdOrSlug(identifier: string | number): Promise {\r\n return this.profileService.getActiveProfile().then(profile => {\r\n let query = '';\r\n if (profile != null && profile.profileType == \"Organisation\") {\r\n query = `?organisationId=${profile.profileIdentifier}`\r\n }\r\n return this.requestHandler.get(`grants/${identifier}${query}`);\r\n });\r\n }\r\n\r\n getApplyCheckByIdOrSlug(contentIdentifier: number | string, roundIdentifier: number | string): Promise {\r\n return this.profileService.getActiveProfile().then((profile) => {\r\n let query = `?roundId=${roundIdentifier}`;\r\n if (profile != null && profile.profileType == \"Organisation\") {\r\n query = `${query}&organisationId=${profile.profileIdentifier}`\r\n }\r\n return this.requestHandler.get(`grants/${contentIdentifier}/apply-check${query}`);\r\n });\r\n }\r\n\r\n hasOldUrl(slug: string, type: string): void {\r\n this.requestHandler.get(`application/latest-slug/${slug}/${type}`).then(latestSlug => {\r\n //redirect to the latest slug?\r\n if (type == Dto.Constants.SlugType[Dto.Constants.SlugType.PublicContent]) {\r\n this.router.navigateToRoute(Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.GrantsDetail], {\r\n contentIdentifier: latestSlug\r\n });\r\n } else if (type == Dto.Constants.SlugType[Dto.Constants.SlugType.GrantRound]) {\r\n //??\r\n }\r\n });\r\n }\r\n\r\n getMostRecentGrants(): Promise { \r\n return this.requestHandler.post(`grants/search`); \r\n }\r\n\r\n searchGrants(searchRequest: Dto.IPublicContentSearchFilterRequestDto): Promise {\r\n return this.requestHandler.post(\r\n `grants/search`, searchRequest);\r\n }\r\n\r\n grantEnquiry(contentId: number, enquiry: Dto.IPublicContentEnquiryDto): Promise {\r\n return this.requestHandler.post(`grants/${contentId}/enquire`, enquiry);\r\n }\r\n}\r\n","\r\nimport scrollIntoView from \"scroll-into-view\";\r\n\r\nexport function scrollIntoViewExternal(element: Element) {\r\n\r\n let offset = 10;\r\n \r\n //note 768 is the SM breakpoint where the nav gets larger, so we're offsetting the nav.\r\n if (document.body.clientWidth >= 768) {\r\n offset = 130;\r\n }\r\n\r\n scrollIntoView(element, { align: { top: 0, topOffset: offset } });\r\n}\r\n","/*!\n * Clamp.js 0.7.0\n *\n * Copyright 2011-2013, Joseph Schmitt http://joe.sh\n * Released under the WTFPL license\n * http://sam.zoy.org/wtfpl/\n */\n\n(function(root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD\n define([], factory);\n } else if (typeof exports === 'object') {\n // Node, CommonJS-like\n module.exports = factory();\n } else {\n // Browser globals\n root.$clamp = factory();\n }\n}(this, function() {\n /**\n * Clamps a text node.\n * @param {HTMLElement} element. Element containing the text node to clamp.\n * @param {Object} options. Options to pass to the clamper.\n */\n function clamp(element, options) {\n options = options || {};\n\n var self = this,\n win = window,\n opt = {\n clamp: options.clamp || 2,\n useNativeClamp: typeof(options.useNativeClamp) != 'undefined' ? options.useNativeClamp : true,\n splitOnChars: options.splitOnChars || ['.', '-', '–', '—', ' '], //Split on sentences (periods), hypens, en-dashes, em-dashes, and words (spaces).\n animate: options.animate || false,\n truncationChar: options.truncationChar || '…',\n truncationHTML: options.truncationHTML\n },\n\n sty = element.style,\n originalText = element.innerHTML,\n\n supportsNativeClamp = typeof(element.style.webkitLineClamp) != 'undefined',\n clampValue = opt.clamp,\n isCSSValue = clampValue.indexOf && (clampValue.indexOf('px') > -1 || clampValue.indexOf('em') > -1),\n truncationHTMLContainer;\n\n if (opt.truncationHTML) {\n truncationHTMLContainer = document.createElement('span');\n truncationHTMLContainer.innerHTML = opt.truncationHTML;\n }\n\n\n // UTILITY FUNCTIONS __________________________________________________________\n\n /**\n * Return the current style for an element.\n * @param {HTMLElement} elem The element to compute.\n * @param {string} prop The style property.\n * @returns {number}\n */\n function computeStyle(elem, prop) {\n if (!win.getComputedStyle) {\n win.getComputedStyle = function(el, pseudo) {\n this.el = el;\n this.getPropertyValue = function(prop) {\n var re = /(\\-([a-z]){1})/g;\n if (prop == 'float') prop = 'styleFloat';\n if (re.test(prop)) {\n prop = prop.replace(re, function() {\n return arguments[2].toUpperCase();\n });\n }\n return el.currentStyle && el.currentStyle[prop] ? el.currentStyle[prop] : null;\n };\n return this;\n };\n }\n\n return win.getComputedStyle(elem, null).getPropertyValue(prop);\n }\n\n /**\n * Returns the maximum number of lines of text that should be rendered based\n * on the current height of the element and the line-height of the text.\n */\n function getMaxLines(height) {\n var availHeight = height || element.clientHeight,\n lineHeight = getLineHeight(element);\n\n return Math.max(Math.floor(availHeight / lineHeight), 0);\n }\n\n /**\n * Returns the maximum height a given element should have based on the line-\n * height of the text and the given clamp value.\n */\n function getMaxHeight(clmp) {\n var lineHeight = getLineHeight(element);\n return lineHeight * clmp;\n }\n\n /**\n * Returns the line-height of an element as an integer.\n */\n function getLineHeight(elem) {\n var lh = computeStyle(elem, 'line-height');\n if (lh == 'normal') {\n // Normal line heights vary from browser to browser. The spec recommends\n // a value between 1.0 and 1.2 of the font size. Using 1.1 to split the diff.\n lh = parseInt(computeStyle(elem, 'font-size')) * 1.2;\n }\n return parseInt(lh);\n }\n\n\n // MEAT AND POTATOES (MMMM, POTATOES...) ______________________________________\n var splitOnChars = opt.splitOnChars.slice(0),\n splitChar = splitOnChars[0],\n chunks,\n lastChunk;\n\n /**\n * Gets an element's last child. That may be another node or a node's contents.\n */\n function getLastChild(elem) {\n //Current element has children, need to go deeper and get last child as a text node\n if (elem.lastChild.children && elem.lastChild.children.length > 0) {\n return getLastChild(Array.prototype.slice.call(elem.children).pop());\n }\n //This is the absolute last child, a text node, but something's wrong with it. Remove it and keep trying\n else if (!elem.lastChild || !elem.lastChild.nodeValue || elem.lastChild.nodeValue === '' || elem.lastChild.nodeValue == opt.truncationChar) {\n elem.lastChild.parentNode.removeChild(elem.lastChild);\n return getLastChild(element);\n }\n //This is the last child we want, return it\n else {\n return elem.lastChild;\n }\n }\n\n /**\n * Removes one character at a time from the text until its width or\n * height is beneath the passed-in max param.\n */\n function truncate(target, maxHeight) {\n if (!maxHeight) {\n return;\n }\n\n /**\n * Resets global variables.\n */\n function reset() {\n splitOnChars = opt.splitOnChars.slice(0);\n splitChar = splitOnChars[0];\n chunks = null;\n lastChunk = null;\n }\n\n var nodeValue = target.nodeValue.replace(opt.truncationChar, '');\n\n //Grab the next chunks\n if (!chunks) {\n //If there are more characters to try, grab the next one\n if (splitOnChars.length > 0) {\n splitChar = splitOnChars.shift();\n }\n //No characters to chunk by. Go character-by-character\n else {\n splitChar = '';\n }\n\n chunks = nodeValue.split(splitChar);\n }\n\n //If there are chunks left to remove, remove the last one and see if\n // the nodeValue fits.\n if (chunks.length > 1) {\n // console.log('chunks', chunks);\n lastChunk = chunks.pop();\n // console.log('lastChunk', lastChunk);\n applyEllipsis(target, chunks.join(splitChar));\n }\n //No more chunks can be removed using this character\n else {\n chunks = null;\n }\n\n //Insert the custom HTML before the truncation character\n if (truncationHTMLContainer) {\n target.nodeValue = target.nodeValue.replace(opt.truncationChar, '');\n element.innerHTML = target.nodeValue + ' ' + truncationHTMLContainer.innerHTML + opt.truncationChar;\n }\n\n //Search produced valid chunks\n if (chunks) {\n //It fits\n if (element.clientHeight <= maxHeight) {\n //There's still more characters to try splitting on, not quite done yet\n if (splitOnChars.length >= 0 && splitChar !== '') {\n applyEllipsis(target, chunks.join(splitChar) + splitChar + lastChunk);\n chunks = null;\n }\n //Finished!\n else {\n return element.innerHTML;\n }\n }\n }\n //No valid chunks produced\n else {\n //No valid chunks even when splitting by letter, time to move\n //on to the next node\n if (splitChar === '') {\n applyEllipsis(target, '');\n target = getLastChild(element);\n\n reset();\n }\n }\n\n //If you get here it means still too big, let's keep truncating\n if (opt.animate) {\n setTimeout(function() {\n truncate(target, maxHeight);\n }, opt.animate === true ? 10 : opt.animate);\n } else {\n return truncate(target, maxHeight);\n }\n }\n\n function applyEllipsis(elem, str) {\n elem.nodeValue = str + opt.truncationChar;\n }\n\n\n // CONSTRUCTOR ________________________________________________________________\n\n if (clampValue == 'auto') {\n clampValue = getMaxLines();\n } else if (isCSSValue) {\n clampValue = getMaxLines(parseInt(clampValue));\n }\n\n var clampedText;\n if (supportsNativeClamp && opt.useNativeClamp) {\n sty.overflow = 'hidden';\n sty.textOverflow = 'ellipsis';\n sty.webkitBoxOrient = 'vertical';\n sty.display = '-webkit-box';\n sty.webkitLineClamp = clampValue;\n\n if (isCSSValue) {\n sty.height = opt.clamp + 'px';\n }\n } else {\n var height = getMaxHeight(clampValue);\n if (height <= element.clientHeight) {\n clampedText = truncate(getLastChild(element), height);\n }\n }\n\n return {\n 'original': originalText,\n 'clamped': clampedText\n };\n }\n\n return clamp;\n}));\n","/*!\n * @preserve\n *\n * Readmore.js jQuery plugin\n * Author: @jed_foster\n * Project home: http://jedfoster.github.io/Readmore.js\n * Licensed under the MIT license\n *\n * Debounce function from http://davidwalsh.name/javascript-debounce-function\n */\n\n/* global jQuery */\n\n(function(factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD\n define(['jquery'], factory);\n } else if (typeof exports === 'object') {\n // CommonJS\n module.exports = factory(require('jquery'));\n } else {\n // Browser globals\n factory(jQuery);\n }\n}(function($) {\n 'use strict';\n\n var readmore = 'readmore',\n defaults = {\n speed: 100,\n collapsedHeight: 200,\n heightMargin: 16,\n moreLink: 'Read More',\n lessLink: 'Close',\n embedCSS: true,\n blockCSS: 'display: block; width: 100%;',\n startOpen: false,\n\n // callbacks\n beforeToggle: function(){},\n afterToggle: function(){}\n },\n cssEmbedded = {},\n uniqueIdCounter = 0;\n\n function debounce(func, wait, immediate) {\n var timeout;\n\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (! immediate) {\n func.apply(context, args);\n }\n };\n var callNow = immediate && !timeout;\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) {\n func.apply(context, args);\n }\n };\n }\n\n function uniqueId(prefix) {\n var id = ++uniqueIdCounter;\n\n return String(prefix == null ? 'rmjs-' : prefix) + id;\n }\n\n function setBoxHeights(element) {\n var el = element.clone().css({\n height: 'auto',\n width: element.width(),\n maxHeight: 'none',\n overflow: 'hidden'\n }).insertAfter(element),\n expandedHeight = el.outerHeight(),\n cssMaxHeight = parseInt(el.css({maxHeight: ''}).css('max-height').replace(/[^-\\d\\.]/g, ''), 10),\n defaultHeight = element.data('defaultHeight');\n\n el.remove();\n\n var collapsedHeight = cssMaxHeight || element.data('collapsedHeight') || defaultHeight;\n\n // Store our measurements.\n element.data({\n expandedHeight: expandedHeight,\n maxHeight: cssMaxHeight,\n collapsedHeight: collapsedHeight\n })\n // and disable any `max-height` property set in CSS\n .css({\n maxHeight: 'none'\n });\n }\n\n var resizeBoxes = debounce(function() {\n $('[data-readmore]').each(function() {\n var current = $(this),\n isExpanded = (current.attr('aria-expanded') === 'true');\n\n setBoxHeights(current);\n\n current.css({\n height: current.data( (isExpanded ? 'expandedHeight' : 'collapsedHeight') )\n });\n });\n }, 100);\n\n function embedCSS(options) {\n if (! cssEmbedded[options.selector]) {\n var styles = ' ';\n\n if (options.embedCSS && options.blockCSS !== '') {\n styles += options.selector + ' + [data-readmore-toggle], ' +\n options.selector + '[data-readmore]{' +\n options.blockCSS +\n '}';\n }\n\n // Include the transition CSS even if embedCSS is false\n styles += options.selector + '[data-readmore]{' +\n 'transition: height ' + options.speed + 'ms;' +\n 'overflow: hidden;' +\n '}';\n\n (function(d, u) {\n var css = d.createElement('style');\n css.type = 'text/css';\n\n if (css.styleSheet) {\n css.styleSheet.cssText = u;\n }\n else {\n css.appendChild(d.createTextNode(u));\n }\n\n d.getElementsByTagName('head')[0].appendChild(css);\n }(document, styles));\n\n cssEmbedded[options.selector] = true;\n }\n }\n\n function Readmore(element, options) {\n this.element = element;\n\n this.options = $.extend({}, defaults, options);\n\n embedCSS(this.options);\n\n this._defaults = defaults;\n this._name = readmore;\n\n this.init();\n\n // IE8 chokes on `window.addEventListener`, so need to test for support.\n if (window.addEventListener) {\n // Need to resize boxes when the page has fully loaded.\n window.addEventListener('load', resizeBoxes);\n window.addEventListener('resize', resizeBoxes);\n }\n else {\n window.attachEvent('load', resizeBoxes);\n window.attachEvent('resize', resizeBoxes);\n }\n }\n\n\n Readmore.prototype = {\n init: function() {\n var current = $(this.element);\n\n current.data({\n defaultHeight: this.options.collapsedHeight,\n heightMargin: this.options.heightMargin\n });\n\n setBoxHeights(current);\n\n var collapsedHeight = current.data('collapsedHeight'),\n heightMargin = current.data('heightMargin');\n\n if (current.outerHeight(true) <= collapsedHeight + heightMargin) {\n // The block is shorter than the limit, so there's no need to truncate it.\n return true;\n }\n else {\n var id = current.attr('id') || uniqueId(),\n useLink = this.options.startOpen ? this.options.lessLink : this.options.moreLink;\n\n current.attr({\n 'data-readmore': '',\n 'aria-expanded': this.options.startOpen,\n 'id': id\n });\n\n current.after($(useLink)\n .on('click', (function(_this) {\n return function(event) {\n _this.toggle(this, current[0], event);\n };\n })(this))\n .attr({\n 'data-readmore-toggle': '',\n 'aria-controls': id\n }));\n\n if (! this.options.startOpen) {\n current.css({\n height: collapsedHeight\n });\n }\n }\n },\n\n toggle: function(trigger, element, event) {\n if (event) {\n event.preventDefault();\n }\n\n if (! trigger) {\n trigger = $('[aria-controls=\"' + _this.element.id + '\"]')[0];\n }\n\n if (! element) {\n element = _this.element;\n }\n\n var $element = $(element),\n newHeight = '',\n newLink = '',\n expanded = false,\n collapsedHeight = $element.data('collapsedHeight');\n\n if ($element.height() <= collapsedHeight) {\n newHeight = $element.data('expandedHeight') + 'px';\n newLink = 'lessLink';\n expanded = true;\n }\n else {\n newHeight = collapsedHeight;\n newLink = 'moreLink';\n }\n\n // Fire beforeToggle callback\n // Since we determined the new \"expanded\" state above we're now out of sync\n // with our true current state, so we need to flip the value of `expanded`\n this.options.beforeToggle(trigger, $element, ! expanded);\n\n $element.css({'height': newHeight});\n\n // Fire afterToggle callback\n $element.on('transitionend', (function(_this) {\n return function() {\n _this.options.afterToggle(trigger, $element, expanded);\n\n $(this).attr({\n 'aria-expanded': expanded\n }).off('transitionend');\n }\n })(this));\n\n $(trigger).replaceWith($(this.options[newLink])\n .on('click', (function(_this) {\n return function(event) {\n _this.toggle(this, element, event);\n };\n })(this))\n .attr({\n 'data-readmore-toggle': '',\n 'aria-controls': $element.attr('id')\n }));\n },\n\n destroy: function() {\n $(this.element).each(function() {\n var current = $(this);\n\n current.attr({\n 'data-readmore': null,\n 'aria-expanded': null\n })\n .css({\n maxHeight: '',\n height: ''\n })\n .next('[data-readmore-toggle]')\n .remove();\n\n current.removeData();\n });\n }\n };\n\n\n $.fn.readmore = function(options) {\n var args = arguments,\n selector = this.selector;\n\n options = options || {};\n\n if (typeof options === 'object') {\n return this.each(function() {\n if ($.data(this, 'plugin_' + readmore)) {\n var instance = $.data(this, 'plugin_' + readmore);\n instance.destroy.apply(instance);\n }\n\n options.selector = selector;\n\n $.data(this, 'plugin_' + readmore, new Readmore(this, options));\n });\n }\n else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {\n return this.each(function () {\n var instance = $.data(this, 'plugin_' + readmore);\n if (instance instanceof Readmore && typeof instance[options] === 'function') {\n instance[options].apply(instance, Array.prototype.slice.call(args, 1));\n }\n });\n }\n };\n\n}));\n\n","module.exports = __webpack_public_path__ + \"assets/images/accountSelectionList.png\";","import { EventAggregator } from \"aurelia-event-aggregator\";\r\nimport { autoinject, singleton } from \"aurelia-dependency-injection\";\r\nimport \"./responsive-layout-service.less\";\r\n\r\n//adapted from this lightweight solution to enable javascript behaviours based on css breakpoints: https://www.lullabot.com/articles/importing-css-breakpoints-into-javascript\r\n@autoinject\r\nexport class ResponsiveLayoutService {\r\n\r\n value: \"xs\" | \"sm\" | \"md\" | \"lg\";\r\n\r\n constructor(private readonly eventAggregator: EventAggregator) {\r\n //register to resize events, and immediately trigger the resize event.\r\n var that = this;\r\n $(window).resize(function () {\r\n that.refreshValue();\r\n }).resize();\r\n }\r\n\r\n private refreshValue() {\r\n this.value = window.getComputedStyle(document.querySelector('body'), ':before').getPropertyValue('content').replace(/\\\"/g, '') as \"xs\" | \"sm\" | \"md\" | \"lg\";\r\n this.eventAggregator.publish(DeviceLayoutChangedEvent, this.value);\r\n }\r\n}\r\n\r\nexport const DeviceLayoutChangedEvent = \"device-layout-breakpoint-changed\";","module.exports = __webpack_public_path__ + \"assets/images/appNav.png\";","module.exports = __webpack_public_path__ + \"assets/images/appNavBottom.png\";","module.exports = __webpack_public_path__ + \"assets/video/introduction.mp4\";","module.exports = __webpack_public_path__ + \"assets/images/recoverPass.png\";","module.exports = __webpack_public_path__ + \"assets/images/enterUID.png\";","module.exports = __webpack_public_path__ + \"assets/images/confirmEmail.png\";","module.exports = __webpack_public_path__ + \"assets/video/manageProfileAccess.mp4\";","module.exports = __webpack_public_path__ + \"assets/images/changeprofile.png\";","module.exports = __webpack_public_path__ + \"assets/images/profileSelection.png\";","module.exports = __webpack_public_path__ + \"assets/images/profileLocation.png\";","module.exports = __webpack_public_path__ + \"assets/video/createOrgProfile.mp4\";","module.exports = __webpack_public_path__ + \"assets/images/orgUserAccess.png\";","module.exports = __webpack_public_path__ + \"assets/images/orgUserList.png\";","module.exports = __webpack_public_path__ + \"assets/video/orgUserAccess.mp4\";","module.exports = __webpack_public_path__ + \"assets/video/joinOrg.mp4\";","module.exports = __webpack_public_path__ + \"assets/images/grantSearch.png\";","module.exports = __webpack_public_path__ + \"assets/images/grantsNav.png\";","module.exports = __webpack_public_path__ + \"assets/images/grantsNavHeader.png\";","module.exports = __webpack_public_path__ + \"assets/images/viewApp.png\";","module.exports = __webpack_public_path__ + \"assets/images/editApplicationMenu.png\";","import { autoinject } from \"aurelia-framework\";\r\nimport { Dto } from \"project/project\";\r\nimport { GrantDirectoryService } from \"./grant-directory-service\";\r\nimport { Router } from \"aurelia-router\";\r\nimport { RequestHandler } from \"./request-handler\";\r\n\r\n@autoinject\r\nexport class SlugifyService {\r\n router:Router;\r\n\r\n constructor(\r\n router: Router,\r\n private readonly grantDirectoryService: GrantDirectoryService, private readonly requestHandler: RequestHandler) {\r\n this.router = router;\r\n }\r\n\r\n permanentRedirect(id:number): void {\r\n this.grantDirectoryService.getGrantById(id).then(data => {\r\n \r\n this.router.navigateToRoute(\r\n Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.GrantsDetail],\r\n {contentIdentifier: data.contentSlug}\r\n );\r\n });\r\n }\r\n\r\n getContentSlug(id: number): Promise {\r\n return this.requestHandler.get(`grants/${id}/slug`);\r\n }\r\n\r\n isNumber(n:any) { \r\n return !isNaN(parseFloat(n)) && !isNaN(n - 0) \r\n }\r\n}\r\n","module.exports = function(cb) {\n\trequire.ensure([], function(require) {\n\t\tcb(require(\"!!../../node_modules/awesome-typescript-loader/dist/entry.js??ref--8-0!./search.ts\"));\n\t}, \"grants-directory\");\n}","module.exports = function(cb) {\n\trequire.ensure([], function(require) {\n\t\tcb(require(\"!!../../node_modules/awesome-typescript-loader/dist/entry.js??ref--8-0!./view.ts\"));\n\t}, \"grants-directory\");\n}","import { autoinject, PLATFORM } from \"aurelia-framework\";\r\nimport { NavigationInstruction, RouteConfig, Router, RedirectToRoute, Redirect } from \"aurelia-router\";\r\nimport { Dto } from \"project/project\";\r\nimport { SharedDto } from \"project/project-shared\";\r\nimport { ApplicationFormService } from \"services/application-form-service\";\r\nimport { ApplicationService, IApplyCheckResult } from \"services/application-service\";\r\nimport { GrantDirectoryService } from \"services/grant-directory-service\";\r\nimport { Notifier } from \"services/notifier\";\r\nimport { ProfileService } from \"services/profile-service\";\r\nimport { ApplicationFormCustomElement } from \"shared/controls/online-form/application-form\";\r\nimport { ValidationError } from \"shared/controls/validation-error\";\r\nimport { ModelChecker } from \"shared/utils/model-checker\";\r\nimport { AuthManager } from \"auth/auth-manager\";\r\nimport { generateApplicationUrl, generateGrantUrl } from \"services/url-generators\";\r\nimport { Logger } from \"aurelia-logging\";\r\nimport { IApplyNowModalConditionsEnum, IApplyNowModalParams } from \"grants/modals/apply-now-modal/apply-now-modal\";\r\nimport { ActiveProfile } from \"models/active-profile\";\r\nimport { ILoginOrRegisterModalParams } from \"grants/modals/login-or-register-modal/login-or-register-modal\";\r\nimport { DialogService } from \"aurelia-dialog\";\r\nimport { Confirm } from \"shared/controls/confirm-modal/confirm\";\r\nimport { Messages } from \"utils/messages\";\r\nimport { OrganisationService } from \"services/organisation-service\";\r\nimport TargetLateInvitationStatus = SharedDto.Constants.TargetLateInvitationStatus;\r\n\r\n@autoinject\r\nexport class Apply {\r\n publicContentId: number | string;\r\n roundIdentifier: number | string;\r\n formTemplate: SharedDto.OnlineForm.Form.IApplicationFormTemplateDto;\r\n formInstance: SharedDto.OnlineForm.Application.IApplicationFormDto;\r\n oldFormInstance: SharedDto.OnlineForm.Application.IApplicationFormDto;\r\n\r\n applicationForm: ApplicationFormCustomElement;\r\n isSaving: boolean = false;\r\n\r\n activeProfile: ActiveProfile;\r\n account: Dto.IUserResponse;\r\n availableOrganisationProfiles: Dto.IUserOrganisationProfile[];\r\n content: SharedDto.PublicContent.IPublicContentDetailViewDto;\r\n applyCheckByIdOrSlug: Dto.INotification; \r\n \r\n applyingOrganisationId: number;\r\n applyingOrganisationBusinessId: number;\r\n applyingRegisteredTrainingOrganisationId: number;\r\n \r\n constructor(private readonly applicationFormService: ApplicationFormService,\r\n private readonly grantDirectoryService: GrantDirectoryService,\r\n private readonly applicationService: ApplicationService,\r\n private readonly profileService: ProfileService,\r\n private readonly dialogService: DialogService,\r\n private readonly router: Router,\r\n private readonly notifier: Notifier,\r\n private readonly confirm: Confirm,\r\n private readonly logger: Logger,\r\n private readonly organisationService: OrganisationService,\r\n private readonly modelchecker: ModelChecker,\r\n private readonly authManager: AuthManager) { }\r\n\r\n canDeactivate() {\r\n return !this.authManager.isLoggedIn || this.modelchecker.checkUnchanged(this.formInstance, this.oldFormInstance);\r\n }\r\n \r\n async canActivate(params: { contentIdentifier: number | string, roundIdentifier: number | string, isNew: boolean }, routeConfig: RouteConfig, navigationInstruction: NavigationInstruction) {\r\n\r\n let promises = [];\r\n //load all required data in parallel\r\n promises.push(\r\n this.profileService.getActiveProfile().then(data => this.activeProfile = data),\r\n this.profileService.getAccount().then(data => this.account = data),\r\n this.grantDirectoryService.getGrantByIdOrSlug(params.contentIdentifier).then(data => this.content = data),\r\n );\r\n\r\n if(this.authManager.isLoggedIn) {\r\n promises.push(\r\n this.organisationService.getAvailableOrganisationByGrantAndRoundIdentifier(params.contentIdentifier, params.roundIdentifier).then(data => this.availableOrganisationProfiles = data),\r\n );\r\n }\r\n\r\n await Promise.all(promises);\r\n\r\n // validate if user has a valid individual account\r\n // this is for old accounts in the current production environment\r\n if(this.account && ! this.account.isValid) {\r\n this.notifier.warning('To apply for this grant you must update your individual profile.');\r\n return new Redirect(`/account/contact-information/edit?redirect=${generateGrantUrl(params.contentIdentifier)}`);\r\n } \r\n\r\n let checkResult = await this.applicationService.loggedInWithCorrectProfileCheck(this.activeProfile, this.content, this.account, params.isNew, this.availableOrganisationProfiles); \r\n this.applyingOrganisationId = checkResult.organisationId;\r\n this.applyingOrganisationBusinessId = checkResult.businessId;\r\n this.applyingRegisteredTrainingOrganisationId = checkResult.registeredTrainingOrganisationId;\r\n \r\n if (checkResult.result === \"redirect\") {\r\n //the user has opted to login or be redirected somewhere to be able to apply - send them there\r\n return new Redirect(checkResult.redirectUrl)\r\n } else if (checkResult.result === \"cancelled\") {\r\n //return the user to the content view - they cancelled any options to rectify invalid login/profile pre requisites\r\n return new Redirect(generateGrantUrl(params.contentIdentifier));\r\n }\r\n\r\n this.applicationFormService.isIndividual = this.activeProfile.profileType == \"Individual\";\r\n\r\n return this.grantDirectoryService\r\n .getApplyCheckByIdOrSlug(params.contentIdentifier, params.roundIdentifier)\r\n .then((result: Dto.INotification) => {\r\n if (result.successful) {\r\n return true;\r\n } else {\r\n if (result.warnings instanceof Array && result.warnings.length > 0) {\r\n for (let warning of result.warnings) {\r\n this.notifier.warning(warning);\r\n }\r\n }\r\n return new Redirect(generateGrantUrl(params.contentIdentifier));\r\n }\r\n });\r\n }\r\n\r\n apply(model: SharedDto.PublicContent.IPublicContentDetailViewDto, router: Router): void {\r\n router.navigateToRoute(\"Apply\", { contentIdentifier: model.contentSlug ? model.contentSlug : model.publicContentId, roundIdentifier: model.grantRoundSlug ? model.grantRoundSlug : model.roundId });\r\n }\r\n\r\n generateApplyUrl(model: SharedDto.PublicContent.IPublicContentDetailViewDto, router: Router): string {\r\n return router.generate(\"Apply\", { contentIdentifier: model.contentSlug ? model.contentSlug : model.publicContentId, roundIdentifier: model.grantRoundSlug ? model.grantRoundSlug : model.roundId });\r\n }\r\n\r\n activate(params: { contentIdentifier: number | string, roundIdentifier: number | string }) {\r\n this.publicContentId = params.contentIdentifier;\r\n this.roundIdentifier = params.roundIdentifier;\r\n this.applicationFormService.isPreview = false;\r\n\r\n return this.applicationService.getBlankApplicationBySlugOrId(params.contentIdentifier, params.roundIdentifier, this.applyingOrganisationBusinessId).then((application: any) => {\r\n this.formInstance = application.applicationForm;\r\n this.formTemplate = application.formTemplate;\r\n }).catch(error => {\r\n var previousPage = this.router.generate(Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.GrantsDetail], {'contentIdentifier' : params.contentIdentifier})\r\n this.router.navigate(previousPage)\r\n\r\n if (error.hasOwnProperty('noContinue')) {\r\n return;\r\n }\r\n if (error instanceof ValidationError) {\r\n if (error.errors) {\r\n error.errors.forEach(e => {\r\n this.notifier.error(e);\r\n });\r\n return;\r\n }\r\n }\r\n \r\n this.logger.error(error); \r\n });\r\n }\r\n\r\n attached() {\r\n this.oldFormInstance = JSON.parse(JSON.stringify(this.formInstance));\r\n }\r\n\r\n public findSystemQuestionTemplate(code: SharedDto.Constants.SystemQuestion): SharedDto.OnlineForm.Form.IQuestionDto {\r\n var temp = [].concat.apply([], this.formTemplate.steps.map(x => x.sections.map(y => y.questions)));\r\n var templateQuestions = [].concat.apply([], temp);\r\n var questionTemplate = (templateQuestions as SharedDto.OnlineForm.Form.IQuestionDto[])\r\n .find(x => x.systemQuestion == code)\r\n\r\n return questionTemplate;\r\n }\r\n\r\n findQuestionAnswer(questionId) {\r\n for (var step of this.formInstance.formInstance.steps) {\r\n for (var sg of step.sectionGroups) {\r\n for (var sec of sg.sections) {\r\n for (var qg of sec.questionGroups) {\r\n for (var q of qg.questions) {\r\n if (q.templateQuestionId == questionId) {\r\n return q;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n save() {\r\n if (!this.isSaving) {\r\n this.isSaving = true;\r\n this.applicationForm.validateForSave().then(valid => {\r\n if (!valid) {\r\n let error = new Error;\r\n error['noContinue'] = true;\r\n throw error;\r\n }\r\n\r\n this.formInstance.organisationBusinessId = this.applyingOrganisationBusinessId;\r\n this.formInstance.registeredTrainingOrganisationId = this.applyingRegisteredTrainingOrganisationId;\r\n \r\n let applicationId = this.applicationService.createApplicationBySlug(this.formInstance, this.publicContentId, this.roundIdentifier, this.applyingOrganisationBusinessId);\r\n \r\n this.notifier.info('Application saved.');\r\n return applicationId;\r\n }).then((applicationId) => {\r\n this.oldFormInstance = JSON.parse(JSON.stringify(this.formInstance));\r\n return applicationId;\r\n }).then((applicationId) => {\r\n this.router.navigate(generateApplicationUrl(applicationId));\r\n }).catch(error => {\r\n this.isSaving = false;\r\n if (error.hasOwnProperty('noContinue')) {\r\n return;\r\n }\r\n if (error instanceof ValidationError) {\r\n if (error.errors) {\r\n error.errors.forEach(e => {\r\n this.notifier.error(e);\r\n });\r\n return;\r\n }\r\n }\r\n this.notifier.error(\"There was an error saving your application.\");\r\n this.logger.error(error);\r\n this.isSaving = false;\r\n });\r\n }\r\n }\r\n}\r\n","module.exports = \"\";","import { bindable, customElement, bindingMode, autoinject, computedFrom } from \"aurelia-framework\";\r\nimport { SharedDto } from \"project/project-shared\";\r\n\r\n\r\n@autoinject\r\n@customElement(\"search-filter-panel\")\r\n\r\nexport class SearchFilterPanel {\r\n @bindable() title: string;\r\n @bindable() options: Array;\r\n @bindable() selectedValues: Array;\r\n @bindable() namePrefix: string = \"changeme\";\r\n @bindable() collapsed: boolean = true;\r\n @bindable() disabled: boolean = false;\r\n\r\n constructor(private element: Element) {\r\n }\r\n\r\n\r\n toggleCollapse() {\r\n this.collapsed = !this.collapsed;\r\n }\r\n\r\n collapsedChanged(newValue, oldValue) {\r\n var panel = $(this.element).find('.filter-body');\r\n panel.slideToggle(200);\r\n }\r\n\r\n @computedFrom(\"collapsed\")\r\n get iconClass() {\r\n return this.collapsed ? \"fa fa-fw fa-chevron-down\" : \"fa fa-fw fa-chevron-up\";\r\n }\r\n\r\n}\r\n\r\nexport class SearchPanelCheckboxItem {\r\n value: number;\r\n label: string;\r\n\r\n constructor(value: number, label: string) {\r\n this.value = value;\r\n this.label = label\r\n }\r\n}\r\n","module.exports = \" \";","import { autoinject } from \"aurelia-framework\";\r\nimport { DialogController } from \"aurelia-dialog\";\r\nimport { ValidationControllerFactory, ValidationRules } from \"aurelia-validation\";\r\n\r\nimport { DataService } from \"services/data-service\";\r\nimport { ValidationBase } from \"base-class\";\r\nimport { Dto } from \"project/project\";\r\nimport { AuthManager } from \"auth/auth-manager\";\r\n\r\nexport interface IContactProfileModel extends Dto.IPublicContentEnquiryDto {\r\n contactType: string,\r\n contactOrganisation: string\r\n};\r\n\r\n@autoinject\r\nexport class Enquire extends ValidationBase {\r\n loggedIn: boolean;\r\n isBusy: boolean;\r\n model: IContactProfileModel\r\n\r\n recaptchaSiteKey: string;\r\n recaptchaEnabled: boolean = true;\r\n\r\n constructor(public readonly dialogController: DialogController,\r\n private readonly dataService: DataService,\r\n private readonly authManager: AuthManager,\r\n controllerFactory: ValidationControllerFactory) { \r\n super(controllerFactory)\r\n }\r\n\r\n activate(model: IContactProfileModel) {\r\n this.model = model;\r\n \r\n this.loggedIn = this.authManager.isLoggedIn;\r\n return this.dataService.getRecaptchaKey().then((data: { value: string, enabled: boolean }) => {\r\n this.recaptchaSiteKey = data.value;\r\n this.recaptchaEnabled = data.enabled;\r\n }).then(() => this.setupValidation());\r\n }\r\n\r\n setupValidation() { \r\n ValidationRules\r\n .ensure((m: IContactProfileModel) => m.contactEmail).required().email()\r\n .ensure((m: IContactProfileModel) => m.contactName).required().matches(/^[A-Za-z '-]+$/).withMessage(\"Name may contain alphabetic characters, spaces, hyphens and apostrophes\")\r\n .ensure((m: IContactProfileModel) => m.enquiry).required().maxLength(4000)\r\n .ensure((m: IContactProfileModel) => m.contactPhone).required()\r\n .ensure((m: IContactProfileModel) => m.recaptchaResponse)\r\n .required()\r\n .when(m => !this.loggedIn && this.recaptchaEnabled)\r\n .withMessage(\"You must complete the reCaptcha test.\")\r\n .on(this.model);\r\n }\r\n\r\n submit() {\r\n this.isBusy = true;\r\n this.controller.validate().then((result) => {\r\n if (result.valid) {\r\n this.dialogController.ok(this.model);\r\n }\r\n else {\r\n this.isBusy = false;\r\n }\r\n }).catch(() => {\r\n this.isBusy = false;\r\n });\r\n }\r\n \r\n onVerified(response: string) {\r\n this.model.recaptchaResponse = response;\r\n }\r\n}","module.exports = \" \";","import { DialogService } from \"aurelia-dialog\";\r\nimport { autoinject, PLATFORM } from \"aurelia-framework\";\r\nimport { SharedDto } from \"project/project-shared\";\r\nimport { ApplicationFormService } from \"services/application-form-service\";\r\nimport { OnlineFormService } from \"services/online-form-service\";\r\nimport { ApplicationFormCustomElement } from \"shared/controls/online-form/application-form\";\r\nimport { IWarningModal, WarningModal } from \"./warning-modal\";\r\n\r\nPLATFORM.moduleName(\"./warning-modal\");//workaround for template bug and dialog service/webpack.\r\n\r\nexport interface IFormPreviewParams {\r\n formId: number;\r\n contentIdentifier: number;\r\n as: \"individual\" | \"organisation\";\r\n}\r\n\r\n@autoinject\r\nexport class Preview {\r\n contentId: number;\r\n isBusy: boolean = true;\r\n error: boolean = false;\r\n formTemplate: SharedDto.OnlineForm.Form.IApplicationFormTemplateDto;\r\n formInstance: SharedDto.OnlineForm.Application.IApplicationFormDto;\r\n\r\n applicationForm: ApplicationFormCustomElement;\r\n isSaving: boolean = false;\r\n isSubmitting: boolean = false;\r\n formId: number;\r\n\r\n constructor( private readonly dialogService: DialogService,\r\n private readonly formService: OnlineFormService,\r\n private readonly applicationFormService: ApplicationFormService) { }\r\n\r\n activate(params: IFormPreviewParams) {\r\n console.log('activating preview');\r\n this.contentId = params.contentIdentifier;\r\n this.formId = params.formId;\r\n\r\n this.isBusy = true;\r\n let p: Promise;\r\n this.applicationFormService.isPreview = true;\r\n if (params.as == \"individual\") {\r\n this.applicationFormService.isIndividual = true;\r\n p = this.showIndividualPreview();\r\n }\r\n else {\r\n this.applicationFormService.isIndividual = false;\r\n p = this.showOrganisationPreview();\r\n }\r\n\r\n p.catch(error => {\r\n console.log('p3')\r\n this.error = true;\r\n console.log(error);\r\n }).then(() => {\r\n this.isBusy = false;\r\n });\r\n return p;\r\n }\r\n\r\n attached() {\r\n if (!this.error) {\r\n this.warning(false, false, this.contentId);\r\n }\r\n }\r\n\r\n detached() {\r\n this.dialogService.closeAll();\r\n }\r\n\r\n save() {\r\n this.isSaving = true;\r\n this.applicationForm.validateForSave().then(valid => {\r\n if (valid) {\r\n this.warning(true, false, this.contentId);\r\n }\r\n }).catch(() => {\r\n }).then(() => {\r\n this.isSaving = false;\r\n });\r\n }\r\n\r\n submit() {\r\n this.isSubmitting = true;\r\n this.applicationForm.validateForSave().then(valid => {\r\n if (valid) {\r\n this.warning(false, true, this.contentId);\r\n }\r\n }).catch(() => {\r\n }).then(() => {\r\n this.isSubmitting = false;\r\n });\r\n }\r\n\r\n private showIndividualPreview() {\r\n var promises = [];\r\n\r\n promises.push(this.formService.getIndividualFormTemplate(this.formId).then(data => {\r\n this.formTemplate = data;\r\n }));\r\n\r\n promises.push(this.formService.getNewIndividualForm(this.formId).then(data => {\r\n this.formInstance = data;\r\n }));\r\n\r\n return Promise.all(promises);\r\n }\r\n\r\n private showOrganisationPreview() {\r\n var promises = [];\r\n\r\n promises.push(this.formService.getOrganisationFormTemplate(this.formId).then(data => {\r\n console.log('p1')\r\n this.formTemplate = data;\r\n }));\r\n\r\n promises.push(this.formService.getNewOrganisationForm(this.formId).then(data => {\r\n console.log('p2')\r\n this.formInstance = data;\r\n }));\r\n \r\n\r\n return Promise.all(promises);\r\n }\r\n\r\n private warning(save: boolean, submit: boolean, contentId: number): Promise {\r\n return this.dialogService.open({\r\n viewModel: PLATFORM.moduleName(\"grants/preview/warning-modal\"),\r\n model: {\r\n saved: save, submitted: submit, contentId: contentId\r\n } as IWarningModal\r\n });\r\n }\r\n\r\n public findSystemQuestionTemplate(code: SharedDto.Constants.SystemQuestion): SharedDto.OnlineForm.Form.IQuestionDto {\r\n var temp = [].concat.apply([], this.formTemplate.steps.map(x => x.sections.map(y => y.questions)));\r\n var templateQuestions = [].concat.apply([], temp);\r\n var questionTemplate = (templateQuestions as SharedDto.OnlineForm.Form.IQuestionDto[])\r\n .find(x => x.systemQuestion == code)\r\n\r\n return questionTemplate;\r\n }\r\n\r\n findQuestionAnswer(questionId) {\r\n for (var step of this.formInstance.formInstance.steps) {\r\n for(var sg of step.sectionGroups) {\r\n for(var sec of sg.sections) {\r\n for(var qg of sec.questionGroups) {\r\n for(var q of qg.questions) {\r\n if(q.templateQuestionId == questionId) {\r\n return q;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","module.exports = \" \";","import { DialogController } from \"aurelia-dialog\";\r\nimport { autoinject, computedFrom } from \"aurelia-framework\";\r\nimport { generateGrantUrl } from \"services/url-generators\";\r\n\r\nexport interface IWarningModal {\r\n saved: boolean,\r\n submitted: boolean,\r\n contentId: number\r\n}\r\n\r\n@autoinject\r\nexport class WarningModal {\r\n contentId: number;\r\n saved: boolean = false;\r\n submitted: boolean = false;\r\n\r\n constructor(public readonly dialogController: DialogController) {\r\n\r\n }\r\n\r\n activate(params: IWarningModal) {\r\n this.contentId = params.contentId;\r\n this.saved = params.saved;\r\n this.submitted = params.submitted;\r\n }\r\n\r\n @computedFrom(\"contentId\")\r\n get grantLink(): string {\r\n return generateGrantUrl(this.contentId);\r\n }\r\n}\r\n","module.exports = \" \";","import { autoinject } from \"aurelia-dependency-injection\";\r\nimport { PLATFORM } from \"aurelia-pal\";\r\nimport { Router, RouterConfiguration } from \"aurelia-router\";\r\nimport { Dto } from \"project/project\";\r\nimport { ROUTE_APPLICATION_OUTCOME_SUMMARY } from \"utils/router-constants\";\r\n\r\n\r\n@autoinject\r\nexport class Detail {\r\n router: Router;\r\n\r\n configureRouter(config: RouterConfiguration, router: Router) {\r\n config.map([\r\n {\r\n name: Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.GrantsSearch],\r\n route: \"\",\r\n nav: false,\r\n title: \"Grant search\",\r\n moduleId: PLATFORM.moduleName(\"grants/search\", \"grants-directory\"),\r\n settings: {\r\n breadcrumb: false,\r\n auth: false\r\n }\r\n },\r\n {\r\n name: \"supplier-content\",\r\n route: \":contentIdentifier/supplier-information/:supplierContentIdentifier\",\r\n nav: false,\r\n title: \"Supplier information\",\r\n moduleId: PLATFORM.moduleName(\"grants/view\", \"grants-directory\"),\r\n settings: {\r\n breadcrumb: true,\r\n parent: Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.GrantsDetail],\r\n auth: false\r\n }\r\n },\r\n {\r\n name: Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.GrantsDetail],\r\n route: \":contentIdentifier\",\r\n nav: false,\r\n title: \"Grant information\",\r\n moduleId: PLATFORM.moduleName(\"grants/view\", \"grants-directory\"),\r\n settings: {\r\n breadcrumb: true,\r\n parent: Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.GrantsSearch],\r\n auth: false\r\n }\r\n },\r\n {\r\n route: \":contentIdentifier/apply/:roundIdentifier\", name: Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.Apply],\r\n moduleId: PLATFORM.moduleName(\"grants/apply/apply\"), title: \"Apply\",\r\n settings: {\r\n breadcrumb: true,\r\n parent: Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.GrantsDetail],\r\n auth: false\r\n }\r\n },\r\n {\r\n route: \":contentIdentifier/preview/:formId\", name: Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.Preview],\r\n moduleId: PLATFORM.moduleName(\"grants/preview/preview\"), title: \"Preview form\",\r\n settings: {\r\n breadcrumb: true,\r\n parent: Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.GrantsDetail],\r\n auth: false\r\n }\r\n },\r\n ]);\r\n this.router = router;\r\n }\r\n\r\n}\r\n","module.exports = \" \";","import { autoinject, observable, singleton, bindable } from 'aurelia-framework';\r\nimport { ModuleBase } from 'base-class';\r\nimport { DataService } from 'services/data-service';\r\nimport { Dto } from \"project/project\";\r\nimport { SharedDto } from 'project/project-shared';\r\nimport { SearchPanelCheckboxItem } from './controls/search-filter-panel'\r\nimport { computedFrom } from 'aurelia-binding';\r\nimport { GrantDirectoryService } from 'services/grant-directory-service';\r\nimport * as moment from 'moment'\r\nimport { Notifier } from 'services/notifier';\r\nimport { BindingEngine } from 'aurelia-binding';\r\nimport { scrollIntoViewExternal } from 'shared/utils/scroll-into-view';\r\n\r\ntype SortFilterType = \"NewlyListed\" | \"OpenDate\" | \"CloseDate\";\r\n\r\n@autoinject\r\n@singleton()\r\nexport class Search extends ModuleBase {\r\n\r\n totalRecords: number;\r\n grantsList: Array;\r\n\r\n agencies: Array;\r\n selectedAgencies: Array = [];\r\n\r\n categories: Array;\r\n selectedCategories: Array = [];\r\n\r\n beneficiaries: Array;\r\n selectedBeneficiaries: Array = [];\r\n\r\n whoCanApply: Array;\r\n selectedWhoCanApply: Array = [];\r\n\r\n contentTypes: Array;\r\n selectedContentTypes: Array = [];\r\n\r\n grantsAvailable: Array;\r\n selectedGrantsAvailable: Array = [];\r\n\r\n @bindable() benes: number[] = [];\r\n @observable() search: string;\r\n\r\n @observable() page: number = 1;\r\n @observable() pageSize: number = 5;\r\n isBusy: boolean;\r\n\r\n offCanvasElement: HTMLElement;\r\n\r\n @observable() sortFilter: SortFilterType = \"NewlyListed\";\r\n\r\n keywordSearchElement: Element;\r\n drawer: any;\r\n\r\n constructor(dataService: DataService,\r\n private readonly grantDirectoryService: GrantDirectoryService,\r\n private readonly notifier: Notifier,\r\n private readonly bindingEngine: BindingEngine) {\r\n super(dataService);\r\n this.grantsList = [];\r\n\r\n this.whoCanApply = [\r\n new SearchPanelCheckboxItem(1, \"Individuals\"),\r\n new SearchPanelCheckboxItem(2, \"Non Profit Organisations\"),\r\n new SearchPanelCheckboxItem(3, \"For Profit Organisations\"),\r\n ];\r\n\r\n this.contentTypes = [\r\n new SearchPanelCheckboxItem(SharedDto.Constants.PublicContentType.Applicant, \"Grant funding\"),\r\n new SearchPanelCheckboxItem(SharedDto.Constants.PublicContentType.ThirdPartyApplicant, \"Vouchers\"),\r\n new SearchPanelCheckboxItem(SharedDto.Constants.PublicContentType.ThirdPartySupplier, \"To be a supplier\"),\r\n ];\r\n\r\n this.grantsAvailable = [\r\n new SearchPanelCheckboxItem(1, \"Open today\"),\r\n new SearchPanelCheckboxItem(2, \"Open in the next week\"),\r\n new SearchPanelCheckboxItem(3, \"Open in the next fortnight\"),\r\n new SearchPanelCheckboxItem(4, \"Open in the next month\"),\r\n ]\r\n }\r\n\r\n activate(params: { agency?: string, category?: string, term?: string }) {\r\n var promises = [];\r\n promises.push(this.dataService.getAgencies().then((data: Array) => {\r\n this.agencies = data.sort((a, b) => a.description.localeCompare(b.description)).map((m: SharedDto.ICodeListItemDto) => new SearchPanelCheckboxItem(m.id, m.description));\r\n }));\r\n\r\n promises.push(this.dataService.getCategoryByLevel(1).then((data: Array) => {\r\n this.categories = data.map((m: SharedDto.ICodeListItemDto) => new SearchPanelCheckboxItem(m.id, m.description));\r\n }));\r\n\r\n promises.push(this.dataService.getBeneficiaries().then((data: Array) => {\r\n this.beneficiaries = data.map((m: SharedDto.IBeneficiaryDto) => new SearchPanelCheckboxItem(m.beneficiaryId, m.display));\r\n }));\r\n\r\n return Promise.all(promises).then(() => {\r\n if (params.agency || params.category || params.term) {\r\n this.selectedAgencies = [];\r\n this.selectedCategories = [];\r\n this.search = \"\";\r\n }\r\n params.agency && this.agencies.find(a => a.value == parseInt(params.agency)) && this.selectedAgencies.push(params.agency);\r\n params.category && this.categories.find(c => c.value == parseInt(params.category)) && this.selectedCategories.push(params.category);\r\n params.term && (this.search = params.term);\r\n return this.doSearch();\r\n });\r\n }\r\n\r\n attached() {\r\n var menu = new MmenuLight(this.offCanvasElement);\r\n this.drawer = menu.offcanvas({ position: 'left' });\r\n\r\n //setup collection observers on selectedX criteria - note, there's no subscriptions being collected for disposal later because this class is a singleton and there's probably no need for an overhead\r\n this.bindingEngine.collectionObserver(this.selectedAgencies).subscribe(() => this.doSearch());\r\n this.bindingEngine.collectionObserver(this.selectedCategories).subscribe(() => this.doSearch());\r\n this.bindingEngine.collectionObserver(this.selectedBeneficiaries).subscribe(() => this.doSearch());\r\n this.bindingEngine.collectionObserver(this.selectedWhoCanApply).subscribe(() => this.doSearch());\r\n this.bindingEngine.collectionObserver(this.selectedGrantsAvailable).subscribe(() => this.doSearch());\r\n this.bindingEngine.collectionObserver(this.selectedContentTypes).subscribe(() => this.doSearch());\r\n }\r\n\r\n clearAllFilters() {\r\n while (this.selectedAgencies.length > 0) {\r\n this.selectedAgencies.pop();\r\n }\r\n while (this.selectedBeneficiaries.length > 0) {\r\n this.selectedBeneficiaries.pop();\r\n }\r\n while (this.selectedWhoCanApply.length > 0) {\r\n this.selectedWhoCanApply.pop();\r\n }\r\n while (this.selectedCategories.length > 0) {\r\n this.selectedCategories.pop();\r\n }\r\n while (this.selectedGrantsAvailable.length > 0) {\r\n this.selectedGrantsAvailable.pop();\r\n }\r\n }\r\n\r\n removePill(pill: SearchPill) {\r\n var thingToRemove: Array;\r\n switch (pill.source) {\r\n case \"categories\": thingToRemove = this.selectedCategories; break;\r\n case \"agencies\": thingToRemove = this.selectedAgencies; break;\r\n case \"beneficiaries\": thingToRemove = this.selectedBeneficiaries; break;\r\n case \"whoCanApply\": thingToRemove = this.selectedWhoCanApply; break;\r\n case \"grantsAvailable\": thingToRemove = this.selectedGrantsAvailable; break;\r\n }\r\n let index = thingToRemove.indexOf(\"\" + pill.id);\r\n thingToRemove = thingToRemove.splice(index, 1);\r\n }\r\n\r\n openFilter() {\r\n this.drawer.open();\r\n }\r\n\r\n pageChanged(newVal: number, oldVal: number) {\r\n if (oldVal == undefined) {\r\n return;\r\n }\r\n scrollIntoViewExternal(this.keywordSearchElement);\r\n this.doSearch();\r\n }\r\n\r\n pageSizeChanged(newVal: number, oldVal: number) {\r\n if (oldVal == undefined) {\r\n return;\r\n }\r\n scrollIntoViewExternal(this.keywordSearchElement);\r\n this.doSearch();\r\n }\r\n\r\n sortFilterChanged(newVal: SortFilterType, oldVal: SortFilterType) {\r\n if (oldVal == undefined) {\r\n return;\r\n }\r\n this.doSearch();\r\n }\r\n\r\n sortClosingSoon() {\r\n this.sortFilter = \"CloseDate\";\r\n }\r\n\r\n sortOpeningSoon() {\r\n this.sortFilter = \"OpenDate\";\r\n }\r\n\r\n sortNewlyListed() {\r\n this.sortFilter = \"NewlyListed\";\r\n }\r\n\r\n doSearch(): Promise {\r\n let searchRequest: Dto.IPublicContentSearchFilterRequestDto = {\r\n agencies: this.selectedAgencies.map(m => parseInt(m)).filter(m => !isNaN(m)),\r\n categories: this.selectedCategories.map(m => parseInt(m)).filter(m => !isNaN(m)),\r\n beneficiaries: this.selectedBeneficiaries.map(m => parseInt(m)).filter(m => !isNaN(m)),\r\n publicContentTypes: this.selectedContentTypes.map(m => parseInt(m)).filter(m => !isNaN(m)),\r\n pageSize: this.pageSize,\r\n page: this.page,\r\n sortColumn: \"\",\r\n sortDirection: SharedDto.Constants.SortDirection.Desc,\r\n keywords: this.search,\r\n contentSlug: \"\"\r\n }\r\n\r\n switch (this.sortFilter) {\r\n default:\r\n case \"NewlyListed\":\r\n searchRequest.sortColumn = \"PublishDateFrom\";\r\n searchRequest.sortDirection = SharedDto.Constants.SortDirection.Desc;\r\n break;\r\n case \"CloseDate\":\r\n searchRequest.sortColumn = \"ApplicationsClose\";\r\n searchRequest.sortDirection = SharedDto.Constants.SortDirection.Asc;\r\n break;\r\n case \"OpenDate\":\r\n searchRequest.sortColumn = \"ApplicationsOpen\";\r\n searchRequest.sortDirection = SharedDto.Constants.SortDirection.Asc;\r\n break;\r\n }\r\n\r\n this.selectedWhoCanApply.forEach(m => {\r\n let who = this.whoCanApply.find(w => w.value == parseInt(m));\r\n switch (who.label) {\r\n case \"Individuals\": searchRequest.individualsCanApply = true; break;\r\n case \"Non Profit Organisations\": searchRequest.nonProfitCanApply = true; break;\r\n case \"For Profit Organisations\": searchRequest.forProfitCanApply = true; break;\r\n }\r\n });\r\n\r\n // somehow this nasty thing works. but it needs to be changed to a radio control - not checkbox.\r\n this.selectedGrantsAvailable.forEach(m => {\r\n let when = this.grantsAvailable.find(g => g.value == parseInt(m));\r\n switch (when.label) {\r\n case \"Open today\": searchRequest.applicationsOpenFrom = moment().format(); break;\r\n case \"Open in the next week\": searchRequest.applicationsOpenFrom = moment().add(7, 'days').format(); break;\r\n case \"Open in the next fortnight\": searchRequest.applicationsOpenFrom = moment().add(14, 'days').format(); break;\r\n case \"Open in the next month\": searchRequest.applicationsOpenFrom = moment().add(1, 'month').format(); break;\r\n }\r\n })\r\n this.isBusy = true;\r\n return this.grantDirectoryService.searchGrants(searchRequest).then((res: Dto.IPublicContentSearchResultsDto) => {\r\n this.grantsList = res.results;\r\n this.totalRecords = res.totalRecords;\r\n this.isBusy = false;\r\n }).catch(error => {\r\n this.notifier.error(\"An unexpected error happened while processing your request.\")\r\n this.isBusy = false;\r\n });\r\n }\r\n\r\n @computedFrom(\"selectedAgencies.length\", \"selectedCategories.length\", \"selectedBeneficiaries.length\", \"selectedWhoCanApply.length\", \"selectedGrantsAvailable.length\")\r\n get selectedOptions() {\r\n let val = this.selectedAgencies.map((m) => this.agencies.find(i => i.value == parseInt(m)))\r\n .filter(a => a != undefined)\r\n .map(a => new SearchPill(a.value, a.label, \"agencies\"))\r\n .concat(\r\n this.selectedBeneficiaries.map(m => this.beneficiaries.find(i => i.value == parseInt(m)))\r\n .filter(a => a != undefined)\r\n .map(a => new SearchPill(a.value, a.label, \"beneficiaries\"))\r\n )\r\n .concat(\r\n this.selectedCategories.map(m => this.categories.find(i => i.value == parseInt(m)))\r\n .filter(a => a != undefined)\r\n .map(a => new SearchPill(a.value, a.label, \"categories\"))\r\n )\r\n .concat(\r\n this.selectedGrantsAvailable.map(m => this.grantsAvailable.find(i => i.value == parseInt(m)))\r\n .filter(a => a != undefined)\r\n .map(a => new SearchPill(a.value, a.label, \"grantsAvailable\"))\r\n )\r\n .concat(\r\n this.selectedWhoCanApply.map(m => this.whoCanApply.find(i => i.value == parseInt(m)))\r\n .filter(a => a != undefined)\r\n .map(a => new SearchPill(a.value, a.label, \"whoCanApply\"))\r\n );\r\n return val.sort((a: SearchPill, b: SearchPill) => a.description.length - b.description.length);\r\n }\r\n}\r\n\r\nclass SearchPill {\r\n id: number;\r\n description: string;\r\n source: \"agencies\" | \"categories\" | \"beneficiaries\" | \"whoCanApply\" | \"grantsAvailable\";\r\n\r\n constructor(id: number, description: string, source: \"agencies\" | \"categories\" | \"beneficiaries\" | \"whoCanApply\" | \"grantsAvailable\") {\r\n this.id = id;\r\n this.description = description;\r\n this.source = source;\r\n }\r\n}\r\n","module.exports = \" \";","import { DialogService } from \"aurelia-dialog\";\r\nimport { autoinject, computedFrom, PLATFORM } from \"aurelia-framework\";\r\nimport { activationStrategy, NavigationInstruction, Redirect, RouteConfig, Router } from \"aurelia-router\";\r\nimport { AuthManager } from \"auth/auth-manager\";\r\nimport { IContactProfileModel } from \"grants/enquire/enquire-modal\";\r\nimport { ActiveProfile } from \"models/active-profile\";\r\nimport { Dto } from \"project/project\";\r\nimport { SharedDto } from \"project/project-shared\";\r\nimport { ApplicationService } from \"services/application-service\";\r\nimport { GrantDirectoryService } from \"services/grant-directory-service\";\r\nimport { Notifier } from \"services/notifier\";\r\nimport { ProfileService } from \"services/profile-service\";\r\nimport { SlugifyService } from \"services/slugify-service\";\r\nimport { generateApplicationUrl } from \"services/url-generators\";\r\nimport { Confirm } from \"shared/controls/confirm-modal/confirm\";\r\nimport { ROUTE_APPLICATIONS, ROUTE_GRANTS_DIRECTORY } from \"utils/router-constants\";\r\n\r\n@autoinject\r\nexport class GrantDetailsView {\r\n\r\n model: SharedDto.PublicContent.IPublicContentDetailViewDto;\r\n notFound: boolean;\r\n queryString: string;\r\n currentRoute: string;\r\n\r\n enquireBusy: boolean;\r\n isBusy: boolean = false;\r\n canView: boolean = false;\r\n canEdit: boolean = false;\r\n\r\n profile: ActiveProfile;\r\n userDetails: Dto.IUserResponse;\r\n\r\n mainDescriptionString: string;\r\n descriptionElm: Element;\r\n contentId: string | number;\r\n supplierContentId: string | number;\r\n\r\n googleBreadcrumbScriptElem: HTMLScriptElement;\r\n googleArticleScriptElem: HTMLScriptElement;\r\n\r\n grantSearchRoute = ROUTE_GRANTS_DIRECTORY;\r\n\r\n constructor(private authManager: AuthManager,\r\n private readonly notifier: Notifier,\r\n private readonly dialogService: DialogService,\r\n private readonly profileService: ProfileService,\r\n private readonly grantDirectoryService: GrantDirectoryService,\r\n private readonly router: Router,\r\n private readonly slugify: SlugifyService,\r\n private readonly applicationService: ApplicationService,\r\n private readonly confirm: Confirm) {\r\n }\r\n\r\n canActivate(params: { contentIdentifier: any, supplierContentIdentifier?: any, invitation?: any }) {\r\n //a catch to redirect links still using the old identifiers\r\n if (this.slugify.isNumber(params.contentIdentifier)) {\r\n return this.slugify.getContentSlug(+params.contentIdentifier).then(slug => {\r\n if (slug != null && slug != \"\") {\r\n let supplierLink = this.router.generate(Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.GrantsDetail], { contentIdentifier: slug, invitation: params.invitation });\r\n return new Redirect(supplierLink);\r\n }\r\n return true;\r\n })\r\n }\r\n return true;\r\n }\r\n\r\n determineActivationStrategy() {\r\n //to get the animation of the page changing when switching between applicant and supplier public contents\r\n return activationStrategy.replace;\r\n }\r\n\r\n activate(params: { contentIdentifier: string | number, supplierContentIdentifier?: number }, routeConfig: RouteConfig, navigationInstruction: NavigationInstruction) {\r\n this.contentId = params.contentIdentifier;\r\n this.supplierContentId = params.supplierContentIdentifier;\r\n\r\n return this.grantDirectoryService.getGrantByIdOrSlug(this.supplierContentId || this.contentId).then(data => {\r\n this.model = data;\r\n\r\n if (data == null) {\r\n //if no content returned, show the no-content page.\r\n this.notFound = true;\r\n return;\r\n }\r\n\r\n this.canView = this.canEdit = true;\r\n\r\n //Set page title on load and populate description field with data for google\r\n this.setMetaInformation();\r\n routeConfig.navModel.title = this.model.grantName;\r\n\r\n this.profileService.getActiveProfile().then(profile => {\r\n this.profile = profile;\r\n })\r\n\r\n this.profileService.getAccount().then(account => {\r\n this.userDetails = account;\r\n });\r\n }).catch(data => {\r\n //todo: the flow of this seems strange. What if the error is not slug related?\r\n this.grantDirectoryService.hasOldUrl(this.contentId, 'GrantDetail')\r\n });\r\n }\r\n\r\n attached() {\r\n this.setArticle(true);\r\n }\r\n\r\n deactivate() {\r\n //reset description/keywords for google SEO\r\n this.setKeywords([]);\r\n this.setArticle(false);\r\n if (this.descriptionElm) {\r\n this.descriptionElm.setAttribute(\"content\", this.mainDescriptionString);\r\n }\r\n }\r\n\r\n private setMetaInformation() {\r\n let description = this.descriptionString(this.model.overviewHtml);\r\n this.descriptionElm = document.querySelector(\"meta[name=description]\");\r\n if (this.descriptionElm) {\r\n this.mainDescriptionString = this.descriptionElm.getAttribute(\"content\");\r\n this.descriptionElm.setAttribute(\"content\", description);\r\n }\r\n this.setKeywords(this.model.categories);\r\n }\r\n\r\n private descriptionString(htmlIn: String): string {\r\n let reg: RegExp = new RegExp('\\|\\<\\/p\\>', 'gi');\r\n return htmlIn.replace(reg, \"\");\r\n }\r\n\r\n private setKeywords(keys: string[]) {\r\n let elm = document.getElementById(\"grantKeys\");\r\n if (keys.length > 0) {\r\n elm.setAttribute(\"content\", keys.join(\",\"));\r\n } else {\r\n elm.setAttribute(\"content\", \"\");\r\n }\r\n }\r\n\r\n private setArticle(setup: Boolean) {\r\n if(this.notFound) {\r\n return;\r\n }\r\n if (!setup) {\r\n this.googleArticleScriptElem.innerText = \"\";\r\n this.googleBreadcrumbScriptElem.innerText = \"\";\r\n return;\r\n }\r\n //Google Article setup\r\n this.googleArticleScriptElem.innerText = JSON.stringify({\r\n '@context': \"https://schema.org\",\r\n '@type': 'NewsArticle',\r\n 'mainEntityOfPage': {\r\n \"@type\": \"WebPage\",\r\n \"@id\": window.location.origin + \"/grants/search\"\r\n },\r\n 'headline': this.model.grantName,\r\n \"image\": [window.location.origin + \"/App/assets/images/ntg-Google.png\"],\r\n \"datePublished\": new Date().toISOString(),\r\n \"dateModified\": new Date().toISOString(),\r\n \"author\": {\r\n \"@type\": \"Organization\",\r\n \"name\": this.model.agency\r\n },\r\n \"publisher\": {\r\n \"@type\": \"Organization\",\r\n \"name\": \"Northern Territory Government\",\r\n \"logo\": {\r\n \"@type\": \"ImageObject\",\r\n \"url\": window.location.origin + \"/App/assets/images/ntg-Google.png\"\r\n }\r\n },\r\n \"description\": this.descriptionString(this.model.overviewHtml)\r\n });\r\n\r\n //Bread crumb setup\r\n this.googleBreadcrumbScriptElem.innerText = JSON.stringify({\r\n \"@context\": \"https://schema.org\",\r\n \"@type\": \"BreadcrumbList\",\r\n \"itemListElement\": [\r\n {\r\n \"@type\": \"ListItem\",\r\n \"position\": 1,\r\n \"name\": \"GrantsNT\",\r\n \"item\": window.location.origin\r\n },\r\n {\r\n \"@type\": \"ListItem\",\r\n \"position\": 2,\r\n \"name\": \"Grants List\",\r\n \"item\": window.location.origin + \"/grants/search\"\r\n },\r\n {\r\n \"@type\": \"ListItem\",\r\n \"position\": 3,\r\n \"name\": this.model.grantName,\r\n \"item\": window.location.origin + \"/grants/\" + this.model.publicContentId\r\n }\r\n ]\r\n });\r\n }\r\n\r\n enquire() {\r\n this.enquireBusy = true;\r\n let promises: [Promise, Promise] = (\r\n this.authManager.isLoggedIn\r\n ? [this.profileService.getActiveProfile(), this.profileService.getIndividualProfile()]\r\n : [Promise.resolve(null), Promise.resolve(null)]\r\n );\r\n //todo: move this logic into the modal, have the modal close once complete.\r\n Promise.all(promises).catch(() => [null, null]).then(profiles => {\r\n let contactModel = {\r\n contactName: profiles[0] ? profiles[0].profileUserFullname : null,\r\n contactEmail: profiles[1] ? profiles[1].emailAddress : null,\r\n contactPhone: profiles[1] ? profiles[1].mobilePhoneNumber : null,\r\n contactType: profiles[0] ? profiles[0].profileType : null,\r\n contactOrganisation: profiles[0] ? profiles[0].profileDisplayName : null,\r\n organisationId: profiles[0] && profiles[0].profileType === 'Organisation' ? profiles[0].profileIdentifier : null,\r\n enquiry: null\r\n } as IContactProfileModel;\r\n return this.dialogService.open({\r\n viewModel: PLATFORM.moduleName('grants/enquire/enquire-modal'),\r\n model: contactModel,\r\n rejectOnCancel: true\r\n }).whenClosed((response) => {\r\n return this.grantDirectoryService.grantEnquiry(this.model.publicContentId, {\r\n contactEmail: response.output.contactEmail,\r\n contactName: response.output.contactName,\r\n contactPhone: response.output.contactPhone,\r\n enquiry: response.output.enquiry,\r\n recaptchaResponse: response.output.recaptchaResponse,\r\n organisationId: response.output.organisationId\r\n });\r\n });\r\n }).then(() => {\r\n this.notifier.success(\"Your enquiry has been submitted\");\r\n }).catch(error => {\r\n if (error.hasOwnProperty('wasCancelled')) { return; }\r\n this.notifier.error(\"Your enquiry could not be submitted. Please try again.\");\r\n console.log(error);\r\n }).then(() => {\r\n this.enquireBusy = false;\r\n });\r\n }\r\n\r\n async apply() {\r\n this.router.navigateToRoute(\"Apply\", { contentIdentifier: this.model.contentSlug ? this.model.contentSlug : this.model.publicContentId, roundIdentifier: this.model.grantRoundSlug ? this.model.grantRoundSlug : this.model.roundId });\r\n }\r\n\r\n // application is both available for organisations and individuals\r\n profileInterstitial() {\r\n let orgProfileType = SharedDto.Constants.FormProfileType[SharedDto.Constants.FormProfileType.Organisation]\r\n let indProfileType = SharedDto.Constants.FormProfileType[SharedDto.Constants.FormProfileType.Individual]\r\n\r\n let otherProfileType = this.profile.profileType === orgProfileType ? indProfileType : orgProfileType;\r\n let currentProfileName = this.profile.profileDisplayName ? this.profile.profileDisplayName : this.profile.profileUserFullname;\r\n //common profile switcher modal might be handy here - force certain profile type selection or cancel kind of workflow.\r\n return this.confirm.confirm(`This application will be created for ${currentProfileName}, however it is also open to ${otherProfileType}. Please confirm you are submitting for the right profile.`)\r\n .then(response => {\r\n if (response) {\r\n this.isBusy = true;\r\n this.router.navigateToRoute(\"Apply\", { contentIdentifier: this.model.contentSlug ? this.model.contentSlug : this.model.publicContentId, roundIdentifier: this.model.grantRoundSlug ? this.model.grantRoundSlug : this.model.roundId });\r\n }\r\n });\r\n }\r\n\r\n @computedFrom(\"model.roundId\", \"singleExistingApplication\")\r\n get existingApplciationLink(): string {\r\n if (this.singleExistingApplication) {\r\n return generateApplicationUrl(this.singleExistingApplication);\r\n }\r\n if (this.model.existingApplications.length > 1) {\r\n return this.router.generate(ROUTE_APPLICATIONS, { roundId: this.model.roundId })\r\n }\r\n return null;\r\n }\r\n\r\n @computedFrom(\"model.canPotentiallyApplyNow\", \"model.applyNow\")\r\n get showApplyNow(): boolean {\r\n return this.model.canPotentiallyApplyNow && !this.model.nonConcurrentAndStillProcessing && (this.model.applyNow && this.model.applyNow.errors.length == 0);\r\n }\r\n\r\n @computedFrom(\"model.applyNow\", \"isBusy\")\r\n get applyNowDisabled(): boolean {\r\n return !this.model.applyNow.successful //some check failed..\r\n || this.isBusy;//we're already procesing something\r\n }\r\n\r\n @computedFrom(\"model.applyNow\")\r\n get applyNowWarning(): string {\r\n if (!this.model || !this.model.applyNow) {\r\n return null;\r\n }\r\n if (!this.model.applyNow.successful) {\r\n if (this.model.applyNow.warnings instanceof Array && this.model.applyNow.warnings.length > 0) {\r\n return this.model.applyNow.warnings[0];\r\n }\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n @computedFrom(\"model.applyNow\")\r\n get applyNowError(): string {\r\n if (!this.model || !this.model.applyNow) {\r\n return null;\r\n }\r\n if (!this.model.applyNow.successful) {\r\n if (this.model.applyNow.errors instanceof Array && this.model.applyNow.errors.length > 0) {\r\n return this.model.applyNow.errors[0];\r\n }\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n @computedFrom(\"router.currentInstruction\")\r\n get changeProfilesHref(): string {\r\n return this.router.generate(Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.ProfileSelect], {\r\n redirect: this.router.currentInstruction.parentInstruction.fragment,\r\n q: this.router.currentInstruction.parentInstruction.queryString\r\n });\r\n }\r\n\r\n @computedFrom(\"canView\", \"canEdit\", \"model.existingApplications\")\r\n get showOpenExistingApplication(): boolean {\r\n return this.model.existingApplications && (this.canView || this.canEdit);\r\n }\r\n\r\n @computedFrom(\"canView\", \"canEdit\", \"model.existingApplications\")\r\n get singleExistingApplication(): number | null {\r\n if (this.model.existingApplications && (this.canView || this.canEdit) && this.model.existingApplications.length == 1) {\r\n return this.model.existingApplications[0];\r\n }\r\n return null;\r\n }\r\n\r\n @computedFrom(\"model.supplierPublicContentId\", \"model.publicContentId\")\r\n get displaySupplierLink(): boolean {\r\n //do not display if there is no supplier content link\r\n if (!this.model.supplierPublicContentId) {\r\n return false;\r\n }\r\n //display if we're not already viewing the supplier content\r\n return this.model.supplierPublicContentId !== this.model.publicContentId;\r\n }\r\n}\r\n","module.exports = \" \";","import { autoinject } from 'aurelia-framework';\r\n\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\n\r\n@autoinject\r\nexport class Help extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \" \";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class FAQ extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \" \";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class ApplyForGrant extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class ApplyForGrantLanding extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class GrantEnquiry extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class GrantSearch extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class GrantSubscription extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \" \";","import { autoinject } from 'aurelia-framework';\r\n\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\n\r\n@autoinject\r\nexport class CompHelp extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \" \";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../assets/video/introduction.mp4\";\r\nimport \"../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class Introduction extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class ApplicationManagement extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class Correspondence extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class ManageGrantLanding extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class Reporting extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class ROI extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class ViewAwarded extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/video/createOrgProfile.mp4\"\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class CreateOrgProfile extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\nimport \"../../../../assets/video/joinOrg.mp4\";\r\n\r\n@autoinject\r\nexport class JoinAnOrg extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/video/manageProfileAccess.mp4\"\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class ManageProfileAccess extends ModuleBase {\r\n\tconstructor(dataService: DataService) {\r\n\t\tsuper(dataService);\r\n\t}\r\n}\r\n","module.exports = \" \";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/video/orgUserAccess.mp4\"\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class OrgUserAccess extends ModuleBase {\r\n\tconstructor(dataService: DataService) {\r\n\t\tsuper(dataService);\r\n\t}\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class SetupLanding extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from \"aurelia-dependency-injection\";\r\nimport { SharedDto } from \"project/project-shared\";\r\nimport { computedFrom } from \"aurelia-binding\";\r\nimport { bindable } from \"aurelia-templating\";\r\nimport { bindingMode } from \"aurelia-binding\";\r\nimport $clamp from \"clamp-js\";\r\nimport \"./grant-card-view.less\";\r\nrequire('readmore-js');\r\n\r\n@autoinject\r\nexport class GrantCardView {\r\n\r\n @bindable({ defaultBindingMode: bindingMode.twoWay }) model: SharedDto.PublicContent.IPublicContentSummaryViewDto;\r\n overviewElement: HTMLDivElement;\r\n agencySpan: HTMLSpanElement;\r\n\r\n attached() {\r\n $clamp(this.agencySpan, { clamp: 2 });\r\n $clamp(this.overviewElement, { clamp: 4 });\r\n }\r\n\r\n @computedFrom(\"model\")\r\n get overviewFirstParagraph(): string {\r\n var startIndex = this.model.overviewHtml.indexOf(\"

\")\r\n var endIndex = this.model.overviewHtml.indexOf(\"

\") + 4;\r\n return this.model.overviewHtml.substr(startIndex, endIndex - startIndex);\r\n }\r\n\r\n @computedFrom(\"model\")\r\n get availableTo(): string {\r\n if (this.model) {\r\n if (this.model.isIndividualEligible && this.model.isOrganisationEligible) {\r\n return \"Individuals and Organisations\"\r\n }\r\n else if (this.model.isIndividualEligible) {\r\n return \"Individuals\"\r\n }\r\n else {\r\n return \"Organisations\"\r\n }\r\n } else {\r\n return \"\";\r\n }\r\n }\r\n\r\n @computedFrom(\"model\")\r\n get showFunding(): boolean {\r\n return this.model.showGlobalMaxFunding && this.model.globalFundingMax !== null && this.model.globalFundingMax > 0;\r\n }\r\n\r\n get firstCategory(): string {\r\n if (this.model && this.model.categories.length > 0) {\r\n return this.model.categories[0];\r\n }\r\n return null;\r\n }\r\n\r\n get otherCategoriesText(): string {\r\n if (this.model && this.model.categories.length > 1) {\r\n var returnString = \"\";\r\n for (let i = 1; i < this.model.categories.length; i++) {\r\n if (i > 1) {\r\n returnString += \", \";\r\n }\r\n returnString += this.model.categories[i];\r\n }\r\n return returnString;\r\n }\r\n return null;\r\n }\r\n}\r\n","module.exports = \" \";","import { bindingMode, computedFrom } from \"aurelia-binding\";\r\nimport { autoinject } from \"aurelia-dependency-injection\";\r\nimport { bindable } from \"aurelia-templating\";\r\nimport { SharedDto } from \"project/project-shared\";\r\nimport \"./grant-detail-view.less\";\r\n\r\n@autoinject\r\nexport class GrantDetailView {\r\n\r\n @bindable({ defaultBindingMode: bindingMode.twoWay }) model: SharedDto.PublicContent.IPublicContentDetailViewDto;\r\n\r\n @computedFrom(\"model\")\r\n get availableTo(): string {\r\n if (this.model) {\r\n if (this.model.isIndividualEligible && this.model.isOrganisationEligible) {\r\n return \"Individuals and Organisations\"\r\n }\r\n else if (this.model.isIndividualEligible) {\r\n return \"Individuals\"\r\n }\r\n else {\r\n return \"Organisations\"\r\n }\r\n } else {\r\n return \"\";\r\n }\r\n }\r\n\r\n @computedFrom(\"model.publicContentType\")\r\n get showSupplierListLink(): boolean {\r\n return this.model.publicContentType === SharedDto.Constants.PublicContentType.ThirdPartyApplicant ||\r\n this.model.publicContentType === SharedDto.Constants.PublicContentType.ThirdPartySupplier;\r\n }\r\n}\r\n","module.exports = \" \";","import { autoinject } from \"aurelia-dependency-injection\";\r\nimport { SharedDto } from \"project/project-shared\";\r\nimport { computedFrom } from \"aurelia-binding\";\r\nimport { bindable } from \"aurelia-templating\";\r\nimport { bindingMode } from \"aurelia-binding\";\r\nimport \"./grant-summary-view.less\";\r\nrequire('readmore-js');\r\n\r\n@autoinject\r\nexport class GrantSummaryView {\r\n\r\n @bindable({ defaultBindingMode: bindingMode.twoWay }) model: SharedDto.PublicContent.IPublicContentSummaryViewDto;\r\n overviewElement: Element;\r\n\r\n attached() {\r\n $(this.overviewElement).readmore({\r\n collapsedHeight: 75,\r\n moreLink: '
+ Read more',\r\n lessLink: ' - Show less'\r\n });\r\n }\r\n\r\n detached() {\r\n $(this.overviewElement).readmore('destroy');\r\n }\r\n\r\n @computedFrom(\"model\")\r\n get availableTo(): string {\r\n if (this.model) {\r\n if (this.model.isIndividualEligible && this.model.isOrganisationEligible) {\r\n return \"Individuals and Organisations\"\r\n }\r\n else if (this.model.isIndividualEligible) {\r\n return \"Individuals\"\r\n }\r\n else {\r\n return \"Organisations\"\r\n }\r\n } else {\r\n return \"\";\r\n }\r\n }\r\n\r\n @computedFrom(\"model\")\r\n get overviewFirstParagraph(): string {\r\n var startIndex = this.model.overviewHtml.indexOf(\"

\")\r\n var endIndex = this.model.overviewHtml.indexOf(\"

\") + 4;\r\n return this.model.overviewHtml.substr(startIndex, endIndex - startIndex);\r\n }\r\n\r\n get firstCategory(): string {\r\n if (this.model && this.model.categories.length > 0) {\r\n return this.model.categories[0];\r\n }\r\n return null;\r\n }\r\n\r\n @computedFrom(\"model\")\r\n get showFunding(): boolean {\r\n return this.model.showGlobalMaxFunding && this.model.globalFundingMax !== null && this.model.globalFundingMax > 0;\r\n }\r\n\r\n get otherCategoriesText(): string {\r\n if (this.model && this.model.categories.length > 1) {\r\n var returnString = \"\";\r\n for (let i = 1; i < this.model.categories.length; i++) {\r\n if (i > 1) {\r\n returnString += \", \";\r\n }\r\n returnString += this.model.categories[i];\r\n }\r\n return returnString;\r\n }\r\n return null;\r\n }\r\n}\r\n","module.exports = \"\";","import { computedFrom, observable } from 'aurelia-binding';\r\nimport { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { autoinject } from 'aurelia-framework';\r\nimport { Router } from 'aurelia-router';\r\nimport { SharedDto } from 'project/project-shared';\r\nimport { FeaturedGrantService } from 'services/featured-grant-service';\r\nimport { generateGrantUrl } from 'services/url-generators';\r\nimport { DeviceLayoutChangedEvent, ResponsiveLayoutService } from 'shared/utils/responsive-layout-service';\r\nimport { ROUTE_GRANTS_DIRECTORY } from 'utils/router-constants';\r\nimport { Dto } from \"./project/project\";\r\nimport { DataService } from './services/data-service';\r\nimport { GrantDirectoryService } from \"./services/grant-directory-service\";\r\n\r\n@autoinject\r\nexport class Welcome {\r\n\r\n grants: Array;\r\n rows: Array> = [];\r\n agencies: Array;\r\n categories: Array;\r\n selectedCategory: number;\r\n selectedAgency: number;\r\n searchTerm: string;\r\n routeGrantsDirectory: string = ROUTE_GRANTS_DIRECTORY;\r\n featuredGrants: SharedDto.FeaturedGrant.IExternalHomePageFeaturedGrantDto[];\r\n \r\n @observable() latestGrantsPage: number = 1;\r\n @observable() latestGrantsPageSize: number = 3;\r\n @observable() latestGrantsCarouselDirectionClass: \"moving-left\" | \"moving-right\" = null;\r\n\r\n constructor(private readonly grantsDirectoryService: GrantDirectoryService,\r\n private readonly dataService: DataService,\r\n private readonly router: Router,\r\n private readonly responsiveLayoutService: ResponsiveLayoutService,\r\n private readonly featuredGrantService: FeaturedGrantService,\r\n private readonly eventAggregator: EventAggregator) {\r\n }\r\n\r\n activate() {\r\n let promises = [\r\n this.grantsDirectoryService.getMostRecentGrants().then((res: Dto.IPublicContentSearchResultsDto) => {\r\n this.grants = res.results;\r\n }),\r\n this.dataService.getAgencies().then((res: Array) => {\r\n this.agencies = res;\r\n }),\r\n this.dataService.getCategoryByLevel(1).then((res: Array) => {\r\n this.categories = res;\r\n }),\r\n this.featuredGrantService.getFeaturedGrant(5, false).then((res: SharedDto.FeaturedGrant.IExternalHomePageFeaturedGrantDto[]) => {\r\n this.featuredGrants = res; \r\n }), \r\n ];\r\n\r\n return Promise.all(promises);\r\n }\r\n\r\n attached() {\r\n this.adjustPageSizeBasedOnDeviceWidth(this.responsiveLayoutService.value);\r\n this.eventAggregator.subscribe(DeviceLayoutChangedEvent, (screenSize: \"xs\" | \"sm\" | \"md\" | \"lg\") => this.adjustPageSizeBasedOnDeviceWidth(screenSize));\r\n }\r\n\r\n adjustPageSizeBasedOnDeviceWidth(screenSize: \"xs\" | \"sm\" | \"md\" | \"lg\") {\r\n switch (screenSize) {\r\n case \"xs\":\r\n this.latestGrantsPageSize = 1;\r\n break;\r\n case \"sm\":\r\n this.latestGrantsPageSize = 2;\r\n break;\r\n case \"md\":\r\n case \"lg\":\r\n this.latestGrantsPageSize = 3;\r\n break;\r\n }\r\n }\r\n\r\n doSearch() {\r\n let searchParams = {\r\n category: this.selectedCategory,\r\n agency: this.selectedAgency,\r\n term: this.searchTerm\r\n };\r\n\r\n this.router.navigateToRoute(ROUTE_GRANTS_DIRECTORY, searchParams);\r\n }\r\n\r\n generateGrantUrl(contentIdentifier: string | number): string {\r\n return generateGrantUrl(contentIdentifier);\r\n }\r\n\r\n @computedFrom(\"grants\", \"latestGrantsPage\", \"latestGrantsPageSize\")\r\n get visibleGrants() {\r\n //if we've navigated to a page that doesn't exist (or the screen size results in showing less), reset page to 1.\r\n if ((this.latestGrantsPage * this.latestGrantsPageSize) - this.latestGrantsPageSize >= this.grants.length) {\r\n this.latestGrantsPage = 1;\r\n }\r\n //find the starting index to start taking records\r\n var index = this.latestGrantsPage > 1 ? (this.latestGrantsPage * this.latestGrantsPageSize) - this.latestGrantsPageSize : 0;\r\n //take 3 records\r\n var latestGrants = [];\r\n for (let i = index; i < this.grants.length && i < index + this.latestGrantsPageSize; i++) {\r\n latestGrants.push(this.grants[i]);\r\n }\r\n return latestGrants;\r\n }\r\n\r\n latestGrantsNextPage() {\r\n if (this.grants && this.grants.length > this.latestGrantsPage * this.latestGrantsPageSize) {\r\n this.latestGrantsCarouselDirectionClass = \"moving-right\";\r\n this.latestGrantsPage = this.latestGrantsPage + 1;\r\n }\r\n }\r\n\r\n latestGrantsPreviousPage() {\r\n if (this.latestGrantsPage > 1) {\r\n this.latestGrantsCarouselDirectionClass = \"moving-left\";\r\n this.latestGrantsPage = this.latestGrantsPage - 1;\r\n }\r\n }\r\n\r\n @computedFrom(\"grants\", \"latestGrantsPage\", \"latestGrantsPageSize\")\r\n get latestGrantsNextDisabled(): boolean {\r\n //next should be disabled when page * 3 >= length\r\n if (this.grants && this.grants.length <= this.latestGrantsPage * this.latestGrantsPageSize) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n @computedFrom(\"grants\", \"latestGrantsPage\", \"latestGrantsPageSize\")\r\n get latestGrantsPreviousDisabled(): boolean {\r\n return this.latestGrantsPage < 2;\r\n }\r\n\r\n @computedFrom(\"featuredGrants\")\r\n get featureGrantActive(): boolean { \r\n return this.featuredGrants && this.featuredGrants.length > 0;\r\n }\r\n}\r\n","module.exports = \" \";"],"sourceRoot":""}