PageSourceSearch

https://actioncoachportugal.pt/bitrix/js/ui/switcher/dist/ui.switcher.bundle.min.js?17903252039847

js actioncoachportugal.pt collected 2026-10-06 06:22:12 UTC 9,847 bytes, 27 lines download raw bytes

1this.BX=this.BX||{};(function(e,i){"use strict";const t={extraLarge:"extra-large",large:"large",medium:"medium",small:"small",extraSmall:"extra-small",extraExtraSmall:"extra-extra-small"};const s={primary:"primary",green:"green"};const a={FILLED:"FILLED",SOLID:"SOLID",TINTED:"TINTED",FILLED_SUCCESS:"FILLED_SUCCESS",FILLED_ALERT:"FILLED_ALERT",FILLED_WARNING:"FILLED_WARNING",FILLED_BLACK:"FILLED_BLACK",FILLED_WHITE:"FILLED_WHITE",FILLED_NO_ACCENT:"FILLED_NO_ACCENT",FILLED_BITRIX_GPT:"FILLED_BITRIX_GPT",FILLED_BOOST:"FILLED_BOOST",TINTED_ACCENT_1:"TINTED_ACCENT_1",TINTED_SUCCESS:"TINTED_SUCCESS",TINTED_ALERT:"TINTED_ALERT",TINTED_WARNING:"TINTED_WARNING",TINTED_GREEN:"TINTED_GREEN",TINTED_VIOLET:"TINTED_VIOLET",TINTED_NO_ACCENT:"TINTED_NO_ACCENT",TINTED_BITRIX_GPT:"TINTED_BITRIX_GPT",OUTLINE:"OUTLINE",OUTLINE_ACCENT_1:"OUTLINE_ACCENT_1",OUTLINE_ACCENT_2:"OUTLINE_ACCENT_2",OUTLINE_ALERT:"OUTLINE_ALERT",OUTLINE_BOOST:"OUTLINE_BOOST",OUTLINE_NO_ACCENT:"OUTLINE_NO_ACCENT",OUTLINE_SUCCESS:"OUTLINE_SUCCESS",OUTLINE_WARNING:"OUTLINE_WARNING",OUTLINE_BITRIX_GPT:"OUTLINE_BITRIX_GPT",SELECTION:"SELECTION"};class l{#e={[t.extraExtraSmall]:"ui-switcher-size-xss",[t.extraSmall]:"ui-switcher-size-xs",[t.small]:"ui-switcher-size-sm",[t.medium]:"ui-switcher-size-md",[t.large]:"ui-switcher-size-lg",[t.extraLarge]:"ui-switcher-size-xl"};#i={[s.primary]:"",[s.green]:"ui-switcher-color-green"};#t={[a.FILLED]:"--style-filled",[a.SOLID]:"--style-filled",[a.TINTED]:"--style-tinted",[a.FILLED_SUCCESS]:"--style-filled-success",[a.FILLED_ALERT]:"--style-filled-alert",[a.FILLED_WARNING]:"--style-filled-warning",[a.FILLED_BLACK]:"--style-filled-black",[a.FILLED_WHITE]:"--style-filled-white",[a.FILLED_NO_ACCENT]:"--style-filled-na",[a.FILLED_BITRIX_GPT]:"--style-filled-bitrix-gpt",[a.FILLED_BOOST]:"--style-filled-boost",[a.TINTED_ACCENT_1]:"--style-tinted-a1",[a.TINTED_SUCCESS]:"--style-tinted-success",[a.TINTED_ALERT]:"--style-tinted-alert",[a.TINTED_WARNING]:"--style-tinted-warning",[a.TINTED_GREEN]:"--style-tinted-green",[a.TINTED_VIOLET]:"--style-tinted-violet",[a.TINTED_NO_ACCENT]:"--style-tinted-na",[a.TINTED_BITRIX_GPT]:"--style-tinted-bitrix-gpt",[a.OUTLINE]:"--style-outline",[a.OUTLINE_ACCENT_1]:"--style-outline-a1",[a.OUTLINE_ACCENT_2]:"--style-outline-a2",[a.OUTLINE_ALERT]:"--style-outline-alert",[a.OUTLINE_BOOST]:"--style-outline-boost",[a.OUTLINE_NO_ACCENT]:"--style-outline-na",[a.OUTLINE_SUCCESS]:"--style-outline-success",[a.OUTLINE_WARNING]:"--style-outline-warning",[a.OUTLINE_BITRIX_GPT]:"--style-outline-bitrix-gpt",[a.SELECTION]:"--style-selection"};#s=false;node;checked=false;id="";handlers={};inputNode;#a=false;#l="";#r=false;events={toggled:"toggled",checked:"checked",unchecked:"unchecked",lock:"lock",unlock:"unlock"};#n="ui-switcher-off";#d="ui-switcher-lock";#h="data-switcher";#c=true;#o=false;#N=null;#T="";#u="";#L=null;#E=null;static#m="data-switcher-init";static list=[];static className="ui-switcher";static classNameOff="ui-switcher-off";constructor(e){this.init(e);l.list.push(this)}static getById(e){return l.list.find((i=>i.id===e))||null}static initByClassName(){const e=document.getElementsByClassName(l.className);[...e].forEach((e=>{if(e.getAttribute(l.#m)){return}new l({node:e})}))}static getList(){return l.list}init(e={}){this.#h=i.Type.isString(e.attributeName)?e.attributeName:this.#h;this.handlers=i.Type.isPlainObject(e.handlers)?e.handlers:{};this.#l=i.Type.isString(e.inputName)?e.inputName:"";this.#r=false;this.#c=i.Type.isBoolean(e.showStateTitle)?e.showStateTitle:true;this.events={toggled:"toggled",checked:"checked",unchecked:"unchecked",lock:"lock",unlock:"unlock"};let a=false;if(e.node){if(!i.Type.isDomNode(e.node)){throw new Error("Parameter `node` DOM Node expected.")}if(this.#N!==null&&this.#N!==e.node){this.#I(this.#N)}this.node=e.node;const l=this.node.getAttribute(this.#h);let r={};try{r=JSON.parse(l??"")||{}}catch{r={}}if(r.id){this.id=r.id}this.checked=Boolean(r.checked);this.#l=r.inputName;if(i.Type.isString(r.color)&&Object.values(s).includes(r.color)){e.color=r.color}if(i.Type.isString(r.size)&&Object.values(t).includes(r.size)){e.size=r.size}a=r.accessible===true;if(i.Type.isString(r.ariaLabel)&&r.ariaLabel.trim()!==""){this.#T=r.ariaLabel.trim()}if(i.Type.isString(r.ariaLabelledBy)&&r.ariaLabelledBy.trim()!==""){this.#u=r.ariaLabelledBy.trim()}if(i.Dom.hasClass(this.node,"--air")){e.useAirDesign=true}}else{this.node=document.createElement("span")}this.#s=e.useAirDesign===true;if(this.#s){this.setAirDesign();this.#b(this.#t,e.style??"")}this.#b(this.#e,e.size??"");if(this.#s===false){this.#b(this.#i,e.color??"")}if(i.Type.isString(e.id)||i.Type.isNumber(e.id)){this.id=e.id}else if(!this.id){this.id=Math.random()}if(i.Type.isString(e.inputName)){this.#l=e.inputName}this.checked=i.Type.isBoolean(e.checked)?e.checked:this.checked;this.#a=i.Type.isBoolean(e.disabled)?e.disabled:this.#a;if(i.Type.isString(e.ariaLabel)&&e.ariaLabel.trim()!==""){this.#T=e.ariaLabel.trim()}if(i.Type.isString(e.ariaLabelledBy)&&e.ariaLabelledBy.trim()!==""){this.#u=e.ariaLabelledBy.trim()}const l=e.accessible===true||a||this.#o;this.#o=this.#y(l);this.#f();this.#_();this.check(this.checked,false);this.disable(this.#a,false)}#b(e,t){const s=e[t];if(!s){return}
1i.Dom.removeClass(this.node,Object.values(e).filter(Boolean));i.Dom.addClass(this.node,s)}#f(){if(this.node.getAttribute(l.#m)){return}this.node.setAttribute(l.#m,"y");i.Dom.addClass(this.node,l.className);if(this.#s){this.setAirDesign()}const e=i.Tag.render`
2			<div>
3				<span class="ui-switcher-cursor"></span>
4				<span class="ui-switcher-enabled">
5					${this.#c?i.Loc.getMessage("UI_SWITCHER_ON"):""}
6				</span>
7				<span class="ui-switcher-disabled">
8					${this.#c?i.Loc.getMessage("UI_SWITCHER_OFF"):""}
9				</span>
10			</div>
11		`;this.node.innerHTML=e.innerHTML;if(this.#l){this.inputNode=i.Tag.render`
12				<input type="hidden" name="${this.#l}" />
13			`;i.Dom.append(this.inputNode,this.node)}this.#L=this.toggle.bind(this);i.bind(this.node,"click",this.#L)}destroy(){const e=l.list.indexOf(this);if(e!==-1){l.list.splice(e,1)}if(this.#L){i.unbind(this.node,"click",this.#L);this.#L=null}if(this.#E){i.unbind(this.node,"keydown",this.#E);this.#E=null}this.#I(this.node);this.#r=false;this.#o=false;this.node?.removeAttribute(l.#m);this.handlers={}}disable(e,t=true,s={}){if(this.isLoading()){return}this.#a=e;if(this.#o){i.Dom.attr(this.node,"aria-disabled",String(e))}t=t!==false;if(e){i.Dom.addClass(this.node,this.#d);t?this.#D(this.events.lock,s):null}else{i.Dom.removeClass(this.node,this.#d);t?this.#D(this.events.unlock,s):null}}check(e,t=true,s={}){if(this.isLoading()){return}this.checked=!!e;if(this.inputNode){this.inputNode.value=this.checked?"Y":"N"}if(this.#o){i.Dom.attr(this.node,"aria-checked",String(this.checked))}t=t!==false;if(this.checked){i.Dom.removeClass(this.node,this.#n);t?this.#D(this.events.unchecked,s):null}else{i.Dom.addClass(this.node,this.#n);t?this.#D(this.events.checked,s):null}if(t){this.#D(this.events.toggled,s)}}isDisabled(){return this.#a}isChecked(){return this.checked}toggle(e){if(this.isDisabled()){return}this.check(!this.isChecked(),true,e)}setLoading(e){this.#r=Boolean(e);if(this.#o){i.Dom.attr(this.node,"aria-busy",String(this.#r))}const t=this.getNode().querySelector(".ui-switcher-cursor");if(this.#r){const e=i.Tag.render`
14				<svg viewBox="25 25 50 50">
15					<circle
16						class="ui-sidepanel-wrapper-loader-path"
17						cx="50"
18						cy="50"
19						r="19"
20						fill="none"
21						stroke-width="5"
22						stroke-miterlimit="10"
23					>
24					</circle>
25				</svg>
26			`;i.Dom.append(e,t)}else{t.innerHTML=""}}isLoading(){return this.#r}setAirDesign(e=true){if(e){i.Dom.addClass(this.node,"--air")}else{i.Dom.removeClass(this.node,"--air")}}#_(){if(!this.#o){return}this.#g();i.Dom.attr(this.node,"aria-busy",String(this.#r));if(this.#N===this.node){return}this.#N=this.node;i.Dom.attr(this.node,"role","switch");i.Dom.attr(this.node,"tabindex","0");i.Dom.attr(this.node,"aria-checked",String(this.checked));[...this.node.children].forEach((e=>{i.Dom.attr(e,"aria-hidden","true")}));if(this.#E===null){this.#E=this.#p.bind(this);i.bind(this.node,"keydown",this.#E)}}#I(e){if(!e||this.#N!==e){return}if(this.#E){i.unbind(e,"keydown",this.#E);this.#E=null}["role","tabindex","aria-checked","aria-disabled","aria-busy","aria-label","aria-labelledby"].forEach((t=>{i.Dom.attr(e,t,null)}));[...e.children].forEach((e=>{i.Dom.attr(e,"aria-hidden",null)}));this.#N=null}#g(){i.Dom.attr(this.node,"aria-labelledby",this.#u===""?null:this.#u);i.Dom.attr(this.node,"aria-label",this.#T===""?null:this.#T)}#p(e){if(e.key!==" "&&e.key!=="Spacebar"&&e.key!=="Enter"){return}if(this.isDisabled()||this.isLoading()){return}e.preventDefault();this.toggle(e)}#C(e){if(!this.#o||e.trim()!==""){return true}console.warn("ui.switcher: `ariaLabel` or `ariaLabelledBy` is required while accessible, name kept");return false}#y(e){if(!e){return false}if(this.#T.trim()===""&&this.#u.trim()===""){console.warn("ui.switcher: `accessible` needs `ariaLabel` or `ariaLabelledBy`, semantics not applied");return false}return true}#D(e,t){i.onCustomEvent(this,e);if(this.handlers[e]){this.handlers[e].call(this,t)}}renderTo(e){if(!i.Type.isDomNode(e)){throw new Error("Target node must be HTMLElement")}i.Dom.append(this.getNode(),e)}getNode(){return this.node}getAttributeName(){return this.#h}getInputName(){return this.#l}setAriaLabel(e){const t=i.Type.isString(e)?e.trim():"";if(t===""&&!this.#C(this.#u)){return}this.#T=t;this.#_()}getAriaLabel(){return this.#T}setAriaLabelledBy(e){const t=i.Type.isString(e)?e.trim():"";if(t===""&&!this.#C(this.#T)){return}this.#u=t;this.#_()}getAriaLabelledBy(){return this.#u}}e.AirSwitcherStyle=a;e.Switcher=l;e.SwitcherColor=s;e.SwitcherSize=t})(this.BX.UI=this.BX.UI||{},BX);
27//# sourceMappingURL=ui.switcher.bundle.map.js

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.