{"version":3,"file":"trix-editor-B5VuCRiu.js","sources":["../../../node_modules/trix/dist/trix.esm.min.js","../../../app/javascript/entrypoints/trix-editor.js"],"sourcesContent":["/*\nTrix 2.1.10\nCopyright © 2024 37signals, LLC\n */\nvar t=\"2.1.10\";const e=\"[data-trix-attachment]\",i={preview:{presentation:\"gallery\",caption:{name:!0,size:!0}},file:{caption:{size:!0}}},n={default:{tagName:\"div\",parse:!1},quote:{tagName:\"blockquote\",nestable:!0},heading1:{tagName:\"h1\",terminal:!0,breakOnReturn:!0,group:!1},code:{tagName:\"pre\",terminal:!0,htmlAttributes:[\"language\"],text:{plaintext:!0}},bulletList:{tagName:\"ul\",parse:!1},bullet:{tagName:\"li\",listAttribute:\"bulletList\",group:!1,nestable:!0,test(t){return r(t.parentNode)===n[this.listAttribute].tagName}},numberList:{tagName:\"ol\",parse:!1},number:{tagName:\"li\",listAttribute:\"numberList\",group:!1,nestable:!0,test(t){return r(t.parentNode)===n[this.listAttribute].tagName}},attachmentGallery:{tagName:\"div\",exclusive:!0,terminal:!0,parse:!1,group:!1}},r=t=>{var e;return null==t||null===(e=t.tagName)||void 0===e?void 0:e.toLowerCase()},o=navigator.userAgent.match(/android\\s([0-9]+.*Chrome)/i),s=o&&parseInt(o[1]);var a={composesExistingText:/Android.*Chrome/.test(navigator.userAgent),recentAndroid:s&&s>12,samsungAndroid:s&&navigator.userAgent.match(/Android.*SM-/),forcesObjectResizing:/Trident.*rv:11/.test(navigator.userAgent),supportsInputEvents:\"undefined\"!=typeof InputEvent&&[\"data\",\"getTargetRanges\",\"inputType\"].every((t=>t in InputEvent.prototype))},l={attachFiles:\"Attach Files\",bold:\"Bold\",bullets:\"Bullets\",byte:\"Byte\",bytes:\"Bytes\",captionPlaceholder:\"Add a caption…\",code:\"Code\",heading1:\"Heading\",indent:\"Increase Level\",italic:\"Italic\",link:\"Link\",numbers:\"Numbers\",outdent:\"Decrease Level\",quote:\"Quote\",redo:\"Redo\",remove:\"Remove\",strike:\"Strikethrough\",undo:\"Undo\",unlink:\"Unlink\",url:\"URL\",urlPlaceholder:\"Enter a URL…\",GB:\"GB\",KB:\"KB\",MB:\"MB\",PB:\"PB\",TB:\"TB\"};const c=[l.bytes,l.KB,l.MB,l.GB,l.TB,l.PB];var u={prefix:\"IEC\",precision:2,formatter(t){switch(t){case 0:return\"0 \".concat(l.bytes);case 1:return\"1 \".concat(l.byte);default:let e;\"SI\"===this.prefix?e=1e3:\"IEC\"===this.prefix&&(e=1024);const i=Math.floor(Math.log(t)/Math.log(e)),n=(t/Math.pow(e,i)).toFixed(this.precision).replace(/0*$/,\"\").replace(/\\.$/,\"\");return\"\".concat(n,\" \").concat(c[i])}}};const h=\"\\ufeff\",d=\" \",g=function(t){for(const e in t){const i=t[e];this[e]=i}return this},m=document.documentElement,p=m.matches,f=function(t){let{onElement:e,matchingSelector:i,withCallback:n,inPhase:r,preventDefault:o,times:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const a=e||m,l=i,c=\"capturing\"===r,u=function(t){null!=s&&0==--s&&u.destroy();const e=A(t.target,{matchingSelector:l});null!=e&&(null==n||n.call(e,t,e),o&&t.preventDefault())};return u.destroy=()=>a.removeEventListener(t,u,c),a.addEventListener(t,u,c),u},b=function(t){let{onElement:e,bubbles:i,cancelable:n,attributes:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=null!=e?e:m;i=!1!==i,n=!1!==n;const s=document.createEvent(\"Events\");return s.initEvent(t,i,n),null!=r&&g.call(s,r),o.dispatchEvent(s)},v=function(t,e){if(1===(null==t?void 0:t.nodeType))return p.call(t,e)},A=function(t){let{matchingSelector:e,untilNode:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.parentNode;if(null!=t){if(null==e)return t;if(t.closest&&null==i)return t.closest(e);for(;t&&t!==i;){if(v(t,e))return t;t=t.parentNode}}},y=t=>document.activeElement!==t&&x(t,document.activeElement),x=function(t,e){if(t&&e)for(;e;){if(e===t)return!0;e=e.parentNode}},C=function(t){var e;if(null===(e=t)||void 0===e||!e.parentNode)return;let i=0;for(t=t.previousSibling;t;)i++,t=t.previousSibling;return i},E=t=>{var e;return null==t||null===(e=t.parentNode)||void 0===e?void 0:e.removeChild(t)},S=function(t){let{onlyNodesOfType:e,usingFilter:i,expandEntityReferences:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=(()=>{switch(e){case\"element\":return NodeFilter.SHOW_ELEMENT;case\"text\":return NodeFilter.SHOW_TEXT;case\"comment\":return NodeFilter.SHOW_COMMENT;default:return NodeFilter.SHOW_ALL}})();return document.createTreeWalker(t,r,null!=i?i:null,!0===n)},R=t=>{var e;return null==t||null===(e=t.tagName)||void 0===e?void 0:e.toLowerCase()},k=function(t){let e,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};\"object\"==typeof t?(n=t,t=n.tagName):n={attributes:n};const r=document.createElement(t);if(null!=n.editable&&(null==n.attributes&&(n.attributes={}),n.attributes.contenteditable=n.editable),n.attributes)for(e in n.attributes)i=n.attributes[e],r.setAttribute(e,i);if(n.style)for(e in n.style)i=n.style[e],r.style[e]=i;if(n.data)for(e in n.data)i=n.data[e],r.dataset[e]=i;return n.className&&n.className.split(\" \").forEach((t=>{r.classList.add(t)})),n.textContent&&(r.textContent=n.textContent),n.childNodes&&[].concat(n.childNodes).forEach((t=>{r.appendChild(t)})),r};let T;const w=function(){if(null!=T)return T;T=[];for(const t in n){const e=n[t];e.tagName&&T.push(e.tagName)}return T},L=t=>N(null==t?void 0:t.firstChild),D=function(t){let{strict:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{strict:!0};return e?N(t):N(t)||!N(t.firstChild)&&function(t){return w().includes(R(t))&&!w().includes(R(t.firstChild))}(t)},N=t=>I(t)&&\"block\"===(null==t?void 0:t.data),I=t=>(null==t?void 0:t.nodeType)===Node.COMMENT_NODE,O=function(t){let{name:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t)return M(t)?t.data===h?!e||t.parentNode.dataset.trixCursorTarget===e:void 0:O(t.firstChild)},P=t=>v(t,e),F=t=>M(t)&&\"\"===(null==t?void 0:t.data),M=t=>(null==t?void 0:t.nodeType)===Node.TEXT_NODE,B={level2Enabled:!0,getLevel(){return this.level2Enabled&&a.supportsInputEvents?2:0},pickFiles(t){const e=k(\"input\",{type:\"file\",multiple:!0,hidden:!0,id:this.fileInputId});e.addEventListener(\"change\",(()=>{t(e.files),E(e)})),E(document.getElementById(this.fileInputId)),document.body.appendChild(e),e.click()}};var _={removeBlankTableCells:!1,tableCellSeparator:\" | \",tableRowSeparator:\"\\n\"},j={bold:{tagName:\"strong\",inheritable:!0,parser(t){const e=window.getComputedStyle(t);return\"bold\"===e.fontWeight||e.fontWeight>=600}},italic:{tagName:\"em\",inheritable:!0,parser:t=>\"italic\"===window.getComputedStyle(t).fontStyle},href:{groupTagName:\"a\",parser(t){const i=\"a:not(\".concat(e,\")\"),n=t.closest(i);if(n)return n.getAttribute(\"href\")}},strike:{tagName:\"del\",inheritable:!0},frozen:{style:{backgroundColor:\"highlight\"}}},W={getDefaultHTML:()=>'
\\n\\n