1"use strict";(self.webpackChunkgatsby_starter_default=self.webpackChunkgatsby_starter_default||[]).push([[785],{691:function(e,t,o){var i=o(6540),a=o(7581);const n="undefined"!=typeof window?(0,i.lazy)(()=>o.e(562).then(o.bind(o,2893)).then(e=>({default:e.ReactP5Wrapper}))):null,l=a.default.div.withConfig({displayName:"P5Sketch__SketchContainer",componentId:"sc-otc9do-0"})(["width:100%;position:relative;display:flex;justify-content:center;align-items:center;background-color:",";border-radius:",";overflow:hidden;canvas{display:block;max-width:100%;height:auto;}"],e=>e.backgroundColor||"transparent",e=>e.theme.radii.lg),r=a.default.div.withConfig({displayName:"P5Sketch__LoadingContainer",componentId:"sc-otc9do-1"})(["width:100%;min-height:",";display:flex;justify-content:center;align-items:center;background-color:var(--color-surface);border-radius:",";color:var(--color-text-secondary);font-size:",";"],e=>e.minHeight||"400px",e=>e.theme.radii.lg,e=>e.theme.typography.fontSizes.lg),s=(0,a.default)(r).withConfig({displayName:"P5Sketch__ErrorContainer",componentId:"sc-otc9do-2"})(["background-color:rgba(239,68,68,0.1);border:1px solid ",";color:",";"],e=>e.theme.colors.error,e=>e.theme.colors.error);t.A=function(e){let{sketch:t,minHeight:o="400px",backgroundColor:a,...c}=e;return"undefined"==typeof window?i.createElement(r,{minHeight:o},i.createElement("span",null,"Loading visualization...")):n?i.createElement(l,{backgroundColor:a},i.createElement(i.Suspense,{fallback:i.createElement(r,{minHeight:o},i.createElement("span",null,"Loading visualization..."))},i.createElement(n,Object.assign({sketch:t},c)))):i.createElement(s,{minHeight:o},i.createElement("span",null,"Error: Unable to load P5 visualization"))}},3997:function(e,t,o){o.r(t),o.d(t,{default:function(){return w}});var i=o(6540),a=o(4755),n=o(7581),l=o(9318),r=o(691);const s=[{name:"Aguascalientes",pop:1.4,lat:22,lon:-102.3,eci:.8,informality:40},{name:"Baja California",pop:3.7,lat:30.5,lon:-115.5,eci:.5,informality:35},{name:"Baja California Sur",pop:.8,lat:26,lon:-112,eci:-.2,informality:50},{name:"Campeche",pop:1,lat:19,lon:-90.5,eci:-.9,informality:65},{name:"Chiapas",pop:5.5,lat:16.5,lon:-92.5,eci:-1.2,informality:70},{name:"Chihuahua",pop:3.8,lat:28.5,lon:-106,eci:.6,informality:40},{name:"Coahuila",pop:3.1,lat:27,lon:-102,eci:.9,informality:38},{name:"Colima",pop:.8,lat:19.15,lon:-103.9,eci:-.1,informality:55},{name:"Mexico City",pop:9.2,lat:19.43,lon:-99.13,eci:1.5,informality:30},{name:"Durango",pop:1.8,lat:24.5,lon:-104.5,eci:.1,informality:52},{name:"Guanajuato",pop:6.2,lat:21,lon:-101,eci:.7,informality:45},{name:"Guerrero",pop:3.5,lat:17.7,lon:-99.5,eci:-1,informality:68},{name:"Hidalgo",pop:3.1,lat:20.5,lon:-99,eci:0,informality:58},{name:"Jalisco",pop:8.3,lat:20.5,lon:-103.75,eci:1,informality:42},{name:"México State",pop:17,lat:19.35,lon:-99.55,eci:1.2,informality:40},{name:"Michoacán",pop:4.7,lat:19.25,lon:-101.75,eci:-.3,informality:60},{name:"Morelos",pop:2,lat:18.75,lon:-99,eci:.2,informality:50},{name:"Nayarit",pop:1.2,lat:22,lon:-105,eci:-.5,informality:62},{name:"Nuevo León",pop:5.8,lat:25.5,lon:-100,eci:1.3,informality:32},{name:"Oaxaca",pop:4.1,lat:17,lon:-96.5,eci:-1.1,informality:72},{name:"Puebla",pop:6.6,lat:19,lon:-98,eci:.4,informality:55},{name:"Querétaro",pop:2.4,lat:20.75,lon:-100,eci:1.1,informality:37},{name:"Quintana Roo",pop:1.9,lat:19.75,lon:-88,eci:-.4,informality:48},{name:"San Luis PotosÃ",pop:2.8,lat:22.5,lon:-100.5,eci:.3,informality:50},{name:"Sinaloa",pop:3,lat:25,lon:-107.5,eci:0,informality:53},{name:"Sonora",pop:3,lat:29.5,lon:-110,eci:.4,informality:43},{name:"Tabasco",pop:2.4,lat:18,lon:-93,eci:-.8,informality:67},{name:"Tamaulipas",pop:3.5,lat:24,lon:-98.5,eci:.2,informality:47},{name:"Tlaxcala",pop:1.4,lat:19.35,lon:-98.1,eci:-.2,informality:59},{name:"Veracruz",pop:8.1,lat:19.5,lon:-96.75,eci:-.6,informality:63},{name:"Yucatán",pop:2.3,lat:20.75,lon:-89,eci:-.7,informality:57},{name:"Zacatecas",pop:1.6,lat:23.5,lon:-103,eci:-.1,informality:56}];function c(e){let t=[],o=[];let i,a,n,l,r,c,p,m,d,h,f,u,y,g,x=null;let b,w,k,v,S,C,E;function _(e,t,o){return null==t?1:1/(1+Math.exp(-o*(e-t)))}let z=function(){function t(t,o,i,a,n,l){this.pos=e.createVector(t,o),this.vel=e.createVector(i-t,a-o),this.vel.normalize(),this.vel.mult(e.random(.5,1.5)*n),this.endPos=e.createVector(i,a),this.lifespan=l,this.originalLifespan=l,this.alpha=255,this.size=e.random(2,4),this.color=e.lerpColor(k,v,e.random(1))}var o=t.prototype;return o.update=function(){this.pos.add(this.vel),this.lifespan--,this.alpha=e.map(this.lifespan,0,this.originalLifespan,0,200),e.constructor.Vector.dist(this.pos,this.endPos)<2*this.vel.mag()&&(this.lifespan=0)},o.isDead=function(){return this.lifespan<=0},o.display=function(){e.noStroke(),e.fill(e.red(this.color),e.green(this.color),e.blue(this.color),this.alpha),e.ellipse(this.pos.x,this.pos.y,this.size,this.size)},t}();function I(){t=[];for(let o of s){let i=e.map(o.lon,-118.5,-86.5,70,y-70),a=e.map(o.lat,32.8,14.5,70,g-70),n=e.map(o.pop,.5,17,6,22);t.push({...o,x:i,y:a,baseSize:n,displayName:"México State"===o.name?"Edo. Mex.":"Mexico City"===o.name?"CDMX":o.name})}}function j(){h&&h.hide(),f&&f.hide(),m&&m.hide(),u&&u.hide(),d&&d.hide()}function N(){x&&(h.html(`Editing: ${x.displayName}`),m.value(x.eci),d.value(x.informality),h.show(),f.show(),m.show(),u.show(),d.show())}e.setup=()=>{y=e.min(.95*e.windowWidth,1200),g=.6*y,g>.85*e.windowHeight&&(g=.85*e.windowHeight,y=g/.6),e.createCanvas(y,g),b=e.color(10,20,40),w=e.color(200,220,255,180),k=e.color(255,100,100,180),v=e.color(255,200,100,180),S=e.color(100,150,255,50),C=e.color(230,240,255),E=e.color(255,255,0),I();let t=20,o=130,s=22,x=20;i=e.createSlider(-.1,0,-.005,.001),i.position(170,x),i.style("width",o+"px"),x+=s,a=e.createSlider(0,2,.85,.01),a.position(170,x),a.style("width",o+"px"),x+=s,n=e.createSlider(-10,10,-6.5,.01),n.position(170,x),n.style("width",o+"px"),x+=s;let _=e.sqrt(y*y+g*g);l=e.createSlider(0,_/2,_/4,1),l.position(170,x),l.style("width",o+"px"),x+=s,r=e.createSlider(.001,.1,.06,.001),r.position(170,x),r.style("width",o+"px"),x+=s,c=e.createCheckbox("Use Transition Logic",!0),c.position(t,x),c.style("color",C.toString()),x+=s,p=e.createCheckbox("Show State Names",!1),p.position(t,x),p.style("color",C.toString()),x+=32,h=e.createP(""),h.position(t,x),h.style("color",C.toString()),h.style("font-weight","bold"),x+=27,f=e.createP("State ECI:"),f.position(t,x),f.style("color",C.toString()),m=e.createSlider(-2,2,0,.01),m.position(140,x),m.style("width",o+"px"),x+=s,u=e.createP("State Informality (%):"),u.position(t,x),u.style("color",C.toString()),d=e.createSlider(0,100,50,1),d.position(140,x),d.style("width",o+"px"),j()},e.draw=()=>
1{if(e.background(b),x&&m&&"none"!==m.elt.style.display){let e=m.value(),o=d.value(),i=t.find(e=>e.name===x.name);i&&(i.eci=e,i.informality=o),f.html("State ECI: "+e.toFixed(2)),u.html("State Informality (%): "+o.toFixed(0))}let s={beta_distance:i.value(),beta_eci:a.value(),beta_informality:n.value(),threshold:l.value(),k_transition:r.value(),transition:c.checked()};!function(t){e.fill(C),e.noStroke(),e.textSize(11),e.textAlign(e.LEFT,e.CENTER);let o=20,i=20;e.text("β_dist:",o,i+8),e.text(t.beta_distance.toFixed(3),310,i+8),i+=22,e.text("β_ECI:",o,i+8),e.text(t.beta_eci.toFixed(2),310,i+8),i+=22,e.text("β_Informality:",o,i+8),e.text(t.beta_informality.toFixed(2),310,i+8),i+=22,e.text("Threshold (dist):",o,i+8),e.text(t.threshold.toFixed(1),310,i+8),i+=22,e.text("k_transition:",o,i+8),e.text(t.k_transition.toFixed(3),310,i+8)}(s),e.textSize(16),e.textAlign(e.CENTER,e.CENTER),e.fill(C),e.text("WorkReach Mobility Model\n(Mexico)",y/2,70/3);let h=function(t,o){const i=t.length;let a=Array(i).fill(null).map(()=>Array(i).fill(0)),n=Array(i).fill(null).map(()=>Array(i).fill(0));for(let s=0;s<i;s++)for(let o=0;o<i;o++)s!==o?(n[s][o]=e.dist(t[s].x,t[s].y,t[o].x,t[o].y),n[s][o]<1&&(n[s][o]=1)):n[s][o]=0;for(let e=0;e<i;e++)for(let l=0;l<i;l++){const i=n[e][l],r=t[l].eci,s=t[e].informality/100;let c;if(o.transition&&null!==o.threshold){const e=_(i,o.threshold,o.k_transition);c=o.beta_distance*i+e*(o.beta_eci*r)+e*(o.beta_informality*s)}else c=o.beta_distance*i+o.beta_eci*r+o.beta_informality*s;a[e][l]=c}let l=Array(i).fill(null).map(()=>Array(i).fill(0));for(let e=0;e<i;e++){let t=-1/0;for(let l=0;l<i;l++)a[e][l]>t&&(t=a[e][l]);let o=0,n=Array(i).fill(0);for(let l=0;l<i;l++)n[l]=Math.exp(a[e][l]-t),o+=n[l];if(0===o)for(let a=0;a<i;a++)l[e][a]=0;else for(let a=0;a<i;a++)l[e][a]=n[a]/o}for(let e=0;e<i;e++)l[e][e]=0;for(let e=0;e<i;e++){let t=0;for(let o=0;o<i;o++)t+=l[e][o];if(t>1e-10)for(let o=0;o<i;o++)l[e][o]/=t;else for(let o=0;o<i;o++)l[e][o]=0}let r=[];for(let e=0;e<i;e++)for(let o=0;o<i;o++){if(e===o)continue;let i=l[e][o]*t[e].pop;r.push({from:t[e],to:t[o],value:i})}return r}(t,s),g=0;for(let e of h)e.value>g&&(g=e.value);0===g&&(g=1e-6);for(let t of h){let i=e.constrain(e.map(t.value,0,g,0,1),0,1);if(i>.001){let a=e.map(i,0,1,5,70),n=e.map(i,0,1,.5,4);e.stroke(e.red(S),e.green(S),e.blue(S),a),e.strokeWeight(n),e.line(t.from.x,t.from.y,t.to.x,t.to.y);let l=.1*i;if(e.random(1)<l&&o.length<800){let a=e.map(i,0,1,1,4),n=e.dist(t.from.x,t.from.y,t.to.x,t.to.y)/a*1.2;a>0&&n>0&&o.push(new z(t.from.x,t.from.y,t.to.x,t.to.y,a,n))}}}for(let e=o.length-1;e>=0;e--)o[e].update(),o[e].display(),o[e].isDead()&&o.splice(e,1);let k=null;for(let o of t)x&&x.name===o.name?(e.stroke(255,0,0),e.strokeWeight(3),e.fill(e.red(w)+30,e.green(w)+30,e.blue(w)+30,230)):(e.noStroke(),e.fill(w)),e.ellipse(o.x,o.y,o.baseSize,o.baseSize),p.checked()&&(e.fill(C),e.noStroke(),e.textSize(9),e.textAlign(e.CENTER,e.CENTER),e.text(o.displayName,o.x,o.y-o.baseSize/2-7)),x&&x.name===o.name||e.dist(e.mouseX,e.mouseY,o.x,o.y)<15+o.baseSize/2&&(k=o);if(k){e.fill(e.red(E),e.green(E),e.blue(E),180),e.noStroke(),e.ellipse(k.x,k.y,k.baseSize+6,k.baseSize+6),e.fill(E),e.textSize(11),e.textAlign(e.CENTER,e.BOTTOM),e.textStyle(e.BOLD);let t=`${k.name}\nPop: ${k.pop}M\nECI: ${k.eci.toFixed(2)}\nInformality: ${k.informality}%`;e.text(t,k.x,k.y-k.baseSize/2-15),e.textStyle(e.NORMAL);for(let o of h)if(o.from===k||o.to===k){let t=e.constrain(e.map(o.value,0,g,0,1),0,1);if(t>.001){let i=e.map(t,0,1,60,200),a=e.map(t,0,1,1,5);e.stroke(e.red(E),e.green(E),e.blue(E),i),e.strokeWeight(a),e.line(o.from.x,o.from.y,o.to.x,o.to.y)}}}},e.mousePressed=()=>{let o=!1;for(let i of t)if(e.dist(e.mouseX,e.mouseY,i.x,i.y)<i.baseSize/1.5+5){x&&x.name===i.name?(x=null,j()):(x=i,N()),o=!0;break}!o&&x&&e.mouseX>300&&(x=null,j())},e.windowResized=()=>{y=e.min(.95*e.windowWidth,1200),g=.6*y,g>.85*e.windowHeight&&(g=.85*e.windowHeight,y=g/.6),e.resizeCanvas(y,g),I();let t=20,o=22,s=20;i.position(170,s),s+=o,a.position(170,s),s+=o,n.position(170,s),s+=o;let x=e.sqrt(y*y+g*g);l.remove(),l=e.createSlider(0,x/2,e.constrain(l.value(),0,x/2),1),l.position(170,s),l.style("width","130px"),s+=o,r.position(170,s),s+=o,c.position(t,s),s+=o,p.position(t,s),s+=32,h.position(t,s),s+=27,f.position(t,s),m.position(140,s),s+=o,u.position(t,s),d.position(140,s)}}const p=n.default.div.withConfig({displayName:"WorkReachSketch__WorkReachContainer",componentId:"sc-j3pt0d-0"})(["width:100%;margin:"," 0;border-radius:",";overflow:hidden;box-shadow:",";background-color:var(--color-surface);"],e=>e.theme.space[8],e=>e.theme.radii.xl,e=>e.theme.shadows.xl),m=n.default.div.withConfig({displayName:"WorkReachSketch__SketchDescription",componentId:"sc-j3pt0d-1"})(["padding:",";background-color:var(--color-bg-secondary);border-bottom:1px solid var(--color-border);h3{font-size:",";margin-bottom:",";color:",";}p{color:var(--color-text-secondary);line-height:",";margin:0;}"],e=>e.theme.space[6],e=>e.theme.typography.fontSizes.xl,e=>e.theme.space[3],e=>e.theme.colors.primary,e=>e.theme.typography.lineHeights.relaxed),d=n.default.div.withConfig({displayName:"WorkReachSketch__Instructions",componentId:"sc-j3pt0d-2"})(["padding:"," ",";background-color:rgba(255,107,53,0.05);border-top:1px solid var(--color-border);font-size:",";color:var(--color-text-secondary);strong{color:var(--color-text);font-weight:",";}"],e=>e.theme.space[4],e=>e.theme.space[6],e=>e.theme.typography.fontSizes.sm,e=>e.theme.typography.fontWeights.semibold);var h=function(e){let{showDescription:t=!0,showInstructions:o=!0}=e;return i.createElement(p,null,t&&i.createElement(m,null,i.createElement("h3",null,"Interactive WorkReach Model"),i.createElement("p",null,"Explore how distance, economic complexity (ECI), and informality shape work location choices across Mexican states. Adjust parameters to
1see how mobility flows change in real-time.")),i.createElement(r.A,{sketch:c,minHeight:"600px",backgroundColor:"#0A0E27"}),o&&i.createElement(d,null,i.createElement("strong",null,"Instructions:")," Use the sliders to adjust model parameters. Click on a state to edit its ECI and informality values. Hover over states to see details and highlight their flows."))};const f=n.default.section.withConfig({displayName:"project-detail__ProjectHero",componentId:"sc-nsoc72-0"})(["min-height:60vh;display:flex;flex-direction:column;justify-content:center;padding:"," ",";background:linear-gradient( 135deg,var(--color-bg) 0%,var(--color-surface) 100% );position:relative;overflow:hidden;&::before{content:'';position:absolute;top:0;left:0;right:0;bottom:0;background:radial-gradient( circle at 20% 50%,rgba(255,107,53,0.1) 0%,transparent 50% );pointer-events:none;}"],e=>e.theme.space[20],e=>e.theme.space[6]),u=n.default.div.withConfig({displayName:"project-detail__HeroContent",componentId:"sc-nsoc72-1"})(["max-width:",";margin:0 auto;position:relative;z-index:1;"],e=>e.theme.containers.lg),y=n.default.span.withConfig({displayName:"project-detail__ProjectCategory",componentId:"sc-nsoc72-2"})(["display:inline-block;font-size:",";font-weight:",";color:",";text-transform:uppercase;letter-spacing:",";margin-bottom:",";"],e=>e.theme.typography.fontSizes.sm,e=>e.theme.typography.fontWeights.semibold,e=>e.theme.colors.primary,e=>e.theme.typography.letterSpacings.wider,e=>e.theme.space[4]),g=n.default.h1.withConfig({displayName:"project-detail__ProjectTitle",componentId:"sc-nsoc72-3"})(["font-size:",";margin-bottom:",";background:linear-gradient( 135deg,"," 0%,"," 100% );-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;@media (max-width:","){font-size:",";}"],e=>e.theme.typography.fontSizes["6xl"],e=>e.theme.space[6],e=>e.theme.colors.primary,e=>e.theme.colors.accent,e=>e.theme.breakpoints.md,e=>e.theme.typography.fontSizes["4xl"]),x=n.default.p.withConfig({displayName:"project-detail__ProjectDescription",componentId:"sc-nsoc72-4"})(["font-size:",";color:var(--color-text-secondary);max-width:800px;line-height:",";"],e=>e.theme.typography.fontSizes["2xl"],e=>e.theme.typography.lineHeights.relaxed),b=n.default.article.withConfig({displayName:"project-detail__ProjectContent",componentId:"sc-nsoc72-5"})(["max-width:",";margin:0 auto;padding:"," ",";h2{font-size:",";margin-top:",";margin-bottom:",";color:var(--color-text);}h3{font-size:",";margin-top:",";margin-bottom:",";color:var(--color-text);}p{font-size:",";line-height:",";margin-bottom:",";}img{width:100%;border-radius:",";margin:"," 0;box-shadow:",";}ul,ol{font-size:",";line-height:",";margin-bottom:",";}li{margin-bottom:",";}blockquote{border-left:4px solid ",";padding-left:",";margin:"," 0;font-style:italic;color:var(--color-text-secondary);}code{background-color:var(--color-surface);padding:"," ",";border-radius:",";font-family:",";font-size:0.9em;}pre{background-color:var(--color-surface);padding:",";border-radius:",";overflow-x:auto;margin:"," 0;code{background:none;padding:0;}}hr{margin:"," 0;border:none;height:1px;background:linear-gradient( 90deg,transparent 0%,var(--color-border) 50%,transparent 100% );}"],e=>e.theme.containers.lg,e=>e.theme.space[12],e=>e.theme.space[6],e=>e.theme.typography.fontSizes["4xl"],e=>e.theme.space[16],e=>e.theme.space[6],e=>e.theme.typography.fontSizes["2xl"],e=>e.theme.space[10],e=>e.theme.space[4],e=>e.theme.typography.fontSizes.lg,e=>e.theme.typography.lineHeights.relaxed,e=>e.theme.space[6],e=>e.theme.radii.xl,e=>e.theme.space[8],e=>e.theme.shadows.xl,e=>e.theme.typography.fontSizes.lg,e=>e.theme.typography.lineHeights.relaxed,e=>e.theme.space[6],e=>e.theme.space[3],e=>e.theme.colors.primary,e=>e.theme.space[6],e=>e.theme.space[8],e=>e.theme.space[1],e=>e.theme.space[2],e=>e.theme.radii.sm,e=>e.theme.typography.fonts.mono,e=>e.theme.space[6],e=>e.theme.radii.lg,e=>e.theme.space[8],e=>e.theme.space[12]);var w=function(e){let{data:t}=e;const{markdownRemark:o}=t,{t:n}=(0,a.useTranslation)();if(!o)return i.createElement("div",null,"Project not found");const{frontmatter:r,html:s}=o,c="workreach"===r.page_id;
1return i.createElement(l.A,{title:r.title,description:r.description,image:r.img,path:`/${"es-mx"===r.lang?"proyectos":"projects"}/${r.page_id}`},i.createElement(f,null,i.createElement(u,null,i.createElement(y,null,n(`projects.category.${r.category}`,r.category)),i.createElement(g,null,r.title),r.description&&i.createElement(x,null,r.description))),i.createElement(b,null,c&&i.createElement(h,null),i.createElement("div",{dangerouslySetInnerHTML:{__html:s}})))}}}]); 2//# sourceMappingURL=component---src-templates-project-detail-jsx-5c9e02e9e9a20a88272b.js.map
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.