import{S as we,i as ye,s as ge,N as ve,e as s,w as f,b as d,c as at,f as h,g as r,h as e,m as st,x as Mt,O as ue,P as $e,k as Pe,Q as Re,n as Ce,t as Z,a as x,o as c,d as nt,C as fe,p as Oe,r as it,u as Ae}from"./index-d577ac2a.js";import{S as Te}from"./SdkTabs-7ce69c38.js";import{F as Ue}from"./FieldsQueryParam-23e11274.js";function pe(n,l,o){const i=n.slice();return i[8]=l[o],i}function be(n,l,o){const i=n.slice();return i[8]=l[o],i}function Me(n){let l;return{c(){l=f("email")},m(o,i){r(o,l,i)},d(o){o&&c(l)}}}function De(n){let l;return{c(){l=f("username")},m(o,i){r(o,l,i)},d(o){o&&c(l)}}}function Ee(n){let l;return{c(){l=f("username/email")},m(o,i){r(o,l,i)},d(o){o&&c(l)}}}function me(n){let l;return{c(){l=s("strong"),l.textContent="username"},m(o,i){r(o,l,i)},d(o){o&&c(l)}}}function he(n){let l;return{c(){l=f("or")},m(o,i){r(o,l,i)},d(o){o&&c(l)}}}function _e(n){let l;return{c(){l=s("strong"),l.textContent="email"},m(o,i){r(o,l,i)},d(o){o&&c(l)}}}function ke(n,l){let o,i=l[8].code+"",S,m,p,u;function _(){return l[7](l[8])}return{key:n,first:null,c(){o=s("button"),S=f(i),m=d(),h(o,"class","tab-item"),it(o,"active",l[3]===l[8].code),this.first=o},m(R,C){r(R,o,C),e(o,S),e(o,m),p||(u=Ae(o,"click",_),p=!0)},p(R,C){l=R,C&16&&i!==(i=l[8].code+"")&&Mt(S,i),C&24&&it(o,"active",l[3]===l[8].code)},d(R){R&&c(o),p=!1,u()}}}function Se(n,l){let o,i,S,m;return i=new ve({props:{content:l[8].body}}),{key:n,first:null,c(){o=s("div"),at(i.$$.fragment),S=d(),h(o,"class","tab-item"),it(o,"active",l[3]===l[8].code),this.first=o},m(p,u){r(p,o,u),st(i,o,null),e(o,S),m=!0},p(p,u){l=p;const _={};u&16&&(_.content=l[8].body),i.$set(_),(!m||u&24)&&it(o,"active",l[3]===l[8].code)},i(p){m||(Z(i.$$.fragment,p),m=!0)},o(p){x(i.$$.fragment,p),m=!1},d(p){p&&c(o),nt(i)}}}function We(n){var ie,re;let l,o,i=n[0].name+"",S,m,p,u,_,R,C,O,B,Dt,rt,T,ct,N,dt,U,tt,Et,et,I,Wt,ut,lt=n[0].name+"",ft,Lt,pt,V,bt,M,mt,Bt,Q,D,ht,qt,_t,Ft,$,Ht,kt,St,vt,Yt,wt,yt,j,gt,E,$t,Nt,J,W,Pt,It,Rt,Vt,k,Qt,q,jt,Jt,Kt,Ct,zt,Ot,Gt,Xt,Zt,At,xt,te,F,Tt,K,Ut,L,z,A=[],ee=new Map,le,G,v=[],oe=new Map,H;function ae(t,a){if(t[1]&&t[2])return Ee;if(t[1])return De;if(t[2])return Me}let Y=ae(n),P=Y&&Y(n);T=new Te({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[6]}'); ... const authData = await pb.collection('${(ie=n[0])==null?void 0:ie.name}').authWithPassword( '${n[5]}', 'YOUR_PASSWORD', ); // after the above you can also access the auth data from the authStore console.log(pb.authStore.isValid); console.log(pb.authStore.token); console.log(pb.authStore.model.id); // "logout" the last authenticated account pb.authStore.clear(); `,dart:` import 'package:pocketbase/pocketbase.dart'; final pb = PocketBase('${n[6]}'); ... final authData = await pb.collection('${(re=n[0])==null?void 0:re.name}').authWithPassword( '${n[5]}', 'YOUR_PASSWORD', ); // after the above you can also access the auth data from the authStore print(pb.authStore.isValid); print(pb.authStore.token); print(pb.authStore.model.id); // "logout" the last authenticated account pb.authStore.clear(); `}});let w=n[1]&&me(),y=n[1]&&n[2]&&he(),g=n[2]&&_e();q=new ve({props:{content:"?expand=relField1,relField2.subRelField"}}),F=new Ue({});let ot=n[4];const se=t=>t[8].code;for(let t=0;tt[8].code;for(let t=0;tParam Type Description`,Bt=d(),Q=s("tbody"),D=s("tr"),ht=s("td"),ht.innerHTML=`
Required identity
`,qt=d(),_t=s("td"),_t.innerHTML='String',Ft=d(),$=s("td"),Ht=f(`The `),w&&w.c(),kt=d(),y&&y.c(),St=d(),g&&g.c(),vt=f(` of the record to authenticate.`),Yt=d(),wt=s("tr"),wt.innerHTML=`
Required password
String The auth record password.`,yt=d(),j=s("div"),j.textContent="Query parameters",gt=d(),E=s("table"),$t=s("thead"),$t.innerHTML=`Param Type Description`,Nt=d(),J=s("tbody"),W=s("tr"),Pt=s("td"),Pt.textContent="expand",It=d(),Rt=s("td"),Rt.innerHTML='String',Vt=d(),k=s("td"),Qt=f(`Auto expand record relations. Ex.: `),at(q.$$.fragment),jt=f(` Supports up to 6-levels depth nested relations expansion. `),Jt=s("br"),Kt=f(` The expanded relations will be appended to the record under the `),Ct=s("code"),Ct.textContent="expand",zt=f(" property (eg. "),Ot=s("code"),Ot.textContent='"expand": {"relField1": {...}, ...}',Gt=f(`). `),Xt=s("br"),Zt=f(` Only the relations to which the request user has permissions to `),At=s("strong"),At.textContent="view",xt=f(" will be expanded."),te=d(),at(F.$$.fragment),Tt=d(),K=s("div"),K.textContent="Responses",Ut=d(),L=s("div"),z=s("div");for(let t=0;to(3,_=O.code);return n.$$set=O=>{"collection"in O&&o(0,u=O.collection)},n.$$.update=()=>{var O,B;n.$$.dirty&1&&o(2,S=(O=u==null?void 0:u.options)==null?void 0:O.allowEmailAuth),n.$$.dirty&1&&o(1,m=(B=u==null?void 0:u.options)==null?void 0:B.allowUsernameAuth),n.$$.dirty&6&&o(5,p=m&&S?"YOUR_USERNAME_OR_EMAIL":m?"YOUR_USERNAME":"YOUR_EMAIL"),n.$$.dirty&1&&o(4,R=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:fe.dummyCollectionRecord(u)},null,2)},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", "data": { "identity": { "code": "validation_required", "message": "Missing required value." } } } `}])},o(6,i=fe.getApiExampleUrl(Oe.baseUrl)),[u,m,S,_,R,p,i,C]}class He extends we{constructor(l){super(),ye(this,l,Le,We,ge,{collection:0})}}export{He as default};