sales-frontend-components 0.0.173 → 0.0.175

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
2
  import { useController } from 'react-hook-form';
3
- import { CheckboxButton, Checkbox, isDate, DatePicker, DateRangePicker, FormCore, Modal, Button, RadioGroup, Radio, FormField, useModalState, ModalUtils, useDropDown, List, ListItem, convertDateString, Table, Select, Accordion, Tab, SegmentGroup, Loading } from 'sales-frontend-design-system';
3
+ import { CheckboxButton, Checkbox, DatePicker, DateRangePicker, FormCore, Modal, Button, RadioGroup, Radio, FormField, useModalState, ModalUtils, useDropDown, List, ListItem, Table, Select, Accordion, Tab, SegmentGroup, Loading } from 'sales-frontend-design-system';
4
4
  import React, { useState, useCallback, useEffect, useRef } from 'react';
5
5
  import { useSearchAddressQuery, useSearchPostalCodeQuery, useSearchAddressStandardizationQuery, useSearchCommonCodeQuery, useSearchCustomerListQuery, useSearchNationalityQuery, useSearchVisaQuery, getDspCustomerListMethod, useSearchEmployeeProfileQuery, useSearchOccupationDetailQuery, useSearchOccupationQuery, useSearchVehicleQuery, useSearchRiskGradeQuery, useSearchOrganizationQuery, getRemoteIdentityVerificationSystemToken, useDudExternalFileUploadMutation, useDudExternalFileDownloadQuery } from 'sales-frontend-api/method';
6
6
  import { IconMainUiSearch, IconGraphicsBankSaneop, IconGraphicsBankKiup, IconGraphicsBankKukmin, IconGraphicsBankSuhyeop, IconGraphicsBankJangGiSinYong, IconGraphicsBankNhNonghyeop, IconGraphicsBankJiyeokNonghyeop, IconGraphicsBankWoori, IconGraphicsBankScJeil, IconGraphicsBankSinhan, IconGraphicsBankHankookCity, IconGraphicsBankDaegu, IconGraphicsBankBusan, IconGraphicsBankGwangju, IconGraphicsBankJeju, IconGraphicsBankJeonbuk, IconGraphicsBankGyeongnam, IconGraphicsBankSaemaulGeumgo, IconGraphicsBankSinhyeop, IconGraphicsBankJeochuk, IconGraphicsBankHsbc, IconGraphicsBankABNAMRO, IconGraphicsBankSanlim, IconGraphicsBankPost, IconGraphicsBankKebHana, IconGraphicsBankKBank, IconGraphicsBankKakaoBank, IconGraphicsBankTossBank, IconGraphicsStockYuantaJeungkwon, IconGraphicsStockKbJeungkwon, IconGraphicsStockMiraeAssetJeungkwon, IconGraphicsStockSamsungJeungkwon, IconGraphicsStockHankookTujajeungkwon, IconGraphicsStockNhWooriTujajeungkwon, IconGraphicsStockGyoboJeungkwon, IconGraphicsStockHiTujajeungkwon, IconGraphicsStockHyundaiChaJeungkwon, IconGraphicsStockKiwoomJeungkwon, IconGraphicsStockSkJeungkwon, IconGraphicsStockDaesinJeungkwon, IconGraphicsStockHanwhaTujajeungkwon, IconGraphicsStockHanaGeumyungTujajeungkwon, IconGraphicsStockSinhanTujajeungkwon, IconGraphicsStockDbGeumyungTujajeungkwon, IconGraphicsStockYujinTujajeungkwon, IconGraphicsStockMeritzJeungkwon, IconGraphicsStockKakaoPayJeungkwon, IconGraphicsStockNhTujajeungkwon, IconGraphicsStockBugukJeungkwon, IconGraphicsStockSinyeongJeungkwon, IconGraphicsStockHochulEopsum, IconGraphicsFeedbackEmpty, IconIllustGrade, IconIllustJob, IconSubUiArrowRight, IconIllustVehicle, IconIllustCamera } from 'sales-frontend-assets';
