PageSourceSearch

https://hotelacapulcolloret.web.app/chunk-DCMR3P3D.js

js hotelacapulcolloret.web.app collected 2026-10-03 12:27:02 UTC 48,756 bytes, 1 lines download raw bytes

1import{a as Rt,b as Vt,c as zt,e as Wt,f as jt,g as Ht}from"./chunk-XNUKI3OP.js";import"./chunk-4ZMUWVGF.js";import{a as Ct,b as yt}from"./chunk-5XVV3RTB.js";import"./chunk-Y2VUAZHJ.js";import"./chunk-GXSSUKYN.js";import{a as ut,b as gt,c as bt,d as ft,e as _t}from"./chunk-EU2UUBKQ.js";import{a as Jt}from"./chunk-TJJL6MEF.js";import"./chunk-26DJPGWL.js";import{a as be}from"./chunk-TWMEDETO.js";import"./chunk-DX5VG3PC.js";import{b as Lt}from"./chunk-WXUDXZ62.js";import{a as Yt}from"./chunk-MCLRFF53.js";import{a as Xt,b as Zt}from"./chunk-KRJAK6XN.js";import{b as Kt}from"./chunk-2OGZSAG3.js";import"./chunk-P4RLOIVO.js";import{a as qt}from"./chunk-5FZIKSSI.js";import{a as $e}from"./chunk-3LTSCMEY.js";import"./chunk-OMSSIMJF.js";import{a as ht}from"./chunk-3WC6QCKY.js";import"./chunk-XRJIK4YB.js";import"./chunk-IOSSROPS.js";import{a as dt}from"./chunk-A6PGHIFI.js";import"./chunk-WC2JX5GM.js";import"./chunk-YBMAZFHW.js";import"./chunk-TSSTODNF.js";import{a as Qt}from"./chunk-NNRSPSDX.js";import"./chunk-7BYAH3M5.js";import"./chunk-3FG2NF5Q.js";import"./chunk-BZCRMZRK.js";import"./chunk-TIQNQ5RC.js";import"./chunk-57VP2QQE.js";import"./chunk-JKCF3JO4.js";import{a as Ut,b as Gt}from"./chunk-X5LTAU4J.js";import{c as G}from"./chunk-V6SVSMOY.js";import{h as $t}from"./chunk-OIFLSKSG.js";import"./chunk-MS4AQ6UA.js";import{a as Mt,c as pe,h as xt}from"./chunk-VHZYRGCR.js";import"./chunk-SG5RK6UL.js";import"./chunk-NCSHAMWP.js";import"./chunk-6PLV7S3T.js";import"./chunk-DAJONF6J.js";import"./chunk-BKGQJ6RO.js";import"./chunk-FGOWXP5A.js";import"./chunk-PL2JL44I.js";import"./chunk-4SKREFI6.js";import"./chunk-TCNPWTBM.js";import"./chunk-VQNAJFAM.js";import"./chunk-KH44JDK7.js";import"./chunk-KNMSOF6J.js";import"./chunk-CWMAFSUC.js";import"./chunk-Q32WRYNR.js";import"./chunk-ANTQMSNS.js";import{c as ye,d as Pt}from"./chunk-VF6KSPH4.js";import{D as wt,E as Bt,F as Dt,G as Et,a as ue,c as ge,f as St,h as kt,i as Tt}from"./chunk-PVZWGOML.js";import{a as Nt}from"./chunk-SH4WA2MY.js";import{a as Ot,b as Ft}from"./chunk-5AKBYDVT.js";import{a as de}from"./chunk-JWHUE3AS.js";import"./chunk-FXWU7OEP.js";import{a as At,c as It}from"./chunk-NUW7CNY3.js";import{c as vt,e as ce}from"./chunk-VESOXM6S.js";import"./chunk-467LRO2K.js";import{A as ve,B as pt,e as me,f as mt,h as ct,n as P}from"./chunk-LV4SMM66.js";import{a as qe,b as Ye,c as Qe,d as Je,e as Xe,f as Ze,g as et,h as tt,i as it,j as nt,l as at}from"./chunk-5X4JKWE6.js";import"./chunk-73STLUJV.js";import"./chunk-OJ2T5HRA.js";import"./chunk-OCS22MR2.js";import"./chunk-F6DRBHD2.js";import{b as Ke,c as le}from"./chunk-T4MWC3RV.js";import{B as ae,C as We,D as oe,F as se,G as je,M as He,N as re,a as Ve,b as ee,d as V,g as ze,i as z,l as Ue,m as te,r as ie,u as ne,x as Ge}from"./chunk-MUYETSO3.js";import"./chunk-HPZM7AH7.js";import{a as F,b as Le,c as Y}from"./chunk-K66MTKBU.js";import{g as Re}from"./chunk-2N6QVGUB.js";import{b as ot,c as st,d as rt}from"./chunk-JOQO77H2.js";import"./chunk-YRNCVXTS.js";import"./chunk-DWBTMM37.js";import{a as lt,b as U}from"./chunk-EX3WDE36.js";import{b as X,c as Z}from"./chunk-MBZP4W4T.js";import"./chunk-B54BU3YZ.js";import"./chunk-ORMEPM4S.js";import{ga as Pe,ha as J,la as Ne}from"./chunk-XFBZPXCU.js";import{$a as v,B as u,Ba as N,Db as De,Eb as Ee,Fb as Ae,Ha as $,Lb as q,Nb as Ie,Ob as m,Pb as I,Qb as O,bb as y,bc as R,cb as Be,db as fe,dc as L,eb as W,fb as j,ga as we,gb as c,hb as a,hc as D,ia as d,ib as s,ic as A,j as Te,jb as g,jc as Oe,l as f,mc as _e,nb as H,ob as K,qb as w,qc as he,r as x,rc as k,s as S,sc as Ce,wc as Fe,x as Q,xb as _,xc as E,zb as p}from"./chunk-R4A3TABJ.js";import{Ra as Se,Ub as ke}from"./chunk-EVQV33YM.js";import{b as xe}from"./chunk-WFMAM73Y.js";import{a as C,b as B,m as h}from"./chunk-DB5PWUBK.js";var ri=n=>[n];function li(n,l){n&1&&(g(0,"img",11),D(1,"ipfsLoader")),n&2&&c("src",A(1,1,l),we)}function di(n,l){if(n&1&&(a(0,"div",3),v(1,li,2,3,"img",11),a(2,"div")(3,"h3",12),m(4),D(5,"titlecase"),s()()()),n&2){let e,t,i=l,o=p();d(),y((e=(e=o.$cardSelected())==null||e.token==null||e.token.metadata==null||(e=e.token.metadata[o.parseInt(((e=o.$cardSelected())==null?null:e.tokenId)||"0")])==null?null:e.imageUrl)?1:-1,e),d(3),I(((t=o.$cardSelected())==null?null:t.tokenId)!==null&&i.metadata?i.metadata[o.parseInt(((t=o.$cardSelected())==null?null:t.tokenId)||"0")]:A(5,2,i.name))}}function mi(n,l){n&1&&(a(0,"h3",4),m(1,"Select a token to edit the quantity"),s())}function ci(n,l){n&1&&m(0," Selected Value ")}function pi(n,l){if(n&1&&m(0),n&2){let e,t=p();O(" ",((e=t.$cardSelected())==null?null:e.value)||0," ")}}function ui(n,l){if(n&1){let e=w();a(0,"pers-info-card",16),_("cardClicked",function(i){x(e);let o=p(4);return S(o.cardSelected(i))}),s()}if(n&2){let e,t=p(2).$implicit,i=p(2);c("$imageUrl","assets/images/svgs/points-wallet-icon.svg")("$value",((e=i.$creditTokenBalances()[t.token.contractAddress])==null?null:e.balance)||0)("$title",t.token.name)("$cursorPointer",!1)}}function gi(n,l){if(n&1){let e=w();a(0,"pers-info-card",18),D(1,"getTokenExpiryDate"),_("cardClicked",function(i){x(e);let o=p(5);return S(o.cardSelected(i))}),s()}if(n&2){let e=l.$implicit;c("$imageUrl",e==null||e.metadata==null?null:e.metadata.imageUrl)("$value",e.balance)("$title",e.metadata==null?null:e.metadata.name)("$expiryDate",A(1,5,e.metadata))("$cursorPointer",!1)}}function bi(n,l){if(n&1&&(a(0,"div",15)(1,"pers-web3-reward-list",17),$(2,gi,2,7,"ng-template",null,1,_e),s()()),n&2){let e,t=p(2).$implicit,i=p(2);d(),c("$accountAddress",((e=i.$business())==null?null:e.accountAddress)||null)("$rewardTokens",L(4,ri,t.token))("$emptyMessage","No rewards available")("$nativeTokenType",t.token.type)}}function fi(n,l){if(n&1&&v(0,ui,1,4,"pers-info-card",14)(1,bi,4,6,"div",15),n&2){let e,t=p(2).filterButtonValue;y((e=t)==="points"?0:1)}}function _i(n,l){if(n&1&&v(0,fi,2,1),n&2){let e=l.$implicit,t=p().filterButtonValue;y(e.type===t?0:-1)}}function hi(n,l){if(n&1&&(a(0,"section",13),W(1,_i,1,1,null,null,Be),s()),n&2){let e=l.filteredData;d(),j(e)}}var ti=(()=>{class n{destroyRef=f(Q);snackBarService=f(G);dialog=f(pe);web3Service=f(dt);tokenService=f(de);transactionAdminService=f(Vt);$activeCreditToken=this.tokenService.$activeCreditToken;$business=E();$showFilters=E(!1);tokenDecimals=this.$activeCreditToken()?.decimals||0;filterCategory="type";filterOptions=Pt;showTitle=!1;showTotal=!1;parseInt=parseInt;$tokens=this.tokenService.$tokens;$businessTokens=k(()=>(this.$tokens()||[]).filter(t=>!t.isGallery).map(t=>({type:ye[t.type],token:t}
1)));$creditTokenBalances=Y(Le(k(()=>({address:this.$business()?.accountAddress??null,tokens:this.$businessTokens().filter(e=>e.type===ye.ERC20).map(e=>e.token)}))).pipe(ke(({address:e,tokens:t})=>this.web3Service.getBalances(e,t.map(i=>({token:i})))),F(this.destroyRef)),{initialValue:{}});getTokenBalanceKey(e,t){return t?`${e.contractAddress}_${t}`:e.contractAddress}$isLoading=u(!1);$isDisable=u(!0);$tokenValue=u(0);$operationValue=u(0);$totalValue=u(0);$cardSelected=u(null);cardSelected(e){console.log("cardSelected: ",e),this.$cardSelected.set({token:e.token,tokenId:e.tokenId,value:e.value})}onClear(){let e=this.$cardSelected();if(!e){this.snackBarService.openSnackBar("No card selected","error");return}let t=e.token.name||"Token";if(e.token.type!==pt.ERC20&&e.tokenId){let o=e.tokenId;t=e.token.metadata?.[parseInt(o)].name||"Token"}this.dialog.open(be,{data:{title:"Are you sure?",description:`You are going to clear all ${t} from this wallet.`,confirmText:"Confirm",cancelText:"Cancel",action:"clear"},width:"fit-content",height:"fit-content"}).afterClosed().pipe(F(this.destroyRef),Se(1)).subscribe(o=>h(this,null,function*(){if(o!==void 0){console.log("result: ",o);try{let r=this.$cardSelected()?.token;if(!r)throw new Error("Token contract not found");let b=this.$business()?.id;if(!b)throw new Error("Business ID not found");let T=yield this.transactionAdminService.burnToken({amount:Math.abs(this.$operationValue()),contractAddress:r.contractAddress,chainId:r.chainId,contractTokenId:this.$cardSelected()?.tokenId||null,senderAccountId:b,senderAccountType:ct.BUSINESS});console.log("Token burned successfully: ",T),this.snackBarService.openSnackBar("Token burned successfully","success")}catch(r){this.snackBarService.openSnackBar("Error burning token","error"),this.$isLoading.set(!1),console.error("Error: ",r);return}}})),this.$isLoading.set(!1),this.$cardSelected.set(null)}onCancel(){this.$tokenValue.set(0),this.$cardSelected.set(null)}operationValueChanged(e){this.$operationValue.set(e)}totalValueChanged(e){this.$totalValue.set(e)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=N({type:n,selectors:[["pers-business-wallet"]],inputs:{$business:[1,"$business"],$showFilters:[1,"$showFilters"]},features:[R([])],decls:15,vars:16,consts:[["dataTemplate",""],["itemTemplate",""],[1,"edit-token-container","d-flex","align-items-center","justify-content-between","m-0"],[1,"d-flex","flex-row","gap-10","align-items-center"],[1,"f-w-500","f-s-18","m-0"],[1,"d-flex","gap-10","align-items-center"],[1,"selected-value-container"],["placeholder","Selected Value"],["mat-flat-button","","color","primary",3,"click","disabled"],["mat-flat-button","","color","warn",3,"click","disabled"],[3,"$tableData","$filterTitle","$filterOptions","$showTitle","$showTotal","$filtersOpen"],["width","60","height","60",1,"rounded","object-cover",3,"src"],[1,"f-w-300","f-s-16","m-0"],[1,"d-flex","flex-wrap","gap-20","p-20"],[3,"$imageUrl","$value","$title","$cursorPointer"],[1,"token-container"],[3,"cardClicked","$imageUrl","$value","$title","$cursorPointer"],[3,"$accountAddress","$rewardTokens","$emptyMessage","$nativeTokenType"],[3,"cardClicked","$imageUrl","$value","$title","$expiryDate","$cursorPointer"]],template:function(t,i){if(t&1){let o=w();a(0,"div",2),v(1,di,6,4,"div",3)(2,mi,2,0,"h3",4),a(3,"div",5)(4,"div",6)(5,"div",7),v(6,ci,1,0)(7,pi,1,1),s()(),a(8,"button",8),_("click",function(){return x(o),S(i.onClear())}),m(9," Clear "),s(),a(10,"button",9),_("click",function(){return x(o),S(i.onCancel())}),m(11," Cancel "),s()()(),a(12,"pers-filter-aside",10),$(13,hi,3,0,"ng-template",null,0,_e),s()}if(t&2){let o,r;d(),y((o=(o=i.$cardSelected())==null?null:o.token)?1:2,o),d(4),Ie(i.$isDisable()?"selected-value text-gray-100":"selected-value"),d(),y(i.$isDisable()?6:7),d(2),q("avoidCumulativeLayoutShift",i.$operationValue()>=0),c("disabled",((r=i.$cardSelected())==null?null:r.value)===0||i.$isLoading()),d(2),q("text-white",!i.$isDisable()),c("disabled",i.$isDisable()),d(2),c("$tableData",i.$businessTokens())("$filterTitle",i.filterCategory)("$filterOptions",i.filterOptions)("$showTitle",i.showTitle)("$showTotal",i.showTotal)("$filtersOpen",i.$showFilters())}},dependencies:[V,ee,zt,Rt,U,Ct,J,Nt,yt],styles:[".wallet-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px}.wallet-container[_ngcontent-%COMP%]   .rewards-section[_ngcontent-%COMP%]{display:flex;flex-direction:column}.cards-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;gap:20px;margin-left:20px}.selected-value-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;width:fit-content;height:40px;border:1px solid #e0e0e0;border-radius:8px}.selected-value-container[_ngcontent-%COMP%]   .selected-value[_ngcontent-%COMP%]{width:120px;height:100%;text-align:center;padding:8px 0 2px}"],changeDetection:0})}return n})();function $i(n,l){n&1&&(a(0,"mat-error"),m(1,"Email is required"),s())}function Mi(n,l){n&1&&(a(0,"mat-error"),m(1,"Please enter a valid email"),s())}function xi(n,l){if(n&1&&(a(0,"mat-option",11),m(1),D(2,"titlecase"),s()),n&2){let e=l.$implicit;c("value",e),d(),I(A(2,2,e))}}function Si(n,l){n&1&&g(0,"mat-spinner",13),n&2&&c("diameter",18)("strokeWidth",2)}function ki(n,l){n&1&&m(0," Add ")}function Ti(n,l){if(n&1){let e=w();a(0,"form",6),_("ngSubmit",function(){x(e);let i=p();return S(i.onAddMember())}),a(1,"mat-form-field",7)(2,"mat-label"),m(3,"Email Address"),s(),g(4,"input",8),v(5,$i,2,0,"mat-error"),v(6,Mi,2,0,"mat-error"),s(),a(7,"mat-form-field",9)(8,"mat-label"),m(9,"Role"),s(),a(10,"mat-select",10),W(11,xi,3,4,"mat-option",11,fe),s()(),a(13,"button",12),v(14,Si,1,2,"mat-spinner",13)(15,ki,1,0),s()()}if(n&2){let e,t,i=p();c("formGroup",i.addMemberForm),d(5),y((e=i.addMemberForm.get("email"))!=null&&e.hasError("required")?5:-1),d(),y((t=i.addMemberForm.get("email"))!=null&&t.hasError("email")?6:-1),d(5),j(i.roleOptions),d(2),c("disabled",i.addMemberForm.invali
1d||i.$isAddingMember()),d(),y(i.$isAddingMember()?14:15)}}function wi(n,l){n&1&&(a(0,"div",5),g(1,"mat-spinner",14),s()),n&2&&(d(),c("diameter",40))}function Bi(n,l){n&1&&(a(0,"th",25),m(1,"User"),s())}function Di(n,l){if(n&1&&(a(0,"td",26)(1,"span",27),m(2),s()()),n&2){let e=l.$implicit,t=p(3);d(2),I(t.getMemberEmail(t.asMember(e)))}}function Ei(n,l){n&1&&(a(0,"th",25),m(1,"Role"),s())}function Ai(n,l){if(n&1&&(a(0,"mat-option",11),m(1),D(2,"titlecase"),s()),n&2){let e=l.$implicit;c("value",e),d(),I(A(2,2,e))}}function Ii(n,l){if(n&1){let e=w();a(0,"td",26)(1,"mat-select",28),_("selectionChange",function(i){let o=x(e).$implicit,r=p(3);return S(r.onUpdateRole(r.asMember(o),i.value))}),W(2,Ai,3,4,"mat-option",11,fe),s()()}if(n&2){let e=l.$implicit,t=p(3);d(),c("value",t.asMember(e).role),d(),j(t.roleOptions)}}function Oi(n,l){n&1&&(a(0,"th",25),m(1,"Added"),s())}function Fi(n,l){if(n&1&&(a(0,"td",26),m(1),D(2,"date"),s()),n&2){let e=l.$implicit,t=p(3);d(),O(" ",Oe(2,1,t.asMember(e).createdAt,"mediumDate")," ")}}function Pi(n,l){n&1&&g(0,"th",25)}function Ni(n,l){if(n&1){let e=w();a(0,"td",26)(1,"button",29),_("click",function(){let i=x(e).$implicit,o=p(3);return S(o.onRemoveMember(o.asMember(i)))}),g(2,"i-tabler",30),s()()}if(n&2){let e=l.$implicit,t=p(3);d(),q("is-owner-btn",t.asMember(e).role==="OWNER"),c("matTooltip",t.asMember(e).role==="OWNER"?"Cannot remove owner":"Remove member")}}function Ri(n,l){n&1&&g(0,"tr",31)}function Li(n,l){n&1&&g(0,"tr",32)}function Vi(n,l){if(n&1&&(a(0,"table",15),H(1,17),$(2,Bi,2,0,"th",18)(3,Di,3,1,"td",19),K(),H(4,20),$(5,Ei,2,0,"th",18)(6,Ii,4,1,"td",19),K(),H(7,21),$(8,Oi,2,0,"th",18)(9,Fi,3,4,"td",19),K(),H(10,22),$(11,Pi,1,0,"th",18)(12,Ni,3,3,"td",19),K(),$(13,Ri,1,0,"tr",23)(14,Li,1,0,"tr",24),s()),n&2){let e=p(2);c("dataSource",e.$members()),d(13),c("matHeaderRowDef",e.displayedColumns),d(),c("matRowDefColumns",e.displayedColumns)}}function zi(n,l){if(n&1&&(a(0,"div",16)(1,"mat-icon",33),m(2,"group_off"),s(),a(3,"p",34),m(4,"No members found"),s(),a(5,"p",35),m(6),D(7,"lowercase"),s()()),n&2){let e=p(2);d(6),O("Add members to give them access to this ",A(7,1,e.$organizationName()))}}function Ui(n,l){if(n&1&&v(0,Vi,15,3,"table",15)(1,zi,8,3,"div",16),n&2){let e=p();y(e.$members().length>0?0:1)}}var ii=(()=>{class n{snackBarService=f(G);fb=f(ae);dialog=f(pe);$organizationId=E.required();$organizationName=E("Organization");$memberOperations=E.required();$members=u([]);$isLoading=u(!1);$isAddingMember=u(!1);$showAddForm=u(!1);_pendingMemberEmails=new Map;displayedColumns=["email","role","createdAt","actions"];roleOptions=mt;addMemberForm=this.fb.group({email:["",[z.required,z.email]],role:[me.VIEWER,z.required]});getRoleBadgeClass(e){return`role-${e.toLowerCase()}`}asMember=e=>e;getMemberEmail(e){return e.included?.user?.email||e.included?.user?.identifierEmail||this._pendingMemberEmails.get(e.userId)||e.userId}ngOnInit(){return h(this,null,function*(){yield this.loadMembers()})}loadMembers(){return h(this,null,function*(){let e=this.$organizationId(),t=this.$memberOperations();if(!(!e||!t)){this.$isLoading.set(!0);try{let i=yield t.getMembers(e);this.$members.set(i)}catch(i){console.error("Error loading members:",i),this.snackBarService.openSnackBar("Error loading members","error")}finally{this.$isLoading.set(!1)}}})}toggleAddForm(){this.$showAddForm.update(e=>!e),this.$showAddForm()||this.addMemberForm.reset({email:"",role:me.VIEWER})}onAddMember(){return h(this,null,function*(){if(this.addMemberForm.invali
1d)return;let e=this.$organizationId(),t=this.$memberOperations();if(!e||!t)return;let{email:i,role:o}=this.addMemberForm.value;this.$isAddingMember.set(!0);try{let r=yield t.addMemberByEmail(e,i,o);this._pendingMemberEmails.set(r.userId,i),this.$members.update(b=>[...b,r]),this.snackBarService.openSnackBar(`Member ${i} added successfully`,"success"),this.toggleAddForm()}catch(r){console.error("Error adding member:",r);let b=r?.userMessage||r?.message||"Error adding member";this.snackBarService.openSnackBar(b,"error")}finally{this.$isAddingMember.set(!1)}})}onUpdateRole(e,t){return h(this,null,function*(){let i=this.$organizationId(),o=this.$memberOperations();if(!(!i||!o))try{yield o.updateMemberRole(i,e.userId,t),this.$members.update(r=>r.map(b=>b.userId===e.userId?B(C({},b),{role:t}):b)),this.snackBarService.openSnackBar("Member role updated","success")}catch(r){console.error("Error updating role:",r);let b=r?.userMessage||r?.message||"Error updating role";this.snackBarService.openSnackBar(b,"error")}})}onRemoveMember(e){return h(this,null,function*(){if(e.role===me.OWNER){window.matchMedia("(hover: none)").matches&&this.snackBarService.openSnackBar("Cannot remove owner","info");return}let t=this.$organizationId(),i=this.$memberOperations();if(!t||!i)return;let o=e.included?.user?.email||e.userId;this.dialog.open(be,{data:{title:"Remove Member",description:`Are you sure you want to remove "${o}" from this organization? This action cannot be undone.`,confirmText:"Confirm",cancelText:"Cancel",action:"delete"},width:"fit-content",height:"fit-content"}).afterClosed().subscribe(b=>h(this,null,function*(){if(b==="delete")try{yield i.removeMember(t,e.userId),this.$members.update(T=>T.filter(M=>M.userId!==e.userId)),this.snackBarService.openSnackBar("Member removed successfully","success")}catch(T){console.error("Error removing member:",T);let M=T?.userMessage||T?.message||"Error removing member";this.snackBarService.openSnackBar(M,"error")}}))})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=N({type:n,selectors:[["pers-organization-members"]],inputs:{$organizationId:[1,"$organizationId"],$organizationName:[1,"$organizationName"],$memberOperations:[1,"$memberOperations"]},features:[R([ge({IconTrash:wt})])],decls:11,vars:6,consts:[[1,"organization-members-container"],[1,"members-header","d-flex","justify-content-between","align-items-center","m-b-16"],[1,"m-0"],["mat-flat-button","","color","primary",3,"click","disabled"],[1,"add-member-form","m-b-16",3,"formGroup"],[1,"loading-container","d-flex","justify-content-center","align-items-center","p-y-48"],[1,"add-member-form","m-b-16",3,"ngSubmit","formGroup"],["appearance","outline",1,"flex-1"],["matInput","","formControlName","email","placeholder","[email protected]","type","email"],["appearance","outline",1,"role-select"],["formControlName","role"],[3,"value"],["mat-flat-button","","color","primary","type","submit",1,"add-btn",3,"disabled"],[3,"diameter","strokeWidth"],[3,"diameter"],["mat-table","",1,"members-table","w-100",3,"dataSource"],[1,"empty-state","d-flex","flex-col","align-items-center","justify-content-center","p-y-48"],["matColumnDef","email"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","role"],["matColumnDef","createdAt"],["matColumnDef","actions"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],[1,"user-email"],[1,"role-select-inline",3,"selectionChange","value"],["mat-icon-button","","matTooltipTouchGestures","on",1,"remove-btn",3,"click","matTooltip"],["name","trash",1,"icon-18","d-flex"],["mat-header-row",""],["mat-row",""],[1,"empty-icon"],[1,"m-t-16","text-gray-600"],[1,"text-gray-400","f-s-14"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"div",1)(2,"h3",2),m(3),s(),a(4,"button",3),_("click",function(){return i.toggleAddForm()}),a(5,"mat-icon"),m(6),s(),m(7),s()(),v(8,Ti,16,5,"form",4),v(9,wi,2,1,"div",5)(10,Ui,2,1),s()),t&2&&(d(3),O("",i.$organizationName()," Members"),d(),c("disabled",i.$isLoading()),d(2),I(i.$showAddForm()?"close"
1:"person_add"),d(),O(" ",i.$showAddForm()?"Cancel":"Add Member"," "),d(),y(i.$showAddForm()?8:-1),d(),y(i.$isLoading()?9:10))},dependencies:[oe,ie,ze,Ue,te,ne,Ge,V,ee,Ve,re,He,se,je,le,Ke,It,At,Re,at,qe,Qe,et,Je,Ye,tt,Xe,Ze,it,nt,Z,X,U,lt,ce,$t,Ft,Ot,ue,J,Ne,Pe],styles:[".organization-members-container[_ngcontent-%COMP%]{padding:16px 0;overflow:hidden;width:100%;box-sizing:border-box}.members-header[_ngcontent-%COMP%]{padding:0 4px}.add-member-form[_ngcontent-%COMP%]{display:flex;gap:12px;align-items:flex-start;flex-wrap:wrap}.add-member-form[_ngcontent-%COMP%]   mat-form-field[_ngcontent-%COMP%]{flex:1 1 180px;min-width:0}.add-member-form[_ngcontent-%COMP%]   .role-select[_ngcontent-%COMP%]{flex:0 1 140px}.add-member-form[_ngcontent-%COMP%]   .add-btn[_ngcontent-%COMP%]{height:56px;min-width:80px}.members-table[_ngcontent-%COMP%]{background:transparent;width:100%;table-layout:fixed}.members-table[_ngcontent-%COMP%]   .mat-mdc-header-cell[_ngcontent-%COMP%]{font-size:14px;font-weight:600;color:var(--bs-gray-700)}.members-table[_ngcontent-%COMP%]   .mat-mdc-cell[_ngcontent-%COMP%]{font-size:14px;padding:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.members-table[_ngcontent-%COMP%]   .mat-column-email[_ngcontent-%COMP%]{width:auto;min-width:0}.members-table[_ngcontent-%COMP%]   .mat-column-email[_ngcontent-%COMP%]   .user-email[_ngcontent-%COMP%]{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.members-table[_ngcontent-%COMP%]   .mat-column-role[_ngcontent-%COMP%], .members-table[_ngcontent-%COMP%]   .mat-column-createdAt[_ngcontent-%COMP%]{width:110px}.members-table[_ngcontent-%COMP%]   .mat-column-actions[_ngcontent-%COMP%]{width:48px;padding-right:0}.members-table[_ngcontent-%COMP%]   .mat-column-actions[_ngcontent-%COMP%]   .is-owner-btn[_ngcontent-%COMP%]{opacity:.38;cursor:default}.members-table[_ngcontent-%COMP%]   .user-id[_ngcontent-%COMP%]{font-family:Consolas,Monaco,monospace;font-size:.75rem;color:var(--bs-gray-600)}.members-table[_ngcontent-%COMP%]   .role-select-inline[_ngcontent-%COMP%]{width:100%}.members-table[_ngcontent-%COMP%]   .mat-mdc-row[_ngcontent-%COMP%]{transition:background-color .15s ease}.members-table[_ngcontent-%COMP%]   .mat-mdc-row[_ngcontent-%COMP%]:hover{background-color:var(--bs-gray-50)}@media (max-width: 600px){.members-table[_ngcontent-%COMP%]   .mat-column-createdAt[_ngcontent-%COMP%]{display:none}.members-table[_ngcontent-%COMP%]   .mat-mdc-cell[_ngcontent-%COMP%], .members-table[_ngcontent-%COMP%]   .mat-mdc-header-cell[_ngcontent-%COMP%]{padding:12px 8px}.members-table[_ngcontent-%COMP%]   .mat-column-role[_ngcontent-%COMP%]{width:140px}.members-table[_ngcontent-%COMP%]   .role-select-inline[_ngcontent-%COMP%]{width:110px}.members-table[_ngcontent-%COMP%]   .mat-column-actions[_ngcontent-%COMP%]{width:32px;padding-right:50px}.members-table[_ngcontent-%COMP%]   .remove-btn[_ngcontent-%COMP%]{--mat-icon-button-icon-size: 20px}}.loading-container[_ngcontent-%COMP%], .empty-state[_ngcontent-%COMP%]{min-height:200px}.empty-state[_ngcontent-%COMP%]   .empty-icon[_ngcontent-%COMP%]{font-size:48px;width:48px;height:48px;opacity:.4}"],changeDetection:0})}return n})();var ni=class{};ni=xe([rt({properties:{tokenMintingAnalytics$:"observable",currentMonthAnalytics$:"observable",transactionsGraphAnalytics$:"observable",userRankingAnalytics$:"observable",engagementRateAnalytics$:"observable",engagementByTimeAnalytics$:"observable",businessRankingAnalytics$:"observable",businessClaimAnalytics$:"observable",retentionAnalytics$:"observable",userAnalytics$:"observable",redemptionRedeemAnalytics$:"observable",$globalDateRange:"signal",$activeEngagementMetrics:"signal"},methods:{getTransactionAnalytics:"promise",getEngagementByTimeAnalyticsWithDateRange:"promise",getUserAnalytics:"promise",reload:"void",reloadAll:"void",setGlobalDateRange:"void"}},ot.ANALYTICS)],ni);var ai=new Te(st.ANALYTICS+" Facade Token");var Gi=[{key:"accountAddress",label:"Account Address",type:"copy"},{key:"displayName",label:"Display Name",type:"text",placeholder:"Business display name"},{key:"businessLegalName",label:"Legal Name",type:"text",placeholder:"Business legal name"},{key:"registrationNumber",label:"Registration Number",type:"text",placeholder:"Company registration, VAT, or EIN"},{key:"email",label:"Email",type:"text",placeholder:"[email protected]"},{key:"phoneNumber",label:"Phone Number",type:"text",placeholder:"+1 234 567 890"},{key:"websiteUrl",label:"Website URL",type:"text",placeholder:"www.example.com"}
1,{key:"imageUrl",label:"Image",type:"image",fileEntityType:P.BUSINESS},{key:"logoUrl",label:"Logo",type:"image",fileEntityType:P.BUSINESS},{key:"description",label:"Description",type:"textarea",placeholder:"Full description of the business",rows:4},{key:"shortDescription",label:"Short Description",type:"textarea",placeholder:"Short description of the business",rows:3},{key:"businessTypeId",label:"Business Type",type:"select",options:[]},{key:"tags",label:"Tags",type:"tags",placeholder:"Add tag...",entityType:"business",hint:"Add tags for categorization and filtering"}],ca=[{key:"displayName",label:"Display Name",type:"text",placeholder:"Business display name"},{key:"businessLegalName",label:"Legal Name",type:"text",placeholder:"Business legal name"},{key:"registrationNumber",label:"Registration Number",type:"text",placeholder:"Company registration, VAT, or EIN"},{key:"email",label:"Email",type:"text",placeholder:"[email protected]"},{key:"phoneNumber",label:"Phone Number",type:"text",placeholder:"+1 234 567 890"},{key:"websiteUrl",label:"Website URL",type:"text",placeholder:"www.example.com"},{key:"imageUrl",label:"Image",type:"image",fileEntityType:P.BUSINESS},{key:"logoUrl",label:"Logo",type:"image",fileEntityType:P.BUSINESS},{key:"description",label:"Description",type:"textarea",placeholder:"Full description of the business",rows:4},{key:"shortDescription",label:"Short Description",type:"textarea",placeholder:"Short description of the business",rows:3},{key:"streetAddress",label:"Street Address",type:"text",placeholder:"Street address"},{key:"city",label:"City",type:"text",placeholder:"City"},{key:"postalCode",label:"Postal Code",type:"text",placeholder:"Postal code"},{key:"neighborhood",label:"Neighborhood",type:"text",placeholder:"Neighborhood"},{key:"district",label:"District",type:"text",placeholder:"District"},{key:"country",label:"Country",type:"text",placeholder:"Country"},{key:"countryCode",label:"Country Code",type:"text",placeholder:"e.g. US, PT, GB"},{key:"businessTypeId",label:"Business Type",type:"select",options:[]},{key:"tags",label:"Tags",type:"tags",placeholder:"Add tag...",entityType:"business",hint:"Add tags for categorization and filtering"}];function oi(n,l){let e=n.map(t=>({value:t.id,label:t.name??""}));return Gi.map(t=>t.key==="businessTypeId"?B(C({},t),{options:e}):t.key==="accountAddress"&&l?.accountAddress?B(C({},t),{value:l.accountAddress}):t)}var Wi=["fileInput"],Me=n=>({businessId:n});function ji(n,l){n&1&&(a(0,"div",18)(1,"mat-icon",18),g(2,"i-tabler",19),s(),a(3,"span",12),m(4,"Details"),s()())}function Hi(n,l){if(n&1&&g(0,"pers-kpi-stats-card",5),n&2){let e=p();c("$title","Business Analytics")("$stats",e.$businessKpiStats())("$columns",3)}}function Ki(n,l){if(n&1){let e=w();a(0,"section",11)(1,"h3",12),m(2,"Confirm new business in the system"),s(),a(3,"pers-approval-section",20),_("approveClicked",function(){x(e);let i=p();return S(i.onApprove())})("rejectClicked",function(i){x(e);let o=p();return S(o.onReject(i))}),s()()}if(n&2){let e=p();d(3),c("approval",e.$approvalData())("isLoading",e.$isApprovalLoading())}}function qi(n,l){n&1&&(a(0,"div",18)(1,"mat-icon",18),g(2,"i-tabler",27),s(),a(3,"span",12),m(4,"Members"),s()())}function Yi(n,l){if(n&1&&(a(0,"mat-card-content",28),g(1,"pers-organization-members",29),s()),n&2){let e=p(2);d(),c("$organizationId",e.$business().id)("$organizationName","Business")("$memberOperations",e.memberOperations)}}function Qi(n,l){n&1&&(a(0,"div",18)(1,"mat-icon",18),g(2,"i-tabler",30),s(),a(3,"span",12),m(4,"Wallet"),s()())}function Ji(n,l){n&1&&(a(0,"div",18)(1,"mat-icon",18),g(2,"i-tabler",31),s(),a(3,"span",12),m(4,"Claims History"),s()())}function Xi(n,l){n&1&&(a(0,"div",18)(1,"mat-icon",18),g(2,"i-tabler",31),s(),a(3,"span",12),m(4,"Transactions"),s()())}function Zi(n,l){n&1&&(a(0,"div",18)(1,"mat-icon",18),g(2,"i-tabler",32),s(),a(3,"span",12),m(4,"Bookings"),s()())}function en(n,l){if(n&1&&(a(0,"mat-tab"),$(1,qi,5,0,"ng-template",1)(2,Yi,2,3,"ng-template",21),s(),a(3,"mat-tab"),$(4,Qi,5,0,"ng-template",1),a(5,"div",22),g(6,"pers-business-wallet",23),s()(),a(7,"mat-tab"),$(8,Ji,5,0,"ng-template",1),a(9,"div",24),g(10,"pers-campaigns-claims-table",25),s()(),a(11,"mat-tab"),$(12,Xi,5,0,"ng-template",1),a(13,"div",24),g(14,"ex-pers-transactions-table",26),s()(),a(15,"mat-tab"),$(16,Zi,5,0,"ng-template",1),a(17,"div",24),g(18,"ex-pers-bookings-table",25),s()()),n&2){let e=p();d(6),c("$business",e.$business())("$showFilters",e.$showWalletFilters()),d(4),c("$context",L(6,Me,e.$business().id)),d(4),c("$context",L(8,Me,e.$business().id))("$tableTitle","Business Transactions"),d(4),c("$context",L(10,Me,e.$business().id))}}var ao=(()=>{class n{$isLoadingBusiness=u(!1);FileUploadEntityType=P;inputData=E.required();stateChange=Fe();fileInput;dialogRef=f(Mt);businessService=f(ht);businessAdminService=f($e);analyticsService=f(ai,{optional:!0});tokenService=f(de);redemptionService=f(Yt);snackBarService=f(G);destroyRef=f(Q);_formBuilder=f(ae);authAdminService=f(Xt,{optional:!0});$isAdmin=k(()=>!!this.authAdminService?.$adminUser());$businessRankingAnalytics=this.analyticsService?Y(this.analyticsService.businessRankingAnalytics$,{initialValue:null}):u(null);$businessClaimAnalytics=this.analyticsService?Y(this.analyticsService.businessClaimAnalytics$,{initialValue:null}):u(null);$activeCreditToken=this.tokenService.$activeCreditToken;$business=u({});isEdit=!1;$businessRedemptionRedeems=u(0);$approvalData=k(()=>this.$business()?.approval??null);$isApprovalLoading=u(!1);onApprove(){return h(this,null,function*(){this.$isApprovalLoading.set(!0);try{let e=yield this.businessAdminService.setBusinessApproval(this.$business().id,ve.APPROVED);this.$business.set(C(C({},this.$business()),e)),this.snackBarService.openSnackBar("Business approved","success")}catch{this.snackBarService.openSnackBar("Error approving business","error")}finally{this.$isApprovalLoading.set(!1)}})}onReject(e){return h(this,null,function*(){this.$isApprovalLoading.set(!0);try{let t=yield this.businessAdminService.setBusinessApproval(this.$business().id,ve.REJECTED,e);this.$business.set(C(C({},this.$business()),t)),this.snackBarService.openSnackBar("Business rejected","success")}catch{this.snackBarService.openSnackBar("Error rejecting business","error")}finally{this.$isApprovalLoading.set(!1)}})}$showWalletFilters=u(!1);$showClaimsFilters=u(!1);$showTransactionsFilters=u(!1);$disableSaveButton=u(!0);$businessClaims=u(null);$selectedTabIndex=u(0);$businessKpis=k(()=>{let e=this.$business(),t=this.$businessRankingAnalytics(),i=this.$businessClaimAnalytics(),o=this.$activeCreditToken();
1if(!e?.id)return null;let r=t?.results?.find(M=>M.businessId===e.id||M.businessid===e.id),b=i?.results?.find(M=>M.businessId===e.id||M.businessid===e.id);return{claims:b?parseInt(String(b.count||0),10):0,pointsReceived:r?parseFloat(String(r.tokenReceived||0)):0,nftBurnt:r?parseFloat(String(r.tokenBurnt||0)):0,symbol:o?.symbol||"Points"}});$businessKpiStats=k(()=>{let e=this.$businessKpis(),t=this.$businessRedemptionRedeems();return e?[{label:"Claims",value:e.claims,icon:"receipt",format:"number"},{label:`${e.symbol} Received`,value:e.pointsReceived,icon:"coin",format:"number"},{label:"Spent At",value:e.nftBurnt,icon:"flame",format:"number"},{label:"Redemptions Used",value:t,icon:"redeem",format:"number"}]:[]});$businessWalletAddress=k(()=>{let e=this.$business(),t=this.$activeCreditToken();return!e?.wallets||!t?.chainId?null:e.wallets.find(o=>o.chainId===t.chainId)?.address||null});memberOperations={getMembers:e=>this.businessAdminService.getMembers(e),addMemberByEmail:(e,t,i)=>this.businessAdminService.addMemberByEmail(e,t,i),updateMemberRole:(e,t,i)=>this.businessAdminService.updateMemberRole(e,t,i),removeMember:(e,t)=>this.businessAdminService.removeMember(e,t)};initialFormValues;maxSizeInMB=10;$isImgLoading=u(!1);$isSaveLoading=u(!1);$isToggleLoading=u(!1);$businessTypes=u([]);$detailsFields=k(()=>oi(this.$businessTypes(),this.$business()));$locationInitialValues=k(()=>{let e=this.$business();return{streetAddress:e.streetAddress||"",city:e.city||"",postalCode:e.postalCode||"",latitude:e.coordsLatitude||0,longitude:e.coordsLongitude||0,neighborhood:e.neighborhood||"",district:e.district||"",country:e.country||"",countryCode:e.countryCode||""}});$businessTypeIcon=k(()=>this.$business().businessType?.iconUrl||null);firstFormGroup=this._formBuilder.group({id:[{value:"",disabled:!0}],displayName:[{value:"",disabled:!1},[z.required]],businessId:[{value:"",disabled:!0}],accountAddress:[{value:"",disabled:!0}],email:[{value:"",disabled:!1}],phoneNumber:[{value:"",disabled:!1}],businessLegalName:[{value:"",disabled:!1}],registrationNumber:[{value:"",disabled:!1}],description:[{value:"",disabled:!1}],shortDescription:[{value:"",disabled:!1}],websiteUrl:[{value:"",disabled:!1}],imageUrl:[{value:"",disabled:!1}],logoUrl:[{value:"",disabled:!1}],streetAddress:[{value:"",disabled:!1}],city:[{value:"",disabled:!1}],postalCode:[{value:"",disabled:!1}],neighborhood:[{value:"",disabled:!1}],district:[{value:"",disabled:!1}],country:[{value:"",disabled:!1}],countryCode:[{value:"",disabled:!1}],coordsLatitude:[{value:0,disabled:!0}],coordsLongitude:[{value:0,disabled:!0}],isActive:[{value:!1,disabled:!1}],canMintToken:[{value:!1,disabled:!1}],canChargeToken:[{value:!1,disabled:!1}],canManageUsers:[{value:!1,disabled:!1}],canReceiveDonation:[{value:!1,disabled:!1}],businessTypeId:[{value:0,disabled:!1}],tags:[{value:[],disabled:!1}]});constructor(){Ce(()=>{let e=this.inputData();he(()=>{this.isEdit=e.action==="edit",this.isBusinessDTO(e.rowData)&&(this.$business.set(e.rowData),this.loadBusinessRedemptionStats(e.rowData.id)),this.initializeForm()})}),Ce(()=>{this.$isSaveLoading(),this.$disableSaveButton(),this.$selectedTabIndex(),he(()=>this.stateChange.emit())})}ngOnInit(){return h(this,null,function*(){let e=this.inputData();if(this.isBusinessDTO(e.rowData)){this.$isLoadingBusiness.set(!0);try{let t=yield this.businessAdminService.getBusinessById(e.rowData.id);t&&(this.$business.set(t),this.initializeForm())}catch(t){console.error("Error loading enriched business data:",t)}finally{this.$isLoadingBusiness.set(!1)}}this.businessService.getBusinessTypes().pipe(F(this.destroyRef)).subscribe(t=>{this.$businessTypes.set(t)})})}initializeForm(){let e=this.$business();if(!this.isEdit){this.initialFormValues=this.firstFormGroup.getRawValue(),this.firstFormGroup.valueChanges.pipe(F(this.destroyRef)).subscribe(()=>{let r=this.firstFormGroup.valid,b=!!this.firstFormGroup.get("displayName")?.value;this.$disableSaveButton.set(!r||!b)});return}let t=e.businessType?.id,i=B(C({},e),{businessType:null}),o=B(C({},i),{businessTypeId:t,businessId:e.id});this.initialFormValues=o,this.firstFormGroup.patchValue(o),this.firstFormGroup.valueChanges.pipe(F(this.destroyRef)).subscribe(()=>{let r=this.hasFormChanged();this.$disableSaveButton.set(!r)})}hasFormChanged(){let e=this.firstFormGroup.getRawValue();return JSON.stringify(this.initialFormValues)!==JSON.stringify(e)}isBusinessDTO(e){return e!==null&&typeof e=="object"&&"id"in e}loadBusinessRedemptionStats(e){return h(this,null,function*(){try{let t=yield this.redemptionService.getRedemptions({ownerBusinessId:e,include:["redeemCount"]});if(t?.data){let i=t.data.reduce((o,r)=>o+(r.redeemCount??0),0);this.$businessRedemptionRedeems.set(i)}}catch(t){console.error("Error loading business redemption stats:",t)}})}isActionDisabled(e){return e==="onSave"?this.$isSaveLoading()||this.$disableSaveButton():!1}isActionVisible(e){return e==="onSave"?this.$selectedTabIndex()===0:!0}closeDialog(){this.dialogRef.close()}onSave(){return h(this,null,function*(){if(this.$isSaveLoading.set(!0),this.firstFormGroup.valid){let e=this.getGeneralBusinessData();if(this.isEdit)try{let t=this.$business(),i=t.id;if(!i){this.snackBarService.openSnackBar("Business ID is required for update","error"),this.$isSaveLoading.set(!1);return}let o=yield this.businessAdminService.updateBusiness(i,e);this.$business.set(C(C({},t),o)),this.initialFormValues=this.firstFormGroup.getRawValue(),this.$disableSaveButton.set(!0),this.snackBarService.openSnackBar("Business updated successfully","success"),this.dialogRef.close({event:"Update",data:o})}catch(t){this.snackBarService.openSnackBar("Error updating business","error"),console.error("Error updating business:",t)}else try{let t=yield this.businessAdminService.createNewBusiness(e);this.snackBarService.openSnackBar("Business created successfully","success"),this.dialogRef.close({event:"Create",data:t})}catch(t){this.snackBarService.openSnackBar("Error creating business","error"),console.error("Error creating business:",t)}}else console.log("Form validation failed:",this.firstFormGroup.errors);this.$isSaveLoading.set(!1)})}getGeneralBusinessData(){let e=this.firstFormGroup.getRawValue(),t={displayName:e.displayName,email:e.email,phoneNumber:e.phoneNumber,businessLegalName:e.businessLegalName,registrationNumber:e.registrationNumber,description:e.description,shortDescription:e.shortDe
1scription,websiteUrl:e.websiteUrl,imageUrl:e.imageUrl,logoUrl:e.logoUrl,streetAddress:e.streetAddress,city:e.city,postalCode:e.postalCode,neighborhood:e.neighborhood,district:e.district,country:e.country,countryCode:e.countryCode,coordsLatitude:e.coordsLatitude,coordsLongitude:e.coordsLongitude,businessTypeId:e.businessTypeId,tags:e.tags??void 0};return Qt(t)}onImgSelected(e){this.$isImgLoading.set(!0)}onImgUploaded(e){return h(this,null,function*(){yield this.onImageFieldUploaded({key:"imageUrl",url:e})})}onImageFieldUploaded(e){return h(this,null,function*(){let{key:t,url:i}=e;try{if(!i||i.length===0){this.$isImgLoading.set(!1);return}if(console.log(`${t} uploaded:`,i),this.isEdit){let o=this.$business(),r={[t]:i};yield this.businessAdminService.updateBusiness(o.id,r),this.$business.set(B(C({},o),{[t]:i})),this.firstFormGroup.patchValue({[t]:i}),this.businessAdminService.reloadBusinesses(),this.snackBarService.openSnackBar("Image uploaded","success")}else this.firstFormGroup.patchValue({[t]:i});this.$isImgLoading.set(!1)}catch(o){this.snackBarService.openSnackBar("Error uploading image","error"),this.$isImgLoading.set(!1),console.error("Error uploading image:",o)}})}onLocationChange(e){this.firstFormGroup.patchValue({streetAddress:e.streetAddress,city:e.city,postalCode:e.postalCode,neighborhood:e.neighborhood??"",district:e.district??"",country:e.country??"",countryCode:e.countryCode??"",coordsLatitude:e.latitude,coordsLongitude:e.longitude}),this.firstFormGroup.markAsDirty()}selectTab(e){switch(this.$selectedTabIndex.set(e.index),this.$showWalletFilters.set(!1),this.$showClaimsFilters.set(!1),this.$showTransactionsFilters.set(!1),e.index){case 1:this.$showWalletFilters.set(!0);break;case 2:this.$showClaimsFilters.set(!0);break;case 3:this.$showTransactionsFilters.set(!0);break}}onImmediateToggle(e,t){return h(this,null,function*(){let i=this.$business();if(!this.isEdit||!i?.id){console.warn("Cannot toggle field for new business or missing business ID");return}this.$isToggleLoading.set(!0);try{let o=this.firstFormGroup.getRawValue(),r={isActive:e==="isActive"?t:!!o.isActive,canMintToken:e==="canMintToken"?t:!!o.canMintToken,canChargeToken:e==="canChargeToken"?t:!!o.canChargeToken,canManageUsers:e==="canManageUsers"?t:!!o.canManageUsers,canReceiveDonation:e==="canReceiveDonation"?t:!!o.canReceiveDonation};yield this.businessAdminService.toggleBusinessStatus(i.id,r),this.$business.set(C(C({},i),r)),this.snackBarService.openSnackBar(`${e} updated successfully`,"success")}catch(o){console.error(`Error updating ${e}:`,o),this.snackBarService.openSnackBar(`Error updating ${e}`,"error"),this.firstFormGroup.patchValue({[e]:!t})}finally{this.$isToggleLoading.set(!1)}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=N({type:n,selectors:[["pers-business-dialog"]],viewQuery:function(t,i){if(t&1&&De(Wi,5),t&2){let o;Ee(o=Ae())&&(i.fileInput=o.first)}},inputs:{inputData:[1,"inputData"]},outputs:{stateChange:"stateChange"},features:[R([ge({IconX:Et,IconUserCircle:Bt,IconBriefcase:kt,IconArticle:St,IconUsers:Dt,IconCalendar:Tt})])],decls:41,vars:22,consts:[["mat-stretch-tabs","false","animationDuration","500ms",2,"height","100%","overflow","hidden",3,"selectedTabChange"],["mat-tab-label",""],[1,"d-flex","flex-col","h-100","p-t-20",2,"overflow-y","auto"],[1,"p-0"],[1,"d-flex","flex-col","gap-0","p-b-20","p-x-24",3,"formGroup"],[3,"$title","$stats","$columns"],[1,"m-b-24"],[3,"fileSelected","imageFieldUrl","$form","$entityId","$entityType","$idLabel","$fields","$isLoading"],[1,"m-t-12"],[1,"f-w-500","m-b-8"],[3,"locationChange","$initialValues","$entityIcon"],[1,"m-t-24"],[1,"f-w-500"],[1,"text-gray-600","f-s-14","m-b-16"],[1,"row","p-l-12"],[1,"d-flex","flex-col","col","gap-10","p-0"],[1,"mat-subtitle-2","f-w-600","text-gray-100","d-block"],["color","primary",1,"self-center",3,"change","checked","disabled"],[1,"d-flex","align-items-center"],["name","user-circle",1,"d-flex","align-items-center","icon-20"],[3,"approveClicked","rejectClicked","approval","isLoading"],["matTabContent",""],[1,"d-flex","flex-col","p-24","wallet-tab-content","h-100","p-0",2,"overflow","hidden"],[1,"h-100",3,"$business","$showFilters"],[1,"d-flex","flex-col","p-24","h-100","p-0",2,"overflow","hidden"],[1,"h-100",3,"$context"],[1,"h-100",3,"$context","$tableTitle"],["name","users",1,"d-flex","align-items-center","icon-20"],[1,"d-flex","flex-col","p-y-24","b-t-1","h-100","p-0",2,"overflow-y","auto"],[3,"$organizationId","$organizationName","$memberOperations"],["name","briefcase",1,"d-flex","align-items-center","icon-20"],["name","article",1,"d-flex","align-items-center","icon-20"],["name","calendar",1,"d-flex","align-items-center","icon-20"]],template:function(t,i){if(t&1&&(a(0,"mat-tab-group",0),_("selectedTabChange",function(r){return i.selectTab(r)}),a(1,"mat-tab"),$(2,ji,5,0,"ng-template",1),a(3,"div",2)(4,"mat-card-content",3)(5,"form",4),v(6,Hi,1,3,"pers-kpi-stats-card",5),a(7,"div",6)(8,"pers-generic-detail
1s-section",7),_("fileSelected",function(r){return i.onImgSelected(r)})("imageFieldUrl",function(r){return i.onImageFieldUploaded(r)}),s()(),a(9,"section",8)(10,"h3",9),m(11,"Address & Location"),s(),a(12,"pers-location-picker",10),_("locationChange",function(r){return i.onLocationChange(r)}),s()(),a(13,"section",11)(14,"h3",12),m(15,"Settings and Permissions"),s(),a(16,"p",13),m(17,"These settings are saved immediately when changed"),s(),a(18,"div",14)(19,"div",15)(20,"mat-label",16),m(21,"Active?"),s(),a(22,"mat-slide-toggle",17),_("change",function(r){return i.onImmediateToggle("isActive",r.checked)}),s()(),a(23,"div",15)(24,"mat-label",16),m(25,"Mint Token"),s(),a(26,"mat-slide-toggle",17),_("change",function(r){return i.onImmediateToggle("canMintToken",r.checked)}),s()(),a(27,"div",15)(28,"mat-label",16),m(29,"Charge Token"),s(),a(30,"mat-slide-toggle",17),_("change",function(r){return i.onImmediateToggle("canChargeToken",r.checked)}),s()(),a(31,"div",15)(32,"mat-label",16),m(33,"Manage Users"),s(),a(34,"mat-slide-toggle",17),_("change",function(r){return i.onImmediateToggle("canManageUsers",r.checked)}),s()(),a(35,"div",15)(36,"mat-label",16),m(37,"Receive Donation"),s(),a(38,"mat-slide-toggle",17),_("change",function(r){return i.onImmediateToggle("canReceiveDonation",r.checked)}),s()()()(),v(39,Ki,4,2,"section",11),s()()()(),v(40,en,19,12),s()),t&2){let o,r,b,T,M;d(5),c("formGroup",i.firstFormGroup),d(),y(i.isEdit&&i.$businessKpiStats().length>0?6:-1),d(2),c("$form",i.firstFormGroup)("$entityId",i.$business().id)("$entityType",i.FileUploadEntityType.BUSINESS)("$idLabel","Business ID")("$fields",i.$detailsFields())("$isLoading",i.$isImgLoading()),d(4),c("$initialValues",i.$locationInitialValues())("$entityIcon",i.$businessTypeIcon()),d(10),c("checked",(o=i.firstFormGroup.get("isActive"))==null?null:o.value)("disabled",i.$isToggleLoading()),d(4),c("checked",(r=i.firstFormGroup.get("canMintToken"))==null?null:r.value)("disabled",i.$isToggleLoading()),d(4),c("checked",(b=i.firstFormGroup.get("canChargeToken"))==null?null:b.value)("disabled",i.$isToggleLoading()),d(4),c("checked",(T=i.firstFormGroup.get("canManageUsers"))==null?null:T.value)("disabled",i.$isToggleLoading()),d(4),c("checked",(M=i.firstFormGroup.get("canReceiveDonation"))==null?null:M.value)("disabled",i.$isToggleLoading()),d(),y(i.isEdit?39:-1),d(),y(i.isEdit?40:-1)}},dependencies:[We,ie,te,oe,ne,re,se,ce,vt,le,V,xt,ue,_t,ut,gt,bt,ft,Z,X,Lt,ti,Wt,jt,ii,Gt,Ut,U,Ht,Jt,qt,Kt,Zt],styles:["[_nghost-%COMP%]{display:flex!important;flex-direction:column;height:100%;overflow:hidden}select[_ngcontent-%COMP%]{height:56px!important;padding:12px;border-radius:5px}.img-card-styles[_ngcontent-%COMP%]{justify-content:center}.short-description-styles[_ngcontent-%COMP%]{width:100%}.short-description-textarea-styles[_ngcontent-%COMP%]{max-height:140px}.description-styles[_ngcontent-%COMP%]{width:100%}.description-textarea-styles[_ngcontent-%COMP%]{max-height:280px}.business-analytics-section[_ngcontent-%COMP%]{background:var(--mat-sys-surface-container-lowest, #fff);border-radius:12px;padding:20px;border:1px solid var(--mat-sys-outline-variant, rgba(0, 0, 0, .12))}.business-analytics-section[_ngcontent-%COMP%]   .section-title[_ngcontent-%COMP%]{font-size:16px;font-weight:500;color:var(--mat-sys-on-surface, rgba(0, 0, 0, .87));margin:0 0 16px}.analytics-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px 12px;background:var(--mat-sys-surface-container-low, #f5f5f5);border-radius:12px;border:1px solid var(--mat-sys-outline-variant, rgba(0, 0, 0, .08));min-height:88px;transition:background-color .2s ease,box-shadow .2s ease}.analytics-card[_ngcontent-%COMP%]:hover{background:var(--mat-sys-surface-container, #eee);box-shadow:0 2px 8px #00000014}.analytics-card[_ngcontent-%COMP%]   .analytics-label[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant, rgba(0, 0, 0, .6));font-weight:500;margin-bottom:6px;text-align:center;text-transform:uppercase;letter-spacing:.5px}.analytics-card[_ngcontent-%COMP%]   .analytics-value[_ngcontent-%COMP%]{font-size:22px;font-weight:600;color:var(--mat-sys-on-surface, rgba(0, 0, 0, .87));line-height:1.2}.kpi-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px;background:var(--mat-sys-surface-container-low, var(--light));border-radius:12px;border:1px solid var(--mat-sys-outline-variant, var(--borderColor));min-height:80px}.kpi-card[_ngcontent-%COMP%]   .kpi-label[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant, var(--textMuted));font-weight:500;margin-bottom:4px;text-align:center}.kpi-card[_ngcontent-%COMP%]   .kpi-value[_ngcontent-%COMP%]{font-size:20px;font-weight:600;color:var(--mat-sys-on-surface, var(--textPrimary))}@media (max-width: 767px){form[_ngcontent-%COMP%]   .row[_ngcontent-%COMP%]{flex-direction:column!important;margin-right:0!important;margin-left:0!important}form[_ngcontent-%COMP%]   .row[_ngcontent-%COMP%]   .col-6[_ngcontent-%COMP%], form[_ngcontent-%COMP%]   .row[_ngcontent-%COMP%]   .col-12[_ngcontent-%COMP%]{width:100%!important;max-width:100%!important;flex:0 0 100%!important;padding-right:0!important}.p-x-24[_ngcontent-%COMP%]{padding-left:12px!important;padding-right:12px!important}.p-l-12[_ngcontent-%COMP%]{padding-left:0!important}  .mat-mdc-tab{min-width:auto!important;padding:0 6px!important;flex:1 1 auto}  .mat-mdc-tab-label-content{gap:4px!important}  span.f-w-500{font-size:11px!important;white-space:nowrap}  .mat-mdc-tab mat-icon,   .mat-mdc-tab i-tabler,   .mat-mdc-tab .icon-20{width:16px!important;height:16px!important;font-size:16px!important;min-width:16px!important}  .mat-mdc-tab-labels{padding:0!important}
1  .mat-mdc-tab-header-pagination{display:none!important}  .mat-mdc-tab-header{width:calc(100% + 48px)!important;margin-left:-24px!important;margin-right:-24px!important;padding-left:16px!important;padding-right:16px!important}}"],changeDetection:0})}return n})();export{ao as BusinessDialogComponent};

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.