mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-11-14 13:02:08 +00:00
1 line
No EOL
56 KiB
Text
1 line
No EOL
56 KiB
Text
{"version":3,"sources":["webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/ready.js","webpack:///./node_modules/unicode-astral-regex/index.js","webpack:///./node_modules/rails-ujs/lib/assets/compiled/rails-ujs.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/core/public.js","webpack:///./node_modules/stringz/dist/index.js"],"names":["ready","loaded","includes","document","readyState","addEventListener","module","exports","this","Rails","linkClickSelector","buttonClickSelector","selector","exclude","inputChangeSelector","formSubmitSelector","formInputClickSelector","formDisableSelector","formEnableSelector","fileInputSelector","linkDisableSelector","buttonDisableSelector","call","nonce","loadCSPNonce","ref","querySelector","content","cspNonce","m","Element","prototype","matches","matchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","webkitMatchesSelector","element","getData","key","setData","value","$","Array","slice","querySelectorAll","csrfParam","csrfToken","meta","CSRFProtection","xhr","token","setRequestHeader","refreshCSRFTokens","param","forEach","input","CustomEvent","fire","preventDefault","window","event","params","evt","createEvent","initCustomEvent","bubbles","cancelable","detail","Event","result","defaultPrevented","Object","defineProperty","get","obj","name","data","dispatchEvent","stopEverything","e","target","stopPropagation","stopImmediatePropagation","delegate","eventType","handler","parentNode","AcceptHeaders","createXHR","prepareOptions","processResponse","text","html","xml","json","script","ajax","options","response","responseText","getResponseHeader","Math","floor","status","success","statusText","error","complete","beforeSend","XMLHttpRequest","OPENED","send","url","location","href","type","toUpperCase","indexOf","dataType","accept","done","open","crossDomain","withCredentials","onreadystatechange","DONE","parser","match","JSON","parse","createElement","setAttribute","head","appendChild","removeChild","DOMParser","replace","parseFromString","isCrossDomain","originAnchor","urlAnchor","protocol","host","toArray","serializeElement","additionalParam","inputs","elements","disabled","option","selected","push","checked","map","encodeURIComponent","join","formElements","form","filter","el","allowAction","handleConfirm","answer","callback","message","getAttribute","confirm","disableFormElement","disableFormElements","disableLinkElement","enableFormElement","enableFormElements","enableLinkElement","handleDisabledElement","enableElement","disableElement","replacement","innerHTML","originalText","removeEventListener","handleMethod","formContent","method","action","style","display","body","click","isRemote","handleRemote","button","enctype","FormData","append","args","arguments","length","formSubmitButtonClick","formNoValidate","preventInsignificantClick","insignificantMetaClick","metaKey","ctrlKey","jQuery","rails","Error","ajaxPrefilter","originalOptions","start","_rails_loaded","setTimeout","require","contentEl","marginBottom","nodeName","getProfileAvatarAnimationHandler","swapTo","swapSrc","src","header","file","files","URL","createObjectURL","dataset","originalSrc","__importDefault","mod","__esModule","unicode_astral_regex_1","str","default","substring","begin","end","substr","len","strLength","parseInt","limit","padString","padPosition","String","padRepeats","repeat","searchStr","pos","Number","isNaN","strArr","index","searchArr","finded","searchIndex"],"mappings":"8FAAe,SAASA,EAAMC,GACxB,CAAC,cAAe,YAAYC,SAASC,SAASC,YAChDH,IAEAE,SAASE,iBAAiB,mBAAoBJ,GAJlD,gD,kBCIAK,EAAOC,QAAU,ye,mBCJjB,SAMA,YAEE,YACE,WACEC,KAAKC,MAAQ,CACXC,kBAAmB,yGACnBC,oBAAqB,CACnBC,SAAU,oEACVC,QAAS,eAEXC,oBAAqB,iEACrBC,mBAAoB,OACpBC,uBAAwB,6MACxBC,oBAAqB,sMACrBC,mBAAoB,4MACpBC,kBAAmB,yCACnBC,oBAAqB,wCACrBC,sBAAuB,+EAExBC,KAAKd,QACPc,KAnBWd,MAoBd,IAAIC,EApBUD,KAoBMC,OACpB,YACE,WACE,IAAIc,EACJA,EAAQ,KAERd,EAAMe,aAAe,WACnB,IAAIC,EACJ,OAAOF,EAAkE,OAAzDE,EAAMtB,SAASuB,cAAc,yBAAmCD,EAAIE,aAAU,GAGhGlB,EAAMmB,SAAW,WACf,OAAgB,MAATL,EAAgBA,EAAQd,EAAMe,kBAEtCF,KAAKd,MACR,WACE,IAAaqB,EACbA,EAAIC,QAAQC,UAAUC,SA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active', 'complete'].includes(document.readyState)) {\n loaded();\n } else {\n document.addEventListener('DOMContentLoaded', loaded);\n }\n}\n","// Borrowed from:\n// https://github.com/lodash/lodash/blob/master/lodash.js\n// https://github.com/mathiasbynens/regenerate\n// https://mathiasbynens.be/notes/javascript-unicode\nmodule.exports = /\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]?|[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*/g;","/*\nUnobtrusive JavaScript\nhttps://github.com/rails/rails/blob/master/actionview/app/assets/javascripts\nReleased under the MIT license\n */\n;\n(function () {\n var context = this;\n (function () {\n (function () {\n this.Rails = {\n linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]',\n buttonClickSelector: {\n selector: 'button[data-remote]:not([form]), button[data-confirm]:not([form])',\n exclude: 'form button'\n },\n inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',\n formSubmitSelector: 'form',\n formInputClickSelector: 'form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])',\n formDisableSelector: 'input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled',\n formEnableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled',\n fileInputSelector: 'input[name][type=file]:not([disabled])',\n linkDisableSelector: 'a[data-disable-with], a[data-disable]',\n buttonDisableSelector: 'button[data-remote][data-disable-with], button[data-remote][data-disable]'\n };\n }).call(this);\n }).call(context);\n var Rails = context.Rails;\n (function () {\n (function () {\n var nonce;\n nonce = null;\n\n Rails.loadCSPNonce = function () {\n var ref;\n return nonce = (ref = document.querySelector(\"meta[name=csp-nonce]\")) != null ? ref.content : void 0;\n };\n\n Rails.cspNonce = function () {\n return nonce != null ? nonce : Rails.loadCSPNonce();\n };\n }).call(this);\n (function () {\n var expando, m;\n m = Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector;\n\n Rails.matches = function (element, selector) {\n if (selector.exclude != null) {\n return m.call(element, selector.selector) && !m.call(element, selector.exclude);\n } else {\n return m.call(element, selector);\n }\n };\n\n expando = '_ujsData';\n\n Rails.getData = function (element, key) {\n var ref;\n return (ref = element[expando]) != null ? ref[key] : void 0;\n };\n\n Rails.setData = function (element, key, value) {\n if (element[expando] == null) {\n element[expando] = {};\n }\n\n return element[expando][key] = value;\n };\n\n Rails.$ = function (selector) {\n return Array.prototype.slice.call(document.querySelectorAll(selector));\n };\n }).call(this);\n (function () {\n var $, csrfParam, csrfToken;\n $ = Rails.$;\n\n csrfToken = Rails.csrfToken = function () {\n var meta;\n meta = document.querySelector('meta[name=csrf-token]');\n return meta && meta.content;\n };\n\n csrfParam = Rails.csrfParam = function () {\n var meta;\n meta = document.querySelector('meta[name=csrf-param]');\n return meta && meta.content;\n };\n\n Rails.CSRFProtection = function (xhr) {\n var token;\n token = csrfToken();\n\n if (token != null) {\n return xhr.setRequestHeader('X-CSRF-Token', token);\n }\n };\n\n Rails.refreshCSRFTokens = function () {\n var param, token;\n token = csrfToken();\n param = csrfParam();\n\n if (token != null && param != null) {\n return $('form input[name=\"' + param + '\"]').forEach(function (input) {\n return input.value = token;\n });\n }\n };\n }).call(this);\n (function () {\n var CustomEvent, fire, matches, preventDefault;\n matches = Rails.matches;\n CustomEvent = window.CustomEvent;\n\n if (typeof CustomEvent !== 'function') {\n CustomEvent = function CustomEvent(event, params) {\n var evt;\n evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n return evt;\n };\n\n CustomEvent.prototype = window.Event.prototype;\n preventDefault = CustomEvent.prototype.preventDefault;\n\n CustomEvent.prototype.preventDefault = function () {\n var result;\n result = preventDefault.call(this);\n\n if (this.cancelable && !this.defaultPrevented) {\n Object.defineProperty(this, 'defaultPrevented', {\n get: function get() {\n return true;\n }\n });\n }\n\n return result;\n };\n }\n\n fire = Rails.fire = function (obj, name, data) {\n var event;\n event = new CustomEvent(name, {\n bubbles: true,\n cancelable: true,\n detail: data\n });\n obj.dispatchEvent(event);\n return !event.defaultPrevented;\n };\n\n Rails.stopEverything = function (e) {\n fire(e.target, 'ujs:everythingStopped');\n e.preventDefault();\n e.stopPropagation();\n return e.stopImmediatePropagation();\n };\n\n Rails.delegate = function (element, selector, eventType, handler) {\n return element.addEventListener(eventType, function (e) {\n var target;\n target = e.target;\n\n while (!(!(target instanceof Element) || matches(target, selector))) {\n target = target.parentNode;\n }\n\n if (target instanceof Element && handler.call(target, e) === false) {\n e.preventDefault();\n return e.stopPropagation();\n }\n });\n };\n }).call(this);\n (function () {\n var AcceptHeaders, CSRFProtection, createXHR, cspNonce, fire, prepareOptions, processResponse;\n cspNonce = Rails.cspNonce, CSRFProtection = Rails.CSRFProtection, fire = Rails.fire;\n AcceptHeaders = {\n '*': '*/*',\n text: 'text/plain',\n html: 'text/html',\n xml: 'application/xml, text/xml',\n json: 'application/json, text/javascript',\n script: 'text/javascript, application/javascript, application/ecmascript, application/x-ecmascript'\n };\n\n Rails.ajax = function (options) {\n var xhr;\n options = prepareOptions(options);\n xhr = createXHR(options, function () {\n var ref, response;\n response = processResponse((ref = xhr.response) != null ? ref : xhr.responseText, xhr.getResponseHeader('Content-Type'));\n\n if (Math.floor(xhr.status / 100) === 2) {\n if (typeof options.success === \"function\") {\n options.success(response, xhr.statusText, xhr);\n }\n } else {\n if (typeof options.error === \"function\") {\n options.error(response, xhr.statusText, xhr);\n }\n }\n\n return typeof options.complete === \"function\" ? options.complete(xhr, xhr.statusText) : void 0;\n });\n\n if (options.beforeSend != null && !options.beforeSend(xhr, options)) {\n return false;\n }\n\n if (xhr.readyState === XMLHttpRequest.OPENED) {\n return xhr.send(options.data);\n }\n };\n\n prepareOptions = function prepareOptions(options) {\n options.url = options.url || location.href;\n options.type = options.type.toUpperCase();\n\n if (options.type === 'GET' && options.data) {\n if (options.url.indexOf('?') < 0) {\n options.url += '?' + options.data;\n } else {\n options.url += '&' + options.data;\n }\n }\n\n if (AcceptHeaders[options.dataType] == null) {\n options.dataType = '*';\n }\n\n options.accept = AcceptHeaders[options.dataType];\n\n if (options.dataType !== '*') {\n options.accept += ', */*; q=0.01';\n }\n\n return options;\n };\n\n createXHR = function createXHR(options, done) {\n var xhr;\n xhr = new XMLHttpRequest();\n xhr.open(options.type, options.url, true);\n xhr.setRequestHeader('Accept', options.accept);\n\n if (typeof options.data === 'string') {\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');\n }\n\n if (!options.crossDomain) {\n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n }\n\n CSRFProtection(xhr);\n xhr.withCredentials = !!options.withCredentials;\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n return done(xhr);\n }\n };\n\n return xhr;\n };\n\n processResponse = function processResponse(response, type) {\n var parser, script;\n\n if (typeof response === 'string' && typeof type === 'string') {\n if (type.match(/\\bjson\\b/)) {\n try {\n response = JSON.parse(response);\n } catch (error) {}\n } else if (type.match(/\\b(?:java|ecma)script\\b/)) {\n script = document.createElement('script');\n script.setAttribute('nonce', cspNonce());\n script.text = response;\n document.head.appendChild(script).parentNode.removeChild(script);\n } else if (type.match(/\\b(xml|html|svg)\\b/)) {\n parser = new DOMParser();\n type = type.replace(/;.+/, '');\n\n try {\n response = parser.parseFromString(response, type);\n } catch (error) {}\n }\n }\n\n return response;\n };\n\n Rails.href = function (element) {\n return element.href;\n };\n\n Rails.isCrossDomain = function (url) {\n var e, originAnchor, urlAnchor;\n originAnchor = document.createElement('a');\n originAnchor.href = location.href;\n urlAnchor = document.createElement('a');\n\n try {\n urlAnchor.href = url;\n return !((!urlAnchor.protocol || urlAnchor.protocol === ':') && !urlAnchor.host || originAnchor.protocol + '//' + originAnchor.host === urlAnchor.protocol + '//' + urlAnchor.host);\n } catch (error) {\n e = error;\n return true;\n }\n };\n }).call(this);\n (function () {\n var matches, toArray;\n matches = Rails.matches;\n\n toArray = function toArray(e) {\n return Array.prototype.slice.call(e);\n };\n\n Rails.serializeElement = function (element, additionalParam) {\n var inputs, params;\n inputs = [element];\n\n if (matches(element, 'form')) {\n inputs = toArray(element.elements);\n }\n\n params = [];\n inputs.forEach(function (input) {\n if (!input.name || input.disabled) {\n return;\n }\n\n if (matches(input, 'select')) {\n return toArray(input.options).forEach(function (option) {\n if (option.selected) {\n return params.push({\n name: input.name,\n value: option.value\n });\n }\n });\n } else if (input.checked || ['radio', 'checkbox', 'submit'].indexOf(input.type) === -1) {\n return params.push({\n name: input.name,\n value: input.value\n });\n }\n });\n\n if (additionalParam) {\n params.push(additionalParam);\n }\n\n return params.map(function (param) {\n if (param.name != null) {\n return encodeURIComponent(param.name) + \"=\" + encodeURIComponent(param.value);\n } else {\n return param;\n }\n }).join('&');\n };\n\n Rails.formElements = function (form, selector) {\n if (matches(form, 'form')) {\n return toArray(form.elements).filter(function (el) {\n return matches(el, selector);\n });\n } else {\n return toArray(form.querySelectorAll(selector));\n }\n };\n }).call(this);\n (function () {\n var allowAction, fire, stopEverything;\n fire = Rails.fire, stopEverything = Rails.stopEverything;\n\n Rails.handleConfirm = function (e) {\n if (!allowAction(this)) {\n return stopEverything(e);\n }\n };\n\n allowAction = function allowAction(element) {\n var answer, callback, message;\n message = element.getAttribute('data-confirm');\n\n if (!message) {\n return true;\n }\n\n answer = false;\n\n if (fire(element, 'confirm')) {\n try {\n answer = confirm(message);\n } catch (error) {}\n\n callback = fire(element, 'confirm:complete', [answer]);\n }\n\n return answer && callback;\n };\n }).call(this);\n (function () {\n var disableFormElement, disableFormElements, disableLinkElement, enableFormElement, enableFormElements, enableLinkElement, formElements, getData, matches, setData, stopEverything;\n matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, stopEverything = Rails.stopEverything, formElements = Rails.formElements;\n\n Rails.handleDisabledElement = function (e) {\n var element;\n element = this;\n\n if (element.disabled) {\n return stopEverything(e);\n }\n };\n\n Rails.enableElement = function (e) {\n var element;\n element = e instanceof Event ? e.target : e;\n\n if (matches(element, Rails.linkDisableSelector)) {\n return enableLinkElement(element);\n } else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formEnableSelector)) {\n return enableFormElement(element);\n } else if (matches(element, Rails.formSubmitSelector)) {\n return enableFormElements(element);\n }\n };\n\n Rails.disableElement = function (e) {\n var element;\n element = e instanceof Event ? e.target : e;\n\n if (matches(element, Rails.linkDisableSelector)) {\n return disableLinkElement(element);\n } else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formDisableSelector)) {\n return disableFormElement(element);\n } else if (matches(element, Rails.formSubmitSelector)) {\n return disableFormElements(element);\n }\n };\n\n disableLinkElement = function disableLinkElement(element) {\n var replacement;\n replacement = element.getAttribute('data-disable-with');\n\n if (replacement != null) {\n setData(element, 'ujs:enable-with', element.innerHTML);\n element.innerHTML = replacement;\n }\n\n element.addEventListener('click', stopEverything);\n return setData(element, 'ujs:disabled', true);\n };\n\n enableLinkElement = function enableLinkElement(element) {\n var originalText;\n originalText = getData(element, 'ujs:enable-with');\n\n if (originalText != null) {\n element.innerHTML = originalText;\n setData(element, 'ujs:enable-with', null);\n }\n\n element.removeEventListener('click', stopEverything);\n return setData(element, 'ujs:disabled', null);\n };\n\n disableFormElements = function disableFormElements(form) {\n return formElements(form, Rails.formDisableSelector).forEach(disableFormElement);\n };\n\n disableFormElement = function disableFormElement(element) {\n var replacement;\n replacement = element.getAttribute('data-disable-with');\n\n if (replacement != null) {\n if (matches(element, 'button')) {\n setData(element, 'ujs:enable-with', element.innerHTML);\n element.innerHTML = replacement;\n } else {\n setData(element, 'ujs:enable-with', element.value);\n element.value = replacement;\n }\n }\n\n element.disabled = true;\n return setData(element, 'ujs:disabled', true);\n };\n\n enableFormElements = function enableFormElements(form) {\n return formElements(form, Rails.formEnableSelector).forEach(enableFormElement);\n };\n\n enableFormElement = function enableFormElement(element) {\n var originalText;\n originalText = getData(element, 'ujs:enable-with');\n\n if (originalText != null) {\n if (matches(element, 'button')) {\n element.innerHTML = originalText;\n } else {\n element.value = originalText;\n }\n\n setData(element, 'ujs:enable-with', null);\n }\n\n element.disabled = false;\n return setData(element, 'ujs:disabled', null);\n };\n }).call(this);\n (function () {\n var stopEverything;\n stopEverything = Rails.stopEverything;\n\n Rails.handleMethod = function (e) {\n var csrfParam, csrfToken, form, formContent, href, link, method;\n link = this;\n method = link.getAttribute('data-method');\n\n if (!method) {\n return;\n }\n\n href = Rails.href(link);\n csrfToken = Rails.csrfToken();\n csrfParam = Rails.csrfParam();\n form = document.createElement('form');\n formContent = \"<input name='_method' value='\" + method + \"' type='hidden' />\";\n\n if (csrfParam != null && csrfToken != null && !Rails.isCrossDomain(href)) {\n formContent += \"<input name='\" + csrfParam + \"' value='\" + csrfToken + \"' type='hidden' />\";\n }\n\n formContent += '<input type=\"submit\" />';\n form.method = 'post';\n form.action = href;\n form.target = link.target;\n form.innerHTML = formContent;\n form.style.display = 'none';\n document.body.appendChild(form);\n form.querySelector('[type=\"submit\"]').click();\n return stopEverything(e);\n };\n }).call(this);\n (function () {\n var ajax,\n fire,\n getData,\n isCrossDomain,\n isRemote,\n matches,\n serializeElement,\n setData,\n stopEverything,\n slice = [].slice;\n matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, fire = Rails.fire, stopEverything = Rails.stopEverything, ajax = Rails.ajax, isCrossDomain = Rails.isCrossDomain, serializeElement = Rails.serializeElement;\n\n isRemote = function isRemote(element) {\n var value;\n value = element.getAttribute('data-remote');\n return value != null && value !== 'false';\n };\n\n Rails.handleRemote = function (e) {\n var button, data, dataType, element, method, url, withCredentials;\n element = this;\n\n if (!isRemote(element)) {\n return true;\n }\n\n if (!fire(element, 'ajax:before')) {\n fire(element, 'ajax:stopped');\n return false;\n }\n\n withCredentials = element.getAttribute('data-with-credentials');\n dataType = element.getAttribute('data-type') || 'script';\n\n if (matches(element, Rails.formSubmitSelector)) {\n button = getData(element, 'ujs:submit-button');\n method = getData(element, 'ujs:submit-button-formmethod') || element.method;\n url = getData(element, 'ujs:submit-button-formaction') || element.getAttribute('action') || location.href;\n\n if (method.toUpperCase() === 'GET') {\n url = url.replace(/\\?.*$/, '');\n }\n\n if (element.enctype === 'multipart/form-data') {\n data = new FormData(element);\n\n if (button != null) {\n data.append(button.name, button.value);\n }\n } else {\n data = serializeElement(element, button);\n }\n\n setData(element, 'ujs:submit-button', null);\n setData(element, 'ujs:submit-button-formmethod', null);\n setData(element, 'ujs:submit-button-formaction', null);\n } else if (matches(element, Rails.buttonClickSelector) || matches(element, Rails.inputChangeSelector)) {\n method = element.getAttribute('data-method');\n url = element.getAttribute('data-url');\n data = serializeElement(element, element.getAttribute('data-params'));\n } else {\n method = element.getAttribute('data-method');\n url = Rails.href(element);\n data = element.getAttribute('data-params');\n }\n\n ajax({\n type: method || 'GET',\n url: url,\n data: data,\n dataType: dataType,\n beforeSend: function beforeSend(xhr, options) {\n if (fire(element, 'ajax:beforeSend', [xhr, options])) {\n return fire(element, 'ajax:send', [xhr]);\n } else {\n fire(element, 'ajax:stopped');\n return false;\n }\n },\n success: function success() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:success', args);\n },\n error: function error() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:error', args);\n },\n complete: function complete() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:complete', args);\n },\n crossDomain: isCrossDomain(url),\n withCredentials: withCredentials != null && withCredentials !== 'false'\n });\n return stopEverything(e);\n };\n\n Rails.formSubmitButtonClick = function (e) {\n var button, form;\n button = this;\n form = button.form;\n\n if (!form) {\n return;\n }\n\n if (button.name) {\n setData(form, 'ujs:submit-button', {\n name: button.name,\n value: button.value\n });\n }\n\n setData(form, 'ujs:formnovalidate-button', button.formNoValidate);\n setData(form, 'ujs:submit-button-formaction', button.getAttribute('formaction'));\n return setData(form, 'ujs:submit-button-formmethod', button.getAttribute('formmethod'));\n };\n\n Rails.preventInsignificantClick = function (e) {\n var data, insignificantMetaClick, link, metaClick, method, nonPrimaryMouseClick;\n link = this;\n method = (link.getAttribute('data-method') || 'GET').toUpperCase();\n data = link.getAttribute('data-params');\n metaClick = e.metaKey || e.ctrlKey;\n insignificantMetaClick = metaClick && method === 'GET' && !data;\n nonPrimaryMouseClick = e.button != null && e.button !== 0;\n\n if (nonPrimaryMouseClick || insignificantMetaClick) {\n return e.stopImmediatePropagation();\n }\n };\n }).call(this);\n (function () {\n var $, CSRFProtection, delegate, disableElement, enableElement, fire, formSubmitButtonClick, getData, handleConfirm, handleDisabledElement, handleMethod, handleRemote, loadCSPNonce, preventInsignificantClick, refreshCSRFTokens;\n fire = Rails.fire, delegate = Rails.delegate, getData = Rails.getData, $ = Rails.$, refreshCSRFTokens = Rails.refreshCSRFTokens, CSRFProtection = Rails.CSRFProtection, loadCSPNonce = Rails.loadCSPNonce, enableElement = Rails.enableElement, disableElement = Rails.disableElement, handleDisabledElement = Rails.handleDisabledElement, handleConfirm = Rails.handleConfirm, preventInsignificantClick = Rails.preventInsignificantClick, handleRemote = Rails.handleRemote, formSubmitButtonClick = Rails.formSubmitButtonClick, handleMethod = Rails.handleMethod;\n\n if (typeof jQuery !== \"undefined\" && jQuery !== null && jQuery.ajax != null) {\n if (jQuery.rails) {\n throw new Error('If you load both jquery_ujs and rails-ujs, use rails-ujs only.');\n }\n\n jQuery.rails = Rails;\n jQuery.ajaxPrefilter(function (options, originalOptions, xhr) {\n if (!options.crossDomain) {\n return CSRFProtection(xhr);\n }\n });\n }\n\n Rails.start = function () {\n if (window._rails_loaded) {\n throw new Error('rails-ujs has already been loaded!');\n }\n\n window.addEventListener('pageshow', function () {\n $(Rails.formEnableSelector).forEach(function (el) {\n if (getData(el, 'ujs:disabled')) {\n return enableElement(el);\n }\n });\n return $(Rails.linkDisableSelector).forEach(function (el) {\n if (getData(el, 'ujs:disabled')) {\n return enableElement(el);\n }\n });\n });\n delegate(document, Rails.linkDisableSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.linkDisableSelector, 'ajax:stopped', enableElement);\n delegate(document, Rails.buttonDisableSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.buttonDisableSelector, 'ajax:stopped', enableElement);\n delegate(document, Rails.linkClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.linkClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.linkClickSelector, 'click', handleConfirm);\n delegate(document, Rails.linkClickSelector, 'click', disableElement);\n delegate(document, Rails.linkClickSelector, 'click', handleRemote);\n delegate(document, Rails.linkClickSelector, 'click', handleMethod);\n delegate(document, Rails.buttonClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.buttonClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.buttonClickSelector, 'click', handleConfirm);\n delegate(document, Rails.buttonClickSelector, 'click', disableElement);\n delegate(document, Rails.buttonClickSelector, 'click', handleRemote);\n delegate(document, Rails.inputChangeSelector, 'change', handleDisabledElement);\n delegate(document, Rails.inputChangeSelector, 'change', handleConfirm);\n delegate(document, Rails.inputChangeSelector, 'change', handleRemote);\n delegate(document, Rails.formSubmitSelector, 'submit', handleDisabledElement);\n delegate(document, Rails.formSubmitSelector, 'submit', handleConfirm);\n delegate(document, Rails.formSubmitSelector, 'submit', handleRemote);\n delegate(document, Rails.formSubmitSelector, 'submit', function (e) {\n return setTimeout(function () {\n return disableElement(e);\n }, 13);\n });\n delegate(document, Rails.formSubmitSelector, 'ajax:send', disableElement);\n delegate(document, Rails.formSubmitSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.formInputClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.formInputClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.formInputClickSelector, 'click', handleConfirm);\n delegate(document, Rails.formInputClickSelector, 'click', formSubmitButtonClick);\n document.addEventListener('DOMContentLoaded', refreshCSRFTokens);\n document.addEventListener('DOMContentLoaded', loadCSPNonce);\n return window._rails_loaded = true;\n };\n\n if (window.Rails === Rails && fire(document, 'rails:attachBindings')) {\n Rails.start();\n }\n }).call(this);\n }).call(this);\n\n if (typeof module === \"object\" && module.exports) {\n module.exports = Rails;\n } else if (typeof define === \"function\" && define.amd) {\n define(Rails);\n }\n}).call(this);","// This file will be loaded on public pages, regardless of theme.\n\nimport createHistory from 'history/createBrowserHistory';\nimport ready from '../mastodon/ready';\n\nconst { delegate } = require('rails-ujs');\nconst { length } = require('stringz');\n\ndelegate(document, '.webapp-btn', 'click', ({ target, button }) => {\n if (button !== 0) {\n return true;\n }\n window.location.href = target.href;\n return false;\n});\n\ndelegate(document, '.status__content__spoiler-link', 'click', function() {\n const contentEl = this.parentNode.parentNode.querySelector('.e-content');\n\n if (contentEl.style.display === 'block') {\n contentEl.style.display = 'none';\n this.parentNode.style.marginBottom = 0;\n } else {\n contentEl.style.display = 'block';\n this.parentNode.style.marginBottom = null;\n }\n\n return false;\n});\n\ndelegate(document, '.modal-button', 'click', e => {\n e.preventDefault();\n\n let href;\n\n if (e.target.nodeName !== 'A') {\n href = e.target.parentNode.href;\n } else {\n href = e.target.href;\n }\n\n window.open(href, 'mastodon-intent', 'width=445,height=600,resizable=no,menubar=no,status=no,scrollbars=yes');\n});\n\nconst getProfileAvatarAnimationHandler = (swapTo) => {\n //animate avatar gifs on the profile page when moused over\n return ({ target }) => {\n const swapSrc = target.getAttribute(swapTo);\n //only change the img source if autoplay is off and the image src is actually different\n if(target.getAttribute('data-autoplay') !== 'true' && target.src !== swapSrc) {\n target.src = swapSrc;\n }\n };\n};\n\ndelegate(document, 'img#profile_page_avatar', 'mouseover', getProfileAvatarAnimationHandler('data-original'));\n\ndelegate(document, 'img#profile_page_avatar', 'mouseout', getProfileAvatarAnimationHandler('data-static'));\n\ndelegate(document, '#account_header', 'change', ({ target }) => {\n const header = document.querySelector('.card .card__img img');\n const [file] = target.files || [];\n const url = file ? URL.createObjectURL(file) : header.dataset.originalSrc;\n\n header.src = url;\n});\n","\"use strict\";\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n \"default\": mod\n };\n};\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n}); // @ts-ignore\n\nvar unicode_astral_regex_1 = __importDefault(require(\"unicode-astral-regex\"));\n/**\n * Converts a string to an array of string chars\n * @param {string} str The string to turn into array\n * @returns {string[]}\n */\n\n\nfunction toArray(str) {\n if (typeof str !== 'string') {\n throw new Error('A string is expected as input');\n }\n\n return str.match(unicode_astral_regex_1.default) || [];\n}\n\nexports.toArray = toArray;\n/**\n * Returns the length of a string\n *\n * @export\n * @param {string} str\n * @returns {number}\n */\n\nfunction length(str) {\n // Check for input\n if (typeof str !== 'string') {\n throw new Error('Input must be a string');\n }\n\n var match = str.match(unicode_astral_regex_1.default);\n return match === null ? 0 : match.length;\n}\n\nexports.length = length;\n/**\n * Returns a substring by providing start and end position\n *\n * @export\n * @param {string} str\n * @param {number} [begin=0] Starting position\n * @param {number} end End position\n * @returns {string}\n */\n\nfunction substring(str, begin, end) {\n if (begin === void 0) {\n begin = 0;\n } // Check for input\n\n\n if (typeof str !== 'string') {\n throw new Error('Input must be a string');\n } // Even though negative numbers work here, theyre not in the spec\n\n\n if (typeof begin !== 'number' || begin < 0) {\n begin = 0;\n }\n\n if (typeof end === 'number' && end < 0) {\n end = 0;\n }\n\n var match = str.match(unicode_astral_regex_1.default);\n if (!match) return '';\n return match.slice(begin, end).join('');\n}\n\nexports.substring = substring;\n/**\n * Returns a substring by providing start position and length\n *\n * @export\n * @param {string} str\n * @param {number} [begin=0] Starting position\n * @param {number} len Desired length\n * @returns {string}\n */\n\nfunction substr(str, begin, len) {\n if (begin === void 0) {\n begin = 0;\n } // Check for input\n\n\n if (typeof str !== 'string') {\n throw new Error('Input must be a string');\n }\n\n var strLength = length(str); // Fix type\n\n if (typeof begin !== 'number') {\n begin = parseInt(begin, 10);\n } // Return zero-length string if got oversize number.\n\n\n if (begin >= strLength) {\n return '';\n } // Calculating postive version of negative value.\n\n\n if (begin < 0) {\n begin += strLength;\n }\n\n var end;\n\n if (typeof len === 'undefined') {\n end = strLength;\n } else {\n // Fix type\n if (typeof len !== 'number') {\n len = parseInt(len, 10);\n }\n\n end = len >= 0 ? len + begin : begin;\n }\n\n var match = str.match(unicode_astral_regex_1.default);\n if (!match) return '';\n return match.slice(begin, end).join('');\n}\n\nexports.substr = substr;\n/**\n * Enforces a string to be a certain length by\n * adding or removing characters\n *\n * @export\n * @param {string} str\n * @param {number} [limit=16] Limit\n * @param {string} [padString='#'] The Pad String\n * @param {string} [padPosition='right'] The Pad Position\n * @returns {string}\n */\n\nfunction limit(str, limit, padString, padPosition) {\n if (limit === void 0) {\n limit = 16;\n }\n\n if (padString === void 0) {\n padString = '#';\n }\n\n if (padPosition === void 0) {\n padPosition = 'right';\n } // Input should be a string, limit should be a number\n\n\n if (typeof str !== 'string' || typeof limit !== 'number') {\n throw new Error('Invalid arguments specified');\n } // Pad position should be either left or right\n\n\n if (['left', 'right'].indexOf(padPosition) === -1) {\n throw new Error('Pad position should be either left or right');\n } // Pad string can be anything, we convert it to string\n\n\n if (typeof padString !== 'string') {\n padString = String(padString);\n } // Calculate string length considering astral code points\n\n\n var strLength = length(str);\n\n if (strLength > limit) {\n return substring(str, 0, limit);\n } else if (strLength < limit) {\n var padRepeats = padString.repeat(limit - strLength);\n return padPosition === 'left' ? padRepeats + str : str + padRepeats;\n }\n\n return str;\n}\n\nexports.limit = limit;\n/**\n * Returns the index of the first occurrence of a given string\n *\n * @export\n * @param {string} str\n * @param {string} [searchStr] the string to search\n * @param {number} [pos] starting position\n * @returns {number}\n */\n\nfunction indexOf(str, searchStr, pos) {\n if (pos === void 0) {\n pos = 0;\n }\n\n if (typeof str !== 'string') {\n throw new Error('Input must be a string');\n }\n\n if (str === '') {\n if (searchStr === '') {\n return 0;\n }\n\n return -1;\n } // fix type\n\n\n pos = Number(pos);\n pos = isNaN(pos) ? 0 : pos;\n searchStr = String(searchStr);\n var strArr = toArray(str);\n\n if (pos >= strArr.length) {\n if (searchStr === '') {\n return strArr.length;\n }\n\n return -1;\n }\n\n if (searchStr === '') {\n return pos;\n }\n\n var searchArr = toArray(searchStr);\n var finded = false;\n var index;\n\n for (index = pos; index < strArr.length; index += 1) {\n var searchIndex = 0;\n\n while (searchIndex < searchArr.length && searchArr[searchIndex] === strArr[index + searchIndex]) {\n searchIndex += 1;\n }\n\n if (searchIndex === searchArr.length && searchArr[searchIndex - 1] === strArr[index + searchIndex - 1]) {\n finded = true;\n break;\n }\n }\n\n return finded ? index : -1;\n}\n\nexports.indexOf = indexOf;"],"sourceRoot":""} |