@@ -57,1674 +57,1680 @@ const FormCheckbox = ({
57
57
  return /* @__PURE__ */ jsx(Checkbox, { ...props, ...field, id: field.name, checked: field.value, onChange: field.onChange, children });
58
58
  };
59
59
 
60
- const FormDatePicker = ({
61
- name,
62
- control,
63
- disabled,
64
- defaultValue,
65
- ...props
66
- }) => {
67
- const { field, fieldState } = useController({ name, control, disabled, defaultValue });
68
- const [selected, setSelected] = React.useState();
69
- React.useEffect(() => {
70
- if (isDate(field.value) && field.value !== selected) {
71
- setSelected(field.value);
72
- }
73
- }, [field.value]);
74
- return /* @__PURE__ */ jsx(
75
- DatePicker,
76
- {
77
- tabIndex: 0,
78
- ...{
79
- ...props,
80
- ...field,
81
- id: field.name,
82
- defaultValue: selected,
83
- error: fieldState.invalid,
84
- onValueChange: field.onChange
85
- }
86
- }
87
- );
88
- };
89
-
90
- const FormDateRangePicker = ({
91
- name,
92
- control,
93
- disabled,
94
- defaultValue,
95
- ...props
96
- }) => {
97
- const { field, fieldState } = useController({
98
- name,
99
- control,
100
- disabled,
101
- defaultValue
102
- });
103
- const [selected, setSelected] = React.useState();
104
- React.useEffect(() => {
105
- const fieldValue = field.value;
106
- if (!fieldValue) {
107
- setSelected(void 0);
108
- return;
109
- }
110
- const isStartDateDifferent = fieldValue.startDate?.getTime() !== selected?.startDate?.getTime();
111
- const isEndDateDifferent = fieldValue.endDate?.getTime() !== selected?.endDate?.getTime();
112
- if (!selected || isStartDateDifferent || isEndDateDifferent) {
113
- setSelected(fieldValue);
114
- }
115
- }, [field.value]);
116
- return /* @__PURE__ */ jsx(
117
- DateRangePicker,
118
- {
119
- tabIndex: 0,
120
- ...{
121
- ...props,
122
- ...field,
123
- id: field.name,
124
- defaultValue: selected,
125
- error: fieldState.invalid,
126
- onValueChange: field.onChange
127
- }
128
- }
129
- );
130
- };
131
-
132
60
  function getDefaultExportFromCjs (x) {
133
61
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
134
62
  }
135
63
 
136
- var bind = {exports: {}};
137
-
138
- /*!
139
- Copyright (c) 2018 Jed Watson.
140
- Licensed under the MIT License (MIT), see
141
- http://jedwatson.github.io/classnames
142
- */
143
-
144
- var hasRequiredBind;
145
-
146
- function requireBind () {
147
- if (hasRequiredBind) return bind.exports;
148
- hasRequiredBind = 1;
149
- (function (module) {
150
- /* global define */
151
-
152
- (function () {
153
-
154
- var hasOwn = {}.hasOwnProperty;
155
-
156
- function classNames () {
157
- var classes = '';
158
-
159
- for (var i = 0; i < arguments.length; i++) {
160
- var arg = arguments[i];
161
- if (arg) {
162
- classes = appendClass(classes, parseValue.call(this, arg));
163
- }
164
- }
165
-
166
- return classes;
167
- }
168
-
169
- function parseValue (arg) {
170
- if (typeof arg === 'string' || typeof arg === 'number') {
171
- return this && this[arg] || arg;
172
- }
64
+ var dayjs_min$1 = {exports: {}};
173
65
 
174
- if (typeof arg !== 'object') {
175
- return '';
176
- }
66
+ var dayjs_min = dayjs_min$1.exports;
177
67
 
178
- if (Array.isArray(arg)) {
179
- return classNames.apply(this, arg);
180
- }
68
+ var hasRequiredDayjs_min;
181
69
 
182
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
183
- return arg.toString();
184
- }
70
+ function requireDayjs_min () {
71
+ if (hasRequiredDayjs_min) return dayjs_min$1.exports;
72
+ hasRequiredDayjs_min = 1;
73
+ (function (module, exports) {
74
+ !function(t,e){module.exports=e();}(dayjs_min,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,true),this.parse(t),this.$x=this.$x||t.x||{},this[p]=true;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,false)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case "YY":return String(e.$y).slice(-2);case "YYYY":return b.s(e.$y,4,"0");case "M":return a+1;case "MM":return b.s(a+1,2,"0");case "MMM":return h(n.monthsShort,a,c,3);case "MMMM":return h(c,a);case "D":return e.$D;case "DD":return b.s(e.$D,2,"0");case "d":return String(e.$W);case "dd":return h(n.weekdaysMin,e.$W,o,2);case "ddd":return h(n.weekdaysShort,e.$W,o,3);case "dddd":return o[e.$W];case "H":return String(s);case "HH":return b.s(s,2,"0");case "h":return d(1);case "hh":return d(2);case "a":return $(s,u,true);case "A":return $(s,u,false);case "m":return String(u);case "mm":return b.s(u,2,"0");case "s":return String(e.$s);case "ss":return b.s(e.$s,2,"0");case "SSS":return b.s(e.$ms,3,"0");case "Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,true);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=true),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
75
+ } (dayjs_min$1));
76
+ return dayjs_min$1.exports;
77
+ }
185
78
 
186
- var classes = '';
79
+ var dayjs_minExports = requireDayjs_min();
80
+ var dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports);
187
81
 
188
- for (var key in arg) {
189
- if (hasOwn.call(arg, key) && arg[key]) {
190
- classes = appendClass(classes, this && this[key] || key);
191
- }
192
- }
82
+ var customParseFormat$2 = {exports: {}};
193
83
 
194
- return classes;
195
- }
84
+ var customParseFormat$1 = customParseFormat$2.exports;
196
85
 
197
- function appendClass (value, newClass) {
198
- if (!newClass) {
199
- return value;
200
- }
201
-
202
- if (value) {
203
- return value + ' ' + newClass;
204
- }
205
-
206
- return value + newClass;
207
- }
86
+ var hasRequiredCustomParseFormat;
208
87
 
209
- if (module.exports) {
210
- classNames.default = classNames;
211
- module.exports = classNames;
212
- } else {
213
- window.classNames = classNames;
214
- }
215
- }());
216
- } (bind));
217
- return bind.exports;
88
+ function requireCustomParseFormat () {
89
+ if (hasRequiredCustomParseFormat) return customParseFormat$2.exports;
90
+ hasRequiredCustomParseFormat = 1;
91
+ (function (module, exports) {
92
+ !function(e,t){module.exports=t();}(customParseFormat$1,(function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,s={},a=function(e){return (e=+e)+(e>68?1900:2e3)};var f=function(e){return function(t){this[e]=+t;}},h=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e);}],u=function(e){var t=s[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=s.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},c={A:[o,function(e){this.afternoon=d(e,false);}],a:[o,function(e){this.afternoon=d(e,true);}],Q:[n,function(e){this.month=3*(e-1)+1;}],S:[n,function(e){this.milliseconds=100*+e;}],SS:[r,function(e){this.milliseconds=10*+e;}],SSS:[/\d{3}/,function(e){this.milliseconds=+e;}],s:[i,f("seconds")],ss:[i,f("seconds")],m:[i,f("minutes")],mm:[i,f("minutes")],H:[i,f("hours")],h:[i,f("hours")],HH:[i,f("hours")],hh:[i,f("hours")],D:[i,f("day")],DD:[r,f("day")],Do:[o,function(e){var t=s.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r);}],w:[i,f("week")],ww:[r,f("week")],M:[i,f("month")],MM:[r,f("month")],MMM:[o,function(e){var t=u("months"),n=(u("monthsShort")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n;}],MMMM:[o,function(e){var t=u("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t;}],Y:[/[+-]?\d+/,f("year")],YY:[r,function(e){this.year=a(e);}],YYYY:[/\d{4}/,f("year")],Z:h,ZZ:h};function l(n){var r,i;r=n,i=s&&s.formats;for(var o=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),a=o.length,f=0;f<a;f+=1){var h=o[f],u=c[h],d=u&&u[0],l=u&&u[1];o[f]=l?{regex:d,parser:l}:h.replace(/^\[|\]$/g,"");}return function(e){for(var t={},n=0,r=0;n<a;n+=1){var i=o[n];if("string"==typeof i)r+=i.length;else {var s=i.regex,f=i.parser,h=e.slice(r),u=s.exec(h)[0];f.call(t,u),e=e.replace(u,"");}}return function(e){var t=e.afternoon;if(void 0!==t){var n=e.hours;t?n<12&&(e.hours+=12):12===n&&(e.hours=0),delete e.afternoon;}}(t),t}}return function(e,t,n){n.p.customParseFormat=true,e&&e.parseTwoDigitYear&&(a=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,o=e.args;this.$u=r;var a=o[1];if("string"==typeof a){var f=true===o[2],h=true===o[3],u=f||h,d=o[2];h&&(d=o[2]),s=this.$locale(),!f&&d&&(s=n.Ls[d]),this.$d=function(e,t,n,r){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var i=l(t)(e),o=i.year,s=i.month,a=i.day,f=i.hours,h=i.minutes,u=i.seconds,d=i.milliseconds,c=i.zone,m=i.week,M=new Date,Y=a||(o||s?1:M.getDate()),p=o||M.getFullYear(),v=0;o&&!s||(v=s>0?s-1:M.getMonth());var D,w=f||0,g=h||0,y=u||0,L=d||0;return c?new Date(Date.UTC(p,v,Y,w,g,y,L+60*c.offset*1e3)):n?new Date(Date.UTC(p,v,Y,w,g,y,L)):(D=new Date(p,v,Y,w,g,y,L),m&&(D=r(D).week(m).toDate()),D)}catch(e){return new Date("")}}(t,a,r,n),this.init(),d&&true!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(a)&&(this.$d=new Date("")),s={};}else if(a instanceof Array)for(var c=a.length,m=1;m<=c;m+=1){o[1]=a[m-1];var M=n.apply(this,o);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}m===c&&(this.$d=new Date(""));}else i.call(this,e);};}}));
93
+ } (customParseFormat$2));
94
+ return customParseFormat$2.exports;
218
95
  }
219
96
 
220
- var bindExports = requireBind();
221
- var classNames = /*@__PURE__*/getDefaultExportFromCjs(bindExports);
97
+ var customParseFormatExports = requireCustomParseFormat();
98
+ var customParseFormat = /*@__PURE__*/getDefaultExportFromCjs(customParseFormatExports);
222
99
 
223
- const highlightOnSearchKeyword = (originalText, targetString) => {
224
- if (!targetString || !originalText?.includes(targetString)) {
225
- return originalText;
226
- }
227
- const replacedText = [];
228
- const splitText = originalText.split(targetString);
229
- for (let i = 0; i < splitText.length; i++) {
230
- replacedText.push(splitText[i] || "");
231
- if (i < splitText.length - 1) {
232
- replacedText.push(
233
- /* @__PURE__ */ jsx("span", { className: "text-primary", children: targetString }, `search-keyword-highlight-${i}-${Math.random()}`)
234
- );
235
- }
100
+ var __defProp = Object.defineProperty;
101
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
102
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
103
+ var getCookie = (name) => {
104
+ if (typeof document === "undefined") {
105
+ return "";
236
106
  }
237
- return replacedText;
107
+ const match = document.cookie.match(new RegExp(`(^|; *)${name}=([^;]*)`));
108
+ return match ? decodeURIComponent(match[2] || "") : "";
238
109
  };
239
- const getGenderName = (genderCode) => {
240
- switch (genderCode) {
241
- case "1":
242
- case "3":
243
- return "\uB0A8\uC131";
244
- case "2":
245
- case "4":
246
- return "\uC5EC\uC131";
247
- default:
248
- return "";
110
+ var getSubdomain = (hostname) => {
111
+ if (!hostname || hostname === "localhost" || hostname === "127.0.0.1") {
112
+ return "";
249
113
  }
114
+ const parts = hostname.split(".");
115
+ if (parts.length < 3) {
116
+ return "";
117
+ }
118
+ return parts[0] ?? "";
250
119
  };
251
-
252
- const cx$k = classNames.bind(styles);
253
- const { InputBox: InputBox$4, Input: Input$4 } = FormCore;
254
- const AddressSearchInitialText = () => {
255
- return /* @__PURE__ */ jsxs("div", { className: cx$k("search-result-list"), children: [
256
- /* @__PURE__ */ jsx("p", { className: cx$k("guide-title"), children: "\uC774\uB807\uAC8C \uAC80\uC0C9\uD574 \uBCF4\uC138\uC694." }),
257
- /* @__PURE__ */ jsxs("ul", { className: cx$k("guide"), children: [
258
- /* @__PURE__ */ jsx("li", { children: "\uB3C4\uB85C\uBA85/\uC9C0\uBA85\uACFC \uAC74\uBB3C\uBC88\uD638\uB97C \uD568\uAED8 \uC785\uB825\uD574\uC8FC\uC138\uC694" }),
259
- /* @__PURE__ */ jsx("li", { children: "\uC608) 63\uB85C 50, \uC5EC\uC758\uB3C4\uB3D9 60" }),
260
- /* @__PURE__ */ jsx("li", { children: "\uC9C0\uBA85\uC740 \uB3D9/\uC74D/\uBA74/\uB9AC\uB85C \uC785\uB825\uD574\uC8FC\uC138\uC694" }),
261
- /* @__PURE__ */ jsx("li", { children: "\uC608) \uC5EC\uC758\uB3C4\uB3D9, \uC5ED\uC0BC\uB3D9" }),
262
- /* @__PURE__ */ jsx("li", { children: "\uC6B0\uD3B8\uBC88\uD638 \uB2E4\uC12F\uC790\uB9AC\uB97C \uBAA8\uB450 \uC785\uB825\uD574\uC8FC\uC138\uC694" }),
263
- /* @__PURE__ */ jsx("li", { children: "\uC608) 07345, 06232" })
264
- ] })
265
- ] });
120
+ var getEnvironmentFromHostname = (hostname) => {
121
+ const debugModeEnv = getCookie("dsp-debug-mode-env")?.toLowerCase();
122
+ if (debugModeEnv) {
123
+ return debugModeEnv;
124
+ }
125
+ const subDomain = getSubdomain(hostname);
126
+ if (hostname === "localhost" || hostname === "127.0.0.1" || hostname.startsWith("localhost")) {
127
+ return "local";
128
+ }
129
+ if (subDomain.includes(`dev`)) {
130
+ return "dev";
131
+ }
132
+ if (subDomain.includes("stg")) {
133
+ return "stg";
134
+ }
135
+ return "prd";
266
136
  };
267
- const AddressSearchResult = ({
268
- addressSearchList,
269
- onChange,
270
- searchKeyword,
271
- selectedAddress
272
- }) => {
273
- return /* @__PURE__ */ jsxs("div", { className: cx$k("search-result-list"), children: [
274
- /* @__PURE__ */ jsxs("p", { className: cx$k("guide-title"), children: [
275
- "\uCD1D ",
276
- /* @__PURE__ */ jsx("span", { className: "text-primary", children: addressSearchList.length }),
277
- "\uAC74\uC758 \uAC80\uC0C9\uACB0\uACFC"
278
- ] }),
279
- addressSearchList.length > 0 && /* @__PURE__ */ jsx(
280
- RadioGroup,
281
- {
282
- items: addressSearchList.map((item) => {
283
- return {
284
- value: JSON.stringify(item),
285
- select: item.roadNameBaseAddress === selectedAddress?.roadNameBaseAddress && item.roadNameDetailAddress === selectedAddress?.roadNameDetailAddress && item.mainBuildingName === selectedAddress?.mainBuildingName,
286
- label: /* @__PURE__ */ jsxs("div", { className: cx$k("search-result"), children: [
287
- /* @__PURE__ */ jsx("div", { className: cx$k("zipcode"), children: highlightOnSearchKeyword(`${item.firstPostalCode}${item.secondPostalCode}`, searchKeyword) }),
288
- /* @__PURE__ */ jsx("div", { className: cx$k("divider") }),
289
- /* @__PURE__ */ jsxs("div", { className: cx$k("address-info"), children: [
290
- /* @__PURE__ */ jsx("span", { className: cx$k("address"), children: highlightOnSearchKeyword(
291
- `${item.roadNameBaseAddress} ${item.roadNameDetailAddress} ${item.mainBuildingName}`,
292
- searchKeyword
293
- ) }),
294
- /* @__PURE__ */ jsx("span", { className: cx$k("old-address"), children: highlightOnSearchKeyword(
295
- `${item.landNumberBaseAddress} ${item.landNumberDetailAddress}`,
296
- searchKeyword
297
- ) })
298
- ] })
299
- ] }),
300
- id: JSON.stringify(item)
301
- };
302
- }),
303
- className: cx$k("radio-group"),
304
- name: "address-search",
305
- size: "medium",
306
- defaultValue: "",
307
- onChange
137
+ var _MessageEventManager = class _MessageEventManager2 {
138
+ constructor() {
139
+ __publicField(this, "handlers", /* @__PURE__ */ new Map());
140
+ window.addEventListener("message", this.handleMessage.bind(this));
141
+ }
142
+ static getInstance() {
143
+ if (!_MessageEventManager2.instance) {
144
+ _MessageEventManager2.instance = new _MessageEventManager2();
145
+ }
146
+ return _MessageEventManager2.instance;
147
+ }
148
+ /**
149
+ *
150
+ * @param event
151
+ */
152
+ handleMessage(event) {
153
+ for (const [key, handler] of this.handlers) {
154
+ try {
155
+ handler(event);
156
+ } catch (error) {
157
+ console.error(`Message handler ${key} error:`, error);
308
158
  }
309
- ),
310
- addressSearchList.length === 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
311
- "`",
312
- /* @__PURE__ */ jsx("span", { className: "text-primary", children: searchKeyword }),
313
- "`\uC5D0 \uB300\uD55C \uAC80\uC0C9\uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."
314
- ] })
315
- ] });
159
+ }
160
+ }
161
+ /**
162
+ * 이벤트 헨들러 함수를 등록합니다.
163
+ * @param key
164
+ * @param handler
165
+ */
166
+ registerHandler(key, handler) {
167
+ this.handlers.set(key, handler);
168
+ }
169
+ /**
170
+ * 이벤트 핸들러 함수를 삭제합니다.
171
+ * @param key
172
+ */
173
+ unregisterHandler(key) {
174
+ this.handlers.delete(key);
175
+ }
316
176
  };
317
- const AddressSearchDetailInput = ({
318
- selectedStandardizationAddress,
319
- onDetailChange,
320
- step,
321
- onStandardizationChange,
322
- detailAddressInput
323
- }) => {
324
- const { land, road } = selectedStandardizationAddress;
325
- return /* @__PURE__ */ jsxs("div", { className: cx$k("search-result-list"), children: [
326
- /* @__PURE__ */ jsx(
327
- Radio.Root,
328
- {
329
- name: "address-search-standardization",
330
- size: "medium",
331
- defaultValue: JSON.stringify(selectedStandardizationAddress),
332
- children: /* @__PURE__ */ jsx(
333
- Radio.Item,
334
- {
335
- className: cx$k("radio-group"),
336
- value: JSON.stringify(selectedStandardizationAddress),
337
- onChange: onStandardizationChange,
338
- children: /* @__PURE__ */ jsxs("div", { className: cx$k("search-result"), children: [
339
- /* @__PURE__ */ jsx(
340
- "div",
341
- {
342
- className: cx$k("zipcode"),
343
- children: `${selectedStandardizationAddress.land?.firstPostalCode}${land?.secondPostalCode}`
344
- }
345
- ),
346
- /* @__PURE__ */ jsx("div", { className: cx$k("divider") }),
347
- /* @__PURE__ */ jsxs("div", { className: cx$k("address-info"), children: [
348
- /* @__PURE__ */ jsx("span", { className: cx$k("address"), children: `${road?.baseAddress} ${road?.detailAddress}` }),
349
- /* @__PURE__ */ jsx("span", { className: cx$k("old-address"), children: `${land?.baseAddress} ${land?.detailAddress}` })
350
- ] })
351
- ] })
352
- }
353
- )
177
+ __publicField(_MessageEventManager, "instance");
178
+ var MessageEventManager = _MessageEventManager;
179
+ function base64ToBlob(base64String, contentType = "") {
180
+ const regex = /^data:([a-zA-Z0-9/+.-]+);base64,/;
181
+ const matches = base64String.match(regex);
182
+ if (matches === null) {
183
+ throw new Error("Invalid base64 string");
184
+ }
185
+ const contentTypeFinal = contentType || matches[1];
186
+ const byteCharacters = atob(base64String.replace(regex, ""));
187
+ const byteNumbers = new Array(byteCharacters.length);
188
+ for (let i = 0; i < byteCharacters.length; i++) {
189
+ byteNumbers[i] = byteCharacters.charCodeAt(i);
190
+ }
191
+ const byteArray = new Uint8Array(byteNumbers);
192
+ return new Blob([byteArray], { type: contentTypeFinal });
193
+ }
194
+ function base64ToFile(base64String, fileName, contentType = "") {
195
+ const blob = base64ToBlob(base64String, contentType);
196
+ if (!blob) {
197
+ throw new Error("Invalid base64 string");
198
+ }
199
+ return blobToFile(blob, fileName);
200
+ }
201
+ function blobToFile(blob, fileName) {
202
+ return new File([blob], fileName, {
203
+ type: blob.type,
204
+ lastModified: Date.now()
205
+ });
206
+ }
207
+ async function fileToBase64(file) {
208
+ return new Promise((resolve, reject) => {
209
+ const reader = new FileReader();
210
+ reader.onload = () => {
211
+ if (typeof reader.result === "string") {
212
+ resolve(reader.result);
213
+ } else {
214
+ reject(new Error("Invalid file type"));
354
215
  }
355
- ),
356
- /* @__PURE__ */ jsxs("div", { className: "d-flex gap-medium items-center", children: [
357
- /* @__PURE__ */ jsx(FormField.Label, { id: "detail", style: { width: "90px" }, children: "\uC0C1\uC138\uC8FC\uC18C" }),
358
- /* @__PURE__ */ jsx(
359
- FormField.TextField,
360
- {
361
- rootProps: {
362
- style: {
363
- display: "flex",
364
- flex: 1
365
- }
366
- },
367
- placeholder: "\uC0C1\uC138\uC8FC\uC18C \uC785\uB825",
368
- onChange: onDetailChange,
369
- size: "small",
370
- value: detailAddressInput,
371
- ...step === "detail-input" && { autoFocus: true }
372
- }
373
- )
374
- ] })
375
- ] });
376
- };
377
- function AddressComponent({ isOpen, onClose, setValue }) {
378
- const {
379
- onAddressSearchClear,
380
- addressSearchKeyword,
381
- addressSearchStep,
382
- onAddressSearchNext,
383
- nextButtonDisabled,
384
- detailAddressInput,
385
- addressSearchList,
386
- onSearch,
387
- onKeyUp,
388
- onSelectChange,
389
- setDetail,
390
- search,
391
- searchInput,
392
- selectedAddress,
393
- onStandardizationChange,
394
- selectedStandardizationAddress,
395
- isLoading
396
- } = useSearchAddress({
397
- setValue,
398
- onClose,
399
- isOpen
216
+ };
217
+ reader.onerror = (error) => {
218
+ reject(error);
219
+ };
220
+ reader.readAsDataURL(file);
400
221
  });
401
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Modal.Root, { isOpen, onClose, modalSize: "full-screen", children: [
402
- /* @__PURE__ */ jsx(Modal.Overlay, {}),
403
- /* @__PURE__ */ jsxs(Modal.Content, { children: [
404
- /* @__PURE__ */ jsx(Modal.Header, { headerTitle: "\uC8FC\uC18C \uAC80\uC0C9", showCloseButton: true }),
405
- /* @__PURE__ */ jsxs(Modal.Body, { children: [
406
- /* @__PURE__ */ jsx(InputBox$4, { clearable: true, endElement: /* @__PURE__ */ jsx(IconMainUiSearch, { onClick: search }), onClear: onAddressSearchClear, children: /* @__PURE__ */ jsx(
407
- Input$4,
408
- {
409
- ...addressSearchStep !== "detail-input" && { autoFocus: true },
410
- onChange: onSearch,
411
- onKeyUp,
412
- value: searchInput,
413
- placeholder: "\uC9C0\uBC88, \uB3C4\uB85C\uBA85, \uAC74\uBB3C\uBA85, \uC6B0\uD3B8\uBC88\uD638 \uC785\uB825",
414
- size: "large"
415
- }
416
- ) }),
417
- addressSearchStep === "initial" && /* @__PURE__ */ jsx(AddressSearchInitialText, {}),
418
- !isLoading && addressSearchStep === "search-result" && /* @__PURE__ */ jsx(
419
- AddressSearchResult,
420
- {
421
- onChange: onSelectChange,
422
- addressSearchList,
423
- searchKeyword: addressSearchKeyword,
424
- selectedAddress
425
- }
426
- ),
427
- !isLoading && addressSearchStep === "detail-input" && selectedAddress && selectedStandardizationAddress && /* @__PURE__ */ jsx(
428
- AddressSearchDetailInput,
429
- {
430
- selectedStandardizationAddress,
431
- onStandardizationChange,
432
- onDetailChange: setDetail,
433
- step: addressSearchStep,
434
- detailAddressInput
435
- }
436
- )
437
- ] }),
438
- /* @__PURE__ */ jsx(Modal.Footer, { children: addressSearchStep !== "initial" && /* @__PURE__ */ jsxs(
439
- Button,
440
- {
441
- onClick: onAddressSearchNext,
442
- variant: "primary",
443
- size: "medium",
444
- appearance: "filled",
445
- width: "full",
446
- children: [
447
- addressSearchStep === "search-result" && "\uB2E4\uC74C(1/2)",
448
- addressSearchStep === "detail-input" && "\uD655\uC778(2/2)"
449
- ]
450
- }
451
- ) })
452
- ] })
453
- ] }) });
454
222
  }
455
-
456
- function useSearchAddress({ setValue, onClose, isOpen }) {
457
- const [searchKeyword, setSearchKeyword] = useState("");
458
- const [step, setStep] = useState("initial");
459
- const [selectedAddress, setSelectedAddress] = useState();
460
- const [selectedStandardizationAddress, setSelectedStandardizationAddress] = useState();
461
- const [searchInput, setSearchInput] = useState("");
462
- const [detailAddressInput, setDetailAddressInput] = useState("");
463
- const [displayList, setDisplayList] = useState([]);
464
- const [searchType, setSearchType] = useState("address");
465
- const [standardizationParams, setStandardizationParams] = useState({
466
- firstPostalCode: "",
467
- secondPostalCode: "",
468
- baseAddress: "",
469
- detailAddress: "",
470
- roadNameYn: "Y"
471
- });
472
- const { data: addressData, isLoading: isLoadingAddress } = useSearchAddressQuery(
473
- { searchKeyWord: searchKeyword },
474
- { enabled: !!searchKeyword && searchType === "address" }
475
- );
476
- const { data: postalData, isLoading: isLoadingPostalCode } = useSearchPostalCodeQuery(
477
- { searchWordName: searchKeyword },
478
- { enabled: !!searchKeyword && searchType === "postalcode" }
479
- );
480
- const { data: standardizedData } = useSearchAddressStandardizationQuery(standardizationParams, {
481
- enabled: !!standardizationParams?.baseAddress
482
- });
483
- const [nextButtonDisabled, setNextButtonDisabled] = useState(false);
484
- const onNext = () => {
485
- if (step === "search-result" && nextButtonDisabled) {
486
- ModalUtils.alert(
487
- "\uC8FC\uC18C\uB97C \uC120\uD0DD\uD558\uC9C0 \uC54A\uC73C\uBA74 \uB2E4\uC74C \uB2E8\uACC4\uB85C \uC774\uB3D9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.\n\uC8FC\uC18C\uB97C \uC120\uD0DD\uD55C \uD6C4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574\uC8FC\uC138\uC694.",
488
- "\uC120\uD0DD \uC8FC\uC18C \uC5C6\uC74C",
489
- { modalId: "search-modal-address-no-selected" }
223
+ function getExt(data) {
224
+ if (typeof data === "string") {
225
+ return data.split(".").pop();
226
+ }
227
+ if (data instanceof File) {
228
+ return data.name.split(".").pop();
229
+ }
230
+ if (data instanceof Blob) {
231
+ return data.type.split("/").pop();
232
+ }
233
+ }
234
+ function downloadBlob(blob, filename) {
235
+ const url = URL.createObjectURL(blob);
236
+ const link = document.createElement("a");
237
+ link.style.display = "none";
238
+ link.href = url;
239
+ link.download = `${filename}.${getExt(blob)}`;
240
+ document.body.appendChild(link);
241
+ link.click();
242
+ document.body.removeChild(link);
243
+ URL.revokeObjectURL(url);
244
+ }
245
+ async function imageUrlToFile(imageUrl) {
246
+ const headers = new Headers();
247
+ headers.append("cache-control", "no-cache");
248
+ const resImage = await fetch(imageUrl, { headers });
249
+ const blob = await resImage.blob();
250
+ const { type } = blob;
251
+ const name = type.split("/").join(".");
252
+ const file = new File([blob], name, { type });
253
+ return file;
254
+ }
255
+ var astx2_min_default = "/* eslint-disable */\n/* ASTx 1.3 | (C) Copyright AhnLab, Inc. | $Revision: 32070 $ */\nvar $ASTX2_CONST = {\n ERROR_SUCCESS: 0,\n ERROR_FAILED: 101,\n ERROR_NOINIT: 102,\n ERROR_NOTINST: 103,\n ERROR_NOTSUPPORTED: 104,\n ERROR_NOCONNECT: 105,\n ERROR_NCK: 106,\n ERROR_ERR: 107,\n ERROR_NSP: 108,\n ERROR_PARAM: 109,\n ERROR_EXCESS: 110,\n ERROR_NEEDUPDATE: 111,\n OPTION_NONE2E: 1,\n OPTION_AUTOFOCUS: 2,\n OPTION_AUTOSETTEXT: 4,\n OPTION_E2EFORM: 8,\n OPTION_E2EFORM_NOENC: 16,\n OPTION_E2EFORM_ALLTRIP: 32,\n OPTION_E2EFORM_ONLY: 64,\n OPTION_E2EFORM_TAGSET: 128,\n OPTION_NONE2E_ALG: 256,\n OPTION_NOSPTDUMMY: 512,\n OPTION_FIXEDTYPE: 1024,\n PROTECT_AK: 1,\n PROTECT_FW: 2,\n PROTECT_PB: 4,\n PROTECT_PCS: 8,\n SERVICE_AK: 1,\n REQUEST_JSONP: 1,\n REQUEST_AJAX: 2,\n DEBUG_NOALIVE: 1,\n INTERVAL_ALIVE: 5e3,\n E2ETYPE_EXCLUDE: -1,\n E2ETYPE_NONE: 0,\n E2ETYPE_CERT1: 1,\n E2ETYPE_CERT2: 2,\n E2ETYPE_SDK: 11,\n E2ETYPE_PLAIN1: 21,\n E2ETYPE_PLAIN2: 22,\n E2ETYPE_WIZVERA: 31,\n PAGEID: '',\n BROWSER_TYPE: '',\n BROWSER_VER: '',\n E2EFORM_TAIL: !0,\n E2EFORM_INIT: '_e2e_forminit',\n E2EFORM_TAG1: '_e2e_1__',\n E2EFORM_TAG2: '_e2e_2__',\n E2EFORM_TAG1_PWD: '_e2e_1_pwd__',\n E2EFORM_TAG2_PWD: '_e2e_2_pwd__',\n getErrno: function (a) {\n return 'NCK' == a ? this.ERROR_NCK : 'ERR' == a ? this.ERROR_ERR : 'NSP' == a ? this.ERROR_NSP : this.ERROR_FAILED;\n },\n _get_browser_version: function (a) {\n var b = 0;\n if (0 <= a.indexOf('Edge/') && ((b = parseInt(a.split('Edge/')[1])), 0 < b)) return 'EG' + b;\n if (0 <= a.indexOf('MSIE')) {\n if (((b = parseInt(a.split('MSIE')[1])), 0 < b)) return 'IE' + b;\n } else if (\n 0 <= a.indexOf('Trident') &&\n (0 <= a.indexOf('rv:')\n ? (b = parseInt(a.split('rv:')[1]))\n : 0 <= a.indexOf('IE') && (b = parseInt(a.split('IE')[1])),\n 0 < b)\n )\n return 'IE' + b;\n return 0 <= a.indexOf('OPR/') && ((b = parseInt(a.split('OPR/')[1])), 0 < b)\n ? 'OP' + b\n : 0 <= a.indexOf('Firefox/') && ((b = parseInt(a.split('Firefox/')[1])), 0 < b)\n ? 'FF' + b\n : 0 <= a.indexOf('Chrome/') && ((b = parseInt(a.split('Chrome/')[1])), 0 < b)\n ? 'CR' + b\n : 0 <= a.indexOf('AppleWebKit') &&\n 0 <= a.indexOf('Version/') &&\n ((b = parseInt(a.split('Version/')[1])), 0 < b)\n ? 'SF' + b\n : 'OT0';\n },\n init: function () {\n this.PAGEID = new Date().getTime();\n this.PAGEID -= Math.floor(100 * Math.random());\n this.BROWSER_VER = this._get_browser_version(navigator.userAgent);\n this.BROWSER_TYPE = this.BROWSER_VER.substring(0, 2);\n }\n};\n$ASTX2_CONST.init();\nvar $ASTX2_COMM = {\n mLocalServerURL: '',\n mClientPublicKey: '',\n mErrorAbortFlag: !1,\n mDegugFlags: 0,\n setDegugFlags: function (a) {\n this.mDegugFlags |= a;\n },\n getDegugFlags: function () {\n return this.mDegugFlags;\n },\n isEnable: function () {\n return 0 < this.mLocalServerURL.length ? !0 : !1;\n },\n uninit: function () {\n this.mLocalServerURL = '';\n },\n errorAbort: function (a) {\n 1 != this.mErrorAbortFlag && ((this.mErrorAbortFlag = !0), $ASTX2_CUST.errorAbort(a));\n }\n },\n $_astxu = {\n mJsonpSequence: 0,\n jsonQstr: function (a) {\n var b = [],\n c;\n for (c in a) a.hasOwnProperty(c) && b.push(encodeURIComponent(c) + '=' + encodeURIComponent(a[c]));\n return b.join('&');\n },\n jsonParse: function (a) {\n var b = a.indexOf('{'),\n c = a.indexOf('}');\n if (-1 == b || -1 == c) return {};\n a = a.substring(b, c + 1);\n return 'object' == typeof window.JSON && 'function' == typeof window.JSON.parse\n ? window.JSON.parse(a)\n : 'function' == typeof jQuery && 'function' == typeof jQuery.parseJSON\n ? jQuery.parseJSON(a)\n : eval('(' + a + ')');\n },\n _send_jsonp_jquery: function (a) {\n try {\n jQuery.ajax({\n url: a.src,\n timeout: a.timeout,\n cache: !1,\n crossDomain: !0,\n dataType: 'jsonp',\n contentType: 'application/javascript',\n success: function (b, d, e) {\n a.onSuccess(b);\n },\n error: function (b, d, e) {\n if (200 == b.status && 1 == a.nocallback) a.onSuccess();\n else a.onFailure();\n },\n complete: function (a, b) {}\n });\n } catch (b) {\n a.onFailure();\n }\n },\n _send_jsonp_dom: function (a) {\n var b = document.createElement('script');\n b.type = 'text/javascript';\n b.id = a.callback;\n b.async = a.async;\n b.src = a.src;\n var c = document.getElementsByTagName('body')[0];\n if (null == c && ((c = document.getElementsByTagName('head')[0]), null == c)) {\n a.onFailure();\n return;\n }\n var d = window.setTimeout(function () {\n window[a.callback] = function () {};\n try {\n var b = document.getElementById(a.callback);\n b && ((b.onerror = function () {}), c.removeChild(b));\n } catch (d) {}\n a.onFailure();\n }, a.timeout);\n 0 == a.nocallback\n ? (window[a.callback] = function (b) {\n window.clearTimeout(d);\n try {\n var f = document.getElementById(a.callback);\n f && c.removeChild(f);\n } catch (g) {}\n a.onSuccess(b);\n })\n : (b.onload = function () {\n window.clearTimeout(d);\n try {\n var b = document.getElementById(a.callback);\n b && c.removeChild(b);\n } catch (f) {}\n a.onSuccess();\n });\n b.onerror = function () {\n window.clearTimeout(d);\n window[a.callback] = function () {};\n try {\n var b = document.getElementById(a.callback);\n b && c.removeChild(b);\n } catch (f) {}\n a.onFailure();\n };\n c.appendChild(b);\n },\n sendJsonp: function (a) {\n null == a.data && (a.data = {});\n null == a.callback && (a.callback = 'jsonpCallback' + $_astxu.rnd());\n null == a.nocallback && (a.nocallback = !1);\n null == a.timeout && (a.timeout = 5e3);\n null == a.async && (a.async = !0);\n null == a.seq && (a.seq = !1);\n null == a.onSuccess && (a.onSuccess = function (a) {});\n null == a.onFailure && (a.onFailure = function () {});\n a.src = 1 == $ASTX2.mUseJQuery ? a.url + '?v=3' : a.url + '?v=2&callback=' + a.callback;\n if (1 == a.seq) {\n var b = ++this.mJsonpSequence;\n a.src += '&seq=' + b;\n 2147483647 <= this.mJsonpSequence && (this.mJsonpSequence = 0);\n }\n b = this.jsonQstr(a.data);\n 0 < b.length && (a.src += '&' + b);\n 1 == $ASTX2.mUseJQuery ? this._send_jsonp_jquery(a) : this._send_jsonp_dom(a);\n },\n _get_xhr_object: function () {\n if ('undefined' !== typeof XMLHttpRequest)\n try {\n return new XMLHttpRequest();\n } catch (a) {}\n try {\n return new ActiveXObject('Microsoft.XMLHTTP');\n } catch (b) {}\n return null;\n },\n sendAjax: function (a) {\n var b = this._get_xhr_object();\n if (null == b) $_astxu.msg('[sendAjax] _get_xhr_object failed');\n else {\n null == a.data && (a.data = {});\n null == a.type && (a.type = 'POST');\n null == a.async && (a.async = !0);\n null == a.onSuccess && (a.onSuccess = function (a) {});\n null == a.onFailure && (a.onFailure = function (a, b) {});\n var c = this.jsonQstr(a.data);\n b.open(a.type, 'GET' == a.type ? a.url + '&' + c : a.url, a.async);\n b.onreadystatechange = function () {\n if (4 == b.readyState)\n if (200 == b.status) a.onSuccess(b.responseText);\n else a.onFailure(b.status);\n };\n null != a.timeout && (b.timeout = a.timeout);\n b.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n b.send(c);\n }\n },\n sendAuthAjax: function (a) {\n var b = this._get_xhr_object();\n const stored = JSON.parse(sessionStorage.getItem('cust-mgmt-auth') || '{}');\n if (null == b) $_astxu.msg('[sendAjax] _get_xhr_object failed');\n else {\n null == a.data && (a.data = {});\n null == a.type && (a.type = 'POST');\n null == a.async && (a.async = !0);\n null == a.onSuccess && (a.onSuccess = function (a) {});\n null == a.onFailure && (a.onFailure = function (a, b) {});\n var c = this.jsonQstr(a.data);\n b.open(a.type, 'GET' == a.type ? a.url + '&' + c : a.url, a.async);\n b.onreadystatechange = function () {\n if (4 == b.readyState)\n if (200 == b.status) a.onSuccess(b.responseText);\n else a.onFailure(b.status);\n };\n null != a.timeout && (b.timeout = a.timeout);\n b.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n b.setRequestHeader('Authorization', stored.key);\n b.withCredentials = true;\n b.send(c);\n }\n },\n isACK: function (a) {\n return a && 'ACK' == a ? !0 : !1;\n },\n isWinOS: function () {\n return -1 != navigator.platform.indexOf('Win32') || -1 != navigator.platform.indexOf('Win64') ? !0 : !1;\n },\n isMacOS: function () {\n return -1 != navigator.platform.indexOf('Mac') ? !0 : !1;\n },\n isLinuxOS: function () {\n return -1 != navigator.platform.indexOf('Linux') ? !0 : !1;\n },\n isMacLinuxOS: function () {\n return 1 == this.isMacOS() || 1 == this.isLinuxOS() ? !0 : !1;\n },\n hasFocused: function () {\n var a = !1;\n try {\n a = document.hasFocus();\n } catch (b) {}\n return a;\n },\n addEvent: function (a, b, c) {\n a.addEventListener ? a.addEventListener(b, c, !1) : a.attachEvent('on' + b, c);\n },\n removeEvent: function (a, b, c) {\n a.removeEventListener ? a.removeEventListener(b, c) : a.detachEvent('on' + b, c);\n },\n getCreatedFormValue: function (a, b, c) {\n null == c && (c = !1);\n c = 1 == c ? document.getElementsByTagName('input') : a.getElementsByTagName('input');\n for (var d = 0; d < c.length; d++) {\n var e = c[d];\n if (e && this.getnc(e.name) == b) return e;\n }\n c = document.createElement('input');\n c.name = b;\n c.type = 'hidden';\n if ('function' === typeof $ASTX2_CUST.onCreatedFormValue) $ASTX2_CUST.onCreatedFormValue(c, b);\n a.appendChild(c);\n return c;\n },\n getHostPath: function () {\n var a = window.location.protocol + '//' + window.location.hostname;\n return (a += window.location.port ? ':' + window.location.port : '');\n },\n getnc: function (a, b) {\n null == b && (b = '');\n return null == a ? b : a;\n },\n getint: function (a, b) {\n null == b && (b = 0);\n return parseInt(a) || b;\n },\n rnd: function () {\n var a = new Date().getTime();\n return (a += new String(Math.floor(100 * Math.random())));\n },\n getKeyCode: function (a) {\n var b = null;\n a && (b = a.keyCode ? a.keyCode : a.which);\n return b;\n },\n xorEncode: function (a, b) {\n for (var c = '', d = new String(a), e = 0; e < d.length; e++) c += String.fromCharCode(b ^ d.charCodeAt(e));\n return c;\n },\n xorDecode: function (a, b) {\n for (var c = '', d = new String(a), e = 0; e < d.length; e++) c += String.fromCharCode(b ^ d.charCodeAt(e));\n return c;\n },\n ltrim: function (a, b) {\n for (b = this.getnc(b, ' '); a.substring(0, 1) == b; ) a = a.substring(1, a.length);\n return a;\n },\n rtrim: function (a, b) {\n for (b = this.getnc(b, ' '); a.substring(a.length - 1, a.length) == b; ) a = a.substring(0, a.length - 1);\n return a;\n },\n alltrim: function (a, b) {\n return this.ltrim(this.rtrim(a, b), b);\n },\n setInputFocus: function () {\n try {\n for (var a = document.getElementsByTagName('input'), b = 0; b < a.length; b++) {\n var c = a[b];\n if (c && 'hidden' != c.type) {\n c.focus();\n break;\n }\n }\n } catch (d) {}\n },\n log: function (a) {\n 'object' === typeof debuger && 'function' === typeof debuger.write\n ? debuger.write(a)\n : 'object' === typeof window.console && 'function' === typeof console.log && console.log(a);\n },\n msg: function (a) {\n this.log(a);\n }\n },\n $ASTX2_E2E = (function () {\n var a = null,\n b = function (a) {\n function b(a) {\n var c = a.target;\n null == c && (c = a.srcElement);\n return c;\n }\n function e(a) {\n if (null == a) return null;\n var b = a.getAttribute('e2e_inputid');\n if (null == b || 0 >= b) return null;\n var c = a.getAttribute('e2e_type');\n if (null == c || 0 >= c) return null;\n var d = a.getAttribute('e2e_inputtype');\n if (null == d || 0 >= d) d = '';\n var e = a.getAttribute('wizvera_key');\n null == e && (e = '');\n var f = {};\n f.e2e_inputid = b;\n f.e2e_type = c;\n f.e2e_inputtype = d;\n f.name = $_astxu.getnc(a.name);\n f.form = a.form ? $_astxu.getnc(a.form.name) : '';\n f.wizvera_key = e;\n return f;\n }\n function f(a) {\n var b = e(a);\n if (null == b) return null;\n b.type = $_astxu.getnc(a.type);\n b.maxlength = $_astxu.getnc(a.getAttribute('maxlength'));\n b.txtmsk = $_astxu.getnc(a.getAttribute('e2e_txtmsk'));\n return b;\n }\n function g(a, b) {\n a.getAttribute('e2e_type') != $ASTX2_CONST.E2ETYPE_PLAIN1 && (a.readOnly = b);\n }\n function h(a, b, c, d, e) {\n 1 == n && q(a, b, c, d, e);\n }\n function q(b, s, d, e, f) {\n var g = {};\n g.pageid = $ASTX2_CONST.PAGEID;\n if (null != s) for (var h in s) s.hasOwnProperty(h) && (g[h] = s[h]);\n a.send_e2e_cmd(b, g, d, e, f);\n }\n function l(a, b) {\n var c = '';\n return (c = 0 == $ASTX2_CONST.E2EFORM_TAIL ? b + a : a + b);\n }\n function m(a, b) {\n var c = '';\n return (c =\n 'password' == a.type\n ? b == $ASTX2_CONST.E2ETYPE_CERT2\n ? l(a.name, $ASTX2_CONST.E2EFORM_TAG2_PWD)\n : l(a.name, $ASTX2_CONST.E2EFORM_TAG1_PWD)\n : b == $ASTX2_CONST.E2ETYPE_CERT2\n ? l(a.name, $ASTX2_CONST.E2EFORM_TAG2)\n : l(a.name, $ASTX2_CONST.E2EFORM_TAG1));\n }\n function C() {\n if (0 != D)\n for (var a = document.getElementsByTagName('form'), b = 0; b < a.length; b++) {\n var c = a[b];\n if (null != c) {\n var d = !1;\n if (k & $ASTX2_CONST.OPTION_E2EFORM_TAGSET) {\n var e = c.getAttribute(E.e2eform_tagset);\n if (null == e || 0 >= e) d = !0;\n } else if (k & $ASTX2_CONST.OPTION_E2EFORM_ONLY) {\n if (null == c) e = !1;\n else\n for (var e = !1, f = c.getElementsByTagName('input'), g = 0; g < f.length; g++) {\n var h = f[g];\n if (null != h && ((h = h.getAttribute('e2e_type')), null != h && 0 < h)) {\n e = !0;\n break;\n }\n }\n 0 == e && (d = !0);\n }\n if (1 != d) {\n if ((d = $_astxu.getCreatedFormValue(c, l($ASTX2_CONST.E2EFORM_INIT, $ASTX2_CONST.E2EFORM_TAG1))))\n d.value = F;\n if ((d = $_astxu.getCreatedFormValue(c, l($ASTX2_CONST.E2EFORM_INIT, $ASTX2_CONST.E2EFORM_TAG2))))\n d.value = G;\n }\n }\n }\n }\n function V(a) {\n var b = 0;\n k & $ASTX2_CONST.OPTION_E2EFORM_NOENC && (b = 1);\n a = {\n ver: $_astxu.getint(a.ver),\n alg: $_astxu.getint(a.alg),\n svr: $_astxu.getnc(a.svr),\n norsa: $_astxu.getint(a.norsa),\n uniq: $_astxu.getnc(a.uniq),\n utime: $_astxu.getint(a.utime),\n ncert: $_astxu.getnc(a.ncert),\n pageid: $ASTX2_CONST.PAGEID,\n noenc: b\n };\n $_astxu.sendJsonp({\n url: $ASTX2_COMM.mLocalServerURL + '/e2e_forminit',\n data: a,\n onSuccess: function (a) {\n var b = $_astxu.getnc(a ? a.result : '');\n 0 == $_astxu.isACK(b)\n ? $_astxu.msg('[e2e_forminit] result=' + b)\n : ((D = !0), (F = $_astxu.getnc(a.e2e_form1)), (G = $_astxu.getnc(a.e2e_form2)), C());\n },\n onFailure: function () {\n $_astxu.msg('[e2e_forminit] failure.');\n }\n });\n }\n function W() {\n $_astxu.sendAuthAjax({\n url: $ASTX2_CUST.getURL($ASTX2_CUST.URL_GET_CERT),\n onSuccess: function (a) {\n var b = $_astxu.jsonParse(a);\n a = $_astxu.getnc(b ? b.result : '');\n 0 == $_astxu.isACK(a)\n ? $_astxu.msg('[_init_e2eform] result=' + a)\n : $ASTX2.set_cert(\n function () {\n V(b);\n },\n function () {\n $_astxu.msg('[_init_e2eform] set_cert() failure');\n },\n b\n );\n },\n onFailure: function (a) {\n $_astxu.msg('[_init_e2eform] failure');\n }\n });\n }\n function H(a) {\n var b = $_astxu.getHostPath() + $_astxu.getnc(window.location.pathname),\n c = 0;\n k & $ASTX2_CONST.OPTION_NOSPTDUMMY && (c = 1);\n q(\n 'e2e_start',\n { browser: $ASTX2_CONST.BROWSER_VER, ver: a.ver, svr: a.svr, valg: a.valg, url: b, custcode: w, nospt: c },\n 5e3,\n function (a) {\n var b = $_astxu.getnc(a ? a.result : '');\n if ($_astxu.isACK(b)) {\n n = 1;\n I = $_astxu.getint(a.call_settext);\n t = $_astxu.getint(a.call_gettext);\n J = $_astxu.getint(a.vm_env);\n K = $_astxu.getint(a.ak_drv);\n try {\n var c = document.activeElement;\n c && x(c, !1);\n } catch (aa) {}\n k & $ASTX2_CONST.OPTION_E2EFORM &&\n (3 > $_astxu.getint(a.stsvr) ? $ASTX2_COMM.errorAbort($ASTX2_CONST.ERROR_NEEDUPDATE) : W());\n if (k & $ASTX2_CONST.OPTION_AUTOSETTEXT)\n for (var d in u) (a = u[d]), null != a && (0 >= $_astxu.getnc(a.value).length || y(a));\n } else n = 2;\n },\n function () {\n n = 2;\n }\n );\n }\n function L(a) {\n if (0 == $_astxu.hasFocused()) return !1;\n if (0 == n) return !0;\n if (1 == n) {\n if (!1 === a) return;\n try {\n var b = document.activeElement;\n b && x(b, !1);\n } catch (c) {}\n return !0;\n }\n n = 0;\n k & $ASTX2_CONST.OPTION_NONE2E\n ? ((a = 0),\n k & $ASTX2_CONST.OPTION_NONE2E_ALG && (a = $ASTX2.mOptionStrings.none2e_alg),\n H({ ver: 1, svr: '_none2e', valg: a }))\n : $_astxu.sendAuthAjax({\n url: $ASTX2_CUST.getURL($ASTX2_CUST.URL_GET_INIT),\n onSuccess: function (a) {\n a = $_astxu.jsonParse(a);\n var b = $_astxu.getnc(a ? a.result : '');\n $_astxu.isACK(b) ? H(a) : (n = -1);\n },\n onFailure: function (a) {\n n = -1;\n }\n });\n return !0;\n }\n function r(a) {\n if (null != a && (a.getAttribute('e2e_type') != $ASTX2_CONST.E2ETYPE_PLAIN1 || 0 != t)) {\n try {\n if (a != document.activeElement) return;\n } catch (b) {}\n 'number' == typeof a.selectionStart\n ? (a.selectionStart = a.selectionEnd = a.value.length)\n : 'undefined' != typeof a.createTextRange && ((a = a.createTextRange()), a.collapse(!1), a.select());\n }\n }\n function x(a, b) {\n v = !1;\n if (k & $ASTX2_CONST.OPTION_FIXEDTYPE && a) {\n var c = a.getAttribute('e2e_inputid');\n null != c && 0 < c && z[c] != a.type && (a.type = z[c]);\n }\n c = f(a);\n null != c &&\n (!0 === b && L(!1),\n h(\n 'e2e_focus',\n c,\n null,\n function (b) {\n g(a, !1);\n window.setTimeout(function () {\n r(a);\n }, 1);\n },\n function () {}\n ));\n }\n function M(a) {\n var c = b(a);\n if (null != c) {\n if ('function' === typeof $ASTX2_CUST.onHandlerPreFocus) $ASTX2_CUST.onHandlerPreFocus(c, a);\n x(c, !0);\n }\n }\n function N(a) {\n a = b(a);\n if (null != a) {\n var c = e(a);\n if (null != c) {\n try {\n if (document.hasFocus() && a === document.activeElement) return;\n } catch (f) {}\n g(a, !0);\n h('e2e_blur', c);\n }\n }\n }\n function O(a) {\n var c = b(a);\n null != c &&\n window.setTimeout(function () {\n r(c);\n }, 1);\n }\n function y(a, b) {\n var c = f(a);\n if (null != c) {\n var d = $_astxu.getnc(a.value);\n c.text = d;\n k & $ASTX2_CONST.OPTION_E2EFORM && (c.e2eform = 1);\n k & $ASTX2_CONST.OPTION_E2EFORM_NOENC && (c.noenc = 1);\n h(\n 'e2e_settext',\n c,\n null,\n function (d) {\n var e = $_astxu.getnc(d ? d.result : '');\n if (0 == $_astxu.isACK(e)) b && b($ASTX2_CONST.ERROR_NCK);\n else {\n if (k & $ASTX2_CONST.OPTION_E2EFORM) {\n var e = m(a, c.e2e_type),\n f = !1;\n k & $ASTX2_CONST.OPTION_E2EFORM_ALLTRIP && (f = !0);\n if ((e = $_astxu.getCreatedFormValue(a.form, e, f))) e.value = $_astxu.getnc(d.e2e_data);\n }\n b && b($ASTX2_CONST.ERROR_SUCCESS);\n }\n },\n function () {\n b && b($ASTX2_CONST.ERROR_FAILED);\n }\n );\n }\n }\n function A(a) {\n 'function' === typeof a.stopPropagation && a.stopPropagation();\n 'function' === typeof a.preventDefault ? a.preventDefault() : (a.returnValue = !1);\n }\n function X(a, b, c) {\n h(\n 'e2e_gettext',\n b,\n null,\n function (b) {\n var d = $_astxu.getnc(b ? b.result : '');\n $_astxu.isACK(d)\n ? ((b = $_astxu.getnc(b.text)), (a.value = b), c && c($ASTX2_CONST.ERROR_SUCCESS))\n : c && c($ASTX2_CONST.ERROR_NCK);\n },\n function () {\n c && c($ASTX2_CONST.ERROR_FAILED);\n }\n );\n }\n function Y(a, b) {\n k & $ASTX2_CONST.OPTION_E2EFORM_NOENC && (b.noenc = 1);\n h(\n 'e2e_formget',\n b,\n null,\n function (c) {\n var d = $_astxu.getnc(c ? c.result : '');\n if (0 == $_astxu.isACK(d)) $_astxu.msg('[e2e_formget] ' + b.name + ',result=' + d);\n else if (((d = a.form), null != d)) {\n var e = m(a, b.e2e_type),\n f = !1;\n k & $ASTX2_CONST.OPTION_E2EFORM_ALLTRIP && (f = !0);\n if ((d = $_astxu.getCreatedFormValue(d, e, f))) d.value = $_astxu.getnc(c.e2e_data);\n }\n },\n function () {}\n );\n }\n function P(a) {\n var c = b(a);\n if (null != c) {\n var e = f(c);\n if (null != e) {\n r(c);\n var p = $_astxu.getKeyCode(a);\n 17 == p && (v = !0);\n if (1 == v)\n return (\n 86 == p &&\n h(\n 'e2e_clear',\n e,\n null,\n function (a) {\n c.value = '';\n },\n function () {}\n ),\n A(a),\n !1\n );\n if (1 == (16 == p || 17 == p || 18 == p ? !0 : !1)) return !0;\n var g = !0;\n k & $ASTX2_CONST.OPTION_E2EFORM &&\n ((e.e2e_type != $ASTX2_CONST.E2ETYPE_CERT1 && e.e2e_type != $ASTX2_CONST.E2ETYPE_CERT2) || Y(c, e));\n 'function' === typeof $ASTX2_CUST.onHandlerKeyDown &&\n 0 == $ASTX2_CUST.onHandlerKeyDown(c, a) &&\n (A(a), (g = !1));\n 1 != t ||\n ('password' == c.type && e.e2e_type != $ASTX2_CONST.E2ETYPE_PLAIN1) ||\n 0 != J ||\n (1 == g &&\n X(c, e, function () {\n 'password' != c.type &&\n 'dynamic' == c.getAttribute('e2e_txtmsk') &&\n (c.value = c.value.replace(/[^*]/g, '*').substring(0, c.value.length - 1) + c.value.slice(-1));\n }),\n 0 == (8 == p || 9 == p || 13 == p || 20 == p ? !0 : !1) && (A(a), (g = !1)));\n return g;\n }\n }\n }\n function Q(a) {\n var c = b(a);\n null != c &&\n (17 == $_astxu.getKeyCode(a) && (v = !1),\n 1 == I\n ? y(c)\n : 0 == t &&\n 'password' != c.type &&\n 'dynamic' == c.getAttribute('e2e_txtmsk') &&\n (c.value = c.value.replace(/[^*]/g, '*').substring(0, c.value.length - 1) + c.value.slice(-1)),\n window.setTimeout(function () {\n r(c);\n }, 1));\n }\n function R(a) {\n var c = b(a);\n null != c &&\n window.setTimeout(function () {\n r(c);\n }, 1);\n }\n function S(a) {\n if ('IE' == $ASTX2_CONST.BROWSER_TYPE || 'EG' == $ASTX2_CONST.BROWSER_TYPE) {\n var c = b(a);\n null != c &&\n '' != c.value &&\n setTimeout(function () {\n if ('' == c.value) {\n var a = e(c);\n null != a && h('e2e_clear', a);\n }\n }, 1);\n }\n }\n function T(a) {\n var c = b(a);\n null != c &&\n ('number' == typeof c.selectionStart\n ? (c.selectionStart < c.value.length || c.selectionEnd < c.value.length) &&\n window.setTimeout(function () {\n r(c);\n }, 1)\n : 'undefined' != typeof c.createTextRange &&\n document.selection &&\n ((a = document.selection.createRange()),\n a.moveStart('character', -c.value.length),\n a.text.length <= c.value.length &&\n window.setTimeout(function () {\n r(c);\n }, 1)));\n }\n function Z(a) {}\n function U(a) {\n h('e2e_unload');\n }\n var k = 0,\n E = [],\n $ = 0,\n B = !1,\n w = 0,\n n = -1,\n I = 0,\n t = 0,\n J = 0,\n K = 1,\n v = !1,\n u = [],\n z = [],\n D = !1,\n F = '',\n G = '';\n this.setOption = function (a) {\n k |= a;\n };\n this.setOptionStrings = function (a) {\n E = a;\n };\n this.attach = function (a, b) {\n null != a && (w = a);\n k & $ASTX2_CONST.OPTION_AUTOSETTEXT && (u = []);\n k & $ASTX2_CONST.OPTION_E2EFORM && C();\n for (var c = document.getElementsByTagName('input'), d = 0; d < c.length; d++) {\n var e = c[d];\n null != e && this.addObject(e);\n }\n q(\n 'e2e_init',\n null,\n null,\n function (a) {\n L();\n $_astxu.addEvent(window, 'blur', Z);\n $_astxu.addEvent(window, 'unload', U);\n $_astxu.addEvent(window, 'beforeunload', U);\n b && b(!0);\n },\n function () {\n b && b(!1);\n }\n );\n B = !0;\n };\n this.addObject = function (a) {\n if (null != a) {\n var b = a.getAttribute('e2e_inputid');\n if (!(null != b && 0 < b)) {\n var c = a.getAttribute('e2e_type');\n if (null == c || 0 >= c)\n if (((c = a.getAttribute('e2e')), 'true' == c || 'on' == c))\n (c = $ASTX2_CONST.E2ETYPE_CERT1), a.setAttribute('e2e_type', c);\n else {\n c = $ASTX2_CONST.E2ETYPE_NONE;\n try {\n if (\n ('function' === typeof $ASTX2_CUST.isE2EObject &&\n 1 == $ASTX2_CUST.isE2EObject(a) &&\n ((c = $ASTX2_CONST.E2ETYPE_CERT1), a.setAttribute('e2e_type', c)),\n 'function' === typeof $ASTX2_CUST.getE2Etype)\n ) {\n var d = $ASTX2_CUST.getE2Etype(a);\n d && ((c = d), a.setAttribute('e2e_type', c));\n }\n } catch (e) {}\n if (c == $ASTX2_CONST.E2ETYPE_NONE) return;\n }\n b = ++$;\n a.setAttribute('e2e_inputid', b);\n d = !0;\n k & $ASTX2_CONST.OPTION_AUTOSETTEXT && 0 < a.value.length && ((d = !1), u.push(a));\n 1 == d && (a.value = '');\n a.setAttribute('autocomplete', 'off');\n g(a, !0);\n z[b] = a.type;\n $_astxu.addEvent(a, 'focus', M);\n $_astxu.addEvent(a, 'blur', N);\n $_astxu.addEvent(a, 'click', O);\n $_astxu.addEvent(a, 'keyup', Q);\n $_astxu.addEvent(a, 'keydown', P);\n $_astxu.addEvent(a, 'select', T);\n $_astxu.addEvent(a, 'mouseup', S);\n $_astxu.addEvent(a, 'mousedown', R);\n k & $ASTX2_CONST.OPTION_E2EFORM &&\n (c == $ASTX2_CONST.E2ETYPE_CERT1 || c == $ASTX2_CONST.E2ETYPE_CERT2) &&\n ((b = a.form),\n null != b &&\n ((a = m(a, c)),\n (c = !1),\n k & $ASTX2_CONST.OPTION_E2EFORM_ALLTRIP && (c = !0),\n $_astxu.getCreatedFormValue(b, a, c)));\n }\n }\n };\n this.subObject = function (a) {\n var b = e(a);\n if (null != b) {\n $_astxu.removeEvent(a, 'focus', M);\n $_astxu.removeEvent(a, 'blur', N);\n $_astxu.removeEvent(a, 'click', O);\n $_astxu.removeEvent(a, 'keyup', Q);\n $_astxu.removeEvent(a, 'keydown', P);\n $_astxu.removeEvent(a, 'select', T);\n $_astxu.removeEvent(a, 'mouseup', S);\n $_astxu.removeEvent(a, 'mousedown', R);\n try {\n a == document.activeElement && h('e2e_blur', b);\n } catch (c) {}\n a.value = '';\n a.setAttribute('e2e_inputid', -1);\n a.setAttribute('e2e_type', -1);\n g(a, !1);\n }\n };\n this.getE2EHash = function (a, b) {\n var c = e(a);\n null == c\n ? b(null, $ASTX2_CONST.ERROR_PARAM)\n : h(\n 'e2e_gethash',\n c,\n null,\n function (a) {\n var c = $_astxu.getnc(a ? a.result : '');\n $_astxu.isACK(c)\n ? b($_astxu.getnc(a.hash), $ASTX2_CONST.ERROR_SUCCESS)\n : b(null, $ASTX2_CONST.ERROR_NCK);\n },\n function () {\n b(null, $ASTX2_CONST.ERROR_FAILED);\n }\n );\n };\n this.getEncText = function (a, b, c) {\n var d = e(a);\n d.customcode = w;\n d.random = b;\n null == d\n ? c(null, null, $ASTX2_CONST.ERROR_PARAM)\n : h(\n 'sdk_getenctext',\n d,\n null,\n function (a) {\n var b = $_astxu.getnc(a ? a.result : '');\n $_astxu.isACK(b)\n ? c(d.name, $_astxu.getnc(a.getenctext), $ASTX2_CONST.ERROR_SUCCESS)\n : c(null, null, $ASTX2_CONST.ERROR_NCK);\n },\n function () {\n c(null, null, $ASTX2_CONST.ERROR_FAILED);\n }\n );\n };\n this.getE2EText = function (a, b) {\n var c = e(a);\n null == c\n ? b(null, null, $ASTX2_CONST.ERROR_PARAM)\n : c.e2e_type != $ASTX2_CONST.E2ETYPE_PLAIN2 && c.e2e_type != $ASTX2_CONST.E2ETYPE_WIZVERA\n ? b(null, null, $ASTX2_CONST.ERROR_PARAM)\n : h(\n 'e2e_gettext',\n c,\n null,\n function (a) {\n var d = $_astxu.getnc(a ? a.result : '');\n $_astxu.isACK(d)\n ? b(c.name, $_astxu.getnc(a.text), $ASTX2_CONST.ERROR_SUCCESS)\n : b(null, null, $ASTX2_CONST.ERROR_NCK);\n },\n function () {\n b(null, null, $ASTX2_CONST.ERROR_FAILED);\n }\n );\n };\n this.setE2EText = function (a, b) {\n y(a, b);\n };\n this.clearE2EText = function (a, b) {\n var c = e(a);\n null != c &&\n h(\n 'e2e_clear',\n c,\n null,\n function (d) {\n d = $_astxu.getnc(d ? d.result : '');\n if (0 == $_astxu.isACK(d)) b && b($ASTX2_CONST.ERROR_NCK);\n else {\n a.value = '';\n if (k & $ASTX2_CONST.OPTION_E2EFORM) {\n d = m(a, c.e2e_type);\n var e = !1;\n k & $ASTX2_CONST.OPTION_E2EFORM_ALLTRIP && (e = !0);\n if ((d = $_astxu.getCreatedFormValue(a.form, d, e))) d.value = '';\n }\n b && b($ASTX2_CONST.ERROR_SUCCESS);\n }\n },\n function () {\n b && b($ASTX2_CONST.ERROR_FAILED);\n }\n );\n };\n this.dettach = function () {\n h('e2e_uninit');\n B = !1;\n };\n this.isAttached = function () {\n return B;\n };\n this.isStarted = function () {\n return 1 == n ? !0 : !1;\n };\n this.checkService = function (a) {\n var b = {};\n b.service = $ASTX2_CONST.SERVICE_AK;\n b.result = $ASTX2_CONST.ERROR_SUCCESS;\n if (0 >= n) {\n var c = this;\n window.setTimeout(function () {\n c.checkService(a);\n }, 300);\n } else\n 1 == n && 0 == K\n ? (b.result = $ASTX2_CONST.ERROR_FAILED)\n : 2 == n && (b.result = $ASTX2_CONST.ERROR_FAILED),\n a(b);\n };\n this.getE2EelmsForm = function (a, b, c, d) {\n for (var f = document.getElementsByTagName('input'), g = 0; g < f.length; g++) {\n var h = f[g];\n if (null != h && ((h = e(h)), null != h && h.e2e_type == d)) {\n var k = !1;\n null == a ? (k = !0) : $_astxu.getnc(a.name) == h.form && (k = !0);\n 0 != k && (b.push(h.e2e_inputid), c.push(h.name));\n }\n }\n };\n this.getE2EelmsID = function (a, b, c, d) {\n for (var f = document.getElementsByTagName('input'), g = 0; g < f.length; g++) {\n var h = f[g];\n if (null != h) {\n var k = e(h);\n if (null != k && k.e2e_type == d) {\n for (var l = !1, h = $_astxu.getnc(h.id).toLowerCase(), m = 0; m < a.length; m++)\n if (a[m].toLowerCase() == h) {\n l = !0;\n break;\n }\n 0 != l && (b.push(k.e2e_inputid), c.push(k.name));\n }\n }\n }\n };\n this.resetE2Evalues = function (a, b) {\n for (var c = document.getElementsByTagName('input'), d = 0; d < c.length; d++) {\n var f = c[d];\n if (null != f) {\n var g = e(f);\n null != g &&\n g.form == a &&\n g.e2e_type != $ASTX2_CONST.E2ETYPE_PLAIN1 &&\n g.e2e_type != $ASTX2_CONST.E2ETYPE_PLAIN2 &&\n (f.value = b);\n }\n }\n };\n this.getE2Eattribute = function (a) {\n return e(a);\n };\n };\n return {\n getInstance: function (c) {\n null === a && (a = new b(c));\n return a;\n }\n };\n })(),\n $ASTX2 = {\n mUseJQuery: !0,\n mUseAjaxHello: !1,\n mUseAutoStart: !0,\n mOption: 0,\n mOptionStrings: [],\n mE2EInst: null,\n mLastError: $ASTX2_CONST.ERROR_SUCCESS,\n send_e2e_cmd: function (a, b, c, d, e, f) {\n if ('object' == typeof $ASTX2_COMM && 0 != $ASTX2_COMM.isEnable()) {\n var g = this;\n null == f && (f = 1);\n var h = !1;\n if ('e2e_focus' == a || 'e2e_blur' == a || 'e2e_gettext' == a || 'e2e_settext' == a) h = !0;\n $_astxu.sendJsonp({\n url: $ASTX2_COMM.mLocalServerURL + '/' + a,\n data: b,\n timeout: c || 5e3,\n async: !1,\n seq: h,\n onSuccess: function (a) {\n d && d(a);\n },\n onFailure: function () {\n 3 > f ? g.send_e2e_cmd(a, b, c, d, e, f + 1) : e && e();\n }\n });\n }\n },\n _send_alive: function () {\n var a = { pageid: $ASTX2_CONST.PAGEID, focus: $_astxu.hasFocused() ? 1 : 0 };\n $_astxu.sendJsonp({ url: $ASTX2_COMM.mLocalServerURL + '/alive', data: a });\n },\n send_alive_run: function () {\n if (!($ASTX2_COMM.getDegugFlags() & $ASTX2_CONST.DEBUG_NOALIVE)) {\n var a = this;\n setInterval(function () {\n a._send_alive();\n }, $ASTX2_CONST.INTERVAL_ALIVE);\n }\n },\n _hello_local_server: function (a, b, c, d, e) {\n var f = this;\n if (d >= c.length)\n f.setLastError($ASTX2_CONST.ERROR_NOTINST),\n 1 == $_astxu.isWinOS() &&\n 1 == f.mUseAutoStart &&\n ((f.mUseAutoStart = !1),\n 'IE' != $ASTX2_CONST.BROWSER_TYPE &&\n 'EG' != $ASTX2_CONST.BROWSER_TYPE &&\n (window.location.href = 'astx://start')),\n b();\n else {\n var g = e[d],\n h = c[d],\n q = 'https://' + (1 == $_astxu.isMacOS() ? 'lx.astxsvc.com' : '127.0.0.1') + ':' + h + '/ASTX2',\n h = '',\n l = document.getElementsByTagName('script');\n if (l) for (var m = 0; m < l.length; m++) l[m].src && 0 <= l[m].src.indexOf('astx2.min.js') && (h = l[m].src);\n l = '$Revision: 32070 $';\n l = l.substr(11, l.length - 13);\n m = !1;\n 0 == $ASTX2.mUseAjaxHello && 1 == d % 2 && (m = !0);\n 'IE' == $ASTX2_CONST.BROWSER_TYPE &&\n 'IE10' != $ASTX2_CONST.BROWSER_VER &&\n 'IE11' != $ASTX2_CONST.BROWSER_VER &&\n ((m = !0), 2e3 < g && (g = 2e3));\n d++;\n 1 == m\n ? $_astxu.sendJsonp({\n url: q + '/hello',\n data: { url: h, version: l },\n timeout: g,\n onSuccess: function (c) {\n var d = $_astxu.getnc(c ? c.result : '');\n c = $_astxu.getnc(c ? c.client_public_key : '');\n $_astxu.isACK(d)\n ? (($ASTX2_COMM.mLocalServerURL = q), ($ASTX2_COMM.mClientPublicKey = c), a())\n : (f.setLastError($ASTX2_CONST.ERROR_NOTINST), b());\n },\n onFailure: function () {\n f._hello_local_server(a, b, c, d, e);\n }\n })\n : $_astxu.sendAjax({\n url: q + '/hello?',\n type: 'POST',\n data: { url: h, version: l },\n timeout: g,\n onSuccess: function (c) {\n var d = $_astxu.jsonParse(c);\n c = $_astxu.getnc(d ? d.result : '');\n d = $_astxu.getnc(d ? d.client_public_key : '');\n $_astxu.isACK(c)\n ? (($ASTX2_COMM.mLocalServerURL = q), ($ASTX2_COMM.mClientPublicKey = d), a())\n : (f.setLastError($ASTX2_CONST.ERROR_NOTINST), b());\n },\n onFailure: function () {\n f._hello_local_server(a, b, c, d, e);\n }\n });\n }\n },\n setOption: function (a) {\n if (null != a) {\n !0 === a.autofocus && (this.mOption |= $ASTX2_CONST.OPTION_AUTOFOCUS);\n !0 === a.e2eform && (this.mOption |= $ASTX2_CONST.OPTION_E2EFORM);\n !1 === a.e2eform_enc && (this.mOption |= $ASTX2_CONST.OPTION_E2EFORM_NOENC);\n !0 === a.e2eform_alltrip && (this.mOption |= $ASTX2_CONST.OPTION_E2EFORM_ALLTRIP);\n !0 === a.e2eform_only && (this.mOption |= $ASTX2_CONST.OPTION_E2EFORM_ONLY);\n !0 === a.autosettext && (this.mOption |= $ASTX2_CONST.OPTION_AUTOSETTEXT);\n !0 === a.nospt && (this.mOption |= $ASTX2_CONST.OPTION_NOSPTDUMMY);\n !0 === a.fixedtype && (this.mOption |= $ASTX2_CONST.OPTION_FIXEDTYPE);\n var b = $_astxu.getnc(a.e2eform_tagset);\n 0 < b.length &&\n ((this.mOption |= $ASTX2_CONST.OPTION_E2EFORM_TAGSET), (this.mOptionStrings.e2eform_tagset = b));\n b = $_astxu.getint(a.none2e_alg);\n 0 < b && ((this.mOption |= $ASTX2_CONST.OPTION_NONE2E_ALG), (this.mOptionStrings.none2e_alg = b));\n }\n },\n _get_custom_value: function () {\n 'undefined' !== typeof $ASTX2_CUST.mUseJQuery && ($ASTX2.mUseJQuery = $ASTX2_CUST.mUseJQuery);\n 'undefined' !== typeof $ASTX2_CUST.mUseAjaxHello && ($ASTX2.mUseAjaxHello = $ASTX2_CUST.mUseAjaxHello);\n 'undefined' !== typeof $ASTX2_CUST.mUseAutoStart &&\n ($ASTX2.mUseAutoStart = 1 == $ASTX2.mUseAutoStart ? $ASTX2_CUST.mUseAutoStart : !1);\n 'undefined' !== typeof $ASTX2_CUST.E2EFORM_TAIL && ($ASTX2_CONST.E2EFORM_TAIL = $ASTX2_CUST.E2EFORM_TAIL);\n 'undefined' !== typeof $ASTX2_CUST.E2EFORM_INIT && ($ASTX2_CONST.E2EFORM_INIT = $ASTX2_CUST.E2EFORM_INIT);\n 'undefined' !== typeof $ASTX2_CUST.E2EFORM_TAG1 && ($ASTX2_CONST.E2EFORM_TAG1 = $ASTX2_CUST.E2EFORM_TAG1);\n 'undefined' !== typeof $ASTX2_CUST.E2EFORM_TAG2 && ($ASTX2_CONST.E2EFORM_TAG2 = $ASTX2_CUST.E2EFORM_TAG2);\n 'undefined' !== typeof $ASTX2_CUST.E2EFORM_TAG1_PWD &&\n ($ASTX2_CONST.E2EFORM_TAG1_PWD = $ASTX2_CUST.E2EFORM_TAG1_PWD);\n 'undefined' !== typeof $ASTX2_CUST.E2EFORM_TAG2_PWD &&\n ($ASTX2_CONST.E2EFORM_TAG2_PWD = $ASTX2_CUST.E2EFORM_TAG2_PWD);\n },\n init: function (a, b, c, d) {\n function e() {\n a();\n if (1 == $_astxu.isMacLinuxOS()) {\n f.send_alive_run();\n try {\n $ASTX2_MLi.init();\n } catch (b) {}\n }\n }\n this.setLastError($ASTX2_CONST.ERROR_SUCCESS);\n if (1 == $ASTX2_COMM.isEnable()) a();\n else {\n this._get_custom_value();\n null != d && ($ASTX2.mUseAutoStart = 1 == d ? $ASTX2.mUseAutoStart : !1);\n 1 == $ASTX2.mUseJQuery && 'undefined' === typeof jQuery && ($ASTX2.mUseJQuery = !1);\n var f = this;\n this.mE2EInst = $ASTX2_E2E.getInstance(this);\n this.mE2EInst.setOption(this.mOption);\n this.mE2EInst.setOptionStrings(this.mOptionStrings);\n var g = [],\n h = [];\n null != c\n ? ((g = [55920, 55920, 55921, 55922]), (h = [c, c, c, c]))\n : ((g = [55920, 55920, 55921, 55922]), (h = [1e4, 1500, 750, 250]));\n setTimeout(function () {\n f._hello_local_server(e, b, g, 0, h);\n }, 200);\n }\n },\n _check_local_server_chk_stamp: function (a, b, c, d) {\n var e = this;\n $_astxu.sendAuthAjax({\n url: $ASTX2_CUST.getURL($ASTX2_CUST.URL_CHK_STAMP),\n data: d,\n onSuccess: function (c) {\n c = $_astxu.jsonParse(c);\n c = $_astxu.getnc(c ? c.result : '');\n $_astxu.isACK(c) ? a() : (e.setLastError($ASTX2_CONST.ERROR_NCK), b());\n },\n onFailure: function (a) {\n b();\n }\n });\n },\n _check_local_server: function (a, b, c, d) {\n var e = this;\n null == d && (d = 1);\n 3 < d\n ? (e.setLastError($ASTX2_CONST.ERROR_NOCONNECT), b())\n : $_astxu.sendJsonp({\n url: $ASTX2_COMM.mLocalServerURL + '/check',\n data: { method: c, url: $ASTX2_CUST.getURL($ASTX2_CUST.URL_GET_STAMP), rnd: $_astxu.rnd() },\n onSuccess: function (f) {\n var g = $_astxu.getnc(f ? f.result : '');\n $_astxu.isACK(g)\n ? ((f.rnd = $_astxu.rnd()), e._check_local_server_chk_stamp(a, b, c, f))\n : e._check_local_server(a, b, c, d + 1);\n },\n onFailure: function () {\n e.setLastError($ASTX2_CONST.ERROR_FAILED);\n e._check_local_server(a, b, c, d + 1);\n }\n });\n },\n checkServer: function (a, b, c) {\n this.setLastError($ASTX2_CONST.ERROR_SUCCESS);\n 0 == $ASTX2_COMM.isEnable()\n ? (this.setLastError($ASTX2_CONST.ERROR_NOINIT), b())\n : (0 == $_astxu.isWinOS() ? (c = 1) : null == c && (c = 1), this._check_local_server(a, b, c));\n },\n _e2e_enable: function () {\n return 0 == $_astxu.isWinOS()\n ? (this.setLastError($ASTX2_CONST.ERROR_NOTSUPPORTED), !1)\n : 0 == $ASTX2_COMM.isEnable()\n ? (this.setLastError($ASTX2_CONST.ERROR_NOINIT), !1)\n : !0;\n },\n resetE2E: function (a, b) {\n this.setLastError($ASTX2_CONST.ERROR_SUCCESS);\n if (0 == this._e2e_enable()) return !1;\n var c = this;\n window.setTimeout(function () {\n c.mE2EInst.attach(a, b);\n }, 100);\n return !0;\n },\n initE2E: function (a, b) {\n this.mOption & $ASTX2_CONST.OPTION_AUTOFOCUS && $_astxu.setInputFocus();\n return this.resetE2E(a, b);\n },\n resetNonE2E: function (a, b) {\n return this.initNonE2E(a, b);\n },\n initNonE2E: function (a, b) {\n this.mE2EInst.setOption($ASTX2_CONST.OPTION_NONE2E);\n this.mOption & $ASTX2_CONST.OPTION_AUTOFOCUS && $_astxu.setInputFocus();\n return this.resetE2E(a, b);\n },\n uninitE2E: function () {\n 1 == $_astxu.isWinOS() && 1 == $ASTX2_COMM.isEnable() && this.mE2EInst.dettach();\n },\n uninitNonE2E: function () {\n this.uninitE2E();\n },\n set_cert: function (a, b, c, d) {\n null == d && (d = 1);\n var e = new String($_astxu.getnc(c['cert' + d]));\n if (0 == e.length) 0 < d ? a() : b();\n else {\n var f = this;\n $_astxu.sendJsonp({\n url: $ASTX2_COMM.mLocalServerURL + '/set_cert',\n data: { step: d, cert: e, pageid: $ASTX2_CONST.PAGEID },\n onSuccess: function (e) {\n setTimeout(function () {\n f.set_cert(a, b, c, d + 1);\n }, 250);\n },\n onFailure: function () {\n b();\n }\n });\n }\n },\n _e2edata_get: function (a, b, c, d) {\n var e = this;\n a = {\n ver: $_astxu.getint(d.ver),\n alg: $_astxu.getint(d.alg),\n svr: $_astxu.getnc(d.svr),\n norsa: $_astxu.getint(d.norsa),\n uniq: $_astxu.getnc(d.uniq),\n utime: $_astxu.getint(d.utime),\n ncert: $_astxu.getnc(d.ncert),\n pageid: $ASTX2_CONST.PAGEID,\n ids1: a.ids1,\n names1: a.names1,\n ids2: a.ids2,\n names2: a.names2\n };\n $_astxu.sendJsonp({\n url: $ASTX2_COMM.mLocalServerURL + '/get_data',\n data: a,\n timeout: 1e4,\n onSuccess: function (a) {\n var d = $_astxu.getnc(a ? a.result : '');\n $_astxu.isACK(d) ? b(a) : (e.setLastError($ASTX2_CONST.ERROR_NCK), c());\n },\n onFailure: function () {\n e.setLastError($ASTX2_CONST.ERROR_FAILED);\n c();\n }\n });\n },\n _e2edata: function (a, b, c) {\n var d = this;\n $_astxu.sendAuthAjax({\n url: $ASTX2_CUST.getURL($ASTX2_CUST.URL_GET_CERT),\n onSuccess: function (e) {\n var f = $_astxu.jsonParse(e);\n e = $_astxu.getnc(f ? f.result : '');\n 0 == $_astxu.isACK(e)\n ? (d.setLastError($ASTX2_CONST.ERROR_NCK), c())\n : d.set_cert(\n function () {\n d._e2edata_get(a, b, c, f);\n },\n function () {\n d.setLastError($ASTX2_CONST.ERROR_NOCONNECT);\n c();\n },\n f\n );\n },\n onFailure: function (a) {\n d.setLastError($ASTX2_CONST.ERROR_FAILED);\n c();\n }\n });\n },\n getE2EData: function (a, b, c) {\n this.setLastError($ASTX2_CONST.ERROR_SUCCESS);\n if (0 == this._e2e_enable()) c();\n else {\n var d = [],\n e = [],\n f = [],\n g = [];\n this.mE2EInst.getE2EelmsForm(a, d, e, 1);\n this.mE2EInst.getE2EelmsForm(a, f, g, 2);\n a = { ids1: d.join(','), names1: e.join(','), ids2: f.join(','), names2: g.join(',') };\n this._e2edata(a, b, c);\n }\n },\n getE2EDataRetry: function (a, b, c, d, e) {\n null == d && (d = 3);\n null == e && (e = 1e3);\n if (0 >= d) this.setLastError($ASTX2_CONST.ERROR_EXCESS), c();\n else {\n var f = this;\n this.getE2EData(\n a,\n function (a) {\n b(a);\n },\n function () {\n f.getLastError() == $ASTX2_CONST.ERROR_NOINIT\n ? window.setTimeout(function () {\n f.getE2EDataRetry(a, b, c, d - 1, e);\n }, e)\n : c();\n }\n );\n }\n },\n getE2EDataIDs: function (a, b, c) {\n this.setLastError($ASTX2_CONST.ERROR_SUCCESS);\n if (0 == this._e2e_enable()) c();\n else {\n null == a && (that.setLastError($ASTX2_CONST.ERROR_PARAM), c());\n var d = [],\n e = [],\n f = [],\n g = [];\n this.mE2EInst.getE2EelmsID(a, d, e, 1);\n this.mE2EInst.getE2EelmsID(a, f, g, 2);\n a = { ids1: d.join(','), names1: e.join(','), ids2: f.join(','), names2: g.join(',') };\n this._e2edata(a, b, c);\n }\n },\n setE2EData: function (a, b, c, d) {\n null == c && (c = !0);\n null == d && (d = '');\n var e = $_astxu.getnc(b.e2e_data1);\n 0 < e.length && ($_astxu.getCreatedFormValue(a, 'e2e_data1').value = e);\n b = $_astxu.getnc(b.e2e_data2);\n 0 < b.length && ($_astxu.getCreatedFormValue(a, 'e2e_data2').value = b);\n 1 == c && this.mE2EInst.resetE2Evalues($_astxu.getnc(a.name), d);\n },\n getE2EPageID: function () {\n return $ASTX2_CONST.PAGEID;\n },\n getE2EInputID: function (a) {\n a = this.mE2EInst.getE2Eattribute(a);\n return null == a ? null : a.e2e_inputid;\n },\n getE2EHash: function (a, b) {\n this.mE2EInst.getE2EHash(a, function (a, d) {\n b(a, d);\n });\n },\n getEncText: function (a, b, c) {\n this.mE2EInst.getEncText(a, b, function (a, b, f) {\n c(b, f);\n });\n },\n getE2EText: function (a, b) {\n this.mE2EInst.getE2EText(a, function (a, d, e) {\n b(d, e);\n });\n },\n getE2ETextS: function (a, b) {\n for (var c = 0, d = 0, e = [], f = 0; f < a.length; f++) {\n var g = a[f];\n null != g && ((g = g.getAttribute('e2e_type')), null != g && g == $ASTX2_CONST.E2ETYPE_PLAIN2 && c++);\n }\n if (0 == c || c != a.length) b(e, $ASTX2_CONST.ERROR_PARAM);\n else\n for (f = 0; f < a.length; f++)\n this.mE2EInst.getE2EText(a[f], function (a, f, g) {\n d >= c || (0 == g ? (e[a] = f) : (d = c), ++d >= c && b(e, g));\n });\n },\n setE2EText: function (a, b) {\n this.mE2EInst.setE2EText(a, b);\n },\n clearE2EText: function (a, b) {\n this.mE2EInst.clearE2EText(a, b);\n },\n clearE2EForm: function (a) {\n for (var b = document.getElementsByTagName('input'), c = 0; c < b.length; c++) {\n var d = b[c];\n null != d &&\n d.form.name == a &&\n 0 != ('text' == d.type || 'password' == d.type) &&\n null != d.getAttribute('e2e_type') &&\n this.mE2EInst.clearE2EText(d);\n }\n },\n addE2EObject: function (a, b) {\n null == b && (b = $ASTX2_CONST.E2ETYPE_CERT1);\n !a || ('text' != a.type && 'password' != a.type) || (a.setAttribute('e2e_type', b), this.mE2EInst.addObject(a));\n },\n subE2EObject: function (a) {\n a && this.mE2EInst.subObject(a);\n },\n setE2EAllExceptInputs: function () {\n for (var a = document.getElementsByTagName('input'), b = 0; b < a.length; b++) {\n var c = a[b];\n null != c &&\n 0 != ('text' == c.type || 'password' == c.type) &&\n null == c.getAttribute('e2e_type') &&\n c.setAttribute('e2e_type', $ASTX2_CONST.E2ETYPE_NONE);\n }\n },\n killFocusE2EAllInputs: function () {\n for (var a = document.getElementsByTagName('input'), b = 0; b < a.length; b++) {\n var c = a[b];\n null != c && 0 != ('text' == c.type || 'password' == c.type) && 0 < c.getAttribute('e2e_type') && c.blur();\n }\n },\n _pclogdata_get: function (a, b, c, d) {\n var e = this;\n c = {\n ver: $_astxu.getint(c.ver),\n alg: $_astxu.getint(c.alg),\n svr: $_astxu.getnc(c.svr),\n norsa: $_astxu.getint(c.norsa),\n uniq: $_astxu.getnc(c.uniq),\n utime: $_astxu.getint(c.utime),\n nlog: $_astxu.getnc(c.nlog),\n ipaddr: $_astxu.getnc(c.ipaddr),\n s2c_alg: $_astxu.getnc(c.s2c_alg),\n s2c_key: $_astxu.getnc(c.s2c_key),\n s2c_salt: $_astxu.getnc(c.s2c_salt),\n browser: $ASTX2_CONST.BROWSER_VER,\n pageid: $ASTX2_CONST.PAGEID,\n opt: d\n };\n $_astxu.sendJsonp({\n url: $ASTX2_COMM.mLocalServerURL + '/get_pclog',\n data: c,\n timeout: 1e4,\n onSuccess: function (c) {\n var d = $_astxu.getnc(c ? c.result : '');\n $_astxu.isACK(d) ? a(c) : (e.setLastError($ASTX2_CONST.ERROR_NCK), b());\n },\n onFailure: function () {\n e.setLastError($ASTX2_CONST.ERROR_FAILED);\n b();\n }\n });\n },\n _pclogdata: function (a, b, c) {\n var d = this;\n $_astxu.sendAuthAjax({\n url: $ASTX2_CUST.getURL($ASTX2_CUST.URL_GET_CERT),\n data: { pclog: 1, client_public_key: $ASTX2_COMM.mClientPublicKey },\n onSuccess: function (e) {\n var f = $_astxu.jsonParse(e);\n e = $_astxu.getnc(f ? f.result : '');\n 0 == $_astxu.isACK(e)\n ? (d.setLastError($ASTX2_CONST.ERROR_NCK), b())\n : d.set_cert(\n function () {\n d._pclogdata_get(a, b, f, c);\n },\n function () {\n d.setLastError($ASTX2_CONST.ERROR_NOCONNECT);\n b();\n },\n f\n );\n },\n onFailure: function (a) {\n d.setLastError($ASTX2_CONST.ERROR_FAILED);\n b();\n }\n });\n },\n getPCLOGData: function (a, b, c, d) {\n null == d && (d = '');\n this.setLastError($ASTX2_CONST.ERROR_SUCCESS);\n 0 == $ASTX2_COMM.isEnable() ? (this.setLastError($ASTX2_CONST.ERROR_NOINIT), c()) : this._pclogdata(b, c, d);\n },\n getPCLOGDataRetry: function (a, b, c, d, e) {\n null == d && (d = 3);\n null == e && (e = 1e3);\n if (0 >= d) this.setLastError($ASTX2_CONST.ERROR_EXCESS), c();\n else {\n var f = this;\n this.getPCLOGData(\n a,\n function (a) {\n b(a);\n },\n function () {\n f.getLastError() == $ASTX2_CONST.ERROR_NOINIT\n ? window.setTimeout(function () {\n f.getPCLOGDataRetry(a, b, c, d - 1, e);\n }, e)\n : c();\n }\n );\n }\n },\n setPCLOGData: function (a, b) {\n var c = $_astxu.getnc(b.pclog_data);\n 0 < c.length && ($_astxu.getCreatedFormValue(a, 'pclog_data').value = c);\n },\n isVmEnv: function (a, b) {\n 0 == $ASTX2_COMM.isEnable()\n ? a(null, $ASTX2_CONST.ERROR_NOINIT)\n : (null == b && (b = ''),\n $_astxu.sendJsonp({\n url: $ASTX2_COMM.mLocalServerURL + '/is_vm_env',\n data: { opts: b },\n onSuccess: function (b) {\n var d = $_astxu.getnc(b ? b.result : '');\n $_astxu.isACK(d) ? a(b.vm_env, $ASTX2_CONST.ERROR_SUCCESS) : a(null, $ASTX2_CONST.ERROR_NCK);\n },\n onFailure: function () {\n a(null, $ASTX2_CONST.ERROR_FAILED);\n }\n }));\n },\n isRemoteEnv: function (a, b) {\n 0 == $ASTX2_COMM.isEnable()\n ? a(null, $ASTX2_CONST.ERROR_NOINIT)\n : (null == b && (b = ''),\n $_astxu.sendJsonp({\n url: $ASTX2_COMM.mLocalServerURL + '/is_remote_env',\n data: { opts: b },\n onSuccess: function (b) {\n var d = $_astxu.getnc(b ? b.result : '');\n $_astxu.isACK(d) ? a(b.remote_env, $ASTX2_CONST.ERROR_SUCCESS) : a(null, $ASTX2_CONST.ERROR_NCK);\n },\n onFailure: function () {\n a(null, $ASTX2_CONST.ERROR_FAILED);\n }\n }));\n },\n isVmRemoteEnv: function (a, b) {\n 0 == $ASTX2_COMM.isEnable()\n ? a(null, $ASTX2_CONST.ERROR_NOINIT)\n : (null == b && (b = ''),\n $_astxu.sendJsonp({\n url: $ASTX2_COMM.mLocalServerURL + '/is_vm_remote_env',\n data: { opts: b },\n onSuccess: function (b) {\n var d = $_astxu.getnc(b ? b.result : '');\n $_astxu.isACK(d) ? a(b.vm_remote_env, $ASTX2_CONST.ERROR_SUCCESS) : a(null, $ASTX2_CONST.ERROR_NCK);\n },\n onFailure: function () {\n a(null, $ASTX2_CONST.ERROR_FAILED);\n }\n }));\n },\n checkService: function (a, b) {\n a == $ASTX2_CONST.SERVICE_AK && this.mE2EInst.checkService(b);\n },\n setProtect: function (a, b) {\n if (0 == $ASTX2_COMM.isEnable()) b && b($ASTX2_CONST.ERROR_NOINIT);\n else {\n var c = {\n customerid: $_astxu.getnc($ASTX2_CUST.mCustomerID),\n ak: a & $ASTX2_CONST.PROTECT_AK ? 1 : -1,\n fw: a & $ASTX2_CONST.PROTECT_FW ? 1 : -1,\n pb: a & $ASTX2_CONST.PROTECT_PB ? 1 : -1,\n pcs: a & $ASTX2_CONST.PROTECT_PCS ? 1 : -1\n };\n $_astxu.sendJsonp({\n url: $ASTX2_COMM.mLocalServerURL + '/set_protect',\n data: c,\n onSuccess: function (a) {\n a = $_astxu.getnc(a ? a.result : '');\n $_astxu.isACK(a) ? b && b($ASTX2_CONST.ERROR_SUCCESS) : b && b($ASTX2_CONST.ERROR_NCK);\n },\n onFailure: function () {\n b && b($ASTX2_CONST.ERROR_FAILED);\n }\n });\n }\n },\n isNotSupportOS: function (a, b) {\n 0 == $ASTX2_COMM.isEnable()\n ? b && b(null, $ASTX2_CONST.ERROR_NOINIT)\n : $_astxu.sendJsonp({\n url: $ASTX2_COMM.mLocalServerURL + '/is_not_support_os',\n data: {\n ak: a & $ASTX2_CONST.PROTECT_AK ? 1 : 0,\n fw: a & $ASTX2_CONST.PROTECT_FW ? 1 : 0,\n pb: a & $ASTX2_CONST.PROTECT_PB ? 1 : 0,\n pcs: a & $ASTX2_CONST.PROTECT_PCS ? 1 : 0\n },\n onSuccess: function (a) {\n var d = $_astxu.getnc(a ? a.result : '');\n $_astxu.isACK(d) ? b && b(a, $ASTX2_CONST.ERROR_SUCCESS) : b && b(null, $ASTX2_CONST.ERROR_NCK);\n },\n onFailure: function () {\n b && b(null, $ASTX2_CONST.ERROR_FAILED);\n }\n });\n },\n isAccessible: function (a, b, c, d, e) {\n null == e && (e = 750);\n if (a == $ASTX2_CONST.REQUEST_JSONP)\n $_astxu.sendJsonp({\n url: b,\n nocallback: !0,\n timeout: e,\n onSuccess: function () {\n c && c(b);\n },\n onFailure: function () {\n d && d(b);\n }\n });\n else {\n if (\n 0 != b.indexOf(window.location.protocol + '//' + window.location.host) &&\n 'IE' == $ASTX2_CONST.BROWSER_TYPE\n ) {\n if ('IE10' != $ASTX2_CONST.BROWSER_VER && 'IE11' != $ASTX2_CONST.BROWSER_VER) {\n d && d(b, 'CORS, not allowed browser');\n return;\n }\n if (0 != b.indexOf('http:') && 0 != b.indexOf('https:')) {\n d && d(b, 'CORS, not allowed protocol');\n return;\n }\n }\n $_astxu.sendAjax({\n url: b,\n type: 'GET',\n timeout: e,\n onSuccess: function (a) {\n c && c(b);\n },\n onFailure: function (a) {\n d && d(b, a);\n }\n });\n }\n },\n uninit: function () {\n this.uninitE2E();\n $ASTX2_COMM.uninit();\n },\n setLastError: function (a) {\n this.mLastError = a;\n },\n getLastError: function () {\n return this.mLastError;\n }\n };\n$ASTX2_MLi = {\n init: function () {\n setTimeout(function () {\n var a = { pageid: $ASTX2_CONST.PAGEID, focus: $_astxu.hasFocused() ? 1 : 0 };\n $_astxu.sendJsonp({ url: $ASTX2_COMM.mLocalServerURL + '/initForML', timeout: 1e3, data: a });\n }, 200);\n }\n};\n\nwindow.$ASTX2 = {\n ...$ASTX2,\n $ASTX2_COMM,\n $_astxu,\n $ASTX2_E2E,\n $ASTX2_MLi\n};\n\n/* ASTx 1.3 | (C) Copyright AhnLab, Inc. | $Revision: 30833 $ */\nconst getSubdomain = (hostname) => {\n if (!hostname || hostname === 'localhost' || hostname === '127.0.0.1') {\n return '';\n }\n\n const parts = hostname.split('.');\n\n // \uCD5C\uC18C 3\uAC1C \uBD80\uBD84\uC774 \uC788\uC5B4\uC57C \uC11C\uBE0C\uB3C4\uBA54\uC778 \uC874\uC7AC (subdomain.domain.com)\n if (parts.length < 3) {\n return '';\n }\n\n // \uCCAB \uBC88\uC9F8 \uBD80\uBD84\uC774 \uC11C\uBE0C\uB3C4\uBA54\uC778\n return parts[0] ?? '';\n};\n\n/**\n * \uD638\uC2A4\uD2B8\uBA85\uC744 \uAE30\uBC18\uC73C\uB85C \uD658\uACBD\uC744 \uD310\uB2E8\uD569\uB2C8\uB2E4.\n * @param hostname \uD638\uC2A4\uD2B8\uBA85\n * @returns \uD658\uACBD \uAD6C\uBD84 \uBB38\uC790\uC5F4 ('local' | 'dev' | 'stg' | 'prd')\n */\nconst getEnvironmentFromHostname = (hostname) => {\n const subDomain = getSubdomain(hostname);\n\n // localhost \uD310\uB2E8\n if (hostname === 'localhost' || hostname === '127.0.0.1' || hostname.startsWith('localhost:')) {\n return 'local';\n }\n\n // dev \uD658\uACBD \uD310\uB2E8\n if (subDomain.includes(`dev`)) {\n return 'dev';\n }\n\n // stg \uD658\uACBD \uD310\uB2E8\n if (subDomain.includes('stg')) {\n return 'stg';\n }\n\n // \uAE30\uBCF8 \uC6B4\uC601\n return 'prd';\n};\n\nconst getServicePath = () => {\n if (typeof window.isStorybookEnv === 'boolean') {\n return '';\n } else {\n return `/${location.pathname.split('/')[1]}`;\n }\n};\n";
256
+ var astx2_custom_default = "/* ASTx 1.3 | (C) Copyright AhnLab, Inc. | $Revision: 30833 $ */\r\n/* eslint-disable */\r\n\r\nlet $ASTX2_CUST = {\r\n // Customer option\r\n /*\r\n mUseJQuery: false, // Whether to use JQuery. \r\n mUseAjaxHello: false,\r\n mUseAutoStart: false, \r\n E2EFORM_TAIL: true,\r\n E2EFORM_INIT: '_e2e_forminit',\r\n E2EFORM_TAG1: '_e2e_1__',\r\n E2EFORM_TAG2: '_e2e_2__',\r\n E2EFORM_TAG1_PWD: '_e2e_1_pwd__',\r\n E2EFORM_TAG2_PWD: '_e2e_2_pwd__',\r\n */\r\n\r\n mCustomerID: null, // Customer ID for setProtect.\r\n\r\n // ASTX2_CUST defined values\r\n URL_GET_INIT: 101,\r\n URL_GET_CERT: 102,\r\n URL_GET_STAMP: 103,\r\n URL_CHK_STAMP: 104,\r\n\r\n setCustomerID(customerID) {\r\n if (customerID !== null && customerID !== 'undefined') {\r\n this.mCustomerID = customerID;\r\n }\r\n },\r\n\r\n getURL(type) {\r\n let result = '';\r\n const timestamp = new Date().getTime();\r\n\r\n switch (type) {\r\n case this.URL_GET_INIT:\r\n result = `${getServicePath()}/api/dea/sltn/astx2/init/get`;\r\n break;\r\n case this.URL_GET_CERT:\r\n result = `${getServicePath()}/api/dea/sltn/astx2/cert/get?v=${timestamp}`; // WAF \uCC28\uB2E8 \uBC29\uC9C0 (post \uC694\uCCAD \uC2DC \uAC12\uC774 \uC5C6\uB294 \uACBD\uC6B0 \uCC28\uB2E8)\r\n break;\r\n case this.URL_GET_STAMP:\r\n result = `${getServicePath()}/api/dea/sltn/astx2/stamp/get`;\r\n break;\r\n case this.URL_CHK_STAMP:\r\n result = `${getServicePath()}/api/dea/sltn/astx2/stamp-chk/post`;\r\n break;\r\n } // end of switch\r\n\r\n return result;\r\n },\r\n\r\n isE2EObject(obj) {\r\n return false;\r\n },\r\n\r\n getE2Etype(obj) {\r\n return null;\r\n },\r\n\r\n onCreatedFormValue(obj, obj_name) {},\r\n\r\n onHandlerPreFocus(obj, event) {},\r\n\r\n onHandlerKeyDown(obj, event) {\r\n return true;\r\n },\r\n\r\n getErrorMessage(errno) {\r\n let message = '[ASTx] ';\r\n\r\n switch (errno) {\r\n case $ASTX2_CONST.ERROR_FAILED:\r\n message += '\uB0B4\uBD80 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD558\uC600\uC2B5\uB2C8\uB2E4.';\r\n break;\r\n case $ASTX2_CONST.ERROR_NOINIT:\r\n message += '\uCD08\uAE30\uD654\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.';\r\n break;\r\n case $ASTX2_CONST.ERROR_NOTINST:\r\n message += '\uC124\uCE58\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.';\r\n break;\r\n case $ASTX2_CONST.ERROR_NOTSUPPORTED:\r\n message += '\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 OS\uC785\uB2C8\uB2E4.';\r\n break;\r\n case $ASTX2_CONST.ERROR_NOCONNECT:\r\n message += '\uC11C\uBC84(Web) \uD1B5\uC2E0 \uC2E4\uD328\uC785\uB2C8\uB2E4.';\r\n break;\r\n case $ASTX2_CONST.ERROR_NCK:\r\n message += '\uC11C\uBC84(Local) \uC751\uB2F5 \uC2E4\uD328\uC785\uB2C8\uB2E4.';\r\n break;\r\n case $ASTX2_CONST.ERROR_ERR:\r\n message += '\uC11C\uBC84(Local) \uB0B4\uBD80 \uC624\uB958\uC785\uB2C8\uB2E4.';\r\n break;\r\n case $ASTX2_CONST.ERROR_NSP:\r\n message += '\uC9C0\uC6D0\uD558\uC9C0 \uB418\uC9C0 \uC54A\uB294 \uD658\uACBD\uC785\uB2C8\uB2E4.';\r\n break;\r\n case $ASTX2_CONST.ERROR_PARAM:\r\n message += '\uC798\uBABB\uB41C \uC778\uC790\uC785\uB2C8\uB2E4.';\r\n break;\r\n case $ASTX2_CONST.ERROR_EXCESS:\r\n message += '\uC7AC\uC2DC\uB3C4 \uD68C\uC218\uB97C \uCD08\uACFC \uD558\uC600\uC2B5\uB2C8\uB2E4.';\r\n break;\r\n case $ASTX2_CONST.ERROR_NEEDUPDATE:\r\n message += '\uC81C\uD488 \uC5C5\uB370\uC774\uD2B8\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.';\r\n break;\r\n default:\r\n message += `errno=${errno}`;\r\n break;\r\n } // end of switch\r\n\r\n return message;\r\n },\r\n\r\n errorAbort(errno) {\r\n alert(this.getErrorMessage(errno));\r\n }\r\n};\r\n";
257
+ function addE2EObject(el, e2e_type) {
258
+ if (window.$ASTX2) {
259
+ window.$ASTX2.addE2EObject(el, e2e_type);
260
+ window.$ASTX2.resetE2E();
261
+ }
262
+ }
263
+ var loadScript = (callback) => {
264
+ if (!window.$ASTX2) {
265
+ console.log("dynamic load");
266
+ const script = document.createElement("script");
267
+ script.innerHTML = `
268
+ ${astx2_min_default}
269
+ ${astx2_custom_default}
270
+ `;
271
+ document.head.appendChild(script);
272
+ script.onload = () => {
273
+ };
274
+ }
275
+ };
276
+ var init = ({
277
+ initSuccess = () => {
278
+ },
279
+ initFailure = () => {
280
+ },
281
+ checkServerSuccess = () => {
282
+ },
283
+ checkServerFailure = () => {
284
+ }
285
+ } = {}) => {
286
+ window.$ASTX2.init(
287
+ () => {
288
+ window.$ASTX2.initE2E();
289
+ window.$ASTX2.checkServer(
290
+ () => {
291
+ checkServerSuccess();
292
+ },
293
+ () => {
294
+ checkServerFailure();
295
+ console.error(`ASTX.checkServer() onFailure: errno=${window.$ASTX2.getLastError()}`);
296
+ }
490
297
  );
491
- return;
298
+ initSuccess();
299
+ },
300
+ () => {
301
+ initFailure();
302
+ if (window.$ASTX2.getLastError() === 103) {
303
+ console.error("AhnLab Safe Transaction \uD074\uB77C\uC774\uC5B8\uD2B8\uAC00 \uC124\uCE58\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.");
304
+ } else {
305
+ console.error(`$ASTX2.init() onFailure: errno=${window.$ASTX2.getLastError()}`);
306
+ }
492
307
  }
493
- if (step === "search-result") {
494
- setStep("detail-input");
495
- setNextButtonDisabled(true);
496
- if (selectedAddress) {
497
- setStandardizationParams({
498
- firstPostalCode: selectedAddress.firstPostalCode,
499
- secondPostalCode: selectedAddress.secondPostalCode,
500
- baseAddress: selectedAddress.roadNameBaseAddress,
501
- detailAddress: selectedAddress.roadNameDetailAddress,
502
- roadNameYn: "Y"
503
- });
308
+ );
309
+ };
310
+ var initASTX2 = ({
311
+ initSuccess = () => {
312
+ },
313
+ initFailure = () => {
314
+ },
315
+ checkServerSuccess = () => {
316
+ },
317
+ checkServerFailure = () => {
318
+ }
319
+ } = {}) => {
320
+ if (window.$ASTX2) {
321
+ init({
322
+ initSuccess,
323
+ initFailure,
324
+ checkServerSuccess,
325
+ checkServerFailure
326
+ });
327
+ }
328
+ };
329
+ function getE2EDataIDs(ids, onSuccess, onFailure = () => {
330
+ }) {
331
+ if (window.$ASTX2) {
332
+ window.$ASTX2.getE2EDataIDs(
333
+ ids,
334
+ async (astx_data) => {
335
+ onSuccess(astx_data);
336
+ },
337
+ () => {
338
+ onFailure();
339
+ console.log(`ASTX.getE2EData() onFailure: errno=${window.$ASTX2.getLastError()}`);
504
340
  }
505
- } else {
506
- selectedStandardizationAddress && setValue({
507
- ...selectedStandardizationAddress,
508
- detailAddressInput
509
- });
510
- onClose();
341
+ );
342
+ }
343
+ }
344
+ dayjs.locale("ko");
345
+ dayjs.extend(customParseFormat);
346
+ var convertDateString = ({ dateString, fromFormat, toFormat }) => {
347
+ return dayjs(dateString, fromFormat).format(toFormat);
348
+ };
349
+ var isDate = (value) => {
350
+ return value instanceof Date && !isNaN(+value);
351
+ };
352
+
353
+ const FormDatePicker = ({
354
+ name,
355
+ control,
356
+ disabled,
357
+ defaultValue,
358
+ ...props
359
+ }) => {
360
+ const { field, fieldState } = useController({ name, control, disabled, defaultValue });
361
+ const [selected, setSelected] = React.useState();
362
+ React.useEffect(() => {
363
+ if (isDate(field.value) && field.value !== selected) {
364
+ setSelected(field.value);
511
365
  }
512
- };
513
- const onSearch = (e) => {
514
- const typeStr = e.target.value;
515
- setSearchInput(typeStr);
516
- };
517
- const search = () => {
518
- if (searchInput === "") {
519
- onClear();
366
+ }, [field.value]);
367
+ return /* @__PURE__ */ jsx(
368
+ DatePicker,
369
+ {
370
+ tabIndex: 0,
371
+ ...{
372
+ ...props,
373
+ ...field,
374
+ id: field.name,
375
+ defaultValue: selected,
376
+ error: fieldState.invalid,
377
+ onValueChange: field.onChange
378
+ }
379
+ }
380
+ );
381
+ };
382
+
383
+ const FormDateRangePicker = ({
384
+ name,
385
+ control,
386
+ disabled,
387
+ defaultValue,
388
+ ...props
389
+ }) => {
390
+ const { field, fieldState } = useController({
391
+ name,
392
+ control,
393
+ disabled,
394
+ defaultValue
395
+ });
396
+ const [selected, setSelected] = React.useState();
397
+ React.useEffect(() => {
398
+ const fieldValue = field.value;
399
+ if (!fieldValue) {
400
+ setSelected(void 0);
520
401
  return;
521
402
  }
522
- if (searchInput && searchInput.length > 1) {
523
- const isNumeric = /^[0-9]+$/.test(searchInput);
524
- setSearchType(isNumeric ? "postalcode" : "address");
525
- setSearchKeyword(searchInput);
526
- setStep("search-result");
527
- setSelectedAddress(void 0);
528
- setDetailAddressInput("");
529
- setNextButtonDisabled(true);
403
+ const isStartDateDifferent = fieldValue.startDate?.getTime() !== selected?.startDate?.getTime();
404
+ const isEndDateDifferent = fieldValue.endDate?.getTime() !== selected?.endDate?.getTime();
405
+ if (!selected || isStartDateDifferent || isEndDateDifferent) {
406
+ setSelected(fieldValue);
530
407
  }
531
- };
532
- const onKeyUp = (e) => {
533
- if (e.key === "Enter") {
534
- search();
408
+ }, [field.value]);
409
+ return /* @__PURE__ */ jsx(
410
+ DateRangePicker,
411
+ {
412
+ tabIndex: 0,
413
+ ...{
414
+ ...props,
415
+ ...field,
416
+ id: field.name,
417
+ defaultValue: selected,
418
+ error: fieldState.invalid,
419
+ onValueChange: field.onChange
420
+ }
535
421
  }
536
- };
537
- const onSelectChange = (e) => {
538
- const selected = e.target.value;
539
- if (selected) {
540
- setSelectedAddress(JSON.parse(selected));
541
- setNextButtonDisabled(false);
542
- }
543
- };
544
- const onStandardizationChange = (e) => {
545
- const selected = e.target.value;
546
- if (selected) {
547
- setSelectedStandardizationAddress(JSON.parse(selected));
548
- setNextButtonDisabled(false);
549
- }
550
- };
551
- const onClear = useCallback(() => {
552
- setSearchKeyword("");
553
- setSearchInput("");
554
- setSelectedAddress(void 0);
555
- setDetailAddressInput("");
556
- setStep("initial");
557
- }, []);
558
- const setDetail = (e) => {
559
- const detail = e.target.value;
560
- setDetailAddressInput(detail);
561
- if (detail) {
562
- setNextButtonDisabled(false);
563
- } else {
564
- setNextButtonDisabled(true);
565
- }
566
- };
567
- useEffect(() => {
568
- if (searchType === "address" && addressData?.data?.addressList) {
569
- setDisplayList(addressData.data.addressList);
570
- } else if (searchType === "postalcode" && postalData?.data?.postalCodeList) {
571
- console.log("transformedList", postalData.data.postalCodeList);
572
- const transformedList = postalData.data.postalCodeList.map((p) => ({
573
- firstPostalCode: p.originalNumber1PostalCode,
574
- secondPostalCode: p.originalNumber2PostalCode,
575
- roadNameBaseAddress: p.roadNameBaseAddress,
576
- roadNameDetailAddress: p.roadNameDetailAddress,
577
- landNumberBaseAddress: p.landNumberBaseAddress,
578
- landNumberDetailAddress: p.landNumberDetailAddress,
579
- mainBuildingName: p.mainBuildingName
580
- }));
581
- setDisplayList(transformedList);
582
- }
583
- }, [addressData, postalData, searchType]);
584
- useEffect(() => {
585
- if (isOpen) {
586
- setSelectedAddress(void 0);
587
- setDetailAddressInput("");
588
- setStep("initial");
589
- setSearchKeyword("");
590
- }
591
- }, [isOpen]);
592
- useEffect(() => {
593
- const road = standardizedData?.data?.addressStandardizationList[1];
594
- const land = standardizedData?.data?.addressStandardizationList[2];
595
- if (road && land) {
596
- setSelectedStandardizationAddress({
597
- land,
598
- road
599
- });
600
- }
601
- }, [standardizedData]);
602
- return {
603
- selectedStandardizationAddress,
604
- onStandardizationChange,
605
- onAddressSearchClear: onClear,
606
- onAddressSearchNext: onNext,
607
- addressSearchKeyword: searchKeyword,
608
- addressSearchList: displayList,
609
- addressSearchStep: step,
610
- selectedAddress,
611
- addressSearchOnValueChange: onSelectChange,
612
- nextButtonDisabled,
613
- detailAddressInput,
614
- onSearch,
615
- onKeyUp,
616
- onSelectChange,
617
- setDetail,
618
- search,
619
- searchInput,
620
- isLoading: isLoadingAddress || isLoadingPostalCode
621
- };
622
- }
623
- const useAddressComponent = () => {
624
- const [fullAddress, setFullAddress] = useState();
625
- const { isOpen, closeModal, openModal } = useModalState();
626
- const AddressSearchComponent = () => /* @__PURE__ */ jsx(AddressComponent, { isOpen, onClose: closeModal, setValue: setFullAddress });
627
- return {
628
- fullAddress,
629
- openModal,
630
- AddressSearchComponent
631
- };
422
+ );
632
423
  };
633
424
 
634
- const BANK_STOCK_SEARCH_MODAL_TABS = [
635
- {
636
- value: "bank",
637
- label: "\uC740\uD589"
638
- },
639
- {
640
- value: "stock",
641
- label: "\uC99D\uAD8C\uC0AC"
425
+ var bind = {exports: {}};
426
+
427
+ /*!
428
+ Copyright (c) 2018 Jed Watson.
429
+ Licensed under the MIT License (MIT), see
430
+ http://jedwatson.github.io/classnames
431
+ */
432
+
433
+ var hasRequiredBind;
434
+
435
+ function requireBind () {
436
+ if (hasRequiredBind) return bind.exports;
437
+ hasRequiredBind = 1;
438
+ (function (module) {
439
+ /* global define */
440
+
441
+ (function () {
442
+
443
+ var hasOwn = {}.hasOwnProperty;
444
+
445
+ function classNames () {
446
+ var classes = '';
447
+
448
+ for (var i = 0; i < arguments.length; i++) {
449
+ var arg = arguments[i];
450
+ if (arg) {
451
+ classes = appendClass(classes, parseValue.call(this, arg));
452
+ }
453
+ }
454
+
455
+ return classes;
456
+ }
457
+
458
+ function parseValue (arg) {
459
+ if (typeof arg === 'string' || typeof arg === 'number') {
460
+ return this && this[arg] || arg;
461
+ }
462
+
463
+ if (typeof arg !== 'object') {
464
+ return '';
465
+ }
466
+
467
+ if (Array.isArray(arg)) {
468
+ return classNames.apply(this, arg);
469
+ }
470
+
471
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
472
+ return arg.toString();
473
+ }
474
+
475
+ var classes = '';
476
+
477
+ for (var key in arg) {
478
+ if (hasOwn.call(arg, key) && arg[key]) {
479
+ classes = appendClass(classes, this && this[key] || key);
480
+ }
481
+ }
482
+
483
+ return classes;
484
+ }
485
+
486
+ function appendClass (value, newClass) {
487
+ if (!newClass) {
488
+ return value;
489
+ }
490
+
491
+ if (value) {
492
+ return value + ' ' + newClass;
493
+ }
494
+
495
+ return value + newClass;
496
+ }
497
+
498
+ if (module.exports) {
499
+ classNames.default = classNames;
500
+ module.exports = classNames;
501
+ } else {
502
+ window.classNames = classNames;
503
+ }
504
+ }());
505
+ } (bind));
506
+ return bind.exports;
507
+ }
508
+
509
+ var bindExports = requireBind();
510
+ var classNames = /*@__PURE__*/getDefaultExportFromCjs(bindExports);
511
+
512
+ const highlightOnSearchKeyword = (originalText, targetString) => {
513
+ if (!targetString || !originalText?.includes(targetString)) {
514
+ return originalText;
642
515
  }
643
- ];
644
- const BANK_STOCK_ICON_LIST = [
645
- {
646
- codeVal: "002",
647
- codeName: "\uC0B0\uC5C5\uC740\uD589",
648
- replaceName: "\uC0B0\uC5C5",
649
- icon: /* @__PURE__ */ jsx(IconGraphicsBankSaneop, {})
650
- },
651
- {
652
- codeVal: "003",
653
- codeName: "\uAE30\uC5C5\uC740\uD589",
654
- replaceName: "\uAE30\uC5C5",
655
- icon: /* @__PURE__ */ jsx(IconGraphicsBankKiup, {})
656
- },
657
- {
658
- codeVal: "004",
659
- codeName: "\uAD6D\uBBFC\uC740\uD589",
660
- replaceName: "\uAD6D\uBBFC",
661
- icon: /* @__PURE__ */ jsx(IconGraphicsBankKukmin, {})
662
- },
663
- {
664
- codeVal: "007",
665
- codeName: "\uC218\uD611\uC740\uD589",
666
- replaceName: "\uC218\uD611",
667
- icon: /* @__PURE__ */ jsx(IconGraphicsBankSuhyeop, {})
668
- },
669
- {
670
- codeVal: "009",
671
- codeName: "\uC7A5\uAE30\uC2E0\uC6A9\uC740\uD589",
672
- replaceName: "\uC7A5\uAE30\uC2E0\uC6A9",
673
- icon: /* @__PURE__ */ jsx(IconGraphicsBankJangGiSinYong, {})
674
- },
675
- {
676
- codeVal: "011",
677
- codeName: "\uB18D\uD611\uC740\uD589",
678
- replaceName: "NH\uB18D\uD611",
679
- icon: /* @__PURE__ */ jsx(IconGraphicsBankNhNonghyeop, {})
680
- },
681
- {
682
- codeVal: "012",
683
- codeName: "\uB18D\uC870",
684
- replaceName: "\uC9C0\uC5ED\uB18D\uD611",
685
- icon: /* @__PURE__ */ jsx(IconGraphicsBankJiyeokNonghyeop, {})
686
- },
687
- {
688
- codeVal: "020",
689
- codeName: "\uC6B0\uB9AC\uC740\uD589",
690
- replaceName: "\uC6B0\uB9AC",
691
- icon: /* @__PURE__ */ jsx(IconGraphicsBankWoori, {})
692
- },
693
- {
694
- codeVal: "023",
695
- codeName: "\uC2A4\uD0E0\uB2E4\uB4DC\uCC28\uD0C0\uB4DC",
696
- replaceName: "SC\uC81C\uC77C",
697
- icon: /* @__PURE__ */ jsx(IconGraphicsBankScJeil, {})
698
- },
699
- {
700
- codeVal: "026",
701
- codeName: "(\uAD6C)\uC2E0\uD55C\uC740\uD589",
702
- replaceName: "\uC2E0\uD55C",
703
- icon: /* @__PURE__ */ jsx(IconGraphicsBankSinhan, {})
704
- },
705
- {
706
- codeVal: "027",
707
- codeName: "\uD55C\uAD6D\uC528\uD2F0\uC740\uD589",
708
- replaceName: "\uD55C\uAD6D\uC528\uD2F0",
709
- icon: /* @__PURE__ */ jsx(IconGraphicsBankHankookCity, {})
710
- },
711
- {
712
- codeVal: "031",
713
- codeName: "iM(\uB300\uAD6C)\uBC45\uD06C",
714
- replaceName: "\uB300\uAD6C",
715
- icon: /* @__PURE__ */ jsx(IconGraphicsBankDaegu, {})
716
- },
717
- {
718
- codeVal: "032",
719
- codeName: "\uBD80\uC0B0\uC740\uD589",
720
- replaceName: "\uBD80\uC0B0",
721
- icon: /* @__PURE__ */ jsx(IconGraphicsBankBusan, {})
722
- },
723
- {
724
- codeVal: "034",
725
- codeName: "\uAD11\uC8FC\uC740\uD589",
726
- replaceName: "\uAD11\uC8FC",
727
- icon: /* @__PURE__ */ jsx(IconGraphicsBankGwangju, {})
728
- },
729
- {
730
- codeVal: "035",
731
- codeName: "\uC81C\uC8FC\uC740\uD589",
732
- replaceName: "\uC81C\uC8FC",
733
- icon: /* @__PURE__ */ jsx(IconGraphicsBankJeju, {})
734
- },
735
- {
736
- codeVal: "037",
737
- codeName: "\uC804\uBD81\uC740\uD589",
738
- replaceName: "\uC804\uBD81",
739
- icon: /* @__PURE__ */ jsx(IconGraphicsBankJeonbuk, {})
740
- },
741
- {
742
- codeVal: "039",
743
- codeName: "\uACBD\uB0A8\uC740\uD589",
744
- replaceName: "\uACBD\uB0A8",
745
- icon: /* @__PURE__ */ jsx(IconGraphicsBankGyeongnam, {})
746
- },
747
- {
748
- codeVal: "045",
749
- codeName: "\uC0C8\uB9C8\uC744\uAE08\uACE0\uC911\uC559\uD68C",
750
- replaceName: "\uC0C8\uB9C8\uC744\uAE08\uACE0",
751
- icon: /* @__PURE__ */ jsx(IconGraphicsBankSaemaulGeumgo, {})
752
- },
753
- {
754
- codeVal: "048",
755
- codeName: "\uC2E0\uD611",
756
- replaceName: "\uC2E0\uD611",
757
- icon: /* @__PURE__ */ jsx(IconGraphicsBankSinhyeop, {})
758
- },
759
- {
760
- codeVal: "050",
761
- codeName: "\uC800\uCD95\uC740\uD589",
762
- replaceName: "\uC800\uCD95",
763
- icon: /* @__PURE__ */ jsx(IconGraphicsBankJeochuk, {})
764
- },
765
- {
766
- codeVal: "054",
767
- codeName: "HSBC\uC740\uD589",
768
- replaceName: "HSBC",
769
- icon: /* @__PURE__ */ jsx(IconGraphicsBankHsbc, {})
770
- },
771
- {
772
- codeVal: "056",
773
- codeName: "\uC5D0\uC774\uBE44\uC5D4\uC554\uB85C\uC740\uD589",
774
- replaceName: "\uC5D0\uC774\uBE44\uC5D4\uC554\uB85C",
775
- icon: /* @__PURE__ */ jsx(IconGraphicsBankABNAMRO, {})
776
- },
777
- {
778
- codeVal: "064",
779
- codeName: "\uC0B0\uB9BC\uC870\uD569\uC911\uC559\uD68C",
780
- replaceName: "\uC0B0\uB9BC\uC870\uD569",
781
- icon: /* @__PURE__ */ jsx(IconGraphicsBankSanlim, {})
782
- },
783
- {
784
- codeVal: "071",
785
- codeName: "\uC6B0\uCCB4\uAD6D",
786
- replaceName: "\uC6B0\uCCB4\uAD6D",
787
- icon: /* @__PURE__ */ jsx(IconGraphicsBankPost, {})
788
- },
789
- {
790
- codeVal: "081",
791
- codeName: "KEB\uD558\uB098\uC740\uD589",
792
- replaceName: "KEB\uD558\uB098",
793
- icon: /* @__PURE__ */ jsx(IconGraphicsBankKebHana, {})
794
- },
795
- {
796
- codeVal: "088",
797
- codeName: "\uC2E0\uD55C\uC740\uD589",
798
- replaceName: "\uC2E0\uD55C",
799
- icon: /* @__PURE__ */ jsx(IconGraphicsBankSinhan, {})
800
- },
801
- {
802
- codeVal: "089",
803
- codeName: "\uCF00\uC774\uBC45\uD06C",
804
- replaceName: "\uCF00\uC774\uBC45\uD06C",
805
- icon: /* @__PURE__ */ jsx(IconGraphicsBankKBank, {})
806
- },
807
- {
808
- codeVal: "090",
809
- codeName: "\uCE74\uCE74\uC624\uBC45\uD06C",
810
- replaceName: "\uCE74\uCE74\uC624\uBC45\uD06C",
811
- icon: /* @__PURE__ */ jsx(IconGraphicsBankKakaoBank, {})
812
- },
813
- {
814
- codeVal: "092",
815
- codeName: "\uD1A0\uC2A4\uBC45\uD06C",
816
- replaceName: "\uD1A0\uC2A4\uBC45\uD06C",
817
- icon: /* @__PURE__ */ jsx(IconGraphicsBankTossBank, {})
818
- },
819
- {
820
- codeVal: "209",
821
- codeName: "\uC720\uC548\uD0C0\uC99D\uAD8C",
822
- replaceName: "\uC720\uC548\uD0C0\uC99D\uAD8C",
823
- icon: /* @__PURE__ */ jsx(IconGraphicsStockYuantaJeungkwon, {})
824
- },
825
- {
826
- codeVal: "218",
827
- codeName: "KB\uC99D\uAD8C",
828
- replaceName: "KB\uC99D\uAD8C",
829
- icon: /* @__PURE__ */ jsx(IconGraphicsStockKbJeungkwon, {})
830
- },
831
- {
832
- codeVal: "230",
833
- codeName: "\uBBF8\uB798\uC5D0\uC14B\uC99D\uAD8C",
834
- replaceName: "\uBBF8\uB798\uC5D0\uC14B\uC99D\uAD8C",
835
- icon: /* @__PURE__ */ jsx(IconGraphicsStockMiraeAssetJeungkwon, {})
836
- },
837
- {
838
- codeVal: "238",
839
- codeName: "\uB300\uC6B0\uC99D\uAD8C",
840
- replaceName: "\uB300\uC6B0\uC99D\uAD8C",
841
- icon: /* @__PURE__ */ jsx(IconGraphicsStockMiraeAssetJeungkwon, {})
842
- },
843
- {
844
- codeVal: "240",
845
- codeName: "\uC0BC\uC131\uC99D\uAD8C",
846
- replaceName: "\uC0BC\uC131\uC99D\uAD8C",
847
- icon: /* @__PURE__ */ jsx(IconGraphicsStockSamsungJeungkwon, {})
848
- },
849
- {
850
- codeVal: "243",
851
- codeName: "\uD55C\uAD6D\uD22C\uC790\uC99D\uAD8C",
852
- replaceName: "\uD55C\uAD6D\uD22C\uC790\uC99D\uAD8C",
853
- icon: /* @__PURE__ */ jsx(IconGraphicsStockHankookTujajeungkwon, {})
854
- },
855
- {
856
- codeVal: "247",
857
- codeName: "\uC6B0\uB9AC\uD22C\uC790\uC99D\uAD8C",
858
- replaceName: "NH(\uC6B0\uB9AC)\uD22C\uC790\uC99D\uAD8C",
859
- icon: /* @__PURE__ */ jsx(IconGraphicsStockNhWooriTujajeungkwon, {})
860
- },
861
- {
862
- codeVal: "261",
863
- codeName: "\uAD50\uBCF4\uC99D\uAD8C",
864
- replaceName: "\uAD50\uBCF4\uC99D\uAD8C",
865
- icon: /* @__PURE__ */ jsx(IconGraphicsStockGyoboJeungkwon, {})
866
- },
867
- {
868
- codeVal: "262",
869
- codeName: "\uD558\uC774\uD22C\uC790\uC99D\uAD8C",
870
- replaceName: "\uD558\uC774\uD22C\uC790\uC99D\uAD8C",
871
- icon: /* @__PURE__ */ jsx(IconGraphicsStockHiTujajeungkwon, {})
872
- },
873
- {
874
- codeVal: "263",
875
- codeName: "\uD604\uB300\uCC28\uD22C\uC790\uC99D\uAD8C",
876
- replaceName: "\uD604\uB300\uCC28\uC99D\uAD8C",
877
- icon: /* @__PURE__ */ jsx(IconGraphicsStockHyundaiChaJeungkwon, {})
878
- },
879
- {
880
- codeVal: "264",
881
- codeName: "\uD0A4\uC6C0\uC99D\uAD8C",
882
- replaceName: "\uD0A4\uC6C0\uC99D\uAD8C",
883
- icon: /* @__PURE__ */ jsx(IconGraphicsStockKiwoomJeungkwon, {})
884
- },
885
- {
886
- codeVal: "266",
887
- codeName: "SK\uC99D\uAD8C",
888
- replaceName: "SK\uC99D\uAD8C",
889
- icon: /* @__PURE__ */ jsx(IconGraphicsStockSkJeungkwon, {})
890
- },
891
- {
892
- codeVal: "267",
893
- codeName: "\uB300\uC2E0\uC99D\uAD8C",
894
- replaceName: "\uB300\uC2E0\uC99D\uAD8C",
895
- icon: /* @__PURE__ */ jsx(IconGraphicsStockDaesinJeungkwon, {})
896
- },
897
- {
898
- codeVal: "269",
899
- codeName: "\uD55C\uD654\uC99D\uAD8C",
900
- replaceName: "\uD55C\uD654\uD22C\uC790\uC99D\uAD8C",
901
- icon: /* @__PURE__ */ jsx(IconGraphicsStockHanwhaTujajeungkwon, {})
902
- },
903
- {
904
- codeVal: "270",
905
- codeName: "\uD558\uB098\uB300\uD22C\uC99D\uAD8C",
906
- replaceName: "\uD558\uB098\uAE08\uC735\uD22C\uC790\uC99D\uAD8C",
907
- icon: /* @__PURE__ */ jsx(IconGraphicsStockHanaGeumyungTujajeungkwon, {})
908
- },
909
- {
910
- codeVal: "278",
911
- codeName: "\uC2E0\uD55C\uAE08\uC735\uD22C\uC790",
912
- replaceName: "\uC2E0\uD55C\uAE08\uC735\uD22C\uC790\uC99D\uAD8C",
913
- icon: /* @__PURE__ */ jsx(IconGraphicsStockSinhanTujajeungkwon, {})
914
- },
915
- {
916
- codeVal: "279",
917
- codeName: "\uB3D9\uBD80\uC99D\uAD8C",
918
- replaceName: "DB\uAE08\uC735\uD22C\uC790\uC99D\uAD8C",
919
- icon: /* @__PURE__ */ jsx(IconGraphicsStockDbGeumyungTujajeungkwon, {})
920
- },
921
- {
922
- codeVal: "280",
923
- codeName: "\uC720\uC9C4\uD22C\uC790\uC99D\uAD8C",
924
- replaceName: "\uC720\uC9C4\uD22C\uC790\uC99D\uAD8C",
925
- icon: /* @__PURE__ */ jsx(IconGraphicsStockYujinTujajeungkwon, {})
926
- },
927
- {
928
- codeVal: "287",
929
- codeName: "\uBA54\uB9AC\uCE20\uC99D\uAD8C",
930
- replaceName: "\uBA54\uB9AC\uCE20\uC99D\uAD8C",
931
- icon: /* @__PURE__ */ jsx(IconGraphicsStockMeritzJeungkwon, {})
932
- },
933
- {
934
- codeVal: "288",
935
- codeName: "\uCE74\uCE74\uC624\uD398\uC774\uC99D\uAD8C",
936
- replaceName: "\uCE74\uCE74\uC624\uD398\uC774\uC99D\uAD8C",
937
- icon: /* @__PURE__ */ jsx(IconGraphicsStockKakaoPayJeungkwon, {})
938
- },
939
- {
940
- codeVal: "289",
941
- codeName: "NH\uD22C\uC790\uC99D\uAD8C",
942
- replaceName: "NH\uD22C\uC790\uC99D\uAD8C",
943
- icon: /* @__PURE__ */ jsx(IconGraphicsStockNhTujajeungkwon, {})
944
- },
945
- {
946
- codeVal: "290",
947
- codeName: "\uBD80\uAD6D\uC99D\uAD8C",
948
- replaceName: "\uBD80\uAD6D\uC99D\uAD8C",
949
- icon: /* @__PURE__ */ jsx(IconGraphicsStockBugukJeungkwon, {})
950
- },
951
- {
952
- codeVal: "291",
953
- codeName: "\uC2E0\uC601\uC99D\uAD8C",
954
- replaceName: "\uC2E0\uC601\uC99D\uAD8C",
955
- icon: /* @__PURE__ */ jsx(IconGraphicsStockSinyeongJeungkwon, {})
516
+ const replacedText = [];
517
+ const splitText = originalText.split(targetString);
518
+ for (let i = 0; i < splitText.length; i++) {
519
+ replacedText.push(splitText[i] || "");
520
+ if (i < splitText.length - 1) {
521
+ replacedText.push(
522
+ /* @__PURE__ */ jsx("span", { className: "text-primary", children: targetString }, `search-keyword-highlight-${i}-${Math.random()}`)
523
+ );
524
+ }
956
525
  }
957
- ];
526
+ return replacedText;
527
+ };
528
+ const getGenderName = (genderCode) => {
529
+ switch (genderCode) {
530
+ case "1":
531
+ case "3":
532
+ return "\uB0A8\uC131";
533
+ case "2":
534
+ case "4":
535
+ return "\uC5EC\uC131";
536
+ default:
537
+ return "";
538
+ }
539
+ };
958
540
 
959
- function useBankStockSearch({ onSelect }) {
960
- const { data } = useSearchCommonCodeQuery({ commonCodeId: "BANK_ORGN_DVSN_CODE" });
961
- const bankStockList = data?.data?.commonCodeList?.[0]?.codeList;
962
- const handleSelect = (item) => {
963
- onSelect(item);
964
- };
965
- const bankList = bankStockList?.filter((bank) => bank.codeVal?.startsWith("0"));
966
- const stockList = bankStockList?.filter((stock) => stock.codeVal?.startsWith("2"));
967
- return {
968
- bankList,
969
- stockList,
970
- handleSelect
971
- };
541
+ const cx$k = classNames.bind(styles);
542
+ const { InputBox: InputBox$4, Input: Input$4 } = FormCore;
543
+ const AddressSearchInitialText = () => {
544
+ return /* @__PURE__ */ jsxs("div", { className: cx$k("search-result-list"), children: [
545
+ /* @__PURE__ */ jsx("p", { className: cx$k("guide-title"), children: "\uC774\uB807\uAC8C \uAC80\uC0C9\uD574 \uBCF4\uC138\uC694." }),
546
+ /* @__PURE__ */ jsxs("ul", { className: cx$k("guide"), children: [
547
+ /* @__PURE__ */ jsx("li", { children: "\uB3C4\uB85C\uBA85/\uC9C0\uBA85\uACFC \uAC74\uBB3C\uBC88\uD638\uB97C \uD568\uAED8 \uC785\uB825\uD574\uC8FC\uC138\uC694" }),
548
+ /* @__PURE__ */ jsx("li", { children: "\uC608) 63\uB85C 50, \uC5EC\uC758\uB3C4\uB3D9 60" }),
549
+ /* @__PURE__ */ jsx("li", { children: "\uC9C0\uBA85\uC740 \uB3D9/\uC74D/\uBA74/\uB9AC\uB85C \uC785\uB825\uD574\uC8FC\uC138\uC694" }),
550
+ /* @__PURE__ */ jsx("li", { children: "\uC608) \uC5EC\uC758\uB3C4\uB3D9, \uC5ED\uC0BC\uB3D9" }),
551
+ /* @__PURE__ */ jsx("li", { children: "\uC6B0\uD3B8\uBC88\uD638 \uB2E4\uC12F\uC790\uB9AC\uB97C \uBAA8\uB450 \uC785\uB825\uD574\uC8FC\uC138\uC694" }),
552
+ /* @__PURE__ */ jsx("li", { children: "\uC608) 07345, 06232" })
553
+ ] })
554
+ ] });
555
+ };
556
+ const AddressSearchResult = ({
557
+ addressSearchList,
558
+ onChange,
559
+ searchKeyword,
560
+ selectedAddress
561
+ }) => {
562
+ return /* @__PURE__ */ jsxs("div", { className: cx$k("search-result-list"), children: [
563
+ /* @__PURE__ */ jsxs("p", { className: cx$k("guide-title"), children: [
564
+ "\uCD1D ",
565
+ /* @__PURE__ */ jsx("span", { className: "text-primary", children: addressSearchList.length }),
566
+ "\uAC74\uC758 \uAC80\uC0C9\uACB0\uACFC"
567
+ ] }),
568
+ addressSearchList.length > 0 && /* @__PURE__ */ jsx(
569
+ RadioGroup,
570
+ {
571
+ items: addressSearchList.map((item) => {
572
+ return {
573
+ value: JSON.stringify(item),
574
+ select: item.roadNameBaseAddress === selectedAddress?.roadNameBaseAddress && item.roadNameDetailAddress === selectedAddress?.roadNameDetailAddress && item.mainBuildingName === selectedAddress?.mainBuildingName,
575
+ label: /* @__PURE__ */ jsxs("div", { className: cx$k("search-result"), children: [
576
+ /* @__PURE__ */ jsx("div", { className: cx$k("zipcode"), children: highlightOnSearchKeyword(`${item.firstPostalCode}${item.secondPostalCode}`, searchKeyword) }),
577
+ /* @__PURE__ */ jsx("div", { className: cx$k("divider") }),
578
+ /* @__PURE__ */ jsxs("div", { className: cx$k("address-info"), children: [
579
+ /* @__PURE__ */ jsx("span", { className: cx$k("address"), children: highlightOnSearchKeyword(
580
+ `${item.roadNameBaseAddress} ${item.roadNameDetailAddress} ${item.mainBuildingName}`,
581
+ searchKeyword
582
+ ) }),
583
+ /* @__PURE__ */ jsx("span", { className: cx$k("old-address"), children: highlightOnSearchKeyword(
584
+ `${item.landNumberBaseAddress} ${item.landNumberDetailAddress}`,
585
+ searchKeyword
586
+ ) })
587
+ ] })
588
+ ] }),
589
+ id: JSON.stringify(item)
590
+ };
591
+ }),
592
+ className: cx$k("radio-group"),
593
+ name: "address-search",
594
+ size: "medium",
595
+ defaultValue: "",
596
+ onChange
597
+ }
598
+ ),
599
+ addressSearchList.length === 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
600
+ "`",
601
+ /* @__PURE__ */ jsx("span", { className: "text-primary", children: searchKeyword }),
602
+ "`\uC5D0 \uB300\uD55C \uAC80\uC0C9\uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."
603
+ ] })
604
+ ] });
605
+ };
606
+ const AddressSearchDetailInput = ({
607
+ selectedStandardizationAddress,
608
+ onDetailChange,
609
+ step,
610
+ onStandardizationChange,
611
+ detailAddressInput
612
+ }) => {
613
+ const { land, road } = selectedStandardizationAddress;
614
+ return /* @__PURE__ */ jsxs("div", { className: cx$k("search-result-list"), children: [
615
+ /* @__PURE__ */ jsx(
616
+ Radio.Root,
617
+ {
618
+ name: "address-search-standardization",
619
+ size: "medium",
620
+ defaultValue: JSON.stringify(selectedStandardizationAddress),
621
+ children: /* @__PURE__ */ jsx(
622
+ Radio.Item,
623
+ {
624
+ className: cx$k("radio-group"),
625
+ value: JSON.stringify(selectedStandardizationAddress),
626
+ onChange: onStandardizationChange,
627
+ children: /* @__PURE__ */ jsxs("div", { className: cx$k("search-result"), children: [
628
+ /* @__PURE__ */ jsx(
629
+ "div",
630
+ {
631
+ className: cx$k("zipcode"),
632
+ children: `${selectedStandardizationAddress.land?.firstPostalCode}${land?.secondPostalCode}`
633
+ }
634
+ ),
635
+ /* @__PURE__ */ jsx("div", { className: cx$k("divider") }),
636
+ /* @__PURE__ */ jsxs("div", { className: cx$k("address-info"), children: [
637
+ /* @__PURE__ */ jsx("span", { className: cx$k("address"), children: `${road?.baseAddress} ${road?.detailAddress}` }),
638
+ /* @__PURE__ */ jsx("span", { className: cx$k("old-address"), children: `${land?.baseAddress} ${land?.detailAddress}` })
639
+ ] })
640
+ ] })
641
+ }
642
+ )
643
+ }
644
+ ),
645
+ /* @__PURE__ */ jsxs("div", { className: "d-flex gap-medium items-center", children: [
646
+ /* @__PURE__ */ jsx(FormField.Label, { id: "detail", style: { width: "90px" }, children: "\uC0C1\uC138\uC8FC\uC18C" }),
647
+ /* @__PURE__ */ jsx(
648
+ FormField.TextField,
649
+ {
650
+ rootProps: {
651
+ style: {
652
+ display: "flex",
653
+ flex: 1
654
+ }
655
+ },
656
+ placeholder: "\uC0C1\uC138\uC8FC\uC18C \uC785\uB825",
657
+ onChange: onDetailChange,
658
+ size: "small",
659
+ value: detailAddressInput,
660
+ ...step === "detail-input" && { autoFocus: true }
661
+ }
662
+ )
663
+ ] })
664
+ ] });
665
+ };
666
+ function AddressComponent({ isOpen, onClose, setValue }) {
667
+ const {
668
+ onAddressSearchClear,
669
+ addressSearchKeyword,
670
+ addressSearchStep,
671
+ onAddressSearchNext,
672
+ nextButtonDisabled,
673
+ detailAddressInput,
674
+ addressSearchList,
675
+ onSearch,
676
+ onKeyUp,
677
+ onSelectChange,
678
+ setDetail,
679
+ search,
680
+ searchInput,
681
+ selectedAddress,
682
+ onStandardizationChange,
683
+ selectedStandardizationAddress,
684
+ isLoading
685
+ } = useSearchAddress({
686
+ setValue,
687
+ onClose,
688
+ isOpen
689
+ });
690
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Modal.Root, { isOpen, onClose, modalSize: "full-screen", children: [
691
+ /* @__PURE__ */ jsx(Modal.Overlay, {}),
692
+ /* @__PURE__ */ jsxs(Modal.Content, { children: [
693
+ /* @__PURE__ */ jsx(Modal.Header, { headerTitle: "\uC8FC\uC18C \uAC80\uC0C9", showCloseButton: true }),
694
+ /* @__PURE__ */ jsxs(Modal.Body, { children: [
695
+ /* @__PURE__ */ jsx(InputBox$4, { clearable: true, endElement: /* @__PURE__ */ jsx(IconMainUiSearch, { onClick: search }), onClear: onAddressSearchClear, children: /* @__PURE__ */ jsx(
696
+ Input$4,
697
+ {
698
+ ...addressSearchStep !== "detail-input" && { autoFocus: true },
699
+ onChange: onSearch,
700
+ onKeyUp,
701
+ value: searchInput,
702
+ placeholder: "\uC9C0\uBC88, \uB3C4\uB85C\uBA85, \uAC74\uBB3C\uBA85, \uC6B0\uD3B8\uBC88\uD638 \uC785\uB825",
703
+ size: "large"
704
+ }
705
+ ) }),
706
+ addressSearchStep === "initial" && /* @__PURE__ */ jsx(AddressSearchInitialText, {}),
707
+ !isLoading && addressSearchStep === "search-result" && /* @__PURE__ */ jsx(
708
+ AddressSearchResult,
709
+ {
710
+ onChange: onSelectChange,
711
+ addressSearchList,
712
+ searchKeyword: addressSearchKeyword,
713
+ selectedAddress
714
+ }
715
+ ),
716
+ !isLoading && addressSearchStep === "detail-input" && selectedAddress && selectedStandardizationAddress && /* @__PURE__ */ jsx(
717
+ AddressSearchDetailInput,
718
+ {
719
+ selectedStandardizationAddress,
720
+ onStandardizationChange,
721
+ onDetailChange: setDetail,
722
+ step: addressSearchStep,
723
+ detailAddressInput
724
+ }
725
+ )
726
+ ] }),
727
+ /* @__PURE__ */ jsx(Modal.Footer, { children: addressSearchStep !== "initial" && /* @__PURE__ */ jsxs(
728
+ Button,
729
+ {
730
+ onClick: onAddressSearchNext,
731
+ variant: "primary",
732
+ size: "medium",
733
+ appearance: "filled",
734
+ width: "full",
735
+ children: [
736
+ addressSearchStep === "search-result" && "\uB2E4\uC74C(1/2)",
737
+ addressSearchStep === "detail-input" && "\uD655\uC778(2/2)"
738
+ ]
739
+ }
740
+ ) })
741
+ ] })
742
+ ] }) });
972
743
  }
973
744
 
974
- function chunk(array, size) {
975
- return Array.from({ length: Math.ceil(array.length / size) }, (v, i) => array.slice(i * size, i * size + size));
976
- }
977
- function BankStockSearchModal({ open, onClose, onSelect }) {
978
- const { bankList, stockList, handleSelect } = useBankStockSearch({
979
- onSelect
745
+ function useSearchAddress({ setValue, onClose, isOpen }) {
746
+ const [searchKeyword, setSearchKeyword] = useState("");
747
+ const [step, setStep] = useState("initial");
748
+ const [selectedAddress, setSelectedAddress] = useState();
749
+ const [selectedStandardizationAddress, setSelectedStandardizationAddress] = useState();
750
+ const [searchInput, setSearchInput] = useState("");
751
+ const [detailAddressInput, setDetailAddressInput] = useState("");
752
+ const [displayList, setDisplayList] = useState([]);
753
+ const [searchType, setSearchType] = useState("address");
754
+ const [standardizationParams, setStandardizationParams] = useState({
755
+ firstPostalCode: "",
756
+ secondPostalCode: "",
757
+ baseAddress: "",
758
+ detailAddress: "",
759
+ roadNameYn: "Y"
980
760
  });
981
- const renderItems = (list) => {
982
- const chunkedList = chunk(list, 5);
983
- return /* @__PURE__ */ jsx("div", { className: styles$1["list-container"], children: chunkedList.map((chunk2, chunkIndex) => /* @__PURE__ */ jsxs("div", { className: styles$1.row, children: [
984
- chunk2.map((item) => {
985
- const findItem = BANK_STOCK_ICON_LIST.find((icon) => icon.codeVal === item.codeVal);
986
- const convertedItem = findItem ? findItem : {
987
- icon: /* @__PURE__ */ jsx(IconGraphicsStockHochulEopsum, {}),
988
- replaceName: item.codeName
989
- };
990
- return /* @__PURE__ */ jsxs("div", { className: styles$1.item, onClick: () => handleSelect(item), children: [
991
- /* @__PURE__ */ jsx("div", { className: styles$1["icon-wrapper"], children: convertedItem?.icon }),
992
- /* @__PURE__ */ jsxs("span", { children: [
993
- " ",
994
- convertedItem?.replaceName
995
- ] })
996
- ] }, `${item.codeVal}-${chunkIndex}`);
997
- }),
998
- chunk2.length < 5 && Array.from({ length: 5 - chunk2.length }).map((_, i) => /* @__PURE__ */ jsx("div", { className: styles$1.item, style: { visibility: "hidden" } }, `placeholder-${chunkIndex}-${i}`))
999
- ] }, chunkIndex)) });
761
+ const { data: addressData, isLoading: isLoadingAddress } = useSearchAddressQuery(
762
+ { searchKeyWord: searchKeyword },
763
+ { enabled: !!searchKeyword && searchType === "address" }
764
+ );
765
+ const { data: postalData, isLoading: isLoadingPostalCode } = useSearchPostalCodeQuery(
766
+ { searchWordName: searchKeyword },
767
+ { enabled: !!searchKeyword && searchType === "postalcode" }
768
+ );
769
+ const { data: standardizedData } = useSearchAddressStandardizationQuery(standardizationParams, {
770
+ enabled: !!standardizationParams?.baseAddress
771
+ });
772
+ const [nextButtonDisabled, setNextButtonDisabled] = useState(false);
773
+ const onNext = () => {
774
+ if (step === "search-result" && nextButtonDisabled) {
775
+ ModalUtils.alert(
776
+ "\uC8FC\uC18C\uB97C \uC120\uD0DD\uD558\uC9C0 \uC54A\uC73C\uBA74 \uB2E4\uC74C \uB2E8\uACC4\uB85C \uC774\uB3D9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.\n\uC8FC\uC18C\uB97C \uC120\uD0DD\uD55C \uD6C4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574\uC8FC\uC138\uC694.",
777
+ "\uC120\uD0DD \uC8FC\uC18C \uC5C6\uC74C",
778
+ { modalId: "search-modal-address-no-selected" }
779
+ );
780
+ return;
781
+ }
782
+ if (step === "search-result") {
783
+ setStep("detail-input");
784
+ setNextButtonDisabled(true);
785
+ if (selectedAddress) {
786
+ setStandardizationParams({
787
+ firstPostalCode: selectedAddress.firstPostalCode,
788
+ secondPostalCode: selectedAddress.secondPostalCode,
789
+ baseAddress: selectedAddress.roadNameBaseAddress,
790
+ detailAddress: selectedAddress.roadNameDetailAddress,
791
+ roadNameYn: "Y"
792
+ });
793
+ }
794
+ } else {
795
+ selectedStandardizationAddress && setValue({
796
+ ...selectedStandardizationAddress,
797
+ detailAddressInput
798
+ });
799
+ onClose();
800
+ }
801
+ };
802
+ const onSearch = (e) => {
803
+ const typeStr = e.target.value;
804
+ setSearchInput(typeStr);
1000
805
  };
1001
- return /* @__PURE__ */ jsxs(Modal.Root, { isOpen: open, onClose, modalSize: "full-screen", children: [
1002
- /* @__PURE__ */ jsx(Modal.Overlay, {}),
1003
- /* @__PURE__ */ jsxs(Modal.Content, { children: [
1004
- /* @__PURE__ */ jsx(Modal.Header, { headerTitle: "\uC740\uD589/\uC99D\uAD8C\uC0AC \uC120\uD0DD", showCloseButton: true }),
1005
- /* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsxs("div", { className: styles$1.container, children: [
1006
- /* @__PURE__ */ jsxs("div", { className: styles$1.section, children: [
1007
- /* @__PURE__ */ jsx("p", { className: styles$1["section-title"], children: "\uC740\uD589\uC0AC" }),
1008
- renderItems(bankList || [])
1009
- ] }),
1010
- /* @__PURE__ */ jsxs("div", { className: styles$1.section, children: [
1011
- /* @__PURE__ */ jsx("p", { className: styles$1["section-title"], children: "\uC99D\uAD8C\uC0AC" }),
1012
- renderItems(stockList || [])
1013
- ] })
1014
- ] }) })
1015
- ] })
1016
- ] });
1017
- }
1018
-
1019
- const useCustomerSearch = (onSelect) => {
1020
- const { triggerRef, isOpen, setIsOpen, DropDown } = useDropDown();
1021
- const [searchKeyword, setSearchKeyword] = useState("");
1022
- const [searchInput, setSearchInput] = useState("");
1023
- const [customerList, setCustomerList] = useState([]);
1024
- const [selectedCustomer, setSelectedCustomer] = useState(null);
1025
- const { data } = useSearchCustomerListQuery({ customerName: searchKeyword });
1026
806
  const search = () => {
1027
- if (searchInput.length >= 2) {
807
+ if (searchInput === "") {
808
+ onClear();
809
+ return;
810
+ }
811
+ if (searchInput && searchInput.length > 1) {
812
+ const isNumeric = /^[0-9]+$/.test(searchInput);
813
+ setSearchType(isNumeric ? "postalcode" : "address");
1028
814
  setSearchKeyword(searchInput);
1029
- setIsOpen(true);
1030
- } else {
1031
- setCustomerList([]);
1032
- setSearchKeyword("");
1033
- setIsOpen(false);
815
+ setStep("search-result");
816
+ setSelectedAddress(void 0);
817
+ setDetailAddressInput("");
818
+ setNextButtonDisabled(true);
1034
819
  }
1035
820
  };
1036
821
  const onKeyUp = (e) => {
1037
- const currentValue = e.target.value;
1038
- if (currentValue.length === 0 || currentValue.slice(-1).normalize("NFD").length > 1 && currentValue.length > 1) {
822
+ if (e.key === "Enter") {
1039
823
  search();
1040
824
  }
1041
825
  };
1042
- const onSearchInputChange = (e) => {
1043
- setSearchInput(e.target.value);
826
+ const onSelectChange = (e) => {
827
+ const selected = e.target.value;
828
+ if (selected) {
829
+ setSelectedAddress(JSON.parse(selected));
830
+ setNextButtonDisabled(false);
831
+ }
1044
832
  };
1045
- const onClear = () => {
1046
- setSearchInput("");
1047
- setSearchKeyword("");
1048
- setCustomerList([]);
1049
- setSelectedCustomer(null);
1050
- setIsOpen(false);
833
+ const onStandardizationChange = (e) => {
834
+ const selected = e.target.value;
835
+ if (selected) {
836
+ setSelectedStandardizationAddress(JSON.parse(selected));
837
+ setNextButtonDisabled(false);
838
+ }
1051
839
  };
1052
- const handleSelectItem = (customer) => {
1053
- setSelectedCustomer(customer);
1054
- setSearchInput(customer.customerName || "");
1055
- setCustomerList([]);
1056
- setIsOpen(false);
1057
- if (onSelect) {
1058
- onSelect(customer);
840
+ const onClear = useCallback(() => {
841
+ setSearchKeyword("");
842
+ setSearchInput("");
843
+ setSelectedAddress(void 0);
844
+ setDetailAddressInput("");
845
+ setStep("initial");
846
+ }, []);
847
+ const setDetail = (e) => {
848
+ const detail = e.target.value;
849
+ setDetailAddressInput(detail);
850
+ if (detail) {
851
+ setNextButtonDisabled(false);
852
+ } else {
853
+ setNextButtonDisabled(true);
1059
854
  }
1060
855
  };
1061
856
  useEffect(() => {
1062
- const filtered = data?.data?.custList?.filter(
1063
- (c) => c.customerName?.toLowerCase().includes(searchInput.toLowerCase())
1064
- );
1065
- setCustomerList(filtered || []);
1066
- }, [data, searchInput]);
857
+ if (searchType === "address" && addressData?.data?.addressList) {
858
+ setDisplayList(addressData.data.addressList);
859
+ } else if (searchType === "postalcode" && postalData?.data?.postalCodeList) {
860
+ console.log("transformedList", postalData.data.postalCodeList);
861
+ const transformedList = postalData.data.postalCodeList.map((p) => ({
862
+ firstPostalCode: p.originalNumber1PostalCode,
863
+ secondPostalCode: p.originalNumber2PostalCode,
864
+ roadNameBaseAddress: p.roadNameBaseAddress,
865
+ roadNameDetailAddress: p.roadNameDetailAddress,
866
+ landNumberBaseAddress: p.landNumberBaseAddress,
867
+ landNumberDetailAddress: p.landNumberDetailAddress,
868
+ mainBuildingName: p.mainBuildingName
869
+ }));
870
+ setDisplayList(transformedList);
871
+ }
872
+ }, [addressData, postalData, searchType]);
873
+ useEffect(() => {
874
+ if (isOpen) {
875
+ setSelectedAddress(void 0);
876
+ setDetailAddressInput("");
877
+ setStep("initial");
878
+ setSearchKeyword("");
879
+ }
880
+ }, [isOpen]);
881
+ useEffect(() => {
882
+ const road = standardizedData?.data?.addressStandardizationList[1];
883
+ const land = standardizedData?.data?.addressStandardizationList[2];
884
+ if (road && land) {
885
+ setSelectedStandardizationAddress({
886
+ land,
887
+ road
888
+ });
889
+ }
890
+ }, [standardizedData]);
1067
891
  return {
1068
- triggerRef,
1069
- isOpen,
1070
- DropDown,
1071
- searchInput,
1072
- customerList,
1073
- searchKeyword,
1074
- onSearchInputChange,
1075
- onKeyUp,
1076
- search,
1077
- onClear,
1078
- handleSelectItem,
1079
- selectedCustomer,
1080
- setSearchInput,
1081
- setCustomerList,
1082
- setSearchKeyword,
1083
- setIsOpen
1084
- };
1085
- };
1086
-
1087
- const cx$j = classNames.bind(styles$2);
1088
- const { InputBox: InputBox$3, Input: Input$3 } = FormCore;
1089
- const CustomerSearch = ({
1090
- onSelectCustomer,
1091
- onSearchClear,
1092
- placeholder,
1093
- rootProps,
1094
- size = "large",
1095
- ...props
1096
- }) => {
1097
- const {
1098
- triggerRef,
1099
- isOpen,
1100
- DropDown,
1101
- searchInput,
1102
- customerList,
1103
- searchKeyword,
1104
- onSearchInputChange,
1105
- onKeyUp,
1106
- search,
1107
- onClear,
1108
- handleSelectItem
1109
- } = useCustomerSearch(onSelectCustomer);
1110
- const handleClear = () => {
1111
- onClear();
1112
- onSearchClear?.();
1113
- };
1114
- return /* @__PURE__ */ jsxs("div", { className: cx$j("container"), children: [
1115
- /* @__PURE__ */ jsx("div", { className: cx$j("search-bar"), children: /* @__PURE__ */ jsx(
1116
- InputBox$3,
1117
- {
1118
- ...rootProps,
1119
- endElement: /* @__PURE__ */ jsx(IconMainUiSearch, { Click: search, style: { width: "20px", height: "20px" } }),
1120
- onClear: handleClear,
1121
- clearable: true,
1122
- children: /* @__PURE__ */ jsx(
1123
- Input$3,
1124
- {
1125
- ...props,
1126
- onChange: onSearchInputChange,
1127
- onKeyUp,
1128
- value: searchInput,
1129
- placeholder: placeholder || "\uACE0\uAC1D\uBA85\uC744 \uB450 \uAE00\uC790 \uC774\uC0C1 \uC785\uB825\uD574\uC8FC\uC138\uC694.",
1130
- size,
1131
- ref: triggerRef
1132
- }
1133
- )
1134
- }
1135
- ) }),
1136
- isOpen && customerList.length > 0 && /* @__PURE__ */ jsx(DropDown, { children: /* @__PURE__ */ jsx("div", { className: cx$j("result-container"), children: /* @__PURE__ */ jsx(List, { children: customerList.map((customer, index) => /* @__PURE__ */ jsx(
1137
- ListItem,
1138
- {
1139
- onClick: () => handleSelectItem(customer),
1140
- selectable: true,
1141
- children: /* @__PURE__ */ jsxs("div", { className: cx$j("customer-item"), children: [
1142
- /* @__PURE__ */ jsx("div", { className: cx$j("name"), children: highlightOnSearchKeyword(customer.customerName || "", searchKeyword) }),
1143
- /* @__PURE__ */ jsxs("div", { className: cx$j("details"), children: [
1144
- /* @__PURE__ */ jsx("span", { children: customer.birthDate && convertDateString({
1145
- dateString: customer.birthDate,
1146
- fromFormat: "YYYYMMDD",
1147
- toFormat: "YYYY.MM.DD"
1148
- }) }),
1149
- /* @__PURE__ */ jsx("span", { className: cx$j("separator"), children: "|" }),
1150
- /* @__PURE__ */ jsx("span", { children: getGenderName(customer.genderCode) }),
1151
- customer.baseAddress && /* @__PURE__ */ jsxs(Fragment, { children: [
1152
- /* @__PURE__ */ jsx("span", { className: cx$j("separator"), children: "|" }),
1153
- /* @__PURE__ */ jsx("span", { children: customer.baseAddress })
1154
- ] })
1155
- ] })
1156
- ] })
1157
- },
1158
- `cust-item-${customer.customerId}-${index}`
1159
- )) }) }) })
1160
- ] });
1161
- };
1162
-
1163
- const cx$i = classNames.bind(styles$2);
1164
- const { InputBox: InputBox$2, Input: Input$2 } = FormCore;
1165
- function CustomerSearchModal({ isOpen, closeModal, onSelect, onSearchClear }) {
1166
- const {
1167
- triggerRef,
1168
- searchInput,
1169
- customerList,
1170
- searchKeyword,
1171
- onSearchInputChange,
1172
- setSearchKeyword,
1173
- setSearchInput,
1174
- setCustomerList,
892
+ selectedStandardizationAddress,
893
+ onStandardizationChange,
894
+ onAddressSearchClear: onClear,
895
+ onAddressSearchNext: onNext,
896
+ addressSearchKeyword: searchKeyword,
897
+ addressSearchList: displayList,
898
+ addressSearchStep: step,
899
+ selectedAddress,
900
+ addressSearchOnValueChange: onSelectChange,
901
+ nextButtonDisabled,
902
+ detailAddressInput,
903
+ onSearch,
1175
904
  onKeyUp,
1176
- search,
1177
- onClear,
1178
- handleSelectItem
1179
- } = useCustomerSearch(onSelect);
1180
- const handleClear = () => {
1181
- onClear();
1182
- onSearchClear?.();
905
+ onSelectChange,
906
+ setDetail,
907
+ search,
908
+ searchInput,
909
+ isLoading: isLoadingAddress || isLoadingPostalCode
1183
910
  };
1184
- return /* @__PURE__ */ jsxs(Modal.Root, { isOpen, onClose: closeModal, modalSize: "full-screen", children: [
1185
- /* @__PURE__ */ jsx(Modal.Overlay, {}),
1186
- /* @__PURE__ */ jsxs(Modal.Content, { children: [
1187
- /* @__PURE__ */ jsx(Modal.Header, { headerTitle: "\uACE0\uAC1D \uAC80\uC0C9", showCloseButton: true }),
1188
- /* @__PURE__ */ jsxs(Modal.Body, { children: [
1189
- /* @__PURE__ */ jsx(InputBox$2, { endElement: /* @__PURE__ */ jsx(IconMainUiSearch, { onClick: search }), onClear: handleClear, clearable: true, children: /* @__PURE__ */ jsx(
1190
- Input$2,
1191
- {
1192
- onChange: onSearchInputChange,
1193
- onKeyUp,
1194
- value: searchInput,
1195
- placeholder: "\uACE0\uAC1D\uBA85\uC744 \uB450 \uAE00\uC790 \uC774\uC0C1 \uC785\uB825\uD574\uC8FC\uC138\uC694.",
1196
- size: "large",
1197
- ref: triggerRef
1198
- }
1199
- ) }),
1200
- searchKeyword && /* @__PURE__ */ jsxs("p", { className: cx$i("result-count"), children: [
1201
- "\uCD1D ",
1202
- /* @__PURE__ */ jsx("span", { className: "text-primary", children: customerList.length }),
1203
- "\uAC74\uC758 \uAC80\uC0C9\uACB0\uACFC"
1204
- ] }),
1205
- searchKeyword && customerList.length === 0 && /* @__PURE__ */ jsxs("div", { className: cx$i("search-result"), children: [
1206
- "`",
1207
- /* @__PURE__ */ jsx("span", { className: "text-primary", children: searchKeyword }),
1208
- "`\uC5D0 \uB300\uD55C \uAC80\uC0C9\uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."
1209
- ] }),
1210
- searchKeyword && customerList.length > 0 && /* @__PURE__ */ jsx("div", { children: customerList.length > 0 && /* @__PURE__ */ jsx(List, { rootProps: { style: { width: "100%" } }, children: customerList.map((customer, index) => /* @__PURE__ */ jsx(
1211
- ListItem,
1212
- {
1213
- onClick: () => {
1214
- handleSelectItem(customer);
1215
- setSearchKeyword("");
1216
- setSearchInput("");
1217
- setCustomerList([]);
1218
- closeModal();
1219
- },
1220
- selectable: true,
1221
- children: /* @__PURE__ */ jsxs("div", { className: cx$i("customer-item", "modal"), children: [
1222
- /* @__PURE__ */ jsx("div", { className: cx$i("name"), children: highlightOnSearchKeyword(customer.customerName || "", searchKeyword) }),
1223
- /* @__PURE__ */ jsxs("div", { className: cx$i("details", "modal"), children: [
1224
- /* @__PURE__ */ jsx("span", { children: customer.birthDate && convertDateString({
1225
- dateString: customer.birthDate,
1226
- fromFormat: "YYYYMMDD",
1227
- toFormat: "YYYY.MM.DD"
1228
- }) }),
1229
- /* @__PURE__ */ jsx("span", { className: cx$i("separator"), children: "|" }),
1230
- /* @__PURE__ */ jsx("span", { children: getGenderName(customer.genderCode) }),
1231
- customer.baseAddress && /* @__PURE__ */ jsxs(Fragment, { children: [
1232
- /* @__PURE__ */ jsx("span", { className: cx$i("separator"), children: "|" }),
1233
- /* @__PURE__ */ jsx("span", { children: customer.baseAddress })
1234
- ] })
1235
- ] })
1236
- ] })
1237
- },
1238
- `cust-item-${customer.customerId}-${index}`
1239
- )) }) })
1240
- ] })
1241
- ] })
1242
- ] });
1243
911
  }
912
+ const useAddressComponent = () => {
913
+ const [fullAddress, setFullAddress] = useState();
914
+ const { isOpen, closeModal, openModal } = useModalState();
915
+ const AddressSearchComponent = () => /* @__PURE__ */ jsx(AddressComponent, { isOpen, onClose: closeModal, setValue: setFullAddress });
916
+ return {
917
+ fullAddress,
918
+ openModal,
919
+ AddressSearchComponent
920
+ };
921
+ };
1244
922
 
1245
- const cx$h = classNames.bind(styles$3);
1246
- const { InputBox: InputBox$1, Input: Input$1 } = FormCore;
1247
- const favoriteList = [
923
+ const BANK_STOCK_SEARCH_MODAL_TABS = [
924
+ {
925
+ value: "bank",
926
+ label: "\uC740\uD589"
927
+ },
928
+ {
929
+ value: "stock",
930
+ label: "\uC99D\uAD8C\uC0AC"
931
+ }
932
+ ];
933
+ const BANK_STOCK_ICON_LIST = [
934
+ {
935
+ codeVal: "002",
936
+ codeName: "\uC0B0\uC5C5\uC740\uD589",
937
+ replaceName: "\uC0B0\uC5C5",
938
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankSaneop, {})
939
+ },
940
+ {
941
+ codeVal: "003",
942
+ codeName: "\uAE30\uC5C5\uC740\uD589",
943
+ replaceName: "\uAE30\uC5C5",
944
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankKiup, {})
945
+ },
946
+ {
947
+ codeVal: "004",
948
+ codeName: "\uAD6D\uBBFC\uC740\uD589",
949
+ replaceName: "\uAD6D\uBBFC",
950
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankKukmin, {})
951
+ },
952
+ {
953
+ codeVal: "007",
954
+ codeName: "\uC218\uD611\uC740\uD589",
955
+ replaceName: "\uC218\uD611",
956
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankSuhyeop, {})
957
+ },
958
+ {
959
+ codeVal: "009",
960
+ codeName: "\uC7A5\uAE30\uC2E0\uC6A9\uC740\uD589",
961
+ replaceName: "\uC7A5\uAE30\uC2E0\uC6A9",
962
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankJangGiSinYong, {})
963
+ },
964
+ {
965
+ codeVal: "011",
966
+ codeName: "\uB18D\uD611\uC740\uD589",
967
+ replaceName: "NH\uB18D\uD611",
968
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankNhNonghyeop, {})
969
+ },
970
+ {
971
+ codeVal: "012",
972
+ codeName: "\uB18D\uC870",
973
+ replaceName: "\uC9C0\uC5ED\uB18D\uD611",
974
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankJiyeokNonghyeop, {})
975
+ },
976
+ {
977
+ codeVal: "020",
978
+ codeName: "\uC6B0\uB9AC\uC740\uD589",
979
+ replaceName: "\uC6B0\uB9AC",
980
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankWoori, {})
981
+ },
982
+ {
983
+ codeVal: "023",
984
+ codeName: "\uC2A4\uD0E0\uB2E4\uB4DC\uCC28\uD0C0\uB4DC",
985
+ replaceName: "SC\uC81C\uC77C",
986
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankScJeil, {})
987
+ },
988
+ {
989
+ codeVal: "026",
990
+ codeName: "(\uAD6C)\uC2E0\uD55C\uC740\uD589",
991
+ replaceName: "\uC2E0\uD55C",
992
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankSinhan, {})
993
+ },
994
+ {
995
+ codeVal: "027",
996
+ codeName: "\uD55C\uAD6D\uC528\uD2F0\uC740\uD589",
997
+ replaceName: "\uD55C\uAD6D\uC528\uD2F0",
998
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankHankookCity, {})
999
+ },
1000
+ {
1001
+ codeVal: "031",
1002
+ codeName: "iM(\uB300\uAD6C)\uBC45\uD06C",
1003
+ replaceName: "\uB300\uAD6C",
1004
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankDaegu, {})
1005
+ },
1006
+ {
1007
+ codeVal: "032",
1008
+ codeName: "\uBD80\uC0B0\uC740\uD589",
1009
+ replaceName: "\uBD80\uC0B0",
1010
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankBusan, {})
1011
+ },
1012
+ {
1013
+ codeVal: "034",
1014
+ codeName: "\uAD11\uC8FC\uC740\uD589",
1015
+ replaceName: "\uAD11\uC8FC",
1016
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankGwangju, {})
1017
+ },
1018
+ {
1019
+ codeVal: "035",
1020
+ codeName: "\uC81C\uC8FC\uC740\uD589",
1021
+ replaceName: "\uC81C\uC8FC",
1022
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankJeju, {})
1023
+ },
1024
+ {
1025
+ codeVal: "037",
1026
+ codeName: "\uC804\uBD81\uC740\uD589",
1027
+ replaceName: "\uC804\uBD81",
1028
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankJeonbuk, {})
1029
+ },
1030
+ {
1031
+ codeVal: "039",
1032
+ codeName: "\uACBD\uB0A8\uC740\uD589",
1033
+ replaceName: "\uACBD\uB0A8",
1034
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankGyeongnam, {})
1035
+ },
1036
+ {
1037
+ codeVal: "045",
1038
+ codeName: "\uC0C8\uB9C8\uC744\uAE08\uACE0\uC911\uC559\uD68C",
1039
+ replaceName: "\uC0C8\uB9C8\uC744\uAE08\uACE0",
1040
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankSaemaulGeumgo, {})
1041
+ },
1042
+ {
1043
+ codeVal: "048",
1044
+ codeName: "\uC2E0\uD611",
1045
+ replaceName: "\uC2E0\uD611",
1046
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankSinhyeop, {})
1047
+ },
1048
+ {
1049
+ codeVal: "050",
1050
+ codeName: "\uC800\uCD95\uC740\uD589",
1051
+ replaceName: "\uC800\uCD95",
1052
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankJeochuk, {})
1053
+ },
1054
+ {
1055
+ codeVal: "054",
1056
+ codeName: "HSBC\uC740\uD589",
1057
+ replaceName: "HSBC",
1058
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankHsbc, {})
1059
+ },
1060
+ {
1061
+ codeVal: "056",
1062
+ codeName: "\uC5D0\uC774\uBE44\uC5D4\uC554\uB85C\uC740\uD589",
1063
+ replaceName: "\uC5D0\uC774\uBE44\uC5D4\uC554\uB85C",
1064
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankABNAMRO, {})
1065
+ },
1066
+ {
1067
+ codeVal: "064",
1068
+ codeName: "\uC0B0\uB9BC\uC870\uD569\uC911\uC559\uD68C",
1069
+ replaceName: "\uC0B0\uB9BC\uC870\uD569",
1070
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankSanlim, {})
1071
+ },
1072
+ {
1073
+ codeVal: "071",
1074
+ codeName: "\uC6B0\uCCB4\uAD6D",
1075
+ replaceName: "\uC6B0\uCCB4\uAD6D",
1076
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankPost, {})
1077
+ },
1078
+ {
1079
+ codeVal: "081",
1080
+ codeName: "KEB\uD558\uB098\uC740\uD589",
1081
+ replaceName: "KEB\uD558\uB098",
1082
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankKebHana, {})
1083
+ },
1084
+ {
1085
+ codeVal: "088",
1086
+ codeName: "\uC2E0\uD55C\uC740\uD589",
1087
+ replaceName: "\uC2E0\uD55C",
1088
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankSinhan, {})
1089
+ },
1090
+ {
1091
+ codeVal: "089",
1092
+ codeName: "\uCF00\uC774\uBC45\uD06C",
1093
+ replaceName: "\uCF00\uC774\uBC45\uD06C",
1094
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankKBank, {})
1095
+ },
1096
+ {
1097
+ codeVal: "090",
1098
+ codeName: "\uCE74\uCE74\uC624\uBC45\uD06C",
1099
+ replaceName: "\uCE74\uCE74\uC624\uBC45\uD06C",
1100
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankKakaoBank, {})
1101
+ },
1102
+ {
1103
+ codeVal: "092",
1104
+ codeName: "\uD1A0\uC2A4\uBC45\uD06C",
1105
+ replaceName: "\uD1A0\uC2A4\uBC45\uD06C",
1106
+ icon: /* @__PURE__ */ jsx(IconGraphicsBankTossBank, {})
1107
+ },
1248
1108
  {
1249
- nationalityCode: "KR",
1250
- nationalityCodeName: "\uB300\uD55C\uBBFC\uAD6D",
1251
- isoNumberNationalityCode: "410",
1252
- nationalityEnglishAbbreviationName: "KOR"
1109
+ codeVal: "209",
1110
+ codeName: "\uC720\uC548\uD0C0\uC99D\uAD8C",
1111
+ replaceName: "\uC720\uC548\uD0C0\uC99D\uAD8C",
1112
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockYuantaJeungkwon, {})
1253
1113
  },
