PageSourceSearch

https://michaelnthiessen.com/_nuxt/AdapterDemoBefore.client.0e876cce.js

js michaelnthiessen.com collected 2026-10-03 21:33:45 UTC 2,826 bytes, 1 lines download raw bytes

1var C=Object.defineProperty;var P=(a,e,s)=>e in a?C(a,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[e]=s;var m=(a,e,s)=>(P(a,typeof e!="symbol"?e+"":e,s),s);import{v as B,q as l,p as x,W as N,V as S,x as b,o as r,b as u,d as t,t as v,S as E,T as V,F as D,r as F,j as M,a9 as T,aa as A,_ as I}from"./entry.1e6759ba.js";class L{constructor(){m(this,"events",[{id:1,name:"Page View"},{id:2,name:"Button Click"},{id:3,name:"Form Submit"}]);m(this,"pageviews",{"/":150,"/about":75,"/courses/composable-design-patterns/adapter-composables/demo":239})}async getCurrentVisitors(){return Math.floor(Math.random()*100)+1}async getEvents(){return await this.delay(500),[...this.events]}async getPageviews(e){return await this.delay(300),this.pageviews[e]??0}async trackEvent(e){await this.delay(400);const s={id:this.events.length+1,name:e};this.events.push(s)}delay(e){return new Promise(s=>setTimeout(s,e))}}const d=a=>(T("data-v-80ce442d"),a=a(),A(),a),U={class:"analytics-demo"},W={class:"stats-card"},j={class:"stat-item"},q=d(()=>t("div",{class:"stat-label"},"Current Visitors",-1)),R={class:"stat-value"},$={class:"stat-item"},z=d(()=>t("div",{class:"stat-label"},"Current Page",-1)),G={class:"current-path"},H={class:"pageviews"},J={class:"events-section"},K=d(()=>t("div",{class:"stat-label"},"Track New Event",-1)),O={class:"event-input"},Q=["disabled"],X=d(()=>t("div",{class:"stat-label"},"Watch Value Changes",-1)),Y={class:"event-input"},Z=d(()=>t("div",{class:"stat-label"},"Events List",-1)),ee={class:"events-list"},te={key:0,class:"no-events"},se=B({__name:"AdapterDemoBefore.client",setup(a){const e=new L,s=l(0),_=x(()=>N().path),w=l(0),c=l(""),p=l([]),h=l(0);S(async()=>{await k(),await g(),await y(_.value)}),b(_,async i=>{await y(i)}),b(h,async()=>{await f("Value changed")});async function k(){s.value=await e.getCurrentVisitors()}async function g(){p.value=await e.getEvents()}async function y(i){w.value=await e.getPageviews(i)}async function f(i){await e.trackEvent(i),await g(),c.value=""}return(i,o)=>(r(),u("div",U,[t("div",W,[t("div",j,[q,t("div",R,v(s.value),1)]),t("div",$,[z,t("div",G,v(_.value),1),t("div",H,v(w.value)+" pageviews",1)])]),t("div",J,[K,t("div",O,[E(t("input",{"onUpdate:modelValue":o[0]||(o[0]=n=>c.value=n),class:"input",placeholder:"Enter event name"},null,512),[[V,c.value]]),t("button",{onClick:o[1]||(o[1]=n=>f(c.value)),class:"button",disabled:!c.value}," Track Event ",8,Q)]),X,t("div",Y,[E(t("input",{"onUpdate:modelValue":o[2]||(o[2]=n=>h.value=n),type:"number",class:"input",placeholder:"Enter a number"},null,512),[[V,h.value]])]),Z,t("ul",ee,[(r(!0),u(D,null,F(p.value,n=>(r(),u("li",{key:n.id},v(n.name),1))),128)),p.value.length===0?(r(),u("li",te," No events found ")):M("",!0)])])]))}});const ie=I(se,[["__scopeId","data-v-80ce442d"]]);export{ie as default};

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.