(function(){if('Discourse'in window&&Discourse.__container__){Discourse.__container__.lookup("service:theme-settings").registerSettings(26,{"linked_words":"staking, https://trustwallet.com/earn|stake, https://trustwallet.com/earn|earn, https://trustwallet.com/earn|dapp, https://trustwallet.com/dapp|assets, https://trustwallet.com/assets|collectibles, https://trustwallet.com/collectibles-wallet|stablecoins, https://trustwallet.com/stablecoins|buy bnb, https://trustwallet.com/buy-bnb|buy btc, https://trustwallet.com/buy-bitcoin|buy eth, https://trustwallet.com/buy-ethereum|buy tron, https://trustwallet.com/buy-tron|buy atom, https://trustwallet.com/buy-atom","excluded_tags":"code|pre","excluded_classes":"onebox"});}})();define("discourse-linkify/initializers/initialize-discourse-linkify",["exports","discourse/lib/plugin-api","../lib/utilities"],function(_exports,_pluginApi,_utilities){"use strict";Object.defineProperty(_exports,"__esModule",{value:true});_exports.default=void 0;var __theme_name__="Auto linkify words";var settings=Discourse.__container__.lookup("service:theme-settings").getObjectForTheme(26);var themePrefix=function themePrefix(key){return "theme_translations.26.".concat(key);};var _default={name:'discourse-linkify-initializer',initialize:function initialize(){(0,_pluginApi.withPluginApi)("0.8.7",function(api){var skipTags={'a':1,'iframe':1};settings.excluded_tags.split('|').forEach(function(tag){tag=tag.trim().toLowerCase();if(tag!==''){skipTags[tag]=1;}});var skipClasses={};settings.excluded_classes.split('|').forEach(function(cls){cls=cls.trim().toLowerCase();if(cls!==''){skipClasses[cls]=1;}});var createLink=function createLink(text,url){var link=document.createElement('a');link.innerHTML=text;link.href=url;link.rel='nofollow';link.target='_blank';link.className='linkify-word no-track-link';return link;};var Action=function Action(inputListName,method){this.inputListName=inputListName;this.createNode=method;this.inputs={};};var linkify=new Action('linked_words',createLink);var actions=[linkify];actions.forEach(_utilities.readInputList);api.decorateCooked(function($elem){actions.forEach(function(action){if(Object.keys(action.inputs).length>0){(0,_utilities.traverseNodes)($elem[0],action,skipTags,skipClasses);}});},{'id':'linkify-words-theme'});});}};_exports.default=_default;});define("discourse-linkify/lib/utilities",["exports"],function(_exports){"use strict";Object.defineProperty(_exports,"__esModule",{value:true});_exports.traverseNodes=_exports.readInputList=void 0;function _instanceof(left,right){if(right!=null&&typeof Symbol!=="undefined"&&right[Symbol.hasInstance]){return!!right[Symbol.hasInstance](left);}else{return left instanceof right;}}
var __theme_name__="Auto linkify words";var settings=Discourse.__container__.lookup("service:theme-settings").getObjectForTheme(26);var themePrefix=function themePrefix(key){return "theme_translations.26.".concat(key);};var readInputList=function readInputList(action){if(settings[action.inputListName].trim()===''){return;}
settings[action.inputListName].split('|').forEach(function(pair){if(!pair.includes(',')){return;}
var split=pair.split(',');var value=split.pop().trim();var word=split.join(',').trim();if(value===''||word===''){return;}
action.inputs[word]=value;});};_exports.readInputList=readInputList;var isInputRegex=function isInputRegex(input){if(input[0]==='/'&&input.split('/').length>2)return true;else return false;};var escapeRegExp=function escapeRegExp(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");};var prepareRegex=function prepareRegex(input){var leftWordBoundary="(\\s|[:.;,!?…\\([{]|^)";var rightWordBoundary="(?=[:.;,!?…\\]})]|\\s|$)";var wordOrRegex,modifier,regex;if(isInputRegex(input)){var tmp=input.split('/');modifier=tmp.pop();wordOrRegex=tmp.slice(1).join('/');if(modifier.includes('i')){modifier='ig';}else{modifier='g';}}else{modifier='i';wordOrRegex=escapeRegExp(input);}
try{regex=new RegExp(leftWordBoundary+'('+wordOrRegex+')'+rightWordBoundary,modifier);}catch(err){console.log("ERROR from auto-linkify theme: Invalid input:");console.log(wordOrRegex);console.log(err.message);return;}
return regex;};var executeRegex=function executeRegex(regex,str,value,matches){if(!_instanceof(regex,RegExp)){return;}
var match=regex.exec(str);if(match===null){return;}
do{match.value=value;matches.push(match);}while(regex.global&&(match=regex.exec(str))!==null);};var replaceCapturedVariables=function replaceCapturedVariables(input,match){if(match.length<=3)return input;var captured=match.slice(3,match.length);var replaced=input;for(var i=captured.length;i>0;i--){var re=new RegExp("\\$"+i.toString(),"");replaced=replaced.replace(re,captured[i-1]);}
return replaced;};var modifyText=function modifyText(text,action){var words=action.inputs;var inputRegexes=Object.keys(words).filter(isInputRegex);var sortedWords=Object.keys(words).filter(function(x){return!isInputRegex(x);}).sort(function(x,y){return y.length-x.length;});var keys=inputRegexes.concat(sortedWords);var matches=[];for(var i=0;i<keys.length;i++){var word=keys[i];var value=words[word];var regex=prepareRegex(word);executeRegex(regex,text.data,value,matches);}
var sortedMatches=matches.sort(function(m,n){return n.index-m.index;});for(var _i=0;_i<sortedMatches.length;_i++){var match=sortedMatches[_i];var matchedLeftBoundary=match[1];var matchedWord=match[2];var _value=replaceCapturedVariables(match.value,match);if(match.index+matchedLeftBoundary.length+matchedWord.length>text.data.length){continue;}
text.splitText(match.index+matchedLeftBoundary.length);text.nextSibling.splitText(matchedWord.length);text.parentNode.replaceChild(action.createNode(matchedWord,_value),text.nextSibling);}};var isSkippedClass=function isSkippedClass(classes,skipClasses){return classes&&classes.split(" ").some(function(cls){return cls in skipClasses;});};var traverseNodes=function traverseNodes(elem,action,skipTags,skipClasses){for(var i=elem.childNodes.length-1;i>=0;i--){var child=elem.childNodes[i];if(child.nodeType===1){var tag=child.nodeName.toLowerCase();var cls=child.getAttribute("class");if(!(tag in skipTags)&&!isSkippedClass(cls,skipClasses)){traverseNodes(child,action,skipTags,skipClasses);}}else if(child.nodeType===3){modifyText(child,action);}}};_exports.traverseNodes=traverseNodes;});