You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
2.0 KiB

function e(){return 60}var t=`/api/auth/sms/send`,n=`/api/auth/sms/login`,r=`cxxfds_token`,i=`cxxfds_participant_competition_slug`,a=`cxxfds_admin_token`,o=`cxxfds_admin_user`,s=`cxxfds_admin_competition_id`,c=`cxxfds_reviewer_token`,l=`cxxfds_reviewer_competition_slug`,u=`/api/v1/review/auth/login`,d=`/api/v1/review/me`,f=`/api/v1/review/applications`;function p(e,t){let n=new URLSearchParams({competition_slug:t});return`${y()}/api/v1/review/applications/${e}?${n.toString()}`}function m(e){return`${y()}/api/v1/review/applications/${e}/score`}var h=`/v1/admin`;function g(){let e=`/admin/`;return e===`/`?`/admin/login`:`${e.endsWith(`/`)?e.slice(0,-1):e}/admin/login`}function _(e){return e}function v(e){let t=e.trim();if(!t)return``;let n=`/admin/`,r=n.endsWith(`/`)?n.slice(0,-1):n;return r&&r!==`/`&&t.startsWith(`${r}/admin`)?_(t.slice(r.length)||`/admin`):_(t)}function y(){return(void 0)?.trim()?(void 0).trim().replace(/\/$/,``):(window.location.hostname,``)}function b(e){let t=String(e??``).trim();if(!t)return t;if(/^https?:\/\//i.test(t))try{let e=new URL(t),n=e.pathname.replace(/\/{2,}/g,`/`);return e.pathname=n.startsWith(`/`)?n:`/${n}`,e.toString()}catch{return t.replace(/([^:])\/\/+/g,`$1/`)}return t.replace(/\/{2,}/g,`/`)}function x(e,t,n){let r=new URLSearchParams({competition_slug:n});return`${y()}/api/v1/review/applications/${e}/files/${t}/download?${r.toString()}`}function S(){let e=(void 0)?.trim();return e?e.replace(/\/$/,``):`${y()}/api${h}`}function C(){return{token:localStorage.getItem(`cxxfds_reviewer_token`)??``,competitionSlug:localStorage.getItem(`cxxfds_reviewer_competition_slug`)??``}}function w(e,t){localStorage.setItem(c,e),localStorage.setItem(l,t)}function T(){localStorage.removeItem(c),localStorage.removeItem(l)}function E(e){return/^\/c\/[^/]+\/review(?:\/|$)/.test(e)}function D(e){return/^\/c\/[^/]+\/manage(?:\/|$)/.test(e)}export{m as C,x as S,D as _,n as a,C as b,u as c,T as d,S as f,b as g,v as h,i,d as l,e as m,a as n,t as o,y as p,o as r,f as s,s as t,r as u,E as v,w,p as x,g as y};