1254
1114
  {
1255
- nationalityCode: "CN",
1256
- nationalityCodeName: "\uC911\uAD6D",
1257
- isoNumberNationalityCode: "156",
1258
- nationalityEnglishAbbreviationName: "CHN"
1115
+ codeVal: "218",
1116
+ codeName: "KB\uC99D\uAD8C",
1117
+ replaceName: "KB\uC99D\uAD8C",
1118
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockKbJeungkwon, {})
1259
1119
  },
1260
1120
  {
1261
- nationalityCode: "VN",
1262
- nationalityCodeName: "\uBCA0\uD2B8\uB0A8",
1263
- isoNumberNationalityCode: "704",
1264
- nationalityEnglishAbbreviationName: "VNM"
1121
+ codeVal: "230",
1122
+ codeName: "\uBBF8\uB798\uC5D0\uC14B\uC99D\uAD8C",
1123
+ replaceName: "\uBBF8\uB798\uC5D0\uC14B\uC99D\uAD8C",
1124
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockMiraeAssetJeungkwon, {})
1265
1125
  },
1266
1126
  {
1267
- nationalityCode: "US",
1268
- nationalityCodeName: "\uBBF8\uAD6D",
1269
- isoNumberNationalityCode: "840",
1270
- nationalityEnglishAbbreviationName: "USA"
1127
+ codeVal: "238",
1128
+ codeName: "\uB300\uC6B0\uC99D\uAD8C",
1129
+ replaceName: "\uB300\uC6B0\uC99D\uAD8C",
1130
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockMiraeAssetJeungkwon, {})
1271
1131
  },
