PageSourceSearch

https://shop.econofoods.co.za/chunk-CAO66USB.js

js econofoods.co.za collected 2026-10-02 23:17:54 UTC 6,993 bytes, 1 lines download raw bytes

1import{a as re}from"./chunk-CSTP43MB.js";import{a as h}from"./chunk-T2RG4LON.js";import{a as ie}from"./chunk-DAG6B7PD.js";import{a as x}from"./chunk-7GZLHU54.js";import"./chunk-47Y3CAPX.js";import{a as Z,c as ee,d as te}from"./chunk-AOP5LVSX.js";import{e as J,j as K}from"./chunk-MSL23EBC.js";import{a as X}from"./chunk-Q5WJ4EDS.js";import{a as Q}from"./chunk-SRWDKDAU.js";import"./chunk-6DNXTDH4.js";import{a as z}from"./chunk-A5Z6QRNS.js";import"./chunk-VRCHXGZN.js";import{z as Y}from"./chunk-DPJH3RKI.js";import{l as W}from"./chunk-WBGR4FA5.js";import"./chunk-KCSC3XVY.js";import"./chunk-RLPZKCO6.js";import{D as V,i as G,k as I,n as j,r as L}from"./chunk-TRVZJDUD.js";import{Ab as w,Ae as U,Cb as P,Da as m,Gc as D,H as v,J as T,Qb as p,R as $,Sa as O,Sb as B,U as E,cb as y,d as F,db as S,dc as R,e as M,ed as A,fa as s,ge as H,ib as u,jb as l,kb as d,kd as N,lb as f,o as _,r as b,s as g,sa as q,t as C}from"./chunk-CGLMPQO4.js";import"./chunk-S6BMTYUY.js";import{i as k}from"./chunk-3QHBEN2I.js";var n=(function(i){return i.missing="missing",i.damaged="damaged",i.expired="expired",i.incorrect="incorrect",i.other="affected",i})(n||{});function se(i,a){if(i&1&&(l(0,"h1",2),p(1),d()),i&2){let oe=P();m(),B(" ",oe.title," ")}}function ne(i,a){i&1&&(l(0,"div",3)(1,"h1",2),f(2,"span",10),d()())}function ae(i,a){i&1&&(l(0,"div",5)(1,"div",11)(2,"span",12),p(3," Loading... "),d()()())}var Be=(()=>{let a=class a{constructor(){this.router=s(A),this.mediaService=s(Q),this.config=s(z),this.seoService=s(U),this.location=s(D),this.toastr=s(W),this.esolveEnquiryService=s(H),this.transactionService=s(Y),this.accountService=s(X),this.ordersService=s(re),this.breadcrumbsService=s(x),this.default_heading="Report a problem",this.default_identifier="orders-report-problem",this.options=[{label:"Missing item",value:n.missing},{label:"Damaged item",value:n.damaged},{label:"Expired item",value:n.expired},{label:"Incorrect item",value:n.incorrect},{label:"Other",value:n.other}],this.loading=!1,this.loading_seo=!0,this.loading_transaction=!0,this.sidebar_expanded=!1,this.title="",this.form=new I({}),this.form_options={},this.model={order_number:0,report_type:null,select_items:[],description:""},this.$form_init=new F,this.$transaction_id_update=new M(0),this.$transaction_stream=this.getTransactionStream();let e=this.$transaction_stream.pipe(g(r=>r?.items??[]));this.fields=[{key:"order_number",type:"input",props:{label:"Order number",placeholder:"Order number",readonly:!0}},{key:"report_type",type:"select",props:{label:"Type of problem",disable_validation_icons:!0,labelPosition:"floating",required:!0,options:this.options},wrappers:["custom-form-field"],validation:{messages:{required:"Please select the type of problem"}}},{key:"select_items",type:"transaction-items-select",props:{label:"Which item(s) are affected?",$items:e,required:!0},expressions:{"props.label":r=>`Which item(s) are ${r.model?.report_type??"affected"}?`,"props.required":r=>r.model?.report_type!==n.other},validation:{messages:{required:"Please selected the affected items"}}},{key:"description",type:"textarea",props:{label:"Description",placeholder:"Description",labelPosition:"floating",hideRequiredMarker:!0,required:!1,rows:6},expressions:{"props.required":r=>{let t=r.model?.report_type;return t!==null&&t===n.other}},validation:{messages:{required:"Please describe the problem"}},wrappers:["custom-form-field"]}]}ngOnChanges(){let e=+(this.transaction_id??0);this.$transaction_id_update.next(e)}ngOnInit(){let r=this.config.module_options.orders?.seo_identifier??this.default_identifier;this.seo_sub=this.mediaService.getHeading(r).pipe(g(o=>o.value),v(()=>_(this.default_heading))).subscribe(o=>{this.setSeo(o),this.loading_seo=!1}),this.transaction_sub=this.$transaction_stream.subscribe({next:o=>{this.transaction=o,this.loading_transaction=!1,this.setBreadcrumbs()}});let t=C([this.$transaction_stream,this.$form_init]);this.populate_form_sub=t.pipe(T(1)).subscribe(([o])=>{o&&this.form_options.resetModel?.({order_number:o.id})})}ngAfterViewInit(){this.$form_init.next()}ngOnDestroy(){this.transaction_sub?.unsubscribe(),this.populate_form_sub?.unsubscribe(),this.seo_sub?.unsubscribe()}submit(){return k(this,null,function*(){this.form.valid||this.form.markAllAsTouched(),this.loading=!0;let e=new FormData,r=yield b(this.accountService.getAccount()),t=this.model.report_type!==n.other?this.model.report_type+" items":"Other",o=this.model.select_items.map(c=>c.id).join(", ");e.append("email",r?.email??""),e.append("order_number",this.model.order_number.toString()),e.append("type_of_problem",t??"Other"),e.append("item_codes",o),e.append("description",this.model.description);try{let c=yield b(this.esolveEnquiryService.send(e));c.success_log.length>0?(this.ordersService.setMessage("Problem successfully reported. You'll be contacted shortly."),this.form_options.resetModel?.(),this.router.navigate(["/orders",this.transaction_id])):this.toastr.error(c.error_log[0].message)}catch(c){this.toastr.error(c.message)}finally{this.loading=!1}})}back(){this.location.back()}getTransactionStream(){return this.$transaction_id_update.pipe(E(e=>(this.loading_transaction=!0,this.transactionService.getTransaction(e))),v(()=>(this.navigateToNotFound(),_(void 0))),$(1))}navigateToNotFound(){this.router.navigateByUrl("/not-found",{skipLocationChange:!0})}setBreadcrumbs(){let e=[new h("My Orders","/orders",0),new h("Order details",["/orders",this.transaction_id??""],1),new h("Report a problem","",2,!0)];this.breadcrumbsService.updateBreadcrumbs(e)}setSeo(e){this.title=e,this.seoService.setTags(e)}};a.\u0275fac=function(r){return new(r||a)},a.\u0275cmp=O({type:a,selectors:[["ng-component"]],inputs:{transaction_id:"transaction_id"},features:[R([x]),q],decls:13,vars:8,consts:[[1,"page-section"],[1,"container-mobile","stretched-container","vstack"],[1,"transaction-heading","mb-spacer"],[1,"placeholder-glow"],[1,"vstack","position-relative",3,"ngSubmit","formGroup"],[1,"loader-wrapper"],[1,"flex-fill"],[1,"flex-fill",3,"fields","form","model","options"],["type","submit",1,"btn","btn-primary","w-100","mt-3","mb-4",3,"disabled"],["type","button",1,"btn","btn-outline-primary","w-100",3,"click"],[1,"placeholder","col-5","rounded-2"],["role","status",1,"spinner-border","spinner-border-sm"],[1,"visually-hidden"]],template:function(r,t){r&1&&(f(0,"econo-breadcrumbs"),l(1,"section",0)(2,"div",1),y(3,se,2,1,"h1",2)(4,ne,3,0,"div",3),l(5,"form",4),w("ngSubmit",function(){return t.submit()}),y(6,ae,4,0,"div",5),l(7,"div",6),f(8,"formly-form",7),d(),l(9,"button",8),p(10," Submit "),d(),l(11,"button",9),w("click",function(){return t.back()}),p(12," Cancel "),d()()()()),r&2&&(m(3),S(t.loading_seo?4:3),m(2),u("formGroup",t.form),m(),S(t.loading||t.loading_transaction?6:-1),m(2),u("fields",t.f
1ields)("form",t.form)("model",t.model)("options",t.form_options),m(),u("disabled",!t.form.valid))},dependencies:[V,j,G,L,N,K,J,te,ee,Z,ie],encapsulation:2});let i=a;return i})();export{Be as ReportPage};

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.