1void 0===window.JThemeSelector&&(window.JThemeSelector=function(e,t,o){var n={inited:!1,id:e};Object.defineProperties(this,{inited:{get:function(){return n.inited},set:function(e){e&&(n.inited=!0)}},id:{get:function(){return n.id}}}),this.params=function(e){if("object"==typeof t&&void 0!==e&&Object.keys(t).indexOf(e)>-1)return t[e]},this.result=function(e){if("object"==typeof o&&void 0!==e&&Object.keys(o).indexOf(e)>-1)return o[e]},this.init()},window.JThemeSelector.prototype={node:null,get color(){return this.isDefaultColor?"default":BX.hasClass(document.body,"theme-dark")?"dark":"light"},set color(e){if(this.node&&("light"===e||"dark"===e||"default"===e)){let t=e;"default"===e&&(t=this.defaultColor);let o=this.node.querySelector(".theme-selector__item--"+t);if(o&&!BX.hasClass(o,"current")){BX.addClass(o,"current"),this.node.setAttribute("title",BX.message("TS_T_"+t));let e=Array.prototype.slice.call(this.node.querySelectorAll(".theme-selector__item.current:not(.theme-selector__item--"+t+")"));if(e.length)for(let t=0;t<e.length;++t)BX.removeClass(e[t],"current")}if(!BX.hasClass(document.body,"theme-"+e)){BX.removeClass(document.body,"theme-default theme-dark theme-light"),BX.addClass(document.body,"theme-"+e);let t=Array.prototype.slice.call(document.querySelectorAll('.style-switcher [data-option-id="THEME_VIEW_COLOR"]'));if(t.length)for(let o=0;o<t.length;++o){let n=t[o].getAttribute("data-option-value");n&&n.toLowerCase()===e?BX.addClass(t[o],"current"):BX.removeClass(t[o],"current")}let o=new FormData;o.set("color",e),this.sendAction("setColor",o),BX.onCustomEvent("onChangeThemeColor",[{value:e}])}}},get isDefaultColor(){return BX.hasClass(document.body,"theme-default")},get defaultColor(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"},init:function(){this.inited||(this.inited=!0,this.node=BX("theme-selector--"+this.id),this.node&&(this.node.theme_selector=this,this.bindEvents(),this.color=this.color))},invert:function(){let e=this.isDefaultColor?this.defaultColor:this.color;this.color="light"===e?"dark":"light"},bindEvents:function(){this.node&&("function"==typeof this.handlers.onNodeClick&&BX.bind(this.node,"click",BX.proxy(this.handlers.onNodeClick,this)),"function"==typeof this.handlers.onKeyDown&&BX.bind(document.body,"keydown",BX.proxy(this.handlers.onKeyDown,this)),"function"==typeof this.handlers.onChangePrefersColorScheme&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",BX.proxy(this.handlers.onChangePrefersColorScheme,this)),"function"==typeof this.handlers.onChangeThemeColor&&BX.addCustomEvent("onChangeThemeColor",BX.proxy(this.handlers.onChangeThemeColor,this)))},unbindEvents:function(){this.node&&("function"==typeof this.handlers.onNodeClick&&BX.unbind(this.node,"click",BX.proxy(this.handlers.onNodeClick,this)),"function"==typeof this.handlers.onKeyDown&&BX.unbind(document.body,"keydown",BX.proxy(this.handlers.onKeyDown,this)),"function"==typeof this.handlers.onChangePrefersColorScheme&&window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",BX.proxy(this.handlers.onChangePrefersColorScheme,this)),"function"==typeof this.handlers.onChangeThemeColor&&BX.removeCustomEvent("onChangeThemeColor",BX.proxy(this.handlers.onChangeThemeColor,this)))},sendAction:function(e,t,o,n,i){t.set("is_ajax_post","Y"),t.set("sessid",BX.message("bitrix_sessid")),t.set("lang",BX.message("LANGUAGE_ID")),t.set("SITE_ID",this.result("SITE_ID")),t.set("SIGNED_PARAMS",this.result("SIGNED_PARAMS")),BX.ajax.runComponentAction("aspro:theme.selector.premier",e,{mode:"ajax",data:t}).then(BX.proxy((function(e){"function"==typeof o&&o(e),"function"==typeof i&&i()}),this),BX.proxy((function(e){console.error(e);let t="";for(let o=0;o<e.errors.length;++o)"object"==typeof e.errors[o]&&e.errors[o].message.length&&(!t.length||e.errors[o].message.length<t.length)&&(t=e.errors[o].message);"function"==typeof n&&n(t),"function"==typeof i&&i()}),this))},handlers:{onNodeClick:function(e){this.invert()},onKeyDown:function(e){(e=e||window.event).ctrlKey&&e.shiftKey&&76==e.keyCode&&(this.invert(),e.stopImmediatePropagation())},onChangePrefersColorScheme:function(e){this.isDefaultColor&&(e||(e=window.event),this.color="default")},onChangeThemeColor:function(e){"object"==typeof e&&e&&"value"in e&&(this.color=e.value)}}});
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.