05-tilda-export-backup/Tilda_ Фантомные тигры Петербурга_files/t-selectbox.min.js

1 line
19 KiB
JavaScript
Raw Permalink Normal View History

2025-10-29 16:50:39 +00:00
(()=>{"use strict";const t={ru:"com",by:"biz",kz:"pro",cc:"one"}[function(){const t={ru:"com",by:"biz",kz:"pro",cc:"one"};let e="cc";if("undefined"!=typeof window){const o=window.location.origin.split(".").pop()||"";Object.keys(t).includes(o)&&(e=o)}return e}()],e=[`https://app.tildacdn.${t}/tfront/plugins/tooltip/t-tooltip.min.js`,`https://app.tildacdn.${t}/tfront/plugins/tooltip/t-tooltip.min.css`],o={position:"bottom",closeDelay:0,maxWidth:200,zIndex:999999999},n={position:"top",type:"info",closeDelay:0,maxWidth:250,zIndex:999999999};var s=function(t,e,o,n){var i;e[0]=0;for(var r=1;r<e.length;r++){var d=e[r++],l=e[r]?(e[0]|=d?1:2,o[e[r++]]):e[++r];3===d?n[0]=l:4===d?n[1]=Object.assign(n[1]||{},l):5===d?(n[1]=n[1]||{})[e[++r]]=l:6===d?n[1][e[++r]]+=l+"":d?(i=t.apply(l,s(t,l,o,["",null])),n.push(i),l[0]?e[0]|=2:(e[r-2]=0,e[r]=i)):n.push(l)}return n},i=new Map;(function(t){var e=i.get(this);return e||(e=new Map,i.set(this,e)),(e=s(this,e.get(t)||(e.set(t,e=function(t){for(var e,o,n=1,s="",i="",r=[0],d=function(t){1===n&&(t||(s=s.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?r.push(0,t,s):3===n&&(t||s)?(r.push(3,t,s),n=2):2===n&&"..."===s&&t?r.push(4,t,0):2===n&&s&&!t?r.push(5,0,!0,s):n>=5&&((s||!t&&5===n)&&(r.push(n,0,s,o),n=6),t&&(r.push(n,t,0,o),n=6)),s=""},l=0;l<t.length;l++){l&&(1===n&&d(),d(l));for(var a=0;a<t[l].length;a++)e=t[l][a],1===n?"<"===e?(d(),r=[r],n=3):s+=e:4===n?"--"===s&&">"===e?(n=1,s=""):s=e+s[0]:i?e===i?i="":s+=e:'"'===e||"'"===e?i=e:">"===e?(d(),n=1):n&&("="===e?(n=5,o=s,s=""):"/"===e&&(n<5||">"===t[l][a+1])?(d(),3===n&&(r=r[0]),n=r,(r=r[0]).push(2,0,n),n=0):" "===e||"\t"===e||"\n"===e||"\r"===e?(d(),n=2):s+=e),3===n&&"!--"===s&&(n=4,r=r[0])}return d(),r}(t)),e),arguments,[])).length>1?e:e[0]}).bind((function(t,s){this[0]=3;for(var i=arguments.length,d=new Array(i>2?i-2:0),l=2;l<i;l++)d[l-2]=arguments[l];if("function"==typeof t){const e=s?.bindTo;e&&delete s.bindTo;const o=new t(s).render(),n=o.querySelector("[children-container]")||o;if(n.append(...d.flat()),n.removeAttribute("children-container"),Array.isArray(e)){const[t,n]=e;t&&"object"==typeof t&&["string","number"].includes(typeof n)&&(t[n]=o)}return o}if("string"==typeof t){const i=document.createElement(t);return s&&Object.entries(s).forEach((t=>{let[s,d]=t;if(s.startsWith("on"))Array.isArray(d)?d.forEach((t=>i.addEventListener(s.substring(2).toLowerCase(),t))):"function"==typeof d&&i.addEventListener(s.substring(2).toLowerCase(),d);else if("className"===s&&"string"==typeof d)i.classList.add(...d.split(" "));else if("tooltip"===s&&"string"==typeof d)l=i,a=d,r(e).then((()=>{if(!window.Tooltip)return;const t=new window.Tooltip({...o,target:l,content:{title:a}});l.updateTooltipContent=t.updateContent.bind(t)}));else if("infoTooltip"===s&&d&&"object"==typeof d)!function(t,o){r(e).then((()=>{if(!window.Tooltip)return;const e=new window.Tooltip({...n,target:t,content:o});t.updateTooltipContent=e.updateContent.bind(e)}))}(i,d);else if("bindTo"===s){if(Array.isArray(d)){const[t,e]=d;t&&"object"==typeof t&&["string","number"].includes(typeof e)&&(t[e]=i)}}else"testid"===s||("string"==typeof d||"number"==typeof d?i.setAttribute(s,d.toString()):"boolean"==typeof d&&d?i.setAttribute(s,""):d&&(i[s]=d));var l,a})),i.append(...d.flat()),i}if(t instanceof Element)return t;throw new Error("Неверный тип для создания элемента")}));function r(t){const e=(Array.isArray(t)?t:[t]).map((t=>{const e=t.split("."),o=e.pop()?.toLowerCase(),n=window.ver?"?v="+window.ver:"";return"js"===o||"css"===o?function(t,e){return new Promise(((o,n)=>{const s="style"===e,i=s?"link":"script",r=s?"href":"src";let d;try{const{pathname:e}=new URL(t,window.location.href);d=e}catch(e){d=t}const l=document.querySelector(`${i}[${r}*="${d}"]`);if(l)return"true"===l.getAttribute("data-loading")?(l.addEventListener("load",o),void l.addEventListener("error",n)):o(new Event("load"));const a=document.createElement(i);a.setAttribute(r,t),s&&a.setAttribute("rel","stylesheet"),a.setAttribute("data-loading","true"),a.addEventListener("load",(()=>{a.removeAttribute("data-loading