@laboratoria/sdk-js 7.2.0-beta.0 → 7.2.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -9154,6 +9154,7 @@ const Lo = /* @__PURE__ */ No(Do), ft = (n, e) => async (t, r = {}) => {
9154
9154
  primaryKey: "code",
9155
9155
  plural: "countries",
9156
9156
  searchProps: ["code", "name", "timeZone"],
9157
+ defaultProps: ["code", "name", "timeZone", "currency"],
9157
9158
  getOptionLabel: ({ code: n, name: e }) => `${n} / ${e}`
9158
9159
  },
9159
9160
  ActivityLogEntry: {
@@ -1483,4 +1483,4 @@
1483
1483
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1484
1484
  * See the License for the specific language governing permissions and
1485
1485
  * limitations under the License.
1486
- */const Oo=5*60,ko=bt("authIdTokenMaxAge")||Oo;let On=null;const No=n=>async e=>{const t=e&&await e.getIdTokenResult(),r=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(r&&r>ko)return;const i=t==null?void 0:t.token;On!==i&&(On=i,await fetch(n,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function Do(n=ti()){const e=Pt(n,"auth");if(e.isInitialized())return e.getImmediate();const t=Yi(n,{popupRedirectResolver:So,persistence:[Ms,Ts,gn]}),r=bt("authTokenSyncURL");if(r){const s=No(r);_s(t,s,()=>s(t.currentUser)),ys(t,o=>s(o))}const i=xn("auth");return i&&Xi(t,`http://${i}`),t}Po("Browser");var Lo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $o(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var kn={exports:{}};(function(n){(function(e){function t(l,m){var d=(l&65535)+(m&65535),w=(l>>16)+(m>>16)+(d>>16);return w<<16|d&65535}function r(l,m){return l<<m|l>>>32-m}function i(l,m,d,w,E,A){return t(r(t(t(m,l),t(w,A)),E),d)}function s(l,m,d,w,E,A,R){return i(m&d|~m&w,l,m,E,A,R)}function o(l,m,d,w,E,A,R){return i(m&w|d&~w,l,m,E,A,R)}function c(l,m,d,w,E,A,R){return i(m^d^w,l,m,E,A,R)}function a(l,m,d,w,E,A,R){return i(d^(m|~w),l,m,E,A,R)}function u(l,m){l[m>>5]|=128<<m%32,l[(m+64>>>9<<4)+14]=m;var d,w,E,A,R,h=1732584193,f=-271733879,p=-1732584194,g=271733878;for(d=0;d<l.length;d+=16)w=h,E=f,A=p,R=g,h=s(h,f,p,g,l[d],7,-680876936),g=s(g,h,f,p,l[d+1],12,-389564586),p=s(p,g,h,f,l[d+2],17,606105819),f=s(f,p,g,h,l[d+3],22,-1044525330),h=s(h,f,p,g,l[d+4],7,-176418897),g=s(g,h,f,p,l[d+5],12,1200080426),p=s(p,g,h,f,l[d+6],17,-1473231341),f=s(f,p,g,h,l[d+7],22,-45705983),h=s(h,f,p,g,l[d+8],7,1770035416),g=s(g,h,f,p,l[d+9],12,-1958414417),p=s(p,g,h,f,l[d+10],17,-42063),f=s(f,p,g,h,l[d+11],22,-1990404162),h=s(h,f,p,g,l[d+12],7,1804603682),g=s(g,h,f,p,l[d+13],12,-40341101),p=s(p,g,h,f,l[d+14],17,-1502002290),f=s(f,p,g,h,l[d+15],22,1236535329),h=o(h,f,p,g,l[d+1],5,-165796510),g=o(g,h,f,p,l[d+6],9,-1069501632),p=o(p,g,h,f,l[d+11],14,643717713),f=o(f,p,g,h,l[d],20,-373897302),h=o(h,f,p,g,l[d+5],5,-701558691),g=o(g,h,f,p,l[d+10],9,38016083),p=o(p,g,h,f,l[d+15],14,-660478335),f=o(f,p,g,h,l[d+4],20,-405537848),h=o(h,f,p,g,l[d+9],5,568446438),g=o(g,h,f,p,l[d+14],9,-1019803690),p=o(p,g,h,f,l[d+3],14,-187363961),f=o(f,p,g,h,l[d+8],20,1163531501),h=o(h,f,p,g,l[d+13],5,-1444681467),g=o(g,h,f,p,l[d+2],9,-51403784),p=o(p,g,h,f,l[d+7],14,1735328473),f=o(f,p,g,h,l[d+12],20,-1926607734),h=c(h,f,p,g,l[d+5],4,-378558),g=c(g,h,f,p,l[d+8],11,-2022574463),p=c(p,g,h,f,l[d+11],16,1839030562),f=c(f,p,g,h,l[d+14],23,-35309556),h=c(h,f,p,g,l[d+1],4,-1530992060),g=c(g,h,f,p,l[d+4],11,1272893353),p=c(p,g,h,f,l[d+7],16,-155497632),f=c(f,p,g,h,l[d+10],23,-1094730640),h=c(h,f,p,g,l[d+13],4,681279174),g=c(g,h,f,p,l[d],11,-358537222),p=c(p,g,h,f,l[d+3],16,-722521979),f=c(f,p,g,h,l[d+6],23,76029189),h=c(h,f,p,g,l[d+9],4,-640364487),g=c(g,h,f,p,l[d+12],11,-421815835),p=c(p,g,h,f,l[d+15],16,530742520),f=c(f,p,g,h,l[d+2],23,-995338651),h=a(h,f,p,g,l[d],6,-198630844),g=a(g,h,f,p,l[d+7],10,1126891415),p=a(p,g,h,f,l[d+14],15,-1416354905),f=a(f,p,g,h,l[d+5],21,-57434055),h=a(h,f,p,g,l[d+12],6,1700485571),g=a(g,h,f,p,l[d+3],10,-1894986606),p=a(p,g,h,f,l[d+10],15,-1051523),f=a(f,p,g,h,l[d+1],21,-2054922799),h=a(h,f,p,g,l[d+8],6,1873313359),g=a(g,h,f,p,l[d+15],10,-30611744),p=a(p,g,h,f,l[d+6],15,-1560198380),f=a(f,p,g,h,l[d+13],21,1309151649),h=a(h,f,p,g,l[d+4],6,-145523070),g=a(g,h,f,p,l[d+11],10,-1120210379),p=a(p,g,h,f,l[d+2],15,718787259),f=a(f,p,g,h,l[d+9],21,-343485551),h=t(h,w),f=t(f,E),p=t(p,A),g=t(g,R);return[h,f,p,g]}function y(l){var m,d="",w=l.length*32;for(m=0;m<w;m+=8)d+=String.fromCharCode(l[m>>5]>>>m%32&255);return d}function b(l){var m,d=[];for(d[(l.length>>2)-1]=void 0,m=0;m<d.length;m+=1)d[m]=0;var w=l.length*8;for(m=0;m<w;m+=8)d[m>>5]|=(l.charCodeAt(m/8)&255)<<m%32;return d}function S(l){return y(u(b(l),l.length*8))}function O(l,m){var d,w=b(l),E=[],A=[],R;for(E[15]=A[15]=void 0,w.length>16&&(w=u(w,l.length*8)),d=0;d<16;d+=1)E[d]=w[d]^909522486,A[d]=w[d]^1549556828;return R=u(E.concat(b(m)),512+m.length*8),y(u(A.concat(R),640))}function L(l){var m="0123456789abcdef",d="",w,E;for(E=0;E<l.length;E+=1)w=l.charCodeAt(E),d+=m.charAt(w>>>4&15)+m.charAt(w&15);return d}function v(l){return unescape(encodeURIComponent(l))}function I(l){return S(v(l))}function N(l){return L(I(l))}function C(l,m){return O(v(l),v(m))}function W(l,m){return L(C(l,m))}function $(l,m,d){return m?d?C(m,l):W(m,l):d?I(l):N(l)}n.exports?n.exports=$:e.md5=$})(Lo)})(kn);var Mo=kn.exports;const Uo=$o(Mo),gt=(n,e)=>async(t,r={})=>{const i=e?await e.getIdToken():null,s=await fetch(`${n}${t}`,{mode:"cors",...r,headers:{...i&&{authorization:`Bearer ${i}`},...r.body&&{"content-type":"application/json"},...r.headers},...r.body&&{body:JSON.stringify(r.body)}}),o=await s.json();if(s.status>202)throw Object.assign(new Error((o==null?void 0:o.message)||`HTTP Error ${s.status}`),{status:s.status,code:o==null?void 0:o.code,body:o});return o},jo=n=>{const e=n.properties||{},t=n.inputProps||Object.keys(e),r=(i,s)=>{const o=e[i]||{};if([null,void 0].includes(s))return o.isRequired?{id:"value-missing-validation-error"}:void 0;if(o.enum)return o.enum.includes(s)?void 0:{id:"enum-validation-error",values:{enum:o.enum,value:s}};switch(o.type){case"integer":if(o.isScalar&&(typeof s!="number"||Number.isNaN(s)))return{id:"invalid-number-validation-error"};break;case"date":break;case"boolean":break;case"json":case"string":default:if(o.isRequired&&!s)return{id:"value-missing-validation-error"};break}};return{validate:i=>t.reduce((s,o)=>{const c=r(o,i[o]);return c?{...s,[o]:c}:s},{}),validateAttr:r}},Bo=(n={})=>Object.keys(n).length?`?q=${JSON.stringify(n)}`:"",Fo=n=>[...n].reduce((e,t)=>t===t.toUpperCase()?`${e}-${t.toLowerCase()}`:`${e}${t}`,""),Ho=n=>`${n[0].toLowerCase()}${n.slice(1)}`,Vo=n=>{const e=Fo(n);return(t,r)=>`/${e}${t?`/${encodeURIComponent(t)}`:""}${Bo(r)}`},Nn=(n,e)=>{const t=Array.isArray(e.inputProps);return Object.keys(n).reduce((r,i)=>{if(t&&!e.inputProps.includes(i))return r;const{isRef:s,isScalar:o,isRequired:c}=e.properties[i]||{};return s&&o&&!c&&n[i]===null?r:{...r,[i]:n[i]}},{})},Wo=({primaryKey:n,properties:e,...t})=>({primaryKey:n||"id",properties:Object.keys(e||{}).reduce((r,i)=>{var b,S;const s=e[i]||{},{type:o,isScalar:c,isRequired:a,isRef:u=!1}=typeof s.type=="string"?s.type==="array"?s.enum?{type:"string",isScalar:!1,isRequired:!1}:(b=s.items)!=null&&b.$ref?{type:s.items.$ref.split("/").pop(),isScalar:!1,isRequired:!1,isRef:!0}:{type:(S=s.items)==null?void 0:S.type,isScalar:!1,isRequired:!1}:{type:s.format==="date-time"?"date":s.type,isScalar:!0,isRequired:!0}:Array.isArray(s.type)?s.type.length===2?{type:s.format==="date-time"?"date":s.type[0],isScalar:!0,isRequired:!1}:{type:"json",isScalar:!0,isRequired:s.type.includes("null")}:s.$ref?{type:s.$ref.split("/").pop(),isScalar:!0,isRequired:!0,isRef:!0}:{type:s.anyOf[0].$ref.split("/").pop(),isScalar:!0,isRequired:!1,isRef:!0},y=s.inputType||(o==="integer"?"number":o);return{...r,[i]:{...e[i],type:o,isScalar:c,isRequired:typeof s.isRequired=="boolean"?s.isRequired:a,isRef:u,inputType:y}}},{}),...t}),xo=(n,e,t,r={},i={})=>{const s=Wo(r),{primaryKey:o,properties:c}=s,a=jo(s),u=Vo(t),y=(...v)=>gt(n,e.authUser)(...v),b=({data:v,...I})=>y(u(null,I),{method:"POST",body:Nn(v,s)}),S=({data:v,...I})=>{const{where:N,...C}=I;return y(u(N[o],C),{method:"PUT",body:Nn(v,s)})},O=v=>{if(!v)return v;const I=Object.keys(v).reduce((N,C)=>{var E;const W=c[C]||{},{type:$,isScalar:l,isRef:m,format:d,items:w}=W;if(m){const A=Ho($);return l?{...N,[C]:i[A].parse(v[C])}:{...N,[C]:typeof((E=i[A])==null?void 0:E.parse)=="function"?v[C].map(R=>i[A].parse(R)):v[C]}}return{...N,[C]:$==="date"&&v[C]?new Date(v[C]):v[C]}},{});return typeof s.parse=="function"?s.parse(I):I},L=Object.keys(c||{}).reduce((v,I)=>c[I].isRef&&c[I].isScalar&&c[I].isRequired?Object.assign(v,{all:v.all.concat(I),oneToOne:v.oneToOne.concat(I),requiredOneToOne:v.requiredOneToOne.concat(I)}):c[I].isRef&&c[I].isScalar?Object.assign(v,{all:v.all.concat(I),oneToOne:v.oneToOne.concat(I),optionalOneToOne:v.optionalOneToOne.concat(I)}):c[I].isRef?Object.assign(v,{all:v.all.concat(I),oneToMany:v.oneToMany.concat(I)}):v,{all:[],oneToOne:[],requiredOneToOne:[],optionalOneToOne:[],oneToMany:[]});return{get schema(){return s},get relations(){return L},parse:O,validateAttr:a.validateAttr,validate:a.validate,findMany:v=>y(u(null,v)).then(I=>I.map(O)),findById:(v,I)=>y(u(v,I)).then(O),create:b,update:S,upsert:v=>v.where[o]?S({where:v.where,data:v.update}):b({data:v.create}),delete:v=>y(u(v),{method:"DELETE"}),stats:()=>y(u("_stats")),search:(v,I={})=>{var d;const{searchProps:N}=s,W=v.split(" ").reduce((w,E)=>[...w,{OR:N.reduce((A,R)=>{const h=R.split(".");return[...A,h.reduceRight((f,p)=>({[p]:f}),{contains:E,mode:"insensitive"})]},[])}],[]),$={...I.select,...I.include},l=(d=s.defaultProps)!=null&&d.length?Object.assign(...s.defaultProps.map(w=>({[w]:!0}))):null,m=Object.keys($).length?$:l;return y(u(null,{where:{...I.where,AND:W},...!!m&&{select:m},...I.orderBy&&{orderBy:I.orderBy},take:I.take||100}))}}},zo=(n,e,t)=>Object.keys(t.properties).reduce((r,i)=>{const s=t.properties[i].$ref.split("/").pop();return Object.assign(r,{[i]:xo(n,e,t.definitions[s].plural||`${i}s`,t.definitions[s],r)})},{}),qo=(n,e)=>Object.keys(n.definitions).reduce((t,r)=>({...t,[r]:e[r]?{...n.definitions[r],...e[r],properties:Object.keys(n.definitions[r].properties).reduce((i,s)=>({...i,[s]:{...n.definitions[r].properties[s],...(e[r].properties||{})[s]}}),e[r].properties||{})}:n.definitions[r]}),{}),Dn={$schema:"http://json-schema.org/draft-07/schema#",definitions:{Country:{type:"object",properties:{code:{type:"string"},name:{type:"string"},incomeFilter:{type:["integer","null"]},canApply:{type:"boolean",default:!1},capital:{type:"array",items:{type:"string"}},timeZone:{type:["string","null"]},flag:{type:["string","null"]},currency:{anyOf:[{$ref:"#/definitions/Currency"},{type:"null"}]},contracts:{type:"array",items:{$ref:"#/definitions/Contract"}},users:{type:"array",items:{$ref:"#/definitions/User"}},applications:{type:"array",items:{$ref:"#/definitions/Application"}},applicationNationalities:{type:"array",items:{$ref:"#/definitions/Application"}},educationLevels:{type:"array",items:{$ref:"#/definitions/EducationLevel"}},universities:{type:"array",items:{$ref:"#/definitions/University"}},companies:{type:"array",items:{$ref:"#/definitions/Company"}},jobs:{type:"array",items:{$ref:"#/definitions/Job"}}}},Currency:{type:"object",properties:{code:{type:"string"},name:{type:"string"},symbol:{type:"string"},countries:{type:"array",items:{$ref:"#/definitions/Country"}}}},User:{type:"object",properties:{uid:{type:"string"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},email:{type:"string"},firstName:{type:"string"},lastName:{type:["string","null"]},role:{type:["string","null"],enum:["staff","manager","finance","admin"]},disabled:{type:"boolean",default:!1},lang:{type:["string","null"],enum:["en","es","pt"]},referralSource:{type:["string","null"],enum:["word_of_mouth","codigo_m","social","google","print","tv","radio","other"]},identifiesAsFemale:{type:["boolean","null"]},dateOfBirth:{type:["string","null"],format:"date-time"},identificationNumber:{type:["string","null"]},mobileNumber:{type:["string","null"]},github:{type:["string","null"]},linkedin:{type:["string","null"]},bio:{type:["string","null"]},country:{anyOf:[{$ref:"#/definitions/Country"},{type:"null"}]},signupCohort:{anyOf:[{$ref:"#/definitions/Cohort"},{type:"null"}]},applications:{type:"array",items:{$ref:"#/definitions/Application"}},contractsAsCheckPilot:{type:"array",items:{$ref:"#/definitions/Contract"}},contracts:{type:"array",items:{$ref:"#/definitions/Contract"}},dropouts:{type:"array",items:{$ref:"#/definitions/Dropout"}},gigs:{type:"array",items:{$ref:"#/definitions/Gig"}},messages:{type:"array",items:{$ref:"#/definitions/Message"}},students:{type:"array",items:{$ref:"#/definitions/Student"}},activityLog:{type:"array",items:{$ref:"#/definitions/ActivityLogEntry"}},authoredActivityLog:{type:"array",items:{$ref:"#/definitions/ActivityLogEntry"}},jobReviews:{type:"array",items:{$ref:"#/definitions/JobReview"}},jobApplications:{type:"array",items:{$ref:"#/definitions/JobApplication"}},studentProjecTeamMembers:{type:"array",items:{$ref:"#/definitions/StudentProjecTeamMember"}}}},Track:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},name:{type:"string"},programs:{type:"array",items:{$ref:"#/definitions/Program"}},crawlerQueries:{type:"array",items:{$ref:"#/definitions/CrawlerQuery"}},jobProfileTypes:{type:"array",items:{$ref:"#/definitions/JobProfileType"}},applicationChallenges:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeTrack"}}}},Program:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},name:{type:"string"},description:{type:["string","null"]},langs:{type:"array",enum:["en","es","pt"]},hidden:{type:"boolean",default:!1},track:{$ref:"#/definitions/Track"},cohorts:{type:"array",items:{$ref:"#/definitions/Cohort"}},stages:{type:"array",items:{$ref:"#/definitions/Stage"}}}},Stage:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},name:{type:"string"},order:{type:"integer"},program:{$ref:"#/definitions/Program"},cohorts:{type:"array",items:{$ref:"#/definitions/Cohort"}}}},Cohort:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},lang:{type:["string","null"],enum:["en","es","pt"]},start:{type:"string",format:"date-time"},end:{type:"string",format:"date-time"},timeZone:{type:["string","null"]},startTime:{type:["string","null"]},endTime:{type:["string","null"]},legacySlug:{type:"string"},vacancies:{type:["integer","null"]},admissionStart:{type:["string","null"],format:"date-time"},admissionEnd:{type:["string","null"],format:"date-time"},admissionCountries:{type:"array",items:{type:"string"}},placementStart:{type:["string","null"],format:"date-time"},placementDuration:{type:["integer","null"]},program:{$ref:"#/definitions/Program"},stage:{$ref:"#/definitions/Stage"},applications:{type:"array",items:{$ref:"#/definitions/Application"}},links:{type:"array",items:{$ref:"#/definitions/CohortLink"}},dropouts:{type:"array",items:{$ref:"#/definitions/Dropout"}},gigs:{type:"array",items:{$ref:"#/definitions/Gig"}},students:{type:"array",items:{$ref:"#/definitions/Student"}},signupUsers:{type:"array",items:{$ref:"#/definitions/User"}},activityLog:{type:"array",items:{$ref:"#/definitions/ActivityLogEntry"}},jobApplications:{type:"array",items:{$ref:"#/definitions/JobApplication"}},studentProjects:{type:"array",items:{$ref:"#/definitions/StudentProject"}}}},Student:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},legacyStudentCode:{type:["string","null"]},cohort:{$ref:"#/definitions/Cohort"},user:{$ref:"#/definitions/User"}}},CohortLink:{type:"object",properties:{id:{type:"integer"},url:{type:"string"},visibility:{type:"string",enum:["public","members","staff","team","admin"]},cohort:{$ref:"#/definitions/Cohort"}}},Dropout:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},date:{type:"string",format:"date-time"},reasonDetail:{type:["string","null"]},notes:{type:["string","null"]},staffSad:{type:"boolean"},covidRelated:{type:["boolean","null"]},reason:{type:"string",enum:["dropout","noShow","invitedToLeave","changeCohort"]},completedProjects:{type:"integer"},lastProject:{type:["string","null"]},cohort:{$ref:"#/definitions/Cohort"},user:{$ref:"#/definitions/User"}}},IscedLevel:{type:"object",properties:{id:{type:"integer"},label:{type:"string"},educationLevels:{type:"array",items:{$ref:"#/definitions/EducationLevel"}}}},EducationLevel:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},lang:{type:"string",enum:["en","es","pt"]},label:{type:"string"},country:{$ref:"#/definitions/Country"},iscedLevel:{$ref:"#/definitions/IscedLevel"},applications:{type:"array",items:{$ref:"#/definitions/Application"}}}},University:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},lang:{type:"string",enum:["en","es","pt"]},name:{type:"string"},filter:{type:"boolean"},country:{$ref:"#/definitions/Country"},applications:{type:"array",items:{$ref:"#/definitions/Application"}}}},Application:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},dateOfBirth:{type:"string",format:"date-time"},isAllowedToWork:{type:"boolean"},hasValidIdDocument:{type:"boolean"},locality:{type:["number","string","boolean","object","array","null"]},householdSize:{type:"integer"},children:{type:"integer"},householdIncome:{type:"integer"},racialIdentity:{type:["string","null"]},schoolType:{type:["string","null"],enum:["private","public","other","subsidized","mixed"]},educationSubject:{type:["string","null"],enum:["design_and_media","software_engineering","engineering","management_and_business","languages","science","health","social_sciences","arts","comms_and_advertising","education","cooking","tourism","economics_and_accounting","law","other"]},isStudying:{type:"boolean"},englishLevel:{type:["string","null"],enum:["NO","A1","A2","B1","B2","C1","C2"]},workStatus:{type:"string",enum:["never","not_now","yes"]},isLookingForWork:{type:["boolean","null"]},monthsLookingForWork:{type:["integer","null"]},monthsUnemployed:{type:["integer","null"]},workRole:{type:["string","null"],enum:["waitress","promoter","manager","cashier","intern","operative","call_center","receptionist","sales_agent","assistant","professional","technical","consultant","other"]},freelance:{type:["boolean","null"]},workFormal:{type:["boolean","null"]},workIncome:{type:["integer","null"]},failedFilters:{type:"array",items:{type:"string"}},bypassFilters:{type:"boolean",default:!1},isReady:{type:"boolean",default:!1},isReturningApplicant:{type:["boolean","null"]},legacyAdmissionCohortSlug:{type:["string","null"]},cohort:{$ref:"#/definitions/Cohort"},user:{$ref:"#/definitions/User"},country:{$ref:"#/definitions/Country"},nationality:{$ref:"#/definitions/Country"},educationLevel:{$ref:"#/definitions/EducationLevel"},university:{anyOf:[{$ref:"#/definitions/University"},{type:"null"}]},challengeAssignments:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeAssignment"}}}},ApplicationChallenge:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},slug:{type:"string"},version:{type:"string"},trackId:{type:"integer"},tracks:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeTrack"}},langs:{type:"array",enum:["en","es","pt"]},json:{type:"string"},archived:{type:"boolean",default:!1},assignments:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeAssignment"}}}},ApplicationChallengeAssignment:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},application:{$ref:"#/definitions/Application"},challenge:{$ref:"#/definitions/ApplicationChallenge"}}},ApplicationChallengeTrack:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},applicationChallenge:{$ref:"#/definitions/ApplicationChallenge"},track:{$ref:"#/definitions/Track"}}},ActivityLogEntry:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},type:{type:"string",enum:["challenge","application_filter","application_filter_bypass","application_cohort_change","project_assessment","project_assessment_request","project_assessment_assignment"]},data:{type:["number","string","boolean","object","array","null"]},path:{type:"string"},author:{$ref:"#/definitions/User"},user:{$ref:"#/definitions/User"},cohort:{$ref:"#/definitions/Cohort"}}},StudentProject:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},projectSlug:{type:"string"},projectVersion:{type:"string"},cohort:{$ref:"#/definitions/Cohort"},links:{type:"array",items:{$ref:"#/definitions/StudentProjectLink"}},team:{type:"array",items:{$ref:"#/definitions/StudentProjecTeamMember"}}}},StudentProjecTeamMember:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},studentProject:{$ref:"#/definitions/StudentProject"},user:{$ref:"#/definitions/User"}}},StudentProjectLink:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},url:{type:"string"},studentProject:{$ref:"#/definitions/StudentProject"}}},Contract:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},isEmployment:{type:"boolean"},feeAmount:{type:"integer"},hoursPerWeek:{type:"integer"},start:{type:"string",format:"date-time"},end:{type:["string","null"],format:"date-time"},isTrial:{type:"boolean",default:!1},source:{type:["string","null"],enum:["graduate","referral","jazzhr","web","linkedin","other"]},checkPilot:{anyOf:[{$ref:"#/definitions/User"},{type:"null"}]},country:{$ref:"#/definitions/Country"},user:{$ref:"#/definitions/User"},gigs:{type:"array",items:{$ref:"#/definitions/Gig"}}}},Gig:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},role:{type:"string",enum:["bm","pdc","js","ux"]},hoursPerWeek:{type:"integer"},start:{type:"string",format:"date-time"},end:{type:["string","null"],format:"date-time"},cohort:{$ref:"#/definitions/Cohort"},contract:{$ref:"#/definitions/Contract"},user:{$ref:"#/definitions/User"}}},Message:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},key:{type:"string"},from:{type:"string"},to:{type:"string"},transport:{type:"string",enum:["mandrill","slack"]},status:{type:"string",default:"PENDING",enum:["PENDING","QUEUED","ERROR","SENT"]},data:{type:["number","string","boolean","object","array","null"]},taskInfo:{type:["number","string","boolean","object","array","null"]},user:{anyOf:[{$ref:"#/definitions/User"},{type:"null"}]},logs:{type:"array",items:{$ref:"#/definitions/MessageLog"}}}},MessageLog:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},statusText:{type:["string","null"]},message:{$ref:"#/definitions/Message"}}},Industry:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},companies:{type:"array",items:{$ref:"#/definitions/Company"}}}},Company:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},source:{type:"string"},sourceId:{type:"string"},name:{type:"string"},size:{type:["string","null"],enum:["A_2_10","B_11_50","C_51_200","D_201_500","E_501_1000","F_1001_5000","G_5001_10000","H_10001_plus"]},data:{type:["number","string","boolean","object","array","null"]},web:{type:["string","null"]},twitter:{type:["string","null"]},github:{type:["string","null"]},facebook:{type:["string","null"]},country:{anyOf:[{$ref:"#/definitions/Country"},{type:"null"}]},industry:{anyOf:[{$ref:"#/definitions/Industry"},{type:"null"}]},jobs:{type:"array",items:{$ref:"#/definitions/Job"}},categories:{type:"array",enum:["Tech_Consultancy","Digital_Transformation","Agency","Startups","High_tech","Traditional_Consulting"]}}},Job:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},source:{type:"string"},sourceId:{type:"string"},title:{type:"string"},publishedAt:{type:"string",format:"date-time"},modality:{type:"string"},publicUrl:{type:["string","null"]},location:{type:["string","null"]},data:{type:["number","string","boolean","object","array","null"]},description:{type:["string","null"]},descriptionHTML:{type:["string","null"]},functions:{type:["string","null"]},functionsHTML:{type:["string","null"]},seniority:{type:["string","null"]},remote:{type:["boolean","null"]},remoteOption:{type:["string","null"],enum:["remote_for_now","locally_remote","fully_remote","no_remote","mixed"]},lang:{type:["string","null"],enum:["en","es","pt"]},maxSalary:{type:["integer","null"]},minSalary:{type:["integer","null"]},tags:{type:"array",items:{type:"string"}},company:{$ref:"#/definitions/Company"},country:{anyOf:[{$ref:"#/definitions/Country"},{type:"null"}]},reviews:{type:"array",items:{$ref:"#/definitions/JobReview"}},applications:{type:"array",items:{$ref:"#/definitions/JobApplication"}},crawlerQueries:{type:"array",items:{$ref:"#/definitions/JobCrawlerQuery"}},crawlerLocations:{type:"array",items:{$ref:"#/definitions/JobCrawlerLocation"}}}},JobProfileType:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},learningObjectives:{type:["number","string","boolean","object","array","null"]},track:{anyOf:[{$ref:"#/definitions/Track"},{type:"null"}]},reviews:{type:"array",items:{$ref:"#/definitions/JobReviewProfileType"}}}},JobReview:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},isValid:{type:"boolean"},invalidReason:{type:["string","null"],enum:["unrelated","experience","qualifications","other"]},comment:{type:["string","null"]},author:{$ref:"#/definitions/User"},job:{$ref:"#/definitions/Job"},profileTypes:{type:"array",items:{$ref:"#/definitions/JobReviewProfileType"}}}},JobReviewProfileType:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},review:{$ref:"#/definitions/JobReview"},profileType:{$ref:"#/definitions/JobProfileType"}}},JobApplication:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},status:{type:"string",default:"pending",enum:["pending","applied","interview","challenge","followup","hired","not_hired"]},hireDate:{type:["string","null"],format:"date-time"},jobStartDate:{type:["string","null"],format:"date-time"},netSalary:{type:["integer","null"]},grossSalary:{type:["integer","null"]},currency:{type:["string","null"]},job:{$ref:"#/definitions/Job"},user:{$ref:"#/definitions/User"},cohort:{anyOf:[{$ref:"#/definitions/Cohort"},{type:"null"}]}}},CrawlerQuery:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},query:{type:"string"},enabled:{type:"boolean",default:!0},track:{$ref:"#/definitions/Track"},jobs:{type:"array",items:{$ref:"#/definitions/JobCrawlerQuery"}}}},JobCrawlerQuery:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},job:{$ref:"#/definitions/Job"},query:{$ref:"#/definitions/CrawlerQuery"}}},CrawlerLocation:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},enabled:{type:"boolean",default:!0},jobs:{type:"array",items:{$ref:"#/definitions/JobCrawlerLocation"}}}},JobCrawlerLocation:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},job:{$ref:"#/definitions/Job"},location:{$ref:"#/definitions/CrawlerLocation"}}}},type:"object",properties:{country:{$ref:"#/definitions/Country"},currency:{$ref:"#/definitions/Currency"},user:{$ref:"#/definitions/User"},track:{$ref:"#/definitions/Track"},program:{$ref:"#/definitions/Program"},stage:{$ref:"#/definitions/Stage"},cohort:{$ref:"#/definitions/Cohort"},student:{$ref:"#/definitions/Student"},cohortLink:{$ref:"#/definitions/CohortLink"},dropout:{$ref:"#/definitions/Dropout"},iscedLevel:{$ref:"#/definitions/IscedLevel"},educationLevel:{$ref:"#/definitions/EducationLevel"},university:{$ref:"#/definitions/University"},application:{$ref:"#/definitions/Application"},applicationChallenge:{$ref:"#/definitions/ApplicationChallenge"},applicationChallengeAssignment:{$ref:"#/definitions/ApplicationChallengeAssignment"},applicationChallengeTrack:{$ref:"#/definitions/ApplicationChallengeTrack"},activityLogEntry:{$ref:"#/definitions/ActivityLogEntry"},studentProject:{$ref:"#/definitions/StudentProject"},studentProjecTeamMember:{$ref:"#/definitions/StudentProjecTeamMember"},studentProjectLink:{$ref:"#/definitions/StudentProjectLink"},contract:{$ref:"#/definitions/Contract"},gig:{$ref:"#/definitions/Gig"},message:{$ref:"#/definitions/Message"},messageLog:{$ref:"#/definitions/MessageLog"},industry:{$ref:"#/definitions/Industry"},company:{$ref:"#/definitions/Company"},job:{$ref:"#/definitions/Job"},jobProfileType:{$ref:"#/definitions/JobProfileType"},jobReview:{$ref:"#/definitions/JobReview"},jobReviewProfileType:{$ref:"#/definitions/JobReviewProfileType"},jobApplication:{$ref:"#/definitions/JobApplication"},crawlerQuery:{$ref:"#/definitions/CrawlerQuery"},jobCrawlerQuery:{$ref:"#/definitions/JobCrawlerQuery"},crawlerLocation:{$ref:"#/definitions/CrawlerLocation"},jobCrawlerLocation:{$ref:"#/definitions/JobCrawlerLocation"}}},Ln=24*(60*60*1e3),Go={Country:{primaryKey:"code",plural:"countries",searchProps:["code","name","timeZone"],getOptionLabel:({code:n,name:e})=>`${n} / ${e}`},ActivityLogEntry:{plural:"activityLog"},User:{primaryKey:"uid",inputProps:["firstName","lastName","email","password","lang","identifiesAsFemale","dateOfBirth","country","identificationNumber","mobileNumber","github","linkedin","bio","role","signupCohort","disabled","referralSource"],searchProps:["firstName","lastName","email"],getOptionLabel:({firstName:n,lastName:e,email:t})=>`${n} ${e} (${t})`,properties:{email:{inputType:"email"},lastName:{isRequired:!0},mobileNumber:{inputType:"phone"},bio:{inputType:"textarea"}},parse:n=>{const e=n.github?`https://github.com/${n.github}.png?size=`:`https://www.gravatar.com/avatar/${Uo(n.email)}?s=`;return{...n,fullName:`${n.firstName||""}${n.lastName?` ${n.lastName}`:""}`,avatar:t=>`${e}${t}`,isStaff:["staff","manager","finance","admin"].includes(n.role),isManager:["manager","finance","admin"].includes(n.role),isFinance:["finance","admin"].includes(n.role),isAdmin:n.role==="admin"}}},Track:{searchProps:["name"]},Program:{searchProps:["name"]},Stage:{searchProps:["name"]},Cohort:{inputProps:["program","stage","lang","name","start","end","timeZone","startTime","endTime","vacancies","admissionStart","admissionEnd","placementStart","admissionCountries"],searchProps:["name"],getOptionLabel:({id:n,name:e,stage:t})=>`${e}${t?` - ${t.name}`:""} (id: ${n})`,properties:{},parse:n=>{var s,o;const e=Date.now();let t;if(n.placementStart){const c=n.placementDuration||270;new Date(+n.placementStart+c*24*60*60*1e3)<e?t="placement_ended":n.placementStart<e&&(t="placement_started")}!t&&n.end<e&&(t="ended"),!t&&n.start<e&&(t="started");const r=n.admissionEnd?+n.admissionEnd+Ln:!1;!t&&r&&r<e&&(t="admission_ended"),!t&&n.admissionStart&&n.admissionStart<e&&(t="admission_started"),!t&&n.admissionStart&&n.admissionEnd&&(t="planned"),t||(t="draft");const i=n.start>e&&n.vacancies?n.vacancies:((s=n._count)==null?void 0:s.students)||((o=n.students)==null?void 0:o.length)||0;return{...n,status:t,size:i}}},Student:{inputProps:["cohort","user"],searchProps:["user.firstName","user.lastName","user.email"],defaultProps:["id","cohort","user"],getOptionLabel:({user:n,cohort:e})=>`${n==null?void 0:n.firstName} ${(n==null?void 0:n.lastName)||""} (${e==null?void 0:e.name})`},Dropout:{inputProps:["cohort","user","date","reason","reasonDetail","lastProject","completedProjects","notes","staffSad","covidRelated"],searchProps:["user.uid","user.firstName","user.lastName","user.email","cohort.name"]},Contract:{inputProps:["user","country","isEmployment","feeAmount","hoursPerWeek","start","end","isTrial","checkPilot","source"],searchProps:["user.firstName","user.lastName","user.email"],getOptionLabel:({id:n,user:e})=>`${e==null?void 0:e.firstName} (id: ${n})`},Gig:{inputProps:["cohort","user","contract","role","hoursPerWeek","start","end"]},Application:{inputProps:["user","cohort","dateOfBirth","country","locality","nationality","isAllowedToWork","hasValidIdDocument","householdSize","children","householdIncome","racialIdentity","educationLevel","schoolType","educationSubject","university","isStudying","englishLevel","workStatus","isLookingForWork","monthsLookingForWork","monthsUnemployed","workRole","freelance","workFormal","workIncome","isReady","bypassFilters"],properties:{locality:{isRequired:!0},englishLevel:{isRequired:!0},isReady:{isRequired:!1},bypassFilters:{isRequired:!1}},parse:n=>{var i,s,o;const e=typeof n.hasFailedFilters=="boolean"?n.hasFailedFilters:typeof((i=n.failedFilters)==null?void 0:i.length)=="number"?n.failedFilters.length>0:void 0;if(!((s=n.cohort)!=null&&s.admissionEnd)||typeof e>"u")return n;const t=Date.now();let r;return n.isReady?r="ready":e&&!n.bypassFilters?r="rejected":n.createdAt<t-90*Ln?r="expired":((o=n.cohort)==null?void 0:o.status)!=="admission_started"?r="admission_ended":r="active",{...n,status:r}}},IscedLevel:{parse:n=>{const e=Math.floor(n.id/10);return{...n,level:e,completed:e*10<n.id}}},EducationLevel:{searchProps:["label"]},University:{plural:"universities",searchProps:["name"]},Company:{plural:"companies"},CrawlerQuery:{plural:"crawlerQueries"},JobCrawlerQuery:{plural:"jobCrawlerQueries"}},Jo=(n,e)=>({...zo(n,e,{...Dn,definitions:qo(Dn,Go)}),gcpLog:{getEntries:async t=>await gt(n,e.authUser)(`/gcp-logs?q=${JSON.stringify(t)}`)}}),Ko=(n,e)=>{const t=gt(n,e.authUser);return{project:{findMany:(r={})=>t(`/projects?q=${JSON.stringify(r)}`),findBySlug:(r,i={})=>t(`/projects/${r}?q=${JSON.stringify(i)}`)},topic:{findMany:(r={})=>t(`/topics?q=${JSON.stringify(r)}`),findBySlug:(r,i={})=>t(`/topics/${r}?q=${JSON.stringify(i)}`)},learningObjective:{findMany:(r={})=>t(`/learning-objectives?q=${JSON.stringify(r)}`)}}},Ve=n=>n>9?`${n}`:`0${n}`,$n=n=>`${Ve(n.getUTCDate())}/${Ve(n.getUTCMonth()+1)}/${n.getUTCFullYear()}`,Mn=n=>`${Ve(n.getUTCHours())}:${Ve(n.getUTCMinutes())}:${n.getUTCSeconds()} UTC`,Yo=n=>`${$n(n)} ${Mn(n)}`,Qo={es:"es-ES",pt:"pt-BR"},Xo=(n,e="es",t=!1)=>new Intl.DateTimeFormat(Qo[e],{...t&&{year:"numeric"},month:"long",day:"numeric",timeZone:"UTC"}).format(new Date(n)),Zo=(n,e)=>{let t=e.getFullYear()-n.getFullYear();const r=e.getMonth()-n.getMonth();return(r<0||r===0&&e.getDate()<n.getDate())&&t--,t},ea=(n,e,t)=>new Intl.NumberFormat(`${n}-${e}`,{currency:t}),ta=(n,e,t,r)=>ea(e,t,r).format(n),na=n=>parseInt(n.replace(/[,\.]/g,""),10),ra=n=>{try{return JSON.parse(window.localStorage.getItem(n))}catch{return null}},ia=({firebaseApiKey:n="AIzaSyAXbaEbpq8NOfn0r8mIrcoHvoGRkJThwdc",firebaseProject:e="laboratoria-la",coreApiUrl:t="https://us-central1-outpost-272720.cloudfunctions.net/core-api"}={})=>{const r=Ot({apiKey:n,authDomain:`${e}.firebaseapp.com`,databaseURL:`https://${e}.firebaseio.com`,projectId:e}),i=Do(r),s={authUser:void 0,user:void 0},o=Jo(t,s);return{...Ko(t,s),...o,auth:{onChange:u=>vs(i,y=>{if(!y)return Object.assign(s,{authUser:null,user:null}),u(s);Object.assign(s,{authUser:y}),o.user.findById(y.uid).then(b=>{Object.assign(s,{user:b}),u(s)}).catch(b=>{console.error(b),Object.assign(s,{authUser:null,user:null}),u(s)})}),signIn:(u,y)=>ms(i,u,y),signOut:()=>bs(i),sendPasswordResetEmail:u=>gs(i,u)},firebaseApp:r}};k.createApp=ia,k.formatCurrency=ta,k.formatDate=$n,k.formatDateTime=Yo,k.formatMonth=Xo,k.formatTime=Mn,k.getAgeAt=Zo,k.loadFromLocalStorage=ra,k.parseCurrency=na,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
1486
+ */const Oo=5*60,ko=bt("authIdTokenMaxAge")||Oo;let On=null;const No=n=>async e=>{const t=e&&await e.getIdTokenResult(),r=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(r&&r>ko)return;const i=t==null?void 0:t.token;On!==i&&(On=i,await fetch(n,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function Do(n=ti()){const e=Pt(n,"auth");if(e.isInitialized())return e.getImmediate();const t=Yi(n,{popupRedirectResolver:So,persistence:[Ms,Ts,gn]}),r=bt("authTokenSyncURL");if(r){const s=No(r);_s(t,s,()=>s(t.currentUser)),ys(t,o=>s(o))}const i=xn("auth");return i&&Xi(t,`http://${i}`),t}Po("Browser");var Lo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $o(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var kn={exports:{}};(function(n){(function(e){function t(l,m){var d=(l&65535)+(m&65535),w=(l>>16)+(m>>16)+(d>>16);return w<<16|d&65535}function r(l,m){return l<<m|l>>>32-m}function i(l,m,d,w,E,A){return t(r(t(t(m,l),t(w,A)),E),d)}function s(l,m,d,w,E,A,R){return i(m&d|~m&w,l,m,E,A,R)}function o(l,m,d,w,E,A,R){return i(m&w|d&~w,l,m,E,A,R)}function c(l,m,d,w,E,A,R){return i(m^d^w,l,m,E,A,R)}function a(l,m,d,w,E,A,R){return i(d^(m|~w),l,m,E,A,R)}function u(l,m){l[m>>5]|=128<<m%32,l[(m+64>>>9<<4)+14]=m;var d,w,E,A,R,h=1732584193,f=-271733879,p=-1732584194,g=271733878;for(d=0;d<l.length;d+=16)w=h,E=f,A=p,R=g,h=s(h,f,p,g,l[d],7,-680876936),g=s(g,h,f,p,l[d+1],12,-389564586),p=s(p,g,h,f,l[d+2],17,606105819),f=s(f,p,g,h,l[d+3],22,-1044525330),h=s(h,f,p,g,l[d+4],7,-176418897),g=s(g,h,f,p,l[d+5],12,1200080426),p=s(p,g,h,f,l[d+6],17,-1473231341),f=s(f,p,g,h,l[d+7],22,-45705983),h=s(h,f,p,g,l[d+8],7,1770035416),g=s(g,h,f,p,l[d+9],12,-1958414417),p=s(p,g,h,f,l[d+10],17,-42063),f=s(f,p,g,h,l[d+11],22,-1990404162),h=s(h,f,p,g,l[d+12],7,1804603682),g=s(g,h,f,p,l[d+13],12,-40341101),p=s(p,g,h,f,l[d+14],17,-1502002290),f=s(f,p,g,h,l[d+15],22,1236535329),h=o(h,f,p,g,l[d+1],5,-165796510),g=o(g,h,f,p,l[d+6],9,-1069501632),p=o(p,g,h,f,l[d+11],14,643717713),f=o(f,p,g,h,l[d],20,-373897302),h=o(h,f,p,g,l[d+5],5,-701558691),g=o(g,h,f,p,l[d+10],9,38016083),p=o(p,g,h,f,l[d+15],14,-660478335),f=o(f,p,g,h,l[d+4],20,-405537848),h=o(h,f,p,g,l[d+9],5,568446438),g=o(g,h,f,p,l[d+14],9,-1019803690),p=o(p,g,h,f,l[d+3],14,-187363961),f=o(f,p,g,h,l[d+8],20,1163531501),h=o(h,f,p,g,l[d+13],5,-1444681467),g=o(g,h,f,p,l[d+2],9,-51403784),p=o(p,g,h,f,l[d+7],14,1735328473),f=o(f,p,g,h,l[d+12],20,-1926607734),h=c(h,f,p,g,l[d+5],4,-378558),g=c(g,h,f,p,l[d+8],11,-2022574463),p=c(p,g,h,f,l[d+11],16,1839030562),f=c(f,p,g,h,l[d+14],23,-35309556),h=c(h,f,p,g,l[d+1],4,-1530992060),g=c(g,h,f,p,l[d+4],11,1272893353),p=c(p,g,h,f,l[d+7],16,-155497632),f=c(f,p,g,h,l[d+10],23,-1094730640),h=c(h,f,p,g,l[d+13],4,681279174),g=c(g,h,f,p,l[d],11,-358537222),p=c(p,g,h,f,l[d+3],16,-722521979),f=c(f,p,g,h,l[d+6],23,76029189),h=c(h,f,p,g,l[d+9],4,-640364487),g=c(g,h,f,p,l[d+12],11,-421815835),p=c(p,g,h,f,l[d+15],16,530742520),f=c(f,p,g,h,l[d+2],23,-995338651),h=a(h,f,p,g,l[d],6,-198630844),g=a(g,h,f,p,l[d+7],10,1126891415),p=a(p,g,h,f,l[d+14],15,-1416354905),f=a(f,p,g,h,l[d+5],21,-57434055),h=a(h,f,p,g,l[d+12],6,1700485571),g=a(g,h,f,p,l[d+3],10,-1894986606),p=a(p,g,h,f,l[d+10],15,-1051523),f=a(f,p,g,h,l[d+1],21,-2054922799),h=a(h,f,p,g,l[d+8],6,1873313359),g=a(g,h,f,p,l[d+15],10,-30611744),p=a(p,g,h,f,l[d+6],15,-1560198380),f=a(f,p,g,h,l[d+13],21,1309151649),h=a(h,f,p,g,l[d+4],6,-145523070),g=a(g,h,f,p,l[d+11],10,-1120210379),p=a(p,g,h,f,l[d+2],15,718787259),f=a(f,p,g,h,l[d+9],21,-343485551),h=t(h,w),f=t(f,E),p=t(p,A),g=t(g,R);return[h,f,p,g]}function y(l){var m,d="",w=l.length*32;for(m=0;m<w;m+=8)d+=String.fromCharCode(l[m>>5]>>>m%32&255);return d}function b(l){var m,d=[];for(d[(l.length>>2)-1]=void 0,m=0;m<d.length;m+=1)d[m]=0;var w=l.length*8;for(m=0;m<w;m+=8)d[m>>5]|=(l.charCodeAt(m/8)&255)<<m%32;return d}function S(l){return y(u(b(l),l.length*8))}function O(l,m){var d,w=b(l),E=[],A=[],R;for(E[15]=A[15]=void 0,w.length>16&&(w=u(w,l.length*8)),d=0;d<16;d+=1)E[d]=w[d]^909522486,A[d]=w[d]^1549556828;return R=u(E.concat(b(m)),512+m.length*8),y(u(A.concat(R),640))}function L(l){var m="0123456789abcdef",d="",w,E;for(E=0;E<l.length;E+=1)w=l.charCodeAt(E),d+=m.charAt(w>>>4&15)+m.charAt(w&15);return d}function v(l){return unescape(encodeURIComponent(l))}function I(l){return S(v(l))}function N(l){return L(I(l))}function C(l,m){return O(v(l),v(m))}function W(l,m){return L(C(l,m))}function $(l,m,d){return m?d?C(m,l):W(m,l):d?I(l):N(l)}n.exports?n.exports=$:e.md5=$})(Lo)})(kn);var Mo=kn.exports;const Uo=$o(Mo),gt=(n,e)=>async(t,r={})=>{const i=e?await e.getIdToken():null,s=await fetch(`${n}${t}`,{mode:"cors",...r,headers:{...i&&{authorization:`Bearer ${i}`},...r.body&&{"content-type":"application/json"},...r.headers},...r.body&&{body:JSON.stringify(r.body)}}),o=await s.json();if(s.status>202)throw Object.assign(new Error((o==null?void 0:o.message)||`HTTP Error ${s.status}`),{status:s.status,code:o==null?void 0:o.code,body:o});return o},jo=n=>{const e=n.properties||{},t=n.inputProps||Object.keys(e),r=(i,s)=>{const o=e[i]||{};if([null,void 0].includes(s))return o.isRequired?{id:"value-missing-validation-error"}:void 0;if(o.enum)return o.enum.includes(s)?void 0:{id:"enum-validation-error",values:{enum:o.enum,value:s}};switch(o.type){case"integer":if(o.isScalar&&(typeof s!="number"||Number.isNaN(s)))return{id:"invalid-number-validation-error"};break;case"date":break;case"boolean":break;case"json":case"string":default:if(o.isRequired&&!s)return{id:"value-missing-validation-error"};break}};return{validate:i=>t.reduce((s,o)=>{const c=r(o,i[o]);return c?{...s,[o]:c}:s},{}),validateAttr:r}},Bo=(n={})=>Object.keys(n).length?`?q=${JSON.stringify(n)}`:"",Fo=n=>[...n].reduce((e,t)=>t===t.toUpperCase()?`${e}-${t.toLowerCase()}`:`${e}${t}`,""),Ho=n=>`${n[0].toLowerCase()}${n.slice(1)}`,Vo=n=>{const e=Fo(n);return(t,r)=>`/${e}${t?`/${encodeURIComponent(t)}`:""}${Bo(r)}`},Nn=(n,e)=>{const t=Array.isArray(e.inputProps);return Object.keys(n).reduce((r,i)=>{if(t&&!e.inputProps.includes(i))return r;const{isRef:s,isScalar:o,isRequired:c}=e.properties[i]||{};return s&&o&&!c&&n[i]===null?r:{...r,[i]:n[i]}},{})},Wo=({primaryKey:n,properties:e,...t})=>({primaryKey:n||"id",properties:Object.keys(e||{}).reduce((r,i)=>{var b,S;const s=e[i]||{},{type:o,isScalar:c,isRequired:a,isRef:u=!1}=typeof s.type=="string"?s.type==="array"?s.enum?{type:"string",isScalar:!1,isRequired:!1}:(b=s.items)!=null&&b.$ref?{type:s.items.$ref.split("/").pop(),isScalar:!1,isRequired:!1,isRef:!0}:{type:(S=s.items)==null?void 0:S.type,isScalar:!1,isRequired:!1}:{type:s.format==="date-time"?"date":s.type,isScalar:!0,isRequired:!0}:Array.isArray(s.type)?s.type.length===2?{type:s.format==="date-time"?"date":s.type[0],isScalar:!0,isRequired:!1}:{type:"json",isScalar:!0,isRequired:s.type.includes("null")}:s.$ref?{type:s.$ref.split("/").pop(),isScalar:!0,isRequired:!0,isRef:!0}:{type:s.anyOf[0].$ref.split("/").pop(),isScalar:!0,isRequired:!1,isRef:!0},y=s.inputType||(o==="integer"?"number":o);return{...r,[i]:{...e[i],type:o,isScalar:c,isRequired:typeof s.isRequired=="boolean"?s.isRequired:a,isRef:u,inputType:y}}},{}),...t}),xo=(n,e,t,r={},i={})=>{const s=Wo(r),{primaryKey:o,properties:c}=s,a=jo(s),u=Vo(t),y=(...v)=>gt(n,e.authUser)(...v),b=({data:v,...I})=>y(u(null,I),{method:"POST",body:Nn(v,s)}),S=({data:v,...I})=>{const{where:N,...C}=I;return y(u(N[o],C),{method:"PUT",body:Nn(v,s)})},O=v=>{if(!v)return v;const I=Object.keys(v).reduce((N,C)=>{var E;const W=c[C]||{},{type:$,isScalar:l,isRef:m,format:d,items:w}=W;if(m){const A=Ho($);return l?{...N,[C]:i[A].parse(v[C])}:{...N,[C]:typeof((E=i[A])==null?void 0:E.parse)=="function"?v[C].map(R=>i[A].parse(R)):v[C]}}return{...N,[C]:$==="date"&&v[C]?new Date(v[C]):v[C]}},{});return typeof s.parse=="function"?s.parse(I):I},L=Object.keys(c||{}).reduce((v,I)=>c[I].isRef&&c[I].isScalar&&c[I].isRequired?Object.assign(v,{all:v.all.concat(I),oneToOne:v.oneToOne.concat(I),requiredOneToOne:v.requiredOneToOne.concat(I)}):c[I].isRef&&c[I].isScalar?Object.assign(v,{all:v.all.concat(I),oneToOne:v.oneToOne.concat(I),optionalOneToOne:v.optionalOneToOne.concat(I)}):c[I].isRef?Object.assign(v,{all:v.all.concat(I),oneToMany:v.oneToMany.concat(I)}):v,{all:[],oneToOne:[],requiredOneToOne:[],optionalOneToOne:[],oneToMany:[]});return{get schema(){return s},get relations(){return L},parse:O,validateAttr:a.validateAttr,validate:a.validate,findMany:v=>y(u(null,v)).then(I=>I.map(O)),findById:(v,I)=>y(u(v,I)).then(O),create:b,update:S,upsert:v=>v.where[o]?S({where:v.where,data:v.update}):b({data:v.create}),delete:v=>y(u(v),{method:"DELETE"}),stats:()=>y(u("_stats")),search:(v,I={})=>{var d;const{searchProps:N}=s,W=v.split(" ").reduce((w,E)=>[...w,{OR:N.reduce((A,R)=>{const h=R.split(".");return[...A,h.reduceRight((f,p)=>({[p]:f}),{contains:E,mode:"insensitive"})]},[])}],[]),$={...I.select,...I.include},l=(d=s.defaultProps)!=null&&d.length?Object.assign(...s.defaultProps.map(w=>({[w]:!0}))):null,m=Object.keys($).length?$:l;return y(u(null,{where:{...I.where,AND:W},...!!m&&{select:m},...I.orderBy&&{orderBy:I.orderBy},take:I.take||100}))}}},zo=(n,e,t)=>Object.keys(t.properties).reduce((r,i)=>{const s=t.properties[i].$ref.split("/").pop();return Object.assign(r,{[i]:xo(n,e,t.definitions[s].plural||`${i}s`,t.definitions[s],r)})},{}),qo=(n,e)=>Object.keys(n.definitions).reduce((t,r)=>({...t,[r]:e[r]?{...n.definitions[r],...e[r],properties:Object.keys(n.definitions[r].properties).reduce((i,s)=>({...i,[s]:{...n.definitions[r].properties[s],...(e[r].properties||{})[s]}}),e[r].properties||{})}:n.definitions[r]}),{}),Dn={$schema:"http://json-schema.org/draft-07/schema#",definitions:{Country:{type:"object",properties:{code:{type:"string"},name:{type:"string"},incomeFilter:{type:["integer","null"]},canApply:{type:"boolean",default:!1},capital:{type:"array",items:{type:"string"}},timeZone:{type:["string","null"]},flag:{type:["string","null"]},currency:{anyOf:[{$ref:"#/definitions/Currency"},{type:"null"}]},contracts:{type:"array",items:{$ref:"#/definitions/Contract"}},users:{type:"array",items:{$ref:"#/definitions/User"}},applications:{type:"array",items:{$ref:"#/definitions/Application"}},applicationNationalities:{type:"array",items:{$ref:"#/definitions/Application"}},educationLevels:{type:"array",items:{$ref:"#/definitions/EducationLevel"}},universities:{type:"array",items:{$ref:"#/definitions/University"}},companies:{type:"array",items:{$ref:"#/definitions/Company"}},jobs:{type:"array",items:{$ref:"#/definitions/Job"}}}},Currency:{type:"object",properties:{code:{type:"string"},name:{type:"string"},symbol:{type:"string"},countries:{type:"array",items:{$ref:"#/definitions/Country"}}}},User:{type:"object",properties:{uid:{type:"string"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},email:{type:"string"},firstName:{type:"string"},lastName:{type:["string","null"]},role:{type:["string","null"],enum:["staff","manager","finance","admin"]},disabled:{type:"boolean",default:!1},lang:{type:["string","null"],enum:["en","es","pt"]},referralSource:{type:["string","null"],enum:["word_of_mouth","codigo_m","social","google","print","tv","radio","other"]},identifiesAsFemale:{type:["boolean","null"]},dateOfBirth:{type:["string","null"],format:"date-time"},identificationNumber:{type:["string","null"]},mobileNumber:{type:["string","null"]},github:{type:["string","null"]},linkedin:{type:["string","null"]},bio:{type:["string","null"]},country:{anyOf:[{$ref:"#/definitions/Country"},{type:"null"}]},signupCohort:{anyOf:[{$ref:"#/definitions/Cohort"},{type:"null"}]},applications:{type:"array",items:{$ref:"#/definitions/Application"}},contractsAsCheckPilot:{type:"array",items:{$ref:"#/definitions/Contract"}},contracts:{type:"array",items:{$ref:"#/definitions/Contract"}},dropouts:{type:"array",items:{$ref:"#/definitions/Dropout"}},gigs:{type:"array",items:{$ref:"#/definitions/Gig"}},messages:{type:"array",items:{$ref:"#/definitions/Message"}},students:{type:"array",items:{$ref:"#/definitions/Student"}},activityLog:{type:"array",items:{$ref:"#/definitions/ActivityLogEntry"}},authoredActivityLog:{type:"array",items:{$ref:"#/definitions/ActivityLogEntry"}},jobReviews:{type:"array",items:{$ref:"#/definitions/JobReview"}},jobApplications:{type:"array",items:{$ref:"#/definitions/JobApplication"}},studentProjecTeamMembers:{type:"array",items:{$ref:"#/definitions/StudentProjecTeamMember"}}}},Track:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},name:{type:"string"},programs:{type:"array",items:{$ref:"#/definitions/Program"}},crawlerQueries:{type:"array",items:{$ref:"#/definitions/CrawlerQuery"}},jobProfileTypes:{type:"array",items:{$ref:"#/definitions/JobProfileType"}},applicationChallenges:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeTrack"}}}},Program:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},name:{type:"string"},description:{type:["string","null"]},langs:{type:"array",enum:["en","es","pt"]},hidden:{type:"boolean",default:!1},track:{$ref:"#/definitions/Track"},cohorts:{type:"array",items:{$ref:"#/definitions/Cohort"}},stages:{type:"array",items:{$ref:"#/definitions/Stage"}}}},Stage:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},name:{type:"string"},order:{type:"integer"},program:{$ref:"#/definitions/Program"},cohorts:{type:"array",items:{$ref:"#/definitions/Cohort"}}}},Cohort:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},lang:{type:["string","null"],enum:["en","es","pt"]},start:{type:"string",format:"date-time"},end:{type:"string",format:"date-time"},timeZone:{type:["string","null"]},startTime:{type:["string","null"]},endTime:{type:["string","null"]},legacySlug:{type:"string"},vacancies:{type:["integer","null"]},admissionStart:{type:["string","null"],format:"date-time"},admissionEnd:{type:["string","null"],format:"date-time"},admissionCountries:{type:"array",items:{type:"string"}},placementStart:{type:["string","null"],format:"date-time"},placementDuration:{type:["integer","null"]},program:{$ref:"#/definitions/Program"},stage:{$ref:"#/definitions/Stage"},applications:{type:"array",items:{$ref:"#/definitions/Application"}},links:{type:"array",items:{$ref:"#/definitions/CohortLink"}},dropouts:{type:"array",items:{$ref:"#/definitions/Dropout"}},gigs:{type:"array",items:{$ref:"#/definitions/Gig"}},students:{type:"array",items:{$ref:"#/definitions/Student"}},signupUsers:{type:"array",items:{$ref:"#/definitions/User"}},activityLog:{type:"array",items:{$ref:"#/definitions/ActivityLogEntry"}},jobApplications:{type:"array",items:{$ref:"#/definitions/JobApplication"}},studentProjects:{type:"array",items:{$ref:"#/definitions/StudentProject"}}}},Student:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},legacyStudentCode:{type:["string","null"]},cohort:{$ref:"#/definitions/Cohort"},user:{$ref:"#/definitions/User"}}},CohortLink:{type:"object",properties:{id:{type:"integer"},url:{type:"string"},visibility:{type:"string",enum:["public","members","staff","team","admin"]},cohort:{$ref:"#/definitions/Cohort"}}},Dropout:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},date:{type:"string",format:"date-time"},reasonDetail:{type:["string","null"]},notes:{type:["string","null"]},staffSad:{type:"boolean"},covidRelated:{type:["boolean","null"]},reason:{type:"string",enum:["dropout","noShow","invitedToLeave","changeCohort"]},completedProjects:{type:"integer"},lastProject:{type:["string","null"]},cohort:{$ref:"#/definitions/Cohort"},user:{$ref:"#/definitions/User"}}},IscedLevel:{type:"object",properties:{id:{type:"integer"},label:{type:"string"},educationLevels:{type:"array",items:{$ref:"#/definitions/EducationLevel"}}}},EducationLevel:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},lang:{type:"string",enum:["en","es","pt"]},label:{type:"string"},country:{$ref:"#/definitions/Country"},iscedLevel:{$ref:"#/definitions/IscedLevel"},applications:{type:"array",items:{$ref:"#/definitions/Application"}}}},University:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},lang:{type:"string",enum:["en","es","pt"]},name:{type:"string"},filter:{type:"boolean"},country:{$ref:"#/definitions/Country"},applications:{type:"array",items:{$ref:"#/definitions/Application"}}}},Application:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},dateOfBirth:{type:"string",format:"date-time"},isAllowedToWork:{type:"boolean"},hasValidIdDocument:{type:"boolean"},locality:{type:["number","string","boolean","object","array","null"]},householdSize:{type:"integer"},children:{type:"integer"},householdIncome:{type:"integer"},racialIdentity:{type:["string","null"]},schoolType:{type:["string","null"],enum:["private","public","other","subsidized","mixed"]},educationSubject:{type:["string","null"],enum:["design_and_media","software_engineering","engineering","management_and_business","languages","science","health","social_sciences","arts","comms_and_advertising","education","cooking","tourism","economics_and_accounting","law","other"]},isStudying:{type:"boolean"},englishLevel:{type:["string","null"],enum:["NO","A1","A2","B1","B2","C1","C2"]},workStatus:{type:"string",enum:["never","not_now","yes"]},isLookingForWork:{type:["boolean","null"]},monthsLookingForWork:{type:["integer","null"]},monthsUnemployed:{type:["integer","null"]},workRole:{type:["string","null"],enum:["waitress","promoter","manager","cashier","intern","operative","call_center","receptionist","sales_agent","assistant","professional","technical","consultant","other"]},freelance:{type:["boolean","null"]},workFormal:{type:["boolean","null"]},workIncome:{type:["integer","null"]},failedFilters:{type:"array",items:{type:"string"}},bypassFilters:{type:"boolean",default:!1},isReady:{type:"boolean",default:!1},isReturningApplicant:{type:["boolean","null"]},legacyAdmissionCohortSlug:{type:["string","null"]},cohort:{$ref:"#/definitions/Cohort"},user:{$ref:"#/definitions/User"},country:{$ref:"#/definitions/Country"},nationality:{$ref:"#/definitions/Country"},educationLevel:{$ref:"#/definitions/EducationLevel"},university:{anyOf:[{$ref:"#/definitions/University"},{type:"null"}]},challengeAssignments:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeAssignment"}}}},ApplicationChallenge:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},slug:{type:"string"},version:{type:"string"},trackId:{type:"integer"},tracks:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeTrack"}},langs:{type:"array",enum:["en","es","pt"]},json:{type:"string"},archived:{type:"boolean",default:!1},assignments:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeAssignment"}}}},ApplicationChallengeAssignment:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},application:{$ref:"#/definitions/Application"},challenge:{$ref:"#/definitions/ApplicationChallenge"}}},ApplicationChallengeTrack:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},applicationChallenge:{$ref:"#/definitions/ApplicationChallenge"},track:{$ref:"#/definitions/Track"}}},ActivityLogEntry:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},type:{type:"string",enum:["challenge","application_filter","application_filter_bypass","application_cohort_change","project_assessment","project_assessment_request","project_assessment_assignment"]},data:{type:["number","string","boolean","object","array","null"]},path:{type:"string"},author:{$ref:"#/definitions/User"},user:{$ref:"#/definitions/User"},cohort:{$ref:"#/definitions/Cohort"}}},StudentProject:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},projectSlug:{type:"string"},projectVersion:{type:"string"},cohort:{$ref:"#/definitions/Cohort"},links:{type:"array",items:{$ref:"#/definitions/StudentProjectLink"}},team:{type:"array",items:{$ref:"#/definitions/StudentProjecTeamMember"}}}},StudentProjecTeamMember:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},studentProject:{$ref:"#/definitions/StudentProject"},user:{$ref:"#/definitions/User"}}},StudentProjectLink:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},url:{type:"string"},studentProject:{$ref:"#/definitions/StudentProject"}}},Contract:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},isEmployment:{type:"boolean"},feeAmount:{type:"integer"},hoursPerWeek:{type:"integer"},start:{type:"string",format:"date-time"},end:{type:["string","null"],format:"date-time"},isTrial:{type:"boolean",default:!1},source:{type:["string","null"],enum:["graduate","referral","jazzhr","web","linkedin","other"]},checkPilot:{anyOf:[{$ref:"#/definitions/User"},{type:"null"}]},country:{$ref:"#/definitions/Country"},user:{$ref:"#/definitions/User"},gigs:{type:"array",items:{$ref:"#/definitions/Gig"}}}},Gig:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},role:{type:"string",enum:["bm","pdc","js","ux"]},hoursPerWeek:{type:"integer"},start:{type:"string",format:"date-time"},end:{type:["string","null"],format:"date-time"},cohort:{$ref:"#/definitions/Cohort"},contract:{$ref:"#/definitions/Contract"},user:{$ref:"#/definitions/User"}}},Message:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},key:{type:"string"},from:{type:"string"},to:{type:"string"},transport:{type:"string",enum:["mandrill","slack"]},status:{type:"string",default:"PENDING",enum:["PENDING","QUEUED","ERROR","SENT"]},data:{type:["number","string","boolean","object","array","null"]},taskInfo:{type:["number","string","boolean","object","array","null"]},user:{anyOf:[{$ref:"#/definitions/User"},{type:"null"}]},logs:{type:"array",items:{$ref:"#/definitions/MessageLog"}}}},MessageLog:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},statusText:{type:["string","null"]},message:{$ref:"#/definitions/Message"}}},Industry:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},companies:{type:"array",items:{$ref:"#/definitions/Company"}}}},Company:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},source:{type:"string"},sourceId:{type:"string"},name:{type:"string"},size:{type:["string","null"],enum:["A_2_10","B_11_50","C_51_200","D_201_500","E_501_1000","F_1001_5000","G_5001_10000","H_10001_plus"]},data:{type:["number","string","boolean","object","array","null"]},web:{type:["string","null"]},twitter:{type:["string","null"]},github:{type:["string","null"]},facebook:{type:["string","null"]},country:{anyOf:[{$ref:"#/definitions/Country"},{type:"null"}]},industry:{anyOf:[{$ref:"#/definitions/Industry"},{type:"null"}]},jobs:{type:"array",items:{$ref:"#/definitions/Job"}},categories:{type:"array",enum:["Tech_Consultancy","Digital_Transformation","Agency","Startups","High_tech","Traditional_Consulting"]}}},Job:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},source:{type:"string"},sourceId:{type:"string"},title:{type:"string"},publishedAt:{type:"string",format:"date-time"},modality:{type:"string"},publicUrl:{type:["string","null"]},location:{type:["string","null"]},data:{type:["number","string","boolean","object","array","null"]},description:{type:["string","null"]},descriptionHTML:{type:["string","null"]},functions:{type:["string","null"]},functionsHTML:{type:["string","null"]},seniority:{type:["string","null"]},remote:{type:["boolean","null"]},remoteOption:{type:["string","null"],enum:["remote_for_now","locally_remote","fully_remote","no_remote","mixed"]},lang:{type:["string","null"],enum:["en","es","pt"]},maxSalary:{type:["integer","null"]},minSalary:{type:["integer","null"]},tags:{type:"array",items:{type:"string"}},company:{$ref:"#/definitions/Company"},country:{anyOf:[{$ref:"#/definitions/Country"},{type:"null"}]},reviews:{type:"array",items:{$ref:"#/definitions/JobReview"}},applications:{type:"array",items:{$ref:"#/definitions/JobApplication"}},crawlerQueries:{type:"array",items:{$ref:"#/definitions/JobCrawlerQuery"}},crawlerLocations:{type:"array",items:{$ref:"#/definitions/JobCrawlerLocation"}}}},JobProfileType:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},learningObjectives:{type:["number","string","boolean","object","array","null"]},track:{anyOf:[{$ref:"#/definitions/Track"},{type:"null"}]},reviews:{type:"array",items:{$ref:"#/definitions/JobReviewProfileType"}}}},JobReview:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},isValid:{type:"boolean"},invalidReason:{type:["string","null"],enum:["unrelated","experience","qualifications","other"]},comment:{type:["string","null"]},author:{$ref:"#/definitions/User"},job:{$ref:"#/definitions/Job"},profileTypes:{type:"array",items:{$ref:"#/definitions/JobReviewProfileType"}}}},JobReviewProfileType:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},review:{$ref:"#/definitions/JobReview"},profileType:{$ref:"#/definitions/JobProfileType"}}},JobApplication:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},status:{type:"string",default:"pending",enum:["pending","applied","interview","challenge","followup","hired","not_hired"]},hireDate:{type:["string","null"],format:"date-time"},jobStartDate:{type:["string","null"],format:"date-time"},netSalary:{type:["integer","null"]},grossSalary:{type:["integer","null"]},currency:{type:["string","null"]},job:{$ref:"#/definitions/Job"},user:{$ref:"#/definitions/User"},cohort:{anyOf:[{$ref:"#/definitions/Cohort"},{type:"null"}]}}},CrawlerQuery:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},query:{type:"string"},enabled:{type:"boolean",default:!0},track:{$ref:"#/definitions/Track"},jobs:{type:"array",items:{$ref:"#/definitions/JobCrawlerQuery"}}}},JobCrawlerQuery:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},job:{$ref:"#/definitions/Job"},query:{$ref:"#/definitions/CrawlerQuery"}}},CrawlerLocation:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},enabled:{type:"boolean",default:!0},jobs:{type:"array",items:{$ref:"#/definitions/JobCrawlerLocation"}}}},JobCrawlerLocation:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},job:{$ref:"#/definitions/Job"},location:{$ref:"#/definitions/CrawlerLocation"}}}},type:"object",properties:{country:{$ref:"#/definitions/Country"},currency:{$ref:"#/definitions/Currency"},user:{$ref:"#/definitions/User"},track:{$ref:"#/definitions/Track"},program:{$ref:"#/definitions/Program"},stage:{$ref:"#/definitions/Stage"},cohort:{$ref:"#/definitions/Cohort"},student:{$ref:"#/definitions/Student"},cohortLink:{$ref:"#/definitions/CohortLink"},dropout:{$ref:"#/definitions/Dropout"},iscedLevel:{$ref:"#/definitions/IscedLevel"},educationLevel:{$ref:"#/definitions/EducationLevel"},university:{$ref:"#/definitions/University"},application:{$ref:"#/definitions/Application"},applicationChallenge:{$ref:"#/definitions/ApplicationChallenge"},applicationChallengeAssignment:{$ref:"#/definitions/ApplicationChallengeAssignment"},applicationChallengeTrack:{$ref:"#/definitions/ApplicationChallengeTrack"},activityLogEntry:{$ref:"#/definitions/ActivityLogEntry"},studentProject:{$ref:"#/definitions/StudentProject"},studentProjecTeamMember:{$ref:"#/definitions/StudentProjecTeamMember"},studentProjectLink:{$ref:"#/definitions/StudentProjectLink"},contract:{$ref:"#/definitions/Contract"},gig:{$ref:"#/definitions/Gig"},message:{$ref:"#/definitions/Message"},messageLog:{$ref:"#/definitions/MessageLog"},industry:{$ref:"#/definitions/Industry"},company:{$ref:"#/definitions/Company"},job:{$ref:"#/definitions/Job"},jobProfileType:{$ref:"#/definitions/JobProfileType"},jobReview:{$ref:"#/definitions/JobReview"},jobReviewProfileType:{$ref:"#/definitions/JobReviewProfileType"},jobApplication:{$ref:"#/definitions/JobApplication"},crawlerQuery:{$ref:"#/definitions/CrawlerQuery"},jobCrawlerQuery:{$ref:"#/definitions/JobCrawlerQuery"},crawlerLocation:{$ref:"#/definitions/CrawlerLocation"},jobCrawlerLocation:{$ref:"#/definitions/JobCrawlerLocation"}}},Ln=24*(60*60*1e3),Go={Country:{primaryKey:"code",plural:"countries",searchProps:["code","name","timeZone"],defaultProps:["code","name","timeZone","currency"],getOptionLabel:({code:n,name:e})=>`${n} / ${e}`},ActivityLogEntry:{plural:"activityLog"},User:{primaryKey:"uid",inputProps:["firstName","lastName","email","password","lang","identifiesAsFemale","dateOfBirth","country","identificationNumber","mobileNumber","github","linkedin","bio","role","signupCohort","disabled","referralSource"],searchProps:["firstName","lastName","email"],getOptionLabel:({firstName:n,lastName:e,email:t})=>`${n} ${e} (${t})`,properties:{email:{inputType:"email"},lastName:{isRequired:!0},mobileNumber:{inputType:"phone"},bio:{inputType:"textarea"}},parse:n=>{const e=n.github?`https://github.com/${n.github}.png?size=`:`https://www.gravatar.com/avatar/${Uo(n.email)}?s=`;return{...n,fullName:`${n.firstName||""}${n.lastName?` ${n.lastName}`:""}`,avatar:t=>`${e}${t}`,isStaff:["staff","manager","finance","admin"].includes(n.role),isManager:["manager","finance","admin"].includes(n.role),isFinance:["finance","admin"].includes(n.role),isAdmin:n.role==="admin"}}},Track:{searchProps:["name"]},Program:{searchProps:["name"]},Stage:{searchProps:["name"]},Cohort:{inputProps:["program","stage","lang","name","start","end","timeZone","startTime","endTime","vacancies","admissionStart","admissionEnd","placementStart","admissionCountries"],searchProps:["name"],getOptionLabel:({id:n,name:e,stage:t})=>`${e}${t?` - ${t.name}`:""} (id: ${n})`,properties:{},parse:n=>{var s,o;const e=Date.now();let t;if(n.placementStart){const c=n.placementDuration||270;new Date(+n.placementStart+c*24*60*60*1e3)<e?t="placement_ended":n.placementStart<e&&(t="placement_started")}!t&&n.end<e&&(t="ended"),!t&&n.start<e&&(t="started");const r=n.admissionEnd?+n.admissionEnd+Ln:!1;!t&&r&&r<e&&(t="admission_ended"),!t&&n.admissionStart&&n.admissionStart<e&&(t="admission_started"),!t&&n.admissionStart&&n.admissionEnd&&(t="planned"),t||(t="draft");const i=n.start>e&&n.vacancies?n.vacancies:((s=n._count)==null?void 0:s.students)||((o=n.students)==null?void 0:o.length)||0;return{...n,status:t,size:i}}},Student:{inputProps:["cohort","user"],searchProps:["user.firstName","user.lastName","user.email"],defaultProps:["id","cohort","user"],getOptionLabel:({user:n,cohort:e})=>`${n==null?void 0:n.firstName} ${(n==null?void 0:n.lastName)||""} (${e==null?void 0:e.name})`},Dropout:{inputProps:["cohort","user","date","reason","reasonDetail","lastProject","completedProjects","notes","staffSad","covidRelated"],searchProps:["user.uid","user.firstName","user.lastName","user.email","cohort.name"]},Contract:{inputProps:["user","country","isEmployment","feeAmount","hoursPerWeek","start","end","isTrial","checkPilot","source"],searchProps:["user.firstName","user.lastName","user.email"],getOptionLabel:({id:n,user:e})=>`${e==null?void 0:e.firstName} (id: ${n})`},Gig:{inputProps:["cohort","user","contract","role","hoursPerWeek","start","end"]},Application:{inputProps:["user","cohort","dateOfBirth","country","locality","nationality","isAllowedToWork","hasValidIdDocument","householdSize","children","householdIncome","racialIdentity","educationLevel","schoolType","educationSubject","university","isStudying","englishLevel","workStatus","isLookingForWork","monthsLookingForWork","monthsUnemployed","workRole","freelance","workFormal","workIncome","isReady","bypassFilters"],properties:{locality:{isRequired:!0},englishLevel:{isRequired:!0},isReady:{isRequired:!1},bypassFilters:{isRequired:!1}},parse:n=>{var i,s,o;const e=typeof n.hasFailedFilters=="boolean"?n.hasFailedFilters:typeof((i=n.failedFilters)==null?void 0:i.length)=="number"?n.failedFilters.length>0:void 0;if(!((s=n.cohort)!=null&&s.admissionEnd)||typeof e>"u")return n;const t=Date.now();let r;return n.isReady?r="ready":e&&!n.bypassFilters?r="rejected":n.createdAt<t-90*Ln?r="expired":((o=n.cohort)==null?void 0:o.status)!=="admission_started"?r="admission_ended":r="active",{...n,status:r}}},IscedLevel:{parse:n=>{const e=Math.floor(n.id/10);return{...n,level:e,completed:e*10<n.id}}},EducationLevel:{searchProps:["label"]},University:{plural:"universities",searchProps:["name"]},Company:{plural:"companies"},CrawlerQuery:{plural:"crawlerQueries"},JobCrawlerQuery:{plural:"jobCrawlerQueries"}},Jo=(n,e)=>({...zo(n,e,{...Dn,definitions:qo(Dn,Go)}),gcpLog:{getEntries:async t=>await gt(n,e.authUser)(`/gcp-logs?q=${JSON.stringify(t)}`)}}),Ko=(n,e)=>{const t=gt(n,e.authUser);return{project:{findMany:(r={})=>t(`/projects?q=${JSON.stringify(r)}`),findBySlug:(r,i={})=>t(`/projects/${r}?q=${JSON.stringify(i)}`)},topic:{findMany:(r={})=>t(`/topics?q=${JSON.stringify(r)}`),findBySlug:(r,i={})=>t(`/topics/${r}?q=${JSON.stringify(i)}`)},learningObjective:{findMany:(r={})=>t(`/learning-objectives?q=${JSON.stringify(r)}`)}}},Ve=n=>n>9?`${n}`:`0${n}`,$n=n=>`${Ve(n.getUTCDate())}/${Ve(n.getUTCMonth()+1)}/${n.getUTCFullYear()}`,Mn=n=>`${Ve(n.getUTCHours())}:${Ve(n.getUTCMinutes())}:${n.getUTCSeconds()} UTC`,Yo=n=>`${$n(n)} ${Mn(n)}`,Qo={es:"es-ES",pt:"pt-BR"},Xo=(n,e="es",t=!1)=>new Intl.DateTimeFormat(Qo[e],{...t&&{year:"numeric"},month:"long",day:"numeric",timeZone:"UTC"}).format(new Date(n)),Zo=(n,e)=>{let t=e.getFullYear()-n.getFullYear();const r=e.getMonth()-n.getMonth();return(r<0||r===0&&e.getDate()<n.getDate())&&t--,t},ea=(n,e,t)=>new Intl.NumberFormat(`${n}-${e}`,{currency:t}),ta=(n,e,t,r)=>ea(e,t,r).format(n),na=n=>parseInt(n.replace(/[,\.]/g,""),10),ra=n=>{try{return JSON.parse(window.localStorage.getItem(n))}catch{return null}},ia=({firebaseApiKey:n="AIzaSyAXbaEbpq8NOfn0r8mIrcoHvoGRkJThwdc",firebaseProject:e="laboratoria-la",coreApiUrl:t="https://us-central1-outpost-272720.cloudfunctions.net/core-api"}={})=>{const r=Ot({apiKey:n,authDomain:`${e}.firebaseapp.com`,databaseURL:`https://${e}.firebaseio.com`,projectId:e}),i=Do(r),s={authUser:void 0,user:void 0},o=Jo(t,s);return{...Ko(t,s),...o,auth:{onChange:u=>vs(i,y=>{if(!y)return Object.assign(s,{authUser:null,user:null}),u(s);Object.assign(s,{authUser:y}),o.user.findById(y.uid).then(b=>{Object.assign(s,{user:b}),u(s)}).catch(b=>{console.error(b),Object.assign(s,{authUser:null,user:null}),u(s)})}),signIn:(u,y)=>ms(i,u,y),signOut:()=>bs(i),sendPasswordResetEmail:u=>gs(i,u)},firebaseApp:r}};k.createApp=ia,k.formatCurrency=ta,k.formatDate=$n,k.formatDateTime=Yo,k.formatMonth=Xo,k.formatTime=Mn,k.getAgeAt=Zo,k.loadFromLocalStorage=ra,k.parseCurrency=na,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laboratoria/sdk-js",
3
- "version": "7.2.0-beta.0",
3
+ "version": "7.2.0-beta.1",
4
4
  "description": "Laboratoria JavaScript (browser) SDK",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -34,4 +34,4 @@
34
34
  "engines": {
35
35
  "node": ">=18.0.0"
36
36
  }
37
- }
37
+ }