PageSourceSearch

https://www.4yfn.com/build/assets/AddToFavourites-B7qRXFvt.js

js 4yfn.com collected 2026-09-25 04:27:15 UTC 5,381 bytes, 2 lines download raw bytes

1import{j as e}from"./jsx-runtime-CWbFWY2M.js";import{c as y}from"./index-6VkcFi5Q.js";import{r as v,i as F}from"./react-CydE4nCL.js";import{t as a,j as I,F as h}from"./app-D9_mHf2z.js";import{u as _}from"./hooks-D8d4huiB.js";import"./vendor-BrssnT-E.js";import"./sendbird-haQy8H9b.js";import"./hooks-BCz_y8Ei.js";import"./api-6K4LlvuG.js";import"./useFavouriteMutationSnapshot-BZsU13eR.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"a156a80817bcc286d094871909811f8803ba8360"};var n=new t.Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="c3ffa42e-7d0a-4a2c-8948-2ff2b7623612",t._sentryDebugIdIdentifier="sentry-dbid-c3ffa42e-7d0a-4a2c-8948-2ff2b7623612")}catch(r){}})();const A=async(t,n)=>{try{return await t(n)===!0}catch(r){return!1}},E=({note:t,onSave:n,onCancel:r})=>{const[m,c]=v.useState(t),[s,x]=v.useState(!1),[o,u]=v.useState(""),l=async i=>{if(i.preventDefault(),s)return;if(x(!0),u(""),await A(n,m)){r();return}u(a("myMwcTranslations.unableToSaveNoteText","Unable to save your note. Please try again.")),x(!1)};return e.jsx("form",{className:"fixed inset-0 z-50 bg-gray-700/75",onSubmit:l,"aria-busy":s,children:e.jsxs("div",{className:"fixed flex flex-col sm:w-1/3 h-64 my-auto mx-2 sm:mx-auto inset-0 z-50 bg-white text-black",children:[e.jsx("div",{className:"flex flex-row-reverse container",children:e.jsx("button",{type:"button",className:"container w-1/12 py-1 px-6 mr-2 font-bold text-3xl",onClick:r,disabled:s,children:e.jsx("i",{className:"fa-solid fa-xmark",children:e.jsx("span",{className:"sr-only",children:"Close Modal"})})})}),e.jsx(F,{className:"placeholder:text-gray-700 text-sm mx-auto bg-gray-400! pt-2 px-2 pb-32 mb-1 w-11/12",value:m,placeholder:a("myMwcTranslations.addNotePlaceholderText","Please add your notes here..."),type:"textarea",onChange:i=>c(i.target.value),name:"note",disabled:s}),o&&e.jsx("p",{className:"mx-auto w-11/12 text-sm text-red-700",role:"alert",children:o}),e.jsx("p",{className:"text-right mr-4 pb-2",children:e.jsx("input",{className:"container w-1/5 py-2 my-2 rounded-sm bg-smartCyan text-white text-sm cursor-pointer",type:"submit",value:s?a("myMwcTranslations.savingStatusText","Saving..."):a("myMwcTranslations.saveButtonText","Save"),disabled:s})})]})})},G=({profile:t,type:n,id:r,isContact:m,name:c=null,style:s="full",notes:x=!0})=>{const{isFavourite:o,setIsFavourite:u,note:l,loading:i,isMutating:d}=_(n,r),[b,N]=v.useState(!1),w=i||d,f=c!=null?c:[t==null?void 0:t.firstName,t==null?void 0:t.lastName].filter(Boolean).join(" ");let T=null;t!=null&&t.userId&&(T=t.userId);const j=async g=>{if(g.preventDefault(),w)return;const M=!!o;if(!await u(!M))return;const p={[h.EXHIBITOR]:{prefix:"exh",nameKey:"exhibitor"},[h.SPEAKER]:{prefix:"spk",nameKey:"speaker"},[h.SESSION]:{prefix:"age",nameKey:"session"}}[n];if(p){const C=M?"remove_fav":"add_fav";I({event:"".concat(p.prefix,"_").concat(C),[p.nameKey]:c,["".concat(p.nameKey,"_id")]:r,user_id:T})}},k=async g=>await u(!0,g,{reportError:!1}),S=()=>N(!1);return o===void 0?null:m?e.jsxs(e.Fragment,{children:[b&&e.jsx(E,{onSave:k,onCancel:S,show:b,id:r,type:n,note:l}),e.jsxs("div",{className:"flex flex-row gap-6",children:[e.jsx("button",{type:"button",id:"contact-button",className:"cursor-pointer",onClick:j,disabled:i,"aria-disabled":d,"aria-busy":d,"aria-pressed":!!o,"aria-label":"Contact".concat(f?": ".concat(f):""),children:o?"- ".concat(a("myMwcTranslations.removeContactLinkText","Remove Contact")):"+ ".concat(a("myMwcTranslations.addContactLinkText","Add Contact"))}),e.jsx("button",{type:"button",id:"note-button",className:"cursor-pointer",onClick:()=>!w&&N(!0),disabled:i,"aria-disabled":d,children:l?a("myMwcTranslations.viewNoteLinkText","View Note"):a("myMwcTranslations.addNoteLinkText","Add Notes")})]})]}):e.jsxs("div",{className:"flex flex-row gap-4",children:[e.jsxs("button",{type:"button",id:"favourite-button",className:y("border border-gray-400 text-black bg-white cursor-pointer inline-block rounded-md",{"py-2 px-3 sm:px-4":s==="full","py-1 px-2":s==="compact"}),onClick:j,disabled:i,"aria-disabled":d,"aria-busy":d,"aria-pressed":!!o,"aria-label":"Favourite".concat(f?": ".concat(f):""),children:[e.jsx("i",{className:y("text-primary text-base",{"fa-solid fa-star":o,"fa-regular fa-star":!o})}),s==="full"&&e.jsxs("span",{className:"hidden sm:inline",children:[" ",a("myMwcTranslations.favouriteButtonText","Favourite")]}),e.jsx("span",{className:"sr-only",children:o?a("myMwcTranslations.removeFavouriteButtonText","Remove from Favourites"):a("myMwcTranslations.addToFavouritesButtonText","Add to Favourites")})]}),x&&e.jsxs("button",{type:"button",id:"note-button",className:y("border border-gray-400 text-black bg-white py-2 cursor-pointer inline-block rounded-md",{"px-3 sm:px-4":s==="full","px-3":s==="compact"}),onClick:()=>!w&&N(!0),disabled:i,"aria-disabled":d,children:[e.jsx("i",{className:y("text-primary text-base",{"fa-solid fa-pen-line":l,"fa-regular fa-pen-line":!l})}),e.jsxs("span",{className:"hidden sm:inline",children:[" ",l?a("myMwcTranslations.viewNoteLinkText","View Note"):a("myMwcTranslations.addNoteLinkText","Add Note")]})]}),b&&e.jsx(E,{onSave:k,onCancel:S,show:b,id:r,type:n,note:l})]})};export{G as default};
2//# sourceMappingURL=AddToFavourites-B7qRXFvt.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.