1import{A as e,a as t}from"./dist-DiEP1Qns.js";import{vn as n}from"./runtime-core.esm-bundler-BKdLzFmX.js";import{t as r}from"./appVariables-if8fQ3xE.js";var i={data:{email:`email_required`,email_invalid:`email_invalid`,name:`name_required`,price:`price_required`,fields:{email:`Please enter the email address.`,password:`Please enter the password.`,otp:`Paste the verification code here.`,project_slug:`Please enter the username.`,profile_full_name:`Please enter the name.`,project_description_small:`Please enter a description for your page.`,website_link:`Please enter a link.`,profile_picture:`Please upload your profile picture.`,confirm_password:`Please enter the confirm password.`}}},a={GBP:`£`,EUR:`â¬`,USD:`$`,AUD:`AU$`,NZD:`NZ$`,INR:`â¹`,CAD:`CA$`,BRL:`R$`,CZK:`CZK `,DKK:`DKK `,HKD:`HK$`,HUF:`HUF `,MXN:`MX$`,NOK:`NOK `,PLN:`PLN `,SGD:`S$`,SEK:`SEK `},o={USD:` United States Dollar `,GBP:` British Pound Sterling `,EUR:` Euro `,AUD:` Australian Dollar `,BRL:` Brazilian Real `,CAD:` Canadian Dollar `,CZK:` Czech Koruna `,DKK:` Danish Krone `,HKD:` Hong Kong Dollar `,HUF:` Hungarian Forint `,INR:` Indian Rupee `,MXN:` Mexican Peso `,NOK:` Norwegian Krone `,NZD:` New Zealand Dollar `,PLN:` Polish ZÅoty `,SGD:` Singapore Dollar `,SEK:` Swedish Krona `},s={MONTH:`month`,YEAR:`year`,LIFETIME:`lifetime`,GIVEAWAY:`lifetime-giveaway`},c=`.buymeacoffee.com`,l=r.IsBrowser?window.pageYOffset||document.documentElement.scrollTop:null,u={getMembershipTitle(e,t){let n=t.duration===s.YEAR?e.price_yearly_converted:e.price_monthly_converted,r=t.duration===s.YEAR?t.membership_level.price_yearly_converted:t.duration===s.LIFETIME?t.membership_level.price_lifetime_converted:t.membership_level.price_monthly_converted;return parseFloat(r)>=parseFloat(n)&&parseFloat(n)!==0?`down`:`up`},convertAmountToPay(e){let t=this.getExchangeRate(),n=Number(e);return parseFloat(t)===1?n:n>50?Math.ceil(n/5)*5:Math.ceil(n)},validationCheck(e){let t=this;return new Promise((n,r)=>{Object.keys(e).forEach(function(n){if(e[n]===``){let t=``;i.data[n]&&(t=`lang.error.${i.data[n]}`),e.setError({[n]:t})}else n.indexOf(`email`)>-1&&!t.validateEmail(e[n])?e.setError({[n]:`lang.error.${i.data[n+`_invalid`]}`}):e.clearErrors(n)}),t.getObjectLength(e.errors)>0?r(!1):n(!0)})},getObjectLength(e){return Object.keys(e).length},loginUrl(e=!0){let n=``;if(e){let e=t().props.ziggy?.location||(r.IsBrowser?window.location.href:``);e&&(n=`?redirect=${e}`)}return`${r.appUrl}/login${n}`},linkToLoginPage(){r.IsBrowser&&(window.location=this.loginUrl())},handleErrorArray(e){let t={};for(let n in e)t[n]=e[n][0];return t},inputEmptyCheck(e,t){return e===``?{status:!0,error:`${t}_required`}:{status:!1,error:``}},validationCheckV1(e){let t=[];for(let n in e)e[n]===``&&(t[n]=i.data.fields[n]);let n=!0;return Object.keys(t).length>0&&(n=!1),{status:n,error:t}},isGreaterAmount(e,t,n){return t>e?{status:!0,error:`${n}_greater_than_amt`}:{status:!1,error:``}},countCheck(e,t){let n=``;return n=e>1?`${t}s`:t,n},widgetType(){return t().props.creator_data.data.donation_settings.widget_version},userCurrency(){return this.getCurrencySymbol(t().props.creator_data.data.currency)},userCurrencyConverted(){return this.getCurrencySymbol(t().props.creator_data.data.currency_converted)},userCurrencyCode(){return this.checkFlagStatus(t().props.creator_data.data,`multiple_currency`)?t().props.meta.data.currency:t().props.creator_data.data.currency},getCurrencySymbol(e){return a[e]},async copyLink(e,t){if(r.IsBrowser){try{await navigator.clipboard.writeText(t);return}catch(e){console.warn(`Clipboard API failed, using fallback.`,e)}let n=document.getElementById(e);n.innerHTML=t;let r=document.createRange();r.selectNodeContents(n);let i=window.getSelection();i.removeAllRanges(),i.addRange(r),document.execCommand(`copy`),i.removeAllRanges()}},showFullModalOnMobile(e){if(r.IsBrowser&&window.innerWidth<=768)return window.innerHeight<e},checkHtmlContentLength(e){return e.replace(/(<([^>]+)>)/gi,``).length},checkFileIsImage(e){return!!(e.type.match(`jpeg|jpg|png|gif`)&&e.type!=`image/svg+xml`)},disableDecimalPoints(e){if((e.charCode?e.charCode:e.keyCode)==46)return e.preventDefault(),!1},numberFormatWithdecimals(e,t,n){return t==`max`?Number(e).toLocaleStr
1ing(`en-US`,{maximumFractionDigits:n}):Number(e).toLocaleString(`en-US`,{minimumFractionDigits:n})},numberFormat(e){let t=Number(e);return Number.isInteger(t)?t.toLocaleString():t.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})},checkHttpExits(e){return!!(e&&(e.indexOf(`https://`)>-1||e.indexOf(`http://`)>-1||e.indexOf(`Https://`)>-1||e.indexOf(`Http://`)>-1))},mathRound(e){return Math.round(e*100)/100},scrollTopTop(e=`smooth`){r.IsBrowser&&window.scrollTo({top:0,left:0,behavior:e})},scrollToElement(e,t,n){e.scrollIntoView({behavior:`smooth`,block:n})},scrollToElementTop(e,t=0){window.scrollTo({top:e.getBoundingClientRect().top+document.documentElement.scrollTop+t,left:0,behavior:`smooth`})},validateEmail(e){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},disableBodyScrolling(){r.IsBrowser&&setTimeout(()=>{document.body.classList.add(`modal-open`)},100)},trimUrl(e){return e.replace(/http(s)?(:)?(\/\/)?|(\/\/)?(www\.)?/g,``)},stripHtmlTags(e){return e.replace(/<[^>]*>?/gm,``)},secondsToHms(e){e=Number(e);let t=Math.floor(e/3600).toString().padStart(2,`0`),n=Math.floor(e%3600/60).toString().padStart(2,`0`),r=Math.floor(e%60).toString().padStart(2,`0`),i=t>0?`${t}:`:``,a=n>0?`${n}:`:`00:`,o=r>0?`${r}`:`00`;return i+a+o},sanitizeTweet(e){if(r.IsBrowser){let t=document.createElement(`div`);t.innerHTML=e;let n=t.firstChild.nodeValue;return encodeURIComponent(n)}return``},sanitizeHtml(e,t=!1,n=null){if(e==null||e===``)return``;let r=String(e);if(n?.length){let e=new Set(n.map(e=>e.toLowerCase()));r=r.replace(/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/gi,(t,n)=>{let r=n.toLowerCase();return e.has(r)?t.startsWith(`</`)?`</${r}>`:`<${r}${[...t.matchAll(/\s(href|target|rel)\s*=\s*(["'])(?:(?!\2).)*\2/gi)].map(e=>e[0]).join(``)}>`:``})}return t&&(r=r.replace(/\s+href\s*=\s*(['"]).*?\1/gi,``)),r},trimBrTags(e){return e.replace(/^(<br\s*\/?>)+|(<br\s*\/?>)+$/gi,``)},linkify(e){if(e)return e.replaceAll(`&`,`&`).replace(/<a(?:\s[^>]*)?>[\s\S]*?<\/a>|(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?!(?:(?:[^<]*<\/(?:img|iframe)>|[^<]*(?:img|iframe)[^>]*>)))(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$])/gi,function(e,t){if(t){let t=e.match(/href="([^"]*)/);if(t){let n=t[1],r=n.match(`^mailto:`)||n.match(`^tel:`);!n.match(`^https?://`)&&!r&&(n=`http://`+n),n.includes(`buymeacoffee.com`)&&!r&&(!n.startsWith(`http://`)&&!n.startsWith(`https://`)?n=`https://`+n:n.startsWith(`http://`)&&(n=n.replace(`http://`,`https://`)));let i=e.replace(/<\/?a[^>]*>/g,``);return`<a href="`+n+`" target="_blank" rel="noopener noreferrer nofollow">`+i+`</a>`}}let n=e;return n.match(`^https?://`)||(n=`http://`+n),n.includes(`buymeacoffee.com`)&&(!n.startsWith(`http://`)&&!n.startsWith(`https://`)?n=`https://`+n:n.startsWith(`http://`)&&(n=n.replace(`http://`,`https://`))),`<a href="`+n+`" target="_blank" rel="noopener noreferrer nofollow">`+e+`</a>`})},triggerElementOnscroll(e){if(e)return window.scrollY>e.getBoundingClientRect().top+e.clientHeight-window.innerHeight},triggerElementOnscrollInsideElement(e,t,n){let r=e.getBoundingClientRect().top-t.getBoundingClientRect().top,i=t.clientHeight,a=n.clientHeight;return e.scrollTop>r+i-a},allowOnlyNumbers(e){return!(e.which!=8&&e.which!=0&&(e.which<48||e.which>57))},fetchDomainName(e){if(!e)return``;try{let t=/^(https?:)?\/\//i.test(e)?e:`https://${e}`;return new URL(t).hostname.replace(/^www\./i,``).toLowerCase()}catch{return``}},manualUrlChange(e){r.IsBrowser&&window.history.pushState(``,``,e)},enablePopState(t){let n=!1;addEventListener(`popstate`,r=>{n||=(e.visit(t,{preserveScroll:!0}),!0)})},checkAStringExistOrNot(e,t){return e.indexOf(t)>-1},replaceStringWithEmpty(e,t){return e.replace(t,``)},getImageWidthAndHeightAndSrc(e,t){if(r.IsBrowser){let n=window.URL||window.webkitURL,r=new Image;r.src=n.createObjectURL(e),r.onload=function(){t(this.src,this.width,this.height)}}},findObjectIndex(e,t){return e.findIndex((e=>e.id==t))},getLastChildFromArray(e){return e?e[e.length-1]:``},checkIsSmallDevice(){return r.IsBrowser&&window.innerWidth<=480},checkIsMobile(){return r.IsBrowser&&window.innerWidth<=768},checkIsTab(){return r.IsBrowser&&window.innerWidth<=991},getFirstName(e){return e.split(` `)[0]},addNoFollowAndTargetBlankToAnchorTag(e){document.querySelectorAll(e).forEach(e
1=>{e.setAttribute(`rel`,`nofollow`),e.setAttribute(`target`,`_blank`)})},removeUnWantedPTags(e){document.querySelectorAll(e).forEach(e=>{e.innerText.length===1&&e.getElementsByTagName(`img`).length===0&&e.getElementsByTagName(`iframe`).length===0&&e.remove()})},removeEmptyPTags(e){let t=document.querySelector(e),n=Array.from(t.querySelectorAll(`:scope > p`)),r=e=>e.innerHTML.replace(/<br\s*\/?>/gi,``).replace(/ /gi,``).trim()===``;for(;n.length&&r(n[0]);)n[0].remove(),n.shift();for(;n.length&&r(n[n.length-1]);)n[n.length-1].remove(),n.pop()},getCookie(e){return`; ${document.cookie}`.indexOf(e)>-1},deleteCookieByName(e){r.IsBrowser&&(document.cookie=e+`=; Path=/;domain=${c}; Expires=Thu, 01 Jan 1970 00:00:01 GMT;`)},getCookieValue(e,t=``){let n=`; ${document.cookie}`.split(`; ${e}=`);return n.length===2?n.pop().split(`;`).shift():t},getCookieValueJson(e){return this.getCookieValue(e)?JSON.parse(this.getCookieValue(e)):{}},lastValueFromLocationUrl(){return window.location.pathname.split(`/`).pop()},setCookieValue(e,t,n){let r=``,i=new Date;if(n===`month`)i.setMonth(i.getMonth()+1),r=`; expires=`+i.toUTCString(),document.cookie=e+`=`+(t||``)+r+`;domain=.buymeacoffee.com;path=/`;else if(n){i.setTime(i.getTime()+n*24*60*60*1e3),r=`; expires=`+i.toUTCString();var a=JSON.stringify(t);document.cookie=e+`=`+encodeURIComponent(a)+r+`;domain=.buymeacoffee.com;path=/`}else document.cookie=e+`=`+(t||``)+`;domain=.buymeacoffee.com; path=/`},setLocalStorage(e,t,n){let r=new Date;r.setDate(r.getDate()+n);let i={...t,expiration:r.getTime()};localStorage.setItem(e,JSON.stringify(i))},getLocalStorage(e){return JSON.parse(localStorage.getItem(e))},deleteLocalStorage(e){localStorage.removeItem(e)},supportsWebp(){return new Promise(e=>{let t=new Image;t.onload=()=>e(!0),t.onerror=()=>e(!1),t.src=`data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=`})},checkAndAddHttpsToLink(e){return this.checkHttpExits(e)?e:`https://${e}`},validateImageBaseurl(e){return e.indexOf(`https://cdn.buymeacoffee.com/`)>-1},getSrcForUrl(e){let t=this.fetchDomainName(e),n;return t==`youtu.be`||t==`youtube.com`?n=this.getYouTubeVideoIdFromUrl(e):t==`vimeo.com`&&(n=this.getVimeoIdFromUrl(e)),n},getYouTubeVideoIdFromUrl(e){let t=e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=|shorts\/)([^#&?]*).*/);if(t&&t[2].length===11)return`https://www.youtube.com/embed/`+t[2]},getVimeoIdFromUrl(e){let t=/vimeo.*\/(\d+)/i.exec(e);if(t){let e=t[1];return e=`https://player.vimeo.com/video/`+e,e}},getNonce(){return t().props.nonce},triggerEnterKeyEvent(e,t){e.which===13&&t()},preventDecimalNumber(e,t){e.key===`.`&&e.preventDefault()},getParamsValueFromUrl(e){return new URL(window.location.href).searchParams.get(e)||``},removeParamsFromUrl(...t){let n=t.flatMap(e=>Array.isArray(e)?e:[e]).filter(Boolean);if(!n.length||!r.IsBrowser)return;let i=new URL(window.location.href);for(let e of n)i.searchParams.delete(e);let a=`${i.pathname}${i.search}${i.hash}`;a!==`${window.location.pathname}${window.location.search}${window.location.hash}`&&e.replace({url:a,preserveState:!0,preserveScroll:!0})},autoFocus(e){e&&document.getElementById(e).focus()},isUrl(e){return!!new RegExp(/(?:https?:\/\/|www\.|\/\/)[^\s"<]+|href\s*=\s*["']?(?:\/\/|https?:\/\/)[^"'\s>]+/i).test(e)},isiOS(){return/(iPhone|iPad|iPod|Mac)/.test(navigator.userAgent)},isAndroid(){return/Android/.test(navigator.userAgent)},openBMCApp(){this.isiOS()||navigator.userAgent.match(/Mac/i)?window.location.href=`https://apps.apple.com/us/app/buy-me-a-coffee/id1480229954`:this.isAndroid()?window.location.href=`https://play.google.com/store/apps/details?id=app.buymeacoffee&hl=en_US&pli=1`:window.location.href=`https://www.buymeacoffee.com`},getLowerCase(e){return e?e.toLowerCase():``},elementObserver(e,t,n){if(r.IsBrowser){let r=new IntersectionObserver(t,n);return r.observe(e),r}},checkScrollEvent(){let e=`static`,t=window.pageYOffset||document.documentElement.scrollTop;return t>l?e=`scrollDown`:t<l&&(e=`scrollUP`),l=t<=0?0:t,{status:e}},sortInAscendingOrder(e){return e.sort(function(e,t){return e.order-t.order})},mountComponentFromDiffPage(e){document.querySelector(e).click()},jsonDecode(e){return JSON.parse(e)},appendQueryToURL(e,t){let n=window.location.href,r=new URL(n),i=new URLSearchParams(r.
1search);i.set(e,t),r.search=i.toString();let a=r.toString();window.history.pushState({path:a},``,a)},roundLikePHP(e,t){var n=e>=0?1:-1;return parseFloat((Math.round(e*10**t+n*1e-4)/10**t).toFixed(t))},getExchangeRate(){let e=t().props.creator_data?.data;if(e&&!e.multiple_currency_enabled)return 1;let n=parseFloat(t().props.meta?.data?.exchange_rate);return Number.isFinite(n)?n:1},roundToMultipleOfFive(e){let t=this.getExchangeRate();return parseFloat(t)===1?e:e>50?Math.ceil(e/5)*5:Math.ceil(e)},getFileSizeInMB(e){return e.size/(1024*1024)},getGifURLFromId(e){return e?`https://media.giphy.com/media/${e}/200w.gif`:``},getUrlWithCdnPath(e){return e?e.startsWith(`http`)?e:`${r.cdnUrl}${e}`:``},generateTimestampedFileName(e,t){return`${e}_${new Date().toISOString().replace(/[:\-]/g,``).replace(/\.\d{3}/,``)}.${t}`},dataURLToBlob(e){let t=atob(e.split(`,`)[1]),n=[];for(let e=0;e<t.length;e++)n.push(t.charCodeAt(e));return new Blob([new Uint8Array(n)],{type:`image/jpeg`})},isMobileDevice(){return/Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent)},isIOSDevice(){return/iPhone|iPad|iPod/i.test(navigator.userAgent)},checkFlagStatus(e,t){return e.feature_flags.hasOwnProperty(t)},ToastParams:{toastIsVisible:n(!1),toastMessage:n(``),toastBackgroundColor:n(`#333`)},showToast(e,t=`#333`){this.ToastParams.toastMessage.value=e,this.ToastParams.toastBackgroundColor.value=t,this.ToastParams.toastIsVisible.value=!0,setTimeout(()=>{this.ToastParams.toastIsVisible.value=!1},2e3)},useToast(){return{toastIsVisible:this.ToastParams.toastIsVisible,toastMessage:this.ToastParams.toastMessage,toastBackgroundColor:this.ToastParams.toastBackgroundColor}},appendParamToHtmlElement(e,t,n,r){let i=RegExp(`<${t}([^>]*)>`,`g`);return e.replace(i,(e,i)=>{let a=RegExp(`\\b${n}\\s*=\\s*(['"])(.*?)\\1`,`i`),o=i.match(a);return o?o[2].trim()?e:`<${t}${i.replace(a,`${n}="${r}"`)}>`:`<${t} ${`${i.trim()} ${n}="${r}"`}>`})},userCurrencyConvertedName(){return this.getCurrencyName(t().props.creator_data.data.currency_converted)},getCurrencyName(e){return o[e]??e},sanitizeText(e){let t={"&":`&`,"<":`<`,">":`>`,""":`"`,"'":`'`};return e.replace(/&[a-z0-9#]+;/gi,e=>t[e]||e)},decodeHtmlEntities(e){if(!r.IsBrowser||!e)return e;let t=document.createElement(`textarea`),n,i=e;do n=i,t.innerHTML=i,i=t.value;while(i!==n);return i},formatToDateTimeString(e,t){let n=t.replace(/\s*:\s*/g,`:`),r=Number(n.match(/^(\d+)/)[1]),i=Number(n.match(/:(\d+)/)[1]),a=n.match(/\s(.*)$/)[1];return a==`PM`&&r<12&&(r+=12),a==`AM`&&r==12&&(r-=12),`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)} ${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}:00`},parseDateTime(e){let t=e.replace(` `,`T`),n=new Date(t);if(isNaN(n.getTime()))return{date:null,time:``};let r=new Date(n.getFullYear(),n.getMonth(),n.getDate()),i=n.getHours(),a=n.getMinutes(),o=i>=12?`PM`:`AM`;i=i%12||12;let s=a.toString().padStart(2,`0`);return{date:r,time:`${i}:${s} ${o}`}},sanitizeUrl(e){if(!e)return``;try{let t=new URL(e);return t.protocol===`https:`?t.href:``}catch{return``}},convertDaysToMonths(e){return Math.floor(e/30)}};export{a as i,s as n,o as r,u as t};
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.