PageSourceSearch

https://ir.traton.com/_app/immutable/chunks/fKwyliMk.js

js traton.com collected 2026-10-02 05:21:44 UTC 2,449 bytes, 1 lines download raw bytes

1const y=t=>btoa(t).replaceAll("+","-").replaceAll("/","_").replaceAll("=",""),U=async(t,e,n)=>{const r=new TextEncoder,o=y(JSON.stringify(t))+"."+y(JSON.stringify(e)),s=await crypto.subtle.importKey("raw",r.encode(n),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),a=await crypto.subtle.sign("HMAC",s,r.encode(o));return o+"."+y(String.fromCharCode.apply(null,Array.from(new Uint8Array(a))))};let f=0;const p=20,u=fetch;var c;(function(t){t.oauth2="oauth2",t.jwt="jwt",t.none="none"})(c||(c={}));let w,l=c.oauth2;const D=t=>{w=t},C=t=>{l=t},j=async(t,e,n,r=u)=>k(t,{...e,method:n},r),v=(t,e,n=u)=>j(t,e,"POST",n),L=(t,e,n=u)=>j(t,e,"GET",n),k=async(t,e,n=u)=>{const r=new URL(t);let o;const s=f;if(l===c.oauth2)o=await b(r);else if(l===c.jwt)o=await m(w,p);else if(l===c.none)o={access_token:"none",token_type:"none"};else throw new Error("Invalid AuthStrategy");const a=async h=>n(r.toString(),{...e,headers:{...e==null?void 0:e.headers,Authorization:`${h.token_type} ${h.access_token}`}});let i=await a(o);const d=i.headers.get("Date")||new Date().toString(),g=new Date(d).getTime();if(i.status===401&&l===c.jwt&&!O(g,s)){const h=new Date().getTime();f=g-h,o=await m(w,p),i=await a(o)}return i};function O(t,e){const n=new Date().getTime()+e;return Math.abs(Math.floor(n/1e3)-Math.floor(t/1e3))<p}const b=async(t,e=u)=>{const n=new URL(t),r=new URL(E(n.toString(),"/oauth2/authorize"),n),s=await(await e(r.toString(),{method:"POST",body:JSON.stringify(w||{}),headers:{"Content-Type":"application/json"}})).json();if(!s.redirect_uri)throw new Error(s.error_description||"Unknown Error");return _(s.redirect_uri,"#")},m=async(t,e=20)=>{const n={iss:t.key,exp:(new Date().getTime()+f)/1e3+e};return{token_type:"Bearer",access_token:await U({alg:"HS256",typ:"JWT"},n,t.secret)}},_=(t,e="?")=>{const[,n]=t.split(e);return Object.fromEntries(new URLSearchParams(n))},E=(t,...e)=>{const n=new URL(t),r=n.search;n.search="";const o=n.toString(),s=e.reduce((i,d)=>`${T(i.trim(),"/")}/${T(d.trim(),"/")}`,o),a=new URL(s);return a.search=r,a.toString()},T=(t,e)=>t.replace(new RegExp(`(^[\\${e}]+)|([\\${e}]+$)`,"g"),"");var S;(function(t){t.context="@context",t.type="@type",t.description="hydra:description",t.title="hydra:title",t.detail="detail",t.violations="violations"})(S||(S={}));var A;(function(t){t.collection="hydra:Collection",t.error="hydra:Error",t.violation="ConstraintViolationList"})(A||(A={}));export{c as A,v as a,C as b,D as c,E as j,L as s};

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.