diff --git a/govuk_step3/assets/nested2-52905722.js b/govuk_step3/assets/nested2-52905722.js new file mode 100644 index 000000000..41cf181f3 --- /dev/null +++ b/govuk_step3/assets/nested2-52905722.js @@ -0,0 +1,2 @@ +import{S as ke,i as Se,s as Ce,g as N,m as A,t as d,l as b,q as L,G as ae,r as Fe,T as je,a as te,d as Be,al as fe,e as P,f as M,u as C,aa as ue,h as Y,j as k,k as $,y as re,n as ne,x as U,p as S,am as Me,z as Ne,B as ie,E as Ae,b as ce,c as me,F as Le,o as pe,Q as Oe,R as ze,v as _e,w as Ie}from"./maplibre_helpers-c90a66cd.js";import{L as Te,Z as Ee,C as ve,p as Ge,g as ee,S as $e,I as Je,B as Pe,q as qe,M as De,m as Re}from"./ZoomOutMap-22960ba9.js";function ge(s,e,t){const r=s.slice();return r[24]=e[t],r}function Ze(s){let e;return{c(){e=C("Home")},m(t,r){k(t,e,r)},d(t){t&&S(e)}}}function de(s){let e,t;return e=new Ae({props:{errorMessage:s[7]}}),{c(){N(e.$$.fragment)},m(r,n){A(e,r,n),t=!0},p(r,n){const o={};n&128&&(o.errorMessage=r[7]),e.$set(o)},i(r){t||(d(e.$$.fragment,r),t=!0)},o(r){b(e.$$.fragment,r),t=!1},d(r){L(e,r)}}}function He(s){let e;return{c(){e=C("Clear")},m(t,r){k(t,e,r)},d(t){t&&S(e)}}}function Qe(s){let e,t,r,n,o,m;return r=new te({props:{$$slots:{default:[He]},$$scope:{ctx:s}}}),r.$on("click",s[18]),{c(){e=P("input"),t=M(),N(r.$$.fragment),Y(e,"type","text"),Y(e,"class","govuk-input govuk-input--width-10"),Y(e,"id","filterText")},m(l,p){k(l,e,p),_e(e,s[1]),k(l,t,p),A(r,l,p),n=!0,o||(m=Ie(e,"input",s[17]),o=!0)},p(l,p){p&2&&e.value!==l[1]&&_e(e,l[1]);const a={};p&134217728&&(a.$$scope={dirty:p,ctx:l}),r.$set(a)},i(l){n||(d(r.$$.fragment,l),n=!0)},o(l){b(r.$$.fragment,l),n=!1},d(l){l&&(S(e),S(t)),L(r,l),o=!1,m()}}}function Ue(s){let e,t,r,n,o,m,l,p;function a(f){s[15](f)}let _={label:"Authority or region",id:"filterAuthority",choices:s[8]};s[4]!==void 0&&(_.value=s[4]),e=new $e({props:_}),ce.push(()=>me(e,"value",a));function I(f){s[16](f)}let O={label:"Funding programme",id:"filterFundingProgramme",choices:s[9]};return s[5]!==void 0&&(O.value=s[5]),n=new $e({props:O}),ce.push(()=>me(n,"value",I)),l=new Le({props:{label:"Any field",id:"filterText",$$slots:{default:[Qe]},$$scope:{ctx:s}}}),{c(){N(e.$$.fragment),r=M(),N(n.$$.fragment),m=M(),N(l.$$.fragment)},m(f,c){A(e,f,c),k(f,r,c),A(n,f,c),k(f,m,c),A(l,f,c),p=!0},p(f,c){const F={};c&256&&(F.choices=f[8]),!t&&c&16&&(t=!0,F.value=f[4],pe(()=>t=!1)),e.$set(F);const j={};c&512&&(j.choices=f[9]),!o&&c&32&&(o=!0,j.value=f[5],pe(()=>o=!1)),n.$set(j);const z={};c&134217730&&(z.$$scope={dirty:c,ctx:f}),l.$set(z)},i(f){p||(d(e.$$.fragment,f),d(n.$$.fragment,f),d(l.$$.fragment,f),p=!0)},o(f){b(e.$$.fragment,f),b(n.$$.fragment,f),b(l.$$.fragment,f),p=!1},d(f){f&&(S(r),S(m)),L(e,f),L(n,f),L(l,f)}}}function he(s){let e,t;return e=new ve({props:{label:`${s[24].scheme_reference}: ${s[24].num_features} features`,$$slots:{default:[We]},$$scope:{ctx:s}}}),{c(){N(e.$$.fragment)},m(r,n){A(e,r,n),t=!0},p(r,n){const o={};n&1&&(o.label=`${r[24].scheme_reference}: ${r[24].num_features} features`),n&134217729&&(o.$$scope={dirty:n,ctx:r}),e.$set(o)},i(r){t||(d(e.$$.fragment,r),t=!0)},o(r){b(e.$$.fragment,r),t=!1},d(r){L(e,r)}}}function Ke(s){let e;return{c(){e=C("Show on map")},m(t,r){k(t,e,r)},d(t){t&&S(e)}}}function Ve(s){let e;return{c(){e=C("Edit scheme")},m(t,r){k(t,e,r)},d(t){t&&S(e)}}}function We(s){let e,t,r=s[24].authority_or_region+"",n,o,m,l,p=s[24].capital_scheme_id+"",a,_,I,O,f=s[24].funding_programme+"",c,F,j,z,Z,T,D,G;function H(){return s[19](s[24])}z=new te({props:{$$slots:{default:[Ke]},$$scope:{ctx:s}}}),z.$on("click",H);function K(){return s[20](s[24])}return T=new te({props:{$$slots:{default:[Ve]},$$scope:{ctx:s}}}),T.$on("click",K),{c(){e=P("p"),t=C("Authority or region: "),n=C(r),o=M(),m=P("p"),l=C("Capital scheme ID: "),a=C(p),_=M(),I=P("p"),O=C("Funding programme: "),c=C(f),F=M(),j=P("div"),N(z.$$.fragment),Z=M(),N(T.$$.fragment),D=M(),Y(j,"class","govuk-button-group")},m(w,v){k(w,e,v),$(e,t),$(e,n),k(w,o,v),k(w,m,v),$(m,l),$(m,a),k(w,_,v),k(w,I,v),$(I,O),$(I,c),k(w,F,v),k(w,j,v),A(z,j,null),$(j,Z),A(T,j,null),k(w,D,v),G=!0},p(w,v){s=w,(!G||v&1)&&r!==(r=s[24].authority_or_region+"")&&U(n,r),(!G||v&1)&&p!==(p=s[24].capital_scheme_id+"")&&U(a,p),(!G||v&1)&&f!==(f=s[24].funding_programme+"")&&U(c,f);const Q={};v&134217728&&(Q.$$scope={dirty:v,ctx:s}),z.$set(Q);const i={};v&134217728&&(i.$$scope={dirty:v,ctx:s}),T.$set(i)},i(w){G||(d(z.$$.fragment,w),d(T.$$.fragment,w),G=!0)},o(w){b(z.$$.fragment,w),b(T.$$.fragment,w),G=!1},d(w){w&&(S(e),S(o),S(m),S(_),S(I),S(F),S(j),S(D)),L(z),L(T)}}}function be(s){let e=s[2].has(s[24].scheme_reference),t,r,n=e&&he(s);return{c(){n&&n.c(),t=Oe()},m(o,m){n&&n.m(o,m),k(o,t,m),r=!0},p(o,m){m&5&&(e=o[2].has(o[24].scheme_reference)),e?n?(n.p(o,m),m&5&&d(n,1)):(n=he(o),n.c(),d(n,1),n.m(t.parentNode,t)):n&&(re(),b(n,1,1,()=>{n=null}),ne())},i(o){r||(d(n),r=!0)},o(o){b(n),r=!1},d(o){o&&S(t),n&&n.d(o)}}}function Xe(s){let e,t,r,n,o,m,l,p,a,_,I,O,f,c,F,j=s[2].size+"",z,Z,T=s[3].route+"",D,G,H=s[3].area+"",K,w,v=s[3].crossing+"",Q,i,g=s[3].other+"",q,V,J,x,R;t=new te({props:{$$slots:{default:[Ze]},$$scope:{ctx:s}}}),t.$on("click",s[14]),l=new Ee({props:{boundaryGeojson:s[6]}});let B=s[7]&&de(s);_=new Be({props:{label:"Load from GeoJSON",id:"load-geojson",loadFile:s[11]}}),O=new ve({props:{label:"Filters",$$slots:{default:[Ue]},$$scope:{ctx:s}}});let W=fe(s[0]),y=[];for(let u=0;ub(y[u],1,1,()=>{y[u]=null});return{c(){e=P("div"),N(t.$$.fragment),r=M(),n=P("div"),o=P("h1"),o.textContent="Browse schemes",m=M(),N(l.$$.fragment),p=M(),B&&B.c(),a=M(),N(_.$$.fragment),I=M(),N(O.$$.fragment),f=M(),c=P("p"),F=C("Showing "),z=C(j),Z=C(" schemes ("),D=C(T),G=C(" routes, "),K=C(H),w=C(` areas, + `),Q=C(v),i=C(" crossings, "),q=C(g),V=C(" other)"),J=M(),x=P("ul");for(let u=0;u{B=null}),ne());const oe={};if(h&134218546&&(oe.$$scope={dirty:h,ctx:u}),O.$set(oe),(!R||h&4)&&j!==(j=u[2].size+"")&&U(z,j),(!R||h&8)&&T!==(T=u[3].route+"")&&U(D,T),(!R||h&8)&&H!==(H=u[3].area+"")&&U(K,H),(!R||h&8)&&v!==(v=u[3].crossing+"")&&U(Q,v),(!R||h&8)&&g!==(g=u[3].other+"")&&U(q,g),h&12293){W=fe(u[0]);let E;for(E=0;E${t}${r}`;return e+="",e}function rt(s,e,t){let r,n;ae(s,ee,i=>t(6,r=i)),ae(s,Re,i=>t(21,n=i)),Fe(()=>{Ne()});let m=new URLSearchParams(window.location.search).get("style")||"streets",l="",p=[],a="",_=new Set,I={area:0,route:0,crossing:0,other:0},O=[],f="",c=[],F="";je(()=>{ee.set(null)});function j(i){try{let g=JSON.parse(i);ee.set(g),z(g),t(7,l=""),n==null||n.fitBounds(ie(g),{padding:20,animate:!1})}catch(g){t(7,l=`Couldn't load schemes from a file: ${g}`)}}function z(i){let g={};for(let[J,x]of Object.entries(i.schemes))g[J]={scheme_reference:J,num_features:0,...x};for(let J of i.features)g[J.properties.scheme_reference].num_features++;t(0,p=Object.values(g));let q=new Set,V=new Set;for(let J of p)J.authority_or_region&&q.add(J.authority_or_region),J.funding_programme&&V.add(J.funding_programme);t(8,O=Array.from(q.entries())),O.sort(),t(9,c=Array.from(V.entries())),c.sort()}function Z(i){let g={type:"FeatureCollection",features:r.features.filter(q=>q.properties.scheme_reference==i.scheme_reference)};n==null||n.fitBounds(ie(g),{padding:20,animate:!1})}function T(i){let g={type:"FeatureCollection",features:r.features.filter(V=>V.properties.scheme_reference==i.scheme_reference)},q=i.authority_or_region;window.localStorage.setItem(q,JSON.stringify(g)),window.open(`scheme.html?authority=${i.authority_or_region}`,"_blank")}const D=()=>window.open("index.html");function G(i){f=i,t(4,f)}function H(i){F=i,t(5,F)}function K(){a=this.value,t(1,a)}const w=()=>t(1,a=""),v=i=>Z(i),Q=i=>T(i);return s.$$.update=()=>{if(s.$$.dirty&127&&r){if(_.clear(),a||f||F){let i=a.toLowerCase();for(let g of r.features)JSON.stringify(g.properties).toLowerCase().includes(i)&&(f&&g.properties.authority_or_region!=f||F&&g.properties.funding_programme!=F||_.add(g.properties.scheme_reference))}else for(let i of p)_.add(i.scheme_reference);ee.update(i=>{if(!i)return null;for(let g of i.features)_.has(g.properties.scheme_reference)?delete g.properties.hide_while_editing:g.properties.hide_while_editing=!0;return i}),t(3,I={area:0,route:0,crossing:0,other:0});for(let i of r==null?void 0:r.features)_.has(i.properties.scheme_reference)&&t(3,I[i.properties.intervention_type]++,I);t(2,_),t(6,r),t(1,a),t(4,f),t(5,F),t(0,p),t(3,I)}},[p,a,_,I,f,F,r,l,O,c,m,j,Z,T,D,G,H,K,w,v,Q]}class nt extends ke{constructor(e){super(),Se(this,e,rt,et,Ce,{})}}document.body.className=document.body.className?document.body.className+" js-enabled":"js-enabled";new nt({target:document.getElementById("app")}); diff --git a/govuk_step3/assets/nested2-64107261.js b/govuk_step3/assets/nested2-64107261.js deleted file mode 100644 index 3bd3ff107..000000000 --- a/govuk_step3/assets/nested2-64107261.js +++ /dev/null @@ -1,2 +0,0 @@ -import{S as we,i as ye,s as ke,g as F,m as M,t as g,l as y,q as N,G as ue,r as ve,T as Se,a as Y,d as Ce,F as je,al as ie,e as E,f as j,u as w,aa as ce,h as U,j as v,k as i,y as te,n as re,x as R,p as S,am as Be,z as Fe,B as me,E as Me,v as pe,w as Ne,Q as Le,R as Oe}from"./maplibre_helpers-c90a66cd.js";import{L as ze,g as X,Z as Ie,p as Te,I as Ee,B as Ge,q as Je,M as qe,m as Ae,C as De}from"./ZoomOutMap-22960ba9.js";function _e(s,e,r){const t=s.slice();return t[18]=e[r],t}function Re(s){let e;return{c(){e=w("Home")},m(r,t){v(r,e,t)},d(r){r&&S(e)}}}function $e(s){let e,r;return e=new Me({props:{errorMessage:s[5]}}),{c(){F(e.$$.fragment)},m(t,n){M(e,t,n),r=!0},p(t,n){const o={};n&32&&(o.errorMessage=t[5]),e.$set(o)},i(t){r||(g(e.$$.fragment,t),r=!0)},o(t){y(e.$$.fragment,t),r=!1},d(t){N(e,t)}}}function Ze(s){let e;return{c(){e=w("Clear")},m(r,t){v(r,e,t)},d(r){r&&S(e)}}}function He(s){let e,r,t,n,o,c;return t=new Y({props:{$$slots:{default:[Ze]},$$scope:{ctx:s}}}),t.$on("click",s[12]),{c(){e=E("input"),r=j(),F(t.$$.fragment),U(e,"type","text"),U(e,"class","govuk-input govuk-input--width-10"),U(e,"id","filterText")},m(u,$){v(u,e,$),pe(e,s[1]),v(u,r,$),M(t,u,$),n=!0,o||(c=Ne(e,"input",s[11]),o=!0)},p(u,$){$&2&&e.value!==u[1]&&pe(e,u[1]);const l={};$&2097152&&(l.$$scope={dirty:$,ctx:u}),t.$set(l)},i(u){n||(g(t.$$.fragment,u),n=!0)},o(u){y(t.$$.fragment,u),n=!1},d(u){u&&(S(e),S(r)),N(t,u),o=!1,c()}}}function de(s){let e,r;return e=new De({props:{label:`${s[18].scheme_reference}: ${s[18].num_features} features`,$$slots:{default:[Ue]},$$scope:{ctx:s}}}),{c(){F(e.$$.fragment)},m(t,n){M(e,t,n),r=!0},p(t,n){const o={};n&1&&(o.label=`${t[18].scheme_reference}: ${t[18].num_features} features`),n&2097153&&(o.$$scope={dirty:n,ctx:t}),e.$set(o)},i(t){r||(g(e.$$.fragment,t),r=!0)},o(t){y(e.$$.fragment,t),r=!1},d(t){N(e,t)}}}function Pe(s){let e;return{c(){e=w("Show on map")},m(r,t){v(r,e,t)},d(r){r&&S(e)}}}function Qe(s){let e;return{c(){e=w("Edit scheme")},m(r,t){v(r,e,t)},d(r){r&&S(e)}}}function Ue(s){let e,r,t=s[18].authority_or_region+"",n,o,c,u,$=s[18].capital_scheme_id+"",l,p,L,Z,G=s[18].funding_programme+"",O,J,h,I,q,z,D,a;function _(){return s[13](s[18])}I=new Y({props:{$$slots:{default:[Pe]},$$scope:{ctx:s}}}),I.$on("click",_);function T(){return s[14](s[18])}return z=new Y({props:{$$slots:{default:[Qe]},$$scope:{ctx:s}}}),z.$on("click",T),{c(){e=E("p"),r=w("Authority or region: "),n=w(t),o=j(),c=E("p"),u=w("Capital scheme ID: "),l=w($),p=j(),L=E("p"),Z=w("Funding programme: "),O=w(G),J=j(),h=E("div"),F(I.$$.fragment),q=j(),F(z.$$.fragment),D=j(),U(h,"class","govuk-button-group")},m(m,k){v(m,e,k),i(e,r),i(e,n),v(m,o,k),v(m,c,k),i(c,u),i(c,l),v(m,p,k),v(m,L,k),i(L,Z),i(L,O),v(m,J,k),v(m,h,k),M(I,h,null),i(h,q),M(z,h,null),v(m,D,k),a=!0},p(m,k){s=m,(!a||k&1)&&t!==(t=s[18].authority_or_region+"")&&R(n,t),(!a||k&1)&&$!==($=s[18].capital_scheme_id+"")&&R(l,$),(!a||k&1)&&G!==(G=s[18].funding_programme+"")&&R(O,G);const K={};k&2097152&&(K.$$scope={dirty:k,ctx:s}),I.$set(K);const H={};k&2097152&&(H.$$scope={dirty:k,ctx:s}),z.$set(H)},i(m){a||(g(I.$$.fragment,m),g(z.$$.fragment,m),a=!0)},o(m){y(I.$$.fragment,m),y(z.$$.fragment,m),a=!1},d(m){m&&(S(e),S(o),S(c),S(p),S(L),S(J),S(h),S(D)),N(I),N(z)}}}function ge(s){let e=s[2].has(s[18].scheme_reference),r,t,n=e&&de(s);return{c(){n&&n.c(),r=Le()},m(o,c){n&&n.m(o,c),v(o,r,c),t=!0},p(o,c){c&5&&(e=o[2].has(o[18].scheme_reference)),e?n?(n.p(o,c),c&5&&g(n,1)):(n=de(o),n.c(),g(n,1),n.m(r.parentNode,r)):n&&(te(),y(n,1,1,()=>{n=null}),re())},i(o){t||(g(n),t=!0)},o(o){y(n),t=!1},d(o){o&&S(r),n&&n.d(o)}}}function Ke(s){let e,r,t,n,o,c,u,$,l,p,L,Z,G,O,J,h,I,q=s[2].size+"",z,D,a=s[3].route+"",_,T,m=s[3].area+"",k,K,H=s[3].crossing+"",x,ne,V=s[3].other+"",ee,se,oe,W,A;r=new Y({props:{$$slots:{default:[Re]},$$scope:{ctx:s}}}),r.$on("click",s[10]),u=new Ie({props:{boundaryGeojson:s[4]}});let C=s[5]&&$e(s);p=new Ce({props:{label:"Load from GeoJSON",id:"load-geojson",loadFile:s[7]}}),O=new je({props:{label:"Filter by any field",id:"filterText",$$slots:{default:[He]},$$scope:{ctx:s}}});let P=ie(s[0]),b=[];for(let f=0;fy(b[f],1,1,()=>{b[f]=null});return{c(){e=E("div"),F(r.$$.fragment),t=j(),n=E("div"),o=E("h1"),o.textContent="Browse schemes",c=j(),F(u.$$.fragment),$=j(),C&&C.c(),l=j(),F(p.$$.fragment),L=j(),Z=E("br"),G=j(),F(O.$$.fragment),J=j(),h=E("p"),I=w("Showing "),z=w(q),D=w(" schemes ("),_=w(a),T=w(" routes, "),k=w(m),K=w(` areas, - `),x=w(H),ne=w(" crossings, "),ee=w(V),se=w(" other)"),oe=j(),W=E("ul");for(let f=0;f{C=null}),re());const ae={};if(d&2097154&&(ae.$$scope={dirty:d,ctx:f}),O.$set(ae),(!A||d&4)&&q!==(q=f[2].size+"")&&R(z,q),(!A||d&8)&&a!==(a=f[3].route+"")&&R(_,a),(!A||d&8)&&m!==(m=f[3].area+"")&&R(k,m),(!A||d&8)&&H!==(H=f[3].crossing+"")&&R(x,H),(!A||d&8)&&V!==(V=f[3].other+"")&&R(ee,V),d&773){P=ie(f[0]);let B;for(B=0;B${r}${t}`;return e+="",e}function xe(s,e,r){let t,n;ue(s,X,a=>r(4,t=a)),ue(s,Ae,a=>r(15,n=a)),ve(()=>{Fe()});let c=new URLSearchParams(window.location.search).get("style")||"streets",u="",$=[],l="",p=new Set,L={area:0,route:0,crossing:0,other:0};Se(()=>{X.set(null)});function Z(a){try{let _=JSON.parse(a);X.set(_),G(_),r(5,u=""),n==null||n.fitBounds(me(_),{padding:20,animate:!1})}catch(_){r(5,u=`Couldn't load schemes from a file: ${_}`)}}function G(a){let _={};for(let[T,m]of Object.entries(a.schemes))_[T]={scheme_reference:T,num_features:0,...m};for(let T of a.features)_[T.properties.scheme_reference].num_features++;r(0,$=Object.values(_))}function O(a){let _={type:"FeatureCollection",features:t.features.filter(T=>T.properties.scheme_reference==a.scheme_reference)};n==null||n.fitBounds(me(_),{padding:20,animate:!1})}function J(a){let _={type:"FeatureCollection",features:t.features.filter(m=>m.properties.scheme_reference==a.scheme_reference)},T=a.authority_or_region;window.localStorage.setItem(T,JSON.stringify(_)),window.open(`scheme.html?authority=${a.authority_or_region}`,"_blank")}const h=()=>window.open("index.html");function I(){l=this.value,r(1,l)}const q=()=>r(1,l=""),z=a=>O(a),D=a=>J(a);return s.$$.update=()=>{if(s.$$.dirty&31){if(p.clear(),l){let a=l.toLowerCase();for(let _ of t.features)JSON.stringify(_.properties).toLowerCase().includes(a)&&p.add(_.properties.scheme_reference)}else for(let a of $)p.add(a.scheme_reference);X.update(a=>{if(!a)return null;for(let _ of a.features)p.has(_.properties.scheme_reference)?delete _.properties.hide_while_editing:_.properties.hide_while_editing=!0;return a}),r(3,L={area:0,route:0,crossing:0,other:0});for(let a of t==null?void 0:t.features)p.has(a.properties.scheme_reference)&&r(3,L[a.properties.intervention_type]++,L);r(2,p),r(1,l),r(4,t),r(0,$),r(3,L)}},[$,l,p,L,t,u,c,Z,O,J,h,I,q,z,D]}class et extends we{constructor(e){super(),ye(this,e,xe,Xe,ke,{})}}document.body.className=document.body.className?document.body.className+" js-enabled":"js-enabled";new et({target:document.getElementById("app")}); diff --git a/govuk_step3/browse.html b/govuk_step3/browse.html index c04809327..f4d3895bf 100644 --- a/govuk_step3/browse.html +++ b/govuk_step3/browse.html @@ -7,7 +7,7 @@ content="initial-scale=1,maximum-scale=1,user-scalable=no" /> ATIP v2 scheme browser - +