vendor: 5,027 bytes, lines 1-14
1/*! ***************************************************************************** 2Copyright (c) Microsoft Corporation. 3 4Permission to use, copy, modify, and/or distribute this software for any 5purpose with or without fee is hereby granted. 6 7THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 8REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 9AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 10INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 11LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 12OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 13PERFORMANCE OF THIS SOFTWARE. 14***************************************************************************** */function A(o,e,i,r){function s(t){return t instanceof i?t:new i(function(n){n(t)})}return new(i||(i=Promise))(function(t,n){function a(l){try{c(r.next(l))}catch(h){n(h)}}function u(l){try{c(r.throw(l))}catch(h){n(h)}}function c(l){l.done?t(l.value):s(l.value).then(a,u)}c((r=r.apply(o,e||[])).next())})}var P=function o(e,i){if(e===i)return!0;if(e&&i&&typeof e=="object"&&typeof i=="object"){if(e.constructor!==i.constructor)return!1;var r,s,t;if(Array.isArray(e)){if(r=e.length,r!=i.length)return!1;for(s=r;s--!==0;)if(!o(e[s],i[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===i.source&&e.flags===i.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===i.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===i.toString();if(t=Object.keys(e),r=t.length,r!==Object.keys(i).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(i,t[s]))return!1;for(s=r;s--!==0;){var n=t[s];if(!o(e[n],i[n]))return!1}return!0}return e!==e&&i!==i};const S="__googleMapsScriptId";var p;(function(o){o[o.INITIALIZED=0]="INITIALIZED",o[o.LOADING=1]="LOADING",o[o.SUCCESS=2]="SUCCESS",o[o.FAILURE=3]="FAILURE"})(p||(p={}));class f{constructor({apiKey:e,authReferrerPolicy:i,channel:r,client:s,id:t=S,language:n,libraries:a=[],mapIds:u,nonce:c,region:l,retries:h=3,url:m="https://maps.googleapis.com/maps/api/js",version:d}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=e,this.authReferrerPolicy=i,this.channel=r,this.client=s,this.id=t||S,this.language=n,this.libraries=a,this.mapIds=u,this.nonce=c,this.region=l,this.retries=h,this.url=m,this.version=d,f.instance){if(!P(this.options,f.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(f.instance.options)}`);return f.instance}f.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?p.FAILURE:this.done?p.SUCCESS:this.loading?p.LOADING:p.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback=__googleMapsCallback",this.apiKey&&(e+=`&key=${this.apiKey}`),this.channel&&(e+=`&channel=${this.channel}`),this.client&&(e+=`&client=${this.client}`),this.libraries.length>0&&(e+=`&libraries=${this.libraries.join(",")}`),this.language&&(e+=`&language=${this.language}`),this.region&&(e+=`®ion=${this.region}`),this.version&&(e+=`&v=${this.version}`),this.mapIds&&(e+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(e+=`&auth_referrer_policy=${this.authReferrerPolicy}`),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,i)=>{this.loadCallback(r=>{r?i(r.error):e(window.google)})})}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){var e,i;if(document.getElementById(this.id)){this.callback();return}const r={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(r).forEach(t=>!r[t]&&delete r[t]),!((i=(e=window==null?void 0:window.google)===null||e===void 0?void 0:e.maps)===null||i===void 0)&&i.importLibrary||(t=>{let n,a,u,c="The Google Maps JavaScript API",l="google",h="importLibrary",m="__ib__",d=document,g=window;g=g[l]||(g[l]={});const y=g.maps||(g.maps={}),E=new Set,v=new URLSearchParams,k=()=>n||(n=new Promise((b,w)=>A(this,void 0,void 0,function*(){var I;yield a=d.createElement("script"),a.id=this.id,v.set("libraries",[...E]+"");for(u in t)v.set(u.replace(/[A-Z]/g,O=>"_"+O[0].toLowerCase()),t[u]);v.set("callback",l+".maps."+m),a.src=this.url+"?"+v,y[m]=b,a.onerror=()=>n=w(Error(c+" could not load.")),a.nonce=this.nonce||((I=d.querySelector("script[n
14once]"))===null||I===void 0?void 0:I.nonce)||"",d.head.append(a)})));y[h]?console.warn(c+" only loads once. Ignoring:",t):y[h]=(b,...w)=>E.add(b)&&k().then(()=>y[h](b,...w))})(r);const s=this.libraries.map(t=>this.importLibrary(t));s.length||s.push(this.importLibrary("core")),Promise.all(s).then(()=>this.callback(),t=>{const n=new ErrorEvent("error",{error:t});this.loadErrorCallback(n)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){const i=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${i} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},i)}else this.onerrorEvent=e,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version){console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),this.callback();return}this.loading||(this.loading=!0,this.setScript())}}}export{f as L};
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.