@divkitframework/divkit 30.1.0 → 30.2.0-canary-fd805ccbf422cfcc881ae2caba9560eec8430cc9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{XQ:()=>Ni,rz:()=>Rr,XX:()=>ea}),new Set;const r="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function n(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class o{constructor(t){n(this,"_listeners","WeakMap"in r?new WeakMap:void 0),n(this,"_observer",void 0),n(this,"options",void 0),this.options=t}observe(t,e){return this._listeners.set(t,e),this._getObserver().observe(t,this.options),()=>{this._listeners.delete(t),this._observer.unobserve(t)}}_getObserver(){var t;return null!==(t=this._observer)&&void 0!==t?t:this._observer=new ResizeObserver((t=>{for(const r of t){var e;o.entries.set(r.target,r),null===(e=this._listeners.get(r.target))||void 0===e||e(r)}}))}}function i(){}function a(t){return t()}function s(t){t.forEach(a)}function l(t,...e){if(null==t){for(const t of e)t(void 0);return i}const r=t.subscribe(...e);return r.unsubscribe?()=>r.unsubscribe():r}function c(t,e,r){return t.set(r),e}let u;function d(t){u=t}function p(){if(!u)throw new Error("Function called outside component initialization");return u}function v(t){p().$$.on_destroy.push(t)}function g(t,e){return p().$$.context.set(t,e),e}function f(t){return p().$$.context.get(t)}o.entries="WeakMap"in r?new WeakMap:void 0,new Map;const h=[],m=[];let y=[];const b=[],_=Promise.resolve();let w=!1;function $(){return w||(w=!0,_.then(C)),_}function x(t){y.push(t)}const k=new Set;let E=0;function C(){if(0!==E)return;const t=u;do{try{for(;E<h.length;){const t=h[E];E++,d(t),A(t.$$)}}catch(t){throw h.length=0,E=0,t}for(d(null),h.length=0,E=0;m.length;)m.pop()();for(let t=0;t<y.length;t+=1){const e=y[t];k.has(e)||(k.add(e),e())}y.length=0}while(h.length);for(;b.length;)b.pop()();w=!1,k.clear(),d(t)}function A(t){if(null!==t.fragment){t.update(),s(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(x)}}new Set;const j=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),F=/^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;function V(t){return F.test(t)||"!doctype"===t.toLowerCase()}const D=/[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;function S(t,e){const r=Object.assign({},...t);if(e){const t=e.classes,n=e.styles;t&&(null==r.class?r.class=t:r.class+=" "+t),n&&(null==r.style?r.style=H(n):r.style=H(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),n=e.slice(0,t).trim(),o=e.slice(t+1).trim();n&&(r[n]=o)}for(const t in e){const n=e[t];n?r[t]=n:delete r[t]}return r}(r.style,n)))}let n="";return Object.keys(r).forEach((t=>{if(D.test(t))return;const e=r[t];!0===e?n+=" "+t:j.has(t.toLowerCase())?e&&(n+=" "+t):null!=e&&(n+=` ${t}="${e}"`)})),n}const O=/[&"]/g,P=/[&<]/g;function I(t,e=!1){const r=String(t),n=e?O:P;n.lastIndex=0;let o="",i=0;for(;n.test(r);){const t=n.lastIndex-1,e=r[t];o+=r.substring(i,t)+("&"===e?"&amp;":'"'===e?"&quot;":"&lt;"),i=t+1}return o+r.substring(i)}function T(t){return"string"==typeof t||t&&"object"==typeof t?I(t,!0):t}function M(t){const e={};for(const r in t)e[r]=T(t[r]);return e}function N(t,e){var r;t=void 0!==(null==(r=t)?void 0:r.length)?r:Array.from(r);let n="";for(let r=0;r<t.length;r+=1)n+=e(t[r],r);return n}const z={$$render:()=>""};function R(t,e){if(!t||!t.$$render)throw"svelte:component"===e&&(e+=" this={...}"),new Error(`<${e}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${e}>.`);return t}let B,U;function W(t){function e(e,r,n,o,i){const a=u;d({$$:{on_destroy:B,context:new Map(i||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const s=t(e,r,n,o);return d(a),s}return{render:(t={},{$$slots:r={},context:n=new Map}={})=>{B=[];const o={title:"",head:"",css:new Set},i=e(o,t,{},r,n);return s(B),{html:i,css:{code:Array.from(o.css).map((t=>t.code)).join("\n"),map:null},head:o.title+o.head}},$$render:e}}function L(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${I(e,!0)}"`}`}function H(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${T(t[e])};`)).join(" ")}function q(t){const e=H(t);return e?` style="${e}"`:""}function J(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function G(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?J(Object(r),!0).forEach((function(e){X(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function X(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Z(t,e,r,n){var o;const i=null===(o=r[t])||void 0===o?void 0:o.type;if(e="Boolean"===i&&"boolean"!=typeof e?null!=e:e,!n||!r[t])return e;if("toAttribute"===n)switch(i){case"Object":case"Array":return null==e?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return null==e?null:e;default:return e}else switch(i){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return null!=e?+e:e}}"function"==typeof HTMLElement&&(U=class extends HTMLElement{constructor(t,e,r){super(),X(this,"$$ctor",void 0),X(this,"$$s",void 0),X(this,"$$c",void 0),X(this,"$$cn",!1),X(this,"$$d",{}),X(this,"$$r",!1),X(this,"$$p_d",{}),X(this,"$$l",{}),X(this,"$$l_u",new Map),this.$$ctor=t,this.$$s=e,r&&this.attachShadow({mode:"open"})}addEventListener(t,e,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const r=this.$$c.$on(t,e);this.$$l_u.set(e,r)}super.addEventListener(t,e,r)}removeEventListener(t,e,r){if(super.removeEventListener(t,e,r),this.$$c){const t=this.$$l_u.get(e);t&&(t(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn)return;function t(t){return()=>{let e;return{c:function(){e=function(t){return document.createElement(t)}("slot"),"default"!==t&&function(t,e,r){null==r?t.removeAttribute(e):t.getAttribute(e)!==r&&t.setAttribute(e,r)}(e,"name",t)},m:function(t,r){!function(t,e,r){t.insertBefore(e,r||null)}(t,e,r)},d:function(t){t&&function(t){t.parentNode&&t.parentNode.removeChild(t)}(e)}}}}const e={},r=function(t){const e={};return t.childNodes.forEach((t=>{e[t.slot||"default"]=!0})),e}(this);for(const o of this.$$s)o in r&&(e[o]=[t(o)]);for(const i of this.attributes){const a=this.$$g_p(i.name);a in this.$$d||(this.$$d[a]=Z(a,i.value,this.$$p_d,"toProp"))}this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:G(G({},this.$$d),{},{$$slots:e,$$scope:{ctx:[]}})});const n=()=>{this.$$r=!0;for(const t in this.$$p_d)if(this.$$d[t]=this.$$c.$$.ctx[this.$$c.$$.props[t]],this.$$p_d[t].reflect){const e=Z(t,this.$$d[t],this.$$p_d,"toAttribute");null==e?this.removeAttribute(t):this.setAttribute(this.$$p_d[t].attribute||t,e)}this.$$r=!1};this.$$c.$$.after_update.push(n),n();for(const s in this.$$l)for(const l of this.$$l[s]){const c=this.$$c.$on(s,l);this.$$l_u.set(l,c)}this.$$l={}}}attributeChangedCallback(t,e,r){var n;this.$$r||(t=this.$$g_p(t),this.$$d[t]=Z(t,r,this.$$p_d,"toProp"),null===(n=this.$$c)||void 0===n||n.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{this.$$cn||(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(t){return Object.keys(this.$$p_d).find((e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t))||t}});const Y=[];function Q(t,e=i){let r;const n=new Set;function o(e){if(i=e,((o=t)!=o?i==i:o!==i||o&&"object"==typeof o||"function"==typeof o)&&(t=e,r)){const e=!Y.length;for(const e of n)e[1](),Y.push(e,t);if(e){for(let t=0;t<Y.length;t+=2)Y[t][0](Y[t+1]);Y.length=0}}var o,i}function a(e){o(e(t))}return{set:o,update:a,subscribe:function(s,l=i){const c=[s,l];return n.add(c),1===n.size&&(r=e(o,a)||i),s(t),()=>{n.delete(c),0===n.size&&r&&(r(),r=null)}}}}function K(t,e,r){const n=!Array.isArray(t),o=n?[t]:t;if(!o.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const a=e.length<2;return c=(t,r)=>{let c=!1;const u=[];let d=0,p=i;const v=()=>{if(d)return;p();const o=e(n?u[0]:u,t,r);a?t(o):p="function"==typeof o?o:i},g=o.map(((t,e)=>l(t,(t=>{u[e]=t,d&=~(1<<e),c&&v()}),(()=>{d|=1<<e}))));return c=!0,v(),function(){s(g),p(),c=!1}},{subscribe:Q(r,c).subscribe};var c}const tt="divkit-bd259",et="divkit-d9099",rt="divkit-c016b",nt="divkit-ee112",ot="divkit-aa145",it="divkit-f0cba",at=Symbol("root");function st(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const lt={"text-range":"divkit-faf07",text:"divkit-d9b0e",text_halign_start:"divkit-e70de",text_halign_center:"divkit-e1659",text_halign_end:"divkit-e48b4",text_valign_start:"divkit-b7b70",text_valign_center:"divkit-ef58e",text_valign_end:"divkit-d4206",text_valign_baseline:"divkit-e0c6c",text__inner:"divkit-b8528",text_singleline:"divkit-ef11c",text_multiline:"divkit-ee8e3",text_truncate_none:"divkit-c6ea1",text__inner_gradient:"divkit-cb8e0",text__image:"divkit-bf6e2",text__image_hidden:"divkit-f1002","text_has-focus-color":"divkit-cb341"},ct={outer:"divkit-d65a7","outer_hide-on-transition-in":"divkit-a6d12","outer_halign-self_start":"divkit-cc452","outer_halign-self_center":"divkit-b8331","outer_halign-self_end":"divkit-c573c","outer_halign-self_stretch":"divkit-dcc74","outer_valign-self_start":"divkit-e8077","outer_valign-self_center":"divkit-d40a7","outer_valign-self_end":"divkit-e9f84","outer_valign-self_stretch":"divkit-b7aa3","outer_parent-flex_vertical":"divkit-c143f","outer_parent-flex_horizontal":"divkit-ef302","outer_valign-self_baseline":"divkit-e72b5",outer_width_content:"divkit-b8f4d",outer_height_content:"divkit-faa66","outer_width-constrained":"divkit-d3211","outer_parent-grid":"divkit-ff439","outer_height-constrained":"divkit-a5256","outer_parent-overlap":"divkit-dab2d","outer_parent-overlap-absolute":"divkit-d43fb","outer_scroll-snap_center":"divkit-d9e38","outer_scroll-snap_start":"divkit-efd1e",outer__border:"divkit-d4056",outer_visibility_invisible:"divkit-f018b",outer_visibility_gone:"divkit-e784b","outer_has-action-animation":"divkit-f4980","outer_has-custom-focus":"divkit-c7f14"};function ut(t){if(!t)return;let e="";for(const r in t)if(t.hasOwnProperty(r)){if(!t[r]&&0!==t[r])continue;e&&(e+=";"),e+=r+":"+String(t[r])}return e||void 0}function dt(t){if("number"!=typeof t&&"string"!=typeof t||!t)return"0";const e=Number(t);return Number.isNaN(e)?"0":Math.ceil(1e3*e)/1e4+"em"}function pt(t){let e=dt(t);return"0"===e&&(e+="em"),e}function vt(t,e){for(;t.length<e;)t="0"+t;return t}function gt(t,e=1,r="transparent"){if("#"!==(t=("string"==typeof t&&t||"").toLowerCase()).charAt(0))return r;const n=ft(t);return n?(n.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>vt(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(n)):r}function ft(t){const e=t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])$/i)||t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i);if(e){if(5===e.length){const[t,r,n,o,i]=e,a=2===n.length?n:n+n,s=2===o.length?o:o+o,l=2===i.length?i:i+i,c=2===r.length?r:r+r;return{a:parseInt(c,16),r:parseInt(a,16),g:parseInt(s,16),b:parseInt(l,16)}}const[t,r,n,o]=e,i=2===r.length?r:r+r,a=2===n.length?n:n+n,s=2===o.length?o:o+o;return{a:255,r:parseInt(i,16),g:parseInt(a,16),b:parseInt(s,16)}}return null}function ht(t){let e=String(t);return e.indexOf("&")>-1&&(e=e.replace(/&/g,"&amp;")),e.indexOf("<")>-1&&(e=e.replace(/</g,"&lt;")),e.indexOf(">")>-1&&(e=e.replace(/>/g,"&gt;")),e.indexOf('"')>-1&&(e=e.replace(/"/g,"&quot;")),e}const mt=Boolean;function yt(t){if(1===t.length&&"solid"===t[0].type)return{color:gt(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=gt(t.bg.color||"transparent");return{size:void 0,pos:void 0,image:`linear-gradient(to bottom,${e},${e})`}}({bg:t}):"gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const r=t.bg.colors.filter(mt);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>gt(t))).join(",")+")"}:void 0}({bg:t}):"image"===t.type?function(t){var e;const r=null===(e=t.bg)||void 0===e?void 0:e.image_url;if(r)return{size:wt(t.bg.scale),pos:$t(t.bg),image:'url("'+ht(r)+'")'}}({bg:t}):"radial_gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const r=t.bg.colors.filter(mt);if(!r.length)return;const n=t.bg.radius;let o;n&&"object"==typeof n&&"type"in n&&void 0!==n.value&&("fixed"===n.type?o=pt(n.value):"relative"===n.type&&(o=bt[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${o||"farthest-corner"} at ${_t(t.bg.center_x)} ${_t(t.bg.center_y)},`+r.map((t=>gt(t))).join(",")+")"}}({bg:t}):void 0)).filter(mt).reverse().reduce((function(t,e){return t.image.push(e.image),t.size.push(e.size||"auto"),t.position.push(e.pos||"50% 50%"),t}),{image:[],size:[],position:[]});return{image:e.image.join(","),size:e.size.join(","),position:e.position.join(",")}}const bt={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function _t(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return pt(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function wt(t){return"fit"===t?"contain":"stretch"===t?"fill":"no_scale"===t?"none":"cover"}function $t(t){let e,r;return e="left"===t.content_alignment_horizontal?"0%":"right"===t.content_alignment_horizontal?"100%":"50%",r="top"===t.content_alignment_vertical?"0%":"bottom"===t.content_alignment_vertical?"100%":"50%",e+" "+r}function xt(t){if(t.startsWith("tel:"))return"tel";const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}function kt(t,e){return e.has(t)}function Et(t,e){const r=Number(t);return Number.isNaN(r)||r<0?e:r}function Ct(t,e,r){return"number"==typeof e&&(t&&e>0&&e<=100||!t&&e>=0&&e<100)?e:r}function At(t){return 0!==t.is_enabled&&!1!==t.is_enabled&&void 0!==t.index}function jt(t,e){e&&t.push(e)}function Ft(t,e,r){const n=[];jt(n,e[t]);for(const o in r)if(r.hasOwnProperty(o)){const i=r[o];i&&jt(n,e[`${t}_${o}`+("string"==typeof i?`_${i}`:"")])}return n.join(" ")}const Vt=Symbol("state");function Dt(t,e){var r,n;const o=t.top||0,i=(null!==(r="ltr"===e?t.end:t.start)&&void 0!==r?r:t.right)||0,a=t.bottom||0,s=(null!==(n="ltr"===e?t.start:t.end)&&void 0!==n?n:t.left)||0;return 0===o&&0===i&&0===a&&0===s?"":dt(o)+" "+dt(i)+" "+dt(a)+" "+dt(s)}function St(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!Number.isNaN(e)}function Ot(t){return St(t)&&t>=0}function Pt(t,e,r){var n,o;if(!t)return r;const i=[t.top,null!==(n="ltr"===e?t.end:t.start)&&void 0!==n?n:t.right,t.bottom,null!==(o="ltr"===e?t.start:t.end)&&void 0!==o?o:t.left];for(let t=0;t<i.length;++t)if(i[t]&&!Ot(i[t]))return r;return Dt(t,e)}const It=Object.prototype.hasOwnProperty;function Tt(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return Object.is(t,e);const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++){const o=r[n];if(!It.call(e,o)||!Tt(t[o],e[o]))return!1}return!0}function Mt(t,e){return Tt(t,e)?e:t}function Nt(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function zt(t,e){const r=Number(t);return Number.isNaN(r)?e:r}function Rt(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...Rt(t))})):e.push(t),e}function Bt(t,e){if(!t||"object"!=typeof t)return e;const r=["top","right","bottom","left"];for(let n=0;n<r.length;++n)if(t[r[n]]&&!Ot(t[r[n]]))return e;return t}function Ut(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>dt((t||e)/r*10))).join(" ")}function Wt(t){return 0!==t.is_enabled&&!1!==t.is_enabled}let Lt;function Ht(){}const qt=Symbol("action"),Jt=W(((t,e,r,n)=>{let{componentContext:o}=e,{id:i=""}=e,{actions:a}=e,{doubleTapActions:s}=e,{longTapActions:l}=e,{cls:c=""}=e,{style:u=null}=e,{attrs:d}=e,{use:p=Ht}=e,{customAction:h=null}=e,{isNativeActionAnimation:m=!0}=e,{hasInnerFocusable:y=!1}=e;const b=f(at),_=f(qt);let w;g(qt,{hasAction:()=>Boolean(_.hasAction()||(null==a?void 0:a.length))});let $,x="",k=!1;if(v((()=>{i&&!y&&b.unregisterFocusable(i),clearTimeout(undefined)})),void 0===e.componentContext&&r.componentContext&&void 0!==o&&r.componentContext(o),void 0===e.id&&r.id&&void 0!==i&&r.id(i),void 0===e.actions&&r.actions&&void 0!==a&&r.actions(a),void 0===e.doubleTapActions&&r.doubleTapActions&&void 0!==s&&r.doubleTapActions(s),void 0===e.longTapActions&&r.longTapActions&&void 0!==l&&r.longTapActions(l),void 0===e.cls&&r.cls&&void 0!==c&&r.cls(c),void 0===e.style&&r.style&&void 0!==u&&r.style(u),void 0===e.attrs&&r.attrs&&void 0!==d&&r.attrs(d),void 0===e.use&&r.use&&void 0!==p&&r.use(p),void 0===e.customAction&&r.customAction&&void 0!==h&&r.customAction(h),void 0===e.isNativeActionAnimation&&r.isNativeActionAnimation&&void 0!==m&&r.isNativeActionAnimation(m),void 0===e.hasInnerFocusable&&r.hasInnerFocusable&&void 0!==y&&r.hasInnerFocusable(y),Array.isArray(a)&&(null==a?void 0:a.length))for(let t=0;t<a.length;++t){const e=a[t].url;if(e){x=e,$=a[t].target||void 0;break}}return Array.isArray(a)&&(null==a?void 0:a.length)&&_.hasAction()&&(x="",o.logError(st(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:a}}))),k=Boolean(h),x&&!kt(xt(x),b.getBuiltinProtocols())?(x="",k=!0):!x&&Array.isArray(a)&&(null==a?void 0:a.length)&&(k=!0,a.some((t=>t.url||t.typed||t.menu_items))||o.logError(st(new Error("The component has a list of actions, but does not have a real action"),{level:"warn",additional:{actions:a}}))),x?`<a${S([{href:T(x)},{target:T($)},{style:T(u)},{class:I(c,!0)+" "+I(m?tt:et,!0)+" "+I(null!=l&&l.length?it:"",!0)},M(d)],{})}${L("this",w,0)}>${n.default?n.default({}):""}</a>`:` <span${S([{class:I(c,!0)+I(k?` ${m?tt:et} ${rt}`:"",!0)+" "+I(null!=l&&l.length?it:"",!0)},{style:T(u)},{role:T(k?"button":null)},{tabindex:T(k?0:null)},M(d)],{})}${L("this",w,0)}>${n.default?n.default({}):""}</span>`})),Gt="divkit-b921d";function Xt(t){return St(t)&&t>0}function Zt(t,e){return t.map((t=>{if(t)if("blur"===t.type){if(Xt(t.radius))return`blur(${pt(t.radius/2)})`}else{if("rtl_mirror"===t.type)return;e(st(new Error("Unknown filter"),{level:"warn",additional:{filter:t.type}}))}else e(st(new Error("Incorrect filter"),{level:"warn"}))})).filter(Boolean).join(" ")}const Yt=W(((t,e,r,n)=>{let o,{direction:i}=e,{componentContext:a}=e,{background:s=[]}=e,{radius:l=""}=e;return void 0===e.direction&&r.direction&&void 0!==i&&r.direction(i),void 0===e.componentContext&&r.componentContext&&void 0!==a&&r.componentContext(a),void 0===e.background&&r.background&&void 0!==s&&r.background(s),void 0===e.radius&&r.radius&&void 0!==l&&r.radius(l),o=s.map((t=>{const e={},r={style:e};if("nine_patch_image"===t.type&&t.insets)e["border-image"]=`url("${t.image_url}") ${t.insets.top||0} ${t.insets.right||0} ${t.insets.bottom||0} ${t.insets.left||0} fill`,e["border-image-width"]="auto";else{const n=yt([t]);"solid"===t.type&&(e["background-color"]=n.color),"gradient"===t.type&&(e["background-image"]=n.image),"image"===t.type&&(e.opacity=Number(t.alpha),r.image_url=t.image_url,e["object-fit"]=n.size,e["object-position"]=n.position,Array.isArray(t.filters)&&t.filters.length&&(e.filter=Zt(t.filters,a.logError),"rtl"===i&&t.filters.some((t=>"rtl_mirror"===t.type))&&(e.transform="scale(-1,1)")))}return r})),`<span${L("class","divkit-bf253"+(l?" divkit-dcad7":""),0)}${q({"border-radius":l})}>${N(o,(t=>t.image_url?`<img${L("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${L("class",Gt,0)}${L("style",ut(t.style),0)}>`:`<span${L("class",Gt,0)}${L("style",ut(t.style),0)}></span>`))}</span>`})),Qt=Yt,Kt={left:"start",center:"center",right:"end",start:"start",end:"end"},te={left:"end",center:"center",right:"start",start:"start",end:"end"},ee={top:"start",center:"center",bottom:"end",baseline:"baseline"},re=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,x,k,E,C,A,j,F,V,D,S,O,P,I,T,M,N,z,B,U,W,H,q,J,G,X,Z,Y,Q,tt,et,rt,nt,ot=i,it=i,lt=i,vt=i,ft=i,ht=i,bt=i,_t=i,wt=i,$t=i,jt=i,St=i,It=i,Ht=i,qt=i,Gt=i,Xt=i,Zt=i,{componentContext:Yt}=e,{cls:re=""}=e,{style:ne}=e,{layoutParams:oe={}}=e,{customDescription:ie=!1}=e,{customPaddings:ae=!1}=e,{customActions:se=""}=e,{additionalPaddings:le=null}=e,{heightByAspect:ce=!1}=e,{parentOf:ue}=e,{parentOfSimpleMode:de}=e,{replaceItems:pe}=e,{hasInnerFocusable:ve=!1}=e;const ge=f(at),fe=f(Vt);let he,me;tt=l(ge.direction,(t=>Q=t));let ye,be,_e,we,$e,xe,ke,Ee,Ce,Ae,je,Fe,Ve,De,Se,Oe,Pe,Ie,Te,Me,Ne,ze=null,Re=[],Be={},Ue={},We=!1,Le=1,He="transparent",qe=0,Je={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},Ge="",Xe=null,Ze="",Ye={},Qe=0,Ke=0,tr=0,er=!1,rr=!1,nr={},or=0,ir=0,ar=0,sr=!1,lr=!1,cr=1,ur=[],dr=!1,pr=!1,vr=[],gr=[],fr=[],hr=[],mr=[],yr=[],br="",_r=!1,wr="visible",$r=0,xr=0,kr=!1,Er=null;function Cr(t,e){if(!Array.isArray(ue)||!pe)return;if(de&&1!==(Array.isArray(e)&&e.length||0))return;const r=ue.findIndex((e=>(null==e?void 0:e.id)===t)),n=ue.slice();n.splice(r,1,...e||[]),ue=n,pe(n)}function Ar(){if(ze&&he){const t=ge.getExtensionContext();ze.forEach((e=>{var r;null===(r=e.unmountView)||void 0===r||r.call(e,he,t)})),ze=null}}function jr(t){var e;null==Ne||Ne.destroy(),he=t,dr&&Yt.json.transition_in&&fe.registerChildWithTransitionIn(Yt.json,Yt,Yt.json.transition_in,t).then((()=>{je=!1})).catch((t=>{throw je=!1,t})),dr&&Yt.json.transition_out&&fe.registerChildWithTransitionOut(Yt.json,Yt,Yt.json.transition_out,t),dr&&Yt.json.transition_change&&fe.registerChildWithTransitionChange(Yt.json,Yt,Yt.json.transition_change,t).then((()=>{Ve=!1})).catch((t=>{throw Ve=!1,t}));const r=Yt.fakeElement?[]:Yt.json.visibility_actions||Yt.json.visibility_action&&[Yt.json.visibility_action],n=Yt.fakeElement?[]:Yt.json.disappear_actions;let o;(Array.isArray(r)&&r.length||Array.isArray(n)&&n.length)&&(o=function(t,{visibilityActions:e,disappearActions:r,rootCtx:n,componentContext:o}){const i=[];e&&e.forEach((t=>{i.push({type:"visibility",index:i.length,action:t,visible:!1,count:0,finished:!1})})),r&&r.forEach((t=>{i.push({type:"disappear",index:i.length,action:t,visible:!1,count:0,finished:!1})}));const a=i.map(((t,e)=>{const r="visibility"===t.type;return o.getDerivedFromVars({index:e,visibility_percentage:t.action.visibility_percentage,visibility_duration:r?t.action.visibility_duration:t.action.disappear_duration,log_limit:t.action.log_limit,is_enabled:t.action.is_enabled})}));let s;const l=()=>{s&&s.disconnect(),i.forEach((t=>{t.timer&&clearTimeout(t.timer)}))},c=K(a,(t=>t));let u;const d=t=>{const e="visibility"===t.type,r=o.getJsonWithVars(t.action),i=r.url,a=r.typed;if(i){const t=xt(i);t&&!kt(t,n.getBuiltinProtocols())&&("div-action"===t?n.execAction(r):r.log_id&&n.execCustomAction(r))}else a&&n.execAction(r);n.logStat(e?"visible":"disappear",r)},p=c.subscribe((e=>{u=e.filter(At);const r={};u.forEach((t=>{r[t.index]=t})),l();const n=[...new Set(u.map((t=>{const e="visibility"===i[t.index].type;return Ct(e,t.visibility_percentage,e?50:0)/100})))];n.length&&(s=new IntersectionObserver((t=>{t.forEach((t=>{u.forEach((e=>{const r=i[e.index],n="visibility"===r.type,o=Ct(n,e.visibility_percentage,n?50:0);let a;a=0===o?t.intersectionRatio>=1e-12:t.intersectionRatio>=o/100;const s=n?!a:a;(n?!r.visible&&a:r.visible&&!a)?r.finished||(r.timer=setTimeout((()=>{++r.count;const t=0===e.log_limit?1/0:e.log_limit||1;++r.count>=t&&(r.finished=!0),d(r)}),Et(e.visibility_duration,800))):s&&r.timer&&clearTimeout(r.timer),r.visible=a}))}))}),{threshold:n}),s.observe(t))}));return{destroy(){var t;null===(t=u)||void 0===t||t.forEach((t=>{const e=i[t.index];e&&"disappear"===e.type&&e.visible&&!e.finished&&n.registerTimeout(window.setTimeout((()=>{d(e)}),t.visibility_duration))})),l(),p()}}}(t,{visibilityActions:r,disappearActions:n,rootCtx:ge,componentContext:Yt}));const i=Yt.json.id;return i&&fe.registerChild(i),null===(e=Yt.json.tooltips)||void 0===e||e.forEach((e=>{ge.registerTooltip(t,e)})),Ne={destroy(){i&&fe.unregisterChild(i),o&&o.destroy(),Er&&Er.destroy()}},Ne}function Fr(){Yt.json.focus&&(function(t){let e;return l(t,(t=>e=t))(),e}(ge.isPointerFocus)||(kr=!0),Yt.execAnyActions(hr))}function Vr(){Yt.json.focus&&(kr=!1,Yt.execAnyActions(mr))}v((()=>{var t;Re.forEach((t=>{ge.unregisterParentOf(t)})),Re=[],null===(t=Yt.json.tooltips)||void 0===t||t.forEach((t=>{ge.unregisterTooltip(t)})),Ar()})),void 0===e.componentContext&&r.componentContext&&void 0!==Yt&&r.componentContext(Yt),void 0===e.cls&&r.cls&&void 0!==re&&r.cls(re),void 0===e.style&&r.style&&void 0!==ne&&r.style(ne),void 0===e.layoutParams&&r.layoutParams&&void 0!==oe&&r.layoutParams(oe),void 0===e.customDescription&&r.customDescription&&void 0!==ie&&r.customDescription(ie),void 0===e.customPaddings&&r.customPaddings&&void 0!==ae&&r.customPaddings(ae),void 0===e.customActions&&r.customActions&&void 0!==se&&r.customActions(se),void 0===e.additionalPaddings&&r.additionalPaddings&&void 0!==le&&r.additionalPaddings(le),void 0===e.heightByAspect&&r.heightByAspect&&void 0!==ce&&r.heightByAspect(ce),void 0===e.parentOf&&r.parentOf&&void 0!==ue&&r.parentOf(ue),void 0===e.parentOfSimpleMode&&r.parentOfSimpleMode&&void 0!==de&&r.parentOfSimpleMode(de),void 0===e.replaceItems&&r.replaceItems&&void 0!==pe&&r.replaceItems(pe),void 0===e.hasInnerFocusable&&r.hasInnerFocusable&&void 0!==ve&&r.hasInnerFocusable(ve),o=Yt.origJson,o&&(Xe=null,Ze="",cr=1,_r=!1,wr="visible",$r=0,xr=0,Ie=void 0,Te=void 0,ur=Yt.fakeElement?[]:Yt.json.transition_triggers||["state_change","visibility_change"],dr=Boolean(-1!==ur.indexOf("state_change")&&Yt.json.id),pr=Boolean(-1!==ur.indexOf("visibility_change")&&Yt.json.id),he&&jr(he)),a=Yt.getDerivedFromVars(Yt.json.focus),vt(),vt=l(a,(t=>N=t)),s=Yt.getDerivedFromVars(Yt.json.border),Zt(),Zt=l(s,(t=>nt=t)),c=Yt.getDerivedFromVars(Yt.json.paddings),Xt(),Xt=l(c,(t=>rt=t)),u=Yt.getDerivedFromVars(Yt.json.margins),qt(),qt=l(u,(t=>Y=t)),d=Yt.getDerivedFromVars(Yt.json.width),It(),It=l(d,(t=>X=t)),p=Yt.getDerivedFromVars(Yt.json.alignment_horizontal),Gt(),Gt=l(p,(t=>et=t)),g=Yt.getDerivedFromVars(Yt.json.height),St(),St=l(g,(t=>G=t)),h=Yt.getDerivedFromVars(Yt.json.alignment_vertical),Ht(),Ht=l(h,(t=>Z=t)),m=Yt.getDerivedFromVars(Yt.json.alpha),jt(),jt=l(m,(t=>J=t)),y=Yt.getDerivedFromVars(Yt.json.accessibility),$t(),$t=l(y,(t=>q=t)),b=Yt.getDerivedFromVars(Yt.json.background),wt(),wt=l(b,(t=>H=t)),_=Yt.getDerivedFromVars(Yt.json.action),bt(),bt=l(_,(t=>U=t)),w=Yt.getDerivedFromVars(Yt.json.actions),_t(),_t=l(w,(t=>W=t)),x=Yt.getDerivedFromVars(Yt.json.doubletap_actions),ht(),ht=l(x,(t=>B=t)),k=Yt.getDerivedFromVars(Yt.json.longtap_actions),ft(),ft=l(k,(t=>z=t)),E=Yt.getDerivedFromVars(Yt.json.action_animation),lt(),lt=l(E,(t=>M=t)),C=Yt.getDerivedFromVars(Yt.json.visibility),it(),it=l(C,(t=>T=t)),A=Yt.getDerivedFromVars(Yt.json.transform),ot(),ot=l(A,(t=>I=t)),Re.forEach((t=>{ge.unregisterParentOf(t)})),Re=[],ue&&ue.forEach((t=>{(null==t?void 0:t.id)&&(Re.push(t.id),ge.registerParentOf(t.id,{replaceWith:Cr,isSingleMode:Boolean(de)}))}));{const t=kr&&(null==N?void 0:N.border)?N.border:nt;let e={},r={},n=!1,o="";if(t){if(t.has_shadow){const r=t.shadow;e["box-shadow"]=r?function(t){var e,r,n,o,i,a;return dt((null===(e=t.offset)||void 0===e||null===(r=e.x)||void 0===r?void 0:r.value)||0)+" "+dt((null===(n=t.offset)||void 0===n||null===(o=n.y)||void 0===o?void 0:o.value)||0)+" "+dt(null!==(i=t.blur)&&void 0!==i?i:2)+" "+gt(t.color||"#000000",null!==(a=t.alpha)&&void 0!==a?a:.19)}(r):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}if(t.stroke&&(n=!0,Le=Et(t.stroke.width,Le),He=gt(t.stroke.color,1,He),r["--divkit-border"]=`${dt(Le+1)} solid ${He}`),t.corners_radius?(Je=function(t,e){const r=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<r.length;++t)if(r[t]&&!Ot(r[t]))return e;return t}(t.corners_radius,Je),e["border-radius"]=Ut(Je),["top-left","top-right","bottom-right","bottom-left"].forEach((t=>{Je[t]=(Je[t]||0)+1})),r["--divkit-border-radius"]=Ut(Je)):t.corner_radius&&(qe=Et(t.corner_radius,qe),Je={"top-left":qe,"top-right":qe,"bottom-right":qe,"bottom-left":qe},e["border-radius"]=dt(qe),r["--divkit-border-radius"]=dt(qe+1)),n&&Le&&(t.corners_radius||t.corner_radius)){let t=Object.assign({},Je);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+Le/2})),o=Ut(t)}}Be=Mt(e,Be),Ue=Mt(r,Ue),We=n,Ge=o}Xe=Bt(rt&&!ae?rt:void 0,Xe),j=Dt(function(t,e){if(!t&&!e)return{};if(!e)return t;if(!t)return e;const r={};return["top","right","bottom","left","start","end"].forEach((n=>{const o=t[n];o&&(r[n]=o);const i=e[n];i&&(r[n]=(r[n]||0)+i)})),r}(Xe,le),Q),Ze=Pt(Y,Q,Ze);{let t,e,r,n,o={},i=0,a=0,s=!1,l=!1;const c=null==X?void 0:X.type;if("fixed"===c)Qe=Et(null==X?void 0:X.value,Qe),e=dt(Qe);else if("wrap_content"===c||("match_parent"===c||!c)&&oe.parentHorizontalWrapContent){if(t="content",("wrap_content"===c&&(null==X?void 0:X.constrained)||("match_parent"===c||!c)&&oe.parentHorizontalWrapContent)&&(o["width-constrained"]=!0,"horizontal"===oe.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=X;t.min_size&&Ot(t.min_size.value)&&(r=dt(t.min_size.value)),t.max_size&&Ot(t.max_size.value)&&(n=dt(t.max_size.value))}"match_parent"!==c&&c||Yt.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","vertical"===oe.parentContainerOrientation&&oe.parentContainerWrap&&(l=!0,Yt.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===oe.parentLayoutOrientation?e=`calc(100% - ${pt(((null==Y?void 0:Y.left)||0)+((null==Y?void 0:Y.right)||0))})`:"horizontal"===oe.parentContainerOrientation&&(i=X&&"weight"in X&&X.weight||1,oe.parentContainerWrap&&(s=!0));if("parent"===t)o["halign-self"]="stretch";else{const t=et;o["halign-self"]="left"===t||"center"===t||"right"===t||"start"===t||"end"===t?("ltr"===Q?Kt:te)[t]:oe.parentHAlign||"start"}t&&(o.width=t),ye=e,be=r,_e=n,Ke=i,tr=a,Ye=Mt(o,Ye),er=s,rr=l}{let t,e,r,n,o={},i=0,a=0,s=!1,l=!1;const c=null==G?void 0:G.type;if(ce);else if("fixed"===c)or=Et(null==G?void 0:G.value,or),e=dt(or);else if("match_parent"!==c||oe.parentVerticalWrapContent){if(t="content",("wrap_content"===c&&(null==G?void 0:G.constrained)||"match_parent"===c&&oe.parentVerticalWrapContent)&&(o["height-constrained"]=!0,"vertical"===oe.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=G;(null==t?void 0:t.min_size)&&Ot(t.min_size.value)&&(r=dt(t.min_size.value)),(null==t?void 0:t.max_size)&&Ot(t.max_size.value)&&(n=dt(t.max_size.value))}"match_parent"===c&&Yt.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","horizontal"===oe.parentContainerOrientation&&oe.parentContainerWrap&&(l=!0,Yt.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===oe.parentLayoutOrientation?e=`calc(100% - ${pt(((null==Y?void 0:Y.top)||0)+((null==Y?void 0:Y.bottom)||0))})`:"vertical"===oe.parentContainerOrientation&&(i=(null==G?void 0:G.weight)||1,oe.parentContainerWrap&&(s=!0));if("parent"===t)o["valign-self"]="stretch";else{const t=Z;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===oe.parentContainerOrientation?o["valign-self"]=ee[t]:o["valign-self"]=oe.parentVAlign||"start"}t&&(o.height=t),we=e,$e=r,xe=n,ir=i,ar=a,nr=Mt(o,nr),sr=s,lr=l}var Dr,Sr,Or;if(F=!!oe.overlapParent||void 0,V=oe.overlapParent&&(!X||"match_parent"===X.type)&&!oe.parentHorizontalWrapContent&&"match_parent"===(null==G?void 0:G.type)&&!oe.parentVerticalWrapContent,D=oe.gridArea?`${oe.gridArea.y+1}/${oe.gridArea.x+1}/span ${oe.gridArea.rowSpan}/span ${oe.gridArea.colSpan}`:void 0,Sr=cr,cr=!Ot(Dr=J)||void 0===Dr||Dr>1?Sr:Number(Dr),ke=1===cr?void 0:cr,me=void 0,q&&!ie&&q.description&&(me={},me["aria-label"]=q.description),Ee=kr&&(null==N?void 0:N.background)?N.background:H,Ce={},Ae=!1,Array.isArray(Ee)&&(Ae=Ee.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(Ge),!Ae)){const t=yt(Ee);Ce["background-color"]=t.color,Ce["background-image"]=t.image,Ce["background-size"]=t.size,Ce["background-position"]=t.position,Ce["background-repeat"]="no-repeat"}je=void 0,dr&&Yt.json.transition_in&&ge.isRunning("stateChange")&&(je=!0),Ve=void 0,dr&&Yt.json.transition_change&&ge.isRunning("stateChange")&&fe.hasTransitionChange(Yt.json.id)&&(Ve=!0);{let t=W||U&&[U]||[],e=B||[],r=z||[],n=(null==N?void 0:N.on_focus)||[],o=(null==N?void 0:N.on_blur)||[];Yt.fakeElement?(t=[],e=[],r=[],n=[],o=[]):(Array.isArray(t)||(t=[],Yt.logError(st(new Error("Actions should be array")))),Array.isArray(e)||(e=[],Yt.logError(st(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],Yt.logError(st(new Error("LongTapActions should be array")))),Array.isArray(n)||(n=[],Yt.logError(st(new Error("FocusActions should be array")))),Array.isArray(o)||(o=[],Yt.logError(st(new Error("BlurActions should be array"))))),(t.length||e.length||r.length)&&se&&(t=[],e=[],r=[],Yt.logError(st(new Error(`Cannot use action on component "${se}"`)))),vr=t.filter(Wt),gr=e.filter(Wt),fr=r.filter(Wt),hr=n.filter(Wt),mr=o.filter(Wt)}M&&(yr=Rt(M),br=yr.map((function(t){const e=zt(t.start_value,1),r=zt(t.end_value,1),n=Et(t.start_delay,0),o="undefined"!=typeof matchMedia&&(Lt||(Lt=window.matchMedia("(prefers-reduced-motion)")),Lt.matches)?0:Et(t.duration,300),i=Nt(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return De=e,Se=r,`opacity ${o}ms ${i} ${n}ms`;case"scale":return Oe=e,Pe=r,`transform ${o}ms ${i} ${n}ms`;case"native":case"no_animation":return"";default:return Yt.logError(st(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", "));{const t=wr,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(T,wr);t!==e&&(!_r||"visible"!==wr&&"visible"!==e?wr=e:async function(t){wr=t;const e="visible"===t?"in":"out",r="in"===e?Yt.json.transition_in:Yt.json.transition_out;pr&&r&&(await $(),"in"===e&&(Fe=!0),fe.runVisibilityTransition(Object.assign(Object.assign({},Yt.json),{visibility:"visible"}),Yt,r,he,e).then((()=>{"in"===e&&(Fe=!1)})).catch((t=>{throw"in"===e&&(Fe=!1),t})))}(e)),_r||(_r=!0)}if(Yt.json&&he&&!Tt(Yt.json.extensions,Me)){let t=Me=Yt.json.extensions;$().then((()=>{if(t===Me&&he&&(Ar(),Array.isArray(Yt.json.extensions))){const t=ge.getExtensionContext();ze=Yt.json.extensions.map((e=>{var r;const n=e.id;if(!n)return;const o=ge.getExtension(n,e.params);return o&&(null===(r=o.mountView)||void 0===r||r.call(o,he,t)),o})).filter(mt)}}))}if(S=Object.assign(Object.assign(Object.assign({},Ye),nr),{"parent-overlap":F,"parent-overlap-absolute":V,"scroll-snap":oe.scrollSnap,"hide-on-transition-in":je||Fe||Ve,visibility:wr,"has-action-animation":Boolean(br),"parent-flex":oe.parentContainerOrientation||void 0,"parent-grid":Boolean(oe.gridArea)||void 0,"has-custom-focus":Boolean(kr&&Yt.json.focus)}),I&&void 0!==I.rotation){const t=I.pivot_x||{type:"pivot-percentage",value:50};$r=zt(t.value,$r);const e="pivot-fixed"===t.type?dt($r):`${$r}%`,r=I.pivot_y||{type:"pivot-percentage",value:50};xr=zt(r.value,xr);Ie=`${e} ${"pivot-fixed"===r.type?dt(xr):`${xr}%`}`,Te=`rotate(${I.rotation}deg)`}return O=er||sr?"100%":Ke||ir?0:void 0,P=Object.assign(Object.assign(Object.assign(Object.assign({},ne),Ce),Be),{width:ye,"min-width":be,"max-width":_e,height:we,"min-height":$e,"max-height":xe||(null==ne?void 0:ne["max-height"]),"grid-area":D,padding:j,margin:Ze,opacity:ke,transition:br,"transform-origin":Ie,transform:Te,"flex-grow":Ke||ir||void 0,"flex-shrink":tr||ar?1:void 0,"flex-basis":O,"--divkit-animation-opacity-start":De,"--divkit-animation-opacity-end":Se,"--divkit-animation-scale-start":Oe,"--divkit-animation-scale-end":Pe}),ot(),it(),lt(),vt(),ft(),ht(),bt(),_t(),wt(),$t(),jt(),St(),It(),Ht(),qt(),tt(),Gt(),Xt(),Zt(),rr||lr?"":`${R(Jt,"Actionable").$$render(t,{componentContext:Yt,id:Yt.json.id,use:jr,cls:re+" "+Ft("outer",ct,S),style:ut(P),actions:vr,doubleTapActions:gr,longTapActions:fr,attrs:me,hasInnerFocusable:ve,isNativeActionAnimation:!yr.length||(Or=yr,Or.some((t=>"native"===t.name)))},{},{default:()=>` ${Ae?`${R(Qt,"OuterBackground").$$render(t,{componentContext:Yt,direction:Q,background:Ee,radius:Ge},{},{})}`:""}${n.default?n.default({focusHandler:Fr,blurHandler:Vr,hasCustomFocus:kr}):""}${We?`<span${L("class",ct.outer__border,0)}${L("style",ut(Ue),0)}></span>`:""}`})}`})),ne=re,oe={"text-range":"divkit-faf07","text-range_singleline":"divkit-ccb64","text-range__top-offset":"divkit-d9237","text-range_decoration_both":"divkit-d7e07","text-range_decoration_underline":"divkit-f3dde","text-range_decoration_strike":"divkit-d27b7","text-range_decoration_none":"divkit-c6b0f"};function ie(t,e){const r=Number(t);return Number.isNaN(r)||r<=0?e:r}function ae(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function se(t,e){return ae(t)||e}const le=W(((t,e,r,n)=>{let o,i,a,s,l,c;var u,d;let{componentContext:p}=e,{text:v}=e,{rootFontSize:g}=e,{textStyles:h={}}=e,{singleline:m=!1}=e,{actions:y}=e;const b=f(at);let _,w="none",$=12,x=1.25,k="",E="",C="",A=null;void 0===e.componentContext&&r.componentContext&&void 0!==p&&r.componentContext(p),void 0===e.text&&r.text&&void 0!==v&&r.text(v),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==g&&r.rootFontSize(g),void 0===e.textStyles&&r.textStyles&&void 0!==h&&r.textStyles(h),void 0===e.singleline&&r.singleline&&void 0!==m&&r.singleline(m),void 0===e.actions&&r.actions&&void 0!==y&&r.actions(y),p.json&&(w="none",$=12,x=1.25,k="",_=void 0,E="",C="",A=null);{let t="none";(h.underline||h.strike)&&("single"===h.underline&&"single"===h.strike?t="both":"single"===h.underline?t="underline":"single"===h.strike&&(t="strike")),w=t}return $=ie(h.font_size,$),Xt(h.line_height)&&(x=Number(h.line_height)/$),Ot(h.letter_spacing)&&(k=dt(h.letter_spacing)),_=se(h.font_weight,_),E="string"==typeof h.font_family&&h.font_family?b.typefaceProvider(h.font_family,{fontWeight:_||400}):"",C=gt(h.text_color,1,C),o=h.top_offset?dt(h.top_offset):"",i=h.background?yt([h.background]):null,A=(null===(u=h.border)||void 0===u?void 0:u.stroke)&&h.border.stroke.color&&"transparent"!==gt(h.border.stroke.color)&&Xt(h.border.stroke.width)?{color:h.border.stroke.color,width:h.border.stroke.width}:null,a=ie(null===(d=h.border)||void 0===d?void 0:d.corner_radius,0),s=h.text_shadow?function(t,e){var r,n,o,i,a,s;return"drop-shadow("+gt(t.color||"#000000",null!==(r=t.alpha)&&void 0!==r?r:.19)+" "+dt(10*((null===(n=t.offset)||void 0===n||null===(o=n.x)||void 0===o?void 0:o.value)||0)/e)+" "+dt(10*((null===(i=t.offset)||void 0===i||null===(a=i.y)||void 0===a?void 0:a.value)||0)/e)+" "+dt(10*(null!==(s=t.blur)&&void 0!==s?s:2)/e)+")"}(h.text_shadow,$):void 0,l={singleline:m,decoration:w},c={"font-size":dt(10*$/g),"line-height":x,"letter-spacing":k,"font-weight":_,"font-family":E,filter:s,color:C,background:(null==i?void 0:i.color)||void 0,"box-shadow":A?`inset 0 0 0 ${dt(A.width)} ${A.color}`:void 0,"border-radius":a?dt(a):void 0},`${o?`<span${L("class",oe["text-range__top-offset"],0)}${q({"margin-top":o})}></span>`:""}${R(Jt,"Actionable").$$render(t,{componentContext:p,cls:Ft("text-range",oe,l),actions:y,style:ut(c)},{},{default:()=>`${I(v)}`})}`})),ce=le;function ue(t,e,r){return"left"===t||"center"===t||"right"===t||"start"===t||"end"===t?"left"===t?"ltr"===e?"start":"end":"right"===t?"ltr"===e?"end":"start":t:r}function de(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?"top"===t?"start":"bottom"===t?"end":t:e}function pe(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}function ve(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const ge=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,j,F,V,D,S,O,P,I,T,M,z,B,U,W,H,q,J,G,X,Z=i,Y=i,Q=i,K=i,tt=i,et=i,nt=i,ot=i,it=i,st=i,ct=i,pt=i,vt=i,ft=i,ht=i,{componentContext:mt}=e,{layoutParams:bt}=e;const _t=f(at);W=l(_t.direction,(t=>U=t));let wt,$t="",xt=12,kt=1.25,Et=!1,Ct="",At="",jt=!1,Vt="start",Dt="start",St="",Ot="",Pt="",It=!1,Tt=[],Mt=[];var Nt;v((()=>{Mt.forEach((([t,e])=>{_t.removeSvgFilter(t,e)}))})),void 0===e.componentContext&&r.componentContext&&void 0!==mt&&r.componentContext(mt),void 0===e.layoutParams&&r.layoutParams&&void 0!==bt&&r.layoutParams(bt),mt.json&&(xt=12,kt=1.25,Et=!1,Ct="",wt=void 0,At="",jt=!1,Vt="start",Dt="start",St="",Pt="",It=!1),o=mt.getDerivedFromVars(mt.json.text),ht(),ht=l(o,(t=>X=t)),a=mt.getDerivedFromVars(mt.json.ranges),Q(),Q=l(a,(t=>S=t)),s=mt.getDerivedFromVars(mt.json.images),Y(),Y=l(s,(t=>D=t)),c=mt.getDerivedFromVars({font_size:mt.json.font_size,letter_spacing:mt.json.letter_spacing,font_weight:mt.json.font_weight,font_family:mt.json.font_family,text_color:mt.json.text_color,underline:mt.json.underline,strike:mt.json.strike,line_height:mt.json.line_height,text_shadow:mt.json.text_shadow}),Z(),Z=l(c,(t=>V=t)),u=mt.getDerivedFromVars(mt.json.font_size),ft(),ft=l(u,(t=>G=t)),d=mt.getDerivedFromVars(mt.json.line_height),vt(),vt=l(d,(t=>J=t)),p=mt.getDerivedFromVars(mt.json.max_lines),it(),it=l(p,(t=>z=t)),g=mt.getDerivedFromVars(mt.json.text_alignment_horizontal),ct(),ct=l(g,(t=>H=t)),h=mt.getDerivedFromVars(mt.json.text_alignment_vertical),st(),st=l(h,(t=>B=t)),m=mt.getDerivedFromVars(mt.json.text_color),ot(),ot=l(m,(t=>M=t)),y=mt.getDerivedFromVars(mt.json.focused_text_color),nt(),nt=l(y,(t=>T=t)),b=mt.getDerivedFromVars(mt.json.truncate),et(),et=l(b,(t=>I=t)),_=mt.getDerivedFromVars(mt.json.text_gradient),tt(),tt=l(_,(t=>P=t)),w=mt.getDerivedFromVars(mt.json.selectable),K(),K=l(w,(t=>O=t)),$=mt.getDerivedFromVars(mt.json.auto_ellipsize),pt(),pt=l($,(t=>q=t)),Nt=X,$t=String(null!=Nt?Nt:""),xt=ie(G,xt);{const t=J;Xt(t)?(kt=Number(t)/xt,Et=!0):Et=!1}x=1===z;{let t,e="",r="",n=!1;if(z&&z>1){const o=Number(z);e=o*kt+"em",t=o,r=o,n=!0}else q&&1!==z&&(n=!0);Ct=e,wt=t,At=r,jt=n}Vt=ue(H,U,Vt),Dt=de(B,Dt),k=!S||$t&&1===S.length&&S[0]&&0===S[0].start&&"number"==typeof S[0].end&&S[0].end>=$t.length,E=Boolean(M)!==Boolean(S&&S[0]&&S[0].text_color);{let t="";z&&k&&E&&(t=gt(M||S&&S[0]&&S[0].text_color,1,St)),St=t}Ot=gt(T,1,Ot),C="none"===I?"none":"";{let t="";if(P){const e=yt([P]);e.image&&(t=e.image)}Pt=t}return It=pe(O,It),function(t,e,r,n){let o=[];if(Mt.forEach((([t,e])=>{_t.removeSvgFilter(t,e)})),Mt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(Tt=[]);const i=t;let a=e||[{start:0,end:i.length}],s=r||[],l=0,c=[],u=[];a.forEach((t=>{void 0!==t.start&&void 0!==t.end&&(u.push({index:t.start,range:t,type:"rangeStart",isStart:!0}),u.push({index:t.end,range:t,type:"rangeEnd"}))})),s.forEach(((t,e)=>{void 0!==t.start&&t.url&&t.start<=i.length&&u.push({index:t.start,image:t,type:"image",arrayIndex:e})})),u.sort(((t,e)=>t.index===e.index?t.type!==e.type?"image"===t.type?-1:"image"===e.type?1:t.type<e.type?-1:1:"image"===t.type&&"image"===e.type?e.arrayIndex-t.arrayIndex:"rangeStart"===t.type&&"rangeStart"===e.type?t.range.end-e.range.end:"rangeStart"===t.type?1:"rangeStart"===e.type?-1:"image"!==t.type&&"image"!==e.type?t.range.start-e.range.start:0:t.index-e.index)),u.forEach((t=>{var e,r;let a="image"===t.type?null:t.range,s=t.index;if(s>l){let a=Object.assign(Object.assign({},n),...c);o.push({text:i.substring(l,s),textStyles:a,actions:"rangeEnd"===t.type&&(null===(r=null===(e=t.range)||void 0===e?void 0:e.actions)||void 0===r?void 0:r.filter(Wt))||void 0})}if("rangeStart"===t.type&&a)c.push(a);else if("rangeEnd"===t.type)c=c.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},n),...c),r=dt(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),i=dt(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const a={"font-size":dt(10*(Number(e.font_size)||12)/xt)};let s="";const l=t.image.tint_color,u=ve(t.image.tint_mode,"source_in");if(l){const e=gt(t.image.tint_color);s=_t.addSvgFilter(e,u),Mt.push([e,u])}o.push({image:{url:t.image.url,width:r,height:i,wrapperStyle:a,svgFilterId:s,preloadRequired:Boolean(t.image.preload_required)}})}l=s})),l<i.length&&o.push({text:i.substring(l),textStyles:Object.assign({},n)}),Tt=o}($t,S,D,V),A={singleline:x,multiline:jt,halign:Vt,valign:Dt,truncate:C,"has-focus-color":Boolean(Ot)},j={gradient:Boolean(Pt)},F={"font-size":dt(xt),"line-height":kt,"max-height":Ct,"-webkit-line-clamp":At,color:St,"background-image":Pt,"--divkit-text-focus-color":Ot},Z(),Y(),Q(),K(),tt(),et(),nt(),ot(),it(),st(),W(),ct(),pt(),vt(),ft(),ht(),`${R(ne,"Outer").$$render(t,{cls:Ft("text",lt,A)+" "+(It?"":rt),componentContext:mt,layoutParams:bt},{},{default:()=>`<span${L("class",Ft("text__inner",lt,j),0)}${L("style",ut(F),0)}>${Tt.length?`${N(Tt,(e=>"text"in e?e.text?`${R(ce,"TextRangeView").$$render(t,{componentContext:mt,text:e.text,rootFontSize:xt,textStyles:e.textStyles,singleline:x,actions:e.actions},{},{})}`:"":e.image?`<span${L("style",ut(e.image.wrapperStyle),0)}><img${L("class",lt.text__image,0)}${L("src",e.image.url,0)}${L("loading",e.image.preloadRequired?"eager":"lazy",0)} decoding="async" aria-hidden="true" alt=""${L("style",ut({width:e.image.width,height:e.image.height,"margin-top":Et?`-${e.image.height}`:void 0,"margin-bottom":Et?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${R(ce,"TextRangeView").$$render(t,{componentContext:mt,text:$t,rootFontSize:xt,textStyles:V,singleline:x},{},{})}`}</span>`})}`})),fe=ge,he={container:"divkit-d37d6",container_wrap:"divkit-c8551",container_overflow_visible:"divkit-f315a",container_orientation_vertical:"divkit-ddc33",container_valign_start:"divkit-a31f0",container_valign_center:"divkit-aae61",container_valign_end:"divkit-eac00","container_valign_space-between":"divkit-ce053","container_valign_space-around":"divkit-cf29b","container_valign_space-evenly":"divkit-b4b04",container_halign_start:"divkit-efaf5",container_halign_center:"divkit-bac9d",container_halign_end:"divkit-ca36b","container_halign_space-between":"divkit-e5c38","container_halign_space-around":"divkit-feff2","container_halign_space-evenly":"divkit-e5e05",container_orientation_horizontal:"divkit-fe458",container_orientation_overlap:"divkit-a644d"};function me(t){return{top:Number(null==t?void 0:t.top)||0,right:Number(null==t?void 0:t.right)||0,bottom:Number(null==t?void 0:t.bottom)||0,left:Number(null==t?void 0:t.left)||0}}function ye(t,e,r){const n=((null==e?void 0:e.margins.left)||0)+((null==e?void 0:e.margins.right)||0),o=((null==e?void 0:e.margins.top)||0)+((null==e?void 0:e.margins.bottom)||0);null!=e&&e.show_at_start&&(r?t.top=e.style.height+o:t.left=e.style.width+n),null!=e&&e.show_at_end&&(r?t.bottom=e.style.height+o:t.right=e.style.width+n)}function be(t,e,r){let n;const o=((null==e?void 0:e.margins.left)||0)+((null==e?void 0:e.margins.right)||0),i=((null==e?void 0:e.margins.top)||0)+((null==e?void 0:e.margins.bottom)||0),a=((null==r?void 0:r.margins.left)||0)+((null==r?void 0:r.margins.right)||0),s=((null==r?void 0:r.margins.top)||0)+((null==r?void 0:r.margins.bottom)||0);return n="horizontal"===t?[null!=r&&r.show_between?r.style.height+s:0,null!=e&&e.show_between?e.style.width+o:0]:[null!=e&&e.show_between?e.style.height+i:0,null!=r&&r.show_between?r.style.width+a:0],n.map(dt).join(" ")}function _e(t){var e;const r=null===(e=t.width)||void 0===e?void 0:e.type;return"wrap_content"===r||"fixed"===r}function we(t){var e;return"match_parent"!==(null===(e=t.height)||void 0===e?void 0:e.type)}function $e(t,e,r){if(!(t&&t.shape&&t.shape.type&&e.includes(t.shape.type)&&"shape_drawable"===t.type))return r;let n;if("rounded_rectangle"===t.shape.type)n={width:Et(null===(i=(o=t.shape).item_width)||void 0===i?void 0:i.value,10),height:Et(null===(a=o.item_height)||void 0===a?void 0:a.value,10),radius:Et(null===(s=o.corner_radius)||void 0===s?void 0:s.value,5)};else{if("circle"!==t.shape.type)return r;n=function(t){var e;const r=2*Et(null===(e=t.radius)||void 0===e?void 0:e.value,10);return{width:r,height:r,radius:r}}(t.shape)}var o,i,a,s;return function(t,e,r){var n;const o={},i=e.stroke||(null==r?void 0:r.stroke),a=null!=i&&i.color?gt(i.color):"",s=null!=i&&i.width?Number(null!==(n=i.width)&&void 0!==n?n:1):"";o.width=t.width,o.height=t.height,o.borderRadius=t.radius;const l=e.background_color||(null==r?void 0:r.color);return o.background=gt(l),a&&s&&(o.boxShadow=`inset 0 0 0 ${dt(s)} ${a}`),o}(n,t.shape,{color:t.color,stroke:t.stroke})}let xe;function ke(){if("undefined"==typeof document&&(xe=!0),void 0!==xe)return xe;const t=document.createElement("div");return t.style.position="absolute",t.style.display="flex",t.style.flexDirection="column",t.style.gap="1px",t.appendChild(document.createElement("div")),t.appendChild(document.createElement("div")),document.body.appendChild(t),xe=1===t.scrollHeight,document.body.removeChild(t),xe}const Ee="divkit-a7719",Ce="divkit-f6e9a";function Ae(t,e,r,n,o,i){const a=e.margins.left,s=e.margins.right,l=e.margins.top,c=e.margins.bottom;i?t.push({top:r.bottom+l,left:o.left+a,width:Math.max(0,o.right-o.left-a-s),height:n.top-r.bottom-l-c,style:e.style}):t.push({top:o.top+l,left:r.right+a,width:n.left-r.right-a-s,height:Math.max(0,o.bottom-o.top-l-c),style:e.style})}function je(t,e,r,n,o,i){const a={top:Math.min(...r.map((t=>t.top))),right:Math.max(...r.map((t=>t.right))),bottom:Math.max(...r.map((t=>t.bottom))),left:Math.min(...r.map((t=>t.left)))};if(null==e?void 0:e.show_at_start){let s,l;"space-around"===o||"space-evenly"===o?(s=i.left-e.style.width,l=i.top-e.style.height):(s=r[0].left-e.style.width-e.margins.left-e.margins.right,l=r[0].top-e.style.height-e.margins.top-e.margins.bottom),Ae(t,e,{top:0,right:s,bottom:l,left:0},r[0],a,n)}if(null==e?void 0:e.show_between)for(let o=0;o<r.length-1;++o)Ae(t,e,r[o],r[o+1],a,n);if(null==e?void 0:e.show_at_end){const s=r[r.length-1];let l,c;"space-around"===o||"space-evenly"===o?(l=i.bottom+e.style.height,c=i.right+e.style.width):(l=s.bottom+e.style.height+e.margins.top+e.margins.bottom,c=s.right+e.style.width+e.margins.left+e.margins.right),Ae(t,e,s,{top:l,right:0,bottom:0,left:c},a,n)}}const Fe=W(((t,e,r,n)=>{let o,{orientation:i}=e,{separator:a}=e,{lineSeparator:s}=e,{contentHAlign:l}=e,{contentVAlign:c}=e,{direction:u}=e;const d=function(t,e){let r,n=0,o=!1;return function(){const e=Date.now();return!n||Math.abs(e-n)>10?(n=e,r=t.apply(this,arguments)):(o||(o=!0,setTimeout((()=>{o=!1,r=t.apply(this,arguments)}),10)),r)}}((function(){if(!o)return;const t=o.getBoundingClientRect(),e=window.getComputedStyle(o),r={top:t.top+parseFloat(e.paddingTop),right:t.right-parseFloat(e.paddingRight),bottom:t.bottom-parseFloat(e.paddingBottom),left:t.left+parseFloat(e.paddingLeft)};g=[];let n=[...o.children].filter((t=>t!==p&&!t.classList.contains(ct.outer__border))),d=[];for(;n.length;){const t=[],e=n.shift();t.push(e);let r=e.getBoundingClientRect(),o=r.left,a=r.right,s=r.bottom;for(;n.length;){let e=n[0],r=e.getBoundingClientRect();if("vertical"===i){if(r.top<s)break}else if("ltr"===u?r.left<a:r.right>o)break;a=Math.max(a,r.right),o=Math.min(o,r.left),s=Math.max(s,r.bottom),t.push(e),n.shift()}d.push(t)}const v=[];d.forEach((t=>{const e=t.map((t=>function(t){const e=t.getBoundingClientRect(),r=getComputedStyle(t);return{top:e.top-parseFloat(r.marginTop),right:e.right+parseFloat(r.marginRight),bottom:e.bottom+parseFloat(r.marginBottom),left:e.left-parseFloat(r.marginLeft)}}(t)));"rtl"===u&&"horizontal"===i&&e.reverse(),a&&je(g,a,e,"vertical"===i,"vertical"===i?c:l,r);const n={top:Math.min(...e.map((t=>t.top))),right:Math.max(...e.map((t=>t.right))),bottom:Math.max(...e.map((t=>t.bottom))),left:Math.min(...e.map((t=>t.left)))};v.push(n)})),"rtl"===u&&"vertical"===i&&v.reverse(),s&&je(g,s,v,"horizontal"===i,"vertical"===i?l:c,r),g.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let p,g=[],f=!1,h=null,m=null;return v((()=>{f=!1})),void 0===e.orientation&&r.orientation&&void 0!==i&&r.orientation(i),void 0===e.separator&&r.separator&&void 0!==a&&r.separator(a),void 0===e.lineSeparator&&r.lineSeparator&&void 0!==s&&r.lineSeparator(s),void 0===e.contentHAlign&&r.contentHAlign&&void 0!==l&&r.contentHAlign(l),void 0===e.contentVAlign&&r.contentVAlign&&void 0!==c&&r.contentVAlign(c),void 0===e.direction&&r.direction&&void 0!==u&&r.direction(u),o=null,(f&&o||h||m)&&(h&&(h.disconnect(),h=null),m&&(m.disconnect(),m=null),f&&o&&("undefined"!=typeof MutationObserver&&(h=new MutationObserver((function(t){t.some((t=>{var e;const r=null===(e=t.target)||void 0===e?void 0:e.classList;return!(null==r?void 0:r.contains(Ce))&&!(null==r?void 0:r.contains(Ee))}))&&d()})),h.observe(o,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(m=new ResizeObserver(d),m.observe(o)))),f&&o&&d(),` <div${L("class",Ee,0)}${L("this",p,0)}>${N(g,(t=>`<div${L("class","divkit-c770e",0)}${q({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${L("class",Ce,0)}${q({width:`${t.style.width}px`,height:`${t.style.height}px`,"border-radius":`${t.style.borderRadius}px`,background:t.style.background,"box-shadow":t.style.boxShadow})}></div> </div>`))}</div>`})),Ve={start:"start",center:"center",end:"end","space-between":"start","space-around":"start","space-evenly":"start"},De={start:"start",center:"center",end:"end",baseline:"baseline","space-between":"start","space-around":"start","space-evenly":"start"},Se=["rounded_rectangle","circle"],Oe=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,v,g,h,m,y,b,_,w,$,x,k,E,C,A,j,F,V,D,S,O,P,I,T,M,z,B,U=i,W=i,L=i,H=i,q=i,J=i,G=i,X=i,Z=i,Y=i,Q=i,tt=i;var et,rt,nt,ot,it,st,lt;let{componentContext:ct}=e,{layoutParams:ut}=e;const dt=f(at);let pt;O=l(dt.direction,(t=>S=t));let vt,gt="vertical",ft="start",ht="start",yt=null,bt=null,_t={},wt=[];void 0===e.componentContext&&r.componentContext&&void 0!==ct&&r.componentContext(ct),void 0===e.layoutParams&&r.layoutParams&&void 0!==ut&&r.layoutParams(ut),o=ct.origJson,o&&(gt="vertical",ft="start",ht="start",vt=void 0),a=ct.json.items,s=ct.getDerivedFromVars(null===(et=ct.json.item_builder)||void 0===et?void 0:et.data,void 0,!0),tt(),tt=l(s,(t=>B=t)),c=ct.getDerivedFromVars(ct.json.orientation),Q(),Q=l(c,(t=>z=t)),u=ct.getDerivedFromVars(ct.json.layout_mode),Y(),Y=l(u,(t=>M=t)),d=ct.getDerivedFromVars(ct.json.content_alignment_vertical),X(),X=l(d,(t=>I=t)),p=ct.getDerivedFromVars(ct.json.content_alignment_horizontal),G(),G=l(p,(t=>P=t)),v=ct.getDerivedFromVars(ct.json.separator),J(),J=l(v,(t=>D=t)),g=ct.getDerivedFromVars(ct.json.line_separator),q(),q=l(g,(t=>V=t)),h=ct.getDerivedFromVars(ct.json.aspect),H(),H=l(h,(t=>F=t)),m=ct.getDerivedFromVars(ct.json.width),W(),W=l(m,(t=>A=t)),y=ct.getDerivedFromVars(ct.json.height),L(),L=l(y,(t=>j=t)),b=ct.getDerivedFromVars(ct.json.clip_to_bounds),U(),U=l(b,(t=>C=t));{let t=[];if(ct.json.item_builder&&Array.isArray(B)&&Array.isArray(ct.json.item_builder.prototypes)){const e=ct.json.item_builder;t=[],B.forEach((r=>{if(null===r||"object"!=typeof r)return;const n=dt.preparePrototypeVariables(e.data_element_name||"it",r);let o;for(let t=0;t<e.prototypes.length;++t){const r=e.prototypes[t];if(r.div){if(void 0===r.selector){o=r.div;break}if(ct.getJsonWithVars(r.selector,n)){o=r.div;break}}}o&&t.push({div:o,vars:n})}))}else t=(Array.isArray(a)&&a||[]).map((t=>({div:t})));wt=t.map(((t,e)=>ct.produceChildContext(t.div,{path:e,variables:t.vars})))}{let t=[];wt.forEach((e=>{t.push(ct.getDerivedFromVars({width:e.json.width,height:e.json.height}))})),pt=K(t,(t=>[...t])),Z(),Z=l(pt,(t=>T=t))}if(gt=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(z,gt),_="wrap"===M,w="horizontal"!==gt&&!_&&T.some(_e),$="vertical"!==gt&&!_&&T.some(we),ft=function(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t||"space-between"===t||"space-around"===t||"space-evenly"===t?"top"===t?"start":"bottom"===t?"end":t:e}(I,ft),ht=function(t,e,r){return"left"===t||"center"===t||"right"===t||"space-between"===t||"space-around"===t||"space-evenly"===t||"start"===t||"end"===t?"left"===t?"ltr"===e?"start":"end":"right"===t?"ltr"===e?"end":"start":t:r}(P,S,ht),(null==D?void 0:D.style)&&"overlap"!==gt&&ke()){const t=$e(D.style,Se,(null==yt?void 0:yt.style)||null);yt=t?{show_at_start:Boolean(null!==(rt=D.show_at_start)&&void 0!==rt&&rt),show_at_end:Boolean(null!==(nt=D.show_at_end)&&void 0!==nt&&nt),show_between:Boolean(null===(ot=D.show_between)||void 0===ot||ot),style:t,margins:me(D.margins)}:null}else yt=null;if((null==V?void 0:V.style)&&"overlap"!==gt&&ke()){const t=$e(V.style,Se,(null==bt?void 0:bt.style)||null);bt=t?{show_at_start:Boolean(null!==(it=V.show_at_start)&&void 0!==it&&it),show_at_end:Boolean(null!==(st=V.show_at_end)&&void 0!==st&&st),show_between:Boolean(null===(lt=V.show_between)||void 0===lt||lt),style:t,margins:me(V.margins)}:null}else bt=null;x=yt||bt?function(t,e,r){const n={};return ye(n,e,"vertical"===t),ye(n,r,"horizontal"===t),n}(gt,yt,bt):null;{const t=null==F?void 0:F.ratio;vt=t&&Xt(t)?t:void 0}{let t={};"overlap"===gt&&(t.overlapParent=!0),"horizontal"!==gt&&(t.parentHAlign=_?"start":Ve[ht]),"vertical"!==gt&&(t.parentVAlign=_?"start":De[ft]),vt||$||j&&"wrap_content"!==j.type&&("match_parent"!==j.type||!(null==ut?void 0:ut.parentVerticalWrapContent))||(t.parentVerticalWrapContent=!0),!w&&("wrap_content"===(null==A?void 0:A.type)||"match_parent"===(null==A?void 0:A.type)&&(null==ut?void 0:ut.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0),"horizontal"===gt&&(t.parentContainerOrientation="horizontal"),"vertical"===gt&&(t.parentContainerOrientation="vertical"),_&&(t.parentContainerWrap=!0),_t=Mt(t,_t)}return k={orientation:gt,valign:ft,halign:ht,wrap:_,overflow:!1===C||0===C?"visible":void 0},E={gap:yt||bt?be(gt,yt,bt):void 0,"aspect-ratio":vt},U(),W(),L(),H(),q(),J(),O(),G(),X(),Z(),Y(),Q(),tt(),`${R(ne,"Outer").$$render(t,{cls:Ft("container",he,k),componentContext:ct,layoutParams:ut,style:E,additionalPaddings:x,heightByAspect:Boolean(vt),parentOf:wt.map((t=>t.json)),replaceItems:function(t){ct=Object.assign(Object.assign({},ct),{json:Object.assign(Object.assign({},ct.json),{items:t.filter(mt)})})}},{},{default:()=>`${N(wt,(e=>`${R(bn,"Unknown").$$render(t,{componentContext:e,layoutParams:_t},{},{})}`))} ${yt||bt?`${R(Fe,"ContainerSeparators").$$render(t,{direction:S,separator:yt,lineSeparator:bt,orientation:gt,contentHAlign:ht,contentVAlign:ft},{},{})}`:""}`})}`})),Pe=Oe,Ie={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function Te(t,e){return"vertical"===t||"horizontal"===t?t:e}const Me=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,v,g=i,{componentContext:f}=e,{layoutParams:h}=e,m="horizontal",y="rgba(0,0,0,0.08)";return void 0===e.componentContext&&r.componentContext&&void 0!==f&&r.componentContext(f),void 0===e.layoutParams&&r.layoutParams&&void 0!==h&&r.layoutParams(h),o=f.origJson,o&&(m="horizontal",y="rgba(0,0,0,0.08)"),a=f.getDerivedFromVars(f.json.delimiter_style),g(),g=l(a,(t=>v=t)),m=Te(null==v?void 0:v.orientation,m),s=!((null==v?void 0:v.color)&&("transparent"===v.color||9===v.color.length&&0===v.color.indexOf("#00"))),y=gt(null==v?void 0:v.color,1,y),c="horizontal"===m?"100%":dt(1),u="horizontal"===m?dt(1):"100%",d={background:y,width:c,height:u},p={orientation:m},g(),`${R(ne,"Outer").$$render(t,{cls:Ft("separator",Ie,p),componentContext:f,layoutParams:h},{},{default:()=>s?`<span${L("class",Ie.separator__inner,0)}${L("style",ut(d),0)}></span>`:""})}`})),Ne={image:"divkit-a448f","image_is-width-content":"divkit-fe14a","image_is-height-content":"divkit-f4d92",image__image:"divkit-ce046",image_error:"divkit-f10d9","image_is-rtl-mirror":"divkit-ae78c","image__aspect-wrapper":"divkit-dc808",image_aspect:"divkit-ae784",image_loaded:"divkit-cf4e0","divkit-image-appearance":"divkit-e555f","image_before-appearance":"divkit-ffe8a"};function ze(t){return t.startsWith("data:")?ht(t):`data:image/jpg;base64,${ht(t)}`}const Re="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Be=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,j,F,V,D,S,O,P,I,T,M,N,z,B,U,W,H,J,G,X=i,Z=i,Y=i,Q=i,K=i,tt=i,et=i,rt=i,nt=i,ot=i,it=i,lt=i,ct=i,dt=i,pt=i,{componentContext:vt}=e,{layoutParams:ft}=e;const ht=f(at);let mt;D=l(ht.direction,(t=>V=t));let yt,bt,_t=0,xt=!1,kt="rgba(0,0,0,0.08)",Ct=!1,At="",jt="none",Vt="50% 50%",Dt="0",St="source_in",Ot="",Pt="",It=0,Tt=0,Mt=0,zt="",Rt="",Bt=!1;v((()=>{ht.removeSvgFilter(bt,St)})),void 0===e.componentContext&&r.componentContext&&void 0!==vt&&r.componentContext(vt),void 0===e.layoutParams&&r.layoutParams&&void 0!==ft&&r.layoutParams(ft),o=vt.origJson,o&&(jt="none",Vt="50% 50%",St="source_in"),a=vt.getDerivedFromVars(vt.json.image_url),ct(),ct=l(a,(t=>H=t)),s=vt.getDerivedFromVars(vt.json.gif_url),dt(),dt=l(s,(t=>J=t)),c=vt.getDerivedFromVars(vt.json.width),lt(),lt=l(c,(t=>W=t)),u=vt.getDerivedFromVars(vt.json.height),it(),it=l(u,(t=>U=t)),d=vt.getDerivedFromVars(vt.json.preview),ot(),ot=l(d,(t=>B=t)),p=vt.getDerivedFromVars(vt.json.placeholder_color),nt(),nt=l(p,(t=>z=t)),g=vt.getDerivedFromVars(vt.json.scale),rt(),rt=l(g,(t=>N=t)),h=vt.getDerivedFromVars({content_alignment_horizontal:vt.json.content_alignment_horizontal,content_alignment_vertical:vt.json.content_alignment_vertical}),et(),et=l(h,(t=>M=t)),m=vt.getDerivedFromVars(vt.json.accessibility),tt(),tt=l(m,(t=>T=t)),y=vt.getDerivedFromVars(vt.json.aspect),K(),K=l(y,(t=>I=t)),b=vt.getDerivedFromVars(vt.json.tint_color),Q(),Q=l(b,(t=>P=t)),_=vt.getDerivedFromVars(vt.json.tint_mode),Y(),Y=l(_,(t=>O=t)),w=vt.getDerivedFromVars(vt.json.appearance_animation),Z(),Z=l(w,(t=>S=t)),$=vt.getDerivedFromVars(vt.json.filters),X(),X=l($,(t=>F=t)),x=vt.getDerivedFromVars(vt.json.preload_required),pt(),pt=l(x,(t=>G=t));{let t="gif"===vt.json.type?J:H;xt="empty://"===t,xt&&(t=Re),yt=t}_t=0,yt?Ct=!1:(Ct=!0,vt.logError(st(new Error(`Missing "${"gif"===vt.json.type?"gif_url":"image_url"}" for "${vt.json.type}"`)))),k="wrap_content"===(null==W?void 0:W.type),E="wrap_content"===(null==U?void 0:U.type),At=B?`url("${ze(B)}")`:"",kt=gt(z,1,kt),jt=wt(N)||jt,Vt=function(t,e,r){let n=t.content_alignment_horizontal;const o=t.content_alignment_vertical;return"start"===n?n="ltr"===e?"left":"right":"end"===n&&(n="ltr"===e?"right":"left"),n&&"left"!==n&&"center"!==n&&"right"!==n||o&&"top"!==o&&"center"!==o&&"bottom"!==o?r:$t({content_alignment_horizontal:n,content_alignment_vertical:o})}(M,V,Vt),C=(null==T?void 0:T.description)||"";{const t=null==I?void 0:I.ratio;Dt=t&&Xt(t)?(100/Number(t)).toFixed(2):"0"}{const t=P?gt(P):void 0,e=ve(O,St);t===bt&&e===St||(ht.removeSvgFilter(bt,St),Ot=t?ht.addSvgFilter(t,e):"",bt=t,St=e)}if(S&&"fade"===S.type){const t=S;Pt=Nt(t.interpolator,"ease_in_out").replace(/_/g,"-"),Mt=Et(t.duration,300),Tt=Et(t.start_delay,0),It=Et(t.alpha,0)}{let t="",e="";Array.isArray(F)&&F.length&&(t=Zt(F,vt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),zt=t,Rt=e,Bt="rtl"===V&&Array.isArray(F)&&F.some((t=>"rtl_mirror"===t.type))}return A={aspect:"0"!==Dt,"is-width-content":k,"is-height-content":E,loaded:!1,"before-appearance":Boolean(Pt)&&!0,"is-rtl-mirror":Bt},j={"background-image":At,"background-color":At?void 0:kt,"background-size":jt,"clip-path":Rt||void 0,"object-fit":jt,"object-position":Vt,filter:["",zt].filter(Boolean).join(" "),"--divkit-appearance-interpolator":Pt||void 0,"--divkit-appearance-fade-start":Pt?It:void 0,"--divkit-appearance-delay":Pt?`${Tt}ms`:void 0,"--divkit-appearance-duration":Pt?`${Mt}ms`:void 0},X(),D(),Z(),Y(),Q(),K(),tt(),et(),rt(),nt(),ot(),it(),lt(),ct(),dt(),pt(),Ct?"":`${R(ne,"Outer").$$render(t,{cls:Ft("image",Ne,A),componentContext:vt,layoutParams:ft,customDescription:!0},{},{default:()=>A.aspect?`<span${L("class",Ne["image__aspect-wrapper"],0)}${q({"padding-bottom":`${Dt}%`})}><img${L("class",Ne.image__image,0)}${L("src",yt,0)}${L("loading",G?"eager":"lazy",0)} decoding="async"${L("style",ut(j),0)}${L("alt",C,0)}${L("aria-hidden",C?null:"true",0)}${L("this",mt,0)}></span>`:`<img${L("class",Ne.image__image,0)}${L("src",yt,0)}${L("loading",G?"eager":"lazy",0)} decoding="async"${L("style",ut(j),0)}${L("alt",C,0)}${L("aria-hidden",C?null:"true",0)}${L("this",mt,0)}>`})}`})),Ue={grid:"divkit-d9080",grid_halign_start:"divkit-fc24d",grid_halign_center:"divkit-a14a6",grid_halign_end:"divkit-cfd04",grid_valign_start:"divkit-c3106",grid_valign_center:"divkit-d4310",grid_valign_end:"divkit-fa9cf"};function We(t){return t>0&&t<1}function Le(t){return String(Math.ceil(1e3*t)/1e3)}function He(t,e,r){if(t.some(We)){const e=Math.max(...t.filter(We).map((t=>1/t)));t=t.map((t=>t*e))}let n=0,o=0;const i=[];if(t.every(Boolean)){o=t.reduce(((t,e)=>t+e),0);for(let i=0;i<r;++i){if(!e[i])continue;const r=e[i]/t[i]*o;r>n&&(n=r)}}for(let e=0;e<r;++e)n?i[e]=`minmax(${dt(n*t[e]/o)},${Le(t[e])}fr)`:t[e]?i[e]=`${Le(t[e])}fr`:i[e]="auto";return i.join(" ")}const qe=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,v,g,h,m,y,b,_,w,$=i,x=i,k=i,E=i,{componentContext:C}=e,{layoutParams:A}=e;m=l(f(at).direction,(t=>h=t));let j,F,V=1,D=[],S=[],O=[],P=[],I=0,T=!1,M="start",z="start";void 0===e.componentContext&&r.componentContext&&void 0!==C&&r.componentContext(C),void 0===e.layoutParams&&r.layoutParams&&void 0!==A&&r.layoutParams(A),o=C.origJson,o&&(V=1,M="start",z="start"),a=Array.isArray(C.json.items)&&C.json.items||[],s=C.getDerivedFromVars(C.json.column_count),E(),E=l(s,(t=>w=t)),c=C.getDerivedFromVars(C.json.content_alignment_vertical),x(),x=l(c,(t=>b=t)),u=C.getDerivedFromVars(C.json.content_alignment_horizontal),$(),$=l(u,(t=>y=t)),V=ie(w,V),d=a.map(((t,e)=>C.produceChildContext(t,{path:e})));{let t=[];d.forEach((e=>{t.push(C.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),j=K(t,(t=>[...t])),k(),k=l(j,(t=>_=t))}{const t={};let e=0,r=0;D=[],S=[],O=[],P=[],T=!1,F=d.map(((n,o)=>{var i,a,s,l;const c=_[o],u=Number(c.columnSpan)||1,d=Number(c.rowSpan)||1,p={x:e,y:r,colSpan:u,rowSpan:d},v="match_parent"===(null===(i=c.width)||void 0===i?void 0:i.type)?Number(c.width.weight||1)/u:0,g="match_parent"===(null===(a=c.height)||void 0===a?void 0:a.type)?Number(c.height.weight||1)/d:0,f=1===u&&"fixed"===(null===(s=c.width)||void 0===s?void 0:s.type)&&c.width.value?Number(c.width.value)/u:0,h=1===d&&"fixed"===(null===(l=c.height)||void 0===l?void 0:l.type)&&c.height.value?Number(c.height.value)/d:0;for(let n=e;n<e+u;++n)for(let e=r;e<r+d;++e)t[n+"_"+e]?(T=!0,C.logError(st(new Error(`No space for item at index ${o}`)))):(t[n+"_"+e]=!0,(!D[n]||D[n]<v)&&(D[n]=v),(!S[e]||S[e]<g)&&(S[e]=g),(!O[n]||O[n]<f)&&(O[n]=f),(!P[e]||P[e]<h)&&(P[e]=h));do{++e,e>=V&&(e=0,++r)}while(t[e+"_"+r]);return{componentContext:n,layoutParams:{gridArea:p}}})),I=r}return M=de(b,M),z=ue(y,h,z),p={valign:M,halign:z},v={"grid-template-columns":He(D,O,V),"grid-template-rows":He(S,P,I)},g=T,m(),$(),x(),k(),E(),g?"":`${R(ne,"Outer").$$render(t,{cls:Ft("grid",Ue,p),componentContext:C,style:v,layoutParams:A,parentOf:d.map((t=>t.json)),replaceItems:function(t){C=Object.assign(Object.assign({},C),{json:Object.assign(Object.assign({},C.json),{items:t.filter(mt)})})}},{},{default:()=>`${N(F,(e=>`${R(bn,"Unknown").$$render(t,{componentContext:e.componentContext,layoutParams:e.layoutParams},{},{})}`))}`})}`})),Je=qe,Ge={gallery:"divkit-cbb0f",gallery__scroller:"divkit-a4e39",gallery_scrollbar_none:"divkit-f49e7",gallery_orientation_horizontal:"divkit-c9be7",gallery_orientation_vertical:"divkit-a72d5","gallery_scroll-snap":"divkit-f606e","gallery__items-grid":"divkit-eb4a5",gallery__items:"divkit-af276",gallery__arrow:"divkit-b72d7","gallery__arrow-icon-path":"divkit-b4173"},Xe="divkit-bf36b",Ze="divkit-a67bf",Ye="divkit-e2a31",Qe="divkit-c684b";function Ke(t){const e=[];let r=t[0],n=1;for(let o=1;o<=t.length;o++)t[o]!==r?(e.push(n>1?`repeat(${n}, ${r})`:r),r=t[o],n=1):n++;return e.join(" ")}function tr(t,e){let r;return function(...n){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,n),r=null}),e)}}function er(t,e){let r=t%e;return r<0&&(r+=e),r}const rr=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,j,F,V,D,S,O,P,T,M,z,B,U,W,H,q=i,J=i,G=i,X=i,Z=i,Y=i,Q=i,tt=i,et=i,rt=i,nt=i,{componentContext:it}=e,{layoutParams:st}=e;const lt=f(at);let ct;j=l(lt.direction,(t=>A=t));let pt,vt=[],gt=!1,ft=!1,ht=null,yt=!1;const bt=lt.getCustomization("galleryLeftClass"),_t=lt.getCustomization("galleryRightClass");let wt,$t,xt,kt,Ct,At=1,jt="horizontal",Vt="start",Dt=8,St="",Ot=[],It={},Tt=!1,Nt={},zt=0;W=l(lt.isDesktop,(t=>U=t));const Rt=tr((function(){if(!ct)return;let t=ct.scrollLeft;"rtl"===A&&(t*=-1);const e=ct.scrollWidth,r=ct.offsetWidth;"ltr"===A?(gt=t>2,ft=t+r<e-2):(ft=t>2,gt=t+r<e-2)}),50);function Bt(){let t=[],e=vt[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<At;++e){const n=vt[e].children[r];n&&t.push(n)}return t}function Ut(t,e="smooth"){const r="horizontal"===jt?"left":"top";ct.scroll({[r]:t,behavior:e})}function Wt(t,e,r="smooth"){const n="horizontal"===jt,o=n?"offsetLeft":"offsetTop",i=t[e];if(i){let t;if("ltr"!==A&&n){const e=ct.offsetWidth;t=i[o]+i.offsetWidth+.01-Dt/2-e}else t=i[o]+.01-Dt/2;Ut(t,r)}}function Lt(t){const e=Bt(),r=ct.getBoundingClientRect(),n=e.findIndex((t=>function(t,e){return"horizontal"===jt?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}(r,t.getBoundingClientRect())));if(-1!==n)return n;const o=e.map((t=>function(t,e){return"horizontal"===jt?e.right>t.left&&t.right>e.left:e.bottom>t.top&&t.bottom>e.top}(r,t.getBoundingClientRect()))),i=o.findIndex(Boolean);return-1!==i?"prev"===t&&2===o.filter(Boolean).length?i+1:i:"prev"===t?1:e.length-2}v((()=>{yt=!1,wt&&!it.fakeElement&&(lt.unregisterInstance(wt),wt=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==it&&r.componentContext(it),void 0===e.layoutParams&&r.layoutParams&&void 0!==st&&r.layoutParams(st),o=it.origJson,o&&(At=1,jt="horizontal",Vt="start",Dt=8,St=""),a=Array.isArray(it.json.items)&&it.json.items||[],s=it.getDerivedFromVars(it.json.column_count),rt(),rt=l(s,(t=>B=t)),c=it.getDerivedFromVars(it.json.orientation),et(),et=l(c,(t=>z=t)),u=it.getDerivedFromVars(it.json.cross_content_alignment),tt(),tt=l(u,(t=>M=t)),d=it.getDerivedFromVars(it.json.item_spacing),Q(),Q=l(d,(t=>T=t)),p=it.getDerivedFromVars(it.json.cross_spacing),Y(),Y=l(p,(t=>P=t)),g=it.getDerivedFromVars(it.json.paddings),Z(),Z=l(g,(t=>O=t)),h=it.getDerivedFromVars(it.json.scroll_mode),G(),G=l(h,(t=>D=t)),m=it.getDerivedFromVars(it.json.restrict_parent_scroll),nt(),nt=l(m,(t=>H=t)),y=it.getDerivedFromVars(it.json.scrollbar),J(),J=l(y,(t=>V=t)),b=it.getDerivedFromVars(it.json.default_item),q(),q=l(b,(t=>F=t)),_=a.map(((t,e)=>it.produceChildContext(t,{path:e}))),w=U&&yt,w?"undefined"!=typeof ResizeObserver&&(ht=new ResizeObserver((()=>{Rt()})),ht.observe(pt)):ht&&(ht.disconnect(),ht=null),At=ie(B,At),$=function(t,e){let r=0,n=[];for(let o=0;o<t.length;++o)n[r]||(n[r]=[]),n[r].push(t[o]),++r>=e&&(r=0);return n}(_,At),jt=Te(z,jt),Vt=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(M,Vt),Dt=Et(T,Dt),$t=dt(Dt),kt=Et(P,Dt),xt=dt(kt),St=Pt(O,A,St),x="horizontal"===jt?"grid-template-columns":"grid-template-rows";{let t=[];_.forEach((e=>{const r="horizontal"===jt?"width":"height";t.push(it.getDerivedFromVars(e.json[r]))})),Ct=K(t,(t=>t)),X(),X=l(Ct,(t=>S=t))}Ot=[],At>1?Ot.push("auto"):S.forEach((t=>{!t&&"horizontal"===jt||"match_parent"===(null==t?void 0:t.type)?Ot.push("100%"):Ot.push("max-content")}));{const t={};let e={};Tt=!1,"horizontal"===jt?e.parentVAlign=Vt:e.parentHAlign=Vt,"paging"===D&&(Tt=!0,e.scrollSnap="start",t["horizontal"===jt?"scroll-padding-left":"scroll-padding-top"]=dt(Dt/2)),1===At&&(e.parentLayoutOrientation=jt),It=Mt(t,It),Nt=Mt(e,Nt)}return k={padding:St,"grid-gap":xt},E={"grid-gap":$t,[x]:Ke(Ot)},C={orientation:jt,"scroll-snap":Tt,scrollbar:"auto"===V?"auto":"none"},zt=Et(F,zt),it.json&&Rt(),it.json&&(wt&&(lt.unregisterInstance(wt),wt=void 0),it.json.id&&!it.fakeElement&&(wt=it.json.id,lt.registerInstance(wt,{setCurrentItem(t){const e=Bt();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Wt(e,t)},setPreviousItem(t,e){const r=Lt("prev"),n=Bt();let o=r-t;o<0&&(o="ring"===e?er(o,n.length):0),Wt(n,o)},setNextItem(t,e){const r="horizontal"===jt,n="ltr"!==A&&r?-1:1,o=r?ct.scrollLeft*n+ct.offsetWidth===ct.scrollWidth:ct.scrollTop+ct.offsetHeight===ct.scrollHeight,i=Bt();if(o&&"ring"===e)return void Wt(i,0);let a=Lt("next")+t;a>i.length-1&&(a="ring"===e?er(a,i.length):i.length-1),Wt(i,a)},scrollToStart(){Ut(0)},scrollToEnd(){Ut("ltr"===A||"horizontal"!==jt?1e6:-1e6)},scrollBackward(t,e){const r="horizontal"===jt,n="ltr"!==A&&r?-1:1,o=r?ct.scrollLeft:ct.scrollTop,i=r?ct.scrollWidth-ct.offsetWidth:ct.scrollHeight-ct.offsetHeight;let a=o*n-t;a<0&&("clamp"===e?a=0:"ring"===e&&(a=er(a,i))),Ut(a*n)},scrollForward(t,e){const r="horizontal"===jt,n="ltr"!==A&&r?-1:1,o=r?ct.scrollLeft:ct.scrollTop,i=r?ct.scrollWidth-ct.offsetWidth:ct.scrollHeight-ct.offsetHeight;let a=o*n+t;a>i&&("clamp"===e?a=i:"ring"===e&&(a=er(a,i))),Ut(a*n)},scrollToPosition(t){Ut("ltr"===A||"horizontal"!==jt?t:-t)}}))),j(),q(),J(),G(),X(),Z(),Y(),Q(),tt(),et(),rt(),W(),nt(),` ${R(ne,"Outer").$$render(t,{cls:Ft("gallery",Ge,C),componentContext:it,layoutParams:st,customPaddings:!0,customActions:"gallery",parentOf:a,replaceItems:function(t){it=Object.assign(Object.assign({},it),{json:Object.assign(Object.assign({},it.json),{items:t.filter(mt)})})}},{},{default:()=>`<div class="${I(Ge.gallery__scroller,!0)+" "+I(H?ot:"",!0)}"${L("style",ut(It),0)}${L("this",ct,0)}><div${L("class",Ge["gallery__items-grid"],0)}${L("style",ut(k),0)}${L("this",pt,0)}>${N($,((e,r)=>`<div${L("class",Ge.gallery__items,0)}${L("style",ut(E),0)}${L("this",vt[r],0)}>${N(e,(e=>`${R(bn,"Unknown").$$render(t,{componentContext:e,layoutParams:Nt},{},{})}`))} </div>`))}</div></div> ${"horizontal"===jt?`${gt&&w?` <div${L("class",bt||`${Ge.gallery__arrow} ${Xe} ${Ye}`,0)}>${bt?"":`<svg${L("class",Ze,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("class",Ge["gallery__arrow-icon-path"],0)} d="m10 16 8.3 8 1.03-1-4-6-.7-1 .7-1 4-6-1.03-1z"></path></svg>`}</div>`:""} ${ft&&w?` <div${L("class",_t||`${Ge.gallery__arrow} ${Xe} ${Qe}`,0)}>${_t?"":`<svg${L("class",Ze,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("class",Ge["gallery__arrow-icon-path"],0)} d="M22 16l-8.3 8-1.03-1 4-6 .7-1-.7-1-4-6 1.03-1 8.3 8z"></path></svg>`}</div>`:""}`:""}`})}`})),nr=rr,or={tabs:"divkit-e0df5",tabs__list:"divkit-ea19b",tabs__item:"divkit-c25c7",tabs__item_selected:"divkit-d560a",tabs__item_actionable:"divkit-dfda0",tabs__panels:"divkit-f5dc0",tabs__swiper:"divkit-eb42c",tabs__swiper_animated:"divkit-b9f18",tabs__swiper_inited:"divkit-fa574",tabs__panel:"divkit-cc9fb",tabs__panel_visible:"divkit-e7306","tabs_height-parent_yes":"divkit-ae594",tabs__separator:"divkit-b85bf"},ir=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,x,k,E,C,A,j,F,V,D,S,O,P,T,M,z,B,U=i,W=i,H=i,J=i,G=i,X=i,Z=i,Y=i,K=i;var tt,et;let{componentContext:rt}=e,{layoutParams:nt}=e;const it=f(at);S=l(it.direction,(t=>D=t));const lt=it.genId("tabs");let ct,vt=!1,ft=Q([]);j=l(ft,(t=>A=t));let ht,mt,yt,bt,_t,wt,$t,xt={},kt={},Ct=12,At="",jt="",Vt="",St="",It="",Tt="",Nt="",zt="",Rt="",Lt="",Ht=0,qt="",Gt="",Zt=null,Yt=!1,Qt=!1,Kt=[],te=[],ee=null;async function re(t,e=!1){if(wt=w,w=t,Yt||(Yt=!0,mt.style.height=dt(mt.clientHeight),yt.style.transform=`translate3d(${100*-(null!=wt?wt:w)}%,0,0)`),Qt=!0,async function(t){await $(),yt.style.transform=`translate3d(${t}%,0,0)`}(100*-w),function(t=!1){const e=t?Math.max(0,w-1):Math.min(w,null!=wt?wt:w),r=t?Math.min(a.length-1,w+1):Math.max(w,null!=wt?wt:w);Kt=Kt.map(((t,n)=>{var o;return t||(n>=e&&n<=r&&(null===(o=a[n])||void 0===o?void 0:o.div)?rt.produceChildContext(a[n].div,{path:n}):void 0)})),te=te.map(((t,n)=>n>=e&&n<=r))}(),async function(){if("match_parent"===(null==C?void 0:C.type))return;await $();const t=document.getElementById(`${lt}-panel-${w}`);t&&(mt.style.height=dt(t.offsetHeight))}(),ee&&clearTimeout(ee),ee=window.setTimeout((()=>{te=a.map(((t,e)=>e===w))}),400),$t=-w*mt.clientWidth,e){await $();const t=ht.querySelector(`.${or.tabs__item_selected}`);t&&t.focus()}}if(v((()=>{ct&&(it.unregisterInstance(ct),ct=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==rt&&r.componentContext(rt),void 0===e.layoutParams&&r.layoutParams&&void 0!==nt&&r.layoutParams(nt),o=rt.origJson,o&&(Ct=12,At="",St="",bt=void 0,It="",_t=void 0,Tt="",Nt="",zt="",Rt="",Lt="",Ht=0,qt="",Gt="",Zt=null),a=Array.isArray(rt.json.items)&&rt.json.items||[],s=a.map((t=>t.div)),c=rt.getDerivedFromVars(rt.json.width),Y(),Y=l(c,(t=>z=t)),u=rt.getDerivedFromVars(rt.json.height),U(),U=l(u,(t=>C=t)),d=rt.getJsonWithVars(rt.json.selected_tab),p=rt.getDerivedFromVars(rt.json.tab_title_style),Z(),Z=l(p,(t=>M=t)),g=rt.getDerivedFromVars(rt.json.has_separator),X(),X=l(g,(t=>T=t)),h=rt.getDerivedFromVars(rt.json.separator_color),G(),G=l(h,(t=>P=t)),m=rt.getDerivedFromVars(rt.json.separator_paddings),J(),J=l(m,(t=>O=t)),y=rt.getDerivedFromVars(rt.json.switch_tabs_by_content_swipe_enabled),H(),H=l(y,(t=>V=t)),b=rt.getDerivedFromVars(rt.json.restrict_parent_scroll),K(),K=l(b,(t=>B=t)),_=rt.getDerivedFromVars(rt.json.title_paddings),W(),W=l(_,(t=>F=t)),w=d&&Number(d)||0,Array.isArray(a)&&a.length){let t=[];a.forEach(((e,r)=>{const n=rt.getJsonWithVars({index:r,title:e.title,title_click_action:e.title_click_action});n.title&&"string"==typeof n.title?t.push(n):rt.logError(st(new Error("Incorrect title for the tab"),{additional:{index:r}}))})),ft.set(t)}else ft.set([]);(null==A?void 0:A.length)?vt=!1:(vt=!0,rt.logError(st(new Error('Incorrect or empty "items" prop for div "tabs"'))));{let t={parentContainerOrientation:"horizontal"};"wrap_content"===(null==z?void 0:z.type)&&(t.parentHorizontalWrapContent=!0),C&&"wrap_content"!==C.type||(t.parentVerticalWrapContent=!0),xt=Mt(t,xt)}if(!vt&&(w<0||w>=a.length)&&(rt.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:rt.json.selected_tab,length:a.length}})),w=w<0?0:a.length-1),vt||A.some((t=>w===t.index))||(rt.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:rt.json.selected_tab}})),w=(null===(tt=A[0])||void 0===tt?void 0:tt.index)||0),x=M||{},Ct=ie(x.font_size,Ct),x.font_size||x.paddings){const t=x.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/Ct*10,right:(Number("ltr"===D?t.end:t.start)||Number(t.right)||0)/Ct*10,bottom:(Number(t.bottom)||0)/Ct*10,left:(Number("ltr"===D?t.start:t.end)||Number(t.left)||0)/Ct*10};At=Pt(e,D,At)}{const t=x.line_height;void 0!==t&&Xt(t)&&(jt=dt(t/Ct*10))}{const t=x.letter_spacing;void 0!==t&&Ot(t)&&(Vt=dt(t/Ct*10))}if(x.corner_radius||x.corners_radius||x.font_size){const t=null!==(et=x.corner_radius)&&void 0!==et?et:1e3;x.corners_radius?St=function(t,e,r,n){const o=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<o.length;++t)if(o[t]&&!Ot(o[t]))return n;return Ut(t,e,r)}(x.corners_radius,t,Ct,St):Ot(t)&&(St=dt(t/Ct*10))}return bt=se(x.active_font_weight||x.font_weight,bt),It=x.font_family&&"string"==typeof x.font_family?it.typefaceProvider(x.font_family,{fontWeight:bt||400}):"",_t=se(x.inactive_font_weight||x.font_weight,_t),Tt=x.font_family&&"string"==typeof x.font_family?it.typefaceProvider(x.font_family,{fontWeight:_t||400}):"",Nt=gt(x.active_text_color,1,Nt),zt=gt(x.inactive_text_color,1,zt),Rt=gt(x.active_background_color,1,Rt),Lt=gt(x.inactive_background_color,1,Lt),Ht=Et(x.item_spacing,Ht),T&&(P&&(qt=gt(P,1,qt)),O&&(Gt=Pt(O,D,Gt))),k={background:qt,margin:Gt},E=void 0===V||Boolean(V),Zt=Bt(F||void 0,Zt),function(t){vt||(Kt=t.map(((t,e)=>{if(e===w&&(null==t?void 0:t.div))return rt.produceChildContext(t.div,{path:e})})),te=t.map(((t,e)=>e===w)))}(a),rt.json&&(ct&&(it.unregisterInstance(ct),ct=void 0),!rt.json.id||vt||rt.fakeElement||(ct=rt.json.id,it.registerInstance(ct,{setCurrentItem(t){if(t<0||t>a.length-1)throw new Error('Item is out of range in "set-current-item" action');re(t)},setPreviousItem(t,e){let r=w-t;r<0&&(r="ring"===e?er(r,a.length):0),re(r)},setNextItem(t,e){let r=w+t;r>a.length-1&&(r="ring"===e?er(r,a.length):a.length-1),re(r)},scrollToStart(){re(0)},scrollToEnd(){re(a.length-1)}}))),kt={"height-parent":"match_parent"===(null==C?void 0:C.type)?"yes":""},U(),j(),W(),H(),S(),J(),G(),X(),Z(),Y(),K(),vt?"":`${R(ne,"Outer").$$render(t,{cls:Ft("tabs",or,kt),componentContext:rt,layoutParams:nt,customActions:"tabs",parentOf:s,parentOfSimpleMode:!0,replaceItems:function(t){rt.json.items&&(rt=Object.assign(Object.assign({},rt),{json:Object.assign(Object.assign({},rt.json),{items:rt.json.items.map(((e,r)=>Object.assign(Object.assign({},e),{div:t[r]})))})}))}},{},{default:()=>` <div class="${I(or.tabs__list,!0)+" "+I(B?ot:"",!0)}" role="tablist"${q({"--divkit-tabs-title-padding":Zt?Dt(Zt,D):"","--divkit-tabs-font-size":dt(Ct),"--divkit-tabs-paddings":At,"--divkit-tabs-line-height":jt,"--divkit-tabs-letter-spacing":Vt,"--divkit-tabs-active-font-weight":bt||"","--divkit-tabs-inactive-font-weight":_t||"","--divkit-tabs-active-font-family":It||"","--divkit-tabs-inactive-font-family":Tt||"","--divkit-tabs-active-text-color":Nt,"--divkit-tabs-inactive-text-color":zt,"--divkit-tabs-active-background-color":Rt,"--divkit-tabs-inactive-background-color":Lt,"--divkit-tabs-border-radius":St,"--divkit-tabs-items-spacing":Ht?pt(10*Ht/Ct):""})}${L("this",ht,0)}>${N(A,(e=>{let r=e.index,n=r===w;return` ${R(Jt,"Actionable").$$render(t,{componentContext:rt,cls:Ft("tabs__item",or,{selected:n,actionable:Boolean(e.title_click_action)}),actions:e.title_click_action&&!rt.fakeElement?[e.title_click_action].filter(Wt):[],attrs:{id:`${lt}-tab-${r}`,"aria-controls":`${lt}-panel-${r}`,role:"tab",tabindex:n&&!rt.fakeElement?e.title_click_action?void 0:"0":"-1","aria-selected":n?"true":"false"},customAction:rt.fakeElement?null:t=>function(t,e){return w===e||(re(e),!1)}(0,r)},{},{default:()=>`${I(e.title)}`})}`}))}</div> ${T?`<div${L("class",or.tabs__separator,0)}${L("style",ut(k),0)}></div>`:""} <div class="${I(or.tabs__panels,!0)+" "+I(B?ot:"",!0)}"${L("this",mt,0)}><div${L("class",Ft("tabs__swiper",or,{inited:Yt,animated:Qt}),0)}${L("this",yt,0)}>${N(A,(e=>{let r=e.index,n=Kt[r];return` <div${L("class",Ft("tabs__panel",or,{visible:te[r]}),0)} role="tabpanel" id="${I(lt,!0)+"-panel-"+I(r,!0)}" aria-labelledby="${I(lt,!0)+"-tab-"+I(r,!0)}" style="${"left: "+I(100*r,!0)+"%"}">${n?`${R(bn,"Unknown").$$render(t,{componentContext:n,layoutParams:xt},{},{})}`:""} </div>`}))}</div></div>`})}`})),ar=ir,sr="divkit-eb860",lr="divkit-e08c6";function cr(t){return e=>{if(e<=0)return 0;if(e>=1)return 1;const r=e*t.length,n=Math.floor(r),o=r-n;return t[n]*o+t[n+1]*(1-o)}}cr([.0021,.0045,.0071,.01,.0131,.0165,.0202,.0242,.0284,.033,.0378,.0429,.0483,.054,.0601,.0664,.0731,.08,.0872,.0948,.1026,.1108,.1192,.1279,.1369,.1461,.1556,.1653,.1753,.1855,.1958,.2064,.2171,.2279,.2389,.25,.2612,.2725,.2839,.2952,.3067,.3181,.3295,.341,.3524,.3637,.375,.3863,.3974,.4085,.4195,.4304,.4412,.4519,.4624,.4729,.4832,.4934,.5034,.5133,.5231,.5327,.5422,.5516,.5608,.5699,.5788,.5876,.5963,.6048,.6132,.6214,.6295,.6375,.6453,.653,.6606,.668,.6754,.6825,.6896,.6965,.7034,.7101,.7166,.7231,.7295,.7357,.7418,.7479,.7538,.7596,.7653,.7709,.7764,.7818,.7871,.7923,.7974,.8024,.8073,.8122,.8169,.8216,.8261,.8306,.835,.8394,.8436,.8478,.8518,.8558,.8598,.8636,.8674,.8711,.8747,.8783,.8818,.8852,.8886,.8919,.8951,.8983,.9014,.9044,.9074,.9103,.9131,.9159,.9187,.9213,.924,.9265,.929,.9315,.9339,.9362,.9385,.9408,.943,.9451,.9472,.9492,.9512,.9532,.9551,.9569,.9587,.9605,.9622,.9638,.9655,.967,.9686,.9701,.9715,.9729,.9743,.9756,.9769,.9782,.9794,.9805,.9817,.9828,.9838,.9848,.9858,.9868,.9877,.9886,.9894,.9902,.991,.9917,.9924,.9931,.9937,.9943,.9949,.9954,.9959,.9964,.9969,.9973,.9977,.998,.9983,.9986,.9989,.9991,.9993,.9995,.9997,.9998,.9999,.9999,1,1]),cr([5e-4,.002,.0045,.0078,.0119,.0168,.0224,.0286,.0355,.0429,.0508,.0592,.0681,.0774,.087,.0969,.1072,.1177,.1285,.1395,.1507,.1621,.1736,.1853,.197,.2089,.2208,.2328,.2448,.2569,.2689,.281,.293,.305,.317,.3289,.3408,.3526,.3644,.376,.3876,.3991,.4105,.4218,.433,.444,.455,.4658,.4765,.4871,.4975,.5078,.518,.528,.5379,.5477,.5573,.5668,.5761,.5853,.5944,.6033,.612,.6206,.6291,.6374,.6456,.6537,.6616,.6693,.677,.6845,.6918,.699,.7061,.713,.7199,.7265,.7331,.7395,.7458,.752,.758,.764,.7698,.7755,.781,.7865,.7918,.7971,.8022,.8072,.8121,.8169,.8216,.8262,.8307,.8351,.8394,.8436,.8477,.8517,.8557,.8595,.8633,.8669,.8705,.874,.8775,.8808,.8841,.8873,.8904,.8934,.8964,.8993,.9022,.9049,.9076,.9103,.9129,.9154,.9178,.9202,.9226,.9249,.9271,.9293,.9314,.9335,.9355,.9375,.9394,.9413,.9431,.9449,.9466,.9483,.95,.9516,.9532,.9547,.9562,.9576,.9591,.9605,.9618,.9631,.9644,.9657,.9669,.9681,.9692,.9703,.9714,.9725,.9736,.9746,.9756,.9765,.9775,.9784,.9793,.9802,.981,.9818,.9826,.9834,.9842,.9849,.9856,.9863,.987,.9877,.9883,.989,.9896,.9902,.9908,.9913,.9919,.9924,.993,.9935,.994,.9944,.9949,.9954,.9958,.9963,.9967,.9971,.9975,.9979,.9983,.9986,.999,.9993,.9997,1]);const ur=W(((t,e,r,n)=>{let o,i,a,s,l,c,u,{componentContext:d}=e,{layoutParams:p}=e;const h=f(at),m=f(Vt);let y,b,_,w,x=!1,k=new Map,E=new Set,C=null,A=[],j=[],F=[],V=[],D=!1;function S(t){w=(null==t?void 0:t.div)?d.produceChildContext(t.div,{path:t.state_id||"<unknown>"}):void 0}async function O(t){if(_===t)return;h.setRunning("stateChange",!0);new Set(E);A.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),A=[];V.forEach((t=>{k.set(t.id,t.node.getBoundingClientRect())})),j=[],F=[],V=[];const e=c.find((e=>e.state_id===t))||null;return e?(_=t,null==s||s.setValue(_),S(e)):d.logError(st(new Error("Cannot find state with id"),{additional:{stateId:t}})),void await $()}return g(Vt,{registerInstance(t,e){C||(C=new Map),C.has(t)?d.logError(st(new Error("Duplicate state with id"),{additional:{id:t}})):C.set(t,e)},unregisterInstance(t){null==C||C.delete(t)},runVisibilityTransition:(t,e,r,n,o)=>Promise.resolve(),registerChildWithTransitionIn(t,e,r,n){const o={json:t,parentComponentContext:e,transitions:r,node:n};return j.push(o),new Promise((t=>{o.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,n){const o={json:t,parentComponentContext:e,transitions:r,node:n};return F.push(o),new Promise((t=>{o.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,n){const o=t.id;if(!o)return Promise.resolve();const i={id:o,json:t,parentComponentContext:e,transitions:r,node:n};return V.push(i),new Promise((t=>{i.resolvePromise=t}))},hasTransitionChange:t=>!!t&&k.has(t),registerChild(t){E.add(t)},unregisterChild(t){E.delete(t)}}),v((()=>{b&&m.unregisterInstance(b)})),void 0===e.componentContext&&r.componentContext&&void 0!==d&&r.componentContext(d),void 0===e.layoutParams&&r.layoutParams&&void 0!==p&&r.layoutParams(p),o=d.json.div_id||d.json.id,i=d.getJsonWithVars(d.json.default_state_id),a=d.json.state_id_variable,s=a?d.getVariable(a,"string"):null,l=d.origJson,l&&(D=!1),o?x=!1:(x=!0,d.logError(st(new Error('Missing "id" prop for div "state"')))),d.json&&(E=new Set),c=Array.isArray(d.json.states)&&d.json.states||[],u=c.map((t=>t.div)),(null==c?void 0:c.length)?x=!1:(x=!0,d.logError(st(new Error('Empty "states" prop for div "state"')))),d.json&&(b&&(m.unregisterInstance(b),b=void 0),o&&!(null==d?void 0:d.fakeElement)&&(b=o,m.registerInstance(o,{setState:O,getChild:function(t){if(C&&C.has(t))return C.get(t);d.logError(st(new Error("Missing state block with id"),{additional:{id:t}}))}}))),!D&&function(t){if(!D&&(D=!0,t.length)){const e=(null==s?void 0:s.getValue())||i;if(e){_=e;const r=t.find((t=>t.state_id===_))||null;S(r),r||d.logError(st(new Error("Cannot find state for default_state_id"),{additional:{selectedId:_}}))}else{const e=t[0];_=e.state_id,S(e)}s&&(s.setValue(_),s.subscribe((t=>{O(t)})))}}(c),x?"":`${R(ne,"Outer").$$render(t,{cls:"divkit-b8efc",componentContext:d,layoutParams:p,parentOf:u,parentOfSimpleMode:!0,replaceItems:function(t){const e=d.json.states;e&&(c=e.map(((e,r)=>Object.assign(Object.assign({},e),{div:t[r]}))),d.json=Object.assign(Object.assign({},d.json),{states:c}),_&&S(c.find((t=>t.state_id===_))||null))}},{},{default:()=>`${w?`${R(bn,"Unknown").$$render(t,{componentContext:w},{},{})}`:""} <div${L("class","divkit-adaae",0)} aria-hidden="true"${L("this",y,0)}>${N(A,(e=>"direction"in e?`<div${L("class",sr,0)}${q({left:`${e.offsetLeft}px`,top:`${e.offsetTop}px`,width:`${e.width}px`,height:`${e.height}px`})}><div${L("class",lr,0)}>${R(bn,"Unknown").$$render(t,{componentContext:e.componentContextCopy},{},{})}</div> </div>`:`<div${L("class",sr,0)}><div${L("class",lr,0)}>${R(bn,"Unknown").$$render(t,{componentContext:e.componentContextCopy},{},{})}</div> </div>`))}</div>`})}`})),dr=ur,pr={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f",pager__arrow:"divkit-d78c2","pager__arrow-icon-path":"divkit-a94d9"},vr=W(((t,e,r,n)=>{let o,a,s,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,j,F,V,D,S,O,P=i,T=i,M=i,z=i,B=i,U=i;var W,H,q,J,G,X,Z,Y,Q,K;let{componentContext:tt}=e,{layoutParams:et}=e;const rt=f(at);C=l(rt.direction,(t=>E=t));const nt=rt.genId("pager"),it=rt.getCustomization("pagerLeftClass"),lt=rt.getCustomization("pagerRightClass");j=l(rt.isDesktop,(t=>A=t)),tr((function(){if(!gt)return;const t=function(){const t=Array.from(vt.children),e=vt.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,n=t.getBoundingClientRect(),"horizontal"===bt?n.left>=r.left&&n.right<=r.right:n.top>=r.top&&n.bottom<=r.bottom;var r,n}));return-1!==r?r:ft}();t!==ft&&(ft=t)}),50);let ct,vt,gt=!1,ft=0,ht=0,yt=!1,bt="horizontal",_t="",wt="",$t="";function xt(t,e="smooth"){const r="horizontal"===bt,n=vt.children[t],o=r?"offsetLeft":"offsetTop",i=r?"left":"top";vt.scroll({[i]:n[o],behavior:e}),ft=t}v((()=>{gt=!1,ct&&(rt.unregisterInstance(ct),ct=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==tt&&r.componentContext(tt),void 0===e.layoutParams&&r.layoutParams&&void 0!==et&&r.layoutParams(et),o=tt.origJson,o&&(wt=""),a=tt.getDerivedFromVars(tt.json.layout_mode),T(),T=l(a,(t=>F=t)),s=tt.getDerivedFromVars(tt.json.orientation),B(),B=l(s,(t=>S=t)),u=tt.getDerivedFromVars(tt.json.item_spacing),z(),z=l(u,(t=>D=t)),d=tt.getDerivedFromVars(tt.json.paddings),M(),M=l(d,(t=>V=t)),p=tt.getDerivedFromVars(tt.json.restrict_parent_scroll),U(),U=l(p,(t=>O=t)),g=(Array.isArray(tt.json.items)&&tt.json.items||[]).map(((t,e)=>tt.produceChildContext(t,{path:e}))),F?"percentage"!==F.type&&"fixed"!==F.type?(yt=!0,tt.logError(st(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):yt=!1:(yt=!0,tt.logError(st(new Error('Empty "layout_mode" prop for div "pager"')))),bt=Te(S,bt);{const t=null==D?void 0:D.value;t&&Ot(t)&&(_t=dt(t||0))}if(wt=Pt(V,E,wt),h="horizontal"===bt?"grid-auto-columns":"grid-auto-rows","fixed"===(null==F?void 0:F.type)){const t=pt("horizontal"===bt?(("ltr"===E?null===(W=tt.json.paddings)||void 0===W?void 0:W.start:null===(H=tt.json.paddings)||void 0===H?void 0:H.end)||(null===(q=tt.json.paddings)||void 0===q?void 0:q.left)||0)+(("ltr"===E?null===(J=tt.json.paddings)||void 0===J?void 0:J.end:null===(G=tt.json.paddings)||void 0===G?void 0:G.start)||(null===(X=tt.json.paddings)||void 0===X?void 0:X.right)||0):((null===(Z=tt.json.paddings)||void 0===Z?void 0:Z.top)||0)+((null===(Y=tt.json.paddings)||void 0===Y?void 0:Y.bottom)||0)),e=null===(Q=F.neighbour_page_width)||void 0===Q?void 0:Q.value;$t=e?`calc(100% + ${t} - 2 * ${pt(e)} - 2 * ${_t})`:"100%"}else if("percentage"===(null==F?void 0:F.type)){const t=null===(K=F.page_width)||void 0===K?void 0:K.value;$t=`${Number(t)}%`}return m={"grid-gap":_t,padding:wt,[h]:$t},y={orientation:bt},b=yt,_=A&&gt&&!b,w="ltr"===E?ft>0:ft+1<g.length,$="ltr"===E?ft+1<g.length:ft>0,x=rt.getStore("pagers"),P(),P=l(x,(t=>k=t)),function(t,e){const r=tt.json.id;if(r){const n=new Map(k);c(x,k=n.set(r,{instId:nt,size:t,currentItem:e,scrollToPagerItem:xt}),k)}}(g.length,ft),function(t){var e;if(t===ht)return;ht=t;const r=tt.getJsonWithVars(null===(e=g[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&tt.execAnyActions(r)}(ft),tt.json&&(ct&&(rt.unregisterInstance(ct),ct=void 0),tt.json.id&&!tt.fakeElement&&(ct=tt.json.id,rt.registerInstance(ct,{setCurrentItem(t){if(t<0||t>g.length-1)throw new Error('Item is out of range in "set-current-item" action');xt(t)},setPreviousItem:function(t,e){let r=ft-t;r<0&&(r="ring"===e?er(r,g.length):0),xt(r)},setNextItem:function(t,e){let r=ft+t;r>g.length-1&&(r="ring"===e?er(r,g.length):g.length-1),xt(r)},scrollToStart(){xt(0)},scrollToEnd(){xt(g.length-1)}}))),P(),C(),j(),T(),M(),z(),B(),U(),b?"":`${R(ne,"Outer").$$render(t,{cls:Ft("pager",pr,y),componentContext:tt,layoutParams:et,customPaddings:!0,parentOf:g.map((t=>t.json)),replaceItems:function(t){tt=Object.assign(Object.assign({},tt),{json:Object.assign(Object.assign({},tt.json),{items:t.filter(mt)})})}},{},{default:()=>`<div class="${I(pr.pager__items,!0)+" "+I(O?ot:"",!0)}"${L("style",ut(m),0)}${L("this",vt,0)}>${N(g,(e=>`<div${L("class",pr.pager__item,0)}>${R(bn,"Unknown").$$render(t,{componentContext:e},{},{})} </div>`))}</div> ${w&&_?` <div${L("class",it||`${pr.pager__arrow} ${Xe} ${Ye}`,0)}>${it?"":`<svg${L("class",Ze,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("class",pr["pager__arrow-icon-path"],0)} d="m10 16 8.3 8 1.03-1-4-6-.7-1 .7-1 4-6-1.03-1z"></path></svg>`}</div>`:""} ${$&&_?` <div${L("class",lt||`${pr.pager__arrow} ${Xe} ${Qe}`,0)}>${lt?"":`<svg${L("class",Ze,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("class",pr["pager__arrow-icon-path"],0)} d="M22 16l-8.3 8-1.03-1 4-6 .7-1-.7-1-4-6 1.03-1 8.3 8z"></path></svg>`}</div>`:""}`})}`})),gr=vr,fr={indicator:"divkit-d8e3f",indicator__scroller:"divkit-b5db0",indicator__items:"divkit-d5d94",indicator__item:"divkit-f6629",indicator_placement_default:"divkit-c1670",indicator__item_active:"divkit-b39cd",indicator_direction_ltr:"divkit-a7473",indicator_direction_rtl:"divkit-a7d63",indicator_placement_stretch:"divkit-b6bd3"},hr=["rounded_rectangle","circle"],mr=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,v,g,h,m,y,b,_,w,x,k,E,C,A,j,F,V=i,D=i,S=i,O=i,P=i,T=i,M=i,z=i,B=i;var U,W;let{componentContext:H}=e,{layoutParams:J}=e;const G=f(at);b=l(G.direction,(t=>y=t));let X,Z,Y,Q={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},K={width:10,height:10,borderRadius:5,background:"#33919cb5"},et="default",rt=15,nt=10,ot=5;if(void 0===e.componentContext&&r.componentContext&&void 0!==H&&r.componentContext(H),void 0===e.layoutParams&&r.layoutParams&&void 0!==J&&r.layoutParams(J),o=H.origJson,o&&(et="default",rt=15,nt=10,ot=5,Q={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},K={width:10,height:10,borderRadius:5,background:"#33919cb5"}),a=H.getDerivedFromVars(H.json.shape),T(),T=l(a,(t=>C=t)),s=H.getDerivedFromVars(H.json.active_item_color),O(),O=l(s,(t=>k=t)),c=H.getDerivedFromVars(H.json.inactive_item_color),P(),P=l(c,(t=>E=t)),u=H.getDerivedFromVars(H.json.active_item_size),M(),M=l(u,(t=>A=t)),d=H.getDerivedFromVars(H.json.active_shape),B(),B=l(d,(t=>F=t)),p=H.getDerivedFromVars(H.json.inactive_shape),z(),z=l(p,(t=>j=t)),v=H.getDerivedFromVars(H.json.space_between_centers),D(),D=l(v,(t=>w=t)),g=H.getDerivedFromVars(H.json.items_placement),S(),S=l(g,(t=>x=t)),F&&(Q=$e({type:"shape_drawable",shape:F},hr,Q)),j&&(K=$e({type:"shape_drawable",shape:j},hr,K)),!F&&!j&&C){const t=ie(A,1.3);K=$e({type:"shape_drawable",shape:C,color:K.background},hr,K),K.background=gt(E,1,K.background),Q=Object.assign(Object.assign({},K),{width:K.width*t,height:K.height*t,borderRadius:K.borderRadius*t,background:Q.background}),Q.background=gt(k,1,Q.background)}if(!x||"default"!==x.type&&"stretch"!==x.type)et="default",w&&(rt=Et(w.value,rt));else if(et=x.type,"default"===et)rt=Et(null===(U=x.space_between_centers)||void 0===U?void 0:U.value,rt);else if("stretch"===et){const t=x;nt=ie(t.max_visible_items,nt),ot=Et(null===(W=t.item_spacing)||void 0===W?void 0:W.value,ot)}return h=G.getStore("pagers"),V(),V=l(h,(t=>_=t)),async function(t){if(H.json.pager_id&&t.has(H.json.pager_id)&&(Y=t.get(H.json.pager_id),await $(),Z)){const t=Z.children[Y.currentItem];if(t){const e=t.offsetLeft;X.scroll({left:e-X.clientWidth/2,behavior:"smooth"})}}}(_),m={placement:et,direction:y},b(),V(),D(),S(),O(),P(),T(),M(),z(),B(),`${R(ne,"Outer").$$render(t,{cls:Ft("indicator",fr,m),componentContext:H,layoutParams:J},{},{default:()=>`<div${L("class",fr.indicator__scroller,0)}${L("this",X,0)}><div${L("class",fr.indicator__items,0)} role="tablist"${q({margin:"default"===et?`0 ${dt(Math.max(0,Q.width-K.width)/2)}`:"","--divkit-indicator-inactive-width":dt(K.width),"--divkit-indicator-inactive-height":dt(K.height),"--divkit-indicator-inactive-border-radius":dt(K.borderRadius),"--divkit-indicator-inactive-background":K.background||"","--divkit-indicator-inactive-box-shadow":K.boxShadow||"","--divkit-indicator-active-width":dt(Q.width),"--divkit-indicator-active-height":dt(Q.height),"--divkit-indicator-active-border-radius":dt(Q.borderRadius),"--divkit-indicator-active-background":Q.background||"","--divkit-indicator-active-box-shadow":Q.boxShadow||"","--divkit-indicator-active-scale":Q.width/K.width,"--divkit-indicator-default-margin":"default"===et?`0 ${dt((rt-K.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===et?dt(ot):"","--divkit-indicator-stretch-max-count":"stretch"===et?nt:"","--divkit-indicator-stretch-max-spacer":"stretch"===et?dt((nt-1)*ot):""})}${L("this",Z,0)}>${Y?`${N(Array(Y.size),((t,e)=>{let r=e===Y.currentItem;return` <div class="${I(Ft("indicator__item",fr,{active:r}),!0)+" "+I(tt,!0)}" role="tab" id="${I(Y.instId,!0)+"-tab-"+I(e,!0)}" aria-controls="${I(Y.instId,!0)+"-panel-"+I(e,!0)}"${L("aria-selected",r?"true":"false",0)}${L("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),yr=mr,br={slider:"divkit-ef4f7",slider__input:"divkit-d1d65",slider__input_secondary:"divkit-c7980",slider__thumb:"divkit-f3453",slider_direction_rtl:"divkit-fb7b5",slider__thumb_secondary:"divkit-e1984","slider__tracks-wrapper":"divkit-f7338","slider__tracks-inner":"divkit-ac903",slider__track:"divkit-e956c","slider__active-track":"divkit-ec5bf","slider__thumb-text":"divkit-c4af5","slider__thumb-text_secondary":"divkit-d8821",slider__tick:"divkit-bd9bf",slider__tick_active:"divkit-d8ce2",slider__tick_inactive:"divkit-e71e7"};function _r(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&gt(t.text_color)||"#000",o=ae(t.font_weight);if(Xt(t.font_size)&&"transparent"!==n){var i,a;const e={fontSize:dt(t.font_size),fontWeight:o,textColor:n};return"number"==typeof(null==r||null===(i=r.x)||void 0===i?void 0:i.value)&&"number"==typeof(null==r||null===(a=r.y)||void 0===a?void 0:a.value)&&(e.offset={x:r.x.value,y:r.y.value}),e}}function wr(t,e,r){return Math.max(e,Math.min(r,Number(t)))}const $r="function"==typeof BigInt;function xr(t){return $r?BigInt(t):Number(t)}const kr=xr("9223372036854775807"),Er=xr("-9223372036854775808");function Cr(t){const e=xr(t);if(e>kr||e<Er)throw new Error("Integer overflow.");if("number"==typeof e&&(Number.isNaN(e)||e!==Math.round(e)))throw new Error("Incorrect integer value.");return e}const Ar=Cr(0);function jr(t){let e=t;return e<0&&(e=-e),e}function Fr(t){let e=0;return t>0?e=1:t<0&&(e=-1),Cr(e)}class Vr{constructor(t,e){const r=this.convertValue(e);this.name=t,this.value=r}getName(){return this.name}subscribe(t){return this.store||(this.store=Q(this.value)),this.store.subscribe(t)}set(t){const e=this.fromString(t);this.setValue(e)}setValue(t){const e=this.convertValue(t);this.value=e,this.store&&this.store.set(e)}getValue(){return this.value}}class Dr extends Vr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}}class Sr extends Vr{convertValue(t){if("bigint"!=typeof t&&"number"!=typeof t)throw new Error("Incorrect variable value");try{return Cr(t)}catch(t){throw new Error("Incorrect variable value")}}fromString(t){try{return Cr(t)}catch(t){throw new Error("Incorrect variable value")}}getType(){return"integer"}}class Or extends Vr{convertValue(t){if("number"!=typeof t||Number.isNaN(t)||!isFinite(t))throw new Error("Incorrect variable value");return t}fromString(t){const e=Number(t);return this.convertValue(e)}getType(){return"number"}}class Pr extends Vr{convertValue(t){if(1!==t&&0!==t&&!0!==t&&!1!==t)throw new Error("Incorrect variable value");return Number(t)}fromString(t){if("1"===t||"true"===t)return 1;if("0"===t||"false"===t)return 0;throw new Error("Incorrect variable value")}getType(){return"boolean"}}class Ir extends Vr{convertValue(t){if("string"!=typeof t||!ft(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}}class Tr extends Vr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}class Mr extends Vr{convertValue(t){if("object"!=typeof t||!t)throw new Error("Incorrect variable value");return t}fromString(t){throw new Error("Dict variable does not support setter from string")}getType(){return"dict"}}class Nr extends Vr{convertValue(t){if(!Array.isArray(t))throw new Error("Incorrect variable value");return t}fromString(t){throw new Error("Array variable does not support setter from string")}getType(){return"array"}}const zr={string:Dr,number:Or,integer:Sr,boolean:Pr,color:Ir,url:Tr,dict:Mr,array:Nr};function Rr(t,e,r){if(!(e in zr))throw new Error("Unsupported variable type");return new zr[e](t,r)}function Br(){}function Ur(t){return t(this.value),Br}function Wr(){throw new Error("Cannot change the value of this type of variable")}const Lr={string:class extends Dr{},number:class extends Or{},integer:class extends Sr{},boolean:class extends Pr{},color:class extends Ir{},url:class extends Tr{},dict:class extends Mr{},array:class extends Nr{}};for(const t in Lr){const e=Lr[t];e.prototype.subscribe=Ur,e.prototype.set=Wr,e.prototype.setValue=Wr}const Hr={width:10,height:10,borderRadius:5,background:"#000"},qr=["rounded_rectangle","circle"],Jr=["rounded_rectangle"];function Gr(t,e,r,n,o){let i=[];if(o)for(let o=t;o<e;++o)i.push((o-r)/(n-r));else{for(let e=r;e<t;++e)i.push((e-r)/(n-r));for(let t=e;t<n+1;++t)i.push((t-r)/(n-r))}return i}const Xr=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,j,F,V,D,S,O,P,T,M,z,B,U,W,H,J,G,X,Z,Y,Q,K,tt=i,et=i,rt=i,nt=i,ot=i,it=i,lt=i,ct=i,ut=i,vt=i,gt=i,ft=i,ht=i,mt=i;var yt,bt,_t,wt;let{componentContext:$t}=e,{layoutParams:xt}=e;const kt=f(at),Et=f(qt);let Ct;P=l(kt.direction,(t=>O=t));let At,jt,Vt,Dt=0,St=100,Pt=Hr,It=Pt,Tt=Hr,Mt=Hr,Nt=null,Rt=null,Bt=Vt,Ut="",Wt="",Lt=!1,Ht=wr(Y||0,Dt,St),Jt=wr(Z||0,Dt,St);tr((function(){}),50),v((()=>{Ct&&(kt.unregisterFocusable(Ct),Ct=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==$t&&r.componentContext($t),void 0===e.layoutParams&&r.layoutParams&&void 0!==xt&&r.layoutParams(xt),o=$t.origJson,o&&(Pt=Hr,It=Pt,Tt=Hr,Mt=Hr,Nt=null,Rt=null,Vt=void 0,Bt=void 0,Ut="",Wt=""),a=$t.json.thumb_value_variable,s=$t.json.thumb_secondary_value_variable,c=a&&$t.getVariable(a,"integer")||Rr("temp","integer",0),ft(),ft=l(c,(t=>Y=t)),u=s&&$t.getVariable(s,"integer")||Rr("temp","integer",0),gt(),gt=l(u,(t=>Z=t)),d=$t.getDerivedFromVars($t.json.min_value),mt(),mt=l(d,(t=>K=t)),p=$t.getDerivedFromVars($t.json.max_value),ht(),ht=l(p,(t=>Q=t)),g=$t.getDerivedFromVars($t.json.thumb_style),vt(),vt=l(g,(t=>X=t)),h=$t.getDerivedFromVars($t.json.thumb_secondary_style),ut(),ut=l(h,(t=>G=t)),m=$t.getDerivedFromVars($t.json.track_inactive_style),ct(),ct=l(m,(t=>J=t)),y=$t.getDerivedFromVars($t.json.track_active_style),lt(),lt=l(y,(t=>H=t)),b=$t.getDerivedFromVars($t.json.tick_mark_active_style),it(),it=l(b,(t=>W=t)),_=$t.getDerivedFromVars($t.json.tick_mark_inactive_style),ot(),ot=l(_,(t=>U=t)),w=$t.getDerivedFromVars($t.json.thumb_text_style),nt(),nt=l(w,(t=>B=t)),$=$t.getDerivedFromVars($t.json.thumb_secondary_text_style),rt(),rt=l($,(t=>z=t)),x=$t.getDerivedFromVars($t.json.accessibility),et(),et=l(x,(t=>M=t)),k=$t.getDerivedFromVars($t.json.secondary_value_accessibility),tt(),tt=l(k,(t=>T=t)),Dt=zt(K,Dt),St=zt(Q,St);{const t=wr(Y||0,Dt,St);t!==Ht&&(Ht=t)}{const t=wr(Z||0,Dt,St);t!==Jt&&(Jt=t)}Pt=$e(X,qr,Pt),It=$e(G,qr,Pt),Tt=$e(J,Jr,Tt),Mt=$e(H,Jr,Mt);{let t=$e(W,qr,Hr);t!==Hr&&(Nt=t)}At=Nt?s?Gr(Math.min(Ht,Jt),Math.max(Ht,Jt)+1,Dt,St,!0):Gr(Dt,Ht,Dt,St,!0):[];{let t=$e(U,qr,Hr);t!==Hr&&(Rt=t)}jt=Rt?s?Gr(Math.min(Ht,Jt),Math.max(Ht,Jt)+1,Dt,St,!1):Gr(Ht+1,St+1,Dt,St,!0):[],Vt=_r(B,Vt),Bt=_r(z,Vt),(null==M?void 0:M.description)?Ut=M.description:$t.logError(st(new Error('Missing accessibility "description" for slider'),{level:"warn"})),(null==T?void 0:T.description)?Wt=T.description:s&&$t.logError(st(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;Et.hasAction()?($t.logError(st(new Error('Cannot show "slider" inside component with action'))),t=!0):Pt===Hr?($t.logError(st(new Error('Missing "thumb_style" in slider'))),t=!0):Mt===Hr?($t.logError(st(new Error('Missing "track_active_style" in slider'))),t=!0):Tt===Hr&&($t.logError(st(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==Lt&&(Lt=t)}return E=dt(Math.max(...[Pt.width,It.width,0].filter(Ot))),C=dt(Math.max(...[Pt.height,It.height,0].filter(Ot))),A=(Ht-Dt)/(St-Dt),j=s?(Jt-Dt)/(St-Dt):void 0,F=void 0!==j?Math.abs(j-A):A,V=void 0!==j?Math.min(j,A):0,D={"--divkit-slider-thumb-width":dt(Pt.width),"--divkit-slider-thumb-height":dt(Pt.height),"--divkit-slider-thumb-secondary-width":dt(It.width),"--divkit-slider-thumb-secondary-height":dt(It.height),"--divkit-slider-text-offset-x":(null===(yt=null==Vt?void 0:Vt.offset)||void 0===yt?void 0:yt.x)?pt(Vt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(bt=null==Vt?void 0:Vt.offset)||void 0===bt?void 0:bt.y)?pt(Vt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(_t=null==Bt?void 0:Bt.offset)||void 0===_t?void 0:_t.x)?pt(Bt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(wt=null==Bt?void 0:Bt.offset)||void 0===wt?void 0:wt.y)?pt(Bt.offset.y):void 0,"--divkit-slider-tick-active-width":Nt?dt(Nt.width):void 0,"--divkit-slider-tick-active-height":Nt?dt(Nt.height):void 0,"--divkit-slider-tick-active-border-radius":Nt?dt(Nt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Nt?void 0:Nt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Nt?void 0:Nt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Rt?dt(Rt.width):void 0,"--divkit-slider-tick-inactive-height":Rt?dt(Rt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Rt?dt(Rt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Rt?void 0:Rt.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Rt?void 0:Rt.boxShadow)||void 0,"--divkit-slider-max-thumb-width":E,"--divkit-slider-max-thumb-height":C,"--divkit-slider-track-part":A,"--divkit-slider-track-secondary-part":j},S={direction:O},$t.json,P(),tt(),et(),rt(),nt(),ot(),it(),lt(),ct(),ut(),vt(),gt(),ft(),ht(),mt()," "+(Lt?"":`${R(ne,"Outer").$$render(t,{cls:Ft("slider",br,S),style:D,customDescription:!0,customActions:"slider",hasInnerFocusable:!0,componentContext:$t,layoutParams:xt},{},{default:({focusHandler:t,blurHandler:e})=>{var r,n,o,i,a,l;return`<div${L("class",br["slider__tracks-wrapper"],0)}><div${L("class",br["slider__tracks-inner"],0)}${L("this",undefined,0)}><div${L("class",br.slider__track,0)}${q({height:dt(Tt.height),"border-radius":dt(Tt.borderRadius),background:Tt.background,"box-shadow":Tt.boxShadow||""})}></div> <div${L("class",br["slider__active-track"],0)}${q({left:"ltr"===O?(100*V).toFixed(2)+"%":void 0,right:"ltr"===O?void 0:(100*V).toFixed(2)+"%",width:(100*F).toFixed(2)+"%",height:dt(Mt.height),"border-radius":dt(Mt.borderRadius),background:Mt.background,"box-shadow":Mt.boxShadow||""})}></div> ${N(At,(t=>`<div class="${I(br.slider__tick,!0)+" "+I(br.slider__tick_active,!0)}"${q({"--divkit-slider-tick":t})}></div>`))} ${N(jt,(t=>`<div class="${I(br.slider__tick,!0)+" "+I(br.slider__tick_inactive,!0)}"${q({"--divkit-slider-tick":t})}></div>`))} <div${L("class",br.slider__thumb,0)}${q({"border-radius":dt(Pt.borderRadius),background:Pt.background,"box-shadow":Pt.boxShadow||""})}>${Vt?`<div${L("class",br["slider__thumb-text"],0)}><div${L("class",br["slider__thumb-text-inner"],0)}${q({"font-size":(null===(r=Vt)||void 0===r?void 0:r.fontSize)||"1em","font-weight":(null===(n=Vt)||void 0===n?void 0:n.fontWeight)||"",color:(null===(o=Vt)||void 0===o?void 0:o.textColor)||"#000"})}>${I(Ht)}</div></div>`:""}</div> ${s?`<div class="${I(br.slider__thumb,!0)+" "+I(br.slider__thumb_secondary,!0)}"${q({"border-radius":dt(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${Bt?`<div class="${I(br["slider__thumb-text"],!0)+" "+I(br["slider__thumb-text_secondary"],!0)}"><div${L("class",br["slider__thumb-text-inner"],0)}${q({"font-size":(null===(i=Bt)||void 0===i?void 0:i.fontSize)||"1em","font-weight":(null===(a=Bt)||void 0===a?void 0:a.fontWeight)||"",color:(null===(l=Bt)||void 0===l?void 0:l.textColor)||"#000"})}>${I(Jt)}</div></div>`:""}</div>`:""} <input type="range"${L("class",br.slider__input,0)}${L("min",Dt,0)}${L("max",St,0)} step="1"${L("value",Ht,0)}${L("aria-label",Ut,0)}${L("this",undefined,0)}> ${s?`<input type="range"${L("class",`${br.slider__input} ${br.slider__input_secondary}`,0)}${L("min",Dt,0)}${L("max",St,0)} step="1"${L("value",Jt,0)}${L("aria-label",Wt,0)}>`:""}</div></div>`}})}`)})),Zr={input:"divkit-c3a4c","input_alignment-horizontal_center":"divkit-fc52a","input_alignment-horizontal_end":"divkit-e9096",input__aligner:"divkit-e0491",input__input:"divkit-f11e0",input__placeholder:"divkit-b7593","input_alignment-vertical_start":"divkit-cd14f","input_alignment-vertical_end":"divkit-cd38f","input_alignment-vertical_baseline":"divkit-dd6af","input_highlight-color":"divkit-cc00f",input__input_singleline:"divkit-ffd1e","input__scroll-wrapper":"divkit-ad8a3",input__input_multiline:"divkit-f61f0","input__input_has-custom-focus":"divkit-e6b50"};function Yr(t,e){if(t===e)return{start:t.length,added:0,removed:0};if(t.length>e.length){const r=Yr(e,t);return{start:r.start,added:r.removed,removed:r.added}}let r=0,n=e.length-1;const o=e.length-t.length;for(;r<n&&r<t.length&&t[r]===e[r];)++r;for(;n-o>=r&&t[n-o]===e[n];)--n;return++n,{start:r,added:n-r,removed:n-r-o}}function Qr(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class Kr{constructor(t){this.char=t}}class tn{constructor(t,e,r){this.char=t,this.filter=e,this.placeholder=r}}class en{constructor(t){Qr(this,"filters",new Map),Qr(this,"destructedValue",[]),Qr(this,"cursorPos",0),this.maskData=t,this.updateMaskData(t)}get cursorPosition(){return this.cursorPos}get rawValue(){return this.collectValueRange(0,this.destructedValue.length-1)}get value(){let t="";for(let e=0;e<this.destructedValue.length;++e){const r=this.destructedValue[e];if(r instanceof Kr)t+=r.char;else if(r instanceof tn)if(r.char)t+=r.char;else{if(!this.maskData.alwaysVisible)break;t+=r.placeholder}}return t}firstEmptyHolderIndex(){const t=this.destructedValue.findIndex((t=>t instanceof tn&&!t.char));return-1!==t?t:this.destructedValue.length}updateMaskData(t,e=!0){const r=this.maskData!==t&&e?this.rawValue:null;this.filters=new Map,this.maskData=t,this.maskData.decoding.forEach((t=>{if(t.filter)try{const e=new RegExp(t.filter);this.filters.set(t.key,e)}catch(e){this.onException(st(e,{level:"error",additional:{key:t.key}}))}})),this.destructedValue=this.maskData.pattern.split("").map((t=>{const e=this.maskData.decoding.find((e=>e.key===t));return e?new tn(null,this.filters.get(e.key),e.placeholder):new Kr(t)})),null!==r&&this.overrideRawValue(r)}overrideRawValue(t){this.clearRange(0,this.destructedValue.length),this.replaceChars(t,0),this.cursorPos=Math.min(this.cursorPos,this.value.length)}applyChangeFrom(t,e){const r=Yr(this.value,t);void 0!==e&&(r.start=Math.max(0,e-r.added));const n=this.buildBodySubstring(r,t),o=this.buildTailSubstring(r);this.cleanup(r);const i=this.firstEmptyHolderIndex(),a=o?this.calculateMaxShift(o,i):void 0;this.replaceChars(n,i,a);const s=this.firstEmptyHolderIndex();this.replaceChars(o,s),this.calculateCursorPosition(r,s)}buildBodySubstring(t,e){return e.substring(t.start,t.start+t.added)}buildTailSubstring(t){return this.collectValueRange(t.start+t.removed,this.destructedValue.length-1)}calculateMaxShift(t,e){if(this.filters.size<=1){let r=0,n=e;for(;n<this.destructedValue.length;)this.destructedValue[n]instanceof tn&&++r,++n;return Math.max(0,r-t.length)}const r=this.calculateInsertableSubstring(t,e);let n=0;for(;n<this.destructedValue.length&&r===this.calculateInsertableSubstring(t,e+n);)++n;return Math.max(0,n-1)}cleanup(t){if(0===t.added&&1===t.removed){let e=t.start;for(;e>=0;){const t=this.destructedValue[e];if(t instanceof tn&&null!==t.char){t.char=null;break}--e}}this.clearRange(t.start,this.destructedValue.length)}clearRange(t,e){let r=t;for(;r<e&&r<this.destructedValue.length;){const t=this.destructedValue[r];t instanceof tn&&(t.char=null),++r}}calculateCursorPosition(t,e){const r=this.firstEmptyHolderIndex();let n;n=t.start<r?Math.min(this.firstHolderAfter(e),this.value.length):r,this.cursorPos=n}calculateInsertableSubstring(t,e){let r="",n=e;const o=()=>{for(var t;n<this.destructedValue.length&&!(this.destructedValue[n]instanceof tn);)++n;return null===(t=this.destructedValue[n])||void 0===t?void 0:t.filter};return t.split("").forEach((t=>{const e=o();null!=e&&e.test(t)&&(r+=t,++n)})),r}collectValueRange(t,e){let r="",n=t;for(;n<=e;){const t=this.destructedValue[n];t instanceof tn&&null!==t.char&&(r+=t.char),++n}return r}replaceChars(t,e,r){let n=this.calculateInsertableSubstring(t,e);void 0!==r&&(n=n.substring(0,r));let o=e,i=0;for(;o<this.destructedValue.length&&i<n.length;){const t=this.destructedValue[o],e=n[i];t instanceof tn&&(t.char=e,++i),++o}}firstHolderAfter(t){let e=t;for(;e<this.destructedValue.length&&!(this.destructedValue[e]instanceof tn);)++e;return e}}class rn extends en{constructor(t,e){super(t),this.logError=e}onException(t){this.logError(t)}}function nn(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class on extends en{constructor(t=void 0,e){super({pattern:"",decoding:[],alwaysVisible:!1}),nn(this,"currencyFormatter",new Intl.NumberFormat),nn(this,"decimalSeparator","."),nn(this,"localeDigits",{}),nn(this,"trimZeroRegExp",new RegExp("")),this.logError=e,this.initFormatter(t)}updateCurrencyParams(t){const e=this.parseFormat(this.rawValue)||0;this.initFormatter(t);const r=e.toString().replace(".",this.decimalSeparator);this.applyChangeFrom(r)}initFormatter(t){try{this.currencyFormatter=new Intl.NumberFormat(t,{minimumFractionDigits:2,maximumFractionDigits:2}),this.decimalSeparator=this.currencyFormatter.format(0)[1],this.localeDigits=new Array(10).fill("").reduce(((t,e,r)=>(t[r]=this.currencyFormatter.format(r)[0],t)),{}),this.trimZeroRegExp=new RegExp(`^${this.localeDigits[0]}+`)}catch(e){this.onException(st(e,{level:"error",additional:{locale:t}}))}}invalidateMaskDataForFormatted(t){const e=this.currencyFormatter.format(t),r=this.formatPattern(e),n=[{key:"#",filter:`[${[...Object.values(this.localeDigits)].join("")}]`,placeholder:this.localeDigits[0]},{key:this.decimalSeparator,filter:`[${this.decimalSeparator}]`,placeholder:this.decimalSeparator}];this.updateMaskData({pattern:r,decoding:n,alwaysVisible:this.maskData.alwaysVisible},!1)}overrideRawValue(t){const e=this.parseFormat(t)||0;this.invalidateMaskDataForFormatted(e),super.overrideRawValue(t)}applyChangeFrom(t,e){const r=Yr(this.value,t),n=this.value.lastIndexOf(this.decimalSeparator),o=t.lastIndexOf(this.decimalSeparator),i=n!==o||-1===n&&-1===o,a=this.validFormat(t,r);this.cleanup(r);const s=this.parseFormat(a)||0;i&&this.invalidateMaskDataForFormatted(s),this.replaceChars(a,0),this.value.length>r.start&&!this.isDigit(this.value[r.start])?this.cursorPos=null!=e?e:this.cursorPosition:this.cursorPos=Math.abs(this.value.length-(t.length-(null!=e?e:this.cursorPosition)))}parseFormat(t){return parseFloat(t.replace(/./g,(t=>this.localeDigits[t]||(t===this.decimalSeparator?".":""))))}formatPattern(t){let e="";for(const r of t)e+=this.isDigit(r)?"#":r;return e}validFormat(t,e){if(!t)return"";let r=-1,n=0;for(;n<t.length;){if(t[n]===this.decimalSeparator&&!this.inDiff(e,n)){r=n;break}n++}let o=-1;1===e.added&&0===e.removed&&[",","."].includes(t[e.start])&&(o=e.start);const i=this.currencyFormatter.resolvedOptions().maximumFractionDigits;let a=i;if(-1!==r)for(n=r;n<t.length;)this.isDigit(t[n])&&!this.inDiff(e,n)&&a--,n++;else{let r=!1;for(let n=0;n<t.length;n++){const o=t[n];o===this.decimalSeparator?r=!0:!this.inDiff(e,n)&&r&&this.isDigit(o)&&a--}}const s=t.includes(this.decimalSeparator)||-1!==o,l=[];n=t.length-1;let c=!1;for(;n>=0;){const u=t[n],d=l.length<=i;this.isDigit(u)?this.inDiff(e,n)&&!c&&s?a>0&&(l.push(u),a--):l.push(u):d&&-1===r&&n===o?(l.push(this.decimalSeparator),c=!0):!d||u!==this.decimalSeparator||r!==n&&-1!==r||(l.push(this.decimalSeparator),c=!0,r=n),n--}return l.reverse().join("").replace(this.trimZeroRegExp,"")}inDiff(t,e){return t.start<=e&&e<t.start+t.added}isDigit(t){return Boolean(this.localeDigits[t])}onException(t){this.logError(t)}}function an(t){const e=t.textContent;let r=0;return"string"==typeof e&&(r+=e.length,t instanceof HTMLElement&&("DIV"===t.tagName||"BR"===t.tagName)&&++r),r}function sn(t,e){if(3!==t.nodeType)if(t instanceof HTMLElement&&"BR"===t.tagName)try{const e=window.getSelection();if(e){e.removeAllRanges();const r=document.createRange(),n=t.parentNode,o=Array.from(n.childNodes).indexOf(t)+1;r.setStart(n,o),r.setEnd(n,o),e.addRange(r)}}catch(t){}else for(let r=0,n=t.childNodes.length;r<n;++r){const n=t.childNodes[r],o=an(n);if(e<=o)return void sn(n,e);e-=o}else try{const r=window.getSelection();if(r){r.removeAllRanges();const n=document.createRange();n.setStart(t,e),n.setEnd(t,e),r.addRange(n)}}catch(t){}}const ln="undefined"!=typeof document&&"inputMode"in document.createElement("input"),cn={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url",password:"password"},un=W(((t,e,r,n)=>{let o,a,s,u,d,p,g,h,m,y,b,_,w,x,k,E,C,A,j,F,V,D,S,O,P,T,M,N,z,B,U,W,H,q,J,G,X,Z,Y,Q,K,tt,et,rt,nt,ot,it,lt,ct,vt,ft,ht=i,mt=i,yt=i,bt=i,_t=i,wt=i,$t=i,xt=i,kt=i,Ct=i,At=i,jt=i,Vt=i,Ot=i,Pt=i,It=i,Tt=i,Mt=i,Nt=i,zt=i;var Rt;let{componentContext:Ut}=e,{layoutParams:Wt}=e;const Lt=f(at);let Ht,qt;q=l(Lt.direction,(t=>H=t));let Jt,Gt,Zt,Yt=null,Qt="",Kt="",te=!1,ee="",re=12,oe="",ae="",le="#000",ce="",ve="start",ge="center",fe="multi_line_text",he="text",me="",ye=null,be="",_e="",we="",$e=!0;function xe(t){qt instanceof HTMLInputElement?qt.selectionStart=qt.selectionEnd=t:sn(qt,t)}async function ke(){if(!qt||!Yt)return;Yt.overrideRawValue(U),d.set(Yt.rawValue),c(u,B=Qt=Kt=Yt.value,B);const t=Yt.cursorPosition;await $(),document.activeElement===qt&&xe(t)}var Ee;v((()=>{Ht&&(Lt.unregisterFocusable(Ht),Ht=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==Ut&&r.componentContext(Ut),void 0===e.layoutParams&&r.layoutParams&&void 0!==Wt&&r.layoutParams(Wt),o=Ut.origJson,o&&(ee="",re=12,Jt=void 0,oe="",Gt=void 0,le="#000",ce="",ve="left",ge="center",fe="multi_line_text",he="text",Zt=void 0,$e=!0),a=Ut.json.text_variable,s=null===(Rt=Ut.json.mask)||void 0===Rt?void 0:Rt.raw_text_variable,u=a&&Ut.getVariable(a,"string")||Rr("temp","string",""),ht(),ht=l(u,(t=>B=t)),d=s&&Ut.getVariable(s,"string")||Rr("temp","string",""),mt(),mt=l(d,(t=>U=t)),p=Ut.getDerivedFromVars(Ut.json.hint_text),Nt(),Nt=l(p,(t=>vt=t)),g=Ut.getDerivedFromVars(Ut.json.hint_color),Mt(),Mt=l(g,(t=>ct=t)),h=Ut.getDerivedFromVars(Ut.json.font_size),Tt(),Tt=l(h,(t=>lt=t)),m=Ut.getDerivedFromVars(Ut.json.font_weight),It(),It=l(m,(t=>it=t)),y=Ut.getDerivedFromVars(Ut.json.font_family),Pt(),Pt=l(y,(t=>ot=t)),b=Ut.getDerivedFromVars(Ut.json.line_height),Ot(),Ot=l(b,(t=>nt=t)),_=Ut.getDerivedFromVars(Ut.json.letter_spacing),Vt(),Vt=l(_,(t=>rt=t)),w=Ut.getDerivedFromVars(Ut.json.text_color),jt(),jt=l(w,(t=>et=t)),x=Ut.getDerivedFromVars(Ut.json.highlight_color),At(),At=l(x,(t=>tt=t)),k=Ut.getDerivedFromVars(Ut.json.text_alignment_horizontal),Ct(),Ct=l(k,(t=>K=t)),E=Ut.getDerivedFromVars(Ut.json.text_alignment_vertical),kt(),kt=l(E,(t=>Q=t)),C=Ut.getDerivedFromVars(Ut.json.keyboard_type),$t(),$t=l(C,(t=>Z=t)),A=Ut.getDerivedFromVars(Ut.json.mask),wt(),wt=l(A,(t=>X=t)),j=Ut.getDerivedFromVars(Ut.json.max_visible_lines),_t(),_t=l(j,(t=>G=t)),F=Ut.getDerivedFromVars(Ut.json.paddings),bt(),bt=l(F,(t=>J=t)),V=Ut.getDerivedFromVars(Ut.json.accessibility),yt(),yt=l(V,(t=>W=t)),D=Ut.getDerivedFromVars(Ut.json.select_all_on_focus),zt(),zt=l(D,(t=>ft=t)),S=Ut.getDerivedFromVars(Ut.json.is_enabled),xt(),xt=l(S,(t=>Y=t)),a?te=!1:(te=!0,Ut.logError(st(new Error('Missing "text_variable" in "input"')))),"fixed_length"===(null==(Ee=X)?void 0:Ee.type)?Yt=function(t,e,r){if("string"==typeof t.pattern&&Array.isArray(t.pattern_elements)&&t.pattern_elements.every((t=>t.key&&"string"==typeof t.key))){const n={pattern:t.pattern,alwaysVisible:Boolean(t.always_visible),decoding:t.pattern_elements.map((t=>({key:t.key,filter:t.regex&&"string"==typeof t.regex?t.regex:void 0,placeholder:t.placeholder&&"string"==typeof t.placeholder?t.placeholder:"_"})))};return r?(r.updateMaskData(n),r):new rn(n,e)}return r||null}(Ee,Ut.logError,Yt):"currency"===(null==Ee?void 0:Ee.type)&&(Yt=function(t,e,r){return r?(r.updateCurrencyParams(t.locale),r):new on(t.locale,e)}(Ee,Ut.logError,Yt)),Yt&&ke(),Yt||Qt===B||(Qt=Kt=B),Yt&&Yt.rawValue!==U&&ke(),O=vt,ee=gt(ct,1,ee),re=ie(lt,re),Jt=se(it,Jt),oe=ot&&"string"==typeof ot?Lt.typefaceProvider(ot,{fontWeight:Jt||400}):"";{const t=nt;Xt(t)&&(Gt=t/re)}return St(rt)&&(ae=dt(rt)),le=gt(et,1,le),ce=gt(tt,1,ce),ve=ue(K,H,ve),ge=de(Q,ge),$e=pe(Y,$e),Z&&Z in cn&&(he=cn[Z],fe=Z),"currency"===(null==X?void 0:X.type)&&(he=ln?"text":"tel",Zt="decimal"),P="multi_line_text"===fe,me=Xt(G)?`calc(${G*(Gt||1.25)*(re/10)+"em"} + ${pt(Et(null==J?void 0:J.top,0)+Et(null==J?void 0:J.bottom,0))})`:"",ye=Bt(J||void 0,ye),be=ye?Dt({top:(Number(ye.top)||0)/re*10,right:(Number("ltr"===H?ye.end:ye.start)||Number(ye.right)||0)/re*10,bottom:(Number(ye.bottom)||0)/re*10,left:(Number("ltr"===H?ye.start:ye.end)||Number(ye.left)||0)/re*10},H):"",_e=ye?Dt({top:(Number(ye.top)||0)/re*10,bottom:(Number(ye.bottom)||0)/re*10},H):"",(null==W?void 0:W.description)?we=W.description:Ut.logError(st(new Error('Missing accessibility "description" for input'),{level:"warn"})),T={"highlight-color":Boolean(ce),multiline:P,"alignment-horizontal":ve,"alignment-vertical":ge},M={"--divkit-input-hint-color":ee,"--divkit-input-highlight-color":ce,"--divkit-input-line-height":Gt,"font-weight":Jt,"font-family":oe,"letter-spacing":ae,color:le,"max-height":me},N={"font-size":dt(re),padding:be},z={"font-size":dt(re),padding:_e},qt&&Ut.json&&(Ht&&(Lt.unregisterFocusable(Ht),Ht=void 0),Ut.json.id&&!Ut.fakeElement&&(Ht=Ut.json.id,Lt.registerFocusable(Ht,{focus(){qt&&qt.focus()}}))),ht(),mt(),yt(),q(),bt(),_t(),wt(),$t(),xt(),kt(),Ct(),At(),jt(),Vt(),Ot(),Pt(),It(),Tt(),Mt(),Nt(),zt(),te?"":`${R(ne,"Outer").$$render(t,{cls:Ft("input",Zr,T),style:M,customDescription:!0,customActions:"input",customPaddings:!0,hasInnerFocusable:!0,componentContext:Ut,layoutParams:Wt},{},{default:({focusHandler:t,blurHandler:e,hasCustomFocus:r})=>{return P?`<span${L("class",Zr["input__scroll-wrapper"],0)}>${!Kt&&O?`<div${L("class",Zr.input__placeholder,0)} aria-hidden="true"${L("style",ut(N),0)}>${I(O)}</div>`:""} <span${L("class",Zr.input__aligner,0)} aria-hidden="true"${L("style",ut(z),0)}>​</span> ${$e?` <span${L("class",Ft("input__input",Zr,{"has-custom-focus":r,multiline:!0}),0)} autocapitalize="off" contenteditable="true" role="textbox" tabindex="0"${L("aria-label",we,0)} aria-multiline="true"${L("style",ut(N),0)}${L("this",qt,0)}>${n=Kt,void 0===n?"":n}</span>`:`<span${L("class",Ft("input__input",Zr,{multiline:!0}),0)} autocapitalize="off" contenteditable="false" role="textbox"${L("aria-label",we,0)} aria-disabled="true" aria-multiline="true"${L("style",ut(N),0)}${L("this",qt,0)}>${(t=>void 0===t?"":t)(Kt)}</span>`}</span>`:`<input${L("type",he,0)}${L("inputmode",Zt,0)}${L("class",Ft("input__input",Zr,{"has-custom-focus":r,singleline:!0}),0)} autocomplete="off" autocapitalize="off"${L("aria-label",we,0)}${L("style",ut(N),0)} ${$e?"":"disabled"}${L("placeholder",O,0)}${L("value",Qt,0)}${L("this",qt,0)}>`;var n}})}`})),dn={select:"divkit-feef3","select__select-text":"divkit-cd862",select_hint:"divkit-a3cf6",select__select:"divkit-bdb72","select__select_has-custom-focused":"divkit-a46ad","has-custom-focused":"divkit-fc5dc",select__option:"divkit-e774b"},pn=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,j,F,V,D,S,O,P,T,M,z,B,U,W=i,H=i,q=i,J=i,G=i,X=i,Z=i,Y=i,Q=i,K=i,tt=i,{componentContext:et}=e,{layoutParams:rt}=e;const nt=f(at);let ot;M=l(nt.direction,(t=>T=t));let it,lt,ct=!1,pt="",vt=null,ft="",ht="rgba(0,0,0,.45)",mt=12,yt="",bt="",_t="#000",wt="";v((()=>{ot&&(nt.unregisterFocusable(ot),ot=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==et&&r.componentContext(et),void 0===e.layoutParams&&r.layoutParams&&void 0!==rt&&r.layoutParams(rt),o=et.origJson,o&&(vt=null,ht="rgba(0,0,0,.45)",mt=12,it=void 0,yt="",lt=void 0,bt="",_t="#000",wt=""),a=et.json.value_variable,s=et.json.options,c=Array.isArray(s)&&s.filter((t=>"string"==typeof t.value))||[],u=a&&et.getVariable(a,"string")||Rr("temp","string",""),K(),K=l(u,(t=>B=t)),d=et.getDerivedFromVars(et.json.paddings),Q(),Q=l(d,(t=>z=t)),p=et.getDerivedFromVars(et.json.hint_text),tt(),tt=l(p,(t=>U=t)),g=et.getDerivedFromVars(et.json.hint_color),Y(),Y=l(g,(t=>P=t)),h=et.getDerivedFromVars(et.json.font_size),Z(),Z=l(h,(t=>O=t)),m=et.getDerivedFromVars(et.json.font_weight),X(),X=l(m,(t=>S=t)),y=et.getDerivedFromVars(et.json.font_family),G(),G=l(y,(t=>D=t)),b=et.getDerivedFromVars(et.json.line_height),J(),J=l(b,(t=>V=t)),_=et.getDerivedFromVars(et.json.letter_spacing),q(),q=l(_,(t=>F=t)),w=et.getDerivedFromVars(et.json.text_color),H(),H=l(w,(t=>j=t)),$=et.getDerivedFromVars(et.json.accessibility),W(),W=l($,(t=>A=t)),Array.isArray(c)&&c.length||et.logError(st(new Error('Empty selection "items" in "select"'))),a?ct=!1:(ct=!0,et.logError(st(new Error('Missing "value_variable" in "select"'))));{const t=c.find((t=>t.value===B));t?pt=("string"==typeof t.text?t.text:t.value)||"":(pt="",B&&et.logError(st(new Error('Value from the variable was not found in the selection items for "select"'))))}mt=ie(O,mt),vt=Bt(z||void 0,vt),ft=vt?Dt({top:(Number(vt.top)||0)/mt*10,right:(Number("ltr"===T?vt.end:vt.start)||Number(vt.right)||0)/mt*10,bottom:(Number(vt.bottom)||0)/mt*10,left:(Number("ltr"===T?vt.start:vt.end)||Number(vt.left)||0)/mt*10},T):"",ht=gt(P,1,ht),it=se(S,it),yt=D&&"string"==typeof D?nt.typefaceProvider(D,{fontWeight:it||400}):"";{const t=V;Xt(t)&&(lt=t/mt)}return St(F)&&(bt=dt(F/mt*10)),_t=gt(j,1,_t),(null==A?void 0:A.description)?wt=A.description:et.logError(st(new Error('Missing accessibility "description" for select'),{level:"warn"})),x={hint:!pt},k={"--divkit-input-hint-color":ht,"font-weight":it,"font-family":yt,color:_t},E={padding:ft,"font-size":dt(mt),"line-height":lt,"letter-spacing":bt},C={"font-size":dt(mt),"line-height":lt,"letter-spacing":bt},et.json,W(),H(),q(),J(),G(),X(),Z(),Y(),M(),Q(),K(),tt(),ct?"":`${R(ne,"Outer").$$render(t,{cls:Ft("select",dn,x),style:k,customDescription:!0,customActions:"select",customPaddings:!0,hasInnerFocusable:!0,componentContext:et,layoutParams:rt},{},{default:({hasCustomFocus:t,focusHandler:e,blurHandler:r})=>`<span${L("class",dn["select__select-text"],0)}${L("style",ut(E),0)} aria-hidden="true"> ${I(pt||U||"​")}</span> <select${L("class",Ft("select__select",dn,{"has-custom-focus":t}),0)}${L("aria-label",wt,0)}${L("style",ut(C),0)}${L("this",undefined,0)}>${N(c,(t=>`<option${L("class",dn.select__option,0)}${L("value",t.value,0)}>${I(t.text||t.value)}</option>`))}</select>`})}`})),vn={video__video:"divkit-c11f9","video__aspect-wrapper":"divkit-cfe32",video_aspect:"divkit-a4f5c"},gn=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,j=i,F=i,V=i,D=i,S=i,O=i,P=i,I=i,{componentContext:T}=e,{layoutParams:M}=e;const z=f(at);let B,U,W,H,J=!1,G=!1,X=[],Z=!1,Y=!1,Q=!1,K=!1,tt="fit",et="0";var rt,nt;v((()=>{B&&(z.unregisterInstance(B),B=void 0),H&&(H(),H=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==T&&r.componentContext(T),void 0===e.layoutParams&&r.layoutParams&&void 0!==M&&r.layoutParams(M),T.json&&(Z=!1,Y=!1,Q=!1,K=!1,W=void 0,tt="fit"),o=T.json.elapsed_time_variable,a=o&&T.getVariable(o,"integer")||Rr("temp","integer",0),a&&(H&&H(),H=a.subscribe((function(t){G&&(G=!1)}))),s=T.getDerivedFromVars(T.json.video_sources),I(),I=l(s,(t=>A=t)),c=T.getDerivedFromVars(T.json.repeatable),P(),P=l(c,(t=>C=t)),u=T.getDerivedFromVars(T.json.autostart),j(),j=l(u,(t=>_=t)),d=T.getDerivedFromVars(T.json.muted),O(),O=l(d,(t=>E=t)),p=T.getDerivedFromVars(T.json.preload_required),S(),S=l(p,(t=>k=t)),g=T.getDerivedFromVars(T.json.preview),D(),D=l(g,(t=>x=t)),h=T.getDerivedFromVars(T.json.scale),V(),V=l(h,(t=>$=t)),m=T.getDerivedFromVars(T.json.aspect),F(),F=l(m,(t=>w=t)),rt=A,nt=X,X=Array.isArray(rt)&&rt.length?rt.filter((t=>"video_source"===(null==t?void 0:t.type)&&"string"==typeof t.url&&"string"==typeof t.mime_type)).map((t=>{const e={src:t.url};return t.mime_type&&(e.type=t.mime_type),e})):nt,X.length?J=!1:(J=!0,T.logError(st(new Error('Missing "video_sources" in "video"')))),Z=pe(C,Z),Y=pe(_,Y),Q=pe(E,Q),K=pe(k,K),W="string"==typeof x?ze(x):W,tt=function(t){return"fill"===t?"cover":"no_scale"===t?"none":"contain"}($)||tt;{const t=null==w?void 0:w.ratio;et=t&&Xt(t)?(100/Number(t)).toFixed(2):"0"}return T.json&&(B&&(z.unregisterInstance(B),B=void 0),!T.json.id||J||T.fakeElement||(B=T.json.id,z.registerInstance(B,{pause:function(){},start:function(){}}))),T.json,y={aspect:"0"!==et},b={"object-fit":tt},j(),F(),V(),D(),S(),O(),P(),I(),J?"":`${R(ne,"Outer").$$render(t,{cls:Ft("video",vn,y),customActions:"video",componentContext:T,layoutParams:M},{},{default:()=>y.aspect?`<div${L("class",vn["video__aspect-wrapper"],0)}${q({"padding-bottom":`${et}%`})}><video${L("class",vn.video__video,0)}${L("style",ut(b),0)} playsinline ${Z?"loop":""} ${Y?"autoplay":""} ${Q?"muted":""}${L("poster",W,0)}${L("preload",K?"metadata":"auto",0)}${L("this",U,0)}>${N(X,(t=>`<source${L("src",t.src,0)}${L("type",t.type,0)}>`))}</video></div>`:`<video${L("class",vn.video__video,0)}${L("style",ut(b),0)} playsinline ${Z?"loop":""} ${Y?"autoplay":""} ${Q?"muted":""}${L("poster",W,0)}${L("preload",K?"metadata":"auto",0)}${L("this",U,0)}>${N(X,(t=>`<source${L("src",t.src,0)}${L("type",t.type,0)}>`))}</video>`})}`})),fn=gn,hn=W(((t,e,r,n)=>{let o,i;var a;let{componentContext:s}=e,{layoutParams:l}=e;const c=f(at);let u=null,d="",p={},v=!1;if(void 0===e.componentContext&&r.componentContext&&void 0!==s&&r.componentContext(s),void 0===e.layoutParams&&r.layoutParams&&void 0!==l&&r.layoutParams(l),"string"==typeof s.json.custom_type&&s.json.custom_type&&(null===(a=c.customComponents)||void 0===a?void 0:a.has(s.json.custom_type))){if(u=c.customComponents.get(s.json.custom_type),"function"==typeof u.template){const t=c.getExtensionContext(),e=new Map;for(const[r,n]of t.variables)e.set(r,n.getValue());d=u.template({props:s.json.custom_props,variables:e})}else d=u.template&&"string"==typeof u.template?u.template:"";p={shadowrootmode:u.shadowRootMode||"open"}}else u=null,d=";",s.logError(st(new Error('Unknown or incorrect "custom_type" prop for div "custom"')));return o=s.json.items,void 0===o||Array.isArray(o)?v=!1:(v=!0,s.logError(st(new Error('Incorrect "items" prop for div "custom"')))),i=(!v&&o||[]).map(((t,e)=>s.produceChildContext(t,{path:e}))),u?`${R(ne,"Outer").$$render(t,{componentContext:s,layoutParams:l},{},{default:()=>{return(e=u.element)?`<${u.element}${S([M(s.json.custom_props||{})],{})}${L("this",undefined,0)}>${V(e)?"":`${d?`<template${S([M(p)],{})}> ${d}</template>`:""} ${!v&&o?`${N(i,(e=>`${R(bn,"Unknown").$$render(t,{componentContext:e},{},{})}`))}`:""}`}${V(e)?"":`</${e}>`}`:"";var e}})}`:""})),mn=hn,yn={};yn.text=fe,yn.container=Pe,yn.separator=Me,yn.image=Be,yn.gif=Be,yn.grid=Je,yn.gallery=nr,yn.tabs=ar,yn.state=dr,yn.pager=gr,yn.indicator=yr,yn.slider=Xr,yn.input=un,yn.select=pn,yn.video=fn,yn.custom=mn;const bn=W(((t,e,r,n)=>{let{componentContext:o}=e,{layoutParams:i}=e;const a=f(at);let s;void 0===e.componentContext&&r.componentContext&&void 0!==o&&r.componentContext(o),void 0===e.layoutParams&&r.layoutParams&&void 0!==i&&r.layoutParams(i);{const t=o.json;if(s=(null==t?void 0:t.type)&&yn[t.type]||void 0,!s){let e;e=(null==t?void 0:t.type)&&a.hasTemplate(t.type)?"Recursive template":"Unknown component",o.logError(st(new Error(e),{additional:{component:(null==t?void 0:t.type)||"<missing>"}}))}}return s?`${R(s||z,"svelte:component").$$render(t,{componentContext:o,layoutParams:i},{},{})}`:""})),_n=W(((t,e,r,n)=>{let{svgFiltersMap:o}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==o&&r.svgFiltersMap(o),Object.keys(o).length?`<svg${L("class","divkit-dc22b",0)} aria-hidden="true"><defs>${N([...Object.keys(o)],(t=>{let[e,r]=t.split(":");return` <filter${L("id",o[t],0)}><feFlood${L("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${L("operator",r.split("_")[1],0)}></feComposite>`:"multiply"===r?'<feComposite in2="SourceGraphic" operator="arithmetic" k1="1" k2="0" k3="0" k4="0"></feComposite>':`<feBlend in2="SourceGraphic"${L("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function wn(t,e,r,n){const o=r[t.type];if(!o)return n(st(new Error("No such template"),{additional:{template:t.type}})),{json:t,templateContext:e};let i;const a={};for(i in e)e.hasOwnProperty(i)&&(a[i]=e[i]);for(i in t)"type"!==i&&"__proto__"!==i&&t.hasOwnProperty(i)&&(a[i]=t[i]);const s=function t(e,r){const n=Object.keys(r).filter((t=>"__proto__"!==t)),o=n.filter((t=>"$"!==t.charAt(0))),i=n.filter((t=>"$"===t.charAt(0)));return o.forEach((n=>{const o=r[n];"object"==typeof o&&null!==o?(e[n]=Array.isArray(o)?[]:{},t(e[n],o)):e[n]=o})),i.forEach((t=>{const n=r[t],o=a[n];if(void 0!==o){const r=t.substring(1);e[r]=o}})),e}({},o);for(i in t)"type"!==i&&"__proto__"!==i&&t.hasOwnProperty(i)&&(s[i]=t[i]);return{json:s,templateContext:a}}function $n(){}function xn(t){return{subscribe:e=>(e(t),$n)}}function kn(t,e){return e.length?e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t):t}function En(t,e){return e.length?e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t):t}function Cn(t){if(t.every((t=>"string"==typeof t)))return{type:"StringLiteral",value:t.join("")};let e=t.reduce(((t,e)=>("string"==typeof e&&"string"==typeof t[t.length-1]?t[t.length-1]+=e:t.push(e),t)),[]).reduce(((t,e)=>("string"==typeof e?t.quasis.push({type:"StringLiteral",value:e}):(t.quasis.length===t.expressions.length&&t.quasis.push({type:"StringLiteral",value:""}),t.expressions.push(e)),t)),{type:"TemplateLiteral",quasis:[],expressions:[]});return e.quasis.length===e.expressions.length&&e.quasis.push({type:"StringLiteral",value:""}),e}function An(t){try{return Cr(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function jn(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function Fn(t,e,r,n){var o=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(o,Fn.prototype),o.expected=e,o.found=r,o.location=n,o.name="SyntaxError",o}function Vn(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}xn(void 0),function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(Fn,Error),Fn.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,n=null;for(r=0;r<t.length;r++)if(t[r].source===this.location.source){n=t[r].text.split(/\r\n|\n|\r/g);break}var o=this.location.start,i=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,a=this.location.source+":"+i.line+":"+i.column;if(n){var s=this.location.end,l=Vn("",i.line.toString().length," "),c=n[o.line-1],u=(o.line===s.line?s.column:c.length+1)-o.column||1;e+="\n --\x3e "+a+"\n"+l+" |\n"+i.line+" | "+c+"\n"+l+" | "+Vn("",o.column-1," ")+Vn("",u,"^")}else e+="\n at "+a}return e},Fn.buildMessage=function(t,e){var r={literal:function(t){return'"'+o(t.text)+'"'},class:function(t){var e=t.parts.map((function(t){return Array.isArray(t)?i(t[0])+"-"+i(t[1]):i(t)}));return"["+(t.inverted?"^":"")+e.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(t){return t.description}};function n(t){return t.charCodeAt(0).toString(16).toUpperCase()}function o(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function i(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function a(t){return r[t.type](t)}return"Expected "+function(t){var e,r,n=t.map(a);if(n.sort(),n.length>0){for(e=1,r=1;e<n.length;e++)n[e-1]!==n[e]&&(n[r]=n[e],r++);n.length=r}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(t)+" but "+function(t){return t?'"'+o(t)+'"':"end of input"}(e)+" found."};const Dn=Number.MAX_VALUE,Sn=Number.MIN_VALUE,On="string",Pn="integer",In="number",Tn="boolean",Mn="color",Nn="url",zn="datetime",Rn="dict",Bn="array";function Un(t,e){var r;switch(null===(r=e[t.type])||void 0===r||r.call(e,t),t.type){case"TemplateLiteral":t.expressions.forEach((t=>{Un(t,e)}));break;case"BinaryExpression":case"LogicalExpression":Un(t.left,e),Un(t.right,e);break;case"UnaryExpression":Un(t.argument,e);break;case"ConditionalExpression":Un(t.test,e),Un(t.consequent,e),Un(t.alternate,e);break;case"TryExpression":Un(t.test,e),Un(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{Un(t,e)}))}}function Wn(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function Ln(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function Hn(t){if("string"===t.type)return t.value;if("integer"===t.type)return String(t.value);if("number"===t.type){let e=String(t.value);return e.includes(".")||(e.includes("e")?e=e.replace("e",".0e"):e+=".0"),e=e.replace(/e\+?/i,"E"),e}if("boolean"===t.type)return t.value?"true":"false";if("datetime"===t.type)return Ln(t.value);if("color"===t.type)return Kn(Qn(t.value));if("url"===t.type)return t.value;if("dict"===t.type)return"<dict>";if("array"===t.type)return"<array>";throw new Error(`Unexpected type ${t.type}`)}function qn(t){let e=Hn(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"),e}function Jn(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function Gn(t,e){if($r)return Cr(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function Xn(t,e){if(e<Er||e>kr)throw new Error("Integer overflow.");!$r&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function Zn(t){const e=[];return Un(t,{Variable(t){e.push(t.id.name)}}),e}function Yn(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function Qn(t){const e=ft(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function Kn(t){return`#${[t.a,t.r,t.g,t.b].map((t=>{if(t<0||t>255)throw new Error("Value out of range 0..1.");return vt(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function to(t){return Kn(Qn(t))}function eo(t){return{type:In,value:Number(t.value)}}const ro={string:"string",number:"number",integer:"number",boolean:"boolean",color:"string",url:"string",array:"array",dict:"object"};function no(t,e,r){const n=ro[r];let o=typeof e;if("array"===n&&!Array.isArray(e)||"array"!==n&&o!==n||"object"===o&&null===e)throw"object"===o&&(o=Array.isArray(e)?"array":null===e?"null":"dict"),new Error(`Incorrect value type: expected "${r}", got "${o}".`);if("number"===n&&"integer"===r){Xn(t,e);try{e=Cr(e)}catch(t){throw new Error("Cannot convert value to integer.")}}return"string"===n&&"color"===r&&(e=to(e)),{type:r,value:e}}const oo=new Map,io=new Map,ao=new Map,so=new Map;function lo(t,e,r){const n={args:e,cb:r},o=oo.get(t)||[];oo.has(t)||oo.set(t,o),o.push(n);const i=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");io.set(i,n)}function co(t,e,r){const n={args:e,cb:r},o=ao.get(t)||[];ao.has(t)||ao.set(t,o),o.push(n);const i=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");so.set(i,n)}function uo(t,e){const r=t.args.length;let n=t.args.length,o=0;const i=t.args[t.args.length-1];if("object"==typeof i&&i.isVararg&&(n=1/0),e.length<r)return{type:"few",expected:r,found:e.length};if(e.length>n)return{type:"many",expected:n,found:e.length};for(let r=0;r<e.length;++r){let n=r>=t.args.length?t.args[t.args.length-1]:t.args[r];if("object"!=typeof n&&(n={type:n}),n.type!==In||e[r].type!==Pn){if(n.type!==e[r].type)return{type:"mismatch",expected:n.type,found:e[r].type}}else++o}return{type:"match",conversions:o}}function po(t,e,r){const n=("function"===t?oo:ao).get(e);if(!n)return{type:"missing"};let o=null,i=null;for(let t=0;t<n.length;++t){const e=uo(n[t],r);"match"!==e.type?o||(o=e):(!i||i.conversions>e.conversions)&&(i={func:n[t],conversions:e.conversions})}if(!i){if(o)return o;throw new Error("Missing function")}return i}function vo(t,e){return e.map(((e,r)=>{let n=r>=t.args.length?t.args[t.args.length-1]:t.args[r];return"object"!=typeof n&&(n={type:n}),n.type===In&&e.type===Pn?eo(e):e}))}function go(t,e){return{type:On,value:Hn(e)}}function fo(t,e){const r=Number(e.value);if(Number.isNaN(r)||!Number.isFinite(r))throw new Error("Unable to convert value to Number.");return{type:In,value:r}}function ho(t,e,r,n){const o=t.variables.get(e.value);let i;return i=o&&o.getType()===n?o.getValue():r.value,"color"===n&&(i=to(i)),{type:n,value:i}}function mo(t,e,r){return ho(t,e,r,r.type)}function yo(t,e,r){return ho(t,e,r,"color")}function bo(t,e,r){return ho(t,e,r,"url")}const _o=t=>(e,r)=>{let n=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++n:"getUTCDay"===t&&0===n&&(n=7),{type:Pn,value:Cr(n)}},wo=_o("getUTCFullYear"),$o=_o("getUTCMonth"),xo=_o("getUTCDate"),ko=_o("getUTCDay"),Eo=_o("getUTCHours"),Co=_o("getUTCMinutes"),Ao=_o("getUTCSeconds"),jo=_o("getUTCMilliseconds");function Fo(t,e,r,n){if(!n.value.length)return t.warnings.push(st(new Error("String for padding is empty."),{level:"warn"})),"";let o="";const i=e.type===On?e.value:Hn(e);for(;o.length+i.length<r.value;)o+=n.value;return o.length>0&&o.length+i.length>r.value&&(o=o.substring(0,Number(r.value)-Number(i.length))),o}function Vo(t,e,r,n){const o=Fo(t,e,r,n);return{type:On,value:o+Hn(e)}}function Do(t,e,r,n){const o=Fo(t,e,r,n);return{type:On,value:Hn(e)+o}}function So(t){return(e,r)=>{const n=Qn(r.value);return{type:In,value:n[t]/255}}}function Oo(t){return(e,r,n)=>{const o=Qn(r.value);return o[t]=255*n.value,{type:Mn,value:Kn(o)}}}const Po=So("a"),Io=So("r"),To=So("g"),Mo=So("b"),No=Oo("a"),zo=Oo("r"),Ro=Oo("g"),Bo=Oo("b");function Uo(t,e,r,n){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let o=Cr(e.value)/Cr(r);return Xn(t,o),"number"==typeof o&&(o=Math.floor(o)),n&&(o=Cr(o)%Cr(n)),{type:Pn,value:o}}const Wo=36e5;function Lo(t){return(e,r,...n)=>{if(0===n.length)throw new Error("Non empty argument list is required.");return no(e,function(t,e){let r=t;for(let t=0;t<e.length;++t){if(!r)throw new Error(`Missing property "${e[t]}" in the dict.`);const n=r[e[t]];if(void 0===n)throw new Error(`Missing property "${e[t]}" in the dict.`);r=n}return r}(r.value,n.map((t=>t.value))),t)}}function Ho(t,e){return(r,n,o,...i)=>{try{return t(r,o,...i)}catch(t){let r=n.value;return"color"===e&&(r=to(r)),{type:e,value:r}}}}const qo=Lo(On),Jo=Lo(In),Go=Lo(Pn),Xo=Lo(Tn),Zo=Lo(Mn),Yo=Lo(Nn),Qo=Lo(Bn),Ko=Lo(Rn),ti=Ho(qo,On),ei=Ho(Jo,In),ri=Ho(Go,Pn),ni=Ho(Xo,Tn),oi=Ho(Zo,Mn),ii=Ho(Yo,Nn);function ai(t,e,...r){try{return Qo(t,e,...r)}catch(t){return{type:Bn,value:[]}}}function si(t,e,...r){try{return Ko(t,e,...r)}catch(t){return{type:Rn,value:{}}}}function li(t,e){return(r,n,o)=>{if(o.value<0||o.value>=n.value.length)throw new Error(`Requested index (${o.value}) out of bounds array size (${n.value.length}).`);let i=n.value[Number(o.value)],a=typeof i;if("array"===t&&!Array.isArray(i)||"array"!==t&&a!==t||"object"===a&&null===i)throw"object"===a&&(a=Array.isArray(i)?"array":null===i?"null":"dict"),new Error(`Incorrect value type: expected "${e}", got "${a}".`);if("number"===t&&"integer"===e){Xn(r,i);try{i=Cr(i)}catch(t){throw new Error("Cannot convert value to integer.")}}return"string"===t&&"color"===e&&(i=to(i)),{type:e,value:i}}}function ci(t,e){return(r,n,o,i)=>{try{return t(r,n,o)}catch(t){let r=i.value;return"color"===e&&(r=to(r)),{type:e,value:r}}}}const ui=li("string","string"),di=li("number","number"),pi=li("number","integer"),vi=li("boolean","boolean"),gi=li("string","color"),fi=li("string","url"),hi=li("array","array"),mi=li("object","dict"),yi=ci(ui,"string"),bi=ci(di,"number"),_i=ci(pi,"integer"),wi=ci(vi,"boolean"),$i=ci(gi,"color"),xi=ci(fi,"url");function ki(t){return(e,r,n)=>{if(!e.store)return{type:t,value:n.value};let o;o="boolean"===t?"boolean":"number"===t||"integer"===t?"number":"string";const i=e.store.getValue(r.value,o);return void 0===i?{type:t,value:n.value}:no(e,i,t)}}function Ei(t){return t.map(qn).join(", ")}lo("toString",[Pn],go),lo("toString",[In],go),lo("toString",[Tn],go),lo("toString",[Mn],go),lo("toString",[Nn],go),lo("toString",[On],go),lo("toNumber",[Pn],fo),lo("toNumber",[On],fo),lo("toInteger",[In],(function(t,e){if(e.value>kr||e.value<Er)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:Pn,value:Cr(r)}})),lo("toInteger",[On],(function(t,e){let r;try{r=Cr(e.value)}catch(t){throw new Error("Unable to convert value to Integer.")}return{type:Pn,value:r}})),lo("toInteger",[Tn],(function(t,e){return{type:Pn,value:Cr(e.value?1:0)}})),lo("toBoolean",[Pn],(function(t,e){const r=Number(e.value);if(1!==r&&0!==r)throw new Error("Unable to convert value to Boolean.");return{type:Tn,value:r}})),lo("toBoolean",[On],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:Tn,value:"true"===e.value?1:0}})),lo("toColor",[On],(function(t,e){return{type:Mn,value:to(e.value)}})),lo("toUrl",[On],(function(t,e){return{type:Nn,value:e.value}})),lo("encodeUri",[On],(function(t,e){try{return{type:On,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),lo("decodeUri",[On],(function(t,e){try{return{type:On,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),lo("getIntegerValue",[On,Pn],mo),lo("getNumberValue",[On,In],mo),lo("getBooleanValue",[On,Tn],mo),lo("getStringValue",[On,On],mo),lo("getColorValue",[On,Mn],yo),lo("getColorValue",[On,On],yo),lo("getUrlValue",[On,Nn],bo),lo("getUrlValue",[On,On],bo),co("toString",[Pn],go),co("toString",[In],go),co("toString",[Tn],go),co("toString",[Mn],go),co("toString",[Nn],go),co("toString",[On],go),lo("parseUnixTime",[Pn],(function(t,e){return{type:zn,value:new Date(1e3*Number(e.value))}})),lo("nowLocal",[],(function(){return{type:zn,value:new Date}})),lo("addMillis",[zn,Pn],(function(t,e,r){return{type:zn,value:new Date(e.value.getTime()+Number(r.value))}})),lo("setYear",[zn,Pn],(function(t,e,r){const n=new Date(e.value);return n.setUTCFullYear(Number(r.value)),{type:zn,value:n}})),lo("setMonth",[zn,Pn],(function(t,e,r){const n=Number(r.value);if(n<1||n>12)throw new Error(`Expecting month in [1..12], instead got ${n}.`);const o=new Date(e.value);return o.setUTCMonth(n-1),{type:zn,value:o}})),lo("setDay",[zn,Pn],(function(t,e,r){const n=new Date(e.value),o=Number(r.value);if(o<=0&&-1!==o||o>function(t){const e=new Date(t);return e.setUTCMonth(e.getUTCMonth()+1),e.setUTCDate(0),e.getUTCDate()}(n))throw new Error(`Unable to set day ${o} for date ${Hn(e)}.`);return n.setUTCDate(-1===o?0:o),{type:zn,value:n}})),lo("setHours",[zn,Pn],(function(t,e,r){const n=Number(r.value);if(n<0||n>23)throw new Error(`Expecting hours in [0..23], instead got ${n}.`);const o=new Date(e.value);return o.setUTCHours(n),{type:zn,value:o}})),lo("setMinutes",[zn,Pn],(function(t,e,r){const n=Number(r.value);if(n<0||n>59)throw new Error(`Expecting minutes in [0..59], instead got ${n}.`);const o=new Date(e.value);return o.setUTCMinutes(n),{type:zn,value:o}})),lo("setSeconds",[zn,Pn],(function(t,e,r){const n=Number(r.value);if(n<0||n>59)throw new Error(`Expecting seconds in [0..59], instead got ${n}.`);const o=new Date(e.value);return o.setUTCSeconds(n),{type:zn,value:o}})),lo("setMillis",[zn,Pn],(function(t,e,r){const n=Number(r.value);if(n<0||n>999)throw new Error(`Expecting millis in [0..999], instead got ${n}.`);const o=new Date(e.value);return o.setUTCMilliseconds(n),{type:zn,value:o}})),lo("getYear",[zn],wo),lo("getMonth",[zn],$o),lo("getDay",[zn],xo),lo("getDayOfWeek",[zn],ko),lo("getHours",[zn],Eo),lo("getMinutes",[zn],Co),lo("getSeconds",[zn],Ao),lo("getMillis",[zn],jo),lo("getIntervalSeconds",[Pn],(function(t,e){return Uo(t,e,1e3,60)})),lo("getIntervalTotalSeconds",[Pn],(function(t,e){return Uo(t,e,1e3)})),lo("getIntervalMinutes",[Pn],(function(t,e){return Uo(t,e,6e4,60)})),lo("getIntervalTotalMinutes",[Pn],(function(t,e){return Uo(t,e,6e4)})),lo("getIntervalHours",[Pn],(function(t,e){return Uo(t,e,Wo,24)})),lo("getIntervalTotalHours",[Pn],(function(t,e){return Uo(t,e,Wo)})),lo("getIntervalTotalDays",[Pn],(function(t,e){return Uo(t,e,864e5)})),lo("getIntervalTotalWeeks",[Pn],(function(t,e){return Uo(t,e,6048e5)})),lo("len",[On],(function(t,e){return{type:Pn,value:Cr(e.value.length)}})),lo("contains",[On,On],(function(t,e,r){return{type:Tn,value:e.value.includes(r.value)?1:0}})),lo("substring",[On,Pn,Pn],(function(t,e,r,n){if(n.value<r.value)throw new Error("Indexes should be in ascending order.");if(r.value<0||r.value>e.value.length||n.value<0||n.value>e.value.length)throw new Error("Indexes are out of bounds.");return{type:On,value:e.value.substring(Number(r.value),Number(n.value))}})),lo("replaceAll",[On,On,On],(function(t,e,r,n){let o;return o=r.value?e.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(r.value),"g"),n.value):e.value,{type:On,value:o}})),lo("index",[On,On],(function(t,e,r){return{type:Pn,value:Cr(e.value.indexOf(r.value))}})),lo("lastIndex",[On,On],(function(t,e,r){return{type:Pn,value:Cr(e.value.lastIndexOf(r.value))}})),lo("trim",[On],(function(t,e){return{type:On,value:e.value.trim()}})),lo("trimLeft",[On],(function(t,e){return{type:On,value:e.value.replace(/^\s+/,"")}})),lo("trimRight",[On],(function(t,e){return{type:On,value:e.value.replace(/\s+$/,"")}})),lo("toUpperCase",[On],(function(t,e){return{type:On,value:e.value.toUpperCase()}})),lo("toLowerCase",[On],(function(t,e){return{type:On,value:e.value.toLowerCase()}})),lo("padStart",[On,Pn,On],Vo),lo("padStart",[Pn,Pn,On],Vo),lo("padEnd",[On,Pn,On],Do),lo("padEnd",[Pn,Pn,On],Do),lo("testRegex",[On,On],(function(t,e,r){let n;try{n=new RegExp(r.value)}catch(t){throw new Error("Invalid regular expression.")}return{type:Tn,value:n.test(e.value)?1:0}})),lo("div",[Pn,Pn],(function(t,e,r){if(r.value===Ar)throw new Error("Division by zero is not supported.");let n=e.value/r.value;return n=Gn(0,n),Xn(t,n),{type:Pn,value:n}})),lo("div",[In,In],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const n=e.value/r.value;return{type:In,value:n}})),lo("mod",[Pn,Pn],(function(t,e,r){if(r.value===Ar)throw new Error("Division by zero is not supported.");let n=e.value%r.value;return n=Gn(0,n),Xn(t,n),{type:Pn,value:n}})),lo("mod",[In,In],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const n=e.value%r.value;return{type:In,value:n}})),lo("mul",[{type:Pn,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Ar;for(let n=1;n<e.length;++n)r*=e[n].value,r=Gn(0,r),Xn(t,r);return{type:Pn,value:r}})),lo("mul",[{type:In,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r*=e[t].value;return{type:In,value:r}})),lo("sub",[{type:Pn,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Ar;for(let n=1;n<e.length;++n)r-=e[n].value,r=Gn(0,r),Xn(t,r);return{type:Pn,value:r}})),lo("sub",[{type:In,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r-=e[t].value;return{type:In,value:r}})),lo("sum",[{type:Pn,isVararg:!0}],(function(t,...e){let r=Ar;for(let n=0;n<e.length;++n)r+=e[n].value,r=Gn(0,r),Xn(t,r);return{type:Pn,value:r}})),lo("sum",[{type:In,isVararg:!0}],(function(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value;return{type:In,value:r}})),lo("abs",[Pn],(function(t,e){const r=jr(e.value);return Xn(t,r),{type:e.type,value:r}})),lo("abs",[In],(function(t,e){const r=Math.abs(e.value);return{type:In,value:r}})),lo("max",[{type:Pn,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");let r=e[0].value;for(let t=1;t<e.length;++t)e[t].value>r&&(r=e[t].value);return{type:Pn,value:r}})),lo("max",[{type:In,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:In,value:Math.max(...e.map((t=>t.value)))}})),lo("min",[{type:Pn,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");let r=e[0].value;for(let t=1;t<e.length;++t)e[t].value<r&&(r=e[t].value);return{type:Pn,value:r}})),lo("min",[{type:In,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:In,value:Math.min(...e.map((t=>t.value)))}})),lo("maxNumber",[],(function(){return{type:In,value:Dn}})),lo("minNumber",[],(function(){return{type:In,value:Sn}})),lo("maxInteger",[],(function(t){return Xn(t,kr),{type:Pn,value:kr}})),lo("minInteger",[],(function(t){return Xn(t,Er),{type:Pn,value:Er}})),lo("round",[In],(function(t,e){const r=Math.sign(e.value);return{type:In,value:r*Math.round(Math.abs(e.value))}})),lo("floor",[In],(function(t,e){return{type:In,value:Math.floor(e.value)}})),lo("ceil",[In],(function(t,e){return{type:In,value:Math.ceil(e.value)}})),lo("signum",[Pn],(function(t,e){return{type:Pn,value:Fr(e.value)}})),lo("signum",[In],(function(t,e){return{type:In,value:Math.sign(e.value)}})),lo("copySign",[Pn,Pn],(function(t,e,r){let n;if(r.value===Ar)n=e.value;else if(e.value===Ar)n=Cr(0);else{const t=Fr(r.value);n=jr(e.value)*t}return Xn(t,n),{type:Pn,value:n}})),lo("copySign",[In,In],(function(t,e,r){let n=Math.sign(r.value);0===n&&(n=Object.is(n,0)?1:-1);const o=Math.abs(e.value)*n;return{type:In,value:o}})),lo("getColorAlpha",[On],Po),lo("getColorAlpha",[Mn],Po),lo("getColorRed",[On],Io),lo("getColorRed",[Mn],Io),lo("getColorGreen",[On],To),lo("getColorGreen",[Mn],To),lo("getColorBlue",[On],Mo),lo("getColorBlue",[Mn],Mo),lo("setColorAlpha",[On,In],No),lo("setColorAlpha",[Mn,In],No),lo("setColorRed",[On,In],zo),lo("setColorRed",[Mn,In],zo),lo("setColorGreen",[On,In],Ro),lo("setColorGreen",[Mn,In],Ro),lo("setColorBlue",[On,In],Bo),lo("setColorBlue",[Mn,In],Bo),lo("rgb",[In,In,In],(function(t,e,r,n){const o={a:255,r:255*e.value,g:255*r.value,b:255*n.value};return{type:Mn,value:Kn(o)}})),lo("argb",[In,In,In,In],(function(t,e,r,n,o){const i={a:255*e.value,r:255*r.value,g:255*n.value,b:255*o.value};return{type:Mn,value:Kn(i)}})),function(){const t={type:On,isVararg:!0};lo("getDictString",[Rn,t],qo),lo("getStringFromDict",[Rn,t],qo),lo("getDictNumber",[Rn,t],Jo),lo("getNumberFromDict",[Rn,t],Jo),lo("getDictInteger",[Rn,t],Go),lo("getIntegerFromDict",[Rn,t],Go),lo("getDictBoolean",[Rn,t],Xo),lo("getBooleanFromDict",[Rn,t],Xo),lo("getDictColor",[Rn,t],Zo),lo("getColorFromDict",[Rn,t],Zo),lo("getDictUrl",[Rn,t],Yo),lo("getUrlFromDict",[Rn,t],Yo),lo("getDictOptString",[On,Rn,t],ti),lo("getOptStringFromDict",[On,Rn,t],ti),lo("getDictOptNumber",[In,Rn,t],ei),lo("getOptNumberFromDict",[In,Rn,t],ei),lo("getDictOptInteger",[Pn,Rn,t],ri),lo("getOptIntegerFromDict",[Pn,Rn,t],ri),lo("getDictOptBoolean",[Tn,Rn,t],ni),lo("getOptBooleanFromDict",[Tn,Rn,t],ni),lo("getDictOptColor",[Mn,Rn,t],oi),lo("getOptColorFromDict",[Mn,Rn,t],oi),lo("getDictOptColor",[On,Rn,t],oi),lo("getOptColorFromDict",[On,Rn,t],oi),lo("getDictOptUrl",[On,Rn,t],ii),lo("getOptUrlFromDict",[On,Rn,t],ii),lo("getDictOptUrl",[Nn,Rn,t],ii),lo("getOptUrlFromDict",[Nn,Rn,t],ii),lo("getDictFromDict",[Rn,t],Ko),lo("getArrayFromDict",[Rn,t],Qo),lo("getOptArrayFromDict",[Rn,t],ai),lo("getOptDictFromDict",[Rn,t],si),co("getString",[Rn,t],qo),co("getBoolean",[Rn,t],Xo),co("getInteger",[Rn,t],Go),co("getNumber",[Rn,t],Jo),co("getUrl",[Rn,t],Yo),co("getColor",[Rn,t],Zo),co("getArray",[Rn,t],Qo),co("getDict",[Rn,t],Ko)}(),lo("getArrayString",[Bn,Pn],ui),lo("getStringFromArray",[Bn,Pn],ui),lo("getArrayNumber",[Bn,Pn],di),lo("getNumberFromArray",[Bn,Pn],di),lo("getArrayInteger",[Bn,Pn],pi),lo("getIntegerFromArray",[Bn,Pn],pi),lo("getArrayBoolean",[Bn,Pn],vi),lo("getBooleanFromArray",[Bn,Pn],vi),lo("getArrayColor",[Bn,Pn],gi),lo("getColorFromArray",[Bn,Pn],gi),lo("getArrayUrl",[Bn,Pn],fi),lo("getUrlFromArray",[Bn,Pn],fi),lo("getArrayFromArray",[Bn,Pn],hi),lo("getDictFromArray",[Bn,Pn],mi),lo("getArrayOptString",[Bn,Pn,On],yi),lo("getOptStringFromArray",[Bn,Pn,On],yi),lo("getArrayOptNumber",[Bn,Pn,In],bi),lo("getOptNumberFromArray",[Bn,Pn,In],bi),lo("getArrayOptInteger",[Bn,Pn,Pn],_i),lo("getOptIntegerFromArray",[Bn,Pn,Pn],_i),lo("getArrayOptBoolean",[Bn,Pn,Tn],wi),lo("getOptBooleanFromArray",[Bn,Pn,Tn],wi),lo("getArrayOptColor",[Bn,Pn,Mn],$i),lo("getOptColorFromArray",[Bn,Pn,Mn],$i),lo("getArrayOptColor",[Bn,Pn,On],$i),lo("getOptColorFromArray",[Bn,Pn,On],$i),lo("getArrayOptUrl",[Bn,Pn,Nn],xi),lo("getOptUrlFromArray",[Bn,Pn,Nn],xi),lo("getArrayOptUrl",[Bn,Pn,On],xi),lo("getOptUrlFromArray",[Bn,Pn,On],xi),lo("getOptArrayFromArray",[Bn,Pn],(function(t,e,r){try{return hi(t,e,r)}catch(t){return{type:Bn,value:[]}}})),lo("getOptDictFromArray",[Bn,Pn],(function(t,e,r){try{return mi(t,e,r)}catch(t){return{type:Rn,value:{}}}})),lo("len",[Bn],(function(t,e){return{type:Pn,value:Cr(e.value.length)}})),co("getString",[Bn,Pn],ui),co("getInteger",[Bn,Pn],pi),co("getNumber",[Bn,Pn],di),co("getBoolean",[Bn,Pn],vi),co("getUrl",[Bn,Pn],fi),co("getColor",[Bn,Pn],gi),co("getArray",[Bn,Pn],hi),co("getDict",[Bn,Pn],mi),lo("getStoredIntegerValue",[On,Pn],ki(Pn)),lo("getStoredNumberValue",[On,In],ki(In)),lo("getStoredStringValue",[On,On],ki(On)),lo("getStoredUrlValue",[On,Nn],ki(Nn)),lo("getStoredUrlValue",[On,On],ki(Nn)),lo("getStoredColorValue",[On,Mn],ki(Mn)),lo("getStoredColorValue",[On,On],ki(Mn)),lo("getStoredBooleanValue",[On,Tn],ki(Tn));const Ci={StringLiteral:function(t,e){return{type:On,value:e.value}},NumberLiteral:function(t,e){return{type:In,value:e.value}},IntegerLiteral:function(t,e){return Xn(t,e.value),{type:Pn,value:e.value}},BooleanLiteral:function(t,e){return{type:Tn,value:e.value?1:0}},UnaryExpression:function(t,e){const r=Wn(Ai(t,e.argument));switch(e.operator){case"!":if(r.type===Tn)return{type:Tn,value:r.value?0:1};Yn(`${e.operator}${qn(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const n="+"===e.operator?1:-1;if(r.type===Pn){const e=r.value*Cr(n);return Xn(t,e),{type:Pn,value:e}}if(r.type===In)return{type:In,value:r.value*n};Yn(`${e.operator}${qn(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=Wn(Ai(t,e.test));if(r.type===Tn)return r.value?Ai(t,e.consequent):Ai(t,e.alternate);Yn(`${qn(r)} ? ${qn(Ai(t,e.consequent))} : ${qn(Ai(t,e.alternate))}`,"Ternary must be called with a Boolean value as a condition.")},TryExpression:function(t,e){try{return Ai(t,e.test)}catch(r){return Ai(t,e.alternate)}},TemplateLiteral:function(t,e){let r="";if(2===e.quasis.length&&""===e.quasis[0].value&&""===e.quasis[1].value)return Ai(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=Hn(Ai(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:On,value:r}},LogicalExpression:function(t,e){const r=Wn(Ai(t,e.left));if(r.type!==Tn&&Yn(`${qn(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Tn,value:0};const n=Wn(Ai(t,e.right));return n.type!==Tn&&Yn(`${qn(r)} ${e.operator} ${qn(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${Jn(n.type)}.`),{type:Tn,value:n.value}},BinaryExpression:function(t,e){const r=e.operator;let n=Ai(t,e.left),o=Ai(t,e.right);if(("number"===n.type&&"integer"===o.type||"integer"===n.type&&"number"===o.type)&&("integer"===n.type?n=eo(n):"integer"===o.type&&(o=eo(o))),n.type!==o.type&&Yn(`${qn(n)} ${e.operator} ${qn(o)}`,`Operator '${r}' cannot be applied to different types: ${Jn(n.type)} and ${Jn(o.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===zn&&r.type===zn?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:Tn,value:n?1:0}}(r,n,o);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==In&&e.type!==Pn&&e.type!==zn&&Yn(`${qn(e)} ${t} ${qn(r)}`,`Operator '${t}' cannot be applied to ${Jn(e.type)} type.`);const o=e.type===zn?e.value.getTime():e.value,i=r.type===zn?r.value.getTime():r.value;return n=">"===t?o>i:">="===t?o>=i:"<"===t?o<i:o<=i,{type:Tn,value:n?1:0}}(r,n,o);if("+"===r||"-"===r)return function(t,e,r,n){if(r.type!==On&&r.type!==In&&r.type!==Pn&&Yn(`${qn(r)} ${e} ${qn(n)}`,`Operator '${e}' cannot be applied to ${Jn(r.type)} type.`),r.type===On)return"-"===e&&Yn(`${qn(r)} - ${qn(n)}`,`Operator '${e}' cannot be applied to ${Jn(r.type)} type.`),{type:On,value:r.value+n.value};let o="+"===e?r.value+n.value:r.value-n.value;if(r.type===Pn)try{o=Gn(0,o),Xn(t,o)}catch(t){Yn(`${qn(r)} ${e} ${qn(n)}`,t.message)}return{type:r.type,value:o}}(t,r,n,o);if("/"===r||"*"===r||"%"===r)return function(t,e,r,n){let o;if(r.type!==Pn&&r.type!==In&&Yn(`${qn(r)} ${e} ${qn(n)}`,`Operator '${e}' cannot be applied to ${Jn(r.type)} type.`),"*"===e)o=r.value*n.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(n.value)&&Yn(`${qn(r)} ${e} ${qn(n)}`,"Division by zero is not supported."),o="/"===e?r.value/n.value:r.value%n.value}if(r.type===Pn)try{o=Gn(0,o),Xn(t,o)}catch(t){Yn(`${qn(r)} ${e} ${qn(n)}`,t.message)}return{type:r.type,value:o}}(t,r,n,o);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;let n,o=e.arguments.map((e=>Ai(t,e)));const i=r+":"+o.map((t=>t.type)).join("#");if(io.has(i))n=io.get(i);else{const t=po("function",r,o);if("expected"in t||"type"in t&&"missing"===t.type){const e=o.map((t=>Jn(t.type))).join(", "),n=`${r}(${Ei(o)})`;"few"===t.type&&0===o.length?Yn(n,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?Yn(n,`Function '${r}' has no matching override for given argument types: ${e}.`):Yn(n,`Unknown function name: ${r}.`)}n=t.func,t.conversions&&(o=vo(n,o))}if(!n)throw new Error("Function not found");try{return n.cb(t,...o)}catch(t){Yn(`${r}(${Ei(o)})`,t.message)}},MethodExpression:function(t,e){const r=e.method.name;let n;e.arguments.unshift(e.object);let o=e.arguments.map((e=>Ai(t,e)));const i=r+":"+o.map((t=>t.type)).join("#");if(so.has(i))n=so.get(i);else{const t=po("method",r,o);if("expected"in t||"type"in t&&"missing"===t.type){const e=o.slice(1).map((t=>Jn(t.type))).join(", "),n=`${r}(${Ei(o.slice(1))})`;"few"===t.type&&1===o.length?Yn(n,`Non empty argument list is required for method '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?Yn(n,`Method '${r}' has no matching override for given argument types: ${e}.`):Yn(n,`Unknown method name: ${r}.`)}n=t.func,t.conversions&&(o=vo(n,o))}if(!n)throw new Error("Method not found");try{return n.cb(t,...o)}catch(t){Yn(`${r}(${Ei(o.slice(1))})`,t.message)}},Variable:function(t,e){const r=e.id.name,n=t.variables.get(r);if(n)return function(t){return{type:t.getType(),value:t.getValue()}}(n);throw new Error(`Variable '${r}' is missing.`)}};function Ai(t,e){if(e.type in Ci)return Ci[e.type](t,e);throw new Error("Unsupported expression")}class ji{constructor(t){this.ast=t}apply(t,e,r,n=!1){try{const o=function(t,e,r){try{const n={variables:t,warnings:[],safeIntegerOverflow:!1,store:e},o=Ai(n,r);return n.safeIntegerOverflow&&n.warnings.push(st(new Error("Safe integer overflow, values may lose accuracy."),{level:"warn"})),{result:o,warnings:n.warnings}}catch(t){return{result:{type:"error",value:t.message},warnings:[]}}}(t,r,this.ast);o.warnings.forEach(e);const i=o.result;if("error"===i.type)return void e(st(new Error("Expression execution error"),{additional:{message:i.value}}));const a=i.value;if(a instanceof Date)return Ln(a);if("boolean"===i.type)return Boolean(a);if("color"===i.type){const t=ft(String(a));if(t)return Kn(t);e(st(new Error("Expression execution error")))}if("integer"===i.type)return a>2147483647||a<-2147483648?void e(st(new Error("Expression result is out of 32-bit int range"))):Number(a);if(!n&&("array"===i.type||"dict"===i.type))try{return JSON.stringify(a)}catch(t){return e(st(new Error(`Failed to stringify ${i.type}`))),`<${i.type}>`}return a}catch(t){return void e(st(new Error("Expression execution error")))}}}function Fi(t,e,r){if(t)if("string"==typeof t){if((n=t).indexOf("@{")>-1||n.indexOf("\\")>-1){e.hasExpression=!0;try{const r=function(t,e){var r,n={},o=(e=void 0!==e?e:{}).grammarSource,i={start:Ee,JsonStringContents:function(){var t,e,r;for(t=pe,e=[],r=Ce();r!==n;)e.push(r),r=Ce();return ve=t,At(e)}},a=Ee,s="@{",l="}",c="@{}",u="\\",d="?",p=":",v="!:",g="||",f="&&",h="==",m="!=",y=">=",b=">",_="<=",w="<",$="+",x="-",k="/",E="*",C="%",A="!",j=".",F="(",V=")",D=",",S="'",O="e",P="E",I=/^[^}]/,T=/^[^'}]/,M=/^[0-9]/,N=/^[a-zA-Z_]/,z=/^[a-zA-Z_0-9]/,R=/^[ \t\r\n]/,B=be("@{",!1),U=be("}",!1),W=be("@{}",!1),L=be("\\",!1),H={type:"any"},q=_e(["}"],!0,!1),J=be("?",!1),G=be(":",!1),X=be("!:",!1),Z=be("||",!1),Y=be("&&",!1),Q=be("==",!1),K=be("!=",!1),tt=be(">=",!1),et=be(">",!1),rt=be("<=",!1),nt=be("<",!1),ot=be("+",!1),it=be("-",!1),at=be("/",!1),st=be("*",!1),lt=be("%",!1),ct=be("!",!1),ut=be(".",!1),dt=be("(",!1),pt=be(")",!1),vt=be(",",!1),gt=we("string"),ft=be("'",!1),ht=_e(["'","}"],!0,!1),mt=we("integer"),yt=_e([["0","9"]],!1,!1),bt=we("number"),_t=be("e",!1),wt=be("E",!1),$t=_e([["a","z"],["A","Z"],"_"],!1,!1),xt=_e([["a","z"],["A","Z"],"_",["0","9"]],!1,!1),kt=we("whitespace"),Et=_e([" ","\t","\r","\n"],!1,!1),Ct=function(t){return t},At=function(t){return Cn(t)},jt=function(t){return t},Ft=function(){return""},Vt=function(){return ye()},Dt=function(){throw new Error("Error tokenizing '"+t+"'.")},St=function(){throw new Error("Error tokenizing '"+t+"'.")},Ot=function(t){return t},Pt=function(t){return jn(t)},It=function(){throw new Error("Error tokenizing '"+t+"'.")},Tt=function(t,e,r){return{type:"ConditionalExpression",test:t,consequent:e,alternate:r}},Mt=function(t,e){return{type:"TryExpression",test:t,alternate:e}},Nt=function(t,e){return En(t,e)},zt=function(t,e){return En(t,e)},Rt=function(t,e){return kn(t,e)},Bt=function(t,e){return kn(t,e)},Ut=function(t,e){return kn(t,e)},Wt=function(t,e){return kn(t,e)},Lt=function(t){return t},Ht=function(t){return t},qt=function(t,e){return{type:"UnaryExpression",operator:t,argument:e}},Jt=function(t,e){return function(t,e){return e.length?e.reduce(((t,e)=>{if(!e[5])throw new Error("Method expected after .");return{type:"MethodExpression",object:t,method:e[3],arguments:e[5][2]}}),t):t}(t,e)},Gt=function(t,e){return{type:"CallExpression",callee:t,arguments:e}},Xt=function(t,e){return[t,...e]},Zt=function(t){return t},Yt=function(t){return t},Qt=function(t){return Cn(t)},Kt=function(t){return t},te=function(){return""},ee=function(){return ye()},re=function(){throw new Error("Error tokenizing '"+t+"'.")},ne=function(){throw new Error("Error tokenizing '"+t+"'.")},oe=function(t){return t},ie=function(t){return jn(t)},ae=function(){throw new Error("Error tokenizing '"+t+"'.")},se=function(){return{type:"IntegerLiteral",value:An(ye())}},le=function(){return{type:"NumberLiteral",value:parseFloat(ye())}},ce=function(){return{type:"NumberLiteral",value:parseFloat(ye())}},ue=function(){const t=ye();if(/\.\./.test(t)||/\.$/.test(t))throw new Error("Unexpected token: .");return function(t){return"true"===t||"false"===t?{type:"BooleanLiteral",value:"true"===t}:{type:"Variable",id:{type:"Identifier",name:t}}}(t)},de=function(){return{type:"Identifier",name:ye()}},pe=0,ve=0,ge=[{line:1,column:1}],fe=0,he=[],me=0;if("startRule"in e){if(!(e.startRule in i))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=i[e.startRule]}function ye(){return t.substring(ve,pe)}function be(t,e){return{type:"literal",text:t,ignoreCase:e}}function _e(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function we(t){return{type:"other",description:t}}function $e(e){var r,n=ge[e];if(n)return n;for(r=e-1;!ge[r];)r--;for(n={line:(n=ge[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return ge[e]=n,n}function xe(t,e,r){var n=$e(t),i=$e(e),a={source:o,start:{offset:t,line:n.line,column:n.column},end:{offset:e,line:i.line,column:i.column}};return r&&o&&"function"==typeof o.offset&&(a.start=o.offset(a.start),a.end=o.offset(a.end)),a}function ke(t){pe<fe||(pe>fe&&(fe=pe,he=[]),he.push(t))}function Ee(){var t,e;return t=pe,Ue(),(e=Ae())!==n?(Ue(),ve=t,t=Ct(e)):(pe=t,t=n),t}function Ce(){var e,r,o,i,a;if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===me&&ke(B)),r!==n?(o=Ue(),(i=Ae())!==n?(Ue(),125===t.charCodeAt(pe)?(a=l,pe++):(a=n,0===me&&ke(U)),a!==n?(ve=e,e=jt(i)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,t.substr(pe,3)===c?(r=c,pe+=3):(r=n,0===me&&ke(W)),r!==n&&(ve=e,r=Ft()),(e=r)===n&&(e=pe,r=pe,me++,92===t.charCodeAt(pe)?(o=u,pe++):(o=n,0===me&&ke(L)),o===n&&(t.substr(pe,2)===s?(o=s,pe+=2):(o=n,0===me&&ke(B))),me--,o===n?r=void 0:(pe=r,r=n),r!==n?(t.length>pe?(o=t.charAt(pe),pe++):(o=n,0===me&&ke(H)),o!==n?(ve=e,e=Vt()):(pe=e,e=n)):(pe=e,e=n),e===n))){if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===me&&ke(B)),r!==n){if(o=[],I.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(q)),i!==n)for(;i!==n;)o.push(i),I.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(q));else o=n;o!==n?(125===t.charCodeAt(pe)?(i=l,pe++):(i=n,0===me&&ke(U)),i!==n?(ve=e,e=Dt()):(pe=e,e=n)):(pe=e,e=n)}else pe=e,e=n;e===n&&(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===me&&ke(B)),r!==n&&(ve=e,r=St()),(e=r)===n&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=n,0===me&&ke(L)),r!==n?(t.substr(pe,2)===s?(o=s,pe+=2):(o=n,0===me&&ke(B)),o!==n?(ve=e,e=Ot(o)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=n,0===me&&ke(L)),r!==n?(t.length>pe?(o=t.charAt(pe),pe++):(o=n,0===me&&ke(H)),o!==n?(ve=e,e=Pt(o)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=n,0===me&&ke(L)),r!==n&&(ve=e,r=It()),e=r))))}return e}function Ae(){var e,r,o,i,a,s;return e=pe,(r=je())!==n?(Ue(),63===t.charCodeAt(pe)?(o=d,pe++):(o=n,0===me&&ke(J)),o!==n?(Ue(),(i=Ae())!==n?(Ue(),58===t.charCodeAt(pe)?(a=p,pe++):(a=n,0===me&&ke(G)),a!==n?(Ue(),(s=Ae())!==n?(ve=e,e=Tt(r,i,s)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=je()),e}function je(){var e,r,o,i;return e=pe,(r=Fe())!==n?(Ue(),t.substr(pe,2)===v?(o=v,pe+=2):(o=n,0===me&&ke(X)),o!==n?(Ue(),(i=Ae())!==n?(ve=e,e=Mt(r,i)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=Fe()),e}function Fe(){var e,r,o,i,a,s,l,c;if(e=pe,(r=Ve())!==n){for(o=[],i=pe,a=Ue(),t.substr(pe,2)===g?(s=g,pe+=2):(s=n,0===me&&ke(Z)),s!==n?(l=Ue(),(c=Ve())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,a=Ue(),t.substr(pe,2)===g?(s=g,pe+=2):(s=n,0===me&&ke(Z)),s!==n?(l=Ue(),(c=Ve())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);ve=e,e=Nt(r,o)}else pe=e,e=n;return e}function Ve(){var e,r,o,i,a,s,l,c;if(e=pe,(r=De())!==n){for(o=[],i=pe,a=Ue(),t.substr(pe,2)===f?(s=f,pe+=2):(s=n,0===me&&ke(Y)),s!==n?(l=Ue(),(c=De())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,a=Ue(),t.substr(pe,2)===f?(s=f,pe+=2):(s=n,0===me&&ke(Y)),s!==n?(l=Ue(),(c=De())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);ve=e,e=zt(r,o)}else pe=e,e=n;return e}function De(){var e,r,o,i,a,s,l,c;if(e=pe,(r=Se())!==n){for(o=[],i=pe,a=Ue(),t.substr(pe,2)===h?(s=h,pe+=2):(s=n,0===me&&ke(Q)),s===n&&(t.substr(pe,2)===m?(s=m,pe+=2):(s=n,0===me&&ke(K))),s!==n?(l=Ue(),(c=Se())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,a=Ue(),t.substr(pe,2)===h?(s=h,pe+=2):(s=n,0===me&&ke(Q)),s===n&&(t.substr(pe,2)===m?(s=m,pe+=2):(s=n,0===me&&ke(K))),s!==n?(l=Ue(),(c=Se())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);ve=e,e=Rt(r,o)}else pe=e,e=n;return e}function Se(){var e,r,o,i,a,s,l,c;if(e=pe,(r=Oe())!==n){for(o=[],i=pe,a=Ue(),t.substr(pe,2)===y?(s=y,pe+=2):(s=n,0===me&&ke(tt)),s===n&&(62===t.charCodeAt(pe)?(s=b,pe++):(s=n,0===me&&ke(et)),s===n&&(t.substr(pe,2)===_?(s=_,pe+=2):(s=n,0===me&&ke(rt)),s===n&&(60===t.charCodeAt(pe)?(s=w,pe++):(s=n,0===me&&ke(nt))))),s!==n?(l=Ue(),(c=Oe())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,a=Ue(),t.substr(pe,2)===y?(s=y,pe+=2):(s=n,0===me&&ke(tt)),s===n&&(62===t.charCodeAt(pe)?(s=b,pe++):(s=n,0===me&&ke(et)),s===n&&(t.substr(pe,2)===_?(s=_,pe+=2):(s=n,0===me&&ke(rt)),s===n&&(60===t.charCodeAt(pe)?(s=w,pe++):(s=n,0===me&&ke(nt))))),s!==n?(l=Ue(),(c=Oe())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);ve=e,e=Bt(r,o)}else pe=e,e=n;return e}function Oe(){var e,r,o,i,a,s,l,c;if(e=pe,(r=Pe())!==n){for(o=[],i=pe,a=Ue(),43===t.charCodeAt(pe)?(s=$,pe++):(s=n,0===me&&ke(ot)),s===n&&(45===t.charCodeAt(pe)?(s=x,pe++):(s=n,0===me&&ke(it))),s!==n?(l=Ue(),(c=Pe())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,a=Ue(),43===t.charCodeAt(pe)?(s=$,pe++):(s=n,0===me&&ke(ot)),s===n&&(45===t.charCodeAt(pe)?(s=x,pe++):(s=n,0===me&&ke(it))),s!==n?(l=Ue(),(c=Pe())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);ve=e,e=Ut(r,o)}else pe=e,e=n;return e}function Pe(){var e,r,o,i,a,s,l,c;if(e=pe,(r=Ie())!==n){for(o=[],i=pe,a=Ue(),47===t.charCodeAt(pe)?(s=k,pe++):(s=n,0===me&&ke(at)),s===n&&(42===t.charCodeAt(pe)?(s=E,pe++):(s=n,0===me&&ke(st)),s===n&&(37===t.charCodeAt(pe)?(s=C,pe++):(s=n,0===me&&ke(lt)))),s!==n?(l=Ue(),(c=Ie())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,a=Ue(),47===t.charCodeAt(pe)?(s=k,pe++):(s=n,0===me&&ke(at)),s===n&&(42===t.charCodeAt(pe)?(s=E,pe++):(s=n,0===me&&ke(st)),s===n&&(37===t.charCodeAt(pe)?(s=C,pe++):(s=n,0===me&&ke(lt)))),s!==n?(l=Ue(),(c=Ie())!==n?i=a=[a,s,l,c]:(pe=i,i=n)):(pe=i,i=n);ve=e,e=Wt(r,o)}else pe=e,e=n;return e}function Ie(){var e,r,o,i;return e=pe,r=pe,me++,45===t.charCodeAt(pe)?(o=x,pe++):(o=n,0===me&&ke(it)),me--,o!==n?(pe=r,r=void 0):r=n,r!==n&&(o=Re())!==n?(ve=e,e=Lt(o)):(pe=e,e=n),e===n&&(e=pe,r=pe,me++,45===t.charCodeAt(pe)?(o=x,pe++):(o=n,0===me&&ke(it)),me--,o!==n?(pe=r,r=void 0):r=n,r!==n&&(o=ze())!==n?(ve=e,e=Ht(o)):(pe=e,e=n),e===n&&(e=pe,33===t.charCodeAt(pe)?(r=A,pe++):(r=n,0===me&&ke(ct)),r===n&&(43===t.charCodeAt(pe)?(r=$,pe++):(r=n,0===me&&ke(ot)),r===n&&(45===t.charCodeAt(pe)?(r=x,pe++):(r=n,0===me&&ke(it)))),r!==n?(o=Ue(),(i=Te())!==n?(ve=e,e=qt(r,i)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=Te()))),e}function Te(){var e,r,o,i,a,s,l,c,u,d,p,v,g,f,h;if(e=pe,r=function(){var e,r,o,i,a;return e=pe,(r=Be())!==n?(Ue(),40===t.charCodeAt(pe)?(o=F,pe++):(o=n,0===me&&ke(dt)),o!==n?(Ue(),(i=Me())!==n?(Ue(),41===t.charCodeAt(pe)?(a=V,pe++):(a=n,0===me&&ke(pt)),a!==n?(ve=e,e=Gt(r,i)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=function(){var e,r,o,i;return e=function(){var e,r,o,i,a,s,l,c,u,d,p;if(e=pe,N.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=n,0===me&&ke($t)),r!==n){if(o=[],i=[],z.test(t.charAt(pe))?(a=t.charAt(pe),pe++):(a=n,0===me&&ke(xt)),a!==n)for(;a!==n;)i.push(a),z.test(t.charAt(pe))?(a=t.charAt(pe),pe++):(a=n,0===me&&ke(xt));else i=n;for(i===n&&(i=pe,46===t.charCodeAt(pe)?(a=j,pe++):(a=n,0===me&&ke(ut)),a!==n?(s=pe,me++,l=pe,c=Ue(),(u=Be())!==n?(d=Ue(),40===t.charCodeAt(pe)?(p=F,pe++):(p=n,0===me&&ke(dt)),p!==n?l=c=[c,u,d,p]:(pe=l,l=n)):(pe=l,l=n),me--,l===n?s=void 0:(pe=s,s=n),s!==n?i=a=[a,s]:(pe=i,i=n)):(pe=i,i=n));i!==n;){if(o.push(i),i=[],z.test(t.charAt(pe))?(a=t.charAt(pe),pe++):(a=n,0===me&&ke(xt)),a!==n)for(;a!==n;)i.push(a),z.test(t.charAt(pe))?(a=t.charAt(pe),pe++):(a=n,0===me&&ke(xt));else i=n;i===n&&(i=pe,46===t.charCodeAt(pe)?(a=j,pe++):(a=n,0===me&&ke(ut)),a!==n?(s=pe,me++,l=pe,c=Ue(),(u=Be())!==n?(d=Ue(),40===t.charCodeAt(pe)?(p=F,pe++):(p=n,0===me&&ke(dt)),p!==n?l=c=[c,u,d,p]:(pe=l,l=n)):(pe=l,l=n),me--,l===n?s=void 0:(pe=s,s=n),s!==n?i=a=[a,s]:(pe=i,i=n)):(pe=i,i=n))}ve=e,e=ue()}else pe=e,e=n;return e}(),e===n&&(e=function(){var e,r,o,i;return me++,e=pe,39===t.charCodeAt(pe)?(r=S,pe++):(r=n,0===me&&ke(ft)),r!==n?(o=function(){var t,e,r;for(t=pe,e=[],r=Ne();r!==n;)e.push(r),r=Ne();return ve=t,Qt(e)}(),39===t.charCodeAt(pe)?(i=S,pe++):(i=n,0===me&&ke(ft)),i!==n?(ve=e,e=Yt(o)):(pe=e,e=n)):(pe=e,e=n),me--,e===n&&(r=n,0===me&&ke(gt)),e}(),e===n&&(e=Re())===n&&(e=ze())===n&&(e=pe,40===t.charCodeAt(pe)?(r=F,pe++):(r=n,0===me&&ke(dt)),r!==n?(Ue(),(o=Ae())!==n?(Ue(),41===t.charCodeAt(pe)?(i=V,pe++):(i=n,0===me&&ke(pt)),i!==n?(ve=e,e=Zt(o)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n))),e}()),e}(),r!==n){for(o=[],i=pe,a=Ue(),46===t.charCodeAt(pe)?(s=j,pe++):(s=n,0===me&&ke(ut)),s!==n?(l=Ue(),(c=Be())!==n?(u=Ue(),d=pe,40===t.charCodeAt(pe)?(p=F,pe++):(p=n,0===me&&ke(dt)),p!==n?(v=Ue(),(g=Me())!==n?(f=Ue(),41===t.charCodeAt(pe)?(h=V,pe++):(h=n,0===me&&ke(pt)),h!==n?d=p=[p,v,g,f,h]:(pe=d,d=n)):(pe=d,d=n)):(pe=d,d=n),d===n&&(d=null),i=a=[a,s,l,c,u,d]):(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,a=Ue(),46===t.charCodeAt(pe)?(s=j,pe++):(s=n,0===me&&ke(ut)),s!==n?(l=Ue(),(c=Be())!==n?(u=Ue(),d=pe,40===t.charCodeAt(pe)?(p=F,pe++):(p=n,0===me&&ke(dt)),p!==n?(v=Ue(),(g=Me())!==n?(f=Ue(),41===t.charCodeAt(pe)?(h=V,pe++):(h=n,0===me&&ke(pt)),h!==n?d=p=[p,v,g,f,h]:(pe=d,d=n)):(pe=d,d=n)):(pe=d,d=n),d===n&&(d=null),i=a=[a,s,l,c,u,d]):(pe=i,i=n)):(pe=i,i=n);ve=e,e=Jt(r,o)}else pe=e,e=n;return e}function Me(){var e,r,o,i,a,s;if(e=pe,(r=Ae())!==n){for(o=[],i=pe,Ue(),44===t.charCodeAt(pe)?(a=D,pe++):(a=n,0===me&&ke(vt)),a!==n?(Ue(),(s=Ae())!==n?i=s:(pe=i,i=n)):(pe=i,i=n);i!==n;)o.push(i),i=pe,Ue(),44===t.charCodeAt(pe)?(a=D,pe++):(a=n,0===me&&ke(vt)),a!==n?(Ue(),(s=Ae())!==n?i=s:(pe=i,i=n)):(pe=i,i=n);ve=e,e=Xt(r,o)}else pe=e,e=n;return e===n&&(e=Ue()),e}function Ne(){var e,r,o,i,a;if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===me&&ke(B)),r!==n?(o=Ue(),(i=Ae())!==n?(Ue(),125===t.charCodeAt(pe)?(a=l,pe++):(a=n,0===me&&ke(U)),a!==n?(ve=e,e=Kt(i)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,t.substr(pe,3)===c?(r=c,pe+=3):(r=n,0===me&&ke(W)),r!==n&&(ve=e,r=te()),(e=r)===n&&(e=pe,r=pe,me++,92===t.charCodeAt(pe)?(o=u,pe++):(o=n,0===me&&ke(L)),o===n&&(39===t.charCodeAt(pe)?(o=S,pe++):(o=n,0===me&&ke(ft)),o===n&&(t.substr(pe,2)===s?(o=s,pe+=2):(o=n,0===me&&ke(B)))),me--,o===n?r=void 0:(pe=r,r=n),r!==n?(t.length>pe?(o=t.charAt(pe),pe++):(o=n,0===me&&ke(H)),o!==n?(ve=e,e=ee()):(pe=e,e=n)):(pe=e,e=n),e===n))){if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===me&&ke(B)),r!==n){if(o=[],T.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(ht)),i!==n)for(;i!==n;)o.push(i),T.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(ht));else o=n;o!==n?(125===t.charCodeAt(pe)?(i=l,pe++):(i=n,0===me&&ke(U)),i!==n?(ve=e,e=re()):(pe=e,e=n)):(pe=e,e=n)}else pe=e,e=n;e===n&&(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===me&&ke(B)),r!==n&&(ve=e,r=ne()),(e=r)===n&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=n,0===me&&ke(L)),r!==n?(t.substr(pe,2)===s?(o=s,pe+=2):(o=n,0===me&&ke(B)),o!==n?(ve=e,e=oe(o)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=n,0===me&&ke(L)),r!==n?(t.length>pe?(o=t.charAt(pe),pe++):(o=n,0===me&&ke(H)),o!==n?(ve=e,e=ie(o)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=n,0===me&&ke(L)),r!==n&&(ve=e,r=ae()),e=r))))}return e}function ze(){var e,r,o,i;if(me++,e=pe,45===t.charCodeAt(pe)?(r=x,pe++):(r=n,0===me&&ke(it)),r===n&&(r=null),o=[],M.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(yt)),i!==n)for(;i!==n;)o.push(i),M.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(yt));else o=n;return o!==n?(ve=e,e=se()):(pe=e,e=n),me--,e===n&&(r=n,0===me&&ke(mt)),e}function Re(){var e,r,o,i,a,s,l,c,u,d;for(me++,e=pe,45===t.charCodeAt(pe)?(r=x,pe++):(r=n,0===me&&ke(it)),r===n&&(r=null),o=[],M.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(yt));i!==n;)o.push(i),M.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(yt));if(46===t.charCodeAt(pe)?(i=j,pe++):(i=n,0===me&&ke(ut)),i!==n){if(a=[],M.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=n,0===me&&ke(yt)),s!==n)for(;s!==n;)a.push(s),M.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=n,0===me&&ke(yt));else a=n;if(a!==n){if(s=pe,101===t.charCodeAt(pe)?(l=O,pe++):(l=n,0===me&&ke(_t)),l===n&&(69===t.charCodeAt(pe)?(l=P,pe++):(l=n,0===me&&ke(wt))),l!==n){if(43===t.charCodeAt(pe)?(c=$,pe++):(c=n,0===me&&ke(ot)),c===n&&(45===t.charCodeAt(pe)?(c=x,pe++):(c=n,0===me&&ke(it))),c===n&&(c=null),u=[],M.test(t.charAt(pe))?(d=t.charAt(pe),pe++):(d=n,0===me&&ke(yt)),d!==n)for(;d!==n;)u.push(d),M.test(t.charAt(pe))?(d=t.charAt(pe),pe++):(d=n,0===me&&ke(yt));else u=n;u!==n?s=l=[l,c,u]:(pe=s,s=n)}else pe=s,s=n;s===n&&(s=null),ve=e,e=le()}else pe=e,e=n}else pe=e,e=n;if(e===n){if(e=pe,45===t.charCodeAt(pe)?(r=x,pe++):(r=n,0===me&&ke(it)),r===n&&(r=null),o=[],M.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(yt)),i!==n)for(;i!==n;)o.push(i),M.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(yt));else o=n;if(o!==n)if(101===t.charCodeAt(pe)?(i=O,pe++):(i=n,0===me&&ke(_t)),i===n&&(69===t.charCodeAt(pe)?(i=P,pe++):(i=n,0===me&&ke(wt))),i!==n){if(43===t.charCodeAt(pe)?(a=$,pe++):(a=n,0===me&&ke(ot)),a===n&&(45===t.charCodeAt(pe)?(a=x,pe++):(a=n,0===me&&ke(it))),a===n&&(a=null),s=[],M.test(t.charAt(pe))?(l=t.charAt(pe),pe++):(l=n,0===me&&ke(yt)),l!==n)for(;l!==n;)s.push(l),M.test(t.charAt(pe))?(l=t.charAt(pe),pe++):(l=n,0===me&&ke(yt));else s=n;s!==n?(ve=e,e=ce()):(pe=e,e=n)}else pe=e,e=n;else pe=e,e=n}return me--,e===n&&(r=n,0===me&&ke(bt)),e}function Be(){var e,r,o,i;if(e=pe,N.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=n,0===me&&ke($t)),r!==n){for(o=[],z.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(xt));i!==n;)o.push(i),z.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===me&&ke(xt));ve=e,e=de()}else pe=e,e=n;return e}function Ue(){var e,r;for(me++,e=[],R.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=n,0===me&&ke(Et));r!==n;)e.push(r),R.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=n,0===me&&ke(Et));return me--,r=n,0===me&&ke(kt),e}if((r=a())!==n&&pe===t.length)return r;throw r!==n&&pe<t.length&&ke({type:"end"}),function(t,e,r){return new Fn(Fn.buildMessage(t,e),t,e,r)}(he,fe<t.length?t.charAt(fe):null,fe<t.length?xe(fe,fe+1):xe(fe,fe))}(t,{startRule:"JsonStringContents"}),n=Zn(r);return e.vars.push(...n),new ji(r)}catch(e){return void r(st(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>Fi(t,e,r)));if("object"==typeof t){const n={};for(const o in t)n[o]=Fi(t[o],e,r);return n}}var n;return t}function Vi(t,e,r,n,o=!1){if(t){if(t instanceof ji)return t.apply(e,r,n,o);if(Array.isArray(t))return t.map((t=>Vi(t,e,r,n)));if("object"==typeof t){const o={};for(const i in t)o[i]=Vi(t[i],e,r,n);return o}}return t}function Di(t,e,r){const n={vars:[],hasExpression:!1},o=Fi(t,n,e);return{vars:[...new Set(n.vars)],hasExpression:n.hasExpression,applyVars:(t,n)=>Vi(o,t,e,r,n)}}const Si={pagers:function(){return Q(new Map)}},Oi=new Map,Pi=new Map;function Ii(t){const e=Oi.get(t)||Q("");return Oi.has(t)||Oi.set(t,e),e}function Ti(t){const e=Pi.get(t)||new Map;return Pi.has(t)||Pi.set(t,e),e}class Mi{setVariable(t){const e=t.getName(),r=Ti(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Ii(this).set(e)}getVariable(t){return Ti(this).get(t)}list(){return Ti(this).values()}}function Ni(){return new Mi}function zi(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const Ri=new Set(["start","stop","pause","resume","cancel","reset"]);class Bi{constructor(t){zi(this,"timers",new Map),zi(this,"awaitActions",[]),this.logError=t.logError,this.applyVars=t.applyVars,this.hasVariableWithType=t.hasVariableWithType,this.setVariableValue=t.setVariableValue,this.execAnyActions=t.execAnyActions,this.visibilityHandler=()=>{"visible"===document.visibilityState?(this.awaitActions.forEach((({id:t,action:e})=>{this.execTimerAction(t,e)})),this.awaitActions=[],this.unholdAll()):this.holdAll()},document.addEventListener("visibilitychange",this.visibilityHandler)}destroy(){document.removeEventListener("visibilitychange",this.visibilityHandler);for(const[t,e]of this.timers)this.stopTimerTimeouts(e)}createTimer(t){null!=t&&t.id?t.duration||t.tick_interval&&(t.value_variable||t.tick_actions)?this.timers.set(t.id,{state:"stopped",definition:t}):this.logError(st(new Error("Misconfigured timer"),{additional:{id:t.id}})):this.logError(st(new Error("Missing timer id")))}execTimerAction(t,e){if(!(t&&e&&this.timers.has(t)&&Ri.has(e)))return void this.logError(st(new Error("Incorrect timer action"),{additional:{id:t,action:e}}));const r=e;if("visible"!==document.visibilityState)return void this.awaitActions.push({id:t,action:r});const n=this.timers.get(t);this[r](n)}stopTimerTimeouts(t){t.durationTimeout&&(clearTimeout(t.durationTimeout),t.durationTimeout=void 0),t.tickTimeout&&(clearTimeout(t.tickTimeout),t.tickTimeout=void 0)}async tickOrUnholdAction(t){const e=performance.now(),r=(t.durationPassed||0)+e-(t.durationStarted||0);t.duration&&r>t.duration||(this.updateVariable(t,r),await this.callActions(t,"tick"),void 0!==t.tickCount&&++t.tickCount)}startOrResume(t){t.state="running",t.hold=!1,t.durationStarted=performance.now();const e=t.duration;e&&(t.durationTimeout=window.setTimeout((async()=>{this.updateVariable(t,e),t.tickCountPredict&&void 0!==t.tickCount&&t.tickCount<t.tickCountPredict&&await this.callActions(t,"tick"),this.stop(t)}),Math.max(0,e-(t.durationPassed||0))));const r=t.tick;if(r){const e=()=>{const n=t.tickStarted=performance.now(),o=Math.max(0,r-(t.tickPassed||0));t.tickTimeout=window.setTimeout((async()=>{await this.tickOrUnholdAction(t),t.tickPassed=(performance.now()-n-o)%r,"running"===t.state&&e()}),o)};e()}}start(t){if("running"===t.state)return void this.logError(st(new Error("The timer is already running")));if("paused"===t.state)return void this.logError(st(new Error("The timer is paused")));const e=t.definition.value_variable;!e||this.hasVariableWithType(e,"integer")?(e&&this.setVariableValue(e,0),t.definition.duration&&(t.duration=this.applyVars(t.definition.duration)),t.definition.tick_interval&&(t.tick=this.applyVars(t.definition.tick_interval)),void 0!==t.duration&&t.duration<0||void 0!==t.tick&&t.tick<=0?this.logError(st(new Error("Incorrect timer properties"),{additional:{id:t.definition.id}})):(void 0!==t.duration&&void 0!==t.tick&&(t.tickCount=0,t.tickCountPredict=Math.floor(t.duration/t.tick)),this.startOrResume(t))):this.logError(st(new Error("Cannot find variable"),{additional:{name:e}}))}stop(t){"stopped"!==t.state?(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t),this.callActions(t,"end")):this.logError(st(new Error("The timer has already been stopped")))}pause(t){if("stopped"===t.state)return void this.logError(st(new Error("The timer has already been stopped")));if("paused"===t.state)return void this.logError(st(new Error("The timer has already been paused")));t.state="paused",this.stopTimerTimeouts(t);const e=performance.now();t.durationStarted&&(t.durationPassed=(t.durationPassed||0)+e-t.durationStarted),t.tickStarted&&(t.tickPassed=(t.tickPassed||0)+e-t.tickStarted);const r=t.definition.value_variable;r&&t.durationPassed&&this.setVariableValue(r,Math.round(t.durationPassed))}resume(t){"stopped"!==t.state?"running"!==t.state?this.startOrResume(t):this.logError(st(new Error("The timer is already running"))):this.logError(st(new Error("The timer has already been stopped")))}cancel(t){"stopped"!==t.state&&(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t))}reset(t){this.cancel(t),this.start(t)}updateVariable(t,e){const r=t.definition.value_variable;r&&this.setVariableValue(r,Math.round(e))}async callActions(t,e){const r=t.definition["end"===e?"end_actions":"tick_actions"];if(r){const t=this.applyVars(r);return this.execAnyActions(t,{processUrls:!1})}}holdAll(){for(const[t,e]of this.timers)"running"===e.state&&(e.hold=!0,this.stopTimerTimeouts(e))}async unholdAll(){for(const[t,e]of this.timers)if("running"===e.state&&e.hold){const t=performance.now();e.durationStarted&&(e.durationPassed=(e.durationPassed||0)+t-e.durationStarted),e.tickStarted&&(e.tickPassed=(e.tickPassed||0)+t-e.tickStarted),e.tick&&await this.tickOrUnholdAction(e),this.startOrResume(e)}}}function Ui(t,e,r,n){const{variable_name:o}=r;if(!o)return void e(st(new Error(`Incorrect ${r.type} action`),{additional:{name:o}}));const i=t.get(o);if(!i)return void e(st(new Error("Cannot find variable"),{additional:{name:o}}));const a=i.getType();"array"===a?n(i):e(st(new Error("Trying to insert value into the non-array"),{additional:{name:o,type:a}}))}const Wi={tooltip:"divkit-f1907",tooltip_visible:"divkit-e5914"},Li=W(((t,e,r,n)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$=i,x=i,k=i,E=i,C=i;var A,j,F,V;let{ownerNode:D}=e,{data:S}=e,{internalId:O}=e,{parentComponentContext:P}=e;b=l(f(at).isDesktop,(t=>y=t)),Date.now();return v((()=>{})),void 0===e.ownerNode&&r.ownerNode&&void 0!==D&&r.ownerNode(D),void 0===e.data&&r.data&&void 0!==S&&r.data(S),void 0===e.internalId&&r.internalId&&void 0!==O&&r.internalId(O),void 0===e.parentComponentContext&&r.parentComponentContext&&void 0!==P&&r.parentComponentContext(P),o=P.produceChildContext(S.div),a=P.getDerivedFromVars(S.position),k(),k=l(a,(t=>m=t)),s=P.getDerivedFromVars(null===(j=null===(A=S.offset)||void 0===A?void 0:A.x)||void 0===j?void 0:j.value),x(),x=l(s,(t=>h=t)),c=P.getDerivedFromVars(null===(V=null===(F=S.offset)||void 0===F?void 0:F.y)||void 0===V?void 0:V.value),$(),$=l(c,(t=>g=t)),u=P.getDerivedFromVars(S.animation_in),E(),E=l(u,(t=>_=t)),d=P.getDerivedFromVars(S.animation_out),C(),C=l(d,(t=>w=t)),p={visible:!1},$(),x(),k(),b(),E(),C(),` <div class="${I(Ft("tooltip",Wi,p),!0)+" "+I(y?nt:"",!0)}"${q({top:"",left:"",width:"",height:""})}${L("this",undefined,0)}>${R(bn,"Unknown").$$render(t,{componentContext:o},{},{})}</div>`})),Hi={root_platform_desktop:"divkit-ee112",menu:"divkit-cedbe",menu_visible:"divkit-e4801",menu__list:"divkit-c8df2",menu__item:"divkit-ffd4a"},qi=W(((t,e,r,n)=>{let o,i,a,{ownerNode:s}=e,{items:c}=e,{parentComponentContext:u}=e;const d=f(at),g=d.getCustomization("menuPopupClass")||"",h=d.getCustomization("menuItemClass")||"";a=l(d.isDesktop,(t=>i=t)),Date.now();const m=function(){const t=p();return(e,r,{cancelable:n=!1}={})=>{const o=t.$$.callbacks[e];if(o){const i=function(t,e,{bubbles:r=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:r,cancelable:n})}(e,r,{cancelable:n});return o.slice().forEach((e=>{e.call(t,i)})),!i.defaultPrevented}return!0}}();function y(){return m("close"),!0}return v((()=>{})),void 0===e.ownerNode&&r.ownerNode&&void 0!==s&&r.ownerNode(s),void 0===e.items&&r.items&&void 0!==c&&r.items(c),void 0===e.parentComponentContext&&r.parentComponentContext&&void 0!==u&&r.parentComponentContext(u),o={visible:!1},a(),` <div class="${I(Ft("menu",Hi,o),!0)+" "+I(i?nt:"",!0)+" "+I(g,!0)}"${q({top:"",left:"",width:"",height:""})}${L("this",undefined,0)}><ul${L("class",Hi.menu__list,0)}>${N(c,(e=>`<li>${R(Jt,"Actionable").$$render(t,{componentContext:u,actions:e.actions||e.action&&[e.action],cls:Hi.menu__item+" "+h,customAction:y},{},{default:()=>`${I(e.text)} `})} </li>`))}</ul></div>`}));let Ji=Q(!0),Gi=0;function Xi(){Ji.set(!1)}function Zi(){Ji.set(!0)}const Yi=new Set(["string","integer","number","url","color","boolean"]);function Qi(t,e){return t&&e?new Map([...t,...e]):t||e||void 0}const Ki=W(((t,e,r,n)=>{let o,i,a,s,c,u;var d,p,f,h;let{id:m}=e,{json:y={}}=e,{platform:b="auto"}=e,{theme:_="system"}=e,{globalVariablesController:w=new Mi}=e,{mix:x=""}=e,{customization:k={}}=e,{builtinProtocols:E=["http","https","tel","mailto","intent"]}=e,{extensions:C=new Map}=e,{onError:A}=e,{onStat:j}=e,{onCustomAction:F}=e,{onComponent:V}=e,{typefaceProvider:D=(t=>"")}=e,{fetchInit:S={}}=e,{tooltipRoot:O}=e,{customComponents:P}=e,{direction:T="ltr"}=e,{store:M}=e,z=Q("desktop"===b);if(s=l(z,(t=>a=t)),"auto"===b&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");z.set(!t.matches),t.addListener((()=>{z.set(!t.matches)}))}let B="light",U=null;const W=Q("rtl"===T?"rtl":"ltr");function H(t){_=t}function q(){return new Map}function J(){return new Map}function G(t){y=t}u=l(W,(t=>c=t));const X=new Set(E);let Z=!1,Y=!1;m||(Y=!0,ft(st(new Error('"id" prop is required'))));const tt={stateChange:!1},et=Ii(w),rt=Ti(w),ot=new Map,it=new Map,lt=new Map;let ct,ut=null,dt=0,pt=[];const vt=[];function gt(t,e,r,n=!1){const o=Di(e,t,M);if(!o.hasExpression)return e;const i=Qi(it,r);return o.applyVars(i,n)}function ft(t){A?A({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function ht(t,e){j&&j({type:t,action:e})}function yt(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type&&t.type in o;){if(({json:t,templateContext:e}=wn(t,e,o,ft)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}}let bt=0;function _t(t){return`${m}-${bt++}`}let wt={},$t={};function Et(t){Ct(gt(ft,t))}async function Ct(t,e){const r=t.url?String(t.url):"",n=t.typed;if(!Wt(t))return;const i=(null==e?void 0:e.logError)||ft;if(r)try{const n=r.replace(/div-action:\/\//,""),a=/([^?]+)\?(.+)/.exec(n);if(!a)return;const s=new URLSearchParams(a[2]);switch(a[1]){case"set_state":await async function(t){if(!t)throw new Error("Missing state id");let e=Tt,r=t.split("/");if(r=["root",...r],r.length<2||r.length%2!=0)throw new Error("Incorrect state id format");for(let t=0;t<r.length;t+=2){const n=r[t],o=r[t+1];let i=e.getChild(n);if(!i)return;await i.setState(o),e=i}}(s.get("state_id"));break;case"set_current_item":case"set_previous_item":case"set_next_item":case"scroll_to_start":case"scroll_to_end":case"scroll_backward":case"scroll_forward":case"scroll_to_position":!function(t,e,{item:r,step:n,overflow:o}){var i,a,s,l,c;if(!e)throw new Error(`Missing id for "${t}" action`);const u=Number(r);if("set_current_item"===t&&Number.isNaN(u))throw new Error(`Incorrect item for "${t}" action`);let d=Number(n);if(n||"set_previous_item"!==t&&"set_next_item"!==t||(d=1),!n&&("scroll_backward"===t||"scroll_forward"===t||"scroll_to_position"===t)||Number.isNaN(d))throw new Error(`Incorrect step value for "${t}" action`);if(o&&"clamp"!==o&&"ring"!==o)throw new Error(`Incorrect overflow value for "${t}" action`);o=o||"clamp";const p=Pt(e);if(p)switch(t){case"set_current_item":return void p.setCurrentItem(u);case"set_previous_item":return void p.setPreviousItem(d,o);case"set_next_item":return void p.setNextItem(d,o);case"scroll_to_start":return void(null===(i=p.scrollToStart)||void 0===i||i.call(p));case"scroll_to_end":return void(null===(a=p.scrollToEnd)||void 0===a||a.call(p));case"scroll_backward":return void(null===(s=p.scrollBackward)||void 0===s||s.call(p,d,o));case"scroll_forward":return void(null===(l=p.scrollForward)||void 0===l||l.call(p,d,o));case"scroll_to_position":null===(c=p.scrollToPosition)||void 0===c||c.call(p,d)}}(a[1],s.get("id"),{item:s.get("item"),step:s.get("step"),overflow:s.get("overflow")});break;case"set_variable":const l=s.get("name"),c=s.get("value");if(l&&null!==c){const t=it.get(l);if(t){const e=t.getType();"dict"===e||"array"===e?i(st(new Error(`Setting ${e} variables is not supported`),{additional:{name:l}})):t.set(c)}else i(st(new Error("Cannot find variable"),{additional:{name:l}}))}else i(st(new Error("Incorrect set_variable_action"),{additional:{url:n}}));break;case"timer":const u=s.get("action"),d=s.get("id");ut?ut.execTimerAction(d,u):i(st(new Error("Incorrect timer action"),{additional:{id:d,action:u}}));break;case"video":!function(t,e,r){const n=(null==r?void 0:r.logError)||ft;if(t){const r=Pt(t);r?"start"===e?r.start():"pause"===e?r.pause():n(st(new Error("Unknown video action"),{additional:{id:t,action:e}})):n(st(new Error("Video component is not found"),{additional:{id:t,action:e}}))}else n(st(new Error("Missing id in video action"),{additional:{action:e}}))}(s.get("id"),s.get("action"),e);break;case"download":!function(t,e,r){const n=(null==r?void 0:r.logError)||ft;if(t){let r;r="function"==typeof S?S(t):S,fetch(t,r).then((t=>{if(!t.ok)throw new Error("Response is not ok");return t.json()})).then((r=>{var i,a,s;if(r){if(r.templates)for(const t in r.templates)o.hasOwnProperty(t)||(o[t]=r.templates[t]);if(Array.isArray(null===(i=r.patch)||void 0===i?void 0:i.changes)){if("transactional"===r.patch.mode){const o=r.patch.changes.find((t=>{const e=Dt.get(t.id);if(!e)return!0;const r=Array.isArray(t.items)?t.items.length:0;return!(!e.isSingleMode||1===r)}));if(o)return n(st(new Error("Skipping transactional, child is not found or broken"),{additional:{url:t,id:o.id}})),void At(null===(a=e.download_callbacks)||void 0===a?void 0:a.on_fail_actions)}r.patch.changes.forEach((t=>{const e=Dt.get(t.id);e&&e.replaceWith(t.id,t.items)})),At(null===(s=e.download_callbacks)||void 0===s?void 0:s.on_success_actions)}}else n(st(new Error("Incorrect patch"),{additional:{url:t}}))})).catch((r=>{var o;n(st(new Error("Failed to download the patch"),{additional:{url:t,originalError:r}})),At(null===(o=e.download_callbacks)||void 0===o?void 0:o.on_fail_actions)}))}else n(st(new Error("Missing url in download action"),{additional:{url:t}}))}(s.get("url"),t,e);break;case"show_tooltip":!function(t,e,r){var n;const o=(null==r?void 0:r.logError)||ft;if(!t)return void o(st(new Error("Missing id in show_tooltip action")));const i=Ot.get(t);if(!i)return void o(st(new Error("Tooltip with the provided id is not found"),{additional:{id:t}}));if("true"!==e&&pt.some((e=>e.desc.id===t)))return;const a={internalId:++dt,ownerNode:i.onwerNode,desc:i.tooltip,timeoutId:0};pt=[...pt,a];const s=null!==(n=i.tooltip.duration)&&void 0!==n?n:5e3;s&&(a.timeoutId=window.setTimeout((()=>{a.timeoutId=0,pt=pt.filter((t=>t.internalId!==a.internalId))}),s))}(s.get("id"),s.get("multiple"),e);break;case"hide_tooltip":!function(t,e){const r=(null==e?void 0:e.logError)||ft;t?pt=pt.filter((e=>{const r=e.desc.id!==t;return!r&&e.timeoutId&&(clearTimeout(e.timeoutId),e.timeoutId=null),r})):r(st(new Error("Missing id in hide_tooltip action")))}(s.get("id"),e);break;case"set_stored_value":!function(t,e,r,n,o){const i=(null==t?void 0:t.logError)||ft;if(!M)return void i(st(new Error("Store is not configured")));let a=r;e&&a&&n&&o?Yi.has(n)?("integer"===n||"number"===n?a=Number(a):"boolean"===n&&(a="true"===a),M.setValue(e,n,a,Number(o))):i(st(new Error("Incorrect stored type"))):i(st(new Error("Missing required params for set_stored_value")))}(e,s.get("name"),s.get("value"),s.get("type"),s.get("lifetime"));break;default:i(st(new Error("Unknown type of action"),{additional:{url:r}}))}}catch(t){i(st(t,{additional:{url:r}}))}else if(n)switch(n.type){case"set_variable":{const{variable_name:t,value:e}=n;if(t&&e){const r=it.get(t);r?r.getType()===e.type?r.setValue(e.value):i(st(new Error("Trying to set value with invalid type"),{additional:{name:t,type:e.type}})):i(st(new Error("Cannot find variable"),{additional:{name:t}}))}else i(st(new Error("Incorrect set_variable action"),{additional:{name:t}}));break}case"array_insert_value":!function(t,e,r){const{variable_name:n,index:o,value:i}=r;!i||"number"!=typeof o&&void 0!==o?e(st(new Error("Incorrect array_insert_value action"),{additional:{name:n}})):Ui(t,e,r,(t=>{const a=t.getValue();if("number"==typeof o&&(o<0||o>a.length))e(st(new Error(`Index out of bound for mutation ${r.type}`),{additional:{name:n,index:o,length:a.length}}));else{const e=a.slice();"number"==typeof o?e.splice(o,0,i.value):e.push(i.value),t.setValue(e)}}))}(it,i,n);break;case"array_remove_value":!function(t,e,r){const{variable_name:n,index:o}=r;"number"==typeof o?Ui(t,e,r,(t=>{const i=t.getValue();if("number"==typeof o&&(o<0||o>=i.length))e(st(new Error(`Index out of bound for mutation ${r.type}`),{additional:{name:n,index:o,length:i.length}}));else{const e=i.slice();e.splice(o,1),t.setValue(e)}})):e(st(new Error("Incorrect array_remove_value action"),{additional:{name:n}}))}(it,i,n);break;case"copy_to_clipboard":!function(t,e){!e.content||"text"!==e.content.type&&"url"!==e.content.type||"string"!=typeof e.content.value?t(st(new Error("Incorrect action"),{additional:{action:e}})):"undefined"!=typeof navigator&&"clipboard"in navigator&&navigator.clipboard&&"writeText"in navigator.clipboard&&"function"==typeof navigator.clipboard.writeText?navigator.clipboard.writeText(e.content.value).catch((e=>{t(st(new Error("Failed to copy to the clipboard"),{additional:{originalError:String(e)}}))})):t(st(new Error("Clipboard is unavailable"),{additional:{action:e}}))}(i,n);break;case"focus_element":{const t=n.element_id&&St.get(n.element_id);t?t.focus():i(st(new Error("Incorrect focus_element action"),{additional:{elementId:n.element_id}}));break}case"clear_focus":try{document.activeElement instanceof HTMLElement&&document.activeElement.blur()}catch(t){}break;default:i(st(new Error("Unknown type of action"),{additional:{type:n.type}}))}}async function At(t,e={}){if(!t||!Array.isArray(t))return;const r=t.filter(Wt);for(let t=0;t<r.length;++t){let n=r[t];const o=n.url,i=n.typed;if(o){const t=xt(o);if(t)if(kt(t,X)){if(e.processUrls)if("_blank"===n.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=o)}else location.href=o}else"div-action"===t?(await Ct(n,e.componentContext),await $()):n.log_id&&(jt(n),await $())}else i?await Ct(n,e.componentContext):e.node&&Array.isArray(n.menu_items)&&n.menu_items.length&&(ct={items:n.menu_items,node:e.node})}r.forEach((t=>{t.log_id&&ht("click",t)}))}function jt(t){null==F||F(t)}const Ft=new Map,Dt=new Map,St=new Map,Ot=new Map;function Pt(t){if(Ft.has(t))return Ft.get(t);ft(st(new Error("Missing instance with id"),{additional:{id:t}}))}const It=new Map;g(at,{logStat:ht,hasTemplate:function(t){return t in o},processTemplate:yt,genId:_t,genClass:function(t){return`divkit-${_t()}`},execAction:Ct,execCustomAction:jt,isRunning:function(t){return tt[t]},setRunning:function(t,e){tt[t]=e},registerInstance:function(t,e){Ft.has(t)?ft(st(new Error("Duplicate instance id"),{additional:{id:t}})):Ft.set(t,e)},unregisterInstance:function(t){Ft.delete(t)},registerParentOf:function(t,e){Dt.set(t,e)},unregisterParentOf:function(t){Dt.delete(t)},registerTooltip:function(t,e){const r=e.id;r&&(Ot.has(r)&&ft(st(new Error("Duplicate tooltip id"),{additional:{id:r}})),Ot.set(r,{onwerNode:t,tooltip:e}))},unregisterTooltip:function(t){const e=t.id;e&&(Ot.delete(e),pt.some((t=>t.desc.id===e))&&(pt=pt.filter((t=>t.desc.id!==e))))},onTooltipClose:function(t){pt=pt.filter((e=>e.internalId!==t))},tooltipRoot:O,registerFocusable:function(t,e){St.set(t,e)},unregisterFocusable:function(t){St.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if($t[r]=$t[r]||0,++$t[r],wt[r])return wt[r];const n=`${_t()}-svg-filter`;return wt=Object.assign(Object.assign({},wt),{[r]:n}),n},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;$t[r]&&0==--$t[r]&&(wt=Object.keys(wt).reduce(((t,e)=>($t[e]&&(t[e]=wt[e]),t)),{}))},preparePrototypeVariables:function(t,e){const r=new Map,n=function(t,e,r){if(!(e in Lr))throw new Error("Unsupported variable type");return new Lr[e](t,r)}(t,"dict",e);return r.set(t,n),r},getStore:function(t){return It.has(t)||function(t){It.has(t)||It.set(t,Si[t]())}(t),It.get(t)},getCustomization:function(t){return null==k?void 0:k[t]},getBuiltinProtocols:function(){return X},getExtension:function(t,e){const r=C.get(t);if(r)return new r(e||{})},getExtensionContext:function(){return{variables:it,logError:ft}},registerTimeout:function(t){vt.push(t)},typefaceProvider:D,isDesktop:z,isPointerFocus:Ji,customComponents:P,direction:W,componentDevtool:void 0}),g(qt,{hasAction:()=>!1});const Tt={setState(t){throw new Error("Not implemented")},getChild(t){if(Mt&&Mt.has(t))return Mt.get(t);ft(st(new Error("Missing state block with id"),{additional:{id:t}}))}};let Mt=null;function Nt(t){if(t.type in zr){"integer"===t.type&&"number"==typeof t.value&&(t.value>Number.MAX_SAFE_INTEGER||t.value<Number.MIN_SAFE_INTEGER)&&ft(st(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=Rr(t.name,t.type,t.value);ot.set(t.name,e),it.set(t.name,e)}catch(e){ft(st(e,{additional:{name:t.name}}))}}}g(Vt,{registerInstance(t,e){Mt||(Mt=new Map),Mt.has(t)?ft(st(new Error("Duplicate state with id"),{additional:{id:t}})):Mt.set(t,e)},unregisterInstance(t){null==Mt||Mt.delete(t)},runVisibilityTransition:(t,e,r,n,o)=>Promise.resolve(),registerChildWithTransitionIn:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionOut:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionChange:(t,e,r,n)=>Promise.resolve(),hasTransitionChange:t=>!1,registerChild(t){},unregisterChild(t){}});const zt=null===(d=null==y?void 0:y.card)||void 0===d?void 0:d.variables;Array.isArray(zt)&&zt.forEach((t=>{if(t&&t.name){if(ot.has(t.name))return void ft(st(new Error("Duplicate variable"),{additional:{name:t.name}}));Nt(t)}}));const Rt=y.palette;Rt&&Rt[B].forEach((t=>{if(ot.has(t.name))ft(st(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=Rr(t.name,"color",t.color);ot.set(t.name,e),it.set(t.name,e)}catch(e){ft(st(e,{additional:{name:t.name}}))}}));for(const[t,e]of rt)it.has(t)||it.set(t,e);et.subscribe((t=>{if(t&&!it.has(t)){const e=rt.get(t);it.set(t,e);const r=lt.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const Bt=null===(f=null==y?void 0:y.card)||void 0===f?void 0:f.timers;if(Bt&&"undefined"!=typeof document){const t=ut=new Bi({logError:ft,applyVars:t=>gt(ft,t),hasVariableWithType:function(t,e){const r=it.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=it.get(t);r?r.setValue(e):ft(st(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:At});Bt.forEach((e=>t.createTimer(e)))}const Ut=function t(e){const r={json:{},path:[],templateContext:{},logError(t){t.additional=t.additional||{},t.additional.path=r.path.join("/"),ft(t)},execAnyActions:(t,e={})=>At(t,{componentContext:r,processUrls:e.processUrls,node:e.node}),getDerivedFromVars:(t,e,n=!1)=>function(t,e,r,n=!1){if(!e)return xn(e);const o=Qi(it,r),i=Di(e,t,M);return i.vars.length?K(i.vars.map((t=>o.get(t)||function(t){const e=lt.get(t)||Q(void 0);return lt.has(t)||lt.set(t,e),e}(t))).filter(mt),(()=>i.applyVars(o,n))):i.hasExpression?xn(i.applyVars(o)):xn(e)}(r.logError,t,Qi(r.variables,e),n),getJsonWithVars:(t,e,n=!1)=>gt(r.logError,t,Qi(r.variables,e),n),produceChildContext(e,n={}){const o=t(r);let i=e,a=r.templateContext;const{templateContext:s,json:l}=yt(i,a);return o.json=l,o.templateContext=s,o.origJson=e,void 0!==n.path&&o.path.push(String(n.path)),e.type&&!n.isRootState&&o.path.push(e.type),o.variables=Qi(r.variables,n.variables),n.fake&&(o.fakeElement=!0),n.isRootState&&(o.isRootState=!0),o},getVariable(t,e){const n=(r.variables||it).get(t);if(n){const o=n.getType();if(o!==e)return void r.logError(st(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:o}}))}return n}};return e?(r.parent=e,r.path=e.path.slice(),e.fakeElement&&(r.fakeElement=!0)):(r.json={type:"root"},r.isRootState=!0),r}();let Lt;v((()=>{Gi--,Gi||(window.removeEventListener("keydown",Xi),window.removeEventListener("pointerdown",Zi)),ut&&ut.destroy(),pt.forEach((t=>{t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=null)})),vt.forEach((t=>{clearTimeout(t)}))})),void 0===e.id&&r.id&&void 0!==m&&r.id(m),void 0===e.json&&r.json&&void 0!==y&&r.json(y),void 0===e.platform&&r.platform&&void 0!==b&&r.platform(b),void 0===e.theme&&r.theme&&void 0!==_&&r.theme(_),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==w&&r.globalVariablesController(w),void 0===e.mix&&r.mix&&void 0!==x&&r.mix(x),void 0===e.customization&&r.customization&&void 0!==k&&r.customization(k),void 0===e.builtinProtocols&&r.builtinProtocols&&void 0!==E&&r.builtinProtocols(E),void 0===e.extensions&&r.extensions&&void 0!==C&&r.extensions(C),void 0===e.onError&&r.onError&&void 0!==A&&r.onError(A),void 0===e.onStat&&r.onStat&&void 0!==j&&r.onStat(j),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==F&&r.onCustomAction(F),void 0===e.onComponent&&r.onComponent&&void 0!==V&&r.onComponent(V),void 0===e.typefaceProvider&&r.typefaceProvider&&void 0!==D&&r.typefaceProvider(D),void 0===e.fetchInit&&r.fetchInit&&void 0!==S&&r.fetchInit(S),void 0===e.tooltipRoot&&r.tooltipRoot&&void 0!==O&&r.tooltipRoot(O),void 0===e.customComponents&&r.customComponents&&void 0!==P&&r.customComponents(P),void 0===e.direction&&r.direction&&void 0!==T&&r.direction(T),void 0===e.store&&r.store&&void 0!==M&&r.store(M),void 0===e.setTheme&&r.setTheme&&void 0!==H&&r.setTheme(H),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==q&&r.getDebugVariables(q),void 0===e.getDebugAllVariables&&r.getDebugAllVariables&&void 0!==J&&r.getDebugAllVariables(J),void 0===e.setData&&r.setData&&void 0!==G&&r.setData(G),void 0===e.execAction&&r.execAction&&void 0!==Et&&r.execAction(Et),"light"===_||"dark"===_?B=_:"system"===_?"undefined"!=typeof matchMedia?(U||(U=matchMedia("(prefers-color-scheme: dark)"),U.addListener((function(){"system"===_&&U&&(B=U.matches?"dark":"light")}))),B=U.matches?"dark":"light"):B="light":ft(st(new Error("Unsupported theme"))),B&&Rt&&Rt[B].forEach((t=>{const e=it.get(t.name);e&&e.setValue(t.color)}));{Z=!1;const t=function(t){if(!t)return st(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return st(new Error("Missing card"));if(!e.states||!e.states.length)return st(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in yn)return st(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return st(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return st(new Error("Missing state_id"),{additional:{index:t}})}return null}(y);t&&(Z=!0,ft(t))}if(o=y.templates||{},(null===(p=null==y?void 0:y.card)||void 0===p?void 0:p.variables)&&Array.isArray(y.card.variables)&&y.card.variables!==zt&&y.card.variables.forEach((t=>{t&&t.name&&!ot.has(t.name)&&Nt(t)})),i=null===(h=null==y?void 0:y.card)||void 0===h?void 0:h.states,i&&!Z&&!Y){const t={type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:i.map((t=>({state_id:t.state_id.toString(),div:t.div})))};Lt=Ut.produceChildContext(t,{isRootState:!0})}return s(),u(),Z||Y||!Lt?"":`<div class="${I("divkit-b023c",!0)+I(a?` ${nt}`:"",!0)+I(x?` ${x}`:"",!0)}"${L("dir",c,0)}>${R(_n,"RootSvgFilters").$$render(t,{svgFiltersMap:wt},{},{})} ${R(bn,"Unknown").$$render(t,{componentContext:Lt},{},{})} ${pt?`${N(pt,(e=>`${R(Li,"TooltipView").$$render(t,{ownerNode:e.ownerNode,data:e.desc,internalId:e.internalId,parentComponentContext:Lt},{},{})}`))}`:""} ${ct?`${R(qi,"Menu").$$render(t,{ownerNode:ct.node,items:ct.items,parentComponentContext:Lt},{},{})}`:""}</div>`})),ta=Ki;function ea(t){return ta.render(t).html}var ra=e.XQ,na=e.rz,oa=e.XX;export{ra as createGlobalVariablesController,na as createVariable,oa as render};
1
+ var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{XQ:()=>Ea,rz:()=>hn,XX:()=>Ja}),new Set;const r="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function n(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class o{constructor(t){n(this,"_listeners","WeakMap"in r?new WeakMap:void 0),n(this,"_observer",void 0),n(this,"options",void 0),this.options=t}observe(t,e){return this._listeners.set(t,e),this._getObserver().observe(t,this.options),()=>{this._listeners.delete(t),this._observer.unobserve(t)}}_getObserver(){var t;return null!==(t=this._observer)&&void 0!==t?t:this._observer=new ResizeObserver((t=>{for(const r of t){var e;o.entries.set(r.target,r),null===(e=this._listeners.get(r.target))||void 0===e||e(r)}}))}}function i(){}function a(t){return t()}function s(t){t.forEach(a)}function l(t,...e){if(null==t){for(const t of e)t(void 0);return i}const r=t.subscribe(...e);return r.unsubscribe?()=>r.unsubscribe():r}function c(t,e,r){return t.set(r),e}let u;function d(t){u=t}function p(){if(!u)throw new Error("Function called outside component initialization");return u}function v(t){p().$$.on_destroy.push(t)}function f(t,e){return p().$$.context.set(t,e),e}function g(t){return p().$$.context.get(t)}o.entries="WeakMap"in r?new WeakMap:void 0,new Map;const h=[],m=[];let y=[];const b=[],_=Promise.resolve();let w=!1;function $(){return w||(w=!0,_.then(E)),_}function x(t){y.push(t)}const k=new Set;let j=0;function E(){if(0!==j)return;const t=u;do{try{for(;j<h.length;){const t=h[j];j++,d(t),C(t.$$)}}catch(t){throw h.length=0,j=0,t}for(d(null),h.length=0,j=0;m.length;)m.pop()();for(let t=0;t<y.length;t+=1){const e=y[t];k.has(e)||(k.add(e),e())}y.length=0}while(h.length);for(;b.length;)b.pop()();w=!1,k.clear(),d(t)}function C(t){if(null!==t.fragment){t.update(),s(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(x)}}new Set;const A=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),F=/^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;function D(t){return F.test(t)||"!doctype"===t.toLowerCase()}const O=/[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;function P(t,e){const r=Object.assign({},...t);if(e){const t=e.classes,n=e.styles;t&&(null==r.class?r.class=t:r.class+=" "+t),n&&(null==r.style?r.style=H(n):r.style=H(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),n=e.slice(0,t).trim(),o=e.slice(t+1).trim();n&&(r[n]=o)}for(const t in e){const n=e[t];n?r[t]=n:delete r[t]}return r}(r.style,n)))}let n="";return Object.keys(r).forEach((t=>{if(O.test(t))return;const e=r[t];!0===e?n+=" "+t:A.has(t.toLowerCase())?e&&(n+=" "+t):null!=e&&(n+=` ${t}="${e}"`)})),n}const S=/[&"]/g,V=/[&<]/g;function T(t,e=!1){const r=String(t),n=e?S:V;n.lastIndex=0;let o="",i=0;for(;n.test(r);){const t=n.lastIndex-1,e=r[t];o+=r.substring(i,t)+("&"===e?"&amp;":'"'===e?"&quot;":"&lt;"),i=t+1}return o+r.substring(i)}function I(t){return"string"==typeof t||t&&"object"==typeof t?T(t,!0):t}function M(t){const e={};for(const r in t)e[r]=I(t[r]);return e}function N(t,e){var r;t=void 0!==(null==(r=t)?void 0:r.length)?r:Array.from(r);let n="";for(let r=0;r<t.length;r+=1)n+=e(t[r],r);return n}const z={$$render:()=>""};function U(t,e){if(!t||!t.$$render)throw"svelte:component"===e&&(e+=" this={...}"),new Error(`<${e}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${e}>.`);return t}let R,B;function L(t){function e(e,r,n,o,i){const a=u;d({$$:{on_destroy:R,context:new Map(i||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const s=t(e,r,n,o);return d(a),s}return{render:(t={},{$$slots:r={},context:n=new Map}={})=>{R=[];const o={title:"",head:"",css:new Set},i=e(o,t,{},r,n);return s(R),{html:i,css:{code:Array.from(o.css).map((t=>t.code)).join("\n"),map:null},head:o.title+o.head}},$$render:e}}function W(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${T(e,!0)}"`}`}function H(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${I(t[e])};`)).join(" ")}function q(t){const e=H(t);return e?` style="${e}"`:""}function J(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?J(Object(r),!0).forEach((function(e){G(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function G(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function X(t,e,r,n){var o;const i=null===(o=r[t])||void 0===o?void 0:o.type;if(e="Boolean"===i&&"boolean"!=typeof e?null!=e:e,!n||!r[t])return e;if("toAttribute"===n)switch(i){case"Object":case"Array":return null==e?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return null==e?null:e;default:return e}else switch(i){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return null!=e?+e:e}}"function"==typeof HTMLElement&&(B=class extends HTMLElement{constructor(t,e,r){super(),G(this,"$$ctor",void 0),G(this,"$$s",void 0),G(this,"$$c",void 0),G(this,"$$cn",!1),G(this,"$$d",{}),G(this,"$$r",!1),G(this,"$$p_d",{}),G(this,"$$l",{}),G(this,"$$l_u",new Map),this.$$ctor=t,this.$$s=e,r&&this.attachShadow({mode:"open"})}addEventListener(t,e,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const r=this.$$c.$on(t,e);this.$$l_u.set(e,r)}super.addEventListener(t,e,r)}removeEventListener(t,e,r){if(super.removeEventListener(t,e,r),this.$$c){const t=this.$$l_u.get(e);t&&(t(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn)return;function t(t){return()=>{let e;return{c:function(){e=function(t){return document.createElement(t)}("slot"),"default"!==t&&function(t,e,r){null==r?t.removeAttribute(e):t.getAttribute(e)!==r&&t.setAttribute(e,r)}(e,"name",t)},m:function(t,r){!function(t,e,r){t.insertBefore(e,r||null)}(t,e,r)},d:function(t){t&&function(t){t.parentNode&&t.parentNode.removeChild(t)}(e)}}}}const e={},r=function(t){const e={};return t.childNodes.forEach((t=>{e[t.slot||"default"]=!0})),e}(this);for(const o of this.$$s)o in r&&(e[o]=[t(o)]);for(const i of this.attributes){const a=this.$$g_p(i.name);a in this.$$d||(this.$$d[a]=X(a,i.value,this.$$p_d,"toProp"))}this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:Y(Y({},this.$$d),{},{$$slots:e,$$scope:{ctx:[]}})});const n=()=>{this.$$r=!0;for(const t in this.$$p_d)if(this.$$d[t]=this.$$c.$$.ctx[this.$$c.$$.props[t]],this.$$p_d[t].reflect){const e=X(t,this.$$d[t],this.$$p_d,"toAttribute");null==e?this.removeAttribute(t):this.setAttribute(this.$$p_d[t].attribute||t,e)}this.$$r=!1};this.$$c.$$.after_update.push(n),n();for(const s in this.$$l)for(const l of this.$$l[s]){const c=this.$$c.$on(s,l);this.$$l_u.set(l,c)}this.$$l={}}}attributeChangedCallback(t,e,r){var n;this.$$r||(t=this.$$g_p(t),this.$$d[t]=X(t,r,this.$$p_d,"toProp"),null===(n=this.$$c)||void 0===n||n.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{this.$$cn||(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(t){return Object.keys(this.$$p_d).find((e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t))||t}});const Z=[];function Q(t,e=i){let r;const n=new Set;function o(e){if(i=e,((o=t)!=o?i==i:o!==i||o&&"object"==typeof o||"function"==typeof o)&&(t=e,r)){const e=!Z.length;for(const e of n)e[1](),Z.push(e,t);if(e){for(let t=0;t<Z.length;t+=2)Z[t][0](Z[t+1]);Z.length=0}}var o,i}function a(e){o(e(t))}return{set:o,update:a,subscribe:function(s,l=i){const c=[s,l];return n.add(c),1===n.size&&(r=e(o,a)||i),s(t),()=>{n.delete(c),0===n.size&&r&&(r(),r=null)}}}}function K(t,e,r){const n=!Array.isArray(t),o=n?[t]:t;if(!o.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const a=e.length<2;return c=(t,r)=>{let c=!1;const u=[];let d=0,p=i;const v=()=>{if(d)return;p();const o=e(n?u[0]:u,t,r);a?t(o):p="function"==typeof o?o:i},f=o.map(((t,e)=>l(t,(t=>{u[e]=t,d&=~(1<<e),c&&v()}),(()=>{d|=1<<e}))));return c=!0,v(),function(){s(f),p(),c=!1}},{subscribe:Q(r,c).subscribe};var c}const tt="divkit-bd259",et="divkit-d9099",rt="divkit-c016b",nt="divkit-ee112",ot="divkit-aa145",it="divkit-f0cba",at=Symbol("root");function st(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const lt={"text-range":"divkit-faf07",text:"divkit-d9b0e",text_halign_start:"divkit-e70de",text_halign_center:"divkit-e1659",text_halign_end:"divkit-e48b4",text_valign_start:"divkit-b7b70",text_valign_center:"divkit-ef58e",text_valign_end:"divkit-d4206",text_valign_baseline:"divkit-e0c6c",text__inner:"divkit-b8528",text_singleline:"divkit-ef11c",text_multiline:"divkit-ee8e3",text_truncate_none:"divkit-c6ea1",text__inner_gradient:"divkit-cb8e0",text__image:"divkit-bf6e2",text__image_hidden:"divkit-f1002","text_has-focus-color":"divkit-cb341"},ct={outer:"divkit-d65a7","outer_hide-on-transition-in":"divkit-a6d12","outer_halign-self_start":"divkit-cc452","outer_halign-self_center":"divkit-b8331","outer_halign-self_end":"divkit-c573c","outer_halign-self_stretch":"divkit-dcc74","outer_valign-self_start":"divkit-e8077","outer_valign-self_center":"divkit-d40a7","outer_valign-self_end":"divkit-e9f84","outer_valign-self_stretch":"divkit-b7aa3","outer_parent-flex_vertical":"divkit-c143f","outer_parent-flex_horizontal":"divkit-ef302","outer_valign-self_baseline":"divkit-e72b5",outer_width_content:"divkit-b8f4d",outer_height_content:"divkit-faa66","outer_width-constrained":"divkit-d3211","outer_parent-grid":"divkit-ff439","outer_height-constrained":"divkit-a5256","outer_parent-overlap":"divkit-dab2d","outer_parent-overlap-absolute":"divkit-d43fb","outer_scroll-snap_center":"divkit-d9e38","outer_scroll-snap_start":"divkit-efd1e",outer__border:"divkit-d4056",outer_visibility_invisible:"divkit-f018b",outer_visibility_gone:"divkit-e784b","outer_has-action-animation":"divkit-f4980","outer_has-custom-focus":"divkit-c7f14"};function ut(t){if(!t)return;let e="";for(const r in t)if(t.hasOwnProperty(r)){if(!t[r]&&0!==t[r])continue;e&&(e+=";"),e+=r+":"+String(t[r])}return e||void 0}function dt(t){if("number"!=typeof t&&"string"!=typeof t||!t)return"0";const e=Number(t);return Number.isNaN(e)?"0":Math.ceil(1e3*e)/1e4+"em"}function pt(t){let e=dt(t);return"0"===e&&(e+="em"),e}function vt(t,e){for(;t.length<e;)t="0"+t;return t}function ft(t,e=1,r="transparent"){if("#"!==(t=("string"==typeof t&&t||"").toLowerCase()).charAt(0))return r;const n=gt(t);return n?(n.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>vt(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(n)):r}function gt(t){const e=t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])$/i)||t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i);if(e){if(5===e.length){const[t,r,n,o,i]=e,a=2===n.length?n:n+n,s=2===o.length?o:o+o,l=2===i.length?i:i+i,c=2===r.length?r:r+r;return{a:parseInt(c,16),r:parseInt(a,16),g:parseInt(s,16),b:parseInt(l,16)}}const[t,r,n,o]=e,i=2===r.length?r:r+r,a=2===n.length?n:n+n,s=2===o.length?o:o+o;return{a:255,r:parseInt(i,16),g:parseInt(a,16),b:parseInt(s,16)}}return null}function ht(t){let e=String(t);return e.indexOf("&")>-1&&(e=e.replace(/&/g,"&amp;")),e.indexOf("<")>-1&&(e=e.replace(/</g,"&lt;")),e.indexOf(">")>-1&&(e=e.replace(/>/g,"&gt;")),e.indexOf('"')>-1&&(e=e.replace(/"/g,"&quot;")),e}const mt=Boolean;function yt(t){if(1===t.length&&"solid"===t[0].type)return{color:ft(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=ft(t.bg.color||"transparent");return{size:void 0,pos:void 0,image:`linear-gradient(to bottom,${e},${e})`}}({bg:t}):"gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const r=t.bg.colors.filter(mt);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>ft(t))).join(",")+")"}:void 0}({bg:t}):"image"===t.type?function(t){var e;const r=null===(e=t.bg)||void 0===e?void 0:e.image_url;if(r)return{size:wt(t.bg.scale),pos:$t(t.bg),image:'url("'+ht(r)+'")'}}({bg:t}):"radial_gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const r=t.bg.colors.filter(mt);if(!r.length)return;const n=t.bg.radius;let o;n&&"object"==typeof n&&"type"in n&&void 0!==n.value&&("fixed"===n.type?o=pt(n.value):"relative"===n.type&&(o=bt[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${o||"farthest-corner"} at ${_t(t.bg.center_x)} ${_t(t.bg.center_y)},`+r.map((t=>ft(t))).join(",")+")"}}({bg:t}):void 0)).filter(mt).reverse().reduce((function(t,e){return t.image.push(e.image),t.size.push(e.size||"auto"),t.position.push(e.pos||"50% 50%"),t}),{image:[],size:[],position:[]});return{image:e.image.join(","),size:e.size.join(","),position:e.position.join(",")}}const bt={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function _t(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return pt(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function wt(t){return"fit"===t?"contain":"stretch"===t?"fill":"no_scale"===t?"none":"cover"}function $t(t){let e,r;return e="left"===t.content_alignment_horizontal?"0%":"right"===t.content_alignment_horizontal?"100%":"50%",r="top"===t.content_alignment_vertical?"0%":"bottom"===t.content_alignment_vertical?"100%":"50%",e+" "+r}function xt(t){if(t.startsWith("tel:"))return"tel";const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}function kt(t,e){return e.has(t)}function jt(t,e){const r=Number(t);return Number.isNaN(r)||r<0?e:r}function Et(t,e,r){return"number"==typeof e&&(t&&e>0&&e<=100||!t&&e>=0&&e<100)?e:r}function Ct(t){return 0!==t.is_enabled&&!1!==t.is_enabled&&void 0!==t.index}function At(t,e){e&&t.push(e)}function Ft(t,e,r){const n=[];At(n,e[t]);for(const o in r)if(r.hasOwnProperty(o)){const i=r[o];i&&At(n,e[`${t}_${o}`+("string"==typeof i?`_${i}`:"")])}return n.join(" ")}const Dt=Symbol("state");function Ot(t,e){var r,n;const o=t.top||0,i=(null!==(r="ltr"===e?t.end:t.start)&&void 0!==r?r:t.right)||0,a=t.bottom||0,s=(null!==(n="ltr"===e?t.start:t.end)&&void 0!==n?n:t.left)||0;return 0===o&&0===i&&0===a&&0===s?"":dt(o)+" "+dt(i)+" "+dt(a)+" "+dt(s)}function Pt(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!Number.isNaN(e)}function St(t){return Pt(t)&&t>=0}function Vt(t,e,r){var n,o;if(!t)return r;const i=[t.top,null!==(n="ltr"===e?t.end:t.start)&&void 0!==n?n:t.right,t.bottom,null!==(o="ltr"===e?t.start:t.end)&&void 0!==o?o:t.left];for(let t=0;t<i.length;++t)if(i[t]&&!St(i[t]))return r;return Ot(t,e)}const Tt=Object.prototype.hasOwnProperty;function It(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return Object.is(t,e);const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++){const o=r[n];if(!Tt.call(e,o)||!It(t[o],e[o]))return!1}return!0}function Mt(t,e){return It(t,e)?e:t}function Nt(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function zt(t,e){const r=Number(t);return Number.isNaN(r)?e:r}function Ut(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...Ut(t))})):e.push(t),e}function Rt(t,e){if(!t||"object"!=typeof t)return e;const r=["top","right","bottom","left"];for(let n=0;n<r.length;++n)if(t[r[n]]&&!St(t[r[n]]))return e;return t}function Bt(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>dt((t||e)/r*10))).join(" ")}function Lt(t){return 0!==t.is_enabled&&!1!==t.is_enabled}let Wt;function Ht(){}const qt=Symbol("action"),Jt=L(((t,e,r,n)=>{let{componentContext:o}=e,{id:i=""}=e,{actions:a}=e,{doubleTapActions:s}=e,{longTapActions:l}=e,{cls:c=""}=e,{style:u=null}=e,{attrs:d}=e,{use:p=Ht}=e,{customAction:h=null}=e,{isNativeActionAnimation:m=!0}=e,{hasInnerFocusable:y=!1}=e;const b=g(at),_=g(qt);let w;f(qt,{hasAction:()=>Boolean(_.hasAction()||(null==a?void 0:a.length))});let $,x="",k=!1;if(v((()=>{i&&!y&&b.unregisterFocusable(i),clearTimeout(undefined)})),void 0===e.componentContext&&r.componentContext&&void 0!==o&&r.componentContext(o),void 0===e.id&&r.id&&void 0!==i&&r.id(i),void 0===e.actions&&r.actions&&void 0!==a&&r.actions(a),void 0===e.doubleTapActions&&r.doubleTapActions&&void 0!==s&&r.doubleTapActions(s),void 0===e.longTapActions&&r.longTapActions&&void 0!==l&&r.longTapActions(l),void 0===e.cls&&r.cls&&void 0!==c&&r.cls(c),void 0===e.style&&r.style&&void 0!==u&&r.style(u),void 0===e.attrs&&r.attrs&&void 0!==d&&r.attrs(d),void 0===e.use&&r.use&&void 0!==p&&r.use(p),void 0===e.customAction&&r.customAction&&void 0!==h&&r.customAction(h),void 0===e.isNativeActionAnimation&&r.isNativeActionAnimation&&void 0!==m&&r.isNativeActionAnimation(m),void 0===e.hasInnerFocusable&&r.hasInnerFocusable&&void 0!==y&&r.hasInnerFocusable(y),Array.isArray(a)&&null!=a&&a.length)for(let t=0;t<a.length;++t){const e=a[t].url;if(e){x=e,$=a[t].target||void 0;break}}return Array.isArray(a)&&null!=a&&a.length&&_.hasAction()&&(x="",o.logError(st(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:a}}))),k=Boolean(h),x&&!kt(xt(x),b.getBuiltinProtocols())?(x="",k=!0):!x&&Array.isArray(a)&&null!=a&&a.length&&(k=!0,a.some((t=>t.url||t.typed||t.menu_items))||o.logError(st(new Error("The component has a list of actions, but does not have a real action"),{level:"warn",additional:{actions:a}}))),x?`<a${P([{href:I(x)},{target:I($)},{style:I(u)},{class:T(c,!0)+" "+T(m?tt:et,!0)+" "+T(null!=l&&l.length?it:"",!0)},M(d)],{})}${W("this",w,0)}>${n.default?n.default({}):""}</a>`:` <span${P([{class:T(c,!0)+T(k?` ${m?tt:et} ${rt}`:"",!0)+" "+T(null!=l&&l.length?it:"",!0)},{style:I(u)},{role:I(k?"button":null)},{tabindex:I(k?0:null)},M(d)],{})}${W("this",w,0)}>${n.default?n.default({}):""}</span>`})),Yt="divkit-b921d";function Gt(t){return Pt(t)&&t>0}function Xt(t,e){return t.map((t=>{if(t)if("blur"===t.type){if(Gt(t.radius))return`blur(${pt(t.radius/2)})`}else{if("rtl_mirror"===t.type)return;e(st(new Error("Unknown filter"),{level:"warn",additional:{filter:t.type}}))}else e(st(new Error("Incorrect filter"),{level:"warn"}))})).filter(Boolean).join(" ")}const Zt=L(((t,e,r,n)=>{let o,{direction:i}=e,{componentContext:a}=e,{background:s=[]}=e,{radius:l=""}=e;return void 0===e.direction&&r.direction&&void 0!==i&&r.direction(i),void 0===e.componentContext&&r.componentContext&&void 0!==a&&r.componentContext(a),void 0===e.background&&r.background&&void 0!==s&&r.background(s),void 0===e.radius&&r.radius&&void 0!==l&&r.radius(l),o=s.map((t=>{const e={},r={style:e};if("nine_patch_image"===t.type&&t.insets)e["border-image"]=`url("${t.image_url}") ${t.insets.top||0} ${t.insets.right||0} ${t.insets.bottom||0} ${t.insets.left||0} fill`,e["border-image-width"]="auto";else{const n=yt([t]);"solid"===t.type&&(e["background-color"]=n.color),"gradient"===t.type&&(e["background-image"]=n.image),"image"===t.type&&(e.opacity=Number(t.alpha),r.image_url=t.image_url,e["object-fit"]=n.size,e["object-position"]=n.position,Array.isArray(t.filters)&&t.filters.length&&(e.filter=Xt(t.filters,a.logError),"rtl"===i&&t.filters.some((t=>"rtl_mirror"===t.type))&&(e.transform="scale(-1,1)")))}return r})),`<span${W("class","divkit-bf253"+(l?" divkit-dcad7":""),0)}${q({"border-radius":l})}>${N(o,(t=>t.image_url?`<img${W("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${W("class",Yt,0)}${W("style",ut(t.style),0)}>`:`<span${W("class",Yt,0)}${W("style",ut(t.style),0)}></span>`))}</span>`})),Qt=Zt;function Kt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function te(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Kt(Object(r),!0).forEach((function(e){ee(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Kt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ee(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const re={left:"start",center:"center",right:"end",start:"start",end:"end"},ne={left:"end",center:"center",right:"start",start:"start",end:"end"},oe={top:"start",center:"center",bottom:"end",baseline:"baseline"},ie=L(((t,e,r,n)=>{var o;let a,s,c,u,d,p,f,h,m,y,b,_,w,x,k,j,E,C,A,F,D,O,P,S,V,T,I,M,N,z,R,B,L,H,q,J,Y,G,X,Z,Q,tt,et,rt,nt,ot,it=i,lt=i,vt=i,gt=i,ht=i,bt=i,_t=i,wt=i,$t=i,At=i,Pt=i,Tt=i,Ht=i,qt=i,Yt=i,Gt=i,Xt=i,Zt=i,{componentContext:Kt}=e,{cls:ee=""}=e,{style:ie}=e,{layoutParams:ae={}}=e,{customDescription:se=!1}=e,{customPaddings:le=!1}=e,{customActions:ce=""}=e,{additionalPaddings:ue=null}=e,{heightByAspect:de=!1}=e,{parentOf:pe}=e,{parentOfSimpleMode:ve}=e,{replaceItems:fe}=e,{hasInnerFocusable:ge=!1}=e;const he=g(at),me=g(Dt);let ye,be;et=l(he.direction,(t=>tt=t));let _e,we,$e,xe,ke,je,Ee,Ce,Ae,Fe,De,Oe,Pe,Se,Ve,Te,Ie,Me,Ne,ze,Ue,Re=null,Be=[],Le={},We={},He=!1,qe=1,Je="transparent",Ye=0,Ge={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},Xe="",Ze=null,Qe="",Ke={},tr=0,er=0,rr=0,nr=!1,or=!1,ir={},ar=0,sr=0,lr=0,cr=!1,ur=!1,dr=1,pr=[],vr=!1,fr=!1,gr=[],hr=[],mr=[],yr=[],br=[],_r=[],wr="",$r=!1,xr="visible",kr=0,jr=0,Er=!1,Cr=null;function Ar(t,e){if(!Array.isArray(pe)||!fe)return;if(ve&&1!==(Array.isArray(e)&&e.length||0))return;const r=pe.findIndex((e=>(null==e?void 0:e.id)===t)),n=pe.slice();n.splice(r,1,...e||[]),pe=n,fe(n)}function Fr(){if(Re&&ye){const t=he.getExtensionContext();Re.forEach((e=>{var r;null===(r=e.unmountView)||void 0===r||r.call(e,ye,t)})),Re=null}}function Dr(t){var e,r;null===(e=Ue)||void 0===e||e.destroy(),ye=t,vr&&Kt.json.transition_in&&me.registerChildWithTransitionIn(Kt.json,Kt,Kt.json.transition_in,t).then((()=>{De=!1})).catch((t=>{throw De=!1,t})),vr&&Kt.json.transition_out&&me.registerChildWithTransitionOut(Kt.json,Kt,Kt.json.transition_out,t),vr&&Kt.json.transition_change&&me.registerChildWithTransitionChange(Kt.json,Kt,Kt.json.transition_change,t).then((()=>{Pe=!1})).catch((t=>{throw Pe=!1,t}));const n=Kt.fakeElement?[]:Kt.json.visibility_actions||Kt.json.visibility_action&&[Kt.json.visibility_action],o=Kt.fakeElement?[]:Kt.json.disappear_actions;let i;(Array.isArray(n)&&n.length||Array.isArray(o)&&o.length)&&(i=function(t,{visibilityActions:e,disappearActions:r,rootCtx:n,componentContext:o}){const i=[];e&&e.forEach((t=>{i.push({type:"visibility",index:i.length,action:t,visible:!1,count:0,finished:!1})})),r&&r.forEach((t=>{i.push({type:"disappear",index:i.length,action:t,visible:!1,count:0,finished:!1})}));const a=i.map(((t,e)=>{const r="visibility"===t.type;return o.getDerivedFromVars({index:e,visibility_percentage:t.action.visibility_percentage,visibility_duration:r?t.action.visibility_duration:t.action.disappear_duration,log_limit:t.action.log_limit,is_enabled:t.action.is_enabled})}));let s;const l=()=>{s&&s.disconnect(),i.forEach((t=>{t.timer&&clearTimeout(t.timer)}))},c=K(a,(t=>t));let u;const d=t=>{const e="visibility"===t.type,r=o.getJsonWithVars(t.action),i=r.url,a=r.typed;if(i){const t=xt(i);t&&!kt(t,n.getBuiltinProtocols())&&("div-action"===t?n.execAction(r):r.log_id&&n.execCustomAction(r))}else a&&n.execAction(r);n.logStat(e?"visible":"disappear",r)},p=c.subscribe((e=>{u=e.filter(Ct);const r={};u.forEach((t=>{r[t.index]=t})),l();const n=[...new Set(u.map((t=>{const e="visibility"===i[t.index].type;return Et(e,t.visibility_percentage,e?50:0)/100})))];n.length&&(s=new IntersectionObserver((t=>{t.forEach((t=>{u.forEach((e=>{const r=i[e.index],n="visibility"===r.type,o=Et(n,e.visibility_percentage,n?50:0);let a;a=0===o?t.intersectionRatio>=1e-12:t.intersectionRatio>=o/100;const s=n?!a:a;(n?!r.visible&&a:r.visible&&!a)?r.finished||(r.timer=setTimeout((()=>{++r.count;const t=0===e.log_limit?1/0:e.log_limit||1;++r.count>=t&&(r.finished=!0),d(r)}),jt(e.visibility_duration,800))):s&&r.timer&&clearTimeout(r.timer),r.visible=a}))}))}),{threshold:n}),s.observe(t))}));return{destroy(){var t;null===(t=u)||void 0===t||t.forEach((t=>{const e=i[t.index];e&&"disappear"===e.type&&e.visible&&!e.finished&&n.registerTimeout(window.setTimeout((()=>{d(e)}),t.visibility_duration))})),l(),p()}}}(t,{visibilityActions:n,disappearActions:o,rootCtx:he,componentContext:Kt}));const a=Kt.json.id;return a&&me.registerChild(a),null===(r=Kt.json.tooltips)||void 0===r||r.forEach((e=>{he.registerTooltip(t,e)})),Ue={destroy(){a&&me.unregisterChild(a),i&&i.destroy(),Cr&&Cr.destroy()}},Ue}function Or(){Kt.json.focus&&(function(t){let e;return l(t,(t=>e=t))(),e}(he.isPointerFocus)||(Er=!0),Kt.execAnyActions(yr))}function Pr(){Kt.json.focus&&(Er=!1,Kt.execAnyActions(br))}v((()=>{var t;Be.forEach((t=>{he.unregisterParentOf(t)})),Be=[],null===(t=Kt.json.tooltips)||void 0===t||t.forEach((t=>{he.unregisterTooltip(t)})),Fr()})),void 0===e.componentContext&&r.componentContext&&void 0!==Kt&&r.componentContext(Kt),void 0===e.cls&&r.cls&&void 0!==ee&&r.cls(ee),void 0===e.style&&r.style&&void 0!==ie&&r.style(ie),void 0===e.layoutParams&&r.layoutParams&&void 0!==ae&&r.layoutParams(ae),void 0===e.customDescription&&r.customDescription&&void 0!==se&&r.customDescription(se),void 0===e.customPaddings&&r.customPaddings&&void 0!==le&&r.customPaddings(le),void 0===e.customActions&&r.customActions&&void 0!==ce&&r.customActions(ce),void 0===e.additionalPaddings&&r.additionalPaddings&&void 0!==ue&&r.additionalPaddings(ue),void 0===e.heightByAspect&&r.heightByAspect&&void 0!==de&&r.heightByAspect(de),void 0===e.parentOf&&r.parentOf&&void 0!==pe&&r.parentOf(pe),void 0===e.parentOfSimpleMode&&r.parentOfSimpleMode&&void 0!==ve&&r.parentOfSimpleMode(ve),void 0===e.replaceItems&&r.replaceItems&&void 0!==fe&&r.replaceItems(fe),void 0===e.hasInnerFocusable&&r.hasInnerFocusable&&void 0!==ge&&r.hasInnerFocusable(ge),a=Kt.origJson,a&&(Ze=null,Qe="",dr=1,$r=!1,xr="visible",kr=0,jr=0,Me=void 0,Ne=void 0,pr=Kt.fakeElement?[]:Kt.json.transition_triggers||["state_change","visibility_change"],vr=Boolean(-1!==pr.indexOf("state_change")&&Kt.json.id),fr=Boolean(-1!==pr.indexOf("visibility_change")&&Kt.json.id),ye&&Dr(ye)),s=Kt.getDerivedFromVars(Kt.json.focus),gt(),gt=l(s,(t=>z=t)),c=Kt.getDerivedFromVars(Kt.json.border),Zt(),Zt=l(c,(t=>ot=t)),u=Kt.getDerivedFromVars(Kt.json.paddings),Xt(),Xt=l(u,(t=>nt=t)),d=Kt.getDerivedFromVars(Kt.json.margins),Yt(),Yt=l(d,(t=>Q=t)),p=Kt.getDerivedFromVars(Kt.json.width),Ht(),Ht=l(p,(t=>X=t)),f=Kt.getDerivedFromVars(Kt.json.alignment_horizontal),Gt(),Gt=l(f,(t=>rt=t)),h=Kt.getDerivedFromVars(Kt.json.height),Tt(),Tt=l(h,(t=>G=t)),m=Kt.getDerivedFromVars(Kt.json.alignment_vertical),qt(),qt=l(m,(t=>Z=t)),y=Kt.getDerivedFromVars(Kt.json.alpha),Pt(),Pt=l(y,(t=>Y=t)),b=Kt.getDerivedFromVars(Kt.json.accessibility),At(),At=l(b,(t=>J=t)),_=Kt.getDerivedFromVars(Kt.json.background),$t(),$t=l(_,(t=>q=t)),w=Kt.getDerivedFromVars(Kt.json.action),_t(),_t=l(w,(t=>L=t)),x=Kt.getDerivedFromVars(Kt.json.actions),wt(),wt=l(x,(t=>H=t)),k=Kt.getDerivedFromVars(Kt.json.doubletap_actions),bt(),bt=l(k,(t=>B=t)),j=Kt.getDerivedFromVars(Kt.json.longtap_actions),ht(),ht=l(j,(t=>R=t)),E=Kt.getDerivedFromVars(Kt.json.action_animation),vt(),vt=l(E,(t=>N=t)),C=Kt.getDerivedFromVars(Kt.json.visibility),lt(),lt=l(C,(t=>M=t)),A=Kt.getDerivedFromVars(Kt.json.transform),it(),it=l(A,(t=>I=t)),Be.forEach((t=>{he.unregisterParentOf(t)})),Be=[],pe&&pe.forEach((t=>{null!=t&&t.id&&(Be.push(t.id),he.registerParentOf(t.id,{replaceWith:Ar,isSingleMode:Boolean(ve)}))}));{var Sr;const t=Er&&null!==(Sr=z)&&void 0!==Sr&&Sr.border?z.border:ot;let e={},r={},n=!1,o="";if(t){if(t.has_shadow){const r=t.shadow;e["box-shadow"]=r?function(t){var e,r,n,o,i,a;return dt((null===(e=t.offset)||void 0===e||null===(r=e.x)||void 0===r?void 0:r.value)||0)+" "+dt((null===(n=t.offset)||void 0===n||null===(o=n.y)||void 0===o?void 0:o.value)||0)+" "+dt(null!==(i=t.blur)&&void 0!==i?i:2)+" "+ft(t.color||"#000000",null!==(a=t.alpha)&&void 0!==a?a:.19)}(r):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}if(t.stroke&&(n=!0,qe=jt(t.stroke.width,qe),Je=ft(t.stroke.color,1,Je),r["--divkit-border"]=`${dt(qe+1)} solid ${Je}`),t.corners_radius?(Ge=function(t,e){const r=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<r.length;++t)if(r[t]&&!St(r[t]))return e;return t}(t.corners_radius,Ge),e["border-radius"]=Bt(Ge),["top-left","top-right","bottom-right","bottom-left"].forEach((t=>{Ge[t]=(Ge[t]||0)+1})),r["--divkit-border-radius"]=Bt(Ge)):t.corner_radius&&(Ye=jt(t.corner_radius,Ye),Ge={"top-left":Ye,"top-right":Ye,"bottom-right":Ye,"bottom-left":Ye},e["border-radius"]=dt(Ye),r["--divkit-border-radius"]=dt(Ye+1)),n&&qe&&(t.corners_radius||t.corner_radius)){let t=te({},Ge);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+qe/2})),o=Bt(t)}}Le=Mt(e,Le),We=Mt(r,We),He=n,Xe=o}Ze=Rt(nt&&!le?nt:void 0,Ze),F=Ot(function(t,e){if(!t&&!e)return{};if(!e)return t;if(!t)return e;const r={};return["top","right","bottom","left","start","end"].forEach((n=>{const o=t[n];o&&(r[n]=o);const i=e[n];i&&(r[n]=(r[n]||0)+i)})),r}(Ze,ue),tt),Qe=Vt(Q,tt,Qe);{var Vr;let t,e,r,n,o={},i=0,a=0,s=!1,l=!1;const c=null===(Vr=X)||void 0===Vr?void 0:Vr.type;var Tr;if("fixed"===c)tr=jt(null===(Tr=X)||void 0===Tr?void 0:Tr.value,tr),e=dt(tr);else if("wrap_content"===c||("match_parent"===c||!c)&&ae.parentHorizontalWrapContent){var Ir;if(t="content",("wrap_content"===c&&null!==(Ir=X)&&void 0!==Ir&&Ir.constrained||("match_parent"===c||!c)&&ae.parentHorizontalWrapContent)&&(o["width-constrained"]=!0,"horizontal"===ae.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=X;t.min_size&&St(t.min_size.value)&&(r=dt(t.min_size.value)),t.max_size&&St(t.max_size.value)&&(n=dt(t.max_size.value))}"match_parent"!==c&&c||Kt.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else{var Mr,Nr;t="parent","vertical"===ae.parentContainerOrientation&&ae.parentContainerWrap&&(l=!0,Kt.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===ae.parentLayoutOrientation?e=`calc(100% - ${pt(((null===(Mr=Q)||void 0===Mr?void 0:Mr.left)||0)+((null===(Nr=Q)||void 0===Nr?void 0:Nr.right)||0))})`:"horizontal"===ae.parentContainerOrientation&&(i=X&&"weight"in X&&X.weight||1,ae.parentContainerWrap&&(s=!0))}if("parent"===t)o["halign-self"]="stretch";else{const t=rt;o["halign-self"]="left"===t||"center"===t||"right"===t||"start"===t||"end"===t?("ltr"===tt?re:ne)[t]:ae.parentHAlign||"start"}t&&(o.width=t),_e=e,we=r,$e=n,er=i,rr=a,Ke=Mt(o,Ke),nr=s,or=l}{var zr;let t,e,r,n,o={},i=0,a=0,s=!1,l=!1;const c=null===(zr=G)||void 0===zr?void 0:zr.type;if(de);else if("fixed"===c){var Ur;ar=jt(null===(Ur=G)||void 0===Ur?void 0:Ur.value,ar),e=dt(ar)}else if("match_parent"!==c||ae.parentVerticalWrapContent){var Rr;if(t="content",("wrap_content"===c&&null!==(Rr=G)&&void 0!==Rr&&Rr.constrained||"match_parent"===c&&ae.parentVerticalWrapContent)&&(o["height-constrained"]=!0,"vertical"===ae.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=G;null!=t&&t.min_size&&St(t.min_size.value)&&(r=dt(t.min_size.value)),null!=t&&t.max_size&&St(t.max_size.value)&&(n=dt(t.max_size.value))}"match_parent"===c&&Kt.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else{var Br,Lr;if(t="parent","horizontal"===ae.parentContainerOrientation&&ae.parentContainerWrap&&(l=!0,Kt.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===ae.parentLayoutOrientation)e=`calc(100% - ${pt(((null===(Br=Q)||void 0===Br?void 0:Br.top)||0)+((null===(Lr=Q)||void 0===Lr?void 0:Lr.bottom)||0))})`;else if("vertical"===ae.parentContainerOrientation){var Wr;i=(null===(Wr=G)||void 0===Wr?void 0:Wr.weight)||1,ae.parentContainerWrap&&(s=!0)}}if("parent"===t)o["valign-self"]="stretch";else{const t=Z;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===ae.parentContainerOrientation?o["valign-self"]=oe[t]:o["valign-self"]=ae.parentVAlign||"start"}t&&(o.height=t),xe=e,ke=r,je=n,sr=i,lr=a,ir=Mt(o,ir),cr=s,ur=l}var Hr,qr,Jr,Yr;if(D=!!ae.overlapParent||void 0,O=ae.overlapParent&&(!X||"match_parent"===X.type)&&!ae.parentHorizontalWrapContent&&"match_parent"===(null===(o=G)||void 0===o?void 0:o.type)&&!ae.parentVerticalWrapContent,P=ae.gridArea?`${ae.gridArea.y+1}/${ae.gridArea.x+1}/span ${ae.gridArea.rowSpan}/span ${ae.gridArea.colSpan}`:void 0,qr=dr,dr=!St(Hr=Y)||void 0===Hr||Hr>1?qr:Number(Hr),Ee=1===dr?void 0:dr,be=void 0,J&&!se&&J.description&&(be={},be["aria-label"]=J.description),Ce=Er&&null!==(Jr=z)&&void 0!==Jr&&Jr.background?z.background:q,Ae={},Fe=!1,Array.isArray(Ce)&&(Fe=Ce.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(Xe),!Fe)){const t=yt(Ce);Ae["background-color"]=t.color,Ae["background-image"]=t.image,Ae["background-size"]=t.size,Ae["background-position"]=t.position,Ae["background-repeat"]="no-repeat"}De=void 0,vr&&Kt.json.transition_in&&he.isRunning("stateChange")&&(De=!0),Pe=void 0,vr&&Kt.json.transition_change&&he.isRunning("stateChange")&&me.hasTransitionChange(Kt.json.id)&&(Pe=!0);{var Gr,Xr;let t=H||L&&[L]||[],e=B||[],r=R||[],n=(null===(Gr=z)||void 0===Gr?void 0:Gr.on_focus)||[],o=(null===(Xr=z)||void 0===Xr?void 0:Xr.on_blur)||[];Kt.fakeElement?(t=[],e=[],r=[],n=[],o=[]):(Array.isArray(t)||(t=[],Kt.logError(st(new Error("Actions should be array")))),Array.isArray(e)||(e=[],Kt.logError(st(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],Kt.logError(st(new Error("LongTapActions should be array")))),Array.isArray(n)||(n=[],Kt.logError(st(new Error("FocusActions should be array")))),Array.isArray(o)||(o=[],Kt.logError(st(new Error("BlurActions should be array"))))),(t.length||e.length||r.length)&&ce&&(t=[],e=[],r=[],Kt.logError(st(new Error(`Cannot use action on component "${ce}"`)))),gr=t.filter(Lt),hr=e.filter(Lt),mr=r.filter(Lt),yr=n.filter(Lt),br=o.filter(Lt)}N&&(_r=Ut(N),wr=_r.map((function(t){const e=zt(t.start_value,1),r=zt(t.end_value,1),n=jt(t.start_delay,0),o="undefined"!=typeof matchMedia&&(Wt||(Wt=window.matchMedia("(prefers-reduced-motion)")),Wt.matches)?0:jt(t.duration,300),i=Nt(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return Se=e,Ve=r,`opacity ${o}ms ${i} ${n}ms`;case"scale":return Te=e,Ie=r,`transform ${o}ms ${i} ${n}ms`;case"native":case"no_animation":return"";default:return Kt.logError(st(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", "));{const t=xr,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(M,xr);t!==e&&(!$r||"visible"!==xr&&"visible"!==e?xr=e:async function(t){xr=t;const e="visible"===t?"in":"out",r="in"===e?Kt.json.transition_in:Kt.json.transition_out;fr&&r&&(await $(),"in"===e&&(Oe=!0),me.runVisibilityTransition(te(te({},Kt.json),{},{visibility:"visible"}),Kt,r,ye,e).then((()=>{"in"===e&&(Oe=!1)})).catch((t=>{throw"in"===e&&(Oe=!1),t})))}(e)),$r||($r=!0)}if(Kt.json&&ye&&!It(Kt.json.extensions,ze)){let t=ze=Kt.json.extensions;$().then((()=>{if(t===ze&&ye&&(Fr(),Array.isArray(Kt.json.extensions))){const t=he.getExtensionContext();Re=Kt.json.extensions.map((e=>{const r=e.id;if(!r)return;const n=he.getExtension(r,e.params);var o;return n&&(null===(o=n.mountView)||void 0===o||o.call(n,ye,t)),n})).filter(mt)}}))}if(S=te(te(te({},Ke),ir),{},{"parent-overlap":D,"parent-overlap-absolute":O,"scroll-snap":ae.scrollSnap,"hide-on-transition-in":De||Oe||Pe,visibility:xr,"has-action-animation":Boolean(wr),"parent-flex":ae.parentContainerOrientation||void 0,"parent-grid":Boolean(ae.gridArea)||void 0,"has-custom-focus":Boolean(Er&&Kt.json.focus)}),I&&void 0!==I.rotation){const t=I.pivot_x||{type:"pivot-percentage",value:50};kr=zt(t.value,kr);const e="pivot-fixed"===t.type?dt(kr):`${kr}%`,r=I.pivot_y||{type:"pivot-percentage",value:50};jr=zt(r.value,jr);Me=`${e} ${"pivot-fixed"===r.type?dt(jr):`${jr}%`}`,Ne=`rotate(${I.rotation}deg)`}return V=nr||cr?"100%":er||sr?0:void 0,T=te(te(te(te({},ie),Ae),Le),{},{width:_e,"min-width":we,"max-width":$e,height:xe,"min-height":ke,"max-height":je||(null==ie?void 0:ie["max-height"]),"grid-area":P,padding:F,margin:Qe,opacity:Ee,transition:wr,"transform-origin":Me,transform:Ne,"flex-grow":er||sr||void 0,"flex-shrink":rr||lr?1:void 0,"flex-basis":V,"--divkit-animation-opacity-start":Se,"--divkit-animation-opacity-end":Ve,"--divkit-animation-scale-start":Te,"--divkit-animation-scale-end":Ie}),it(),lt(),vt(),gt(),ht(),bt(),_t(),wt(),$t(),At(),Pt(),Tt(),Ht(),qt(),Yt(),et(),Gt(),Xt(),Zt(),or||ur?"":`${U(Jt,"Actionable").$$render(t,{componentContext:Kt,id:Kt.json.id,use:Dr,cls:ee+" "+Ft("outer",ct,S),style:ut(T),actions:gr,doubleTapActions:hr,longTapActions:mr,attrs:be,hasInnerFocusable:ge,isNativeActionAnimation:!_r.length||(Yr=_r,Yr.some((t=>"native"===t.name)))},{},{default:()=>` ${Fe?`${U(Qt,"OuterBackground").$$render(t,{componentContext:Kt,direction:tt,background:Ce,radius:Xe},{},{})}`:""}${n.default?n.default({focusHandler:Or,blurHandler:Pr,hasCustomFocus:Er}):""}${He?`<span${W("class",ct.outer__border,0)}${W("style",ut(We),0)}></span>`:""}`})}`})),ae=ie,se={"text-range":"divkit-faf07","text-range_singleline":"divkit-ccb64","text-range__top-offset":"divkit-d9237","text-range_decoration_both":"divkit-d7e07","text-range_decoration_underline":"divkit-f3dde","text-range_decoration_strike":"divkit-d27b7","text-range_decoration_none":"divkit-c6b0f"};function le(t,e){const r=Number(t);return Number.isNaN(r)||r<=0?e:r}function ce(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function ue(t,e){return ce(t)||e}const de=L(((t,e,r,n)=>{var o,i;let a,s,l,c,u,d,{componentContext:p}=e,{text:v}=e,{rootFontSize:f}=e,{textStyles:h={}}=e,{singleline:m=!1}=e,{actions:y}=e;const b=g(at);let _,w="none",$=12,x=1.25,k="",j="",E="",C=null;void 0===e.componentContext&&r.componentContext&&void 0!==p&&r.componentContext(p),void 0===e.text&&r.text&&void 0!==v&&r.text(v),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==f&&r.rootFontSize(f),void 0===e.textStyles&&r.textStyles&&void 0!==h&&r.textStyles(h),void 0===e.singleline&&r.singleline&&void 0!==m&&r.singleline(m),void 0===e.actions&&r.actions&&void 0!==y&&r.actions(y),p.json&&(w="none",$=12,x=1.25,k="",_=void 0,j="",E="",C=null);{let t="none";(h.underline||h.strike)&&("single"===h.underline&&"single"===h.strike?t="both":"single"===h.underline?t="underline":"single"===h.strike&&(t="strike")),w=t}var A;return $=le(h.font_size,$),Gt(h.line_height)&&(x=Number(h.line_height)/$),St(h.letter_spacing)&&(k=dt(h.letter_spacing)),_=ue(h.font_weight,_),j="string"==typeof h.font_family&&h.font_family?b.typefaceProvider(h.font_family,{fontWeight:_||400}):"",E=ft(h.text_color,1,E),a=h.top_offset?dt(h.top_offset):"",s=h.background?yt([h.background]):null,C=null!==(A=h.border)&&void 0!==A&&A.stroke&&h.border.stroke.color&&"transparent"!==ft(h.border.stroke.color)&&Gt(h.border.stroke.width)?{color:h.border.stroke.color,width:h.border.stroke.width}:null,l=le(null===(o=h.border)||void 0===o?void 0:o.corner_radius,0),c=h.text_shadow?function(t,e){var r,n,o,i,a,s;return"drop-shadow("+ft(t.color||"#000000",null!==(r=t.alpha)&&void 0!==r?r:.19)+" "+dt(10*((null===(n=t.offset)||void 0===n||null===(o=n.x)||void 0===o?void 0:o.value)||0)/e)+" "+dt(10*((null===(i=t.offset)||void 0===i||null===(a=i.y)||void 0===a?void 0:a.value)||0)/e)+" "+dt(10*(null!==(s=t.blur)&&void 0!==s?s:2)/e)+")"}(h.text_shadow,$):void 0,u={singleline:m,decoration:w},d={"font-size":dt(10*$/f),"line-height":x,"letter-spacing":k,"font-weight":_,"font-family":j,filter:c,color:E,background:(null===(i=s)||void 0===i?void 0:i.color)||void 0,"box-shadow":C?`inset 0 0 0 ${dt(C.width)} ${C.color}`:void 0,"border-radius":l?dt(l):void 0},`${a?`<span${W("class",se["text-range__top-offset"],0)}${q({"margin-top":a})}></span>`:""}${U(Jt,"Actionable").$$render(t,{componentContext:p,cls:Ft("text-range",se,u),actions:y,style:ut(d)},{},{default:()=>`${T(v)}`})}`})),pe=de;function ve(t,e,r){return"left"===t||"center"===t||"right"===t||"start"===t||"end"===t?"left"===t?"ltr"===e?"start":"end":"right"===t?"ltr"===e?"end":"start":t:r}function fe(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?"top"===t?"start":"bottom"===t?"end":t:e}function ge(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}function he(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}function me(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ye(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?me(Object(r),!0).forEach((function(e){be(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):me(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function be(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const _e=L(((t,e,r,n)=>{let o,a,s,c,u,d,p,f,h,m,y,b,_,w,$,x,k,j,E,C,A,F,D,O,P,S,V,T,I,M,z,R,B,L,H,q,J,Y,G,X=i,Z=i,Q=i,K=i,tt=i,et=i,nt=i,ot=i,it=i,st=i,ct=i,pt=i,vt=i,gt=i,ht=i,{componentContext:mt}=e,{layoutParams:bt}=e;const _t=g(at);L=l(_t.direction,(t=>B=t));let wt,$t="",xt=12,kt=1.25,jt=!1,Et="",Ct="",At=!1,Dt="start",Ot="start",Pt="",St="",Vt="",Tt=!1,It=[],Mt=[];var Nt;v((()=>{Mt.forEach((([t,e])=>{_t.removeSvgFilter(t,e)}))})),void 0===e.componentContext&&r.componentContext&&void 0!==mt&&r.componentContext(mt),void 0===e.layoutParams&&r.layoutParams&&void 0!==bt&&r.layoutParams(bt),mt.json&&(xt=12,kt=1.25,jt=!1,Et="",wt=void 0,Ct="",At=!1,Dt="start",Ot="start",Pt="",Vt="",Tt=!1),o=mt.getDerivedFromVars(mt.json.text),ht(),ht=l(o,(t=>G=t)),a=mt.getDerivedFromVars(mt.json.ranges),Q(),Q=l(a,(t=>P=t)),s=mt.getDerivedFromVars(mt.json.images),Z(),Z=l(s,(t=>O=t)),c=mt.getDerivedFromVars({font_size:mt.json.font_size,letter_spacing:mt.json.letter_spacing,font_weight:mt.json.font_weight,font_family:mt.json.font_family,text_color:mt.json.text_color,underline:mt.json.underline,strike:mt.json.strike,line_height:mt.json.line_height,text_shadow:mt.json.text_shadow}),X(),X=l(c,(t=>D=t)),u=mt.getDerivedFromVars(mt.json.font_size),gt(),gt=l(u,(t=>Y=t)),d=mt.getDerivedFromVars(mt.json.line_height),vt(),vt=l(d,(t=>J=t)),p=mt.getDerivedFromVars(mt.json.max_lines),it(),it=l(p,(t=>z=t)),f=mt.getDerivedFromVars(mt.json.text_alignment_horizontal),ct(),ct=l(f,(t=>H=t)),h=mt.getDerivedFromVars(mt.json.text_alignment_vertical),st(),st=l(h,(t=>R=t)),m=mt.getDerivedFromVars(mt.json.text_color),ot(),ot=l(m,(t=>M=t)),y=mt.getDerivedFromVars(mt.json.focused_text_color),nt(),nt=l(y,(t=>I=t)),b=mt.getDerivedFromVars(mt.json.truncate),et(),et=l(b,(t=>T=t)),_=mt.getDerivedFromVars(mt.json.text_gradient),tt(),tt=l(_,(t=>V=t)),w=mt.getDerivedFromVars(mt.json.selectable),K(),K=l(w,(t=>S=t)),$=mt.getDerivedFromVars(mt.json.auto_ellipsize),pt(),pt=l($,(t=>q=t)),Nt=G,$t=String(null!=Nt?Nt:""),xt=le(Y,xt);{const t=J;Gt(t)?(kt=Number(t)/xt,jt=!0):jt=!1}x=1===z;{let t,e="",r="",n=!1;if(z&&z>1){const o=Number(z);e=o*kt+"em",t=o,r=o,n=!0}else q&&1!==z&&(n=!0);Et=e,wt=t,Ct=r,At=n}Dt=ve(H,B,Dt),Ot=fe(R,Ot),k=!P||$t&&1===P.length&&P[0]&&0===P[0].start&&"number"==typeof P[0].end&&P[0].end>=$t.length,j=Boolean(M)!==Boolean(P&&P[0]&&P[0].text_color);{let t="";z&&k&&j&&(t=ft(M||P&&P[0]&&P[0].text_color,1,Pt)),Pt=t}St=ft(I,1,St),E="none"===T?"none":"";{let t="";if(V){const e=yt([V]);e.image&&(t=e.image)}Vt=t}return Tt=ge(S,Tt),function(t,e,r,n){let o=[];if(Mt.forEach((([t,e])=>{_t.removeSvgFilter(t,e)})),Mt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(It=[]);const i=t;let a=e||[{start:0,end:i.length}],s=r||[],l=0,c=[],u=[];a.forEach((t=>{void 0!==t.start&&void 0!==t.end&&(u.push({index:t.start,range:t,type:"rangeStart",isStart:!0}),u.push({index:t.end,range:t,type:"rangeEnd"}))})),s.forEach(((t,e)=>{void 0!==t.start&&t.url&&t.start<=i.length&&u.push({index:t.start,image:t,type:"image",arrayIndex:e})})),u.sort(((t,e)=>t.index===e.index?t.type!==e.type?"image"===t.type?-1:"image"===e.type?1:t.type<e.type?-1:1:"image"===t.type&&"image"===e.type?e.arrayIndex-t.arrayIndex:"rangeStart"===t.type&&"rangeStart"===e.type?t.range.end-e.range.end:"rangeStart"===t.type?1:"rangeStart"===e.type?-1:"image"!==t.type&&"image"!==e.type?t.range.start-e.range.start:0:t.index-e.index)),u.forEach((t=>{let e="image"===t.type?null:t.range,r=t.index;if(r>l){var a,s;let e=Object.assign(ye({},n),...c);o.push({text:i.substring(l,r),textStyles:e,actions:"rangeEnd"===t.type&&(null===(a=t.range)||void 0===a||null===(s=a.actions)||void 0===s?void 0:s.filter(Lt))||void 0})}if("rangeStart"===t.type&&e)c.push(e);else if("rangeEnd"===t.type)c=c.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(ye({},n),...c),r=dt(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),i=dt(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const a={"font-size":dt(10*(Number(e.font_size)||12)/xt)};let s="";const l=t.image.tint_color,u=he(t.image.tint_mode,"source_in");if(l){const e=ft(t.image.tint_color);s=_t.addSvgFilter(e,u),Mt.push([e,u])}o.push({image:{url:t.image.url,width:r,height:i,wrapperStyle:a,svgFilterId:s,preloadRequired:Boolean(t.image.preload_required)}})}l=r})),l<i.length&&o.push({text:i.substring(l),textStyles:ye({},n)}),It=o}($t,P,O,D),C={singleline:x,multiline:At,halign:Dt,valign:Ot,truncate:E,"has-focus-color":Boolean(St)},A={gradient:Boolean(Vt)},F={"font-size":dt(xt),"line-height":kt,"max-height":Et,"-webkit-line-clamp":Ct,color:Pt,"background-image":Vt,"--divkit-text-focus-color":St},X(),Z(),Q(),K(),tt(),et(),nt(),ot(),it(),st(),L(),ct(),pt(),vt(),gt(),ht(),`${U(ae,"Outer").$$render(t,{cls:Ft("text",lt,C)+" "+(Tt?"":rt),componentContext:mt,layoutParams:bt},{},{default:()=>`<span${W("class",Ft("text__inner",lt,A),0)}${W("style",ut(F),0)}>${It.length?`${N(It,(e=>"text"in e?e.text?`${U(pe,"TextRangeView").$$render(t,{componentContext:mt,text:e.text,rootFontSize:xt,textStyles:e.textStyles,singleline:x,actions:e.actions},{},{})}`:"":e.image?`<span${W("style",ut(e.image.wrapperStyle),0)}><img${W("class",lt.text__image,0)}${W("src",e.image.url,0)}${W("loading",e.image.preloadRequired?"eager":"lazy",0)} decoding="async" aria-hidden="true" alt=""${W("style",ut({width:e.image.width,height:e.image.height,"margin-top":jt?`-${e.image.height}`:void 0,"margin-bottom":jt?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${U(pe,"TextRangeView").$$render(t,{componentContext:mt,text:$t,rootFontSize:xt,textStyles:D,singleline:x},{},{})}`}</span>`})}`})),we=_e,$e={container:"divkit-d37d6",container_wrap:"divkit-c8551",container_overflow_visible:"divkit-f315a",container_orientation_vertical:"divkit-ddc33",container_valign_start:"divkit-a31f0",container_valign_center:"divkit-aae61",container_valign_end:"divkit-eac00","container_valign_space-between":"divkit-ce053","container_valign_space-around":"divkit-cf29b","container_valign_space-evenly":"divkit-b4b04",container_halign_start:"divkit-efaf5",container_halign_center:"divkit-bac9d",container_halign_end:"divkit-ca36b","container_halign_space-between":"divkit-e5c38","container_halign_space-around":"divkit-feff2","container_halign_space-evenly":"divkit-e5e05",container_orientation_horizontal:"divkit-fe458",container_orientation_overlap:"divkit-a644d"};function xe(t){return{top:Number(null==t?void 0:t.top)||0,right:Number(null==t?void 0:t.right)||0,bottom:Number(null==t?void 0:t.bottom)||0,left:Number(null==t?void 0:t.left)||0}}function ke(t,e,r){const n=((null==e?void 0:e.margins.left)||0)+((null==e?void 0:e.margins.right)||0),o=((null==e?void 0:e.margins.top)||0)+((null==e?void 0:e.margins.bottom)||0);null!=e&&e.show_at_start&&(r?t.top=e.style.height+o:t.left=e.style.width+n),null!=e&&e.show_at_end&&(r?t.bottom=e.style.height+o:t.right=e.style.width+n)}function je(t,e,r){let n;const o=((null==e?void 0:e.margins.left)||0)+((null==e?void 0:e.margins.right)||0),i=((null==e?void 0:e.margins.top)||0)+((null==e?void 0:e.margins.bottom)||0),a=((null==r?void 0:r.margins.left)||0)+((null==r?void 0:r.margins.right)||0),s=((null==r?void 0:r.margins.top)||0)+((null==r?void 0:r.margins.bottom)||0);return n="horizontal"===t?[null!=r&&r.show_between?r.style.height+s:0,null!=e&&e.show_between?e.style.width+o:0]:[null!=e&&e.show_between?e.style.height+i:0,null!=r&&r.show_between?r.style.width+a:0],n.map(dt).join(" ")}function Ee(t){var e;const r=null===(e=t.width)||void 0===e?void 0:e.type;return"wrap_content"===r||"fixed"===r}function Ce(t){var e;return"match_parent"!==(null===(e=t.height)||void 0===e?void 0:e.type)}function Ae(t,e,r){if(!(t&&t.shape&&t.shape.type&&e.includes(t.shape.type)&&"shape_drawable"===t.type))return r;let n;if("rounded_rectangle"===t.shape.type)n={width:jt(null===(i=(o=t.shape).item_width)||void 0===i?void 0:i.value,10),height:jt(null===(a=o.item_height)||void 0===a?void 0:a.value,10),radius:jt(null===(s=o.corner_radius)||void 0===s?void 0:s.value,5)};else{if("circle"!==t.shape.type)return r;n=function(t){var e;const r=2*jt(null===(e=t.radius)||void 0===e?void 0:e.value,10);return{width:r,height:r,radius:r}}(t.shape)}var o,i,a,s;return function(t,e,r){var n;const o={},i=e.stroke||(null==r?void 0:r.stroke),a=null!=i&&i.color?ft(i.color):"",s=null!=i&&i.width?Number(null!==(n=i.width)&&void 0!==n?n:1):"";o.width=t.width,o.height=t.height,o.borderRadius=t.radius;const l=e.background_color||(null==r?void 0:r.color);return o.background=ft(l),a&&s&&(o.boxShadow=`inset 0 0 0 ${dt(s)} ${a}`),o}(n,t.shape,{color:t.color,stroke:t.stroke})}let Fe;function De(){if("undefined"==typeof document&&(Fe=!0),void 0!==Fe)return Fe;const t=document.createElement("div");return t.style.position="absolute",t.style.display="flex",t.style.flexDirection="column",t.style.gap="1px",t.appendChild(document.createElement("div")),t.appendChild(document.createElement("div")),document.body.appendChild(t),Fe=1===t.scrollHeight,document.body.removeChild(t),Fe}const Oe="divkit-a7719",Pe="divkit-f6e9a";function Se(t,e,r,n,o,i){const a=e.margins.left,s=e.margins.right,l=e.margins.top,c=e.margins.bottom;i?t.push({top:r.bottom+l,left:o.left+a,width:Math.max(0,o.right-o.left-a-s),height:n.top-r.bottom-l-c,style:e.style}):t.push({top:o.top+l,left:r.right+a,width:n.left-r.right-a-s,height:Math.max(0,o.bottom-o.top-l-c),style:e.style})}function Ve(t,e,r,n,o,i){const a={top:Math.min(...r.map((t=>t.top))),right:Math.max(...r.map((t=>t.right))),bottom:Math.max(...r.map((t=>t.bottom))),left:Math.min(...r.map((t=>t.left)))};if(null!=e&&e.show_at_start){let s,l;"space-around"===o||"space-evenly"===o?(s=i.left-e.style.width,l=i.top-e.style.height):(s=r[0].left-e.style.width-e.margins.left-e.margins.right,l=r[0].top-e.style.height-e.margins.top-e.margins.bottom),Se(t,e,{top:0,right:s,bottom:l,left:0},r[0],a,n)}if(null!=e&&e.show_between)for(let o=0;o<r.length-1;++o)Se(t,e,r[o],r[o+1],a,n);if(null!=e&&e.show_at_end){const s=r[r.length-1];let l,c;"space-around"===o||"space-evenly"===o?(l=i.bottom+e.style.height,c=i.right+e.style.width):(l=s.bottom+e.style.height+e.margins.top+e.margins.bottom,c=s.right+e.style.width+e.margins.left+e.margins.right),Se(t,e,s,{top:l,right:0,bottom:0,left:c},a,n)}}const Te=L(((t,e,r,n)=>{let o,{orientation:i}=e,{separator:a}=e,{lineSeparator:s}=e,{contentHAlign:l}=e,{contentVAlign:c}=e,{direction:u}=e;const d=function(t,e){let r,n=0,o=!1;return function(){const e=Date.now();return!n||Math.abs(e-n)>10?(n=e,r=t.apply(this,arguments)):(o||(o=!0,setTimeout((()=>{o=!1,r=t.apply(this,arguments)}),10)),r)}}((function(){if(!o)return;const t=o.getBoundingClientRect(),e=window.getComputedStyle(o),r={top:t.top+parseFloat(e.paddingTop),right:t.right-parseFloat(e.paddingRight),bottom:t.bottom-parseFloat(e.paddingBottom),left:t.left+parseFloat(e.paddingLeft)};f=[];let n=[...o.children].filter((t=>t!==p&&!t.classList.contains(ct.outer__border))),d=[];for(;n.length;){const t=[],e=n.shift();t.push(e);let r=e.getBoundingClientRect(),o=r.left,a=r.right,s=r.bottom;for(;n.length;){let e=n[0],r=e.getBoundingClientRect();if("vertical"===i){if(r.top<s)break}else if("ltr"===u?r.left<a:r.right>o)break;a=Math.max(a,r.right),o=Math.min(o,r.left),s=Math.max(s,r.bottom),t.push(e),n.shift()}d.push(t)}const v=[];d.forEach((t=>{const e=t.map((t=>function(t){const e=t.getBoundingClientRect(),r=getComputedStyle(t);return{top:e.top-parseFloat(r.marginTop),right:e.right+parseFloat(r.marginRight),bottom:e.bottom+parseFloat(r.marginBottom),left:e.left-parseFloat(r.marginLeft)}}(t)));"rtl"===u&&"horizontal"===i&&e.reverse(),a&&Ve(f,a,e,"vertical"===i,"vertical"===i?c:l,r);const n={top:Math.min(...e.map((t=>t.top))),right:Math.max(...e.map((t=>t.right))),bottom:Math.max(...e.map((t=>t.bottom))),left:Math.min(...e.map((t=>t.left)))};v.push(n)})),"rtl"===u&&"vertical"===i&&v.reverse(),s&&Ve(f,s,v,"horizontal"===i,"vertical"===i?l:c,r),f.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let p,f=[],g=!1,h=null,m=null;return v((()=>{g=!1})),void 0===e.orientation&&r.orientation&&void 0!==i&&r.orientation(i),void 0===e.separator&&r.separator&&void 0!==a&&r.separator(a),void 0===e.lineSeparator&&r.lineSeparator&&void 0!==s&&r.lineSeparator(s),void 0===e.contentHAlign&&r.contentHAlign&&void 0!==l&&r.contentHAlign(l),void 0===e.contentVAlign&&r.contentVAlign&&void 0!==c&&r.contentVAlign(c),void 0===e.direction&&r.direction&&void 0!==u&&r.direction(u),o=null,(g&&o||h||m)&&(h&&(h.disconnect(),h=null),m&&(m.disconnect(),m=null),g&&o&&("undefined"!=typeof MutationObserver&&(h=new MutationObserver((function(t){t.some((t=>{var e;const r=null===(e=t.target)||void 0===e?void 0:e.classList;return!(null!=r&&r.contains(Pe)||null!=r&&r.contains(Oe))}))&&d()})),h.observe(o,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(m=new ResizeObserver(d),m.observe(o)))),g&&o&&d(),` <div${W("class",Oe,0)}${W("this",p,0)}>${N(f,(t=>`<div${W("class","divkit-c770e",0)}${q({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${W("class",Pe,0)}${q({width:`${t.style.width}px`,height:`${t.style.height}px`,"border-radius":`${t.style.borderRadius}px`,background:t.style.background,"box-shadow":t.style.boxShadow})}></div> </div>`))}</div>`}));function Ie(){}function Me(t){return{subscribe:e=>(e(t),Ie)}}function Ne(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ze(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ne(Object(r),!0).forEach((function(e){Ue(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ne(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ue(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Me(void 0);const Re={start:"start",center:"center",end:"end","space-between":"start","space-around":"start","space-evenly":"start"},Be={start:"start",center:"center",end:"end",baseline:"baseline","space-between":"start","space-around":"start","space-evenly":"start"},Le=["rounded_rectangle","circle"],We=L(((t,e,r,n)=>{var o,a,s;let c,u,d,p,v,f,h,m,y,b,_,w,$,x,k,j,E,C,A,F,D,O,P,S,V,T,I,M,z,R,B,L,W,H=i,q=i,J=i,Y=i,G=i,X=i,Z=i,Q=i,tt=i,et=i,rt=i,nt=i,{componentContext:ot}=e,{layoutParams:it}=e;const st=g(at);let lt;I=l(st.direction,(t=>T=t));let ct,ut="vertical",dt="start",pt="start",vt=null,ft=null,gt={},ht=[];void 0===e.componentContext&&r.componentContext&&void 0!==ot&&r.componentContext(ot),void 0===e.layoutParams&&r.layoutParams&&void 0!==it&&r.layoutParams(it),c=ot.origJson,c&&(ut="vertical",dt="start",pt="start",ct=void 0),u=ot.json.items,d="string"==typeof(null===(o=ot.json.item_builder)||void 0===o?void 0:o.data)?ot.getDerivedFromVars(null===(a=ot.json.item_builder)||void 0===a?void 0:a.data,void 0,!0):null!==(s=ot.json.item_builder)&&void 0!==s&&s.data?Me(ot.json.item_builder.data):void 0,nt(),nt=l(d,(t=>W=t)),p=ot.getDerivedFromVars(ot.json.orientation),rt(),rt=l(p,(t=>L=t)),v=ot.getDerivedFromVars(ot.json.layout_mode),et(),et=l(v,(t=>B=t)),f=ot.getDerivedFromVars(ot.json.content_alignment_vertical),Q(),Q=l(f,(t=>z=t)),h=ot.getDerivedFromVars(ot.json.content_alignment_horizontal),Z(),Z=l(h,(t=>M=t)),m=ot.getDerivedFromVars(ot.json.separator),X(),X=l(m,(t=>V=t)),y=ot.getDerivedFromVars(ot.json.line_separator),G(),G=l(y,(t=>S=t)),b=ot.getDerivedFromVars(ot.json.aspect),Y(),Y=l(b,(t=>P=t)),_=ot.getDerivedFromVars(ot.json.width),q(),q=l(_,(t=>D=t)),w=ot.getDerivedFromVars(ot.json.height),J(),J=l(w,(t=>O=t)),$=ot.getDerivedFromVars(ot.json.clip_to_bounds),H(),H=l($,(t=>F=t));{let t=[];if(ot.json.item_builder&&Array.isArray(W)&&Array.isArray(ot.json.item_builder.prototypes)){const e=ot.json.item_builder;t=[],W.forEach((r=>{if(null===r||"object"!=typeof r)return;const n=st.preparePrototypeVariables(e.data_element_name||"it",r);let o;for(let t=0;t<e.prototypes.length;++t){const r=e.prototypes[t];if(r.div){if(void 0===r.selector){o=r.div;break}if(ot.getJsonWithVars(r.selector,n)){o=r.div;break}}}o&&t.push({div:o,vars:n})}))}else t=(Array.isArray(u)&&u||[]).map((t=>({div:t})));ht=t.map(((t,e)=>ot.produceChildContext(t.div,{path:e,variables:t.vars})))}{let t=[];ht.forEach((e=>{t.push(ot.getDerivedFromVars({width:e.json.width,height:e.json.height}))})),lt=K(t,(t=>[...t])),tt(),tt=l(lt,(t=>R=t))}var yt,bt;if(ut=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(L,ut),x="wrap"===B,k="horizontal"!==ut&&!x&&R.some(Ee),j="vertical"!==ut&&!x&&R.some(Ce),dt=function(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t||"space-between"===t||"space-around"===t||"space-evenly"===t?"top"===t?"start":"bottom"===t?"end":t:e}(z,dt),pt=function(t,e,r){return"left"===t||"center"===t||"right"===t||"space-between"===t||"space-around"===t||"space-evenly"===t||"start"===t||"end"===t?"left"===t?"ltr"===e?"start":"end":"right"===t?"ltr"===e?"end":"start":t:r}(M,T,pt),null!==(yt=V)&&void 0!==yt&&yt.style&&"overlap"!==ut&&De()){var _t;const t=Ae(V.style,Le,(null===(_t=vt)||void 0===_t?void 0:_t.style)||null);var wt,$t,xt;vt=t?{show_at_start:Boolean(null!==(wt=V.show_at_start)&&void 0!==wt&&wt),show_at_end:Boolean(null!==($t=V.show_at_end)&&void 0!==$t&&$t),show_between:Boolean(null===(xt=V.show_between)||void 0===xt||xt),style:t,margins:xe(V.margins)}:null}else vt=null;if(null!==(bt=S)&&void 0!==bt&&bt.style&&"overlap"!==ut&&De()){var kt;const t=Ae(S.style,Le,(null===(kt=ft)||void 0===kt?void 0:kt.style)||null);var jt,Et,Ct;ft=t?{show_at_start:Boolean(null!==(jt=S.show_at_start)&&void 0!==jt&&jt),show_at_end:Boolean(null!==(Et=S.show_at_end)&&void 0!==Et&&Et),show_between:Boolean(null===(Ct=S.show_between)||void 0===Ct||Ct),style:t,margins:xe(S.margins)}:null}else ft=null;E=vt||ft?function(t,e,r){const n={};return ke(n,e,"vertical"===t),ke(n,r,"horizontal"===t),n}(ut,vt,ft):null;{var At;const t=null===(At=P)||void 0===At?void 0:At.ratio;ct=t&&Gt(t)?t:void 0}{var Dt,Ot;let t={};"overlap"===ut&&(t.overlapParent=!0),"horizontal"!==ut&&(t.parentHAlign=x?"start":Re[pt]),"vertical"!==ut&&(t.parentVAlign=x?"start":Be[dt]),ct||j||O&&"wrap_content"!==O.type&&("match_parent"!==O.type||null==it||!it.parentVerticalWrapContent)||(t.parentVerticalWrapContent=!0),!k&&("wrap_content"===(null===(Dt=D)||void 0===Dt?void 0:Dt.type)||"match_parent"===(null===(Ot=D)||void 0===Ot?void 0:Ot.type)&&null!=it&&it.parentHorizontalWrapContent)&&(t.parentHorizontalWrapContent=!0),"horizontal"===ut&&(t.parentContainerOrientation="horizontal"),"vertical"===ut&&(t.parentContainerOrientation="vertical"),x&&(t.parentContainerWrap=!0),gt=Mt(t,gt)}return C={orientation:ut,valign:dt,halign:pt,wrap:x,overflow:!1===F||0===F?"visible":void 0},A={gap:vt||ft?je(ut,vt,ft):void 0,"aspect-ratio":ct},H(),q(),J(),Y(),G(),X(),I(),Z(),Q(),tt(),et(),rt(),nt(),`${U(ae,"Outer").$$render(t,{cls:Ft("container",$e,C),componentContext:ot,layoutParams:it,style:A,additionalPaddings:E,heightByAspect:Boolean(ct),parentOf:ht.map((t=>t.json)),replaceItems:function(t){ot=ze(ze({},ot),{},{json:ze(ze({},ot.json),{},{items:t.filter(mt)})})}},{},{default:()=>`${N(ht,(e=>`${U(Yn,"Unknown").$$render(t,{componentContext:e,layoutParams:gt},{},{})}`))} ${vt||ft?`${U(Te,"ContainerSeparators").$$render(t,{direction:T,separator:vt,lineSeparator:ft,orientation:ut,contentHAlign:pt,contentVAlign:dt},{},{})}`:""}`})}`})),He=We,qe={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function Je(t,e){return"vertical"===t||"horizontal"===t?t:e}const Ye=L(((t,e,r,n)=>{var o;let a,s,c,u,d,p,v,f,g=i,{componentContext:h}=e,{layoutParams:m}=e,y="horizontal",b="rgba(0,0,0,0.08)";var _,w;return void 0===e.componentContext&&r.componentContext&&void 0!==h&&r.componentContext(h),void 0===e.layoutParams&&r.layoutParams&&void 0!==m&&r.layoutParams(m),a=h.origJson,a&&(y="horizontal",b="rgba(0,0,0,0.08)"),s=h.getDerivedFromVars(h.json.delimiter_style),g(),g=l(s,(t=>f=t)),y=Je(null===(_=f)||void 0===_?void 0:_.orientation,y),c=!(null!==(o=f)&&void 0!==o&&o.color&&("transparent"===f.color||9===f.color.length&&0===f.color.indexOf("#00"))),b=ft(null===(w=f)||void 0===w?void 0:w.color,1,b),u="horizontal"===y?"100%":dt(1),d="horizontal"===y?dt(1):"100%",p={background:b,width:u,height:d},v={orientation:y},g(),`${U(ae,"Outer").$$render(t,{cls:Ft("separator",qe,v),componentContext:h,layoutParams:m},{},{default:()=>c?`<span${W("class",qe.separator__inner,0)}${W("style",ut(p),0)}></span>`:""})}`})),Ge={image:"divkit-a448f","image_is-width-content":"divkit-fe14a","image_is-height-content":"divkit-f4d92",image__image:"divkit-ce046",image_error:"divkit-f10d9","image_is-rtl-mirror":"divkit-ae78c","image__aspect-wrapper":"divkit-dc808",image_aspect:"divkit-ae784",image_loaded:"divkit-cf4e0","divkit-image-appearance":"divkit-e555f","image_before-appearance":"divkit-ffe8a"};function Xe(t){return t.startsWith("data:")?ht(t):`data:image/jpg;base64,${ht(t)}`}const Ze="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Qe=L(((t,e,r,n)=>{var o,a,s;let c,u,d,p,f,h,m,y,b,_,w,$,x,k,j,E,C,A,F,D,O,P,S,V,T,I,M,N,z,R,B,L,H,J,Y,G,X,Z,Q=i,K=i,tt=i,et=i,rt=i,nt=i,ot=i,it=i,lt=i,ct=i,dt=i,pt=i,vt=i,gt=i,ht=i,{componentContext:mt}=e,{layoutParams:yt}=e;const bt=g(at);let _t;V=l(bt.direction,(t=>S=t));let xt,kt,Et=0,Ct=!1,At="rgba(0,0,0,0.08)",Dt=!1,Ot="",Pt="none",St="50% 50%",Vt="0",Tt="source_in",It="",Mt="",zt=0,Ut=0,Rt=0,Bt="",Lt="",Wt=!1;v((()=>{bt.removeSvgFilter(kt,Tt)})),void 0===e.componentContext&&r.componentContext&&void 0!==mt&&r.componentContext(mt),void 0===e.layoutParams&&r.layoutParams&&void 0!==yt&&r.layoutParams(yt),c=mt.origJson,c&&(Pt="none",St="50% 50%",Tt="source_in"),u=mt.getDerivedFromVars(mt.json.image_url),vt(),vt=l(u,(t=>G=t)),d=mt.getDerivedFromVars(mt.json.gif_url),gt(),gt=l(d,(t=>X=t)),p=mt.getDerivedFromVars(mt.json.width),pt(),pt=l(p,(t=>Y=t)),f=mt.getDerivedFromVars(mt.json.height),dt(),dt=l(f,(t=>J=t)),h=mt.getDerivedFromVars(mt.json.preview),ct(),ct=l(h,(t=>H=t)),m=mt.getDerivedFromVars(mt.json.placeholder_color),lt(),lt=l(m,(t=>L=t)),y=mt.getDerivedFromVars(mt.json.scale),it(),it=l(y,(t=>B=t)),b=mt.getDerivedFromVars({content_alignment_horizontal:mt.json.content_alignment_horizontal,content_alignment_vertical:mt.json.content_alignment_vertical}),ot(),ot=l(b,(t=>R=t)),_=mt.getDerivedFromVars(mt.json.accessibility),nt(),nt=l(_,(t=>z=t)),w=mt.getDerivedFromVars(mt.json.aspect),rt(),rt=l(w,(t=>N=t)),$=mt.getDerivedFromVars(mt.json.tint_color),et(),et=l($,(t=>M=t)),x=mt.getDerivedFromVars(mt.json.tint_mode),tt(),tt=l(x,(t=>I=t)),k=mt.getDerivedFromVars(mt.json.appearance_animation),K(),K=l(k,(t=>T=t)),j=mt.getDerivedFromVars(mt.json.filters),Q(),Q=l(j,(t=>P=t)),E=mt.getDerivedFromVars(mt.json.preload_required),ht(),ht=l(E,(t=>Z=t));{let t="gif"===mt.json.type?X:G;Ct="empty://"===t,Ct&&(t=Ze),xt=t}Et=0,xt?Dt=!1:(Dt=!0,mt.logError(st(new Error(`Missing "${"gif"===mt.json.type?"gif_url":"image_url"}" for "${mt.json.type}"`)))),C="wrap_content"===(null===(o=Y)||void 0===o?void 0:o.type),A="wrap_content"===(null===(a=J)||void 0===a?void 0:a.type),Ot=H?`url("${Xe(H)}")`:"",At=ft(L,1,At),Pt=wt(B)||Pt,St=function(t,e,r){let n=t.content_alignment_horizontal;const o=t.content_alignment_vertical;return"start"===n?n="ltr"===e?"left":"right":"end"===n&&(n="ltr"===e?"right":"left"),n&&"left"!==n&&"center"!==n&&"right"!==n||o&&"top"!==o&&"center"!==o&&"bottom"!==o?r:$t({content_alignment_horizontal:n,content_alignment_vertical:o})}(R,S,St),F=(null===(s=z)||void 0===s?void 0:s.description)||"";{var Ht;const t=null===(Ht=N)||void 0===Ht?void 0:Ht.ratio;Vt=t&&Gt(t)?(100/Number(t)).toFixed(2):"0"}{const t=M?ft(M):void 0,e=he(I,Tt);t===kt&&e===Tt||(bt.removeSvgFilter(kt,Tt),It=t?bt.addSvgFilter(t,e):"",kt=t,Tt=e)}if(T&&"fade"===T.type){const t=T;Mt=Nt(t.interpolator,"ease_in_out").replace(/_/g,"-"),Rt=jt(t.duration,300),Ut=jt(t.start_delay,0),zt=jt(t.alpha,0)}{let t="",e="";Array.isArray(P)&&P.length&&(t=Xt(P,mt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),Bt=t,Lt=e,Wt="rtl"===S&&Array.isArray(P)&&P.some((t=>"rtl_mirror"===t.type))}return D={aspect:"0"!==Vt,"is-width-content":C,"is-height-content":A,loaded:!1,"before-appearance":Boolean(Mt)&&!0,"is-rtl-mirror":Wt},O={"background-image":Ot,"background-color":Ot?void 0:At,"background-size":Pt,"clip-path":Lt||void 0,"object-fit":Pt,"object-position":St,filter:["",Bt].filter(Boolean).join(" "),"--divkit-appearance-interpolator":Mt||void 0,"--divkit-appearance-fade-start":Mt?zt:void 0,"--divkit-appearance-delay":Mt?`${Ut}ms`:void 0,"--divkit-appearance-duration":Mt?`${Rt}ms`:void 0},Q(),V(),K(),tt(),et(),rt(),nt(),ot(),it(),lt(),ct(),dt(),pt(),vt(),gt(),ht(),Dt?"":`${U(ae,"Outer").$$render(t,{cls:Ft("image",Ge,D),componentContext:mt,layoutParams:yt,customDescription:!0},{},{default:()=>D.aspect?`<span${W("class",Ge["image__aspect-wrapper"],0)}${q({"padding-bottom":`${Vt}%`})}><img${W("class",Ge.image__image,0)}${W("src",xt,0)}${W("loading",Z?"eager":"lazy",0)} decoding="async"${W("style",ut(O),0)}${W("alt",F,0)}${W("aria-hidden",F?null:"true",0)}${W("this",_t,0)}></span>`:`<img${W("class",Ge.image__image,0)}${W("src",xt,0)}${W("loading",Z?"eager":"lazy",0)} decoding="async"${W("style",ut(O),0)}${W("alt",F,0)}${W("aria-hidden",F?null:"true",0)}${W("this",_t,0)}>`})}`})),Ke={grid:"divkit-d9080",grid_halign_start:"divkit-fc24d",grid_halign_center:"divkit-a14a6",grid_halign_end:"divkit-cfd04",grid_valign_start:"divkit-c3106",grid_valign_center:"divkit-d4310",grid_valign_end:"divkit-fa9cf"};function tr(t){return t>0&&t<1}function er(t){return String(Math.ceil(1e3*t)/1e3)}function rr(t,e,r){if(t.some(tr)){const e=Math.max(...t.filter(tr).map((t=>1/t)));t=t.map((t=>t*e))}let n=0,o=0;const i=[];if(t.every(Boolean)){o=t.reduce(((t,e)=>t+e),0);for(let i=0;i<r;++i){if(!e[i])continue;const r=e[i]/t[i]*o;r>n&&(n=r)}}for(let e=0;e<r;++e)n?i[e]=`minmax(${dt(n*t[e]/o)},${er(t[e])}fr)`:t[e]?i[e]=`${er(t[e])}fr`:i[e]="auto";return i.join(" ")}function nr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function or(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?nr(Object(r),!0).forEach((function(e){ir(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ir(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const ar=L(((t,e,r,n)=>{let o,a,s,c,u,d,p,v,f,h,m,y,b,_,w,$=i,x=i,k=i,j=i,{componentContext:E}=e,{layoutParams:C}=e;m=l(g(at).direction,(t=>h=t));let A,F,D=1,O=[],P=[],S=[],V=[],T=0,I=!1,M="start",z="start";void 0===e.componentContext&&r.componentContext&&void 0!==E&&r.componentContext(E),void 0===e.layoutParams&&r.layoutParams&&void 0!==C&&r.layoutParams(C),o=E.origJson,o&&(D=1,M="start",z="start"),a=Array.isArray(E.json.items)&&E.json.items||[],s=E.getDerivedFromVars(E.json.column_count),j(),j=l(s,(t=>w=t)),c=E.getDerivedFromVars(E.json.content_alignment_vertical),x(),x=l(c,(t=>b=t)),u=E.getDerivedFromVars(E.json.content_alignment_horizontal),$(),$=l(u,(t=>y=t)),D=le(w,D),d=a.map(((t,e)=>E.produceChildContext(t,{path:e})));{let t=[];d.forEach((e=>{t.push(E.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),A=K(t,(t=>[...t])),k(),k=l(A,(t=>_=t))}{const t={};let e=0,r=0;O=[],P=[],S=[],V=[],I=!1,F=d.map(((n,o)=>{var i,a,s,l;const c=_[o],u=Number(c.columnSpan)||1,d=Number(c.rowSpan)||1,p={x:e,y:r,colSpan:u,rowSpan:d},v="match_parent"===(null===(i=c.width)||void 0===i?void 0:i.type)?Number(c.width.weight||1)/u:0,f="match_parent"===(null===(a=c.height)||void 0===a?void 0:a.type)?Number(c.height.weight||1)/d:0,g=1===u&&"fixed"===(null===(s=c.width)||void 0===s?void 0:s.type)&&c.width.value?Number(c.width.value)/u:0,h=1===d&&"fixed"===(null===(l=c.height)||void 0===l?void 0:l.type)&&c.height.value?Number(c.height.value)/d:0;for(let n=e;n<e+u;++n)for(let e=r;e<r+d;++e)t[n+"_"+e]?(I=!0,E.logError(st(new Error(`No space for item at index ${o}`)))):(t[n+"_"+e]=!0,(!O[n]||O[n]<v)&&(O[n]=v),(!P[e]||P[e]<f)&&(P[e]=f),(!S[n]||S[n]<g)&&(S[n]=g),(!V[e]||V[e]<h)&&(V[e]=h));do{++e,e>=D&&(e=0,++r)}while(t[e+"_"+r]);return{componentContext:n,layoutParams:{gridArea:p}}})),T=r}return M=fe(b,M),z=ve(y,h,z),p={valign:M,halign:z},v={"grid-template-columns":rr(O,S,D),"grid-template-rows":rr(P,V,T)},f=I,m(),$(),x(),k(),j(),f?"":`${U(ae,"Outer").$$render(t,{cls:Ft("grid",Ke,p),componentContext:E,style:v,layoutParams:C,parentOf:d.map((t=>t.json)),replaceItems:function(t){E=or(or({},E),{},{json:or(or({},E.json),{},{items:t.filter(mt)})})}},{},{default:()=>`${N(F,(e=>`${U(Yn,"Unknown").$$render(t,{componentContext:e.componentContext,layoutParams:e.layoutParams},{},{})}`))}`})}`})),sr=ar,lr={gallery:"divkit-cbb0f",gallery__scroller:"divkit-a4e39",gallery_scrollbar_none:"divkit-f49e7",gallery_orientation_horizontal:"divkit-c9be7",gallery_orientation_vertical:"divkit-a72d5","gallery_scroll-snap":"divkit-f606e","gallery__items-grid":"divkit-eb4a5",gallery__items:"divkit-af276",gallery__arrow:"divkit-b72d7","gallery__arrow-icon-path":"divkit-b4173"},cr="divkit-bf36b",ur="divkit-a67bf",dr="divkit-e2a31",pr="divkit-c684b";function vr(t){const e=[];let r=t[0],n=1;for(let o=1;o<=t.length;o++)t[o]!==r?(e.push(n>1?`repeat(${n}, ${r})`:r),r=t[o],n=1):n++;return e.join(" ")}function fr(t,e){let r;return function(...n){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,n),r=null}),e)}}function gr(t,e){let r=t%e;return r<0&&(r+=e),r}function hr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function mr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?hr(Object(r),!0).forEach((function(e){yr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function yr(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const br=L(((t,e,r,n)=>{let o,a,s,c,u,d,p,f,h,m,y,b,_,w,$,x,k,j,E,C,A,F,D,O,P,S,V,I,M,z,R,B,L,H,q=i,J=i,Y=i,G=i,X=i,Z=i,Q=i,tt=i,et=i,rt=i,nt=i,{componentContext:it}=e,{layoutParams:st}=e;const lt=g(at);let ct;A=l(lt.direction,(t=>C=t));let pt,vt=[],ft=!1,gt=!1,ht=null,yt=!1;const bt=lt.getCustomization("galleryLeftClass"),_t=lt.getCustomization("galleryRightClass");let wt,$t,xt,kt,Et,Ct=1,At="horizontal",Dt="start",Ot=8,Pt="",St=[],Tt={},It=!1,Nt={},zt=0;L=l(lt.isDesktop,(t=>B=t));const Ut=fr((function(){if(!ct)return;let t=ct.scrollLeft;"rtl"===C&&(t*=-1);const e=ct.scrollWidth,r=ct.offsetWidth;"ltr"===C?(ft=t>2,gt=t+r<e-2):(gt=t>2,ft=t+r<e-2)}),50);function Rt(){let t=[],e=vt[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<Ct;++e){const n=vt[e].children[r];n&&t.push(n)}return t}function Bt(t,e="smooth"){const r="horizontal"===At?"left":"top";ct.scroll({[r]:t,behavior:e})}function Lt(t,e,r="smooth"){const n="horizontal"===At,o=n?"offsetLeft":"offsetTop",i=t[e];if(i){let t;if("ltr"!==C&&n){const e=ct.offsetWidth;t=i[o]+i.offsetWidth+.01-Ot/2-e}else t=i[o]+.01-Ot/2;Bt(t,r)}}function Wt(t){const e=Rt(),r=ct.getBoundingClientRect(),n=e.findIndex((t=>function(t,e){return"horizontal"===At?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}(r,t.getBoundingClientRect())));if(-1!==n)return n;const o=e.map((t=>function(t,e){return"horizontal"===At?e.right>t.left&&t.right>e.left:e.bottom>t.top&&t.bottom>e.top}(r,t.getBoundingClientRect()))),i=o.findIndex(Boolean);return-1!==i?"prev"===t&&2===o.filter(Boolean).length?i+1:i:"prev"===t?1:e.length-2}v((()=>{yt=!1,wt&&!it.fakeElement&&(lt.unregisterInstance(wt),wt=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==it&&r.componentContext(it),void 0===e.layoutParams&&r.layoutParams&&void 0!==st&&r.layoutParams(st),o=it.origJson,o&&(Ct=1,At="horizontal",Dt="start",Ot=8,Pt=""),a=Array.isArray(it.json.items)&&it.json.items||[],s=it.getDerivedFromVars(it.json.column_count),rt(),rt=l(s,(t=>R=t)),c=it.getDerivedFromVars(it.json.orientation),et(),et=l(c,(t=>z=t)),u=it.getDerivedFromVars(it.json.cross_content_alignment),tt(),tt=l(u,(t=>M=t)),d=it.getDerivedFromVars(it.json.item_spacing),Q(),Q=l(d,(t=>I=t)),p=it.getDerivedFromVars(it.json.cross_spacing),Z(),Z=l(p,(t=>V=t)),f=it.getDerivedFromVars(it.json.paddings),X(),X=l(f,(t=>S=t)),h=it.getDerivedFromVars(it.json.scroll_mode),Y(),Y=l(h,(t=>O=t)),m=it.getDerivedFromVars(it.json.restrict_parent_scroll),nt(),nt=l(m,(t=>H=t)),y=it.getDerivedFromVars(it.json.scrollbar),J(),J=l(y,(t=>D=t)),b=it.getDerivedFromVars(it.json.default_item),q(),q=l(b,(t=>F=t)),_=a.map(((t,e)=>it.produceChildContext(t,{path:e}))),w=B&&yt,w?"undefined"!=typeof ResizeObserver&&(ht=new ResizeObserver((()=>{Ut()})),ht.observe(pt)):ht&&(ht.disconnect(),ht=null),Ct=le(R,Ct),$=function(t,e){let r=0,n=[];for(let o=0;o<t.length;++o)n[r]||(n[r]=[]),n[r].push(t[o]),++r>=e&&(r=0);return n}(_,Ct),At=Je(z,At),Dt=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(M,Dt),Ot=jt(I,Ot),$t=dt(Ot),kt=jt(V,Ot),xt=dt(kt),Pt=Vt(S,C,Pt),x="horizontal"===At?"grid-template-columns":"grid-template-rows";{let t=[];_.forEach((e=>{const r="horizontal"===At?"width":"height";t.push(it.getDerivedFromVars(e.json[r]))})),Et=K(t,(t=>t)),G(),G=l(Et,(t=>P=t))}St=[],Ct>1?St.push("auto"):P.forEach((t=>{!t&&"horizontal"===At||"match_parent"===(null==t?void 0:t.type)?St.push("100%"):St.push("max-content")}));{const t={};let e={};It=!1,"horizontal"===At?e.parentVAlign=Dt:e.parentHAlign=Dt,"paging"===O&&(It=!0,e.scrollSnap="start",t["horizontal"===At?"scroll-padding-left":"scroll-padding-top"]=dt(Ot/2)),1===Ct&&(e.parentLayoutOrientation=At),Tt=Mt(t,Tt),Nt=Mt(e,Nt)}return k={padding:Pt,"grid-gap":xt},j={"grid-gap":$t,[x]:vr(St)},E={orientation:At,"scroll-snap":It,scrollbar:"auto"===D?"auto":"none"},zt=jt(F,zt),it.json&&Ut(),it.json&&(wt&&(lt.unregisterInstance(wt),wt=void 0),it.json.id&&!it.fakeElement&&(wt=it.json.id,lt.registerInstance(wt,{setCurrentItem(t){const e=Rt();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Lt(e,t)},setPreviousItem(t,e){const r=Wt("prev"),n=Rt();let o=r-t;o<0&&(o="ring"===e?gr(o,n.length):0),Lt(n,o)},setNextItem(t,e){const r="horizontal"===At,n="ltr"!==C&&r?-1:1,o=r?ct.scrollLeft*n+ct.offsetWidth===ct.scrollWidth:ct.scrollTop+ct.offsetHeight===ct.scrollHeight,i=Rt();if(o&&"ring"===e)return void Lt(i,0);let a=Wt("next")+t;a>i.length-1&&(a="ring"===e?gr(a,i.length):i.length-1),Lt(i,a)},scrollToStart(){Bt(0)},scrollToEnd(){Bt("ltr"===C||"horizontal"!==At?1e6:-1e6)},scrollBackward(t,e){const r="horizontal"===At,n="ltr"!==C&&r?-1:1,o=r?ct.scrollLeft:ct.scrollTop,i=r?ct.scrollWidth-ct.offsetWidth:ct.scrollHeight-ct.offsetHeight;let a=o*n-t;a<0&&("clamp"===e?a=0:"ring"===e&&(a=gr(a,i))),Bt(a*n)},scrollForward(t,e){const r="horizontal"===At,n="ltr"!==C&&r?-1:1,o=r?ct.scrollLeft:ct.scrollTop,i=r?ct.scrollWidth-ct.offsetWidth:ct.scrollHeight-ct.offsetHeight;let a=o*n+t;a>i&&("clamp"===e?a=i:"ring"===e&&(a=gr(a,i))),Bt(a*n)},scrollToPosition(t){Bt("ltr"===C||"horizontal"!==At?t:-t)}}))),A(),q(),J(),Y(),G(),X(),Z(),Q(),tt(),et(),rt(),L(),nt(),` ${U(ae,"Outer").$$render(t,{cls:Ft("gallery",lr,E),componentContext:it,layoutParams:st,customPaddings:!0,customActions:"gallery",parentOf:a,replaceItems:function(t){it=mr(mr({},it),{},{json:mr(mr({},it.json),{},{items:t.filter(mt)})})}},{},{default:()=>`<div class="${T(lr.gallery__scroller,!0)+" "+T(H?ot:"",!0)}"${W("style",ut(Tt),0)}${W("this",ct,0)}><div${W("class",lr["gallery__items-grid"],0)}${W("style",ut(k),0)}${W("this",pt,0)}>${N($,((e,r)=>`<div${W("class",lr.gallery__items,0)}${W("style",ut(j),0)}${W("this",vt[r],0)}>${N(e,(e=>`${U(Yn,"Unknown").$$render(t,{componentContext:e,layoutParams:Nt},{},{})}`))} </div>`))}</div></div> ${"horizontal"===At?`${ft&&w?` <div${W("class",bt||`${lr.gallery__arrow} ${cr} ${dr}`,0)}>${bt?"":`<svg${W("class",ur,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${W("class",lr["gallery__arrow-icon-path"],0)} d="m10 16 8.3 8 1.03-1-4-6-.7-1 .7-1 4-6-1.03-1z"></path></svg>`}</div>`:""} ${gt&&w?` <div${W("class",_t||`${lr.gallery__arrow} ${cr} ${pr}`,0)}>${_t?"":`<svg${W("class",ur,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${W("class",lr["gallery__arrow-icon-path"],0)} d="M22 16l-8.3 8-1.03-1 4-6 .7-1-.7-1-4-6 1.03-1 8.3 8z"></path></svg>`}</div>`:""}`:""}`})}`})),_r=br,wr={tabs:"divkit-e0df5",tabs__list:"divkit-ea19b",tabs__item:"divkit-c25c7",tabs__item_selected:"divkit-d560a",tabs__item_actionable:"divkit-dfda0",tabs__panels:"divkit-f5dc0",tabs__swiper:"divkit-eb42c",tabs__swiper_animated:"divkit-b9f18",tabs__swiper_inited:"divkit-fa574",tabs__panel:"divkit-cc9fb",tabs__panel_visible:"divkit-e7306","tabs_height-parent_yes":"divkit-ae594",tabs__separator:"divkit-b85bf"};function $r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function xr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$r(Object(r),!0).forEach((function(e){kr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$r(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function kr(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const jr=L(((t,e,r,n)=>{var o;let a,s,c,u,d,p,f,h,m,y,b,_,w,x,k,j,E,C,A,F,D,O,P,S,V,I,M,z,R,B,L=i,H=i,J=i,Y=i,G=i,X=i,Z=i,K=i,tt=i,{componentContext:et}=e,{layoutParams:rt}=e;const nt=g(at);S=l(nt.direction,(t=>P=t));const it=nt.genId("tabs");let lt,ct=!1,vt=Q([]);F=l(vt,(t=>A=t));let gt,ht,mt,yt,bt,_t,wt,$t={},xt={},kt=12,Et="",Ct="",At="",Dt="",Pt="",Tt="",It="",Nt="",zt="",Ut="",Wt=0,Ht="",qt="",Yt=null,Xt=!1,Zt=!1,Qt=[],Kt=[],te=null;async function ee(t,e=!1){if(_t=x,x=t,Xt||(Xt=!0,ht.style.height=dt(ht.clientHeight),mt.style.transform=`translate3d(${100*-(null!==(r=_t)&&void 0!==r?r:x)}%,0,0)`),Zt=!0,async function(t){await $(),mt.style.transform=`translate3d(${t}%,0,0)`}(100*-x),function(t=!1){var e,r;const n=t?Math.max(0,x-1):Math.min(x,null!==(e=_t)&&void 0!==e?e:x),o=t?Math.min(s.length-1,x+1):Math.max(x,null!==(r=_t)&&void 0!==r?r:x);Qt=Qt.map(((t,e)=>{var r;return t||(e>=n&&e<=o&&null!==(r=s[e])&&void 0!==r&&r.div?et.produceChildContext(s[e].div,{path:e}):void 0)})),Kt=Kt.map(((t,e)=>e>=n&&e<=o))}(),async function(){var t;if("match_parent"===(null===(t=C)||void 0===t?void 0:t.type))return;await $();const e=document.getElementById(`${it}-panel-${x}`);e&&(ht.style.height=dt(e.offsetHeight))}(),te&&clearTimeout(te),te=window.setTimeout((()=>{Kt=s.map(((t,e)=>e===x))}),400),wt=-x*ht.clientWidth,e){await $();const t=gt.querySelector(`.${wr.tabs__item_selected}`);t&&t.focus()}var r}if(v((()=>{lt&&(nt.unregisterInstance(lt),lt=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==et&&r.componentContext(et),void 0===e.layoutParams&&r.layoutParams&&void 0!==rt&&r.layoutParams(rt),a=et.origJson,a&&(kt=12,Et="",Dt="",yt=void 0,Pt="",bt=void 0,Tt="",It="",Nt="",zt="",Ut="",Wt=0,Ht="",qt="",Yt=null),s=Array.isArray(et.json.items)&&et.json.items||[],c=s.map((t=>t.div)),u=et.getDerivedFromVars(et.json.width),K(),K=l(u,(t=>R=t)),d=et.getDerivedFromVars(et.json.height),L(),L=l(d,(t=>C=t)),p=et.getJsonWithVars(et.json.selected_tab),f=et.getDerivedFromVars(et.json.tab_title_style),Z(),Z=l(f,(t=>z=t)),h=et.getDerivedFromVars(et.json.has_separator),X(),X=l(h,(t=>M=t)),m=et.getDerivedFromVars(et.json.separator_color),G(),G=l(m,(t=>I=t)),y=et.getDerivedFromVars(et.json.separator_paddings),Y(),Y=l(y,(t=>V=t)),b=et.getDerivedFromVars(et.json.switch_tabs_by_content_swipe_enabled),J(),J=l(b,(t=>O=t)),_=et.getDerivedFromVars(et.json.restrict_parent_scroll),tt(),tt=l(_,(t=>B=t)),w=et.getDerivedFromVars(et.json.title_paddings),H(),H=l(w,(t=>D=t)),x=p&&Number(p)||0,Array.isArray(s)&&s.length){let t=[];s.forEach(((e,r)=>{const n=et.getJsonWithVars({index:r,title:e.title,title_click_action:e.title_click_action});n.title&&"string"==typeof n.title?t.push(n):et.logError(st(new Error("Incorrect title for the tab"),{additional:{index:r}}))})),vt.set(t)}else vt.set([]);var re,ne;null!==(re=A)&&void 0!==re&&re.length?ct=!1:(ct=!0,et.logError(st(new Error('Incorrect or empty "items" prop for div "tabs"'))));{var oe;let t={parentContainerOrientation:"horizontal"};"wrap_content"===(null===(oe=R)||void 0===oe?void 0:oe.type)&&(t.parentHorizontalWrapContent=!0),C&&"wrap_content"!==C.type||(t.parentVerticalWrapContent=!0),$t=Mt(t,$t)}if(!ct&&(x<0||x>=s.length)&&(et.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:et.json.selected_tab,length:s.length}})),x=x<0?0:s.length-1),ct||A.some((t=>x===t.index))||(et.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:et.json.selected_tab}})),x=(null===(ne=A[0])||void 0===ne?void 0:ne.index)||0),k=z||{},kt=le(k.font_size,kt),k.font_size||k.paddings){const t=k.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/kt*10,right:(Number("ltr"===P?t.end:t.start)||Number(t.right)||0)/kt*10,bottom:(Number(t.bottom)||0)/kt*10,left:(Number("ltr"===P?t.start:t.end)||Number(t.left)||0)/kt*10};Et=Vt(e,P,Et)}{const t=k.line_height;void 0!==t&&Gt(t)&&(Ct=dt(t/kt*10))}{const t=k.letter_spacing;void 0!==t&&St(t)&&(At=dt(t/kt*10))}if(k.corner_radius||k.corners_radius||k.font_size){var ie;const t=null!==(ie=k.corner_radius)&&void 0!==ie?ie:1e3;k.corners_radius?Dt=function(t,e,r,n){const o=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<o.length;++t)if(o[t]&&!St(o[t]))return n;return Bt(t,e,r)}(k.corners_radius,t,kt,Dt):St(t)&&(Dt=dt(t/kt*10))}return yt=ue(k.active_font_weight||k.font_weight,yt),Pt=k.font_family&&"string"==typeof k.font_family?nt.typefaceProvider(k.font_family,{fontWeight:yt||400}):"",bt=ue(k.inactive_font_weight||k.font_weight,bt),Tt=k.font_family&&"string"==typeof k.font_family?nt.typefaceProvider(k.font_family,{fontWeight:bt||400}):"",It=ft(k.active_text_color,1,It),Nt=ft(k.inactive_text_color,1,Nt),zt=ft(k.active_background_color,1,zt),Ut=ft(k.inactive_background_color,1,Ut),Wt=jt(k.item_spacing,Wt),M&&(I&&(Ht=ft(I,1,Ht)),V&&(qt=Vt(V,P,qt))),j={background:Ht,margin:qt},E=void 0===O||Boolean(O),Yt=Rt(D||void 0,Yt),function(t){ct||(Qt=t.map(((t,e)=>{if(e===x&&null!=t&&t.div)return et.produceChildContext(t.div,{path:e})})),Kt=t.map(((t,e)=>e===x)))}(s),et.json&&(lt&&(nt.unregisterInstance(lt),lt=void 0),!et.json.id||ct||et.fakeElement||(lt=et.json.id,nt.registerInstance(lt,{setCurrentItem(t){if(t<0||t>s.length-1)throw new Error('Item is out of range in "set-current-item" action');ee(t)},setPreviousItem(t,e){let r=x-t;r<0&&(r="ring"===e?gr(r,s.length):0),ee(r)},setNextItem(t,e){let r=x+t;r>s.length-1&&(r="ring"===e?gr(r,s.length):s.length-1),ee(r)},scrollToStart(){ee(0)},scrollToEnd(){ee(s.length-1)}}))),xt={"height-parent":"match_parent"===(null===(o=C)||void 0===o?void 0:o.type)?"yes":""},L(),F(),H(),J(),S(),Y(),G(),X(),Z(),K(),tt(),ct?"":`${U(ae,"Outer").$$render(t,{cls:Ft("tabs",wr,xt),componentContext:et,layoutParams:rt,customActions:"tabs",parentOf:c,parentOfSimpleMode:!0,replaceItems:function(t){et.json.items&&(et=xr(xr({},et),{},{json:xr(xr({},et.json),{},{items:et.json.items.map(((e,r)=>xr(xr({},e),{},{div:t[r]})))})}))}},{},{default:()=>` <div class="${T(wr.tabs__list,!0)+" "+T(B?ot:"",!0)}" role="tablist"${q({"--divkit-tabs-title-padding":Yt?Ot(Yt,P):"","--divkit-tabs-font-size":dt(kt),"--divkit-tabs-paddings":Et,"--divkit-tabs-line-height":Ct,"--divkit-tabs-letter-spacing":At,"--divkit-tabs-active-font-weight":yt||"","--divkit-tabs-inactive-font-weight":bt||"","--divkit-tabs-active-font-family":Pt||"","--divkit-tabs-inactive-font-family":Tt||"","--divkit-tabs-active-text-color":It,"--divkit-tabs-inactive-text-color":Nt,"--divkit-tabs-active-background-color":zt,"--divkit-tabs-inactive-background-color":Ut,"--divkit-tabs-border-radius":Dt,"--divkit-tabs-items-spacing":Wt?pt(10*Wt/kt):""})}${W("this",gt,0)}>${N(A,(e=>{let r=e.index,n=r===x;return` ${U(Jt,"Actionable").$$render(t,{componentContext:et,cls:Ft("tabs__item",wr,{selected:n,actionable:Boolean(e.title_click_action)}),actions:e.title_click_action&&!et.fakeElement?[e.title_click_action].filter(Lt):[],attrs:{id:`${it}-tab-${r}`,"aria-controls":`${it}-panel-${r}`,role:"tab",tabindex:n&&!et.fakeElement?e.title_click_action?void 0:"0":"-1","aria-selected":n?"true":"false"},customAction:et.fakeElement?null:t=>function(t,e){return x===e||(ee(e),!1)}(0,r)},{},{default:()=>`${T(e.title)}`})}`}))}</div> ${M?`<div${W("class",wr.tabs__separator,0)}${W("style",ut(j),0)}></div>`:""} <div class="${T(wr.tabs__panels,!0)+" "+T(B?ot:"",!0)}"${W("this",ht,0)}><div${W("class",Ft("tabs__swiper",wr,{inited:Xt,animated:Zt}),0)}${W("this",mt,0)}>${N(A,(e=>{let r=e.index,n=Qt[r];return` <div${W("class",Ft("tabs__panel",wr,{visible:Kt[r]}),0)} role="tabpanel" id="${T(it,!0)+"-panel-"+T(r,!0)}" aria-labelledby="${T(it,!0)+"-tab-"+T(r,!0)}" style="${"left: "+T(100*r,!0)+"%"}">${n?`${U(Yn,"Unknown").$$render(t,{componentContext:n,layoutParams:$t},{},{})}`:""} </div>`}))}</div></div>`})}`})),Er=jr,Cr="divkit-eb860",Ar="divkit-e08c6";function Fr(t){return e=>{if(e<=0)return 0;if(e>=1)return 1;const r=e*t.length,n=Math.floor(r),o=r-n;return t[n]*o+t[n+1]*(1-o)}}function Dr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Or(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Dr(Object(r),!0).forEach((function(e){Pr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Dr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Pr(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Fr([.0021,.0045,.0071,.01,.0131,.0165,.0202,.0242,.0284,.033,.0378,.0429,.0483,.054,.0601,.0664,.0731,.08,.0872,.0948,.1026,.1108,.1192,.1279,.1369,.1461,.1556,.1653,.1753,.1855,.1958,.2064,.2171,.2279,.2389,.25,.2612,.2725,.2839,.2952,.3067,.3181,.3295,.341,.3524,.3637,.375,.3863,.3974,.4085,.4195,.4304,.4412,.4519,.4624,.4729,.4832,.4934,.5034,.5133,.5231,.5327,.5422,.5516,.5608,.5699,.5788,.5876,.5963,.6048,.6132,.6214,.6295,.6375,.6453,.653,.6606,.668,.6754,.6825,.6896,.6965,.7034,.7101,.7166,.7231,.7295,.7357,.7418,.7479,.7538,.7596,.7653,.7709,.7764,.7818,.7871,.7923,.7974,.8024,.8073,.8122,.8169,.8216,.8261,.8306,.835,.8394,.8436,.8478,.8518,.8558,.8598,.8636,.8674,.8711,.8747,.8783,.8818,.8852,.8886,.8919,.8951,.8983,.9014,.9044,.9074,.9103,.9131,.9159,.9187,.9213,.924,.9265,.929,.9315,.9339,.9362,.9385,.9408,.943,.9451,.9472,.9492,.9512,.9532,.9551,.9569,.9587,.9605,.9622,.9638,.9655,.967,.9686,.9701,.9715,.9729,.9743,.9756,.9769,.9782,.9794,.9805,.9817,.9828,.9838,.9848,.9858,.9868,.9877,.9886,.9894,.9902,.991,.9917,.9924,.9931,.9937,.9943,.9949,.9954,.9959,.9964,.9969,.9973,.9977,.998,.9983,.9986,.9989,.9991,.9993,.9995,.9997,.9998,.9999,.9999,1,1]),Fr([5e-4,.002,.0045,.0078,.0119,.0168,.0224,.0286,.0355,.0429,.0508,.0592,.0681,.0774,.087,.0969,.1072,.1177,.1285,.1395,.1507,.1621,.1736,.1853,.197,.2089,.2208,.2328,.2448,.2569,.2689,.281,.293,.305,.317,.3289,.3408,.3526,.3644,.376,.3876,.3991,.4105,.4218,.433,.444,.455,.4658,.4765,.4871,.4975,.5078,.518,.528,.5379,.5477,.5573,.5668,.5761,.5853,.5944,.6033,.612,.6206,.6291,.6374,.6456,.6537,.6616,.6693,.677,.6845,.6918,.699,.7061,.713,.7199,.7265,.7331,.7395,.7458,.752,.758,.764,.7698,.7755,.781,.7865,.7918,.7971,.8022,.8072,.8121,.8169,.8216,.8262,.8307,.8351,.8394,.8436,.8477,.8517,.8557,.8595,.8633,.8669,.8705,.874,.8775,.8808,.8841,.8873,.8904,.8934,.8964,.8993,.9022,.9049,.9076,.9103,.9129,.9154,.9178,.9202,.9226,.9249,.9271,.9293,.9314,.9335,.9355,.9375,.9394,.9413,.9431,.9449,.9466,.9483,.95,.9516,.9532,.9547,.9562,.9576,.9591,.9605,.9618,.9631,.9644,.9657,.9669,.9681,.9692,.9703,.9714,.9725,.9736,.9746,.9756,.9765,.9775,.9784,.9793,.9802,.981,.9818,.9826,.9834,.9842,.9849,.9856,.9863,.987,.9877,.9883,.989,.9896,.9902,.9908,.9913,.9919,.9924,.993,.9935,.994,.9944,.9949,.9954,.9958,.9963,.9967,.9971,.9975,.9979,.9983,.9986,.999,.9993,.9997,1]);const Sr=L(((t,e,r,n)=>{let o,i,a,s,l,c,u,{componentContext:d}=e,{layoutParams:p}=e;const h=g(at),m=g(Dt);let y,b,_,w,x=!1,k=new Map,j=new Set,E=null,C=[],A=[],F=[],D=[],O=!1;function P(t){w=null!=t&&t.div?d.produceChildContext(t.div,{path:t.state_id||"<unknown>"}):void 0}async function S(t){if(_===t)return;h.setRunning("stateChange",!0);new Set(j);C.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),C=[];D.forEach((t=>{k.set(t.id,t.node.getBoundingClientRect())})),A=[],F=[],D=[];const e=c.find((e=>e.state_id===t))||null;var r;e?(_=t,null===(r=s)||void 0===r||r.setValue(_),P(e)):d.logError(st(new Error("Cannot find state with id"),{additional:{stateId:t}})),await $()}var V;return f(Dt,{registerInstance(t,e){E||(E=new Map),E.has(t)?d.logError(st(new Error("Duplicate state with id"),{additional:{id:t}})):E.set(t,e)},unregisterInstance(t){var e;null===(e=E)||void 0===e||e.delete(t)},runVisibilityTransition:(t,e,r,n,o)=>Promise.resolve(),registerChildWithTransitionIn(t,e,r,n){const o={json:t,parentComponentContext:e,transitions:r,node:n};return A.push(o),new Promise((t=>{o.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,n){const o={json:t,parentComponentContext:e,transitions:r,node:n};return F.push(o),new Promise((t=>{o.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,n){const o=t.id;if(!o)return Promise.resolve();const i={id:o,json:t,parentComponentContext:e,transitions:r,node:n};return D.push(i),new Promise((t=>{i.resolvePromise=t}))},hasTransitionChange:t=>!!t&&k.has(t),registerChild(t){j.add(t)},unregisterChild(t){j.delete(t)}}),v((()=>{b&&m.unregisterInstance(b)})),void 0===e.componentContext&&r.componentContext&&void 0!==d&&r.componentContext(d),void 0===e.layoutParams&&r.layoutParams&&void 0!==p&&r.layoutParams(p),o=d.json.div_id||d.json.id,i=d.getJsonWithVars(d.json.default_state_id),a=d.json.state_id_variable,s=a?d.getVariable(a,"string"):null,l=d.origJson,l&&(O=!1),o?x=!1:(x=!0,d.logError(st(new Error('Missing "id" prop for div "state"')))),d.json&&(j=new Set),c=Array.isArray(d.json.states)&&d.json.states||[],u=c.map((t=>t.div)),null!==(V=c)&&void 0!==V&&V.length?x=!1:(x=!0,d.logError(st(new Error('Empty "states" prop for div "state"')))),d.json&&(b&&(m.unregisterInstance(b),b=void 0),!o||null!=d&&d.fakeElement||(b=o,m.registerInstance(o,{setState:S,getChild:function(t){if(E&&E.has(t))return E.get(t);d.logError(st(new Error("Missing state block with id"),{additional:{id:t}}))}}))),!O&&function(t){if(!O&&(O=!0,t.length)){var e;const r=(null===(e=s)||void 0===e?void 0:e.getValue())||i;if(r){_=r;const e=t.find((t=>t.state_id===_))||null;P(e),e||d.logError(st(new Error("Cannot find state for default_state_id"),{additional:{selectedId:_}}))}else{const e=t[0];_=e.state_id,P(e)}s&&(s.setValue(_),s.subscribe((t=>{S(t)})))}}(c),x?"":`${U(ae,"Outer").$$render(t,{cls:"divkit-b8efc",componentContext:d,layoutParams:p,parentOf:u,parentOfSimpleMode:!0,replaceItems:function(t){const e=d.json.states;e&&(c=e.map(((e,r)=>Or(Or({},e),{},{div:t[r]}))),d.json=Or(Or({},d.json),{},{states:c}),_&&P(c.find((t=>t.state_id===_))||null))}},{},{default:()=>`${w?`${U(Yn,"Unknown").$$render(t,{componentContext:w},{},{})}`:""} <div${W("class","divkit-adaae",0)} aria-hidden="true"${W("this",y,0)}>${N(C,(e=>"direction"in e?`<div${W("class",Cr,0)}${q({left:`${e.offsetLeft}px`,top:`${e.offsetTop}px`,width:`${e.width}px`,height:`${e.height}px`})}><div${W("class",Ar,0)}>${U(Yn,"Unknown").$$render(t,{componentContext:e.componentContextCopy},{},{})}</div> </div>`:`<div${W("class",Cr,0)}><div${W("class",Ar,0)}>${U(Yn,"Unknown").$$render(t,{componentContext:e.componentContextCopy},{},{})}</div> </div>`))}</div>`})}`})),Vr=Sr,Tr={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f",pager__arrow:"divkit-d78c2","pager__arrow-icon-path":"divkit-a94d9"};function Ir(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Mr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ir(Object(r),!0).forEach((function(e){Nr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ir(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Nr(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const zr=L(((t,e,r,n)=>{let o,a,s,u,d,p,f,h,m,y,b,_,w,$,x,k,j,E,C,A,F,D,O,P,S,V=i,I=i,M=i,z=i,R=i,B=i,{componentContext:L}=e,{layoutParams:H}=e;const q=g(at);E=l(q.direction,(t=>j=t));const J=q.genId("pager"),Y=q.getCustomization("pagerLeftClass"),G=q.getCustomization("pagerRightClass");A=l(q.isDesktop,(t=>C=t)),fr((function(){if(!Q)return;const t=function(){const t=Array.from(Z.children),e=Z.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,n=t.getBoundingClientRect(),"horizontal"===rt?n.left>=r.left&&n.right<=r.right:n.top>=r.top&&n.bottom<=r.bottom;var r,n}));return-1!==r?r:K}();t!==K&&(K=t)}),50);let X,Z,Q=!1,K=0,tt=0,et=!1,rt="horizontal",nt="",it="",lt="";function ct(t,e="smooth"){const r="horizontal"===rt,n=Z.children[t],o=r?"offsetLeft":"offsetTop",i=r?"left":"top";Z.scroll({[i]:n[o],behavior:e}),K=t}v((()=>{Q=!1,X&&(q.unregisterInstance(X),X=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==L&&r.componentContext(L),void 0===e.layoutParams&&r.layoutParams&&void 0!==H&&r.layoutParams(H),o=L.origJson,o&&(it=""),a=L.getDerivedFromVars(L.json.layout_mode),I(),I=l(a,(t=>F=t)),s=L.getDerivedFromVars(L.json.orientation),R(),R=l(s,(t=>P=t)),u=L.getDerivedFromVars(L.json.item_spacing),z(),z=l(u,(t=>O=t)),d=L.getDerivedFromVars(L.json.paddings),M(),M=l(d,(t=>D=t)),p=L.getDerivedFromVars(L.json.restrict_parent_scroll),B(),B=l(p,(t=>S=t)),f=(Array.isArray(L.json.items)&&L.json.items||[]).map(((t,e)=>L.produceChildContext(t,{path:e}))),F?"percentage"!==F.type&&"fixed"!==F.type?(et=!0,L.logError(st(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):et=!1:(et=!0,L.logError(st(new Error('Empty "layout_mode" prop for div "pager"')))),rt=Je(P,rt);{var vt;const t=null===(vt=O)||void 0===vt?void 0:vt.value;t&&St(t)&&(nt=dt(t||0))}var ft,gt;if(it=Vt(D,j,it),h="horizontal"===rt?"grid-auto-columns":"grid-auto-rows","fixed"===(null===(ft=F)||void 0===ft?void 0:ft.type)){var ht,yt,bt,_t,wt,$t,xt,kt,jt;const t=pt("horizontal"===rt?(("ltr"===j?null===(ht=L.json.paddings)||void 0===ht?void 0:ht.start:null===(yt=L.json.paddings)||void 0===yt?void 0:yt.end)||(null===(bt=L.json.paddings)||void 0===bt?void 0:bt.left)||0)+(("ltr"===j?null===(_t=L.json.paddings)||void 0===_t?void 0:_t.end:null===(wt=L.json.paddings)||void 0===wt?void 0:wt.start)||(null===($t=L.json.paddings)||void 0===$t?void 0:$t.right)||0):((null===(xt=L.json.paddings)||void 0===xt?void 0:xt.top)||0)+((null===(kt=L.json.paddings)||void 0===kt?void 0:kt.bottom)||0)),e=null===(jt=F.neighbour_page_width)||void 0===jt?void 0:jt.value;lt=e?`calc(100% + ${t} - 2 * ${pt(e)} - 2 * ${nt})`:"100%"}else if("percentage"===(null===(gt=F)||void 0===gt?void 0:gt.type)){var Et;const t=null===(Et=F.page_width)||void 0===Et?void 0:Et.value;lt=`${Number(t)}%`}return m={"grid-gap":nt,padding:it,[h]:lt},y={orientation:rt},b=et,_=C&&Q&&!b,w="ltr"===j?K>0:K+1<f.length,$="ltr"===j?K+1<f.length:K>0,x=q.getStore("pagers"),V(),V=l(x,(t=>k=t)),function(t,e){const r=L.json.id;if(r){const n=new Map(k);c(x,k=n.set(r,{instId:J,size:t,currentItem:e,scrollToPagerItem:ct}),k)}}(f.length,K),function(t){var e;if(t===tt)return;tt=t;const r=L.getJsonWithVars(null===(e=f[t].json)||void 0===e?void 0:e.selected_actions);null!=r&&r.length&&L.execAnyActions(r)}(K),L.json&&(X&&(q.unregisterInstance(X),X=void 0),L.json.id&&!L.fakeElement&&(X=L.json.id,q.registerInstance(X,{setCurrentItem(t){if(t<0||t>f.length-1)throw new Error('Item is out of range in "set-current-item" action');ct(t)},setPreviousItem:function(t,e){let r=K-t;r<0&&(r="ring"===e?gr(r,f.length):0),ct(r)},setNextItem:function(t,e){let r=K+t;r>f.length-1&&(r="ring"===e?gr(r,f.length):f.length-1),ct(r)},scrollToStart(){ct(0)},scrollToEnd(){ct(f.length-1)}}))),V(),E(),A(),I(),M(),z(),R(),B(),b?"":`${U(ae,"Outer").$$render(t,{cls:Ft("pager",Tr,y),componentContext:L,layoutParams:H,customPaddings:!0,parentOf:f.map((t=>t.json)),replaceItems:function(t){L=Mr(Mr({},L),{},{json:Mr(Mr({},L.json),{},{items:t.filter(mt)})})}},{},{default:()=>`<div class="${T(Tr.pager__items,!0)+" "+T(S?ot:"",!0)}"${W("style",ut(m),0)}${W("this",Z,0)}>${N(f,(e=>`<div${W("class",Tr.pager__item,0)}>${U(Yn,"Unknown").$$render(t,{componentContext:e},{},{})} </div>`))}</div> ${w&&_?` <div${W("class",Y||`${Tr.pager__arrow} ${cr} ${dr}`,0)}>${Y?"":`<svg${W("class",ur,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${W("class",Tr["pager__arrow-icon-path"],0)} d="m10 16 8.3 8 1.03-1-4-6-.7-1 .7-1 4-6-1.03-1z"></path></svg>`}</div>`:""} ${$&&_?` <div${W("class",G||`${Tr.pager__arrow} ${cr} ${pr}`,0)}>${G?"":`<svg${W("class",ur,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${W("class",Tr["pager__arrow-icon-path"],0)} d="M22 16l-8.3 8-1.03-1 4-6 .7-1-.7-1-4-6 1.03-1 8.3 8z"></path></svg>`}</div>`:""}`})}`})),Ur=zr,Rr={indicator:"divkit-d8e3f",indicator__scroller:"divkit-b5db0",indicator__items:"divkit-d5d94",indicator__item:"divkit-f6629",indicator_placement_default:"divkit-c1670",indicator__item_active:"divkit-b39cd",indicator_direction_ltr:"divkit-a7473",indicator_direction_rtl:"divkit-a7d63",indicator_placement_stretch:"divkit-b6bd3"};function Br(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Lr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Br(Object(r),!0).forEach((function(e){Wr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Br(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Wr(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const Hr=["rounded_rectangle","circle"],qr=L(((t,e,r,n)=>{let o,a,s,c,u,d,p,v,f,h,m,y,b,_,w,x,k,j,E,C,A,F,D=i,O=i,P=i,S=i,V=i,I=i,M=i,z=i,R=i,{componentContext:B}=e,{layoutParams:L}=e;const H=g(at);b=l(H.direction,(t=>y=t));let J,Y,G,X={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},Z={width:10,height:10,borderRadius:5,background:"#33919cb5"},Q="default",K=15,et=10,rt=5;if(void 0===e.componentContext&&r.componentContext&&void 0!==B&&r.componentContext(B),void 0===e.layoutParams&&r.layoutParams&&void 0!==L&&r.layoutParams(L),o=B.origJson,o&&(Q="default",K=15,et=10,rt=5,X={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},Z={width:10,height:10,borderRadius:5,background:"#33919cb5"}),a=B.getDerivedFromVars(B.json.shape),I(),I=l(a,(t=>E=t)),s=B.getDerivedFromVars(B.json.active_item_color),S(),S=l(s,(t=>k=t)),c=B.getDerivedFromVars(B.json.inactive_item_color),V(),V=l(c,(t=>j=t)),u=B.getDerivedFromVars(B.json.active_item_size),M(),M=l(u,(t=>C=t)),d=B.getDerivedFromVars(B.json.active_shape),R(),R=l(d,(t=>F=t)),p=B.getDerivedFromVars(B.json.inactive_shape),z(),z=l(p,(t=>A=t)),v=B.getDerivedFromVars(B.json.space_between_centers),O(),O=l(v,(t=>w=t)),f=B.getDerivedFromVars(B.json.items_placement),P(),P=l(f,(t=>x=t)),F&&(X=Ae({type:"shape_drawable",shape:F},Hr,X)),A&&(Z=Ae({type:"shape_drawable",shape:A},Hr,Z)),!F&&!A&&E){const t=le(C,1.3);Z=Ae({type:"shape_drawable",shape:E,color:Z.background},Hr,Z),Z.background=ft(j,1,Z.background),X=Lr(Lr({},Z),{},{width:Z.width*t,height:Z.height*t,borderRadius:Z.borderRadius*t,background:X.background}),X.background=ft(k,1,X.background)}var nt;if(!x||"default"!==x.type&&"stretch"!==x.type)Q="default",w&&(K=jt(w.value,K));else if(Q=x.type,"default"===Q)K=jt(null===(nt=x.space_between_centers)||void 0===nt?void 0:nt.value,K);else if("stretch"===Q){var ot;const t=x;et=le(t.max_visible_items,et),rt=jt(null===(ot=t.item_spacing)||void 0===ot?void 0:ot.value,rt)}return h=H.getStore("pagers"),D(),D=l(h,(t=>_=t)),async function(t){if(B.json.pager_id&&t.has(B.json.pager_id)&&(G=t.get(B.json.pager_id),await $(),Y)){const t=Y.children[G.currentItem];if(t){const e=t.offsetLeft;J.scroll({left:e-J.clientWidth/2,behavior:"smooth"})}}}(_),m={placement:Q,direction:y},b(),D(),O(),P(),S(),V(),I(),M(),z(),R(),`${U(ae,"Outer").$$render(t,{cls:Ft("indicator",Rr,m),componentContext:B,layoutParams:L},{},{default:()=>`<div${W("class",Rr.indicator__scroller,0)}${W("this",J,0)}><div${W("class",Rr.indicator__items,0)} role="tablist"${q({margin:"default"===Q?`0 ${dt(Math.max(0,X.width-Z.width)/2)}`:"","--divkit-indicator-inactive-width":dt(Z.width),"--divkit-indicator-inactive-height":dt(Z.height),"--divkit-indicator-inactive-border-radius":dt(Z.borderRadius),"--divkit-indicator-inactive-background":Z.background||"","--divkit-indicator-inactive-box-shadow":Z.boxShadow||"","--divkit-indicator-active-width":dt(X.width),"--divkit-indicator-active-height":dt(X.height),"--divkit-indicator-active-border-radius":dt(X.borderRadius),"--divkit-indicator-active-background":X.background||"","--divkit-indicator-active-box-shadow":X.boxShadow||"","--divkit-indicator-active-scale":X.width/Z.width,"--divkit-indicator-default-margin":"default"===Q?`0 ${dt((K-Z.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===Q?dt(rt):"","--divkit-indicator-stretch-max-count":"stretch"===Q?et:"","--divkit-indicator-stretch-max-spacer":"stretch"===Q?dt((et-1)*rt):""})}${W("this",Y,0)}>${G?`${N(Array(G.size),((t,e)=>{let r=e===G.currentItem;return` <div class="${T(Ft("indicator__item",Rr,{active:r}),!0)+" "+T(tt,!0)}" role="tab" id="${T(G.instId,!0)+"-tab-"+T(e,!0)}" aria-controls="${T(G.instId,!0)+"-panel-"+T(e,!0)}"${W("aria-selected",r?"true":"false",0)}${W("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),Jr=qr,Yr={slider:"divkit-ef4f7",slider__input:"divkit-d1d65",slider__input_secondary:"divkit-c7980",slider__thumb:"divkit-f3453",slider_direction_rtl:"divkit-fb7b5",slider__thumb_secondary:"divkit-e1984","slider__tracks-wrapper":"divkit-f7338","slider__tracks-inner":"divkit-ac903",slider__track:"divkit-e956c","slider__active-track":"divkit-ec5bf","slider__thumb-text":"divkit-c4af5","slider__thumb-text_secondary":"divkit-d8821",slider__tick:"divkit-bd9bf",slider__tick_active:"divkit-d8ce2",slider__tick_inactive:"divkit-e71e7"};function Gr(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&ft(t.text_color)||"#000",o=ce(t.font_weight);if(Gt(t.font_size)&&"transparent"!==n){var i,a;const e={fontSize:dt(t.font_size),fontWeight:o,textColor:n};return"number"==typeof(null==r||null===(i=r.x)||void 0===i?void 0:i.value)&&"number"==typeof(null==r||null===(a=r.y)||void 0===a?void 0:a.value)&&(e.offset={x:r.x.value,y:r.y.value}),e}}function Xr(t,e,r){return Math.max(e,Math.min(r,Number(t)))}const Zr="function"==typeof BigInt;function Qr(t){return Zr?BigInt(t):Number(t)}const Kr=Qr("9223372036854775807"),tn=Qr("-9223372036854775808");function en(t){const e=Qr(t);if(e>Kr||e<tn)throw new Error("Integer overflow.");if("number"==typeof e&&(Number.isNaN(e)||e!==Math.round(e)))throw new Error("Incorrect integer value.");return e}const rn=en(0);function nn(t){let e=t;return e<0&&(e=-e),e}function on(t){let e=0;return t>0?e=1:t<0&&(e=-1),en(e)}class an{constructor(t,e){const r=this.convertValue(e);this.name=t,this.value=r}getName(){return this.name}subscribe(t){return this.store||(this.store=Q(this.value)),this.store.subscribe(t)}set(t){const e=this.fromString(t);this.setValue(e)}setValue(t){const e=this.convertValue(t);this.value=e,this.store&&this.store.set(e)}getValue(){return this.value}}class sn extends an{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}}class ln extends an{convertValue(t){if("bigint"!=typeof t&&"number"!=typeof t)throw new Error("Incorrect variable value");try{return en(t)}catch(t){throw new Error("Incorrect variable value")}}fromString(t){try{return en(t)}catch(t){throw new Error("Incorrect variable value")}}getType(){return"integer"}}class cn extends an{convertValue(t){if("number"!=typeof t||Number.isNaN(t)||!isFinite(t))throw new Error("Incorrect variable value");return t}fromString(t){const e=Number(t);return this.convertValue(e)}getType(){return"number"}}class un extends an{convertValue(t){if(1!==t&&0!==t&&!0!==t&&!1!==t)throw new Error("Incorrect variable value");return Number(t)}fromString(t){if("1"===t||"true"===t)return 1;if("0"===t||"false"===t)return 0;throw new Error("Incorrect variable value")}getType(){return"boolean"}}class dn extends an{convertValue(t){if("string"!=typeof t||!gt(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}}class pn extends an{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}class vn extends an{convertValue(t){if("object"!=typeof t||!t)throw new Error("Incorrect variable value");return t}fromString(t){throw new Error("Dict variable does not support setter from string")}getType(){return"dict"}}class fn extends an{convertValue(t){if(!Array.isArray(t))throw new Error("Incorrect variable value");return t}fromString(t){throw new Error("Array variable does not support setter from string")}getType(){return"array"}}const gn={string:sn,number:cn,integer:ln,boolean:un,color:dn,url:pn,dict:vn,array:fn};function hn(t,e,r){if(!(e in gn))throw new Error("Unsupported variable type");return new gn[e](t,r)}function mn(){}function yn(t){return t(this.value),mn}function bn(){throw new Error("Cannot change the value of this type of variable")}const _n={string:class extends sn{},number:class extends cn{},integer:class extends ln{},boolean:class extends un{},color:class extends dn{},url:class extends pn{},dict:class extends vn{},array:class extends fn{}};for(const t in _n){const e=_n[t];e.prototype.subscribe=yn,e.prototype.set=bn,e.prototype.setValue=bn}const wn={width:10,height:10,borderRadius:5,background:"#000"},$n=["rounded_rectangle","circle"],xn=["rounded_rectangle"];function kn(t,e,r,n,o){let i=[];if(o)for(let o=t;o<e;++o)i.push((o-r)/(n-r));else{for(let e=r;e<t;++e)i.push((e-r)/(n-r));for(let t=e;t<n+1;++t)i.push((t-r)/(n-r))}return i}const jn=L(((t,e,r,n)=>{var o,a,s,c,u,d,p,f,h,m,y,b;let _,w,$,x,k,j,E,C,A,F,D,O,P,S,V,I,M,z,R,B,L,H,J,Y,G,X,Z,Q,K,tt,et,rt,nt,ot,it,lt,ct,ut,vt,ft,gt,ht=i,mt=i,yt=i,bt=i,_t=i,wt=i,$t=i,xt=i,kt=i,jt=i,Et=i,Ct=i,At=i,Dt=i,{componentContext:Ot}=e,{layoutParams:Pt}=e;const Vt=g(at),Tt=g(qt);let It;Z=l(Vt.direction,(t=>X=t));let Mt,Nt,Ut,Rt=0,Bt=100,Lt=wn,Wt=Lt,Ht=wn,Jt=wn,Yt=null,Gt=null,Xt=Ut,Zt="",Qt="",Kt=!1,te=Xr(vt||0,Rt,Bt),ee=Xr(ut||0,Rt,Bt);fr((function(){}),50),v((()=>{It&&(Vt.unregisterFocusable(It),It=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==Ot&&r.componentContext(Ot),void 0===e.layoutParams&&r.layoutParams&&void 0!==Pt&&r.layoutParams(Pt),_=Ot.origJson,_&&(Lt=wn,Wt=Lt,Ht=wn,Jt=wn,Yt=null,Gt=null,Ut=void 0,Xt=void 0,Zt="",Qt=""),w=Ot.json.thumb_value_variable,$=Ot.json.thumb_secondary_value_variable,x=w&&Ot.getVariable(w,"integer")||hn("temp","integer",0),Ct(),Ct=l(x,(t=>vt=t)),k=$&&Ot.getVariable($,"integer")||hn("temp","integer",0),Et(),Et=l(k,(t=>ut=t)),j=Ot.getDerivedFromVars(Ot.json.min_value),Dt(),Dt=l(j,(t=>gt=t)),E=Ot.getDerivedFromVars(Ot.json.max_value),At(),At=l(E,(t=>ft=t)),C=Ot.getDerivedFromVars(Ot.json.thumb_style),jt(),jt=l(C,(t=>ct=t)),A=Ot.getDerivedFromVars(Ot.json.thumb_secondary_style),kt(),kt=l(A,(t=>lt=t)),F=Ot.getDerivedFromVars(Ot.json.track_inactive_style),xt(),xt=l(F,(t=>it=t)),D=Ot.getDerivedFromVars(Ot.json.track_active_style),$t(),$t=l(D,(t=>ot=t)),O=Ot.getDerivedFromVars(Ot.json.tick_mark_active_style),wt(),wt=l(O,(t=>nt=t)),P=Ot.getDerivedFromVars(Ot.json.tick_mark_inactive_style),_t(),_t=l(P,(t=>rt=t)),S=Ot.getDerivedFromVars(Ot.json.thumb_text_style),bt(),bt=l(S,(t=>et=t)),V=Ot.getDerivedFromVars(Ot.json.thumb_secondary_text_style),yt(),yt=l(V,(t=>tt=t)),I=Ot.getDerivedFromVars(Ot.json.accessibility),mt(),mt=l(I,(t=>K=t)),M=Ot.getDerivedFromVars(Ot.json.secondary_value_accessibility),ht(),ht=l(M,(t=>Q=t)),Rt=zt(gt,Rt),Bt=zt(ft,Bt);{const t=Xr(vt||0,Rt,Bt);t!==te&&(te=t)}{const t=Xr(ut||0,Rt,Bt);t!==ee&&(ee=t)}Lt=Ae(ct,$n,Lt),Wt=Ae(lt,$n,Lt),Ht=Ae(it,xn,Ht),Jt=Ae(ot,xn,Jt);{let t=Ae(nt,$n,wn);t!==wn&&(Yt=t)}Mt=Yt?$?kn(Math.min(te,ee),Math.max(te,ee)+1,Rt,Bt,!0):kn(Rt,te,Rt,Bt,!0):[];{let t=Ae(rt,$n,wn);t!==wn&&(Gt=t)}var re,ne;Nt=Gt?$?kn(Math.min(te,ee),Math.max(te,ee)+1,Rt,Bt,!1):kn(te+1,Bt+1,Rt,Bt,!0):[],Ut=Gr(et,Ut),Xt=Gr(tt,Ut),null!==(re=K)&&void 0!==re&&re.description?Zt=K.description:Ot.logError(st(new Error('Missing accessibility "description" for slider'),{level:"warn"})),null!==(ne=Q)&&void 0!==ne&&ne.description?Qt=Q.description:$&&Ot.logError(st(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;Tt.hasAction()?(Ot.logError(st(new Error('Cannot show "slider" inside component with action'))),t=!0):Lt===wn?(Ot.logError(st(new Error('Missing "thumb_style" in slider'))),t=!0):Jt===wn?(Ot.logError(st(new Error('Missing "track_active_style" in slider'))),t=!0):Ht===wn&&(Ot.logError(st(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==Kt&&(Kt=t)}return z=dt(Math.max(...[Lt.width,Wt.width,0].filter(St))),R=dt(Math.max(...[Lt.height,Wt.height,0].filter(St))),B=(te-Rt)/(Bt-Rt),L=$?(ee-Rt)/(Bt-Rt):void 0,H=void 0!==L?Math.abs(L-B):B,J=void 0!==L?Math.min(L,B):0,Y={"--divkit-slider-thumb-width":dt(Lt.width),"--divkit-slider-thumb-height":dt(Lt.height),"--divkit-slider-thumb-secondary-width":dt(Wt.width),"--divkit-slider-thumb-secondary-height":dt(Wt.height),"--divkit-slider-text-offset-x":null!==(o=Ut)&&void 0!==o&&null!==(a=o.offset)&&void 0!==a&&a.x?pt(Ut.offset.x):void 0,"--divkit-slider-text-offset-y":null!==(s=Ut)&&void 0!==s&&null!==(c=s.offset)&&void 0!==c&&c.y?pt(Ut.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":null!==(u=Xt)&&void 0!==u&&null!==(d=u.offset)&&void 0!==d&&d.x?pt(Xt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":null!==(p=Xt)&&void 0!==p&&null!==(f=p.offset)&&void 0!==f&&f.y?pt(Xt.offset.y):void 0,"--divkit-slider-tick-active-width":Yt?dt(Yt.width):void 0,"--divkit-slider-tick-active-height":Yt?dt(Yt.height):void 0,"--divkit-slider-tick-active-border-radius":Yt?dt(Yt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null===(h=Yt)||void 0===h?void 0:h.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null===(m=Yt)||void 0===m?void 0:m.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Gt?dt(Gt.width):void 0,"--divkit-slider-tick-inactive-height":Gt?dt(Gt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Gt?dt(Gt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null===(y=Gt)||void 0===y?void 0:y.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null===(b=Gt)||void 0===b?void 0:b.boxShadow)||void 0,"--divkit-slider-max-thumb-width":z,"--divkit-slider-max-thumb-height":R,"--divkit-slider-track-part":B,"--divkit-slider-track-secondary-part":L},G={direction:X},Ot.json,Z(),ht(),mt(),yt(),bt(),_t(),wt(),$t(),xt(),kt(),jt(),Et(),Ct(),At(),Dt()," "+(Kt?"":`${U(ae,"Outer").$$render(t,{cls:Ft("slider",Yr,G),style:Y,customDescription:!0,customActions:"slider",hasInnerFocusable:!0,componentContext:Ot,layoutParams:Pt},{},{default:({focusHandler:t,blurHandler:e})=>{var r,n,o,i,a,s;return`<div${W("class",Yr["slider__tracks-wrapper"],0)}><div${W("class",Yr["slider__tracks-inner"],0)}${W("this",undefined,0)}><div${W("class",Yr.slider__track,0)}${q({height:dt(Ht.height),"border-radius":dt(Ht.borderRadius),background:Ht.background,"box-shadow":Ht.boxShadow||""})}></div> <div${W("class",Yr["slider__active-track"],0)}${q({left:"ltr"===X?(100*J).toFixed(2)+"%":void 0,right:"ltr"===X?void 0:(100*J).toFixed(2)+"%",width:(100*H).toFixed(2)+"%",height:dt(Jt.height),"border-radius":dt(Jt.borderRadius),background:Jt.background,"box-shadow":Jt.boxShadow||""})}></div> ${N(Mt,(t=>`<div class="${T(Yr.slider__tick,!0)+" "+T(Yr.slider__tick_active,!0)}"${q({"--divkit-slider-tick":t})}></div>`))} ${N(Nt,(t=>`<div class="${T(Yr.slider__tick,!0)+" "+T(Yr.slider__tick_inactive,!0)}"${q({"--divkit-slider-tick":t})}></div>`))} <div${W("class",Yr.slider__thumb,0)}${q({"border-radius":dt(Lt.borderRadius),background:Lt.background,"box-shadow":Lt.boxShadow||""})}>${Ut?`<div${W("class",Yr["slider__thumb-text"],0)}><div${W("class",Yr["slider__thumb-text-inner"],0)}${q({"font-size":(null===(r=Ut)||void 0===r?void 0:r.fontSize)||"1em","font-weight":(null===(n=Ut)||void 0===n?void 0:n.fontWeight)||"",color:(null===(o=Ut)||void 0===o?void 0:o.textColor)||"#000"})}>${T(te)}</div></div>`:""}</div> ${$?`<div class="${T(Yr.slider__thumb,!0)+" "+T(Yr.slider__thumb_secondary,!0)}"${q({"border-radius":dt(Wt.borderRadius),background:Wt.background,"box-shadow":Wt.boxShadow||""})}>${Xt?`<div class="${T(Yr["slider__thumb-text"],!0)+" "+T(Yr["slider__thumb-text_secondary"],!0)}"><div${W("class",Yr["slider__thumb-text-inner"],0)}${q({"font-size":(null===(i=Xt)||void 0===i?void 0:i.fontSize)||"1em","font-weight":(null===(a=Xt)||void 0===a?void 0:a.fontWeight)||"",color:(null===(s=Xt)||void 0===s?void 0:s.textColor)||"#000"})}>${T(ee)}</div></div>`:""}</div>`:""} <input type="range"${W("class",Yr.slider__input,0)}${W("min",Rt,0)}${W("max",Bt,0)} step="1"${W("value",te,0)}${W("aria-label",Zt,0)}${W("this",undefined,0)}> ${$?`<input type="range"${W("class",`${Yr.slider__input} ${Yr.slider__input_secondary}`,0)}${W("min",Rt,0)}${W("max",Bt,0)} step="1"${W("value",ee,0)}${W("aria-label",Qt,0)}>`:""}</div></div>`}})}`)})),En={input:"divkit-c3a4c","input_alignment-horizontal_center":"divkit-fc52a","input_alignment-horizontal_end":"divkit-e9096",input__aligner:"divkit-e0491",input__input:"divkit-f11e0",input__placeholder:"divkit-b7593","input_alignment-vertical_start":"divkit-cd14f","input_alignment-vertical_end":"divkit-cd38f","input_alignment-vertical_baseline":"divkit-dd6af","input_highlight-color":"divkit-cc00f",input__input_singleline:"divkit-ffd1e","input__scroll-wrapper":"divkit-ad8a3",input__input_multiline:"divkit-f61f0","input__input_has-custom-focus":"divkit-e6b50"};function Cn(t,e){if(t===e)return{start:t.length,added:0,removed:0};if(t.length>e.length){const r=Cn(e,t);return{start:r.start,added:r.removed,removed:r.added}}let r=0,n=e.length-1;const o=e.length-t.length;for(;r<n&&r<t.length&&t[r]===e[r];)++r;for(;n-o>=r&&t[n-o]===e[n];)--n;return++n,{start:r,added:n-r,removed:n-r-o}}function An(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class Fn{constructor(t){this.char=t}}class Dn{constructor(t,e,r){this.char=t,this.filter=e,this.placeholder=r}}class On{constructor(t){An(this,"filters",new Map),An(this,"destructedValue",[]),An(this,"cursorPos",0),this.maskData=t,this.updateMaskData(t)}get cursorPosition(){return this.cursorPos}get rawValue(){return this.collectValueRange(0,this.destructedValue.length-1)}get value(){let t="";for(let e=0;e<this.destructedValue.length;++e){const r=this.destructedValue[e];if(r instanceof Fn)t+=r.char;else if(r instanceof Dn)if(r.char)t+=r.char;else{if(!this.maskData.alwaysVisible)break;t+=r.placeholder}}return t}firstEmptyHolderIndex(){const t=this.destructedValue.findIndex((t=>t instanceof Dn&&!t.char));return-1!==t?t:this.destructedValue.length}updateMaskData(t,e=!0){const r=this.maskData!==t&&e?this.rawValue:null;this.filters=new Map,this.maskData=t,this.maskData.decoding.forEach((t=>{if(t.filter)try{const e=new RegExp(t.filter);this.filters.set(t.key,e)}catch(e){this.onException(st(e,{level:"error",additional:{key:t.key}}))}})),this.destructedValue=this.maskData.pattern.split("").map((t=>{const e=this.maskData.decoding.find((e=>e.key===t));return e?new Dn(null,this.filters.get(e.key),e.placeholder):new Fn(t)})),null!==r&&this.overrideRawValue(r)}overrideRawValue(t){this.clearRange(0,this.destructedValue.length),this.replaceChars(t,0),this.cursorPos=Math.min(this.cursorPos,this.value.length)}applyChangeFrom(t,e){const r=Cn(this.value,t);void 0!==e&&(r.start=Math.max(0,e-r.added));const n=this.buildBodySubstring(r,t),o=this.buildTailSubstring(r);this.cleanup(r);const i=this.firstEmptyHolderIndex(),a=o?this.calculateMaxShift(o,i):void 0;this.replaceChars(n,i,a);const s=this.firstEmptyHolderIndex();this.replaceChars(o,s),this.calculateCursorPosition(r,s)}buildBodySubstring(t,e){return e.substring(t.start,t.start+t.added)}buildTailSubstring(t){return this.collectValueRange(t.start+t.removed,this.destructedValue.length-1)}calculateMaxShift(t,e){if(this.filters.size<=1){let r=0,n=e;for(;n<this.destructedValue.length;)this.destructedValue[n]instanceof Dn&&++r,++n;return Math.max(0,r-t.length)}const r=this.calculateInsertableSubstring(t,e);let n=0;for(;n<this.destructedValue.length&&r===this.calculateInsertableSubstring(t,e+n);)++n;return Math.max(0,n-1)}cleanup(t){if(0===t.added&&1===t.removed){let e=t.start;for(;e>=0;){const t=this.destructedValue[e];if(t instanceof Dn&&null!==t.char){t.char=null;break}--e}}this.clearRange(t.start,this.destructedValue.length)}clearRange(t,e){let r=t;for(;r<e&&r<this.destructedValue.length;){const t=this.destructedValue[r];t instanceof Dn&&(t.char=null),++r}}calculateCursorPosition(t,e){const r=this.firstEmptyHolderIndex();let n;n=t.start<r?Math.min(this.firstHolderAfter(e),this.value.length):r,this.cursorPos=n}calculateInsertableSubstring(t,e){let r="",n=e;const o=()=>{for(var t;n<this.destructedValue.length&&!(this.destructedValue[n]instanceof Dn);)++n;return null===(t=this.destructedValue[n])||void 0===t?void 0:t.filter};return t.split("").forEach((t=>{const e=o();null!=e&&e.test(t)&&(r+=t,++n)})),r}collectValueRange(t,e){let r="",n=t;for(;n<=e;){const t=this.destructedValue[n];t instanceof Dn&&null!==t.char&&(r+=t.char),++n}return r}replaceChars(t,e,r){let n=this.calculateInsertableSubstring(t,e);void 0!==r&&(n=n.substring(0,r));let o=e,i=0;for(;o<this.destructedValue.length&&i<n.length;){const t=this.destructedValue[o],e=n[i];t instanceof Dn&&(t.char=e,++i),++o}}firstHolderAfter(t){let e=t;for(;e<this.destructedValue.length&&!(this.destructedValue[e]instanceof Dn);)++e;return e}}class Pn extends On{constructor(t,e){super(t),this.logError=e}onException(t){this.logError(t)}}function Sn(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class Vn extends On{constructor(t=void 0,e){super({pattern:"",decoding:[],alwaysVisible:!1}),Sn(this,"currencyFormatter",new Intl.NumberFormat),Sn(this,"decimalSeparator","."),Sn(this,"localeDigits",{}),Sn(this,"trimZeroRegExp",new RegExp("")),this.logError=e,this.initFormatter(t)}updateCurrencyParams(t){const e=this.parseFormat(this.rawValue)||0;this.initFormatter(t);const r=e.toString().replace(".",this.decimalSeparator);this.applyChangeFrom(r)}initFormatter(t){try{this.currencyFormatter=new Intl.NumberFormat(t,{minimumFractionDigits:2,maximumFractionDigits:2}),this.decimalSeparator=this.currencyFormatter.format(0)[1],this.localeDigits=new Array(10).fill("").reduce(((t,e,r)=>(t[r]=this.currencyFormatter.format(r)[0],t)),{}),this.trimZeroRegExp=new RegExp(`^${this.localeDigits[0]}+`)}catch(e){this.onException(st(e,{level:"error",additional:{locale:t}}))}}invalidateMaskDataForFormatted(t){const e=this.currencyFormatter.format(t),r=this.formatPattern(e),n=[{key:"#",filter:`[${[...Object.values(this.localeDigits)].join("")}]`,placeholder:this.localeDigits[0]},{key:this.decimalSeparator,filter:`[${this.decimalSeparator}]`,placeholder:this.decimalSeparator}];this.updateMaskData({pattern:r,decoding:n,alwaysVisible:this.maskData.alwaysVisible},!1)}overrideRawValue(t){const e=this.parseFormat(t)||0;this.invalidateMaskDataForFormatted(e),super.overrideRawValue(t)}applyChangeFrom(t,e){const r=Cn(this.value,t),n=this.value.lastIndexOf(this.decimalSeparator),o=t.lastIndexOf(this.decimalSeparator),i=n!==o||-1===n&&-1===o,a=this.validFormat(t,r);this.cleanup(r);const s=this.parseFormat(a)||0;i&&this.invalidateMaskDataForFormatted(s),this.replaceChars(a,0),this.value.length>r.start&&!this.isDigit(this.value[r.start])?this.cursorPos=null!=e?e:this.cursorPosition:this.cursorPos=Math.abs(this.value.length-(t.length-(null!=e?e:this.cursorPosition)))}parseFormat(t){return parseFloat(t.replace(/./g,(t=>this.localeDigits[t]||(t===this.decimalSeparator?".":""))))}formatPattern(t){let e="";for(const r of t)e+=this.isDigit(r)?"#":r;return e}validFormat(t,e){if(!t)return"";let r=-1,n=0;for(;n<t.length;){if(t[n]===this.decimalSeparator&&!this.inDiff(e,n)){r=n;break}n++}let o=-1;1===e.added&&0===e.removed&&[",","."].includes(t[e.start])&&(o=e.start);const i=this.currencyFormatter.resolvedOptions().maximumFractionDigits;let a=i;if(-1!==r)for(n=r;n<t.length;)this.isDigit(t[n])&&!this.inDiff(e,n)&&a--,n++;else{let r=!1;for(let n=0;n<t.length;n++){const o=t[n];o===this.decimalSeparator?r=!0:!this.inDiff(e,n)&&r&&this.isDigit(o)&&a--}}const s=t.includes(this.decimalSeparator)||-1!==o,l=[];n=t.length-1;let c=!1;for(;n>=0;){const u=t[n],d=l.length<=i;this.isDigit(u)?this.inDiff(e,n)&&!c&&s?a>0&&(l.push(u),a--):l.push(u):d&&-1===r&&n===o?(l.push(this.decimalSeparator),c=!0):!d||u!==this.decimalSeparator||r!==n&&-1!==r||(l.push(this.decimalSeparator),c=!0,r=n),n--}return l.reverse().join("").replace(this.trimZeroRegExp,"")}inDiff(t,e){return t.start<=e&&e<t.start+t.added}isDigit(t){return Boolean(this.localeDigits[t])}onException(t){this.logError(t)}}function Tn(t){const e=t.textContent;let r=0;return"string"==typeof e&&(r+=e.length,t instanceof HTMLElement&&("DIV"===t.tagName||"BR"===t.tagName)&&++r),r}function In(t,e){if(3!==t.nodeType)if(t instanceof HTMLElement&&"BR"===t.tagName)try{const e=window.getSelection();if(e){e.removeAllRanges();const r=document.createRange(),n=t.parentNode,o=Array.from(n.childNodes).indexOf(t)+1;r.setStart(n,o),r.setEnd(n,o),e.addRange(r)}}catch(t){}else for(let r=0,n=t.childNodes.length;r<n;++r){const n=t.childNodes[r],o=Tn(n);if(e<=o)return void In(n,e);e-=o}else try{const r=window.getSelection();if(r){r.removeAllRanges();const n=document.createRange();n.setStart(t,e),n.setEnd(t,e),r.addRange(n)}}catch(t){}}const Mn="undefined"!=typeof document&&"inputMode"in document.createElement("input"),Nn={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url",password:"password"},zn=L(((t,e,r,n)=>{var o;let a,s,u,d,p,f,h,m,y,b,_,w,x,k,j,E,C,A,F,D,O,P,S,V,I,M,N,z,R,B,L,H,q,J,Y,G,X,Z,Q,K,tt,et,rt,nt,ot,it,lt,ct,vt,gt,ht,mt=i,yt=i,bt=i,_t=i,wt=i,$t=i,xt=i,kt=i,Et=i,Ct=i,At=i,Dt=i,St=i,Vt=i,Tt=i,It=i,Mt=i,Nt=i,zt=i,Ut=i,{componentContext:Bt}=e,{layoutParams:Lt}=e;const Wt=g(at);let Ht,qt;J=l(Wt.direction,(t=>q=t));let Jt,Yt,Xt,Zt=null,Qt="",Kt="",te=!1,ee="",re=12,ne="",oe="",ie="#000",se="",ce="start",de="center",pe="multi_line_text",he="text",me="",ye=null,be="",_e="",we="",$e=!0;function xe(t){qt instanceof HTMLInputElement?qt.selectionStart=qt.selectionEnd=t:In(qt,t)}async function ke(){if(!qt||!Zt)return;Zt.overrideRawValue(L),p.set(Zt.rawValue),c(d,B=Qt=Kt=Zt.value,B);const t=Zt.cursorPosition;await $(),document.activeElement===qt&&xe(t)}var je,Ee,Ce,Ae,Fe;v((()=>{Ht&&(Wt.unregisterFocusable(Ht),Ht=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==Bt&&r.componentContext(Bt),void 0===e.layoutParams&&r.layoutParams&&void 0!==Lt&&r.layoutParams(Lt),a=Bt.origJson,a&&(ee="",re=12,Jt=void 0,ne="",Yt=void 0,ie="#000",se="",ce="left",de="center",pe="multi_line_text",he="text",Xt=void 0,$e=!0),s=Bt.json.text_variable,u=null===(o=Bt.json.mask)||void 0===o?void 0:o.raw_text_variable,d=s&&Bt.getVariable(s,"string")||hn("temp","string",""),mt(),mt=l(d,(t=>B=t)),p=u&&Bt.getVariable(u,"string")||hn("temp","string",""),yt(),yt=l(p,(t=>L=t)),f=Bt.getDerivedFromVars(Bt.json.hint_text),zt(),zt=l(f,(t=>gt=t)),h=Bt.getDerivedFromVars(Bt.json.hint_color),Nt(),Nt=l(h,(t=>vt=t)),m=Bt.getDerivedFromVars(Bt.json.font_size),Mt(),Mt=l(m,(t=>ct=t)),y=Bt.getDerivedFromVars(Bt.json.font_weight),It(),It=l(y,(t=>lt=t)),b=Bt.getDerivedFromVars(Bt.json.font_family),Tt(),Tt=l(b,(t=>it=t)),_=Bt.getDerivedFromVars(Bt.json.line_height),Vt(),Vt=l(_,(t=>ot=t)),w=Bt.getDerivedFromVars(Bt.json.letter_spacing),St(),St=l(w,(t=>nt=t)),x=Bt.getDerivedFromVars(Bt.json.text_color),Dt(),Dt=l(x,(t=>rt=t)),k=Bt.getDerivedFromVars(Bt.json.highlight_color),At(),At=l(k,(t=>et=t)),j=Bt.getDerivedFromVars(Bt.json.text_alignment_horizontal),Ct(),Ct=l(j,(t=>tt=t)),E=Bt.getDerivedFromVars(Bt.json.text_alignment_vertical),Et(),Et=l(E,(t=>K=t)),C=Bt.getDerivedFromVars(Bt.json.keyboard_type),xt(),xt=l(C,(t=>Z=t)),A=Bt.getDerivedFromVars(Bt.json.mask),$t(),$t=l(A,(t=>X=t)),F=Bt.getDerivedFromVars(Bt.json.max_visible_lines),wt(),wt=l(F,(t=>G=t)),D=Bt.getDerivedFromVars(Bt.json.paddings),_t(),_t=l(D,(t=>Y=t)),O=Bt.getDerivedFromVars(Bt.json.accessibility),bt(),bt=l(O,(t=>H=t)),P=Bt.getDerivedFromVars(Bt.json.select_all_on_focus),Ut(),Ut=l(P,(t=>ht=t)),S=Bt.getDerivedFromVars(Bt.json.is_enabled),kt(),kt=l(S,(t=>Q=t)),s?te=!1:(te=!0,Bt.logError(st(new Error('Missing "text_variable" in "input"')))),"fixed_length"===(null==(je=X)?void 0:je.type)?Zt=function(t,e,r){if("string"==typeof t.pattern&&Array.isArray(t.pattern_elements)&&t.pattern_elements.every((t=>t.key&&"string"==typeof t.key))){const n={pattern:t.pattern,alwaysVisible:Boolean(t.always_visible),decoding:t.pattern_elements.map((t=>({key:t.key,filter:t.regex&&"string"==typeof t.regex?t.regex:void 0,placeholder:t.placeholder&&"string"==typeof t.placeholder?t.placeholder:"_"})))};return r?(r.updateMaskData(n),r):new Pn(n,e)}return r||null}(je,Bt.logError,Zt):"currency"===(null==je?void 0:je.type)&&(Zt=function(t,e,r){return r?(r.updateCurrencyParams(t.locale),r):new Vn(t.locale,e)}(je,Bt.logError,Zt)),Zt&&ke(),Zt||Qt===B||(Qt=Kt=B),Zt&&Zt.rawValue!==L&&ke(),V=gt,ee=ft(vt,1,ee),re=le(ct,re),Jt=ue(lt,Jt),ne=it&&"string"==typeof it?Wt.typefaceProvider(it,{fontWeight:Jt||400}):"";{const t=ot;Gt(t)&&(Yt=t/re)}return Pt(nt)&&(oe=dt(nt)),ie=ft(rt,1,ie),se=ft(et,1,se),ce=ve(tt,q,ce),de=fe(K,de),$e=ge(Q,$e),Z&&Z in Nn&&(he=Nn[Z],pe=Z),"currency"===(null===(Ee=X)||void 0===Ee?void 0:Ee.type)&&(he=Mn?"text":"tel",Xt="decimal"),I="multi_line_text"===pe,me=Gt(G)?`calc(${G*(Yt||1.25)*(re/10)+"em"} + ${pt(jt(null===(Ce=Y)||void 0===Ce?void 0:Ce.top,0)+jt(null===(Ae=Y)||void 0===Ae?void 0:Ae.bottom,0))})`:"",ye=Rt(Y||void 0,ye),be=ye?Ot({top:(Number(ye.top)||0)/re*10,right:(Number("ltr"===q?ye.end:ye.start)||Number(ye.right)||0)/re*10,bottom:(Number(ye.bottom)||0)/re*10,left:(Number("ltr"===q?ye.start:ye.end)||Number(ye.left)||0)/re*10},q):"",_e=ye?Ot({top:(Number(ye.top)||0)/re*10,bottom:(Number(ye.bottom)||0)/re*10},q):"",null!==(Fe=H)&&void 0!==Fe&&Fe.description?we=H.description:Bt.logError(st(new Error('Missing accessibility "description" for input'),{level:"warn"})),M={"highlight-color":Boolean(se),multiline:I,"alignment-horizontal":ce,"alignment-vertical":de},N={"--divkit-input-hint-color":ee,"--divkit-input-highlight-color":se,"--divkit-input-line-height":Yt,"font-weight":Jt,"font-family":ne,"letter-spacing":oe,color:ie,"max-height":me},z={"font-size":dt(re),padding:be},R={"font-size":dt(re),padding:_e},qt&&Bt.json&&(Ht&&(Wt.unregisterFocusable(Ht),Ht=void 0),Bt.json.id&&!Bt.fakeElement&&(Ht=Bt.json.id,Wt.registerFocusable(Ht,{focus(){qt&&qt.focus()}}))),mt(),yt(),bt(),J(),_t(),wt(),$t(),xt(),kt(),Et(),Ct(),At(),Dt(),St(),Vt(),Tt(),It(),Mt(),Nt(),zt(),Ut(),te?"":`${U(ae,"Outer").$$render(t,{cls:Ft("input",En,M),style:N,customDescription:!0,customActions:"input",customPaddings:!0,hasInnerFocusable:!0,componentContext:Bt,layoutParams:Lt},{},{default:({focusHandler:t,blurHandler:e,hasCustomFocus:r})=>{return I?`<span${W("class",En["input__scroll-wrapper"],0)}>${!Kt&&V?`<div${W("class",En.input__placeholder,0)} aria-hidden="true"${W("style",ut(z),0)}>${T(V)}</div>`:""} <span${W("class",En.input__aligner,0)} aria-hidden="true"${W("style",ut(R),0)}>​</span> ${$e?` <span${W("class",Ft("input__input",En,{"has-custom-focus":r,multiline:!0}),0)} autocapitalize="off" contenteditable="true" role="textbox" tabindex="0"${W("aria-label",we,0)} aria-multiline="true"${W("style",ut(z),0)}${W("this",qt,0)}>${n=Kt,void 0===n?"":n}</span>`:`<span${W("class",Ft("input__input",En,{multiline:!0}),0)} autocapitalize="off" contenteditable="false" role="textbox"${W("aria-label",we,0)} aria-disabled="true" aria-multiline="true"${W("style",ut(z),0)}${W("this",qt,0)}>${(t=>void 0===t?"":t)(Kt)}</span>`}</span>`:`<input${W("type",he,0)}${W("inputmode",Xt,0)}${W("class",Ft("input__input",En,{"has-custom-focus":r,singleline:!0}),0)} autocomplete="off" autocapitalize="off"${W("aria-label",we,0)}${W("style",ut(z),0)} ${$e?"":"disabled"}${W("placeholder",V,0)}${W("value",Qt,0)}${W("this",qt,0)}>`;var n}})}`})),Un={select:"divkit-feef3","select__select-text":"divkit-cd862",select_hint:"divkit-a3cf6",select__select:"divkit-bdb72","select__select_has-custom-focused":"divkit-a46ad","has-custom-focused":"divkit-fc5dc",select__option:"divkit-e774b"},Rn=L(((t,e,r,n)=>{let o,a,s,c,u,d,p,f,h,m,y,b,_,w,$,x,k,j,E,C,A,F,D,O,P,S,V,I,M,z,R,B,L=i,H=i,q=i,J=i,Y=i,G=i,X=i,Z=i,Q=i,K=i,tt=i,{componentContext:et}=e,{layoutParams:rt}=e;const nt=g(at);let ot;M=l(nt.direction,(t=>I=t));let it,lt,ct=!1,pt="",vt=null,gt="",ht="rgba(0,0,0,.45)",mt=12,yt="",bt="",_t="#000",wt="";v((()=>{ot&&(nt.unregisterFocusable(ot),ot=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==et&&r.componentContext(et),void 0===e.layoutParams&&r.layoutParams&&void 0!==rt&&r.layoutParams(rt),o=et.origJson,o&&(vt=null,ht="rgba(0,0,0,.45)",mt=12,it=void 0,yt="",lt=void 0,bt="",_t="#000",wt=""),a=et.json.value_variable,s=et.json.options,c=Array.isArray(s)&&s.filter((t=>"string"==typeof t.value))||[],u=a&&et.getVariable(a,"string")||hn("temp","string",""),K(),K=l(u,(t=>R=t)),d=et.getDerivedFromVars(et.json.paddings),Q(),Q=l(d,(t=>z=t)),p=et.getDerivedFromVars(et.json.hint_text),tt(),tt=l(p,(t=>B=t)),f=et.getDerivedFromVars(et.json.hint_color),Z(),Z=l(f,(t=>V=t)),h=et.getDerivedFromVars(et.json.font_size),X(),X=l(h,(t=>S=t)),m=et.getDerivedFromVars(et.json.font_weight),G(),G=l(m,(t=>P=t)),y=et.getDerivedFromVars(et.json.font_family),Y(),Y=l(y,(t=>O=t)),b=et.getDerivedFromVars(et.json.line_height),J(),J=l(b,(t=>D=t)),_=et.getDerivedFromVars(et.json.letter_spacing),q(),q=l(_,(t=>F=t)),w=et.getDerivedFromVars(et.json.text_color),H(),H=l(w,(t=>A=t)),$=et.getDerivedFromVars(et.json.accessibility),L(),L=l($,(t=>C=t)),Array.isArray(c)&&c.length||et.logError(st(new Error('Empty selection "items" in "select"'))),a?ct=!1:(ct=!0,et.logError(st(new Error('Missing "value_variable" in "select"'))));{const t=c.find((t=>t.value===R));t?pt=("string"==typeof t.text?t.text:t.value)||"":(pt="",R&&et.logError(st(new Error('Value from the variable was not found in the selection items for "select"'))))}mt=le(S,mt),vt=Rt(z||void 0,vt),gt=vt?Ot({top:(Number(vt.top)||0)/mt*10,right:(Number("ltr"===I?vt.end:vt.start)||Number(vt.right)||0)/mt*10,bottom:(Number(vt.bottom)||0)/mt*10,left:(Number("ltr"===I?vt.start:vt.end)||Number(vt.left)||0)/mt*10},I):"",ht=ft(V,1,ht),it=ue(P,it),yt=O&&"string"==typeof O?nt.typefaceProvider(O,{fontWeight:it||400}):"";{const t=D;Gt(t)&&(lt=t/mt)}var $t;return Pt(F)&&(bt=dt(F/mt*10)),_t=ft(A,1,_t),null!==($t=C)&&void 0!==$t&&$t.description?wt=C.description:et.logError(st(new Error('Missing accessibility "description" for select'),{level:"warn"})),x={hint:!pt},k={"--divkit-input-hint-color":ht,"font-weight":it,"font-family":yt,color:_t},j={padding:gt,"font-size":dt(mt),"line-height":lt,"letter-spacing":bt},E={"font-size":dt(mt),"line-height":lt,"letter-spacing":bt},et.json,L(),H(),q(),J(),Y(),G(),X(),Z(),M(),Q(),K(),tt(),ct?"":`${U(ae,"Outer").$$render(t,{cls:Ft("select",Un,x),style:k,customDescription:!0,customActions:"select",customPaddings:!0,hasInnerFocusable:!0,componentContext:et,layoutParams:rt},{},{default:({hasCustomFocus:t,focusHandler:e,blurHandler:r})=>`<span${W("class",Un["select__select-text"],0)}${W("style",ut(j),0)} aria-hidden="true"> ${T(pt||B||"​")}</span> <select${W("class",Ft("select__select",Un,{"has-custom-focus":t}),0)}${W("aria-label",wt,0)}${W("style",ut(E),0)}${W("this",undefined,0)}>${N(c,(t=>`<option${W("class",Un.select__option,0)}${W("value",t.value,0)}>${T(t.text||t.value)}</option>`))}</select>`})}`})),Bn={video__video:"divkit-c11f9","video__aspect-wrapper":"divkit-cfe32",video_aspect:"divkit-a4f5c"},Ln=L(((t,e,r,n)=>{let o,a,s,c,u,d,p,f,h,m,y,b,_,w,$,x,k,j,E,C,A=i,F=i,D=i,O=i,P=i,S=i,V=i,T=i,{componentContext:I}=e,{layoutParams:M}=e;const z=g(at);let R,B,L,H,J=!1,Y=!1,G=[],X=!1,Z=!1,Q=!1,K=!1,tt="fit",et="0";var rt,nt;v((()=>{R&&(z.unregisterInstance(R),R=void 0),H&&(H(),H=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==I&&r.componentContext(I),void 0===e.layoutParams&&r.layoutParams&&void 0!==M&&r.layoutParams(M),I.json&&(X=!1,Z=!1,Q=!1,K=!1,L=void 0,tt="fit"),o=I.json.elapsed_time_variable,a=o&&I.getVariable(o,"integer")||hn("temp","integer",0),a&&(H&&H(),H=a.subscribe((function(t){Y&&(Y=!1)}))),s=I.getDerivedFromVars(I.json.video_sources),T(),T=l(s,(t=>C=t)),c=I.getDerivedFromVars(I.json.repeatable),V(),V=l(c,(t=>E=t)),u=I.getDerivedFromVars(I.json.autostart),A(),A=l(u,(t=>_=t)),d=I.getDerivedFromVars(I.json.muted),S(),S=l(d,(t=>j=t)),p=I.getDerivedFromVars(I.json.preload_required),P(),P=l(p,(t=>k=t)),f=I.getDerivedFromVars(I.json.preview),O(),O=l(f,(t=>x=t)),h=I.getDerivedFromVars(I.json.scale),D(),D=l(h,(t=>$=t)),m=I.getDerivedFromVars(I.json.aspect),F(),F=l(m,(t=>w=t)),rt=C,nt=G,G=Array.isArray(rt)&&rt.length?rt.filter((t=>"video_source"===(null==t?void 0:t.type)&&"string"==typeof t.url&&"string"==typeof t.mime_type)).map((t=>{const e={src:t.url};return t.mime_type&&(e.type=t.mime_type),e})):nt,G.length?J=!1:(J=!0,I.logError(st(new Error('Missing "video_sources" in "video"')))),X=ge(E,X),Z=ge(_,Z),Q=ge(j,Q),K=ge(k,K),L="string"==typeof x?Xe(x):L,tt=function(t){return"fill"===t?"cover":"no_scale"===t?"none":"contain"}($)||tt;{var ot;const t=null===(ot=w)||void 0===ot?void 0:ot.ratio;et=t&&Gt(t)?(100/Number(t)).toFixed(2):"0"}return I.json&&(R&&(z.unregisterInstance(R),R=void 0),!I.json.id||J||I.fakeElement||(R=I.json.id,z.registerInstance(R,{pause:function(){},start:function(){}}))),I.json,y={aspect:"0"!==et},b={"object-fit":tt},A(),F(),D(),O(),P(),S(),V(),T(),J?"":`${U(ae,"Outer").$$render(t,{cls:Ft("video",Bn,y),customActions:"video",componentContext:I,layoutParams:M},{},{default:()=>y.aspect?`<div${W("class",Bn["video__aspect-wrapper"],0)}${q({"padding-bottom":`${et}%`})}><video${W("class",Bn.video__video,0)}${W("style",ut(b),0)} playsinline ${X?"loop":""} ${Z?"autoplay":""} ${Q?"muted":""}${W("poster",L,0)}${W("preload",K?"metadata":"auto",0)}${W("this",B,0)}>${N(G,(t=>`<source${W("src",t.src,0)}${W("type",t.type,0)}>`))}</video></div>`:`<video${W("class",Bn.video__video,0)}${W("style",ut(b),0)} playsinline ${X?"loop":""} ${Z?"autoplay":""} ${Q?"muted":""}${W("poster",L,0)}${W("preload",K?"metadata":"auto",0)}${W("this",B,0)}>${N(G,(t=>`<source${W("src",t.src,0)}${W("type",t.type,0)}>`))}</video>`})}`})),Wn=Ln,Hn=L(((t,e,r,n)=>{let o,i,{componentContext:a}=e,{layoutParams:s}=e;const l=g(at);let c=null,u="",d={},p=!1;var v;if(void 0===e.componentContext&&r.componentContext&&void 0!==a&&r.componentContext(a),void 0===e.layoutParams&&r.layoutParams&&void 0!==s&&r.layoutParams(s),"string"==typeof a.json.custom_type&&a.json.custom_type&&null!==(v=l.customComponents)&&void 0!==v&&v.has(a.json.custom_type)){if(c=l.customComponents.get(a.json.custom_type),"function"==typeof c.template){const t=l.getExtensionContext(),e=new Map;for(const[r,n]of t.variables)e.set(r,n.getValue());u=c.template({props:a.json.custom_props,variables:e})}else u=c.template&&"string"==typeof c.template?c.template:"";d={shadowrootmode:c.shadowRootMode||"open"}}else c=null,u=";",a.logError(st(new Error('Unknown or incorrect "custom_type" prop for div "custom"')));return o=a.json.items,void 0===o||Array.isArray(o)?p=!1:(p=!0,a.logError(st(new Error('Incorrect "items" prop for div "custom"')))),i=(!p&&o||[]).map(((t,e)=>a.produceChildContext(t,{path:e}))),c?`${U(ae,"Outer").$$render(t,{componentContext:a,layoutParams:s},{},{default:()=>{return(e=c.element)?`<${c.element}${P([M(a.json.custom_props||{})],{})}${W("this",undefined,0)}>${D(e)?"":`${u?`<template${P([M(d)],{})}> ${u}</template>`:""} ${!p&&o?`${N(i,(e=>`${U(Yn,"Unknown").$$render(t,{componentContext:e},{},{})}`))}`:""}`}${D(e)?"":`</${e}>`}`:"";var e}})}`:""})),qn=Hn,Jn={};Jn.text=we,Jn.container=He,Jn.separator=Ye,Jn.image=Qe,Jn.gif=Qe,Jn.grid=sr,Jn.gallery=_r,Jn.tabs=Er,Jn.state=Vr,Jn.pager=Ur,Jn.indicator=Jr,Jn.slider=jn,Jn.input=zn,Jn.select=Rn,Jn.video=Wn,Jn.custom=qn;const Yn=L(((t,e,r,n)=>{let{componentContext:o}=e,{layoutParams:i}=e;const a=g(at);let s;void 0===e.componentContext&&r.componentContext&&void 0!==o&&r.componentContext(o),void 0===e.layoutParams&&r.layoutParams&&void 0!==i&&r.layoutParams(i);{const t=o.json;if(s=(null==t?void 0:t.type)&&Jn[t.type]||void 0,!s){let e;e=null!=t&&t.type&&a.hasTemplate(t.type)?"Recursive template":"Unknown component",o.logError(st(new Error(e),{additional:{component:(null==t?void 0:t.type)||"<missing>"}}))}}return s?`${U(s||z,"svelte:component").$$render(t,{componentContext:o,layoutParams:i},{},{})}`:""})),Gn=L(((t,e,r,n)=>{let{svgFiltersMap:o}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==o&&r.svgFiltersMap(o),Object.keys(o).length?`<svg${W("class","divkit-dc22b",0)} aria-hidden="true"><defs>${N([...Object.keys(o)],(t=>{let[e,r]=t.split(":");return` <filter${W("id",o[t],0)}><feFlood${W("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${W("operator",r.split("_")[1],0)}></feComposite>`:"multiply"===r?'<feComposite in2="SourceGraphic" operator="arithmetic" k1="1" k2="0" k3="0" k4="0"></feComposite>':`<feBlend in2="SourceGraphic"${W("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function Xn(t,e,r,n){const o=r[t.type];if(!o)return n(st(new Error("No such template"),{additional:{template:t.type}})),{json:t,templateContext:e};let i;const a={};for(i in e)e.hasOwnProperty(i)&&(a[i]=e[i]);for(i in t)"type"!==i&&"__proto__"!==i&&t.hasOwnProperty(i)&&(a[i]=t[i]);const s=function t(e,r){const n=Object.keys(r).filter((t=>"__proto__"!==t)),o=n.filter((t=>"$"!==t.charAt(0))),i=n.filter((t=>"$"===t.charAt(0)));return o.forEach((n=>{const o=r[n];"object"==typeof o&&null!==o?(e[n]=Array.isArray(o)?[]:{},t(e[n],o)):e[n]=o})),i.forEach((t=>{const n=r[t],o=a[n];if(void 0!==o){const r=t.substring(1);e[r]=o}})),e}({},o);for(i in t)"type"!==i&&"__proto__"!==i&&t.hasOwnProperty(i)&&(s[i]=t[i]);return{json:s,templateContext:a}}function Zn(t,e){return e.length?e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t):t}function Qn(t,e){return e.length?e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t):t}function Kn(t){if(t.every((t=>"string"==typeof t)))return{type:"StringLiteral",value:t.join("")};let e=t.reduce(((t,e)=>("string"==typeof e&&"string"==typeof t[t.length-1]?t[t.length-1]+=e:t.push(e),t)),[]).reduce(((t,e)=>("string"==typeof e?t.quasis.push({type:"StringLiteral",value:e}):(t.quasis.length===t.expressions.length&&t.quasis.push({type:"StringLiteral",value:""}),t.expressions.push(e)),t)),{type:"TemplateLiteral",quasis:[],expressions:[]});return e.quasis.length===e.expressions.length&&e.quasis.push({type:"StringLiteral",value:""}),e}function to(t){try{return en(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function eo(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function ro(t,e,r,n){var o=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(o,ro.prototype),o.expected=e,o.found=r,o.location=n,o.name="SyntaxError",o}function no(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(ro,Error),ro.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,n=null;for(r=0;r<t.length;r++)if(t[r].source===this.location.source){n=t[r].text.split(/\r\n|\n|\r/g);break}var o=this.location.start,i=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,a=this.location.source+":"+i.line+":"+i.column;if(n){var s=this.location.end,l=no("",i.line.toString().length," "),c=n[o.line-1],u=(o.line===s.line?s.column:c.length+1)-o.column||1;e+="\n --\x3e "+a+"\n"+l+" |\n"+i.line+" | "+c+"\n"+l+" | "+no("",o.column-1," ")+no("",u,"^")}else e+="\n at "+a}return e},ro.buildMessage=function(t,e){var r={literal:function(t){return'"'+o(t.text)+'"'},class:function(t){var e=t.parts.map((function(t){return Array.isArray(t)?i(t[0])+"-"+i(t[1]):i(t)}));return"["+(t.inverted?"^":"")+e.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(t){return t.description}};function n(t){return t.charCodeAt(0).toString(16).toUpperCase()}function o(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function i(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function a(t){return r[t.type](t)}return"Expected "+function(t){var e,r,n=t.map(a);if(n.sort(),n.length>0){for(e=1,r=1;e<n.length;e++)n[e-1]!==n[e]&&(n[r]=n[e],r++);n.length=r}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(t)+" but "+function(t){return t?'"'+o(t)+'"':"end of input"}(e)+" found."};const oo=Number.MAX_VALUE,io=Number.MIN_VALUE,ao="string",so="integer",lo="number",co="boolean",uo="color",po="url",vo="datetime",fo="dict",go="array";function ho(t,e){var r;switch(null===(r=e[t.type])||void 0===r||r.call(e,t),t.type){case"TemplateLiteral":t.expressions.forEach((t=>{ho(t,e)}));break;case"BinaryExpression":case"LogicalExpression":ho(t.left,e),ho(t.right,e);break;case"UnaryExpression":ho(t.argument,e);break;case"ConditionalExpression":ho(t.test,e),ho(t.consequent,e),ho(t.alternate,e);break;case"TryExpression":ho(t.test,e),ho(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{ho(t,e)}))}}function mo(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function yo(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function bo(t){if("string"===t.type)return t.value;if("integer"===t.type)return String(t.value);if("number"===t.type){let e=String(t.value);return e.includes(".")||(e.includes("e")?e=e.replace("e",".0e"):e+=".0"),e=e.replace(/e\+?/i,"E"),e}if("boolean"===t.type)return t.value?"true":"false";if("datetime"===t.type)return yo(t.value);if("color"===t.type)return Co(Eo(t.value));if("url"===t.type)return t.value;if("dict"===t.type)return"<dict>";if("array"===t.type)return"<array>";throw new Error(`Unexpected type ${t.type}`)}function _o(t){let e=bo(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"),e}function wo(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function $o(t,e){if(Zr)return en(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function xo(t,e){if(e<tn||e>Kr)throw new Error("Integer overflow.");!Zr&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function ko(t){const e=[];return ho(t,{Variable(t){e.push(t.id.name)}}),e}function jo(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function Eo(t){const e=gt(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function Co(t){return`#${[t.a,t.r,t.g,t.b].map((t=>{if(t<0||t>255)throw new Error("Value out of range 0..1.");return vt(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function Ao(t){return Co(Eo(t))}function Fo(t){return{type:lo,value:Number(t.value)}}const Do={string:"string",number:"number",integer:"number",boolean:"boolean",color:"string",url:"string",array:"array",dict:"object"};function Oo(t,e,r){const n=Do[r];let o=typeof e;if("array"===n&&!Array.isArray(e)||"array"!==n&&o!==n||"object"===o&&null===e)throw"object"===o&&(o=Array.isArray(e)?"array":null===e?"null":"dict"),new Error(`Incorrect value type: expected ${wo(r)}, got ${wo(o)}.`);if("number"===n&&"integer"===r){xo(t,e);try{e=en(e)}catch(t){throw new Error("Cannot convert value to integer.")}}return"string"===n&&"color"===r&&(e=Ao(e)),{type:r,value:e}}const Po=new Map,So=new Map,Vo=new Map,To=new Map;function Io(t,e,r){const n={args:e,cb:r},o=Po.get(t)||[];Po.has(t)||Po.set(t,o),o.push(n);const i=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");So.set(i,n)}function Mo(t,e,r){const n={args:e,cb:r},o=Vo.get(t)||[];Vo.has(t)||Vo.set(t,o),o.push(n);const i=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");To.set(i,n)}function No(t,e){const r=t.args.length;let n=t.args.length,o=0;const i=t.args[t.args.length-1];if("object"==typeof i&&i.isVararg&&(n=1/0),e.length<r)return{type:"few",expected:r,found:e.length};if(e.length>n)return{type:"many",expected:n,found:e.length};for(let r=0;r<e.length;++r){let n=r>=t.args.length?t.args[t.args.length-1]:t.args[r];if("object"!=typeof n&&(n={type:n}),n.type!==lo||e[r].type!==so){if(n.type!==e[r].type)return{type:"mismatch",expected:n.type,found:e[r].type}}else++o}return{type:"match",conversions:o}}function zo(t,e,r){const n=("function"===t?Po:Vo).get(e);if(!n)return{type:"missing"};let o=null,i=null;for(let t=0;t<n.length;++t){const e=No(n[t],r);"match"!==e.type?o||(o=e):(!i||i.conversions>e.conversions)&&(i={func:n[t],conversions:e.conversions})}if(!i){if(o)return o;throw new Error("Missing function")}return i}function Uo(t,e){return e.map(((e,r)=>{let n=r>=t.args.length?t.args[t.args.length-1]:t.args[r];return"object"!=typeof n&&(n={type:n}),n.type===lo&&e.type===so?Fo(e):e}))}function Ro(t,e){return e.type===go||e.type===fo?{type:ao,value:JSON.stringify(e.value)}:{type:ao,value:bo(e)}}function Bo(t,e){const r=Number(e.value);if(Number.isNaN(r)||!Number.isFinite(r))throw new Error("Unable to convert value to Number.");return{type:lo,value:r}}function Lo(t,e,r,n){const o=t.variables.get(e.value);let i;return i=o&&o.getType()===n?o.getValue():r.value,"color"===n&&(i=Ao(i)),{type:n,value:i}}function Wo(t,e,r){return Lo(t,e,r,r.type)}function Ho(t,e,r){return Lo(t,e,r,"color")}function qo(t,e,r){return Lo(t,e,r,"url")}function Jo(t,e){return t&&e?t.padStart(e,"0"):t}const Yo={G(t,e){let r;return r=t<4?"short":5===t?"narrow":"long",e({era:r},"era")},d:(t,e)=>Jo(e({day:"numeric"},"day"),t>1?t:0),D:(t,e)=>Jo(e({},"dayofyear"),t>1?t:0),F:(t,e)=>Jo(e({},"dayofweekinmonth"),t>1?t:0),M(t,e){let r;return r=1===t?"numeric":2===t?"2-digit":3===t?"short":5===t?"narrow":"long",e({month:r,day:"numeric"},"month")},y:(t,e)=>Jo(e({year:2===t?"2-digit":"numeric"},"year"),t>2?t:void 0),Y:(t,e)=>Jo(e({year:2===t?"2-digit":"numeric"},"weekyear"),t>2?t:void 0),u:(t,e)=>Jo(e({year:"numeric"},"extendedyear"),t>1?t:void 0),E(t,e){let r;return r=t<=3?"short":5===t?"narrow":"long",e({weekday:r},"weekday")},e:(t,e)=>t>2?Yo.E(t,e):Jo(e({},"weekdaynumeric"),t>1?t:void 0),w:(t,e)=>Jo(e({},"week"),t>1?t:void 0),W:(t,e)=>Jo(e({},"weekofmonth"),t>1?t:void 0),H(t,e){const r=e({hour:"numeric",hour12:!1,hourCycle:"h23"},"hour");if(r)return Jo(String(Number(r)%24),t>1?t:void 0)},h:(t,e)=>Jo(e({hour:"numeric",hour12:!0,hourCycle:"h12"},"hour"),t>1?t:void 0),K(t,e){const r=e({hour:"numeric",hour12:!0,hourCycle:"h11"},"hour");if(r)return Jo(String(Number(r)%12),t>1?t:void 0)},k:(t,e)=>Jo(e({hour:"numeric",hour12:!1,hourCycle:"h24"},"hour"),t>2?t:void 0),a:(t,e)=>e({hour:"numeric",hour12:!0,hourCycle:"h11",dayPeriod:void 0},"dayPeriod"),m:(t,e)=>Jo(e({minute:"numeric"},"minute"),t>1?t:void 0),s:(t,e)=>Jo(e({second:"numeric"},"second"),t>1?t:void 0),S(t,e){const r=e({fractionalSecondDigits:Math.min(3,t)},"fractionalSecond");return r&&t>3?r.padEnd(t,"0"):r},z:(t,e)=>e({timeZoneName:4===t?"long":"short"},"timeZoneName"),Z(t,e){const r=-Number(e({},"timezoneoffset")),n=Math.abs(r/60),o=100*Math.floor(n)+60*(n-Math.floor(n));return(r>=0?"+":"-")+Jo(String(o),4)}},Go=/(\w)\1*|''|'(''|[^'])+('|$)|./g,Xo=/^'([^]*?)'?$/,Zo=/''/g,Qo=/[a-zA-Z]/,Ko=864e5;function ti(t,e,r){const n=t[e?"getUTCDay":"getDay"](),o=n<r?r-n-7:r-n;return new Date(t.getTime()+Ko*o)}function ei(t,e,r){const n=new Date(t);return n[e?"setUTCDate":"setDate"](1),n[e?"setUTCMonth":"setMonth"](0),ti(n,e,r)}function ri(t,e){return Math.round((t.getTime()-e.getTime())/Ko)}function ni(t,e,r){let n=0;const o=ei(t,e||!1,r),i=new Date(t);i[e?"setUTCFullYear":"setFullYear"](t[e?"getUTCFullYear":"getFullYear"]()+1);const a=ei(i,e||!1,r),s=t.getTime()<o.getTime(),l=t.getTime()>=a.getTime();let c=t[e?"getUTCFullYear":"getFullYear"]();if(s){--c,o[e?"setUTCFullYear":"setFullYear"](o[e?"getUTCFullYear":"getFullYear"]()-1);const i=ri(ti(t,e,r),o);n=Math.round(i/7)+1}else if(l)++c,n=1;else{const i=ri(ti(t,e,r),o);n=Math.round(i/7)+1}return{week:n,year:c}}function oi(t,e,{locale:r,isUTC:n,weekStartDay:o=0}={}){const i=(e,i)=>{if("week"===i){const{week:e}=ni(t,n||!1,o);return String(e)}if("weekofmonth"===i){const e=t[n?"getUTCDay":"getDay"](),r=new Date(t);r[n?"setUTCDate":"setDate"](1);const o=r[n?"getUTCDay":"getDay"](),i=t[n?"getUTCDate":"getDate"]();return String(Math.ceil(i/7)+(e<o?1:0))}if("dayofweekinmonth"===i){const e=t[n?"getUTCDate":"getDate"]();return String(Math.ceil(e/7))}if("weekdaynumeric"===i){let e=t[n?"getUTCDay":"getDay"]();return e<o&&(e+=7),String(e-o+1)}if("dayofyear"===i){const e=new Date(t);e[n?"setUTCMonth":"setMonth"](0),e[n?"setUTCDate":"setDate"](1),e[n?"setUTCHours":"setHours"](1),e[n?"setUTCMinutes":"setMinutes"](1),e[n?"setUTCSeconds":"setSeconds"](1);const r=Math.ceil((t.getTime()-e.getTime())/Ko);return String(r)}if("weekyear"===i){let{year:r}=ni(t,n||!1,o);return r<1&&(r=1-r),"2-digit"===e.year?String(r%100):String(r)}if("extendedyear"===i){const r=t[n?"getUTCFullYear":"getFullYear"]();return"2-digit"===e.year?String(r%100):String(r)}if("timezoneoffset"===i)return n?"0":String(t.getTimezoneOffset());n&&(e.timeZone="UTC");const a=new Intl.DateTimeFormat(r,e).formatToParts(t);for(let t=0;t<a.length;++t)if(a[t].type===i)return a[t].value};return(e.match(Go)||[]).map((t=>{if("''"===t)return"'";const e=t[0];if("'"===e)return function(t){const e=t.match(Xo);return e?e[1].replace(Zo,"'"):t}(t);if(Yo[e])return Yo[e](t.length,i);if(e.match(Qo))throw new Error(`Format string contains an unescaped latin alphabet character "${e}"`);return t})).join("")}const ii=t=>(e,r)=>{let n=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++n:"getUTCDay"===t&&0===n&&(n=7),{type:so,value:en(n)}};function ai(t){return(e,r,n,o)=>({type:ao,value:oi(r.value,n.value,{locale:null==o?void 0:o.value,isUTC:t,weekStartDay:e.weekStartDay})})}const si=ii("getUTCFullYear"),li=ii("getUTCMonth"),ci=ii("getUTCDate"),ui=ii("getUTCDay"),di=ii("getUTCHours"),pi=ii("getUTCMinutes"),vi=ii("getUTCSeconds"),fi=ii("getUTCMilliseconds"),gi=ai(!1),hi=ai(!0);function mi(t,e,r,n){if(!n.value.length)return t.warnings.push(st(new Error("String for padding is empty."),{level:"warn"})),"";let o="";const i=e.type===ao?e.value:bo(e);for(;o.length+i.length<r.value;)o+=n.value;return o.length>0&&o.length+i.length>r.value&&(o=o.substring(0,Number(r.value)-Number(i.length))),o}function yi(t,e,r,n){const o=mi(t,e,r,n);return{type:ao,value:o+bo(e)}}function bi(t,e,r,n){const o=mi(t,e,r,n);return{type:ao,value:bo(e)+o}}function _i(t){return(e,r)=>{const n=Eo(r.value);return{type:lo,value:n[t]/255}}}function wi(t){return(e,r,n)=>{const o=Eo(r.value);return o[t]=255*n.value,{type:uo,value:Co(o)}}}const $i=_i("a"),xi=_i("r"),ki=_i("g"),ji=_i("b"),Ei=wi("a"),Ci=wi("r"),Ai=wi("g"),Fi=wi("b");function Di(t,e,r,n){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let o=en(e.value)/en(r);return xo(t,o),"number"==typeof o&&(o=Math.floor(o)),n&&(o=en(o)%en(n)),{type:so,value:o}}const Oi=36e5;function Pi(t){return(e,r,...n)=>{if(0===n.length)throw new Error("Non empty argument list is required.");return Oo(e,function(t,e){let r=t;for(let t=0;t<e.length;++t){if(!r)throw new Error(`Missing property "${e[t]}" in the dict.`);const n=r[e[t]];if(void 0===n)throw new Error(`Missing property "${e[t]}" in the dict.`);r=n}return r}(r.value,n.map((t=>t.value))),t)}}function Si(t,e){return(r,n,o,...i)=>{try{return t(r,o,...i)}catch(t){let r=n.value;return"color"===e&&(r=Ao(r)),{type:e,value:r}}}}const Vi=Pi(ao),Ti=Pi(lo),Ii=Pi(so),Mi=Pi(co),Ni=Pi(uo),zi=Pi(po),Ui=Pi(go),Ri=Pi(fo),Bi=Si(Vi,ao),Li=Si(Ti,lo),Wi=Si(Ii,so),Hi=Si(Mi,co),qi=Si(Ni,uo),Ji=Si(zi,po);function Yi(t,e,...r){try{return Ui(t,e,...r)}catch(t){return{type:go,value:[]}}}function Gi(t,e,...r){try{return Ri(t,e,...r)}catch(t){return{type:fo,value:{}}}}function Xi(t,e){return(r,n,o)=>{if(o.value<0||o.value>=n.value.length)throw new Error(`Requested index (${o.value}) out of bounds array size (${n.value.length}).`);let i=n.value[Number(o.value)],a=typeof i;if("array"===t&&!Array.isArray(i)||"array"!==t&&a!==t||"object"===a&&null===i)throw"object"===a&&(a=Array.isArray(i)?"Array":null===i?"Null":"Dict"),new Error(`Incorrect value type: expected ${wo(e)}, got ${wo(a)}.`);if("number"===t&&"integer"===e){xo(r,i);try{i=en(i)}catch(t){throw new Error("Cannot convert value to integer.")}}return"string"===t&&"color"===e&&(i=Ao(i)),{type:e,value:i}}}function Zi(t,e){return(r,n,o,i)=>{try{return t(r,n,o)}catch(t){let r=i.value;return"color"===e&&(r=Ao(r)),{type:e,value:r}}}}const Qi=Xi("string","string"),Ki=Xi("number","number"),ta=Xi("number","integer"),ea=Xi("boolean","boolean"),ra=Xi("string","color"),na=Xi("string","url"),oa=Xi("array","array"),ia=Xi("object","dict"),aa=Zi(Qi,"string"),sa=Zi(Ki,"number"),la=Zi(ta,"integer"),ca=Zi(ea,"boolean"),ua=Zi(ra,"color"),da=Zi(na,"url");function pa(t){return(e,r,n)=>{if(!e.store)return{type:t,value:n.value};let o;o="boolean"===t?"boolean":"number"===t||"integer"===t?"number":"string";const i=e.store.getValue(r.value,o);return void 0===i?{type:t,value:n.value}:Oo(e,i,t)}}function va(t){return t.map(_o).join(", ")}Io("toString",[so],Ro),Io("toString",[lo],Ro),Io("toString",[co],Ro),Io("toString",[uo],Ro),Io("toString",[po],Ro),Io("toString",[ao],Ro),Io("toString",[go],Ro),Io("toString",[fo],Ro),Io("toNumber",[so],Bo),Io("toNumber",[ao],Bo),Io("toInteger",[lo],(function(t,e){if(e.value>Kr||e.value<tn)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:so,value:en(r)}})),Io("toInteger",[ao],(function(t,e){let r;try{r=en(e.value)}catch(t){throw new Error("Unable to convert value to Integer.")}return{type:so,value:r}})),Io("toInteger",[co],(function(t,e){return{type:so,value:en(e.value?1:0)}})),Io("toBoolean",[so],(function(t,e){const r=Number(e.value);if(1!==r&&0!==r)throw new Error("Unable to convert value to Boolean.");return{type:co,value:r}})),Io("toBoolean",[ao],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:co,value:"true"===e.value?1:0}})),Io("toColor",[ao],(function(t,e){return{type:uo,value:Ao(e.value)}})),Io("toUrl",[ao],(function(t,e){return{type:po,value:e.value}})),Io("encodeUri",[ao],(function(t,e){try{return{type:ao,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),Io("decodeUri",[ao],(function(t,e){try{return{type:ao,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),Io("getIntegerValue",[ao,so],Wo),Io("getNumberValue",[ao,lo],Wo),Io("getBooleanValue",[ao,co],Wo),Io("getStringValue",[ao,ao],Wo),Io("getColorValue",[ao,uo],Ho),Io("getColorValue",[ao,ao],Ho),Io("getUrlValue",[ao,po],qo),Io("getUrlValue",[ao,ao],qo),Mo("toString",[so],Ro),Mo("toString",[lo],Ro),Mo("toString",[co],Ro),Mo("toString",[uo],Ro),Mo("toString",[po],Ro),Mo("toString",[ao],Ro),Mo("toString",[go],Ro),Mo("toString",[fo],Ro),Io("parseUnixTime",[so],(function(t,e){return{type:vo,value:new Date(1e3*Number(e.value))}})),Io("parseUnixTimeAsLocal",[so],(function(t,e){const r=new Date(1e3*Number(e.value)),n=r.getTimezoneOffset();return r.setMinutes(r.getMinutes()-n),{type:vo,value:r}})),Io("nowLocal",[],(function(){return{type:vo,value:new Date}})),Io("addMillis",[vo,so],(function(t,e,r){return{type:vo,value:new Date(e.value.getTime()+Number(r.value))}})),Io("setYear",[vo,so],(function(t,e,r){const n=new Date(e.value);return n.setUTCFullYear(Number(r.value)),{type:vo,value:n}})),Io("setMonth",[vo,so],(function(t,e,r){const n=Number(r.value);if(n<1||n>12)throw new Error(`Expecting month in [1..12], instead got ${n}.`);const o=new Date(e.value);return o.setUTCMonth(n-1),{type:vo,value:o}})),Io("setDay",[vo,so],(function(t,e,r){const n=new Date(e.value),o=Number(r.value);if(o<=0&&-1!==o||o>function(t){const e=new Date(t);return e.setUTCMonth(e.getUTCMonth()+1),e.setUTCDate(0),e.getUTCDate()}(n))throw new Error(`Unable to set day ${o} for date ${bo(e)}.`);return n.setUTCDate(-1===o?0:o),{type:vo,value:n}})),Io("setHours",[vo,so],(function(t,e,r){const n=Number(r.value);if(n<0||n>23)throw new Error(`Expecting hours in [0..23], instead got ${n}.`);const o=new Date(e.value);return o.setUTCHours(n),{type:vo,value:o}})),Io("setMinutes",[vo,so],(function(t,e,r){const n=Number(r.value);if(n<0||n>59)throw new Error(`Expecting minutes in [0..59], instead got ${n}.`);const o=new Date(e.value);return o.setUTCMinutes(n),{type:vo,value:o}})),Io("setSeconds",[vo,so],(function(t,e,r){const n=Number(r.value);if(n<0||n>59)throw new Error(`Expecting seconds in [0..59], instead got ${n}.`);const o=new Date(e.value);return o.setUTCSeconds(n),{type:vo,value:o}})),Io("setMillis",[vo,so],(function(t,e,r){const n=Number(r.value);if(n<0||n>999)throw new Error(`Expecting millis in [0..999], instead got ${n}.`);const o=new Date(e.value);return o.setUTCMilliseconds(n),{type:vo,value:o}})),Io("getYear",[vo],si),Io("getMonth",[vo],li),Io("getDay",[vo],ci),Io("getDayOfWeek",[vo],ui),Io("getHours",[vo],di),Io("getMinutes",[vo],pi),Io("getSeconds",[vo],vi),Io("getMillis",[vo],fi),Io("formatDateAsLocal",[vo,ao],gi),Io("formatDateAsUTC",[vo,ao],hi),Io("formatDateAsLocalWithLocale",[vo,ao,ao],gi),Io("formatDateAsUTCWithLocale",[vo,ao,ao],hi),Io("getIntervalSeconds",[so],(function(t,e){return Di(t,e,1e3,60)})),Io("getIntervalTotalSeconds",[so],(function(t,e){return Di(t,e,1e3)})),Io("getIntervalMinutes",[so],(function(t,e){return Di(t,e,6e4,60)})),Io("getIntervalTotalMinutes",[so],(function(t,e){return Di(t,e,6e4)})),Io("getIntervalHours",[so],(function(t,e){return Di(t,e,Oi,24)})),Io("getIntervalTotalHours",[so],(function(t,e){return Di(t,e,Oi)})),Io("getIntervalTotalDays",[so],(function(t,e){return Di(t,e,864e5)})),Io("getIntervalTotalWeeks",[so],(function(t,e){return Di(t,e,6048e5)})),Io("len",[ao],(function(t,e){return{type:so,value:en(e.value.length)}})),Io("contains",[ao,ao],(function(t,e,r){return{type:co,value:e.value.includes(r.value)?1:0}})),Io("substring",[ao,so,so],(function(t,e,r,n){if(n.value<r.value)throw new Error("Indexes should be in ascending order.");if(r.value<0||r.value>e.value.length||n.value<0||n.value>e.value.length)throw new Error("Indexes are out of bounds.");return{type:ao,value:e.value.substring(Number(r.value),Number(n.value))}})),Io("replaceAll",[ao,ao,ao],(function(t,e,r,n){let o;return o=r.value?e.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(r.value),"g"),n.value):e.value,{type:ao,value:o}})),Io("index",[ao,ao],(function(t,e,r){return{type:so,value:en(e.value.indexOf(r.value))}})),Io("lastIndex",[ao,ao],(function(t,e,r){return{type:so,value:en(e.value.lastIndexOf(r.value))}})),Io("trim",[ao],(function(t,e){return{type:ao,value:e.value.trim()}})),Io("trimLeft",[ao],(function(t,e){return{type:ao,value:e.value.replace(/^\s+/,"")}})),Io("trimRight",[ao],(function(t,e){return{type:ao,value:e.value.replace(/\s+$/,"")}})),Io("toUpperCase",[ao],(function(t,e){return{type:ao,value:e.value.toUpperCase()}})),Io("toLowerCase",[ao],(function(t,e){return{type:ao,value:e.value.toLowerCase()}})),Io("padStart",[ao,so,ao],yi),Io("padStart",[so,so,ao],yi),Io("padEnd",[ao,so,ao],bi),Io("padEnd",[so,so,ao],bi),Io("testRegex",[ao,ao],(function(t,e,r){let n;try{n=new RegExp(r.value)}catch(t){throw new Error("Invalid regular expression.")}return{type:co,value:n.test(e.value)?1:0}})),Io("div",[so,so],(function(t,e,r){if(r.value===rn)throw new Error("Division by zero is not supported.");let n=e.value/r.value;return n=$o(0,n),xo(t,n),{type:so,value:n}})),Io("div",[lo,lo],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const n=e.value/r.value;return{type:lo,value:n}})),Io("mod",[so,so],(function(t,e,r){if(r.value===rn)throw new Error("Division by zero is not supported.");let n=e.value%r.value;return n=$o(0,n),xo(t,n),{type:so,value:n}})),Io("mod",[lo,lo],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const n=e.value%r.value;return{type:lo,value:n}})),Io("mul",[{type:so,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:rn;for(let n=1;n<e.length;++n)r*=e[n].value,r=$o(0,r),xo(t,r);return{type:so,value:r}})),Io("mul",[{type:lo,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r*=e[t].value;return{type:lo,value:r}})),Io("sub",[{type:so,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:rn;for(let n=1;n<e.length;++n)r-=e[n].value,r=$o(0,r),xo(t,r);return{type:so,value:r}})),Io("sub",[{type:lo,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r-=e[t].value;return{type:lo,value:r}})),Io("sum",[{type:so,isVararg:!0}],(function(t,...e){let r=rn;for(let n=0;n<e.length;++n)r+=e[n].value,r=$o(0,r),xo(t,r);return{type:so,value:r}})),Io("sum",[{type:lo,isVararg:!0}],(function(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value;return{type:lo,value:r}})),Io("abs",[so],(function(t,e){const r=nn(e.value);return xo(t,r),{type:e.type,value:r}})),Io("abs",[lo],(function(t,e){const r=Math.abs(e.value);return{type:lo,value:r}})),Io("max",[{type:so,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Function requires non empty argument list.");let r=e[0].value;for(let t=1;t<e.length;++t)e[t].value>r&&(r=e[t].value);return{type:so,value:r}})),Io("max",[{type:lo,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Function requires non empty argument list.");return{type:lo,value:Math.max(...e.map((t=>t.value)))}})),Io("min",[{type:so,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Function requires non empty argument list.");let r=e[0].value;for(let t=1;t<e.length;++t)e[t].value<r&&(r=e[t].value);return{type:so,value:r}})),Io("min",[{type:lo,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Function requires non empty argument list.");return{type:lo,value:Math.min(...e.map((t=>t.value)))}})),Io("maxNumber",[],(function(){return{type:lo,value:oo}})),Io("minNumber",[],(function(){return{type:lo,value:io}})),Io("maxInteger",[],(function(t){return xo(t,Kr),{type:so,value:Kr}})),Io("minInteger",[],(function(t){return xo(t,tn),{type:so,value:tn}})),Io("round",[lo],(function(t,e){const r=Math.sign(e.value);return{type:lo,value:r*Math.round(Math.abs(e.value))}})),Io("floor",[lo],(function(t,e){return{type:lo,value:Math.floor(e.value)}})),Io("ceil",[lo],(function(t,e){return{type:lo,value:Math.ceil(e.value)}})),Io("signum",[so],(function(t,e){return{type:so,value:on(e.value)}})),Io("signum",[lo],(function(t,e){return{type:lo,value:Math.sign(e.value)}})),Io("copySign",[so,so],(function(t,e,r){let n;if(r.value===rn)n=e.value;else if(e.value===rn)n=en(0);else{const t=on(r.value);n=nn(e.value)*t}return xo(t,n),{type:so,value:n}})),Io("copySign",[lo,lo],(function(t,e,r){let n=Math.sign(r.value);0===n&&(n=Object.is(n,0)?1:-1);const o=Math.abs(e.value)*n;return{type:lo,value:o}})),Io("getColorAlpha",[ao],$i),Io("getColorAlpha",[uo],$i),Io("getColorRed",[ao],xi),Io("getColorRed",[uo],xi),Io("getColorGreen",[ao],ki),Io("getColorGreen",[uo],ki),Io("getColorBlue",[ao],ji),Io("getColorBlue",[uo],ji),Io("setColorAlpha",[ao,lo],Ei),Io("setColorAlpha",[uo,lo],Ei),Io("setColorRed",[ao,lo],Ci),Io("setColorRed",[uo,lo],Ci),Io("setColorGreen",[ao,lo],Ai),Io("setColorGreen",[uo,lo],Ai),Io("setColorBlue",[ao,lo],Fi),Io("setColorBlue",[uo,lo],Fi),Io("rgb",[lo,lo,lo],(function(t,e,r,n){const o={a:255,r:255*e.value,g:255*r.value,b:255*n.value};return{type:uo,value:Co(o)}})),Io("argb",[lo,lo,lo,lo],(function(t,e,r,n,o){const i={a:255*e.value,r:255*r.value,g:255*n.value,b:255*o.value};return{type:uo,value:Co(i)}})),function(){const t={type:ao,isVararg:!0};Io("getDictString",[fo,t],Vi),Io("getStringFromDict",[fo,t],Vi),Io("getDictNumber",[fo,t],Ti),Io("getNumberFromDict",[fo,t],Ti),Io("getDictInteger",[fo,t],Ii),Io("getIntegerFromDict",[fo,t],Ii),Io("getDictBoolean",[fo,t],Mi),Io("getBooleanFromDict",[fo,t],Mi),Io("getDictColor",[fo,t],Ni),Io("getColorFromDict",[fo,t],Ni),Io("getDictUrl",[fo,t],zi),Io("getUrlFromDict",[fo,t],zi),Io("getDictOptString",[ao,fo,t],Bi),Io("getOptStringFromDict",[ao,fo,t],Bi),Io("getDictOptNumber",[lo,fo,t],Li),Io("getOptNumberFromDict",[lo,fo,t],Li),Io("getDictOptInteger",[so,fo,t],Wi),Io("getOptIntegerFromDict",[so,fo,t],Wi),Io("getDictOptBoolean",[co,fo,t],Hi),Io("getOptBooleanFromDict",[co,fo,t],Hi),Io("getDictOptColor",[uo,fo,t],qi),Io("getOptColorFromDict",[uo,fo,t],qi),Io("getDictOptColor",[ao,fo,t],qi),Io("getOptColorFromDict",[ao,fo,t],qi),Io("getDictOptUrl",[ao,fo,t],Ji),Io("getOptUrlFromDict",[ao,fo,t],Ji),Io("getDictOptUrl",[po,fo,t],Ji),Io("getOptUrlFromDict",[po,fo,t],Ji),Io("getDictFromDict",[fo,t],Ri),Io("getArrayFromDict",[fo,t],Ui),Io("getOptArrayFromDict",[fo,t],Yi),Io("getOptDictFromDict",[fo,t],Gi),Mo("getString",[fo,t],Vi),Mo("getBoolean",[fo,t],Mi),Mo("getInteger",[fo,t],Ii),Mo("getNumber",[fo,t],Ti),Mo("getUrl",[fo,t],zi),Mo("getColor",[fo,t],Ni),Mo("getArray",[fo,t],Ui),Mo("getDict",[fo,t],Ri)}(),Io("getArrayString",[go,so],Qi),Io("getStringFromArray",[go,so],Qi),Io("getArrayNumber",[go,so],Ki),Io("getNumberFromArray",[go,so],Ki),Io("getArrayInteger",[go,so],ta),Io("getIntegerFromArray",[go,so],ta),Io("getArrayBoolean",[go,so],ea),Io("getBooleanFromArray",[go,so],ea),Io("getArrayColor",[go,so],ra),Io("getColorFromArray",[go,so],ra),Io("getArrayUrl",[go,so],na),Io("getUrlFromArray",[go,so],na),Io("getArrayFromArray",[go,so],oa),Io("getDictFromArray",[go,so],ia),Io("getArrayOptString",[go,so,ao],aa),Io("getOptStringFromArray",[go,so,ao],aa),Io("getArrayOptNumber",[go,so,lo],sa),Io("getOptNumberFromArray",[go,so,lo],sa),Io("getArrayOptInteger",[go,so,so],la),Io("getOptIntegerFromArray",[go,so,so],la),Io("getArrayOptBoolean",[go,so,co],ca),Io("getOptBooleanFromArray",[go,so,co],ca),Io("getArrayOptColor",[go,so,uo],ua),Io("getOptColorFromArray",[go,so,uo],ua),Io("getArrayOptColor",[go,so,ao],ua),Io("getOptColorFromArray",[go,so,ao],ua),Io("getArrayOptUrl",[go,so,po],da),Io("getOptUrlFromArray",[go,so,po],da),Io("getArrayOptUrl",[go,so,ao],da),Io("getOptUrlFromArray",[go,so,ao],da),Io("getOptArrayFromArray",[go,so],(function(t,e,r){try{return oa(t,e,r)}catch(t){return{type:go,value:[]}}})),Io("getOptDictFromArray",[go,so],(function(t,e,r){try{return ia(t,e,r)}catch(t){return{type:fo,value:{}}}})),Io("len",[go],(function(t,e){return{type:so,value:en(e.value.length)}})),Mo("getString",[go,so],Qi),Mo("getInteger",[go,so],ta),Mo("getNumber",[go,so],Ki),Mo("getBoolean",[go,so],ea),Mo("getUrl",[go,so],na),Mo("getColor",[go,so],ra),Mo("getArray",[go,so],oa),Mo("getDict",[go,so],ia),Io("getStoredIntegerValue",[ao,so],pa(so)),Io("getStoredNumberValue",[ao,lo],pa(lo)),Io("getStoredStringValue",[ao,ao],pa(ao)),Io("getStoredUrlValue",[ao,po],pa(po)),Io("getStoredUrlValue",[ao,ao],pa(po)),Io("getStoredColorValue",[ao,uo],pa(uo)),Io("getStoredColorValue",[ao,ao],pa(uo)),Io("getStoredBooleanValue",[ao,co],pa(co));const fa={StringLiteral:function(t,e){return{type:ao,value:e.value}},NumberLiteral:function(t,e){return{type:lo,value:e.value}},IntegerLiteral:function(t,e){return xo(t,e.value),{type:so,value:e.value}},BooleanLiteral:function(t,e){return{type:co,value:e.value?1:0}},UnaryExpression:function(t,e){const r=mo(ga(t,e.argument));switch(e.operator){case"!":if(r.type===co)return{type:co,value:r.value?0:1};jo(`${e.operator}${_o(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const n="+"===e.operator?1:-1;if(r.type===so){const e=r.value*en(n);return xo(t,e),{type:so,value:e}}if(r.type===lo)return{type:lo,value:r.value*n};jo(`${e.operator}${_o(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=mo(ga(t,e.test));if(r.type===co)return r.value?ga(t,e.consequent):ga(t,e.alternate);jo(`${_o(r)} ? ${_o(ga(t,e.consequent))} : ${_o(ga(t,e.alternate))}`,"Ternary must be called with a Boolean value as a condition.")},TryExpression:function(t,e){try{return ga(t,e.test)}catch(r){return ga(t,e.alternate)}},TemplateLiteral:function(t,e){let r="";if(2===e.quasis.length&&""===e.quasis[0].value&&""===e.quasis[1].value)return ga(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=bo(ga(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:ao,value:r}},LogicalExpression:function(t,e){const r=mo(ga(t,e.left));if(r.type!==co&&jo(`${_o(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:co,value:0};const n=mo(ga(t,e.right));return n.type!==co&&jo(`${_o(r)} ${e.operator} ${_o(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${wo(n.type)}.`),{type:co,value:n.value}},BinaryExpression:function(t,e){const r=e.operator;let n=ga(t,e.left),o=ga(t,e.right);if(("number"===n.type&&"integer"===o.type||"integer"===n.type&&"number"===o.type)&&("integer"===n.type?n=Fo(n):"integer"===o.type&&(o=Fo(o))),n.type!==o.type&&jo(`${_o(n)} ${e.operator} ${_o(o)}`,`Operator '${r}' cannot be applied to different types: ${wo(n.type)} and ${wo(o.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===vo&&r.type===vo?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:co,value:n?1:0}}(r,n,o);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==lo&&e.type!==so&&e.type!==vo&&jo(`${_o(e)} ${t} ${_o(r)}`,`Operator '${t}' cannot be applied to ${wo(e.type)} type.`);const o=e.type===vo?e.value.getTime():e.value,i=r.type===vo?r.value.getTime():r.value;return n=">"===t?o>i:">="===t?o>=i:"<"===t?o<i:o<=i,{type:co,value:n?1:0}}(r,n,o);if("+"===r||"-"===r)return function(t,e,r,n){if(r.type!==ao&&r.type!==lo&&r.type!==so&&jo(`${_o(r)} ${e} ${_o(n)}`,`Operator '${e}' cannot be applied to ${wo(r.type)} type.`),r.type===ao)return"-"===e&&jo(`${_o(r)} - ${_o(n)}`,`Operator '${e}' cannot be applied to ${wo(r.type)} type.`),{type:ao,value:r.value+n.value};let o="+"===e?r.value+n.value:r.value-n.value;if(r.type===so)try{o=$o(0,o),xo(t,o)}catch(t){jo(`${_o(r)} ${e} ${_o(n)}`,t.message)}return{type:r.type,value:o}}(t,r,n,o);if("/"===r||"*"===r||"%"===r)return function(t,e,r,n){let o;if(r.type!==so&&r.type!==lo&&jo(`${_o(r)} ${e} ${_o(n)}`,`Operator '${e}' cannot be applied to ${wo(r.type)} type.`),"*"===e)o=r.value*n.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(n.value)&&jo(`${_o(r)} ${e} ${_o(n)}`,"Division by zero is not supported."),o="/"===e?r.value/n.value:r.value%n.value}if(r.type===so)try{o=$o(0,o),xo(t,o)}catch(t){jo(`${_o(r)} ${e} ${_o(n)}`,t.message)}return{type:r.type,value:o}}(t,r,n,o);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;let n,o=e.arguments.map((e=>ga(t,e)));const i=r+":"+o.map((t=>t.type)).join("#");if(So.has(i))n=So.get(i);else{const t=zo("function",r,o);if("expected"in t||"type"in t&&"missing"===t.type){const e=o.map((t=>wo(t.type))).join(", "),n=`${r}(${va(o)})`;"few"===t.type&&0===o.length?jo(n,"Function requires non empty argument list."):"many"===t.type||"few"===t.type||"mismatch"===t.type?jo(n,`Function has no matching overload for given argument types: ${e}.`):jo(n,`Unknown function name: ${r}.`)}n=t.func,t.conversions&&(o=Uo(n,o))}if(!n)throw new Error("Function not found");try{return n.cb(t,...o)}catch(t){jo(`${r}(${va(o)})`,t.message)}},MethodExpression:function(t,e){const r=e.method.name;let n;e.arguments.unshift(e.object);let o=e.arguments.map((e=>ga(t,e)));const i=r+":"+o.map((t=>t.type)).join("#");if(To.has(i))n=To.get(i);else{const t=zo("method",r,o);if("expected"in t||"type"in t&&"missing"===t.type){const e=o.slice(1).map((t=>wo(t.type))).join(", "),n=`${r}(${va(o.slice(1))})`;"few"===t.type&&1===o.length?jo(n,"Method requires non empty argument list."):"many"===t.type||"few"===t.type||"mismatch"===t.type?jo(n,`Method has no matching overload for given argument types: ${e}.`):jo(n,`Unknown method name: ${r}.`)}n=t.func,t.conversions&&(o=Uo(n,o))}if(!n)throw new Error("Method not found");try{return n.cb(t,...o)}catch(t){jo(`${r}(${va(o.slice(1))})`,t.message)}},Variable:function(t,e){const r=e.id.name,n=t.variables.get(r);if(n)return function(t){return{type:t.getType(),value:t.getValue()}}(n);throw new Error(`Variable '${r}' is missing.`)}};function ga(t,e){if(e.type in fa)return fa[e.type](t,e);throw new Error("Unsupported expression")}class ha{constructor(t){this.ast=t}apply({variables:t,logError:e,store:r,weekStartDay:n,keepComplex:o}){try{const i=function(t,e,r,n){try{const o={variables:t,warnings:[],safeIntegerOverflow:!1,store:e,weekStartDay:(null==n?void 0:n.weekStartDay)||0},i=ga(o,r);return o.safeIntegerOverflow&&o.warnings.push(st(new Error("Safe integer overflow, values may lose accuracy."),{level:"warn"})),{result:i,warnings:o.warnings}}catch(t){return{result:{type:"error",value:t.message},warnings:[]}}}(t,r,this.ast,{weekStartDay:n});i.warnings.forEach(e);const a=i.result;if("error"===a.type)return void e(st(new Error("Expression execution error"),{additional:{message:a.value}}));const s=a.value;if(s instanceof Date)return yo(s);if("boolean"===a.type)return Boolean(s);if("color"===a.type){const t=gt(String(s));if(t)return Co(t);e(st(new Error("Expression execution error")))}if("integer"===a.type)return s>2147483647||s<-2147483648?void e(st(new Error("Expression result is out of 32-bit int range"))):Number(s);if(!o&&("array"===a.type||"dict"===a.type))try{return JSON.stringify(s)}catch(t){return e(st(new Error(`Failed to stringify ${a.type}`))),`<${a.type}>`}return s}catch(t){return void e(st(new Error("Expression execution error")))}}}function ma(t,e,r){if(t)if("string"==typeof t){if((n=t).indexOf("@{")>-1||n.indexOf("\\")>-1){e.hasExpression=!0;try{const r=function(t,e){var r,n={},o=(e=void 0!==e?e:{}).grammarSource,i={start:Ee,JsonStringContents:function(){var t,e,r;for(t=ve,e=[],r=Ce();r!==n;)e.push(r),r=Ce();return fe=t,Ct(e)}},a=Ee,s="@{",l="}",c="@{}",u="\\",d="?",p=":",v="!:",f="||",g="&&",h="==",m="!=",y=">=",b=">",_="<=",w="<",$="+",x="-",k="/",j="*",E="%",C="!",A=".",F="(",D=")",O=",",P="'",S="e",V="E",T=/^[^}]/,I=/^[^'}]/,M=/^[0-9]/,N=/^[a-zA-Z_]/,z=/^[a-zA-Z_0-9]/,U=/^[ \t\r\n]/,R=_e("@{",!1),B=_e("}",!1),L=_e("@{}",!1),W=_e("\\",!1),H={type:"any"},q=we(["}"],!0,!1),J=_e("?",!1),Y=_e(":",!1),G=_e("!:",!1),X=_e("||",!1),Z=_e("&&",!1),Q=_e("==",!1),K=_e("!=",!1),tt=_e(">=",!1),et=_e(">",!1),rt=_e("<=",!1),nt=_e("<",!1),ot=_e("+",!1),it=_e("-",!1),at=_e("/",!1),st=_e("*",!1),lt=_e("%",!1),ct=_e("!",!1),ut=_e(".",!1),dt=_e("(",!1),pt=_e(")",!1),vt=_e(",",!1),ft=$e("string"),gt=_e("'",!1),ht=we(["'","}"],!0,!1),mt=$e("integer"),yt=we([["0","9"]],!1,!1),bt=$e("number"),_t=_e("e",!1),wt=_e("E",!1),$t=we([["a","z"],["A","Z"],"_"],!1,!1),xt=we([["a","z"],["A","Z"],"_",["0","9"]],!1,!1),kt=$e("whitespace"),jt=we([" ","\t","\r","\n"],!1,!1),Et=function(t){return t},Ct=function(t){return Kn(t)},At=function(t){return t},Ft=function(){return""},Dt=function(){return be()},Ot=function(){throw new Error("Error tokenizing '"+t+"'.")},Pt=function(){throw new Error("Error tokenizing '"+t+"'.")},St=function(t){return t},Vt=function(t){return eo(t)},Tt=function(){throw new Error("Error tokenizing '"+t+"'.")},It=function(t,e,r){return{type:"ConditionalExpression",test:t,consequent:e,alternate:r}},Mt=function(t,e){return{type:"TryExpression",test:t,alternate:e}},Nt=function(t,e){return Qn(t,e)},zt=function(t,e){return Qn(t,e)},Ut=function(t,e){return Zn(t,e)},Rt=function(t,e){return Zn(t,e)},Bt=function(t,e){return Zn(t,e)},Lt=function(t,e){return Zn(t,e)},Wt=function(t){return t},Ht=function(t){return t},qt=function(t,e){return{type:"UnaryExpression",operator:t,argument:e}},Jt=function(){throw new Error("Incorrect unary operator")},Yt=function(t,e){return function(t,e){return e.length?e.reduce(((t,e)=>{if(!e[5])throw new Error("Method expected after .");return{type:"MethodExpression",object:t,method:e[3],arguments:e[5][2]}}),t):t}(t,e)},Gt=function(t,e){return{type:"CallExpression",callee:t,arguments:e}},Xt=function(t,e){return[t,...e]},Zt=function(t){return t},Qt=function(t){return t},Kt=function(t){return Kn(t)},te=function(t){return t},ee=function(){return""},re=function(){return be()},ne=function(){throw new Error("Error tokenizing '"+t+"'.")},oe=function(){throw new Error("Error tokenizing '"+t+"'.")},ie=function(t){return t},ae=function(t){return eo(t)},se=function(){throw new Error("Error tokenizing '"+t+"'.")},le=function(){return{type:"IntegerLiteral",value:to(be())}},ce=function(){return{type:"NumberLiteral",value:parseFloat(be())}},ue=function(){return{type:"NumberLiteral",value:parseFloat(be())}},de=function(){const t=be();if(/\.\./.test(t)||/\.$/.test(t))throw new Error("Unexpected token: .");return function(t){return"true"===t||"false"===t?{type:"BooleanLiteral",value:"true"===t}:{type:"Variable",id:{type:"Identifier",name:t}}}(t)},pe=function(){return{type:"Identifier",name:be()}},ve=0,fe=0,ge=[{line:1,column:1}],he=0,me=[],ye=0;if("startRule"in e){if(!(e.startRule in i))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=i[e.startRule]}function be(){return t.substring(fe,ve)}function _e(t,e){return{type:"literal",text:t,ignoreCase:e}}function we(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function $e(t){return{type:"other",description:t}}function xe(e){var r,n=ge[e];if(n)return n;for(r=e-1;!ge[r];)r--;for(n={line:(n=ge[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return ge[e]=n,n}function ke(t,e,r){var n=xe(t),i=xe(e),a={source:o,start:{offset:t,line:n.line,column:n.column},end:{offset:e,line:i.line,column:i.column}};return r&&o&&"function"==typeof o.offset&&(a.start=o.offset(a.start),a.end=o.offset(a.end)),a}function je(t){ve<he||(ve>he&&(he=ve,me=[]),me.push(t))}function Ee(){var t,e;return t=ve,Le(),(e=Ae())!==n?(Le(),fe=t,t=Et(e)):(ve=t,t=n),t}function Ce(){var e,r,o,i,a;if(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=n,0===ye&&je(R)),r!==n?(o=Le(),(i=Ae())!==n?(Le(),125===t.charCodeAt(ve)?(a=l,ve++):(a=n,0===ye&&je(B)),a!==n?(fe=e,e=At(i)):(ve=e,e=n)):(ve=e,e=n)):(ve=e,e=n),e===n&&(e=ve,t.substr(ve,3)===c?(r=c,ve+=3):(r=n,0===ye&&je(L)),r!==n&&(fe=e,r=Ft()),(e=r)===n&&(e=ve,r=ve,ye++,92===t.charCodeAt(ve)?(o=u,ve++):(o=n,0===ye&&je(W)),o===n&&(t.substr(ve,2)===s?(o=s,ve+=2):(o=n,0===ye&&je(R))),ye--,o===n?r=void 0:(ve=r,r=n),r!==n?(t.length>ve?(o=t.charAt(ve),ve++):(o=n,0===ye&&je(H)),o!==n?(fe=e,e=Dt()):(ve=e,e=n)):(ve=e,e=n),e===n))){if(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=n,0===ye&&je(R)),r!==n){if(o=[],T.test(t.charAt(ve))?(i=t.charAt(ve),ve++):(i=n,0===ye&&je(q)),i!==n)for(;i!==n;)o.push(i),T.test(t.charAt(ve))?(i=t.charAt(ve),ve++):(i=n,0===ye&&je(q));else o=n;o!==n?(125===t.charCodeAt(ve)?(i=l,ve++):(i=n,0===ye&&je(B)),i!==n?(fe=e,e=Ot()):(ve=e,e=n)):(ve=e,e=n)}else ve=e,e=n;e===n&&(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=n,0===ye&&je(R)),r!==n&&(fe=e,r=Pt()),(e=r)===n&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=n,0===ye&&je(W)),r!==n?(t.substr(ve,2)===s?(o=s,ve+=2):(o=n,0===ye&&je(R)),o!==n?(fe=e,e=St(o)):(ve=e,e=n)):(ve=e,e=n),e===n&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=n,0===ye&&je(W)),r!==n?(t.length>ve?(o=t.charAt(ve),ve++):(o=n,0===ye&&je(H)),o!==n?(fe=e,e=Vt(o)):(ve=e,e=n)):(ve=e,e=n),e===n&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=n,0===ye&&je(W)),r!==n&&(fe=e,r=Tt()),e=r))))}return e}function Ae(){var e,r,o,i,a,s;return e=ve,(r=Fe())!==n?(Le(),63===t.charCodeAt(ve)?(o=d,ve++):(o=n,0===ye&&je(J)),o!==n?(Le(),(i=Ae())!==n?(Le(),58===t.charCodeAt(ve)?(a=p,ve++):(a=n,0===ye&&je(Y)),a!==n?(Le(),(s=Ae())!==n?(fe=e,e=It(r,i,s)):(ve=e,e=n)):(ve=e,e=n)):(ve=e,e=n)):(ve=e,e=n)):(ve=e,e=n),e===n&&(e=Fe()),e}function Fe(){var e,r,o,i;return e=ve,(r=De())!==n?(Le(),t.substr(ve,2)===v?(o=v,ve+=2):(o=n,0===ye&&je(G)),o!==n?(Le(),(i=Ae())!==n?(fe=e,e=Mt(r,i)):(ve=e,e=n)):(ve=e,e=n)):(ve=e,e=n),e===n&&(e=De()),e}function De(){var e,r,o,i,a,s,l,c;if(e=ve,(r=Oe())!==n){for(o=[],i=ve,a=Le(),t.substr(ve,2)===f?(s=f,ve+=2):(s=n,0===ye&&je(X)),s!==n?(l=Le(),(c=Oe())!==n?i=a=[a,s,l,c]:(ve=i,i=n)):(ve=i,i=n);i!==n;)o.push(i),i=ve,a=Le(),t.substr(ve,2)===f?(s=f,ve+=2):(s=n,0===ye&&je(X)),s!==n?(l=Le(),(c=Oe())!==n?i=a=[a,s,l,c]:(ve=i,i=n)):(ve=i,i=n);fe=e,e=Nt(r,o)}else ve=e,e=n;return e}function Oe(){var e,r,o,i,a,s,l,c;if(e=ve,(r=Pe())!==n){for(o=[],i=ve,a=Le(),t.substr(ve,2)===g?(s=g,ve+=2):(s=n,0===ye&&je(Z)),s!==n?(l=Le(),(c=Pe())!==n?i=a=[a,s,l,c]:(ve=i,i=n)):(ve=i,i=n);i!==n;)o.push(i),i=ve,a=Le(),t.substr(ve,2)===g?(s=g,ve+=2):(s=n,0===ye&&je(Z)),s!==n?(l=Le(),(c=Pe())!==n?i=a=[a,s,l,c]:(ve=i,i=n)):(ve=i,i=n);fe=e,e=zt(r,o)}else ve=e,e=n;return e}function Pe(){var e,r,o,i,a,s,l,c;if(e=ve,(r=Se())!==n){for(o=[],i=ve,a=Le(),t.substr(ve,2)===h?(s=h,ve+=2):(s=n,0===ye&&je(Q)),s===n&&(t.substr(ve,2)===m?(s=m,ve+=2):(s=n,0===ye&&je(K))),s!==n?(l=Le(),(c=Se())!==n?i=a=[a,s,l,c]:(ve=i,i=n)):(ve=i,i=n);i!==n;)o.push(i),i=ve,a=Le(),t.substr(ve,2)===h?(s=h,ve+=2):(s=n,0===ye&&je(Q)),s===n&&(t.substr(ve,2)===m?(s=m,ve+=2):(s=n,0===ye&&je(K))),s!==n?(l=Le(),(c=Se())!==n?i=a=[a,s,l,c]:(ve=i,i=n)):(ve=i,i=n);fe=e,e=Ut(r,o)}else ve=e,e=n;return e}function Se(){var e,r,o,i,a,s,l,c;if(e=ve,(r=Ve())!==n){for(o=[],i=ve,a=Le(),t.substr(ve,2)===y?(s=y,ve+=2):(s=n,0===ye&&je(tt)),s===n&&(62===t.charCodeAt(ve)?(s=b,ve++):(s=n,0===ye&&je(et)),s===n&&(t.substr(ve,2)===_?(s=_,ve+=2):(s=n,0===ye&&je(rt)),s===n&&(60===t.charCodeAt(ve)?(s=w,ve++):(s=n,0===ye&&je(nt))))),s!==n?(l=Le(),(c=Ve())!==n?i=a=[a,s,l,c]:(ve=i,i=n)):(ve=i,i=n);i!==n;)o.push(i),i=ve,a=Le(),t.substr(ve,2)===y?(s=y,ve+=2):(s=n,0===ye&&je(tt)),s===n&&(62===t.charCodeAt(ve)?(s=b,ve++):(s=n,0===ye&&je(et)),s===n&&(t.substr(ve,2)===_?(s=_,ve+=2):(s=n,0===ye&&je(rt)),s===n&&(60===t.charCodeAt(ve)?(s=w,ve++):(s=n,0===ye&&je(nt))))),s!==n?(l=Le(),(c=Ve())!==n?i=a=[a,s,l,c]:(ve=i,i=n)):(ve=i,i=n);fe=e,e=Rt(r,o)}else ve=e,e=n;return e}function Ve(){var e,r,o,i,a,s,l,c;if(e=ve,(r=Te())!==n){for(o=[],i=ve,a=Le(),43===t.charCodeAt(ve)?(s=$,ve++):(s=n,0===ye&&je(ot)),s===n&&(45===t.charCodeAt(ve)?(s=x,ve++):(s=n,0===ye&&je(it))),s!==n?(l=Le(),(c=Te())!==n?i=a=[a,s,l,c]:(ve=i,i=n)):(ve=i,i=n);i!==n;)o.push(i),i=ve,a=Le(),43===t.charCodeAt(ve)?(s=$,ve++):(s=n,0===ye&&je(ot)),s===n&&(45===t.charCodeAt(ve)?(s=x,ve++):(s=n,0===ye&&je(it))),s!==n?(l=Le(),(c=Te())!==n?i=a=[a,s,l,c]:(ve=i,i=n)):(ve=i,i=n);fe=e,e=Bt(r,o)}else ve=e,e=n;return e}function Te(){var e,r,o,i,a,s,l,c;if(e=ve,(r=Ie())!==n){for(o=[],i=ve,a=Le(),47===t.charCodeAt(ve)?(s=k,ve++):(s=n,0===ye&&je(at)),s===n&&(42===t.charCodeAt(ve)?(s=j,ve++):(s=n,0===ye&&je(st)),s===n&&(37===t.charCodeAt(ve)?(s=E,ve++):(s=n,0===ye&&je(lt)))),s!==n?(l=Le(),(c=Ie())!==n?i=a=[a,s,l,c]:(ve=i,i=n)):(ve=i,i=n);i!==n;)o.push(i),i=ve,a=Le(),47===t.charCodeAt(ve)?(s=k,ve++):(s=n,0===ye&&je(at)),s===n&&(42===t.charCodeAt(ve)?(s=j,ve++):(s=n,0===ye&&je(st)),s===n&&(37===t.charCodeAt(ve)?(s=E,ve++):(s=n,0===ye&&je(lt)))),s!==n?(l=Le(),(c=Ie())!==n?i=a=[a,s,l,c]:(ve=i,i=n)):(ve=i,i=n);fe=e,e=Lt(r,o)}else ve=e,e=n;return e}function Ie(){var e,r,o,i;return e=ve,r=ve,ye++,45===t.charCodeAt(ve)?(o=x,ve++):(o=n,0===ye&&je(it)),ye--,o!==n?(ve=r,r=void 0):r=n,r!==n&&(o=Re())!==n?(fe=e,e=Wt(o)):(ve=e,e=n),e===n&&(e=ve,r=ve,ye++,45===t.charCodeAt(ve)?(o=x,ve++):(o=n,0===ye&&je(it)),ye--,o!==n?(ve=r,r=void 0):r=n,r!==n&&(o=Ue())!==n?(fe=e,e=Ht(o)):(ve=e,e=n),e===n&&(e=ve,33===t.charCodeAt(ve)?(r=C,ve++):(r=n,0===ye&&je(ct)),r===n&&(43===t.charCodeAt(ve)?(r=$,ve++):(r=n,0===ye&&je(ot)),r===n&&(45===t.charCodeAt(ve)?(r=x,ve++):(r=n,0===ye&&je(it)))),r!==n?(o=Le(),i=function(){var e,r;return e=ve,43===t.charCodeAt(ve)?(r=$,ve++):(r=n,0===ye&&je(ot)),r===n&&(45===t.charCodeAt(ve)?(r=x,ve++):(r=n,0===ye&&je(it))),r!==n&&(fe=e,r=Jt()),r}(),i===n&&(i=Me()),i!==n?(fe=e,e=qt(r,i)):(ve=e,e=n)):(ve=e,e=n),e===n&&(e=Me()))),e}function Me(){var e,r,o,i,a,s,l,c,u,d,p,v,f,g,h;if(e=ve,r=function(){var e,r,o,i,a;return e=ve,(r=Be())!==n?(Le(),40===t.charCodeAt(ve)?(o=F,ve++):(o=n,0===ye&&je(dt)),o!==n?(Le(),(i=Ne())!==n?(Le(),41===t.charCodeAt(ve)?(a=D,ve++):(a=n,0===ye&&je(pt)),a!==n?(fe=e,e=Gt(r,i)):(ve=e,e=n)):(ve=e,e=n)):(ve=e,e=n)):(ve=e,e=n),e===n&&(e=function(){var e,r,o,i;return e=function(){var e,r,o,i,a,s,l,c,u,d,p;if(e=ve,N.test(t.charAt(ve))?(r=t.charAt(ve),ve++):(r=n,0===ye&&je($t)),r!==n){if(o=[],i=[],z.test(t.charAt(ve))?(a=t.charAt(ve),ve++):(a=n,0===ye&&je(xt)),a!==n)for(;a!==n;)i.push(a),z.test(t.charAt(ve))?(a=t.charAt(ve),ve++):(a=n,0===ye&&je(xt));else i=n;for(i===n&&(i=ve,46===t.charCodeAt(ve)?(a=A,ve++):(a=n,0===ye&&je(ut)),a!==n?(s=ve,ye++,l=ve,c=Le(),(u=Be())!==n?(d=Le(),40===t.charCodeAt(ve)?(p=F,ve++):(p=n,0===ye&&je(dt)),p!==n?l=c=[c,u,d,p]:(ve=l,l=n)):(ve=l,l=n),ye--,l===n?s=void 0:(ve=s,s=n),s!==n?i=a=[a,s]:(ve=i,i=n)):(ve=i,i=n));i!==n;){if(o.push(i),i=[],z.test(t.charAt(ve))?(a=t.charAt(ve),ve++):(a=n,0===ye&&je(xt)),a!==n)for(;a!==n;)i.push(a),z.test(t.charAt(ve))?(a=t.charAt(ve),ve++):(a=n,0===ye&&je(xt));else i=n;i===n&&(i=ve,46===t.charCodeAt(ve)?(a=A,ve++):(a=n,0===ye&&je(ut)),a!==n?(s=ve,ye++,l=ve,c=Le(),(u=Be())!==n?(d=Le(),40===t.charCodeAt(ve)?(p=F,ve++):(p=n,0===ye&&je(dt)),p!==n?l=c=[c,u,d,p]:(ve=l,l=n)):(ve=l,l=n),ye--,l===n?s=void 0:(ve=s,s=n),s!==n?i=a=[a,s]:(ve=i,i=n)):(ve=i,i=n))}fe=e,e=de()}else ve=e,e=n;return e}(),e===n&&(e=function(){var e,r,o,i;return ye++,e=ve,39===t.charCodeAt(ve)?(r=P,ve++):(r=n,0===ye&&je(gt)),r!==n?(o=function(){var t,e,r;for(t=ve,e=[],r=ze();r!==n;)e.push(r),r=ze();return fe=t,Kt(e)}(),39===t.charCodeAt(ve)?(i=P,ve++):(i=n,0===ye&&je(gt)),i!==n?(fe=e,e=Qt(o)):(ve=e,e=n)):(ve=e,e=n),ye--,e===n&&(r=n,0===ye&&je(ft)),e}(),e===n&&(e=Re())===n&&(e=Ue())===n&&(e=ve,40===t.charCodeAt(ve)?(r=F,ve++):(r=n,0===ye&&je(dt)),r!==n?(Le(),(o=Ae())!==n?(Le(),41===t.charCodeAt(ve)?(i=D,ve++):(i=n,0===ye&&je(pt)),i!==n?(fe=e,e=Zt(o)):(ve=e,e=n)):(ve=e,e=n)):(ve=e,e=n))),e}()),e}(),r!==n){for(o=[],i=ve,a=Le(),46===t.charCodeAt(ve)?(s=A,ve++):(s=n,0===ye&&je(ut)),s!==n?(l=Le(),(c=Be())!==n?(u=Le(),d=ve,40===t.charCodeAt(ve)?(p=F,ve++):(p=n,0===ye&&je(dt)),p!==n?(v=Le(),(f=Ne())!==n?(g=Le(),41===t.charCodeAt(ve)?(h=D,ve++):(h=n,0===ye&&je(pt)),h!==n?d=p=[p,v,f,g,h]:(ve=d,d=n)):(ve=d,d=n)):(ve=d,d=n),d===n&&(d=null),i=a=[a,s,l,c,u,d]):(ve=i,i=n)):(ve=i,i=n);i!==n;)o.push(i),i=ve,a=Le(),46===t.charCodeAt(ve)?(s=A,ve++):(s=n,0===ye&&je(ut)),s!==n?(l=Le(),(c=Be())!==n?(u=Le(),d=ve,40===t.charCodeAt(ve)?(p=F,ve++):(p=n,0===ye&&je(dt)),p!==n?(v=Le(),(f=Ne())!==n?(g=Le(),41===t.charCodeAt(ve)?(h=D,ve++):(h=n,0===ye&&je(pt)),h!==n?d=p=[p,v,f,g,h]:(ve=d,d=n)):(ve=d,d=n)):(ve=d,d=n),d===n&&(d=null),i=a=[a,s,l,c,u,d]):(ve=i,i=n)):(ve=i,i=n);fe=e,e=Yt(r,o)}else ve=e,e=n;return e}function Ne(){var e,r,o,i,a,s;if(e=ve,(r=Ae())!==n){for(o=[],i=ve,Le(),44===t.charCodeAt(ve)?(a=O,ve++):(a=n,0===ye&&je(vt)),a!==n?(Le(),(s=Ae())!==n?i=s:(ve=i,i=n)):(ve=i,i=n);i!==n;)o.push(i),i=ve,Le(),44===t.charCodeAt(ve)?(a=O,ve++):(a=n,0===ye&&je(vt)),a!==n?(Le(),(s=Ae())!==n?i=s:(ve=i,i=n)):(ve=i,i=n);fe=e,e=Xt(r,o)}else ve=e,e=n;return e===n&&(e=Le()),e}function ze(){var e,r,o,i,a;if(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=n,0===ye&&je(R)),r!==n?(o=Le(),(i=Ae())!==n?(Le(),125===t.charCodeAt(ve)?(a=l,ve++):(a=n,0===ye&&je(B)),a!==n?(fe=e,e=te(i)):(ve=e,e=n)):(ve=e,e=n)):(ve=e,e=n),e===n&&(e=ve,t.substr(ve,3)===c?(r=c,ve+=3):(r=n,0===ye&&je(L)),r!==n&&(fe=e,r=ee()),(e=r)===n&&(e=ve,r=ve,ye++,92===t.charCodeAt(ve)?(o=u,ve++):(o=n,0===ye&&je(W)),o===n&&(39===t.charCodeAt(ve)?(o=P,ve++):(o=n,0===ye&&je(gt)),o===n&&(t.substr(ve,2)===s?(o=s,ve+=2):(o=n,0===ye&&je(R)))),ye--,o===n?r=void 0:(ve=r,r=n),r!==n?(t.length>ve?(o=t.charAt(ve),ve++):(o=n,0===ye&&je(H)),o!==n?(fe=e,e=re()):(ve=e,e=n)):(ve=e,e=n),e===n))){if(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=n,0===ye&&je(R)),r!==n){if(o=[],I.test(t.charAt(ve))?(i=t.charAt(ve),ve++):(i=n,0===ye&&je(ht)),i!==n)for(;i!==n;)o.push(i),I.test(t.charAt(ve))?(i=t.charAt(ve),ve++):(i=n,0===ye&&je(ht));else o=n;o!==n?(125===t.charCodeAt(ve)?(i=l,ve++):(i=n,0===ye&&je(B)),i!==n?(fe=e,e=ne()):(ve=e,e=n)):(ve=e,e=n)}else ve=e,e=n;e===n&&(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=n,0===ye&&je(R)),r!==n&&(fe=e,r=oe()),(e=r)===n&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=n,0===ye&&je(W)),r!==n?(t.substr(ve,2)===s?(o=s,ve+=2):(o=n,0===ye&&je(R)),o!==n?(fe=e,e=ie(o)):(ve=e,e=n)):(ve=e,e=n),e===n&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=n,0===ye&&je(W)),r!==n?(t.length>ve?(o=t.charAt(ve),ve++):(o=n,0===ye&&je(H)),o!==n?(fe=e,e=ae(o)):(ve=e,e=n)):(ve=e,e=n),e===n&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=n,0===ye&&je(W)),r!==n&&(fe=e,r=se()),e=r))))}return e}function Ue(){var e,r,o,i;if(ye++,e=ve,45===t.charCodeAt(ve)?(r=x,ve++):(r=n,0===ye&&je(it)),r===n&&(r=null),o=[],M.test(t.charAt(ve))?(i=t.charAt(ve),ve++):(i=n,0===ye&&je(yt)),i!==n)for(;i!==n;)o.push(i),M.test(t.charAt(ve))?(i=t.charAt(ve),ve++):(i=n,0===ye&&je(yt));else o=n;return o!==n?(fe=e,e=le()):(ve=e,e=n),ye--,e===n&&(r=n,0===ye&&je(mt)),e}function Re(){var e,r,o,i,a,s,l,c,u,d;for(ye++,e=ve,45===t.charCodeAt(ve)?(r=x,ve++):(r=n,0===ye&&je(it)),r===n&&(r=null),o=[],M.test(t.charAt(ve))?(i=t.charAt(ve),ve++):(i=n,0===ye&&je(yt));i!==n;)o.push(i),M.test(t.charAt(ve))?(i=t.charAt(ve),ve++):(i=n,0===ye&&je(yt));if(46===t.charCodeAt(ve)?(i=A,ve++):(i=n,0===ye&&je(ut)),i!==n){if(a=[],M.test(t.charAt(ve))?(s=t.charAt(ve),ve++):(s=n,0===ye&&je(yt)),s!==n)for(;s!==n;)a.push(s),M.test(t.charAt(ve))?(s=t.charAt(ve),ve++):(s=n,0===ye&&je(yt));else a=n;if(a!==n){if(s=ve,101===t.charCodeAt(ve)?(l=S,ve++):(l=n,0===ye&&je(_t)),l===n&&(69===t.charCodeAt(ve)?(l=V,ve++):(l=n,0===ye&&je(wt))),l!==n){if(43===t.charCodeAt(ve)?(c=$,ve++):(c=n,0===ye&&je(ot)),c===n&&(45===t.charCodeAt(ve)?(c=x,ve++):(c=n,0===ye&&je(it))),c===n&&(c=null),u=[],M.test(t.charAt(ve))?(d=t.charAt(ve),ve++):(d=n,0===ye&&je(yt)),d!==n)for(;d!==n;)u.push(d),M.test(t.charAt(ve))?(d=t.charAt(ve),ve++):(d=n,0===ye&&je(yt));else u=n;u!==n?s=l=[l,c,u]:(ve=s,s=n)}else ve=s,s=n;s===n&&(s=null),fe=e,e=ce()}else ve=e,e=n}else ve=e,e=n;if(e===n){if(e=ve,45===t.charCodeAt(ve)?(r=x,ve++):(r=n,0===ye&&je(it)),r===n&&(r=null),o=[],M.test(t.charAt(ve))?(i=t.charAt(ve),ve++):(i=n,0===ye&&je(yt)),i!==n)for(;i!==n;)o.push(i),M.test(t.charAt(ve))?(i=t.charAt(ve),ve++):(i=n,0===ye&&je(yt));else o=n;if(o!==n)if(101===t.charCodeAt(ve)?(i=S,ve++):(i=n,0===ye&&je(_t)),i===n&&(69===t.charCodeAt(ve)?(i=V,ve++):(i=n,0===ye&&je(wt))),i!==n){if(43===t.charCodeAt(ve)?(a=$,ve++):(a=n,0===ye&&je(ot)),a===n&&(45===t.charCodeAt(ve)?(a=x,ve++):(a=n,0===ye&&je(it))),a===n&&(a=null),s=[],M.test(t.charAt(ve))?(l=t.charAt(ve),ve++):(l=n,0===ye&&je(yt)),l!==n)for(;l!==n;)s.push(l),M.test(t.charAt(ve))?(l=t.charAt(ve),ve++):(l=n,0===ye&&je(yt));else s=n;s!==n?(fe=e,e=ue()):(ve=e,e=n)}else ve=e,e=n;else ve=e,e=n}return ye--,e===n&&(r=n,0===ye&&je(bt)),e}function Be(){var e,r,o,i;if(e=ve,N.test(t.charAt(ve))?(r=t.charAt(ve),ve++):(r=n,0===ye&&je($t)),r!==n){for(o=[],z.test(t.charAt(ve))?(i=t.charAt(ve),ve++):(i=n,0===ye&&je(xt));i!==n;)o.push(i),z.test(t.charAt(ve))?(i=t.charAt(ve),ve++):(i=n,0===ye&&je(xt));fe=e,e=pe()}else ve=e,e=n;return e}function Le(){var e,r;for(ye++,e=[],U.test(t.charAt(ve))?(r=t.charAt(ve),ve++):(r=n,0===ye&&je(jt));r!==n;)e.push(r),U.test(t.charAt(ve))?(r=t.charAt(ve),ve++):(r=n,0===ye&&je(jt));return ye--,r=n,0===ye&&je(kt),e}if((r=a())!==n&&ve===t.length)return r;throw r!==n&&ve<t.length&&je({type:"end"}),function(t,e,r){return new ro(ro.buildMessage(t,e),t,e,r)}(me,he<t.length?t.charAt(he):null,he<t.length?ke(he,he+1):ke(he,he))}(t,{startRule:"JsonStringContents"}),n=ko(r);return e.vars.push(...n),new ha(r)}catch(e){return void r(st(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>ma(t,e,r)));if("object"==typeof t){const n={};for(const o in t)n[o]=ma(t[o],e,r);return n}}var n;return t}function ya(t,e){if(t){if(t instanceof ha)return t.apply(e);if(Array.isArray(t))return t.map((t=>ya(t,e)));if("object"==typeof t){const r={};for(const n in t)r[n]=ya(t[n],e);return r}}return t}function ba(t,e,r,n){const o={vars:[],hasExpression:!1},i=ma(t,o,e);return{vars:[...new Set(o.vars)],hasExpression:o.hasExpression,applyVars:(t,o)=>ya(i,{variables:t,logError:e,store:r,weekStartDay:n,keepComplex:o})}}const _a={pagers:function(){return Q(new Map)}},wa=new Map,$a=new Map;function xa(t){const e=wa.get(t)||Q("");return wa.has(t)||wa.set(t,e),e}function ka(t){const e=$a.get(t)||new Map;return $a.has(t)||$a.set(t,e),e}class ja{setVariable(t){const e=t.getName(),r=ka(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),xa(this).set(e)}getVariable(t){return ka(this).get(t)}list(){return ka(this).values()}}function Ea(){return new ja}function Ca(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const Aa=new Set(["start","stop","pause","resume","cancel","reset"]);class Fa{constructor(t){Ca(this,"timers",new Map),Ca(this,"awaitActions",[]),this.logError=t.logError,this.applyVars=t.applyVars,this.hasVariableWithType=t.hasVariableWithType,this.setVariableValue=t.setVariableValue,this.execAnyActions=t.execAnyActions,this.visibilityHandler=()=>{"visible"===document.visibilityState?(this.awaitActions.forEach((({id:t,action:e})=>{this.execTimerAction(t,e)})),this.awaitActions=[],this.unholdAll()):this.holdAll()},document.addEventListener("visibilitychange",this.visibilityHandler)}destroy(){document.removeEventListener("visibilitychange",this.visibilityHandler);for(const[t,e]of this.timers)this.stopTimerTimeouts(e)}createTimer(t){null!=t&&t.id?t.duration||t.tick_interval&&(t.value_variable||t.tick_actions)?this.timers.set(t.id,{state:"stopped",definition:t}):this.logError(st(new Error("Misconfigured timer"),{additional:{id:t.id}})):this.logError(st(new Error("Missing timer id")))}execTimerAction(t,e){if(!(t&&e&&this.timers.has(t)&&Aa.has(e)))return void this.logError(st(new Error("Incorrect timer action"),{additional:{id:t,action:e}}));const r=e;if("visible"!==document.visibilityState)return void this.awaitActions.push({id:t,action:r});const n=this.timers.get(t);this[r](n)}stopTimerTimeouts(t){t.durationTimeout&&(clearTimeout(t.durationTimeout),t.durationTimeout=void 0),t.tickTimeout&&(clearTimeout(t.tickTimeout),t.tickTimeout=void 0)}async tickOrUnholdAction(t){const e=performance.now(),r=(t.durationPassed||0)+e-(t.durationStarted||0);t.duration&&r>t.duration||(this.updateVariable(t,r),await this.callActions(t,"tick"),void 0!==t.tickCount&&++t.tickCount)}startOrResume(t){t.state="running",t.hold=!1,t.durationStarted=performance.now();const e=t.duration;e&&(t.durationTimeout=window.setTimeout((async()=>{this.updateVariable(t,e),t.tickCountPredict&&void 0!==t.tickCount&&t.tickCount<t.tickCountPredict&&await this.callActions(t,"tick"),this.stop(t)}),Math.max(0,e-(t.durationPassed||0))));const r=t.tick;if(r){const e=()=>{const n=t.tickStarted=performance.now(),o=Math.max(0,r-(t.tickPassed||0));t.tickTimeout=window.setTimeout((async()=>{await this.tickOrUnholdAction(t),t.tickPassed=(performance.now()-n-o)%r,"running"===t.state&&e()}),o)};e()}}start(t){if("running"===t.state)return void this.logError(st(new Error("The timer is already running")));if("paused"===t.state)return void this.logError(st(new Error("The timer is paused")));const e=t.definition.value_variable;!e||this.hasVariableWithType(e,"integer")?(e&&this.setVariableValue(e,0),t.definition.duration&&(t.duration=this.applyVars(t.definition.duration)),t.definition.tick_interval&&(t.tick=this.applyVars(t.definition.tick_interval)),void 0!==t.duration&&t.duration<0||void 0!==t.tick&&t.tick<=0?this.logError(st(new Error("Incorrect timer properties"),{additional:{id:t.definition.id}})):(void 0!==t.duration&&void 0!==t.tick&&(t.tickCount=0,t.tickCountPredict=Math.floor(t.duration/t.tick)),this.startOrResume(t))):this.logError(st(new Error("Cannot find variable"),{additional:{name:e}}))}stop(t){"stopped"!==t.state?(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t),this.callActions(t,"end")):this.logError(st(new Error("The timer has already been stopped")))}pause(t){if("stopped"===t.state)return void this.logError(st(new Error("The timer has already been stopped")));if("paused"===t.state)return void this.logError(st(new Error("The timer has already been paused")));t.state="paused",this.stopTimerTimeouts(t);const e=performance.now();t.durationStarted&&(t.durationPassed=(t.durationPassed||0)+e-t.durationStarted),t.tickStarted&&(t.tickPassed=(t.tickPassed||0)+e-t.tickStarted);const r=t.definition.value_variable;r&&t.durationPassed&&this.setVariableValue(r,Math.round(t.durationPassed))}resume(t){"stopped"!==t.state?"running"!==t.state?this.startOrResume(t):this.logError(st(new Error("The timer is already running"))):this.logError(st(new Error("The timer has already been stopped")))}cancel(t){"stopped"!==t.state&&(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t))}reset(t){this.cancel(t),this.start(t)}updateVariable(t,e){const r=t.definition.value_variable;r&&this.setVariableValue(r,Math.round(e))}async callActions(t,e){const r=t.definition["end"===e?"end_actions":"tick_actions"];if(r){const t=this.applyVars(r);return this.execAnyActions(t,{processUrls:!1})}}holdAll(){for(const[t,e]of this.timers)"running"===e.state&&(e.hold=!0,this.stopTimerTimeouts(e))}async unholdAll(){for(const[t,e]of this.timers)if("running"===e.state&&e.hold){const t=performance.now();e.durationStarted&&(e.durationPassed=(e.durationPassed||0)+t-e.durationStarted),e.tickStarted&&(e.tickPassed=(e.tickPassed||0)+t-e.tickStarted),e.tick&&await this.tickOrUnholdAction(e),this.startOrResume(e)}}}function Da(t,e,r,n){const{variable_name:o}=r;if(!o)return void e(st(new Error(`Incorrect ${r.type} action`),{additional:{name:o}}));const i=t.get(o);if(!i)return void e(st(new Error("Cannot find variable"),{additional:{name:o}}));const a=i.getType();"array"===a?n(i):e(st(new Error("Trying to insert value into the non-array"),{additional:{name:o,type:a}}))}const Oa={tooltip:"divkit-f1907",tooltip_visible:"divkit-e5914"},Pa=L(((t,e,r,n)=>{var o,a,s,c;let u,d,p,f,h,m,y,b,_,w,$,x,k,j,E=i,C=i,A=i,F=i,D=i,{ownerNode:O}=e,{data:P}=e,{internalId:S}=e,{parentComponentContext:V}=e;x=l(g(at).isDesktop,(t=>$=t)),Date.now();return v((()=>{var t;null===(t=null)||void 0===t||t.disconnect()})),void 0===e.ownerNode&&r.ownerNode&&void 0!==O&&r.ownerNode(O),void 0===e.data&&r.data&&void 0!==P&&r.data(P),void 0===e.internalId&&r.internalId&&void 0!==S&&r.internalId(S),void 0===e.parentComponentContext&&r.parentComponentContext&&void 0!==V&&r.parentComponentContext(V),u=V.produceChildContext(P.div),d=V.getDerivedFromVars(P.position),A(),A=l(d,(t=>w=t)),p=V.getDerivedFromVars(null===(o=P.offset)||void 0===o||null===(a=o.x)||void 0===a?void 0:a.value),C(),C=l(p,(t=>_=t)),f=V.getDerivedFromVars(null===(s=P.offset)||void 0===s||null===(c=s.y)||void 0===c?void 0:c.value),E(),E=l(f,(t=>b=t)),h=V.getDerivedFromVars(P.animation_in),F(),F=l(h,(t=>k=t)),m=V.getDerivedFromVars(P.animation_out),D(),D=l(m,(t=>j=t)),y={visible:!1},E(),C(),A(),x(),F(),D(),` <div class="${T(Ft("tooltip",Oa,y),!0)+" "+T($?nt:"",!0)}"${q({top:"",left:"",width:"",height:""})}${W("this",undefined,0)}>${U(Yn,"Unknown").$$render(t,{componentContext:u},{},{})}</div>`})),Sa={root_platform_desktop:"divkit-ee112",menu:"divkit-cedbe",menu_visible:"divkit-e4801",menu__list:"divkit-c8df2",menu__item:"divkit-ffd4a"},Va=L(((t,e,r,n)=>{let o,i,a,{ownerNode:s}=e,{items:c}=e,{parentComponentContext:u}=e;const d=g(at),f=d.getCustomization("menuPopupClass")||"",h=d.getCustomization("menuItemClass")||"";a=l(d.isDesktop,(t=>i=t)),Date.now();const m=function(){const t=p();return(e,r,{cancelable:n=!1}={})=>{const o=t.$$.callbacks[e];if(o){const i=function(t,e,{bubbles:r=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:r,cancelable:n})}(e,r,{cancelable:n});return o.slice().forEach((e=>{e.call(t,i)})),!i.defaultPrevented}return!0}}();function y(){return m("close"),!0}return v((()=>{var t;null===(t=null)||void 0===t||t.disconnect()})),void 0===e.ownerNode&&r.ownerNode&&void 0!==s&&r.ownerNode(s),void 0===e.items&&r.items&&void 0!==c&&r.items(c),void 0===e.parentComponentContext&&r.parentComponentContext&&void 0!==u&&r.parentComponentContext(u),o={visible:!1},a(),` <div class="${T(Ft("menu",Sa,o),!0)+" "+T(i?nt:"",!0)+" "+T(f,!0)}"${q({top:"",left:"",width:"",height:""})}${W("this",undefined,0)}><ul${W("class",Sa.menu__list,0)}>${N(c,(e=>`<li>${U(Jt,"Actionable").$$render(t,{componentContext:u,actions:e.actions||e.action&&[e.action],cls:Sa.menu__item+" "+h,customAction:y},{},{default:()=>`${T(e.text)} `})} </li>`))}</ul></div>`}));class Ta{constructor(t){this.params=t,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerUp=this.onPointerUp.bind(this)}processActions(t){const e=this.params[t];Array.isArray(e)&&e.length&&this.context&&this.context.processExpressions(e).forEach((t=>{var e;null===(e=this.context)||void 0===e||e.execAction(t)}))}onPointerDown(t){this.startCoords={pageX:t.pageX,pageY:t.pageY}}onPointerUp(t){if(!this.startCoords)return;const e=t.pageX-this.startCoords.pageX,r=t.pageY-this.startCoords.pageY;Math.abs(e)>Math.abs(r)?e>8?this.processActions("swipe_right"):e<-8&&this.processActions("swipe_left"):r>8?this.processActions("swipe_down"):r<-8&&this.processActions("swipe_up")}mountView(t,e){this.context=e,t.addEventListener("pointerdown",this.onPointerDown),t.addEventListener("pointerup",this.onPointerUp),t.addEventListener("pointercancel",this.onPointerUp)}unmountView(t,e){t.removeEventListener("pointerdown",this.onPointerDown),t.removeEventListener("pointerup",this.onPointerUp),t.removeEventListener("pointercancel",this.onPointerUp)}}function Ia(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ma(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ia(Object(r),!0).forEach((function(e){Na(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ia(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Na(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}let za=Q(!0),Ua=0;function Ra(){za.set(!1)}function Ba(){za.set(!0)}const La=new Set(["string","integer","number","url","color","boolean"]);function Wa(t,e){return t&&e?new Map([...t,...e]):t||e||void 0}const Ha=L(((t,e,r,n)=>{var o,i,a,s,c,u;let d,p,g,h,m,y,{id:b}=e,{json:_={}}=e,{platform:w="auto"}=e,{theme:x="system"}=e,{globalVariablesController:k=new ja}=e,{mix:j=""}=e,{customization:E={}}=e,{builtinProtocols:C=["http","https","tel","mailto","intent"]}=e,{extensions:A=new Map}=e,{onError:F}=e,{onStat:D}=e,{onCustomAction:O}=e,{onComponent:P}=e,{typefaceProvider:S=(t=>"")}=e,{fetchInit:V={}}=e,{tooltipRoot:I}=e,{customComponents:M}=e,{direction:z="ltr"}=e,{store:R}=e,{weekStartDay:B=0}=e;A.set("gesture",Ta);let L=!0,H=Q("desktop"===w);if(h=l(H,(t=>g=t)),"auto"===w&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");H.set(!t.matches),t.addListener((()=>{H.set(!t.matches)}))}let q="light",J=null;const Y=Q("rtl"===z?"rtl":"ltr");function G(t){x=t}function X(){return new Map}function Z(){return new Map}function tt(t){_=t}y=l(Y,(t=>m=t));const et=new Set(C);let rt=!1,ot=!1;b||(ot=!0,_t(st(new Error('"id" prop is required'))));const it={stateChange:!1},lt=xa(k),ct=ka(k),ut=new Map,dt=new Map,pt=new Map;let vt,ft=null,gt=0,ht=[];const yt=[];function bt(t,e,r,n=!1){const o=ba(e,t,R,B);if(!o.hasExpression)return e;const i=Wa(dt,r);return o.applyVars(i,n)}function _t(t){F?F({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function wt(t,e){D&&D({type:t,action:e})}function $t(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type&&t.type in d;){if(({json:t,templateContext:e}=Xn(t,e,d,_t)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}}let jt=0;function Et(t){return`${b}-${jt++}`}let Ct={},At={};function Ft(t){Ot(bt(_t,t))}async function Ot(t,e){const r=t.url?String(t.url):"",n=t.typed;if(!Lt(t))return;const o=(null==e?void 0:e.logError)||_t;if(r)try{const n=r.replace(/div-action:\/\//,""),i=/([^?]+)\?(.+)/.exec(n);if(!i)return;const a=new URLSearchParams(i[2]);switch(i[1]){case"set_state":await async function(t){if(!t)throw new Error("Missing state id");let e=Ut,r=t.split("/");if(r=["root",...r],r.length<2||r.length%2!=0)throw new Error("Incorrect state id format");for(let t=0;t<r.length;t+=2){const n=r[t],o=r[t+1];let i=e.getChild(n);if(!i)return;await i.setState(o),e=i}}(a.get("state_id"));break;case"set_current_item":case"set_previous_item":case"set_next_item":case"scroll_to_start":case"scroll_to_end":case"scroll_backward":case"scroll_forward":case"scroll_to_position":!function(t,e,{item:r,step:n,overflow:o}){var i,a,s,l,c;if(!e)throw new Error(`Missing id for "${t}" action`);const u=Number(r);if("set_current_item"===t&&Number.isNaN(u))throw new Error(`Incorrect item for "${t}" action`);let d=Number(n);if(n||"set_previous_item"!==t&&"set_next_item"!==t||(d=1),!n&&("scroll_backward"===t||"scroll_forward"===t||"scroll_to_position"===t)||Number.isNaN(d))throw new Error(`Incorrect step value for "${t}" action`);if(o&&"clamp"!==o&&"ring"!==o)throw new Error(`Incorrect overflow value for "${t}" action`);o=o||"clamp";const p=Nt(e);if(p)switch(t){case"set_current_item":return void p.setCurrentItem(u);case"set_previous_item":return void p.setPreviousItem(d,o);case"set_next_item":return void p.setNextItem(d,o);case"scroll_to_start":return void(null===(i=p.scrollToStart)||void 0===i||i.call(p));case"scroll_to_end":return void(null===(a=p.scrollToEnd)||void 0===a||a.call(p));case"scroll_backward":return void(null===(s=p.scrollBackward)||void 0===s||s.call(p,d,o));case"scroll_forward":return void(null===(l=p.scrollForward)||void 0===l||l.call(p,d,o));case"scroll_to_position":null===(c=p.scrollToPosition)||void 0===c||c.call(p,d)}}(i[1],a.get("id"),{item:a.get("item"),step:a.get("step"),overflow:a.get("overflow")});break;case"set_variable":const s=a.get("name"),l=a.get("value");if(s&&null!==l){const t=dt.get(s);if(t){const e=t.getType();"dict"===e||"array"===e?o(st(new Error(`Setting ${e} variables is not supported`),{additional:{name:s}})):t.set(l)}else o(st(new Error("Cannot find variable"),{additional:{name:s}}))}else o(st(new Error("Incorrect set_variable_action"),{additional:{url:n}}));break;case"timer":const c=a.get("action"),u=a.get("id");ft?ft.execTimerAction(u,c):o(st(new Error("Incorrect timer action"),{additional:{id:u,action:c}}));break;case"video":!function(t,e,r){const n=(null==r?void 0:r.logError)||_t;if(t){const r=Nt(t);r?"start"===e?r.start():"pause"===e?r.pause():n(st(new Error("Unknown video action"),{additional:{id:t,action:e}})):n(st(new Error("Video component is not found"),{additional:{id:t,action:e}}))}else n(st(new Error("Missing id in video action"),{additional:{action:e}}))}(a.get("id"),a.get("action"),e);break;case"download":!function(t,e,r){const n=(null==r?void 0:r.logError)||_t;if(t){let r;r="function"==typeof V?V(t):V,fetch(t,r).then((t=>{if(!t.ok)throw new Error("Response is not ok");return t.json()})).then((r=>{var o;if(r){if(r.templates)for(const t in r.templates)d.hasOwnProperty(t)||(d[t]=r.templates[t]);if(Array.isArray(null===(o=r.patch)||void 0===o?void 0:o.changes)){var i;if("transactional"===r.patch.mode){const o=r.patch.changes.find((t=>{const e=Tt.get(t.id);if(!e)return!0;const r=Array.isArray(t.items)?t.items.length:0;return!(!e.isSingleMode||1===r)}));var a;if(o)return n(st(new Error("Skipping transactional, child is not found or broken"),{additional:{url:t,id:o.id}})),void Pt(null===(a=e.download_callbacks)||void 0===a?void 0:a.on_fail_actions)}r.patch.changes.forEach((t=>{const e=Tt.get(t.id);e&&e.replaceWith(t.id,t.items)})),Pt(null===(i=e.download_callbacks)||void 0===i?void 0:i.on_success_actions)}}else n(st(new Error("Incorrect patch"),{additional:{url:t}}))})).catch((r=>{var o;n(st(new Error("Failed to download the patch"),{additional:{url:t,originalError:r}})),Pt(null===(o=e.download_callbacks)||void 0===o?void 0:o.on_fail_actions)}))}else n(st(new Error("Missing url in download action"),{additional:{url:t}}))}(a.get("url"),t,e);break;case"show_tooltip":!function(t,e,r){var n;const o=(null==r?void 0:r.logError)||_t;if(!t)return void o(st(new Error("Missing id in show_tooltip action")));const i=Mt.get(t);if(!i)return void o(st(new Error("Tooltip with the provided id is not found"),{additional:{id:t}}));if("true"!==e&&ht.some((e=>e.desc.id===t)))return;const a={internalId:++gt,ownerNode:i.onwerNode,desc:i.tooltip,timeoutId:0};ht=[...ht,a];const s=null!==(n=i.tooltip.duration)&&void 0!==n?n:5e3;s&&(a.timeoutId=window.setTimeout((()=>{a.timeoutId=0,ht=ht.filter((t=>t.internalId!==a.internalId))}),s))}(a.get("id"),a.get("multiple"),e);break;case"hide_tooltip":!function(t,e){const r=(null==e?void 0:e.logError)||_t;t?ht=ht.filter((e=>{const r=e.desc.id!==t;return!r&&e.timeoutId&&(clearTimeout(e.timeoutId),e.timeoutId=null),r})):r(st(new Error("Missing id in hide_tooltip action")))}(a.get("id"),e);break;case"set_stored_value":!function(t,e,r,n,o){const i=(null==t?void 0:t.logError)||_t;if(!R)return void i(st(new Error("Store is not configured")));let a=r;e&&a&&n&&o?La.has(n)?("integer"===n||"number"===n?a=Number(a):"boolean"===n&&(a="true"===a),R.setValue(e,n,a,Number(o))):i(st(new Error("Incorrect stored type"))):i(st(new Error("Missing required params for set_stored_value")))}(e,a.get("name"),a.get("value"),a.get("type"),a.get("lifetime"));break;default:o(st(new Error("Unknown type of action"),{additional:{url:r}}))}}catch(t){o(st(t,{additional:{url:r}}))}else if(n)switch(n.type){case"set_variable":{const{variable_name:t,value:e}=n;if(t&&e){const r=dt.get(t);r?r.getType()===e.type?r.setValue(e.value):o(st(new Error("Trying to set value with invalid type"),{additional:{name:t,type:e.type}})):o(st(new Error("Cannot find variable"),{additional:{name:t}}))}else o(st(new Error("Incorrect set_variable action"),{additional:{name:t}}));break}case"array_insert_value":!function(t,e,r){const{variable_name:n,index:o,value:i}=r;!i||"number"!=typeof o&&void 0!==o?e(st(new Error("Incorrect array_insert_value action"),{additional:{name:n}})):Da(t,e,r,(t=>{const a=t.getValue();if("number"==typeof o&&(o<0||o>a.length))e(st(new Error(`Index out of bound for mutation ${r.type}`),{additional:{name:n,index:o,length:a.length}}));else{const e=a.slice();"number"==typeof o?e.splice(o,0,i.value):e.push(i.value),t.setValue(e)}}))}(dt,o,n);break;case"array_remove_value":!function(t,e,r){const{variable_name:n,index:o}=r;"number"==typeof o?Da(t,e,r,(t=>{const i=t.getValue();if("number"==typeof o&&(o<0||o>=i.length))e(st(new Error(`Index out of bound for mutation ${r.type}`),{additional:{name:n,index:o,length:i.length}}));else{const e=i.slice();e.splice(o,1),t.setValue(e)}})):e(st(new Error("Incorrect array_remove_value action"),{additional:{name:n}}))}(dt,o,n);break;case"copy_to_clipboard":!function(t,e){!e.content||"text"!==e.content.type&&"url"!==e.content.type||"string"!=typeof e.content.value?t(st(new Error("Incorrect action"),{additional:{action:e}})):"undefined"!=typeof navigator&&"clipboard"in navigator&&navigator.clipboard&&"writeText"in navigator.clipboard&&"function"==typeof navigator.clipboard.writeText?navigator.clipboard.writeText(e.content.value).catch((e=>{t(st(new Error("Failed to copy to the clipboard"),{additional:{originalError:String(e)}}))})):t(st(new Error("Clipboard is unavailable"),{additional:{action:e}}))}(o,n);break;case"focus_element":{const t=n.element_id&&It.get(n.element_id);t?t.focus():o(st(new Error("Incorrect focus_element action"),{additional:{elementId:n.element_id}}));break}case"clear_focus":try{document.activeElement instanceof HTMLElement&&document.activeElement.blur()}catch(t){}break;default:o(st(new Error("Unknown type of action"),{additional:{type:n.type}}))}}async function Pt(t,e={}){if(!t||!Array.isArray(t))return;const r=t.filter(Lt);for(let t=0;t<r.length;++t){let n=r[t];const o=n.url,i=n.typed;if(o){const t=xt(o);if(t)if(kt(t,et)){if(e.processUrls)if("_blank"===n.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=o)}else location.href=o}else"div-action"===t?(await Ot(n,e.componentContext),await $()):n.log_id&&(St(n),await $())}else i?await Ot(n,e.componentContext):e.node&&Array.isArray(n.menu_items)&&n.menu_items.length&&(vt={items:n.menu_items,node:e.node})}r.forEach((t=>{t.log_id&&wt("click",t)}))}function St(t){null==O||O(t)}const Vt=new Map,Tt=new Map,It=new Map,Mt=new Map;function Nt(t){if(Vt.has(t))return Vt.get(t);_t(st(new Error("Missing instance with id"),{additional:{id:t}}))}const zt=new Map;f(at,{logStat:wt,hasTemplate:function(t){return t in d},processTemplate:$t,genId:Et,genClass:function(t){return`divkit-${Et()}`},execAction:Ot,execCustomAction:St,isRunning:function(t){return it[t]},setRunning:function(t,e){it[t]=e},registerInstance:function(t,e){Vt.has(t)?_t(st(new Error("Duplicate instance id"),{additional:{id:t}})):Vt.set(t,e)},unregisterInstance:function(t){Vt.delete(t)},registerParentOf:function(t,e){Tt.set(t,e)},unregisterParentOf:function(t){Tt.delete(t)},registerTooltip:function(t,e){const r=e.id;r&&(Mt.has(r)&&_t(st(new Error("Duplicate tooltip id"),{additional:{id:r}})),Mt.set(r,{onwerNode:t,tooltip:e}))},unregisterTooltip:function(t){const e=t.id;e&&(Mt.delete(e),ht.some((t=>t.desc.id===e))&&(ht=ht.filter((t=>t.desc.id!==e))))},onTooltipClose:function(t){ht=ht.filter((e=>e.internalId!==t))},tooltipRoot:I,registerFocusable:function(t,e){It.set(t,e)},unregisterFocusable:function(t){It.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(At[r]=At[r]||0,++At[r],Ct[r])return Ct[r];const n=`${Et()}-svg-filter`;return Ct=Ma(Ma({},Ct),{},{[r]:n}),n},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;At[r]&&0==--At[r]&&(Ct=Object.keys(Ct).reduce(((t,e)=>(At[e]&&(t[e]=Ct[e]),t)),{}))},preparePrototypeVariables:function(t,e){const r=new Map,n=function(t,e,r){if(!(e in _n))throw new Error("Unsupported variable type");return new _n[e](t,r)}(t,"dict",e);return r.set(t,n),r},getStore:function(t){return zt.has(t)||function(t){zt.has(t)||zt.set(t,_a[t]())}(t),zt.get(t)},getCustomization:function(t){return null==E?void 0:E[t]},getBuiltinProtocols:function(){return et},getExtension:function(t,e){const r=A.get(t);if(r)return new r(e||{})},getExtensionContext:function(){return{variables:dt,processExpressions:t=>bt(_t,t),execAction:Ft,logError:_t}},registerTimeout:function(t){L?yt.push(t):clearTimeout(t)},typefaceProvider:S,isDesktop:H,isPointerFocus:za,customComponents:M,direction:Y,componentDevtool:void 0}),f(qt,{hasAction:()=>!1});const Ut={setState(t){throw new Error("Not implemented")},getChild(t){if(Rt&&Rt.has(t))return Rt.get(t);_t(st(new Error("Missing state block with id"),{additional:{id:t}}))}};let Rt=null;function Bt(t){if(t.type in gn){"integer"===t.type&&"number"==typeof t.value&&(t.value>Number.MAX_SAFE_INTEGER||t.value<Number.MIN_SAFE_INTEGER)&&_t(st(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=hn(t.name,t.type,t.value);ut.set(t.name,e),dt.set(t.name,e)}catch(e){_t(st(e,{additional:{name:t.name}}))}}}f(Dt,{registerInstance(t,e){Rt||(Rt=new Map),Rt.has(t)?_t(st(new Error("Duplicate state with id"),{additional:{id:t}})):Rt.set(t,e)},unregisterInstance(t){var e;null===(e=Rt)||void 0===e||e.delete(t)},runVisibilityTransition:(t,e,r,n,o)=>Promise.resolve(),registerChildWithTransitionIn:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionOut:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionChange:(t,e,r,n)=>Promise.resolve(),hasTransitionChange:t=>!1,registerChild(t){},unregisterChild(t){}});const Wt=null===(o=_)||void 0===o||null===(i=o.card)||void 0===i?void 0:i.variables;Array.isArray(Wt)&&Wt.forEach((t=>{if(t&&t.name){if(ut.has(t.name))return void _t(st(new Error("Duplicate variable"),{additional:{name:t.name}}));Bt(t)}}));const Ht=_.palette;Ht&&Ht[q].forEach((t=>{if(ut.has(t.name))_t(st(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=hn(t.name,"color",t.color);ut.set(t.name,e),dt.set(t.name,e)}catch(e){_t(st(e,{additional:{name:t.name}}))}}));for(const[t,e]of ct)dt.has(t)||dt.set(t,e);lt.subscribe((t=>{if(t&&!dt.has(t)){const e=ct.get(t);dt.set(t,e);const r=pt.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const Jt=null===(a=_)||void 0===a||null===(s=a.card)||void 0===s?void 0:s.timers;if(Jt&&"undefined"!=typeof document){const t=ft=new Fa({logError:_t,applyVars:t=>bt(_t,t),hasVariableWithType:function(t,e){const r=dt.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=dt.get(t);r?r.setValue(e):_t(st(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:Pt});Jt.forEach((e=>t.createTimer(e)))}const Yt=function t(e){const r={json:{},path:[],templateContext:{},logError(t){t.additional=t.additional||{},t.additional.path=r.path.join("/"),_t(t)},execAnyActions:(t,e={})=>Pt(t,{componentContext:r,processUrls:e.processUrls,node:e.node}),getDerivedFromVars:(t,e,n=!1)=>function(t,e,r,n=!1){if(!e)return Me(e);const o=Wa(dt,r),i=ba(e,t,R,B);return i.vars.length?K(i.vars.map((t=>o.get(t)||function(t){const e=pt.get(t)||Q(void 0);return pt.has(t)||pt.set(t,e),e}(t))).filter(mt),(()=>i.applyVars(o,n))):i.hasExpression?Me(i.applyVars(o)):Me(e)}(r.logError,t,Wa(r.variables,e),n),getJsonWithVars:(t,e,n=!1)=>bt(r.logError,t,Wa(r.variables,e),n),produceChildContext(e,n={}){const o=t(r);let i=e,a=r.templateContext;const{templateContext:s,json:l}=$t(i,a);return o.json=l,o.templateContext=s,o.origJson=e,void 0!==n.path&&o.path.push(String(n.path)),e.type&&!n.isRootState&&o.path.push(e.type),o.variables=Wa(r.variables,n.variables),n.fake&&(o.fakeElement=!0),n.isRootState&&(o.isRootState=!0),o},getVariable(t,e){const n=(r.variables||dt).get(t);if(n){const o=n.getType();if(o!==e)return void r.logError(st(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:o}}))}return n}};return e?(r.parent=e,r.path=e.path.slice(),e.fakeElement&&(r.fakeElement=!0)):(r.json={type:"root"},r.isRootState=!0),r}();let Gt;v((()=>{L=!1,Ua--,Ua||(window.removeEventListener("keydown",Ra),window.removeEventListener("pointerdown",Ba)),ft&&ft.destroy(),ht.forEach((t=>{t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=null)})),yt.forEach((t=>{clearTimeout(t)}))})),void 0===e.id&&r.id&&void 0!==b&&r.id(b),void 0===e.json&&r.json&&void 0!==_&&r.json(_),void 0===e.platform&&r.platform&&void 0!==w&&r.platform(w),void 0===e.theme&&r.theme&&void 0!==x&&r.theme(x),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==k&&r.globalVariablesController(k),void 0===e.mix&&r.mix&&void 0!==j&&r.mix(j),void 0===e.customization&&r.customization&&void 0!==E&&r.customization(E),void 0===e.builtinProtocols&&r.builtinProtocols&&void 0!==C&&r.builtinProtocols(C),void 0===e.extensions&&r.extensions&&void 0!==A&&r.extensions(A),void 0===e.onError&&r.onError&&void 0!==F&&r.onError(F),void 0===e.onStat&&r.onStat&&void 0!==D&&r.onStat(D),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==O&&r.onCustomAction(O),void 0===e.onComponent&&r.onComponent&&void 0!==P&&r.onComponent(P),void 0===e.typefaceProvider&&r.typefaceProvider&&void 0!==S&&r.typefaceProvider(S),void 0===e.fetchInit&&r.fetchInit&&void 0!==V&&r.fetchInit(V),void 0===e.tooltipRoot&&r.tooltipRoot&&void 0!==I&&r.tooltipRoot(I),void 0===e.customComponents&&r.customComponents&&void 0!==M&&r.customComponents(M),void 0===e.direction&&r.direction&&void 0!==z&&r.direction(z),void 0===e.store&&r.store&&void 0!==R&&r.store(R),void 0===e.weekStartDay&&r.weekStartDay&&void 0!==B&&r.weekStartDay(B),void 0===e.setTheme&&r.setTheme&&void 0!==G&&r.setTheme(G),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==X&&r.getDebugVariables(X),void 0===e.getDebugAllVariables&&r.getDebugAllVariables&&void 0!==Z&&r.getDebugAllVariables(Z),void 0===e.setData&&r.setData&&void 0!==tt&&r.setData(tt),void 0===e.execAction&&r.execAction&&void 0!==Ft&&r.execAction(Ft),"light"===x||"dark"===x?q=x:"system"===x?"undefined"!=typeof matchMedia?(J||(J=matchMedia("(prefers-color-scheme: dark)"),J.addListener((function(){"system"===x&&J&&(q=J.matches?"dark":"light")}))),q=J.matches?"dark":"light"):q="light":_t(st(new Error("Unsupported theme"))),q&&Ht&&Ht[q].forEach((t=>{const e=dt.get(t.name);e&&e.setValue(t.color)}));{rt=!1;const t=function(t){if(!t)return st(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return st(new Error("Missing card"));if(!e.states||!e.states.length)return st(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in Jn)return st(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return st(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return st(new Error("Missing state_id"),{additional:{index:t}})}return null}(_);t&&(rt=!0,_t(t))}var Xt,Zt;if(d=_.templates||{},null!==(Xt=_)&&void 0!==Xt&&null!==(Zt=Xt.card)&&void 0!==Zt&&Zt.variables&&Array.isArray(_.card.variables)&&_.card.variables!==Wt&&_.card.variables.forEach((t=>{t&&t.name&&!ut.has(t.name)&&Bt(t)})),p=null===(c=_)||void 0===c||null===(u=c.card)||void 0===u?void 0:u.states,p&&!rt&&!ot){const t={type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:p.map((t=>({state_id:t.state_id.toString(),div:t.div})))};Gt=Yt.produceChildContext(t,{isRootState:!0})}return h(),y(),rt||ot||!Gt?"":`<div class="${T("divkit-b023c",!0)+T(g?` ${nt}`:"",!0)+T(j?` ${j}`:"",!0)}"${W("dir",m,0)}>${U(Gn,"RootSvgFilters").$$render(t,{svgFiltersMap:Ct},{},{})} ${U(Yn,"Unknown").$$render(t,{componentContext:Gt},{},{})} ${ht?`${N(ht,(e=>`${U(Pa,"TooltipView").$$render(t,{ownerNode:e.ownerNode,data:e.desc,internalId:e.internalId,parentComponentContext:Gt},{},{})}`))}`:""} ${vt?`${U(Va,"Menu").$$render(t,{ownerNode:vt.node,items:vt.items,parentComponentContext:Gt},{},{})}`:""}</div>`})),qa=Ha;function Ja(t){return qa.render(t).html}var Ya=e.XQ,Ga=e.rz,Xa=e.XX;export{Ya as createGlobalVariablesController,Ga as createVariable,Xa as render};
2
2
  //# sourceMappingURL=server.mjs.map