diff --git a/cypress/fixtures/paymentDetail/paymentDetail.min.js b/cypress/fixtures/paymentDetail/paymentDetail.min.js index 73904a1..5673a26 100644 --- a/cypress/fixtures/paymentDetail/paymentDetail.min.js +++ b/cypress/fixtures/paymentDetail/paymentDetail.min.js @@ -1 +1 @@ -!function(){"use strict";function e(){return"secure.dol.state.nj.us"===window.location.hostname}function t(t,i){null!=window.gtag&&e()?gtag("event",t,i):console.log("In production, the following event would be logged to Google Analytics:",{name:t,parameters:i})}const i="https://beta.nj.gov/files/tdi-fli-claim-status/assets";function n(e){return new Date(e).toLocaleDateString("en-us",{year:"numeric",month:"long",day:"numeric"})}function o(e){return e.match(/\b\d{1,2}\/\d{1,2}\/\d{4}\b/)[0]||"N/A"}function r(e,...t){return String.raw({raw:e},...t)}function a(e,...t){return String.raw({raw:e},...t)}function s(){return screen.width>768}const l=r``,d=r``,c=r`Return to top`;class m{constructor(e,t=!1){this.rootEl=e,this.buttonEl=this.rootEl.querySelector("button[aria-expanded]"),this.iconEl=this.rootEl.querySelector("img"),this.isLoggingEnabled=t;const i=this.buttonEl.getAttribute("aria-controls");this.contentEl=document.getElementById(i),this.open="true"===this.buttonEl.getAttribute("aria-expanded"),this.buttonEl.addEventListener("click",this.onButtonClick.bind(this))}onButtonClick(){this.toggle(!this.open)}toggle(e){e!==this.open&&(this.open=e,this.buttonEl.setAttribute("aria-expanded",`${e}`),e?(this.contentEl.removeAttribute("hidden"),this.iconEl.src=`${i}/remove.svg`,this.iconEl.alt="See less",this.isLoggingEnabled&&t("[DOL_DABI] Opened Claim Detail form accordion",{object_details:this.rootEl.dataset.logKey||"N/A"})):(this.contentEl.setAttribute("hidden",""),this.iconEl.src=`${i}/add.svg`,this.iconEl.alt="See more"))}open(){this.toggle(!0)}close(){this.toggle(!1)}}var g;function p(e){let t=e;return e.includes("maximum entitlement")?t="Max entitlement":e.includes("recovered")?t="Recovered/returned":e.includes("Request to Claimant for Continued Claim Information has been received")?t="P30 received":e.includes("completed request to Claimant for Continued Claim")?t="P30 sent":e.includes("Please contact our office for additional information")?t="Pay code 99/6":e.includes("next payment is scheduled")?t="Next pay scheduled":e.includes("No additional benefits have been authorized.")?t="No additional benefits":e.includes("ended on")&&(t="Leave ended"),t}g=function(){!function(){if(e()){const e="G-2F7W0D0NDJ",t=document.createElement("script");t.src=`https://www.googletagmanager.com/gtag/js?id=${e}`,document.head.appendChild(t);const i=document.createElement("script");i.innerHTML=`window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', '${e}');`,document.head.appendChild(i)}}();try{!function(){if(!s()){const e=document.createElement("meta");e.name="viewport",e.content="width=device-width, initial-scale=1",document.getElementsByTagName("head")[0]?.appendChild(e);const t=document.getElementsByTagName("img");for(let e=0;e{const t=e.children;return{date:t[0].innerText,gross:t[1].innerText,fica:t[2].innerText,medicare:t[3].innerText,diOffset:t[4].innerText,garnishment:t[5].innerText,fit:t[6].innerText,net:t[7].innerText,payId:t[8].innerText,fromDate:t[9].innerText,toDate:t[10].innerText}}));return{status:o,paymentType:n,p30DateSent:i,claimType:t,payments:r}}();!function(e){const{status:i,paymentType:n,p30DateSent:o,claimType:r}=e,a=p(i);t("[DOL_DABI] Viewed Payment Detail page",{object_type:r||"N/A",object_status:a||"N/A",object_details:JSON.stringify({p30:o||"N/A",payType:n||"N/A"})})}(e),function(){const e=document.getElementsByName("claimlist")[0].children,t=Array.from(e).length;if(null==e||4!==t)throw new Error(`Cannot safely remove old HTML, expected 4 root children, got ${t}`);e[1]?.remove(),e[1]?.remove(),e[1]?.remove()}(),function(){const e=document.createElement("style");e.textContent=a`.accordion-header{margin:0}.accordion-trigger{background:0 0;display:flex;align-items:center;margin:0;gap:16px;padding:16px 20px;justify-content:space-between;position:relative;text-align:left;width:100%;cursor:pointer;border:.5px solid #a9aeb1;border-radius:5px;outline-offset:.25rem}.accordion-title{font-weight:700;font-size:16px;line-height:24px}.accordion-title.highlighted{color:#0076d6}.accordion-panel{padding:19px 32px 16px;border:.5px solid #a9aeb1;border-radius:5px;border-top:none;border-top-left-radius:0;border-top-right-radius:0;transform:translateY(-3px)}form{margin-block-end:0}`,document.head.appendChild(e)}(),function(e){const{status:t,p30DateSent:a,claimType:g,payments:u}=e,f=p(t),h=document.getElementsByName("claimlist")[0],y=document.createElement("div"),b=s()?"107px":"20px";var v,x,w,k;y.innerHTML=r`${l}
All claims
Right arrow ${w="Status",k="claimdetail()",r``} Right arrow
Payments

Payments

Claim for ${x=g,"TDI"===x?"Temporary Disability Insurance (TDI)":"FLI"===x?"Family Leave Insurance (FLI)":x}

Payment information


${function(e,t,i){let a="";switch(e){case"Max entitlement":a=r`
You've reached the maximum benefits allowed under state law.

You can't extend your state benefits for this condition/disability, regardless of whether your doctor approves it. If your medical condition continues to prevent you from working, apply for Social Security Disability Insurance.
`;break;case"P30 received":const e=o(t);"FLI"===i?a=r`Your FL3 form (Family Leave Insurance Continued Claim Certification) was received on ${n(e)}.

Steps to complete
  • There's no action for you to take.
`:"TDI"===i&&(a=r`Your P30 form (Request to Claimant for Continued Claim Information) was received on ${n(e)}.

Steps to complete
  • There's no action for you to take.
Tips for pregnancy claims
  • If you're taking bonding leave (Family Leave Insurance) immediately after, look out for an FL2 form in the mail. We'll send it to you after your P30 is processed.
  • The FL2 is how you'll start your bonding leave, without a break in payments.
`);break;case"P30 sent":a=r`
Heads up!
Your last scheduled payment is coming up. We need you to end or extend your claim online. To complete this step, you'll need the P30 letter, or Request for Continued Claim Information. We mailed this to you on ${n(o(t))}.

It's important to complete this step so we know whether you recovered (end claim), or if you need to file a medical extension (extend claim).

Steps to complete
  • Look for a letter in the mail: "Form P30: Request to Claimant for Continued Information."
  • Find the "Form ID" (11 digits) in the middle of the page.
  • Log in to your benefits account and follow the instructions.
  • Share the Form ID with your doctor.
  • If this is a pregnancy claim and you're starting bonding leave immediately after, keep an eye on the mail for your FL2 (new mother/bonding claim).
Need help?
If you can't find the letter, give us a call: 609-292-7060. The form is unique to your claim, so you can't print it online. The P30 letter looks like this:
Sample P30 letter titled 'Request for Continued Claim Information' from the New Jersey Department of Labor, showing nine sections of claimant information. The form ID is found in the middle of the page.
`;break;case"Next pay scheduled":a=r`
We're sending payment to your benefits debit card on ${n(o(t))}. You can access the funds about 2 business days later.

Questions? Learn more about how payments are sent.
`;break;case"Leave ended":a=r`
Your ${"FLI"===i?"Family Leave":"Temporary Disability"} claim ended on ${n(o(t))}. ${"TDI"===i?r`

Tips for pregnancy claims
  • If you're taking bonding leave (Family Leave Insurance) immediately after, look out for an FL2 form in the mail. We'll send it to you after your P30 is processed.
  • The FL2 is how you'll start your bonding leave, without a break in payments.
`:""}
`;break;case"Recovered/returned":a="No further benefits have been issued since you recovered / returned to work.";break;case"Pay code 99/6":a=r`Please contact our office for additional information.`;break;default:a=t}return a}(f,t,g)}

Payment history


${v=u,v.map(((e,t)=>{const{date:o,gross:a,fica:s,medicare:l,diOffset:d,garnishment:c,fit:m,net:g,payId:p,fromDate:u,toDate:f}=e,h=new Date(o)>new Date;return r`

`})).join("")}
${c}
${d}`,h.append(y),document.querySelectorAll(".accordion-header").forEach((e=>{new m(e)}))}(e),function(){const e=document.body.style;e.backgroundColor="#ffffff",e.fontFamily="'Public Sans', sans-serif",e.lineHeight="16px",e.lineHeight="24px",e.color="#1C1D1F",e.padding="0px"}(),function(){const e=document.createElement("aside");e.innerHTML='Give feedback',e.style.fontSize="16px",e.style.lineHeight="normal",e.style.backgroundColor="#003366",e.style.padding="8px 16px",e.style.borderRadius="4px",e.style.position="fixed",e.style.top=s()?"15%":"5%",e.style.right="0px",e.style.transformOrigin="bottom right",e.style.transform="rotate(-90deg)",document.body.appendChild(e)}(),function(){let e=document.querySelector("link[rel~='icon']");null==e&&(e=document.createElement("link"),e.rel="icon",document.head.appendChild(e)),e.href="https://beta.nj.gov/files/favicon.ico"}(),g="Payments",document.title=g,document.documentElement.lang="en"}catch(e){t("[DOL_DABI] Payment redesign error",{object_details:e instanceof Error?e.message:"Unknown"})}var g},"loading"===document.readyState?window.addEventListener("DOMContentLoaded",(()=>{g()})):g()}(); +!function(){"use strict";function e(){return"secure.dol.state.nj.us"===window.location.hostname}function t(t,i){null!=window.gtag&&e()?gtag("event",t,i):console.log("In production, the following event would be logged to Google Analytics:",{name:t,parameters:i})}const i="https://beta.nj.gov/files/tdi-fli-claim-status/assets";function n(e){return new Date(e).toLocaleDateString("en-us",{year:"numeric",month:"long",day:"numeric"})}function o(e){return e.match(/\b\d{1,2}\/\d{1,2}\/\d{4}\b/)[0]||"N/A"}function r(e,...t){return String.raw({raw:e},...t)}function a(e,...t){return String.raw({raw:e},...t)}function s(){return screen.width>768}const l=r``,d=r``,c=r`Return to top`;class m{constructor(e,t=!1){this.rootEl=e,this.buttonEl=this.rootEl.querySelector("button[aria-expanded]"),this.iconEl=this.rootEl.querySelector("img"),this.isLoggingEnabled=t;const i=this.buttonEl.getAttribute("aria-controls");this.contentEl=document.getElementById(i),this.open="true"===this.buttonEl.getAttribute("aria-expanded"),this.buttonEl.addEventListener("click",this.onButtonClick.bind(this))}onButtonClick(){this.toggle(!this.open)}toggle(e){e!==this.open&&(this.open=e,this.buttonEl.setAttribute("aria-expanded",`${e}`),e?(this.contentEl.removeAttribute("hidden"),this.iconEl.src=`${i}/remove.svg`,this.iconEl.alt="See less",this.isLoggingEnabled&&t("[DOL_DABI] Opened Claim Detail form accordion",{object_details:this.rootEl.dataset.logKey||"N/A"})):(this.contentEl.setAttribute("hidden",""),this.iconEl.src=`${i}/add.svg`,this.iconEl.alt="See more"))}open(){this.toggle(!0)}close(){this.toggle(!1)}}var g;function p(e){let t=e;return e.includes("maximum entitlement")?t="Max entitlement":e.includes("recovered")?t="Recovered/returned":e.includes("Request to Claimant for Continued Claim Information has been received")?t="P30 received":e.includes("completed request to Claimant for Continued Claim")?t="P30 sent":e.includes("Please contact our office for additional information")?t="Pay code 99/6":e.includes("next payment is scheduled")?t="Next pay scheduled":e.includes("No additional benefits have been authorized.")?t="No additional benefits":e.includes("ended on")&&(t="Leave ended"),t}g=function(){!function(){if(e()){const e="G-2F7W0D0NDJ",t=document.createElement("script");t.src=`https://www.googletagmanager.com/gtag/js?id=${e}`,document.head.appendChild(t);const i=document.createElement("script");i.innerHTML=`window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', '${e}');`,document.head.appendChild(i)}}();try{!function(){if(!s()){const e=document.createElement("meta");e.name="viewport",e.content="width=device-width, initial-scale=1",document.getElementsByTagName("head")[0]?.appendChild(e);const t=document.getElementsByTagName("img");for(let e=0;e{const t=e.children;return{date:t[0].innerText,gross:t[1].innerText,fica:t[2].innerText,medicare:t[3].innerText,diOffset:t[4].innerText,garnishment:t[5].innerText,fit:t[6].innerText,net:t[7].innerText,payId:t[8].innerText,fromDate:t[9].innerText,toDate:t[10].innerText}}));return{status:r,paymentType:o,p30DateSent:i,claimType:t,payments:a}}();!function(e){const{status:i,paymentType:n,p30DateSent:o,claimType:r}=e,a=p(i);t("[DOL_DABI] Viewed Payment Detail page",{object_type:r||"N/A",object_status:a||"N/A",object_details:JSON.stringify({p30:o||"N/A",payType:n||"N/A"})})}(e),function(){const e=document.getElementsByName("claimlist")[0].children,t=Array.from(e).length;if(null==e||4!==t)throw new Error(`Cannot safely remove old HTML, expected 4 root children, got ${t}`);e[1]?.remove(),e[1]?.remove(),e[1]?.remove()}(),function(){const e=document.createElement("style");e.textContent=a`.accordion-header{margin:0}.accordion-trigger{background:0 0;display:flex;align-items:center;margin:0;gap:16px;padding:16px 20px;justify-content:space-between;position:relative;text-align:left;width:100%;cursor:pointer;border:.5px solid #a9aeb1;border-radius:5px;outline-offset:.25rem}.accordion-title{font-weight:700;font-size:16px;line-height:24px}.accordion-title.highlighted{color:#0076d6}.accordion-panel{padding:19px 32px 16px;border:.5px solid #a9aeb1;border-radius:5px;border-top:none;border-top-left-radius:0;border-top-right-radius:0;transform:translateY(-3px)}form{margin-block-end:0}`,document.head.appendChild(e)}(),function(e){const{status:t,p30DateSent:a,claimType:g,payments:u}=e,f=p(t),h=document.getElementsByName("claimlist")[0],y=document.createElement("div"),b=s()?"107px":"20px";var v,x,w,k;y.innerHTML=r`${l}
All claims
Right arrow ${w="Status",k="claimdetail()",r``} Right arrow
Payments

Payments

Claim for ${x=g,"TDI"===x?"Temporary Disability Insurance (TDI)":"FLI"===x?"Family Leave Insurance (FLI)":x}

Payment information


${function(e,t,i){let a="";switch(e){case"Max entitlement":a=r`
You've reached the maximum benefits allowed under state law.

You can't extend your state benefits for this condition/disability, regardless of whether your doctor approves it. If your medical condition continues to prevent you from working, apply for Social Security Disability Insurance.
`;break;case"P30 received":const e=o(t);"FLI"===i?a=r`Your FL3 form (Family Leave Insurance Continued Claim Certification) was received on ${n(e)}.

Steps to complete
  • There's no action for you to take.
`:"TDI"===i&&(a=r`Your P30 form (Request to Claimant for Continued Claim Information) was received on ${n(e)}.

Steps to complete
  • There's no action for you to take.
Tips for pregnancy claims
  • If you're taking bonding leave (Family Leave Insurance) immediately after, look out for an FL2 form in the mail. We'll send it to you after your P30 is processed.
  • The FL2 is how you'll start your bonding leave, without a break in payments.
`);break;case"P30 sent":a=r`
Heads up!
Your last scheduled payment is coming up. We need you to end or extend your claim online. To complete this step, you'll need the P30 letter, or Request for Continued Claim Information. We mailed this to you on ${n(o(t))}.

It's important to complete this step so we know whether you recovered (end claim), or if you need to file a medical extension (extend claim).

Steps to complete
  • Look for a letter in the mail: "Form P30: Request to Claimant for Continued Information."
  • Find the "Form ID" (11 digits) in the middle of the page.
  • Log in to your benefits account and follow the instructions.
  • Share the Form ID with your doctor.
  • If this is a pregnancy claim and you're starting bonding leave immediately after, keep an eye on the mail for your FL2 (new mother/bonding claim).
Need help?
If you can't find the letter, give us a call: 609-292-7060. The form is unique to your claim, so you can't print it online. The P30 letter looks like this:
Sample P30 letter titled 'Request for Continued Claim Information' from the New Jersey Department of Labor, showing nine sections of claimant information. The form ID is found in the middle of the page.
`;break;case"Next pay scheduled":a=r`
We're sending payment to your benefits debit card on ${n(o(t))}. You can access the funds about 2 business days later.

Questions? Learn more about how payments are sent.
`;break;case"Leave ended":a=r`
Your ${"FLI"===i?"Family Leave":"Temporary Disability"} claim ended on ${n(o(t))}. ${"TDI"===i?r`

Tips for pregnancy claims
  • If you're taking bonding leave (Family Leave Insurance) immediately after, look out for an FL2 form in the mail. We'll send it to you after your P30 is processed.
  • The FL2 is how you'll start your bonding leave, without a break in payments.
`:""}
`;break;case"Recovered/returned":a="No further benefits have been issued since you recovered / returned to work.";break;case"Pay code 99/6":a=r`Please contact our office for additional information.`;break;default:a=t}return a}(f,t,g)}

Payment history


${v=u,v.map(((e,t)=>{const{date:o,gross:a,fica:s,medicare:l,diOffset:d,garnishment:c,fit:m,net:g,payId:p,fromDate:u,toDate:f}=e,h=new Date(o)>new Date;return r`

`})).join("")}
${c}
${d}`,h.append(y),document.querySelectorAll(".accordion-header").forEach((e=>{new m(e)}))}(e),function(){const e=document.body.style;e.backgroundColor="#ffffff",e.fontFamily="'Public Sans', sans-serif",e.lineHeight="16px",e.lineHeight="24px",e.color="#1C1D1F",e.padding="0px"}(),function(){const e=document.createElement("aside");e.innerHTML='Give feedback',e.style.fontSize="16px",e.style.lineHeight="normal",e.style.backgroundColor="#003366",e.style.padding="8px 16px",e.style.borderRadius="4px",e.style.position="fixed",e.style.top=s()?"15%":"5%",e.style.right="0px",e.style.transformOrigin="bottom right",e.style.transform="rotate(-90deg)",document.body.appendChild(e)}(),function(){let e=document.querySelector("link[rel~='icon']");null==e&&(e=document.createElement("link"),e.rel="icon",document.head.appendChild(e)),e.href="https://beta.nj.gov/files/favicon.ico"}(),g="Payments",document.title=g,document.documentElement.lang="en"}catch(e){t("[DOL_DABI] Payment redesign error",{object_details:e instanceof Error?e.message:"Unknown"})}var g},"loading"===document.readyState?window.addEventListener("DOMContentLoaded",(()=>{g()})):g()}(); diff --git a/src/paymentDetail.js b/src/paymentDetail.js index eba4dbf..741a5de 100644 --- a/src/paymentDetail.js +++ b/src/paymentDetail.js @@ -62,7 +62,7 @@ function getMetadata() { ?.children[1]?.innerText ?? ""; const payTypeAbbr = payType.includes("debit") ? "Debit" - : paymentType.includes("issued by check") + : payType.includes("issued by check") ? "Check" : ""; const status =