PageSourceSearch

https://roden.co.kr/js/common.1789971750.js

js roden.co.kr collected 2026-09-25 11:06:00 UTC 725,301 bytes, 13,030 lines download raw bytes

1var selRange, product_brand_list;
2if (typeof(COMMON_JS) == 'undefined') {
3    jQuery.migrateTrace = false;
4    jQuery.migrateMute = true;
5    $.fn.outerHTML = function() {
6        return $(this).clone().wrapAll("<div/>").parent().html();
7    }
8
9    $.toast = function(opts) {
10        var closeToast = function ($toast, opts) {
11            $toast.find('.toast-box').fadeOut(opts.animation_duration);
12            setTimeout(function () {
13                $toast.remove();
14            }, opts.animation_duration);
15            
16            $(document).off('.toast');
17            $(window).off('.toast');
18        }; 
19
20        var show = function() {
21            if($('.toast-container').length) $('.toast-container').remove();
22
23            var $toast = $(`
24                <div class="toast-container">
25                    <div class="toast-box">${opts.title}</div>
26                </div>
27            `);
28
29            var $box = $toast.find('.toast-box');
30
31            // 애니메이션 방법1
32            // var set_height = $toast.height();
33            // $toast.css({
34            //     'top' : opts.top, 
35            //     'left' : opts.left, 
36            //     'z-index': opts.zIndex,
37            //     'box-shadow' : '1px 1px 4px ' + colorset + 'aa',
38            //     'color' : colorset,
39            //     'font-size' : '14px',
40            //     'border' : '1px solid ' + colorset,
41            //     'height' : '0px',
42            // }).animate({'height' : set_height}, opts.animation_duration);
43
44            // 애니메이션 방법2
45            // $toast.css({
46            //     'display':'none', 
47            //     'top' : opts.top, 
48            //     'left' : opts.left, 
49            //     'z-index': opts.zIndex,
50            //     'box-shadow' : '1px 1px 4px ' + colorset + 'aa',
51            //     'color' : colorset,
52            //     'font-size' : '14px',
53            //     'border' : '1px solid ' + colorset,
54            // }).fadeIn(opts.animation_duration);
55
56            // 애니메이션 방법3
57            $box.css({
58                top: opts.top,
59                left: opts.left,
60                zIndex: opts.zIndex,
61                transform: `translate(-50%,-50%) scale(0)`,
62                transition: `transform ${(opts.animation_duration / 1000)}s`,
63                opacity: '.3',
64                position: 'fixed',
65                wordBreak : 'auto-phrase',
66            });
67
68            $box.css(opts.boxCss || {});
69            $box.addClass(opts.type);
70
71            $('body').append($toast);
72
73            setTimeout(function() {
74                $box.css({ transform: `translate(-50%,-50%) scale(1)` });
75                $box.animate({ opacity: '1' }, opts.animation_duration);
76            }, 0);
77
78            // auto close
79            if (opts.autoClose) {
80                setTimeout(function () {
81                    closeToast($toast, opts);
82                }, opts.display_duration + opts.animation_duration);
83            } else {
84                $toast.addClass('autoclose');
85
86                setTimeout(function () {
87                    $(window).on('wheel.toast', function () {
88                        closeToast($toast, opts);
89                    });
90
91                    $(window).on('scroll.toast', function () {
92                        closeToast($toast, opts);
93                    });
94                }, 0);
95            }
96
97            
98            // outside click close
99            if (!opts.autoClose && opts.outsideClickClose) {
100                $box.on('click', function (e) {
101                    e.stopPropagation();
102                });
103
104                setTimeout(function () {
105                    $(document).on('click.toast', function () {
106                        closeToast($toast, opts);
107                        $(document).off('click.toast');
108                    });
109                }, 0);
110            }
111
112            
113            // self click close
114            if (!opts.autoClose && !opts.outsideClickClose) {
115                $box.css('cursor', 'pointer');
116
117                $box.on('click', function (e) {
118                    e.stopPropagation();
119                    closeToast($toast, opts);
120                });
121            }
122
123        };
124
125        opts = $.extend(true, {}, $.toast.defaults, opts);
126        show();
127    }
128
129    $.toast.defaults = {
130        title: 'Type the title.',
131        type: 'info', // info - blue, danger - red, 
132        display_duration: 3000,
133        animation_duration: 300,
134        top: '150px',
135        left: '50%',
136        zIndex: '9999',
137
138        autoClose: true, // 자동 닫힘
139        outsideClickClose: true, // 바깥 클릭 닫힘
140        boxCss: {}
141    };
142
143    if (typeof rt_path == 'undefined')
144        alert('rt_path 변수가 선언되지 않았습니다.');
145
146    var COMMON_JS = true;
147
148    var setLogs = function(type, action, icon, obj, page, select_el) {
149        if (typeof IS_CONFIG == 'undefined' || IS_CONFIG !== true) return false;
150        if (typeof SID == 'undefined' || !SID) return false;
151        if(typeof page == 'undefined') page = PAGE;
152        if(typeof select_el == 'undefined') select_el = editEL;
153        $.ajax({
154            url:'/template/log',
155            type:'post',
156            async: true,
157            dataType:'json',
158            data: { sid: SID, page: page, type: type, el: select_el, action: action, icon: icon, obj: obj },
159            success:function(data) {
160                if (typeof data.error != 'undefined' && data.error) {
161                    return false;
162                }
163                addlogs(data);
164            }
165        });
166    }
167    
168    var getHistoryLogText = function(data) {
169        var action = (typeof data.msg != 'undefined' && data.msg) ? data.msg : ((typeof data.action != 'undefined') ? data.action : '');
170        var objKey = (typeof data.obj != 'undefined' && data.obj) ? data.obj : '';
171        var str = (typeof $.lang[LANG]['log.' + action] != 'undefined') ? $.lang[LANG]['log.' + action] : action;
172        var obj = (typeof $.lang[LANG]['log.' + objKey] == 'undefined') ? objKey + ' ' : $.lang[LANG]['log.' + objKey] + ' ';
173
174        obj = (data.type == 'MENU' || data.type == 'FOOT' || data.type == 'BOOKMARK') ? obj : '';
175        if (obj === '' && typeof str != 'undefined' && str.length > 0) str = str.replace(/^: /, '');
176
177        return obj + str;
178    }
179
180    var createHistoryLogItem = function(data, activeSeq) {
181        var $li = $('<li>'),
182            $log = $('<a>'),
183            icon = (typeof data.icon != 'undefined' && data.icon) ? data.icon : '',
184            date = (typeof data.regdate != 'undefined' && data.regdate) ? data.regdate : ((typeof data.date != 'undefined') ? data.date : '');
185
186        $log.attr('href', '#')
187            .attr('data-seq', data.seq)
188            .attr('data-mode', (typeof data.mode != 'undefined' && data.mode) ? data.mode : 'snapshot')
189            .attr('data-target-seq', (typeof data.target_seq != 'undefined' && data.target_seq) ? data.target_seq : '')
190            .attr('data-toggle', 'tooltip')
191            .attr('data-placement', 'left')
192            .attr('data-container', 'body')
193            .attr('title', date)
194            .addClass('user-logs');
195
196        if (typeof activeSeq != 'undefined' && activeSeq && String(activeSeq) == String(data.seq)) {
197            $log.addClass('active');
198        }
199
200        $log.append($('<i>').addClass('fa').addClass(icon));
201        $log.append(document.createTextNode(' ' + getHistoryLogText(data)));
202        $li.append($log);
203
204        return $li;
205    }
206
207    var renderHistoryList = function(actionList, activeSeq) {
208        var $dropdown = $('.history-dropdown');
209        if($dropdown.length == 0 || !$.isArray(actionList)) return false;
210
211        $dropdown.empty();
212        $.each(actionList, function(i, data) {
213            if(!data || !data.seq) return true;
214            $dropdown.append(createHistoryLogItem(data, activeSeq));
215        });
216
217        return true;
218    }
219
220    var refreshHistoryList = function(activeSeq) {
221        if (typeof SID == 'undefined' || !SID) return false;
222
223        $.ajax({
224            url:'/template/history_list',
225            type:'post',
226            async: true,
227            dataType:'json',
228            data: { sid: SID },
229            success:function(data) {
230                var r = checkError(data);
231                if (r == false) return false;
232
233                var currentSeq = (typeof activeSeq != 'undefined' && activeSeq) ? activeSeq : data.history;
234                renderHistoryList(data.action, currentSeq);
235            }
236        });
237
238        return true;
239    }
240
241    var addlogs = function(data) {
242        var hasDeletedAction = (typeof data.deleted_action_seq_list != 'undefined' && $.isArray(data.deleted_action_seq_list) && data.deleted_action_seq_list.length > 0);
243        if (typeof data.deleted_action_seq_list != 'undefined' && $.isArray(data.deleted_action_seq_list)) {
244            $.each(data.deleted_action_seq_list, function(i, seq) {
245                $('.history-dropdown .user-logs[data-seq="' + seq + '"]').closest('li').remove();
246            });
247        }
248        $('.history-dropdown li a').removeClass('active');
249        var maxHistoryLogCount = 50;
250        while ($('.history-dropdown').children().length > maxHistoryLogCount - 1) {
251            $('.history-dropdown li').last().remove();
252        }
253        $('.history-dropdown').prepend(createHistoryLogItem(data, data.seq));
254        if(hasDeletedAction) refreshHistoryList(data.seq);
255    }
256
257    function getServiceHost() {
258        var s = window.location.hostname;
259        if (s == 'www.creatorlink.net' || s == 'creatorlink.net' || s == 'www.showbible.com' || s == 'showbible.com' || s == 'www.addblock.net' || s == 'addblock.net' ||
260            s == 'www.creatorlink-gabia.com' || s == 'creatorlink-gabia.com') {
261            s = s.replace('www.', '');
262            s = (window.location.port) ? s + ':' + window.location.port : s;
263        } else {
264            s = window.location.host;
265        }
266        return s;
267    }
268
269    function clLocalStorageClear() {
270      var cl_key_arr = ['referer','sid','type','pid','view','page_mode','status','parent','reply_name','reply','id','content','secret','href','forum_email'];
271      $.each(cl_key_arr, function(i, k) {
272          if (typeof k != 'undefined' && k) window.localStorage.removeItem(k);
273      });
274    }
275
276    function log_analytics(sid, googleAnalytics, googleAnalytics_check) {
277        var scriptTag = '';
278        if (googleAnalytics_check == 'old') {
279            scriptTag = "\
280            (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n\
281            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n\
282            m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n\
283            })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n\
284            ";
285            if (googleAnalytics) {
286                scriptTag += "\
287                ga('create', '" + googleAnalytics + "', 'auto');\n\
288                ga('require', 'displayfeatures');\n\
289                ga('require', 'linkid');\n\
290                ga('send', 'pageview');\n\
291                ";
292            }
293
294        } else {
295            if (sid && googleAnalytics) {
296                scriptTag = "\
297                window.dataLayer = window.dataLayer || [];\n\
298                function gtag(){dataLayer.push(arguments); }\n\
299                gtag('js', new Date());\n\
300                ";
301                scriptTag += (googleAnalytics) ? "gtag('config', '" + googleAnalytics + "');\n" : "";
302                $('body').prepend('<script async src="https://www.googletagmanager.com/gtag/js?i
302d=' + googleAnalytics + '"></script>');
303            }
304        }
305
306        if(scriptTag != '') {
307            var addScriptTag = '';
308            if(sid && googleAnalytics) {
309                addScriptTag += "\n\
310                    <script>\n\
311                        window.dataLayer = window.dataLayer || [];\n\
312                        if(typeof localStorage.getItem('googleAnalyticsUID"+sid+"') != 'undefined' && localStorage.getItem('googleAnalyticsUID"+sid+"')) {\n\
313                            dataLayer.push({ 'user_id': localStorage.getItem('googleAnalyticsUID"+sid+"') });\n\
314                        }\n\
315                    </script>\n\
316                ";
317            }
318
319            addScriptTag += '<script>' + scriptTag + '</script>'
320            $('body').prepend(addScriptTag);
321        }
322        
323    }
324
325    function naverSeo(type) {
326        var jsonscript = '';
327        switch (type) {
328            case 'faq':
329                {
330                    jsonscript +=
331                    '\
332                    {\
333                      "@context": "http://schema.org",\
334                      "@type": "FAQPage",\
335                      "mainEntity": [\
336                        {\
337                          "@type": "Question",\
338                          "name": "포트폴리오 사이트만 만들 수 있나요?",\
339                          "acceptedAnswer": {\
340                            "@type": "Answer",\
341                            "text": "아닙니다. 쇼핑몰, 회사홈페이지, 개인블로그, 모바일청첩장 등 원하시는 사이트를 자유롭게 만드실 수 있습니다."\
342                          }\
343                        },\
344                        {\
345                          "@type": "Question",\
346                          "name": "결제 기능(쇼핑몰)을 사용할 수 있나요",\
347                          "acceptedAnswer": {\
348                            "@type": "Answer",\
349                            "text": "<ul>\
350                                        <li>쇼핑 요금제를 적용하여 쇼핑몰을 만들 수 있습니다.</li>\
351                                        <li> </li>\
352                                        <li>PG가입을 통해 신용카드나 계좌이체 등의 결제시스템을 연동할 수 있으며, 상품관리나 주문배송관리 등의 쇼핑 관련 기능이 제공됩니다.</li>\
353                                        <li>기존에 크리에이터링크에서 만든 홈페이지가 있는 경우에도 새로 쇼핑몰을 만들 필요 없이 쇼핑 요금제만 적용하면 쇼핑몰로 전환할 수 있습니다.</li>\
354                                        <li><a href=\\"https://www.creatorlink.net/shoppingevent\\">쇼핑 요금제 자세히 보기</a></li>\
355                                    </ul>"\
356                          }\
357                        },\
358                        {\
359                          "@type": "Question",\
360                          "name": "코딩을 몰라도 홈페이지를 만들 수 있나요?",\
361                          "acceptedAnswer": {\
362                            "@type": "Answer",\
363                            "text": "네. 코딩을 전혀 몰라도 쉽게 만들 수 있는 모듈형 제작방식을 제공하고 있습니다."\
364                          }\
365                        },\
366                        {\
367                          "@type": "Question",\
368                          "name": "홈페이지는 몇 개까지 만들 수 있나요?",\
369                          "acceptedAnswer": {\
370                            "@type": "Answer",\
371                            "text": "계정 당 10개의 홈페이지를 만들 수 있습니다."\
372                          }\
373                        },\
374                        {\
375                          "@type": "Question",\
376                          "name": "네이버나 다음에 노출시킬 수 있나요?",\
377                          "acceptedAnswer": {\
378                            "@type": "Answer",\
379                            "text": "네. 사이트를 만드신 후 각 포털에 검색등록을 하실 수 있습니다."\
380                          }\
381                        }\
382                      ]\
383                    }\
384                ';
385                    break;
386                }
387            case 'carousel':
388                {
389                    jsonscript +=
390                    '\
391                    {\
392                      "@context":"http://schema.org",\
393                      "@type":"ItemList",\
394                      "itemListElement":[\
395                        {\
396                          "@type": "ListItem",\
397                          "name": "Dajeong",\
398                          "image": "https://storage.googleapis.com/cr-resource/image/b79b620cbfea30807340cf90ed5e5bbe/rousefleur/rousefleur-bestsite.jpg",\
399                          "url": "https://rousefleur.creatorlink.net",\
400                          "position": "1"\
401                        },\
402                        {\
403                          "@type": "ListItem",\
404                          "name": "궁리",\
405                          "image": "https://storage.googleapis.com/cr-resource/image/91cd3ae4e7326ec246d8ce207325311e/guungri/guungri-bestsite.jpg",\
406                          "url": "https://guungri.creatorlink.net",\
407                          "position": "2"\
408                        },\
409                        {\
410                          "@type": "ListItem",\
411                          "name": "운타",\
412                          "image": "https://storage.googleapis.com/cr-resource/image/0a1afa78e08359fea268dc23cf25feba/unta/unta-bestsite.jpg",\
413                          "url": "https://unta.creatorlink.net",\
414                          "position": "3"\
415                        },\
416                        {\
417                          "@type": "ListItem",\
418                          "name": "HC DESIGN",\
419                          "image": "https://storage.googleapis.com/cr-resource/image/8a3065df6f50178993b1d7d5ab5bb345/metafranchise/metafranchise-bestsite.jpg",\
420                          "url": "https://metafranchise.creatorlink.net",\
421                          "position": "4"\
422                        },\
423                        {\
424                          "@type": "ListItem",\
425                          "name": "에이캠스튜디오",\
426                          "image": "https://storage.googleapis.com/cr-resource/image/17fbe9f7a0ddd0efddf0f34aeca01744/acamstudio/acamstudio-bestsite.jpg",\
427                          "url": "https://acamstudio.creatorlink.net",\
428                          "position": "5"\
429                        },\
430                        {\
431                          "@type": "ListItem",\
432                          "name": "미카엘",\
433                          "image": "https://storage.googleapis.com/cr-resource/image/5fa6beb099367406036b7744fdf0d518/lawyerljw/lawyerljw-bestsite.jpg",\
434                          "url": "https://lawyerljw.creatorlink.net",\
435                          "position": "6"\
436                        },\
437                        {\
438                          "@type": "ListItem",\
439                          "name": "포씨드",\
440                          "image": "//storage.googleapis.com/cr-resource/image/774baa5c985fc6eb5824f15d60130756/forseed/forseed-bestsite.jpg",\
441                          "url": "https://forseed.creatorlink.net",\
442                          "position": "7"\
443                        },\
444                        {\
445                          "@type": "ListItem",\
446                          "name": "snoworks",\
447                          "image": "https://storage.googleapis.com/cr-resource/image/8bb728caf2a19b5f6263478d7eaaee24/w
447haledesign/whaledesign-bestsite.jpg",\
448                          "url": "https://whaledesign.creatorlink.net",\
449                          "position": "8"\
450                        },\
451                        {\
452                          "@type": "ListItem",\
453                          "name": "NARKO",\
454                          "image": "https://storage.googleapis.com/cr-resource/image/a206b43e3689c50cb9affa3a7f76df8a/narko/narko-bestsite.jpg",\
455                          "url": "https://narko.creatorlink.net",\
456                          "position": "9"\
457                        } \
458                      ]\
459                    }\
460                ';
461                    break;
462                }
463            case 'review':
464                {
465                    jsonscript +=
466                    '\
467                    {\
468                      "@context": "https://schema.org",\
469                      "@type": "Product",\
470                      "aggregateRating": {\
471                        "@type": "AggregateRating",\
472                        "ratingValue": "5",\
473                        "reviewCount": "70"\
474                      },\
475                      "name" : "Responsive Homepage",\
476                      "review": [\
477                        {\
478                          "@type": "Review",\
479                          "author": "soh******",\
480                          "name": "써본것 중 제일 쉽고 편했어요",\
481                          "reviewBody": "간단하게 사이트를 만들 수 있어 좋아요 :) 직접 코딩을 해서 제작해 본 적도 있고, 카***** 같은 유사 플랫폼을 이용한 적도 있는데 제가 시도해 본 것 중엔 사용방식이나 설정 방법이 제일 쉽고 편했어요. 웹사이트 제작 필요하신 분들께 추천드려봅니다.",\
482                          "reviewRating": {\
483                            "@type": "Rating",\
484                            "bestRating": "5",\
485                            "ratingValue": "5"\
486                          }\
487                        },\
488                        {\
489                          "@type": "Review",\
490                          "author": "지**",\
491                          "name": "디자인도 퀄리티가 너무 높아서.... 놀랐습니다.",\
492                          "reviewBody": "홈페이지 제작 어렵게 생각했는데 이렇게 멋진 홈페이지가 간단하게 뚝딱 제작된다니...너무 놀랍네요...홈페이지가 필요하시거나 포폴필요하신분은 크리에이터링크로 작업하시면 너무 좋을듯합니다. 디자인도 퀄리티가 너무 높아서.... 놀랐습니다.",\
493                          "reviewRating": {\
494                            "@type": "Rating",\
495                            "bestRating": "5",\
496                            "ratingValue": "5"\
497                          }\
498                        },\
499                        {\
500                          "@type": "Review",\
501                          "author": "fa***",\
502                          "name": "창업 사이트도 크리에이터 링크를 이용하고 있답니다.",\
503                          "reviewBody": "크리에이터 링크 사이트를 이용해서 사이트를 만들어 사용한지 벌써 일년이 넘었네요! 너무나 편리하고 필수적인 기능들이 잘 들어가 있어서, 초보자들도 바로 만들 수 있게끔 되어있어요. 저도 처음엔 개인 포트폴리오 사이트를 만드려고 크리에이터 링크를 이용하다가 너무 좋아서 지금은 창업 사이트도 크리에이터 링크를 이용하고 있답니다.",\
504                          "reviewRating": {\
505                            "@type": "Rating",\
506                            "bestRating": "5",\
507                            "ratingValue": "5"\
508                          }\
509                        },\
510                        {\
511                          "@type": "Review",\
512                          "author": "이**",\
513                          "name": "\\"쉽고 빠르게 홈페이지 제작은..크리에이터 링크가 답입니다.",\
514                          "reviewBody": "\\"우리나라에서 제공하는 무료 홈페이지 중에서 \\"\\"아, 이게 제일 나다운 홈페이지다.\\"\\" 하고 느꼈네요. 내가 원하는 대로 만들려면 어려운 코딩 공부를 해야 되죠ㅠㅠ 하지만 크리에이터 링크는 척척! 잘 만들어주니까 너무 좋아요! 여러분.. 쉽고 빠르게 홈페이지 제작은..크리에이터 링크가 답입니다.\\"",\
515                          "reviewRating": {\
516                            "@type": "Rating",\
517                            "bestRating": "5",\
518                            "ratingValue": "5"\
519                          }\
520                        },\
521                        {\
522                          "@type": "Review",\
523                          "author": "윤**",\
524                          "name": "윅*에서 크리에이터링크로 갈아탔네요~",\
525                          "reviewBody": "원래는 포트폴리오 사이트를 외국사이트 윅*로 만들어보려고 계획했었는데 우연히 크리에이터링크 사이트 발견하고 거기 작업하던거 포기하고 바로 갈아탔네요~ 쉽ê²
525Œ 블럭으로 추가되는 것도 편리하고 편집하는 것도 직관적이고 무엇보다도 한글 서체가 다양해서 만족입니다~ " ,\
526                          "reviewRating" : {\
527                            "@type": "Rating",\
528                            "bestRating": "5",\
529                            "ratingValue": "5"\
530                          }\
531                        }\
532                      ]\
533                    }\
534                ';
535                    break;
536                }
537
538            default:
539                {
540                    break;
541                }
542        }
543        $('body').prepend('<script type="application/ld+json">' + jsonscript + '</script>');
544    }
545
546    function arrayUnique(array) {
547        var a = array.concat();
548        for (var i = 0; i < a.length; ++i) {
549            for (var j = i + 1; j < a.length; ++j) {
550                if (a[i] === a[j])
551                    a.splice(j--, 1);
552            }
553        }
554        return a;
555    }
556
557    function arrayRemove(arr, value) {
558        return arr.filter(function(ele) {
559            return ele != value;
560        });
561    }
562
563    function win_open(url, name, option) {
564        var popup = window.open(rt_path + '/' + url, name, option);
565        popup.focus();
566    }
567
568    // 쪽지 창
569    function win_memo(url) {
570        if (!url)
571            url = "member/memo/lists";
572        win_open(url, "winMemo", "left=50,top=50,width=620,height=460,scrollbars=1");
573    }
574
575    // 자기소개 창
576    function win_profile(mb_id) {
577        win_open("member/profile/qry/" + mb_id, 'winProfile', 'left=50,top=50,width=400,height=500,scrollbars=1');
578    }
579
580    // 우편번호 창
581    function win_zip(frm_name, frm_zip1, frm_zip2, frm_addr1, frm_addr2) {
582        url = "useful/zip/qry/" + frm_name + "/" + frm_zip1 + "/" + frm_zip2 + "/" + frm_addr1 + "/" + frm_addr2;
583        win_open(url, "winZip", "left=50,top=50,width=616,height=460,scrollbars=1");
584    }
585
586    // POST 전송, 결과값 리턴
587    function post_s(href, parm, del) {
588        /*if (!del || confirm(  $.lang[LANG]['page.board.cts.msg.delete'] )) {
589            $.post(rt_path + '/' + href, parm, function (req) {
590                document.write(req);
591            });
592        }*/
593        var confirm = false;
594        var modal = $(this).showModalFlat('', $.lang[LANG]['page.board.cts.msg.delete'], true, true, function() {
595            confirm = true;
596            if (!del || confirm) {
597                $.post(rt_path + '/' + href, parm, function(req) {
598                    document.write(req);
599                });
600            }
601        }, 'cancel', 'ok', 'cl-cmmodal cl-s-btn w560 cl-p130 cl-t80 cl-modal cl-none-title cl-close-btn', '', '', function() {
602            $(document).on('keydown', function(e) {
603                if (e.keyCode == 27) modal.modal('hide');
604            });
605        });
606    }
607
608    // POST 이동
609    function post_goto(url, parm, target) {
610        var f = document.createElement('form');
611
612        var objs, value;
613        for (var key in parm) {
614            value = parm[key];
615            objs = document.createElement('input');
616            objs.setAttribute('type', 'hidden');
617            objs.setAttribute('name', key);
618            objs.setAttribute('value', value);
619            f.appendChild(objs);
620        }
621
622        if (target)
623            f.setAttribute('target', target);
624
625        f.setAttribute('method', 'post');
626        f.setAttribute('action', rt_path + '/' + url);
627        document.body.appendChild(f);
628        f.submit();
629    }
630
631    // POST ì°½
632    function post_win(name, url, parm, opt) {
633        var temp_win = window.open('', name, opt);
634        post_goto(url, parm, name);
635    }
636
637    // 일반 삭제 검사 확인
638    function del(href) {
639        if (confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n정말 삭제하시겠습니까?"))
640            document.location.href = rt_path + '/' + href;
641    }
642
643    // 플래시에 변수 추가 fh
644    function flash_movie(src, ids, width, height, wmode, fh) {
645        var wh = "";
646        if (parseInt(width) && parseInt(height))
647            wh = " width='" + width + "' height='" + height + "' ";
648        return "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/s
648hockwave/cabs/flash/swflash.cab#version=6,0,0,0' " + wh + " id=" + ids + "><param name=wmode value=" + wmode + "><param name=movie value=" + src + "><param name=quality value=high><param name=flashvars value=" + fh + "><embed src=" + src + " quality=high wmode=" + wmode + " flashvars=" + fh + " type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash' " + wh + "></embed></object>";
649    }
650
651    // 동영상 파일
652    function obj_movie(src, ids, width, height, autostart) {
653        var wh = "";
654        if (parseInt(width) && parseInt(height))
655            wh = " width='" + width + "' height='" + height + "' ";
656        if (!autostart) autostart = false;
657        return "<embed src='" + src + "' " + wh + " autostart='" + autostart + "'></embed>";
658    }
659
660    // 아이프레임 높이 자동조절
661    function reSize(obj) {
662        try {
663            var objBody = frames[obj].document.body;
664            var objFrame = document.getElementById(obj);
665            ifrmHeight = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight);
666            objFrame.style.height = ifrmHeight;
667        } catch (e) {}
668    }
669
670    function sEncode(val) {
671        return encodeURIComponent(val).replace(/%/g, '.');
672    }
673
674    // script 에서 js 파일 로드
675    function importScript(FILES) {
676        var _importScript = function(filename) {
677            if (filename) {
678                document.write('<script type="text/javascript" src="' + rt_path + '/js/' + filename + '.js"></s' + 'cript>');
679            }
680        };
681
682        for (var i = 0; i < FILES.length; i++) {
683            _importScript(FILES[i]);
684        }
685    }
686
687    // jQuery textarea
688    function txresize(tx, type, size) {
689        var tx = $('#' + tx);
690        if (type == 1)
691            tx.animate({ 'height': '-=' + size + 'px' }, 'fast');
692        else if (type == 2)
693            tx.animate({ 'height': size }, 'fast');
694        else if (type == 3)
695            tx.animate({ 'height': '+=' + size + 'px' }, 'fast');
696    }
697
698    // 팝업 닫기
699    function popup_close(id, onday) {
700        if (onday) {
701            var today = new Date();
702            today.setTime(today.getTime() + (60 * 60 * 1000 * 24));
703            document.cookie = id + "=" + escape(true) + "; path=/; expires=" + today.toGMTString() + ";";
704        }
705
706        if (window.parent.name.indexOf(id) != -1)
707            window.close();
708        else
709            document.getElementById(id).style.display = 'none';
710    }
711
712    function checkcode(e) {
713        var code = (window.event) ? event.keyCode : e.which; //IE : FF - Chrome both
714        if (code > 31 && code < 45) nAllow(e);
715        if (code > 45 && code < 48) nAllow(e);
716        if (code > 57 && code < 65) nAllow(e);
717        if (code > 90 && code < 97) nAllow(e);
718        if (code > 122 && code < 127) nAllow(e);
719    }
720
721    function nAllow(e) {
722        alert('특수문자 - 만 사용할수있습니다');
723        if (navigator.appName != "Netscape") {
724            //for not returning keycode value
725            event.returnValue = false; //IE ,  - Chrome both
726        } else {
727            e.preventDefault(); //FF ,  - Chrome both
728        }
729    }
730
731    function copyToClipboard(text) {
732        if (window.clipboardData && window.clipboardData.setData) {
733            // IE specific code path to prevent textarea being shown while dialog is visible.
734            return clipboardData.setData("Text", text);
735
736        } else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
737            var textarea = document.createElement("textarea");
738            textarea.textContent = text;
739            textarea.style.position = "fixed"; // Prevent scrolling to bottom of page in MS Edge.
740            document.body.appendChild(textarea);
741            textarea.select();
742            try {
743                return document.execCommand("copy"); // Security exception may be thrown by some browsers.
744            } catch (ex) {
745                console.warn("Copy to clipboard failed.", ex);
746                return false;
747            } finally {
748                document.body.removeChild(textarea);
749            }
750        }
751    }
752
753    function copyTextToClipboard(text) {
754        var copyFrom = $('<textarea class="hide"/>');
755        copyFrom.text(text);
756        $('body').append(copyFrom);
757        copyFrom.select();
758        document.execCommand('copy');
759        copyFrom.remove();
760    }
761
762    function trim(str) {
763        str = str.replace(/^\s*/, '').replace(/\s*$/, '');
764        return str; //변환한 스트링을 리턴.
765    }
766
767    jQuery.fn.center = function() {
768        this.css("position", "absolute");
769        this.css("top", Math.max(0, (($(window).height() - $(this).outerHeight()) / 2) + $(window).scrollTop()) + "px");
770        this.css("left", Math.max(0, (($(window).width() - $(this).outerWidth()) / 2) + $(window).scrollLeft()) + "px");
771        return this;
772    }
773
774    function setCookie(cookieName, cookieValue, expireDate) {
775        var today = new Date();
776        today.setDate(today.getDate() + parseInt(expireDate));
777        document.cookie = cookieName + "=" + escape(cookieValue) + "; path=/; expires=" + today.toGMTString() + ";";
778    }
779
780    function getCookie(cookieName) {
781        var search = cookieName + "=";
782        var cookie = document.cookie;
783
784        // 현재 쿠키가 존재할 경우
785        if (cookie.length > 0) {
786            // 해당 쿠키명이 존재하는지 검색한 후 존재하면 위치를 리턴.
787            startIndex = cookie.indexOf(cookieName);
788
789            // 만약 존재한다면
790            if (startIndex != -1) {
791                // 값을 얻어내기 위해 시작 인덱스 조절
792                startIndex += cookieName.length;
793
794                // 값을 얻어내기 위해 종료 인덱스 추출
795                endIndex = cookie.indexOf(";", startIndex);
796
797                // 만약 종료 인덱스를 못찾게 되면 쿠키 전체길이로 설정
798                if (endIndex == -1) endIndex = cookie.length;
799
800                // 쿠키값을 추출하여 리턴
801                return unescape(cookie.substring(startIndex + 1, endIndex));
802            } else {
803                // 쿠키 내에 해당 쿠키가 존재하지 않을 경우
804                return false;
805            }
806        } else {
807            // 쿠키 자체가 없을 경우
808            return false;
809        }
810    }
811
812    function deleteCookie(cookieName) {
813        var expireDate = new Date();
814
815        //어제 날짜를 쿠키 소멸 날짜로 설정한다.
816        expireDate.setDate(expireDate.getDate() - 1);
817        document.cookie = cookieName + "= " + "; expires=" + expireDate.toGMTString() + "; path=/";
818    }
819
820    function getRandom() {
821        var result = Math.floor(Math.random() * 10) + 1;
822        return result;
823    }
824
825    function strpos(haystack, needle, offset) {
826        // From: http://phpjs.org/functions
827        // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
828        // +   improved by: Onno Marsman
829        // +   bugfixed by: Daniel Esteban
830        // +   improved by: Brett Zamir (http://brett-zamir.me)
831        // *     example 1: strpos('Kevin van Zonneveld', 'e', 5);
832        // *     returns 1: 14
833        var i = (haystack + '').indexOf(needle, (offset || 0));
834        return i === -1 ? false : i;
835    }
836
837    function htmlEntities(str) {
838        return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
839    }
840
841    function removeEmptyLines(html) {
842        return html
843            .split('\n')                    
844            .map(line => line.trim())       
845            .filter(line => line !== '')    
846            .join('\n');                    
847    }
848    
849
850    function htmlspecialchars_decode(string, quote_style) {
851        if(typeof string == 'undefined' || !string) return '';
852
853        var optTemp = 0;
854        var i = 0;
855        var noquotes = false;
856        if (typeof quote_style === 'undefined') {
857            quote_style = 2;
858        }
859        string = string.toString()
860            .replace(/&lt;/g, '<')
861            .replace(/&gt;/g, '>')
862            .replace(/&amp;lt;/g, '<')
863            .replace(/&amp;gt;/g, '>');
864
865        var OPTS = {
866            'ENT_NOQUOTES': 0,
867            'ENT_HTML_QUOTE_SINGLE': 1,
868            'ENT_HTML_QUOTE_DOUBLE': 2,
869            'ENT_COMPAT': 2,
870            'ENT_QUOTES': 3,
871            'ENT_IGNORE': 4
872        };
873        if (quote_style === 0) {
874            noquotes = true;
875        }
876        if (typeof quote_style !== 'number') { // Allow for a single string or an array of string flags
877            quote_style = [].concat(quote_style);
878            for (i = 0; i < quote_style.length; i++) {
879                // Resolve string input to bitwise e.g. 'PATHINFO_EXTENSION' becomes 4
880                if (OPTS[quote_style[i]] === 0) {
881                    noquotes = true;
882                } else if (OPTS[quote_style[i]]) {
883                    optTemp = optTemp | OPTS[quote_style[i]];
884                }
885            }
886            quote_style = optTemp;
887        }
888        if (quote_style & OPTS.ENT_HTML_QUOTE_SINGLE) {
889            string = string.replace(/&#0*39;/g, "'"); // PHP doesn't currently escape if more than one 0, but it should
890            // string = string.replace(/&apos;|&#x0*27;/g, "'"); // This would also be useful here, but not a part of PHP
891        }
892        if (!noquotes) {
893            string = string.replace(/&quot;/g, '"');
894        }
895        // Put this in last place to avoid escape being double-decoded
896        string = string.replace(/&amp;/g, '&');
897
898        return string;
899    }
900
901    function explode(delimiter, string, limit) {
902        //  discuss at: http://phpjs.org/functions/explode/
903        // original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
904        //   example 1: explode(' ', 'Kevin van Zonneveld');
905        //   returns 1: {0: 'Kevin', 1: 'van', 2: 'Zonneveld'}
906
907        if (arguments.length < 2 || typeof delimiter === 'undefined' || typeof string === 'undefined') return null;
908        if (delimiter === '' || delimiter === false || delimiter === null) return false;
909        if (typeof delimiter === 'function' || typeof delimiter === 'object' || typeof string === 'function' || typeof string ===
910            'object') {
911            return {
912                0: ''
913            };
914        }
915        if (delimiter === true) delimiter = '1';
916
917        // Here we go...
918        delimiter += '';
919        string += '';
920
921        var s = string.split(delimiter);
922
923        if (typeof limit === 'undefined') return s;
924
925        // Support for limit
926        if (limit === 0) limit = 1;
927
928        // Positive limit
929        if (limit > 0) {
930            if (limit >= s.length) return s;
931            return s.slice(0, limit - 1)
932                .concat([s.slice(limit - 1)
933                    .join(delimiter)
934                ]);
935        }
936
937        // Negative limit
938        if (-limit >= s.length) return [];
939
940        s.splice(s.length + limit);
941        return s;
942    }
943
944    function microtime(get_as_float) {
945        var now = new Date()
946            .getTime() / 1000;
947        var s = parseInt(now, 10);
948
949        return (get_as_float) ? now * 1000 : (Math.round((now - s) * 1000) / 1000) + ' ' + s;
950    }
951
952    function log(r) {
953        console.log(r);
954    }
955
956    function pathinfo(path, options) {
957        //        note: which makes it fully compliant with PHP syntax.
958        //  depends on: basename
959        //   example 1: pathinfo('/www/htdocs/index.html', 1);
960        //   returns 1: '/www/htdocs'
961        //   example 2: pathinfo('/www/htdocs/index.html', 'PATHINFO_BASENAME');
962        //   returns 2: 'index.html'
963        //   example 3: pathinfo('/www/htdocs/index.html', 'PATHINFO_EXTENSION');
964        //   returns 3: 'html'
965        //   example 4: pathinfo('/www/htdocs/index.html', 'PATHINFO_FILENAME');
966        //   returns 4: 'index'
967        //   example 5: pathinfo('/www/htdocs/index.html', 2 | 4);
968        //   returns 5: {basename: 'index.html', extension: 'html'}
969        //   example 6: pathinfo('/www/htdocs/index.html', 'PATHINFO_ALL');
970        //   returns 6: {dirname: '/www/htdocs', basename: 'index.html', extension: 'html', filename: 'index'}
971        //   example 7: pathinfo('/www/htdocs/index.html');
972        //   returns 7: {dirname: '/www/htdocs', basename: 'index.html', extension: 'html', filename: 'index'}
973        var opt = '',
974            optName = '',
975            optTemp = 0,
976            tmp_arr = {},
977            cnt = 0,
978            i = 0;
979        var have_basename = false,
980            have_extension = false,
981            have_filename = false;
982
983        // Input defaulting & sanitation
984        if (!path) {
985            return false;
986        }
987        if (!options) {
988            options = 'PATHINFO_ALL';
989        }
990
991        // Initialize binary arguments. Both the string & integer (constant) input is
992        // allowed
993        var OPTS = {
994            'PATHINFO_DIRNAME': 1,
995            'PATHINFO_BASENAME': 2,
996            'PATHINFO_EXTENSION': 4,
997            'PATHINFO_FILENAME': 8,
998            'PATHINFO_ALL': 0
999        };
1000
1001        // PATHINFO_ALL sums up all previously defined PATHINFOs (could just pre-calculate)
1002        for (optName in OPTS) {
1003            OPTS.PATHINFO_ALL = OPTS.PATHINFO_ALL | OPTS[optName];
1004        }
1005        if (typeof options !== 'number') { // Allow for a single string or an array of string flags
1006            options = [].concat(options);
1007            for (i = 0; i < options.length; i++) {
1008                // Resolve string input to bitwise e.g. 'PATHINFO_EXTENSION' becomes 4
1009                if (OPTS[options[i]]) {
1010                    optTemp = optTemp | OPTS[options[i]];
1011                }
1012            }
1013            options = optTemp;
1014        }
1015
1016        // Internal Functions
1017        var __getExt = function(path) {
1018            var str = path + '';
1019            var dotP = str.lastIndexOf('.') + 1;
1020            return !dotP ? false : dotP !== str.length ? str.substr(dotP) : '';
1021        };
1022
1023        function basename(path, suffix) {
1024            //  discuss at: http://phpjs.org/functions/basename/
1025            // original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
1026            // improved by: Ash Searle (http://hexmen.com/blog/)
1027            // improved by: Lincoln Ramsay
1028            // improved by: djmix
1029            // improved by: Dmitry Gorelenkov
1030            //   example 1: basename('/www/site/home.htm', '.htm');
1031            //   returns 1: 'home'
1032            //   example 2: basename('ecra.php?p=1');
1033            //   returns 2: 'ecra.php?p=1'
1034            //   example 3: basename('/some/path/');
1035            //   returns 3: 'path'
1036            //   example 4: basename('/some/path_ext.ext/','.ext');
1037            //   returns 4: 'path_ext'
1038
1039            var b = path;
1040            var lastChar = b.charAt(b.length - 1);
1041
1042            if (lastChar === '/' || lastChar === '\\') {
1043                b = b.slice(0, -1);
1044            }
1045
1046            b = b.replace(/^.*[\/\\]/g, '');
1047
1048            if (typeof suffix === 'string' && b.substr(b.length - suffix.length) == suffix) {
1049                b = b.substr(0, b.length - suffix.length);
1050            }
1051            return b;
1052        }
1053
1054        // Gather path infos
1055        if (options & OPTS.PATHINFO_DIRNAME) {
1056            var dirName = path.replace(/\\/g, '/')
1057                .replace(/\/[^\/]*\/?$/, ''); // dirname
1058            tmp_arr.dirname = dirName === path ? '.' : dirName;
1059        }
1060
1061        if (options & OPTS.PATHINFO_BASENAME) {
1062            if (false === have_basename) {
1063                have_basename = basename(path);
1064            }
1065            tmp_arr.basename = have_basename;
1066        }
1067
1068        if (options & OPTS.PATHINFO_EXTENSION) {
1069            if (false === have_basename) {
1070                have_basename = basename(path);
1071            }
1072            if (false === have_extension) {
1073                have_extension = __getExt(have_basename);
1074            }
1075            if (false !== have_extension) {
1076                tmp_arr.extension = have_extension;
1077            }
1078        }
1079
1080        if (options & OPTS.PATHINFO_FILENAME) {
1081            if (false === have_basename) {
1082                have_basename = basename(path);
1083            }
1084            if (false === have_extension) {
1085                have_extension = __getExt(have_basename);
1086            }
1087            if (false === have_filename) {
1088                have_filename = have_basename.slice(0, have_basename.length - (have_extension ? have_extension.length + 1 :
1089                    have_extension === false ? 0 : 1));
1090            }
1091            tmp_arr.filename = have_filename;
1092        }
1093
1094        // If array contains only 1 element: return string
1095        cnt = 0;
1096        for (opt in tmp_arr) {
1097            cnt++;
1098        }
1099        if (cnt == 1) {
1100            return tmp_arr[opt];
1101        }
1102
1103        // Return full-blown array
1104        return tmp_arr;
1105    }
1106
1107    function isIE() {
1108        userAgent = window.navigator.userAgent;
1109        return userAgent.indexOf("MSIE ") > -1 || userAgent.indexOf("Trident/") > -1 || userAgent.indexOf("Edge/") > -1;
1110    }
1111
1112    function isMobile() {
1113        return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) ? true : false;
1114    }
1115
1116    $(document).on('click', '#goto-top-m', function(e) {
1117        e.preventDefault();
1118        $('body,html').animate({ scrollTop: 0 }, 400);
1119    });
1120
1121    $(window).on('scroll', function() {
1122        if ($(this).scrollTop() > 50) {
1123            $('.site-cts-banner, .cl-cts-banner, #ch-plugin').addClass('up');
1124            $('#goto-top-m, #goto-top-s').addClass('show');
1125        } else {
1126            $('.site-cts-banner, .cl-cts-banner, #ch-plugin').removeClass('up');
1127            $('#goto-top-m, #goto-top-s').removeClass('show');
1128        }
1129    });
1130
1131    $(document).on('click', '.tpl-share-snsPost', function(e) {
1132        var sns = $(this).attr('data-sns'),
1133            sid = (typeof SID == 'undefined') ? property.SID : SID,
1134            host = (typeof HOST == 'undefined') ? property.HOST : HOST,
1135            view = (typeof VIEW == 'undefined') ? property.VIEW : VIEW,
1136            page = (property.PAGE).split(','),
1137            hostname = (host.indexOf('addblock') > -1) ? window.location.host : window.location.hostname,
1138            url = window.location.protocol + '//' + hostname + '/' + page[0] + '/view/' + view,
1139            txt = (page[0] == 'forum') ? $('.tpl-forum-title').text() : $('[data-project-title]').text(),
1140            pageLang = sid.split('__');
1141        if (pageLang.length > 1) url = window.location.protocol + '//' + hostname + '/_lang/' + pageLang[1] + '/' + page[0] + '/view/' + view;
1142        sendSns(sns, url, txt);
1143    });
1144
1145    function sendSns(sns, url, txt) {
1146        var img = $('meta[property="og:image"]').attr('content'),
1147            description = ($('meta[property="og:description"]').length > 0) ? $('meta[property="og:description"]').attr('content') : $('meta[name="description"]').attr('content');
1148
1149        var o,
1150            _url = (typeof url == "undefined") ? encodeURIComponent("http://creatorlink.net") : encodeURIComponent(url),
1151            _txt = (typeof txt === "string" && txt.trim()) ? encodeURIComponent(txt) : encodeURIComponent("Make your portfolio site as easily as stacking blocks"),
1152            _br = encodeURIComponent('\r\n'),
1153            _img = (typeof img == "undefined") ? 'https://storage.googleapis.com/i.addblock.net/config/aboutVideoImg00.png' : img,
1154            _kakaolinkurl = (typeof url == "undefined") ? "http://creatorlink.net" : url;
1155
1156        switch (sns) {
1157            case 'facebook':
1158                o = {
1159                    method: 'popup',
1160                    url: 'https://www.facebook.com/sharer/sharer.php?u=' + _url + '&t=' + _txt
1161                };
1162                break;
1163            case 'twitter':
1164                o = {
1165                    method: 'popup',
1166                    url: 'http://twitter.com/intent/tweet?text=' + _txt + '&url=' + _url + '&source=' + _url
1167                };
1168                break;
1169            case 'google':
1170                o = {
1171                    method: 'popup',
1172                    url: 'https://plus.google.com/share?url=' + _url
1173                };
1174                break;
1175            case 'pinterest':
1176                o = {
1177                    method: 'popup',
1178                    url: 'http://pinterest.com/pin/create/button/?url=' + _url + '&media=' + _img + '&description=' + _txt
1179                };
1180                break;
1181            case "tumblr":
1182                o = {
1183                    method: 'popup',
1184                    url: 'http://www.tumblr.com/share?v=3&u=' + _url + '&t=creatorlink&s='
1185                };
1186                break;
1187            case "naverblog":
1188                o = {
1189                    method: 'popup',
1190                    url: 'http://share.naver.com/web/shareView.nhn?url=' + _url + '&title=' + _txt
1191                };
1192                break;
1193            case "kakaotalk":
1194                if (typeof property.SETTINGS.kakaolink != 'undefined') {
1195                    var kakaolink_key = property.SETTINGS.kakaolink_key;
1196                    console.log('txt: '+txt);
1197                    console.log('description: '+description);
1198                    kakaotalkShare(txt, description, _img, kakaolink_key, _kakaolinkurl);
1199                } else alert('카카오 API키 오류');
1200                o = {
1201                    method: ''
1202                };
1203                break;
1204            case "urlcopy":
1205                copyToUrlClipboard(url);
1206                o = {
1207                    method: ''
1208                };
1209                break;
1210            default:
1211                o = {
1212                    method: ''
1213                };
1214                break;
1215        }
1216        switch (o.method) {
1217            case "popup":
1218                var left = (screen.width / 2) - (575 / 2);
1219                var top = (screen.height / 2) - (575 / 2);
1220                window.open(o.url, 'Share', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=575, height=575, top=' + top + ', left=' + left);
1221                break;
1222            default:
1223                break;
1224        }
1225    }
1226
1227    function kakaotalkShare(title, content, img, kakaolink_key, url) {
1228        Kakao.cleanup();
1229        Kakao.init(kakaolink_key);
1230        if(Kakao.isInitialized()) {
1231            Kakao.Share.sendDefault({
1232                objectType: 'feed',
1233                content: {
1234                    title: title,
1235                    description: content,
1236                    imageUrl: img,
1237                    link: {
1238                        mobileWebUrl: url,
1239                        webUrl: url
1240                    }
1241                },
1242                buttons: [{
1243                    title: '웹으로 보기',
1244                    link: {
1245                        mobileWebUrl: url,
1246                        webUrl: url
1247                    }
1248                }]
1249            });
1250        }
1251    }
1252
1253    function copyToUrlClipboard(url) {
1254        if (window.clipboardData && window.clipboardData.setData) {
1255            // IE specific code path to prevent textarea being shown while dialog is visible.
1256            return clipboardData.setData("Text", url);
1257
1258        } else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
1259            var textarea = document.createElement("textarea");
1260            textarea.textContent = url;
1261            textarea.style.position = "fixed"; // Prevent scrolling to bottom of page in MS Edge.
1262            document.body.appendChild(textarea);
1263            textarea.select();
1264            try {
1265                return document.execCommand("copy"); // Security exception may be thrown by some browsers.
1266            } catch (ex) {
1267                console.warn("Copy to clipboard failed.", ex);
1268                return false;
1269            } finally {
1270                document.body.removeChild(textarea);
1271                alert($.lang[LANG]['config.sns.urlcopy.alert']);
1272            }
1273        }
1274    }
1275
1276    function stripslashes(str) {
1277        return (str + '')
1278            .replace(/\\(.?)/g, function(s, n1) {
1279                switch (n1) {
1280                    case '\\':
1281                        return '\\';
1282                    case '0':
1283                        return '\u0000';
1284                    case '':
1285                        return '';
1286                    default:
1287                        return n1;
1288                }
1289            });
1290    }
1291
1292    function isNumber(s) {
1293        s += '';
1294        s = s.replace(/^\s*|\s*$/g, '');
1295        if (s == '' || isNaN(s)) return false;
1296        return true;
1297    }
1298
1299    function saveSelection() {
1300        if (window.getSelection) {
1301            sel = window.getSelection();
1302            if (sel.getRangeAt && sel.rangeCount) {
1303                return sel.getRangeAt(0);
1304            }
1305        } else if (document.selection && document.selection.createRange) {
1306            return document.selection.createRange();
1307        }
1308        return null;
1309    }
1310
1311    function restoreSelection(range) {
1312        if (range) {
1313            if (window.getSelection) {
1314                sel = window.getSelection();
1315                sel.removeAllRanges();
1316                sel.addRange(range);
1317            } else if (document.selection && range.select) {
1318                range.select();
1319            }
1320        }
1321    }
1322
1323    function getBytes(string) {
1324        if(string == '') return 0;
1325        var cnt = 0,
1326            ch = "";
1327        for (var i = 0; i < string.length; i++) {
1328            ch = string.charAt(i);
1329            if (escape(ch).length > 4) {
1330                cnt += 2;
1331            } else {
1332                cnt += 1;
1333            }
1334        }
1335        return cnt;
1336    }
1337
1338    function getWidthPercent(el) {
1339        var width = parseFloat($(el).css('width')) / parseFloat($(el).parent().css('width'));
1340        return Math.round(100 * width) + '%';
1341    }
1342
1343    // smartresize
1344    (function($, sr) {
1345
1346        // debouncing function from John Hann
1347        // http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
1348        var debounce = function(func, threshold, execAsap) {
1349                var timeout;
1350
1351                return function debounced() {
1352                    var obj = this,
1353                        args = arguments;
1354
1355                    function delayed() {
1356                        if (!execAsap)
1357                            func.apply(obj, args);
1358                        timeout = null;
1359                    };
1360
1361                    if (timeout)
1362                        clearTimeout(timeout);
1363                    else if (execAsap)
1364                        func.apply(obj, args);
1365
1366                    timeout = setTimeout(delayed, threshold || 100);
1367                };
1368            }
1369            // smartresize 
1370        jQuery.fn[sr] = function(fn) { return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); };
1371
1372    })(jQuery, 'smartresize');
1373
1374    function emailcheck(email) {
1375        // var regExp = /[0-9a-zA-Z][_0-9a-zA-Z-]*@[_0-9a-zA-Z-]+(\.[_0-9a-zA-Z-]+){1,2}$/;
1376        var regExp = /^[a-zA-Z0-9+-\_.]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/;
1377        if (email.lenght == 0) return false;
1378        if (!email.match(regExp)) return false;
1379        if (email.indexOf(',') > -1) return false;
1380        return true;
1381    }
1382
1383    function shareModal() {
1384        var title = $('meta[property="og:title"]').attr('content'),
1385            description = ($('meta[property="og:description"]').length > 0) ? $('meta[property="og:description"]').attr('content') : $('meta[name="description"]').attr('content');
1386        $(this).showModalFlat($.lang[LANG]['config.sns-share-btn'], snsPost(), false, false, '', '', '', 'cl-modal cl-cmmodal cl-p70 cl-s-btn cl-close-btn cl-t80 w320 share-modal');
1387    }
1388
1389    var snsPost = function() {
1390        str = "" +
1391            "   <ul class='tpl-share-sns'>";
1392        if (property.SETTINGS.kakaolink == 'on') {
1393            str += "<li class='tpl-share-snsPost' data-sns='kakaotalk' id='kakao-link-btn'><span class='share-round'><svg viewBox=\"0 0 24 24\" width=\"20\" height=\"20\"><path d=\"M12 1.89c-6.08 0-11 3.89-11 8.7 0 3.13 2.09 5.87 5.22 7.4 -0.23 0.86-0.83 3.11-0.95 3.59 -0.15 0.6 0.22 0.59 0.46 0.43 0.19-0.13 3.01-2.05 4.23-2.88 0.66 0.1 1.34 0.15 2.04 0.15 6.08 0 11-3.89 11-8.7C23 5.79 18.08 1.89 12 1.89\"/></svg></span> <span class='tpl-share-sns-name'>" + $.lang[LANG]["config.sns.kakaotalk"] + "</span></li>";
1394        }
1395
1396        str += "<li class='tpl-share-snsPost' data-sns='facebook'><span class='share-round'><svg viewBox=\"0 0 24 24\" width=\"20\" height=\"20\"><path d=\"M15.64 4.65l2.07 0v-3.5C17.35 1.11 16.12 1 14.69 1c-2.98 0-5.03 1.82-5.03 5.17v2.88H6.29v3.91h3.38V23h4.04V12.96h3.37l0.5-3.91H13.7v-2.5C13.7 5.42 14.02 4.65 15.64 4.65z\"/></svg></span> <span class='tpl-share-sns-name'>" + $.lang[LANG]["config.sns.facebook"] + "</span></li>" +
1397            "       <li class='tpl-share-snsPost' data-sns='twitter'><span class='share-round'><svg viewBox=\"0 0 20 20\" width=\"20\" height=\"20\"><path d=\"M14.21 16.71h1.53L5.86 3.2H4.22l9.98 13.52Zm.97-15.13h2.76l-6.03 7.14L19 18.43h-5.55L9.1 12.54l-4.98 5.89H1.36l6.45-7.63L1 1.58h5.7l3.93 5.38 4.55-5.38Z\"/></svg></span> <span class='tpl-share-sns-name'>" + $.lang[LANG]["config.sns.twitter"] + "</span></li>" +
1398            "       <li class='tpl-share-snsPost' data-sns='naverblog'><span class='share-round'><svg viewBox=\"0 0 24 24\" width=\"20\" height=\"20\"><path d=\"M18.49 10.29c-0.48 0-0.87 0.39-0.87 0.87 0 0.48 0.39 0.87 0.87 0.87 0.48 0 0.87-0.39 0.87-0.87C19.36 10.68 18.97 10.29 18.49 10.29z\"/><path d=\"M13.3 10.29c-0.48 0-0.87 0.39-0.87 0.87 0 0.48 0.39 0.87 0.87 0.87 0.48 0 0.87-0.39 0.87-0.87C14.17 10.68 13.78 10.29 13.3 10.29z\"/><path d=\"M5.59 10.29c-0.48 0-0.87 0.39-0.87 0.87 0 0.48 0.39 0.87 0.87 0.87 0.48 0 0.87-0.39 0.87-0.87C6.45 10.68 6.07 10.29 5.59 10.29z\"/><path d=\"M19.53 3H4.47C2.56 3 1 4.56 1 6.49v8.27c0 1.93 1.56 3.49 3.47 3.49h5.18l1.77 2.88c0 0 0.02 0.03 0.06 0.08 0.1 0.18 0.29 0.3 0.51 0.3 0.22 0 0.41-0.12 0.51-0.29 0.04-0.05 0.06-0.09 0.06-0.09l1.77-2.88h5.18c1.92 0 3.47-1.56 3.47-3.49V6.49C23 4.56 21.44 3 19.53 3zM5.89 13.21c-0.81 0-1.13-0.58-1.13-0.58v0.44H3.39V7.46h1.35v2.14c0.54-0.53 1.14-0.53 1.14-0.53 1.83 0 1.9 2.05 1.9 2.05C7.78 13.14 5.89 13.21 5.89 13.21zM10.13 9.44v3.63h-1.3V9.75c0-1.14-0.61-1.12-0.61-1.12v-1.3C10.19 7.33 10.13 9.44 10.13 9.44zM15.58 11.16c0 2.05-2.28 2.05-2.28 2.05 -2.3 0-2.23-2.05-2.23-2.05 0-2.08 2.23-2.08 2.23-2.08C15.65 9.08 15.58 11.16 15.58 11.16zM20.61 13.01c0 2.13-1.97 2.1-1.97 2.1h-0.52v-1.19h0.32c0.95 0 0.86-0.98 0.86-0.98v-0.31c-0.42 0.54-1.18 0.51-1.18 0.51 -1.87 0-1.85-2-1.85-2 0-2.14 1.91-2.06 1.91-2.06 0.74 0 1.13 0.51 1.13 0.51V9.21h1.31V13.01z\"/></svg></span> <span class='tpl-share-sns-name'>" + $.lang[LANG]["config.sns.naverblog"] + "</span></li>" +
1399            "       <li class='tpl-share-snsPost' data-sns='urlcopy'><span class='share-round'><svg viewBox=\"0 0 24 24\" width=\"20\" height=\"20\"><path d=\"M8.71 18.87c-0.48 0.48-1.11 0.74-1.79 0.74s-1.31-0.26-1.79-0.74c-0.99-0.99-0.99-2.59 0-3.58l4.15-4.15c0.48-0.48 1.11-0.74 1.79-0.74 0.68 0 1.31 0.26 1.79 0.74l0.98-0.98c-0.76-0.76-1.77-1.15-2.77-1.15s-2 0.38-2.77 1.15l-4.15 4.15c-1.53 1.53-1.53 4.01 0 5.54C4.91 20.62 5.91 21 6.92 21s2-0.38 2.77-1.15l2.08-2.08 -0.98-0.98L8.71 18.87z\"/><path d=\"M19.85 4.15C19.09 3.38 18.09 3 17.08 3c-1 0-2 0.38-2.77 1.15l-2.08 2.08 0.98 0.98 2.08-2.08c0.48-0.48 1.11-0.74 1.79-0.74s1.31 0.26 1.79 0.74c0.99 0.99 0.99 2.59 0 3.58l-4.15 4.15c-0.48 0.48-1.11 0.74-1.79 0.74 -0.68 0-1.31-0.26-1.79-0.74l-0.98 0.98c0.76 0.76 1.77 1.15 2.77 1.15s2-0.38 2.77-1.15l4.15-4.15C21.38 8.16 21.38 5.68 19.85 4.15z\"/></svg></span> <span class='tpl-share-sns-name'>" + $.lang[LANG]["config.sns.urlcopy"] + "</span></li>" +
1400            "       <!--<li class='tpl-share-snsPost' data-sns='google'><i class='fa fa-google-plus-square'></i> <span class='tpl-share-sns-name'>" + $.lang[LANG]["config.sns.google"] + "</span></li>" +
1401            "       <li class='tpl-share-snsPost' data-sns='pinterest'><i class='fa fa-pinterest-square'></i> <span class='tpl-share-sns-name'>" + $.lang[LANG]["config.sns.pinterest"] + "</span></li>" +
1402            "       <li class='tpl-share-snsPost' data-sns='tumblr'><i class='fa fa-tumblr-square'></i> <span class='tpl-share-sns-name'>" + $.lang[LANG]["config.sns.tumblr"] + "</span></li>-->" +
1403            "   </ul>" +
1404            "";
1405        return str;
1406    }
1407
1408
1409    var getLike = function(view) {
1410        var deferred = $.Deferred();
1411        var lSID = (PAGE_MODE == 'c') ? SID : property.SID,
1412            lPARENT = (PAGE_MODE == 'c') ? PARENT : property.PARENT,
1413            lVIEW = (PAGE_MODE == 'c') ? VIEW : property.VIEW;
1414        var type = (lPARENT.mode) ? 'P' : 'F';
1415
1416        if (view !== undefined && view) {
1417            type = 'P';
1418            lPARENT = '';
1419            lVIEW = view;
1420        }
1421
1422        $.ajax({
1423            type: 'post',
1424            url: '/template/like/get',
1425            data: { type: type, view: lVIEW, sid: lSID },
1426            dataType: 'json',
1427            async: false,
1428            success: function(data) {
1429                deferred.resolve(data);
1430            }
1431        });
1432
1433        return deferred.promise();
1434    }
1435
1436    var setLike = function(el, mode) {
1437        if (typeof MODE !== 'undefined' && MODE == 'demo') return false;
1438        var umemberActivate = (PAGE_MODE == 'c') ? Number(UMEMBER_ACTIVATE) : Number(property.UMEMBER_ACTIVATE);
1439        var checkLogin = (PAGE_MODE == 'c') ? true : false;
1440        var view = (PAGE_MODE == 'c') ? VIEW : property.VIEW;
1441        var parent = (PAGE_MODE == 'c') ? PARENT : property.PARENT;
1442        var sid = (PAGE_MODE == 'c') ? SID : property.SID;
1443
1444        var cm_id = '';
1445        var elsettings = {};
1446        var $this = el;
1447
1448        if (PAGE_MODE == 's') {
1449            var umember = property.UMEMBER;
1450            checkLogin = umember.check_login;
1451
1452            if (umemberActivate == 0 && umember.id_type == 'creatorlink') { //creatorlink login
1453                checkLogin = (umember.id !== undefined && umember.id) ? true : false;
1454            }
1455
1456            if ($('#write-login').length > 0) $('#write-login').remove();
1457
1458            if (parent.page) {
1459                elsettings = JSON.parse(parent.settings);
1460            } else {
1461                var parent_id = ($this.hasClass('gallery-like')) ? $this.closest('.blueimp-gallery').attr('id').replace('gframe-', '') : $this.closest('.element').attr('data-id');
1462                var el_idx = $('.element[data-id="' + parent_id + '"]').attr('data-el').replace('el_', '')
1463                var el_target = property.INITPAGE[el_idx];
1464                elsettings = JSON.parse(el_target.elsettings);
1465            }
1466
1467            var like_key = (mode == 'comment') ? 'likeComment_display' : 'like_display',
1468                like = (elsettings && elsettings.hasOwnProperty(like_key)) ? elsettings[like_key] : 'A';
1469
1470            if (like == 'M' && checkLogin == false) {
1471                if (confirm($.lang[LANG]['config.like.onlylogin'])) {
1472                    var action = (property.VALIDTYPE == 'SM') ? '/_login' : '/_cllogin';
1473                    var url = $(location).attr('pathname');
1474                    var html = '<form name="write_login_form" id="write-login" method="post" action="' + action + '" style="display:none;">\
1475                                    <input type="hidden" name="status" value="like">\
1476                                    <input type="hidden" name="sid" value="' + property.SID + '">\
1477                                    <input type="hidden" name="url" value="' + url + '">\
1478                                </form>';
1479                    $('body').append(html);
1480                    document.write_login_form.submit();
1481                }
1482                return false;
1483            }
1484        }
1485
1486        var like_id = $this.attr('data-like');
1487        var cnt = 0;
1488
1489        if (mode == 'list') {
1490            like_id = $this.closest('.figure.like').attr('data-like');
1491        }
1492        $this.addClass('disabled');
1493        var type = (parent.mode)? 'P':'F';
1494        var pid = parent.pid;
1495        switch (mode) {
1496            case 'gallery':
1497                type = 'P';
1498                pid = '';
1499                view = $this.attr('data-seq');
1500                break;
1501            case 'list':
1502                type = 'P';
1503                pid = '';
1504                view = $this.closest('.gallery-item').attr('data-seq');
1505                break;
1506            case 'comment':
1507                type += 'C';
1508                view = $this.closest('.page-comments').attr('data-id');
1509                cm_id = $this.attr('data-id');
1510                break;
1511        }
1512
1513        if (like_id !== undefined && like_id) { //delete like
1514            $.ajax({
1515                type: 'post',
1516                url: '/template/like/delete',
1517                data: { type: type, view: like_id, sid: sid, pid: pid, cm_id: cm_id },
1518                dataType: 'json',
1519                async: true,
1520                success: function(data) {
1521                    $this.removeClass('disabled');
1522                    switch (mode) {
1523                        case 'list':
1524                            $this.closest('.figure.like').removeClass('active').removeAttr('data-like');
1525                            $this.closest('.figure.like').find('.figure-like-cnt').text(data.cnt);
1526                            break;
1527
1528                        case 'gallery':
1529                            $this.removeClass('active').removeAttr('data-like');
1530                            view = $this.attr('data-seq');
1531                            var $figureLike = $('.gallery-item[data-seq="' + view + '"] .figure.like');
1532                            cnt = $figureLike.find('.figure-like-cnt').text();
1533                            $figureLike.removeClass('active').removeAttr('data-like');
1534                            $figureLike.find('.figure-like-cnt').text(data.cnt);
1535                            break;
1536
1537                        case 'project':
1538                            $this.removeClass('active').removeAttr('data-like');
1539                            $this.find('.btn-label').text(data.cnt);
1540                            break;
1541
1542                        case 'forum':
1543                            $this.removeClass('active').removeAttr('data-like');
1544                            $this.find('.btn-label').text(data.cnt);
1545
1546                            if ($('.page-bottomlist').length > 0) {
1547                                $('.tpl-forum-list-like[data-id="' + view + '"]').removeClass('active').removeAttr('data-like');
1548                                if ($('.tpl-forum-list-like[data-id="' + view + '"]').is('td') && $('.tpl-forum-list-like[data-id="' + view + '"] .forum-like-cnt').length == 0) {
1549                                    $('.tpl-forum-list-like[data-id="' + view + '"]').text(data.cnt);
1550                                } else {
1551                                    $('.tpl-forum-list-like[data-id="' + view + '"] .forum-like-cnt').text(data.cnt);
1552                                }
1553                            }
1554                            break;
1555
1556                        case 'comment':
1557                            $this.removeClass('active').removeAttr('data-like');
1558                            $this.find('.cm-like-cnt').text(data.cnt);
1559
1560                            break;
1561
1562                        default:
1563                            break;
1564                    }
1565                }
1566            });
1567        } else { //insert like
1568            $.ajax({
1569                type: 'post',
1570                url: '/template/like/update',
1571                data: { type: type, view: view, sid: sid, pid: pid, cm_id: cm_id },
1572                dataType: 'json',
1573                async: true,
1574                success: function(data) {
1575                    $this.removeClass('disabled');
1576                    switch (mode) {
1577                        case 'list':
1578                            $this.closest('.figure.like').addClass('active').attr('data-like', view);
1579                            $this.closest('.figure.like').find('.figure-like-cnt').text(data.cnt);
1580                            break;
1581
1582                        case 'gallery':
1583                            $this.addClass('active').attr('data-like', view);
1584
1585                            var $figureLike = $('.gallery-item[data-seq="' + view + '"] .figure.like');
1586                            cnt = $figureLike.find('.figure-like-cnt').text();
1587
1588                            $figureLike.addClass('active').attr('data-like', view);
1589                            $figureLike.find('.figure-like-cnt').text(data.cnt);
1590                            break;
1591
1592                        case 'project':
1593                            $this.addClass('active').attr('data-like', view);
1594                            $this.find('.btn-label').text(data.cnt);
1595                            break;
1596
1597                        case 'forum':
1598                            $this.addClass('active').attr('data-like', view);
1599                            $this.find('.btn-label').text(data.cnt);
1600
1601                            if ($('.page-bottomlist').length > 0) {
1602                                $('.tpl-forum-list-like[data-id="' + view + '"]').addClass('active').attr('data-like', view);
1603                                if ($('.tpl-forum-list-like[data-id="' + view + '"]').is('td') && $('.tpl-forum-list-like[data-id="' + view + '"] .forum-like-cnt').length == 0) {
1604                                    $('.tpl-forum-list-like[data-id="' + view + '"]').text(data.cnt);
1605                                } else {
1606                                    $('.tpl-forum-list-like[data-id="' + view + '"] .forum-like-cnt').text(data.cnt);
1607                                }
1608                            }
1609                            break;
1610
1611                        case 'comment':
1612                            $this.addClass('active').attr('data-like', view);
1613                            $this.find('.cm-like-cnt').text(data.cnt);
1614
1615                            break;
1616
1617                        default:
1618                            break;
1619                    }
1620                }
1621            });
1622        }
1623    }
1624
1625    var imgPopupFrame = function (el) {
1626        $('#imgPopupFrame').remove();
1627        var href = (typeof el == 'string')? el : $(el).attr('href');
1628        var imgSrc = (href.indexOf('googleusercontent') > -1)? getServeImage(href, 0, '') : href;
1629        var str = '\
1630            <div id="imgPopupFrame">\
1631                <div class="image-popup"><img src="'+imgSrc+'" onerror="this.src=\'//storage.googleapis.com/i.addblock.net/img_broken_fill_500.png\'"></div>\
1632                <div class="zoomable hide"></div>\
1633                <a class="close"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22" width="22" height="22"><polygon points="22 1.06 20.94 0 11 9.94 1.06 0 0 1.06 9.94 11 0 20.94 1.06 22 11 12.06 20.94 22 22 20.94 12.06 11 "/></svg></a>\
1634                <a class="zoom-in" data-toggle="tooltip" data-placement="bottom" data-html="true" data-original-title="확대"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
1634<path d="M24 22.94l-6.42-6.42C19.08 14.76 20 12.49 20 10c0-5.52-4.48-10-10-10S0 4.48 0 10s4.48 10 10 10c2.49 0 4.76-0.92 6.52-2.42L22.94 24 24 22.94zM1.5 10c0-4.69 3.81-8.5 8.5-8.5 4.69 0 8.5 3.81 8.5 8.5s-3.81 8.5-8.5 8.5C5.31 18.5 1.5 14.69 1.5 10z"/><polygon points="10.75 6 9.25 6 9.25 9.25 6 9.25 6 10.75 9.25 10.75 9.25 14 10.75 14 10.75 10.75 14 10.75 14 9.25 10.75 9.25 "/></svg></a>\
1635                <a class="zoom-out disabled" data-toggle="tooltip" data-placement="bottom" data-html="true" data-original-title="축소"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 23 23" width="23" height="23"><g><path d="m23 21.98-6.16-6.16a9.566 9.566 0 0 0 2.32-6.24C19.17 4.29 14.88 0 9.58 0S0 4.29 0 9.58s4.29 9.58 9.58 9.58c2.39 0 4.57-.88 6.24-2.32L21.98 23 23 21.98zM1.44 9.58c0-4.49 3.65-8.15 8.15-8.15 4.49 0 8.15 3.65 8.15 8.15s-3.65 8.15-8.15 8.15-8.15-3.66-8.15-8.15z"/><path d="M5.75 8.86h7.67v1.44H5.75z"/></g></svg></a>\
1636                <a class="view-original disabled" data-toggle="tooltip" data-placement="bottom" data-html="true" data-original-title="화면 크기에 맞춰 확대">\
1637                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 27 27" width="27" height="27"><g><path d="M1 4.12v18.75h25V4.12H1zm23.5 17.26h-22V5.62h22v15.76z"/><path d="M8.03 18.19h1.56V8.81H6.47v1.57h1.56zM12.72 10.38h1.56v1.56h-1.56zM12.72 15.06h1.56v1.56h-1.56zM18.19 18.19h1.56V8.81h-3.13v1.57h1.57z"/></g></svg>\
1638                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 27 27" width="27" height="27"><path d="M24.03 4.03 24 4V3h-1l-.03-.03-.03.03H13.5v1.5h7.94L4.5 21.44V13.5H3v9.44l-.03.03L3 23v1h1l.03.03.03-.03h9.44v-1.5H5.56L22.5 5.56v7.94H24V4.06z"/></svg>\
1639                </a>\
1640            </div>\
1641        ';
1642        
1643        $('.dsgn-body').append(str);
1644
1645        setTimeout(function(){
1646            $('#imgPopupFrame').addClass('imgPopup-display');
1647
1648            var currentWidth = $('#imgPopupFrame .image-popup img').width();
1649            if(currentWidth >= $(window).width()) {
1650                $('#imgPopupFrame .view-original').addClass('disabled');
1651            } else {
1652                $('#imgPopupFrame .view-original').removeClass('disabled');
1653            }
1654            setImgPopupIconTooltip($('#imgPopupFrame'));
1655        }, 500);
1656    }
1657
1658    var setImgPopupIconTooltip = function(el){
1659        $(el).find('.zoom-in, .zoom-out, .view-original, .view-original.fullscreen').attr({
1660            'data-toggle': 'tooltip',
1661            'data-placement': 'bottom',
1662            'data-html': 'true',
1663        });
1664
1665        $(el).find('.zoom-in').attr('data-original-title', $.lang[LANG]['gallery.slide.tooltip.zoom-in']);
1666        $(el).find('.zoom-out').attr('data-original-title', $.lang[LANG]['gallery.slide.tooltip.zoom-out']);
1667
1668        $(el).find('.view-original').attr('data-original-title', $.lang[LANG]['gallery.slide.view-fullscreen']);
1669        if($(el).find('.view-original').hasClass('fullscreen')) {
1670            $(el).find('.view-original').attr('data-original-title', $.lang[LANG]['gallery.slide.tooltip.view-original']);
1671        } else {
1672            $(el).find('.view-original').attr('data-original-title', $.lang[LANG]['gallery.slide.tooltip.view-fullscreen']);
1673        }
1674    }
1675
1676    var setPopupImgScale = function(el, scale) {
1677        var $img = el.find('img');
1678        var currentWidth = $img.width();
1679        var currentHeight = $img.height();
1680
1681        var zoomable = el.find('.zoomable');
1682
1683        if(zoomable.find('img').length == 0) {
1684            var $cloneImg = el.find('img').clone();
1685            $cloneImg.addClass('clone').attr('data-width', currentWidth).attr('data-height', currentHeight);
1686            zoomable.append($cloneImg);
1687        }
1688        var zoomableImg = zoomable.find('img');
1689
1690        var windowWidth = $(window).width();
1691        var windowHeight = $(window).height();
1692        var scaledWidth = currentWidth * scale;
1693        var scaledHeight = currentHeight * scale;
1694
1695        var scrollTop = zoomable.scrollTop();
1696        var scrollLeft = zoomable.scrollLeft();
1697
1698        var offsetX = ((windowWidth - currentWidth) > 0) ? (windowWidth - currentWidth) * 0.5 : 0;
1699        var offsetY = ((windowHeight - currentHeight) > 0) ? (windowHeight - currentHeight) * 0.5 : 0;
1700        var scaledOffsetX = ((windowWidth - scaledWidth - 8) > 0) ? (windowWidth - scaledWidth - 8) * 0.5 : 0;
1701        var scaledOffsetY = ((windowHeight - scaledHeight) > 0) ? (windowHeight - scaledHeight) * 0.5 : 0;
1702        var offset = {top: scaledOffsetY + 'px', left: scaledOffsetX + 'px'};
1703        var isScroll = false;
1704        var centerX = 0;
1705        var centerY = 0;
1706        var scrollPositionX = 0;
1707        var scrollPositionY = 0;
1708
1709        zoomable.removeClass('scroll');
1710        if(scaledWidth > windowWidth) {
1711            zoomable.css('width', scaledWidth);
1712            isScroll = true;
1713            offset = {top: scaledOffsetY+'px', left: 0};
1714        }
1715
1716        if(scaledHeight > windowHeight) {
1717            zoomable.css('height', scaledHeight);
1718            isScroll = true;
1719            offset = {top: 0, left: scaledOffsetX+'px'};
1720        } 
1721
1722        if(scaledWidth >= windowWidth && scaledHeight >= windowHeight) {
1723            offset = {top: 0, left: 0};
1724        }
1725
1726        if(isScroll) {
1727            zoomable.addClass('scroll');
1728            var scrollOffsetX = scaledWidth - windowWidth;
1729            var scrollOffsetY = scaledHeight - windowHeight;
1730            centerX = (scrollOffsetX - 8) * 0.5;
1731            centerY = (scrollOffsetY - 8) * 0.5;
1732            
1733            scrollPositionX = (zoomable.attr('data-scroll-left') !== undefined)? Number(zoomable.attr('data-scroll-left')) * scrollOffsetX : centerX;
1734            scrollPositionY = (zoomable.attr('data-scroll-top') !== undefined)? Number(zoomable.attr('data-scroll-top')) * scrollOffsetY : centerY;
1735        }
1736
1737        var scaleAnimation = Object.assign({}, offset, {width: scaledWidth+'px', height: scaledHeight+'px', scrollLeft: scrollPositionX, scrollTop: scrollPositionY});
1738
1739        if (scale > 1) {    
1740            $('#imgPopupFrame a.zoom-out').removeClass('disabled');
1741            zoomable.removeClass('hide');
1742            var zoomWidth = zoomableImg.attr('data-width');
1743            var zoomHeight = zoomableImg.attr('data-height');
1744            var initialWidth = zoomableImg.width();
1745            var initialHeight = zoomableImg.height();
1746
1747            if(Number(zoomWidth) == currentWidth) {
1748                zoomableImg.css({width: currentWidth+'px', height: currentHeight+'px', top: offsetY+'px', left: offsetX+'px'});
1749            }
1750
1751            zoomable.addClass('visible');
1752            setTimeout(function(){
1753                el.addClass('fullscreen');
1754                
1755                zoomableImg.animate(scaleAnimation, 200);
1756                // console.log(initialWidth, scaledWidth);
1757                if(initialWidth < windowWidth && scaledWidth > windowWidth) {
1758                    scrollPositionX = centerX;
1759                    var scrollLeft = centerX / (scaledWidth - windowWidth);
1760                    zoomable.attr({'data-scroll-left': scrollLeft});
1761                }
1762                if(initialHeight < windowHeight && scaledHeight > windowHeight) {
1763                    scrollPositionY = centerY;
1764                    var scrollTop = centerY / (scaledHeight - windowHeight);
1765                    zoomable.attr({'data-scroll-top': scrollTop});
1766                }
1767
1768                zoomable.animate({scrollLeft: scrollPositionX, scrollTop: scrollPositionY}, 200); //scroll
1769
1770                // if(scaledWidth >= windowWidth && scaledHeight >= windowHeight) zoomable.animate({scrollLeft: scrollPositionX, scrollTop: scrollPositionY}, 500);
1771
1772                zoomableImg.attr('data-scale', scale).attr('data-width', scaledWidth).attr('data-height', scaledHeight);
1773
1774                var isDragging = false;
1775                var lastX, lastY;
1776                zoomable.off('mousedown mousemove mouseup scroll');
1777                zoomable.on("mousedown", function(e) {
1778                    isDragging = true;
1779                    lastX = e.clientX;
1780                    lastY = e.clientY;
1781                    $(this).addClass('dragging');
1782                    e.preventDefault();
1783                    e.stopPropagation();
1784
1785                }).on("mousemove", function(e) {
1786                    if (isDragging) {
1787                        var deltaX = e.clientX - lastX;
1788                        var deltaY = e.clientY - lastY;
1789                        $(this).scrollLeft($(this).scrollLeft() - deltaX);
1790                        $(this).scrollTop($(this).scrollTop() - deltaY);
1791                        lastX = e.clientX;
1792                        lastY = e.clientY;
1793                        e.preventDefault();
1794                        e.stopPropagation();
1795                    }
1796                }).on("mouseup", function() {
1797                    isDragging = false;
1798                    $(this).removeClass('dragging');
1799
1800                    var scrollLeft = (($(this)[0].scrollWidth - $(this)[0].clientWidth) > 0) ? $(this).scrollLeft() / ($(this)[0].scrollWidth - $(this)[0].clientWidth) : 0;  // 가로 스크롤 좌표
1801                    var scrollTop = (($(this)[0].scrollHeight - $(this)[0].clientHeight) > 0) ? $(this).scrollTop() / ($(this)[0].scrollHeight - $(this)[0].clientHeight) : 0;    // 세로 스크롤 좌표
1802
1803                    zoomable.attr({'data-scroll-top': scrollTop, 'data-scroll-left': scrollLeft});
1804                    // console.log("가로 스크롤 좌표: " + scrollLeft);
1805                    // console.log("세로 스크롤 좌표: " + scrollTop);
1806                });
1807
1808                zoomable.on('mousewheel', function(e){
1809                    var scrollLeft = (($(this)[0].scrollWidth - $(this)[0].clientWidth) > 0) ? $(this).scrollLeft() / ($(this)[0].scrollWidth - $(this)[0].clientWidth) : 0;  // 가로 스크롤 좌표
1810                    var scrollTop = (($(this)[0].scrollHeight - $(this)[0].clientHeight) > 0) ? $(this).scrollTop() / ($(this)[0].scrollHeight - $(this)[0].clientHeight) : 0;    // 세로 스크롤 좌표
1811
1812                    zoomable.attr({'data-scroll-top': scrollTop, 'data-scroll-left': scrollLeft});
1813                    // console.log("가로 스크롤 좌표: " + scrollLeft);
1814                    // console.log("세로 스크롤 좌표: " + scrollTop);
1815                });
1816            }, 100);
1817        } else { //원본 크기
1818            zoomableImg.animate(scaleAnimation, 200);
1819            zoomable.animate({scrollLeft: scrollPositionX, scrollTop: scrollPositionY}, 200);
1820
1821            $('#imgPopupFrame a.zoom-out').addClass('disabled');
1822            $('#imgPopupFrame a.view-original').removeClass('fullscreen');
1823
1824            if(scaledWidth == $(window).width()) {
1825                $('#imgPopupFrame a.view-original').addClass('disabled');
1826            }
1827
1828            setTimeout(function(){
1829                el.removeClass('fullscreen');
1830            }, 100);
1831            setTimeout(function(){
1832                zoomable.removeClass('visible').addClass('hide');
1833                zoomable.removeAttr('data-scroll-top data-scroll-left')
1834                zoomableImg.remove();
1835            }, 200);
1836        }
1837    
1838        
1839    }
1840
1841    var drawBadgeList = function(use_badge, badge_settings) {
1842        var badgeList = '';
1843        if(typeof badge_settings == 'undefined' || !badge_settings) {
1844            badge_settings = {}
1845        }
1846        if(typeof use_badge != 'undefined' && use_badge) {
1847            var badgeCnt = use_badge.length;
1848            $.each(use_badge, function(idx, b){
1849                var bsettings = (typeof badge_settings[b] != 'undefined')? badge_settings[b] : {};
1850                var badgeType = (typeof bsettings.type != 'undefined' && bsettings.type)? bsettings.type : 'edit';
1851                var badgeStyle = (typeof bsettings.style != 'undefined' && bsettings.style)? bsettings.style : 'default-1 small';
1852                var badgeText = (typeof bsettings.badge_text != 'undefined' && bsettings.badge_text)? bsettings.badge_text : $.lang[LANG]['gallery.shopping.badge.'+b];
1853                var badgeBorderColor = (typeof bsettings.border_color != 'undefined' && bsettings.border_color)? bsettings.border_color : '';
1854                var badgeBackgroundColor = (typeof bsettings.background_color != 'undefined' && bsettings.background_color)? bsettings.background_color : '';
1855                var badgeFontColor = (typeof bsettings.font_color != 'undefined' && bsettings.font_color)? bsettings.font_color : '';
1856                var $badge = (badgeType == 'edit')? $('<span class="product-badge ' + badgeStyle + '">' + badgeText + '</span>') : $('<span class="product-badge"><img class="badge-img" src="' + bsettings.image_src + '"></span>');
1857                
1858                if(badgeBorderColor) $badge.css('border-color', badgeBorderColor);
1859                if(badgeBackgroundColor) $badge.css('background-color', badgeBackgroundColor);
1860                if(badgeFontColor) $badge.css('color', badgeFontColor);
1861                // if(typeof PAGE_MODE != 'undefined' && PAGE_MODE == 'c') $badge.attr('data-type', b);
1862                $badge.attr('data-type', b);
1863
1864                badgeList += $badge[0].outerHTML;
1865            });
1866        }
1867        
1868        return badgeList;
1869    }
1870
1871    var getBadgeSize = function(badge_settings) {
1872        var small = 0;
1873        var medium = 0;
1874        var large = 0;
1875        var cnt = 0;
1876        if(typeof badge_settings != 'undefined' && badge_settings) {
1877            $.each(badge_settings, function(t, b){
1878                if(b.type == 'edit') {
1879                    cnt++;
1880                    if(b.style.indexOf('small') > -1) small++;
1881                    if(b.style.indexOf('medium') > -1) medium++;
1882                    if(b.style.indexOf('large') > -1) large++;
1883                }
1884            });
1885        }
1886        
1887        var flag = false;
1888        if(cnt == small) flag = 'badge-small';
1889        if(cnt == medium) flag = 'badge-medium';
1890        if(cnt == large) flag = 'badge-large';
1891
1892        return flag;
1893    }
1894
1895    $(document).on('click', '#imgPopupFrame .close, #imgPopupFrame .image-popup', function(e){
1896        if(!$(e.target).is('img')) $('#imgPopupFrame').fadeOut(500);
1897    });
1898
1899    $(document).on('dblclick','#imgPopupFrame .image-popup img, #imgPopupFrame .zoomable img', function(e) {
1900        e.preventDefault();
1901        e.stopPropagation();
1902        $('#imgPopupFrame a.view-original').toggleClass('fullscreen');
1903
1904        var el = $('#imgPopupFrame');
1905        var $img = $('#imgPopupFrame .image-popup img');
1906
1907        if($('#imgPopupFrame a.view-original').hasClass('fullscreen')) {
1908            var img = $img[0];
1909
1910            var currentWidth = $img.width();
1911            var currentHeight = $img.height();
1912            var windowWidth = $(window).width()-8;
1913            var windowHeight = $(window).height();
1914            var naturalWidth = img.naturalWidth,
1915                naturalHeight = img.naturalHeight;
1916            
1917            scale = (windowWidth / currentWidth).toFixed(15);
1918        } else {
1919            scale = 1;
1920        }
1921
1922        setImgPopupIconTooltip(el);
1923        setPopupImgScale(el, scale);
1924    });
1925
1926    $(document).on('click','#imgPopupFrame a.view-original', function(e) {
1927        e.preventDefault();
1928        e.stopPropagation();
1929        $(this).toggleClass('fullscreen');
1930
1931        var el = $('#imgPopupFrame');
1932        setImgPopupIconTooltip(el);
1933        $('#imgPopupFrame .view-original[data-toggle="tooltip"]').tooltip('show');
1934
1935        var $img = el.find('img');
1936        if($(this).hasClass('fullscreen')) {
1937            var img = $img[0];
1938
1939            var currentWidth = $img.width();
1940            var currentHeight = $img.height();
1941            var windowWidth = $(window).width()-8;
1942            var windowHeight = $(window).height();
1943            var naturalWidth = img.naturalWidth,
1944                naturalHeight = img.naturalHeight;
1945            
1946            scale = (windowWidth / currentWidth).toFixed(15);
1947        } else {
1948            scale = 1;
1949        }
1950        setPopupImgScale(el, scale);
1951    });
1952
1953    $(document).on('click','#imgPopupFrame a.zoom-in, #imgPopupFrame a.zoom-out', function(e) {
1954        e.stopPropagation();
1955
1956        var scale = $('#imgPopupFrame .zoomable img').attr('data-scale');
1957        if(scale === undefined) scale = 1;
1958
1959        if($(this).hasClass('zoom-in')) {
1960            $('#imgPopupFrame a.view-original').removeClass('disabled').addClass('fullscreen');
1961
1962            scale = Number(scale) + 0.5;
1963        } else {
1964            if(scale > 1) scale = Number(scale) - 0.5;
1965            if(scale < 1) scale = 1;
1966            if(scale == 1) {
1967                $('#imgPopupFrame a.view-original').removeClass('fullscreen');
1968            }
1969        }
1970        
1971        // setImgPopupIconTooltip(el);
1972        setPopupImgScale($('#imgPopupFrame'), scale);
1973        
1974    });
1975
1976    $(document).on('click', '.data-feed-load-more', function() {
1977        var feed = $(this).attr('data-feed-el');
1978        let feed_view = $('.'+feed+' .social-feed-element:visible').length;
1979        if ($('.' + feed + ' .listprogress').length) {
1980            $(this).showModalFlat('INFORMATION', 'Please wait...', true, false, '', 'ok');
1981            return false;
1982        }
1983        $('.' + feed + ' .social-feed-element').addClass('show-posts');
1984        if (typeof $('.' + feed + ' .social-feed-element:eq(0)').first().attr('social-feed-id') != 'undefined') $(this).hide();
1985    });
1986
1987    var loadingElement = function(el, msg) {
1988        $('.' + el + ' .listprogress').remove();
1989        if ($('.' + el).find('.social-feed-container').hasClass('listprogress-end')) return false;
1990        msg = (typeof msg == "undefined") ? "" : msg;
1991        var p = (msg) ? "<p class='text-center'>" + msg + "</p>" : "";
1992        $('.' + el + ' .social-feed-container').append('<div class="listprogress" style="width: 100%; text-align:center; padding:50px 0;"><svg version="1.1" xmlns="http://www.w3.org/svg/2000" viewBox="0 0 30 30" width="60" style="width:20px; height: 20px;"><circle cy="15" cx="15" r="14" style="stroke:#00baff;"></circle></svg>' + p + '</div>');
1993    }
1994
1995    var setCustomPagination = function(config) {
1996
1997        var $obj = config['$obj'],
1998            total = config['total'],
1999            view = (config['view']) ? config['view'] : 10,
2000            page_num = (config['page_num']) ? config['page_num'] : 1,
2001            page_view = (config['page_view']) ? config['page_view'] : 5,
2002            pagingContainer = config['pagingContainer'],
2003            section = config['section'],
2004            base_url = config['base_url'];
2005
2006        start = Math.floor((page_num - 1) / page_view) * page_view,
2007            pages = Math.ceil(total / view),
2008            end = (Math.floor((page_num - 1) / page_view) + 1) * page_view,
2009            end = (end > pages) ? pages : end,
2010            prev = (start > 0) ? start : 1,
2011            next = ((end + 1) > pages) ? pages : end + 1,
2012            page_class = section + '-page';
2013
2014        $obj.empty();
2015
2016        for (i = start; i < end; i++) {
2017            var active = ((i + 1) == page_num) ? "active" : "",
2018                pageHref = base_url + (i + 1);
2019
2020            $obj.append($("<li class='" + page_class + " " + active + "' data-view='" + view + "' data-page-num='" + (i + 1) + "'><a href='" + pageHref + "'>" + (i + 1) + "</a></li>"));
2021        }
2022
2023        var prevHref = base_url + prev,
2024            nextHref = base_url + next,
2025            firstHref = base_url + '1',
2026            lastHref = base_url + pages,
2027            $prev = "" +
2028            "<li class='" + page_class + " prev' data-view='" + view +
2029            "' data-page-num='" + (start) + "'>" +
2030            "<a href='" + prevHref + "' aria-label='Previous'>" +
2031            "<span aria-hidden='true'>" +
2032            "<i class='fa fa-angle-left'></i>" +
2033            "</span>" +
2034            "</a>" +
2035            "</li>",
2036            $next = "" +
2037            "<li class='" + page_class + " next' data-view='" + view +
2038            "' data-page-num='" + (i + 1) + "'>" +
2039            "<a href='" + nextHref + "' aria-label='Previous'>" +
2040            "<span aria-hidden='true'>" +
2041            "<i class='fa fa-angle-right'></i>" +
2042            "</span>" +
2043            "</a>" +
2044            "</li>",
2045            $first = "" +
2046            "<li class='" + page_class + " prev' data-view='" + view +
2047            "' data-page-num='1'>" +
2048            "<a href='" + firstHref + "' aria-label='First'>" +
2049            "<span aria-hidden='true'>" +
2050            "<i class='fa fa-angle-double-left'></i>" +
2051            "</span>" +
2052            "</a>" +
2053            "</li>",
2054            $last = "" +
2055            "<li class='" + page_class + " prev' data-view='" + view +
2056            "' data-page-num='" + pages + "'>" +
2057            "<a href='" + lastHref + "' aria-label='Last'>" +
2058            "<span aria-hidden='true'>" +
2059            "<i class='fa fa-angle-double-right'></i>" +
2060            "</span>" +
2061            "</a>" +
2062            "</li>";
2063
2064        if (start != 0)
2065            $obj.prepend($prev);
2066
2067        if (end != pages)
2068            $obj.append($next);
2069
2070        if (pages > 5) {
2071            if (page_num > 5) $obj.prepend($first);
2072            $obj.append($last);
2073        }
2074
2075    }
2076
2077    function memberLogin() {
2078        location.href = "/";
2079    }
2080
2081
2082    Number.prototype.format = function(n, x) {
2083        var re = '\\d(?=(\\d{' + (x || 3) + '})+' + (n > 0 ? '\\.' : '$') + ')';
2084        return this.toFixed(Math.max(0, ~~n)).replace(new RegExp(re, 'g'), '$&,');
2085    };
2086
2087    // 뎁스가 있는 값을 확인하기
2088    var checkNested = function(obj) {
2089        var args = Array.prototype.slice.call(arguments, 1);
2090
2091        for (var i = 0; i < args.length; i++) {
2092            if (!obj || !obj.hasOwnProperty(args[i])) {
2093                return false;
2094            }
2095            obj = obj[args[i]];
2096        }
2097        return true;
2098    }
2099
2100    Number.prototype.format = function() {
2101        if (this == 0) return 0;
2102
2103        var reg = /(^[+-]?\d+)(\d{3})/;
2104        var n = (this + '');
2105
2106        while (reg.test(n)) n = n.replace(reg, '$1' + ',' + '$2');
2107
2108        return n;
2109    };
2110
2111
2112    String.prototype.format = function() {
2113        var num = parseFloat(this);
2114        if (isNaN(num)) return "0";
2115
2116        return num.format();
2117    };
2118
2119    function selectionRect() {
2120        var s = window.getSelection();
2121        oRange = s.getRangeAt(0); //get the text range
2122        oRect = oRange.getBoundingClientRect();
2123        return oRect;
2124    }
2125
2126    function isHangulKey(event) {
2127        return (event.keyCode >= 12593 && event.keyCode <= 12622) || // 자모음 범위
2128        (event.keyCode >= 44032 && event.keyCode <= 55203) || // 완성형 범위
2129        (event.keyCode >= 12592 && event.keyCode <= 12687);
2130    }            
2131
2132    function placeCaretAtEnd(el) {
2133        el.focus();
2134        if (typeof window.getSelection != "undefined" &&
2135            typeof document.createRange != "undefined") {
2136            var range = document.createRange();
2137            range.selectNodeContents(el);
2138            range.collapse(false);
2139            var sel = window.getSelection();
2140            sel.removeAllRanges();
2141            sel.addRange(range);
2142        } else if (typeof document.body.createTextRange != "undefined") {
2143            var textRange = document.body.createTextRange();
2144            textRange.moveToElementText(el);
2145            textRange.collapse(false);
2146            textRange.select();
2147        }
2148    }
2149
2150    var insertVideo = function(sUrl, mode) {
2151        if (typeof sUrl == 'object') {
2152            var result = [];
2153            $.each(sUrl, function(i, v) {
2154                var r = insertVideo(v);
2155                if (typeof r != 'undefined') result.push(r);
2156            });
2157            return (sUrl.length == result.length) ? result : false;
2158        }
2159
2160        sUrl = sUrl.replace('www.', '');
2161        var img = 'https://storage.googleapis.com/i.addblock.net/video-icon.jpg';
2162        // video url patterns(youtube, instagram, vimeo, dailymotion)
2163        var ytRegExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;
2164        var ytMatch = sUrl.match(ytRegExp);
2165
2166        var igRegExp = /\/\/instagram.com\/p\/(.[a-zA-Z0-9]*)/;
2167        var igMatch = sUrl.match(igRegExp);
2168
2169        var vRegExp = /\/\/vine.co\/v\/(.[a-zA-Z0-9]*)/;
2170        var vMatch = sUrl.match(vRegExp);
2171
2172        var vimRegExp = /\/\/(player.)?vimeo.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/;
2173        var vimMatch = sUrl.match(vimRegExp);
2174
2175        var dmRegExp = /.+dailymotion.com\/(video|hub|embed)\/([^_]+)[^#]*(#video=([^_&]+))?/;
2176        var dmMatch = sUrl.match(dmRegExp);
2177
2178        var mcRegExp = /\/\/metacafe.com\/watch\/(.[a-zA-Z0-9]*)\/(.[a-zA-Z0-9\-]*)\//;
2179        var mcMatch = sUrl.match(mcRegExp);
2180
2181        var kakaoExp = /\/\/tv.kakao.com\/(channel|embed)\/([0-9]{6,11}|player)\/cliplink\/([0-9]{6,11})/;
2182        var kaMatch = sUrl.match(kakaoExp);
2183
2184        var kakaoExp2 = /\/\/tv.kakao.com\/(v|l)\/([0-9]{6,11})/;
2185        var kaMatch2 = sUrl.match(kakaoExp2);
2186
2187        var naverExp = /\/\/serviceapi.rmcnmv.naver.com\/(.*)/;
2188        var naMatch = sUrl.match(naverExp);
2189
2190        var sound = sUrl.search('soundcloud.com');
2191        var $video, src;
2192        if (ytMatch && ytMatch[2].length === 11) {
2193            var youtubeId = ytMatch[2];
2194            src = '//www.youtube.com/embed/' + youtubeId;
2195            src = src.replace('watch?v=', 'v/');
2196
2197            $video = $('<iframe>')
2198                .attr({ 'src': src + '?wmode=transparent', 'frameborder': '0' });
2199            img = '//img.youtube.com/vi/' + youtubeId + '/default.jpg';
2200            /*        
2201            } else if (igMatch && igMatch[0].length > 0) {
2202                $video = $('<iframe>')
2203                .attr('src', igMatch[0] + '/embed/')
2204                .attr('width', '612').attr('height', '710')
2205                .attr('scrolling', 'no')
2206                .attr('allowtransparency', 'true');
2207            } else if (vMatch && vMatch[0].length > 0) {
2208                $video = $('<iframe>')
2209                .attr('src', vMatch[0] + '/embed/simple')
2210                //.attr('width', '600').attr('height', '600')
2211                .attr('class', 'vine-embed');
2212                src = vMatch[0] + '/embed/simple';
2213            */
2214        } else if (vimMatch && vimMatch[3].length > 0) {
2215            $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')
2216                .attr('src', '//player.vimeo.com/video/' + vimMatch[3]);
2217            //.attr('width', '640').attr('height', '360');
2218            src = '//player.vimeo.com/video/' + vimMatch[3];
2219            $.getJSON('https://vimeo.com/api/oembed.json?url=https://player.vimeo.com/video/' + vimMatch[3] + '&width=640', function(data) {
2220                if (typeof data.thumbnail_url != 'undefined' && data.thumbnail_url) {
2221                    img = data.thumbnail_url;
2222                }
2223            });
2224        } else if (dmMatch && dmMatch[2].length > 0) {
2225            dmMatch[2] = dmMatch[2].replace("video/", "");
2226            $video = $('<iframe>')
2227                .attr('src', '//www.dailymotion.com/embed/video/' + dmMatch[2]);
2228            //.attr('width', '640').attr('height', '360');
2229            src = '//www.dailymotion.com/embed/video/' + dmMatch[2];
2230            img = '//dailymotion.com/thumbnail/video/' + dmMatch[2];
2231        }
2232        /* else if (mcMatch && mcMatch[1].length > 0) {
2233                    $video = $('<iframe>')
2234                    .attr('src', 'http://www.metacafe.com/embed/' + mcMatch[1] + '/' + mcMatch[2]);
2235                    //.attr('width', '640').attr('height', '360');
2236                    src = 'http://www.metacafe.com/embed/' + mcMatch[1] + '/' + mcMatch[2];
2237                }*/
2238        else if (sound > -1) {
2239            $.getJSON('https://soundcloud.com/oembed?format=json&url=' + sUrl, function(data) {
2240                if (typeof data.html == 'undefined') {
2241                    alert('get Soundcloud API error');
2242                    return;
2243                }
2244                $video = $(data.html);
2245                src = $video.prop('src');
2246                img = data.thumbnail_url;
2247            }).fail(function(response) {
2248                console.log(response);
2249                alert('get Soundcloud API error');
2250                $video = false;
2251                src = false;
2252            });
2253        } else if (kaMatch && kaMatch[3].length > 0) {
2254            $video = $('<iframe>')
2255                .attr('src', '//tv.kakao.com/embed/player/cliplink/' + kaMatch[3] + '?service=kakao_tv');
2256            src = '//tv.kakao.com/embed/player/cliplink/' + kaMatch[3] + '?service=kakao_tv';
2257            // img = file_get_contents('//tv.kakao.com/v/' + kaMatch[3]);
2258        } else if (kaMatch2 && kaMatch2[2].length > 0) {
2259            var kakao_tv_iframe = {
2260                    'l': '//play-tv.kakao.com/embed/player/livelink?liveLinkId=',
2261                    'v': '//play-tv.kakao.com/embed/player/cliplink/'
2262                },
2263                kakao_tv_parameter = {
2264                    'l': '&service=player_share',
2265                    'v': '?service=player_share'
2266                }
2267            kakao_tv_src = kakao_tv_iframe[kaMatch2[1]] + kaMatch2[2] + kakao_tv_parameter[kaMatch2[1]];
2268
2269            $video = $('<iframe>')
2270                .attr('src', kakao_tv_src)
2271                .attr('scrolling', 'no')
2272                .attr('allow', 'autoplay');
2273            src = kakao_tv_src;
2274        }
2275        /* else if(naMatch && naMatch[1].length > 0) {
2276                   $video = $('<iframe>')
2277                   .attr('src', '//serviceapi.rmcnmv.naver.com/' + naMatch[1]);
2278                   src = '//serviceapi.rmcnmv.naver.com/' + naMatch[1];
2279               } */
2280        else {
2281            // this is not a known video link. Now what, Cat? Now what?
2282        }
2283
2284        if ($video) {
2285            $video.attr('frameborder', 0);
2286        }
2287
2288        switch (mode) {
2289            case "src":
2290                return src;
2291                break;
2292            case "img":
2293                return img;
2294                break;
2295            default:
2296                return $video;
2297                break;
2298        }
2299    }
2300
2301    function setForumWrap() {
2302        var width = $('body').width(),
2303            margin = 0,
2304            size = $('.fr-view').width(),
2305            sidebar = $('.dsgn-body').hasClass('sidebar');
2306
2307        width = (sidebar) ? width - $('header.sidebar').width() : width;
2308        $.each($('.f-align-full, .f-align-wide'), function(i, v) {
2309            if ($(this).hasClass('f-align-full')) {
2310                margin = (width - size) / 2;
2311            } else {
2312                container = (size == 720) ? (size + 240) : (size + 220);
2313                if (width <= container) container = width;
2314                width = container;
2315                margin = (container - size) / 2;
2316            }
2317            $(this).css('cssText', 'width: ' + width + 'px !important; margin-left:-' + margin + 'px; max-width:' + width + 'px !important;');
2318        });
2319    }
2320
2321    function doGetCaretPosition(oField) {
2322
2323        // Initialize
2324        var iCaretPos = 0;
2325
2326        // IE Support
2327        if (document.selection) {
2328
2329            // Set focus on the element
2330            oField.focus();
2331
2332            // To get cursor position, get empty selection range
2333            var oSel = document.selection.createRange();
2334
2335            // Move selection start to 0 position
2336            oSel.moveStart('character', -oField.value.length);
2337
2338            // The caret position is selection length
2339            iCaretPos = oSel.text.length;
2340        }
2341
2342        // Firefox support
2343        else if (oField.selectionStart || oField.selectionStart == '0')
2344            iCaretPos = oField.selectionStart;
2345
2346
2347        // Return results
2348        return iCaretPos;
2349    }
2350
2351    function resetForm($obj) {
2352        $.each($obj.find('.tpl-form-element'), function(i, v) {
2353            var type = $(this).prop('type');
2354            switch (type) {
2355                case 'text':
2356                case 'tel':
2357                case 'number':
2358                case 'textarea':
2359                    $(this).val('');
2360                    break;
2361
2362                case 'radio':
2363                case 'checkbox':
2364                    $(this).prop('checked', false);
2365                    break;
2366
2367                case 'select-one':
2368                case 'select-multi':
2369                    $(this).val('');
2370                    $(this)[0].selectIndex = -1;
2371                    break;
2372            }
2373        });
2374    }
2375
2376    function getRecommendInfo($el, $img, mode) {
2377        // alert('el: ' + $el + ', img:' + $img + ', mode:' + mode);
2378        if (typeof mode == 'undefined' || $el.hasClass('el-footer')) mode = true;
2379
2380        var width = '';
2381        if (mode == false) {
2382            width = ($('#element-display > div').is('[data-width]')) ? $('#element-display > div').attr('data-width') : $el.attr('data-width');
2383        } else {
2384            if (typeof $el.attr('data-width') != 'undefined' && $el.attr('data-type2') != 'logo') width = $el.attr('data-width');
2385            else if ($el.attr('data-type2') == 'logo' && $el.attr('data-case') == 'slideshow69') width = '160';
2386            else if ($el.attr('data-type2') == 'logo' && $el.attr('data-case') == 'slideshow68') width = '100';
2387            else width = 0;
2388        }
2389
2390        var src = $img.prop('src');
2391        var preVerRegExp = new RegExp('/'+SID+'/'),
2392            newVerRegExp = new RegExp('googleusercontent'),
2393            sample_check = (src.match(preVerRegExp) === null && src.match(newVerRegExp) === null) ? true : false,
2394            ori_src = src,
2395            src = (sample_check || width == 0) ? src : getServeImage(src, 0,RESOURCE + '/' + SID);
2396
2397        var gallery_check = (($el.attr('data-id') == 'all_products' || $el.attr('data-type2') == 'premium') && $el.attr('data-type') == 'gallery' && $el.find('.gjs').attr('data-js-code') == 1) ? true : false;
2398
2399        var img_resolution = '',
2400            img = new Image(),
2401            nWidth = 0,
2402            nHeight = 0,
2403            txt_img_click = (mode) ? $.lang[LANG]['editor.image.click.change'] + '<br>' : '',
2404            recomm_str = '',
2405            footerlogo = (selectEL == 'el-footer') ? $img[0].src.split(':')[1] : '',
2406            isfooterAttach = typeof $('img[src="' + footerlogo + '"]').is('[data-footer-attach]') == 'undefined' ? false : $('img[src="' + footerlogo + '"]').is('[data-footer-attach]');
2407
2408        img.src = (typeof src == 'undefined') ? '' : src;
2409
2410        // if (width == 0) {
2411            // if (selectEL == 'el-menu' || (selectEL == 'el-footer' && isfooterAttach)) { 푸터 로고 이미지 호버 시 내용 없는 툴팁 노출 되어 툴팁 미노출 되도록 처리
2412            if (selectEL == 'el-menu' || (selectEL == 'el-footer')) {
2413                var el_img = $('.' + selectEL).find('img[data-attach="true"]');
2414                if (typeof el_img.attr('src') != "undefined" && ori_src.match(el_img.attr('src')) !== null) {
2415                    // HTML[data-max-width] > CSS max-width > HTML ELEMENT width()
2416                    nWidth = (typeof el_img.css('max-width') != 'undefined' && el_img.css('max-width').match(/px/gi) !== null) ? el_img.css('max-width').replace('px', '') : el_img.width();
2417                    nHeight = (typeof el_img.css('max-height') != 'undefined' && el_img.css('max-height').match(/px/gi) !== null) ? el_img.css('max-height').replace('px', '') : el_img.height();
2418
2419                    img_resolution = (typeof el_img.closest('.navbar-brand').attr('data-recommend') != 'undefined') ? el_img.closest('.navbar-brand').attr('data-recommend') : nWidth + ' X ' + nHeight;
2420                    // return '<div class="text-left">' + txt_img_click + '<span class="txt-recomm">' + $.lang[LANG]['editor.image.recomm.menu'] + '<br>' + img_resolution + '</span></div>';
2421                    return "<div class=\'text-left\'>" + txt_img_click + "</div>";
2422                }
2423            } else {
2424                img.onload = function() {
2425                    nWidth = this.width;
2426                    nHeight = this.height;
2427                    img_resolution = ((nWidth) ? nWidth : $img.width()) + ' X ' + ((nHeight) ? nHeight : $img.height());
2428
2429                    recomm_str = "<div class=\'text-left\'>" + txt_img_click + "<span class=\'txt-recomm\'>" + $.lang[LANG]['editor.image.recomm.size'] + "<br>" + img_resolution + "</span></div>";
2430
2431                    if (mode) {
2432                        var this_src = ori_src.substr(ori_src.lastIndexOf('/') + 1);
2433                        if(gallery_check) $('.bc-resource').find('[style*="' + this_src + '"]').attr('data-original-title', recomm_str);
2434                        else $('.bc-resource').find('img[src$="' + this_src + '"]').attr('data-original-title', recomm_str);
2435                    } else {
2436                        if ($('.recomm-image-text').length > 0) $('.recomm-image-text').html(recomm_str).show();
2437                        else $('body').append(recomm_str);
2438                    }
2439                }
2440                return "<div class=\'text-left\'>" + txt_img_click + "<span class=\'txt-recomm\' data-loading=\'true\'>Loading...</span></div>";
2441            }
2442
2443
2444            // if(mode) return '<div class="text-left">' + $.lang[LANG]['editor.image.click.change'] + '<br><span class="txt-recomm">' + $.lang[LANG]['editor.image.recomm'] + '<br>' + img_resolution + '</span></div>';
2445            // else return '<div class="text-left"><span class="txt-recomm">' + $.lang[LANG]['editor.image.recomm'] + '<br>' + img_resolution + '</span></div>';
2446        /*
2447        } else {
2448            switch (width) {
2449                case '1920':
2450                    img_resolution = '1920 X FREE';
2451                    break;
2452                case '800':
2453                    img_resolution = '800 X FREE';
2454                    break;
2455                case '700':
2456                    img_resolution = '700 X 500';
2457                    break;
2458                case '670':
2459                    img_resolution = '670 X 980';
2460                    break;
2461                case '650':
2462                    img_resolution = '650 X 370';
2463                    break;
2464                case '600':
2465                    img_resolution = '600 X 600';
2466                    break;
2467                case '250':
2468                    img_resolution = '250 X 250';
2469                    break;
2470                case '160':
2471                    img_resolution = '160 X 100';
2472                    break;
2473                case '100':
2474                    img_resolution = '100 X 100';
2475                    break;
2476                case '60':
2477                    img_resolution = '60 X 60';
2478                    break;
2479            }
2480            // var gallery_check = (($el.attr('data-id') == 'all_products' || $el.attr('data-type2') == 'premium') && $el.attr('data-type') == 'gallery' && $el.find('.gjs').attr('data-js-code') == 1) ? true : false;
2481            // if(!gallery_check) {
2482            //   if(width > 1000) {
2483            //     nWidth = this.width;
2484            //     nHeight = this.height;
2485            //     img_resolution = ((nWidth) ? nWidth : $img[0].naturalWidth) + ' X ' + ((nHeight) ? nHeight : $img[0].naturalHeight);
2486            //   } else {
2487            //     //현재 블럭의 이미지 영역의 2배 사이즈
2488            //     var $el_img = $('.' + selectEL).find('[data-attach="true"]');
2489            //     var img_width = ($el_img[0].width) ? $el_img[0].width : $el_img[0].clientWidth,
2490            //         img_height = ($el_img[0].height) ? $el_img[0].height : $el_img[0].clientHeight;
2491            //     img_resolution = (img_width * 2) + ' X ' + (img_height * 2);
2492            //   }
2493            // }
2494
2495            return "<div class=\'text-left\'>" + txt_img_click + "<span class=\'txt-recomm\'>" + $.lang[LANG]['editor.image.recomm.size'] + "<br>" + img_resolution + "</span></div>";
2496        }
2497        */
2498
2499    }
2500
2501    var getRatio = function(w) {
2502        var r = '';
2503        switch (w) {
2504            case "1920":
2505                r = '&w=1920&fit=crop';
2506                break;
2507            case "800":
2508                r = '&w=800&fit=crop';
2509                break;
2510            case "700":
2511                r = '&w=700&h=500&crop=face&fit=crop';
2512                break;
2513            case "670":
2514                r = '&w=670&h=980&crop=face&fit=crop';
2515                break;
2516            case "650":
2517                r = '&w=600&h=370&crop=face&fit=crop';
2518                break;
2519            case "600":
2520                r = '&w=600&h=600&crop=face&fit=crop';
2521                break;
2522            case "250":
2523                r = '&w=250&h=250&crop=face&fit=crop';
2524                break;
2525            case "60":
2526                r = '&w=60&h=60&crop=face&fit=crop';
2527                break;
2528            case "0":
2529                r = '';
2530                break;
2531        }
2532        return r;
2533    }
2534
2535    var tplFormitem = function(type, idx, val) {
2536        var tpl = '';
2537        if (typeof val == 'undefined' || val == '') {
2538            if ($.inArray(type, ['radio.image', 'check.image']) > -1) {
2539                val = {"options":[
2540                        {"label":"A","image":"https://storage.googleapis.com/i.addblock.net/sample/form_selection_sample01.jpg"},
2541                        {"label":"B","image":"https://storage.googleapis.com/i.addblock.net/sample/form_selection_sample02.jpg"},
2542                        {"label":"C","image":"https://storage.googleapis.com/i.addblock.net/sample/form_selection_sample03.jpg"},
2543                        {"label":"D","image":"https://storage.googleapis.com/i.addblock.net/sample/form_selection_sample04.jpg"},
2544                    ],"imageConfig":{"mode":"fixed","column":4}};
2545            } else if ($.inArray(type, ['file.download', 'file.upload']) > -1) {
2546                val = '';
2547            } else {
2548                val = ['A', 'B'];
2549            }
2550        } else {
2551            if ($.inArray(type, ['radio.image', 'check.image']) > -1) {
2552                val = $.parseJSON(val);
2553            } else if ($.inArray(type, ['file.download', 'file.upload']) > -1) {
2554                val = val.split('||');
2555            } else {
2556                val = val.split('`');
2557            }
2558        }
2559        // console.log(type, idx, val);
2560        var blang = (typeof $('.' + selectEL).attr('data-blocklang') == 'undefined') ? $('#element-display[data-ref="' + selectEL + '"]').attr('data-blocklang') : $('.' + selectEL).attr('data-blocklang'),
2561            sdefault = '';
2562        if (typeof blang == 'undefined') {
2563            blang = getLanguage(true);
2564        }
2565
2566        if (blang == 'ko') {
2567            sdefault = '선택하세요';
2568            datePlaceholder = '날짜 선택';
2569            date2Placeholder = '날짜/시간 선택';
2570        } else if (blang == 'en') {
2571            sdefault = 'Select';
2572            datePlaceholder = 'Date';
2573            date2Placeholder = 'Date/Time';
2574        } else if (blang == 'ja') {
2575            sdefault = '選択してください';
2576            datePlaceholder = 'Date';
2577            date2Placeholder = 'Date/Time';
2578        } else {
2579            sdefault = 'Select';
2580            datePlaceholder = 'Date';
2581            date2Placeholder = 'Date/Time';
2582        }
2583        switch (type) {
2584            case 'text':
2585                tpl = '<input class="form-control" type="text">';
2586                break;
2587            case 'memo':
2588                tpl = '<textarea class="form-control"></textarea>';
2589                break;
2590            case 'select':
2591                var isFranchiseBar = ($('.' + selectEL).attr('data-type2') == 'franchise bar' || $('#element-display[data-ref="' + selectEL + '"]').attr('data-type2') == 'franchise bar');
2592                
2593                if (isFranchiseBar) {
2594                    tpl = '<div class="franchise-form-select">';
2595                    tpl = tpl + '<select class="form-control franchise-form-select-native hide">';
2596                    tpl = tpl + '<option value="">' + sdefault + '</option>';
2597                    $.each(val, function(i, v) {
2598                        tpl = tpl + '<option value="' + replaceQuote(v) + '">' + v + '</option>';
2599                    });
2600                    tpl = tpl + '</select>';
2601                    tpl = tpl + '<button type="button" class="dropdown-toggle form-control" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">';
2602                    tpl = tpl + '<span class="franchise-form-select-label">' + sdefault + '</span><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" width="12" height="12"><path d="m6 8 4-4H2z"/></svg>';
2603                    tpl = tpl + '</button>';
2604                    tpl = tpl + '<ul class="dropdown-menu" role="menu">';
2605                    tpl = tpl + '<li><a href="javascript:;" data-value="">' + sdefault + '</a></li>';
2606                    $.each(val, function(i, v) {
2607                        tpl = tpl + '<li><a href="javascript:;" data-value="' + replaceQuote(v) + '">' + v + '</a></li>';
2608                    });
2609                    tpl = tpl + '</ul>';
2610                    tpl = tpl + '</div>';
2611                } else {
2612                    tpl = '<select class="form-control">';
2613                    tpl = tpl + '<option value="">' + sdefault + '</option>';
2614                    $.each(val, function(i, v) {
2615                        tpl = tpl + '<option value="' + replaceQuote(v) + '">' + v + '</option>';
2616                    });
2617                    tpl = tpl + '</select>';
2618                }
2619                break;
2620            case 'check':
2621                tpl = '<div>';
2622                $.each(val, function(i, v) {
2623                    tpl = tpl + '<label class="checkbox-inline"><input type="checkbox" class="forms-item-check" name="' + (type + idx) + '" value="' + replaceQuote(v) + '">' + v + '</label>';
2624                });
2625                tpl = tpl + '</div>';
2626                break;
2627            case 'radio':
2628                tpl = '<div>';
2629                $.each(val, function(i, v) {
2630                    tpl = tpl + '<label class="radio-inline"><input type="radio" class="forms-item-radio" name="' + (type + idx) + '" value="' + replaceQuote(v) + '">' + v + '</label>';
2631                });
2632                tpl = tpl + '</div>';
2633                break;
2634            case 'check.image':
2635            case 'radio.image':
2636                var optionArr = val.options;
2637                let inputType = (type == 'check.image')? 'checkbox' : 'radio';
2638                tpl = '<div>';
2639                $.each(optionArr, function(i, v) {
2640                    // let hasImage = !!v.image;
2641                    tpl = tpl + `<label class="${inputType}-inline">
2642                        <div class="forms-item-image"><img class="img-responsive" src="${v.image}"></div>
2643                        <div><input type="${inputType}" class="forms-item-check" name="${type + idx}" value="${replaceQuote(v.label)}"><span>${v.label}</span></div>
2644                    </label>`;
2645                });
2646                tpl = tpl + '</div>';
2647                break;
2648            case 'date':
2649                tpl = '<div>';
2650                tpl = tpl + '<input class="form-control form-date date-ymd" type="text" readonly placeholder="' + datePlaceholder + '"/><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
2650<path d="M18.92 7.48s-.02-.08-.04-.12c-.2-.58-.66-1.04-1.24-1.24-.04-.01-.08-.03-.12-.04-.17-.05-.35-.08-.52-.08h-1V5c0-.55-.45-1-1-1s-1 .45-1 1v1h-4V5c0-.55-.45-1-1-1s-1 .45-1 1v1H7c-.18 0-.35.03-.52.08-.04.01-.08.02-.12.04-.58.2-1.04.66-1.24 1.24A1.876 1.876 0 0 0 5 8v10c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V8c0-.18-.03-.35-.08-.52M17.75 18c0 .41-.34.75-.75.75H7c-.41 0-.75-.34-.75-.75v-8h11.5zM11 15h2v2h-2zm3 0h2v2h-2zm-3-3h2v2h-2zm3 0h2v2h-2zm-6 3h2v2H8zm0-3h2v2H8z"/></svg>';
2651                tpl = tpl + '</div>';
2652                break;
2653            case 'date2':
2654                tpl = '<div>';
2655                tpl = tpl + '<input class="form-control date-ymd form-date" type="text" readonly placeholder="' + date2Placeholder + '"/><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M18.92 7.48s-.02-.08-.04-.12c-.2-.58-.66-1.04-1.24-1.24-.04-.01-.08-.03-.12-.04-.17-.05-.35-.08-.52-.08h-1V5c0-.55-.45-1-1-1s-1 .45-1 1v1h-4V5c0-.55-.45-1-1-1s-1 .45-1 1v1H7c-.18 0-.35.03-.52.08-.04.01-.08.02-.12.04-.58.2-1.04.66-1.24 1.24A1.876 1.876 0 0 0 5 8v10c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V8c0-.18-.03-.35-.08-.52M17.75 18c0 .41-.34.75-.75.75H7c-.41 0-.75-.34-.75-.75v-8h11.5zM11 15h2v2h-2zm3 0h2v2h-2zm-3-3h2v2h-2zm3 0h2v2h-2zm-6 3h2v2H8zm0-3h2v2H8z"/></svg>';
2656                tpl = tpl + '</div>';
2657                break;
2658            case 'file.upload':
2659                tpl = '<div>';
2660                tpl = tpl + '<input type="text" class="hide" value="" /><label class=""><input type="file" class="hide" />' + clSVG('paperclip', '16', '16', false, '') + $.lang[blang]['config.form.btn.attachment'] + ' <span class="file-uploaded-number">(0/10)</span></label><p class="file-title text">' + $.lang[blang]['config.form.file.attachment.none'] + '</p></div>';
2661                break;
2662            case 'file.download':
2663                tpl = '<div>';
2664                tpl = tpl + '<p class="file-title text">' + clSVG('paperclip', '16', '16', false, '') + (val[0] ? val[0] : $.lang[blang]['config.form.file.attachment.none']) + '</p>';
2665                tpl = tpl + '</div>';
2666                break;
2667        }
2668        // console.log('tpl return', tpl);
2669        return tpl;
2670    }
2671
2672    $(function() {
2673        $('.franchise-form-select.dropdown').removeClass('dropdown');
2674        $('.franchise-form-select .dropdown-toggle').removeClass('btn btn-default');
2675    });
2676
2677    function setContactFranchiseDropdownDirection($select) {
2678        var $block = $select.closest('[data-type="contact"][data-type2="franchise bar"]'),
2679            $toggle = $select.find('.dropdown-toggle').first(),
2680            $menu = $select.find('.dropdown-menu').first();
2681
2682        if ($block.length == 0 || $toggle.length == 0 || $menu.length == 0 || typeof $toggle[0].getBoundingClientRect == 'undefined') {
2683            $select.removeClass('dropup');
2684            return;
2685        }
2686
2687        var rect = $toggle[0].getBoundingClientRect(),
2688            viewportHeight = window.innerHeight || document.documentElement.clientHeight || $(window).height(),
2689            bottomSpace = viewportHeight - rect.bottom,
2690            topSpace = rect.top,
2691            menuHeight = $menu.outerHeight(),
2692            menuStyle = $menu.attr('style'),
2693            gap = 12;
2694
2695        if (menuHeight == 0) {
2696            $menu.css({'display': 'block', 'visibility': 'hidden'});
2697            menuHeight = $menu.outerHeight();
2698            if (typeof menuStyle == 'undefined') $menu.removeAttr('style');
2699            else $menu.attr('style', menuStyle);
2700        }
2701
2702        if (bottomSpace < menuHeight + gap && topSpace > bottomSpace) $select.addClass('dropup');
2703        else $select.removeClass('dropup');
2704    }
2705
2706    $(document).on('show.bs.dropdown', '[data-type="contact"][data-type2="franchise bar"] .franchise-form-select', function() {
2707        var $select = $(this),
2708            $block = $select.closest('[data-type="contact"][data-type2="franchise bar"]');
2709
2710        $block.add($block.closest('.elem-hidden')).addClass('franchise-form-select-open');
2711        setContactFranchiseDropdownDirection($select);
2712    });
2713
2714    $(document).on('hidden.bs.dropdown', '[data-type="contact"][data-type2="franchise bar"] .franchise-form-select', function() {
2715        var $select = $(this),
2716            $block = $select.closest('[data-type="contact"][data-type2="franchise bar"]');
2717
2718        $select.removeClass('dropup');
2719        $block.add($block.closest('.elem-hidden')).removeClass('franchise-form-select-open');
2720    });
2721
2722    $('.franchise-form-select .dropdown-menu a').live('click', function(e) {
2723        e.preventDefault();
2724
2725        var $option = $(this),
2726            value = $option.attr('data-value'),
2727            text = $option.text(),
2728            $select = $option.closest('.franchise-form-select');
2729
2730        $select.find('select.franchise-form-select-native').val(value).change();
2731        $select.find('.franchise-form-select-label').text(text).toggleClass('selected', value != '');
2732        $select.find('.dropdown-menu li').removeClass('active');
2733        $option.closest('li').addClass('active');
2734    });
2735
2736    function replaceQuote(str) {
2737        // str = str.replace(/\\/g, '\\\\');
2738        // str = str.replace(/\'/g, '\\\'');
2739        str = str.replace(/\"/g, '&quot;');
2740        // str = str.replace(/\0/g, '\\0');
2741        return str;
2742    }
2743
2744    function buildLargePostData(fieldName, value, data) {
2745        var chunkSize = 4000,
2746            encodedValue = JSON.stringify((typeof value == 'undefined' || value === null) ? '' : String(value)),
2747            chunkFieldName = fieldName + '_chunks',
2748            start = 0,
2749            end,
2750            code;
2751
2752        if (typeof data == 'undefined' || data === null) data = {};
2753
2754        if (encodedValue.length <= chunkSize) {
2755            data[fieldName] = encodedValue;
2756            return data;
2757        }
2758
2759        data[fieldName] = '';
2760        data[chunkFieldName] = [];
2761
2762        while (start < encodedValue.length) {
2763            end = start + chunkSize;
2764            if (end < encodedValue.length) {
2765                code = encodedValue.charCodeAt(end - 1);
2766                if (code >= 0xD800 && code <= 0xDBFF) end--;
2767            }
2768            if (end <= start) end = start + chunkSize;
2769
2770            data[chunkFieldName].push(encodedValue.substring(start, end));
2771            start = end;
2772        }
2773
2774        return data;
2775    }
2776
2777    var captchaContainer = null;
2778    var loadCaptcha = function() {
2779        $('#recaptcha').attr('data-res', '');
2780        captchaContainer = grecaptcha.render('recaptcha', {
2781            'sitekey': '6LfZjyIUAAAAAIMcTzt0XriAdVXHExtrVsNUaiHz',
2782            'callback': loadCaptchaCallback
2783        });
2784    }
2785    var loadCaptchaCallback = function(res) { $('#recaptcha').attr('data-res', res); }
2786    var recaptchCallback = function() {}
2787    var checkCaptcha = function() {
2788        var s = $('#recaptcha').attr('data-res');
2789        var res = $.post('/fm/recaptcha', { r: s }, function(data) {
2790            return data;
2791        }, 'json');
2792        return res;
2793    }
2794
2795    var load_kcaptcha = function() {
2796        $('#kcaptcha').attr('src', 'https://storage.googleapis.com/i.addblock.net/js/load_kcaptcha.gif');
2797        $('#kcaptcha').attr('title', $.lang[LANG]['page.reset-password.captcha-tip']);
2798
2799        $.ajax({
2800            type: 'POST',
2801            url: rt_path + '/check/kcaptcha/session?_' + new Date().getTime(),
2802            xhrFields: { withCredentials: true },
2803            success: function(data) {
2804                md5_norobot_key = data;
2805                var t = (new Date).getTime();
2806                setTimeout(function() {
2807                    var t = new Date().getTime();
2808                    $('#kcaptcha').attr('src', rt_path + '/check/kcaptcha/image?_=' + t);
2809                }, 100);
2810            }
2811        });
2812    }
2813
2814    var load_form_kcaptcha = function($formEL, pid) {
2815        $formEL.find('.kcaptcha-box img').attr('src', '//storage.googleapis.com/i.addblock.net/js/load_kcaptcha.gif');
2816        $.ajax({
2817            type: 'POST',
2818            url: rt_path + '/check/kcaptcha/session/' + pid + '?_' + new Date().getTime(),
2819            xhrFields: { withCredentials: true },
2820            success: function(data) {
2821                md5_norobot_pid = data;
2822                setTimeout(function() {
2823                    var t = new Date().getTime();
2824                    $formEL.find('.kcaptcha-box img').attr('src', rt_path + '/check/kcaptcha/image/' + pid + '?_=' + t);
2825                }, 100);                
2826            }
2827        });
2828    }
2829
2830    var getContactCaptchaHTML = function(blocklang) {
2831        if(!blocklang || typeof $.lang[blocklang] == 'undefined') blocklang = LANG;
2832
2833        return '\
2834            <div class="form-group form-captcha">\
2835                <div class="kcaptcha-wrap display-flex">\
2836                    <div class="kcaptcha-box">\
2837                        <img src="//storage.googleapis.com/i.addblock.net/forum/captcha_sample_Img.jpg" id="kcaptcha" alt="" title="' + $.lang[blocklang]['form.item.captcha-tip'] + '">\
2838                    </div>\
2839                    <div class="text-left kcaptcha-key-wrap">\
2840                        <input type="text" id="wr_key" name="wr_key" class="col-xs-12 col-sm-12 col-md-12 ed input-bg-opacity input-captcha" placeholder="' + $.lang[blocklang]['form.item.captcha.placeholder'] + '">\
2841                        <a href="#" class="kcaptcha-change hand small fsize12">' + $.lang[blocklang]['form.item.captcha-change'] + '</a>\
2842                    </div>\
2843                </div>\
2844            </div>\
2845        ';
2846    }
2847
2848    var setContactSubmitSecurity = function($contactEL, pid, settings, blocklang) {
2849        if(!$contactEL || $contactEL.length == 0 || $contactEL.attr('data-type') != 'contact') return;
2850        if(!settings) settings = {};
2851
2852        var submit_ip_block_use = (typeof settings.submit_ip_block_use != 'undefined' && settings.submit_ip_block_use == 'ON') ? 'ON' : 'OFF',
2853            captcha_use = (typeof settings.captcha_use != 'undefined' && settings.captcha_use == 'ON') ? 'ON' : 'OFF',
2854            check_config_mode = $('body').hasClass('mode-config') || $('.dsgn-body').hasClass('mode-config');
2855
2856        $contactEL.attr('data-submit-ip-block', submit_ip_block_use);
2857        $contactEL.attr('data-captcha', (captcha_use == 'ON' && !check_config_mode) ? 'true' : 'false');
2858        $contactEL.find('.form-captcha').remove();
2859    }
2860
2861    $('.element[data-type="form"] .form-group .view-privacy').live('click', function(){
2862        $(this).toggleClass('active');
2863        if($(this).hasClass('active')) {
2864            $(this).closest('.form-privacy').find('textarea').show();
2865        } else {
2866            $(this).closest('.form-privacy').find('textarea').hide();
2867        }
2868    });
2869
2870    $('.element[data-type="contact"][data-type2="franchise bar"] .form-group .view-privacy').live('click', function(){
2871        let $el = $(this).closest('.element');
2872        let blocklang = (typeof $el.attr('data-blocklang') != 'undefined')? $el.attr('data-blocklang') : LANG;
2873        let slang = (typeof SLANG != 'undefined' && typeof SLANG.select_code != 'undefined' && SLANG.select_code != 'ko')? 'en' : 'ko';
2874        let privacyTxt = $(this).closest('.form-privacy').find('textarea').val();
2875
2876        // if(PAGE_MODE == 'c') slang = LANG;
2877        if(!privacyTxt) privacyTxt = $.lang[blocklang]['contact.privacy.text.default'];
2878
2879        let modal_content = '<div class="textarea-container">' + privacyTxt + '</div>';
2880        $(this).showModalFlat($.lang[blocklang]['contact.consult.privacy.view.title'], modal_content, true, false, '', $.lang[slang]['config.close'], '', 'cl-cmmodal cl-s-btn cover cl-p70 cl-t80 cl-modal w560 cl-okbtn-pbt70 cl-close-btn contact-privacy-view');
2881    });
2882
2883    var loadMapDropdown = function ($el, selected, index) {
2884        if(typeof selected == 'undefined') selected = '';
2885        if(typeof index == 'undefined') index = 0;
2886        var blocklang = (typeof $el.attr('data-blocklang') != 'undefined')? $el.attr('data-blocklang') : LANG;
2887        var area0 = {
2888            [$.lang[blocklang]['contact.map.search.sido']] : '',
2889            [$.lang[blocklang]['contact.map.search.sido.1']]: '서울',
2890            [$.lang[blocklang]['contact.map.search.sido.2']]: '인천',
2891            [$.lang[blocklang]['contact.map.search.sido.3']]: '대전',
2892            [$.lang[blocklang]['contact.map.search.sido.4']]: '세종',
2893            [$.lang[blocklang]['contact.map.search.sido.5']]: '광주',
2894            [$.lang[blocklang]['contact.map.search.sido.6']]: '대구',
2895            [$.lang[blocklang]['contact.map.search.sido.7']]: '울산',
2896            [$.lang[blocklang]['contact.map.search.sido.8']]: '부산',
2897            [$.lang[blocklang]['contact.map.search.sido.9']]: '경기',
2898            [$.lang[blocklang]['contact.map.search.sido.10']]: '강원',
2899            [$.lang[blocklang]['contact.map.search.sido.11']]: '충북',
2900            [$.lang[blocklang]['contact.map.search.sido.12']]: '충남',
2901            [$.lang[blocklang]['contact.map.search.sido.13']]: '전북',
2902            [$.lang[blocklang]['contact.map.search.sido.14']]: '전남',
2903            [$.lang[blocklang]['contact.map.search.sido.15']]: '경북',
2904            [$.lang[blocklang]['contact.map.search.sido.16']]: '경남',
2905            [$.lang[blocklang]['contact.map.search.sido.17']]: '제주',
2906        };
2907        var areaObj = {
2908            area1: ["강남구","강동구","강북구","강서구","관악구","광진구","구로구","금천구","노원구","도봉구","동대문구","동작구","마포구","서대문구","서초구","성동구","성북구","송파구","양천구","영등포구","용산구","은평구","종로구","중구","중랑구"],
2909            area2: ["계양구","남구","남동구","동구","부평구","서구","연수구","중구","강화군","옹진군"],
2910            area3: ["대덕구","동구","서구","유성구","중구"],
2911            area4: ["세종시"],
2912            area5: ["광산구","남구","동구","북구","서구"],
2913            area6: ["남구","달서구","동구","북구","서구","수성구","중구","달성군"],
2914            area7: ["남구","동구","북구","중구","울주군"],
2915            area8: ["강서구","금정구","남구","동구","동래구","부산진구","북구","사상구","사하구","서구","수영구","연제구","영도구","중구","해운대구","기장군"],
2916            area9: ["고양시","과천시","광명시","광주시","구리시","군포시","김포시","남양주시","동두천시","부천시","성남시","수원시","시흥시","안산시","안성시","안양시","양주시","오산시","용인시","의왕시","의정부시","이천시","파주시","평택시","포천시","하남시","화성시","가평군","양평군","여주군","연천군"],
2917            area10: ["강릉시","동해시","삼척시","속초시","원주시","춘천시","태백시","고성군","양구군","양양군","영월군","인제군","정선군","철원군","평창군","홍천군","화천군","횡성군"],
2918            area11: ["제천시","청주시","충주시","괴산군","단양군","보은군","영동군","옥천군","음성군","증평군","진천군","청원군"],
2919            area12: ["계룡시","공주시","논산시","보령시","서산시","아산시","천안시","금산군","당진군","부여군","서천군","연기군","예산군","청양군","태안군","홍성군"],
2920            area13: ["군산시","김제시","남원시","익산시","전주시","정읍시","고창군","무주군","부안군","순창군","완주군","임실군","장수군","진안군"],
2921            area14: ["광양시","나주시","목포시","순천시","여수시","강진군","고흥군","곡성군","구례군","담양군","무안군","보성군","신안군","영광군","영암군","완도군","장성군","장흥군","진도군","함평군","해남군","화순군"],
2922            area15: ["경산시","경주시","구미시","김천시","문경시","상주시","안동시","영주시","영천시","포항시","고령군","군위군","봉화군","성주군","영덕군","영양군","예천군","울릉군","울진군","의성군","청도군","청송군","칠곡군"],
2923            area16: ["거제시","김해시","마산시","밀양시","사천시","양산시","진주시","진해시","창원시","통영시","거창군","고성군","남해군","산청군","의령군","창녕군","하동군","함안군","함양군","합천군"],
2924            area17: ["서귀포시","제주시","남제주군","북제주군"],
2925        };
2926
2927        var areaObj_en = {
2928            area1: ["Gangnam District", "Gangdong District", "Gangbuk District", "Gangseo District", "Gwanak District", "Gwangjin District", "Guro District", "Geumcheon District", "Nowon District", "Dobong District", "Dongdaemun District", "Dongjak District", "Mapo District", "Seodaemun District", "Seocho District", "Seongdong District", "Seongbuk District", "Songpa District", "Yangcheon District", "Yeongdeungpo District", "Yongsan District", "Eunpyeong District", "Jongno District", "Jung District", "Jungnang District"],
2929            area2: ["Gyeyang District", "Nam District", "Namdong District", "Dong District", "Bupyeong District", "Seo District", "Yeonsu District", "Jung District", "Ganghwa County", "Ongjin County"],
2930            area3: ["Daedeok District", "Dong District", "Seo District", "Yuseong District", "Jung District"],
2931            area4: ["Gwangsan District", "Nam District", "Dong District", "Buk District", "Seo District"],
2932            area5: ["Nam District", "Dalseo District", "Dong District", "Buk District", "Seo District", "Suseong District", "Jung District", "Dalseong County"],
2933            area6: ["Nam District", "Dong District", "Buk District", "Jung District", "Ulju County"],
2934            area7: ["Gangseo District", "Geumjeong District", "Nam District", "Dong District", "Dongnae District", "Busanjin District", "Buk District", "Sasang District", "Saha District", "Seo District", "Suyeong District", "Yeonje District", "Yeongdo District", "Jung District", "Haeundae District", "Gijang County"],
2935            area8: ["Goyang City", "Gwacheon City", "Gawngmyeong City", "Gwangju City", "Guri City", "Gunpo City", "Gimpo City", "Namyangju City", "Dongducheon City", "Bucheon City", "Seongnam City", "Suwon City", "Siheung City", "Ansan City", "Anseong City", "Anyang City", "Yangju City", "Osan City", "Yongin City", "Uiwang City", "Uijeongbu City", "Icheon City", "Paju City", "Pyeongtaek City", "Pocheon City", "Hanam City", "Hwaseong City", "Gapyeong City", "Yangpyeong County", "Yeoju County", "Yeoncheon County"],
2936            area9: ["Gangneung City", "Donghae City", "Samcheok City", "Sokcho City", "Wonju City", "Chuncheon City", "Taebaek City", "Goseong County", "Yanggu County", "Yangyang County", "Yeongwol County", "Inje County", "Jeongseon County", "Cheorwon County", "Pyeongchang County", "Hongcheon County", "Hwacheon County", "Hoengseong County"],
2937            area10: ["Jecheon City", "Cheongju City", "Chungju City", " Goesan County", "Danyang County", "Boeun County", "Yeongdong County", "Okcheon County", "Eumseong County", "Jeungpyeong County", "Jincheon County", "Cheongwon County"],
2938            area11: ["Gyeryong City", "Gongju City", "Nonsan City", "Boryeong City", "Seosan City", "Asan City", "Cheonan City", "Geumsan County", "Dangjin County", "Buyeo County", "Seocheon County", "Yeongi County", "Yesan County", "Cheongyang County", "Taean County", "Hongseong County"],
2939            area12: ["Gunsan City", "Gimje City", "Namwon City", "Iksan City", "Jeonju City", "Jeongeup City", "Gochang County", "Muju County", "Buan County", "Sunchang County", "Wanju County", "Imsil County", "Jangsu County", "Jinan County"],
2940            area13: ["Gwangyang City", "Naju City", "Mokpo City", "Suncheon City", "Yeosu City", "Gangjin County", "Goheung County", "Gokseong County", "Gurye County", "Damyang County", "Muan County", "Boseong County", "Sinan County", "Yeonggwang County", "Yeongam County", "Wando County", "Jangseong County", "Jangheung County", "Jindo County", "Hampyeong County", "Haenam County", "Hwasun County"],
2941            area14: ["Gyeongsan City", "Gyeongju City", "Gumi City", "Gimcheon City", "Mungyeong City", "Sangju City", "Andong City", "Yeongju City", "Yeongcheon City", "Pohang City", "Goryeong County", "Gunwi County", "Bonghwa County", "Seongju County", "Yeongdeok County", "Yeongyang County", "Yecheon County", "Ulleung County", "Uljin County", "Uiseong County", "Cheongdo County", "Cheongsong County", "Chilgok County"],
2942            area15: ["Geoje City", "Gimhae City", "Masan City", "Miryang City", "Sacheon City", "Yangsan City", "Jinju City", "Jinhae-gu", "Changwon City", "Tongyeong City", "Geochang County", "Goseong County", "Namhae County", "Sancheong County", "Uiryeong County", "Changnyeong County", "Hadong County", "Haman County", "Hamyang County", "Hapcheon County"],
2943            area16: ["Seogwipo City", "Jeju City", "Namjeju County", "Bukjeju County"],
2944            area17: ["Sejong City"],
2945        };
2946
2947        var sido = '';
2948        var gungu = '<li class="empty"><a href="javascript:;">' + $.lang[blocklang]['contact.map.search.gungu'] + '</a></li>';
2949
2950        var idx = 0
2951        $.each(area0, function(k, v){
2952            var active = (selected == k)? 'active' : '';  
2953            sido += '<li class="' + active + '"><a href="javascript:;" data-idx="' + idx + '" data-val="' + v + '">' + k + '</a></li>';
2954            idx ++;
2955        });
2956
2957        $el.find('.select-si-do .dropdown-menu').html(sido);
2958
2959        var area = 'area' + index;
2960        if(index > 0) {
2961            var num = 0;
2962            $.each(areaObj[area], function(k, v) {
2963                let gunguTxt = (blocklang == 'en')? areaObj_en[area][k] : v;
2964                gungu += '<li><a href="javascript:;" data-idx="' + num + '" data-val="' + v + '">' + gunguTxt + '</a></li>';
2965                num ++;
2966            });
2967        }
2968
2969        $el.find('.select-gun-gu .dropdown-menu').html(gungu);
2970    }
2971
2972    var searchByStoreAddr = function ($el, val, mode) {
2973        if(typeof mode == 'undefined') mode = '';
2974        let total = 0;
2975        let regionMap = {
2976            '충남': ['충남', '충청남도'],
2977            '충북': ['충북', '충청북도'],
2978            '전남': ['전남', '전라남도'],
2979            '전북': ['전북', '전라북도'],
2980            '경남': ['경남', '경상남도'],
2981            '경북': ['경북', '경상북도'],
2982        };
2983        let regionKeywords = regionMap[val] || [val];
2984        $el.find('.map-item-list .map-item-empty').remove();
2985
2986        $el.find('.item').each(function(idx, v){
2987            if(mode == 'gungu' && $(v).hasClass('not-result')) {
2988                return true;
2989            }
2990            var addr = $(v).attr('data-addr');
2991            let matched = regionKeywords.some(function (keyword) {
2992                return addr.indexOf(keyword) !== -1;
2993            });
2994
2995            if (!matched) {
2996                $(this).addClass('hide not-result');
2997            } else {
2998                $(this).removeClass('hide not-result');
2999                total++;
3000            }
3001        });
3002
3003        if(val) searchResultEmpty($el, total);
3004        if ($('body').width() <= 991) fmapMobilePaging($el);
3005    }
3006
3007    var searchByStorename = function ($el) {
3008        var val = $el.find('.searchby-storename input').val().trim().toLowerCase();
3009        let total = 0;
3010
3011        $el.find('.map-item-list .map-item-empty').remove();
3012        $el.find('.item').removeClass('hide not-result');
3013        
3014        if($el.find('.select-si-do .selected').length) {
3015            let selectedIdx1 = $el.find('.select-si-do .selected').attr('data-selected-idx');
3016            searchByStoreAddr($el, $el.find('.select-si-do li a[data-idx="' + selectedIdx1 + '"]').attr('data-val'));
3017
3018            if($el.find('.select-gun-gu .selected').length) {
3019                let selectedIdx2 = $el.find('.select-gun-gu .selected').attr('data-selected-idx');
3020                searchByStoreAddr($el, $el.find('.select-gun-gu li a[data-idx="' + selectedIdx2 + '"]').attr('data-val'), 'gungu');
3021            }
3022        }
3023        
3024        if(typeof val != 'undefined' && val) {
3025            $el.find('.item').each(function(idx, v){
3026                if($(v).hasClass('not-result')) {
3027                    return true;
3028                }
3029                var itemName = $(v).find('.item-name').text().toLowerCase();
3030                if(typeof itemName != 'undefined' && itemName.indexOf(val) === -1) {
3031                    $(v).addClass('hide not-result');
3032                } else {
3033                    $(v).removeClass('hide not-result');
3034                    total ++;
3035                }
3036            });
3037
3038            searchResultEmpty($el, total);
3039        }
3040        
3041        $el.find('.searchby-storename input').blur();
3042        if ($('body').width() <= 991) fmapMobilePaging($el);
3043    }
3044
3045    var searchResultEmpty = function ($el, total) {
3046        let blocklang = ($el.attr('data-blocklang'))? $el.attr('data-blocklang') : LANG;
3047        let emptyHTML = '<div class="map-item-empty">' + $.lang[blocklang]['contact.map.search.results.empty'] + '</div>';
3048        let searchCnt = $el.find('.map-item-list .item:not(.hide)').length;
3049
3050        if(total == 0) {
3051            $el.find('.map-item-list .map-item-empty').remove();
3052            $el.find('.map-item-list').append(emptyHTML);
3053        }
3054    }
3055
3056    $('[data-type="contact"][data-type2="franchise map"] .select-si-do .dropdown-toggle').live('click', function(e){
3057        e.preventDefault();
3058
3059        var $el = $(this).closest('.element');
3060        var $btn = $(this).find('span');
3061        var val = $(this).find('span').text();
3062        var idx = ($btn.attr('data-selected-idx'))? $btn.attr('data-selected-idx') : 0;
3063        loadMapDropdown($el, val, idx);
3064    });
3065
3066    $('[data-type="contact"][data-type2="franchise map"] .select-si-do li a').live('click', function(e){
3067        var $el = $(this).closest('.element');
3068        var $btn = $(this).closest('.dropdown').find('button.dropdown-toggle > span');
3069        var idx = $(this).attr('data-idx');
3070        var val = $(this).attr('data-val');
3071        var valTxt = $(this).text();
3072        var blocklang = (typeof $el.attr('data-blocklang') != 'undefined')? $el.attr('data-blocklang') : LANG;
3073
3074        $(this).closest('.map-search').find('.select-gun-gu .dropdown-toggle > span').removeClass('selected');
3075        $(this).closest('.map-search').find('.select-gun-gu .dropdown-toggle > span').text($.lang[blocklang]['contact.map.search.gungu']);
3076
3077        $el.find('.searchby-storename input').val('');
3078        $btn.text(valTxt);
3079
3080        $el.find('.item').removeClass('hide not-result');
3081        $btn.removeClass('selected');
3082
3083        if(typeof val != 'undefined' && val) {
3084            $btn.addClass('selected');
3085            $btn.attr('data-selected-idx', idx);
3086            searchByStoreAddr($el, val);
3087        } else {
3088            $el.find('.map-item-list .map-item-empty').remove();
3089            $el.find('.item').removeClass('hide not-result');
3090            if ($('body').width() <= 991) fmapMobilePaging($el);
3091        }
3092
3093        loadMapDropdown($el, val, $(this).attr('data-idx'));
3094    });
3095
3096    $('[data-type="contact"][data-type2="franchise map"] .select-gun-gu .dropdown-toggle').live('click', function(e){
3097        e.preventDefault();
3098
3099        var $el = $(this).closest('.element');
3100        var blocklang = (typeof $el.attr('data-blocklang') != 'undefined')? $el.attr('data-blocklang') : LANG;
3101        
3102        if($el.find('.select-si-do .selected').length == 0) {
3103            $el.find('.select-gun-gu .dropdown-menu').html('<li class="empty"><a href="javascript:;">' + $.lang[blocklang]['contact.map.search.gungu'] + '</a></li>');
3104        }
3105    });
3106
3107    $('[data-type="contact"][data-type2="franchise map"] .select-gun-gu li a').live('click', function(e){
3108        var $el = $(this).closest('.element');
3109        var $li = $(this).closest('li');
3110        var $btn = $(this).closest('.dropdown').find('button.dropdown-toggle > span');
3111        var idx = $(this).attr('data-idx');
3112        var val = $(this).attr('data-val');
3113        var valTxt = $(this).text();
3114
3115        $el.find('.searchby-storename input').val('');
3116        $btn.text(valTxt);
3117        $btn.removeClass('selected');
3118        // console.log('gungu', val, $el.find('.select-si-do .selected'));
3119        // if(typeof val != 'undefined' && val) {
3120        //     $btn.addClass('selected');
3121        //     $btn.attr('data-selected-idx', idx);
3122        //     searchByStoreAddr($el, val);
3123        // } else {
3124        //     if($el.find('.select-si-do .selected')) {
3125        //         let selectedIdx = $('.select-si-do .selected').attr('data-selected-idx');
3126        //         searchByStoreAddr($el, $el.find('.select-si-do li a[data-idx="' + selectedIdx + '"]').attr('data-val'));
3127        //     } else {
3128        //         $el.find('.item').removeClass('hide not-result');                
3129        //     }
3130        // }
3131        if($el.find('.select-si-do .selected').length) {
3132            let selectedIdx = $('.select-si-do .selected').attr('data-selected-idx');
3133            searchByStoreAddr($el, $el.find('.select-si-do li a[data-idx="' + selectedIdx + '"]').attr('data-val'));
3134
3135            if(typeof val != 'undefined' && val) {
3136                $btn.addClass('selected');
3137                $btn.attr('data-selected-idx', idx);
3138                if(selectedIdx != '4') searchByStoreAddr($el, val, 'gungu');
3139            }
3140        } else {
3141            $el
3141.find('.map-item-list .map-item-empty').remove();
3142            $el.find('.item').removeClass('hide not-result');
3143            if ($('body').width() <= 991) fmapMobilePaging($el);
3144        }
3145    });
3146
3147    $('[data-type="contact"][data-type2="franchise map"] .searchby-storename input[type="text"]').live('keyup', function(e){
3148        if(e.keyCode == 13) {
3149            var $el = $(this).closest('.element');
3150            searchByStorename($el);
3151        }
3152    });
3153    $('[data-type="contact"][data-type2="franchise map"] .searchby-storename .map-search-btn').live('click', function(e){
3154        var $el = $(this).closest('.element');
3155        searchByStorename($el);
3156    });
3157
3158    $('[data-type="contact"][data-type2="franchise map"] .map-item-list > .item:not(.selected)').live('click', function(){
3159        var $el = $(this).closest('.element');
3160        var mapKind = $(this).attr('data-map_kind');
3161        $el.find('.map-item-list > .item').removeClass('selected');
3162        $(this).addClass('selected');
3163
3164        drawMap($(this), $el);
3165
3166        if($el.find('.map-info').length > 0) {
3167            var idx = (typeof $(this).attr('data-idx') == 'undefined')? 0 : $(this).attr('data-idx');
3168            // console.log('idx', idx);
3169            $el.find('.map-info').addClass('hide');
3170            $el.find('.map-info[data-idx="'+idx+'"]').removeClass('hide');
3171        }
3172    });
3173
3174    var drawMap = function($item, $el){
3175        var iVALIDPLAN = (PAGE_MODE == 'c') ? VALIDPLAN : property.VALIDPLAN;
3176        var id = $el.attr('data-id');
3177        var mapKind = $item.attr('data-map_kind');
3178        var zoomInOut = $item.attr('data-zoominout');
3179        var mapTitle = $item.attr('data-maptitle');
3180        var mapContent = $item.attr('data-mapcontent');
3181        var useTitle = $item.attr('data-usetitle');
3182        var useContent = $item.attr('data-usecontent');
3183        var lat = $item.attr("data-lat");
3184        var lng = $item.attr("data-lng");
3185        var zoom = $item.attr("data-zoom");
3186
3187        if(typeof zoomInOut == 'undefined' || !zoomInOut) zoomInOut = false;
3188        if(typeof zoom == 'undefined' || !zoom) zoom = 17;
3189        if(typeof mapTitle == 'undefined' || !mapTitle) mapTitle = '';
3190        if(typeof mapContent == 'undefined' || !mapContent) mapContent = '';
3191        if(typeof useTitle == 'undefined' || !useTitle) useTitle = false;
3192        if(typeof useContent == 'undefined' || !useContent) useContent = false;
3193
3194        zoomInOut = JSON.parse(zoomInOut);
3195        useTitle = JSON.parse(useTitle);
3196        useContent = JSON.parse(useContent);
3197
3198        $el.find('.map-wrap').html('<div id="map-container-'+id+'" class="map-container"></div>')
3199
3200        $el.find('.map-container').attr('data-map_kind', mapKind);
3201        $el.find('.map-container').attr('data-zoominout', zoomInOut);
3202        $el.find('.map-container').attr('data-maptitle', mapTitle);
3203        $el.find('.map-container').attr('data-mapcontent', mapContent);
3204        $el.find('.map-container').attr('data-usetitle', useTitle);
3205        $el.find('.map-container').attr('data-usecontent', useContent);
3206
3207        var container = 'map-container-'+id;
3208
3209        switch(mapKind) {
3210            case 'google':
3211                var mapUrl = $item.attr('data-map_url');
3212                var map_set = (mapUrl.match(/^@/) !== null) ? 'html' : 'link';
3213                var map_iframe = '';
3214                if(map_set == 'html') {
3215                    map_iframe = decodeURIComponent(atob(mapUrl.replace(/^@/,'')));
3216                    console.log(map_iframe);
3217                } else {
3218                    map_iframe = getMapURL(mapUrl, 'html');
3219                }
3220                $el.find('.map-wrap').html(map_iframe);
3221                break;
3222            case 'kakao':
3223                if($el.find('.map-container[data-map_kind="kakao"]').length && (typeof kakao == 'undefined' || typeof kakao.maps == 'undefined' || kakao.maps == null || iVALIDPLAN == '')) {
3224                    $el.find('.map-wrap').html('지도연결해제됨. Javascript키 확인');
3225                    $el.find('.map-wrap').html('<iframe class="google-map" src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3165.5659473821083!2d127.0282496015659!3d37.494568!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x357ca1598c361b2b%3A0xdbf9af292beff3c!2z6rCV64Ko!5e0!3m2!1sko!2skr!4v1637303748377!5m2!1sko!2skr" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy"></iframe>');
3226                } else {
3227                    var options = { center: new kakao.maps.LatLng(lat, lng), level: 3};
3228                    var c_map = new kakao.maps.Map($('#' + container).get(0), options);
3229                    var marker = new kakao.maps.Marker({ position: new kakao.maps.LatLng(lat, lng), map: c_map});
3230
3231                    if(zoomInOut == true) {
3232                        var zoomControlHtml = '';
3233                        zoomControlHtml += '\
3234                            <div class="zoom-control" style="margin-top: 8px; margin-right: 8px; right: 0; width: 30px; position: absolute; background-color: #fff; z-index: 1; border-radius: 3px; box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.16);">\
3235                                <div class="btn-zoom-control" data-inout="I" style="cursor: pointer; width: 30px; height: 30px;">\
3236                                    <svg style="fill: #6b6b6b; margin: 3px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
3236<path d="M17 11h-4V7c0-.55-.45-1-1-1s-1 .45-1 1v4H7c-.55 0-1 .45-1 1s.45 1 1 1h4v4c0 .55.45 1 1 1s1-.45 1-1v-4h4c.55 0 1-.45 1-1s-.45-1-1-1z"/></svg>\
3237                                </div>\
3238                                <div class="slider-wrap-container" style="height: 130px;">\
3239                                    <div class="slider-wrap small" style="text-align: center; height: 100%;">\
3240                                        <div style="max-height: 100%;" class="zoom-control-slider"></div>\
3241                                    </div>\
3242                                </div>\
3243                                <div class="btn-zoom-control" data-inout="O" style="cursor: pointer; width: 30px; height: 30px;">\
3244                                    <svg style="fill: #6b6b6b; margin: 3px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M17 13H7c-.55 0-1-.45-1-1s.45-1 1-1h10c.55 0 1 .45 1 1s-.45 1-1 1z"/></svg>\
3245                                </div>\
3246                            </div>\
3247                        ';
3248                        var $zoomController = $(zoomControlHtml);
3249                        $('#' + container).append($zoomController);
3250                        var zoom_slider = $zoomController.find('.zoom-control-slider').slider({
3251                            'orientation': 'vertical',
3252                            'min' : 1,
3253                            'max' : 14,
3254                            'step' : 1,
3255                            'value' : 3,
3256                            'handle' : 'square',
3257                            'tooltip' : 'hide',
3258                        }).on('slide', function(data) {
3259                            c_map.setLevel(data.value);
3260                            c_map.setCenter(marker.getPosition());
3261                        }).on('slideStop', function(data) {
3262                            c_map.setLevel(data.value);
3263                            c_map.setCenter(marker.getPosition());
3264                        });
3265
3266                        $zoomController.find('.btn-zoom-control').on('click', function() {
3267                            if($(this).data('inout') == 'I') {
3268                                c_map.setLevel(c_map.getLevel() - 1);
3269                                zoom_slider.slider('setValue', c_map.getLevel());
3270                            } else if($(this).data('inout' == 'O')) {
3271                                c_map.setLevel(c_map.getLevel() + 1);
3272                                zoom_slider.slider('setValue', c_map.getLevel());
3273                            }
3274                        });
3275
3276                        kakao.maps.event.addListener(c_map, 'zoom_changed', function() {
3277                            zoom_slider.slider('setValue', c_map.getLevel());
3278                        });
3279                    }
3280                        
3281                    if(useTitle == true || useContent == true) {
3282                        var iwContent = '';
3283
3284                        if(!mapTitle) mapTitle = $.lang[LANG]['config.contact.map.placeholder.place'];
3285                        if(!mapContent) mapContent = $.lang[LANG]['config.contact.map.placeholder.content'];
3286
3287                        if(useTitle == true) {
3288                            iwContent = '<div class="title">' + mapTitle + '</div>';
3289                        }
3290                        if(useContent == true) {
3291                            iwContent += '<div class="content">' + mapContent + '</div>';
3292                        }
3293                        // console.log('iwContent', iwContent);
3294                        if(iwContent) {
3295                            iwContent = '<div class="contact-map-info-window"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path d="M8 0C4.69 0 2 2.69 2 6s1 4 6 10c5-6 6-6.69 6-10s-2.69-6-6-6zm0 8.3a2.3 2.3 0 1 1 0-4.6 2.3 2.3 0 0 1 0 4.6z"/></svg>' + iwContent + '</div>';
3296                            var infoWindow = $(iwContent);
3297                            $('#' + container).append(infoWindow);
3298                        }
3299                    }
3300
3301                    $(window).on("resize", function() {
3302                        c_map.setCenter(marker.getPosition());
3303                    });
3304                    c_map.relayout();
3305                }
3306                break;
3307            case 'naver':
3308                if($el.find('.map-container[data-map_kind="naver"]').length && (typeof naver == 'undefined' || typeof naver.maps == 'undefined' || naver.maps == null || iVALIDPLAN == '')) {
3309                    $el.find('.map-wrap').html('지도연결해제됨. Client ID 확인');
3310                    $el.find('.map-wrap').html('<iframe class="google-map" src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3165.5659473821083!2d127.0282496015659!3d37.494568!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x357ca1598c361b2b%3A0xdbf9af292beff3c!2z6rCV64Ko!5e0!3m2!1sko!2skr!4v1637303748377!5m2!1sko!2skr" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy"></iframe>');
3311                } else {       
3312                    var options = { center: new naver.maps.LatLng(lat, lng), zoom: 17};
3313                    var c_map = new naver.maps.Map(container, options);
3314                    var marker = new naver.maps.Marker({ position: new naver.maps.LatLng(lat, lng), map: c_map});
3315
3316                    if(zoomInOut == true) {
3317                        var zoomControlHtml = '';
3318                        zoomControlHtml += '\
3319                            <div class="zoom-control" style="margin-top: 8px; margin-right: 8px; right: 0; width: 30px; position: absolute; background-color: #fff; z-index: 1; border-radius: 3px; box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.16);">\
3320                                <div class="btn-zoom-control" data-inout="I" style="cursor: pointer; width: 30px; height: 30px;">\
3321                                    <svg style="fill: #6b6b6b; margin: 3px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
3321<path d="M17 11h-4V7c0-.55-.45-1-1-1s-1 .45-1 1v4H7c-.55 0-1 .45-1 1s.45 1 1 1h4v4c0 .55.45 1 1 1s1-.45 1-1v-4h4c.55 0 1-.45 1-1s-.45-1-1-1z"/></svg>\
3322                                </div>\
3323                                <div class="slider-wrap-container" style="height: 130px;">\
3324                                    <div class="slider-wrap small" style="text-align: center; height: 100%;">\
3325                                        <div style="max-height: 100%;" class="zoom-control-slider"></div>\
3326                                    </div>\
3327                                </div>\
3328                                <div class="btn-zoom-control" data-inout="O" style="cursor: pointer; width: 30px; height: 30px;">\
3329                                    <svg style="fill: #6b6b6b; margin: 3px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M17 13H7c-.55 0-1-.45-1-1s.45-1 1-1h10c.55 0 1 .45 1 1s-.45 1-1 1z"/></svg>\
3330                                </div>\
3331                            </div>\
3332                        ';
3333                        var $zoomController = $(zoomControlHtml);
3334                        $('#' + container).append($zoomController);
3335                        var zoom_slider = $zoomController.find('.zoom-control-slider').slider({
3336                            'orientation': 'vertical',
3337                            'min' : 6,
3338                            'max' : 21,
3339                            'step' : 1,
3340                            'value' : zoom,
3341                            'handle' : 'square',
3342                            'reversed' : true,
3343                            'tooltip' : 'hide',
3344                        }).on('slide', function(data) {
3345                            c_map.setZoom(data.value);
3346                            c_map.setCenter(marker.getPosition());
3347                        }).on('slideStop', function(data) {
3348                            c_map.setZoom(data.value);
3349                            c_map.setCenter(marker.getPosition());
3350                        });
3351                        $zoomController.find('.btn-zoom-control').on('click', function() {
3352                            if($(this).data('inout') == 'I') {
3353                                c_map.setZoom(c_map.getZoom() + 1);
3354                                zoom_slider.slider('setValue', c_map.getZoom());
3355                            } else if($(this).data('inout' == 'O')) {
3356                                c_map.setZoom(c_map.getZoom() - 1);
3357                                zoom_slider.slider('setValue', c_map.getZoom());
3358                            }
3359                        });
3360
3361                        naver.maps.Event.addListener(c_map, 'zoom_changed', function(zoom) {
3362                            zoom_slider.slider('setValue', c_map.getZoom());
3363                        });
3364                    }
3365
3366                    if(useTitle == true || useContent == true) {
3367                        var iwContent = '';
3368                        
3369                        if(!mapTitle) mapTitle = $.lang[LANG]['config.contact.map.placeholder.place'];
3370                        if(!mapContent) mapContent = $.lang[LANG]['config.contact.map.placeholder.content'];
3371
3372                        if(useTitle == true) {
3373                            iwContent = '<div class="title">' + mapTitle + '</div>';
3374                        }
3375                        if(useContent == true) {
3376                            iwContent += '<div class="content">' + mapContent + '</div>';
3377                        }
3378
3379                        if(iwContent) {
3380                            iwContent = '<div class="contact-map-info-window"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path d="M8 0C4.69 0 2 2.69 2 6s1 4 6 10c5-6 6-6.69 6-10s-2.69-6-6-6zm0 8.3a2.3 2.3 0 1 1 0-4.6 2.3 2.3 0 0 1 0 4.6z"/></svg>' + iwContent + '</div>';
3381                            var infoWindow = $(iwContent);
3382                            $('#' + container).append(infoWindow);
3383                            // infoWindow.css('bottom', 'calc(-100% + ' + (infoWindow.outerHeight() + 36) + 'px)');  
3384                        }
3385                    }
3386                    $(window).on("resize", function() {
3387                        c_map.setCenter(marker.getPosition());
3388                    });
3389                }
3390                break;
3391        }
3392    }
3393
3394    var setDefaultFranchiseMap = function($el) {
3395        let blocklang = (typeof $el.attr('data-blocklang') != 'undefined')? $el.attr('data-blocklang') : LANG;
3396        $el.find('.map-search-dropdown .dropdown-menu').html('');
3397        $el.find('.map-search-dropdown .dropdown-toggle > span').removeClass('selected');
3398        $el.find('.select-si-do .dropdown-toggle > span').text($.lang[blocklang]['contact.map.search.sido']);
3399        $el.find('.select-gun-gu .dropdown-toggle > span').text($.lang[blocklang]['contact.map.search.gungu']);
3400        $el.find('.searchby-storename input').val('');
3401
3402        $el.find('.map-item-list > .item').removeAttr('style');
3403        $el.find('.map-item-list >
3403 .item').removeClass('__matrix_focus');
3404        $el.find('.map-item-list > .item').removeClass('hide');
3405        $el.find('.map-item-list > .item').removeClass('selected');
3406        $el.find('.map-item-list > .item').eq(0).addClass('selected');
3407        $el.find('.map-item-list .map-item-empty').remove();
3408
3409        if($el.find('.map-info').length > 0) {
3410            $el.find('.map-info').addClass('hide');
3411            $el.find('.map-info').eq(0).removeClass('hide');
3412        }
3413
3414        drawMap($el.find('.map-item-list > .item').eq(0), $el);
3415    }
3416
3417    var paginatedItems = new Array();
3418    var fmapMobilePaging = function($el) { //init
3419        var $items = $el.find('[data-fmap-loop="true"] > .item:not(.not-result)');
3420        var itemArr = $items.get();
3421        var itemsPerPage = ($('body').width() <= 767)? 3 : 8;
3422        // console.log('itemArr', itemArr);
3423        if($('body').width() <= 767) {
3424            if($el.find('[data-fmap-loop="true"]').attr('data-view-m')) itemsPerPage = $el.find('[data-fmap-loop="true"]').attr('data-view-m') * 1;
3425        } else if($('body').width() <= 991) {
3426            if($el.find('[data-fmap-loop="true"]').attr('data-view-t')) itemsPerPage = $el.find('[data-fmap-loop="true"]').attr('data-view-t') * 1;
3427        } else {
3428            $items.removeClass('hide');
3429        }
3430        // console.log('itemsPerPage', itemsPerPage);
3431
3432        // 전체 페이지 수 계산
3433        var totalPages = Math.ceil(itemArr.length / itemsPerPage);
3434
3435        // console.log('totalPages', totalPages);
3436        if ($('body').width() <= 991) {
3437
3438            if(totalPages > 1) {
3439                // 배열을 페이지당 나누기
3440                var pageNumHTML = '';
3441                var elname = $el.attr('data-name');
3442                paginatedItems[elname] = [];
3443                // console.log(paginatedItems);
3444                for (var i = 0; i < totalPages; i++) {
3445                    var start = i * itemsPerPage;
3446                    var end = start + itemsPerPage;
3447                    // console.log(start, end);
3448                    paginatedItems[elname].push(itemArr.slice(start, end));
3449                }
3450
3451                var endPage = paginatedItems[elname].length - 1;
3452                // console.log('paginatedItems[elname]', paginatedItems[elname]);
3453                $.each(paginatedItems[elname], function(idx, v){
3454                    var pageNum = idx + 1;
3455                    pageNumHTML += '<li class="' + (pageNum == 1? 'active' : (pageNum > 5? 'hide' : '')) + '" data-item-page="' + idx + '">'+pageNum+'</li>'
3456                });
3457
3458                var paginationHTML = '\
3459                <ul class="display-flex align-items-center">\
3460                    <li class="go-start disabled" data-item-page="0"><i class="fa fa-angle-double-left" aria-hidden="true"></i></li>\
3461                    <li class="go-prev disabled" data-item-page="prev"><i class="fa fa-angle-left" aria-hidden="true"></i></li>\
3462                    ' + pageNumHTML + '\
3463                    <li class="go-next" data-item-page="next"><i class="fa fa-angle-right" aria-hidden="true"></i></li>\
3464                    <li class="go-end" data-item-page="' + endPage + '"><i class="fa fa-angle-double-right" aria-hidden="true"></i></li>\
3465                </ul>\
3466                ';
3467
3468                $el.find('.m-map-pagination').html(paginationHTML);
3469
3470                $items.addClass('hide');
3471                $.each(paginatedItems[elname][0], function(idx, v){
3472                    $(v).removeClass('hide');
3473                });
3474            } else {
3475                $el.find('.m-map-pagination').html('');
3476            }
3477
3478            $('.m-map-pagination > ul > li:not(.disabled)').die('click');
3479            $('.m-map-pagination > ul > li:not(.disabled)').live('click', function(){
3480                let $this = (typeof isElviewPage != 'undefined' && isElviewPage === true)? $(this).closest('.el_viewblock') : $(this).closest('.element');
3481                let page = $(this).attr('data-item-page');
3482                let currentElName = $this.attr('data-name');
3483                let endPage = $this.find('li.go-end').attr('data-item-page') * 1;
3484                let activated = $this.find('.m-map-pagination > ul > li.active').attr('data-item-page') * 1;
3485                let currentItems = new Array();
3486
3487                $this.find('.m-map-pagination > ul > li').removeClass('active');
3488                $this.find('.m-map-pagination > ul > li').removeClass('disabled');
3489
3490                if(isNaN(activated)) activated = endPage;
3491                // console.log(activated, endPage, paginatedItems[currentElName]);
3492                switch (page) {
3493                    case 'prev':
3494                        if(activated > 0) {
3495                            page = activated - 1;
3496                        } else {
3497                            page = 0;
3498                        }
3499                        break;
3500                    case 'next':
3501                        if(activated < endPage) {
3502                            page = activated + 1;
3503                        } else {
3504                            page = endPage;
3505                        }
3506                        break;
3507                    default:
3508                        page = page * 1;
3509                        break;
3510                }
3511
3512                if(page == 0) {
3513                    $this.find('.m-map-pagination > ul > li.go-start').addClass('disabled');
3514                    $this.find('.m-map-pagination > ul > li.go-prev').addClass('disabled');
3515                }
3516                if(page >= 4) {
3517                    $this.find('.m-map-pagination > ul >
3517 li:not(.go-start):not(.go-end):not(.go-prev):not(.go-next)').addClass('hide');
3518                    $this.find('.m-map-pagination > ul > li[data-item-page="' + (page - 2) + '"]').removeClass('hide');
3519                    $this.find('.m-map-pagination > ul > li[data-item-page="' + (page - 1) + '"]').removeClass('hide');
3520                    $this.find('.m-map-pagination > ul > li[data-item-page="' + page + '"]').removeClass('hide');
3521                    $this.find('.m-map-pagination > ul > li[data-item-page="' + (page + 1) + '"]').removeClass('hide');
3522                    $this.find('.m-map-pagination > ul > li[data-item-page="' + (page + 2) + '"]').removeClass('hide');
3523                } else {
3524                    $this.find('.m-map-pagination > ul > li:not(.go-start):not(.go-end):not(.go-prev):not(.go-next)').addClass('hide');
3525                    $this.find('.m-map-pagination > ul > li[data-item-page="0"]').removeClass('hide');
3526                    $this.find('.m-map-pagination > ul > li[data-item-page="1"]').removeClass('hide');
3527                    $this.find('.m-map-pagination > ul > li[data-item-page="2"]').removeClass('hide');
3528                    $this.find('.m-map-pagination > ul > li[data-item-page="3"]').removeClass('hide');
3529                    $this.find('.m-map-pagination > ul > li[data-item-page="4"]').removeClass('hide');
3530                }
3531                if(page == endPage) {
3532                    $this.find('.m-map-pagination > ul > li.go-end').addClass('disabled');
3533                    $this.find('.m-map-pagination > ul > li.go-next').addClass('disabled');
3534                }
3535
3536                currentItems = paginatedItems[currentElName][page];
3537                // console.log('currentItems', page, currentItems);
3538                $this.find('[data-fmap-loop="true"] > .item').addClass('hide');
3539                if(typeof currentItems != 'undefined') {
3540                    $.each(currentItems, function(idx, v){
3541                        // console.log($(v));
3542                        $(v).removeClass('hide');
3543                    });
3544                }
3545
3546                $this.find('.m-map-pagination > ul > li[data-item-page="' + page + '"]:not(.go-start):not(.go-end)').addClass('active');
3547            });
3548        }
3549    }
3550
3551    $('#comm-name,#comm-pass').live('blur', function(e) {
3552        if ($(this).hasClass('guestbook-pass')) return false;
3553        window.scrollTo(0, 0);
3554    });
3555    var getLocation = function(url) {
3556        var parser = document.createElement('a');
3557        parser.href = url;
3558        parser.href = parser.href;
3559
3560        if (parser.host === '') {
3561            var newProtocolAndHost = window.location.protocol + '//' + window.location.host;
3562            if (url.charAt(1) === '/') {
3563                parser.href = newProtocolAndHost + url;
3564            } else {
3565                var currentFolder = ('/' + parser.pathname).match(/.*\//)[0];
3566                parser.href = newProtocolAndHost + currentFolder + url;
3567            }
3568        }
3569        var properties = ['host', 'hostname', 'hash', 'href', 'port', 'protocol', 'search'];
3570        for (var i = 0, n = properties.length; i < n; i++) {
3571            this[properties[i]] = parser[properties[i]];
3572        }
3573        this.pathname = (parser.pathname.charAt(0) !== '/' ? '/' : '') + parser.pathname;
3574    }
3575
3576
3577    var setResizeImageFolder = function(w, content_image) {
3578        var magic_type = (PAGE_MODE == 'c') ? SETTINGS.magic_type : property.SETTINGS.magic_type,
3579            check_magic_type = (typeof magic_type != 'undefined' && magic_type == 'webp') ? true : false;
3580        t = (check_magic_type) ? '-rw' : '';
3581
3582        var r = '';
3583        if (content_image && content_image.lastIndexOf('=') > -1) {
3584            var image_index = content_image.lastIndexOf('=');
3585            content_image = content_image.substr(0, image_index);
3586
3587            switch (w) {
3588
3589                case "0":
3590                    r = content_image + '=s0' + t;
3591                    break;
3592                case "60":
3593                    r = content_image + '=w60-h60-n' + t;
3594                    break;
3595                case "250":
3596                    r = content_image + '=w250-h250-n' + t;
3597                    break;
3598                case "300":
3599                    r = content_image + '=w300-h300-n' + t;
3600                    break;
3601                case "600":
3602                    r = content_image + '=w600-h600-n' + t;
3603                    break;
3604                case "650":
3605                    r = content_image + '=w650-h370-n' + t;
3606                    break;
3607                case "670":
3608                    r = content_image + '=w670-h980-n' + t;
3609                    break;
3610                case "700":
3611                    r = content_image + '=w700-h500-n' + t;
3612                    break;
3613                case "800":
3614                    r = content_image + '=w800' + t;
3615                    break;
3616                    //case "1920": break;
3617                default:
3618                    r = content_image;
3619                    break;
3620            }
3621        }
3622
3623        return r;
3624    }
3625
3626    function changeLanguage(code, mode) {
3627        var isSYNC = false;
3628
3629        if (typeof mode != 'undefined' && typeof mode == 'object') isSYNC = false;
3630        else isSYNC = (typeof mode != 'undefined' && mode && mode.match(/^sync_/gi) !== null) ? true : false;
3631        var sid = (typeof SID == 'undefined') ? property.SID : SID;
3632        var type = '';
3633
3634        if (typeof mode == 'undefined') {
3635            type = (typeof property !== 'undefined' && property.LOAD == 'RENDER') ? 'render' : 'publish';
3636        } else if (typeof mode == 'object') {
3637            type = 'board';
3638        } else {
3639            type = 'config';
3640
3641            if (isSYNC) type = mode.replace(/^sync_/gi, '');
3642        }
3643
3644        $.post('/language/' + code, { sid: sid, type: type }, function(data) {
3645            if (isSYNC) {
3646                // console.log('change language');
3647                return false;
3648            } else {
3649                if (typeof mode == 'undefined') {
3650                    if (typeof property !== 'undefined' && property.LOAD == 'RENDER') location.href = '/render';
3651                    else location.href = '/';
3652                } else if (typeof mode == 'object') {
3653                    var url = $(mode).attr('data-url');
3654                    var checkDashboard = '/dashboard';
3655                    if (window.location.href.indexOf(checkDashboard) > -1) { //dashboard         
3656                        window.open(url, '_blank').focus();
3657                    } else {
3658                        location.href = url;
3659                    }
3660                } else {
3661                    if (mode == 'end_config') {
3662                        console.log('change language');
3663                        return false;
3664                    }
3665                    location.href = '/' + CONFIG_URL + 'config';
3666                }
3667            }
3668        }, 'json');
3669    }
3670
3671
3672    $(document).on('click', '.bizcommpop-open', function(e) {
3673        var url = 'http://www.ftc.go.kr/bizCommPop.do?wrkr_no=1148687877';
3674        window.open(url, 'bizCommPop', 'width=750, height=700;');
3675    });
3676
3677
3678    function setMadeWithCreatorlink() {
3679        var s_service = (typeof SERVICE == 'undefined') ? ((typeof property == 'undefined') ? '' : property.SERVICE) : SERVICE,
3680            s_plantype = (typeof VALIDTYPE == 'undefined') ? ((typeof property == 'undefined') ? '' : property.VALIDTYPE) : VALIDTYPE;
3681
3682        var checkGabia = (s_service.indexOf('gabia') > -1) ? true : false,
3683            made_width = (checkGabia && LANG == 'ko') ? 'w-2' : '',
3684            go_to_link = (checkGabia) ? 'http://creatorlink-gabia.com' : 'http://creatorlink.net?utm_source=FreeSite&utm_medium=banner&utm_campaign=powered_by_Creatorlink&utm_term=sitebanner&utm_content=free',
3685            go_to_txt = (checkGabia) ? 'footer.made-mark.description.gabia' : 'footer.made-mark.description',
3686            made_txt = $.lang[LANG]['footer.made-mark.description.title'];
3687        // upgrade_href = (checkGabia) ? 'href="https://www.gabia.com/mygabia/service" target="_blank"' : 'href="/upgrade/site/"';
3688
3689        if ($('.dsgn-body').find('.made-with-creatorlink').length > 0) {
3690            $('.dsgn-body').find('.made-with-creatorlink').show().attr('style', 'display: block!important');
3691        } else {
3692            var svg_logo = '<svg class="made-with-creatorlink-logo logo-b logo-p" alt="Creatorlink logo" role="img" viewBox="0 0 168 38"><path class="st11" d="M70.71 12.36c-3.48 0-5.9 2.19-5.9 5.34v4.11c0 3.34 2.17 5.25 5.96 5.25 2.06 0 3.98-0.58 5.41-1.64l0.14-0.11 -1.03-1.95 -0.2 0.1c-1.67 0.85-2.74 1.15-4.11 1.15 -2.23 0-3.23-0.87-3.23-2.83v-0.94h8.62v-3.08C76.37 14.13 74.52 12.36 70.71 12.36zM73.52 18.45h-5.77v-0.92c0-1.91 1.53-2.78 2.96-2.78 2.02 0 2.81 0.78 2.81 2.78V18.45z"></path><path class="st11" d="M84.38 12.36c-1.52 0-3.34 0.55-4.87 1.47l-0.17 0.1 1.11 1.95 0.19-0.1c1.41-0.69 2.48-0.98 3.59-0.98 2.22 0 2.93 0.51 2.93 2.1v1.29h-3.64c-3.09 0-4.65 1.47-4.65 4.37 0 1.22 0.39 2.33 1.09 3.12 0.76 0.85 1.84 1.3 3.12 1.3 0.09 0 0.18 0 0.26-0.01 1.37-0.06 2.71-0.51 3.97-0.99l0.04 0.79h2.76v-9.76C90.11 13.76 88.39 12.36 84.38 12.36zM87.17 23.79l-0.01 0c-0.83 0.32-1.87 0.72-3.2 0.73h-0.06c-1.46 0-2.08-0.6-2.08-2.01 0-1.37 0.55-1.92 1.89-1.92h3.47V23.79z"></path><path class="st11" d="M101.06 24.31c-0.95 0.23-1.63 0.33-2.26 0.33 -1.16 0-1.27-0.36-1.27-1.31v
3692-8.47h3.9l0-2.22h-3.9V9.26l-2.94 0.01v3.38h-2.56v2.22h2.56v8.86c0 2.31 1.18 3.34 3.82 3.34 1.04 0 2.14-0.18 3.11-0.52l0.17-0.06 -0.4-2.23L101.06 24.31z"></path><path class="st11" d="M109.95 12.36c-3.88 0-6.11 1.96-6.11 5.36v3.97c0 3.41 2.23 5.36 6.11 5.36 3.88 0 6.11-1.96 6.11-5.36v-3.97C116.06 14.32 113.84 12.36 109.95 12.36zM113.12 21.78c0 1.89-1.04 2.8-3.17 2.8 -2.13 0-3.17-0.92-3.17-2.8v-4.14c0-1.89 1.04-2.8 3.17-2.8 2.13 0 3.17 0.92 3.17 2.8V21.78z"></path><path class="st11" d="M59.07 14.72l0.01-2.07H56.3v14.13h2.94v-9.04c1.75-1.89 4.2-3.24 4.2-3.24l-1.4-1.84C62.04 12.65 60.26 13.76 59.07 14.72z"></path><path class="st11" d="M121.93 14.72l0.01-2.07h-2.77v14.13h2.94v-9.04c1.75-1.89 4.2-3.24 4.2-3.24l-1.4-1.84C124.91 12.65 123.12 13.76 121.93 14.72z"></path><path class="st11" d="M51.54 22.93c-0.96 1.11-2.12 1.66-3.56 1.66 -2.13 0-3.17-0.92-3.17-2.8v-4.14c0-1.89 1.04-2.8 3.17-2.8 1.73 0 2.83 0.77 3.68 1.52l0.13 0.12 1.99-1.39 -0.13-0.17c-0.76-0.95-2.5-2.55-5.67-2.55 -3.88 0-6.11 1.96-6.11 5.36v3.97c0 3.41 2.23 5.36 6.11 5.36 3.03 0 4.76-1.58 5.68-2.91l0.13-0.18 -2.13-1.18L51.54 22.93z"></path><rect x="128.71" y="6.68" class="st11" width="1.2" height="20.07"></rect><rect x="134.41" y="12.69" class="st11" width="1.2" height="14.06"></rect><rect x="134.41" y="8.29" class="st11" width="1.2" height="2.18"></rect><path class="st11" d="M148.67 13.44c-1.68-0.98-5.06-0.52-7.21 0.71V12.5h-1.2v14.25h1.2V15.33c1.74-1.3 5.26-1.79 6.61-1 1.38 0.81 1.38 2.37 1.38 2.43v9.99h1.2v-9.99C150.65 16.67 150.63 14.59 148.67 13.44z"></path><polygon class="st11" points="158.27 18.97 164.05 12.69 162.6 12.69 156 19.89 156 6.68 154.8 6.68 154.8 26.75 156 26.75 156 21.44 157.54 19.77 163.6 26.75 165 26.75 "></polygon><path class="st11" d="M3 10.79L3 10.79l0 16.42 14.22 8.21 14.22-8.21V10.79L17.22 2.58 3 10.79zM26.7 13.53L26.7 13.53 26.7 13.53l-4.74 2.74h0l-4.74-2.74 -4.74 2.74v5.47l4.74 2.74 4.74-2.74 4.74 2.74 -9.48 5.47 -9.48-5.47V13.53l9.48-5.47L26.7 13.53 26.7 13.53z"></path></svg>',
3693                svg_logo_m = '<svg class="made-with-creatorlink-logo logo-b logo-m" alt="Creatorlink logo" viewBox="0 0 26 30" width="26" height="30"><path class="st11" d="M1 8.1L1 8.1V22l12 6.9L25 22V8.1L13 1.2 1 8.1zM21 10.5L21 10.5 21 10.5l-4 2.3 0 0 -4-2.3 -4 2.3v4.6l4 2.3 4-2.3 4 2.3 -8 4.6L5 19.7v-9.2l8-4.6L21 10.5 21 10.5z"/></svg>',
3694                str = '\
3695                    <div class="made-with-creatorlink ' + made_width + '" alt="' + made_txt + '" title="' + made_txt + '">\
3696                        <a class="made-creatorlink-link fixed-banner" href="' + go_to_link + '" target="_blank">\
3697                            <div class="inner-logo">' + svg_logo + svg_logo_m + '</div>\
3698                            <div class="inner-txt">\
3699                                <ul>\
3700                                    <li>' + $.lang[LANG][go_to_txt + '.1'] + '</li>\
3701                                    <li>' + $.lang[LANG][go_to_txt + '.2'] + '</li>\
3702                                </ul>\
3703                            </div>\
3704                            <div class="inner-btn"><span>' + $.lang[LANG]['footer.made-mark.btn'] + '</span></div>\
3705                        </a>\
3706                        <div class="rolling-wrapper">\
3707                          <a class="made-creatorlink-link">\
3708                              <div class="inner-logo">' + svg_logo + svg_logo_m + '</div>\
3709                              <div class="inner-txt">\
3710                                  <ul>\
3711                                      <li>' + $.lang[LANG][go_to_txt + '.1'] + '</li>\
3712                                  </ul>\
3713                              </div>\
3714                              <div class="inner-btn"><span>' + $.lang[LANG]['footer.made-mark.btn'] + '</span></div>\
3715                          </a>\
3716                          <a class="made-creatorlink-link blue">\
3717                              <div class="inner-logo">' + svg_logo + svg_logo_m + '</div>\
3718                              <div class="inner-txt">\
3719                                  <ul>\
3720                                      <li>' + $.lang[LANG][go_to_txt + '.2'] + '</li>\
3721                                  </ul>\
3722                              </div>\
3723                              <div class="inner-btn"><span>' + $.lang[LANG]['footer.made-mark.btn'] + '</span></div>\
3724                          </a>\
3725                        </div>\
3726                    </div>\
3727                ';
3728            $('.dsgn-body').append(str);
3729
3730            var mwcRollingId = new Interval(mwcRollingStart, 3000);
3731            mwcRollingId.start();
3732        }
3733    }
3734
3735    function setMadeWithCreatorlinkOld() {
3736        var host = (typeof SERVICE == 'undefined') ? property.SERVICE : SERVICE,
3737            made_width = (host.indexOf('gabia') > -1 && LANG == 'ko') ? 'w-2' : '',
3738            go_to_link = (host.indexOf('gabia') > -1) ? 'http://creatorlink-gabia.com' : 'http://creatorlink.net?utm_source=FreeSite&utm_medium=banner&utm_campaign=p
3738owered_by_Creatorlink&utm_term=sitebanner&utm_content=free',
3739            go_to_txt = (host.indexOf('gabia') > -1) ? 'footer.made-mark.description.gabia' : 'footer.made-mark.description',
3740            made_txt = $.lang[LANG]['footer.made-mark.description.title'];
3741
3742        if ($('.dsgn-body').find('.made-with-creatorlink').length > 0) {
3743            $('.dsgn-body').find('.made-with-creatorlink').show().attr('style', 'display: block!important');
3744        } else {
3745            var svg_logo = '<svg class="made-with-creatorlink-logo" viewBox="0 0 26 30" width="26" height="30"><path class="st11" d="M1 8.1L1 8.1V22l12 6.9L25 22V8.1L13 1.2 1 8.1zM21 10.5L21 10.5 21 10.5l-4 2.3 0 0 -4-2.3 -4 2.3v4.6l4 2.3 4-2.3 4 2.3 -8 4.6L5 19.7v-9.2l8-4.6L21 10.5 21 10.5z"/></svg>',
3746                str = '\
3747                    <div class="made-with-creatorlink ' + made_width + '" alt="' + made_txt + '" title="' + made_txt + '">\
3748                        <a class="made-creatorlink-link" href="' + go_to_link + '" target="_blank">\
3749                            <div class="inner-logo">' + svg_logo + '</div>\
3750                            <div class="inner-txt">\
3751                                <ul>\
3752                                    <li>' + $.lang[LANG][go_to_txt + '.1'] + '</li>\
3753                                    <li>' + $.lang[LANG][go_to_txt + '.2'] + '</li>\
3754                                </ul>\
3755                            </div>\
3756                        </a>\
3757                    </div>\
3758                ';
3759            $('.dsgn-body').append(str);
3760
3761            var mwcRollingId = new Interval(mwcRollingStart, 3000);
3762            mwcRollingId.start();
3763        }
3764    }
3765
3766    // function mwcRollingStart() {
3767    //     var $mwcUl = $('.made-with-creatorlink').find('ul'),
3768    //         $mwcHeight = $mwcUl.children().outerHeight(),
3769    //         $length = $mwcUl.children().length;
3770
3771    //     $mwcUl.css('height', $mwcHeight + 'px');
3772    //     $mwcUl.animate({ top: -$mwcHeight + 'px' }, 1000, 'easeInOutQuart', function() {
3773    //         $(this).append($(this).find('li:first').clone().wrapAll('<li/>').parent().html());
3774
3775    //         $(this).find('li:first').remove();
3776    //         $(this).css('top', 0);
3777    //     });
3778    // }
3779    function mwcRollingStart() {
3780      var $wrap = $('.made-with-creatorlink'),
3781          $inner = $wrap.find('.rolling-wrapper'),
3782          $items = $inner.find('.made-creatorlink-link'),
3783          itemHeight = $items.outerHeight();
3784      $inner.css('position','relative');
3785
3786      var $next = $inner.find('.made-creatorlink-link').eq(1);
3787      setTimeout(function () {
3788          if ($next.hasClass('blue')) {
3789              $wrap.addClass('blue');
3790          } else {
3791              $wrap.removeClass('blue');
3792          }
3793      }, 500);
3794
3795      $inner.animate(
3796          { top: -itemHeight + 'px' },
3797          1000,
3798          'easeInOutQuart',
3799          function () {
3800              $inner.append($inner.find('.made-creatorlink-link:first'));
3801              $inner.css('top', 0);
3802          }
3803      );
3804    }
3805
3806    function Interval(fn, time) {
3807        var timer = false;
3808        this.start = function() {
3809            if (!this.isRunning())
3810                timer = setInterval(fn, time);
3811        };
3812        this.stop = function() {
3813            clearInterval(timer);
3814            timer = false;
3815        };
3816        this.isRunning = function() {
3817            return timer !== false;
3818        };
3819    }
3820
3821    function siteNotice(fn, checkDouble, mode, sidchk) {
3822        var s_service = (typeof SERVICE == 'undefined') ? ((typeof property == 'undefined') ? '' : property.SERVICE) : SERVICE;
3823        var s_plantype = (typeof VALIDTYPE == 'undefined') ? ((typeof property == 'undefined') ? '' : property.VALIDTYPE) : VALIDTYPE;
3824
3825        var mode = (mode) ? mode : 'dashbord';
3826        var checkDouble = (typeof checkDouble != 'undefined' && checkDouble) ? checkDouble : '';
3827        var checkGabia = (s_service.indexOf('gabia') > -1 || (typeof rt_service != 'undefined' && rt_service == 'ga')) ? true : false;
3828        var checkGabiaOther = ['manager', 'shopping', 'nickname', 'language', 'chmod', 'chmod.group', 'chmod.commentLevel', 'siteclone'];
3829        var description_other = (checkGabia) ? (($.inArray(fn, checkGabiaOther) > -1) ? '.GA' : '') : '';
3830        var upgrade_url = (checkGabia) ? 'https://www.gabia.com/mygabia/service" target="_blank' : ((fn == 'shopping') ? '/shoppingevent' : '/upgrade/site/');
3831        var sidchk = (sidchk) ? sidchk : '';
3832
3833        // if(fn == 'gabia.bn.chmod') {
3834        //     fn = 'chmod';
3835        //     description_other = '.GA';
3836        //     upgrade_url = '/manager/member';
3837
3838        var modal_title = $.lang[LANG]['dashbord.upgrade.' + fn + '.title' + description_other];
3839        var modal_description = $.lang[LANG]['dashbord.upgrade.' + fn + '.description' + description_other];
3840        var modal_class = 'cl-cmmodal cl-s-btn w560 cl-p130 cl-p0';
3841        var modal_btn = {
3842                'cls': '',
3843                'upgrade': true,
3844                'url': upgrade_url,
3845                'target': '_blank',
3846            };
3847
3848        switch(fn) {
3849            case 'siteclone':
3850                modal_btn.url += sidchk;
3851                modal_btn.target = '';
3852                break;
3853            case 'metaDetail':
3854            case 'metaPlus':
3855            case 'metaOnepage':
3856                modal_title = $.lang[LANG]['dashbord.upgrade.meta.title'];
3857                break;
3858            case 'sitelimit':
3859                modal_title = $.lang[LANG]['dashbord.upgrade.siteclone.title'];
3860                modal_btn.upgrade = false;
3861                modal_btn.cls = 'btn-closeOnly';
3862                break;
3863            case 'chmod.group':
3864                if (s_plantype == 'BN') modal_description = $.lang[LANG]['dashbord.upgrade.chmod.group.description.bn'];
3865                break;
3866            case 'chmod.commentLevel':
3867                if (checkGabia && $('.' + selectEL).is('[data-type="gallery"]')) modal_title = $.lang[LANG]['dashbord.upgrade.chmod.commentLevel.gallery.title.GA'];
3868                break;
3869            case 'cert':
3870                modal_class = 'cl-cmmodal cl-s-btn w560 cl-p70 cl-p0 site-not-cert-modal';
3871                break;
3872            case 'menufixbtn':
3873            case 'menufixlang':
3874                modal_title = $.lang[LANG]['config.upgrade.'+fn+'.title'];
3875                modal_description = (checkGabia) ? $.lang[LANG]['config.upgrade.' + fn + '.description.gabia'] : $.lang[LANG]['config.upgrade.' + fn + '.description'];
3876                break;
3877            case 'kakao_onlynumber':
3878                modal_title = $.lang[LANG]['site.delete.process.end.title']; 
3879                modal_description = $.lang[LANG]['shopping.dashboard.kakaoNotice.onlynumber'];
3880                modal_btn.upgrade = false;
3881                modal_btn.cls = 'btn-closeOnly';
3882                break;
3883            case 'kakao_number_length':
3884                modal_title = $.lang[LANG]['site.delete.process.end.title']; 
3885                modal_description = $.lang[LANG]['shopping.dashboard.kakaoNotice.numlength'];
3886                modal_btn.upgrade = false;
3887                modal_btn.cls = 'btn-closeOnly';
3888                break;
3889            case 'kakao_dupnumber':
3890                modal_title = $.lang[LANG]['site.delete.process.end.title']; 
3891                modal_description = $.lang[LANG]['shopping.dashboard.kakaoNotice.dupnumber'];
3892                modal_btn.upgrade = false;
3893                modal_btn.cls = 'btn-closeOnly';
3894                break;
3895            case 'notificationtalkmail':
3896                modal_title = $.lang[LANG]['dashbord.upgrade.kakaoemail.title'];
3897                modal_description = $.lang[LANG]['dashbord.upgrade.kakaoemail.description'];
3898                break;
3899            case 'notificationSmsDisable':
3900                modal_title = $.lang[LANG]['dashbord.upgrade.smsnotification.title'];
3901                modal_description = $.lang[LANG]['dashbord.upgrade.smsnotification.description'];
3902                break;
3903            case 'smsNotificationSettingDisable':
3904                modal_title = $.lang[LANG]['config.smsnotification.setting.disabled.title'];
3905                modal_description = $.lang[LANG]['config.smsnotification.setting.disabled.description'];
3906                break;
3907            case 'notificationKakaoDisable':
3908                modal_title = $.lang[LANG]['dashbord.upgrade.kakaonotification.title'];
3909                modal_description = $.lang[LANG]['dashbord.upgrade.kakaonotification.description'];
3910                break;
3911            case 'notificationtalkmailgabia':
3912                modal_title = $.lang[LANG]['dashbord.upgrade.kakaoemail.title'];
3913                modal_description = $.lang[LANG]['dashbord.upgrade.kakaoemailgabia.description'];
3914                break;
3915            case 'kakaoShoppingDisable':
3916                modal_title = $.lang[LANG]['dashbord.upgrade.kakaodisable.title']; 
3917                modal_description = $.lang[LANG]['dashbord.upgrade.kakaodisable.description'];
3918                modal_btn.target = '';
3919                break;
3920            case 'go_upgradepage':
3921                modal_title = $.lang[LANG]['dashbord.upgrade.transfer.title'];
3922                modal_description = $.lang[LANG]['dashbord.upgrade.transfer.description'];
3923                modal_btn.url += sidchk;
3924                modal_btn.target = '';
3925                break;
3926            case 'calendar':
3927                modal_title = $.lang[LANG]['dashbord.upgrade.calendar.title']; 
3928                modal_description = $.lang[LANG]['dashbord.upgrade.calendar.description'];
3929                break;
3930            case 'smtp-onoff':
3931                modal_title = $.lang[LANG]['dashbord.upgrade.smtp-onoff.title']; 
3932                modal_description = $.lang[LANG]['dashbord.upgrade.smtp-onoff.description'];
3933                modal_class += ' smtp-upgrade-modal';
3934                break;
3935            case 'smtp-gabia-onoff':
3936                modal_title = $.lang[LANG]['dashbord.upgrade.smtp-gabia-onoff.title']; 
3937                modal_description = $.lang[LANG]['dashbord.upgrade.smtp-gabia-onoff.description'];
3938                modal_class += ' smtp-upgrade-modal';
3939                break;
3940            case 'member-smtp-onoff':
3941                modal_title = $.lang[LANG]['dashbord.upgrade.member-smtp-onoff.title'];
3942                modal_description = $.lang[LANG]['dashbord.upgrade.member-smtp-onoff.description'];
3943                modal_class += ' smtp-upgrade-modal';
3944                break;
3945            default:
3946                break;
3947        }
3948
3949        var btn_upgrade = (modal_btn.upgrade) ? `
3950                    <a href="${modal_btn.url}" id="upgrade-usemember-link" class="btn" target="${modal_btn.target}">${clSVG('planupgrade',18,18)}${$.lang[LANG]['dashbord.toolbar.upgrade-site']}</a>
3951            ` : '';
3952        var str = `
3953            <div class="site-upgrade-notice">
3954                <p><span class="text-centermodal">${modal_description}</span></p>
3955                <div class="btn-box ${modal_btn.cls}">
3956                    ${btn_upgrade}
3957                    <button type="button" class="btn btn-default btn-sm close-button-dialog" data-dismiss="modal">${$.lang[LANG]['config.close']}</button>
3958                </div>
3959            </div>
3960        `;
3961
3962        $(this).showModalFlat(modal_title, str,false,false,'','','',modal_class,'','','',function(){
3963            if(checkDouble) {$('.modal.modal-default.fade.in').css('zIndex','');}
3964        });
3965    }
3966
3967    function hideMadeWithCreatorlink() {
3968        $('.goto-top').removeClass('moved');
3969        $('#cl-music-player-icon').removeClass('moved');
3970        $('.made-with-creatorlink').hide();
3971    }
3972
3973    function sites(s) {
3974        var sites_deferred = $.Deferred();
3975        if (typeof s == 'undefined') sites_deferred.reject('sid Undefined :(');
3976        else {
3977            $.ajax({
3978                url: '/template/publishSites',
3979                data: { sid: s },
3980                type: 'POST',
3981                dataType: 'json',
3982                async: true,
3983                cashe: false,
3984                success: function(data) {
3985                    if (typeof data.error != 'undefined' && data.error) {
3986                        sites_deferred.reject(data.error);
3987                        return false;
3988                    }
3989
3990                    sites_deferred.resolve(data);
3991                }
3992            });
3993        }
3994        return sites_deferred.promise();
3995    }
3996
3997    function pbSite(s, onoff) {
3998        var pbSite_deferred = $.Deferred();
3999        if (typeof s == 'undefined') pbSite_deferred.reject('sid Undefined :(');
4000        else {
4001            $.ajax({
4002                url: '/template/publish1',
4003                data: { sid: s, onoff: onoff },
4004                type: 'POST',
4005                dataType: 'json',
4006                async: true,
4007                cashe: false,
4008                success: function(data) {
4009                    if (typeof data.error != 'undefined' && data.error) {
4010                        pbSite_deferred.reject(data.error);
4011                        return false;
4012                    }
4013
4014                    pbSite_deferred.resolve(data);
4015                }
4016            });
4017        }
4018        return pbSite_deferred.promise();
4019    }
4020
4021    function pbGallery(s, onoff, count, p, sCount, i) {
4022        var pbGallery_deferred = $.Deferred();
4023        if (typeof s == 'undefined') pbGallery_deferred.reject('sid Undefined :(');
4024        else {
4025            $.ajax({
4026                url: '/template/publish2',
4027                data: { sid: s, onoff: onoff, count: count, p: p + 1, sCount: sCount, i: i },
4028                type: 'POST',
4029                dataType: 'json',
4030                async: true,
4031                cashe: false,
4032                success: function(data) {
4033                    if (typeof data.error != 'undefined' && data.error) {
4034                        pbGallery_deferred.reject(data.error);
4035                        return false;
4036                    }
4037
4038                    pbGallery_deferred.resolve(data);
4039                }
4040            });
4041        }
4042        return pbGallery_deferred.promise();
4043    }
4044
4045    function pbPages(s, onoff, count, p, sCount, i) {
4046        var pbPages_deferred = $.Deferred();
4047        if (typeof s == 'undefined') pbPages_deferred.reject('sid Undefined :(');
4048        else {
4049            $.ajax({
4050                url: '/template/publish3',
4051                data: { sid: s, onoff: onoff, count: count, p: p + 1, sCount: sCount, i: i },
4052                type: 'POST',
4053                dataType: 'json',
4054                async: true,
4055                cashe: false,
4056                success: function(data) {
4057                    if (typeof data.error != 'undefined' && data.error) {
4058                        pbPages_deferred.reject(data.error);
4059                        return false;
4060                    }
4061
4062                    pbPages_deferred.resolve(data);
4063                }
4064            });
4065        }
4066        return pbPages_deferred.promise();
4067    }
4068
4069    function clearData(type, s, onoff, count, p) {
4070        return $.ajax({
4071            url: '/template/clear',
4072            data: { type: type, sid: s, count: count, p: p + 1, onoff: onoff },
4073            type: 'POST',
4074            dataType: 'json',
4075            async: true,
4076            cashe: false,
4077            success: function(data) {
4078                console.log(data);
4079            }
4080        });
4081    }
4082
4083    function user_location() {
4084        var xhttp = new XMLHttpRequest();
4085        xhttp.onreadystatechange = function() {
4086            if (this.readyState == 4 && this.status == 200) {
4087                var ip = this.responseText,
4088                    sid = (typeof property.SID) ? property.SID : '',
4089                    refer = (typeof property.VIREFER) ? property.VIREFER : '';
4090                if (/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(ip) && sid) {
4091                    $.ajax({
4092                        type: 'POST',
4093                        url: '/template/visitor/' + sid,
4094                        data: { ip: ip, refer: refer },
4095                        dataType: 'json',
4096                        async: true,
4097                        cache: false,
4098                        success: function(r) {
4099                            // console.log(r);
4100                        }
4101                    });
4102                }
4103            }
4104        };
4105        xhttp.open('GET', '//api.ip.pe.kr', true);
4106        // xhttp.open('GET', '//api.ipify.org', true);
4107        xhttp.send();
4108    }
4109
4110    function getProgressWidth() {
4111        var $p = $('.progress-bar');
4112        return $p.width() / $p.parent().width() * 100;
4113    }
4114
4115    var checkError = function(data) {
4116        if(typeof data == 'undefined') data = {};
4117
4118        if (typeof data.error != "undefined" && data.error) {
4119            // alert(data.error);
4120            if (data.error == "No user data") {
4121                internalLink = true;
4122                // location.replace('/member/login');
4123                if (CONFIG_URL) location.replace('/_admin');
4124                setTimeout(function() {
4125                    if (typeof hideAllModal == 'function') hideAllModal();
4126                    var modal = $(this).showModalFlat('<img src="https://storage.googleapis.com/i.addblock.net/modal-logo-dark.png" alt="creaotrlink logo"/>', loginForm(), true, true, function() {}, 'cancel', 'w450');
4127                    $('.flat-modal .modal-footer').hide();
4128                    $('.modal-default[id*=flat-modal] .modal-dialog .modal-body').css('margin', '55px 45px 35px');
4129                    $('.modal-default[id*=flat-modal]').css('z-index', '1041');
4130                    $('.flat-modal').next('.modal-backdrop').css('z-index', '1040');
4131                }, 500);
4132            } else {
4133                $.processOFF();
4134                alert(data.error);
4135            }
4136            return false;
4137        } else {
4138            internalLink = false;
4139            return true;
4140        }
4141    }
4142
4143    $(document)
4144        .off('keypress', 'input[expComma]')
4145        .on('keypress', 'input[expComma]', function(e) {
4146            var key = (e.which) ? e.which : e.keyCode;
4147            if (key == 44) return false;
4148    });
4149
4150    $(document)
4151        .off('blur', 'input[numberOnly]')
4152        .on('blur', 'input[numberOnly]', function(e) {
4153            var val = $(this).val();
4154            var r = val.replace(/[^\d,]/g, '');
4155
4156            if ($(this).hasClass('isFloat')) {
4157                r = val.replace(/[^\d.,]/g, '');
4158            } else if ($(this).attr('class') && $(this).attr('class').indexOf('price') > -1) {
4159                r = val.replace(/[^\d.,-]/g, '');
4160            }
4161
4162            $(this).val(r);
4163        });
4164
4165    $(document)
4166        .off('keypress', 'input[numberOnly]')
4167        .on('keypress', 'input[numberOnly]', function(e) {
4168            var key = (e.which) ? e.which : e.keyCode,
4169                sign = ($(this).hasClass('sign')) ? true : false,
4170                float = $(this).hasClass('isFloat') ? true : false;
4171            if (key > 47 && key < 58) {
4172                return true;
4173            } else if (sign && (key == 43 || key == 45)) {
4174                return true;
4175            } else if (float && key == 46 && $(this).val().indexOf('.') == -1) {
4176                return true;
4177            } else {
4178                return false;
4179            }
4180        });
4181
4182    $(document)
4183        .off('keyup', 'input[numberOnly]')
4184        .on('keyup', 'input[numberOnly]', function(e) {
4185            var n = addCommas($(this).val().replace(/[^0-9.+-]/g, ""));
4186            $(this).val(n);
4187        });
4188
4189    function addCommas(x) {
4190        if (x.length == 0) return '';
4191        x = String(x);
4192        var l = x.split(""),
4193            zero = true;
4194        $.each(l, function(i, v) {
4195            if (x.charAt(0) == '+' || x.charAt(0) == '-') {
4196                var sign = x.charAt(0);
4197                if (x.charAt(1) == "0") {
4198                    x = x.substr(2);
4199                    x = sign + x;
4200                } else if (x.charAt(1) == '+' || x.charAt(1) == '-') {
4201                    x = x.substr(1);
4202                }
4203            } else if (x.charAt(0) == "0" && x.length > 1 && x.indexOf('.') == -1) {
4204                x = x.substr(1);
4205            }
4206        });
4207
4208        if (x.length > 0 && x.indexOf('.') > -1) return x;
4209        return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
4210    }
4211
4212    function removeCommas(x) {
4213        if (!x || x.length == 0) return "";
4214        if (x == "0" || x == 0) return 0;
4215        else return x.split(",").join("");
4216    }
4217
4218
4219    function inputNumberFormat(obj) {
4220        obj.value = comma(uncomma(obj.value));
4221    }
4222
4223    function comma(str) {
4224        str = String(str);
4225        return str.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, '$1,');
4226    }
4227
4228    function uncomma(str) {
4229        str = String(str);
4230        return str.replace(/[^\d]+/g, '');
4231    }
4232
4233
4234    function formTranslate(l) {
4235        if (l != 'ko') {
4236            $('select[form-type="select"] option:selected').text('Select');
4237        }
4238    }
4239
4240    function changeFavicon(src) {
4241        document.head = document.head || document.getElementsByTagName('head')[0];
4242        var link = document.createElement('link'),
4243            oldLink = document.getElementById('dynamic-favicon');
4244
4245        link.id = 'dynamic-favicon';
4246        link.type = 'image/x-icon';
4247        link.rel = 'icon';
4248        link.href = src;
4249        if (oldLink) {
4250            document.head.removeChild(oldLink);
4251        }
4252        document.head.appendChild(link);
4253    }
4254
4255    function occurrences(string, subString, allowOverlapping) {
4256        string += "";
4257        subString += "";
4258        if (subString.length <= 0) return (string.length + 1);
4259
4260        var n = 0,
4261            pos = 0,
4262            step = allowOverlapping ? 1 : subString.length;
4263
4264        while (true) {
4265            pos = string.indexOf(subString, pos);
4266            if (pos >= 0) {
4267                ++n;
4268                pos += step;
4269            } else break;
4270        }
4271        return n;
4272    }
4273
4274    function errorTag(tag) {
4275        var divStart = occurrences(tag, '<div', false),
4276            divEnd = occurrences(tag, '</div>', false);
4277
4278        if (divStart != divEnd) return true;
4279        return false;
4280    }
4281
4282
4283    function errorWorkingEmojisModal(closecallback, showcallback, hidecallback) {
4284        if ($('.cl-cmmodal.error-emoji').length > 0) return false;
4285
4286        if (typeof showcallback == 'undefined' || showcallback == '') {
4287            showcallback = function() {
4288                $('.modal-dialog.error-emoji').closest('.flat-modal').next('.modal-backdrop').attr('style', 'display: block; z-index: 1042!important;');
4289                $('.modal-dialog.error-emoji').closest('.modal').attr('style', 'display: block; z-index: 1043');
4290            }
4291        }
4292
4293        $(this).showModalFlat($.lang[LANG]['config.information'], $.lang[LANG]['config.working.emoji'], true, false, '', 'ok', '', 'cl-cmmodal cl-s-btn w560 cl-p130 cl-p0 cl-okbtn-pbt70 error-emoji', '', closecallback, showcallback, hidecallback);
4294    }
4295
4296    function errorEmojisModal(modal_zindex, closecallback, showcallback, hidecallback) {
4297        if ($('.cl-cmmodal.error-emoji').length > 0) return false;
4298        var modal_size = (typeof modal_zindex != 'undefined' && modal_zindex) ? 'zindex'+modal_zindex : 'zindex1043';
4299        $(this).showModalFlat($.lang[LANG]['config.information'], $.lang[LANG]['config.unable.emoji'], true, false, '', 'ok', '', 'cl-cmmodal cl-s-btn w560 cl-p130 cl-p0 cl-okbtn-pbt70 error-emoji '+modal_size, '', closecallback, showcallback, hidecallback);
4300    }
4301
4302    function checkEmojis(str) {
4303        var regex = /(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|\ud83c[\ude32-\ude3a]|\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff]|&zwj;)/g;
4304        return regex.test(str);
4305    }
4306
4307    function removeEmojis(str) {
4308        var regex = /(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|\ud83c[\ude32-\ude3a]|\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff]|&zwj;)/g;
4309        return str.replace(regex, '');
4310    }
4311
4312
4313
4314    function changeEmoji(str, op, usedDeferred) {
4315        if (typeof op == 'undefined' || (op != 'encode' && op != 'decode')) return str;
4316        if (typeof usedDeferred != 'boolean') usedDeferred = false;
4317
4318        if (usedDeferred) {
4319            var deferred = $.Deferred();
4320            $.post('/template/emoji', { str: str, op: op }, function(data) {
4321                deferred.resolve(data.str);
4322            }, 'json');
4323            return deferred.promise();
4324        } else {
4325            $.post('/template/emoji', { str: str, op: op }, function(data) {
4326                return data.str;
4327            }, 'json');
4328        }
4329    }
4330
4331
4332    function strReplace(str, searchStr, replaceStr) {
4333        return str.split(searchStr).join(replaceStr);
4334    }
4335
4336    function checkBase64Encode(str) {
4337        var regExp = /^(?:[A-Z0-9+\/]{4})*(?:[A-Z0-9+\/]{2}==|[A-Z0-9+\/]{3}=|[A-Z0-9+\/]{4})$/i;
4338        return (str.length % 4 == 0) && regExp.test(str);
4339    }
4340
4341    function number_format(val) {
4342        let parts = val.toString().split("."); 
4343        parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","); 
4344        return parts.join(".");
4345    }
4346//
4347    function checkTemplateSite(sid) {
4348        var checkTemp = (PAGE_MODE == 'c') ? CHECKTEMP : property.CHECKTEMP;
4349        if(typeof checkTemp == 'undefined') return false;
4350        if (!sid || !checkTemp) return false;
4351        var templates_lang = ['ko', 'en'],
4352            // 라이브 백업 코드 
4353            // templates_org = ["pardinus","otocyon","fulica","phocoena","tremarctos","mysticetus","nigripes","pteromys","guanicoe","civettina","viverra","simensis", "euryzona", "leopardus", "gryphus", "rubicola", "wintoni", "iliensis", "javan", "acinonyx", "ochotona", "tayra", "fennec", "beluga", "itatsi", "pennantii", "luscinius", "kidogo", "rourei", "graysoni", "pagensis", "lilliae", "inscinius", "diazi", "gerpi", "lutreola", "walie", "gambieri", "saola", "waldeni", "indri", "jefferyi"],        
4354            templates_org = [
4355                "aves","habroptila","vultur","pardinus","otocyon","fulica","phocoena","tremarctos","mysticetus","nigripes","pteromys","guanicoe","civettina","viverra","simensis", "euryzona", "leopardus", "gryphus", "rubicola", "wintoni", "iliensis", "javan", "acinonyx", "ochotona", "tayra", "fennec", "beluga", "itatsi", "pennantii", "luscinius", "kidogo", "rourei", "graysoni", "pagensis", "lilliae", "inscinius", "diazi", "gerpi", "lutreola", "walie", "gambieri", "saola", "waldeni", "indri", "jefferyi", "theropithecus", "pelzelni",
4356                "template001", "template002", "template003", "template004", "template005", "template006", "template007", "template008", "template009",
4357                "plutolabs","smc","cloudia","eunoia","saladly",
4358                "academy02","academy03","academy04","academy05",
4359                "company02","company03","company04","company05","company06","company07",
4360                "beauty01","beauty02","beauty03","beauty04","beauty05","beauty06",
4361                "culture01","culture02","culture03","culture05","culture06","culture07","culture08",
4362                "sports03","sports04",
4363                "cafe04","cafe05",
4364                "house02","house05",
4365                "portfolio16","portfolio06","portfolio22","portfolio23",
4366                "product02","franchise01","franchise02",
4367                "business", "comingsoon", "portfolio", "restaurant", "studio"
4368            ],
4369            // templates_org = ["aves","habroptila","vultur","pardinus","otocyon","fulica","phocoena","tremarctos","mysticetus","nigripes","pteromys","guanicoe","civettina","viverra","simensis", "euryzona", "leopardus", "gryphus", "rubicola", "wintoni", "iliensis", "javan", "acinonyx", "ochotona", "tayra", "fennec", "beluga", "itatsi", "pennantii", "luscinius", "kidogo", "rourei", "graysoni", "pagensis", "lilliae", "inscinius", "diazi", "gerpi", "lutreola", "walie", "gambieri", "saola", "waldeni", "indri", "jefferyi", "theropithecus", "pelzelni",
4370            //                  "template001", "template002", "template003", "template004", "template005", "template006", "template007", "template008", "template009",
4371            //                  "plutolabs","smc","cloudia","eunoia","saladly",
4372            //                  "academy02","academy03","company02","company03","company04","company05","company06","company07",
4373            //                  "beauty01","beauty02","beauty03","beauty04","beauty05","beauty06","sports03","sports04","cafe04","cafe05","academy04","academy05",
4374            //                  "culture01","culture02","culture03","culture05","culture06","culture07","culture08","product02","house02","house05","portfolio06","portfolio16"],
4375            templates = [],
4376            templates_admin = [];
4377
4378
4379        $.each(templates_org, function(i, v) {
4380            $.each(templates_lang, function(a, b) {
4381                templates_admin.push(v + '_' + b);
4382            });
4383        });
4384
4385        templates = templates_admin.concat(templates_org);
4386
4387        var is_templates = ($.inArray(sid.toLowerCase(), templates) > -1) ? true : false;
4388
4389        return is_templates;
4390    }
4391
4392    jQuery.fn.serializeObject = function() {
4393        var obj = null;
4394        try {
4395            if (this[0].tagName && this[0].tagName.toUpperCase() == "FORM") {
4396                var arr = this.serializeArray();
4397                if (arr) {
4398                    obj = {};
4399                    jQuery.each(arr, function() {
4400                        obj[this.name] = this.value;
4401                    });
4402                } //if ( arr ) {
4403            }
4404        } catch (e) {
4405            alert(e.message);
4406        } finally {}
4407        return obj;
4408    }
4409
4410    function errorCss(css) {
4411        css = css.replace(/::/g, '');
4412        var cssStart = occurrences(css, '{', false),
4413            cssEnd = occurrences(css, '}', false),
4414            pStart = occurrences(css, ':', false),
4415            pEnd = occurrences(css, ';', false),
4416            min = occurrences(css, '(min-width', false),
4417            min2 = occurrences(css, '( min-width', false),
4418            max = occurrences(css, '(max-width', false),
4419            max2 = occurrences(css, '( max-width', false),
4420            hover = occurrences(css, ':hover', false),
4421            active = occurrences(css, ':active', false),
4422            focus = occurrences(css, ':focus', false),
4423            before = occurrences(css, ':before', false),
4424            after = occurrences(css, ':after', false),
4425            empty = occurrences(css, ':empty', false),
4426            not = occurrences(css, ':not', false),
4427            css_is = occurrences(css, ':is', false),
4428            checked = occurrences(css, ':checked', false),
4429            first = occurrences(css, ':first-child', false),
4430            last = occurrences(css, ':last-child', false),
4431            first_letter = occurrences(css, ':first-letter', false),
4432            first_line = occurrences(css, ':first-line', false),
4433            first_of_type = occurrences(css, ':first-of-type', false),
4434            nth = occurrences(css, ':nth', false),
4435            nth_even = occurrences(css, ':nth-child(even)', true),
4436            nth_odd = occurrences(css, ':nth-child(odd)', true),
4437            holder1 = occurrences(css, ':-webkit-input-placeholder', false),
4438            holder2 = occurrences(css, ':-moz-placeholder', false),
4439            holder3 = occurrences(css, ':-ms-input-placeholder', false),
4440            media_controls = occurrences(css, ':-webkit-media-controls', false),
4441            select_icon = occurrences(css, ':-ms-expand', false),
4442            scrollbar1 = occurrences(css, ':-webkit-scrollbar', false),
4443            scrollbar2 = occurrences(css, ':-webkit-scrollbar-track', false),
4444            scrollbar3 = occurrences(css, ':-webkit-scrollbar-thumbr', false),
4445            https = occurrences(css, 'https:', false),
4446            http = occurrences(css, 'http:', false);
4447
4448        if (rt_admin == "adm") {
4449            console.log('{', cssStart);
4450            console.log('}', cssEnd);
4451            console.log(':', pStart);
4452            console.log(';', pEnd);
4453            console.log('media css', (min + min2 + max + max2));
4454            console.log('hover', hover);
4455            console.log('active', active);
4456            console.log('focus', focus);
4457            console.log('before', before);
4458            console.log('after', after);
4459            console.log('empty', empty);
4460            console.log('not', not);
4461            console.log('css_is', css_is);
4462            console.log('checked', checked);
4463            console.log('first-child', first);
4464            console.log('last-child', last);
4465            console.log('first-letter', first_letter);
4466            console.log('first-line', first_line);
4467            console.log('first-of-type', first_of_type);
4468            console.log('nth', nth);
4469            console.log('nth-even', nth_even);
4470            console.log('nth-odd', nth_odd);
4471            console.log('holder', (holder1 + holder2 + holder3));
4472            console.log('video-controls(::-webkit-media-controls)', media_controls);
4473            console.log('select-icon(::-ms-expand)', select_icon);
4474            console.log('scrollbar', scrollbar1);
4475            console.log('scrollbar-track', scrollbar2);
4476            console.log('scrollbar-thumb', scrollbar3);
4477            console.log('https:', https);
4478            console.log('http:', http);
4479        }
4480        // if (cssStart != cssEnd) return true;
4481        // if (pStart != (pEnd + min + min2 + max + max2 + hover + active + focus + before + after + empty + not + css_is + checked + first + last + first_letter + first_line + first_of_type + nth + holder1 + holder2 + holder3 + media_controls + select_icon + scrollbar1 + scrollbar2 + scrollbar3 + https + http)) return true;
4482        // return false;
4483
4484        // 중괄호 중첩 체크
4485        let bracesError = checkBracesNested(css);
4486        if (bracesError) return bracesError;
4487
4488        // 주석 닫힘 체크
4489        let commentError = checkCommentClosed(css);
4490        if (commentError) return commentError;
4491        
4492        // 고유 클래스(.userEL숫자) 체크
4493        let errorMsg = hasUserELClass(css);
4494        if(errorMsg) return errorMsg;
4495
4496        return null;
4497    }
4498
4499    if (typeof(MD5_JS) == 'undefined') {
4500        var MD5_JS = true;
4501        var hexcase = 0;
4502        var b64pad = "";
4503        var chrsz = 8;
4504
4505        function hex_md5(s) { return binl2hex(core_md5(str2binl(s), s.length * chrsz)); }
4506
4507        function b64_md5(s) { return binl2b64(core_md5(str2binl(s), s.length * chrsz)); }
4508
4509        function str_md5(s) { return binl2str(core_md5(str2binl(s), s.length * chrsz)); }
4510
4511        function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }
4512
4513        function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }
4514
4515        function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }
4516
4517        function core_md5(x, len) {
4518            x[len >> 5] |= 0x80 << ((len) % 32);
4519            x[(((len + 64) >>> 9) << 4) + 14] = len;
4520            var a = 1732584193;
4521            var b = -271733879;
4522            var c = -1732584194;
4523            var d = 271733878;
4524            for (var i = 0; i < x.length; i += 16) {
4525                var olda = a;
4526                var oldb = b;
4527                var oldc = c;
4528                var oldd = d;
4529                a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936);
4530                d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586);
4531                c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819);
4532                b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330);
4533                a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897);
4534                d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426);
4535                c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341);
4536                b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983);
4537                a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416);
4538                d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417);
4539                c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);
4540                b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);
4541                a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682);
4542                d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);
4543                c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);
4544                b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329);
4545                a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510);
4546                d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632);
4547                c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713);
4548                b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302);
4549                a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691);
4550                d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083);
4551                c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);
4552                b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848);
4553                a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438);
4554                d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690);
4555                c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961);
4556                b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501);
4557                a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467);
4558                d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784);
4559                c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473);
4560                b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);
4561                a = md5_hh(a, b, c, d, x[i + 5], 4, -378558);
4562                d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463);
4563                c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562);
4564                b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);
4565                a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060);
4566                d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353);
4567                c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632);
4568                b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);
4569                a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174);
4570                d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222);
4571                c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979);
4572                b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189);
4573                a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487);
4574                d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);
4575                c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520);
4576                b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651);
4577                a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844);
4578                d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415);
4579                c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);
4580                b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055);
4581                a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571);
4582                d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606);
4583                c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);
4584                b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799);
4585                a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359);
4586                d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);
4587                c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380);
4588                b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649);
4589                a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070);
4590                d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);
4591                c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259);
4592                b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551);
4593                a = safe_add(a, olda);
4594                b = safe_add(b, oldb);
4595                c = safe_add(c, oldc);
4596                d = safe_add(d, oldd);
4597            }
4598            return Array(a, b, c, d);
4599        }
4600
4601        function md5_cmn(q, a, b, x, s, t) { return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b); }
4602
4603        function md5_ff(a, b, c, d, x, s, t) { return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); }
4604
4605        function md5_gg(a, b, c, d, x, s, t) { return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); }
4606
4607        function md5_hh(a, b, c, d, x, s, t) { return md5_cmn(b ^ c ^ d, a, b, x, s, t); }
4608
4609        function md5_ii(a, b, c, d, x, s, t) { return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); }
4610
4611        function SHA256(s) {
4612            var chrsz   = 8;
4613            var hexcase = 0;
4614
4615            function safe_add (x, y) {
4616                var lsw = (x & 0xFFFF) + (y & 0xFFFF);
4617                var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
4618                return (msw << 16) | (lsw & 0xFFFF);
4619            }
4620
4621            function S (X, n) { return ( X >>> n ) | (X << (32 - n)); }
4622            function R (X, n) { return ( X >>> n ); }
4623            function Ch(x, y, z) { return ((x & y) ^ ((~x) & z)); }
4624            function Maj(x, y, z) { return ((x & y) ^ (x & z) ^ (y & z)); }
4625            function Sigma0256(x) { return (S(x, 2) ^ S(x, 13) ^ S(x, 22)); }
4626            function Sigma1256(x) { return (S(x, 6) ^ S(x, 11) ^ S(x, 25)); }
4627            function Gamma0256(x) { return (S(x, 7) ^ S(x, 18) ^ R(x, 3)); }
4628            function Gamma1256(x) { return (S(x, 17) ^ S(x, 19) ^ R(x, 10)); }
4629            function core_sha256(m, l) {
4630                var K = new Array(0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1, 
4631                    0x923F82A4, 0xAB1C5ED5, 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, 
4632                    0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, 0xE49B69C1, 0xEFBE4786, 
4633                    0xFC19DC6, 0x240CA1CC, 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, 
4634                    0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, 0xC6E00BF3, 0xD5A79147, 
4635                    0x6CA6351, 0x14292967, 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, 
4636                    0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, 0xA2BFE8A1, 0xA81A664B, 
4637                    0xC24B8B70, 0xC76C51A3, 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, 
4638                    0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, 0x391C0CB3, 0x4ED8AA4A, 
4639                    0x5B9CCA4F, 0x682E6FF3, 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, 
4640                    0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2);
4641    
4642                var HASH = new Array(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19);
4643    
4644                var W = new Array(64);
4645                var a, b, c, d, e, f, g, h, i, j;
4646                var T1, T2;
4647         
4648                m[l >> 5] |= 0x80 << (24 - l % 32);
4649                m[((l + 64 >> 9) << 4) + 15] = l;
4650         
4651                for ( var i = 0; i<m.length; i+=16 ) {
4652                    a = HASH[0];
4653                    b = HASH[1];
4654                    c = HASH[2];
4655                    d = HASH[3];
4656                    e = HASH[4];
4657                    f = HASH[5];
4658                    g = HASH[6];
4659                    h = HASH[7];
4660         
4661                    for ( var j = 0; j<64; j++) {
4662                        if (j < 16) W[j] = m[j + i];
4663                        else W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]);
4664         
4665                        T1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]);
4666                        T2 = safe_add(Sigma0256(a), Maj(a, b, c));
4667         
4668                        h = g;
4669                        g = f;
4670                        f = e;
4671                        e = safe_add(d, T1);
4672                        d = c;
4673                        c = b;
4674                        b = a;
4675                        a = safe_add(T1, T2);
4676                    }
4677         
4678                    HASH[0] = safe_add(a, HASH[0]);
4679                    HASH[1] = safe_add(b, HASH[1]);
4680                    HASH[2] = safe_add(c, HASH[2]);
4681                    HASH[3] = safe_add(d, HASH[3]);
4682                    HASH[4] = safe_add(e, HASH[4]);
4683                    HASH[5] = safe_add(f, HASH[5]);
4684                    HASH[6] = safe_add(g, HASH[6]);
4685                    HASH[7] = safe_add(h, HASH[7]);
4686                }
4687                return HASH;
4688            }
4689            function str2binb (str) {
4690                var bin = Array();
4691                var mask = (1 << chrsz) - 1;
4692                for(var i = 0; i < str.length * chrsz; i += chrsz) {
4693                    bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (24 - i%32);
4694                }
4695                return bin;
4696            }
4697         
4698            function Utf8Encode(string) {
4699                string = string.replace(/\r\n/g,"\n");
4700                var utftext = "";
4701         
4702                for (var n = 0; n < string.length; n++) {
4703         
4704                    var c = string.charCodeAt(n);
4705         
4706                    if (c < 128) {
4707                        utftext += String.fromCharCode(c);
4708                    }
4709                    else if((c > 127) && (c < 2048)) {
4710                        utftext += String.fromCharCode((c >> 6) | 192);
4711                        utftext += String.fromCharCode((c & 63) | 128);
4712                    }
4713                    else {
4714                        utftext += String.fromCharCode((c >> 12) | 224);
4715                        utftext += String.fromCharCode(((c >> 6) & 63) | 128);
4716                        utftext += String.fromCharCode((c & 63) | 128);
4717                    }
4718         
4719                }
4720         
4721                return utftext;
4722            }
4723         
4724            function binb2hex (binarray) {
4725                var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
4726                var str = "";
4727                for(var i = 0; i < binarray.length * 4; i++) {
4728                    str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +
4729                    hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8  )) & 0xF);
4730                }
4731                return str;
4732            }
4733            
4734            s = Utf8Encode(s);
4735            return binb2hex(core_sha256(str2binb(s), s.length * chrsz));
4736        }
4737
4738        function core_hmac_md5(key, data) {
4739            var bkey = str2binl(key);
4740            if (bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);
4741            var ipad = Array(16),
4742                opad = Array(16);
4743            for (var i = 0; i < 16; i++) {
4744                ipad[i] = bkey[i] ^ 0x36363636;
4745                opad[i] = bkey[i] ^ 0x5C5C5C5C;
4746            }
4747            var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
4748            return core_md5(opad.concat(hash), 512 + 128);
4749        }
4750
4751        function safe_add(x, y) { var lsw = (x & 0xFFFF) + (y & 0xFFFF); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xFFFF); }
4752
4753        function bit_rol(num, cnt) { return (num << cnt) | (num >>> (32 - cnt)); }
4754
4755        function str2binl(str) { var bin = Array(); var mask = (1 << chrsz) - 1; for (var i = 0; i < str.length * chrsz; i += chrsz) bin[i >> 5] |= (str.charCodeAt(i / chrsz) & mask) << (i % 32); return bin; }
4756
4757        function binl2str(bin) { var str = ""; var mask = (1 << chrsz) - 1; for (var i = 0; i < bin.length * 32; i += chrsz) str += String.fromCharCode((bin[i >> 5] >>> (i % 32)) & mask); return str; }
4758
4759        function binl2hex(binarray) { var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; var str = ""; for (var i = 0; i < binarray.length * 4; i++) str += hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8 + 4)) & 0xF) + hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8)) & 0xF); return str; }
4760
4761        function binl2b64(binarray) {
4762            var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
4762+/";
4763            var str = "";
4764            for (var i = 0; i < binarray.length * 4; i += 3) {
4765                var triplet = (((binarray[i >> 2] >> 8 * (i % 4)) & 0xFF) << 16) | (((binarray[i + 1 >> 2] >> 8 * ((i + 1) % 4)) & 0xFF) << 8) | ((binarray[i + 2 >> 2] >> 8 * ((i + 2) % 4)) & 0xFF);
4766                for (var j = 0; j < 4; j++) {
4767                    if (i * 8 + j * 6 > binarray.length * 32) str += b64pad;
4768                    else
4769                        str += tab.charAt((triplet >> 6 * (3 - j)) & 0x3F);
4770                }
4771            }
4772            return str;
4773        }
4774    }
4775    var Base64 = {
4776        _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
4777        encode: function(input) {
4778            var output = "";
4779            var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
4780            var i = 0;
4781            input = Base64._utf8_encode(input);
4782            while (i < input.length) {
4783                chr1 = input.charCodeAt(i++);
4784                chr2 = input.charCodeAt(i++);
4785                chr3 = input.charCodeAt(i++);
4786                enc1 = chr1 >> 2;
4787                enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
4788                enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
4789                enc4 = chr3 & 63;
4790                if (isNaN(chr2)) { enc3 = enc4 = 64 } else if (isNaN(chr3)) { enc4 = 64 }
4791                output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4)
4792            }
4793            return output
4794        },
4795        decode: function(input) {
4796            var output = "";
4797            var chr1, chr2, chr3;
4798            var enc1, enc2, enc3, enc4;
4799            var i = 0;
4800            input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
4801            while (i < input.length) {
4802                enc1 = this._keyStr.indexOf(input.charAt(i++));
4803                enc2 = this._keyStr.indexOf(input.charAt(i++));
4804                enc3 = this._keyStr.indexOf(input.charAt(i++));
4805                enc4 = this._keyStr.indexOf(input.charAt(i++));
4806                chr1 = (enc1 << 2) | (enc2 >> 4);
4807                chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
4808                chr3 = ((enc3 & 3) << 6) | enc4;
4809                output = output + String.fromCharCode(chr1);
4810                if (enc3 != 64) { output = output + String.fromCharCode(chr2) }
4811                if (enc4 != 64) { output = output + String.fromCharCode(chr3) }
4812            }
4813            output = Base64._utf8_decode(output);
4814            return output
4815        },
4816        _utf8_encode: function(string) {
4817            string = string.replace(/\r\n/g, "\n");
4818            var utftext = "";
4819            for (var n = 0; n < string.length; n++) {
4820                var c = string.charCodeAt(n);
4821                if (c < 128) { utftext += String.fromCharCode(c) } else if ((c > 127) && (c < 2048)) {
4822                    utftext += String.fromCharCode((c >> 6) | 192);
4823                    utftext += String.fromCharCode((c & 63) | 128)
4824                } else {
4825                    utftext += String.fromCharCode((c >> 12) | 224);
4826                    utftext += String.fromCharCode(((c >> 6) & 63) | 128);
4827                    utftext += String.fromCharCode((c & 63) | 128)
4828                }
4829            }
4830            return utftext
4831        },
4832        _utf8_decode: function(utftext) {
4833            var string = "";
4834            var i = 0;
4835            var c = c1 = c2 = 0;
4836            while (i < utftext.length) {
4837                c = utftext.charCodeAt(i);
4838                if (c < 128) {
4839                    string += String.fromCharCode(c);
4840                    i++
4841                } else if ((c > 191) && (c < 224)) {
4842                    c2 = utftext.charCodeAt(i + 1);
4843                    string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
4844                    i += 2
4845                } else {
4846                    c2 = utftext.charCodeAt(i + 1);
4847                    c3 = utftext.charCodeAt(i + 2);
4848                    string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
4849                    i += 3
4850                }
4851            }
4852            return string
4853        }
4854    }
4855
4856
4857    /* new code 20240402 */
4858    var clmd5 = {
4859        hexcase: 0,
4860        b64pad: '',
4861        hex_md5: function(s) { return clmd5.rstr2hex(clmd5.rstr_md5(clmd5.str2rstr_utf8(s))); },
4862        b64_md5: function(s) { return clmd5.rstr2b64(clmd5.rstr_md5(clmd5.str2rstr_utf8(s))); },
4863        any_md5: function(s, e) { return clmd5.rstr2any(clmd5.rstr_md5(clmd5.str2rstr_utf8(s)), e); },
4864        hex_hmac_md5: function(k, d) { return clmd5.rstr2hex(clmd5.rstr_hmac_md5(clmd5.str2rstr_utf8(k), clmd5.str2rstr_utf8(d))); },
4865        b64_hmac_md5: function(k, d) { return clmd5.rstr2b64(clmd5.rstr_hmac_md5(clmd5.str2rstr_utf8(k), clmd5.str2rstr_utf8(d))); },
4866        any_hmac_md5: function(k, d, e) { return clmd5.rstr2any(clmd5.rstr_hmac_md5(clmd5.str2rstr_utf8(k), clmd5.str2rstr_utf8(d)), e); },
4867        rstr_md5: function(s) { return clmd5.binl2rstr(clmd5.binl_md5(clmd5.rstr2binl(s), s.length * 8)); },
4868        rstr_hmac_md5: function(key, data) {
4869            var bkey = clmd5.rstr2binl(key);
4870            if(bkey.length > 16) bkey = clmd5.binl_md5(bkey, key.length * 8);
4871
4872            var ipad = Array(16), opad = Array(16);
4873            for(var i = 0; i < 16; i++)
4874            {
4875                ipad[i] = bkey[i] ^ 0x36363636;
4876                opad[i] = bkey[i] ^ 0x5C5C5C5C;
4877            }
4878
4879            var hash = clmd5.binl_md5(ipad.concat(clmd5.rstr2binl(data)), 512 + data.length * 8);
4880            return clmd5.binl2rstr(clmd5.binl_md5(opad.concat(hash), 512 + 128));
4881        },
4882        rstr2hex: function(input) {
4883            try { clmd5.hexcase } catch(e) { clmd5.hexcase=0; }
4884            var hex_tab = clmd5.hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
4885            var output = "";
4886            var x;
4887            for(var i = 0; i < input.length; i++)
4888            {
4889              x = input.charCodeAt(i);
4890              output += hex_tab.charAt((x >>> 4) & 0x0F)
4891                     +  hex_tab.charAt( x        & 0x0F);
4892            }
4893            return output;
4894        },
4895        rstr2b64: function(input) {
4896            try { clmd5.b64pad } catch(e) { clmd5.b64pad=''; }
4897            var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
4897+/";
4898            var output = "";
4899            var len = input.length;
4900            for(var i = 0; i < len; i += 3)
4901            {
4902              var triplet = (input.charCodeAt(i) << 16)
4903                          | (i + 1 < len ? input.charCodeAt(i+1) << 8 : 0)
4904                          | (i + 2 < len ? input.charCodeAt(i+2)      : 0);
4905              for(var j = 0; j < 4; j++)
4906              {
4907                if(i * 8 + j * 6 > input.length * 8) output += clmd5.b64pad;
4908                else output += tab.charAt((triplet >>> 6*(3-j)) & 0x3F);
4909              }
4910            }
4911            return output;
4912        },
4913        rstr2any: function(input, encoding) {
4914            var divisor = encoding.length;
4915            var i, j, q, x, quotient;
4916          
4917            /* Convert to an array of 16-bit big-endian values, forming the dividend */
4918            var dividend = Array(Math.ceil(input.length / 2));
4919            for(i = 0; i < dividend.length; i++)
4920            {
4921              dividend[i] = (input.charCodeAt(i * 2) << 8) | input.charCodeAt(i * 2 + 1);
4922            }
4923          
4924            /*
4925             * Repeatedly perform a long division. The binary array forms the dividend,
4926             * the length of the encoding is the divisor. Once computed, the quotient
4927             * forms the dividend for the next step. All remainders are stored for later
4928             * use.
4929             */
4930            var full_length = Math.ceil(input.length * 8 /
4931                                              (Math.log(encoding.length) / Math.log(2)));
4932            var remainders = Array(full_length);
4933            for(j = 0; j < full_length; j++)
4934            {
4935              quotient = Array();
4936              x = 0;
4937              for(i = 0; i < dividend.length; i++)
4938              {
4939                x = (x << 16) + dividend[i];
4940                q = Math.floor(x / divisor);
4941                x -= q * divisor;
4942                if(quotient.length > 0 || q > 0)
4943                  quotient[quotient.length] = q;
4944              }
4945              remainders[j] = x;
4946              dividend = quotient;
4947            }
4948          
4949            /* Convert the remainders to the output string */
4950            var output = "";
4951            for(i = remainders.length - 1; i >= 0; i--)
4952              output += encoding.charAt(remainders[i]);
4953          
4954            return output;
4955        },
4956        str2rstr_utf8: function(input) {
4957            var output = "";
4958            var i = -1;
4959            var x, y;
4960          
4961            while(++i < input.length)
4962            {
4963              /* Decode utf-16 surrogate pairs */
4964              x = input.charCodeAt(i);
4965              y = i + 1 < input.length ? input.charCodeAt(i + 1) : 0;
4966              if(0xD800 <= x && x <= 0xDBFF && 0xDC00 <= y && y <= 0xDFFF)
4967              {
4968                x = 0x10000 + ((x & 0x03FF) << 10) + (y & 0x03FF);
4969                i++;
4970              }
4971          
4972              /* Encode output as utf-8 */
4973              if(x <= 0x7F)
4974                output += String.fromCharCode(x);
4975              else if(x <= 0x7FF)
4976                output += String.fromCharCode(0xC0 | ((x >>> 6 ) & 0x1F),
4977                                              0x80 | ( x         & 0x3F));
4978              else if(x <= 0xFFFF)
4979                output += String.fromCharCode(0xE0 | ((x >>> 12) & 0x0F),
4980                                              0x80 | ((x >>> 6 ) & 0x3F),
4981                                              0x80 | ( x         & 0x3F));
4982              else if(x <= 0x1FFFFF)
4983                output += String.fromCharCode(0xF0 | ((x >>> 18) & 0x07),
4984                                              0x80 | ((x >>> 12) & 0x3F),
4985                                              0x80 | ((x >>> 6 ) & 0x3F),
4986                                              0x80 | ( x         & 0x3F));
4987            }
4988            return output;
4989        },
4990        // str2rstr_utf16le: function(input) {
4991        //     var output = "";
4992        //     for(var i = 0; i < input.length; i++)
4993        //       output += String.fromCharCode( input.charCodeAt(i)        & 0xFF,
4994        //                                     (input.charCodeAt(i) >>> 8) & 0xFF);
4995        //     return output;
4996        // },
4997        // str2rstr_utf16be: function(input) {
4998        //     var output = "";
4999        //     for(var i = 0; i < input.length; i++)
5000        //       output += String.fromCharCode((input.charCodeAt(i) >>> 8) & 0xFF,
5001        //                                      input.charCodeAt(i)        & 0xFF);
5002        //     return output;
5003        // },
5004        rstr2binl: function(input) {
5005            var output = Array(input.length >> 2);
5006            for(var i = 0; i < output.length; i++)
5007              output[i] = 0;
5008            for(var i = 0; i < input.length * 8; i += 8)
5009              output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (i%32);
5010            return output;
5011        },
5012        binl2rstr: function(input) {
5013            var output = "";
5014            for(var i = 0; i < input.length * 32; i += 8)
5015              output += String.fromCharCode((input[i>>5] >>> (i % 32)) & 0xFF);
5016            return output;
5017        },
5018        binl_md5: function(x, len) {
5019            /* append padding */
5020            x[len >> 5] |= 0x80 << ((len) % 32);
5021            x[(((len + 64) >>> 9) << 4) + 14] = len;
5022          
5023            var a =  1732584193;
5024            var b = -271733879;
5025            var c = -1732584194;
5026            var d =  271733878;
5027          
5028            for(var i = 0; i < x.length; i += 16)
5029            {
5030              var olda = a;
5031              var oldb = b;
5032              var oldc = c;
5033              var oldd = d;
5034          
5035              a = clmd5.md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
5036              d = clmd5.md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
5037              c = clmd5.md5_ff(c, d, a, b, x[i+ 2], 17,  606105819);
5038              b = clmd5.md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
5039              a = clmd5.md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
5040              d = clmd5.md5_ff(d, a, b, c, x[i+ 5], 12,  1200080426);
5041              c = clmd5.md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
5042              b = clmd5.md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
5043              a = clmd5.md5_ff(a, b, c, d, x[i+ 8], 7 ,  1770035416);
5044              d = clmd5.md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
5045              c = clmd5.md5_ff(c, d, a, b, x[i+10], 17, -42063);
5046              b = clmd5.md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
5047              a = clmd5.md5_ff(a, b, c, d, x[i+12], 7 ,  1804603682);
5048              d = clmd5.md5_ff(d, a, b, c, x[i+13], 12, -40341101);
5049              c = clmd5.md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
5050              b = clmd5.md5_ff(b, c, d, a, x[i+15], 22,  1236535329);
5051          
5052              a = clmd5.md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
5053              d = clmd5.md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
5054              c = clmd5.md5_gg(c, d, a, b, x[i+11], 14,  643717713);
5055              b = clmd5.md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
5056              a = clmd5.md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
5057              d = clmd5.md5_gg(d, a, b, c, x[i+10], 9 ,  38016083);
5058              c = clmd5.md5_gg(c, d, a, b, x[i+15], 14, -660478335);
5059              b = clmd5.md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
5060              a = clmd5.md5_gg(a, b, c, d, x[i+ 9], 5 ,  568446438);
5061              d = clmd5.md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
5062              c = clmd5.md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
5063              b = clmd5.md5_gg(b, c, d, a, x[i+ 8], 20,  1163531501);
5064              a = clmd5.md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
5065              d = clmd5.md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
5066              c = clmd5.md5_gg(c, d, a, b, x[i+ 7], 14,  1735328473);
5067              b = clmd5.md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
5068          
5069              a = clmd5.md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
5070              d = clmd5.md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
5071              c = clmd5.md5_hh(c, d, a, b, x[i+11], 16,  1839030562);
5072              b = clmd5.md5_hh(b, c, d, a, x[i+14], 23, -35309556);
5073              a = clmd5.md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
5074              d = clmd5.md5_hh(d, a, b, c, x[i+ 4], 11,  1272893353);
5075              c = clmd5.md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
5076              b = clmd5.md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
5077              a = clmd5.md5_hh(a, b, c, d, x[i+13], 4 ,  681279174);
5078              d = clmd5.md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
5079              c = clmd5.md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
5080              b = clmd5.md5_hh(b, c, d, a, x[i+ 6], 23,  76029189);
5081              a = clmd5.md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
5082              d = clmd5.md5_hh(d, a, b, c, x[i+12], 11, -421815835);
5083              c = clmd5.md5_hh(c, d, a, b, x[i+15], 16,  530742520);
5084              b = clmd5.md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
5085          
5086              a = clmd5.md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
5087              d = clmd5.md5_ii(d, a, b, c, x[i+ 7], 10,  1126891415);
5088              c = clmd5.md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
5089              b = clmd5.md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
5090              a = clmd5.md5_ii(a, b, c, d, x[i+12], 6 ,  1700485571);
5091              d = clmd5.md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
5092              c = clmd5.md5_ii(c, d, a, b, x[i+10], 15, -1051523);
5093              b = clmd5.md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
5094              a = clmd5.md5_ii(a, b, c, d, x[i+ 8], 6 ,  1873313359);
5095              d = clmd5.md5_ii(d, a, b, c, x[i+15], 10, -30611744);
5096              c = clmd5.md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
5097              b = clmd5.md5_ii(b, c, d, a, x[i+13], 21,  1309151649);
5098              a = clmd5.md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
5099              d = clmd5.md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
5100              c = clmd5.md5_ii(c, d, a, b, x[i+ 2], 15,  718787259);
5101              b = clmd5.md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
5102          
5103              a = clmd5.safe_add(a, olda);
5104              b = clmd5.safe_add(b, oldb);
5105              c = clmd5.safe_add(c, oldc);
5106              d = clmd5.safe_add(d, oldd);
5107            }
5108            return Array(a, b, c, d);
5109        },
5110        md5_cmn: function(q, a, b, x, s, t) { return clmd5.safe_add(clmd5.bit_rol(clmd5.safe_add(clmd5.safe_add(a, q), clmd5.safe_add(x, t)), s),b); },
5111        md5_ff: function(a, b, c, d, x, s, t) { return clmd5.md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); },
5112        md5_gg: function(a, b, c, d, x, s, t) { return clmd5.md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); },
5113        md5_hh: function(a, b, c, d, x, s, t) { return clmd5.md5_cmn(b ^ c ^ d, a, b, x, s, t); },
5114        md5_ii: function(a, b, c, d, x, s, t) { return clmd5.md5_cmn(c ^ (b | (~d)), a, b, x, s, t); },
5115        safe_add: function(x, y) {
5116            var lsw = (x & 0xFFFF) + (y & 0xFFFF);
5117            var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
5118            return (msw << 16) | (lsw & 0xFFFF);
5119        },
5120        bit_rol: function(num, cnt) { return (num << cnt) | (num >>> (32 - cnt)); }
5121    }
5122
5123    $('.newcheckbox').live('click', function() {
5124        var checkCollection = $(this).parents('.collection-item').length;
5125        if (checkCollection < 1) {
5126            if ($(this).hasClass('disabled')) {
5127                return false;
5128            }
5129        }
5130    });
5131
5132
5133    var setPanelTranslate = function(obj) {
5134        $.each(obj.find('[data-title]'), function(i, v) {
5135            var el_title = $(this).attr('data-title'),
5136                lang_check = /[ㄱ-ㅎㅏ-ㅣ가-힣]/,
5137                el_title_lang = (lang_check.test(el_title)) ? 'ko' : 'en',
5138                arr = $.lang[el_title_lang];
5139            if ($(this).parent().hasClass('gallery-item')) return true;
5140            key = getKeyByValue(arr, el_title);
5141
5142            if (key && el_title_lang != LANG) $(this).attr('data-title', $.lang[LANG][key]);
5143            if (typeof $.lang['en'][key] != 'undefined') $(this).attr('data-subtitle', $.lang['en'][key].toLowerCase().replace(/\s/g, '-'));
5144        });
5145    }
5146
5147    var cutStrInBytes = function(str, limit) {
5148        var size = 0;
5149        for (var i = 0; i < str.length; i++) {
5150            size += (str.charCodeAt(i) > 128) ? 2 : 1;
5151            if (size > limit) return str.substring(0, i) + '...';
5152        }
5153        return str;
5154    }
5155
5156    var initSyncField = function(tmpEL, elsettings) {
5157        if(tmpEL.is('[data-init="true"]')) return true;
5158        tmpEL.attr('data-init','true');
5159
5160        var elviewpage = (tmpEL.is('.el_viewblock')) ? true : false;
5161
5162        var el = tmpEL.attr('data-el'),
5163            elid = tmpEL.attr('data-id'),
5164            elname = tmpEL.attr('data-name'),
5165            elcss = (elviewpage) ? '' : CSSJSON.toJSON($('#'+el+'css').text()),
5166            elstyle = (elviewpage) ? {} : style.get(elcss,`.${elname}`);
5167
5168        if(tmpEL.find('input.sync-option').length > -1) {
5169            if(elviewpage) {
5170                elstyle = {
5171                    __layout_col_p: getComputedStyle(document.querySelector('.el_viewblock')).getPropertyValue('--layout-col-p') || 1,
5172                    __layout_col_t: getComputedStyle(document.querySelector('.el_viewblock')).getPropertyValue('--layout-col-t') || 1,
5173                    __layout_col_m: getComputedStyle(document.querySelector('.el_viewblock')).getPropertyValue('--layout-col-m') || 1,
5174                    __layout_imgh: getComputedStyle(document.querySelector('.el_viewblock')).getPropertyValue('--layout-imgh') || 1,
5175                }
5176            }
5177
5178            tmpEL.find('input.sync-option')
5179                .attr('data-col-p', elstyle.__layout_col_p)
5180                .attr('data-col-t', elstyle.__layout_col_t)
5181                .attr('data-col-m', elstyle.__layout_col_m)
5182                .attr('data-imgh', elstyle.__layout_imgh);
5183        }
5184
5185        var field = [],
5186            field_template = {
5187                'brand': {
5188                    'html_ko': '<div class="brand"></div>',
5189                    'html_en': '<div class="brand"></div>',
5190                },
5191                'name': {
5192                    'html_ko': '<div class="name"></div>',
5193                    'html_en': '<div class="name"></div>',
5194                },
5195                'caption': {
5196                    'html_ko': '<div class="caption"></div>',
5197                    'html_en': '<div class="caption"></div>',
5198                },
5199                'price': {
5200                    'html_ko': '<ul class="price-wrap"><li class="price-sale">40,000원</li><li class="price">34,400원</li><li class="sale">24%</li></ul>',
5201                    'html_en': '<ul class="price-wrap"><li class="price-sale">₩40,000</li><li class="price">₩34,400</li><li class="sale">24%</li></ul>',
5202                },
5203                //script append
5204                'price_unit_pricing': {
5205                    'html_ko': '<li class="price-unit-pricing"></li>',
5206                    'html_en': '<li class="price-unit-pricing"></li>',
5207                },
5208                'price_soldout': {
5209                    'html_ko': '<li class="soldout hidden>품절</li>',
5210                    'html_en': '<li class="soldout hidden">Sold out</li>',
5211                }
5212
5213            };
5214    }
5215    var showHideSyncField = function(elObj, elsettings) {
5216        initSyncField(elObj, elsettings);
5217
5218        var off_field = (typeof elsettings.field_disable != 'undefined') ? elsettings.field_disable : [];
5219        $.each(off_field, function(i,k) {
5220            var tmp_k = k;
5221            if(k == 'title') tmp_k = 'name';
5222            else if(k == 'price') tmp_k += ', .sync-item .sale, .
5222sync-item .price-sale, .sync-item .soldout';
5223
5224            if($.inArray(k, off_field) > -1) {
5225                var sync_field = $(elObj).find(`.sync-item .${tmp_k}`);
5226                sync_field.addClass('hide');
5227                if(typeof PAGE_MODE != 'undefined' && PAGE_MODE != 'c') sync_field.empty();
5228            }
5229        });
5230    }
5231
5232    var initGalleryField = function(tmpEL) {
5233        var initcheck = tmpEL.is('.grid') ? tmpEL.closest('.element').is('[data-init="true"]') : tmpEL.is('[data-init="true"]');
5234        if(initcheck) return true;
5235        tmpEL.is('.grid') ? tmpEL.closest('.element').attr('data-init','true') : tmpEL.attr('data-init','true');
5236
5237        var field = ['comment','like','basket'];
5238        var field_template = {
5239                'title': {
5240                    'html_ko': '<h5 class="figure title">제목을 입력해 주세요.</h5>',
5241                    'html_en': '<h5 class="figure title">Enter a title here.</h5>',
5242                },
5243                'caption': {
5244                    'html_ko': '<p class="figure caption">내용을 입력해 주세요.</p>',
5245                    'html_en': '<p class="figure caption">Enter a content here.</p>',
5246                },
5247                'price': {
5248                    'html_ko': '<ul class="figure price"><li class="price-val">120,000원</li><li class="price-sale hide"></li><li class="price-sale-per hide"></li></ul>',
5249                    'html_en': '<ul class="figure price"><li class="price-val">₩120,000</li><li class="price-sale hide"></li><li class="price-sale-per hide"></li></ul>',
5250                },
5251                'review': {
5252                    'html_ko': '<ul class="figure review"><li class="review-cnt">리뷰 <span class="figure-review-cnt">3</span></li><li class="review-score">평점 <span class="figure-review-score">4.8</span></li></ul>',
5253                    'html_en': '<ul class="figure review"><li class="review-cnt">Review <span class="figure-review-cnt">3</span></li><li class="review-score">Ratings <span class="figure-review-score">4.8</span></li></ul>',
5254                },
5255                'comment': {
5256                    'html_ko': '<div class="figure comment hide" data-style="@iconstyle">@icon<span class="figure-comment-cnt">0</span></div>',
5257                    'html_en': '<div class="figure comment hide" data-style="@iconstyle">@icon<span class="figure-comment-cnt">0</span></div>',
5258                    'iconstyle': {
5259                        'default': clSVG(`field_comment`,16,16,true,`figure-comment-icon`)
5260                    }
5261                },
5262                'like': {
5263                    'html_ko': '<div class="figure like hide" data-style="@iconstyle">@icon<span class="figure-like-cnt">0</span></div>',
5264                    'html_en': '<div class="figure like hide" data-style="@iconstyle">@icon<span class="figure-like-cnt">0</span></div>',
5265                    'iconstyle': {
5266                        'default': clSVG(`field_like`,16,16,true,`figure-like-icon`)
5267                    }
5268                },
5269                'basket': {
5270                    'html_ko': '<div class="figure basket hide"><span class="basket-btn">장바구니 담기</span></div>',
5271                    'html_en': '<div class="figure basket hide"><span class="basket-btn">Add to cart</span></div>',
5272                },
5273
5274            };
5275
5276        var gitem = (tmpEL.is('.grid')) ? tmpEL.eq(0) : tmpEL.find('.grid').eq(0);
5277        var target = gitem.find('.figure').length > 0 ? gitem.find('.figure').last().attr('class').trim().replace(/ /gi,'.') : '';
5278
5279        if(target == 'figure') {
5280            if(gitem.find('.figure').last().is('h5')) target = `h5.figure`;
5281            else if(gitem.find('.figure').last().is('p')) target = `p.figure`;
5282            else target = '';
5283        }
5284        if(target == '') field = [];
5285
5286
5287        $.each(field, function(i,k) {
5288            if(typeof field_template[k] == 'undefined') return true;
5289            var tmp_check = (gitem.find(`.figure.${k}`).length > 0) ? true : false;
5290            var tmp_lang = 'ko';
5291            var tmp_html = (typeof field_template[k]['html_'+tmp_lang] != 'undefined') ? field_template[k]['html_'+tmp_lang] : '';
5292            var tmp_iconstyle = (typeof gitem.find(`.figure.${k}`).attr('data-style') != 'undefined') ? gitem.find(`.figure.${k}`).attr('data-style') : 'default';
5293            var tmp_icon = (typeof field_template[k]['iconstyle'] != 'undefined' && typeof field_template[k]['iconstyle'][tmp_iconstyle] != 'undefined') ? field_template[k]['iconstyle'][tmp_iconstyle] : '';
5294            if(tmp_icon == '') tmp_iconstyle = '';
5295
5296            if(tmp_check) {
5297                if(tmp_icon != '') {
5298                    tmpEL.find(`.figure.${k} > svg, .figure.${k} > .figure-${k}-icon`).remove();
5299                    tmpEL.find(`figcaption:not(.top) .figure.${k}`).attr('data-style',tmp_iconstyle).prepend(tmp_icon);
5300                }
5301            } else {
5302                tmpEL.find(`figcaption:not(.top) .figure.${k}`).remove();
5303                tmpEL.find(`figcaption:not(.top) .${target}`).after(tmp_html.replace(/\@iconstyle/,tmp_iconstyle).replace(/\@icon/,tmp_icon));
5304                target = `figure.${k}`;
5305            }
5306        });
5307    }
5308    var showHideGalleryField = function(elObj, elsettings) {
5309        initGalleryField(elObj);
5310
5311        if (typeof elsettings == 'undefined' ||
5312            $.isEmptyObject(elsettings)
5313        ) {
5314            return false;
5315        }
5316
5317        var gVALIDTYPE = (PAGE_MODE == 'c') ? VALIDTYPE : property.VALIDTYPE;
5318        var gLANG = (PAGE_MODE == 'c') ? LANG : property.LANG;
5319        var gLUX = (PAGE_MODE == 'c') ? LUX : property.LUX;
5320
5321        var el_mode = elObj.attr('data-mode');
5322        var el_seq = elObj.attr('data-id');
5323        var checkPublishMode = (PAGE_MODE != 'c' && typeof property != 'undefined' && property.PUBLISH);
5324        var checkEmpty = elObj.find('[data-loop="true"]').is(':empty');
5325        var checkGalleryField = (elObj.find('h5.figure').eq(0).hasClass('title')) ? true : false;
5326
5327        if(elObj.find('.layout-container').length > 0 && elObj.find('.layout-row').length === 0) elObj.find('[data-loop="true"]').addClass('layout-row');
5328
5329        if(checkEmpty) {
5330            var tmp_description = (el_seq == 'all_products') ? $.lang[LANG]['editor.gallery.product.empty.list'] : $.lang[LANG]['editor.gallery.category.empty.list'];
5331            if(gLUX) tmp_description = $.lang[LANG]['editor.gallery.product.empty.list'];
5332            elObj.find('[data-loop="true"]').removeAttr('style').empty().attr('data-description',tmp_description);
5333            return false;
5334        } else if(!checkGalleryField) {
5335            return false;
5336        }
5337
5338        if(checkPublishMode && el_mode != 'shopping' && el_seq != 'all_products') {
5339            elObj.find('.figure.brand, .figure.price, .figure.review, .figure.basket').remove();
5340        }
5341
5342        var gfield_all = ['brand','title','caption','price','review_cnt','review_score','comment','number','basket','like','basket'];
5343        var gfield_oldver = getOrDefault(elsettings,'field_oldver',[]);
5344        var gfield_disable = getOrDefault(elsettings,'field_disable',[]);
5345        var gfield_listSet = (typeof el_mode != 'undefined') ? ['title', 'caption'] : [];
5346        if (typeof el_mode != 'undefined' && el_mode == 'shopping') {
5347            gfield_listSet = ['title', 'caption', 'price', 'review_cnt', 'review_score', 'basket'];
5348            if (typeof LUX != 'undefined' ? LUX : property.LUX) gfield_listSet.push('brand');
5349            if ( elObj.find('.goption[data-basket-disabled="true"]').lenght > 0
5350                || gfield_disable.indexOf('basket') < 0 && gfield_oldver.indexOf('basket') < 0 && elObj.find('.figure.basket:not([data-oldver])').length == 0
5351                || (gVALIDTYPE != 'SM' && gfield_disable.indexOf('basket') < 0)
5352            ) {
5353                gfield_disable.push('basket');
5354            }
5355            if (typeof el_seq != 'undefined' && el_seq == 'all_products') gfield_disable = [];
5356        } else if (typeof el_mode != 'undefined' && el_mode == 'project') {
5357            gfield_listSet = ['title', 'caption', 'comment', 'like'];
5358        } else if (typeof el_mode != 'undefined' && el_mode == 'gallery') {
5359            gfield_listSet = ['title', 'caption', 'like'];
5360        }
5361
5362        if (elObj.find('.figure.number').length > 0) gfield_listSet.push('number');
5363        if (elObj.find('.figure.like').length > 0) elObj.find('.figure.like').addClass('hide');
5364
5365        $.each(gfield_all, function(g_i, g_v) {
5366            var onoff = ($.inArray(g_v, gfield_disable) > -1) ? false : true;
5367            if (onoff && $.inArray(g_v, gfield_listSet) == -1) onoff = false;
5368            if(g_v == 'comment' && !(typeof elsettings.comment_display != 'undefined' && elsettings.comment_display != 'OFF')) onoff = false;
5369            if(g_v == 'like' && !(typeof elsettings.like_display != 'undefined' && elsettings.like_display != 'N')) onoff = false;
5370
5371            var checkReviewField = (g_v.match(/^review_/gi) !== null) ? true : false;
5372            if (checkReviewField) {
5373                elObj.find('.figure.review').attr(`data-${g_v}`, onoff);
5374            } else {
5375                if (onoff) {
5376                    elObj.find(`.figure.${g_v}`).each(function(i, tmp) {
5377                        if (  (g_v == 'comment' && Number($(tmp).find('figure-comment-cnt').text()) == 0) ||
5378                              (g_v == 'basket' && $(this).hasClass('cannotby'))
5379                        ) {
5380                            return true;
5381                        }
5382                        $(this).removeAttr('style');
5383                        $(this).removeClass('hide');
5384                    });
5385                } else {
5386                    elObj.find(`.figure.${g_v}`).each(function() { 
5387                        $(this).addClass('hide'); 
5388                    });
5389                }
5390            }
5391        });
5392
5393        elObj.find('.grid figcaption').each(function() {
5394            if($(this).find('.figure:not(.hide, .review[data-review_cnt="false"][data-review_score="false"])').length > 0 && $(this).height() > 0) {
5395                $(this).removeClass('allhide');
5396            } else {
5397                $(this).addClass('allhide');
5398            }
5399        });
5400
5401        if( elObj.is('[data-msny="true"]') 
5402            && typeof elObj.find('[data-loop="true"]').data('masonry') != 'object'
5403            && ($('.dsgn-body').hasClass('mode-config') || elObj.is('.el_viewblock'))
5404        ) {
5405            reloadBlockMasonry('init',elObj);
5406        }
5407
5408        if(elObj.find('.emptyGalleryItem').length > 0) elObj.find('[data-loop]').addClass('sample-loop');
5409
5410        elObj.find('._aosReloadPoint').remove();
5411        elObj.find('.grid').last().prepend('<input type="hidden" class="_aosReloadPoint">');
5412    }
5413
5414    var refreshGallerySwiperHeight = function(el) {
5415        if (typeof el == 'undefined' || !el || $(el).length == 0 || $(el).length > 1) return false;
5416        if ($(el).find('.empty-txt').length > 0 || $(el).find('.grid').length == 0) return false;
5417
5418        var swiper_elname = $(el).attr('data-name'),
5419            swp_h = getComputedStyle(document.querySelector('.' + swiper_elname)).getPropertyValue('--swiper-height');
5420        if (typeof swp_h != 'undefined' && swp_h) {
5421            var gel = $(el).find('.grid').eq(0),
5422                gw = parseFloat(gel[0].getBoundingClientRect().width),
5423                gpl = parseFloat(gel.css('padding-left').replace(/[^0-9]/g, '')),
5424                gpr = parseFloat(gel.css('padding-right').replace(/[^0-9]/g, ''));
5425
5426            if ($(el).is('.reorderBlock')) {
5427                gw = parseFloat(gw * 5);
5428                gpl = parseFloat(gpl * 5);
5429                gpl = parseFloat(gpl * 5);
5430            }
5431            var swp_wrap_h = (gw - (gpl + gpr)) * parseFloat(swp_h);
5432            $(el).find('.swiper-wrapper').css('height', parseFloat(swp_wrap_h) + 'px');
5433        }
5434    }
5435
5436
5437    var getDsgnBodyChild = function(el) {
5438        const nodeEl = (el instanceof jQuery) ? el[0] : el;
5439        if (!nodeEl) return null;
5440
5441        const body = nodeEl.closest('.dsgn-body');
5442        if (!body) return null;
5443
5444        let node = nodeEl;
5445        while (node && node.parentElement !== body) {
5446            node = node.parentElement;
5447        }
5448
5449        return node;
5450    }
5451
5452    $(document).on('click','.cl-gtoolbar .cl-gsort .cl-gsort-btn', function(e) {
5453        $(this).closest('.cl-gsort').toggleClass('open');
5454    });
5455
5456    var getGToolbar = function(el) {
5457        let $el = (el instanceof jQuery) ? el : $(el);
5458
5459        let $gtoolbar = $el.find('.cl-gtoolbar');
5460
5461        if($gtoolbar.length === 0) {
5462            const $parentElem = $el.closest('.elem');
5463            $gtoolbar = $parentElem.find('.cl-gtoolbar');
5464        }
5465
5466        return $gtoolbar;
5467    }
5468
5469    var initGToolbar = function(el, obj) {
5470        const $el = el;
5471        if ($el.length == 0) {
5472            console.log('undefined Target..');
5473            return false;
5474        }
5475
5476        const opts = {
5477            id: $el.attr('data-id'),
5478            total: 0,
5479            settings: {},
5480            ...(obj ?? {})
5481        };
5482
5483        if(!opts.id) {
5484            console.log('undefined Target id..');
5485            return false;
5486        }
5487
5488        var tmp_deferred = $.Deferred();
5489        if (typeof isElviewPage != 'undefined' && isElviewPage === true) {
5490        } else if ($.isEmptyObject(opts.settings)) {
5491            $.getJSON('/template/element/type/get/seq/' + opts.id, function(data) {
5492                checkError(data);
5493                opts.settings = (data[0] && data[0].elsettings) ? JSON.parse(data[0].elsettings) : {};
5494                if(opts.id === 'all_products') opts.total = data[0]?.total?.conf_total ?? 0;
5495                tmp_deferred.resolve(opts);
5496            });
5497        } else {
5498            tmp_deferred.resolve(opts);
5499        }
5500
5501        tmp_deferred.promise().then(function(d) {
5502            if(d.id === 'all_products') setGToolbarAllProducts($el, d.settings, d.total);
5503            else setGToolbarGallery($el, d.id, d.settings);
5504        });
5505    }
5506
5507    var addGToolbar = function(add_target, add_gtoolbar) {
5508        const $addTarget = $(add_target);
5509        if($addTarget.length === 0) return;
5510        else if($addTarget.length > 1) add_gtoolbar = null;
5511
5512        const isAdd = (typeof add_gtoolbar !== 'undefined' && $(ad
5512d_gtoolbar).is('.cl-gtoolbar')) ? true : false;
5513
5514        $addTarget.each(function() {
5515            const $el = $(this);
5516            const el = $el.attr('data-el');
5517            const elname = $el.attr('data-name');
5518            const elfeature = $el.attr('data-feature') || '';
5519            const elcase = $el.attr('data-case') || '';
5520            const elcss_str = $(`#${el}css`).text();
5521            const elcss = CSSJSON.toJSON(elcss_str);
5522            const elselector = `.${elname}`;
5523            const elstyle = style.get(elcss,elselector);
5524
5525            const gtoolbar_selector = `.cl-gtoolbar-${elname}`;
5526            const gtoolbar_style = style.get(elcss,gtoolbar_selector);
5527            const checkLatestVer = !gtoolbar_style.undefined;
5528
5529            if(isAdd) {
5530                const $gtoolbarNow = getGToolbar($el);
5531                $gtoolbarNow.remove();
5532                if(!checkLatestVer) $el.find('.gallery-category-wrap').remove();
5533
5534                const $gtoolbar = $(add_gtoolbar).clone(true);
5535
5536                if(!$gtoolbar.find('.row').is(':empty')) {
5537                    const orgblock_obj = {
5538                        'gallery45': {selector:'.right-wrap', position:'prepend'}
5539                    };
5540                    const custom = getOrDefault(orgblock_obj,elcase,{});
5541                    const checkCustom = (getOrDefault(custom,'selector','') != '' && $el.find(custom.selector).length > 0) ? true : false;
5542
5543                    const space = cssNumber(getElementRootCss($el,'--fullwidth-space','15px'));
5544                    if(space > 0) setElementRootCss($gtoolbar.find('.container'),{'--fullwidth-space':`${space}px`});
5545
5546                    const isFullwidth = ($el.find('.container.full-width').length > 0) ? true: false;
5547                    $gtoolbar.find('.container').toggleClass('full-width', isFullwidth);
5548                    $gtoolbar.find('.container').toggleClass('init-space-on', isFullwidth && space === 0);
5549
5550                    if($gtoolbar.is('[data-sticky="ON"]') 
5551                        && $el.is('[data-aos], [data-parallax="true"][data-parallax-effect="scroll"]')
5552                    ) {
5553                        if($el.closest('.elem').length < 1) console.log('null');
5554
5555                        $el.closest('.elem').prepend($gtoolbar);
5556                    }
5557                    else if(checkCustom) {
5558                        switch(custom.position) {
5559                            case 'prepend':
5560                                $el.find(custom.selector).prepend($gtoolbar);
5561                                break;
5562                            case 'append':
5563                                $el.find(custom.selector).append($gtoolbar);
5564                                break;
5565                            case 'before':
5566                                $el.find(custom.selector).before($gtoolbar);
5567                                break;
5568                            case 'after':
5569                                $el.find(custom.selector).after($gtoolbar);
5570                                break;
5571                            default:
5572                                $el.prepend($gtoolbar);
5573                                break;
5574                        }
5575                    }
5576                    else if($el.is('[data-type2="premium"]') || $el.has('input.gjs').length) {
5577                        const g_name = $el.attr('data-name');
5578                        const gjs_name = $el.find('.gjs').attr('data-js');
5579                        const gjs_code = $el.find('.gjs').attr('data-js-code');
5580                        const gjs = gjs_name + gjs_code;
5581                        let gcate_obj = {
5582                            'touchslider1': '.ts-container',
5583                            'fixedscroll1': '.fixed-wrap',
5584                            'fixedscroll2': '.fixed-wrap',
5585                        };
5586
5587                        if(elfeature) {
5588                            gcate_obj = {
5589                                'touchslider1': '.ts-container',
5590                                'fixedscroll1': '.content-wrap',
5591                                'fixedscroll2': '.content-wrap',
5592                            };
5593                        }
5594
5595                        const gcate_position = getOrDefault(gcate_obj,gjs,'') || $el.find('.gjs').attr('data-js-selector');
5596                        if(gcate_position && $el.find(gcate_position).length > 0) $el.find(gcate_position).before($gtoolbar);
5597                    }
5598                    else if($el.children('input[type="hidden"]').length > 0) {
5599                        $el.children('input[type="hidden"]').last().after($gtoolbar);
5600                    }
5601                    else {
5602                        $el.prepend($gtoolbar);
5603                    }
5604                }
5605            }
5606
5607            const $gtoolbarDom = getGToolbar($el);
5608            const checkUsedElem = ($gtoolbarDom.closest('.elem.elem-visible').length > 0) ? true : false;
5609            if(isAdd && !checkLatestVer) {
5610                const set_style = {};
5611
5612                const gcate_align_init = {left: 'flex-start', center: 'center', right: 'flex-end'};
5613                const old_warp_style = style.get(elcss,`${elselector} .gallery-category-wrap`);
5614                const old_gtoolbar_style = style.get(elcss,`${elselector} .cl-gtoolbar`);
5615                let old_align = 'flex-start';
5616                if(!old_gtoolbar_style.undefined) old_align = getOrDefault(old_gtoolbar_style,'--gcate-align','');
5617                else if(!old_warp_style.undefined) old_align = gcate_align_init?.[old_warp_style.txAlign];
5618                if(getElementRootCss($gtoolbarDom,'--gcate-align','') !== old_align) {
5619                    set_style['--gcate-align'] = old_align;
5620                }
5621
5622                const gcate_bgcolor_init = (elcase == 'gallery43') ? '#abb1b8' : '#ffffff';
5623                const old_bgcolor = getOrDefaultRootcss(elstyle,'__gcate_background',gcate_bgcolor_init,elselector);
5624                set_style['--gtoolbar-bgcolor'] = old_bgcolor;
5625
5626                const old_font_style = style.get(elcss,`${elselector} .gallery-category-nav li a`);
5627                if(!old_font_style.undefined) {
5628                    if(old_font_style?.txName) set_style['--gcate-fname'] = old_font_style.txName;
5629                    if(old_font_style?.txSize) set_style['--gcate-fsize'] = `${old_font_style.txSize}px`;
5630                    if(old_font_style?.txWeight) set_style['--gcate-fweight'] = old_font_style.txWeight;
5631                }
5632
5633                const old_color_style = style.get(elcss,`${elselector} .gallery-category-nav li:not(.active) a,${elselector} .gallery-category-nav li:not(.active):before`);
5634                if(!old_color_style.undefined) {
5635                    if(old_color_style?.txColor) set_style['--gcate-color'] = old_color_style.txColor;
5636                }
5637                const old_color2_style = style.get(elcss,`${elselector} .gallery-category-nav li.active a,${elselector} .gallery-category-nav li a:hover,${elselector} .gallery-category-nav li a:focus,${elselector} .gallery-category-nav li.active:after`);
5638                if(!old_color2_style.undefined) {
5639                    if(old_color2_style?.txColor) set_style['--gcate-color-active'] = old_color2_style.txColor;
5640                }
5641
5642                setElementRootCss($gtoolbarDom,set_style);
5643            }
5644
5645            if(checkUsedElem) {
5646                setElementRootCss($gtoolbarDom.closest('.elem'),{'--gtoolbar-h':`${$gtoolbarDom[0].offsetHeight}px`});
5647            }
5648
5649            if(!$.clnav.check()) {
5650                setElementRootCss('html',{'--header-height':`${$('.dsgn-body').hasClass('sidebar') ? 0 : $('header').outerHeight()}px`});
5651
5652                var is_config = $('body').hasClass('mode-config');
5653                var is_overlap = (typeof property != 'undefined') ? property.HEADER : HEADER;
5654                var is_el0 = $el.is('[data-el="el_0"]');
5655                $gtoolbarDom.toggleClass('top0', (is_config && !(is_overlap && is_el0)) ? true : false);
5656            }
5657
5658            if(PAGE_MODE == 'c' && $('#el-blockConfig.open').length > 0) {
5659                $gtoolbarDom.find('.cl-gsort').toggleClass('open', ($('#el-blockConfig.open #bc-default-config-list .ctrl-btn.active.open[data-list="gallery_sort_product"]').length > 0) ? true : false);
5660            }
5661        });
5662
5663
5664        $('html').toggleClass('gtoolbar-sticky-ON', $('.cl-gtoolbar[data-sticky="ON"]').length > 0 ? true : false);
5665    }
5666
5667    var setGToolbarGallery = function(target, id, s) {
5668        const $el = $(target);
5669        if($el.length === 0) return;
5670
5671        const el = $el.attr('data-el');
5672        const elname = $el.attr('data-name');
5673        const elcss_str = $(`#${el}css`).text();
5674        const elcss = CSSJSON.toJSON(elcss_str);
5675
5676        const gtoolbar_selector = `.cl-gtoolbar-${elname}`;
5677        const gtoolbar_style = style.get(elcss,gtoolbar_selector);
5678        const checkLatestVer = !gtoolbar_style.undefined;
5679
5680        const $gtoolbar = $(`
5681            <div class="cl-gtoolbar cl-gtoolbar-${$el.attr('data-name')}" 
5682                data-mode="gallery"
5683                data-lang="${LANG}"
5684                data-sticky="${getOrDefault(s,'category_sticky','OFF')}"
5685                data-gcate-style="${getOrDefault(gtoolbar_style,'__gcate_style','default')}"
5686            >
5687                <div class="container">
5688                    <div class="row">
5689
5690                        <template class="cl-gcate"></template>
5691                        <template class="cl-gsort"></template>
5692
5693                    </div>
5694                </div>
5695            </div>
5696        `);
5697
5698        // gallery category (gcate)
5699        const gcate_display = getOrDefault(s,'category_display','OFF');
5700        if(gcate_display === 'ON') {
5701            const $gCate = $(`
5702                <div class="cl-gcate">
5703                    <ul class="cl-gcate-list"></ul>
5704                </div>
5705            `);
5706
5707            let gcate_list = getOrDefault(s,'category','').replace(/\|/g, '').replace(/\,/g, ',').split(',').filter(v => v.trim() !== '');
5708            if(gcate_list.length < 1) gcate_list = ['Category1', 'Category2', 'Category3'];
5709            gcate_list.unshift(getOrDefault(s,'category_home','All'));
5710
5711            const gcate_active = $.cookie(`gallery-category-${id}`) || '';
5712            $.each(gcate_list, function(i,k) {
5713                k = k.trim();
5714
5715                const $gcateItem = $(`<li class="cl-gcate-item"><a href="javascript:;" data-idx="${i}">${k}</a></li>`);
5716                $gcateItem.toggleClass('active', k === gcate_active);
5717                if(i === 0 && getOrDefault(s,'category_home_hide',false)) $gcateItem.addClass('hide');
5718
5719                $gCate.find('.cl-gcate-list').append($gcateItem);
5720            });
5721            if($gCate.find('.cl-gcate-item.active').length === 0) $gCate.find('.cl-gcate-item').not('.hide').eq(0).addClass('active');
5722
5723            $gtoolbar.find('template.cl-gcate').replaceWith($gCate);
5724        } else {
5725            $gtoolbar.find('template.cl-gcate').remove();
5726        }
5727
5728        // gallery sort (gsort)
5729        const gsort_init = ['recent','sales','lowprice','highprice','discount','review_cnt'];
5730        const gsort_type = getOrDefault(s,'gallery_sort','default');
5731        const gmode = $el.attr('data-mode');
5732        if(`${gmode}.${gsort_type}` == 'shopping.product') {
5733            const $gSort = $(`
5734                <div class="cl-gsort">
5735                    <div class="cl-gsort-btn-wrap">
5736                        <div class="cl-gsort-btn">
5737                            <span class="cl-gsort-active"></span>
5738                            ${clSVG('caret2',16,16,false)}
5739                        </div>
5740                        <ul class="cl-gsort-list">
5741                        </ul>
5742                    </div>
5743                </div>
5744            `);
5745
5746            const gsort_active = $.cookie('gallery-orderby-' + id) || 'recent';
5747            if($.inArray(gsort_active,gsort_init) < 0) gsort_active = gsort_init[0];
5748
5749            $.each(gsort_init, function(i,k) {
5750                const gsort_label = $.lang[LANG][`gallery.shopping.orderby.${k}`];
5751                const $gsortItem = $(`<li class="cl-gsort-item"><a href="javascript:;" data-idx="${i}" data-orderby="${k}">${gsort_label}</a></li>`);
5752                $gsortItem.find('a').append(clSVG('check2',13,10,false));
5753                if(k === gsort_active) {
5754                    $gsortItem.addClass('active');
5755                    $gSort.find('.cl-gsort-active').html(gsort_label);
5756                }
5757
5758                $gSort.find('ul').append($gsortItem);
5759            });
5760            
5761            $gtoolbar.find('template.cl-gsort').replaceWith($gSort);
5762        } else {
5763            $gtoolbar.find('template.cl-gsort').remove();
5764        }
5765
5766        if(!checkLatestVer) {
5767            $el.attr('data-ver','1');
5768            $gtoolbar.addClass('gallery-category-wrap');
5769            $gtoolbar.find('.cl-gcate-list').addClass('gallery-category-nav').attr('data-category-color',getOrDefault(s,'category_color_type',''));
5770            $gtoolbar.find('.cl-gsort-btn-wrap').addClass('gallery-sort-nav');
5771        }
5772
5773        addGToolbar($el,$gtoolbar);
5774    }
5775
5776    var setGToolbarAllProducts = function(target, s, total) {
5777        const $el = $(target);
5778        if($el.length === 0) return;
5779
5780        const el = $el.attr('data-el');
5781        const elid = $el.attr('data-id');
5782        const elcss_str = $(`#${el}css`).text();
5783        const elcss = CSSJSON.toJSON(elcss_str);
5784
5785        const gtoolbar_selector = `.cl-gtoolbar-userELallProducts`;
5786        const gtoolbar_style = style.get(elcss,gtoolbar_selector);
5787        const checkLatestVer = !gtoolbar_style.undefined;
5788
5789        if(s === null) {
5790            if(PAGE_MODE == 'c') {
5791                s = $.bcModal?.data?.block?.elsettings ?? {};
5792            }
5793            else {
5794                const blockData = property.CONTENTS?.[`el${elid}`]?.element ?? {};
5795                s = $.parseJSON(blockData?.elsettings ?? '{}');
5796                total = blockData?.total?.list_total ?? 0;
5797            }
5798        }
5799
5800        const $gtoolbar = $(`
5801            <div class="cl-gtoolbar cl-gtoolbar-userELallProducts"
5802                data-mode="allproducts"
5803                data-lang="${LANG}"
5804                data-sticky="${getOrDefault(s,'allproducts_sticky','OFF')}"
5805            >
5806                <div class="container">
5807                    <div class="row">
5808
5809                        <div class="cl-gsort pc">
5810                            <ul class="cl-gsort-list"></ul>
5811                        </div>
5812
5813                        <div class="cl-gsort mobile">
5814                            <div class="cl-gsort-btn-wrap">
5815                                <div class="cl-gsort-btn dropdown-toggle">
5816                                    <span class="cl-gsort-active"></span>
5817                                    ${clSVG('caret2',16,16,false)}
5818                                </div>
5819                                <ul class="cl-gsort-list">
5820                                </ul>
5821                            </div>
5822                            <div class="cl-gsort-list-total" data-total="${total}"></div>
5823                        </div>
5824
5825                    </div>
5826                </div>
5827            </div>
5828        `);
5829
5830        const gsort_init = getAllProductsSortList(s);
5831        let gsort_active = $.cookie('gallery-category-all_products') || '';
5832        if(gsort_init?.[gsort_active] === false) gsort_active = getAllProductsSortVal(s);
5833        $.each(gsort_init, function(k,onoff) {
5834            if(onoff === false) return true;
5835
5836            const gsort_label = $.lang[LANG][`config.allproducts.${k}`];
5837            const $gsortItem = $(`<li class="cl-gsort-item"><a href="javascript:;" data-idx="${i}" data-orderby="${k}">${gsort_label}</a></li>`);
5838            if(k === gsort_active) {
5839                $gsortItem.addClass('active');
5840                $gtoolbar.find('.cl-gsort-active').html(gsort_label);
5841            }
5842
5843            $gtoolbar.find('.cl-gsort-list').append($gsortItem);
5844        });
5845
5846        $gtoolbar.find('.cl-gsort.pc .cl-gsort-list').append(`<li class="cl-gsort-item total"><a href="javascript:;"><span class="cl-gsort-list-total" data-total="${total}"></span></a></li>`)
5847
5848        if(!checkLatestVer) {
5849            $gtoolbar.addClass('allProducts-sort-wrap').attr('data-ver','1');
5850            $gtoolbar.find('.cl-gsort.pc .cl-gsort-list').addClass('gallery-category-nav allProducts-sort-list');
5851            $gtoolbar.find('.cl-gsort.mobile').addClass('allProducts-sort-mobile');
5852            $gtoolbar.find('.cl-gsort.mobile .cl-gsort-btn-wrap').addClass('gallery-sort-nav');
5853            $gtoolbar.find('.cl-gsort.mobile .cl-gsort-list').addClass('gallery-category-nav');
5854        }
5855
5856        addGToolbar($el,$gtoolbar);
5857    }
5858
5859    var getAllProductsSortList = function(elsettings) {
5860
5861        var orderby = getOrDefault(elsettings,'orderby','');
5862        var orderby_val = ['recent','lowprice','review_cnt','high_score','sales','hits'];
5863
5864        if(Array.isArray(elsettings?.orderby_val)
5865        ) {
5866            orderby_val = elsettings.orderby_val;
5867        } else if(
5868            elsettings?.orderby_val && 
5869            typeof elsettings.orderby_val === 'object' &&
5870            !Array.isArray(elsettings.orderby_val)
5871        ) {
5872            orderby_val = Object.keys(elsettings.orderby_val);
5873        }
5874
5875        var orderby_init = {};
5876        if(orderby != '') {
5877            orderby.split('||').forEach(function(value, index) {
5878                orderby_init[orderby_val[index]] = (value === 'true') ? true : false;
5879            });  
5880        } else {
5881            orderby_init = {
5882                'lowprice': false,
5883                'review_cnt': false,
5884                'high_score': false,
5885                'recent': true,
5886                'sales': false,
5887                'hits': false,
5888            };
5889        }
5890
5891        return orderby_init;
5892    }
5893    var getAllProductsSortVal = function(elsettings) {
5894        var orderby_list = getAllProductsSortList(elsettings);
5895        var orderby_active = '';
5896        var orderby_cookie = $.cookie('gallery-category-all_products') || '';
5897        if(orderby_list[orderby_active] === true) orderby_active = orderby_cookie;
5898        else {
5899            for (var key in orderby_list) {
5900                if (orderby_list[key]) {
5901                    orderby_active = key;
5902                    break;
5903                }
5904            }
5905        }
5906        $.cookie('gallery-category-all_products', orderby_active, { path: '/', expires: 12 * 60 * 60 * 1000 });
5907
5908        return orderby_active;
5909    }
5910
5911    var getEventObject = function(type, price, quantity, step, explan, lang, href) {
5912        var prod_position = {
5913                "LK": 0,
5914                "BS": 0,
5915                "BN": 1,
5916                "SM": 2
5917            },
5918            prod_type = {
5919                "LK": $.lang[LANG]['pay.plan.LK.name'],
5920                "BS": $.lang[LANG]['pay.plan.BS.name'],
5921                "BN": $.lang[LANG]['pay.plan.BN.name'],
5922                "SM": $.lang[LANG]['pay.plan.SM.name']
5923            },
5924            prod_brand = (lang == 'ko') ? '크리에이터링크' : 'creatorlink',
5925            prod_currency = (lang == 'ko') ? 'KRW' : 'USD',
5926            prod_action = '',
5927            prod_step = 1;
5928
5929        if (explan.length == 0) {
5930            prod_action = '신규결제';
5931        }
5931 else if (explan == type) {
5932            prod_action = '요금제 연장';
5933        } else if ((explan.length && type.length) && (explan != type)) {
5934            prod_action = '요금제 변경';
5935        }
5936
5937        var charge = price + (price * 0.1);
5938        return {
5939            'name': prod_type[type],
5940            'price': charge,
5941            'brand': prod_brand,
5942            'category': prod_action,
5943            'variant': quantity,
5944            'position': prod_position[type],
5945            'explan': explan,
5946            'plan': type,
5947            'step': step,
5948            'currency': prod_currency,
5949            'href': href
5950        }
5951    }
5952
5953
5954    /* 동영상블럭 갤러리타입 **************************************/
5955    var getGalleryVideoType = function(val) {
5956        var videoTypeArray = ['youtube', 'vimeo', 'soundcloud', 'youtu.be'],
5957            videoType = '';
5958
5959        $.each(videoTypeArray, function(i, v) {
5960            if (val.indexOf(v) > -1) {
5961                videoType = v;
5962            }
5963        });
5964
5965        return videoType;
5966    }
5967
5968    var getYoutubeStartSeconds = function(videoUrl) {
5969        var startMatch = videoUrl && videoUrl.match(/[?&](?:t|start)=([^&#]+)/i),
5970            startValue = (startMatch && startMatch[1]) ? decodeURIComponent(startMatch[1]) : '',
5971            timeMatch = null,
5972            seconds = 0;
5973
5974        if (!startValue) return '';
5975        if (/^\d+$/.test(startValue)) return parseInt(startValue, 10);
5976
5977        timeMatch = startValue.match(/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s?)?$/i);
5978        if (!timeMatch) return '';
5979
5980        seconds += (timeMatch[1]) ? parseInt(timeMatch[1], 10) * 3600 : 0;
5981        seconds += (timeMatch[2]) ? parseInt(timeMatch[2], 10) * 60 : 0;
5982        seconds += (timeMatch[3]) ? parseInt(timeMatch[3], 10) : 0;
5983
5984        return (seconds > 0) ? seconds : '';
5985    }
5986
5987    var getGalleryVideoData = function(videoUrl) {
5988        var videoId = '',
5989            videoThumb = '',
5990            videoType = '',
5991            videoStart = '',
5992            check_video = false;
5993
5994        videoType = getGalleryVideoType(videoUrl);
5995
5996        switch (videoType) {
5997            case 'youtube':
5998            case 'youtu.be':
5999                let ytregExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;
6000                let ytsregExp = /^.*(youtube\.com\/shorts\/)([a-zA-Z0-9_-]{11})(\?.*)?$/;
6001                let ytlregExp = /^.*(youtube\.com\/live\/)([a-zA-Z0-9_-]{11})(\?.*)?$/;
6002
6003                let ytmatch = videoUrl.match(ytregExp);
6004                let ytsmatch = videoUrl.match(ytsregExp);
6005                let ytlmatch = videoUrl.match(ytlregExp);
6006
6007                var aType = "text/html",
6008                    src = '';
6009
6010                if (ytmatch && ytmatch[2].length === 11) {
6011                    videoId = ytmatch[2];
6012                } else if (ytsmatch && ytsmatch[2].length === 11) { // shorts
6013                    videoId = ytsmatch[2];
6014                } else if (ytlmatch && ytlmatch[2].length === 11) { // live (새로 추가)
6015                    videoId = ytlmatch[2];
6016                }
6017
6018                if (videoId) {
6019                    videoThumb = '//img.youtube.com/vi/' + videoId + '/maxresdefault.jpg';
6020                    src = '//www.youtube.com/embed/' + videoId;
6021                    videoStart = getYoutubeStartSeconds(videoUrl);
6022                    check_video = true;
6023                }
6024
6025                break;
6026            case 'vimeo':
6027                var regExp = /\/\/(player.)?vimeo.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/,
6028                    match = videoUrl.match(regExp);
6029
6030                if (match && match[3].length > 0) {
6031                    videoId = match[3],
6032                    aType = "text/html",
6033                    src = '//player.vimeo.com/video/' + videoId;
6034
6035                    var vidx = ($('#el-blockConfig .bg-video-wrap .input-group.active').length > 0) ? $('#el-blockConfig .bg-video-wrap .input-group.active').attr('id').replace(/[^0-9]/gi, '') : 0,
6036                        vgrid = $('.'+selectEL).find('.grid').eq(vidx),
6037                        w = (vidx && vgrid.length > 0) ? vgrid.width() + 100 : 1024,
6038                        h = (vidx && vgrid.length > 0) ? vgrid.height() + 100 : 1024,
6039                        size = (w > h) ? '&height='+h : '&width='+w;
6040                    $.getJSON('https://vimeo.com/api/oembed.json?url=https://player.vimeo.com/video/' + videoId + size, function(data) {
6041                        if (typeof data.thumbnail_url != 'undefined' && data.thumbnail_url) {
6042                            videoThumb = data.thumbnail_url;
6043                        }
6044                    });
6045
6046                    check_video = true;
6047                }
6048
6049
6050                break;
6051
6052            case 'soundcloud':
6053                videoId = '',
6054                aType = "";
6055
6056                videoUrl = (videoUrl.indexOf('https') > -1) ? videoUrl : 'https://' + videoUrl;
6057
6058                $.getJSON('https://soundcloud.com/oembed?format=json&url=' + videoUrl, function(data) {
6059                    if (typeof data.html == 'undefined') { return; }
6060                    $video = $(data.html);
6061                    src = $video.prop('src');
6062                    videoThumb = data.thumbnail_url;
6063                    check_video = true;
6064                }).fail(function(response) {
6065                    console.log(response);
6066                    return;
6067                });
6068
6069                break;
6070            default:
6071
6072                break;
6073        }
6074
6075        var videoData = {
6076            check_video: check_video,
6077            videoType: videoType,
6078            videoId: videoId,
6079            videoStart: videoStart,
6080            videoUrl: videoUrl,
6081            aType: aType,
6082            poster: videoThumb,
6083            iframe_src: src
6084        }
6085
6086        return videoData;
6087    }
6088
6089    var renderVideoThumb = function($target, video_str, videoData, bt_type2) { 
6090        if(typeof bt_type2 == 'undefined') bt_type2 = null;
6091        const $videoContent = $target;
6092
6093        $videoContent.html(video_str);
6094        if (videoData.iframe_src) {
6095            $videoContent.attr('data-url', videoData.iframe_src);
6096        }
6097        if (videoData.videoUrl) {
6098            $videoContent.attr('data-url-orig', videoData.videoUrl);
6099        }
6100
6101        if (bt_type2 === 'shorts') $videoContent.addClass('fitvidsignore');
6102        else $videoContent.removeClass('fitvidsignore');
6103
6104        if (videoData.videoType === 'youtube') {
6105            const testImg = new Image();
6106            testImg.onload = function () {
6107                if (this.width <= 120 && this.height <= 90) {
6108                    const thumb = videoData.poster.replace('maxresdefault', '0');
6109                    $videoContent.find('.video-gallery-url').attr('data-poster', thumb);
6110                    $videoContent.find('.ly-img').css('background-image', 'url(' + thumb + ')');
6111                    saveContentElement(false);
6112                }
6113            };
6114            testImg.src = videoData.poster;
6115        }
6116    }
6117    // $('.video-content > svg').live('click', function() {
6118    //     if($(this).parents('.el_viewblock').length>0) return false;
6119
6120    //     $.loadingOn($(this).parents('.video-content')); 
6121
6122    //     var vd_src = $(this).parents('.video-content').attr('data-url'),
6123    //         vd_height = $(this).parents('.video-content').css('height').replace('px',''),
6124    //         vd_data = getGalleryVideoData(vd_src),
6125    //         vd_mode = $(this).parents('.element').attr('data-mode'),
6126    //         vd_id = $(this).parents('.element').attr('data-id'),
6127    //         vd_mute = (vd_src.indexOf('vimeo')>-1) ? '&muted=1' : '&mute=1',
6128    //         vd_content_new = '<iframe class="video-iframe hide" height="'+vd_height+'" src="'+vd_data.iframe_src+'?wmode=transparent&amp;autoplay=1'+vd_mute+'" allow="autoplay""></iframe>';
6129
6130    //     if(vd_mode!='zoom') {
6131    //         //if(isThumnailv_type) {
6132    //             $(this).parents('.video-content').append(vd_content_new);
6133    //             $(this).parents('.video-content').find('.ly-img').remove();
6134    //             $(this).remove();
6135
6136    //             setTimeout(function(){
6137    //                 $('.video-iframe').removeClass('hide');
6138    //                 $('.dsgn-body').fitVids();
6139    //                 $.loadingOFF();
6140
6141    //             },300);
6142    //         //}
6143    //     }   
6144    // });
6145
6146    function setSnsJoinConvertScript(snstype) {
6147        console.log('setSnsJoinConvertScript');
6148        snstype = (typeof snstype != 'undefined') ? snstype : 'naver';
6149        var scriptStr = '\
6150            <script type="text/javascript" src="https://wcs.naver.net/wcslog.js"></script>\
6151            <script type="text/javascript" class="snsjoin_convert">\
6152            if(typeof(wcs) != "undefined") {\
6153                if(!wcs_add) var wcs_add={};\
6154                wcs_add["wa"]="s_48e853d9cc7e";\
6155                var _nasa={};\
6156                _nasa["cnv"] = wcs.cnv("2","1");\
6157                wcs_do(_nasa);\
6158                console.log("naver 전환");\
6159            }\
6160            </script>\
6161            <script type="text/javascript" charset="UTF-8" src="//t1.daumcdn.net/kas/static/kp.js"></script>\
6162            <script type="text/javascript" class="snsjoin_convert">\
6163                kakaoPixel("6608645775572775786").pageView();\
6164                kakaoPixel("6608645775572775786").completeRegistration();\
6165                console.log("kakao 전환");\
6166            </script>\
6167            <script type="text/javascript" class="snsjoin_convert">\
6168            !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?\
6169                n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;\
6170                n.push=n;n.loaded=!0;n.version="2.0";n.queue=[];t=b.createElement(e);t.async=!0;\
6171                t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,\
6172                document,"script","https://connect.facebook.net/en_US/fbevents.js");\
6173                fbq("init", "256796588050321");\
6174                fbq("track", "PageView");\
6175                fbq("trac", "CompleteRegistration");\
6176                console.log("facebook 전환");\
6177            </script>\
6178        ';
6179
6180        switch (snstype) {
6181            case 'naver':
6182                scriptStr += '\
vendor: 108 bytes, lines 6182-6183
6182
6183                    <script class="snsjoin_convert" async src="https://www.googletagmanager.com/gtag/js?id=
6183G-JT83EQYG01
vendor: 11 bytes, line 6183
6183"></script>
6183\
6184                    <script class="snsjoin_convert">\
6185                    window.dataLayer = window.dataLayer || [];\
6186                        function gtag(){dataLayer.push(arguments);}\
6187                        gtag("js", new Date());\
6188                        gtag("config", "G-JT83EQYG01");\
6189                        gtag("event", "네이버_소셜_회원가입_완료", {\
6190                        "Social_Button" : "네이버 아이콘",\
6191                    });\
6192                    </script>\
6193                ';
6194                break;
6195
6196            case 'kakao':
6197                scriptStr += '\
vendor: 104 bytes, lines 6197-6198
6197
6198                <script class="snsjoin_convert" async src="https://www.googletagmanager.com/gtag/js?id=
6198G-JT83EQYG01
vendor: 11 bytes, line 6198
6198"></script>
6198\
6199                <script class="snsjoin_convert">\
6200                    window.dataLayer = window.dataLayer || [];\
6201                    function gtag(){dataLayer.push(arguments);}\
6202                    gtag("js", new Date());\
6203                    gtag("config", "G-JT83EQYG01");\
6204                    gtag("event", "카카오_소셜_회원가입_완료", {\
6205                    "Social_Button" : "카카오 아이콘",\
6206                    });\
6207                </script>\
6208                ';
6209                break;
6210                
6211            case 'fb':
6212                scriptStr += '\
vendor: 104 bytes, lines 6212-6213
6212
6213                <script class="snsjoin_convert" async src="https://www.googletagmanager.com/gtag/js?id=
6213G-JT83EQYG01
vendor: 11 bytes, line 6213
6213"></script>
6213\
6214                <script class="snsjoin_convert">\
6215                console.log(\'sss\');\
6216                window.dataLayer = window.dataLayer || [];\
6217                    function gtag(){dataLayer.push(arguments);}\
6218                    gtag("js", new Date());\
6219                    gtag("config", "G-JT83EQYG01");\
6220                    gtag("event", "페이스북_소셜_회원가입_완료", {\
6221                    "Social_Button" : "페이스북 아이콘",\
6222                });\
6223                </script>\
6224                ';
6225            break;
6226
6227            case 'google':
6228                scriptStr += '\
vendor: 104 bytes, lines 6228-6229
6228
6229                <script class="snsjoin_convert" async src="https://www.googletagmanager.com/gtag/js?id=
6229G-JT83EQYG01
vendor: 11 bytes, line 6229
6229"></script>
6229\
6230                <script class="snsjoin_convert">\
6231                window.dataLayer = window.dataLayer || [];\
6232                    function gtag(){dataLayer.push(arguments);}\
6233                    gtag("js", new Date());\
6234                    gtag("config", "G-JT83EQYG01");\
6235                    gtag("event", "구글_소셜_회원가입_완료", {\
6236                    "Social_Button" : "구글 아이콘",\
6237                });\
6238                </script>\
6239                ';
6240            break;
6241
6242            default:
6243                break;
6244        }
6245        $('.snsjoin_convert').remove();
6246        $('body').append(scriptStr);
6247    }
6248
6249    function kakaoLogin() {
6250        if(window.Kakao) {
6251            const kakao = window.Kakao;
6252            if(!kakao.isInitialized()) {
6253                kakao.init('85677ffc26b1bca1130b866859031c06');
6254            }
6255
6256            Kakao.Auth.authorize({
6257                redirectUri: document.location.protocol + '//' + getServiceHost() + '/oauth_kakao',
6258                scope: 'account_email,profile',
6259                state: document.getElementById( "modoo_url" ).value
6260            });
6261        }
6262    }
6263
6264    var googleMemberClientId = '388609418061-gv9aogfpi35f69aa0u9uvsn5vg6gm270.apps.googleusercontent.com';
6265    var googleMemberLoginContext = {};
6266    var googleMemberTokenClient = null;
6267
6268    function setSnsLandJoin() {
6269        var landCheckEl = document.getElementById('land_check');
6270        var landPlanEl = document.getElementById('land_plan');
6271
6272        if( typeof $ != 'undefined' && $.cookie &&
6273            landCheckEl && landPlanEl && landPlanEl.value &&
6274            (landCheckEl.value == 'true' || landCheckEl.value == '1')
6275        ) {
6276            $.cookie('land_join', landPlanEl.value, { path : '/' });
6277        }
6278    }
6279
6280    function googleMemberLogin(from) {
6281        var modooUrlEl = document.getElementById('modoo_url');
6282        var landJoin = '';
6283
6284        if(typeof $ != 'undefined' && $.cookie && $.cookie('land_join')) {
6285            landJoin = $.cookie('land_join');
6286            $.removeCookie('land_join', { path: '/' });
6287        }
6288
6289        googleMemberLoginContext = {
6290            from: from || '',
6291            url: (modooUrlEl && modooUrlEl.value) ? modooUrlEl.value : '',
6292            land_join: landJoin
6293        };
6294
6295        if(!(window.google && google.accounts && google.accounts.oauth2)) {
6296            alert('Google 로그인 스크립트를 불러오는 중입니다. 잠시 후 다시 시도해 주세요.');
6297            return;
6298        }
6299
6300        if(!googleMemberTokenClient) {
6301            googleMemberTokenClient = google.accounts.oauth2.initTokenClient({
6302                client_id: googleMemberClientId,
6303                scope: 'openid email profile',
6304                callback: googleMemberLoginCallback,
6305                error_callback: function() {
6306                    alert('Google 로그인을 취소했거나 로그인 창을 열 수 없습니다.');
6307                }
6308            });
6309        }
6310
6311        googleMemberTokenClient.requestAccessToken({prompt: 'select_account'});
6312    }
6313
6314    function googleMemberLoginCallback(response) {
6315        if(!response || response.error) {
6316            alert('Google 계정 정보를 확인할 수 없습니다.');
6317            return;
6318        }
6319
6320        if(!response.access_token) {
6321            alert('Google 계정 정보를 확인할 수 없습니다.');
6322            return;
6323        }
6324
6325        var postData = {
6326            access_token: response.access_token,
6327            from: googleMemberLoginContext.from || '',
6328            url: googleMemberLoginContext.url || ''
6329        };
6330
6331        if(googleMemberLoginContext.land_join) postData.land_join = googleMemberLoginContext.land_join;
6332
6333        $.post('/member/googlelogin', postData, function(data) {
6334            if(typeof data.msg != 'undefined' && data.msg) {
6335                alert(data.msg);
6336                return false;
6337            }
6338
6339            var redirectGoogleMemberLogin = function() {
6340                if(typeof data.url != 'undefined' && data.url) location.href = data.url;
6341                else location.replace('/dashboard');
6342            };
6343
6344            if(data.join) {
6345                try {
6346                    setSnsJoinConvertScript('google');
6347                } catch(e) {
6348                    if(window.console && console.error) console.error(e);
6349                }
6350            }
6351
6352            if(data.login) {
6353                if(data.join) {
6354                    setTimeout(redirectGoogleMemberLogin, 500);
6355                } else {
6356                    redirectGoogleMemberLogin();
6357                }
6358            }
6359        }, 'json').fail(function() {
6360            alert('Google 로그인 처리 중 오류가 발생했습니다. 잠시 후 다시 시도해 주세요.');
6361        });
6362    }
6363
6364    /*
6365    function kakaoLogin(ip) {
6366        Kakao.Auth.login({
6367            success: function(response) {
6368                //사용자 정보 가져오기
6369                Kakao.API.request({
6370                    url: '/v2/user/me', //계정 정보를 가져오는 request url
6371                    success: function(data) {
6372                        var user = data.kakao_account, //카카오 계정 정보
6373                            accessToken = Kakao.Auth.getAccessToken();
6374
6375                        Kakao.Auth.setAccessToken(accessToken);
6376
6377                        var checkObj = { userinfo: data, id: user.email, snsType: 'kakao', ip: ip };
6378                        if (typeof $.cookie('land_join') != 'undefined' && $.cookie('land_join')) {
6379                            checkObj['land_join'] = $.cookie('land_join');
6380                            $.removeCookie('land_join', { path: '/' });
6381                        }
6382                        $.post('/template/snsloginCheck', checkObj, function(data) {
6383                            if (data.login) {
6384                                if (data.join) setSnsJoinConvertScript(); //sns 회원가입 전환 스크립트 
6385
6386                                if (typeof data.url != 'undefined' && data.url) location.href = data.url;
6387                                else location.replace('/');
6388                                self.close();
6389                            } else {
6390                                alert(data.msg);
6391                                opener.location.reload();
6392                                self.close();
6393                            }
6394                        }, 'json');
6395                    },
6396                    fail: function(error) {
6397                        console.log('카카오톡과 연결이 완료되지 않았습니다.');
6398                    },
6399                })
6400            },
6401            fail: function(error) {
6402                console.log('카카오톡과 연결 실패하였습니다.');
6403            },
6404        })
6405    }
6406    */
6407
6408    function snsLogout() {
6409        var sid = (typeof SID != 'undefined' && SID) ? SID : '';
6410
6411        if(window.Kakao) {
6412            Kakao.init('85677ffc26b1bca1130b866859031c06');
6413            Kakao.isInitialized();
6414    
6415            if (Kakao.Auth.getAccessToken()) {
6416                Kakao.Auth.logout()
6417                    .then(function(response) {
6418                        // console.log(Kakao.Auth.getAccessToken());
6419                    })
6420                    .catch(function(error) {
6421                        // console.log('Not logged in.');
6422                    });
6423            }
6424        }
6425
6426        window.fbAsyncInit = function() {
6427            FB.init({
6428                version : 'v19.0',
6429                appId : '590704662264509',		// [ creatorlink ] Facebook App
6430                // appId : '398865637129551',	// [ creatorlinkdev ] Facebook Test App
6431                status	: true,		//check login status
6432                cookie	: true,
6433                xfbml	: true
6434            });
6435
6436            FB.getLoginStatus(function(response) {
6437                if (response.status == 'connected') {
6438                    FB.logout(function(response) {
6439                        FB.Auth.setAuthResponse(null, 'unknown');
6440                        console.log('logged out~');
6441                    });
6442                }
6443            });
6444        };
6445
6446        (function(d, s, id) {
6447            var js, fjs = d.getElementsByTagName(s)[0];
6448            if (d.getElementById(id)) { return; }
6449            js = d.createElement(s);
6450            js.id = id;
6451            js.async = true;
6452            js.src = 'https://connect.facebook.net/en_KR/all.js';
6453            fjs.parentNode.insertBefore(js, fjs);
6454        }(document, 'script', 'facebook-jssdk'));
6455
6456        if (typeof sid != 'undefined' && sid) {
6457            if ($.cookie('domainSet-next-' + sid) !== undefined) $.removeCookie('domainSet-next-' + sid, { path: '/' });
6458        }
6459
6460        location.href = '/member/login/out';
6461    }
6462
6463    function disableScrolling() {
6464        var x = window.scrollX;
6465        var y = window.scrollY;
6466        window.onscroll = function() { window.scrollTo(x, y); };
6467    }
6468
6469    function enableScrolling() {
6470        window.onscroll = function() {};
6471    }
6472
6473    var hexToRgba = function(hex) {
6474        if (hex.lastIndexOf('#') > -1) {
6475            hex = hex.replace(/#/, '0x');
6476        } else {
6477            hex = '0x' + hex;
6478        }
6479        var r = hex >> 16;
6480        var g = (hex & 0x00FF00) >> 8;
6481        var b = hex & 0x0000FF;
6482        return rgb = { r: r, g: g, b: b };
6483    }
6484
6485    function hexToRgba2(hex, alpha = 1) {
6486        hex = hex.replace(/^#/, '');
6487        
6488        if (hex.length === 3) {
6489            hex = hex.split('').map(c => c + c).join('');
6490        }
6491
6492        const bigint = parseInt(hex, 16);
6493        const r = (bigint >> 16) & 255;
6494        const g = (bigint >> 8) & 255;
6495        const b = bigint & 255;
6496
6497        return `rgba(${r}, ${g}, ${b}, ${alpha})`;
6498    }
6499
6500    var rgbaToOpacity = function(rgba) {
6501        if (typeof rgba == 'undefined') rgba = 'rgba(255,255,255,1)';
6502        //rgba = rgba.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+(\.\d{1,2}))[\s+]?/i);
6503        var r = [],
6504            rgba = rgba.replace(/^(rgb|rgba)\(/, '').replace(/\)$/, '').replace(/\s/g, '').split(',');
6505
6506        r.r = rgba[0], r.g = rgba[1], r.b = rgba[2], r.a = rgba[3];
6507        return r;
6508    }
6509
6510    var onlyUnique = function(value, index, self) {
6511        return self.indexOf(value) === index;
6512    }
6513
6514    var arrayDuplicates = function(arr) {
6515        var duplicates = {};
6516        for (var i = 0; i < arr.length; i++) {
6517            if (duplicates.hasOwnProperty(arr[i])) {
6518                duplicates[arr[i]].push(i);
6519            }
6519 else if (arr.lastIndexOf(arr[i]) !== i) {
6520                duplicates[arr[i]] = [i];
6521            }
6522        }
6523
6524        return duplicates;
6525    }
6526
6527    var arrayLastItem = function(arr) {
6528        if (Array.isArray(arr))
6529            return arr.pop();
6530        else return "";
6531    }
6532
6533    var getLang = function(selectorTag, SID) {
6534        var ch_lang = '';
6535        if (typeof selectorTag.attr('data-blocklang') != 'undefined') { ch_lang = selectorTag.attr('data-blocklang'); } else {
6536            if ($('.menu-' + SID + ' .siteLANG').length > 0)
6537                ch_lang = ($('.menu-' + SID + ' .siteLANG').find('li.active a').attr('data-code') == 'ko') ? 'ko' : 'en';
6538            else ch_lang = LANG;
6539        }
6540
6541        return ch_lang;
6542    }
6543
6544    function templateModeChange(e) {
6545        $('.template-mode').removeClass('active');
6546        $(e).addClass('active');
6547        $('#template-site .modal-dialog .modal-content').find('.load-template').css('display', 'block');
6548        $.processON();
6549
6550        // var widthSize = ($(e).attr('class').indexOf('desktop') > -1) ? '100%' : '100%';
6551        // widthSize = ($(e).attr('class').indexOf('tablet') > -1) ? ($(e).attr('class').indexOf('mobile') > -1 ? '360px' : '770px') : widthSize;
6552
6553        var widthSize = '';
6554        if($(e).attr('class').indexOf('desktop') > -1) widthSize = '100%';
6555        else if($(e).attr('class').indexOf('tablet') > -1) widthSize = '785px';
6556        else  widthSize = '433px';
6557
6558        $('#template-site .modal-dialog .modal-content').css({
6559            'max-width': 'unset',
6560            'width': widthSize,
6561            'height': '86.5%'
6562        });
6563        setTimeout(function() {
6564            $.processOFF();
6565            $('#template-site .modal-dialog .modal-content').find('.load-template').fadeOut(200);
6566        }, 650);
6567        setTimeout(function() { // aos height resize
6568            $('#template-site .modal-dialog .modal-content').css('height', '86.6%');
6569        }, 800);
6570    }
6571
6572    function previewModeChange1(e) {
6573
6574        var hashId = $(e).attr('id');
6575        location.hash = hashId;
6576
6577        $('.template-mode').removeClass('active');
6578        $(e).addClass('active');
6579        $('#previewmain .modal-content-pre').find('.load-template').css('display', 'block');
6580        $.processON('Loading...');
6581
6582        var widthSize = '';
6583        if ($(e).attr('class').indexOf('desktop') > -1) widthSize = '100%';
6584        else if ($(e).attr('class').indexOf('tablet') > -1) widthSize = '785px';
6585        else widthSize = '431px';
6586        $('#previewmain .modal-content-pre').css({
6587            'max-width': 'unset',
6588            'width': widthSize
6589        });
6590
6591        // setTimeout(function(){          
6592        //     $.processOFF();     
6593        //     $('#previewmain .modal-content-pre').find('.load-template').fadeOut(200);
6594        // },650);  
6595
6596        //0206라이브 업뎃 복원용 
6597        //$("#iframe1").get(0).contentDocument.location.reload();
6598
6599        //0206 업뎃 후 문제 시 삭제 
6600        $("#iframe1").get(0).contentWindow.location.reload();
6601
6602        $("#iframe1").off('load').on('load', function(e) {
6603            var iframe = this;
6604            setTimeout(function() {
6605                var frame = iframe.contentWindow;
6606                if(!frame || !frame.jQuery || typeof frame.tabMotion != 'function') return;
6607
6608                frame.jQuery('.tabs').each(function() {
6609                    var $tabs = frame.jQuery(this),
6610                        el = $tabs.attr('data-name'),
6611                        mobile_tab_line = $tabs.attr('mobile-tab-line'),
6612                        tab_line = (typeof mobile_tab_line != 'undefined' && mobile_tab_line) ? mobile_tab_line : $tabs.attr('tab-line');
6613
6614                    if(!el || tab_line != '1') return;
6615
6616                    var len = $tabs.find('.tab-box .tab:not(.hover)').length,
6617                        motion_style = $tabs.attr('tab-motion-style'),
6618                        tab_counted = $tabs.attr('tab-count'),
6619                        mobile_tab_count = $tabs.attr('mobile-tab-count'),
6620                        tab_count = (typeof mobile_tab_count != 'undefined' && mobile_tab_count) ? mobile_tab_count : ((tab_counted > 4) ? 4 : tab_counted),
6621                        tab_case = $tabs.attr('data-case'),
6622                        motion = Number($tabs.attr('tab-motion')) || 0;
6623
6624                    if(len > Number(tab_count)) frame.tabMotion(el, motion, '', len, motion_style, tab_count, tab_case);
6625                });
6626            }, 300);
6627
6628            $.processOFF();
6629            $('#previewmain .modal-content-pre').find('.load-template').fadeOut(200);
6630        });
6631    }
6632
6633    function templateModeDefault(width) {
6634        var widthSize = '';
6635        if (width > 1199) {
6636            widthSize = '100%';
6637        } else if (width <= 1199 && width >= 768) {
6638            widthSize = '785px';
6639        } else if (width <= 767) {
6640            widthSize = '431px';
6641        }
6642
6643        $('#template-site .modal-dialog .modal-content').css({
6644            'max-width': 'unset',
6645            'width': widthSize
6646        });
6647
6648    }
6649
6650    var initViewPageToolbar = function(option, settings, viewData) {
6651        var deferred = $.Deferred();
6652        if (typeof option == 'undefined') option = '';
6653        if (typeof settings == 'undefined') settings = '';
6654
6655        var this_page = (PAGE_MODE == 'c') ? PAGE : property.PAGE,
6656            eltype = (this_page.match(/^forum\,/) !== null) ? 'forum' : 'gallery',
6657            checkForum = (eltype == 'forum') ? true : false,
6658            checkGallery = (eltype == 'gallery') ? true : false,
6659            checkModoo = (getOrDefault(settings,'forum_type','') == 'modoo') ? true : false;
6660
6661        var view_lang = LANG;
6662        if(checkForum && typeof settings.chlang != 'undefined' && settings.chlang) view_lang = settings.chlang;
6663
6664        var toolbar_html = {back:'', like:'', share:'', bottomnav:''};
6665
6666        var pb_icon_back = '', pb_icon_prev = '', pb_icon_next = '', pb_icon_share, pb_icon_like;
6667        var pb_text_back = '', pb_text_prev = '', pb_text_next = '', pb_text_share;
6668        if(checkGallery) {
6669            pb_icon_back = getOrDefault(settings, 'pb_icon_back', '<svg viewBox="0 0 24 24" width="24" height="24"><path d="M4 5h16v2H4zM4 11h16v2H4zM4 17h16v2H4z"></path></svg>');
6670            pb_icon_prev = getOrDefault(settings, 'pb_icon_prev', '<svg viewBox="0 0 24 24" width="24" height="24"><path d="M13.36 18.64L6.73 12l6.63-6.64 1.28 1.28L9.27 12l5.37 5.36z"/></svg>');
6671            pb_icon_next = getOrDefault(settings, 'pb_icon_next', '<svg viewBox="0 0 24 24" width="24" height="24"><path d="M10.64 18.64l-1.28-1.28L14.73 12 9.36 6.64l1.28-1.28L17.27 12z"/></svg>');
6672            pb_icon_share = getOrDefault(settings, 'pb_icon_share', '<svg viewBox="0 0 28 28" width="28" height="28"><path d="M21 17c-1.24 0-2.33.58-3.07 1.46l-7.05-3.53c.07-.3.12-.61.12-.93s-.05-.63-.12-.93l7.05-3.53c.74.88 1.83 1.46 3.07 1.46 2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4c0 .32.05.63.12.93l-7.05 3.53C9.33 10.58 8.24 10 7 10c-2.21 0-4 1.79-4 4s1.79 4 4 4c1.24 0 2.33-.58 3.07-1.46l7.05 3.53c-.07.3-.12.61-.12.93 0 2.21 1.79 4 4 4s4-1.79 4-4-1.79-4-4-4zm0-12.2c1.21 0 2.2.99 2.2 2.2s-.99 2.2-2.2 2.2-2.2-.99-2.2-2.2.99-2.2 2.2-2.2zM7 16.2c-1.21 0-2.2-.99-2.2-2.2s.99-2.2 2.2-2.2 2.2.99 2.2 2.2-.99 2.2-2.2 2.2zm14 7c-1.21 0-2.2-.99-2.2-2.2s.99-2.2 2.2-2.2 2.2.99 2.2 2.2-.99 2.2-2.2 2.2z"></path></svg>');
6673            pb_icon_like = getOrDefault(settings, 'pb_icon_like', '<svg viewBox="0 0 28 28" width="28" height="28"><path d="m22.76 14.7-8.74 8.97-8.75-8.97m0 0c-2.31-2.32-2.37-6.14-.13-8.53 2.24-2.4 5.93-2.46 8.24-.14.23.23.44.48.63.75 1.93-2.67 5.59-3.2 8.16-1.2s3.09 5.79 1.16 8.45c-.18.24-.37.47-.58.68"></path><path d="M14.01 24.57c-.24 0-.48-.1-.64-.27l-8.74-8.97c-2.64-2.66-2.71-7.04-.15-9.78a6.576 6.576 0 0 1 4.74-2.12c1.79-.01 3.5.67 4.8 1.96a6.576 6.576 0 0 1 3.74-1.86c1.77-.25 3.54.22 4.97 1.34 2.95 2.29 3.55 6.64 1.33 9.69-.2.28-.42.54-.66.78l-.06.06-8.68 8.9c-.17.17-.4.27-.65.27zm-8.1-10.51c0 .01.01.01 0 0l8.1 8.32 8.1-8.31.06-.06c.15-.16.3-.33.43-.52 1.65-2.27 1.21-5.51-.98-7.22a4.723 4.723 0 0 0-3.61-.97c-1.31.2-2.47.91-3.27 2a.91.91 0 0 1-.73.37c-.29 0-.56-.14-.73-.38-.16-.22-.34-.44-.54-.64a4.78 4.78 0 0 0-3.49-1.43A4.83 4.83 0 0 0 5.8 6.78c-1.91 2.04-1.86 5.31.11 7.28z"></path></svg>');
6674            pb_text_back = getOrDefault(settings, 'pb_text_back', '');
6675            pb_text_prev = getOrDefault(settings, 'pb_text_prev', '');
6676            pb_text_next = getOrDefault(settings, 'pb_text_next', '');
6677            pb_text_share = getOrDefault(settings, 'pb_text_share', '');
6678        }
6679
6680        var like = {
6681            id: '', 
6682            active: '', 
6683            cnt: 0,
6684            svg: {
6685                forum: '<svg viewBox="0 0 28 28" width="28" height="28"><path d="m22.76 14.7-8.74 8.97-8.75-8.97m0 0c-2.31-2.32-2.37-6.14-.13-8.53 2.24-2.4 5.93-2.46 8.24-.14.23.23.44.48.63.75 1.93-2.67 5.59-3.2 8.16-1.2s3.09 5.79 1.16 8.45c-.18.24-.37.47-.58.68"></path><path d="M14.01 24.57c-.24 0-.48-.1-.64-.27l-8.74-8.97c-2.64-2.66-2.71-7.04-.15-9.78a6.576 6.576 0 0 1 4.74-2.12c1.79-.01 3.5.67 4.8 1.96a6.576 6.576 0 0 1 3.74-1.86c1.77-.25 3.54.22 4.97 1.34 2.95 2.29 3.55 6.64 1.33 9.69-.2.28-.42.54-.66.78l-.06.06-8.68 8.9c-.17.17-.4.27-.65.27zm-8.1-10.51c0 .01.01.01 0 0l8.1 8.32 8.1-8.31.06-.06c.15-.16.3-.33.43-.52 1.65-2.27 1.21-5.51-.98-7.22a4.723 4.723 0 0 0-3.61-.97c-1.31.2-2.47.91-3.27 2a.91.91 0 0 1-.73.37c-.29 0-.56-.14-.73-.38-.16-.22-.34-.44-.54-.64a4.78 4.78 0 0 0-3.49-1.43A4.83 4.83 0 0 0 5.8 6.78c-1.91 2.04-1.86 5.31.11 7.28z"></path></svg>',
6686                gallery: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="m22.76 14.7-8.74 8.97-8.75-8.97m0 0c-2.31-2.32-2.37-6.14-.13-8.53 2.24-2.4 5.93-2.46 8.24-.14.23.23.44.48.63.75 1.93-2.67 5.59-3.2 8.16-1.2s3.09 5.79 1.16 8.45c-.18.24-.37.47-.58.68"></path><path d="M14.01 24.57c-.24 0-.48-.1-.64-.27l-8.74-8.97c-2.64-2.66-2.71-7.04-.15-9.78a6.576 6.576 0 0 1 4.74-2.12c1.79-.01 3.5.67 4.8 1.96a6.576 6.576 0 0 1 3.74-1.86c1.77-.25 3.54.22 4.97 1.34 2.95 2.29 3.55 6.64 1.33 9.69-.2.28-.42.54-.66.78l-.06.06-8.68 8.9c-.17.17-.4.27-.65.27zm-8.1-10.51c0 .01.01.01 0 0l8.1 8.32 8.1-8.31.06-.06c.15-.16.3-.33.43-.52 1.65-2.27 1.21-5.51-.98-7.22a4.723 4.723 0 0 0-3.61-.97c-1.31.2-2.47.91-3.27 2a.91.91 0 0 1-.73.37c-.29 0-.56-.14-.73-.38-.16-.22-.34-.44-.54-.64a4.78 4.78 0 0 0-3.49-1.43A4.83 4.83 0 0 0 5.8 6.78c-1.91 2.04-1.86 5.31.11 7.28z"></path></svg>',
6687            }
6688        };
6689        
6690        if(checkGallery) {
6691            toolbar_html.back = `<div class="toolbar-btn back hide">${pb_icon_back}${pb_text_back ? `<span class="btn-label">${pb_text_back}</span>` : ''}</div>`;
6692            likeData = getLike();
6693            likeData.done(function(data) {
6694                like.cnt = data.cnt;
6695                if (typeof data.own != 'undefined' && data.own) {
6696                    like.id = data.view;
6697                    like.active = 'active';
6698                }
6699            });
6700            toolbar_html.like = `
6701                <div class="toolbar-btn like hide ${like.active}" data-like="${like.id}">
6702                    <button type="button" class="btn">
6703                        ${pb_icon_like}
6704                        <span class="btn-label">${like.cnt}</span>
6705                    </button>
6706                </div>
6707            `;
6708        }
6709        if(checkForum && typeof viewData != 'undefined') {
6710            let fmLikeCnt = (typeof viewData.fm_like_cnt != 'undefined')? viewData.fm_like_cnt : 0;
6711            if(typeof viewData.check_like_own != 'undefined' && viewData.check_like_own) {
6712                like.id = viewData.id;
6713                like.active = 'active';
6714            }
6715            toolbar_html.like = `
6716                <div class="toolbar-btn like hide ${like.active}" data-like="${like.id}">
6717                    <button type="button" class="btn">
6718                        ${like.svg[eltype]}
6719                        <span class="btn-label">${fmLikeCnt}</span>
6720                    </button>
6721                </div>
6722            `;
6723        }
6724        
6725
6726        
6727        var share = {
6728                svg: {
6729                    forum: '',
6730                    gallery: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M21 17c-1.24 0-2.33.58-3.07 1.46l-7.05-3.53c.07-.3.12-.61.12-.93s-.05-.63-.12-.93l7.05-3.53c.74.88 1.83 1.46 3.07 1.46 2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4c0 .32.05.63.12.93l-7.05 3.53C9.33 10.58 8.24 10 7 10c-2.21 0-4 1.79-4 4s1.79 4 4 4c1.24 0 2.33-.58 3.07-1.46l7.05 3.53c-.07.3-.12.61-.12.93 0 2.21 1.79 4 4 4s4-1.79 4-4-1.79-4-4-4zm0-12.2c1.21 0 2.2.99 2.2 2.2s-.99 2.2-2.2 2.2-2.2-.99-2.2-2.2.99-2.2 2.2-2.2zM7 16.2c-1.21 0-2.2-.99-2.2-2.2s.99-2.2 2.2-2.2 2.2.99 2.2 2.2-.99 2.2-2.2 2.2zm14 7c-1.21 0-2.2-.99-2.2-2.2s.99-2.2 2.2-2.2 2.2.99 2.2 2.2-.99 2.2-2.2 2.2z"></path></svg>',
6731                },
6732                label: {
6733                    forum: $.lang[view_lang ]['board.button.share'],
6734                    gallery: '',
6735                }
6736            };
6737        var share_icon = (checkGallery && pb_icon_share) ? pb_icon_share : share.svg[eltype];
6738        var share_label = (checkGallery && pb_text_share) ? pb_text_share : share.label[eltype];
6739        toolbar_html.share = `
6740            <div class="toolbar-btn share hide">
6741                <button type="button" class="btn">
6742                    ${share_icon}
6743                    ${share_label ? '<span class="btn-label">'+share_label+'</span>' : ''}
6744                </button>
6745            </div>
6746        `;
6747
6748        if(checkGallery) {
6749            toolbar_html.bottomnav = `
6750                <div class="toolbar-btn bottomnav hide">
6751                    <div class="btn data-page-back active">${pb_icon_back}</div>
6752                    <div class="btn data-page-prev ${($('.data-page-prev').hasClass('active')) ? 'active' : ''}">${pb_icon_prev}${pb_text_prev ? `<span class="btn-label">${pb_text_prev}</span>` : ''}</div>
6753                    <div class="btn data-page-next ${($('.data-page-next').hasClass('active')) ? 'active' : ''}">${pb_icon_next}${pb_text_next ? `<span class="btn-label">${pb_text_next}</span>` : ''}</div>
6754                </div>
6755            `;
6756        }
6757
6758        var toolbar_str = '',
6759            toolbar_arr = (checkForum) ? ['like','share'] : ['back','share','like','bottomnav'];
6760        $.each(toolbar_arr, function(i,k) {
6761            toolbar_str += toolbar_html[k];
6762        });
6763        var toolbar_html = `
6764            <div class="page-toolbars" data-type="${eltype}" data-page-option="${option}">
6765                <div class="toolbar-wrap">
6766                    ${toolbar_str}
6767                </div>
6768            </div>
6769        `;
6770
6771        if(checkForum) {
6772            if($('.page-toolbars').length == 0) {
6773                if(checkModoo) $('.tpl-forum-modoo-reply').prepend(toolbar_html);
6774                else $('.tpl-forum-list-footer').prepend(toolbar_html);
6775            }
6776        }
6777        if(checkGallery) {
6778            var tmpToolbar = $(toolbar_html);
6779            tmpToolbar.wrapInner('<div class="container"><div class="row"><div class="col-md-12 col-sm-12 col-xs-12"></div></div></div></div>');
6780
6781            var beforePositon = $('.el-footer');
6782            if(PAGE_MODE == 'c') {
6783                if($('.page-comments').length > 0) beforePositon = $('.page-comments');
6784                else if($('.page-bottomlist').length > 0) beforePositon = $('.page-bottomlist');
6785                else if($('.el-footer_ctrl').length > 0) beforePositon = $('.el-footer_ctrl');
6786                else beforePositon = $('.add-footer-information');
6787            }
6788            if(beforePositon.length > 0) beforePositon.before(tmpToolbar.prop('outerHTML'));
6789            else $('.dsgn-body').append(tmpToolbar.prop('outerHTML'));
6790
6791            if(PAGE_MODE == 'c' && $('.el-fixedcontact').length) {
6792                var fixedContactEL = $('.el-fixedcontact').attr('data-el');
6793                $('.el-footer_ctrl').before($('.' + fixedContactEL + '_ctrl'));
6794                $('.el-footer_ctrl').before($('.el-fixedcontact'));
6795            }
6796        }
6797
6798        deferred.resolve($('.page-toolbars'));
6799        return deferred.promise();
6800    }
6801
6802    var setViewPageBottomDefaultSettings = function(settings, parent, eltype) {
6803        if(typeof settings == 'undefined' || !settings || typeof settings != 'object') return settings;
6804
6805        var isGallery = (eltype == 'gallery' && (parent && parent.mode == 'project')) ? true : false;
6806
6807        return settings;
6808    }
6809
6810    var setViewPageToolbar = function(field) {
6811        if(typeof PARENT == 'undefined' && typeof property.PARENT == 'undefined') return false;
6812        
6813        if(typeof field == 'undefined') field = '';
6814
6815        var this_page = (PAGE_MODE == 'c') ? PAGE : property.PAGE,
6816            this_view = (PAGE_MODE == 'c') ? VIEW : property.VIEW,
6817            eltype = (this_page.match(/^forum\,/) !== null) ? 'forum' : 'gallery',
6818            checkConfig = (PAGE_MODE == 'c') ? true : false,
6819            checkForum = (eltype == 'forum') ? true : false,
6820            checkGallery = (eltype == 'gallery') ? true : false,
6821            checkPlan = (checkConfig) ? VALIDPLAN : property.VALIDPLAN,
6822            checkMLock = (checkConfig) ? false : (typeof property.ISLOCK != 'undefined' && property.ISLOCK == 'true') ? true : false,
6823            parent = (checkConfig) ? PARENT : property.PARENT;
6824
6825        if(!this_view
6826            || (checkGallery && !checkConfig && (property.COUNT === 0 || $('.error_404.element[data-name="error_404"]').length === 1))
6827        ) return false;
6828
6829        var option = (parent.settings) ? jQuery.parseJSON(parent.settings) : {};
6830        option = setViewPageBottomDefaultSettings(option, parent, eltype);
6831        var check = {};
6832        if(checkGallery) {
6833            check = (field == '') ? {back:true, share:true, like:true, bottomnav:true, bottomlist:true} : {
6834                bottomlist: (field == 'bottomlist') ? true : false,
6835                share: (field == 'share') ? true : false,
6836                like: (field == 'like') ? true : false,
6837                bottomnav: (field == 'bottomnav') ? true : false,
6838            };
6839        } else {
6840            check = (field == '') ? {share:true, like:true, bottomnav:true, bottomlist:true} : {
6841                bottomlist: (field == 'bottomlist') ? true : false, 
6842                share: (field == 'share') ? true : false, 
6843                like: (field == 'like') ? true : false, 
6844                bottomnav: (field == 'bottomnav') ? true : false, 
6845            };
6846        }
6847        // console.log(option);
6848        if(checkMLock) return false;
6849        $.each(check, function(k,onoff) {
6850            if(!onoff) return true;
6851
6852            switch(k) {
6853                case 'back':
6854                    onoff = (typeof option.bottomNav_display != 'undefined' && option.bottomNav_display == 'ON') ? true : false;
6855                    if(onoff) $('.page-toolbars .toolbar-btn.back').removeClass('hide');
6856                    break
6857    
6858                case 'share':
6859                    onoff = (typeof option.sns_share_display != 'undefined' && option.sns_share_display == 'ON') ? true : false;
6860                    if(onoff) $('.page-toolbars .toolbar-btn.share').removeClass('hide');
6861                    break
6862    
6863                case 'like':
6864                    if(!checkPlan) break;
6865
6866                    onoff = (typeof option.like_display != 'undefined' && option.like_display != 'N') ? true : false;
6867                    // if(checkGallery && typeof option.field_disable != 'undefined' && option.field_disable && $.inArray('like', option.field_disable) > -1) onoff = false;
6868                    if(onoff) $('.page-toolbars .toolbar-btn.like').removeClass('hide');
6869                    break
6870    
6871                case 'bottomnav':
6872                    onoff = (typeof option.bottomNav_display != 'undefined' && option.bottomNav_display == 'ON') ? true : false;
6873                    if(onoff) $('.page-toolbars .toolbar-btn.bottomnav').removeClass('hide');
6874                    break
6875    
6876                case 'bottomlist':
6877                    onoff = (typeof option.bottomlist_display != 'undefined' && option.bottomlist_display == 'ON') ? true : false;
6878                    if(onoff) $.bottomlist.init();
6879                    break
6880    
6881                default:
6882                    break
6883            }
6884
6885        });
6886
6887        var $pbEl = $('[data-type="page_bottom"]').first();
6888        if($pbEl.length > 0) {
6889            var hasVisible = $pbEl.find('.toolbar-btn').not('.hide').length > 0
6890                          || $pbEl.find('.page-comments').length > 0
6891                          || $pbEl.find('.page-bottomlist').not('.hide').length > 0;
6892            $pbEl.toggleClass('empty', !hasVisible);
6893        }
6894    }
6895
6896    var initViewPageBottom = function(option, settings, viewData) { //page bottom
6897        var deferred = $.Deferred();
6898        if (typeof option == 'undefined') option = '';
6899
6900        let checkConfig = (PAGE_MODE == 'c') ? true : false;
6901        let $existingBottomEL = $('[data-type="page_bottom"]').first();
6902        let parent = (checkConfig) ? PARENT : property.PARENT;
6903
6904        if (typeof settings == 'undefined' || !settings) {
6905            settings = (parent && parent.settings) ? (typeof parent.settings == 'string' ? $.parseJSON(parent.settings) : parent.settings) : {};
6906        }
6907        let rawSettings = $.extend(true, {}, settings);
6908        settings = setViewPageBottomDefaultSettings(settings, parent, 'gallery');
6909        let view = (checkConfig) ? VIEW : property.VIEW;
6910        let parentSeq = parent.pid;
6911        let elClass = `el_${$('.element:not(.el-menu):not(.el-footer)').length}`;
6912        let dataCase = (typeof settings.pb_template_elname != 'undefined')? settings.pb_template_elname : '';
6913        if(!dataCase && $existingBottomEL.length > 0) dataCase = $existingBottomEL.attr('data-case');
6914        if(!dataCase) dataCase = 'page-bottom1';
6915        let configEL = `
6916                <div class="${elClass}_ctrl config-element-section" data-id="page_bottom_${parentSeq}"><div class="config-element"><svg viewBox="0 0 19 19" width="23" height="23"><path d="M17.16 8.16l1.41-1.51c-0.2-0.65-0.48-1.28-0.84-1.9 -0.35-0.61-0.77-1.17-1.23-1.67l-2.02 0.46c-0.7-0.58-1.48-1.03-2.32-1.34l-0.61-1.97C10.9 0.08 10.21 0 9.5 0 8.79 0 8.1 0.08 7.44 0.22L6.83 2.2h0C5.98 2.51 5.19 2.97 4.51 3.54L2.5 3.08c-0.46 0.5-0.87 1.06-1.23 1.67S0.64 6 0.44 6.65l1.4 1.52c-0.16 0.89-0.15 1.8 0 2.68l-1.41 1.51c0.2 0.65 0.48 1.28 0.84 1.9s0.77 1.17 1.23 1.67l2.02-0.46c0.7 0.58 1.48 1.03 2.32 1.34l0.61 1.97v0C8.1 18.92 8.79 19 9.5 19c0.71 0 1.4-0.08 2.06-0.22l0.61-1.97c0.85-0.31 1.63-0.77 2.32-1.34l2.01 0.46c0.46-0.5 0.87-1.06 1.23-1.67 0.35-0.61 0.63-1.25 0.84-1.9l-1.4-1.52C17.31 9.94 17.31 9.04 17.16 8.16zM9.5 15.5c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6S12.81 15.5 9.5 15.5z"/></svg></div></div>
6917                `;
6918        let $bottomEL = ($existingBottomEL.length > 0)
6919            ? $existingBottomEL
6920            : $(`<div class="element ${elClass} page_bottom_${parentSeq} page-bottom" data-id="page_bottom_${parentSeq}" data-el="${elClass}" data-parent-id="${parentSeq}" data-case="${dataCase}" data-type="page_bottom"></div>`);
6921        if(dataCase) {
6922            $bottomEL.attr('data-case', dataCase);
6923            $bottomEL.removeClass(function(i, cls) {
6924                return (cls.match(/\bpage-bottom\d+\b/) || []).join(' ');
6925            }).addClass(dataCase);
6926        }
6927
6928        initViewPageToolbar(option, settings, viewData).always(function(pageToolbar) {
6929            if (PAGE_MODE == 'c' && view && settings.comment_display == 'ON') displayComment();
6930            if (typeof setViewPageToolbar == 'function') {
6931                setViewPageToolbar();
6932            }
6933
6934            var attachBottomArea = function() {
6935                let $toolbarEL = $('.page-toolbars').first();
6936                let $commentEL = $('.page-comments').first();
6937                let $bottomlistEL = $('.page-bottomlist').first();
6938                if ($commentEL.length > 0) {
6939                    if (settings.comment_display == 'OFF') $commentEL.addClass('hide');
6940                    else if (settings.comment_display == 'ON') $commentEL.removeClass('hide');
6941                }
6942                let hasVisibleToolbar = ($toolbarEL.length > 0 && $toolbarEL.find('.toolbar-btn').not('.hide').length > 0);
6943                let hasVisibleComment = ($commentEL.length > 0 && !$commentEL.hasClass('hide'));
6944                let hasExplicitPageBottom = (
6945                    $existingBottomEL.length > 0
6946                    || typeof rawSettings.pb_template_seq != 'undefined'
6947                    || typeof rawSettings.pb_template_elname != 'undefined'
6948                    || typeof rawSettings.pb_blockname != 'undefined'
6949                );
6950                let isProjectGallery = (parent && parent.mode == 'project');
6951                let hasExplicitToolbarSetting = (
6952                    isProjectGallery
6953                    || hasExplicitPageBottom
6954                    || typeof rawSettings.bottomNav_display != 'undefined'
6955                    || typeof rawSettings.like_display != 'undefined'
6956                    || typeof rawSettings.sns_share_display != 'undefined'
6957                    || typeof rawSettings.bottomlist_display != 'undefined'
6958                );
6959                let hasExplicitCommentSetting = (isProjectGallery || hasExplicitPageBottom || typeof rawSettings.comment_display != 'undefined');
6960                let hasBottomChildren = (
6961                    (hasVisibleToolbar && hasExplicitToolbarSetting)
6962                    || (hasVisibleComment && hasExplicitCommentSetting)
6963                    || ($bottomlistEL.length > 0 && hasExplicitToolbarSetting)
6964                );
6965                if (!hasBottomChildren && !isProjectGallery) return false;
6966
6967                if ($bottomEL.parent().length === 0) {
6968                    let beforePositon = $('.el-footer').first();
6969                    if (checkConfig) {
6970                        if ($commentEL.length > 0) beforePositon = $commentEL;
6971                        else if ($bottomlistEL.length > 0) beforePositon = $bottomlistEL;
6972                        else if ($('.el-footer_ctrl').length > 0) beforePositon = $('.el-footer_ctrl').first();
6973                        else beforePositon = $('.add-footer-information').first();
6974                    }
6975                    if (beforePositon.length > 0) beforePositon.before($bottomEL);
6976                    else $('.dsgn-body').append($bottomEL);
6977                }
6978
6979                if ($toolbarEL.length > 0 && $toolbarEL.parent()[0] !== $bottomEL[0]) $bottomEL.prepend($toolbarEL);
6980                if ($commentEL.length > 0 && $commentEL.parent()[0] !== $bottomEL[0]) {
6981                    if ($bottomlistEL.length > 0 && $bottomlistEL.parent()[0] === $bottomEL[0]) $bottomlistEL.before($commentEL);
6982                    else $bottomEL.append($commentEL);
6983                }
6984                if ($bottomlistEL.length > 0 && $bottomlistEL.parent()[0] !== $bottomEL[0]) $bottomEL.append($bottomlistEL);
6985                return true;
6986            }
6987
6988            let hasBottomChildren = attachBottomArea();
6989            
6990            var hasVisible = $bottomEL.find('.toolbar-btn').not('.hide').length > 0
6991                          || $bottomEL.find('.page-comments').not('.hide').length > 0
6992                          || $bottomEL.find('.page-bottomlist').not('.hide').length > 0;
6993
6994            $bottomEL.toggleClass('empty', !hasVisible);
6995
6996            var _pb_settings = (typeof settings == 'string') ? $.parseJSON(settings) : settings;
6997            if(typeof setBlockAOS == 'function' && checkConfig == false) setBlockAOS($bottomEL, {block: _pb_settings, skipRefresh: true});
6998            if(typeof setBlockParallax == 'function' && _pb_settings.pb_parallax == 'true') {
6999                $bottomEL.attr({'data-parallax':'true', 'data-parallax-effect': _pb_settings.pb_parallax_effect || 'fixed'});
7000                if(_pb_settings.pb_parallax_media) $bottomEL.attr('data-parallax-media', _pb_settings.pb_parallax_media);
7001                if(typeof setBlockElem == 'function') setBlockElem($bottomEL);
7002                setBlockParallax($bottomEL);
7003            } else if(typeof setBlockParallax == 'function') {
7004                $bottomEL.removeAttr('data-parallax data-parallax-effect data-parallax-media');
7005            }
7006            var _pb_siteSettings = (checkConfig) ? SETTINGS : property.SETTINGS;
7007            var _pbHasBookmark = (parentSeq && _pb_siteSettings && _pb_siteSettings.blockBookmarkList && typeof _pb_siteSettings.blockBookmarkList['bookmarkpb' + parentSeq] != 'undefined');
7008            if(_pbHasBookmark) $bottomEL.attr('data-bookmark', 'pb' + parentSeq);
7009            else $bottomEL.removeAttr('data-bookmark');
7010            var _pb_colorset = (_pb_settings.viewpage_colorset) ? _pb_settings.viewpage_colorset : {};
7011            if(typeof _pb_colorset.__pb_content_wrap_width != 'undefined' && _pb_colorset.__pb_content_wrap_width == '100%') {
7012                $bottomEL.addClass('full-width');
7013            } else {
7014                $bottomEL.removeClass('full-width');
7015            }
7016
7017            if (checkConfig && hasBottomChildren && $('[data-type="page_bottom"].config-element-section').length === 0) {
7018                $bottomEL.before(configEL);
7019            }
7020
7021            deferred.resolve(($bottomEL.length > 0 && hasBottomChildren)
7022                ? $bottomEL
7023                : ((typeof pageToolbar != 'undefined' && pageToolbar) ? pageToolbar : $('.page-toolbars')));
7024        });
7025        return deferred.promise();
7026    }
7027    var setViewPageStyle = function() {
7028        $('body').find('.clViewPageStyle').remove();
7029        if(typeof PAGE_MODE == 'undefined') return false;
7030
7031        var tmp_v = (PAGE_MODE == 'c') ? VIEW : property.VIEW;
7032        var tmp_parent = (PAGE_MODE == 'c') ? PARENT : property.PARENT;
7033        var tmp_page = (PAGE_MODE == 'c') ? PAGE : property.PAGE;
7034        if(!tmp_v) return false;
7035
7036        var checkGalleryView = (tmp_v && tmp_page.match(/^forum,/g) === null) ? true : false;
7037        var checkForumView = !checkGalleryView;
7038
7039        var elid = tmp_parent.pid;
7040        var elname = tmp_parent.element;
7041        var elcss = (typeof tmp_parent.elcss != 'undefined') ? CSSJSON.toJSON(htmlspecialchars_decode(tmp_parent.elcss)) : CSSJSON.toJSON;
7042        var elstyle = style.get(elcss,`.${elname}`);
7043        var elsettings = (typeof tmp_parent.settings != 'undefined') ? $.parseJSON(tmp_parent.settings) : {};
7044        var viewcss = {root:'', body:'', add:''};
7045
7046        var body_selector = (isElview) ? 'body' : 'body > .dsgn-body';
7047        var body_s = {background_image:'none'};
7048        if(!elstyle.undefined) {
7049            if(Coloris.getColorRegex().test(elstyle.bgColor)) body_s.background_color = elstyle.bgColor;
7050            if(elstyle.bgUrl != '') body_s.background_image = elstyle.bgUrl;
7051            if(elstyle.bgPosition != '') body_s.background_position = elstyle.bgPosition;
7052            if(elstyle.bgRepeat != '') body_s.background_repeat = elstyle.bgRepeat;
7053            if(elstyle.bgSize != '') body_s.background_size = elstyle.bgSize;
7054        }
7055
7056        if(checkGalleryView) {
7057            var galproject_style = style.get(elcss,`.${elname} .galProjectBg`);
7058            if(!galproject_style.undefined) {
7059                if(Coloris.getColorRegex().test(galproject_style.bgColor)) body_s.background_color = galproject_style.bgColor;
7060                if(galproject_style.bgUrl != '') body_s.background_image = galproject_style.bgUrl;
7061                if(galproject_style.bgPosition != '') body_s.background_position = galproject_style.bgPosition;
7062                if(galproject_style.bgRepeat != '') body_s.background_repeat = galproject_style.bgRepeat;
7063                if(galproject_style.bgSize != '') body_s.background_size = galproject_style.bgSize;
7064            }
7065        } else {
7066        }
7067
7068        Object.keys(body_s).forEach(function(key) {
7069            viewcss.body += `${key.replace(/_/g, '-')}: ${body_s[key]}; `;
7070        });
7071
7072        if(checkForumView) {
7073            // old version
7074            if(typeof elstyle.__forum_color == 'undefined') {
7075                elstyle.__forum_color = (typeof elsettings.forum_color != 'undefined') ? elsettings.forum_color : '#191919';
7076                if($.inArray(elstyle.__forum_color, ['black','white']) > -1) elstyle.__forum_color = (elstyle.__forum_color == 'white') ? '#ffffff' : '#191919';
7077                elstyle.__forum_color_rgb = Coloris.getChangeColorVal(elstyle.__forum_color,'rgb_str');
7078            }
7079
7080            var f_color = elstyle.__forum_color;
7081            var f_color_rgb = elstyle.__forum_color_rgb;
7082            viewcss.root += `
7083                --forum-color: ${f_color};
7084                --forum-color-rgb: ${f_color_rgb};
7085            `;
7086            viewcss.add += `
7087                .forum-view .forum-write .tpl-forum-title {
7088                    font-size: 2em;
7089                    font-family: 'Noto Sans','Noto Sans Kr';
7090                    height: auto;
7091                    line-height: 1.4;
7092                }
7093                .forum-user-info li.user-ctrl .dropdown-menu {
7094                    ${viewcss.body} 
7095                }
7096            `;
7097        }
7098
7099        if(typeof elsettings.viewpage_colorset !== 'undefined') {
7100            Object.keys(elsettings.viewpage_colorset).forEach(function(key) {
7101                var cssKey = key.replace(/_/g, '-');  // _를 -로 변경
7102                var cssValue = elsettings.viewpage_colorset[key];
7103                if(key == '__pb_background_image_url' && cssValue && cssValue != 'none') cssValue = 'url(' + cssValue + ')';
7104                viewcss.root += `${cssKey}: ${cssValue}; `;
7105
7106                if(checkForumView) {
7107                    var checkColorRgb = ($.inArray(key, ['__like_color','__like_color_active','__share_color','__comment_color']) > -1) ? true : false;
7108                    if(checkColorRgb) {
7109                        viewcss.root += `${cssKey}-rgb: ${Coloris.getChangeColorVal(cssValue,'rgb_str')}; `;
7110                    }
7111                }
7112            });
7113        } else {
7114            var block_color = getOrDefault(elsettings,`${checkForumView ? 'forum' : 'gallery'}_color`,''),
7115                root_color = {
7116                    comment: {default:'#222428', placeholder:'rgba(34,36,40,0.8)', disabled:'rgba(34,36,40,0.05)', line:'rgba(34,36,40,0.2)', radius: '0px', shadow: 'none'},
7117                    like: {default:'#505050', active:'#ee445f'},
7118                    share: '#505050',
7119                    bottomnav: {default:'#505050', disabled:'rgba(80,80,80,0.2)'},
7120                    bottomlist: {default:'#777777', disabled:'rgba(119,119,119,0.2)'},
7121                };
7122            if($.inArray(block_color, ['black','white']) > -1) block_color = (block_color == 'white') ? '#ffffff' : '#191919';
7123            console.log('block_color', block_color);
7124            if(block_color) {
7125                if(checkGalleryView) { // gallery
7126                    root_color.comment = {default:block_color, placeholder:Coloris.getChangeColorVal(block_color,'a',0.8), disabled:Coloris.getChangeColorVal(block_color,'a',0.05), line:root_color.comment.line};
7127                    root_color.share = block_color;
7128                    root_color.bottomnav = {default:block_color, disabled:Coloris.getChangeColorVal(block_color,'a',0.2)};
7129                    root_color.bottomlist = {default:block_color, disabled:Coloris.getChangeColorVal(block_color,'a',0.2)};
7130                } else { // forum
7131                    root_color.comment = {default:block_color, placeholder:Coloris.getChangeColorVal(block_color,'a',0.8), disabled:Coloris.getChangeColorVal(block_color,'a',0.05), line:Coloris.getChangeColorVal(block_color,'a',0.2)};
7132                    root_color.share = block_color;
7133                    root_color.bottomnav = {default:block_color, disabled:Coloris.getChangeColorVal(block_color,'a',0.2)};
7134                    root_color.bottomlist = {default:block_color, disabled:Coloris.getChangeColorVal(block_color,'a',0.2)};
7135                }
7136            }
7137
7138            if(checkGalleryView) {
7139                if(getOrDefault(elsettings,'gl_like_color','') != '') root_color.like.default = elsettings.gl_like_color;
7140                if(getOrDefault(elsettings,'gl_likeActive_color','') != '') root_color.like.active = elsettings.gl_likeActive_color;
7141            }
7142            if(checkForumView) {
7143                if(getOrDefault(elsettings,'fm_like_color','') != '') root_color.like.default = elsettings.fm_like_color;
7144                if(getOrDefault(elsettings,'fm_likeActive_color','') != '') root_color.like.active = elsettings.fm_likeActive_color;
7145            }
7146
7147            viewcss.root += `
7148                --comment-color: ${root_color.comment.default};
7149                --comment-color-placeholder: ${root_color.comment.placeholder};
7150                --comment-color-disabled: ${root_color.comment.disabled};
7151                --comment-line: ${root_color.comment.line};
7152                --comment-radius: ${root_color.comment.radius};
7153                --comment-shadow: ${root_color.comment.shadow};
7154                --like-color: ${root_color.like.default};
7155                --like-color-active: ${root_color.like.active};
7156                --share-color:  ${root_color.share};
7157                --bottomnav-color: ${root_color.bottomnav.default};
7158                --bottomnav-color-disabled': ${root_color.bottomnav.disabled};
7159                --bottomlist-color': ${root_color.bottomlist.default};
7160                --bottomlist-color-disabled': ${root_color.bottomlist.disabled};
7161            `;
7162        }
7163        
7164        var viewcss_str = `
7165            :root { /* Viewpage Root Style */
7166                ${viewcss.root}
7167            }
7168
7169            ${body_selector} {
7170                ${viewcss.body}
7171                height: auto !important;
7172            }
7173            .page-comments .tpl-comment-form { border-radius: var(--comment-radius); box-shadow: var(--comment-shadow); }
7174            ${viewcss.add}
7175        `;
7176
7177        var isElview = ($('.elviewcss').length > 0) ? true : false;
7178        if (isElview) $('.elviewcss').after(`<style class="clViewPageStyle">${viewcss_str}</style>`);
7179        else $('#dsgn-body').after(`<style class="clViewPageStyle">${viewcss_str}</style>`);
7180    }
7181
7182
7183    var appendGalleryFrame = function(tpl,id,type,elsettings) {
7184        if(typeof tpl == 'undefined') return '';
7185        if(typeof id == 'undefined') return tpl;
7186        if(typeof type == 'undefined' || !type) type = 'gallery';
7187
7188        var gframe_selector = (type == 'sync') ? `sframe-${id}` : `gframe-${id}`;
7189        tpl.find('[data-gallery]').attr('data-gallery', `#${gframe_selector}`);
7190
7191        var settings = (typeof elsettings == 'object') ? elsettings : {};
7192        if ($.isEmptyObject(settings)) settings = (typeof elsettings != 'undefined' && elsettings) ? $.parseJSON(elsettings) : {};
7193
7194        var img_onoff = (typeof settings.img_original_display != 'undefined' && settings.img_original_display) ? settings.img_original_display : 'ON',
7195            title_onoff = (typeof settings.gframe_title_visible != 'undefined' && settings.gframe_title_visible == 'OFF') ? 'OFF' : 'ON',
7196            like = (typeof settings.like_display != 'undefined' && settings.like_display) ? settings.like_display : 'N';
7197
7198        tpl.find('[data-gallery]').attr({ 'data-img-original': img_onoff, 'data-gallery-title': title_onoff, 'data-gallery-like': like });
7199        if (!title_onoff) tpl.find('[data-gallery]').attr({ 'data-title': '' });
7200
7201        galleryFrame(id,type,settings);
7202        return tpl;
7203    }
7204    var galleryFrame = function(id,type,settings) {
7205        if(typeof id == 'undefined') id = '';
7206        if(typeof type == 'undefined' || !type) type = 'gallery';
7207        if(typeof settings == 'undefined' || typeof settings != 'object') settings = {};
7208        // console.log(id,type,settings);
7209        var autoplay = (typeof settings.gframe_autoplay != 'undefined' && settings.gframe_autoplay == 'ON') ? true : false,
7210            interval = (typeof settings.gframe_interval != 'undefined' && settings.gframe_interval) ? settings.gframe_interval : 5000,
7211            like_color = (typeof settings.viewpage_colorset != 'undefined' && typeof settings.viewpage_colorset.__like_color != 'undefined' && Coloris.getColorRegex().test(settings.viewpage_colorset.__like_color)) ? settings.viewpage_colorset.__like_color : '#505050',
7212            like_color_active = (typeof settings.viewpage_colorset != 'undefined' && typeof settings.viewpage_colorset.__like_color_active != 'undefined' && Coloris.getColorRegex().test(settings.viewpage_colorset.__like_color_active)) ? settings.viewpage_colorset.__like_color_active : '#ee445f';
7213        var gframe_selector = (type == 'sync') ? `sframe-${id}` : `gframe-${id}`;
7214        let isYoutubeShorts = false;
7215
7216        if(type == 'video') {
7217            let type2 = $('.element[data-id="' + id + '"]').attr('data-type2');
7218            if(type2 == 'shorts') isYoutubeShorts = true;
7219        }
7220        $(`#${gframe_selector}`).remove();
7221        var str = `
7222            <div id="${gframe_selector}" class="blueimp-gallery blueimp-gallery-controls" data-start-slideshow="${(autoplay) ? 'true' : 'false'}" data-slideshow-interval="${interval}" data-yt-shorts="${isYoutubeShorts}">
7223                <div class="slides"></div>
7224                <div class="zoomable hide"></div>
7225                <h3 class="title"></h3>
7226                <a class="prev"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44" width="44" height="44"><path d="M31.33 42 12 22 31.33 2l.67.69L13.34 22 32 41.31z"/></svg></a>
7227                <a class="next"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44" width="44" height="44"><path d="M12.67 2 32 22 12.67 42l-.67-.69L30.66 22 12 2.69z"/></svg></a>
7228                ${(type == 'gallery') ? '<div class="slide-index"><span class="current-slide"></span>/<span class="total-slide"></span></div>' : ''}
7229                <a class="close"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22" width="22" height="22"><polygon points="22 1.06 20.94 0 11 9.94 1.06 0 0 1.06 9.94 11 0 20.94 1.06 22 11 12.06 20.94 22 22 20.94 12.06 11 "/></svg></a>
7230                <a class="play-pause">
7231                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="m5.3 4.08 17 9.92-17 9.92V4.08m-.4-2.1c-.73 0-1.4.58-1.4 1.4v21.24a1.397 1.397 0 0 0 2.1 1.21l18.19-10.62c.93-.54.93-1.88 0-2.42L5.61 2.17c-.23-.13-.47-.19-.71-.19z"/></svg>
7232                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path d="M7.6 25.5c-.77 0-1.4-.63-1.4-1.4V3.9c0-.77.63-1.4 1.4-1.4.77 0 1.4.63 1.4 1.4v20.2c0 .77-.63 1.4-1.4 1.4zM20.4 25.5c-.77 0-1.4-.63-1.4-1.4V3.9c0-.77.63-1.4 1.4-1.4.77 0 1.4.63 1.4 1.4v20.2c0 .77-.63 1.4-1.4 1.4z"/></g></svg>
7233                </a>
7234                <a class="gallery-like"></a>
7235                <ol class="indicator"></ol>
7236            </div>
7237        `;
7238
7239            // https://flow.team/l/1meSh
7240            // $(`.${type}-frame`).append(str);
7241            // document.querySelector(`#${gframe_selector}`).style.setProperty('--like-color', like_color, null);
7242            // document.querySelector(`#${gframe_selector}`).style.setProperty('--like-color-active', like_color_active, null);
7243
7244            $(`.${type}-frame`).append(str);
7245            var gframeEl = document.querySelector(`#${gframe_selector}`);
7246
7247            if (gframeEl) {
7248                gframeEl.style.setProperty('--like-color', like_color, null);
7249                gframeEl.style.setProperty('--like-color-active', like_color_active, null);
7250            } else {
7251                console.log('엘리먼트가 아직 DOM에 없음');
7252                setTimeout(function() {
7253                    var gframeElRetry = document.querySelector(`#${gframe_selector}`);
7254                    if (gframeElRetry) {
7255                        gframeElRetry.style.setProperty('--like-color', like_color, null);
7256                        gframeElRetry.style.setProperty('--like-color-active', like_color_active, null);
7257                    }
7258                }, 0); 
7259            }
7260
7261        // $(`#${gframe_selector}`).on('close', function (event) {
7262        //     console.log('lightbox close');
7263        // });
7264    }
7265
7266    // 인증창 호출 함수
7267    function auth_type_check(outside) {
7268        if (typeof outside === 'undefined' || !outside) outside = false;
7269
7270        var auth_form = document.form_auth;
7271
7272        // if (auth_form.ordr_idxx.value == "") {
7273        //     alert("요청번호는 필수 입니다.");
7274        //     return false;
7275        // } else {
7276        var hostname = window.location.hostname;
7277        var checkDomain = !(hostname.includes('creatorlink') || hostname.includes('addblock'));
7278
7279        if (checkDomain && window.location.protocol == 'http:') {
7280            alert($.lang[LANG]['manager.cert.disable.domain']);
7281            return false
7282        }
7283
7284        if(isMobile()) {
7285            if (window.sessionStorage) {
7286                sessionStorage.removeItem('kcpCertSubmitting');
7287                sessionStorage.setItem('kcpCertReturnUrl', window.location.href);
7288            }
7289            auth_form.target = "_self";
7290        } else { // 스마트폰이 아닌경우
7291            var return_gubun;
7292            var width = 410;
7293            var height = 500;
7294
7295            var leftpos = screen.width / 2 - (width / 2);
7296            var toppos = screen.height / 2 - (height / 2);
7297
7298            var winopts = "width=" + width + ", height=" + height + ", toolbar=no,status=no,statusbar=no,menubar=no,scrollbars=no,resizable=no";
7299            var position = ",left=" + leftpos + ", top=" + toppos;
7300            var AUTH_POP = window.open('', 'auth_popup', winopts + position);
7301
7302            auth_form.target = "auth_popup"; // !!주의 고정값 ( 리턴받을때 사용되는 타겟명입니다.)
7303        }
7304
7305        auth_form.method = "post";
7306
7307        // 인증창 호출 및 결과값 리턴 페이지 주소
7308        if(window.location.pathname.includes('/upgrade') || window.location.pathname.includes('/mypage') || window.location.pathname.includes('/dashboard')) {
7309            auth_form.action = '/upgrade_cert_req';
7310        } else {
7311            auth_form.action = "/cert_req";
7312        }
7313
7314        if (outside) {
7315            auth_form.submit();
7316            return false;
7317        } else {
7318            return true;
7319        }
7320        // }
7321    }
7322
7323    // 요청번호 생성 예제 ( up_hash 생성시 필요 ) 
7324    function init_orderid() {
7325        var today = new Date();
7326        var year = today.getFullYear();
7327        var month = today.getMonth() + 1;
7328        var date = today.getDate();
7329        var time = today.getTime();
7330
7331        if (parseInt(month) < 10) {
7332            month = "0" + month;
7333        }
7334
7335        var vOrderID = year + "" + month + "" + date + "" + time;
7336
7337        if (document.form_auth !== undefined && document.form_auth.ordr_idxx) {
7338            document.form_auth.ordr_idxx.value = vOrderID;
7339        }
7340
7341        return vOrderID;
7342    }
7343
7344    $(function() {
7345        if (!isMobile() || !window.sessionStorage) return;
7346
7347        var certResult = sessionStorage.getItem('kcpCertResult');
7348        if (!certResult) return;
7349
7350        try {
7351            certResult = JSON.parse(certResult);
7352            var retryCount = 0;
7353            var handleCertResult = function() {
7354                if (typeof document.form_auth === 'undefined' || (certResult.start_page == 'myinfo' && $("form[name='myinfo_form']").length == 0)) {
7355                    if (retryCount++ < 50) {
7356                        setTimeout(handleCertResult, 100);
7357                        return;
7358                    }
7359                }
7360
7361                sessionStorage.removeItem('kcpCertResult');
7362                sessionStorage.removeItem('kcpCertReturnUrl');
7363                sessionStorage.removeItem('kcpCertSubmitting');
7364
7365                if (typeof window.call_auth_data === 'function') {
7366                    window.call_auth_data(certResult);
7367                } else if (typeof window.auth_data === 'function') {
7368                    window.auth_data(certResult);
7369                }
7370            };
7371            setTimeout(handleCertResult, 0);
7372        } catch(e) {
7373            alert(e);
7374        }
7375    });
7376 
7377    function slideEffectClassAdd($el) {
7378        $el.find('.cl_caption').addClass('slide-effect-target');
7379        $el.find('.head_title').addClass('slide-effect-target');
7380        $el.find('.figure-title').addClass('slide-effect-target');
7381        
7382        var $target_during = $($el).attr('effect-during');
7383        
7384        if ($target_during) {
7385            // data-slide-effect-during 값(밀리초 단위)을 초 단위로 변환합니다.
7386            $target_during = parseFloat($target_during) / 1000;
7387            $el[0].style.setProperty('--anim-during', $target_during+'s');
7388        }
7389
7390        if($el.attr('data-slide-effect') == 'zoomin' || $el.attr('data-slide-effect') == 'zoomout') {
7391            $el.find('.slide-effect-target').each(function() {
7392                $(this).children().wrapAll('<div class="zoomAnimation" ></div>');
7393            });
7394        }        
7395    }
7396    // JH Animation Slideshow53 블럭 화살표 클릭 시 애니메이션 바로 적용
7397    $('[data-type="showcase"][data-case="slideshow53"] .carousel-control').live('click',function(){
7398        var $target = $(this).closest('[data-slide-effect]');
7399        var originalSlideEffectVal = $target.attr('data-slide-effect');
7400        $target.attr('data-slide-effect', '');
7401        requestAnimationFrame(function () {
7402            $target.attr('data-slide-effect', originalSlideEffectVal);
7403        });      
7404    });
7405    // 인증창 종료후 인증데이터 리턴 함수
7406    function auth_data(frm) {
7407        var auth_form = document.form_auth;
7408        // var nField        = frm.elements.length;
7409        // var response_data = "";
7410
7411        // up_hash 검증 (V2에서는 up_hash 미사용으로 값이 있을 때만 검증)
7412        if (frm.up_hash && auth_form.veri_up_hash && frm.up_hash != auth_form.veri_up_hash.value) {
7413            alert("up_hash 변조 위험있음");
7414        }
7415
7416        /* 리턴 값 모두 찍어보기 (테스트 시에만 사용) */
7417        // var form_value = "";
7418
7419        // for ( i = 0 ; i < frm.length ; i++ )
7420        // {
7421        //     form_value += "["+frm.elements[i].name + "] = [" + frm.elements[i].value + "]\n";
7422        // }
7423        // console.log(form_value);
7424        if (frm.res_cd == '0000' && frm.birth_day !== undefined) {
7425            var yyyy = frm.birth_day.substr(0, 4);
7426            var mm = frm.birth_day.substr(4, 2);
7427            var dd = frm.birth_day.substr(6, 2);
7428        }
7429
7430        switch (frm.start_page) {
7431            case 'register':
7432            case 'myinfo':
7433                if (frm.res_cd == '0000') {
7434                    $('button.btn-cert').text($.lang[LANG]['siteum.regexp.complete.cert']).prop('disabled', true);
7435                    if (frm.start_page == 'register') loadRegisterField();
7436                } else {
7437                    if (frm.res_cd == 'exist') {
7438                        var error_title = '';
7439                        var error_msg = '';
7440                        var find_btn = $.lang[LANG]['siteum.forgot.id.link'];
7441                        if (frm.um_id != '') {
7442                            if (frm.start_page == 'register') {
7443                                error_title = $.lang[LANG]['siteum.cert.already.registered'];
7444                                error_msg = $.lang[LANG]['siteum.cert.already.registered.txt'] + '<div class="user-id">' + frm.um_id + '</div>';
7445                            } else {
7446                                error_title = $.lang[LANG]['siteum.cert.already.cert'];
7447                                error_msg = $.lang[LANG]['siteum.cert.already.cert.txt'] + '<div class="user-id">' + frm.um_id + '</div>';
7448                            }
7449
7450                            find_btn = $.lang[LANG]['siteum.forgot.pw.link'];
7451                        }
7452                        $(this).showModalFlat(error_title, error_msg, true, true, function() {
7453                            $('input[name="sns_key"]').val('');
7454                            console.log($('input[name="sns_key"]'));
7455                            $.getJSON('/umember/login/out', function(r) {
7456                                // if (frm.start_page == 'myinfo') {
7457                                //     if ($.cookie('cert_popup') !== undefined) {
7458                                //         $.removeCookie('cert_popup', true, { path: '/', expires: 12 * 60 * 60 * 1000 });
7459                                //     }
7460                                // }
7461                                location.href = '/_login';
7462                            }, 'json');
7463                        }, 'close', $.lang[LANG]['siteum.cert.login'], 'modal-dialog cl-cmmodal cl-s-btn w560 cl-p70 cl-modal cl-close-btn user-exist-modal', '');
7464                    } else if (frm.res_cd == 'not_adult') {
7465                        $(this).showModalFlat($.lang[LANG]['siteum.cert.adult.cannot.complete'], $.lang[LANG]['siteum.cert.adult.cannot.complete.txt'], true, false, '', 'ok', '', 'modal-dialog cl-cmmodal cl-s-btn w560 cl-p70 cl-modal cl-close-btn');
7466                    }
7467
7468                    return false;
7469                }
7470                var sid = frm.sid;
7471                var gender = (frm.sex_code !== undefined && frm.sex_code) ? ((frm.sex_code == '01') ? '남' : '여') : '';
7472                $('#input-name').val(frm.user_name).addClass('has-value');
7473                $('#input-birth').val(yyyy + '-' + mm + '-' + dd).addClass('has-value');
7474                $('#input-tel').val(frm.phone_no).addClass('has-value');
7475                $('#input-gender').val(frm.sex_code).addClass('has-value');
7476                $('.certified-info .input-name').text(frm.user_name);
7477                $('.certified-info .input-birth').text(yyyy + '. ' + mm + '. ' + dd + '.');
7478                $('.certified-info .input-tel').text(frm.phone_no.replace(/^(\d{3})(\d{3,4})(\d{4})$/, '$1-$2-$3'));
7479                $('.certified-info .input-gender').text(gender);
7480                $('#cert_data').val(frm.cert_data);
7481                // $('#ci_url').val(frm.ci_url);
7482                // $('#di_url').val(frm.di_url);
7483                $('.cl-s-register-btn').removeClass('hide');
7484                $('.cl-s-cert').addClass('hide');
7485                if (frm.start_page == 'myinfo') {
7486                    var formData = $("form[name='myinfo_form']").serializeObject();
7487                    $.ajax({
7488                        url: '/_myinfo_proc',
7489                        data: { sid: sid, data: JSON.stringify(formData) },
7490                        dataType: 'json',
7491                        type: 'POST',
7492                        async: false,
7493                        cache: false,
7494                        success: function(data) {
7495                            // console.log(data);
7496                            location.reload();
7497                        }
7498                    });
7499                }
7500                break;
7501            case 'find_id':
7502                if (frm.res_cd == '0000') {
7503                    $('.cl-s-forgot-box').addClass('hide');
7504                    $('.forgot-result').removeClass('hide');
7505                    $('.forgot-result .user-id').text(frm.um_id);
7506                } else {
7507                    $(this).showModalFlat($.lang[LANG]['siteum.forgot.id.invalid'], $.lang[LANG]['siteum.forgot.id.invalid.txt'], true, true, function() {
7508                        location.href = '/_register';
7509                    }, 'close', $.lang[LANG]['siteum.forgot.id.register'], 'modal-dialog cl-cmmodal cl-s-btn w560 cl-p70 cl-modal cl-close-btn', '');
7510                    return false;
7511                }
7512                break;
7513            case 'sitelock':
7514                break;
7515        }
7516    }
7517
7518    var iconShowHide = function() {
7519        var body_w = $('body').width();
7520        $('.template-mode').removeClass('active');
7521        if (body_w >= 1200) {
7522            $('.template-desktop, .template-tablet, .template-mobile').show();
7523            $('.template-desktop').addClass('active');
7524        } else if (body_w <= 1199 && body_w >= 768) {
7525            $('.template-desktop').hide();
7526            $('.template-tablet, .template-mobile').show();
7527            $('.template-tablet').addClass('active');
7528        } else if (body_w <= 767) {
7529            $('.template-desktop, .template-tablet').hide();
7530            $('.template-mobile').show().addClass('active');
7531        }
7532    }
7533
7534    var checkOS = function() {
7535        var os, ua = navigator.userAgent;
7536        if (ua.match(/Win(dows )?NT 6\.0/)) {
7537            os = "Windows Vista";
7538        } else if (ua.match(/Win(dows )?(NT 5\.1|XP)/)) {
7539            os = "Windows XP";
7540        } else {
7541            if ((ua.indexOf("Windows NT 5.1") != -1) || (ua.indexOf("Windows XP") != -1)) {
7542                os = "Windows XP";
7543            } else if ((ua.indexOf("Windows NT 7.0") != -1) || (ua.indexOf("Windows NT 6.1") != -1)) {
7544                os = "Windows 7";
7545            } else if ((ua.indexOf("Windows NT 8.0") != -1) || (ua.indexOf("Windows NT 6.2") != -1)) {
7546                os = "Windows 8";
7547            } else if ((ua.indexOf("Windows NT 8.1") != -1) || (ua.indexOf("Windows NT 6.3") != -1)) {
7548                os = "Windows 8.1";
7549            } else if ((ua.indexOf("Windows NT 10.0") != -1) || (ua.indexOf("Windows NT 6.4") != -1)) {
7550                os = "Windows 10";
7551            } else if ((ua.indexOf("iPad") != -1) || (ua.indexOf("iPhone") != -1) || (ua.indexOf("iPod") != -1)) {
7552                os = "Apple iOS";
7553            } else if (ua.indexOf("Android") != -1) {
7554                os = "Android OS";
7555            } else if (ua.match(/Win(dows )?NT( 4\.0)?/)) {
7556                os = "Windows NT";
7557            } else if (ua.match(/Mac|PPC/)) {
7558                os = "Mac OS";
7559            } else if (ua.match(/Linux/)) {
7560                os = "Linux";
7561            } else if (ua.match(/(Free|Net|Open)BSD/)) {
7562                os = RegExp.$1 + "BSD";
7563            } else if (ua.match(/SunOS/)) {
7564                os = "Solaris";
7565            }
7566        }
7567        if (os.indexOf("Windows") != -1) {
7568            if (navigator.userAgent.indexOf('WOW64') > -1 || navigator.userAgent.indexOf('Win64') > -1) {
7569                os += ' 64bit';
7570            } else {
7571                os += ' 32bit';
7572            }
7573        }
7574        return os;
7575    }
7576
7577    var checkBrowser = function() {
7578        var agt = navigator.userAgent.toLowerCase();
7579        if (agt.indexOf("chrome") != -1) return 'Chrome';
7580        if (agt.indexOf("opera") != -1) return 'Opera';
7581        if (agt.indexOf("staroffice") != -1) return 'Star Office';
7582        if (agt.indexOf("webtv") != -1) return 'WebTV';
7583        if (agt.indexOf("beonex") != -1) return 'Beonex';
7584        if (agt.indexOf("chimera") != -1) return 'Chimera';
7585        if (agt.indexOf("netpositive") != -1) return 'NetPositive';
7586        if (agt.indexOf("phoenix") != -1) return 'Phoenix';
7587        if (agt.indexOf("firefox") != -1) return 'Firefox';
7588        if (agt.indexOf("safari") != -1) return 'Safari';
7589        if (agt.indexOf("skipstone") != -1) return 'SkipStone';
7590        if (agt.indexOf("netscape") != -1) return 'Netscape';
7591        if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
7592        if (agt.indexOf("msie") != -1) {
7593            let rv = -1;
7594            if (navigator.appName == 'Microsoft Internet Explorer') {
7595                let ua = navigator.userAgent;
7596                var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
7597                if (re.exec(ua) != null)
7598                    rv = parseFloat(RegExp.$1);
7599            }
7600            return 'Internet Explorer ' + rv;
7601        }
7602    }
7603
7604    /**************************************************************************************** Change Profile */
7605    $('.change-profile, .profile_left').live('click', function(e) {
7606        if ($('script[src="/js/jquery.fileupload.js"]').length == 0) $('head').append('<script type="text/javascript" src="/js/jquery.fileupload.js"></script>');
7607
7608        if($(this).hasClass('signinwrap_logo')) return;
7609
7610        var name = ($(this).attr('class').indexOf('change-profile') > -1) ? $('.site-username').attr('data-user-name') : $('.profile_left').find('.m-profile').text().trim(),
7611            img = ($(this).attr('class').indexOf('change-profile') > -1) ? $('svg.change-profile').attr('data-user-img') : $('label.m-profile').attr('data-user-img'),
7612            paid = ($(this).attr('class').indexOf('change-profile') > -1) ? $('svg.change-profile').attr('data-user-plan') : $('label.m-profile').attr('data-user-plan'),
7613            check_um = ($(this).attr('class').indexOf('change-profile') > -1) ? $('svg.change-profile').attr('data-user-um') : $('label.m-profile').attr('data-user-um');
7614        if (check_um == 'um-profile') {
7615            //var mypageModal = $.umember.showMypageModal('<?=$mb["sid"]?>');
7616            var url = '/_myinfo';
7617            location.href = url;
7618        } else if (paid == 'true') {
7619            img = (typeof img == 'undefined' || img == '') ? 'https://storage.googleapis.com/i.addblock.net/member/profile_default.jpg' : img + '?_' + new Date().getTime();
7620            var str = '\
7621                <div class="dashboard-profile">\
7622                    <div class="dashboard-userimg dashboard-user-wrap">\
7623                        <svg viewBox="0 0 110 110" >\
7624                            <pattern id="dashboard-image-popup" patternUnits="userSpaceOnUse" width="120" height="120">\
7625                                <image xlink:href="' + img + '" x="0" width="110" height="110" />\
7626                            </pattern>\
7627                            <circle cx="55" cy="56" r="54" fill="url(#dashboard-image-popup)" stroke="#eeeff0"></circle>\
7628                        </svg>\
7629                    </div>\
7630                    <span class="fileinput-button profile-text-box">\
7631                        <label for="siteProfilefileupload">' + $.lang[LANG]['siteum.mypage.change.image'] + '</label>\
7632                        <input id="siteProfilefileupload" class="modal-upload-button site-profile-upload-btn" type="file" name="files[]">\
7633                    </span>\
7634                    <p class="p-text">' + $.lang[LANG]['dash.siteprofile.modal.nickname'] + $.lang[LANG]['account.modal.edit-image.size'] + '</p>\
7635                    <div class="section-username">\
7636                        <div class="input-group cl-common-form-wrap mypage-cl-form-wrap">\
7637                            <div class="cl-common-form-group cl-userNick-wrap">\
7638                                <input type="text" class="input-userNickname" name="usernick_name" required="required"  value="' + name + '">\
7639                                <label for="input" id="username-label" class="cl-common-control-label change-username-label">' + $.lang[LANG]['account.modal.edit-image.nickname'] + '</label>\
7640                            </div>\
7641                        </div>\
7642                        <p class="siteprofileImg_notice"><span class="profilenotice_icon">※</span><span class="profilenotice_txt">' + $.lang[LANG]['dash.siteprofile.modal.nickname.notice'] + '</span</p>\
7643                    </div>\
7644                    <ul class="hide uploadfiles"></ul>\
7645                </div>\
7646            ';
7647
7648            if ($(this).hasClass('profile_left')) $('.m-header_user.menu, .btn-box.m-headerClose.in ').css('zIndex', '1010');
7649
7650            var modal = $(this).showModalFlat($.lang[LANG]['dash.siteprofile.modal.title'], str, true, true, function() {
7651                var modal_id = $(this).closest('.modal').attr('id'),
7652                    $nick = $('.input-userNickname'),
7653                    org = $('.site-username').attr('data-user-name'),
7654                    sid = SID,
7655                    settings = {
7656                        site_nick: $nick.val().trim()
7657                    },
7658                    special_pattern = /[~!@\#$%<>^&*\()\-=+_\’'"]/gi,
7659                    uploadimg = $('#dashboard-image-popup1 image').attr('xlink:href'),
7660                    nouploadimg = $('#dashboard-image-top image').attr('xlink:href'),
7661                    profileimg = ($('label.change-profile').hasClass('um-profile')) ? 'profileimg_um' : 'profileimg_site';
7662
7663                if ($('#dashboard-image-popup1').length > 0) {
7664                    $.post('/template/resource/upload-saveprofile', { uploadimg: uploadimg, profileimg: profileimg }, function(data) {
7665                        if (typeof data.error != "undefined" && data.error) {
7666                            $(this).showModalFlat('ERROR', data.error, true, false, '', 'ok');
7667                            return false;
7668                        }
7669                        $('svg.change-profile').attr('data-user-img', uploadimg);
7670                        $('label.m-profile').attr('data-user-img', uploadimg);
7671                        $('#dashboard-image-top image').attr('xlink:href', uploadimg);
7672                        $('#m-dashboard-image-top image').attr('xlink:href', uploadimg);
7673
7674                        modal.modal('hide');
7675                    }, 'json');
7676                }
7677
7678                $nick.removeClass('has-error');
7679                if (!$nick.val().trim()) {
7680                    $nick.addClass('has-error');
7681                    alert($.lang[LANG]['dashbord.settings.info.site-nick.edit-info']);
7682                    return false;
7683                } else if ($nick.val().trim() == org) {
7684                    modal.modal('hide');
7685                    return false;
7686                } else if (checkEmojis($nick.val().trim())) {
7687                    errorEmojisModal();
7688                    return false;
7689                }
7690
7691                if ((special_pattern.test($nick.val().trim()) == true)) {
7692                    alert($.lang[LANG]['dashbord.settings.info.site-nick.edit-spec']);
7693                    return false;
7694                }
7695
7696                $.post('/template/settings', {
7697                    'sid': sid,
7698                    'settings': JSON.stringify(settings),
7699                    'el': ''
7700                }, function(data) {
7701                    if (typeof data.error != 'undefined' && data.error) {
7702                        $nick.addClass('has-error');
7703                        alert(data.error);
7704                        return false;
7705                    }
7706
7707                    $('.m-text-size').text(data.data.site_nick).attr('data-user-name', data.data.site_nick);
7708                    $('.site-username').attr('data-user-name', data.data.site_nick);
7709                    $('.mb-nickname').text(data.data.site_nick);
7710                    $('#register-nickname input.edit-input').attr('value', data.data.site_nick);
7711
7712                    $('.cl-changePro-modal ul.uploadfiles').empty();
7713                    modal.modal('hide');
7714                }, 'json');
7715            }, 'cancel', 'config.change', 'cl-cmmodal cl-s-btn w560 cl-p130 cl-p0 cl-changePro-modal', true, function() {
7716                //console.log('showCallback-cancel');
7717                var imgfile = $('.cl-changePro-modal .uploadfiles li').attr('data-source'),
7718                    files = [];
7719
7720                $('.cl-changePro-modal .uploadfiles li').each(function() {
7721                    files.push($(this).attr('data-source'));
7722                });
7723
7724                $('.cl-changePro-modal .uploadfiles').empty();
7725                if ($('#dashboard-image-popup1').length > 0) {
7726                    $.processON($.lang[LANG]['dash.siteprofile.modal.deleteimg']);
7727                    $.ajax({
7728                        type: 'POST',
7729                        url: '/template/resource/delete-gcloud',
7730                        data: { s: files },
7731                        dataType: 'json',
7732                        async: true,
7733                        success: function(data) {
7734                            if (typeof data.error != "undefined" && data.error) {
7735                                $(this).showModalFlat('ERROR', data.error, true, false, '', 'ok');
7736                                return false;
7737                            }
7738                            $.processOFF();
7739                        }
7740                    });
7741                }
7742            }, function() {
7743                $(document).on('click', '.site-profile-upload-btn', function() {
7744                    $(this).fileupload({
7745                            url: '/template/resource/upload-myimage-file',
7746                            dataType: 'json',
7747                            async: true,
7748                            pasteZone: null,
7749                            add: function(e, data) {
7750                                $('#loading').css('left', '-100%');
7751                                $.processON();
7752                                data.submit();
7753                            },
7754                            done: function(e, data) {
7755                                if (typeof data.result.error != 'undefined' && data.result.error) {
7756                                    alert(data.result.error);
7757                                    $('.progress .progress-bar').css('width', '0%');
7758                                    $.processOFF();
7759                                    return;
7760                                }
7761
7762                                if (data.result.src) {
7763                                    var src1 = '<svg viewBox="0 0 110 110" ><pattern id="dashboard-image-popup1" patternUnits="userSpaceOnUse" width="120" height="120"><image xlink:href="' + data.result.src + '" x="0" width="110" height="110"></image></pattern><circle cx="55" cy="56" r="54" fill="url(#dashboard-image-popup1)" stroke="#eeeff0"></circle></svg>\
7764                                    ',
7765                                        src2 = '<svg viewBox="0 0 110 110" ><pattern id="dashboard-image-popup2" patternUnits="userSpaceOnUse" width="120" height="120"><image xlink:href="' + data.result.src + '" x="0" width="110" height="110"></image></pattern><circle cx="55" cy="56" r="54" fill="url(#dashboard-image-popup2)" stroke="#eeeff0"></circle></svg>\
7766                                        ',
7767                                        read_upload_file = '<li data-source="' + data.result.file_name + '"><img src="' + data.result.src + '"></li>';
7768
7769                                    $('.dashboard-userimg').html(src1);
7770                                    $('.cl-changePro-modal ul.uploadfiles').append(read_upload_file);
7771                                    //$('label.change-profile').html(src2).attr('data-user-img',data.result.src);
7772                                    //$('.dashboard-userimg').attr('data-imgsave',data.result.path+'/'+data.result.raw_name);
7773
7774                                }
7775                                $.processOFF();
7776                                $('#loading').css('left', '50%');
7777                            },
7778                            progressall: function(e, data) {
7779                                var progress = parseInt(data.loaded / data.total * 100, 10);
7780                                $('.progress .progress-bar').css(
7781                                    'width',
7782                                    progress + '%'
7783                                );
7784
7785                            },
7786                        }).prop('disabled', !$.support.fileInput)
7787                        .parent().addClass($.support.fileInput ? undefined : 'disabled');
7788                });
7789            }, function() {
7790                $('.m-header_user.menu, .btn-box.m-headerClose.in ').css('zIndex', '');
7791            });
7792        } else {
7793            siteNotice('nickname');
7794        }
7795
7796    });
7797
7798    /***********************************************************************************************************************************************/
7799    
7800    var setLayoutHeight = function(el) {
7801        if(typeof el != 'undefined' && $.inArray(el, ['el-menu','el-footer']) > -1) return false;
7802
7803        var block_selector = (typeof el != 'undefined' && el == 'el_display') ? '#element-display .el_viewblock' : '.element[data-layout]';
7804        if($(block_selector).length == 0) return false;
7805
7806        $(block_selector).each(function() {
7807            var type2 = (typeof $(this).attr('data-type2') != 'undefined' && $(this).attr('data-type2'))? $(this).attr('data-type2') : '';
7808            if($(this).attr('data-mode') == 'thumb' || $(this).find('.layout-grid').length == 0) {
7809                return true;
7810            }
7811            var lyh = (typeof $(this).find('.lyoption').attr('data-lyh') != 'undefined') ? $(this).find('.lyoption').attr('data-lyh') : 0.6;
7812            if (typeof lyh == 'undefined' || lyh == 'auto') return;
7813
7814            var el = $(this).find('.layout-grid').eq(0),
7815                bl_w = Math.round(parseFloat(el[0].offsetWidth)),
7816                bl_pl = (el.css('padding-left')) ? Math.round(parseFloat(el.css('padding-left').replace(/[^0-9]/g, ''))) : 15,
7817                bl_pr = (el.css('padding-right')) ? Math.round(parseFloat(el.css('padding-right').replace(/[^0-9]/g, ''))) : 15,
7818                bl_w_pd = bl_w - (bl_pl + bl_pr),
7819                bl_ly_height = Math.round(bl_w_pd * parseFloat(lyh));
7820
7821            // $(this).find('.row .video-content').css('height', bl_ly_height + 'px');
7822            // $(this).find('.ly-img').css('height', bl_ly_height + 'px');
7823            let ly_height = (type2 == 'shorts')? lyh : lyh - 0.05;
7824            $(this).find('.row .video-content').css('aspect-ratio', `1 / ${ly_height}`);
7825            $(this).find('.ly-img').css('aspect-ratio', `1 / ${lyh - 0.05}`);
7826            // if ($(this).attr('data-mode') == 'thumb' && $(this).attr('data-playtype') == 'true') $(this).find('iframe').css('height', bl_ly_height + 'px');
7827
7828            // var bl_svg_val = (bl_w_pd < 233) ? Math.round(parseFloat(bl_w_pd * 0.25)) : 58;
7829            var bl_svg_val;
7830            if(bl_w_pd > 920) {
7831              bl_svg_val = 58;
7832            } else if(bl_w_pd > 700) {
7833              bl_svg_val = 50;
7834            } else if(bl_w_pd > 500) {
7835              bl_svg_val = 46;
7836            } else if(bl_w_pd > 300) {
7837              bl_svg_val = 42;
7838            } else if(bl_w_pd > 210) {
7839              bl_svg_val = 36;
7840            } else {
7841              bl_svg_val = 30;
7842            }
7843            $(this).find('.playbtn').attr('width', bl_svg_val).attr('height', bl_svg_val);
7844            $(this).css('overflow', 'hidden');
7845        });
7846
7847    }
7848
7849    var getLayoutData = function(tag) {
7850        var tag_ly_arr = [],
7851            tag_pd = (typeof tag.find('.lyoption').attr('data-lypd') != 'undefined' && tag.find('.lyoption').attr('data-lypd')) ? tag.find('.lyoption').attr('data-lypd') : '15',
7852            tag_pc = (typeof tag.find('.lyoption').attr('data-lycol') != 'undefined' && tag.find('.lyoption').attr('data-lycol')) ? tag.find('.lyoption').attr('data-lycol') : '4',
7853            tag_t = (typeof tag.find('.lyoption').attr('data-lycol-t') != 'undefined' && tag.find('.lyoption').attr('data-lycol-t')) ? tag.find('.lyoption').attr('data-lycol-t') : '2',
7854            tag_m = (typeof tag.find('.lyoption').attr('data-lycol-m') != 'undefined' && tag.find('.lyoption').attr('data-lycol-m')) ? tag.find('.lyoption').attr('data-lycol-m') 
7854: '2',
7855            tag_lyw = (typeof tag.find('.lyoption').attr('data-lyw') != 'undefined' && tag.find('.lyoption').attr('data-lyw')) ? tag.find('.lyoption').attr('data-lyw') : (tag_pc == '1' ? '100' : 'auto'),
7856            tag_lyh = (typeof tag.find('.lyoption').attr('data-lyh') != 'undefined' && tag.find('.lyoption').attr('data-lyh')) ? tag.find('.lyoption').attr('data-lyh') : '0.6',
7857            tag_orgw = (typeof tag.find('.lyoption').attr('data-org-width') != 'undefined' && tag.find('.lyoption').attr('data-org-width')) ? tag.find('.lyoption').attr('data-org-width') : ''
7858
7859        var bl_cont = tag.find('.container'),
7860            bl_cont_w = parseFloat(bl_cont[0].offsetWidth),
7861            layout_grid = $('.' + selectEL).find('.layout-grid').eq(0),
7862            bl_w = parseFloat(layout_grid[0].offsetWidth),
7863            bl_pl = (layout_grid.css('padding-left')) ? parseFloat(layout_grid.css('padding-left').replace(/[^0-9]/g, '')) : 15,
7864            bl_pr = (layout_grid.css('padding-right')) ? parseFloat(layout_grid.css('padding-right').replace(/[^0-9]/g, '')) : 15,
7865            bl_lyw = (tag_pc == '1') ? Number(tag_lyw) : '',
7866            bl_lyw_dot = (tag_pc == '1') ? bl_lyw / 100 : '',
7867            bl_cont_w_re = (tag_pc == '1') ? (bl_cont_w - (bl_pl + bl_pr)) * bl_lyw_dot : '';
7868
7869        tag_ly_arr['pc'] = tag_pc;
7870        tag_ly_arr['t'] = tag_t;
7871        tag_ly_arr['m'] = tag_m;
7872        tag_ly_arr['lyw'] = tag_lyw;
7873        tag_ly_arr['pd'] = tag_pd;
7874        tag_ly_arr['lyh'] = tag_lyh;
7875        tag_ly_arr['bl_cont_w'] = bl_cont_w;
7876        tag_ly_arr['bl_w'] = bl_w;
7877        tag_ly_arr['bl_pl'] = bl_pl;
7878        tag_ly_arr['bl_pr'] = bl_pr;
7879        tag_ly_arr['bl_lyw_dot'] = bl_lyw_dot;
7880        tag_ly_arr['bl_cont_w_re'] = bl_cont_w_re;
7881
7882        return tag_ly_arr;
7883    }
7884
7885
7886    $(document).on('click', '.guestbook-fr-35, .btn-ico-right', function(e) {
7887        $(this).prev().click();
7888    });
7889    $(document).on('click', '.page-toolbars .toolbar-btn.share', function(e) {
7890        var option = $(this).closest('.page-toolbars').attr('data-page-option');
7891        if (option == 'S') {
7892            $(this).showModalFlat('INFORMATION', $.lang[LANG]['config.gallery.share.cannot.secret-post'], true, false, '', 'ok', '', 'cl-cmmodal cl-s-btn w560 cl-p130 cl-t80 cl-modal cl-none-title');
7893            return false;
7894        }
7895        if (typeof MODE == 'undefined' && property.PUBLISH) shareModal();
7896        else $(this).showModalFlat($.lang[LANG]['config.information'], $.lang[LANG]['config.gallery.share.publish'], true, false, '', 'ok', '', 'cl-cmmodal cl-s-btn w560 cl-p130 cl-p0 cl-okbtn-pbt70');
7897    });
7898
7899    $(document).on('click', '.page-toolbars .toolbar-btn.like', function(e) {
7900        var page = (PAGE_MODE == 'c') ? PAGE : property.PAGE;
7901        if (page.indexOf(',') > -1) {
7902            var page = (PAGE_MODE == 'c') ? PAGE.split(',') : (property.PAGE).split(',');
7903            var npage = (page[0] == 'forum') ? 'forum' : 'project';
7904            setLike($(this), npage);
7905        } else {
7906            return false;
7907        }
7908    });
7909    $(document).on('click', 'a.gallery-like', function(e) {
7910        setLike($(this), 'gallery');
7911    });
7912    $(document).on('click', '.figure.like > *', function(e) {
7913        var $this = $(this).closest('.figure.like');
7914        if ($this.closest('.emptyGallery').length > 0) return false;
7915        setLike($this, 'list');
7916    });
7917    // $(document).on('click','.element[data-type2="qna"] .tpl-forum-list-like, .element[data-type2="faq"] .tpl-forum-list-like, .element[data-type2="guestbook"] .tpl-forum-list-like', function(e) {
7918    //     var $this = $(this);
7919    //     setLike($this, 'flist');
7920    // });
7921    $(document).on('click', '.element a[data-popup][data-popup-name], .clnav-sidemobile a[data-popup][data-popup-name]', function(e){
7922        e.preventDefault();
7923        e.stopPropagation();
7924        var $popupLink = $(this);
7925        if($popupLink.closest('.change-mobile-modal, .change-mobile-design-modal').length > 0) return;
7926
7927        var iVALIDPLAN = (PAGE_MODE == 'c') ? VALIDPLAN : property.VALIDPLAN;
7928        var iVALIDTYPE = (PAGE_MODE == 'c') ? VALIDTYPE : property.VALIDTYPE;
7929        if(iVALIDPLAN && iVALIDTYPE != 'PK') imgPopupFrame($popupLink);
7930    });
7931
7932    var checkUseCommentFunc = function(mode, eltag) {
7933        var check = false;
7934        if (mode == 'project') {
7935            var notUseComment = ['gallery_38', 'gallery_37', 'gallery_36', 'gallery_28', 'gallery_25', 'gallery_22', 'gallery_21', 'gallery_8', 'gallery_6'];
7936            var $eltag = $(htmlspecialchars_decode(eltag, 'ENT_QUOTES'));
7937            var tplImg = $eltag.find('img').attr('src');
7938            var notUseCommentCnt = 0;
7939            $.each(notUseComment, function(i, v) {
7940                if (typeof tplImg !== 'undefined' && tplImg.indexOf(v) > -1) {
7941                    notUseCommentCnt++;
7942                    return false;
7943                }
7944            });
7945            check = ($eltag.find('h5.figure').eq(0).hasClass('only-sh') || !$eltag.find('h5.figure').eq(0).hasClass('title') || !$eltag.find('p.figure').eq(0).hasClass('caption') || notUseCommentCnt > 0) ? false : true;
7946        }
7947
7948        return check;
7949    }
7950
7951    var checkUseLikeFunc = function(mode, eltag) { //like
7952        var check = false;
7953        var notUseLike = ['gallery_38', 'gallery_37', 'gallery_36', 'gallery_28', 'gallery_25', 'gallery_22', 'gallery_21', 'gallery_8', 'gallery_6'];
7954        // var umemberActivate = (PAGE_MODE == 'c')? UMEMBER_ACTIVATE : property.UMEMBER_ACTIVATE;
7955        // if(umemberActivate == 0) {
7956        //     return false;
7957        // }
7958        var lVALIDPLAN = (PAGE_MODE == 'c') ? VALIDPLAN : property.VALIDPLAN;
7959        if (!lVALIDPLAN) return false;
7960        switch (mode) {
7961            case 'project':
7962            case 'gallery':
7963                var $eltag = $(htmlspecialchars_decode(eltag, 'ENT_QUOTES'));
7964                var tplImg = $eltag.find('img').attr('src');
7965                var notUseLikeCnt = 0;
7966                $.each(notUseLike, function(i, v) {
7967                    if (typeof tplImg !== 'undefined' && tplImg.indexOf(v) > -1) {
7968                        notUseLikeCnt++;
7969                        return false;
7970                    }
7971                });
7972                check = ($eltag.find('h5.figure').eq(0).hasClass('only-sh') || !$eltag.find('h5.figure').eq(0).hasClass('title') || !$eltag.find('p.figure').eq(0).hasClass('caption') || notUseLikeCnt > 0) ? false : true;
7973
7974                break;
7975        }
7976
7977        return check;
7978    }
7979
7980    var getRgbaValArray = function(bg_color, opacity_val) {
7981        var bgColorArr = [],
7982            setColorArr = [],
7983            opacity_val = (typeof opacity_val != 'undefined' && opacity_val) ? opacity_val : '';
7984
7985        if (typeof bg_color == 'undefined') return;
7986        if (bg_color == 'transparent' || !bg_color || bg_color == 'none') opacity_val = '0';
7987        bg_color = (bg_color == 'transparent' || !bg_color || bg_color == 'none') ? 'rgba(255,255,255,' + opacity_val + ')' : bg_color;
7988
7989        if (bg_color.indexOf('#') > -1) {
7990            if (bg_color.length < 5) {
7991                var str_color = bg_color.substring(1, bg_color.length);
7992                bg_color += str_color;
7993            }
7994
7995            var bgColorArr_re = Object.values(hexToRgba(bg_color));
7996            setColorArr['r'] = bgColorArr_re['0'].toString();
7997            setColorArr['g'] = bgColorArr_re['1'].toString();
7998            setColorArr['b'] = bgColorArr_re['2'].toString();
7999            setColorArr['a'] = '1';
8000        } else setColorArr = rgbaToOpacity(bg_color);
8001
8002        bg_color = 'rgb(' + setColorArr.r + ',' + setColorArr.g + ',' + setColorArr.b + ')'
8003        if (opacity_val != '' && (setColorArr.a != opacity_val)) setColorArr.a = opacity_val;
8004
8005        bgColorArr['rgba'] = setColorArr;
8006        bgColorArr['val'] = bg_color;
8007        bgColorArr['rgba_txt'] = 'rgba(' + setColorArr.r + ',' + setColorArr.g + ',' + setColorArr.b + ',' + setColorArr.a + ')';
8008
8009        return bgColorArr;
8010    }
8011
8012    var getColorAndOpacity = function(bc_selector, css, css_change_opt, change_color_array) {
8013        var bg_info = {},
8014            bg_opt_color = (typeof change_color_array == 'undefined' && !change_color_array) ? getColor(bc_selector, css, css_change_opt) : change_color_array,
8015            bg_opt_color_val = bg_opt_color['val'],
8016            bg_transparent_class = (bg_opt_color_val == 'transparent' || !bg_opt_color_val) ? ' transparent' : '',
8017            bg_opt_opacity_percent = (bg_opt_color_val == 'transparent' || !bg_opt_color_val) ? 0 : (bg_opt_color['rgba']['a'] * 100),
8018            bg_opt_opacity_dot = (bg_opt_color_val == 'transparent' || !bg_opt_color_val) ? 0 : (bg_opt_opacity_percent / 100);
8019
8020
8021        if (css_change_opt == 'background-color' &&
8022            typeof css['children'][bc_selector] != 'undefined' &&
8023            typeof css['children'][bc_selector]['attributes'] != 'undefined' &&
8024            typeof css['children'][bc_selector]['attributes']['opacity'] != 'undefined'
8025        ) {
8026            var this_opacity = css['children'][bc_selector]['attributes']['opacity'];
8027            if (this_opacity == '1' && css['children'][bc_selector]['attributes']['background-color'] == 'transparent') {
8028                bg_opt_opacity_dot = 0;
8029                bg_opt_opacity_percent = 0;
8030            } else {
8031                if (this_opacity.match(/^[0-9\.]*$/g) !== null) {
8032                    bg_opt_opacity_dot = this_opacity;
8033                    bg_opt_opacity_percent = this_opacity * 100;
8034                }
8035            }
8036
8037        }
8038
8039        bg_info = {
8040            color: bg_opt_color,
8041            trans: bg_transparent_class,
8042            op_percent: bg_opt_opacity_percent,
8043            op_dot: bg_opt_opacity_dot,
8044        }
8045
8046        return bg_info;
8047    }
8048
8049    var getLoadBlockScript = function(blocks) {
8050        if (typeof blocks == 'undefined' || blocks.toString().length == 0) return { total: 0, list: {} };
8051
8052        var script_names = {
8053                'gallery'   : ['comments','bottomlist'],
8054                'forum'     : ['forum','comments','bottomlist'],
8055                'latest'    : ['forum','latest'],
8056                'sns'       : ['socialfeed'],
8057                // 'contact'   : ['jqueryFileupload'],
8058                'countdown' : ['jqueryCountdown'],
8059                'shopping'  : ['shopping'],
8060                'review'    : ['reviewContents'],
8061            },
8062            script_path = {
8063                //'loadScript-???' : 'script path', 
8064                'aos'       : 'https://unpkg.com/[email protected]/dist/aos.js',
8065                'shopping'  : '/js/shopping.js',
8066                'forum'     : '/js/module/forum.js',
8067                'latest'    : '/js/module/latest.js',
8068                'reviewContents'    : '/js/module/review_contents.js',
8069                'comments'  : '/js/module/comments.js',
8070                'bottomlist'    : '/js/module/bottomlist.js',
8071                'socialfeed'    : '/js/feed/socialfeed.js',
8072                // 'jqueryFileupload'  : '/js/jquery.fileupload.js',
8073                'jqueryCountdown'   : '/js/jquery.countdown.js',
8074            },
8075            script_total = 0,
8076            script_result = {};
8077
8078        $.each(blocks, function(i, v) {
8079            if (v === false) return true;
8080
8081            var sct_names = (typeof script_names[i] != 'undefined' && script_names[i]) ? script_names[i] : [];
8082            $.each(sct_names, function(idx, val) {
8083                if (typeof script_path[val] != 'undefined' && script_path[val]) {
8084                    if (typeof script_result[val] == 'undefined') script_total++;
8085                    script_result[val] = script_path[val];
8086                }
8087            })
8088        });
8089
8090        return { total: script_total, list: script_result };
8091    }
8092
8093    var loadingScript = function(r) {
8094        var deferred = $.Deferred();
8095        var script_r = getLoadBlockScript(r),
8096            script_total = (typeof script_r.total != 'undefined') ? script_r.total : 0,
8097            script_load = 0;
8098
8099        if (script_total == 0) deferred.resolve();
8100        $.each(script_r.list, function(s_n, s_p) {
8101            if ($('.loadScript-' + s_n).length == 0) {
8102                $.ajax({
8103                    async: false,
8104                    url: s_p,
8105                    dataType: 'script',
8106                    success: function(data) {
8107                        $('head').append('<input type="hidden" class="loadScript-' + s_n + '" value="' + s_p + '">');
8108                        script_load++;
8109                    },
8110                    error: function(request, status, error) {
8111                        // console.log("code: " + request.status);
8112                        // console.log("message: " + request.responseText);
8113                        // console.log("error: " + error);
8114                    }
8115                }).done(function() {
8116                    if (script_load == script_total) deferred.resolve();
8117                });
8118            } else {
8119                script_load++;
8120                if (script_load == script_total) deferred.resolve();
8121            }
8122        });
8123
8124        return deferred.promise();
8125    }
8126
8127    // lux shopping
8128    var ChooseFilters = function(brand, search, mode) {
8129        var min = (mode == true) ? getProductParams('min_price') : getSearchURL('min_price'),
8130            max = (mode == true) ? getProductParams('max_price') : getSearchURL('max_price'),
8131            price = [10, 30, 50, 70, 100, 150, 200, 300, 500];
8132        s = '';
8133        if (typeof search == 'undefined') {
8134            s = '\
8135            <div class="prod-search-brand"><input type="text" class="search-brand-input" placeHolder="브랜드 검색" enterkeyhint="search">\
8136            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>\
8137            </div>\
8138            ';
8139        }
8140        if (brand) {
8141            s = s + '\
8142            <button type="button" class="btn-v2 recommend-filter brand" data-key="brand" data-val="B00000IP">톰포드</button>\
8143            <button type="button" class="btn-v2 recommend-filter brand" data-key="brand" data-val="B00000DM">마크 제이콥스</button>\
8144            <button type="button" class="btn-v2 recommend-filter brand" data-key="brand" data-val="B00000BO">생로랑</button>\
8145            <button type="button" class="btn-v2 recommend-filter brand" data-key="brand" data-val="B00000BQ">버버리</button>\
8146            <button type="button" class="btn-v2 recommend-filter brand" data-key="brand" data-val="B000000C">구찌</button>\
8147            ';
8148        }
8149
8150        s = s + '\
8151        <div class="filter-buttons">\
8152            <div class="btn-group product_type">\
8153                <button type="button" class="dropdown-toggle recommend-filter list-filter dropdown-button" data-toggle="dropdown">\
8154                    <span class="type_trend">상품유형</span>\
8155                    <svg width="12" height="12" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16">\
8156                        <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"></path>\
8157                    </svg>\
8158                </button>\
8159                <ul class="dropdown-menu">\
8160                    <li data-key="trend" data-val="T0000000">브랜드홈</li>\
8161                    <li data-key="trend" data-val="T00000CQ">편집샵</li>\
8162                    <li data-key="trend" data-val="T00000CS">국내배송</li>\
8163                    <li data-key="trend" data-val="T00000HO">도매부티크</li>\
8164                </ul>\
8165            </div>\
8166            <div class="btn-group">\
8167                <button type="button" class="dropdown-toggle recommend-filter list-filter dropdown-button" data-toggle="dropdown">\
8168                    <span class="type_discount_rate">할인율</span>\
8169                    <svg width="12" height="12" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16">\
8170                        <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"></path>\
8171                    </svg>\
8172                </button>\
8173                <ul class="dropdown-menu">\
8174                    <li data-key="discount_rate" data-val="sp">특가세일</li>\
8175                    <li data-key="discount_rate" data-val="10off">10off이하</li>\
8176                    <li data-key="discount_rate" data-val="10n30">10n30off</li>\
8177                    <li data-key="discount_rate" data-val="30n50">30n50off</li>\
8178                    <li data-key="discount_rate" data-val="50off">50off이상</li>\
8179                </ul>\
8180            </div>\
8181            <div class="btn-group">\
8182                <button type="button" class="dropdown-toggle recommend-filter list-filter dropdown-button" data-toggle="dropdown">\
8183                    <span class="type_min_price">최저가</span>\
8184                    <svg width="12" height="12" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16">\
8185                        <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"></path>\
8186                    </svg>\
8187                </button>\
8188                <ul class="dropdown-menu">\
8189                    <li data-key="min_price" data-val="">선택안함</li>\
8190                    ' + setPriceHtml(price, 'min_price', max) + '\
8191                </ul>\
8192            </div>\
8193            <div class="btn-group">\
8194                <button type="button" class="dropdown-toggle recommend-filter list-filter dropdown-button" data-toggle="dropdown">\
8195                    <span class="type_max_price">최고가</span>\
8196                    <svg width="12" height="12" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16">\
8197                        <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"></path>\
8198                    </svg>\
8199                </button>\
8200                <ul class="dropdown-menu">\
8201                    ' + setPriceHtml(price, 'max_price', min) + '\
8202                    <li data-key="max_price" data-val="">선택안함</li>\
8203                </ul>\
8204            </div>\
8205        </div>\
8206        ';
8207        return s;
8208    }
8209
8210    var setPriceHtml = function(price, type, selected_price) {
8211        var s = '';
8212        $.each(price, function(i, v) {
8213            var active = '';
8214            if (type == 'min_price') {
8215                if (Number(selected_price) > 0 && v >= Number(selected_price)) {
8216                    active = 'disabled';
8217                }
8218            } else {
8219                if (Number(selected_price) > 0 && v <= Number(selected_price)) active = 'disabled';
8220            }
8221            // if(v == Number(getSearchURL(type))) active = 'active';
8222            s = s + '<li class="' + active + '" data-key="' + type + '" data-val="' + v + '">' + v + '만원</li>';
8223        });
8224        return s;
8225    }
8226
8227    var lux_all_category;
8228    var getAllCategory = function(select, category, list, idx, no) {
8229        $.processON();
8230        $.ajax({
8231            type: 'POST',
8232            url: '/template/lux_category_all',
8233            data: { sid: SID },
8234            dataType: 'json',
8235            async: true,
8236            cache: false,
8237            success: function(r) {
8238                lux_all_category = r.root;
8239                $.processOFF();
8240                var html = setSelectCategoryHTML(r, true);
8241                if (typeof select != 'undefined') {
8242                    var $html = $(html);
8243
8244                    $html.find('li').addClass('disable').css('display', 'none');
8245                    $html.find('li[data-category="' + select + '"]').removeClass('disable').addClass('active').css('display', '').empty().append(category);
8246                    $html.find('li.click-off').removeClass('disable');
8247                    if (Number(select) > 1000000) {
8248                        $html.find('.add-user-category').css('display', '');
8249                        $html.find('.input-user-category').css('display', 'none');
8250                    }
8251                    var s = (list.length == 1) ? displaySubCategoryList(lux_all_category[list[0]]['sub']) : displaySubCategoryList(lux_all_category[list[0]]['sub'][list[1]]['sub'], true);
8252                    $html.find('.add-user-category').before(s);
8253                    html = $html.outerHTML();
8254                }
8255                var modal = $(this).showModalFlat('상품연결', html, true, true, function() {
8256                    var choose = $('.choose-select-category li.active').attr('data-category');
8257                    if (typeof choose == 'undefined') {
8258                        alert('선택된 카테고리가 없습니다');
8259                        return false;
8260                    }
8261                    var s = '<ul class="active" data-sid="' + SID + '" data-no="' + ((typeof no != 'undefined') ? no : '') + '">',
8262                        $items = $('.choose-select-category li.active span'),
8263                        add = [],
8264                        updated = [];
8265                    $.each($items, function(i, v) {
8266                        s += '<li class="' + (($items.length == i + 1) ? 'last' : '') + '" data-category-no="' + $(this).attr('data-category') + '" data-seq="' + ((typeof $(this).attr('data-seq') == 'undefined') ? '' : $(this).attr('data-seq')) + '"><span class="user-category-text">' + $(this).text().trim() + '</span></li>\n';
8267                        add.push($(this).attr('data-category'));
8268                        updated.push((typeof $(this).attr('data-seq') == 'undefined') ? '' : $(this).attr('data-seq'));
8269                    });
8270                    s += '<div class="user-selected-category-delete" data-no=""><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle" viewBox="0 0 16 16"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"></path><path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708
8270L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"></path></svg></div>';
8271                    s += '</ul>';
8272
8273                    // 기존 카테고리 
8274                    var selected = [];
8275                    $.each($('#lux-category-text ul'), function(i, v) {
8276                        var sub_selected = [];
8277                        $.each($(this).find('li'), function(a, b) {
8278                            sub_selected.push($(this).attr('data-category-no'));
8279                        });
8280                        selected.push(sub_selected.join());
8281                    });
8282
8283                    var duplicates = false;
8284                    $.each(selected, function(i, v) {
8285                        if (v.indexOf(add.join()) > -1) {
8286                            alert('이미 추가된 카테고리입니다');
8287                            duplicates = true;
8288                        }
8289                        if (duplicates) return false;
8290                    });
8291
8292                    if (duplicates) return false;
8293
8294                    // 상위 카테고리 중복 제거
8295                    var depth_arr = []
8296                    $.each(add, function(i, v) {
8297                        depth_arr.push(v);
8298                        var remove_idx = selected.indexOf(depth_arr.join());
8299                        if (remove_idx > -1) {
8300                            var $remove_category = $('#lux-category-text ul').eq(remove_idx),
8301                                remove_deleted = [];
8302                            $.each($remove_category.find('li'), function(a, b) {
8303                                if (typeof $(this).attr('data-seq') != 'undefined' && $(this).attr('data-seq') != '')
8304                                    remove_deleted.push($(this).attr('data-seq'));
8305                            });
8306                            var d = $('#category-deleted').val(),
8307                                deleted = (d.length) ? (d || '').split(',') : [];
8308
8309                            if (remove_deleted.length) {
8310                                deleted.push(...remove_deleted);
8311                                r = deleted.join();
8312                                $('#category-deleted').val(r);
8313                            }
8314                            $('#lux-category-text ul').eq(remove_idx).remove();
8315                            alert('기존에 선택한 상위 카테고리는 중복으로 제거 됩니다.');
8316                        }
8317                    });
8318
8319                    if (typeof idx != 'undefined') {
8320                        $('#lux-category-text ul').eq(idx).remove();
8321                        idx = idx - 1;
8322                        if (idx > -1) {
8323                            $('#lux-category-text ul').eq(idx).after(s);
8324                        } else {
8325                            $('#lux-category-text').append(s);
8326                        }
8327                    } else {
8328                        $('#lux-category-text').append(s);
8329                    }
8330
8331                    // 삭제된 카테고리 처리
8332                    var prev_category = $('#category-update-deleted').val();
8333                    if (prev_category.length) {
8334                        var prev_arr = prev_category.split(',');
8335                        if (updated.length) {
8336                            $.each(updated, function(i, v) {
8337                                if (v.length) prev_arr = arrayRemove(prev_arr, v);
8338                            });
8339                        }
8340                        $('#category-deleted').val(prev_arr.join());
8341                    }
8342                    modal.modal('hide');
8343                }, 'config.close', 'config.ok', 'cl-cmmodal cl-s-btn w700 cl-p70 cl-p0 noActive-domain-check h800', true, function() {
8344                    // close callback
8345                    $('#category-update-deleted').val('');
8346                });
8347            },
8348            error: function(xhr, status, error) {
8349                $.processOFF();
8350                alert("Error " + xhr.status + " : 관리자에게 문의");
8351            }
8352        });
8353    }
8354
8355    $(document)
8356        .on('touchstart', '.carousel', function(e) {
8357            if(typeof PAGE_MODE != 'undefined' && PAGE_MODE == 'c') return false;
8358
8359            const slideshow_xClick = e.originalEvent.touches[0].pageX;
8360            $(this).one('touchmove', function(event){
8361                const slideshow_xMove = event.originalEvent.touches[0].pageX;
8362                const slideshow_sensitivityInPx = 5;
8363
8364                if( Math.floor(slideshow_xClick - slideshow_xMove) > slideshow_sensitivityInPx ){
8365                    $(this).carousel('next');
8366                }
8367                else if( Math.floor(slideshow_xClick - slideshow_xMove) < -slideshow_sensitivityInPx ){
8368                    $(this).carousel('prev');
8369                }
8370            });
8371            $(this).on('touchend', function(){
8372                $(this).off('touchmove');
8373            });
8374        });
8375
8376    $(document)
8377    .on('mousedown', '.carousel[data-drag="true"]', function(e) {
8378        // if(typeof PAGE_MODE != 'undefined' && PAGE_MODE == 'c') return false;
8379
8380        const slideshow_xClick = e.pageX;
8381        const $carousel = $(this);
8382
8383        const mouseMoveHandler = function(event){
8384            const slideshow_xMove = event.pageX;
8385            const slideshow_sensitivityInPx = 5;
8386
8387            const diff = slideshow_xClick - slideshow_xMove;
8388
8389            if( Math.floor(diff) > slideshow_sensitivityInPx ){
8390                $carousel.carousel('next');
8391                $(document).off('mousemove', mouseMoveHandler); 
8392                $(document).off('mouseup', mouseUpHandler);
8393            }
8394            else if( Math.floor(diff) < -slideshow_sensitivityInPx ){
8395                $carousel.carousel('prev');
8396                $(document).off('mousemove', mouseMoveHandler);
8397                $(document).off('mouseup', mouseUpHandler);
8398            }
8399        };
8400
8401        $(document).on('mousemove', mouseMoveHandler);
8402
8403        const mouseUpHandler = function(){
8404            $(document).off('mousemove', mouseMoveHandler);
8405            $(document).off('mouseup', mouseUpHandler);
8406        };
8407        
8408        $(document).on('mouseup', mouseUpHandler);
8409
8410        e.preventDefault();
8411    });
8412
8413    $(document)
8414        .off('click', '#lux-category-text ul')
8415        .on('click', '#lux-category-text ul', function(e) {
8416            var $selected = $(this),
8417                s = '',
8418                first = 0,
8419                l = [],
8420                i = $(this).index(),
8421                u = [],
8422                no = $(this).attr('data-no');
8423            if ($(this).attr('data-sid') == 'mlux') return;
8424            if ($selected.find('li').length) {
8425                $.each($selected.find('li'), function(i, v) {
8426                    if (i == 0) first = $(this).attr('data-category-no');
8427                    s += '<span class="selected" data-category="' + $(this).attr('data-category-no') + '" data-seq="' + $(this).attr('data-seq') + '">' + $(this).text() + ' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle" viewBox="0 0 16 16"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"></path><path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"></path></svg></span>';
8428                    l.push($(this).attr('data-category-no'));
8429                    u.push($(this).attr('data-seq'));
8430                });
8431            }
8432            $('#category-update-deleted').val(u.join());
8433            getAllCategory(first, s, l, i, no);
8434        });
8435
8436    $(document)
8437        .off('click', '.user-selected-category-delete')
8438        .on('click', '.user-selected-category-delete', function(e) {
8439            e.stopPropagation();
8440            if (confirm('카테고리를 삭제하시겠습니까?')) {
8441                var selected_category = $(this).parent().find('li'),
8442                    user_deleted = [];
8443
8444                $.each(selected_category, function(i, v) {
8445                    if (typeof $(this).attr('data-seq') != 'undefined' && $(this).attr('data-seq') != '')
8446                        user_deleted.push($(this).attr('data-seq'));
8447                });
8448
8449                var unique = [...new Set(user_deleted)],
8450                    d = $('#category-deleted').val(),
8451                    deleted = (d.length) ? (d || '').split(',') : [];
8452                $(this).parents('ul').remove();
8453                if (unique.length) {
8454                    deleted.push(...unique);
8455                    r = deleted.join();
8456                    $('#category-deleted').val(r);
8457                }
8458            }
8459        });
8460
8461    $(document)
8462        .off('click', '.lux-category-add')
8463        .on('click', '.lux-category-add', function(e) {
8464            getAllCategory();
8465        });
8466
8467    $(document)
8468        .off('click', '.choose-select-category.add li .lux-category-modify, .sub-category-item .lux-category-modify')
8469        .on('click', '.choose-select-category.add li .lux-category-modify, .sub-category-item .lux-category-modify', function(e) {
8470            e.stopPropagation();
8471            var category_name = $(this).parent().text().trim(),
8472                seq = $(this).parent().attr('data-category');
8473
8474            $('li.orig').addClass('hide');
8475            $('.sub-category-item').addClass('hide');
8476            $('.input-user-category').addClass('active').css('display', 'block');
8477            $('.modal-footer .ok-button-dialog').addClass('disabled');
8478            $('#input-user-category').val(category_name).attr('data-modify', 'true').attr('data-category', seq);
8479        });
8480
8481    $(document)
8482        .off('click', '.choose-select-category.add li .lux-category-delete, .sub-category-item .lux-category-delete')
8483        .on('click', '.choose-select-category.add li .lux-category-delete, .sub-category-item .lux-category-delete', function(e) {
8484            e.stopPropagation();
8485            var depth = $('.choose-select-category.add li.active .selected').length,
8486                category_no = $(this).parent().attr('data-category'),
8487                parent = $('.choose-select-category.add li.active .selected:nth-child(1)').attr('data-category'),
8488                sub = $('.choose-select-category.add li.active .selected:nth-child(2)').attr('data-category');
8489            var agree = (confirm('선택하신 카테고리를 삭제하시겠습니까?')) ? true : false;
8490            if ($('#lux-category-text').find('[data-category-no="' + category_no + '"]').length && agree == true) {
8491                alert('현재 상품에 적용된 카테고리입니다.');
8492                agree = false;
8493            }
8494            if (agree == false) return;
8495            $.processON();
8496            $.ajax({
8497                type: 'POST',
8498                url: '/template/lux_category_delete',
8499                data: { sid: SID, category_no: category_no, depth: depth },
8500                dataType: 'json',
8501                async: true,
8502                cache: false,
8503                success: function(r) {
8504                    $.processOFF();
8505                    if (typeof r.error != 'undefined' && r.error) {
8506                        alert(r.error);
8507                        return false;
8508                    }
8509                    lux_all_category = r.all_category;
8510                    if (depth == 0) {
8511                        $('.choose-select-category li[data-category="' + r.category_no + '"]').remove();
8512                    } else if (depth == 1) {
8513                        $('.sub-category-item div[data-category="' + r.category_no + '"]').remove();
8514                        displaySubCategoryList(lux_all_category[parent]['sub']);
8515                    } else {
8516                        $('.sub-category-item div[data-category="' + r.category_no + '"]').remove();
8517                        displaySubCategoryList(lux_all_category[parent]['sub'][sub]['sub'], true);
8518                    }
8519                },
8520                error: function(xhr, status, error) {
8521                    $.processOFF();
8522                    $('.input-user-category.active').removeClass('spinner');
8523                    alert("Error " + xhr.status + " : 관리자에게 문의");
8524                }
8525            });
8526        });
8527
8528    $(document)
8529        .off('click', '.choose-select-category.add li')
8530        .on('click', '.choose-select-category.add li', function(e) {
8531            if ($(this).hasClass('click-off')) return;
8532            var id = $(this).attr('data-category'),
8533                selected = $(this).text();
8534            if ($(this).find('.selected').length) return false;
8535            $('.choose-select-category.add li.orig:not([data-category="' + id + '"]').fadeOut(0).addClass('disable');
8536
8537            if (Number(id) > 1000000000) {
8538                if ($('.input-user-category').hasClass('active')) {
8539                    $('.input-user-category').removeClass('active').hide();
8540                    $('.modal-footer .ok-button-dialog').removeClass('disabled');
8541                }
8542                // addInputCategoryClose(0);
8543                enableCategoryButton();
8544            } else addInputCategoryClose(0);
8545
8546            $('.sub-category-item').removeClass('active').remove();
8547            $('.choose-select-category.add li').removeClass('active');
8548            $(this).addClass('active').html('<span class="selected" data-category="' + id + '">' + selected + ' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle" viewBox="0 0 16 16"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/><path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"/></svg></span>');
8549
8550            displaySubCategoryList(lux_all_category[id]['sub']);
8551        })
8552        .off('hover', '.choose-select-category.add li')
8553        .on('hover', '.choose-select-category.add li', function(e) {
8554            var id = $(this).attr('data-category');
8555            if ($(this).find('.selected').length) return;
8556            if (Number(id) > 1000000000 && $(this).find('.lux-category-delete').length == 0) {
8557                $(this).append('<span class="lux-category-delete"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash" viewBox="0 0 16 16"><path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z"/><path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z"/></svg></span>');
8558                $(this).append('<span class="lux-category-modify"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil" viewBox="0 0 16 16"><path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z"/></svg></span>');
8559            }
8560        });
8561
8562    $(document)
8563        .off('hover', '.sub-category-item > div')
8564        .on('hover', '.sub-category-item > div', function(e) {
8565            var id = $(this).attr('data-category');
8566            if ($(this).find('.selected').length) return;
8567            if (Number(id) > 1000000 && $(this).find('.lux-category-delete').length == 0) {
8568                $(this).append('<span class="lux-category-delete"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash" viewBox="0 0 16 16"><path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z"/><path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z"/></svg></span>');
8569                $(this).append('<span class="lux-category-modify"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil" viewBox="0 0 16 16"><path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z"/></svg></span>');
8570            }
8571        });
8572
8573    $(document)
8574        .off('click', '.choose-select-category.add li.add-user-category')
8575        .on('click', '.choose-select-category.add li.add-user-category', function(e) {
8576            var depth = $('.choose-select-category.add .selected').length,
8577                root = '',
8578                parent = '';
8579
8580            $('#input-user-category').attr('data-category', '').attr('data-modify', '');
8581            if (depth > 0) {
8582                root = $('.choose-select-category.add .selected').first().attr('data-category');
8583                parent = $('.choose-select-category.add .selected').last().attr('data-category');
8584            }
8585            depth++;
8586
8587            $('#input-user-category').attr('data-depth', depth).attr('data-parent', parent).attr('data-root', root);
8588            $(this).fadeOut(0).addClass('disable');
8589            setTimeout(function() {
8590                $('.input-user-category').fadeIn(0).addClass('active');
8591                $('.modal-footer .ok-button-dialog').addClass('disabled');
8592                $('#input-user-category').focus();
8593                $('.sub-category-item').addClass('hide');
8594            }, 0);
8595        });
8596
8597    $(document)
8598        .off('click', '.input-user-category-close svg')
8599        .on('click', '.input-user-category-close svg', function(e) {
8600            if ($(this).parent().prev().attr('data-modify') == 'true') {
8601                $('li.orig').removeClass('hide');
8602                addInputCategoryClose(0);
8603            } else {
8604                addInputCategoryClose(0);
8605            }
8606        });
8607
8608    $(document)
8609        .off('keyup', '#input-user-category')
8610        .on('keyup', '#input-user-category', function(e) {
8611            var key = (e.which) ? e.which : e.keyCode,
8612                category_no = $(this).attr('data-category'),
8613                depth = $(this).attr('data-depth'),
8614                parent = $(this).attr('data-parent'),
8615                root = $(this).attr('data-root'),
8616                full_no = [],
8617                full_name = [],
8618                val = $(this).val().trim();
8619
8620            $.each($('.choose-select-category.add .selected'), function(i, v) {
8621                full_no.push($(this).attr('data-category'));
8622                full_name.push($(this).text().trim());
8623            });
8624
8625            if (key == 13 && val != '') {
8626                $('.input-user-category.active').addClass('spinner');
8627                $.ajax({
8628                    type: 'POST',
8629                    url: '/template/lux_category_add',
8630                    data: { val: val, depth: depth, parent_no: parent, root: root, sid: SID, full_no: full_no, full_name: full_name, category_no: category_no },
8631                    dataType: 'json',
8632                    async: true,
8633                    cache: false,
8634                    success: function(r) {
8635                        $('.input-user-category.active').removeClass('spinner');
8636                        if (typeof r.error != 'undefined' && r.error) {
8637                            alert(r.error);
8638                            return false;
8639                        }
8640                        lux_all_category = r.all_category.all;
8641                        $('.input-user-category > input').val('');
8642                        $('.input-user-category').fadeOut(200).removeClass('active');
8643                        $('.modal-footer .ok-button-dialog').removeClass('disabled');
8644                        $('.sub-category-item').removeClass('hide');
8645                        if (category_no.length) {
8646                            if (r.depth == 1) {
8647                                $('.choose-select-category li.orig[data-category="' + category_no + '"]').html('<span class="user-category-text">' + val + '</span> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle" viewBox="0 0 16 16"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"></path><path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"></path></svg>');
8648                            } else {
8649                                $('.sub-category-item div[data-category="' + category_no + '"]').html('<span class="user-category-text">' + val + '</span><span class="lux-category-delete"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash" viewBox="0 0 16 16"><path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z"></path><path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z"></path></svg></span><span class="lux-category-modify"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil" viewBox="0 0 16 16"><path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z"></path></svg></span>');
8650                            }
8651                            $('li.orig').removeClass('hide');
8652                            $('.sub-category-item').removeClass('hide');
8653                        } else {
8654                            if (depth == 1) {
8655                                $('.add-user-category').before('<li class="orig" data-category="' + r.insert_no + '">' + val + '</li>');
8656                            } else if (depth == 2) {
8657                                $('.sub-category-item').removeClass('active').remove();
8658                                displaySubCategoryList(lux_all_category[parent]['sub']);
8659                            } else {
8660                                $('.sub-category-item').removeClass('active').remove();
8661                                displaySubCategoryList(lux_all_category[root]['sub'][parent]['sub'], true);
8662                            }
8663                            enableCategoryButton();
8664                        }
8665
8666                    },
8667                    error: function(xhr, status, error) {
8668                        $('.input-user-category.active').removeClass('spinner');
8669                        alert("Error " + xhr.status + " : 관리자
8669에게 문의");
8670                    }
8671                });
8672            }
8673        });
8674
8675    $(document)
8676        .off('click', '.sub-category-item div')
8677        .on('click', '.sub-category-item div', function(e) {
8678            var id = $(this).attr('data-category'),
8679                sub = $(this).attr('data-sub'),
8680                selected = $(this).text();
8681
8682            $('.choose-select-category.add li.active').append('<span class="selected" data-category="' + id + '">' + selected + ' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle" viewBox="0 0 16 16"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/><path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"/></svg></span>');
8683            if ($(this).hasClass('last')) {
8684                $('.sub-category-item').removeClass('active').remove();
8685                if ($('.choose-select-category.add .selected').length == 3) $('.add-user-category').addClass('disable');
8686                return;
8687            } else $('.sub-category-item').removeClass('active').remove();
8688
8689            displaySubCategoryList(lux_all_category[sub]['sub'][id]['sub'], true);
8690        });
8691
8692    $(document)
8693        .off('click', '.choose-select-category.add li > .selected')
8694        .on('click', '.choose-select-category.add li > .selected', function(e) {
8695            e.stopPropagation();
8696            if ($('.input-user-category').hasClass('active')) {
8697                $('.input-user-category').removeClass('active').hide();
8698                $('.modal-footer .ok-button-dialog').removeClass('disabled');
8699            }
8700            $('.sub-category-item').removeClass('active').remove();
8701            var category_no = Number($(this).attr('data-category'));
8702            switch ($(this).index()) {
8703                case 0:
8704                    $(this).parent().removeClass('active');
8705                    $(this).parent().text($(this).text());
8706                    // $('.add-user-category').addClass('disable').fadeOut(200);
8707                    // setTimeout(function() {
8708                    $('.choose-select-category.add li.disable').fadeIn(200).removeClass('disable');
8709                    // },200);
8710                    break;
8711                case 1:
8712                    $(this).parent().html($('.choose-select-category.add li > .selected').first().outerHTML());
8713                    var id = $('.choose-select-category.add li > .selected').last().attr('data-category');
8714                    displaySubCategoryList(lux_all_category[id]['sub']);
8715                    if (category_no > 1000000000) setTimeout(function() { enableCategoryButton(); }, 500);
8716                    break;
8717                case 2:
8718                    $(this).remove();
8719                    var id = $('.choose-select-category.add li > .selected').last().attr('data-category'),
8720                        sub = $('.choose-select-category.add li > .selected').first().attr('data-category');
8721                    displaySubCategoryList(lux_all_category[sub]['sub'][id]['sub'], true);
8722                    if (category_no > 1000000000) setTimeout(function() { enableCategoryButton(); }, 500);
8723                    break;
8724            }
8725        });
8726
8727    var addInputCategoryClose = function(out) {
8728        $('.sub-category-item').removeClass('hide');
8729        $('.input-user-category > input').val('');
8730        $('.input-user-category').removeClass('active').fadeOut(out, function() {
8731            if (out > 0) $('.choose-select-category.add li.add-user-category').removeClass('disable');
8732            $('.modal-footer .ok-button-dialog').removeClass('disabled');
8733        });
8734    }
8735
8736    var enableCategoryButton = function() {
8737        $('.choose-select-category.add li.add-user-category').removeClass('disable').show();
8738    }
8739
8740    var displaySubCategoryList = function(o, last, out) {
8741        $('.sub-category-item').remove();
8742        var s = '<div class="sub-category-item">';
8743        $.each(o, function(i, v) {
8744            s += '<div class="' + ((last) ? 'last' : '') + '" data-category="' + v.category_no + '" data-sub="' + v.parent_category_no + '"><span class="user-category-text">' + v.category_name + '</span></div>';
8745        });
8746        s += '</div>';
8747        $('.add-user-category').before(s);
8748        // setTimeout(function() {
8749        $('.sub-category-item').addClass('active');
8750        // },200);
8751        if (typeof out != 'undefined') return s;
8752    }
8753
8754    var setSelectCategoryHTML = function(r, add) {
8755        var category_add = (typeof add != 'undefined' && add == true) ? ' add' : '',
8756            li = '',
8757            active = '',
8758            prev_str = '',
8759            used = [];
8760
8761        $.each(r.use_category, function(i, v) {
8762            used.push(v);
8763        });
8764
8765        $.each(r.root, function(i, v) {
8766            var disabled = (used.indexOf(Number(v.category_no)) > -1) ? ' disabled' : '';
8767            if (typeof r.use_category[Number(selectID)] != 'undifined' && r.use_category[Number(selectID)] == v.category_no) {
8768                disabled = '';
8769            }
8770
8771            active = (v.category_no == r.category_no) ? 'active' : '';
8772            if (active == 'active') prev_str = v.category_no + ',' + v.category_name;
8773            if (v.count == -1) v.count = 0;
8774            li += '<li class="' + active + disabled + ' orig" data-category="' + v.category_no + '"><span class="user-category-text">
8774' + v.category_name + ((add) ? '</span> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle" viewBox="0 0 16 16"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/><path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"/></svg>' : '</span><span class="count">' + number_format(v.count) + '</span></li>');
8775        });
8776
8777        var s = '<ul class="choose-select-category' + category_add + '" data-prev="' + prev_str + '">' + li;
8778        if (add == true) {
8779            s += '<li class="click-off add-user-category orig"><svg xmlns="http://www.w3.org/2000/svg" width="17" height="17" fill="currentColor" class="bi bi-plus-lg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 2a.5.5 0 0 1 .5.5v5h5a.5.5 0 0 1 0 1h-5v5a.5.5 0 0 1-1 0v-5h-5a.5.5 0 0 1 0-1h5v-5A.5.5 0 0 1 8 2Z"/></svg> 카테고리 추가</li>';
8780            s += '<li class="click-off input-user-category" data-depth="1"><input type="text" id="input-user-category" maxlength="20" placeholder="카테고리명을 입력하세요"><span class="input-user-category-close"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-lg" viewBox="0 0 16 16"><path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"></path></svg></span></li>';
8781            s += '';
8782        }
8783        s += '</ul>';
8784        return s;
8785    }
8786
8787    var selectShoppingCategory = function(seq, mode, r, replace) {
8788        var modal = $(this).showModalFlat('상품 연결', setSelectCategoryHTML(r), true, true, function() {
8789            modal.modal('hide');
8790
8791            var choose = $('.choose-select-category li.active').attr('data-category');
8792            if (typeof choose == 'undefined') {
8793                alert('선택된 카테고리가 없습니다');
8794                return false;
8795            }
8796            $.modalON();
8797            setTimeout(function() {
8798                $('.gallerytype-choose').modal('hide');
8799                if (replace == true) selectGalleryTypeNreloadList(seq, mode, choose);
8800                else selectGalleryElement(seq, mode, choose);
8801            }, 500);
8802        }, 'config.close', 'config.ok', 'cl-cmmodal cl-s-btn w700 cl-p70 cl-p0 noActive-domain-check,zindex', true, '', '', function() {
8803            $('.flat-modal.zindex').remove();
8804            $('.choose-gallery-type li[data-gallery-type]').attr('style', '');
8805        });
8806    }
8807
8808    $(document).on({
8809        mouseenter: function(e) {
8810            $(this).parent().addClass('show-category');
8811        },
8812        mouseleave: function(e) {
8813            $(this).parent().removeClass('show-category');
8814        }
8815    }, ".cl-s-product-lux-info .lux-category-wrap");
8816
8817    $(document).on('click', '.choose-select-category li:not(.click-off)', function(e) {
8818        if ($(this).hasClass('disabled')) return false;
8819        $('.choose-select-category li').removeClass('active');
8820        $(this).addClass('active');
8821    });
8822
8823    $(document)
8824        .off('click', '.shop-filter-header .recommend-filter ~ .dropdown-menu li, .shop-filter-header .recommend-filter.brand')
8825        .on('click', '.shop-filter-header .recommend-filter ~ .dropdown-menu li, .shop-filter-header .recommend-filter.brand', function(e) {
8826            var key = $(this).attr('data-key'),
8827                val = $(this).attr('data-val'),
8828                selected_param = ($('.gallery-modal').length) ? localStorage.getItem(key) : getSearchURL(key);
8829            if ($(this).hasClass('disabled')) return;
8830
8831            if ($(this).hasClass('active')) {
8832                val = ($('.gallery-modal').length) ? removeParameter(key, val, true) : removeParameter(key, val);
8833            } else {
8834                if (key == 'brand' || key == 'trend' || key == 'discount_rate') {
8835                    if ((selected_param || '').indexOf(val) < 0) {
8836                        val = (selected_param) ? selected_param + ',' + val : val;
8837                    } else {
8838                        val = ($('.gallery-modal').length) ? removeParameter(key, val, true) : removeParameter(key, val);
8839                    }
8840                }
8841            }
8842
8843            if ($('.gallery-modal').length) {
8844                localStorage.setItem(key, val);
8845                $.gallery.show($.gallery.block_id, 1);
8846            } else {
8847                $.processON();
8848                location.href = setSearchURL(key, val);
8849            }
8850        });
8851
8852    $(document)
8853/* head
8854        .off('click', '.shop-filter-header .checked-filters .item-filter .dropdown-menu li')
8855        .on('click', '.shop-filter-header .checked-filters .item-filter .dropdown-menu li', function(e) {
8856            var key = $(this).attr('data-key'),
8857                val = $(this).attr('data-val');
8858
8859            if ($('.gallery-modal').length) {
8860                localStorage.setItem(key, val);
8861                $.gallery.show($.gallery.block_id, 1);
8862            } else {
8863                location.href = setSearchURL(key, val);
8864            }
8865        });
8866
8867    $(document)
8868        .off('click', '.shop-filter-header .checked-filters li svg')
8869        .on('click', '.shop-filter-header .checked-filters li svg', function(e) {
8870            e.stopPropagation();
8871            var key = $(this).parent().attr('data-key'),
8872                val = $(this).parent().attr('data-val');
8873
8874            val = ($('.gallery-modal').length) ? removeParameter(key, val, true) : removeParameter(key, val);
8875            if ($('.gallery-modal').length) {
8876                localStorage.setItem(key, val);
8877                $.gallery.show($.gallery.block_id, 1);
8878            } else {
8879                location.href = setSearchURL(key, val);
8880            }
8881        });
8882================================================================        
8883*/
8884    .off('click','.shop-filter-header .item-filter .dropdown-menu li')
8885    .on ('click','.shop-filter-header .item-filter .dropdown-menu li', function(e) {
8886        var key = $(this).attr('data-key'),
8887            val = $(this).attr('data-val');
8888
8889        if($('.gallery-modal').length) { 
8890            localStorage.setItem(key,val);
8891            $.gallery.show($.gallery.block_id,1);
8892        } else {
8893            location.href = setSearchURL(key,val);
8894        }
8895    });
8896
8897    $(document)
8898    .off('click','.shop-filter-header .checked-filters .user-checked svg')
8899    .on ('click','.shop-filter-header .checked-filters .user-checked svg', function(e) {
8900        e.stopPropagation();
8901        var key = $(this).parent().attr('data-key'),
8902            val = $(this).parent().attr('data-val');
8903
8904        val = ($('.gallery-modal').length) ? removeParameter(key,val,true) : removeParameter(key,val);
8905        if($('.gallery-modal').length) { 
8906            localStorage.setItem(key,val);
8907            $.gallery.show($.gallery.block_id,1);
8908        } else {
8909            location.href = setSearchURL(key,val);
8910        }
8911    });
8912/* ============================================================ */
8913
8914    $(document)
8915        .off('click', '.shop-filter-header .sub-category, .shop-filter-header .selected-category-item')
8916        .on('click', '.shop-filter-header .sub-category, .shop-filter-header .selected-category-item', function(e) {
8917            var key = $(this).attr('data-key'),
8918                val = $(this).attr('data-val');
8919
8920            if ($('.gallery-modal').length) {
8921                localStorage.setItem(key, val);
8922                $.gallery.show($.gallery.block_id, 1);
8923            } else {
8924                location.href = setSearchURL(key, val);
8925            }
8926        });
8927
8928    $(document)
8929        .off('keyup', '.product-name-input')
8930        .on('keyup', '.product-name-input', function(e) {
8931            var key = (e.which) ? e.which : e.keyCode,
8932                search_name = $(this).val().trim();
8933            if (key == 13) {
8934                if (search_name.indexOf(',') > -1 || search_name.indexOf('"') > -1 || search_name.indexOf('%') > -1) {
8935                    alert('\, \% \" 검색어에 포함될 수 없습니다');
8936                    return false;
8937                }
8938                
8939                searchProductName($(this));
8940            }
8941        });
8942
8943    $(document)
8944        .off('click','.search-product-cancel')
8945        .on ('click','.search-product-cancel', function(e) {
8946            if($(this).prev().val().trim() == '') return;
8947            localStorage.removeItem('product_name');
8948            $('.product-name-input').val('');
8949            $.processON();
8950            ($('.gallery-modal').length) ? 
8951                $.gallery.show($.gallery.block_id,1) :
8952                location.href = setSearchURL('product_name','');
8953        });
8954
8955    
8956    let qm_dragging = false, qm_startX = 0, qm_startLeft = 0;
8957    let $qm_active = $(); 
8958
8959    $(document)
8960        .off('click', '.search-product-remove')
8961        .on('click', '.search-product-remove', function(e) {
8962            if ($(this).prev().val().trim() == '') return;
8963            localStorage.removeItem('product_name');
8964            $('.product-name-input').val('');
8965            $.processON();
8966            ($('.gallery-modal').length) ?
8967                $.gallery.show($.gallery.block_id, 1):
8968                location.href = setSearchURL('product_name', '');
8969        });
8970
8971    $(document)
8972        .on('mousedown', '.quickmenu[data-imgtype="bottom_default"]', function (e) {
8973            qm_dragging = true;
8974            $qm_active = $(this).find('ul');
8975            if (!$qm_active.length) {
8976                qm_dragging = false;
8977                return;
8978            }
8979            qm_startX = e.pageX;
8980            qm_startLeft = $qm_active.scrollLeft() || 0;
8981            $qm_active.addClass('is-dragging');
8982            e.preventDefault();
8983        })
8984        .on('mousemove', '.quickmenu[data-imgtype="bottom_default"]', function (e) {
8985            if (!qm_dragging || !$qm_active.length) return;
8986            const dx = e.pageX - qm_startX;
8987            $qm_active.scrollLeft(qm_startLeft - dx); 
8988        })
8989        .on('mouseup mouseleave', '.quickmenu[data-imgtype="bottom_default"]', function () {
8990            if (!qm_dragging) return;
8991            qm_dragging = false;
8992            if ($qm_active.length) $qm_active.removeClass('is-dragging');
8993            $qm_active = $();
8994        })
8995        .on('dragstart', '.quickmenu[data-imgtype="bottom_default"]', function (e) { console.log(12); e.preventDefault(); });
8996    /*
8997        $(document)
8998        .off('keyup','.prod-search-brand .search-brand-input')
8999        .on ('keyup','.prod-search-brand .search-brand-input', function(e) {
9000            var key = (e.which) ? e.which : e.keyCode,
9001                search_brand = $(this).val().trim(),
9002                brand_code = '';
9003            if(key == 13) {
9004                $.each(product_brand_list, function(i,v) {
9005                    if(v.brand_name == search_brand) {
9006                        brand_code = v.brand_code;
9007                        return false;
9008                    }
9009                });
9010                if(brand_code) {
9011                    if($('.gallery-modal').length) {
9012                        localStorage.setItem('brand',brand_code);
9013                        $.gallery.show(selectID,1);
9014                    } else location.href = setSearchURL('brand',brand_code);
9015                }
9016            }
9017        });
9018    */
9019    function searchProductName($input) {
9020        var params = getProductParams(),
9021            stx = $input.val().trim();
9022
9023        if (stx.length) {
9024            if ($('.gallery-modal').length) {
9025                localStorage.setItem('product_name', stx);
9026                $.gallery.show($.gallery.block_id, 1);
9027            } else {
9028                $.processON();
9029                location.href = setSearchURL('product_name', stx);
9030            }
9031        }
9032    }
9033
9034    function removeElementByIndex(array, index) {
9035        if (index > -1) { // 제거할 인덱스가 배열 범위 내에 있는 경우
9036            array.splice(index, 1); // 해당 인덱스의 원소를 제거
9037        }
9038        return array;
9039    }
9040
9041    function getAddSearches() {
9042        var searches = (localStorage.getItem('searches_' + $.lux.select_type) === null || localStorage.getItem('searches_' + $.lux.select_type) == '[null]') ? [] : JSON.parse(localStorage.getItem('searches_' + $.lux.select_type)),
9043            sort = $('.lux-product-search .sort-filter .type_filter').attr('data-val');
9044        sort = (sort) ? sort : 'new';
9045        $.each(searches, function(i,v) {
9046            if(v == null) return true;            
9047            searches[i]['sort'] = sort;
9048        });        
9049               
9050        return searches;
9051    }
9052
9053    function resetAddSearches() {
9054      var s = getAddSearches();
9055      localStorage.removeItem('searches_' + $.lux.select_type);
9056    }
9057
9058    function defaultProductParams() {
9059        return {
9060            'category_no': '',
9061            'brand': '',
9062            'trend': '',
9063            'discount_rate': '',
9064            'min_sale': '',
9065            'max_sale': '',
9066            'min_price': '',
9067            'max_price': '',
9068            'filter': '',
9069            'product_name': '',
9070            'sort': '',
9071            'prod_case': ''
9072        }
9073    }
9074
9075    function getStorageItem(key) {
9076        if(typeof key == 'undefined' || key == '') return '';
9077
9078        $default_val = '';
9079        switch(key) {
9080            case 'gallery-product-filter':  $default_val = 'all'; break;
9081            case 'gallery-product-view':    $default_val = 0; break;
9082            case 'gallery-product-page':    $default_val = 1; break;
9083            default:                        $default_val = ''; break;
9084        }
9085
9086        return (localStorage.getItem(key) === null) ? $default_val : localStorage.getItem(key);
9087    }
9088
9089    function getProductParams(key) {
9090        var r = {
9091            'category_no': (localStorage.getItem('category_no') === null) ? '' : localStorage.getItem('category_no'),
9092            'brand': (localStorage.getItem('brand') === null) ? '' : localStorage.getItem('brand'),
9093            'trend': (localStorage.getItem('trend') === null) ? '' : localStorage.getItem('trend'),
9094            'discount_rate': (localStorage.getItem('discount_rate') === null) ? '' : localStorage.getItem('discount_rate'),
9095            'min_sale': (localStorage.getItem('min_sale') === null) ? '' : localStorage.getItem('min_sale'),
9096            'max_sale': (localStorage.getItem('max_sale') === null) ? '' : localStorage.getItem('max_sale'),
9097            'min_price': (localStorage.getItem('min_price') === null) ? '' : localStorage.getItem('min_price'),
9098            'max_price': (localStorage.getItem('max_price') === null) ? '' : localStorage.getItem('max_price'),
9099            'filter': (localStorage.getItem('filter') === null) ? '' : localStorage.getItem('filter'),
9100            'product_name': (localStorage.getItem('product_name') === null) ? '' : localStorage.getItem('product_name'),
9101            'sort': (localStorage.getItem('sort') === null) ? '' : localStorage.getItem('sort'),
9102            'prod_case': (localStorage.getItem('prod_case') === null) ? '' : localStorage.getItem('prod_case'),
9103        }
9104        if (typeof key != 'undefined') return r[key];
9105        else {
9106            var isNull = true;
9107            $.each(r, function(i, v) {
9108                if (v.length) isNull = false;
9109            });
9110            if (isNull) return null;
9111            else return r;
9112        }
9113    }
9114
9115    function setSearchesIndexValue(key, value) {
9116        var idx = $('.search-list .search-group.active').index(),
9117            searches = getAddSearches();
9118
9119        if (idx < 0 || typeof key == 'undefined') return false;
9120
9121        // var o = searches[idx][key];
9122        // if(o.length) {
9123        //     o+= ',' + value;
9124        // } else o = value;
9125        if (searches.length == 0 || searches === null || searches[0] == null) {
9126            searches = [];
9127            searches.push(defaultProductParams());
9128            searches[idx][key] = value;
9129        } else {
9130            searches[idx][key] = value;
9131        }
9132
9133        // localStorage.setItem('searches', JSON.stringify(searches));
9134        localStorage.setItem('searches_' + $.lux.select_type, JSON.stringify(searches));        
9135        resetLocalStorageSearch();
9136        return true;
9137    }
9138
9139    function setProductParams(params) {
9140        $.each(params, function(k, v) {
9141            if (v.length) {
9142                localStorage.setItem(k, v);
9143            }
9144        });
9145    }
9146
9147    function resetProductParams() {
9148        localStorage.removeItem('category_no');
9149        localStorage.removeItem('brand');
9150        localStorage.removeItem('trend');
9151        localStorage.removeItem('discount_rate');
9152        localStorage.removeItem('min_sale');
9153        localStorage.removeItem('max_sale');
9154        localStorage.removeItem('min_price');
9155        localStorage.removeItem('max_price');
9156        localStorage.removeItem('filter');
9157        localStorage.removeItem('product_name');
9158        localStorage.removeItem('sort');
9159        localStorage.removeItem('prod_case');
9160        localStorage.removeItem('add_search');
9161        localStorage.removeItem('searches');
9162    }
9163
9164    function resetLocalStorageSearch() {
9165        localStorage.removeItem('category_no');
9166        localStorage.removeItem('brand');
9167        localStorage.removeItem('trend');
9168        localStorage.removeItem('discount_rate');
9169        localStorage.removeItem('min_sale');
9170        localStorage.removeItem('max_sale');
9171        localStorage.removeItem('min_price');
9172        localStorage.removeItem('max_price');
9173        localStorage.removeItem('filter');
9174        localStorage.removeItem('product_name');
9175        localStorage.removeItem('sort');
9176        localStorage.removeItem('prod_case');
9177    }
9178
9179    function resetSearches() {
9180        localStorage.removeItem('searches_lux');
9181        localStorage.removeItem('searches_shopping');
9182        localStorage.removeItem('searches_project');
9183        localStorage.removeItem('searches_gallery');
9184    }
9185
9186    function removeParameter(key, remove, mode) {
9187        var param = (mode == true) ? localStorage.getItem(key) : getSearchURL(),
9188            s = (mode == true) ? param : param[key],
9189            val = (s || '').split(',');
9190
9191        var r = arrayRemove(val, remove);
9192        return (r.length) ? r.join(',') : '';
9193    }
9194
9195    function getSearchURL(key) {
9196        var location = window.location.href,
9197            url = new URL(location),
9198            param = url.searchParams;
9199
9200        var r = {};
9201        if(typeof key != 'undefined' && key) {
9202            r[key] = (param.get(key) == null) ? '' : param.get(key);
9203        } else {
9204            r = {
9205                'category_no' : (param.get('category_no') == null) ? '' : param.get('category_no'),
9206                'brand' : (param.get('brand') == null) ? '' : param.get('brand'),
9207                'trend' : (param.get('trend') == null) ? '' : param.get('trend'),
9208                'discount_rate' : (param.get('discount_rate') == null) ? '' : param.get('discount_rate'),
9209                'min_sale' : (param.get('min_sale') == null) ? '' : param.get('min_sale'),
9210                'max_sale' : (param.get('max_sale') == null) ? '' : param.get('max_sale'),
9211                'min_price' : (param.get('min_price') == null) ? '' : param.get('min_price'),
9212                'max_price' : (param.get('max_price') == null) ? '' : param.get('max_price'),
9213                'filter' : (param.get('filter') == null) ? '' : param.get('filter'),
9214                'product_name' : (param.get('product_name') == null) ? '' : param.get('product_name'),
9215                'sort' : (param.get('sort') == null) ? '' : param.get('sort'),
9216            }
9217        }
9218
9219        $.each(r, function(r_k, r_v) {
9220            switch(r_k) {
9221                case 'trend':
9222                    var trend = (r_v) ? r_v.split(',') : [];
9223                    $(trend).each(function(k, v) {
9224                        $('.recommend-filter.list-filter + .dropdown-menu [data-key="trend"][data-val="' + v + '"]').addClass('active');
9225                    });
9226                    break;
9227                case 'min_sale':
9228                case 'max_sale':
9229                    break;
9230                case 'discount_rate':
9231                    var discount_rate = (r_v) ? r_v.split(',') : [];
9232                    $(discount_rate).each(function(k, v) {
9233                        $('.recommend-filter.list-filter + .dropdown-menu [data-key="discount_rate"][data-val="' + v + '"]').addClass('active');
9234                    });
9235                    break;
9236
9237                case 'product_name':
9238                    $('.search-product input.product-name-input').val(r_v);
9239                    break;
9240
9241                case 'sort':
9242                    if(r_v == '') r_v = 'new'; 
9243                    $('.checked-filters li[data-key="sort"][data-val="' + r_v + '"]').addClass('active');
9244                    var sort_active_str = $('.checked-filters li[data-key="sort"].active').eq(0).text();
9245                    $('.checked-filters .type_filter').text(sort_active_str);
9246                    break;
9247
9248                default:
9249                    if($.inArray(r_k, ['min_price', 'max_price']) > -1 && r_v) {
9250                        $('.recommend-filter.list-filter + .dropdown-menu [data-key="' + r_k + '"][data-val="' + r_v + '"]').addClass('active');
9251                    }
9252                    break;
9253            }
9254        });
9255
9256        return (typeof key != 'undefined') ? r[key] : r;
9257    }
9258
9259    function setSearchURL(k, v) {
9260        var param = getSearchURL();
9261        // 초기 category_no
9262        if (param.category_no == '') {
9263            var searches = getAddSearches();
9264            param.category_no = searches[0].category_no;
9265        }
9266        param[k] = v;
9267        setProductParams(param);
9268        var page = (typeof PAGE == 'undefined') ? property.PAGE : PAGE;
9269        if (typeof MODE == 'undefined') { // render
9270            var url = (property.LOAD == 'RENDER') ? '/render/' : '/';
9271            return url + page + 
9272              '?category_no=' + param.category_no + 
9273              '&brand=' + param.brand + 
9274              '&trend=' + param.trend + 
9275              '&discount_rate=' + param.discount_rate + 
9276              '&min_sale=' + param.min_sale + 
9277              '&max_sale=' + param.max_sale + 
9278              '&min_price=' + param.min_price + 
9279              '&max_price=' + param.max_price + 
9280              '&filter=' + param.filter + 
9281              '&product_name=' + param.product_name + 
9282              '&sort=' + param.sort;
9283        } else { // config
9284            return '/config/page/' + page + 
9285              '?category_no=' + param.category_no + 
9286              '&brand=' + param.brand + 
9287              '&trend=' + param.trend + 
9288              '&discount_rate=' + param.discount_rate + 
9289              '&min_sale=' + param.min_sale + 
9290              '&max_sale=' + param.max_sale + 
9291              '&min_price=' + param.min_price + 
9292              '&max_price=' + param.max_price + 
9293              '&filter=' + param.filter + 
9294              '&product_name=' + param.product_name + 
9295              '&sort=' + param.sort;
9296        }
9297    }
9298
9299    var shopHeaderDisplaySkin = function($tag,data) {
9300        if(typeof data.mode == 'undefined' || data.mode != 'shopping') return;
9301        var checkDefaultCall = false;
9302
9303        var shd_skin = $tag.attr('data-skin'),
9304            shd_row_class = 'goption-row',
9305            shd_r = data.category_info;
9306
9307        var $cate_selected_ul = $('<ul class="selected-category-list"></ul>'),
9308            cate_full = (typeof shd_r.selected != 'undefined' && shd_r.selected.full_category_no != null) ? shd_r.selected.full_category_no : [],
9309            cate_last_name = '',
9310            cate_last_val = '';
9311        if(typeof shd_r != 'undefined' && typeof shd_r.selected != 'undefined' && typeof shd_r.selected.full_category_name != 'undefined' && shd_r.selected.full_category_name != null) {
9312            $.each(shd_r.selected.full_category_name, function(i,v) {
9313                if(v != null && i < 3) {
9314                    cate_last_name = v;
9315                    cate_last_val = cate_full[i];
9316                    $cate_selected_ul.append('<li class="selected-category-item hand" data-key="category_no" data-val="' + cate_last_val + '">' + cate_last_name + '</li>');
9317                }
9318            });
9319        }
9320        $cate_selected_ul.find('li:last').addClass('active');
9321
9322        var $cate_h1 = $('<h1 class="selected-category-h1">' + cate_last_name + '</h1>');
9323
9324        var $cate_sub_ul = $('<ul class="sub-category-list"></ul>'),
9325            checkCateSub = false;
9326        $.each(shd_r.sub, function(i,o) {
9327            var cate_sub_active = (shd_r.selected.category_no == o.category_no) ? 'active' : '';
9328            if(cate_sub_active != '') checkCateSub = true;
9329
9330            var cate_sub_name = o.category_name;
9331            if($.inArray(shd_skin, ['000']) > -1) cate_sub_name += '<span class="count">' + number_format(s.count) + '</span>';
9332            if($.inArray(shd_skin, ['001','002','003']) > -1) cate_sub_name = '<span class="sub-category-name">' + cate_sub_name + '</span>';
9333
9334            $cate_sub_ul.append('<li class="sub-category ' + cate_sub_active + '" data-key="category_no" data-val="' + o.category_no + '">' + cate_sub_name + ' </li>');
9335        });
9336        if(typeof shd_r.selected != 'undefined' && typeof shd_r.selected.category_no != 'undefined') {
9337            var all_cate_sub_name = ($.inArray(shd_skin, ['001','002','003']) > -1) ? '<span class="sub-category-name">전체</span>' : '전체';
9338            $cate_sub_ul.prepend('<li class="sub-category all-sub-category ' + ((checkCateSub) ? '' : 'active') + '" data-key="category_no" data-val="' + cate_last_val + '">' + all_cate_sub_name + '</li>');
9339        }
9340
9341        var $search_product = $('<div class="search-product"></div>'),
9342            $search_product_input = $('<input type="text" class="product-name-input form-control" placeholder="상품명 검색" enterkeyhint="search" value="">'),
9343            $search_product_cancel = $('<span class="search-product-cancel">' + clSVG('close_m','16','16',false,'') + '</span>'),
9344            $search_product_search = $('<span class="search-product-btn">' + clSVG('search','16','16',false,'') + '</span>');
9345
9346
9347        var checkBrand = (  typeof data.category_info.uri != 'undefined' && 
9348                            typeof data.category_info.uri.brand != 'undefined' && (data.category_info.uri.brand).length
9349                        ) ? false : (($.inArray(shd_skin, ['001','002','003']) > -1) ? false : true),
9350            $search_filter = $('<div class="filter-wrap">' + ChooseFilters(checkBrand) + '</div>');
9351
9352        var sort_filter_ul = ($.inArray(shd_skin, ['001','002','003']) > -1) ? 'div' : 'ul',
9353            sort_filter_li = ($.inArray(sort_filter_ul, ['div']) > -1) ? sort_filter_ul : 'li',
9354            $sort_filter = $('\
9355                <'+ sort_filter_ul + '>\
9356                    <' + sort_filter_li + ' class="btn-group">\
9357                        <button type="button" class="dropdown-toggle recommend-filter list-filter dropdown-button item-filter" data-toggle="dropdown">\
9358                            <span class="type_filter">신상품</span>\
9359                            <svg width="12" height="12" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"></path></svg>\
9360                        </button>\
9361                        <ul class="dropdown-menu">\
9362                            <li data-key="sort" data-val="new">신상품</li>\
9363                            <li data-key="sort" data-val="name">상품명</li>\
9364                            <li data-key="sort" data-val="low">낮은가격</li>\
9365                            <li data-key="sort" data-val="high">높은가격</li>\
9366                        </ul>\
9367                    </' + sort_filter_li + '>\
9368                </'+ sort_filter_ul + '>\
9369            ');
9370
9371
9372        var checked_filter_ul = ($.inArray(shd_skin, ['001']) > -1) ? 'div' : 'ul',
9373            checked_filter_li = ($.inArray(checked_filter_ul, ['div']) > -1) ? checked_filter_ul : 'li',
9374            $checked_filter_item = $('<' + checked_filter_li + ' class="user-checked"><span></span> ' + clSVG('close_m_thin',16,16,false) + '</' + checked_filter_li + '>'),
9375            $checked_filter = $('<' + checked_filter_ul + ' class="checked-filters"></' + checked_filter_ul + '>');
9376        if(typeof shd_r.checked != 'undefined' && shd_r.checked) {
9377            $.each(shd_r.checked, function(i,o) {
9378                var $tmp_cf = $checked_filter_item.clone();
9379                $tmp_cf.attr({'data-key': o.key, 'data-val': o.val});
9380                $tmp_cf.find(' > span').text(o.str);
9381                $checked_filter.append($tmp_cf);
9382            });
9383        }
9384
9385        var result_total = (typeof data.total != 'undefined' && typeof data.total.list_total != 'undefined' && data.total.list_total) ? data.total.list_total : 0,
9386            result_title = ($.inArray(shd_skin, ['001','002','003']) > -1) ? '<h1>검색결과</h1>' : '',
9387            $result_summary = $('<div class="result-summary">' + result_title + ' <span class="total">' + addCommas(result_total) + '</span><span class="unit">개</span></div>');
9388
9389        switch(shd_skin) {
9390            case '001':
9391                $tag.append($search_product.addClass('clearfix').append($search_product_input.attr('placeholder', '상품 검색')).append($search_product_search))
9392                    .append($cate_selected_ul)
9393                    .append($cate_sub_ul)
9394                    .append('<div class="line-wrap"><hr class="line"/></div>')
9395                    .append($search_filter.addClass('clearfix'))
9396                    .append($checked_filter);
9397                
9398                $sort_filter.find('.type_filter + svg').replaceWith(clSVG('caret',8,4,false));
9399                $sort_filter.find('.btn-group').addClass('pull-right');
9400                $tag.append($sort_filter.addClass('last clearfix').prepend($result_summary));
9401                break;
9402
9403            case '002':
9404                $tag.append($cate_selected_ul.addClass('clearfix'))
9405                    .append($search_product.addClass('clearfix').append($search_product_input.attr('placeholder', '상품 검색')).append($search_product_search))
9406                    .append('<div class="clearfix"></div>')
9407                    .append($cate_h1.addClass('clearfix'))
9408                    .append($cate_sub_ul)
9409                    .append('<div class="line-wrap"><hr class="line"/></div>')
9410                    .append($search_filter.addClass('clearfix'))
9411                    .append($checked_filter);
9412
9413                $sort_filter.find('.type_filter + svg').replaceWith(clSVG('caret',8,4,false));
9414                $sort_filter.find('.btn-group').addClass('pull-right');
9415                $tag.append($sort_filter.addClass('last clearfix').append($result_summary));
9416
9417                if($tag.find('.checked-filters').is(':empty')) $tag.find('.last.clearfix > div').css('margin-right', '8px');
9418                break;
9419
9420            case '003':
9421                $tag.append($cate_selected_ul.addClass('clearfix'))
9422                    .append('<div class="clearfix"></div>')
9423                    .append($cate_h1.addClass('clearfix'))
9424                    .append($cate_sub_ul)
9425                    .append('<div class="line-wrap"><hr class="line"/></div>')
9426                    .append($search_filter.addClass('clearfix'))
9427                    .append($checked_filter);
9428
9429                $sort_filter.find('.type_filter + svg').replaceWith(clSVG('caret',8,4,false));
9430                $sort_filter.find('.btn-group').addClass('pull-right');
9431                $tag.append($sort_filter.addClass('last clearfix').append($result_summary));
9432                $tag.find('h1.selected-category-h1').append('<div class="result-summary"><span class="total">
9432' + addCommas(result_total) + '</span><span class="unit">개 상품</span></div>').wrap('<div></div>');
9433                $tag.find('h1.selected-category-h1').before($search_product.addClass('clearfix').append($search_product_input.attr('placeholder', '상품 검색')).append($search_product_search));
9434
9435                if($tag.find('.checked-filters').is(':empty')) $tag.find('.last.clearfix > div').css('margin-right', '8px');
9436                break;
9437
9438            default:
9439                checkDefaultCall = true;
9440                break;
9441        }
9442
9443        if(checkDefaultCall) {
9444            $tag.removeAttr('data-skin');
9445            shopHeaderDisplay($tag,data);
9446            return;
9447        } else {
9448            getSearchURL();
9449
9450            if($tag.closest('[class*="el_"]').length > 0 && $tag.closest('[class*="el_"]').find('.full-width').length > 0) $tag.addClass('full-width');
9451            else $tag.removeClass('full-width');
9452
9453            $tag.children().addClass('goption-row');
9454        }
9455
9456        var brand_search = (typeof data.brand_search != 'undefined' && typeof data.brand_search.tag != 'undefined' && data.brand_search.tag) ? data.brand_search.tag : '';
9457        shopBrandInputAutocomplete(data.brand_list, brand_search);
9458
9459    }
9460
9461    var shopHeaderDisplay = function($tag,data) {
9462        var checkLUX = typeof LUX != 'undefined' ? LUX : property.LUX;
9463        if(checkLUX && $tag.closest('.element').is('[data-type="gallery"][data-mode="shopping"]')) $tag.closest('.element').addClass('cl-lux-gallery');
9464
9465        var check_only_cate = (typeof data.only_category != 'undefined' && data.only_category === true) ? true : false;
9466        if(!check_only_cate) return;
9467        if(typeof $tag.attr('data-skin') != 'undefined' && $tag.attr('data-skin')) {
9468            shopHeaderDisplaySkin($tag,data);
9469            return;
9470        }
9471        var brandChecked = (typeof data.category_info.uri != 'undefined' && 
9472                            typeof data.category_info.uri.brand != 'undefined' && (data.category_info.uri.brand).length
9473                          ) ? false : true;
9474        $tag.prepend('<ul class="goption-row checked-filters"></ul>');
9475        $tag.prepend('<div class="goption-row filter-wrap">' + ChooseFilters(brandChecked) + '</div>');
9476        $tag.prepend('<ul class="goption-row sub-category-list"></ul>');
9477        $tag.prepend('<ul class="goption-row selected-category-list"></ul>');
9478        selected_category = data.category_info;
9479
9480        // lux shopping selected category
9481        if (typeof selected_category == 'object' && data.mode == 'shopping') {
9482            var $category_nav = $tag.find('.selected-category-list'),
9483                full_category_no = selected_category.selected.full_category_no;
9484            last_category_no = '';
9485            if (selected_category.selected.full_category_name !== null) {
9486                $.each(selected_category.selected.full_category_name, function(c, s) {
9487                    if (s != null && c < 3) {
9488                        $category_nav.append('<li class="selected-category-item hand" data-key="category_no" data-val="' + full_category_no[c] + '">' + s + '</li>');
9489                        last_category_no = full_category_no[c];
9490                    }
9491                });
9492            }
9493            // search 
9494            var product_name_input = ($('.gallery-modal').length) ? getProductParams('product_name') : getSearchURL('product_name');
9495            $category_nav.append('<li class="search-product"><input type="text" class="form-control product-name-input" placeholder="상품명 검색" enterkeyhint="search" value="' + product_name_input + '"><span class="search-product-cancel"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-lg" viewBox="0 0 16 16"><path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/></svg></span></li>');
9496
9497            var $sub_category = $tag.find('.sub-category-list'),
9498                sub_category_selected = false;
9499            $.each(selected_category.sub, function(c, s) {
9500                var active = (selected_category.selected.category_no == s.c
9500ategory_no) ? 'active' : '';
9501                if (active.length) sub_category_selected = true;
9502
9503                $sub_category.append('<li class="sub-category ' + active + '" data-key="category_no" data-val="' + s.category_no + '">' + s.category_name + ' <span class="count">' + number_format(s.count) + '</span></li>');
9504            });
9505
9506            if (typeof selected_category.selected != 'undefined' && typeof selected_category.selected.category_no != 'undefined') {
9507                $sub_category.prepend('<li class="sub-category all-sub-category ' + ((sub_category_selected) ? '' : 'active') + '" data-key="category_no" data-val="' + last_category_no + '">전체</li>');
9508            }
9509
9510            $.each(selected_category.checked, function(s,l) {
9511                $tag.find('.checked-filters').append('<li class="user-checked" data-key="' + l.key + '" data-val="' + l.val + '">' + l.str + ' ' + clSVG('close_m_thin',16,16,false) + '</li>');
9512            });
9513
9514            if ($tag.find('.checked-filters .list-filter').length == 0) {
9515                var selected = ($('.gallery-modal').length) ? getProductParams('sort') : getSearchURL('sort'),
9516                    filters = {
9517                        'new': '신상품',
9518                        'name': '상품명',
9519                        'low': '낮은가격',
9520                        'high': '높은가격'
9521                    };
9522                if (selected == '') selected = 'new';
9523                var s = '\
9524                <div class="btn-group list-filter">\
9525                    <button type="button" class="dropdown-toggle recommend-filter dropdown-button item-filter" data-toggle="dropdown">\
9526                        <span class="type_filter">' + filters[selected] + '</span>\
9527                        <svg width="12" height="12" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16">\
9528                            <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"></path>\
9529                        </svg>\
9530                    </button>\
9531                    <ul class="dropdown-menu">\
9532                        <li data-key="sort" data-val="new">신상품</li>\
9533                        <li data-key="sort" data-val="name">상품명</li>\
9534                        <li data-key="sort" data-val="low">낮은가격</li>\
9535                        <li data-key="sort" data-val="high">높은가격</li>\
9536                    </ul>\
9537                </div>\
9538                ';
9539                /*
9540                <li data-key="filter" data-val="hot">인기상품</li>\
9541                <li data-key="filter" data-val="review">사용후기</li>\
9542                */
9543
9544                var prod_cases = { 'A': '전체', 'M': '수정상품', 'O': '사입상품', 'H': '숨김상품', 'S': '품절상품' };
9545                var prod_case_value = getProductParams('prod_case');
9546                if (!prod_case_value) prod_case_value = 'A'; 
9547                if ($('.gallery-modal').length) { // 상품관리 모달 열린상태
9548                    s += '<div class="btn-group list-filter">\
9549                            <button type="button" class="dropdown-toggle recommend-filter list-filter dropdown-button" data-toggle="dropdown">\
9550                                <span class="type_prod_case">' + prod_cases[prod_case_value] + '</span>\
9551                                <svg width="12" height="12" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16">\
9552                                    <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"></path>\
9553                                </svg>\
9554                            </button>\
9555                            <ul class="dropdown-menu">\
9556                    ';
9557                    $.each(prod_cases, function(k, v) {
9558                        s += '<li class="" data-key="prod_case" data-val="' + k + '">' + v + '</li>';
9559                    });
9560
9561                    s += '\
9562                            </ul>\
9563                        </div>';
9564                }
9565
9566                $tag.find('.checked-filters').append(s);
9567            }
9568        }
9569
9570        // lux shopping filter active
9571        if(data.mode == 'shopping') {
9572            if($('.gallery-modal').length == 0) var tmp_filter = getSearchURL();
9573            var trend = localStorage.getItem('trend'),
9574                discount_rate = localStorage.getItem('discount_rate'),
9575                min_sale = localStorage.getItem('min_sale'),
9576                max_sale = localStorage.getItem('max_sale'),
9577                min_price = localStorage.getItem('min_price'),
9578                max_price = localStorage.getItem('max_price'),
9579                filter = localStorage.getItem('filter');
9580
9581            $.each((trend || '').split(','), function(s, l) {
9582                $tag.find('.filter-wrap li[data-key="trend"][data-val="' + l + '"]').addClass('active');
9583            });
9584            $.each((discount_rate || '').split(','), function(s, l) {
9585                $tag.find('.filter-wrap li[data-key="discount_rate"][data-val="' + l + '"]').addClass('active');
9586            });
9587            $tag.find('.filter-wrap li[data-key="min_price"][data-val="' + min_price + '"]').addClass('active');
9588            $tag.find('.filter-wrap li[data-key="max_price"][data-val="' + max_price + '"]').addClass('active');
9589            $tag.find('.filter-wrap li[data-key="filter"][data-val="' + filter + '"]').addClass('active');
9590        }
9591        // lux brand
9592        // var tags = [];
9593        // $.each(data.brand_list, function(i,v) {
9594        //     tags.push(v.brand_name);
9595        // });
9596        
9597        var brand_search = (typeof data.brand_search != 'undefined' && typeof data.brand_search.tag != 'undefined' && data.brand_search.tag) ? data.brand_search.tag : '';
9598        shopBrandInputAutocomplete(data.brand_list, brand_search);
9599    }
9600
9601    var shopBrandInputAutocomplete = function(list, search) {
9602        if(typeof search == 'undefined') search = '';
9603
9604        $('.search-brand-input').autocomplete({
9605            source: search,
9606            appendTo: '.prod-search-brand',
9607            focus: function(event, ui) {
9608                $('.ui-autocomplete li').removeClass('active');
9609                if (ui.item.value == '') return false;
9610                $('.ui-autocomplete li a:contains("' + ui.item.value + '")').parent().addClass('active');
9611                return false;
9612            },
9613            select: function(event, ui) {
9614                if (ui.item.value == '') {
9615                    event.preventDefault();
9616                    return false;
9617                }
9618                var selected = ui.item.value,
9619                    val = selected.split(" ["),
9620                    search_brand = '',
9621                    brand_code = '';
9622                ui.item.value = val[0];
9623
9624                search_brand = val[0];
9625                $.each(list, function(i,v) {
9626                    if(v.brand_name == search_brand) {
9627                        brand_code = v.brand_code;
9628                        return false;
9629                    }
9630                });
9631                if (brand_code) {
9632                    if ($('.gallery-modal').length) {
9633                        localStorage.setItem('brand', brand_code);
9634                        $.gallery.show($.gallery.block_id, 1);
9635                    } else {
9636                        $.processON();
9637                        location.href = setSearchURL('brand', brand_code);
9638                    }
9639                }
9640            },
9641            response: function(event, ui) {
9642                if (ui.content.length == 0) {
9643                    ui.content.push({ value: '', label: '검색되는 브랜드가 없습니다.' });
9644                }
9645            }
9646        });
9647    }
9648    var getRecordHtml = function(service) {
9649        var str = '';
9650        switch (service) {
9651            case 'go':
9652                str += '\
9653                <div class="table-wrap">\
9654                    <table>\
9655                        <colgroup>\
9656                            <col width="120px"></col>\
9657                            <col width="75px"></col>\
9658                            <col width="85px"></col>\
9659                            <col width="60px"></col>\
9660                            <col width="*"></col>\
9661                        </colgroup>\
9662                        <thead>\
9663                            <tr><td>' + $.lang[LANG]['domain.connect.record.title.name'] + '</td><td>' + $.lang[LANG]['domain.connect.record.title.ttl'] + '</td><td>' + $.lang[LANG]['domain.connect.record.title.type'] + '</td><td>' + $.lang[LANG]['domain.connect.record.title.priority'] + '</td><td>' + $.lang[LANG]['domain.connect.record.title.val'] + '</td></tr>\
9664                        </thead>\
9665                        <tbody>\
9666                            <tr><td>' + $.lang[LANG]['domain.connect.record.content.blank.1'] + '</td><td>3600</td><td>MX</td><td>1</td><td>ASPMX.L.GOOGLE.COM</td></tr>\
9667                            <tr><td>' + $.lang[LANG]['domain.connect.record.content.blank.1'] + '</td><td>3600</td><td>MX</td><td>5</td><td>ALT1.ASPMX.L.GOOGLE.COM</td></tr>\
9668                            <tr><td>' + $.lang[LANG]['domain.connect.record.content.blank.1'] + '</td><td>3600</td><td>MX</td><td>5</td><td>ALT2.ASPMX.L.GOOGLE.COM</td></tr>\
9669                            <tr><td>' + $.lang[LANG]['domain.connect.record.content.blank.1'] + '</td><td>3600</td><td>MX</td><td>10</td><td>ALT3.ASPMX.L.GOOGLE.COM</td></tr>\
9670                            <tr><td>' + $.lang[LANG]['domain.connect.record.content.blank.1'] + '</td><td>3600</td><td>MX</td><td>10</td><td>ALT4.ASPMX.L.GOOGLE.COM</td></tr>\
9671                        </tbody>\
9672                    </table>\
9673                </div>\
9674                </div>';
9675                break;
9676
9677            case 'nv':
9678                str += '\
9679                <div class="table-wrap">\
9680                    <table>\
9681                        <colgroup>\
9682                            <col width="180px"></col>\
9683                            <col width="60px"></col>\
9684                            <col width="*"></col>\
9685                        </colgroup>\
9686                        <thead>\
9687                            <tr><td>' + $.lang[LANG]['domain.connect.record.title.name'] + '</td><td>' + $.lang[LANG]['domain.connect.record.title.priority'] + '</td><td>' + $.lang[LANG]['domain.connect.record.title.record'] + '</td></tr>\
9688                        </thead>\
9689                        <tbody>\
9690                            <tr><td>' + $.lang[LANG]['domain.connect.record.content.blank.2'] + '</td><td>10</td><td>kr1-aspmx1.worksmobile.com.</td></tr>\
9691                            <tr><td>' + $.lang[LANG]['domain.connect.record.content.blank.2'] + '</td><td>20</td><td>kr1-aspmx2.worksmobile.com.</td></tr>\
9692                        </tbody>\
9693                    </table>\
9694                </div>\
9695                </div>';
9696                break;
9697
9698            case 'dm':
9699                str += '\
9700                <div class="table-wrap">\
9701                    <table>\
9702                        <colgroup>\
9703                            <col width="160px"></col>\
9704                            <col width="60px"></col>\
9705                            <col width="*"></col>\
9706                        </colgroup>\
9707                        <thead>\
9708                            <tr><td>' + $.lang[LANG]['domain.connect.record.title.name'] + '</td><td>' + $.lang[LANG]['domain.connect.record.title.priority'] + '</td><td>' + $.lang[LANG]['domain.connect.record.title.record'] + '</td></tr>\
9709                        </thead>\
9710                        <tbody>\
9711                            <tr><td>' + $.lang[LANG]['domain.connect.record.content.blank.2'] + '</td><td>10</td><td>ASPMX.daum.net.</td></tr>\
9712                            <tr><td>' + $.lang[LANG]['domain.connect.record.content.blank.2'] + '</td><td>20</td><td>ALT.ASPMX.daum.net.</td></tr>\
9713                        </tbody>\
9714                    </table>\
9715                </div>\
9716                </div>';
9717                break;
9718
9719            case 'hi':
9720                str += '\
9721                <div class="table-wrap">\
9722                    <table>\
9723                        <colgroup>\
9724                            <col width="130px"></col>\
9725                            <col width="85px"></col>\
9726                            <col width="60px"></col>\
9727                            <col width="*"></col>\
9728                        </colgroup>\
9729                        <thead>\
9730                            <tr><td>' + $.lang[LANG]['domain.connect.record.title.name'] + '</td><td>' + $.lang[LANG]['domain.connect.record.title.type'] + '</td><td>' + $.lang[LANG]['domain.connect.record.title.priority'] + '</td><td>' + $.lang[LANG]['domain.connect.record.title.val'] + '</td></tr>\
9731                        </thead>\
9732                        <tbody>\
9733                            <tr><td>@</td><td>MX</td><td>10</td><td>mx1.hiworks.com.</td></tr>\
9734                            <tr><td>@</td><td>MX</td><td>20</td><td>
9734mx2.hiworks.com.</td></tr>\
9735                            <tr><td>@</td><td>TXT(SPF)</td><td></td><td>v=spf1 include:_spf.hiworks.co.kr ~all</td></tr>\
9736                        </tbody>\
9737                    </table>\
9738                </div>\
9739                </div>';
9740                break;
9741
9742            case 'mp':
9743                str += '\
9744                <div class="table-wrap">\
9745                    <table>\
9746                        <colgroup>\
9747                            <col width="130px"></col>\
9748                            <col width="85px"></col>\
9749                            <col width="60px"></col>\
9750                            <col width="*"></col>\
9751                        </colgroup>\
9752                        <thead>\
9753                            <tr><td>' + $.lang[LANG]['domain.connect.record.title.name'] + '</td><td>' + $.lang[LANG]['domain.connect.record.title.type'] + '</td><td>' + $.lang[LANG]['domain.connect.record.title.priority'] + '</td><td>' + $.lang[LANG]['domain.connect.record.title.val'] + '</td></tr>\
9754                        </thead>\
9755                        <tbody>\
9756                            <tr><td>' + $.lang[LANG]['domain.connect.record.content.blank.2'] + '</td><td>MX</td><td>10</td><td>mx01.mailplug.com.</td></tr>\
9757                            <tr><td>' + $.lang[LANG]['domain.connect.record.content.blank.2'] + '</td><td>MX</td><td>20</td><td>mx02.mailplug.com.</td></tr>\
9758                            <tr><td>mail</td><td>CNAME</td><td></td><td>m79.mailplug.com</td></tr>\
9759                            <tr><td>' + $.lang[LANG]['domain.connect.record.content.blank.2'] + '</td><td>TXT(SPF)</td><td></td><td>v=spf1 mx include:mailplug.com ~all</td></tr>\
9760                        </tbody>\
9761                    </table>\
9762                </div>\
9763                </div>';
9764                break;
9765
9766            case 'etc':
9767                var suadmin = '<?=SU_EADMIN?>',
9768                    url = (suadmin) ? "https://creatorlink.net/help" : "";
9769
9770                str += '\
9771                <div class="etc-info">\
9772                    <p>' + $.lang[LANG]['domain.connect.mx.info.text.1'] + '<a href="' + url + '" target="_blank">' + $.lang[LANG]['domain.connect.mx.info.text.2'] + '</a>' + $.lang[LANG]['domain.connect.mx.info.text.3'] + '</p>\
9773                    <div class="info-text">\
9774                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 13" width="13" height="13"><path d="M6.5 0a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13zm0 12C3.47 12 1 9.53 1 6.5S3.47 1 6.5 1 12 3.47 12 6.5 9.53 12 6.5 12z"/><path d="M6 3h1v5H6zM6 9h1v1H6z"/></svg>' + $.lang[LANG]['domain.connect.mx.info.text.4'] + '\
9775                    </div>\
9776                </div>';
9777                break;
9778        }
9779
9780        return str;
9781    }
9782
9783    var setFixedMenuCss = function(checkEllist) {      
9784        // console.log('setFixedMenuCss :: 로고 / 확장기능 버튼 height,line-height 추가');
9785        var fh_selector = (checkEllist) ? '.elviewhtml header.navbar[data-fixtype]' : 'header.navbar[data-fixtype]',
9786            $fh = $(fh_selector);
9787
9788        if($fh.length == 0) return false;
9789        var fh_type = $fh.attr('data-fh-type'),
9790            fixtypeNum = $fh.attr('data-fixtype').replace(/(top|sidebar)\_/gi, ''),
9791            fixtypeArr = ['01', '02', '03', '08'];
9792        if($fh.find('#fixed-menu').find('.cl-visible').length == 0 && fh_type=='top') {
9793          if(PAGE_MODE == 'c') {
9794            $fh.find('.fh-container').addClass('hide');
9795          } else {
9796            $fh.find('.fh-container').remove();
9797          }
9798        }
9799
9800        var check_color_panel = ($('.elmenu-content').length > 0) ? 60 : 49,
9801            fixed_mn_width = $fh.find('.cl-fixed-menu').width() + check_color_panel,
9802            fixed_mn_height = $fh.find('#tpl-menu li').height(),
9803            navbarHeader_width = $fh.find('.navbar-header').width(),
9804            check_fixed_mn = ($fh.find('.cl-fixed-menu').length>0) ? true : false;
9805
9806        logo_mn_height = ($fh.find('.navbar-brand img').height() > $fh.find('#tpl-menu').height()) ? '' : fixed_mn_height;
9807
9808        if($fh.find('.cl-menu-option').length > 0) {
9809            if($fh.find('.cl-menu-option').is('[data-mwidth="all"]') && $fh.is('[data-fh-type="right"]')) {
9810                var fixed_m_w = $fh.find('.cl-fixed-menu').outerWidth(),
9811                    moption_row_padding = {};
9812
9813                if($fh.find('.cl-menu-option').is('.nfullDrop')) moption_row_padding = {};
9814                else if($fh.is('[data-fixtextalign="center"]')) moption_row_padding = {'padding-left':fixed_m_w+'px','padding-right':fixed_m_w+'px'};
9815                else if($fh.is('[data-fixtextalign="right"]')) moption_row_padding = {'padding-right':fixed_m_w+'px'};
9816
9817                if($.isEmptyObject(moption_row_padding)) {
9818                    document.querySelector(fh_selector+' .moption-row').style.removeProperty('padding-left');
9819                    document.querySelector(fh_selector+' .moption-row').style.removeProperty('padding-right');
9820                } else {
9821                    if($fh.is('[data-fixtextalign="center"]')) $fh.find('#tpl-menu').css('padding-left',fixed_m_w + 'px');
9822                    else document.querySelector(fh_selector+' #tpl-menu').style.removeProperty('padding-left');
9823                    $fh.find('.moption-row').css(moption_row_padding);
9824                }
9825            }
9826        } else {
9827            /* menu width ****************/
9828            $fh.find('#tpl-menu').css({
9829                'width': (fh_type == 'right') ? (($fh.find(' > .container[data-fh-align]').length > 0) ? '100%' : '') : (!check_fixed_mn && (fh_type=='top') ? '100%' : ''),
9830                'max-width': (fh_type == 'right') ? (($fh.find(' > .container[data-fh-align]').length > 0) ? 'calc(100% - ' + fixed_mn_width + 'px)' : '') : (!check_fixed_mn && (fh_type=='top') ? 'calc(100% - ' + navbarHeader_width + 'px)' : '')
9831            });
9832
9833            /* menu 확장기능 ul, li, a => 메뉴 행간별 line-height, height :: 확장기능 행간 조절 ****************/
9834            $fh.find('.cl-fixed-menu#fixed-menu').css('line-height', (fh_type == 'right') ? fixed_mn_height + 'px' : '');
9835            $fh.find('.cl-fixed-menu#fixed-menu li > a:not(.cl-langlist):not(.cl-umMenu):not(.cl-lang)').css('line-height', (fh_type == 'right') ? (fixed_mn_height - 1) + 'px' : '');
9836            $fh.find('.cl-fixed-menu#fixed-menu,.cl-fixed-menu#fixed-menu li > a:not(.cl-langlist):not(.cl-umMenu):not(.cl-lang)').css({
9837                'height': (fh_type == 'right') ? fixed_mn_height + 'px' : '',
9838            });
9839
9840            /* menu 확장기능 ul, li, a => 메뉴 행간별 line-height, height :: 확장기능 다국어 행간 조절  ****************/
9841            $fh.find('.cl-fixed-menu#fixed-menu .cl-visible.siteLANG, .cl-fixed-menu#fixed-menu .cl-visible.siteLANG .slang-active,\
9842                     .cl-fixed-menu#fixed-menu .cl-visible.siteLANG .cl-lang').css({
9843                'line-height': (fh_type == 'right') ? ($fh.find('.cl-fixed-menu li.cl-fixbtn').height() - 1) + 'px' : '',
9844                'height': (fh_type == 'right') ? $fh.find('.cl-fixed-menu li.cl-fixbtn').height() + 'px' : '',
9845            });
9846
9847            /* menu 로고 a => 메뉴 행간별 line-height, height ****************/
9848            if ($('body').width() > 768) {
9849                $fh.find('.navbar-brand').css({
9850                    'line-height': (fh_type == 'sidebar' || (fh_type != 'sidebar' && $fh.find(' > .container[data-fh-align]').length == 0)) ? '' : logo_mn_height + 'px',
9851                });
9852            } else {
9853                $fh.find('.navbar-brand').css('line-height', '');
9854            }
9855        }
9856
9857
9858        if (fh_type == 'sidebar' && window.innerWidth > 768) {
9859            var siteLANG_hght = Number($fh.find('.cl-visible.siteLANG').outerHeight());
9860            siteLANG_hght = (typeof MODE == 'undefined') ? siteLANG_hght : siteLANG_hght + 35;
9861
9862            $fh.find('.menu-inner').css('height', 'calc(100% - ' + siteLANG_hght + 'px)');
9863        }
9864
9865        if (checkEllist) {
9866            if (fh_type == 'right' && $fh.find('.mini-home').length > 0) {
9867                if ($('body').width() > 768) {
9868                    $fh.find('.mini-home').closest('.navbar-collapse').attr('style', 'display: inline-block !important');
9869                } else $fh.find('.mini-home').parent().removeAttr('style');
9870            }
9871        }
9872    }
9873
9874    $(document).on('mouseenter', '.el-menu [data-fixtype^="sidebar_"] .siteLANG.cl-fixbtn, .el-menu [data-fixtype^="sidebar_"] .siteUM.cl-fixbtn, #elmenu-display .siteLANG.cl-fixbtn', function() {
9875        var fixtypeNum = $('.el-menu header.navbar').attr('data-fixtype').replace(/(top|sidebar)\_/gi, ''),
9876            $dropdown = $(this).find('.dropdown-menu'),
9877            checkSiteLang = ($(this).hasClass('siteLANG')) ? 'siteLang' : 'um',
9878            $toggle = (checkSiteLang == 'siteLang') ? $(this).find('.cl-lang.dropdown-toggle') : $(this).find('.cl-logout.dropdown-toggle'),
9879            $dropdown_width = $dropdown.outerWidth(),
9880            $toggle_width = $toggle.outerWidth(),
9881            pos_left = $toggle.offset().left.toFixed(0),
9882            fixedMenu_pdlf = (checkSiteLang == 'um') ? Number($('.el-menu .cl-fixed-menu').css('padding-left').replace(/px/gi, '')) : '',
9883            fixedSiteLang_pdlf = (checkSiteLang == 'siteLang') ? Number($('.el-menu .siteLANG.cl-visible').css('padding-left').replace(/px/gi, '')) : 0,
9884            fixedMenu_textalign = ($('header.navbar[data-fixtype]').attr('data-fixtextalign')) ? $('header.navbar[data-fixtype]').attr('data-fixtextalign') : 'center',
9885            checkSidebar = ($('header.navbar[data-fixtype]').hasClass('sidebar')) ? true : false,
9886            fixtypeArr = ['01', '02', '03', '08'],
9887            check_scroll = (checkSidebar) ? $('header.navbar[data-fixtype] .menu-inner').hasVerticalScrollbar() : false;
9888
9889        pos_left = ($(this).parents('#elmenu-display').hasClass('elmenu-color-edit') && checkSiteLang == 'siteLang') ? $toggle.position().left.toFixed(0) : pos_left;
9890
9891        if (checkSiteLang == 'um') {
9892            if ($.inArray(fixtypeNum, fixtypeArr) > -1) {
9893                var left_val = 0;
9894                pos_left -= fixedMenu_pdlf;
9895                if (fixedMenu_textalign == 'center') {
9896                    var left_val = pos_left - $dropdown_width / 2 + $toggle_width / 2;
9897                    left_val = (check_scroll) ? left_val - 8 : left_val;
9898                    $dropdown.css('left', left_val);
9899                } else if (fixedMenu_textalign == 'left') {
9900                    $dropdown.css('left', 0);
9901                } else $dropdown.css({
9902                    'left': 'auto',
9903                    'right': 0
9904                });
9905            } else {
9906                $dropdown.css('left', -$dropdown_width / 2 + $toggle_width / 2);
9907            }
9908        } else {
9909            var cl_lang_top = Number($(this).find('.cl-lang').position().top.toFixed(0)),
9910                cl_lang_hght = Number($(this).find('.cl-lang').outerHeight());
9911
9912            if (checkSidebar) {
9913                if (fixedMenu_textalign == 'center') {
9914                    $dropdown.css('left', pos_left - $dropdown_width / 2 + $toggle_width / 2);
9915                } else if (fixedMenu_textalign == 'left') {
9916                    $dropdown.css('left', fixedSiteLang_pdlf);
9917                } else $dropdown.css({
9918                    'left': 'auto'
9919                });
9920            } else {
9921                if($('.el-menu header.navbar .cl-menu-option').length == 0)  $dropdown.css('left', pos_left - $dropdown_width / 2 + $toggle_width / 2);
9922            }
9923
9924            if (!$(this).parents('#elmenu-display').hasClass('elmenu-color-edit')) $dropdown.css('bottom', cl_lang_top + cl_lang_hght + 10);
9925        }
9926    });
9927
9928    $.fn.hasVerticalScrollbar = function() {
9929        // This will return true, when the div has vertical scrollbar
9930        if (typeof this.get(0) == 'undefined') return false;
9931        return this.get(0).scrollHeight > this.height();
9932    }
9933
9934    $.contentsSlider = {
9935        ready: function(el_seq) {
9936            return new Promise((resolve, reject) => {
9937                // console.log('contentsSlider ready');
9938                let $swiperEL = $('.element[data-id="' + el_seq + '"]');
9939                let column = ($swiperEL.find('[data-matrix-loop]').length > 0)? Number($swiperEL.find('[data-matrix-loop]').attr('data-matrix-column')) : $swiperEL.find('.item').length;
9940                let eltype = (typeof $swiperEL.attr('data-type') != 'undefined')? $swiperEL.attr('data-type') : '';               
9941
9942                $swiperEL.find('.item').parent().parent().addClass('swiper');
9943                $swiperEL.find('.item').parent().addClass('swiper-wrapper');
9944                $swiperEL.find('.item').addClass('swiper-slide');
9945
9946                let swiperContainer = '.element[data-id="' + el_seq + '"] .swiper';
9947                let container = document.querySelector(swiperContainer);
9948                let wrapper = document.querySelector('.element[data-id="' + el_seq +'"] .swiper-wrapper');
9949                let slides = container.querySelectorAll('.swiper-slide');
9950                let containerWidth = $(swiperContainer).outerWidth();
9951                let slideCnt = slides.length;
9952
9953                if($swiperEL.find('.full-width').length == 0 && containerWidth > 1170) containerWidth = 1170;
9954                let slideWidth = containerWidth / column;
9955                // console.log($swiperEL.attr('data-case'), 'width', containerWidth, $(swiperContainer).width() / column, slideWidth);
9956                if(eltype == 'contents') {
9957                    slides.forEach(function (slide) {
9958                         slide.style.width = `${slideWidth}px`;
9959                    });
9960                }
9961                // if(slideCnt < column + 1 || slideCnt % column > 0) {
9962                //     let totalSlideCnt = slideCnt;
9963                //     let totalPages = Math.ceil(slideCnt / column);
9964                //     if(totalPages == 1) totalPages = 2;
9965                //     let leastSlideCnt = lcm(slideCnt, column);
9966                //     if(leastSlideCnt <= column) leastSlideCnt = leastSlideCnt * 2;
9967                //     // console.log('totalSlideCnt', totalSlideCnt);
9968                //     // console.log('lcm', lcm(slideCnt, column));
9969                //     while (totalSlideCnt < slideCnt * totalPages) {
9970                //         Array.from(slides).forEach((slide, index) => {
9971                //             const clone = slide.cloneNode(true); // 슬라이드 복제
9972                //             clone.classList.add('plus-slide');   // 복제된 슬라이드에 'plus-slide' 클래스 추가
9973                //             clone.setAttribute('data-original-slide-index', index);
9974                //             wrapper.appendChild(clone);       // 컨테이너에 추가
9975                //             totalSlideCnt++;                 // 총 슬라이드 수 증가
9976                //         });
9977                //     }
9978                // } 
9979
9980                // function gcd(a, b) {
9981                //     return b === 0 ? a : gcd(b, a % b);
9982                // }
9983
9984                // function lcm(a, b) {
9985                //     return (a * b) / gcd(a, b);
9986                // }
9987               
9988                resolve(true);
9989            });
9990        },
9991        init: function(el_seq, elsettings, mode) {
9992            if(typeof mode == 'undefined' || !mode) mode = 'r';
9993            
9994            let $swiperEL = $('.element[data-id="' + el_seq + '"]');
9995            // console.log('contents slider init');
9996            // if($swiperEL.find('.item.modify').length > 0) return false;
9997
9998            let blockorg = elsettings.blockorg;
9999            let column = ($swiperEL.find('[data-matrix-loop]').length > 0)? Number($swiperEL.find('[data-matrix-loop]').attr('data-matrix-column')) : $swiperEL.find('.item').length;
10000            let slideCount = $swiperEL.find('.item').length;
10001            let windowWidth = $(window).width();
10002
10003            let elname = $('.element[data-id="' + el_seq + '"]').attr('data-name');
10004            let eltype = $('.element[data-id="' + el_seq + '"]').attr('data-type');               
10005            
10006            if(eltype == 'video') {
10007                column = (typeof $swiperEL.find('.lyoption').attr('data-lycol') != 'undefined' && $swiperEL.find('.lyoption').attr('data-lycol'))? Number($swiperEL.find('.lyoption').attr('data-lycol')) : $swiperEL.find('.item').length;
10008            }
10009
10010            if(typeof blockorg != 'undefined') $swiperEL.attr('data-case', blockorg);
10011
10012            if(mode == 'c') {
10013                $swiperEL.addClass('slider-active');
10014            }
10015
10016            let tabletCol = 4;
10017            let mobileCol = 2;
10018
10019            if(windowWidth < 992) {
10020                if($swiperEL.find('.item').hasClass('col-sm-4')) tabletCol = 3;
10021                if($swiperEL.find('.item').hasClass('col-sm-6')) tabletCol = 2;
10022                if(typeof blockorg != 'undefined') {
10023                    // if(blockorg == 'contents77') tabletCol = 2;
10024                    // if(blockorg == 'contents78') tabletCol = 2;
10025                    // if(blockorg == 'contents79') tabletCol = 2;
10026                    if(blockorg == 'contents134') tabletCol = 2;
10027                    if(blockorg == 'contents137') tabletCol = 2;
10028                    if(blockorg == 'contents138') tabletCol = 1;
10029                }
10030                if(slideCount < tabletCol) tabletCol = 1;
10031                column = tabletCol;
10032            }
10033            if(windowWidth < 768) {
10034                if($swiperEL.find('.item').hasClass('col-xs-6')) mobileCol = 2;
10035                if($swiperEL.find('.item').hasClass('col-xs-12')) mobileCol = 1;
10036                if(typeof blockorg != 'undefined') {
10037                    if(blockorg == 'contents77') mobileCol = 1;
10038                    if(blockorg == 'contents78') mobileCol = 1;
10039                    if(blockorg == 'contents79') mobileCol = 1;
10040                    if(blockorg == 'contents134') mobileCol = 1;
10041                    if(blockorg == 'contents137') mobileCol = 1;
10042                    if(blockorg == 'contents138') mobileCol = 1;
10043                }
10044                if(slideCount < mobileCol) mobileCol = 1;
10045                column = mobileCol;
10046            }
10047            
10048            if($swiperEL.find('.lyoption').length > 0) {
10049                if(windowWidth <= 991) {
10050                    tabletCol = (typeof $swiperEL.find('.lyoption').attr('data-lycol-t') != 'undefined' && $swiperEL.find('.lyoption').attr('data-lycol-t'))? Number($swiperEL.find('.lyoption').attr('data-lycol-t')) : 2;
10051                    column = Number(tabletCol);
10052                }
10053                if(windowWidth <= 768) {
10054                    mobileCol = (typeof $swiperEL.find('.lyoption').attr('data-lycol-m') != 'undefined' && $swiperEL.find('.lyoption').attr('data-lycol-m'))? Number($swiperEL.find('.lyoption').attr('data-lycol-m')) : 2;
10055                    column = Number(mobileCol);
10056                }
10057            }
10058
10059            let swiperContainer = '.element[data-id="' + el_seq + '"] .swiper';
10060    
10061            let slider_nav_style = (typeof elsettings.slider_nav_style != 'undefined' && elsettings.slider_nav_style)? elsettings.slider_nav_style : 1;
10062            let slider_page_style = (typeof elsettings.slider_page_style != 'undefined' && elsettings.slider_page_style)? elsettings.slider_page_style : 1;
10063            let slider_delay = (typeof elsettings.slider_delay != 'undefined' && elsettings.slider_delay)? Number(elsettings.slider_delay) : 1000;
10064            let slider_speed = (typeof elsettings.slider_speed != 'undefined' && elsettings.slider_speed)? Number(elsettings.slider_speed) : 1000;
10065            let slider_nav_size = getComputedStyle(document.querySelector('.' + elname)).getPropertyValue('--slider-nav-size');
10066            let slider_page_size = getComputedStyle(document.querySelector('.' + elname)).getPropertyValue('--slider-page-size');
10067	            let slider_nav_display = (typeof elsettings.slider_nav_display != 'undefined' && elsettings.slider_nav_display)? elsettings.slider_nav_display : ['arrow', 'pagination'];
10068	            let slider_motion = (typeof elsettings.slider_motion != 'undefined' && elsettings.slider_motion)? elsettings.slider_motion : 'space';
10069	            let isSlowSlider = (slider_motion == 'slow');
10070	            let loopAdditionalSlides = (isSlowSlider)? Math.max(slideCount, column * 2) : column;
10071
10072            let useNavigation = (slider_nav_display.indexOf('arrow') > -1)? true : false;
10073            let usePagination = (slider_nav_display.indexOf('pagination') > -1)? true : false;
10074            let paginationType;
10075
10076            let autoplayEnabled = true;
10077
10078            switch (slider_motion) {
10079                case 'slow':
10080                    useNavigation = false;
10081                    usePagination = false;
10082                    break;
10083                case 'space':
10084                    usePagination = false;
10085                    if (slideCount <= column) {
10086                        useNavigation = false;
10087                        autoplayEnabled = false;
10088                    }
10089                    break;
10090                case 'page':
10091                    if (slideCount <= column) {
10092                        useNavigation = false;
10093                        usePagination = false;
10094                        autoplayEnabled = false;
10095                    }
10096                    break;                    
10097                case 'stop':
10098                    if (slideCount <= column) {
10099                        useNavigation = false;
10100                        usePagination = false;
10101                    }
10102                    autoplayEnabled = false;
10103                    break;
10104            }
10105
10106            if(mode == 'c') autoplayEnabled = false;
10107            
10108            if(typeof slider_nav_size == 'undefined' || !slider_nav_size) slider_nav_size = 52;
10109            slider_nav_size = parseInt(slider_nav_size);
10110
10111            if(usePagination) {
10112              switch (true) {
10113                  case [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, 15, 16, 17, 18].includes(parseInt(slider_page_style)):
10114                      paginationType = 'bullets';
10115                      break;
10116                  case [11, 12, 13].includes(parseInt(slider_page_style)):
10117                      paginationType = 'fraction';
10118                      break;
10119                  case [0].includes(parseInt(slider_page_style)):
10120                      paginationType = 'custom';
10121                      break;
10122                  default:
10123                      paginationType = 'bullets';
10124                      break;
10125              }
10126              if (!slider_page_size) {
10127                  const sizeMap = {
10128                      '28px': [9, 11, 13, 14],
10129                      '40px': [],
10130                      '52px': [1, 2, 3, 8, 17],
10131                      '64px': [12, 15, 16],
10132                      '76px': [5, 7, 6, 10]
10133                  };
10134
10135                  slider_page_size = Object.keys(sizeMap).find(key => sizeMap[key].includes(parseInt(slider_page_style))) || '52px';
10136              }
10137            }
10138
10139            if($swiperEL.find('.slider-nav-btn').length == 0) {
10140                let sliderNav = (useNavigation)? contentsSliderNav(slider_nav_size, slider_nav_style) : '';
10141                let sliderPagination = (usePagination)? '<div class="slider-pagination-' + el_seq + '" data-style="'+slider_page_style+'" data-size="'+slider_page_size+'"></div>' : '';
10142                if(useNavigation) $(swiperContainer).after(sliderNav);
10143                if(usePagination && $swiperEL.find('.slider-pagination-' + el_seq + '').length == 0) $(swiperContainer).after(sliderPagination);
10144            }
10145            
10146            $swiperEL.attr('data-slider-motion', slider_motion);
10147            $swiperEL.attr('data-slider-navsize', slider_nav_size);
10148
10149		            document.querySelector(swiperContainer).addEventListener('focus', function(e) {
10150		                e.preventDefault();
10151		                e.stopImmediatePropagation(); // Swiper 내부 이벤트로 전달되지 않게 막음
10152		                return false;
10153		            }, true);
10154
10155		            function getSlowSliderOriginalSlides() {
10156		                return $swiperEL.find('.swiper-wrapper > .item').not('.cl-slow-slide-clone').toArray();
10157		            }
10158
10159		            function getSlowSliderImages() {
10160		                return $(getSlowSliderOriginalSlides()).find('img').toArray();
10161		            }
10162
10163		            function getSlowSliderContentHeight(container) {
10164		                if(!container) return 0;
10165
10166		                let wrapper = container.querySelector('.swiper-wrapper');
10167		                if(wrapper) {
10168		                    let wrapperHeight = wrapper.getBoundingClientRect().height || 0;
10169		                    if(wrapperHeight > 0) return wrapperHeight;
10170		                }
10171
10172		                let maxHeight = 0;
10173		                getSlowSliderOriginalSlides().forEach(function(slide) {
10174		                    maxHeight = Math.max(maxHeight, slide.getBoundingClientRect().height || 0);
10175		                });
10176
10177		                return maxHeight;
10178		            }
10179
10180		            function getSlowSliderReserveHeight(container) {
10181		                if(!container) return 0;
10182
10183			                let reserveHeight = getSlowSliderContentHeight(container);
10184			                let originalSlides = getSlowSliderOriginalSlides();
10185			                let firstSlide = originalSlides.length > 0 ? originalSlides[0] : null;
10186			                let firstImg = firstSlide ? firstSlide.querySelector('img') : null;
10187
10188			                if(firstSlide && firstImg) {
10189			                    let orgw = parseFloat(firstImg.getAttribute('data-orgw')) || firstImg.naturalWidth || 0;
10190			                    let orgh = parseFloat(firstImg.getAttribute('data-orgh')) || firstImg.naturalHeight || 0;
10191			                    let slideStyle = window.getComputedStyle(firstSlide);
10192			                    let slideWidth = firstSlide.getBoundingClientRect().width || 0;
10193			                    let slidePaddingX = (parseFloat(slideStyle.paddingLeft) || 0) + (parseFloat(slideStyle.paddingRight) || 0);
10194			                    let slidePaddingY = (parseFloat(slideStyle.paddingTop) || 0) + (parseFloat(slideStyle.paddingBottom) || 0);
10195			                    let imageWidth = firstImg.getBoundingClientRect().width || 0;
10196
10197			                    if(!slideWidth) {
10198			                        let containerWidth = container.getBoundingClientRect().width || $(swiperContainer).outerWidth() || 0;
10199			                        slideWidth = containerWidth / Math.max(column, 1);
10200			                    }
10201
10202			                    if(!imageWidth && slideWidth > 0) {
10203			                        imageWidth = Math.max(slideWidth - slidePaddingX, 0);
10204			                        if(orgw > 0) imageWidth = Math.min(imageWidth, orgw);
10205			                    }
10206
10207			                    if(orgw > 0 && orgh > 0 && imageWidth > 0) {
10208			                        reserveHeight = Math.max(reserveHeight, (imageWidth * (orgh / orgw)) + slidePaddingY);
10209			                    }
10210			                }
10211
10212		                return reserveHeight;
10213		            }
10214
10215		            function setSlowSliderPreparing(on) {
10216		                let container = document.querySelector(swiperContainer);
10217		                if(!container) return;
10218
10219			                if(on) {
10220			                    let reserveHeight = getSlowSliderReserveHeight(container);
10221			                    if(!container.hasAttribute('data-cl-slow-original-min-height')) {
10222			                        container.setAttribute('data-cl-slow-original-min-height', container.style.minHeight || '');
10223			                    }
10224			                    if(reserveHeight > 0) {
10225			                        container.style.minHeight = reserveHeight + 'px';
10226			                    }
10227			                    container.style.visibility = 'hidden';
10228			                    container.style.overflowAnchor = 'none';
10229			                    container.setAttribute('data-cl-slow-preparing', 'true');
10230			                    return;
10231			                }
10232
10233			                let stableHeight = getSlowSliderContentHeight(container);
10234			                if(stableHeight > 0) {
10235			                    container.style.minHeight = stableHeight + 'px';
10236			                }
10237			                container.style.visibility = '';
10238			                container.style.overflowAnchor = 'none';
10239			                container.removeAttribute('data-cl-slow-preparing');
10240			                container.setAttribute('data-cl-slow-stable-height', 'true');
10241			            }
10242
10243			            function refreshSlowSliderReserveHeight(actualOnly) {
10244			                let container = document.querySelector(swiperContainer);
10245			                if(!container || !container.hasAttribute('data-cl-slow-preparing')) return;
10246
10247				                let reserveHeight = actualOnly ? getSlowSliderContentHeight(container) : getSlowSliderReserveHeight(container);
10248			                if(reserveHeight > 0) {
10249			                    container.style.minHeight = reserveHeight + 'px';
10250			                }
10251			            }
10252
10253		            function waitSlowSliderImages() {
10254		                let images = getSlowSliderImages();
10255		                if(images.length == 0) return Promise.resolve();
10256
10257		                return new Promise(function(resolve) {
10258		                    let done = false;
10259		                    let remain = images.length;
10260		                    let timer = window.setTimeout(finish, 2500);
10261
10262		                    function finish() {
10263		                        if(done) return;
10264		                        done = true;
10265		                        window.clearTimeout(timer);
10266		                        resolve();
10267		                    }
10268
10269		                    function markImageReady(img) {
10270		                        function mark() {
10271		                            remain--;
10272		                            if(remain <= 0) finish();
10273		                        }
10274
10275		                        if(img && img.complete && img.naturalWidth > 0 && typeof img.decode == 'function') {
10276		                            img.decode().then(mark).catch(mark);
10277		                            return;
10278		                        }
10279
10280		                        mark();
10281		                    }
10282
10283		                    images.forEach(function(img) {
10284		                        if(img.complete) {
10285		                            markImageReady(img);
10286		                            return;
10287		                        }
10288
10289		                        img.addEventListener('load', function() {
10290		                            markImageReady(img);
10291		                        }, {once: true});
10292		                        img.addEventListener('error', function() {
10293		                            markImageReady(img);
10294		                        }, {once: true});
10295		                    });
10296		                });
10297		            }
10298
10299			            function prepareSlowSliderSlides() {
10300			                let wrapper = document.querySelector(swiperContainer + ' .swiper-wrapper');
10301			                if(!wrapper) return;
10302
10303			                $swiperEL.find('.cl-slow-slide-clone').remove();
10304			                wrapper.removeAttribute('data-cl-slow-clone-sets');
10305
10306			                let originalSlides = getSlowSliderOriginalSlides();
10307			                if(originalSlides.length <= column) return;
10308
10309		                let wrapperWidth = wrapper.getBoundingClientRect().width || wrapper.scrollWidth;
10310		                let originalWidth = originalSlides.reduce(function(total, slide) {
10311		                    return total + slide.getBoundingClientRect().width;
10312		                }, 0);
10313		                let cloneSets = Math.ceil(wrapperWidth / Math.max(originalWidth, 1)) + 4;
10314		                cloneSets = Math.max(3, Math.min(cloneSets, 8));
10315		                wrapper.setAttribute('data-cl-slow-clone-sets', cloneSets);
10316
10317		                for(let i = 0; i < cloneSets; i++) {
10318		                    originalSlides.forEach(function(slide) {
10319		                        let clone = slide.cloneNode(true);
10320		                        clone.classList.add('cl-slow-slide-clone');
10321		                        clone.classList.remove('swiper-slide-active', 'swiper-slide-next', 'swiper-slide-prev', 'swiper-slide-duplicate-active', 'swiper-slide-duplicate-next', 'swiper-slide-duplicate-prev');
10322		                        clone.setAttribute('aria-hidden', 'true');
10323		                        wrapper.appendChild(clone);
10324		                    });
10325		                }
10326		            }
10327
10328	            function startSlowSliderMotion(swiper) {
10329	                if(!isSlowSlider || !swiper || !swiper.el) return;
10330
10331	                let wrapper = swiper.wrapperEl || swiper.el.querySelector('.swiper-wrapper');
10332	                if(!wrapper) return;
10333
10334	                if(swiper.el._clSlowFrame) {
10335	                    cancelAnimationFrame(swiper.el._clSlowFrame);
10336	                    swiper.el._clSlowFrame = null;
10337	                }
10338
10339		                let originalSlides = getSlowSliderOriginalSlides();
10340	                if(originalSlides.length <= column) return;
10341
10342		                let firstSlide = originalSlides[0];
10343		                let lastSlide = originalSlides[originalSlides.length - 1];
10344		                let firstRect = firstSlide.getBoundingClientRect();
10345		                let lastRect = lastSlide.getBoundingClientRect();
10346		                let loopDistance = (lastRect.left - firstRect.left) + lastRect.width;
10347		                if(!loopDistance) return;
10348
10349		                let cloneSets = parseInt(wrapper.getAttribute('data-cl-slow-clone-sets'), 10) || 1;
10350		                let resetStart = loopDistance;
10351		                let resetEnd = loopDistance * Math.max(2, cloneSets);
10352		                let resetSpan = Math.max(loopDistance, resetEnd - resetStart);
10353		                let avgSlideWidth = loopDistance / originalSlides.length;
10354		                let pixelsPerMs = avgSlideWidth / Math.max(slider_speed, 1);
10355		                let offset = Math.abs(swiper.translate || 0);
10356		                if(offset >= resetEnd) {
10357		                    offset = resetStart + ((offset - resetStart) % resetSpan);
10358		                }
10359		                let lastTime = 0;
10360
10361	                wrapper.style.transitionDuration = '0ms';
10362	                swiper.el._clSlowPaused = false;
10363
10364	                swiper.autoplay = swiper.autoplay || {};
10365	                swiper.autoplay.stop = function() {
10366	                    swiper.el._clSlowPaused = true;
10367	                    return true;
10368	                };
10369	                swiper.autoplay.start = function() {
10370	                    lastTime = 0;
10371	                    swiper.el._clSlowPaused = false;
10372	                    return true;
10373	                };
10374
10375	                function move(time) {
10376	                    if(!swiper || swiper.destroyed || !document.body.contains(swiper.el)) return;
10377	                    if(!lastTime) lastTime = time;
10378
10379	                    let elapsed = time - lastTime;
10380	                    lastTime = time;
10381
10382		                    if(!swiper.el._clSlowPaused) {
10383		                        offset = offset + (elapsed * pixelsPerMs);
10384		                        if(offset >= resetEnd) {
10385		                            offset = resetStart + ((offset - resetStart) % resetSpan);
10386		                        }
10387		                        wrapper.style.transitionDuration = '0ms';
10388		                        wrapper.style.transform = 'translate3d(' + (-offset) + 'px, 0, 0)';
10389		                        swiper.translate = -offset;
10390		                    }
10391
10392	                    swiper.el._clSlowFrame = requestAnimationFrame(move);
10393	                }
10394
10395	                swiper.el._clSlowFrame = requestAnimationFrame(move);
10396	            }
10397
10398		            requestAnimationFrame(function(){
10399		                function initSwiper() {
10400		                    if(document.querySelector(swiperContainer) && !document.querySelector(swiperContainer).swiper) {
10401		                        if(isSlowSlider) {
10402		                            refreshSlowSliderReserveHeight(true);
10403		                            prepareSlowSliderSlides();
10404		                        }
10405		                        let swiper = new Swiper(swiperContainer, {
10406	                        slidesPerView: 'auto',
10407	                        spaceBetween: 0,
10408	                        slidesPerGroup: ($.inArray(slider_motion, ['page', 'stop']) > -1)? column : 1,
10409	                        slidesPerGroupAuto: ($.inArray(slider_motion, ['page', 'stop']) > -1)? true : false,
10410	                        allowTouchMove: (slider_motion == 'slow' || slideCount <= column)? false : true,
10411	                        simulateTouch: (slider_motion == 'slow' || slideCount <= column)? false : true,
10412	                        loop: (isSlowSlider)? false : true,
10413	                        loopFillGroupWithBlank: (isSlowSlider)? false : true,
10414	                        loopAdditionalSlides: loopAdditionalSlides,
10415                        navigation: (useNavigation)? {
10416                            nextEl: '.element[data-id="' + el_seq + '"] .slider-nav-btn.next',
10417                            prevEl: '.element[data-id="' + el_seq + '"] .slider-nav-btn.prev',
10418                        } : '',
10419                        pagination: (usePagination)? {
10420                            el: '.slider-pagination-' + el_seq,
10421                            clickable: true,
10422                            type: paginationType,
10423                            dynamicBullets: [2, 4].includes(parseInt(slider_page_style)),
10424                            renderFraction: function (currentClass, totalClass) {
10425                              const styleIdx = parseInt(slider_page_style);
10426                              if (styleIdx === 12) {
10427                                const arrowSvg = '<svg viewBox="0 0 20 20" width="20" height="20"><path d="M13.76 18a.47.47 0 0 1-.33-.14L5.9 10.33a.483.483 0 0 1 0-.67l7.53-7.53c.18-.18.48-.18.67 0s.18.48 0 .67L6.9 10l7.2 7.2c.18.18.18.48 0 .67-.09.08-.21.13-.34.13z" /></svg>';
10428
10429                                return '<div class="fraction-capsule">' +
10430                                       '  <div class="fraction-numbers">' +
10431                                       '    <span class="' + currentClass + '"></span>' +
10432                                       '    <span class="separator">/</span>' +
10433                                       '    <span class="' + totalClass + '"></span>' +
10434                                       '  </div>' +
10435                                       '  <div class="fraction-nav">' +
10436                                       '    <div class="custom-nav-btn prev">' + arrowSvg + '</div>' + // 기존 클래스와 구분하기 위해 custom-nav-btn 사용
10437                                       '    <div class="nav-divider"></div>' +
10438                                       '    <div class="custom-nav-btn next">' + arrowSvg + '</div>' +
10439                                       '  </div>' +
10440                                       '</div>';
10441                              }
10442
10443                              return '<div class="fraction-capsule">' +
10444                                     '<span class="' + currentClass + '"></span>' +
10445                                     '<span class="separator">/</span>' +
10446                                     '<span class="' + totalClass + '"></span>' +
10447                                     '</div>';
10448                            },
10449                            renderBullet: function (index, className) {
10450                              const styleIdx = parseInt(slider_page_style);
10451                              let displayNum;
10452
10453                              // 1. 미끄러지는 바(indicator)를 사용하는 스타일들 (10, 18 등)
10454                              if ([10].includes(styleIdx)) {
10455                                  // 첫 번째 불렛 생성 시에만 indicator 추가
10456                                  if (index === 0) {
10457                                      setTimeout(() => {
10458                                          const paginationEl = document.querySelector('.slider-pagination-' + el_seq);
10459                                          if (paginationEl && !paginationEl.querySelector('.nav-indicator')) {
10460                                              const indicator = document.createElement('div');
10461                                              indicator.className = 'nav-indicator';
10462                                              paginationEl.appendChild(indicator);
10463                                              
10464                                              // moveIndicator 또는 $.contentsSlider.moveNavIndicator 호출
10465                                              if (typeof $.contentsSlider !== 'undefined') {
10466                                                  $.contentsSlider.moveNavIndicator(this, el_seq);
10467                                              } else if (typeof moveIndicator === 'function') {
10468                                                  moveIndicator(this);
10469                                              }
10470                                          }
10471                                      }, 0);
10472                                  }
10473                              }
10474
10475                              // 2. 숫자를 표시해야 하는 스타일들 (9, 10, 14)
10476                              if ([9, 10, 14].includes(styleIdx)) {
10477                                  if (styleIdx === 14) {
10478                                      displayNum = index + 1;
10479                                  } else {
10480                                      displayNum = (index + 1).toString().padStart(2, '0');
10481                                  }
10482                                  return '<span class="' + className + '">' + displayNum + '</span>';
10483                              } 
10484                              
10485                              // 3. 그 외 기본 불렛 (18번 포함)
10486                              return '<span class="' + className + '"></span>';
10487                            } 
10488                        } : false,
10489		                        autoplay: {
10490		                            enabled: (isSlowSlider)? false : autoplayEnabled,
10491		                            delay: (isSlowSlider)? 1 : slider_delay,
10492		                            disableOnInteraction: false,
10493		                            pauseOnMouseEnter: false,
10494	                        },
10495                        speed: slider_speed,
10496	                        observer: (isSlowSlider)? false : true,
10497	                        observeParents: (isSlowSlider)? false : true,
10498                        preventClicks: true,
10499                        preventClicksPropagation: true,
10500                        slideToClickedSlide: false,
10501                        // observeSlideChildren: true,
10502                        centeredSlides: false,
10503                        initialSlide: 0,
10504	                        freeMode: false,
10505	                        freeModeMomentum: false,
10506	                        on: {
10507                            init: function() {
10508                                const $paginationEl = $('.slider-pagination-' + el_seq);
10509                                if($swiperEL.find('.container').hasClass('full-width')) $paginationEl.addClass('full-width');
10510                                if (this.params.pagination.dynamicBullets) {
10511                                  $paginationEl.css('opacity','0');
10512                                }
10513                                if (this.params.pagination.type === 'bullets' && (parseInt(slider_page_style) !== 18)) {
10514                                    if (!$paginationEl.find('.swiper-pagination-width').length) {
10515                                        $paginationEl.append('<div class="swiper-pagination-width"></div>');
10516                                    }
10517                                    const $widthWrapper = $paginationEl.find('.swiper-pagination-width');
10518                                    
10519                                    $paginationEl.find('> .swiper-pagination-bullet').appendTo($widthWrapper);
10520                                }
10521
10522                                if (parseInt(slider_page_style) === 12) {
10523                                    const sw = this;
10524
10525                                    $paginationEl.off('click', '.custom-nav-btn').on('click', '.custom-nav-btn.prev', function(e) {
10526                                        e.preventDefault();
10527                                        sw.slidePrev();
10528                                    }).on('click', '.custom-nav-btn.next', function(e) {
10529                                        e.preventDefault();
10530                                        sw.slideNext();
10531                                    });
10532                                }
10533
10534                                // 스타일 18일 때 인디케이터 바 생성
10535                                if (parseInt(slider_page_style) === 18) {
10536                                    if ($paginationEl.length && !$paginationEl.find('.nav-indicator').length) {
10537                                      if(parseInt(slider_page_style) === 10) {
10538                                        //$paginationEl.find('.swiper-pagination-width').append('<div class="nav-indicator"></div>');
10539                                      } else {
10540                                        $paginationEl.append('<div class="nav-indicator"></div>');
10541                                      }
10542                                        
10543                                      setTimeout(() => {
10544                                          $.contentsSlider.moveNavIndicator(this, el_seq);
10545                                      }, 50);
10546                                    }
10547                                }
10548
10549		                                if(!isSlowSlider) this.loopFix();
10550		                                if(isSlowSlider) {
10551		                                    this.update();
10552		                                    refreshSlowSliderReserveHeight(true);
10553		                                    startSlowSliderMotion(this);
10554		                                    requestAnimationFrame(function() {
10555		                                        requestAnimationFrame(function() {
10556		                                            setSlowSliderPreparing(false);
10557		                                        });
10558		                                    });
10559		                                }
10560
10561	                                $.contentsSlider.setSliderNavPosition(el_seq);
10562                                // if(slider_motion == 'stop') $.contentsSlider.updateNavigationState(this);
10563                                if(PAGE_MODE == 'c') {
10564                                    let sw = this;
10565                                    setTimeout(function(){
10566                                        if(typeof sw.el != 'undefined' && sw.el) {
10567                                            if(!sw.el.querySelector('.item.modify')) {
10568                                                sw.update();
10569                                            }
10570                                            if (autoplayEnabled == false) {
10571                                                sw.autoplay.stop();
10572                                                sw.params.autoplay.enabled = false;
10573                                            }
10574                                        }
10575                                    }, 100);
10576                                }
10577                                if(windowWidth < 768) {
10578                                    let bulletCount = this.pagination.bullets.length;
10579                                    if (bulletCount > 10) {
10580                                        document.querySelector(".slider-pagination-" + el_seq).style.display = "none";
10581                                    }
10582                                }
10583                            },
10584		                            resize: function() {
10585		                                $.contentsSlider.setSliderNavPosition(el_seq);
10586		                                if(isSlowSlider) {
10587		                                    prepareSlowSliderSlides();
10588		                                    startSlowSliderMotion(this);
10589		                                }
10590
10591		                                if (parseInt(slider_page_style) === 18) {
10592                                    $.contentsSlider.moveNavIndicator(this, el_seq);
10593                                }
10594                            },
10595                            setTranslate: function() {
10596                              if (this.params.pagination.dynamicBullets) {
10597                                  const sw = this;
10598                                  const $paginationEl = $(sw.pagination.el);
10599                                  const $widthWrapper = $paginationEl.find('.swiper-pagination-width');
10600
10601                                  requestAnimationFrame(() => {
10602                                      const dynamicWidth = sw.pagination.el.style.width;
10603                                      if (dynamicWidth) {
10604                                          $widthWrapper.css('width', dynamicWidth);
10605                                          $paginationEl.removeAttr('style');
10606                                      }
10607                                  });
10608                              }
10609                            },
10610                            slideChangeTransitionStart: function () {
10611                                // console.log('slideChangeTransitionStart', this.el.querySelector('.item.modify'), this.previousIndex);
10612                                if (this.el.querySelector('.item.modify')) {
10613                                    this.slideTo(this.previousIndex, 0, false);
10614                                }
10615                                // 스타일 18일 때 바 이동 실행
10616                                if (parseInt(slider_page_style) === 18) {
10617                                    $.contentsSlider.moveNavIndicator(this, el_seq);
10618                                }
10619                            },
10620                        },
10621                    });
10622
10623                    let lsw = document.querySelector('.element[data-id="' + el_seq + '"] .swiper');
10624                    if(lsw && lsw.swiper) {
10625                        switch (eltype) {
10626                            case 'video':
10627                                $('#gframe-' + el_seq).on('opened', function(event, slide){
10628                                    if(slider_motion != 'stop') lsw.swiper.autoplay.stop();
10629                                }).on('closed', function (event){
10630                                    if(slider_motion != 'stop') lsw.swiper.autoplay.start();
10631                                });
10632                                break;
10633                            case 'sns':
10634                                $(lsw).on({
10635                                    mouseenter: function(e){
10636                                        if(lsw.swiper && slider_motion != 'stop' && $('#el-blockConfig.open').length == 0) lsw.swiper.autoplay.stop();
10637                                    },
10638                                    mousemove: function(e){
10639                                        if(lsw.swiper && slider_motion != 'stop' && $('#el-blockConfig.open').length == 0) lsw.swiper.autoplay.stop();
10640                                    },
10641                                    mouseout: function(e){
10642                                        if(lsw.swiper && slider_motion != 'stop' && $('#el-blockConfig.open').length == 0) lsw.swiper.autoplay.start();
10643                                    },
10644                                });
10645                                
10646                                break;
10647                        }
10648                    }
10649		                    } else {
10650		                        console.log('slide not loaded');
10651		                    }
10652		                }
10653
10654		                if(isSlowSlider) {
10655		                    setSlowSliderPreparing(true);
10656		                    waitSlowSliderImages().then(function() {
10657		                        refreshSlowSliderReserveHeight(true);
10658		                        initSwiper();
10659		                    });
10660		                    return;
10661		                }
10662
10663		                initSwiper();
10664		            });
10665        },
10666	        destroy: function(el_seq) {
10667	            let swiperContainer = '.element[data-id="' + el_seq + '"] .swiper';
10668	            // console.log('swiperContainer', swiperContainer, document.querySelector(swiperContainer).swiper);
10669	            if (swiperContainer && document.querySelector(swiperContainer) && document.querySelector(swiperContainer).swiper) {
10670	                let swiperEl = document.querySelector(swiperContainer);
10671		                if(swiperEl._clSlowFrame) {
10672		                    cancelAnimationFrame(swiperEl._clSlowFrame);
10673		                    swiperEl._clSlowFrame = null;
10674		                }
10675		                swiperEl.swiper.destroy(true, true);
10676		                let originalMinHeight = swiperEl.getAttribute('data-cl-slow-original-min-height');
10677		                if(originalMinHeight !== null) {
10678		                    if(originalMinHeight) {
10679		                        swiperEl.style.minHeight = originalMinHeight;
10680		                    } else {
10681		                        swiperEl.style.removeProperty('min-height');
10682		                    }
10683		                    swiperEl.removeAttribute('data-cl-slow-original-min-height');
10684		                }
10685		                swiperEl.style.visibility = '';
10686		                swiperEl.style.overflowAnchor = '';
10687		                swiperEl.removeAttribute('data-cl-slow-preparing');
10688		                swiperEl.removeAttribute('data-cl-slow-stable-height');
10689
10690		                let $swiperEL = $('.element[data-id="' + el_seq + '"]');
10691	                let $item = $swiperEL.find('.item');
10692
10693	                $swiperEL.find('.plus-slide').remove();
10694	                $swiperEL.find('.cl-slow-slide-clone').remove();
10695	                $swiperEL.find('.slider-pagination-' + el_seq).remove();
10696                $swiperEL.find('.slider-nav-btn').remove();
10697                $swiperEL.removeClass('slider-active');
10698                $swiperEL.removeClass('slider-modify');
10699                $swiperEL.removeClass('slider-centered');
10700
10701                $item.removeClass('swiper-slide-duplicate swiper-slide-duplicate-prev swiper-slide-duplicate-next swiper-slide-duplicate-active modify');
10702                $item.removeClass('swiper-slide').removeAttr('role').removeAttr('aria-label');
10703                $item.parent().removeClass('swiper-wrapper').removeAttr('id').removeAttr('aria-live');
10704                $item.parent().parent().removeClass('swiper swiper-backface-hidden');
10705            }
10706        },
10707        update: function(el_seq, elsettings, mode) {
10708            if(typeof mode == 'undefined' || !mode) mode = 'r';
10709            if(PAGE_MODE == 'c' && localStorage.hasOwnProperty('slider_elsettings')) {
10710                // console.log('mode', mode);
10711                // console.log('update setting', JSON.stringify(elsettings));
10712                localStorage.setItem('slider_elsettings', JSON.stringify(elsettings));
10713            }
10714            $.contentsSlider.destroy(el_seq);
10715            requestAnimationFrame(function() {
10716                $.contentsSlider.ready(el_seq).then(() => {
10717                    $.contentsSlider.init(el_seq, elsettings, mode);
10718                });
10719            });
10720        },
10721        setSliderNavPosition: function(el_seq) {
10722            let $swiperEL = $('.element[data-id="' + el_seq + '"]');
10723            let $firstSlide = $('.element[data-id="' + el_seq + '"] .swiper-slide.item').first();
10724
10725            if(typeof $swiperEL.offset() != 'undefined' && typeof $firstSlide.offset() != 'undefined') {
10726                let sideMargin = $swiperEL.find('.swiper').outerWidth() / 2 + 15;
10727                let offsetTop = $firstSlide.offset().top - $swiperEL.offset().top;
10728                let slideHeight = $firstSlide.height();
10729                let topPos = offsetTop + (slideHeight / 2);
10730                // console.log('offsetTop', offsetTop);
10731                $swiperEL.find('.slider-nav-btn').css('top', `${topPos}px`);
10732
10733                if($swiperEL.find('.full-width').length == 0 && $(window).width() > 767) {
10734                    if($swiperEL.find('.lyoption[data-lypd]').length > 0) {
10735                        let lypd = Number($swiperEL.find('.lyoption').attr('data-lypd'));
10736                        sideMargin -= lypd;
10737                    }
10738                    if($swiperEL.attr('data-type') == 'contents' && $swiperEL.find('[data-matrix-loop="true"]').length > 0) {
10739                        let itemPadLeft = Math.round(parseFloat($firstSlide.css('padding-left').replace(/[^0-9]/g, ''))) || 0;
10740                        sideMargin -= itemPadLeft;
10741                    }
10742
10743                    $('.element[data-id="' + el_seq + '"] .slider-nav-btn.next').css({
10744                        right: `calc(50% - ${sideMargin}px - var(--slider-nav-size))`,
10745                    });
10746
10747                    $('.element[data-id="' + el_seq + '"] .slider-nav-btn.prev').css({
10748                        left: `calc(50% - ${sideMargin}px - var(--slider-nav-size))`,
10749                    });
10750                } else {
10751                    $('.element[data-id="' + el_seq + '"] .slider-nav-btn.next').css('right', '');
10752                    $('.element[data-id="' + el_seq + '"] .slider-nav-btn.prev').css('left', '');
10753                }
10754            }
10755
10756            if($('#el-blockConfig.open').length > 0) {
10757                let selector = $('#select-navigation-style').attr('data-selector');
10758                let bcCSS = getStyleText();
10759                let prevVal = style.getCssProperty(bcCSS, selector, '--slider-nav-color');
10760                if(prevVal == 'initial') {
10761                    let color = $('.bc-slider-nav-ctrl input[data-root="--slider-nav-color"]').val();
10762                    if(typeof color != 'undefined' && color) {
10763                        $( selector + ' .slider-nav-btn svg').css('fill', color);
10764                    }
10765                } else {
10766                    $( selector + ' .slider-nav-btn svg').removeAttr('style');
10767                }
10768            }
10769
10770            $('.element[data-id="' + el_seq + '"] .slider-nav-btn').removeClass('invisible');
10771        },
10772        updateNavigationState: function(swiper) {
10773            let prevButton = swiper.navigation.prevEl;
10774            let nextButton = swiper.navigation.nextEl;
10775            let pagination = $(swiper.pagination.bullets);
10776            
10777            setTimeout(function(){
10778                if(prevButton && nextButton) {
10779                    if(pagination.length <= 1) {
10780                        prevButton.classList.add('swiper-button-disabled', 'swiper-button-hidden');
10781                        nextButton.classList.add('swiper-button-disabled', 'swiper-button-hidden');
10782                        swiper.pagination.el.classList.add('swiper-button-disabled', 'swiper-pagination-hidden');
10783                    } else {
10784                        if (swiper.realIndex === 0) {
10785                            swiper.allowSlidePrev = false;
10786                            prevButton.classList.add('swiper-button-disabled');
10787                            prevButton.setAttribute('aria-disabled', true);
10788                        } else {
10789                            swiper.allowSlidePrev = true;
10790                            prevButton.classList.remove('swiper-button-disabled');
10791                            prevButton.removeAttribute('aria-disabled');
10792                        }
10793
10794                        if (pagination.last().hasClass('swiper-pagination-bullet-active')) {
10795                            swiper.allowSlideNext = false;
10796                            nextButton.classList.add('swiper-button-disabled');
10797                            nextButton.setAttribute('aria-disabled', true);
10798                        } else {
10799                            swiper.allowSlideNext = true;
10800                            nextButton.classList.remove('swiper-button-disabled');
10801                            nextButton.removeAttribute('aria-disabled');
10802                        }
10803                    }
10804                }
10805                swiper.navigation.update();
10806                swiper.pagination.update();
10807            });
10808        },
10809        moveNavIndicator : function(swiper, el_seq) {
10810          const $paginationEl = $('.slider-pagination-' + el_seq);
10811          const $activeBullet = $paginationEl.find('.swiper-pagination-bullet-active');
10812          const $indicator = $paginationEl.find('.nav-indicator');
10813
10814          if ($activeBullet.length && $indicator.length) {
10815              // jQuery의 position()을 사용하면 부모 내부에서의 상대 위치를 쉽게 잡습니다.
10816              const pos = $activeBullet.position();
10817              
10818              $indicator.css({
10819                  'width': $activeBullet.outerWidth() + 'px',
10820                  'height': '2px',
10821                  'transform': `translateX(${pos.left}px)`
10822              });
10823          }
10824      }
10825    }
10826
10827    function contentsSliderNav(size, n) {
10828        let navObj = { //52
10829            1:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="m15.06 2-1.41 1.41L36.23 26 13.65 48.59 15.06 50l24-24-24-24z"/></svg>',
10830            2:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="M26 2C12.75 2 2 12.75 2 26s10.75 24 24 24 24-10.75 24-24S39.25 2 26 2Zm-3.36 36-.85-.85L32.94 26 21.79 14.85l.85-.85 12 12-12 12Z"/></svg>',
10831            3:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="M2 2v48h48V2H2Zm20.64 36-.85-.85L32.94 26 21.79 14.85l.85-.85 12 12-12 12Z"/></svg>',
10832            4:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="M50 26 35.86 11.86l-1.42 1.41L46.17 25H2v2h44.17L34.45 38.73l1.41 1.41 12.72-12.73h.01L50 26z"/></svg>',
10833            5:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="M26 3c12.68 0 23 10.32 23 23S38.68 49 26 49 3 38.68 3 26 13.32 3 26 3m0-1C12.75 2 2 12.75 2 26s10.75 24 24 24 24-10.75 24-24S39.25 2 26 2Z"/><path d="m22.64 38-.85-.85L32.94 26 21.79 14.85l.85-.85 12 12-12 12z"/></svg>',
10834            6:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="M49 3v46H3V3h46m1-1H2v48h48V2Z"/><path d="m22.64 38-.85-.85L32.94 26 21.79 14.85l.85-.85 12 12-12 12z"/></svg>',
10835            7:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="M50.04 25.85s0-.06-.01-.09c0-.02-.02-.03-.03-.05-.02-.05-.05-.09-.08-.13-.03-.04-.05-.08-.09-.11a.444.444 0 0 0-.11-.08c-.04-.03-.08-.06-.13-.08-.02 0-.03-.02-.05-.03C38.78 21.69 37.77 13 37.73 12.63a.75.75 0 0 0-.82-.67.75.75 0 0 0-.67.82c.04.36.89 8.04 9.37 12.47H2.69c-.41 0-.75.34-.75.75s.34.75.75.75h42.94c-8.48 4.43-9.34 12.1-9.37 12.47-.04.41.26.78.67.82h.08c.38 0 .71-.29.75-.67.04-.37 1.04-9.06 11.81-12.65 0 0 .01 0 .02-.01a.72.72 0 0 0 .21-.12l.06-.06c.04-.04.08-.09.11-.14.02-.03.03-.06.04-.09 0-.02.02-.03.03-.06 0-.03 0-.06.01-.09.01-.05.02-.1.02-.15 0-.05 0-.1-.02-.15Z"/></svg>',
10836            8:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="m3.07 27.82-1 .08c.04.47.09.93.15 1.39v.02c.02.15.04.3.07.45l.99-.16c-.1-.63-.18-1.27-.23-1.9ZM3.12 23.6l-.99-.1c-.07.66-.11 1.32-.12 2l1 .02c.01-.64.05-1.28.12-1.91ZM3.94 19.47l-.96-.28c-.08.28-.16.56-.23.85 0 .01 0 .03-.01.04V20.71l.98.2c.13-.62.28-1.25.47-1.86ZM6.59 40.12c.39.54.81 1.06 1.24 1.57l.76-.65c-.42-.48-.82-.99-1.19-1.5l-.81.59ZM9.94 8.17c-.06.05-.11.1-.17.15l-.01.01-.02.02v.04l-.02.02-.01.01c-.24.23-.47.47-.69.71l.73.68c.44-.46.9-.92 1.37-1.34l-.67-.74ZM3.78 31.97l-.97.26s.02.09.04.14 0 .01 0 .02V32.7c0 .01 0 .03.01.04s0 .01 0 .02v.03c.13.42.26.84.41 1.25l.94-.34c-.22-.6-.41-1.21-.57-1.83ZM7.75 12l-.79-.61c-.29.37-.56.75-.82 1.14s0 0 0 .01-.02.03-.03.04 0 0 0 .01-.01.02-.02.03V12.76c0 .01-.02.02-.02.04 0 .01-.01.02-.02.03l.84.54c.34-.53.72-1.06 1.1-1.57ZM4.34 36.35c.29.6.6 1.19.94 1.77l.86-.51c-.32-.55-.62-1.12-.9-1.69l-.9.43ZM17.75 4.52l-.36-.93c-.4.15-.79.32-1.18.49s0 0-.01 0-.02 0-.03.01h-.09c-.14.06-.28.13-.41.2l.44.9c.57-.28 1.16-.53 1.76-.76ZM35.73 4.05c-.61-.27-1.23-.51-1.86-.73l-.33.94c.6.21 1.2.44 1.78.7l.41-.9
108361ZM48.36 20.6l.97-.23c-.13-.53-.27-1.05-.43-1.57s0 0 0-.01V18.64c0-.01 0-.03-.01-.04 0-.01 0-.02-.01-.04l-.95.31c.2.6.38 1.22.53 1.84ZM39.56 6.2c-.17-.12-.34-.23-.51-.34s-.02-.02-.04-.02H39s-.01 0-.02-.01h-.02s-.01 0-.02-.01h-.07s-.01 0-.02-.01h-.04s-.02-.02-.04-.02l-.3-.18-.5.87c.55.31 1.1.66 1.62 1.02l.57-.82ZM9.49 43.42c.36.34.74.68 1.12 1s.02.01.02.02 0 0 .01 0 0 0 .01.01h.03c.07.06.15.12.22.18l.63-.78c-.5-.4-.98-.82-1.44-1.26l-.69.73ZM48.97 24.76l1-.05v-.03c-.04-.62-.1-1.24-.18-1.85l-.99.14c.09.63.15 1.27.18 1.91ZM31.56 2.65c-.33-.08-.66-.15-.99-.21h-.22c-.2-.04-.41-.07-.61-.1l-.15.99c.63.09 1.26.22 1.88.36l.23-.97ZM21.8 3.38l-.18-.98c-.16.03-.33.06-.49.1s0 0-.01 0H20.93c-.02 0-.03 0-.04.01-.28.06-.57.13-.85.21s-.03 0-.04.01H19.94l.26.96c.61-.17 1.24-.31 1.87-.43ZM26 3c.39 0 .78 0 1.16.03l.05-1c-.15 0-.29-.01-.44-.02H25.99c-.41.01-.82.04-1.22.07l.08 1c.63-.05 1.28-.08 1.92-.08ZM5.5 15.56l-.89-.45c-.26.51-.5 1.02-.72 1.55v.02c0 .01-.01.03-.02.04 0 .01-.01.03-.02.04v.07l.93.38c.24-.59.51-1.17.8-1.74ZM42.94 9c-.13-.13-.26-.25-.38-.38l-.01-.01-.02-.02-.01-.01-.01-.01-.02-.02-.01-.01-.01-.01-.02-.02-.01-.01-.03-.03-.01-.01-.02-.02-.01-.01-.01-.01-.02-.02-.01-.01-.01-.01-.03-.03c-.25-.24-.51-.46-.78-.69l-.64.76c.49.41.96.85 1.41 1.3l.71-.71ZM45.76 12.38v-.03s0-.01-.01-.02v-.02l-.02-.02-.01-.01c-.01-.02-.02-.03-.04-.05a25.6 25.6 0 0 0-1.01-1.32l-.77.63c.4.49.79 1.01 1.15 1.53l.82-.57ZM43.89 40.45l.78.63V40.8s0-.01.01-.02v-.02l.02-.02v-.01c0-.01.02-.02.03-.03v-.01c0-.01.02-.02.03-.04.01-.02.02-.03.04-.05.01-.02.02-.03.04-.05.06-.08.12-.16.17-.24s.02-.02.03-.04c0-.01.02-.02.03-.04v-.02s0-.01.01-.02V40.09s.01-.02.02-.03 0 0 0-.01v-.01l-.83-.56c-.36.53-.74 1.04-1.14 1.54ZM40.96 43.47l.65.76c.51-.43.99-.89 1.46-1.36l-.71-.7c-.45.45-.92.89-1.4 1.31ZM13.46 5.54c-.45.28-.9.57-1.33.88h-.04s-.02.01-.02.02c-.05.04-.1.07-.15.11l.59.81c.51-.38 1.05-.74 1.59-1.07l-.52-.85ZM48.98 27.06c-.03.64-.08 1.28-.17 1.91l.99.13c.02-.12.03-.25.04-.37s0-.01 0-.02v-.05c.05-.49.09-.99.11-1.49l-1-.05ZM46.23 36.95l.88.48c.1-.19.21-.39.3-.58s.02-.04.03-.06.01-.03.02-.04v-.01s0-.02.01-.03 0 0 0-.01v-.01s0-.02.01-.03V36.43s0-.02.01-.02v-.04s0-.02.01-.02v-.05s0-.02.01-.02v-.01c0-.01.01-.03.02-.04v-.02c.03-.06.05-.12.08-.18l-.92-.4c-.26.58-.54 1.16-.84 1.72ZM47.89 33.08l.95.31c.2-.63.38-1.27.53-1.93l-.97-.23c-.14.62-.32 1.24-.51 1.85ZM47.92 16.2c-.22-.49-.45-.96-.7-1.43s0 0 0-.01v-.05c-.04-.08-.08-.15-.12-.22l-.88.48c.31.56.6 1.13.86 1.71l.91-.41ZM16.83 48.19c.28.12.56.23.85.33H17.81s.02 0 .03.01c.22.08.43.15.65.22s0 0 .01 0h.07l.3-.95c-.61-.19-1.21-.41-1.8-.66l-.38.92ZM21.03 49.48c.19.04.38.08.57.11h.02c.41.07.83.14 1.25.19l.12-.99c-.63-.08-1.27-.19-1.89-.32l-.21.98ZM12.94 46.14s.03.02.05.03H13s.01 0 .02.01h.08s.02.01.03.02 0 0 .01 0c.37.23.75.45 1.13.67s.02.01.03.02 0 0 .01 0h.01s.02.01.03.01H14.49l.47-.88c-.56-.3-1.11-.63-1.65-.98l-.54.84ZM37.52 45.91l.5.87c.06-.04.12-.07.18-.11h.01c.01 0 .03-.01.04-.02H38.46s.02-.01.03-.02 0 0 .01 0h.01s.02-.01.03-.02h.01c.01 0 .03-.02.04-.02h.01s.02-.01.03-.02 0 0 .01 0c.28-.18.56-.36.83-.55l-.57-.82c-.52.36-1.07.71-1.62 1.03ZM26 49h-.58l-.02 1H26.1c.26 0 .51-.01.77-.02s.03 0 .05 0h.13l-.06-1c-.44.03-.89.04-1.34.04ZM33.7 47.68l.33.94H34.09c.01 0 .03 0 .04-.01h.06c.01 0 .03-.01.04-.02s.03-.01.04-.02c.03-.01.07-.03.1-.04.01 0 .03-.01.04-.02h.02c.01 0 .03-.01.04-.02H34.68c.01 0 .03-.01.04-.02.28-.11.56-.23.83-.36l-.41-.91c-.58.26-1.18.5-1.78.72ZM29.62 48.72l.16.99c.66-.1 1.32-.24 1.96-.39l-.24-.97c-.62.15-1.25.28-1.88.38ZM29.36 17.36l-.7.71 7.43 7.43H14v1h22.09l-7.43 7.43.7.71L38 26l-8.64-8.64z"/></svg>',
10837            9:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="m21.74 2-.91.43L32.16 26 20.83 49.57l.91.43 11.53-24L21.74 2z"/></svg>',
10838            10: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="m49.68 25.22-.15-.15-13.86-13.86c-.43-.43-1.12-.43-1.55 0l-.15.15c-.43.43-.43 1.12 0 1.55l11.89 11.88H3.2c-.66 0-1.2.54-1.2 1.2s.54 1.2 1.2 1.2h42.66L33.98 39.07c-.43.43-.43 1.12 0 1.55l.15.15c.43.43 1.12.43 1.55 0l13.86-13.86.15-.15c.21-.21.32-.49.32-.77s-.11-.56-.32-.77Z"/></svg>',
10839            11: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="m39.31 24.94-22.5-22.5c-.59-.59-1.54-.59-2.12 0s-.59 1.54 0 2.12L36.13 26 14.69 47.44a1.49 1.49 0 0 0 0 2.12c.29.29.68.44 1.06.44s.77-.15 1.06-.44l22.5-22.5c.59-.59.59-1.54 0-2.12Z"/></svg>', 
10840            12: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="M39.76 23.42 19.41 3.07c-1.38-1.38-3.79-1.38-5.17 0-.69.69-1.07 1.61-1.07 2.58s.38 1.9 1.07 2.58L32 25.99 14.24 43.75c-.69.69-1.07 1.61-1.07 2.58a3.655 3.655 0 0 0 3.66 3.66c.98 0 1.89-.38 2.58-1.
1084007l20.34-20.34c.69-.69 1.07-1.61 1.07-2.58s-.38-1.9-1.07-2.58Zm-1.06 4.1L18.36 47.86c-.82.82-2.23.82-3.05 0-.41-.41-.63-.95-.63-1.52s.22-1.12.63-1.52L33.6 26.53c.29-.29.29-.77 0-1.06L15.3 7.18c-.41-.41-.63-.95-.63-1.52s.22-1.12.63-1.52c.42-.42.97-.63 1.52-.63s1.1.21 1.53.63l20.34 20.34c.41.41.63.95.63 1.52s-.22 1.12-.63 1.52Z"/></svg>', 
10841            13: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="m50 26-.01-.01-3.9-3.99L32.38 8H22l13.71 14H2v8h33.7L22 44h10.38l12.43-12.7 1.27-1.3L50 26z"/></svg>', 
10842            14: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="m46.07 26-.01-.01L22.07 2H7.93l24 24-24 24h14.14L39 33.07 46.07 26z"/></svg>', 
10843            15: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="m32.19 26-.01-.01L13.19 7H2l19 19L2 45h11.19L26.6 31.6l5.59-5.6z"/><path d="M49.99 25.99 31 7H19.81l19 19-19 19H31l13.4-13.4L50 26l-.01-.01z"/></svg>', 
10844            16: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="M50 26c0-.07-.01-.13-.04-.19-.01-.03-.03-.05-.05-.07-.02-.03-.03-.06-.06-.09L27.23 3.02c-.2-.2-.51-.2-.71 0s-.2.51 0 .71L48.29 25.5H2.5c-.28 0-.5.22-.5.5s.22.5.5.5h45.79L26.52 48.27c-.2.2-.2.51 0 .71a.485.485 0 0 0 .7 0l22.62-22.62s.09-.1.11-.17c.02-.04.02-.08.02-.12 0-.03.02-.05.02-.08Z"/></svg>', 
10845            17: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="m36.74 17.71-.71.71 11.56 11.55H2v1h48L36.74 17.71z"/></svg>', 
10846            18: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="M40.48 23.37 18.36 2.95c-2.29-2.11-6-.49-6 2.63v40.84c0 3.11 3.71 4.74 6 2.63l22.12-20.42a3.576 3.576 0 0 0 0-5.25Z"/>', 
10847            19: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="M14 2v48l26-24L14 2z"/></svg>', 
10848            20: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="M26 2C12.75 2 2 12.75 2 26s10.75 24 24 24 24-10.75 24-24S39.25 2 26 2Zm-4.5 36V14l13 12-13 12Z"/></svg>', 
10849            21: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="M2 2v48h48V2H2Zm19.5 36V14l13 12-13 12Z"/></svg>', 
10850            22: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="M50 26 32 9v16H2v2h30v16l18-17z"/></svg>', 
10851            23: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="M26 3c12.68 0 23 10.32 23 23S38.68 49 26 49 3 38.68 3 26 13.32 3 26 3m0-1C12.75 2 2 12.75 2 26s10.75 24 24 24 24-10.75 24-24S39.25 2 26 2Z"/><path d="m34.5 26-13-12v24l13-12z"/></svg>', 
10852            24: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="M49 3v46H3V3h46m1-1H2v48h48V2Z"/><path d="m34.5 26-13-12v24l13-12z"/></svg>', 
10853            25: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="M47.18 23.33 42.59 19 32 9v10H2v14h30v10l10.59-10 4.59-4.33L50 26l-2.82-2.67z"/></svg>', 
10854            26: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="m34.5 26-13-12v24l13-12zM26 2H25.67c-.41.01-.82.04-1.22.07l.08 1c.63-.05 1.28-.08 1.92-.08v-1Zm-4.38.4c-.16.03-.33.06-.49.1s0 0-.01 0H20.89c-.28.06-.57.13-.85.21s-.03 0-.04.01H19.94l.26.96c.61-.17 1.24-.31 1.87-.43l-.18-.98Zm-4.23 1.19c-.4.15-.79.32-1.18.49s0 0-.01 0-.02 0-.03.01h-.09c-.14.06-.28.13-.41.2l.44.9c.57-.28 1.16-.53 1.76-.76l-.36-.93Zm-3.93 1.95c-.45.28-.9.57-1.33.88h-.04s-.02.01-.02.02c-.05.04-.1.07-.15.11l.59.81c.51-.38 1.05-.74 1.59-1.07l-.52-.85ZM9.94 8.17c-.06.05-.11.1-.17.15l-.01.01-.02.02-.02.02-.01.01c-.24.23-.47.47-.69.71l.73.68c.44-.46.9-.91 1.37-1.34l-.67-.74Zm-2.99 3.22c-.29.37-.56.75-.82 1.14s0 0 0 .01-.02.03-.03.04 0 0 0 .01-.01.02-.02.03V12.74c0 .01-.02.02-.02.04 0 .01-.01.02-.02.03l.84.54c.34-.53.72-1.06 1.1-1.57l-.79-.61Zm-2.34 3.72c-.26.51-.5 1.02-.72 1.55v.02c0 .01-.01.03-.02.04 0 .01-.01.03-.02.04v.08l.93.38c.24
10854-.59.51-1.17.8-1.74l-.89-.45Zm-1.63 4.08c-.08.28-.16.56-.23.85 0 .01 0 .03-.01.04V20.69l.98.2c.13-.62.28-1.25.47-1.86l-.96-.28Zm-.85 4.31c-.07.66-.11 1.32-.12 2l1 .02c.01-.64.05-1.28.12-1.91l-.99-.1Zm.94 4.32-1 .08c.03.44.08.88.14 1.31v.03c.03.18.05.36.08.54l.99-.16c-.1-.63-.18-1.27-.23-1.9Zm.71 4.15-.97.26c.04.13.07.26.11.39s0 .02 0 .03V33.07c0 .01 0 .03.01.04v.07l.18.51.94-.34c-.22-.6-.41-1.21-.57-1.83Zm1.46 3.95-.9.43c.18.37.36.73.56 1.09.12.23.25.45.38.67l.86-.51c-.32-.55-.62-1.12-.9-1.69Zm2.16 3.61-.81.59v.02s.01.02.02.02 0 0 0 .01.02.03.03.04c.2.27.4.53.61.79v.09l.02.02.01.01c.08.09.15.18.23.27l.76-.65c-.42-.48-.82-.99-1.19-1.5Zm2.78 3.16-.69.73s.08.08.12.11l.01.01.01.01.01.01c.37.35.76.68 1.16 1s0 0 .01 0h.02c.01.01.03.02.04.03l.63-.78c-.5-.4-.98-.82-1.44-1.26Zm3.31 2.61-.54.84c.05.03.1.07.16.1h.01s.02.01.03.02 0 0 .01 0h.01s.02.01.03.02 0 0 .01 0H13.51s.02 0 .03.01h.02s.02.01.03.02h.01l.27.15.47-.88c-.56-.3-1.11-.63-1.65-.98Zm3.72 1.96-.38.92c.21.09.43.17.64.25h.13c.33.12.66.23.99.34l.3-.95c-.61-.19-1.21-.41-1.8-.66Zm4.02 1.25-.21.98c.24.05.47.1.71.14h.08c.35.06.71.11 1.07.16l.12-.99c-.63-.08-1.27-.19-1.89-.32Zm6.11.45c-.44.03-.89.04-1.34.04h-.58l-.02 1H25.97c.26 0 .51-.01.77-.02h.17l-.06-1Zm4.16-.62c-.62.15-1.25.28-1.88.38l.16.99c.66-.1 1.32-.24 1.96-.39l-.24-.97Zm3.98-1.38c-.58.26-1.18.5-1.78.72l.33.94s.02 0 .03-.01.03-.01.04-.02 0 0 .01 0H34.45s.02 0 .03-.01 0 0 .01 0 .03-.01.04-.02c.4-.16.79-.32 1.18-.5l-.41-.91Zm3.66-2.08c-.52.36-1.07.71-1.62 1.03l.5.87c.14-.08.28-.16.42-.25s0 0 .01 0H38.56s.01 0 .02-.01h.02s.01 0 .02-.01h.01c.01 0 .02-.02.04-.02h.01s.01 0 .02-.01h.02c.01 0 .03-.02.04-.02.01 0 .02-.02.04-.02h.01l.09-.06c.19-.12.38-.25.56-.38l-.57-.82Zm3.22-2.71c-.45.45-.92.89-1.4 1.31l.65.76c.12-.1.24-.2.35-.31l.01-.01s.02-.01.02-.02 0 0 .01-.01l.01-.01.02-.02H42.09l.01-.01.01-.01h.01l.02-.02.01-.01.01-.01.02-.02.01-.01.01-.01.02-.02.01-.01.01-.01.02-.02.01-.01.01-.01.02-.02.01-.01.02-.02.02-.02h.01l.15-.15-.71-.7Zm2.67-3.26c-.36.53-.74 1.04-1.14 1.54l.78.63c.42-.52.82-1.05 1.19-1.61l-.83-.56Zm2.04-3.68c-.26.58-.54 1.16-.84 1.72l.88.48s0-.01.01-.02c.05-.1.1-.19.15-.29l.03-.06c.02-.03.03-.06.05-.1 0-.01.01-.03.02-.04v-.01c0-.01.01-.03.02-.04v-.02s0-.02.01-.02v-.01c0-.01.01-.03.02-.04v-.01s0-.02.01-.02v-.04s0-.02.01-.02v-.02s0-.02.01-.02v-.01s0-.01.01-.02v-.02s0-.01.01-.02v-.01s0-.02.01-.02v-.04s0-.02.01-.02v-.02s0-.02.01-.02v-.01s0-.02.01-.02v-.02c0-.01.01-.03.02-.04.08-.18.16-.35.24-.53l-.92-.4Zm1.33-3.99c-.14.62-.32 1.24-.51 1.85l.95.31c.1-.31.19-.62.28-.94s0-.01 0-.02V31.99l.03-.11-.97-.23Zm.58-4.18c-.03.64-.08 1.28-.17 1.91l.99.13c.02-.14.03-.27.05-.41v-.08c.05-.48.09-.97.11-1.46l-1-.05Zm.8-4.34-.99.14c.09.63.15 1.27.18 1.91l1-.05c-.02-.47-.06-.93-.11-1.39s0-.01 0-.02l-.06-.5Zm-.99-4.28-.95.31c.2.6.38 1.22.53 1.84l.97-.23c-.16-.65-.34-1.29-.55-1.92Zm-1.77-4.03-.88.48c.31.56.6 1.13.86 1.71l.91-.41c-.27-.61-.57-1.21-.89-1.79Zm-2.46-3.63-.77.63c.4.49.79 1.01 1.15 1.53l.82-.57c-.14-.2-.28-.39-.42-.59 0 0-.01-.02-.02-.02s0 0 0-.01v-.01s-.01-.02-.02-.02 0 0 0-.01v-.01s-.01-.02-.02-.02V11.4s-.01-.02-.02-.02v-.02s-.01-.02-.02-.02v-.01c0-.01-.02-.02-.03-.04s-.03-.03-.04-.05c-.1-.12-.19-.24-.29-.36Zm-3.09-3.13-.64.76c.49.41.96.85 1.41 1.3l.71-.71c-.47-.47-.96-.92-1.47-1.35Zm-3.6-2.51-.5.87c.55.31 1.1.66 1.62 1.02l.57-.82c-.17-.12-.34-.23-.51-.34-.01 0-.02-.02-.04-.02H39s-.01 0-.02-.01h-.02s-.01 0-.02-.01h-.07s-.01 0-.02-.01h-.04c-.01 0-.02-.01-.04-.02l-.3-.18Zm-4-1.82-.33.94c.6.21 1.2.44 1.78.7l.41-.91h-.02s-.02 0-.03-.01 0 0-.01 0H35.19s-.02 0-.03-.01 0 0-.01 0c-.17-.06-.33-.12-.5-.18ZM29.6 2.27l-.15.99c.63.09 1.26.22 1.88.36l.23-.97s-.07-.02-.1-.02-.03 0-.04-.01H30.9l-.72-.12ZM26 2v1c.39 0 .78 0 1.16.03l.05-1c-.15 0-.29-.01-.44-.02H26.45Z"/></svg>',
10855            27: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="52" height="52"><path d="M10.06 2 8.65 3.41 31.23 26 8.65 48.59 10.06 50l24-24-24-24z"/><path d="m22.06 2-1.41 1.41L43.23 26 20.65 48.59 22.06 50l24-24-24-24z"/></svg>', 
10856        };
10857
10858        switch(size) {
10859            case 28:
10860                navObj = {
10861                    1:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M9.06 2 7.65 3.41 18.23 14 7.65 24.59 9.06 26l12-12-12-12z"/></svg>',
10862                    2:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M14 2C7.37 2 2 7.37 2 14s5.37 12 12 12 12-5.37 12-12S20.63 2 14 2Zm-1.36 18-.85-.85L16.94 14l-5.15-5.15.85-.85 6 6-6 6Z"/></svg>',
10863                    3:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M2 2v24h24V2H2Zm10.64 18-.85-.85L16.94 14l-5.15-5.15.85-.85 6 6-6 6Z"/></svg>',
10864                    4:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="m26 14-7.07-7.07-1.42 1.41L22.17 13H2v2h20.17l-4.65 4.66 1.41 1.41 5.65-5.66h.01L26 14z"/></svg>',
10865                    5:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M14 3c6.07 0 11 4.93 11 11s-4.93 11-11 11S3 20.07 3 14 7.93 3 14 3m0-1C7.37 2 2 7.37 2 14s5.37 12 12 12 12-5.37 12-12S20.63 2 14 2Z"/><path d="m12.64 20-.85-.85L16.94 14l-5.15-5.15.85-.85 6 6-6 6z"/></svg>',
10866                    6:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M24.8 3.2v21.6H3.2V3.2h21.6M26 2H2v24h24V2Z"/><path d="m12.64 20-.85-.85L16.94 14l-5.15-5.15.85-.85 6 6-6 6z"/></svg>',
10867                    7:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M25.99 14c0-.05 0-.1-.02-.15 0-.03 0-.06-.01-.09 0-.02-.02-.03-.03-.05-.02-.05-.05-.09-.08-.13-.03-.04-.05-.08-.08-.11a.444.444 0 0 0-.11-.08c-.04-.03-.08-.06-.13-.08-.02 0-.03-.02-.05-.03-5.12-1.71-5.63-5.82-5.65-6.01a.745.745 0 0 0-.82-.67.75.75 0 0 0-.67.82c.02.17.39 3.48 3.72 5.82H2.75c-.41 0-.75.34-.75.75s.34.75.75.75h19.32c-3.33 2.34-3.71 5.65-3.72 5.82-.04.41.26.78.67.82h.08c.38 0 .7-.29.75-.67.02-.17.52-4.3 5.65-6.01 0 0 .01 0 .02-.01a.72.72 0 0 0 .21-.12l.06-.06c.04-.04.08-.09.11-.14.02-.03.03-.06.05-.09 0-.02.02-.03.03-.05 0-.03 0-.06.01-.09.01-.05.02-.1.02-.15Z"/></svg>',
10868                    8:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M3 14c0-.38.02-.77.06-1.15l-.99-.1c0 .07-.01.15-.02.22s0 .02 0 .03c0 .11-.01.22-.02.33s0 .02 0 .02v.15c0 .08 0 .16.01.24l1-.06c-.01-.23-.02-.46-.02-.69ZM4.3 21.06c.39.54.83 1.05 1.31 1.51l.7-.71c-.44-.43-.84-.89-1.2-1.39l-.81.59ZM2.41 17.11c.17.65.4 1.28.68 1.88l.91-.42c-.25-.55-.46-1.13-.62-1.72l-.97.26ZM3.02 9.16s-.01.03-.02.04c0 .01 0 .02-.01.03s0 .01 0 .02v.05c-.12.29-.22.59-.32.89l.95.3c.18-.58.42-1.15.69-1.69l-.89-.45c-.1.2-.2.4-.29.61ZM10.06 3.73 9.7 2.8c-.14.05-.27.11-.41.16s-.01 0-.02 0h-.05c-.01 0-.02 0-.03.01-.01 0-.02.01-.03.02-.35.16-.69.34-1.
1086802.54l.51.86c.53-.31 1.08-.58 1.65-.8ZM24.98 13.41l1-.05c-.02-.35-.05-.71-.1-1.05s0-.02 0-.03v-.14c-.03-.18-.07-.35-.1-.52l-.98.22c.13.59.22 1.2.25 1.81ZM14 3c.19 0 .37 0 .56.01l.05-1c-.15 0-.3-.01-.45-.01H13.66c-.15.02-.31.04-.46.07l.16.99c.6-.1 1.21-.15 1.83-.15ZM24.96 9.1a13 13 0 0 0-.37-.75s-.01-.03-.02-.04-.01-.02-.02-.03 0-.01-.01-.02c0-.01-.01-.02-.02-.03 0-.01-.02-.03-.02-.04-.11-.19-.23-.38-.35-.56l-.83.55c.34.51.64 1.05.89 1.6l.91-.41ZM18.86 3.03c-.23-.1-.46-.19-.69-.28-.02 0-.03-.01-.05-.02-.01 0-.02 0-.04-.01s-.02 0-.03-.01c-.01 0-.02 0-.04-.01h-.34c-.08-.02-.17-.05-.26-.07l-.25.97c.59.15 1.17.35 1.73.6l.41-.91ZM5.97 5.09l-.01.01-.01.01s-.01.02-.02.02l-.03.03c-.29.29-.56.6-.81.92s-.02.02-.03.04l.78.62c.38-.48.8-.93 1.25-1.34l-.67-.74ZM19.51 23.52l.5.87c.36-.21.7-.43 1.03-.67 0 0 .02-.01.02-.02l.01-.01c.15-.11.3-.23.45-.35l-.64-.77c-.47.39-.98.74-1.5 1.05ZM22.56 20.91l.78.63s0-.01.01-.02c0 0 .02-.02.02-.03s.01-.02.02-.02.02-.02.03-.04.07-.09.1-.13.05-.07.07-.1.06-.09.1-.13c0-.01.02-.03.03-.04l.03-.04c0-.01.01-.02.02-.03 0-.01.01-.02.02-.03 0-.01.01-.02.02-.03 0 0 .01-.02.02-.02 0 0 0-.01.01-.02s0 0 0-.01v-.03s0-.01.01-.02v-.02s0-.02.01-.02c0 0 0-.02.01-.02 0 0 0-.02.01-.02 0 0 0-.02.01-.02l-.87-.49c-.3.53-.65 1.04-1.03 1.51ZM24.47 17.39l.95.31c.2-.63.36-1.28.45-1.95l-.99-.14c-.09.6-.23 1.2-.42 1.78ZM22.07 5.12l-.02-.02-.01-.01-.01-.01-.02-.02h-.02v-.01s-.01 0-.02-.01c0 0-.02-.02-.03-.02 0 0-.02-.01-.02-.02s-.02-.01-.02-.02c0 0-.01 0-.02-.01 0 0-.01 0-.02-.01l-.01-.01-.02-.02c-.01 0-.02-.02-.04-.03-.08-.06-.16-.12-.25-.18l-.58.82c.5.35.97.75 1.4 1.18l.71-.71c-.13-.13-.27-.26-.4-.38ZM11.51 25.74c.64.14 1.31.22 1.98.25l.04-1c-.61-.03-1.22-.1-1.82-.23l-.21.98ZM15.73 24.86l.16.99c.16-.03.32-.05.48-.09H16.83c.1-.03.2-.06.3-.1l-.32-.95c-.58.19-1.17.34-1.78.44ZM7.47 24.07c.17.11.33.21.5.31s.02.01.03.02h.01s.02 0 .02.01c.34.19.7.37 1.06.52l.4-.92c-.56-.24-1.1-.53-1.61-.87l-.54.84ZM15.4 9.4l-.7.71 3.39 3.39H8v1h10.09l-3.39 3.39.7.71L20 14l-4.6-4.6z"/></svg>',
10869                    9:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="m12.65 2-.91.43L17.25 14l-5.51 11.57.91.43 5.71-12-5.71-12z"/></svg>',
10870                    10: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M25.79 14.56c.05-.07.11-.13.14-.22.09-.22.09-.47 0-.69-.03-.08-.08-.14-.13-.2-.02-.03-.03-.06-.06-.09l-6.51-6.51c-.35-.35-.92-.35-1.27 0s-.35.92 0 1.27l4.97 4.97H2.9c-.5 0-.9.4-.9.9s.4.9.9.9h20.03l-4.97 4.97a.9.9 0 0 0 0 1.27.9.9 0 0 0 1.27 0l6.5-6.51c.02-.02.03-.05.05-.07Z"/></svg>',
10871                    11: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="m21.31 12.94-10.5-10.5c-.59-.59-1.54-.59-2.12 0s-.59 1.54 0 2.12L18.13 14l-9.44 9.44a1.49 1.49 0 0 0 0 2.12c.29.29.68.44 1.06.44s.77-.15 1.06-.44l10.5-10.5c.59-.59.59-1.54 0-2.12Z"/></svg>',
10872                    12: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="m21.56 12.09-9.29-9.3c-1.05-1.05-2.77-1.05-3.83 0s-1.05 2.77 0 3.83L15.82 14l-7.38 7.38a2.722 2.722 0 0 0 0 3.83c.51.51 1.19.79 1.91.79s1.4-.28 1.91-.79l9.29-9.29a2.722 2.722 0 0 0 0-3.83Zm-1.06 2.76-9.29 9.29c-.46.46-1.25.46-1.71 0-.47-.47-.47-1.24 0-1.71l7.91-7.91c.29-.29.29-.77 0-1.06L9.5 5.55c-.47-.47-.47-1.24 0-1.71.24-.24.54-.35.85-.35s.62.12.85.35l9.29 9.29c.47.47.47 1.24 0 1.71Z"/></svg>',
10873                    13: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M26 14v-.01l-1.87-1.87L17 5h-5.3l7.12 7.12H2v3.76h16.82L11.7 23H17l6.35-6.35.77-.77L26 14z"/></svg>',
10874                    14: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M24.53 14v-.01L12.53 2H5.46l12.01 12-12 12h7.06L21 17.53 24.54 14h-.01z"/></svg>',
10875                    15: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="m16.8 14-9-9H2.5l9 9-9 9h5.3l6.35-6.35L16.8 14z" class="cls-1"/><path d="m26 14-9-9h-5.3l9 9-9 9H17l6.35-6.35L26 14z"/></svg>',
10876                    16: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M25.96 14.19c.08-.19.05-.41-.11-.56-.01-.01-.03-.01-.04-.02L15.25 3.04c-.2-.2-.51-.2-.71 0-.2.2-.2.51 0 .71l9.75 9.75H2.5c-.28 0-.5.22-.5.5s.22.5.5.5h21.79l-9.75 9.75c-.19.19-.19.5 0 .69.19.2.51.2.71.01l10.61-10.61.01-.01c.03-.04.06-.08.08-.12 0 0 .01-.02.02-.03Z"/></svg>',
10877                    17: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="m19.1 10.1-.7.71L23.59 16H2v1h24l-6.9-6.9z"/></svg>',
10878                    18: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M21.74 12.69 10.68 2.48c-1.14-1.06-3-.24-3 1.31v20.42c0 1.56 1.85 2.37 3 1.31l11.06-10.21c.77-.71.77-1.92 0-2.63Z"/>',
10879                    19: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M8.5 2v24l13-12-13-12z"/></svg>',
10880                    20: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M14 2C7.37 2 2 7.37 2 14s5.37 12 12 12 12-5.37 12-12S20.63 2 14 2Zm-2.25 18V8l6.5 6-6.5 6Z"/></svg>',
10881                    21: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M2 2v24h24V2H2Zm9.75 18V8l6.5 6-6.5 6Z"/></svg>',
10882                    22: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="m26 14-9-8v7H2v2h15v7l9-8z"/></svg>',
10883                    23: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M14 3c6.07 0 11 4.93 11 11s-4.93 11-11 11S3 20.07 3 14 7.93 3 14 3m0-1C7.37 2 2 7.37 2 14s5.37 12 12 12 12-5.37 12-12S20.63 2 14 2Z"/><path d="m18.25 14-6.5-6v12l6.5-6z"/></svg>',
10884                    24: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M25 3v22H3V3h22m1-1H2v24h24V2Z"/><path d="m18.25 14-6.5-6v12l6.5-6z"/></svg>',
10885                    25: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M24.59 12.75 21.5 10 17 6v4H2v8h15v4l4.5-4 3.09-2.75L26 14l-1.41-1.25z"/></svg>',
10886                    26: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="m18.25 14-6.5-6v12l6.5-6zM14 2H13.55l-.41.06.16.99c.6-.1 1.21-.15 1.83-.15v-1Zm-4.3.79c-.63.24-1.23.53-1.8.87l.51.86c.53-.31 1.08-.58 1.65-.8l-.36-.93ZM5.97 5.08c-.34.3-.66.63-.96.96s-.02.02-.03.03 0 .01-.01.02l-.01.
1088601s-.02.02-.02.03c-.06.07-.12.15-.18.22l.78.62c.38-.48.8-.93 1.25-1.34l-.67-.74ZM3.3 8.55v.04c-.13.26-.24.52-.35.78 0 .01 0 .02-.01.03s0 .02-.01.03v.06s0 .02-.01.03c0 .01 0 .02-.01.04-.06.16-.11.33-.17.49l.95.3c.18-.58.42-1.15.69-1.69l-.89-.45Zm-1.24 4.2c0 .05-.01.1-.01.15V13.11c0 .13-.01.25-.02.38s0 .01 0 .01v.05c0 .09 0 .18.01.26l1-.06c-.01-.23-.02-.46-.02-.69 0-.38.02-.77.06-1.15l-.99-.1Zm1.31 4.1-.97.26.09.32s0 .02.01.04v.04c0 .01 0 .02.01.03.1.32.22.63.34.93 0 0 0 .02.01.02v.02c0 .01.01.02.02.03s.03.07.04.1l.91-.42c-.25-.55-.46-1.13-.62-1.72Zm1.73 3.62-.81.59c.39.54.83 1.05 1.31 1.51l.7-.71c-.44-.43-.84-.89-1.2-1.39Zm2.92 2.76-.54.84c.11.07.23.14.34.21 0 0 .02 0 .02.01 0 0 .02 0 .02.01.01 0 .02.01.03.02.38.21.76.41 1.16.58l.4-.92c-.56-.24-1.1-.53-1.61-.87Zm3.7 1.53-.21.98c.64.14 1.31.22 1.98.25l.04-1c-.61-.03-1.22-.1-1.82-.23Zm5.79-.33c-.58.19-1.17.34-1.78.44l.16.99c.13-.02.26-.04.38-.07h.05c.41-.09.82-.19 1.22-.32h.04c.01 0 .02 0 .03-.01l-.32-.95Zm3.5-1.95c-.47.39-.98.74-1.5 1.05l.5.87s.05-.03.07-.04c0 0 .02 0 .03-.01h.02c.5-.3.97-.64 1.41-1.01l-.64-.77Zm2.58-3.08c-.3.53-.65 1.04-1.03 1.51l.78.63c.12-.14.23-.29.34-.44s.01-.02.02-.03c0 0 0-.01.01-.02l.01-.01s0-.01.01-.02l.02-.02s.01-.02.02-.03c0 0 .01-.02.02-.03 0-.01.02-.02.02-.04 0-.01.02-.02.02-.04s.02-.03.02-.04c0-.01.02-.03.02-.04 0-.01.01-.02.02-.03 0 0 0-.01.01-.02v-.03c0-.01.01-.02.02-.03.05-.08.1-.16.14-.24l-.87-.49Zm1.29-3.8c-.09.6-.23 1.2-.42 1.78l.95.31c.2-.63.36-1.28.45-1.95l-.99-.14Zm.83-4.22-.98.22c.13.59.22 1.2.25 1.81l1-.05c-.04-.68-.13-1.34-.27-1.98Zm-1.72-4.03-.83.55c.34.51.64 1.05.89 1.6l.91-.41c-.27-.61-.6-1.2-.97-1.75Zm-3.04-3.14-.58.82c.5.35.97.75 1.4 1.18l.71-.71-.01-.01-.02-.02-.03-.03c-.01-.01-.03-.02-.04-.04-.27-.25-.56-.49-.85-.72 0 0-.02-.01-.03-.02l-.01-.01s-.01 0-.02-.01-.02-.02-.03-.02l-.11-.08Zm-3.97-1.84-.25.97c.59.15 1.17.35 1.73.6l.41-.91c-.6-.27-1.24-.49-1.89-.65ZM14 2v1c.19 0 .37 0 .56.01l.05-1h-.42Z"/></svg>',
10887                    27: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M6.06 2 4.65 3.41 15.23 14 4.65 24.59 6.06 26l12-12-12-12z"/><path d="m14.06 2-1.41 1.41L23.23 14 12.65 24.59 14.06 26l12-12-12-12z"/></svg>',
10888                }
10889                break;
10890            case 40:
10891                navObj = {
10892                    1:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="m13.06 38-1.41-1.41L28.23 20 11.65 3.41 13.06 2l18 18-18 18z"/></svg>',
10893                    2:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="M20 2C10.06 2 2 10.06 2 20s8.06 18 18 18 18-8.06 18-18S29.94 2 20 2Zm-2.86 27-.85-.85L24.44 20l-8.15-8.15.85-.85 9 9-9 9Z"/></svg>',
10894                    3:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="M2 2v36h36V2H2Zm15.14 27-.85-.85L24.44 20l-8.15-8.15.85-.85 9 9-9 9Z"/></svg>',
10895                    4:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="m25.281 29.897 11.31-11.317 1.415 1.414-11.31 11.317z"/><path d="m25.27 10.1 1.415-1.415L38 20l-1.414 1.414z"/><path d="M2 19h34v2H2z"/></svg>',
10896                    5:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="M20 3c9.37 0 17 7.63 17 17s-7.63 17-17 17S3 29.37 3 20 10.63 3 20 3m0-1C10.06 2 2 10.06 2 20s8.06 18 18 18 18-8.06 18-18S29.94 2 20 2Z"/><path d="m17.14 29-.85-.85L24.44 20l-8.15-8.15.85-.85 9 9-9 9z"/></svg>',
10897                    6:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="m17.14 29-.85-.85L24.44 20l-8.15-8.15.85-.85 9 9-9 9z"/><path d="M37 3v34H3V3h34m1-1H2v36h36V2Z"/></svg>',
10898                    7:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="M37.25 19.8c-.08 0-.16-.01-.24-.04C27.54 16.6 26.68 8.82 26.65 8.49a.75.75 0 0 1 .67-.82c.42-.03.78.26.82.67.03.31.84 7.16 9.34 9.99a.75.75 0 0 1-.24 1.46Z"/><path d="M27.4 30.43h-.07a.75.75 0 0 1-.67-.82c.03-.33.9-8.11 10.36-11.27.39-.13.82.08.95.47.13.39-.08.82-.47.95-8.55 2.85-9.34 9.92-9.34 9.99a.75.75 0 0 1-.75.68Z"/><path d="M37.25 19.8H2.75c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h34.5c.41 0 .75.34.75.75s-.34.75-.75.75Z"/></svg>',
10899                    8:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="M20 2H19.83c-.5.01-1 .05-1.49.1l.11.99c.62-.07 1.26-.1 1.89-.1v-1Zm-4.36.53c-.65.16-1.29.36-1.91.59l.35.94c.59-.22 1.19-.41 1.8-.56l-.24-.97ZM11.55 4.1c-.33.17-.65.36-.96.55h-.02s-.01 0-.02.01c-.01 0-.02.01-.03.02-.17.11-.35.22-.52.34s0 0-.01 0l.57.82c.52-.35 1.06-.68 1.61-.98l-.47-.88Zm-3.6 2.53-.01.01h-.01l-.01.01h-.01l-.01.01c-.43.4-.84.81-1.22 1.25l.75.66c.42-.47.86-.92 1.33-1.34l-.67-.74ZM5.07 9.94c-.14.2-.27.41-.4.61 0 .02-.02.03-.03.05 0 0-.01.02-.02.03s0 .01-.01.02c0 0 0 .01-.01.02 0 0 0 .01-.01.02 0 0 0 .01-.01.02 0 0 0 .01-.01.02 0 0 0 .01-.01.02 0 .01-.01.02-.02.03-.13.23-.26.46-.38.7l.89.46c.29-.56.62-1.1.97-1.62l-.83-.56Zm-1.99 3.91c-.07.19-.13.37-.19.56s-.01.03-.02.05c0 .02-.01.03-.02.05 0 .03-.02.05-.03.08 0 .01 0 .03-.01.04-.08.27-.16.55-.24.83v.05c0 .02 0 .04-.01.
1089905l.97.23c.15-.61.33-1.22.54-1.81l-.94-.34Zm-.98 4.28s0 .08-.01.13c-.04.44-.06.89-.07 1.34s0 0 0 .01v.13h1v-.12c0-.59.03-1.19.09-1.77l-.99-.1Zm1.06 4.25-.99.14c.04.31.1.62.15.93v.05c.06.28.12.55.19.82l.97-.25c-.16-.61-.28-1.23-.37-1.85Zm1.08 4-.93.38v.04c.24.58.51 1.13.8 1.68l.88-.48c-.3-.55-.57-1.13-.81-1.71ZM6.25 30l-.81.59c.25.35.52.68.79 1.01s.02.02.03.03.02.02.02.03c0 0 0 .01.01.02v.01l.01.01.01.01.02.02.01.01.02.02.02.02.74-.67c-.42-.46-.83-.96-1.19-1.46Zm2.83 3.03-.64.77c.51.43 1.04.83 1.6 1.2l.55-.83c-.52-.35-1.03-.73-1.51-1.13Zm3.48 2.26-.44.9s.06.03.09.04c.01 0 .02 0 .03.01H12.5s.02 0 .03.01c.12.05.24.09.37.14l.34-.94c-.59-.21-1.18-.46-1.74-.73Zm3.92 1.34-.21.98c.6.13 1.21.22 1.82.29h.08l.1-1c-.63-.06-1.25-.16-1.87-.29Zm6.01.19c-.62.09-1.25.15-1.88.17l.04 1c.67-.02 1.34-.08 1.99-.18l-.15-.99Zm4-1.1c-.58.24-1.18.45-1.78.62l.28.96h.02c.47-.14.93-.29 1.38-.46s.02 0 .04-.01.02 0 .03-.01.01 0 .02 0h.03l-.38-.92Zm3.6-2.04c-.5.37-1.04.72-1.58 1.04l.5.87c.07-.04.13-.08.2-.12 0 0 .01 0 .02-.01s.01 0 .02-.01.01 0 .02-.01.03-.02.04-.02c.43-.26.84-.54 1.24-.84l-.59-.8Zm3.02-2.85c-.4.48-.83.95-1.28 1.39l.7.72c.25-.24.5-.49.73-.75l.03-.03.02-.02v-.01l.01-.01v-.01l.02-.02.01-.01.02-.02v-.01l.02-.02s.01-.02.02-.03c.04-.04.07-.09.11-.13l-.77-.64Zm2.23-3.49c-.27.57-.58 1.12-.91 1.65l.85.53c.22-.35.43-.72.63-1.09 0-.01.01-.02.02-.03 0 0 0-.02.01-.02v-.02s0-.01.01-.02.01-.03.02-.04c.06-.11.11-.22.17-.34l-.9-.43Zm1.32-3.93c-.13.61-.29 1.23-.48 1.83l.95.31v-.05c0-.01 0-.02.01-.03.18-.57.32-1.14.44-1.73l-.98-.2Zm1.32-4.18-1 .04a14.813 14.813 0 0 1-.02 1.89l1 .07c0-.08 0-.16.01-.23v-.03c0-.19.02-.38.02-.57v-.89Zm-.71-4.33-.96.28c.18.6.32 
108991.22.43 1.84l.98-.17c-.03-.19-.07-.37-.11-.56s0-.03 0-.04V16.07c0-.02 0-.03-.01-.05l-.12-.44Zm-1.75-4.02-.86.51c.32.54.61 1.11.87 1.68l.91-.41c-.05-.11-.1-.23-.16-.34s0-.01 0-.02v-.02c-.22-.45-.45-.89-.71-1.33Zm-2.67-3.49-.71.7c.44.45.86.93 1.25 1.42l.79-.62c-.41-.52-.85-1.03-1.32-1.5Zm-3.43-2.73-.52.85c.53.33 1.06.69 1.55 1.08l.61-.79c-.51-.39-1.03-.76-1.58-1.09Zm-3.99-1.83-.3.95c.6.19 1.19.41 1.76.67l.41-.91c-.61-.27-1.23-.51-1.87-.71Zm-4.32-.8-.06 1c.63.04 1.26.11 1.88.22l.17-.99c-.65-.11-1.31-.19-1.99-.23Z"/><path d="M11 19.5h17.25v1H11z"/><path d="m22.61 26.57-.71-.71L27.76 20l-5.86-5.86.71-.71L29.18 20l-6.57 6.57z"/></svg>',
10900                    9:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="m17.18 38-.9-.43L24.72 20 16.28 2.43l.9-.43 8.65 18-8.65 18z"/></svg>',
10901                    10: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><rect width="17" height="2" x="23.15" y="13.7" rx=".9" ry=".9" transform="rotate(45 31.654 14.692)"/><rect width="17" height="2" x="23.15" y="24.3" rx=".9" ry=".9" transform="rotate(-45 31.662 25.305)"/><path d="M36.69 21H3c-.55 0-1-.45-1-1s.45-1 1-1h33.69c.55 0 1 .45 1 1s-.45 1-1 1Z"/></svg>',
10902                    11: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="M12.75 38c-.38 0-.77-.15-1.06-.44a1.49 1.49 0 0 1 0-2.12L27.13 20 11.69 4.56a1.49 1.49 0 0 1 0-2.12 1.49 1.49 0 0 1 2.12 0l16.5 16.5c.59.59.59 1.54 0 2.12l-16.5 16.5c-.29.29-.68.44-1.06.44Z"/></svg>',
10903                    12: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="M13.45 38c-.78 0-1.51-.3-2.06-.85s-.85-1.28-.85-2.06.3-1.51.85-2.06l13.04-13.04L11.4 6.96c-.55-.55-.85-1.28-.85-2.06s.3-1.51.85-2.05a2.915 2.915 0 0 1 4.11 0L30.6 17.94c.55.55.85 1.28.85 2.05s-.3 1.51-.85 2.05L15.51 37.13c-.55.55-1.28.85-2.05.85Zm0-34.5c-.36 0-.72.14-1 .41-.27.27-.41.62-.41.99s.15.73.41.99l13.57 13.57a.75.75 0 0 1 0 1.06L12.45 34.09c-.27.27-.41.62-.41.99s.15.73.41.99c.53.53 1.46.53 1.99 0l15.09-15.09c.27-.27.41-.62.41-.99s-.15-.73-.41-.99L14.45 3.91c-.27-.27-.63-.41-.99-.41Z"/></svg>',
10904                    13: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="m38 20-.01-.01L35.06 17 24.79 6.5H17L27.28 17H2v6h25.28L17 33.5h7.79l9.32-9.52.95-.98L38 20z"/></svg>',
10905                    14: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="m29 25.3 5.3-5.3-.01-.01L16.3 2H5.7l18 18-18 18h10.6L29 25.3z"/></svg>',
10906                    15: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="M2 5.75 16.25 20 2 34.25h8.4L20.45 24.2l4.2-4.2L10.4 5.75H2Z"/><path d="M15.35 5.75 29.6 20 15.35 34.25h8.4L33.8 24.2 38 20 23.76 5.75h-8.4Z" data-name="Path_366"/></svg>',
10907                    16: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="M38 20c0-.07-.01-.13-.04-.19-.02-.04-.05-.08-.08-.12a.219.219 0 0 1-.03-.05L21 2.8c-.2-.2-.51-.2-.71 0s-.2.51 0 .71l16 16H2.5c-.28 0-.5.22-.5.5s.22.5.5.5h33.79l-16 16c-.2.2-.2.51 0 .71a.485.485 0 0 0 .7 0l16.85-16.85s.09-.1.11-.17c.02-.05.03-.11.03-.16v-.03Z"/></svg>',
10908                    17: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="M38.1 25.11h-36v-1h33.59l-8.37-8.37.7-.71L38.1 25.11z"/></svg>',
10909                    18: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="M31.13 17.94 14.67 2.75c-1.79-1.66-4.7-.38-4.7 2.06V35.2c0 2.44 2.91 3.71 4.7 2.06l16.46-15.19c1.2-1.11 1.2-3.01 0-4.11Z"/></svg>',
10910                    19: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="M30.75 20 11.25 2v36l19.5-18z"/></svg>',
10911                    20: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="M20 2C10.06 2 2 10.06 2 20s8.06 18 18 18 18-8.06 18-18S29.94 2 20 2Zm-3.88 27V11l9.75 9-9.75 9Z"/></svg>',
10912                    21: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="M2 2v36h36V2H2Zm14.12 27V11l9.75 9-9.75 9Z"/></svg>',
10913                    22: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="M38 20 24.5 7.25V19H2v2h22.5v11.75L38 20z"/></svg>',
10914                    23: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="M20 3c9.37 0 17 7.63 17 17s-7.63 17-17 17S3 29.37 3 20 10.63 3 20 3m0-1C10.06 2 2 10.06 2 20s8.06 18 18 18 18-8.06 18-18S29.94 2 20 2Z"/><path d="m25.88 20-9.76-9v18l9.76-9z"/></svg>',
10915                    24: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="M37 3v34H3V3h34m1-1H2v36h36V2Z"/><path d="m25.88 20-9.76-9v18l9.76-9z"/></svg>',
10916                    25: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="m35.88 18-3.44-3.25-7.94-7.5v7.5H2v10.5h22.5v7.5l7.94-7.5L35.88 22 38 20l-2.12-2z"/></svg>',
10917                    26: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="m25.88 20-9.76-9v18l9.76-9zM20 2h-.19c-.5.01-1 .05-1.49.1l.11.99c.62-.07 1.26-.1 1.89-.1v-1Zm-4.36.53c-.23.06-.45.12-.67.18H14.86c-.01 0-.02 0-.03.01-.02 0-.03.01-.05.02-.02 0-.03.01-.05.02-.17.06-.33.11-.49.18l.35.94c.59-.22 1.19-.41 1.8-.56l-.24-.97ZM11.55 4.1s-.07.04-.11.06-.02.01-.03.02c0 0-.02.01-.03.02s-.02.01-.03.02c-.39.23-.77.47-1.14.72l.57.82c.52-.35 1.06-.68 1.61-.98l-.47-.88Zm-3.6 2.53c-.09.08-.18.17-.28.25s-.02.02-.03.03l-.01.01-.02.02H7.6l-.01.01-.01.01h-.01l-.01.01-.01.01h-.02v.05l-.01.01v.02s-.01.02-.02.02-.04.05-.06.07l.75.66c.42-.47.86-.92 1.33-1.34l-.67-.74ZM5.07 9.94s0 .01-.01.02c-.35.52-.67 1.06-.96 1.62l.89.46c.29-.56.62-1.1.97-1.62l-.83-.56Zm-1.99 3.91c-.07.18-.13.37-.19.56v.08s0 .03-.01.04 0 .02 0 .02v.22l-.09.36.97.23c.15-.61.33-1.22.54-1.81l-.94-.34Zm-.98 4.28s0 .07-.01.11c-.04.45-.07.91-.07 1.37v.14h1v-.12c0-.59.03-1.19.09-1.77l-.99-.1Zm1.06 4.25-.99.14c.05.36.11.72.19 1.08s0 .03 0 .04V23.71c.04.2.09.4.14.6l.97-.25c-.16-.61-.28-1.23-.37-1.85Zm1.08 4-.93.38s.03.07.04.11c.18.43.37.85.59 1.26v.02c.05.1.1.2.16.3l.88-.48c-.3-.55-.57-1.13-.81-1.71ZM6.25 30l-.81.59c.34.46.7.91 1.08 1.34.05.05.1.11.15.16l.74-.67c-.42-.46-.83-.96-1.19-1.46Zm2.83 3.03-.64.77c.16.14.33.27.5.41 0 0 .01 0 .02.02.31.24.64.47.96.69l.55-.83c-.52-.35-1.03-.73-1.51-1.13Zm3.48 2.26-.44.9c.6.29 1.21.55 1.84.77l.34-.94c-.59-.21-1.18-.46-1.74-.73Zm3.92 1.34-.21.98.32.06h.03c.5.09 1 .17 1.52.22l.1-1c-.63-.06-1.25-.16-1.87-.29Zm6.01.19c-.62.09-1.25.15-1.88.17l.04 1c.67-.02 1.34-.08 1.99-.18l-.15-.99Zm4-1.1c-.58.24-1.18.45-1.78.62l.28.96c.64-.19 1.27-.41 1.89-.66l-.38-.92Zm3.6-2.04c-.5.37-1.04.72-1.58 1.04l.5.87s.01 0 .02-.01c0 0 .01 0 .02-.01h.01c.53-.31 1.05-.66 1.54-1.02l-.59-.8Zm3.02-2.85c-.4.48-.83.95-1.28 1.39l.7.72c.48-.46.93-.95 1.36-1.47l-.77-.64Zm2.23-3.49c-.27.57-.58 1.12-.91 1.65l.85.53c.18-.3.36-.6.53-.91v-.02s0-.02.01-.03c.12-.23.24-.46.35-.7l-.9-.43Zm1.32-3.93c-.13.61-.29 1.23-.48 1.83l.95.31c.14-.44.27-.89.38-1.34.04-.17.07-.33.11-.5l-.98-.2Zm1.32-4.18-1 .04a14.813 14.813 0 0 1-.02 1.89l1 .07c0-.09.01-.17.02-.26v-.08c0-.17.01-.35.02-.52s0-.01 0-.02v-.88Zm-.71-4.33-.96.28c.18.6.32 
109171.22.43 1.84l.98-.17s-.01-.06-.02-.1v-.02c-.11-.6-.25-1.18-.42-1.76Zm-1.75-4.02-.86.51c.32.54.61 1.11.87 1.68l.91-.41c-.07-.17-.15-.33-.23-.49 0 0 0-.02-.01-.02v-.02s0-.01-.01-.02c0-.01-.01-.03-.02-.04-.07-.14-.14-.28-.22-.42s-.02-.03-.03-.05 0-.02-.01-.03l-.24-.42Zm-2.67-3.49-.71.7c.44.45.86.93 1.25 1.42l.79-.62c-.3-.38-.61-.74-.94-1.1 0 0-.01-.02-.02-.02v-.01l-.02-.02c-.09-.1-.19-.2-.28-.29Zm-3.43-2.73-.52.85c.53.33 1.06.69 1.55 1.08l.61-.79c-.14-.11-.28-.21-.42-.32l-.01-.01s-.01 0-.02-.01c-.37-.27-.75-.52-1.14-.76Zm-3.99-1.83-.3.95c.6.19 1.19.41 1.76.67l.41-.91c-.28-.13-.57-.25-.86-.36-.01 0-.03-.01-.04-.02s-.02 0-.03-.01-.03-.01-.04-.02-.02 0-.03-.01-.02 0-.03-.01 0 0-.01 0-.02 0-.04-.01c-.23-.08-.45-.16-.68-.23Zm-4.32-.8-.06 1c.63.04 1.26.11 1.88.22l.17-.99c-.34-.06-.68-.11-1.03-.15h-.02c-.29-.03-.57-.06-.86-.07Z"/></svg>',
10918                    27: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="m8.61 38-1.42-1.41L23.78 20 7.19 3.41 8.61 2l18 18-18 18z"/><path d="m17.51 38-1.41-1.41L32.69 20 16.1 3.41 17.51 2l18 18-18 18z"/></svg>',
10919                }
10920                
10921                break;
10922            case 52:
10923                break;
10924            case 64:
10925                navObj = {
10926                    1:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="m20.06 62-1.41-1.41L47.23 32 18.65 3.41 20.06 2l30 30-30 30z"/></svg>',
10927                    2:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="M32 2C15.43 2 2 15.43 2 32s13.43 30 30 30 30-13.43 30-30S48.57 2 32 2Zm-4.86 45-.85-.85L40.44 32 26.29 17.85l.85-.85 15 15-15 15Z"/></svg>',
10928                    3:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="M2 2v60h60V2H2Zm25.14 45-.85-.85L40.44 32 26.29 17.85l.85-.85 15 15-15 15Z"/></svg>',
10929                    4:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="m40.792 50.555 19.785-19.813 1.415 1.413-19.785 19.813z"/><path d="m40.48 13.459 1.413-1.414 20.11 20.11-1.414 1.414z"/><path d="M2 31h58v2H2z"/></svg>',
10930                    5:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="M32 3c15.99 0 29 13.01 29 29S47.99 61 32 61 3 47.99 3 32 16.01 3 32 3m0-1C15.43 2 2 15.43 2 32s13.43 30 30 30 30-13.43 30-30S48.57 2 32 2Z"/><path d="m27.14 47-.85-.85L40.44 32 26.29 17.85l.85-.85 15 15-15 15z"/></svg>',
10931                    6:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="m27.14 47-.85-.85L40.44 32 26.29 17.85l.85-.85 15 15-15 15z"/><path d="M61 3v58H3V3h58m1-1H2v60h60V2Z"/></svg>',
10932                    7:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="M61.25 32.75c-.08 0-.16-.01-.24-.04-14.59-4.86-15.95-17.19-15.96-17.31a.75.75 0 0 1 .67-.82c.42-.04.78.26.82.67.05.47 1.31 11.49 14.95 16.04a.75.75 0 0 1-.24 1.46Z"/><path d="M45.8 49.42h-.07a.75.75 0 0 1-.67-.82c.01-.12 1.38-12.45 15.96-17.31.39-.13.82.08.95.47.13.39-.08.82-.47.95-13.67 4.56-14.93 15.92-14.94 16.04a.75.75 0 0 1-.75.68Z"/><path d="M60.47 32.75H2.75c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h57.72c.41 0 .75.34.75.75s-.34.75-.75.75Z"/></svg>',
10933                    8:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="M32 2H31.56c-.48 0-.96.03-1.43.06l.07 1c.64-.04 1.29-.06 1.93-.06V2Zm-4.38.32c-.36.05-.72.11-1.08.18h-.31c-.13.03-.25.05-.38.08l.21.98c.63-.14 1.27-.25 1.9-.34l-.14-.99Zm-4.3.95c-.37.11-.74.23-1.11.36-.01 0-.03 0-.04.01-.01 0-.02 0-.03.01h-.01s-.02 0-.03.01c0 0-.02 0-.03.01h-.02s-.02 0-.03.01c0 0-.02 0-.03.01 0 0-.02 0-.03.01h-.04c-.01 0-.02 0-.03.01h-.01c-.01 0-.02 0-.03.01-.01 0-.03.01-.04.02-.09.03-.17.06-.25.09l.35.94c.6-.23 1.22-.43 1.83-.62l-.29-.96Zm-4.1 1.58h-.02s-.02 0-.03.01c-.58.28-1.16.57-1.72.89l.49.87c.56-.31 1.14-.61 1.72-.88l-.43-.9Zm-3.83 2.16s-.09.06-.14.09c0 0-.02.01-.03.02 0 0-.02.01-.03.02-.01 0-.02.02-.04.02-.01 0-.02.02-.04.02 0 0-.02.01-.03.02-.43.29-.84.59-1.25.9 0 0-.02.01-.03.02 0 0-.02.01-.02.02l.61.79c.51-.39 1.04-.77 1.57-1.12l-.55-.83Zm-3.47 2.7s-.07.06-.1.09l-.01.01h-.01s-.01.02-.02.02c-.27.25-.53.5-.79.75s-.01.01-.02.02l-.01.
1093301-.01.01-.02.02c-.08.08-.16.16-.23.24l.72.7c.45-.46.92-.91 1.39-1.34l-.67-.74Zm-3.04 3.17c-.09.11-.18.21-.26.32 0 0 0 .01-.01.02v.01s-.01.02-.02.02v.01s-.01.02-.02.02c-.21.26-.41.53-.61.79s0 0 0 .01c0 0-.01.02-.02.02v.02s-.01.02-.02.02c-.04.06-.08.11-.12.17l.81.59c.38-.52.77-1.03 1.18-1.53l-.77-.64Zm-2.55 3.58c-.35.57-.67 1.15-.98 1.74l.89.46c.3-.57.61-1.14.95-1.69l-.86-.52Zm-2 3.92c-.26.61-.5 1.24-.71 1.87l.95.32c.21-.61.44-1.21.69-1.81l-.92-.39Zm-1.4 4.17v.05c-.16.62-.3 1.25-.41 1.89l.98.18c.12-.63.26-1.27.42-1.89l-.97-.25Zm-.77 4.33V29.26c-.03.39-.05.78-.07 1.17l1 .04c.02-.64.07-1.29.14-1.93l-.99-.1Zm.87 4.35-1 .04c0 .21.02.41.03.62v.21l.09 1.02.99-.11c-.07-.64-.12-1.29-.14-1.93Zm.48 4.22-.98.19c.06.3.12.6.19.9V38.75s0 .03.01.05c.05.2.1.4.15.61l.97-.25c-.16-.62-.3-1.25-.42-1.89Zm1.1 4.1-.94.33c.17.48.35.95.54 1.42s0 .02.01.03 0 0 0 .01c0 0 0 .02.01.03v.02s0 .02.01.03c.03.08.07.17.11.25l.92-.39c-.25-.59-.49-1.2-.7-1.8Zm1.69 3.9-.89.46s0 .01.01.02c0 .01.01.02.02.03.3.57.62 1.13.95 1.68l.85-.52c-.34-.55-.66-1.11-.95-1.68Zm2.25 3.61-.81.59s0 .01.01.02c0 0 .01.02.02.03 0 0 .01.02.02.03 0 .01.02.02.03.03 0 0 .01.02.02.03 0 0 .01.02.02.03 0 0 .01.02.02.03 0 0 .01.02.02.03 0 0 .01.02.02.03 0 0 .01.02.02.02l.01.02s.01.02.02.03c0 0 .01.02.02.03 0 0 .01.02.02.03 0 0 .01.02.02.03 0 .01.02.02.03.03 0 0 .01.02.02.03 0 .01.02.02.03.04 0 0 .01.02.02.03 0 .01.02.02.03.04 0 0 .01.02.02.03.02.02.03.04.05.06.03.04.06.08.1.12.04.05.08.11.13.16.15.19.3.38.46.56l.77-.64c-.41-.49-.81-1.01-1.19-1.52Zm2.74 3.24-.71.7v.01l.01.01.02.02.02.02.03.03.02.02.03.03.08.08c.06.06.12.12.18.17s.01.01.02.02l.03.03.02.02.01.01.02.02h.01l.01.01v.01l.02.02h.01l.02.02s.02.01.02.02c.18.17.35.33.54.49l.67-.75c-.48-.43-.95-.88-1.4-1.33Zm3.19 2.81-.6.8c.53.4 1.08.79 1.63 1.16l.55-.83c-.54-.35-1.07-.73-1.58-1.12Zm3.57 2.32-.48.88.12.06s.02.01.03.02c0 0 .02.01.03.02.02.01.05.02.07.04a22.66 22.66 0 0 0 .89.46c.01 0 .03.01.04.02.01 0 .03.01.04.02.01 0 .02 0 .03.01H18.94c.08.04.15.07.23.11l.42-.91a27.7 27.7 0 0 1-1.72-.87Zm3.86 1.77-.35.94H21.75s.02 0 .03.01 0 0 .01 0a22.772 22.772 0 0 0 1.11.37s.02 0 .03 0h.13c.04.01.08.03.13.04l.28-.96c-.62-.18-1.23-.39-1.83-.61Zm4.08 1.18-.21.98.75.15H26.93c.17.03.35.05.52.08l.14-.99c-.64-.09-1.28-.2-1.9-.33Zm4.21.57-.06 1 .55.03H31.18v-1h-.14c-.6 0-1.2-.02-1.8-.05Zm6.17-.28c-.63.1-1.28.17-1.92.23l.08 1c.67-.06 1.33-.13 1.99-.23l-.15-.99Zm4.15-.94c-.61.19-1.24.36-1.87.5l.23.97s.06-.01.09-.02 0 0 .01 0H39.1c.02 0 .03 0 .04-.01.51-.13 1.02-.27 1.53-.42l-.29-.96Zm3.96-1.54c-.58.28-1.18.54-1.77.77l.37.93c.18-.07.35-.14.53-.22.01 0 .02 0 .03-.01 0 0 .02 0 .03-.01 0 0 .02 0 .03-.01h.02s.02 0 .03-.01H43.87s.02 0 .03-.01h.01s.02 0 .03-.01.03-.01.04-.02c.22-.1.44-.2.65-.3 0 0 .02 0 .03-.01s-.43-.9-.43-.9Zm3.69-2.11c-.53.36-1.08.7-1.64 1.03l.5.87c.08-.05.16-.09.24-.14s.02-.01.03-.02 0 0 .01 0h.05s.02-.01.03-.02c0 0 .02-.01.03-.02.4-.24.79-.49 1.18-.75l-.56-.83Zm3.34-2.62c-.47.43-.97.85-1.47 1.25l.62.78c.44-.35.87-.71 1.29-1.09l.02-.02h.01l.01-.01.02-.02v-.01l.02-.02.02-.02-.67-.74Zm2.93-3.09c-.41.5-.84.99-1.27 1.45l.73.68.02-.02.01-.01.02-.02s.01-.02.02-.02 0 0 .01-.01c.4-.43.79-.88 1.16-1.33l-.77-.63Zm2.45-3.47c-.33.55-.68 1.1-1.05 1.62l.82.57c.38-.55.74-1.11 1.09-1.68l-.86-.51Zm1.91-3.79c-.25.59-.51 1.18-.8 1.76l.9.44c.26-.52.5-1.04.72-1.57 0 0 0-.02.01-.03v-.01s0-.02.01-.03v-.02c.01-.03.03-.06.04-.09l-.92-.38Zm1.33-4.04c-.16.62-.34 1.25-.53 1.86l.95.31.06-.18s0-.03.01-.04 0-.01 0-.01v-.12c.12-.41.24-.82.35-1.23v-.08l-.97-.24Zm.73-4.18c-.06.64-.15 1.28-.25 1.92l.99.16V36.39c.01-.12.03-.25.04-.37l-1-.1Zm1.11-4.3-1 .05c.02.45.03.91.03 1.37v.57l1 .02V32.07c0-.4-.01-.79-.03-1.18Zm-.53-4.37-.98.19c.12.63.23 1.27.31 1.91l.99-.13c-.01-.09-.02-.19-.04-.28s0-.01 0-.02V27.31c-.04-.22-.08-.43-.12-.64Zm-1.15-4.24-.94.33c.21.6.41 1.22.58 1.84l.96-.27c-.18-.65-.38-1.28-.6-1.91Zm-1.77-4.02-.88.47c.3.57.59 1.15.85 1.74l.91-.41v-.02s0-.02-.01-.03c-.18-.39-.37-.78-.56-1.17s-.01-.03-.02-.04c0-.01 0-.02-.02-.03 0-.01 0-.02-.01-.03 0 0 0-.02-.01-.03 0 0 0-.02-.01-.03v-.02s0-.02-.01-.03c0 0 0-.02-.01-.03v-.03s0-.02-.01-.03v-.03s0-.01-.01-.02Zm-2.34-3.72-.81.59c.38.52.75 1.05 1.09 1.59l.84-.54c-.1-.16-.21-.33-.32-.49 0 0-.01-.02-.02-.03 0-.01-.02-.02-.02-.04 0 0-.01-.02-.02-.03 0 0-.01-.02-.02-.03 0 0-.01-.02-.02-.03 0 0-.01-.02-.02-.02 0 0 0-.01-.01-.02 0 0-.01-.02-.02-.02 0 0-.01-.02-.02-.03 0 0-.01-.02-.02-.03 0 0-.01-.02-.02-.03s0-.01-.01-.02c0 0-.01-.02-.02-.03 0 0-.01-.02-.02-.03 0 0-.01-.02-.02-.03 0 0-.01-.02-.02-.03l-.45-.63Zm-2.86-3.34-.71.7c.45.46.89.93 1.31 1.42l.76-.65c-.44-.5-.89-.99-1.36-1.47ZM50.01 8l-.6.8c.51.39 1.02.79 1.51 1.21l.65-.76c-.15-.13-.3-.26-.45-.38s-.02-.01-.02-.02 0 0-.01 0-.02-.01-.02-.02h-.01l-.01-.01h-.04s-.01 0-.01-.01c0 0-.02-.01-.02-.02-.01 0-.02-.02-.03-.03-.25-.2-.5-.4-.76-.59Zm-3.7-2.37-.48.88c.56.31 1.12.64 1.67.98l.54-.84s-.06-.04-.08-.05c0 0-.02-.01-.03-.02h-.03s-.02-.01-.03-.02h-.01s-.02-.01-.03-.02c-.35-.22-.7-.43-1.06-.63s-.02-.01-.03-.02h-.05s-.02 0-.03-.01c-.06-.03-.12-.07-.19-.1Zm-4-1.81-.34.94c.6.22 1.21.46 1.79.72l.41-.91c-.06-.03-.11-.05-.17-.08s-.03-.01-.04-.02-.02 0-.03-.01 0 0-.01 0c0 0-.02 0-.03-.01h-.01s-.02 0-.03-.01 0 0-.01 0H43.61s-.02 0-.03-.01h-.01s-.02 0-.03-.01h-.03s-.02 0-.03-.01 0 0-.01 0c-.14-.05-.27-.1-.41-.15Zm-4.23-1.2-.2.98c.63.13 1.26.28 1.88.45l.27-.96c-.64-.18-1.29-.33-1.94-.47Zm-4.36-.57-.06 1c.64.04 1.29.09 1.93.17l.12-.99s-.06 0-.09-.01-.03 0-.05 0h-.34c-.38-.04-.77-.07-1.16-.09Z"/><path d="M18.67 31.5H44.7v1H18.67z"/><path d="m35.89 41.56-.7-.71L44.04 32l-8.85-8.85.7-.71L45.45 32l-9.56 9.56z"/></svg>',
10934                    9:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="m27.29 62-.9-.43L40.6 32 26.39 2.43l.9-.43 14.42 30-14.42 30z"/></svg>',
10935                    10: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><rect width="28" height="3" x="37.57" y="21.66" rx="1.5" ry="1.5" transform="rotate(45 51.567 23.16)"/><rect width="28" height="3" x="37.57" y="39.34" rx="1.5" ry="1.5" transform="rotate(-45 51.575 40.837)"/><path d="M60 33.5H4c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5h56c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5Z"/></svg>',
10936                    11: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="M19.75 62c-.38 0-.77-.15-1.06-.44a1.49 1.49 0 0 1 0-2.12L46.13 32 18.69 4.56a1.49 1.49 0 0 1 0-2.12 1.49 1.49 0 0 1 2.12 0l28.5 28.5c.59.59.59 1.54 0 2.12l-28.5 28.5c-.29.29-.68.44-1.06.44Z"/></svg>',
10937                    12: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="M21.1 62a4.16 4.16 0 0 1-2.96-1.23c-.79-.79-1.23-1.84-1.23-2.96s.44-2.17 1.23-2.96L40.98 32 18.13 9.15c-.79-.79-1.23-1.84-1.23-2.96s.44-2.17 1.23-2.96A4.16 4.16 0 0 1 21.09 2c1.12 0 2.17.44 2.96 1.23l25.81 25.81c.79.79 1.23 1.84 1.23 2.96s-.44 2.17-1.23 2.96L24.05 60.77A4.16 4.16 0 0 1 21.09 62Zm0-58.5c-.72 0-1.4.28-1.9.79-.51.51-.79 1.18-.79 1.9s.28 1.39.79 1.9l23.38 23.38c.29.29.29.77 0 1.06L19.2 55.91c-.51.51-.79 1.18-.79 1.9s.28 1.39.79 1.9c1.02 1.02 2.79 1.02 3.8 0L48.81 33.9c.51-.51.79
10937-1.18.79-1.9s-.28-1.39-.79-1.9L23 4.29c-.51-.51-1.18-.79-1.9-.79Z"/></svg>',
10938                    13: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="m62 32-.01-.01L57 27 39.5 9.5H26.24L43.74 27H2v10h41.74l-17.5 17.5H39.5l15.87-15.87L57 37l5-5z"/></svg>',
10939                    14: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="M47 40.84 55.84 32l-.02-.02L25.84 2H8.16l30 30-30 30h17.68L47 40.83v.01z"/></svg>',
10940                    15: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="M2 8.67 25.33 32 2 55.33h13.75l16.46-16.46L39.08 32h-.01L15.75 8.67H2Z"/><path d="M24.92 8.67 48.25 32 24.92 55.33h13.75l16.46-16.46L62 32h-.01L38.67 8.67H24.92Z" data-name="Path_366"/></svg>',
10941                    16: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="M62 32c0-.07-.01-.13-.04-.19-.02-.04-.05-.08-.08-.12a.219.219 0 0 1-.03-.05l-28.5-28.5c-.2-.2-.51-.2-.71 0s-.2.51 0 .71L60.29 31.5H2.5c-.28 0-.5.22-.5.5s.22.5.5.5h57.79L32.64 60.15c-.2.2-.2.51 0 .71a.485.485 0 0 0 .7 0l28.5-28.5s.09-.1.11-.17c.02-.05.03-.11.03-.16V32Z"/></svg>',
10942                    17: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="M62 40.29H2v-1h57.59L44.85 24.56l.71-.71L62 40.29z"/></svg>',
10943                    18: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="M50.85 28.77 23.12 3.18c-2.82-2.6-7.38-.6-7.38 3.23v51.18c0 3.84 4.57 5.83 7.38 3.23l27.72-25.59a4.4 4.4 0 0 0 0-6.47Z"/></svg>',
10944                    19: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="M50.25 32 17.75 2v60l32.5-30z"/></svg>',
10945                    20: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="M32 2C15.43 2 2 15.43 2 32s13.43 30 30 30 30-13.43 30-30S48.57 2 32 2Zm-6.33 45V17l16.67 15-16.67 15Z"/></svg>',
10946                    21: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="M2 2v60h60V2H2Zm23.67 45V17l16.67 15-16.67 15Z"/></svg>',
10947                    22: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="M62 32 40.33 11.17V31H2v2h38.33v19.83L62 32z"/></svg>',
10948                    23: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="M32 3c15.99 0 29 13.01 29 29S47.99 61 32 61 3 47.99 3 32 16.01 3 32 3m0-1C15.43 2 2 15.43 2 32s13.43 30 30 30 30-13.43 30-30S48.57 2 32 2Z"/><path d="M42.33 32 25.67 17v30l16.66-15z"/></svg>',
10949                    24: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="M61 3v58H3V3h58m1-1H2v60h60V2Z"/><path d="M42.33 32 25.67 17v30l16.66-15z"/></svg>',
10950                    25: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="m58.47 28.61-6-5.78-12.14-11.66v11.66H2v18.34h38.33v11.66l12.14-11.66 6-5.78L62 32l-3.53-3.39z"/></svg>',
10951                    26: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="M42.33 32 25.67 17v30l16.66-15zM32 2H31.55c-.48 0-.96.03-1.43.06l.07 1c.64-.04 1.29-.06 1.93-.06V2Zm-4.38.32c-.36.05-.72.11-1.08.18h-.31c-.13.03-.25.05-.38.08l.21.98c.63-.14 1.27-.25 1.9-.34l-.14-.99Zm-4.3.95c-.37.11-.74.23-1.11.36-.01 0-.03 0-.04.01-.01 0-.02 0-.03.01h-.01s-.02 0-.03.01c0 0-.02 0-.03.01h-.02s-.02 0-.03.01c0 0-.02 0-.03.01 0 0-.02 0-.03.01h-.04c-.01 0-.02 0-.03.01h-.01c-.01 0-.02 0-.03.01-.01 0-.03.01-.04.02-.09.03-.17.06-.25.09l.35.94c.6-.23 1.22-.43 1.83-.62l-.29-.96Zm-4.1 1.58h-.02s-.02 0-.03.01c-.58.28-1.16.57-1.72.89l.49.87c.56-.31 1.14-.61 1.72-.88l-.43-.9Zm-3.83 2.16s-.09.06-.14.09c0 0-.02.01-.03.02 0 0-.02.01-.03.02-.01 0-.02.02-.04.02-.01 0-.02.02-.04.02 0 0-.02.01-.03.02-.43.29-.84.59-1.25.9 0 0-.02.01-.03.02 0 0-.02.01-.02.02l.61.79c.51-.39 1.04-.77 1.57-1.12l-.55-.83Zm-3.47 2.7s-.07.06-.1.09l-.01.01h-.01s-.01.02-.02.02c-.27.25-.53.5-.79.75s-.01.01-.02.02l-.01.
1095101-.01.01-.02.02c-.08.08-.16.16-.23.24l.72.7c.45-.46.92-.91 1.39-1.34l-.67-.74Zm-3.04 3.17c-.09.11-.18.21-.26.32 0 0 0 .01-.01.02s0 .01 0 .01v.01s-.01.02-.02.02v.01s-.01.02-.02.02c-.21.26-.41.53-.61.79s0 0 0 .01c0 0-.01.02-.02.02v.02s-.01.02-.02.02c-.04.06-.08.11-.12.17l.81.59c.38-.52.77-1.03 1.18-1.53l-.77-.64Zm-2.55 3.58c-.35.57-.67 1.15-.98 1.74l.89.46c.3-.57.61-1.14.95-1.69l-.86-.52Zm-2 3.92c-.26.61-.5 1.24-.71 1.87l.95.32c.21-.61.44-1.21.69-1.81l-.92-.39Zm-1.4 4.17v.05c-.16.62-.3 1.25-.41 1.89l.98.18c.12-.63.26-1.27.42-1.89l-.97-.25Zm-.77 4.33V29.27c-.03.39-.05.78-.07 1.17l1 .04c.02-.64.07-1.29.14-1.93l-.99-.1Zm.87 4.35-1 .04c0 .21.02.41.03.62s0 0 0 .01V34.1l.09 1.02.99-.11c-.07-.64-.12-1.29-.14-1.93Zm.48 4.22-.98.19c.06.3.12.6.19.9V38.75s0 .03.01.05c.05.2.1.4.15.61l.97-.25c-.16-.62-.3-1.25-.42-1.89Zm1.1 4.1-.94.33c.17.48.35.95.54 1.42s0 .02.01.03 0 0 0 .01c0 0 0 .02.01.03v.02s0 .02.01.03c.03.08.07.17.11.25l.92-.39c-.25-.59-.49-1.2-.7-1.8Zm1.69 3.9-.89.46s0 .01.01.02c0 .01.01.02.02.03.3.57.62 1.13.95 1.68l.85-.52c-.34-.55-.66-1.11-.95-1.68Zm2.25 3.61-.81.59s0 .01.01.02c0 0 .01.02.02.03 0 0 .01.02.02.03 0 .01.02.02.03.03 0 0 .01.02.02.03 0 0 .01.02.02.03 0 0 .01.02.02.03 0 0 .01.02.02.03 0 0 .01.02.02.03 0 0 .01.02.02.02l.01.02s.01.02.02.03c0 0 .01.02.02.03 0 0 .01.02.02.03 0 0 .01.02.02.03 0 .01.02.02.03.03 0 0 .01.02.02.03 0 .01.02.02.03.04 0 0 .01.02.02.03 0 .01.02.02.03.04 0 0 .01.02.02.03.02.02.03.04.05.06.03.04.06.08.1.12.04.05.08.11.13.16.15.19.3.38.46.56l.77-.64c-.41-.49-.81-1.01-1.19-1.52Zm2.74 3.24-.71.7.01.01.02.02.02.02.03.03.02.02.03.03.08.08c.06.06.12.12.18.17s.01.01.02.02l.03.03.02.02.01.01.02.02h.01l.01.01v.01l.02.02h.01l.02.02s.02.01.02.02c.18.17.35.33.54.49l.67-.75c-.48-.43-.95-.88-1.4-1.33Zm3.19 2.81-.6.8c.53.4 1.08.79 1.63 1.16l.55-.83c-.54-.35-1.07-.73-1.58-1.12Zm3.57 2.32-.48.88.12.06s.02.01.03.02c0 0 .02.01.03.02.02.01.05.02.07.04a22.66 22.66 0 0 0 .89.46c.01 0 .03.01.04.02.01 0 .03.01.04.02.01 0 .02 0 .03.01H18.94c.08.04.15.07.23.11l.42-.91a27.7 27.7 0 0 1-1.72-.87Zm3.86 1.77-.35.94H21.75s.02 0 .03.01 0 0 .01 0a22.772 22.772 0 0 0 1.11.37s.02 0 .03 0h.13c.04.01.08.03.13.04l.28-.96c-.62-.18-1.23-.39-1.83-.61Zm4.08 1.18-.21.98.75.15H26.93c.17.03.35.05.52.08l.14-.99c-.64-.09-1.28-.2-1.9-.33Zm4.21.57-.06 1 .55.03H31.23v-1h-.14c-.6 0-1.2-.02-1.8-.05Zm6.17-.28c-.63.1-1.28.17-1.92.23l.08 1c.67-.06 1.33-.13 1.99-.23l-.15-.99Zm4.15-.94c-.61.19-1.24.36-1.87.5l.23.97s.06-.01.09-.02 0 0 .01 0H39.1c.02 0 .03 0 .04-.01.51-.13 1.02-.27 1.53-.42l-.29-.96Zm3.96-1.54c-.58.28-1.18.54-1.77.77l.37.93c.18-.07.35-.14.53-.22.01 0 .02 0 .03-.01 0 0 .02 0 .03-.01 0 0 .02 0 .03-.01h.02s.02 0 .03-.01H43.87s.02 0 .03-.01h.01s.02 0 .03-.01.03-.01.04-.02c.22-.1.44-.2.65-.3 0 0 .02 0 .03-.01s-.43-.9-.43-.9Zm3.69-2.11c-.53.36-1.08.7-1.64 1.02l.5.87c.08-.05.16-.09.24-.14s.02-.01.03-.02 0 0 .01 0h.05s.02-.01.03-.02c0 0 .02-.01.03-.02.4-.24.79-.49 1.18-.75l-.56-.83Zm3.34-2.62c-.47.43-.97.85-1.47 1.25l.62.78c.44-.35.87-.71 1.29-1.09l.02-.02h.01l.01-.01.02-.02.02-.02.02-.02-.67-.74Zm2.93-3.09c-.41.5-.84.99-1.27 1.45l.73.68.02-.02.01-.01.02-.02s.01-.02.02-.02 0 0 .01-.01c.4-.43.79-.88 1.16-1.33l-.77-.63Zm2.45-3.47c-.33.55-.68 1.1-1.05 1.62l.82.57c.38-.55.74-1.11 1.09-1.68l-.86-.51Zm1.91-3.79c-.25.59-.51 1.18-.8 1.76l.9.44c.26-.52.5-1.04.72-1.57 0 0 0-.02.01-.03v-.01s0-.02.01-.03v-.02c.01-.03.03-.06.04-.09l-.92-.38Zm1.33-4.04c-.16.62-.34 1.25-.53 1.86l.95.31.06-.18s0-.03.01-.04 0-.01 0-.01v-.12c.12-.41.24-.82.35-1.23v-.1l-.97-.24Zm.73-4.18c-.06.64-.15 1.28-.25 1.92l.99.16V36.33c.01-.12.03-.25.04-.37l-1-.1Zm1.11-4.3-1 .05c.02.45.03.91.03 1.37v.57l1 .02V32.06c0-.4-.01-.79-.03-1.18Zm-.53-4.37-.98.19c.12.63.23 1.27.31 1.91l.99-.13c-.01-.09-.02-.19-.04-.28s0-.01 0-.02V27.3c-.04-.22-.08-.43-.12-.64Zm-1.15-4.24-.94.33c.21.6.41 1.22.58 1.84l.96-.27c-.18-.65-.38-1.28-.6-1.91Zm-1.77-4.02-.88.47c.3.57.59 1.15.85 1.74l.91-.41v-.02s0-.02-.01-.03c-.18-.39-.37-.78-.56-1.17s-.01-.03-.02-.04c0-.01 0-.02-.02-.03 0-.01 0-.02-.01-.03 0 0 0-.02-.01-.03s0 0 0-.01c0 0 0-.02-.01-.03v-.02s0-.02-.01-.03c0 0 0-.02-.01-.03v-.03s0-.02-.01-.03v-.03s0-.01-.01-.02Zm-2.34-3.72-.81.59c.38.52.75 1.05 1.09 1.59l.84-.54c-.1-.16-.21-.33-.32-.49 0 0-.01-.02-.02-.03 0-.01-.02-.02-.02-.04 0 0-.01-.02-.02-.03 0 0-.01-.02-.02-.03 0 0-.01-.02-.02-.03 0 0-.01-.02-.02-.02 0 0 0-.01-.01-.02 0 0-.01-.02-.02-.02 0 0-.01-.02-.02-.03 0 0-.01-.02-.02-.03 0 0-.01-.02-.02-.03s0-.01-.01-.02c0 0-.01-.02-.02-.03 0 0-.01-.02-.02-.03 0 0-.01-.02-.02-.03 0 0-.01-.02-.02-.03l-.45-.63Zm-2.86-3.34-.71.7c.45.46.89.93 1.31 1.42l.76-.65c-.44-.5-.89-.99-1.36-1.47ZM50.01 8l-.6.8c.51.39 1.02.79 1.51 1.21l.65-.76c-.15-.13-.3-.26-.45-.38s-.02-.01-.02-.02 0 0-.01 0-.02-.01-.02-.02h-.01l-.01-.01h-.03v-.01h-.01s-.01 0-.01-.01c0 0-.02-.01-.02-.02-.01 0-.02-.02-.03-.03-.25-.2-.5-.4-.76-.59Zm-3.7-2.37-.48.88c.56.31 1.12.64 1.67.98l.54-.84s-.06-.04-.08-.05c0 0-.02-.01-.03-.02h-.03s-.02-.01-.03-.02h-.01s-.02-.01-.03-.02c-.35-.22-.7-.43-1.06-.63s-.02-.01-.03-.02h-.05s-.02 0-.03-.01c-.06-.03-.12-.07-.19-.1Zm-4-1.81-.34.94c.6.22 1.21.46 1.79.72l.41-.91c-.06-.03-.11-.05-.17-.08s-.03-.01-.04-.02-.02 0-.03-.01 0 0-.01 0c0 0-.02 0-.03-.01h-.01s-.02 0-.03-.01 0 0-.01 0H43.61s-.02 0-.03-.01h-.01s-.02 0-.03-.01h-.03s-.02 0-.03-.01 0 0-.01 0c-.14-.05-.27-.1-.41-.15Zm-4.23-1.2-.2.98c.63.13 1.26.28 1.88.45l.27-.96c-.64-.18-1.29-.33-1.94-.47Zm-4.36-.57-.06 1c.64.04 1.29.09 1.93.17l.12-.99s-.06 0-.09-.01-.03 0-.05 0h-.34c-.38-.04-.77-.07-1.16-.09Z"/></svg>',
10952                    27: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64"><path d="m13.42 62-1.41-1.41L40.59 32 12.01 3.41 13.42 2l30 30-30 30z"/><path d="m26.7 62-1.41-1.41L53.87 32 25.29 3.41 26.7 2l30 30-30 30z"/></svg>',
10953                }
10954
10955                break;
10956            case 76:
10957                navObj = {
10958                    1:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="m21.06 2-1.41 1.41L54.23 38 19.65 72.59 21.06 74l36-36-36-36z"/></svg>',
10959                    2:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="M38 2C18.12 2 2 18.12 2 38s16.12 36 36 36 36-16.12 36-36S57.88 2 38 2Zm-5.36 54-.85-.85L48.94 38 31.79 20.85l.85-.85 18 18-18 18Z"/></svg>',
10960                    3:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="M2 2v72h72V2H2Zm30.64 54-.85-.85L48.94 38 31.79 20.85l.85-.85 18 18-18 18Z"/></svg>',
10961                    4:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="m74 38-.04-.04-21.17-21.17-1.42 1.41L70.17 37H2v2h68.17L51.38 57.8l1.41 1.41 19.79-19.8h.01L74 38z"/></svg>',
10962                    5:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="M38 3c19.3 0 35 15.7 35 35S57.3 73 38 73 3 57.3 3 38 18.7 3 38 3m0-1C18.12 2 2 18.12 2 38s16.12 36 36 36 36-16.12 36-36S57.88 2 38 2Z"/><path d="m32.64 56-.85-.85L48.94 38 31.79 20.85l.85-.85 18 18-18 18z"/></svg>',
10963                    6:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="M74.5 74.5h-73v-73h73v73Zm-72-1h71v-71h-71v71Z"/><path d="m32.64 56-.85-.85L48.94 38 31.79 20.85l.85-.85 18 18-18 18z"/></svg>',
10964                    7:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="M73.99 38c0-.05 0-.1-.02-.15 0-.03 0-.06-.01-.09 0-.02-.02-.03-.03-.05-.02-.05-.05-.09-.08-.13-.03-.04-.05-.08-.08-.11a.444.444 0 0 0-.11-.08c-.04-.03-.08-.06-.13-.08-.02 0-.03-.02-.05-.03-16.39-5.46-17.91-18.73-17.96-19.3a.75.75 0 0 0-1.49.15c.01.14 1.41 12.65 15.32 19.11H2.75c-.41 0-.75.34-.75.75s.34.75.75.75h66.6c-13.91 6.46-15.3 18.97-15.32 19.11-.04.41.26.78.67.82h.07c.38 0 .71-.29.75-.68.06-.56 1.57-13.83 17.9
109646-19.3 0 0 .01 0 .02-.01a.72.72 0 0 0 .21-.12l.06-.06c.04-.04.08-.09.11-.14.02-.03.03-.06.04-.09 0-.02.02-.03.03-.06 0-.03 0-.06.01-.09.01-.05.02-.1.02-.15Z"/></svg>',
10965                    8:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="m3.19 34.35-.99-.1c0 .07-.01.14-.02.21V34.6c-.05.52-.08 1.04-.11 1.56l1 .05c.03-.65.08-1.3.15-1.94ZM3.01 38.63l-1 .02c.01.67.04 1.34.09 2l1-.07c-.05-.64-.08-1.3-.09-1.94ZM3.89 30.14l-.97-.22-.09.41V30.46c-.07.34-.14.69-.2 1.03s0 0 0 .01v.01c0 .03 0 .05-.01.08v.09l.99.17c.11-.64.24-1.28.38-1.91ZM11.69 62.57l.04.04v.02s.01.02.02.02 0 0 .01.01v.02c.09.09.18.19.27.28s.04.04.05.06v.01s.04.04.05.06 0 .01 0 .01l.02.02v.02l.01.01v.04s0 .01.01.02 0 0 0 .01v.03l.03.03.04.04v.01l.05.05.05.05c.01.01.02.02.04.03l.02.02v.01s.01.02.02.02l.69-.72c-.47-.45-.93-.91-1.37-1.38l-.73.68ZM6.8 22.12l-.89-.45c-.08.16-.17.33-.25.5v.03c0 .01-.01.02-.02.03v.04c0 .02-.02.04-.03.06s0 0 0 .01v.02l-.03.06v.02s-.03.06-.04.09 0 0 0 .01v.01c0 .02-.02.04-.03.06s0 0 0 .01v.02s-.01.03-.02.04 0 0 0 .01v.04s-.01.03-.02.05v.02c-.06.14-.13.28-.19.42l.91.4c.26-.59.54-1.18.83-1.76ZM5.1 26.04l-.94-.34c-.16.43-.3.86-.44 1.3s0 .01 0 .01v.04s0 .03-.01.04 0 .01 0 .01v.03c0 .02-.01.03-.02.05v.02c-.02.08-.05.16-.07.23l.96.29c.19-.62.39-1.24.61-1.84ZM9.55 15.93l.79.61c.4-.51.81-1.01 1.23-1.5l-.75-.66c-.44.5-.86 1.02-1.27 1.54ZM8.89 59.18c.37.5.74.99 1.13 1.47s0 0 0 .01v.01s.01.02.02.02v.01l.77-.63c-.41-.5-.81-1.02-1.19-1.54l-.81.59ZM6.52 55.47c.32.58.66 1.16 1.02 1.72l.85-.53c-.34-.55-.68-1.11-.99-1.67l-.87.49ZM4.19 47.08l-.97.26c.07.28.15.55.23.82v.09c.09.31.19.62.29.92l.95-.31c-.2-.61-.39-1.24-.56-1.86ZM4.62 51.51c.13.31.26.62.39.92s0 0 0 .01v.02c.11.25.23.5.34.75l.9-.43c-.28-.58-.54-1.18-.78-1.78l-.93.38ZM3.34 42.89l-.99.14c.04.28.08.55.13.83s0 0 0 .01c.06.38.13.75.2 1.13l.98-.19c-.12-.63-.23-1.28-.32-1.92ZM8.97 18.44l-.83-.56c-.1.14-.19.28-.28.42 0 0 0 .01-.01.02s0 0 0 .01v.01s-.01.02-.02.03v.04s-.01.02-.02.03 0 0 0 .01v.03s-.02.03-.02.04v.03c-.01.02-.02.03-.03.05v.03s-.02.04-.03.05v.02s-.03.04-.04.07c-.12.19-.23.37-.34.56l.86.51c.33-.55.68-1.11 1.04-1.64ZM66.34 15.79v-.02c0-.01-.02-.02-.03-.04s0 0 0-.01v-.02s-.01-.02-.02-.02 0 0 0-.01v-.01s-.01-.02-.02-.03v-.05s-.01-.02-.02-.02V15.5s-.01-.02-.02-.02c0 0-.02-.02-.02-.03v-.01c-.01-.01-.02-.03-.03-.04s-.03-.03-.04-.05c-.02-.02-.03-.04-.05-.06-.1-.12-.21-.25-.32-.37s-.03-.04-.05-.06c-.01-.02-.03-.03-.04-.05l-.75.66c.43.48.84.99 1.24 1.5l.79-.62ZM70.87 23.31c-.16-.37-.33-.73-.51-1.08v-.03c0-.01-.01-.02-.02-.03s0-.01 0-.01v-.01s0-.02-.01-.03 0 0 0-.01v-.02c-.08-.17-.17-.33-.25-.5l-.89.46c.3.57.58 1.16.84 1.75l.91-.41ZM68.84 19.41c-.2-.33-.4-.65-.61-.97s-.03-.05-.05-.08-.03-.05-.05-.08v-.01c-.01-.02-.02-.04-.04-.05v-.01c0-.02-.02-.03-.03-.04v-.02l-.03-.04c-.01-.02-.02-.03-.03-.04v-.01s-.02-.04-.04-.06v-.01c-.01-.02-.03-.04-.04-.06v-.01c0-.01-.01-.02-.02-.03l-.83.56c.36.53.72 1.08 1.05 1.64l.86-.52ZM71.46 27.72l.96-.29c-.1-.31-.19-.62-.3-.92s-.02-.06-.03-.09v-.02s-.02-.05-.02-.07v-.03s-.01-.04-.02-.06 0 0 0-.01v-.03s-.01-.04-.02-.06 0 0 0-.01v-.01c-.06-.18-.13-.35-.19-.53l-.94.35c.22.61.43 1.22.62 1.84ZM72.95 36.12l1-.05c-.01-.28-.03-.56-.05-.84s0-.08 0-.11V34.57l-.99.11c.07.64.12 1.29.16 1.94ZM72.47 31.87l.98-.17c-.12-.66-.25-1.31-.4-1.96l-.97.23c.15.63.28 1.27.39 1.9ZM38 3c.59 0 1.18.01 1.77.04l.05-1c-.45-.02-.91-.04-1.36-.04H37.85c-.24 0-.48.01-.72.02H36.99c-.11 0-.22.01-.33.02l.05 1c.64-.04 1.3-.05 1.94-.05ZM33.73 3.26l-.12-.99c-.26.03-.51.07-.77.1H32.6s-.05 0-.08.01 0 0-.01 0h-.03c-.2.03-.39.06-.58.1l.18.98c.63-.11 1.28-.21 1.92-.29ZM52.59 5.08s-.02 0-.02-.01h-.03c-.59-.26-1.18-.5-1.79-.73l-.35.94c.6.23 1.21.48 1.8.74l.41-.91ZM25.45 5.32l-.36-.93c-.18.07-.37.14-.55.22-.03.01-.06.02-.09.04h-.07s-.02 0-.03.01h-.04c-.02 0-.04.02-.06.02h-.02s-.06.02-.09.04h-.02s-.05.02-.07.03 0 0-.01 0h-.01c-.02.01-.05.02-.07.03h-.04s-.02 0-.03.01h-.02c-.02 0-.03.01-.05.02h-.03c-.05.02-.1.04-.15.07l.41.91c.59-.26 1.19-.52 1.79-.75ZM29.53 4.03l-.24-.97c-.33.08-.67.17-1 .26h-.04s-.03 0-.04.01 0 0-.01 0h-.04s-.04.01-.06.02h-.02c-.18.05-.36.11-.55.16l.3.96c.62-.19 1.25-.37 1.87-.52ZM48.47 3.55c-.26-.08-.52-.16-.79-.23h-.03c-.02 0-.04-.01-.06-.02h-.05c-.01 0-.02 0-.04-.01H47.38c-.01 0-.03 0-.04-.01s0 0-.01 0h-.04s-.03 0-.04-.01 0 0-.01 0h-.04s-.03 0-.05-.01 0 0-.01 0h-.04s-.03 0-.05-.01 0 0-.01 0H47l-.24.97c.63.15 1.26.32 
109651.87.51l.29-.96ZM44.19 2.53h-.05c-.02 0-.04 0-.07-.01h-.02c-.57-.1-1.15-.18-1.74-.25h-.02l-.12.99c.64.07 1.29.17 1.92.28l.17-.99ZM26.3 72.06c.08.03.15.05.23.08h.02c.02 0 .03.01.05.02h.08c.11.04.22.07.33.11s0 0 .01 0c.02 0 .05.02.07.02h.08c.01 0 .03 0 .04.01h.03c.25.08.5.15.76.22l.27-.96c-.62-.17-1.25-.37-1.86-.58l-.32.95ZM59.09 65.93l.6.8h.01v-.01h.02l.02-.02h.02c.01 0 .02-.02.04-.03s0 0 .01 0h.02s.05-.04.07-.06c.39-.31.78-.62 1.16-.95l-.65-.76c-.49.42-1 .83-1.52 1.22ZM65.23 59.99l.78.63V60.43s.01-.02.02-.02v-.03s.01-.02.02-.02c0 0 .01-.02.02-.02s0 0 0-.01v-.01s.01-.02.02-.02 0 0 0-.01v-.01s.02-.03.03-.04 0 0 0-.01v-.01c0-.01.02-.02.03-.04s0 0 0-.01v-.01s.01-.02.02-.03 0 0 0-.01-.81-.59-.81-.59c-.38.52-.77 1.04-1.18 1.55ZM62.34 63.15l.7.72c.31-.3.61-.6.9-.91s0 0 0-.01.01-.02.02-.02c0 0 .02-.02.02-.03.12-.12.23-.25.35-.37l-.73-.68c-.44.47-.9.94-1.36 1.39ZM63.42 12.5l-.21-.21v-.02l-.01-.01c-.37-.36-.75-.72-1.14-1.06l-.67.75c.48.43.96.88 1.41 1.33l.71-.71ZM56.49 7.11c-.16-.1-.33-.19-.49-.29h-.01l-.06-.03h-.01c-.02 0-.03-.02-.05-.03l-.06-.03h-.01l-.06-.03h-.02c-.02-.01-.05-.03-.07-.04h-.01c-.26-.15-.52-.29-.79-.43l-.47.88c.57.3 1.14.62 1.69.95l.51-.86ZM60.12 9.59h-.01c-.3-.24-.61-.47-.92-.69s0 0-.01 0c0 0-.02-.01-.03-.02-.17-.12-.34-.25-.52-.37l-.57.82c.53.37 1.06.76 1.57 1.15l.61-.79ZM55.53 68.3l.5.87c.43-.25.86-.51 1.28-.78s0 0 .01 0 .04-.03.07-.04 0 0 .01 0h.02s.03-.02.04-.03h.02s.02-.01.03-.02c.02-.01.03-.02.05-.03l-.55-.84c-.54.35-1.1.7-1.65 1.02ZM67.71 56.51l.85.53c.05-.08.1-.17.16-.25v-.03s.01-.02.02-.03v-.04s.01-.02.02-.03 0 0 0-.01V56.55s.01-.02.02-.03 0 0 0-.01v-.02s.02-.03.02-.04v-.03c.12-.21.24-.43.36-.64l-.88-.48c-.31.57-.64 1.13-.98 1.68ZM73 38.45c0 .65-.03 1.3-.08 1.94l1 .07c0-.11.01-.23.02-.34s0-.01 0-.01v-.02c.03-.46.04-.92.05-1.38s0 0 0-.01v-.04h-1ZM72.37 44.64l.98.19V44.7l.09-.51v-.04c0-.02 0-.05.01-.07V43.97c.05-.3.09-.6.13-.9l-.99-.13c-.09.64-.19 1.29-.31 1.92ZM71.31 48.78l.95.31c.09-.28.18-.57.26-.86s0 0 0-.01c0-.03.02-.05.02-.08v-.03c0-.01 0-.02.01-.03V48c0-.02 0-.03.01-.05v-.03l.09-.34-.97-.25c-.16.62-.35 1.25-.55 1.87ZM69.75 52.76l.91.42.03-.06v-.07c.16-.35.32-.7.46-1.06s0 0 0-.01v-.03s.01-.03.02-.04v-.18l-.93-.37c-.24.6-.5 1.2-.77 1.78ZM16.7 8.97s-.02.01-.02.02h-.01c-.28.21-.57.43-.84.64l.62.79c.51-.4 1.03-.79 1.56-1.16l-.57-.82c-.22.15-.43.31-.65.46ZM20.23 6.68h-.01c-.02.01-.04.02-.05.03s0 0-.01 0h-.03s-.03.02-.04.02h-.02s-.02.01-.03.02c0 0-.01 0-.02.01s-.01 0-.02.01h-.02s-.03.02-.04.02h-.02s-.04.02-.05.03l.52.85c.55-.33 1.12-.66 1.69-.96l-.47-.88c-.29.15-.58.31-.86.48ZM30.54 73.23l.27.06h.09c.49.1.99.18 1.49.26l.15-.99c-.64-.1-1.28-.21-1.91-.35l-.21.98ZM18.41 68.21l.57.36h.01c.02.01.03.02.05.03s0 0 .01 0h.03s.02.01.03.02h.03s.02.01.03.02c.01 0 .02.01.03.02l.06.03h.02c.14.08.28.16.41.24l.5-.87c-.56-.32-1.12-.66-1.66-1.01l-.54.84ZM14.88 65.59c.2.16.39.33.59.49s0 0 .01 0h.02s.02.02.04.03h.01c.01.01.03.02.04.03.24.19.47.37.71.55l.6-.8c-.52-.39-1.03-.79-1.52-1.21l-.64.77ZM13.29 11.82l-.01.01-.01.01-.03.03-.01.01s-.01.02-.02.02 0 0 0 .01h-.01l-.02.02c-.02.01-.03.03-.05.05-.15.15-.31.3-.46.46l.71.7c.45-.46.93-.91 1.41-1.34l-.67-.74c-.21.19-.42.38-.62.57ZM22.24 70.38c.09.04.18.09.27.13H22.57c.02 0 .03.01.05.02h.03c.44.2.88.4 1.32.59l.39-.92c-.59-.25-1.19-.52-1.77-.8l-.44.9ZM34.89 73.87l.74.06H36.58l.03-1c-.65-.02-1.3-.06-1.94-.11l-.09 1ZM47.68 71.64l.28.96.41-.12H48.43c.02 0 .03-.01.05-.02h.03c.42-.13.83-.26 1.24-.41l-.33-.94c-.61.21-1.23.41-1.85.59ZM51.71 70.21l.39.92c.2-.09.4-.17.6-.26s0 0 .01 0h.04c.35-.16.71-.33 1.05-.5l-.44-.9c-.58.29-1.17.56-1.77.81ZM43.51 72.57l.16.99c.19-.03.39-.06.58-.1s0 0 .01 0h.01c.03 0 .05 0 .08-.01H44.48s.04 0 .06-.01 0 0 .01 0h.03c.27-.05.53-.11.79-.16l-.21-.98c-.63.14-1.27.26-1.91.36ZM39.25 72.98l.04 1c.15 0 .29-.01.44-.02s0 0 .01 0H39.96l.89-.06h.18l-.09-1c-.64.06-1.29.1-1.94.12ZM41.9 27.31 52.09 37.5H22v1h30.09L41.9 48.69l.7.71L54 38 42.6 26.6l-.7.71z"/></svg>',
10966                    9:  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="m30.85 2-.9.43L47.04 38 29.95 73.57l.9.43 17.3-36-17.3-36z"/></svg>',
10967                    10: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="M74 38c0-.19-.04-.38-.11-.55-.09-.22-.23-.41-.4-.57L53.02 16.41c-.57-.57-1.5-.57-2.08 0l-.04.04c-.57.57-.57 1.5 0 2.08L68.87 36.5H3.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5h65.37L50.9 57.47c-.57.57-.57 1.5 0 2.08l.04.04c.57.57 1.5.57 2.08 0l20.47-20.47c.18-.15.32-.35.41-.57.07-.17.11-.35.11-.55Z"/></svg>',
10968                    11: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="m56.31 36.94-34.5-34.5c-.59-.59-1.54-.59-2.12 0s-.59 1.54 0 2.12L53.13 38 19.69 71.44a1.49 1.49 0 0 0 0 2.12c.29.29.68.44 1.06.44s.77-.15 1.06-.44l34.5-34.5c.59-.59.59-1.54 0-2.12Z"/></svg>',
10969                    12: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="M58.01 34.54 26.91 3.43C25.99 2.51 24.76 2 23.45 2s-2.54.51-3.46 1.43c-.92.92-1.43 2.15-1.43 3.46s.51 2.54 1.43 3.46l27.64 27.64-27.64 27.64c-.92.92-1.43 2.15-1.43 3.46s.51 2.54 1.43 3.46c.92.92 2.15 1.43 3.46 1.43s2.54-.51 3.46-1.43l31.1-31.1c.92-.92 1.43-2.15 1.43-3.46s-.51-2.54-1.43-3.46Zm-1.06 5.86-31.1 31.1c-1.28 1.28-3.52 1.28-4.8 0-.64-.64-1-1.49-1-2.4s.35-1.76 1-2.4l28.17-28.17c.29-.29.29-.77 0-1.06L21.05 9.3c-.64-.64-1-1.49-1-2.4s.35-1.76 1-2.4 1.49-1 2.4-1 1.76.35 2.4 1l31.1 31.1c.64.64 1 1.49 1 2.4s-.35 1.76-1 2.4Z"/></svg>',
10970                    13: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76">
10970<path d="m74 38-.01-.02L68 32 47 11H31.09l21 21H2v12h50.09l-21 21H47l19.05-19.05L68 44l6-6z"/></svg>',
10971                    14: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="m67.6 38-.01-.02L31.6 2H10.39L46.4 38l-36 36h21.2L57 48.6 67.61 38h-.01z"/></svg>',
10972                    15: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="m46.5 38-.02-.01L18.5 10H2l28 28L2 66h16.5l19.75-19.75L46.5 38z"/><path d="M73.99 37.99 46 10H29.5l28 28-28 28H46l19.75-19.75L74 38l-.01-.01z"/></svg>',
10973                    16: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="M74 38c0-.07-.01-.13-.04-.19 0-.02-.02-.03-.03-.05a.284.284 0 0 0-.08-.11L39.56 3.35c-.2-.2-.51-.2-.71 0s-.2.51 0 .71L72.3 37.51H2.5c-.28 0-.5.22-.5.5s.22.5.5.5h69.79L38.85 71.95c-.2.2-.2.51 0 .71a.485.485 0 0 0 .7 0l34.29-34.29s.09-.11.12-.17c.02-.04.02-.09.03-.13 0-.02.01-.04.01-.06Z"/></svg>',
10974                    17: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="m54.38 28.38-.71.7L71.59 47H2v1h72L54.38 28.38z"/></svg>',
10975                    18: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="M59.23 34.06 26.04 3.43c-3.43-3.17-8.99-.73-8.99 3.94v61.26c0 4.67 5.56 7.11 8.99 3.94l33.18-30.63c2.3-2.12 2.3-5.75 0-7.88Z"/></svg>',
10976                    19: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="M19.5 2v72l39-36-39-36z"/></svg>',
10977                    20: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="M38 2C18.12 2 2 18.12 2 38s16.12 36 36 36 36-16.12 36-36S57.88 2 38 2Zm-7 54V20l20 18-20 18Z"/></svg>',
10978                    21: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="M2 2v72h72V2H2Zm29 54V20l20 18-20 18Z"/></svg>',
10979                    22: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="M74 38 48 13v24H2v2h46v24l26-25z"/></svg>',
10980                    23: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="M38 3c19.3 0 35 15.7 35 35S57.3 73 38 73 3 57.3 3 38 18.7 3 38 3m0-1C18.12 2 2 18.12 2 38s16.12 36 36 36 36-16.12 36-36S57.88 2 38 2Z"/><path d="M51 38 31 20v36l20-18z"/></svg>',
10981                    24: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="M73 3v70H3V3h70m1-1H2v72h72V2Z"/><path d="M51 38 31 20v36l20-18z"/></svg>',
10982                    25: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="M69.76 33.93 62.56 27 48 13v14H2v22h46v14l14.56-14 7.2-6.93L74 38l-4.24-4.07z"/></svg>',
10983                    26: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="M51 38 31 20v36l20-18zM38 2H37.66c-.24 0-.48.01-.72.02H36.8c-.11 0-.22.01-.33.02l.05 1c.64-.04 1.3-.05 1.94-.05v-1Zm-4.39.26c-.26.03-.51.07-.77.1H32.6s-.05 0-.08.01 0 0-.01 0h-.02c-.2.03-.39.06-.58.1l.18.98c.63-.11 1.28-.21 1.92-.29l-.12-.99Zm-4.32.8c-.33.08-.67.17-1 .26h-.04s-.03 0-.04.01 0 0-.01 0h-.03c-.02 0-.04.01-.06.02h-.02c-.18.05-.36.11-.55.16l.3.96c.62-.19 1.25-.37 1.87-.52l-.24-.97Zm-4.2 1.32c-.18.07-.37.14-.55.22s-.06.02-.09.04h-.07s-.02 0-.03.01h-.04c-.02 0-.04.02-.06.02h-.02s-.06.02-.09.04h-.02s-.05.02-.07.03 0 0-.01 0h-.01c-.02.01-.05.02-.07.03h-.04s-.02 0-.03.01h-.02c-.02 0-.03.01-.05.02h-.03c-.05.02-.1.04-.15.07l.41.91c.59-.26 1.19-.52 1.79-.75l-.36-.93Zm-4 1.83c-.29.15-.58.31-.86.48s0 0-.01 0c-.02.01-.04.02-.05.03s0 0-.01 0h-.03s-.03.02-.04.02h-.02s-.02.01-.03.02c0 0-.01 0-.02.01 0 0-.01 0-.02.01h-.02s-.03.02-.04.02h-.02s-.04.02-.05.03l.52.85c.55-.33 1.12-.66 1.69-.96l-.47-.88Zm-3.75 2.3c-.22.15-.43.31-.64.46 0 0-.02.01-.02.02h-.01c-.28.21-.57.43-.84.64l.62.79c.51-.4 1.03-.79 1.56-1.16l-.57-.82Zm-3.43 2.74c-.21.19-.42.38-.62.57s0 0-.01.01l-.01.01-.03.03-.01.01s-.01.02-.02.02h-.01l-.02.02c-.02.01-.03.03-.05.05-.15.15-.31.3-.46.46l.71.7c.45-.46.93-.91 1.41-1.34l-.67-.74Zm-3.09 3.14c-.44.5-.86 1.02-1.27 1.54l.79.61c.4-.51.81-1.01 1.23-1.5l-.75-.66Zm-2.67 3.49c-.1.14-.19.28-.28.42 0 0 0 .01-.01.02v.01s-.01.02-.02.03v.03s-.01.02-.02.03 0 0 0 .01v.03s-.02.03-.02.04v.03c-.01.02-.02.03-.03.05v.03s-.02.04-.03.05 0 .01 0 .01v.01s-.03.04-.04.07c-.12.19-.23.37-.34.56l.86.51c.33-.55.68-1.11 1.04-1.64l-.83-.56Zm-2.24 3.78c-.08.16-.17.33-.25.5v.03c0 .01-.01.02-.02.03v.04c0 .02-.02.04-.03.06s0 0 0 .01v.02l-.03.06v.02s-.03.06-.04.09 0 0 0 .01v.01l-.03.06v.03s-.01.03-.02.04 0 0 0 .01v.04c0 .02-.01.03-.02.05v.02c-.06.14-.13.28-.19.42l.91.4c.26-.59.54-1.18.83-1.76l-.89-.45ZM4.16 25.7c-.16.43-.3.86-.44 1.3s0 .01 0 .01v.04s0 .03-.01.04 0 .01 0 .01v.03c0 .02-.01.03-.02.05v.02c-.02.08-.05.16-.07.23l.96.29c.19-.62.39-1.24.61-1.84l-.94-.34Zm-1.25 4.21-.09.41V30.43c-.07.34-.14.69-.2 
109831.03s0 0 0 .01v.01c0 .03 0 .05-.01.08v.07l.99.17c.11-.64.24-1.28.38-1.91l-.97-.22Zm-.72 4.34c0 .07-.01.14-.02.21v.14c-.05.52-.08 1.04-.11 1.56l1 .05c.03-.65.08-1.3.15-1.94l-.99-.1Zm.82 4.38-1 .02c.01.67.04 1.34.09 2l1-.07c-.05-.64-.08-1.3-.09-1.94Zm.33 4.26-.99.14c.04.28.08.55.13.83s0 0 0 .01c.06.38.13.75.2 1.13l.98-.19c-.12-.63-.23-1.28-.32-1.92Zm.85 4.19-.97.26c.07.28.15.55.23.82v.09c.09.31.19.62.29.92l.95-.31c-.2-.61-.39-1.24-.56-1.86Zm1.36 4.05-.93.38c.13.31.26.62.39.92s0 0 0 .01v.02c.11.25.23.5.34.75l.9-.43c-.28-.58-.54-1.18-.78-1.78Zm1.84 3.86-.87.49c.32.58.66 1.16 1.02 1.72l.85-.53c-.34-.55-.68-1.11-.99-1.67Zm2.3 3.6-.81.59c.37.5.74.99 1.13 1.47s0 0 0 .01v.01s.01.02.02.02v.02l.77-.63c-.41-.5-.81-1.02-1.19-1.54Zm2.73 3.3-.73.68.04.04v.02s.01.02.02.02 0 0 .01.01v.02c.09.09.18.19.27.28s.04.04.05.06v.01s.04.04.05.06.01.02.02.02l.01.01.01.01.03.03.04.04.05.05c.02.01.03.03.05.04.01.01.02.02.04.03l.02.02v.01s.01.02.02.02l.69-.72c-.47-.45-.93-.91-1.37-1.38Zm3.1 2.94-.64.77c.2.16.39.33.59.49s0 0 .01 0h.02s.02.02.04.03h.01c.01.01.03.02.04.03.24.19.47.37.71.55l.6-.8c-.52-.39-1.03-.79-1.52-1.21Zm3.44 2.54-.54.84.57.36H19c.02.01.03.02.05.03s0 0 .01 0h.03s.02.01.03.02h.03s.02.01.03.02c.01 0 .02.01.03.02l.06.03h.02c.14.08.28.16.41.24l.5-.87c-.56-.32-1.12-.66-1.66-1.01Zm3.72 2.11-.44.9c.09.04.18.09.27.13H22.57c.02 0 .03.01.05.02h.03c.44.2.88.4 1.32.59l.39-.92c-.59-.25-1.19-.52-1.77-.8Zm3.95 1.63-.32.95c.08.03.15.05.23.08s0 0 .01 0h.01c.02 0 .03.01.05.02h.08c.11.04.22.07.33.11s0 0 .01 0c.02 0 .05.02.07.02h.08c.01 0 .03 0 .04.01h.03c.25.08.5.15.76.22l.27-.96c-.62-.18-1.25-.37-1.86-.58Zm4.12 1.14-.21.98.27.06h.09c.49.1.99.18 1.49.26l.15-.99c-.64-.1-1.28-.21-1.91-.35Zm4.23.62-.09 1 .74.06H36.58l.03-1c-.65-.02-1.3-.06-1.94-.11Zm6.22-.01c-.64.06-1.29.1-1.94.12l.04 1c.15 0 .29-.01.44-.02s0 0 .01 0h.21l.89-.06h.18l-.09-1Zm4.22-.65c-.63.14-1.27.26-1.91.36l.16.99c.19-.03.39-.06.58-.1s0 0 .01 0h.01c.03 0 .05 0 .08-.01H44.48s.04 0 .06-.01 0 0 .01 0h.03c.27-.05.53-.11.79-.16l-.21-.98Zm4.12-1.16c-.61.21-1.23.41-1.85.59l.28.96.41-.12H48.44c.02 0 .03-.01.05-.02h.03c.42-.13.83-.26 1.24-.41l-.33-.94Zm3.94-1.65c-.58.29-1.17.56-1.77.81l.39.92c.2-.09.4-.17.6-.26s0 0 .01 0h.04c.35-.16.71-.33 1.05-.5l-.44-.9Zm3.71-2.12c-.54.35-1.1.7-1.65 1.02l.5.87c.43-.25.86-.51 1.28-.78s0 0 .01 0 .04-.03.07-.04 0 0 .01 0h.02s.03-.02.04-.03h.02s.02-.01.03-.02c.02-.01.03-.02.05-.03l-.55-.84Zm3.42-2.56c-.49.42-1 .83-1.52 1.22l.6.8h.03s.02-.01.02-.02h.02c.01 0 .02-.02.04-.03s0 0 .01 0h.02s.05-.04.07-.06c.39-.31.78-.62 1.16-.95l-.65-.76Zm3.09-2.96c-.44.47-.9.94-1.36 1.39l.7.72c.31-.3.61-.6.9-.91s0 0 0-.01.01-.02.02-.02c0 0 .02-.02.02-.03.12-.12.23-.25.35-.37l-.73-.68Zm2.71-3.31c-.38.52-.77 1.04-1.18 1.55l.78.63v-.09s.01-.02.02-.02v-.03s.01-.02.02-.02 0-.01 0-.01.01-.02.02-.02 0 0 0-.01v-.01s.01-.02.02-.02 0 0 0-.01v-.01s.02-.03.03-.04 0 0 0-.01v-.01c0-.01.02-.02.03-.04s0 0 0-.01v-.01s.01-.02.02-.03 0 0 0-.01-.81-.59-.81-.59Zm2.28-3.61c-.31.57-.64 1.13-.98 1.68l.85.53c.05-.08.1-.17.16-.25v-.03s.01-.02.02-.03v-.04s.01-.02.02-.03v-.07s.01-.02.02-.03 0 0 0-.01v-.02s.02-.03.02-.04v-.03c.12-.21.24-.43.36-.64l-.88-.48Zm1.83-3.87c-.24.6-.5 1.2-.77 1.78l.91.42.03-.06v-.07c.16-.35.32-.7.46-1.06s0 0 0-.01v-.03s.01-.03.02-.04V51.78l-.93-.37Zm1.34-4.06c-.16.62-.35 1.25-.55 1.87l.95.31c.09-.28.18-.57.26-.86v-.01c0-.03.02-.05.02-.08v-.03c0-.01 0-.02.01-.03v-.07c0-.02 0-.03.01-.05v-.03l.09-.34-.97-.25Zm.82-4.19c-.09.64-.19 1.29-.31 1.92l.98.19v-.12l.09-.51v-.04c0-.02 0-.05.01-.07V44c.05-.3.09-.6.13-.9l-.99-.13Zm.32-4.27c0 .65-.03 1.3-.08 1.94l1 .07c0-.11.01-.23.02-.34s0-.01 0-.01v-.02c.03-.46.04-.92.05-1.38v-.05h-1Zm.79-4.38-.99.11c.07.64.12 1.29.16 1.94l1-.05c-.01-.28-.03-.56-.05-.84V34.58Zm-.74-4.33-.97.23c.15.63.28 1.27.39 1.9l.98-.17c-.12-.66-.25-1.31-.4-1.96Zm-1.27-4.21-.94.35c.22.61.43 1.22.62 1.84l.96-.29c-.1-.31-.19-.62-.3-.92s-.02-.06-.03-.09v-.02c0-.02-.02-.05-.02-.07v-.03c0-.02-.01-.04-.02-.06s0 0 0-.01v-.03s-.01-.04-.02-.06 0 0 0-.01v-.01c-.06-.18-.13-.35-.19-.53Zm-1.77-4.03-.89.46c.3.57.58 1.16.84 1.75l.91-.41c-.16-.37-.33-.73-.51-1.08v-.03c0-.01-.01-.02-.02-.03v-.01s0-.02-.01-.03 0 0 0-.01v-.02
10983c-.08-.17-.17-.33-.25-.5Zm-2.26-3.77-.83.56c.36.53.72 1.08 1.05 1.64l.86-.52c-.2-.33-.4-.65-.61-.97-.02-.03-.03-.05-.05-.08-.02-.03-.03-.05-.05-.08v-.01c-.01-.02-.02-.04-.04-.05v-.01c0-.02-.02-.03-.03-.04v-.02c0-.01-.02-.03-.03-.04s0 0 0-.01c-.01-.02-.02-.03-.03-.04v-.01c-.01-.02-.02-.04-.04-.05v-.01c-.01-.02-.03-.04-.04-.06s0 0 0-.01-.01-.02-.02-.03Zm-2.69-3.48-.75.66c.43.49.84.99 1.24 1.5l.79-.62v-.02s-.02-.02-.03-.04 0 0 0-.01v-.02s-.01-.02-.02-.02 0 0 0-.01-.01-.02-.02-.03v-.05s-.01-.02-.02-.02v-.04s-.01-.02-.02-.02c0 0-.02-.02-.02-.03-.01-.01-.02-.03-.03-.04-.01-.02-.03-.03-.04-.05-.02-.02-.03-.04-.05-.06-.1-.12-.21-.25-.32-.37-.02-.02-.03-.04-.05-.06-.01-.02-.03-.03-.04-.05Zm-3.1-3.12-.67.75c.48.43.96.88 1.41 1.33l.71-.71-.21-.21v-.01l-.01-.01c-.37-.36-.75-.72-1.14-1.06Zm-3.45-2.72-.57.82c.53.37 1.06.76 1.57 1.15l.61-.79h-.01c-.3-.24-.61-.47-.92-.69s0 0-.01 0c0 0-.02-.01-.03-.02-.17-.12-.34-.25-.52-.37Zm-3.76-2.28-.47.88c.57.3 1.14.62 1.69.95l.51-.86c-.16-.1-.33-.19-.49-.29h-.01l-.06-.03h-.01c-.02 0-.03-.02-.05-.03l-.06-.03h-.01l-.06-.03h-.02c-.02-.01-.05-.03-.07-.04h-.01c-.26-.15-.52-.29-.79-.43Zm-4.01-1.81-.35.94c.6.23 1.21.48 1.8.74l.41-.91s-.02 0-.02-.01h-.03c-.59-.26-1.18-.5-1.79-.73Zm-4.2-1.3-.24.97c.63.15 1.26.32 1.87.51l.29-.96c-.26-.08-.52-.16-.79-.23h-.03c-.02 0-.04-.01-.06-.02h-.05c-.01 0-.02 0-.04-.01H47.37c-.01 0-.03 0-.04-.01s0 0-.01 0h-.04s-.03 0-.04-.01 0 0-.01 0h-.04s-.03 0-.05-.01 0 0-.01 0h-.04s-.03 0-.05-.01 0 0-.01 0h-.04Zm-4.33-.78-.12.99c.64.07 1.29.17 1.92.28l.17-.99h-.04c-.02 0-.04 0-.07-.01h-.02c-.57-.1-1.15-.18-1.74-.25h-.02ZM38 2v1c.59 0 1.18.01 1.77.04l.05-1c-.45-.02-.91-.04-1.36-.04H38.3Z"/></svg>',
10984                    27: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="76" height="76"><path d="m14.06 2-1.41 1.41L47.23 38 12.65 72.59 14.06 74l36-36-36-36z"/><path d="m30.06 2-1.41 1.41L63.23 38 28.65 72.59 30.06 74l36-36-36-36z"/></svg>',
10985                }
10986                break;
10987        }
10988        let navigation = '<div class="slider-nav-btn prev invisible navsize'+size+'">' + navObj[n] + '</div><div class="slider-nav-btn next invisible navsize'+size+'">' + navObj[n] + '</div>';
10989        return navigation;
10990    }
10991
10992    function enableContentsSlider(el_seq, type, settings) {
10993        let enableBlocks = {
10994            'contents': ["contents6", "contents7", "contents8", "contents11", "contents12", "contents13", "contents16",
10995                "contents17", "contents18", "contents19", "contents20", "contents21", "contents41", "contents42",
10996                "contents43", "contents44", "contents45", "contents46", "contents47", "contents48", "contents49",
10997                "contents50", "contents51", "contents52", "contents53", "contents54", "contents55", "contents61", "contents62", "contents63",
10998                "contents67","contents68", "contents69", "contents73", "contents74", "contents75", "contents77", "contents78",
10999                "contents79", "contents80", "contents81", "contents82", "contents83", "contents84", "contents85",
11000                "contents97", "contents98", "contents99", "contents102", "contents103", "contents104", "contents106",
11001                "contents107", "contents108", "contents134", "contents137", "contents138"],
11002            'text': ['text1', 'text33', 'text35', 'text36', 'text37', 'text38', 'text40', 'text41', 'text42','text43',
11003                'text44', 'text46', 'text49', 'text51', 'text52', 'text53', 'text57', 'text58', 'text59', 'text60',
11004                'text61', 'text62', 'text63', 'text67', 'text68', 'text70', 'text79', 'text80', 'text82', 'text84',
11005                'text85', 'text86', 'text88', 'text104'],
11006            'image': ['image1', 'image2', 'image3', 'image4', 'image5', 'image6', 'image7', 'image8', 'image9', 'image10',
11007                'image11', 'image12', 'image13', 'image14', 'image15', 'image16', 'image17', 'image18', 'image19', 'image20',
11008                'image21', 'image22', 'image23', 'image24', 'image25', 'image26', 'image27', 'image29', 'image30', 'image31',
11009                'image32', 'image33', 'image34', 'image35', 'image-sample1'],
11010            'video': ['video1', 'video5', 'video7', 'video-grid2', 'video15', 'video16', 'video17', 'video20', 'video21', 'video22'],
11011            'sns': ['social23', 'social24', 'social26', 'social27', 'social28', 'social29', 'social30', 'social31', 'social32', 'social33'],
11012        }
11013
11014        let blockorg = $('.element[data-id="' + el_seq + '"]').attr('data-case');
11015        if(typeof settings != 'undefined' && settings && typeof settings.blockorg != 'undefined' && settings.blockorg) blockorg = settings.blockorg;
11016
11017        let flag = false;
11018        if(typeof enableBlocks[type] != 'undefined' && enableBlocks[type].indexOf(blockorg) > -1) {
11019            flag = true;
11020        }
11021
11022        if(type == 'contents' && $('.element[data-id="' + el_seq + '"]').find('[data-clone-loop]').length > 0) {
11023            flag = false;
11024        }
11025        if(type == 'video' && $('.element[data-id="' + el_seq + '"]').find('.lyoption').length == 0) {
11026            flag = false;
11027        }
11028        if($.inArray(type, ['contents', 'text', 'image', 'sns']) > -1 && $('.element[data-id="' + el_seq + '"]').find('[data-matrix-loop] .item').length == 0) {
11029            flag = false;
11030        }
11031        
11032        return flag;
11033    }
11034
11035    function isObjectEmpty(obj) {
11036        return Object.values(obj).every(value => {
11037            if (typeof value === 'object' && !Array.isArray(value)) {
11038                return isObjectEmpty(value);
11039            }
11040            return value === null || value === undefined || value === '';
11041        });
11042    }
11043
11044    // 이미지/텍스트 슬라이드 함수
11045    function sliderClean(select) {
11046        // console.log(select);
11047        $(select).find('.swiper-slide-duplicate').remove();
11048		$(select).find('.swiper-notification').remove();
11049        $(select).find('.swiper-slide-invisible-blank').remove();
11050        $(select).find('.swiper-slide.delete').remove();
11051    }
11052    
11053    function sliderModify(slide) {
11054        document.querySelector(slide).swiper.destroy();
11055		slider(slide);
11056    }
11057
11058    function sliderUnitModify(slide) {
11059        document.querySelector(slide).swiper.destroy();
11060		sliderUnit(slide);
11061    }
11062
11063    // function textSliderModify(slide) {
11064    //     document.querySelector(slide).swiper.destroy();
11065	// 	textSlider(slide);
11066    // }
11067
11068    //showcase logoSlide
11069    var sswiper;
11070    var uswiper;
11071    var tswiper;
11072
11073    //이미지 / 텍스트 슬라이드 미리보기///////////////////////////
11074    // $(window).resize(function(){
11075    //     slideshow();
11076    //     textslideshow();
11077    // });
11078
11079    function slideshow() {
11080        new Swiper( '.logoSlide', { slidesPerView: 'auto', simulateTouch: false, loop: true, speed: 5000, autoplay: { delay: 0, disableOnInteraction: false, }, });
11081    }
11082    function textslideshow() {
11083        new Swiper( '.reviewSlide', { slidesPerView: 'auto', simulateTouch: false, loop: true, speed: 7000, autoplay: { delay: 0, disableOnInteraction: false, }, });
11084    }
11085    ///////////////////////////////////////////////////////////
11086
11087    //showcase logoSlide(flow)
11088    function slider(t) {
11089        var elem = document.querySelector(t).children[0];
11090        if($(elem).hasClass('cl-ns-wrap')) return false;
11091        let ss = $(elem).attr('data-scroll-speed');
11092        
11093        // let mleft = $(elem).find('.item:eq(0)').css('margin-left').replace(/[^0-9]/g, "");
11094        var w = $(window).width();
11095        // if(w < 991) $(elem).find('.swiper-slide').css('margin-left', (mleft / 3) + 'px');
11096        // if(w < 767) $(elem).find('.swiper-slide').css('margin-left', (mleft / 4) + 'px');
11097        // if(w < 480) $(elem).find('.swiper-slide').css('margin-left', 0 + 'px');
11098        let space = Number($(elem).attr('slide-space'));
11099        if(w < 767) { //모바일버전 간격조정
11100            if(space == 1) $(elem).find('.swiper-slide:not(.bmove)').css('margin-left', '0px');
11101            else $(elem).find('.swiper-slide:not(.bmove)').css('margin-left', (space * 10 - 10) +'px');
11102        }
11103
11104        if (ss == 1000) {
11105            sswiper = new Swiper( t, { slidesPerView: 'auto', allowTouchMove: false, simulateTouch: false, loop: true, speed: 1000, autoplay: { delay: 0, disableOnInteraction: false, }, });
11106        } else if (ss == 1500) {
11107            sswiper = new Swiper( t, { slidesPerView: 'auto', allowTouchMove: false, simulateTouch: false, loop: true, speed: 1500, autoplay: { delay: 0, disableOnInteraction: false, }, });
11108        } else if (ss == 2200) {
11109            sswiper = new Swiper( t, { slidesPerView: 'auto', allowTouchMove: false, simulateTouch: false, loop: true, speed: 2200, autoplay: { delay: 0, disableOnInteraction: false, }, });
11110        } else if (ss == 3000) {
11111            sswiper = new Swiper( t, { slidesPerView: 'auto', allowTouchMove: false, simulateTouch: false, loop: true, speed: 3000, autoplay: { delay: 0, disableOnInteraction: false, }, });
11112        } else if (ss == 5000) {
11113            sswiper = new Swiper( t, { slidesPerView: 'auto', allowTouchMove: false, simulateTouch: false, loop: true, speed: 5000, autoplay: { delay: 0, disableOnInteraction: false, }, });
11114        } else {
11115            sswiper = new Swiper( t, { slidesPerView: 'auto', allowTouchMove: false, simulateTouch: false, loop: true, speed: 7000, autoplay: { delay: 0, disableOnInteraction: false, }, });
11116        }
11117    }
11118
11119    //showcase logoSlide(unit)
11120    function sliderUnit(t) {
11121        if($(t).find('.item').length == 0 || $(t).hasClass('cl-not-supported') || $(t).find('.cl-ns-wrap').length > 0) return false;
11122
11123        var elem = document.querySelector(t).children[0];
11124        $(elem).find('.item').removeAttr('style');
11125        let ss = $(elem).attr('data-scroll-speed');
11126        let unit = Number($(elem).attr('data-page-unit'));
11127        let delay = Number($(elem).attr('data-delay-time'));
11128        let slide_time = Number($(elem).attr('data-slide-time'));
11129        var newTransitionDuration = slide_time;
11130        var option = { slidesPerView : 1, loop : true, slidesPerGroup : 1, loopFillGroupWithBlank : true, allowTouchMove: false, simulateTouch: false, autoplay : { delay : delay, disableOnInteraction : false}};
11131        option['speed'] = newTransitionDuration * 1000;
11132        option['slidesPerView'] = Number(unit);
11133        option['slidesPerGroup'] = Number(unit);
11134        if(unit == 5) {
11135            option['breakpoints'] = { 320 : { slidesPerView : 4, slidesPerGroup : 4 }, 767 : { slidesPerView : 4, slidesPerGroup : 4 }, 991 : { slidesPerView : 5, slidesPerGroup : 5 }};
11136        } else if(unit == 6) {
11137            option['breakpoints'] = { 320 : { slidesPerView : 4, slidesPerGroup : 4 }, 767 : { slidesPerView : 4, slidesPerGroup : 4 }, 991 : { slidesPerView : 6, slidesPerGroup : 6 }};
11138        } else if(unit == 7) {
11139            option['breakpoints'] = { 320 : { slidesPerView : 4, slidesPerGroup : 4 }, 767 : { slidesPerView : 4, slidesPerGroup : 4 }, 991 : { slidesPerView : 7, slidesPerGroup : 7 }};
11140        } else if(unit == 8) {
11141            option['breakpoints'] = { 320 : { slidesPerView : 4, slidesPerGroup : 4 }, 767 : { slidesPerView : 4, slidesPerGroup : 4 }, 991 : { slidesPerView : 8, slidesPerGroup : 8 }};
11142        } else if(unit == 9) {
11143            option['breakpoints'] = { 320 : { slidesPerView : 4, slidesPerGroup : 4 }, 767 : { slidesPerView : 4, slidesPerGroup : 4 }, 991 : { slidesPerView : 9, slidesPerGroup : 9 }};
11144        } else if(unit == 10) {
11145            option['breakpoints'] = { 320 : { slidesPerView : 4, slidesPerGroup : 4 }, 767 : { slidesPerView : 4, slidesPerGroup : 4 }, 991 : { slidesPerView : 10, slidesPerGroup : 10 }};
11146        } else {
11147            option['breakpoints'] = { 320 : { slidesPerView : 4, slidesPerGroup : 4 }, 767 : { slidesPerView : 4, slidesPerGroup : 4 }, 991 : { slidesPerView : 4, slidesPerGroup : 4 }};
11148        }
11149        new Swiper(t, option);
11150
11151    }
11152
11153    //showcase textSlide
11154    function textSlider(t) {
11155        var parent = document.querySelector(t);
11156        if (!parent || parent.children.length === 0) return false;
11157
11158        var elem = parent.children[0];
11159        // if($(elem).hasClass('cl-ns-wrap')) return false;
11160        if($(t).find('.item').length == 0 || $(t).hasClass('cl-not-supported') || $(t).find('.cl-ns-wrap').length > 0) return false;
11161        let ts = $(elem).attr('data-scroll-speed');
11162        if(ts == 3000){
11163            tswiper = new Swiper( t, { watchSlidesProgress: true, slidesPerView: 'auto', allowTouchMove: false, simulateTouch: false, loop: true, speed: 3000, autoplay: { delay: 0, disableOnInteraction: false, }, });
11164        } else if(ts == 5000){
11165            tswiper = new Swiper( t, { watchSlidesProgress: true, slidesPerView: 'auto', allowTouchMove: false, simulateTouch: false, loop: true, speed: 5000, autoplay: { delay: 0, disableOnInteraction: false, }, });
11166        } else if (ts == 7000) {
11167            tswiper = new Swiper( t, { watchSlidesProgress: true, slidesPerView: 'auto', allowTouchMove: false, simulateTouch: false, loop: true, speed: 7000, autoplay: { delay: 0, disableOnInteraction: false, }, });
11168        } else if (ts == 9000) {
11169            tswiper = new Swiper( t, { watchSlidesProgress: true, slidesPerView: 'auto', allowTouchMove: false, simulateTouch: false, loop: true, speed: 9000, autoplay: { delay: 0, disableOnInteraction: false, }, });
11170        } else if (ts == 12000) {
11171            tswiper = new Swiper( t, { watchSlidesProgress: true, slidesPerView: 'auto', allowTouchMove: false, simulateTouch: false, loop: true, speed: 12000, autoplay: { delay: 0, disableOnInteraction: false, }, });
11172        } else {
11173            tswiper = new Swiper( t, { watchSlidesProgress: true, slidesPerView: 'auto', allowTouchMove: false, simulateTouch: false, loop: true, speed: 8
11173000, autoplay: { delay: 0, disableOnInteraction: false, }, });
11174        }
11175
11176        $(tswiper.$el).data('tswiper', tswiper);
11177    }
11178}
11179
11180function updateTabArrowState(el, motion, tab_len, motion_style, tab_count) {
11181    var $tab = $('.'+el);
11182    if($tab.length == 0) return;
11183
11184    var mobile_tab_line = $tab.attr('mobile-tab-line'),
11185        navi_use = $tab.attr('navigation-use'),
11186        tab_line = ($(window).width() < 991 && typeof mobile_tab_line != 'undefined' && mobile_tab_line) ? mobile_tab_line : $tab.attr('tab-line'),
11187        max_motion = 0;
11188
11189    tab_len = Number(tab_len);
11190    tab_count = Number(tab_count);
11191    motion = Number(motion);
11192    if(isNaN(motion)) motion = 0;
11193
11194    if($(window).width() > 991 && navi_use != "1") {
11195        $tab.find('.left-arrow, .right-arrow, .left-arrow .arrow, .right-arrow .arrow').addClass('hide');
11196        return;
11197    }
11198
11199    if(!tab_len || !tab_count || tab_line != 1 || tab_len <= tab_count) {
11200        $tab.find('.left-arrow, .right-arrow, .left-arrow .arrow, .right-arrow .arrow').addClass('hide');
11201        return;
11202    }
11203
11204    if(motion_style == 1) max_motion = Math.max(tab_len - tab_count, 0);
11205    else max_motion = Math.max(Math.ceil(tab_len / tab_count) - 1, 0);
11206
11207    if(motion < 0) motion = 0;
11208    if(motion > max_motion) motion = max_motion;
11209
11210    $tab.find('.left-arrow, .right-arrow, .left-arrow .arrow, .right-arrow .arrow').removeClass('hide');
11211    $tab.find('.left-arrow, .left-arrow .arrow').toggleClass('hide', motion <= 0);
11212    $tab.find('.right-arrow, .right-arrow .arrow').toggleClass('hide', motion >= max_motion);
11213}
11214
11215function getTabMotionMargin(el, target_index) {
11216    var $tab = $('.'+el),
11217        $tabBox = $tab.find('.tab-box'),
11218        $tabs = $tabBox.find('.tab:not(.hover)'),
11219        $target = $tabs.eq(target_index),
11220        $last = $tabs.last(),
11221        $tabBoxOut = $tab.find('.tab-box-out').eq(0),
11222        left_overlap = 0,
11223        right_overlap = 0;
11224
11225    if($target.length == 0) return 0;
11226    if($tabBoxOut.length == 0) $tabBoxOut = $tabBox.parent();
11227
11228    var box_left = $tabBoxOut.offset().left,
11229        box_right = box_left + $tabBoxOut.outerWidth(),
11230        $leftArrow = $tab.find('.left-arrow:not(.hide)').eq(0),
11231        $rightArrow = $tab.find('.right-arrow:not(.hide)').eq(0);
11232
11233    if($leftArrow.length > 0) {
11234        left_overlap = Math.max(0, ($leftArrow.offset().left + $leftArrow.outerWidth()) - box_left);
11235    }
11236    if($rightArrow.length > 0) {
11237        right_overlap = Math.max(0, box_right - $rightArrow.offset().left);
11238    }
11239
11240    var visible_left = left_overlap,
11241        visible_right = $tabBoxOut.innerWidth() - right_overlap,
11242        content_width = $last.position().left + $last.outerWidth(),
11243        margin = visible_left - $target.position().left,
11244        min_margin = visible_right - content_width,
11245        max_margin = visible_left;
11246
11247    if(content_width > (visible_right - visible_left)) {
11248        margin = Math.max(min_margin, Math.min(max_margin, margin));
11249    }
11250
11251    return margin;
11252}
11253
11254function getTabMotionBounds(el) {
11255    var $tab = $('.'+el),
11256        $tabBox = $tab.find('.tab-box'),
11257        $tabs = $tabBox.find('.tab:not(.hover)'),
11258        $last = $tabs.last(),
11259        $tabBoxOut = $tab.find('.tab-box-out').eq(0),
11260        left_overlap = 0,
11261        right_overlap = 0;
11262
11263    if($tab.length == 0 || $last.length == 0) return {min:0, max:0};
11264    if($tabBoxOut.length == 0) $tabBoxOut = $tabBox.parent();
11265
11266    var box_left = $tabBoxOut.offset().left,
11267        box_right = box_left + $tabBoxOut.outerWidth(),
11268        $leftArrow = $tab.find('.left-arrow:not(.hide)').eq(0),
11269        $rightArrow = $tab.find('.right-arrow:not(.hide)').eq(0);
11270
11271    if($leftArrow.length > 0) {
11272        left_overlap = Math.max(0, ($leftArrow.offset().left + $leftArrow.outerWidth()) - box_left);
11273    }
11274    if($rightArrow.length > 0) {
11275        right_overlap = Math.max(0, box_right - $rightArrow.offset().left);
11276    }
11277
11278    var visible_left = left_overlap,
11279        visible_right = $tabBoxOut.innerWidth() - right_overlap,
11280        content_width = $last.position().left + $last.outerWidth(),
11281        visible_width = visible_right - visible_left,
11282        min_margin = visible_right - content_width,
11283        max_margin = visible_left;
11284
11285    if(content_width <= visible_width) min_margin = max_margin;
11286
11287    return {
11288        min: Math.min(min_margin, max_margin),
11289        max: max_margin
11290    };
11291}
11292
11293function getTabSwipeOption($tab) {
11294    var w = $(window).width(),
11295        mobile_tab_line = $tab.attr('mobile-tab-line'),
11296        mobile_tab_count = $tab.attr('mobile-tab-count'),
11297        tab_counted = $tab.attr('tab-count'),
11298        tab_line = (w < 991 && typeof mobile_tab_line != 'undefined' && mobile_tab_line) ? mobile_tab_line : $tab.attr('tab-line'),
11299        tab_count = (w < 991) ? ((typeof mobile_tab_count != 'undefined' && mobile_tab_count) ? mobile_tab_count : ((tab_counted > 4) ? 4 : tab_counted)) : tab_counted,
11300        tab_len = $tab.find('.tab-box .tab:not(.hover)').length,
11301        motion = Number($tab.attr('tab-motion'));
11302
11303    if(isNaN(motion)) motion = 0;
11304    tab_count = Number(tab_count);
11305
11306    return {
11307        el: $tab.attr('data-name'),
11308        tab_line: tab_line,
11309        tab_count: tab_count,
11310        tab_len: tab_len,
11311        motion: motion,
11312        motion_style: $tab.attr('tab-motion-style') || 1,
11313        tab_case: $tab.attr('data-case')
11314    };
11315}
11316
11317function getTabMotionByMargin(el, margin, motion_style, tab_count, tab_len) {
11318    var $tabs = $('.'+el).find('.tab-box .tab:not(.hover)'),
11319        bounds = getTabMotionBounds(el),
11320        target_left = bounds.max - margin,
11321        motion = 0,
11322        max_motion = 0;
11323
11324    tab_count = Number(tab_count);
11325    tab_len = Number(tab_len);
11326
11327    if(motion_style == 1) max_motion = Math.max(tab_len - tab_count, 0);
11328    else max_motion = Math.max(Math.ceil(tab_len / tab_count) - 1, 0);
11329
11330    if(margin <= bounds.min + 1) return max_motion;
11331    if(margin >= bounds.max - 1) return 0;
11332
11333    $tabs.each(function(i){
11334        if($(this).position().left <= target_left + 1) motion = i;
11335    });
11336
11337    if(motion_style == 1) {
11338        motion = Math.min(motion, max_motion);
11339    } else {
11340        motion = Math.floor(motion / tab_count);
11341        motion = Math.min(motion, max_motion);
11342    }
11343
11344    return Math.max(0, motion);
11345}
11346
11347(function(){
11348    $(document)
11349        .on('touchstart.tabSwipe', '.tabs .tab-box', function(e) {
11350            if($(window).width() >= 991) return;
11351
11352            var touch = e.originalEvent.touches && e.originalEvent.touches[0],
11353                $tab = $(this).closest('.tabs'),
11354                option = getTabSwipeOption($tab);
11355
11356            if(!touch || !option.el || option.tab_line != 1 || !option.tab_count || option.tab_len <= option.tab_count) return;
11357
11358            $(this).stop(true, true);
11359            $tab.data('tabSwipe', {
11360                active: true,
11361                locked: false,
11362                horizontal: false,
11363                moved: false,
11364                el: option.el,
11365                motion: option.motion,
11366                motion_style: option.motion_style,
11367                tab_count: option.tab_count,
11368                tab_len: option.tab_len,
11369                tab_case: option.tab_case,
11370                startX: touch.pageX,
11371                startY: touch.pageY,
11372                startMargin: parseFloat($(this).css('margin-left')) || 0,
11373                lastX: touch.pageX,
11374                lastTime: new Date().getTime(),
11375                velocityX: 0
11376            });
11377        })
11378        .on('touchmove.tabSwipe', '.tabs .tab-box', function(e) {
11379            var touch = e.originalEvent.touches && e.originalEvent.touches[0],
11380                $tab = $(this).closest('.tabs'),
11381                swipe = $tab.data('tabSwipe');
11382
11383            if(!touch || !swipe || !swipe.active) return;
11384
11385            var diff_x = touch.pageX - swipe.startX,
11386                diff_y = touch.pageY - swipe.startY;
11387
11388            if(!swipe.locked && (Math.abs(diff_x) > 8 || Math.abs(diff_y) > 8)) {
11389                swipe.locked = true;
11390                swipe.horizontal = Math.abs(diff_x) > Math.abs(diff_y);
11391            }
11392
11393            if(!swipe.horizontal) return;
11394
11395            e.preventDefault();
11396            swipe.moved = Math.abs(diff_x) > 10;
11397
11398            var bounds = getTabMotionBounds(swipe.el),
11399                margin = swipe.startMargin + diff_x;
11400
11401            margin = Math.max(bounds.min, Math.min(bounds.max, margin));
11402            $(this).css('margin-left', margin+'px');
11403
11404            var now = new Date().getTime(),
11405                time_diff = now - swipe.lastTime;
11406
11407            if(time_diff > 0) swipe.velocityX = (touch.pageX - swipe.lastX) / time_diff;
11408            swipe.lastX = touch.pageX;
11409            swipe.lastTime = now;
11410        })
11411        .on('touchend.tabSwipe touchcancel.tabSwipe', '.tabs .tab-box', function(e) {
11412            var $tab = $(this).closest('.tabs'),
11413                swipe = $tab.data('tabSwipe');
11414
11415            if(!swipe || !swipe.active) return;
11416
11417            if(!swipe.horizontal) {
11418                $tab.removeData('tabSwipe');
11419                return;
11420            }
11421
11422            var bounds = getTabMotionBounds(swipe.el),
11423                margin = parseFloat($(this).css('margin-left'));
11424
11425            if(isNaN(margin)) margin = swipe.startMargin;
11426            margin = Math.max(bounds.min, Math.min(bounds.max, margin));
11427
11428            if(swipe.moved) {
11429                $tab.data('tabSwipeBlockClick', true);
11430                setTimeout(function(){
11431                    $tab.removeData('tabSwipeBlockClick');
11432                }, 300);
11433            }
11434
11435            var glide = (e.type == 'touchcancel') ? 0 : swipe.velocityX * 220,
11436                glide_limit = 240,
11437                end_margin = margin + Math.max(-glide_limit, Math.min(glide_limit, glide)),
11438                duration = Math.min(420, Math.max(160, Math.abs(end_margin - margin) * 1.6));
11439
11440            end_margin = Math.max(bounds.min, Math.min(bounds.max, end_margin));
11441
11442            var motion = getTabMotionByMargin(swipe.el, end_margin, swipe.motion_style, swipe.tab_count, swipe.tab_len);
11443            $('.'+swipe.el).attr('tab-motion', motion);
11444            updateTabArrowState(swipe.el, motion, swipe.tab_len, swipe.motion_style, swipe.tab_count);
11445
11446            if(Math.abs(end_margin - margin) > 2) {
11447                $(this).stop(true, true).animate({marginLeft : end_margin+'px'}, duration);
11448            } else {
11449                $(this).css('margin-left', end_margin+'px');
11450            }
11451            $tab.removeData('tabSwipe');
11452        })
11453        .on('click.tabSwipe', '.tabs .tab-box .tab', function(e) {
11454            if($(this).closest('.tabs').data('tabSwipeBlockClick')) {
11455                e.preventDefault();
11456                e.stopImmediatePropagation();
11457                return false;
11458            }
11459        });
11460})();
11461
11462// var cur = 0;
11463function tabMotion(el, motion, wh, len, motion_style, tab_count, tab_case, tab_counted) {
11464    tab_counted = (typeof tab_counted != 'undefined') ? tab_counted : '';
11465    // console.log('el: '+el+', motion: '+motion+', width: '+wh+', len: '+len+', motion_style: '+motion_style+', tab_count: '+tab_count+', tab_case: '+tab_case+', tab_counted: '+tab_counted);
11466
11467    var mobile_tab_line = $('.'+el).attr('mobile-tab-line');
11468    var tab_line  = ($(window).width() < 991 && typeof mobile_tab_line != 'undefined' && mobile_tab_line) ? mobile_tab_line : $('.'+el).attr('tab-line');
11469    var tab_len = $('.'+el).find('.tab-box .tab:not(.hover)').length,
11470        max_motion = (motion_style == 1) ? Math.max(Number(tab_len) - Number(tab_count), 0) : Math.max(Math.ceil(Number(tab_len) / Number(tab_count)) - 1, 0);
11471
11472    motion = Number(motion);
11473    if(isNaN(motion)) motion = 0;
11474    if(motion < 0) motion = 0;
11475    if(motion > max_motion) motion = max_motion;
11476    $('.'+el).attr('tab-motion', motion);
11477    updateTabArrowState(el, motion, tab_len, motion_style, tab_count);
11478
11479    var cur = 0,
11480        cur = cur + motion;
11481
11482    if(tab_case == 'tab6') {
11483        var num = Number(tab_count) + Number(motion);
11484        $('.'+el).find('.tab-box .tab').removeClass('line');
11485        $('.'+el).find('.tab-box .tab').addClass('line');
11486        if(motion_style == 1) {
11487            $('.'+el).find('.tab-box .tab').removeClass('hide-line');
11488            $('.'+el).find('.tab-box .tab:eq('+ num +')').addClass('hide-line');
11489            $('.'+el).find('.tab-box .tab:eq('+ motion +')').addClass('hide-line');
11490        } else {
11491            var line_r = Number(tab_count) + (Number(motion) * Number(tab_count)),
11492                line_l = Number(tab_count) * Number(motion);
11493            $('.'+el).find('.tab-box .tab').removeClass('hide-line');
11494            $('.'+el).find('.tab-box .tab:eq('+ line_r +')').addClass('hide-line');
11495            $('.'+el).find('.tab-box .tab:eq('+ line_l +')').addClass('hide-line');
11496        }
11497    }
11498    
11499    if(cur >= len) cur = 0;
11500    else if(cur < 0) cur = len - 1;
11501
11502
11503
11504    if(tab_line == 1) {
11505        if(motion_style == 1) {
11506            var margin = getTabMotionMargin(el, motion);
11507            $('.'+el).find('.tab-box').animate({marginLeft : margin+'px'});
11508        } else {
11509            var margin = getTabMotionMargin(el, Number(motion) * Number(tab_count));
11510            $('.'+el).find('.tab-box').animate({marginLeft : margin+'px'});
11511        }
11512    }
11513}
11514
11515function tabArrow(el) {
11516    //resize는 블럭script에서 처음 로드시 실행
11517    var w = $(window).width(),
11518        h = $('.'+el).attr("tab-height"),
11519        h991 = 80 / 100 * h,
11520        h767 = 60 / 100 * h,
11521        navi_use = $('.'+el).attr("navigation-use"),
11522        mobile_tab_line = $('.'+el).attr("mobile-tab-line"),
11523        mobile_tab_count = $('.'+el).attr("mobile-tab-count"),
11524        tab_line = (w < 991 && typeof mobile_tab_line != 'undefined' && mobile_tab_line) ? mobile_tab_line : $('.'+el).attr("tab-line"),
11525        tab_count = (w < 991 && typeof mobile_tab_count != 'undefined' && mobile_tab_count) ? mobile_tab_count : 4,
11526        tab_len = $('.'+el).find(".tab-box .tab:not(.hide)").length,
11527        tab_width = $('.'+el).find(".tab-width");
11528    if(w < 991 && w > 767) {
11529        $('.'+el+' .tab-box').css("min-height", h991 + "px");
11530        $('.'+el+' .tab').css("min-height", h991 + "px");
11531        if(tab_line == "1" && tab_len > Number(tab_count)) {
11532            tab_width.find(".arrow-box").removeClass("hide").find(".arrow").removeClass("hide").find(".before, .after").css({"display":"flex","align-items":"center"});
11533            updateTabArrowState(el, $('.'+el).attr('tab-motion'), tab_len, $('.'+el).attr('tab-motion-style'), tab_count);
11534        } else tab_width.find(".arrow-box").addClass("hide").find(".arrow").addClass("hide").find(".before, .after").css("display", "");
11535    } else if(w <= 767) {
11536        $('.'+el+' .tab-box').css("min-height", h767 + "px");
11537        $('.'+el+' .tab').css("min-height", h767 + "px");
11538        if(tab_line == "1" && tab_len > Number(tab_count)) {
11539            tab_width.find(".arrow-box").removeClass("hide").find(".arrow").removeClass("hide").find(".before, .after").css({"display":"flex","align-items":"center"});
11540            updateTabArrowState(el, $('.'+el).attr('tab-motion'), tab_len, $('.'+el).attr('tab-motion-style'), tab_count);
11541        } else tab_width.find(".arrow-box").addClass("hide").find(".arrow").addClass("hide").find(".before, .after").css("display", "");
11542    } else if(w > 991) {
11543        $('.'+el+' .tab-box').css("min-height", h + "px");
11544        $('.'+el+' .tab').css("min-height", h + "px");
11545        if(navi_use == "0" && tab_len > 4 && tab_line == "1") tab_width.find(".arrow-box").addClass("hide").find(".arrow").addClass("hide").find(".before, .after").css("display", "");
11546        else if(navi_use == "1" && tab_line == "1" && tab_len > Number($('.'+el).attr("tab-count"))) {
11547            tab_width.find(".arrow-box").removeClass("hide").find(".arrow").removeClass("hide").find(".before, .after").css({"display":"flex","align-items":"center"});
11548            updateTabArrowState(el, $('.'+el).attr('tab-motion'), tab_len, $('.'+el).attr('tab-motion-style'), $('.'+el).attr("tab-count"));
11549        }
11550    }
11551}
11552
11553// history-block line align
11554function lineAlign(el) {
11555    var $el = $('.'+el);
11556
11557    if(!$el.length) return;
11558
11559    var $dots = $el.find('.timeline-box > .timeline-dot, .timeline-item .timeline-dot').filter(':visible'),
11560        $firstDot = $dots.first(),
11561        $lastDot = $dots.last(),
11562        $timelineLines = $el.find('.timeline-item .timeline-line'),
11563        $sampleLine = $timelineLines.first(),
11564        $lineWrap = $el.find('.timeline-items').first(),
11565        lineWidth = parseFloat($sampleLine.css('width')) || parseFloat($sampleLine.outerWidth()) || 1,
11566        lineColor = $sampleLine.css('background-color') || $sampleLine.css('border-left-color') || '#b7aa9b',
11567        isSideNav = $('.dsgn-body').hasClass('sidebar')
11568            || $('body').is('[data-clnav-layout="sidenav"]')
11569            || $('.cl-nav[data-layout="sidenav"], header[data-layout="sidenav"]').length > 0;
11570    if(!$lineWrap.length) $lineWrap = $el;
11571    if($lineWrap[0] !== $el[0]) $el.children('.history-timeline-line').remove();
11572
11573    var $line = $lineWrap.children('.history-timeline-line');
11574
11575    if(lineColor == 'rgba(0, 0, 0, 0)' || lineColor == 'transparent') {
11576        lineColor = $sampleLine.css('border-left-color') || '#b7aa9b';
11577    }
11578
11579    if(isSideNav) {
11580        $el.find('.history-timeline-line').remove();
11581        if($el.is('[data-history-line-position="true"]')) $el.removeAttr('data-history-line-position').css('position', '');
11582        $timelineLines.show();
11583        return;
11584    }
11585
11586    $timelineLines.hide();
11587
11588    if($dots.length < 2) {
11589        $line.remove();
11590        return;
11591    }
11592
11593    if(!$line.length) {
11594        $line = $('<div class="history-timeline-line" data-runtime="history-line"></div>').prependTo($lineWrap);
11595    }
11596
11597    if($lineWrap[0] === $el[0] && $el.css('position') == 'static') $el.attr('data-history-line-position', 'true').css('position', 'relative');
11598
11599    var elOffset = $lineWrap.offset(),
11600        firstCenterX = $firstDot.offset().left + ($firstDot.outerWidth() / 2),
11601        firstCenterY = $firstDot.offset().top + ($firstDot.outerHeight() / 2),
11602        lastCenterY = $lastDot.offset().top + ($lastDot.outerHeight() / 2),
11603        left = Math.round(firstCenterX - elOffset.left - (lineWidth / 2)),
11604        top = Math.round(firstCenterY - elOffset.top),
11605        height = Math.max(Math.round(lastCenterY - firstCenterY), 0);
11606
11607    $line.css({
11608        position: 'absolute',
11609        left: left+'px',
11610        top: top+'px',
11611        width: lineWidth+'px',
11612        height: height+'px',
11613        backgroundColor: lineColor,
11614        zIndex: 0,
11615        pointerEvents: 'none'
11616    });
11617}
11618
11619function getHistoryBlockLineAlignName($block) {
11620    var el = $block.attr('data-name'),
11621        match;
11622
11623    if(!el) {
11624        match = ($block.attr('class') || '').match(/(?:^|\s)(userEL\d+)(?:\s|$)/);
11625        el = (match) ? match[1] : '';
11626    }
11627
11628    return el;
11629}
11630
11631function lineAlignHistoryBlocks(scope) {
11632    var $scope = (scope) ? $(scope) : $(document),
11633        selector = '[data-type="contents"][data-type2="history"], .history-block';
11634
11635    $scope.find(selector).addBack(selector).each(function() {
11636        var el = getHistoryBlockLineAlignName($(this));
11637        if(el) lineAlign(el);
11638    });
11639}
11640
11641$(window).on('load resize', function() {
11642    clearTimeout(window._historyLineAlignTimer);
11643    window._historyLineAlignTimer = setTimeout(function() {
11644        lineAlignHistoryBlocks();
11645    }, 100);
11646});
11647
11648$(function() {
11649    setTimeout(function() {
11650        lineAlignHistoryBlocks();
11651    }, 100);
11652    setTimeout(function() {
11653        lineAlignHistoryBlocks();
11654    }, 500);
11655});
11656
11657$(document).on('load', '[data-type="contents"][data-type2="history"] img, .history-block img', function() {
11658    lineAlignHistoryBlocks($(this).closest('[data-type="contents"][data-type2="history"], .history-block'));
11659});
11660
11661$(document).ajaxComplete(function() {
11662    setTimeout(function() {
11663        lineAlignHistoryBlocks();
11664    }, 100);
11665    setTimeout(function() {
11666        lineAlignHistoryBlocks();
11667    }, 500);
11668});
11669
11670function channelTalkHide(isHide) {        
11671    if(isHide) {
11672        $('#ch-plugin, .cl-cts-banner').fadeOut().attr('style','z-index: 1 !important; pointer-events: none !important;');
11673    } else {
11674        $('#ch-plugin, .cl-cts-banner').fadeIn().attr('style','z-index: 10000000 !important; pointer-events: auto !important;');
11675    }
11676}
11677
11678window.onload = function() {
11679    var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ? true : false,
11680        scroll_body = '.dashbottom-wrap',
11681        scrollTarget = document.querySelector('.dashbottom-wrap');
11682
11683    switch(this_page) {
11684        case 'plan':
11685        case 'billing':
11686            scroll_body = '.sub.sub-page';
11687            scrollTarget = document.querySelector('.sub.sub-page');
11688            break;
11689        
11690        case 'message':
11691            scroll_body = 'html';
11692            scrollTarget = window;
11693            break;
11694
11695        default:
11696            break;
11697    }
11698
11699    if(scrollTarget != null) {
11700        scrollTarget.addEventListener('scroll', function(e) {
11701            if($('#ch-plugin, .cl-cts-banner').length == 0) return;
11702            var isScrollAtBottom = (($(scroll_body).outerHeight() + $(scroll_body).scrollTop() + (isMobile ? 10 : 0)) >=  $(scroll_body).get(0).scrollHeight) ? true : false;
11703            // $('#popup-title').html('<p style="font-size: 9px;">'+isScrollAtBottom+' = '+($(scroll_body).outerHeight() + $(scroll_body).scrollTop() + (isMobile ? 10 : 0))+' >= '+$(scroll_body).get(0).scrollHeight+'</p>');
11704            if (isScrollAtBottom) {
11705                if(!$('body').is('.channelTalkHide')) {
11706                    $('body').addClass('channelTalkHide');
11707                    channelTalkHide(true);
11708                }
11709            } else {
11710                if($('body').is('.channelTalkHide')) {
11711                    $('body').removeClass('channelTalkHide');
11712                    channelTalkHide(false);
11713                }
11714            }
11715        });
11716    }
11717
11718    if(this_page == 'settings' && typeof faviconPreload == 'function') faviconPreload();
11719
11720    if(this_page == 'manager') {
11721        $('.member_disabled, .dropdown.member_disabled + svg').off('click');
11722        $('.member_disabled, .dropdown.member_disabled + svg').on('click', function(e){
11723            e.preventDefault();
11724            e.stopPropagation();
11725            if(!$('#flat-modal').length) siteNotice('manager');
11726            return false;
11727        });
11728        $('select.member_disabled').off('mousedown');
11729        $('select.member_disabled').on('mousedown', function(e){
11730            e.preventDefault();
11731            e.stopPropagation();
11732            if(!$('#flat-modal').length) siteNotice('manager');
11733            return false;
11734        });
11735    }
11736    if(this_page == 'shopping') {
11737        $('.shopping_disabled').off('click');
11738        $('.shopping_disabled').on('click', function(e){
11739            e.preventDefault();
11740            e.stopPropagation();
11741            if(!$('#flat-modal').length) siteNotice('shopping');
11742            return false;
11743        });
11744    }
11745}
11746
11747function emojiEncode(text) {
11748    // 이모지만을 포함하는 정규 표현식
11749    var emojiRegex = /[\u{1F300}-\u{1F5FF}\u{1F600}-\u{1F64F}\u{1F680}-\u{1F6FF}\u{1F700}-\u{1F77F}\u{1F780}-\u{1F7FF}\u{1F800}-\u{1F8FF}\u{1F900}-\u{1F9FF}\u{1FA00}-\u{1FA6F}\u{2600}-\u{26FF}\u{2700}-\u{27BF}\u{2B50}\u{2B55}]/gu;
11750    
11751    // 입력 텍스트에서 이모지만을 추출하여 배열로 저장
11752    var emojis = text.match(emojiRegex) || [];
11753
11754    // 이모지를 유니코드 이스케이프로 변환하고, 이를 원래 위치에 대체
11755    emojis.forEach(function(emoji) {
11756        var codePoints = [];
11757        for (var i = 0; i < emoji.length; i++) {
11758            codePoints.push('\\u' + emoji.charCodeAt(i).toString(16));
11759        }
11760        text = text.replace(emoji, codePoints.join(''));
11761    });
11762
11763    return text;
11764}
11765
11766function emojiDecode(escapedString) {
11767    return escapedString.replace(/\\u[\dA-F]{4}/gi, match => String.fromCharCode(parseInt(match.replace(/\\u/g, ''), 16)));
11768}
11769
11770function focusAtEnd(input) {
11771    input.focus();
11772    var value = input.val();
11773    input.val('');
11774    input.val(value);
11775}
11776
11777function clCheckBrowser(browser) {
11778    if(typeof browser == 'undefined' || !browser) return false;
11779
11780    var is_tablet = /Android|iPad/i.test(navigator.userAgent);
11781    var is_mobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
11782    var is_pc = !is_mobile && !is_tablet;
11783    var is_chrome = /Chrome|CriOS/i.test(navigator.userAgent);
11784    var is_safari = /Safari/i.test(navigator.userAgent) && !/Chrome|CriOS/i.test(navigator.userAgent);
11785    var is_firefox = /Firefox/i.test(navigator.userAgent);
11786    var is_edge = /Edg/i.test(navigator.userAgent) || /Edge/i.test(navigator.userAgent);
11787    var is_opera = /OPR/i.test(navigator.userAgent) || /Opera/i.test(navigator.userAgent);
11788    var is_ie = /MSIE/i.test(navigator.userAgent) || /Trident/i.test(navigator.userAgent);
11789    var is_kakao = /KAKAOTALK/i.test(navigator.userAgent);
11790
11791    switch(browser.trim().toLowerCase()) {
11792        case 'tablet': return is_tablet; break;
11793        case 'mobile': return is_mobile; break;
11794        case 'pc': return is_pc; break;
11795
11796        case 'chrome': return is_chrome; break;
11797        case 'safari': return is_safari; break;
11798        case 'firefox': return is_firefox; break;
11799        case 'edge': return is_edge; break;
11800        case 'opera': return is_opera; break;
11801        case 'ie': return is_ie; break;
11802        case 'kakao': return is_kakao; break;
11803
11804        default: return false; break;
11805    }
11806}
11807
11808function hasTouch() {
11809    // Android Phone|iPhone|iPad|Touch-enabled laptop 
11810    return navigator.maxTouchPoints > 0;
11811}
11812function isIOS() {
11813    const ua = navigator.userAgent;
11814    // 기본 iOS 디바이스
11815    const iOSDevice = /iPhone|iPad|iPod/i.test(ua);
11816    // iPadOS 13+ (Mac으로 위장하는 경우)
11817    const iPadOS = navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1;
11818    // iPhone Safari | Mac Safari  (iPhone|Android Chrome == false)
11819    // const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
11820    return iOSDevice || iPadOS;
11821}
11822function getScroller() {
11823    var configBody = document.querySelector('.dsgn-body.mode-config');
11824    if (!configBody) return window;
11825    if (typeof $.clnav !== 'undefined' && $.clnav.check()) return window;
11826    return configBody;
11827}
11828var baseParallaxAnimations = {
11829    'horizontal-right': function (layer, el, st) {
11830        return gsap.fromTo(layer, { x: -150 }, { x: 150, ease: 'none', scrollTrigger: st });
11831    },
11832    'horizontal-left': function (layer, el, st) {
11833        return gsap.fromTo(layer, { x: 150 }, { x: -150, ease: 'none', scrollTrigger: st });
11834    },
11835    'zoom-in': function (layer, el, st) {
11836        return gsap.fromTo(layer, { scale: 1 }, {
11837            scale: 1.5,
11838            ease: 'none',
11839            transformOrigin: 'center',
11840            scrollTrigger: st
11841        });
11842    },
11843    'zoom-out': function (layer, el, st) {
11844        return gsap.fromTo(layer, { scale: 1.5 }, {
11845            scale: 1,
11846            ease: 'none',
11847            transformOrigin: 'center',
11848            scrollTrigger: st
11849        });
11850    },
11851    'float-down': function (layer, el, st) {
11852        return gsap.fromTo(layer, { y: 0, opacity: 1 }, {
11853            y: el.offsetHeight,
11854            opacity: 0,
11855            ease: 'none',
11856            scrollTrigger: $.extend({}, st, { end: 'center center' })
11857        });
11858    },
11859    'float-up': function (layer, el, st) {
11860        return gsap.fromTo(layer, { y: el.offsetHeight, opacity: 0 }, {
11861            y: 0,
11862            opacity: 1,
11863            ease: 'power2.out',
11864            scrollTrigger: $.extend({}, st, {
11865                start: 'top 50%',
11866                end: 'center center',
11867                toggleActions: 'play none none reverse'
11868            })
11869        });
11870    },
11871    'scroll': function (layer, el, st) {
11872        return gsap.fromTo(layer, { y: -200 }, {
11873            y: 200,
11874            ease: 'none',
11875            scrollTrigger: st
11876        });
11877    }
11878};
11879var customParallaxAnimations = {
11880    'contents140': function (layer, el, st) {
11881        const pinTarget = layer.parentElement;
11882
11883        gsap.set(pinTarget, {
11884            overflow: 'hidden',
11885            position: 'relative'
11886        });
11887
11888        ScrollTrigger.matchMedia({
11889            "(min-width: 768px)": function () {
11890                gsap.fromTo(layer, {
11891                    scale: 1.5
11892                }, {
11893                    scale: 1,
11894                    ease: "none",
11895                    transformOrigin: "center center",
11896                    scrollTrigger: {
11897                        ...st,
11898                        trigger: pinTarget,
11899                        pin: true,
11900                        pinSpacing: true,
11901                        start: "top top",
11902                        end: "bottom+=50 top",
11903                        scrub: true
11904                    }
11905                });
11906            },
11907            "(max-width: 767px)": function () {
11908                gsap.fromTo(layer, {
11909                    scale: 2
11910                }, {
11911                    scale: 1,
11912                    ease: "none",
11913                    transformOrigin: "center center",
11914                    scrollTrigger: st
11915                });
11916            }
11917        });
11918    }
11919};
11920function resolveAnimationMode(layer, el) {
11921    var mode = layer.dataset.mode || el.getAttribute('data-parallax-effect') || 'scroll';
11922
11923    if (isIOS() && mode === 'fixed') return 'scroll';
11924    return mode;
11925}
11926function prepareParallaxDOM(el, media) {
11927    let $el = (el instanceof jQuery) ? el : $(el);
11928    $el = $el.closest('.element');
11929
11930    const parallax_media = media || $el.attr('data-parallax-media') || 'background';
11931    const parallax_mode = $el.attr('data-parallax-effect') || 'fixed';
11932    const $elem = $el.closest('.elem').length > 0 ? $el.closest('.elem') : $el;
11933
11934    if($.inArray(parallax_mode, ['fixed']) > -1) {
11935        $el.find(`.parallax-layer[data-media="${parallax_media}"]`).remove();
11936        if($elem.length > 0) removeElementRootCss($elem, '--parallax-');
11937    }
11938    else if($.inArray(parallax_mode, ['scroll']) > -1) {
11939        if(parallax_media === 'background') {
11940            var bgImage = $el.css('background-image');
11941            if ((!bgImage || bgImage === 'none') && $el.attr('data-type') == 'page_bottom') {
11942                var _pbBgVar = getComputedStyle($el[0]).getPropertyValue('--pb-background-image-url').trim();
11943                if(_pbBgVar && _pbBgVar !== 'none') bgImage = _pbBgVar.match(/^url\(/) ? _pbBgVar : 'url(' + _pbBgVar + ')';
11944            }
11945            if (!bgImage || bgImage === 'none') return;
11946
11947            setElementRootCss($elem, {
11948                '--parallax-bgimg': bgImage,
11949                '--parallax-bgimg-size': 'cover',
11950                '--parallax-bgimg-position': '50% 0',
11951                '--parallax-bgimg-repeat': 'repeat-y',
11952                '--parallax-bgimg-attachment': 'scroll',
11953            });
11954        }
11955
11956        if($el.find(`.parallax-layer[data-media="${parallax_media}"]`).length === 0) {
11957            $el.prepend(`<div class="parallax-layer" data-media="${parallax_media}"></div>`);
11958        }
11959        const $layer = $el.find(`.parallax-layer[data-media="${parallax_media}"]`).last();
11960        $layer.attr({
11961            'data-mode': parallax_mode,
11962        });
11963
11964        $elem.addClass('_parallax_visible');
11965    }
11966}
11967
11968function setBlockParallaxGsap(target, media, retry) {
11969    retry = retry || 0;
11970    if (typeof ScrollTrigger === 'undefined') return;
11971
11972    gsap.registerPlugin(ScrollTrigger);
11973
11974    setTimeout(function () {
11975        var selectors = [];
11976        if (!media) selectors.push('.parallax-layer')
11977        else selectors.push(`.parallax-layer[data-media="${media}"]`);
11978        var layers = [];
11979
11980        if (typeof target === 'string') {
11981            var finalSelector = selectors
11982                .map(function (sel) {
11983                    return target ? '.' + target + ' ' + sel : sel;
11984                })
11985                .join(', ');
11986            layers = gsap.utils.toArray(finalSelector);
11987        } else {
11988            var targetElements = [];
11989            if (target instanceof jQuery) {
11990                targetElements = target.toArray();
11991            } else if (target) {
11992                targetElements = gsap.utils.toArray(target);
11993            }
11994
11995            if (targetElements.length) {
11996                targetElements.forEach(function (targetEl) {
11997                    var $scope = $(targetEl).closest('.elem');
11998                    if (!$scope.length) {
11999                        $scope = $(targetEl);
12000                    }
12001                    selectors.forEach(function (sel) {
12002                        layers = layers.concat($scope.find(sel).toArray());
12003                    });
12004                });
12005            } else if (!target) {
12006                layers = gsap.utils.toArray(selectors.join(', '));
12007            }
12008        }
12009
12010        if (!layers.length && retry < 5) {
12011            return setBlockParallaxGsap(target, media, retry + 1);
12012        }
12013
12014        var scroller = getScroller();
12015
12016        layers.forEach(function (layer) {
12017            var media = layer.dataset.media;
12018            var target_conf = {
12019                background: {
12020                    selector: '[data-parallax]',
12021                    check: function (el) {
12022                        return el.hasAttribute('data-parallax');
12023                    }
12024                },
12025                image: {
12026                    selector: '[data-img-parallax]',
12027                    check: function (el) {
12028                        return el.hasAttribute('data-img-parallax');
12029                    }
12030                }
12031            };
12032            var conf = target_conf[media];
12033            // var target = layer._parallaxTarget || ((layer.dataset.mode === 'fixed') ? layer.nextElementSibling : layer.parentElement);
12034            var target = layer.parentElement;
12035            while (target && conf && !target.matches(conf.selector)) {
12036                target = target.closest(conf.selector);
12037            }
12038            var enabled = false;
12039            if (conf && target) {
12040                enabled = conf.check(target);
12041            }
12042            gsap.killTweensOf(layer);
12043            if (layer._parallaxTrigger) {
12044                layer._parallaxTrigger.kill();
12045                layer._parallaxTrigger = null;
12046            }
12047
12048            if (!enabled) {
12049                gsap.set(layer, { clearProps: 'all' });
12050                return;
12051            }
12052            var animationMode = resolveAnimationMode(layer, target);
12053            if (!animationMode) return;
12054
12055            var stConfig = {
12056                trigger: target,
12057                scroller: scroller,
12058                scrub: true,
12059                start: 'top bottom',
12060                invalidateOnRefresh: true
12061            };
12062
12063            var animate =
12064                    customParallaxAnimations[animationMode] ||
12065                    baseParallaxAnimations[animationMode] ||
12066                    baseParallaxAnimations.scroll;
12067            layer._parallaxTrigger = animate(layer, target, stConfig) || null;
12068        });
12069
12070        ScrollTrigger.refresh();
12071    }, 50);
12072}
12073function setBlockParallax(el, override) {
12074    const $targets = (el instanceof jQuery) ? el : $(el);
12075    if ($targets.length === 0) return false;
12076
12077    const hasOwn = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
12078    const getOverrideValue = (obj, keys) => {
12079        if (!obj || typeof obj !== 'object') return undefined;
12080
12081        for (let i = 0; i < keys.length; i++) {
12082            if (hasOwn(obj, keys[i])) return obj[keys[i]];
12083        }
12084
12085        return undefined;
12086    };
12087
12088    $targets.each(function () {
12089        const $target = $(this);
12090        const parallax_enabled_raw = getOverrideValue(override, ['enabled', 'parallax', 'data-parallax']);
12091        const parallax_mode_raw = getOverrideValue(override, ['effect', 'mode', 'parallaxEffect', 'data-parallax-effect']);
12092        const parallax_media_raw = getOverrideValue(override, ['media', 'parallaxMedia', 'data-parallax-media']);
12093
12094        const parallax_enabled = (typeof parallax_enabled_raw !== 'undefined')
12095            ? (String(parallax_enabled_raw) === 'true' || parallax_enabled_raw === true)
12096            : $target.is('[data-parallax="true"]');
12097
12098        let parallax_mode = (typeof parallax_mode_raw !== 'undefined' && parallax_mode_raw !== '')
12099            ? String(parallax_mode_raw)
12100            : ($target.attr('data-parallax-effect') || 'fixed');
12101        let parallax_media = (typeof parallax_media_raw !== 'undefined' && parallax_media_raw !== '')
12102            ? String(parallax_media_raw)
12103            : ($target.attr('data-parallax-media') || 'background');
12104
12105        if(!parallax_enabled) {
12106            $target.removeAttr('data-parallax data-parallax-effect data-parallax-media');
12107            $target.find('.parallax-layer').remove();
12108
12109            removeElementRootCss($target,'--parallax-');
12110        }
12111        else {
12112            if(isIOS() && parallax_mode === 'fixed') parallax_mode = 'scroll';
12113
12114            $target.attr('data-parallax','true');
12115            $target.attr('data-parallax-effect',parallax_mode);
12116            $target.attr('data-parallax-media',parallax_media);
12117
12118            prepareParallaxDOM($target, parallax_media);
12119            if($.inArray(parallax_mode, ['scroll']) > -1) setBlockParallaxGsap($target, parallax_media);
12120        }
12121    });
12122}
12123
12124function colorisSetVal(color, target, $context = $('.bc-style')) {
12125    if (!Coloris.getColorRegex().test(color)) return;
12126    const coloris_selector = `.coloris-picker .coloris[data-root="${target.root}"][selector="${target.selector}"]`;
12127    const $elements = $context.find(coloris_selector);
12128
12129    $elements.each(function () {
12130        const $el = $(this);
12131        let finalColor = color;
12132
12133        if ($el.hasClass('clr-alphaoff')) {
12134            finalColor = Coloris.getChangeColorVal(color, 'a', 1);
12135        }
12136
12137        $el.val(finalColor);
12138
12139        const colorInfo = Coloris.getColorInfo(finalColor, 'rgba');
12140        const rgbaString = typeof colorInfo === 'string' ? colorInfo : colorInfo.rgba || '';
12141
12142        $el.closest('.clr-field').css('color', rgbaString);
12143    });
12144}
12145
12146function colorisBind() {
12147    document.querySelector('.coloris-picker input').setAttribute('autocomplete', 'off');
12148    if($('.coloris-picker > .coloris').length > 0) Coloris.wrap('.coloris-picker > .coloris');
12149}
12150
12151function getOrDefaultRootcss(obj, key, def, selector) {
12152    let val;
12153    if(typeof obj == 'object') val = (typeof key == 'string' && key != '') ? obj[key] : obj;
12154    else if(typeof obj == 'string' && key == '') val = obj;
12155    
12156    var root_key = (key != '') ? key.replace(/\_/gi,'-') : '';
12157
12158    if(typeof val === 'undefined') {
12159        if(typeof selector != 'undefined' && selector != '' && document.querySelector(selector)) {
12160            var now_style = getComputedStyle(document.querySelector(selector));
12161            if( typeof now_style.getPropertyValue(root_key) != 'undefined' && 
12162                now_style.getPropertyValue(root_key) != ''
12163            ) {
12164                val = now_style.getPropertyValue(root_key);
12165                // if(/-fsize$/.test(key)) result = Number(cssNumber(result));
12166            }
12167        }
12168    }
12169
12170    if(typeof val === 'undefined') return def;
12171
12172    if (typeof def === 'number') {
12173        val = cssNumber(val);
12174
12175        if (!isNaN(val) && val !== '') return Number(val);
12176        return def;
12177    }
12178
12179    if (typeof def === 'boolean') {
12180        if (typeof val === 'boolean') return val;
12181        if (typeof val === 'string') return val === 'true';
12182        return Boolean(val);
12183    }
12184
12185    return String(val);
12186}
12187function getOrDefault(obj, key, def) {
12188    let val;
12189    if(typeof obj == 'object') val = (typeof key == 'string' && key != '') ? obj[key] : obj;
12190    else if(typeof obj == 'string' && key == '') val = obj;
12191
12192    if(typeof val === 'undefined') return def;
12193
12194    if (typeof def === 'number') {
12195        if (!isNaN(val) && val !== '') return Number(val);
12196        return def;
12197    }
12198
12199    if (typeof def === 'boolean') {
12200        if (typeof val === 'boolean') return val;
12201        if (typeof val === 'string') return val === 'true';
12202        return Boolean(val);
12203    }
12204
12205    if (Array.isArray(def)) {
12206        if(!Array.isArray(val) && val != '') val = val.split(',');
12207        return Array.isArray(val) ? val : def;
12208    }
12209
12210    if (typeof def === 'object') {
12211        return (val && typeof val === 'object' && !Array.isArray(val)) ? val : def;
12212    }
12213
12214    if(val === '') return def;
12215    return String(val);
12216}
12217
12218function setResourceBtn(isOpen,obj) {
12219    if(typeof obj == 'undefined') obj = {};
12220
12221    if(typeof selectCount != 'undefined') selectCount = getOrDefault(obj,'maxcount',0);
12222    if(selectCount > 1) selectCount = 1;
12223
12224    document.querySelectorAll('.resource-useit').forEach(el => {
12225        [...el.attributes].forEach(attr => {
12226            if (attr.name.startsWith('data-')) {
12227                el.removeAttribute(attr.name);
12228            }
12229        });
12230        
12231        for (let key in obj) {
12232            if (obj.hasOwnProperty(key)) {
12233                el.setAttribute(`data-${key}`, obj[key] || '');
12234            }
12235        }
12236    });
12237
12238    var imgtype = (typeof obj.imgtype != 'undefined' && obj.imgtype) ? obj.imgtype : '';
12239    if(imgtype.indexOf('default') > -1 && isOpen) $('#el-iconstorage').modal('show');  
12240    else {
12241        if(isOpen) $('#el-fileupload').modal('show');
12242    }
12243    
12244}
12245
12246function resizeVideoIframe(tag) {
12247    if($(tag).find('iframe').length === 0 || $(tag).find('[data-bg-type="background"]').length == 0) return;
12248    var iframe = $(tag).find('.container'),
12249        width = iframe.width(),
12250        p_height = iframe.height(),
12251        height = (width / 16) * 9;
12252    if(p_height > height) height = p_height;
12253    iframe.find('iframe').height(height);
12254    initBgVimeoIframe(tag);
12255}
12256
12257function initBgVimeoIframe(tag) {
12258    var root = (tag && tag.jquery) ? tag.get(0) : tag;
12259    if(!root || !root.querySelectorAll) return;
12260
12261    var iframes = root.querySelectorAll('[data-bg-video="true"][data-bg-type="background"] iframe[src*="player.vimeo.com"]');
12262    if(!iframes.length) return;
12263
12264    for(var i = 0; i < iframes.length; i++) {
12265        bindBgVimeoIframe(iframes[i]);
12266    }
12267}
12268
12269function bindBgVimeoIframe(iframe) {
12270    if(!iframe || iframe._bgVimeoLoadBound === true) return;
12271    iframe._bgVimeoLoadBound = true;
12272
12273    iframe.classList.remove('loaded');
12274    iframe.removeAttribute('data-ready');
12275    iframe.removeAttribute('data-vimeo-bg-ready');
12276    iframe.removeAttribute('data-vimeo-bg-load-bound');
12277    iframe.setAttribute('data-vimeo-bg-load-bound', 'true');
12278
12279    var shown = false,
12280        fallbackTimer = null;
12281
12282    var showIframe = function() {
12283        if(shown) return;
12284        shown = true;
12285        if(fallbackTimer) window.clearTimeout(fallbackTimer);
12286        iframe.setAttribute('data-vimeo-bg-ready', 'true');
12287        iframe.classList.add('loaded');
12288    };
12289
12290    fallbackTimer = window.setTimeout(showIframe, 4000);
12291
12292    loadBgVimeoApi(function(loaded) {
12293        if(!loaded || !window.Vimeo || !window.Vimeo.Player) {
12294            window.setTimeout(showIframe, 1500);
12295            return;
12296        }
12297
12298        var player;
12299        try {
12300            player = new window.Vimeo.Player(iframe);
12301        } catch(e) {
12302            window.setTimeout(showIframe, 1500);
12303            return;
12304        }
12305
12306        player.ready().then(function() {
12307            player.on('play', function() {
12308                window.setTimeout(showIframe, 300);
12309            });
12310            player.on('timeupdate', function(data) {
12311                if(data && data.seconds > 0.05) showIframe();
12312            });
12313            if(player.getCurrentTime) {
12314                player.getCurrentTime().then(function(seconds) {
12315                    if(seconds > 0.05) showIframe();
12316                });
12317            }
12318        }).catch(function() {
12319            window.setTimeout(showIframe, 1500);
12320        });
12321    });
12322}
12323
12324function loadBgVimeoApi(callback) {
12325    if(window.Vimeo && window.Vimeo.Player) {
12326        callback(true);
12327        return;
12328    }
12329
12330    window._bgVimeoApiCallbacks = window._bgVimeoApiCallbacks || [];
12331    window._bgVimeoApiCallbacks.push(callback);
12332
12333    if(window._bgVimeoApiLoading) return;
12334    window._bgVimeoApiLoading = true;
12335
12336    var script = document.createElement('script');
12337    script.src = 'https://player.vimeo.com/api/player.js';
12338    script.onload = function() {
12339        flushBgVimeoApiCallbacks(true);
12340    };
12341    script.onerror = function() {
12342        flushBgVimeoApiCallbacks(false);
12343    };
12344    document.head.appendChild(script);
12345}
12346
12347function flushBgVimeoApiCallbacks(loaded) {
12348    var callbacks = window._bgVimeoApiCallbacks || [];
12349    window._bgVimeoApiCallbacks = [];
12350    window._bgVimeoApiLoading = false;
12351
12352    for(var i = 0; i < callbacks.length; i++) {
12353        callbacks[i](loaded);
12354    }
12355}
12356
12357if(document.readyState == 'loading') {
12358    document.addEventListener('DOMContentLoaded', function() {
12359        initBgVimeoIframe(document);
12360    });
12361} else {
12362    initBgVimeoIframe(document);
12363}
12364
12365function debounce(func, delay) {
12366  let timer;
12367  return function (...args) {
12368    clearTimeout(timer);
12369    timer = setTimeout(() => func.apply(this, args), delay);
12370  };
12371}
12372
12373window._blockMasonryResizeTargets = window._blockMasonryResizeTargets || [];
12374window._blockMasonryResizeHandler = debounce(() => {
12375    window._blockMasonryResizeTargets.forEach($target => {
12376        if ($target && $target.length > 0) {
12377            reloadBlockMasonry('refresh', $target);
12378        }
12379    });
12380}, 300);
12381
12382function reloadBlockMasonry(fn, msnyEL, items) {
12383    if(typeof fn == 'undefined' || typeof msnyEL == 'undefined' || msnyEL.length === 0) return;
12384
12385    var checkElviewer = msnyEL.hasClass('el_viewblock'),
12386        checkMsny = msnyEL.is('[data-msny="true"]'),
12387        msnyLoop = msnyEL.find('[data-loop="true"]'),
12388        el_type = msnyEL.attr('data-type'),
12389        el_selector = checkElviewer ? '.el_viewblock' : `.${msnyEL.attr('data-name')}`,
12390        item_selector = (el_type === 'gallery') ? '.grid' : '.item';
12391    if(!checkMsny || msnyLoop.is('[data-description]:empty')) {
12392        if(fn != 'init') return;
12393        fn = 'destroy';
12394    }
12395
12396    if(msnyEL.find(`.${el_type}-loading-status`).length == 0)  {
12397        var loadingtag = `<div class="${el_type}-loading-status"><div class="loading-dots"></div></div>`
12398        if(msnyEL.find('[data-loop="true"]').is(':empty')) {
12399            msnyEL.find('[data-loop="true"]').before(loadingtag);
12400        } else {
12401            msnyEL.find('[data-loop="true"]').after(loadingtag);
12402        }
12403    }
12404
12405    if(items) items.hide(); 
12406    var msny_gutter = Number(getComputedStyle(document.querySelector(el_selector)).getPropertyValue('--layout-gap-col')) || 0;
12407    if($('body').outerWidth() <= 787) msny_gutter = msny_gutter * 0.5;
12408    else if($('body').outerWidth() > 787 && $('body').outerWidth() <= 991) msny_gutter = msny_gutter * 0.8;
12409    var msny_opts = {
12410        itemSelector: item_selector,
12411        columnWidth: item_selector,
12412        percentPosition: true,
12413        gutter: msny_gutter,
12414        horizontalOrder: false,
12415        resize: true,
12416        transitionDuration: '0.4s',
12417        stagger: 30
12418    };
12419 
12420    var prevHeight = msnyLoop.outerHeight() || msnyLoop[0].scrollHeight || 200;
12421    msnyLoop.css('min-height', `${prevHeight}px`);
12422
12423    msnyLoop.off('layoutComplete');
12424    msnyLoop.on('layoutComplete', function() {
12425        msnyEL.find(`.${el_type}-loading-status`).remove();
12426        msnyEL.find(item_selector).show();
12427        msnyLoop.css('min-height', '');
12428
12429        //.allhide 다시계산
12430        if(el_type === 'gallery') {
12431            msnyEL.find('.grid figcaption').each(function() {
12432                if($(this).find('.figure:not(.hide, .review[data-review_cnt="false"][data-review_score="false"])').length > 0 && $(this).height() > 0) {
12433                    $(this).removeClass('allhide');
12434                } else {
12435                    $(this).addClass('allhide');
12436                }
12437            });
12438        }
12439    });
12440
12441
12442    function applyMsny(afterinit = false) {
12443        // if(afterinit) console.log('Masonry 초기화 완료!');
12444        msnyLoop.imagesLoaded(function () {
12445            msnyLoop.masonry(msny_opts);
12446        }).progress(function (instance, image) {
12447            $(image.img).closest(item_selector).show();
12448        });
12449    }
12450
12451
12452    if( msnyLoop.data('masonry')
12453        && $.inArray(fn, ['init','destroy']) > -1
12454    ) {
12455        msnyLoop.data('masonry').destroy();
12456        msnyLoop.removeData('masonry');
12457    }
12458
12459    switch(fn) {
12460        case 'destroy':
12461            msnyLoop.css('min-height','');
12462            msnyEL.find(`.${el_type}-loading-status`).remove();
12463            break;
12464
12465        case 'init':
12466            // msnyEL.find(item_selector).hide();
12467            applyMsny(true);
12468
12469            if(typeof window._blockMasonryResizeHandler === 'function') {
12470                window.__masonryResizeTarget = msnyEL;
12471                
12472                if (!window._blockMasonryResizeHandler._registered) {
12473                    window.addEventListener('resize', window._blockMasonryResizeHandler);
12474                    window._blockMasonryResizeHandler._registered = true;
12475                }
12476                
12477                let exists = window._blockMasonryResizeTargets.some($t => $t.is(msnyEL));
12478                if (!exists) {
12479                    window._blockMasonryResizeTargets.push(msnyEL);
12480                }
12481            }
12482            break;
12483
12484        case 'add':
12485            if(items) {
12486                msnyLoop.append(items);
12487                items.imagesLoaded(function () {
12488                    msnyLoop.masonry('appended', items).masonry('layout');
12489                }).progress(function (instance, image) {
12490                    $(image.img).closest(item_selector).show();
12491                });
12492            }
12493            break;
12494
12495        case 'refresh':
12496            msnyLoop.masonry({gutter:msny_opts.gutter});
12497            break;
12498
12499        default:
12500            // console.log(`UNDEFINED fn`,fn);
12501            break;
12502    }
12503}
12504
12505function setOldVerBlockView(viewEL,obj) {
12506    if( typeof viewEL == 'undefined' || $(viewEL).length === 0 
12507        || typeof obj == 'undefined' || $.isEmptyObject(obj) || typeof obj.seq == 'undefined'
12508    ) return false;
12509
12510    var checkElView = (typeof obj.checkElviewer != 'undefined' && obj.checkElviewer === true) ? true : false,
12511        el_selector = `.element[data-id="${obj.seq}"]`;
12512    if(checkElView) el_selector = (typeof obj.elname != 'undefined' && obj.elname) ? `.elviewhtml .${obj.elname}` : '.elviewhtml';
12513
12514    var el_style = getComputedStyle(document.querySelector(el_selector));
12515
12516    var now = new Date();
12517    var check_oldver = '';
12518    switch(obj.type) {
12519        case 'gallery':
12520            if($(viewEL).find('.sh-pcolor').length > 0) $(viewEL).attr('data-ver','1');
12521            if($(viewEL).find('.goption[data-gcol]').length > 0) {
12522                $(viewEL).find('.container').addClass('layout-container');
12523                $(viewEL).find('[data-loop="true"]').addClass('layout-row');
12524
12525                var check_layout = (!el_style.getPropertyValue('--layout-col-p') 
12526                                    && !el_style.getPropertyValue('--layout-gap-row')
12527                                    && !el_style.getPropertyValue('--layout-gap-col')
12528                                    && !el_style.getPropertyValue('--layout-imgh') 
12529                                    && !el_style.getPropertyValue('--layout')
12530                    ) ? true : false;
12531
12532                if(check_layout) {
12533                    if($(viewEL).find('.goption').attr('data-gcol') == '' && $(viewEL).is('[data-case="gallery45"]')) $(viewEL).find('.goption').attr('data-gcol',2);
12534                    var tmp_col = ($(viewEL).find('.goption').is('[data-gcol]')) ? Number($(viewEL).find('.goption').attr('data-gcol') || 1) : 1,
12535                        tmp_col_t = ($(viewEL).find('.goption').is('[data-gcol-t]')) ? Number($(viewEL).find('.goption').attr('data-gcol-t')) : tmp_col ?? 1,
12536                        tmp_col_m = ($(viewEL).find('.goption').is('[data-gcol-m]')) ? Number($(viewEL).find('.goption').attr('data-gcol-m')) : tmp_col_t ?? 1,
12537                        tmp_gap = ($(viewEL).find('.goption').is('[data-gpd]')) ? Number($(viewEL).find('.goption[data-gpd]').attr('data-gpd').trim()) * 2 : 0,
12538                        tmp_imgh = ($(viewEL).find('.goption').is('[data-gh]')) ? $(viewEL).find('.goption').attr('data-gh') : 1;
12539                    if(tmp_imgh == 'auto') tmp_imgh = 1;
12540
12541                    document.querySelectorAll(el_selector).forEach(tmpel=> {
12542                        tmpel.style.setProperty('--layout-col-p', tmp_col, null);
12543                        tmpel.style.setProperty('--layout-col-t', tmp_col_t, null);
12544                        tmpel.style.setProperty('--layout-col-m', tmp_col_m, null);
12545                        tmpel.style.setProperty('--layout-gap-row', tmp_gap, null);
12546                        tmpel.style.setProperty('--layout-gap-col', tmp_gap, null);
12547                        tmpel.style.setProperty('--layout-imgh', tmp_imgh, null);
12548                    });
12549                }
12550            }
12551
12552            var check_gimg = ($(viewEL).find('.grid:eq(0)').find('img.img-responsive').length > 0 
12553                                && $(viewEL).find('.grid:eq(0)').find('.g-img').length > 0
12554                ) ? true : false;
12555            if(check_gimg) $(viewEL).find('.g-img').remove();
12556
12557            var check_basket = (el_style.getPropertyValue('--gallery-figure-title-fname')) ? true : false;
12558            if(check_basket) {
12559                var tmp_basket = {
12560                    __basket_fname: el_style.getPropertyValue('--gallery-figure-title-fname'),
12561                    __basket_fsize: '11px',
12562                    __basket_fweight: 400,
12563                    __basket_color: el_style.getPropertyValue('--gallery-figure-title-color'),
12564                    __basket_color_hover: el_style.getPropertyValue('--gallery-figure-title-color'),
12565                    __basket_bgcolor: 'transparent',
12566                    __basket_bgcolor_hover: 'transparent',
12567                    __basket_line: el_style.getPropertyValue('--gallery-figure-title-color-alpha'),
12568                    __basket_line_hover: el_style.getPropertyValue('--gallery-figure-title-color-alpha2'),
12569                };
12570                $.each(tmp_basket, function(o_rk, o_rv) {
12571                    document.querySelectorAll(el_selector).forEach(tmpel=> {
12572                        tmpel.style.setProperty(o_rk.replace(/\_/gi,'-'), o_rv, null);
12573                    });
12574                });
12575            }
12576
12577            break;
12578        
12579        case 'sync':
12580            var check_option = ($(el_selector).find('input.sync-option').length > 0) ? true : false;
12581            if(check_option) {
12582                
12583                if($(viewEL).find('.container:not(.layout-container)').length > 0) $(viewEL).find('.container').addClass('layout-container');
12584                if($(viewEL).find('.sync-row:not(.layout-row)').length > 0) $(viewEL).find('.sync-row').addClass('layout-row');
12585
12586                var check_gap = (el_style.getPropertyValue('--sync-view')) ? true : false;
12587                if(check_gap) {
12588                    $(viewEL).attr('data-ver','1');
12589
12590                    var tmp_col_p = el_style.getPropertyValue('--sync-view'),
12591                        tmp_col_t = el_style.getPropertyValue('--sync-view-t'),
12592                        tmp_col_m = el_style.getPropertyValue('--sync-view-m'),
12593                        tmp_gap = el_style.getPropertyValue('--sync-space'),
12594                        tmp_gap_top = el_style.getPropertyValue('--sync-space-top'),
12595                        tmp_imgh = el_style.getPropertyValue('--sync-height'),
12596                        tmp_display_cnt = el_style.getPropertyValue('--sync-page-unit');
12597                    document.querySelectorAll(el_selector).forEach(tmpel=> {
12598                        tmpel.style.setProperty('--layout-col-p', tmp_col_p, null);
12599                        tmpel.style.setProperty('--layout-col-t', tmp_col_t, null);
12600                        tmpel.style.setProperty('--layout-col-m', tmp_col_m, null);
12601                        tmpel.style.setProperty('--layout-gap-col', tmp_gap * 2, null);
12602                        tmpel.style.setProperty('--layout-gap-row', tmp_gap * 2 * tmp_gap_top, null);
12603                        tmpel.style.setProperty('--layout-imgh', tmp_imgh, null);
12604                        tmpel.style.setProperty('--display-count', tmp_display_cnt, null);
12605                    });
12606                }
12607            }
12608            break;
12609
12610        case 'forum':
12611            if($(viewEL).is('[data-fcolor]')) $(viewEL).attr('data-ver','1');
12612            break;
12613
12614        default:
12615            break;
12616    }
12617}
12618
12619
12620function getSiteMenuMax(sid, valid_plan, valid_type) {
12621    if(typeof sid == 'undefined' || !sid) return 0;
12622
12623    const custom_group = {
12624        200: ['flowedu'],
12625        300: ['tempmainleather']
12626    };
12627
12628    let result = (valid_plan && valid_type == 'SM') ? 200 : 100;
12629
12630    for (const [limit, group] of Object.entries(custom_group)) {
12631        if (group.includes(sid)) {
12632            result = Number(limit);
12633            break;
12634        }
12635    }
12636
12637    return result;
12638}
12639
12640function setSiteMenuOption() {
12641    var checkConfig = (PAGE_MODE == 'c') ? true : false;
12642    var checkView = (PAGE_MODE == 'c') ? VIEW : property.VIEW;
12643    var checkFroumView = (checkView && /^forum,/.test(checkView)) ? true : false;
12644    var sid = (PAGE_MODE == 'c') ? SID : property.SID;
12645    var page = (PAGE_MODE == 'c') ? PAGE : property.PAGE;
12646    var ppage = (PAGE_MODE == 'c') ? PARENT.ppage : property.PARENT.ppage;
12647    var checkpage = (checkView) ? ppage : page;
12648    var smenu = (PAGE_MODE == 'c') ? SMENU : property.SMENU;
12649    var menuoption = (PAGE_MODE == 'c') ? MENUOPTION : property.MENUOPTION;
12650
12651    $.each(menuoption, function(i,o) {
12652        o.active = '';
12653        if(o.isbookmark === '' && o.isflink === '' && o.isinner === '' 
12654            && o.name.replace(/ /g, '-') === checkpage
12655        ) {
12656            o.active = 'active';
12657        }
12658
12659        $.each(o.children, function(sub_i, sub_o) {
12660            sub_o.active = '';
12661            if(`${o.active}${sub_o.isbookmark}${sub_o.isflink}${sub_o.isinner}${sub_o.name.replace(/ /g, '-')}` === checkpage) {
12662                sub_o.active = 'active';
12663                o.active = 'open';
12664                if(!$.clnav.check() && $('body').width() > 768) o.active = 'active';
12665            }
12666        });
12667    });
12668}
12669
12670function date_string(d) {
12671    const date = new Date(d);
12672    const month = date.getMonth() + 1;
12673    const day = date.getDate();
12674    const weekdayNames = ['일', '월', '화', '수', '목', '금', '토'];
12675    const weekday = weekdayNames[date.getDay()];
12676    return `${month}월 ${day}일 (${weekday})`;
12677}
12678
12679
12680function slideNavigation(n) {
12681    let navObj = {
12682        1: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44" width="44" height="44"><path d="m27.65 22-1.4-1.4-8.5-8.5-1.4 1.4 8.5 8.5-8.5 8.5 1.4 1.4 8.5-8.5z"/></svg>',
12683        2: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44" width="44" height="44"><path d="m27.65 22-1.4-1.4-8.5-8.5-1.4 1.4 8.5 8.5-8.5 8.5 1.4 1.4 8.5-8.5z"/></svg>',
12684        3: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44" width="44" height="44"><path d="M1.96 2v40h40V2h-40zm15.75 29.9-1.4-1.4 8.5-8.5-8.5-8.5 1.4-1.4 8.5 8.5 1.4 1.4-9.9 9.9z"/></svg>',
12685        4: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44" width="44" height="44"><path d="m37.6 20.6-8.5-8.5-1.4 1.4 7.5 7.5H5v2h30.2l-7.5 7.5 1.4 1.4 8.5-8.5L39 22z"/></svg>',
12686        5: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44" width="44" height="44"><g><path d="M22 2C10.95 2 2 10.95 2 22s8.95 20 20 20 20-8.95 20-20S33.05 2 22 2zm0 38.8C11.63 40.8 3.2 32.37 3.2 22S11.63 3.2 22 3.2 40.8 11.63 40.8 22 32.37 40.8 22 40.8z"/><path d="m25.11 21.15-6.22-6.22-.85.85L24.26 22l-6.22 6.22.85.85 6.22-6.22.85-.85-.85-.85z"/></g></svg>',
12687        6: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44" width="44" height="44"><g><path d="m18.89 29.07 6.22-6.22.85-.85-.85-.85-6.22-6.22-.85.85L24.26 22l-6.22 6.22z"/><path d="M2 2v40h40V2H2zm38.8 38.8H3.2V3.2h37.6v37.6z"/></g></svg>',
12688        7: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44" width="44" height="44"><path d="m17.69 1.79-.9.42L26.21 22l-9.42 19.79.9.42L27.32 22z"/></svg>',
12689        8: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44" width="44" height="44"><g><path d="M10.84 38.6c.08.06.17.11.25.17h.04c.17.11.34.22.52.32l.62-1.03c-.27-.16-.53-.33-.79-.51l-.64 1.05z"/><path d="m4.53 28.96-1.12.44c.01.03.03.06.04.1v.02c.1.25.2.49.31.73v.05c0 .01.01.01.01.02l1.09-.5c-.09-.28-.21-.57-.33-.86z"/><path d="m3.26 23.49-1.2.09c.02.25.04.49.07.73V24.59l1.19-.15c-.01-.33-.04-.64-.06-.95z"/><path d="m3.25 20.67-1.2-.08c-.02.33-.04.66-.05 1l1.2.02c.01-.32.02-.63.05-.94z"/><path d="m3.65 17.88-1.17-.26c-.07.32-.14.65-.19.98l1.18.2c.05-.31.11-.62.18-.92z"/><path d="m8.49 36.74.3.27c.02.02.04.04.06.05l.01.01.01.01.01.01.01.01.01.01s.01 0 .01.01c0 0 .01 0 .01.01 0 0 .01 0 .01.01 0 0 .01 0 .01.01l.01.01.01.01h.01l.01.01.01.01H9l.01.01.01.01.01.01.01.01.01.01.01.01h.01l.01.01.01.01h.01s.01 0 .01.01c0 0 .01 0 .01.01 0 0 .01 0 .01.01 0 0 .01 0 .01.01 0 0 .01 0 .01.01 0 0 .01 0 .01.01 0 0 .01 0 .01.01l.01.01.01.01.01.01.01.01.01.01.01.01.01.01.77-.92c-.24-.2-.48-.41-.71-.62l-.81.87z"/><path d="m4.47 15.18-1.12-.44c-.05.12-.1.25-.14.37v.02s0 .01-.01.01c0 .01-.01.02-.01.03-.01.03-.02.07-.04.1v.03s0 .01-.01.01c0 0 0 .01-.01.01-.04.1-.07.21-.11.31l1.14.38c.09-.24.2-.54.31-.83z"/><path d="M4.73 32.09c.11.18.21.36.32.53v.03l.18.27 1-.66c-.17-.26-.34-.53-.5-.8l-1 .63z"/><path d="m10.71 5.49-.1.07-.01.01-.01.01-.01.01-.01.01-.01.01-.01.01-.01.01-.01.01s-.01 0-.01.01c0 0-.01 0-.01.01 0 0-.01 0-.01.01 0 0-.01 0-.01.01 0 0-.01 0-.01.01 0 0-.01 0-.01.01 0 0-.01 0-.01.01 0 0-.01 0-.01.01 0 0-.01 0-.01.01 0 0-.01 0-.01.01 0 0-.01 0-.01.01 0 0-.01 0-.01.01 0 0-.01 0-.01.01 0 0-.01 0-.01.01 0 0-.01 0-.01.01 0 0-.01 0-.01.01 0 0-.01 0-.01.01 0 0-.01 0-.01.01 0 0-.01 0-.01.01 0 0-.01 0-.01.01 0 0-.01 0-.01.01 0 0-.01 0-.01.01l-.01.01-.01.01-.01.01-.01.01-.01.01-.01.01-.01.01-.01.01-.01.01-.01.01c-.07.05-.13.1-.2.15l.73.95c.25-.19.5-.37.76-.55l-.79-1.02z"/><path d="M6.43 34.56c.21.26.43.51.65.76l.89-.8c-.21-.23-.41-.47-.61-.72l-.93.76z"/><path d="M27.6 2.8c-.21-.06-.43-.12-.65-.18h-.05l-.26-.06-.28 1.17c.31.07.61.15.91.24l.33-1.17z"/><path d="M24.67 2.18c-.04 0-.07-.01-.11-.01-.13-.02-.25-.03-.38-.04H24.03c-.05-.01-.11-.01-.16-.02h-.05c-.05 0-.1-.01-.15-.01l-.1 1.2c.31.03.63.06.93.1l.17-1.22z"/><path d="M39.19 11.77c-.13-.22-.27-.44-.41-.66v-.02l-.01-.01c-.02-.03-.04-.06-.06-.1l-1 .67c.17.26.34.53.5.79l.98-.67z"/><path d="m39.41 14.9 1.11-.45-.06-.15v-.17c-.01-.02-.01-.03-.02-.05-.08-.18-.15-.35-.23-.52l-1.09.51c.05.26.18.54.29.83z"/><path d="m40.28 17.58 1.17-.28c-.02-.07-.03-.13-.05-.2V16.88c-.03-.12-.07-.24-.1-.36l-1.15.34c-.03.11.05.42.13.72z"/><path d="m40.73 20.36 1.2-.1-.03-.29v-.03c-.02-.22-.05-.44-.08-.66l-1.19.16c.04.3.07.61.1.92z"/><path d="m9.19 8.24-.82-.88c-.05.05-.09.09-.14.13l-.01.01-.01.01-.01.01-.01.01s-.01 0-.01.01l-.01.01-.01.01-.01.01-.01.01-.01.01-.01.01-.01.01c-.16.15-.31.3-.46.46l.86.83c.22-.22.45-.44.68-.66z"/><path d="M22 3.2V2H21.89c-.27 0-.54.01-.8.02l.06 1.2c.22-.01.53-.02.85-.02z"/><path d="m7.27 10.31-.94-.74c-.09.11-.17.22-.26.33l-.01.01v.01l-.01.01v.01l-.01.01v.01l-.01.01v.01l-.01.01v.02l-.01.
1268901v.01s0 .01-.01.01c0 0 0 .01-.01.01 0 0 0 .01-.01.01 0 0 0 .01-.01.01 0 0 0 .01-.01.01 0 0 0 .01-.01.01 0 0 0 .01-.01.01 0 0 0 .01-.01.01 0 0 0 .01-.01.01 0 0 0 .01-.01.01 0 0 0 .01-.01.01 0 0 0 .01-.01.01 0 0 0 .01-.01.01 0 0 0 .01-.01.01 0 0 0 .01-.01.01 0 0 0 .01-.01.01 0 0 0 .01-.01.01 0 0 0 .01-.01.01 0 0 0 .01-.01.01 0 0 0 .01-.01.01 0 0 0 .01-.01.01v.02s0 .01-.01.01c0 0 0 .01-.01.01l-.01.01-.01.01-.01.01c-.01.02-.02.03-.03.05l.98.7.57-.75z"/><path d="m5.69 12.64-1.04-.6c-.1.18-.2.36-.3.55v.03l-.15.3 1.07.55c.11-.28.26-.56.42-.83z"/><path d="m19.19 3.41-.18-1.19-.39.06H18.39c-.01 0-.02 0-.03.01-.01 0-.02 0-.03.01H18.06l.24 1.18c.27.03.58-.02.89-.07z"/><path d="m3.69 26.27-1.17.27.06.24v.07c.05.22.11.44.18.66l1.15-.33c-.07-.3-.15-.6-.22-.91z"/><path d="m36.82 33.57.95.74c.01-.01.01-.02.02-.02l.01-.01.01-.01.01-.01s0-.01.01-.01c0 0 0-.01.01-.01l.01-.01v-.01l.01-.01v-.02s0-.01.01-.01l.01-.01.01-.01.01-.01.01-.01.01-.01c.03-.04.06-.08.09-.11l.01-.01.01-.01s0-.01.01-.01c0 0 0-.01.01-.01 0 0 0-.01.01-.01 0 0 0-.01.01-.01 0 0 0-.01.01-.01 0 0 0-.01.01-.01 0 0 0-.01.01-.01l.01-.01v-.01l.01-.01.01-.01s0-.01.01-.01c0 0 0-.01.01-.01v-.01l.01-.01v-.01l.01-.01v-.01l.01-.01v-.01s0-.01.01-.01c0 0 0-.01.01-.01 0 0 0-.01.01-.01 0 0 0-.01.01-.01 0 0 0-.01.01-.01 0 0 0-.01.01-.01 0 0 0-.01.01-.01 0 0 0-.01.01-.01 0 0 0-.01.01-.01 0 0 0-.01.01-.01v-.04c0-.01 0 0 .01-.01v-.01l.01-.01v-.01l.01-.01s0-.01.01-.01c0 0 0-.01.01-.01 0 0 0-.01.01-.01.02-.02.03-.05.05-.07l-.98-.69c-.21.25-.4.5-.59.75z"/><path d="M37.46 9.31c-.01-.01-.01-.01 0 0l-.01-.01-.01-.01v-.01l-.01-.01c-.01-.01 0 0 0-.01l-.01-.01v-.01l-.01-.01v-.01l-.01-.01-.01-.01v-.01l-.01-.01v-.01s0-.01-.01-.01c0 0 0-.01-.01-.01 0 0 0-.01-.01-.01 0 0 0-.01-.01-.01 0 0 0-.01-.01-.01 0 0 0-.01-.01-.01 0 0 0-.01-.01-.01l-.01-.01v-.01l-.01-.01v-.01l-.01-.01v-.01l-.01-.01-.01-.01v-.01L37.25 9s0-.01-.01-.01c0 0 0-.01-.01-.01l-.01-.01-.01-.01-.01-.01s0-.01-.01-.01v-.01l-.01-.01-.01-.01-.01-.01-.01-.01-.01-.01v-.01l-.01-.01v-.01l-.01-.01v-.01l-.01-.01s0-.01-.01-.01c0 0 0-.01-.01-.01 0 0 0-.01-.01-.01 0 0 0-.01-.01-.01 0 0 0-.01-.01-.01l-.01-.01-.01-.01-.01-.01-.01-.01-.01-.01-.01-.01-.01-.01-.01-.01c-.06-.07-.12-.14-.19-.21l-.89.81c.21.23.42.47.61.71l.95-.69z"/><path d="m34.92 35.65.83.87c.09-.09.18-.17.27-.26l.01-.01.01-.01.01-.01.01-.01.01-.01.01-.01.01-.01.01-.01.36-.36-.87-.83c-.22.23-.44.45-.67.66z"/><path d="m32.74 37.43.69.98.01-.01.01-.01.01-.01s.01 0 .01-.01c0 0 .01 0 .01-.01 0 0 .01 0 .01-.01 0 0 .01 0 .01-.01 0 0 .01 0 .01-.01h.01l.01-.01c.01-.01 0 0 .01 0h.01l.01-.01s.01 0 .01-.01c0 0 .01 0 .01-.01 0 0 .01 0 .01-.01 0 0 .01 0 .01-.01.1-.07.2-.15.3-.22l.01-.01.01-.01s.01 0 .01-.01l.01-.01h.01s.01 0 .01-.01c0 0 .01 0 .01-.01 0 0 .01 0 .01-.01 0 0 .01 0 .01-.01l.01-.01c.07-.05.14-.11.21-.16l-.73-.95c-.23.22-.48.4-.74.58z"/><path d="M35.39 7.15c0-.01 0-.01 0 0l-.01-.01-.01-.01-.01-.01-.01-.01a17.4 17.4 0 0 0-.65-.56l-.01-.01-.01-.01-.01-.01-.01-.01-.01-.01-.76.93c.24.2.48.4.71.61l.79-.89z"/><path d="m32.61 5.04-.01-.01-.01-.01H32.53c-.11-.07-.22-.14-.33-.2l-.61 1.03c.27.16.54.33.8.5l.66-1c-.16-.13-.3-.22-.44-.31z"/><path d="m40.38 25.97 1.17.25c.02-.08.03-.16.05-.24v-.05c.04-.18.07-.36.1-.54v-.03c.01-.04.01-.08.02-.12l-1.18-.19c-.04.31-.1.62-.16.92z"/><path d="M40.8 22.24c0 .32-.02.63-.04.94l1.2.07v-.08l.03-.6c0-.11.01-.21.01-.32l-1.2-.01z"/><path d="m39.58 28.68 1.12.43c.07-.19.14-.39.21-.59v-.09c.03-.09.06-.17.08-.26l-1.14-.37c-.05.29-.16.58-.27.88z"/><path d="m38.38 31.23 1.05.59c.05-.09.1-.17.14-.26v-.03c.1-.18.19-.36.28-.54v-.01l-1.
1268907-.54c-.09.24-.24.51-.4.79z"/><path d="M13.3 3.99c-.3.15-.6.3-.89.46l.58 1.05c.27-.15.55-.29.84-.43l-.53-1.08z"/><path d="M19.17 41.8c.2.03.4.05.6.08h.03c.12.01.24.03.36.04l.11-1.2c-.31-.03-.62-.06-.93-.11l-.17 1.19z"/><path d="M16.24 41.16c.13.04.26.08.39.11.01 0 .02 0 .02.01H16.77c.1.03.2.05.3.08l.29-1.17c-.31-.08-.61-.16-.91-.25l-.21 1.22z"/><path d="m22.15 40.8.01 1.2c.34 0 .67-.01 1-.03l-.07-1.2c-.31.02-.62.03-.94.03z"/><path d="M16.09 2.89c-.19.06-.37.12-.56.18-.02.01-.04.01-.06.02l-.33.12.41 1.13c.29-.11.59-.21.89-.3l-.35-1.15z"/><path d="m30.31 38.87.53 1.08c.11-.06.23-.11.34-.17h.01s.01 0 .01-.01h.02c.17-.09.33-.18.49-.27l-.58-1.05c-.26.13-.54.28-.82.42z"/><path d="M13.44 40.08c.1.05.19.09.29.13H13.85c.06.03.11.05.17.08h.07c.09.04.18.08.27.11l.46-1.11c-.29-.12-.58-.25-.86-.38l-.52 1.17z"/><path d="m27.7 39.92.36 1.14.2-.06h.05c.16-.05.33-.11.49-.17.06-.02.13-.05.19-.07l-.42-1.12c-.27.08-.57.19-.87.28z"/><path d="M30.37 3.83c-.01 0-.01-.01-.01-.01h-.02c-.24-.11-.48-.22-.73-.32h-.07c-.01 0-.02-.01-.03-.01l-.45 1.11c.29.12.58.24.86.37l.51-1.09c-.03-.04-.04-.04-.06-.05z"/><path d="m24.96 40.57.19 1.19c.07-.01.14-.02.22-.04H25.43c.12-.02.25-.04.37-.07h.04l.29-.06-.25-1.17c-.3.04-.61.1-.92.15z"/><path d="m29 22-4.24-4.24-.71.7 3.04 3.04H16v1h11.09l-3.04 3.04.71.7 3.53-3.53z"/></g></svg>',
12690        9: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44" width="44" height="44"><g><path d="M8.48 17.6h1.15l3.2 5.55.94 1.81h.06c-.06-.89-.14-1.87-.14-2.78V17.6h1.06v8.8H13.6l-3.2-5.55-.95-1.81H9.4c.05.89.13 1.82.13 2.75v4.62H8.48V17.6z"/><path d="M16.84 17.6h5.07v.95h-3.96v2.76h3.33v.95h-3.33v3.2h4.09v.95h-5.21V17.6z"/><path d="m25.17 21.86-2.4-4.26h1.22l1.2 2.25c.23.41.41.78.7 1.28h.05c.24-.5.41-.88.62-1.28l1.17-2.25h1.16l-2.4 4.32 2.57 4.49h-1.22l-1.3-2.38c-.23-.44-.47-.89-.75-1.42h-.05c-.25.53-.48.97-.71 1.42l-1.27 2.38H22.6l2.57-4.55z"/><path d="M31.74 18.55h-2.66v-.95h6.44v.95h-2.66v7.86h-1.12v-7.86z"/></g></svg>',
12691    };
12692    let navigation = '<div class="slide-nav-btn prev">' + navObj[n] + '</div><div class="slide-nav-btn next">' + navObj[n] + '</div>';
12693    return navigation;
12694}
12695
12696function extractBlocks(css) {
12697    if (!css || typeof css !== 'string') {
12698        return null;
12699    }
12700
12701    css = removeComments(css);
12702
12703    const blocks = [];
12704    let currentBlock = '';
12705    let braceDepth = 0;
12706    let inString = false;
12707    let stringChar = '';
12708    let inComment = false;
12709    let escaped = false;
12710    let isAtRule = false;
12711
12712    for (let i = 0; i < css.length; i++) {
12713        const char = css[i];
12714        const nextChar = css[i + 1];
12715
12716        // 이스케이프 문자 처리
12717        if (escaped) {
12718            currentBlock += char;
12719            escaped = false;
12720            continue;
12721        }
12722
12723        if (char === '\\') {
12724            escaped = true;
12725            currentBlock += char;
12726            continue;
12727        }
12728
12729        // 주석 처리
12730        if (!inString && char === '/' && nextChar === '*') {
12731            inComment = true;
12732            currentBlock += char;
12733            continue;
12734        }
12735
12736        if (inComment && char === '*' && nextChar === '/') {
12737            inComment = false;
12738            currentBlock += char + nextChar;
12739            i++; // nextChar도 건너뛰기
12740            continue;
12741        }
12742
12743        if (inComment) {
12744            currentBlock += char;
12745            continue;
12746        }
12747
12748        // 문자열 처리
12749        if (!inString && (char === '"' || char === "'")) {
12750            inString = true;
12751            stringChar = char;
12752            currentBlock += char;
12753            continue;
12754        }
12755
12756        if (inString && char === stringChar) {
12757            inString = false;
12758            stringChar = '';
12759            currentBlock += char;
12760            continue;
12761        }
12762
12763        if (inString) {
12764            currentBlock += char;
12765            continue;
12766        }
12767
12768        // @ 규칙 시작 감지
12769        if (char === '@' && braceDepth === 0 && currentBlock.trim() === '') {
12770            isAtRule = true;
12771        }
12772
12773        // 중괄호 처리
12774        if (char === '{') {
12775            braceDepth++;
12776            currentBlock += char;
12777            
12778            // @ 규칙의 첫 번째 중괄호인 경우, 내부 규칙들을 개별적으로 처리
12779            if (isAtRule && braceDepth === 1) {
12780                // @ 규칙의 헤더 부분을 저장
12781                const atRuleHeader = currentBlock.trim();
12782
12783                // 선택자 규칙을 포함할 수 있는 @ 규칙들만 재귀적으로 처리
12784                const selectorContainingAtRules = ['@media', '@supports', '@layer', '@container', '@scope', '@starting-style'];
12785                const shouldProcessInner = selectorContainingAtRules.some(rule => atRuleHeader.startsWith(rule));
12786                
12787                
12788                // 내부 CSS 찾기
12789                let innerCss = '';
12790                let innerBraceDepth = 1;
12791                let j = i + 1;
12792                
12793                while (j < css.length && innerBraceDepth > 0) {
12794                    const innerChar = css[j];
12795                    if (innerChar === '{') {
12796                        innerBraceDepth++;
12797                    } else if (innerChar === '}') {
12798                        innerBraceDepth--;
12799                    }
12800                    
12801                    if (innerBraceDepth > 0) {
12802                        innerCss += innerChar;
12803                    }
12804                    j++;
12805                }
12806                
12807                // 선택자 규칙을 포함할 수 있는 @ 규칙만 재귀적으로 처리
12808                if (shouldProcessInner) {
12809                    // 주석을 완전히 제거한 후 재귀 처리
12810                    const cleanedInnerCss = removeComments(innerCss);
12811                    const innerBlocks = extractBlocks(cleanedInnerCss);
12812                    if (innerBlocks) {
12813                        blocks.push(...innerBlocks);
12814                    }
12815                }
12816                
12817                // // @ 규칙 전체를 하나의 블록으로도 추가 (특별 케이스 처리용)
12818                // const fullAtRule = css.substring(css.indexOf(atRuleHeader), j);
12819                // blocks.push(fullAtRule.trim());
12820                
12821                // 인덱스 조정하고 초기화
12822                i = j - 1;
12823                currentBlock = '';
12824                braceDepth = 0;
12825                isAtRule = false;
12826                continue;
12827            }
12828        } else if (char === '}') {
12829            braceDepth--;
12830            currentBlock += char;
12831            
12832            // 일반 블록이 완료되었을 때
12833            if (braceDepth === 0 && !isAtRule) {
12834                const trimmedBlock = currentBlock.trim();
12835                if (trimmedBlock) {
12836                    blocks.push(trimmedBlock);
12837                }
12838                currentBlock = '';
12839            }
12840        } else {
12841            currentBlock += char;
12842        }
12843    }
12844
12845    // 마지막에 남은 블록이 있다면
12846    const trimmedBlock = currentBlock.trim();
12847    if (trimmedBlock && braceDepth === 0) {
12848        blocks.push(trimmedBlock);
12849    }
12850
12851    return blocks.length > 0 ? blocks : null;
12852}
12853
12854function removeComments(css) {
12855    return css.replace(/\/\*[\s\S]*?\*\//g, '');
12856}
12857
12858function navigateToInvalidSelector(css, invalidSelector, selectorIndex, blockStart) {
12859    // 블록 내에서 해당 선택자의 정확한 위치 찾기
12860    let selectorStart = blockStart;
12861    
12862    // 선택자들을 순회하며 해당 인덱스의 위치 찾기
12863    const block = css.substring(blockStart);
12864    const selectorPart = block.split('{')[0];
12865    const selectors = selectorPart.split(',');
12866    
12867    for (let i = 0; i <= selectorIndex; i++) {
12868        if (i === 0) {
12869            // 첫 번째 선택자는 블록 시작부터
12870            selectorStart = blockStart;
12871        } else {
12872            // 이후 선택자들은 이전 쉼표 이후부터 찾기
12873            const prevSelectorEnd = css.indexOf(',', selectorStart);
12874            if (prevSelectorEnd !== -1) {
12875                selectorStart = prevSelectorEnd + 1;
12876                // 공백 및 개행 문자 스킵
12877                while (selectorStart < css.length && /\s/.test(css[selectorStart])) {
12878                    selectorStart++;
12879                }
12880            }
12881        }
12882        
12883        if (i === selectorIndex) {
12884            // 실제 잘못된 선택자의 시작 위치 찾기
12885            const trimmedSelector = selectors[i].trim();
12886            const actualStart = css.indexOf(trimmedSelector, selectorStart);
12887            if (actualStart !== -1) {
12888                selectorStart = actualStart;
12889            }
12890            break;
12891        }
12892    }
12893
12894    const lines = css.substring(0, selectorStart).split('\n');
12895    const line = lines.length - 1;
12896    const ch = lines[lines.length - 1].length;
12897
12898    // 현재 커서 위치 가져오기
12899    const currentCursor = editorCss.getCursor();
12900    const currentLine = currentCursor.line;
12901
12902    // 에러 라인과 현재 라인 비교해서 스크롤 방향 결정
12903    if (line > currentLine) {
12904        // 에러가 아래쪽에 있으면 조금 더 아래로 스크롤
12905        editorCss.scrollIntoView({line: line + 10, ch: 0});
12906    } else if (line < currentLine) {
12907        // 에러가 위쪽에 있으면 조금 더 위로 스크롤  
12908        editorCss.scrollIntoView({line: Math.max(0, line - 10), ch: 0});
12909    } else {
12910        // 같은 라인이면 기본 스크롤
12911        editorCss.scrollIntoView({line: line + 10, ch: ch});
12912    }
12913
12914    // 커서 이동 및 포커스
12915    editorCss.setCursor(line, ch);
12916    editorCss.focus();
12917
12918    console.log(`Invalid selector "${invalidSelector}" highlighted at line ${line + 1}, column ${ch + 1}`);
12919}
12920
12921function startsWithELClassName(selector, ELClassName) {
12922    if (!selector.startsWith(ELClassName)) {
12923        return false;
12924    }
12925    
12926    // ELClassName 다음 문자가 없거나, 공백, ., :, [, > 등의 CSS 선택자 구분자인지 확인
12927    const nextCharIndex = ELClassName.length;
12928    if (nextCharIndex >= selector.length) {
12929        return true;
12930    }
12931    
12932    const nextChar = selector[nextCharIndex];
12933    return /[\s.:#\[>+~,]/.test(nextChar);
12934}
12935
12936function isValidSelector(selector, ELClassName) {
12937    // ELClassName이 selector에 있는지 찾기
12938    const index = selector.indexOf(ELClassName);
12939    
12940    // ELClassName이 아예 없음
12941    const checkClsname = (ELClassName == 'menu') ? false : true;
12942    if (checkClsname && index === -1) {
12943        return $.lang[LANG]['editor.css.userELClassError'].replace("{elClass}", ELClassName);
12944    }
12945    
12946    // ELClassName이 있으면 다음 문자 확인
12947    const nextCharIndex = index + ELClassName.length;
12948    
12949    // 끝까지 일치하거나, 다음 문자가 CSS 구분자인지 확인
12950    if (nextCharIndex >= selector.length || /[\s.:#\[>+~,]/.test(selector[nextCharIndex])) {
12951        return null; // 유효함
12952    } else {
12953        // ELClassName 뒤에 다른 문자가 붙어있음 (예: .userEL939385598인데 .userEL939385598123일때)
12954        return $.lang[LANG]['editor.css.userELClassError'].replace("{elClass}", ELClassName);
12955    }
12956}
12957
12958function hasUserELClass(css) {
12959    // const ELClassName = '.userEL' + $('#el-save').data('seq');
12960    const ELClassName = $('#tpl-prop-name').val();
12961    const blocks = extractBlocks(css);
12962    if (blocks) {
12963        for (const block of blocks) {
12964            const selectorPart = block.split('{')[0].trim();
12965            const selectors = selectorPart.split(',').map(s => s.trim());
12966            
12967            for (let i = 0; i < selectors.length; i++) {
12968                const selector = selectors[i];
12969                const errorMsg = isValidSelector(selector, ELClassName);
12970                if (errorMsg) {
12971                    const blockStart = css.indexOf(block);
12972                    navigateToInvalidSelector(css, selector, i, blockStart);
12973                    return errorMsg;
12974                }
12975            }
12976        }
12977    }
12978    
12979    return null;
12980}
12981
12982function normalizeHtmlRootUserELClass(tag, seq) {
12983    if (!seq || seq === 'menu' || seq === 'footer') return tag;
12984
12985    const rawTag = tag || '';
12986    const requiredClass = 'userEL' + seq;
12987    const $wrap = $('<div>').html(rawTag);
12988    const $root = $wrap.children().first();
12989
12990    if ($root.length === 0) return tag;
12991
12992    if ($root.hasClass(requiredClass)) {
12993        return $wrap.html();
12994    }
12995
12996    return `<div class="${requiredClass}">${$wrap.html()}</div>`;
12997}
12998
12999function checkBracesNested(css) {
13000    let stack = [];
13001    let commentOpen = false;
13002
13003    for (let i = 0; i < css.length; i++) {
13004        if (!commentOpen && css[i] === '/' && css[i+1] === '*') commentOpen = true;
13005        else if (commentOpen && css[i-1] === '*' && css[i] === '/') commentOpen = false;
13006
13007        if (!commentOpen) {
13008            if (css[i] === '{') stack.push('{');
13009            if (css[i] === '}') {
13010                if (stack.length === 0) return $.lang[LANG]['editor.css.openBraceError'];
13011                stack.pop();
13012            }
13013        }
13014    }
13015
13016    if (stack.length > 0) return $.lang[LANG]['editor.css.closeBraceError'];
13017    return null;
13018}
13019
13020function checkCommentClosed(css) {
13021    let commentOpen = false;
13022
13023    for (let i = 0; i < css.length; i++) {
13024        if (!commentOpen && css[i] === '/' && css[i+1] === '*') commentOpen = true;
13025        else if (commentOpen && css[i-1] === '*' && css[i] === '/') commentOpen = false;
13026    }
13027
13028    if (commentOpen) return $.lang[LANG]['editor.css.commentError'];
13029    return null;
13030}

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.