var LM=Object.defineProperty;var dM=(g,A,B)=>A in g?LM(g,A,{enumerable:!0,configurable:!0,writable:!0,value:B}):g[A]=B;var DB=(g,A,B)=>(dM(g,typeof A!="symbol"?A+"":A,B),B);import{S as aB,i as lB,s as IB,z as jQ,a as AB,b as h,c as s,d as NB,e as sA,f as c,l as yA,A as mQ,B as bQ,C as OQ,g as IQ,v as R,w as U,h as tA,r as QQ,j as TB,k as aQ,m as KA,L as M,n as VA,I as PQ,F as nB,G as cB,J as oB,p as m,u as b,y as O,o as nA,q as wA,K as XE,t as RB,H as YQ,_ as ve,a9 as Ki,a1 as le,M as fC,Q as vo,a0 as HQ,O as fM,Y as YM,ad as ki,a7 as PM,ae as KM,x as $A,a2 as Ci,a3 as ii,R as kM,U as xM}from"./index-aa6be1a1.js";import{U as cQ,a as RQ,I as qr,L as Oe}from"./UIEventSource-92ac4fe9.js";import{Q as Rw,C as Ve,L as qC}from"./Constants-78dfb500.js";import{l as HM,M as SM,A as Di,d as pM,a6 as JM,aw as zM,aV as Vo,aW as Wo,aX as jM,S as mM,aY as _C,aZ as bM,a_ as OM,q as YC,ag as xi,a$ as vM,B as oi,_ as VM,ap as WM,x as XM,y as aC,Y as Xo,b0 as ZM,b1 as qM,Q as Mi,b2 as Hi,w as PC,$ as _M,I as Zo,a0 as qo,b3 as $M,z as An,L as _r,b4 as Bn,b5 as _o,b6 as Qn,U as gn,H as CC,k as $C,h as lC,j as FC,ab as $o,aq as AM,T as En}from"./ChartJsUtils-4d4315f9.js";import{a as QB,g as wn,L as KC,T as SA,d as Si,b as hC,P as en,c as pi}from"./SubtleButton-5269e23e.js";import{P as uE,M as sn,D as tn,T as rn}from"./ThemeSearch-d428351d.js";import{T as iC,G as AC,A as BM,C as $r,B as Vr,l as Cn,k as Dn,m as on}from"./AccordionSingle-de293e2e.js";import{L as Fs}from"./Loading-38202d52.js";import{C as Mn}from"./Community-82f4308b.js";import{A as uC,Q as Ai,p as QM,f as nn,T as gM,m as NC,q as ni,r as cn,n as In,S as Wr,s as an,t as ln,E as Fn,u as hn,v as un,w as Nn,M as Tn}from"./TagRenderingAnswer-84eeff2e.js";import{_ as Bi}from"./preload-helper-a4192956.js";import{A as Pt,I as kC}from"./IsOnline-479694eb.js";import{a as EM,b as Gn}from"./Filterview-48758b17.js";import{P as Rn}from"./PrivacyPolicy-66f690a2.js";import{t as Ji}from"./tw-join-70ce42f3.js";import{B as yn}from"./BackButton-7910cf2a.js";function Un(g){let A,B,Q,w,E;const e=g[2].default,t=jQ(e,g,g[1],null);let r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 24 24"},{fill:"currentColor"},{"aria-hidden":"true"},g[0]],D={};for(let C=0;C{A=AB(AB({},A),aQ(i)),B(0,w=TB(A,Q)),"$$scope"in i&&B(1,e=i.$$scope)},[w,e,E,t,r,D,C,n]}class dn extends aB{constructor(A){super(),lB(this,A,Ln,Un,IB,{})}}function fn(g){let A,B,Q,w,E;const e=g[2].default,t=jQ(e,g,g[1],null);let r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 24 24"},{fill:"currentColor"},{"aria-hidden":"true"},g[0]],D={};for(let C=0;C{A=AB(AB({},A),aQ(i)),B(0,w=TB(A,Q)),"$$scope"in i&&B(1,e=i.$$scope)},[w,e,E,t,r,D,C,n]}class wM extends aB{constructor(A){super(),lB(this,A,Yn,fn,IB,{})}}function Pn(g){let A,B,Q,w,E,e;const t=g[2].default,r=jQ(t,g,g[1],null);let D=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 24 24"},{fill:"currentColor"},{"aria-hidden":"true"},g[0]],C={};for(let n=0;n{A=AB(AB({},A),aQ(i)),B(0,w=TB(A,Q)),"$$scope"in i&&B(1,e=i.$$scope)},[w,e,E,t,r,D,C,n]}class kn extends aB{constructor(A){super(),lB(this,A,Kn,Pn,IB,{})}}function xn(g){let A,B,Q,w,E;const e=g[2].default,t=jQ(e,g,g[1],null);let r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 24 24"},{fill:"currentColor"},{"aria-hidden":"true"},g[0]],D={};for(let C=0;C{A=AB(AB({},A),aQ(i)),B(0,w=TB(A,Q)),"$$scope"in i&&B(1,e=i.$$scope)},[w,e,E,t,r,D,C,n]}class Sn extends aB{constructor(A){super(),lB(this,A,Hn,xn,IB,{})}}function pn(g){let A,B,Q,w,E;const e=g[2].default,t=jQ(e,g,g[1],null);let r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 24 24"},{fill:"currentColor"},{"aria-hidden":"true"},g[0]],D={};for(let C=0;C{A=AB(AB({},A),aQ(i)),B(0,w=TB(A,Q)),"$$scope"in i&&B(1,e=i.$$scope)},[w,e,E,t,r,D,C,n]}class zn extends aB{constructor(A){super(),lB(this,A,Jn,pn,IB,{})}}function jn(g){let A,B,Q,w,E,e;const t=g[2].default,r=jQ(t,g,g[1],null);let D=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 24 24"},{fill:"currentColor"},{"aria-hidden":"true"},g[0]],C={};for(let n=0;n{A=AB(AB({},A),aQ(i)),B(0,w=TB(A,Q)),"$$scope"in i&&B(1,e=i.$$scope)},[w,e,E,t,r,D,C,n]}class bn extends aB{constructor(A){super(),lB(this,A,mn,jn,IB,{})}}function On(g){let A,B,Q,w,E;const e=g[2].default,t=jQ(e,g,g[1],null);let r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 20 20"},{fill:"currentColor"},{"aria-hidden":"true"},g[0]],D={};for(let C=0;C{A=AB(AB({},A),aQ(i)),B(0,w=TB(A,Q)),"$$scope"in i&&B(1,e=i.$$scope)},[w,e,E,t,r,D,C,n]}class Vn extends aB{constructor(A){super(),lB(this,A,vn,On,IB,{})}}function Wn(g){let A,B,Q,w,E;const e=g[2].default,t=jQ(e,g,g[1],null);let r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 20 20"},{fill:"currentColor"},{"aria-hidden":"true"},g[0]],D={};for(let C=0;C{A=AB(AB({},A),aQ(i)),B(0,w=TB(A,Q)),"$$scope"in i&&B(1,e=i.$$scope)},[w,e,E,t,r,D,C,n]}class Zn extends aB{constructor(A){super(),lB(this,A,Xn,Wn,IB,{})}}function qn(g){let A,B,Q,w,E;const e=g[2].default,t=jQ(e,g,g[1],null);let r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 20 20"},{fill:"currentColor"},{"aria-hidden":"true"},g[0]],D={};for(let C=0;C{A=AB(AB({},A),aQ(i)),B(0,w=TB(A,Q)),"$$scope"in i&&B(1,e=i.$$scope)},[w,e,E,t,r,D,C,n]}class t8 extends aB{constructor(A){super(),lB(this,A,_n,qn,IB,{})}}function $n(g){let A,B,Q,w,E;const e=g[2].default,t=jQ(e,g,g[1],null);let r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 20 20"},{fill:"currentColor"},{"aria-hidden":"true"},g[0]],D={};for(let C=0;C{A=AB(AB({},A),aQ(i)),B(0,w=TB(A,Q)),"$$scope"in i&&B(1,e=i.$$scope)},[w,e,E,t,r,D,C,n]}class eM extends aB{constructor(A){super(),lB(this,A,Ac,$n,IB,{})}}function Bc(g){let A,B,Q,w,E,e;const t=g[2].default,r=jQ(t,g,g[1],null);let D=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 20 20"},{fill:"currentColor"},{"aria-hidden":"true"},g[0]],C={};for(let n=0;n{A=AB(AB({},A),aQ(i)),B(0,w=TB(A,Q)),"$$scope"in i&&B(1,e=i.$$scope)},[w,e,E,t,r,D,C,n]}class gc extends aB{constructor(A){super(),lB(this,A,Qc,Bc,IB,{})}}function Ec(g){let A,B,Q,w,E;const e=g[2].default,t=jQ(e,g,g[1],null);let r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 20 20"},{fill:"currentColor"},{"aria-hidden":"true"},g[0]],D={};for(let C=0;C{A=AB(AB({},A),aQ(i)),B(0,w=TB(A,Q)),"$$scope"in i&&B(1,e=i.$$scope)},[w,e,E,t,r,D,C,n]}class ec extends aB{constructor(A){super(),lB(this,A,wc,Ec,IB,{})}}function sc(g){let A,B,Q,w,E;const e=g[2].default,t=jQ(e,g,g[1],null);let r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 20 20"},{fill:"currentColor"},{"aria-hidden":"true"},g[0]],D={};for(let C=0;C{A=AB(AB({},A),aQ(i)),B(0,w=TB(A,Q)),"$$scope"in i&&B(1,e=i.$$scope)},[w,e,E,t,r,D,C,n]}class sM extends aB{constructor(A){super(),lB(this,A,tc,sc,IB,{})}}function rc(g){let A,B,Q,w,E;const e=g[2].default,t=jQ(e,g,g[1],null);let r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 20 20"},{fill:"currentColor"},{"aria-hidden":"true"},g[0]],D={};for(let C=0;C{A=AB(AB({},A),aQ(i)),B(0,w=TB(A,Q)),"$$scope"in i&&B(1,e=i.$$scope)},[w,e,E,t,r,D,C,n]}class ic extends aB{constructor(A){super(),lB(this,A,Cc,rc,IB,{})}}function Dc(g){let A,B,Q,w,E;const e=g[2].default,t=jQ(e,g,g[1],null);let r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 20 20"},{fill:"currentColor"},{"aria-hidden":"true"},g[0]],D={};for(let C=0;C{A=AB(AB({},A),aQ(i)),B(0,w=TB(A,Q)),"$$scope"in i&&B(1,e=i.$$scope)},[w,e,E,t,r,D,C,n]}class Mc extends aB{constructor(A){super(),lB(this,A,oc,Dc,IB,{})}}function nc(g){let A,B,Q,w,E;const e=g[2].default,t=jQ(e,g,g[1],null);let r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 20 20"},{fill:"currentColor"},{"aria-hidden":"true"},g[0]],D={};for(let C=0;C{A=AB(AB({},A),aQ(i)),B(0,w=TB(A,Q)),"$$scope"in i&&B(1,e=i.$$scope)},[w,e,E,t,r,D,C,n]}class Ic extends aB{constructor(A){super(),lB(this,A,cc,nc,IB,{})}}class Gw{static initSwitch(A,B,Q,w){const E=B;return Rw.getQueryParameter(A,{deflt:""+E,documentation:Q,stackOffset:-1,category:w}).sync(t=>t===void 0?E:t!=="false",[],t=>t==E?void 0:""+t)}}class ac{constructor(){DB(this,"featureSwitchFakeUser");this.featureSwitchFakeUser=Rw.getBooleanQueryParameter("fake-user",!1,"If true, 'dryrun' mode is activated and a fake user account is loaded","testing")}}class r8 extends ac{constructor(B){super();DB(this,"featureSwitchEnableLogin");DB(this,"featureSwitchSearch");DB(this,"featureSwitchBackgroundSelection");DB(this,"featureSwitchWelcomeMessage");DB(this,"featureSwitchCommunityIndex");DB(this,"featureSwitchExtraLinkEnabled");DB(this,"featureSwitchBackToThemeOverview");DB(this,"featureSwitchShareScreen");DB(this,"featureSwitchGeolocation");DB(this,"featureSwitchCache");DB(this,"featureSwitchIsTesting");DB(this,"featureSwitchIsDebugging");DB(this,"featureSwitchShowAllQuestions");DB(this,"featureSwitchFilter");DB(this,"featureSwitchMultiSelect");DB(this,"featureSwitchEnableExport");DB(this,"overpassUrl");DB(this,"overpassTimeout");DB(this,"overpassMaxZoom");DB(this,"osmApiTileSize");DB(this,"backgroundLayerId");DB(this,"featureSwitchMorePrivacy");DB(this,"featureSwitchLayerDefault");this.featureSwitchEnableLogin=Gw.initSwitch("fs-enable-login",(B==null?void 0:B.enableUserBadge)??!0,"Disables/Enables logging in and thus disables editing all together. This effectively puts MapComplete into read-only mode.","interface"),this.featureSwitchSearch=Gw.initSwitch("fs-search",(B==null?void 0:B.enableSearch)??!0,"Disables/Enables the search bar","interface"),this.featureSwitchBackgroundSelection=Gw.initSwitch("fs-background",(B==null?void 0:B.enableBackgroundLayerSelection)??!0,"Disables/Enables the background layer control where a user can enable e.g. aerial imagery","interface"),this.featureSwitchFilter=Gw.initSwitch("fs-filter",(B==null?void 0:B.enableLayers)??!0,"Disables/Enables the filter view where a user can enable/disable MapComplete-layers or filter for certain properties","interface"),this.featureSwitchMultiSelect=Gw.initSwitch("fs-multiselect",(B==null?void 0:B.enableMultiSelect)??!1,"Disables/Enables the multi-select feature","interface"),this.featureSwitchWelcomeMessage=Gw.initSwitch("fs-welcome-message",!0,"Disables/enables the help menu or welcome message","interface"),this.featureSwitchCommunityIndex=Gw.initSwitch("fs-community-index",this.featureSwitchEnableLogin.data,"Disables/enables the button to get in touch with the community","interface"),this.featureSwitchExtraLinkEnabled=Gw.initSwitch("fs-iframe-popout",!0,"Disables/Enables the extraLink button. By default, if in iframe mode and the welcome message is hidden, a popout button to the full mapcomplete instance is shown instead (unless disabled with this switch or another extraLink button is enabled)","interface"),this.featureSwitchBackToThemeOverview=Gw.initSwitch("fs-homepage-link",(B==null?void 0:B.enableMoreQuests)??!0,"Disables/Enables the various links which go back to the index page with the theme overview","interface"),this.featureSwitchShareScreen=Gw.initSwitch("fs-share-screen",(B==null?void 0:B.enableShareScreen)??!0,"Disables/Enables the 'Share-screen'-tab in the welcome message","interface"),this.featureSwitchGeolocation=Gw.initSwitch("fs-geolocation",(B==null?void 0:B.enableGeolocation)??!0,"Disables/Enables the geolocation button","interface"),this.featureSwitchLayerDefault=Rw.getBooleanQueryParameter("fs-layers-enabled",!0,"If set to false, all layers will be disabled - except the explicitly enabled layers","map"),this.featureSwitchShowAllQuestions=Gw.initSwitch("fs-all-questions",(B==null?void 0:B.enableShowAllQuestions)??!1,"Always show all questions","interface"),this.featureSwitchEnableExport=Gw.initSwitch("fs-export",(B==null?void 0:B.enableExportButton)??!0,"Enable the export as GeoJSON and CSV button","interface"),this.featureSwitchCache=Gw.initSwitch("fs-cache",(B==null?void 0:B.enableCache)??!0,"Enable/disable caching from localStorage","technical");let Q=!1;!Ve.osmAuthConfig.url.startsWith("https://master.apis.dev.openstreetmap.org")&&!cQ.runningFromConsole&&location.hostname==="127.0.0.1"&&(Q=!0),this.featureSwitchIsTesting=Rw.getBooleanQueryParameter("test",Q,"If true, 'dryrun' mode is activated. The app will behave as normal, except that changes to OSM will be printed onto the console instead of actually uploaded to osm.org","testing"),this.featureSwitchIsDebugging=Rw.getBooleanQueryParameter("debug",!1,"If true, shows some extra debugging help such as all the available tags on every object","testing"),this.featureSwitchMorePrivacy=Rw.getBooleanQueryParameter("moreprivacy",B.enableMorePrivacy,"If true, the location distance indication will not be written to the changeset and other privacy enhancing measures might be taken."),this.overpassUrl=Rw.getQueryParameter("overpassUrl",{deflt:((B==null?void 0:B.overpassUrl)??Ve.defaultOverpassUrls).join(","),documentation:"Point mapcomplete to a different overpass-instance. Example: https://overpass-api.de/api/interpreter",category:"technical"}).sync(w=>w==null?void 0:w.split(","),[],w=>w==null?void 0:w.join(",")),this.overpassTimeout=RQ.asInt(Rw.getQueryParameter("overpassTimeout",{deflt:""+(B==null?void 0:B.overpassTimeout),documentation:"Set a different timeout (in seconds) for queries in overpass",category:"technical"})),this.overpassMaxZoom=RQ.asFloat(Rw.getQueryParameter("overpassMaxZoom",{deflt:""+(B==null?void 0:B.overpassMaxZoom),documentation:" point to switch between OSM-api and overpass",category:"technical"})),this.osmApiTileSize=RQ.asInt(Rw.getQueryParameter("osmApiTileSize",{deflt:""+(B==null?void 0:B.osmApiTileSize),documentation:"Tilesize when the OSM-API is used to fetch data within a BBOX",category:"technical"})),this.backgroundLayerId=Rw.getQueryParameter("background",{deflt:B==null?void 0:B.defaultBackgroundId,category:"map",documentation:["When set, load this raster layer (or a layer of this category) as background layer instead of using the default background. This is as if the user opened the background selection menu and selected the layer with the given id or category.","Most raster layers are based on the [editor layer index](https://github.com/osmlab/editor-layer-index)","#### Selecting a category","If one of the following values is used, this parameter will be interpreted as a _category_ instead of the id of a specific layer. The best layer of this category will be used. Supported categories are those from the editor layer index and are:",HM.map(w=>"- "+w).join(`
`),"#### Selecting a specific layer","One can use the [ID of an ELI-layer](./ELI-overview.md) or use one of the global, builtin layers:",SM.list(Di.globalLayers.map(w=>w.properties.id+(w.properties.best?" ⭐":"")))].join(`
`)})}}function lc(g){let A,B,Q,w,E;const e=g[2].default,t=jQ(e,g,g[1],null);let r=[{xmlns:"http://www.w3.org/2000/svg"},{fill:"none"},{viewBox:"0 0 24 24"},{"stroke-width":"1.5"},{stroke:"currentColor"},{"aria-hidden":"true"},g[0]],D={};for(let C=0;C{A=AB(AB({},A),aQ(i)),B(0,w=TB(A,Q)),"$$scope"in i&&B(1,e=i.$$scope)},[w,e,E,t,r,D,C,n]}class hc extends aB{constructor(A){super(),lB(this,A,Fc,lc,IB,{})}}function uc(g){let A,B,Q,w,E;const e=g[2].default,t=jQ(e,g,g[1],null);let r=[{xmlns:"http://www.w3.org/2000/svg"},{fill:"none"},{viewBox:"0 0 24 24"},{"stroke-width":"1.5"},{stroke:"currentColor"},{"aria-hidden":"true"},g[0]],D={};for(let C=0;C{A=AB(AB({},A),aQ(i)),B(0,w=TB(A,Q)),"$$scope"in i&&B(1,e=i.$$scope)},[w,e,E,t,r,D,C,n]}class Tc extends aB{constructor(A){super(),lB(this,A,Nc,uc,IB,{})}}class TC{constructor(){DB(this,"permission",new RQ("prompt"));DB(this,"_gpsAvailable",new RQ(!0));DB(this,"gpsAvailable",this._gpsAvailable);DB(this,"requestMoment",new RQ(void 0));DB(this,"allowMoving",new RQ(!0));DB(this,"currentGPSLocation",new RQ(void 0));DB(this,"_previousLocationGrant",qC.getParsed("geolocation-permissions",!1));DB(this,"_grantedThisSession",new RQ(!1));DB(this,"gpsStateExplanation");const A=this;this.permission.addCallbackAndRunD(async Q=>{Q==="granted"&&(A._previousLocationGrant.setData(!0),A._grantedThisSession.setData(!0)),Q==="prompt"&&A._grantedThisSession.data&&(A._previousLocationGrant.setData(!1),A.permission.setData("denied"),A.currentGPSLocation.setData(void 0),console.warn("Detected a downgrade in permissions!")),Q==="denied"&&A._previousLocationGrant.setData(!1)}),console.log("Previous location grant:",this._previousLocationGrant.data),this._previousLocationGrant.data&&(this._previousLocationGrant.setData(!1),console.log("Requesting access to GPS as this was previously granted"),Rw.wasInitialized("lat")||Rw.wasInitialized("lon")||this.requestMoment.setData(new Date),this.requestPermission());const B=this.currentGPSLocation.map(Q=>Q!==void 0);this.gpsStateExplanation=this.gpsAvailable.map(Q=>B.data?this.allowMoving.data?QB.t.general.labels.jumpToLocation:QB.t.general.visualFeedback.islocked:Q?this.permission.data==="denied"?QB.t.general.geopermissionDenied:this.permission.data==="prompt"?QB.t.general.labels.jumpToLocation:this.permission.data==="requested"?QB.t.general.waitingForGeopermission:QB.t.general.waitingForLocation:QB.t.general.labels.locationNotAvailable,[this.allowMoving,this.permission,B])}requestPermission(){this.requestPermissionAsync()}static isSafari(){return navigator.permissions===void 0&&navigator.geolocation!==void 0}async requestPermissionAsync(){var A;if(typeof navigator>"u"){this.permission.setData("denied");return}if(!(this.permission.data!=="prompt"&&this.permission.data!=="requested")){if(Pt.inAndroid.data){this.permission.setData("requested"),this.permission.addCallbackAndRunD(B=>{if(B==="granted")return this.startWatching(),!0}),Pt.requestGeoPermission().then(B=>{const Q=B.value==="true";this.permission.set(Q?"granted":"denied")});return}if(TC.isSafari()){this.permission.setData("requested"),this.startWatching();return}this.permission.setData("requested");try{const B=await((A=navigator==null?void 0:navigator.permissions)==null?void 0:A.query({name:"geolocation"}));if(console.log("Got geolocation state",B.state),B.state==="granted"||B.state==="denied"){this.permission.setData(B.state),this.startWatching();return}B.addEventListener("change",()=>{this.permission.setData(B.state)}),this.permission.setData("requested"),this.startWatching()}catch(B){console.error("Could not get permission:",B)}}}async startWatching(){Pt.inAndroid.data&&Pt.watchLocation(this.currentGPSLocation),navigator.geolocation.watchPosition(A=>{this._gpsAvailable.set(!0),this.currentGPSLocation.setData(A.coords),this._previousLocationGrant.setData(!0)},A=>{if(A.code===2||A.code===3){this._gpsAvailable.set(!1);return}if(this._gpsAvailable.set(!0),A.code===1){this.permission.set("denied"),this._grantedThisSession.setData(!1);return}console.warn("Could not get location with navigator.geolocation due to",A)},{enableHighAccuracy:!0})}}const dC=class dC{constructor(A,B,Q,w){DB(this,"renderings");DB(this,"i",0);DB(this,"hasPresets");DB(this,"hasNoteLayer");DB(this,"features");DB(this,"_features");DB(this,"_usermode");DB(this,"_enabledAddMorePoints");this._usermode=Q,this._enabledAddMorePoints=w,this.hasNoteLayer=A.hasNoteLayer(),this.hasPresets=A.hasPresets();const E=[];for(const e of A.layers)for(let t=0;tcQ.runningFromConsole?"":e.ConstructElement().innerHTML)),this._features=new RQ([]),this.features=this._features,B.addCallbackAndRunD(({lon:e,lat:t,mode:r})=>{this._features.setData([this.createFeature(e,t,r)])})}createFeature(A,B,Q){var E,e;const w={id:dC.newPointElementId+"_"+this.i,has_note_layer:this.hasNoteLayer?"yes":"no",has_presets:this.hasPresets?"yes":"no",renderings:this.renderings.join(""),number_of_presets:""+this.renderings.length,first_preset:this.renderings[0],mouse_button:Q??"none",_usermode:(E=this._usermode)==null?void 0:E.data,_addNewEnabled:((e=this._enabledAddMorePoints)==null?void 0:e.data)??!0?"yes":"no"};return this.i++,{type:"Feature",properties:w,geometry:{type:"Point",coordinates:[A,B]}}}clear(){this._features.setData([])}};DB(dC,"newPointElementId","new_point_dialog");let Qi=dC;function Gc(g){let A,B,Q,w,E,e,t=[g[0],{xmlns:"http://www.w3.org/2000/svg"},{width:"375px"},{height:"375px"},{viewBox:"0 0 375 375"},{version:"1.1"}],r={};for(let D=0;D{A=AB(AB({},A),aQ(i)),B(0,w=TB(A,Q))},[w,E,e,t,r,D,C,n]}class yc extends aB{constructor(A){super(),lB(this,A,Rc,Gc,IB,{color:1})}get color(){return this.$$.ctx[1]}}function Uc(g){let A,B,Q,w,E,e,t=[g[1],{xmlns:"http://www.w3.org/2000/svg"},{width:"375px"},{height:"375px"},{viewBox:"0 0 375 375"},{version:"1.1"}],r={};for(let D=0;D{A=AB(AB({},A),aQ(i)),B(1,w=TB(A,Q)),"color"in i&&B(0,E=i.color)},[E,w,e,t,r,D,C,n]}class dc extends aB{constructor(A){super(),lB(this,A,Lc,Uc,IB,{color:0})}}function fc(g){let A,B;return A=new Vo({props:{class:g[0],style:"animation: 3s linear 0s infinite normal none running spin;"}}),{c(){m(A.$$.fragment)},m(Q,w){b(A,Q,w),B=!0},p(Q,w){const E={};w&1&&(E.class=Q[0]),A.$set(E)},i(Q){B||(R(A.$$.fragment,Q),B=!0)},o(Q){U(A.$$.fragment,Q),B=!1},d(Q){O(A,Q)}}}function Yc(g){let A,B;return A=new Wo({props:{class:g[0],style:"animation: 3s linear 0s infinite normal none running spin;"}}),{c(){m(A.$$.fragment)},m(Q,w){b(A,Q,w),B=!0},p(Q,w){const E={};w&1&&(E.class=Q[0]),A.$set(E)},i(Q){B||(R(A.$$.fragment,Q),B=!0)},o(Q){U(A.$$.fragment,Q),B=!1},d(Q){O(A,Q)}}}function Pc(g){let A,B;return A=new Wo({props:{class:g[0]}}),{c(){m(A.$$.fragment)},m(Q,w){b(A,Q,w),B=!0},p(Q,w){const E={};w&1&&(E.class=Q[0]),A.$set(E)},i(Q){B||(R(A.$$.fragment,Q),B=!0)},o(Q){U(A.$$.fragment,Q),B=!1},d(Q){O(A,Q)}}}function Kc(g){let A,B;return A=new yc({props:{class:g[0]}}),{c(){m(A.$$.fragment)},m(Q,w){b(A,Q,w),B=!0},p(Q,w){const E={};w&1&&(E.class=Q[0]),A.$set(E)},i(Q){B||(R(A.$$.fragment,Q),B=!0)},o(Q){U(A.$$.fragment,Q),B=!1},d(Q){O(A,Q)}}}function kc(g){let A,B,Q,w;const E=[Sc,Hc],e=[];function t(r,D){return r[3]?0:1}return A=t(g),B=e[A]=E[A](g),{c(){B.c(),Q=PQ()},m(r,D){e[A].m(r,D),sA(r,Q,D),w=!0},p(r,D){let C=A;A=t(r),A===C?e[A].p(r,D):(nB(),U(e[C],1,1,()=>{e[C]=null}),cB(),B=e[A],B?B.p(r,D):(B=e[A]=E[A](r),B.c()),R(B,1),B.m(Q.parentNode,Q))},i(r){w||(R(B),w=!0)},o(r){U(B),w=!1},d(r){e[A].d(r),r&&tA(Q)}}}function xc(g){let A,B;return A=new jM({props:{class:g[0]}}),{c(){m(A.$$.fragment)},m(Q,w){b(A,Q,w),B=!0},p(Q,w){const E={};w&1&&(E.class=Q[0]),A.$set(E)},i(Q){B||(R(A.$$.fragment,Q),B=!0)},o(Q){U(A.$$.fragment,Q),B=!1},d(Q){O(A,Q)}}}function Hc(g){let A,B;return A=new Vo({props:{class:g[0]}}),{c(){m(A.$$.fragment)},m(Q,w){b(A,Q,w),B=!0},p(Q,w){const E={};w&1&&(E.class=Q[0]),A.$set(E)},i(Q){B||(R(A.$$.fragment,Q),B=!0)},o(Q){U(A.$$.fragment,Q),B=!1},d(Q){O(A,Q)}}}function Sc(g){let A,B;return A=new dc({props:{class:g[0]}}),{c(){m(A.$$.fragment)},m(Q,w){b(A,Q,w),B=!0},p(Q,w){const E={};w&1&&(E.class=Q[0]),A.$set(E)},i(Q){B||(R(A.$$.fragment,Q),B=!0)},o(Q){U(A.$$.fragment,Q),B=!1},d(Q){O(A,Q)}}}function pc(g){let A,B,Q,w;const E=[xc,kc,Kc,Pc,Yc,fc],e=[];function t(r,D){return r[1]?r[2]!==void 0?1:r[4]==="denied"||!r[5]?2:r[4]==="prompt"?3:r[4]==="requested"?4:5:0}return A=t(g),B=e[A]=E[A](g),{c(){B.c(),Q=PQ()},m(r,D){e[A].m(r,D),sA(r,Q,D),w=!0},p(r,[D]){let C=A;A=t(r),A===C?e[A].p(r,D):(nB(),U(e[C],1,1,()=>{e[C]=null}),cB(),B=e[A],B?B.p(r,D):(B=e[A]=E[A](r),B.c()),R(B,1),B.m(Q.parentNode,Q))},i(r){w||(R(B),w=!0)},o(r){U(B),w=!1},d(r){e[A].d(r),r&&tA(Q)}}}function Jc(g,A,B){let Q,w,E,e,t,{state:r}=A,D=r.geolocation.geolocationState,C=r.geolocation.geolocationState.permission;oB(g,C,N=>B(4,e=N));let n=D.allowMoving;oB(g,n,N=>B(1,Q=N));let i=r.geolocation.geolocationState.currentGPSLocation;oB(g,i,N=>B(2,w=N));let a=r.geolocationControl,G=r.geolocation.geolocationState.gpsAvailable;oB(g,G,N=>B(5,t=N));let F=a.lastClickWithinThreeSecs;oB(g,F,N=>B(3,E=N));let{clss:T="h-8 w-8 shrink-0"}=A;return g.$$set=N=>{"state"in N&&B(11,r=N.state),"clss"in N&&B(0,T=N.clss)},[T,Q,w,E,e,t,C,n,i,G,F,r]}class zc extends aB{constructor(A){super(),lB(this,A,Jc,pc,IB,{state:11,clss:0})}}function zi(g,A,B){const Q=g.slice();return Q[6]=A[B],Q}function ji(g){var w;let A,B=((w=g[0])==null?void 0:w.nameEn)+"",Q;return{c(){A=nA("h3"),Q=RB(B)},m(E,e){sA(E,A,e),c(A,Q)},p(E,e){var t;e&1&&B!==(B=((t=E[0])==null?void 0:t.nameEn)+"")&&YQ(Q,B)},d(E){E&&tA(A)}}}function mi(g){let A,B,Q;return B=new SA({props:{t:g[3]}}),{c(){A=nA("div"),m(B.$$.fragment),s(A,"class","thanks w-fit")},m(w,E){sA(w,A,E),b(B,A,null),Q=!0},p:VA,i(w){Q||(R(B.$$.fragment,w),Q=!0)},o(w){U(B.$$.fragment,w),Q=!1},d(w){w&&tA(A),O(B)}}}function bi(g){var L,H,j,QA;let A,B,Q,w,E,e,t=(((L=g[6].resolved)==null?void 0:L.name)??((H=g[6].resolved)==null?void 0:H.url))+"",r,D,C,n=((j=g[6].resolved)==null?void 0:j.description)+"",i,a,G=((QA=g[6].languageCodes)==null?void 0:QA.indexOf(g[2]))>=0,F,T,N=G&&mi(g);return{c(){var DA;A=nA("div"),B=nA("img"),w=wA(),E=nA("div"),e=nA("a"),r=RB(t),C=wA(),i=RB(n),a=wA(),N&&N.c(),F=wA(),s(B,"class","m-2 h-8 w-8"),ve(B.src,Q=`${Ve.communityIndexHost}${g[6].type}.svg`)||s(B,"src",Q),s(e,"href",D=(DA=g[6].resolved)==null?void 0:DA.url),s(e,"target","_blank"),s(e,"rel","noreferrer nofollow noopener"),s(e,"class","font-bold"),s(E,"class","flex flex-col"),s(A,"class","link-underline my-4 flex items-center")},m(DA,q){sA(DA,A,q),c(A,B),c(A,w),c(A,E),c(E,e),c(e,r),c(E,C),c(E,i),c(E,a),N&&N.m(E,null),c(A,F),T=!0},p(DA,q){var x,$,lA,K,P;(!T||q&2&&!ve(B.src,Q=`${Ve.communityIndexHost}${DA[6].type}.svg`))&&s(B,"src",Q),(!T||q&2)&&t!==(t=(((x=DA[6].resolved)==null?void 0:x.name)??(($=DA[6].resolved)==null?void 0:$.url))+"")&&YQ(r,t),(!T||q&2&&D!==(D=(lA=DA[6].resolved)==null?void 0:lA.url))&&s(e,"href",D),(!T||q&2)&&n!==(n=((K=DA[6].resolved)==null?void 0:K.description)+"")&&YQ(i,n),q&6&&(G=((P=DA[6].languageCodes)==null?void 0:P.indexOf(DA[2]))>=0),G?N?(N.p(DA,q),q&6&&R(N,1)):(N=mi(DA),N.c(),R(N,1),N.m(E,null)):N&&(nB(),U(N,1,1,()=>{N=null}),cB())},i(DA){T||(R(N),T=!0)},o(DA){U(N),T=!1},d(DA){DA&&tA(A),N&&N.d()}}}function jc(g){var r;let A,B,Q,w=((r=g[0])==null?void 0:r.nameEn)&&ji(g),E=g[1],e=[];for(let D=0;DU(e[D],1,1,()=>{e[D]=null});return{c(){A=nA("div"),w&&w.c(),B=wA();for(let D=0;DD.replace("{native}",wn[C]??C));let{country:e}=A,t=[];const r=KC.language;return oB(g,r,D=>B(2,Q=D)),g.$$set=D=>{"country"in D&&B(0,e=D.country)},g.$$.update=()=>{g.$$.dirty&1&&B(1,t=Array.from(Object.values((e==null?void 0:e.resources)??{})))},[e,t,Q,E,r]}class tM extends aB{constructor(A){super(),lB(this,A,mc,jc,IB,{country:0})}}function Oi(g,A,B){const Q=g.slice();return Q[8]=A[B],Q}function bc(g){let A,B,Q=g[0],w=[];for(let e=0;eU(w[e],1,1,()=>{w[e]=null});return{c(){for(let e=0;e{n[L]=null}),cB(),E=n[w],E?E.p(T,N):(E=n[w]=C[w](T),E.c()),R(E,1),E.m(A,e));let H=t;t=F(T),t===H?G[t].p(T,N):(nB(),U(G[H],1,1,()=>{G[H]=null}),cB(),r=G[t],r?r.p(T,N):(r=G[t]=a[t](T),r.c()),R(r,1),r.m(A,null))},i(T){D||(R(B.$$.fragment,T),R(E),R(r),D=!0)},o(T){U(B.$$.fragment,T),U(E),U(r),D=!1},d(T){T&&tA(A),O(B),n[w].d(),G[t].d()}}}function Xc(g,A,B){let Q,w,{location:E}=A;const e=E.mapD(n=>{const i=iC.embedded_tile(n.lat,n.lon,6);return cQ.SubstituteKeys(Ve.communityIndexHost+"tile_{z}_{x}_{y}.geojson",i)}),t=QB.t.communityIndex,r=new RQ([]);e.addCallbackAndRun(async n=>{const i=await cQ.downloadJsonCached(n,86400);i!==void 0&&r.setData(i.features)});const D=r.mapD(n=>n.filter(i=>AC.inside([E.data.lon,E.data.lat],i)),[E]);oB(g,D,n=>B(0,Q=n));const C=RQ.fromPromise(cQ.downloadJsonCached(Ve.communityIndexHost+"/global.json",24*60*60*1e3));return oB(g,C,n=>B(1,w=n)),g.$$set=n=>{"location"in n&&B(5,E=n.location)},[Q,w,t,D,C,E]}class Zc extends aB{constructor(A){super(),lB(this,A,Xc,Wc,IB,{location:5})}}var qc=function(g){var A,B;if(g.hasOwnProperty("type"))return A=DC(g),B=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],A.reduce(function(Q,w){return[Math.min(w[0],Q[0]),Math.min(w[1],Q[1]),Math.max(w[0],Q[2]),Math.max(w[1],Q[3])]},B)};function DC(g){var A;return g.type=="Point"?A=[g.coordinates]:g.type=="LineString"||g.type=="MultiPoint"?A=g.coordinates:g.type=="Polygon"||g.type=="MultiLineString"?A=g.coordinates.reduce(function(B,Q){return B.concat(Q)},[]):g.type=="MultiPolygon"?A=g.coordinates.reduce(function(B,Q){return B.concat(Q.reduce(function(w,E){return w.concat(E)},[]))},[]):g.type=="Feature"?A=DC(g.geometry):g.type=="GeometryCollection"?A=g.geometries.reduce(function(B,Q){return B.concat(DC(Q))},[]):g.type=="FeatureCollection"&&(A=g.features.reduce(function(B,Q){return B.concat(DC(Q))},[])),A}var oC=Object.prototype.hasOwnProperty,rM=Object.prototype.toString,Vi=Object.defineProperty,Wi=Object.getOwnPropertyDescriptor,Xi=function(A){return typeof Array.isArray=="function"?Array.isArray(A):rM.call(A)==="[object Array]"},Zi=function(A){if(!A||rM.call(A)!=="[object Object]")return!1;var B=oC.call(A,"constructor"),Q=A.constructor&&A.constructor.prototype&&oC.call(A.constructor.prototype,"isPrototypeOf");if(A.constructor&&!B&&!Q)return!1;var w;for(w in A);return typeof w>"u"||oC.call(A,w)},qi=function(A,B){Vi&&B.name==="__proto__"?Vi(A,B.name,{enumerable:!0,configurable:!0,value:B.newValue,writable:!0}):A[B.name]=B.newValue},_i=function(A,B){if(B==="__proto__")if(oC.call(A,B)){if(Wi)return Wi(A,B).value}else return;return A[B]},_c=function g(){var A,B,Q,w,E,e,t=arguments[0],r=1,D=arguments.length,C=!1;for(typeof t=="boolean"&&(C=t,t=arguments[1]||{},r=2),(t==null||typeof t!="object"&&typeof t!="function")&&(t={});r-1?e.coordinates.map(function(t){var r={};return r.type=e.type.replace("Multi",""),r.coordinates=t,e.crs&&(r.crs=e.crs),r}):!1}function w(e){var t=e.every(function(n){return A.indexOf(n.type)>-1}),r=e[0].crs||0,D=e.every(function(n){var i=n.crs||0;return i==r});if(t&&D){var C={};return C.type="Multi"+e[0].type,C.coordinates=[],r!=0&&(C.crs=r),e.forEach(function(n){C.coordinates.push(n.coordinates)}),C}else return!1}var E={explode:Q,implode:w};g.exports?g.exports=E:window&&(window.multigeojson=E)})()})(CM);var $c=CM.exports,ci=$c;function GC(g,A,B,Q,w){var E=g.map(function(t){return w.coordinateConverter&&(t=w.coordinateConverter(t)),[(t[0]-B.x)/A,(B.y-t[1])/A]}),e=E.map(function(t){return Q?t[0].toFixed(Q)+","+t[1].toFixed(Q):t[0]+","+t[1]});return e.join(" ")}function iM(g,A,B,Q){var w=Q&&Q.r?Q.r:1,E=Q&&Q.hasOwnProperty("pointAsCircle")?Q.pointAsCircle:!1,e=GC([g.coordinates],A,B,Q.precision,Q);return E?[e]:["M"+e+" m"+-w+",0 a"+w+","+w+" 0 1,1 "+2*w+",0 a"+w+","+w+" 0 1,1 "+-2*w+",0"]}function A1(g,A,B,Q){var w=Q&&Q.hasOwnProperty("explode")?Q.explode:!1,E=ci.explode(g).map(function(e){return iM(e,A,B,Q)[0]});return w?E:[E.join(" ")]}function DM(g,A,B,Q){var w=GC(g.coordinates,A,B,Q.precision,Q),E="M"+w;return[E]}function B1(g,A,B,Q){var w=Q&&Q.hasOwnProperty("explode")?Q.explode:!1,E=ci.explode(g).map(function(e){return DM(e,A,B,Q)[0]});return w?E:[E.join(" ")]}function oM(g,A,B,Q){var w,E;w=GC(g.coordinates[0],A,B,Q.precision,Q),g.coordinates.length>1&&(E=g.coordinates.slice(1,g.coordinates.length));var e="M"+w;if(E)for(var t=0;t ",w}function $i(g,A){function B(Q,w,E,e){if(Q.hasOwnProperty(w))return Q[w];throw new Error(e.slice(0,E+1).join(".")+" is not a valid property path")}return A.split(".").reduce(B,g)}var t1={GeoJSON2SVG:BC};class xC{constructor(A){DB(this,"_state");this._state=A}static cleanFeature(A){A={type:A.type,geometry:{...A.geometry},properties:{...A.properties}};for(const Q in A.properties)Q==="_lon"||Q==="_lat"||Q.startsWith("_")&&delete A.properties[Q];const B=[].concat(mM.metatags.filter(Q=>Q.includesDates).map(Q=>Q.keys));for(const Q of B)delete A.properties[Q];return A}getCleanGeoJson(A){const B=this.getCleanGeoJsonPerLayer(A);return{type:"FeatureCollection",features:[].concat(...Array.from(B.values()))}}asSvg(A){var n,i,a;const B=this._state.perLayer;A=A??{};const Q=A.width??1e3,w=A.height??1e3;if(Q 0";const E=A.unit??"px",e={left:-180,bottom:-90,right:180,top:90};if(A.mapExtent!==void 0){const G=A.mapExtent;e.left=G.minLon,e.right=G.maxLon,e.bottom=G.minLat,e.top=G.maxLat}console.log("Generateing svg, extent:",{mapExtent:e,width:Q,height:w});const t=[];for(const G of Array.from(B.keys())){let F=B.get(G).features.data;if(F.length===0)continue;const T=(n=A==null?void 0:A.layers)==null?void 0:n.find(QA=>QA.id===G),N=T==null?void 0:T.lineRendering[0],L=new t1.GeoJSON2SVG({viewportSize:{width:Q,height:w},mapExtent:e,output:"svg",attributes:[{property:"style",type:"static",value:"fill:none;stroke-width:1"},{property:"properties.stroke",type:"dynamic",key:"stroke"}]});A.noSelfIntersectingLines&&(F=AC.SplitSelfIntersectingWays(F));for(const QA of F){const DA=((a=(i=N==null?void 0:N.color)==null?void 0:i.GetRenderValue(QA.properties))==null?void 0:a.txt)??"#ff0000";QA.properties.stroke=cQ.colorAsHex(cQ.color(DA))}const H=L.convert({type:"FeatureCollection",features:F}),j=`
`+H.map(QA=>" "+QA).join(`
`)+`
`;t.push(j)}const r=Q,D=w;return``+`
`+t.join(`
`)+`
`}getCleanGeoJsonPerLayer(A){const B=this._state,Q=new Map,w=B.theme.layers.filter(e=>e.source!==null).map(e=>e.id),E=B.mapProperties.bounds.data;for(const e of w){let r=B.perLayer.get(e).GetFeaturesWithin(E);const D=B.layerState.filteredLayers.get(e);r=r.filter(C=>D.isShown(C.properties,B.layerState.globalFilters.data)),A||(r=r.map(C=>xC.cleanFeature(C))),Q.set(e,r)}return Q}createImage(A,B,Q){const w=document.createElement("img"),E={layouticon:this._state.theme.icon};if(w.src=E[A],!w.src)throw"Invalid key for 'createImage': "+A+"; try one of: "+Object.keys(E).join(", ");return w.style.width=B,w.style.height=Q,console.log("Fetching an image with src",w.src),w}}const r1=g=>({}),AD=g=>({});function C1(g){let A,B,Q,w,E,e,t,r,D;const C=g[12].image,n=jQ(C,g,g[13],AD),i=n||o1();return w=new SA({props:{t:g[0]}}),e=new SA({props:{t:g[1],cls:"subtle"}}),{c(){A=nA("button"),i&&i.c(),B=wA(),Q=nA("span"),m(w.$$.fragment),E=wA(),m(e.$$.fragment),s(Q,"class","flex flex-col items-start"),s(A,"class","w-full"),M(A,"justify-content","start")},m(a,G){sA(a,A,G),i&&i.m(A,null),c(A,B),c(A,Q),b(w,Q,null),c(Q,E),b(e,Q,null),t=!0,r||(D=yA(A,"click",g[7]),r=!0)},p(a,G){n&&n.p&&(!t||G&8192)&&mQ(n,C,a,a[13],t?OQ(C,a[13],G,r1):bQ(a[13]),AD);const F={};G&1&&(F.t=a[0]),w.$set(F);const T={};G&2&&(T.t=a[1]),e.$set(T)},i(a){t||(R(i,a),R(w.$$.fragment,a),R(e.$$.fragment,a),t=!0)},o(a){U(i,a),U(w.$$.fragment,a),U(e.$$.fragment,a),t=!1},d(a){a&&tA(A),i&&i.d(a),O(w),O(e),r=!1,D()}}}function i1(g){let A,B;return A=new Fs({props:{$$slots:{default:[c1]},$$scope:{ctx:g}}}),{c(){m(A.$$.fragment)},m(Q,w){b(A,Q,w),B=!0},p(Q,w){const E={};w&8208&&(E.$$scope={dirty:w,ctx:Q}),A.$set(E)},i(Q){B||(R(A.$$.fragment,Q),B=!0)},o(Q){U(A.$$.fragment,Q),B=!1},d(Q){O(A,Q)}}}function D1(g){let A,B;return A=new SA({props:{cls:"alert",t:QB.t.general.error}}),{c(){m(A.$$.fragment)},m(Q,w){b(A,Q,w),B=!0},p:VA,i(Q){B||(R(A.$$.fragment,Q),B=!0)},o(Q){U(A.$$.fragment,Q),B=!1},d(Q){O(A,Q)}}}function o1(g){let A,B;return A=new uC({props:{class:"mr-2 h-12 w-12 shrink-0"}}),{c(){m(A.$$.fragment)},m(Q,w){b(A,Q,w),B=!0},p:VA,i(Q){B||(R(A.$$.fragment,Q),B=!0)},o(Q){U(A.$$.fragment,Q),B=!1},d(Q){O(A,Q)}}}function M1(g){let A,B;return A=new SA({props:{t:g[5].exporting}}),{c(){m(A.$$.fragment)},m(Q,w){b(A,Q,w),B=!0},p:VA,i(Q){B||(R(A.$$.fragment,Q),B=!0)},o(Q){U(A.$$.fragment,Q),B=!1},d(Q){O(A,Q)}}}function n1(g){let A;return{c(){A=RB(g[4])},m(B,Q){sA(B,A,Q)},p(B,Q){Q&16&&YQ(A,B[4])},i:VA,o:VA,d(B){B&&tA(A)}}}function c1(g){let A,B,Q,w;const E=[n1,M1],e=[];function t(r,D){return r[4]?0:1}return A=t(g),B=e[A]=E[A](g),{c(){B.c(),Q=PQ()},m(r,D){e[A].m(r,D),sA(r,Q,D),w=!0},p(r,D){let C=A;A=t(r),A===C?e[A].p(r,D):(nB(),U(e[C],1,1,()=>{e[C]=null}),cB(),B=e[A],B?B.p(r,D):(B=e[A]=E[A](r),B.c()),R(B,1),B.m(Q.parentNode,Q))},i(r){w||(R(B),w=!0)},o(r){U(B),w=!1},d(r){e[A].d(r),r&&tA(Q)}}}function I1(g){let A,B,Q,w;const E=[D1,i1,C1],e=[];function t(r,D){return r[3]?0:r[2]?1:2}return A=t(g),B=e[A]=E[A](g),{c(){B.c(),Q=PQ()},m(r,D){e[A].m(r,D),sA(r,Q,D),w=!0},p(r,[D]){let C=A;A=t(r),A===C?e[A].p(r,D):(nB(),U(e[C],1,1,()=>{e[C]=null}),cB(),B=e[A],B?B.p(r,D):(B=e[A]=E[A](r),B.c()),R(B,1),B.m(Q.parentNode,Q))},i(r){w||(R(B),w=!0)},o(r){U(B),w=!1},d(r){e[A].d(r),r&&tA(Q)}}}function a1(g,A,B){let Q,{$$slots:w={},$$scope:E}=A,{state:e}=A,{extension:t}=A,{mimetype:r}=A,{construct:D}=A,{mainText:C}=A,{helperText:n}=A;const i=QB.t.general.download;let a=!1,G=!1,F=new RQ(void 0);oB(g,F,N=>B(4,Q=N));async function T(){B(2,a=!0);const N=e.layerState.filteredLayers.get("gps_location");B(8,e.userRelatedState.preferencesAsTags.data.__showTimeSensitiveIcons="no",e),e.userRelatedState.preferencesAsTags.ping();const L=N.isDisplayed.data;try{N.isDisplayed.setData(!1);const j=`MapComplete_${e.theme.id}_export_${new Date().toISOString().substr(0,19)}.${t}`,QA=await D(j,F);if(!QA)return;console.log("Got data",QA),cQ.offerContentsAsDownloadableFile(QA,j,{mimetype:r})}catch(H){B(3,G=!0),console.error(H)}finally{B(2,a=!1),N.isDisplayed.setData(L),B(8,e.userRelatedState.preferencesAsTags.data.__showTimeSensitiveIcons="yes",e),e.userRelatedState.preferencesAsTags.ping()}}return g.$$set=N=>{"state"in N&&B(8,e=N.state),"extension"in N&&B(9,t=N.extension),"mimetype"in N&&B(10,r=N.mimetype),"construct"in N&&B(11,D=N.construct),"mainText"in N&&B(0,C=N.mainText),"helperText"in N&&B(1,n=N.helperText),"$$scope"in N&&B(13,E=N.$$scope)},[C,n,a,G,Q,i,F,T,e,t,r,D,w,E]}class tr extends aB{constructor(A){super(),lB(this,A,a1,I1,IB,{state:8,extension:9,mimetype:10,construct:11,mainText:0,helperText:1})}}function FQ(g){"@babel/helpers - typeof";return FQ=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},FQ(g)}var pB=function(){return typeof window=200&&A.status"u"?"undefined":FQ(window))!=="object"||window!==pB?function(){}:typeof HTMLAnchorElement"u"?"undefined":FQ(FileReader))==="object"){var t=new FileReader;t.onloadend=function(){var C=t.result;C=e?C:C.replace(/^data:[^;]*;/,"data:attachment/file;"),Q?Q.location.href=C:location=C,Q=null},t.readAsDataURL(g)}else{var r=pB.URL||pB.webkitURL,D=r.createObjectURL(g);Q?Q.location=D:location.href=D,Q=null,setTimeout(function(){r.revokeObjectURL(D)},4e4)}});/**
* A class to parse color values
* @author Stoyan Stefanov
* {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
* @license Use it if you like it
*/function MM(g){var A;g=g||"",this.ok=!1,g.charAt(0)=="#"&&(g=g.substr(1,6)),g={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[g=(g=g.replace(/ /g,"")).toLowerCase()]||g;for(var B=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],Q=0;Q255?255:this.r,this.g=this.g255?255:this.g,this.b=this.b255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var t=this.r.toString(16),r=this.g.toString(16),D=this.b.toString(16);return t.length==1&&(t="0"+t),r.length==1&&(r="0"+r),D.length==1&&(D="0"+D),"#"+t+r+D}}/**
* @license
* Joseph Myers does not specify a particular license for his work.
*
* Author: Joseph Myers
* Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
*
* Modified by: Owen Leong
*/function VC(g,A){var B=g[0],Q=g[1],w=g[2],E=g[3];B=OE(B,Q,w,E,A[0],7,-680876936),E=OE(E,B,Q,w,A[1],12,-389564586),w=OE(w,E,B,Q,A[2],17,606105819),Q=OE(Q,w,E,B,A[3],22,-1044525330),B=OE(B,Q,w,E,A[4],7,-176418897),E=OE(E,B,Q,w,A[5],12,1200080426),w=OE(w,E,B,Q,A[6],17,-1473231341),Q=OE(Q,w,E,B,A[7],22,-45705983),B=OE(B,Q,w,E,A[8],7,1770035416),E=OE(E,B,Q,w,A[9],12,-1958414417),w=OE(w,E,B,Q,A[10],17,-42063),Q=OE(Q,w,E,B,A[11],22,-1990404162),B=OE(B,Q,w,E,A[12],7,1804603682),E=OE(E,B,Q,w,A[13],12,-40341101),w=OE(w,E,B,Q,A[14],17,-1502002290),B=vE(B,Q=OE(Q,w,E,B,A[15],22,1236535329),w,E,A[1],5,-165796510),E=vE(E,B,Q,w,A[6],9,-1069501632),w=vE(w,E,B,Q,A[11],14,643717713),Q=vE(Q,w,E,B,A[0],20,-373897302),B=vE(B,Q,w,E,A[5],5,-701558691),E=vE(E,B,Q,w,A[10],9,38016083),w=vE(w,E,B,Q,A[15],14,-660478335),Q=vE(Q,w,E,B,A[4],20,-405537848),B=vE(B,Q,w,E,A[9],5,568446438),E=vE(E,B,Q,w,A[14],9,-1019803690),w=vE(w,E,B,Q,A[3],14,-187363961),Q=vE(Q,w,E,B,A[8],20,1163531501),B=vE(B,Q,w,E,A[13],5,-1444681467),E=vE(E,B,Q,w,A[2],9,-51403784),w=vE(w,E,B,Q,A[7],14,1735328473),B=VE(B,Q=vE(Q,w,E,B,A[12],20,-1926607734),w,E,A[5],4,-378558),E=VE(E,B,Q,w,A[8],11,-2022574463),w=VE(w,E,B,Q,A[11],16,1839030562),Q=VE(Q,w,E,B,A[14],23,-35309556),B=VE(B,Q,w,E,A[1],4,-1530992060),E=VE(E,B,Q,w,A[4],11,1272893353),w=VE(w,E,B,Q,A[7],16,-155497632),Q=VE(Q,w,E,B,A[10],23,-1094730640),B=VE(B,Q,w,E,A[13],4,681279174),E=VE(E,B,Q,w,A[0],11,-358537222),w=VE(w,E,B,Q,A[3],16,-722521979),Q=VE(Q,w,E,B,A[6],23,76029189),B=VE(B,Q,w,E,A[9],4,-640364487),E=VE(E,B,Q,w,A[12],11,-421815835),w=VE(w,E,B,Q,A[15],16,530742520),B=WE(B,Q=VE(Q,w,E,B,A[2],23,-995338651),w,E,A[0],6,-198630844),E=WE(E,B,Q,w,A[7],10,1126891415),w=WE(w,E,B,Q,A[14],15,-1416354905),Q=WE(Q,w,E,B,A[5],21,-57434055),B=WE(B,Q,w,E,A[12],6,1700485571),E=WE(E,B,Q,w,A[3],10,-1894986606),w=WE(w,E,B,Q,A[10],15,-1051523),Q=WE(Q,w,E,B,A[1],21,-2054922799),B=WE(B,Q,w,E,A[8],6,1873313359),E=WE(E,B,Q,w,A[15],10,-30611744),w=WE(w,E,B,Q,A[6],15,-1560198380),Q=WE(Q,w,E,B,A[13],21,1309151649),B=WE(B,Q,w,E,A[4],6,-145523070),E=WE(E,B,Q,w,A[11],10,-1120210379),w=WE(w,E,B,Q,A[2],15,718787259),Q=WE(Q,w,E,B,A[9],21,-343485551),g[0]=B0(B,g[0]),g[1]=B0(Q,g[1]),g[2]=B0(w,g[2]),g[3]=B0(E,g[3])}function HC(g,A,B,Q,w,E){return A=B0(B0(A,g),B0(Q,E)),B0(A>>32-w,B)}function OE(g,A,B,Q,w,E,e){return HC(A&B|~A&Q,g,A,w,E,e)}function vE(g,A,B,Q,w,E,e){return HC(A&Q|B&~Q,g,A,w,E,e)}function VE(g,A,B,Q,w,E,e){return HC(A^B^Q,g,A,w,E,e)}function WE(g,A,B,Q,w,E,e){return HC(B^(A|~Q),g,A,w,E,e)}function nM(g){var A,B=g.length,Q=[1732584193,-271733879,-1732584194,271733878];for(A=64;A>2]|=g.charCodeAt(A)>2]|=12855)for(VC(Q,w),A=0;A>2]=g.charCodeAt(A)+(g.charCodeAt(A+1)>8*B+4&15]+QD[g>>8*B&15];return A}function h1(g){return String.fromCharCode((255&g)>>0,(65280&g)>>8,(16711680&g)>>16,(4278190080&g)>>24)}function wi(g){return nM(g).map(h1).join("")}var u1=function(g){for(var A=0;A>16)+(A>>16)+(B>>16)>0),new Array(E+1).join(w)),t=[],r=0;r\b..\0¶Ðh>/\f©þdSiz";var E=(A+this.padding).substr(0,32),e=(B+this.padding).substr(0,32);this.O=this.processOwnerPassword(E,e),this.P=-(1+(255^w)),this.encryptionKey=wi(E+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(Q)).substr(0,5),this.U=ei(this.encryptionKey,this.padding)}function Kr(g){if(/[^\u0000-\u00ff]/.test(g))throw new Error("Invalid PDF Name Object: "+g+", Only accept ASCII characters.");for(var A="",B=g.length,Q=0;Q126?A+="#"+("0"+w.toString(16)).slice(-2):A+=g[Q]}return A}function ED(g){if(FQ(g)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var A={};this.subscribe=function(B,Q,w){if(w=w||!1,typeof B!="string"||typeof Q!="function"||typeof w!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");A.hasOwnProperty(B)||(A[B]={});var E=Math.random().toString(35);return A[B][E]=[Q,!!w],E},this.unsubscribe=function(B){for(var Q in A)if(A[Q][B])return delete A[Q][B],Object.keys(A[Q]).length===0&&delete A[Q],!0;return!1},this.publish=function(B){if(A.hasOwnProperty(B)){var Q=Array.prototype.slice.call(arguments,1),w=[];for(var E in A[B]){var e=A[B][E];try{e[0].apply(g,Q)}catch(t){pB.console&&fQ.error("jsPDF PubSub Error",t.message,t)}e[1]&&w.push(E)}w.length&&w.forEach(this.unsubscribe)}},this.getTopics=function(){return A}}function RC(g){if(!(this instanceof RC))return new RC(g);var A="opacity,stroke-opacity".split(",");for(var B in g)g.hasOwnProperty(B)&&A.indexOf(B)>=0&&(this[B]=g[B]);this.id="",this.objectNumber=-1}function cM(g,A){this.gState=g,this.matrix=A,this.id="",this.objectNumber=-1}function Cr(g,A,B,Q,w){if(!(this instanceof Cr))return new Cr(g,A,B,Q,w);this.type=g==="axial"?2:3,this.coords=A,this.colors=B,cM.call(this,Q,w)}function kr(g,A,B,Q,w){if(!(this instanceof kr))return new kr(g,A,B,Q,w);this.boundingBox=g,this.xStep=A,this.yStep=B,this.stream="",this.cloneIndex=0,cM.call(this,Q,w)}function YB(g){var A,B=typeof arguments[0]=="string"?arguments[0]:"p",Q=arguments[1],w=arguments[2],E=arguments[3],e=[],t=1,r=16,D="S",C=null;FQ(g=g||{})==="object"&&(B=g.orientation,Q=g.unit||Q,w=g.format||w,E=g.compress||g.compressPdf||E,(C=g.encryption||null)!==null&&(C.userPassword=C.userPassword||"",C.ownerPassword=C.ownerPassword||"",C.userPermissions=C.userPermissions||[]),t=typeof g.userUnit=="number"?Math.abs(g.userUnit):1,g.precision!==void 0&&(A=g.precision),g.floatPrecision!==void 0&&(r=g.floatPrecision),D=g.defaultPathOperation||"S"),e=g.filters||(E===!0?["FlateEncode"]:e),Q=Q||"mm",B=(""+(B||"P")).toLowerCase();var n=g.putOnlyUsedFonts||!1,i={},a={internal:{},__private__:{}};a.__private__.PubSub=ED;var G="1.3",F=a.__private__.getPdfVersion=function(){return G};a.__private__.setPdfVersion=function(l){G=l};var T={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};a.__private__.getPageFormats=function(){return T};var N=a.__private__.getPageFormat=function(l){return T[l]};w=w||"a4";var L={COMPAT:"compat",ADVANCED:"advanced"},H=L.COMPAT;function j(){this.saveGraphicsState(),Z(new hB(_A,0,0,-_A,0,Wg()*_A).toString()+" cm"),this.setFontSize(this.getFontSize()/_A),D="n",H=L.ADVANCED}function QA(){this.restoreGraphicsState(),D="S",H=L.COMPAT}var DA=a.__private__.combineFontStyleAndFontWeight=function(l,f){if(l=="bold"&&f=="normal"||l=="bold"&&f==400||l=="normal"&&f=="italic"||l=="bold"&&f=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return f&&(l=f==400||f==="normal"?l==="italic"?"italic":"normal":f!=700&&f!=="bold"||l!=="normal"?(f==700?"bold":f)+""+l:"bold"),l};a.advancedAPI=function(l){var f=H===L.COMPAT;return f&&j.call(this),typeof l!="function"||(l(this),f&&QA.call(this)),this},a.compatAPI=function(l){var f=H===L.ADVANCED;return f&&QA.call(this),typeof l!="function"||(l(this),f&&j.call(this)),this},a.isAdvancedAPI=function(){return H===L.ADVANCED};var q,x=function(l){if(H!==L.ADVANCED)throw new Error(l+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},$=a.roundToPrecision=a.__private__.roundToPrecision=function(l,f){var EA=A||f;if(isNaN(l)||isNaN(EA))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return l.toFixed(EA).replace(/0+$/,"")};q=a.hpf=a.__private__.hpf=typeof r=="number"?function(l){if(isNaN(l))throw new Error("Invalid argument passed to jsPDF.hpf");return $(l,r)}:r==="smart"?function(l){if(isNaN(l))throw new Error("Invalid argument passed to jsPDF.hpf");return $(l,l>-1&&l>16&255,uA=GB>>8&255,YA=255&GB}if(uA===void 0||zA===void 0&&EA===uA&&uA===YA)if(typeof EA=="string")f=EA+" "+ZA[0];else switch(l.precision){case 2:f=lA(EA/255)+" "+ZA[0];break;case 3:default:f=K(EA/255)+" "+ZA[0]}else if(zA===void 0||FQ(zA)==="object"){if(zA&&!isNaN(zA.a)&&zA.a===0)return f=["1.","1.","1.",ZA[1]].join(" ");if(typeof EA=="string")f=[EA,uA,YA,ZA[1]].join(" ");else switch(l.precision){case 2:f=[lA(EA/255),lA(uA/255),lA(YA/255),ZA[1]].join(" ");break;default:case 3:f=[K(EA/255),K(uA/255),K(YA/255),ZA[1]].join(" ")}}else if(typeof EA=="string")f=[EA,uA,YA,zA,ZA[2]].join(" ");else switch(l.precision){case 2:f=[lA(EA),lA(uA),lA(YA),lA(zA),ZA[2]].join(" ");break;case 3:default:f=[K(EA),K(uA),K(YA),K(zA),ZA[2]].join(" ")}return f},OB=a.__private__.getFilters=function(){return e},eg=a.__private__.putStream=function(l){var f=(l=l||{}).data||"",EA=l.filters||OB(),uA=l.alreadyAppliedFilters||[],YA=l.addLength1||!1,zA=f.length,ZA=l.objectId,sB=function(NQ){return NQ};if(C!==null&&ZA===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");C!==null&&(sB=$Q.encryptor(ZA,0));var GB={};EA===!0&&(EA=["FlateEncode"]);var xB=l.additionalKeyValues||[],kB=(GB=YB.API.processDataByFilters!==void 0?YB.API.processDataByFilters(f,EA):{data:f,reverseChain:[]}).reverseChain+(Array.isArray(uA)?uA.join(" "):uA.toString());if(GB.data.length!==0&&(xB.push({key:"Length",value:GB.data.length}),YA===!0&&xB.push({key:"Length1",value:zA})),kB.length!=0)if(kB.split("/").length-1==1)xB.push({key:"Filter",value:kB});else{xB.push({key:"Filter",value:"["+kB+"]"});for(var zB=0;zB>"),GB.data.length!==0&&(Z("stream"),Z(sB(GB.data)),Z("endstream"))},hg=a.__private__.putPage=function(l){var f=l.number,EA=l.data,uA=l.objId,YA=l.contentsObjId;wg(uA,!0),Z(">"),Z("endobj");var zA=EA.join(`
`);return H===L.ADVANCED&&(zA+=`
Q`),wg(YA,!0),eg({data:zA,filters:OB(),objectId:YA}),Z("endobj"),uA},NE=a.__private__.putPages=function(){var l,f,EA=[];for(l=1;l>"),Z("endobj"),qB.publish("postPutPages")},TE=function(l){qB.publish("putFont",{font:l,out:Z,newObject:hQ,putStream:eg}),l.isAlreadyPutted!==!0&&(l.objectNumber=hQ(),Z(">"),Z("endobj"))},eE=function(){for(var l in WB)WB.hasOwnProperty(l)&&(n===!1||n===!0&&i.hasOwnProperty(l))&&TE(WB[l])},SQ=function(l){l.objectNumber=hQ();var f=[];f.push({key:"Type",value:"/XObject"}),f.push({key:"Subtype",value:"/Form"}),f.push({key:"BBox",value:"["+[q(l.x),q(l.y),q(l.x+l.width),q(l.y+l.height)].join(" ")+"]"}),f.push({key:"Matrix",value:"["+l.matrix.toString()+"]"});var EA=l.pages[1].join(`
`);eg({data:EA,additionalKeyValues:f,objectId:l.objectNumber}),Z("endobj")},fB=function(){for(var l in yQ)yQ.hasOwnProperty(l)&&SQ(yQ[l])},Uw=function(l,f){var EA,uA=[],YA=1/(f-1);for(EA=0;EAl[GB+1].offset;)GB++;var kB=l[GB].offset,zB=(EA-kB)/(l[GB+1].offset-kB),wQ=l[GB].color,sQ=l[GB+1].color;sB+=CA(Math.round((1-zB)*wQ[0]+zB*sQ[0]).toString(16))+CA(Math.round((1-zB)*wQ[1]+zB*sQ[1]).toString(16))+CA(Math.round((1-zB)*wQ[2]+zB*sQ[2]).toString(16))}return sB.trim()},ZE=function(l,f){f||(f=21);var EA=hQ(),uA=Uw(l.colors,f),YA=[];YA.push({key:"FunctionType",value:"0"}),YA.push({key:"Domain",value:"[0.0 1.0]"}),YA.push({key:"Size",value:"["+f+"]"}),YA.push({key:"BitsPerSample",value:"8"}),YA.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),YA.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),eg({data:uA,additionalKeyValues:YA,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:EA}),Z("endobj"),l.objectNumber=hQ(),Z(">"),Z("endobj")},Lw=function(l,f){var EA=rQ(),uA=hQ();f.push({resourcesOid:EA,objectOid:uA}),l.objectNumber=uA;var YA=[];YA.push({key:"Type",value:"/Pattern"}),YA.push({key:"PatternType",value:"1"}),YA.push({key:"PaintType",value:"1"}),YA.push({key:"TilingType",value:"1"}),YA.push({key:"BBox",value:"["+l.boundingBox.map(q).join(" ")+"]"}),YA.push({key:"XStep",value:q(l.xStep)}),YA.push({key:"YStep",value:q(l.yStep)}),YA.push({key:"Resources",value:EA+" 0 R"}),l.matrix&&YA.push({key:"Matrix",value:"["+l.matrix.toString()+"]"}),eg({data:l.stream,additionalKeyValues:YA,objectId:l.objectNumber}),Z("endobj")},ug=function(l){var f;for(f in VB)VB.hasOwnProperty(f)&&(VB[f]instanceof Cr?ZE(VB[f]):VB[f]instanceof kr&&Lw(VB[f],l))},k=function(l){for(var f in l.objectNumber=hQ(),Z(">"),Z("endobj")},v=function(){var l;for(l in gQ)gQ.hasOwnProperty(l)&&k(gQ[l])},MA=function(){for(var l in Z("/XObject =0&&Z("/"+l+" "+yQ[l].objectNumber+" 0 R");qB.publish("putXobjectDict"),Z(">>")},_=function(){$Q.oid=hQ(),Z(""),Z("/O "),Z("/P "+$Q.P),Z(">>"),Z("endobj")},dA=function(){for(var l in Z("/Font >")},XA=function(){if(Object.keys(VB).length>0){for(var l in Z("/Shading =0&&Z("/"+l+" "+VB[l].objectNumber+" 0 R");qB.publish("putShadingPatternDict"),Z(">>")}},Ng=function(l){if(Object.keys(VB).length>0){for(var f in Z("/Pattern =0&&VB[f].objectNumber>")}},rw=function(){if(Object.keys(gQ).length>0){var l;for(l in Z("/ExtGState =0&&Z("/"+l+" "+gQ[l].objectNumber+" 0 R");qB.publish("putGStateDict"),Z(">>")}},CQ=function(l){wg(l.resourcesOid,!0),Z(">"),Z("endobj")},qE=function(){var l=[];eE(),v(),fB(),ug(l),qB.publish("putResources"),l.forEach(CQ),CQ({resourcesOid:ig,objectOid:Number.MAX_SAFE_INTEGER}),qB.publish("postPutResources")},Tg=function(){qB.publish("putAdditionalObjects");for(var l=0;l>8&&(GB=!0);l=sB.join("")}for(EA=l.length;GB===void 0&&EA!==0;)l.charCodeAt(EA-1)>>8&&(GB=!0),EA--;if(!GB)return l;for(sB=f.noBOM?[]:[254,255],EA=0,uA=l.length;EA>8)>>8)throw new Error("Character at position "+EA+" of string '"+l+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");sB.push(kB),sB.push(xB-(kB14400||YA>14400)&&(fQ.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),uA=Math.min(14400,uA),YA=Math.min(14400,YA)),w=[uA,YA],B.substr(0,1)){case"l":YA>uA&&(w=[YA,uA]);break;case"p":uA>YA&&(w=[YA,uA])}he(w),Aw(RE),Z(Ag),iE!==0&&Z(iE+" J"),DE!==0&&Z(DE+" j"),qB.publish("addPage",{pageNumber:EQ})},Ts=function(l){l>0&&lEQ&&(V=EQ),this.setPage(V))},We=function(l){l>0&&l>"),Z("endobj")},Ne=a.__private__.putCatalog=function(l){var f=(l=l||{}).rootDictionaryObjId||oQ;switch(hQ(),Z(">"),Z("endobj")},ys=a.__private__.putTrailer=function(){Z("trailer"),Z(" ]"),Z(">>")},Us=a.__private__.putHeader=function(){Z("%PDF-"+G),Z("%ºß¬à")},Ls=a.__private__.putXRef=function(){var l="0000000000";Z("xref"),Z("0 "+(TA+1)),Z("0000000000 65535 f ");for(var f=1;f
",sB=pB.open();return sB!==null&&sB.document.write(ZA),sB}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(pB)==="[object Window]"){var GB='