PageSourceSearch

https://www.iev-group.com/wp-content/plugins/copy-the-code/assets/frontend/js/global-injector.js?ver=5.5.3

js iev-group.com collected 2026-10-04 03:13:26 UTC 30,839 bytes, 1 lines download raw bytes

vendor: 4,572 bytes, line 1
1!function(){function t(){"use strict";t=function(){return o};var r,o={},n=Object.prototype,a=n.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",u=c.toStringTag||"@@toStringTag";function d(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(r){d=function(t,e,r){return t[e]=r}}function h(t,e,r,o){var n=e&&e.prototype instanceof m?e:m,a=Object.create(n.prototype),c=new M(o||[]);return i(a,"_invoke",{value:S(t,r,c)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}o.wrap=h;var f="suspendedStart",g="suspendedYield",v="executing",b="completed",y={};function m(){}function x(){}function w(){}var C={};d(C,s,(function(){return this}));var _=Object.getPrototypeOf,k=_&&_(_(V([])));k&&k!==n&&a.call(k,s)&&(C=k);var L=w.prototype=m.prototype=Object.create(C);function E(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,r){function o(n,i,c,s){var l=p(t[n],t,i);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==e(d)&&a.call(d,"__await")?r.resolve(d.__await).then((function(t){o("next",t,c,s)}),(function(t){o("throw",t,c,s)})):r.resolve(d).then((function(t){u.value=t,c(u)}),(function(t){return o("throw",t,c,s)}))}s(l.arg)}var n;i(this,"_invoke",{value:function(t,e){function a(){return new r((function(r,n){o(t,e,r,n)}))}return n=n?n.then(a,a):a()}})}function S(t,e,o){var n=f;return function(a,i){if(n===v)throw Error("Generator is already running");if(n===b){if("throw"===a)throw i;return{value:r,done:!0}}for(o.method=a,o.arg=i;;){var c=o.delegate;if(c){var s=A(c,o);if(s){if(s===y)continue;return s}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(n===f)throw n=b,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);n=v;var l=p(t,e,o);if("normal"===l.type){if(n=o.done?b:g,l.arg===y)continue;return{value:l.arg,done:o.done}}"throw"===l.type&&(n=b,o.method="throw",o.arg=l.arg)}}}function A(t,e){var o=e.method,n=t.iterator[o];if(n===r)return e.delegate=null,"throw"===o&&t.iterator.return&&(e.method="return",e.arg=r,A(t,e),"throw"===e.method)||"return"!==o&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+o+"' method")),y;var a=p(n,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,y;var i=a.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,y):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,y)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function B(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function V(t){if(t||""===t){var o=t[s];if(o)return o.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(a.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=r,e.done=!0,e};return i.next=i}}throw new TypeError(e(t)+" is not iterable")}return x.prototype=w,i(L,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:x,configurable:!0}),x.displayName=d(w,u,"GeneratorFunction"),o.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===x||"GeneratorFunction"===(e.displayName||e.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,d(t,u,"GeneratorFunction")),t.prototype=Object.create(L),t},o.awrap=function(t){return{__await:t}},E(T.prototype),d(T.prototype,l,(function(){return this})),o.AsyncIterator=T,o.async=function(t,e,r,n,a){void 0===a&&(a=Promise);var i=new T(h(t,e,r,n),a);return o.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},E(L),d(L,u,"Generator"),d(L,s,(function(){return this})),d(L,"toString",(function(){return"[object Generator]"})),o.keys=function(t){var e=Object(t),r=[];for(var o in e)r.push(o);return r.reverse(),function t(){for(;r.length;){var o=r.pop();if(o in e)return t.value=o,t.done=!1,t}return t.done=!0,t}},o.values=V,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEac
1h(B),!t)for(var e in this)"t"===e.charAt(0)&&a.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function o(o,n){return c.type="throw",c.arg=t,e.next=o,n&&(e.method="next",e.arg=r),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),l=a.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&a.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var n=o;break}}n&&("break"===t||"continue"===t)&&n.tryLoc<=e&&e<=n.finallyLoc&&(n=null);var i=n?n.completion:{};return i.type=t,i.arg=e,n?(this.method="next",this.next=n.finallyLoc,y):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),B(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var o=r.completion;if("throw"===o.type){var n=o.arg;B(r)}return n}}throw Error("illegal catch attempt")},delegateYield:function(t,e,o){return this.delegate={iterator:V(t),resultName:e,nextLoc:o},"next"===this.method&&(this.arg=r),y}},o}function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function r(t,e,r,o,n,a,i){try{var c=t[a](i),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(o,n)}function o(t){return function(){var e=this,o=arguments;return new Promise((function(n,a){var i=t.apply(e,o);function c(t){r(i,n,a,c,s,"next",t)}function s(t){r(i,n,a,c,s,"throw",t)}c(void 0)}))}}function n(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r<e;r++)o[r]=t[r];return o}!function(){"use strict";var r,a,i,c={config:"undefined"!=typeof ctcGlobalInjector?ctcGlobalInjector:{},rules:[],processedElements:new WeakSet,debug:function(t){if(this.config.debug){for(var e="log",r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];var i=o;"warn"===t||"error"===t?(e=t,i=o):i=[t].concat(o);var c=console[e]||console.log;c.call.apply(c,[console,"CTC:"].concat(n(i)))}},init:function(){var t=this;this.rules=this.config.rules||[],this.rules.length&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",(function(){return t.start()})):this.start())},start:function(){this.bindDelegatedCopyHandler(),this.applyRules(),this.observeChanges()},bindDelegatedCopyHandler:function(){var t=this;this.delegatedBound||(this.delegatedBound=!0,document.addEventListener("click",(function(e){var r=e.target;if(r&&1===r.nodeType){var o=r.closest(".ctc-copy-btn, .ctc-cover-button");if(o){var n=o.closest(".ctc-wrapper");if(n){var a=n.getAttribute("data-rule-id");if(a){var i=t.getRuleById(a);if(i){var c=t.getWrappedTargetElement(n);c&&(e.preventDefault(),e.stopPropagation(),t.handleCopy(c,o,i))}}}}}})))},getRuleById:function(t){return this.rules&&this.rules.length&&this.rules.find((function(e){return String(e.id)===String(t)}))||null},getWrappedTargetElement:function(t){for(var e=0,r=Array.from(t.children||[]);e<r.length;e++){var o=r[e];if(o&&1===o.nodeType&&!(o.classList.contains("ctc-copy-btn")||o.classList.contains("ctc-cover-overlay")||o.classList.contains("ctc-outside")))return o}return null},observeChanges:function(){var t=this;"undefined"!=typeof MutationObserver&&new MutationObserver((function(e){var r=!1;e.forEach((function(t){t.addedNodes.length>0&&(r=!0)})),r&&(clearTimeout(t.reapplyTimeout),t.reapplyTimeout=setTimeout((function(){t.applyRules()}),100))})).observe(document.body,{childList:!0,subtree:!0})},applyRules:function(){var t=this;
1this.rules&&0!==this.rules.length&&this.rules.forEach((function(e){e.selector&&e.selector.split(",").map((function(t){return t.trim()})).filter(Boolean).forEach((function(r){try{document.querySelectorAll(r).forEach((function(r){t.processedElements.has(r)||e.exclude_selector&&r.matches(e.exclude_selector)||r.closest(".ctc-wrapper")||r.querySelector(".ctc-copy-btn")||(t.injectButton(r,e),t.processedElements.add(r))}))}catch(e){t.debug("warn","Invalid selector:",r,e)}}))}))},injectButton:function(t,e){var r,o=this,a=e.visual_style||"button",i=this.migratePosition(e.button_position||"inside_top_right"),c=(i.startsWith("inside"),i.startsWith("outside")),s=document.createElement("div");switch(s.className="ctc-wrapper ctc-wrapper--".concat(a," ctc-wrapper--").concat(i),s.setAttribute("data-rule-id",e.id),s.setAttribute("data-position",i),this.setCSSVariables(s,e),t.parentNode.insertBefore(s,t),s.appendChild(t),a){case"icon":r=this.createIconButton(e);break;case"cover":r=this.createCoverButton(e,s);break;default:r=this.createTextButton(e)}if(e.custom_css_class){var l,u=e.custom_css_class.split(/\s+/).filter(Boolean);if(u.length>0)(l=r.classList).add.apply(l,n(u))}if("cover"!==a)if(c){var d=document.createElement("div");d.className="ctc-outside ctc-outside--".concat(i),d.appendChild(r),i.includes("before")?s.insertBefore(d,t):s.appendChild(d)}else s.appendChild(r);r.addEventListener("click",(function(n){n.preventDefault(),n.stopPropagation(),o.handleCopy(t,r,e)}))},migratePosition:function(t){var e={inside:"inside_top_right",outside:"outside_after_right"};return["inside_top_left","inside_top_right","inside_bottom_left","inside_bottom_right","outside_before_left","outside_before_right","outside_after_left","outside_after_right"].includes(t)?t:e[t]?e[t]:"inside_top_right"},setCSSVariables:function(t,e){var r=e.style||{};switch(e.visual_style||"button"){case"button":this.setVar(t,"--ctc-bg",r.bg_color,"#4f46e5"),this.setVar(t,"--ctc-hover-bg",r.hover_bg_color||this.darkenColor(r.bg_color||"#4f46e5",12)),this.setVar(t,"--ctc-text-color",r.text_color,"#ffffff"),this.setVar(t,"--ctc-font-size",r.font_size,13,"px"),this.setVar(t,"--ctc-padding-x",r.padding_x,16,"px"),this.setVar(t,"--ctc-padding-y",r.padding_y,8,"px"),this.setVar(t,"--ctc-border-radius",r.border_radius,6,"px");break;case"icon":this.setVar(t,"--ctc-icon-color",r.icon_color,"#6b7280"),this.setVar(t,"--ctc-icon-hover-color",r.icon_hover_color,"#4f46e5"),this.setVar(t,"--ctc-bg",r.bg_color,"transparent"),this.setVar(t,"--ctc-border-color",r.border_color,"#e5e7eb"),this.setVar(t,"--ctc-icon-stroke",r.border_width,1,"px"),this.setVar(t,"--ctc-padding",r.padding,8,"px"),this.setVar(t,"--ctc-border-radius",r.border_radius,6,"px");break;case"cover":var o=r.overlay_color||"#0f172a",n=r.hover_overlay_color||"#4f46e5",a=(r.overlay_opacity||20)/100,i=Math.min(a+.1,1);this.setVar(t,"--ctc-cover-overlay",this.hexToRgba(o,a)),this.setVar(t,"--ctc-cover-hover-overlay",this.hexToRgba(n,i)),this.setVar(t,"--ctc-cover-blur",r.blur,2,"px");var c=r.cover_bg_color||"#ffffff",s=r.cover_hover_bg_color||"#f1f5f9";this.setVar(t,"--ctc-cover-btn-bg",c),this.setVar(t,"--ctc-cover-btn-hover-bg",s);var l=this.getContrastTextColor(c),u=this.getContrastTextColor(s);this.setVar(t,"--ctc-cover-btn-text",l),this.setVar(t,"--ctc-cover-btn-hover-text",u),this.setVar(t,"--ctc-cover-btn-padding-x",r.cover_padding_x,12,"px"),this.setVar(t,"--ctc-cover-btn-padding-y",r.cover_padding_y,6,"px"),this.setVar(t,"--ctc-cover-btn-radius",r.cover_border_radius,9999,"px"),this.setVar(t,"--ctc-cover-btn-font-size",r.cover_font_size,10,"px")}},setVar:function(t,e,r,o,n){var a=null!=r&&""!==r?r:o;n&&"number"==typeof a&&(a+=n),t.style.setProperty(e,a)},createTextButton:function(t){var e=document.createElement("button");if(e.type="button",e.className="ctc-copy-btn ctc-copy-btn--button",e.setAttribute("aria-label",t.tooltip_text||"Copy to clipboard"),e.setAttribute("data-ctc-button","true"),!1!==t.icon_enabled){var r=this.createIcon(t.icon_key||"clipboard");"right"===t.icon_position?(e.appendChild(this.createTextSpan(t.button_text||"Copy")),e.appendChild(r)):(e.appendChild(r),e.a
1ppendChild(this.createTextSpan(t.button_text||"Copy")))}else e.appendChild(this.createTextSpan(t.button_text||"Copy"));return e},createIconButton:function(t){var e=document.createElement("button");e.type="button",e.className="ctc-copy-btn ctc-copy-btn--icon",e.setAttribute("aria-label",t.tooltip_text||"Copy to clipboard"),e.setAttribute("title",t.tooltip_text||"Copy to clipboard"),e.setAttribute("data-ctc-button","true");var r=t.style||{},o=this.createIcon(t.icon_key||"clipboard",r.icon_size||16);return e.appendChild(o),e},createCoverButton:function(t,e){var r=document.createElement("div");r.className="ctc-cover-overlay";var o=document.createElement("button");return o.type="button",o.className="ctc-cover-button",o.setAttribute("aria-label",t.tooltip_text||"Copy to clipboard"),o.setAttribute("data-ctc-button","true"),!1!==t.icon_enabled&&o.appendChild(this.createCoverIcon(t.icon_key||"clipboard")),o.appendChild(this.createCoverText(t.button_text||"Copy")),r.appendChild(o),e.insertBefore(r,e.firstChild),o},createCoverIcon:function(t){var e,r,o,n=document.createElement("span");n.className="ctc-cover-icon";var a=null===(o=((null===(e=this.config.styles)||void 0===e||null===(e=e.cover)||void 0===e?void 0:e.icons)||(null===(r=this.config.styles)||void 0===r||null===(r=r.button)||void 0===r?void 0:r.icons)||{})[t])||void 0===o?void 0:o.svg;if(!a){var i={clipboard:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"/></svg>',copy:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"/></svg>',eye:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"/></svg>',click:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 15l-2 5L9 9l11 4-5 2zm0 0l5 5M7.188 2.239l.777 2.897M5.136 7.965l-2.898-.777M13.95 4.05l-2.122 2.122m-5.657 5.656l-2.12 2.122"/></svg>'};a=i[t]||i.clipboard}return n.innerHTML=a,n},createCoverText:function(t){var e=document.createElement("span");return e.className="ctc-cover-text",e.textContent=t,e},createTextSpan:function(t){var e=document.createElement("span");return e.className="ctc-copy-btn__text",e.textContent=t,e},createIcon:function(t){var e,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,n=document.createElement("span");n.className="ctc-copy-btn__icon";var a=null===(r=((null===(e=this.config.styles)||void 0===e||null===(e=e.button)||void 0===e?void 0:e.icons)||{})[t])||void 0===r?void 0:r.svg;if(a)a.startsWith("<svg")||(a='<svg viewBox="0 0 16 16" width="'.concat(o,'" height="').concat(o,'">').concat(a,"</svg>"));else{var i={clipboard:'<path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"/><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"/>',check:'<path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"/>'};a='<svg viewBox="0 0 16 16" width="'.concat(o,'" height="').concat(o,'">').concat(i[t]||i.clipboard,"</svg>")}return n.innerHTML=a,n},getCopyAs:function(t){var e,r=null!==(e=t.copy_as)&&void 0!==e?e:t.copy_as;if(r&&-1!==["text","html","text_and_html","image","json","svg"].indexOf(r))return r;var o=t.copy_format||"";return"html"===o||"innerHTML"===o?"html":"text"===o?"text":"text_and_html"},getCopyPayload:(i=o(t().mark((function r(o,n,a,i){var c,s,l,u,d,h,p,f,g,v,b,y,m,x,w,C,_,k,L,E,T;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!window.CTC||"function"!=typeof window.CTC.getCopyPayload){t.next=11;break}return(c=o.cloneNode(!0)).querySelectorAll('.ctc-copy-btn, .ctc-cover-overlay, [data-ctc-button="true"]').forEach((function(t){return t.remove()})),c.querySelectorAll("img.emoji").forEach((function(t){var e=t.getAttribute("alt")||"";t.replaceWith(document.createTextNode(e))})),s=o.classList&&o.classList.contains("hljs")||"PRE"===o.tagName||"CODE"===o.tagName||o.closest&&o.closest("pre.hljs, code.hljs"),l=s?"text":a,u={removeSpaces:!s,trimLines:!1,removeSelectors:[".ctc-copy-btn",".ctc-cover-overlay",".ctc-wrapper"]},"image"===a&&i&&(d=i.image_format||"png",-1!==["png","jpeg","webp"].indexOf(d)&&(u.imageFormat=d,u.imageQuality=null!==(h=i.image_quality)&&void 0!==h?h:.92)),t.next=10,window.CTC.getCopyPayload(c,l,u);case 10:return t.abrupt("return",t.sent);case 11:p=n.textContent||"",f=n.innerHTML||"",g=p.replace(/\s+/g," ").trim(),t.t0=a,t.next="text"===t.t0?17:"html"===t.t0?18:"text_and_html"===t.t0?19:"json"===t.t0?20:"svg"===t.t0?23:"image"===t.t0?27:54;break;case 17:return t.abrupt("return",{value:g,copyAs:"text"});case 18:return t.abrupt("return",{value:g,htmlValue:f,copyAs:"html"});case 19:return t.abrupt("return",{value:g,htmlValue:f,copyAs:"text_and_html"});case 20:v=g;try{v=JSON.stringify(JSON.parse(v),null,2)}catch(t){}return t.abrupt("return",{value:v,copyAs:"json"});case 23:return b=n.querySelector("svg")||("SVG"===n.tagName?n:null),y=b?b.outerHTML:f,m=b?(b.textContent||"").trim():g,t.abrupt("return",{value:m||y,htmlValue:y,copyAs:"svg"});case 27:if((x=this).debug("getCopyPayload - image case START"),w=o.querySelector("img")||("IMG"===o.tagName?o:null),C=o.querySelector("canvas")||("CANVAS"===o.tagName?o:null),x.debug("Image elements found:",{hasImg:!!w,imgSrc:w?w.src:null,imgAlt:w?w.alt:null,hasCanvas:!!C,canvasToBlob:C?e(C.toBlob):"N/A"}),_=null,k=null,!C||"function"!=typeof C.toBlob){t.next=41;break}return x.debug("Using canvas.toBlob"),t.next=38,new Promise((function(t){C.toBlob((function(e){x.debug("canvas.toBlob result:",{hasBlob:!!e,blobSize:e?e.size:0}),t(e||null)}),"image/png")}));case 38:_=t.sent,t.next=48;break;case 41:if(!w||!w.src){t.next=48;break}x.debug("Creating image blob from img element"),L=!1;try{E=new URL(w.src,window.location.href),L=E.origin===window.location.origin,x.debug("Image origin check:",{imgOrigin:E.origin,pageOrigin:window.location.origin,isSameOrigin:L})}catch(t){x.debug("error","URL parsing failed:",t),L=!1}return t.next=47,new Promise((function(t,e){var r=document.createElement("canvas"),o=r.getContext("2d"),n=new Image;L?x.debug("Same-origin image, not using crossOrigin"):(n.crossOrigin="anonymous",x.debug('Using crossOrigin="anonymous" for cross-origin image')),n.onload=function(){x.debug("Image loaded successfully:",{naturalWi
1dth:n.naturalWidth,naturalHeight:n.naturalHeight});try{r.width=n.naturalWidth,r.height=n.naturalHeight,o.drawImage(n,0,0),r.toBlob((function(e){x.debug("canvas.toBlob from image result:",{hasBlob:!!e,blobSize:e?e.size:0,blobType:e?e.type:null}),t(e||null)}),"image/png")}catch(t){x.debug("error","Canvas draw failed:",t),e(new Error("Canvas draw failed - may be CORS restricted"))}},n.onerror=function(){var t=L?"Image load failed":"Image load failed - may be cross-origin without CORS headers";x.debug("error","Image load error:",t),e(new Error(t))},n.src=w.src,x.debug("Image src set:",w.src)})).catch((function(t){return k=t.message||"Image blob creation failed",x.debug("error","Image blob creation failed:",k),null}));case 47:_=t.sent;case 48:if(_){t.next=52;break}return T=w&&(w.alt||w.src)||g,x.debug("error","Image blob creation FAILED - falling back to text:",{error:k,fallbackValue:T,fallbackValueLength:T.length}),t.abrupt("return",{value:T,copyAs:"text",imageBlobError:k});case 52:return x.debug("Image blob created successfully:",{blobSize:_.size,blobType:_.type}),t.abrupt("return",{value:g,imageBlob:_,copyAs:"image"});case 54:return t.abrupt("return",{value:g,htmlValue:f,copyAs:"text_and_html"});case 55:case"end":return t.stop()}}),r,this)}))),function(t,e,r,o){return i.apply(this,arguments)}),handleCopy:(a=o(t().mark((function e(r,o,n){var a,i,c,s,l,u,d,h,p,f,g,v,b,y,m;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.debug("handleCopy START",{ruleId:n.id,selector:n.selector}),(a=r.cloneNode(!0)).querySelectorAll('.ctc-copy-btn, .ctc-cover-overlay, [data-ctc-button="true"]').forEach((function(t){return t.remove()})),i=this.getCopyAs(n),this.debug("copyAs from rule:",i),t.next=7,this.getCopyPayload(r,a,i,n);case 7:if(c=t.sent,s=c.value||"",this.debug("Payload received:",{copyAs:c.copyAs,hasImageBlob:!!c.imageBlob,imageBlobSize:c.imageBlob?c.imageBlob.size:0,textLength:s.length,textPreview:s.substring(0,50)}),u=(l="image"===i)&&(!c.imageBlob||"image"!==c.copyAs),this.debug("Image copy check:",{imageCopyRequested:l,imageCopyFailed:u,hasImageBlob:!!c.imageBlob,payloadCopyAs:c.copyAs}),d=!1,h=null,p=c.copyAs,f=!1,t.prev=17,!window.CTC||!window.CTC.CopyEngine){t.next=32;break}return this.debug("Using CopyEngine"),g=new window.CTC.CopyEngine,v={value:c.value,htmlValue:c.htmlValue||"",imageBlob:c.imageBlob||null,copyAs:c.copyAs,intent:"content",source:"global-injector",context:{ruleId:n.id,selector:n.selector}},this.debug("CopyEngine params:",{copyAs:v.copyAs,hasImageBlob:!!v.imageBlob,imageBlobSize:v.imageBlob?v.imageBlob.size:0,valueLength:v.value?v.value.length:0}),t.next=25,g.execute(v);case 25:b=t.sent,d=b.success,h=b.reason||null,this.debug("CopyEngine result:",{success:b.success,reason:b.reason,copyAs:v.copyAs}),l&&"image"===c.copyAs&&(b.success&&c.imageBlob?(f=!0,p="image",this.debug("Image ACTUALLY copied successfully!")):(f=!1,p="text",d=!1,this.debug("error","Image copy FAILED!",{reason:b.reason,hasBlob:!!c.imageBlob,willFallback:!0}))),t.next=33;break;case 32:this.debug("warn","CopyEngine not available");case 33:if(d||!navigator.clipboard||!navigator.clipboard.writeText){t.next=48;break}return this.debug("Fallback to writeText"),t.prev=35,t.next=38,navigator.clipboard.writeText(s);case 38:d=!0,h=null,p="text",this.debug("Text copied via writeText fallback"),t.next=48;break;case 44:t.prev=44,t.t0=t.catch(35),h=t.t0.message||"Clipboard API failed",this.debug("error","writeText fallback failed:",t.t0);case 48:d||(this.debug("Fallback to execCommand"),(y=document.createElement("textarea")).value=s,y.style.cssText="position:fixed;opacity:0;pointer-events:none;",document.body.appendChild(y),y.select(),d=document.execCommand("copy"),document.body.removeChild(y),d?(h=null,p="text",this.debug("Text copied via execCommand fallback")):(h="execCommand failed",this.debug("error","execCommand fallback failed"))),m=d&&(!l||f),this.debug("Final decision:",{copySuccess:d,imageCopyRequested:l,imageActuallyCopied:f,actualCopyType:p,shouldShowSuccess:m,willShowFallback:l&&!f&&d}),d?(l&&!f?(this.debug("warn","Image copy FAILED - showing fallback feedback instead of success!"),this.show
1FallbackFeedback(o,n,p,l)):(this.debug("Showing success feedback"),this.showSuccessFeedback(o,n)),this.trackEvent(n,!0,null)):(this.debug("error","Copy completely failed - showing error feedback"),this.showErrorFeedback(o,n),this.trackEvent(n,!1,h)),t.next=59;break;case 54:t.prev=54,t.t1=t.catch(17),this.debug("error","Failed to copy:",t.t1),this.showErrorFeedback(o,n),this.trackEvent(n,!1,t.t1.message||"Unknown error");case 59:case"end":return t.stop()}}),e,this,[[17,54],[35,44]])}))),function(t,e,r){return a.apply(this,arguments)}),showSuccessFeedback:function(t,e){var r=t.classList.contains("ctc-cover-button"),o=t.querySelector(r?".ctc-cover-text":".ctc-copy-btn__text"),n=t.querySelector(r?".ctc-cover-icon":".ctc-copy-btn__icon"),a=o?o.textContent:"",i=n?n.innerHTML:"";if(o&&(o.textContent=e.success_text||"Copied!"),n){var c,s=(null===(c=n.querySelector("svg"))||void 0===c?void 0:c.getAttribute("width"))||(r?12:16);n.innerHTML='<svg viewBox="0 0 16 16" width="'.concat(s,'" height="').concat(s,'"><path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"/></svg>')}if(t.classList.add(r?"ctc-copied":"ctc-copy-btn--copied"),r){var l=t.closest(".ctc-cover-overlay");l&&l.classList.add("ctc-copied")}setTimeout((function(){if(o&&(o.textContent=a),n&&(n.innerHTML=i),t.classList.remove(r?"ctc-copied":"ctc-copy-btn--copied"),r){var e=t.closest(".ctc-cover-overlay");e&&e.classList.remove("ctc-copied")}}),2e3)},showFallbackFeedback:function(t,e,r,o){var n=t.classList.contains("ctc-cover-button"),a=t.querySelector(n?".ctc-cover-text":".ctc-copy-btn__text"),i=t.querySelector(n?".ctc-cover-icon":".ctc-copy-btn__icon"),c=a?a.textContent:"",s=i?i.innerHTML:"";if(a){var l=window.isSecureContext||"undefined"!=typeof location&&"https:"===location.protocol?"Copied as text":"Copied as text (image copy requires HTTPS)";a.textContent=l}if(i){var u,d=(null===(u=i.querySelector("svg"))||void 0===u?void 0:u.getAttribute("width"))||(n?12:16);i.innerHTML='<svg viewBox="0 0 16 16" width="'.concat(d,'" height="').concat(d,'"><path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"/></svg>')}if(t.classList.add(n?"ctc-copied":"ctc-copy-btn--copied"),n){var h=t.closest(".ctc-cover-overlay");h&&h.classList.add("ctc-copied")}setTimeout((function(){if(a&&(a.textContent=c),i&&(i.innerHTML=s),t.classList.remove(n?"ctc-copied":"ctc-copy-btn--copied"),n){var e=t.closest(".ctc-cover-overlay");e&&e.classList.remove("ctc-copied")}}),3e3)},showErrorFeedback:function(t,e){var r=t.classList.contains("ctc-cover-button"),o=t.querySelector(r?".ctc-cover-text":".ctc-copy-btn__text"),n=o?o.textContent:"";o&&(o.textContent="Error"),t.classList.add(r?"ctc-error":"ctc-copy-btn--error"),setTimeout((function(){o&&(o.textContent=n),t.classList.remove(r?"ctc-error":"ctc-copy-btn--error")}),2e3)},trackEvent:function(t,e,r){var o=this;if((!t||!1!==t.analytics_enabled)&&this.config.eventsUrl){var n={rule_id:t.id||null,success:e,error_reason:r||null,device:this.detectDevice(),browser:this.detectBrowser(),metadata:{source:"global-injector",post_id:this.config.postId||null,post_type:this.config.postType||null,page_url:this.config.pageUrl||window.location.href}};window.requestIdleCallback?window.requestIdleCallback((function(){return o.sendEvent(n)})):setTimeout((function(){return o.sendEvent(n)}),0)}},sendEvent:(r=o(t().mark((function e(r){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch(this.config.eventsUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});case 3:t.next=8;break;case 5:t.prev=5,t.t0=t.catch(0),console.debug("CTC: Analytics event failed:",t.t0);case 8:case"end":return t.stop()}}),e,this,[[0,5]])}))),function(t){return r.apply(this,arguments)}),detectDevice:function(){var t=navigator.userAgent;return/tablet|ipad|playbook|silk/i.test(t)?"tablet":/mobile|iphone|ipod|android|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile/i.test(t)?"mobile":"desktop"},detectBrowser:function(){var t=navigator.userAgent;return t.indexOf("Chrome")>-1?"chrome":t.indexOf("Firefox")>-1?"firefox":t.indexOf("Safari")>-1?"safari":t.indexOf("Edge")>-1?"edge":"unknown"},hexToRgba:function(t,e){t=t.replace("#","");var r=parseInt(t.substring(0,2),16),o=parseInt(t.substring(2,4),16),n=parseInt(t.substring(4,6),16);return"rgba(".concat(r,", ").concat(o,", ").concat(n,", ").concat(e,")")},getContrastTextColor:function(t){if(!t||"string"!=typeof t)return"#0f172a";var e=t.replace("#","");return 6!==e.length||.2126*(parseInt(e.substring(0,2),16)/255)+.7152*(parseInt(e.substring(2,4),16)/255)+.0722*(parseInt(e.substring(4,6),16)/255)>.5?"#0f172a":"#ffffff"},darkenColor:function(t,e){t=t.replace("#","");var r=1-e/100,o=Math.round(parseInt(t.substring(0,2),16)*r),n=Math.round(parseInt(t.substring(2,4),16)*r),a=Math.round(parseInt(t.substring(4,6),16)*r);return"#"+[o=Math.max(0,Math.min(255,o)),n=Math.max(0,Math.min(255,n)),a=Math.max(0,Math.min(255,a))].map((function(t){return t.toString(16).padStart(2,"0")})).join("")}};c.init(),window.CTCGlobalInjector=c}()}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.