text: !function(e){function t(r){if(n[r])return n[r].exports;var l=n[r]={i:r,l:!1,exports:{}};return e[r].call(l.exports,l,l.exports,t),l.l=!0,l.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),l=(n.n(r),n(2)),a=(n.n(l),n(3)),i=(n.n(a),n(4));n.n(i);Object(l.registerBlockType)("syntaxhighlighter/code",{title:Object(r.__)("SyntaxHighlighter Code","syntaxhighlighter"),description:Object(r.__)("Adds syntax highlighting to source code (front end only).","syntaxhighlighter"),icon:"editor-code",category:"formatting",keywords:[Object(r.__)("Source","syntaxhighlighter"),Object(r.__)("Program","syntaxhighlighter"),Object(r.__)("Develop","syntaxhighlighter")],attributes:{content:{type:"string",source:"text",selector:"pre"},language:{type:"string",default:syntaxHighlighterData.settings.language.default},lineNumbers:{type:"boolean",default:syntaxHighlighterData.settings.lineNumbers.default},firstLineNumber:{type:"string",default:syntaxHighlighterData.settings.firstLineNumber.default},highlightLines:{type:"string"},wrapLines:{type:"boolean",default:syntaxHighlighterData.settings.wrapLines.default},makeURLsClickable:{type:"boolean",default:syntaxHighlighterData.settings.makeURLsClickable.default},quickCode:{type:"boolean",default:syntaxHighlighterData.settings.quickCode.default}},supports:{html:!1},transforms:{from:[{type:"enter",regExp:/^```$/,transform:function(){return Object(l.createBlock)("syntaxhighlighter/code")}},{type:"raw",isMatch:function(e){return"PRE"===e.nodeName&&1===e.children.length&&"CODE"===e.firstChild.nodeName},schema:{pre:{children:{code:{children:{"#text":{}}}}}}},{type:"block",blocks:["core/code"],transform:function(e){var t=e.content;return Object(l.createBlock)("syntaxhighlighter/code",{content:t})}}],to:[{type:"block",blocks:["core/code"],transform:function(e){var t=e.content;return Object(l.createBlock)("core/code",{content:t})}}]},edit:function(e){var t=e.attributes,n=e.setAttributes,l=e.className,o=t.content,s=t.language,h=t.lineNumbers,c=t.firstLineNumber,g=t.highlightLines,u=t.wrapLines,p=t.makeURLsClickable,m=t.quickCode,b=[];if(syntaxHighlighterData.settings.language.supported){var d=[];for(var y in syntaxHighlighterData.brushes)d.push({label:syntaxHighlighterData.brushes[y],value:y});b.push(wp.element.createElement(a.PanelRow,null,wp.element.createElement(a.SelectControl,{label:Object(r.__)("Code Language","syntaxhighlighter"),value:s,options:d,onChange:function(e){return n({language:e})}})))}return syntaxHighlighterData.settings.lineNumbers.supported&&b.push(wp.element.createElement(a.PanelRow,null,wp.element.createElement(a.ToggleControl,{label:Object(r.__)("Show Line Numbers","syntaxhighlighter"),checked:h,onChange:function(e){return n({lineNumbers:e})}}))),h&&syntaxHighlighterData.settings.firstLineNumber.supported&&b.push(wp.element.createElement(a.PanelRow,null,wp.element.createElement(a.TextControl,{label:Object(r.__)("First Line Number","syntaxhighlighter"),type:"number",value:c,onChange:function(e){return n({firstLineNumber:e})},min:1,max:1e5}))),syntaxHighlighterData.settings.highlightLines.supported&&b.push(wp.element.createElement(a.TextControl,{label:Object(r.__)("Highlight Lines","syntaxhighlighter"),value:g,help:Object(r.__)("A comma-separated list of line numbers to highlight. Can also be a range. Example: 1,5,10-20","syntaxhighlighter"),onChange:function(e){return n({highlightLines:e})}})),syntaxHighlighterData.settings.wrapLines.supported&&b.push(wp.element.createElement(a.PanelRow,null,wp.element.createElement(a.ToggleControl,{label:Object(r.__)("Wrap Long Lines","syntaxhighlighter"),checked:u,onChange:function(e){return n({wrapLines:e})}}))),syntaxHighlighterData.settings.makeURLsClickable.supported&&b.push(wp.element.createElement(a.PanelRow,null,wp.element.createElement(a.ToggleControl,{label:Object(r.__)("Make URLs Clickable","syntaxhighlighter"),checked:p,onChange:function(e){return n({makeURLsClickable:e})}}))),syntaxHighlighterData.settings.quickCode.supported&&b.push(wp.element.createElement(a.PanelRow,null,wp.element.createElement(a.ToggleControl,{label:Object(r.__)("Enable edit mode on double click","syntaxhighlighter"),checked:m,onChange:function(e){return n({quickCode:e})}}))),[wp.element.createElement(i.InspectorControls,{key:"syntaxHighlighterInspectorControls"},wp.element.createElement(a.PanelBody,{title:Object(r.__)("Settings","syntaxhighlighter")},b)),wp.element.createElement("div",{className:l+" wp-block-code"},wp.element.createElement(i.PlainText,{value:o,onChange:function(e){return n({content:e})},placeholder:Object(r.__)("Tip: To the right, choose a code language from the block settings.","syntaxhighlighter"),"aria-label":Object(r.__)("SyntaxHighlighter Code","syntaxhighlighter")}))]},save:function(e){var t=e.attributes,n=t.content;return wp.element.createElement("pre",null,n)}})},function(e,t){e.exports=wp.i18n},function(e,t){e.exports=wp.blocks},function(e,t){e.exports=wp.components},function(e,t){e.exports=wp.editor}]);