1import{a as Y}from"./chunk-2XTEL4C3.js";import{a as N}from"./chunk-RHBXUYAX.js";import{a as p,b as j}from"./chunk-W3XJHQ7V.js";import{a as L}from"./chunk-WKSI6BXT.js";import"./chunk-5WULFUIF.js";import"./chunk-ZO7MWZV5.js";import"./chunk-QZZRNXAP.js";import"./chunk-E5C3DMEE.js";import"./chunk-MS4AQ6UA.js";import"./chunk-DTBZ7U2G.js";import"./chunk-LR32ZC3B.js";import"./chunk-MRUXXFZZ.js";import"./chunk-ZK2UVZHG.js";import"./chunk-YCWVNKHW.js";import"./chunk-IKP3GIDA.js";import"./chunk-FAYJO6ZN.js";import{a as P}from"./chunk-6FDE4EML.js";import{$a as A,ab as E,b as y,ia as B,lb as w,sc as I,wc as O}from"./chunk-UMFZ3LLX.js";import{a as M,b as V}from"./chunk-BWEGVNY2.js";import"./chunk-AG6QEAUI.js";import{b as R}from"./chunk-SAUKD7DD.js";import{Jb as g,Lb as C,Qb as h,Qc as s,Rb as a,Rc as c,Sb as m,Tb as l,_b as k,db as r,dc as x,fc as u,oa as v,ob as d,pa as b,tc as n,ub as D,uc as T,vc as f,wc as _}from"./chunk-KKSGD2T6.js";import"./chunk-EQDQRRRY.js";function U(o,S){if(o&1&&(a(0,"div",0),l(1,"mat-progress-spinner",3),m()),o&2){let e=u();r(),h("mode",e.commonService.mode)("strokeWidth",2)("diameter",80)}}function W(o,S){if(o&1&&l(0,"app-server-error",1),o&2){let e=u();h("callback",e.getCredit.bind(e))}}function q(o,S){if(o&1){let e=k();a(0,"section",2)(1,"p",4),n(2),s(3,"translate"),l(4,"br")(5,"br"),a(6,"span"),n(7),s(8,"translate"),a(9,"b"),n(10),m()(),l(11,"br"),a(12,"span"),n(13),s(14,"translate"),a(15,"b"),n(16),m()()(),l(17,"app-tile-box-card",5),s(18,"translate"),l(19,"app-tile-box-card",6),s(20,"translate"),a(21,"div",7)(22,"button",8),x("click",function(){v(e);let i=u();return b(i.goBack())}),n(23),s(24,"translate"),m(),a(25,"button",9),x("click",function(){v(e);let i=u();return b(i.activateCredit())}),n(26),s(27,"translate"),m()()()}if(o&2){let e=u();r(2),f(" ",c(3,21,"demandResources.title")," "),r(5),f(" ",c(8,23,"demandResources.deptAmountCurrency")," "),r(3),_("",e.monetaryAmount," ",e.config.currencySymbol),r(3),f(" ",c(14,25,"demandResources.deptAmountMb")," "),r(3),f("",e.dataAmount," Mb"),r(),h("type","radio")("label",c(18,27,"demandResources.tileBoxLabel"))("checkBoxValue",e.creditType.MONETARY)("checkedValue",!0)("callback",e.selectCreditValue.bind(e))("name","10 "+e.config.currencySymbol),r(2),h("type","radio")("label",c(20,29,"demandResources.tileBoxLabel2"))("checkBoxValue",e.creditType.DATA)("checkedValue",!1)("name","750 Mb")("callback",e.selectCreditValue.bind(e))("hasBottomMargin",!0),r(4),T(c(24,31,"cancel")),r(3),T(c(27,33,"activate"))}}var G=(()=>{class o{constructor(e,t,i,K,F,H){this.commonService=e,this.shopService=t,this.location=i,this.dialog=K,this.trs=F,this.storageService=H,this.config=y,this.isCreditDataLoaded=!1,this.showError=!1,this.creditType=p,this.commonService.isBackButtonActivated=!0,this.commonService.isPageTitleActivated=!0,this.commonService.isCustomerPickerActivated=!1,this.commonService.isFindNumberActivated=!1,this.commonService.setPageTitle(this.trs.trsTs("pageTitle.demandResources"),"demand-resources")}ngOnInit(){this.getCredit()}getCredit(){this.showError=!1,this.shopService.creditData(this.storageService.get(M.CID)).subscribe(e=>{if(console.log("result",e),this.isCreditDataLoaded=!0,e.status&&e.status==="OK"){if(e.statusMessage!=="OK"){this.openConfirmationDialog("error",e.statusMessage);return}e.CreditState.Credit.filter(t=>{t.type===p.MONETARY&&(this.monetaryAmount=+t.amount/100),t.type===p.DATA&&(this.dataAmount=t.amount)})}},()=>{this.showError=!0,this.isCreditDataLoaded=!1})}handleError(e){switch(e.status){case 406:this.openConfirmationDialog("error",this.trs.trsTs("httpErrorCode.creditGet406"));return;case 409:this.openConfirmationDialog("error",this.trs.trsTs("httpErrorCode.creditGet409"));return;case 410:this.openConfirmationDialog("error",this.trs.trsTs("httpErrorCode.creditGet410"));return;case 411:this.openConfirmationDialog("error",this.trs.trsTs("httpErrorCode.creditGet411"));return;default:this.openConfirmationDialog("error",this.trs.trsTs("httpErrorCode.default"));return}}openConfirmationDialog(e,t){this.dialog.open(I,{width:"420px",panelClass:["global-dialog","confirmation-dialog"],data:{type:e,confirmButtonText:this.trs.trsTs("close"),confirmButtonAction:!1,closeButton:!1,title:t}}).afterClosed().subscribe(()=>{})}selectCreditValue(e){this.selectedValue=e.value}activateCredit(){this.openPurchaseDialog("success",this.selectedValue?this.selectedValue:p.MONETARY)}openPurchaseDialog(e,t){this.dialog.open(Y,{width:"420px",panelClass:["global-dialog","blue-bg","purchase-dialog"],data:{type:e,value:t,title:this.titleMessage(),description:this.descriptionMessage(t)}}).afterClosed().subscribe(()=>{})}titleMessage(){return'<h3 class="title">'+this.trs.trsTs("demandResources.tileBoxTitle")+"</h3>"}descriptionMessage(e){let i={value:e===p.MONETARY?"10 kn":"750 Mb"};return e===p.MONETARY?this.trs.trsTsParams("demandResources.addValueMessageKn",i):this.trs.trsTsParams("demandResources.addValueMessageMb",i)}goBack(){this.location.back()}ngOnDestroy(){this.commonService.isBackButtonActivated=!1,this.commonService.isPageTitleActivated=!1}static{this.\u0275fac=function(t){return new(t||o)(d(O),d(j),d(R),d(B),d(w),d(V))}}static{this.\u0275cmp=D({type:o,selectors:[["app-demand-resources"]],decls:3,vars:3,consts:[[1,"page-spinner"],[3,"callback"],[1,"demand-resources-page"],[3,"mode","strokeWidth","diameter"],[1,"mb16"],["fixBoxHeight","height60",3,"type","label","checkBoxValue","checkedValue","callback","name"],["fixBoxHeight","height60",3,"type","label","checkBoxValue","checkedValue","name","callback","hasBottomMargin"],[1,"download-wrapper","shop-pages"],[1,"btn-radius","radius100","background-4","font-regular","download",3,"click"],[1,"btn-radius","radius100","background-2","font-regular",3,"click"]],template:function(t,i){t&1&&(g(0,U,2,3,"div",0),g(1,W,1,1,"app-server-error",1),g(2,q,28,35,"section",2)),t&2&&(C(!i.isCreditDataLoaded&&!i.showError?0:-1),r(),C(i.showError?1:-1),r(),C(i.isCreditDataLoaded?2:-1))},dependencies:[P,L,N,E,A],encapsulation:2})}}return o}
1)();var ue=[{path:"",redirectTo:"demand-resources",pathMatch:"full"},{path:"demand-resources",component:G}];export{ue as DEMAND_RESOURCES_ROUTES};
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.