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qB,EAAgB,GAEdC,EAAoB7B,KAAKF,OAAOiB,eACnCe,MAAM,KAAK,GACXN,OACAC,cACGM,EAAmB,IAAIC,KAAKC,eAChC,QACA5C,EAAgBwC,IAEfK,cAAc,IAAIC,MAClBC,QAAO,SAACC,GAAa,MAA4B,iBAAvBA,EAAcC,IAAuB,IAClE,OAAIP,GACFH,EAAgBG,EAAiB,GAAGxB,MAC7B,UAAPW,OAAiBU,IAEZ5B,KAAKF,OAAOiB,cACrB,GAAC,CAAAT,IAAA,0BAAAC,MAED,SAAwBI,GACtB,IACMb,GAAUe,OAAO0B,SAASC,MAAQ,IAAIV,MAAM,KAAK,GAEjDW,GADe3C,GAAUA,EAAOgC,MAAM,MAAS,IAC1BM,QAAO,SAACM,GAAI,OAAKA,EAAKC,QAHlC,WAGqD,CAAC,IAAE,GAIvE,OAHIF,GAAUA,EAAOX,MAAM,KAAKc,OAAS,IACvCjC,EAAkBA,EAAkB,IAAM8B,GAErC9B,CACT,M,oEAACf,CAAA,CA1EoB,E","sources":["webpack:///./resources/js/common/job-posting-detail.ts"],"sourcesContent":["const timeZoneOptions = {\n  pt: {\n    timeZone: \"America/Los_Angeles\",\n    timeZoneName: \"short\",\n  },\n  ct: {\n    timeZone: \"America/Chicago\",\n    timeZoneName: \"short\",\n  },\n  et: {\n    timeZone: \"America/New_York\",\n    timeZoneName: \"short\",\n  },\n};\n\nconst listOfModfiedTags = [\"remote pt\", \"remote ct\", \"remote et\"];\n\nclass JobPostingDetails {\n  domRoot: HTMLElement;\n  params: any;\n  targetedParagraph: any;\n  $applyLink: JQuery<HTMLElement>;\n\n  constructor(domRoot: HTMLElement, params: any) {\n    this.domRoot = domRoot;\n    this.params = params;\n    this.targetedParagraph = this.domRoot.querySelector(\n      \".job-posting-detail--highlight\"\n    );\n    this.$applyLink = $(\".global-nav--wac__button--primary\", this.domRoot);\n    this.init();\n  }\n\n  init() {\n    this.setParagraphText();\n    const finalLinkUrl = this.getPostingUrlWithSource(\n      this.params.postingApplyUrl\n    );\n    this.$applyLink.on(\"click\", function () {\n      window.open(finalLinkUrl, \"_self\");\n      return false;\n    });\n  }\n\n  setParagraphText() {\n    if (this.params.remoteEligible) {\n      this.setParagraphTextWithRemoteTag();\n    } else {\n      this.targetedParagraph.innerHTML = `${this.params.postingTeam} | ${this.params.postingLocation} | ${this.params.postingCommitment}`;\n    }\n  }\n\n  setParagraphTextWithRemoteTag() {\n    const remoteText = listOfModfiedTags.includes(\n      this.params.remoteEligible.trim().toLowerCase()\n    )\n      ? this.getTimeZoneAbbrevation()\n      : this.params.remoteEligible.trim();\n    const paragraphText = `${this.params.postingTeam} | ${this.params.postingLocation} | ${remoteText} | ${this.params.postingCommitment}`;\n    this.targetedParagraph.innerHTML = paragraphText;\n  }\n\n  getTimeZoneAbbrevation() {\n    let timeZoneAbbre = \"\";\n    // get the correct timeZoneOption\n    const timeZoneOptionKey = this.params.remoteEligible\n      .split(\" \")[1]\n      .trim()\n      .toLowerCase();\n    const dateTimeTimeZone = new Intl.DateTimeFormat(\n      \"en-US\",\n      timeZoneOptions[timeZoneOptionKey]\n    )\n      .formatToParts(new Date())\n      .filter((dateTimeParts) => dateTimeParts.type === \"timeZoneName\");\n    if (dateTimeTimeZone) {\n      timeZoneAbbre = dateTimeTimeZone[0].value;\n      return `Remote ${timeZoneAbbre}`;\n    }\n    return this.params.remoteEligible;\n  }\n\n  getPostingUrlWithSource(postingApplyUrl: string) {\n    const SOURCE = \"source\";\n    const params = (window.location.href || \"\").split(\"?\")[1];\n    const paramsArray = (params && params.split(\"&\")) || [];\n    const source = paramsArray.filter((item) => item.indexOf(SOURCE) > -1)[0];\n    if (source && source.split(\"=\").length > 0) {\n      postingApplyUrl = postingApplyUrl + \"?\" + source;\n    }\n    return postingApplyUrl;\n  }\n}\n\nexport default JobPostingDetails;\n"],"names":["timeZoneOptions","pt","timeZone","timeZoneName","ct","et","listOfModfiedTags","JobPostingDetails","domRoot","params","_classCallCheck","this","targetedParagraph","querySelector","$applyLink","$","init","key","value","setParagraphText","finalLinkUrl","getPostingUrlWithSource","postingApplyUrl","on","window","open","remoteEligible","setParagraphTextWithRemoteTag","innerHTML","concat","postingTeam","postingLocation","postingCommitment","remoteText","includes","trim","toLowerCase","getTimeZoneAbbrevation","paragraphText","timeZoneAbbre","timeZoneOptionKey","split","dateTimeTimeZone","Intl","DateTimeFormat","formatToParts","Date","filter","dateTimeParts","type","location","href","source","item","indexOf","length"],"sourceRoot":""}