1272
1132
  {
1273
- nationalityCode: "RU",
1274
- nationalityCodeName: "\uB7EC\uC2DC\uC544",
1275
- isoNumberNationalityCode: "643",
1276
- nationalityEnglishAbbreviationName: "RUS"
1133
+ codeVal: "240",
1134
+ codeName: "\uC0BC\uC131\uC99D\uAD8C",
1135
+ replaceName: "\uC0BC\uC131\uC99D\uAD8C",
1136
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockSamsungJeungkwon, {})
1137
+ },
1138
+ {
1139
+ codeVal: "243",
1140
+ codeName: "\uD55C\uAD6D\uD22C\uC790\uC99D\uAD8C",
1141
+ replaceName: "\uD55C\uAD6D\uD22C\uC790\uC99D\uAD8C",
1142
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockHankookTujajeungkwon, {})
1143
+ },
1144
+ {
1145
+ codeVal: "247",
1146
+ codeName: "\uC6B0\uB9AC\uD22C\uC790\uC99D\uAD8C",
1147
+ replaceName: "NH(\uC6B0\uB9AC)\uD22C\uC790\uC99D\uAD8C",
1148
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockNhWooriTujajeungkwon, {})
1149
+ },
1150
+ {
1151
+ codeVal: "261",
1152
+ codeName: "\uAD50\uBCF4\uC99D\uAD8C",
1153
+ replaceName: "\uAD50\uBCF4\uC99D\uAD8C",
1154
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockGyoboJeungkwon, {})
1155
+ },
1156
+ {
1157
+ codeVal: "262",
1158
+ codeName: "\uD558\uC774\uD22C\uC790\uC99D\uAD8C",
1159
+ replaceName: "\uD558\uC774\uD22C\uC790\uC99D\uAD8C",
1160
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockHiTujajeungkwon, {})
1161
+ },
1162
+ {
1163
+ codeVal: "263",
1164
+ codeName: "\uD604\uB300\uCC28\uD22C\uC790\uC99D\uAD8C",
1165
+ replaceName: "\uD604\uB300\uCC28\uC99D\uAD8C",
1166
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockHyundaiChaJeungkwon, {})
1167
+ },
1168
+ {
1169
+ codeVal: "264",
1170
+ codeName: "\uD0A4\uC6C0\uC99D\uAD8C",
1171
+ replaceName: "\uD0A4\uC6C0\uC99D\uAD8C",
1172
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockKiwoomJeungkwon, {})
1173
+ },
1174
+ {
1175
+ codeVal: "266",
1176
+ codeName: "SK\uC99D\uAD8C",
1177
+ replaceName: "SK\uC99D\uAD8C",
1178
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockSkJeungkwon, {})
1179
+ },
1180
+ {
1181
+ codeVal: "267",
1182
+ codeName: "\uB300\uC2E0\uC99D\uAD8C",
1183
+ replaceName: "\uB300\uC2E0\uC99D\uAD8C",
1184
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockDaesinJeungkwon, {})
1185
+ },
1186
+ {
1187
+ codeVal: "269",
1188
+ codeName: "\uD55C\uD654\uC99D\uAD8C",
1189
+ replaceName: "\uD55C\uD654\uD22C\uC790\uC99D\uAD8C",
1190
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockHanwhaTujajeungkwon, {})
1191
+ },
1192
+ {
1193
+ codeVal: "270",
1194
+ codeName: "\uD558\uB098\uB300\uD22C\uC99D\uAD8C",
1195
+ replaceName: "\uD558\uB098\uAE08\uC735\uD22C\uC790\uC99D\uAD8C",
1196
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockHanaGeumyungTujajeungkwon, {})
1197
+ },
1198
+ {
1199
+ codeVal: "278",
1200
+ codeName: "\uC2E0\uD55C\uAE08\uC735\uD22C\uC790",
1201
+ replaceName: "\uC2E0\uD55C\uAE08\uC735\uD22C\uC790\uC99D\uAD8C",
1202
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockSinhanTujajeungkwon, {})
1203
+ },
1204
+ {
1205
+ codeVal: "279",
1206
+ codeName: "\uB3D9\uBD80\uC99D\uAD8C",
1207
+ replaceName: "DB\uAE08\uC735\uD22C\uC790\uC99D\uAD8C",
1208
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockDbGeumyungTujajeungkwon, {})
1209
+ },
1210
+ {
1211
+ codeVal: "280",
1212
+ codeName: "\uC720\uC9C4\uD22C\uC790\uC99D\uAD8C",
1213
+ replaceName: "\uC720\uC9C4\uD22C\uC790\uC99D\uAD8C",
1214
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockYujinTujajeungkwon, {})
1215
+ },
1216
+ {
1217
+ codeVal: "287",
1218
+ codeName: "\uBA54\uB9AC\uCE20\uC99D\uAD8C",
1219
+ replaceName: "\uBA54\uB9AC\uCE20\uC99D\uAD8C",
1220
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockMeritzJeungkwon, {})
1221
+ },
1222
+ {
1223
+ codeVal: "288",
1224
+ codeName: "\uCE74\uCE74\uC624\uD398\uC774\uC99D\uAD8C",
1225
+ replaceName: "\uCE74\uCE74\uC624\uD398\uC774\uC99D\uAD8C",
1226
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockKakaoPayJeungkwon, {})
1227
+ },
1228
+ {
1229
+ codeVal: "289",
1230
+ codeName: "NH\uD22C\uC790\uC99D\uAD8C",
1231
+ replaceName: "NH\uD22C\uC790\uC99D\uAD8C",
1232
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockNhTujajeungkwon, {})
1233
+ },
1234
+ {
1235
+ codeVal: "290",
1236
+ codeName: "\uBD80\uAD6D\uC99D\uAD8C",
1237
+ replaceName: "\uBD80\uAD6D\uC99D\uAD8C",
1238
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockBugukJeungkwon, {})
1239
+ },
1240
+ {
1241
+ codeVal: "291",
1242
+ codeName: "\uC2E0\uC601\uC99D\uAD8C",
1243
+ replaceName: "\uC2E0\uC601\uC99D\uAD8C",
1244
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockSinyeongJeungkwon, {})
1277
1245
  }
