{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./Usc.Web/scripts/bundles/programitem2022/_programitem2022.js","webpack:///./Usc.Web/scripts/bundles/programitem2022/controller.js"],"names":["installedModules","__webpack_require__","moduleId","module","i","l","exports","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","angular","controller","DOM","INT","AUD","filterValid","this","findValidLocationForAudience","validLocation","locationButtons","find","e","getAttribute","includes","audience","onLocationSelect","innerText","trim","location","cricosElement","document","getElementById","style","display","toLowerCase","onAudienceSelect","localStorage","setItem","substring","currentLocationAudience","_locationButtons$find","filterableElements","forEach","locAttribute","validLoc","audAttribute","validAud","classList","defaultAudienceArray","Array","from","querySelectorAll","map","x","split","flat","filter","v","arr","indexOf","pathways","length","parentElement","setAttribute","getItem","search","locationElements","audienceElements","locationDropdown"],"mappings":"KACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,IAIIC,EAJJ,OAAGH,EAAiBE,KAIhBC,EAASH,EAAiBE,GAAY,CACzCE,EAAGF,EACHG,EAAG,GACHC,QAAS,EACV,EAGAC,EAAQL,GAAUM,KAAKL,EAAOG,QAASH,EAAQA,EAAOG,QAASL,CAAmB,EAGlFE,EAAOE,EAAI,GAGJF,IAhB4BG,OAiBpC,CAIAL,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASL,EAASM,EAAMC,GAC3CZ,EAAoBa,EAAER,EAASM,CAAI,GACtCG,OAAOC,eAAeV,EAASM,EAAM,CAAEK,WAAY,GAAMC,IAAKL,CAAO,CAAC,CAExE,EAGAZ,EAAoBkB,EAAI,SAASb,GACX,aAAlB,OAAOc,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeV,EAASc,OAAOC,YAAa,CAAEC,MAAO,QAAS,CAAC,EAEvEP,OAAOC,eAAeV,EAAS,aAAc,CAAEg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Ae,cAAc,EAAE+B,cAAcC,aAAa,WAAY,UAAU,EAIjG/C,KAAKQ,SAA0C,GAA/BwB,EAAqBa,QAAoBb,EAAqB,KAAOnC,EAAMA,EAAMD,GAGtD,QAAtCwB,aAAa4B,QAAQ,WAAW,GAAepC,SAASqC,OAAO1C,SAAS,UAAU,IAAMyB,EAAqBzB,SAASV,CAAG,EAAGG,KAAKQ,SAAWX,EACxIe,SAASqC,OAAO1C,SAAS,UAAU,GAAKyB,EAAqBzB,SAASX,CAAG,IAAGI,KAAKQ,SAAWZ,GAjBrG,IAoBMsD,EAAmBpC,SAASqB,iBAAiB,YAAY,EACzDgB,EAAmBrC,SAASqB,iBAAiB,YAAY,EAE/D,IAAMV,EAAqB,CAAC,GAAGyB,EAAkB,GAAGC,GAC9ChD,EAAkB8B,MAAMC,KAAKkB,iBAAiBjB,iBAAiB,QAAQ,CAAC,EAG9EnC,KAAKC,6BAA6B,CACtC,EAEkF,C","file":"programitem2022-bundle-8d1b1e0a3003307730a0.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/dist/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 66);\n","import './controller.js';\r\n//import '../programitem/studentprofilemodal';\r\n\r\nimport 'Sass/views/program-item-2022.scss';","(function () {\r\n 'use strict';\r\n\r\n /*\r\n * Until we have an actual functioning curriculum information management system, this is as good as it gets.\r\n * @param {any} $scope\r\n * @param {any} $q\r\n * @param {any} capsService\r\n */\r\n function controller() {\r\n\r\n const DOM = 'domestic';\r\n const INT = 'international';\r\n const LOC = 'location';\r\n const AUD = 'audience';\r\n\r\n this.findValidLocationForAudience = () => {\r\n const validLocation = locationButtons.find(e => e.getAttribute(AUD).includes(this.audience));\r\n if (validLocation) {\r\n this.onLocationSelect(validLocation.innerText.trim());\r\n }\r\n }\r\n\r\n this.onLocationSelect = location => {\r\n this.location = location;\r\n filterValid();\r\n const cricosElement = document.getElementById('cricos');\r\n\r\n if (cricosElement) {\r\n cricosElement.style.display = this.location.toLowerCase() === 'online' ? 'none' : 'block';\r\n }\r\n }\r\n\r\n this.onAudienceSelect = audience => {\r\n this.audience = audience.toLowerCase();\r\n localStorage.setItem('view_pref', this.audience.substring(0, 3));\r\n\r\n filterValid();\r\n\r\n // if the current location isn't available to the selected type, find the first valid\r\n // it's a bit ugly as it requires getting the node from the dropdown to check the audience\r\n const currentLocationAudience = locationButtons.find(e => e.innerText.trim() === this.location)?.getAttribute(AUD);\r\n if (currentLocationAudience && !currentLocationAudience.includes(this.audience)) {\r\n this.findValidLocationForAudience();\r\n }\r\n }\r\n\r\n const filterValid = () => {\r\n filterableElements.forEach(e => {\r\n const locAttribute = e.getAttribute(LOC);\r\n const validLoc = !locAttribute || locAttribute.includes(this.location);\r\n const audAttribute = e.getAttribute(AUD);\r\n const validAud = !audAttribute || audAttribute.includes(this.audience);\r\n\r\n e.classList[validLoc && validAud ? 'remove' : 'add']('d-none');\r\n e.classList[validLoc && validAud ? 'add' : 'remove']('pulse');\r\n });\r\n }\r\n\r\n // set the default location, trigger events\r\n // default location is determined by checking the header blocks\r\n const defaultAudienceArray = Array.from(document.querySelectorAll('.program-header--text [audience]'))\r\n .map(x => x.getAttribute('audience').split(' '))\r\n .flat()\r\n .filter((v, i, arr) => arr.indexOf(v) === i);\r\n\r\n // hide pathways for international if no pathways applicable\r\n if (defaultAudienceArray.includes(INT) && document.getElementById('pathways')) {\r\n const intPathways = pathways.querySelectorAll('[audience*=\"international\"]');\r\n if (intPathways.length == 0) {\r\n document.getElementById('pathways-tab').parentElement.setAttribute('audience', 'domestic');\r\n }\r\n }\r\n\r\n this.audience = defaultAudienceArray.length == 2 ? DOM : defaultAudienceArray[0] === INT ? INT : DOM;\r\n\r\n // override if querystring sets value or if localstore has international preference\r\n if ((localStorage.getItem('view_pref') === 'int' || location.search.includes('view=int')) && defaultAudienceArray.includes(INT)) this.audience = INT;\r\n else if (location.search.includes('view=dom') && defaultAudienceArray.includes(DOM)) this.audience = DOM;\r\n\r\n // find all elements with location attribute, hide em\r\n const locationElements = document.querySelectorAll('[location]');\r\n const audienceElements = document.querySelectorAll('[audience]');\r\n\r\n const filterableElements = [...locationElements, ...audienceElements];\r\n const locationButtons = Array.from(locationDropdown.querySelectorAll('button'));\r\n\r\n // cascades through locationSelect and filterValid\r\n this.findValidLocationForAudience();\r\n }\r\n\r\n angular.module('Uscapp').controller('Usc.ProgramItem2022.Controller', [controller]);\r\n}());\r\n"],"sourceRoot":""}