You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
23 KiB

var R=Object.defineProperty;var V=(t,a,e)=>a in t?R(t,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[a]=e;var u=(t,a,e)=>V(t,typeof a!="symbol"?a+"":a,e);import{l as j,af as _,ag as K,g as $,x as S,ah as L,ai as E,b as I,ac as F,ad as H,ae as J,K as Y,aj as A,ak as W,H as U}from"./index-MyY_xqVN.js";import{V as q,A as z,e as T,f as Q,u as X,y as k,a2 as M,C as Z,G as ee,_ as te,g as x,h as y,i as g,j as h,p as se,w as N,m as oe,s as ie,l as b,a0 as B,t as D,k as G,q as ne,F as P,z as re,x as p}from"./index-BLqts8WY.js";import{u as ae}from"./index-CsfPLOYu.js";import{Q as de}from"./QuickNav-DgCyvgDx.js";import{E as le}from"./EntityIcon-CF1RwQI5.js";import{G as ce}from"./GiftedDialog-CFmou4Be.js";import{O as he}from"./OfferDialog-BFpCo0de.js";import{C as ue}from"./ContactNameDialog-CYaRfHTt.js";import{T as me}from"./TopMessage-BE0GBIgW.js";import{s as fe}from"./sort-Dh4GzQVc.js";var ge=Object.defineProperty,pe=Object.getOwnPropertyDescriptor,ye=(t,a,e,s)=>{for(var o=s>1?void 0:s?pe(a,e):a,i=t.length-1,r;i>=0;i--)(r=t[i])&&(o=(s?r(a,e,o):r(o))||o);return s&&o&&ge(a,e,o),o};let O=class extends q{constructor(){super(...arguments);u(this,"$notify");u(this,"activeDid","");u(this,"apiServer","");u(this,"contacts",[]);u(this,"contactInput","");u(this,"contactEdit",null);u(this,"contactNewName","");u(this,"contactsSelected",[]);u(this,"givenByMeDescriptions",{});u(this,"givenByMeConfirmed",{});u(this,"givenByMeUnconfirmed",{});u(this,"givenToMeDescriptions",{});u(this,"givenToMeConfirmed",{});u(this,"givenToMeUnconfirmed",{});u(this,"hideRegisterPromptOnNewContact",!1);u(this,"isRegistered",!1);u(this,"showDidCopy",!1);u(this,"showPubKeyCopy",!1);u(this,"showPubKeyHashCopy",!1);u(this,"showGiveNumbers",!1);u(this,"showGiveTotals",!0);u(this,"showGiveConfirmed",!0);u(this,"showLargeIdenticon");u(this,"AppString",z);u(this,"libsUtil",j)}async created(){await T.open();const e=await Q();this.activeDid=e.activeDid||"",this.apiServer=e.apiServer||"",this.isRegistered=!!e.isRegistered,this.showGiveNumbers=!!e.showContactGivesInline,this.hideRegisterPromptOnNewContact=!!e.hideRegisterPromptOnNewContact,this.showGiveNumbers&&this.loadGives();const s=await T.contacts.toArray();this.contacts=s.sort((r,n)=>(r.name||"").localeCompare(n.name||""));const o=this.$route.query.contactJwt;if(o){const{payload:r}=_(o),n=r.own,c={did:r.iss,name:n.name,nextPubKeyHashB64:n.nextPublicEncKeyHash,profileImageUrl:n.profileImageUrl,publicKeyBase64:n.publicEncKey,registered:n.registered};this.addContact(c)}const i=this.$route.query.inviteJwt;if(i==="")this.$notify({group:"alert",type:"danger",title:"Blank Invite",text:"The invite was not included, which can happen when your iOS device cuts off the link. Try pasting the full link into a browser."},7e3);else if(i){this.activeDid||(this.activeDid=await K());const r=await $(this.activeDid);try{const n=await this.axios.post(this.apiServer+"/api/v2/claim",{jwtEncoded:i},{headers:r});if(n.status!=201)throw{error:{response:n}};await X(this.activeDid,{isRegistered:!0}),this.isRegistered=!0,this.$notify({group:"alert",type:"success",title:"Registered",text:"You are now registered."},3e3),await new Promise(m=>setTimeout(m,1e3));const d=_(i).payload;this.$refs.contactNameDialog.open("Who Invited You?","",async m=>{await this.addContact({did:d.vc.credentialSubject.agent.identifier,name:m,registered:!0}),await new Promise(f=>setTimeout(f,1e3)),this.showOnboardingInfo()},async()=>{await this.addContact({did:d.vc.credentialSubject.agent.identifier,name:"(person who invited you)",registered:!0}),await new Promise(m=>setTimeout(m,1e3)),this.showOnboardingInfo()})}catch(n){const c="Error redeeming invite: "+S(n);k(c,!0);let d="Got an error sending the invite.";n.response&&n.response.data&&n.response.data.error?n.response.data.error.message?d=n.response.data.error.message:d=n.response.data.error:n.message&&(d=n.message),this.$notify({group:"alert",type:"danger",title:"Error with Invite",text:d},5e3)}}}danger(e,s="Error",o=5e3){this.$notify({group:"alert",type:"danger",title:s,text:e},o)}showOnboardingInfo(){this.$notify({group:"modal",type:"confirm",title:"They're Added To Your List",text:"Would you like to go to the main page now?",onYes:async()=>{this.$router.push({name:"home"})}},-1)}filteredContacts(){return this.showGiveNumbers?this.contactsSelected.length===0?this.contacts:this.contacts.filter(e=>this.contactsSelected.includes(e.did)):this.contacts}async loadGives(){if(!this.activeDid)return;const e=(s,o,i,r,n)=>{if(s.status===200){const c=s.data.data;for(const d of c){const m=n?d.recipientDid:d.agentDid;if(d.unit==="HUR"){if(d.amountConfirmed){const f=i[m]||0;i[m]=f+d.amount}else{const f=r[m]||0;r[m]=f+d.amount}!o[m]&&d.description&&(o[m]=d.description)}}}else console.error("Got bad response status & data of",s.status,s.data),this.$notify({group:"alert",type:"danger",title:"Retrieval Error",text:"Got an error retrieving your "+(n?"given":"received")+" data from the server."},5e3)};try{const s=await $(this.activeDid,this.$notify),o=this.apiServer+"/api/v2/report/gives?agentDid="+encodeURIComponent(this.activeDid),i=this.apiServer+"/api/v2/report/gives?recipientDid="+encodeURIComponent(this.activeDid),[r,n]=await Promise.all([this.axios.get(o,{headers:s}),this.axios.get(i,{headers:s})]),c={},d={},m={};e(r,c,d,m,!0),this.givenByMeDescriptions=c,this.givenByMeConfirmed=d,this.givenByMeUnconfirmed=m;const f={},w={},v={};e(n,f,w,v,!1),this.givenToMeDescriptions=f,this.givenToMeConfirmed=w,this.givenToMeUnconfirmed=v}catch(s){const o="Error loading gives: "+S(s);k(o,!0),this.$notify({group:"alert",type:"danger",title:"Load Error",text:"Got an error loading your gives."},5e3)}}async onClickNewContact(){const e=this.contactInput.trim();if(!e){this.danger("There was no contact info to add. Try the other green buttons.","No Contact");return}if(e.startsWith(L)){await this.addContactFromScan(e);return}if(e.startsWith(E)){const s=e.split(/\n/),o=[];for(const r of s)!r.trim()||r.startsWith(E)||o.push(this.addContactFromEndorserMobileLine(r));try{await Promise.all(o),this.$notify({group:"alert",type:"success",title:"Contacts Added",text:"Each contact was added. Nothing was sent to the server."},3e3)}catch(r){const n="Error adding contacts from CSV: "+S(r);k(n,!0),this.danger("An error occurred. Some contacts may have been added.")}const i=await T.contacts.toArray();this.contacts=i.sort((r,n)=>(r.name||"").localeCompare(n.name||""));return}if(e.startsWith("did:")){let s=e,o,i,r;const n=e.indexOf(",");if(n>-1){s=e.substring(0,n).trim(),o=e.substring(n+1).trim();const f=e.indexOf(",",n+1);if(f>-1){o=e.substring(n+1,f).trim(),i=e.substring(f+1).trim();const w=e.indexOf(",",f+1);w>-1&&(i=e.substring(f+1,w).trim(),r=e.substring(w+1).trim())}}let c=i;c&&/^[0-9A-Fa-f]{66}$/i.test(c)&&(c=I.Buffer.from(c,"hex").toString("base64"));let d=r;d&&/^[0-9A-Fa-f]{66}$/i.test(d)&&(d=I.Buffer.from(d,"hex").toString("base64"));const m={did:s,name:o,publicKeyBase64:c,nextPubKeyHashB64:d};await this.addContact(m);return}if(e.includes("[")){const s=e.substring(e.indexOf("["),e.lastIndexOf("]")+1);try{const o=JSON.parse(s);this.$router.push({name:"contact-import",query:{contacts:JSON.stringify(o)}})}catch(o){const i="Error adding contacts from array: "+S(o);k(i,!0),this.danger("The input could not be parsed.","Invalid Contact List")}return}this.danger("No contact info was found in that input.","No Contact Info")}async addContactFromEndorserMobileLine(e){let s=e,o="",i,r,n;const c=e.indexOf(",");if(c>-1){s=e.substring(0,c).trim(),o=e.substring(c+1).trim();const f=e.indexOf(",",c+1);if(f>-1){o=e.substring(c+1,f).trim(),i=e.substring(f+1).trim();const w=e.indexOf(",",f+1);if(w>-1){i=e.substring(f+1,w).trim(),r=e.substring(w+1).trim()=="true";const v=e.indexOf(",",w+1);v>-1&&(r=e.substring(w+1,v).trim()=="true",n=e.substring(v+1).trim()=="true")}}}let d=i;d&&/^[0-9A-Fa-f]{66}$/i.test(d)&&(d=I.Buffer.from(d,"hex").toString("base64"));const m={did:o,name:s,publicKeyBase64:d,seesMe:r,registered:n};return T.contacts.add(m)}async addContactFromScan(e){const s=F(e);if(s)return this.addContact({did:s.iss,name:s.own.name,nextPubKeyHashB64:s.own.nextPublicEncKeyHash,profileImageUrl:s.own.profileImageUrl,publicKeyBase64:s.own.publicEncKey,registered:s.own.registered});this.$notify({group:"alert",type:"danger",title:"No Contact Info",text:"The contact info could not be parsed."},3e3)}async addContact(e){if(!e.did){this.danger("Cannot add a contact without a DID.","Incomplete Contact");return}if(!H(e.did)){this.danger("The DID must begin with 'did:'","Invalid DID");return}return T.contacts.add(e).then(()=>{const s=this.contacts.concat([e]);this.contacts=fe((i,r)=>(i.name||"").localeCompare(r.name||""),s);let o;this.activeDid?(this.setVisibility(e,!0,!1),e.seesMe=!0,o="They were added, and your activity is visible to them."):o="They were added.",this.contactInput="",this.isRegistered&&!this.hideRegisterPromptOnNewContact&&!e.registered&&setTimeout(()=>{this.$notify({group:"modal",type:"confirm",title:"Register",text:"Do you want to register them?",onCancel:async i=>{i&&(await M({hideRegisterPromptOnNewContact:i}),this.hideRegisterPromptOnNewContact=i)},onNo:async i=>{i&&(await M({hideRegisterPromptOnNewContact:i}),this.hideRegisterPromptOnNewContact=i)},onYes:async()=>{await this.register(e)},promptToStopAsking:!0},-1)},500),this.$notify({group:"alert",type:"success",title:"Contact Added",text:o},3e3)}).catch(s=>{var r;const o="Error when adding contact to storage: "+S(s);k(o,!0);let i="An error prevented this import.";((r=s.message)==null?void 0:r.indexOf("Key already exists in the object store."))>-1&&(i="A contact with that DID is already in your contact list. Edit them directly below."),s.name==="ConstraintError"&&(i+=" Check that the contact doesn't conflict with any you already have."),this.danger(i,"Contact Not Added",-1)})}async confirmSetVisibility(e,s){const o=s?"Are you sure you want to make your activity visible to them?":"Are you sure you want to hide all your activity from them?";this.$notify({group:"modal",type:"confirm",title:"Set Visibility",text:o,onYes:async()=>{await this.setVisibility(e,s,!0)&&(e.seesMe=s)}},-1)}async register(e){var s;this.$notify({group:"alert",type:"toast",title:"Sent..."},1e3);try{const o=await J(this.activeDid,this.apiServer,this.axios,e);o.success?(e.registered=!0,await T.contacts.update(e.did,{registered:!0}),this.$notify({group:"alert",type:"success",title:"Registration Success",text:(e.name||"That unnamed person")+" has been registered."},5e3)):this.$notify({group:"alert",type:"danger",title:"Registration Error",text:o.error||"Something went wrong during registration."},5e3)}catch(o){const i="Error when registering: "+S(o);k(i,!0);let r="There was an error.";const n=o;n.isAxiosError?(s=n.response)!=null&&s.data&&typeof n.response.data=="object"&&"error"in n.response.data&&typeof n.response.data.error=="object"&&n.response.data.error!==null&&"message"in n.response.data.error?r=n.response.data.error.message:n.message?r=n.message:r=JSON.stringify(n.toJSON()):r=o,this.$notify({group:"alert",type:"danger",title:"Registration Error",text:r},5e3)}}async setVisibility(e,s,o){const i=await Y(this.activeDid,this.apiServer,this.axios,T,e,s);if(i.success)return o&&this.$notify({group:"alert",type:"success",title:"Visibility Set",text:(e.name||"That user")+" can "+(s?"":"not ")+"see your activity."},3e3),!0;{console.error("Got strange result from setting visibility. It can happen when setting visibility on oneself.",i);const r=i.error||"Could not set visibility on the server.";return this.$notify({group:"alert",type:"danger",title:"Error Setting Visibility",text:r},5e3),!1}}confirmShowGiftedDialog(e,s){if(s===this.activeDid&&this.givenToMeUnconfirmed[e]>0){const o=this.givenToMeUnconfirmed[e]==1?"is":"are",i=this.givenToMeUnconfirmed[e]==1?"hour":"hours",r="There "+o+" "+this.givenToMeUnconfirmed[e]+" unconfirmed "+i+" from them. Would you like to confirm some of those hours?";this.$notify({group:"modal",type:"confirm",title:"Delete",text:r,onNo:async()=>{this.showGiftedDialog(e,s)},onYes:async()=>{this.$router.push({name:"contact-amounts",query:{contactDid:e}})}},-1)}else this.showGiftedDialog(e,s)}showGiftedDialog(e,s){let o,i;e&&(o={did:e,name:A(this.activeDid,this.contacts,e)}),s&&(i={did:s,name:A(this.activeDid,this.contacts,s)});let r,n="";e==this.activeDid?(r=c=>{const d=U(this.givenByMeUnconfirmed);d[s]=(d[s]||0)+c,this.givenByMeUnconfirmed=d},n="Given to "+((i==null?void 0:i.name)||"Someone Unnamed")):(r=c=>{const d=U(this.givenToMeUnconfirmed);d[e]=(d[e]||0)+c,this.givenToMeUnconfirmed=d},n="Received from "+((o==null?void 0:o.name)||"Someone Unnamed")),this.$refs.customGivenDialog.open(o,i,void 0,n,void 0,r)}openOfferDialog(e,s){this.$refs.customOfferDialog.open(e,s)}async toggleShowContactAmounts(){const e=!this.showGiveNumbers;try{await M({showContactGivesInline:e})}catch(s){const o="Error updating contact-amounts setting: "+S(s);k(o,!0),this.$notify({group:"alert",type:"danger",title:"Error Updating Contact Setting",text:"The setting may not have saved. Try again, maybe after restarting the app."},5e3)}this.showGiveNumbers=e,e&&Object.keys(this.givenByMeDescriptions).length===0&&Object.keys(this.givenByMeConfirmed).length===0&&Object.keys(this.givenByMeUnconfirmed).length===0&&Object.keys(this.givenToMeDescriptions).length===0&&Object.keys(this.givenToMeConfirmed).length===0&&Object.keys(this.givenToMeUnconfirmed).length===0&&this.loadGives()}toggleShowGiveTotals(){this.showGiveTotals?(this.showGiveTotals=!1,this.showGiveConfirmed=!0):this.showGiveConfirmed?(this.showGiveTotals=!1,this.showGiveConfirmed=!1):(this.showGiveTotals=!0,this.showGiveConfirmed=!0)}showGiveAmountsClassNames(){return{"from-slate-400":this.showGiveTotals,"to-slate-700":this.showGiveTotals,"from-green-400":!this.showGiveTotals&&this.showGiveConfirmed,"to-green-700":!this.showGiveTotals&&this.showGiveConfirmed,"from-yellow-400":!this.showGiveTotals&&!this.showGiveConfirmed,"to-yellow-700":!this.showGiveTotals&&!this.showGiveConfirmed}}async copySelectedContacts(){if(this.contactsSelected.length===0){this.danger("You must select contacts to copy.");return}const e=this.contacts.filter(i=>this.contactsSelected.includes(i.did));console.log("Array of selected contacts:",JSON.stringify(e));const s=await W(this.activeDid,{contacts:e}),o=ee+"/contact-import/"+s;ae().copy(o).then(()=>{this.$notify({group:"alert",type:"info",title:"Copied",text:"The link for those contacts is now in the clipboard."},5e3)})}shortDid(e){return e.startsWith("did:peer:")?e.substring(0,11)+"..."+e.substring(27,34)+"...":e.startsWith("did:ethr:")?e.substring(0,18)+"...":e.substring(0,e.indexOf(":",4)+7)+"..."}};O=ye([Z({components:{GiftedDialog:ce,EntityIcon:le,OfferDialog:he,QuickNav:de,ContactNameDialog:ue,TopMessage:me}})],O);const we={id:"Content",class:"p-6 pb-24 max-w-3xl mx-auto"},be={id:"formAddNewContact",class:"mt-4 mb-4 flex items-stretch"},ve={key:1,class:"flex items-center bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-1 mr-1 rounded-md"},Ce={key:0,class:"flex justify-between"},xe={class:"w-full text-left"},Se=["checked"],Te={class:"w-full text-right"},ke={key:1,class:"flex justify-between mt-1"},De={class:"w-full text-right"},Ge={class:"text-sm uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1 py-1 rounded-md"},Ne={key:2,id:"listContacts",class:"border-t border-slate-300 mt-1"},Ie={class:"grow overflow-hidden"},Me={class:"flex items-center"},Oe=["checked","onClick"],_e={class:"text-base font-semibold ml-2"},$e={class:"ml-4 text-sm overflow-hidden"},Ee={id:"ContactActions",class:"flex gap-1.5 mt-2"},Ae={key:0,class:"ml-auto flex gap-1.5"},Ue=["onClick","title"],Be=["onClick","title"],Pe=["onClick"],Re={key:3},Ve={key:4,class:"mt-2 w-full text-left"},je=["checked"],Ke={key:5,class:"fixed z-[100] top-0 inset-x-0 w-full"},Le={class:"absolute inset-0 h-screen flex flex-col items-center justify-center bg-slate-900/50"};function Fe(t,a,e,s,o,i){const r=x("QuickNav"),n=x("TopMessage"),c=x("fa"),d=x("router-link"),m=x("EntityIcon"),f=x("GiftedDialog"),w=x("OfferDialog"),v=x("ContactNameDialog");return p(),y(P,null,[g(r,{selected:"Contacts"}),g(n),h("section",we,[a[16]||(a[16]=h("h1",{id:"ViewHeading",class:"text-4xl text-center font-light"}," Your Contacts ",-1)),a[17]||(a[17]=h("div",{class:"flex justify-between py-2 mt-8"},[h("span"),h("span",null,[h("a",{href:"/help-onboarding",target:"_blank",class:"text-xs uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-1 rounded-md ml-1"}," Onboarding Guide ")])],-1)),h("div",be,[t.isRegistered?(p(),se(d,{key:0,to:{name:"invite-one"},class:"flex items-center bg-gradient-to-b from-green-400 to-green-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-1 mr-1 rounded-md"},{default:N(()=>[g(c,{icon:"envelope-open-text",class:"fa-fw text-2xl"})]),_:1})):(p(),y("span",ve,[g(c,{icon:"envelope-open-text",class:"fa-fw text-2xl",onClick:a[0]||(a[0]=l=>t.danger("You must get registered before you can invite others.","Not Registered"))})])),g(d,{to:{name:"contact-qr"},class:"flex items-center bg-gradient-to-b from-green-400 to-green-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-1 mr-1 rounded-md"},{default:N(()=>[g(c,{icon:"qrcode",class:"fa-fw text-2xl"})]),_:1}),oe(h("textarea",{type:"text",placeholder:"New URL or DID, Name, Public Key, Next Public Key Hash",class:"block w-full rounded-l border border-r-0 border-slate-400 px-3 py-2 h-10","onUpdate:modelValue":a[1]||(a[1]=l=>t.contactInput=l)},null,512),[[ie,t.contactInput]]),h("button",{class:"px-4 rounded-r bg-green-200 border border-l-0 border-green-400",onClick:a[2]||(a[2]=l=>t.onClickNewContact())},[g(c,{icon:"plus",class:"fa-fw"})])]),t.contacts.length>0?(p(),y("div",Ce,[h("div",xe,[t.showGiveNumbers?b("",!0):(p(),y("input",{key:0,type:"checkbox",checked:t.contactsSelected.length===t.contacts.length,onClick:a[3]||(a[3]=l=>t.contactsSelected.length===t.contacts.length?t.contactsSelected=[]:t.contactsSelected=t.contacts.map(C=>C.did)),class:"align-middle ml-2 h-6 w-6","data-testId":"contactCheckAllTop"},null,8,Se)),t.showGiveNumbers?b("",!0):(p(),y("button",{key:1,href:"",class:"text-md bg-gradient-to-b shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white ml-2 px-1 py-1 rounded-md",style:B(t.contactsSelected.length>0?"background-image: linear-gradient(to bottom, #3b82f6, #1e40af);":"background-image: linear-gradient(to bottom, #94a3b8, #374151);"),onClick:a[4]||(a[4]=l=>t.copySelectedContacts()),"data-testId":"copySelectedContactsButtonTop"}," Copy Selections ",4))]),h("div",Te,[h("button",{href:"",class:"text-md bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1 py-1 rounded-md",onClick:a[5]||(a[5]=l=>t.toggleShowContactAmounts())},D(t.showGiveNumbers?"Hide Hours, Offer, etc":"See Hours, Offer, etc"),1)])])):b("",!0),t.showGiveNumbers?(p(),y("div",ke,[h("div",De,[a[10]||(a[10]=G(" In the following, only the most recent hours are included. To see more, click ")),h("span",Ge,[g(c,{icon:"file-lines",class:"fa-fw"})]),a[11]||(a[11]=h("br",null,null,-1)),h("button",{href:"",class:ne(["text-md bg-gradient-to-b shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-1 rounded-md mt-1",t.showGiveAmountsClassNames()]),onClick:a[6]||(a[6]=l=>t.toggleShowGiveTotals())},[G(D(t.showGiveTotals?"Totals":t.showGiveConfirmed?"Confirmed Amounts":"Unconfirmed Amounts")+" ",1),g(c,{icon:"left-right",class:"fa-fw"})],2)])])):b("",!0),t.contacts.length>0?(p(),y("ul",Ne,[(p(!0),y(P,null,re(t.filteredContacts(),l=>(p(),y("li",{class:"border-b border-slate-300 pt-1 pb-1",key:l.did,"data-testId":"contactListItem"},[h("div",Ie,[h("div",Me,[g(m,{contact:l,iconSize:24,class:"inline-block align-text-bottom border border-slate-300 rounded cursor-pointer",onClick:C=>t.showLargeIdenticon=l},null,8,["contact","onClick"]),t.showGiveNumbers?b("",!0):(p(),y("input",{key:0,type:"checkbox",checked:t.contactsSelected.includes(l.did),onClick:C=>t.contactsSelected.includes(l.did)?t.contactsSelected.splice(t.contactsSelected.indexOf(l.did),1):t.contactsSelected.push(l.did),class:"ml-2 h-6 w-6","data-testId":"contactCheckOne"},null,8,Oe)),h("h2",_e,D(l.name||t.AppString.NO_CONTACT_NAME),1),g(d,{to:{path:"/did/"+encodeURIComponent(l.did)},title:"See more about this person"},{default:N(()=>[g(c,{icon:"circle-info",class:"text-xl text-blue-500 ml-4"})]),_:2},1032,["to"]),h("span",$e,D(t.shortDid(l.did)),1)]),h("div",Ee,[t.showGiveNumbers&&l.did!=t.activeDid?(p(),y("div",Ae,[h("button",{class:"text-sm bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-1.5 rounded-l-md",onClick:C=>t.confirmShowGiftedDialog(l.did,t.activeDid),title:t.givenToMeDescriptions[l.did]||""},[a[12]||(a[12]=G(" From: ")),a[13]||(a[13]=h("br",null,null,-1)),G(" "+D(this.showGiveTotals?(t.givenToMeConfirmed[l.did]||0)+(t.givenToMeUnconfirmed[l.did]||0):this.showGiveConfirmed?t.givenToMeConfirmed[l.did]||0:t.givenToMeUnconfirmed[l.did]||0),1)],8,Ue),h("button",{class:"text-sm bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white -ml-1.5 px-2 py-1.5 rounded-r-md border-l",onClick:C=>t.confirmShowGiftedDialog(t.activeDid,l.did),title:t.givenByMeDescriptions[l.did]||""},[a[14]||(a[14]=G(" To: ")),a[15]||(a[15]=h("br",null,null,-1)),G(" "+D(this.showGiveTotals?(t.givenByMeConfirmed[l.did]||0)+(t.givenByMeUnconfirmed[l.did]||0):this.showGiveConfirmed?t.givenByMeConfirmed[l.did]||0:t.givenByMeUnconfirmed[l.did]||0),1)],8,Be),h("button",{class:"text-sm bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-1.5 rounded-md border border-blue-400",onClick:C=>t.openOfferDialog(l.did,l.name),"data-testId":"offerButton"}," Offer ",8,Pe),g(d,{to:{name:"contact-amounts",query:{contactDid:l.did}},class:"text-sm bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-1.5 rounded-md border border-slate-400",title:"See more given activity"},{default:N(()=>[g(c,{icon:"file-lines",class:"fa-fw"})]),_:2},1032,["to"])])):b("",!0)])])]))),128))])):(p(),y("p",Re,"There are no contacts.")),t.contacts.length>0?(p(),y("div",Ve,[t.showGiveNumbers?b("",!0):(p(),y("input",{key:0,type:"checkbox",checked:t.contactsSelected.length===t.contacts.length,onClick:a[7]||(a[7]=l=>t.contactsSelected.length===t.contacts.length?t.contactsSelected=[]:t.contactsSelected=t.contacts.map(C=>C.did)),class:"align-middle ml-2 h-6 w-6","data-testId":"contactCheckAllBottom"},null,8,je)),t.showGiveNumbers?b("",!0):(p(),y("button",{key:1,href:"",class:"text-md bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white ml-2 px-1 py-1 rounded-md",style:B(t.contactsSelected.length>0?"background-image: linear-gradient(to bottom, #3b82f6, #1e40af);":"background-image: linear-gradient(to bottom, #94a3b8, #374151);"),onClick:a[8]||(a[8]=l=>t.copySelectedContacts())}," Copy Selections ",4))])):b("",!0),g(f,{ref:"customGivenDialog"},null,512),g(w,{ref:"customOfferDialog"},null,512),g(v,{ref:"contactNameDialog"},null,512),t.showLargeIdenticon?(p(),y("div",Ke,[h("div",Le,[g(m,{contact:t.showLargeIdenticon,iconSize:512,class:"flex w-11/12 max-w-sm mx-auto mb-3 overflow-hidden bg-white rounded-lg shadow-lg",onClick:a[9]||(a[9]=l=>t.showLargeIdenticon=void 0)},null,8,["contact"])])])):b("",!0)])],64)}const ot=te(O,[["render",Fe]]);export{ot as default};