/*!
 * Copyright (c) what3words http://what3words.com
 */
import{g as t,a as n,u as o,S as s,c as a}from"./p-BtTtF6d2.js";const e=async function(){var e;const r=window,{w3w:i={}}=r,{callback:l,key:c,host:u,version:f,headers:p}=i,h=t(),d=null!=c?c:h[s.KEY];if(d&&(n.api.setApiKey(d),o.setApiKey(d)),(u||h[s.BASEURL])&&n.api.setConfig({host:null!=u?u:h[s.BASEURL]}),(f||h[s.VERSION])&&n.api.setConfig({apiVersion:null!=f?f:h[s.VERSION]}),p&&n.api.setConfig({headers:p}),r.what3words=n,!r.sessionStorage.getItem(a)){const{v4:t}=await import("./p-4ePKl-vU.js");r.sessionStorage.setItem(a,t({rng:()=>{const t=[];for(let n=0;n<16;n++)t.push(Math.round(255*Math.random()));return t}}))}r.what3words_session_id=r.sessionStorage.getItem(a),l&&"function"==typeof r[l]&&r[l](n),h[s.CALLBACK]&&"function"==typeof r[h[s.CALLBACK]]&&(null===(e=r[h[s.CALLBACK]])||void 0===e||e.call(r))};export{e as g}