# code-block-pro/1.11.1/build/front/front.js

Code Block Pro – Beautiful Syntax Highlighting, version 1.11.1. 1 lines.

- Page: https://pluginprobe.com/plugins/code-block-pro/1.11.1/code/build/front/front.js
- Raw: https://pluginprobe.com/plugins/code-block-pro/1.11.1/raw/build/front/front.js
- Modified: 2023-01-04T06:51:48+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/code-block-pro/1.11.1/code/build/front/front.js#L10-L20`.

```javascript
!function(){var e={640:function(e,t,o){"use strict";var n=o(742),a={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var o,r,c,l,i,d,s=!1;t||(t={}),o=t.debug||!1;try{if(c=n(),l=document.createRange(),i=document.getSelection(),(d=document.createElement("span")).textContent=e,d.ariaHidden="true",d.style.all="unset",d.style.position="fixed",d.style.top=0,d.style.clip="rect(0, 0, 0, 0)",d.style.whiteSpace="pre",d.style.webkitUserSelect="text",d.style.MozUserSelect="text",d.style.msUserSelect="text",d.style.userSelect="text",d.addEventListener("copy",(function(n){if(n.stopPropagation(),t.format)if(n.preventDefault(),void 0===n.clipboardData){o&&console.warn("unable to use e.clipboardData"),o&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=a[t.format]||a.default;window.clipboardData.setData(r,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e);t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))})),document.body.appendChild(d),l.selectNodeContents(d),i.addRange(l),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");s=!0}catch(n){o&&console.error("unable to copy using execCommand: ",n),o&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),s=!0}catch(n){o&&console.error("unable to copy using clipboardData: ",n),o&&console.error("falling back to prompt"),r=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(r,e)}}finally{i&&("function"==typeof i.removeRange?i.removeRange(l):i.removeAllRanges()),d&&document.body.removeChild(d),c()}return s}},742:function(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,o=[],n=0;n<e.rangeCount;n++)o.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||o.forEach((function(t){e.addRange(t)})),t&&t.focus()}}}},t={};function o(n){var a=t[n];if(void 0!==a)return a.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,o),r.exports}o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,{a:t}),t},o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=o(640),t=o.n(e);const n=()=>{Array.from(document.querySelectorAll(".code-block-pro-copy-button:not(.cbp-cb-loaded)")).forEach((e=>{e.classList.add("cbp-cb-loaded"),e.style.display="block",e.addEventListener("click",(e=>{var o,n,a;const r=null===(o=e.target)||void 0===o?void 0:o.closest("span");t()(null!==(n=null==r||null===(a=r.dataset)||void 0===a?void 0:a.code)&&void 0!==n?n:"",{format:"text/plain"}),r.classList.add("copying"),setTimeout((()=>{r.classList.remove("copying")}),2e3)}))})),Array.from(document.querySelectorAll(".wp-block-kevinbatdorf-code-block-pro pre:not(.cbp-hl-loaded)")).forEach((e=>{e.classList.add("cbp-hl-loaded");const t=e.querySelectorAll(".cbp-line-highlight");t.length&&(new ResizeObserver((t=>{t.forEach((t=>{e.style.setProperty("--cbp-block-width","0");const o=t.target.querySelector("code").offsetWidth,n=o+16===t.target.scrollWidth?o+16:t.target.scrollWidth+16;e.style.setProperty("--cbp-block-width",`${n}px`)}))})).observe(e),t.forEach((e=>{e.insertAdjacentHTML("beforeend",'<span aria-hidden="true" class="cbp-line-highlighter"></span>')})))})),(()=>{var e;if(null===(e=window.codeBlockPro)||void 0===e||!e.pluginUrl)return;const t=Array.from(document.querySelectorAll("[data-code-block-pro-font-family]:not(.cbp-ff-loaded)")||[]);t.forEach((e=>e.classList.add("cbp-ff-loaded"))),[...new Set(t.map((e=>e.dataset.codeBlockProFontFamily)).filter(Boolean))].forEach((async e=>{const t=new FontFace(e,`url(${window.codeBlockPro.pluginUrl}/build/fonts/${e}.woff2)`);await t.load(),document.fonts.add(t)}))})()};n(),window.addEventListener("DOMContentLoaded",n),window.addEventListener("load",n)}()}();
```
