diff --git a/404.html b/404.html index 7cef9c4..6590dda 100644 --- a/404.html +++ b/404.html @@ -41,5 +41,5 @@ - + diff --git a/551.5de55e78a93f5225.js b/551.5de55e78a93f5225.js deleted file mode 100644 index f8f38f1..0000000 --- a/551.5de55e78a93f5225.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkangor=self.webpackChunkangor||[]).push([[551],{2747:(S,v,o)=>{o.d(v,{n:()=>R});var u=o(1648),e=o(4085),r=o(4438);const b=[[["","angorCardFront",""]],[["","angorCardBack",""]],"*",[["","angorCardExpansion",""]]],x=["[angorCardFront]","[angorCardBack]","*","[angorCardExpansion]"];function w(i,y){1&i&&(r.j41(0,"div",0),r.SdG(1),r.k0s(),r.j41(2,"div",1),r.SdG(3,1),r.k0s())}function E(i,y){1&i&&(r.j41(0,"div",2),r.SdG(1,3),r.k0s()),2&i&&r.Y8G("@expandCollapse",void 0)}function C(i,y){if(1&i&&(r.SdG(0,2),r.DNE(1,E,2,1,"div",2)),2&i){const c=r.XpG();r.R7$(),r.vxM(c.expanded?1:-1)}}let R=(()=>{class i{constructor(){this.expanded=!1,this.face="front",this.flippable=!1}get classList(){return{"angor-card-expanded":this.expanded,"angor-card-face-back":this.flippable&&"back"===this.face,"angor-card-face-front":this.flippable&&"front"===this.face,"angor-card-flippable":this.flippable}}ngOnChanges(c){"expanded"in c&&(this.expanded=(0,e.he)(c.expanded.currentValue)),"flippable"in c&&(this.flippable=(0,e.he)(c.flippable.currentValue))}static{this.\u0275fac=function(p){return new(p||i)}}static{this.\u0275cmp=r.VBU({type:i,selectors:[["angor-card"]],hostVars:2,hostBindings:function(p,f){2&p&&r.HbH(f.classList)},inputs:{expanded:"expanded",face:"face",flippable:"flippable"},exportAs:["angorCard"],standalone:!0,features:[r.OA$,r.aNF],ngContentSelectors:x,decls:2,vars:2,consts:[[1,"angor-card-front"],[1,"angor-card-back"],[1,"angor-card-expansion"]],template:function(p,f){1&p&&(r.NAR(b),r.DNE(0,w,4,0)(1,C,2,1)),2&p&&(r.vxM(f.flippable?0:-1),r.R7$(),r.vxM(f.flippable?-1:1))},styles:["angor-card{position:relative;display:flex;overflow:hidden;--tw-bg-opacity: 1;background-color:rgba(var(--angor-bg-card-rgb),var(--tw-bg-opacity));border-radius:1rem;--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}angor-card.angor-card-flippable{border-radius:0;overflow:visible;transform-style:preserve-3d;transition:transform 1s;perspective:600px;background:transparent;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}angor-card.angor-card-flippable.angor-card-face-back .angor-card-front{visibility:hidden;opacity:0;transform:rotateY(180deg)}angor-card.angor-card-flippable.angor-card-face-back .angor-card-back{visibility:visible;opacity:1;transform:rotateY(360deg)}angor-card.angor-card-flippable .angor-card-front,angor-card.angor-card-flippable .angor-card-back{display:flex;flex-direction:column;flex:1 1 auto;z-index:10;transition:transform .5s ease-out 0s,visibility 0s ease-in .2s,opacity 0s ease-in .2s;backface-visibility:hidden;--tw-bg-opacity: 1;background-color:rgba(var(--angor-bg-card-rgb),var(--tw-bg-opacity));border-radius:1rem;--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}angor-card.angor-card-flippable .angor-card-front{position:relative;opacity:1;visibility:visible;transform:rotateY(0);overflow:hidden}angor-card.angor-card-flippable .angor-card-back{position:absolute;inset:0;opacity:0;visibility:hidden;transform:rotateY(180deg);overflow:hidden auto}\n"],encapsulation:2,data:{animation:u.F}})}}return i})()},8551:(S,v,o)=>{o.r(v),o.d(v,{default:()=>D});var u=o(467),e=o(4438),r=o(9417),b=o(177),x=o(2102),w=o(9042),E=o(8834),C=o(9213),R=o(2798),i=o(7403),y=o(6324),c=o(6231),p=o(719),f=o(2747),A=o(5766),Z=o(9706);function T(l,k){1&l&&(e.j41(0,"div",6)(1,"label",7),e.EFF(2,"Comment (Optional)"),e.k0s(),e.nrm(3,"textarea",17),e.k0s())}function j(l,k){if(1&l&&(e.j41(0,"div",18)(1,"h3",19),e.EFF(2,"Invoice Created:"),e.k0s(),e.j41(3,"p",20),e.EFF(4),e.k0s()()),2&l){const t=e.XpG();e.R7$(4),e.JRh(t.invoice.pr)}}function I(l,k){if(1&l&&(e.j41(0,"div",21)(1,"p",22),e.EFF(2),e.k0s()()),2&l){const t=e.XpG();e.R7$(2),e.JRh(t.error)}}const D=[{path:"",component:(()=>{class l{constructor(t){this.util=t,this.formBuilder=(0,e.WQX)(r.ok),this.signerService=(0,e.WQX)(y.A),this.relayService=(0,e.WQX)(c.b),this.payRequest=null,this.invoice={pr:""},this.canZap=!1,this.loading=!1,this.error=""}ngOnInit(){this.initializeForm()}initializeForm(){this.sendZapForm=this.formBuilder.group({lightningAddress:["",[r.k0.required,this.validateLightningAddress]],eventId:[""],amount:["",[r.k0.required,r.k0.min(1)]],comment:[""]})}validateLightningAddress(t){return t.value.includes("@")?null:{invalidFormat:!0}}getCallbackUrl(t){if(t.includes("@")){const[a,n]=t.split("@");return`https://${n}/.well-known/lnurlp/${a}`}return t.toLowerCase().startsWith("lnurl")?this.util.convertBech32ToText(t).toString():null}fetchPayRequest(){var t=this;return(0,u.A)(function*(){t.resetState();const a=t.sendZapForm.get("lightningAddress")?.value;if(!a)return void t.setError("Lightning Address is required.");const n=t.getCallbackUrl(a);try{const s=yield fetch(n);if(!s.ok)throw new Error("Failed to fetch pay request.");const d=yield s.json();if("ERROR"===d.status)return void t.setError(d.reason||"Error fetching the pay request.");t.payRequest=d,t.canZap=!0,t.configureAmountValidators()}catch(s){t.setError(s.message||"Error connecting to the server.")}finally{t.loading=!1}})()}configureAmountValidators(){if(!this.payRequest)return;const t=(this.payRequest.minSendable||1e3)/1e3,a=(this.payRequest.maxSendable||21e6)/1e3,n=this.sendZapForm.get("amount");n?.setValidators([r.k0.required,r.k0.min(t),r.k0.max(a)]),n?.updateValueAndValidity()}onSubmit(){var t=this;return(0,u.A)(function*(){if(t.sendZapForm.invalid)return void t.setError("Please fill out the form correctly.");t.resetState();const{eventId:n,amount:s,comment:d}=t.sendZapForm.value;if(!t.payRequest)return void t.setError("Pay request is not loaded.");const m=new URL(t.payRequest.callback),h=new URLSearchParams({amount:(1e3*s).toString()});if(d&&t.payRequest.commentAllowed&&h.set("comment",d),n){const g=yield t.createAndSignZapRequest(n,d);h.set("nostr",JSON.stringify(g))}try{const g=yield fetch(`${m.origin}${m.pathname}?${h.toString()}`);if(!g.ok)throw new Error("Failed to fetch invoice.");const F=yield g.json();if("ERROR"===F.status)return void t.setError(F.reason||"Error fetching the invoice.");t.invoice=F}catch(g){t.setError(g.message||"Error fetching the invoice.")}})()}createAndSignZapRequest(t,a){var n=this;return(0,u.A)(function*(){try{const s=n.createZapRequestData(t,a);let d;if(n.signerService.isUsingSecretKey()){const m=yield n.signerService.getDecryptedSecretKey();if(!m)throw new Error("Private key could not be retrieved.");const h=(0,A.aT)(m);d=(0,p.pC)(s,h)}else d=yield n.signerService.signEventWithExtension(s);if(!d)throw new Error("Signing failed. Signed event is null.");return d}catch(s){throw console.error("Error creating and signing zap request:",s),new Error("Failed to create and sign zap request.")}})()}createZapRequestData(t,a){return{kind:9734,content:a||"",tags:[["e",t],["p",this.payRequest?.nostrPubkey||""],["relays",...this.relayService.getConnectedRelays()]],pubkey:this.signerService.getPublicKey(),created_at:Math.floor(Date.now()/1e3)}}sendZapToRelay(t){var a=this;return(0,u.A)(function*(){try{yield a.relayService.publishEventToWriteRelays(t),console.log("Zap event sent successfully")}catch(n){a.setError("Failed to send zap event to relays"),console.error("Error sending zap event:",n)}})()}resetState(){this.error="",this.loading=!0,this.invoice={pr:""}}setError(t){this.error=t,this.loading=!1}static{this.\u0275fac=function(a){return new(a||l)(e.rXU(Z.FP))}}static{this.\u0275cmp=e.VBU({type:l,selectors:[["app-zap"]],standalone:!0,features:[e.aNF],decls:27,vars:6,consts:[[1,"mx-auto","w-full","max-w-5xl","p-6","sm:p-8"],[1,"flex","w-full","max-w-140","m-auto","flex-col","items-start"],[1,"mb-8","flex","flex-col","items-start","p-6","sm:p-8","transition-all","duration-300","w-full","pb-6"],[1,"flex","items-center","justify-center","mb-6","w-full"],[1,"text-2xl","font-semibold","text-center"],[1,"w-full","space-y-4",3,"ngSubmit","formGroup"],[1,"form-group"],[1,"block","text-sm","font-medium","text-gray-600","mb-1"],[1,"flex","items-center"],["type","text","formControlName","lightningAddress","placeholder","username@domain.com",1,"flex-grow","p-2","border","rounded","focus:outline-none","focus:ring-2","focus:ring-gray-500"],["type","button",1,"ml-2","px-4","py-2","text-sm","bg-gray-800","text-white","rounded","hover:bg-gray-700",3,"click"],["type","text","formControlName","eventId","placeholder","Event ID for specific zap",1,"w-full","p-2","border","rounded","focus:outline-none","focus:ring-2","focus:ring-gray-500"],["type","number","formControlName","amount","placeholder","Amount",1,"w-full","p-2","border","rounded","focus:outline-none","focus:ring-2","focus:ring-gray-500"],["class","form-group",4,"ngIf"],["type","submit",1,"w-full","py-2","text-sm","font-semibold","bg-gray-800","text-white","rounded","hover:bg-gray-700","disabled:bg-gray-400",3,"disabled"],["class","invoice mt-6 p-4 border rounded-lg bg-gray-50 shadow w-full",4,"ngIf"],["class","error mt-6 p-4 border rounded-lg bg-red-50 shadow w-full",4,"ngIf"],["formControlName","comment","placeholder","Add a comment...","rows","3",1,"w-full","p-2","border","rounded","focus:outline-none","focus:ring-2","focus:ring-gray-500"],[1,"invoice","mt-6","p-4","border","rounded-lg","bg-gray-50","shadow","w-full"],[1,"text-lg","font-semibold","text-gray-800"],[1,"text-gray-700","break-words"],[1,"error","mt-6","p-4","border","rounded-lg","bg-red-50","shadow","w-full"],[1,"text-red-600","font-medium"]],template:function(a,n){1&a&&(e.j41(0,"div",0)(1,"div",1)(2,"angor-card",2)(3,"div",3)(4,"h2",4),e.EFF(5,"Send a Zap"),e.k0s()(),e.j41(6,"form",5),e.bIt("ngSubmit",function(){return n.onSubmit()}),e.j41(7,"div",6)(8,"label",7),e.EFF(9,"Lightning Address"),e.k0s(),e.j41(10,"div",8),e.nrm(11,"input",9),e.j41(12,"button",10),e.bIt("click",function(){return n.fetchPayRequest()}),e.EFF(13," Fetch "),e.k0s()()(),e.j41(14,"div",6)(15,"label",7),e.EFF(16,"Event ID (Optional)"),e.k0s(),e.nrm(17,"input",11),e.k0s(),e.j41(18,"div",6)(19,"label",7),e.EFF(20,"Amount (in Satoshis)"),e.k0s(),e.nrm(21,"input",12),e.k0s(),e.DNE(22,T,4,0,"div",13),e.j41(23,"button",14),e.EFF(24),e.k0s()(),e.DNE(25,j,5,1,"div",15)(26,I,3,1,"div",16),e.k0s()()()),2&a&&(e.R7$(6),e.Y8G("formGroup",n.sendZapForm),e.R7$(16),e.Y8G("ngIf",null==n.payRequest?null:n.payRequest.commentAllowed),e.R7$(),e.Y8G("disabled",n.sendZapForm.invalid||n.loading),e.R7$(),e.SpI(" ",n.loading?"Sending...":"Send Zap"," "),e.R7$(),e.Y8G("ngIf",n.invoice.pr),e.R7$(),e.Y8G("ngIf",n.error))},dependencies:[b.MD,b.bT,x.RG,w.fS,E.Hl,C.m_,R.Ve,i.EE,r.X1,r.qT,r.me,r.Q0,r.BC,r.cb,r.j4,r.JD,f.n]})}}return l})()}]}}]); \ No newline at end of file diff --git a/551.e12e45c28bc44f03.js b/551.e12e45c28bc44f03.js new file mode 100644 index 0000000..f61ab50 --- /dev/null +++ b/551.e12e45c28bc44f03.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkangor=self.webpackChunkangor||[]).push([[551],{2747:(S,m,a)=>{a.d(m,{n:()=>E});var g=a(1648),h=a(4085),r=a(4438);const e=[[["","angorCardFront",""]],[["","angorCardBack",""]],"*",[["","angorCardExpansion",""]]],i=["[angorCardFront]","[angorCardBack]","*","[angorCardExpansion]"];function y(s,v){1&s&&(r.j41(0,"div",0),r.SdG(1),r.k0s(),r.j41(2,"div",1),r.SdG(3,1),r.k0s())}function x(s,v){1&s&&(r.j41(0,"div",2),r.SdG(1,3),r.k0s()),2&s&&r.Y8G("@expandCollapse",void 0)}function w(s,v){if(1&s&&(r.SdG(0,2),r.DNE(1,x,2,1,"div",2)),2&s){const c=r.XpG();r.R7$(),r.vxM(c.expanded?1:-1)}}let E=(()=>{class s{constructor(){this.expanded=!1,this.face="front",this.flippable=!1}get classList(){return{"angor-card-expanded":this.expanded,"angor-card-face-back":this.flippable&&"back"===this.face,"angor-card-face-front":this.flippable&&"front"===this.face,"angor-card-flippable":this.flippable}}ngOnChanges(c){"expanded"in c&&(this.expanded=(0,h.he)(c.expanded.currentValue)),"flippable"in c&&(this.flippable=(0,h.he)(c.flippable.currentValue))}static{this.\u0275fac=function(u){return new(u||s)}}static{this.\u0275cmp=r.VBU({type:s,selectors:[["angor-card"]],hostVars:2,hostBindings:function(u,f){2&u&&r.HbH(f.classList)},inputs:{expanded:"expanded",face:"face",flippable:"flippable"},exportAs:["angorCard"],standalone:!0,features:[r.OA$,r.aNF],ngContentSelectors:i,decls:2,vars:2,consts:[[1,"angor-card-front"],[1,"angor-card-back"],[1,"angor-card-expansion"]],template:function(u,f){1&u&&(r.NAR(e),r.DNE(0,y,4,0)(1,w,2,1)),2&u&&(r.vxM(f.flippable?0:-1),r.R7$(),r.vxM(f.flippable?-1:1))},styles:["angor-card{position:relative;display:flex;overflow:hidden;--tw-bg-opacity: 1;background-color:rgba(var(--angor-bg-card-rgb),var(--tw-bg-opacity));border-radius:1rem;--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}angor-card.angor-card-flippable{border-radius:0;overflow:visible;transform-style:preserve-3d;transition:transform 1s;perspective:600px;background:transparent;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}angor-card.angor-card-flippable.angor-card-face-back .angor-card-front{visibility:hidden;opacity:0;transform:rotateY(180deg)}angor-card.angor-card-flippable.angor-card-face-back .angor-card-back{visibility:visible;opacity:1;transform:rotateY(360deg)}angor-card.angor-card-flippable .angor-card-front,angor-card.angor-card-flippable .angor-card-back{display:flex;flex-direction:column;flex:1 1 auto;z-index:10;transition:transform .5s ease-out 0s,visibility 0s ease-in .2s,opacity 0s ease-in .2s;backface-visibility:hidden;--tw-bg-opacity: 1;background-color:rgba(var(--angor-bg-card-rgb),var(--tw-bg-opacity));border-radius:1rem;--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}angor-card.angor-card-flippable .angor-card-front{position:relative;opacity:1;visibility:visible;transform:rotateY(0);overflow:hidden}angor-card.angor-card-flippable .angor-card-back{position:absolute;inset:0;opacity:0;visibility:hidden;transform:rotateY(180deg);overflow:hidden auto}\n"],encapsulation:2,data:{animation:g.F}})}}return s})()},8551:(S,m,a)=>{a.r(m),a.d(m,{default:()=>D});var g=a(467),h=a(7403),r=a(177),e=a(4438),i=a(9417),y=a(8834),x=a(2102),w=a(9213),E=a(9042),s=a(2798),v=a(5766),c=a(6231),u=a(6324),f=a(9706),A=a(719),Z=a(2747);function T(d,k){1&d&&(e.j41(0,"div",6)(1,"label",7),e.EFF(2,"Comment (Optional)"),e.k0s(),e.nrm(3,"textarea",17),e.k0s())}function I(d,k){if(1&d&&(e.j41(0,"div",18)(1,"h3",19),e.EFF(2,"Invoice Created:"),e.k0s(),e.j41(3,"p",20),e.EFF(4),e.k0s()()),2&d){const t=e.XpG();e.R7$(4),e.JRh(t.invoice.pr)}}function j(d,k){if(1&d&&(e.j41(0,"div",21)(1,"p",22),e.EFF(2),e.k0s()()),2&d){const t=e.XpG();e.R7$(2),e.JRh(t.error)}}const D=[{path:"",component:(()=>{class d{constructor(){this.formBuilder=(0,e.WQX)(i.ok),this.signerService=(0,e.WQX)(u.A),this.relayService=(0,e.WQX)(c.b),this.utilities=(0,e.WQX)(f.FP),this.payRequest=null,this.invoice={pr:""},this.canZap=!1,this.loading=!1,this.error=""}ngOnInit(){this.initializeForm()}initializeForm(){this.sendZapForm=this.formBuilder.group({lightningAddress:["",[i.k0.required,this.validateLightningAddress]],eventId:[""],amount:["",[i.k0.required,i.k0.min(1)]],comment:[""]})}validateLightningAddress(t){return t.value.includes("@")?null:{invalidFormat:!0}}getCallbackUrl(t){try{if(t.includes("@")){const[o,n]=t.split("@");return`https://${n}/.well-known/lnurlp/${o}`}return t.toLowerCase().startsWith("lnurl")?this.utilities.convertBech32ToText(t).toString():null}catch(o){return console.error("Error generating callback URL:",o),null}}fetchPayRequest(){var t=this;return(0,g.A)(function*(){t.resetState();const o=t.sendZapForm.get("lightningAddress")?.value;if(!o)return void t.setError("Lightning Address is required.");const n=t.getCallbackUrl(o);if(n)try{const l=yield fetch(n);if(!l.ok)throw new Error(`Failed to fetch pay request: ${l.statusText}`);const p=yield l.json();if("ERROR"===p.status)throw new Error(p.reason||"Error fetching the pay request.");t.payRequest=p,t.canZap=!0,t.configureAmountValidators()}catch(l){t.setError(l.message||"Error connecting to the server.")}finally{t.loading=!1}else t.setError("Invalid Lightning Address.")})()}configureAmountValidators(){if(!this.payRequest)return;const t=(this.payRequest.minSendable||1e3)/1e3,o=(this.payRequest.maxSendable||21e6)/1e3,n=this.sendZapForm.get("amount");n?.setValidators([i.k0.required,i.k0.min(t),i.k0.max(o)]),n?.updateValueAndValidity()}onSubmit(){var t=this;return(0,g.A)(function*(){if(t.sendZapForm.invalid)return void t.setError("Please fill out the form correctly.");t.resetState();const{eventId:n,amount:l,comment:p}=t.sendZapForm.value;if(t.payRequest)try{const b=new URL(t.payRequest.callback),C=new URLSearchParams({amount:(1e3*l).toString()});if(p&&t.payRequest.commentAllowed&&C.set("comment",p),n){const $=yield t.createAndSignZapRequest(n,p);C.set("nostr",JSON.stringify($))}const R=yield fetch(`${b.origin}${b.pathname}?${C.toString()}`);if(!R.ok)throw new Error(`Failed to fetch invoice: ${R.statusText}`);const F=yield R.json();if("ERROR"===F.status)throw new Error(F.reason||"Error fetching the invoice.");t.invoice=F}catch(b){t.setError(b.message||"Error processing the zap request.")}finally{t.loading=!1}else t.setError("Pay request is not loaded.")})()}createAndSignZapRequest(t,o){var n=this;return(0,g.A)(function*(){try{const l=n.createZapRequestData(t,o),p=n.signerService.isUsingSecretKey()?(0,A.pC)(l,(0,v.aT)(yield n.signerService.getDecryptedSecretKey())):yield n.signerService.signEventWithExtension(l);if(!p)throw new Error("Signing failed. Signed event is null.");return p}catch(l){throw console.error("Error creating and signing zap request:",l),new Error("Failed to create and sign zap request.")}})()}createZapRequestData(t,o){return{kind:9734,content:o||"",tags:[["e",t],["p",this.payRequest?.nostrPubkey||""],["relays",...this.relayService.getConnectedRelays()]],pubkey:this.signerService.getPublicKey(),created_at:Math.floor(Date.now()/1e3)}}resetState(){this.error="",this.loading=!0,this.invoice={pr:""}}setError(t){this.error=t,this.loading=!1}static{this.\u0275fac=function(o){return new(o||d)}}static{this.\u0275cmp=e.VBU({type:d,selectors:[["app-zap"]],standalone:!0,features:[e.aNF],decls:27,vars:6,consts:[[1,"mx-auto","w-full","max-w-5xl","p-6","sm:p-8"],[1,"flex","w-full","max-w-140","m-auto","flex-col","items-start"],[1,"mb-8","flex","flex-col","items-start","p-6","sm:p-8","transition-all","duration-300","w-full","pb-6"],[1,"flex","items-center","justify-center","mb-6","w-full"],[1,"text-2xl","font-semibold","text-center"],[1,"w-full","space-y-4",3,"ngSubmit","formGroup"],[1,"form-group"],[1,"block","text-sm","font-medium","text-gray-600","mb-1"],[1,"flex","items-center"],["type","text","formControlName","lightningAddress","placeholder","username@domain.com",1,"flex-grow","p-2","border","rounded","focus:outline-none","focus:ring-2","focus:ring-gray-500"],["type","button",1,"ml-2","px-4","py-2","text-sm","bg-gray-800","text-white","rounded","hover:bg-gray-700",3,"click"],["type","text","formControlName","eventId","placeholder","Event ID for specific zap",1,"w-full","p-2","border","rounded","focus:outline-none","focus:ring-2","focus:ring-gray-500"],["type","number","formControlName","amount","placeholder","Amount",1,"w-full","p-2","border","rounded","focus:outline-none","focus:ring-2","focus:ring-gray-500"],["class","form-group",4,"ngIf"],["type","submit",1,"w-full","py-2","text-sm","font-semibold","bg-gray-800","text-white","rounded","hover:bg-gray-700","disabled:bg-gray-400",3,"disabled"],["class","invoice mt-6 p-4 border rounded-lg bg-gray-50 shadow w-full",4,"ngIf"],["class","error mt-6 p-4 border rounded-lg bg-red-50 shadow w-full",4,"ngIf"],["formControlName","comment","placeholder","Add a comment...","rows","3",1,"w-full","p-2","border","rounded","focus:outline-none","focus:ring-2","focus:ring-gray-500"],[1,"invoice","mt-6","p-4","border","rounded-lg","bg-gray-50","shadow","w-full"],[1,"text-lg","font-semibold","text-gray-800"],[1,"text-gray-700","break-words"],[1,"error","mt-6","p-4","border","rounded-lg","bg-red-50","shadow","w-full"],[1,"text-red-600","font-medium"]],template:function(o,n){1&o&&(e.j41(0,"div",0)(1,"div",1)(2,"angor-card",2)(3,"div",3)(4,"h2",4),e.EFF(5,"Send a Zap"),e.k0s()(),e.j41(6,"form",5),e.bIt("ngSubmit",function(){return n.onSubmit()}),e.j41(7,"div",6)(8,"label",7),e.EFF(9,"Lightning Address"),e.k0s(),e.j41(10,"div",8),e.nrm(11,"input",9),e.j41(12,"button",10),e.bIt("click",function(){return n.fetchPayRequest()}),e.EFF(13," Fetch "),e.k0s()()(),e.j41(14,"div",6)(15,"label",7),e.EFF(16,"Event ID (Optional)"),e.k0s(),e.nrm(17,"input",11),e.k0s(),e.j41(18,"div",6)(19,"label",7),e.EFF(20,"Amount (in Satoshis)"),e.k0s(),e.nrm(21,"input",12),e.k0s(),e.DNE(22,T,4,0,"div",13),e.j41(23,"button",14),e.EFF(24),e.k0s()(),e.DNE(25,I,5,1,"div",15)(26,j,3,1,"div",16),e.k0s()()()),2&o&&(e.R7$(6),e.Y8G("formGroup",n.sendZapForm),e.R7$(16),e.Y8G("ngIf",null==n.payRequest?null:n.payRequest.commentAllowed),e.R7$(),e.Y8G("disabled",n.sendZapForm.invalid||n.loading),e.R7$(),e.SpI(" ",n.loading?"Sending...":"Send Zap"," "),e.R7$(),e.Y8G("ngIf",n.invoice.pr),e.R7$(),e.Y8G("ngIf",n.error))},dependencies:[r.MD,r.bT,x.RG,E.fS,y.Hl,w.m_,s.Ve,h.EE,i.X1,i.qT,i.me,i.Q0,i.BC,i.cb,i.j4,i.JD,Z.n]})}}return d})()}]}}]); \ No newline at end of file diff --git a/873.6609f53c79575bb2.js b/873.0e3b3fa22d50ccac.js similarity index 53% rename from 873.6609f53c79575bb2.js rename to 873.0e3b3fa22d50ccac.js index 690b62c..f41750e 100644 --- a/873.6609f53c79575bb2.js +++ b/873.0e3b3fa22d50ccac.js @@ -1 +1 @@ -"use strict";(self.webpackChunkangor=self.webpackChunkangor||[]).push([[873],{9873:(ot,E,a)=>{a.r(E),a.d(E,{default:()=>Ke});var m=a(467),S=a(9345),$=a(7403),d=a(177),c=a(9417),g=a(8834),y=a(1997),f=a(2102),_=a(9213),b=a(9042),k=a(9115),Y=a(9183),D=a(450),x=a(4823),F=a(5245),B=a(8865),C=a(5398),M=a(7540),X=a(1413),A=a(9454),G=a(882),N=a(8703),e=a(4438),h=a(5351),P=a(5416);class V{constructor(s,t){this._document=t;const o=this._textarea=this._document.createElement("textarea"),n=o.style;n.position="fixed",n.top=n.opacity="0",n.left="-999em",o.setAttribute("aria-hidden","true"),o.value=s,o.readOnly=!0,(this._document.fullscreenElement||this._document.body).appendChild(o)}copy(){const s=this._textarea;let t=!1;try{if(s){const o=this._document.activeElement;s.select(),s.setSelectionRange(0,s.value.length),t=this._document.execCommand("copy"),o&&o.focus()}}catch{}return t}destroy(){const s=this._textarea;s&&(s.remove(),this._textarea=void 0)}}let w=(()=>{class i{constructor(t){this._document=t}copy(t){const o=this.beginCopy(t),n=o.copy();return o.destroy(),n}beginCopy(t){return new V(t,this._document)}static{this.\u0275fac=function(o){return new(o||i)(e.KVO(d.qQ))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var j=a(7673),R=a(9437),L=a(1626);let Z=(()=>{class i{constructor(t){this.http=t}getLightning(t){return this.http.get(t).pipe((0,R.W)(o=>(console.error("Failed to fetch Lightning response:",o),(0,j.of)({status:"Failed"}))))}getLightningInvoice(t,o){return this.http.get(`${t}?amount=${o}`).pipe((0,R.W)(r=>(console.error("Failed to fetch Lightning invoice:",r),(0,j.of)({pr:"",status:"Failed"}))))}getLightningAddress(t){try{const[o,n]=t.split("@");return`https://${n}/.well-known/lnurlp/${o}`}catch{return console.error("Invalid Lightning address format:",t),""}}sendZapRequest(t,o,n,r){const l=encodeURIComponent(JSON.stringify(o));return this.http.get(`${t}?amount=${n}&nostr=${l}&lnurl=${r}`).pipe((0,R.W)(u=>(console.error("Failed to send zap request:",u),(0,j.of)({pr:"",status:"Failed"}))))}login(){return(0,m.A)(function*(){try{return window.webln&&!window.webln.isEnabled()&&(yield window.webln.enable()),!0}catch(t){return console.error("WebLN login failed:",t),!1}})()}hasWebln(){return!!window.webln}sendPayment(t){var o=this;return(0,m.A)(function*(){try{return o.hasWebln()?yield window.webln.sendPayment(t):(console.error("WebLN is not available"),null)}catch(n){throw console.error("Payment failed:",n),n}})()}payInvoice(t){var o=this;return(0,m.A)(function*(){if((yield o.login())&&o.hasWebln())try{return!!(yield o.sendPayment(t))}catch(r){return console.error("Failed to pay invoice:",r),!1}return console.error("WebLN not available or login failed"),!1})()}static{this.\u0275fac=function(o){return new(o||i)(e.KVO(L.Qq))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var O=a(719),U=a(6324),W=a(6231),z=a(2798),K=a(5766),q=a(9706);function Q(i,s){if(1&i){const t=e.RV6();e.j41(0,"button",15),e.bIt("click",function(){let n;const r=e.eBV(t).$implicit,l=e.XpG(2);return e.Njj(null==(n=l.sendZapForm.get("amount"))?null:n.setValue(r.value))}),e.j41(1,"mat-icon",16),e.EFF(2),e.k0s(),e.j41(3,"span",17),e.EFF(4),e.k0s()()}if(2&i){const t=s.$implicit;e.R7$(2),e.JRh(t.icon),e.R7$(2),e.JRh(t.label)}}function J(i,s){1&i&&(e.j41(0,"mat-error"),e.EFF(1," Zap amount is required "),e.k0s())}function H(i,s){1&i&&(e.j41(0,"mat-error"),e.EFF(1," Minimum amount is 1 sat "),e.k0s())}function ee(i,s){if(1&i){const t=e.RV6();e.j41(0,"mat-dialog-content",5)(1,"div",6),e.DNE(2,Q,5,2,"button",7),e.k0s(),e.nrm(3,"mat-divider"),e.j41(4,"div",8)(5,"mat-form-field",9)(6,"mat-label"),e.EFF(7,"Zap Amount"),e.k0s(),e.nrm(8,"input",10),e.j41(9,"mat-hint",11),e.EFF(10,"Amount in sats"),e.k0s(),e.DNE(11,J,2,0,"mat-error",12)(12,H,2,0,"mat-error",12),e.k0s(),e.j41(13,"mat-form-field",9)(14,"mat-label"),e.EFF(15,"Comment"),e.k0s(),e.nrm(16,"input",13),e.j41(17,"mat-hint",11),e.EFF(18),e.k0s()()(),e.j41(19,"mat-dialog-actions",11)(20,"button",14),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.onSubmit())}),e.EFF(21," Create Invoice "),e.k0s()()()}if(2&i){let t,o,n;const r=e.XpG();e.R7$(2),e.Y8G("ngForOf",r.zapButtons),e.R7$(2),e.Y8G("formGroup",r.sendZapForm),e.R7$(7),e.Y8G("ngIf",null==(t=r.sendZapForm.get("amount"))?null:t.hasError("required")),e.R7$(),e.Y8G("ngIf",null==(o=r.sendZapForm.get("amount"))?null:o.hasError("min")),e.R7$(6),e.SpI(" ",(null==(n=r.sendZapForm.get("comment"))||null==n.value?null:n.value.length)||0,"/100 "),e.R7$(2),e.Y8G("disabled",r.sendZapForm.invalid)}}function te(i,s){if(1&i&&(e.j41(0,"div",21)(1,"span",22),e.EFF(2),e.k0s(),e.nrm(3,"mat-divider",23)(4,"qrcode",24),e.k0s()),2&i){const t=e.XpG(2);e.R7$(2),e.SpI("Scan with phone to pay (",t.invoiceAmount," sats)"),e.R7$(2),e.Y8G("qrdata",t.lightningInvoice)("matTooltip","Lightning Invoice")("errorCorrectionLevel","M")}}function ne(i,s){if(1&i){const t=e.RV6();e.j41(0,"div",25)(1,"mat-form-field",26)(2,"mat-label"),e.EFF(3,"Invoice Address"),e.k0s(),e.nrm(4,"input",27),e.j41(5,"button",28),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return e.Njj(n.copyInvoice())}),e.nrm(6,"mat-icon",29),e.k0s()()()}if(2&i){const t=e.XpG(2);e.R7$(4),e.Y8G("value",t.lightningInvoice),e.R7$(),e.Y8G("matTooltip","Copy Invoice"),e.R7$(),e.Y8G("svgIcon","heroicons_outline:clipboard-document")}}function oe(i,s){if(1&i&&(e.j41(0,"mat-dialog-content",18),e.DNE(1,te,5,4,"div",19)(2,ne,7,3,"div",20),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ngIf",t.displayQRCode),e.R7$(),e.Y8G("ngIf",t.showInvoiceSection&&t.lightningInvoice)}}let ie=(()=>{class i{constructor(t){this.util=t,this.formBuilder=(0,e.WQX)(c.ok),this.lightningService=(0,e.WQX)(Z),this.signerService=(0,e.WQX)(U.A),this.relayService=(0,e.WQX)(W.b),this.dialogRef=(0,e.WQX)(h.CP),this.snackBar=(0,e.WQX)(P.UG),this.clipboard=(0,e.WQX)(w),this.data=(0,e.WQX)(h.Vh),this.lightningInvoice="",this.payRequest=null,this.displayQRCode=!1,this.showInvoiceSection=!1,this.loading=!1,this.invoiceAmount=0,this.error="",this.zapButtons=[{icon:"thumb_up",label:"21",value:21},{icon:"favorite",label:"50",value:50},{icon:"emoji_emotions",label:"100",value:100},{icon:"star",label:"500",value:500},{icon:"celebration",label:"1k",value:1e3},{icon:"rocket",label:"5k",value:5e3},{icon:"local_fire_department",label:"10k",value:1e4},{icon:"flash_on",label:"100k",value:1e5},{icon:"diamond",label:"500k",value:5e5}]}ngOnInit(){this.initializeForm()}initializeForm(){this.sendZapForm=this.formBuilder.group({lightningAddress:[this.data.lud16||this.data.lud06,[c.k0.required,this.validateLightningAddress]],amount:["",[c.k0.required,c.k0.min(1)]],comment:[""]})}validateLightningAddress(t){return t.value.includes("@")?null:{invalidFormat:!0}}onSubmit(){var t=this;return(0,m.A)(function*(){t.sendZapForm.invalid?t.showError("Please fill out the form correctly."):(t.loading=!0,yield t.fetchPayRequest())})()}getCallbackUrl(t){if(t.includes("@")){const[o,n]=t.split("@");return`https://${n}/.well-known/lnurlp/${o}`}return t.toLowerCase().startsWith("lnurl")?this.util.convertBech32ToText(t).toString():null}fetchPayRequest(){var t=this;return(0,m.A)(function*(){t.resetState();const o=t.data.lud16||t.data.lud06;if(!o)return void t.showError("Lightning Address is required.");let n=t.getCallbackUrl(o);try{const r=yield fetch(n);if(!r.ok)throw new Error("Failed to fetch pay request.");const l=yield r.json();if("ERROR"===l.status)return void t.showError(l.reason||"Error fetching the pay request.");t.payRequest=l,t.showInvoiceSection=!1,t.configureAmountValidators(),yield t.generateInvoice()}catch(r){t.showError(r.message||"Error connecting to the server.")}finally{t.loading=!1}})()}generateInvoice(){var t=this;return(0,m.A)(function*(){const o=t.sendZapForm.get("amount")?.value,n=t.sendZapForm.get("comment")?.value,r=t.data.eventId||null;if(!t.payRequest)return void t.showError("Pay request is not loaded.");t.invoiceAmount=o;const l=new URL(t.payRequest.callback),p=new URLSearchParams({amount:(1e3*o).toString()});if(n&&t.payRequest.commentAllowed&&p.set("comment",n),r){const u=yield t.createAndSignZapRequest(r,n);p.set("nostr",JSON.stringify(u))}try{const u=yield fetch(`${l.origin}${l.pathname}?${p.toString()}`);if(!u.ok)throw new Error("Failed to fetch invoice.");const v=yield u.json();if("ERROR"===v.status)return void t.showError(v.reason||"Error fetching the invoice.");t.lightningInvoice=v.pr,t.showInvoiceSection=!0,t.toggleQRCodeDisplay(!0)}catch(u){t.showError(u.message||"Error fetching the invoice.")}})()}configureAmountValidators(){if(!this.payRequest)return;const t=(this.payRequest.minSendable||1e3)/1e3,o=(this.payRequest.maxSendable||21e6)/1e3,n=this.sendZapForm.get("amount");n?.setValidators([c.k0.required,c.k0.min(t),c.k0.max(o)]),n?.updateValueAndValidity()}createAndSignZapRequest(t,o){var n=this;return(0,m.A)(function*(){try{const r=n.createZapRequestData(t,o);let l;if(n.signerService.isUsingSecretKey()){const p=yield n.signerService.getDecryptedSecretKey();if(!p)throw new Error("Private key could not be retrieved.");const u=(0,K.aT)(p);l=(0,O.pC)(r,u)}else l=yield n.signerService.signEventWithExtension(r);if(!l)throw new Error("Signing failed. Signed event is null.");return l}catch(r){throw console.error("Error creating and signing zap request:",r),new Error("Failed to create and sign zap request.")}})()}createZapRequestData(t,o){return{kind:9734,content:o||"",tags:[["e",t],["p",this.payRequest?.nostrPubkey||""],["relays",...this.relayService.getConnectedRelays()]],pubkey:this.signerService.getPublicKey(),created_at:Math.floor(Date.now()/1e3)}}copyInvoice(){this.lightningInvoice?(this.clipboard.copy(this.lightningInvoice),this.showSuccess("Invoice copied to clipboard")):this.showError("No invoice available to copy")}toggleQRCodeDisplay(t=!1){this.displayQRCode=!!t||!this.displayQRCode}resetState(){this.error="",this.loading=!0,this.lightningInvoice=""}showError(t){this.error=t,this.loading=!1,this.snackBar.open(t,"Dismiss",{duration:2e3})}showSuccess(t){this.snackBar.open(t,"Dismiss",{duration:2e3})}closeDialog(){this.dialogRef.close()}static{this.\u0275fac=function(o){return new(o||i)(e.rXU(q.FP))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["app-send-dialog"]],standalone:!0,features:[e.aNF],decls:7,vars:4,consts:[[1,"absolute","right-0","top-0","pr-4","pt-4"],["mat-icon-button","","aria-label","Close",3,"matDialogClose"],[1,"text-secondary",3,"svgIcon"],["class","p-0 mt-4",4,"ngIf"],["class","flex flex-col items-center justify-center text-center p-1 mt-4",4,"ngIf"],[1,"p-0","mt-4"],[1,"preset-buttons"],["class","mr-1 px-3","mat-button","",3,"click",4,"ngFor","ngForOf"],[1,"zap-form",3,"formGroup"],["appearance","outline",1,"sats-input"],["matInput","","formControlName","amount","placeholder","Enter amount in sats, e.g., 100","type","number","aria-label","Zap Amount"],["align","end"],[4,"ngIf"],["matInput","","formControlName","comment","placeholder","Optional comment, e.g., as a gift...","aria-label","Comment","maxlength","100"],["mat-raised-button","","color","primary",3,"click","disabled"],["mat-button","",1,"mr-1","px-3",3,"click"],[1,"text-orange-500","icon-size-5"],[1,"ml-2"],[1,"flex","flex-col","items-center","justify-center","text-center","p-1","mt-4"],["class","w-full flex flex-col items-center",4,"ngIf"],["class","w-full max-w-md",4,"ngIf"],[1,"w-full","flex","flex-col","items-center"],[1,"mb-2"],[1,"w-full","mb-4"],[1,"qrcode-image","m-auto",3,"qrdata","matTooltip","errorCorrectionLevel"],[1,"w-full","max-w-md"],["appearance","outline",1,"w-full"],["matInput","","readonly","","aria-label","Invoice Address",3,"value"],["mat-icon-button","","matSuffix","","aria-label","Copy Invoice",3,"click","matTooltip"],[3,"svgIcon"]],template:function(o,n){1&o&&(e.j41(0,"div",0)(1,"button",1),e.nrm(2,"mat-icon",2),e.k0s()(),e.j41(3,"h1"),e.EFF(4,"\u26a1Zap"),e.k0s(),e.DNE(5,ee,22,6,"mat-dialog-content",3)(6,oe,3,2,"mat-dialog-content",4)),2&o&&(e.R7$(),e.Y8G("matDialogClose",void 0),e.R7$(),e.Y8G("svgIcon","heroicons_outline:x-mark"),e.R7$(3),e.Y8G("ngIf",!n.showInvoiceSection||!n.lightningInvoice),e.R7$(),e.Y8G("ngIf",n.showInvoiceSection&&n.lightningInvoice))},dependencies:[G.vg,g.Hl,g.$z,g.iY,_.m_,_.An,c.YN,c.me,c.Q0,c.BC,c.cb,c.tU,f.nJ,f.rl,c.X1,c.j4,c.JD,d.MD,d.Sq,d.bT,z.Ve,f.MV,f.TL,f.yw,f.RG,b.fS,b.fg,h.Yi,h.E7,C.f,C.c,y.q,x.oV,h.tx],styles:[".preset-buttons[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;justify-items:center;margin-bottom:20px}.preset-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{font-size:14px;font-weight:700;display:flex;align-items:center;justify-content:center;max-height:60px!important}.sats-input[_ngcontent-%COMP%]{margin-top:20px;width:100%}.lightning-buttons[_ngcontent-%COMP%]{margin:5px 0}"]})}}return i})();var I=a(8418),re=a(7291),se=a(345),ae=a(5713),le=a(881),ce=a(9979),me=a(1772),pe=a(5645),ue=a(413);const de=["eventInput"],fe=["commentInput"],ge=()=>["hex","npub"],he=(i,s)=>({height:i,overflow:s}),ve=(i,s)=>({"white-space":i,"max-height":s,overflow:"hidden"}),T=i=>({"large-font":i});function _e(i,s){if(1&i&&(e.qex(0),e.nrm(1,"img",35),e.bVm()),2&i){const t=e.XpG();e.R7$(),e.FS9("alt",(null==t.profileUser?null:t.profileUser.display_name)||(null==t.profileUser?null:t.profileUser.name)||""),e.Y8G("src",t.getSafeUrl(null==t.profileUser?null:t.profileUser.picture),e.B4B)}}function be(i,s){if(1&i&&e.nrm(0,"img",36),2&i){const t=e.XpG();e.FS9("alt",(null==t.profileUser?null:t.profileUser.display_name)||(null==t.profileUser?null:t.profileUser.name)||"")}}function ke(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",38)(2,"span",39),e.EFF(3),e.k0s(),e.j41(4,"span",40),e.EFF(5,"FOLLOWERS"),e.k0s()(),e.j41(6,"div",38)(7,"span",41),e.EFF(8),e.k0s(),e.j41(9,"span",42),e.EFF(10," FOLLOWING "),e.k0s()(),e.bVm()),2&i){const t=s.ngIf;e.R7$(2),e.Y8G("matTooltip","Total contact: "+t.totalContacts),e.R7$(),e.SpI(" ",t.followersCount," "),e.R7$(5),e.JRh(t.followingCount),e.R7$(),e.Y8G("matTooltip","Total contact: "+t.totalContacts)}}function ye(i,s){if(1&i&&(e.j41(0,"div",37),e.DNE(1,ke,11,4,"ng-container",21),e.nI1(2,"async"),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ngIf",e.bMT(2,1,t.stats$))}}function xe(i,s){if(1&i&&(e.j41(0,"div",37)(1,"div",38)(2,"span",39),e.EFF(3),e.k0s(),e.j41(4,"span",40),e.EFF(5,"FOLLOWERS"),e.k0s()(),e.j41(6,"div",38)(7,"span",41),e.EFF(8),e.k0s(),e.j41(9,"span",42),e.EFF(10," FOLLOWING "),e.k0s()()()),2&i){const t=e.XpG();e.R7$(2),e.Y8G("matTooltip","Total contact: "+t.totalContacts),e.R7$(),e.SpI(" ",t.followersCount," "),e.R7$(5),e.JRh(t.followingCount),e.R7$(),e.Y8G("matTooltip","Total contact: "+t.totalContacts)}}function Fe(i,s){if(1&i){const t=e.RV6();e.j41(0,"div")(1,"button",43),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.toggleFollow())}),e.nrm(2,"mat-icon",44),e.k0s()()}if(2&i){const t=e.XpG();e.R7$(),e.Y8G("matTooltip",t.isFollowing?"Unfollow":"Follow"),e.R7$(),e.Y8G("svgIcon",t.isFollowing?"heroicons_outline:user-minus":"heroicons_outline:user-plus")}}function Ce(i,s){if(1&i){const t=e.RV6();e.j41(0,"button",45),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.openZapDialog())}),e.j41(1,"span",46),e.nrm(2,"mat-icon",47),e.j41(3,"span"),e.EFF(4),e.k0s()()()}if(2&i){const t=e.XpG();e.R7$(2),e.Y8G("svgIcon",t.isCurrentUserProfile?"heroicons_outline:qr-code":"feather:zap"),e.R7$(2),e.JRh(t.isCurrentUserProfile?"Receive Zap":"Send Zap")}}function je(i,s){if(1&i){const t=e.RV6();e.qex(0),e.j41(1,"button",45),e.bIt("click",function(){const n=e.eBV(t).$implicit,r=e.XpG();return e.Njj(r.copyKey(n))}),e.j41(2,"span",46),e.nrm(3,"mat-icon",47),e.j41(4,"span"),e.EFF(5),e.k0s()()(),e.bVm()}if(2&i){const t=s.$implicit;e.R7$(3),e.Y8G("svgIcon","heroicons_outline:clipboard-document"),e.R7$(2),e.SpI("Copy Public key (",t,")")}}function Re(i,s){1&i&&(e.j41(0,"button",48)(1,"span",46),e.nrm(2,"mat-icon",47),e.j41(3,"span"),e.EFF(4,"Edit your profile"),e.k0s()()()),2&i&&(e.Y8G("routerLink","/settings/profile"),e.R7$(2),e.Y8G("svgIcon","heroicons_outline:pencil-square"))}function Ie(i,s){1&i&&(e.qex(0),e.j41(1,"button",49)(2,"span",46),e.nrm(3,"mat-icon",47),e.j41(4,"span"),e.EFF(5,"Report"),e.k0s()()(),e.j41(6,"button",49)(7,"span",46),e.nrm(8,"mat-icon",47),e.j41(9,"span"),e.EFF(10,"Turn on notifications"),e.k0s()()(),e.bVm()),2&i&&(e.R7$(3),e.Y8G("svgIcon","heroicons_solid:exclamation-triangle"),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:bell"))}function Ee(i,s){1&i&&(e.j41(0,"span",56),e.EFF(1,"..."),e.k0s())}function $e(i,s){if(1&i){const t=e.RV6();e.j41(0,"angor-card",50)(1,"div",51)(2,"div",52),e.EFF(3,"About"),e.k0s(),e.j41(4,"button",53),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.toggleAbout())}),e.j41(5,"mat-icon"),e.EFF(6),e.k0s()()(),e.j41(7,"div",54),e.EFF(8),e.DNE(9,Ee,2,0,"span",55),e.k0s()()}if(2&i){const t=e.XpG();e.Y8G("ngStyle",e.l_i(5,he,t.aboutExpanded?"auto":"80px",t.aboutExpanded?"visible":"hidden")),e.R7$(6),e.JRh(t.aboutExpanded?"expand_less":"expand_more"),e.R7$(),e.Y8G("ngStyle",e.l_i(8,ve,t.aboutExpanded?"normal":"nowrap",t.aboutExpanded?"none":"1.5em")),e.R7$(),e.SpI(" ",(null==t.profileUser?null:t.profileUser.about)||""," "),e.R7$(),e.Y8G("ngIf",!t.aboutExpanded)}}function Ge(i,s){if(1&i){const t=e.RV6();e.j41(0,"div",75)(1,"emoji-mart",76),e.bIt("emojiClick",function(n){e.eBV(t);const r=e.XpG(2);return e.Njj(r.addEmoji(n))}),e.k0s()()}if(2&i){const t=e.XpG(2);e.R7$(),e.Y8G("darkMode",t.darkMode)}}function Pe(i,s){if(1&i){const t=e.RV6();e.j41(0,"angor-card",57)(1,"div",58)(2,"div",59),e.EFF(3,"Create Post"),e.k0s(),e.j41(4,"mat-slide-toggle",60),e.bIt("change",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.togglePreview())}),e.EFF(5," Preview "),e.k0s()(),e.j41(6,"div",61)(7,"div",62),e.nrm(8,"img",63),e.j41(9,"div",64),e.EFF(10),e.k0s()(),e.j41(11,"mat-form-field",65),e.nrm(12,"textarea",66,3),e.k0s()(),e.j41(14,"div",67)(15,"div",46)(16,"button",68),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.toggleEmojiPicker())}),e.nrm(17,"mat-icon",23),e.j41(18,"span",69),e.EFF(19,"Feeling"),e.k0s()(),e.DNE(20,Ge,2,1,"div",70),e.j41(21,"button",71),e.nrm(22,"mat-icon",23),e.j41(23,"span",69),e.EFF(24,"Media"),e.k0s()(),e.j41(25,"button",71),e.nrm(26,"mat-icon",23),e.j41(27,"span",69),e.EFF(28,"Tag"),e.k0s()(),e.j41(29,"button",72),e.nrm(30,"mat-icon",23),e.k0s(),e.j41(31,"mat-menu",null,4)(33,"button",73)(34,"span",46),e.nrm(35,"mat-icon",47),e.j41(36,"span"),e.EFF(37,"Tag"),e.k0s()()(),e.j41(38,"button",73)(39,"span",46),e.nrm(40,"mat-icon",47),e.j41(41,"span"),e.EFF(42,"Feeling"),e.k0s()()(),e.j41(43,"button",49)(44,"span",46),e.nrm(45,"mat-icon",47),e.j41(46,"span"),e.EFF(47,"Live"),e.k0s()()(),e.j41(48,"button",49)(49,"span",46),e.nrm(50,"mat-icon",47),e.j41(51,"span"),e.EFF(52,"Gif"),e.k0s()()(),e.j41(53,"button",49)(54,"span",46),e.nrm(55,"mat-icon",47),e.j41(56,"span"),e.EFF(57,"Check in"),e.k0s()()()()(),e.j41(58,"button",74),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.sendEvent())}),e.nrm(59,"mat-icon",23),e.j41(60,"span",69),e.EFF(61,"Send"),e.k0s()()()()}if(2&i){const t=e.sdS(32),o=e.XpG();e.R7$(4),e.Y8G("color","primary"),e.R7$(4),e.FS9("alt",(null==o.profileUser?null:o.profileUser.display_name)||(null==o.profileUser?null:o.profileUser.name)||""),e.Y8G("src",null==o.profileUser?null:o.profileUser.picture,e.B4B),e.R7$(2),e.SpI(" ",(null==o.profileUser?null:o.profileUser.display_name)||(null==o.profileUser?null:o.profileUser.name)||""," "),e.R7$(),e.Y8G("subscriptSizing","dynamic"),e.R7$(),e.Y8G("placeholder","What's on your mind?")("rows",3),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:face-smile"),e.R7$(3),e.Y8G("ngIf",o.showEmojiPicker),e.R7$(2),e.Y8G("svgIcon","heroicons_solid:photo"),e.R7$(4),e.Y8G("svgIcon","heroicons_solid:user-circle"),e.R7$(3),e.Y8G("matMenuTriggerFor",t),e.R7$(),e.Y8G("svgIcon","heroicons_solid:ellipsis-horizontal"),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:user-circle"),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:face-smile"),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:play"),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:sparkles"),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:map-pin"),e.R7$(4),e.Y8G("svgIcon","heroicons_solid:paper-airplane")}}function we(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",99),e.nrm(2,"iframe",100),e.k0s(),e.bVm()),2&i){const t=e.XpG().$implicit;e.R7$(2),e.Y8G("src",t.safeWord,e.f$h)}}function Ue(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",99),e.nrm(2,"img",101),e.k0s(),e.bVm()),2&i){const t=e.XpG().$implicit;e.R7$(2),e.Y8G("src",t.safeWord,e.B4B)}}function Te(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",99)(2,"video",102),e.nrm(3,"source",103),e.EFF(4," Your browser does not support the video tag. "),e.k0s()(),e.bVm()),2&i){const t=e.XpG().$implicit;e.R7$(3),e.Y8G("src",t.safeWord,e.B4B)}}function Se(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",99)(2,"audio",104),e.nrm(3,"source",105),e.EFF(4," Your browser does not support the audio element. "),e.k0s()(),e.bVm()),2&i){const t=e.XpG().$implicit;e.R7$(3),e.Y8G("src",t.safeWord,e.B4B)}}function Ye(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",106)(2,"a",107)(3,"span",108),e.EFF(4),e.k0s()()(),e.bVm()),2&i){const t=e.XpG().$implicit;e.R7$(2),e.Y8G("href",t.word,e.B4B),e.R7$(2),e.JRh(t.word)}}function De(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",106)(2,"span",109),e.EFF(3),e.k0s()(),e.bVm()),2&i){const t=e.XpG().$implicit,o=e.XpG(2);e.R7$(2),e.Y8G("ngClass",e.eq3(2,T,o.isSingleEmojiOrWord(t))),e.R7$(),e.SpI(" ",t.trim()," ")}}function Be(i,s){if(1&i&&(e.j41(0,"div",98),e.DNE(1,we,3,1,"ng-container",21)(2,Ue,3,1,"ng-container",21)(3,Te,5,1,"ng-container",21)(4,Se,5,1,"ng-container",21)(5,Ye,5,2,"ng-container",21)(6,De,4,4,"ng-container",21),e.k0s()),2&i){const t=s.$implicit;e.R7$(),e.Y8G("ngIf","youtube"===t.token),e.R7$(),e.Y8G("ngIf","image"===t.token),e.R7$(),e.Y8G("ngIf","video"===t.token),e.R7$(),e.Y8G("ngIf","audio"===t.token),e.R7$(),e.Y8G("ngIf","link"===t.token),e.R7$(),e.Y8G("ngIf",!t.token)}}function Me(i,s){if(1&i&&(e.j41(0,"angor-card",77,5)(2,"div",78),e.nrm(3,"img",79),e.j41(4,"div",80)(5,"span",81),e.EFF(6),e.k0s(),e.j41(7,"span",82),e.EFF(8,"1 minutes ago"),e.k0s()()(),e.DNE(9,Be,7,6,"div",83),e.j41(10,"div",84)(11,"button",85),e.nrm(12,"mat-icon",86),e.j41(13,"span",69),e.EFF(14,"Unlike"),e.k0s()(),e.j41(15,"button",85),e.nrm(16,"mat-icon",87),e.j41(17,"span",69),e.EFF(18,"Comment"),e.k0s()(),e.j41(19,"button",85),e.nrm(20,"mat-icon",88),e.j41(21,"span",69),e.EFF(22,"Share"),e.k0s()(),e.j41(23,"button",85),e.nrm(24,"mat-icon",89),e.j41(25,"span",69),e.EFF(26,"Zap"),e.k0s()()(),e.nrm(27,"hr",90),e.j41(28,"div",91)(29,"div",46)(30,"div",92),e.EFF(31," 0 Zap "),e.k0s()(),e.nrm(32,"div",93),e.j41(33,"div",94)(34,"button",95),e.EFF(35," 0 Like "),e.k0s(),e.j41(36,"button",95),e.EFF(37," 0 shares "),e.k0s(),e.j41(38,"button",96)(39,"span",97),e.EFF(40,"0 Comments"),e.k0s()()()()()),2&i){const t=e.XpG();e.R7$(3),e.FS9("alt",(null==t.profileUser?null:t.profileUser.display_name)||(null==t.profileUser?null:t.profileUser.name)||""),e.Y8G("src",t.getSafeUrl(null==t.profileUser?null:t.profileUser.picture),e.B4B),e.R7$(3),e.JRh((null==t.profileUser?null:t.profileUser.display_name)||(null==t.profileUser?null:t.profileUser.name)||""),e.R7$(3),e.Y8G("ngForOf",t.parseContent.parseContent(t.eventInput.nativeElement.value))("ngForTrackBy",t.trackByFn),e.R7$(3),e.Y8G("svgIcon","heroicons_solid:heart"),e.R7$(4),e.Y8G("svgIcon","heroicons_solid:chat-bubble-left-ellipsis"),e.R7$(4),e.Y8G("svgIcon","heroicons_solid:share"),e.R7$(4),e.Y8G("svgIcon","heroicons_solid:bolt")}}function Xe(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",99),e.nrm(2,"iframe",100),e.k0s(),e.bVm()),2&i){const t=e.XpG().$implicit;e.R7$(2),e.Y8G("src",t.safeWord,e.f$h)}}function Ae(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",99),e.nrm(2,"img",101),e.k0s(),e.bVm()),2&i){const t=e.XpG().$implicit;e.R7$(2),e.Y8G("src",t.safeWord,e.B4B)}}function Ne(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",99)(2,"video",102),e.nrm(3,"source",103),e.EFF(4," Your browser does not support the video tag. "),e.k0s()(),e.bVm()),2&i){const t=e.XpG().$implicit;e.R7$(3),e.Y8G("src",t.safeWord,e.B4B)}}function Ve(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",99)(2,"audio",104),e.nrm(3,"source",105),e.EFF(4," Your browser does not support the audio element. "),e.k0s()(),e.bVm()),2&i){const t=e.XpG().$implicit;e.R7$(3),e.Y8G("src",t.safeWord,e.B4B)}}function Le(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",106)(2,"a",107)(3,"span",108),e.EFF(4),e.k0s()()(),e.bVm()),2&i){const t=e.XpG().$implicit;e.R7$(2),e.Y8G("href",t.word,e.B4B),e.R7$(2),e.JRh(t.word)}}function Ze(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",106)(2,"span",109),e.EFF(3),e.k0s()(),e.bVm()),2&i){const t=e.XpG().$implicit,o=e.XpG(2);e.R7$(2),e.Y8G("ngClass",e.eq3(2,T,o.isSingleEmojiOrWord(t))),e.R7$(),e.SpI(" ",t.trim()," ")}}function Oe(i,s){if(1&i&&(e.j41(0,"div",98),e.DNE(1,Xe,3,1,"ng-container",21)(2,Ae,3,1,"ng-container",21)(3,Ne,5,1,"ng-container",21)(4,Ve,5,1,"ng-container",21)(5,Le,5,2,"ng-container",21)(6,Ze,4,4,"ng-container",21),e.k0s()),2&i){const t=s.$implicit;e.R7$(),e.Y8G("ngIf","youtube"===t.token),e.R7$(),e.Y8G("ngIf","image"===t.token),e.R7$(),e.Y8G("ngIf","video"===t.token),e.R7$(),e.Y8G("ngIf","audio"===t.token),e.R7$(),e.Y8G("ngIf","link"===t.token),e.R7$(),e.Y8G("ngIf",!t.token)}}function We(i,s){if(1&i){const t=e.RV6();e.j41(0,"angor-card",33,6)(2,"div",78),e.nrm(3,"img",79),e.j41(4,"div",80)(5,"span",81),e.EFF(6),e.k0s(),e.j41(7,"span",82),e.EFF(8),e.nI1(9,"ago"),e.k0s()(),e.j41(10,"button",110),e.nrm(11,"mat-icon",23),e.k0s(),e.j41(12,"mat-menu",null,7)(14,"button",49)(15,"span",46),e.nrm(16,"mat-icon",47),e.j41(17,"span"),e.EFF(18,"Save post"),e.k0s()()(),e.j41(19,"button",49)(20,"span",46),e.nrm(21,"mat-icon",47),e.j41(22,"span"),e.EFF(23,"Hide post"),e.k0s()()(),e.j41(24,"button",49)(25,"span",46),e.nrm(26,"mat-icon",47),e.j41(27,"span"),e.EFF(28,"Snooze for 30 days"),e.k0s()()(),e.j41(29,"button",49)(30,"span",46),e.nrm(31,"mat-icon",47),e.j41(32,"span"),e.EFF(33,"Hide all"),e.k0s()()(),e.nrm(34,"mat-divider",26),e.j41(35,"button",49)(36,"span",46),e.nrm(37,"mat-icon",47),e.j41(38,"span"),e.EFF(39,"Report post"),e.k0s()()(),e.j41(40,"button",49)(41,"span",46),e.nrm(42,"mat-icon",47),e.j41(43,"span"),e.EFF(44,"Turn on notifications for this post"),e.k0s()()()()(),e.DNE(45,Oe,7,6,"div",83),e.j41(46,"div",84)(47,"button",85),e.nrm(48,"mat-icon",86),e.j41(49,"span",69),e.EFF(50,"Unlike"),e.k0s()(),e.j41(51,"button",85),e.nrm(52,"mat-icon",87),e.j41(53,"span",69),e.EFF(54,"Comment"),e.k0s()(),e.j41(55,"button",85),e.nrm(56,"mat-icon",88),e.j41(57,"span",69),e.EFF(58,"Share"),e.k0s()(),e.j41(59,"button",68),e.bIt("click",function(){const n=e.eBV(t).$implicit,r=e.XpG();return e.Njj(r.openZapDialog(n.id))}),e.nrm(60,"mat-icon",89),e.j41(61,"span",69),e.EFF(62,"Zap"),e.k0s()()(),e.nrm(63,"hr",90),e.j41(64,"div",91),e.nrm(65,"div",93),e.j41(66,"div",94)(67,"button",111),e.bIt("click",function(){const n=e.eBV(t).$implicit,r=e.XpG();return e.Njj(r.openPost(n.id))}),e.j41(68,"span",97),e.EFF(69,"Read More ..."),e.k0s()()()()()}if(2&i){const t=s.$implicit,o=e.sdS(13),n=e.XpG();e.R7$(3),e.FS9("alt",(null==n.profileUser?null:n.profileUser.display_name)||(null==n.profileUser?null:n.profileUser.name)||""),e.Y8G("src",n.getSafeUrl(null==n.profileUser?null:n.profileUser.picture),e.B4B),e.R7$(3),e.JRh((null==n.profileUser?null:n.profileUser.display_name)||(null==n.profileUser?null:n.profileUser.name)||""),e.R7$(2),e.JRh(e.bMT(9,18,t.created_at)),e.R7$(2),e.Y8G("matMenuTriggerFor",o),e.R7$(),e.Y8G("svgIcon","heroicons_solid:ellipsis-vertical"),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:arrow-up-tray"),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:eye-slash"),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:clock"),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:minus-circle"),e.R7$(6),e.Y8G("svgIcon","heroicons_solid:exclamation-triangle"),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:bell"),e.R7$(3),e.Y8G("ngForOf",n.parseContent.parseContent(t.content))("ngForTrackBy",n.trackByFn),e.R7$(3),e.Y8G("svgIcon","heroicons_solid:heart"),e.R7$(4),e.Y8G("svgIcon","heroicons_solid:chat-bubble-left-ellipsis"),e.R7$(4),e.Y8G("svgIcon","heroicons_solid:share"),e.R7$(4),e.Y8G("svgIcon","heroicons_solid:bolt")}}function ze(i,s){if(1&i){const t=e.RV6();e.j41(0,"div",112)(1,"button",113),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.loadNextPage())}),e.EFF(2),e.k0s()()}if(2&i){const t=e.XpG();e.R7$(),e.Y8G("disabled",t.loading),e.R7$(),e.SpI(" ",t.loading?"Loading...":"Load More Posts"," ")}}const Ke=[{path:"",component:(()=>{class i{constructor(t,o,n,r,l,p,u,v,qe,Qe,Je,He,et,tt,nt){this._changeDetectorRef=t,this._signerService=o,this._storageService=n,this._sanitizer=r,this._route=l,this._router=p,this._socialService=u,this._snackBar=v,this._dialog=qe,this._angorConfigService=Qe,this._angorConfirmationService=Je,this._eventService=He,this._subscriptionService=et,this._clipboard=tt,this.parseContent=nt,this.darkMode=!1,this.isLoading=!0,this.errorMessage=null,this._unsubscribeAll=new X.B,this.allPublicKeys=[],this.isCurrentUserProfile=!1,this.isFollowing=!1,this.showEmojiPicker=!1,this.showCommentEmojiPicker=!1,this.lightningResponse=null,this.lightningInvoice=null,this.paymentInvoice="",this.invoiceAmount="?",this.isLiked=!1,this.isPreview=!1,this.posts=[],this.currentPage=1,this.loading=!1,this.myLikes=[],this.myLikedNoteIds=[],this.isLoadingPosts=!0,this.noEventsMessage="",this.hasMorePosts=!0,this.followersList=[],this.followingList=[],this.aboutExpanded=!0,this.totalContacts=0,this.followersCount=0,this.followingCount=0}ngOnInit(){var t=this;return(0,m.A)(function*(){t.initializeTheme(),t.processRouteParams(),t.loadInitialPosts(),t.subscribeToNewPosts()})()}initializeTheme(){this._angorConfigService.config$.subscribe(t=>{"auto"===t.scheme?this.detectSystemTheme():this.darkMode="dark"===t.scheme})}processRouteParams(){this._route.paramMap.subscribe(t=>{const o=t.get("pubkey")||"";o?this.isValidHexPubkey(o)?(this.routePubKey=o,this.isCurrentUserProfile=!1):(this.errorMessage="Public key is invalid. Please check your input.",this.setCurrentUserProfile()):this.setCurrentUserProfile(),this.loadUserProfileData(this.routePubKey)})}setCurrentUserProfile(){this.isCurrentUserProfile=!0,this.routePubKey=this._signerService.getPublicKey()}loadUserProfileData(t){this.loadUserProfile(t),this.stats$=this._storageService.getContactStats$(t)}isValidHexPubkey(t){return/^[a-fA-F0-9]{64}$/.test(t)}loadInitialPosts(){var t=this;return(0,m.A)(function*(){t.loading=!0;let o=0;try{for(;o<5;){const l=yield t._storageService.getPostsByPubKeysWithPagination([t.routePubKey],t.currentPage,10);if(l.length>0){t.posts=[...t.posts,...l],t.posts.sort((p,u)=>u.created_at-p.created_at);break}o++,o<5&&(yield t.delay(3e3))}t.hasMorePosts=t.posts.length>0,t.hasMorePosts||console.log("This user has no posts.")}catch(l){console.error("Error loading posts:",l)}finally{t.loading=!1}t._changeDetectorRef.detectChanges()})()}delay(t){return new Promise(o=>setTimeout(o,t))}subscribeToNewPosts(){var t=this;this.isCurrentUserProfile?this._storageService.posts$.subscribe(o=>{o&&o.pubkey===this.routePubKey&&(this.posts.unshift(o),this.posts.sort((n,r)=>r.created_at-n.created_at),this._changeDetectorRef.detectChanges())}):this.postsSubscriptionId=this._subscriptionService.addSubscriptions([{authors:[this.routePubKey],kinds:[1]}],function(){var n=(0,m.A)(function*(r){t.isReply(r)||t._storageService.savePost(r)});return function(r){return n.apply(this,arguments)}}())}isReply(t){return t.tags.filter(n=>"e"===n[0]||"p"===n[0]).length>0}loadNextPage(){this.loading||(this.currentPage++,this.loadInitialPosts())}toggleAbout(){this.aboutExpanded=!this.aboutExpanded}ngOnDestroy(){this.subscriptionId&&this._subscriptionService.removeSubscriptionById(this.subscriptionId),this.postsSubscriptionId&&this._subscriptionService.removeSubscriptionById(this.postsSubscriptionId),this._unsubscribeAll.next(null),this._unsubscribeAll.complete()}loadUserProfile(t){var o=this;return(0,m.A)(function*(){if(o.isLoading=!0,o.errorMessage=null,o.profileUser=null,o._changeDetectorRef.detectChanges(),!t)return o.errorMessage="No public key found. Please log in again.",o.isLoading=!1,void o._changeDetectorRef.detectChanges();try{const n=yield o._storageService.getProfile(t);n&&(o.profileUser=n,o._changeDetectorRef.detectChanges()),o.subscribeToUserProfileAndContacts(t)}catch(n){console.error("Error loading user profile:",n)}})()}subscribeToUserProfileAndContacts(t){var o=this;return(0,m.A)(function*(){o.subscriptionId=o._subscriptionService.addSubscriptions([{authors:[t],kinds:[0],limit:1},{kinds:[I.In],authors:[t]},{kinds:[I.In],"#p":[t]}],function(){var r=(0,m.A)(function*(l){switch(l.kind){case 0:yield o.processProfileMetadata(l,t);break;case I.In:o.processContactData(l,t)}});return function(l){return r.apply(this,arguments)}}())})()}processProfileMetadata(t,o){var n=this;return(0,m.A)(function*(){try{const r=JSON.parse(t.content);n.profileUser=r,yield n._storageService.saveProfile(o,r),n._changeDetectorRef.markForCheck()}catch(r){console.error("Error processing metadata event:",r)}})()}processContactData(t,o){const n=t.pubkey===o,r={id:t.id,pubkey:t.pubkey,created_at:t.created_at,tags:t.tags,isFollower:n};n?(this.followersList.push(r),this.followersCount++,this.totalContacts++,this._changeDetectorRef.detectChanges()):(this.followingList.push(r),this.followingCount++,this.totalContacts++,this._changeDetectorRef.detectChanges())}getSafeUrl(t){return this._sanitizer.bypassSecurityTrustUrl(t)}toggleFollow(){var t=this;return(0,m.A)(function*(){try{const o=t._signerService.getPublicKey(),n=t.routePubKey||t.currentUserPubKey;if(!n||!o)return void console.error("Public key missing. Unable to toggle follow.");t.isFollowing?yield t._socialService.unfollow(n):yield t._socialService.follow(n),t.isFollowing=!t.isFollowing,t._changeDetectorRef.detectChanges()}catch(o){console.error("Failed to toggle follow:",o)}})()}openSnackBar(t,o="dismiss"){this._snackBar.open(t,o,{duration:1300})}canUseZap(){var t=this;return(0,m.A)(function*(){return!(!t.profileUser||!t.profileUser.lud06&&!t.profileUser.lud16)||(t.openSnackBar("User can't receive zaps"),!1)})()}openZapDialog(t=""){this.canUseZap()&&this._dialog.open(ie,{width:"405px",maxHeight:"90vh",data:{lud16:this.profileUser.lud16,lud06:this.profileUser.lud06,pubkey:this.profileUser.pubkey,eventId:t}})}toggleLike(){this.isLiked=!this.isLiked,this.isLiked&&setTimeout(()=>{this.isLiked=!1,this.isLiked=!0},300)}addEmoji(t){this.eventInput.nativeElement.value+=t.emoji.native,this.showEmojiPicker=!1}toggleEmojiPicker(){this.showCommentEmojiPicker=!1,this.showEmojiPicker=!this.showEmojiPicker}addEmojiTocomment(t){this.commentInput.nativeElement.value+=t.emoji.native,this.showCommentEmojiPicker=!1}detectSystemTheme(){const t=window.matchMedia("(prefers-color-scheme: dark)");this.darkMode=t.matches,t.addEventListener("change",o=>{this.darkMode=o.matches})}togglePreview(){this.isPreview=!this.isPreview}sendEvent(){""!=this.eventInput.nativeElement.value&&this._eventService.sendTextEvent(this.eventInput.nativeElement.value).then(()=>{this._changeDetectorRef.markForCheck()}).catch(t=>{console.error("Failed to send Event:",t)})}copyHex(){this._clipboard.copy(this.routePubKey),this.openSnackBar("hex public key copied","dismiss")}copyNpub(){var t=this._signerService.getNpubFromPubkey(this.routePubKey);this._clipboard.copy(t),this.openSnackBar("npub public key copied","dismiss")}isSingleEmojiOrWord(t){const o=t.trim(),n=/^\w+$/.test(o),r=/^[\p{Emoji}]+$/u.test(o);return n||r}openPost(t){this._router.navigate(["/post",t])}static{this.\u0275fac=function(o){return new(o||i)(e.rXU(e.gRc),e.rXU(U.A),e.rXU(re.n),e.rXU(se.up),e.rXU(F.nX),e.rXU(F.Ix),e.rXU(ae.l),e.rXU(P.UG),e.rXU(h.bZ),e.rXU(le.P),e.rXU(ce.m),e.rXU(me.x),e.rXU(pe.n),e.rXU(w),e.rXU(ue.m))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["profile"]],viewQuery:function(o,n){if(1&o&&(e.GBs(de,5),e.GBs(fe,5)),2&o){let r;e.mGM(r=e.lsd())&&(n.eventInput=r.first),e.mGM(r=e.lsd())&&(n.commentInput=r.first)}},standalone:!0,features:[e.aNF],decls:40,vars:20,consts:[["defaultAvatar",""],["otherUserStats",""],["profileMenu","matMenu"],["eventInput",""],["postCardMenu01","matMenu"],["expandableComments","angorCard"],["expandableCard02","angorCard"],["postCardMenu02","matMenu"],[1,"flex","min-w-0","flex-auto","flex-col"],[1,"bg-card","flex","flex-col","shadow"],["onerror","this.onerror=null; this.src='/images/pages/profile/cover.jpg';",1,"h-40","object-cover","lg:h-80",3,"src","alt"],[1,"bg-card","mx-auto","flex","w-full","max-w-5xl","flex-0","flex-col","items-center","px-8","lg:h-18","lg:flex-row"],[1,"-mt-26","flex-shrink-0","rounded-full","lg:-mt-22"],[4,"ngIf","ngIfElse"],[1,"mt-4","flex","flex-grow","flex-col","items-center","lg:ml-8","lg:mt-0","lg:items-start"],[1,"max-w-full","truncate","text-lg","font-bold","leading-tight","lg:max-w-[25rem]",2,"white-space","nowrap","overflow","hidden","text-overflow","ellipsis"],[1,"text-secondary","max-w-full","truncate","leading-tight","lg:max-w-[25rem]",2,"white-space","nowrap","overflow","hidden","text-overflow","ellipsis"],[1,"mx-8","hidden","h-8","flex-shrink-0","border-l-2","lg:flex"],[1,"flex","flex-shrink-0","items-center","space-x-6","lg:mt-0"],["class","mt-6 flex flex-shrink-0 items-center space-x-6 lg:mt-0",4,"ngIf","ngIfElse"],[1,"mb-4","mt-8","flex","flex-shrink-0","items-center","space-x-6","lg:m-0","lg:ml-auto"],[4,"ngIf"],["mat-icon-button","",3,"matMenuTriggerFor"],[1,"icon-size-5",3,"svgIcon"],["mat-menu-item","",3,"click",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"my-2"],["mat-menu-item","",3,"routerLink",4,"ngIf"],[1,"mx-auto","w-full","max-w-5xl","p-6","sm:p-8"],[1,"flex","w-full","max-w-140","m-auto","flex-col","items-start"],["class","about-section mb-8 flex flex-col items-start p-6 transition-all duration-300 w-full pb-6 sm:p-8","style","position: relative",3,"ngStyle",4,"ngIf"],["class","mb-8 flex w-full flex-col p-6 pb-6 sm:p-8",4,"ngIf"],["class","mb-8 flex w-full flex-col bg-primary-50 dark:bg-primary-800",4,"ngIf"],[1,"mb-8","flex","w-full","flex-col"],["class","mt-4 m-auto flex justify-center",4,"ngIf"],["onerror","this.onerror=null; this.src='/images/avatars/avatar-placeholder.png';",1,"ring-bg-card","h-32","min-h-32","w-32","min-w-32","max-w-fit","rounded-full","object-cover","ring-4",3,"src","alt"],["src","/images/avatars/avatar-placeholder.png","onerror","this.onerror=null; this.src='/images/avatars/avatar-placeholder.png';",1,"ring-bg-card","h-32","min-h-32","w-32","min-w-32","rounded-full","object-cover","ring-4",3,"alt"],[1,"mt-6","flex","flex-shrink-0","items-center","space-x-6","lg:mt-0"],[1,"flex","flex-col","items-center"],[1,"font-bold",3,"matTooltip"],[1,"text-secondary","text-sm","font-medium"],[1,"font-bold"],[1,"text-secondary","text-sm","font-medium",3,"matTooltip"],["mat-icon-button","",3,"click","matTooltip"],[3,"svgIcon"],["mat-menu-item","",3,"click"],[1,"flex","items-center"],[1,"mr-3","icon-size-5",3,"svgIcon"],["mat-menu-item","",3,"routerLink"],["mat-menu-item",""],[1,"about-section","mb-8","flex","flex-col","items-start","p-6","transition-all","duration-300","w-full","pb-6","sm:p-8",2,"position","relative",3,"ngStyle"],[1,"mb-2","flex","w-full","items-center","justify-between"],[1,"text-2xl","font-semibold","leading-tight"],["mat-icon-button","","color","primary","aria-label","Toggle about section",2,"position","absolute","top","16px","right","16px",3,"click"],[1,"about-content","text-base","text-gray-700","transition-all","duration-300",3,"ngStyle"],["class","text-gray-500",4,"ngIf"],[1,"text-gray-500"],[1,"mb-8","flex","w-full","flex-col","p-6","pb-6","sm:p-8"],[1,"flex","justify-between"],[1,"text-xl","font-semibold"],[1,"-mr-4","ml-auto",3,"change","color"],[1,"mt-8","flex","flex-col","items-start","sm:flex-row"],[1,"mb-6","flex","items-center","sm:mb-0"],["onerror","this.onerror=null; this.src='/images/avatars/avatar-placeholder.png';",1,"mr-4","h-12","w-12","min-w-12","rounded-full","object-cover",3,"src","alt"],[1,"sm:hidden"],[1,"w-full",3,"subscriptSizing"],["matInput","","cdkTextareaAutosize","",3,"placeholder","rows"],[1,"-mx-3","mt-6","flex","items-center","justify-between","sm:mt-8"],["mat-button","",1,"mr-1","px-3",3,"click"],[1,"ml-2"],["class","emoji-picker-container-global",4,"ngIf"],["mat-button","",1,"mr-1","hidden","px-3","sm:inline-flex"],["mat-button","",1,"px-3",3,"matMenuTriggerFor"],["mat-menu-item","",1,"sm:hidden"],["mat-button","",1,"mr-1","flex","px-3",3,"click"],[1,"emoji-picker-container-global"],[3,"emojiClick","darkMode"],[1,"mb-8","flex","w-full","flex-col","bg-primary-50","dark:bg-primary-800"],[1,"mx-6","mb-4","mt-6","flex","items-center","sm:mx-8"],["onerror","this.onerror=null; this.src='/images/avatars/avatar-placeholder.png';",1,"mr-4","h-10","w-10","rounded-full","object-cover",3,"src","alt"],[1,"flex","flex-col"],[1,"font-semibold","leading-none"],[1,"text-secondary","mt-1","text-sm","leading-none"],["class","inline-block break-words whitespace-pre-wrap",4,"ngFor","ngForOf","ngForTrackBy"],[1,"mx-3","flex","items-center","sm:mx-5"],["mat-button","",1,"mr-1","px-3"],[1,"text-red-500","icon-size-5",3,"svgIcon"],[1,"text-blue-500","icon-size-5",3,"svgIcon"],[1,"text-green-500","icon-size-5",3,"svgIcon"],[1,"text-orange-500","icon-size-5",3,"svgIcon"],[1,"mx-6","mb-6","mt-4","border-b","sm:mx-8"],[1,"mx-6","mb-4","flex","flex-col","sm:mx-8","sm:mb-6","sm:flex-row","sm:items-center"],[1,"ml-3","text-md","tracking-tight"],[1,"hidden","flex-auto","sm:flex"],[1,"mt-4","flex","items-center","sm:mt-0"],["mat-button","",1,"-ml-2","mr-1","px-3","sm:ml-0"],["mat-button","",1,"px-3","sm:-mr-4"],[1,"mr-1"],[1,"inline-block","break-words","whitespace-pre-wrap"],[1,"relative","mb-4","block"],["width","560","height","315","frameborder","0","allowfullscreen","",3,"src"],["alt","Embedded Image",1,"max-h-140","object-cover",2,"width","100%",3,"src"],["controls","",2,"width","100%"],["type","video/mp4",3,"src"],["controls",""],["type","audio/mpeg",3,"src"],[1,"mx-6","mb-6","mt-2","sm:mx-8"],["target","_blank",1,"inline-block","break-words","break-all","text-blue-500","underline",3,"href"],[1,"inline-block","break-words","break-all"],[1,"inline-block","break-words","break-all",3,"ngClass"],["mat-icon-button","",1,"-mr-4","ml-auto",3,"matMenuTriggerFor"],["mat-button","",1,"px-3","sm:-mr-4",3,"click"],[1,"mt-4","m-auto","flex","justify-center"],["mat-raised-button","","color","primary",3,"click","disabled"]],template:function(o,n){if(1&o&&(e.j41(0,"div",8)(1,"div",9)(2,"div"),e.nrm(3,"img",10),e.k0s(),e.j41(4,"div",11)(5,"div",12),e.DNE(6,_e,2,2,"ng-container",13)(7,be,1,1,"ng-template",null,0,e.C5r),e.k0s(),e.j41(9,"div",14)(10,"div",15),e.EFF(11),e.k0s(),e.j41(12,"div",16),e.EFF(13),e.k0s()(),e.nrm(14,"div",17),e.j41(15,"div",18),e.DNE(16,ye,3,3,"div",19)(17,xe,11,4,"ng-template",null,1,e.C5r),e.nrm(19,"div",17),e.j41(20,"div",20),e.DNE(21,Fe,3,2,"div",21),e.j41(22,"div")(23,"button",22),e.nrm(24,"mat-icon",23),e.k0s(),e.j41(25,"mat-menu",null,2),e.DNE(27,Ce,5,2,"button",24)(28,je,6,2,"ng-container",25),e.nrm(29,"mat-divider",26),e.DNE(30,Re,5,2,"button",27)(31,Ie,11,2,"ng-container",21),e.k0s()()()()()(),e.j41(32,"div",28)(33,"div",29),e.DNE(34,$e,10,11,"angor-card",30)(35,Pe,62,19,"angor-card",31)(36,Me,41,9,"angor-card",32),e.Z7z(37,We,70,20,"angor-card",33,e.Vm6),e.DNE(39,ze,3,2,"div",34),e.k0s()()()),2&o){const r=e.sdS(8),l=e.sdS(18),p=e.sdS(26);e.R7$(3),e.FS9("alt",(null==n.profileUser?null:n.profileUser.display_name)||(null==n.profileUser?null:n.profileUser.name)||"Banner"),e.Y8G("src",(null==n.profileUser?null:n.profileUser.banner)||"/images/pages/profile/cover.jpg",e.B4B),e.R7$(3),e.Y8G("ngIf",null==n.profileUser?null:n.profileUser.picture)("ngIfElse",r),e.R7$(5),e.SpI(" ",(null==n.profileUser?null:n.profileUser.display_name)||(null==n.profileUser?null:n.profileUser.name)||"Unknown User"," "),e.R7$(2),e.SpI(" ",(null==n.profileUser?null:n.profileUser.username)||(null==n.profileUser?null:n.profileUser.name)," "),e.R7$(3),e.Y8G("ngIf",n.isCurrentUserProfile)("ngIfElse",l),e.R7$(5),e.Y8G("ngIf",!n.isCurrentUserProfile),e.R7$(2),e.Y8G("matMenuTriggerFor",p),e.R7$(),e.Y8G("svgIcon","heroicons_solid:ellipsis-vertical"),e.R7$(3),e.Y8G("ngIf",!n.isCurrentUserProfile||n.isCurrentUserProfile),e.R7$(),e.Y8G("ngForOf",e.lJ4(19,ge)),e.R7$(2),e.Y8G("ngIf",n.isCurrentUserProfile),e.R7$(),e.Y8G("ngIf",!n.isCurrentUserProfile),e.R7$(3),e.Y8G("ngIf",(null==n.profileUser?null:n.profileUser.about)&&""!==n.profileUser.about.trim()),e.R7$(),e.Y8G("ngIf",n.isCurrentUserProfile),e.R7$(),e.Y8G("ngIf",n.isPreview),e.R7$(),e.Dyx(n.posts),e.R7$(2),e.Y8G("ngIf",n.hasMorePosts)}},dependencies:[F.Wk,S.n,_.m_,_.An,g.Hl,g.$z,g.iY,k.Cn,k.kk,k.fb,k.Cp,f.RG,f.rl,b.fS,b.fg,$.xb,$.EE,y.w,y.q,x.uc,x.oV,d.YU,d.MD,d.Sq,d.bT,d.B3,d.Jj,c.YN,C.f,B.Ic,D.sG,Y.D6,M.e,A.MY,G.vg,N.g],styles:[".emoji-picker-container-global{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:9999;width:350px;max-width:100%}.heart-beat{animation:heartBeatAnimation .3s ease-in-out}@keyframes heartBeatAnimation{0%{transform:scale(1)}30%{transform:scale(2)}60%{transform:scale(1)}to{transform:scale(1)}}.loading-spinner{display:flex;justify-content:center;align-items:center;margin:20px 0}.loading-spinner .spinner{border:4px solid rgba(0,0,0,.1);border-left-color:#009fb5;border-radius:50%;width:30px;height:30px;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.about-section{overflow:hidden;transition:height .3s ease}.c-img,.c-video{max-width:100%;border-radius:10px}\n"],encapsulation:2,changeDetection:0})}}return i})()}]}}]); \ No newline at end of file +"use strict";(self.webpackChunkangor=self.webpackChunkangor||[]).push([[873],{9873:(ot,E,a)=>{a.r(E),a.d(E,{default:()=>Ke});var c=a(467),S=a(9345),$=a(7403),d=a(177),m=a(9417),g=a(8834),y=a(1997),f=a(2102),_=a(9213),b=a(9042),k=a(9115),Y=a(9183),D=a(450),x=a(4823),F=a(5245),B=a(8865),C=a(5398),M=a(7540),X=a(1413),A=a(9454),G=a(882),N=a(8703),e=a(4438),h=a(5351),P=a(5416);class V{constructor(s,t){this._document=t;const n=this._textarea=this._document.createElement("textarea"),o=n.style;o.position="fixed",o.top=o.opacity="0",o.left="-999em",n.setAttribute("aria-hidden","true"),n.value=s,n.readOnly=!0,(this._document.fullscreenElement||this._document.body).appendChild(n)}copy(){const s=this._textarea;let t=!1;try{if(s){const n=this._document.activeElement;s.select(),s.setSelectionRange(0,s.value.length),t=this._document.execCommand("copy"),n&&n.focus()}}catch{}return t}destroy(){const s=this._textarea;s&&(s.remove(),this._textarea=void 0)}}let w=(()=>{class i{constructor(t){this._document=t}copy(t){const n=this.beginCopy(t),o=n.copy();return n.destroy(),o}beginCopy(t){return new V(t,this._document)}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(d.qQ))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var j=a(7673),R=a(9437),L=a(1626);let Z=(()=>{class i{constructor(t){this.http=t}getLightning(t){return this.http.get(t).pipe((0,R.W)(n=>(console.error("Failed to fetch Lightning response:",n),(0,j.of)({status:"Failed"}))))}getLightningInvoice(t,n){return this.http.get(`${t}?amount=${n}`).pipe((0,R.W)(r=>(console.error("Failed to fetch Lightning invoice:",r),(0,j.of)({pr:"",status:"Failed"}))))}getLightningAddress(t){try{const[n,o]=t.split("@");return`https://${o}/.well-known/lnurlp/${n}`}catch{return console.error("Invalid Lightning address format:",t),""}}sendZapRequest(t,n,o,r){const l=encodeURIComponent(JSON.stringify(n));return this.http.get(`${t}?amount=${o}&nostr=${l}&lnurl=${r}`).pipe((0,R.W)(u=>(console.error("Failed to send zap request:",u),(0,j.of)({pr:"",status:"Failed"}))))}login(){return(0,c.A)(function*(){try{return window.webln&&!window.webln.isEnabled()&&(yield window.webln.enable()),!0}catch(t){return console.error("WebLN login failed:",t),!1}})()}hasWebln(){return!!window.webln}sendPayment(t){var n=this;return(0,c.A)(function*(){try{return n.hasWebln()?yield window.webln.sendPayment(t):(console.error("WebLN is not available"),null)}catch(o){throw console.error("Payment failed:",o),o}})()}payInvoice(t){var n=this;return(0,c.A)(function*(){if((yield n.login())&&n.hasWebln())try{return!!(yield n.sendPayment(t))}catch(r){return console.error("Failed to pay invoice:",r),!1}return console.error("WebLN not available or login failed"),!1})()}static{this.\u0275fac=function(n){return new(n||i)(e.KVO(L.Qq))}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var O=a(719),U=a(6324),W=a(6231),z=a(2798),K=a(5766),q=a(9706);function Q(i,s){if(1&i){const t=e.RV6();e.j41(0,"button",15),e.bIt("click",function(){let o;const r=e.eBV(t).$implicit,l=e.XpG(2);return e.Njj(null==(o=l.sendZapForm.get("amount"))?null:o.setValue(r.value))}),e.j41(1,"mat-icon",16),e.EFF(2),e.k0s(),e.j41(3,"span",17),e.EFF(4),e.k0s()()}if(2&i){const t=s.$implicit;e.R7$(2),e.JRh(t.icon),e.R7$(2),e.JRh(t.label)}}function J(i,s){1&i&&(e.j41(0,"mat-error"),e.EFF(1," Zap amount is required "),e.k0s())}function H(i,s){1&i&&(e.j41(0,"mat-error"),e.EFF(1," Minimum amount is 1 sat "),e.k0s())}function ee(i,s){if(1&i){const t=e.RV6();e.j41(0,"mat-dialog-content",5)(1,"div",6),e.DNE(2,Q,5,2,"button",7),e.k0s(),e.nrm(3,"mat-divider"),e.j41(4,"div",8)(5,"mat-form-field",9)(6,"mat-label"),e.EFF(7,"Zap Amount"),e.k0s(),e.nrm(8,"input",10),e.j41(9,"mat-hint",11),e.EFF(10,"Amount in sats"),e.k0s(),e.DNE(11,J,2,0,"mat-error",12)(12,H,2,0,"mat-error",12),e.k0s(),e.j41(13,"mat-form-field",9)(14,"mat-label"),e.EFF(15,"Comment"),e.k0s(),e.nrm(16,"input",13),e.j41(17,"mat-hint",11),e.EFF(18),e.k0s()()(),e.j41(19,"mat-dialog-actions",11)(20,"button",14),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onSubmit())}),e.EFF(21," Create Invoice "),e.k0s()()()}if(2&i){let t,n,o;const r=e.XpG();e.R7$(2),e.Y8G("ngForOf",r.zapButtons),e.R7$(2),e.Y8G("formGroup",r.sendZapForm),e.R7$(7),e.Y8G("ngIf",null==(t=r.sendZapForm.get("amount"))?null:t.hasError("required")),e.R7$(),e.Y8G("ngIf",null==(n=r.sendZapForm.get("amount"))?null:n.hasError("min")),e.R7$(6),e.SpI(" ",(null==(o=r.sendZapForm.get("comment"))||null==o.value?null:o.value.length)||0,"/100 "),e.R7$(2),e.Y8G("disabled",r.sendZapForm.invalid)}}function te(i,s){if(1&i&&(e.j41(0,"div",21)(1,"span",22),e.EFF(2),e.k0s(),e.nrm(3,"mat-divider",23)(4,"qrcode",24),e.k0s()),2&i){const t=e.XpG(2);e.R7$(2),e.SpI("Scan with phone to pay (",t.invoiceAmount," sats)"),e.R7$(2),e.Y8G("qrdata",t.lightningInvoice)("matTooltip","Lightning Invoice")("errorCorrectionLevel","M")}}function ne(i,s){if(1&i){const t=e.RV6();e.j41(0,"div",25)(1,"mat-form-field",26)(2,"mat-label"),e.EFF(3,"Invoice Address"),e.k0s(),e.nrm(4,"input",27),e.j41(5,"button",28),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.copyInvoice())}),e.nrm(6,"mat-icon",29),e.k0s()()()}if(2&i){const t=e.XpG(2);e.R7$(4),e.Y8G("value",t.lightningInvoice),e.R7$(),e.Y8G("matTooltip","Copy Invoice"),e.R7$(),e.Y8G("svgIcon","heroicons_outline:clipboard-document")}}function oe(i,s){if(1&i&&(e.j41(0,"mat-dialog-content",18),e.DNE(1,te,5,4,"div",19)(2,ne,7,3,"div",20),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ngIf",t.displayQRCode),e.R7$(),e.Y8G("ngIf",t.showInvoiceSection&&t.lightningInvoice)}}let ie=(()=>{class i{constructor(t){this.util=t,this.formBuilder=(0,e.WQX)(m.ok),this.lightningService=(0,e.WQX)(Z),this.signerService=(0,e.WQX)(U.A),this.relayService=(0,e.WQX)(W.b),this.dialogRef=(0,e.WQX)(h.CP),this.snackBar=(0,e.WQX)(P.UG),this.clipboard=(0,e.WQX)(w),this.data=(0,e.WQX)(h.Vh),this.lightningInvoice="",this.payRequest=null,this.displayQRCode=!1,this.showInvoiceSection=!1,this.loading=!1,this.invoiceAmount=0,this.error="",this.zapButtons=[{icon:"thumb_up",label:"21",value:21},{icon:"favorite",label:"50",value:50},{icon:"emoji_emotions",label:"100",value:100},{icon:"star",label:"500",value:500},{icon:"celebration",label:"1k",value:1e3},{icon:"rocket",label:"5k",value:5e3},{icon:"local_fire_department",label:"10k",value:1e4},{icon:"flash_on",label:"100k",value:1e5},{icon:"diamond",label:"500k",value:5e5}]}ngOnInit(){this.initializeForm()}initializeForm(){this.sendZapForm=this.formBuilder.group({lightningAddress:[this.data.lud16||this.data.lud06,[m.k0.required,this.validateLightningAddress]],amount:["",[m.k0.required,m.k0.min(1)]],comment:[""]})}validateLightningAddress(t){return t.value.includes("@")?null:{invalidFormat:!0}}onSubmit(){var t=this;return(0,c.A)(function*(){t.sendZapForm.invalid?t.showError("Please fill out the form correctly."):(t.loading=!0,yield t.fetchPayRequest())})()}getCallbackUrl(t){if(t.includes("@")){const[n,o]=t.split("@");return`https://${o}/.well-known/lnurlp/${n}`}return t.toLowerCase().startsWith("lnurl")?this.util.convertBech32ToText(t).toString():null}fetchPayRequest(){var t=this;return(0,c.A)(function*(){t.resetState();const n=t.data.lud16||t.data.lud06;if(!n)return void t.showError("Lightning Address is required.");let o=t.getCallbackUrl(n);try{const r=yield fetch(o);if(!r.ok)throw new Error("Failed to fetch pay request.");const l=yield r.json();if("ERROR"===l.status)return void t.showError(l.reason||"Error fetching the pay request.");t.payRequest=l,t.showInvoiceSection=!1,t.configureAmountValidators(),yield t.generateInvoice()}catch(r){t.showError(r.message||"Error connecting to the server.")}finally{t.loading=!1}})()}generateInvoice(){var t=this;return(0,c.A)(function*(){const n=t.sendZapForm.get("amount")?.value,o=t.sendZapForm.get("comment")?.value,r=t.data.eventId||null;if(!t.payRequest)return void t.showError("Pay request is not loaded.");t.invoiceAmount=n;const l=new URL(t.payRequest.callback),p=new URLSearchParams({amount:(1e3*n).toString()});if(o&&t.payRequest.commentAllowed&&p.set("comment",o),r){const u=yield t.createAndSignZapRequest(r,o);p.set("nostr",JSON.stringify(u))}try{const u=yield fetch(`${l.origin}${l.pathname}?${p.toString()}`);if(!u.ok)throw new Error("Failed to fetch invoice.");const v=yield u.json();if("ERROR"===v.status)return void t.showError(v.reason||"Error fetching the invoice.");t.lightningInvoice=v.pr,t.showInvoiceSection=!0,t.toggleQRCodeDisplay(!0)}catch(u){t.showError(u.message||"Error fetching the invoice.")}})()}configureAmountValidators(){if(!this.payRequest)return;const t=(this.payRequest.minSendable||1e3)/1e3,n=(this.payRequest.maxSendable||21e6)/1e3,o=this.sendZapForm.get("amount");o?.setValidators([m.k0.required,m.k0.min(t),m.k0.max(n)]),o?.updateValueAndValidity()}createAndSignZapRequest(t,n){var o=this;return(0,c.A)(function*(){try{const r=o.createZapRequestData(t,n);let l;if(o.signerService.isUsingSecretKey()){const p=yield o.signerService.getDecryptedSecretKey();if(!p)throw new Error("Private key could not be retrieved.");const u=(0,K.aT)(p);l=(0,O.pC)(r,u)}else l=yield o.signerService.signEventWithExtension(r);if(!l)throw new Error("Signing failed. Signed event is null.");return l}catch(r){throw console.error("Error creating and signing zap request:",r),new Error("Failed to create and sign zap request.")}})()}createZapRequestData(t,n){return{kind:9734,content:n||"",tags:[["e",t],["p",this.payRequest?.nostrPubkey||""],["relays",...this.relayService.getConnectedRelays()]],pubkey:this.signerService.getPublicKey(),created_at:Math.floor(Date.now()/1e3)}}copyInvoice(){this.lightningInvoice?(this.clipboard.copy(this.lightningInvoice),this.showSuccess("Invoice copied to clipboard")):this.showError("No invoice available to copy")}toggleQRCodeDisplay(t=!1){this.displayQRCode=!!t||!this.displayQRCode}resetState(){this.error="",this.loading=!0,this.lightningInvoice=""}showError(t){this.error=t,this.loading=!1,this.snackBar.open(t,"Dismiss",{duration:2e3})}showSuccess(t){this.snackBar.open(t,"Dismiss",{duration:2e3})}closeDialog(){this.dialogRef.close()}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(q.FP))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["app-send-dialog"]],standalone:!0,features:[e.aNF],decls:7,vars:4,consts:[[1,"absolute","right-0","top-0","pr-4","pt-4"],["mat-icon-button","","aria-label","Close",3,"matDialogClose"],[1,"text-secondary",3,"svgIcon"],["class","p-0 mt-4",4,"ngIf"],["class","flex flex-col items-center justify-center text-center p-1 mt-4",4,"ngIf"],[1,"p-0","mt-4"],[1,"preset-buttons"],["class","mr-1 px-3","mat-button","",3,"click",4,"ngFor","ngForOf"],[1,"zap-form",3,"formGroup"],["appearance","outline",1,"sats-input"],["matInput","","formControlName","amount","placeholder","Enter amount in sats, e.g., 100","type","number","aria-label","Zap Amount"],["align","end"],[4,"ngIf"],["matInput","","formControlName","comment","placeholder","Optional comment, e.g., as a gift...","aria-label","Comment","maxlength","100"],["mat-raised-button","","color","primary",3,"click","disabled"],["mat-button","",1,"mr-1","px-3",3,"click"],[1,"text-orange-500","icon-size-5"],[1,"ml-2"],[1,"flex","flex-col","items-center","justify-center","text-center","p-1","mt-4"],["class","w-full flex flex-col items-center",4,"ngIf"],["class","w-full max-w-md",4,"ngIf"],[1,"w-full","flex","flex-col","items-center"],[1,"mb-2"],[1,"w-full","mb-4"],[1,"qrcode-image","m-auto",3,"qrdata","matTooltip","errorCorrectionLevel"],[1,"w-full","max-w-md"],["appearance","outline",1,"w-full"],["matInput","","readonly","","aria-label","Invoice Address",3,"value"],["mat-icon-button","","matSuffix","","aria-label","Copy Invoice",3,"click","matTooltip"],[3,"svgIcon"]],template:function(n,o){1&n&&(e.j41(0,"div",0)(1,"button",1),e.nrm(2,"mat-icon",2),e.k0s()(),e.j41(3,"h1"),e.EFF(4,"\u26a1Zap"),e.k0s(),e.DNE(5,ee,22,6,"mat-dialog-content",3)(6,oe,3,2,"mat-dialog-content",4)),2&n&&(e.R7$(),e.Y8G("matDialogClose",void 0),e.R7$(),e.Y8G("svgIcon","heroicons_outline:x-mark"),e.R7$(3),e.Y8G("ngIf",!o.showInvoiceSection||!o.lightningInvoice),e.R7$(),e.Y8G("ngIf",o.showInvoiceSection&&o.lightningInvoice))},dependencies:[G.vg,g.Hl,g.$z,g.iY,_.m_,_.An,m.YN,m.me,m.Q0,m.BC,m.cb,m.tU,f.nJ,f.rl,m.X1,m.j4,m.JD,d.MD,d.Sq,d.bT,z.Ve,f.MV,f.TL,f.yw,f.RG,b.fS,b.fg,h.Yi,h.E7,C.f,C.c,y.q,x.oV,h.tx],styles:[".preset-buttons[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;justify-items:center;margin-bottom:20px}.preset-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{font-size:14px;font-weight:700;display:flex;align-items:center;justify-content:center;max-height:60px!important}.sats-input[_ngcontent-%COMP%]{margin-top:20px;width:100%}.lightning-buttons[_ngcontent-%COMP%]{margin:5px 0}"]})}}return i})();var I=a(8418),re=a(7291),se=a(345),ae=a(5713),le=a(881),ce=a(9979),me=a(1772),pe=a(5645),ue=a(413);const de=["eventInput"],fe=["commentInput"],ge=()=>["hex","npub"],he=(i,s)=>({height:i,overflow:s}),ve=(i,s)=>({"white-space":i,"max-height":s,overflow:"hidden"}),T=i=>({"large-font":i});function _e(i,s){if(1&i&&(e.qex(0),e.nrm(1,"img",35),e.bVm()),2&i){const t=e.XpG();e.R7$(),e.FS9("alt",(null==t.profileUser?null:t.profileUser.display_name)||(null==t.profileUser?null:t.profileUser.name)||""),e.Y8G("src",t.getSafeUrl(null==t.profileUser?null:t.profileUser.picture),e.B4B)}}function be(i,s){if(1&i&&e.nrm(0,"img",36),2&i){const t=e.XpG();e.FS9("alt",(null==t.profileUser?null:t.profileUser.display_name)||(null==t.profileUser?null:t.profileUser.name)||"")}}function ke(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",38)(2,"span",39),e.EFF(3),e.k0s(),e.j41(4,"span",40),e.EFF(5,"FOLLOWERS"),e.k0s()(),e.j41(6,"div",38)(7,"span",41),e.EFF(8),e.k0s(),e.j41(9,"span",42),e.EFF(10," FOLLOWING "),e.k0s()(),e.bVm()),2&i){const t=s.ngIf;e.R7$(2),e.Y8G("matTooltip","Total contact: "+t.totalContacts),e.R7$(),e.SpI(" ",t.followersCount," "),e.R7$(5),e.JRh(t.followingCount),e.R7$(),e.Y8G("matTooltip","Total contact: "+t.totalContacts)}}function ye(i,s){if(1&i&&(e.j41(0,"div",37),e.DNE(1,ke,11,4,"ng-container",21),e.nI1(2,"async"),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ngIf",e.bMT(2,1,t.stats$))}}function xe(i,s){if(1&i&&(e.j41(0,"div",37)(1,"div",38)(2,"span",39),e.EFF(3),e.k0s(),e.j41(4,"span",40),e.EFF(5,"FOLLOWERS"),e.k0s()(),e.j41(6,"div",38)(7,"span",41),e.EFF(8),e.k0s(),e.j41(9,"span",42),e.EFF(10," FOLLOWING "),e.k0s()()()),2&i){const t=e.XpG();e.R7$(2),e.Y8G("matTooltip","Total contact: "+t.totalContacts),e.R7$(),e.SpI(" ",t.followersCount," "),e.R7$(5),e.JRh(t.followingCount),e.R7$(),e.Y8G("matTooltip","Total contact: "+t.totalContacts)}}function Fe(i,s){if(1&i){const t=e.RV6();e.j41(0,"div")(1,"button",43),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.toggleFollow())}),e.nrm(2,"mat-icon",44),e.k0s()()}if(2&i){const t=e.XpG();e.R7$(),e.Y8G("matTooltip",t.isFollowing?"Unfollow":"Follow"),e.R7$(),e.Y8G("svgIcon",t.isFollowing?"heroicons_outline:user-minus":"heroicons_outline:user-plus")}}function Ce(i,s){if(1&i){const t=e.RV6();e.j41(0,"button",45),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.openZapDialog())}),e.j41(1,"span",46),e.nrm(2,"mat-icon",47),e.j41(3,"span"),e.EFF(4),e.k0s()()()}if(2&i){const t=e.XpG();e.R7$(2),e.Y8G("svgIcon",t.isCurrentUserProfile?"heroicons_outline:qr-code":"feather:zap"),e.R7$(2),e.JRh(t.isCurrentUserProfile?"Receive Zap":"Send Zap")}}function je(i,s){if(1&i){const t=e.RV6();e.qex(0),e.j41(1,"button",45),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG();return e.Njj(r.copyKey(o))}),e.j41(2,"span",46),e.nrm(3,"mat-icon",47),e.j41(4,"span"),e.EFF(5),e.k0s()()(),e.bVm()}if(2&i){const t=s.$implicit;e.R7$(3),e.Y8G("svgIcon","heroicons_outline:clipboard-document"),e.R7$(2),e.SpI("Copy Public key (",t,")")}}function Re(i,s){1&i&&(e.j41(0,"button",48)(1,"span",46),e.nrm(2,"mat-icon",47),e.j41(3,"span"),e.EFF(4,"Edit your profile"),e.k0s()()()),2&i&&(e.Y8G("routerLink","/settings/profile"),e.R7$(2),e.Y8G("svgIcon","heroicons_outline:pencil-square"))}function Ie(i,s){1&i&&(e.qex(0),e.j41(1,"button",49)(2,"span",46),e.nrm(3,"mat-icon",47),e.j41(4,"span"),e.EFF(5,"Report"),e.k0s()()(),e.j41(6,"button",49)(7,"span",46),e.nrm(8,"mat-icon",47),e.j41(9,"span"),e.EFF(10,"Turn on notifications"),e.k0s()()(),e.bVm()),2&i&&(e.R7$(3),e.Y8G("svgIcon","heroicons_solid:exclamation-triangle"),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:bell"))}function Ee(i,s){1&i&&(e.j41(0,"span",56),e.EFF(1,"..."),e.k0s())}function $e(i,s){if(1&i){const t=e.RV6();e.j41(0,"angor-card",50)(1,"div",51)(2,"div",52),e.EFF(3,"About"),e.k0s(),e.j41(4,"button",53),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.toggleAbout())}),e.j41(5,"mat-icon"),e.EFF(6),e.k0s()()(),e.j41(7,"div",54),e.EFF(8),e.DNE(9,Ee,2,0,"span",55),e.k0s()()}if(2&i){const t=e.XpG();e.Y8G("ngStyle",e.l_i(5,he,t.aboutExpanded?"auto":"80px",t.aboutExpanded?"visible":"hidden")),e.R7$(6),e.JRh(t.aboutExpanded?"expand_less":"expand_more"),e.R7$(),e.Y8G("ngStyle",e.l_i(8,ve,t.aboutExpanded?"normal":"nowrap",t.aboutExpanded?"none":"1.5em")),e.R7$(),e.SpI(" ",(null==t.profileUser?null:t.profileUser.about)||""," "),e.R7$(),e.Y8G("ngIf",!t.aboutExpanded)}}function Ge(i,s){if(1&i){const t=e.RV6();e.j41(0,"div",75)(1,"emoji-mart",76),e.bIt("emojiClick",function(o){e.eBV(t);const r=e.XpG(2);return e.Njj(r.addEmoji(o))}),e.k0s()()}if(2&i){const t=e.XpG(2);e.R7$(),e.Y8G("darkMode",t.darkMode)}}function Pe(i,s){if(1&i){const t=e.RV6();e.j41(0,"angor-card",57)(1,"div",58)(2,"div",59),e.EFF(3,"Create Post"),e.k0s(),e.j41(4,"mat-slide-toggle",60),e.bIt("change",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.togglePreview())}),e.EFF(5," Preview "),e.k0s()(),e.j41(6,"div",61)(7,"div",62),e.nrm(8,"img",63),e.j41(9,"div",64),e.EFF(10),e.k0s()(),e.j41(11,"mat-form-field",65),e.nrm(12,"textarea",66,3),e.k0s()(),e.j41(14,"div",67)(15,"div",46)(16,"button",68),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.toggleEmojiPicker())}),e.nrm(17,"mat-icon",23),e.j41(18,"span",69),e.EFF(19,"Feeling"),e.k0s()(),e.DNE(20,Ge,2,1,"div",70),e.j41(21,"button",71),e.nrm(22,"mat-icon",23),e.j41(23,"span",69),e.EFF(24,"Media"),e.k0s()(),e.j41(25,"button",71),e.nrm(26,"mat-icon",23),e.j41(27,"span",69),e.EFF(28,"Tag"),e.k0s()(),e.j41(29,"button",72),e.nrm(30,"mat-icon",23),e.k0s(),e.j41(31,"mat-menu",null,4)(33,"button",73)(34,"span",46),e.nrm(35,"mat-icon",47),e.j41(36,"span"),e.EFF(37,"Tag"),e.k0s()()(),e.j41(38,"button",73)(39,"span",46),e.nrm(40,"mat-icon",47),e.j41(41,"span"),e.EFF(42,"Feeling"),e.k0s()()(),e.j41(43,"button",49)(44,"span",46),e.nrm(45,"mat-icon",47),e.j41(46,"span"),e.EFF(47,"Live"),e.k0s()()(),e.j41(48,"button",49)(49,"span",46),e.nrm(50,"mat-icon",47),e.j41(51,"span"),e.EFF(52,"Gif"),e.k0s()()(),e.j41(53,"button",49)(54,"span",46),e.nrm(55,"mat-icon",47),e.j41(56,"span"),e.EFF(57,"Check in"),e.k0s()()()()(),e.j41(58,"button",74),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.sendEvent())}),e.nrm(59,"mat-icon",23),e.j41(60,"span",69),e.EFF(61,"Send"),e.k0s()()()()}if(2&i){const t=e.sdS(32),n=e.XpG();e.R7$(4),e.Y8G("color","primary"),e.R7$(4),e.FS9("alt",(null==n.profileUser?null:n.profileUser.display_name)||(null==n.profileUser?null:n.profileUser.name)||""),e.Y8G("src",null==n.profileUser?null:n.profileUser.picture,e.B4B),e.R7$(2),e.SpI(" ",(null==n.profileUser?null:n.profileUser.display_name)||(null==n.profileUser?null:n.profileUser.name)||""," "),e.R7$(),e.Y8G("subscriptSizing","dynamic"),e.R7$(),e.Y8G("placeholder","What's on your mind?")("rows",3),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:face-smile"),e.R7$(3),e.Y8G("ngIf",n.showEmojiPicker),e.R7$(2),e.Y8G("svgIcon","heroicons_solid:photo"),e.R7$(4),e.Y8G("svgIcon","heroicons_solid:user-circle"),e.R7$(3),e.Y8G("matMenuTriggerFor",t),e.R7$(),e.Y8G("svgIcon","heroicons_solid:ellipsis-horizontal"),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:user-circle"),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:face-smile"),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:play"),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:sparkles"),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:map-pin"),e.R7$(4),e.Y8G("svgIcon","heroicons_solid:paper-airplane")}}function we(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",99),e.nrm(2,"iframe",100),e.k0s(),e.bVm()),2&i){const t=e.XpG().$implicit;e.R7$(2),e.Y8G("src",t.safeWord,e.f$h)}}function Ue(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",99),e.nrm(2,"img",101),e.k0s(),e.bVm()),2&i){const t=e.XpG().$implicit;e.R7$(2),e.Y8G("src",t.safeWord,e.B4B)}}function Te(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",99)(2,"video",102),e.nrm(3,"source",103),e.EFF(4," Your browser does not support the video tag. "),e.k0s()(),e.bVm()),2&i){const t=e.XpG().$implicit;e.R7$(3),e.Y8G("src",t.safeWord,e.B4B)}}function Se(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",99)(2,"audio",104),e.nrm(3,"source",105),e.EFF(4," Your browser does not support the audio element. "),e.k0s()(),e.bVm()),2&i){const t=e.XpG().$implicit;e.R7$(3),e.Y8G("src",t.safeWord,e.B4B)}}function Ye(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",106)(2,"a",107)(3,"span",108),e.EFF(4),e.k0s()()(),e.bVm()),2&i){const t=e.XpG().$implicit;e.R7$(2),e.Y8G("href",t.word,e.B4B),e.R7$(2),e.JRh(t.word)}}function De(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",106)(2,"span",109),e.EFF(3),e.k0s()(),e.bVm()),2&i){const t=e.XpG().$implicit,n=e.XpG(2);e.R7$(2),e.Y8G("ngClass",e.eq3(2,T,n.isSingleEmojiOrWord(t))),e.R7$(),e.SpI(" ",t.trim()," ")}}function Be(i,s){if(1&i&&(e.j41(0,"div",98),e.DNE(1,we,3,1,"ng-container",21)(2,Ue,3,1,"ng-container",21)(3,Te,5,1,"ng-container",21)(4,Se,5,1,"ng-container",21)(5,Ye,5,2,"ng-container",21)(6,De,4,4,"ng-container",21),e.k0s()),2&i){const t=s.$implicit;e.R7$(),e.Y8G("ngIf","youtube"===t.token),e.R7$(),e.Y8G("ngIf","image"===t.token),e.R7$(),e.Y8G("ngIf","video"===t.token),e.R7$(),e.Y8G("ngIf","audio"===t.token),e.R7$(),e.Y8G("ngIf","link"===t.token),e.R7$(),e.Y8G("ngIf",!t.token)}}function Me(i,s){if(1&i&&(e.j41(0,"angor-card",77,5)(2,"div",78),e.nrm(3,"img",79),e.j41(4,"div",80)(5,"span",81),e.EFF(6),e.k0s(),e.j41(7,"span",82),e.EFF(8,"1 minutes ago"),e.k0s()()(),e.DNE(9,Be,7,6,"div",83),e.j41(10,"div",84)(11,"button",85),e.nrm(12,"mat-icon",86),e.j41(13,"span",69),e.EFF(14,"Unlike"),e.k0s()(),e.j41(15,"button",85),e.nrm(16,"mat-icon",87),e.j41(17,"span",69),e.EFF(18,"Comment"),e.k0s()(),e.j41(19,"button",85),e.nrm(20,"mat-icon",88),e.j41(21,"span",69),e.EFF(22,"Share"),e.k0s()(),e.j41(23,"button",85),e.nrm(24,"mat-icon",89),e.j41(25,"span",69),e.EFF(26,"Zap"),e.k0s()()(),e.nrm(27,"hr",90),e.j41(28,"div",91)(29,"div",46)(30,"div",92),e.EFF(31," 0 Zap "),e.k0s()(),e.nrm(32,"div",93),e.j41(33,"div",94)(34,"button",95),e.EFF(35," 0 Like "),e.k0s(),e.j41(36,"button",95),e.EFF(37," 0 shares "),e.k0s(),e.j41(38,"button",96)(39,"span",97),e.EFF(40,"0 Comments"),e.k0s()()()()()),2&i){const t=e.XpG();e.R7$(3),e.FS9("alt",(null==t.profileUser?null:t.profileUser.display_name)||(null==t.profileUser?null:t.profileUser.name)||""),e.Y8G("src",t.getSafeUrl(null==t.profileUser?null:t.profileUser.picture),e.B4B),e.R7$(3),e.JRh((null==t.profileUser?null:t.profileUser.display_name)||(null==t.profileUser?null:t.profileUser.name)||""),e.R7$(3),e.Y8G("ngForOf",t.parseContent.parseContent(t.eventInput.nativeElement.value))("ngForTrackBy",t.trackByFn),e.R7$(3),e.Y8G("svgIcon","heroicons_solid:heart"),e.R7$(4),e.Y8G("svgIcon","heroicons_solid:chat-bubble-left-ellipsis"),e.R7$(4),e.Y8G("svgIcon","heroicons_solid:share"),e.R7$(4),e.Y8G("svgIcon","heroicons_solid:bolt")}}function Xe(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",99),e.nrm(2,"iframe",100),e.k0s(),e.bVm()),2&i){const t=e.XpG().$implicit;e.R7$(2),e.Y8G("src",t.safeWord,e.f$h)}}function Ae(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",99),e.nrm(2,"img",101),e.k0s(),e.bVm()),2&i){const t=e.XpG().$implicit;e.R7$(2),e.Y8G("src",t.safeWord,e.B4B)}}function Ne(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",99)(2,"video",102),e.nrm(3,"source",103),e.EFF(4," Your browser does not support the video tag. "),e.k0s()(),e.bVm()),2&i){const t=e.XpG().$implicit;e.R7$(3),e.Y8G("src",t.safeWord,e.B4B)}}function Ve(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",99)(2,"audio",104),e.nrm(3,"source",105),e.EFF(4," Your browser does not support the audio element. "),e.k0s()(),e.bVm()),2&i){const t=e.XpG().$implicit;e.R7$(3),e.Y8G("src",t.safeWord,e.B4B)}}function Le(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",106)(2,"a",107)(3,"span",108),e.EFF(4),e.k0s()()(),e.bVm()),2&i){const t=e.XpG().$implicit;e.R7$(2),e.Y8G("href",t.word,e.B4B),e.R7$(2),e.JRh(t.word)}}function Ze(i,s){if(1&i&&(e.qex(0),e.j41(1,"div",106)(2,"span",109),e.EFF(3),e.k0s()(),e.bVm()),2&i){const t=e.XpG().$implicit,n=e.XpG(2);e.R7$(2),e.Y8G("ngClass",e.eq3(2,T,n.isSingleEmojiOrWord(t))),e.R7$(),e.SpI(" ",t.trim()," ")}}function Oe(i,s){if(1&i&&(e.j41(0,"div",98),e.DNE(1,Xe,3,1,"ng-container",21)(2,Ae,3,1,"ng-container",21)(3,Ne,5,1,"ng-container",21)(4,Ve,5,1,"ng-container",21)(5,Le,5,2,"ng-container",21)(6,Ze,4,4,"ng-container",21),e.k0s()),2&i){const t=s.$implicit;e.R7$(),e.Y8G("ngIf","youtube"===t.token),e.R7$(),e.Y8G("ngIf","image"===t.token),e.R7$(),e.Y8G("ngIf","video"===t.token),e.R7$(),e.Y8G("ngIf","audio"===t.token),e.R7$(),e.Y8G("ngIf","link"===t.token),e.R7$(),e.Y8G("ngIf",!t.token)}}function We(i,s){if(1&i){const t=e.RV6();e.j41(0,"angor-card",33,6)(2,"div",78),e.nrm(3,"img",79),e.j41(4,"div",80)(5,"span",81),e.EFF(6),e.k0s(),e.j41(7,"span",82),e.EFF(8),e.nI1(9,"ago"),e.k0s()(),e.j41(10,"button",110),e.nrm(11,"mat-icon",23),e.k0s(),e.j41(12,"mat-menu",null,7)(14,"button",49)(15,"span",46),e.nrm(16,"mat-icon",47),e.j41(17,"span"),e.EFF(18,"Save post"),e.k0s()()(),e.j41(19,"button",49)(20,"span",46),e.nrm(21,"mat-icon",47),e.j41(22,"span"),e.EFF(23,"Hide post"),e.k0s()()(),e.j41(24,"button",49)(25,"span",46),e.nrm(26,"mat-icon",47),e.j41(27,"span"),e.EFF(28,"Snooze for 30 days"),e.k0s()()(),e.j41(29,"button",49)(30,"span",46),e.nrm(31,"mat-icon",47),e.j41(32,"span"),e.EFF(33,"Hide all"),e.k0s()()(),e.nrm(34,"mat-divider",26),e.j41(35,"button",49)(36,"span",46),e.nrm(37,"mat-icon",47),e.j41(38,"span"),e.EFF(39,"Report post"),e.k0s()()(),e.j41(40,"button",49)(41,"span",46),e.nrm(42,"mat-icon",47),e.j41(43,"span"),e.EFF(44,"Turn on notifications for this post"),e.k0s()()()()(),e.DNE(45,Oe,7,6,"div",83),e.j41(46,"div",84)(47,"button",85),e.nrm(48,"mat-icon",86),e.j41(49,"span",69),e.EFF(50,"Unlike"),e.k0s()(),e.j41(51,"button",85),e.nrm(52,"mat-icon",87),e.j41(53,"span",69),e.EFF(54,"Comment"),e.k0s()(),e.j41(55,"button",85),e.nrm(56,"mat-icon",88),e.j41(57,"span",69),e.EFF(58,"Share"),e.k0s()(),e.j41(59,"button",68),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG();return e.Njj(r.openZapDialog(o.id))}),e.nrm(60,"mat-icon",89),e.j41(61,"span",69),e.EFF(62,"Zap"),e.k0s()()(),e.nrm(63,"hr",90),e.j41(64,"div",91),e.nrm(65,"div",93),e.j41(66,"div",94)(67,"button",111),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG();return e.Njj(r.openPost(o.id))}),e.j41(68,"span",97),e.EFF(69,"Read More ..."),e.k0s()()()()()}if(2&i){const t=s.$implicit,n=e.sdS(13),o=e.XpG();e.R7$(3),e.FS9("alt",(null==o.profileUser?null:o.profileUser.display_name)||(null==o.profileUser?null:o.profileUser.name)||""),e.Y8G("src",o.getSafeUrl(null==o.profileUser?null:o.profileUser.picture),e.B4B),e.R7$(3),e.JRh((null==o.profileUser?null:o.profileUser.display_name)||(null==o.profileUser?null:o.profileUser.name)||""),e.R7$(2),e.JRh(e.bMT(9,18,t.created_at)),e.R7$(2),e.Y8G("matMenuTriggerFor",n),e.R7$(),e.Y8G("svgIcon","heroicons_solid:ellipsis-vertical"),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:arrow-up-tray"),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:eye-slash"),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:clock"),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:minus-circle"),e.R7$(6),e.Y8G("svgIcon","heroicons_solid:exclamation-triangle"),e.R7$(5),e.Y8G("svgIcon","heroicons_solid:bell"),e.R7$(3),e.Y8G("ngForOf",o.parseContent.parseContent(t.content))("ngForTrackBy",o.trackByFn),e.R7$(3),e.Y8G("svgIcon","heroicons_solid:heart"),e.R7$(4),e.Y8G("svgIcon","heroicons_solid:chat-bubble-left-ellipsis"),e.R7$(4),e.Y8G("svgIcon","heroicons_solid:share"),e.R7$(4),e.Y8G("svgIcon","heroicons_solid:bolt")}}function ze(i,s){if(1&i){const t=e.RV6();e.j41(0,"div",112)(1,"button",113),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.loadNextPage())}),e.EFF(2),e.k0s()()}if(2&i){const t=e.XpG();e.R7$(),e.Y8G("disabled",t.loading),e.R7$(),e.SpI(" ",t.loading?"Loading...":"Load More Posts"," ")}}const Ke=[{path:"",component:(()=>{class i{constructor(t,n,o,r,l,p,u,v,qe,Qe,Je,He,et,tt,nt){this._changeDetectorRef=t,this._signerService=n,this._storageService=o,this._sanitizer=r,this._route=l,this._router=p,this._socialService=u,this._snackBar=v,this._dialog=qe,this._angorConfigService=Qe,this._angorConfirmationService=Je,this._eventService=He,this._subscriptionService=et,this._clipboard=tt,this.parseContent=nt,this.darkMode=!1,this.isLoading=!0,this.errorMessage=null,this._unsubscribeAll=new X.B,this.allPublicKeys=[],this.isCurrentUserProfile=!1,this.isFollowing=!1,this.showEmojiPicker=!1,this.showCommentEmojiPicker=!1,this.lightningResponse=null,this.lightningInvoice=null,this.paymentInvoice="",this.invoiceAmount="?",this.isLiked=!1,this.isPreview=!1,this.posts=[],this.currentPage=1,this.loading=!1,this.myLikes=[],this.myLikedNoteIds=[],this.isLoadingPosts=!0,this.noEventsMessage="",this.hasMorePosts=!0,this.followersList=[],this.followingList=[],this.aboutExpanded=!0,this.totalContacts=0,this.followersCount=0,this.followingCount=0}ngOnInit(){var t=this;return(0,c.A)(function*(){t.initializeTheme(),t.processRouteParams(),t.loadInitialPosts(),t.subscribeToNewPosts()})()}initializeTheme(){this._angorConfigService.config$.subscribe(t=>{"auto"===t.scheme?this.detectSystemTheme():this.darkMode="dark"===t.scheme})}processRouteParams(){this._route.paramMap.subscribe(t=>{const n=t.get("pubkey")||"";n?this.isValidHexPubkey(n)?(this.routePubKey=n,this.isCurrentUserProfile=!1):(this.errorMessage="Public key is invalid. Please check your input.",this.setCurrentUserProfile()):this.setCurrentUserProfile(),this.loadUserProfileData(this.routePubKey)})}setCurrentUserProfile(){this.isCurrentUserProfile=!0,this.routePubKey=this._signerService.getPublicKey()}loadUserProfileData(t){this.loadUserProfile(t),this.stats$=this._storageService.getContactStats$(t)}isValidHexPubkey(t){return/^[a-fA-F0-9]{64}$/.test(t)}loadInitialPosts(){var t=this;return(0,c.A)(function*(){t.loading=!0;let n=0;try{for(;n<5;){const l=yield t._storageService.getPostsByPubKeysWithPagination([t.routePubKey],t.currentPage,10);if(l.length>0){t.posts=[...t.posts,...l],t.posts.sort((p,u)=>u.created_at-p.created_at);break}n++,n<5&&(yield t.delay(3e3))}t.hasMorePosts=t.posts.length>0,t.hasMorePosts||console.log("This user has no posts.")}catch(l){console.error("Error loading posts:",l)}finally{t.loading=!1}t._changeDetectorRef.detectChanges()})()}delay(t){return new Promise(n=>setTimeout(n,t))}subscribeToNewPosts(){var t=this;this.isCurrentUserProfile?this._storageService.posts$.subscribe(n=>{n&&n.pubkey===this.routePubKey&&(this.posts.unshift(n),this.posts.sort((o,r)=>r.created_at-o.created_at),this._changeDetectorRef.detectChanges())}):this.postsSubscriptionId=this._subscriptionService.addSubscriptions([{authors:[this.routePubKey],kinds:[1]}],function(){var o=(0,c.A)(function*(r){t.isReply(r)||t._storageService.savePost(r)});return function(r){return o.apply(this,arguments)}}())}isReply(t){return t.tags.filter(o=>"e"===o[0]||"p"===o[0]).length>0}loadNextPage(){this.loading||(this.currentPage++,this.loadInitialPosts())}toggleAbout(){this.aboutExpanded=!this.aboutExpanded}ngOnDestroy(){this.subscriptionId&&this._subscriptionService.removeSubscriptionById(this.subscriptionId),this.postsSubscriptionId&&this._subscriptionService.removeSubscriptionById(this.postsSubscriptionId),this._unsubscribeAll.next(null),this._unsubscribeAll.complete()}loadUserProfile(t){var n=this;return(0,c.A)(function*(){if(n.isLoading=!0,n.errorMessage=null,n.profileUser=null,n._changeDetectorRef.detectChanges(),!t)return n.errorMessage="No public key found. Please log in again.",n.isLoading=!1,void n._changeDetectorRef.detectChanges();try{const o=yield n._storageService.getProfile(t);o&&(n.profileUser=o,n._changeDetectorRef.detectChanges()),n.subscribeToUserProfileAndContacts(t)}catch(o){console.error("Error loading user profile:",o)}})()}subscribeToUserProfileAndContacts(t){var n=this;return(0,c.A)(function*(){n.subscriptionId=n._subscriptionService.addSubscriptions([{authors:[t],kinds:[0],limit:1},{kinds:[I.In],authors:[t]},{kinds:[I.In],"#p":[t]}],function(){var r=(0,c.A)(function*(l){switch(l.kind){case 0:yield n.processProfileMetadata(l,t);break;case I.In:n.processContactData(l,t)}});return function(l){return r.apply(this,arguments)}}())})()}processProfileMetadata(t,n){var o=this;return(0,c.A)(function*(){try{const r=JSON.parse(t.content);o.profileUser=r,yield o._storageService.saveProfile(n,r),o._changeDetectorRef.markForCheck()}catch(r){console.error("Error processing metadata event:",r)}})()}processContactData(t,n){const o=t.pubkey===n,r={id:t.id,pubkey:t.pubkey,created_at:t.created_at,tags:t.tags,isFollower:o};o?(this.followersList.push(r),this.followersCount++,this.totalContacts++,this._changeDetectorRef.detectChanges()):(this.followingList.push(r),this.followingCount++,this.totalContacts++,this._changeDetectorRef.detectChanges())}getSafeUrl(t){return this._sanitizer.bypassSecurityTrustUrl(t)}toggleFollow(){var t=this;return(0,c.A)(function*(){try{const n=t._signerService.getPublicKey(),o=t.routePubKey||t.currentUserPubKey;if(!o||!n)return void console.error("Public key missing. Unable to toggle follow.");t.isFollowing?yield t._socialService.unfollow(o):yield t._socialService.follow(o),t.isFollowing=!t.isFollowing,t._changeDetectorRef.detectChanges()}catch(n){console.error("Failed to toggle follow:",n)}})()}openSnackBar(t,n="dismiss"){this._snackBar.open(t,n,{duration:3e3})}canUseZap(){var t=this;return(0,c.A)(function*(){return!(!t.profileUser||!t.profileUser.lud06&&!t.profileUser.lud16)||(t.openSnackBar("Using Zap is not possible. Please complete your profile to include lud06 or lud16."),!1)})()}openZapDialog(t=""){var n=this;return(0,c.A)(function*(){(yield n.canUseZap())&&n._dialog.open(ie,{width:"405px",maxHeight:"90vh",data:{lud16:n.profileUser.lud16,lud06:n.profileUser.lud06,pubkey:n.profileUser.pubkey,eventId:t}})})()}toggleLike(){this.isLiked=!this.isLiked,this.isLiked&&setTimeout(()=>{this.isLiked=!1,this.isLiked=!0},300)}addEmoji(t){this.eventInput.nativeElement.value+=t.emoji.native,this.showEmojiPicker=!1}toggleEmojiPicker(){this.showCommentEmojiPicker=!1,this.showEmojiPicker=!this.showEmojiPicker}addEmojiTocomment(t){this.commentInput.nativeElement.value+=t.emoji.native,this.showCommentEmojiPicker=!1}detectSystemTheme(){const t=window.matchMedia("(prefers-color-scheme: dark)");this.darkMode=t.matches,t.addEventListener("change",n=>{this.darkMode=n.matches})}togglePreview(){this.isPreview=!this.isPreview}sendEvent(){""!=this.eventInput.nativeElement.value&&this._eventService.sendTextEvent(this.eventInput.nativeElement.value).then(()=>{this.eventInput.nativeElement.value="",this._changeDetectorRef.markForCheck()}).catch(t=>{console.error("Failed to send Event:",t)})}copyHex(){this._clipboard.copy(this.routePubKey),this.openSnackBar("hex public key copied","dismiss")}copyNpub(){var t=this._signerService.getNpubFromPubkey(this.routePubKey);this._clipboard.copy(t),this.openSnackBar("npub public key copied","dismiss")}isSingleEmojiOrWord(t){const n=t.trim(),o=/^\w+$/.test(n),r=/^[\p{Emoji}]+$/u.test(n);return o||r}openPost(t){this._router.navigate(["/post",t])}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(e.gRc),e.rXU(U.A),e.rXU(re.n),e.rXU(se.up),e.rXU(F.nX),e.rXU(F.Ix),e.rXU(ae.l),e.rXU(P.UG),e.rXU(h.bZ),e.rXU(le.P),e.rXU(ce.m),e.rXU(me.x),e.rXU(pe.n),e.rXU(w),e.rXU(ue.m))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["profile"]],viewQuery:function(n,o){if(1&n&&(e.GBs(de,5),e.GBs(fe,5)),2&n){let r;e.mGM(r=e.lsd())&&(o.eventInput=r.first),e.mGM(r=e.lsd())&&(o.commentInput=r.first)}},standalone:!0,features:[e.aNF],decls:40,vars:20,consts:[["defaultAvatar",""],["otherUserStats",""],["profileMenu","matMenu"],["eventInput",""],["postCardMenu01","matMenu"],["expandableComments","angorCard"],["expandableCard02","angorCard"],["postCardMenu02","matMenu"],[1,"flex","min-w-0","flex-auto","flex-col"],[1,"bg-card","flex","flex-col","shadow"],["onerror","this.onerror=null; this.src='/images/pages/profile/cover.jpg';",1,"h-40","object-cover","lg:h-80",3,"src","alt"],[1,"bg-card","mx-auto","flex","w-full","max-w-5xl","flex-0","flex-col","items-center","px-8","lg:h-18","lg:flex-row"],[1,"-mt-26","flex-shrink-0","rounded-full","lg:-mt-22"],[4,"ngIf","ngIfElse"],[1,"mt-4","flex","flex-grow","flex-col","items-center","lg:ml-8","lg:mt-0","lg:items-start"],[1,"max-w-full","truncate","text-lg","font-bold","leading-tight","lg:max-w-[25rem]",2,"white-space","nowrap","overflow","hidden","text-overflow","ellipsis"],[1,"text-secondary","max-w-full","truncate","leading-tight","lg:max-w-[25rem]",2,"white-space","nowrap","overflow","hidden","text-overflow","ellipsis"],[1,"mx-8","hidden","h-8","flex-shrink-0","border-l-2","lg:flex"],[1,"flex","flex-shrink-0","items-center","space-x-6","lg:mt-0"],["class","mt-6 flex flex-shrink-0 items-center space-x-6 lg:mt-0",4,"ngIf","ngIfElse"],[1,"mb-4","mt-8","flex","flex-shrink-0","items-center","space-x-6","lg:m-0","lg:ml-auto"],[4,"ngIf"],["mat-icon-button","",3,"matMenuTriggerFor"],[1,"icon-size-5",3,"svgIcon"],["mat-menu-item","",3,"click",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"my-2"],["mat-menu-item","",3,"routerLink",4,"ngIf"],[1,"mx-auto","w-full","max-w-5xl","p-6","sm:p-8"],[1,"flex","w-full","max-w-140","m-auto","flex-col","items-start"],["class","about-section mb-8 flex flex-col items-start p-6 transition-all duration-300 w-full pb-6 sm:p-8","style","position: relative",3,"ngStyle",4,"ngIf"],["class","mb-8 flex w-full flex-col p-6 pb-6 sm:p-8",4,"ngIf"],["class","mb-8 flex w-full flex-col bg-primary-50 dark:bg-primary-800",4,"ngIf"],[1,"mb-8","flex","w-full","flex-col"],["class","mt-4 m-auto flex justify-center",4,"ngIf"],["onerror","this.onerror=null; this.src='/images/avatars/avatar-placeholder.png';",1,"ring-bg-card","h-32","min-h-32","w-32","min-w-32","max-w-fit","rounded-full","object-cover","ring-4",3,"src","alt"],["src","/images/avatars/avatar-placeholder.png","onerror","this.onerror=null; this.src='/images/avatars/avatar-placeholder.png';",1,"ring-bg-card","h-32","min-h-32","w-32","min-w-32","rounded-full","object-cover","ring-4",3,"alt"],[1,"mt-6","flex","flex-shrink-0","items-center","space-x-6","lg:mt-0"],[1,"flex","flex-col","items-center"],[1,"font-bold",3,"matTooltip"],[1,"text-secondary","text-sm","font-medium"],[1,"font-bold"],[1,"text-secondary","text-sm","font-medium",3,"matTooltip"],["mat-icon-button","",3,"click","matTooltip"],[3,"svgIcon"],["mat-menu-item","",3,"click"],[1,"flex","items-center"],[1,"mr-3","icon-size-5",3,"svgIcon"],["mat-menu-item","",3,"routerLink"],["mat-menu-item",""],[1,"about-section","mb-8","flex","flex-col","items-start","p-6","transition-all","duration-300","w-full","pb-6","sm:p-8",2,"position","relative",3,"ngStyle"],[1,"mb-2","flex","w-full","items-center","justify-between"],[1,"text-2xl","font-semibold","leading-tight"],["mat-icon-button","","color","primary","aria-label","Toggle about section",2,"position","absolute","top","16px","right","16px",3,"click"],[1,"about-content","text-base","text-gray-700","transition-all","duration-300",3,"ngStyle"],["class","text-gray-500",4,"ngIf"],[1,"text-gray-500"],[1,"mb-8","flex","w-full","flex-col","p-6","pb-6","sm:p-8"],[1,"flex","justify-between"],[1,"text-xl","font-semibold"],[1,"-mr-4","ml-auto",3,"change","color"],[1,"mt-8","flex","flex-col","items-start","sm:flex-row"],[1,"mb-6","flex","items-center","sm:mb-0"],["onerror","this.onerror=null; this.src='/images/avatars/avatar-placeholder.png';",1,"mr-4","h-12","w-12","min-w-12","rounded-full","object-cover",3,"src","alt"],[1,"sm:hidden"],[1,"w-full",3,"subscriptSizing"],["matInput","","cdkTextareaAutosize","",3,"placeholder","rows"],[1,"-mx-3","mt-6","flex","items-center","justify-between","sm:mt-8"],["mat-button","",1,"mr-1","px-3",3,"click"],[1,"ml-2"],["class","emoji-picker-container-global",4,"ngIf"],["mat-button","",1,"mr-1","hidden","px-3","sm:inline-flex"],["mat-button","",1,"px-3",3,"matMenuTriggerFor"],["mat-menu-item","",1,"sm:hidden"],["mat-button","",1,"mr-1","flex","px-3",3,"click"],[1,"emoji-picker-container-global"],[3,"emojiClick","darkMode"],[1,"mb-8","flex","w-full","flex-col","bg-primary-50","dark:bg-primary-800"],[1,"mx-6","mb-4","mt-6","flex","items-center","sm:mx-8"],["onerror","this.onerror=null; this.src='/images/avatars/avatar-placeholder.png';",1,"mr-4","h-10","w-10","rounded-full","object-cover",3,"src","alt"],[1,"flex","flex-col"],[1,"font-semibold","leading-none"],[1,"text-secondary","mt-1","text-sm","leading-none"],["class","inline-block break-words whitespace-pre-wrap",4,"ngFor","ngForOf","ngForTrackBy"],[1,"mx-3","flex","items-center","sm:mx-5"],["mat-button","",1,"mr-1","px-3"],[1,"text-red-500","icon-size-5",3,"svgIcon"],[1,"text-blue-500","icon-size-5",3,"svgIcon"],[1,"text-green-500","icon-size-5",3,"svgIcon"],[1,"text-orange-500","icon-size-5",3,"svgIcon"],[1,"mx-6","mb-6","mt-4","border-b","sm:mx-8"],[1,"mx-6","mb-4","flex","flex-col","sm:mx-8","sm:mb-6","sm:flex-row","sm:items-center"],[1,"ml-3","text-md","tracking-tight"],[1,"hidden","flex-auto","sm:flex"],[1,"mt-4","flex","items-center","sm:mt-0"],["mat-button","",1,"-ml-2","mr-1","px-3","sm:ml-0"],["mat-button","",1,"px-3","sm:-mr-4"],[1,"mr-1"],[1,"inline-block","break-words","whitespace-pre-wrap"],[1,"relative","mb-4","block"],["width","560","height","315","frameborder","0","allowfullscreen","",3,"src"],["alt","Embedded Image",1,"max-h-140","object-cover",2,"width","100%",3,"src"],["controls","",2,"width","100%"],["type","video/mp4",3,"src"],["controls",""],["type","audio/mpeg",3,"src"],[1,"mx-6","mb-6","mt-2","sm:mx-8"],["target","_blank",1,"inline-block","break-words","break-all","text-blue-500","underline",3,"href"],[1,"inline-block","break-words","break-all"],[1,"inline-block","break-words","break-all",3,"ngClass"],["mat-icon-button","",1,"-mr-4","ml-auto",3,"matMenuTriggerFor"],["mat-button","",1,"px-3","sm:-mr-4",3,"click"],[1,"mt-4","m-auto","flex","justify-center"],["mat-raised-button","","color","primary",3,"click","disabled"]],template:function(n,o){if(1&n&&(e.j41(0,"div",8)(1,"div",9)(2,"div"),e.nrm(3,"img",10),e.k0s(),e.j41(4,"div",11)(5,"div",12),e.DNE(6,_e,2,2,"ng-container",13)(7,be,1,1,"ng-template",null,0,e.C5r),e.k0s(),e.j41(9,"div",14)(10,"div",15),e.EFF(11),e.k0s(),e.j41(12,"div",16),e.EFF(13),e.k0s()(),e.nrm(14,"div",17),e.j41(15,"div",18),e.DNE(16,ye,3,3,"div",19)(17,xe,11,4,"ng-template",null,1,e.C5r),e.nrm(19,"div",17),e.j41(20,"div",20),e.DNE(21,Fe,3,2,"div",21),e.j41(22,"div")(23,"button",22),e.nrm(24,"mat-icon",23),e.k0s(),e.j41(25,"mat-menu",null,2),e.DNE(27,Ce,5,2,"button",24)(28,je,6,2,"ng-container",25),e.nrm(29,"mat-divider",26),e.DNE(30,Re,5,2,"button",27)(31,Ie,11,2,"ng-container",21),e.k0s()()()()()(),e.j41(32,"div",28)(33,"div",29),e.DNE(34,$e,10,11,"angor-card",30)(35,Pe,62,19,"angor-card",31)(36,Me,41,9,"angor-card",32),e.Z7z(37,We,70,20,"angor-card",33,e.Vm6),e.DNE(39,ze,3,2,"div",34),e.k0s()()()),2&n){const r=e.sdS(8),l=e.sdS(18),p=e.sdS(26);e.R7$(3),e.FS9("alt",(null==o.profileUser?null:o.profileUser.display_name)||(null==o.profileUser?null:o.profileUser.name)||"Banner"),e.Y8G("src",(null==o.profileUser?null:o.profileUser.banner)||"/images/pages/profile/cover.jpg",e.B4B),e.R7$(3),e.Y8G("ngIf",null==o.profileUser?null:o.profileUser.picture)("ngIfElse",r),e.R7$(5),e.SpI(" ",(null==o.profileUser?null:o.profileUser.display_name)||(null==o.profileUser?null:o.profileUser.name)||"Unknown User"," "),e.R7$(2),e.SpI(" ",(null==o.profileUser?null:o.profileUser.username)||(null==o.profileUser?null:o.profileUser.name)," "),e.R7$(3),e.Y8G("ngIf",o.isCurrentUserProfile)("ngIfElse",l),e.R7$(5),e.Y8G("ngIf",!o.isCurrentUserProfile),e.R7$(2),e.Y8G("matMenuTriggerFor",p),e.R7$(),e.Y8G("svgIcon","heroicons_solid:ellipsis-vertical"),e.R7$(3),e.Y8G("ngIf",!o.isCurrentUserProfile||o.isCurrentUserProfile),e.R7$(),e.Y8G("ngForOf",e.lJ4(19,ge)),e.R7$(2),e.Y8G("ngIf",o.isCurrentUserProfile),e.R7$(),e.Y8G("ngIf",!o.isCurrentUserProfile),e.R7$(3),e.Y8G("ngIf",(null==o.profileUser?null:o.profileUser.about)&&""!==o.profileUser.about.trim()),e.R7$(),e.Y8G("ngIf",o.isCurrentUserProfile),e.R7$(),e.Y8G("ngIf",o.isPreview),e.R7$(),e.Dyx(o.posts),e.R7$(2),e.Y8G("ngIf",o.hasMorePosts)}},dependencies:[F.Wk,S.n,_.m_,_.An,g.Hl,g.$z,g.iY,k.Cn,k.kk,k.fb,k.Cp,f.RG,f.rl,b.fS,b.fg,$.xb,$.EE,y.w,y.q,x.uc,x.oV,d.YU,d.MD,d.Sq,d.bT,d.B3,d.Jj,m.YN,C.f,B.Ic,D.sG,Y.D6,M.e,A.MY,G.vg,N.g],styles:[".emoji-picker-container-global{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:9999;width:350px;max-width:100%}.heart-beat{animation:heartBeatAnimation .3s ease-in-out}@keyframes heartBeatAnimation{0%{transform:scale(1)}30%{transform:scale(2)}60%{transform:scale(1)}to{transform:scale(1)}}.loading-spinner{display:flex;justify-content:center;align-items:center;margin:20px 0}.loading-spinner .spinner{border:4px solid rgba(0,0,0,.1);border-left-color:#009fb5;border-radius:50%;width:30px;height:30px;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.about-section{overflow:hidden;transition:height .3s ease}.c-img,.c-video{max-width:100%;border-radius:10px}\n"],encapsulation:2,changeDetection:0})}}return i})()}]}}]); \ No newline at end of file diff --git a/index.html b/index.html index 7cef9c4..6590dda 100644 --- a/index.html +++ b/index.html @@ -41,5 +41,5 @@ - + diff --git a/ngsw.json b/ngsw.json index daab311..d43cc1d 100644 --- a/ngsw.json +++ b/ngsw.json @@ -1,6 +1,6 @@ { "configVersion": 1, - "timestamp": 1731486450022, + "timestamp": 1731503764583, "index": "/index.html", "assetGroups": [], "dataGroups": [], diff --git a/runtime.4fb6769c7cd1b070.js b/runtime.496be2de97dbdc21.js similarity index 59% rename from runtime.4fb6769c7cd1b070.js rename to runtime.496be2de97dbdc21.js index c5cf439..bccab6f 100644 --- a/runtime.4fb6769c7cd1b070.js +++ b/runtime.496be2de97dbdc21.js @@ -1 +1 @@ -(()=>{"use strict";var e,v={},g={};function r(e){var n=g[e];if(void 0!==n)return n.exports;var a=g[e]={id:e,loaded:!1,exports:{}};return v[e].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.m=v,e=[],r.O=(n,a,i,d)=>{if(!a){var t=1/0;for(f=0;f=d)&&Object.keys(r.O).every(p=>r.O[p](a[o]))?a.splice(o--,1):(u=!1,d0&&e[f-1][2]>d;f--)e[f]=e[f-1];e[f]=[a,i,d]},r.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return r.d(n,{a:n}),n},r.d=(e,n)=>{for(var a in n)r.o(n,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((n,a)=>(r.f[a](e,n),n),[])),r.u=e=>(76===e?"common":e)+"."+{19:"f5eff9f0fb41d2a5",76:"03a793f7dff21ff4",96:"63ffb306f6cc4cf6",218:"b3b8b492f2b248be",258:"74e10dcd2177d092",307:"052b08b6291857ae",354:"5567fe4d7117b0cd",364:"352dcb18a587bd74",408:"44ab5c4c49586401",450:"6b828714c4539eff",514:"9c340e033925930a",539:"af0130483732a56f",551:"5de55e78a93f5225",588:"380d9cba851daca3",632:"616768ba8230661a",706:"fbef25b504c45d6f",770:"3ff08aa8a3292ad8",865:"e320a31fbe74bda0",873:"6609f53c79575bb2",896:"b6f66e1cb70998f1"}[e]+".js",r.miniCssF=e=>{},r.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{var e={},n="angor:";r.l=(a,i,d,f)=>{if(e[a])e[a].push(i);else{var t,u;if(void 0!==d)for(var o=document.getElementsByTagName("script"),l=0;l{t.onerror=t.onload=null,clearTimeout(b);var h=e[a];if(delete e[a],t.parentNode&&t.parentNode.removeChild(t),h&&h.forEach(_=>_(p)),m)return m(p)},b=setTimeout(s.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=s.bind(null,t.onerror),t.onload=s.bind(null,t.onload),u&&document.head.appendChild(t)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:n=>n},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="",(()=>{var e={121:0};r.f.j=(i,d)=>{var f=r.o(e,i)?e[i]:void 0;if(0!==f)if(f)d.push(f[2]);else if(121!=i){var t=new Promise((c,s)=>f=e[i]=[c,s]);d.push(f[2]=t);var u=r.p+r.u(i),o=new Error;r.l(u,c=>{if(r.o(e,i)&&(0!==(f=e[i])&&(e[i]=void 0),f)){var s=c&&("load"===c.type?"missing":c.type),b=c&&c.target&&c.target.src;o.message="Loading chunk "+i+" failed.\n("+s+": "+b+")",o.name="ChunkLoadError",o.type=s,o.request=b,f[1](o)}},"chunk-"+i,i)}else e[i]=0},r.O.j=i=>0===e[i];var n=(i,d)=>{var o,l,[f,t,u]=d,c=0;if(f.some(b=>0!==e[b])){for(o in t)r.o(t,o)&&(r.m[o]=t[o]);if(u)var s=u(r)}for(i&&i(d);c{"use strict";var e,v={},g={};function r(e){var n=g[e];if(void 0!==n)return n.exports;var a=g[e]={id:e,loaded:!1,exports:{}};return v[e].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.m=v,e=[],r.O=(n,a,i,d)=>{if(!a){var t=1/0;for(f=0;f=d)&&Object.keys(r.O).every(p=>r.O[p](a[c]))?a.splice(c--,1):(u=!1,d0&&e[f-1][2]>d;f--)e[f]=e[f-1];e[f]=[a,i,d]},r.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return r.d(n,{a:n}),n},r.d=(e,n)=>{for(var a in n)r.o(n,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((n,a)=>(r.f[a](e,n),n),[])),r.u=e=>(76===e?"common":e)+"."+{19:"f5eff9f0fb41d2a5",76:"03a793f7dff21ff4",96:"63ffb306f6cc4cf6",218:"b3b8b492f2b248be",258:"74e10dcd2177d092",307:"052b08b6291857ae",354:"5567fe4d7117b0cd",364:"352dcb18a587bd74",408:"44ab5c4c49586401",450:"6b828714c4539eff",514:"9c340e033925930a",539:"af0130483732a56f",551:"e12e45c28bc44f03",588:"380d9cba851daca3",632:"616768ba8230661a",706:"fbef25b504c45d6f",770:"3ff08aa8a3292ad8",865:"e320a31fbe74bda0",873:"0e3b3fa22d50ccac",896:"b6f66e1cb70998f1"}[e]+".js",r.miniCssF=e=>{},r.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{var e={},n="angor:";r.l=(a,i,d,f)=>{if(e[a])e[a].push(i);else{var t,u;if(void 0!==d)for(var c=document.getElementsByTagName("script"),l=0;l{t.onerror=t.onload=null,clearTimeout(s);var h=e[a];if(delete e[a],t.parentNode&&t.parentNode.removeChild(t),h&&h.forEach(_=>_(p)),m)return m(p)},s=setTimeout(b.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=b.bind(null,t.onerror),t.onload=b.bind(null,t.onload),u&&document.head.appendChild(t)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:n=>n},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="",(()=>{var e={121:0};r.f.j=(i,d)=>{var f=r.o(e,i)?e[i]:void 0;if(0!==f)if(f)d.push(f[2]);else if(121!=i){var t=new Promise((o,b)=>f=e[i]=[o,b]);d.push(f[2]=t);var u=r.p+r.u(i),c=new Error;r.l(u,o=>{if(r.o(e,i)&&(0!==(f=e[i])&&(e[i]=void 0),f)){var b=o&&("load"===o.type?"missing":o.type),s=o&&o.target&&o.target.src;c.message="Loading chunk "+i+" failed.\n("+b+": "+s+")",c.name="ChunkLoadError",c.type=b,c.request=s,f[1](c)}},"chunk-"+i,i)}else e[i]=0},r.O.j=i=>0===e[i];var n=(i,d)=>{var c,l,[f,t,u]=d,o=0;if(f.some(s=>0!==e[s])){for(c in t)r.o(t,c)&&(r.m[c]=t[c]);if(u)var b=u(r)}for(i&&i(d);o