1import{s as e}from"./rolldown-runtime-BG2f4sTM.js";import{t}from"./react-CYsHstG7.js";import{u as n}from"./hooks-Dr3i4SJb.js";import{$ as r,En as i,J as a,Xt as o,fn as s,j as c,ln as l,nt as u,tn as d,tt as f,wn as p,yn as m}from"./state-C4IzlkDq.js";import{Ar as h,Bt as g,Ci as _,Cr as v,Fi as y,Hi as b,Jr as x,Li as S,Lr as C,Mi as w,Mr as T,Nr as E,Ot as D,Pi as O,Pr as k,Qn as A,Ri as j,Sr as M,Ui as N,Ur as P,Vr as F,Wn as ee,Wr as I,ji as L,ki as R,m as te,s as ne,t as re,u as ie,ur as ae,xi as oe,zi as se,zr as ce}from"./analytics-DyulWhN4.js";import{n as le}from"./env-B8hvVhPP.js";import{t as ue}from"./jsx-runtime-CqqR4vFp.js";import{E as de,_ as fe,g as pe,h as me,m as he,n as ge,x as _e,y as ve}from"./icons-BPGyB4it.js";import{_ as ye,g as be,t as xe,v as Se}from"./format-sNN-Y9cn.js";import{t as Ce}from"./checkoutFailureTelemetry-bcnBBp_y.js";import{I as we}from"./useQuery-BhDSG0wj.js";import{a as z,n as B}from"./Toast-CGSK31on.js";import{n as Te,t as Ee}from"./stripeReturnContext-BAYwQ1FA.js";import{t as De}from"./TextLink-Cvv-ojMh.js";import{t as Oe}from"./Tooltip-Dv7KDgP2.js";import{t as ke}from"./prop-types-CORYyAMl.js";import{a as Ae,n as je,o as Me,r as Ne,s as Pe}from"./AlgoSdkConnectContext-B2E0ZIH3.js";import{t as Fe}from"./lib-vMFTh-KW.js";import{i as Ie}from"./arrays-VI7XjGhB.js";function Le(e,t){ye(2,arguments);var n=be(e),r=Se(t);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}var Re=365.2425,ze=10**8*24*60*60*1e3,Be=6e4,Ve=36e5,He=1e3;-ze;var Ue=3600*24;Ue*7,Ue*Re/12*3;var V=ue(),We=({className:e=``})=>(0,V.jsx)(`div`,{className:`animate-pulse rounded bg-lofty-gray-300 dark:bg-lofty-purple-500/30 ${e}`}),Ge=({className:e=``,lines:t=1})=>(0,V.jsx)(`div`,{className:`flex flex-col gap-2 ${e}`,children:Array.from({length:t}).map((e,n)=>(0,V.jsx)(`div`,{className:`animate-pulse rounded bg-lofty-gray-300 dark:bg-lofty-purple-500/30 h-3 ${n===t-1&&t>1?`w-3/4`:`w-full`}`},n))}),Ke=()=>(0,V.jsxs)(`div`,{className:`flex items-center gap-3 py-4 px-3 animate-pulse`,children:[(0,V.jsx)(`div`,{className:`h-11 w-11 rounded-lg bg-lofty-gray-300 dark:bg-lofty-purple-500/30 shrink-0`}),(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsx)(`div`,{className:`h-3.5 w-3/4 rounded bg-lofty-gray-300 dark:bg-lofty-purple-500/30`}),(0,V.jsx)(`div`,{className:`mt-2 h-2.5 w-1/2 rounded bg-lofty-gray-300 dark:bg-lofty-purple-500/30`})]}),(0,V.jsxs)(`div`,{className:`text-right shrink-0`,children:[(0,V.jsx)(`div`,{className:`h-3.5 w-16 rounded bg-lofty-gray-300 dark:bg-lofty-purple-500/30`}),(0,V.jsx)(`div`,{className:`mt-2 h-2.5 w-12 rounded bg-lofty-gray-300 dark:bg-lofty-purple-500/30 ml-auto`})]})]}),H=e(t(),1),U=e(ke(),1);function qe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Je(e){if(Array.isArray(e))return e}function Ye(e,t,n){return(t=it(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xe(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Ze(){throw TypeError(`Invalid attempt to destructure non-iterable instance. 2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Qe(Object(n),!0).forEach(function(t){Ye(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function et(e,t){if(e==null)return{};var n,r,i=tt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function tt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function nt(e,t){return Je(e)||Xe(e,t)||ot(e,t)||Ze()}function rt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function it(e){var t=rt(e,`string`);return typeof t==`symbol`?t:t+``}function at(e){"@babel/helpers - typeof";return at=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},at(e)}function ot(e,t){if(e){if(typeof e==`string`)return qe(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qe(e,t):void 0}}var W=function(e,t,n){var r=!!n,i=H.useRef(n);H.useEffect(function(){i.current=n},[n]),H.useEffect(function(){if(!r||!e)return function(){};var n=function(){if(i.current)return i.current.apply(i,arguments)};return e.on(t,n),function(){e.off(t,n)}},[r,t,e,i])},st=function(e){var t=H.useRef(e);return H.useEffect(function(){t.current=e},[e]),t.current},G=function(e){return e!==null&&at(e)===`object`},ct=function(e){return G(e)&&typeof e.then==`function`},lt=function(e){return G(e)&&typeof e.elements==`function`&&typeof e.createToken==`function`&&typeof e.createPaymentMethod==`function`&&typeof e.confirmCardPayment==`function`},ut=`[object Object]`,dt=function e(t,n){if(!G(t)||!G(n))return t===n;var r=Array.isArray(t);if(r!==Array.isArray(n))return!1;var i=Object.prototype.toString.call(t)===ut;if(i!==(Object.prototype.toString.call(n)===ut))return!1;if(!i&&!r)return t===n;var a=Object.keys(t),o=Object.keys(n);if(a.length!==o.length)return!1;for(var s={},c=0;c<a.length;c+=1)s[a[c]]=!0;for(var l=0;l<o.length;l+=1)s[o[l]]=!0;var u=Object.keys(s);if(u.length!==a.length)return!1;var d=t,f=n;return u.every(function(t){return e(d[t],f[t])})}
2,ft=function(e,t,n){return G(e)?Object.keys(e).reduce(function(r,i){var a=!G(t)||!dt(e[i],t[i]);return n.includes(i)?(a&&console.warn(`Unsupported prop change: options.${i} is not a mutable property.`),r):a?$e($e({},r||{}),{},Ye({},i,e[i])):r},null):null},pt="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",mt=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pt;if(e===null||lt(e))return e;throw Error(t)},ht=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pt;if(ct(e))return{tag:`async`,stripePromise:Promise.resolve(e).then(function(e){return mt(e,t)})};var n=mt(e,t);return n===null?{tag:`empty`}:{tag:`sync`,stripe:n}},gt=function(e){!e||!e._registerWrapper||!e.registerAppInfo||(e._registerWrapper({name:`react-stripe-js`,version:`6.8.2`}),e.registerAppInfo({name:`react-stripe-js`,version:`6.8.2`,url:`https://stripe.com/docs/stripe-js/react`}))},_t=H.createContext(null);_t.displayName=`ElementsContext`;var vt=function(e,t){if(!e)throw Error(`Could not find Elements context; You need to wrap the part of your app that ${t} in an <Elements> provider.`);return e},yt=function(e){var t=e.stripe,n=e.options,r=e.children,i=H.useMemo(function(){return ht(t)},[t]),a=nt(H.useState(function(){return{stripe:i.tag===`sync`?i.stripe:null,elements:i.tag===`sync`?i.stripe.elements(n):null}}),2),o=a[0],s=a[1];H.useEffect(function(){var e=!0,t=function(e){s(function(t){return t.stripe?t:{stripe:e,elements:e.elements(n)}})};return i.tag===`async`&&!o.stripe?i.stripePromise.then(function(n){n&&e&&t(n)}):i.tag===`sync`&&!o.stripe&&t(i.stripe),function(){e=!1}},[i,o,n]);var c=st(t);H.useEffect(function(){c!==null&&c!==t&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[c,t]);var l=st(n);return H.useEffect(function(){if(o.elements){var e=ft(n,l,[`clientSecret`,`fonts`]);e&&o.elements.update(e)}},[n,l,o.elements]),H.useEffect(function(){gt(o.stripe)},[o.stripe]),H.createElement(_t.Provider,{value:o},r)};yt.propTypes={stripe:U.default.any,options:U.default.object};var bt=function(e){return vt(H.useContext(_t),e)},xt=function(){return bt(`calls useElements()`).elements},St=function(e){var t=e.children;return t(bt(`mounts <ElementsConsumer>`))};St.propTypes={children:U.default.func.isRequired};var Ct=H.createContext(null);Ct.displayName=`CheckoutContext`;var wt=function(e){var t=H.useContext(Ct),n=H.useContext(_t);if(t){if(n)throw Error(`You cannot wrap the part of your app that ${e} in both a checkout provider and <Elements> provider.`);return t}else return vt(n,e)},Tt=[`mode`],Et=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},K=function(e,t,n){var r=`${Et(e)}Element`,i=t?function(e){wt(`mounts <${r}>`);var t=e.id,n=e.className;return H.createElement(`div`,{id:t,className:n})}:function(t){var n=t.id,i=t.className,a=t.options,o=a===void 0?{}:a,s=t.onBlur,c=t.onFocus,l=t.onReady,u=t.onChange,d=t.onEscape,f=t.onClick,p=t.onLoadError,m=t.onLoaderStart,h=t.onNetworksChange,g=t.onConfirm,_=t.onCancel,v=t.onShippingAddressChange,y=t.onShippingRateChange,b=t.onSavedPaymentMethodRemove,x=t.onSavedPaymentMethodUpdate,S=t.onAvailablePaymentMethodsChange,C=wt(`mounts <${r}>`),w=`elements`in C?C.elements:null,T=`checkoutState`in C?C.checkoutState:null,E=T?.type===`success`||T?.type===`loading`?T.sdk:null,D=nt(H.useState(null),2),O=D[0],k=D[1],A=H.useRef(null),j=H.useRef(null);W(O,`blur`,s),W(O,`focus`,c),W(O,`escape`,d),W(O,`click`,f),W(O,`loaderror`,p),W(O,`loaderstart`,m),W(O,`networkschange`,h),W(O,`confirm`,g),W(O,`cancel`,_),W(O,`shippingaddresschange`,v),W(O,`shippingratechange`,y),W(O,`savedpaymentmethodremove`,b),W(O,`savedpaymentmethodupdate`,x),W(O,`availablepaymentmethodschange`,S),W(O,`change`,u);var M;l&&(M=e===`expressCheckout`?l:function(){l(O)}),W(O,`ready`,M),H.useLayoutEffect(function(){if(A.current===null&&j.current!==null&&(w||E)){var t=null;if(E){var n=E,i=E;switch(e){case`paymentForm`:t=i.createForm(o);break;case`payment`:t=n.createPaymentElement(o);break;case`address`:if(`mode`in o){var a=o.mode,s=et(o,Tt);if(a===`shipping`)t=n.createShippingAddressElement(s);else if(a===`billing`)t=n.createBillingAddressElement(s);else throw Error(`Invalid options.mode. mode must be 'billing' or 'shipping'.`)}else throw Error(`You must supply options.mode. mode must be 'billing' or 'shipping'.`);break;case`expressCheckout`:t=n.createExpressCheckoutElement(o);break;case`currencySelector`:t=E.createCurrencySelectorElement();break;case`taxId`:t=n.createTaxIdElement(o);break;case`contactDetails`:t=n.createContactDetailsElement();break;case`terms`:t=n.createTermsElement(o);break;default:throw Error(`<${r}> is not supported inside a checkout provider. Use an <Elements> provider instead.`)}}else w&&(t=w.create(e,o));A.current=t,k(t),t&&t.mount(j.current)}},[w,E,o]);var N=st(o);return H.useEffect(function(){if(A.current){var e=ft(o,N,[`paymentRequest`]);e&&`update`in A.current&&A.current.update(e)}},[o,N]),H.useLayoutEffect(function(){return function(){if(A.current&&typeof A.current.destroy==`function`)try{A.current.destroy(),A.current=null}catch{}}},[]),H.createElement(`div`,{id:n,className:i,ref:j})};return i.propTypes={id:U.default.string,className:U.default.string,onChange:U.default.func,onBlur:U.default.func,onFocus:U.default.func,onReady:U.default.func,onEscape:U.default.func,onClick:U.default.func,onLoadError:U.default.func,onLoaderStart:U.default.func,onNetworksChange:U.default.func,onConfirm:U.default.func,onCancel:U.default.func,onShippingAddressChange:U.default.func,onShippingRateChange:U.default.func,onSavedPaymentMethodRemove:U.default.func,onSavedPaymentMethodUpdate:U.default.func,onAvailablePaymentMethodsChange:U.default.func,options:U.default.object},i.displayName=r,i.__elementType=e,i},q=typeof window>`u`,Dt=H.createContext(null);Dt.displayName=`EmbeddedCheckoutProviderContext`;var Ot=function(){return wt(`calls useStripe()`).stripe};K(`auBankAccount`,q),K(`card`,q),K(`cardNumber`,q),K(`cardExpiry`,q),K(`cardCvc`,q),K(`currencySelector`,q),K(`iban`,q);var kt=K(`payment`,q),At=K(`expressCheckout`,q);K(`paymentRequestButton`,q),K(`linkAuthentication`,q),K(`contactDetails`,q),K(`address`,q),K(`shippingAddress`,q),K(`paymentMethodMessaging`,q),K(`taxId`,q),K(`issuingCardNumberDis
2play`,q),K(`issuingCardCvcDisplay`,q),K(`issuingCardExpiryDisplay`,q),K(`issuingCardPinDisplay`,q),K(`issuingCardCopyButton`,q),K(`terms`,q);var jt=e=>{let t=Number(e?.participant?.baseTokensStaked??0),n=Number(e?.participant?.baseLpTokensHeld??0),r=Number(e?.staking?.base?.remove??0);if(!Number.isFinite(n)||n<=0||!Number.isFinite(r)||r<=0)return 0;let i=n/r;return!Number.isFinite(i)||i<=0?0:t>0?Math.min(t,i):i},Mt=(e,t,n)=>{let r=0;if(t&&t[n]?.active&&(t[n].percent>0||t[n].fixedFee>0)){let i=t[n],a=(e+(i?.fixedFee??0)/100)/(1-(i?.percent??0));r=i?.simple?E(e*(i?.percent??0)):E(a-e)}return r},Nt=e=>![`us`,`usa`,`united states`].includes((e||``).toLowerCase()),Pt=(e,t)=>{let n=Math.abs(e||0),r=(n+0/100)/.992;return E(Math.min(5,r-n),2,!0)},Ft=e=>(t,n,r=0)=>{let i=t-Math.max(0,r);return i<=0?0:Mt(i,n,Nt(e)?`international`:`default`)},It=e=>{let{property:t,orderBook:n,propertyInfo:r,isComingSoon:i,isSold:a}=e,o=(n?.orderBook?.sellOrders??[]).length>0,s=(n?.orderBook?.buyOrders??[]).length>0,c=te(t,1);r?.lastPrice;let l={bestBuyPrice:s?n?.ranges?.buy?.max??0:0,bestSellPrice:o?n?.ranges?.sell?.min??0:0,startingPrice:c?.totalPricePerToken??0,houseCanaryPrice:c?.houseCanaryPricePerToken??0,details:c};return i||!a||(l.startingPrice=c?.totalPricePerToken??0),l},Lt=e=>(e?.orderBook?.buyOrders??[]).length>0||(e?.orderBook?.sellOrders??[]).length>0,Rt=(e,t)=>
2{if(!e)return 0;let n=e.propertyAssets?.find(e=>e.assetId===t.assetId),r=n?.decimals??0;return E((n?.amount??0)/10**r,r,!1)},zt=(e,t,n)=>Rt(e&&(e.includes(w.LoftyWallet)||e.includes(`shared`))?t.find(e=>e.shared):t.find(e=>!e.shared),n),Bt=(e,t)=>e.map(e=>Rt(e,t)),Vt=(e,t)=>Bt(e,t).reduce((e,t)=>e+t,0),Ht=e=>{let t=jt(e);return t<=0?0:Math.round(t)},Ut=({screen:e,assetDecimals:t,isMarketOrder:n,isBuyOrder:r,pricePerToken:i})=>t>0?e===`fractional`?n&&i>0?`dollars`:`fractional-shares`:n&&r?`whole-shares`:`fractional-shares`:`whole-shares`,Wt=(e,t,n,r=0)=>{if(!Number.isFinite(e)||e<=0)return n;let i=Math.ceil(n/e/t-1e-9),a=Math.ceil(r/t-1e-9),o=Math.max(1,i,a)*t;return Math.max(n,Math.ceil(o*e*100)/100)},Gt=(e,t,n,r)=>{let i=e?.cryptoAssets?.find(e=>e.symbol===t),a=e?.cryptoAssets?.find(e=>e.assetId===0);if(!e||!i||!a)return{paymentWallet:null,currencyDecimals:0,totalCryptoPrice:n,totalIntegerPrice:0,availableCurrency:0,availableAlgo:0,hasPayment:!1,hasFee:!1};let o=i?.decimals??-1,s=n*10**o,c=i?.amount??0,l=a?.amount??0,u=l>=1e3;return i?.assetId===0&&(u=l>=s+1e3),r&&(u=!0),{paymentWallet:e,currencyDecimals:o,totalCryptoPrice:n,totalIntegerPrice:s,availableCurrency:c,availableAlgo:l,hasPayment:c>=s,hasFee:u}},Kt=(e,t,n,r)=>{let i=e?e.includes(w.LoftyWallet)||e.includes(`shared`):!1;return{wallets:Gt(i?r.find(e=>e.shared):r.find(e=>!e.shared),t,n,i)}},qt=e=>e===`bank_account`,Jt=e=>e===`card`,Yt=e=>e===`new_bank_account`,Xt=e=>!!e?.startsWith(`ba_`);function Zt(e){return(0,V.jsx)(`div`,{className:`mt-24 mb-8 h-96`,children:(0,V.jsxs)(`div`,{className:`max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center`,children:[(0,V.jsx)(`p`,{className:`text-slate-400 dark:text-slate-500 lofty-text-link`,children:`Page not found`}),(0,V.jsx)(`h1`,{className:`m-4 text-9xl font-bold text-slate-700 dark:text-slate-300`,children:`404`}),(0,V.jsx)(De,{to:e.to??`/`,children:e.linkText??`Go to home page`})]})})}var Qt={success:`bg-lofty-green/15 text-lofty-green-700 dark:bg-lofty-green/15 dark:text-lofty-green`,warning:`bg-lofty-yellow/15 text-lofty-yellow dark:bg-amber-400/15 dark:text-amber-300`,danger:`bg-lofty-error/10 text-lofty-error dark:bg-lofty-red/15 dark:text-lofty-red`,info:`bg-lofty/10 text-lofty dark:bg-lofty-purple/15 dark:text-lofty-purple`,neutral:`bg-lofty-purple-600/[0.07] text-lofty-gray-700 dark:bg-white/10 dark:text-lofty-gray-200`,primary:`bg-lofty-purple-50 text-lofty dark:bg-lofty-purple/20 dark:text-lofty-purple`};function $t({tone:e,label:t,className:n=``,dot:r=!0}){return(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 whitespace-nowrap rounded-full px-2.5 py-1 text-xs font-semibold leading-none ${Qt[e]} ${n}`,children:[r&&(0,V.jsx)(`span`,{"aria-hidden":!0,className:`h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-80`}),t]})}var J=`USDC`,en=`Order funding settles in your Lofty Wallet when the trade executes.`,tn=`Originating payment type`,Y=`UNKNOWN`,nn=`Shares`,rn=`Shares from your wallet are sold on the marketplace and settle to USDC when the trade executes.`,an={fundingSource:`Funding source`,settlementCurrency:`Settlement currency`},on={callout:tn,total:`Total`},sn={ach:`Bank Account`,"ach debit":`Bank Account`,algo:`ALGO`,algorand:`ALGO`,bank:`Bank Account`,"bank account":`Bank Account`,card:`Credit/Debit Card`,"credit card":`Credit/Debit Card`,"credit debit card":`Credit/Debit Card`,"debit card":`Credit/Debit Card`,defly:`Defly Wallet`,"defly wallet":`Defly Wallet`,external:`External Wallet`,"external wallet":`External Wallet`,gift:`Gift Balance`,"gift balance":`Gift Balance`,lofty:`Lofty Wallet`,"lofty wallet":`Lofty Wallet`,myalgo:`MyAlgo Wallet`,"myalgo wallet":`MyAlgo Wallet`,pera:`Pera Wallet`,"pera wallet":`Pera Wallet`,rent:`Rental Income`,"rental income":`Rental Income`,shared:`Lofty Wallet`,"shared wallet":`Lofty Wallet`,stbl:`USDC`,usdc:`USDC`},cn={calloutNote:en,defaultFundingSource:Y,displayLabel:`Payment Method`,fallbackFundingSourceLabel:Y,gradient:{dark:{from:`#1b2752ff`,to:`#394a88ff`},light:{from:`#f6f8ffff`,to:`#edf3f7ff`}},settlementCurrencyLabel:J,variant:`default`},ln={algo:{calloutNote:`Paid from your wallet in ALGO and converted to USDC at the current execution rate.`,defaultFundingSource:Y,dis
2playLabel:`ALGO`,fallbackFundingSourceLabel:Y,gradient:{dark:{from:`#16255fff`,to:`#3b50daff`},light:{from:`#eef3ffff`,to:`#e8ecffff`}},settlementCurrencyLabel:J,variant:`algo`},bank:{calloutNote:`ACH funding converts to USDC before execution so the order can settle in your Lofty Wallet.`,defaultFundingSource:Y,displayLabel:`Bank Account`,fallbackFundingSourceLabel:Y,gradient:{dark:{from:`#162e57ff`,to:`#2f5ea2ff`},light:{from:`#eef5ffff`,to:`#e6f0fbff`}},settlementCurrencyLabel:J,variant:`bank`},card:{calloutNote:`Converted to USDC before execution so the order can settle in your Lofty Wallet.`,defaultFundingSource:Y,displayLabel:`Credit/Debit Card`,fallbackFundingSourceLabel:Y,gradient:{dark:{from:`#1b2564ff`,to:`#4d3fedff`},light:{from:`#f4f0ffff`,to:`#ebf5ffff`}},settlementCurrencyLabel:J,variant:`card`},gift:{calloutNote:`Gift funds are applied first and converted to USDC before execution when needed.`,defaultFundingSource:Y,displayLabel:`Gift Balance`,fallbackFundingSourceLabel:Y,gradient:{dark:{from:`#3f2466ff`,to:`#6c45d2ff`},light:{from:`#f8efffff`,to:`#f0e8ffff`}},settlementCurrencyLabel:J,variant:`gift`},rent:{calloutNote:`Available rent is applied first and converted to USDC before the order executes.`,defaultFundingSource:Y,displayLabel:`Rental Income`,fallbackFundingSourceLabel:Y,gradient:{dark:{from:`#0d3a56ff`,to:`#2c7199ff`},light:{from:`#eef7ffff`,to:`#e7f2f8ff`}},settlementCurrencyLabel:J,variant:`rent`},usdc:{calloutNote:`No conversion required. The order settles directly from your wallet's USDC balance.`,defaultFundingSource:Y,displayLabel:`USDC`,fallbackFundingSourceLabel:Y,gradient:{dark:{from:`#1b2752ff`,to:`#394a88ff`},light:{from:`#f6f8ffff`,to:`#edf3f7ff`}},settlementCurrencyLabel:J,variant:`usdc`}},un=new Set([`complete`,`completed`,`executed`,`filled`,`success`,`successful`,`succeeded`]),dn=new Set([`ach`,`ach debit`,`bank`,`bank account`,`new bank`,`new bank account`]),fn=new Set([`card`,`credit card`,`credit debit card`,`debit card`]),pn=new Set([`gift`,`gift balance`]),mn=new Set([`rent`,`rental income`]),hn=new Set([`algo`,`algorand`,`defly`,`defly wallet`,`myalgo`,`myalgo wallet`,`pera`,`pera wallet`]),gn=new Set([`defly`,`defly wallet`,`external`,`external wallet`,`lofty`,`lofty wallet`,`myalgo`,`myalgo wallet`,`pera`,`pera wallet`,`shared`,`shared wallet`]),_n=new Set([`algo`]),vn=new Set([`stbl`,`usdc`]),yn=new Set([`lofty`,`lofty wallet`,`shared`,`shared wallet`]),bn=new Set([`defly`,`defly wallet`,`external`,`external wallet`,`myalgo`,`myalgo wallet`,`other`,`pera`,`pera wallet`]),xn=new Set([`algo`,`algorand`,`crypto`,`stbl`,`usdc`]),Sn=e=>e?.trim().toLowerCase()??``,X=e=>Sn(e).replace(/[/_-]+/g,` `).replace(/\s+/g,` `).trim(),Cn=e=>typeof e==`number`&&Number.isFinite(e),wn=e=>e.cryptoPurchase?.paymentMethod??e.paymentMethod??e.paymentSource??e.fundingSource,Tn=e=>e.fundingSource??e.paymentSource??e.transferFrom??e.cryptoPurchase?.transferFrom??e.cryptoPurchase?.paymentMethod??e.paymentMethod,En=e=>[e.paymentSource,e.transferFrom,e.cryptoPurchase?.transferFrom,e.cryptoPurchase?.paymentMethod,e.paymentMethod,...e.fundingSourceHints??[]],Dn=e=>X(wn(e)),On=e=>X(e.cryptoPurchase?.paymentCurrency??e.paymentCurrency),kn=e=>{let t=X(e);return t?t.endsWith(`s`)&&t.length>1?t.slice(0,-1):t:`share`},An=e=>{let t=X(e);return t?sn[t]?sn[t]:t.includes(`card`)?ln.card.displayLabel:t.includes(`bank`)||t.includes(`ach`)?ln.bank.displayLabel:t.includes(`gift`)?ln.gift.displayLabel:t.includes(`rent`)?ln.rent.displayLabel:t.split(` `).filter(Boolean).map(e=>sn[e]??`${e.charAt(0).toUpperCase()}${e.slice(1)}`).join(` `):cn.displayLabel},jn=e=>{let t=e?.trim();if(!t)return null;let n=X(t);return n&&!sn[n]?t:null},Mn=e=>{let t=X(e);return t?t===`wallet`?`lofty`:t===`other`?`external`:xn.has(t)?null:yn.has(t)||t===`wallet`||t.includes(`lofty`)||t.includes(`shared`)?`lofty`:bn.has(t)||t.includes(`external`)||t.includes(`pera`)||t.includes(`myalgo`)||t.includes(`defly`)?`external`:null:null},Nn=(e,t)=>{let n=!1;for(let r of e){let e=Mn(r);if(e===`lofty`)return`Lofty Wallet`;e===`external`&&(n=!0),t&&X(r)===`crypto`&&(n=!0)}return n?`External Wallet`:Y},Pn=(...e)=>Nn(e,!0),Fn=(...e)=>Nn(e,!1),In=e=>e.appliedGift??e.giftBalanceUsed??e.cryptoPurchase?.giftBalanceUsed??0,Ln=e=>e.appliedRent??e.rentalIncomeUsed??e.cryptoPurchase?.rentalIncomeUsed??0,Rn=e=>{let t=E(In(e),2),n=E(Ln(e),2);if(t<=0&&n<=0)return null;if(Cn(e.totalAmount)&&e.totalAmount>0){let r=E(Math.abs(e.totalAmount),2);if(t>=r&&t>=n)return`gift`;if(n>=r&&n>t)return`rent`}return Dn(e)?null:t>=n?`gift`:`rent`},zn=e=>!e||e==="default"?cn:ln[e],Bn=e=>{let t=Rn(e);if(t)return t;let n=Dn(e),r=On(e),i=_n.has(r)?`algo`:vn.has(r)?`usdc`:null;return pn.has(n)||n.includes(`gift`)?`gift`:mn.has(n)||n.includes(`rent`)?`rent`:fn.has(n)||n.includes(`card`)?`card`:dn.has(n)||n.includes(`ach`)||n.includes(`bank`)?`bank`:hn.has(n)?`algo`:n===`usdc`||n===`stbl`?`usdc`:gn.has(n)&&i||i?i:null},Vn=(e,t,...n)=>{let r=t?.trim(),i=n.find(e=>!!e?.trim());return e===`algo`||e===`usdc`?Fn(r,...n):r||jn(i)||(e?zn(e).fallbackFundingSourceLabel:i?An(i):cn.fallbackFundingSourceLabel)},Hn=e=>{let t=Bn(e),n=wn(e),r=Tn(e),i=En(e);if(!t){let t=An(n);return{calloutNote:cn.calloutNote,displayLabel:t,fundingSourceLabel:Vn(null,e.fundingSource,r),settlementCurrencyLabel:cn.settlementCurrencyLabel,variant:null}}let a=zn(t);return{calloutNote:a.calloutNote,displayLabel:a.displayLabel,fundingSourceLabel:Vn(t,e.fundingSource,...i),settlementCurrencyLabel:a.settlementCurrencyLabel,variant:t}},Un=({assetNoun:e=`share`,isExecuted:t,orderType:n,status:r,subtype:i})=>{let a=Sn(n),o=Sn(r),s=Sn(i),c=kn(e);return a===`market`||s===j.Liquidity?`Execution price per ${c}`:t||un.has(o)?`Executed price per ${c}`:`Limit price per ${c}`},Wn=({pmmV2QuoteFeeReceipt:e,aggregatedPoolFees:t,cryptoPurchase:n,excludeCryptoPurchaseFees:r=!1})=>{let i=r?0:n?.stripeFee??0,a=r?0:n?.exchangeFee??0,o=[{amount:E(i/100,2),key:`processingFee`,label:`Processing fee`}
2,{amount:E(a??0,2),key:`exchangeFee`,label:`Exchange fee`},{amount:E(e?.lpFeeUsd??(t?.lpFee??0)/1e6,2),key:`liquidityFee`,label:`Liquidity fee`},{amount:E(e?.maintainerFeeUsd??(t?.maintFee??0)/1e6,2),key:`maintenanceFee`,label:`Lofty fee`}].filter(e=>e.amount>0);return{items:o,total:E(o.reduce((e,t)=>e+t.amount,0),2)}},Gn=({calloutLabel:e=on.callout,calloutNote:t,calloutValue:n,detailLabels:r=an,feeRows:i=[],fundingSource:a,headline:o,leftPills:s,priceLabel:c,priceValue:l,propertyHref:u,propertyTitle:d,rightPill:f={label:`Order Detail`,tone:`neutral`},settlementCurrency:p,totalLabel:m=on.total,totalValue:h,variant:g})=>{let _=g??`default`,v=zn(_),y=n??v.displayLabel;return{calloutLabel:e,calloutNote:t??v.calloutNote,calloutValue:y,detailRows:[{emphasis:`strong`,label:r.fundingSource,value:a?.trim()||v.fallbackFundingSourceLabel,wrap:!0},{emphasis:`strong`,label:r.settlementCurrency,value:p??v.settlementCurrencyLabel},{emphasis:`headline`,label:c,value:l}],feeRows:i,headline:o??y,leftPills:s,propertyHref:u,propertyTitle:d,rightPill:f,totalRow:h?{emphasis:`headline`,label:m,value:h}:void 0,variant:_}},Kn=(e,t,n)=>({feeBreakdown:Wn(t),labels:an,origin:Hn(e),priceLabel:Un(n)}),qn=e=>Cn(e.price)&&Cn(e.totalQuantity??e.quantity)?Math.abs(e.price*(e.totalQuantity??e.quantity)):Cn(e.amountToCommit)?Math.abs(e.amountToCommit):null,Jn=e=>{if(Cn(e.total))return Math.abs(e.total);if(Cn(e.amount)){let t=e.units??(e.subtype===j.Redemption?1:100);return Math.abs(e.amount)/t}return null},Yn=({cryptoPurchase:e,fundingSource:t,fundingSourceHints:n,order:r,orderType:i=`limit`,productNoun:a=`share`,paymentSource:o})=>Kn({appliedGift:r.appliedGift,appliedRent:r.appliedRent,cryptoPurchase:e,fundingSource:t,fundingSourceHints:n,paymentCurrency:r.paymentCurrency,paymentMethod:r.paymentMethod,paymentSource:o,totalAmount:qn(r)},{cryptoPurchase:e},{assetNoun:a,orderType:i,status:r.status}),Xn=({cryptoPurchase:e,fundingSource:t,fundingSourceHints:n,productNoun:r=`share`,status:i,transaction:a})=>{let o=Sn(a.subtype)===j.Liquidity?`market`:`limit`;return Kn({cryptoPurchase:e??a.cryptoPurchase??null,fundingSource:t,fundingSourceHints:n,giftBalanceUsed:a.giftBalanceUsed,paymentCurrency:a.paymentCurrency,paymentMethod:a.paymentMethod,paymentSource:a.paymentSource,rentalIncomeUsed:a.rentalIncomeUsed,totalAmount:a.pmmV2QuoteFeeReceipt?.quoteAmount??Jn(a),transferFrom:a.transferFrom},{aggregatedPoolFees:a.aggregatedPoolFees,pmmV2QuoteFeeReceipt:a.pmmV2QuoteFeeReceipt,cryptoPurchase:e??a.cryptoPurchase??null,excludeCryptoPurchaseFees:o===`market`},{assetNoun:r,orderType:o,status:i??a.status,subtype:a.subtype})},Zn=`bg-[linear-gradient(120deg,var(--payment-callout-light-from)_0%,var(--payment-callout-light-to)_100%)] dark:bg-[linear-gradient(120deg,var(--payment-callout-dark-from)_0%,var(--payment-callout-dark-to)_100%)]`,Qn=e=>{let t=`mx-auto w-full max-w-[520px] space-y-[18px]`;return e?`${t} ${e}`:t},$n=e=>{let{gradient:t}=zn(e);return{"--payment-callout-dark-from":t.dark.from,"--payment-callout-dark-to":t.dark.to,"--payment-callout-light-from":t.light.from,"--payment-callout-light-to":t.light.to}},er=e=>e.emphasis===`headline`?`text-22 font-bold text-lofty-purple-600 dark:text-white`:e.emphasis===`strong`?`text-18 font-semibold text-lofty-purple-600 dark:text-white`:`text-base font-semibold text-lofty-purple-600 dark:text-white`,tr=({pill:e})=>(0,V.jsx)(`span`,{className:`inline-flex items-center whitespace-nowrap rounded-full px-2.5 py-1 text-xs font-semibold leading-none ${Qt[e.tone]}`,children:e.label}),nr=({row:e})=>(0,V.jsxs)(`div`,{className:`flex flex-col gap-1.5 sm:flex-row sm:items-center sm:justify-between sm:gap-4`,children:[(0,V.jsx)(`dt`,{className:`shrink-0 text-14 font-medium text-lofty-gray-700 dark:text-lofty-gray-200`,children:e.label}),(0,V.jsx)(`dd`,{className:`m-0 break-words text-left leading-tight sm:max-w-[60%] sm:text-right ${er(e)} ${e.wrap?``:`sm:whitespace-nowrap`}`,children:e.value})]}),rr=({className:e,rows:t})=>(0,V.jsx)(`dl`,{className:e,children:t.map(e=>(0,V.jsx)(nr,{row:e},`${e.label}-${e.value}`))}),ir=({headingId:e,href:t,title:n})=>{let r=`break-words text-2xl font-bold leading-tight text-lofty-purple-600 dar
2k:text-white`;return t?(0,V.jsx)(`h3`,{id:e,className:r,children:(0,V.jsx)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`transition-colors hover:text-lofty dark:hover:text-lofty-link`,children:n})}):(0,V.jsx)(`h3`,{id:e,className:r,children:n})},ar=({className:e,footer:t,model:n})=>{let r=(0,H.useId)(),i=(0,H.useId)();return(0,V.jsxs)(`div`,{className:Qn(e),children:[n.headline&&(0,V.jsx)(`h2`,{className:`break-words text-[clamp(1.625rem,6vw,1.75rem)] font-bold leading-[1.1] text-lofty-purple-600 dark:text-white`,children:n.headline}),(0,V.jsxs)(`article`,{"aria-labelledby":r,className:`overflow-hidden rounded-[24px] border border-lofty-gray-300 bg-white p-5 shadow-cardLight dark:border-lofty-purple-500 dark:bg-lofty-purple-700 dark:shadow-cardDark sm:p-6`,"data-testid":`payment-origin-detail-card`,"data-variant":n.variant,children:[(0,V.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,V.jsx)(`div`,{className:`flex min-w-0 flex-wrap gap-2`,children:n.leftPills.map(e=>(0,V.jsx)(tr,{pill:e},`${e.label}-${e.tone}`))}),(0,V.jsx)(`div`,{className:`flex w-full justify-start sm:w-auto sm:justify-end`,children:(0,V.jsx)(tr,{pill:n.rightPill})})]}),(0,V.jsx)(ir,{headingId:r,href:n.propertyHref,title:n.propertyTitle}),(0,V.jsxs)(`section`,{"aria-labelledby":i,className:`rounded-[20px] px-5 py-5 ${Zn}`,"data-testid":`payment-origin-callout`,style:$n(n.variant),children:[(0,V.jsx)(`p`,{id:i,className:`text-12 font-bold tracking-[0.033rem] text-lofty-purple-600/58 dark:text-lofty-purple-50/82`,children:n.calloutLabel}),(0,V.jsx)(`p`,{className:`mt-2 break-words text-[clamp(1.75rem,7vw,1.875rem)] font-bold leading-[1.05] text-lofty-purple-600 dark:text-white`,children:n.calloutValue}),(0,V.jsx)(`p`,{className:`mt-3 text-14 font-medium leading-[1.45] text-lofty-purple-600/78 dark:text-lofty-purple-50`,children:n.calloutNote})]}),(0,V.jsx)(rr,{className:`space-y-3`,rows:n.detailRows}),n.feeRows.length>0&&(0,V.jsx)(rr,{className:`space-y-3 border-t border-lofty-gray-100 pt-4 dark:border-lofty-purple-500/30`,rows:n.feeRows}),n.totalRow&&(0,V.jsx)(rr,{className:`space-y-3 border-t border-lofty-gray-200 pt-4 dark:border-lofty-purple-500/40`,rows:[n.totalRow]})]}),t&&(0,V.jsx)(`div`,{className:`mt-5`,children:t})]})]})},Z=`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-lofty/40 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-lofty-purple-800`,or=`rounded-2xl border border-lofty-gray-300 bg-white dark:border-lofty-purple-500 dark:bg-lofty-purple-700`,sr=`border-lofty-gray-300 dark:border-lofty-purple-500`,cr=`divide-lofty-gray-300 dark:divide-lofty-purple-500`,lr=`text-[11px] font-semibold uppercase tracking-[0.18em] text-lofty dark:text-lofty-purple`,ur=`text-3xl font-bold tracking-tight text-lofty-purple-600 dark:text-white sm:text-4xl`,dr=`mt-2 max-w-2xl text-sm leading-6 text-lofty-gray-700 dark:text-lofty-gray-200 sm:text-base`,fr=`text-lg font-semibold tracking-tight text-lofty-purple-600 dark:text-white`,pr=`text-lofty-gray-700 dark:text-lofty-gray-200`,mr=`font-semibold tabular-nums tracking-tight text-lofty-purple-600 dark:text-white`,hr=`font-semibold tabular-nums tracking-tight text-lofty-green-700 dark:text-lofty-green`,gr=[`block w-full rounded-[10px] border border-lofty-purple-600/20 bg-white text-sm text-lofty-purple-600 transition-colors`,`placeholder:text-lofty-purple-600/40 focus:border-lofty focus:outline-none focus:ring-0`,`dark:border-lofty-gray/20 dark:bg-lofty-purple-800 dark:text-white dark:placeholder:text-lofty-gray/40 dark:focus:border-lofty-purple`].join(` `),_r=`block text-[13px] font-medium text-lofty-purple-600/60 dark:text-lofty-gray/60`,vr=[`inline-flex items-center justify-center gap-2 rounded-full border-2 border-transparent bg-lofty px-5 py-2.5 text-sm font-bold text-white transition-colors`,`hover:bg-lofty-purple-600 disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-lofty`,`dark:hover:bg-lofty-purple dark:disabled:hover:bg-lofty`,Z].join(` `),yr=[`inline-flex items-center justify-center gap-2 rounded-full border-2 border-lofty px-5 py-2.5 text-sm font-bold text-lofty transition-colors`,`hover:bg-lofty hover:text-white disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent disabled:hover:text-lofty`,`dark:border-lofty-purple dark:text-lofty-purple dark:hover:bg-lofty-purple dark:hover:text-lofty-purple-800`,`dark:disabled:hover:bg-transparent dark:disabled:hover:text-lofty-purple`,Z].join(` `),br=[`inline-flex items-center justify-center gap-2 rounded-full border-2 border-lofty-error px-5 py-2.5 text-sm font-bold text-lofty-error transition-colors`,`hover:bg-lofty-error hover:text-white disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent disabled:hover:text-lofty-error`,`dark:border-lofty-red dark:text-lofty-red dark:hover:bg-lofty-red dark:hover:text-white`,`dark:disabled:hover:bg-transparent dark:disabled:hover:text-lofty-red`,Z].join(` `),xr=[`inline-flex items-center justify-center gap-2 rounded-[3px] bg-lofty/10 px-4 text-sm font-semibold text-lofty transition-colors`,`hover:bg-lofty hover:text-white disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-lofty/10 disabled:hover:text-lofty`,`dark:bg-lofty-purple dark:text-white dark:hover:bg-lofty`,Z].join(` `),Sr=[`inline-flex items-center justify-center gap-2 rounded-full px-3.5 text-sm font-semibold text-lofty-gray-700 transition-colors`,`hover:bg-lofty-gray-100 hover:text-lofty-purple-600 disabled:cursor-not-allowed disabled:opacity-40`,`dark:text-lofty-gray-200 dark:hover:bg-lofty-purple-600 dar
2k:hover:text-white`,Z].join(` `),Cr=`inline-flex items-center gap-1.5 text-sm font-semibold text-lofty-error transition-colors hover:text-lofty-lightNegative disabled:cursor-not-allowed disabled:opacity-50 dark:text-lofty-red`;[`inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full text-lofty-gray-700 transition-colors`,`hover:bg-lofty/10 hover:text-lofty dark:text-lofty-gray-200 dark:hover:bg-lofty-gray/10 dark:hover:text-white`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-lofty/40`].join(` `);var wr=`font-semibold text-lofty transition-colors hover:text-lofty-purple-600 dark:text-lofty-purple dark:hover:text-white`,Tr=`rounded-[10px] border border-lofty bg-lofty px-3 py-2.5 text-sm font-semibold text-white transition-colors ${Z}`,Er=`rounded-[10px] border border-lofty-purple-600/20 bg-white px-3 py-2.5 text-sm font-semibold text-lofty-purple-600 transition-colors hover:border-lofty hover:bg-lofty/5 dark:border-lofty-gray/20 dark:bg-transparent dark:text-white dark:hover:border-lofty-purple dark:hover:bg-lofty-purple/10 ${Z}`,Dr=`inline-flex items-center rounded-[3px] bg-lofty/10 px-1.5 py-0.5 text-[11px] font-medium text-lofty dark:bg-lofty-purple/15 dark:text-lofty-purple`,Or=`px-4 py-3 text-[11px] font-semibold uppercase tracking-[0.12em] text-lofty-gray-700 dark:text-lofty-gray-200`,kr=`transition-colors hover:bg-lofty/[0.04] dark:hover:bg-white/[0.04]`,Ar={container:`w-full max-w-md border-none pb-4 sm:pb-0 font-abc-favorit-arabic-trial !shadow-transactCard dark:!shadow-cardDark`,containerColors:`bg-white dark:bg-lofty-purple-700`,content:`flex flex-col p-6 relative`,overflow:`hidden`},Q=({className:e})=>(0,V.jsx)(`div`,{className:`animate-pulse rounded bg-lofty-gray-300 dark:bg-lofty-purple-500/30 ${e}`}),jr=e=>`${v(E(e,2),{minimumFractionDigits:2,maximumFractionDigits:2})} USD`,Mr=e=>e?.trim().toLowerCase()??``,Nr=e=>e?.replace(/[_-]+/g,` `).split(` `).filter(Boolean).map(e=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`).join(` `)??``,Pr=e=>typeof e==`number`&&Number.isFinite(e),Fr=e=>{if(!(!e.slug||typeof window>`u`))return`${window.location.origin}/property_deal/${e.slug}`},Ir=({paymentMethod:e,paymentMethodObject:t})=>{if(!t)return;let n=t.last4?.trim(),r=t.bankName?.trim(),i=t.displayName?.trim(),a=t.name?.split(`:`)[0]?.trim(),o=Mr(e??t.type??t.symbol??i??a);if(n&&o.includes(`card`))return`Saved card ending in ${n}`;if(o.includes(`ach`)||o.includes(`bank`)){if(r&&n)return`${r} ending in ${n}`;if(r)return r}return i||a||void 0},Lr=e=>e?[e.type,e.symbol,e.displayName,e.name?.split(`:`)[0]?.trim()]:[],Rr=e=>{let t=e.units??(e.subtype===j.Redemption?1:100);return Pr(e.backfilledTotal)?Math.abs(e.backfilledTotal/t):Pr(e.amount)?Math.abs(e.amount/t):null},zr=({quantityFilled:e=0,status:t,subType:n,totalQuantity:r=0})=>{let i=Mr(t);return e>0&&e<r&&[`active`,`executed`,`executing`,`pending`].includes(i)?{label:`Partially Filled`,tone:`info`}:[`executed`,`filled`].includes(i)?{label:`Filled`,tone:`success`}:i===`active`?{label:`Open`,tone:`info`}:i===`cancelled`||i===`canceled`?{label:[R.USER_CANCEL,R.USER_SIGN_CANCEL].includes(n)?`Canceled by user`:`Canceled`,tone:`danger`}:i===`expired`?{label:`Expired`,tone:`neutral`}:[`pending`,`intent`].includes(i)?{label:`Pending`,tone:`warning`}:i===`executing`?{label:`Processing`,tone:`warning`}:{label:Nr(i)||`Open`,tone:`neutral`}},Br=e=>{let t=Mr(e);return[S.Pending,S.PaymentPending,S.PendingKYC,S.PendingReview].includes(t)?{label:`Pending`,tone:`warning`}:[S.Canceled,`cancelled`].includes(t)?{label:`Canceled`,tone:`danger`}:t===S.Failed?{label:`Failed`,tone:`danger`}:t===S.Refunded?{label:`Refunded`,tone:`neutral`}:([`complete`,`completed`,`executed`,`filled`,S.Success].includes(t),{label:`Complete`,tone:`success`})},Vr=e=>{if(!e.length)return[];let t=E(e.reduce((e,t)=>e+t.amount,0),2);return[...e.map(e=>({label:e.label,value:jr(e.amount)})),{emphasis:`strong`,label:`Total fees`,value:jr(t)}]},Hr=({direction:e,orderType:t})=>({label:`${Nr(t)} ${Nr(e)}`,tone:`primary`}),Ur=({direction:e,isSellback:t,orderType:n})=>({label:t?`Sellback`:`${Nr(n)} ${Nr(e)}`,tone:`primary`}),Wr=()=>(0,V.jsx)(`div`,{className:`overflow-x-hidden px-4 py-5 sm:px-6 sm:py-6`,children:(0,V.jsxs)(`div`,{className:`mx-auto w-full max-w-[520px] space-y-4`,children:[(0,V.jsx)(Q,{className:`h-8 w-48`}),(0,V.jsxs)(`div`,{className:`rounded-[24px] border border-lofty-gray-300 bg-white p-5 shadow-cardLight dark:border-lofty-purple-500 dark:bg-lofty-purple-700 dark:shadow-cardDark sm:p-6`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2.5`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,V.jsx)(Q,{className:`h-8 w-24 rounded-full`}),(0,V.jsx)(Q,{className:`h-8 w-16 rounded-full`})]}),(0,V.jsx)(Q,{className:`h-8 w-28 rounded-full`})]}),(0,V.jsx)(Q,{className:`mt-4 h-8 w-3/4`}),(0,V.jsxs)(`div`,{className:`mt-4 rounded-[20px] px-5 py-5`,children:[(0,V.jsx)(Q,{className:`h-3 w-32`}),(0,V.jsx)(Q,{className:`mt-3 h-10 w-2/3`}),(0,V.jsx)(Q,{className:`mt-4 h-4 w-full`}),(0,V.jsx)(Q,{className:`mt-2 h-4 w-5/6`})]}),(0,V.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,V.jsx)(Q,{className:`h-5 w-full`}),(0,V.jsx)(Q,{className:`h-5 w-full`}),(0,V.jsx)(Q,{className:`h-6 w-full`})]}),(0,V.jsxs)(`div`,{className:`mt-4 space-y-3 border-t border-lofty-gray-100 pt-4 dark:border-lofty-purple-500/30`,children:[(0,V.jsx)(Q,{className:`h-5 w-full`}),(0,V.jsx)(Q,{className:`h-5 w-full`}),(0,V.jsx)(Q,{className:`h-5 w-full`})]}),(0,V.jsx)(`div`,{className:`mt-4 border-t border-lofty-gray-200 pt-4 dark:border-lofty-purple-500/40`,children:(0,V.jsx)(Q,{className:`h-6 w-full`})}),(0,V.jsx)(`div`,{className:`mt-5`,children:(0,V.jsx)(Q,{className:`h-10 w-full rounded-lg`})})]})]})}),Gr=({paymentSource:e,property:t,onOpenUpdates:n,onCancelOrder:r,isCancellable:i=!1,isCancelling:a=!1,order:o,cryptoPurchase:s})=>{let c=o.direction===_.Sell,l=o.orderType===`market`?`market`:`limit`,u=Number(o.totalQuantity??o.quantity??0),d=Number(o.quantityFilled??0),f=Number(o.price??0),p=Ir({paymentMethod:s?.paymentMethod??o.paymentMethod,paymentMethodObject:o.paymentMethodObject}),m=Lr(o.paymentMethodObject),h=c?Pn(e,s?.transferFrom,s?.paymentMethod,o.paymentMethod,p,...m):void 0,g=c?Kn({fundingSource:p,fundingSourceHints:m,paymentSource:e,totalAmount:E(u*f,2)},{cryptoPurchase:s},{assetNoun:`share`,orderType:l,status:o.status}):Yn({cryptoPurchase:s,fundingSource:p,fundingSourceHints:m,order:o,orderType:l,paymentSource:e,productNoun:`share`}),v=Vr(g.feeBreakdown.items),y=E(u*f+g.feeBreakdown.total,2),b=g.origin.variant===`rent`||g.origin.variant===`gift`,x=g.origin.fundingSourceLabel===`UNKNOWN`&&b&&e?e:g.origin.fundingSourceLabel;return(0,V.jsx)(`div`,{className:`overflow-x-hidden px-4 py-5 sm:px-6 sm:py-6`,children:(0,V.jsx)(ar,{footer:(0,V.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:n,className:`${yr}
2 w-full sm:flex-1`,children:[(0,V.jsx)(`i`,{"aria-hidden":!0,className:`far fa-clock-rotate-left text-xs`}),`See order updates`]}),i&&r&&(0,V.jsxs)(`button`,{type:`button`,disabled:a,onClick:r,className:`${br} w-full sm:w-auto sm:min-w-[156px]`,children:[a&&(0,V.jsx)(he,{className:`h-4 w-4`}),a?`Canceling...`:`Cancel Order`]})]}),model:Gn({calloutNote:c?rn:g.origin.calloutNote,calloutValue:c?nn:g.origin.displayLabel,feeRows:v,fundingSource:c?h:x,leftPills:[Hr({direction:o.direction,orderType:l}),zr({quantityFilled:d,status:o.status,subType:o.subType,totalQuantity:u})],priceLabel:g.priceLabel,priceValue:jr(f),propertyHref:Fr(t),propertyTitle:t.address,rightPill:{label:`Order Detail`,tone:`neutral`},settlementCurrency:o.direction===_.Sell?`USDC`:g.origin.settlementCurrencyLabel,totalValue:jr(y),variant:c?null:g.origin.variant})})})},Kr=({property:e,order:t,status:n=`executed`})=>{let r=t,i=Number(r.quantity||r.tokens||0),a=r.pmmV2QuoteFeeReceipt,o=a?.quoteAmount??Rr(r),s=r.direction??r.type??se.Buy,c=r.subtype===j.Liquidity,l=r.orderType??(c?`market`:`limit`),u=r.subtype===j.Sellback,d=u||s===_.Sell||s===se.Sell,f=(i>0&&Pr(o)?a?E(a.principalUsd/i,2):E(o/i,2,!1):null)??(Pr(r.price)?Math.abs(r.price):0),p=Ir({paymentMethod:r.paymentMethod,paymentMethodObject:r.paymentMethodObject}),m=Lr(r.paymentMethodObject),h=d?Pn(r.paymentSource,r.transferFrom,r.cryptoPurchase?.transferFrom,r.cryptoPurchase?.paymentMethod,r.paymentMethod,p,...m):void 0,g=d?Kn({fundingSource:p,fundingSourceHints:m,paymentSource:r.paymentSource??r.paymentMethod,totalAmount:o??(Pr(r.total)?Math.abs(r.total):null)},{aggregatedPoolFees:r.aggregatedPoolFees,pmmV2QuoteFeeReceipt:a,cryptoPurchase:r.cryptoPurchase??null,excludeCryptoPurchaseFees:c},{assetNoun:`share`,orderType:c?`market`:`limit`,status:r.status??n,subtype:r.subtype}):Xn({cryptoPurchase:r.cryptoPurchase??null,fundingSource:p,fundingSourceHints:m,productNoun:`share`,status:r.status??n,transaction:r}),v=Vr(g.feeBreakdown.items),y=o??(Pr(r.total)?Math.abs(r.total):0),b=E(a?.quoteAmount??y+g.feeBreakdown.total,2);return(0,V.jsx)(`div`,{className:`overflow-x-hidden px-4 py-5 sm:px-6 sm:py-6`,children:(0,V.jsx)(ar,{model:Gn({calloutNote:d?rn:g.origin.calloutNote,calloutValue:d?nn:g.origin.displayLabel,feeRows:v,fundingSource:d?h:g.origin.fundingSourceLabel,leftPills:[Ur({direction:s,isSellback:u,orderType:l}),Br(r.status??n)],priceLabel:g.priceLabel,priceValue:jr(f),propertyHref:Fr(e),propertyTitle:e.address,rightPill:{label:`Order Detail`,tone:`neutral`},settlementCurrency:d?`USDC`:g.origin.settlementCurrencyLabel,totalValue:jr(b),variant:d?null:g.origin.variant})})})},qr={missing_cardholder_name:`your saved card has no cardholder name - please re-add your card`,cardholder_name_mismatch:`the name on your saved card must match your Lofty account name`,wrong_payment_method:`your saved card is not available for this account - please choose another payment method`,"card_declined:do_not_honor":`your bank declined the charge - contact your bank or use another payment method`,"card_declined:insufficient_funds":`your card was declined for insufficient funds`,"card_declined:fraudulent":`your bank flagged the charge - contact your bank or use another payment method`,"card_declined:generic_decline":`your card was declined by your bank`,"card_declined:expired_card":`your card has expired - please update your card`,payment_blocked:`the card charge was blocked before it reached your bank - please try again or use another payment method`,payment_failed_unclassified:`the card charge could not be completed - please try again or use another payment method`,payment_method_invalid:`your saved card can no longer be charged - please remove and re-add your card`,authentication_required:`this card needs extra authentication that cannot run after matching - please try again from checkout`,funding_retry_exhausted:`we could not fund this order in time - please try again`},Jr=e=>{if(e)return qr[e]??(e.startsWith(`card_declined`)?`your card was declined by your bank`:void 0)},Yr=e=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`,Xr=(e,t)=>
2t===R.PAYMENT_DECLINED||!!e?.startsWith(`card_declined`),Zr=e=>{let t=Jr(e.cancelReason);if(t)return{title:Xr(e.cancelReason,e.subType)?`Card declined`:`Payment failed`,text:`Nothing was purchased. ${Yr(t)}.`};if(e.subType===R.PAYMENT_DECLINED)return{title:`Card declined`,text:`Nothing was purchased. Please try a different payment method.`}},Qr=({label:e,value:t,crypto:n=!1})=>(0,V.jsxs)(`div`,{className:`flex flex-col`,children:[(0,V.jsxs)(`span`,{className:`text-sm font-semibold tabular-nums text-lofty-purple-600 dark:text-white`,children:[n?``:`$`,t]}),(0,V.jsx)(`span`,{className:`text-xs text-lofty-gray-700 dark:text-lofty-gray-200`,children:e})]}),$r=(e,t,n,r,i)=>{let a=`Cancelled ${n} of ${r} ${t}`,o=Jr(i);if(o)return`${a} - ${o}`;switch(e){case R.INSUFFICIENT_FUNDS:return`${a} - insufficient wallet balance`;case R.FUNDING_FAILED:return`${a} - funding error`;case R.PAYMENT_DECLINED:return`${a} - payment method declined`;case R.LP_MATCH_CANCEL:return`Matched with market order â ${n} of ${r} ${t} executed`;default:return a}},ei=e=>e===`execute`?`bg-lofty-green-700 dark:bg-lofty-green`:e===`cancel`||e===`expired`?`bg-lofty-error dark:bg-lofty-red`:`bg-lofty dark:bg-lofty-purple`,ti=({stream:e,orderSubType:t,isLast:n})=>{let{quantity:r,totalQuantity:i,type:a,direction:o,createdAt:s,currency:c,price:l,swappedAmount:u}=e,d=T(i,`share`).word,f=`Bought ${r} of ${i} ${d}`,p=`Sold ${r} of ${i} ${d}`,m=`Order for ${r} of ${i} ${d} expired`,h=$r(t,d,r,i,e.cancelReason),g=`Signed ${r} of ${i} ${d}`,v=a===`execute`&&o===_.Buy?f:a===`execute`&&o===_.Sell?p:a===`sign`?g:a===`create`?`Submitted order`:a===`expired`?m:a===`cancel`?h:a;return(0,V.jsxs)(`li`,{className:`relative flex gap-4 pb-6 last:pb-0`,children:[!n&&(0,V.jsx)(`span`,{"aria-hidden":!0,className:`absolute left-[5px] top-4 h-full w-px bg-lofty-gray-300 dark:bg-lofty-purple-500`}),(0,V.jsx)(`span`,{"aria-hidden":!0,className:`mt-1.5 h-[11px] w-[11px] shrink-0 rounded-full ring-4 ring-white dark:ring-lofty-purple-700 ${ei(a)}`}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`p`,{className:`text-sm font-semibold tracking-tight text-lofty-purple-600 dark:text-white`,children:v}),(0,V.jsxs)(`p`,{className:`mt-0.5 text-xs text-lofty-gray-700 dark:text-lofty-gray-200`,children:[xe(s,`h:mma`),` on `,xe(s,`MMMM dd, yyyy`)]}),a===`execute`&&(0,V.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-6 rounded-[10px] border border-lofty-gray-300 px-4 py-3 dark:border-lofty-purple-500`,children:[(0,V.jsx)(Qr,{label:`Share price`,value:k(l,2)}),(0,V.jsx)(Qr,{label:`USD value`,value:k(l*r,2)}),(0,V.jsx)(Qr,{label:`${c?.toUpperCase()} value`,value:M(u/10**6,{minimumFractionDigits:0,maximumFractionDigits:6}),crypto:!0})]})]})]})},ni=({updates:e,order:t})=>{let n=e.filter(e=>![`sign`,`intent`].includes(e.type));return(0,V.jsxs)(`div`,{className:`px-5 py-5 sm:px-6`,children:[(0,V.jsxs)(`p`,{className:`mb-5 font-mono text-xs text-lofty-gray-700 dark:text-lofty-gray-200`,children:[`Order #`,t.appId??0]}),(0,V.jsx)(`ol`,{children:n.map((e,r)=>(0,V.jsx)(ti,{stream:e,orderSubType:t.subType,isLast:r===n.length-1},e.id))})]})},ri=({onClose:e,label:t=`Close order detail`})=>(0,V.jsx)(`button`,{type:`button`,"aria-label":t,onClick:e,className:`inline-flex h-10 w-10 items-center justify-center rounded-full border border-lofty-gray-300 bg-white text-lofty-purple-600 transition-colors hover:border-lofty hover:bg-lofty/10 hover:text-lofty focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-lofty/40 dark:border-lofty-purple-500 dark:bg-lofty-purple-700 dark:text-white dark:hover:border-lofty-purple dark:hover:bg-lofty-purple/15 dark:hover:text-lofty-purple`,children:(0,V.jsx)(`i`,{"aria-hidden":!0,className:`far fa-xmark text-sm`})}),ii=`bg-lofty-gray-100 text-lofty-purple-600 dark:bg-lofty-purple-800 dark:text-white`,ai=({children:e,isModalOpen:t,onClose:n})=>(0,V.jsx)(l,{id:`orderDetailModal`,isOpen:t,onBackdropClick:n,onRequestClose:n,className:{container:`border-none h-[calc(100vh-1rem)] supports-[height:100dvh]:h-[calc(100dvh-1rem)] w-[calc(100vw-1rem)] rounded-[24px] font-abc-favorit-arabic-trial sm:h-auto sm:max-h-[92vh] sm:supports-[height:100dvh]:max-h-[92dvh] sm:w-[calc(100vw-2rem)] sm:max-w-[576px] sm:rou
2nded-[28px]`,containerColors:`bg-white border-white text-lofty-purple-600 dark:bg-lofty-purple-700 dark:border-lofty-purple-700 dark:text-white`,content:`m-0 flex h-full flex-col p-0`,overflow:`hidden`},minHeight:`auto`,showCloseBtn:!1,children:e}),oi=({property:e,propertyId:t,orderId:r,direction:i,onClose:s,onOrderCanceled:u})=>{let[d,f]=(0,H.useState)({order:null,property:null,streams:[],cryptoPurchase:null}),[p,m]=(0,H.useState)(!0),[h,_]=(0,H.useState)(!1),v=a(),[y,S]=(0,H.useState)({otp:null,modeRequired:b.None,error:null,mfaRequest:null}),C=a(),T=o(),E=n(),D=r??E.id,O=d.order&&[`active`].includes(d.order?.status),k=()=>d.streams.length>0&&v.openModal(),j=()=>v.closeModal(),M=async()=>e||(t?(await we(t)).data:null),P=async()=>{try{let[e,t,n]=await Promise.all([A(D),g(D).catch(()=>null),M()]),r=e.data;if(!r)throw e.error;f({order:r.order,cryptoPurchase:t?.data??null,property:n,streams:e.data.streams.map(t=>({...t,direction:e.data.order.direction,decimals:e.data.order.exchangeRateDecimals??0,totalQuantity:e.data.order.totalQuantity??0,currency:t.paymentMethod||e.data.order.paymentCurrency,quantity:t.quantity||e.data.order.quantity-e.data.streams.reduce((e,t)=>t.type===`execute`?e+t.quantity:e,0)}))})}catch(e){let t=e instanceof Error?e.message:`Unknown error`;B.fire({text:`An error was encountered while loading the order: ${t}`})}m(!1)},F=async e=>{if((e.code||e.token)&&e.AccessToken){let t={code:e.code??``,token:e.token??``},n={otp:t,AccessToken:e.AccessToken,target:`TOTP.MarketplaceCancel`};return S(e=>({...e,otp:t,mfaRequest:n})),await Promise.resolve(!1)}return await Promise.resolve(!0)},I=async()=>{if(!(!d.order?.id||!d.property))try{_(!0),S(e=>({...e,error:null}));let e=await ee({propertyId:d.property.id,orderId:d.order.id,reason:R.USER_CANCEL,mfaRequest:y.mfaRequest??void 0});if(_(!1),e.outcome===`challenge`)if(e.reason===N.MfaRequired){S(t=>({...t,modeRequired:e.challenge,otp:null,mfaRequest:null}));return}else if(e.reason===N.MfaError){S(t=>({...t,modeRequired:e.challenge,otp:null,mfaRequest:null,error:`Invalid authentication token`}));return}else throw S(e=>({...e,modeRequired:b.None,otp:null,mfaRequest:null,error:null})),Error(`Invalid withdrawal verification`);if(e.outcome===`unconfirmed`){C.closeModal(),S(e=>({...e,modeRequired:b.None,otp:null,mfaRequest:null,error:null})),z.fire({icon:`warning`,title:`Cancellation not confirmed`,text:`${e.error}. The order status below has been refreshed â please check it before retrying.`,timer:8e3}),P();return}z.fire({icon:`success`,title:`Order ${d.order?.appId} has successfully been cancelled!`}),u(d.order.id),re.trackEvent(d.order.direction===`sell`?`Property : Exchange : SellOrder : Canceled`:`Property : Exchange : BuyOrder : Canceled`,{propertyId:d.property.id,property:d.property.address,quantity:d.order.totalQuantity,value:(d.order?.quantity??1)*(d.order?.price??1),price:d.order.price,orderId:d.order.id}),C.closeModal(),S(e=>({...e,modeRequired:b.None,otp:null,mfaRequest:null,error:null})),P()}catch{z.fire({icon:`error`,title:`Something went wrong, please contact Support`})}};(0,H.useEffect)(()=>{P();let e=setInterval(()=>{P()},x);return()=>clearInterval(e)},[D]);let L=(e,t)=>{C.closeModal(),S(e=>({...e,modeRequired:b.None,otp:null,mfaRequest:null,error:null}))};return(0,H.useEffect)(()=>{y.modeRequired!==b.None&&(y.mfaRequest?I():!C.isModalOpen&&C.openModal())},[y.modeRequired,y.mfaRequest]),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(l,{id:`order-cancel-2fa-code-verify`,isOpen:C.isModalOpen,showCloseBtn:!1,className:{container:`w-full max-w-md border-none pb-6 sm:pb-0 font-abc-favorit-arabic-trial !shadow-transactCard dark:!shadow-cardDark`,containerColors:`bg-white dark:bg-lofty-purple-700`,content:`flex flex-col p-6 relative`},minHeight:`auto`,children:(0,V.jsx)(c,{mode:`verify`,verifyMode:y.modeRequired,operation:`TOTP.WalletWithdrawal`,authUser:T.authUser,isVisible:C.isModalOpen,errorMessage:y.error,isLoading:h,onCancel:L,onComplete:e=>L(!0,e?.opToken),onRequestConfirm:F})}),(0,V.jsx)(ai,{onClose:j,isModalOpen:v.isModalOpen,children:(0,V.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden bg-white dark:bg-lofty-purple-700 sm:max-h-[92vh] sm:supports-[height:100dvh]:max-h-[92dvh] sm:rou
2nded-[28px]`,children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-b border-lofty-gray-300 px-5 py-4 dark:border-lofty-purple-500 sm:px-6`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-[0.18em] text-lofty dark:text-lofty-purple`,children:`Order updates`}),(0,V.jsx)(`h2`,{className:`mt-1 text-lg font-bold tracking-tight text-lofty-purple-600 dark:text-white`,children:`Activity on this order`})]}),(0,V.jsx)(ri,{onClose:j,label:`Close order updates`})]}),(0,V.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto`,children:[p&&(0,V.jsx)(Wr,{}),!p&&!!d.order&&(0,V.jsx)(ni,{order:d.order,updates:d.streams}),!p&&!d.order&&(0,V.jsx)(Zt,{})]})]})}),(0,V.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden ${ii}`,children:[(0,V.jsx)(`div`,{className:`shrink-0 flex justify-end px-4 pt-4 sm:px-6 sm:pt-6`,children:(0,V.jsx)(ri,{onClose:s})}),(0,V.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto`,children:[p&&(0,V.jsx)(Wr,{}),!p&&!!d.order&&!!d.property&&(0,V.jsx)(Gr,{isCancellable:!!O,isCancelling:h,onCancelOrder:()=>!h&&I(),paymentSource:d.order.commitFromLoftyWallet?w.LoftyWallet:w.ExternalWallet,property:d.property,onOpenUpdates:k,order:d.order,cryptoPurchase:d.cryptoPurchase}),!p&&!d.order&&(0,V.jsx)(Zt,{})]})]})]})},$=e=>e?.trim()||void 0,si=e=>{let t=$(e);if(!t)return;if(/^[a-z]{2}$/i.test(t))return t.toUpperCase();let n=t.toLowerCase();return Object.entries(C).find(([,e])=>e.name.toLowerCase()===n)?.[0]},ci=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)),li=(e,t={})=>{let n=t.includeName===!1?void 0:[e.firstName,e.lastName].map($).filter(Boolean).join(` `)||void 0,r=ci({line1:$(e.streetAddress),city:$(e.city),state:$(e.addressState),country:si(e.country),postal_code:$(e.postalCode)}),i=Object.values(r).some(Boolean);return{name:n,email:$(e.email),...i?{address:r}:{}}},ui=()=>void 0,di=`Unable to save bank account. Please try again.`,fi=(e,t)=>e instanceof Error?e:Error(e?.message??t),pi=({isOpen:e,onClose:t,onSuccess:n,currentState:r})=>{let[i,a]=(0,H.useState)(!1),[c,u]=(0,H.useState)(!1),[d,f]=(0,H.useState)(!1),p=Ot(),m=xt(),h=o();(0,H.useEffect)(()=>{e||(u(!1),f(!1))},[e]);let g=(0,H.useMemo)(()=>({layout:`tabs`,paymentMethodOrder:[`us_bank_account`]}),[]),_=async()=>{if(!p||!m){z.fire({icon:`error`,title:`Payment form is still loading. Please try again.`});return}try{a(!0),re.trackEvent(`Property : Invest : Checkout : Add New Bank Account : Began`,ui());let e=await m.submit();if(e.error)throw fi(e.error,`Unable to save bank account`);let r=await ne(`bank`);if(!r.clientSecret)throw Error(r.error??`Unable to prepare bank account setup`);let i=Te({flow:`setup`,methodType:`bank`}),o=await p.confirmSetup({elements:m,clientSecret:r.clientSecret,confirmParams:{payment_method_data:{billing_details:li(h)},return_url:i.returnUrl},redirect:`if_required`}).finally(()=>Ee(i.id));if(o.error)throw fi(o.error,`Unable to save bank account`);if(o.setupIntent?.status!==`succeeded`){z.fire({icon:`info`,title:`Bank account verification is pending. We will show it once Stripe verifies it.`}),t();return}let s=typeof o.setupIntent?.payment_method==`string`?o.setupIntent?.payment_method:o.setupIntent?.payment_method?.id;if(!s)throw Error(`Unable to resolve saved bank account`);n((await ie()).paymentMethods.find(e=>e.id===s)??{type:oe.Bank,id:s,created:Date.now(),country:`US`,bankName:`Bank account`,routingNumber:``,last4:``,brand:`Bank account`,institutionId:null,expireMonth:0,expireYear:0,billing_details:{},default:!1}),re.trackEvent(`Property : Invest : Checkout : Add New Bank Account : Succeeded`,ui())}catch(e){ae(fi(e,di),`AddBankAccountModal::onSaveBankAccount`,{error:e}),B.fire({text:di})}finally{a(!1)}},v=i||!c||!d||!p||!m;return(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(l,{id:`AddBankAccountModal`,isOpen:e,onBackdropClick:t,onRequestClose:t,className:{container:`border-none w-full h-full`,content:`m-0 p-0 h-full flex`,overflow:`hidden`},showCloseBtn:!1,children:(0,V.jsxs)(`div`,{className:`bg-white relative flex flex-1 flex-col h-full justify-between pt-4.5 sm:pt-6 lg:pt-8 overflow-hidden`,children:[(0,V.jsx)(`div`,{className:`mb-4.5 px-4.5 sm:px-6 lg:px-8`,children:(0,V.jsx)(s,{onClick:t})}),(0,V.jsxs)(`div`,{className:`flex flex-1 flex-col lg:flex-row h-full lg:gap-x-4 overflow-y-auto`,children:[(0,V.jsx)(`div`,{className:`flex lg:flex-1 flex-col px-4.5 sm:px-6 lg:px-8`,children:(0,V.jsxs)(`div`,{className:`flex flex-col lg:fixed`,children:[(0,V.jsx)(`h1`,{className:`text-28 sm:text-4xl lg:text-5xl 2xl:text-64 text-lofty-purple-600 font-bold`,children:`Add Bank Account`}),(0,V.jsx)(`p`,{className:`text-m text-lofty-gray-800 dark:text-slate-400`,children:`Link your bank account to fund your investments.`})]})}),(0,V.jsx)(`div`,{className:`flex flex-1 h-full items-start mt-12 lg:mt-0 px-0 lg:px-8`,children:(0,V.jsxs)(`div`,{className:`w-full flex flex-col gap-y-4`,children:[(0,V.jsx)(`div`,{className:`border border-lofty-gray-200 bg-white rounded-xl px-4 py-4`,children:(0,V.jsx)(kt,{options:g,onChange:e=>f(e.complete)})}),(0,V.jsxs)(`div`,{className:`flex bg-lofty-gray-200/30 items-center lg:rou
2nded px-4.5 py-4`,children:[(0,V.jsx)(`input`,{id:`ach_debit_consent`,name:`ach_debit_consent`,type:`checkbox`,onChange:e=>u(e.currentTarget.checked),checked:c,disabled:i,className:`h-4 w-4 text-themeBlue-600 focus:ring-themeBlue-500 border-gray-300 rounded`}),(0,V.jsx)(`label`,{htmlFor:`ach_debit_consent`,className:`ml-4 mr-2 cursor-pointer block text-sm text-left font-semibold text-lofty-gray-700`,children:`I authorize Lofty AI to electronically debit my account and, if necessary, electronically credit my account to correct erroneous debits.`})]})]})})]}),(0,V.jsxs)(`div`,{className:`bg-white flex rounded-t-2xl sm:rounded-none px-4.5 py-6 sm:px-6 lg:px-8 lg:py-3 xl:px-12 xl:py-4 2xl:px-16 text-lofty-gray-700`,children:[(0,V.jsx)(`div`,{className:`hidden lg:flex lg:flex-1 items-center text-lofty-gray-800`}),(0,V.jsx)(`div`,{className:`flex flex-1 flex-col sm:flex-row justify-between lg:justify-end items-center`,children:(0,V.jsxs)(`button`,{type:`button`,onClick:_,disabled:v,className:[`lofty-link-button whitespace-nowrap ${v?`disabled`:``}`,`mt-4.5 sm:mt-0`,`min-w-[339px] sm:min-w-[365px] lg:min-w-[240px] xl:min-w-[272px] 2xl:min-w-[324px]`].join(` `),children:[i?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(he,{className:`h-6 w-6 m-auto inline`}),(0,V.jsx)(`span`,{children:` Processing..`})]}):`Save bank account`,(0,V.jsx)(`span`,{})]})})]})]})})})},mi=`Unable to save card. Please try again.`,hi={checkout:{submitLabel:`Add card and continue`},wallet:{helperText:`Saving a card does not charge it. You can remove it anytime under Wallets & Payment Methods.`,submitLabel:`Save card`}},gi=(e,t)=>e instanceof Error?e:Error(e?.message??t),_i=e=>[e.firstName,e.lastName].map(e=>e?.trim()).filter(Boolean).join(` `),vi=({isOpen:e,onClose:t,onSuccess:n,flow:r=`wallet`})=>{let[i,a]=(0,H.useState)(!1),[s,c]=(0,H.useState)(!1),[u,f]=(0,H.useState)(``),p=Ot(),m=xt(),{isDark:h}=d(),g=o(),_=hi[r];(0,H.useEffect)(()=>{e&&(c(!1),f(e=>e.trim()?e:_i(g)))},[e,g.firstName,g.lastName]);let v=(0,H.useMemo)(()=>({layout:h?{type:`accordion`,defaultCollapsed:!1,spacedAccordionItems:!1}
2:`tabs`,wallets:{applePay:`never`,googlePay:`never`,link:`never`},paymentMethodOrder:[`card`],fields:{billingDetails:{name:`never`}}}),[h]),y=async()=>{if(!p||!m){z.fire({icon:`error`,title:`Payment form is still loading. Please try again.`});return}let e=u.trim();if(!e){z.fire({icon:`error`,title:`Please enter the name on the card.`});return}try{a(!0);let t=await m.submit();if(t.error)throw gi(t.error,`Unable to save card`);let r=await ne(`card`);if(!r.clientSecret)throw Error(r.error??`Unable to prepare card setup`);let i={...li(g,{includeName:!1}),name:e},o=Te({flow:`setup`,methodType:`card`}),s=await p.confirmSetup({elements:m,clientSecret:r.clientSecret,confirmParams:{payment_method_data:{billing_details:i},return_url:o.returnUrl},redirect:`if_required`}).finally(()=>Ee(o.id));if(s.error)throw gi(s.error,`Unable to save card`);if(s.setupIntent?.status!==`succeeded`)throw Error(`Card setup is not complete. Please verify the card and try again.`);let c=typeof s.setupIntent?.payment_method==`string`?s.setupIntent.payment_method:s.setupIntent?.payment_method?.id;if(!c)throw Error(`Unable to resolve saved card`);let l=(await ie()).paymentMethods.find(e=>e.id===c);n?.(l??{type:oe.Card,id:c,created:Date.now(),country:``,bankName:``,institutionId:``,routingNumber:``,last4:``,brand:`New Card`,expireMonth:0,expireYear:0,billing_details:i,default:!1})}catch(e){ae(gi(e,mi),`AddCreditCardModal::onSaveCard`,{error:e}),B.fire({text:mi})}finally{a(!1)}},b=!!u.trim(),x=i||!s||!b||!p||!m;return(0,V.jsx)(l,{id:`AddCreditCardModal`,isOpen:e,onBackdropClick:t,onRequestClose:t,className:{container:`border-none w-full sm:max-w-[720px] lg:max-w-[820px] max-h-[92vh] supports-[height:100dvh]:max-h-[92dvh] overflow-hidden`,containerColors:`bg-white dark:bg-lofty-purple-700 border-white dark:border-lofty-purple-700 text-lofty-purple-600 dark:text-white`,content:`m-0 p-0 flex flex-col`,overflow:`hidden`},minHeight:`auto`,showCloseBtn:!1,children:(0,V.jsxs)(`div`,{className:`relative flex max-h-[92vh] supports-[height:100dvh]:max-h-[92dvh] w-full flex-col overflow-hidden bg-white text-lofty-purple-600 dark:bg-lofty-purple-700 dark:text-white`,children:[(0,V.jsx)(`button`,{type:`button`,onClick:t,className:`absolute right-5 top-5 z-10 flex h-9 w-9 items-center justify-center rounded-full text-lofty-gray-500 transition-colors hover:bg-lofty-purple-50 hover:text-lofty-purple-600 dark:text-lofty-gray-200 dark:hover:bg-white/10 dark:hover:text-white sm:right-7 sm:top-7`,"aria-label":`Close add card modal`,children:(0,V.jsx)(`i`,{className:`fas fa-times text-xl`})}),(0,V.jsxs)(`div`,{className:`px-5 pb-4 pt-14 sm:px-8 sm:pb-5 sm:pt-8`,children:[(0,V.jsx)(`h1`,{className:`mr-10 font-abc-favorit-arabic-trial text-3xl font-bold leading-tight text-lofty-purple-600 dark:text-white sm:text-4xl`,children:`Add Card`}),(0,V.jsx)(`p`,{className:`mt-2 max-w-xl text-sm leading-5 text-lofty-gray-500 dark:text-lofty-gray-200 sm:text-base sm:leading-6`,children:`Add a debit or credit card to fund your investments.`})]}),(0,V.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-4 sm:px-8 sm:py-5`,children:[(0,V.jsxs)(`div`,{className:`mb-4`,children:[(0,V.jsx)(`label`,{htmlFor:`cardholder-name`,className:`mb-1.5 block text-sm font-medium text-lofty-purple-600/70 dark:text-lofty-gray-200`,children:`Name on card`}),(0,V.jsx)(`input`,{id:`cardholder-name`,name:`cardholderName`,type:`text`,autoComplete:`cc-name`,placeholder:`Full name as shown on card`,value:u,onChange:e=>f(e.target.value),disabled:i,className:`block w-full rounded-xl border border-lofty-purple-600/20 bg-transparent p-3 text-base text-lofty-purple-600 shadow-sm placeholder:text-lofty-gray-400 focus:border-lofty focus:outline-none focus:ring-lofty dark:border-lofty-gray/20 dark:bg-lofty-purple-800/40 dark:text-white dark:placeholder:text-lofty-gray-300 dark:focus:border-lofty-purple`})]}),(0,V.jsxs)(`div`,{className:`mb-4 flex flex-col gap-3 rounded-2xl border border-lofty-purple-600/10 bg-lofty-purple-50/60 p-4 dark:border-lofty-purple-500/40 dark:bg-lofty-purple-800/40 sm:flex-row sm:items-center sm:justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,V.jsx)(`span`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-lofty/10 text-lofty dark:bg-lofty-purple/20 dark:text-lofty-purple`,"aria-hidden":`true`,children:(0,V.jsx)(`i`,{className:`fas fa-lock text-sm`})}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`p`,{className:`text-sm font-semibold text-lofty-purple-600 dar
2k:text-white`,children:`Secure card storage`}),(0,V.jsx)(`p`,{className:`mt-0.5 text-xs leading-5 text-lofty-gray-500 dark:text-lofty-gray-200 sm:text-sm`,children:`Your card details are encrypted and sent directly to Stripe. Lofty never stores your full card number or security code.`})]})]}),(0,V.jsx)(`a`,{href:`https://stripe.com`,target:`_blank`,rel:`noreferrer`,className:`w-fit shrink-0 rounded bg-white p-0.5`,"aria-label":`Learn about Stripe payment processing`,children:(0,V.jsx)(`img`,{src:`/static/img/payments/powered-by-stripe.svg`,alt:`Powered by Stripe`,className:`h-[28px] w-auto`})})]}),(0,V.jsx)(`div`,{className:`add-card-payment-element rounded-2xl border border-lofty-purple-600/10 bg-white dark:border-lofty-purple-500/50 dark:bg-lofty-purple-800/20 dark:[--colorBackground:#111849]`,children:(0,V.jsx)(kt,{options:v,onChange:e=>c(e.complete)})}),_.helperText&&(0,V.jsxs)(`p`,{className:`mt-3 flex items-start gap-2 text-xs leading-5 text-lofty-gray-500 dark:text-lofty-gray-200 sm:text-sm`,children:[(0,V.jsx)(`i`,{className:`fas fa-check-circle mt-1 text-lofty`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{children:_.helperText})]})]}),(0,V.jsx)(`div`,{className:`flex shrink-0 border-t border-lofty-purple-600/10 bg-white px-5 py-4 dark:border-white/10 dark:bg-lofty-purple-800 sm:justify-end sm:px-8`,children:(0,V.jsxs)(`button`,{type:`button`,onClick:y,className:[`lofty-link-button w-full whitespace-nowrap sm:w-auto ${x?`disabled`:``}`,`min-w-[240px] text-base 2xl:text-lg`].join(` `),disabled:x,children:[i?(0,V.jsx)(he,{className:`h-6 w-6 m-auto inline`}):_.submitLabel,(0,V.jsx)(`span`,{})]})})]})})},yi=`data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.896%203.56283C13.398%205.70481%2013.2285%207.58945%2012.5176%207.77145C11.8061%207.95412%2010.8236%206.3648%2010.3223%204.22282C9.82032%202.08084%209.98979%200.196198%2010.7007%200.0141999C11.4122%20-0.167798%2012.3947%201.42085%2012.896%203.56283ZM21.1794%205.40481C20.0687%204.19149%2017.8585%204.52015%2016.2427%206.13947C14.6276%207.75879%2014.2181%2010.0548%2015.3294%2011.2687C16.44%2012.4821%2018.6502%2012.1534%2020.266%2010.5341C21.8812%208.91411%2022.2906%206.61813%2021.1794%205.40481ZM12.3436%2023.9866C13.0551%2023.8046%2013.1994%2021.8133%2012.667%2019.54C12.1347%2017.2667%2011.1263%2015.5707%2010.4161%2015.7534C9.70454%2015.9354%209.56029%2017.9267%2010.0926%2020.2C10.625%2022.4733%2011.6327%2024.1686%2012.3436%2023.9866ZM5.09779%206.51546C7.14825%207.13879%208.64696%208.23211%208.44451%208.95811C8.24269%209.68343%206.41604%209.76676%204.36557%209.14344C2.31511%208.52011%200.816398%207.42679%201.01821%206.70013C1.22067%205.9748%203.04733%205.89147%205.09779%206.5148V6.51546ZM18.4083%2014.7087C20.5843%2015.3707%2022.1852%2016.4954%2021.9827%2017.2207C21.7803%2017.946%2019.8521%2017.998%2017.6755%2017.3367C15.4989%2016.6747%2013.898%2015.55%2014.1004%2014.8247C14.3029%2014.0994%2016.2311%2014.0474%2018.4083%2014.7087ZM7.40504%2013.1867C6.89599%2012.6434%205.2278%2013.4334%203.67928%2014.9527C2.13012%2016.4714%201.286%2018.1433%201.79506%2018.686C2.30347%2019.23%203.97165%2018.4393%205.52082%2016.92C7.06998%2015.4014%207.91345%2013.7301%207.4044%2013.1867H7.40504Z'%20fill='%239383FF'/%3e%3c/svg%3e`,bi={pera:(0,V.jsx)(`img`,{src:yi,alt:`PeraWalletSVG`,className:`h-6 w-6 rounded-full`}),defly:(0,V.jsx)(`img`,{src:yi,alt:`PeraWalletSVG`,className:`h-6 w-6 rounded-full`}),bank:(0,V.jsx)(`i`,{className:`fas fa-university text-lg text-lofty dark:text-lofty-purple`}),cc:(0,V.jsx)(`i`,{className:`fas fa-credit-card text-lg text-lofty dark:text-lofty-purple`})},xi={pera:`Pera Wallet`,defly:`Defly Wallet`,bank:`Bank Account`,cc:`Card`},Si=({label:e,onClick:t,icon:n})=>(0,V.jsxs)(`button`,{type:`button`,className:`group flex w-full items-center justify-between rounded-2xl border border-lofty-purple-600/15 bg-white px-4 py-4 text-left transition-colors hover:border-lofty hover:bg-lofty-purple-50 dark:border-lofty-purple-500/60 dark:bg-lofty-purple-800/20 dark:hover:border-lofty-purple dark:hover:bg-lofty-purple-600/20 sm:px-5 sm:py-5`,onClick:t,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,V.jsx)(`div`,{className:`flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-lofty-purple-50 dark:bg-lofty-purple-500/25`,children:n?(0,V.jsx)(`img`,{alt:`${e} icon`,src:n,className:`h-6 w-6 rounded-full`}):bi[e]}),(0,V.jsx)(`div`,{className:`font-abc-favorit-arabic-trial text-base font-bold text-lofty-purple-600 dar
2k:text-white sm:text-lg`,children:xi[e]})]}),(0,V.jsx)(ge,{color:`text-lofty-gray-500 dark:text-lofty-gray-200`,className:`h-5 w-5 transition-colors group-hover:text-lofty dark:group-hover:text-white`})]}),Ci=({isDark:e,billingDetails:t,paymentMethodTypes:n=[`card`]})=>({mode:`setup`,currency:`usd`,paymentMethodTypes:n,defaultValues:{billingDetails:t},appearance:{theme:e?`night`:`stripe`,variables:{borderRadius:`12px`,colorPrimary:`#4D3FED`,colorBackground:e?`#111849`:`#FFFFFF`,colorText:e?`#FFFFFF`:`#02094D`,colorTextSecondary:e?`#C7CADB`:`#6B7280`,colorTextPlaceholder:`#9CA3AF`},rules:{".AccordionItem":{backgroundColor:e?`#111849`:`#FFFFFF`,borderColor:e?`#343B79`:`#E5E7EB`,boxShadow:`none`},".Block":{backgroundColor:e?`#111849`:`#FFFFFF`,borderColor:e?`#343B79`:`#E5E7EB`,boxShadow:`none`},".Input":{boxShadow:`none`,backgroundColor:e?`#111849`:`#FFFFFF`,borderColor:e?`#343B79`:`#E5E7EB`},".Label":{color:e?`#FFFFFF`:`#02094D`},".Tab":{backgroundColor:e?`#111849`:`#FFFFFF`,boxShadow:`none`,borderColor:e?`#343B79`:`#E5E7EB`},".Tab--selected":{backgroundColor:`#4D3FED`,boxShadow:`none`,borderColor:`#4D3FED`,color:`#FFFFFF`},".Text":{color:e?`#C7CADB`:`#6B7280`},".TermsText":{color:e?`#C7CADB`:`#6B7280`}}},loader:`auto`}),wi=`lofty:stripe-reload`,Ti=6e4,Ei=()=>{if(typeof sessionStorage>`u`)return!1;let e=sessionStorage.getItem(wi);if(!e)return!1;let t=Number(e);return Number.isFinite(t)&&Date.now()-t<Ti},Di=()=>typeof performance>`u`||typeof performance.getEntriesByType!=`function`?!1:performance.getEntriesByType(`navigation`)[0]?.type===`reload`,Oi=()=>Ei()&&Di(),ki=()=>{typeof sessionStorage>`u`||sessionStorage.setItem(wi,String(Date.now()))},Ai=()=>typeof window>`u`||typeof sessionStorage>`u`||Ei()?!1:(ki(),window.location.reload(),!0),ji=()=>{typeof window>`u`||(ki(),window.location.reload())},Mi=async({source:e,paymentCategory:t=`unknown`,allowAutoReload:n=!1})=>(Ce({stage:e===`stripe_load`?`stripe_load`:e,errorCode:`stripe_unavailable`,stripeReady:!1,paymentCategory:t}),n&&Ai()?`auto_reloaded`:(await B.fire({title:`Card payments unavailable`,text:`Secure card and bank payments could not be loaded. Reload the page to try again, or pay with your Lofty wallet if available.`,confirmButtonText:`Reload`,showCancelButton:!0,cancelButtonText:`Dismiss`})).isConfirmed?(ji(),`reloaded`):`dismissed`),Ni=()=>{Oi()&&z.fire({icon:`warning`,title:`Card payments are still unavailable. You can reload again or use your Lofty wallet.`})},Pi=P()?Fe(le().stripePk).catch(e=>(console.error(`Failed to load Stripe.js; continuing without Stripe`,e),Ai(),null)):null,Fi=p({key:`stripeContext`,default:Pi,dangerouslyAllowMutability:!I.isProd}),Ii=F.ready;(async()=>{Ii=await F.waitUntilReady()})();var Li=()=>I.debug||Ii&&F.isOn(ce.DebuggingConsole),Ri=e=>({log:(...e)=>{Li()&&console.log(...e)},error:(...e)=>{Li()&&console.error(...e)}}),zi=[`rounded-2xl border border-lofty-gray-300 bg-white`,`dark:border-lofty-purple-500 dark:bg-lofty-purple-700`].join(` `),Bi=`${zi} p-6`,Vi=`text-xl font-semibold tracking-tight text-lofty-purple-600 dark:text-white`,Hi=`mt-1 max-w-2xl text-sm leading-6 text-lofty-gray-700 dark:text-lofty-gray-200`,Ui=`block text-sm font-semibold text-lofty-purple-600 dark:text-white`,Wi=[`mt-2 block w-full rounded-lg border border-lofty-gray-300 bg-white px-3 py-2.5`,`text-base text-lofty-purple-600 placeholder:text-lofty-gray-400`,`focus:border-lofty focus:outline-none focus:ring-2 focus:ring-lofty sm:text-sm`,`dark:border-lofty-purple-500 dark:bg-lofty-purple-800 dark:text-white dark:placeholder:text-lofty-gray-700`].join(` `),Gi=[`inline-flex items-center justify-center gap-2 rounded-full bg-lofty px-5 py-2.5`,`text-sm font-semibold text-white transition-colors`,`hover:bg-lofty-purple-600 dark:hover:bg-lofty-purple`,`disabled:cursor-not-allowed disabled:opacity-50`].join(` `),Ki=[`inline-flex items-center justify-center gap-2 rounded-full border border-lofty px-4 py-2`,`text-sm font-semibold text-lofty transition-colors hover:bg-lofty hover:text-white`,`disabled:cursor-not-allowed disabled:opacity-50`,`disabled:hover:bg-transparent disabled:hover:text-lofty`,`dark:border-lofty-purple dark:text-lofty-purple dark:hover:bg-lofty-purple dark:hover:text-white`,`dark:disabled:hover:bg-transparent dark:disabled:hover:text-lofty-purple`].join(` `),qi=[`inline-flex items-center gap-1.5 text-sm font-semibold text-lofty-error transition-colors`,`hover:text-lofty-lightNegative disabled:cursor-not-allowed disabled:opacity-50 dark:text-lofty-red`].join(` `),Ji=[`inline-flex items-center justify-center gap-2 rounded-full bg-lofty-error px-4 py-2`,`text-sm font-semibold text-white transition-colors hover:bg-lofty-lightNegative`,`disabled:cursor-not-allowed disabled:opacity-50 dark:bg-lofty-red`].join(` `),Yi=[`inline-flex items-center gap-1.5 text-sm font-semibold text-lofty transition-colors`,`hover:text-lofty-purple-600 disabled:cursor-not-allowed disabled:opacity-50 dark:text-lofty-purple dark:hover:text-white`].join(` `),Xi=[`inline-flex items-center justify-center rounded-full px-4 py-2`,`text-sm font-semibold text-lofty-gray-700 transition-colors hover:bg-lofty-gray-100`,`dark:text-lofty-gray-200 dark:hover:bg-lofty-purple-600`].join(` `),Zi=`border border-lofty-gray-300 bg-white dark:border-lofty-purple-500 dark:bg-lofty-purple-700`,Qi={container:`w-full sm:max-w-md border-none pb-4 sm:pb-0 font-abc-favorit-arabic-trial !shadow-transactCard dark:!shadow-cardDark`,containerColors:`bg-white dark:bg-lofty-purple-700 border-white dark:border-lofty-purple-700 text-lofty-purple-600 dar
2k:text-white`,content:`flex flex-col p-6 relative`,overflow:`auto`},$i=`text-[11px] font-semibold uppercase tracking-[0.18em] text-lofty dark:text-lofty-purple`,ea=`mt-1.5 text-xl font-bold tracking-tight text-lofty-purple-600 dark:text-white`,ta=`mt-1 text-sm leading-6 text-lofty-gray-700 dark:text-lofty-gray-200`,na=`mt-6 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,ra=`inline-flex items-center gap-1.5 text-sm font-semibold text-lofty transition-colors hover:text-lofty-purple-600 dark:text-lofty-purple dark:hover:text-white`,ia=`text-xs font-semibold uppercase tracking-[0.18em] text-lofty dark:text-lofty-purple`,aa=`text-3xl font-bold leading-tight tracking-tight text-lofty-purple-600 dark:text-white sm:text-4xl`,oa=`mt-2 text-sm text-lofty-gray-700 dark:text-lofty-gray-200 sm:text-base`,sa=`text-base font-semibold text-lofty-purple-600 dark:text-white`,ca=`rounded-2xl border border-lofty-gray-300 bg-white dark:border-lofty-purple-500 dark:bg-lofty-purple-700`,la=`rounded-2xl border border-dashed border-lofty-gray-300 px-6 py-8 text-center text-sm text-lofty-gray-700 dark:border-lofty-purple-500 dark:text-lofty-gray-200`,ua=`text-xs font-medium text-lofty-gray-700 dark:text-lofty-gray-200`,da=`mt-1 text-xl font-bold tabular-nums text-lofty-purple-600 dark:text-white`,fa=`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-semibold leading-none`,pa=`${fa} bg-lofty-purple-50 text-lofty dark:bg-lofty-purple/15 dark:text-lofty-purple`,ma=`${fa} bg-lofty-green/15 text-exchange-green dark:bg-lofty-green/15 dark:text-lofty-green`,ha=`${fa} bg-lofty-yellow/10 text-exchange-yellowTo dark:bg-lofty-yellow/20 dark:text-lofty-yellow`,ga=`font-mono text-[13px] leading-5 break-all text-lofty-purple-600 dark:text-white`,_a=`${ga} rounded-[10px] border border-lofty-gray-300 bg-lofty-gray-50 px-3 py-2.5 dark:border-lofty-purple-500 dark:bg-lofty-purple-800`,va=`flex items-center gap-3 border-b border-lofty-gray-300 py-3.5 last:border-b-0 dark:border-lofty-purple-500 sm:gap-4`,ya=`truncate text-sm font-semibold text-lofty-purple-600 dark:text-white sm:text-base`,ba=`truncate text-xs text-lofty-gray-700 dark:text-lofty-gray-200 sm:text-sm`,xa=`text-sm font-semibold tabular-nums text-lofty-purple-600 dark:text-white sm:text-base`,Sa=`text-xs text-lofty-gray-500 transition-colors group-hover:text-lofty dark:text-lofty-gray-200 dark:group-hover:text-lofty-purple`,Ca=`flex items-start justify-between gap-4 border-b border-lofty-gray-300 py-3 text-sm last:border-b-0 dark:border-lofty-purple-500`,wa=`text-lofty-gray-700 dark:text-lofty-gray-200`,Ta=`text-right font-semibold tabular-nums text-lofty-purple-600 dark:text-white`,Ea=`flex flex-col gap-3 rounded-[10px] bg-lofty-yellow/10 px-4 py-3 text-sm leading-5 text-exchange-yellowTo dark:bg-lofty-yellow/20 dark:text-lofty-yellow sm:flex-row sm:items-center sm:justify-between`,Da=`mt-1.5 text-xs font-medium text-lofty-error dark:text-lofty-red`,Oa=`mt-1.5 text-xs text-lofty-gray-700 dark:text-lofty-gray-200`,ka=`mt-4 flex flex-col gap-2.5 text-sm leading-6 text-lofty-gray-700 dark:text-lofty-gray-200`,Aa=`flex gap-2.5`,ja=`fas fa-circle-check mt-1.5 text-xs text-lofty dark:text-lofty-purple`,Ma=`flex gap-2.5 rounded-[10px] bg-lofty-error/10 px-4 py-3 text-sm leading-5 text-lofty-error dark:bg-lofty-red/15 dark:text-lofty-red`;function Na({isOpen:e,onClose:t,replaceWallet:n}){let r=je();return(0,V.jsxs)(l,{id:`ReplaceCurrentWallet`,isOpen:e,onBackdropClick:t,onRequestClose:t,showCloseBtn:!0,minHeight:`auto`,className:Qi,children:[(0,V.jsx)(`p`,{className:$i,children:`Wallet · External wallet`}),(0,V.jsx)(`h2`,{className:ea,children:`Replace your external wallet?`}),(0,V.jsx)(`p`,{className:ta,children:`Lofty links one external wallet at a time. A new external wallet replaces the current one.`}),(0,V.jsx)(`p`,{className:`${ta} mt-2`,children:`If the current wallet still holds Lofty property shares or LP tokens, move them first. Shares left in a replaced wallet stop counting toward your Lofty account until you link that wallet again.`}),(0,V.jsx)(`div`,{className:`mt-5 flex flex-col gap-3`,children:r.availableWallets?.map(e=>(0,V.jsx)(Si,{onClick:()=>n(e),label:e.metadata?.name?.toLowerCase(),icon:e.metadata.icon},e.metadata.name))}),(0,V.jsx)(`div`,{className:na,children:(0,V.jsx)(`button`,{type:`button`,onClick:t,className:Xi,children:`Keep my current wallet`})})]})}var Pa=function(e){return e.Default=`default`,e.ConnectWallet=`connect`,e.ReplaceWallet=`replace`,e}({}),Fa={modalHeight:``,title:`Add Payment Method`,displaySwitchMessage:!1,showBankOptions:!0,promptToSelectOnlyIfNeeded:!1},Ia=typeof localStorage>`u`?null:JSON.parse(localStorage.getItem(`allowsPopups`)??`null`),La=()=>
2{if(typeof window>`u`)return!1;if(Ia===null){try{window.open(``,``,`width=1 height=1 left=10000`)?.close(),window.open(``,``,`width=1 height=1 left=10000`)?.close(),Ia=Date.now()}catch{B.fire({text:`Pop-up Blocker is enabled. Please add this site to your exception list and reload the page. Otherwise, some of our features may not work for you.`}),Ia=-Date.now()}localStorage.setItem(`allowsPopups`,`${Ia}`)}return Ia>0};function Ra({isOpen:e,zIndexBase:t,mode:n=`default`,onClose:r,onSuccess:s,wallets:c,addPaymentMethod:u,isMarketOrder:f,cardOnly:p,cardFlow:m=`wallet`}){let h=je(),g=Ri(),[_]=(0,H.useState)(La()),{isModalOpen:v,openModal:y,closeModal:b}=a(),{isModalOpen:x,openModal:S,closeModal:C}=a(),{isModalOpen:w,openModal:T,closeModal:E}=a(),[D,O]=(0,H.useState)(),[k,A]=(0,H.useState)(),j=i(Fi),{isDark:M}=d(),N=o(),P=(0,H.useMemo)(()=>li(N,{includeName:k!==`card`}),[k,N.addressState,N.city,N.country,N.email,N.firstName,N.lastName,N.postalCode,N.streetAddress]),F=(0,H.useMemo)(()=>{if(k)return Ci({isDark:M,billingDetails:P,paymentMethodTypes:k===`card`?[`card`]:[`us_bank_account`]})},[k,M,P]),ee=()=>{let e={...Fa};switch(n){case`connect`:e.modalHeight=``,e.title=`Select a method to connect your wallet`,e.showBankOptions=!1,e.promptToSelectOnlyIfNeeded=!0;break;case`replace`:e.modalHeight=`800px`,e.displaySwitchMessage=!0,e.title=`Switch wallet`,e.showBankOptions=!1;break;default:break}return e},I=async e=>{try{let t=await e.connect();if(Array.isArray(t)&&t[0].address){let e=t[0].address,n=c.find(e=>!e.shared)?.address!==e;await h.verifySavedAccounts([e]),s({success:!0,connectedAccount:e,newAccount:n}),R()}}catch(t){console.log(`ð ~ handleConnectClick ~ error:`,t),B.fire({text:`${e.metadata.name} connection failed: ${t}`})}};(0,H.useEffect)(()=>{if(!D)return;let e=c.find(e=>!e.shared);g.log(`AddOrSwitchPayment.useEffect(selectedWalletType):`,{selectedWallet:D.id,external:e,mode:n,wallets:c}),!e||n===`connect`?I(D):y()},[D]),(0,H.useEffect)(()=>{g.log(`AddOrSwitchPayment modal: Popups are enabled:`,_)},[]);let L=async(e,t)=>j&&await j?(A(e),t(),!0):(await Mi({source:`add_payment`,paymentCategory:e===`bank`?`bank`:`card`}),!1);(0,H.useEffect)(()=>{if(!e||!p||x)return;let t=!1;return(async()=>{let e=await L(`card`,S);t||e||r()})(),()=>{t=!0}},[e,p]);let R=()=>{O(void 0),A(void 0),b(),r()},te=ee();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Na,{isOpen:v,replaceWallet:I,onClose:()=>{O(void 0),b()}}),u&&x&&F&&(0,V.jsx)(yt,{stripe:j,options:F,children:(0,V.jsx)(vi,{isOpen:x,flow:m,onClose:()=>{C(),R()},onSuccess:e=>{u(e),C(),R()}})},`${k}-${M?`dark`:`light`}`),u&&!f&&w&&F&&(0,V.jsx)(yt,{stripe:j,options:F,children:(0,V.jsx)(pi,{isOpen:w,onClose:()=>{E(),R()},onSuccess:e=>{u(e),E(),R()},currentState:{}})},`${k}-${M?`dark`:`light`}`),(0,V.jsx)(l,{id:`addModal`,isOpen:e&&!p,zIndexBase:t,onRequestClose:R,onBackdropClick:R,showCloseBtn:!1,className:{container:`border-none w-full sm:max-w-[400px] overflow-hidden`,containerColors:`bg-white dark:bg-lofty-purple-700 border-white dark:border-lofty-purple-700 text-lofty-purple-600 dark:text-white`,content:`flex flex-1 flex-col p-0 relative`},minHeight:te.modalHeight||`auto`,children:(0,V.jsxs)(`div`,{className:`relative p-5 sm:p-6`,children:[(0,V.jsx)(`button`,{type:`button`,onClick:R,className:`absolute right-5 top-5 flex h-9 w-9 items-center justify-center rounded-full text-lofty-gray-500 transition-colors hover:bg-lofty-purple-50 hover:text-lofty-purple-600 dark:text-lofty-gray-200 dark:hover:bg-white/10 dark:hover:text-white sm:right-7 sm:top-7`,"aria-label":`Close add payment method modal`,children:(0,V.jsx)(`i`,{className:`fas fa-times text-xl`})}),(0,V.jsx)(`h2`,{className:`mr-12 font-abc-favorit-arabic-trial text-2xl font-bold leading-tight text-lofty-purple-600 dark:text-white sm:text-3xl`,children:te.title}),te.displaySwitchMessage&&(0,V.jsx)(`p`,{className:`mt-3 font-abc-favorit-arabic-trial text-sm text-lofty-gray-500 dark:text-lofty-gray-200`,children:`You have already linked an external wallet. Connecting another external wallet will replace the current one.`}),(0,V.jsxs)(`div`,{className:`mt-5 flex flex-col gap-y-3`,children:[te.showBankOptions&&(0,V.jsx)(Si,{label:`cc`,onClick:()=>L(`card`,S)}),te.showBankOptions&&!f&&(0,V.jsx)(Si,{label:`bank`,onClick:()=>L(`bank`,T)}),h.availableWallets?.filter(e=>e.metadata?.name?.toLowerCase()===`pera`).map(e=>(0,V.jsx)(Si,{onClick:()=>O(e),label:`pera`,icon:e.metadata.icon},e.metadata.name))]})]})})]})}var za=({isOpen:e,onClose:t,onAddBank:n,zIndexBase:r,primaryActionLabel:i=`Add bank account`})=>(0,V.jsx)(l,{id:`legacyBankMigrationModal`,isOpen:e,zIndexBase:r,onBackdropClick:t,onRequestClose:t,showCloseBtn:!0,roundCloseButton:!0,minHeight:`auto`,className:{container:`border-none w-full sm:max-w-[420px] bg-white dark:bg-lofty-purple-700`,content:`flex flex-1 flex-col p-6 relative`},children:(0,V.jsxs)(`div`,{className:`pt-2 flex flex-col gap-y-5`,children:[(0,V.jsx)(`div`,{className:`flex items-center justify-center w-12 h-12 rounded-full bg-lofty/10 dark:bg-lofty/20`,children:(0,V.jsx)(`i`,{className:`fas fa-university text-lofty text-xl`})}),(0,V.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,V.jsx)(`h2`,{className:`font-abc-favorit-arabic-trial text-2xl font-bold text-lofty-purple-600 dar
2k:text-white leading-tight`,children:`Re-add your bank account`}),(0,V.jsx)(`p`,{className:`font-abc-favorit-arabic-trial text-sm text-lofty-gray-500 dark:text-lofty-gray-200`,children:`We're migrating to a new payment processor for ACH bank transfers. Your saved bank account is on the previous system and can no longer be used to fund purchases. Add it again to keep paying directly from your bank.`})]}),(0,V.jsx)(`button`,{type:`button`,onClick:n,className:`flex justify-center p-2 rounded-full text-center w-full bg-lofty hover:bg-lofty-purple-600 transition-colors`,children:(0,V.jsx)(`span`,{className:`text-white font-abc-favorit-arabic-trial text-base font-bold`,children:i})}),(0,V.jsx)(`button`,{type:`button`,onClick:t,className:`text-lofty text-center font-medium cursor-pointer`,children:`Maybe later`})]})}),Ba=({label:e,timer:t=500})=>{let n=[`.`,`..`,`...`],[r,i]=(0,H.useState)(0);return(0,H.useEffect)(()=>{let e=setInterval(()=>{i(e=>(e+1)%3)},t);return()=>clearInterval(e)},[]),(0,V.jsxs)(`span`,{className:`flex overflow-visible`,children:[(0,V.jsx)(`span`,{children:e}),(0,V.jsx)(`span`,{className:`relative`,children:(0,V.jsx)(`span`,{className:`absolute left-0 top-0 bottom-0`,children:n[r]})})]})},Va=`bg-gradient-to-br from-lofty-purple border-lofty`;function Ha({currency:e,selected:t,onChange:n,handleSelection:r,onBlur:i,active:a=!0,showFees:o,compareField:s=`symbol`,variant:c}){let l=()=>{n({type:`input`,target:{value:e[s],name:e.name}}),r()},u=t&&a;return c===`method`?(0,V.jsxs)(`button`,{type:`button`,onClick:a?l:()=>{},onBlur:i,className:[`appearance-none flex items-center justify-between w-full rounded-xl border px-4 py-4 text-left transition-colors`,u?`border-lofty dark:border-lofty-purple`:`border-lofty-gray-300 dark:border-lofty-purple-500`,a?`cursor-pointer hover:border-lofty dark:hover:border-lofty-purple`:`opacity-30 cursor-not-allowed border-gray-400`].filter(Boolean).join(` `),children:[(0,V.jsxs)(`span`,{className:`flex items-center gap-3 min-w-0`,children:[(0,V.jsx)(`span`,{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-lofty-purple-50 dark:bg-lofty-purple-500/30`,children:e.logo?typeof e.logo==`string`?(0,V.jsx)(`img`,{className:`h-6 w-6 rounded-full`,src:e.logo,alt:`logo`}):(0,V.jsx)(`span`,{className:`h-6 w-6 inline-flex items-center justify-center`,children:e.logo}):null}),(0,V.jsxs)(`span`,{className:`min-w-0`,children:[(0,V.jsxs)(`span`,{className:`flex items-center gap-2 font-abc-favorit-arabic-trial text-sm font-bold text-lofty-purple-600 dark:text-white`,children:[(0,V.jsx)(`span`,{className:`truncate`,children:e.displayName||e.name}),!a&&(0,V.jsx)(`span`,{className:`text-xs uppercase font-normal`,children:`Planned`})]}),o&&e.subtitle&&(0,V.jsx)(`span`,{className:`block text-xs text-lofty-gray-500 dark:text-lofty-gray-200 mt-0.5`,children:e.subt
2itle})]})]}),u?(0,V.jsx)(_e,{color:`text-lofty dark:text-lofty-purple`,className:`h-4 w-4 shrink-0`}):(0,V.jsx)(ge,{color:`text-lofty-gray-400 dark:text-lofty-gray-200`,className:`h-5 w-5 shrink-0`})]}):(0,V.jsxs)(`button`,{type:`button`,onClick:a?l:()=>{},onBlur:i,className:[`appearance-none flex items-center justify-between w-full`,a?``:`opacity-30`,u?`border-lofty`:`border-white dark:border-lofty-purple-600`,!a&&`border-gray-400`,`border-2 rounded-xl`,u?Va:`bg-transparent`,a?`cursor-pointer`:`cursor-not-allowed`,`px-4.5 py-4 sm:py-[17px] lg:py-4 xl:py-[17px] 2xl:px-6 2xl:py-[22px]`].filter(Boolean).join(` `),children:[(0,V.jsxs)(`div`,{className:[`flex items-center text-lofty-purple-600 dark:text-white max-w-full`,`text-sm leading-4 sm:text-lg sm:leading-5 lg:text-sm lg:leading-4 xl:text-lg xl:leading-5 2xl:text-2xl 2xl:leading-7`].join(` `),children:[e.logo?typeof e.logo==`string`?(0,V.jsx)(`img`,{className:`w-6 inline-block mr-3`,src:e.logo,alt:`logo`}):(0,V.jsx)(`span`,{className:`w-6 inline-block mr-3`,children:e.logo}):null,(0,V.jsxs)(`div`,{className:`flex flex-col items-start max-w-full`,children:[(0,V.jsxs)(`div`,{className:`capitalize font-bold text-lofty-purple-600 dark:text-white max-w-full flex items-center`,children:[(0,V.jsx)(`span`,{className:`whitespace-nowrap overflow-hidden text-ellipsis`,children:e.displayName||e.name}),!a&&(0,V.jsx)(`span`,{className:`pl-2 uppercase font-normal text-mxs sm:text-sm lg:text-mxs xl:text-sm 2xl:text-lg`,children:`Planned`}),(0,V.jsx)(`span`,{className:`pl-2 text-mxs sm:text-13 2xl:text-base text-lofty-purple-600 font-light whitespace-nowrap`,children:e.number})]}),o&&e.subtitle&&(0,V.jsx)(`span`,{className:`text-lofty-purple-600 dark:text-white text-sm text-left`,children:e.subt
2itle})]})]}),u&&(0,V.jsx)(_e,{color:`text-lofty dark:text-lofty-purple-600`,className:`w-3.5 sm:w-[17px] lg:w-3.5 xl:w-[17px] 2xl:w-6`})]})}var Ua=({label:e,tooltip:t,htmlFor:n,nowrap:r=!1})=>(0,V.jsxs)(`label`,{className:`flex font-semibold text-sm sm:text-lg lg:text-sm xl:text-lg 2xl:text-2xl text-lofty-gray-700 dark:text-slate-200`,htmlFor:n??void 0,children:[t&&(0,V.jsxs)(Oe,{className:`flex max-w-fit items-center`,placement:`bottom`,content:(0,V.jsx)(`div`,{className:`block max-w-350-px p-2 text-left`,children:(0,V.jsx)(`span`,{children:t})}),children:[(0,V.jsx)(`span`,{className:r?`whitespace-nowrap`:void 0,children:e}),(0,V.jsx)(`i`,{className:`fas fa-info-circle ml-2 cursor-pointer text-xs text-lofty-purple mr-2`})]}),!t&&(0,V.jsx)(`span`,{className:r?`whitespace-nowrap`:void 0,children:e})]}),Wa=`Larger orders using the market order type can move the market price, so not all your shares in your order will be executed at the displayed price. This is called slippage and is a risk with market orders.`;function Ga({currencies:e,value:t,handleSelection:n,onChange:r,onBlur:i,type:a,sell:o=!1,isSell:s=!1,compareField:c,variant:l}){return(0,V.jsx)(`div`,{className:l===`method`?`flex flex-col gap-y-2`:`flex flex-col gap-y-3 2xl:grid 2xl:grid-cols-2 2xl:gap-4.5`,children:e.map(e=>(0,V.jsx)(Ha,{currency:e,compareField:c,handleSelection:n,selected:o||t&&e[c]?.toUpperCase()===t.toUpperCase(),active:!e.planned,onChange:r,onBlur:i,showFees:!s||a===`marketSelector`,variant:l},e[c]))})}var Ka=({label:e,subText:t,tooltip:n,selectedCurrency:r,openModal:i,sell:a=!1,currency:o=!1,currencyNumber:s,rentBalance:c,giftBalance:l,isMarketOrder:u,currentMarketPrice:d,onOpenApplyBalanceModal:f,compact:p=!1})=>p?(0,V.jsxs)(`div`,{className:`py-2`,children:[(0,V.jsxs)(`div`,{className:`flex flex-row justify-between items-center mb-1.5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(`span`,{className:`text-[9px] font-bold uppercase tracking-[0.08em] text-lofty-gray-700 dark:text-white/50`,children:e}),!!n&&(0,V.jsx)(Ua,{label:``,tooltip:n,htmlFor:null,nowrap:!0})]}),t&&(0,V.jsx)(`span`,{className:`text-xs text-lofty-gray-500 dark:text-white/60`,children:t})]}),(0,V.jsxs)(`button`,{type:`button`,onClick:i,className:`w-full flex items-center justify-between gap-3 px-3.5 py-2.5 rounded-xl border border-exchange-ligthgray dark:border-white/30 hover:border-lofty-purple dark:hover:border-white/60 transition-colors text-left`,children:[(0,V.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0 flex-1`,children:[(0,V.jsx)(`span`,{className:`capitalize text-sm font-semibold text-lofty-gray-700 dark:text-white truncate`,children:r}),s&&(0,V.jsx)(`span`,{className:`text-xs text-lofty-purple-600 dark:text-lofty-purple-50 font-light truncate`,children:s})]}),(0,V.jsxs)(`span`,{className:`flex items-center gap-1 text-xs font-medium text-lofty-purple dark:text-white/70 whitespace-nowrap`,children:[`Change`,(0,V.jsx)(de,{color:`text-lofty-purple dark:text-white/70`})]})]}),!!f&&(l||c)&&(0,V.jsxs)(`div`,{className:`flex justify-end gap-2 mt-1.5`,children:[l&&(0,V.jsx)(`button`,{type:`button`,className:`text-[11px] text-lofty cursor-pointer border border-lofty rounded-full font-medium px-3 py-0.5 text-nowrap dark:text-white dark:border-white`,onClick:()=>f(L.Gift),children:`Apply gift balance`}),c&&(0,V.jsx)(`button`,{type:`button`,className:`text-[11px] text-lofty cursor-pointer border border-lofty rounded-full font-medium px-3 py-0.5 text-nowrap dark:text-white dark:border-white`,onClick:()=>f(L.Rent),children:`Apply rent balance`})]})]}):(0,V.jsxs)(`div`,{className:`py-3 cursor-pointer`,role:`button`,tabIndex:-1,children:[(0,V.jsxs)(`div`,{onClick:i,children:[(0,V.jsxs)(`div`,{className:`flex flex-row justify-between items-center`,children:[(0,V.jsx)(Ua,{label:e,tooltip:n,htmlFor:null,nowrap:!0}),t&&(0,V.jsx)(`label`,{className:`flex items-center ml-1 text-right text-mxs sm:text-sm lg:text-mxs xl:text-sm 2xl:text-lg text-lofty-gray-500 dark:text-white leading-5`,children:t})]}),(0,V.jsx)(`div`,{className:`border-2 border-exchange-ligthgray dark:border-white/40 rounded-xl flex justify-between mt-2 sm:mt-3 lg:mt-2 xl:mt-3 2xl:mt-4 p-4 sm:p-3 lg:p-4 xl:p-6 2xl:p-8`,children:(0,V.jsxs)(`div`,{className:`flex items-center cursor-pointer justify-between w-full font-semibold text-lofty-gray-700 dark:text-white`,children:[(0,V.jsxs)(`span`,{className:`capitalize`,children:[(0,V.jsx)(`span`,{className:`text-lg sm:text-2xl lg:text-lg xl:text-2xl 2xl:text-32 dark:text-white`,children:r}),s&&(0,V.jsx)(`span`,{className:`pl-2 text-sm lg:text-xl text-lofty-purple-600 dar
2k:text-lofty-purple-50 font-light`,children:s})]}),(0,V.jsx)(de,{color:`text-lofty-gray-500`})]})})]}),(0,V.jsx)(`div`,{className:`text-lofty-gray-500 dark:text-slate-300 whitespace-nowrap`,children:(0,V.jsxs)(`div`,{className:`flex justify-end mt-2 sm:mt-3 lg:mt-2 xl:mt-3 2xl:mt-4 text-mxs sm:text-sm lg:text-mxs xl:text-sm 2xl:text-lg`,children:[(0,V.jsxs)(`div`,{className:`flex space-x-4`,children:[!!f&&l&&(0,V.jsx)(`button`,{type:`button`,className:`text-lofty cursor-pointer border border-lofty rounded-full font-medium px-8 py-1 text-nowrap dark:text-white dark:border-white`,onClick:()=>f(L.Gift),children:`Add gift balance`}),!!f&&c&&(0,V.jsx)(`button`,{type:`button`,className:`text-lofty cursor-pointer border border-lofty rounded-full font-medium px-8 py-1 text-nowrap dark:text-white dark:border-white ${l&&c?`bg-lofty text-white`:``}`,onClick:()=>f(L.Rent),children:`Add rent balance`})]}),u&&(d??0)>0&&(0,V.jsxs)(`div`,{className:`flex`,children:[(0,V.jsx)(`span`,{className:`font-bold ml-1`,children:`$${h(d??0,{minimumFractionDigits:2})}`}),(0,V.jsx)(`span`,{className:`ml-1`,children:`Current Market Price/share`}),(0,V.jsxs)(Oe,{className:`flex max-w-fit items-center ml-2`,placement:`bottom`,content:(0,V.jsx)(`div`,{className:`flex max-w-350-px p-2 text-left whitespace-normal`,children:(0,V.jsx)(`span`,{children:Wa})}),children:[(0,V.jsx)(`button`,{type:`button`,className:`underline decoration-dotted text-mxs sm:text-sm`,children:`What's this?`}),(0,V.jsx)(`span`,{className:`sr-only`,children:Wa}),(0,V.jsx)(`i`,{className:`fa-solid fa-circle-question cursor-pointer text-xs text-lofty-purple ml-1 mr-2`})]})]})]})})]}),qa={name:`Add payment method`,symbol:``};function Ja({control:e,currencies:t,sell:n=!1,title:o,subText:c,description:u,currency:d,tooltip:f,useBalances:p,addPaymentMethod:h,isMarketOrder:g,currentMarketPrice:_,name:v,type:y,compareField:b=`symbol`,compact:x=!1}){let{field:S}=m({name:v??(d?`paymentCurrency`:`paymentMethod`),control:e,rules:{required:!0}}),{isModalOpen:C,openModal:w,closeModal:T}=a(),E=a(),D=t.length>0,O=D?t.find(e=>S&&e&&e[b]?.toUpperCase()===S.value?.toUpperCase())??t[0]:qa,k=i(r),A=x,j=()=>{h&&E.openModal()},M=()=>{j()};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Ka,{label:o,text:u??``,icon:O?.logo,selectedCurrency:O?.displayName||O.name,currencyNumber:O?.number,subText:c,openModal:()=>{D?w():M()},sell:n,currency:d,tooltip:f,giftBalance:(p?.gift??0)>0&&p?.showGift,rentBalance:(p?.rent??0)>0&&p?.showRent,onOpenApplyBalanceModal:p?.onOpenApplyBalanceModal,isMarketOrder:g,currentMarketPrice:_,compact:x}),!!h&&(0,V.jsx)(Ra,{isOpen:E.isModalOpen,onClose:E.closeModal,addPaymentMethod:e=>{h(e),E.closeModal(),T()},onSuccess:()=>{},wallets:k,isMarketOrder:g,cardFlow:`checkout`}),(0,V.jsxs)(l,{id:`CurrencySelector`+S.name,isOpen:C,onBackdropClick:T,onRequestClose:T,minHeight:``,className:{container:A?`border-none w-full sm:max-w-[400px] bg-white dark:bg-lofty-purple-700`:`border-none overflow-auto w-full h-full lg:w-[428px] lg:h-auto xl:w-640-px 2xl:w-960-px`,content:A?`flex flex-1 flex-col p-6 relative`:`w-full h-full flex flex-col px-4.5 py-5 lg:py-8 xl:px-6 2xl:px-8 2xl:py-12 ${n?`bg-[#F7F7F7] dark:bg-lofty-purple-700`:`bg-lofty-purple-50 dark:bg-lofty-purple-700`}`},showCloseBtn:A,children:[A?(0,V.jsxs)(`div`,{className:`pt-2`,children:[!!h&&(0,V.jsx)(`button`,{type:`button`,onClick:M,className:`mb-3 ml-auto block text-sm font-medium text-lofty hover:underline`,children:`Add Payment Method`}),(0,V.jsx)(`h2`,{className:`font-abc-favorit-arabic-trial text-2xl font-bold text-lofty-purple-600 dark:text-white leading-tight mb-2`,children:o}),!!u&&!(d&&!n)&&(0,V.jsx)(`p`,{className:`font-abc-favorit-arabic-trial text-sm text-lofty-gray-500 dark:text-lofty-gray-200 mb-8`,children:u}),(0,V.jsx)(`div`,{className:`flex flex-col gap-y-2 mt-4 mb-6`,children:(0,V.jsx)(Ga,{onChange:!n||!d?S.onChange:()=>{},onBlur:!n||!d?S.onBlur:()=>{},value:S.value,compareField:b,currencies:t,handleSelection:T,sell:n&&d,isSell:n,type:y,variant:`method`})})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsx)(s,{onClick:T}),!!h&&(0,V.jsx)(`button`,{type:`button`,className:`text-lofty text-md cursor-pointer float-right`,onClick:M,children:`Add Payment Method`})]}),(0,V.jsx)(`h1`,{className:[`font-bold text-lofty-purple-600 dar
2k:text-white mt-4.5`,`text-28 sm:text-4xl lg:text-28 xl:text-5xl 2xl:text-64 2xl:leading-tight`].join(` `),children:o}),(0,V.jsx)(`div`,{className:`text-sm sm:text-lg lg:text-sm xl:text-xl 2xl:text-2xl mb-2 text-m text-lofty-gray-800 dark:text-slate-500`,children:!n&&d?(0,V.jsx)(`p`,{className:`py-4`,children:(0,V.jsx)(`a`,{href:`https://www.lofty.ai/learn/now-buy-real-estate-with-cryptocurrency-on-lofty-ai`,target:`_blank`,rel:`noreferrer`,className:`underline text-lofty-gray-800`,children:`Learn how to get crypto`})}):u})]}),!A&&(0,V.jsx)(Ga,{onChange:!n||!d?S.onChange:()=>{},onBlur:!n||!d?S.onBlur:()=>{},value:S.value,compareField:b,currencies:t,handleSelection:T,sell:n&&d,isSell:n,type:y})]})]})}var Ya=[{id:O.Algorand,name:`Algorand`,symbol:`ALGO`,network:y.Algorand,logo:(0,V.jsx)(ve,{className:`h-6 w-6`}),qrImage:`/static/img/crypto-logos/qr-logo-algorand.png`},{id:O.USDCoin,name:`USDC (Algorand)`,symbol:`USDC`,network:y.Algorand,logo:(0,V.jsx)(pe,{className:`h-6 w-6`}),qrImage:`/static/img/crypto-logos/qr-logo-usdc.png`},{id:O.STBL,name:`STBL (Algorand)`,symbol:`STBL`,network:y.Algorand,logo:(0,V.jsx)(me,{size:`h-6 w-6`}),qrImage:`/static/img/crypto-logos/qr-logo-stbl.png`},{id:O.Ethereum,name:`Ethereum`,symbol:`ETH`,network:y.Ethereum,logo:(0,V.jsx)(`div`,{className:`flex items-center justify-center rounded-full border-2 h-6 w-6`,children:(0,V.jsx)(fe,{className:`h-6 w-6`,circle:!1})}),qrImage:`/static/img/crypto-logos/qr-logo-ethereum.png`}],Xa=[`Sign on behalf of the membership during escrow`,`Sign property manager agreements on behalf of the membership`,`Act as a liaison to transfer information between the ownership and the 3rd party property manager`,`Distribute rent income pro-rata to each owner's entitled share`,`Carry out the wishes of the membership as determined by the governance program`],Za=({number:e,children:t})=>(0,V.jsxs)(`div`,{className:`flex gap-3 rounded-xl bg-lofty-purple-50 dark:bg-lofty-purple-700 py-3.5 px-4`,children:[(0,V.jsx)(`span`,{className:`shrink-0 flex items-center justify-center h-7 w-7 rounded-full 3 bg-[#4D3FED1A] dark:bg-[#9383FF26] 4 text-[13px] font-bold text-lofty dark:text-lofty-purple`,children:e}),(0,V.jsx)(`div`,{className:`flex-1 text-[13px] leading-[1.55] text-lofty-purple-600 dark:text-lofty-gray-200`,children:t})]}),Qa=e=>{let{isOpen:t,onClose:n,onSigned:r,propertyInfo:i}=e,[a,o]=(0,H.useState)(!1),[s,c]=(0,H.useState)(!1),[u,d]=(0,H.useState)(null),[f,p]=(0,H.useState)(!1),m=(0,H.useRef)(null);(0,H.useEffect)(()=>()=>{m.current&&clearTimeout(m.current)},[]);let h=async()=>{d(null),c(!0);try{if(!i.participant_app_id)throw Error(`No DAO App ID`);let e=await D({appIds:[i.participant_app_id]});if(!e)throw Error(`DAO agreement signing failed`);if(!e.success&&e.error)throw Error(e.error);p(!0),c(!1),m.current=setTimeout(()=>{r(!0)},1200)}catch(e){d(e.message||`There was an error signing the co-owner agreement.`),r(!1),c(!1)}},g=e=>{(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),o(!a))},_=i.documents?.find(e=>e.title===`Documents`)?.targetUrl,v=i.documents?.find(e=>e.title===`Operating Agreement`)?.targetUrl??_??`/terms`;return(0,V.jsx)(l,{id:`marketplace-accept-terms`,isOpen:t,onBackdropClick:n,onRequestClose:n,className:{container:[`border-none w-full h-full lg:h-auto lg:max-w-[520px]`,`bg-white dark:bg-lofty-purple-800`,`lg:rounded-[20px]`,`lg:shadow-[0_8px_48px_rgba(0,0,0,0.11)] dark:lg:shadow-[0_8px_48px_rgba(0,0,0,0.25)]`,`font-inter`].join(` `),content:`m-0 p-0 h-full flex`,overflow:`hidden`},showCloseBtn:!1,children:(0,V.jsxs)(`div`,{className:`flex flex-col w-full h-full`,children:[(0,V.jsxs)(`div`,{className:`flex-1 overflow-y-auto overscroll-contain dao-agreement-scrollbar 5 px-6 pt-6 pb-6 lg:px-8 lg:pt-8 lg:max-h-[70vh]`,children:[!!n&&(0,V.jsx)(`button`,{type:`button`,onClick:n,className:`absolute top-4 right-4 lg:top-5 lg:right-5 p-2 min-w-[44px] min-h-[44px] 6 flex items-center justify-center rounded-full 7 text-lofty-gray-500 hover:text-lofty-gray-700 dark:text-lofty-gray-700 dark:hover:text-lofty-gray-500 8 hover:bg-lofty-purple-50 dark:hover:bg-lofty-purple-700 9 transition-colors`,"aria-label":`Close`,children:(0,V.jsx)(`svg`,{className:`h-5 w-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 18L18 6M6 6l12 12`})})}),(0,V.jsx)(`div`,{className:`flex justify-center mt-5 mb-5`,children:(0,V.jsx)(`div`,{className:`flex items-center justify-center h-16 w-16 rounded-full bg-[#4D3FED1A] dar
9k:bg-[#9383FF1A]`,children:(0,V.jsx)(`svg`,{className:`h-8 w-8 text-lofty dark:text-lofty-purple`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.5,d:`M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z`})})})}),(0,V.jsx)(`h2`,{className:`text-[20px] sm:text-[22px] font-bold tracking-[-0.3px] text-center text-lofty-purple-600 dark:text-lofty-gray mb-2`,children:`Please review co-owner agreement`}),(0,V.jsx)(`p`,{className:`text-sm leading-[1.5] text-center text-lofty-gray-500 mb-4`,children:`You must review and agree to the terms below before you can receive shares for this property.`}),(0,V.jsx)(`p`,{className:`text-sm font-medium text-lofty-purple-600 dark:text-lofty-gray-200 leading-[1.5] mb-3`,children:`By purchasing a share, you agree to become a co-owner in a property with other owners and acknowledge the following:`}),(0,V.jsxs)(`div`,{className:`space-y-2.5 mb-4`,children:[(0,V.jsxs)(Za,{number:1,children:[`You have read all legal disclaimers and the operating agreement for this specific property membership`,` `,(0,V.jsxs)(`a`,{href:v,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 px-2.5 py-0.5 ml-1 10 rounded-full text-xs font-semibold 11 bg-[#4D3FED1A] dark:bg-[#9383FF26] 12 text-lofty dark:text-lofty-purple 13 hover:bg-[#4D3FED33] dark:hover:bg-[#9383FF40] 14 transition-colors`,children:[`here`,(0,V.jsx)(`svg`,{className:`h-3 w-3`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M7 17L17 7M17 7H7M17 7v10`})})]})]}),(0,V.jsxs)(Za,{number:2,children:[(0,V.jsx)(`span`,{children:`You agree to elect Lofty AI, Inc. as a representative of the membership with limited powers to perform the following acts:`}),(0,V.jsx)(`ul`,{className:`mt-2.5 space-y-1.5 pl-2`,children:Xa.map((e,t)=>(0,V.jsxs)(`li`,{className:`flex items-start gap-2 text-xs leading-[1.5] text-lofty-gray-700 dark:text-lofty-gray-500`,children:[(0,V.jsx)(`span`,{className:`shrink-0 mt-[7px] h-[5px] w-[5px] rounded-full bg-lofty-gray-500 dark:bg-lofty-gray-700`}),e]},t))})]}),(0,V.jsx)(Za,{number:3,children:`You understand that you are responsible as a co-owner to vote through the governance program to manage your property when necessary and that voting is mandatory.`}),(0,V.jsx)(Za,{number:4,children:`Your co-ownership in a given property is in effect when you hold at least 1 property share in that property.`})]})]}),(0,V.jsxs)(`div`,{className:`shrink-0 px-6 pb-6 pt-5 lg:px-8 lg:pb-7 15 border-t border-[#4D3FED14] dark:border-[#9383FF20]`,style:{paddingBottom:`max(1.75rem, env(safe-area-inset-bottom))`},children:[(0,V.jsxs)(`div`,{className:`flex items-start gap-3 cursor-pointer group mb-5`,onClick:()=>o(!a),children:[(0,V.jsx)(`div`,{role:`checkbox`,"aria-checked":a,"aria-required":`true`,"aria-label":`I certify that I have read Lofty AI's Terms of Service`,tabIndex:0,onKeyDown:g,className:`shrink-0 mt-0.5 h-[22px] w-[22px] rounded-md flex items-center justify-center 16 transition-colors border-2 outline-none 17 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-lofty 18 ${a?`border-lofty dark:border-lofty-purple bg-lofty dark:bg-lofty-purple`:`border-lofty dark:border-lofty-purple bg-transparent group-hover:border-lofty-purple-600 dark:group-hover:border-lofty-gray`}`,children:a&&(0,V.jsx)(`svg`,{className:`h-3.5 w-3.5 text-white`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:3,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M5 13l4 4L19 7`})})}),(0,V.jsx)(`span`,{className:`text-[13px] leading-normal select-none text-lofty-gray-700 dark:text-lofty-gray-500`,children:`I certify that I have read Lofty AI's Terms of Service in full and agree that I am qualified to invest in this offering`})]}),u&&(0,V.jsxs)(`div`,{className:`flex items-start gap-2.5 p-3 rounded-xl mb-4 19 bg-red-50 dark:bg-red-500/10 20 border border-red-200 dark:border-red-500/20`,children:[(0,V.jsx)(`svg`,{className:`shrink-0 h-5 w-5 text-red-500 dark:text-red-400 mt-0.5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v3.75m9-.75
20a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z`})}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`p`,{className:`text-sm font-medium text-red-800 dark:text-red-300`,children:u}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>d(null),className:`mt-1 text-xs font-medium text-red-600 dark:text-red-400 21 hover:text-red-800 dark:hover:text-red-300 underline`,children:`Dismiss`})]})]}),(0,V.jsx)(`button`,{type:`button`,disabled:!a||s||f,onClick:h,className:` 22 w-full h-[52px] rounded-[49px] text-lg font-bold transition-all duration-200 23 flex items-center justify-center 24 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-lofty 25 ${a&&!s&&!f?`bg-lofty text-lofty-gray hover:brightness-[1.1] hover:shadow-lg hover:shadow-lofty/25 active:scale-[0.98]`:`bg-lofty/30 dark:bg-lofty/20 text-lofty-gray-500 cursor-not-allowed`} 26 `,children:f?(0,V.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`svg`,{className:`h-5 w-5 text-white animate-scaleIn`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M5 13l4 4L19 7`})}),(0,V.jsx)(`span`,{children:`Agreement Signed`})]}):s?(0,V.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(he,{}),(0,V.jsx)(Ba,{label:`Signing agreement`})]}):`Agree`})]})]})})},$a=new Pe({wallets:[Me.PERA,Me.DEFLY],network:I.isProd?Ae.MAINNET:Ae.TESTNET,algod:{baseServer:Ie.algodServer,token:Ie.algodToken,port:Ie.algodPort}});function eo({children:e}){return(0,V.jsx)(Ne,{manager:$a,children:e})}var to=2,no=class extends H.Component{state={failed:!1,crashes:0};static getDerivedStateFromError(){return{failed:!0}}componentDidMount(){f(()=>{this.setState(e=>e.failed&&e.crashes<=to?{...e,failed:!1}:e)})}componentWillUnmount(){f(null)}componentDidCatch(e){this.setState(e=>({...e,crashes:e.crashes+1})),ae(e instanceof Error?e:Error(String(e)),`UnifoldErrorBoundary`,{})}render(){return this.state.failed?this.props.fallback:this.props.children}};function ro({children:e}){let t=le().unifoldPublishableKey||`pk_dev_local_placeholder`;return(0,V.jsx)(no,{fallback:e,children:(0,V.jsx)(u,{publishableKey:t,config:{modalTitle:`Deposit USDC`,display:{transferCrypto:{exchangeRate:!0}}},children:e})})}function io({children:e}){return(0,V.jsx)(eo,{children:(0,V.jsx)(ro,{children:e})})}function ao({children:e}){return typeof io==`function`?(0,V.jsx)(io,{children:e}):(0,V.jsx)(V.Fragment,{children:e})}export{Gi as $,Ft as $t,ga as A,kr as At,xa as B,Ut as Bt,Ta as C,xr as Ct,$i as D,Tr as Dt,ta as E,Ar as Et,aa as F,pr as Ft,Xi as G,Gt,ua as H,Ht,Sa as I,ur as It,qi as J,Xt as Jt,zi as K,qt as Kt,va as L,$t as Lt,Ea as M,fr as Mt,oa as N,dr as Nt,na as O,Er as Ot,ia as P,Or as Pt,Yi as Q,Pt as Qt,ba as R,Zt as Rt,Ca as S,sr as St,Qi as T,wr as Tt,da as U,Wt as Ut,sa as V,Kt as Vt,Ki as W,It as Wt,Wi as X,zt as Xt,Ui as Y,Yt,Zi as Z,Lt as Zt,Ma as _,Cr as _t,Ua as a,Ot as an,Mi as at,Oa as b,_r as bt,Ra as c,Ge as cn,oi as ct,ka as d,He as dn,Wr as dt,Nt as en,Bi as et,ja as f,Le as fn,Kr as ft,ha as g,Dr as gt,ma as h,or as ht,Ja as i,xt as in,Pi as it,_a as j,yr as jt,ea as k,vr as kt,Pa as l,Ve as ln,ii as lt,pa as m,hr as mt,Qa as n,yt as nn,Vi as nt,Ba as o,We as on,Ni as ot,Aa as p,mr as pt,Ji as q,Jt as qt,Ya as r,At as rn,Fi as rt,za as s,Ke as sn,ri as st,ao as t,jt as tn,Hi as tt,ca as u,Be as un,Zr as ut,la as v,cr as vt,ra as w,gr as wt,wa as x,Sr as xt,Da as y,lr as yt,ya as z,Vt as zt};
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.