PageSourceSearch

https://www.deutsche-juristinnen-voelkerrecht.org/wp-content/plugi…/website-translator/js/float.js?ver=3.0.8-1

js deutsche-juristinnen-voelkerrecht.org collected 2026-09-24 11:38:37 UTC 23,413 bytes, 276 lines download raw bytes

1(function(){
2    var gt = window.websiteTranslatorSettings || {};
3    gt = gt[document.currentScript.getAttribute('data-iwt-widget-id')] || gt;
4
5    if(gt.default_language == null) {
6        console.log('gtranslateSettings is not properly initialized');
7        return;
8    }
9
10    var lang_array_english = {"af":"Afrikaans","sq":"Albanian","am":"Amharic","ar":"Arabic","hy":"Armenian","az":"Azerbaijani","eu":"Basque","be":"Belarusian","bn":"Bengali","bs":"Bosnian","bg":"Bulgarian","ca":"Catalan","ceb":"Cebuano","ny":"Chichewa","zh-CN":"Chinese (Simplified)","zh-TW":"Chinese (Traditional)","co":"Corsican","hr":"Croatian","cs":"Czech","da":"Danish","nl":"Dutch","en":"English","eo":"Esperanto","et":"Estonian","tl":"Filipino","fi":"Finnish","fr":"French","fy":"Frisian","gl":"Galician","ka":"Georgian","de":"German","el":"Greek","gu":"Gujarati","ht":"Haitian Creole","ha":"Hausa","haw":"Hawaiian","iw":"Hebrew","hi":"Hindi","hmn":"Hmong","hu":"Hungarian","is":"Icelandic","ig":"Igbo","id":"Indonesian","ga":"Irish","it":"Italian","ja":"Japanese","jw":"Javanese","kn":"Kannada","kk":"Kazakh","km":"Khmer","ko":"Korean","ku":"Kurdish (Kurmanji)","ky":"Kyrgyz","lo":"Lao","la":"Latin","lv":"Latvian","lt":"Lithuanian","lb":"Luxembourgish","mk":"Macedonian","mg":"Malagasy","ms":"Malay","ml":"Malayalam","mt":"Maltese","mi":"Maori","mr":"Marathi","mn":"Mongolian","my":"Myanmar (Burmese)","ne":"Nepali","no":"Norwegian","ps":"Pashto","fa":"Persian","pl":"Polish","pt":"Portuguese","pa":"Punjabi","ro":"Romanian","ru":"Russian","sm":"Samoan","gd":"Scottish Gaelic","sr":"Serbian","st":"Sesotho","sn":"Shona","sd":"Sindhi","si":"Sinhala","sk":"Slovak","sl":"Slovenian","so":"Somali","es":"Spanish","su":"Sundanese","sw":"Swahili","sv":"Swedish","tg":"Tajik","ta":"Tamil","te":"Telugu","th":"Thai","tr":"Turkish","uk":"Ukrainian","ur":"Urdu","uz":"Uzbek","vi":"Vietnamese","cy":"Welsh","xh":"Xhosa","yi":"Yiddish","yo":"Yoruba","zu":"Zulu"};
11    var lang_array_native = {"af":"Afrikaans","sq":"Shqip","am":"\u12a0\u121b\u122d\u129b","ar":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","hy":"\u0540\u0561\u0575\u0565\u0580\u0565\u0576","az":"Az\u0259rbaycan dili","eu":"Euskara","be":"\u0411\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f \u043c\u043e\u0432\u0430","bn":"\u09ac\u09be\u0982\u09b2\u09be","bs":"Bosanski","bg":"\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438","ca":"Catal\u00e0","ceb":"Cebuano","ny":"Chichewa","zh-CN":"\u7b80\u4f53\u4e2d\u6587","zh-TW":"\u7e41\u9ad4\u4e2d\u6587","co":"Corsu","hr":"Hrvatski","cs":"\u010ce\u0161tina\u200e","da":"Dansk","nl":"Nederlands","en":"English","eo":"Esperanto","et":"Eesti","tl":"Filipino","fi":"Suomi","fr":"Fran\u00e7ais","fy":"Frysk","gl":"Galego","ka":"\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8","de":"Deutsch","el":"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac","gu":"\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0","ht":"Kreyol ayisyen","ha":"Harshen Hausa","haw":"\u014clelo Hawai\u02bbi","iw":"\u05e2\u05b4\u05d1\u05b0\u05e8\u05b4\u05d9\u05ea","hi":"\u0939\u093f\u0928\u094d\u0926\u0940","hmn":"Hmong","hu":"Magyar","is":"\u00cdslenska","ig":"Igbo","id":"Bahasa Indonesia","ga":"Gaeilge","it":"Italiano","ja":"\u65e5\u672c\u8a9e","jw":"Basa Jawa","kn":"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1","kk":"\u049a\u0430\u0437\u0430\u049b \u0442\u0456\u043b\u0456","km":"\u1797\u17b6\u179f\u17b6\u1781\u17d2\u1798\u17c2\u179a","ko":"\ud55c\uad6d\uc5b4","ku":"\u0643\u0648\u0631\u062f\u06cc\u200e","ky":"\u041a\u044b\u0440\u0433\u044b\u0437\u0447\u0430","lo":"\u0e9e\u0eb2\u0eaa\u0eb2\u0ea5\u0eb2\u0ea7","la":"Latin","lv":"Latvie\u0161u valoda","lt":"Lietuvi\u0173 kalba","lb":"L\u00ebtzebuergesch","mk":"\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438 \u0458\u0430\u0437\u0438\u043a","mg":"Malagasy","ms":"Bahasa Melayu","ml":"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02","mt":"Maltese","mi":"Te Reo M\u0101ori","mr":"\u092e\u0930\u093e\u0920\u0940","mn":"\u041c\u043e\u043d\u0433\u043e\u043b","my":"\u1017\u1019\u102c\u1005\u102c","ne":"\u0928\u0947\u092a\u093e\u0932\u0940","no":"Norsk bokm\u00e5l","ps":"\u067e\u069a\u062a\u0648","fa":"\u0641\u0627\u0631\u0633\u06cc","pl":"Polski","pt":"Portugu\u
1100eas","pa":"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40","ro":"Rom\u00e2n\u0103","ru":"\u0420\u0443\u0441\u0441\u043a\u0438\u0439","sm":"Samoan","gd":"G\u00e0idhlig","sr":"\u0421\u0440\u043f\u0441\u043a\u0438 \u0458\u0435\u0437\u0438\u043a","st":"Sesotho","sn":"Shona","sd":"\u0633\u0646\u068c\u064a","si":"\u0dc3\u0dd2\u0d82\u0dc4\u0dbd","sk":"Sloven\u010dina","sl":"Sloven\u0161\u010dina","so":"Afsoomaali","es":"Espa\u00f1ol","su":"Basa Sunda","sw":"Kiswahili","sv":"Svenska","tg":"\u0422\u043e\u04b7\u0438\u043a\u04e3","ta":"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd","te":"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41","th":"\u0e44\u0e17\u0e22","tr":"T\u00fcrk\u00e7e","uk":"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430","ur":"\u0627\u0631\u062f\u0648","uz":"O\u2018zbekcha","vi":"Ti\u1ebfng Vi\u1ec7t","cy":"Cymraeg","xh":"isiXhosa","yi":"\u05d9\u05d9\u05d3\u05d9\u05e9","yo":"Yor\u00f9b\u00e1","zu":"Zulu"};
12
13    var default_language = gt.default_language;
14    var languages = gt.languages||Object.keys(lang_array_english);
15    var alt_flags = gt.alt_flags||{};
16    var flag_style = gt.flag_style||'2d';
17    var flags_location = gt.flags_location;
18    var url_structure = gt.url_structure||'none';
19    var custom_domains = gt.custom_domains||{};
20    var switcher_horizontal_position = gt.switcher_horizontal_position||'left';
21    var switcher_vertical_position = gt.switcher_vertical_position||'bottom';
22    var float_switcher_open_direction = gt.float_switcher_open_direction||'top';
23    var native_language_names = gt.native_language_names||false;
24    var detect_browser_language = gt.detect_browser_language||false;
25    var wrapper_selector = gt.wrapper_selector||'.iwt_wrapper';
26
27    var custom_css = gt.custom_css||'';
28    var lang_array = native_language_names && lang_array_native || lang_array_english;
29
30    var u_class = '.iwt_container-'+Array.from('float'+wrapper_selector).reduce(function(h,c){return 0|(31*h+c.charCodeAt(0))},0).toString(36);
31
32    var widget_code = '';
33    var widget_css = custom_css;
34
35    flags_location += (flag_style=='3d'?32:'svg')+'/';
36    var flag_ext = flag_style=='3d'?'.png':'.svg';
37
38    // helper functions
39    function get_flag_src(lang) {
40        if(!alt_flags[lang])
41            return flags_location+lang+flag_ext;
42        else if(alt_flags[lang] == 'usa')
43            return flags_location+'en-us'+flag_ext;
44        else if(alt_flags[lang] == 'canada')
45            return flags_location+'en-ca'+flag_ext;
46        else if(alt_flags[lang] == 'brazil')
47            return flags_location+'pt-br'+flag_ext;
48        else if(alt_flags[lang] == 'mexico')
49            return flags_location+'es-mx'+flag_ext;
50        else if(alt_flags[lang] == 'argentina')
51            return flags_location+'es-ar'+flag_ext;
52        else if(alt_flags[lang] == 'colombia')
53            return flags_location+'es-co'+flag_ext;
54        else if(alt_flags[lang] == 'quebec')
55            return flags_location+'fr-qc'+flag_ext;
56        else
57            return alt_flags[lang];
58    }
59
60    function get_lang_href(lang) {
61        var href = '#';
62
63        if(url_structure == 'sub_directory') {
64            var gt_request_uri = (document.currentScript.getAttribute('data-iwt-orig-url') || (location.pathname.startsWith('/'+current_lang+'/') && '/'+location.pathname.split('/').slice(2).join('/') || location.pathname)) + location.search + location.hash;
65            href = (lang == default_language) && location.protocol+'//'+location.hostname+gt_request_uri || location.protocol+'//'+location.hostname+'/'+lang+gt_request_uri;
66        } else if(url_structure == 'sub_domain') {
67            var gt_request_uri = (document.currentScript.getAttribute('data-iwt-orig-url') || location.pathname) + location.search + location.hash;
68            var domain = document.currentScript.getAttribute('data-iwt-orig-domain') || location.hostname;
69            if(typeof custom_domains == 'object' && custom_domains[lang])
70                href = (lang == default_language) && location.protocol+'//'+domain+gt_request_uri || location.protocol+'//'+custom_domains[lang]+gt_request_uri;
71            else
72                href = (lang == default_language) && location.protocol+'//'+domain+gt_request_uri || location.protocol+'//'+lang+'.'+domain.replace(/^www\./, '')+gt_request_uri;
73        }
74
75        return href;
76    }
77
78    var current_lang = document.querySelector('html').getAttribute('lang')||default_language;
79    if(url_structure == 'none') {
80        var googtrans_matches = document.cookie.match('(^|;) ?googtrans=([^;]*)(;|$)');
81        current_lang = googtrans_matches && googtrans_matches[2].split('/')[2] || current_lang;
82    }
83
84    if(!lang_array[current_lang])
85        current_lang = default_language;
86
87    if(url_structure == 'none') {
88        widget_code += '<div id="google_translate_element2"></div>';
89
90        widget_css += "div.skiptranslate,#google_translate_element2{display:none!important}";
91        widget_css += "body{top:0!important}";
92        widget_css += "font font{background-color:transparent!important;box-shadow:none!important;position:initial!important}";
93    }
94
95    widget_css += '.iwt_float_switcher{font-family:Arial;font-size:20px;border-radius:2px;color:#555;display:inline-block;line-height:20px;box-shadow:rgba(0,0,0,0.15) 0 5px 15px;background:#fff;overflow:hidden;transition:all .5s cubic-bezier(0.4, 0, 1, 1)}';
96    widget_css += '.iwt_float_switcher img{vertical-align:middle;display:inline-block;width:33px;
96height:auto;margin:0 5px 0 0;border-radius:3px}';
97    if(float_switcher_open_direction == 'left' || float_switcher_open_direction == 'right') {
98        var max_width = 0.7 * window.innerWidth - 120;
99        if(window.innerWidth < 1000)
100            max_width = window.innerWidth - 260;
101        max_width += 'px';
102
103        if(switcher_horizontal_position == 'inline')
104            max_width = 'calc(100% - 122px)';
105
106        // todo: optimize
107        widget_css += '.iwt_float_switcher .iwt_options{position:relative;z-index:777;white-space:nowrap;float:'+float_switcher_open_direction+';max-width:'+max_width+';overflow:hidden;transform:translateX(-'+window.innerWidth+'px);opacity:0;cursor:pointer;transition:all .8s cubic-bezier(.3,1.1,.4,1.1)}';
108        widget_css += '.iwt_float_switcher .iwt_options a{display:inline-block;text-decoration:none;padding:'+(flag_style=='3d'?6:10)+'px 15px;color:#444;transition:color .4s linear}';
109        widget_css += '.iwt_float_switcher .iwt-selected{position:relative;z-index:888;background-color:#fff;float:left;cursor:pointer;text-transform:uppercase;overflow:hidden;'+(switcher_horizontal_position != 'inline' && 'text-align:'+switcher_horizontal_position)+'}';
110    } else {
111        widget_css += '.iwt_float_switcher .iwt_options{position:relative;z-index:777;max-height:250px;overflow-y:auto;transform:translateY(-30px);opacity:0;cursor:pointer;transition:all .8s cubic-bezier(.3,1.1,.4,1.1)}';
112        widget_css += '.iwt_float_switcher .iwt_options a{display:block;text-decoration:none;padding:'+(flag_style=='3d'?6:10)+'px 15px;color:#444;transition:color .4s linear}';
113        widget_css += '.iwt_float_switcher .iwt-selected{position:relative;z-index:888;background-color:#fff;cursor:pointer;text-transform:uppercase;overflow:hidden;'+(switcher_horizontal_position != 'inline' && 'text-align:'+switcher_horizontal_position)+'}';
114    }
115    widget_css += '.iwt_float_switcher .iwt_options.iwt-open{opacity:1;transform:translateX(0px)}';
116
117    widget_css += '.iwt_float_switcher .iwt_options::-webkit-scrollbar-track{background-color:#f5f5f5}';
118    widget_css += '.iwt_float_switcher .iwt_options::-webkit-scrollbar{width:5px}';
119    widget_css += '.iwt_float_switcher .iwt_options::-webkit-scrollbar-thumb{background-color:#888}';
120    widget_css += '.iwt_float_switcher .iwt_options a:hover{background:#6070a0;color:#fff}';
121    widget_css += '.iwt_float_switcher .iwt_options a.iwt-current{display:none}';
122    widget_css += '.iwt_float_switcher .iwt-selected .iwt-current-lang{padding:'+(flag_style=='3d'?6:10)+'px 15px;color:#333;font-weight:bold}';
123    widget_css += '.iwt_float_switcher .iwt-selected .iwt-current-lang span.iwt-lang-code{position:relative;top:2px}';
124
125    var arr_angle = (float_switcher_open_direction == 'left'||float_switcher_open_direction == 'right')?90:0;
126    widget_css += ".iwt_float_switcher .iwt-selected .iwt-current-lang span.iwt_float_switcher-arrow{display:inline-block;height:24px;width:15px;vertical-align:middle;background-image:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 285 285'><path d='M282 76.5l-14.2-14.3a9 9 0 0 0-13.1 0L142.5 174.4 30.3 62.2a9 9 0 0 0-13.2 0L3 76.5a9 9 0 0 0 0 13.1l133 133a9 9 0 0 0 13.1 0l133-133a9 9 0 0 0 0-13z' style='fill:%23666'/></svg>\");background-position:50%;background-size:11px;background-repeat:no-repeat;transition:all .3s;transform:rotate("+(arr_angle-180)+"deg)}";
127    widget_css += '.iwt_float_switcher .iwt-selected .iwt-current-lang span.iwt_float_switcher-arrow.iwt_arrow_rotate{transform:rotate('+arr_angle+'deg)}';
128
129    if(switcher_horizontal_position == 'inline')
130        widget_code += '<div id="iwt_float_wrapper" tabindex="0" role="complementary" aria-label="Click here to change the website language"><div class="iwt_float_switcher notranslate" style="opacity:0">';
131    else
132        widget_code +=
133          '<div id="iwt_float_wrapper" tabindex="0" role="complementary" aria-label="Click here to change the website language" style="position:fixed;' +
134          switcher_vertical_position +
135          ":20px;" +
136          switcher_horizontal_position +
137          ':20px;z-index:999999;"><div class="iwt_switcher_wrapper iwt_float_switcher notranslate" style="opacity:0">';
138
139    var gt_current_div = '<div class="iwt-selected"><div class="iwt-current-lang"><img src="'+get_flag_src(current_lang)+'" alt="'+current_lang+'"> <span class="iwt-lang-code">'+current_lang+'</span> <span class="iwt_float_switcher-arrow"></span></div></div>';
140    var iwt_options_div = '<div class="iwt_options" style="display:none">';
141    languages.forEach(function(lang) {
142        var el_a = document.createElement('a');
143        el_a.href = get_lang_href(lang);
144        el_a.classList.add('nturl');
145        current_lang == lang && el_a.classList.add('iwt-current');
146        el_a.setAttribute('data-iwt-lang', lang);
147        el_a.setAttribute('role', 'button');
148
149        var el_img = document.createElement('img');
150        el_img.setAttribute('data-iwt-lazy-src', get_flag_src(lang));
151        el_img.alt = lang;
152
153        el_a.appendChild(el_img);
154        el_a.innerHTML += ' ' + lang_array[lang];
155
156        iwt_options_div += el_a.outerHTML;
157    });
158    iwt_options_div += '</div>';
159
160    if((switcher_vertical_position == 'top' && float_switcher_open_direction == 'bottom') || (switcher_vertical_position == 'bottom' && float_switcher_open_direction == 'bottom'))
161        widget_code += gt_current_div + iwt_options_div;
162    else
163        widget_code += iwt_options_div + gt_current_div;
164
165    widget_code += '</div></div>';
166
167    var add_css = document.createElement('style');
168    add_css.classList.add('iwt_css');
169    add_css.textContent = widget_css;
170    document.head.appendChild(add_css);
171
172    document.querySelectorAll(wrapper_selector).forEach(function(e){e.classList.add(u_class.substring(1));e.innerHTML+=widget_code});
173
174    if(url_structure == 'none') {
175        function get_current_lang() {var keyValue = document.cookie.match('(^|;) ?googtrans=([^;]*)(;|$)');return keyValue ? keyValue[2].split('/')[2] : null;}
176        function fire_event(element,event){try{if(document.createEventObject){var evt=document.createEventObject();element.fireEvent('on'+event,evt)}else{var evt=document.createEvent('HTMLEvents');evt.initEvent(event,true,true);element.dispatchEvent(evt)}}catch(e){}}
177        function load_tlib(){if(!window.iwt_translate_script){window.iwt_translate_script=document.createElement('script');iwt_translate_script.src='https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit2';document.body.appendChild(iwt_translate_script);}}
178        window.doIwt = function(lang_pair){if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];if(get_current_lang() == null && lang == lang_pair.split('|')[0])return;var teCombo;var sel=document.getElementsByTagName('select');for(var i=0;i<sel.length;i++)if(sel[i].className.indexOf('goog-te-combo')!=-1){teCombo=sel[i];break;}if(document.getElementById('google_translate_element2')==null||document.getElementById('google_translate_element2').innerHTML.length==0||teCombo.length==0||teCombo.innerHTML.length==0){setTimeout(function(){doIwt(lang_pair)},500)}else{teCombo.value=lang;fire_event(teCombo,'change');fire_event(teCombo,'change')}}
179        window.googleTranslateElementInit2=function(){new google.translate.TranslateElement({pageLanguage:default_language,autoDisplay:false},'google_translate_element2')};
180    }
181
182    var iwt_float_open = false;
183    function gt_hscroll(evt){var tgt = evt.target;if(tgt.tagName == 'A')tgt=tgt.parentNode;else if(tgt.tagName == 'IMG')tgt=tgt.parentNode.parentNode;if(evt.type == 'mousewheel'){evt.preventDefault();tgt.scrollLeft -= Math.sign(evt.wheelDelta) * 88;}else if(evt.type == 'touchstart'){gt_touchstart_posx = gt_touchstart_posx_static = evt.touches[0].pageX;gt_touchstart_timestamp = evt.timeStamp;}else if(evt.type == 'touchmove'){evt.preventDefault();tgt.scrollLeft += Math.sign(gt_touchstart_posx - evt.touches[0].pageX) * 10;gt_touchstart_posx = evt.touches[0].pageX;}else if(evt.type == 'touchend'){var scroll_speed = (gt_touchstart_posx_static - evt.changedTouches[0].pageX) / (evt.timeStamp - gt_touchstart_timestamp);tgt.scrollTo({left: tgt.scrollLeft + scroll_speed * 500, behavior: 'smooth'});}}
184    function gt_show_float_switcher(el){
185        iwt_float_open=true;
186        if(switcher_horizontal_position == 'inline')
187            el.querySelector(u_class + ' .iwt_options').style.maxWidth = (el.parentNode.clientWidth - el.clientWidth - 1) + 'px';
188        el.querySelectorAll(u_class + ' .iwt_options a img:not([src])').forEach(function(img){img.setAttribute('src', img.getAttribute('data-iwt-lazy-src'));});
189        el.querySelector(u_class + ' .iwt-selected span.iwt_float_switcher-arrow').classList.add('iwt_arrow_rotate');
190        el.querySelectorAll(u_class + ' .iwt_options').forEach(function(e){
191            e.style.display='block';
192            setTimeout(function(){
193                e.classList.add('iwt-open');
194                if(float_switcher_open_direction == 'left' || float_switcher_open_direction == 'right') {
195                    e.addEventListener('mousewheel', gt_hscroll);
196                    e.addEventListener('touchstart', gt_hscroll);
197                    e.addEventListener('touchmove', gt_hscroll);
198                    e.addEventListener('touchend', gt_hscroll);
199                }
200            },200);
201        });
202    }
203    function gt_hide_float_switcher(){
204        iwt_float_open=false;
205        document.querySelectorAll(u_class + ' .iwt_float_switcher .iwt-selected span.iwt_float_switcher-arrow.iwt_arrow_rotate').forEach(function(e){e.classList.remove('iwt_arrow_rotate')});
206        document.querySelectorAll(u_class + ' .iwt_float_switcher .iwt_options.iwt-open').forEach(function(e){
207            if(float_switcher_open_direction == 'left' || float_switcher_open_direction == 'right') {
208                e.removeEventListener('mousewheel', gt_hscroll);
209                e.removeEventListener('touchstart', gt_hscroll);
210                e.removeEventListener('touchmove', gt_hscroll);
211                e.removeEventListener('touchend', gt_hscroll);
212            }
213            e.classList.remove('iwt-open');
214            setTimeout(function(){e.style.display='none'},200);
215        });
216    }
217    function gt_update_float_language(el){
218        var lang=el.getAttribute('data-iwt-lang');
219        var img_src=el.parentNode.querySelector('a[data-iwt-lang="'+lang+'"] img').getAttribute('src');
220        setTimeout(function(){el.parentNode.querySelector('a.iwt-current').classList.remove('iwt-current');el.classList.add('iwt-current');},400);
221        el.parentNode.parentNode.querySelector('.iwt-selected img').setAttribute('src',img_src);
222        el.parentNode.parentNode.querySelector('.iwt-selected span.iwt-lang-code').innerText=lang;
223        gt_hide_float_switcher();
224    }
225
226    setTimeout(function(){document.querySelectorAll(u_class + ' .iwt_float_switcher').forEach(function(e){e.style.opacity=1})},20);
227    document.querySelectorAll(u_class + ' a[data-iwt-lang]').forEach(function(e){e.addEventListener('click',function(evt){
228        if(url_structure == 'none') {
229            evt.preventDefault();
230            doIwt(default_language+'|'+e.getAttribute('data-iwt-lang'));
231        }
232        gt_update_float_language(e);
233    })});
234
235    document.querySelectorAll(u_class + ' div.iwt-selected').forEach(function(e){
236        e.addEventListener('click',function(evt){evt.stopPropagation();if(iwt_float_open)gt_hide_float_switcher();else gt_show_float_switcher(e.parentNode);});
237        e.addEventListener('pointerenter',function(evt){evt.target.parentNode.querySelectorAll('.iwt_options img:not([src])').forEach(function(img){img.setAttribute('src', img.getAttribute('data-iwt-lazy-src'))})});
238    });
239
240    document.addEventListener('click',function(){if(iwt_float_open)gt_hide_float_switcher()});
241
242    document.getElementById('iwt_float_wrapper').addEventListener('keydown', function(evt) {
243        if (evt.key === 'Enter' || evt.key === ' ') {
244            evt.stopPropagation();
245            if(iwt_float_open)gt_hide_float_switcher();
246            else gt_show_float_switcher(evt.currentTarget);
247        }
248    });
249
250    if(detect_browser_language && window.localStorage && window.navigator && localStorage.getItem('iwt_autoswitch') == null && !/bot|spider|slurp|facebook/i.test(navigator.userAgent)) {
251        var accept_language = (navigator.language||navigator.userLanguage).toLowerCase();
252        switch(accept_language) {
253            case 'zh':
254            case 'zh-cn':var preferred_language = 'zh-CN';break;
255            case 'zh-tw':
256            case 'zh-hk':var preferred_language = 'zh-TW';break;
257            case 'he':var preferred_language = 'iw';break;
258            default:var preferred_language = accept_language.substr(0,2);break;
259        }
260
261        if(current_lang == default_language && preferred_language != default_language && languages.includes(preferred_language)) {
262            if(url_structure == 'none') {
263                load_tlib();
264                window.iwt_translate_script.onload=function(){
265                    doIwt(default_language+'|'+preferred_language);
266                    var el = document.querySelector(u_class+' a[data-iwt-lang="'+preferred_language+'"]');
267                    el.querySelectorAll('img:not([src])').forEach(function(e){e.setAttribute('src', e.getAttribute('data-iwt-lazy-src'))});
268                    gt_update_float_language(el);
269                };
270            } else
271                document.querySelectorAll(u_class+' a[data-iwt-lang="'+preferred_language+'"]').forEach(function(e){location.href=e.href});
272        }
273
274        localStorage.setItem('iwt_autoswitch', 1);
275    }
276})();

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.