From 2319312d0eb1fe7eda312acb29ac6e9ab895ce38 Mon Sep 17 00:00:00 2001
From: dabreegster ATIP does not send any data over the network or store your data in the
+ Be sure that you're not losing anything important before doing this!`,s=R(),P(a.$$.fragment),l=R(),c&&c.c(),u=ce()},m(m,g){y(m,e,g),G(e,t),y(m,i,g),y(m,o,g),y(m,s,g),L(a,m,g),y(m,l,g),c&&c.m(m,g),y(m,u,g),f=!0},p(m,g){var k;(!f||g&2)&&n!==(n=((k=m[1])==null?void 0:k.message)+"")&&be(t,n);const v={};g&2048&&(v.$$scope={dirty:g,ctx:m}),a.$set(v),m[1]?c?(c.p(m,g),g&2&&b(c,1)):(c=Po(m),c.c(),b(c,1),c.m(u.parentNode,u)):c&&(se(),$(c,1,1,()=>{c=null}),le())},i(m){f||(b(a.$$.fragment,m),b(c),f=!0)},o(m){$(a.$$.fragment,m),$(c),f=!1},d(m){m&&(w(e),w(i),w(o),w(s),w(l),w(u)),C(a,m),c&&c.d(m)}}}function Ad(r){let e,n,t;function i(s){r[7](s)}let o={title:"Local Storage Quota Exceeded",$$slots:{default:[Fd]},$$scope:{ctx:r}};return r[0]!==void 0&&(o.open=r[0]),e=new Nt({props:o}),V.push(()=>x(e,"open",i)),{c(){P(e.$$.fragment)},m(s,a){L(e,s,a),t=!0},p(s,[a]){const l={};a&2054&&(l.$$scope={dirty:a,ctx:s}),!n&&a&1&&(n=!0,l.open=s[0],ne(()=>n=!1)),e.$set(l)},i(s){t||(b(e.$$.fragment,s),t=!0)},o(s){$(e.$$.fragment,s),t=!1},d(s){C(e,s)}}}function Nd(r,e,n){let{show:t}=e,{setStorageError:i}=e,{clearCurrentSketch:o}=e,{currentAuthority:s}=e;function a(c){let p=$l(c);i&&n(1,i.storedStrings=p,i),c===s&&o()}function l(){o(),yl(),n(0,t=!1),n(1,i=void 0)}const u=c=>a(c.key);function f(c){t=c,n(0,t)}return r.$$set=c=>{"show"in c&&n(0,t=c.show),"setStorageError"in c&&n(1,i=c.setStorageError),"clearCurrentSketch"in c&&n(5,o=c.clearCurrentSketch),"currentAuthority"in c&&n(2,s=c.currentAuthority)},[t,i,s,a,l,o,u,f]}class Rd extends re{constructor(e){super(),ie(this,e,Nd,Ad,te,{show:0,setStorageError:1,clearCurrentSketch:5,currentAuthority:2})}}function Fo(r){let e,n;return e=new ql({props:{label:"Manage files",$$slots:{default:[Dd]},$$scope:{ctx:r}}}),{c(){P(e.$$.fragment)},m(t,i){L(e,t,i),n=!0},p(t,i){const o={};i&2097164&&(o.$$scope={dirty:i,ctx:t}),e.$set(o)},i(t){n||(b(e.$$.fragment,t),n=!0)},o(t){$(e.$$.fragment,t),n=!1},d(t){C(e,t)}}}function Od(r){let e,n,t;return{c(){e=q("img"),t=z(`
+ Save`),st(e.src,n=km)||J(e,"src",n),J(e,"alt","Save as GeoJSON file")},m(i,o){y(i,e,o),y(i,t,o)},p:Q,d(i){i&&(w(e),w(t))}}}function jd(r){let e,n,t;return{c(){e=q("img"),t=z(`
+ Clear all`),st(e.src,n=wm)||J(e,"src",n),J(e,"alt","Clear all")},m(i,o){y(i,e,o),y(i,t,o)},p:Q,d(i){i&&(w(e),w(t))}}}function Id(r){let e,n,t,i;return e=new _e({props:{$$slots:{default:[Od]},$$scope:{ctx:r}}}),e.$on("click",r[8]),t=new bt({props:{$$slots:{default:[jd]},$$scope:{ctx:r}}}),t.$on("click",r[14]),{c(){P(e.$$.fragment),n=R(),P(t.$$.fragment)},m(o,s){L(e,o,s),y(o,n,s),L(t,o,s),i=!0},p(o,s){const a={};s&2097152&&(a.$$scope={dirty:s,ctx:o}),e.$set(a);const l={};s&2097152&&(l.$$scope={dirty:s,ctx:o}),t.$set(l)},i(o){i||(b(e.$$.fragment,o),b(t.$$.fragment,o),i=!0)},o(o){$(e.$$.fragment,o),$(t.$$.fragment,o),i=!1},d(o){o&&w(n),C(e,o),C(t,o)}}}function Bd(r){let e;return{c(){e=z("Clear all work")},m(n,t){y(n,e,t)},d(n){n&&w(e)}}}function qd(r){let e;return{c(){e=z("Cancel")},m(n,t){y(n,e,t)},d(n){n&&w(e)}}}function Gd(r){let e,n,t,i;return e=new bt({props:{$$slots:{default:[Bd]},$$scope:{ctx:r}}}),e.$on("click",r[7]),t=new _e({props:{$$slots:{default:[qd]},$$scope:{ctx:r}}}),t.$on("click",r[15]),{c(){P(e.$$.fragment),n=R(),P(t.$$.fragment)},m(o,s){L(e,o,s),y(o,n,s),L(t,o,s),i=!0},p(o,s){const a={};s&2097152&&(a.$$scope={dirty:s,ctx:o}),e.$set(a);const l={};s&2097152&&(l.$$scope={dirty:s,ctx:o}),t.$set(l)},i(o){i||(b(e.$$.fragment,o),b(t.$$.fragment,o),i=!0)},o(o){$(e.$$.fragment,o),$(t.$$.fragment,o),i=!1},d(o){o&&w(n),C(e,o),C(t,o)}}}function Td(r){let e,n,t,i;return t=new He({props:{$$slots:{default:[Gd]},$$scope:{ctx:r}}}),{c(){e=q("p"),e.textContent="This will delete everything for all schemes.",n=R(),P(t.$$.fragment)},m(o,s){y(o,e,s),y(o,n,s),L(t,o,s),i=!0},p(o,s){const a={};s&2097160&&(a.$$scope={dirty:s,ctx:o}),t.$set(a)},i(o){i||(b(t.$$.fragment,o),i=!0)},o(o){$(t.$$.fragment,o),i=!1},d(o){o&&(w(e),w(n)),C(t,o)}}}function Dd(r){let e,n,t,i,o,s,a,l,u;e=new Xo({props:{label:"Load GeoJSON file",onLoad:r[9]}}),t=new He({props:{$$slots:{default:[Id]},$$scope:{ctx:r}}}),o=new Xe({props:{errorMessage:r[2]}});function f(p){r[16](p)}let c={title:"Would you like to clear your work?",displayEscapeButton:!1,$$slots:{default:[Td]},$$scope:{ctx:r}};return r[3]!==void 0&&(c.open=r[3]),a=new Nt({props:c}),V.push(()=>x(a,"open",f)),{c(){P(e.$$.fragment),n=R(),P(t.$$.fragment),i=R(),P(o.$$.fragment),s=R(),P(a.$$.fragment)},m(p,m){L(e,p,m),y(p,n,m),L(t,p,m),y(p,i,m),L(o,p,m),y(p,s,m),L(a,p,m),u=!0},p(p,m){const g={};m&2097160&&(g.$$scope={dirty:m,ctx:p}),t.$set(g);const v={};m&4&&(v.errorMessage=p[2]),o.$set(v);const k={};m&2097160&&(k.$$scope={dirty:m,ctx:p}),!l&&m&8&&(l=!0,k.open=p[3],ne(()=>l=!1)),a.$set(k)},i(p){u||(b(e.$$.fragment,p),b(t.$$.fragment,p),b(o.$$.fragment,p),b(a.$$.fragment,p),u=!0)},o(p){$(e.$$.fragment,p),$(t.$$.fragment,p),$(o.$$.fragment,p),$(a.$$.fragment,p),u=!1},d(p){p&&(w(n),w(i),w(s)),C(e,p),C(t,p),C(o,p),C(a,p)}}}function Ud(r){let e,n,t,i,o,s=(r[6].mode=="list"||r[6].mode=="split-route"||r[6].mode=="set-image"||r[6].mode=="streetview")&&Fo(r);function a(f){r[17](f)}function l(f){r[18](f)}let u={clearCurrentSketch:r[7],currentAuthority:r[1]};return r[4]!==void 0&&(u.show=r[4]),r[5]!==void 0&&(u.setStorageError=r[5]),n=new Rd({props:u}),V.push(()=>x(n,"show",a)),V.push(()=>x(n,"setStorageError",l)),{c(){s&&s.c(),e=R(),P(n.$$.fragment)},m(f,c){s&&s.m(f,c),y(f,e,c),L(n,f,c),o=!0},p(f,[c]){f[6].mode=="list"||f[6].mode=="split-route"||f[6].mode=="set-image"||f[6].mode=="streetview"?s?(s.p(f,c),c&64&&b(s,1)):(s=Fo(f),s.c(),b(s,1),s.m(e.parentNode,e)):s&&(se(),$(s,1,1,()=>{s=null}),le());const p={};c&2&&(p.currentAuthority=f[1]),!t&&c&16&&(t=!0,p.show=f[4],ne(()=>t=!1)),!i&&c&32&&(i=!0,p.setStorageError=f[5],ne(()=>i=!1)),n.$set(p)},i(f){o||(b(s),b(n.$$.fragment,f),o=!0)},o(f){$(s),$(n.$$.fragment,f),o=!1},d(f){f&&w(e),s&&s.d(f),C(n,f)}}}function zd(r,e){var n=document.createElement("a");n.setAttribute("href","data:text/plain;charset=utf-8, "+encodeURIComponent(e)),n.setAttribute("download",r),document.body.appendChild(n),n.click(),document.body.removeChild(n)}function Jd(r,e,n){let t,i=Q,o=()=>(i(),i=Ke(u,B=>n(13,t=B)),u),s,a;W(r,pe,B=>n(6,s=B)),W(r,xe,B=>n(19,a=B)),r.$$.on_destroy.push(()=>i());let{cfg:l}=e,{gjSchemes:u}=e;o();let{authorityName:f}=e,c="",p=f;a!="v1"&&(p+=`_${a}`);let m=!1,g=!1;it(async()=>{let O=new URLSearchParams(window.location.search).get("geojsonUrl"),F=window.localStorage.getItem(p);if(O){console.log(`Loading GeoJSON from ${O}`);try{let I=await(await fetch(O)).text();u.set(On(JSON.parse(I)))}catch(A){console.log(`Failed to load from URL: ${A}`)}}else if(F)try{u.set(On(JSON.parse(F)))}catch(A){console.log(`Failed to load from local storage: ${A}`)}n(12,m=!0)});let v=!1,k;function M(){n(3,g=!1),u.update(B=>{let O=Tr(l);return O.origin=B.origin,O.authority=B.authority,O}),on.set(null),ln.set(new Set),Ne(pe,s.mode="list",s)}function _(){const B=JSON.parse(JSON.stringify(t));for(let O of B.features)delete O.properties.hide_while_editing;return B}function h(){let B=_();B.authority=f,B.origin="atip-v2",zd(`${p}.geojson`,JSON.stringify(B,null," "))}function E(B,O){try{u.set(On(JSON.parse(O))),n(2,c="")}catch(F){n(2,c=`Couldn't load scheme from a file: ${F}`)}}const d=()=>n(3,g=!0),S=()=>n(3,g=!1);function N(B){g=B,n(3,g)}function j(B){v=B,n(4,v),n(12,m),n(13,t),n(11,p)}function U(B){k=B,n(5,k),n(12,m),n(13,t),n(11,p)}return r.$$set=B=>{"cfg"in B&&n(10,l=B.cfg),"gjSchemes"in B&&o(n(0,u=B.gjSchemes)),"authorityName"in B&&n(1,f=B.authorityName)},r.$$.update=()=>{if(r.$$.dirty&14336&&m&&t){console.log("GJ changed, saving to local storage");const B=wl(p,JSON.stringify(_()));B.isQuotaError&&(n(4,v=!0),n(5,k=B))}},[u,f,c,g,v,k,s,M,h,E,l,p,m,t,d,S,N,j,U]}class Yd extends re{constructor(e){super(),ie(this,e,Jd,Ud,te,{cfg:10,gjSchemes:0,authorityName:1})}}function Xd(r){let e;return{c(){e=q("div"),e.innerHTML=` ATIP does not send any data over the network or store your data in the
cloud. The current file you're editing will be saved in your browser's
local storage and automatically resume when you return to the page. Click Edit scheme
, then
@@ -76,5 +76,5 @@ and limitations under the License.
or
Load from GeoJSON
to save or load a file to your computer. You can share these files with others
- to collaborate on designs.a?`Please enter a number that's at most ${a};`:""}function p(){l=this.value,n(2,l)}return r.$$set=m=>{"label"in m&&n(0,t=m.label),"value"in m&&n(6,i=m.value),"width"in m&&n(1,o=m.width),"min"in m&&n(7,s=m.min),"max"in m&&n(8,a=m.max)},[t,o,l,u,f,c,i,s,a,p]}class sr extends re{constructor(e){super(),ie(this,e,xl,Ql,te,{label:0,value:6,width:1,min:7,max:8})}}function ui(r){let e,n;return{c(){e=q("div"),n=D(r[2]),J(e,"class","govuk-hint")},m(t,i){y(t,e,i),G(e,n)},p(t,i){i&4&&be(n,t[2])},d(t){t&&w(e)}}}function ea(r){let e,n,t,i,o,s,a;e=new Ye({props:{errorMessage:r[4]}});let l=r[2]&&ui(r);return{c(){P(e.$$.fragment),n=R(),l&&l.c(),t=R(),i=q("textarea"),J(i,"class","govuk-textarea"),J(i,"id",r[5]),J(i,"rows",r[3])},m(u,f){L(e,u,f),y(u,n,f),l&&l.m(u,f),y(u,t,f),y(u,i,f),Le(i,r[0]),o=!0,s||(a=he(i,"input",r[6]),s=!0)},p(u,f){const c={};f&16&&(c.errorMessage=u[4]),e.$set(c),u[2]?l?l.p(u,f):(l=ui(u),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),(!o||f&8)&&J(i,"rows",u[3]),f&1&&Le(i,u[0])},i(u){o||(_(e.$$.fragment,u),o=!0)},o(u){$(e.$$.fragment,u),o=!1},d(u){u&&(w(n),w(t),w(i)),F(e,u),l&&l.d(u),s=!1,a()}}}function ta(r){let e,n;return e=new Ct({props:{label:r[1],id:r[5],$$slots:{default:[ea]},$$scope:{ctx:r}}}),{c(){P(e.$$.fragment)},m(t,i){L(e,t,i),n=!0},p(t,[i]){const o={};i&2&&(o.label=t[1]),i&157&&(o.$$scope={dirty:i,ctx:t}),e.$set(o)},i(t){n||(_(e.$$.fragment,t),n=!0)},o(t){$(e.$$.fragment,t),n=!1},d(t){F(e,t)}}}function na(r,e,n){let{label:t}=e,{hint:i=""}=e,{value:o}=e,{rows:s=5}=e,{errorMessage:a=""}=e,l=At();function u(){o=this.value,n(0,o)}return r.$$set=f=>{"label"in f&&n(1,t=f.label),"hint"in f&&n(2,i=f.hint),"value"in f&&n(0,o=f.value),"rows"in f&&n(3,s=f.rows),"errorMessage"in f&&n(4,a=f.errorMessage)},[o,t,i,s,a,l,u]}class Ur extends re{constructor(e){super(),ie(this,e,na,ta,te,{label:1,hint:2,value:0,rows:3,errorMessage:4})}}function ra(r){let e,n,t,i,o,s;return e=new Ye({props:{errorMessage:r[2]}}),{c(){P(e.$$.fragment),n=R(),t=q("input"),J(t,"type","text"),J(t,"class","govuk-input"),J(t,"id",r[3])},m(a,l){L(e,a,l),y(a,n,l),y(a,t,l),Le(t,r[0]),i=!0,o||(s=[he(t,"input",r[6]),he(t,"change",r[5])],o=!0)},p(a,l){const u={};l&4&&(u.errorMessage=a[2]),e.$set(u),l&1&&t.value!==a[0]&&Le(t,a[0])},i(a){i||(_(e.$$.fragment,a),i=!0)},o(a){$(e.$$.fragment,a),i=!1},d(a){a&&(w(n),w(t)),F(e,a),o=!1,er(s)}}}function ia(r){let e,n;return e=new Ct({props:{label:r[1],id:r[3],$$slots:{default:[ra]},$$scope:{ctx:r}}}),{c(){P(e.$$.fragment)},m(t,i){L(e,t,i),n=!0},p(t,[i]){const o={};i&2&&(o.label=t[1]),i&133&&(o.$$scope={dirty:i,ctx:t}),e.$set(o)},i(t){n||(_(e.$$.fragment,t),n=!0)},o(t){$(e.$$.fragment,t),n=!1},d(t){F(e,t)}}}function oa(r,e,n){let t,{label:i}=e,{value:o}=e,{required:s=!1}=e,a=At();function l(f){Uo.call(this,r,f)}function u(){o=this.value,n(0,o)}return r.$$set=f=>{"label"in f&&n(1,i=f.label),"value"in f&&n(0,o=f.value),"required"in f&&n(4,s=f.required)},r.$$.update=()=>{r.$$.dirty&17&&n(2,t=s&&(o==null||o=="")?"Required":"")},[o,i,t,a,s,l,u]}class ir extends re{constructor(e){super(),ie(this,e,oa,ia,te,{label:1,value:0,required:4})}}function sa(r){let e,n,t,i;const o=r[2].default,s=Kt(o,r,r[1],null);let a=[{type:"button"},{class:"govuk-button govuk-button--warning"},{"data-module":"govuk-button"},r[0]],l={};for(let u=0;ul||g>u||v>f){a=c,l=t,u=g,f=v,o=0;return}var S=Ut([a,c],n.properties);if(e(S,t,i,v,o)===!1)return!1;o++,a=c})===!1)return!1}}})}function ls(r,e,n){var t=n,i=!1;return ss(r,function(o,s,a,l,u){i===!1&&n===void 0?t=o:t=e(t,o,s,a,l,u),i=!0}),t}function as(r,e){if(!r)throw new Error("geojson is required");jt(r,function(n,t,i){if(n.geometry!==null){var o=n.geometry.type,s=n.geometry.coordinates;switch(o){case"LineString":if(e(n,t,i,0,0)===!1)return!1;break;case"Polygon":for(var a=0;a=s){var a=(n+i)/2;return[e,a-(t-e)/2,t,a+(t-e)/2]}else{var l=(e+t)/2;return[l-(i-n)/2,n,l+(i-n)/2,i]}}function Lr(r){var e=[1/0,1/0,-1/0,-1/0];return Ot(r,function(n){e[0]>n[0]&&(e[0]=n[0]),e[1]>n[1]&&(e[1]=n[1]),e[2]a?`Please enter a number that's at most ${a};`:""}function p(){l=this.value,n(2,l)}return r.$$set=m=>{"label"in m&&n(0,t=m.label),"value"in m&&n(6,i=m.value),"width"in m&&n(1,o=m.width),"min"in m&&n(7,s=m.min),"max"in m&&n(8,a=m.max)},[t,o,l,u,f,c,i,s,a,p]}class sr extends re{constructor(e){super(),ie(this,e,xl,Ql,te,{label:0,value:6,width:1,min:7,max:8})}}function ui(r){let e,n;return{c(){e=q("div"),n=z(r[2]),J(e,"class","govuk-hint")},m(t,i){y(t,e,i),G(e,n)},p(t,i){i&4&&be(n,t[2])},d(t){t&&w(e)}}}function ea(r){let e,n,t,i,o,s,a;e=new Xe({props:{errorMessage:r[4]}});let l=r[2]&&ui(r);return{c(){P(e.$$.fragment),n=R(),l&&l.c(),t=R(),i=q("textarea"),J(i,"class","govuk-textarea"),J(i,"id",r[5]),J(i,"rows",r[3])},m(u,f){L(e,u,f),y(u,n,f),l&&l.m(u,f),y(u,t,f),y(u,i,f),Le(i,r[0]),o=!0,s||(a=he(i,"input",r[6]),s=!0)},p(u,f){const c={};f&16&&(c.errorMessage=u[4]),e.$set(c),u[2]?l?l.p(u,f):(l=ui(u),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),(!o||f&8)&&J(i,"rows",u[3]),f&1&&Le(i,u[0])},i(u){o||(b(e.$$.fragment,u),o=!0)},o(u){$(e.$$.fragment,u),o=!1},d(u){u&&(w(n),w(t),w(i)),C(e,u),l&&l.d(u),s=!1,a()}}}function ta(r){let e,n;return e=new Ft({props:{label:r[1],id:r[5],$$slots:{default:[ea]},$$scope:{ctx:r}}}),{c(){P(e.$$.fragment)},m(t,i){L(e,t,i),n=!0},p(t,[i]){const o={};i&2&&(o.label=t[1]),i&157&&(o.$$scope={dirty:i,ctx:t}),e.$set(o)},i(t){n||(b(e.$$.fragment,t),n=!0)},o(t){$(e.$$.fragment,t),n=!1},d(t){C(e,t)}}}function na(r,e,n){let{label:t}=e,{hint:i=""}=e,{value:o}=e,{rows:s=5}=e,{errorMessage:a=""}=e,l=At();function u(){o=this.value,n(0,o)}return r.$$set=f=>{"label"in f&&n(1,t=f.label),"hint"in f&&n(2,i=f.hint),"value"in f&&n(0,o=f.value),"rows"in f&&n(3,s=f.rows),"errorMessage"in f&&n(4,a=f.errorMessage)},[o,t,i,s,a,l,u]}class Dr extends re{constructor(e){super(),ie(this,e,na,ta,te,{label:1,hint:2,value:0,rows:3,errorMessage:4})}}function ra(r){let e,n,t,i,o,s;return e=new Xe({props:{errorMessage:r[2]}}),{c(){P(e.$$.fragment),n=R(),t=q("input"),J(t,"type","text"),J(t,"class","govuk-input"),J(t,"id",r[3])},m(a,l){L(e,a,l),y(a,n,l),y(a,t,l),Le(t,r[0]),i=!0,o||(s=[he(t,"input",r[6]),he(t,"change",r[5])],o=!0)},p(a,l){const u={};l&4&&(u.errorMessage=a[2]),e.$set(u),l&1&&t.value!==a[0]&&Le(t,a[0])},i(a){i||(b(e.$$.fragment,a),i=!0)},o(a){$(e.$$.fragment,a),i=!1},d(a){a&&(w(n),w(t)),C(e,a),o=!1,er(s)}}}function ia(r){let e,n;return e=new Ft({props:{label:r[1],id:r[3],$$slots:{default:[ra]},$$scope:{ctx:r}}}),{c(){P(e.$$.fragment)},m(t,i){L(e,t,i),n=!0},p(t,[i]){const o={};i&2&&(o.label=t[1]),i&133&&(o.$$scope={dirty:i,ctx:t}),e.$set(o)},i(t){n||(b(e.$$.fragment,t),n=!0)},o(t){$(e.$$.fragment,t),n=!1},d(t){C(e,t)}}}function oa(r,e,n){let t,{label:i}=e,{value:o}=e,{required:s=!1}=e,a=At();function l(f){Do.call(this,r,f)}function u(){o=this.value,n(0,o)}return r.$$set=f=>{"label"in f&&n(1,i=f.label),"value"in f&&n(0,o=f.value),"required"in f&&n(4,s=f.required)},r.$$.update=()=>{r.$$.dirty&17&&n(2,t=s&&(o==null||o=="")?"Required":"")},[o,i,t,a,s,l,u]}class ir extends re{constructor(e){super(),ie(this,e,oa,ia,te,{label:1,value:0,required:4})}}function sa(r){let e,n,t,i;const o=r[2].default,s=Kt(o,r,r[1],null);let a=[{type:"button"},{class:"govuk-button govuk-button--warning"},{"data-module":"govuk-button"},r[0]],l={};for(let u=0;u=s){var a=(n+i)/2;return[e,a-(t-e)/2,t,a+(t-e)/2]}else{var l=(e+t)/2;return[l-(i-n)/2,n,l+(i-n)/2,i]}}function Lr(r){var e=[1/0,1/0,-1/0,-1/0];return Ot(r,function(n){e[0]>n[0]&&(e[0]=n[0]),e[1]>n[1]&&(e[1]=n[1]),e[2]l||g>u||v>f){a=c,l=t,u=g,f=v,o=0;return}var S=pt([a,c],n.properties);if(e(S,t,i,v,o)===!1)return!1;o++,a=c})===!1)return!1}}})}Me(zs,"segmentEach");function Cp(r,e,n){var t=n,i=!1;return zs(r,function(o,s,a,l,u){i===!1&&n===void 0?t=o:t=e(t,o,s,a,l,u),i=!0}),t}Me(Cp,"segmentReduce");function Js(r,e){if(!r)throw new Error("geojson is required");$n(r,function(n,t,i){if(n.geometry!==null){var o=n.geometry.type,s=n.geometry.coordinates;switch(o){case"LineString":if(e(n,t,i,0,0)===!1)return!1;break;case"Polygon":for(var a=0;aSaving files
Saving files