1(this.webpackJsonpvm_ksa_web_onboarding_app=this.webpackJsonpvm_ksa_web_onboarding_app||[]).push([[50],{525:function(e,a,t){"use strict";t.r(a);var n=t(0),o=t.n(n),l=t(1),s=t(10),i=t(20),r=t(2),d=t(11),c=t(88),m=t(4);var u=e=>{const a="content_services_";let t="";return-1===e.data.duration?t=r.a.keys[a+"offer_duration_label_free"]:(t=m.a.monthsInDay(e.data.duration)+" ",t+=1===t?r.a.keys[a+"offer_duration_label_singular"]:r.a.keys[a+"offer_duration_label_plural"]),o.a.createElement("li",{className:"streaming-option form-field"},o.a.createElement("input",{type:"radio",id:"streaming-"+e.data.key,name:"streaming-service",onChange:e.changeOption,value:e.data.id,defaultChecked:"none"===e.data.key}),o.a.createElement("label",{className:"streaming-option-label "+(e.data.duration?"margin-push":""),htmlFor:"streaming-"+e.data.key},o.a.createElement("span",{className:"streaming-option-content"},o.a.createElement("span",{className:"streaming-option-name"},r.a.keys[a+e.data.key+"_offer"]),e.data.duration?o.a.createElement("span",{className:"streaming-option-offer"},t):""),e.data.image?o.a.createElement("img",{className:"streaming-option-image",src:e.data.image,alt:e.data.key}):""))};var _=e=>{var a;return o.a.createElement("ul",{className:"streaming-options"},null===(a=e.options)||void 0===a?void 0:a.map((a,t)=>a.promotionCode||a.promotionId||"none"===a.key?o.a.createElement(u,{key:a.id,data:a,changeOption:()=>e.handleSelectedStream(a.key)}):null))};var p=e=>{var a;const t="content_services_";if(e.data&&"none"!==(null===(a=e.data)||void 0===a?void 0:a.key)){const a=e.data;let n="";return-1===a.duration?n=r.a.keys[t+"offer_duration_label_free"]:(n=m.a.monthsInDay(a.duration)+" ",n+=1===n?r.a.keys[t+"offer_duration_label_singular"]:r.a.keys[t+"offer_duration_label_plural"]),o.a.createElement("div",{className:"streaming-description"},o.a.createElement("div",{className:"streaming-description-logo"},a.descriptionImage?o.a.createElement("img",{src:a.descriptionImage,alt:a.key}):""),o.a.createElement("div",{className:"streaming-description-header"},o.a.createElement("strong",{className:"streaming-service-name"},r.a.keys[t+(null===a||void 0===a?void 0:a.key)+"_offer"]),o.a.createElement("span",{dangerouslySetInnerHTML:{__html:r.a.keys[t+(null===a||void 0===a?void 0:a.key)+"_description_subtitle"]}})),o.a.createElement("div",{className:"streaming-description-content"},o.a.createElement("span",{className:"streaming-description-label"},r.a.keys[t+(null===a||void 0===a?void 0:a.key)+"_description_label_about"]),o.a.createElement("span",{className:"streaming-description-text"},r.a.keys[t+(null===a||void 0===a?void 0:a.key)+"_description_text"])),o.a.createElement("div",{className:"streaming-description-pricing"},o.a.createElement("div",{className:"row"},o.a.createElement("span",{className:"streaming-description-label"},r.a.keys[t+"description_label_subscriptions"]),o.a.createElement("span",{className:"details"},o.a.createElement("span",{className:"left"},o.a.createElement("strong",null,r.a.keys[t+"description_seriesplan"]),o.a.createElement("span",null,"(",12===a.commitment?r.a.keys[t+"description_seriesplan_yearly"]:r.a.keys[t+"description_seriesplan_monthly"],")")),o.a.createElement("strong",{className:"right crossout"},r.a.keys.general_currency+" "+a.worth))),o.a.createElement("div",{className:"row"},o.a.createElement("span",{className:"streaming-description-label"},r.a.keys[t+"description_label_offers"]),o.a.createElement("span",{className:"details"},o.a.createElement("span",{className:"left"},r.a.keys[t+"description_offers_text1"]),o.a.createElement("strong",{className:"right stroke"},n)))))}return o.a.createElement("div",{className:"streaming-description"})},v=t(50);var E=e=>{var a,t,m,u,E,g,h,P,y,S,N,A,k,f,b,R,M,D,I,L,V,O;const w="content_services_",F=l.a.get("content_services",!0);let C=null,T=null;if(F){const e=JSON.parse(F);C=e.services_anghami,T=e.services_starzplay}const z=l.a.get("content_services_description",!0);let B=null,G=null;if(z){let e=null;try{e=JSON.parse(z),B=e.content_services_description_anghami,G=e.content_services_description_starzplay}catch(U){}}const[j,Y]=Object(n.useState)("none"),[J]=Object(n.useState)([{id:0,key:"none",duration:!1,image:!1,worth:0,commitment:!1,descriptionImage:!1,promotionCode:null,promotionId:null},{id:1,key:d.g.toLowerCase(),duration:null===(a=e.anghamiPromotion)||void 0===a||null===(t=a.Value)||void 0===t?void 0:t.PromotionDuration,image:null===(m=C)||void 0===m?void 0:m.url,worth:null===(u=e.anghamiPromotion)||void 0===u||null===(E=u.Value)||void 0===E?void 0:E.Worth,commitment:null===(g=e.anghamiPromotion)||void 0===g||null===(h=g.Value)||void 0===h?void 0:h.Commitment,descriptionImage:null===(P=B)||void 0===P?void 0:P.url,promotionCode:null===(y=e.anghamiPromotion)||void 0===y?void 0:y.PromotionCode,promotionId:null===(S=e.anghamiPromotion)||void 0===S||null===(N=S.Value)||void 0===N?void 0:N.ID},{id:2,key:d.m.toLowerCase(),duration:null===(A=e.starzPlayPromotion)||void 0===A||null===(k=A.Value)||void 0===k?void 0:k.PromotionDuration,image:null===(f=T)||void 0===f?void 0:f.url,worth:null===(b=e.starzPlayPromotion)||void 0===b||null===(R=b.Value)||void 0===R?void 0:R.Worth,commitment:null===(M=e.starzPlayPromotion)||void 0===M||null===(D=M.Value)||void 0===D?void 0:D.Commitment,descriptionImage:null===(I=G)||void 0===I?void 0:I.url,promotionCode:null===(L=e.starzPlayPromotion)||void 0===L?void 0:L.PromotionCode,promotionId:null===(V=e.starzPlayPromotion)||void 0===V||null===(O=V.Value)||void 0===O?void 0:O.ID}]);return o.a.createElement("div",{className:"page-modal"},o.a.createElement("div",{className:"dialog-container-header"},o.a.createElement("h1",{className:"dialog-container-header-title"},o.a.createElement("span",{className:"line"},r.a.keys[w+"title_line1"]),"\xa0",o.a.createElement("span",{className:"line"},r.a.keys[w+"title_line2"]))),o.a.createElement("div",{className:"dialog-container-content streaming"},e.loading&&o.a.createElement("div",{className:"spinner"}," ",o.a.createElement(c.a,null)," "),!e.loading&&o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:"streaming-info"},o.a.createElement("div",{className:"streaming-info-description"},r.a.keys[w+"description"]),o.a.createElement(_,{handleSelectedStream:e=>{Y(e)},options:J}),o.a.createElement("button",{className:"dialog-submit",onClick:()=>{(()=>{if(0===j.id||"none"===j)return void e.handleSelectedWithoutPromo();const a=J.filter(e=>e.key===j)[0],t=null===a||void 0===a?void 0:a.promotionCode;let n=l.a.get("StreamModal");if(n&&!1!==(null===n||void 0===n?void 0:n.SHOW)&&n.TYPE)switch(n.TYPE
1){case"STORAGE_PARAMS_CUS":e.handleLoading(!0),v.a.init('storage_params["plan_ids"]'),l.a.set("plan_type",n.plan_ids,!0),i.a.savePlanFromParams(n.plan_ids,t);break;case"STORAGE_PARAMS_PRD_BUNDLE":e.handleLoading(!0),l.a.set("plan_type",n.plan_type,!0),i.a.saveBundleFromParams(n.bundle_id,n.plan_ids,t).then(e=>{l.a.set("StreamModal",{})}).catch(e=>{l.a.set("StreamModal",{})});break;case"STORAGE_PARAMS_PRD_PLAN_IDs":e.handleLoading(!0),l.a.set("plan_type",n.plan_type,!0),i.a.savePlanFromParams(n.plan_ids,t);break;case"SAVE_PREDEFINED":e.handleLoading(!0),i.a.saveProductAndBundle(n.PLAN,t).then(e=>{s.a.fetchFlowStatus(4).then(e=>{l.a.set("StreamModal",{})}).catch(e=>{l.a.set("StreamModal",{})})}).catch(e=>{});break;case"SAVE_PREDEFINED_VANITY":e.handleLoading(!0),i.a.saveProductAndNoPlan(t).then(e=>{s.a.fetchFlowStatus(4).then(e=>{l.a.set("StreamModal",{})}).catch(e=>{l.a.set("StreamModal",{})})}).catch(e=>{});break;case"SAVE_AVAILABLE":e.handleLoading(!0),i.a.saveProductAndBundle(n.PLAN,t).then(e=>{s.a.fetchFlowStatus(4).then(e=>{l.a.set("StreamModal",{})}).catch(e=>{l.a.set("StreamModal",{})})}).catch(e=>{})}})()}},r.a.keys[w+"btn_continue"])),o.a.createElement(p,{data:J.filter(e=>e.key===j)[0]}))))};a.default=e=>{const[a,t]=Object(n.useState)(!1),[r,c]=Object(n.useState)(!1),[m,u]=Object(n.useState)(null),[_,p]=Object(n.useState)([]);Object(n.useEffect)(()=>(p([].push(l.a.get_obsrv("StreamModal").subscribe(e=>{!0===(null===e||void 0===e?void 0:e.SHOW)?(u({anghamiPromotion:null===e||void 0===e?void 0:e[d.a],starzPlayPromotion:null===e||void 0===e?void 0:e[d.r]}),t(!0),document.body.classList.add("overflow")):e&&!0===e.ERROR?(c(!1),t(!1),document.body.classList.remove("overflow")):(t(!1),c(!1),document.body.classList.remove("overflow"))}))),()=>{if(_&&(null===_||void 0===_?void 0:_.length))for(let e of _)e.unsubscribe()}),[_]);let g=null;var h,P;a&&(m.anghamiPromotion||m.starzPlayPromotion)&&(g=o.a.createElement("div",{className:"dialog"},o.a.createElement("div",{className:"dialog-container"},!r&&o.a.createElement("div",{className:"dialog-close"},o.a.createElement("span",{className:"close",onClick:()=>{(()=>{switch(l.a.get("StreamModal").TYPE){case"STORAGE_PARAMS_CUS":case"STORAGE_PARAMS_PRD_BUNDLE":case"STORAGE_PARAMS_PRD_PLAN_IDs":case"SAVE_AVAILABLE":case"SAVE_PREDEFINED":case"SAVE_PREDEFINED_VANITY":default:l.a.set("StreamModal",{})}})()}})),o.a.createElement(o.a.Fragment,null,o.a.createElement(E,{anghamiPromotion:m.anghamiPromotion?{...m.anghamiPromotion,Value:JSON.parse(null===(h=m.anghamiPromotion)||void 0===h?void 0:h.Value)}:null,starzPlayPromotion:m.starzPlayPromotion?{...m.starzPlayPromotion,Value:JSON.parse(null===(P=m.starzPlayPromotion)||void 0===P?void 0:P.Value)}:null,handleSelectedWithoutPromo:()=>(()=>{let e=l.a.get("StreamModal");switch(e.TYPE){case"STORAGE_PARAMS_CUS":c(!0),v.a.init('storage_params["plan_ids"]'),l.a.set("plan_type",e.plan_ids,!0),i.a.savePlanFromParams(e.plan_ids).then(e=>{l.a.set("StreamModal",{})}).catch(e=>{l.a.set("StreamModal",{})});break;case"STORAGE_PARAMS_PRD_BUNDLE":c(!0),l.a.set("plan_type",e.plan_type,!0),i.a.saveBundleFromParams(e.bundle_id,e.plan_ids).then(e=>{l.a.set("StreamModal",{})}).catch(e=>{l.a.set("StreamModal",{})});break;case"STORAGE_PARAMS_PRD_PLAN_IDs":c(!0),l.a.set("plan_type",e.plan_type,!0),i.a.savePlanFromParams(e.plan_ids).then(e=>{l.a.set("StreamModal",{})}).catch(e=>{});break;case"SAVE_AVAILABLE":c(!0),i.a.saveProductAndBundle().then(e=>{s.a.fetchFlowStatus(6).then(e=>{l.a.set("StreamModal",{})}).catch(e=>{})}).catch(e=>{});break;case"SAVE_PREDEFINED":c(!0),i.a.saveProductAndBundle(e.PlAN).then(e=>{s.a.fetchFlowStatus(6).then(e=>{l.a.set("StreamModal",{})}).catch(e=>{})}).catch(e=>{});break;case"SAVE_PREDEFINED_VANITY":c(!0),i.a.saveProductAndNoPlan().then(e=>{s.a.fetchFlowStatus(4).then(e=>{l.a.set("StreamModal",{})}).catch(e=>{})}).catch(e=>{})}})(),handleLoading:e=>c(e),loading:r})))));return g}}}]); 2//# sourceMappingURL=50.3d9fb6a1.chunk.js.map
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.