1278
1246
  ];
1279
- const NationalitySearchInitialText = ({
1280
- setSearchInput,
1281
- setSearchKeyword
1282
- }) => {
1283
- const set = (keyword) => {
1284
- setSearchInput(keyword);
1285
- setSearchKeyword(keyword);
1247
+
1248
+ function useBankStockSearch({ onSelect }) {
1249
+ const { data } = useSearchCommonCodeQuery({ commonCodeId: "BANK_ORGN_DVSN_CODE" });
1250
+ const bankStockList = data?.data?.commonCodeList?.[0]?.codeList;
1251
+ const handleSelect = (item) => {
1252
+ onSelect(item);
1286
1253
  };
1287
- return /* @__PURE__ */ jsxs("div", { className: cx$h("favorite-container"), children: [
1288
- /* @__PURE__ */ jsx("p", { className: cx$h("favorite-title"), children: "\uB9CE\uC774 \uCC3E\uB294 \uAD6D\uC801" }),
1289
- /* @__PURE__ */ jsx("ul", { className: cx$h("favorite"), children: favoriteList.map((item, index) => /* @__PURE__ */ jsx("li", { onClick: () => set(item.nationalityCodeName), children: /* @__PURE__ */ jsx("button", { children: item.nationalityCodeName }) }, `${item.nationalityCode}-${index}`)) })
1290
- ] });
1291
- };
1292
- const NationalitySearchResult = ({ nationalityList, searchKeyWord, onSelect, onConfirm }) => {
1293
- const [filterList, setFilterList] = useState([]);
1294
- useEffect(() => {
1295
- const filterList2 = nationalityList.filter((item) => item.nationalityCodeName.includes(searchKeyWord)) || [];
1296
- setFilterList(filterList2);
1297
- }, [nationalityList, searchKeyWord]);
1298
- return /* @__PURE__ */ jsxs("div", { className: "mt-4", children: [
1299
- /* @__PURE__ */ jsxs("p", { className: cx$h("favorite-title"), children: [
1300
- "\uCD1D ",
1301
- /* @__PURE__ */ jsx("span", { className: "text-primary", children: filterList.length }),
1302
- "\uAC74\uC758 \uAC80\uC0C9\uACB0\uACFC"
1303
- ] }),
1304
- /* @__PURE__ */ jsx("ul", { className: cx$h("favorite"), children: filterList.length > 0 && filterList.map((item, index) => {
1305
- return /* @__PURE__ */ jsx("li", { onClick: () => {
1306
- onSelect(item.nationalityCodeName);
1307
- onConfirm();
1308
- }, children: /* @__PURE__ */ jsx("button", { children: highlightOnSearchKeyword(item.nationalityCodeName, searchKeyWord) }) }, `${index}-${item.nationalityCode}`);
1309
- }) }),
1310
- filterList.length === 0 && /* @__PURE__ */ jsxs("div", { className: cx$h("search-result"), children: [
1311
- "`",
1312
- /* @__PURE__ */ jsx("span", { className: "text-primary", children: searchKeyWord }),
1313
- "`\uC5D0 \uB300\uD55C \uAC80\uC0C9\uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."
1314
- ] })
1315
- ] });
1316
- };
1317
- function NationalityComponent({ isOpen, onClose, setValue, onConfirm }) {
1318
- const {
1319
- search,
1320
- onClear,
1321
- searchKeyWord,
1322
- onKeyUp,
1323
- onSearch,
1324
- searchList,
1325
- searchInput,
1326
- onSelect,
1327
- setSearchInput,
1328
- setSearchKeyword
1329
- } = useSearchNationality({
1330
- setValue,
1331
- onClose,
1332
- isOpen
1254
+ const bankList = bankStockList?.filter((bank) => bank.codeVal?.startsWith("0"));
1255
+ const stockList = bankStockList?.filter((stock) => stock.codeVal?.startsWith("2"));
1256
+ return {
1257
+ bankList,
1258
+ stockList,
1259
+ handleSelect
1260
+ };
1261
+ }
1262
+
1263
+ function chunk(array, size) {
1264
+ return Array.from({ length: Math.ceil(array.length / size) }, (v, i) => array.slice(i * size, i * size + size));
1265
+ }
1266
+ function BankStockSearchModal({ open, onClose, onSelect }) {
1267
+ const { bankList, stockList, handleSelect } = useBankStockSearch({
1268
+ onSelect
1333
1269
  });
1334
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Modal.Root, { isOpen, onClose, modalSize: "full-screen", children: [
1335
- /* @__PURE__ */ jsx(Modal.Overlay, {}),
1336
- /* @__PURE__ */ jsxs(Modal.Content, { children: [
1337
- /* @__PURE__ */ jsx(Modal.Header, { headerTitle: "\uAD6D\uC801 \uAC80\uC0C9", showCloseButton: true }),
1338
- /* @__PURE__ */ jsxs(Modal.Body, { children: [
1339
- /* @__PURE__ */ jsx(
1340
- InputBox$1,
1341
- {
1342
- clearable: true,
1343
- endElement: /* @__PURE__ */ jsx("button", { children: /* @__PURE__ */ jsx(IconMainUiSearch, { onClick: search }) }),
1344
- onClear,
1345
- className: cx$h("search-input"),
1346
- children: /* @__PURE__ */ jsx(
1347
- Input$1,
1348
- {
1349
- onChange: onSearch,
1350
- onKeyUp,
1351
- placeholder: "\uC9C0\uBC88, \uB3C4\uB85C\uBA85, \uAC74\uBB3C\uBA85, \uC6B0\uD3B8\uBC88\uD638 \uC785\uB825",
1352
- size: "large",
1353
- value: searchInput
1354
- }
1355
- )
1356
- }
1357
- ),
1358
- !searchKeyWord && /* @__PURE__ */ jsx(NationalitySearchInitialText, { setSearchInput, setSearchKeyword }),
1359
- searchKeyWord && /* @__PURE__ */ jsx(NationalitySearchResult, { nationalityList: searchList, searchKeyWord, onSelect, onConfirm })
1360
- ] })
1270
+ const renderItems = (list) => {
1271
+ const chunkedList = chunk(list, 5);
1272
+ return /* @__PURE__ */ jsx("div", { className: styles$1["list-container"], children: chunkedList.map((chunk2, chunkIndex) => /* @__PURE__ */ jsxs("div", { className: styles$1.row, children: [
1273
+ chunk2.map((item) => {
1274
+ const findItem = BANK_STOCK_ICON_LIST.find((icon) => icon.codeVal === item.codeVal);
1275
+ const convertedItem = findItem ? findItem : {
1276
+ icon: /* @__PURE__ */ jsx(IconGraphicsStockHochulEopsum, {}),
1277
+ replaceName: item.codeName
1278
+ };
1279
+ return /* @__PURE__ */ jsxs("div", { className: styles$1.item, onClick: () => handleSelect(item), children: [
1280
+ /* @__PURE__ */ jsx("div", { className: styles$1["icon-wrapper"], children: convertedItem?.icon }),
1281
+ /* @__PURE__ */ jsxs("span", { children: [
1282
+ " ",
1283
+ convertedItem?.replaceName
1284
+ ] })
1285
+ ] }, `${item.codeVal}-${chunkIndex}`);
1286
+ }),
1287
+ chunk2.length < 5 && Array.from({ length: 5 - chunk2.length }).map((_, i) => /* @__PURE__ */ jsx("div", { className: styles$1.item, style: { visibility: "hidden" } }, `placeholder-${chunkIndex}-${i}`))
1288
+ ] }, chunkIndex)) });
1289
+ };
1290
+ return /* @__PURE__ */ jsxs(Modal.Root, { isOpen: open, onClose, modalSize: "full-screen", children: [
1291
+ /* @__PURE__ */ jsx(Modal.Overlay, {}),
1292
+ /* @__PURE__ */ jsxs(Modal.Content, { children: [
1293
+ /* @__PURE__ */ jsx(Modal.Header, { headerTitle: "\uC740\uD589/\uC99D\uAD8C\uC0AC \uC120\uD0DD", showCloseButton: true }),
1294
+ /* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsxs("div", { className: styles$1.container, children: [
1295
+ /* @__PURE__ */ jsxs("div", { className: styles$1.section, children: [
1296
+ /* @__PURE__ */ jsx("p", { className: styles$1["section-title"], children: "\uC740\uD589\uC0AC" }),
1297
+ renderItems(bankList || [])
1298
+ ] }),
1299
+ /* @__PURE__ */ jsxs("div", { className: styles$1.section, children: [
1300
+ /* @__PURE__ */ jsx("p", { className: styles$1["section-title"], children: "\uC99D\uAD8C\uC0AC" }),
1301
+ renderItems(stockList || [])
1302
+ ] })
1303
+ ] }) })
1361
1304
  ] })
1362
- ] }) });
1305
+ ] });
1363
1306
  }
