1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2098fe52-5140-4b7d-bbf2-0c27bd179cce",e._sentryDebugIdIdentifier="sentry-dbid-2098fe52-5140-4b7d-bbf2-0c27bd179cce")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5269],{36004:(e,t,r)=>{r.d(t,{He:()=>f,UU:()=>k,hD:()=>m});var s,o,n,i,a,u,d=((s=d||{}).PENDING="pending",s.DONE="done",s.NULL="null",s),c=((o=c||{}).User="User",o.Bot="Bot",o),h=((n=h||{})[n.Short=1]="Short",n[n.Medium=2]="Medium",n[n.Long=3]="Long",n),l=((i=l||{}).answer="answer",i.chat="chat",i),f=((a=f||{}).chat="chat",a.voice="voice",a.roleplay="roleplay",a.none="none",a),p=((u=p||{}).macro="MACRO",u.micro="MICRO",u.tech_talks="TECH_TALKS",u),m=class extends Error{constructor(e,t,r){super(e),this.name="ApiError",this.status=t,this.body=r}},y=e=>new Promise(t=>{setTimeout(t,e)}),g=e=>e.status>=500||429===e.status;function b(e){if(!e)return"";let t=new URLSearchParams;Object.entries(e).forEach(([e,r])=>{if(null!=r){if(Array.isArray(r))return void r.forEach(r=>{null!=r&&t.append(e,String(r))});if("object"==typeof r){try{t.append(e,JSON.stringify(r))}catch{t.append(e,String(r))}return}t.append(e,String(r))}});let r=t.toString();return r?`?${r}`:""}function w(e){let t={};return e?.acceptLanguage&&(t["X-Accept-Language"]=e.acceptLanguage),t}function q(e,t){let r=t;if(r&&"object"==typeof r&&"type"in r&&(r=r.type),"cookie"===r)return!function(e){try{return new URL(e),!0}catch{return!1}}(e)?void 0:"include"}function E(e){return"u">typeof FormData&&e instanceof FormData}function T(e){return"u">typeof Blob&&e instanceof Blob}function S(e){return"u">typeof ArrayBuffer&&e instanceof ArrayBuffer}async function U(e,t,r=!1){var s;let o,n={"Cache-Control":"no-cache",...(s=e.appVersion,o={},s&&(o["X-SDK-Version"]=s),o),...e.headers??{}};if(e.auth?.type==="bearer"){let t="function"==typeof e.auth.getToken?await e.auth.getToken():e.auth.getToken;t&&(n.Authorization=`Bearer ${t}`)}return r&&(n["Content-Type"]="application/json"),Object.assign(n,t??{}),n}var I=class{constructor(e){this.cfg={retry:{retries:2,minDelayMs:250,maxDelayMs:2e3,retryOn:g},...e},this.fetchImpl=e.fetchImpl??fetch.bind(globalThis)}async doFetch(e,t){return this.fetchImpl(e,t)}buildUrl(e,t){return`${this.cfg.baseUrl}${e}${b(t)}`}async request(e,t={}){let r,s,o=function(){let e=globalThis;if(e.crypto?.randomUUID)try{return e.crypto.randomUUID()}catch{}if(e.crypto?.getRandomValues){let t=new Uint8Array(16);return e.crypto.getRandomValues(t),Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)}(),n=`${this.cfg.baseUrl}${e}${b(t.query)}`,i=t.method??(void 0!==t.body?"POST":"GET"),a=!1;void 0!==t.body&&(E(t.body)||T(t.body)||S(t.body)?(r=t.body,a=!1):(r=JSON.stringify(t.body),a=!0));let u=await U(this.cfg,t.headers,a),{retries:d}=this.cfg.retry,c=this.cfg.retry.minDelayMs,h=this.cfg.retry.maxDelayMs,l=this.cfg.retry.retryOn,f=Date.now();this.cfg.onRequestStart?.({url:n,method:i,id:o});for(let e=0;e<=d;e+=1)try{let s=await this.doFetch(n,{method:i,headers:u,body:r,signal:t.signal,credentials:q(this.cfg.baseUrl,this.cfg.auth?.type)});if(!s.ok){let t;if(l(s)&&e<d){let t=function(e,t=Date.now()){if(!e)return null;let r=e.trim();if(!r)return null;let s=Number(r);if(!Number.isNaN(s))return Math.max(0,Math.round(1e3*s));let o=Date.parse(r);if(!Number.isNaN(o)){let e=o-t;return e>0?e:0}return null}(s.headers.get("retry-after"))??function(e,t,r,s=!0){let o=Math.min(r,t*2**e);return s?Math.floor(Math.random()*(o+1)):o}(e,c,h,!0);await y(t);continue}let r=s.headers.get("content-type")||"";try{t=r.includes("application/json")?await s.json():await s.text()}catch{}let a=t&&(t.message||t.error)||`Request failed with status ${s.status}`;throw this.cfg.onRequestEnd?.({url:n,method:i,id:o,ok:!1,status:s.status,durationMs:Date.now()-f}),new m(a,s.status,t)}let a=(s.headers.get("content-type")||"").includes("application/json")?await s.json():await s.text();return this.cfg.onRequestEnd?.({url:n,method:i,id:o,ok:!0,status:s.status,durationMs:Date.now()-f}),a}catch(t){if(s=t,e>=d)break}if(this.cfg.onRequestEnd?.({url:n,method:i,id:o,ok:!1,status:s?.status??0,durationMs:Date.now()-f}),s instanceof m)throw s;
1throw new m(s?.message||"Network error",0)}async stream(e,t={}){let r,s=`${this.cfg.baseUrl}${e}${b(t.query)}`,o=!1;void 0!==t.body&&(E(t.body)||T(t.body)||S(t.body)?r=t.body:(r=JSON.stringify(t.body),o=!0));let n=await U(this.cfg,t.headers,o),i=await this.doFetch(s,{method:t.method??"POST",headers:n,body:r,signal:t.signal,credentials:q(this.cfg.baseUrl,this.cfg.auth?.type)});if(!i.ok||!i.body){let e,t=i.headers.get("content-type")||"";try{e=t.includes("application/json")?await i.json():await i.text()}catch{}throw new m(e&&(e.message||e.error)||`Stream failed with status ${i.status}`,i.status,e)}return i.body}async requestRaw(e,t={}){let r,s=`${this.cfg.baseUrl}${e}${b(t.query)}`,o=t.method??(void 0!==t.body?"POST":"GET"),n=!1;void 0!==t.body&&(E(t.body)||T(t.body)||S(t.body)?r=t.body:(r=JSON.stringify(t.body),n=!0));let i=await U(this.cfg,t.headers,n),a=await this.doFetch(s,{method:o,headers:i,body:r,signal:t.signal,credentials:q(this.cfg.baseUrl,this.cfg.auth?.type)});if(!a.ok){let e,t=a.headers.get("content-type")||"";try{e=t.includes("application/json")?await a.json():await a.text()}catch{}throw new m(e&&(e.message||e.error)||`Request failed with status ${a.status}`,a.status,e)}return a}};function k(e){let t=new I(e);return{auth:{getSession:()=>t.request("/auth/session",{method:"GET"}),logout:()=>t.request("/auth/logout",{method:"GET"}),ssoDiscover:e=>t.request("/sso/discover",{method:"POST",body:e}),ssoJitRedirectUrl:({idp:e,platform:r="PRO",redirectUri:s})=>t.buildUrl("/sso/jit/redirect",{idp:e,platform:r,redirect_uri:s}),ssoIdp:e=>t.request(`/sso/idp/${encodeURIComponent(e)}`,{method:"GET"})},chat:{sendMessage:(e,r)=>t.request("/chat",{method:"POST",body:e,headers:w(r)}),streamCompletion:(e,r)=>t.stream("/chat",{method:"POST",body:e,headers:w(r),signal:r?.signal}),getStarred:e=>t.request("/chat/starred",{method:"GET",query:{skip:e?.skip??0,limit:e?.limit??20}}),star(e){if(!e)throw Error("responseId is required");return t.request(`/chat/${encodeURIComponent(e)}/star`,{method:"POST"})},unstar(e){if(!e)throw Error("responseId is required");return t.request(`/chat/${encodeURIComponent(e)}/star`,{method:"DELETE"})},sendFeedback(e,r){if(!e)throw Error("messageId is required");return t.request(`/chat/${encodeURIComponent(e)}/feedback`,{method:"POST",body:r})},addComment(e,r){if(!e)throw Error("messageId is required");let s=r?.trim();if(!s)throw Error("commentText is required");return t.request(`/chat/${encodeURIComponent(e)}/comment`,{method:"POST",body:{comment_text:s}})}},session:{list:()=>t.request("/session",{method:"GET"}),recreate(e){if(!e)throw Error("sessionId is required");return t.request(`/session/${encodeURIComponent(e)}/`,{method:"GET"})},rename(e,r){if(!e)throw Error("sessionId is required");let s=r?.trim();if(!s)throw Error("newDescription is required");return t.request(`/session/${encodeURIComponent(e)}/`,{method:"PUT",body:{new_description:s}})},remove(e){if(!e)throw Error("sessionId is required");return t.request(`/session/${encodeURIComponent(e)}/`,{method:"DELETE",body:{session_id:e}})}},roleplay:{initialize:(e,r)=>t.request("/roleplay/initialization",{method:"GET",query:{scenario:e.scenario,responseId:e.responseId},headers:w(r),signal:r?.signal}),getTranscript(e){if(!e)throw Error("messageId is required");return t.request(`/roleplay/${encodeURIComponent(e)}/transcript`,{method:"GET"})},reject(e){if(!e)throw Error("messageId is required");return t.request(`/roleplay/${encodeURIComponent(e)}/reject`,{method:"POST",body:{}})}},user:{getAccount:()=>t.request("/user/account",{method:"GET"}),updateAccount:e=>t.request("/user/account",{method:"POST",body:e}),updateSettings:e=>t.request("/user/settings",{method:"PUT",body:e})},profile:{getStatus:()=>t.request("/profile/status",{method:"GET"}),getQuiz:e=>t.request("/profile/quiz",{method:"GET",headers:w(e)}),getPinkProfile:e=>t.request("/pink-profile",{method:"GET",headers:w(e)})},course:{getOverview:()=>t.request("/course/overview",{method:"GET"}),async downloadCertificate(e){if(!e)throw Error("articleCode is required");return(await t.requestRaw(`/course/certificate/${encodeURIComponent(e)}`,{method:"GET",query:{download:!0}})).blob()}},tour:{getStatus:()=>t.request("/guided-tour/status",{method:"GET"}),initialize:e=>t.request("/guided-tour/status",{method:"POST",body:e}),updateStatus:e=>t.request("/guided-tour/status",{method:"PUT",body:e})},stream:{createSignedUrl:e=>t.request("/stream/create_signed_url/",{method:"POST",body:e})},whisper:{transcribe:e=>t.request("/whisper",{method:"POST",body:e})},_http:t}}},89214:(e,t,r)=>{r.d(t,{S4:()=>h,dW:()=>u,pO:()=>d,qk:()=>c});var s=r(12115),o=r(95155),n=r(35625),i=r(48934),a=(0,s.createContext)(null);function u({sdk:e,children:t}){let r=(0,s.useMemo)(()=>e,[e]);return(0,o.jsx)(a.Provider,{value:r,children:t})}function d(){let e=(0,s.useContext)(a);if(!e)throw Error("usePinkProSdk must be used within PinkProSdkProvider");return e}var c={auth:{session:()=>["auth","session"]},user:{account:()=>["user","account"]},profile:{status:()=>["profile","status"],quiz:e=>["profile","quiz",e??null],pinkProfile:e=>["profile","pink-profile",e??null]},session:{list:()=>["session","list"],recreate:e=>["session","recreate",e]},chat:{starred:(e,t)=>["chat","starred",e??0,t??20]},roleplay:{transcript:e=>["roleplay","transcript",e]},course:{overview:()=>["course","overview"]},tour:{status:()=>["tour","status"]}};function h(){let e=d(),t=(0,n.jE)();return(0,i.n)({mutationFn:t=>e.tour.updateStatus(t),onSuccess:()=>{t.invalidateQueries({queryKey:c.tour.status()})}})}}}]);
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.