@naver-maps/react
Version:
NaverMaps Component For React or Next
28 lines (24 loc) • 23.9 kB
JavaScript
(function(L,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],T):(L=typeof globalThis<"u"?globalThis:L||self,T(L.index={},L.React))})(this,function(L,T){"use strict";var fe={exports:{}},H={};/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Te;function rr(){if(Te)return H;Te=1;var r=T,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function f(h,p,m){var y,w={},A=null,K=null;m!==void 0&&(A=""+m),p.key!==void 0&&(A=""+p.key),p.ref!==void 0&&(K=p.ref);for(y in p)a.call(p,y)&&!u.hasOwnProperty(y)&&(w[y]=p[y]);if(h&&h.defaultProps)for(y in p=h.defaultProps,p)w[y]===void 0&&(w[y]=p[y]);return{$$typeof:t,type:h,key:A,ref:K,props:w,_owner:s.current}}return H.Fragment=n,H.jsx=f,H.jsxs=f,H}var $={};/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Se;function tr(){return Se||(Se=1,process.env.NODE_ENV!=="production"&&function(){var r=T,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),h=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),K=Symbol.for("react.offscreen"),ae=Symbol.iterator,ie="@@iterator";function _r(e){if(e===null||typeof e!="object")return null;var i=ae&&e[ae]||e[ie];return typeof i=="function"?i:null}var G=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(e){{for(var i=arguments.length,o=new Array(i>1?i-1:0),c=1;c<i;c++)o[c-1]=arguments[c];wr("error",e,o)}}function wr(e,i,o){{var c=G.ReactDebugCurrentFrame,g=c.getStackAddendum();g!==""&&(i+="%s",o=o.concat([g]));var b=o.map(function(d){return String(d)});b.unshift("Warning: "+i),Function.prototype.apply.call(console[e],console,b)}}var Tr=!1,Sr=!1,Or=!1,Cr=!1,Pr=!1,Ae;Ae=Symbol.for("react.module.reference");function jr(e){return!!(typeof e=="string"||typeof e=="function"||e===a||e===u||Pr||e===s||e===m||e===y||Cr||e===K||Tr||Sr||Or||typeof e=="object"&&e!==null&&(e.$$typeof===A||e.$$typeof===w||e.$$typeof===f||e.$$typeof===h||e.$$typeof===p||e.$$typeof===Ae||e.getModuleId!==void 0))}function xr(e,i,o){var c=e.displayName;if(c)return c;var g=i.displayName||i.name||"";return g!==""?o+"("+g+")":o}function ke(e){return e.displayName||"Context"}function D(e){if(e==null)return null;if(typeof e.tag=="number"&&C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case a:return"Fragment";case n:return"Portal";case u:return"Profiler";case s:return"StrictMode";case m:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case h:var i=e;return ke(i)+".Consumer";case f:var o=e;return ke(o._context)+".Provider";case p:return xr(e,e.render,"ForwardRef");case w:var c=e.displayName||null;return c!==null?c:D(e.type)||"Memo";case A:{var g=e,b=g._payload,d=g._init;try{return D(d(b))}catch{return null}}}return null}var B=Object.assign,Q=0,Ie,Me,Ne,De,Fe,Le,We;function Ye(){}Ye.__reactDisabledLog=!0;function Ar(){{if(Q===0){Ie=console.log,Me=console.info,Ne=console.warn,De=console.error,Fe=console.group,Le=console.groupCollapsed,We=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ye,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Q++}}function kr(){{if(Q--,Q===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:B({},e,{value:Ie}),info:B({},e,{value:Me}),warn:B({},e,{value:Ne}),error:B({},e,{value:De}),group:B({},e,{value:Fe}),groupCollapsed:B({},e,{value:Le}),groupEnd:B({},e,{value:We})})}Q<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ge=G.ReactCurrentDispatcher,me;function oe(e,i,o){{if(me===void 0)try{throw Error()}catch(g){var c=g.stack.trim().match(/\n( *(at )?)/);me=c&&c[1]||""}return`
`+me+e}}var ye=!1,se;{var Ir=typeof WeakMap=="function"?WeakMap:Map;se=new Ir}function Ue(e,i){if(!e||ye)return"";{var o=se.get(e);if(o!==void 0)return o}var c;ye=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var b;b=ge.current,ge.current=null,Ar();try{if(i){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(F){c=F}Reflect.construct(e,[],d)}else{try{d.call()}catch(F){c=F}e.call(d.prototype)}}else{try{throw Error()}catch(F){c=F}e()}}catch(F){if(F&&c&&typeof F.stack=="string"){for(var l=F.stack.split(`
`),P=c.stack.split(`
`),R=l.length-1,_=P.length-1;R>=1&&_>=0&&l[R]!==P[_];)_--;for(;R>=1&&_>=0;R--,_--)if(l[R]!==P[_]){if(R!==1||_!==1)do if(R--,_--,_<0||l[R]!==P[_]){var k=`
`+l[R].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),typeof e=="function"&&se.set(e,k),k}while(R>=1&&_>=0);break}}}finally{ye=!1,ge.current=b,kr(),Error.prepareStackTrace=g}var J=e?e.displayName||e.name:"",er=J?oe(J):"";return typeof e=="function"&&se.set(e,er),er}function Mr(e,i,o){return Ue(e,!1)}function Nr(e){var i=e.prototype;return!!(i&&i.isReactComponent)}function ue(e,i,o){if(e==null)return"";if(typeof e=="function")return Ue(e,Nr(e));if(typeof e=="string")return oe(e);switch(e){case m:return oe("Suspense");case y:return oe("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case p:return Mr(e.render);case w:return ue(e.type,i,o);case A:{var c=e,g=c._payload,b=c._init;try{return ue(b(g),i,o)}catch{}}}return""}var ce=Object.prototype.hasOwnProperty,Ve={},Be=G.ReactDebugCurrentFrame;function le(e){if(e){var i=e._owner,o=ue(e.type,e._source,i?i.type:null);Be.setExtraStackFrame(o)}else Be.setExtraStackFrame(null)}function Dr(e,i,o,c,g){{var b=Function.call.bind(ce);for(var d in e)if(b(e,d)){var l=void 0;try{if(typeof e[d]!="function"){var P=Error((c||"React class")+": "+o+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw P.name="Invariant Violation",P}l=e[d](i,d,c,o,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(R){l=R}l&&!(l instanceof Error)&&(le(g),C("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",c||"React class",o,d,typeof l),le(null)),l instanceof Error&&!(l.message in Ve)&&(Ve[l.message]=!0,le(g),C("Failed %s type: %s",o,l.message),le(null))}}}var Fr=Array.isArray;function be(e){return Fr(e)}function Lr(e){{var i=typeof Symbol=="function"&&Symbol.toStringTag,o=i&&e[Symbol.toStringTag]||e.constructor.name||"Object";return o}}function Wr(e){try{return Ke(e),!1}catch{return!0}}function Ke(e){return""+e}function Ge(e){if(Wr(e))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Lr(e)),Ke(e)}var q=G.ReactCurrentOwner,Yr={key:!0,ref:!0,__self:!0,__source:!0},ze,Je,Ee;Ee={};function Ur(e){if(ce.call(e,"ref")){var i=Object.getOwnPropertyDescriptor(e,"ref").get;if(i&&i.isReactWarning)return!1}return e.ref!==void 0}function Vr(e){if(ce.call(e,"key")){var i=Object.getOwnPropertyDescriptor(e,"key").get;if(i&&i.isReactWarning)return!1}return e.key!==void 0}function Br(e,i){if(typeof e.ref=="string"&&q.current&&i&&q.current.stateNode!==i){var o=D(q.current.type);Ee[o]||(C('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',D(q.current.type),e.ref),Ee[o]=!0)}}function Kr(e,i){{var o=function(){ze||(ze=!0,C("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",i))};o.isReactWarning=!0,Object.defineProperty(e,"key",{get:o,configurable:!0})}}function Gr(e,i){{var o=function(){Je||(Je=!0,C("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",i))};o.isReactWarning=!0,Object.defineProperty(e,"ref",{get:o,configurable:!0})}}var zr=function(e,i,o,c,g,b,d){var l={$$typeof:t,type:e,key:i,ref:o,props:d,_owner:b};return l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(l,"_self",{configurable:!1,enumerable:!1,writable:!1,value:c}),Object.defineProperty(l,"_source",{configurable:!1,enumerable:!1,writable:!1,value:g}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l};function Jr(e,i,o,c,g){{var b,d={},l=null,P=null;o!==void 0&&(Ge(o),l=""+o),Vr(i)&&(Ge(i.key),l=""+i.key),Ur(i)&&(P=i.ref,Br(i,g));for(b in i)ce.call(i,b)&&!Yr.hasOwnProperty(b)&&(d[b]=i[b]);if(e&&e.defaultProps){var R=e.defaultProps;for(b in R)d[b]===void 0&&(d[b]=R[b])}if(l||P){var _=typeof e=="function"?e.displayName||e.name||"Unknown":e;l&&Kr(d,_),P&&Gr(d,_)}return zr(e,l,P,g,c,q.current,d)}}var Re=G.ReactCurrentOwner,He=G.ReactDebugCurrentFrame;function z(e){if(e){var i=e._owner,o=ue(e.type,e._source,i?i.type:null);He.setExtraStackFrame(o)}else He.setExtraStackFrame(null)}var _e;_e=!1;function we(e){return typeof e=="object"&&e!==null&&e.$$typeof===t}function $e(){{if(Re.current){var e=D(Re.current.type);if(e)return`
Check the render method of \``+e+"`."}return""}}function Hr(e){{if(e!==void 0){var i=e.fileName.replace(/^.*[\\\/]/,""),o=e.lineNumber;return`
Check your code at `+i+":"+o+"."}return""}}var Xe={};function $r(e){{var i=$e();if(!i){var o=typeof e=="string"?e:e.displayName||e.name;o&&(i=`
Check the top-level render call using <`+o+">.")}return i}}function Ze(e,i){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var o=$r(i);if(Xe[o])return;Xe[o]=!0;var c="";e&&e._owner&&e._owner!==Re.current&&(c=" It was passed a child from "+D(e._owner.type)+"."),z(e),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',o,c),z(null)}}function Qe(e,i){{if(typeof e!="object")return;if(be(e))for(var o=0;o<e.length;o++){var c=e[o];we(c)&&Ze(c,i)}else if(we(e))e._store&&(e._store.validated=!0);else if(e){var g=_r(e);if(typeof g=="function"&&g!==e.entries)for(var b=g.call(e),d;!(d=b.next()).done;)we(d.value)&&Ze(d.value,i)}}}function Xr(e){{var i=e.type;if(i==null||typeof i=="string")return;var o;if(typeof i=="function")o=i.propTypes;else if(typeof i=="object"&&(i.$$typeof===p||i.$$typeof===w))o=i.propTypes;else return;if(o){var c=D(i);Dr(o,e.props,"prop",c,e)}else if(i.PropTypes!==void 0&&!_e){_e=!0;var g=D(i);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",g||"Unknown")}typeof i.getDefaultProps=="function"&&!i.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Zr(e){{for(var i=Object.keys(e.props),o=0;o<i.length;o++){var c=i[o];if(c!=="children"&&c!=="key"){z(e),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",c),z(null);break}}e.ref!==null&&(z(e),C("Invalid attribute `ref` supplied to `React.Fragment`."),z(null))}}function qe(e,i,o,c,g,b){{var d=jr(e);if(!d){var l="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(l+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var P=Hr(g);P?l+=P:l+=$e();var R;e===null?R="null":be(e)?R="array":e!==void 0&&e.$$typeof===t?(R="<"+(D(e.type)||"Unknown")+" />",l=" Did you accidentally export a JSX literal instead of a component?"):R=typeof e,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",R,l)}var _=Jr(e,i,o,g,b);if(_==null)return _;if(d){var k=i.children;if(k!==void 0)if(c)if(be(k)){for(var J=0;J<k.length;J++)Qe(k[J],e);Object.freeze&&Object.freeze(k)}else C("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Qe(k,e)}return e===a?Zr(_):Xr(_),_}}function Qr(e,i,o){return qe(e,i,o,!0)}function qr(e,i,o){return qe(e,i,o,!1)}var et=qr,rt=Qr;$.Fragment=a,$.jsx=et,$.jsxs=rt}()),$}process.env.NODE_ENV==="production"?fe.exports=rr():fe.exports=tr();var ee=fe.exports;const nr={BACKGROUND:"bg",BACKGROUND_DETAIL:"ol",BICYCLE:"br",CADASTRAL:"lp",CTT:"ctt",HIKING_TRAIL:"ar",PANORAMA:"pr",POI_KOREAN:"lko",TRANSIT:"ts",KOREAN:"lko",ENGLISH:"len",CHINESE:"lzh",JAPANESE:"lja"},ar=(r,t)=>{const n=r??{},s=(t??[]).map(u=>nr[u]).join(".");return n.latitude&&n.longitude&&(n.center=new window.naver.maps.LatLng(n.latitude,n.longitude)),{...n,mapTypes:new window.naver.maps.MapTypeRegistry({normal:window.naver.maps.NaverStyleMapTypeOptions.getNormalMap({overlayType:s}),satellite:window.naver.maps.NaverStyleMapTypeOptions.getSatelliteMap({overlayType:s}),hybrid:window.naver.maps.NaverStyleMapTypeOptions.getHybridMap({overlayType:s}),terrain:window.naver.maps.NaverStyleMapTypeOptions.getTerrainMap({overlayType:s})})}},j=Symbol.for("@ts-pattern/matcher"),Oe=Symbol.for("@ts-pattern/isVariadic"),re="@ts-pattern/anonymous-select-key",de=r=>!!(r&&typeof r=="object"),te=r=>r&&!!r[j],S=(r,t,n)=>{if(te(r)){const a=r[j](),{matched:s,selections:u}=a.match(t);return s&&u&&Object.keys(u).forEach(f=>n(f,u[f])),s}if(de(r)){if(!de(t))return!1;if(Array.isArray(r)){if(!Array.isArray(t))return!1;let a=[],s=[],u=[];for(const f of r.keys()){const h=r[f];te(h)&&h[Oe]?u.push(h):u.length?s.push(h):a.push(h)}if(u.length){if(u.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<a.length+s.length)return!1;const f=t.slice(0,a.length),h=s.length===0?[]:t.slice(-s.length),p=t.slice(a.length,s.length===0?1/0:-s.length);return a.every((m,y)=>S(m,f[y],n))&&s.every((m,y)=>S(m,h[y],n))&&(u.length===0||S(u[0],p,n))}return r.length===t.length&&r.every((f,h)=>S(f,t[h],n))}return Object.keys(r).every(a=>{const s=r[a];return(a in t||te(u=s)&&u[j]().matcherType==="optional")&&S(s,t[a],n);var u})}return Object.is(t,r)},x=r=>{var t,n,a;return de(r)?te(r)?(t=(n=(a=r[j]()).getSelectionKeys)==null?void 0:n.call(a))!=null?t:[]:Array.isArray(r)?X(r,x):X(Object.values(r),x):[]},X=(r,t)=>r.reduce((n,a)=>n.concat(t(a)),[]);function ir(...r){if(r.length===1){const[t]=r;return n=>S(t,n,()=>{})}if(r.length===2){const[t,n]=r;return S(t,n,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${r.length}.`)}function O(r){return Object.assign(r,{optional:()=>pe(r),and:t=>E(r,t),or:t=>Ce(r,t),select:t=>t===void 0?Z(r):Z(t,r)})}function ve(r){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[Oe]:!0})}}))(r),{optional:()=>ve(pe(r)),select:t=>ve(t===void 0?Z(r):Z(t,r))})}function pe(r){return O({[j]:()=>({match:t=>{let n={};const a=(s,u)=>{n[s]=u};return t===void 0?(x(r).forEach(s=>a(s,void 0)),{matched:!0,selections:n}):{matched:S(r,t,a),selections:n}},getSelectionKeys:()=>x(r),matcherType:"optional"})})}const or=(r,t)=>{for(const n of r)if(!t(n))return!1;return!0},sr=(r,t)=>{for(const[n,a]of r.entries())if(!t(a,n))return!1;return!0};function E(...r){return O({[j]:()=>({match:t=>{let n={};const a=(s,u)=>{n[s]=u};return{matched:r.every(s=>S(s,t,a)),selections:n}},getSelectionKeys:()=>X(r,x),matcherType:"and"})})}function Ce(...r){return O({[j]:()=>({match:t=>{let n={};const a=(s,u)=>{n[s]=u};return X(r,x).forEach(s=>a(s,void 0)),{matched:r.some(s=>S(s,t,a)),selections:n}},getSelectionKeys:()=>X(r,x),matcherType:"or"})})}function v(r){return{[j]:()=>({match:t=>({matched:!!r(t)})})}}function Z(...r){const t=typeof r[0]=="string"?r[0]:void 0,n=r.length===2?r[1]:typeof r[0]=="string"?void 0:r[0];return O({[j]:()=>({match:a=>{let s={[t??re]:a};return{matched:n===void 0||S(n,a,(u,f)=>{s[u]=f}),selections:s}},getSelectionKeys:()=>[t??re].concat(n===void 0?[]:x(n))})})}function I(r){return typeof r=="number"}function U(r){return typeof r=="string"}function W(r){return typeof r=="bigint"}const Pe=O(v(function(r){return!0})),ur=Pe,V=r=>Object.assign(O(r),{startsWith:t=>{return V(E(r,(n=t,v(a=>U(a)&&a.startsWith(n)))));var n},endsWith:t=>{return V(E(r,(n=t,v(a=>U(a)&&a.endsWith(n)))));var n},minLength:t=>V(E(r,(n=>v(a=>U(a)&&a.length>=n))(t))),maxLength:t=>V(E(r,(n=>v(a=>U(a)&&a.length<=n))(t))),includes:t=>{return V(E(r,(n=t,v(a=>U(a)&&a.includes(n)))));var n},regex:t=>{return V(E(r,(n=t,v(a=>U(a)&&!!a.match(n)))));var n}}),cr=V(v(U)),M=r=>Object.assign(O(r),{between:(t,n)=>M(E(r,((a,s)=>v(u=>I(u)&&a<=u&&s>=u))(t,n))),lt:t=>M(E(r,(n=>v(a=>I(a)&&a<n))(t))),gt:t=>M(E(r,(n=>v(a=>I(a)&&a>n))(t))),lte:t=>M(E(r,(n=>v(a=>I(a)&&a<=n))(t))),gte:t=>M(E(r,(n=>v(a=>I(a)&&a>=n))(t))),int:()=>M(E(r,v(t=>I(t)&&Number.isInteger(t)))),finite:()=>M(E(r,v(t=>I(t)&&Number.isFinite(t)))),positive:()=>M(E(r,v(t=>I(t)&&t>0))),negative:()=>M(E(r,v(t=>I(t)&&t<0)))}),lr=M(v(I)),Y=r=>Object.assign(O(r),{between:(t,n)=>Y(E(r,((a,s)=>v(u=>W(u)&&a<=u&&s>=u))(t,n))),lt:t=>Y(E(r,(n=>v(a=>W(a)&&a<n))(t))),gt:t=>Y(E(r,(n=>v(a=>W(a)&&a>n))(t))),lte:t=>Y(E(r,(n=>v(a=>W(a)&&a<=n))(t))),gte:t=>Y(E(r,(n=>v(a=>W(a)&&a>=n))(t))),positive:()=>Y(E(r,v(t=>W(t)&&t>0))),negative:()=>Y(E(r,v(t=>W(t)&&t<0)))}),fr=Y(v(W)),dr=O(v(function(r){return typeof r=="boolean"})),vr=O(v(function(r){return typeof r=="symbol"})),pr=O(v(function(r){return r==null}));var N={__proto__:null,matcher:j,optional:pe,array:function(...r){return ve({[j]:()=>({match:t=>{if(!Array.isArray(t))return{matched:!1};if(r.length===0)return{matched:!0};const n=r[0];let a={};if(t.length===0)return x(n).forEach(u=>{a[u]=[]}),{matched:!0,selections:a};const s=(u,f)=>{a[u]=(a[u]||[]).concat([f])};return{matched:t.every(u=>S(n,u,s)),selections:a}},getSelectionKeys:()=>r.length===0?[]:x(r[0])})})},set:function(...r){return O({[j]:()=>({match:t=>{if(!(t instanceof Set))return{matched:!1};let n={};if(t.size===0)return{matched:!0,selections:n};if(r.length===0)return{matched:!0};const a=(u,f)=>{n[u]=(n[u]||[]).concat([f])},s=r[0];return{matched:or(t,u=>S(s,u,a)),selections:n}},getSelectionKeys:()=>r.length===0?[]:x(r[0])})})},map:function(...r){return O({[j]:()=>({match:t=>{if(!(t instanceof Map))return{matched:!1};let n={};if(t.size===0)return{matched:!0,selections:n};const a=(h,p)=>{n[h]=(n[h]||[]).concat([p])};if(r.length===0)return{matched:!0};var s;if(r.length===1)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(s=r[0])==null?void 0:s.toString()}`);const[u,f]=r;return{matched:sr(t,(h,p)=>{const m=S(u,p,a),y=S(f,h,a);return m&&y}),selections:n}},getSelectionKeys:()=>r.length===0?[]:[...x(r[0]),...x(r[1])]})})},intersection:E,union:Ce,not:function(r){return O({[j]:()=>({match:t=>({matched:!S(r,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:v,select:Z,any:Pe,_:ur,string:cr,number:lr,bigint:fr,boolean:dr,symbol:vr,nullish:pr,instanceOf:function(r){return O(v(function(t){return n=>n instanceof t}(r)))},shape:function(r){return O(v(ir(r)))}};const he={matched:!1,value:void 0};function hr(r){return new ne(r,he)}class ne{constructor(t,n){this.input=void 0,this.state=void 0,this.input=t,this.state=n}with(...t){if(this.state.matched)return this;const n=t[t.length-1],a=[t[0]];let s;t.length===3&&typeof t[1]=="function"?(a.push(t[0]),s=t[1]):t.length>2&&a.push(...t.slice(1,t.length-1));let u=!1,f={};const h=(m,y)=>{u=!0,f[m]=y},p=!a.some(m=>S(m,this.input,h))||s&&!s(this.input)?he:{matched:!0,value:n(u?re in f?f[re]:f:this.input,this.input)};return new ne(this.input,p)}when(t,n){if(this.state.matched)return this;const a=!!t(this.input);return new ne(this.input,a?{matched:!0,value:n(this.input,this.input)}:he)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){return this.run()}run(){if(this.state.matched)return this.state.value;let t;try{t=JSON.stringify(this.input)}catch{t=this.input}throw new Error(`Pattern matching error: no pattern matches value ${t}`)}returnType(){return this}}const gr=r=>hr(r).with(N.not({clientId:N.string}),()=>"clientId is required").with(N.not({category:N.optional(N.union("fin","gov","ncp"))}),()=>"only fin, gov, ncp is allowed").with(N.optional({subModules:N.not(N.array(N.union("drawing","geocoder","panorama","visualization")))}),()=>"subModules is invalid").otherwise(()=>{}),je="naver-maps-script-id",mr="https://oapi.map.naver.com/openapi/v3/maps.js",yr=({clientId:r,category:t="ncp",subModules:n=[],callback:a=[]})=>{var y;const s={clientId:r,category:t,subModules:n},u=gr(s),f=!!document.getElementById(je);if(u)throw new Error(u);if(f)return;const h=new URLSearchParams({[`${s.category??"ncp"}ClientId`]:s.clientId,submodules:((y=s.subModules)==null?void 0:y.join())??""}),p=`${mr}?${h}`,m=document.createElement("script");m.setAttribute("id",je),m.setAttribute("type","text/javascript"),m.setAttribute("src",p),m.setAttribute("async",""),m.setAttribute("defer",""),m.onerror=()=>new Error("naver map script load failed"),m.onload=()=>{a&&a.forEach(w=>w())},document.head.appendChild(m)},xe=T.createContext({map:void 0,mapIsLoaded:!1});function br({clientId:r,category:t,subModules:n,initLayers:a,mapOptions:s,onLoaded:u,children:f,...h}){const p=T.useRef(null),[m,y]=T.useState(!1),[w,A]=T.useState(),K={clientId:r,category:t,subModules:n},ae=()=>{if(!p.current)throw new Error("map ref is not founded");const ie=new naver.maps.Map(p.current,ar(s,a));A(()=>ie),y(()=>!0),u&&u(ie)};return T.useEffect(()=>(yr({...K,callback:[ae]}),()=>{w==null||w.destroy(),A(()=>{})}),[]),ee.jsx(xe.Provider,{value:{map:w,mapIsLoaded:m},children:ee.jsx("div",{ref:p,...h,children:f})})}const Er=()=>{const r=T.useContext(xe);return T.useMemo(()=>r,[r])};function Rr({onLoaded:r,latitude:t,longitude:n,children:a,...s}){const u=T.useRef(null),[f,h]=T.useState(),{map:p,mapIsLoaded:m}=Er(),y=w=>{if(!u.current)throw new Error("marker ref is not founded");const A=new naver.maps.Marker({map:w,position:new naver.maps.LatLng(t,n),icon:a?{content:u.current}:void 0});h(()=>A),r&&r(A)};return T.useEffect(()=>{m&&p&&y(p)},[m]),T.useEffect(()=>()=>{f==null||f.setMap(null),h(()=>{})},[]),ee.jsx("div",{style:{display:"none"},children:ee.jsx("div",{ref:u,...s,children:a})})}L.NaverMap=br,L.NaverMarker=Rr,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});