1import{d as l}from"../dayjs.min-CtHDA5l_6o8S.js";import{r as v,w as g}from"../weekday-GObSkmvGM6m_.js";import{d as y}from"../duration-BK0_PWQCq46f.js";import{i as w}from"../init-CoEtLPpOwRfP.js";import{M as f}from"../meilisearch_chunk-Bu1_DSe1XTvt.js";import{A as P}from"../markdown-directive-D2LLUtPlajWi.js";import S from"./video-player-entry-BDUWL9w0m0_X.js";import{c as b}from"../collapse-content-DIRgaQu22z9L.js";import{c as _}from"../countries-DNhVFLzlUdPm.js";import{x,u as C,T as I,K as F,U as L,V as $,Q as k,M as j,W as q,L as E,X as T}from"../common-Dr4WdSIEHEUW.js";import{a as M}from"../axios_chunk-CLxAxl5Wb_6r.js";import{s as U}from"../activestorage.esm-BYWRMjOUGt5q.js";import"../setup-hotwire-turbo-DnXZijdOj2Ph.js";import"../es-qoWiLYMVqzkF.js";import"../sentry-initializer-BUsTl4EQC4qv.js";import{A as D}from"../ActivityModule-x-Ze_blcHvzd.js";import{s as O}from"../focusedTimeout-CS-8rFJgQ9Lb.js";import{c as A}from"../click-binder-8TaYJqLn7HLX.js";import{a as R,c as V}from"../activityTrack-DnxYyEuigbls.js";import"../shared-packs-E_IN3P_mQBx7.js";import"../menu-packs-BPYn-3tP3ekF.js";/* empty css */import"../module.esm-CHQVXANyOE5s.js";import"../imageLazzyLoad-DUTK6bMEzBRB.js";import"../log-COEE0D_sNqpN.js";import"../preload-helper-ICK8sbMsE0SP.js";import"../auth-BDM2NH9H1bVF.js";import"../errors-DH6DCUGuIYZQ.js";import"./SimplePopoverComponent-C3HSN7ETujYi.js";import"../BaseComponent-D2B5BwFWx57C.js";import"./SimpleDropdownComponent-DnwI8yE5sExY.js";import"../index-DkIJ1XdCcxhx.js";import"../exports-CizwVqZfXGGG.js";import"../my-activity-CVkS7iETQOnD.js";import"../activities-G-50OplOoF9z.js";import"../pageDuration-DvxA7ZKxDZ2I.js";import"../consumer-DMD7T20Zgzl0.js";import"../navbar-background-1WO8k_yTmhFL.js";const H=(s,a,h)=>({query:"",startWidth:"",availableLetters:[],subjects:[],alphabet:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],expanded:!1,loading:!0,searchIndex:void 0,onClickLetter(r){this.startWidth=r,this.query="",this.search()},search(){if(!this.searchIndex)return;this.loading=!0,this.expanded=!1,this.query=this.query.trim();let r=`university.id = ${s}`;this.startWidth!==""&&(r+=` AND subject.starts_with = ${this.startWidth}`),this.searchIndex.search(this.query,{filter:r,limit:24}).then(c=>{this.subjects=c.hits,this.loading=!1})},load(){this.searchIndex&&this.searchIndex.search("",{filter:`university.id= ${s}`,facets:["subject.starts_with"],limit:24}).then(r=>{this.subjects=r.hits,this.loading=!1,this.availableLetters=Object.keys(r.facetDistribution["subject.starts_with"])})},init(){if(!a||!h)return;const r=new f({host:a,apiKey:h});this.searchIndex=r.index("CareerSubject"),this.load(),this.$watch("query",c=>{c!==""&&(this.startWidth="")})}}),W=(s,a,h)=>({items:s,selected:0,loading:!0,initialized:!1,loadCareers(r){let c;h?c=`&faculty_id=${this.items[r].id}`:c=`&study_area=${this.items[r].id}`,fetch(`/api/partner_university_careers?university_id=${a}${c}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(u=>u.json()).then(u=>{this.items[r].partner_university_careers=u,this.items[r].loaded=!0,this.loading=!1})},inSetIndex(r){this.loading||(this.selected=r,this.items[r].loaded||(this.loading=!0,this.loadCareers(r)))},init(){this.initialized=!0,this.inSetIndex=this.inSetIndex.bind(this),this.loadCareers(0)}});function z(){return{onBeforeFrameRender(s){const a=s.target.dataset.handler;if(!a||P._data[a].loaded)return;s.preventDefault(),document.querySelector(`[x-data^="${a}"]`)._ax_loaded.then(()=>s.detail.resume())},trackInteraction(s){window.ActivityModule.activityTrack("Home Interaction",{...s,"Device User":window.detectDevice()})}}}const B=[{value:"in_person",name:"Presencial"},{value:"virtual",name:"Virtual"},{value:"hybrid",name:"HÃbrido"}],G=(s,a=[])=>a.length===0?s:s.map(h=>Object.assign(h,{selected:a.includes(h.id.toString())})),N=(s=[],a,h,r,c,u,m)=>({q:r.q||"",mode:r.mode||"",location:r.location?.split(",")?.filter(t=>t)||[],open:!1,modes:B,country:null,defaultStates:[],listStates:[],statesFilter:[],favorites:[],duration:parseInt(r.duration||"0"),durations:[{name:"1 a 3 años",value:1},{name:"3 a 5 años",value:2},{name:"Más de 5 años",value:3}],areas:G(s,r.areas||[]),careersCount:"00",searchIndex:void 0,favoritesIndex:void 0,careers:[],maxPrice:r.max_price||5e3,minPrice:r.min_price||0,university:{id:r.university_id||0,name:r.university_name||""},facets:{},page:1,perPage:10,disabled:!1,totalPages:0,loading:!0,mounted:!1,favoritesPopoverAvailable:m,closeFavoritesPopover(){this.favoritesPopoverAvailable=!1},markCoachmarkAsSeen(){m&&fetch("/api/partners/coachmarks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:"favorites"})}).catch(t=>{console.error("Error:",t)})},toggleFavorites(t){const i=document.getElementById("total-favorites-target"),e=parseInt(t.id);fetch("/api/partner_university_careers/favorite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({partner_university_career_id:e})}).then(n=>n.json()).then(n=>{this.favorites.find(o=>o.id===e)?(this.favorites=this.favorites.map(o=>(o.id===e&&(o.favorite=n.saved),o)),i&&(i.textContent=parseInt(i.textContent)+(n.saved?1:-1))):(i&&(i.textContent=parseInt(i.textContent)+1),this.favorites.push({id:e,favorite:n.saved}))})},addLocation(t){this.statesFilter=[],this.location.push(t),this.listStates.includes(t)||this.listStates.push(t),this.$refs.locationInput.value=""},numberToCurrency(t){return x(t)},filterLocationInput(t){const i=t.target.value;if(i==="")this.statesFilter=[];else{const e=this.country.states.map(n=>n.name);this.statesFilter=e.filter(n=>n.toLowerCase().includes(i.toLowerCase())).sort((n,o)=>{const d=p=>p.toLowerCase().startsWith(i.toLowerCase());return d(o)-d(n)})}},parameterizeLink(t){return t.replace(/[^a-zA-Z0-9/-]/g,"-").replace(/-+/g,"-").toLowerCase()},careerLink(t){return this.parameterizeLink(`${t.name}-${t.public_id}`)},universityLink(t){return this.parameterizeLink(`${t.country}
1/${t.name_link}-${t.public_id}`)},totalFilters(){const t=[this.mode,this.duration].filter(d=>d).length,i=this.minPrice>0||this.maxPrice<5e3?1:0,e=this.university.id>0?1:0,n=this.location?.length||0,o=this.areas.filter(d=>d.selected).length;return t+n+o+i+e},clearFilters(){this.mode="",this.location=[],this.duration=0,this.minPrice=0,this.maxPrice=5e3,this.university={id:0,name:""},this.areas=this.areas.map(t=>Object.assign(t,{selected:!1})),this.page=1,this.updateURLSearchParams(),this.search()},buildFilters(t=!0,i=!0){const e=[];this.mode&&t&&e.push(`mode = ${this.mode}`),this.minPrice>0&&(e.push(`simulation_amount >= ${this.minPrice}`),e.push("university.type_of_institution != 'public'")),this.maxPrice<5e3&&e.push(`simulation_amount <= ${this.maxPrice}`),this.university.id>0&&e.push(`university.id = ${this.university.id}`),this.location?.length>0&&e.push(`cities IN ['${this.location.join("','")}']`);const n=this.areas.filter(o=>o.selected).map(o=>o.id);if(n.length&&e.push(`study_area_id IN [${n.join(",")}]`),this.duration&&i)switch(this.duration){case 1:e.push("duration <= 3");break;case 2:e.push("duration >= 3 AND duration <= 5");break;case 3:e.push("duration > 5")}return e},toggleMode(t){this.mode=this.mode===t?"":t},toggleLocation(t){this.location.includes(t)?(this.location=this.location.filter(i=>i!==t),this.defaultStates.includes(t)||(this.listStates=this.listStates.filter(i=>i!==t))):this.location.push(t)},toggleDuration(t){this.duration=this.duration===t?0:t},removeRangePriceFilter(){this.maxPrice=5e3,this.minPrice=0},removeUniversityFilter(){this.university={id:0,name:""}},facetCareer(t){return`${t||0} ${(t||0)>1?"carreras":"carrera"}`},facetToDuration(t){return this.facetCareer(this.facetDurationValue(t))},facetDurationValue(t){if(Object.keys(this.facets?.duration||{}).length<=0)return 0;if(t===1)return this.facets.duration[1];if(t===2)return this.facets.duration[5];if(t===3){const i=["1","5"];return Object.entries(this.facets.duration).filter(([n])=>!i.includes(n)).reduce((n,[,o])=>n+o,0)}},onSearch(t){t.preventDefault(),t.stopPropagation()},updateURLSearchParams(){const t=new URLSearchParams;this.q&&t.append("q",this.q),this.mode&&t.append("mode",this.mode),this.location?.length>0&&t.append("location",this.location),this.duration&&t.append("duration",this.duration.toString()),this.maxPrice!==5e3&&t.append("max_price",this.maxPrice.toString()),this.minPrice>0&&t.append("min_price",this.minPrice.toString()),this.university.id>0&&t.append("university_id",this.university.id.toString()),this.university.name?.length>0&&t.append("university_name",encodeURIComponent(this.university.name.toString())),this.areas.filter(e=>e.selected).forEach(e=>t.append("areas[]",e.id));let i=window.location.pathname;t.toString()&&(i+=`?${t.toString()}`),window.history.replaceState({},"",i)},search(t=!1){if(this.fetching&&this.mounted||this.disabled)return;t&&(this.q=t),this.loading=!0;const i={offset:this.perPage*(this.page-1),limit:this.perPage,filter:this.buildFilters()};this.q===""&&(i.sort=["career.normalized_name:asc","university.normalized_name_and_country:asc"]),(this.maxPrice!==5e3||this.minPrice>0)&&(i.sort=["simulation_amount:asc"]),this.searchIndex.search(this.q,i).then(e=>{this.loading=!1,this.careers=e.hits,this.careersCount=`${e.estimatedTotalHits<10?"0":""}${e.estimatedTotalHits}`,this.totalPages=Math.ceil(e.estimatedTotalHits/this.perPage)}),this.searchIndex.search(this.q,{facets:["mode"],filter:this.buildFilters(!1,!0)}).then(e=>{this.facets={...this.facets,...e.facetDistribution}}),this.searchIndex.search(this.q,{facets:["duration"],filter:this.buildFilters(!0,!1)}).then(e=>{this.facets={...this.facets,...e.facetDistribution}})},facetsEmpty(){return Object.keys(this.facets).length===0},searchByCareerForSuggestions(){if(this.q==="")return;const t={limit:7};this.searchIndex.search(this.q,t).then(i=>{this.$dispatch("navbarsuggestions",{suggestions:i.hits.map(e=>e.career.name)})})},setPage(t){t<1||t>this.totalPages||t!==this.page&&(this.page=t,this.updateURLSearchParams(),this.search(),window.scrollTo({top:0,behavior:"smooth"}))}
1,loadMore(){this.disabled=!0;const t={offset:this.perPage*this.page,limit:this.perPage,filter:this.buildFilters()};this.q===""&&(t.sort=["career.normalized_name:asc","university.normalized_name_and_country:asc"]),this.searchIndex.search(this.q,t).then(i=>{this.page+=1,this.loading=!1,this.disabled=!1;const e=this.careers.concat(i.hits);this.careers=e})},searchSuggestionSelected(t){this.page=1,this.updateURLSearchParams(),this.search(t)},searchFieldListener(){let t=null;const i=document.getElementById("navbar-search-field");i&&i.addEventListener("input",n=>{t&&clearTimeout(t),this.q=i.value,n.key!=="Enter"&&this.searchByCareerForSuggestions(),t=setTimeout(()=>{this.page=1,this.updateURLSearchParams(),this.search()},300)});const e=document.getElementById("navbar-search-clear");e&&e.addEventListener("click",()=>{this.q="",this.page=1,this.updateURLSearchParams(),this.search()})},changeFilter(){this.page=1,this.updateURLSearchParams(),this.search()},findCountry(t){return _.find(i=>i.name===t)},get modeFilterAvailable(){return this.modes.some(t=>this.facets?.mode?.[t.value]>0)},get durationFilterAvailable(){return this.durations.some(t=>this.facetDurationValue(t.value)>0)},isFavorite(t){return this.favorites.some(i=>i.id===t.id&&i.favorite)},fetchFavorites(){M.get("/api/partner_university_careers/favorites",{headers:{"Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"}}).then(t=>{this.favorites=t.data}).catch(t=>{console.error(t)})},init(){if(this.country=this.findCountry(c),this.country){this.defaultStates=[this.country.capital,...this.country.states.filter(e=>e.name!==this.country.capital).slice(0,2).map(e=>e.name)];const i=(r.location?.split(",")?.filter(e=>e)||[]).filter(e=>!this.defaultStates.includes(e));this.listStates=[...this.defaultStates,...i]}if(this.search=this.search.bind(this),this.loadMore=this.loadMore.bind(this),this.changeFilter=this.changeFilter.bind(this),!a||!h)return;const t=new f({host:a,apiKey:h});this.searchIndex=t.index("PartnerUniversityCareer"),this.favoritesIndex=t.index("PartnerUniversityCareerFavorite"),this.search(),this.mounted=!0,this.$watch("mode",this.changeFilter),this.$watch("location",this.changeFilter),this.$watch("areas",this.changeFilter),this.$watch("duration",this.changeFilter),this.$watch("maxPrice",this.changeFilter),this.$watch("minPrice",this.changeFilter),this.$watch("university",this.changeFilter),this.$watch("open",()=>{this.open?document.body.classList.add("overflow-hidden"):document.body.classList.remove("overflow-hidden")}),this.searchFieldListener(),this.markCoachmarkAsSeen(),this.fetchFavorites()}}),K=()=>({step:1,areas:[],removeUIOption(){navigator.sendBeacon("/api/users/options/remove_ui_option/partner_ob")},onExit(){this.removeUIOption(),window.location.href="/home"},onClick(s){const a=this.areas.findIndex(h=>h===s);if(a>=0){this.areas.splice(a,1);return}this.areas.push(s)},onGoNext(){const s=new URLSearchParams;this.areas.forEach(a=>s.append("areas[]",a)),this.removeUIOption(),window.location.href=`/partners/universities?${s.toString()}`}});"serviceWorker"in navigator&&navigator.serviceWorker.getRegistrations().then(s=>{s.forEach(a=>{a.active&&a.active.scriptURL.endsWith("/sw.js")&&a.unregister()})});l.extend(v);l.extend(y);l.extend(g);l.locale("es");U();window.dayjs=l;window.setFocusedTimeout=O;window.userProfileIMGError=C;window.coverIMGError=I;window.countDown=F;window.selectSearch=L;window.focusAndOpenKeyboard=$;window.nFormatter=k;window.clickInterestLanding=R;window.clickCardTrack=V;window.hideShowPopupConfirmEmail=j;window.closeBySession=A;window.configMeilisearchClient=q;window.ActivityModule=D;window.fixCoverIMG=E;window.setViewHeight=T;window.setViewHeight();window.addEventListener("resize",()=>{window.setViewHeight()});w(s=>{s.data("universityProfile",H),s.data("partnerCareers",W),s.data("indexHome",z),s.data("institutionsVideoPlayer",S),s.data("collapseContent",b),s.data("partnerSearch",N),s.data("partnerEnroll",K)});
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.