PageSourceSearch

https://sulwhasoo.com/ind-script/optimizer_user.php?filename=jZFBD…44912c580a4cdcf32967054&t=1789957184&user=T

js sulwhasoo.com collected 2026-09-25 02:53:06 UTC 327,069 bytes, 5,254 lines download raw bytes

1(function () {
2    "use strict";
3
4    var CONFIG = {
5        API_BASE: "https://ap-brand-cafe24-adm-fo.apddev.com/api/fo/api",
6        MALL_ID: "apsulwhasoo",
7        GOOGLE_MAPS_KEY: "AIzaSyCZDOtz7wSQUiApqncQLW6Y3ExBBXd9exc",
8        MARKER: "/wvl/img/marker.png"
9    };
10
11    /* ==================== Google Maps ==================== */
12
13    function loadGoogleMaps(callback) {
14        if (typeof google !== "undefined" && google.maps) {
15            callback();
16            return;
17        }
18        var script = document.createElement("script");
19        script.src = "https://maps.googleapis.com/maps/api/js?key=" + CONFIG.GOOGLE_MAPS_KEY + "&region=KR&language=ko";
20        script.async = true;
21        script.defer = true;
22        script.onload = callback;
23        document.head.appendChild(script);
24    }
25
26    function initMap(canvasId, lat, lng, markerUrl) {
27        var canvas = document.getElementById(canvasId);
28        if (!canvas || typeof google === "undefined") return;
29
30        var styles = [
31            { stylers: [] },
32            {
33                featureType: "road",
34                elementType: "geometry",
35                stylers: [{ saturation: 0 }, { visibility: "simplified" }]
36            },
37            {
38                featureType: "road",
39                elementType: "labels",
40                stylers: [{ visibility: "off" }]
41            }
42        ];
43        var styledMap = new google.maps.StyledMapType(styles, { name: "Styled Map" });
44
45        var position = { lat: parseFloat(lat), lng: parseFloat(lng) };
46        var mapInstance = new google.maps.Map(canvas, {
47            center: position,
48            zoom: 16,
49            mapTypeControlOptions: {
50                mapTypeIds: [google.maps.MapTypeId.ROADMAP, "map_style"]
51            },
52            restriction: {
53                latLngBounds: {
54                    north: 38.658064296236525,
55                    south: 33.12651372124617,
56                    east: 131.21123750988733,
57                    west: 124.45464596903972
58                },
59                strictBounds: false
60            }
61        });
62
63        mapInstance.mapTypes.set("map_style", styledMap);
64        mapInstance.setMapTypeId("map_style");
65
66        new google.maps.Marker({
67            position: position,
68            map: mapInstance,
69            icon: markerUrl || undefined
70        });
71
72        google.maps.event.addListener(mapInstance, "idle", function () {
73            var iframes = canvas.querySelectorAll("iframe");
74            for (var i = 0; i < iframes.length; i++) {
75                iframes[i].title = "내용 없음";
76            }
77        });
78    }
79
80    /* ==================== Store ==================== */
81
82    var Store = {
83        init: function () {
84            var $items = $(".store-list li");
85            var transitionMs = parseFloat($(".store-map").css("transition-duration")) * 1000 || 0;
86
87            $items.each(function (idx) {
88                var $li = $(this);
89                var $link = $li.find("> .store-link");
90                var mapId = $link.attr("data-target") || "";
91                var $canvas = $("#" + mapId);
92
93                $canvas.data("hasMap", false);
94
95                $link.on("click", function (e) {
96                    e.preventDefault();
97                    e.stopPropagation();
98
99                    if (!$canvas.data("hasMap") && mapId) {
100                        $canvas.data("hasMap", true);
101                        initMap(mapId, $link.data("lat"), $link.data("lng"), $link.data("marker"));
102                    }
103
104                    $items.removeClass("is-active");
105                    $li.addClass("is-active");
106
107                    if ($(".store-map").css("position") !== "absolute") {
108                        if (idx === 0) {
109                            $("html, body").animate({ scrollTop: 0 }, 250, "swing");
110                        } else {
111                            setTimeout(function () {
112                                $("html, body").animate({ scrollTop: $li.offset().top }, 250, "swing");
113                            }, transitionMs);
114                        }
115                    }
116                });
117            });
118
119            $items.eq(0).find(".store-link").trigger("click");
120        },
121
122        list: function (keyword) {
123            var params = { country: "KR", language: "ko_KR" };
124            if (keyword) params.keyword = keyword;
125
126            var query = "?" + new URLSearchParams(params).toString();
127            fetch(CONFIG.API_BASE + "/" + CONFIG.MALL_ID + "/stores" + query, {
128                headers: { "Accept": "application/json" }
129            })
130            .then(function (r) {
131                if (!r.ok) throw new Error("API " + r.status);
132                return r.json();
133            })
134            .then(function (res) {
135                var stores = (res && res.data) ? res.data : [];
136                var $template = $(".store-list-template li");
137                var $list = $(".store-list");
138
139                $list.empty();
140
141                if (stores.length === 0) {
142                    $("#not-found-item").show();
143                    return;
144                }
145                $("#not-found-item").hide();
146
147                stores.forEach(function (store) {
148                    var $li = $template.clone();
149                    var canvasId = "map-canvas" + store.id;
150
151                    $li.find(".store-link")
152                        .attr("data-target", canvasId)
153                        .attr("data-lat", store.latitude || "")
154                        .attr("data-lng", store.longitude || "")
155                        .attr("data-marker", CONFIG.MARKER)
156                        .attr("store-link", store.id);
157
158                    $li.find(".store-title").text(store.shop_name || "");
159                    $li.find(".address").text(store.address || "");
160                    $li.find(".tel").text(store.phone || "");
161                    $li.find(".map-canvas").attr("id", canvasId);
162
163                    $list.append($li);
164                });
165
166                Store.init();
167            })
168            .catch(function () {
169                $("#not-found-item").show();
170            });
171        }
172    };
173
174    /* ==================== Init ==================== */
175
176    $(function () {
177        $(".store-list-template").hide();
178        $(".store-list").empty();
179
180        $("#store-form").on("submit", function (e) {
181            e.preventDefault();
182            loadGoogleMaps(function () {
183                Store.list($.trim($("#store-name").val()));
184            });
185        });
186
187        loadGoogleMaps(function () {
188            Store.list();
189        });
190    });
191
192})();
193
194var aCategory = [];
195$(function(){
196    var methods = {
197        aCategory    : [],
198        aSubCategory : {},
199        get: function() {
200             $.ajax({
201                url : '/exec/front/Product/SubCategory',
202                dataType: 'json',
203                success: function(aData) {
204                    if (aData == null || aData == 'undefined') {
205                        methods.checkSub();
206                        return;
207                    }
208                    for (var i=0; i<aData.length; i++)
209                    {
210                        var sParentCateNo = aData[i].parent_cate_no;
211                        var sCateNo = aData[i].cate_no;
212                        if (!methods.aSubCategory[sParentCateNo]) {
213                            methods.aSubCategory[sParentCateNo] = [];
214                        }
215                        if (!aCategory[sCateNo]) {
216                            aCategory[sCateNo] = [];
217                        }
218                        methods.aSubCategory[sParentCateNo].push( aData[i] );
219                        aCategory[sCateNo] = aData[i];
220                    }
221                    methods.checkSub();
222                }
223            });
224        },
225        getParam: function(sUrl, sKey) {
226            if (typeof sUrl !== 'string') return;
227            var aUrl         = sUrl.split('?');
228            var sQueryString = aUrl[1];
229            var aParam       = {};
230            if (sQueryString) {
231                var aFields = sQueryString.split("&");
232                var aField  = [];
233                for (var i=0; i<aFields.length; i++) {
234                    aField = aFields[i].split('=');
235                    aParam[aField[0]] = aField[1];
236                }
237            }
238            return sKey ? aParam[sKey] : aParam;
239        },
240
241        show: function(overNode, iCateNo) {
242             var oParentNode = overNode;
243            var aHtml = [];
244            var sMyCateList = localStorage.getItem("myCateList");
245            if (methods.aSubCategory[iCateNo] != undefined) {
246                aHtml.push('<ul class="slideSubMenu">');
247                $(methods.aSubCategory[iCateNo]).each(function() {
248                    var sNextParentNo = this.cate_no;
249                    var sCateSelected = (checkInArray(sMyCateList, this.cate_no) == true) ? ' selected' : '';
250                    if (methods.aSubCategory[sNextParentNo] == undefined) {
251                        aHtml.push('<li class="noChild" id="cate'+this.cate_no+'">');
252                        var sHref = '/product/list.html'+this.param;
253                    } else {
254                        aHtml.push('<li id="cate'+this.cate_no+'">');
255                        var sHref = '#none';
256                    }
257                    aHtml.push('<a href="/product/list.html'+this.param+'" class="view" cate="'+this.param+'" data-i18n="LIST.PRD_CATE_NO_'+this.cate_no+'" data-i18n-new>'+this.name+'</a>');
258                    if (methods.aSubCategory[sNextParentNo] != undefined)  aHtml.push('<a href="'+sHref+'"'+this.param+'" onclick="subMenuEvent(this);" class="cate">상품보기</a>');
259
260                    if (methods.aSubCategory[sNextParentNo] != undefined) {
261                        aHtml.push('<ul>');
262                        $(methods.aSubCategory[sNextParentNo]).each(function() {
263                            var sNextParentNo2 = this.cate_no;
264                            var sCateSelected = (checkInArray(sMyCateList, this.cate_no) == true) ? ' selected' : '';
265                            if (methods.aSubCategory[sNextParentNo2] == undefined) {
266                                aHtml.push('<li class="noChild" id="cate'+this.cate_no+'">');
267                                var sHref = '/product/list.html'+this.param;
268                            } else {
269                                aHtml.push('<li id="cate'+this.cate_no+'">');
270                                var sHref = '#none';
271                            }
272                            aHtml.push('<a href="/product/list.html'+this.param+'" class="view" cate="'+this.param+'" data-i18n="LIST.PRD_CATE_NO_'+this.cate_no+'" data-i18n-new>'+this.name+'</a>');
273                            if (methods.aSubCategory[sNextParentNo] != undefined)  aHtml.push('<a href="'+sHref+'"'+this.param+'" onclick="subMenuEvent(this);" class="cate">상품보기</a>');
274
275                            if (methods.aSubCategory[sNextParentNo2] != undefined) {
276                                aHtml.push('<ul>');
277
278                                $(methods.aSubCategory[sNextParentNo2]).each(function() {
279                                    aHtml.push('<li class="noChild" id="cate'+this.cate_no+'">');
280                                    var sCateSelected = (checkInArray(sMyCateList, this.cate_no) == true) ? ' selected' : '';
281                                    aHtml.push('<a href="/product/list.html'+this.param+'" class="view" cate="'+this.param+'" onclick="subMenuEvent(this);" data-i18n="LIST.PRD_CATE_NO_'+this.cate_no+'" data-i18n-new>'+this.name+'</a>');
282                                    aHtml.push('</li>');
283                                });
284                                aHtml.push('</ul>');
285                            }
286                            aHtml.push('</li>');
287                        });
288                        aHtml.push('</ul>');
289                    }
290                    aHtml.push('</li>');
291                });
292                aHtml.push('</ul>');
293            }
294            $(oParentNode).append(aHtml.join(''));
295            if (window.i18nextCafe24) {
296            	i18nextCafe24.translate('data-i18n-new');
297            }
298        },
299        close: function() {
300            $('.slideSubMenu').remove();
301        },
302        checkSub: function() {
303            $('.cate').each(function(){
304                var sParam = $(this).attr('cate');
305                if (!sParam) return;
306                var iCateNo = Number(methods.getParam(sParam, 'cate_no'));
307                var result = methods.aSubCategory[iCateNo];
308                if (result == undefined) {
309                    if ($(this).closest('#slideProjectList').length) {
310                        var sHref = '/product/project.html'+sParam;
311                    } else {
312                        var sHref = '/product/list.html'+sParam;
313                    }
314
315                    $(this).attr('href', sHref);
316                    $(this).parent().attr('class', 'noChild');
317                }
318            });
319        }
320    };
321
322    methods.get();
323
324    $('#slideCateList li > a.cate').on('click', function(e) {
325        var sParam = $(this).attr('cate');
326        if (!sParam) return;
327        var iCateNo = Number(methods.getParam(sParam, 'cate_no'));
328        var hasClass =  $(this).parent().hasClass('selected');
329
330        if(hasClass) {
331            methods.close();
332            $(this).parent().removeClass('selected');
333        } else {
334            if (!iCateNo) return;
335            $('#aside #slideCateList li').removeClass('selected');
336            $(this).parent().addClass('selected');
337            methods.close();
338            methods.show(this.parentNode, iCateNo);
339        }
340        e.preventDefault();
341    });
342
343	/* 모바일 슬라이드바 카테고리 중분류체크 */
344	jQuery('#slide_add_category li').each(function(){
345		if( jQuery(this).children('ul').length == 0 ){
346			jQuery(this).addClass('noChild');
347		} else {
348			jQuery(this).append('<button type="button" class="cate">상품보기</button>');
349		}
350    });
351
352    $('#aside #slide_add_category a').not(".cate").on('click', function(e) {
353		const $this = $(this);
354		const $parentLi = $this.parent('li');
355		const $nextUl = $this.next('ul');
356
357		if ($nextUl.length > 0 && !($(this).attr("href").includes('/category') && $(this).closest('.sub_cate01').length > 0)) {
358			e.preventDefault();
359
360			// 1. 이미 열려있는 메뉴를 다시 클릭한 경우 -> 전체 닫기
361			if ($parentLi.hasClass('selected')) {
362				$parentLi.removeClass('selected');
363				$parentLi.find('ul').slideUp(250);
364				$parentLi.find('li').removeClass('selected');
365			} 
366			
367			// 2. 새로운 메뉴를 여는 경우
368			else {
369				// 다른 형제 메뉴들은 모두 닫음 (기존 규칙 유지)
370				const $siblings = $parentLi.siblings();
371				$siblings.removeClass('selected');
372				$siblings.find('ul').slideUp(250);
373				$siblings.find('li').removeClass('selected');
374
375				// 현재 클릭한 메뉴 열기
376				$parentLi.addClass('selected');
377				$nextUl.slideDown(250);
378
379				// [추가된 로직] 2depth가 열릴 때 하위 3depth 자동 전개
380				// 클릭한 게 1depth이고, 열리는 게 sub_cate01일 때만 작동
381				if ($nextUl.hasClass('sub_cate01')) {
382					setTimeout(function() {
383						// sub_cate01 내부의 모든 sub_cate02를 찾아 슬라이드 다운
384						const $thirdDepth = $nextUl.find('ul.sub_cate02');
385						
386						$thirdDepth.slideDown(250);
387						$thirdDepth.parent('li').addClass('selected'); // 시각적 활성화
388					}, 300);
389				}
390			}
391		}
392	});
393
394    $('#slideCateList h2').on('click', function() {
395        var oParentId = $(this).parent().attr('id');
396        if (oParentId == 'slideCateList' || oParentId == 'slideMultishopList' || oParentId == 'slideProjectList') {
397            ($(this).attr('class') == 'selected') ? $(this).next().hide() : $(this).next().show();
398        }
399        $(this).toggleClass('selected');
400    });
401
vendor: 46,206 bytes, lines 402-440
402    $('#slideProjectList .icoCategory').on('click', function() {
403        var target = $(this).parents('#slideProjectList');
404        if(target.find('.categoryList').css("display") == "none"){
405            target.find('.categoryList').show();
406        }else{
407            target.find('.categoryList').hide();
408        }
409
410        $(this).parents('.title').toggleClass('selected');
411    });
412
413});
414function subMenuEvent(obj) {
415    $(obj).parent().find('li').removeClass('selected');
416    $(obj).parent().toggleClass('selected');
417}
418
419function checkInArray(sBookmarkList, iCateNo) {
420    if (sBookmarkList == null) return false;
421    var aBookmarkList = sBookmarkList.split("|");
422    for (var i = 0; i < aBookmarkList.length; i++) {
423        if (aBookmarkList[i] == iCateNo) {
424            return true;
425        }
426    }
427    return false;
428}
429/**
430 * Swiper 4.5.1
431 * Most modern mobile touch slider and framework with hardware accelerated transitions
432 * http://www.idangero.us/swiper/
433 *
434 * Copyright 2014-2019 Vladimir Kharlampidi
435 *
436 * Released under the MIT License
437 *
438 * Released on: September 13, 2019
439 */
440!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Swiper=t()}(this,function(){"use strict";var f="undefined"==typeof document?{body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},location:{hash:""}}:document,ee="undefined"==typeof window?{document:f,navigator:{userAgent:""},location:{},history:{},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){}}:window,l=function(e){for(var t=0;t<e.length;t+=1)this[t]=e[t];return this.length=e.length,this};function I(e,t){var a=[],i=0;if(e&&!t&&e instanceof l)return e;if(e)if("string"==typeof e){var s,r,n=e.trim();if(0<=n.indexOf("<")&&0<=n.indexOf(">")){var o="div";for(0===n.indexOf("<li")&&(o="ul"),0===n.indexOf("<tr")&&(o="tbody"),0!==n.indexOf("<td")&&0!==n.indexOf("<th")||(o="tr"),0===n.indexOf("<tbody")&&(o="table"),0===n.indexOf("<option")&&(o="select"),(r=f.createElement(o)).innerHTML=n,i=0;i<r.childNodes.length;i+=1)a.push(r.childNodes[i])}else for(s=t||"#"!==e[0]||e.match(/[ .<>:~]/)?(t||f).querySelectorAll(e.trim()):[f.getElementById(e.trim().split("#")[1])],i=0;i<s.length;i+=1)s[i]&&a.push(s[i])}else if(e.nodeType||e===ee||e===f)a.push(e);else if(0<e.length&&e[0].nodeType)for(i=0;i<e.length;i+=1)a.push(e[i]);return new l(a)}function r(e){for(var t=[],a=0;a<e.length;a+=1)-1===t.indexOf(e[a])&&t.push(e[a]);return t}I.fn=l.prototype,I.Class=l,I.Dom7=l;var t={addClass:function(e){if(void 0===e)return this;for(var t=e.split(" "),a=0;a<t.length;a+=1)for(var i=0;i<this.length;i+=1)void 0!==this[i]&&void 0!==this[i].classList&&this[i].classList.add(t[a]);return this},removeClass:function(e){for(var t=e.split(" "),a=0;a<t.length;a+=1)for(var i=0;i<this.length;i+=1)void 0!==this[i]&&void 0!==this[i].classList&&this[i].classList.remove(t[a]);return this},hasClass:function(e){return!!this[0]&&this[0].classList.contains(e)},toggleClass:function(e){for(var t=e.split(" "),a=0;a<t.length;a+=1)for(var i=0;i<this.length;i+=1)void 0!==this[i]&&void 0!==this[i].classList&&this[i].classList.toggle(t[a]);return this},attr:function(e,t){var a=arguments;if(1===arguments.length&&"string"==typeof e)return this[0]?this[0].getAttribute(e):void 0;for(var i=0;i<this.length;i+=1)if(2===a.length)this[i].setAttribute(e,t);else for(var s in e)this[i][s]=e[s],this[i].setAttribute(s,e[s]);return this},removeAttr:function(e){for(var t=0;t<this.length;t+=1)this[t].removeAttribute(e);return this},data:function(e,t){var a;if(void 0!==t){for(var i=0;i<this.length;i+=1)(a=this[i]).dom7ElementDataStorage||(a.dom7ElementDataStorage={}),a.dom7ElementDataStorage[e]=t;return this}if(a=this[0]){if(a.dom7ElementDataStorage&&e in a.dom7ElementDataStorage)return a.dom7ElementDataStorage[e];var s=a.getAttribute("data-"+e);return s||void 0}},transform:function(e){for(var t=0;t<this.length;t+=1){var a=this[t].style;a.webkitTransform=e,a.transform=e}return this},transition:function(e){"string"!=typeof e&&(e+="ms");for(var t=0;t<this.length;t+=1){var a=this[t].style;a.webkitTransitionDuration=e,a.transitionDuration=e}return this},on:function(){for(var e,t=[],a=arguments.length;a--;)t[a]=arguments[a];var i=t[0],r=t[1],n=t[2],s=t[3];function o(e){var t=e.target;if(t){var a=e.target.dom7EventData||[];if(a.indexOf(e)<0&&a.unshift(e),I(t).is(r))n.apply(t,a);else for(var i=I(t).parents(),s=0;s<i.length;s+=1)I(i[s]).is(r)&&n.apply(i[s],a)}}function l(e){var t=e&&e.target&&e.target.dom7EventData||[];t.indexOf(e)<0&&t.unshift(e),n.apply(this,t)}"function"==typeof t[1]&&(i=(e=t)[0],n=e[1],s=e[2],r=void 0),s=s||!1;for(var d,p=i.split(" "),c=0;c<this.length;c+=1){var u=this[c];if(r)for(d=0;d<p.length;d+=1){var h=p[d];u.dom7LiveListeners||(u.dom7LiveListeners={}),u.dom7LiveListeners[h]||(u.dom7LiveListeners[h]=[]),u.dom7LiveListeners[h].push({listener:n,proxyListener:o}),u.addEventListener(h,o,s)}else for(d=0;d<p.length;d+=1){var v=p[d];u.dom7Listeners||(u.dom7Listeners={}),u.dom7Listeners[v]||(u.dom7Listeners[v]=[]),u.dom7Listeners[v].push({listener:n,proxyListener:l}),u.addEventListener(v,l,s)}}return this},off:function(){for(var e,t=[],a=arguments.length;a--;)t[a]=arguments[a];var i=t[0],s=t[1],r=t[2],n=t[3];"function"==typeof t[1]&&(i=(e=t)[0],r=e[1],n=e[2],s=void 0),n=n||!1;for(var o=i.split(" "),l=0;l<o.length;l+=1)for(var d=o[l],p=0;p<this.length;p+=1){var c=this[p],u=void 0;if(!s&&c.dom7Listeners?u=c.dom7Listeners[d]:s&&c.dom7LiveListeners&&(u=c.dom7LiveListeners[d]),u&&u.length)for(var h=u.length-1;0<=h;h-=1){var v=u[h];r&&v.listener===r?(c.removeEventListener(d,v.proxyListener,n),u.splice(h,1)):r&&v.listener&&v.listener.dom7proxy&&v.listener.dom7proxy===r?(c.removeEventListener(d,v.proxyListener,n),u.splice(h,1)):r||(c.removeEventListener(d,v.proxyListener,n),u.splice(h,1))}}return this},trigger:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var a=e[0].split(" "),i=e[1],s=0;s<a.length;s+=1)for(var r=a[s],n=0;n<this.length;n+=1){var o=this[n],l=void 0;try{l=new ee.CustomEvent(r,{detail:i,bubbles:!0,cancelable:!0})}catch(e){(l=f.createEvent("Event")).initEvent(r,!0,!0),l.detail=i}o.dom7EventData=e.filter(function(e,t){return 0<t}),o.dispatchEvent(l),o.dom7EventData=[],delete o.dom7EventData}return this},transitionEnd:function(t){var a,i=["webkitTransitionEnd","transitionend"],s=this;function r(e){if(e.target===this)for(t.call(this,e),a=0;a<i.length;a+=1)s.off(i[a],r)}if(t)for(a=0;a<i.length;a+=1)s.on(i[a],r);return this},outerWidth:function(e){if(0<this.length){if(e){var t=this.styles();return this[0].offsetWidth+parseFloat(t.getPropertyValue("margin-right"))+parseFloat(t.getPropertyValue("margin-left"))}return this[0].offsetWidth}return null},outerHeight:function(e){if(0<this.length){if(e){var t=this.styles();return this[0].offsetHeight+parseFloat(t.getPropertyValue("margin-top"))+parseFloat(t.getPropertyValue("margin-bottom"))}return this[0].offsetHeight}return null},offset:function(){if(0<this.length){var e=this[0],t=e.getBoundingClientRect(),a=f.body,i=e.clientTop||a.clientTop||0,s=e.clientLeft||a.clientLeft||0,r=e===ee?ee.scrollY:e.scrollTop,n=e===ee?ee.scrollX:e.scrollLeft;return{top:t.top+r-i,left:t.left+n-s}}return null},css:function(e,t){var a;if(1===arguments.length){if("string"!=typeof e){for(a=0;a<this.length;a+=1)for(var i in e)this[a].style[i]=e[i];return this}if(this[0])return ee.getComputedStyle(this[0],null).getPropertyValue(e)}if(2!==arguments.length||"string"!=typeof e)return this;for(a=0;a<this.length;a+=1)this[a].style[e]=t;return this},each:function(e){if(!e)return this;for(var t=0;t<this.length;t+=1)if(!1===e.call(this[t],t,this[t]))return this;return this},html:function(e){if(void 0===e)return this[0]?this[0].innerHTML:void 0;for(var t=0;t<this.length;t+=1)this[t].innerHTML=e;return this},text:function(e){if(void 0===e)return this[0]?this[0].textContent.trim():null;for(var t=0;t<this.length;t+=1)this[t].textContent=e;return this},is:function(e){var t,a,i=this[0];if(!i||void 0===e)return!1;if("string"==typeof e){if(i.matches)return i.matches(e);if(i.webkitMatchesSelector)return i.webkitMatchesSelector(e);if(i.msMatchesSelector)return i.msMatchesSelector(e);for(t=I(e),a=0;a<t.length;a+=1)if(t[a]===i)return!0;return!1}if(e===f)return i===f;if(e===ee)return i===ee;if(e.nodeType||e instanceof l){for(t=e.nodeType?[e]:e,a=0;a<t.length;a+=1)if(t[a]===i)return!0;return!1}return!1},index:function(){var e,t=this[0];if(t){for(e=0;null!==(t=t.previousSibling);)1===t.nodeType&&(e+=1);return e}},eq:function(e){if(void 0===e)return this;var t,a=this.length;return new l(a-1<e?[]:e<0?(t=a+e)<0?[]:[this[t]]:[this[e]])},append:function(){for(var e,t=[],a=arguments.length;a--;)t[a]=arguments[a];for(var i=0;i<t.length;i+=1){e=t[i];for(var s=0;s<this.length;s+=1)if("string"==typeof e){var r=f.createElement("div");for(r.innerHTML=e;r.firstChild;)this[s].appendChild(r.firstChild)}else if(e instanceof l)for(var n=0;n<e.length;n+=1)this[s].appendChild(e[n]);else this[s].appendChild(e)}return this},prepend:function(e){var t,a;for(t=0;t<this.length;t+=1)if("string"==typeof e){var i=f.createElement("div");for(i.innerHTML=e,a=i.childNodes.length-1;0<=a;a-=1)this[t].insertBefore(i.childNodes[a],this[t].childNodes[0])}else if(e instanceof l)for(a=0;a<e.length;a+=1)this[t].insertBefore(e[a],this[t].childNodes[0]);else this[t].insertBefore(e,this[t].childNodes[0]);return this},next:function(e){return 0<this.length?e?this[0].nextElementSibling&&I(this[0].nextElementSibling).is(e)?new l([this[0].nextElementSibling]):new l([]):this[0].nextElementSibling?new l([this[0].nextElementSibling]):new l([]):new l([])},nextAll:function(e){var t=[],a=this[0];if(!a)return new l([]);for(;a.nextElementSibling;){var i=a.nextElementSibling;e?I(i).is(e)&&t.push(i):t.push(i),a=i}return new l(t)},prev:function(e){if(0<this.length){var t=this[0];return e?t.previousElementSibling&&I(t.previousElementSibling).is(e)?new l([t.previousElementSibling]):new l([]):t.previousElementSibling?new l([t.previousElementSibling]):new l([])}return new l([])},prevAll:function(e){var t=[],a=this[0];if(!a)return new l([]);for(;a.previousElementSibling;){var i=a.previousElementSibling;e?I(i).is(e)&&t.push(i):t.push(i),a=i}return new l(t)},parent:function(e){for(var t=[],a=0;a<this.length;a+=1)null!==this[a].parentNode&&(e?I(this[a].parentNode).is(e)&&t.push(this[a].parentNode):t.push(this[a].parentNode));return I(r(t))},parents:function(e){for(var t=[],a=0;a<this.length;a+=1)for(var i=this[a].parentNode;i;)e?I(i).is(e)&&t.push(i):t.push(i),i=i.parentNode;return I(r(t))},closest:function(e){var t=this;return void 0===e?new l([]):(t.is(e)||(t=t.parents(e).eq(0)),t)},find:function(e){for(var t=[],a=0;a<this.length;a+=1)for(var i=this[a].querySelectorAll(e),s=0;s<i.length;s+=1)t.push(i[s]);return new l(t)},children:function(e){for(var t=[],a=0;a<this.length;a+=1)for(var i=this[a].childNodes,s=0;s<i.length;s+=1)e?1===i[s].nodeType&&I(i[s]).is(e)&&t.push(i[s]):1===i[s].nodeType&&t.push(i[s]);return new l(r(t))},remove:function(){for(var e=0;e<this.length;e+=1)this[e].parentNode&&this[e].parentNode.removeChild(this[e]);return this},add:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var a,i;for(a=0;a<e.length;a+=1){var s=I(e[a]);for(i=0;i<s.length;i+=1)this[this.length]=s[i],this.length+=1}return this},styles:function(){return this[0]?ee.getComputedStyle(this[0],null):{}}};Object.keys(t).forEach(function(e){I.fn[e]=I.fn[e]||t[e]});function e(e){void 0===e&&(e={});var t=this;t.params=e,t.eventsListeners={},t.params&&t.params.on&&Object.keys(t.params.on).forEach(function(e){t.on(e,t.params.on[e])})}var a,i,s,n,te={deleteProps:function(e){var t=e;Object.keys(t).forEach(function(e){try{t[e]=null}catch(e){}try{delete t[e]}catch(e){}})},nextTick:function(e,t){return void 0===t&&(t=0),setTimeout(e,t)},now:function(){return Date.now()},getTranslate:function(e,t){var a,i,s;void 0===t&&(t="x");var r=ee.getComputedStyle(e,null);return ee.WebKitCSSMatrix?(6<(i=r.transform||r.webkitTransform).split(",").length&&(i=i.split(", ").map(function(e){return e.replace(",",".")}).join(", ")),s=new ee.WebKitCSSMatrix("none"===i?"":i)):a=(s=r.MozTransform||r.OTransform||r.MsTransform||r.msTransform||r.transform||r.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,")).toString().split(","),"x"===t&&(i=ee.WebKitCSSMatrix?s.m41:16===a.length?parseFloat(a[12]):parseFloat(a[4])),"y"===t&&(i=ee.WebKitCSSMatrix?s.m42:16===a.length?parseFloat(a[13]):parseFloat(a[5])),i||0},parseUrlQuery:function(e){var t,a,i,s,r={},n=e||ee.location.href;if("string"==typeof n&&n.length)for(s=(a=(n=-1<n.indexOf("?")?n.replace(/\S*\?/,""):"").split("&").filter(function(e){return""!==e})).length,t=0;t<s;t+=1)i=a[t].replace(/#\S+/g,"").split("="),r[decodeURIComponent(i[0])]=void 0===i[1]?void 0:decodeURIComponent(i[1])||"";return r},isObject:function(e){return"object"==typeof e&&null!==e&&e.constructor&&e.constructor===Object},extend:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var a=Object(e[0]),i=1;i<e.length;i+=1){var s=e[i];if(null!=s)for(var r=Object.keys(Object(s)),n=0,o=r.length;n<o;n+=1){var l=r[n],d=Object.getOwnPropertyDescriptor(s,l);void 0!==d&&d.enumerable&&(te.isObject(a[l])&&te.isObject(s[l])?te.extend(a[l],s[l]):!te.isObject(a[l])&&te.isObject(s[l])?(a[l]={},te.extend(a[l],s[l])):a[l]=s[l])}}return a}},ae=(s=f.createElement("div"),{touch:ee.Modernizr&&!0===ee.Modernizr.touch||!!(0<ee.navigator.maxTouchPoints||"ontouchstart"in ee||ee.DocumentTouch&&f instanceof ee.DocumentTouch),pointerEvents:!!(ee.navigator.pointerEnabled||ee.PointerEvent||"maxTouchPoints"in ee.navigator&&0<ee.navigator.maxTouchPoints),prefixedPointerEvents:!!ee.navigator.msPointerEnabled,transition:(i=s.style,"transition"in i||"webkitTransition"in i||"MozTransition"in i),transforms3d:ee.Modernizr&&!0===ee.Modernizr.csstransforms3d||(a=s.style,"webkitPerspective"in a||"MozPerspective"in a||"OPerspective"in a||"MsPerspective"in a||"perspective"in a),flexbox:function(){for(var e=s.style,t="alignItems webkitAlignItems webkitBoxAlign msFlexAlign mozBoxAlign webkitFlexDirection msFlexDirection mozBoxDirection mozBoxOrient webkitBoxDirection webkitBoxOrient".split(" "),a=0;a<t.length;a+=1)if(t[a]in e)return!0;return!1}(),observer:"MutationObserver"in ee||"WebkitMutationObserver"in ee,passiveListener:function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});ee.addEventListener("testPassiveListener",null,t)}catch(e){}return e}(),gestures:"ongesturestart"in ee}),ie={isIE:!!ee.navigator.userAgent.match(/Trident/g)||!!ee.navigator.userAgent.match(/MSIE/g),isEdge:!!ee.navigator.userAgent.match(/Edge/g),isSafari:(n=ee.navigator.userAgent.toLowerCase(),0<=n.indexOf("safari")&&n.indexOf("chrome")<0&&n.indexOf("android")<0),isUiWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(ee.navigator.userAgent)},o={components:{configurable:!0}};e.prototype.on=function(e,t,a){var i=this;if("function"!=typeof t)return i;var s=a?"unshift":"push";return e.split(" ").forEach(function(e){i.eventsListeners[e]||(i.eventsListeners[e]=[]),i.eventsListeners[e][s](t)}),i},e.prototype.once=function(a,i,e){var s=this;if("function"!=typeof i)return s;function r(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];i.apply(s,e),s.off(a,r),r.f7proxy&&delete r.f7proxy}return r.f7proxy=i,s.on(a,r,e)},e.prototype.off=function(e,i){var s=this;return s.eventsListeners&&e.split(" ").forEach(function(a){void 0===i?s.eventsListeners[a]=[]:s.eventsListeners[a]&&s.eventsListeners[a].length&&s.eventsListeners[a].forEach(function(e,t){(e===i||e.f7proxy&&e.f7proxy===i)&&s.eventsListeners[a].splice(t,1)})}),s},e.prototype.emit=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var a,i,s,r=this;return r.eventsListeners&&(s="string"==typeof e[0]||Array.isArray(e[0])?(a=e[0],i=e.slice(1,e.length),r):(a=e[0].events,i=e[0].data,e[0].context||r),(Array.isArray(a)?a:a.split(" ")).forEach(function(e){if(r.eventsListeners&&r.eventsListeners[e]){var t=[];r.eventsListeners[e].forEach(function(e){t.push(e)}),t.forEach(function(e){e.apply(s,i)})}})),r},e.prototype.useModulesParams=function(a){var i=this;i.modules&&Object.keys(i.modules).forEach(function(e){var t=i.modules[e];t.params&&te.extend(a,t.params)})},e.prototype.useModules=function(i){void 0===i&&(i={});var s=this;s.modules&&Object.keys(s.modules).forEach(function(e){var a=s.modules[e],t=i[e]||{};a.instance&&Object.keys(a.instance).forEach(function(e){var t=a.instance[e];s[e]="function"==typeof t?t.bind(s):t}),a.on&&s.on&&Object.keys(a.on).forEach(function(e){s.on(e,a.on[e])}),a.create&&a.create.bind(s)(t)})},o.components.set=function(e){this.use&&this.use(e)},e.installModule=function(t){for(var e=[],a=arguments.length-1;0<a--;)e[a]=arguments[a+1];var i=this;i.prototype.modules||(i.prototype.modules={});var s=t.name||Object.keys(i.prototype.modules).length+"_"+te.now();return(i.prototype.modules[s]=t).proto&&Object.keys(t.proto).forEach(function(e){i.prototype[e]=t.proto[e]}),t.static&&Object.keys(t.static).forEach(function(e){i[e]=t.static[e]}),t.install&&t.install.apply(i,e),i},e.use=function(e){for(var t=[],a=arguments.length-1;0<a--;)t[a]=arguments[a+1];var i=this;return Array.isArray(e)?(e.forEach(function(e){return i.installModule(e)}),i):i.installModule.apply(i,[e].concat(t))},Object.defineProperties(e,o);var d={updateSize:function(){var e,t,a=this,i=a.$el;e=void 0!==a.params.width?a.params.width:i[0].clientWidth,t=void 0!==a.params.height?a.params.height:i[0].clientHeight,0===e&&a.isHorizontal()||0===t&&a.isVertical()||(e=e-parseInt(i.css("padding-left"),10)-parseInt(i.css("padding-right"),10),t=t-parseInt(i.css("padding-top"),10)-parseInt(i.css("padding-bottom"),10),te.extend(a,{width:e,height:t,size:a.isHorizontal()?e:t}))},updateSlides:function(){var e=this,t=e.params,a=e.$wrapperEl,i=e.size,s=e.rtlTranslate,r=e.wrongRTL,n=e.virtual&&t.virtual.enabled,o=n?e.virtual.slides.length:e.slides.length,l=a.children("."+e.params.slideClass),d=n?e.virtual.slides.length:l.length,p=[],c=[],u=[],h=t.slidesOffsetBefore;"function"==typeof h&&(h=t.slidesOffsetBefore.call(e));var v=t.slidesOffsetAfter;"function"==typeof v&&(v=t.slidesOffsetAfter.call(e));var f=e.snapGrid.length,m=e.snapGrid.length,g=t.spaceBetween,b=-h,w=0,y=0;if(void 0!==i){var x,T;"string"==typeof g&&0<=g.indexOf("%")&&(g=parseFloat(g.replace("%",""))/100*i),e.virtualSize=-g,s?l.css({marginLeft:"",marginTop:""}):l.css({marginRight:"",marginBottom:""}),1<t.slidesPerColumn&&(x=Math.floor(d/t.slidesPerColumn)===d/e.params.slidesPerColumn?d:Math.ceil(d/t.slidesPerColumn)*t.slidesPerColumn,"auto"!==t.slidesPerView&&"row"===t.slidesPerColumnFill&&(x=Math.max(x,t.slidesPerView*t.slidesPerColumn)));for(var E,S=t.slidesPerColumn,C=x/S,M=Math.floor(d/t.slidesPerColumn),P=0;P<d;P+=1){T=0;var k=l.eq(P);if(1<t.slidesPerColumn){var z=void 0,$=void 0,I=void 0;if("column"===t.slidesPerColumnFill||"row"===t.slidesPerColumnFill&&1<t.slidesPerGroup){if("column"===t.slidesPerColumnFill)I=P-($=Math.floor(P/S))*S,(M<$||$===M&&I===S-1)&&S<=(I+=1)&&(I=0,$+=1);else{var L=Math.floor(P/t.slidesPerGroup);$=P-(I=Math.floor(P/t.slidesPerView)-L*t.slidesPerColumn)*t.slidesPerView-L*t.slidesPerView}z=$+I*x/S,k.css({"-webkit-box-ordinal-group":z,"-moz-box-ordinal-group":z,"-ms-flex-order":z,"-webkit-order":z,order:z})}else $=P-(I=Math.floor(P/C))*C;k.css("margin-"+(e.isHorizontal()?"top":"left"),0!==I&&t.spaceBetween&&t.spaceBetween+"px").attr("data-swiper-column",$).attr("data-swiper-row",I)}if("none"!==k.css("display")){if("auto"===t.slidesPerView){var D=ee.getComputedStyle(k[0],null),O=k[0].style.transform,A=k[0].style.webkitTransform;if(O&&(k[0].style.transform="none"),A&&(k[0].style.webkitTransform="none"),t.roundLengths)T=e.isHorizontal()?k.outerWidth(!0):k.outerHeight(!0);else if(e.isHorizontal()){var H=parseFloat(D.getPropertyValue("width")),G=parseFloat(D.getPropertyValue("padding-left")),N=parseFloat(D.getPropertyValue("padding-right")),B=parseFloat(D.getPropertyValue("margin-left")),X=parseFloat(D.getPropertyValue("margin-right")),V=D.getPropertyValue("box-sizing");T=V&&"border-box"===V&&!ie.isIE?H+B+X:H+G+N+B+X}else{var Y=parseFloat(D.getPropertyValue("height")),F=parseFloat(D.getPropertyValue("padding-top")),R=parseFloat(D.getPropertyValue("padding-bottom")),q=parseFloat(D.getPropertyValue("margin-top")),W=parseFloat(D.getPropertyValue("margin-bottom")),j=D.getPropertyValue("box-sizing");T=j&&"border-box"===j&&!ie.isIE?Y+q+W:Y+F+R+q+W}O&&(k[0].style.transform=O),A&&(k[0].style.webkitTransform=A),t.roundLengths&&(T=Math.floor(T))}else T=(i-(t.slidesPerView-1)*g)/t.slidesPerView,t.roundLengths&&(T=Math.floor(T)),l[P]&&(e.isHorizontal()?l[P].style.width=T+"px":l[P].style.height=T+"px");l[P]&&(l[P].swiperSlideSize=T),u.push(T),t.centeredSlides?(b=b+T/2+w/2+g,0===w&&0!==P&&(b=b-i/2-g),0===P&&(b=b-i/2-g),Math.abs(b)<.001&&(b=0),t.roundLengths&&(b=Math.floor(b)),y%t.slidesPerGroup==0&&p.push(b),c.push(b)):(t.roundLengths&&(b=Math.floor(b)),y%t.slidesPerGroup==0&&p.push(b),c.push(b),b=b+T+g),e.virtualSize+=T+g,w=T,y+=1}}if(e.virtualSize=Math.max(e.virtualSize,i)+v,s&&r&&("slide"===t.effect||"coverflow"===t.effect)&&a.css({width:e.virtualSize+t.spaceBetween+"px"}),ae.flexbox&&!t.setWrapperSize||(e.isHorizontal()?a.css({width:e.virtualSize+t.spaceBetween+"px"}):a.css({height:e.virtualSize+t.spaceBetween+"px"})),1<t.slidesPerColumn&&(e.virtualSize=(T+t.spaceBetween)*x,e.virtualSize=Math.ceil(e.virtualSize/t.slidesPerColumn)-t.spaceBetween,e.isHorizontal()?a.css({width:e.virtualSize+t.spaceBetween+"px"}):a.css({height:e.virtualSize+t.spaceBetween+"px"}),t.centeredSlides)){E=[];for(var U=0;U<p.length;U+=1){var K=p[U];t.roundLengths&&(K=Math.floor(K)),p[U]<e.virtualSize+p[0]&&E.push(K)}p=E}if(!t.centeredSlides){E=[];for(var _=0;_<p.length;_+=1){var Z=p[_];t.roundLengths&&(Z=Math.floor(Z)),p[_]<=e.virtualSize-i&&E.push(Z)}p=E,1<Math.floor(e.virtualSize-i)-Math.floor(p[p.length-1])&&p.push(e.virtualSize-i)}if(0===p.length&&(p=[0]),0!==t.spaceBetween&&(e.isHorizontal()?s?l.css({marginLeft:g+"px"}):l.css({marginRight:g+"px"}):l.css({marginBottom:g+"px"})),t.centerInsufficientSlides){var Q=0;if(u.forEach(function(e){Q+=e+(t.spaceBetween?t.spaceBetween:0)}),(Q-=t.spaceBetween)<i){var J=(i-Q)/2;p.forEach(function(e,t){p[t]=e-J}),c.forEach(function(e,t){c[t]=e+J})}}te.extend(e,{slides:l,snapGrid:p,slidesGrid:c,slidesSizesGrid:u}),d!==o&&e.emit("slidesLengthChange"),p.length!==f&&(e.params.watchOverflow&&e.checkOverflow(),e.emit("snapGridLengthChange")),c.length!==m&&e.emit("slidesGridLengthChange"),(t.watchSlidesProgress||t.watchSlidesVisibility)&&e.updateSlidesOffset()}},updateAutoHeight:function(e){var t,a=this,i=[],s=0;if("number"==typeof e?a.setTransition(e):!0===e&&a.setTransition(a.params.speed),"auto"!==a.params.slidesPerView&&1<a.params.slidesPerView)for(t=0;t<Math.ceil(a.params.slidesPerView);t+=1){var r=a.activeIndex+t;if(r>a.slides.length)break;i.push(a.slides.eq(r)[0])}else i.push(a.slides.eq(a.activeIndex)[0]);for(t=0;t<i.length;t+=1)if(void 0!==i[t]){var n=i[t].offsetHeight;s=s<n?n:s}s&&a.$wrapperEl.css("height",s+"px")},updateSlidesOffset:function(){for(var e=this.slides,t=0;t<e.length;t+=1)e[t].swiperSlideOffset=this.isHorizontal()?e[t].offsetLeft:e[t].offsetTop},updateSlidesProgress:function(e){void 0===e&&(e=this&&this.translate||0);var t=this,a=t.params,i=t.slides,s=t.rtlTranslate;if(0!==i.length){void 0===i[0].swiperSlideOffset&&t.updateSlidesOffset();var r=-e;s&&(r=e),i.removeClass(a.slideVisibleClass),t.visibleSlidesIndexes=[],t.visibleSlides=[];for(var n=0;n<i.length;n+=1){var o=i[n],l=(r+(a.centeredSlides?t.minTranslate():0)-o.swiperSlideOffset)/(o.swiperSlideSize+a.spaceBetween);if(a.watchSlidesVisibility){var d=-(r-o.swiperSlideOffset),p=d+t.slidesSizesGrid[n];(0<=d&&d<t.size-1||1<p&&p<=t.size||d<=0&&p>=t.size)&&(t.visibleSlides.push(o),t.visibleSlidesIndexes.push(n),i.eq(n).addClass(a.slideVisibleClass))}o.progress=s?-l:l}t.visibleSlides=I(t.visibleSlides)}},updateProgress:function(e){void 0===e&&(e=this&&this.translate||0);var t=this,a=t.params,i=t.maxTranslate()-t.minTranslate(),s=t.progress,r=t.isBeginning,n=t.isEnd,o=r,l=n;n=0==i?r=!(s=0):(r=(s=(e-t.minTranslate())/i)<=0,1<=s),te.extend(t,{progress:s,isBeginning:r,isEnd:n}),(a.watchSlidesProgress||a.watchSlidesVisibility)&&t.updateSlidesProgress(e),r&&!o&&t.emit("reachBeginning toEdge"),n&&!l&&t.emit("reachEnd toEdge"),(o&&!r||l&&!n)&&t.emit("fromEdge"),t.emit("progress",s)},updateSlidesClasses:function(){var e,t=this,a=t.slides,i=t.params,s=t.$wrapperEl,r=t.activeIndex,n=t.realIndex,o=t.virtual&&i.virtual.enabled;a.removeClass(i.slideActiveClass+" "+i.slideNextClass+" "+i.slidePrevClass+" "+i.slideDuplicateActiveClass+" "+i.slideDuplicateNextClass+" "+i.slideDuplicatePrevClass),(e=o?t.$wrapperEl.find("."+i.slideClass+'[data-swiper-slide-index="'+r+'"]'):a.eq(r)).addClass(i.slideActiveClass),i.loop&&(e.hasClass(i.slideDuplicateClass)?s.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+n+'"]').addClass(i.slideDuplicateActiveClass):s.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+n+'"]').addClass(i.slideDuplicateActiveClass));var l=e.nextAll("."+i.slideClass).eq(0).addClass(i.slideNextClass);i.loop&&0===l.length&&(l=a.eq(0)).addClass(i.slideNextClass);var d=e.prevAll("."+i.slideClass).eq(0).addClass(i.slidePrevClass);i.loop&&0===d.length&&(d=a.eq(-1)).addClass(i.slidePrevClass),i.loop&&(l.hasClass(i.slideDuplicateClass)?s.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+l.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicateNextClass):s.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+l.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicateNextClass),d.hasClass(i.slideDuplicateClass)?s.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+d.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicatePrevClass):s.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+d.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicatePrevClass))},updateActiveIndex:function(e){var t,a=this,i=a.rtlTranslate?a.translate:-a.translate,s=a.slidesGrid,r=a.snapGrid,n=a.params,o=a.activeIndex,l=a.realIndex,d=a.snapIndex,p=e;if(void 0===p){for(var c=0;c<s.length;c+=1)void 0!==s[c+1]?i>=s[c]&&i<s[c+1]-(s[c+1]-s[c])/2?p=c:i>=s[c]&&i<s[c+1]&&(p=c+1):i>=s[c]&&(p=c);n.normalizeSlideIndex&&(p<0||void 0===p)&&(p=0)}if((t=0<=r.indexOf(i)?r.indexOf(i):Math.floor(p/n.slidesPerGroup))>=r.length&&(t=r.length-1),p!==o){var u=parseInt(a.slides.eq(p).attr("data-swiper-slide-index")||p,10);te.extend(a,{snapIndex:t,realIndex:u,previousIndex:o,activeIndex:p}),a.emit("activeIndexChange"),a.emit("snapIndexChange"),l!==u&&a.emit("realIndexChange"),(a.initialized||a.runCallbacksOnInit)&&a.emit("slideChange")}else t!==d&&(a.snapIndex=t,a.emit("snapIndexChange"))},updateClickedSlide:function(e){var t=this,a=t.params,i=I(e.target).closest("."+a.slideClass)[0],s=!1;if(i)for(var r=0;r<t.slides.length;r+=1)t.slides[r]===i&&(s=!0);if(!i||!s)return t.clickedSlide=void 0,void(t.clickedIndex=void 0);t.clickedSlide=i,t.virtual&&t.params.virtual.enabled?t.clickedIndex=parseInt(I(i).attr("data-swiper-slide-index"),10):t.clickedIndex=I(i).index(),a.slideToClickedSlide&&void 0!==t.clickedIndex&&t.clickedIndex!==t.activeIndex&&t.slideToClickedSlide()}};var p={getTranslate:function(e){void 0===e&&(e=this.isHorizontal()?"x":"y");var t=this.params,a=this.rtlTranslate,i=this.translate,s=this.$wrapperEl;if(t.virtualTranslate)return a?-i:i;var r=te.getTranslate(s[0],e);return a&&(r=-r),r||0},setTranslate:function(e,t){var a=this,i=a.rtlTranslate,s=a.params,r=a.$wrapperEl,n=a.progress,o=0,l=0;a.isHorizontal()?o=i?-e:e:l=e,s.roundLengths&&(o=Math.floor(o),l=Math.floor(l)),s.virtualTranslate||(ae.transforms3d?r.transform("translate3d("+o+"px, "+l+"px, 0px)"):r.transform("translate("+o+"px, "+l+"px)")),a.previousTranslate=a.translate,a.translate=a.isHorizontal()?o:l;var d=a.maxTranslate()-a.minTranslate();(0==d?0:(e-a.minTranslate())/d)!==n&&a.updateProgress(e),a.emit("setTranslate",a.translate,t)},minTranslate:function(){return-this.snapGrid[0]},maxTranslate:function(){return-this.snapGrid[this.snapGrid.length-1]}};var c={setTransition:function(e,t){this.$wrapperEl.transition(e),this.emit("setTransition",e,t)},transitionStart:function(e,t){void 0===e&&(e=!0);var a=this,i=a.activeIndex,s=a.params,r=a.previousIndex;s.autoHeight&&a.updateAutoHeight();var n=t;if(n=n||(r<i?"next":i<r?"prev":"reset"),a.emit("transitionStart"),e&&i!==r){if("reset"===n)return void a.emit("slideResetTransitionStart");a.emit("slideChangeTransitionStart"),"next"===n?a.emit("slideNextTransitionStart"):a.emit("slidePrevTransitionStart")}},transitionEnd:function(e,t){void 0===e&&(e=!0);var a=this,i=a.activeIndex,s=a.previousIndex;a.animating=!1,a.setTransition(0);var r=t;if(r=r||(s<i?"next":i<s?"prev":"reset"),a.emit("transitionEnd"),e&&i!==s){if("reset"===r)return void a.emit("slideResetTransitionEnd");a.emit("slideChangeTransitionEnd"),"next"===r?a.emit("slideNextTransitionEnd"):a.emit("slidePrevTransitionEnd")}}};var u={slideTo:function(e,t,a,i){void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===a&&(a=!0);var s=this,r=e;r<0&&(r=0);var n=s.params,o=s.snapGrid,l=s.slidesGrid,d=s.previousIndex,p=s.activeIndex,c=s.rtlTranslate;if(s.animating&&n.preventInteractionOnTransition)return!1;var u=Math.floor(r/n.slidesPerGroup);u>=o.length&&(u=o.length-1),(p||n.initialSlide||0)===(d||0)&&a&&s.emit("beforeSlideChangeStart");var h,v=-o[u];if(s.updateProgress(v),n.normalizeSlideIndex)for(var f=0;f<l.length;f+=1)-Math.floor(100*v)>=Math.floor(100*l[f])&&(r=f);if(s.initialized&&r!==p){if(!s.allowSlideNext&&v<s.translate&&v<s.minTranslate())return!1;if(!s.allowSlidePrev&&v>s.translate&&v>s.maxTranslate()&&(p||0)!==r)return!1}return h=p<r?"next":r<p?"prev":"reset",c&&-v===s.translate||!c&&v===s.translate?(s.updateActiveIndex(r),n.autoHeight&&s.updateAutoHeight(),s.updateSlidesClasses(),"slide"!==n.effect&&s.setTranslate(v),"reset"!==h&&(s.transitionStart(a,h),s.transitionEnd(a,h)),!1):(0!==t&&ae.transition?(s.setTransition(t),s.setTranslate(v),s.updateActiveIndex(r),s.updateSlidesClasses(),s.emit("beforeTransitionStart",t,i),s.transitionStart(a,h),s.animating||(s.animating=!0,s.onSlideToWrapperTransitionEnd||(s.onSlideToWrapperTransitionEnd=function(e){s&&!s.destroyed&&e.target===this&&(s.$wrapperEl[0].removeEventListener("transitionend",s.onSlideToWrapperTransitionEnd),s.$wrapperEl[0].removeEventListener("webkitTransitionEnd",s.onSlideToWrapperTransitionEnd),s.onSlideToWrapperTransitionEnd=null,delete s.onSlideToWrapperTransitionEnd,s.transitionEnd(a,h))}),s.$wrapperEl[0].addEventListener("transitionend",s.onSlideToWrapperTransitionEnd),s.$wrapperEl[0].addEventListener("webkitTransitionEnd",s.onSlideToWrapperTransitionEnd))):(s.setTransition(0),s.setTranslate(v),s.updateActiveIndex(r),s.updateSlidesClasses(),s.emit("beforeTransitionStart",t,i),s.transitionStart(a,h),s.transitionEnd(a,h)),!0)},slideToLoop:function(e,t,a,i){void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===a&&(a=!0);var s=e;return this.params.loop&&(s+=this.loopedSlides),this.slideTo(s,t,a,i)},slideNext:function(e,t,a){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0);var i=this,s=i.params,r=i.animating;return s.loop?!r&&(i.loopFix(),i._clientLeft=i.$wrapperEl[0].clientLeft,i.slideTo(i.activeIndex+s.slidesPerGroup,e,t,a)):i.slideTo(i.activeIndex+s.slidesPerGroup,e,t,a)},slidePrev:function(e,t,a){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0);var i=this,s=i.params,r=i.animating,n=i.snapGrid,o=i.slidesGrid,l=i.rtlTranslate;if(s.loop){if(r)return!1;i.loopFix(),i._clientLeft=i.$wrapperEl[0].clientLeft}function d(e){return e<0?-Math.floor(Math.abs(e)):Math.floor(e)}var p,c=d(l?i.translate:-i.translate),u=n.map(function(e){return d(e)}),h=(o.map(function(e){return d(e)}),n[u.indexOf(c)],n[u.indexOf(c)-1]);return void 0!==h&&(p=o.indexOf(h))<0&&(p=i.activeIndex-1),i.slideTo(p,e,t,a)},slideReset:function(e,t,a){return void 0===e&&(e=this.params.speed),void 0===t&&(t=!0),this.slideTo(this.activeIndex,e,t,a)},slideToClosest:function(e,t,a){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0);var i=this,s=i.activeIndex,r=Math.floor(s/i.params.slidesPerGroup);if(r<i.snapGrid.length-1){var n=i.rtlTranslate?i.translate:-i.translate,o=i.snapGrid[r];(i.snapGrid[r+1]-o)/2<n-o&&(s=i.params.slidesPerGroup)}return i.slideTo(s,e,t,a)},slideToClickedSlide:function(){var e,t=this,a=t.params,i=t.$wrapperEl,s="auto"===a.slidesPerView?t.slidesPerViewDynamic():a.slidesPerView,r=t.clickedIndex;if(a.loop){if(t.animating)return;e=parseInt(I(t.clickedSlide).attr("data-swiper-slide-index"),10),a.centeredSlides?r<t.loopedSlides-s/2||r>t.slides.length-t.loopedSlides+s/2?(t.loopFix(),r=i.children("."+a.slideClass+'[data-swiper-slide-index="'+e+'"]:not(.'+a.slideDuplicateClass+")").eq(0).index(),te.nextTick(function(){t.slideTo(r)})):t.slideTo(r):r>t.slides.length-s?(t.loopFix(),r=i.children("."+a.slideClass+'[data-swiper-slide-index="'+e+'"]:not(.'+a.slideDuplicateClass+")").eq(0).index(),te.nextTick(function(){t.slideTo(r)})):t.slideTo(r)}else t.slideTo(r)}};var h={loopCreate:function(){var i=this,e=i.params,t=i.$wrapperEl;t.children("."+e.slideClass+"."+e.slideDuplicateClass).remove();var s=t.children("."+e.slideClass);if(e.loopFillGroupWithBlank){var a=e.slidesPerGroup-s.length%e.slidesPerGroup;if(a!==e.slidesPerGroup){for(var r=0;r<a;r+=1){var n=I(f.createElement("div")).addClass(e.slideClass+" "+e.slideBlankClass);t.append(n)}s=t.children("."+e.slideClass)}}"auto"!==e.slidesPerView||e.loopedSlides||(e.loopedSlides=s.length),i.loopedSlides=parseInt(e.loopedSlides||e.slidesPerView,10),i.loopedSlides+=e.loopAdditionalSlides,i.loopedSlides>s.length&&(i.loopedSlides=s.length);var o=[],l=[];s.each(function(e,t){var a=I(t);e<i.loopedSlides&&l.push(t),e<s.length&&e>=s.length-i.loopedSlides&&o.push(t),a.attr("data-swiper-slide-index",e)});for(var d=0;d<l.length;d+=1)t.append(I(l[d].cloneNode(!0)).addClass(e.slideDuplicateClass));for(var p=o.length-1;0<=p;p-=1)t.prepend(I(o[p].cloneNode(!0)).addClass(e.slideDuplicateClass))},loopFix:function(){var e,t=this,a=t.params,i=t.activeIndex,s=t.slides,r=t.loopedSlides,n=t.allowSlidePrev,o=t.allowSlideNext,l=t.snapGrid,d=t.rtlTranslate;t.allowSlidePrev=!0,t.allowSlideNext=!0;var p=-l[i]-t.getTranslate();if(i<r)e=s.length-3*r+i,e+=r,t.slideTo(e,0,!1,!0)&&0!=p&&t.setTranslate((d?-t.translate:t.translate)-p);else if("auto"===a.slidesPerView&&2*r<=i||i>=s.length-r){e=-s.length+i+r,e+=r,t.slideTo(e,0,!1,!0)&&0!=p&&t.setTranslate((d?-t.translate:t.translate)-p)}t.allowSlidePrev=n,t.allowSlideNext=o},loopDestroy:function(){var e=this.$wrapperEl,t=this.params,a=this.slides;e.children("."+t.slideClass+"."+t.slideDuplicateClass+",."+t.slideClass+"."+t.slideBlankClass).remove(),a.removeAttr("data-swiper-slide-index")}};var v={setGrabCursor:function(e){if(!(ae.touch||!this.params.simulateTouch||this.params.watchOverflow&&this.isLocked)){var t=this.el;t.style.cursor="move",t.style.cursor=e?"-webkit-grabbing":"-webkit-grab",t.style.cursor=e?"-moz-grabbin":"-moz-grab",t.style.cursor=e?"grabbing":"grab"}},unsetGrabCursor:function(){ae.touch||this.params.watchOverflow&&this.isLocked||(this.el.style.cursor="")}};var m={appendSlide:function(e){var t=this,a=t.$wrapperEl,i=t.params;if(i.loop&&t.loopDestroy(),"object"==typeof e&&"length"in e)for(var s=0;s<e.length;s+=1)e[s]&&a.append(e[s]);else a.append(e);i.loop&&t.loopCreate(),i.observer&&ae.observer||t.update()},prependSlide:function(e){var t=this,a=t.params,i=t.$wrapperEl,s=t.activeIndex;a.loop&&t.loopDestroy();var r=s+1;if("object"==typeof e&&"length"in e){for(var n=0;n<e.length;n+=1)e[n]&&i.prepend(e[n]);r=s+e.length}else i.prepend(e);a.loop&&t.loopCreate(),a.observer&&ae.observer||t.update(),t.slideTo(r,0,!1)},addSlide:function(e,t){var a=this,i=a.$wrapperEl,s=a.params,r=a.activeIndex;s.loop&&(r-=a.loopedSlides,a.loopDestroy(),a.slides=i.children("."+s.slideClass));var n=a.slides.length;if(e<=0)a.prependSlide(t);else if(n<=e)a.appendSlide(t);else{for(var o=e<r?r+1:r,l=[],d=n-1;e<=d;d-=1){var p=a.slides.eq(d);p.remove(),l.unshift(p)}if("object"==typeof t&&"length"in t){for(var c=0;c<t.length;c+=1)t[c]&&i.append(t[c]);o=e<r?r+t.length:r}else i.append(t);for(var u=0;u<l.length;u+=1)i.append(l[u]);s.loop&&a.loopCreate(),s.observer&&ae.observer||a.update(),s.loop?a.slideTo(o+a.loopedSlides,0,!1):a.slideTo(o,0,!1)}},removeSlide:function(e){var t=this,a=t.params,i=t.$wrapperEl,s=t.activeIndex;a.loop&&(s-=t.loopedSlides,t.loopDestroy(),t.slides=i.children("."+a.slideClass));var r,n=s;if("object"==typeof e&&"length"in e){for(var o=0;o<e.length;o+=1)r=e[o],t.slides[r]&&t.slides.eq(r).remove(),r<n&&(n-=1);n=Math.max(n,0)}else r=e,t.slides[r]&&t.slides.eq(r).remove(),r<n&&(n-=1),n=Math.max(n,0);a.loop&&t.loopCreate(),a.observer&&ae.observer||t.update(),a.loop?t.slideTo(n+t.loopedSlides,0,!1):t.slideTo(n,0,!1)},removeAllSlides:function(){for(var e=[],t=0;t<this.slides.length;t+=1)e.push(t);this.removeSlide(e)}},g=function(){var e=ee.navigator.userAgent,t={ios:!1,android:!1,androidChrome:!1,desktop:!1,windows:!1,iphone:!1,ipod:!1,ipad:!1,cordova:ee.cordova||ee.phonegap,phonegap:ee.cordova||ee.phonegap},a=e.match(/(Windows Phone);?[\s\/]+([\d.]+)?/),i=e.match(/(Android);?[\s\/]+([\d.]+)?/),s=e.match(/(iPad).*OS\s([\d_]+)/),r=e.match(/(iPod)(.*OS\s([\d_]+))?/),n=!s&&e.match(/(iPhone\sOS|iOS)\s([\d_]+)/);if(a&&(t.os="windows",t.osVersion=a[2],t.windows=!0),i&&!a&&(t.os="android",t.osVersion=i[2],t.android=!0,t.androidChrome=0<=e.toLowerCase().indexOf("chrome")),(s||n||r)&&(t.os="ios",t.ios=!0),n&&!r&&(t.osVersion=n[2].replace(/_/g,"."),t.iphone=!0),s&&(t.osVersion=s[2].replace(/_/g,"."),t.ipad=!0),r&&(t.osVersion=r[3]?r[3].replace(/_/g,"."):null,t.iphone=!0),t.ios&&t.osVersion&&0<=e.indexOf("Version/")&&"10"===t.osVersion.split(".")[0]&&(t.osVersion=e.toLowerCase().split("version/")[1].split(" ")[0]),t.desktop=!(t.os||t.android||t.webView),t.webView=(n||s||r)&&e.match(/.*AppleWebKit(?!.*Safari)/i),t.os&&"ios"===t.os){var o=t.osVersion.split("."),l=f.querySelector('meta[name="viewport"]');t.minimalUi=!t.webView&&(r||n)&&(1*o[0]==7?1<=1*o[1]:7<1*o[0])&&l&&0<=l.getAttribute("content").indexOf("minimal-ui")}return t.pixelRatio=ee.devicePixelRatio||1,t}();function b(){var e=this,t=e.params,a=e.el;if(!a||0!==a.offsetWidth){t.breakpoints&&e.setBreakpoint();var i=e.allowSlideNext,s=e.allowSlidePrev,r=e.snapGrid;if(e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),t.freeMode){var n=Math.min(Math.max(e.translate,e.maxTranslate()),e.minTranslate());e.setTranslate(n),e.updateActiveIndex(),e.updateSlidesClasses(),t.autoHeight&&e.updateAutoHeight()}else e.updateSlidesClasses(),("auto"===t.slidesPerView||1<t.slidesPerView)&&e.isEnd&&!e.params.centeredSlides?e.slideTo(e.slides.length-1,0,!1,!0):e.slideTo(e.activeIndex,0,!1,!0);e.autoplay&&e.autoplay.running&&e.autoplay.paused&&e.autoplay.run(),e.allowSlidePrev=s,e.allowSlideNext=i,e.params.watchOverflow&&r!==e.snapGrid&&e.checkOverflow()}}var w={init:!0,direction:"horizontal",touchEventsTarget:"container",initialSlide:0,speed:300,preventInteractionOnTransition:!1,edgeSwipeDetection:!1,edgeSwipeThreshold:20,freeMode:!1,freeModeMomentum:!0,freeModeMomentumRatio:1,freeModeMomentumBounce:!0,freeModeMomentumBounceRatio:1,freeModeMomentumVelocityRatio:1,freeModeSticky:!1,freeModeMinimumVelocity:.02,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsInverse:!1,spaceBetween:0,slidesPerView:1,slidesPerColumn:1,slidesPerColumnFill:"column",slidesPerGroup:1,centeredSlides:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!1,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:0,touchMoveStopPropagation:!0,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,watchSlidesVisibility:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,preloadImages:!0,updateOnImagesReady:!0,loop:!1,loopAdditionalSlides:0,loopedSlides:null,loopFillGroupWithBlank:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,containerModifierClass:"swiper-container-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-invisible-blank",slideActiveClass:"swiper-slide-active",slideDuplicateActiveClass:"swiper-slide-duplicate-active",slideVisibleClass:"swiper-slide-visible",slideDuplicateClass:"swiper-slide-duplicate",slideNextClass:"swiper-slide-next",slideDuplicateNextClass:"swiper-slide-duplicate-next",slidePrevClass:"swiper-slide-prev",slideDuplicatePrevClass:"swiper-slide-duplicate-prev",wrapperClass:"swiper-wrapper",runCallbacksOnInit:!0},y={update:d,translate:p,transition:c,slide:u,loop:h,grabCursor:v,manipulation:m,events:{attachEvents:function(){var e=this,t=e.params,a=e.touchEvents,i=e.el,s=e.wrapperEl;e.onTouchStart=function(e){var t=this,a=t.touchEventsData,i=t.params,s=t.touches;if(!t.animating||!i.preventInteractionOnTransition){var r=e;if(r.originalEvent&&(r=r.originalEvent),a.isTouchEvent="touchstart"===r.type,(a.isTouchEvent||!("which"in r)||3!==r.which)&&!(!a.isTouchEvent&&"button"in r&&0<r.button||a.isTouched&&a.isMoved))if(i.noSwiping&&I(r.target).closest(i.noSwipingSelector?i.noSwipingSelector:"."+i.noSwipingClass)[0])t.allowClick=!0;else if(!i.swipeHandler||I(r).closest(i.swipeHandler)[0]){s.currentX="touchstart"===r.type?r.targetTouches[0].pageX:r.pageX,s.currentY="touchstart"===r.type?r.targetTouches[0].pageY:r.pageY;var n=s.currentX,o=s.currentY,l=i.edgeSwipeDetection||i.iOSEdgeSwipeDetection,d=i.edgeSwipeThreshold||i.iOSEdgeSwipeThreshold;if(!l||!(n<=d||n>=ee.screen.width-d)){if(te.extend(a,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),s.startX=n,s.startY=o,a.touchStartTime=te.now(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,0<i.threshold&&(a.allowThresholdMove=!1),"touchstart"!==r.type){var p=!0;I(r.target).is(a.formElements)&&(p=!1),f.activeElement&&I(f.activeElement).is(a.formElements)&&f.activeElement!==r.target&&f.activeElement.blur();var c=p&&t.allowTouchMove&&i.touchStartPreventDefault;(i.touchStartForcePreventDefault||c)&&r.preventDefault()}t.emit("touchStart",r)}}}}.bind(e),e.onTouchMove=function(e){var t=this,a=t.touchEventsData,i=t.params,s=t.touches,r=t.rtlTranslate,n=e;if(n.originalEvent&&(n=n.originalEvent),a.isTouched){if(!a.isTouchEvent||"mousemove"!==n.type){var o="touchmove"===n.type?n.targetTouches[0].pageX:n.pageX,l="touchmove"===n.type?n.targetTouches[0].pageY:n.pageY;if(n.preventedByNestedSwiper)return s.startX=o,void(s.startY=l);if(!t.allowTouchMove)return t.allowClick=!1,void(a.isTouched&&(te.extend(s,{startX:o,startY:l,currentX:o,currentY:l}),a.touchStartTime=te.now()));if(a.isTouchEvent&&i.touchReleaseOnEdges&&!i.loop)if(t.isVertical()){if(l<s.startY&&t.translate<=t.maxTranslate()||l>s.startY&&t.translate>=t.minTranslate())return a.isTouched=!1,void(a.isMoved=!1)}else if(o<s.startX&&t.translate<=t.maxTranslate()||o>s.startX&&t.translate>=t.minTranslate())return;if(a.isTouchEvent&&f.activeElement&&n.target===f.activeElement&&I(n.target).is(a.formElements))return a.isMoved=!0,void(t.allowClick=!1);if(a.allowTouchCallbacks&&t.emit("touchMove",n),!(n.targetTouches&&1<n.targetTouches.length)){s.currentX=o,s.currentY=l;var d=s.currentX-s.startX,p=s.currentY-s.startY;if(!(t.params.threshold&&Math.sqrt(Math.pow(d,2)+Math.pow(p,2))<t.params.threshold)){var c;if(void 0===a.isScrolling)t.isHorizontal()&&s.currentY===s.startY||t.isVertical()&&s.currentX===s.startX?a.isScrolling=!1:25<=d*d+p*p&&(c=180*Math.atan2(Math.abs(p),Math.abs(d))/Math.PI,a.isScrolling=t.isHorizontal()?c>i.touchAngle:90-c>i.touchAngle);if(a.isScrolling&&t.emit("touchMoveOpposite",n),void 0===a.startMoving&&(s.currentX===s.startX&&s.currentY===s.startY||(a.startMoving=!0)),a.isScrolling)a.isTouched=!1;else if(a.startMoving){t.allowClick=!1,n.preventDefault(),i.touchMoveStopPropagation&&!i.nested&&n.stopPropagation(),a.isMoved||(i.loop&&t.loopFix(),a.startTranslate=t.getTranslate(),t.setTransition(0),t.animating&&t.$wrapperEl.trigger("webkitTransitionEnd transitionend"),a.allowMomentumBounce=!1,!i.grabCursor||!0!==t.allowSlideNext&&!0!==t.allowSlidePrev||t.setGrabCursor(!0),t.emit("sliderFirstMove",n)),t.emit("sliderMove",n),a.isMoved=!0;var u=t.isHorizontal()?d:p;s.diff=u,u*=i.touchRatio,r&&(u=-u),t.swipeDirection=0<u?"prev":"next",a.currentTranslate=u+a.startTranslate;var h=!0,v=i.resistanceRatio;if(i.touchReleaseOnEdges&&(v=0),0<u&&a.currentTranslate>t.minTranslate()?(h=!1,i.resistance&&(a.currentTranslate=t.minTranslate()-1+Math.pow(-t.minTranslate()+a.startTranslate+u,v))):u<0&&a.currentTranslate<t.maxTranslate()&&(h=!1,i.resistance&&(a.currentTranslate=t.maxTranslate()+1-Math.pow(t.maxTranslate()-a.startTranslate-u,v))),h&&(n.preventedByNestedSwiper=!0),!t.allowSlideNext&&"next"===t.swipeDirection&&a.currentTranslate<a.startTranslate&&(a.currentTranslate=a.startTranslate),!t.allowSlidePrev&&"prev"===t.swipeDirection&&a.currentTranslate>a.startTranslate&&(a.currentTranslate=a.startTranslate),0<i.threshold){if(!(Math.abs(u
vendor: 5,426 bytes, line 440
440)>i.threshold||a.allowThresholdMove))return void(a.currentTranslate=a.startTranslate);if(!a.allowThresholdMove)return a.allowThresholdMove=!0,s.startX=s.currentX,s.startY=s.currentY,a.currentTranslate=a.startTranslate,void(s.diff=t.isHorizontal()?s.currentX-s.startX:s.currentY-s.startY)}i.followFinger&&((i.freeMode||i.watchSlidesProgress||i.watchSlidesVisibility)&&(t.updateActiveIndex(),t.updateSlidesClasses()),i.freeMode&&(0===a.velocities.length&&a.velocities.push({position:s[t.isHorizontal()?"startX":"startY"],time:a.touchStartTime}),a.velocities.push({position:s[t.isHorizontal()?"currentX":"currentY"],time:te.now()})),t.updateProgress(a.currentTranslate),t.setTranslate(a.currentTranslate))}}}}}else a.startMoving&&a.isScrolling&&t.emit("touchMoveOpposite",n)}.bind(e),e.onTouchEnd=function(e){var t=this,a=t.touchEventsData,i=t.params,s=t.touches,r=t.rtlTranslate,n=t.$wrapperEl,o=t.slidesGrid,l=t.snapGrid,d=e;if(d.originalEvent&&(d=d.originalEvent),a.allowTouchCallbacks&&t.emit("touchEnd",d),a.allowTouchCallbacks=!1,!a.isTouched)return a.isMoved&&i.grabCursor&&t.setGrabCursor(!1),a.isMoved=!1,void(a.startMoving=!1);i.grabCursor&&a.isMoved&&a.isTouched&&(!0===t.allowSlideNext||!0===t.allowSlidePrev)&&t.setGrabCursor(!1);var p,c=te.now(),u=c-a.touchStartTime;if(t.allowClick&&(t.updateClickedSlide(d),t.emit("tap",d),u<300&&300<c-a.lastClickTime&&(a.clickTimeout&&clearTimeout(a.clickTimeout),a.clickTimeout=te.nextTick(function(){t&&!t.destroyed&&t.emit("click",d)},300)),u<300&&c-a.lastClickTime<300&&(a.clickTimeout&&clearTimeout(a.clickTimeout),t.emit("doubleTap",d))),a.lastClickTime=te.now(),te.nextTick(function(){t.destroyed||(t.allowClick=!0)}),!a.isTouched||!a.isMoved||!t.swipeDirection||0===s.diff||a.currentTranslate===a.startTranslate)return a.isTouched=!1,a.isMoved=!1,void(a.startMoving=!1);if(a.isTouched=!1,a.isMoved=!1,a.startMoving=!1,p=i.followFinger?r?t.translate:-t.translate:-a.currentTranslate,i.freeMode){if(p<-t.minTranslate())return void t.slideTo(t.activeIndex);if(p>-t.maxTranslate())return void(t.slides.length<l.length?t.slideTo(l.length-1):t.slideTo(t.slides.length-1));if(i.freeModeMomentum){if(1<a.velocities.length){var h=a.velocities.pop(),v=a.velocities.pop(),f=h.position-v.position,m=h.time-v.time;t.velocity=f/m,t.velocity/=2,Math.abs(t.velocity)<i.freeModeMinimumVelocity&&(t.velocity=0),(150<m||300<te.now()-h.time)&&(t.velocity=0)}else t.velocity=0;t.velocity*=i.freeModeMomentumVelocityRatio,a.velocities.length=0;var g=1e3*i.freeModeMomentumRatio,b=t.velocity*g,w=t.translate+b;r&&(w=-w);var y,x,T=!1,E=20*Math.abs(t.velocity)*i.freeModeMomentumBounceRatio;if(w<t.maxTranslate())i.freeModeMomentumBounce?(w+t.maxTranslate()<-E&&(w=t.maxTranslate()-E),y=t.maxTranslate(),T=!0,a.allowMomentumBounce=!0):w=t.maxTranslate(),i.loop&&i.centeredSlides&&(x=!0);else if(w>t.minTranslate())i.freeModeMomentumBounce?(w-t.minTranslate()>E&&(w=t.minTranslate()+E),y=t.minTranslate(),T=!0,a.allowMomentumBounce=!0):w=t.minTranslate(),i.loop&&i.centeredSlides&&(x=!0);else if(i.freeModeSticky){for(var S,C=0;C<l.length;C+=1)if(l[C]>-w){S=C;break}w=-(w=Math.abs(l[S]-w)<Math.abs(l[S-1]-w)||"next"===t.swipeDirection?l[S]:l[S-1])}if(x&&t.once("transitionEnd",function(){t.loopFix()}),0!==t.velocity)g=r?Math.abs((-w-t.translate)/t.velocity):Math.abs((w-t.translate)/t.velocity);else if(i.freeModeSticky)return void t.slideToClosest();i.freeModeMomentumBounce&&T?(t.updateProgress(y),t.setTransition(g),t.setTranslate(w),t.transitionStart(!0,t.swipeDirection),t.animating=!0,n.transitionEnd(function(){t&&!t.destroyed&&a.allowMomentumBounce&&(t.emit("momentumBounce"),t.setTransition(i.speed),t.setTranslate(y),n.transitionEnd(function(){t&&!t.destroyed&&t.transitionEnd()}))})):t.velocity?(t.updateProgress(w),t.setTransition(g),t.setTranslate(w),t.transitionStart(!0,t.swipeDirection),t.animating||(t.animating=!0,n.transitionEnd(function(){t&&!t.destroyed&&t.transitionEnd()}))):t.updateProgress(w),t.updateActiveIndex(),t.updateSlidesClasses()}else if(i.freeModeSticky)return void t.slideToClosest();(!i.freeModeMomentum||u>=i.longSwipesMs)&&(t.updateProgress(),t.updateActiveIndex(),t.updateSlidesClasses())}else{for(var M=0,P=t.slidesSizesGrid[0],k=0;k<o.length;k+=i.slidesPerGroup)void 0!==o[k+i.slidesPerGroup]?p>=o[k]&&p<o[k+i.slidesPerGroup]&&(P=o[(M=k)+i.slidesPerGroup]-o[k]):p>=o[k]&&(M=k,P=o[o.length-1]-o[o.length-2]);var z=(p-o[M])/P;if(u>i.longSwipesMs){if(!i.longSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&(z>=i.longSwipesRatio?t.slideTo(M+i.slidesPerGroup):t.slideTo(M)),"prev"===t.swipeDirection&&(z>1-i.longSwipesRatio?t.slideTo(M+i.slidesPerGroup):t.slideTo(M))}else{if(!i.shortSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&t.slideTo(M+i.slidesPerGroup),"prev"===t.swipeDirection&&t.slideTo(M)}}}.bind(e),e.onClick=function(e){this.allowClick||(this.params.preventClicks&&e.preventDefault(),this.params.preventClicksPropagation&&this.animating&&(e.stopPropagation(),e.stopImmediatePropagation()))}.bind(e);var r="container"===t.touchEventsTarget?i:s,n=!!t.nested;if(ae.touch||!ae.pointerEvents&&!ae.prefixedPointerEvents){if(ae.touch){var o=!("touchstart"!==a.start||!ae.passiveListener||!t.passiveListeners)&&{passive:!0,capture:!1};r.addEventListener(a.start,e.onTouchStart,o),r.addEventListener(a.move,e.onTouchMove,ae.passiveListener?{passive:!1,capture:n}:n),r.addEventListener(a.end,e.onTouchEnd,o)
vendor: 5,404 bytes, line 440
440}(t.simulateTouch&&!g.ios&&!g.android||t.simulateTouch&&!ae.touch&&g.ios)&&(r.addEventListener("mousedown",e.onTouchStart,!1),f.addEventListener("mousemove",e.onTouchMove,n),f.addEventListener("mouseup",e.onTouchEnd,!1))}else r.addEventListener(a.start,e.onTouchStart,!1),f.addEventListener(a.move,e.onTouchMove,n),f.addEventListener(a.end,e.onTouchEnd,!1);(t.preventClicks||t.preventClicksPropagation)&&r.addEventListener("click",e.onClick,!0),e.on(g.ios||g.android?"resize orientationchange observerUpdate":"resize observerUpdate",b,!0)},detachEvents:function(){var e=this,t=e.params,a=e.touchEvents,i=e.el,s=e.wrapperEl,r="container"===t.touchEventsTarget?i:s,n=!!t.nested;if(ae.touch||!ae.pointerEvents&&!ae.prefixedPointerEvents){if(ae.touch){var o=!("onTouchStart"!==a.start||!ae.passiveListener||!t.passiveListeners)&&{passive:!0,capture:!1};r.removeEventListener(a.start,e.onTouchStart,o),r.removeEventListener(a.move,e.onTouchMove,n),r.removeEventListener(a.end,e.onTouchEnd,o)}(t.simulateTouch&&!g.ios&&!g.android||t.simulateTouch&&!ae.touch&&g.ios)&&(r.removeEventListener("mousedown",e.onTouchStart,!1),f.removeEventListener("mousemove",e.onTouchMove,n),f.removeEventListener("mouseup",e.onTouchEnd,!1))}else r.removeEventListener(a.start,e.onTouchStart,!1),f.removeEventListener(a.move,e.onTouchMove,n),f.removeEventListener(a.end,e.onTouchEnd,!1);(t.preventClicks||t.preventClicksPropagation)&&r.removeEventListener("click",e.onClick,!0),e.off(g.ios||g.android?"resize orientationchange observerUpdate":"resize observerUpdate",b)}},breakpoints:{setBreakpoint:function(){var e=this,t=e.activeIndex,a=e.initialized,i=e.loopedSlides;void 0===i&&(i=0);var s=e.params,r=s.breakpoints;if(r&&(!r||0!==Object.keys(r).length)){var n=e.getBreakpoint(r);if(n&&e.currentBreakpoint!==n){var o=n in r?r[n]:void 0;o&&["slidesPerView","spaceBetween","slidesPerGroup"].forEach(function(e){var t=o[e];void 0!==t&&(o[e]="slidesPerView"!==e||"AUTO"!==t&&"auto"!==t?"slidesPerView"===e?parseFloat(t):parseInt(t,10):"auto")});var l=o||e.originalParams,d=l.direction&&l.direction!==s.direction,p=s.loop&&(l.slidesPerView!==s.slidesPerView||d);d&&a&&e.changeDirection(),te.extend(e.params,l),te.extend(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),e.currentBreakpoint=n,p&&a&&(e.loopDestroy(),e.loopCreate(),e.updateSlides(),e.slideTo(t-i+e.loopedSlides,0,!1)),e.emit("breakpoint",l)}}},getBreakpoint:function(e){if(e){var t=!1,a=[];Object.keys(e).forEach(function(e){a.push(e)}),a.sort(function(e,t){return parseInt(e,10)-parseInt(t,10)});for(var i=0;i<a.length;i+=1){var s=a[i];this.params.breakpointsInverse?s<=ee.innerWidth&&(t=s):s>=ee.innerWidth&&!t&&(t=s)}return t||"max"}}},checkOverflow:{checkOverflow:function(){var e=this,t=e.isLocked;e.isLocked=1===e.snapGrid.length,e.allowSlideNext=!e.isLocked,e.allowSlidePrev=!e.isLocked,t!==e.isLocked&&e.emit(e.isLocked?"lock":"unlock"),t&&t!==e.isLocked&&(e.isEnd=!1,e.navigation.update())}},classes:{addClasses:function(){var t=this.classNames,a=this.params,e=this.rtl,i=this.$el,s=[];s.push("initialized"),s.push(a.direction),a.freeMode&&s.push("free-mode"),ae.flexbox||s.push("no-flexbox"),a.autoHeight&&s.push("autoheight"),e&&s.push("rtl"),1<a.slidesPerColumn&&s.push("multirow"),g.android&&s.push("android"),g.ios&&s.push("ios"),(ie.isIE||ie.isEdge)&&(ae.pointerEvents||ae.prefixedPointerEvents)&&s.push("wp8-"+a.direction),s.forEach(function(e){t.push(a.containerModifierClass+e)}),i.addClass(t.join(" "))},removeClasses:function(){var e=this.$el,t=this.classNames;e.removeClass(t.join(" "))}},images:{loadImage:function(e,t,a,i,s,r){var n;function o(){r&&r()}e.complete&&s?o():t?((n=new ee.Image).onload=o,n.onerror=o,i&&(n.sizes=i),a&&(n.srcset=a),t&&(n.src=t)):o()},preloadImages:function(){var e=this;function t(){null!=e&&e&&!e.destroyed&&(void 0!==e.imagesLoaded&&(e.imagesLoaded+=1),e.imagesLoaded===e.imagesToLoad.length&&(e.params.updateOnImagesReady&&e.update(),e.emit("imagesReady")))}e.imagesToLoad=e.$el.find("img");for(var a=0;a<e.imagesToLoad.length;a+=1){var i=e.imagesToLoad[a];e.loadImage(i,i.currentSrc||i.getAttribute("src"),i.srcset||i.getAttribute("srcset"),i.sizes||i.getAttribute("sizes"),!0,t)}}}},x={},T=function(u){function h(){for(var e,t,s,a=[],i=arguments.length;i--;)a[i]=arguments[i];s=(s=1===a.length&&a[0].constructor&&a[0].constructor===Object?a[0]:(t=(e=a)[0],e[1]))||{},s=te.extend({},s),t&&!s.el&&(s.el=t),u.call(this,s),Object.keys(y).forEach(function(t){Object.keys(y[t]).forEach(function(e){h.prototype[e]||(h.prototype[e]=y[t][e])})});var r=this;void 0===r.modules&&(r.modules={}),Object.keys(r.modules).forEach(function(e){var t=r.modules[e];if(t.params){var a=Object.keys(t.params)[0],i=t.params[a];if("object"!=typeof i||null===i)return;if(!(a in s&&"enabled"in i))return;!0===s[a]&&(s[a]={enabled:!0}),"object"!=typeof s[a]||"enabled"in s[a]||(s[a].enabled=!0),s[a]||(s[a]={enabled:!1})}});var n=te.extend({},w);r.useModulesParams(n),r.params=te.extend({},n,x,s),r.originalParams=te.extend({},r.params),r.passedParams=te.extend({},s);var o=(r.$=I)(r.params.el);if(t=o[0]){if(1<o.length){var l=[];return o.each(function(e,t){var a=te.extend({},s,{el:t});l.push(new h(a))}),l}t.swiper=r,o.data("swiper",r);var d,p,c=o.children("."+r.params.wrapperClass);return te.extend(r,{$el:o,el:t,$wrapperEl:c,wrapperEl:c[0],classNames:[],slides:I
vendor: 4,684 bytes, line 440
440(),slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal:function(){return"horizontal"===r.params.direction},isVertical:function(){return"vertical"===r.params.direction},rtl:"rtl"===t.dir.toLowerCase()||"rtl"===o.css("direction"),rtlTranslate:"horizontal"===r.params.direction&&("rtl"===t.dir.toLowerCase()||"rtl"===o.css("direction")),wrongRTL:"-webkit-box"===c.css("display"),activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,allowSlideNext:r.params.allowSlideNext,allowSlidePrev:r.params.allowSlidePrev,touchEvents:(d=["touchstart","touchmove","touchend"],p=["mousedown","mousemove","mouseup"],ae.pointerEvents?p=["pointerdown","pointermove","pointerup"]:ae.prefixedPointerEvents&&(p=["MSPointerDown","MSPointerMove","MSPointerUp"]),r.touchEventsTouch={start:d[0],move:d[1],end:d[2]},r.touchEventsDesktop={start:p[0],move:p[1],end:p[2]},ae.touch||!r.params.simulateTouch?r.touchEventsTouch:r.touchEventsDesktop),touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,formElements:"input, select, option, textarea, button, video",lastClickTime:te.now(),clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,isTouchEvent:void 0,startMoving:void 0},allowClick:!0,allowTouchMove:r.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),r.useModules(),r.params.init&&r.init(),r}}u&&(h.__proto__=u);var e={extendedDefaults:{configurable:!0},defaults:{configurable:!0},Class:{configurable:!0},$:{configurable:!0}};return((h.prototype=Object.create(u&&u.prototype)).constructor=h).prototype.slidesPerViewDynamic=function(){var e=this,t=e.params,a=e.slides,i=e.slidesGrid,s=e.size,r=e.activeIndex,n=1;if(t.centeredSlides){for(var o,l=a[r].swiperSlideSize,d=r+1;d<a.length;d+=1)a[d]&&!o&&(n+=1,s<(l+=a[d].swiperSlideSize)&&(o=!0));for(var p=r-1;0<=p;p-=1)a[p]&&!o&&(n+=1,s<(l+=a[p].swiperSlideSize)&&(o=!0))}else for(var c=r+1;c<a.length;c+=1)i[c]-i[r]<s&&(n+=1);return n},h.prototype.update=function(){var a=this;if(a&&!a.destroyed){var e=a.snapGrid,t=a.params;t.breakpoints&&a.setBreakpoint(),a.updateSize(),a.updateSlides(),a.updateProgress(),a.updateSlidesClasses(),a.params.freeMode?(i(),a.params.autoHeight&&a.updateAutoHeight()):(("auto"===a.params.slidesPerView||1<a.params.slidesPerView)&&a.isEnd&&!a.params.centeredSlides?a.slideTo(a.slides.length-1,0,!1,!0):a.slideTo(a.activeIndex,0,!1,!0))||i(),t.watchOverflow&&e!==a.snapGrid&&a.checkOverflow(),a.emit("update")}function i(){var e=a.rtlTranslate?-1*a.translate:a.translate,t=Math.min(Math.max(e,a.maxTranslate()),a.minTranslate());a.setTranslate(t),a.updateActiveIndex(),a.updateSlidesClasses()}},h.prototype.changeDirection=function(a,e){void 0===e&&(e=!0);var t=this,i=t.params.direction;return(a=a||("horizontal"===i?"vertical":"horizontal"))===i||"horizontal"!==a&&"vertical"!==a||(t.$el.removeClass(""+t.params.containerModifierClass+i+" wp8-"+i).addClass(""+t.params.containerModifierClass+a),(ie.isIE||ie.isEdge)&&(ae.pointerEvents||ae.prefixedPointerEvents)&&t.$el.addClass(t.params.containerModifierClass+"wp8-"+a),t.params.direction=a,t.slides.each(function(e,t){"vertical"===a?t.style.width="":t.style.height=""}),t.emit("changeDirection"),e&&t.update()),t},h.prototype.init=function(){var e=this;e.initialized||(e.emit("beforeInit"),e.params.breakpoints&&e.setBreakpoint(),e.addClasses(),e.params.loop&&e.loopCreate(),e.updateSize(),e.updateSlides(),e.params.watchOverflow&&e.checkOverflow(),e.params.grabCursor&&e.setGrabCursor(),e.params.preloadImages&&e.preloadImages(),e.params.loop?e.slideTo(e.params.initialSlide+e.loopedSlides,0,e.params.runCallbacksOnInit):e.slideTo(e.params.initialSlide,0,e.params.runCallbacksOnInit),e.attachEvents(),e.initialized=!0,e.emit("init"))},h.prototype.destroy=function(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0);var a=this,i=a.params,s=a.$el,r=a.$wrapperEl,n=a.slides;return void 0===a.params||a.destroyed||(a.emit("beforeDestroy"),a.initialized=!1,a.detachEvents(),i.loop&&a.loopDestroy(),t&&(a.removeClasses(),s.removeAttr("style"),r.removeAttr("style"),n&&n.length&&n.removeClass([i.slideVisibleClass,i.slideActiveClass,i.slideNextClass,i.slidePrevClass].join(" ")).removeAttr("style").removeAttr("data-swiper-slide-index").removeAttr("data-swiper-column").removeAttr("data-swiper-row")),a.emit("destroy"),Object.keys(a.eventsListeners).forEach(function(e){a.off(e)}),!1!==e&&(a.$el[0].swiper=null,a.$el.data("swiper",null),te.deleteProps(a)),a.destroyed=!0),null},h.extendDefaults=function(e){te.extend(
vendor: 15,102 bytes, line 440
440x,e)},e.extendedDefaults.get=function(){return x},e.defaults.get=function(){return w},e.Class.get=function(){return u},e.$.get=function(){return I},Object.defineProperties(h,e),h}(e),E={name:"device",proto:{device:g},static:{device:g}},S={name:"support",proto:{support:ae},static:{support:ae}},C={name:"browser",proto:{browser:ie},static:{browser:ie}},M={name:"resize",create:function(){var e=this;te.extend(e,{resize:{resizeHandler:function(){e&&!e.destroyed&&e.initialized&&(e.emit("beforeResize"),e.emit("resize"))},orientationChangeHandler:function(){e&&!e.destroyed&&e.initialized&&e.emit("orientationchange")}}})},on:{init:function(){ee.addEventListener("resize",this.resize.resizeHandler),ee.addEventListener("orientationchange",this.resize.orientationChangeHandler)},destroy:function(){ee.removeEventListener("resize",this.resize.resizeHandler),ee.removeEventListener("orientationchange",this.resize.orientationChangeHandler)}}},P={func:ee.MutationObserver||ee.WebkitMutationObserver,attach:function(e,t){void 0===t&&(t={});var a=this,i=new P.func(function(e){if(1!==e.length){var t=function(){a.emit("observerUpdate",e[0])};ee.requestAnimationFrame?ee.requestAnimationFrame(t):ee.setTimeout(t,0)}else a.emit("observerUpdate",e[0])});i.observe(e,{attributes:void 0===t.attributes||t.attributes,childList:void 0===t.childList||t.childList,characterData:void 0===t.characterData||t.characterData}),a.observer.observers.push(i)},init:function(){var e=this;if(ae.observer&&e.params.observer){if(e.params.observeParents)for(var t=e.$el.parents(),a=0;a<t.length;a+=1)e.observer.attach(t[a]);e.observer.attach(e.$el[0],{childList:e.params.observeSlideChildren}),e.observer.attach(e.$wrapperEl[0],{attributes:!1})}},destroy:function(){this.observer.observers.forEach(function(e){e.disconnect()}),this.observer.observers=[]}},k={name:"observer",params:{observer:!1,observeParents:!1,observeSlideChildren:!1},create:function(){te.extend(this,{observer:{init:P.init.bind(this),attach:P.attach.bind(this),destroy:P.destroy.bind(this),observers:[]}})},on:{init:function(){this.observer.init()},destroy:function(){this.observer.destroy()}}},z={update:function(e){var t=this,a=t.params,i=a.slidesPerView,s=a.slidesPerGroup,r=a.centeredSlides,n=t.params.virtual,o=n.addSlidesBefore,l=n.addSlidesAfter,d=t.virtual,p=d.from,c=d.to,u=d.slides,h=d.slidesGrid,v=d.renderSlide,f=d.offset;t.updateActiveIndex();var m,g,b,w=t.activeIndex||0;m=t.rtlTranslate?"right":t.isHorizontal()?"left":"top",b=r?(g=Math.floor(i/2)+s+o,Math.floor(i/2)+s+l):(g=i+(s-1)+o,s+l);var y=Math.max((w||0)-b,0),x=Math.min((w||0)+g,u.length-1),T=(t.slidesGrid[y]||0)-(t.slidesGrid[0]||0);function E(){t.updateSlides(),t.updateProgress(),t.updateSlidesClasses(),t.lazy&&t.params.lazy.enabled&&t.lazy.load()}if(te.extend(t.virtual,{from:y,to:x,offset:T,slidesGrid:t.slidesGrid}),p===y&&c===x&&!e)return t.slidesGrid!==h&&T!==f&&t.slides.css(m,T+"px"),void t.updateProgress();if(t.params.virtual.renderExternal)return t.params.virtual.renderExternal.call(t,{offset:T,from:y,to:x,slides:function(){for(var e=[],t=y;t<=x;t+=1)e.push(u[t]);return e}()}),void E();var S=[],C=[];if(e)t.$wrapperEl.find("."+t.params.slideClass).remove();else for(var M=p;M<=c;M+=1)(M<y||x<M)&&t.$wrapperEl.find("."+t.params.slideClass+'[data-swiper-slide-index="'+M+'"]').remove();for(var P=0;P<u.length;P+=1)y<=P&&P<=x&&(void 0===c||e?C.push(P):(c<P&&C.push(P),P<p&&S.push(P)));C.forEach(function(e){t.$wrapperEl.append(v(u[e],e))}),S.sort(function(e,t){return t-e}).forEach(function(e){t.$wrapperEl.prepend(v(u[e],e))}),t.$wrapperEl.children(".swiper-slide").css(m,T+"px"),E()},renderSlide:function(e,t){var a=this,i=a.params.virtual;if(i.cache&&a.virtual.cache[t])return a.virtual.cache[t];var s=i.renderSlide?I(i.renderSlide.call(a,e,t)):I('<div class="'+a.params.slideClass+'" data-swiper-slide-index="'+t+'">'+e+"</div>");return s.attr("data-swiper-slide-index")||s.attr("data-swiper-slide-index",t),i.cache&&(a.virtual.cache[t]=s),s},appendSlide:function(e){if("object"==typeof e&&"length"in e)for(var t=0;t<e.length;t+=1)e[t]&&this.virtual.slides.push(e[t]);else this.virtual.slides.push(e);this.virtual.update(!0)},prependSlide:function(e){var t=this,a=t.activeIndex,i=a+1,s=1;if(Array.isArray(e)){for(var r=0;r<e.length;r+=1)e[r]&&t.virtual.slides.unshift(e[r]);i=a+e.length,s=e.length}else t.virtual.slides.unshift(e);if(t.params.virtual.cache){var n=t.virtual.cache,o={};Object.keys(n).forEach(function(e){o[parseInt(e,10)+s]=n[e]}),t.virtual.cache=o}t.virtual.update(!0),t.slideTo(i,0)},removeSlide:function(e){var t=this;if(null!=e){var a=t.activeIndex;if(Array.isArray(e))for(var i=e.length-1;0<=i;i-=1)t.virtual.slides.splice(e[i],1),t.params.virtual.cache&&delete t.virtual.cache[e[i]],e[i]<a&&(a-=1),a=Math.max(a,0);else t.virtual.slides.splice(e,1),t.params.virtual.cache&&delete t.virtual.cache[e],e<a&&(a-=1),a=Math.max(a,0);t.virtual.update(!0),t.slideTo(a,0)}},removeAllSlides:function(){var e=this;e.virtual.slides=[],e.params.virtual.cache&&(e.virtual.cache={}),e.virtual.update(!0),e.slideTo(0,0)}},$={name:"virtual",params:{virtual:{enabled:!1,slides:[],cache:!0,renderSlide:null,renderExternal:null,addSlidesBefore:0,addSlidesAfter:0}},create:function(){var e=this;te.extend(e,{virtual:{update:z.update.bind(e),appendSlide:z.appendSlide.bind(e),prependSlide:z.prependSlide.bind(e),removeSlide:z.removeSlide.bind(e),removeAllSlides:z.removeAllSlides.bind(e),renderSlide:z.renderSlide.bind(e),slides:e.params.virtual.slides,cache:{}}})},on:{beforeInit:function(){var e=this;if(e.params.virtual.enabled){e.classNames.push(e.params.containerModifierClass+"virtual");var t={watchSlidesProgress:!0};te.extend(e.params,t),te.extend(e.originalParams,t),e.params.initialSlide||e.virtual.update()}},setTranslate:function(){this.params.virtual.enabled&&this.virtual.update()}}},L={handle:function(e){var t=this,a=t.rtlTranslate,i=e;i.originalEvent&&(i=i.originalEvent);var s=i.keyCode||i.charCode;if(!t.allowSlideNext&&(t.isHorizontal()&&39===s||t.isVertical()&&40===s||34===s))return!1;if(!t.allowSlidePrev&&(t.isHorizontal()&&37===s||t.isVertical()&&38===s||33===s))return!1;if(!(i.shiftKey||i.altKey||i.ctrlKey||i.metaKey||f.activeElement&&f.activeElement.nodeName&&("input"===f.activeElement.nodeName.toLowerCase()||"textarea"===f.activeElement.nodeName.toLowerCase()))){if(t.params.keyboard.onlyInViewport&&(33===s||34===s||37===s||39===s||38===s||40===s)){var r=!1;if(0<t.$el.parents("."+t.params.slideClass).length&&0===t.$el.parents("."+t.params.slideActiveClass).length)return;var n=ee.innerWidth,o=ee.innerHeight,l=t.$el.offset();a&&(l.left-=t.$el[0].scrollLeft);for(var d=[[l.left,l.top],[l.left+t.width,l.top],[l.left,l.top+t.height],[l.left+t.width,l.top+t.height]],p=0;p<d.length;p+=1){var c=d[p];0<=c[0]&&c[0]<=n&&0<=c[1]&&c[1]<=o&&(r=!0)}if(!r)return}t.isHorizontal()?(33!==s&&34!==s&&37!==s&&39!==s||(i.preventDefault?i.preventDefault():i.returnValue=!1),(34!==s&&39!==s||a)&&(33!==s&&37!==s||!a)||t.slideNext(),(33!==s&&37!==s||a)&&(34!==s&&39!==s||!a)||t.slidePrev()):(33!==s&&34!==s&&38!==s&&40!==s||(i.preventDefault?i.preventDefault():i.returnValue=!1),34!==s&&40!==s||t.slideNext(),33!==s&&38!==s||t.slidePrev()),t.emit("keyPress",s)}},enable:function(){this.keyboard.enabled||(I(f).on("keydown",this.keyboard.handle),this.keyboard.enabled=!0)},disable:function(){this.keyboard.enabled&&(I(f).off("keydown",this.keyboard.handle),this.keyboard.enabled=!1)}},D={name:"keyboard",params:{keyboard:{enabled:!1,onlyInViewport:!0}},create:function(){te.extend(this,{keyboard:{enabled:!1,enable:L.enable.bind(this),disable:L.disable.bind(this),handle:L.handle.bind(this)}})},on:{init:function(){this.params.keyboard.enabled&&this.keyboard.enable()},destroy:function(){this.keyboard.enabled&&this.keyboard.disable()}}};var O={lastScrollTime:te.now(),event:-1<ee.navigator.userAgent.indexOf("firefox")?"DOMMouseScroll":function(){var e="onwheel",t=e in f;if(!t){var a=f.createElement("div");a.setAttribute(e,"return;"),t="function"==typeof a[e]}return!t&&f.implementation&&f.implementation.hasFeature&&!0!==f.implementation.hasFeature("","")&&(t=f.implementation.hasFeature("Events.wheel","3.0")),t}()?"wheel":"mousewheel",normalize:function(e){var t=0,a=0,i=0,s=0;return"detail"in e&&(a=e.detail),"wheelDelta"in e&&(a=-e.wheelDelta/120),"wheelDeltaY"in e&&(a=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=a,a=0),i=10*t,s=10*a,"deltaY"in e&&(s=e.deltaY),"deltaX"in e&&(i=e.deltaX),(i||s)&&e.deltaMode&&(1===e.deltaMode?(i*=40,s*=40):(i*=800,s*=800)),i&&!t&&(t=i<1?-1:1),s&&!a&&(a=s<1?-1:1),{spinX:t,spinY:a,pixelX:i,pixelY:s}},handleMouseEnter:function(){this.mouseEntered=!0},handleMouseLeave:function(){this.mouseEntered=!1},handle:function(e){var t=e,a=this,i=a.params.mousewheel;if(!a.mouseEntered&&!i.releaseOnEdges)return!0;t.originalEvent&&(t=t.originalEvent);var s=0,r=a.rtlTranslate?-1:1,n=O.normalize(t);if(i.forceToAxis)if(a.isHorizontal()){if(!(Math.abs(n.pixelX)>Math.abs(n.pixelY)))return!0;s=n.pixelX*r}else{if(!(Math.abs(n.pixelY)>Math.abs(n.pixelX)))return!0;s=n.pixelY}else s=Math.abs(n.pixelX)>Math.abs(n.pixelY)?-n.pixelX*r:-n.pixelY;if(0===s)return!0;if(i.invert&&(s=-s),a.params.freeMode){a.params.loop&&a.loopFix();var o=a.getTranslate()+s*i.sensitivity,l=a.isBeginning,d=a.isEnd;if(o>=a.minTranslate()&&(o=a.minTranslate()),o<=a.maxTranslate()&&(o=a.maxTranslate()),a.setTransition(0),a.setTranslate(o),a.updateProgress(),a.updateActiveIndex(),a.updateSlidesClasses(),(!l&&a.isBeginning||!d&&a.isEnd)&&a.updateSlidesClasses(),a.params.freeModeSticky&&(clearTimeout(a.mousewheel.timeout),a.mousewheel.timeout=te.nextTick(function(){a.slideToClosest()},300)),a.emit("scroll",t),a.params.autoplay&&a.params.autoplayDisableOnInteraction&&a.autoplay.stop(),o===a.minTranslate()||o===a.maxTranslate())return!0}else{if(60<te.now()-a.mousewheel.lastScrollTime)if(s<0)if(a.isEnd&&!a.params.loop||a.animating){if(i.releaseOnEdges)return!0}else a.slideNext(),a.emit("scroll",t);else if(a.isBeginning&&!a.params.loop||a.animating){if(i.releaseOnEdges)return!0}else a.slidePrev(),a.emit("scroll",t);a.mousewheel.lastScrollTime=(new ee.Date).getTime()}return t.preventDefault?t.preventDefault():t.returnValue=!1,!1},enable:function(){var e=this;if(!O.event)return!1;if(e.mousewheel.enabled)return!1;var t=e.$el;return"container"!==e.params.mousewheel.eventsTarged&&(t=I(e.params.mousewheel.eventsTarged)),t.on("mouseenter",e.mousewheel.handleMouseEnter),t.on("mouseleave",e.mousewheel.handleMouseLeave),t.on(O.event,e.mousewheel.handle),e.mousewheel.enabled=!0},disable:function(){var e=this;if(!O.event)return!1;if(!e.mousewheel.enabled)return!1;var t=e.$el;return"container"!==e.params.mousewheel.eventsTarged&&(t=I(e.params.mousewheel.eventsTarged)),t.off(O.event,e.mousewheel.handle),!(e.mousewheel.enabled=!1)}},A={update:function(){var e=this,t=e.params.navigation;if(!e.params.loop){var a=e.navigation,i=a.$nextEl,s=a.$prevEl;s&&0<s.length&&(e.isBeginning?s.addClass(t.disabledClass):s.removeClass(t.disabledClass),s[e.params.watchOverflow&&e.isLocked?"addClass":"removeClass"](t.lockClass)),i&&0<i.length&&(e.isEnd?i.addClass(t.disabledClass):i.removeClass(t.disabledClass),i[e.params.watchOverflow&&e.isLocked?"addClass":"removeClass"](t.lockClass))}},onPrevClick:function(e){e.preventDefault(),this.isBeginning&&!this.params.loop||this.slidePrev()},onNextClick:function(e){e.preventDefault(),this.isEnd&&!this.params.loop||this.slideNext()},init:function(){var e,t,a=this,i=a.params.navigation;(i.nextEl||i.prevEl)&&(i.nextEl&&(e=I(i.nextEl),a.params.uniqueNavElements&&"string"==typeof i.nextEl&&1<e.length&&1===a.$el.find(i.nextEl).length&&(e=a.$el.find(i.nextEl))),i.prevEl&&(t=I(i.prevEl),a.params.uniqueNavElements&&"string"==typeof i.prevEl&&1<t.length&&1===a.$el.find(i.prevEl).length&&(t=a.$el.find(i.prevEl))),e&&0<e.length&&e.on("click",a.navigation.onNextClick),t&&0<t.length&&t.on("click",a.navigation.onPrevClick),te.extend(a.navigation,{$nextEl:e,nextEl:e&&e[0],$prevEl:t,prevEl:t&&t[0]}))},destroy:function(){var e=this,t=e.navigation,a=t.$nextEl,i=t.$prevEl;a&&a.length&&(a.off("click",e.navigation.onNextClick),a.removeClass(e.params.navigation.disabledClass)),i&&i.length&&(i.off("click",e.navigation.onPrevClick),i.removeClass(e.params.navigation.disabledClass))}},H={update:function(){var e=this,t=e.rtl,s=e.params.pagination;if(s.el&&e.pagination.el&&e.pagination.$el&&0!==e.pagination.$el.length){var r,a=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:e.slides.length,i=e.pagination.$el,n=e.params.loop?Math.ceil((a-2*e.loopedSlides)/e.params.slidesPerGroup):e.snapGrid.length;if(e.params.loop?((r=Math.ceil((e.activeIndex-e.loopedSlides)/e.params.slidesPerGroup))>a-1-2*e.loopedSlides&&(r-=a-2*e.loopedSlides),n-1<r&&(r-=n),r<0&&"bullets"!==e.params.paginationType&&(r=n+r)):r=void 0!==e.snapIndex?e.snapIndex:e.activeIndex||0,"bullets"===s.type&&e.pagination.bullets&&0<e.pagination.bullets.length){var o,l,d,p=e.pagination.bullets;if(s.dynamicBullets&&(e.pagination.bulletSize=p.eq(0)[e.isHorizontal()?"outerWidth":"outerHeight"](!0),i.css(e.isHorizontal()?"width":"height",e.pagination.bulletSize*(s.dynamicMainBullets+4)+"px"),1<s.dynamicMainBullets&&void 0!==e.previousIndex&&(e.pagination.dynamicBulletIndex+=r-e.previousIndex,e.pagination.dynamicBulletIndex>s.dynamicMainBullets-1?e.pagination.dynamicBulletIndex=s.dynamicMainBullets-1:e.pagination.dynamicBulletIndex<0&&(e.pagination.dynamicBulletIndex=0)),o=r-e.pagination.dynamicBulletIndex,d=((l=o+(Math.min(p.length,s.dynamicMainBullets)-1))+o)/2),p.removeClass(s.bulletActiveClass+" "+s.bulletActiveClass+"-next "+s.bulletActiveClass+"-next-next "+s.bulletActiveClass+"-prev "+s.bulletActiveClass+"-prev-prev "+s.bulletActiveClass+"-main"),1<i.length)p.each(function(e,t){var a=I(t),i=a.index();i===r&&a.addClass(s.bulletActiveClass),s.dynamicBullets&&(o<=i&&i<=l&&a.addClass(s.bulletActiveClass+"-main"),i===o&&a.prev().addClass(s.bulletActiveClass+"-prev").prev().addClass(s.bulletActiveClass+"-prev-prev"),i===l&&a.next().addClass(s.bulletActiveClass+"-next").next().addClass(s.bulletActiveClass+"-next-next"))});else if(p.eq(r).addClass(s.bulletActiveClass),s.dynamicBullets){for(var c=p.eq(o),u=p.eq(l),h=o;h<=l;h+=1)p.eq(h).addClass(s.bulletActiveClass+"-main");c.prev().addClass(s.bulletActiveClass+"-prev").prev().addClass(s.bulletActiveClass+"-prev-prev"),u.next().addClass(s.bulletActiveClass+"-next").next().addClass(s.bulletActiveClass+"-next-next")}if(s.dynamicBullets){var v=Math.min(p.length,s.dynamicMainBullets+4),f=(e.pagination.bulletSize*v-e.pagination.bulletSize)/2-d*e.pagination.bulletSize,m=t?"right":"left";p.css(e.isHorizontal()?m:"top",f+"px")}}if("fraction"===s.type&&(i.find("."+s.currentClass).text(s.formatFractionCurrent(r+1)),i.find("."+s.totalClass).text(s.formatFractionTotal(n))),"progressbar"===s.type){var g;g=s.progressbarOpposite?e.isHorizontal()?"vertical":"horizontal":e.isHorizontal()?"horizontal":"vertical";var b=(r+1)/n,w=1,y=1;"horizontal"===g?w=b:y=b,i.find("."+s.progressbarFillClass).transform("translate3d(0,
4400,0) scaleX("+w+") scaleY("+y+")").transition(e.params.speed)}"custom"===s.type&&s.renderCustom?(i.html(s.renderCustom(e,r+1,n)),e.emit("paginationRender",e,i[0])):e.emit("paginationUpdate",e,i[0]),i[e.params.watchOverflow&&e.isLocked?"addClass":"removeClass"](s.lockClass)}},render:function(){var e=this,t=e.params.pagination;if(t.el&&e.pagination.el&&e.pagination.$el&&0!==e.pagination.$el.length){var a=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:e.slides.length,i=e.pagination.$el,s="";if("bullets"===t.type){for(var r=e.params.loop?Math.ceil((a-2*e.loopedSlides)/e.params.slidesPerGroup):e.snapGrid.length,n=0;n<r;n+=1)t.renderBullet?s+=t.renderBullet.call(e,n,t.bulletClass):s+="<"+t.bulletElement+' class="'+t.bulletClass+'"></'+t.bulletElement+">";i.html(s),e.pagination.bullets=i.find("."+t.bulletClass)}"fraction"===t.type&&(s=t.renderFraction?t.renderFraction.call(e,t.currentClass,t.totalClass):'<span class="'+t.currentClass+'"></span> / <span class="'+t.totalClass+'"></span>',i.html(s)),"progressbar"===t.type&&(s=t.renderProgressbar?t.renderProgressbar.call(e,t.progressbarFillClass):'<span class="'+t.progressbarFillClass+'"></span>',i.html(s)),"custom"!==t.type&&e.emit("paginationRender",e.pagination.$el[0])}},init:function(){var a=this,e=a.params.pagination;if(e.el){var t=I(e.el);0!==t.length&&(a.params.uniqueNavElements&&"string"==typeof e.el&&1<t.length&&1===a.$el.find(e.el).length&&(t=a.$el.find(e.el)),"bullets"===e.type&&e.clickable&&t.addClass(e.clickableClass),t.addClass(e.modifierClass+e.type),"bullets"===e.type&&e.dynamicBullets&&(t.addClass(""+e.modifierClass+e.type+"-dynamic"),a.pagination.dynamicBulletIndex=0,e.dynamicMainBullets<1&&(e.dynamicMainBullets=1)),"progressbar"===e.type&&e.progressbarOpposite&&t.addClass(e.progressbarOppositeClass),e.clickable&&t.on("click","."+e.bulletClass,function(e){e.preventDefault();var t=I(this).index()*a.params.slidesPerGroup;a.params.loop&&(t+=a.loopedSlides),a.slideTo(t)}),te.extend(a.pagination,{$el:t,el:t[0]}))}},destroy:function(){var e=this,t=e.params.pagination;if(t.el&&e.pagination.el&&e.pagination.$el&&0!==e.pagination.$el.length){var a=e.pagination.$el;a.removeClass(t.hiddenClass),a.removeClass(t.modifierClass+t.type),e.pagination.bullets&&e.pagination.bullets.removeClass(t.bulletActiveClass),t.clickable&&a.off("click","."+t.bulletClass)}}},G={setTranslate:function(){var e=this;if(e.params.scrollbar.el&&e.scrollbar.el){var t=e.scrollbar,a=e.rtlTranslate,i=e.progress,s=t.dragSize,r=t.trackSize,n=t.$dragEl,o=t.$el,l=e.params.scrollbar,d=s,p=(r-s)*i;a?0<(p=-p)?(d=s-p,p=0):r<-p+s&&(d=r+p):p<0?(d=s+p,p=0):r<p+s&&(d=r-p),e.isHorizontal()?(ae.transforms3d?n.transform("translate3d("+p+"px, 0, 0)"):n.transform("translateX("+p+"px)"),n[0].style.width=d+"px"):(ae.transforms3d?n.transform("translate3d(0px, "+p+"px, 0)"):n.transform("translateY("+p+"px)"),n[0].style.height=d+"px"),l.hide&&(clearTimeout(e.scrollbar.timeout),o[0].style.opacity=1,e.scrollbar.timeout=setTimeout(function(){o[0].style.opacity=0,o.transition(400)},1e3))}},setTransition:function(e){this.params.scrollbar.el&&this.scrollbar.el&&this.scrollbar.$dragEl.transition(e)},updateSize:function(){var e=this;if(e.params.scrollbar.el&&e.scrollbar.el){var t=e.scrollbar,a=t.$dragEl,i=t.$el;a[0].style.width="",a[0].style.height="";var s,r=e.isHorizontal()?i[0].offsetWidth:i[0].offsetHeight,n=e.size/e.virtualSize,o=n*(r/e.size);s="auto"===e.params.scrollbar.dragSize?r*n:parseInt(e.params.scrollbar.dragSize,10),e.isHorizontal()?a[0].style.width=s+"px":a[0].style.height=s+"px",i[0].style.display=1<=n?"none":"",e.params.scrollbar.hide&&(i[0].style.opacity=0),te.extend(t,{trackSize:r,divider:n,moveDivider:o,dragSize:s}),t.$el[e.params.watchOverflow&&e.isLocked?"addClass":"removeClass"](e.params.scrollbar.lockClass)}},getPointerPosition:function(e){return this.isHorizontal()?"touchstart"===e.type||"touchmove"===e.type?e.targetTouches[0].pageX:e.pageX||e.clientX:"touchstart"===e.type||"touchmove"===e.type?e.targetTouches[0].pageY:e.pageY||e.clientY},setDragPosition:function(e){var t,a=this,i=a.scrollbar,s=a.rtlTranslate,r=i.$el,n=i.dragSize,o=i.trackSize,l=i.dragStartPos;t=(i.getPointerPosition(e)-r.offset()[a.isHorizontal()?"left":"top"]-(null!==l?l:n/2))/(o-n),t=Math.max(Math.min(t,1),0),s&&(t=1-t);var d=a.minTranslate()+(a.maxTranslate()-a.minTranslate())*t;a.updateProgress(d),a.setTranslate(d),a.updateActiveIndex(),a.updateSlidesClasses()}
vendor: 9,991 bytes, line 440
440,onDragStart:function(e){var t=this,a=t.params.scrollbar,i=t.scrollbar,s=t.$wrapperEl,r=i.$el,n=i.$dragEl;t.scrollbar.isTouched=!0,t.scrollbar.dragStartPos=e.target===n[0]||e.target===n?i.getPointerPosition(e)-e.target.getBoundingClientRect()[t.isHorizontal()?"left":"top"]:null,e.preventDefault(),e.stopPropagation(),s.transition(100),n.transition(100),i.setDragPosition(e),clearTimeout(t.scrollbar.dragTimeout),r.transition(0),a.hide&&r.css("opacity",1),t.emit("scrollbarDragStart",e)},onDragMove:function(e){var t=this.scrollbar,a=this.$wrapperEl,i=t.$el,s=t.$dragEl;this.scrollbar.isTouched&&(e.preventDefault?e.preventDefault():e.returnValue=!1,t.setDragPosition(e),a.transition(0),i.transition(0),s.transition(0),this.emit("scrollbarDragMove",e))},onDragEnd:function(e){var t=this,a=t.params.scrollbar,i=t.scrollbar.$el;t.scrollbar.isTouched&&(t.scrollbar.isTouched=!1,a.hide&&(clearTimeout(t.scrollbar.dragTimeout),t.scrollbar.dragTimeout=te.nextTick(function(){i.css("opacity",0),i.transition(400)},1e3)),t.emit("scrollbarDragEnd",e),a.snapOnRelease&&t.slideToClosest())},enableDraggable:function(){var e=this;if(e.params.scrollbar.el){var t=e.scrollbar,a=e.touchEventsTouch,i=e.touchEventsDesktop,s=e.params,r=t.$el[0],n=!(!ae.passiveListener||!s.passiveListeners)&&{passive:!1,capture:!1},o=!(!ae.passiveListener||!s.passiveListeners)&&{passive:!0,capture:!1};ae.touch?(r.addEventListener(a.start,e.scrollbar.onDragStart,n),r.addEventListener(a.move,e.scrollbar.onDragMove,n),r.addEventListener(a.end,e.scrollbar.onDragEnd,o)):(r.addEventListener(i.start,e.scrollbar.onDragStart,n),f.addEventListener(i.move,e.scrollbar.onDragMove,n),f.addEventListener(i.end,e.scrollbar.onDragEnd,o))}},disableDraggable:function(){var e=this;if(e.params.scrollbar.el){var t=e.scrollbar,a=e.touchEventsTouch,i=e.touchEventsDesktop,s=e.params,r=t.$el[0],n=!(!ae.passiveListener||!s.passiveListeners)&&{passive:!1,capture:!1},o=!(!ae.passiveListener||!s.passiveListeners)&&{passive:!0,capture:!1};ae.touch?(r.removeEventListener(a.start,e.scrollbar.onDragStart,n),r.removeEventListener(a.move,e.scrollbar.onDragMove,n),r.removeEventListener(a.end,e.scrollbar.onDragEnd,o)):(r.removeEventListener(i.start,e.scrollbar.onDragStart,n),f.removeEventListener(i.move,e.scrollbar.onDragMove,n),f.removeEventListener(i.end,e.scrollbar.onDragEnd,o))}},init:function(){var e=this;if(e.params.scrollbar.el){var t=e.scrollbar,a=e.$el,i=e.params.scrollbar,s=I(i.el);e.params.uniqueNavElements&&"string"==typeof i.el&&1<s.length&&1===a.find(i.el).length&&(s=a.find(i.el));var r=s.find("."+e.params.scrollbar.dragClass);0===r.length&&(r=I('<div class="'+e.params.scrollbar.dragClass+'"></div>'),s.append(r)),te.extend(t,{$el:s,el:s[0],$dragEl:r,dragEl:r[0]}),i.draggable&&t.enableDraggable()}},destroy:function(){this.scrollbar.disableDraggable()}},N={setTransform:function(e,t){var a=this.rtl,i=I(e),s=a?-1:1,r=i.attr("data-swiper-parallax")||"0",n=i.attr("data-swiper-parallax-x"),o=i.attr("data-swiper-parallax-y"),l=i.attr("data-swiper-parallax-scale"),d=i.attr("data-swiper-parallax-opacity");if(n||o?(n=n||"0",o=o||"0"):this.isHorizontal()?(n=r,o="0"):(o=r,n="0"),n=0<=n.indexOf("%")?parseInt(n,10)*t*s+"%":n*t*s+"px",o=0<=o.indexOf("%")?parseInt(o,10)*t+"%":o*t+"px",null!=d){var p=d-(d-1)*(1-Math.abs(t));i[0].style.opacity=p}if(null==l)i.transform("translate3d("+n+", "+o+", 0px)");else{var c=l-(l-1)*(1-Math.abs(t));i.transform("translate3d("+n+", "+o+", 0px) scale("+c+")")}},setTranslate:function(){var i=this,e=i.$el,t=i.slides,s=i.progress,r=i.snapGrid;e.children("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each(function(e,t){i.parallax.setTransform(t,s)}),t.each(function(e,t){var a=t.progress;1<i.params.slidesPerGroup&&"auto"!==i.params.slidesPerView&&(a+=Math.ceil(e/2)-s*(r.length-1)),a=Math.min(Math.max(a,-1),1),I(t).find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each(function(e,t){i.parallax.setTransform(t,a)})})},setTransition:function(s){void 0===s&&(s=this.params.speed);this.$el.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each(function(e,t){var a=I(t),i=parseInt(a.attr("data-swiper-parallax-duration"),10)||s;0===s&&(i=0),a.transition(i)})}},B={getDistanceBetweenTouches:function(e){if(e.targetTouches.length<2)return 1;var t=e.targetTouches[0].pageX,a=e.targetTouches[0].pageY,i=e.targetTouches[1].pageX,s=e.targetTouches[1].pageY;return Math.sqrt(Math.pow(i-t,2)+Math.pow(s-a,2))},onGestureStart:function(e){var t=this,a=t.params.zoom,i=t.zoom,s=i.gesture;if(i.fakeGestureTouched=!1,i.fakeGestureMoved=!1,!ae.gestures){if("touchstart"!==e.type||"touchstart"===e.type&&e.targetTouches.length<2)return;i.fakeGestureTouched=!0,s.scaleStart=B.getDistanceBetweenTouches(e)}s.$slideEl&&s.$slideEl.length||(s.$slideEl=I(e.target).closest(".swiper-slide"),0===s.$slideEl.length&&(s.$slideEl=t.slides.eq(t.activeIndex)),s.$imageEl=s.$slideEl.find("img, svg, canvas"),s.$imageWrapEl=s.$imageEl.parent("."+a.containerClass),s.maxRatio=s.$imageWrapEl.attr("data-swiper-zoom")||a.maxRatio,0!==s.$imageWrapEl.length)?(s.$imageEl.transition(0),t.zoom.isScaling=!0):s.$imageEl=void 0},onGestureChange:function(e){var t=this.params.zoom,a=this.zoom,i=a.gesture;if(!ae.gestures){if("touchmove"!==e.type||"touchmove"===e.type&&e.targetTouches.length<2)return;a.fakeGestureMoved=!0,i.scaleMove=B.getDistanceBetweenTouches(e)}i.$imageEl&&0!==i.$imageEl.length&&(a.scale=ae.gestures?e.scale*a.currentScale:i.scaleMove/i.scaleStart*a.currentScale,a.scale>i.maxRatio&&(a.scale=i.maxRatio-1+Math.pow(a.scale-i.maxRatio+1,.5)),a.scale<t.minRatio&&(a.scale=t.minRatio+1-Math.pow(t.minRatio-a.scale+1,.5)),i.$imageEl.transform("translate3d(0,0,0) scale("+a.scale+")"))},onGestureEnd:function(e){var t=this.params.zoom,a=this.zoom,i=a.gesture;if(!ae.gestures){if(!a.fakeGestureTouched||!a.fakeGestureMoved)return;if("touchend"!==e.type||"touchend"===e.type&&e.changedTouches.length<2&&!g.android)return;a.fakeGestureTouched=!1,a.fakeGestureMoved=!1}i.$imageEl&&0!==i.$imageEl.length&&(a.scale=Math.max(Math.min(a.scale,i.maxRatio),t.minRatio),i.$imageEl.transition(this.params.speed).transform("translate3d(0,0,0) scale("+a.scale+")"),a.currentScale=a.scale,a.isScaling=!1,1===a.scale&&(i.$slideEl=void 0))},onTouchStart:function(e){var t=this.zoom,a=t.gesture,i=t.image;a.$imageEl&&0!==a.$imageEl.length&&(i.isTouched||(g.android&&e.preventDefault(),i.isTouched=!0,i.touchesStart.x="touchstart"===e.type?e.targetTouches[0].pageX:e.pageX,i.touchesStart.y="touchstart"===e.type?e.targetTouches[0].pageY:e.pageY))},onTouchMove:function(e){var t=this,a=t.zoom,i=a.gesture,s=a.image,r=a.velocity;if(i.$imageEl&&0!==i.$imageEl.length&&(t.allowClick=!1,s.isTouched&&i.$slideEl)){s.isMoved||(s.width=i.$imageEl[0].offsetWidth,s.height=i.$imageEl[0].offsetHeight,s.startX=te.getTranslate(i.$imageWrapEl[0],"x")||0,s.startY=te.getTranslate(i.$imageWrapEl[0],"y")||0,i.slideWidth=i.$slideEl[0].offsetWidth,i.slideHeight=i.$slideEl[0].offsetHeight,i.$imageWrapEl.transition(0),t.rtl&&(s.startX=-s.startX,s.startY=-s.startY));var n=s.width*a.scale,o=s.height*a.scale;if(!(n<i.slideWidth&&o<i.slideHeight)){if(s.minX=Math.min(i.slideWidth/2-n/2,0),s.maxX=-s.minX,s.minY=Math.min(i.slideHeight/2-o/2,0),s.maxY=-s.minY,s.touchesCurrent.x="touchmove"===e.type?e.targetTouches[0].pageX:e.pageX,s.touchesCurrent.y="touchmove"===e.type?e.targetTouches[0].pageY:e.pageY,!s.isMoved&&!a.isScaling){if(t.isHorizontal()&&(Math.floor(s.minX)===Math.floor(s.startX)&&s.touchesCurrent.x<s.touchesStart.x||Math.floor(s.maxX)===Math.floor(s.startX)&&s.touchesCurrent.x>s.touchesStart.x))return void(s.isTouched=!1);if(!t.isHorizontal()&&(Math.floor(s.minY)===Math.floor(s.startY)&&s.touchesCurrent.y<s.touchesStart.y||Math.floor(s.maxY)===Math.floor(s.startY)&&s.touchesCurrent.y>s.touchesStart.y))return void(s.isTouched=!1)}e.preventDefault(),e.stopPropagation(),s.isMoved=!0,s.currentX=s.touchesCurrent.x-s.touchesStart.x+s.startX,s.currentY=s.touchesCurrent.y-s.touchesStart.y+s.startY,s.currentX<s.minX&&(s.currentX=s.minX+1-Math.pow(s.minX-s.currentX+1,.8)),s.currentX>s.maxX&&(s.currentX=s.maxX-1+Math.pow(s.currentX-s.maxX+1,.8)),s.currentY<s.minY&&(s.currentY=s.minY+1-Math.pow(s.minY-s.currentY+1,.8)),s.currentY>s.maxY&&(s.currentY=s.maxY-1+Math.pow(s.currentY-s.maxY+1,.8)),r.prevPositionX||(r.prevPositionX=s.touchesCurrent.x),r.prevPositionY||(r.prevPositionY=s.touchesCurrent.y),r.prevTime||(r.prevTime=Date.now()),r.x=(s.touchesCurrent.x-r.prevPositionX)/(Date.now()-r.prevTime)/2,r.y=(s.touchesCurrent.y-r.prevPositionY)/(Date.now()-r.prevTime)/2,Math.abs(s.touchesCurrent.x-r.prevPositionX)<2&&(r.x=0),Math.abs(s.touchesCurrent.y-r.prevPositionY)<2&&(r.y=0),r.prevPositionX=s.touchesCurrent.x,r.prevPositionY=s.touchesCurrent.y,r.prevTime=Date.now(),i.$imageWrapEl.transform("translate3d("+s.currentX+"px, "+s.currentY+"px,0)")}}},onTouchEnd:function(){var e=this.zoom,t=e.gesture,a=e.image,i=e.velocity;if(t.$imageEl&&0!==t.$imageEl.length){if(!a.isTouched||!a.isMoved)return a.isTouched=!1,void(a.isMoved=!1);a.isTouched=!1,a.isMoved=!1;var s=300,r=300,n=i.x*s,o=a.currentX+n,l=i.y*r,d=a.currentY+l;0!==i.x&&(s=Math.abs((o-a.currentX)/i.x)),0!==i.y&&(r=Math.abs((d-a.currentY)/i.y));var p=Math.max(s,r);a.currentX=o,a.currentY=d;var c=a.width*e.scale,u=a.height*e.scale;a.minX=Math.min(t.slideWidth/2-c/2,0),a.maxX=-a.minX,a.minY=Math.min(t.slideHeight/2-u/2,0),a.maxY=-a.minY,a.currentX=Math.max(Math.min(a.currentX,a.maxX),a.minX),a.currentY=Math.max(Math.min(a.currentY,a.maxY),a.minY),t.$imageWrapEl.transition(p).transform("translate3d("+a.currentX+"px, "+a.currentY+"px,0)")}},onTransitionEnd:function(){var e=this.zoom,t=e.gesture;t.$slideEl&&this.previousIndex!==this.activeIndex&&(t.$imageEl.transform("translate3d(0,
4400,0) scale(1)"),t.$imageWrapEl.transform("translate3d(0,0,0)"),e.scale=1,e.currentScale=1,t.$slideEl=void 0,t.$imageEl=void 0,t.$imageWrapEl=void 0)},toggle:function(e){var t=this.zoom;t.scale&&1!==t.scale?t.out():t.in(e)},in:function(e){var t,a,i,s,r,n,o,l,d,p,c,u,h,v,f,m,g=this,b=g.zoom,w=g.params.zoom,y=b.gesture,x=b.image;y.$slideEl||(y.$slideEl=g.clickedSlide?I(g.clickedSlide):g.slides.eq(g.activeIndex),y.$imageEl=y.$slideEl.find("img, svg, canvas"),y.$imageWrapEl=y.$imageEl.parent("."+w.containerClass)),y.$imageEl&&0!==y.$imageEl.length&&(y.$slideEl.addClass(""+w.zoomedSlideClass),a=void 0===x.touchesStart.x&&e?(t="touchend"===e.type?e.changedTouches[0].pageX:e.pageX,"touchend"===e.type?e.changedTouches[0].pageY:e.pageY):(t=x.touchesStart.x,x.touchesStart.y),b.scale=y.$imageWrapEl.attr("data-swiper-zoom")||w.maxRatio,b.currentScale=y.$imageWrapEl.attr("data-swiper-zoom")||w.maxRatio,e?(f=y.$slideEl[0].offsetWidth,m=y.$slideEl[0].offsetHeight,i=y.$slideEl.offset().left+f/2-t,s=y.$slideEl.offset().top+m/2-a,o=y.$imageEl[0].offsetWidth,l=y.$imageEl[0].offsetHeight,d=o*b.scale,p=l*b.scale,h=-(c=Math.min(f/2-d/2,0)),v=-(u=Math.min(m/2-p/2,0)),(r=i*b.scale)<c&&(r=c),h<r&&(r=h),(n=s*b.scale)<u&&(n=u),v<n&&(n=v)):n=r=0,y.$imageWrapEl.transition(300).transform("translate3d("+r+"px, "+n+"px,0)"),y.$imageEl.transition(300).transform("translate3d(0,0,0) scale("+b.scale+")"))},out:function(){var e=this,t=e.zoom,a=e.params.zoom,i=t.gesture;i.$slideEl||(i.$slideEl=e.clickedSlide?I(e.clickedSlide):e.slides.eq(e.activeIndex),i.$imageEl=i.$slideEl.find("img, svg, canvas"),i.$imageWrapEl=i.$imageEl.parent("."+a.containerClass)),i.$imageEl&&0!==i.$imageEl.length&&(t.scale=1,t.currentScale=1,i.$imageWrapEl.transition(300).transform("translate3d(0,0,0)"),i.$imageEl.transition(300).transform("translate3d(0,0,0) scale(1)"),i.$slideEl.removeClass(""+a.zoomedSlideClass),i.$slideEl=void 0)},enable:function(){var e=this,t=e.zoom;if(!t.enabled){t.enabled=!0;var a=!("touchstart"!==e.touchEvents.start||!ae.passiveListener||!e.params.passiveListeners)&&{passive:!0,capture:!1};ae.gestures?(e.$wrapperEl.on("gesturestart",".swiper-slide",t.onGestureStart,a),e.$wrapperEl.on("gesturechange",".swiper-slide",t.onGestureChange,a),e.$wrapperEl.on("gestureend",".swiper-slide",t.onGestureEnd,a)):"touchstart"===e.touchEvents.start&&(e.$wrapperEl.on(e.touchEvents.start,".swiper-slide",t.onGestureStart,a),e.$wrapperEl.on(e.touchEvents.move,".swiper-slide",t.onGestureChange,a),e.$wrapperEl.on(e.touchEvents.end,".swiper-slide",t.onGestureEnd,a)),e.$wrapperEl.on(e.touchEvents.move,"."+e.params.zoom.containerClass,t.onTouchMove)}},disable:function(){var e=this,t=e.zoom;if(t.enabled){e.zoom.enabled=!1;var a=!("touchstart"!==e.touchEvents.start||!ae.passiveListener||!e.params.passiveListeners)&&{passive:!0,capture:!1};ae.gestures?(e.$wrapperEl.off("gesturestart",".swiper-slide",t.onGestureStart,a),e.$wrapperEl.off("gesturechange",".swiper-slide",t.onGestureChange,a),e.$wrapperEl.off("gestureend",".swiper-slide",t.onGestureEnd,a)):"touchstart"===e.touchEvents.start&&(e.$wrapperEl.off(e.touchEvents.start,".swiper-slide",t.onGestureStart,a),e.$wrapperEl.off(e.touchEvents.move,".swiper-slide",t.onGestureChange,a),e.$wrapperEl.off(e.touchEvents.end,".swiper-slide",t.onGestureEnd,a)),e.$wrapperEl.off(e.touchEvents.move,"."+e.params.zoom.containerClass,t.onTouchMove)}}},X={loadInSlide:function(e,l){void 0===l&&(l=!0);var d=this,p=d.params.lazy;if(void 0!==e&&0!==d.slides.length){var c=d.virtual&&d.params.virtual.enabled?d.$wrapperEl.children("."+d.params.slideClass+'[data-swiper-slide-index="'+e+'"]'):d.slides.eq(e),t=c.find("."+p.elementClass+":not(."+p.loadedClass+"):not(."+p.loadingClass+")");!c.hasClass(p.elementClass)||c.hasClass(p.loadedClass)||c.hasClass(p.loadingClass)||(t=t.add(c[0])),0!==t.length&&t.each(function(e,t){var i=I(t);i.addClass(p.loadingClass);var s=i.attr("data-background"),r=i.attr("data-src"),n=i.attr("data-srcset"),o=i.attr("data-sizes");d.loadImage(i[0],r||s,n,o,!1,function(){if(null!=d&&d&&(!d||d.params)&&!d.destroyed){if(s?(i.css("background-image",'url("'+s+'")'),i.removeAttr("data-background")):(n&&(i.attr("srcset",n
vendor: 5,170 bytes, line 440
440),i.removeAttr("data-srcset")),o&&(i.attr("sizes",o),i.removeAttr("data-sizes")),r&&(i.attr("src",r),i.removeAttr("data-src"))),i.addClass(p.loadedClass).removeClass(p.loadingClass),c.find("."+p.preloaderClass).remove(),d.params.loop&&l){var e=c.attr("data-swiper-slide-index");if(c.hasClass(d.params.slideDuplicateClass)){var t=d.$wrapperEl.children('[data-swiper-slide-index="'+e+'"]:not(.'+d.params.slideDuplicateClass+")");d.lazy.loadInSlide(t.index(),!1)}else{var a=d.$wrapperEl.children("."+d.params.slideDuplicateClass+'[data-swiper-slide-index="'+e+'"]');d.lazy.loadInSlide(a.index(),!1)}}d.emit("lazyImageReady",c[0],i[0])}}),d.emit("lazyImageLoad",c[0],i[0])})}},load:function(){var i=this,t=i.$wrapperEl,a=i.params,s=i.slides,e=i.activeIndex,r=i.virtual&&a.virtual.enabled,n=a.lazy,o=a.slidesPerView;function l(e){if(r){if(t.children("."+a.slideClass+'[data-swiper-slide-index="'+e+'"]').length)return!0}else if(s[e])return!0;return!1}function d(e){return r?I(e).attr("data-swiper-slide-index"):I(e).index()}if("auto"===o&&(o=0),i.lazy.initialImageLoaded||(i.lazy.initialImageLoaded=!0),i.params.watchSlidesVisibility)t.children("."+a.slideVisibleClass).each(function(e,t){var a=r?I(t).attr("data-swiper-slide-index"):I(t).index();i.lazy.loadInSlide(a)});else if(1<o)for(var p=e;p<e+o;p+=1)l(p)&&i.lazy.loadInSlide(p);else i.lazy.loadInSlide(e);if(n.loadPrevNext)if(1<o||n.loadPrevNextAmount&&1<n.loadPrevNextAmount){for(var c=n.loadPrevNextAmount,u=o,h=Math.min(e+u+Math.max(c,u),s.length),v=Math.max(e-Math.max(u,c),0),f=e+o;f<h;f+=1)l(f)&&i.lazy.loadInSlide(f);for(var m=v;m<e;m+=1)l(m)&&i.lazy.loadInSlide(m)}else{var g=t.children("."+a.slideNextClass);0<g.length&&i.lazy.loadInSlide(d(g));var b=t.children("."+a.slidePrevClass);0<b.length&&i.lazy.loadInSlide(d(b))}}},V={LinearSpline:function(e,t){var a,i,s,r,n,o=function(e,t){for(i=-1,a=e.length;1<a-i;)e[s=a+i>>1]<=t?i=s:a=s;return a};return this.x=e,this.y=t,this.lastIndex=e.length-1,this.interpolate=function(e){return e?(n=o(this.x,e),r=n-1,(e-this.x[r])*(this.y[n]-this.y[r])/(this.x[n]-this.x[r])+this.y[r]):0},this},getInterpolateFunction:function(e){var t=this;t.controller.spline||(t.controller.spline=t.params.loop?new V.LinearSpline(t.slidesGrid,e.slidesGrid):new V.LinearSpline(t.snapGrid,e.snapGrid))},setTranslate:function(e,t){var a,i,s=this,r=s.controller.control;function n(e){var t=s.rtlTranslate?-s.translate:s.translate;"slide"===s.params.controller.by&&(s.controller.getInterpolateFunction(e),i=-s.controller.spline.interpolate(-t)),i&&"container"!==s.params.controller.by||(a=(e.maxTranslate()-e.minTranslate())/(s.maxTranslate()-s.minTranslate()),i=(t-s.minTranslate())*a+e.minTranslate()),s.params.controller.inverse&&(i=e.maxTranslate()-i),e.updateProgress(i),e.setTranslate(i,s),e.updateActiveIndex(),e.updateSlidesClasses()}if(Array.isArray(r))for(var o=0;o<r.length;o+=1)r[o]!==t&&r[o]instanceof T&&n(r[o]);else r instanceof T&&t!==r&&n(r)},setTransition:function(t,e){var a,i=this,s=i.controller.control;function r(e){e.setTransition(t,i),0!==t&&(e.transitionStart(),e.params.autoHeight&&te.nextTick(function(){e.updateAutoHeight()}),e.$wrapperEl.transitionEnd(function(){s&&(e.params.loop&&"slide"===i.params.controller.by&&e.loopFix(),e.transitionEnd())}))}if(Array.isArray(s))for(a=0;a<s.length;a+=1)s[a]!==e&&s[a]instanceof T&&r(s[a]);else s instanceof T&&e!==s&&r(s)}},Y={makeElFocusable:function(e){return e.attr("tabIndex","0"),e},addElRole:function(e,t){return e.attr("role",t),e},addElLabel:function(e,t){return e.attr("aria-label",t),e},disableEl:function(e){return e.attr("aria-disabled",!0),e},enableEl:function(e){return e.attr("aria-disabled",!1),e},onEnterKey:function(e){var t=this,a=t.params.a11y;if(13===e.keyCode){var i=I(e.target);t.navigation&&t.navigation.$nextEl&&i.is(t.navigation.$nextEl)&&(t.isEnd&&!t.params.loop||t.slideNext(),t.isEnd?t.a11y.notify(a.lastSlideMessage):t.a11y.notify(a.nextSlideMessage)),t.navigation&&t.navigation.$prevEl&&i.is(t.navigation.$prevEl)&&(t.isBeginning&&!t.params.loop||t.slidePrev(),t.isBeginning?t.a11y.notify(a.firstSlideMessage):t.a11y.notify(a.prevSlideMessage)),t.pagination&&i.is("."+t.params.pagination.bulletClass)&&i[0].click()}},notify:function(e){var t=this.a11y.liveRegion;0!==t.length&&(t.html(""),t.html(e))},updateNavigation:function(){var e=this;if(!e.params.loop){var t=e.navigation,a=t.$nextEl,i=t.$prevEl;i&&0<i.length&&(e.isBeginning?e.a11y.disableEl(i):e.a11y.enableEl(i)),a&&0<a.length&&(e.isEnd?e.a11y.disableEl(a):e.a11y.enableEl(a))}},updatePagination:function(){var i=this,s=i.params.a11y;i.pagination&&i.params.pagination.clickable&&i.pagination.bullets&&i.pagination.bullets.length&&i.pagination.bullets.each(function(e,t){var a=I(t);i.a11y.makeElFocusable(a),i.a11y.addElRole(a,"button"),i.a11y.addElLabel(a,s.paginationBulletMessage.replace(/{{index}}/,a.index()+1))})},init:function(){var e=this;e.$el.append(e.a11y.liveRegion);var t,a,i=e.params.a11y;e.navigation&&e.navigation.$nextEl&&(t=e.navigation.$nextEl),e.navigation&&e.navigation.$prevEl&&(a=e.navigation.$prevEl),t&&(e.a11y.makeElFocusable(t),e.a11y.addElRole(t,"button"),e.a11y.addElLabel(t,i.nextSlideMessage),t.on("key
440down",e.a11y.onEnterKey)),a&&(e.a11y.makeElFocusable(a),e.a11y.addElRole(a,"button"),e.a11y.addElLabel(a,i.prevSlideMessage),a.on("keydown",e.a11y.onEnterKey)),e.pagination&&e.params.pagination.clickable&&e.pagination.bullets&&e.pagination.bullets.length&&e.pagination.$el.on("keydown","."+e.params.pagination.bulletClass,e.a11y.onEnterKey)},destroy:function(){var e,t,a=this;a.a11y.liveRegion&&0<a.a11y.liveRegion.length&&a.a11y.liveRegion.remove(),a.navigation&&a.navigation.$nextEl&&(e=a.navigation.$nextEl),a.navigation&&a.navigation.$prevEl&&(t=a.navigation.$prevEl),e&&e.off("keydown",a.a11y.onEnterKey),t&&t.off("keydown",a.a11y.onEnterKey),a.pagination&&a.params.pagination.clickable&&a.pagination.bullets&&a.pagination.bullets.length&&a.pagination.$el.off("keydown","."+a.params.pagination.bulletClass,a.a11y.onEnterKey)}},F={init:function(){var e=this;if(e.params.history){if(!ee.history||!ee.history.pushState)return e.params.history.enabled=!1,void(e.params.hashNavigation.enabled=!0);var t=e.history;t.initialized=!0,t.paths=F.getPathValues(),(t.paths.key||t.paths.value)&&(t.scrollToSlide(0,t.paths.value,e.params.runCallbacksOnInit),e.params.history.replaceState||ee.addEventListener("popstate",e.history.setHistoryPopState))}},destroy:function(){this.params.history.replaceState||ee.removeEventListener("popstate",this.history.setHistoryPopState)},setHistoryPopState:function(){this.history.paths=F.getPathValues(),this.history.scrollToSlide(this.params.speed,this.history.paths.value,!1)},getPathValues:function(){var e=ee.location.pathname.slice(1).split("/").filter(function(e){return""!==e}),t=e.length;return{key:e[t-2],value:e[t-1]}},setHistory:function(e,t){if(this.history.initialized&&this.params.history.enabled){var a=this.slides.eq(t),i=F.slugify(a.attr("data-history"));ee.location.pathname.includes(e)||(i=e+"/"+i);var s=ee.history.state;s&&s.value===i||(this.params.history.replaceState?ee.history.replaceState({value:i},null,i):ee.history.pushState({value:i},null,i))}},slugify:function(e){return e.toString().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,"")},scrollToSlide:function(e,t,a){var i=this;if(t)for(var s=0,r=i.slides.length;s<r;s+=1){var n=i.slides.eq(s);if(F.slugify(n.attr("data-history"))===t&&!n.hasClass(i.params.slideDuplicateClass)){var o=n.index();i.slideTo(o,e,a)}}else i.slideTo(0,e,a)}},R={onHashCange:function(){var e=this,t=f.location.hash.replace("#","");if(t!==e.slides.eq(e.activeIndex).attr("data-hash")){var a=e.$wrapperEl.children("."+e.params.slideClass+'[data-hash="'+t+'"]').index();if(void 0===a)return;e.slideTo(a)}},setHash:function(){var e=this;if(e.hashNavigation.initialized&&e.params.hashNavigation.enabled)if(e.params.hashNavigation.replaceState&&ee.history&&ee.history.replaceState)ee.history.replaceState(null,null,"#"+e.slides.eq(e.activeIndex).attr("data-hash")||"");else{var t=e.slides.eq(e.activeIndex),a=t.attr("data-hash")||t.attr("data-history");f.location.hash=a||""}},init:function(){var e=this;if(!(!e.params.hashNavigation.enabled||e.params.history&&e.params.history.enabled)){e.hashNavigation.initialized=!0;var t=f.location.hash.replace("#","");if(t)for(var a=0,i=e.slides.length;a<i;a+=1){var s=e.slides.eq(a);if((s.attr("data-hash")||s.attr("data-history"))===t&&!s.hasClass(e.params.slideDuplicateClass)){var r=s.index();e.slideTo(r,0,e.params.runCallbacksOnInit,!0)}}e.params.hashNavigation.watchState&&I(ee).on("hashchange",e.hashNavigation.onHashCange)}},destroy:function(){this.params.hashNavigation.watchState&&I(ee).off("hashchange",this.hashNavigation.onHashCange)}},q={run:function(){var e=this,t=e.slides.eq(e.activeIndex),a=e.params.autoplay.delay;t.attr("data-swiper-autoplay")&&(a=t.attr("data-swiper-autoplay")||e.params.autoplay.delay),clearTimeout(e.autoplay.timeout),e.autoplay.timeout=te.nextTick(function(){e.params.autoplay.reverseDirection?e.params.loop?(e.loopFix(),e.slidePrev(e.params.speed,!0,!0),e.emit("autoplay")):e.isBeginning?e.params.autoplay.stopOnLastSlide?e.autoplay.stop():(e.slideTo(e.slides.length-1,e.params.speed,!0,
vendor: 20,833 bytes, line 440
440!0),e.emit("autoplay")):(e.slidePrev(e.params.speed,!0,!0),e.emit("autoplay")):e.params.loop?(e.loopFix(),e.slideNext(e.params.speed,!0,!0),e.emit("autoplay")):e.isEnd?e.params.autoplay.stopOnLastSlide?e.autoplay.stop():(e.slideTo(0,e.params.speed,!0,!0),e.emit("autoplay")):(e.slideNext(e.params.speed,!0,!0),e.emit("autoplay"))},a)},start:function(){var e=this;return void 0===e.autoplay.timeout&&(!e.autoplay.running&&(e.autoplay.running=!0,e.emit("autoplayStart"),e.autoplay.run(),!0))},stop:function(){var e=this;return!!e.autoplay.running&&(void 0!==e.autoplay.timeout&&(e.autoplay.timeout&&(clearTimeout(e.autoplay.timeout),e.autoplay.timeout=void 0),e.autoplay.running=!1,e.emit("autoplayStop"),!0))},pause:function(e){var t=this;t.autoplay.running&&(t.autoplay.paused||(t.autoplay.timeout&&clearTimeout(t.autoplay.timeout),t.autoplay.paused=!0,0!==e&&t.params.autoplay.waitForTransition?(t.$wrapperEl[0].addEventListener("transitionend",t.autoplay.onTransitionEnd),t.$wrapperEl[0].addEventListener("webkitTransitionEnd",t.autoplay.onTransitionEnd)):(t.autoplay.paused=!1,t.autoplay.run())))}},W={setTranslate:function(){for(var e=this,t=e.slides,a=0;a<t.length;a+=1){var i=e.slides.eq(a),s=-i[0].swiperSlideOffset;e.params.virtualTranslate||(s-=e.translate);var r=0;e.isHorizontal()||(r=s,s=0);var n=e.params.fadeEffect.crossFade?Math.max(1-Math.abs(i[0].progress),0):1+Math.min(Math.max(i[0].progress,-1),0);i.css({opacity:n}).transform("translate3d("+s+"px, "+r+"px, 0px)")}},setTransition:function(e){var a=this,t=a.slides,i=a.$wrapperEl;if(t.transition(e),a.params.virtualTranslate&&0!==e){var s=!1;t.transitionEnd(function(){if(!s&&a&&!a.destroyed){s=!0,a.animating=!1;for(var e=["webkitTransitionEnd","transitionend"],t=0;t<e.length;t+=1)i.trigger(e[t])}})}}},j={setTranslate:function(){var e,t=this,a=t.$el,i=t.$wrapperEl,s=t.slides,r=t.width,n=t.height,o=t.rtlTranslate,l=t.size,d=t.params.cubeEffect,p=t.isHorizontal(),c=t.virtual&&t.params.virtual.enabled,u=0;d.shadow&&(p?(0===(e=i.find(".swiper-cube-shadow")).length&&(e=I('<div class="swiper-cube-shadow"></div>'),i.append(e)),e.css({height:r+"px"})):0===(e=a.find(".swiper-cube-shadow")).length&&(e=I('<div class="swiper-cube-shadow"></div>'),a.append(e)));for(var h=0;h<s.length;h+=1){var v=s.eq(h),f=h;c&&(f=parseInt(v.attr("data-swiper-slide-index"),10));var m=90*f,g=Math.floor(m/360);o&&(m=-m,g=Math.floor(-m/360));var b=Math.max(Math.min(v[0].progress,1),-1),w=0,y=0,x=0;f%4==0?(w=4*-g*l,x=0):(f-1)%4==0?(w=0,x=4*-g*l):(f-2)%4==0?(w=l+4*g*l,x=l):(f-3)%4==0&&(w=-l,x=3*l+4*l*g),o&&(w=-w),p||(y=w,w=0);var T="rotateX("+(p?0:-m)+"deg) rotateY("+(p?m:0)+"deg) translate3d("+w+"px, "+y+"px, "+x+"px)";if(b<=1&&-1<b&&(u=90*f+90*b,o&&(u=90*-f-90*b)),v.transform(T),d.slideShadows){var E=p?v.find(".swiper-slide-shadow-left"):v.find(".swiper-slide-shadow-top"),S=p?v.find(".swiper-slide-shadow-right"):v.find(".swiper-slide-shadow-bottom");0===E.length&&(E=I('<div class="swiper-slide-shadow-'+(p?"left":"top")+'"></div>'),v.append(E)),0===S.length&&(S=I('<div class="swiper-slide-shadow-'+(p?"right":"bottom")+'"></div>'),v.append(S)),E.length&&(E[0].style.opacity=Math.max(-b,0)),S.length&&(S[0].style.opacity=Math.max(b,0))}}if(i.css({"-webkit-transform-origin":"50% 50% -"+l/2+"px","-moz-transform-origin":"50% 50% -"+l/2+"px","-ms-transform-origin":"50% 50% -"+l/2+"px","transform-origin":"50% 50% -"+l/2+"px"}),d.shadow)if(p)e.transform("translate3d(0px, "+(r/2+d.shadowOffset)+"px, "+-r/2+"px) rotateX(90deg) rotateZ(0deg) scale("+d.shadowScale+")");else{var C=Math.abs(u)-90*Math.floor(Math.abs(u)/90),M=1.5-(Math.sin(2*C*Math.PI/360)/2+Math.cos(2*C*Math.PI/360)/2),P=d.shadowScale,k=d.shadowScale/M,z=d.shadowOffset;e.transform("scale3d("+P+", 1, "+k+") translate3d(0px, "+(n/2+z)+"px, "+-n/2/k+"px) rotateX(-90deg)")}var $=ie.isSafari||ie.isUiWebView?-l/2:0;i.transform("translate3d(0px,0,"+$+"px) rotateX("+(t.isHorizontal()?0:u)+"deg) rotateY("+(t.isHorizontal()?-u:0)+"deg)")},setTransition:function(e){var t=this.$el;this.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e),this.params.cubeEffect.shadow&&!this.isHorizontal()&&t.find(".swiper-cube-shadow").transition(e)}},U={setTranslate:function(){for(var e=this,t=e.slides,a=e.rtlTranslate,i=0;i<t.length;i+=1){var s=t.eq(i),r=s[0].progress;e.params.flipEffect.limitRotation&&(r=Math.max(Math.min(s[0].progress,1),-1));var n=-180*r,o=0,l=-s[0].swiperSlideOffset,d=0;if(e.isHorizontal()?a&&(n=-n):(d=l,o=-n,n=l=0),s[0].style.zIndex=-Math.abs(Math.round(r))+t.length,e.params.flipEffect.slideShadows){var p=e.isHorizontal()?s.find(".swiper-slide-shadow-left"):s.find(".swiper-slide-shadow-top"),c=e.isHorizontal()?s.find(".swiper-slide-shadow-right"):s.find(".swiper-slide-shadow-bottom");0===p.length&&(p=I('<div class="swiper-slide-shadow-'+(e.isHorizontal()?"left":"top")+'"></div>'),s.append(p)),0===c.length&&(c=I('<div class="swiper-slide-shadow-'+(e.isHorizontal()?"right":"bottom")+'"></div>'),s.append(c)),p.length&&(p[0].style.opacity=Math.max(-r,0)),c.length&&(c[0].style.opacity=Math.max(r,0))}s.transform("translate3d("+l+"px, "+d+"px, 0px) rotateX("+o+"deg) rotateY("+n+"deg)")}},setTransition:function(e){var a=this,t=a.slides,i=a.activeIndex,s=a.$wrapperEl;if(t.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e),a.params.virtualTranslate&&0!==e){var r=!1;t.eq(i).transitionEnd(function(){if(!r&&a&&!a.destroyed){r=!0,a.animating=!1;for(var e=["webkitTransitionEnd","transitionend"],t=0;t<e.length;t+=1)s.trigger(e[t])}})}}},K={setTranslate:function(){for(var e=this,t=e.width,a=e.height,i=e.slides,s=e.$wrapperEl,r=e.slidesSizesGrid,n=e.params.coverflowEffect,o=e.isHorizontal(),l=e.translate,d=o?t/2-l:a/2-l,p=o?n.rotate:-n.rotate,c=n.depth,u=0,h=i.length;u<h;u+=1){var v=i.eq(u),f=r[u],m=(d-v[0].swiperSlideOffset-f/2)/f*n.modifier,g=o?p*m:0,b=o?0:p*m,w=-c*Math.abs(m),y=o?0:n.stretch*m,x=o?n.stretch*m:0;Math.abs(x)<.001&&(x=0),Math.abs(y)<.001&&(y=0),Math.abs(w)<.001&&(w=0),Math.abs(g)<.001&&(g=0),Math.abs(b)<.001&&(b=0);var T="translate3d("+x+"px,"+y+"px,"+w+"px)  rotateX("+b+"deg) rotateY("+g+"deg)";if(v.transform(T),v[0].style.zIndex=1-Math.abs(Math.round(m)),n.slideShadows){var E=o?v.find(".swiper-slide-shadow-left"):v.find(".swiper-slide-shadow-top"),S=o?v.find(".swiper-slide-shadow-right"):v.find(".swiper-slide-shadow-bottom");0===E.length&&(E=I('<div class="swiper-slide-shadow-'+(o?"left":"top")+'"></div>'),v.append(E)),0===S.length&&(S=I('<div class="swiper-slide-shadow-'+(o?"right":"bottom")+'"></div>'),v.append(S)),E.length&&(E[0].style.opacity=0<m?m:0),S.length&&(S[0].style.opacity=0<-m?-m:0)}}(ae.pointerEvents||ae.prefixedPointerEvents)&&(s[0].style.perspectiveOrigin=d+"px 50%")},setTransition:function(e){this.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e)}},_={init:function(){var e=this,t=e.params.thumbs,a=e.constructor;t.swiper instanceof a?(e.thumbs.swiper=t.swiper,te.extend(e.thumbs.swiper.originalParams,{watchSlidesProgress:!0,slideToClickedSlide:!1}),te.extend(e.thumbs.swiper.params,{watchSlidesProgress:!0,slideToClickedSlide:!1})):te.isObject(t.swiper)&&(e.thumbs.swiper=new a(te.extend({},t.swiper,{watchSlidesVisibility:!0,watchSlidesProgress:!0,slideToClickedSlide:!1})),e.thumbs.swiperCreated=!0),e.thumbs.swiper.$el.addClass(e.params.thumbs.thumbsContainerClass),e.thumbs.swiper.on("tap",e.thumbs.onThumbClick)},onThumbClick:function(){var e=this,t=e.thumbs.swiper;if(t){var a=t.clickedIndex,i=t.clickedSlide;if(!(i&&I(i).hasClass(e.params.thumbs.slideThumbActiveClass)||null==a)){var s;if(s=t.params.loop?parseInt(I(t.clickedSlide).attr("data-swiper-slide-index"),10):a,e.params.loop){var r=e.activeIndex;e.slides.eq(r).hasClass(e.params.slideDuplicateClass)&&(e.loopFix(),e._clientLeft=e.$wrapperEl[0].clientLeft,r=e.activeIndex);var n=e.slides.eq(r).prevAll('[data-swiper-slide-index="'+s+'"]').eq(0).index(),o=e.slides.eq(r).nextAll('[data-swiper-slide-index="'+s+'"]').eq(0).index();s=void 0===n?o:void 0===o?n:o-r<r-n?o:n}e.slideTo(s)}}},update:function(e){var t=this,a=t.thumbs.swiper;if(a){var i="auto"===a.params.slidesPerView?a.slidesPerViewDynamic():a.params.slidesPerView;if(t.realIndex!==a.realIndex){var s,r=a.activeIndex;if(a.params.loop){a.slides.eq(r).hasClass(a.params.slideDuplicateClass)&&(a.loopFix(),a._clientLeft=a.$wrapperEl[0].clientLeft,r=a.activeIndex);var n=a.slides.eq(r).prevAll('[data-swiper-slide-index="'+t.realIndex+'"]').eq(0).index(),o=a.slides.eq(r).nextAll('[data-swiper-slide-index="'+t.realIndex+'"]').eq(0).index();s=void 0===n?o:void 0===o?n:o-r==r-n?r:o-r<r-n?o:n}else s=t.realIndex;a.visibleSlidesIndexes&&a.visibleSlidesIndexes.indexOf(s)<0&&(a.params.centeredSlides?s=r<s?s-Math.floor(i/2)+1:s+Math.floor(i/2)-1:r<s&&(s=s-i+1),a.slideTo(s,e?0:void 0))}var l=1,d=t.params.thumbs.slideThumbActiveClass;if(1<t.params.slidesPerView&&!t.params.centeredSlides&&(l=t.params.slidesPerView),a.slides.removeClass(d),a.params.loop||a.params.virtual)for(var p=0;p<l;p+=1)a.$wrapperEl.children('[data-swiper-slide-index="'+(t.realIndex+p)+'"]').addClass(d);else for(var c=0;c<l;c+=1)a.slides.eq(t.realIndex+c).addClass(d)}}},Z=[E,S,C,M,k,$,D,{name:"mousewheel",params:{mousewheel:{enabled:!1,releaseOnEdges:!1,invert:!1,forceToAxis:!1,sensitivity:1,eventsTarged:"container"}},create:function(){var e=this;te.extend(e,{mousewheel:{enabled:!1,enable:O.enable.bind(e),disable:O.disable.bind(e),handle:O.handle.bind(e),handleMouseEnter:O.handleMouseEnter.bind(e),handleMouseLeave:O.handleMouseLeave.bind(e),lastScrollTime:te.now()}})},on:{init:function(){this.params.mousewheel.enabled&&this.mousewheel.enable()},destroy:function(){this.mousewheel.enabled&&this.mousewheel.disable()}}},{name:"navigation",params:{navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock"}},create:function(){var e=this;te.extend(e,{navigation:{init:A.init.bind(e),update:A.update.bind(e),destroy:A.destroy.bind(e),onNextClick:A.onNextClick.bind(e),onPrevClick:A.onPrevClick.bind(e)}})},on:{init:function(){this.navigation.init(),this.navigation.update()},toEdge:function(){this.navigation.update()},fromEdge:function(){this.navigation.update()},destroy:function(){this.navigation.destroy()},click:function(e){var t,a=this,i=a.navigation,s=i.$nextEl,r=i.$prevEl;!a.params.navigation.hideOnClick||I(e.target).is(r)||I(e.target).is(s)||(s?t=s.hasClass(a.params.navigation.hiddenClass):r&&(t=r.hasClass(a.params.navigation.hiddenClass)),!0===t?a.emit("navigationShow",a):a.emit("navigationHide",a),s&&s.toggleClass(a.params.navigation.hiddenClass),r&&r.toggleClass(a.params.navigation.hiddenClass))}}},{name:"pagination",params:{pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:function(e){return e},formatFractionTotal:function(e){return e},bulletClass:"swiper-pagination-bullet",bulletActiveClass:"swiper-pagination-bullet-active",modifierClass:"swiper-pagination-",currentClass:"swiper-pagination-current",totalClass:"swiper-pagination-total",hiddenClass:"swiper-pagination-hidden",progressbarFillClass:"swiper-pagination-progressbar-fill",progressbarOppositeClass:"swiper-pagination-progressbar-opposite",clickableClass:"swiper-pagination-clickable",lockClass:"swiper-pagination-lock"}},create:function(){var e=this;te.extend(e,{pagination:{init:H.init.bind(e),render:H.render.bind(e),update:H.update.bind(e),destroy:H.destroy.bind(e),dynamicBulletIndex:0}})},on:{init:function(){this.pagination.init(),this.pagination.render(),this.pagination.update()},activeIndexChange:function(){this.params.loop?this.pagination.update():void 0===this.snapIndex&&this.pagination.update()},snapIndexChange:function(){this.params.loop||this.pagination.update()},slidesLengthChange:function(){this.params.loop&&(this.pagination.render(),this.pagination.update())},snapGridLengthChange:function(){this.params.loop||(this.pagination.render(),this.pagination.update())},destroy:function(){this.pagination.destroy()},click:function(e){var t=this;t.params.pagination.el&&t.params.pagination.hideOnClick&&0<t.pagination.$el.length&&!I(e.target).hasClass(t.params.pagination.bulletClass)&&(!0===t.pagination.$el.hasClass(t.params.pagination.hiddenClass)?t.emit("paginationShow",t):t.emit("paginationHide",t),t.pagination.$el.toggleClass(t.params.pagination.hiddenClass))}}},{name:"scrollbar",params:{scrollbar:{el:null,dragSize:"auto",hide:!1,draggable:!1,snapOnRelease:!0,lockClass:"swiper-scrollbar-lock",dragClass:"swiper-scrollbar-drag"}},create:function(){var e=this;te.extend(e,{scrollbar:{init:G.init.bind(e),destroy:G.destroy.bind(e),updateSize:G.updateSize.bind(e),setTranslate:G.setTranslate.bind(e),setTransition:G.setTransition.bind(e),enableDraggable:G.enableDraggable.bind(e),disableDraggable:G.disableDraggable.bind(e),setDragPosition:G.setDragPosition.bind(e),getPointerPosition:G.getPointerPosition.bind(e),onDragStart:G.onDragStart.bind(e),onDragMove:G.onDragMove.bind(e),onDragEnd:G.onDragEnd.bind(e),isTouched:!1,timeout:null,dragTimeout:null}})},on:{init:function(){this.scrollbar.init(),this.scrollbar.updateSize(),this.scrollbar.setTranslate()},update:function(){this.scrollbar.updateSize()},resize:function(){this.scrollbar.updateSize()},observerUpdate:function(){this.scrollbar.updateSize()},setTranslate:function(){this.scrollbar.setTranslate()},setTransition:function(e){this.scrollbar.setTransition(e)},destroy:function(){this.scrollbar.destroy()}}},{name:"parallax",params:{parallax:{enabled:!1}},create:function(){te.extend(this,{parallax:{setTransform:N.setTransform.bind(this),setTranslate:N.setTranslate.bind(this),setTransition:N.setTransition.bind(this)}})},on:{beforeInit:function(){this.params.parallax.enabled&&(this.params.watchSlidesProgress=!0,this.originalParams.watchSlidesProgress=!0)},init:function(){this.params.parallax.enabled&&this.parallax.setTranslate()},setTranslate:function(){this.params.parallax.enabled&&this.parallax.setTranslate()},setTransition:function(e){this.params.parallax.enabled&&this.parallax.setTransition(e)}}},{name:"zoom",params:{zoom:{enabled:!1,maxRatio:3,minRatio:1,toggle:!0,containerClass:"swiper-zoom-container",zoomedSlideClass:"swiper-slide-zoomed"}},create:function(){var i=this,t={enabled:!1,scale:1,currentScale:1,isScaling:!1,gesture:{$slideEl:void 0,slideWidth:void 0,slideHeight:void 0,$imageEl:void 0,$imageWrapEl:void 0,maxRatio:3},image:{isTouched:void 0,isMoved:void 0,currentX:void 0,currentY:void 0,minX:void 0,minY:void 0,maxX:void 0,maxY:void 0,width:void 0,height:void 0,startX:void 0,startY:void 0,touchesStart:{},touchesCurrent:{}},velocity:{x:void 0,y:void 0,prevPositionX:void 0,prevPositionY:void 0,prevTime:void 0}};"onGestureStart onGestureChange onGestureEnd onTouchStart onTouchMove onTouchEnd onTransitionEnd toggle enable disable in out".split(" ").forEach(function(e){t[e]=B[e].bind(i)}),te.extend(i,{zoom:t});var s=1;Object.defineProperty(i.zoom,"scale",{get:function(){return s},set:function(e){if(s!==e){var t=i.zoom.gesture.$imageEl?i.zoom.gesture.$imageEl[0]:void 0,a=i.zoom.gesture.$slideEl?i.zoom.gesture.$slideEl[0]:void 0;i.emit("zoomChange",e,t,a)}s=e}})},on:{init:function(){this.params.zoom.enabled&&this.zoom.enable()},destroy:function(){this.zoom.disable()},touchStart:function(e){this.zoom.enabled&&this.zoom.onTouchStart(e)},touchEnd:function(e){this.zoom.enabled&&this.zoom.onTouchEnd(e)},doubleTap:function(e){this.params.zoom.enabled&&this.zoom.enabled&&this.params.zoom.toggle&&this.zoom.toggle(e)},transitionEnd:function(){this.zoom.enabled&&this.params.zoom.enabled&&this.zoom.onTransitionEnd()}}},{name:"lazy",params:{lazy:{enabled:!1,loadPrevNext:!1,loadPrevNextAmount:1,loadOnTransitionStart:!1,elementClass:"swiper-lazy",loadingClass:"swiper-lazy-loading",loadedClass:"swiper-lazy-loaded",preloaderClass:"swiper-lazy-preloader"}},create:function(){te.extend(this,{lazy:{initialImageLoaded:!1,load:X.load.bind(this),loadInSlide:X.loadInSlide.bind(this)}})},on:{beforeInit:function(){this.params.lazy.enabled&&this.params.preloadImages&&(this.params.preloadImages=!1)},init:function(){this.params.lazy.enabled&&!this.params.loop&&0===this.params.initialSlide&&this.lazy.load()},scroll:function(){this.params.freeMode&&!this.params.freeModeSticky&&this.lazy.load()},resize:function(){this.params.lazy.enabled&&this.lazy.load()},scrollbarDragMove:function(){this.params.lazy.enabled&&this.lazy.load()},transitionStart:function(){var e=this;e.params.lazy.enabled&&(!e.params.lazy.loadOnTransitionStart&&(e.params.lazy.loadOnTransitionStart||e.lazy.initialImageLoaded)||e.lazy.load())},transitionEnd:function(){this.params.lazy.enabled&&!this.params.lazy.loadOnTransitionStart&&this.lazy.load()}}},{name:"controller",params:{controller:{control:void 0,inverse:!1,by:"slide"}},create:function(){var e=this;te.extend(e,{controller:{control:e.params.controller.control,getInterpolateFunction:V.getInterpolateFunction.bind(e),setTranslate:V.setTranslate.bind(e),setTransition:V.setTransition.bind(e)}})},on:{update:function(){this.controller.control&&this.controller.spline&&(this.controller.spline=void 0,delete this.controller.spline)},resize:function(){this.controller.control&&this.controller.spline&&(this.controller.spline=void 0,delete this.controller.spline)},observerUpdate:function(){this.controller.control&&this.controller.spline&&(this.controller.spline=void 0,delete this.controller.spline)},setTranslate:function(e,t){this.controller.control&&this.controller.setTranslate(e,t)},setTransition:function(e,t){this.controller.control&&this.controller.setTransition(e,t)}}},{name:"a11y",params:{a11y:{enabled:!0,notificationClass:"swiper-notification",prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}"}},create:function(){var t=this;te.extend(t,{a11y:{liveRegion:I('<span class="'+t.params.a11y.notificationClass+'" aria-live="assertive" aria-atomic="true"></span>')}}),Object.keys(Y).forEach(function(e){t.a11y[e]=Y[e].bind(t)})},on:{init:function(){this.params.a11y.enabled&&(this.a11y.init(),this.a11y.updateNavigation())},toEdge:function(){this.params.a11y.enabled&&this.a11y.updateNavigation()},fromEdge:function(){this.params.a11y.enabled&&this.a11y.updateNavigation()},paginationUpdate:function(){this.params.a11y.enabled&&this.a11y.updatePagination()},destroy:function(){this.params.a11y.enabled&&this.a11y.destroy()}}},{name:"history",params:{history:{enabled:!1,replaceState:!1,key:"slides"}},create:function(){var e=this;te.extend(e,{history:{init:F.init.bind(e),setHistory:F.setHistory.bind(e),setHistoryPopState:F.setHistoryPopState.bind(e),scrollToSlide:F.scrollToSlide.bind(e),destroy:F.destroy.bind(e)}})},on:{init:function(){this.params.history.enabled&&this.history.init()},destroy:function(){this.params.history.enabled&&this.history.destroy()},transitionEnd:function(){this.history.initialized&&this.history.setHistory(this.params.history.key,this.activeIndex)}}},{name:"hash-navigation",params:{hashNavigation:{enabled:!1,replaceState:!1,watchState:!1}},create:function(){var e=this;te.extend(e,{hashNavigation:{initialized:!1,init:R.init.bind(e),destroy:R.destroy.bind(e),setHash:R.setHash.bind(e),onHashCange:R.onHashCange.bind(e)}})},on:{init:function(){this.params.hashNavigation.enabled&&this.hashNavigation.init()},destroy:function(){this.params.hashNavigation.enabled&&this.hashNavigation.destroy()},transitionEnd:function(){this.hashNavigation.initialized&&this.hashNavigation.setHash()}}},{name:"autoplay",params:{autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!0,stopOnLastSlide:!1,reverseDirection:!1}},create:function(){var t=this;te.extend(t,{autoplay:{running:!1,paused:!1,run:q.run.bind(t),start:q.start.bind(t),stop:q.stop.bind(t),pause:q.pause.bind(t),onTransitionEnd:function(e){t&&!t.destroyed&&t.$wrapperEl&&e.target===this&&(t.$wrapperEl[0].removeEventListener("transitionend",t.autoplay.onTransitionEnd),t.$wrapperEl[0].removeEventListener("webkitTransitionEnd",t.autoplay.onTransitionEnd),t.autoplay.paused=!1,t.autoplay.running?t.autoplay.run():t.autoplay.stop())}}})},on:{init:function(){this.params.autoplay.enabled&&this.autoplay.start()},beforeTransitionStart:function(e,t){this.autoplay.running&&(t||!this.params.autoplay.disableOnInteraction?this.autoplay.pause(e):this.autoplay.stop())},s
440liderFirstMove:function(){this.autoplay.running&&(this.params.autoplay.disableOnInteraction?this.autoplay.stop():this.autoplay.pause())},destroy:function(){this.autoplay.running&&this.autoplay.stop()}}},{name:"effect-fade",params:{fadeEffect:{crossFade:!1}},create:function(){te.extend(this,{fadeEffect:{setTranslate:W.setTranslate.bind(this),setTransition:W.setTransition.bind(this)}})},on:{beforeInit:function(){var e=this;if("fade"===e.params.effect){e.classNames.push(e.params.containerModifierClass+"fade");var t={slidesPerView:1,slidesPerColumn:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!0};te.extend(e.params,t),te.extend(e.originalParams,t)}},setTranslate:function(){"fade"===this.params.effect&&this.fadeEffect.setTranslate()},setTransition:function(e){"fade"===this.params.effect&&this.fadeEffect.setTransition(e)}}},{name:"effect-cube",params:{cubeEffect:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94}},create:function(){te.extend(this,{cubeEffect:{setTranslate:j.setTranslate.bind(this),setTransition:j.setTransition.bind(this)}})},on:{beforeInit:function(){var e=this;if("cube"===e.params.effect){e.classNames.push(e.params.containerModifierClass+"cube"),e.classNames.push(e.params.containerModifierClass+"3d");var t={slidesPerView:1,slidesPerColumn:1,slidesPerGroup:1,watchSlidesProgress:!0,resistanceRatio:0,spaceBetween:0,centeredSlides:!1,virtualTranslate:!0};te.extend(e.params,t),te.extend(e.originalParams,t)}},setTranslate:function(){"cube"===this.params.effect&&this.cubeEffect.setTranslate()},setTransition:function(e){"cube"===this.params.effect&&this.cubeEffect.setTransition(e)}}},{name:"effect-flip",params:{flipEffect:{slideShadows:!0,limitRotation:!0}},create:function(){te.extend(this,{flipEffect:{setTranslate:U.setTranslate.bind(this),setTransition:U.setTransition.bind(this)}})},on:{beforeInit:function(){var e=this;if("flip"===e.params.effect){e.classNames.push(e.params.containerModifierClass+"flip"),e.classNames.push(e.params.containerModifierClass+"3d");var t={slidesPerView:1,slidesPerColumn:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!0};te.extend(e.params,t),te.extend(e.originalParams,t)}},setTranslate:function(){"flip"===this.params.effect&&this.flipEffect.setTranslate()},setTransition:function(e){"flip"===this.params.effect&&this.flipEffect.setTransition(e)}}},{name:"effect-coverflow",params:{coverflowEffect:{rotate:50,stretch:0,depth:100,modifier:1,slideShadows:!0}},create:function(){te.extend(this,{coverflowEffect:{setTranslate:K.setTranslate.bind(this),setTransition:K.setTransition.bind(this)}})},on:{beforeInit:function(){var e=this;"coverflow"===e.params.effect&&(e.classNames.push(e.params.containerModifierClass+"coverflow"),e.classNames.push(e.params.containerModifierClass+"3d"),e.params.watchSlidesProgress=!0,e.originalParams.watchSlidesProgress=!0)},setTranslate:function(){"coverflow"===this.params.effect&&this.coverflowEffect.setTranslate()},setTransition:function(e){"coverflow"===this.params.effect&&this.coverflowEffect.setTransition(e)}}},{name:"thumbs",params:{thumbs:{swiper:null,slideThumbActiveClass:"swiper-slide-thumb-active",thumbsContainerClass:"swiper-container-thumbs"}},create:function(){te.extend(this,{thumbs:{swiper:null,init:_.init.bind(this),update:_.update.bind(this),onThumbClick:_.onThumbClick.bind(this)}})},on:{beforeInit:function(){var e=this.params.thumbs;e&&e.swiper&&(this.thumbs.init(),this.thumbs.update(!0))},slideChange:function(){this.thumbs.swiper&&this.thumbs.update()},update:function(){this.thumbs.swiper&&this.thumbs.update()},resize:function(){this.thumbs.swiper&&this.thumbs.update()},observerUpdate:function(){this.thumbs.swiper&&this.thumbs.update()},setTransition:function(e){var t=this.thumbs.swiper;t&&t.setTransition(e)},beforeDestroy:function(){var e=this.thumbs.swiper;e&&this.thumbs.swiperCreated&&e&&e.destroy()}}}];return void 0===T.use&&(T.use=T.Class.use,T.installModule=T.Class.installModule),T.use(Z),T});
441
442// 210812 서정환수정
443EC$(function($) {
444    var filter = "win16|win32|win64|mac|macintel";
445    var device = "pc";
446    if (navigator.platform) {
447        if (filter.indexOf(navigator.platform.toLowerCase()) < 0) {
448			device = "mobile";
449		}
450    }
451
452    /**
453     * 상품상세, 상품 확대보기(팝업) - 소비자가 할인표시 */
454    var oPriceInfoEl = $('#ec-product-price-info');
455    if (oPriceInfoEl.length > 0) {
456        var salePriceEl = $('#span_product_price_text');
457        percentageCul(oPriceInfoEl, salePriceEl);
458    }
459
460    /**
461    * 상품목록/메인진열 - 소비자가 할인표시*/
462	function sale_percent() {
463		var mainEl = $("#contents");
464		if (mainEl.length > 0) {
465		  var productListEl = $('.xans-product-listmain, .xans-product-listrecommend, .xans-product-listnew, .xans-product-listnormal, .xans-search-result');
466			for (var i = 0; i < productListEl.length; i++) {
467				var prdListEl = productListEl.eq(i).find('.prdList > li');
468				for (var j = 0; j < prdListEl.length; j++) {
469					var priceEl = prdListEl.eq(j).find('.description'),
470						salePriceEl = priceEl.parent().find('.thumbnail');
471					if (device == "mobile") {
472						salePriceEl = priceEl.parent().find('.thumbnail');
473					}
474					percentageCul(priceEl, salePriceEl);
475
476				}
477			}
478		}
479	}
480
481    function percentageCul(target, salePriceEl) {
482		// 1. 값 가져오기
483		var rawCustom = target.attr('ec-data-custom') || "";
484		var rawPrice = target.attr('ec-data-price') || "";
485
486		// 2. 숫자로 변환 (데이터가 없으면 0)
487		var iCustomPrice = parseInt(rawCustom.replace(/[^0-9]/g, ""), 10) || 0;
488		var iPrice = parseInt(rawPrice.replace(/[^0-9]/g, ""), 10) || 0;
489
490        var sDisplayAmount = 'p', // p:할인율, w:할인금액
491            iOfftoFixed = 0, // 할인율 소수점자릿수
492            sSaleText = '',
493            regexp = /B(?=(d{3})+(?!d))/g;
494
495        if (iCustomPrice > 0 && iPrice > 0 && iPrice != iCustomPrice) {
496            if (sDisplayAmount == 'p') {
497                sSaleText = (((iCustomPrice - iPrice) / iCustomPrice) * 100).toFixed(iOfftoFixed) + '%';
498            } else if (sDisplayAmount == 'w') {
499                sSaleText = parseInt(iCustomPrice - iPrice).toString().replace(regexp, ',') + '원 OFF';
500            }
501            salePriceEl.append("<div class='sale_box'>" + sSaleText + "</div>");
502        }
503    }
504
505	/* 상품 할인율 실행 */
506	setTimeout(function(){
507		sale_percent();
508	}, 300);
509
510	/* [더보기] 버튼 클릭시 상품로딩되고 0.6초후 재계산 - 서정환 */
511	jQuery(".btnMore").click( function( ){
512		setTimeout(function(){
513			sale_percent();
514		}, 600);
515	});
516});
517/**
518 * hasClass
519 */
520function hasClass(element, className){
521    return (' ' + element.className + ' ').indexOf(' ' + className+ ' ') > -1;
522};
523
524/**
525 *  toggle
526 */
527function toggleClassAll(element, handler, className){
528    var _handler = document.querySelector(handler);
529    document.querySelectorAll(handler).forEach(function(item){
530        item.addEventListener('click', function(){
531            var _element = item.parentNode;
532            if ( hasClass( _element, className ) ) {
533                _element.classList.remove( className );
534            } else {
535                _element.classList.add( className );
536            }
537        })
538    })
539};
540
541/**
542 *  findElements
543 */
544function findElements(element, findElement){
545    var resultElements = [];
546    document.querySelectorAll(element).forEach(function(item){
547        var findElementList = item.querySelectorAll(findElement);
548        findElementList = Array.prototype.slice.call(findElementList);
549        resultElements = resultElements.concat(findElementList);
550    })
551    return resultElements;
552};
553
554/**
555 *  setAttributeAl
556 */
557function setAttributeAll(elements, name, value){
558    elements.forEach(function(item){
559        item.setAttribute(name, value);
560    })
561};
562
563/**
564 *  tooltip
565 */
566function setTooltipEvent(){
567    var input = findElements('.eTooltip', 'input');
568    input.forEach(function(item){
569        item.addEventListener('focusin', function(event){
570            var targetName = returnTargetName(event.target);
571            targetName.nextElementSibling.style.display = 'block'
572        });
573        item.addEventListener('focusout', function(event){
574            var targetName = returnTargetName(event.target);
575            targetName.nextElementSibling.style.display = 'none'
576        });
577    });
578}
579
580/**
581 *  tooltip input focus
582 */
583function returnTargetName(_this){
584    var ePlacename = _this.parentElement.getAttribute("class");
585    var targetName;
586    if(ePlacename == "ePlaceholder"){ //ePlaceholder supported
587        targetName = _this.parentElement;
588    }else{
589        targetName = _this;
590    }
591    return targetName;
592}
593
594/**
595 * window load
596 */
597window.addEventListener('load', function(){
598    if (document.querySelector('.eTooltip')){
599        setAttributeAll(findElements('.eTooltip', '.btnClose'),'tabIndex','-1');
600        setTooltipEvent();
601    }
602    if (document.querySelector('div.eToggle')){
603        toggleClassAll(false, 'div.eToggle .title', 'selected');
604    }
605});
606window.addEventListener('load', function(){
607	bottomNav();
608    handleNav();
609    searchLayer();
610});
611
612function toggleClass(element, handler, className){
613	var _handler = document.querySelector(handler);
614	var _element = document.querySelector(element);
615
616    _handler.addEventListener('click', function(){
617        if ( _element.classList.contains(className) ) {
618            _element.classList.remove( className );
619        } else {
620            _element.classList.add( className );
621        }
622    });
623}
624
625function handleNav() {
626    var btnNavs = document.querySelectorAll('.eNavFold');
627    var btnClose = document.querySelector('#aside .btnClose');
628    var dimmed = document.querySelector('#layoutDimmed');
629    var elements = document.getElementsByClassName("test");
630    btnNavs.forEach( function(btnNav) {
631        btnNav.addEventListener('click', function(){
632            document.body.classList.add('expand');
633        });
634    });
635    btnClose.addEventListener('click', function(){
636        document.body.classList.remove('expand');
637    });
638    handleDimmed(dimmed, document.body, 'expand');
639}
640
641
642function searchLayer() {
643    var btnSearchs = document.querySelectorAll('.eSearch');
644    var btnClose = document.querySelector('.xans-layout-searchheader .btnClose');
645	var btnClose2 = document.querySelector('.misc-close-search');
646    btnSearchs.forEach( function(btnSearch) {
647        btnSearch.addEventListener('click', function(){
648            document.body.classList.add('searchExpand');
649            var input = document.querySelector('#keyword');
650            input.setAttribute("placeholder","검색어를 입력해주세요");
651            //input.focus();
652        });
653    });
654    btnClose.addEventListener('click', function(){
655        document.body.classList.remove('searchExpand');
656    });
657    var dimmed = document.querySelector('#layoutDimmed');
658    handleDimmed(dimmed, document.body, 'searchExpand');
659}
660
661function handleDimmed(target, element, className){
662    target.addEventListener('click', function(){
663        element.classList.remove(className);
664    });
665}
666
667function bottomScroll(){
668    var lastScrollTop = 0;
669    var delta = 5;
670    var fixBox = document.querySelector('.bottom-nav__top');
671    var fixBoxHeight = fixBox.offsetHeight;
672    var didScroll;
673
674    window.onscroll = function(e) {
675        didScroll = true;
676    };
677
678    setInterval(function(){
679        if(didScroll){
680            hasScrolled();
681            didScroll = false;
682        }
683    }, 250);
684
685    function hasScrolled(){
686        var nowScrollTop = window.scrollY;
687        if(Math.abs(lastScrollTop - nowScrollTop) <= delta){
688            return;
689        }
690        if(nowScrollTop > lastScrollTop && nowScrollTop > fixBoxHeight){
691            //Scroll down
692            var scrollTop = window.scrollTop();
693            var innerHeight = window.innerHeight();
694            var scrollHeight = $('body').prop('scrollHeight');
695            if (scrollTop + innerHeight >= scrollHeight) {
696                fixBox.classList.add('bottom-nav--hide');
697                return true;
698            }
699        }else{
700            if(nowScrollTop + window.innerHeight < document.body.offsetHeight){
701                //Scroll up
702                fixBox.classList.remove('bottom-nav--hide');
703            }
704        }
705        lastScrollTop = nowScrollTop;
706    }
707}
708
709function bottomNav(){
710    var lastScrollTop = 0;
711    var btnTop = document.querySelector('.bottom-nav__top');
712    var footer = document.querySelector('.footer'); // 푸터 요소 선택
713    var fixedButton = document.getElementById("orderFixArea");
714    var defaultBottom = 0;
715    
716    if(fixedButton){
717        document.body.classList.add("button--fixed");
718    };
719
720	window.addEventListener("scroll", function(){
721		var scroll = window.pageYOffset || document.documentElement.scrollTop;
722        var nav = document.querySelector('.bottom-nav');
723        var windowHeight = window.innerHeight;
724        var windowWidth = window.innerWidth;
725        var docHeight = document.documentElement.scrollHeight;
726        var footerHeight = footer ? footer.offsetHeight : 0;
727        
728		if (scroll > lastScrollTop){
729			nav.classList.add('bottom-nav--hide');
730		} else {
731			nav.classList.remove('bottom-nav--hide');
732		}
733		// scroll bottom
734		if(scroll === document.body.scrollHeight - document.documentElement.offsetHeight){
735			nav.classList.remove('bottom-nav--hide');
736		}
737        // 모바일일때 top 버튼 위치 조정
738        if (windowWidth < 1024 && scroll + windowHeight >= docHeight - footerHeight) {
739            btnTop.style.bottom = (footerHeight + defaultBottom - 40 - 15) + "px";
740        } else {
741            // 최하단이 아닐 때: 기본 위치로 복구
742            btnTop.style.bottom = defaultBottom + "px";
743        }
744		lastScrollTop = scroll <= 0 ? 0 : scroll;
745
746        // top button
747        var currentScrollPercentage = getCurrentScrollPercentage();
748        if(currentScrollPercentage > 15 && scroll > document.querySelector('#header').offsetHeight){
749        	btnTop.classList.add('bottom-nav__top--show');
750        } else {
751			btnTop.classList.remove('bottom-nav__top--show');
752        }
753	});
754
755    btnTop.addEventListener('click', function(e){
756        e.preventDefault();
757        window.scrollTo({
758          top: 0,
759          behavior: 'smooth'
760        });
761    });
762}
763
764function getOffset(element){
765    if (!element.getClientRects().length)
766    {
767      return { top: 0, left: 0 };
768    }
769
770    var rect = element.getBoundingClientRect();
771    var win = element.ownerDocument.defaultView;
772    return (
773    {
774      top: rect.top + win.pageYOffset,
775      left: rect.left + win.pageXOffset
776    });
777}
778
779function getQuickPosition(){
780	var role = document.querySelector("meta[name='path_role']").getAttribute('content');
781	if (role === "MAIN") {
782		return getMainQuickPosition();
783	} else {
784		return getSubQuickPosition();
785	}
786}
787
788function getMainQuickPosition(){
789	var quickMenu = document.querySelector('#quick');
790	var collection = document.querySelector('.collection');
791	var snsItem = document.querySelector('.snsItem');
792
793	var mainTopSpace = 115;
794	var mainFooterSpace = 34;
795
796	var top = collection.offsetTop + collection.clientHeight + mainTopSpace;
797    var footTop = getOffset(snsItem).top + mainFooterSpace;
798	var maxY = footTop - quickMenu.offsetHeight;
799
800	return [top, maxY]
801}
802
803function getSubQuickPosition(){
804	var quickMenu = document.querySelector('#quick');
805	var footer = document.querySelector("#footer");
806
807	var footerSpace = 60;
808	var top = 284;
809    var footTop = getOffset(footer).top;
810	var maxY = footTop - quickMenu.offsetHeight - footerSpace;
811
812	return [top, maxY]
813}
814
815function setQuickScrollEvent(y, quick){
816	var header = document.querySelector('#header');
817	var position = getQuickPosition();
818	var scrollY = y;
819	if (scrollY >= position[0] - header.offsetHeight){
820		if (scrollY < position[1]) {
821			quick.classList.add('fixed');
822			quick.removeAttribute('style');
823        } else {
824			quick.classList.remove('fixed');
825			quick.style.position = 'absolute';
826			quick.style.top = position[1] + 'px';
827        }
828	} else {
829		quick.style.top = position[0] + 'px';
830        quick.classList.remove('fixed');
831    }
832}
833
834function quickGoTop(){
835    var btnTop = document.querySelector('#quick .pageTop');
836	btnTop.addEventListener('click', function(){
837        window.scrollTo({
838          top: 0,
839          behavior: 'smooth'
840        });
841    });
842}
843
844function getCurrentScrollPercentage(){
845	return (window.scrollY + window.innerHeight) / document.body.clientHeight * 100
846}
847
848
849jQuery(document).ready(function() {
850	/* 검색페이지 정렬 텍스트 변경 */
851	jQuery("#order_by").each(function(){
852		jQuery('option:first-child', this).text('- 정렬방식 -');
853	});
854
855	/* 하단 에스크로 사용하면 출력 */
856	jQuery("#footer .inner .bt_escrow").each(function(){
857		var bt_escrow = jQuery(this).attr("data-ez-escrow");
858		if ( !bt_escrow == '' ) {
859			var bt_escrow_name = jQuery("a img[data-ez-escrow-id="+ bt_escrow +"]", this).addClass('on');
860			jQuery(this).css('display','flex');
861		}
862	});
863
864	/* 로그인페이지 SNS 사용하면 출력 */
865	jQuery(".xans-member-login .login__sns .wrap_sns_log a").each(function(){
866		var wrap_sns_log = jQuery(this).hasClass('displaynone');
867		if( wrap_sns_log == false){
868			jQuery(".xans-member-login .login__sns").css('display','block');
869		}
870	});
871
872	/* 기획전 레이아웃변경에 따른 타겟고정위치 변경 */
873	var header_height = document.getElementById("header").scrollHeight;
874	jQuery('.xans-project-list h3 span').css('top',-header_height+30);
875
876	/* 모바일에서 쇼핑큐레이션 */
877	jQuery('#shoppQbtn').click(function(){
878		if (jQuery("#searchContent.xans-product-searchdata").is(":hidden")) {
879			jQuery('#searchContent.xans-product-searchdata').slideDown('normal');
880			jQuery(this).text('상세검색 닫기');
881			jQuery(this).css('margin-top','0');
882		} else {
883			jQuery('#searchContent.xans-product-searchdata').slideUp('normal');
884			jQuery(this).text('상세검색');
885		}
886	});
887
888	/* 모바일에서 쇼핑큐레이션 없을시 버튼 숨김 */
889	jQuery("#searchContent").each(function(){
890		var prdCount_count = jQuery("#ec-searchdata-area", this).length;
891		if ( prdCount_count == '0' ) {
892			jQuery('#shoppQbtn').hide();
893		}
894	});
895
896	/* 마이페이지 나의게시글 없을때 메시지 표시 */
897	jQuery(".xans-myshop-boardpackage").each(function(){
898		var boardlist = jQuery(".xans-myshop-boardlist table", this).length;
899		if ( boardlist == '0' ) {
900			jQuery('.myshop_boardlist_empty').css('display','flex');
901		}
902	});
903
904	/* 더보기 클릭시 */
905	jQuery('.btnMore').click(function(){
906		setTimeout(function(){
907			ifmore();
908		},600)
909	});
910	setTimeout(function(){
911		ifmore();
912	},300)
913
914	/* 상단 카테고리 변경 감지 */
915	top_category(); // 상단카테고리
916	observeTopCategory(); // 상단카테고리 변경 감지
917});
918
919/* 상단 카테고리 변경 감지 */
920function observeTopCategory(){
921	var targetNode = jQuery('#header .xans-layout-category > ul')[0];
922
923	// MutationObserver 인스턴스 생성
924	var observer = new MutationObserver(function(mutationsList, observer) {
925			// 변경 감지된 경우 상단카테고리 실행
926			top_category();
927	});
928
929	// 상단 카테고리가 있는 경우 변경 감지
930	if (targetNode) {
931			observer.observe(targetNode, { childList: true, subtree: true });
932	}
933}
934
935/* 상단 카테고리 */
936function top_category(){
937	/* 상단카테고리 */
938	jQuery('#header .top_category li').on('focusin mouseenter', function() {
939		// 마우스가 들어오거나 내부 요소에 포커스가 갈 때 메뉴 열기
940		jQuery(this).addClass('on');
941	});
942
943	jQuery('#header .top_category li').on('focusout mouseleave', function(e) {
944		var $this = jQuery(this);
945		
946		// 핵심 로직: 0.01초 뒤에 체크하여 포커스가 현재 li 밖에 있는지 확인
947		setTimeout(function() {
948			// 현재 포커스된 요소(activeElement)가 클릭한 li 내부에 포함되어 있지 않다면
949			if ($this.has(document.activeElement).length === 0) {
950				$this.removeClass('on');
951			}
952		}, 10); 
953	});
954
955	/* 상단카테고리 중분류체크 */
956	jQuery('#header .top_category ul.sub_cate01 li').each(function() {
957		if (jQuery(this).children('ul').length == 0) {
958			jQuery(this).addClass('noChild');
959		}
960	});
961}
962
963/* 최상단배너 쿠키 스크립트 - 서정환 */
964function setCookiem(cookie_name, cookie_value, expire_date) {
965    var today = new Date();
966    var expire = new Date();
967    expire.setTime(today.getTime() + 3600000 * 24 * expire_date);
968    cookies = cookie_name + '=' + cookie_value + '; path=/;';
969    if (expire_date != 0) cookies += 'expires=' + expire.toGMTString();
970    document.cookie = cookies;
971}
972
973function delCookiem(cookie_name) {
974	var _today = new Date();
975	var value = '';
976	_today.setDate(_today.getDate() - 1);
977	document.cookie = cookie_name + "=" + value + '; path=/;' + "; expires=" + _today.toGMTString();
978}
979
980function getCookiem(name) {
981    lims = document.cookie;
982    var index = lims.indexOf(name + "=");
983    if (index == -1) {
984        return null;
985    }
986    index = lims.indexOf("=", index) + 1; // first character
987    var endstr = lims.indexOf(';', index);
988    if (endstr == -1) {
989        endstr = lims.length; // last character
990    }
991    return unescape(lims.substring(index, endstr));
992}
993
994/* 더보기 클릭시 */
995function ifmore(){
996	/* 상품 썸네일 관심상품 출력 & 숨김 */
997	setTimeout(function(){
998		jQuery('.ec-base-product .prdList .icon__box .wish').each(function(){
999			var isstatus = jQuery(this).children('img').attr('icon_status');
1000			if ( isstatus == 'on' ) {
1001				jQuery(this).addClass('on');
1002			}
1003		});
1004		jQuery('.ec-base-product .prdList .icon__box .wish').click(function(){
1005			var isstatus = jQuery(this).children('img').attr('icon_status');
1006			if ( isstatus == 'off' ) {
1007				jQuery(this).addClass('on');
1008			} else {
1009				jQuery(this).removeClass('on');
1010			}
1011		});
1012	},200)
1013	jQuery('.ec-base-product .prdList > li').each(function(){
1014		/* 상품진열 장바구니 사용안할시 숨김 */
1015		if (jQuery(".icon__box .cart > .ec-admin-icon", this).length == 1) {
1016		} else {
1017			jQuery('.icon__box .cart', this).hide();
1018		}
1019		/* 상품진열 옵션미리보기 사용안할시 숨김 */
1020		if (jQuery(".icon__box .option > a", this).length == 1) {
1021		} else {
1022			jQuery('.icon__box .option', this).hide();
1023		}
1024		/* 상품진열 관심상품 사용안할시 숨김 */
1025		if (jQuery(".icon__box .wish > .ec-product-listwishicon", this).length == 1) {
1026		} else {
1027			jQuery('.icon__box .wish', this).hide();
1028		}
1029	});
1030}
1031//window popup script
1032function winPop(url) {
1033    window.open(url, "popup", "width=300,height=300,left=10,top=10,resizable=no,scrollbars=no");
1034}
1035/**
1036 * document.location.href split
1037 * return array Param
1038 */
1039function getQueryString(sKey)
1040{
1041    var sQueryString = document.location.search.substring(1);
1042    var aParam       = {};
1043
1044    if (sQueryString) {
1045        var aFields = sQueryString.split("&");
1046        var aField  = [];
1047        for(var i=0; i<aFields.length; i++){
1048            aField = aFields[i].split('=');
1049            aParam[aField[0]] = aField[1];            
1050        }
1051    }
1052
1053    aParam.page = aParam.page ? aParam.page : 1;
1054    return sKey ? aParam[sKey] : aParam;
1055};
1056
1057/**
1058  *  구매버튼
1059*/
1060var globalBuyBtnScrollFunc = function() {
1061    // 구매버튼 관련변수
1062    var sFixId = $('#orderFixItem').length > 0  ? 'orderFixItem' : 'fixedActionButton',
1063        $area = $('#orderFixArea'),
1064        $item = $('#' + sFixId + '').not($area);
1065
1066    $(window).scroll(function(){
1067        try {
1068             // 구매버튼 관련변수
1069            var iCurrentHeightPos = $(this).scrollTop() + $(this).height(),
1070                iButtonHeightPos = $item.offset().top;
1071
1072            if (iCurrentHeightPos > iButtonHeightPos || iButtonHeightPos < $(this).scrollTop() + $item.height()) {
1073                if (iButtonHeightPos < $(this).scrollTop() - $item.height()) {
1074                    $area.fadeIn('fast');
1075                } else {
1076                    $area.hide();
1077                }
1078            } else {
1079                $area.fadeIn('fast');
1080            }
1081        } catch(e) { }
1082    });
1083};
1084
1085$(function(){
1086    // tab
1087    $.eTab = function(ul) {
1088        $(ul).find('a').on('click', function() {
1089            var _li = $(this).parent('li').addClass('selected').siblings().removeClass('selected'),
1090                _target = $(this).attr('href'),
1091                _siblings = '.' + $(_target).attr('class');
1092            $(_target).show().siblings(_siblings).hide();
1093            return false
1094        });
1095    }
1096    if ( window.call_eTab ) {
1097        call_eTab();
1098    };
1099    globalBuyBtnScrollFunc();
1100});
1101window.Modernizr=function(au,at,ar){function R(b){ak.cssText=b}function Q(d,c){return R(ag.join(d+";")+(c||""))}function P(d,c){return typeof d===c}function O(d,c){return !!~(""+d).indexOf(c)}function N(f,c){for(var h in f){var g=f[h];if(!O(g,"-")&&ak[g]!==ar){return c=="pfx"?g:!0}}return !1}function M(g,c,j){for(var i in g){var h=c[g[i]];if(h!==ar){return j===!1?g[i]:P(h,"function")?h.bind(j||c):h}}return !1}function L(g,f,j){var i=g.charAt(0).toUpperCase()+g.slice(1),h=(g+" "+ae.join(i+" ")+i).split(" ");return P(f,"string")||P(f,"undefined")?N(h,f):(h=(g+" "+ad.join(i+" ")+i).split(" "),M(h,f,j))}var aq="2.8.3",ap={},ao=!0,an=at.documentElement,am="modernizr",al=at.createElement(am),ak=al.style,aj,ai=":)",ah={}.toString,ag=" -webkit- -moz- -o- -ms- ".split(" "),af="Webkit Moz O ms",ae=af.split(" "),ad=af.toLowerCase().split(" "),ac={},ab={},aa={},Z=[],Y=Z.slice,X,W=function(v,u,t,s){var r,q,p,o,h=at.createElement("div"),g=at.body,b=g||at.createElement("body");if(parseInt(t,10)){while(t--){p=at.createElement("div"),p.id=s?s[t]:am+(t+1),h.appendChild(p)}}return r=["&#173;",'<style id="s',am,'">',v,"</style>"].join(""),h.id=am,(g?h:b).innerHTML+=r,b.appendChild(h),g||(b.style.background="",b.style.overflow="hidden",o=an.style.overflow,an.style.overflow="hidden",an.appendChild(b)),q=u(h,v),g?h.parentNode.removeChild(h):(b.parentNode.removeChild(b),an.style.overflow=o),!!q},V=function(a){var f=au.matchMedia||au.msMatchMedia;if(f){return f(a)&&f(a).matches||!1}var e;return W("@media "+a+" { #"+am+" { position: absolute; } }",function(c){e=(au.getComputedStyle?getComputedStyle(c,null):c.currentStyle)["position"]=="absolute"}),e},U=function(){function c(h,g){g=g||at.createElement(b[h]||"div"),h="on"+h;var a=h in g;return a||(g.setAttribute||(g=at.createElement("div")),g.setAttribute&&g.removeAttribute&&(g.setAttribute(h,""),a=P(g[h],"function"),P(g[h],"undefined")||(g[h]=ar),g.removeAttribute(h))),g=null,a}var b={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return c}(),T={}.hasOwnProperty,S;!P(T,"undefined")&&!P(T.call,"undefined")?S=function(d,c){return T.call(d,c)}:S=function(d,c){return c in d&&P(d.constructor.prototype[c],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(a){var h=this;if(typeof h!="function"){throw new TypeError}
1101var g=Y.call(arguments,1),f=function(){if(this instanceof f){var b=function(){};b.prototype=h.prototype;var d=new b,c=h.apply(d,g.concat(Y.call(arguments)));return Object(c)===c?c:d}return h.apply(a,g.concat(Y.call(arguments)))};return f}),ac.touch=function(){var a;return"ontouchstart" in au||au.DocumentTouch&&at instanceof DocumentTouch?a=!0:W(["@media (",ag.join("touch-enabled),("),am,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(b){a=b.offsetTop===9}),a},ac.rgba=function(){return R("background-color:rgba(150,255,150,.5)"),O(ak.backgroundColor,"rgba")},ac.backgroundsize=function(){return L("backgroundSize")},ac.borderradius=function(){return L("borderRadius")},ac.boxshadow=function(){return L("boxShadow")},ac.opacity=function(){return Q("opacity:.55"),/^0.55$/.test(ak.opacity)},ac.cssanimations=function(){return L("animationName")},ac.cssgradients=function(){var e="background-image:",d="gradient(linear,left top,right bottom,from(#9f9),to(white));",f="linear-gradient(left top,#9f9, white);";return R((e+"-webkit- ".split(" ").join(d+e)+ag.join(f+e)).slice(0,-e.length)),O(ak.backgroundImage,"gradient")},ac.csstransforms=function(){return !!L("transform")},ac.csstransforms3d=function(){var b=!!L("perspective");return b&&"webkitPerspective" in an.style&&W("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(a,d){b=a.offsetLeft===9&&a.offsetHeight===3}),b},ac.csstransitions=function(){return L("transition")},ac.generatedcontent=function(){var b;return W(["#",am,"{font:0/0 a}#",am,':after{content:"',ai,'";visibility:hidden;font:3px/1 a}'].join(""),function(a){b=a.offsetHeight>=3}),b},ac.video=function(){var b=at.createElement("video"),f=!1;try{if(f=!!b.canPlayType){f=new Boolean(f),f.ogg=b.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),f.h264=b.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),f.webm=b.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}}catch(e){}return f};for(var K in ac){S(ac,K)&&(X=K.toLowerCase(),ap[X]=ac[K](),Z.push((ap[X]?"":"no-")+X))}return ap.addTest=function(e,c){if(typeof e=="object"){for(var f in e){S(e,f)&&ap.addTest(f,e[f])}}else{e=e.toLowerCase();if(ap[e]!==ar){return ap}c=typeof c=="function"?c():c,typeof ao!="undefined"&&ao&&(an.className+=" "+(c?"":"no-")+e),ap[e]=c}return ap},R(""),al=aj=null,function(aw,av){function A(f,e){var h=f.createElement("p"),g=f.getElementsByTagName("head")[0]||f.documentElement;return h.innerHTML="x<style>"+e+"</style>",g.insertBefore(h.lastChild,g.firstChild)}function z(){var b=t.elements;return typeof b=="string"?b.split(" "):b}function y(d){var c=C[d[E]];return c||(c={},D++,d[E]=D,C[D]=c),c}function x(b,h,f){h||(h=av);if(B){return h.createElement(b)}f||(f=y(h));var e;return f.cache[b]?e=f.cache[b].cloneNode():G.test(b)?e=(f.cache[b]=f.createElem(b)).cloneNode():e=f.createElem(b),e.canHaveChildren&&!H.test(b)&&!e.tagUrn?f.frag.appendChild(e):e}function w(b,l){b||(b=av);if(B){return b.createDocumentFragment()}l=l||y(b);var k=l.frag.cloneNode(),j=0,i=z(),h=i.length;for(;j<h;j++){k.createElement(i[j])}return k}function v(d,c){c.cache||(c.cache={},c.createElem=d.createElement,c.createFrag=d.createDocumentFragment,c.frag=c.createFrag()),d.createElement=function(a){return t.shivMethods?x(a,d,c):c.createElem(a)},d.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+z().join().replace(/[\w\-]+/g,function(b){return c.createElem(b),c.frag.createElement(b),'c("'+b+'")'})+");return n}")(t,c.frag)}function u(b){b||(b=av);var d=y(b);return t.shivCSS&&!F&&!d.hasCSS&&(d.hasCSS=!!A(b,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),B||v(b,d),b}var J="3.7.0",I=aw.html5||{},H=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,G=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,F,E="_html5shiv",D=0,C={},B;(function(){try{var b=av.createElement("a");b.innerHTML="<xyz></xyz>",F="hidden" in b,B=b.childNodes.length==1||function(){av.createElement("a");var c=av.createDocumentFragment();return typeof c.cloneNode=="undefined"||typeof c.createDocumentFragment=="undefined"||typeof c.createElement=="undefined"}()}catch(d){F=!0,B=!0}})();var t={elements:I.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:J,shivCSS:I.shivCSS!==!1,supportsUnknownElements:B,shivMethods:I.shivMethods!==!1,type:"default",shivDocument:u,createElement:x,createDocumentFragment:w};aw.html5=t,u(av)}(this,at),ap._version=aq,ap._prefixes=ag,ap._domPrefixes=ad,ap._cssomPrefixes=ae,ap.mq=V,ap.hasEvent=U,ap.testProp=function(b){return N([b])},ap.testAllProps=L,ap.testStyles=W,an.className=an.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(ao?" js "+Z.join(" "):""),ap}(this,this.document),function(ad,ac,ab){function aa(b){return"[object Function]"==P.call(b)}function Z(b){return"string"==typeof b}function Y(){}function X(b){return !b||"loaded"==b||"complete"==b||"uninitialized"==b}function W(){var b=O.shift();M=1,b?b.t?R(function(){("c"==b.t?L.injectCss:L.injectJs)(b.s,0,b.a,b.x,b.e,1)},0):(b(),W()):M=0}function V(w,v,t,s,q,p,n){function m(a){if(!g&&X(h.readyState)&&(x.r=g=1,!M&&W(),h.onload=h.onreadystatechange=null,a)){"img"!=w&&R(function(){I.removeChild(h)},50);for(var c in D[v]){D[v].hasOwnProperty(c)&&D[v][c].onload()}}}var n=n||L.errorTimeout,h=ac.createElement(w),g=0,b=0,x={t:t,s:v,e:q,a:p,x:n};1===D[v]&&(b=1,D[v]=[]),"object"==w?h.data=v:(h.src=v,h.type=w),h.width=h.height="0",h.onerror=h.onload=h.onreadystatechange=function(){m.call(this,b)},O.splice(s,0,x),"img"!=w&&(b||2===D[v]?(I.insertBefore(h,J?null:Q),R(m,n)):D[v].push(h))}function U(g,e,j,i,h){return M=0,e=e||"j",Z(g)?V("c"==e?G:H,g,e,this.i++,j,i,h):(O.splice(this.i++,0,g),1==O.length&&W()),this}function T(){var b=L;return b.loader={load:U,i:0},b}var S=ac.documentElement,R=ad.setTimeout,Q=ac.getElementsByTagName("script")[0],P={}
1101.toString,O=[],M=0,K="MozAppearance" in S.style,J=K&&!!ac.createRange().compareNode,I=J?S:Q.parentNode,S=ad.opera&&"[object Opera]"==P.call(ad.opera),S=!!ac.attachEvent&&!S,H=K?"object":S?"script":"img",G=S?"script":H,F=Array.isArray||function(b){return"[object Array]"==P.call(b)},E=[],D={},C={timeout:function(d,c){return c.length&&(d.timeout=c[0]),d}},N,L;L=function(e){function c(i){var i=i.split("!"),h=E.length,q=i.pop(),p=i.length,q={url:q,origUrl:q,prefixes:i},o,l,j;for(l=0;l<p;l++){j=i[l].split("="),(o=C[j.shift()])&&(q=o(q,j))}for(l=0;l<h;l++){q=E[l](q)}return q}function n(b,s,r,q,p){var o=c(b),l=o.autoCallback;o.url.split(".").pop().split("?").shift(),o.bypass||(s&&(s=aa(s)?s:s[b]||s[q]||s[b.split("/").pop().split("?")[0]]),o.instead?o.instead(b,s,r,q,p):(D[o.url]?o.noexec=!0:D[o.url]=1,r.load(o.url,o.forceCSS||!o.forceJS&&"css"==o.url.split(".").pop().split("?").shift()?"c":ab,o.noexec,o.attrs,o.timeout),(aa(s)||aa(l))&&r.load(function(){T(),s&&s(o.origUrl,p,q),l&&l(o.origUrl,p,q),D[o.url]=2})))}function m(w,v){function u(b,h){if(b){if(Z(b)){h||(r=function(){var i=[].slice.call(arguments);q.apply(this,i),p()}),n(b,r,v,0,t)}else{if(Object(b)===b){for(g in o=function(){var a=0,i;for(i in b){b.hasOwnProperty(i)&&a++}return a}(),b){b.hasOwnProperty(g)&&(!h&&!--o&&(aa(r)?r=function(){var i=[].slice.call(arguments);q.apply(this,i),p()}:r[g]=function(i){return function(){var a=[].slice.call(arguments);i&&i.apply(this,a),p()}}(q[g])),n(b[g],r,v,g,t))}}}}else{!h&&p()}}var t=!!w.test,s=w.load||w.both,r=w.callback||Y,q=r,p=w.complete||Y,o,g;u(t?w.yep:w.nope,!!s),s&&u(s)}var k,f,d=this.yepnope.loader;if(Z(e)){n(e,0,d,0)}else{if(F(e)){for(k=0;k<e.length;k++){f=e[k],Z(f)?n(f,0,d,0):F(f)?L(f):Object(f)===f&&m(f,d)}}else{Object(e)===e&&m(e,d)}}},L.addPrefix=function(d,c){C[d]=c},L.addFilter=function(b){E.push(b)},L.errorTimeout=10000,null==ac.readyState&&ac.addEventListener&&(ac.readyState="loading",ac.addEventListener("DOMContentLoaded",N=function(){ac.removeEventListener("DOMContentLoaded",N,0),ac.readyState="complete"},0)),ad.yepnope=T(),ad.yepnope.executeStack=W,ad.yepnope.injectJs=function(r,q,p,n,m,h){var g=ac.createElement("script"),f,b,n=n||L.errorTimeout;g.src=r;for(b in p){g.setAttribute(b,p[b])}q=h?W:q||Y,g.onreadystatechange=g.onload=function(){!f&&X(g.readyState)&&(f=1,q(),g.onload=g.onreadystatechange=null)},R(function(){f||(f=1,q(1))},n),m?g.onload():Q.parentNode.insertBefore(g,Q)},ad.yepnope.injectCss=function(b,n,m,l,k,h){var l=ac.createElement("link"),f,n=h?W:n||Y;l.href=b,l.rel="stylesheet",l.type="text/css";for(f in m){l.setAttribute(f,m[f])}k||(Q.parentNode.insertBefore(l,Q),R(n,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))},Modernizr.addTest("boxsizing",function(){return Modernizr.testAllProps("boxSizing")&&(document.documentMode===undefined||document.documentMode>7)}),Modernizr.addTest("mediaqueries",Modernizr.mq("only all")),Modernizr.addTest("ie8compat",function(){return !window.addEventListener&&document.documentMode&&document.documentMode===7});
1102'use strict';
1103
1104var PopupManager = {
1105    storageKey: 'hidePopup_',
1106    getToday: function() {
1107        return new Date().toISOString().split('T')[0];
1108    },
1109    // 오늘 다시 보지 않기 저장
1110    save: function(popupId) {
1111        localStorage.setItem(this.storageKey + popupId, this.getToday());
1112    },
1113    // 오늘 다시 보지 않기 여부 확인
1114    isHidden: function(popupId) {
1115        return localStorage.getItem(this.storageKey + popupId) === this.getToday();
1116    }
1117};
1118
1119var _typeof =
1120  typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'
1121    ? function (obj) {
1122        return typeof obj;
1123      }
1124    : function (obj) {
1125        return obj && typeof Symbol === 'function' && obj.constructor === Symbol ? 'symbol' : typeof obj;
1126      };
1127
1128/* popup layer */
1129var AP2022Modal = function AP2022Modal(params) {
1130  /* find */
1131  if (!Array.prototype.find) {
1132    Object.defineProperty(Array.prototype, 'find', {
1133      value: function value(predicate) {
1134        // 1. Let O be ? ToObject(this value).
1135        if (this == null) {
1136          throw new TypeError('"this" is null or not defined');
1137        }
1138
1139        var o = Object(this);
1140
1141        // 2. Let len be ? ToLength(? Get(O, "length")).
1142        var len = o.length >>> 0;
1143
1144        // 3. If IsCallable(predicate) is false, throw a TypeError exception.
1145        if (typeof predicate !== 'function') {
1146          throw new TypeError('predicate must be a function');
1147        }
1148
1149        // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.
1150        var thisArg = arguments[1];
1151
1152        // 5. Let k be 0.
1153        var k = 0;
1154
1155        // 6. Repeat, while k < len
1156        while (k < len) {
1157          // a. Let Pk be ! ToString(k).
1158          // b. Let kValue be ? Get(O, Pk).
1159          // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
1160          // d. If testResult is true, return kValue.
1161          var kValue = o[k];
1162          if (predicate.call(thisArg, kValue, k, o)) {
1163            return kValue;
1164          }
1165          // e. Increase k by 1.
1166          k++;
1167        }
1168
1169        // 7. Return undefined.
1170        return undefined;
1171      },
1172      configurable: true,
1173      writable: true
1174    });
1175  }
1176
1177  /* closest */
1178  if (!Element.prototype.matches) {
1179    Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
1180  }
1181
1182  if (!Element.prototype.closest) {
1183    Element.prototype.closest = function (s) {
1184      var el = this;
1185
1186      do {
1187        if (Element.prototype.matches.call(el, s)) return el;
1188        el = el.parentElement || el.parentNode;
1189      } while (el !== null && el.nodeType === 1);
1190      return null;
1191    };
1192  }
1193
1194  var _this = this;
1195  var defaults = {
1196    layerRootSelectorName: '.ap2022-popup',
1197    popupInnerSelectorName: '.ap2022-popup__inner',
1198    popupScrollSelectorName: '.ap2022-popup__scrollable', // 221230 추가
1199    readyClass: 'is-ready',
1200    activeClass: 'is-active',
1201    closeOutClick: false,
1202    on: {
1203      layerOpenStart: null,
1204      layerOpenEnd: null,
1205      layerCloseStart: null,
1206      layerCloseEnd: null
1207    }
1208  };
1209
1210  _this.activeLayerList = [];
1211  _this.lastFocusElement = null;
1212  _this.tabPressTimer = null;
1213
1214  params = params || {};
1215
1216  for (var prop in defaults) {
1217    if (prop in params && _typeof(params[prop]) === 'object') {
1218      for (var subProp in defaults[prop]) {
1219        if (!(subProp in params[prop])) {
1220          params[prop][subProp] = defaults[prop][subProp];
1221        }
1222      }
1223    } else if (!(prop in params)) {
1224      params[prop] = defaults[prop];
1225    }
1226  }
1227  _this.params = params;
1228
1229  _this.isElement = function (x) {
1230    return x instanceof HTMLElement;
1231  };
1232
1233  _this.clickElements = function () {
1234    return ['[tabindex]', 'a', 'button', 'input', 'select', 'details', 'textarea'];
1235  };
1236
1237  _this.isActiveLayer = function (layer) {
1238    _this.activeLayerList.find(function (obj) {
1239      if (obj.element === layer) {
1240        return true;
1241      } else {
1242        return false;
1243      }
1244    });
1245  };
1246
1247  _this.findActiveLayerIndex = function (layer) {
1248	  for (var i = 0; i < _this.activeLayerList.length; i++) {
1249		if (_this.activeLayerList[i].element === layer) {
1250		  return i;
1251		}
1252	  }
1253	  return -1; // 찾지 못하면 -1 반환
1254	};
1255
1256  _this.whichTransitionEvent = function () {
1257    var el = document.createElement('div');
1258    var transitions = {
1259      transition: 'transitionend',
1260      OTransition: 'oTransitionEnd',
1261      MozTransition: 'transitionend',
1262      WebkitTransition: 'webkitTransitionEnd'
1263    };
1264
1265    for (var t in transitions) {
1266      if (el.style[t] !== undefined) {
1267        return transitions[t];
1268      }
1269    }
1270  };
1271
1272  // 221230 추가
1273  _this.hasScroll = function(scrollElement) {
1274    if (scrollElement.scrollHeight > scrollElement.clientHeight) {
1275      scrollElement.setAttribute('tabindex', 0);
1276    }
1277  }
1278
1279  document.addEventListener('keydown', function (event) {
1280    // 1. 현재 화면에 실제로 '보이는'(.ap2022-popup 중 display가 none이 아닌) 모든 팝업 수집
1281    var allVisiblePopups = Array.prototype.slice.call(document.querySelectorAll('.ap2022-popup')).filter(function(el) {
1282        return window.getComputedStyle(el).display !== 'none';
1283    });
1284
1285    if (allVisiblePopups.length > 0) {
1286        var keyCode = event.keyCode || event.which;
1287        var isTabPressed = !event.shiftKey && keyCode === 9;
1288        var isShiftTabPressed = event.shiftKey && keyCode === 9;
1289        var isEscPressed = event.key === 'Escape' || event.key === 'Esc' || keyCode === 27;
1290
1291        // 2. 화면상 가장 마지막에 있는(DOM 트리 하단 = 사용자 눈에 가장 위) 팝업 선택
1292        var activeLayer = allVisiblePopups[allVisiblePopups.length - 1];
1293        
1294        // 3. 포커스 요소 찾기 (문자열 join 필수)
1295        var focusableSelectors = _this.clickElements().join(',');
1296        var tabElements = activeLayer.querySelectorAll(focusableSelectors);
1297
1298        // ESC 처리
1299        if (isEscPressed) {
1300            event.preventDefault();
1301            _this.close(activeLayer);
1302            return;
1303        }
1304
1305        if (tabElements.length === 0) return;
1306
1307        var firstTabElement = tabElements[0];
1308        var lastTabElement = tabElements[tabElements.length - 1];
1309
1310        // 4. 포커스 가두기
1311        if (isTabPressed) {
1312            if (document.activeElement === lastTabElement) {
1313                event.preventDefault();
1314                firstTabElement.focus();
1315            }
1316        } else if (isShiftTabPressed) {
1317            if (document.activeElement === firstTabElement) {
1318                event.preventDefault();
1319                lastTabElement.focus();
1320            }
1321        }
1322    }
1323});
1324
1325  document.addEventListener('click', function (event) {
1326    if (_this.activeLayerList.length > 0) {
1327      if (event.target.closest(_this.params.layerRootSelectorName) && !event.target.closest(_this.params.popupInnerSelectorName)) {
1328        (function () {
1329          var activeLayer = _this.activeLayerList[_this.activeLayerList.length - 1].element;
1330          var param = _this.activeLayerList[_this.activeLayerList.length - 1].params;
1331          if (param.closeOutClick) {
1332            _this.activeLayerList.find(function (obj) {
1333              if (obj.element === activeLayer) {
1334                _this.closeActiveLayer(activeLayer);
1335              }
1336            });
1337          }
1338        })();
1339      }
1340    }
1341	// [추가] data-modal-event 버튼 클릭 처리
1342	var closeBtn = event.target.closest('[data-modal-event="close"]');
1343	if (closeBtn) {
1344		event.preventDefault();
1345		var layer = closeBtn.closest(_this.params.layerRootSelectorName);
1346		if (layer) {
1347		  _this.close(layer);
1348		}
1349	}
1350  });
1351};
1352
1353AP2022Modal.prototype.open = function (selector, params) {
1354  var _this = this;
1355  var layer = null;
1356  if (!_this.isElement(selector)) {
1357    layer = document.querySelector(selector);
1358  } else {
1359    layer = selector;
1360  }
1361
1362  var currentFocus = document.activeElement;
1363  if (currentFocus && currentFocus !== document.body && currentFocus.tagName !== 'BODY') {
1364    _this.lastFocusElement = currentFocus;
1365  } else {
1366    _this.lastFocusElement = null; 
1367  }
1368
1369  params = params || {};
1370  for (var prop in _this.params) {
1371    if (prop in params && _typeof(params[prop]) === 'object') {
1372      for (var subProp in _this.params[prop]) {
1373        if (!(subProp in params[prop])) {
1374          params[prop][subProp] = _this.params[prop][subProp];
1375        }
1376      }
1377    } else if (!(prop in params)) {
1378      params[prop] = _this.params[prop];
1379    }
1380  }
1381  _this.params = params;
1382
1383  if (layer || layer.classList.contains(layerRootSelectorName)) {
1384    _this.activeLayerList.push({
1385      element: layer,
1386      params: params
1387    });
1388
1389    if (_this.params.on.layerOpenStart && typeof _this.params.on.layerOpenStart === 'function') {
1390      _this.params.on.layerOpenStart();
1391    }
1392
1393    new Promise(function (resolve) {
1394      layer.style.display = '';
1395      resolve();
1396    }).then(function () {
1397      new Promise(function (resolve) {
1398        layer.classList.add(_this.params.readyClass);
1399        resolve();
1400      }).then(function () {
1401        layer.classList.add(_this.params.activeClass);
1402        layer.querySelector(_this.params.popupInnerSelectorName).tabIndex = 0;
1403
1404        var tabElements = layer.querySelectorAll(_this.clickElements());
1405        if (tabElements.length > 0) {
1406			var firstTabElement = tabElements[0];
1407			firstTabElement.focus(); // 여기서 처음 켜질 때 포커스를 잡아줍니다.
1408		}
1409        
1410        if (_this.params.on.layerOpenEnd && typeof _this.params.on.layerOpenEnd === 'function') {
1411          _this.params.on.layerOpenEnd();
1412        }
1413
1414        // 221230 추가 - 스크롤바 있을 경우 tabindex 추가
1415        var scrollElement = layer.querySelector(_this.params.popupScrollSelectorName);
1416        if (scrollElement) {
1417          _this.hasScroll(scrollElement);
1418
1419          var childImgs = scrollElement.querySelectorAll('img');
1420          if (childImgs.length > 0) {
1421            childImgs.forEach(function(img) {
1422              // console.log(img.complete);
1423              if (!img.complete) {
1424                img.addEventListener('load', function() {
1425                  if (this.complete && this.naturalHeight) {
1426                    _this.hasScroll(scrollElement);
1427                  }
1428                })
1429              }
1430            });
1431          }
1432        }
1433      });
1434    });
1435  }
1436};
1437
1438AP2022Modal.prototype.close = function (selector) {
1439  var _this = this;
1440  
1441  var layer = null;
1442  if (!_this.isElement(selector)) {
1443    layer = document.querySelector(selector);
1444  } else {
1445    layer = selector;
1446  }
1447  if (layer || layer.classList.contains(_this.params.layerRootSelectorName)) {
1448    (function () {
1449      
1450      var closeEvent = function closeEvent() {
1451		// 1. 오늘 하루 보지 않기 체크박스 저장
1452		var checkbox = layer.querySelector('input[type="checkbox"][name^="onlyToday"]');
1453		if (checkbox && checkbox.checked) {
1454			PopupManager.save(layer.id);
1455		}
1456
1457		// 2. 클래스 제거 및 활성 리스트에서 삭제
1458		layer.classList.remove(_this.params.readyClass);
1459		var idx = _this.findActiveLayerIndex(layer);
1460		if (idx > -1) {
1461			_this.activeLayerList.splice(idx, 1);
1462		}
1463
1464		// 3. 포커스 복구 로직
1465		if (_this.activeLayerList.length > 0) {
1466			// 상황 A: 뒤에 다른 팝업이 남아있는 경우
1467			var activeLayer = _this.activeLayerList[_this.activeLayerList.length - 1].element;
1468			var tabElements = activeLayer.querySelectorAll(_this.clickElements().join(','));
1469			if (tabElements.length > 0) {
1470				tabElements[0].focus();
1471			}
1472		} else {
1473			console.log(_this.lastFocusElement);
1474			// 상황 B: 마지막 팝업이 닫힌 경우
1475			if (_this.lastFocusElement) {
1476				// 버튼 클릭으로 열렸던 경우: 원래 버튼으로 복구
1477				_this.lastFocusElement.focus();
1478				_this.lastFocusElement = null;
1479			} else {
1480				window.scrollTo(0, 0);
1481				document.body.setAttribute('tabindex', '-1');
1482				document.body.focus();
1483			}
1484		}
1485
1486		// 4. 팝업 숨김 및 콜백 실행
1487		layer.style.display = 'none';
1488		if (_this.params.on.layerCloseEnd && typeof _this.params.on.layerCloseEnd === 'function') {
1489			_this.params.on.layerCloseEnd();
1490		}
1491	};
1492
1493      var style = getComputedStyle(layer);
1494
1495      new Promise(function (resolve) {
1496        layer.classList.remove(_this.params.activeClass);
1497        if (_this.params.on.layerCloseStart && typeof _this.params.on.layerCloseStart === 'function') {
1498          _this.params.on.layerCloseStart();
1499        }
1500
1501        resolve();
1502      }).then(function () {
1503        if(_this.closeTimer) {
1504          clearTimeout(_this.closeTimer);
1505          _this.closeTimer = null;
1506        }
1507        
1508        if (style.transition !== 'all 0s ease 0s') {
1509          const transitionDuration = style.transitionDuration.split('s')[0] * 1000;
1510          _this.closeTimer = setTimeout(function() {
1511            closeEvent();
1512          }, transitionDuration);
1513          //layer.addEventListener(_this.whichTransitionEvent(), closeEvent, {once: true});
1514        } else {
1515          closeEvent();
1516        }
1517      });
1518    })();
1519  }
1520};
1521
1522AP2022Modal.prototype.closeActiveLayer = function (selector) {
1523  var _this = this;
1524  var lastActiveLayer = _this.activeLayerList[_this.activeLayerList.length - 1].element;
1525
1526  if (selector) {
1527    if (lastActiveLayer === selector) {
1528      _this.close(lastActiveLayer);
1529    }
1530  } else {
1531    _this.close(lastActiveLayer);
1532  }
1533};
1534function instantiateModal() {
1535    var modals = document.querySelectorAll('[data-ap2022-modal]');
1536    if (modals.length) {
1537        window.modal = new AP2022Modal();
1538        
1539        modals.forEach(function(popup) {
1540            // 오늘 하루 보지 않기 체크
1541            if (popup.id && PopupManager.isHidden(popup.id)) {
1542                popup.style.display = 'none';
1543                popup.classList.remove('is-active');
1544                return;
1545            }
1546
1547            if (popup.classList.contains('is-active')) {
1548                window.modal.open(popup);
1549            }
1550        });
1551    }
1552}
1553
1554if (typeof document !== 'undefined') {
1555  if (document.readyState === 'loading') {
1556    document.addEventListener('DOMContentLoaded', instantiateModal);
1557  } else {
1558    instantiateModal();
1559  }
1560}
1561var SWS = window.SWS || {};
1562$(function(){
1563    SWS.$win = $(window);
1564})
1565var swfobject = function() {
1566    var aq = "undefined",
1567        aD = "object",
1568        ab = "Shockwave Flash",
1569        X = "ShockwaveFlash.ShockwaveFlash",
1570        aE = "application/x-shockwave-flash",
1571        ac = "SWFObjectExprInst",
1572        ax = "onreadystatechange",
1573        af = window,
1574        aL = document,
1575        aB = navigator,
1576        aa = false,
1577        Z = [aN],
1578        aG = [],
1579        ag = [],
1580        al = [],
1581        aJ, ad, ap, at, ak = false,
1582        aU = false,
1583        aH, an, aI = true,
1584        ah = function() {
1585            var a = typeof aL.getElementById != aq && typeof aL.getElementsByTagName != aq && typeof aL.createElement != aq,
1586                e = aB.userAgent.toLowerCase(),
1587                c = aB.platform.toLowerCase(),
1588                i = c ? /win/.test(c) : /win/.test(e),
1589                k = c ? /mac/.test(c) : /mac/.test(e),
1590                h = /webkit/.test(e) ? parseFloat(e.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false,
1591                d = !+"\v1",
1592                g = [0, 0, 0],
1593                l = null;
1594            if (typeof aB.plugins != aq && typeof aB.plugins[ab] == aD) {
1595                l = aB.plugins[ab].description;
1596                if (l && !(typeof aB.mimeTypes != aq && aB.mimeTypes[aE] && !aB.mimeTypes[aE].enabledPlugin)) {
1597                    aa = true;
1598                    d = false;
1599                    l = l.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
1600                    g[0] = parseInt(l.replace(/^(.*)\..*$/, "$1"), 10);
1601                    g[1] = parseInt(l.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
1602                    g[2] = /[a-zA-Z]/.test(l) ? parseInt(l.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0
1603                }
1604            } else {
1605                if (typeof af.ActiveXObject != aq) {
1606                    try {
1607                        var j = new ActiveXObject(X);
1608                        if (j) {
1609                            l = j.GetVariable("$version");
1610                            if (l) {
1611                                d = true;
1612                                l = l.split(" ")[1].split(",");
1613                                g = [parseInt(l[0], 10), parseInt(l[1], 10), parseInt(l[2], 10)]
1614                            }
1615                        }
1616                    } catch (b) {}
1617                }
1618            }
1619            return {
1620                w3: a,
1621                pv: g,
1622                wk: h,
1623                ie: d,
1624                win: i,
1625                mac: k
1626            }
1627        }(),
1628        aK = function() {
1629            if (!ah.w3) {
1630                return
1631            }
1632            if ((typeof aL.readyState != aq && aL.readyState == "complete") || (typeof aL.readyState == aq && (aL.getElementsByTagName("body")[0] || aL.body))) {
1633                aP()
1634            }
1635            if (!ak) {
1636                if (typeof aL.addEventListener != aq) {
1637                    aL.addEventListener("DOMContentLoaded", aP, false)
1638                }
1639                if (ah.ie && ah.win) {
1640                    aL.attachEvent(ax, function() {
1641                        if (aL.readyState == "complete") {
1642                            aL.detachEvent(ax, arguments.callee);
1643                            aP()
1644                        }
1645                    });
1646                    if (af == top) {
1647                        (function() {
1648                            if (ak) {
1649                                return
1650                            }
1651                            try {
1652                                aL.documentElement.doScroll("left")
1653                            } catch (a) {
1654                                setTimeout(arguments.callee, 0);
1655                                return
1656                            }
1657                            aP()
1658                        })()
1659                    }
1660                }
1661                if (ah.wk) {
1662                    (function() {
1663                        if (ak) {
1664                            return
1665                        }
1666                        if (!/loaded|complete/.test(aL.readyState)) {
1667                            setTimeout(arguments.callee, 0);
1668                            return
1669                        }
1670                        aP()
1671                    })()
1672                }
1673                aC(aP)
1674            }
1675        }();
1676
1677    function aP() {
1678        if (ak) {
1679            return
1680        }
1681        try {
1682            var b = aL.getElementsByTagName("body")[0].appendChild(ar("span"));
1683            b.parentNode.removeChild(b)
1684        } catch (a) {
1685            return
1686        }
1687        ak = true;
1688        var d = Z.length;
1689        for (var c = 0; c < d; c++) {
1690            Z[c]()
1691        }
1692    }
1693
1694    function aj(a) {
1695        if (ak) {
1696            a()
1697        } else {
1698            Z[Z.length] = a
1699        }
1700    }
1701
1702    function aC(a) {
1703        if (typeof af.addEventListener != aq) {
1704            af.addEventListener("load", a, false)
1705        } else {
1706            if (typeof aL.addEventListener != aq) {
1707                aL.addEventListener("load", a, false)
1708            } else {
1709                if (typeof af.attachEvent != aq) {
1710                    aM(af, "onload", a)
1711                } else {
1712                    if (typeof af.onload == "function") {
1713                        var b = af.onload;
1714                        af.onload = function() {
1715                            b();
1716                            a()
1717                        }
1718                    } else {
1719                        af.onload = a
1720                    }
1721                }
1722            }
1723        }
1724    }
1725
1726    function aN() {
1727        if (aa) {
1728            Y()
1729        } else {
1730            am()
1731        }
1732    }
1733
1734    function Y() {
1735        var d = aL.getElementsByTagName("body")[0];
1736        var b = ar(aD);
1737        b.setAttribute("type", aE);
1738        var a = d.appendChild(b);
1739        if (a) {
1740            var c = 0;
1741            (function() {
1742                if (typeof a.GetVariable != aq) {
1743                    var e = a.GetVariable("$version");
1744                    if (e) {
1745                        e = e.split(" ")[1].split(",");
1746                        ah.pv = [parseInt(e[0], 10), parseInt(e[1], 10), parseInt(e[2], 10)]
1747                    }
1748                } else {
1749                    if (c < 10) {
1750                        c++;
1751                        setTimeout(arguments.callee, 10);
1752                        return
1753                    }
1754                }
1755                d.removeChild(b);
1756                a = null;
1757                am()
1758            })()
1759        } else {
1760            am()
1761        }
1762    }
1763
1764    function am() {
1765        var h = aG.length;
1766        if (h > 0) {
1767            for (var i = 0; i < h; i++) {
1768                var c = aG[i].id;
1769                var m = aG[i].callbackFn;
1770                var a = {
1771                    success: false,
1772                    id: c
1773                };
1774                if (ah.pv[0] > 0) {
1775                    var j = aS(c);
1776                    if (j) {
1777                        if (ao(aG[i].swfVersion) && !(ah.wk && ah.wk < 312)) {
1778                            ay(c, true);
1779                            if (m) {
1780                                a.success = true;
1781                                a.ref = av(c);
1782                                m(a)
1783                            }
1784                        } else {
1785                            if (aG[i].expressInstall && au()) {
1786                                var e = {};
1787                                e.data = aG[i].expressInstall;
1788                                e.width = j.getAttribute("width") || "0";
1789                                e.height = j.getAttribute("height") || "0";
1790                                if (j.getAttribute("class")) {
1791                                    e.styleclass = j.getAttribute("class")
1792                                }
1793                                if (j.getAttribute("align")) {
1794                                    e.align = j.getAttribute("align")
1795                                }
1796                                var g = {};
1797                                var d = j.getElementsByTagName("param");
1798                                var l = d.length;
1799                                for (var k = 0; k < l; k++) {
1800                                    if (d[k].getAttribute("name").toLowerCase() != "movie") {
1801                                        g[d[k].getAttribute("name")] = d[k].getAttribute("value")
1802                                    }
1803                                }
1804                                ae(e, g, c, m)
1805                            } else {
1806                                aF(j);
1807                                if (m) {
1808                                    m(a)
1809                                }
1810                            }
1811                        }
1812                    }
1813                } else {
1814                    ay(c, true);
1815                    if (m) {
1816                        var b = av(c);
1817                        if (b && typeof b.SetVariable != aq) {
1818                            a.success = true;
1819                            a.ref = b
1820                        }
1821                        m(a)
1822                    }
1823                }
1824            }
1825        }
1826    }
1827
1828    function av(b) {
1829        var d = null;
1830        var c = aS(b);
1831        if (c && c.nodeName == "OBJECT") {
1832            if (typeof c.SetVariable != aq) {
1833                d = c
1834            } else {
1835                var a = c.getElementsByTagName(aD)[0];
1836                if (a) {
1837                    d = a
1838                }
1839            }
1840        }
1841        return d
1842    }
1843
1844    function au() {
1845        return !aU && ao("6.0.65") && (ah.win || ah.mac) && !(ah.wk && ah.wk < 312)
1846    }
1847
1848    function ae(g, d, i, e) {
1849        aU = true;
1850        ap = e || null;
1851        at = {
1852            success: false,
1853            id: i
1854        };
1855        var a = aS(i);
1856        if (a) {
1857            if (a.nodeName == "OBJECT") {
1858                aJ = aO(a);
1859                ad = null
1860            } else {
1861                aJ = a;
1862                ad = i
1863            }
1864            g.id = ac;
1865            if (typeof g.width == aq || (!/%$/.test(g.width) && parseInt(g.width, 10) < 310)) {
1866                g.width = "310"
1867            }
1868            if (typeof g.height == aq || (!/%$/.test(g.height) && parseInt(g.height, 10) < 137)) {
1869                g.height = "137"
1870            }
1871            aL.title = aL.title.slice(0, 47) + " - Flash Player Installation";
1872            var b = ah.ie && ah.win ? "ActiveX" : "PlugIn",
1873                c = "MMredirectURL=" + af.location.toString().replace(/&/g, "%26") + "&MMplayerType=" + b + "&MMdoctitle=" + aL.title;
1874            if (typeof d.flashvars != aq) {
1875                d.flashvars += "&" + c
1876            } else {
1877                d.flashvars = c
1878            }
1879            if (ah.ie && ah.win && a.readyState != 4) {
1880                var h = ar("div");
1881                i += "SWFObjectNew";
1882                h.setAttribute("id", i);
1883                a.parentNode.insertBefore(h, a);
1884                a.style.display = "none";
1885                (function() {
1886                    if (a.readyState == 4) {
1887                        a.parentNode.removeChild(a)
1888                    } else {
1889                        setTimeout(arguments.callee, 10)
1890                    }
1891                })()
1892            }
1893            aA(g, d, i)
1894        }
1895    }
1896
1897    function aF(a) {
1898        if (ah.ie && ah.win && a.readyState != 4) {
1899            var b = ar("div");
1900            a.parentNode.insertBefore(b, a);
1901            b.parentNode.replaceChild(aO(a), b);
1902            a.style.display = "none";
1903            (function() {
1904                if (a.readyState == 4) {
1905                    a.parentNode.removeChild(a)
1906                } else {
1907                    setTimeout(arguments.callee, 10)
1908                }
1909            })()
1910        } else {
1911            a.parentNode.replaceChild(aO(a), a)
1912        }
1913    }
1914
1915    function aO(b) {
1916        var d = ar("div");
1917        if (ah.win && ah.ie) {
1918            d.innerHTML = b.innerHTML
1919        } else {
1920            var e = b.getElementsByTagName(aD)[0];
1921            if (e) {
1922                var a = e.childNodes;
1923                if (a) {
1924                    var g = a.length;
1925                    for (var c = 0; c < g; c++) {
1926                        if (!(a[c].nodeType == 1 && a[c].nodeName == "PARAM") && !(a[c].nodeType == 8)) {
1927                            d.appendChild(a[c].cloneNode(true))
1928                        }
1929                    }
1930                }
1931            }
1932        }
1933        return d
1934    }
1935
1936    function aA(e, h, c) {
1937        var d, a = aS(c);
1938        if (ah.wk && ah.wk < 312) {
1939            return d
1940        }
1941        if (a) {
1942            if (typeof e.id == aq) {
1943                e.id = c
1944            }
1945            if (ah.ie && ah.win) {
1946                var g = "";
1947                for (var j in e) {
1948                    if (e[j] != Object.prototype[j]) {
1949                        if (j.toLowerCase() == "data") {
1950                            h.movie = e[j]
1951                        } else {
1952                            if (j.toLowerCase() == "styleclass") {
1953                                g += ' class="' + e[j] + '"'
1954                            } else {
1955                                if (j.toLowerCase() != "classid") {
1956                                    g += " " + j + '="' + e[j] + '"'
1957                                }
1958                            }
1959                        }
1960                    }
1961                }
1962                var i = "";
1963                for (var k in h) {
1964                    if (h[k] != Object.prototype[k]) {
1965                        i += '<param name="' + k + '" value="' + h[k] + '" />'
1966                    }
1967                }
1968                a.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + g + ">" + i + "</object>";
1969                ag[ag.length] = e.id;
1970                d = aS(e.id)
1971            } else {
1972                var b = ar(aD);
1973                b.setAttribute("type", aE);
1974                for (var l in e) {
1975                    if (e[l] != Object.prototype[l]) {
1976                        if (l.toLowerCase() == "styleclass") {
1977                            b.setAttribute("class", e[l])
1978                        } else {
1979                            if (l.toLowerCase() != "classid") {
1980                                b.setAttribute(l, e[l])
1981                            }
1982                        }
1983                    }
1984                }
1985                for (var m in h) {
1986                    if (h[m] != Object.prototype[m] && m.toLowerCase() != "movie") {
1987                        aQ(b, m, h[m])
1988                    }
1989                }
1990                a.parentNode.replaceChild(b, a);
1991                d = b
1992            }
1993        }
1994        return d
1995    }
1996
1997    function aQ(b, d, c) {
1998        var a = ar("param");
1999        a.setAttribute("name", d);
2000        a.setAttribute("value", c);
2001        b.appendChild(a)
2002    }
2003
2004    function aw(a) {
2005        var b = aS(a);
2006        if (b && b.nodeName == "OBJECT") {
2007            if (ah.ie && ah.win) {
2008                b.style.display = "none";
2009                (function() {
2010                    if (b.readyState == 4) {
2011                        aT(a)
2012                    } else {
2013                        setTimeout(arguments.callee, 10)
2014                    }
2015                })()
2016            } else {
2017                b.parentNode.removeChild(b)
2018            }
2019        }
2020    }
2021
2022    function aT(a) {
2023        var b = aS(a);
2024        if (b) {
2025            for (var c in b) {
2026                if (typeof b[c] == "function") {
2027                    b[c] = null
2028                }
2029            }
2030            b.parentNode.removeChild(b)
2031        }
2032    }
2033
2034    function aS(a) {
2035        var c = null;
2036        try {
2037            c = aL.getElementById(a)
2038        } catch (b) {}
2039        return c
2040    }
2041
2042    function ar(a) {
2043        return aL.createElement(a)
2044    }
2045
2046    function aM(a, c, b) {
2047        a.attachEvent(c, b);
2048        al[al.length] = [a, c, b]
2049    }
2050
2051    function ao(a) {
2052        var b = ah.pv,
2053            c = a.split(".");
2054        c[0] = parseInt(c[0], 10);
2055        c[1] = parseInt(c[1], 10) || 0;
2056        c[2] = parseInt(c[2], 10) || 0;
2057        return (b[0] > c[0] || (b[0] == c[0] && b[1] > c[1]) || (b[0] == c[0] && b[1] == c[1] && b[2] >= c[2])) ? true : false
2058    }
2059
2060    function az(b, g, a, c) {
2061        if (ah.ie && ah.mac) {
2062            return
2063        }
2064        var e = aL.getElementsByTagName("head")[0];
2065        if (!e) {
2066            return
2067        }
2068        var h = (a && typeof a == "string") ? a : "screen";
2069        if (c) {
2070            aH = null;
2071            an = null
2072        }
2073        if (!aH || an != h) {
2074            var d = ar("style");
2075            d.setAttribute("type", "text/css");
2076            d.setAttribute("media", h);
2077            aH = e.appendChild(d);
2078            if (ah.ie && ah.win && typeof aL.styleSheets != aq && aL.styleSheets.length > 0) {
2079                aH = aL.styleSheets[aL.styleSheets.length - 1]
2080            }
2081            an = h
2082        }
2083        if (ah.ie && ah.win) {
2084            if (aH && typeof aH.addRule == aD) {
2085                aH.addRule(b, g)
2086            }
2087        } else {
2088            if (aH && typeof aL.createTextNode != aq) {
2089                aH.appendChild(aL.createTextNode(b + " {" + g + "}"))
2090            }
2091        }
2092    }
2093
2094    function ay(a, c) {
2095        if (!aI) {
2096            return
2097        }
2098        var b = c ? "visible" : "hidden";
2099        if (ak && aS(a)) {
2100            aS(a).style.visibility = b
2101        } else {
2102            az("#" + a, "visibility:" + b)
2103        }
2104    }
2105
2106    function ai(b) {
2107        var a = /[\\\"<>\.;]/;
2108        var c = a.exec(b) != null;
2109        return c && typeof encodeURIComponent != aq ? encodeURIComponent(b) : b
2110    }
2111    var aR = function() {
2112        if (ah.ie && ah.win) {
2113            window.attachEvent("onunload", function() {
2114                var a = al.length;
2115                for (var b = 0; b < a; b++) {
2116                    al[b][0].detachEvent(al[b][1], al[b][2])
2117                }
2118                var d = ag.length;
2119                for (var c = 0; c < d; c++) {
2120                    aw(ag[c])
2121                }
2122                for (var e in ah) {
2123                    ah[e] = null
2124                }
2125                ah = null;
2126                for (var g in swfobject) {
2127                    swfobject[g] = null
2128                }
2129                swfobject = null
2130            })
2131        }
2132    }();
2133    return {
2134        registerObject: function(a, e, c, b) {
2135            if (ah.w3 && a && e) {
2136                var d = {};
2137                d.id = a;
2138                d.swfVersion = e;
2139                d.expressInstall = c;
2140                d.callbackFn = b;
2141                aG[aG.length] = d;
2142                ay(a, false)
2143            } else {
2144                if (b) {
2145                    b({
2146                        success: false,
2147                        id: a
2148                    })
2149                }
2150            }
2151        },
2152        getObjectById: function(a) {
2153            if (ah.w3) {
2154                return av(a)
2155            }
2156        },
2157        embedSWF: function(l, e, i, g, c, a, b, j, h, k) {
2158            var d = {
2159                success: false,
2160                id: e
2161            };
2162            if (ah.w3 && !(ah.wk && ah.wk < 312) && l && e && i && g && c) {
2163                ay(e, false);
2164                aj(function() {
2165                    i += "";
2166                    g += "";
2167                    var r = {};
2168                    if (h && typeof h === aD) {
2169                        for (var p in h) {
2170                            r[p] = h[p]
2171                        }
2172                    }
2173                    r.data = l;
2174                    r.width = i;
2175                    r.height = g;
2176                    var o = {};
2177                    if (j && typeof j === aD) {
2178                        for (var q in j) {
2179                            o[q] = j[q]
2180                        }
2181                    }
2182                    if (b && typeof b === aD) {
2183                        for (var m in b) {
2184                            if (typeof o.flashvars != aq) {
2185                                o.flashvars += "&" + m + "=" + b[m]
2186                            } else {
2187                                o.flashvars = m + "=" + b[m]
2188                            }
2189                        }
2190                    }
2191                    if (ao(c)) {
2192                        var n = aA(r, o, e);
2193                        if (r.id == e) {
2194                            ay(e, true)
2195                        }
2196                        d.success = true;
2197                        d.ref = n
2198                    } else {
2199                        if (a && au()) {
2200                            r.data = a;
2201                            ae(r, o, e, k);
2202                            return
2203                        } else {
2204                            ay(e, true)
2205                        }
2206                    }
2207                    if (k) {
2208                        k(d)
2209                    }
2210                })
2211            } else {
2212                if (k) {
2213                    k(d)
2214                }
2215            }
2216        },
2217        switchOffAutoHideShow: function() {
2218            aI = false
2219        },
2220        ua: ah,
2221        getFlashPlayerVersion: function() {
2222            return {
2223                major: ah.pv[0],
2224                minor: ah.pv[1],
2225                release: ah.pv[2]
2226            }
2227        },
2228        hasFlashPlayerVersion: ao,
2229        createSWF: function(a, b, c) {
2230            if (ah.w3) {
2231                return aA(a, b, c)
2232            } else {
2233                return undefined
2234            }
2235        },
2236        showExpressInstall: function(b, a, d, c) {
2237            if (ah.w3 && au()) {
2238                ae(b, a, d, c)
2239            }
2240        },
2241        removeSWF: function(a) {
2242            if (ah.w3) {
2243                aw(a)
2244            }
2245        },
2246        createCSS: function(b, a, c, d) {
2247            if (ah.w3) {
2248                az(b, a, c, d)
2249            }
2250        },
2251        addDomLoadEvent: aj,
2252        addLoadEvent: aC,
2253        getQueryParamValue: function(b) {
2254            var a = aL.location.search || aL.location.hash;
2255            if (a) {
2256                if (/\?/.test(a)) {
2257                    a = a.split("?")[1]
2258                }
2259                if (b == null) {
2260                    return ai(a)
2261                }
2262                var c = a.split("&");
2263                for (var d = 0; d < c.length; d++) {
2264                    if (c[d].substring(0, c[d].indexOf("=")) == b) {
2265                        return ai(c[d].substring((c[d].indexOf("=") + 1)))
2266                    }
2267                }
2268            }
2269            return ""
2270        },
2271        expressInstallCallback: function() {
2272            if (aU) {
2273                var a = aS(ac);
2274                if (a && aJ) {
2275                    a.parentNode.replaceChild(aJ, a);
2276                    if (ad) {
2277                        ay(ad, true);
2278                        if (ah.ie && ah.win) {
2279                            aJ.style.display = "block"
2280                        }
2281                    }
2282                    if (ap) {
2283                        ap(at)
2284                    }
2285                }
2286                aU = false
2287            }
2288        }
2289    }
2290}();
2291(function(b) {
2292    var a = {};
2293    b.fn.ytchromeless = function(d) {
2294        var c = {
2295            videoWidth: "640",
2296            videoHeight: "360",
2297            videoIdBase: "ytplayer",
2298            autoplay: false,
2299            mute: false,
2300            start: 0,
2301            end: 0,
2302            loop: false,
2303            params: {
2304                allowScriptAccess: "always",
2305                wmode: "transparent"
2306            },
2307            onReady: undefined,
2308            onStateChange: undefined
2309        };
2310        return this.each(function(k) {
2311            var j = b.extend({}, c, d),
2312                l = b(this),
2313                g = l.attr("href"),
2314                m = l.attr("id") || j.videoIdBase + k,
2315                n = g.substr(31),
2316                h = l.wrap('<div class="video-player"></div>').parent(),
2317                r = b('<div class="video"></div>').prependTo(h).attr("id", m),
2318                q, e = false,
2319                p = false;
2320            onYouTubePlayerReady = function(i) {
2321                console.log("[ytchromeless] ready", i);
2322                q.cueVideoById(n);
2323                if (j.mute) {
2324                    q.mute()
2325                }
2326                if (j.autoplay) {
2327                    q.playVideo()
2328                }
2329                setInterval(function() {
2330                    var o = q.getPlayerState(),
2331                        s = q.getCurrentTime();
2332                    if (o !== e) {
2333                        log("[ytchromeless] state changed", o);
2334                        e = o;
2335                        if (!p && e === 1 && j.start > 0) {
2336                            log("[ytchromeless] start from", j.start + "s");
2337                            q.seekTo(j.start, true);
2338                            p = true
2339                        }
2340                        if (j.loop && e === 0) {
2341                            log("[ytchromeless] video ended. restart to", j.start + "s");
2342                            q.seekTo(j.start, true)
2343                        }
2344                        if (typeof j.onStateChange === "function") {
2345                            j.onStateChange(e)
2346                        }
2347                    }
2348                    if (j.end > 0 && j.end > j.start && j.end <= s) {
2349                        if (j.loop) {
2350                            log("[ytchromeless] restart to", j.start + "s");
2351                            q.seekTo(j.start, true)
2352                        } else {
2353                            log("[ytchromeless] stop video at end point");
2354                            q.stopVideo()
2355                        }
2356                    }
2357                }, 100)
2358            };
2359            h.init = function() {
2360                swfobject.embedSWF("http://www.youtube.com/apiplayer?version=3&enablejsapi=1&playerapiid=" + m, m, j.videoWidth, j.videoHeight, "8", null, null, j.params, {
2361                    id: m
2362                }, function() {
2363                    q = document.getElementById(m);
2364                    if (typeof j.onReady === "function") {
2365                        j.onReady(q)
2366                    }
2367                });
2368                l.hide()
2369            };
2370            h.init()
2371        })
2372    }
2373})(jQuery);
2374
2375// 2023 접근성 공통 UI
2376const AP2022A11Y = (function() {
2377    const _hasScroll = function(scrollElement) {
2378      if (scrollElement.scrollHeight > scrollElement.clientHeight) {
2379        scrollElement.setAttribute('tabindex', 0);
2380      } else {
2381        scrollElement.removeAttribute('tabindex');
2382      }
2383    }
2384  
2385    const _getScrollHeight = function(scrollElement) {
2386      const computedStyles = window.getComputedStyle(scrollElement);
2387      return (computedStyles.maxHeight !== 'none') ? computedStyles.maxHeight : computedStyles.height;
2388    }
2389  
2390    // 동영상 자막영역 UI
2391    const setVideoScript = {
2392      show: function(params) {
2393        const _this = this;
2394        const defaults = {
2395          rootClass: 'ap2022-video-script-box',
2396          textAreaClass: 'ap2022-video-script-box__text'
2397        }
2398  
2399        params = params || {};
2400        for (const prop in defaults) {
2401          params[prop] = (prop in params) ? params[prop] : defaults[prop];
2402        }
2403  
2404        const videoScriptElement = document.querySelectorAll('.'.concat(params.rootClass));
2405  
2406        if (videoScriptElement.length > 0) {
2407          videoScriptElement.forEach(function(item) {
2408            const textElement = item.querySelector('.'.concat(params.textAreaClass));
2409            if (textElement) {
2410              _hasScroll(textElement);
2411              window.addEventListener('resize', function() {
2412                _hasScroll(textElement);
2413              });
2414            }
2415          });
2416        }
2417      },
2418      toggle: function(params) {
2419        const _this = this;
2420        const defaults = {
2421          rootClass: 'ap2022-video-script-box',
2422          textAreaClass: 'ap2022-video-script-box__text',
2423          headerClass: 'ap2022-video-script-box__header',
2424          toggleClass: 'ap2022-video-script-box__toggle',
2425          buttonClass: 'ap2022-video-script-box__button',
2426          activeClass: 'is-active',
2427          activeDescription: '닫기',
2428          inactiveDescription: '열기',
2429          buttonLabel: '자막'
2430        }
2431  
2432        params = params || {};
2433        for (const prop in defaults) {
2434          params[prop] = (prop in params) ? params[prop] : defaults[prop];
2435        }
2436        
2437        const videoScriptElement = document.querySelectorAll('.'.concat(params.rootClass));
2438        const buttonContent = '<span>' + params.buttonLabel + '</span><i></i>';
2439        const buttonHTML = '<button type="button" class="' + params.buttonClass + '" title="' + params.inactiveDescription + '">' + buttonContent + '</button>';
2440  
2441        if (videoScriptElement.length > 0) {
2442          videoScriptElement.forEach(function(item) {
2443            const textElement = item.querySelector('.'.concat(params.textAreaClass));
2444            if (textElement) {
2445              // toggle UI 를 위한 HTML 생성
2446              const headerElement = document.createElement('div');
2447              headerElement.className = params.headerClass;
2448              headerElement.innerHTML = buttonHTML;
2449              item.insertBefore(headerElement, item.firstChild);
2450  
2451              const textElementWrapper = document.createElement('div');
2452              textElementWrapper.className = params.toggleClass;
2453              textElement.parentNode.insertBefore(textElementWrapper, textElement);
2454              textElementWrapper.appendChild(textElement);
2455              textElementWrapper.style.display = 'none';
2456              textElementWrapper.style.maxHeight = '0px';
2457  
2458              // toggle 버튼 이벤트 추가
2459              item.addEventListener('click', function(e) {
2460                const buttonElement = e.target.closest('.'.concat(params.buttonClass));
2461                if (buttonElement) {
2462                  if (!item.classList.contains(params.activeClass)) {
2463                    item.classList.add(params.activeClass);
2464                    buttonElement.setAttribute('title', params.activeDescription);
2465                    textElementWrapper.style.display = '';
2466                    textElementWrapper.style.maxHeight = _getScrollHeight(textElement);
2467                    _hasScroll(textElement);
2468                  } else {
2469                    item.classList.remove(params.activeClass);
2470                    buttonElement.setAttribute('title', params.inactiveDescription);
2471                    textElementWrapper.style.maxHeight = '0px';
2472  
2473                    if (window.getComputedStyle(textElementWrapper).transitionDuration === '0s') {
2474                      textElementWrapper.style.display = 'none';
2475                      _hasScroll(textElement);
2476                    } else {
2477                      textElementWrapper.addEventListener('transitionend', function() {
2478                        if (!item.classList.contains(params.activeClass) && textElementWrapper.style.display === '') {
2479                          textElementWrapper.style.display = 'none';
2480                          _hasScroll(textElement);
2481                        }
2482                      });
2483                    }
2484                  }
2485                }
2486              });
2487  
2488              window.addEventListener('resize', function() {
2489                if (textElementWrapper.style.display !== 'none') {
2490                  textElementWrapper.style.maxHeight = _getScrollHeight(textElement);
2491                  _hasScroll(textElement);
2492                }
2493              });
2494            }
2495          });
2496        }
2497      }
2498    }
2499  
2500    return {
2501      setVideoScript: setVideoScript
2502    }
2503  })();
2504
2505
2506// toggleLayer에서 참조하는 adNormalClose 속성 초기화
2507SWS.adNormalClose = SWS.adNormalClose || {
2508    search: false,
2509    sideNav: false
2510};
2511
2512/* 2. toggleLayer jQuery 플러그인 */
2513(function($) {
2514    var $window = $(window);
2515    var defaults = {
2516        side: false,
2517        autoFocus: true,
2518        toggleByClass: false,
2519        activeClass: "is-active",
2520        closeBtnClass: "close-layer",
2521        isopen: false,
2522        onOpen: function($btn, $target) {},
2523        onClose: function($btn, $target) {}
2524    };
2525
2526    $.fn.toggleLayer = function(options) {
2527        if (this.length === 0) return this;
2528        if (this.length > 1) {
2529            this.each(function() {
2530                $(this).toggleLayer(options);
2531            });
2532            return this;
2533        }
2534
2535        var plugin = {};
2536        var $btn = this;
2537        var selector = $btn.selector || "";
2538
2539        var init = function() {
2540            plugin.settings = $.extend({}, defaults, options);
2541            plugin.targetId = $btn.attr("href");
2542            plugin.$target = $(plugin.targetId);
2543            plugin.$close = plugin.$target.find("." + plugin.settings.closeBtnClass);
2544            
2545            // 초기 상태 설정
2546            $btn.data("target", {
2547                isopen: plugin.settings.isopen
2548            });
2549
2550            // 타겟이 이미 보이는 경우 (top-search 제외하고 닫기 처리)
2551            if (plugin.$target.is(":visible")) {
2552                if (plugin.$target.attr("id") !== "top-search") close();
2553            }
2554
2555            // 버튼 클릭 이벤트
2556            $btn.on("click", function(e) {
2557                // SWS 객체 의존성 부분
2558                if (SWS.adNormalClose.search) {
2559                    $btn.data("target", {
2560                        isopen: !plugin.settings.isopen
2561                    });
2562                } else {
2563                    $btn.data("target", {
2564                        isopen: plugin.settings.isopen
2565                    });
2566                }
2567
2568                if ($btn.data("target").isopen) {
2569                    close();
2570                } else {
2571                    open();
2572                }
2573                e.stopPropagation();
2574                e.preventDefault();
2575            });
2576
2577            // 닫기 버튼 클릭 이벤트
2578            plugin.$close.on("click", function(e) {
2579                close();
2580                e.stopPropagation();
2581                e.preventDefault();
2582            });
2583
2584            // 타겟 내부 클릭 시 닫히지 않도록 전파 중단
2585            plugin.$target.on("click", function(e) {
2586                e.stopPropagation();
2587            });
2588
2589            // 외부(body) 클릭 시 닫기
2590            $("body").on("click", function() {
2591                if ($btn.data("target").isopen) {
2592                    close();
2593                }
2594            });
2595
2596            // 리사이즈 이벤트
2597            $window.on("resize", function() {
2598                plugin.settings.side = ($btn.data("layerOption") == undefined) ? false : $btn.data("layerOption");
2599                // Modernizr 의존성 (터치가 아닌 환경에서 리사이즈 시 닫기)
2600                if (typeof Modernizr !== 'undefined' && !Modernizr.touch && plugin.$target.is(":visible")) {
2601                    close();
2602                }
2603            });
2604            
2605            // 초기화 시 타겟 속성 설정 (outline 제거 등)
2606            setupTarget();
2607        };
2608
2609        var setupTarget = function() {
2610            plugin.$target.css({
2611                outline: "0 none"
2612            }).attr({
2613                tabindex: "0"
2614            });
2615            if (plugin.$target.attr("hidden") !== "hidden") {
2616                plugin.$target.attr("tabindex", "0");
2617            } else {
2618                plugin.$target.attr("tabindex", "-1");
2619                plugin.$target.find("a, input, button, select, textarea").attr("tabindex", "-1");
2620            }
2621        };
2622
2623        var close = function() {
2624            if (plugin.settings.activeClass !== "") {
2625                plugin.$target.removeClass(plugin.settings.activeClass);
2626            }
2627            if (plugin.visible) {
2628                plugin.$target.hide();
2629            } else {
2630                plugin.settings.onClose($btn, plugin.$target);
2631            }
2632            if (!plugin.settings.toggleByClass) {
2633                plugin.$target.hide();
2634            }
2635            $btn.removeClass("toggle-on");
2636            $btn.data("target").isopen = false;
2637            plugin.settings.isopen = false;
2638			$btn.attr("aria-expanded",false);
2639            $btn.focus();
2640            
2641            // 중첩된 토글이 있다면 닫기
2642            if (selector && plugin.$target.find(selector).hasClass("toggle-on")) {
2643                plugin.$target.find(selector).trigger("click");
2644            }
2645            
2646            plugin.$target.attr("tabindex", "-1");
2647            plugin.$target.find("a, input, button, select, textarea").attr("tabindex", "-1");
2648        };
2649
2650        var open = function() {
2651            var $focusTarget = plugin.$target;
2652            
2653            // 위치 설정 (side 옵션이 있을 경우)
2654            if (plugin.settings.side !== false) {
2655                var pos = $btn.offset();
2656                var sidePos = (plugin.settings.side == "left") ? pos.left : (pos.left + $btn.outerWidth());
2657                
2658                if (plugin.settings.side == "left") {
2659                    plugin.$target.css({
2660                        top: pos.top,
2661                        left: sidePos - plugin.$target.outerWidth()
2662                    });
2663                } else if (plugin.settings.side == "right") {
2664                    plugin.$target.css({
2665                        top: pos.top,
2666                        right: ($(window).width() - sidePos) - plugin.$target.outerWidth()
2667                    });
2668                }
2669            }
2670            
2671            if (plugin.visible) {
2672                plugin.$target.show();
2673            } else {
2674                plugin.settings.onOpen($btn, plugin.$target);
2675            }
2676            
2677            if (!plugin.settings.toggleByClass) {
2678                plugin.$target.show();
2679            }
2680            if (plugin.settings.activeClass !== "") {
2681                plugin.$target.addClass(plugin.settings.activeClass);
2682            }
2683            
2684            // 오토 포커스
2685            if (plugin.$target.find("input").length && plugin.settings.autoFocus) {
2686                $focusTarget = plugin.$target.find("input").eq(0);
2687            }
2688            $focusTarget.focus();
2689            
2690            $btn.addClass("toggle-on");
2691            $btn.data("target").isopen = true;
2692            plugin.settings.isopen = true;
2693            $btn.attr("aria-expanded",true);
2694            plugin.$target.attr("tabindex", "0");
2695            plugin.$target.find("a, input, button, select, textarea").removeAttr("tabindex");
2696        };
2697
2698        // 외부에서 제어 가능하도록 메서드 노출
2699        $btn.openTarget = open;
2700        $btn.closeTarget = close;
2701        
2702        init();
2703        
2704        return this;
2705    };
2706})(jQuery);
2707// 아코디언
2708(function(a) {
2709    a.fn.accordion = function(b) {
2710        var b = a.extend({
2711            easing: "easeOutQuint",
2712            speed: 400,
2713            titleSelector: ".q",
2714            contSelector: ".a",
2715            collapsible: false,
2716            callback: function() {},
2717            onOpen: function(c) {}
2718        }, b);
2719        return this.each(function() {
2720            var g = a(this),
2721                d = g.find(b.titleSelector),
2722                e = g.find(b.contSelector),
2723                j = d.parent(),
2724                i = g.filter(".on");
2725
2726            // 💡 [핵심 추가] .q 안에 button이나 a 태그가 있으면 거기로 타겟을 좁혀주는 함수
2727            var setAria = function(target, state) {
2728                var btn = target.find("button, a, [role='button']");
2729                (btn.length ? btn : target).attr("aria-expanded", state);
2730            };
2731
2732            var h = function() {
2733                var k = d.outerHeight();
2734
2735                // 1. 초기 렌더링 시 전체 닫힘 처리
2736                setAria(d, "false");
2737
2738                d.on("click keypress", function(l) {
2739                    if (l.type == "click" || l.which == 13) {
2740                        c(a(this).parent())
2741                    }
2742                });
2743                if (!b.collapsible) {
2744                    if (i.length > 0) {
2745                        c(i.eq(0))
2746                    }
2747                } else {
2748                    i.removeClass("on")
2749                }
2750                
2751                // 2. 초기 열려있는(.on) 요소만 상태 업데이트
2752                setAria(j.filter(".on").find(b.titleSelector), "true");
2753                j.not(".on").find(b.contSelector).hide()
2754            };
2755            var c = function(k) {
2756                var l = k.hasClass("on");
2757                j.removeClass("on");
2758                
2759                // 3. 슬라이드 동작 시 전체 리셋
2760                setAria(d, "false");
2761
2762                e.stop(true, true).slideUp({
2763                    duration: b.speed,
2764                    easing: b.easing,
2765                    complete: function() {
2766                        b.callback();
2767                        e.css("zoom", 1)
2768                    }
2769                });
2770                if (l) {
2771                    return
2772                }
2773                
2774                // 4. 선택된 타겟만 true 업데이트
2775                k.addClass("on");
2776                setAria(k.find(b.titleSelector), "true");
2777                
2778                k.find(b.contSelector).stop(true, true).slideDown({
2779                    duration: b.speed,
2780                    easing: b.easing,
2781                    complete: function() {
2782                        b.callback();
2783                        b.onOpen(k)
2784                    }
2785                })
2786            };
2787            h()
2788        })
2789    };
2790    a.fn.accordion1 = function(b) {
2791        var b = a.extend({
2792            easing: "ease",
2793            speed: 400,
2794            titleSelector: ".q",
2795            contSelector: ".a",
2796            collapsible: false,
2797            callback: function() {},
2798            onOpen: function(c) {}
2799        }, b);
2800        return this.each(function() {
2801            var g = a(this),
2802                d = g.find(b.titleSelector),
2803                e = g.find(b.contSelector),
2804                j = d.closest("section"),
2805                i = g.filter(".on");
2806
2807            // 💡 accordion1 에도 동일한 헬퍼 함수 적용
2808            var setAria = function(target, state) {
2809                var btn = target.find("button, a, [role='button']");
2810                (btn.length ? btn : target).attr("aria-expanded", state);
2811            };
2812
2813            var h = function() {
2814                var k = d.outerHeight();
2815
2816                setAria(d, "false");
2817
2818                d.on("click", function(l) {
2819                    if (l.type == "click" || l.which == 13) {
2820                        c(a(this).closest("section"))
2821                    }
2822                });
2823                if (!b.collapsible) {
2824                    if (i.length > 0) {
2825                        c(i.eq(0))
2826                    }
2827                } else {
2828                    i.removeClass("on")
2829                }
2830                
2831                setAria(j.filter(".on").find(b.titleSelector), "true");
2832                j.not(".on").find(b.contSelector).hide()
2833            };
2834            var c = function(k) {
2835                var l = k.hasClass("on");
2836                j.removeClass("on");
2837                
2838                setAria(d, "false");
2839
2840                e.stop(true, true).slideUp({
2841                    duration: b.speed,
2842                    complete: function() {
2843                        b.callback();
2844                        e.css("zoom", 1)
2845                    }
2846                });
2847                if (l) {
2848                    return
2849                }
2850                
2851                k.addClass("on");
2852                setAria(k.find(b.titleSelector), "true");
2853                
2854                k.find(b.contSelector).stop(true, true).slideDown({
2855                    duration: b.speed,
2856                    complete: function() {
2857                        b.callback();
2858                        b.onOpen(k)
2859                    }
2860                })
2861            };
2862            h()
2863        })
2864    }
2865})(jQuery);
2866
2867$(function() {
2868    //nav();
2869    selectbox();
2870    //scrollToTop();
2871    var c = $(".toggle-layer").toggleLayer();
2872    // $(".break-word, .product-name, .detail-concept h2, .detail-content h3, .archive-print-header .h, .archive-name, .archive-section .h").each(function(h, j) {
2873    //     var g = $(j),
2874    //         e;
2875    //     if ($.browser.webkit) {
2876    //         e = new SplitText(g);
2877    //         g.find(">span").css("white-space", "nowrap")
2878    //     } else {
2879    //         g.css({
2880    //             "word-break": "keep-all",
2881    //             "word-wrap": "break-word"
2882    //         })
2883    //     }
2884    // });
2885    //$("#legacy-browser").on("click", "button.legacy-browser-close", function() {
2886    //    $(this).parent().slideUp(200, function() {
2887    //        $(this).remove()
2888    //    })
2889    //});
2890    $(function() {
2891        $(".sch-close").click(function() {
2892            SWS.schClickEvent = true;
2893            if (SWS.schClickEvent) {
2894                $(".misc-links").show();
2895                $(".search-container").hide();
2896                //SWS.$body.removeClass("is-open-search");
2897                $("#top-search").attr("tabindex", "-1");
2898                $("#top-search").find("a, input, button, select, textarea").attr("tabindex", "-1");
2899            };
2900            $('.inner-top-search').one('transitionend webkitTransitionEnd oTransitionEnd otransitionend', function(){
2901                SWS.schClickEvent = false;
2902            });
2903                
2904        });
2905        $(".search-delete").click(function() {
2906            $(".search-box #q").val('');
2907            $(this).attr('hidden', 'true');
2908            $(".search-box #q").focus();
2909        });
2910    $(".footer-toggle-button").on("click", function() {
2911            if ($(this).attr('aria-expanded') === 'false') {
2912                $(this).attr('aria-expanded', 'true');
2913                $(".mo-footer-wrap").slideDown(250);
2914				$('html, body').animate({ scrollTop: $(document).height() }, 250);
2915            } else {
2916                $(this).attr('aria-expanded', 'false');
2917                $(".mo-footer-wrap").slideUp(250);
2918            }
2919            $(this).toggleClass("is-open");
2920        });
2921    });
2922    let isPC = (window.innerWidth < 1024) ? false : true;
2923    window.addEventListener('resize', () => {
2924        let resizePC = (window.innerWidth < 1024) ? false : true;
2925        if(isPC !== resizePC){
2926            document.querySelector(".footer-toggle-button").setAttribute('aria-expanded', 'false');
2927            document.querySelector(".mo-footer-wrap").style.display = '';
2928            isPC = resizePC;
2929        }
2930    });
2931    var a = $(".misc-links");
2932    var d = $("#open-search").toggleLayer({
2933        autoFocus: false,
2934        toggleByClass: true,
2935        isopen: false,
2936        onOpen: function(g, e) {
2937            a.hide();
2938            e.show();
2939            if (SWS.adNormalClose.search) SWS.adNormalClose.search = false;
2940            if (!$("#sidenav-open").is(":visible")) {
2941                //SWS.$body.addClass("is-open-search");
2942                var targetBtnBlur, targetBtnKeyDown, targetBtnShiftKey;
2943                $(".sch-close").on("keydown blur", function(e) {
2944                    if (!SWS.schClickEvent) {
2945                        keyboardFocus(e, "tab", "#top-search", "search", "is-open-search");
2946                    }
2947                });
2948            } else {
2949                SWS.$body.addClass("is-open-search");
2950                e.find("input").focus();
2951                bodyScrollLock.disableBodyScroll(SWS.$body);
2952                var targetBtnBlur, targetBtnKeyDown, targetBtnShiftKey;
2953                $(".search-box .submit").on("keydown blur", function(e) {
2954                    keyboardFocus(e, "tab", "#top-search", "search", "is-open-search")
2955                });
2956            }
2957            e.on("click.toggleClose", function() {
2958                d.closeTarget()
2959            });
2960            e.find(".search-box").on("click", function(h) {
2961                h.stopPropagation()
2962            });
2963            $("#top-search").removeAttr('hidden');
2964            $(".search-box #q").on("change keyup paste", function() {
2965                var currentVal = $(this).val();
2966                if (currentVal.length > 0) {
2967                    $(".search-delete").removeAttr('hidden');
2968                } else {
2969                    $(".search-delete").attr('hidden', 'true');
2970                }
2971            });
2972        },
2973        onClose: function(g, e) {
2974            if (!$("#sidenav-open").is(":visible")) {
2975                bodyScrollLock.clearAllBodyScrollLocks();
2976            } else {
2977                a.show();
2978                e.hide();
2979                g.focus();
2980                if (!SWS.$body.hasClass("is-open-sidenav")) bodyScrollLock.clearAllBodyScrollLocks();
2981            };
2982            SWS.$body.removeClass("is-open-search");
2983            e.off("click.toggleClose");
2984            $("#top-search").attr('hidden', 'true');
2985        }
2986    });
2987    $("#store-guide-link").toggleLayer({
2988        autoFocus: false,
2989        toggleByClass: true,
2990        onOpen: function(g, e) {
2991            e.show();
2992            TweenMax.to(g, 0.4, {
2993                autoAlpha: 0.5,
2994                ease: Power2.easeInOut,
2995                onComplete: function() {}
2996            })
2997        },
2998        onClose: function(g, e) {
2999            e.hide();
3000            g.focus();
3001            TweenMax.to(g, 0.4, {
3002                autoAlpha: 1,
3003                ease: Power2.easeInOut,
3004                onComplete: function() {}
3005            })
3006        }
3007    });
3008    if (Modernizr.mediaqueries) {
3009        var languageMobileInitComplate = false;
3010        function languageMobileInit() {
3011            $("#language-list").clone().attr("id", "language-list-footer").appendTo($("#sulwhasoo-languages"));
3012            return languageMobileInitComplate = true;
3013        }
3014        languageMobileInit();
3015        var targetBtnBlur, targetBtnKeyDown, targetBtnShiftKey;
3016        function languageKeyBoardTab(e, keyType) {
3017            // 언어 선택 팝업 키보드 접근성 대응 코드
3018            e.type === "blur" ? targetBtnBlur = true : targetBtnBlur = false;
3019            if (e.type === "keydown") {
3020                targetBtnKeyDown = true;
3021                e.shiftKey ? targetBtnShiftKey = true : targetBtnShiftKey = false;
3022            }
3023            if (keyType === "tab" && targetBtnBlur && targetBtnKeyDown && !targetBtnShiftKey) {
3024                languageBtn.removeClass("toggle-on");
3025                languageBtn.attr("aria-expanded", "false");
3026                languageBtn.focus();
3027                SWS.languageCloseClickEvent = false;
3028            } else if (keyType === "shiftTab" && targetBtnBlur && targetBtnKeyDown && targetBtnShiftKey) {
3029                languageBtn.removeClass("toggle-on");
3030                languageBtn.attr("aria-expanded", "false");
3031                languageBtn.focus();
3032                SWS.languageCloseClickEvent = false;
3033            }
3034        }
3035        var languageBtn = $("#toggle-languages");
3036        if (languageMobileInitComplate) {
3037            var languageListBtns = $("#language-list-footer > li > a");
3038            var languageListLastBtn = languageListBtns.length - 1;
3039            languageBtn.click(function() {
3040                $(this).addClass("toggle-on");
3041                languageBtn.attr("aria-expanded", "true");
3042            });
3043            $(languageListBtns[languageListLastBtn]).on("keydown blur", function(e) {
3044                languageKeyBoardTab(e, "tab");
3045            });
3046        }
3047        $(".languages .close-layer-languages").click(function() {
3048            SWS.languageCloseClickEvent = true;
3049            if (SWS.languageCloseClickEvent) {
3050                languageBtn.removeClass("toggle-on");
3051                languageBtn.attr("aria-expanded", "false");
3052            }
3053        });
3054        $(".languages .close-layer-languages").on("keydown blur", function(e) {
3055            if (!SWS.languageCloseClickEvent) languageKeyBoardTab(e, "shiftTab");
3056        });
3057    }
3058    $("#language-list").on("click", "a", function() {
3059        c.closeTarget()
3060    })
3061    /* header ë°°ê²½ */
3062    $('#header.renew2022-header .inner .top_nav_box .top_category > ul > li:has(.sub_cate01)').on('mouseover focusin',function(){
3063        $('#header.renew2022-header .inner .top_nav_box .top_category').addClass('open');
3064    })
3065    $('#header.renew2022-header .inner .top_nav_box .top_category > ul > li:not(:has(.sub_cate01))').on('mouseover focusin',function(){
3066        $('#header.renew2022-header .inner .top_nav_box .top_category').removeClass('open');
3067    })
3068    $('#header.renew2022-header .inner .top_nav_box .top_category').on('mouseleave focusout',function(){
3069        $('#header.renew2022-header .inner .top_nav_box .top_category').removeClass('open');
3070    })
3071    
3072	// 커스텀 셀렉트
3073	function selectbox() {
3074		var c = $("div.selectbox"),
3075			a = c.find(".selectbox-option"),
3076			d = $(document);
3077		c.not(".is-disabled").each(function() {
3078			var v = $(this),
3079				e = v.find(">.selector"),
3080				y = v.find(".selector-text"),
3081				g = v.find(">.selectbox-option"),
3082				l = g.find(">li"),
3083				h, r = "",
3084				i = (l.find("a").length > 0) ? true : false,
3085				m, s = false,
3086				u = l.length;
3087			t();
3088
3089			function t() {
3090				var w;
3091				if (v.data("is-setup")) {
3092					return
3093				}
3094				w = 0;
3095				h = (i) ? l.find(">a") : l;
3096				x();
3097				j();
3098				if (i) {
3099					g.on("click", "a", function(A) {
3100						q(this)
3101					});
3102					g.on("keydown", "a", function(C) {
3103						if (C.keyCode == 38) {
3104							C.preventDefault();
3105						} else if (C.keyCode == 40) {
3106							C.preventDefault();
3107						}
3108					});
3109					g.on("keyup", "a", function(C) {
3110						var B = $(this),
3111							A = B.data("index");
3112						if (C.keyCode == 27) {
3113							k();
3114							n(C)
3115						} else {
3116							if (C.keyCode == 38) {
3117								if (A - 1 >= 0) {
3118									h.eq(A - 1).focus()
3119								}
3120							} else {
3121								if (C.keyCode == 40) {
3122									if (A + 1 <= u - 1) {
3123										h.eq(A + 1).focus()
3124									}
3125								}
3126							}
3127						}
3128					});
3129					g.on("focus", "a", function(A) {
3130						$(this).parent().addClass("is-active")
3131					});
3132					g.on("blur", "a", function(A) {
3133						$(this).parent().removeClass("is-active")
3134					})
3135				} else {
3136					g.on("click", "li", function(A) {
3137						q(this);
3138						A.stopPropagation()
3139					});
3140					v.delegate("li", "keydown", function(C) {
3141						if (C.keyCode == 38) {
3142							C.preventDefault();
3143						} else if (C.keyCode == 40) {
3144							C.preventDefault();
3145						}
3146					});
3147					v.delegate("li", "keyup", function(C) {
3148						var B = $(this),
3149							A = B.data("index");
3150						if (C.keyCode == 13) {
3151							$(this).trigger("click")
3152						} else {
3153							var prevLength = B.prevAll("li:not([style*='display: none'])").length;
3154							var nextLength = B.nextAll("li:not([style*='display: none'])").length;
3155
3156							if (C.keyCode == 27) {
3157								k();
3158								n(C)
3159							} else {
3160								if (C.keyCode == 38) {
3161									var prevIdx = B.prevAll("li:not([style*='display: none'])").eq(0).data("index");
3162									h.eq(prevIdx).focus();
3163								} else {
3164									if (C.keyCode == 40) {
3165										if(nextLength > 0){
3166											var nextIdx = B.nextAll("li:not([style*='display: none'])").eq(0).data("index");
3167											h.eq(nextIdx).focus();
3168										}
3169									}
3170								}
3171							}
3172						}
3173					});
3174					g.on("focus", "li", function(A) {
3175						$(this).addClass("is-active")
3176					});
3177					g.on("blur", "li", function(A) {
3178						$(this).removeClass("is-active")
3179					})
3180				}
3181				e.on("click keyup", function(A) {
3182					// 수정됨: tabindex 기준 대신 data-index 값 기준으로 초기화 여부 판단 (일부 li에 tabindex가 안 들어갈 수 있으므로)
3183					if ($(this).next("ul").find("li").data("index") == undefined) {
3184						if (i) {
3185							h.each(function(B, C) {
3186								$(C).data("index", B)
3187							})
3188						} else {
3189							h.each(function(B, C) {
3190								var $li = $(C);
3191								// 수정됨: a 또는 button이 포함되어 있지 않을 때만 tabindex 적용
3192								if ($li.find("a, button").length === 0) {
3193									$li.attr("tabindex", 0);
3194								}
3195								$li.data("index", B);
3196								$li.find("input[type=radio]").attr("tabindex", -1);
3197							})
3198						}
3199						u = h.length
3200					}
3201					if (A.type == "click" || A.keyCode == 13) {
3202						if (v.data("is-open")) {
3203							p();
3204						} else {
3205							o();
3206							
3207							var $currentEl;
3208							if (!i) {
3209								$currentEl = h.has("input:checked"); 
3210							} else {
3211								var currentText = e.find(">span").text(); 
3212								$currentEl = h.filter(function() {
3213									var itemText = $(this).find(".select-item").length > 0 ? $(this).find(".select-item").text() : $(this).text();
3214									return $.trim(itemText) === $.trim(currentText);
3215								});
3216							}
3217
3218							if ($currentEl.length > 0 && $currentEl.css("display") !== "none") {
3219								$currentEl.focus(); 
3220							} else {
3221								h.not('[style*="display: none"]').eq(0).focus(); 
3222							}
3223						}
3224						A.preventDefault();
3225					}
3226				});
3227				e.on("focus", z);
3228				v.on("click", function(A) {
3229					A.stopPropagation()
3230				});
3231
3232				function z() {
3233					var A = new Array(38, 40);
3234					d.on("keyup.blockArrow", "li", function(C) {
3235						var B = C.which;
3236						if ($.inArray(B, A) > -1) {
3237							C.preventDefault();
3238							return false
3239						}
3240					})
3241				}
3242				v.on("click", function(A) {
3243					A.stopPropagation()
3244				});
3245				if (!i && g.has(".is-current")) {
3246					w = $(window).scrollTop();
3247					g.find(".is-current").click();
3248					$("html, body").scrollTop(w);
3249					e.blur()
3250				}
3251				if (i && v.has(".is-current").length > 0) {
3252					g.find(".is-current").addClass("is-active");
3253					y.text(g.find(".is-current").text())
3254				}
3255				v.data("is-setup", true);
3256				v.on("focusout", function(e) {
3257					setTimeout(function() {
3258						if (!v.has(document.activeElement).length && !v.is(document.activeElement)) {
3259							p(); 
3260						}
3261					}, 10); 
3262				});
3263			}
3264
3265			function q(A) {
3266				var z = $(A),
3267					w = (z.find(".select-item").length > 0) ? true : false;
3268				if (w) {
3269					r = z.find(".select-item").html();
3270					e.find(">span").html(r)
3271				} else {
3272					r = z.text();
3273					e.find(">span").text(r)
3274				}
3275				if (!i) {
3276					g.find("input").prop("checked", false);
3277					z.find("input").prop("checked", true).trigger("change")
3278				}
3279				k()
3280			}
3281
3282			function x() {
3283				v.data("is-open", false);
3284				e.attr("tabindex", 0);
3285				if (!i) {
3286					// 수정됨: a, button 존재 여부에 따라 tabindex 분기 처리
3287					h.each(function(z, B) {
3288						var $li = $(B);
3289						if ($li.find("a, button").length === 0) {
3290							$li.attr("tabindex", 0);
3291						}
3292					});
3293
3294					h.find("input[type=radio]").attr("tabindex", "-1").each(function(z, B) {
3295						var A = $(B),
3296							w, C;
3297						if (A.attr("id") && A.attr("id") !== "") {
3298							return
3299						}
3300						w = A.parent("label") || A.siblings("label");
3301						C = A.attr("name") + (z + 1);
3302						A.attr("id", C);
3303						if (w.length) {
3304							w.attr("for", C)
3305						}
3306					})
3307				}
3308				h.each(function(w, z) {
3309					$(z).data("index", w)
3310				})
3311			}
3312
3313			function j() {
3314				if (!v.attr("style") || v.attr("style").indexOf("width") == -1 || v.width() !== "100%") {
3315					var z = l.children().width() + 0,
3316						w = e.outerWidth() + 0;
3317					if (w < z) {
3318						v.width(z)
3319					}
3320				}
3321				g.css("visibility", "visible").hide()
3322			}
3323
3324			function o() {
3325				if (v.data("is-open")) {
3326					return
3327				}
3328				b();
3329				v.addClass("is-active").css("zIndex", 1000).data("is-open", true).attr("aria-expanded", true);
3330				g.show()
3331			}
3332
3333			function p() {
3334				g.hide();
3335				d.off("keyup.blockArrow");
3336				v.removeClass("is-active").css("zIndex", 1).data("is-open", false).attr("aria-expanded", false)
3337			}
3338
3339			function k() {
3340				p();
3341				e.focus()
3342			}
3343
3344			function n(w) {
3345				if (w.preventDefault) {
3346					w.preventDefault();
3347					w.stopPropagation()
3348				} else {
3349					w.returnValue = false
3350				}
3351			}
3352		});
3353		d.on("click", b);
3354
3355		function b() {
3356			c.removeClass("is-active").css("zIndex", "auto").data("is-open", false).attr("aria-expanded", false);
3357			a.hide()
3358		}
3359	}
3360});
3361// ë§µ
3362function initMap(c, h, i, l) {
3363    var c = (c) ? c : "map-canvas000",
3364        h = (h) ? h : 0,
3365        i = (i) ? i : 0;
3366    var k = [{
3367        stylers: []
3368    }, {
3369        featureType: "road",
3370        elementType: "geometry",
3371        stylers: [{
3372            saturation: 0
3373        }, {
3374            visibility: "simplified"
3375        }]
3376    }, {
3377        featureType: "road",
3378        elementType: "labels",
3379        stylers: [{
3380            visibility: "off"
3381        }]
3382    }];
3383    var j = new google.maps.StyledMapType(k, {
3384        name: "Styled Map"
3385    });
3386    var g = new google.maps.LatLng(h, i);
3387    var d = {
3388        zoom: 16,
3389        center: g,
3390        mapTypeControlOptions: {
3391            mapTypeIds: [google.maps.MapTypeId.ROADMAP, "map_style"]
3392        },
3393        restriction: {
3394            latLngBounds: {
3395                east: 131.21123750988733,
3396                south: 33.12651372124617,
3397                north: 38.658064296236525,
3398                west: 124.45464596903972
3399            },
3400            strictBounds: false
3401        },
3402    };
3403    var b = new google.maps.Map(document.getElementById(c), d);
3404    var e = l;
3405    var a = new google.maps.Marker({
3406        position: g,
3407        map: b,
3408        icon: e
3409    });
3410    b.mapTypes.set("map_style", j);
3411    b.setMapTypeId("map_style");
3412    google.maps.event.addListener(b, 'idle', () => {
3413        const iframes = document.querySelectorAll('.map-canvas iframe');
3414        for (let i = 0; i < iframes.length; i++) {
3415            iframes[i].title = "내용 없음";
3416        }
3417    });
3418}
3419// 스플릿텍스트
3420function SplitText(b, a) {
3421    this.$input = b;
3422    this.bunches = [];
3423    if (a) {
3424        this.o = a
3425    } else {
3426        this.o = {
3427            type: "words",
3428        }
3429    }
3430    this.dataText = (this.o.type == "chars") ? this.$input.text() : this.$input.html();
3431    this.dataText = $.trim(this.dataText);
3432    if (this.o.bunchClass != undefined) {
3433        this.bunchClass = this.o.bunchClass
3434    }
3435    this.init()
3436}
3437SplitText.prototype = {
3438    split: function() {
3439        var a = 0;
3440        if (this.o.type == "chars") {
3441            this.arrText = this.dataText.split("")
3442        } else {
3443            this.arrText = this.dataText.replace(/\t|\n/gi, "").split(" ")
3444        }
3445        return this.arrText
3446    },
3447    append: function() {
3448        var b = 0,
3449            a = "";
3450        for (; b < this.arrText.length; b++) {
3451            if (this.arrText[b] == " ") {
3452                this.arrText[b] = "&nbsp;"
3453            }
3454            if (this.arrText[b].indexOf("<br>") == 0) {
3455                a += "<br><span>" + this.arrText[b].replace("<br>", "") + "</span>"
3456            } else {
3457                a += "<span>" + this.arrText[b] + "</span>"
3458            }
3459            if (this.o.type == "words") {
3460                a += " "
3461            }
3462        }
3463        this.$input.text("");
3464        $(a).appendTo(this.$input)
3465    },
3466    init: function() {
3467        var a = [];
3468        this.split();
3469        this.append();
3470        this.$input.find(">span").addClass(this.bunchClass).each(function(b, c) {
3471            a[b] = c
3472        });
3473        return this.bunches = a
3474    }
3475};
3476
3477
3478document.addEventListener("DOMContentLoaded", function () {
3479	/* url 체크로 header 메뉴 active 표시 */
3480    const currentPath = window.location.pathname;
3481	if(currentPath === '/' || currentPath.includes('/int/en')) return;
3482	let $this;
3483    if (currentPath.includes('/category')) { //제품&리스트
3484        const link = document.querySelector('#header .top_category > ul >li > a[href*="/category"]');
3485		link.classList.add('active');
3486		if(currentPath.includes('/26/')){
3487			// 1. 스킨케어 (26)
3488			const moLinks = document.querySelectorAll('#aside.w-cafe24 #slide_add_category a[href*="/26/"]');
3489			if(moLinks) {
3490				moLinks.forEach(function(moLink){
3491					moLink.classList.add('is-current');
3492				});
3493			}
3494		} else if(currentPath.includes('/27/')){
3495			// 2. 메이크업 (27)
3496			const moLink = document.querySelector('#aside.w-cafe24 #slide_add_category a[href*="/27/"]');
3497			if(moLink) moLink.classList.add('is-current');
3498		} else if(currentPath.includes('/28/')){
3499			// 3. 남성 (28)
3500			const moLink = document.querySelector('#aside.w-cafe24 #slide_add_category a[href*="/28/"]');
3501			if(moLink) moLink.classList.add('is-current');
3502		}
3503		$this = $('#aside #slide_add_category > li > a[href*="/category/"]');
3504    } else if (currentPath.includes('/first-care-activating')) { //윤조
3505		const link = document.querySelector('#header .top_category > ul >li > a[href*="first-care-activating"]');
3506		if (link) link.classList.add('active');
3507    } else if (currentPath.includes('/concentrated-ginseng-rejuvenating')) { //자음생
3508		const link = document.querySelector('#header .top_category > ul >li > a[href*="concentrated-ginseng-rejuvenating"]');
3509		if (link) link.classList.add('active');
3510    } else if (currentPath.includes('/gift')) { //기프트
3511		const link = document.querySelector('#header .top_category > ul >li > a[href*="/gift"]');
3512		if (link) link.classList.add('active');
3513		$this = $('#aside #slide_add_category > li > a[href*="/gift/"]');
3514    } else if (currentPath.includes('/best')) { //베스트셀러
3515		const link = document.querySelector('#header .top_category > ul >li > a[href*="/best"]');
3516		if (link) link.classList.add('active');
3517    } else if (currentPath.includes('/spa')) { //스파
3518		const link = document.querySelector('#header .top_category > ul >li > a[href*="/spa"]');
3519		if (link) link.classList.add('active');
3520		$this = $('#aside #slide_add_category > li > a[href*="/spa/"]');
3521    } else if (currentPath.includes('/flagship')) { //플래그십스토어
3522		const link = document.querySelector('#header .top_category > ul >li > a[href*="/flagship"]');
3523		if (link) link.classList.add('active');
3524		$this = $('#aside #slide_add_category > li > a[href*="/flagship/"]');
3525    } else if (currentPath.includes('/about-sulwhasoo')) { //ABOUT 설화수
3526		const link = document.querySelector('#header .top_category > ul >li > a[href*="/about-sulwhasoo"]');
3527		if (link) link.classList.add('active');
3528		if(currentPath.includes('/culture/')){
3529			const moLink = document.querySelector(`#aside.w-cafe24 #slide_add_category a[href*="/culture/"]`);	
3530			moLink.classList.add('is-current');
3531		} else if(currentPath.includes('/culture-project/')){
3532			const moLink = document.querySelector(`#aside.w-cafe24 #slide_add_category a[href*="/culture-project/"]`);		
3533			moLink.classList.add('is-current');
3534		} else if(currentPath.includes('/brand-news/')){
3535			const moLink = document.querySelector(`#aside.w-cafe24 #slide_add_category a[href*="/brand-news/"]`);		
3536			moLink.classList.add('is-current');
3537		} else if(currentPath.includes('/classic-luxury-set/')){
3538			const moLink = document.querySelector(`#aside.w-cafe24 #slide_add_category a[href*="/classic-luxury-set/"]`);		
3539			moLink.classList.add('is-current');
3540		} else {
3541			const moLinks = document.querySelectorAll(`#aside.w-cafe24 #slide_add_category a[href*="${currentPath}"]`);
3542			if(moLinks) {
3543				moLinks.forEach(function(moLink){
3544					moLink.classList.add('is-current');
3545				});
3546			}
3547		}
3548		$this = $('#aside #slide_add_category > li > a[href*="/about-sulwhasoo/"]');
3549    }
3550	if(!(currentPath.includes('/about-sulwhasoo')) && !(currentPath.includes('/category'))){
3551		const moLinks = document.querySelectorAll(`#aside.w-cafe24 #slide_add_category a[href*="${currentPath}"]`);
3552		if(moLinks) {
3553			moLinks.forEach(function(moLink){
3554				moLink.classList.add('is-current');
3555			});
3556		}
3557	}
3558	/* 모바일 사이드바 열림 */
3559	if($this) {
3560		const $parentLi = $this.parent('li');
3561		const $nextUl = $this.next('ul');
3562
3563		// 현재 클릭한 메뉴 열기
3564		$parentLi.addClass('selected');
3565		$nextUl.slideDown(250);
3566
3567		// 클릭한 게 1depth이고, 열리는 게 sub_cate01일 때만 작동
3568		if ($nextUl.hasClass('sub_cate01')) {
3569			setTimeout(function() {
3570				// sub_cate01 내부의 모든 sub_cate02를 찾아 슬라이드 다운
3571				const $thirdDepth = $nextUl.find('ul.sub_cate02');
3572				
3573				$thirdDepth.slideDown(250);
3574				$thirdDepth.parent('li').addClass('selected'); // 시각적 활성화
3575			}, 300);
3576		}
3577	}
3578
3579	/* header 메뉴 tabindex와 title 후처리 */
3580	$('.top_category a').each(function() {
3581        var $this = $(this);
3582        var linkText = $this.text(); // a 태그 안의 텍스트 가져오기 (공백 제거)
3583        // 속성 부여
3584        $this.attr({
3585            'tabindex': '0',
3586        });
3587    });
3588});
3589/* 웹접근성 (포커스 관련) */
3590document.addEventListener('keydown', function(e) {
3591	/* 검색창 */
3592    // 1. body에 searchExpand 클래스가 있을 때만 작동
3593    if (!document.body.classList.contains('searchExpand')) return;
3594
3595    const isTab = (e.key === 'Tab' || e.keyCode === 9);
3596    if (!isTab) return;
3597
3598    const shiftKey = e.shiftKey;
3599    const activeElem = document.activeElement;
3600    
3601    // 요소 선택
3602    const miscClose = document.querySelector('.misc-close-search');
3603    const keywordInput = document.querySelector('#keyword');
3604    const schClose = document.querySelector('.sch-close');
3605
3606    // 2. .misc-close-search에서 Tab을 누르면 #keyword로 이동
3607    if (activeElem === miscClose && !shiftKey) {
3608        if (keywordInput) {
3609            e.preventDefault();
3610            keywordInput.focus();
3611        }
3612    }
3613
3614    // 3. #keyword에서 Shift + Tab을 누르면 .misc-close-search로 이동
3615    if (activeElem === keywordInput && shiftKey) {
3616        if (miscClose) {
3617            e.preventDefault();
3618            miscClose.focus();
3619        }
3620    }
3621
3622    // 4. .sch-close에서 Tab을 누르면 해당 버튼을 클릭(닫기 실행)
3623    if (activeElem === schClose && !shiftKey) {
3624        e.preventDefault();
3625        schClose.click();
3626		document.querySelector('.top_category > ul > li > a').focus();
3627    }
3628});
3629
3630// ESC키 모달 닫기
3631window.addEventListener('keydown', function(event) {
3632  if (event.key === 'Escape') {
3633    // 검색창
3634    if (document.body.classList.contains('searchExpand')) {
3635      const btnClose = document.querySelector('.wrap-search-box .btnClose');
3636      if (btnClose) {
3637        btnClose.click();
3638      }
3639    }
3640  }
3641});
3642
3643document.addEventListener('DOMContentLoaded', function() {
3644  // 프레임을 찾는 함수
3645  function fixIframeAccessibility() {
3646    const $log = $('#log_realtime');
3647    if ($log.length) {
3648      $log.attr({
3649        'title': '데이터 수집 도구',
3650        'aria-hidden': 'true',
3651        'tabindex': '-1',
3652		'lang': 'ko'
3653      });
3654      return true;
3655    }
3656    return false;
3657  }
3658  function fixIframeAccessibility2() {
3659	const $session = $('iframe[src*="cafe24data.com"]');
3660	if ($session.length) {
3661      $session.attr({
3662        'title': '데이터 처리용 프레임',
3663		'aria-hidden': 'true',
3664		'tabindex': '-1',
3665			'lang': 'ko'
3666      });
3667      return true;
3668    }
3669    return false;
3670  }
3671
3672  if (!fixIframeAccessibility()) {
3673    setTimeout(fixIframeAccessibility, 1000);
3674  }
3675  if (!fixIframeAccessibility2()) {
3676    setTimeout(fixIframeAccessibility2, 1000);
3677  }
3678});
3679/* footer 메뉴 위치 재배치 */
3680document.addEventListener("DOMContentLoaded", function () {
3681	$('#footer .footer-links-login').insertBefore('.footer-last-li');
3682});
3683
3684//document.addEventListener("DOMContentLoaded", function () {
3685//	document.addEventListener('focusin', function() {
3686//	  console.log('현재 포커스:', document.activeElement);
3687//	});
3688//});
3689// $(document).ready(function() {
3690// //    let currentUrl = window.location.href;
3691
3692//     // 로그인 페이지용 IP와 일반 페이지용 IP 배열 분리
3693//     let generalIpArr = ['121.140.140.212', '121.140.140.210', '165.225.228.112', '165.225.228.121', '165.225.228.88'];
3694//     let allowedPrefix = '165.225.228';
3695
3696//     $.ajax({
3697//         url: 'https://app.weaverloft.com/breadymall/fo/ip',
3698//         type: 'POST',
3699//         dataType: 'json',
3700//         success: function(data) {
3701
3702// 		console.log(data);
3703
3704// 			if (!generalIpArr.includes(data) && !data.startsWith(allowedPrefix)) {
3705// 				window.stop();
3706// 				document.body.innerHTML = '접근이 거부되었습니다. ' + data;
3707
3708// 				return;					
3709// 			}
3710//         },
3711//         error: function(jqXHR, textStatus, errorThrown) {
3712//             console.log(textStatus, errorThrown);
3713//         }
3714//     });
3715// });
3716
3717/**
3718 * Webcomponent의 생명주기와 비슷하게 섹션을 컨트롤 할 수 있습니다.
3719 */
3720(function () {
3721  var base = {
3722    version: '1.0.0',
3723    component: {},
3724    ready: false,
3725    register: register,
3726    connect: connect,
3727    change: change,
3728    disconnect: disconnect,
3729  }
3730
3731  try {
3732    polyfill();
3733    init();
3734  } catch (e) {
3735
3736  }
3737
3738  function init() {
3739    try {
3740      _init();
3741    } catch (e) {
3742      console.error(e);
3743    }
3744  }
3745
3746  function _run(name, section, fn, type) {
3747    var handlers = this.component[name];
3748    if (handlers) {
3749      for (var j = 0; j < handlers.length; j++) {
3750        if (handlers[j][fn]) {
3751          handlers[j][fn](section, type);
3752        }
3753      }
3754    }
3755  }
3756
3757  function connect(name, section, type) {
3758    return _run.call(this, name, section, 'connect', type)
3759  }
3760
3761  function change(name, section, type) {
3762    return _run.call(this, name, section, 'change', type)
3763  }
3764
3765  function disconnect(name, section, type) {
3766    return _run.call(this, name, section, 'disconnect', type)
3767  }
3768
3769  /**
3770   * 섹션의 라이프사이클 관리 기능을 등록합니다.
3771   * @param  {string} name 섹션 이름
3772   * @param  {function | object} init 초기화시 호출 함수 또는 함수목록
3773   * @returns void
3774   */
3775  function register(name, init) {
3776    var handler = _register.call(this, name, (init.init || init)(), arguments);
3777    if (EZST.ready) {
3778      var sections = document.querySelectorAll('[data-ez-module="' + name + '"]');
3779      for (var i = 0; i < sections.length; i++) {
3780        if (handler.init) {
3781          handler.init(sections[i]);
3782        }
3783        if (handler.connect) {
3784          handler.connect(sections[i]);
3785        }
3786      }
3787    }
3788  }
3789
3790  function _init() {
3791    window.addEventListener('DOMContentLoaded', function (ev) {
3792      EZST.ready = true;
3793      for (var k in EZST.component) {
3794        var sections = document.querySelectorAll('[data-ez-module="' + k + '"]');
3795        for (var i = 0; i < sections.length; i++) {
3796          var handlers = EZST.component[k];
3797          for (var j = 0; j < handlers.length; j++) {
3798            if (handlers[j].init) {
3799              handlers[j].init(sections[i]);
3800            }
3801            if (handlers[j].connect) {
3802              handlers[j].connect(sections[i]);
3803            }
3804          }
3805        }
3806      }
3807    });
3808
3809    window.EZST = Object.assign(window.EZST || {}, base, {
3810      status: ('EZST' in window) ? 1 : 0,
3811    });
3812
3813    _prepare();
3814    _setViewType();
3815    _cleanup()
3816  }
3817
3818  function _setViewType() {
3819    try {
3820      var mq = window.matchMedia("(max-width: 1024px)");
3821      mq.addEventListener('change', function (ev) {
3822        _changeViewType(ev.target);
3823
3824      }, false);
3825      _changeViewType(mq);
3826    } catch (e) {
3827
3828    }
3829  }
3830  function _changeViewType(mq) {
3831    document.documentElement.classList.toggle('ez-view-type-mobile', mq.matches);
3832  }
3833
3834  function _cleanup() {
3835    window.addEventListener('DOMContentLoaded', function (ev) {
3836      var props = document.documentElement.querySelectorAll('ez-prop,script[type="text/ez-prop"]');
3837      for (var i = 0; i < props.length; i++) {
3838        props[i].parentNode && props[i].parentNode.removeChild(props[i]);
3839      }
3840    });
3841  }
3842
3843  function _prepare() {
3844    if (EZST.q && EZST.q.length) {
3845      for (var i = 0; i < EZST.q.length; i++) {
3846        _register.apply(EZST, EZST.q[i]);
3847      }
3848      delete EZST.q;
3849    }
3850  }
3851
3852  function _register(name, init, raw) {
3853    var handler = {
3854      // init: function (section) { },
3855      // disconnect: function (section) { },
3856      // changed: function (section) { },
3857      // connect: function (section) { },
3858    };
3859    Object.assign(handler, (init && init.constructor === Object) ? init : (raw[1].constructor === Object) ? raw[1] : {});
3860    if (!this.component[name]) {
3861      this.component[name] = [];
3862    }
3863    this.component[name].push(handler);
3864    return handler;
3865  }
3866
3867  function polyfill() {
3868    if (typeof Object.assign != "function") {
3869      Object.defineProperty(Object, "assign", {
3870        value: function assign(target, varArgs) {
3871          "use strict";
3872          if (target == null) {
3873            throw new TypeError("Cannot convert undefined or null to object");
3874          }
3875          var to = Object(target);
3876          for (var index = 1; index < arguments.length; index++) {
3877            var nextSource = arguments[index];
3878            if (nextSource != null) {
3879              for (var nextKey in nextSource) {
3880                if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
3881                  to[nextKey] = nextSource[nextKey];
3882                }
3883              }
3884            }
3885          }
3886          return to;
3887        },
3888        writable: true,
3889        configurable: true
3890      });
3891    }
3892  }
3893})();
3894
3895// 스크립트 생성 일시 2026 / 01 / 09 | 작성자 : LDG
3896// 스크립트 수정 일시 2026 / 03 / 09 | 작성자 : JMH (Footer 합침, 경로 주석 추가)
3897// 스크립트 수정 일시 2026 / 03 / 17 | 작성자 : JMH (1/2/3depth 분리, 2depth 부모 포함)
3898// GNB + Footer 삽입부
3899// layout/basic/layout.html 파일에 지정
3900window.addEventListener('load', function() {
3901    // ============================
3902    // PC GNB 1depth
3903    // ============================
3904    const gnb1depth = document.querySelectorAll('.header .top_category > ul > li');
3905    gnb1depth.forEach(item => {
3906        const link = item.querySelector(':scope > a');
3907        if (link && !link.hasAttribute('ap-click-area')) {
3908            const txt = link.textContent.trim();
3909            link.setAttribute('ap-click-area', 'GNB');
3910            link.setAttribute('ap-click-name', 'Click GNB');
3911            link.setAttribute('ap-click-data', txt);
3912        }
3913    });
3914
3915    // PC GNB 2depth
3916    const gnb2depth = document.querySelectorAll('.header .top_category > ul > li > ul.sub_cate01 > li');
3917    gnb2depth.forEach(item => {
3918        const link = item.querySelector(':scope > a');
3919        if (link) {
3920            const parentLi = item.parentElement.parentElement;
3921            const parentLink = parentLi.querySelector(':scope > a');
3922            const parentTxt = parentLink ? parentLink.textContent.trim() : '';
3923            const txt = link.textContent.trim();
3924
3925            link.setAttribute('ap-click-area', 'GNB');
3926            link.setAttribute('ap-click-name', 'Click GNB');
3927            link.setAttribute('ap-click-data', parentTxt + '>' + txt);
3928        }
3929    });
3930
3931    // PC GNB 3depth
3932    const gnb3depth = document.querySelectorAll('.header .top_category > ul > li > ul.sub_cate01 > li > ul.sub_cate02 > li');
3933    gnb3depth.forEach(item => {
3934        const link = item.querySelector(':scope > a');
3935        if (link) {
3936            // 2depth (부모의 부모)
3937            const depth2Li = item.parentElement.parentElement;
3938            const depth2Link = depth2Li.querySelector(':scope > a');
3939            const depth2Txt = depth2Link ? depth2Link.textContent.trim() : '';
3940
3941            // 1depth (2depth의 부모의 부모)
3942            const depth1Li = depth2Li.parentElement.parentElement;
3943            const depth1Link = depth1Li.querySelector(':scope > a');
3944            const depth1Txt = depth1Link ? depth1Link.textContent.trim() : '';
3945
3946            const txt = link.textContent.trim();
3947
3948            link.setAttribute('ap-click-area', 'GNB');
3949            link.setAttribute('ap-click-name', 'Click GNB');
3950            link.setAttribute('ap-click-data', depth1Txt + '>' + depth2Txt + '>' + txt);
3951        }
3952    });
3953
3954    // ============================
3955    // MOBILE GNB 1depth
3956    // ============================
3957    const mobileGnb1depth = document.querySelectorAll('#aside #slide_add_category > li');
3958    mobileGnb1depth.forEach(item => {
3959        const link = item.querySelector(':scope > a');
3960        if (link && !link.hasAttribute('ap-click-area')) {
3961            const txt = link.textContent.trim();
3962            link.setAttribute('ap-click-area', 'GNB');
3963            link.setAttribute('ap-click-name', 'Click GNB');
3964            link.setAttribute('ap-click-data', txt);
3965        }
3966    });
3967
3968    // MOBILE GNB 2depth
3969    const mobileGnb2depth = document.querySelectorAll('#aside #slide_add_category > li > ul.sub_cate01 > li');
3970    mobileGnb2depth.forEach(item => {
3971        const link = item.querySelector(':scope > a');
3972        if (link) {
3973            const parentLi = item.closest('#slide_add_category > li');
3974            const parentLink = parentLi ? parentLi.querySelector(':scope > a') : null;
3975            const parentTxt = parentLink ? parentLink.textContent.trim() : '';
3976            const txt = link.textContent.trim();
3977
3978            link.setAttribute('ap-click-area', 'GNB');
3979            link.setAttribute('ap-click-name', 'Click GNB');
3980            link.setAttribute('ap-click-data', parentTxt + '>' + txt);
3981        }
3982    });
3983
3984    // MOBILE GNB 3depth
3985    const mobileGnb3depth = document.querySelectorAll('#aside #slide_add_category > li > ul.sub_cate01 > li > ul.sub_cate02 > li');
3986    mobileGnb3depth.forEach(item => {
3987        const link = item.querySelector(':scope > a');
3988        if (link) {
3989            const depth2Li = item.parentElement.parentElement;
3990            const depth2Link = depth2Li.querySelector(':scope > a');
3991            const depth2Txt = depth2Link ? depth2Link.textContent.trim() : '';
3992
3993            const depth1Li = depth2Li.closest('#slide_add_category > li');
3994            const depth1Link = depth1Li ? depth1Li.querySelector(':scope > a') : null;
3995            const depth1Txt = depth1Link ? depth1Link.textContent.trim() : '';
3996
3997            const txt = link.textContent.trim();
3998
3999            link.setAttribute('ap-click-area', 'GNB');
4000            link.setAttribute('ap-click-name', 'Click GNB');
4001            link.setAttribute('ap-click-data', depth1Txt + '>' + depth2Txt + '>' + txt);
4002        }
4003    });
4004
4005    // ============================
4006    // Footer
4007    // ============================
4008    const footerLinks = document.querySelectorAll('#footer a, .footer a');
4009    footerLinks.forEach(link => {
4010        if (!link.hasAttribute('ap-click-area')) {
4011            const text = link.textContent.trim();
4012
4013            link.setAttribute('ap-click-area', 'Footer');
4014            link.setAttribute('ap-click-name', 'Click - Footer');
4015            link.setAttribute('ap-click-data', text);
4016        }
4017    });
4018
4019    // Footer SNS 링크
4020    const snsLinks = document.querySelectorAll('#footer .sns > a, .footer .sns > a, #footer .social > a, .footer .social > a, #footer [class*="sns"] > a, .footer [class*="sns"] > a');
4021    snsLinks.forEach(link => {
4022        const href = link.getAttribute('href') || '';
4023        let snsName = '';
4024
4025        if (href.includes('instagram')) snsName = 'Instagram';
4026        else if (href.includes('facebook')) snsName = 'Facebook';
4027        else if (href.includes('youtube')) snsName = 'YouTube';
4028        else if (href.includes('twitter') || href.includes('x.com')) snsName = 'X';
4029        else if (href.includes('tiktok')) snsName = 'TikTok';
4030        else if (href.includes('kakao')) snsName = 'Kakao';
4031        else if (href.includes('naver')) snsName = 'Naver';
4032        else snsName = link.textContent.trim() || 'SNS';
4033
4034        link.setAttribute('ap-click-area', 'Footer');
4035        link.setAttribute('ap-click-name', 'Click - Footer SNS');
4036        link.setAttribute('ap-click-data', snsName);
4037    });
4038    // ===== AS-IS 매핑 자동 부착 (시작) =====
4039    // AS-IS 사이트(www.sulwhasoo.com) ap-click 패턴을 href/text 매칭으로 자동 부착
4040    // HTML 구조 변경 없음 - 속성만 setAttribute로 추가
4041    const AS_IS_BY_HREF = {
4042    "#main": {
4043        "area": "Header",
4044        "name": "Click - #main",
4045        "data": "#main"
4046    },
4047    "/kr/ko/index.html": {
4048        "area": "Header",
4049        "name": "Click - Header",
4050        "data": "logo"
4051    },
4052    "/": {
4053        "area": "Header",
4054        "name": "Select Country",
4055        "data": "int/en"
4056    },
4057    "/index.html": {
4058        "area": "Header",
4059        "name": "Select Country",
4060        "data": "cn/zh"
4061    },
4062    "/tc_s/": {
4063        "area": "Header",
4064        "name": "Select Country",
4065        "data": "hk/zh"
4066    },
4067    "/hk/en": {
4068        "area": "Header",
4069        "name": "Select Country",
4070        "data": "hk/en"
4071    },
4072    "/en": {
4073        "area": "Header",
4074        "name": "Select Country",
4075        "data": "th/en"
4076    },
4077    "/tw/zh": {
4078        "area": "Header",
4079        "name": "Select Country",
4080        "data": "tw/zh"
4081    },
4082    "/fr/fr": {
4083        "area": "Header",
4084        "name": "Select Country",
4085        "data": "fr/fr"
4086    },
4087    "/kr/ko/misc/store/store.html": {
4088        "area": "Header",
4089        "name": "Click - Find a Store",
4090        "data": "매장찾기"
4091    },
4092    "/kr/ko/display/brand/detail?brandSn=18": {
4093        "area": "Header",
4094        "name": "Click - Mall",
4095        "data": "구매하기"
4096    },
4097    "#top-search": {
4098        "area": "Header",
4099        "name": "Click - Search",
4100        "data": "Search"
4101    },
4102    "#open-search": {
4103        "area": "Header",
4104        "name": "Click - Search Close",
4105        "data": "Search Close"
4106    },
4107    "/kr/ko/about-sulwhasoo/brand-news/archive/perfecting-cushion-limited-edition.html": {
4108        "area": "Main",
4109        "name": "Click - Main Visual",
4110        "data": "Main Visual_퍼펙팅 쿠션 LTD"
4111    },
4112    "/kr/ko/first-care-activating/first-care-activating-serum-vi.html": {
4113        "area": "Main",
4114        "name": "Click - Main Visual",
4115        "data": "Main Visual_윤조에센스 6세대 커버페이지"
4116    },
4117    "/kr/ko/gift/giftselection/gift-selection.html": {
4118        "area": "Main",
4119        "name": "Click - Main Visual",
4120        "data": "Main Visual_설화수 기프트 - 설화수의 특별한 선물"
4121    },
4122    "/kr/ko/products/first-care-activating-serum-mist.html": {
4123        "area": "Main",
4124        "name": "Click - Main Visual",
4125        "data": "Main Visual_윤조에센스 미스트"
4126    },
4127    "/kr/ko/concentrated-ginseng-rejuvenating/introduction.html": {
4128        "area": "Main",
4129        "name": "Click - Main Visual",
4130        "data": "Main Visual_자음생크림 (2025 AD)"
4131    },
4132    "/kr/ko/display/event_detail?planDisplaySn=14328": {
4133        "area": "Main",
4134        "name": "Click - Main Visual",
4135        "data": "Main Visual_봄처럼 반가운 설화수의 선물 (4/20~5/17)"
4136    },
4137    "/kr/ko/products/the-ultimate-s-cream-rich.html": {
4138        "area": "Main",
4139        "name": "Click - Recommendation",
4140        "data": "Recommendation_진설크림 리치"
4141    },
4142    "/kr/ko/products/concentrated-ginseng-rejuvenating-ampoule.html": {
4143        "area": "Main",
4144        "name": "Click - Recommendation",
4145        "data": "Recommendation_자음생앰플"
4146    },
4147    "/kr/ko/products/white-ginseng-radiance-refining-mask.html": {
4148        "area": "Main",
4149        "name": "Click - Recommendation",
4150        "data": "Recommendation_백삼팩"
4151    },
4152    "/kr/ko/products/perfecting-lip-color.html": {
4153        "area": "Main",
4154        "name": "Click - Recommendation",
4155        "data": "Recommendation_퍼펙팅 립컬러"
4156    },
4157    "/kr/ko/products/perfecting-powder-foundation.html": {
4158        "area": "Main",
4159        "name": "Click - Recommendation",
4160        "data": "Recommendation_퍼펙팅 트윈케이크"
4161    },
4162    "/kr/ko/products/gentle-cleansing-oil.html": {
4163        "area": "Main",
4164        "name": "Click - Recommendation",
4165        "data": "Recommendation_순행클렌징오일"
4166    },
4167    "/kr/ko/products/concentrated-ginseng-rejuvenating-serum.html": {
4168        "area": "Main",
4169        "name": "Click - Curation",
4170        "data": "Curation_Product_자음생캡슐세럼"
4171    },
4172    "/kr/ko/products/concentrated-ginseng-rejuvenating-cream-rich.html": {
4173        "area": "Main",
4174        "name": "Click - Curation",
4175        "data": "Curation_Product_자음생크림 리치"
4176    },
4177    "/kr/ko/flagship/bukchon/index.html": {
4178        "area": "Main",
4179        "name": "Click - Banner",
4180        "data": "Banner_설화수 북촌 플래그십 스토어"
4181    },
4182    "/kr/ko/flagship/dosan/index.html": {
4183        "area": "Main",
4184        "name": "Click - Banner",
4185        "data": "Banner_설화수 도산 플래그십 스토어"
4186    },
4187    "' + data[i].popupButtonUrl + '": {
4188        "area": "Main Popup",
4189        "name": "Click - Main Popup Detail Link",
4190        "data": "' + data[i].popupGTMCode + '"
4191    },
4192    "/kr/ko/products/first-care-activating-serum-vi.html": {
4193        "area": "Best-Seller",
4194        "name": "Click - VIEW DETAILS",
4195        "data": "First Care Activating Serum VI"
4196    },
4197    "/kr/ko/product/detail?onlineProdSn=62172&amp;utm_source=sulwhasoo.com&amp;utm_medium=mall&amp;utm_campaign=button_click&amp;onlineProdCode=111170002143": {
4198        "area": "Best-Seller",
4199        "name": "Click - VIEW DETAILS",
4200        "data": "Concentrated Ginseng Rejuvenating Ampoule"
4201    },
4202    "/kr/ko/product/detail?onlineProdSn=56900&amp;utm_source=sulwhasoo.com&amp;utm_medium=mall&amp;utm_campaign=button_click&amp;onlineProdCode=111170001579": {
4203        "area": "Best-Seller",
4204        "name": "Click - VIEW DETAILS",
4205        "data": "Overnight Vitalizing Mask"
4206    },
4207    "/kr/ko/product/detail?onlineProdSn=56898&amp;onlineProdCode=111170001577": {
4208        "area": "Best-Seller",
4209        "name": "Click - VIEW DETAILS",
4210        "data": "Gentle Cleansing Oil"
4211    },
4212    "/kr/ko/product/detail?onlineProdSn=62174&amp;onlineProdCode=111170002144": {
4213        "area": "Best-Seller",
4214        "name": "Click - VIEW DETAILS",
4215        "data": "Concentrated Ginseng Rejuvenating Serum"
4216    },
4217    "/kr/ko/product/detail?onlineProdSn=56947&amp;onlineProdCode=111170101593": {
4218        "area": "Best-Seller",
4219        "name": "Click - VIEW DETAILS",
4220        "data": "Men Skincare Duo Set"
4221    },
4222    "/kr/ko/product/detail?onlineProdSn=60647&amp;onlineProdCode=111170001997": {
4223        "area": "Best-Seller",
4224        "name": "Click - VIEW DETAILS",
4225        "data": "UV Daily Essential Sunscreen"
4226    }
4227};
4228    const AS_IS_BY_TEXT = {
4229    "본문 바로가기": {
4230        "area": "Header",
4231        "name": "Click - #main",
4232        "data": "#main"
4233    },
4234    "한국/한국어": {
4235        "area": "Header",
4236        "name": "Select Country",
4237        "data": "kr/ko"
4238    },
4239    "International/English": {
4240        "area": "Header",
4241        "name": "Select Country",
4242        "data": "int/en"
4243    },
4244    "中文": {
4245        "area": "Header",
4246        "name": "Select Country",
4247        "data": "cn/zh"
4248    },
4249    "繁體中文": {
4250        "area": "Header",
4251        "name": "Select Country",
4252        "data": "hk/zh"
4253    },
4254    "Hong Kong(China)/English": {
4255        "area": "Header",
4256        "name": "Select Country",
4257        "data": "hk/en"
4258    },
4259    "Singapore/English": {
4260        "area": "Header",
4261        "name": "Select Country",
4262        "data": "sg/en"
4263    },
4264    "Malaysia/English": {
4265        "area": "Header",
4266        "name": "Select Country",
4267        "data": "my/en"
4268    },
4269    "Việt Nam/Tiếng Việt": {
4270        "area": "Header",
4271        "name": "Select Country",
4272        "data": "vn/vi"
4273    },
4274    "Vietnam/English": {
4275        "area": "Header",
4276        "name": "Select Country",
4277        "data": "vn/en"
4278    },
4279    "Indonesia/Bahasa Indonesia": {
4280        "area": "Header",
4281        "name": "Select Country",
4282        "data": "id/id"
4283    },
4284    "ประเทศไทย/ไทย": {
4285        "area": "Header",
4286        "name": "Select Country",
4287        "data": "th/th"
4288    },
4289    "Thailand/English": {
4290        "area": "Header",
4291        "name": "Select Country",
4292        "data": "th/en"
4293    },
4294    "台灣/繁體中文": {
4295        "area": "Header",
4296        "name": "Select Country",
4297        "data": "tw/zh"
4298    },
4299    "USA/English": {
4300        "area": "Header",
4301        "name": "Select Country",
4302        "data": "us/en"
4303    },
4304    "FRANCE/FRANCAIS": {
4305        "area": "Header",
4306        "name": "Select Country",
4307        "data": "fr/fr"
4308    },
4309    "매장찾기": {
4310        "area": "Header",
4311        "name": "Click - Find a Store",
4312        "data": "매장찾기"
4313    },
4314    "구매하기": {
4315        "area": "Header",
4316        "name": "Click - Mall",
4317        "data": "구매하기"
4318    },
4319    "' + data[i].popupButtonName + '": {
4320        "area": "Main Popup",
4321        "name": "Click - Main Popup Detail Link",
4322        "data": "' + data[i].popupGTMCode + '"
4323    }
4324};
4325    
4326    function normHref(h) {
4327        if (!h) return '';
4328        return h.replace(/^https?:\/\/[^\/]+/, '').trim();
4329    }
4330    
4331    // 모든 정적 a/button 순회 (이미 ap-click 있으면 보존)
4332    document.querySelectorAll('a[href], button').forEach(function(el) {
4333        if (el.hasAttribute('ap-click-area')) return;
4334        const href = el.getAttribute('href') || '';
4335        const text = (el.textContent || '').trim();
4336        let entry = AS_IS_BY_HREF[normHref(href)] || AS_IS_BY_HREF[href] || AS_IS_BY_TEXT[text];
4337        if (!entry) return;
4338        if (entry.area) el.setAttribute('ap-click-area', entry.area);
4339        if (entry.name) el.setAttribute('ap-click-name', entry.name);
4340        if (entry.data) el.setAttribute('ap-click-data', entry.data);
4341    });
4342    // ===== AS-IS 매핑 자동 부착 (끝) =====
4343
4344    // ===== 디버그: GNB/Footer/AS-IS 부착 결과 =====
4345    setTimeout(function() {
4346        var apClicks = document.querySelectorAll('[ap-click-area]');
4347        // console.log('[GA GNB/Footer] 전체 ap-click 부착 요소:', apClicks.length);
4348        var byName = {};
4349        apClicks.forEach(function(el) {
4350            var n = el.getAttribute('ap-click-name') || '(no name)';
4351            byName[n] = (byName[n] || 0) + 1;
4352        });
4353        // console.log('[GA GNB/Footer] name별 분포:', byName);
4354    }, 800);
4355
4356});
4357
4358// ===== 디버그: 클릭 이벤트 추적 =====
4359window.addEventListener('load', function() {
4360    document.addEventListener('click', function(e) {
4361        var target = e.target.closest('[ap-click-area]');
4362        if (!target) return;
4363        var info = {
4364            area: target.getAttribute('ap-click-area'),
4365            name: target.getAttribute('ap-click-name'),
4366            data: target.getAttribute('ap-click-data'),
4367            href: target.getAttribute('href'),
4368            text: (target.textContent || '').trim().substring(0, 50)
4369        };
4370        // console.log('[CLICK]', info);
4371    }, true);
4372});
4373
4374// ===== 키워드 검색 추적 (모든 페이지) =====
4375// 인기검색어/추천/배너 키워드 클릭 시 sessionStorage 마커 셋팅
4376// → 검색 페이지 진입 시 w.ga_search.js가 마커 확인하여 'Keyword Search'로 판별
4377window.addEventListener('load', function() {
4378    var KEYWORD_SELECTORS = [
4379        '.keyword-list a',
4380        '.keyword-wrap a',
4381        '.popular-keyword a',
4382        '[class*="popular-keyword"] a',
4383        '[class*="hot-keyword"] a',
4384        '.recommend-keyword a',
4385        '.recom-keyword a',
4386        '.main-popup a[href*="search.html"]',
4387        '.hot_keyword a',
4388        '[ap-click-name*="Popular Keyword"]',
4389        '[ap-click-name*="Hot Keyword"]',
4390        '[ap-click-name*="Banner"]'
4391    ];
4392    document.querySelectorAll(KEYWORD_SELECTORS.join(', ')).forEac
4392h(function(link) {
4393        var href = link.getAttribute('href') || '';
4394        // search.html로 가는 링크만 (또는 keyword 파라미터 포함)
4395        if (href.indexOf('search.html') > -1 || href.indexOf('keyword=') > -1) {
4396            link.addEventListener('click', function() {
4397                sessionStorage.setItem('ga_keyword_search', '1');
4398                // console.log('[KEYWORD_CLICK] 키워드 검색 마커 셋팅:', (link.textContent || '').trim());
4399            });
4400        }
4401    });
4402});
4403
4404// ===== 해시태그 검색 추적 (모든 페이지) =====
4405// PDP/메인의 hashtag 클릭 시 sessionStorage 마커 셋팅
4406// → 검색 페이지에서 'Hashtag Search'로 판별
4407window.addEventListener('load', function() {
4408    var HASHTAG_SELECTORS = [
4409        '.pdp__hashtag',
4410        '.pdp__hashtags a',
4411        '.f-hashtag a',
4412        '.f-hashtag',
4413        '.hashtag a',
4414        '[class*="hashtag"] a',
4415        '[class*="hash-tag"] a',
4416        'a[href*="search.html"][href*="%23"]',
4417        'a[href*="keyword=%23"]'
4418    ];
4419    document.querySelectorAll(HASHTAG_SELECTORS.join(', ')).forEach(function(link) {
4420        var href = link.getAttribute('href') || '';
4421        // search.html로 가는 hashtag만
4422        if (href.indexOf('search.html') > -1 || href.indexOf('keyword=') > -1
4423            || link.tagName.toLowerCase() === 'span'
4424            || (link.textContent || '').indexOf('#') > -1) {
4425            link.addEventListener('click', function() {
4426                sessionStorage.setItem('ga_hashtag_search', '1');
4427                // console.log('[HASHTAG_CLICK] 해시태그 검색 마커:', (link.textContent || '').trim());
4428            });
4429        }
4430    });
4431});
4432
4433// ===== GNB 클릭 시 breadcrumb sessionStorage 저장 =====
4434// 카테고리 페이지에 #ga-bread DOM이 없을 때 fallback으로 사용
4435window.addEventListener('load', function() {
4436    function saveBreadFromGnbLink(link) {
4437        // 1depth/2depth/3depth Li 찾기
4438        var d3Li = link.closest('.sub_cate02 > li');
4439        var d2Li = link.closest('.sub_cate01 > li');
4440        var d1Li = link.closest('.top_category > ul > li, #slide_add_category > li, #aside #slide_add_category > li');
4441
4442        var d1Text = '', d2Text = '', d3Text = '';
4443        if (d1Li) {
4444            var d1A = d1Li.querySelector(':scope > a');
4445            if (d1A) d1Text = (d1A.textContent || '').trim();
4446        }
4447        if (d2Li) {
4448            var d2A = d2Li.querySelector(':scope > a');
4449            if (d2A) d2Text = (d2A.textContent || '').trim();
4450        }
4451        if (d3Li) {
4452            var d3A = d3Li.querySelector(':scope > a');
4453            if (d3A) d3Text = (d3A.textContent || '').trim();
4454        }
4455
4456        // 클릭한 링크의 텍스트 (가장 깊은 항목)
4457        var clickedText = (link.textContent || '').trim();
4458
4459        var parts = ['HOME'];
4460        if (d1Text) parts.push(d1Text);
4461        if (d2Text && d2Text !== d1Text) parts.push(d2Text);
4462        if (d3Text && d3Text !== d2Text && d3Text !== clickedText) parts.push(d3Text);
4463        // 클릭한 항목 자체가 깊이별 텍스트와 다르면 마지막에 추가
4464        if (clickedText && clickedText !== d1Text && clickedText !== d2Text && clickedText !== d3Text) {
4465            parts.push(clickedText);
4466        }
4467        var bread = parts.join(' > ');
4468        if (bread && bread !== 'HOME') {
4469            sessionStorage.setItem('ga-gnb-bread', bread);
4470            // console.log('[GNB_BREAD] 저장:', bread);
4471        }
4472    }
4473
4474    // PC + Mobile GNB 모두 처리
4475    document.querySelectorAll(
4476        '.header a, ' +
4477        '.top_category a, ' +
4478        '#aside #slide_add_category a, ' +
4479        '#slide_add_category a'
4480    ).forEach(function(link) {
4481        link.addEventListener('click', function() {
4482            saveBreadFromGnbLink(link);
4483        });
4484    });
4485});
4486
4487// 스크립트 생성 일시 2026 / 03 / 13 | 작성자 : JMH
4488// 동적 Bread 생성 함수 (HTML ID + GNB ap-click-data 기반)
4489// layout/basic/layout.html 파일에 지정 (w.ga_header.js보다 먼저 로드)
4490//
4491// [HTML 필수 작업]
4492// #ga-bread       : product/list.html, product/detail.html — product_headcategory 모듈의 <ol>
4493// #ga-prd-name    : product/detail.html — 상품명 요소
4494// #ga-bread-value : 커스텀 페이지 — bread 값 직접 지정 (선택)
4495
4496// ============================
4497// GNB 클릭 시 카테고리 경로 저장
4498// ap-click-data="메이크업>페이스>파운데이션" → sessionStorage에 "HOME > 메이크업 > 페이스 > 파운데이션"
4499// ============================
4500document.addEventListener('click', function(e) {
4501    var gnbLink = e.target.closest('[ap-click-area="GNB"]');
4502    if (!gnbLink) return;
4503    var data = gnbLink.getAttribute('ap-click-data');
4504    if (!data) return;
4505    var parts = data.split('>').map(function(s) { return s.trim(); }
4505).filter(Boolean);
4506    if (parts.length > 0) {
4507        sessionStorage.setItem('ga-gnb-bread', 'HOME > ' + parts.join(' > '));
4508    }
4509});
4510
4511window.generateBread = function(pageType) {
4512
4513    // ===== 페이지별 정적 매핑 (Excel TO-BE 기준) =====
4514    const PAGE_BREAD_MAP = {
4515        "/": "HOME",
4516        "/first-care-activating/first-care-activating-serum-vi.html": "HOME > 윤조",
4517        "/concentrated-ginseng-rejuvenating/introduction.html": "HOME > 자음생",
4518        "/gift/artofdelight/art-of-delight.html": "HOME > 기프트 > 아트 오브 딜라이트",
4519        "/gift/giftselection/gift-selection.html": "HOME > 기프트 > 기프트 셀렉션",
4520        "/best/best-seller.html": "HOME > 베스트 셀러",
4521        "/spa/introduction/introduction.html": "HOME > 스파 > 소개",
4522        "/spa/programs/programs.html": "HOME > 스파 > 프로그램",
4523        "/spa/reservation/reservation.html": "HOME > 스파 > 예약",
4524        "/spa/location/location.html": "HOME > 스파 > 매장 찾기",
4525        "/flagship/intro/index.html": "HOME > 플래그십 스토어 > 소개",
4526        "/flagship/bukchon/index.html": "HOME > 플래그십 스토어 > 북촌",
4527        "/flagship/dosan/index.html": "HOME > 플래그십 스토어 > 도산",
4528        "/about-sulwhasoo/brand-story/brand-story.html": "HOME > ABOUT 설화수 > 브랜드 스토리",
4529        "/about-sulwhasoo/brand-sustainability/sustainability/brand-sustainability.html": "HOME > ABOUT 설화수 > 지속가능성",
4530        "/about-sulwhasoo/brand-sustainability/anti-counterfeit/anti-counterfeit.html": "HOME > ABOUT 설화수 > 위조품 방지",
4531        "/about-sulwhasoo/culture/list.html": "HOME > ABOUT 설화수 > 설화문화전",
4532        "/about-sulwhasoo/salon-sulwhasoo/salon-sulwhasoo.html": "HOME > ABOUT 설화수 > 살롱 설화수",
4533        "/about-sulwhasoo/sulwha-project/archive.html": "HOME > ABOUT 설화수 > 설화 프로젝트",
4534        "/about-sulwhasoo/brand-news/archive/archive.html": "HOME > ABOUT 설화수 > 브랜드 뉴스",
4535        "/about-sulwhasoo/classic-luxury-set/classic-luxury-set.html": "HOME > ABOUT 설화수 > 명작 컬렉션",
4536        "/store/store.html": "HOME > 매장찾기",
4537        "/misc/sitemap/sitemap.html": "HOME > SITEMAP"
4538};
4539    const PAGE_BREAD_WILDCARDS = [
4540        {regex: '^/about-sulwhasoo/culture/sulwhasoo-post/sulwhasoo-post\d+\.html$', bread: 'HOME > ABOUT 설화수 > 살롱 설화수'},
4541        {regex: '^/about-sulwhasoo/sulwha-project/season-\w+\.html$', bread: 'HOME > ABOUT 설화수 > 설화 프로젝트'},
4542        {regex: '^/about-sulwhasoo/classic-luxury-set/[\w-]+\.html$', bread: 'HOME > ABOUT 설화수 > 명작 컬렉션'},
4543        {regex: '^/about-sulwhasoo/brand-news/archive/contents/\d+/[\w-]+\.html$', bread: 'HOME > ABOUT 설화수 > 브랜드 뉴스'}
4544    ];
4545    
4546    var cleanPathnameOnly = location.pathname.split('?')[0];
4547    if (PAGE_BREAD_MAP[cleanPathnameOnly]) {
4548        return PAGE_BREAD_MAP[cleanPathnameOnly];
4549    }
4550    for (var w = 0; w < PAGE_BREAD_WILDCARDS.length; w++) {
4551        if (new RegExp(PAGE_BREAD_WILDCARDS[w].regex).test(cleanPathnameOnly)) {
4552            return PAGE_BREAD_WILDCARDS[w].bread;
4553        }
4554    }
4555    
4556    var HOME = 'HOME';
4557
4558    // ============================
4559    // 1. 메인 페이지
4560    // ============================
4561    if (pageType === 'MAIN') return HOME;
4562
4563    // ============================
4564    // 2. 카테고리/상품 페이지 — #ga-bread (ol > li) 읽기
4565    // ============================
4566    if (pageType === 'PRODUCT_LIST' || pageType === 'PRODUCT_DETAIL') {
4567        var breadEl = document.getElementById('ga-bread');
4568        var categoryBread = null;
4569
4570        if (breadEl) {
4571            var items = breadEl.querySelectorAll('li');
4572            var parts = [];
4573            items.forEach(function(li) {
4574                var text = li.textContent.trim();
4575                if (text && text !== '홈' && text !== 'Home' && text !== 'home') {
4576                    parts.push(text);
4577                }
4578            });
4579            if (parts.length > 0) {
4580                categoryBread = HOME + ' > ' + parts.join(' > ');
4581            }
4582        }
4583
4584        // #ga-bread 비어있을 때 — GNB 클릭 경로 폴백
4585        if (!categoryBread) {
4586            categoryBread = sessionStorage.getItem('ga-gnb-bread') || null;
4587        }
4588
4589        if (pageType === 'PRODUCT_DETAIL') {
4590            // 상품명: #ga-prd-name → var product_name 폴백
4591            var prdNameEl = document.getElementById('ga-prd-name');
4592            var productName = prdNameEl ? prdNameEl.textContent.trim()
4593                : (typeof product_name !== 'undefined' && product_name ? product_name : '');
4594
4595            if (categoryBread) {
4596                sessionStorage.setItem('lastBread', categoryBread);
4597                return productName ? categoryBread + ' > ' + productName : categoryBread;
4598            }
4599
4600            // sessionStorage 폴백 (리스트 → 상세 이동 시)
4601            var prevBread = sessionStorage.getItem('lastBread');
4602            if (prevBread) {
4603                return productName ? prevBread + ' > ' + productName : prevBread;
4604            }
4605
4606            return productName ? HOME + ' > ' + productName : HOME;
4607        }
4608
4609        // 카테고리 리스트
4610        if (categoryBread) {
4611            sessionStorage.setItem('lastBread', categoryBread);
4612            return categoryBread;
4613        }
4614
4615        // #ga-bread-value 폴백 (커스텀 상품 페이지: /product/makeup.html 등)
4616        var breadValEl = document.getElementById('ga-bread-value');
4617        if (breadValEl) return breadValEl.textContent.trim();
4618
4619        return undefined;
4620    }
4621
4622    // ============================
4623    // 3. 검색 페이지 — URL 파라미터에서 키워드 추출
4624    // ============================
4625    if (pageType === 'SEARCH_RESULT') {
4626        var keyword = new URLSearchParams(location.search).get('keyword') || '';
4627        return keyword ? HOME + ' > SEARCH > ' + keyword : HOME + ' > SEARCH';
4628    }
4629
4630    // ============================
4631    // 4. 고정 페이지
4632    // ============================
4633    if (pageType === 'CART') return HOME + ' > 장바구니';
4634    if (pageType === 'ORDER') return HOME + ' > 장바구니 > 주문';
4635    if (pageType === 'EVENT_LIST') return HOME + ' > 이벤트';
4636
4637    // ============================
4638    // 5. 나머지 — h2 텍스트 또는 GNB 클릭 경로 활용
4639    // ============================
4640    var h2 = document.querySelector('h2');
4641    var h2Text = h2 ? h2.textContent.trim() : '';
4642
4643    if (pageType === 'MY') {
4644        return h2Text ? HOME + ' > 마이페이지 > ' + h2Text : HOME + ' > 마이페이지';
4645    }
4646
4647    if (pageType === 'EVENT_DETAIL') {
4648        return h2Text ? HOME + ' > 이벤트 > ' + h2Text : HOME + ' > 이벤트';
4649    }
4650
4651    // LBLL 상세 — h3.board-tit에서 제목 추출
4652    if (location.pathname.indexOf('/lbll/research/read') > -1) {
4653        var lbllTit = document.querySelector('h3.board-tit');
4654        var lbllTitle = lbllTit ? lbllTit.textContent.trim() : '';
4655        if (lbllTitle) return HOME + ' > LBLL > 리스트 > ' + lbllTitle;
4656    }
4657
4658    // HTML에 직접 지정된 bread 값 (커스텀 페이지: /product/makeup.html 등)
4659    var breadValueEl = document.getElementById('ga-bread-value');
4660    if (breadValueEl) return breadValueEl.textContent.trim();
4661
4662    // GNB 클릭 경로 폴백
4663    var gnbBread = sessionStorage.getItem('ga-gnb-bread');
4664    if (gnbBread) {
4665        // 상품 상세인 경우 상품명 추가 (#ga-prd-name → product_name → h2.prd-name)
4666        var prdEl = document.getElementById('ga-prd-name');
4667        var prdName = prdEl ? prdEl.textContent.trim()
4668            : (typeof product_name !== 'undefined' && product_name ? product_name : '');
4669        if (!prdName) {
4670            var prdH2 = document.querySelector('h2.prd-name');
4671            prdName = prdH2 ? prdH2.textContent.trim() : '';
4672        }
4673        if (prdName) return gnbBread + ' > ' + prdName;
4674        return gnbBread;
4675    }
4676
4677    return undefined;
4678};
4679
4680// 스크립트 생성 일시 2026 / 02 / 25 | 작성자 : JMH
4681// 페이징, 사용자 정보 변수
4682window.dataLayer = window.dataLayer || [];
4683
4684// ===== 유저 정보 API 활성화 플래그 =====
4685// true: API 호출 활성 (운영) / false: API 호출 비활성 (타 쇼핑몰 테스트용)
4686const ENABLE_USER_API = true;
4687
4688// CAFE24API.getCustomerIDInfo를 Promise로 래핑 + 폴링
4689// 옴니 SSO redirect 직후 cafe24 회원 세션이 미정착으로 member_id=null 응답 → 200ms × 최대 15회 재시도
4690function getCustomerId(maxAttempts = 15, interval = 200) {
4691    return new Promise((resolve) => {
4692        let attempts = 0;
4693        const tryOnce = () => {
4694            attempts++;
4695            CAFE24API.getCustomerIDInfo(function(err, res) {
4696                var memberId = res && res.id ? res.id.member_id : undefined;
4697                if (memberId) {
4698                    resolve(memberId);
4699                } else if (err || attempts >= maxAttempts) {
4700                    resolve(null);
4701                } else {
4702                    setTimeout(tryOnce, interval);
4703                }
4704            });
4705        };
4706        tryOnce();
4707    });
4708}
4709
4710// ===== 사용자 정보 비동기 로더 (페이지 식별 변수 push와 분리) =====
4711function loadUserInfoAsync(shopNo) {
4712    return getCustomerId().then(function(fullUserId) {
4713        const userId = fullUserId ? fullUserId.split('@')[0] : undefined;
4714        if (!ENABLE_USER_API) return null;
4715        if (!userId || !fullUserId.includes('@s')) return null;
4716        const storedUserId = localStorage.getItem('AP_USER_ID');
4717        if (storedUserId !== userId) {
4718            clearUserData();
4719            return fetchUserInfoOnce(userId, shopNo);
4720        } else if (localStorage.getItem('AP_USER_INFO')) {
4721            Object.assign(window, JSON.parse(localStorage.getItem('AP_USER_INFO')));
4722        }
4723        return null;
4724    }).then(function() {
4725        window.dataLayer = window.dataLayer || [];
4726        window.dataLayer.push({ event: 'user_info_ready' });
4727    });
4728}
4729
4730document.addEventListener('DOMContentLoaded', function() {
4731    const shopNo = CAFE24.SDE_SHOP_NUM;
4732
4733    // 로그인 상태 체크 (쿠키 기반 — AP_DATA_ISLOGIN 표시용)
4734    const isLoggedIn = document.cookie.match(/(?:^| |;)iscache=F/) ? 'Y' : 'N';
4735
4736    // 로그아웃 상태일 때 로컬 스토리지 초기화
4737    if (isLoggedIn === 'N') {
4738        clearUserData();
4739        sessionStorage.removeItem('AP_USER_ID');
4740        sessionStorage.removeItem('AP_USER_INFO');
4741    }
4742
4743    // 현재 페이지가 아이프레임 내부인지 확인
4744    try {
4745        if (window.self !== window.top) {
4746            return;
4747        }
4748    } catch (e) {
4749        return; // 보안 오류가 발생하면 아이프레임 내부로 간주
4750    }
4751
4752    // 상수 정의
4753    const SITE_NAME = 'SULWHASOO';
4754    const ENV = 'PRD';
4755
4756    // 페이지 타입 정의 (bread는 w.ga_bread.js에서 동적 생성)
4757    const PAGE_TYPES = {
4758        MAIN: { paths: ['/', '/index.html'], type: 'MAIN' },
4759        MY: { path: '/myshop', type: 'MY' },
4760        PRODUCT_DETAIL: { path: ['/product/detail'], type: 'PRODUCT_DETAIL' },
4761        PRODUCT_LIST: { path: ['/category', '/product/list', '/best'], type: 'PRODUCT_LIST' },
4762        SEARCH: { path: ['/shopSearch', '/product/search'], type: 'SEARCH_RESULT' },
4763        CART: { path: '/order/basket', type: 'CART' },
4764        ORDER: { path: '/order', type: 'ORDER' },
4765        EVENT_LIST: { path: '/event', type: 'EVENT_LIST' },
4766        EVENT_DETAIL: { path: '/event/detail', type: 'EVENT_DETAIL' }
4767    };
4768
4769    // 언어 코드에서 국가와 언어 정보를 추출
4770    const languageCode = CAFE24.FRONT_LANGUAGE_CODE;
4771    const [lang, country] = languageCode.split('_');
4772    const LANGUAGE_COUNTRY = country.toUpperCase();
4773    const LANGUAGE_LANG = lang.toUpperCase();
4774
4775    // 카페24 플러스앱에서 접속했는지 판별
4776    let isCafe24App = navigator.userAgent.indexOf('Cafe24Plus') > -1;
4777
4778    // 접속 디바이스 타입 확인
4779    const channel = isCafe24App ? 'APP' : EC_MOBILE_DEVICE ? 'MOBILE' : 'PC';
4780
4781    // 페이지 타입 결정
4782    let pageType = 'OTHERS';
4783
4784    // 쿼리 문자열 제거 (URL 경로만 추출)
4785    const cleanPath = location.pathname.split('?')[0];
4786
4787    // 메인 페이지 체크 (정확한 경로 매칭)
4788    if (PAGE_TYPES.MAIN.paths.includes(cleanPath)) {
4789        pageType = PAGE_TYPES.MAIN.type;
4790    } else {
4791        // 다른 페이지 타입 체크
4792        for (const [key, value] of Object.entries(PAGE_TYPES)) {
4793            if (Array.isArray(value.path)) {
4794                if (value.path.some(p => location.pathname.startsWith(p))) {
4795                    pageType = value.type;
4796                    break;
4797                }
4798            } else if (location.pathname.startsWith(value.path)) {
4799                pageType = value.type;
4800                break;
4801            }
4802        }
4803
4804        // 이벤트 상세 페이지 체크 (쿼리 파라미터 확인)
4805        if (cleanPath.includes('/event/detail')) {
4806            pageType = 'EVENT_DETAIL';
4807        }
4808    }
4809
4810    // URL 매칭 실패 시 — 변수/DOM 기반 보조 판별
4811    if (pageType === 'OTHERS') {
4812        if (typeof product_name !== 'undefined' && product_name) {
4813            pageType = 'PRODUCT_DETAIL';
4814        }
4815    }
4816
4817    // 동적 bread 생성 (w.ga_bread.js)
4818    const bread = window.generateBread ? window.generateBread(pageType) : undefined;
4819
4820    // 페이징 정보 전역 변수 선언
4821    window.AP_DATA_SITENAME = SITE_NAME;
4822    window.AP_DATA_COUNTRY = LANGUAGE_COUNTRY;
4823    window.AP_DATA_LANG = LANGUAGE_LANG;
4824    window.AP_DATA_ENV = ENV;
4825    window.AP_DATA_CHANNEL = channel;
4826    window.AP_DATA_BREAD = bread;
4827    window.AP_DATA_PAGETYPE = pageType;
4828    window.AP_DATA_ISLOGIN = isLoggedIn;
4829
4830    // // 페이지 정보 디버깅 로그
4831    // console.log('[GA HEADER]', {
4832    //     브랜드: window.AP_DATA_SITENAME,
4833    //     국가코드: window.AP_DATA_COUNTRY,
4834    //     페이지언어: window.AP_DATA_LANG,
4835    //     개발환경: window.AP_DATA_ENV,
4836    //     접속환경: window.AP_DATA_CHANNEL,
4837    //     페이지브래드: window.AP_DATA_BREAD,
4838    //     페이지타입: window.AP_DATA_PAGETYPE,
4839    //     로그인유무: window.AP_DATA_ISLOGIN
4840    // });
4841
4842    // console.log({
4843    //     회원아이디: window.AP_DATA_GCID,
4844    //     통합회원번호: window.AP_DATA_CID,
4845    //     통합회원여부: window.AP_DATA_ISMEMBER,
4846    //     성별: window.AP_DATA_CG,
4847    //     생년: window.AP_DATA_CD,
4848    //     로그인방법: window.AP_DATA_LOGINTYPE,
4849    //     회원등급: window.AP_DATA_CT,
4850    //     뷰티포인트등급: window.AP_DATA_BEAUTYCT,
4851    //     임직원여부: window.AP_DATA_ISEMPLOYEE
4852    // });
4853
4854    // 사용자 정보 비동기 로드 (페이지 식별 변수 push 완료 후 fire-and-forget)
4855    loadUserInfoAsync(shopNo).catch(function() {});
4856});
4857
4858async function fetchUserInfoOnce(user_id, shop_no) {
4859    // localStorage에서 먼저 확인
4860    const storedData = localStorage.getItem('AP_USER_INFO');
4861    const storedUserId = localStorage.getItem('AP_USER_ID'); // 저장된 사용자 ID
4862
4863    // 현재 로그인한 사용자와 저장된 데이터의 사용자 ID가 일치하는지 확인
4864    if (storedData && storedUserId === user_id) {
4865        // console.log('[USER_INFO 검증] fetchUserInfoOnce: localStorage에 데이터 존재 → API 호출 스킵');
4866        const userInfo = JSON.parse(storedData);
4867        Object.assign(window, userInfo); // 전역 변수에 데이터 할당
4868        return; // 이미 저장된 데이터가 있으면 API 호출 X
4869    }
4870
4871    // console.log('[USER_INFO 검증] fetchUserInfoOnce: API 호출 시작');
4872    try {
4873        const response = await fetch('https://ap-brand-cafe24-adm-fo.apddev.com/api/fo/api/apsulwhasoo/user-info', {
4874            method: 'POST',
4875            headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
4876            body: new URLSearchParams({ user_id, shop_no })
4877        });
4878
4879        if (!response.ok) throw new Error('API 호출 실패');
4880
4881        const data = await response.json();
4882        
4883        // 전역 변수 set을 login_complete 트리거 이전에 수행 (GTM에서 트리거 시점에 사용자 변수 활용 가능)
4884        const userInfo = {
4885            AP_DATA_GCID: data.ap_login_id || undefined,
4886            AP_DATA_CID: data.incs_no || undefined,
4887            AP_DATA_ISMEMBER: "Y", // 기본값 설정
4888            AP_DATA_CG: data.sxcl_cd || undefined,
4889            AP_DATA_CD: data.birth_year || undefined,
4890            AP_DATA_LOGINTYPE: "NORMAL", // 기본값 설정
4891            AP_DATA_CT: determineGroupName(data.group_name),
4892            AP_DATA_BEAUTYCT: data.icsg_nm || undefined,
4893            AP_DATA_ISEMPLOYEE: data.emp_yn || undefined
4894        };
4895        Object.assign(window, userInfo);
4896
4897        // 사용자 정보 set 완료 후 login_complete 트리거 발사
4898        window.dataLayer = window.dataLayer || [];
4899        window.dataLayer.push({
4900            'event':'login_complete',
4901            'event_category':'login',
4902            'event_action':'login - complete',
4903            'event_label': data.omni_amr
4904        });
4905
4906        if (data.omni_first_login_yn === 'Y') {
4907            window.dataLayer.push({
4908                'event':'sign_up_complete',
4909                'event_category':'sign_up',
4910                'event_action':'sign_up - complete',
4911                'event_label': data.omni_amr
4912            });
4913        }
4914
4915        // // localStorage에 사용자 정보 및 ID 저장
4916        localStorage.setItem('AP_USER_INFO', JSON.stringify(userInfo));
4917        localStorage.setItem('AP_USER_ID', user_id); // 현재 사용자 ID 저장
4918        // console.log('[USER_INFO 검증] fetchUserInfoOnce: API 호출 성공 → localStorage에 저장 완료');
4919
4920    } catch (error) {
4921        // console.error('[USER_INFO 검증] API 호출 중 에러:', error);
4922    }
4923}
4924
4925// 언어 판별 및 대문자 변환 함수
4926function determineGroupName(groupName) {
4927    if (!groupName) return undefined; // 값이 없으면 undefined 반환
4928
4929    const isEnglish = /^[A-Za-z\s]+$/.test(groupName); // 영어인지 확인
4930    return isEnglish ? groupName.toUpperCase() : groupName; // 영어면 대문자 변환, 아니면 그대로 반환
4931}
4932
4933
4934function clearUserData() {
4935    // console.log('[USER_INFO 검증] clearUserData: 사용자 데이터 초기화');
4936    // localStorage 초기화
4937    localStorage.removeItem('AP_USER_INFO');
4938    localStorage.removeItem('AP_USER_ID');
4939
4940    // 전역 변수 초기화
4941    window.AP_DATA_GCID = undefined;
4942    window.AP_DATA_CID = undefined;
4943    window.AP_DATA_ISMEMBER = undefined;
4944    window.AP_DATA_CG = undefined;
4945    window.AP_DATA_CD = undefined;
4946    window.AP_DATA_LOGINTYPE = undefined;
4947    window.AP_DATA_CT = undefined;
4948    window.AP_DATA_BEAUTYCT = undefined;
4949    window.AP_DATA_ISEMPLOYEE = undefined;
4950
4951    // console.log("사용자 데이터 초기화 완료");
4952}
4953
4954// 페이지 로드 시 카테고리 정보를 전역 변수에 저장
4955window.globalCategoryInfo = {};
4956let categoryInitialized = false; // 카테고리 초기화 완료 플래그
4957let categoryRetryCount = 0; // 카테고리 재시도 횟수
4958const MAX_CATEGORY_RETRY = 20; // 최대 재시도 (500ms × 20 = 10초)
4959
4960// 카테고리 초기화 및 계층 구조 생성
4961(function initCategoryInfo() {
4962    try {
4963        if (typeof aCategory !== 'undefined' && aCategory.length > 0) {
4964            for (let i = 0; i < aCategory.length; i++) {
4965                if (aCategory[i] && aCategory[i].cate_no) {
4966                    globalCategoryInfo[aCategory[i].cate_no] = aCategory[i];
4967                }
4968            }
4969
4970            // 계층 구조로 이름을 조합하여 전역 변수에 저장
4971            globalCategoryInfo.formatted = [];
4972            for (const cateNo in globalCategoryInfo) {
4973                const category = globalCategoryInfo[cateNo];
4974                const name = category.name;
4975                let parentCateNo = category.parent_cate_no;
4976
4977                let fullName = name;
4978
4979                // 상위 카테고리 이름을 포함하여 fullName 생성
4980                while (parentCateNo && globalCategoryInfo[parentCateNo]) {
4981                    const parentName = globalCategoryInfo[parentCateNo].name;
4982                    fullName = `${parentName} / ${fullName}`;
4983                    parentCateNo = globalCategoryInfo[parentCateNo].parent_cate_no;
4984                }
4985
4986                globalCategoryInfo.formatted.push({ cate_no: cateNo, name: fullName });
4987            }
4988
4989            categoryInitialized = true; // 초기화 완료 표시
4990
4991        } else if (categoryRetryCount < MAX_CATEGORY_RETRY) {
4992            categoryRetryCount++;
4993            setTimeout(initCategoryInfo, 500); // 데이터가 로드될 때까지 대기
4994        }
4995    } catch (error) {
4996        // console.error('카테고리 정보 초기화 중 오류:', error);
4997    }
4998})();
4999
5000
5001// 스크립트 생성 일시 2026 / 05 / 13 | 작성자 : JMH
5002// 외부 매장 링크 클릭 시 go_to_mall 이벤트 태깅
5003// console.log('[GO_TO_MALL] w.ga_gotomall.js 로드됨');
5004
5005document.addEventListener('DOMContentLoaded', function () {
5006    window.dataLayer = window.dataLayer || [];
5007    // console.log('[GO_TO_MALL] click listener 등록 시작');
5008
5009    function detectMallByHref(href) {
5010        if (!href) return null;
5011        var h = href.toLowerCase();
5012        if (h.indexOf('amoremall.com') > -1) return 'APMALL';
5013        if (h.indexOf('beautypoint.co.kr') > -1) return 'BEAUTYPOINT';
5014        if (h.indexOf('11st.co.kr') > -1) return '11ST';
5015        if (h.indexOf('coupang.com') > -1) return 'COUPANG';
5016        if (h.indexOf('gmarket.co.kr') > -1) return 'GMARKET';
5017        if (h.indexOf('auction.co.kr') > -1) return 'AUCTION';
5018        if (h.indexOf('lotte') > -1 && h.indexOf('shopping') > -1) return 'LOTTEON';
5019        if (h.indexOf('shinsegae') > -1 || h.indexOf('ssg.com') > -1) return 'SSG';
5020        if (h.indexOf('oliveyoung') > -1) return 'OLIVEYOUNG';
5021        if (h.indexOf('hyundai') > -1 && h.indexOf('hmall') > -1) return 'HMALL';
5022        if (h.indexOf('aekyung') > -1) return 'AEKYUNG';
5023        if (h.indexOf('emart') > -1) return 'EMART';
5024        if (h.indexOf('smartstore.naver.com') > -1 || h.indexOf('brand.naver.com') > -1 || h.indexOf('shopping.naver.com') > -1) return 'NAVER';
5025        return null;
5026    }
5027
5028    // 한글 몰명(어드민 등록 buyLinks key 등) → 영문 컨벤션 정규화
5029    var KOR_TO_EN = {
5030        '아모레몰': 'APMALL', 'AP몰': 'APMALL', 'APMALL': 'APMALL',
5031        '뷰티포인트': 'BEAUTYPOINT',
5032        '11번가': '11ST',
5033        '쿠팡': 'COUPANG',
5034        'G마켓': 'GMARKET', '지마켓': 'GMARKET',
5035        '옥션': 'AUCTION',
5036        '롯데온': 'LOTTEON', '롯데': 'LOTTEON',
5037        'SSG': 'SSG', '쓱닷컴': 'SSG', '신세계': 'SSG',
5038        '올리브영': 'OLIVEYOUNG',
5039        '현대H몰': 'HMALL', 'H몰': 'HMALL',
5040        '애경몰': 'AEKYUNG',
5041        '이마트몰': 'EMART', '이마트': 'EMART',
5042        '네이버': 'NAVER', '네이버 브랜드 스토어': 'NAVER',
5043        '네이버 스마트스토어': 'NAVER', '네이버쇼핑': 'NAVER', '네이버 쇼핑': 'NAVER'
5044    };
5045    function normalizeMallName(s) {
5046        if (!s) return s;
5047        var key = s.replace(/\s+/g, ' ').trim();
5048        if (KOR_TO_EN[key]) return KOR_TO_EN[key];
5049        // 부분 매칭 (예: "네이버 브랜드 스토어 (상품A)")
5050        for (var k in KOR_TO_EN) {
5051            if (key.indexOf(k) > -1) return KOR_TO_EN[k];
5052        }
5053        return key;
5054    }
5055
5056    // PDP 구매링크 컨테이너 안의 옵션 <a>는 텍스트(=buyLinks key=몰명)를 폴백으로 활용
5057    function isPdpBuyLink(link) {
5058        if (!link || !link.closest) return false;
5059        return !!link.closest('.btn-link-wrap, .ap2022-popup__body, #sws-go-apmall-link, .store-online');
5060    }
5061
5062    // capture 단계로 등록 (target=_blank로 새 창 열리기 전에 잡기 위해)
5063    document.addEventListener('click', function (e) {
5064        var link = e.target.closest('a, button, [ap-data-gotomall]');
5065        if (!link) return;
5066
5067        var mallName = link.getAttribute('ap-data-gotomall');
5068        if (!mallName) {
5069            var clickName = link.getAttribute('ap-click-name') || '';
5070            // 'Click - Mall' / 'Click-mall' / 'Click Mall' 등 대소문자·구분자 변형 허용
5071            if (/click[\s\-]*mall/i.test(clickName)) {
5072                mallName = link.getAttribute('ap-click-data') || null;
5073            }
5074        }
5075        if (!mallName) {
5076            var href = link.getAttribute('href') || '';
5077            mallName = detectMallByHref(href);
5078        }
5079        // PDP 구매링크 다중 옵션 폴백: 링크 텍스트(=어드민 등록 몰명) 사용
5080        if (!mallName && isPdpBuyLink(link)) {
5081            var txt = (link.textContent || '').replace(/\s+/g, ' ').trim();
5082            if (txt && txt !== '구매하러 가기' && txt.length <= 30) {
5083                mallName = txt;
5084            }
5085        }
5086
5087        if (!mallName) return;
5088        mallName = normalizeMallName(mallName);
5089
5090        var info = {
5091            mall_name: mallName,
5092            href: link.getAttribute('href') || '',
5093            text: (link.textContent || '').replace(/\s+/g, ' ').trim().substring(0, 50),
5094            target: link.getAttribute('target') || '_self'
5095        };
5096        // console.log('[GO_TO_MALL] 클릭 감지!', info);
5097
5098        try {
5099            window.dataLayer.push({
5100                'event': 'go_to_mall',
5101                'mall_name': mallName
5102            });
5103            // console.log('[GO_TO_MALL] dataLayer push 완료:', { event: 'go_to_mall', mall_name: mallName });
5104        } catch(err) {
5105            // console.error('[GO_TO_MALL] push 실패:', err);
5106        }
5107    }, true);  // capture phase
5108
5109    // console.log('[GO_TO_MALL] click listener 등록 완료 (capture phase)');
5110});
5111
5112// 외부 mall 링크에 ap-data-gotomall 속성 자동 부착
5113window.addEventListener('load', function() {
5114    var MALL_PATTERNS = [
5115        { host: 'amoremall.com',    name: 'APMALL' },
5116        { host: 'beautypoint.co.kr', name: 'BEAUTYPOINT' },
5117        { host: '11st.co.kr',       name: '11ST' },
5118        { host: 'coupang.com',      name: 'COUPANG' },
5119        { host: 'gmarket.co.kr',    name: 'GMARKET' },
5120        { host: 'oliveyoung',       name: 'OLIVEYOUNG' },
5121        { host: 'lotte',            name: 'LOTTEON' },
5122        { host: 'ssg.com',          name: 'SSG' },
5123        { host: 'smartstore.naver.com', name: 'NAVER' },
5124        { host: 'brand.naver.com',  name: 'NAVER' }
5125    ];
5126    document.querySelectorAll('a[href]').forEach(function(link) {
5127        if (link.hasAttribute('ap-data-gotomall')) return;
5128        var href = (link.getAttribute('href') || '').toLowerCase();
5129        if (!href.startsWith('http')) return;
5130        for (var i = 0; i < MALL_PATTERNS.length; i++) {
5131            if (href.indexOf(MALL_PATTERNS[i].host) > -1) {
5132                link.setAttribute('ap-data-gotomall', MALL_PATTERNS[i].name);
5133                if (!link.hasAttribute('ap-click-area')) {
5134                    link.setAttribute('ap-click-area', 'External');
5135                    link.setAttribute('ap-click-name', 'Click - Mall');
5136                    link.setAttribute('ap-click-data', MALL_PATTERNS[i].name);
5137                }
5138                break;
5139            }
5140        }
5141    });
5142
5143    var gotomallLinks = document.querySelectorAll('[ap-data-gotomall]');
5144    var clickMallLinks = document.querySelectorAll('[ap-click-name="Click - Mall"]');
5145    // console.log('[GO_TO_MALL] ap-data-gotomall 부착된 링크:', gotomallLinks.length);
5146    // console.log('[GO_TO_MALL] ap-click-name="Click - Mall" 링크:', clickMallLinks.length);
5147    if (gotomallLinks.length > 0) {
5148        var malls = {};
5149        gotomallLinks.forEach(function(l) {
5150            var m = l.getAttribute('ap-data-gotomall');
5151            malls[m] = (malls[m] || 0) + 1;
5152        });
5153        // console.log('[GO_TO_MALL] mall별 분포:', malls);
5154    }
5155    // Click - Mall 링크 샘플 (한율 구매하기 등)
5156    if (clickMallLinks.length > 0) {
5157        clickMallLinks.forEach(function(l, idx) {
5158            if (idx < 5) {
5159                console.log('[GO_TO_MALL] Click-Mall 링크 #' + (idx+1) + ':', {
5160                    href: l.getAttribute('href'),
5161                    data: l.getAttribute('ap-click-data'),
5162                    text: (l.textContent || '').trim().substring(0, 30)
5163                });
5164            }
5165        });
5166    }
5167});
5168
5169$(function(){
5170    if (typeof(EC_SHOP_MULTISHOP_SHIPPING) != "undefined") {
5171        var sShippingCountryCode4Cookie = 'shippingCountryCode';
5172        var bShippingCountryProc = false;
5173
5174        // 배송국가 선택 설정이 사용안함이면 숨김
5175        if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === false) {
5176            $('.xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist').hide();
5177            $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption .xans-layout-multishoplistmultioptioncountry').hide();
5178        } else {
5179            $('.thumb .xans-layout-multishoplistitem').hide();
5180            var aShippingCountryCode = document.cookie.match('(^|;) ?'+sShippingCountryCode4Cookie+'=([^;]*)(;|$)');
5181            if (typeof(aShippingCountryCode) != 'undefined' && aS
5181hippingCountryCode != null && aShippingCountryCode.length > 2) {
5182                var sShippingCountryValue = aShippingCountryCode[2];
5183            }
5184
5185            // query string으로 넘어 온 배송국가 값이 있다면, 그 값을 적용함
5186            var aHrefCountryValue = decodeURIComponent(location.href).split("/?country=");
5187
5188            if (aHrefCountryValue.length == 2) {
5189                var sShippingCountryValue = aHrefCountryValue[1];
5190            }
5191
5192            // 메인 페이지에서 국가선택을 안한 경우, 그 외의 페이지에서 셋팅된 값이 안 나오는 현상 처리
5193            if (location.href.split("/").length != 4 && $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val()) {
5194                $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join(""));
5195
5196                if ($("#f_country").length > 0 && location.href.indexOf("orderform.html") > -1) {
5197                    $("#f_country").val($(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val());
5198                }
5199            }
5200            if (typeof(sShippingCountryValue) != "undefined" && sShippingCountryValue != "" && sShippingCountryValue != null) {
5201                sShippingCountryValue = sShippingCountryValue.split("#")[0];
5202                var bShippingCountryProc = true;
5203
5204                $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(sShippingCountryValue);
5205                $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join(""));
5206                var expires = new Date();
5207                expires.setTime(expires.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30일간 쿠키 유지
5208                document.cookie = sShippingCountryCode4Cookie+'=' + $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val() +';path=/'+ ';expires=' + expires.toUTCString();
5209                if ($("#f_country").length > 0 && location.href.indexOf("orderform.html") > -1) {
5210                    $("#f_country").val(sShippingCountryValue).change();
5211                }
5212            }
5213        }
5214        // 언어선택 설정이 사용안함이면 숨김
5215        if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingLanguageSelection === false) {
5216            $('.xans-layout-multishopshipping .xans-layout-multishopshippinglanguagelist').hide();
5217            $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption .xans-layout-multishoplistmultioptionlanguage').hide();
5218        } else {
5219            $('.thumb .xans-layout-multishoplistitem').hide();
5220        }
5221
5222        // 배송국가 및 언어 설정이 둘 다 사용안함이면 숨김
5223        if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShipping === false) {
5224            $(".xans-layout-multishopshipping").hide();
5225            $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption').hide();
5226        } else if (bShippingCountryProc === false && location.href.split("/").length == 4) { // 배송국가 값을 처리한 적이 없고, 메인화면일 때만 선택 레이어를 띄움
5227            var sShippingCountryValue = $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val();
5228            $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(sShippingCountryValue);
5229            $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join(""));
5230            // 배송국가 선택을 사용해야 레이어를 보이게 함
5231            if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === true) {
5232                $(".xans-layout-multishopshipping").show();
5233            }
5234        }
5235
5236        $(".xans-layout-multishopshipping .btnClose").on("click", function() {
5237            $(".xans-layout-multishopshipping").hide();
5238        });
5239
5240        $(".xans-layout-multishopshipping .ec-base-button a").on("click", function() {
5241            var expires = new Date();
5242            expires.setTime(expires.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30일간 쿠키 유지
5243            document.cookie = sShippingCountryCode4Cookie+'=' + $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val() +';path=/'+ ';expires=' + expires.toUTCString();
5244
5245            // 도메인 문제로 쿠키로 배송국가 설정이 안 되는 경우를 위해 query string으로 배송국가 값
5245을 넘김
5246            var sQuerySting = (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === false) ? "" : "/?country="+encodeURIComponent($(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val());
5247
5248            location.href = '//'+$(".xans-layout-multishopshipping .xans-layout-multishopshippinglanguagelist").val()+sQuerySting;
5249        });
5250        $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a").on("click", function() {
5251            $(".xans-layout-multishopshipping").show();
5252        });
5253    }
5254});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.