1/** 2* DO NOT EDIT THIS FILE. 3* See the following change record for more information, 4* https://www.drupal.org/node/2815083 5* @preserve 6**/ 7 8window.Drupal = { behaviors: {}, locale: {} }; 9 10(function (Drupal, drupalSettings, drupalTranslations, console, Proxy, Reflect) { 11 Drupal.throwError = function (error) { 12 setTimeout(function () { 13 throw error; 14 }, 0); 15 }; 16 17 Drupal.attachBehaviors = function (context, settings) { 18 context = context || document; 19 settings = settings || drupalSettings; 20 var behaviors = Drupal.behaviors; 21 22 Object.keys(behaviors || {}).forEach(function (i) { 23 if (typeof behaviors[i].attach === 'function') { 24 try { 25 behaviors[i].attach(context, settings); 26 } catch (e) { 27 Drupal.throwError(e); 28 } 29 } 30 }); 31 }; 32 33 Drupal.detachBehaviors = function (context, settings, trigger) { 34 context = context || document; 35 settings = settings || drupalSettings; 36 trigger = trigger || 'unload'; 37 var behaviors = Drupal.behaviors; 38 39 Object.keys(behaviors || {}).forEach(function (i) { 40 if (typeof behaviors[i].detach === 'function') { 41 try { 42 behaviors[i].detach(context, settings, trigger); 43 } catch (e) { 44 Drupal.throwError(e); 45 } 46 } 47 }); 48 }; 49 50 Drupal.checkPlain = function (str) { 51 str = str.toString().replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, '''); 52 return str; 53 }; 54 55 Drupal.formatString = function (str, args) { 56 var processedArgs = {}; 57 58 Object.keys(args || {}).forEach(function (key) { 59 switch (key.charAt(0)) { 60 case '@': 61 processedArgs[key] = Drupal.checkPlain(args[key]); 62 break; 63 64 case '!': 65 processedArgs[key] = args[key]; 66 break; 67 68 default: 69 processedArgs[key] = Drupal.theme('placeholder', args[key]); 70 break; 71 } 72 }); 73 74 return Drupal.stringReplace(str, processedArgs, null); 75 }; 76 77 Drupal.stringReplace = function (str, args, keys) { 78 if (str.length === 0) { 79 return str; 80 } 81 82 if (!Array.isArray(keys)) { 83 keys = Object.keys(args || {}); 84 85 keys.sort(function (a, b) { 86 return a.length - b.length; 87 }); 88 } 89 90 if (keys.length === 0) { 91 return str; 92 } 93 94 var key = keys.pop(); 95 var fragments = str.split(key); 96 97 if (keys.length) { 98 for (var i = 0; i < fragments.length; i++) { 99 fragments[i] = Drupal.stringReplace(fragments[i], args, keys.slice(0)); 100 } 101 } 102 103 return fragments.join(args[key]); 104 }; 105 106 Drupal.t = function (str, args, options) { 107 options = options || {}; 108 options.context = options.context || ''; 109 110 if (typeof drupalTranslations !== 'undefined' && drupalTranslations.strings && drupalTranslations.strings[options.context] && drupalTranslations.strings[options.context][str]) { 111 str = drupalTranslations.strings[options.context][str]; 112 } 113 114 if (args) { 115 str = Drupal.formatString(str, args); 116 } 117 return str; 118 }; 119 120 Drupal.url = function (path) { 121 return drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix + path; 122 }; 123 124 Drupal.url.toAbsolute = function (url) { 125 var urlParsingNode = document.createElement('a'); 126 127 try { 128 url = decodeURIComponent(url); 129 } catch (e) {} 130 131 urlParsingNode.setAttribute('href', url); 132 133 return urlParsingNode.cloneNode(false).href; 134 }; 135 136 Drupal.url.isLocal = function (url) { 137 var absoluteUrl = Drupal.url.toAbsolute(url); 138 var protocol = window.location.protocol; 139 140 if (protocol === 'http:' && absoluteUrl.indexOf('https:') === 0) { 141 protocol = 'https:'; 142 } 143 var baseUrl = protocol + '//' + window.location.host + drupalSettings.path.baseUrl.slice(0, -1); 144 145 try { 146 absoluteUrl = decodeURIComponent(absoluteUrl); 147 } catch (e) {} 148 try { 149 baseUrl = decodeURIComponent(baseUrl); 150 } catch (e) {} 151 152 return absoluteUrl === baseUrl || absoluteUrl.indexOf(baseUrl + '/') === 0; 153 }; 154 155 Drupal.formatPlural = function (count, singular, plural, args, options) { 156 args = args || {}; 157 args['@count'] = count; 158 159 var pluralDelimiter = drupalSettings.pluralDelimiter; 160 var translations = Drupal.t(singular + pluralDelimiter + plural, args, options).split(pluralDelimiter); 161 var index = 0; 162 163 if (typeof drupalTranslations !== 'undefined' && drupalTranslations.pluralFormula) { 164 index = count in drupalTranslations.pluralFormula ? drupalTranslations.pluralFormula[count] : drupalTranslations.pluralFormula.default; 165 } else if (args['@count'] !== 1) { 166 index = 1; 167 } 168 169 return translations[index]; 170 }; 171 172 Drupal.encodePath = function (item) { 173 return window.encodeURIComponent(item).replace(/%2F/g, '/'); 174 }; 175 176 Drupal.deprecationError = function (_ref) { 177 var message = _ref.message; 178 179 if (drupalSettings.suppressDeprecationErrors === false && typeof console !== 'undefined' && console.warn) { 180 console.warn('[Deprecation] ' + message); 181 } 182 }; 183 184 Drupal.deprecatedProperty = function (_ref2) { 185 var target = _ref2.target, 186 deprecatedProperty = _ref2.deprecatedProperty, 187 message = _ref2.message; 188 189 if (!Proxy || !Reflect) { 190 return target; 191 } 192 193 return new Proxy(target, { 194 get: function get(target, key) { 195 for (var _len = arguments.length, rest = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { 196 rest[_key - 2] = arguments[_key]; 197 } 198 199 if (key === deprecatedProperty) { 200 Drupal.deprecationError({ message: message }); 201 } 202 return Reflect.get.apply(Reflect, [target, key].concat(rest)); 203 } 204 }); 205 }; 206 207 Drupal.theme = function (func) { 208 if (func in Drupal.theme) { 209 var _Drupal$theme; 210 211 for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { 212 args[_key2 - 1] = arguments[_key2]; 213 } 214
215 return (_Drupal$theme = Drupal.theme)[func].apply(_Drupal$theme, args); 216 } 217 }; 218 219 Drupal.theme.placeholder = function (str) { 220 return '<em class="placeholder">' + Drupal.checkPlain(str) + '</em>'; 221 }; 222})(Drupal, window.drupalSettings, window.drupalTranslations, window.console, window.Proxy, window.Reflect);
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.