1import { S as g, s as v, q as b, m as w, u as y, r as d, R as f } from "./queryClient-DpZpBkWP.js"; 2import { a as x, o as m, p as R, c as M, j as u, G as E } from "./emotion-react.browser.esm-MfU6wlAJ.js"; 3import { M as S } from "./index-DQ3Y9SbI.js"; 4class k extends g { 5 constructor(t, e) { 6 super(), this.client = t, this.setOptions(e), this.bindMethods(), this.updateResult(); 7 } 8 bindMethods() { 9 this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this); 10 } 11 setOptions(t) { 12 var e; 13 const s = this.options; 14 this.options = this.client.defaultMutationOptions(t), v(s, this.options) || this.client.getMutationCache().notify({ 15 type: "observerOptionsUpdated", 16 mutation: this.currentMutation, 17 observer: this 18 }), (e = this.currentMutation) == null || e.setOptions(this.options); 19 } 20 onUnsubscribe() { 21 if (!this.listeners.length) { 22 var t; 23 (t = this.currentMutation) == null || t.removeObserver(this); 24 } 25 } 26 onMutationUpdate(t) { 27 this.updateResult(); 28 const e = { 29 listeners: !0 30 }; 31 t.type === "success" ? e.onSuccess = !0 : t.type === "error" && (e.onError = !0), this.notify(e); 32 } 33 getCurrentResult() { 34 return this.currentResult; 35 } 36 reset() { 37 this.currentMutation = void 0, this.updateResult(), this.notify({ 38 listeners: !0 39 }); 40 } 41 mutate(t, e) { 42 return this.mutateOptions = e, this.currentMutation && this.currentMutation.removeObserver(this), this.currentMutation = this.client.getMutationCache().build(this.client, { 43 ...this.options, 44 variables: typeof t < "u" ? t : this.options.variables 45 }), this.currentMutation.addObserver(this), this.currentMutation.execute(); 46 } 47 updateResult() { 48 const t = this.currentMutation ? this.currentMutation.state : b(), e = { 49 ...t, 50 isLoading: t.status === "loading", 51 isSuccess: t.status === "success", 52 isError: t.status === "error", 53 isIdle: t.status === "idle", 54 mutate: this.mutate, 55 reset: this.reset 56 }; 57 this.currentResult = e; 58 } 59 notify(t) { 60 w.batch(() => { 61 if (this.mutateOptions && this.hasListeners()) { 62 if (t.onSuccess) { 63 var e, s, i, r; 64 (e = (s = this.mutateOptions).onSuccess) == null || e.call(s, this.currentResult.data, this.currentResult.variables, this.currentResult.context), (i = (r = this.mutateOptions).onSettled) == null || i.call(r, this.currentResult.data, null, this.currentResult.variables, this.currentResult.context); 65 } else if (t.onError) { 66 var o, c, l, n; 67 (o = (c = this.mutateOptions).onError) == null || o.call(c, this.currentResult.error, this.currentResult.variables, this.currentResult.context), (l = (n = this.mutateOptions).onSettled) == null || l.call(n, void 0, this.currentResult.error, this.currentResult.variables, this.currentResult.context); 68 } 69 } 70 t.listeners && this.listeners.forEach((h) => { 71 h(this.currentResult); 72 }); 73 }); 74 } 75} 76function j(a, t, e) { 77 const s = y(a, t), i = x({ 78 context: s.context 79 }), [r] = d.useState(() => new k(i, s)); 80 d.useEffect(() => { 81 r.setOptions(s); 82 }, [r, s]); 83 const o = m(d.useCallback((l) => r.subscribe(w.batchCalls(l)), [r]), () => r.getCurrentResult(), () => r.getCurrentResult()), c = d.useCallback((l, n) => { 84 r.mutate(l, n).catch(C); 85 }, [r]); 86 if (o.error && R(r.options.useErrorBoundary, [o.error])) 87 throw o.error; 88 return { 89 ...o, 90 mutate: c, 91 mutateAsync: o.mutate 92 }; 93} 94function C() { 95} 96function p() { 97 return p = Object.assign ? Object.assign.bind() : function(a) { 98 for (var t = 1; t < arguments.length; t++) { 99 var e = arguments[t]; 100 for (var s in e) 101 ({}).hasOwnProperty.call(e, s) && (a[s] = e[s]); 102 } 103 return a; 104 }, p.apply(null, arguments); 105} 106const O = M` 107 .ReactModal__Overlay { 108 height: 100vh; 109 height: 100svh; 110 } 111`, H = ({ 112 title: a, 113 contentStyle: t = { 114 padding: "16px" 115 }, 116 overlayStyle: e, 117 containerStyle: s, 118 maxWidth: i, 119 ...r 120}) => { 121 d.useEffect(() => { 122 if (!r.isOpen) 123 return; 124 const c = document.body.style.overflow, l = document.body.style.paddingRight, n = document.createElement("div"); 125 n.style.cssText = "overflow:scroll; visibility:hidden; position:absolute;", document.body.appendChild(n); 126 const h = n.offsetWidth - n.clientWidth; 127 return n.remove(), document.body.style.overflow = "hidden", document.body.style.paddingRight = `${h}px`, () => { 128 document.body.style.overflow = c, document.body.style.paddingRight = l; 129 }; 130 }, [r.isOpen]); 131 const o = { 132 overlay: { 133 zIndex: "1000", 134 overflow: "scroll", 135 "--tw-bg-opacity": "0.5", 136 backgroundColor: "rgb(0 0 0 / var(--tw-bg-opacity))", 137 paddingTop: "80px", 138 paddingBottom: "80px", 139 ...e 140 }, 141 content: { 142 position: "relative", 143 bottom: "0px", 144 left: "50%", 145 top: "0px", 146 marginLeft: "0px", 147 marginRight: "0px", 148 "--tw-translate-x": "-50%", 149 transform: "translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))", 150 borderRadius: "3px", 151 borderWidth: "0px", 152 padding: "0px", 153 "--tw-text-opacity": "1", 154 color: "rgb(33 33 33 / var(--tw-text-opacity))", 155 "--tw-shadow": "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
156 "--tw-shadow-colored": "0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color)", 157 boxShadow: "var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)", 158 maxWidth: i ?? "600px", 159 ...s 160 } 161 }; 162 return u(f.Fragment, null, u(E, { 163 styles: O 164 }), u(S, p({ 165 style: o 166 }, r), typeof a == "string" ? u("header", { 167 css: { 168 position: "relative", 169 display: "flex", 170 height: "50px", 171 alignItems: "center", 172 justifyContent: "center", 173 borderBottomWidth: "1px", 174 "--tw-border-opacity": "1", 175 borderBottomColor: "rgb(229 229 229 / var(--tw-border-opacity))", 176 padding: "16px", 177 fontSize: "18px", 178 fontWeight: "500" 179 } 180 }, u("span", { 181 css: { 182 flex: "1 1 0%", 183 textAlign: "center", 184 fontSize: "15px", 185 fontWeight: "500" 186 } 187 }, a), u("button", { 188 type: "button", 189 "aria-label": "ë«ê¸°", 190 css: { 191 position: "absolute", 192 right: "20px", 193 top: "50%", 194 display: "flex", 195 height: "24px", 196 width: "24px", 197 "--tw-translate-y": "-50%", 198 transform: "translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))", 199 cursor: "pointer", 200 alignItems: "center", 201 justifyContent: "center", 202 backgroundColor: "unset", 203 padding: "0px" 204 }, 205 onClick: r.onRequestClose 206 }, u("svg", { 207 "aria-hidden": "true", 208 width: "18", 209 height: "18", 210 viewBox: "0 0 18 18", 211 fill: "none", 212 xmlns: "http://www.w3.org/2000/svg" 213 }, u("path", { 214 d: "M18 0L0 18M0 0L18 18", 215 stroke: "currentColor" 216 })))) : null, u("main", { 217 style: t 218 }, r.children))); 219}, I = ({ 220 onComplete: a, 221 height: t = 450 222}) => (f.useEffect(() => { 223 const e = function(s) { 224 if (s.data.type === "ADDRESS_SELECTED") { 225 const { 226 address: i, 227 postalCode: r 228 } = s.data; 229 a({ 230 addr1: i, 231 zipcode: r 232 }); 233 } 234 }; 235 return window.addEventListener("message", e), () => { 236 window.removeEventListener("message", e); 237 }; 238}, [a]), u("iframe", { 239 src: "/_/address/", 240 style: { 241 width: "100%", 242 height: `${t}px`, 243 border: "none" 244 } 245})), T = () => { 246 const [a, t] = d.useState(null), [e, s] = d.useState(!0); 247 d.useEffect(() => { 248 (async () => { 249 try { 250 s(!0); 251 const o = window.TEST_SERVER ? "https://gateway-platform.dev.imwebapis.com" : "https://gateway-platform.imwebapis.com", c = new AbortController(), l = window.setTimeout(() => c.abort(), 3e3), n = await fetch(`${o}/address/health/daum`, { 252 signal: c.signal 253 }); 254 if (window.clearTimeout(l), !n.ok) { 255 t(!0), s(!1); 256 return; 257 } 258 const h = await n.json(); 259 t(h.isHealthy ?? !0); 260 } catch { 261 t(!0); 262 } finally { 263 s(!1); 264 } 265 })(); 266 }, []); 267 const i = a === !1 || window.ADDRESS_MODE === "kakao" || window.ADDRESS_MODE === "naver"; 268 return { 269 isDaumHealthy: a, 270 isLoading: e, 271 shouldUseFallback: i 272 }; 273}; 274export { 275 I as A, 276 H as M, 277 T as a, 278 j as u 279}; 280//# sourceMappingURL=useDaumHealthCheck-CBe2pidJ.js.map
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.