1364
1307
 
1365
- function useSearchNationality({ setValue, onClose, isOpen }) {
1366
- const [searchKeyWord, setSearchKeyword] = useState("");
1367
- const [selectedNationality, setSelectedNationality] = useState();
1308
+ const useCustomerSearch = (onSelect) => {
1309
+ const { triggerRef, isOpen, setIsOpen, DropDown } = useDropDown();
1310
+ const [searchKeyword, setSearchKeyword] = useState("");
1368
1311
  const [searchInput, setSearchInput] = useState("");
1369
- const { data } = useSearchNationalityQuery({ searchKeyWord });
1370
- const searchList = data?.data.nationalityList || [];
1371
- const onSearch = (e) => {
1372
- const typeStr = e.target.value;
1373
- setSearchInput(typeStr);
1374
- };
1312
+ const [customerList, setCustomerList] = useState([]);
1313
+ const [selectedCustomer, setSelectedCustomer] = useState(null);
1314
+ const { data } = useSearchCustomerListQuery({ customerName: searchKeyword });
1375
1315
  const search = () => {
1376
- if (searchInput === "") {
1377
- onClear();
1378
- return;
1379
- }
1380
- if (searchInput && searchInput.length > 0) {
1316
+ if (searchInput.length >= 2) {
1381
1317
  setSearchKeyword(searchInput);
1382
- setSelectedNationality("");
1318
+ setIsOpen(true);
1319
+ } else {
1320
+ setCustomerList([]);
1321
+ setSearchKeyword("");
1322
+ setIsOpen(false);
1383
1323
  }
1384
1324
  };
1385
1325
  const onKeyUp = (e) => {
1386
1326
  const currentValue = e.target.value;
1387
- if (currentValue.length === 0 || currentValue.slice(-1).normalize("NFD").length > 1) {
1327
+ if (currentValue.length === 0 || currentValue.slice(-1).normalize("NFD").length > 1 && currentValue.length > 1) {
1388
1328
  search();
1389
1329
  }
1390
1330
  };
1391
- const onClear = useCallback(() => {
1392
- setSearchKeyword("");
1331
+ const onSearchInputChange = (e) => {
1332
+ setSearchInput(e.target.value);
1333
+ };
1334
+ const onClear = () => {
1393
1335
  setSearchInput("");
1394
- setSelectedNationality("");
1395
- }, []);
1396
- const onSelect = (nationality) => {
1397
- setSelectedNationality(nationality);
1398
- const value = searchList.find((item) => item.nationalityCodeName === nationality);
1399
- value && setValue(value);
1400
- onClose();
1336
+ setSearchKeyword("");
1337
+ setCustomerList([]);
1338
+ setSelectedCustomer(null);
1339
+ setIsOpen(false);
1401
1340
  };
1402
- useEffect(() => {
1403
- if (isOpen) {
1404
- setSelectedNationality("");
1405
- setSearchKeyword("");
1341
+ const handleSelectItem = (customer) => {
1342
+ setSelectedCustomer(customer);
1343
+ setSearchInput(customer.customerName || "");
1344
+ setCustomerList([]);
1345
+ setIsOpen(false);
1346
+ if (onSelect) {
1347
+ onSelect(customer);
1406
1348
  }
1407
- }, [isOpen]);
1349
+ };
1350
+ useEffect(() => {
1351
+ const filtered = data?.data?.custList?.filter(
1352
+ (c) => c.customerName?.toLowerCase().includes(searchInput.toLowerCase())
1353
+ );
1354
+ setCustomerList(filtered || []);
1355
+ }, [data, searchInput]);
1408
1356
  return {
1409
- onClear,
1410
- searchKeyWord,
1411
- searchList,
1412
- selectedNationality,
1413
- onSearch,
1357
+ triggerRef,
1358
+ isOpen,
1359
+ DropDown,
1360
+ searchInput,
1361
+ customerList,
1362
+ searchKeyword,
1363
+ onSearchInputChange,
1414
1364
  onKeyUp,
1415
1365
  search,
1416
- searchInput,
1417
- onSelect,
1366
+ onClear,
1367
+ handleSelectItem,
1368
+ selectedCustomer,
1369
+ setSearchInput,
1370
+ setCustomerList,
1418
1371
  setSearchKeyword,
1419
- setSearchInput
1420
- };
1421
- }
1422
- const useNationalityComponent = () => {
1423
- const [nationality, setNationality] = useState();
1424
- const { isOpen, closeModal, openModal } = useModalState();
1425
- const [isConfirmed, setIsConfirmed] = useState(false);
1426
- const onConfirm = () => {
1427
- setIsConfirmed(true);
1428
- };
1429
- const openInitModal = () => {
1430
- setIsConfirmed(false);
1431
- openModal();
1432
- };
1433
- const NationalitySearchComponent = () => /* @__PURE__ */ jsx(NationalityComponent, { isOpen, onClose: closeModal, setValue: setNationality, onConfirm });
1434
- return {
1435
- isOpen,
1436
- closeModal,
1437
- setNationality,
1438
- nationality,
1439
- openModal: openInitModal,
1440
- NationalitySearchComponent,
1441
- isConfirmed,
1442
- setIsConfirmed
1443
- };
1444
- };
1445
-
1446
- var dayjs_min$1 = {exports: {}};
1447
-
1448
- var dayjs_min = dayjs_min$1.exports;
1449
-
1450
- var hasRequiredDayjs_min;
1451
-
1452
- function requireDayjs_min () {
1453
- if (hasRequiredDayjs_min) return dayjs_min$1.exports;
1454
- hasRequiredDayjs_min = 1;
1455
- (function (module, exports) {
1456
- !function(t,e){module.exports=e();}(dayjs_min,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,true),this.parse(t),this.$x=this.$x||t.x||{},this[p]=true;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,false)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case "YY":return String(e.$y).slice(-2);case "YYYY":return b.s(e.$y,4,"0");case "M":return a+1;case "MM":return b.s(a+1,2,"0");case "MMM":return h(n.monthsShort,a,c,3);case "MMMM":return h(c,a);case "D":return e.$D;case "DD":return b.s(e.$D,2,"0");case "d":return String(e.$W);case "dd":return h(n.weekdaysMin,e.$W,o,2);case "ddd":return h(n.weekdaysShort,e.$W,o,3);case "dddd":return o[e.$W];case "H":return String(s);case "HH":return b.s(s,2,"0");case "h":return d(1);case "hh":return d(2);case "a":return $(s,u,true);case "A":return $(s,u,false);case "m":return String(u);case "mm":return b.s(u,2,"0");case "s":return String(e.$s);case "ss":return b.s(e.$s,2,"0");case "SSS":return b.s(e.$ms,3,"0");case "Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,true);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=true),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
1457
- } (dayjs_min$1));
1458
- return dayjs_min$1.exports;
1459
- }
1460
-
1461
- var dayjs_minExports = requireDayjs_min();
1462
- var dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports);
1463
-
1464
- var customParseFormat$2 = {exports: {}};
1465
-
1466
- var customParseFormat$1 = customParseFormat$2.exports;
1467
-
1468
- var hasRequiredCustomParseFormat;
1469
-
1470
- function requireCustomParseFormat () {
1471
- if (hasRequiredCustomParseFormat) return customParseFormat$2.exports;
1472
- hasRequiredCustomParseFormat = 1;
1473
- (function (module, exports) {
1474
- !function(e,t){module.exports=t();}(customParseFormat$1,(function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,s={},a=function(e){return (e=+e)+(e>68?1900:2e3)};var f=function(e){return function(t){this[e]=+t;}},h=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e);}],u=function(e){var t=s[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=s.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},c={A:[o,function(e){this.afternoon=d(e,false);}],a:[o,function(e){this.afternoon=d(e,true);}],Q:[n,function(e){this.month=3*(e-1)+1;}],S:[n,function(e){this.milliseconds=100*+e;}],SS:[r,function(e){this.milliseconds=10*+e;}],SSS:[/\d{3}/,function(e){this.milliseconds=+e;}],s:[i,f("seconds")],ss:[i,f("seconds")],m:[i,f("minutes")],mm:[i,f("minutes")],H:[i,f("hours")],h:[i,f("hours")],HH:[i,f("hours")],hh:[i,f("hours")],D:[i,f("day")],DD:[r,f("day")],Do:[o,function(e){var t=s.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r);}],w:[i,f("week")],ww:[r,f("week")],M:[i,f("month")],MM:[r,f("month")],MMM:[o,function(e){var t=u("months"),n=(u("monthsShort")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n;}],MMMM:[o,function(e){var t=u("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t;}],Y:[/[+-]?\d+/,f("year")],YY:[r,function(e){this.year=a(e);}],YYYY:[/\d{4}/,f("year")],Z:h,ZZ:h};function l(n){var r,i;r=n,i=s&&s.formats;for(var o=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),a=o.length,f=0;f<a;f+=1){var h=o[f],u=c[h],d=u&&u[0],l=u&&u[1];o[f]=l?{regex:d,parser:l}:h.replace(/^\[|\]$/g,"");}return function(e){for(var t={},n=0,r=0;n<a;n+=1){var i=o[n];if("string"==typeof i)r+=i.length;else {var s=i.regex,f=i.parser,h=e.slice(r),u=s.exec(h)[0];f.call(t,u),e=e.replace(u,"");}}return function(e){var t=e.afternoon;if(void 0!==t){var n=e.hours;t?n<12&&(e.hours+=12):12===n&&(e.hours=0),delete e.afternoon;}}(t),t}}return function(e,t,n){n.p.customParseFormat=true,e&&e.parseTwoDigitYear&&(a=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,o=e.args;this.$u=r;var a=o[1];if("string"==typeof a){var f=true===o[2],h=true===o[3],u=f||h,d=o[2];h&&(d=o[2]),s=this.$locale(),!f&&d&&(s=n.Ls[d]),this.$d=function(e,t,n,r){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var i=l(t)(e),o=i.year,s=i.month,a=i.day,f=i.hours,h=i.minutes,u=i.seconds,d=i.milliseconds,c=i.zone,m=i.week,M=new Date,Y=a||(o||s?1:M.getDate()),p=o||M.getFullYear(),v=0;o&&!s||(v=s>0?s-1:M.getMonth());var D,w=f||0,g=h||0,y=u||0,L=d||0;return c?new Date(Date.UTC(p,v,Y,w,g,y,L+60*c.offset*1e3)):n?new Date(Date.UTC(p,v,Y,w,g,y,L)):(D=new Date(p,v,Y,w,g,y,L),m&&(D=r(D).week(m).toDate()),D)}catch(e){return new Date("")}}(t,a,r,n),this.init(),d&&true!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(a)&&(this.$d=new Date("")),s={};}else if(a instanceof Array)for(var c=a.length,m=1;m<=c;m+=1){o[1]=a[m-1];var M=n.apply(this,o);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}m===c&&(this.$d=new Date(""));}else i.call(this,e);};}}));
1475
- } (customParseFormat$2));
1476
- return customParseFormat$2.exports;
1477
- }
1478
-
1479
- var customParseFormatExports = requireCustomParseFormat();
1480
- var customParseFormat = /*@__PURE__*/getDefaultExportFromCjs(customParseFormatExports);
1481
-
1482
- var __defProp = Object.defineProperty;
1483
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1484
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
1485
- var getCookie = (name) => {
1486
- if (typeof document === "undefined") {
1487
- return "";
1488
- }
1489
- const match = document.cookie.match(new RegExp(`(^|; *)${name}=([^;]*)`));
1490
- return match ? decodeURIComponent(match[2] || "") : "";
1491
- };
1492
- var getSubdomain = (hostname) => {
1493
- if (!hostname || hostname === "localhost" || hostname === "127.0.0.1") {
1494
- return "";
1495
- }
1496
- const parts = hostname.split(".");
1497
- if (parts.length < 3) {
1498
- return "";
1499
- }
1500
- return parts[0] ?? "";
1501
- };
1502
- var getEnvironmentFromHostname = (hostname) => {
1503
- const debugModeEnv = getCookie("dsp-debug-mode-env")?.toLowerCase();
1504
- if (debugModeEnv) {
1505
- return debugModeEnv;
1506
- }
1507
- const subDomain = getSubdomain(hostname);
1508
- if (hostname === "localhost" || hostname === "127.0.0.1" || hostname.startsWith("localhost")) {
1509
- return "local";
1510
- }
1511
- if (subDomain.includes(`dev`)) {
1512
- return "dev";
1513
- }
1514
- if (subDomain.includes("stg")) {
1515
- return "stg";
1516
- }
1517
- return "prd";
1518
- };
1519
- var _MessageEventManager = class _MessageEventManager2 {
1520
- constructor() {
1521
- __publicField(this, "handlers", /* @__PURE__ */ new Map());
1522
- window.addEventListener("message", this.handleMessage.bind(this));
1523
- }
1524
- static getInstance() {
1525
- if (!_MessageEventManager2.instance) {
1526
- _MessageEventManager2.instance = new _MessageEventManager2();
1527
- }
1528
- return _MessageEventManager2.instance;
1529
- }
1530
- /**
1531
- *
1532
- * @param event
1533
- */
1534
- handleMessage(event) {
1535
- for (const [key, handler] of this.handlers) {
1536
- try {
1537
- handler(event);
1538
- } catch (error) {
1539
- console.error(`Message handler ${key} error:`, error);
1540
- }
1541
- }
1542
- }
1543
- /**
1544
- * 이벤트 헨들러 함수를 등록합니다.
1545
- * @param key
1546
- * @param handler
1547
- */
1548
- registerHandler(key, handler) {
1549
- this.handlers.set(key, handler);
1550
- }
1551
- /**
1552
- * 이벤트 핸들러 함수를 삭제합니다.
1553
- * @param key
1554
- */
1555
- unregisterHandler(key) {
1556
- this.handlers.delete(key);
1557
- }
1372
+ setIsOpen
1373
+ };
1558
1374
  };
1559
- __publicField(_MessageEventManager, "instance");
1560
- var MessageEventManager = _MessageEventManager;
1561
- function base64ToBlob(base64String, contentType = "") {
1562
- const regex = /^data:([a-zA-Z0-9/+.-]+);base64,/;
1563
- const matches = base64String.match(regex);
1564
- if (matches === null) {
1565
- throw new Error("Invalid base64 string");
1566
- }
1567
- const contentTypeFinal = contentType || matches[1];
1568
- const byteCharacters = atob(base64String.replace(regex, ""));
1569
- const byteNumbers = new Array(byteCharacters.length);
1570
- for (let i = 0; i < byteCharacters.length; i++) {
1571
- byteNumbers[i] = byteCharacters.charCodeAt(i);
1572
- }
1573
- const byteArray = new Uint8Array(byteNumbers);
1574
- return new Blob([byteArray], { type: contentTypeFinal });
1575
- }
1576
- function base64ToFile(base64String, fileName, contentType = "") {
1577
- const blob = base64ToBlob(base64String, contentType);
1578
- if (!blob) {
1579
- throw new Error("Invalid base64 string");
1580
- }
1581
- return blobToFile(blob, fileName);
1582
- }
1583
- function blobToFile(blob, fileName) {
1584
- return new File([blob], fileName, {
1585
- type: blob.type,
1586
- lastModified: Date.now()
1587
- });
1588
- }
1589
- async function fileToBase64(file) {
1590
- return new Promise((resolve, reject) => {
1591
- const reader = new FileReader();
1592
- reader.onload = () => {
1593
- if (typeof reader.result === "string") {
1594
- resolve(reader.result);
1595
- } else {
1596
- reject(new Error("Invalid file type"));
1375
+
1376
+ const cx$j = classNames.bind(styles$2);
1377
+ const { InputBox: InputBox$3, Input: Input$3 } = FormCore;
1378
+ const CustomerSearch = ({
1379
+ onSelectCustomer,
1380
+ onSearchClear,
1381
+ placeholder,
1382
+ rootProps,
1383
+ size = "large",
1384
+ ...props
1385
+ }) => {
1386
+ const {
1387
+ triggerRef,
1388
+ isOpen,
1389
+ DropDown,
1390
+ searchInput,
1391
+ customerList,
1392
+ searchKeyword,
1393
+ onSearchInputChange,
1394
+ onKeyUp,
1395
+ search,
1396
+ onClear,
1397
+ handleSelectItem
1398
+ } = useCustomerSearch(onSelectCustomer);
1399
+ const handleClear = () => {
1400
+ onClear();
1401
+ onSearchClear?.();
1402
+ };
1403
+ return /* @__PURE__ */ jsxs("div", { className: cx$j("container"), children: [
1404
+ /* @__PURE__ */ jsx("div", { className: cx$j("search-bar"), children: /* @__PURE__ */ jsx(
1405
+ InputBox$3,
1406
+ {
1407
+ ...rootProps,
1408
+ endElement: /* @__PURE__ */ jsx(IconMainUiSearch, { Click: search, style: { width: "20px", height: "20px" } }),
1409
+ onClear: handleClear,
1410
+ clearable: true,
1411
+ children: /* @__PURE__ */ jsx(
1412
+ Input$3,
1413
+ {
1414
+ ...props,
1415
+ onChange: onSearchInputChange,
1416
+ onKeyUp,
1417
+ value: searchInput,
1418
+ placeholder: placeholder || "\uACE0\uAC1D\uBA85\uC744 \uB450 \uAE00\uC790 \uC774\uC0C1 \uC785\uB825\uD574\uC8FC\uC138\uC694.",
1419
+ size,
1420
+ ref: triggerRef
1421
+ }
1422
+ )
1597
1423
  }
1598
- };
1599
- reader.onerror = (error) => {
1600
- reject(error);
1601
- };
1602
- reader.readAsDataURL(file);
1603
- });
1604
- }
1605
- function getExt(data) {
1606
- if (typeof data === "string") {
1607
- return data.split(".").pop();
1608
- }
1609
- if (data instanceof File) {
1610
- return data.name.split(".").pop();
1611
- }
1612
- if (data instanceof Blob) {
1613
- return data.type.split("/").pop();
1614
- }
1615
- }
1616
- function downloadBlob(blob, filename) {
1617
- const url = URL.createObjectURL(blob);
1618
- const link = document.createElement("a");
1619
- link.style.display = "none";
1620
- link.href = url;
1621
- link.download = `${filename}.${getExt(blob)}`;
1622
- document.body.appendChild(link);
1623
- link.click();
1624
- document.body.removeChild(link);
1625
- URL.revokeObjectURL(url);
1626
- }
1627
- async function imageUrlToFile(imageUrl) {
1628
- const headers = new Headers();
1629
- headers.append("cache-control", "no-cache");
1630
- const resImage = await fetch(imageUrl, { headers });
1631
- const blob = await resImage.blob();
1632
- const { type } = blob;
1633
- const name = type.split("/").join(".");
1634
- const file = new File([blob], name, { type });
1635
- return file;
1636
- }
1637
- var astx2_min_default = "/* eslint-disable */\n/* ASTx 1.3 | (C) Copyright AhnLab, Inc. | $Revision: 32070 $ */\nvar $ASTX2_CONST = {\n ERROR_SUCCESS: 0,\n ERROR_FAILED: 101,\n ERROR_NOINIT: 102,\n ERROR_NOTINST: 103,\n ERROR_NOTSUPPORTED: 104,\n ERROR_NOCONNECT: 105,\n ERROR_NCK: 106,\n ERROR_ERR: 107,\n ERROR_NSP: 108,\n ERROR_PARAM: 109,\n ERROR_EXCESS: 110,\n ERROR_NEEDUPDATE: 111,\n OPTION_NONE2E: 1,\n OPTION_AUTOFOCUS: 2,\n OPTION_AUTOSETTEXT: 4,\n OPTION_E2EFORM: 8,\n OPTION_E2EFORM_NOENC: 16,\n OPTION_E2EFORM_ALLTRIP: 32,\n OPTION_E2EFORM_ONLY: 64,\n OPTION_E2EFORM_TAGSET: 128,\n OPTION_NONE2E_ALG: 256,\n OPTION_NOSPTDUMMY: 512,\n OPTION_FIXEDTYPE: 1024,\n PROTECT_AK: 1,\n PROTECT_FW: 2,\n PROTECT_PB: 4,\n PROTECT_PCS: 8,\n SERVICE_AK: 1,\n REQUEST_JSONP: 1,\n REQUEST_AJAX: 2,\n DEBUG_NOALIVE: 1,\n INTERVAL_ALIVE: 5e3,\n E2ETYPE_EXCLUDE: -1,\n E2ETYPE_NONE: 0,\n E2ETYPE_CERT1: 1,\n E2ETYPE_CERT2: 2,\n E2ETYPE_SDK: 11,\n E2ETYPE_PLAIN1: 21,\n E2ETYPE_PLAIN2: 22,\n E2ETYPE_WIZVERA: 31,\n PAGEID: '',\n BROWSER_TYPE: '',\n BROWSER_VER: '',\n E2EFORM_TAIL: !0,\n E2EFORM_INIT: '_e2e_forminit',\n E2EFORM_TAG1: '_e2e_1__',\n E2EFORM_TAG2: '_e2e_2__',\n E2EFORM_TAG1_PWD: '_e2e_1_pwd__',\n E2EFORM_TAG2_PWD: '_e2e_2_pwd__',\n getErrno: function (a) {\n return 'NCK' == a ? this.ERROR_NCK : 'ERR' == a ? this.ERROR_ERR : 'NSP' == a ? this.ERROR_NSP : this.ERROR_FAILED;\n },\n _get_browser_version: function (a) {\n var b = 0;\n if (0 <= a.indexOf('Edge/') && ((b = parseInt(a.split('Edge/')[1])), 0 < b)) return 'EG' + b;\n if (0 <= a.indexOf('MSIE')) {\n if (((b = parseInt(a.split('MSIE')[1])), 0 < b)) return 'IE' + b;\n } else if (\n 0 <= a.indexOf('Trident') &&\n (0 <= a.indexOf('rv:')\n ? (b = parseInt(a.split('rv:')[1]))\n : 0 <= a.indexOf('IE') && (b = parseInt(a.split('IE')[1])),\n 0 < b)\n )\n return 'IE' + b;\n return 0 <= a.indexOf('OPR/') && ((b = parseInt(a.split('OPR/')[1])), 0 < b)\n ? 'OP' + b\n : 0 <= a.indexOf('Firefox/') && ((b = parseInt(a.split('Firefox/')[1])), 0 < b)\n ? 'FF' + b\n : 0 <= a.indexOf('Chrome/') && ((b = parseInt(a.split('Chrome/')[1])), 0 < b)\n ? 'CR' + b\n : 0 <= a.indexOf('AppleWebKit') &&\n 0 <= a.indexOf('Version/') &&\n ((b = parseInt(a.split('Version/')[1])), 0 < b)\n ? 'SF' + b\n : 'OT0';\n },\n init: function () {\n this.PAGEID = new Date().getTime();\n this.PAGEID -= Math.floor(100 * Math.random());\n this.BROWSER_VER = this._get_browser_version(navigator.userAgent);\n this.BROWSER_TYPE = this.BROWSER_VER.substring(0, 2);\n }\n};\n$ASTX2_CONST.init();\nvar $ASTX2_COMM = {\n mLocalServerURL: '',\n mClientPublicKey: '',\n mErrorAbortFlag: !1,\n mDegugFlags: 0,\n setDegugFlags: function (a) {\n this.mDegugFlags |= a;\n },\n getDegugFlags: function () {\n return this.mDegugFlags;\n },\n isEnable: function () {\n return 0 < this.mLocalServerURL.length ? !0 : !1;\n },\n uninit: function () {\n this.mLocalServerURL = '';\n },\n errorAbort: function (a) {\n 1 != this.mErrorAbortFlag && ((this.mErrorAbortFlag = !0), $ASTX2_CUST.errorAbort(a));\n }\n },\n $_astxu = {\n mJsonpSequence: 0,\n jsonQstr: function (a) {\n var b = [],\n c;\n for (c in a) a.hasOwnProperty(c) && b.push(encodeURIComponent(c) + '=' + encodeURIComponent(a[c]));\n return b.join('&');\n },\n jsonParse: function (a) {\n var b = a.indexOf('{'),\n c = a.indexOf('}');\n if (-1 == b || -1 == c) return {};\n a = a.substring(b, c + 1);\n return 'object' == typeof window.JSON && 'function' == typeof window.JSON.parse\n ? window.JSON.parse(a)\n : 'function' == typeof jQuery && 'function' == typeof jQuery.parseJSON\n ? jQuery.parseJSON(a)\n : eval('(' + a + ')');\n },\n _send_jsonp_jquery: function (a) {\n try {\n jQuery.ajax({\n url: a.src,\n timeout: a.timeout,\n cache: !1,\n crossDomain: !0,\n dataType: 'jsonp',\n contentType: 'application/javascript',\n success: function (b, d, e) {\n a.onSuccess(b);\n },\n error: function (b, d, e) {\n if (200 == b.status && 1 == a.nocallback) a.onSuccess();\n else a.onFailure();\n },\n complete: function (a, b) {}\n });\n } catch (b) {\n a.onFailure();\n }\n },\n _send_jsonp_dom: function (a) {\n var b = document.createElement('script');\n b.type = 'text/javascript';\n b.id = a.callback;\n b.async = a.async;\n b.src = a.src;\n var c = document.getElementsByTagName('body')[0];\n if (null == c && ((c = document.getElementsByTagName('head')[0]), null == c)) {\n a.onFailure();\n return;\n }\n var d = window.setTimeout(function () {\n window[a.callback] = function () {};\n try {\n var b = document.getElementById(a.callback);\n b && ((b.onerror = function () {}), c.removeChild(b));\n } catch (d) {}\n a.onFailure();\n }, a.timeout);\n 0 == a.nocallback\n ? (window[a.callback] = function (b) {\n window.clearTimeout(d);\n try {\n var f = document.getElementById(a.callback);\n f && c.removeChild(f);\n } catch (g) {}\n a.onSuccess(b);\n })\n : (b.onload = function () {\n window.clearTimeout(d);\n try {\n var b = document.getElementById(a.callback);\n b && c.removeChild(b);\n } catch (f) {}\n a.onSuccess();\n });\n b.onerror = function () {\n window.clearTimeout(d);\n window[a.callback] = function () {};\n try {\n var b = document.getElementById(a.callback);\n b && c.removeChild(b);\n } catch (f) {}\n a.onFailure();\n };\n c.appendChild(b);\n },\n sendJsonp: function (a) {\n null == a.data && (a.data = {});\n null == a.callback && (a.callback = 'jsonpCallback' + $_astxu.rnd());\n null == a.nocallback && (a.nocallback = !1);\n null == a.timeout && (a.timeout = 5e3);\n null == a.async && (a.async = !0);\n null == a.seq && (a.seq = !1);\n null == a.onSuccess && (a.onSuccess = function (a) {});\n null == a.onFailure && (a.onFailure = function () {});\n a.src = 1 == $ASTX2.mUseJQuery ? a.url + '?v=3' : a.url + '?v=2&callback=' + a.callback;\n if (1 == a.seq) {\n var b = ++this.mJsonpSequence;\n a.src += '&seq=' + b;\n 2147483647 <= this.mJsonpSequence && (this.mJsonpSequence = 0);\n }\n b = this.jsonQstr(a.data);\n 0 < b.length && (a.src += '&' + b);\n 1 == $ASTX2.mUseJQuery ? this._send_jsonp_jquery(a) : this._send_jsonp_dom(a);\n },\n _get_xhr_object: function () {\n if ('undefined' !== typeof XMLHttpRequest)\n try {\n return new XMLHttpRequest();\n } catch (a) {}\n try {\n return new ActiveXObject('Microsoft.XMLHTTP');\n } catch (b) {}\n return null;\n },\n sendAjax: function (a) {\n var b = this._get_xhr_object();\n if (null == b) $_astxu.msg('[sendAjax] _get_xhr_object failed');\n else {\n null == a.data && (a.data = {});\n null == a.type && (a.type = 'POST');\n null == a.async && (a.async = !0);\n null == a.onSuccess && (a.onSuccess = function (a) {});\n null == a.onFailure && (a.onFailure = function (a, b) {});\n var c = this.jsonQstr(a.data);\n b.open(a.type, 'GET' == a.type ? a.url + '&' + c : a.url, a.async);\n b.onreadystatechange = function () {\n if (4 == b.readyState)\n if (200 == b.status) a.onSuccess(b.responseText);\n else a.onFailure(b.status);\n };\n null != a.timeout && (b.timeout = a.timeout);\n b.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n b.send(c);\n }\n },\n sendAuthAjax: function (a) {\n var b = this._get_xhr_object();\n const stored = JSON.parse(sessionStorage.getItem('cust-mgmt-auth') || '{}');\n if (null == b) $_astxu.msg('[sendAjax] _get_xhr_object failed');\n else {\n null == a.data && (a.data = {});\n null == a.type && (a.type = 'POST');\n null == a.async && (a.async = !0);\n null == a.onSuccess && (a.onSuccess = function (a) {});\n null == a.onFailure && (a.onFailure = function (a, b) {});\n var c = this.jsonQstr(a.data);\n b.open(a.type, 'GET' == a.type ? a.url + '&' + c : a.url, a.async);\n b.onreadystatechange = function () {\n if (4 == b.readyState)\n if (200 == b.status) a.onSuccess(b.responseText);\n else a.onFailure(b.status);\n };\n null != a.timeout && (b.timeout = a.timeout);\n b.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n b.setRequestHeader('Authorization', stored.key);\n b.withCredentials = true;\n b.send(c);\n }\n },\n isACK: function (a) {\n return a && 'ACK' == a ? !0 : !1;\n },\n isWinOS: function () {\n return -1 != navigator.platform.indexOf('Win32') || -1 != navigator.platform.indexOf('Win64') ? !0 : !1;\n },\n isMacOS: function () {\n return -1 != navigator.platform.indexOf('Mac') ? !0 : !1;\n },\n isLinuxOS: function () {\n return -1 != navigator.platform.indexOf('Linux') ? !0 : !1;\n },\n isMacLinuxOS: function () {\n return 1 == this.isMacOS() || 1 == this.isLinuxOS() ? !0 : !1;\n },\n hasFocused: function () {\n var a = !1;\n try {\n a = document.hasFocus();\n } catch (b) {}\n return a;\n },\n addEvent: function (a, b, c) {\n a.addEventListener ? a.addEventListener(b, c, !1) : a.attachEvent('on' + b, c);\n },\n removeEvent: function (a, b, c) {\n a.removeEventListener ? a.removeEventListener(b, c) : a.detachEvent('on' + b, c);\n },\n getCreatedFormValue: function (a, b, c) {\n null == c && (c = !1);\n c = 1 == c ? document.getElementsByTagName('input') : a.getElementsByTagName('input');\n for (var d = 0; d < c.length; d++) {\n var e = c[d];\n if (e && this.getnc(e.name) == b) return e;\n }\n c = document.createElement('input');\n c.name = b;\n c.type = 'hidden';\n if ('function' === typeof $ASTX2_CUST.onCreatedFormValue) $ASTX2_CUST.onCreatedFormValue(c, b);\n a.appendChild(c);\n return c;\n },\n getHostPath: function () {\n var a = window.location.protocol + '//' + window.location.hostname;\n return (a += window.location.port ? ':' + window.location.port : '');\n },\n getnc: function (a, b) {\n null == b && (b = '');\n return null == a ? b : a;\n },\n getint: function (a, b) {\n null == b && (b = 0);\n return parseInt(a) || b;\n },\n rnd: function () {\n var a = new Date().getTime();\n return (a += new String(Math.floor(100 * Math.random())));\n },\n getKeyCode: function (a) {\n var b = null;\n a && (b = a.keyCode ? a.keyCode : a.which);\n return b;\n },\n xorEncode: function (a, b) {\n for (var c = '', d = new String(a), e = 0; e < d.length; e++) c += String.fromCharCode(b ^ d.charCodeAt(e));\n return c;\n },\n xorDecode: function (a, b) {\n for (var c = '', d = new String(a), e = 0; e < d.length; e++) c += String.fromCharCode(b ^ d.charCodeAt(e));\n return c;\n },\n ltrim: function (a, b) {\n for (b = this.getnc(b, ' '); a.substring(0, 1) == b; ) a = a.substring(1, a.length);\n return a;\n },\n rtrim: function (a, b) {\n for (b = this.getnc(b, ' '); a.substring(a.length - 1, a.length) == b; ) a = a.substring(0, a.length - 1);\n return a;\n },\n alltrim: function (a, b) {\n return this.ltrim(this.rtrim(a, b), b);\n },\n setInputFocus: function () {\n try {\n for (var a = document.getElementsByTagName('input'), b = 0; b < a.length; b++) {\n var c = a[b];\n if (c && 'hidden' != c.type) {\n c.focus();\n break;\n }\n }\n } catch (d) {}\n },\n log: function (a) {\n 'object' === typeof debuger && 'function' === typeof debuger.write\n ? debuger.write(a)\n : 'object' === typeof window.console && 'function' === typeof console.log && console.log(a);\n },\n msg: function (a) {\n this.log(a);\n }\n },\n $ASTX2_E2E = (function () {\n var a = null,\n b = function (a) {\n function b(a) {\n var c = a.target;\n null == c && (c = a.srcElement);\n return c;\n }\n function e(a) {\n if (null == a) return null;\n var b = a.getAttribute('e2e_inputid');\n if (null == b || 0 >= b) return null;\n var c = a.getAttribute('e2e_type');\n if (null == c || 0 >= c) return null;\n var d = a.getAttribute('e2e_inputtype');\n if (null == d || 0 >= d) d = '';\n var e = a.getAttribute('wizvera_key');\n null == e && (e = '');\n var f = {};\n f.e2e_inputid = b;\n f.e2e_type = c;\n f.e2e_inputtype = d;\n f.name = $_astxu.getnc(a.name);\n f.form = a.form ? $_astxu.getnc(a.form.name) : '';\n f.wizvera_key = e;\n return f;\n }\n function f(a) {\n var b = e(a);\n if (null == b) return null;\n b.type = $_astxu.getnc(a.type);\n b.maxlength = $_astxu.getnc(a.getAttribute('maxlength'));\n b.txtmsk = $_astxu.getnc(a.getAttribute('e2e_txtmsk'));\n return b;\n }\n function g(a, b) {\n a.getAttribute('e2e_type') != $ASTX2_CONST.E2ETYPE_PLAIN1 && (a.readOnly = b);\n }\n function h(a, b, c, d, e) {\n 1 == n && q(a, b, c, d, e);\n }\n function q(b, s, d, e, f) {\n var g = {};\n g.pageid = $ASTX2_CONST.PAGEID;\n if (null != s) for (var h in s) s.hasOwnProperty(h) && (g[h] = s[h]);\n a.send_e2e_cmd(b, g, d, e, f);\n }\n function l(a, b) {\n var c = '';\n return (c = 0 == $ASTX2_CONST.E2EFORM_TAIL ? b + a : a + b);\n }\n function m(a, b) {\n var c = '';\n return (c =\n 'password' == a.type\n ? b == $ASTX2_CONST.E2ETYPE_CERT2\n ? l(a.name, $ASTX2_CONST.E2EFORM_TAG2_PWD)\n : l(a.name, $ASTX2_CONST.E2EFORM_TAG1_PWD)\n : b == $ASTX2_CONST.E2ETYPE_CERT2\n ? l(a.name, $ASTX2_CONST.E2EFORM_TAG2)\n : l(a.name, $ASTX2_CONST.E2EFORM_TAG1));\n }\n function C() {\n if (0 != D)\n for (var a = document.getElementsByTagName('form'), b = 0; b < a.length; b++) {\n var c = a[b];\n if (null != c) {\n var d = !1;\n if (k & $ASTX2_CONST.OPTION_E2EFORM_TAGSET) {\n var e = c.getAttribute(E.e2eform_tagset);\n if (null == e || 0 >= e) d = !0;\n } else if (k & $ASTX2_CONST.OPTION_E2EFORM_ONLY) {\n if (null == c) e = !1;\n else\n for (var e = !1, f = c.getElementsByTagName('input'), g = 0; g < f.length; g++) {\n var h = f[g];\n if (null != h && ((h = h.getAttribute('e2e_type')), null != h && 0 < h)) {\n e = !0;\n break;\n }\n }\n 0 == e && (d = !0);\n }\n if (1 != d) {\n if ((d = $_astxu.getCreatedFormValue(c, l($ASTX2_CONST.E2EFORM_INIT, $ASTX2_CONST.E2EFORM_TAG1))))\n d.value = F;\n if ((d = $_astxu.getCreatedFormValue(c, l($ASTX2_CONST.E2EFORM_INIT, $ASTX2_CONST.E2EFORM_TAG2))))\n d.value = G;\n }\n }\n }\n }\n function V(a) {\n var b = 0;\n k & $ASTX2_CONST.OPTION_E2EFORM_NOENC && (b = 1);\n a = {\n ver: $_astxu.getint(a.ver),\n alg: $_astxu.getint(a.alg),\n svr: $_astxu.getnc(a.svr),\n norsa: $_astxu.getint(a.norsa),\n uniq: $_astxu.getnc(a.uniq),\n utime: $_astxu.getint(a.utime),\n ncert: $_astxu.getnc(a.ncert),\n pageid: $ASTX2_CONST.PAGEID,\n noenc: b\n };\n $_astxu.sendJsonp({\n url: $ASTX2_COMM.mLocalServerURL + '/e2e_forminit',\n data: a,\n onSuccess: function (a) {\n var b = $_astxu.getnc(a ? a.result : '');\n 0 == $_astxu.isACK(b)\n ? $_astxu.msg('[e2e_forminit] result=' + b)\n : ((D = !0), (F = $_astxu.getnc(a.e2e_form1)), (G = $_astxu.getnc(a.e2e_form2)), C());\n },\n onFailure: function () {\n $_astxu.msg('[e2e_forminit] failure.');\n }\n });\n }\n function W() {\n $_astxu.sendAuthAjax({\n url: $ASTX2_CUST.getURL($ASTX2_CUST.URL_GET_CERT),\n onSuccess: function (a) {\n var b = $_astxu.jsonParse(a);\n a = $_astxu.getnc(b ? b.result : '');\n 0 == $_astxu.isACK(a)\n ? $_astxu.msg('[_init_e2eform] result=' + a)\n : $ASTX2.set_cert(\n function () {\n V(b);\n },\n function () {\n $_astxu.msg('[_init_e2eform] set_cert() failure');\n },\n b\n );\n },\n onFailure: function (a) {\n $_astxu.msg('[_init_e2eform] failure');\n }\n });\n }\n function H(a) {\n var b = $_astxu.getHostPath() + $_astxu.getnc(window.location.pathname),\n c = 0;\n k & $ASTX2_CONST.OPTION_NOSPTDUMMY && (c = 1);\n q(\n 'e2e_start',\n { browser: $ASTX2_CONST.BROWSER_VER, ver: a.ver, svr: a.svr, valg: a.valg, url: b, custcode: w, nospt: c },\n 5e3,\n function (a) {\n var b = $_astxu.getnc(a ? a.result : '');\n if ($_astxu.isACK(b)) {\n n = 1;\n I = $_astxu.getint(a.call_settext);\n t = $_astxu.getint(a.call_gettext);\n J = $_astxu.getint(a.vm_env);\n K = $_astxu.getint(a.ak_drv);\n try {\n var c = document.activeElement;\n c && x(c, !1);\n } catch (aa) {}\n k & $ASTX2_CONST.OPTION_E2EFORM &&\n (3 > $_astxu.getint(a.stsvr) ? $ASTX2_COMM.errorAbort($ASTX2_CONST.ERROR_NEEDUPDATE) : W());\n if (k & $ASTX2_CONST.OPTION_AUTOSETTEXT)\n for (var d in u) (a = u[d]), null != a && (0 >= $_astxu.getnc(a.value).length || y(a));\n } else n = 2;\n },\n function () {\n n = 2;\n }\n );\n }\n function L(a) {\n if (0 == $_astxu.hasFocused()) return !1;\n if (0 == n) return !0;\n if (1 == n) {\n if (!1 === a) return;\n try {\n var b = document.activeElement;\n b && x(b, !1);\n } catch (c) {}\n return !0;\n }\n n = 0;\n k & $ASTX2_CONST.OPTION_NONE2E\n ? ((a = 0),\n k & $ASTX2_CONST.OPTION_NONE2E_ALG && (a = $ASTX2.mOptionStrings.none2e_alg),\n H({ ver: 1, svr: '_none2e', valg: a }))\n : $_astxu.sendAuthAjax({\n url: $ASTX2_CUST.getURL($ASTX2_CUST.URL_GET_INIT),\n onSuccess: function (a) {\n a = $_astxu.jsonParse(a);\n var b = $_astxu.getnc(a ? a.result : '');\n $_astxu.isACK(b) ? H(a) : (n = -1);\n },\n onFailure: function (a) {\n n = -1;\n }\n });\n return !0;\n }\n function r(a) {\n if (null != a && (a.getAttribute('e2e_type') != $ASTX2_CONST.E2ETYPE_PLAIN1 || 0 != t)) {\n try {\n if (a != document.activeElement) return;\n } catch (b) {}\n 'number' == typeof a.selectionStart\n ? (a.selectionStart = a.selectionEnd = a.value.length)\n : 'undefined' != typeof a.createTextRange && ((a = a.createTextRange()), a.collapse(!1), a.select());\n }\n }\n function x(a, b) {\n v = !1;\n if (k & $ASTX2_CONST.OPTION_FIXEDTYPE && a) {\n var c = a.getAttribute('e2e_inputid');\n null != c && 0 < c && z[c] != a.type && (a.type = z[c]);\n }\n c = f(a);\n null != c &&\n (!0 === b && L(!1),\n h(\n 'e2e_focus',\n c,\n null,\n function (b) {\n g(a, !1);\n window.setTimeout(function () {\n r(a);\n }, 1);\n },\n function () {}\n ));\n }\n function M(a) {\n var c = b(a);\n if (null != c) {\n if ('function' === typeof $ASTX2_CUST.onHandlerPreFocus) $ASTX2_CUST.onHandlerPreFocus(c, a);\n x(c, !0);\n }\n }\n function N(a) {\n a = b(a);\n if (null != a) {\n var c = e(a);\n if (null != c) {\n try {\n if (document.hasFocus() && a === document.activeElement) return;\n } catch (f) {}\n g(a, !0);\n h('e2e_blur', c);\n }\n }\n }\n function O(a) {\n var c = b(a);\n null != c &&\n window.setTimeout(function () {\n r(c);\n }, 1);\n }\n function y(a, b) {\n var c = f(a);\n if (null != c) {\n var d = $_astxu.getnc(a.value);\n c.text = d;\n k & $ASTX2_CONST.OPTION_E2EFORM && (c.e2eform = 1);\n k & $ASTX2_CONST.OPTION_E2EFORM_NOENC && (c.noenc = 1);\n h(\n 'e2e_settext',\n c,\n null,\n function (d) {\n var e = $_astxu.getnc(d ? d.result : '');\n if (0 == $_astxu.isACK(e)) b && b($ASTX2_CONST.ERROR_NCK);\n else {\n if (k & $ASTX2_CONST.OPTION_E2EFORM) {\n var e = m(a, c.e2e_type),\n f = !1;\n k & $ASTX2_CONST.OPTION_E2EFORM_ALLTRIP && (f = !0);\n if ((e = $_astxu.getCreatedFormValue(a.form, e, f))) e.value = $_astxu.getnc(d.e2e_data);\n }\n b && b($ASTX2_CONST.ERROR_SUCCESS);\n }\n },\n function () {\n b && b($ASTX2_CONST.ERROR_FAILED);\n }\n );\n }\n }\n function A(a) {\n 'function' === typeof a.stopPropagation && a.stopPropagation();\n 'function' === typeof a.preventDefault ? a.preventDefault() : (a.returnValue = !1);\n }\n function X(a, b, c) {\n h(\n 'e2e_gettext',\n b,\n null,\n function (b) {\n var d = $_astxu.getnc(b ? b.result : '');\n $_astxu.isACK(d)\n ? ((b = $_astxu.getnc(b.text)), (a.value = b), c && c($ASTX2_CONST.ERROR_SUCCESS))\n : c && c($ASTX2_CONST.ERROR_NCK);\n },\n function () {\n c && c($ASTX2_CONST.ERROR_FAILED);\n }\n );\n }\n function Y(a, b) {\n k & $ASTX2_CONST.OPTION_E2EFORM_NOENC && (b.noenc = 1);\n h(\n 'e2e_formget',\n b,\n null,\n function (c) {\n var d = $_astxu.getnc(c ? c.result : '');\n if (0 == $_astxu.isACK(d)) $_astxu.msg('[e2e_formget] ' + b.name + ',result=' + d);\n else if (((d = a.form), null != d)) {\n var e = m(a, b.e2e_type),\n f = !1;\n k & $ASTX2_CONST.OPTION_E2EFORM_ALLTRIP && (f = !0);\n if ((d = $_astxu.getCreatedFormValue(d, e, f))) d.value = $_astxu.getnc(c.e2e_data);\n }\n },\n function () {}\n );\n }\n function P(a) {\n var c = b(a);\n if (null != c) {\n var e = f(c);\n if (null != e) {\n r(c);\n var p = $_astxu.getKeyCode(a);\n 17 == p && (v = !0);\n if (1 == v)\n return (\n 86 == p &&\n h(\n 'e2e_clear',\n e,\n null,\n function (a) {\n c.value = '';\n },\n function () {}\n ),\n A(a),\n !1\n );\n if (1 == (16 == p || 17 == p || 18 == p ? !0 : !1)) return !0;\n var g = !0;\n k & $ASTX2_CONST.OPTION_E2EFORM &&\n ((e.e2e_type != $ASTX2_CONST.E2ETYPE_CERT1 && e.e2e_type != $ASTX2_CONST.E2ETYPE_CERT2) || Y(c, e));\n 'function' === typeof $ASTX2_CUST.onHandlerKeyDown &&\n 0 == $ASTX2_CUST.onHandlerKeyDown(c, a) &&\n (A(a), (g = !1));\n 1 != t ||\n ('password' == c.type && e.e2e_type != $ASTX2_CONST.E2ETYPE_PLAIN1) ||\n 0 != J ||\n (1 == g &&\n X(c, e, function () {\n 'password' != c.type &&\n 'dynamic' == c.getAttribute('e2e_txtmsk') &&\n (c.value = c.value.replace(/[^*]/g, '*').substring(0, c.value.length - 1) + c.value.slice(-1));\n }),\n 0 == (8 == p || 9 == p || 13 == p || 20 == p ? !0 : !1) && (A(a), (g = !1)));\n return g;\n }\n }\n }\n function Q(a) {\n var c = b(a);\n null != c &&\n (17 == $_astxu.getKeyCode(a) && (v = !1),\n 1 == I\n ? y(c)\n : 0 == t &&\n 'password' != c.type &&\n 'dynamic' == c.getAttribute('e2e_txtmsk') &&\n (c.value = c.value.replace(/[^*]/g, '*').substring(0, c.value.length - 1) + c.value.slice(-1)),\n window.setTimeout(function () {\n r(c);\n }, 1));\n }\n function R(a) {\n var c = b(a);\n null != c &&\n window.setTimeout(function () {\n r(c);\n }, 1);\n }\n function S(a) {\n if ('IE' == $ASTX2_CONST.BROWSER_TYPE || 'EG' == $ASTX2_CONST.BROWSER_TYPE) {\n var c = b(a);\n null != c &&\n '' != c.value &&\n setTimeout(function () {\n if ('' == c.value) {\n var a = e(c);\n null != a && h('e2e_clear', a);\n }\n }, 1);\n }\n }\n function T(a) {\n var c = b(a);\n null != c &&\n ('number' == typeof c.selectionStart\n ? (c.selectionStart < c.value.length || c.selectionEnd < c.value.length) &&\n window.setTimeout(function () {\n r(c);\n }, 1)\n : 'undefined' != typeof c.createTextRange &&\n document.selection &&\n ((a = document.selection.createRange()),\n a.moveStart('character', -c.value.length),\n a.text.length <= c.value.length &&\n window.setTimeout(function () {\n r(c);\n }, 1)));\n }\n function Z(a) {}\n function U(a) {\n h('e2e_unload');\n }\n var k = 0,\n E = [],\n $ = 0,\n B = !1,\n w = 0,\n n = -1,\n I = 0,\n t = 0,\n J = 0,\n K = 1,\n v = !1,\n u = [],\n z = [],\n D = !1,\n F = '',\n G = '';\n this.setOption = function (a) {\n k |= a;\n };\n this.setOptionStrings = function (a) {\n E = a;\n };\n this.attach = function (a, b) {\n null != a && (w = a);\n k & $ASTX2_CONST.OPTION_AUTOSETTEXT && (u = []);\n k & $ASTX2_CONST.OPTION_E2EFORM && C();\n for (var c = document.getElementsByTagName('input'), d = 0; d < c.length; d++) {\n var e = c[d];\n null != e && this.addObject(e);\n }\n q(\n 'e2e_init',\n null,\n null,\n function (a) {\n L();\n $_astxu.addEvent(window, 'blur', Z);\n $_astxu.addEvent(window, 'unload', U);\n $_astxu.addEvent(window, 'beforeunload', U);\n b && b(!0);\n },\n function () {\n b && b(!1);\n }\n );\n B = !0;\n };\n this.addObject = function (a) {\n if (null != a) {\n var b = a.getAttribute('e2e_inputid');\n if (!(null != b && 0 < b)) {\n var c = a.getAttribute('e2e_type');\n if (null == c || 0 >= c)\n if (((c = a.getAttribute('e2e')), 'true' == c || 'on' == c))\n (c = $ASTX2_CONST.E2ETYPE_CERT1), a.setAttribute('e2e_type', c);\n else {\n c = $ASTX2_CONST.E2ETYPE_NONE;\n try {\n if (\n ('function' === typeof $ASTX2_CUST.isE2EObject &&\n 1 == $ASTX2_CUST.isE2EObject(a) &&\n ((c = $ASTX2_CONST.E2ETYPE_CERT1), a.setAttribute('e2e_type', c)),\n 'function' === typeof $ASTX2_CUST.getE2Etype)\n ) {\n var d = $ASTX2_CUST.getE2Etype(a);\n d && ((c = d), a.setAttribute('e2e_type', c));\n }\n } catch (e) {}\n if (c == $ASTX2_CONST.E2ETYPE_NONE) return;\n }\n b = ++$;\n a.setAttribute('e2e_inputid', b);\n d = !0;\n k & $ASTX2_CONST.OPTION_AUTOSETTEXT && 0 < a.value.length && ((d = !1), u.push(a));\n 1 == d && (a.value = '');\n a.setAttribute('autocomplete', 'off');\n g(a, !0);\n z[b] = a.type;\n $_astxu.addEvent(a, 'focus', M);\n $_astxu.addEvent(a, 'blur', N);\n $_astxu.addEvent(a, 'click', O);\n $_astxu.addEvent(a, 'keyup', Q);\n $_astxu.addEvent(a, 'keydown', P);\n $_astxu.addEvent(a, 'select', T);\n $_astxu.addEvent(a, 'mouseup', S);\n $_astxu.addEvent(a, 'mousedown', R);\n k & $ASTX2_CONST.OPTION_E2EFORM &&\n (c == $ASTX2_CONST.E2ETYPE_CERT1 || c == $ASTX2_CONST.E2ETYPE_CERT2) &&\n ((b = a.form),\n null != b &&\n ((a = m(a, c)),\n (c = !1),\n k & $ASTX2_CONST.OPTION_E2EFORM_ALLTRIP && (c = !0),\n $_astxu.getCreatedFormValue(b, a, c)));\n }\n }\n };\n this.subObject = function (a) {\n var b = e(a);\n if (null != b) {\n $_astxu.removeEvent(a, 'focus', M);\n $_astxu.removeEvent(a, 'blur', N);\n $_astxu.removeEvent(a, 'click', O);\n $_astxu.removeEvent(a, 'keyup', Q);\n $_astxu.removeEvent(a, 'keydown', P);\n $_astxu.removeEvent(a, 'select', T);\n $_astxu.removeEvent(a, 'mouseup', S);\n $_astxu.removeEvent(a, 'mousedown', R);\n try {\n a == document.activeElement && h('e2e_blur', b);\n } catch (c) {}\n a.value = '';\n a.setAttribute('e2e_inputid', -1);\n a.setAttribute('e2e_type', -1);\n g(a, !1);\n }\n };\n this.getE2EHash = function (a, b) {\n var c = e(a);\n null == c\n ? b(null, $ASTX2_CONST.ERROR_PARAM)\n : h(\n 'e2e_gethash',\n c,\n null,\n function (a) {\n var c = $_astxu.getnc(a ? a.result : '');\n $_astxu.isACK(c)\n ? b($_astxu.getnc(a.hash), $ASTX2_CONST.ERROR_SUCCESS)\n : b(null, $ASTX2_CONST.ERROR_NCK);\n },\n function () {\n b(null, $ASTX2_CONST.ERROR_FAILED);\n }\n );\n };\n this.getEncText = function (a, b, c) {\n var d = e(a);\n d.customcode = w;\n d.random = b;\n null == d\n ? c(null, null, $ASTX2_CONST.ERROR_PARAM)\n : h(\n 'sdk_getenctext',\n d,\n null,\n function (a) {\n var b = $_astxu.getnc(a ? a.result : '');\n $_astxu.isACK(b)\n ? c(d.name, $_astxu.getnc(a.getenctext), $ASTX2_CONST.ERROR_SUCCESS)\n : c(null, null, $ASTX2_CONST.ERROR_NCK);\n },\n function () {\n c(null, null, $ASTX2_CONST.ERROR_FAILED);\n }\n );\n };\n this.getE2EText = function (a, b) {\n var c = e(a);\n null == c\n ? b(null, null, $ASTX2_CONST.ERROR_PARAM)\n : c.e2e_type != $ASTX2_CONST.E2ETYPE_PLAIN2 && c.e2e_type != $ASTX2_CONST.E2ETYPE_WIZVERA\n ? b(null, null, $ASTX2_CONST.ERROR_PARAM)\n : h(\n 'e2e_gettext',\n c,\n null,\n function (a) {\n var d = $_astxu.getnc(a ? a.result : '');\n $_astxu.isACK(d)\n ? b(c.name, $_astxu.getnc(a.text), $ASTX2_CONST.ERROR_SUCCESS)\n : b(null, null, $ASTX2_CONST.ERROR_NCK);\n },\n function () {\n b(null, null, $ASTX2_CONST.ERROR_FAILED);\n }\n );\n };\n this.setE2EText = function (a, b) {\n y(a, b);\n };\n this.clearE2EText = function (a, b) {\n var c = e(a);\n null != c &&\n h(\n 'e2e_clear',\n c,\n null,\n function (d) {\n d = $_astxu.getnc(d ? d.result : '');\n if (0 == $_astxu.isACK(d)) b && b($ASTX2_CONST.ERROR_NCK);\n else {\n a.value = '';\n if (k & $ASTX2_CONST.OPTION_E2EFORM) {\n d = m(a, c.e2e_type);\n var e = !1;\n k & $ASTX2_CONST.OPTION_E2EFORM_ALLTRIP && (e = !0);\n if ((d = $_astxu.getCreatedFormValue(a.form, d, e))) d.value = '';\n }\n b && b($ASTX2_CONST.ERROR_SUCCESS);\n }\n },\n function () {\n b && b($ASTX2_CONST.ERROR_FAILED);\n }\n );\n };\n this.dettach = function () {\n h('e2e_uninit');\n B = !1;\n };\n this.isAttached = function () {\n return B;\n };\n this.isStarted = function () {\n return 1 == n ? !0 : !1;\n };\n this.checkService = function (a) {\n var b = {};\n b.service = $ASTX2_CONST.SERVICE_AK;\n b.result = $ASTX2_CONST.ERROR_SUCCESS;\n if (0 >= n) {\n var c = this;\n window.setTimeout(function () {\n c.checkService(a);\n }, 300);\n } else\n 1 == n && 0 == K\n ? (b.result = $ASTX2_CONST.ERROR_FAILED)\n : 2 == n && (b.result = $ASTX2_CONST.ERROR_FAILED),\n a(b);\n };\n this.getE2EelmsForm = function (a, b, c, d) {\n for (var f = document.getElementsByTagName('input'), g = 0; g < f.length; g++) {\n var h = f[g];\n if (null != h && ((h = e(h)), null != h && h.e2e_type == d)) {\n var k = !1;\n null == a ? (k = !0) : $_astxu.getnc(a.name) == h.form && (k = !0);\n 0 != k && (b.push(h.e2e_inputid), c.push(h.name));\n }\n }\n };\n this.getE2EelmsID = function (a, b, c, d) {\n for (var f = document.getElementsByTagName('input'), g = 0; g < f.length; g++) {\n var h = f[g];\n if (null != h) {\n var k = e(h);\n if (null != k && k.e2e_type == d) {\n for (var l = !1, h = $_astxu.getnc(h.id).toLowerCase(), m = 0; m < a.length; m++)\n if (a[m].toLowerCase() == h) {\n l = !0;\n break;\n }\n 0 != l && (b.push(k.e2e_inputid), c.push(k.name));\n }\n }\n }\n };\n this.resetE2Evalues = function (a, b) {\n for (var c = document.getElementsByTagName('input'), d = 0; d < c.length; d++) {\n var f = c[d];\n if (null != f) {\n var g = e(f);\n null != g &&\n g.form == a &&\n g.e2e_type != $ASTX2_CONST.E2ETYPE_PLAIN1 &&\n g.e2e_type != $ASTX2_CONST.E2ETYPE_PLAIN2 &&\n (f.value = b);\n }\n }\n };\n this.getE2Eattribute = function (a) {\n return e(a);\n };\n };\n return {\n getInstance: function (c) {\n null === a && (a = new b(c));\n return a;\n }\n };\n })(),\n $ASTX2 = {\n mUseJQuery: !0,\n mUseAjaxHello: !1,\n mUseAutoStart: !0,\n mOption: 0,\n mOptionStrings: [],\n mE2EInst: null,\n mLastError: $ASTX2_CONST.ERROR_SUCCESS,\n send_e2e_cmd: function (a, b, c, d, e, f) {\n if ('object' == typeof $ASTX2_COMM && 0 != $ASTX2_COMM.isEnable()) {\n var g = this;\n null == f && (f = 1);\n var h = !1;\n if ('e2e_focus' == a || 'e2e_blur' == a || 'e2e_gettext' == a || 'e2e_settext' == a) h = !0;\n $_astxu.sendJsonp({\n url: $ASTX2_COMM.mLocalServerURL + '/' + a,\n data: b,\n timeout: c || 5e3,\n async: !1,\n seq: h,\n onSuccess: function (a) {\n d && d(a);\n },\n onFailure: function () {\n 3 > f ? g.send_e2e_cmd(a, b, c, d, e, f + 1) : e && e();\n }\n });\n }\n },\n _send_alive: function () {\n var a = { pageid: $ASTX2_CONST.PAGEID, focus: $_astxu.hasFocused() ? 1 : 0 };\n $_astxu.sendJsonp({ url: $ASTX2_COMM.mLocalServerURL + '/alive', data: a });\n },\n send_alive_run: function () {\n if (!($ASTX2_COMM.getDegugFlags() & $ASTX2_CONST.DEBUG_NOALIVE)) {\n var a = this;\n setInterval(function () {\n a._send_alive();\n }, $ASTX2_CONST.INTERVAL_ALIVE);\n }\n },\n _hello_local_server: function (a, b, c, d, e) {\n var f = this;\n if (d >= c.length)\n f.setLastError($ASTX2_CONST.ERROR_NOTINST),\n 1 == $_astxu.isWinOS() &&\n 1 == f.mUseAutoStart &&\n ((f.mUseAutoStart = !1),\n 'IE' != $ASTX2_CONST.BROWSER_TYPE &&\n 'EG' != $ASTX2_CONST.BROWSER_TYPE &&\n (window.location.href = 'astx://start')),\n b();\n else {\n var g = e[d],\n h = c[d],\n q = 'https://' + (1 == $_astxu.isMacOS() ? 'lx.astxsvc.com' : '127.0.0.1') + ':' + h + '/ASTX2',\n h = '',\n l = document.getElementsByTagName('script');\n if (l) for (var m = 0; m < l.length; m++) l[m].src && 0 <= l[m].src.indexOf('astx2.min.js') && (h = l[m].src);\n l = '$Revision: 32070 $';\n l = l.substr(11, l.length - 13);\n m = !1;\n 0 == $ASTX2.mUseAjaxHello && 1 == d % 2 && (m = !0);\n 'IE' == $ASTX2_CONST.BROWSER_TYPE &&\n 'IE10' != $ASTX2_CONST.BROWSER_VER &&\n 'IE11' != $ASTX2_CONST.BROWSER_VER &&\n ((m = !0), 2e3 < g && (g = 2e3));\n d++;\n 1 == m\n ? $_astxu.sendJsonp({\n url: q + '/hello',\n data: { url: h, version: l },\n timeout: g,\n onSuccess: function (c) {\n var d = $_astxu.getnc(c ? c.result : '');\n c = $_astxu.getnc(c ? c.client_public_key : '');\n $_astxu.isACK(d)\n ? (($ASTX2_COMM.mLocalServerURL = q), ($ASTX2_COMM.mClientPublicKey = c), a())\n : (f.setLastError($ASTX2_CONST.ERROR_NOTINST), b());\n },\n onFailure: function () {\n f._hello_local_server(a, b, c, d, e);\n }\n })\n : $_astxu.sendAjax({\n url: q + '/hello?',\n type: 'POST',\n data: { url: h, version: l },\n timeout: g,\n onSuccess: function (c) {\n var d = $_astxu.jsonParse(c);\n c = $_astxu.getnc(d ? d.result : '');\n d = $_astxu.getnc(d ? d.client_public_key : '');\n $_astxu.isACK(c)\n ? (($ASTX2_COMM.mLocalServerURL = q), ($ASTX2_COMM.mClientPublicKey = d), a())\n : (f.setLastError($ASTX2_CONST.ERROR_NOTINST), b());\n },\n onFailure: function () {\n f._hello_local_server(a, b, c, d, e);\n }\n });\n }\n },\n setOption: function (a) {\n if (null != a) {\n !0 === a.autofocus && (this.mOption |= $ASTX2_CONST.OPTION_AUTOFOCUS);\n !0 === a.e2eform && (this.mOption |= $ASTX2_CONST.OPTION_E2EFORM);\n !1 === a.e2eform_enc && (this.mOption |= $ASTX2_CONST.OPTION_E2EFORM_NOENC);\n !0 === a.e2eform_alltrip && (this.mOption |= $ASTX2_CONST.OPTION_E2EFORM_ALLTRIP);\n !0 === a.e2eform_only && (this.mOption |= $ASTX2_CONST.OPTION_E2EFORM_ONLY);\n !0 === a.autosettext && (this.mOption |= $ASTX2_CONST.OPTION_AUTOSETTEXT);\n !0 === a.nospt && (this.mOption |= $ASTX2_CONST.OPTION_NOSPTDUMMY);\n !0 === a.fixedtype && (this.mOption |= $ASTX2_CONST.OPTION_FIXEDTYPE);\n var b = $_astxu.getnc(a.e2eform_tagset);\n 0 < b.length &&\n ((this.mOption |= $ASTX2_CONST.OPTION_E2EFORM_TAGSET), (this.mOptionStrings.e2eform_tagset = b));\n b = $_astxu.getint(a.none2e_alg);\n 0 < b && ((this.mOption |= $ASTX2_CONST.OPTION_NONE2E_ALG), (this.mOptionStrings.none2e_alg = b));\n }\n },\n _get_custom_value: function () {\n 'undefined' !== typeof $ASTX2_CUST.mUseJQuery && ($ASTX2.mUseJQuery = $ASTX2_CUST.mUseJQuery);\n 'undefined' !== typeof $ASTX2_CUST.mUseAjaxHello && ($ASTX2.mUseAjaxHello = $ASTX2_CUST.mUseAjaxHello);\n 'undefined' !== typeof $ASTX2_CUST.mUseAutoStart &&\n ($ASTX2.mUseAutoStart = 1 == $ASTX2.mUseAutoStart ? $ASTX2_CUST.mUseAutoStart : !1);\n 'undefined' !== typeof $ASTX2_CUST.E2EFORM_TAIL && ($ASTX2_CONST.E2EFORM_TAIL = $ASTX2_CUST.E2EFORM_TAIL);\n 'undefined' !== typeof $ASTX2_CUST.E2EFORM_INIT && ($ASTX2_CONST.E2EFORM_INIT = $ASTX2_CUST.E2EFORM_INIT);\n 'undefined' !== typeof $ASTX2_CUST.E2EFORM_TAG1 && ($ASTX2_CONST.E2EFORM_TAG1 = $ASTX2_CUST.E2EFORM_TAG1);\n 'undefined' !== typeof $ASTX2_CUST.E2EFORM_TAG2 && ($ASTX2_CONST.E2EFORM_TAG2 = $ASTX2_CUST.E2EFORM_TAG2);\n 'undefined' !== typeof $ASTX2_CUST.E2EFORM_TAG1_PWD &&\n ($ASTX2_CONST.E2EFORM_TAG1_PWD = $ASTX2_CUST.E2EFORM_TAG1_PWD);\n 'undefined' !== typeof $ASTX2_CUST.E2EFORM_TAG2_PWD &&\n ($ASTX2_CONST.E2EFORM_TAG2_PWD = $ASTX2_CUST.E2EFORM_TAG2_PWD);\n },\n init: function (a, b, c, d) {\n function e() {\n a();\n if (1 == $_astxu.isMacLinuxOS()) {\n f.send_alive_run();\n try {\n $ASTX2_MLi.init();\n } catch (b) {}\n }\n }\n this.setLastError($ASTX2_CONST.ERROR_SUCCESS);\n if (1 == $ASTX2_COMM.isEnable()) a();\n else {\n this._get_custom_value();\n null != d && ($ASTX2.mUseAutoStart = 1 == d ? $ASTX2.mUseAutoStart : !1);\n 1 == $ASTX2.mUseJQuery && 'undefined' === typeof jQuery && ($ASTX2.mUseJQuery = !1);\n var f = this;\n this.mE2EInst = $ASTX2_E2E.getInstance(this);\n this.mE2EInst.setOption(this.mOption);\n this.mE2EInst.setOptionStrings(this.mOptionStrings);\n var g = [],\n h = [];\n null != c\n ? ((g = [55920, 55920, 55921, 55922]), (h = [c, c, c, c]))\n : ((g = [55920, 55920, 55921, 55922]), (h = [1e4, 1500, 750, 250]));\n setTimeout(function () {\n f._hello_local_server(e, b, g, 0, h);\n }, 200);\n }\n },\n _check_local_server_chk_stamp: function (a, b, c, d) {\n var e = this;\n $_astxu.sendAuthAjax({\n url: $ASTX2_CUST.getURL($ASTX2_CUST.URL_CHK_STAMP),\n data: d,\n onSuccess: function (c) {\n c = $_astxu.jsonParse(c);\n c = $_astxu.getnc(c ? c.result : '');\n $_astxu.isACK(c) ? a() : (e.setLastError($ASTX2_CONST.ERROR_NCK), b());\n },\n onFailure: function (a) {\n b();\n }\n });\n },\n _check_local_server: function (a, b, c, d) {\n var e = this;\n null == d && (d = 1);\n 3 < d\n ? (e.setLastError($ASTX2_CONST.ERROR_NOCONNECT), b())\n : $_astxu.sendJsonp({\n url: $ASTX2_COMM.mLocalServerURL + '/check',\n data: { method: c, url: $ASTX2_CUST.getURL($ASTX2_CUST.URL_GET_STAMP), rnd: $_astxu.rnd() },\n onSuccess: function (f) {\n var g = $_astxu.getnc(f ? f.result : '');\n $_astxu.isACK(g)\n ? ((f.rnd = $_astxu.rnd()), e._check_local_server_chk_stamp(a, b, c, f))\n : e._check_local_server(a, b, c, d + 1);\n },\n onFailure: function () {\n e.setLastError($ASTX2_CONST.ERROR_FAILED);\n e._check_local_server(a, b, c, d + 1);\n }\n });\n },\n checkServer: function (a, b, c) {\n this.setLastError($ASTX2_CONST.ERROR_SUCCESS);\n 0 == $ASTX2_COMM.isEnable()\n ? (this.setLastError($ASTX2_CONST.ERROR_NOINIT), b())\n : (0 == $_astxu.isWinOS() ? (c = 1) : null == c && (c = 1), this._check_local_server(a, b, c));\n },\n _e2e_enable: function () {\n return 0 == $_astxu.isWinOS()\n ? (this.setLastError($ASTX2_CONST.ERROR_NOTSUPPORTED), !1)\n : 0 == $ASTX2_COMM.isEnable()\n ? (this.setLastError($ASTX2_CONST.ERROR_NOINIT), !1)\n : !0;\n },\n resetE2E: function (a, b) {\n this.setLastError($ASTX2_CONST.ERROR_SUCCESS);\n if (0 == this._e2e_enable()) return !1;\n var c = this;\n window.setTimeout(function () {\n c.mE2EInst.attach(a, b);\n }, 100);\n return !0;\n },\n initE2E: function (a, b) {\n this.mOption & $ASTX2_CONST.OPTION_AUTOFOCUS && $_astxu.setInputFocus();\n return this.resetE2E(a, b);\n },\n resetNonE2E: function (a, b) {\n return this.initNonE2E(a, b);\n },\n initNonE2E: function (a, b) {\n this.mE2EInst.setOption($ASTX2_CONST.OPTION_NONE2E);\n this.mOption & $ASTX2_CONST.OPTION_AUTOFOCUS && $_astxu.setInputFocus();\n return this.resetE2E(a, b);\n },\n uninitE2E: function () {\n 1 == $_astxu.isWinOS() && 1 == $ASTX2_COMM.isEnable() && this.mE2EInst.dettach();\n },\n uninitNonE2E: function () {\n this.uninitE2E();\n },\n set_cert: function (a, b, c, d) {\n null == d && (d = 1);\n var e = new String($_astxu.getnc(c['cert' + d]));\n if (0 == e.length) 0 < d ? a() : b();\n else {\n var f = this;\n $_astxu.sendJsonp({\n url: $ASTX2_COMM.mLocalServerURL + '/set_cert',\n data: { step: d, cert: e, pageid: $ASTX2_CONST.PAGEID },\n onSuccess: function (e) {\n setTimeout(function () {\n f.set_cert(a, b, c, d + 1);\n }, 250);\n },\n onFailure: function () {\n b();\n }\n });\n }\n },\n _e2edata_get: function (a, b, c, d) {\n var e = this;\n a = {\n ver: $_astxu.getint(d.ver),\n alg: $_astxu.getint(d.alg),\n svr: $_astxu.getnc(d.svr),\n norsa: $_astxu.getint(d.norsa),\n uniq: $_astxu.getnc(d.uniq),\n utime: $_astxu.getint(d.utime),\n ncert: $_astxu.getnc(d.ncert),\n pageid: $ASTX2_CONST.PAGEID,\n ids1: a.ids1,\n names1: a.names1,\n ids2: a.ids2,\n names2: a.names2\n };\n $_astxu.sendJsonp({\n url: $ASTX2_COMM.mLocalServerURL + '/get_data',\n data: a,\n timeout: 1e4,\n onSuccess: function (a) {\n var d = $_astxu.getnc(a ? a.result : '');\n $_astxu.isACK(d) ? b(a) : (e.setLastError($ASTX2_CONST.ERROR_NCK), c());\n },\n onFailure: function () {\n e.setLastError($ASTX2_CONST.ERROR_FAILED);\n c();\n }\n });\n },\n _e2edata: function (a, b, c) {\n var d = this;\n $_astxu.sendAuthAjax({\n url: $ASTX2_CUST.getURL($ASTX2_CUST.URL_GET_CERT),\n onSuccess: function (e) {\n var f = $_astxu.jsonParse(e);\n e = $_astxu.getnc(f ? f.result : '');\n 0 == $_astxu.isACK(e)\n ? (d.setLastError($ASTX2_CONST.ERROR_NCK), c())\n : d.set_cert(\n function () {\n d._e2edata_get(a, b, c, f);\n },\n function () {\n d.setLastError($ASTX2_CONST.ERROR_NOCONNECT);\n c();\n },\n f\n );\n },\n onFailure: function (a) {\n d.setLastError($ASTX2_CONST.ERROR_FAILED);\n c();\n }\n });\n },\n getE2EData: function (a, b, c) {\n this.setLastError($ASTX2_CONST.ERROR_SUCCESS);\n if (0 == this._e2e_enable()) c();\n else {\n var d = [],\n e = [],\n f = [],\n g = [];\n this.mE2EInst.getE2EelmsForm(a, d, e, 1);\n this.mE2EInst.getE2EelmsForm(a, f, g, 2);\n a = { ids1: d.join(','), names1: e.join(','), ids2: f.join(','), names2: g.join(',') };\n this._e2edata(a, b, c);\n }\n },\n getE2EDataRetry: function (a, b, c, d, e) {\n null == d && (d = 3);\n null == e && (e = 1e3);\n if (0 >= d) this.setLastError($ASTX2_CONST.ERROR_EXCESS), c();\n else {\n var f = this;\n this.getE2EData(\n a,\n function (a) {\n b(a);\n },\n function () {\n f.getLastError() == $ASTX2_CONST.ERROR_NOINIT\n ? window.setTimeout(function () {\n f.getE2EDataRetry(a, b, c, d - 1, e);\n }, e)\n : c();\n }\n );\n }\n },\n getE2EDataIDs: function (a, b, c) {\n this.setLastError($ASTX2_CONST.ERROR_SUCCESS);\n if (0 == this._e2e_enable()) c();\n else {\n null == a && (that.setLastError($ASTX2_CONST.ERROR_PARAM), c());\n var d = [],\n e = [],\n f = [],\n g = [];\n this.mE2EInst.getE2EelmsID(a, d, e, 1);\n this.mE2EInst.getE2EelmsID(a, f, g, 2);\n a = { ids1: d.join(','), names1: e.join(','), ids2: f.join(','), names2: g.join(',') };\n this._e2edata(a, b, c);\n }\n },\n setE2EData: function (a, b, c, d) {\n null == c && (c = !0);\n null == d && (d = '');\n var e = $_astxu.getnc(b.e2e_data1);\n 0 < e.length && ($_astxu.getCreatedFormValue(a, 'e2e_data1').value = e);\n b = $_astxu.getnc(b.e2e_data2);\n 0 < b.length && ($_astxu.getCreatedFormValue(a, 'e2e_data2').value = b);\n 1 == c && this.mE2EInst.resetE2Evalues($_astxu.getnc(a.name), d);\n },\n getE2EPageID: function () {\n return $ASTX2_CONST.PAGEID;\n },\n getE2EInputID: function (a) {\n a = this.mE2EInst.getE2Eattribute(a);\n return null == a ? null : a.e2e_inputid;\n },\n getE2EHash: function (a, b) {\n this.mE2EInst.getE2EHash(a, function (a, d) {\n b(a, d);\n });\n },\n getEncText: function (a, b, c) {\n this.mE2EInst.getEncText(a, b, function (a, b, f) {\n c(b, f);\n });\n },\n getE2EText: function (a, b) {\n this.mE2EInst.getE2EText(a, function (a, d, e) {\n b(d, e);\n });\n },\n getE2ETextS: function (a, b) {\n for (var c = 0, d = 0, e = [], f = 0; f < a.length; f++) {\n var g = a[f];\n null != g && ((g = g.getAttribute('e2e_type')), null != g && g == $ASTX2_CONST.E2ETYPE_PLAIN2 && c++);\n }\n if (0 == c || c != a.length) b(e, $ASTX2_CONST.ERROR_PARAM);\n else\n for (f = 0; f < a.length; f++)\n this.mE2EInst.getE2EText(a[f], function (a, f, g) {\n d >= c || (0 == g ? (e[a] = f) : (d = c), ++d >= c && b(e, g));\n });\n },\n setE2EText: function (a, b) {\n this.mE2EInst.setE2EText(a, b);\n },\n clearE2EText: function (a, b) {\n this.mE2EInst.clearE2EText(a, b);\n },\n clearE2EForm: function (a) {\n for (var b = document.getElementsByTagName('input'), c = 0; c < b.length; c++) {\n var d = b[c];\n null != d &&\n d.form.name == a &&\n 0 != ('text' == d.type || 'password' == d.type) &&\n null != d.getAttribute('e2e_type') &&\n this.mE2EInst.clearE2EText(d);\n }\n },\n addE2EObject: function (a, b) {\n null == b && (b = $ASTX2_CONST.E2ETYPE_CERT1);\n !a || ('text' != a.type && 'password' != a.type) || (a.setAttribute('e2e_type', b), this.mE2EInst.addObject(a));\n },\n subE2EObject: function (a) {\n a && this.mE2EInst.subObject(a);\n },\n setE2EAllExceptInputs: function () {\n for (var a = document.getElementsByTagName('input'), b = 0; b < a.length; b++) {\n var c = a[b];\n null != c &&\n 0 != ('text' == c.type || 'password' == c.type) &&\n null == c.getAttribute('e2e_type') &&\n c.setAttribute('e2e_type', $ASTX2_CONST.E2ETYPE_NONE);\n }\n },\n killFocusE2EAllInputs: function () {\n for (var a = document.getElementsByTagName('input'), b = 0; b < a.length; b++) {\n var c = a[b];\n null != c && 0 != ('text' == c.type || 'password' == c.type) && 0 < c.getAttribute('e2e_type') && c.blur();\n }\n },\n _pclogdata_get: function (a, b, c, d) {\n var e = this;\n c = {\n ver: $_astxu.getint(c.ver),\n alg: $_astxu.getint(c.alg),\n svr: $_astxu.getnc(c.svr),\n norsa: $_astxu.getint(c.norsa),\n uniq: $_astxu.getnc(c.uniq),\n utime: $_astxu.getint(c.utime),\n nlog: $_astxu.getnc(c.nlog),\n ipaddr: $_astxu.getnc(c.ipaddr),\n s2c_alg: $_astxu.getnc(c.s2c_alg),\n s2c_key: $_astxu.getnc(c.s2c_key),\n s2c_salt: $_astxu.getnc(c.s2c_salt),\n browser: $ASTX2_CONST.BROWSER_VER,\n pageid: $ASTX2_CONST.PAGEID,\n opt: d\n };\n $_astxu.sendJsonp({\n url: $ASTX2_COMM.mLocalServerURL + '/get_pclog',\n data: c,\n timeout: 1e4,\n onSuccess: function (c) {\n var d = $_astxu.getnc(c ? c.result : '');\n $_astxu.isACK(d) ? a(c) : (e.setLastError($ASTX2_CONST.ERROR_NCK), b());\n },\n onFailure: function () {\n e.setLastError($ASTX2_CONST.ERROR_FAILED);\n b();\n }\n });\n },\n _pclogdata: function (a, b, c) {\n var d = this;\n $_astxu.sendAuthAjax({\n url: $ASTX2_CUST.getURL($ASTX2_CUST.URL_GET_CERT),\n data: { pclog: 1, client_public_key: $ASTX2_COMM.mClientPublicKey },\n onSuccess: function (e) {\n var f = $_astxu.jsonParse(e);\n e = $_astxu.getnc(f ? f.result : '');\n 0 == $_astxu.isACK(e)\n ? (d.setLastError($ASTX2_CONST.ERROR_NCK), b())\n : d.set_cert(\n function () {\n d._pclogdata_get(a, b, f, c);\n },\n function () {\n d.setLastError($ASTX2_CONST.ERROR_NOCONNECT);\n b();\n },\n f\n );\n },\n onFailure: function (a) {\n d.setLastError($ASTX2_CONST.ERROR_FAILED);\n b();\n }\n });\n },\n getPCLOGData: function (a, b, c, d) {\n null == d && (d = '');\n this.setLastError($ASTX2_CONST.ERROR_SUCCESS);\n 0 == $ASTX2_COMM.isEnable() ? (this.setLastError($ASTX2_CONST.ERROR_NOINIT), c()) : this._pclogdata(b, c, d);\n },\n getPCLOGDataRetry: function (a, b, c, d, e) {\n null == d && (d = 3);\n null == e && (e = 1e3);\n if (0 >= d) this.setLastError($ASTX2_CONST.ERROR_EXCESS), c();\n else {\n var f = this;\n this.getPCLOGData(\n a,\n function (a) {\n b(a);\n },\n function () {\n f.getLastError() == $ASTX2_CONST.ERROR_NOINIT\n ? window.setTimeout(function () {\n f.getPCLOGDataRetry(a, b, c, d - 1, e);\n }, e)\n : c();\n }\n );\n }\n },\n setPCLOGData: function (a, b) {\n var c = $_astxu.getnc(b.pclog_data);\n 0 < c.length && ($_astxu.getCreatedFormValue(a, 'pclog_data').value = c);\n },\n isVmEnv: function (a, b) {\n 0 == $ASTX2_COMM.isEnable()\n ? a(null, $ASTX2_CONST.ERROR_NOINIT)\n : (null == b && (b = ''),\n $_astxu.sendJsonp({\n url: $ASTX2_COMM.mLocalServerURL + '/is_vm_env',\n data: { opts: b },\n onSuccess: function (b) {\n var d = $_astxu.getnc(b ? b.result : '');\n $_astxu.isACK(d) ? a(b.vm_env, $ASTX2_CONST.ERROR_SUCCESS) : a(null, $ASTX2_CONST.ERROR_NCK);\n },\n onFailure: function () {\n a(null, $ASTX2_CONST.ERROR_FAILED);\n }\n }));\n },\n isRemoteEnv: function (a, b) {\n 0 == $ASTX2_COMM.isEnable()\n ? a(null, $ASTX2_CONST.ERROR_NOINIT)\n : (null == b && (b = ''),\n $_astxu.sendJsonp({\n url: $ASTX2_COMM.mLocalServerURL + '/is_remote_env',\n data: { opts: b },\n onSuccess: function (b) {\n var d = $_astxu.getnc(b ? b.result : '');\n $_astxu.isACK(d) ? a(b.remote_env, $ASTX2_CONST.ERROR_SUCCESS) : a(null, $ASTX2_CONST.ERROR_NCK);\n },\n onFailure: function () {\n a(null, $ASTX2_CONST.ERROR_FAILED);\n }\n }));\n },\n isVmRemoteEnv: function (a, b) {\n 0 == $ASTX2_COMM.isEnable()\n ? a(null, $ASTX2_CONST.ERROR_NOINIT)\n : (null == b && (b = ''),\n $_astxu.sendJsonp({\n url: $ASTX2_COMM.mLocalServerURL + '/is_vm_remote_env',\n data: { opts: b },\n onSuccess: function (b) {\n var d = $_astxu.getnc(b ? b.result : '');\n $_astxu.isACK(d) ? a(b.vm_remote_env, $ASTX2_CONST.ERROR_SUCCESS) : a(null, $ASTX2_CONST.ERROR_NCK);\n },\n onFailure: function () {\n a(null, $ASTX2_CONST.ERROR_FAILED);\n }\n }));\n },\n checkService: function (a, b) {\n a == $ASTX2_CONST.SERVICE_AK && this.mE2EInst.checkService(b);\n },\n setProtect: function (a, b) {\n if (0 == $ASTX2_COMM.isEnable()) b && b($ASTX2_CONST.ERROR_NOINIT);\n else {\n var c = {\n customerid: $_astxu.getnc($ASTX2_CUST.mCustomerID),\n ak: a & $ASTX2_CONST.PROTECT_AK ? 1 : -1,\n fw: a & $ASTX2_CONST.PROTECT_FW ? 1 : -1,\n pb: a & $ASTX2_CONST.PROTECT_PB ? 1 : -1,\n pcs: a & $ASTX2_CONST.PROTECT_PCS ? 1 : -1\n };\n $_astxu.sendJsonp({\n url: $ASTX2_COMM.mLocalServerURL + '/set_protect',\n data: c,\n onSuccess: function (a) {\n a = $_astxu.getnc(a ? a.result : '');\n $_astxu.isACK(a) ? b && b($ASTX2_CONST.ERROR_SUCCESS) : b && b($ASTX2_CONST.ERROR_NCK);\n },\n onFailure: function () {\n b && b($ASTX2_CONST.ERROR_FAILED);\n }\n });\n }\n },\n isNotSupportOS: function (a, b) {\n 0 == $ASTX2_COMM.isEnable()\n ? b && b(null, $ASTX2_CONST.ERROR_NOINIT)\n : $_astxu.sendJsonp({\n url: $ASTX2_COMM.mLocalServerURL + '/is_not_support_os',\n data: {\n ak: a & $ASTX2_CONST.PROTECT_AK ? 1 : 0,\n fw: a & $ASTX2_CONST.PROTECT_FW ? 1 : 0,\n pb: a & $ASTX2_CONST.PROTECT_PB ? 1 : 0,\n pcs: a & $ASTX2_CONST.PROTECT_PCS ? 1 : 0\n },\n onSuccess: function (a) {\n var d = $_astxu.getnc(a ? a.result : '');\n $_astxu.isACK(d) ? b && b(a, $ASTX2_CONST.ERROR_SUCCESS) : b && b(null, $ASTX2_CONST.ERROR_NCK);\n },\n onFailure: function () {\n b && b(null, $ASTX2_CONST.ERROR_FAILED);\n }\n });\n },\n isAccessible: function (a, b, c, d, e) {\n null == e && (e = 750);\n if (a == $ASTX2_CONST.REQUEST_JSONP)\n $_astxu.sendJsonp({\n url: b,\n nocallback: !0,\n timeout: e,\n onSuccess: function () {\n c && c(b);\n },\n onFailure: function () {\n d && d(b);\n }\n });\n else {\n if (\n 0 != b.indexOf(window.location.protocol + '//' + window.location.host) &&\n 'IE' == $ASTX2_CONST.BROWSER_TYPE\n ) {\n if ('IE10' != $ASTX2_CONST.BROWSER_VER && 'IE11' != $ASTX2_CONST.BROWSER_VER) {\n d && d(b, 'CORS, not allowed browser');\n return;\n }\n if (0 != b.indexOf('http:') && 0 != b.indexOf('https:')) {\n d && d(b, 'CORS, not allowed protocol');\n return;\n }\n }\n $_astxu.sendAjax({\n url: b,\n type: 'GET',\n timeout: e,\n onSuccess: function (a) {\n c && c(b);\n },\n onFailure: function (a) {\n d && d(b, a);\n }\n });\n }\n },\n uninit: function () {\n this.uninitE2E();\n $ASTX2_COMM.uninit();\n },\n setLastError: function (a) {\n this.mLastError = a;\n },\n getLastError: function () {\n return this.mLastError;\n }\n };\n$ASTX2_MLi = {\n init: function () {\n setTimeout(function () {\n var a = { pageid: $ASTX2_CONST.PAGEID, focus: $_astxu.hasFocused() ? 1 : 0 };\n $_astxu.sendJsonp({ url: $ASTX2_COMM.mLocalServerURL + '/initForML', timeout: 1e3, data: a });\n }, 200);\n }\n};\n\nwindow.$ASTX2 = {\n ...$ASTX2,\n $ASTX2_COMM,\n $_astxu,\n $ASTX2_E2E,\n $ASTX2_MLi\n};\n\n/* ASTx 1.3 | (C) Copyright AhnLab, Inc. | $Revision: 30833 $ */\nconst getSubdomain = (hostname) => {\n if (!hostname || hostname === 'localhost' || hostname === '127.0.0.1') {\n return '';\n }\n\n const parts = hostname.split('.');\n\n // \uCD5C\uC18C 3\uAC1C \uBD80\uBD84\uC774 \uC788\uC5B4\uC57C \uC11C\uBE0C\uB3C4\uBA54\uC778 \uC874\uC7AC (subdomain.domain.com)\n if (parts.length < 3) {\n return '';\n }\n\n // \uCCAB \uBC88\uC9F8 \uBD80\uBD84\uC774 \uC11C\uBE0C\uB3C4\uBA54\uC778\n return parts[0] ?? '';\n};\n\n/**\n * \uD638\uC2A4\uD2B8\uBA85\uC744 \uAE30\uBC18\uC73C\uB85C \uD658\uACBD\uC744 \uD310\uB2E8\uD569\uB2C8\uB2E4.\n * @param hostname \uD638\uC2A4\uD2B8\uBA85\n * @returns \uD658\uACBD \uAD6C\uBD84 \uBB38\uC790\uC5F4 ('local' | 'dev' | 'stg' | 'prd')\n */\nconst getEnvironmentFromHostname = (hostname) => {\n const subDomain = getSubdomain(hostname);\n\n // localhost \uD310\uB2E8\n if (hostname === 'localhost' || hostname === '127.0.0.1' || hostname.startsWith('localhost:')) {\n return 'local';\n }\n\n // dev \uD658\uACBD \uD310\uB2E8\n if (subDomain.includes(`dev`)) {\n return 'dev';\n }\n\n // stg \uD658\uACBD \uD310\uB2E8\n if (subDomain.includes('stg')) {\n return 'stg';\n }\n\n // \uAE30\uBCF8 \uC6B4\uC601\n return 'prd';\n};\n\nconst getServicePath = () => {\n if (typeof window.isStorybookEnv === 'boolean') {\n return '';\n } else {\n return `/${location.pathname.split('/')[1]}`;\n }\n};\n";
1638
- var astx2_custom_default = "/* ASTx 1.3 | (C) Copyright AhnLab, Inc. | $Revision: 30833 $ */\r\n/* eslint-disable */\r\n\r\nlet $ASTX2_CUST = {\r\n // Customer option\r\n /*\r\n mUseJQuery: false, // Whether to use JQuery. \r\n mUseAjaxHello: false,\r\n mUseAutoStart: false, \r\n E2EFORM_TAIL: true,\r\n E2EFORM_INIT: '_e2e_forminit',\r\n E2EFORM_TAG1: '_e2e_1__',\r\n E2EFORM_TAG2: '_e2e_2__',\r\n E2EFORM_TAG1_PWD: '_e2e_1_pwd__',\r\n E2EFORM_TAG2_PWD: '_e2e_2_pwd__',\r\n */\r\n\r\n mCustomerID: null, // Customer ID for setProtect.\r\n\r\n // ASTX2_CUST defined values\r\n URL_GET_INIT: 101,\r\n URL_GET_CERT: 102,\r\n URL_GET_STAMP: 103,\r\n URL_CHK_STAMP: 104,\r\n\r\n setCustomerID(customerID) {\r\n if (customerID !== null && customerID !== 'undefined') {\r\n this.mCustomerID = customerID;\r\n }\r\n },\r\n\r\n getURL(type) {\r\n let result = '';\r\n const timestamp = new Date().getTime();\r\n\r\n switch (type) {\r\n case this.URL_GET_INIT:\r\n result = `${getServicePath()}/api/dea/sltn/astx2/init/get`;\r\n break;\r\n case this.URL_GET_CERT:\r\n result = `${getServicePath()}/api/dea/sltn/astx2/cert/get?v=${timestamp}`; // WAF \uCC28\uB2E8 \uBC29\uC9C0 (post \uC694\uCCAD \uC2DC \uAC12\uC774 \uC5C6\uB294 \uACBD\uC6B0 \uCC28\uB2E8)\r\n break;\r\n case this.URL_GET_STAMP:\r\n result = `${getServicePath()}/api/dea/sltn/astx2/stamp/get`;\r\n break;\r\n case this.URL_CHK_STAMP:\r\n result = `${getServicePath()}/api/dea/sltn/astx2/stamp-chk/post`;\r\n break;\r\n } // end of switch\r\n\r\n return result;\r\n },\r\n\r\n isE2EObject(obj) {\r\n return false;\r\n },\r\n\r\n getE2Etype(obj) {\r\n return null;\r\n },\r\n\r\n onCreatedFormValue(obj, obj_name) {},\r\n\r\n onHandlerPreFocus(obj, event) {},\r\n\r\n onHandlerKeyDown(obj, event) {\r\n return true;\r\n },\r\n\r\n getErrorMessage(errno) {\r\n let message = '[ASTx] ';\r\n\r\n switch (errno) {\r\n case $ASTX2_CONST.ERROR_FAILED:\r\n message += '\uB0B4\uBD80 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD558\uC600\uC2B5\uB2C8\uB2E4.';\r\n break;\r\n case $ASTX2_CONST.ERROR_NOINIT:\r\n message += '\uCD08\uAE30\uD654\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.';\r\n break;\r\n case $ASTX2_CONST.ERROR_NOTINST:\r\n message += '\uC124\uCE58\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.';\r\n break;\r\n case $ASTX2_CONST.ERROR_NOTSUPPORTED:\r\n message += '\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 OS\uC785\uB2C8\uB2E4.';\r\n break;\r\n case $ASTX2_CONST.ERROR_NOCONNECT:\r\n message += '\uC11C\uBC84(Web) \uD1B5\uC2E0 \uC2E4\uD328\uC785\uB2C8\uB2E4.';\r\n break;\r\n case $ASTX2_CONST.ERROR_NCK:\r\n message += '\uC11C\uBC84(Local) \uC751\uB2F5 \uC2E4\uD328\uC785\uB2C8\uB2E4.';\r\n break;\r\n case $ASTX2_CONST.ERROR_ERR:\r\n message += '\uC11C\uBC84(Local) \uB0B4\uBD80 \uC624\uB958\uC785\uB2C8\uB2E4.';\r\n break;\r\n case $ASTX2_CONST.ERROR_NSP:\r\n message += '\uC9C0\uC6D0\uD558\uC9C0 \uB418\uC9C0 \uC54A\uB294 \uD658\uACBD\uC785\uB2C8\uB2E4.';\r\n break;\r\n case $ASTX2_CONST.ERROR_PARAM:\r\n message += '\uC798\uBABB\uB41C \uC778\uC790\uC785\uB2C8\uB2E4.';\r\n break;\r\n case $ASTX2_CONST.ERROR_EXCESS:\r\n message += '\uC7AC\uC2DC\uB3C4 \uD68C\uC218\uB97C \uCD08\uACFC \uD558\uC600\uC2B5\uB2C8\uB2E4.';\r\n break;\r\n case $ASTX2_CONST.ERROR_NEEDUPDATE:\r\n message += '\uC81C\uD488 \uC5C5\uB370\uC774\uD2B8\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.';\r\n break;\r\n default:\r\n message += `errno=${errno}`;\r\n break;\r\n } // end of switch\r\n\r\n return message;\r\n },\r\n\r\n errorAbort(errno) {\r\n alert(this.getErrorMessage(errno));\r\n }\r\n};\r\n";
1639
- function addE2EObject(el, e2e_type) {
1640
- if (window.$ASTX2) {
1641
- window.$ASTX2.addE2EObject(el, e2e_type);
1642
- window.$ASTX2.resetE2E();
1643
- }
1644
- }
1645
- var loadScript = (callback) => {
1646
- if (!window.$ASTX2) {
1647
- console.log("dynamic load");
1648
- const script = document.createElement("script");
1649
- script.innerHTML = `
1650
- ${astx2_min_default}
1651
- ${astx2_custom_default}
1652
- `;
1653
- document.head.appendChild(script);
1654
- script.onload = () => {
1655
- };
1656
- }
1424
+ ) }),
1425
+ isOpen && customerList.length > 0 && /* @__PURE__ */ jsx(DropDown, { children: /* @__PURE__ */ jsx("div", { className: cx$j("result-container"), children: /* @__PURE__ */ jsx(List, { children: customerList.map((customer, index) => /* @__PURE__ */ jsx(
1426
+ ListItem,
1427
+ {
1428
+ onClick: () => handleSelectItem(customer),
1429
+ selectable: true,
1430
+ children: /* @__PURE__ */ jsxs("div", { className: cx$j("customer-item"), children: [
1431
+ /* @__PURE__ */ jsx("div", { className: cx$j("name"), children: highlightOnSearchKeyword(customer.customerName || "", searchKeyword) }),
1432
+ /* @__PURE__ */ jsxs("div", { className: cx$j("details"), children: [
1433
+ /* @__PURE__ */ jsx("span", { children: customer.birthDate && convertDateString({
1434
+ dateString: customer.birthDate,
1435
+ fromFormat: "YYYYMMDD",
1436
+ toFormat: "YYYY.MM.DD"
1437
+ }) }),
1438
+ /* @__PURE__ */ jsx("span", { className: cx$j("separator"), children: "|" }),
1439
+ /* @__PURE__ */ jsx("span", { children: getGenderName(customer.genderCode) }),
1440
+ customer.baseAddress && /* @__PURE__ */ jsxs(Fragment, { children: [
1441
+ /* @__PURE__ */ jsx("span", { className: cx$j("separator"), children: "|" }),
1442
+ /* @__PURE__ */ jsx("span", { children: customer.baseAddress })
1443
+ ] })
1444
+ ] })
1445
+ ] })
1446
+ },
1447
+ `cust-item-${customer.customerId}-${index}`
1448
+ )) }) }) })
1449
+ ] });
1657
1450
  };
1658
- var init = ({
1659
- initSuccess = () => {
1660
- },
1661
- initFailure = () => {
1662
- },
1663
- checkServerSuccess = () => {
1451
+
1452
+ const cx$i = classNames.bind(styles$2);
1453
+ const { InputBox: InputBox$2, Input: Input$2 } = FormCore;
1454
+ function CustomerSearchModal({ isOpen, closeModal, onSelect, onSearchClear }) {
1455
+ const {
1456
+ triggerRef,
1457
+ searchInput,
1458
+ customerList,
1459
+ searchKeyword,
1460
+ onSearchInputChange,
1461
+ setSearchKeyword,
1462
+ setSearchInput,
1463
+ setCustomerList,
1464
+ onKeyUp,
1465
+ search,
1466
+ onClear,
1467
+ handleSelectItem
1468
+ } = useCustomerSearch(onSelect);
1469
+ const handleClear = () => {
1470
+ onClear();
1471
+ onSearchClear?.();
1472
+ };
1473
+ return /* @__PURE__ */ jsxs(Modal.Root, { isOpen, onClose: closeModal, modalSize: "full-screen", children: [
1474
+ /* @__PURE__ */ jsx(Modal.Overlay, {}),
1475
+ /* @__PURE__ */ jsxs(Modal.Content, { children: [
1476
+ /* @__PURE__ */ jsx(Modal.Header, { headerTitle: "\uACE0\uAC1D \uAC80\uC0C9", showCloseButton: true }),
1477
+ /* @__PURE__ */ jsxs(Modal.Body, { children: [
1478
+ /* @__PURE__ */ jsx(InputBox$2, { endElement: /* @__PURE__ */ jsx(IconMainUiSearch, { onClick: search }), onClear: handleClear, clearable: true, children: /* @__PURE__ */ jsx(
1479
+ Input$2,
1480
+ {
1481
+ onChange: onSearchInputChange,
1482
+ onKeyUp,
1483
+ value: searchInput,
1484
+ placeholder: "\uACE0\uAC1D\uBA85\uC744 \uB450 \uAE00\uC790 \uC774\uC0C1 \uC785\uB825\uD574\uC8FC\uC138\uC694.",
1485
+ size: "large",
1486
+ ref: triggerRef
1487
+ }
1488
+ ) }),
1489
+ searchKeyword && /* @__PURE__ */ jsxs("p", { className: cx$i("result-count"), children: [
1490
+ "\uCD1D ",
1491
+ /* @__PURE__ */ jsx("span", { className: "text-primary", children: customerList.length }),
1492
+ "\uAC74\uC758 \uAC80\uC0C9\uACB0\uACFC"
1493
+ ] }),
1494
+ searchKeyword && customerList.length === 0 && /* @__PURE__ */ jsxs("div", { className: cx$i("search-result"), children: [
1495
+ "`",
1496
+ /* @__PURE__ */ jsx("span", { className: "text-primary", children: searchKeyword }),
1497
+ "`\uC5D0 \uB300\uD55C \uAC80\uC0C9\uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."
1498
+ ] }),
1499
+ searchKeyword && customerList.length > 0 && /* @__PURE__ */ jsx("div", { children: customerList.length > 0 && /* @__PURE__ */ jsx(List, { rootProps: { style: { width: "100%" } }, children: customerList.map((customer, index) => /* @__PURE__ */ jsx(
1500
+ ListItem,
1501
+ {
1502
+ onClick: () => {
1503
+ handleSelectItem(customer);
1504
+ setSearchKeyword("");
1505
+ setSearchInput("");
1506
+ setCustomerList([]);
1507
+ closeModal();
1508
+ },
1509
+ selectable: true,
1510
+ children: /* @__PURE__ */ jsxs("div", { className: cx$i("customer-item", "modal"), children: [
1511
+ /* @__PURE__ */ jsx("div", { className: cx$i("name"), children: highlightOnSearchKeyword(customer.customerName || "", searchKeyword) }),
1512
+ /* @__PURE__ */ jsxs("div", { className: cx$i("details", "modal"), children: [
1513
+ /* @__PURE__ */ jsx("span", { children: customer.birthDate && convertDateString({
1514
+ dateString: customer.birthDate,
1515
+ fromFormat: "YYYYMMDD",
1516
+ toFormat: "YYYY.MM.DD"
1517
+ }) }),
1518
+ /* @__PURE__ */ jsx("span", { className: cx$i("separator"), children: "|" }),
1519
+ /* @__PURE__ */ jsx("span", { children: getGenderName(customer.genderCode) }),
1520
+ customer.baseAddress && /* @__PURE__ */ jsxs(Fragment, { children: [
1521
+ /* @__PURE__ */ jsx("span", { className: cx$i("separator"), children: "|" }),
1522
+ /* @__PURE__ */ jsx("span", { children: customer.baseAddress })
1523
+ ] })
1524
+ ] })
1525
+ ] })
1526
+ },
1527
+ `cust-item-${customer.customerId}-${index}`
1528
+ )) }) })
1529
+ ] })
1530
+ ] })
1531
+ ] });
1532
+ }
1533
+
1534
+ const cx$h = classNames.bind(styles$3);
1535
+ const { InputBox: InputBox$1, Input: Input$1 } = FormCore;
1536
+ const favoriteList = [
1537
+ {
1538
+ nationalityCode: "KR",
1539
+ nationalityCodeName: "\uB300\uD55C\uBBFC\uAD6D",
1540
+ isoNumberNationalityCode: "410",
1541
+ nationalityEnglishAbbreviationName: "KOR"
1664
1542
  },
1665
- checkServerFailure = () => {
1666
- }
1667
- } = {}) => {
1668
- window.$ASTX2.init(
1669
- () => {
1670
- window.$ASTX2.initE2E();
1671
- window.$ASTX2.checkServer(
1672
- () => {
1673
- checkServerSuccess();
1674
- },
1675
- () => {
1676
- checkServerFailure();
1677
- console.error(`ASTX.checkServer() onFailure: errno=${window.$ASTX2.getLastError()}`);
1678
- }
1679
- );
1680
- initSuccess();
1681
- },
1682
- () => {
1683
- initFailure();
1684
- if (window.$ASTX2.getLastError() === 103) {
1685
- console.error("AhnLab Safe Transaction \uD074\uB77C\uC774\uC5B8\uD2B8\uAC00 \uC124\uCE58\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.");
1686
- } else {
1687
- console.error(`$ASTX2.init() onFailure: errno=${window.$ASTX2.getLastError()}`);
1688
- }
1689
- }
1690
- );
1691
- };
1692
- var initASTX2 = ({
1693
- initSuccess = () => {
1543
+ {
1544
+ nationalityCode: "CN",
1545
+ nationalityCodeName: "\uC911\uAD6D",
1546
+ isoNumberNationalityCode: "156",
1547
+ nationalityEnglishAbbreviationName: "CHN"
1694
1548
  },
1695
- initFailure = () => {
1549
+ {
1550
+ nationalityCode: "VN",
1551
+ nationalityCodeName: "\uBCA0\uD2B8\uB0A8",
1552
+ isoNumberNationalityCode: "704",
1553
+ nationalityEnglishAbbreviationName: "VNM"
1696
1554
  },
1697
- checkServerSuccess = () => {
1555
+ {
1556
+ nationalityCode: "US",
1557
+ nationalityCodeName: "\uBBF8\uAD6D",
1558
+ isoNumberNationalityCode: "840",
1559
+ nationalityEnglishAbbreviationName: "USA"
1698
1560
  },
1699
- checkServerFailure = () => {
1700
- }
1701
- } = {}) => {
1702
- if (window.$ASTX2) {
1703
- init({
1704
- initSuccess,
1705
- initFailure,
1706
- checkServerSuccess,
1707
- checkServerFailure
1708
- });
1561
+ {
1562
+ nationalityCode: "RU",
1563
+ nationalityCodeName: "\uB7EC\uC2DC\uC544",
1564
+ isoNumberNationalityCode: "643",
1565
+ nationalityEnglishAbbreviationName: "RUS"
1709
1566
  }
1567
+ ];
1568
+ const NationalitySearchInitialText = ({
1569
+ setSearchInput,
1570
+ setSearchKeyword
1571
+ }) => {
1572
+ const set = (keyword) => {
1573
+ setSearchInput(keyword);
1574
+ setSearchKeyword(keyword);
1575
+ };
1576
+ return /* @__PURE__ */ jsxs("div", { className: cx$h("favorite-container"), children: [
1577
+ /* @__PURE__ */ jsx("p", { className: cx$h("favorite-title"), children: "\uB9CE\uC774 \uCC3E\uB294 \uAD6D\uC801" }),
1578
+ /* @__PURE__ */ jsx("ul", { className: cx$h("favorite"), children: favoriteList.map((item, index) => /* @__PURE__ */ jsx("li", { onClick: () => set(item.nationalityCodeName), children: /* @__PURE__ */ jsx("button", { children: item.nationalityCodeName }) }, `${item.nationalityCode}-${index}`)) })
1579
+ ] });
1710
1580
  };
1711
- function getE2EDataIDs(ids, onSuccess, onFailure = () => {
1712
- }) {
1713
- if (window.$ASTX2) {
1714
- window.$ASTX2.getE2EDataIDs(
1715
- ids,
1716
- async (astx_data) => {
1717
- onSuccess(astx_data);
1718
- },
1719
- () => {
1720
- onFailure();
1721
- console.log(`ASTX.getE2EData() onFailure: errno=${window.$ASTX2.getLastError()}`);
1722
- }
1723
- );
1724
- }
1581
+ const NationalitySearchResult = ({ nationalityList, searchKeyWord, onSelect, onConfirm }) => {
1582
+ const [filterList, setFilterList] = useState([]);
1583
+ useEffect(() => {
1584
+ const filterList2 = nationalityList.filter((item) => item.nationalityCodeName.includes(searchKeyWord)) || [];
1585
+ setFilterList(filterList2);
1586
+ }, [nationalityList, searchKeyWord]);
1587
+ return /* @__PURE__ */ jsxs("div", { className: "mt-4", children: [
1588
+ /* @__PURE__ */ jsxs("p", { className: cx$h("favorite-title"), children: [
1589
+ "\uCD1D ",
1590
+ /* @__PURE__ */ jsx("span", { className: "text-primary", children: filterList.length }),
1591
+ "\uAC74\uC758 \uAC80\uC0C9\uACB0\uACFC"
1592
+ ] }),
1593
+ /* @__PURE__ */ jsx("ul", { className: cx$h("favorite"), children: filterList.length > 0 && filterList.map((item, index) => {
1594
+ return /* @__PURE__ */ jsx("li", { onClick: () => {
1595
+ onSelect(item.nationalityCodeName);
1596
+ onConfirm();
1597
+ }, children: /* @__PURE__ */ jsx("button", { children: highlightOnSearchKeyword(item.nationalityCodeName, searchKeyWord) }) }, `${index}-${item.nationalityCode}`);
1598
+ }) }),
1599
+ filterList.length === 0 && /* @__PURE__ */ jsxs("div", { className: cx$h("search-result"), children: [
1600
+ "`",
1601
+ /* @__PURE__ */ jsx("span", { className: "text-primary", children: searchKeyWord }),
1602
+ "`\uC5D0 \uB300\uD55C \uAC80\uC0C9\uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."
1603
+ ] })
1604
+ ] });
1605
+ };
1606
+ function NationalityComponent({ isOpen, onClose, setValue, onConfirm }) {
1607
+ const {
1608
+ search,
1609
+ onClear,
1610
+ searchKeyWord,
1611
+ onKeyUp,
1612
+ onSearch,
1613
+ searchList,
1614
+ searchInput,
1615
+ onSelect,
1616
+ setSearchInput,
1617
+ setSearchKeyword
1618
+ } = useSearchNationality({
1619
+ setValue,
1620
+ onClose,
1621
+ isOpen
1622
+ });
1623
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Modal.Root, { isOpen, onClose, modalSize: "full-screen", children: [
1624
+ /* @__PURE__ */ jsx(Modal.Overlay, {}),
1625
+ /* @__PURE__ */ jsxs(Modal.Content, { children: [
1626
+ /* @__PURE__ */ jsx(Modal.Header, { headerTitle: "\uAD6D\uC801 \uAC80\uC0C9", showCloseButton: true }),
1627
+ /* @__PURE__ */ jsxs(Modal.Body, { children: [
1628
+ /* @__PURE__ */ jsx(
1629
+ InputBox$1,
1630
+ {
1631
+ clearable: true,
1632
+ endElement: /* @__PURE__ */ jsx("button", { children: /* @__PURE__ */ jsx(IconMainUiSearch, { onClick: search }) }),
1633
+ onClear,
1634
+ className: cx$h("search-input"),
1635
+ children: /* @__PURE__ */ jsx(
1636
+ Input$1,
1637
+ {
1638
+ onChange: onSearch,
1639
+ onKeyUp,
1640
+ placeholder: "\uAD6D\uC801 \uC785\uB825",
1641
+ size: "large",
1642
+ value: searchInput
1643
+ }
1644
+ )
1645
+ }
1646
+ ),
1647
+ !searchKeyWord && /* @__PURE__ */ jsx(NationalitySearchInitialText, { setSearchInput, setSearchKeyword }),
1648
+ searchKeyWord && /* @__PURE__ */ jsx(NationalitySearchResult, { nationalityList: searchList, searchKeyWord, onSelect, onConfirm })
1649
+ ] })
1650
+ ] })
1651
+ ] }) });
1725
1652
  }
1726
- dayjs.locale("ko");
1727
- dayjs.extend(customParseFormat);
1653
+
1654
+ function useSearchNationality({ setValue, onClose, isOpen }) {
1655
+ const [searchKeyWord, setSearchKeyword] = useState("");
1656
+ const [selectedNationality, setSelectedNationality] = useState();
1657
+ const [searchInput, setSearchInput] = useState("");
1658
+ const { data } = useSearchNationalityQuery({ searchKeyWord });
1659
+ const searchList = data?.data.nationalityList || [];
1660
+ const onSearch = (e) => {
1661
+ const typeStr = e.target.value;
1662
+ setSearchInput(typeStr);
1663
+ };
1664
+ const search = () => {
1665
+ if (searchInput === "") {
1666
+ onClear();
1667
+ return;
1668
+ }
1669
+ if (searchInput && searchInput.length > 0) {
1670
+ setSearchKeyword(searchInput);
1671
+ setSelectedNationality("");
1672
+ }
1673
+ };
1674
+ const onKeyUp = (e) => {
1675
+ const currentValue = e.target.value;
1676
+ if (currentValue.length === 0 || currentValue.slice(-1).normalize("NFD").length > 1) {
1677
+ search();
1678
+ }
1679
+ };
1680
+ const onClear = useCallback(() => {
1681
+ setSearchKeyword("");
1682
+ setSearchInput("");
1683
+ setSelectedNationality("");
1684
+ }, []);
1685
+ const onSelect = (nationality) => {
1686
+ setSelectedNationality(nationality);
1687
+ const value = searchList.find((item) => item.nationalityCodeName === nationality);
1688
+ value && setValue(value);
1689
+ onClose();
1690
+ };
1691
+ useEffect(() => {
1692
+ if (isOpen) {
1693
+ setSelectedNationality("");
1694
+ setSearchKeyword("");
1695
+ }
1696
+ }, [isOpen]);
1697
+ return {
1698
+ onClear,
1699
+ searchKeyWord,
1700
+ searchList,
1701
+ selectedNationality,
1702
+ onSearch,
1703
+ onKeyUp,
1704
+ search,
1705
+ searchInput,
1706
+ onSelect,
1707
+ setSearchKeyword,
1708
+ setSearchInput
1709
+ };
1710
+ }
1711
+ const useNationalityComponent = () => {
1712
+ const [nationality, setNationality] = useState();
1713
+ const { isOpen, closeModal, openModal } = useModalState();
1714
+ const [isConfirmed, setIsConfirmed] = useState(false);
1715
+ const onConfirm = () => {
1716
+ setIsConfirmed(true);
1717
+ };
1718
+ const openInitModal = () => {
1719
+ setIsConfirmed(false);
1720
+ openModal();
1721
+ };
1722
+ const NationalitySearchComponent = () => /* @__PURE__ */ jsx(NationalityComponent, { isOpen, onClose: closeModal, setValue: setNationality, onConfirm });
1723
+ return {
1724
+ isOpen,
1725
+ closeModal,
1726
+ setNationality,
1727
+ nationality,
1728
+ openModal: openInitModal,
1729
+ NationalitySearchComponent,
1730
+ isConfirmed,
1731
+ setIsConfirmed
1732
+ };
1733
+ };
1728
1734
 
1729
1735
  const CODES = {
1730
1736
  appInit: {
@@ -3131,6 +3137,7 @@ function useJobVehicleSearchModal() {
3131
3137
  JobSearch,
3132
3138
  VehicleSearch,
3133
3139
  riskGrade,
3140
+ riskGradeCode,
3134
3141
  hospitalizationGrade,
3135
3142
  resetJobVehicleSearch,
3136
3143
  selectedJobDetail
@@ -3169,6 +3176,7 @@ function useJobVehicleSearchModal() {
3169
3176
  selectedJobDetail,
3170
3177
  selectedVehicle,
3171
3178
  riskGrade,
3179
+ riskGradeCode,
3172
3180
  hospitalizationGrade,
3173
3181
  isOpenJobVehicleModal: isOpen,
3174
3182
  isConfirmed,
@@ -4541,5 +4549,5 @@ function GaIframe() {
4541
4549
  return /* @__PURE__ */ jsx("noscript", { children: /* @__PURE__ */ jsx("iframe", { src: "https://www.googletagmanager.com/ns.html?id=GTM-PPT3LJ56", height: "0", width: "0", style: { display: "none", visibility: "hidden" } }) });
4542
4550
  }
4543
4551
 
4544
- export { Attachment, BANK_STOCK_ICON_LIST, BANK_STOCK_SEARCH_MODAL_TABS, BankStockSearchModal, CODES, CustomerSearch, CustomerSearchModal, DeaCustomerSearchModal, DudDownload, DudUpload, EmployeeSearchModal, FormCheckbox, FormCheckboxButton, FormDatePicker, FormDateRangePicker, FormSearchJobField, FormSegmentGroup, FormSelect, FormTextField, GaIframe, JobVehicleSearchModal, OrganizationSearchModal, RIV_SEARCH_PARAM_MAP, StepIndicator, getGenderName, highlightOnSearchKeyword, resize, testSignatureBase64Data, useAddressComponent, useBankStockSearch, useCamera, useCanvasPaint, useCustomerSearch, useDownloader, useJobSearchModal, useJobVehicleSearchModal, useNationalityComponent, useNxlOneModal, useRemoteIdentityVerification, useRemoteIdentityVerificationIframe, useRemoteIdentityVerificationPopup, useSearchAddress, useSearchNationality, useSearchVisa, useVisaComponent };
4552
+ export { Attachment, BANK_STOCK_ICON_LIST, BANK_STOCK_SEARCH_MODAL_TABS, BankStockSearchModal, CODES, CustomerSearch, CustomerSearchModal, DeaCustomerSearchModal, DudDownload, DudUpload, EmployeeSearchModal, FormCheckbox, FormCheckboxButton, FormDatePicker, FormDateRangePicker, FormSearchJobField, FormSegmentGroup, FormSelect, FormTextField, GaIframe, JobVehicleSearchModal, OrganizationSearchModal, RIV_SEARCH_PARAM_MAP, StepIndicator, getGenderName, highlightOnSearchKeyword, resize, testSignatureBase64Data, useAddressComponent, useBankStockSearch, useCamera, useCanvasPaint, useCustomerSearch, useDownloader, useJobSearchModal, useJobVehicleSearch, useJobVehicleSearchModal, useNationalityComponent, useNxlOneModal, useRemoteIdentityVerification, useRemoteIdentityVerificationIframe, useRemoteIdentityVerificationPopup, useSearchAddress, useSearchNationality, useSearchVisa, useVisaComponent };
4545
4553
  //# sourceMappingURL=index.esm.js.map