PageSourceSearch

https://pixelview.io/assets/PricingNavigation-B6mLHz8-.js

js pixelview.io collected 2026-10-02 07:28:40 UTC 5,418 bytes, 1 lines download raw bytes

1import{$ as e,B as t,C as n,I as r,J as i,M as a,R as o,T as s,U as c,Z as l,at as u,c as d,j as f,k as p,m,n as h,nt as g,o as _,p as v,rt as y,s as b}from"./index-vJQRxF6f.js";import{t as x}from"./useAPI-CjJb_V9C.js";var S=f({__name:`BaseLink`,props:{name:{default:``},href:{},exact:{type:Boolean},size:{default:`md`},variant:{default:`primary`}},setup(e){let r=n(()=>/^(?:https?:|mailto:|tel:)/.test(e.href)),l=n(()=>r.value?{is:`a`,name:e.name,href:e.href,class:[`baseLink`,e.size,e.variant],target:e.href.startsWith(`http`)?`_blank`:void 0,rel:e.href.startsWith(`http`)?`noopener noreferrer`:void 0}:{is:`RouterLink`,name:e.name,to:v(e.href,m.global.locale.value),class:[`baseLink`,e.size,e.variant],activeClass:`active`,exactActiveClass:e.exact?`active`:``});return(e,n)=>(o(),s(c(l.value.is),y(a(l.value)),{default:i(()=>[t(e.$slots,`left`),t(e.$slots,`default`,{},()=>[p(u(l.value.name),1)]),t(e.$slots,`right`)]),_:3},16))}}),C=[{viewers:5,billingCycle:`monthly`,intervalMonths:1},{viewers:5,billingCycle:`quarterly`,intervalMonths:3},{viewers:5,billingCycle:`yearly`,intervalMonths:12},{viewers:10,billingCycle:`monthly`,intervalMonths:1},{viewers:10,billingCycle:`quarterly`,intervalMonths:3},{viewers:10,billingCycle:`yearly`,intervalMonths:12},{viewers:20,billingCycle:`monthly`,intervalMonths:1},{viewers:20,billingCycle:`quarterly`,intervalMonths:3},{viewers:20,billingCycle:`yearly`,intervalMonths:12}],w={5:{monthly:17500,quarterly:47200,yearly:168e3},10:{monthly:21e3,quarterly:56700,yearly:201600},20:{monthly:28500,quarterly:76900,yearly:273600}},T=()=>({assignment_token:null,campaign_id:null,country:null,currency:`usd`,currency_exponent:2,provider:`stripe`,plans:C.map(e=>({plan_key:`${e.viewers}_viewers_${e.billingCycle}`,viewers:e.viewers,billing_cycle:e.billingCycle,interval_months:e.intervalMonths,amount_minor:w[e.viewers][e.billingCycle]}))}),E=e=>typeof e==`object`&&!!e&&!Array.isArray(e),D=e=>e===null||typeof e==`string`;function O(e){if(!E(e)||!D(e.assignment_token)||typeof e.assignment_token==`string`&&!e.assignment_token||!D(e.campaign_id)||!D(e.country)||typeof e.provider!=`string`||!e.provider||typeof e.currency!=`string`||!/^[A-Za-z]{3}$/.test(e.currency)||!Number.isInteger(e.currency_exponent)||e.currency_exponent<0||e.currency_exponent>3||!Array.isArray(e.plans)||e.plans.length!==C.length)throw Error(`Invalid pricing response`);for(let t of C){let n=`${t.viewers}_viewers_${t.billingCycle}`,r=e.plans.find(e=>E(e)&&e.plan_key===n);if(!E(r)||r.viewers!==t.viewers||r.billing_cycle!==t.billingCycle||r.interval_months!==t.intervalMonths||!Number.isSafeInteger(r.amount_minor)||r.amount_minor<0)throw Error(`Invalid pricing plan: ${n}`)}}var k=(e,t,n)=>e.plans.find(e=>e.viewers===t&&e.billing_cycle===n),A=(e,t)=>e/10**t,j=(e,t,n)=>{let r=new Intl.NumberFormat(n,{style:`currency`,currency:e.currency,currencyDisplay:`symbol`,minimumFractionDigits:e.currency_exponent,maximumFractionDigits:e.currency_exponent,trailingZeroDisplay:`stripIfInteger`}),i=A(t.amount_minor,e.currency_exponent);return{monthly:r.format(i/t.interval_months),total:r.format(i)}},M=(e,t)=>{if(!t)return e;let n=new URL(e);return n.origin!==`https://app.pixelview.io`||n.username||n.password?e:(n.searchParams.set(`pricing_assignment`,t),n.href)},N=b(`pricing`,()=>{let t=x(),n=l({quote:null,error:null,fallback:!1,loading:!1}),r=null,i=()=>{if(typeof window>`u`)return null;try{return window.localStorage.getItem(`pixelview_pricing_assignment`)}catch{return null}},a=e=>{if(!(typeof window>`u`))try{window.localStorage.setItem(`pixelview_pricing_assignment`,e)}catch{return}},o=()=>{if(n.quote&&!n.fallback)return Promise.resolve(n.quote);if(r)return r;n.loading=!0,n.error=null;let e=(async()=>{let e={},r=h(),o=i();/^[A-Z]{2}$/.test(r)&&r!==`XX`&&(e.country=r),o&&(e.assignment_token=o);let s=await t.get(`/pricing`,{query:e,credentials:`omit`,retry:0,timeout:1e4});return O(s),n.quote=s,n.fallback=!1,s.assignment_token&&a(s.assignment_token),s})().catch(e=>(n.error=`Subscription pricing is unavailable. Please retry.`,n.fallback=!0,n.quote=T(),n.quote)).finally(()=>{n.loading=!1,r=null});return r=e,e};return{...e(n),loadPricing:o}}),P=()=>{let e=N(),{quote:t,error:n,loading:i}=d(e),a=(e,n)=>{if(t.value)return k(t.value,e,n)};return r(()=>{e.loadPricing().catch(()=>void 0)}),{quote:t,error:n,loading:i,loadPricing:e.loadPricing,getPlan:a,getFormattedPrice:(e,n)=>{let r=a(e,n);return!t.value||!r?null:j(t.value,r)}}},F=f({__name:`PricingNavigation`,props:{href:{default:``},name:{default:``},appearance:{default:`button`},size:{default:`md`},variant:{default:`primary`}},setup(e){let{quote:r}=P(),a=n(()=>{try{let t=new URL(e.href);return t.origin===`https://app.pixelview.io`&&!t.username&&!t.password}catch{return!1}}),l=n(()=>a.value?M(e.href,r.value?.assignment_token??null):e.href),d=n(()=>e.appearance===`native`?`a`:e.appearance===`link`?S:_);return(n,r)=>(o(),s(c(d.value),{name:e.name,size:e.size,variant:e.variant,href:l.value,"data-
1pricing-handoff":a.value?``:void 0,class:g(a.value?`ph-no-capture ph-no-record`:void 0),referrerpolicy:a.value?`no-referrer`:void 0,rel:a.value?`nofollow noopener noreferrer`:void 0},{left:i(()=>[t(n.$slots,`left`)]),right:i(()=>[t(n.$slots,`right`)]),default:i(()=>[t(n.$slots,`default`,{},()=>[p(u(e.name),1)])]),_:3},8,[`name`,`size`,`variant`,`href`,`data-pricing-handoff`,`class`,`referrerpolicy`,`rel`]))}});export{P as n,S as r,F 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.