1"use strict";(self.webpackChunkpwa=self.webpackChunkpwa||[]).push([[7516],{16789:function(e,t,r){r.d(t,{M:function(){return n}});const n=(0,r(16546).F3)("FileOpener")},22948:function(e,t,r){r.d(t,{X:function(){return c}});var n=r(20641);const s={class:"dashboard-inner",style:{padding:"0"}},i={key:0,class:"mt-24 dash-router-view flex-1 overflow-y-auto overflow-x-hidden pjn-finpay-page relative"},o={key:0,style:{position:"absolute",top:"0",left:"0",right:"0",bottom:"0",background:"white",display:"flex","align-items":"center","justify-content":"center","z-index":"50"}},a=["src"];function c(e,t,r,c,d,u){const l=(0,n.g2)("LoaderPJN");return(0,n.uX)(),(0,n.CE)("div",s,[""!==d.finchoice_link?((0,n.uX)(),(0,n.CE)("div",i,[d.iframeLoading?((0,n.uX)(),(0,n.CE)("div",o,[(0,n.bF)(l)])):(0,n.Q3)("",!0),(0,n.Lk)("iframe",{id:"InsuranceIframe",ref:"insuranceIframe",src:d.finchoice_link,frameborder:"0",allowfullscreen:""},null,8,a)])):(0,n.Q3)("",!0)])}},37448:function(e,t,r){var n,s;r.d(t,{Wi:function(){return s},__:function(){return n}}),function(e){e.Documents="DOCUMENTS",e.Data="DATA",e.Library="LIBRARY",e.Cache="CACHE",e.External="EXTERNAL",e.ExternalStorage="EXTERNAL_STORAGE"}(n||(n={})),function(e){e.UTF8="utf8",e.ASCII="ascii",e.UTF16="utf16"}(s||(s={}))},37516:function(e,t,r){r.a(e,async function(e,n){try{r.r(t);var s=r(22948),i=r(61429),o=r(66262),a=e([i]);i=(a.then?(await a)():a)[0];const c=(0,o.A)(i.A,[["render",s.X]]);t.default=c,n()}catch(e){n(e)}})},43840:function(e,t,r){r.a(e,async function(e,n){try{r(44114);var s=r(24058),i=r(66160),o=r(25158),a=r(25911),c=r(16546),d=r(85142),u=r(16789),l=r(40159),h=r(99070),p=e([i,o]);[i,o]=p.then?(await p)():p,t.A={components:{LoaderPJN:h.A},mixins:[i.A],created(){if(!this.$store.getters.user?.multi_product_enabled)return this.$router.push({name:"my-account",query:{getUserData:!0}
1});this.token=this.$store.getters.token,this.$store.dispatch(s.Wv,!1),this.$store.dispatch(s.Af,!0)},mounted(){const e=this.createObjectFromQueryParams();e.token=this.$store.getters.token,e.baseUrl="https://api.payjustnow.com/api/v2/app/finchoice/funeralinsurance/platform-prod",this.payload=e,window.addEventListener("message",this.handleMessageFromIframe),this.resizeIframeWithResizeObserver(),window.addEventListener("resize",this.triggerIframeResize),"accident-plan-landing"===e?.redirect_route?(this.productType="accident",this.$store.dispatch(s.Ik,"Accident Cover"),this.$store.dispatch(s.DN,"Accident Cover")):(this.productType="funeral",this.$store.dispatch(s.Ik,"Funeral Cover"),this.$store.dispatch(s.DN,"Funeral Cover"))},unmounted(){window.removeEventListener("message",this.handleMessageFromIframe),window.removeEventListener("resize",this.triggerIframeResize),this.resizeObserver&&this.iframeBody&&(this.resizeObserver.unobserve(this.iframeBody),this.resizeObserver.disconnect())},data(){return{finchoice_link:"/pjninsuranceapp/index.html",iframeLoading:!0,resizeObserver:null,iframeBody:null,payload:null,token:null,productType:null}},methods:{createObjectFromQueryParams(){let e=new URL(window.location.href).searchParams,t={};for(let[r,n]of e)isNaN(n)||"product_id"!==r&&"term"!==r||(n=parseInt(n)),"account_opening"===r&&(n="true"===n),t[r]=n;return t},handleMessageFromIframe(e){if(e.origin!==window.location.origin)return;const{type:t,data:r}=e.data;if("FC_insurance"===t||"FC_accident"===t)if(r?.appRun){const e=this.createObjectFromQueryParams(),t={customer:{id_number:this.customer?.id_number,consumer_id:this.customer?.consumer_profile_id,pjn_quote_id:this.$route.query.pjn_quote_id||null,cover:this.$route.query.cover||null,first_name:this.customer?.first_name,last_name:this.customer?.last_name,gender:this.getGenderFromSouthAfricanID(this.customer?.id_number),email:this.customer?.email,cellphone:this.customer?.mobile_number,address_line1:this.customer?.address?.address_line_1,address_suburb:this.customer?.address?.address_line_2,address_city:this.customer?.address?.city,address_country:"ZA",address_area_code:this.customer?.address?.postal_code,net_salary:this.beforeComma(this.customer?.netincomerange)},base_url:this.payload.baseUrl,token:this.payload.token};e?.redirect_route&&(t.redirect_route=e.redirect_route),this.sendMessageToIframe(t),this.iframeLoading=!1,this.trackingData={source:this.productType+"-embedded",pjnQuoteid:this.$route.query.pjn_quote_id??null,pjnConsumerId:this.customer?.consumer_profile_id??null,cover:this.$route.query.cover??null};let r=this.trackingData;r.context="Start application";const n={entity:o.JK.PAGE,entity_id:this.productType+"-embedded-impression-started",tracking_data:r,impression_type:o.p3.VIEWED};(0,o.eB)(n,o.CZ.IMPRESSION)}else if("go_to_account"===r?.event){if(r?.pjn_account_id)return this.$router.push({name:"my-account",query:{showAccount:r?.pjn_account_id}});this.$router.push({name:"my-account",query:{getUserData:!0}
1})}else if("page_load"===r?.event){let e=r?.content||{};e.source=this.productType+"-embedded",e.pjnQuoteid=this.$route.query.pjn_quote_id??null,e.pjnConsumerId=this.customer?.consumer_profile_id??null,e.cover=this.$route.query.cover??null,e.context=r?.context||this.productType+" embedded page loaded";const t={entity:o.JK.PAGE,entity_id:`${this.productType}-embedded-impression-${r?.context?.toLowerCase().replace(/\s+/g,"-")||"loaded"}`,tracking_data:e,impression_type:o.p3.VIEWED};(0,o.eB)(t,o.CZ.IMPRESSION)}else if("click_event"===r?.event){let e=r?.content||{};e.source=this.productType+"-embedded",e.pjnQuoteid=this.$route.query.pjn_quote_id??null,e.pjnConsumerId=this.customer?.consumer_profile_id??null,e.cover=this.$route.query.cover??null,e.context=r?.context||this.productType+" embedded click event";const t={entity:o.JK.HTML_ELEMENT,entity_id:`${this.productType}-embedded-click-${r?.context?.toLowerCase().replace(/\s+/g,"-")||"event"}`,tracking_data:e};(0,o.eB)(t,o.CZ.CLICK)}else r?.terms_And_Conditions?this.openPdf(t).then(()=>{}).catch(e=>{}):r?.tokenError&&this.$store.dispatch(l.XW).then(e=>{this.sendMessageToIframe({type:"REFRESH_TOKEN_RESPONSE",token:e.data.token})}).catch(e=>{this.$router.push({name:"my-account",query:{getUserData:!0}
1})})},sendMessageToIframe(e){const t={type:"PJN",data:e};document.getElementById("InsuranceIframe").contentWindow.postMessage(t,"*")},resizeIframeWithResizeObserver(){const e=document.getElementById("InsuranceIframe");e&&e.addEventListener("load",()=>{try{const t=e.contentDocument||e.contentWindow.document;if(this.iframeBody=t.body,!this.iframeBody)return;const r=()=>{requestAnimationFrame(()=>{e&&this.iframeBody&&(e.style.height=this.iframeBody.scrollHeight+"px")})};r(),this.resizeObserver=new ResizeObserver(r),this.resizeObserver.observe(this.iframeBody)}catch(e){}})},triggerIframeResize(){try{const e=this.$refs.insuranceIframe,t=(e.contentDocument||e.contentWindow.document).body;if(!t)return;e.style.height=t.scrollHeight+"px"}catch(e){}},getGenderFromSouthAfricanID(e){if(!/^\d{13}$/.test(e))throw new Error("Invalid South African ID number. Must be 13 digits.");const t=parseInt(e.slice(6,10),10);return t>=0&&t<=4999?"female":t>=5e3&&t<=9999?"male":null},beforeComma(e){if("string"!=typeof e)return e;const t=e.indexOf(",");return-1===t?e:e.substring(0,t).trim()},async openPdf(e){const t="FC_accident"===e?"https://payjustnow.com/wp-content/uploads/2026/02/PJNAccident_Cover_TermsandConditions.pdf":"https://payjustnow.com/wp-content/uploads/2025/09/PJNFuneral_Cover_TermsandConditions.pdf";try{c.Ii.isNativePlatform()?await a.P.open({url:t}):window.open(t,"_blank")}catch(e){}},async getDocFromAPI(){const e={"Content-Type":"application/json; charset=utf-8",Accept:"application/pdf",identifier:"legacy.jwt",Authorization:"Bearer "+this.token},t="pjn-funeral-cover-terms.pdf";try{const r=await axios.request({url:"https://api.payjustnow.com/api/v2/app/finchoice/funeralinsurance/platform-prod/insurance/documents/terms-and-conditions",method:"get",headers:e,responseType:"blob"}),n=new Blob([r.data],{type:"application/pdf"});if(c.Ii.isNativePlatform()){const e=await this.blobToBase64(n),r=t,s=await d.YA.writeFile({path:r,data:e,directory:d.__.Cache});await u.M.open({filePath:s.uri,contentType:"application/pdf"})}else{const e=document.createElement("a");e.href=URL.createObjectURL(n),e.download=t,e.click(),URL.revokeObjectURL(e.href)}return this.$notify({title:"Success!",text:"Your document is downloaded.",group:"top",type:"success"}),!0}catch(e){this.$notify({title:"Sorry!",text:"There was an error fetching the document. Please try again later.",group:"top",type:"error"})}},async blobToBase64(e){return new Promise((t,r)=>{const n=new FileReader;n.onloadend=()=>{const e=n.result.split(",")[1];t(e)},n.onerror=r,n.readAsDataURL(e)})}},computed:{customer(){return this.$store.getters.user}}},n()}catch(e){n(e)}})},61429:function(e,t,r){r.a(e,async function(e,n){try{r.d(t,{A:function(){return s.A}});var s=r(43840),i=e([s]);s=(i.then?(await i)():i)[0],n()}catch(e){n(e)}})},85142:function(e,t,r){r.d(t,{YA:function(){return i},__:function(){return s.__}});var n=r(16546),s=r(37448);const i=(0,n.F3)("Filesystem",{web:()=>r.e(9956).then(r.bind(r,69956)).then(e=>new e.FilesystemWeb)})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.