@divkitframework/divkit 29.7.0 → 29.8.0

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.
package/dist/server.js CHANGED
@@ -1,2 +1,2 @@
1
- (()=>{"use strict";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),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{createGlobalVariablesController:()=>So,createVariable:()=>Hr,render:()=>Wo}),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 i{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;i.entries.set(r.target,r),null===(e=this._listeners.get(r.target))||void 0===e||e(r)}}))}}function o(){}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 o}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)}i.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),j(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 j(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 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(),i=e.slice(t+1).trim();n&&(r[n]=i)}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:A.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 i="",o=0;for(;n.test(r);){const t=n.lastIndex-1,e=r[t];i+=r.substring(o,t)+("&"===e?"&amp;":'"'===e?"&quot;":"&lt;"),o=t+1}return i+r.substring(o)}function M(t){return"string"==typeof t||t&&"object"==typeof t?I(t,!0):t}function T(t){const e={};for(const r in t)e[r]=M(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 L(t){function e(e,r,n,i,o){const a=u;d({$$:{on_destroy:B,context:new Map(o||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const s=t(e,r,n,i);return d(a),s}return{render:(t={},{$$slots:r={},context:n=new Map}={})=>{B=[];const i={title:"",head:"",css:new Set},o=e(i,t,{},r,n);return s(B),{html:o,css:{code:Array.from(i.css).map((t=>t.code)).join("\n"),map:null},head:i.title+i.head}},$$render:e}}function W(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}: ${M(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){Z(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 Z(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 Y(t,e,r,n){var i;const o=null===(i=r[t])||void 0===i?void 0:i.type;if(e="Boolean"===o&&"boolean"!=typeof e?null!=e:e,!n||!r[t])return e;if("toAttribute"===n)switch(o){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(o){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(),Z(this,"$$ctor",void 0),Z(this,"$$s",void 0),Z(this,"$$c",void 0),Z(this,"$$cn",!1),Z(this,"$$d",{}),Z(this,"$$r",!1),Z(this,"$$p_d",{}),Z(this,"$$l",{}),Z(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 i of this.$$s)i in r&&(e[i]=[t(i)]);for(const o of this.attributes){const a=this.$$g_p(o.name);a in this.$$d||(this.$$d[a]=Y(a,o.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=Y(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]=Y(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 X=[];function Q(t,e=o){let r;const n=new Set;function i(e){if(o=e,((i=t)!=i?o==o:i!==o||i&&"object"==typeof i||"function"==typeof i)&&(t=e,r)){const e=!X.length;for(const e of n)e[1](),X.push(e,t);if(e){for(let t=0;t<X.length;t+=2)X[t][0](X[t+1]);X.length=0}}var i,o}function a(e){i(e(t))}return{set:i,update:a,subscribe:function(s,l=o){const c=[s,l];return n.add(c),1===n.size&&(r=e(i,a)||o),s(t),()=>{n.delete(c),0===n.size&&r&&(r(),r=null)}}}}function K(t,e,r){const n=!Array.isArray(t),i=n?[t]:t;if(!i.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=o;const v=()=>{if(d)return;p();const i=e(n?u[0]:u,t,r);a?t(i):p="function"==typeof i?i:o},g=i.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",it="divkit-aa145",ot="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,i,o]=e,a=2===n.length?n:n+n,s=2===i.length?i:i+i,l=2===o.length?o:o+o,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,i]=e,o=2===r.length?r:r+r,a=2===n.length?n:n+n,s=2===i.length?i:i+i;return{a:255,r:parseInt(o,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 i;n&&"object"==typeof n&&"type"in n&&void 0!==n.value&&("fixed"===n.type?i=pt(n.value):"relative"===n.type&&(i=bt[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${i||"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){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}function kt(t,e){return e.has(t)}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 jt(t,e){e&&t.push(e)}function At(t,e,r){const n=[];jt(n,e[t]);for(const i in r)if(r.hasOwnProperty(i)){const o=r[i];o&&jt(n,e[`${t}_${i}`+("string"==typeof o?`_${o}`:"")])}return n.join(" ")}const Ft=Symbol("state");function Vt(t,e){var r,n;const i=t.top||0,o=(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===i&&0===o&&0===a&&0===s?"":dt(i)+" "+dt(o)+" "+dt(a)+" "+dt(s)}function Dt(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!Number.isNaN(e)}function St(t){return Dt(t)&&t>=0}function Ot(t,e,r){var n,i;if(!t)return r;const o=[t.top,null!==(n="ltr"===e?t.end:t.start)&&void 0!==n?n:t.right,t.bottom,null!==(i="ltr"===e?t.start:t.end)&&void 0!==i?i:t.left];for(let t=0;t<o.length;++t)if(o[t]&&!St(o[t]))return r;return Vt(t,e)}function Pt(t,e){const r=Number(t);return Number.isNaN(r)||r<0?e:r}const It=Object.prototype.hasOwnProperty;function Mt(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 i=r[n];if(!It.call(e,i)||!Mt(t[i],e[i]))return!1}return!0}function Tt(t,e){return Mt(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]]&&!St(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 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:i}=e,{id:o=""}=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((()=>{o&&!y&&b.unregisterFocusable(o)})),void 0===e.componentContext&&r.componentContext&&void 0!==i&&r.componentContext(i),void 0===e.id&&r.id&&void 0!==o&&r.id(o),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="",i.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))||i.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:M(x)},{target:M($)},{style:M(u)},{class:I(c,!0)+" "+I(m?tt:et,!0)+" "+I(null!=l&&l.length?ot:"",!0)},T(d)],{})}${W("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?ot:"",!0)},{style:M(u)},{role:M(k?"button":null)},{tabindex:M(k?0:null)},T(d)],{})}${W("this",w,0)}>${n.default?n.default({}):""}</span>`})),Gt=Jt,Zt="divkit-b921d";function Yt(t){return Dt(t)&&t>0}function Xt(t,e){return t.map((t=>{if(t)if("blur"===t.type){if(Yt(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 Qt=L(((t,e,r,n)=>{let i,{direction:o}=e,{componentContext:a}=e,{background:s=[]}=e,{radius:l=""}=e;return f(at),void 0===e.direction&&r.direction&&void 0!==o&&r.direction(o),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),i=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"===o&&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(i,(t=>t.image_url?`<img${W("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${W("class",Zt,0)}${W("style",ut(t.style),0)}>`:`<span${W("class",Zt,0)}${W("style",ut(t.style),0)}></span>`))}</span>`})),Kt=Qt,te={left:"start",center:"center",right:"end",start:"start",end:"end"},ee={left:"end",center:"center",right:"start",start:"start",end:"end"},re={top:"start",center:"center",bottom:"end",baseline:"baseline"},ne=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,x,k,E,C,j,A,F,V,D,S,O,P,I,M,T,N,z,B,U,L,H,q,J,G,Z,Y,X,Q,tt,et,rt,nt,it,ot=o,lt=o,vt=o,ft=o,ht=o,bt=o,_t=o,wt=o,$t=o,jt=o,Dt=o,It=o,Ht=o,qt=o,Jt=o,Zt=o,Yt=o,Xt=o,{componentContext:Qt}=e,{cls:ne=""}=e,{style:ie}=e,{layoutParams:oe={}}=e,{customDescription:ae=!1}=e,{customPaddings:se=!1}=e,{customActions:le=""}=e,{additionalPaddings:ce=null}=e,{heightByAspect:ue=!1}=e,{parentOf:de}=e,{parentOfSimpleMode:pe}=e,{replaceItems:ve}=e,{hasInnerFocusable:ge=!1}=e;const fe=f(at),he=f(Ft);let me,ye;I=l(fe.isPointerFocus,(t=>P=t)),et=l(fe.direction,(t=>tt=t));let be,_e,we,$e,xe,ke,Ee,Ce,je,Ae,Fe,Ve,De,Se,Oe,Pe,Ie,Me,Te,Ne,ze=null,Re=[],Be={},Ue={},Le=!1,We=1,He="transparent",qe=0,Je={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},Ge="",Ze=null,Ye="",Xe={},Qe=0,Ke=0,tr=0,er=!1,rr=!1,nr={},ir=0,or=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(de)||!ve)return;if(pe&&1!==(Array.isArray(e)&&e.length||0))return;const r=de.findIndex((e=>(null==e?void 0:e.id)===t)),n=de.slice();n.splice(r,1,...e||[]),de=n,ve(n)}function jr(){if(ze&&me){const t=fe.getExtensionContext();ze.forEach((e=>{var r;null===(r=e.unmountView)||void 0===r||r.call(e,me,t)})),ze=null}}function Ar(){Qt.json.focus&&(P||(kr=!0),Qt.execAnyActions(hr))}function Fr(){Qt.json.focus&&(kr=!1,Qt.execAnyActions(mr))}v((()=>{var t;Re.forEach((t=>{fe.unregisterParentOf(t)})),Re=[],null===(t=Qt.json.tooltips)||void 0===t||t.forEach((t=>{fe.unregisterTooltip(t)})),jr()})),void 0===e.componentContext&&r.componentContext&&void 0!==Qt&&r.componentContext(Qt),void 0===e.cls&&r.cls&&void 0!==ne&&r.cls(ne),void 0===e.style&&r.style&&void 0!==ie&&r.style(ie),void 0===e.layoutParams&&r.layoutParams&&void 0!==oe&&r.layoutParams(oe),void 0===e.customDescription&&r.customDescription&&void 0!==ae&&r.customDescription(ae),void 0===e.customPaddings&&r.customPaddings&&void 0!==se&&r.customPaddings(se),void 0===e.customActions&&r.customActions&&void 0!==le&&r.customActions(le),void 0===e.additionalPaddings&&r.additionalPaddings&&void 0!==ce&&r.additionalPaddings(ce),void 0===e.heightByAspect&&r.heightByAspect&&void 0!==ue&&r.heightByAspect(ue),void 0===e.parentOf&&r.parentOf&&void 0!==de&&r.parentOf(de),void 0===e.parentOfSimpleMode&&r.parentOfSimpleMode&&void 0!==pe&&r.parentOfSimpleMode(pe),void 0===e.replaceItems&&r.replaceItems&&void 0!==ve&&r.replaceItems(ve),void 0===e.hasInnerFocusable&&r.hasInnerFocusable&&void 0!==ge&&r.hasInnerFocusable(ge),Qt.json&&oe&&(Ze=null,Ye="",cr=1,_r=!1,wr="visible",$r=0,xr=0,Me=void 0,Te=void 0,ur=Qt.fakeElement?[]:Qt.json.transition_triggers||["state_change","visibility_change"],dr=Boolean(-1!==ur.indexOf("state_change")&&Qt.json.id),pr=Boolean(-1!==ur.indexOf("visibility_change")&&Qt.json.id)),i=Qt.getDerivedFromVars(Qt.json.focus),ft(),ft=l(i,(t=>z=t)),a=Qt.getDerivedFromVars(Qt.json.border),Xt(),Xt=l(a,(t=>it=t)),s=Qt.getDerivedFromVars(Qt.json.paddings),Yt(),Yt=l(s,(t=>nt=t)),c=Qt.getDerivedFromVars(Qt.json.margins),Jt(),Jt=l(c,(t=>Q=t)),u=Qt.getDerivedFromVars(Qt.json.width),Ht(),Ht=l(u,(t=>Y=t)),d=Qt.getDerivedFromVars(Qt.json.alignment_horizontal),Zt(),Zt=l(d,(t=>rt=t)),p=Qt.getDerivedFromVars(Qt.json.height),It(),It=l(p,(t=>Z=t)),g=Qt.getDerivedFromVars(Qt.json.alignment_vertical),qt(),qt=l(g,(t=>X=t)),h=Qt.getDerivedFromVars(Qt.json.alpha),Dt(),Dt=l(h,(t=>G=t)),m=Qt.getDerivedFromVars(Qt.json.accessibility),jt(),jt=l(m,(t=>J=t)),y=Qt.getDerivedFromVars(Qt.json.background),$t(),$t=l(y,(t=>q=t)),b=Qt.getDerivedFromVars(Qt.json.action),_t(),_t=l(b,(t=>L=t)),_=Qt.getDerivedFromVars(Qt.json.actions),wt(),wt=l(_,(t=>H=t)),w=Qt.getDerivedFromVars(Qt.json.doubletap_actions),bt(),bt=l(w,(t=>U=t)),x=Qt.getDerivedFromVars(Qt.json.longtap_actions),ht(),ht=l(x,(t=>B=t)),k=Qt.getDerivedFromVars(Qt.json.action_animation),vt(),vt=l(k,(t=>N=t)),E=Qt.getDerivedFromVars(Qt.json.visibility),lt(),lt=l(E,(t=>T=t)),C=Qt.getDerivedFromVars(Qt.json.transform),ot(),ot=l(C,(t=>M=t)),Re.forEach((t=>{fe.unregisterParentOf(t)})),Re=[],de&&de.forEach((t=>{(null==t?void 0:t.id)&&(Re.push(t.id),fe.registerParentOf(t.id,{replaceWith:Cr,isSingleMode:Boolean(pe)}))}));{const t=kr&&(null==z?void 0:z.border)?z.border:it;let e={},r={},n=!1,i="";if(t){if(t.has_shadow){const r=t.shadow;e["box-shadow"]=r?function(t){var e,r,n,i,o,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===(i=n.y)||void 0===i?void 0:i.value)||0)+" "+dt(null!==(o=t.blur)&&void 0!==o?o: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,We=Pt(t.stroke.width,We),He=gt(t.stroke.color,1,He),r.border=`${dt(We)} 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]&&!St(r[t]))return e;return t}(t.corners_radius,Je),r["border-radius"]=e["border-radius"]=Ut(Je)):t.corner_radius&&(qe=Pt(t.corner_radius,qe),Je={"top-left":qe,"top-right":qe,"bottom-right":qe,"bottom-left":qe},r["border-radius"]=e["border-radius"]=dt(qe)),n&&We&&(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)+We/2})),i=Ut(t)}}Be=Tt(e,Be),Ue=Tt(r,Ue),Le=n,Ge=i}Ze=Bt(nt&&!se?nt:void 0,Ze),j=Vt(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 i=t[n];i&&(r[n]=i);const o=e[n];o&&(r[n]=(r[n]||0)+o)})),r}(Ze,ce),tt),Ye=Ot(Q,tt,Ye);{let t,e,r,n,i={},o=0,a=0,s=!1,l=!1;const c=null==Y?void 0:Y.type;if("fixed"===c)Qe=Pt(null==Y?void 0:Y.value,Qe),e=dt(Qe);else if("wrap_content"===c||("match_parent"===c||!c)&&oe.parentHorizontalWrapContent){if(t="content",("wrap_content"===c&&(null==Y?void 0:Y.constrained)||("match_parent"===c||!c)&&oe.parentHorizontalWrapContent)&&(i["width-constrained"]=!0,"horizontal"===oe.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Y;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||Qt.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,Qt.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==Q?void 0:Q.left)||0)+((null==Q?void 0:Q.right)||0))})`:"horizontal"===oe.parentContainerOrientation&&(o=Y&&"weight"in Y&&Y.weight||1,oe.parentContainerWrap&&(s=!0));if("parent"===t)i["halign-self"]="stretch";else{const t=rt;i["halign-self"]="left"===t||"center"===t||"right"===t||"start"===t||"end"===t?("ltr"===tt?te:ee)[t]:oe.parentHAlign||"start"}t&&(i.width=t),be=e,_e=r,we=n,Ke=o,tr=a,Xe=Tt(i,Xe),er=s,rr=l}{let t,e,r,n,i={},o=0,a=0,s=!1,l=!1;const c=null==Z?void 0:Z.type;if(ue);else if("fixed"===c)ir=Pt(null==Z?void 0:Z.value,ir),e=dt(ir);else if("match_parent"!==c||oe.parentVerticalWrapContent){if(t="content",("wrap_content"===c&&(null==Z?void 0:Z.constrained)||"match_parent"===c&&oe.parentVerticalWrapContent)&&(i["height-constrained"]=!0,"vertical"===oe.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Z;(null==t?void 0:t.min_size)&&St(t.min_size.value)&&(r=dt(t.min_size.value)),(null==t?void 0:t.max_size)&&St(t.max_size.value)&&(n=dt(t.max_size.value))}"match_parent"===c&&Qt.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,Qt.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==Q?void 0:Q.top)||0)+((null==Q?void 0:Q.bottom)||0))})`:"vertical"===oe.parentContainerOrientation&&(o=(null==Z?void 0:Z.weight)||1,oe.parentContainerWrap&&(s=!0));if("parent"===t)i["valign-self"]="stretch";else{const t=X;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===oe.parentContainerOrientation?i["valign-self"]=re[t]:i["valign-self"]=oe.parentVAlign||"start"}t&&(i.height=t),$e=e,xe=r,ke=n,or=o,ar=a,nr=Tt(i,nr),sr=s,lr=l}var Vr,Dr,Sr;if(A=!!oe.overlapParent||void 0,F=oe.overlapParent&&(!Y||"match_parent"===Y.type)&&!oe.parentHorizontalWrapContent&&"match_parent"===(null==Z?void 0:Z.type)&&!oe.parentVerticalWrapContent,V=oe.gridArea?`${oe.gridArea.y+1}/${oe.gridArea.x+1}/span ${oe.gridArea.rowSpan}/span ${oe.gridArea.colSpan}`:void 0,Dr=cr,cr=!St(Vr=G)||void 0===Vr||Vr>1?Dr:Number(Vr),Ee=1===cr?void 0:cr,ye=void 0,J&&!ae&&J.description&&(ye={},ye["aria-label"]=J.description),Ce=kr&&(null==z?void 0:z.background)?z.background:q,je={},Ae=!1,Array.isArray(Ce)&&(Ae=Ce.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(Ge),!Ae)){const t=yt(Ce);je["background-color"]=t.color,je["background-image"]=t.image,je["background-size"]=t.size,je["background-position"]=t.position,je["background-repeat"]="no-repeat"}Fe=void 0,dr&&Qt.json.transition_in&&fe.isRunning("stateChange")&&(Fe=!0),De=void 0,dr&&Qt.json.transition_change&&fe.isRunning("stateChange")&&he.hasTransitionChange(Qt.json.id)&&(De=!0);{let t=H||L&&[L]||[],e=U||[],r=B||[],n=(null==z?void 0:z.on_focus)||[],i=(null==z?void 0:z.on_blur)||[];Qt.fakeElement?(t=[],e=[],r=[],n=[],i=[]):(Array.isArray(t)||(t=[],Qt.logError(st(new Error("Actions should be array")))),Array.isArray(e)||(e=[],Qt.logError(st(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],Qt.logError(st(new Error("LongTapActions should be array")))),Array.isArray(n)||(n=[],Qt.logError(st(new Error("FocusActions should be array")))),Array.isArray(i)||(i=[],Qt.logError(st(new Error("BlurActions should be array"))))),(t.length||e.length||r.length)&&le&&(t=[],e=[],r=[],Qt.logError(st(new Error(`Cannot use action on component "${le}"`)))),vr=t.filter(Lt),gr=e.filter(Lt),fr=r.filter(Lt),hr=n.filter(Lt),mr=i.filter(Lt)}N&&(yr=Rt(N),br=yr.map((function(t){const e=zt(t.start_value,1),r=zt(t.end_value,1),n=Pt(t.start_delay,0),i="undefined"!=typeof matchMedia&&(Wt||(Wt=window.matchMedia("(prefers-reduced-motion)")),Wt.matches)?0:Pt(t.duration,300),o=Nt(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return Se=e,Oe=r,`opacity ${i}ms ${o} ${n}ms`;case"scale":return Pe=e,Ie=r,`transform ${i}ms ${o} ${n}ms`;case"native":case"no_animation":return"";default:return Qt.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?Qt.json.transition_in:Qt.json.transition_out;pr&&r&&(await $(),"in"===e&&(Ve=!0),he.runVisibilityTransition(Object.assign(Object.assign({},Qt.json),{visibility:"visible"}),Qt,r,me,e).then((()=>{"in"===e&&(Ve=!1)})).catch((t=>{throw"in"===e&&(Ve=!1),t})))}(e)),_r||(_r=!0)}if(Qt.json&&me&&!Mt(Qt.json.extensions,Ne)){let t=Ne=Qt.json.extensions;$().then((()=>{if(t===Ne&&me&&(jr(),Array.isArray(Qt.json.extensions))){const t=fe.getExtensionContext();ze=Qt.json.extensions.map((e=>{var r;const n=e.id;if(!n)return;const i=fe.getExtension(n,e.params);return i&&(null===(r=i.mountView)||void 0===r||r.call(i,me,t)),i})).filter(mt)}}))}if(Qt&&Er&&Er.update(Qt),D=Object.assign(Object.assign(Object.assign({},Xe),nr),{"parent-overlap":A,"parent-overlap-absolute":F,"scroll-snap":oe.scrollSnap,"hide-on-transition-in":Fe||Ve||De,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&&Qt.json.focus)}),M&&void 0!==M.rotation){const t=M.pivot_x||{type:"pivot-percentage",value:50};$r=zt(t.value,$r);const e="pivot-fixed"===t.type?dt($r):`${$r}%`,r=M.pivot_y||{type:"pivot-percentage",value:50};xr=zt(r.value,xr),Me=`${e} ${"pivot-fixed"===r.type?dt(xr):`${xr}%`}`,Te=`rotate(${M.rotation}deg)`}return S=er||sr?"100%":Ke||or?0:void 0,O=Object.assign(Object.assign(Object.assign(Object.assign({},ie),je),Be),{width:be,"min-width":_e,"max-width":we,height:$e,"min-height":xe,"max-height":ke||(null==ie?void 0:ie["max-height"]),"grid-area":V,padding:j,margin:Ye,opacity:Ee,transition:br,"transform-origin":Me,transform:Te,"flex-grow":Ke||or||void 0,"flex-shrink":tr||ar?1:void 0,"flex-basis":S,"--divkit-animation-opacity-start":Se,"--divkit-animation-opacity-end":Oe,"--divkit-animation-scale-start":Pe,"--divkit-animation-scale-end":Ie}),I(),ot(),lt(),vt(),ft(),ht(),bt(),_t(),wt(),$t(),jt(),Dt(),It(),Ht(),qt(),Jt(),et(),Zt(),Yt(),Xt(),rr||lr?"":`${R(Gt,"Actionable").$$render(t,{componentContext:Qt,id:Qt.json.id,use:function(t){var e;me=t,dr&&Qt.json.transition_in&&he.registerChildWithTransitionIn(Qt.json,Qt,Qt.json.transition_in,t).then((()=>{Fe=!1})).catch((t=>{throw Fe=!1,t})),dr&&Qt.json.transition_out&&he.registerChildWithTransitionOut(Qt.json,Qt,Qt.json.transition_out,t),dr&&Qt.json.transition_change&&he.registerChildWithTransitionChange(Qt.json,Qt,Qt.json.transition_change,t).then((()=>{De=!1})).catch((t=>{throw De=!1,t}));const r=Qt.fakeElement?[]:Qt.json.visibility_actions||Qt.json.visibility_action&&[Qt.json.visibility_action],n=Qt.fakeElement?[]:Qt.json.disappear_actions;let i;(Array.isArray(r)&&r.length||Array.isArray(n)&&n.length)&&(i=function(t,{visibilityActions:e,disappearActions:r,rootCtx:n,componentContext:i}){const o=[];e&&e.forEach((t=>{o.push({type:"visibility",index:o.length,action:t,visible:!1,count:0,finished:!1})})),r&&r.forEach((t=>{o.push({type:"disappear",index:o.length,action:t,visible:!1,count:0,finished:!1})}));const a=o.map(((t,e)=>{const r="visibility"===t.type;return i.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(),o.forEach((t=>{t.timer&&clearTimeout(t.timer)}))},c=K(a,(t=>t)).subscribe((e=>{const r=e.filter(Ct),a={};r.forEach((t=>{a[t.index]=t})),l();const c=[...new Set(r.map((t=>{const e="visibility"===o[t.index].type;return Et(e,t.visibility_percentage,e?50:0)/100})))];c.length&&(s=new IntersectionObserver((t=>{t.forEach((t=>{r.forEach((e=>{const r=o[e.index],a="visibility"===r.type,s=Et(a,e.visibility_percentage,a?50:0);let l;l=0===s?t.intersectionRatio>=1e-12:t.intersectionRatio>=s/100;const c=a?!r.visible&&l:r.visible&&!l,u=a?!l:l;c?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);const o=i.getJsonWithVars(r.action),s=o.url,l=o.typed;if(s){const t=xt(s);t&&!kt(t,n.getBuiltinProtocols())&&("div-action"===t?n.execAction(o):o.log_id&&n.execCustomAction(o))}else l&&n.execAction(o);n.logStat(a?"visible":"disappear",o)}),e.visibility_duration||800)):u&&r.timer&&clearTimeout(r.timer),r.visible=l}))}))}),{threshold:c}),s.observe(t))}));return{destroy(){l(),c()}}}(t,{visibilityActions:r,disappearActions:n,rootCtx:fe,componentContext:Qt}));const o=Qt.json.id;return o&&he.registerChild(o),null===(e=Qt.json.tooltips)||void 0===e||e.forEach((e=>{fe.registerTooltip(t,e)})),{destroy(){o&&he.unregisterChild(o),i&&i.destroy(),Er&&Er.destroy()}}},cls:ne+" "+At("outer",ct,D),style:ut(O),actions:vr,doubleTapActions:gr,longTapActions:fr,attrs:ye,hasInnerFocusable:ge,isNativeActionAnimation:!yr.length||(Sr=yr,Sr.some((t=>"native"===t.name)))},{},{default:()=>` ${Ae?`${R(Kt,"OuterBackground").$$render(t,{componentContext:Qt,direction:tt,background:Ce,radius:Ge},{},{})}`:""}${n.default?n.default({focusHandler:Ar,blurHandler:Fr,hasCustomFocus:kr}):""}${Le?`<span${W("class",ct.outer__border,0)}${W("style",ut(Ue),0)}></span>`:""}`})}`})),ie=ne,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 ae(t,e){const r=Number(t);return Number.isNaN(r)||r<=0?e:r}function se(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function le(t,e){return se(t)||e}const ce=L(((t,e,r,n)=>{let i,o,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="",j=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="",j=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 $=ae(h.font_size,$),Yt(h.line_height)&&(x=Number(h.line_height)/$),St(h.letter_spacing)&&(k=dt(h.letter_spacing)),_=le(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),i=h.top_offset?dt(h.top_offset):"",o=h.background?yt([h.background]):null,j=(null===(u=h.border)||void 0===u?void 0:u.stroke)&&h.border.stroke.color&&"transparent"!==gt(h.border.stroke.color)&&Yt(h.border.stroke.width)?{color:h.border.stroke.color,width:h.border.stroke.width}:null,a=ae(null===(d=h.border)||void 0===d?void 0:d.corner_radius,0),s=h.text_shadow?function(t,e){var r,n,i,o,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===(i=n.x)||void 0===i?void 0:i.value)||0)/e)+" "+dt(10*((null===(o=t.offset)||void 0===o||null===(a=o.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==o?void 0:o.color)||void 0,"box-shadow":j?`inset 0 0 0 ${dt(j.width)} ${j.color}`:void 0,"border-radius":a?dt(a):void 0},`${i?`<span${W("class",oe["text-range__top-offset"],0)}${q({"margin-top":i})}></span>`:""}${R(Gt,"Actionable").$$render(t,{componentContext:p,cls:At("text-range",oe,l),actions:y,style:ut(c)},{},{default:()=>`${I(v)}`})}`})),ue=ce;function de(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 pe(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?"top"===t?"start":"bottom"===t?"end":t:e}function ve(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}function ge(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const fe=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P,I,M,T,z,B,U,L,H,q,J,G,Z,Y=o,X=o,Q=o,K=o,tt=o,et=o,nt=o,it=o,ot=o,st=o,ct=o,pt=o,vt=o,ft=o,ht=o,{componentContext:mt}=e,{layoutParams:bt}=e;const _t=f(at);L=l(_t.direction,(t=>U=t));let wt,$t="",xt=12,kt=1.25,Et=!1,Ct="",jt="",Ft=!1,Vt="start",Dt="start",St="",Ot="",Pt="",It=!1,Mt=[],Tt=[];var Nt;v((()=>{Tt.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,jt="",Ft=!1,Vt="start",Dt="start",St="",Pt="",It=!1),i=mt.getDerivedFromVars(mt.json.text),ht(),ht=l(i,(t=>Z=t)),a=mt.getDerivedFromVars(mt.json.ranges),X(),X=l(a,(t=>D=t)),s=mt.getDerivedFromVars(mt.json.images),Y(),Y=l(s,(t=>V=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}),Q(),Q=l(c,(t=>S=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),ot(),ot=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),it(),it=l(m,(t=>T=t)),y=mt.getDerivedFromVars(mt.json.focused_text_color),nt(),nt=l(y,(t=>M=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=Z,$t=String(null!=Nt?Nt:""),xt=ae(G,xt);{const t=J;Yt(t)?(kt=Number(t)/xt,Et=!0):Et=!1}x=1===z;{let t,e="",r="",n=!1;if(z&&z>1){const i=Number(z);e=i*kt+"em",t=i,r=i,n=!0}else q&&1!==z&&(n=!0);Ct=e,wt=t,jt=r,Ft=n}Vt=de(H,U,Vt),Dt=pe(B,Dt),k=!D||$t&&1===D.length&&D[0]&&0===D[0].start&&"number"==typeof D[0].end&&D[0].end>=$t.length,E=Boolean(T)!==Boolean(D&&D[0]&&D[0].text_color);{let t="";z&&k&&E&&(t=gt(T||D&&D[0]&&D[0].text_color,1,St)),St=t}Ot=gt(M,1,Ot),C="none"===I?"none":"";{let t="";if(P){const e=yt([P]);e.image&&(t=e.image)}Pt=t}return It=ve(O,It),function(t,e,r){let n=[];if(Tt.forEach((([t,e])=>{_t.removeSvgFilter(t,e)})),Tt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(Mt=[]);const i=t;let o=e||[{start:0,end:i.length}],a=r||[],s=0,l=[],c=[];o.forEach((t=>{void 0!==t.start&&void 0!==t.end&&(c.push({index:t.start,range:t,type:"rangeStart",isStart:!0}),c.push({index:t.end,range:t,type:"rangeEnd"}))})),a.forEach(((t,e)=>{void 0!==t.start&&t.url&&t.start<=i.length&&c.push({index:t.start,image:t,type:"image",arrayIndex:e})})),c.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)),c.forEach((t=>{var e,r;let o="image"===t.type?null:t.range,a=t.index;if(a>s){let o=Object.assign(Object.assign({},S),...l);n.push({text:i.substring(s,a),textStyles:o,actions:"rangeEnd"===t.type&&(null===(r=null===(e=t.range)||void 0===e?void 0:e.actions)||void 0===r?void 0:r.filter(Lt))||void 0})}if("rangeStart"===t.type&&o)l.push(o);else if("rangeEnd"===t.type)l=l.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},S),...l),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 o={"font-size":dt(10*(Number(e.font_size)||12)/xt)};let a="";const s=t.image.tint_color,c=ge(t.image.tint_mode,"source_in");if(s){const e=gt(t.image.tint_color);a=_t.addSvgFilter(e,c),Tt.push([e,c])}n.push({image:{url:t.image.url,width:r,height:i,wrapperStyle:o,svgFilterId:a,preloadRequired:Boolean(t.image.preload_required)}})}s=a})),s<i.length&&n.push({text:i.substring(s),textStyles:Object.assign({},S)}),Mt=n}($t,D,V),j={singleline:x,multiline:Ft,halign:Vt,valign:Dt,truncate:C,"has-focus-color":Boolean(Ot)},A={gradient:Boolean(Pt)},F={"font-size":dt(xt),"line-height":kt,"max-height":Ct,"-webkit-line-clamp":jt,color:St,"background-image":Pt,"--divkit-text-focus-color":Ot},Y(),X(),Q(),K(),tt(),et(),nt(),it(),ot(),st(),L(),ct(),pt(),vt(),ft(),ht(),`${R(ie,"Outer").$$render(t,{cls:At("text",lt,j)+" "+(It?"":rt),componentContext:mt,layoutParams:bt},{},{default:()=>`<span${W("class",At("text__inner",lt,A),0)}${W("style",ut(F),0)}>${Mt.length?`${N(Mt,(e=>"text"in e?e.text?`${R(ue,"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":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(ue,"TextRangeView").$$render(t,{componentContext:mt,text:$t,rootFontSize:xt,textStyles:S,singleline:x},{},{})}`}</span>`})}`})),he=fe,me={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 ye(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 be(t,e,r){const n=((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);null!=e&&e.show_at_start&&(r?t.top=e.style.height+i:t.left=e.style.width+n),null!=e&&e.show_at_end&&(r?t.bottom=e.style.height+i:t.right=e.style.width+n)}function _e(t,e,r){let n;const i=((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),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+i:0]:[null!=e&&e.show_between?e.style.height+o:0,null!=r&&r.show_between?r.style.width+a:0],n.map(dt).join(" ")}function we(t){var e;const r=null===(e=t.width)||void 0===e?void 0:e.type;return"wrap_content"===r||"fixed"===r}function $e(t){var e;return"match_parent"!==(null===(e=t.height)||void 0===e?void 0:e.type)}function xe(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:Pt(null===(o=(i=t.shape).item_width)||void 0===o?void 0:o.value,10),height:Pt(null===(a=i.item_height)||void 0===a?void 0:a.value,10),radius:Pt(null===(s=i.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*Pt(null===(e=t.radius)||void 0===e?void 0:e.value,10);return{width:r,height:r,radius:r}}(t.shape)}var i,o,a,s;return function(t,e,r){var n;const i={},o=e.stroke||(null==r?void 0:r.stroke),a=null!=o&&o.color?gt(o.color):"",s=null!=o&&o.width?Number(null!==(n=o.width)&&void 0!==n?n:1):"";i.width=t.width,i.height=t.height,i.borderRadius=t.radius;const l=e.background_color||(null==r?void 0:r.color);return i.background=gt(l),a&&s&&(i.boxShadow=`inset 0 0 0 ${dt(s)} ${a}`),i}(n,t.shape,{color:t.color,stroke:t.stroke})}let ke;function Ee(){if("undefined"==typeof document&&(ke=!0),void 0!==ke)return ke;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),ke=1===t.scrollHeight,document.body.removeChild(t),ke}const Ce="divkit-a7719",je="divkit-f6e9a";function Ae(t,e,r,n,i,o){const a=e.margins.left,s=e.margins.right,l=e.margins.top,c=e.margins.bottom;o?t.push({top:r.bottom+l,left:i.left+a,width:Math.max(0,i.right-i.left-a-s),height:n.top-r.bottom-l-c,style:e.style}):t.push({top:i.top+l,left:r.right+a,width:n.left-r.right-a-s,height:Math.max(0,i.bottom-i.top-l-c),style:e.style})}function Fe(t,e,r,n,i,o){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"===i||"space-evenly"===i?(s=o.left-e.style.width,l=o.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 i=0;i<r.length-1;++i)Ae(t,e,r[i],r[i+1],a,n);if(null==e?void 0:e.show_at_end){const s=r[r.length-1];let l,c;"space-around"===i||"space-evenly"===i?(l=o.bottom+e.style.height,c=o.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 Ve=L(((t,e,r,n)=>{let i,{orientation:o}=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,i=!1;return function(){const e=Date.now();return!n||Math.abs(e-n)>10?(n=e,r=t.apply(this,arguments)):(i||(i=!0,setTimeout((()=>{i=!1,r=t.apply(this,arguments)}),10)),r)}}((function(){if(!i)return;const t=i.getBoundingClientRect(),e=window.getComputedStyle(i),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=[...i.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(),i=r.left,a=r.right,s=r.bottom;for(;n.length;){let e=n[0],r=e.getBoundingClientRect();if("vertical"===o){if(r.top<s)break}else if("ltr"===u?r.left<a:r.right>i)break;a=Math.max(a,r.right),i=Math.min(i,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"===o&&e.reverse(),a&&Fe(g,a,e,"vertical"===o,"vertical"===o?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"===o&&v.reverse(),s&&Fe(g,s,v,"horizontal"===o,"vertical"===o?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!==o&&r.orientation(o),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),i=null,(f&&i||h||m)&&(h&&(h.disconnect(),h=null),m&&(m.disconnect(),m=null),f&&i&&("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(je))&&!(null==r?void 0:r.contains(Ce))}))&&d()})),h.observe(i,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(m=new ResizeObserver(d),m.observe(i)))),f&&i&&d(),` <div${W("class",Ce,0)}${W("this",p,0)}>${N(g,(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",je,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>`})),De={start:"start",center:"center",end:"end","space-between":"start","space-around":"start","space-evenly":"start"},Se={start:"start",center:"center",end:"end",baseline:"baseline","space-between":"start","space-around":"start","space-evenly":"start"},Oe=["rounded_rectangle","circle"],Pe=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,v,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P,I,M,T,z,B=o,U=o,L=o,W=o,H=o,q=o,J=o,G=o,Z=o,Y=o,X=o,Q=o;var tt,et,rt,nt,it,ot,st;let{componentContext:lt}=e,{layoutParams:ct}=e;const ut=f(at);let dt;S=l(ut.direction,(t=>D=t));let pt,vt="vertical",gt="start",ft="start",ht=null,yt=null,bt={},_t=[];void 0===e.componentContext&&r.componentContext&&void 0!==lt&&r.componentContext(lt),void 0===e.layoutParams&&r.layoutParams&&void 0!==ct&&r.layoutParams(ct),lt.json&&(vt="vertical",gt="start",ft="start",pt=void 0),i=lt.json.items,a=lt.getDerivedFromVars(null===(tt=lt.json.item_builder)||void 0===tt?void 0:tt.data,void 0,!0),Q(),Q=l(a,(t=>z=t)),s=lt.getDerivedFromVars(lt.json.orientation),X(),X=l(s,(t=>T=t)),c=lt.getDerivedFromVars(lt.json.layout_mode),Y(),Y=l(c,(t=>M=t)),u=lt.getDerivedFromVars(lt.json.content_alignment_vertical),G(),G=l(u,(t=>P=t)),d=lt.getDerivedFromVars(lt.json.content_alignment_horizontal),J(),J=l(d,(t=>O=t)),p=lt.getDerivedFromVars(lt.json.separator),q(),q=l(p,(t=>V=t)),v=lt.getDerivedFromVars(lt.json.line_separator),H(),H=l(v,(t=>F=t)),g=lt.getDerivedFromVars(lt.json.aspect),W(),W=l(g,(t=>A=t)),h=lt.getDerivedFromVars(lt.json.width),U(),U=l(h,(t=>C=t)),m=lt.getDerivedFromVars(lt.json.height),L(),L=l(m,(t=>j=t)),y=lt.getDerivedFromVars(lt.json.clip_to_bounds),B(),B=l(y,(t=>E=t));{let t=[];if(lt.json.item_builder&&Array.isArray(z)&&Array.isArray(lt.json.item_builder.prototypes)){const e=lt.json.item_builder;t=[],z.forEach((r=>{if(null===r||"object"!=typeof r)return;const n=ut.preparePrototypeVariables(e.data_element_name||"it",r);let i;for(let t=0;t<e.prototypes.length;++t){const r=e.prototypes[t];if(r.div){if(void 0===r.selector){i=r.div;break}if(lt.getJsonWithVars(r.selector,n)){i=r.div;break}}}i&&t.push({div:i,vars:n})}))}else t=(i||[]).map((t=>({div:t})));_t=t.map(((t,e)=>lt.produceChildContext(t.div,{path:e,variables:t.vars})))}{let t=[];_t.forEach((e=>{t.push(lt.getDerivedFromVars({width:e.json.width,height:e.json.height}))})),dt=K(t,(t=>[...t])),Z(),Z=l(dt,(t=>I=t))}if(vt=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(T,vt),b="wrap"===M,_="horizontal"!==vt&&!b&&I.some(we),w="vertical"!==vt&&!b&&I.some($e),gt=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}(P,gt),ft=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}(O,D,ft),(null==V?void 0:V.style)&&"overlap"!==vt&&Ee()){const t=xe(V.style,Oe,(null==ht?void 0:ht.style)||null);ht=t?{show_at_start:Boolean(null!==(et=V.show_at_start)&&void 0!==et&&et),show_at_end:Boolean(null!==(rt=V.show_at_end)&&void 0!==rt&&rt),show_between:Boolean(null===(nt=V.show_between)||void 0===nt||nt),style:t,margins:ye(V.margins)}:null}else ht=null;if((null==F?void 0:F.style)&&"overlap"!==vt&&Ee()){const t=xe(F.style,Oe,(null==yt?void 0:yt.style)||null);yt=t?{show_at_start:Boolean(null!==(it=F.show_at_start)&&void 0!==it&&it),show_at_end:Boolean(null!==(ot=F.show_at_end)&&void 0!==ot&&ot),show_between:Boolean(null===(st=F.show_between)||void 0===st||st),style:t,margins:ye(F.margins)}:null}else yt=null;$=ht||yt?function(t,e,r){const n={};return be(n,e,"vertical"===t),be(n,r,"horizontal"===t),n}(vt,ht,yt):null;{const t=null==A?void 0:A.ratio;pt=t&&Yt(t)?t:void 0}{let t={};"overlap"===vt&&(t.overlapParent=!0),"horizontal"!==vt&&(t.parentHAlign=b?"start":De[ft]),"vertical"!==vt&&(t.parentVAlign=b?"start":Se[gt]),pt||w||j&&"wrap_content"!==j.type&&("match_parent"!==j.type||!(null==ct?void 0:ct.parentVerticalWrapContent))||(t.parentVerticalWrapContent=!0),!_&&("wrap_content"===(null==C?void 0:C.type)||"match_parent"===(null==C?void 0:C.type)&&(null==ct?void 0:ct.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0),"horizontal"===vt&&(t.parentContainerOrientation="horizontal"),"vertical"===vt&&(t.parentContainerOrientation="vertical"),b&&(t.parentContainerWrap=!0),bt=Tt(t,bt)}return x={orientation:vt,valign:gt,halign:ft,wrap:b,overflow:!1===E||0===E?"visible":void 0},k={gap:ht||yt?_e(vt,ht,yt):void 0,"aspect-ratio":pt},B(),U(),L(),W(),H(),q(),S(),J(),G(),Z(),Y(),X(),Q(),`${R(ie,"Outer").$$render(t,{cls:At("container",me,x),componentContext:lt,layoutParams:ct,style:k,additionalPaddings:$,heightByAspect:Boolean(pt),parentOf:_t.map((t=>t.json)),replaceItems:function(t){lt=Object.assign(Object.assign({},lt),{json:Object.assign(Object.assign({},lt.json),{items:t.filter(mt)})})}},{},{default:()=>`${N(_t,(e=>`${R(kn,"Unknown").$$render(t,{componentContext:e,layoutParams:bt},{},{})}`))} ${ht||yt?`${R(Ve,"ContainerSeparators").$$render(t,{direction:D,separator:ht,lineSeparator:yt,orientation:vt,contentHAlign:ft,contentVAlign:gt},{},{})}`:""}`})}`})),Ie=Pe,Me={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 Ne=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,v=o,{componentContext:g}=e,{layoutParams:f}=e,h="horizontal",m="rgba(0,0,0,0.08)";return void 0===e.componentContext&&r.componentContext&&void 0!==g&&r.componentContext(g),void 0===e.layoutParams&&r.layoutParams&&void 0!==f&&r.layoutParams(f),g.json&&(h="horizontal",m="rgba(0,0,0,0.08)"),i=g.getDerivedFromVars(g.json.delimiter_style),v(),v=l(i,(t=>p=t)),h=Te(null==p?void 0:p.orientation,h),a=!((null==p?void 0:p.color)&&("transparent"===p.color||9===p.color.length&&0===p.color.indexOf("#00"))),m=gt(null==p?void 0:p.color,1,m),s="horizontal"===h?"100%":dt(1),c="horizontal"===h?dt(1):"100%",u={background:m,width:s,height:c},d={orientation:h},v(),`${R(ie,"Outer").$$render(t,{cls:At("separator",Me,d),componentContext:g,layoutParams:f},{},{default:()=>a?`<span${W("class",Me.separator__inner,0)}${W("style",ut(u),0)}></span>`:""})}`})),ze={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 Re(t){return t.startsWith("data:")?ht(t):`data:image/jpg;base64,${ht(t)}`}const Be="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Ue=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P,I,M,T,N,z,B,U,L,H,J,G=o,Z=o,Y=o,X=o,Q=o,K=o,tt=o,et=o,rt=o,nt=o,it=o,ot=o,lt=o,ct=o,dt=o,{componentContext:pt}=e,{layoutParams:vt}=e;const ft=f(at);let ht;V=l(ft.direction,(t=>F=t));let mt,yt,bt=0,_t=!1,xt="rgba(0,0,0,0.08)",kt=!1,Et="",Ct="none",jt="50% 50%",Ft="0",Vt="source_in",Dt="",St="",Ot=0,It=0,Mt=0,Tt="",zt="",Rt=!1;v((()=>{ft.removeSvgFilter(yt,Vt)})),void 0===e.componentContext&&r.componentContext&&void 0!==pt&&r.componentContext(pt),void 0===e.layoutParams&&r.layoutParams&&void 0!==vt&&r.layoutParams(vt),pt.json&&(Ct="none",jt="50% 50%",Vt="source_in"),i=pt.getDerivedFromVars(pt.json.image_url),lt(),lt=l(i,(t=>L=t)),a=pt.getDerivedFromVars(pt.json.gif_url),ct(),ct=l(a,(t=>H=t)),s=pt.getDerivedFromVars(pt.json.width),ot(),ot=l(s,(t=>U=t)),c=pt.getDerivedFromVars(pt.json.height),it(),it=l(c,(t=>B=t)),u=pt.getDerivedFromVars(pt.json.preview),nt(),nt=l(u,(t=>z=t)),d=pt.getDerivedFromVars(pt.json.placeholder_color),rt(),rt=l(d,(t=>N=t)),p=pt.getDerivedFromVars(pt.json.scale),et(),et=l(p,(t=>T=t)),g=pt.getDerivedFromVars({content_alignment_horizontal:pt.json.content_alignment_horizontal,content_alignment_vertical:pt.json.content_alignment_vertical}),tt(),tt=l(g,(t=>M=t)),h=pt.getDerivedFromVars(pt.json.accessibility),K(),K=l(h,(t=>I=t)),m=pt.getDerivedFromVars(pt.json.aspect),Q(),Q=l(m,(t=>P=t)),y=pt.getDerivedFromVars(pt.json.tint_color),X(),X=l(y,(t=>O=t)),b=pt.getDerivedFromVars(pt.json.tint_mode),Y(),Y=l(b,(t=>S=t)),_=pt.getDerivedFromVars(pt.json.appearance_animation),Z(),Z=l(_,(t=>D=t)),w=pt.getDerivedFromVars(pt.json.filters),G(),G=l(w,(t=>A=t)),$=pt.getDerivedFromVars(pt.json.preload_required),dt(),dt=l($,(t=>J=t));{let t="gif"===pt.json.type?H:L;_t="empty://"===t,_t&&(t=Be),mt=t}bt=0,mt?kt=!1:(kt=!0,pt.logError(st(new Error(`Missing "${"gif"===pt.json.type?"gif_url":"image_url"}" for "${pt.json.type}"`)))),x="wrap_content"===(null==U?void 0:U.type),k="wrap_content"===(null==B?void 0:B.type),Et=z?`url("${Re(z)}")`:"",xt=gt(N,1,xt),Ct=wt(T)||Ct,jt=function(t,e,r){let n=t.content_alignment_horizontal;const i=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||i&&"top"!==i&&"center"!==i&&"bottom"!==i?r:$t({content_alignment_horizontal:n,content_alignment_vertical:i})}(M,F,jt),E=(null==I?void 0:I.description)||"";{const t=null==P?void 0:P.ratio;Ft=t&&Yt(t)?(100/Number(t)).toFixed(2):"0"}{const t=O?gt(O):void 0,e=ge(S,Vt);t===yt&&e===Vt||(ft.removeSvgFilter(yt,Vt),Dt=t?ft.addSvgFilter(t,e):"",yt=t,Vt=e)}if(D&&"fade"===D.type){const t=D;St=Nt(t.interpolator,"ease_in_out").replace(/_/g,"-"),Mt=Pt(t.duration,300),It=Pt(t.start_delay,0),Ot=Pt(t.alpha,0)}{let t="",e="";Array.isArray(A)&&A.length&&(t=Xt(A,pt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),Tt=t,zt=e,Rt="rtl"===F&&Array.isArray(A)&&A.some((t=>"rtl_mirror"===t.type))}return C={aspect:"0"!==Ft,"is-width-content":x,"is-height-content":k,loaded:!1,"before-appearance":Boolean(St)&&!0,"is-rtl-mirror":Rt},j={"background-image":Et,"background-color":Et?void 0:xt,"background-size":Ct,"clip-path":zt||void 0,"object-fit":Ct,"object-position":jt,filter:["",Tt].filter(Boolean).join(" "),"--divkit-appearance-interpolator":St||void 0,"--divkit-appearance-fade-start":St?Ot:void 0,"--divkit-appearance-delay":St?`${It}ms`:void 0,"--divkit-appearance-duration":St?`${Mt}ms`:void 0},G(),V(),Z(),Y(),X(),Q(),K(),tt(),et(),rt(),nt(),it(),ot(),lt(),ct(),dt(),kt?"":`${R(ie,"Outer").$$render(t,{cls:At("image",ze,C),componentContext:pt,layoutParams:vt,customDescription:!0},{},{default:()=>C.aspect?`<span${W("class",ze["image__aspect-wrapper"],0)}${q({"padding-bottom":`${Ft}%`})}><img${W("class",ze.image__image,0)}${W("src",mt,0)}${W("loading",J?"eager":"lazy",0)} decoding="async"${W("style",ut(j),0)}${W("alt",E,0)}${W("aria-hidden",E?null:"true",0)}${W("this",ht,0)}></span>`:`<img${W("class",ze.image__image,0)}${W("src",mt,0)}${W("loading",J?"eager":"lazy",0)} decoding="async"${W("style",ut(j),0)}${W("alt",E,0)}${W("aria-hidden",E?null:"true",0)}${W("this",ht,0)}>`})}`})),Le={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 He(t){return String(Math.ceil(1e3*t)/1e3)}function qe(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,i=0;const o=[];if(t.every(Boolean)){i=t.reduce(((t,e)=>t+e),0);for(let o=0;o<r;++o){if(!e[o])continue;const r=e[o]/t[o]*i;r>n&&(n=r)}}for(let e=0;e<r;++e)n?o[e]=`minmax(${dt(n*t[e]/i)},${He(t[e])}fr)`:t[e]?o[e]=`${He(t[e])}fr`:o[e]="auto";return o.join(" ")}const Je=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,v,g,h,m,y,b,_,w=o,$=o,x=o,k=o,{componentContext:E}=e,{layoutParams:C}=e;h=l(f(at).direction,(t=>g=t));let j,A,F=1,V=[],D=[],S=[],O=[],P=0,I=!1,M="start",T="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),E.json&&(F=1,M="start",T="start"),i=Array.isArray(E.json.items)&&E.json.items||[],a=E.getDerivedFromVars(E.json.column_count),k(),k=l(a,(t=>_=t)),s=E.getDerivedFromVars(E.json.content_alignment_vertical),$(),$=l(s,(t=>y=t)),c=E.getDerivedFromVars(E.json.content_alignment_horizontal),w(),w=l(c,(t=>m=t)),F=ae(_,F),u=i.map(((t,e)=>E.produceChildContext(t,{path:e})));{let t=[];u.forEach((e=>{t.push(E.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),j=K(t,(t=>[...t])),x(),x=l(j,(t=>b=t))}{const t={};let e=0,r=0;V=[],D=[],S=[],O=[],I=!1,A=u.map(((n,i)=>{var o,a,s,l;const c=b[i],u=Number(c.columnSpan)||1,d=Number(c.rowSpan)||1,p={x:e,y:r,colSpan:u,rowSpan:d},v="match_parent"===(null===(o=c.width)||void 0===o?void 0:o.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]?I=!0:(t[n+"_"+e]=!0,(!V[n]||V[n]<v)&&(V[n]=v),(!D[e]||D[e]<g)&&(D[e]=g),(!S[n]||S[n]<f)&&(S[n]=f),(!O[e]||O[e]<h)&&(O[e]=h));do{++e,e>=F&&(e=0,++r)}while(t[e+"_"+r]);return{componentContext:n,layoutParams:{gridArea:p}}})),0!==e&&(I=!0),I&&E.logError(st(new Error('Mismatching "grid" rows/columns'))),P=r}return M=pe(y,M),T=de(m,g,T),d={valign:M,halign:T},p={"grid-template-columns":qe(V,S,F),"grid-template-rows":qe(D,O,P)},v=I,h(),w(),$(),x(),k(),v?"":`${R(ie,"Outer").$$render(t,{cls:At("grid",Le,d),componentContext:E,style:p,layoutParams:C,parentOf:u.map((t=>t.json)),replaceItems:function(t){E=Object.assign(Object.assign({},E),{json:Object.assign(Object.assign({},E.json),{items:t.filter(mt)})})}},{},{default:()=>`${N(A,(e=>`${R(kn,"Unknown").$$render(t,{componentContext:e.componentContext,layoutParams:e.layoutParams},{},{})}`))}`})}`})),Ge=Je,Ze={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"},Ye="divkit-bf36b",Xe="divkit-a67bf",Qe="divkit-e2a31",Ke="divkit-c684b";function tr(t){const e=[];let r=t[0],n=1;for(let i=1;i<=t.length;i++)t[i]!==r?(e.push(n>1?`repeat(${n}, ${r})`:r),r=t[i],n=1):n++;return e.join(" ")}function er(t,e){let r;return function(...n){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,n),r=null}),e)}}const rr=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P,M,T,z,B,U,L,H=o,q=o,J=o,G=o,Z=o,Y=o,X=o,Q=o,tt=o,et=o,rt=o,{componentContext:nt}=e,{layoutParams:ot}=e;const st=f(at);let lt;j=l(st.direction,(t=>C=t));let ct,pt=[],vt=!1,gt=!1,ft=null,ht=!1;const yt=st.getCustomization("galleryLeftClass"),bt=st.getCustomization("galleryRightClass");let _t,wt,$t,xt,kt,Et=1,Ct="horizontal",jt="start",Ft=8,Vt="",Dt=[],St={},It=!1,Mt={},Nt=0;U=l(st.isDesktop,(t=>B=t));const zt=er((function(){if(!lt)return;let t=lt.scrollLeft;"rtl"===C&&(t*=-1);const e=lt.scrollWidth,r=lt.offsetWidth;"ltr"===C?(vt=t>2,gt=t+r<e-2):(gt=t>2,vt=t+r<e-2)}),50);function Rt(){let t=[],e=pt[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<Et;++e){const n=pt[e].children[r];n&&t.push(n)}return t}function Bt(t,e,r="smooth"){const n="horizontal"===Ct,i=n?"offsetLeft":"offsetTop",o=n?"left":"top",a=t[e];a&&lt.scroll({[o]:Math.max(0,a[i]+.01-Ft/2),behavior:r})}function Ut(t){const e=Rt(),r=lt.getBoundingClientRect(),n=e.findIndex((t=>function(t,e){return"horizontal"===Ct?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 i=e.map((t=>function(t,e){return"horizontal"===Ct?e.right>t.left&&t.right>e.left:e.bottom>t.top&&t.bottom>e.top}(r,t.getBoundingClientRect()))),o=i.findIndex(Boolean);return-1!==o?"prev"===t&&2===i.filter(Boolean).length?o+1:o:"prev"===t?1:e.length-2}v((()=>{ht=!1,_t&&!nt.fakeElement&&(st.unregisterInstance(_t),_t=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==nt&&r.componentContext(nt),void 0===e.layoutParams&&r.layoutParams&&void 0!==ot&&r.layoutParams(ot),nt.json&&(Et=1,Ct="horizontal",jt="start",Ft=8,Vt=""),i=Array.isArray(nt.json.items)&&nt.json.items||[],a=nt.getDerivedFromVars(nt.json.column_count),et(),et=l(a,(t=>z=t)),s=nt.getDerivedFromVars(nt.json.orientation),tt(),tt=l(s,(t=>T=t)),c=nt.getDerivedFromVars(nt.json.cross_content_alignment),Q(),Q=l(c,(t=>M=t)),u=nt.getDerivedFromVars(nt.json.item_spacing),X(),X=l(u,(t=>P=t)),d=nt.getDerivedFromVars(nt.json.cross_spacing),Y(),Y=l(d,(t=>O=t)),p=nt.getDerivedFromVars(nt.json.paddings),Z(),Z=l(p,(t=>S=t)),g=nt.getDerivedFromVars(nt.json.scroll_mode),J(),J=l(g,(t=>V=t)),h=nt.getDerivedFromVars(nt.json.restrict_parent_scroll),rt(),rt=l(h,(t=>L=t)),m=nt.getDerivedFromVars(nt.json.scrollbar),q(),q=l(m,(t=>F=t)),y=nt.getDerivedFromVars(nt.json.default_item),H(),H=l(y,(t=>A=t)),b=i.map(((t,e)=>nt.produceChildContext(t,{path:e}))),_=B&&ht,_?"undefined"!=typeof ResizeObserver&&(ft=new ResizeObserver((()=>{zt()})),ft.observe(ct)):ft&&(ft.disconnect(),ft=null),Et=ae(z,Et),w=function(t,e){let r=0,n=[];for(let i=0;i<t.length;++i)n[r]||(n[r]=[]),n[r].push(t[i]),++r>=e&&(r=0);return n}(b,Et),Ct=Te(T,Ct),jt=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(M,jt),Ft=Pt(P,Ft),wt=dt(Ft),xt=Pt(O,Ft),$t=dt(xt),Vt=Ot(S,C,Vt),$="horizontal"===Ct?"grid-template-columns":"grid-template-rows";{let t=[];b.forEach((e=>{const r="horizontal"===Ct?"width":"height";t.push(nt.getDerivedFromVars(e.json[r]))})),kt=K(t,(t=>t)),G(),G=l(kt,(t=>D=t))}Dt=[],Et>1?Dt.push("auto"):D.forEach((t=>{!t&&"horizontal"===Ct||"match_parent"===(null==t?void 0:t.type)?Dt.push("100%"):Dt.push("max-content")}));{const t={};let e={};It=!1,"horizontal"===Ct?e.parentVAlign=jt:e.parentHAlign=jt,"paging"===V&&(It=!0,e.scrollSnap="start",t["horizontal"===Ct?"scroll-padding-left":"scroll-padding-top"]=dt(Ft/2)),1===Et&&(e.parentLayoutOrientation=Ct),St=Tt(t,St),Mt=Tt(e,Mt)}return x={padding:Vt,"grid-gap":$t},k={"grid-gap":wt,[$]:tr(Dt)},E={orientation:Ct,"scroll-snap":It,scrollbar:"auto"===F?"auto":"none"},Nt=Pt(A,Nt),nt.json&&zt(),nt.json&&(_t&&(st.unregisterInstance(_t),_t=void 0),nt.json.id&&!nt.fakeElement&&(_t=nt.json.id,st.registerInstance(_t,{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');Bt(e,t)},setPreviousItem(t){const e=Ut("prev"),r=Rt();let n=e-1;n<0&&(n="ring"===t?r.length-1:e),Bt(r,n)},setNextItem(t){const e="horizontal"===Ct?lt.scrollLeft+lt.offsetWidth===lt.scrollWidth:lt.scrollTop+lt.offsetHeight===lt.scrollHeight,r=Rt();if(e&&"ring"===t)return void Bt(r,0);const n=Ut("next");let i=n+1;i>r.length-1&&(i="ring"===t?0:n),Bt(r,i)}}))),j(),H(),q(),J(),G(),Z(),Y(),X(),Q(),tt(),et(),U(),rt(),` ${R(ie,"Outer").$$render(t,{cls:At("gallery",Ze,E),componentContext:nt,layoutParams:ot,customPaddings:!0,customActions:"gallery",parentOf:i,replaceItems:function(t){nt=Object.assign(Object.assign({},nt),{json:Object.assign(Object.assign({},nt.json),{items:t.filter(mt)})})}},{},{default:()=>`<div class="${I(Ze.gallery__scroller,!0)+" "+I(L?it:"",!0)}"${W("style",ut(St),0)}${W("this",lt,0)}><div${W("class",Ze["gallery__items-grid"],0)}${W("style",ut(x),0)}${W("this",ct,0)}>${N(w,((e,r)=>`<div${W("class",Ze.gallery__items,0)}${W("style",ut(k),0)}${W("this",pt[r],0)}>${N(e,(e=>`${R(kn,"Unknown").$$render(t,{componentContext:e,layoutParams:Mt},{},{})}`))} </div>`))}</div></div> ${"horizontal"===Ct?`${vt&&_?` <div${W("class",yt||`${Ze.gallery__arrow} ${Ye} ${Qe}`,0)}>${yt?"":`<svg${W("class",Xe,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${W("class",Ze["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&&_?` <div${W("class",bt||`${Ze.gallery__arrow} ${Ye} ${Ke}`,0)}>${bt?"":`<svg${W("class",Xe,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${W("class",Ze["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,ir={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__separator:"divkit-b85bf"},or=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,x,k,E,C,j,A,F,V,D,S,O,P,M,T,z,B=o,U=o,L=o,H=o,J=o,G=o,Z=o,Y=o,X=o;var K,tt;let{componentContext:et}=e,{layoutParams:rt}=e;const nt=f(at);V=l(nt.direction,(t=>F=t));const ot=nt.genId("tabs");let lt,ct=!1,vt=Q([]);C=l(vt,(t=>E=t));let ft,ht,mt,yt,bt,_t,wt,$t={},xt=12,kt="",Et="",Ct="",jt="",Ft="",Dt="",It="",Mt="",Nt="",zt="",Rt=0,Wt="",Ht="",qt=null,Jt=!1,Zt=!1,Xt=[],Qt=[],Kt=null;async function te(t,e=!1){if(_t=_,_=t,Jt||(Jt=!0,ht.style.height=dt(ht.clientHeight),mt.style.transform=`translate3d(${100*-(null!=_t?_t:_)}%,0,0)`),Zt=!0,async function(t){await $(),mt.style.transform=`translate3d(${t}%,0,0)`}(100*-_),function(t=!1){const e=t?Math.max(0,_-1):Math.min(_,null!=_t?_t:_),r=t?Math.min(i.length-1,_+1):Math.max(_,null!=_t?_t:_);Xt=Xt.map(((t,n)=>{var o;return t||(n>=e&&n<=r&&(null===(o=i[n])||void 0===o?void 0:o.div)?et.produceChildContext(i[n].div,{path:n}):void 0)})),Qt=Qt.map(((t,n)=>n>=e&&n<=r))}(),async function(){await $();const t=document.getElementById(`${ot}-panel-${_}`);t&&(ht.style.height=dt(t.offsetHeight))}(),Kt&&clearTimeout(Kt),Kt=window.setTimeout((()=>{Qt=i.map(((t,e)=>e===_))}),400),wt=-_*ht.clientWidth,e){await $();const t=ft.querySelector(`.${ir.tabs__item_selected}`);t&&t.focus()}}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),et.json&&(xt=12,kt="",jt="",yt=void 0,Ft="",bt=void 0,Dt="",It="",Mt="",Nt="",zt="",Rt=0,Wt="",Ht="",qt=null),i=et.json.items||[],a=i.map((t=>t.div)),s=et.getDerivedFromVars(et.json.width),Y(),Y=l(s,(t=>T=t)),c=et.getDerivedFromVars(et.json.height),Z(),Z=l(c,(t=>M=t)),u=et.getJsonWithVars(et.json.selected_tab),d=et.getDerivedFromVars(et.json.tab_title_style),G(),G=l(d,(t=>P=t)),p=et.getDerivedFromVars(et.json.has_separator),J(),J=l(p,(t=>O=t)),g=et.getDerivedFromVars(et.json.separator_color),H(),H=l(g,(t=>S=t)),h=et.getDerivedFromVars(et.json.separator_paddings),L(),L=l(h,(t=>D=t)),m=et.getDerivedFromVars(et.json.switch_tabs_by_content_swipe_enabled),U(),U=l(m,(t=>A=t)),y=et.getDerivedFromVars(et.json.restrict_parent_scroll),X(),X=l(y,(t=>z=t)),b=et.getDerivedFromVars(et.json.title_paddings),B(),B=l(b,(t=>j=t)),_=u&&Number(u)||0,Array.isArray(i)&&i.length){let t=[];i.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([]);(null==E?void 0:E.length)?ct=!1:(ct=!0,et.logError(st(new Error('Incorrect or empty "items" prop for div "tabs"'))));{let t={};"wrap_content"===(null==T?void 0:T.type)&&(t.parentHorizontalWrapContent=!0),M&&"wrap_content"!==M.type||(t.parentVerticalWrapContent=!0),$t=Tt(t,$t)}if(!ct&&(_<0||_>=i.length)&&(et.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:et.json.selected_tab,length:i.length}})),_=_<0?0:i.length-1),ct||E.some((t=>_===t.index))||(et.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:et.json.selected_tab}})),_=(null===(K=E[0])||void 0===K?void 0:K.index)||0),w=P||{},xt=ae(w.font_size,xt),w.font_size||w.paddings){const t=w.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/xt*10,right:(Number("ltr"===F?t.end:t.start)||Number(t.right)||0)/xt*10,bottom:(Number(t.bottom)||0)/xt*10,left:(Number("ltr"===F?t.start:t.end)||Number(t.left)||0)/xt*10};kt=Ot(e,F,kt)}{const t=w.line_height;void 0!==t&&Yt(t)&&(Et=dt(t/xt*10))}{const t=w.letter_spacing;void 0!==t&&St(t)&&(Ct=dt(t/xt*10))}if(w.corner_radius||w.corners_radius||w.font_size){const t=null!==(tt=w.corner_radius)&&void 0!==tt?tt:1e3;w.corners_radius?jt=function(t,e,r,n){const i=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<i.length;++t)if(i[t]&&!St(i[t]))return n;return Ut(t,e,r)}(w.corners_radius,t,xt,jt):St(t)&&(jt=dt(t/xt*10))}return yt=le(w.active_font_weight||w.font_weight,yt),Ft=w.font_family&&"string"==typeof w.font_family?nt.typefaceProvider(w.font_family,{fontWeight:yt||400}):"",bt=le(w.inactive_font_weight||w.font_weight,bt),Dt=w.font_family&&"string"==typeof w.font_family?nt.typefaceProvider(w.font_family,{fontWeight:bt||400}):"",It=gt(w.active_text_color,1,It),Mt=gt(w.inactive_text_color,1,Mt),Nt=gt(w.active_background_color,1,Nt),zt=gt(w.inactive_background_color,1,zt),Rt=Pt(w.item_spacing,Rt),O&&(S&&(Wt=gt(S,1,Wt)),D&&(Ht=Ot(D,F,Ht))),x={background:Wt,margin:Ht},k=void 0===A||Boolean(A),qt=Bt(j||void 0,qt),function(t){ct||(Xt=t.map(((t,e)=>{if(e===_&&(null==t?void 0:t.div))return et.produceChildContext(t.div,{path:e})})),Qt=t.map(((t,e)=>e===_)))}(i),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>i.length-1)throw new Error('Item is out of range in "set-current-item" action');te(t)},setPreviousItem(t){let e=_-1;e<0&&(e="ring"===t?i.length-1:_),te(e)},setNextItem(t){let e=_+1;e>i.length-1&&(e="ring"===t?0:_),te(e)}}))),C(),B(),U(),V(),L(),H(),J(),G(),Z(),Y(),X(),ct?"":`${R(ie,"Outer").$$render(t,{cls:At("tabs",ir,{}),componentContext:et,layoutParams:rt,customActions:"tabs",parentOf:a,parentOfSimpleMode:!0,replaceItems:function(t){et.json.items&&(et=Object.assign(Object.assign({},et),{json:Object.assign(Object.assign({},et.json),{items:et.json.items.map(((e,r)=>Object.assign(Object.assign({},e),{div:t[r]})))})}))}},{},{default:()=>` <div class="${I(ir.tabs__list,!0)+" "+I(z?it:"",!0)}" role="tablist"${q({"--divkit-tabs-title-padding":qt?Vt(qt,F):"","--divkit-tabs-font-size":dt(xt),"--divkit-tabs-paddings":kt,"--divkit-tabs-line-height":Et,"--divkit-tabs-letter-spacing":Ct,"--divkit-tabs-active-font-weight":yt||"","--divkit-tabs-inactive-font-weight":bt||"","--divkit-tabs-active-font-family":Ft||"","--divkit-tabs-inactive-font-family":Dt||"","--divkit-tabs-active-text-color":It,"--divkit-tabs-inactive-text-color":Mt,"--divkit-tabs-active-background-color":Nt,"--divkit-tabs-inactive-background-color":zt,"--divkit-tabs-border-radius":jt,"--divkit-tabs-items-spacing":Rt?pt(Rt):""})}${W("this",ft,0)}>${N(E,(e=>{let r=e.index,n=r===_;return` ${R(Gt,"Actionable").$$render(t,{componentContext:et,cls:At("tabs__item",ir,{selected:n,actionable:Boolean(e.title_click_action)}),actions:e.title_click_action&&!et.fakeElement?[e.title_click_action].filter(Lt):[],attrs:{id:`${ot}-tab-${r}`,"aria-controls":`${ot}-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 _===e||(te(e),!1)}(0,r)},{},{default:()=>`${I(e.title)} `})}`}))}</div> ${O?`<div${W("class",ir.tabs__separator,0)}${W("style",ut(x),0)}></div>`:""} <div class="${I(ir.tabs__panels,!0)+" "+I(z?it:"",!0)}"${W("this",ht,0)}><div${W("class",At("tabs__swiper",ir,{inited:Jt,animated:Zt}),0)}${W("this",mt,0)}>${N(E,(e=>{let r=e.index,n=Xt[r];return` <div${W("class",At("tabs__panel",ir,{visible:Qt[r]}),0)} role="tabpanel" id="${I(ot,!0)+"-panel-"+I(r,!0)}" aria-labelledby="${I(ot,!0)+"-tab-"+I(r,!0)}" style="${"left: "+I(100*r,!0)+"%"}">${n?`${R(kn,"Unknown").$$render(t,{componentContext:n,layoutParams:$t},{},{})}`:""} </div>`}))}</div></div>`})}`})),ar=or,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),i=r-n;return t[n]*i+t[n+1]*(1-i)}}function ur(t){return Math.max(...t.map((t=>(Number(t.duration)||200)+(Number(t.start_delay)||0))))}function dr(t){const e=[];return"set"===t.type?(t.items||[]).forEach((t=>{e.push(...dr(t))})):e.push(t),e}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 pr={tooltip:"divkit-f1907",tooltip_visible:"divkit-e5914"},vr=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,$=o,x=o,k=o,E=o,C=o;var j,A,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),i=P.produceChildContext(S.div),a=P.getDerivedFromVars(S.position),k(),k=l(a,(t=>m=t)),s=P.getDerivedFromVars(null===(A=null===(j=S.offset)||void 0===j?void 0:j.x)||void 0===A?void 0:A.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(At("tooltip",pr,p),!0)+" "+I(y?nt:"",!0)}"${q({top:"",left:"",width:"",height:""})}${W("this",undefined,0)}>${R(kn,"Unknown").$$render(t,{componentContext:i},{},{})}</div>`}));function gr(t){return"change_bounds"===t.type?t:"set"===t.type?gr(t.items[0]):null}const fr=L(((t,e,r,n)=>{let i,o,a,s,l,c,{componentContext:u}=e,{layoutParams:d}=e;const p=f(at),h=f(Ft);let m,y,b,_,w=!1,x=new Map,k=new Set,E=null,C=[],j=[],A=[],F=[],V=!1;function D(t){_=(null==t?void 0:t.div)?u.produceChildContext(t.div,{path:t.state_id||"<unknown>"}):void 0}function S(t,e,r){let{json:n,parentComponentContext:i,transitions:o,node:a}=e;n=u.getJsonWithVars(n),o=u.getJsonWithVars(o);const s=dr(o),l=a.getBoundingClientRect(),c=Object.assign(Object.assign({},n),{margins:void 0,alpha:(d=s,d.some((t=>"fade"===t.type))?void 0:n.alpha)});var d;return{json:c,componentContextCopy:i.produceChildContext(c,{fake:!0}),elementBbox:l,rootBbox:t,transitions:s,alpha:n.alpha,width:l.width,height:l.height,offsetTop:l.top-t.top,offsetLeft:l.left-t.left,direction:r,resolvePromise:e.resolvePromise,node:e.node}}async function O(t){if(b===t)return;p.setRunning("stateChange",!0);const e=new Set(k);C.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),C=[];let r=[];if(m){const t=m.getBoundingClientRect();r=A.map((e=>S(t,e,"out")))}F.forEach((t=>{x.set(t.id,t.node.getBoundingClientRect())})),j=[],A=[],F=[];const n=l.find((e=>e.state_id===t))||null;if(n?(b=t,null==s||s.setValue(b),D(n)):u.logError(st(new Error("Cannot find state with id"),{additional:{stateId:t}})),await $(),!m)return;const i=m.getBoundingClientRect();let o=j.filter((t=>{var r;return!(!t.json.id||e.has(t.json.id))||(null===(r=t.resolvePromise)||void 0===r||r.call(t),!1)})).map((t=>S(i,t,"in")));r=r.filter((t=>{var e;return!(!t.json.id||k.has(t.json.id))||(null===(e=t.resolvePromise)||void 0===e||e.call(t),!1)}));const a=r.concat(o),c=a.reduce(((t,e)=>Math.max(t,ur(e.transitions))),0),d=F.filter((t=>x.has(t.id))).map((t=>{const e=Object.assign(Object.assign({},t.json),{margins:void 0,width:{type:"match_parent"},height:{type:"match_parent"}});return{json:e,componentContextCopy:t.parentComponentContext.produceChildContext(e,{fake:!0}),rootBbox:i,beforeBbox:x.get(t.id),afterBbox:t.node.getBoundingClientRect(),node:t.node,transition:u.getJsonWithVars(gr(t.transitions)),resolvePromise:t.resolvePromise}}));C=[...a.map((t=>Object.assign(Object.assign({},t),{maxDuration:c}))),...d],x.clear(),p.setRunning("stateChange",!1)}return g(Ft,{registerInstance(t,e){E||(E=new Map),E.has(t)?u.logError(st(new Error("Duplicate state with id"),{additional:{id:t}})):E.set(t,e)},unregisterInstance(t){null==E||E.delete(t)},runVisibilityTransition(t,e,r,n,i){if(!m)return Promise.resolve();const o=S(m.getBoundingClientRect(),{json:t,parentComponentContext:e,transitions:r,node:n},i),a=ur(o.transitions),s=Object.assign(Object.assign({},o),{maxDuration:a});return C=[...C.filter((t=>t.node!==o.node)),s],new Promise((t=>{s.resolvePromise=t}))},registerChildWithTransitionIn(t,e,r,n){const i={json:t,parentComponentContext:e,transitions:r,node:n};return j.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,n){const i={json:t,parentComponentContext:e,transitions:r,node:n};return A.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,n){const i=t.id;if(!i)return Promise.resolve();const o={id:i,json:t,parentComponentContext:e,transitions:r,node:n};return F.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&x.has(t),registerChild(t){k.add(t)},unregisterChild(t){k.delete(t)}}),v((()=>{y&&h.unregisterInstance(y)})),void 0===e.componentContext&&r.componentContext&&void 0!==u&&r.componentContext(u),void 0===e.layoutParams&&r.layoutParams&&void 0!==d&&r.layoutParams(d),i=u.json.div_id||u.json.id,o=u.getJsonWithVars(u.json.default_state_id),a=u.json.state_id_variable,s=a?u.getVariable(a,"string"):null,u.json&&(V=!1),i?w=!1:(w=!0,u.logError(st(new Error('Missing "id" prop for div "state"')))),u.json&&(k=new Set),l=u.json.states||[],c=l.map((t=>t.div)),(null==l?void 0:l.length)?w=!1:(w=!0,u.logError(st(new Error('Empty "states" prop for div "state"')))),u.json&&(y&&(h.unregisterInstance(y),y=void 0),i&&!(null==u?void 0:u.fakeElement)&&(y=i,h.registerInstance(i,{setState:O,getChild:function(t){if(E&&E.has(t))return E.get(t);u.logError(st(new Error("Missing state block with id"),{additional:{id:t}}))}}))),!V&&function(t){if(!V&&(V=!0,t.length)){const e=(null==s?void 0:s.getValue())||o;if(e){b=e;const r=t.find((t=>t.state_id===b))||null;D(r),r||u.logError(st(new Error("Cannot find state for default_state_id"),{additional:{selectedId:b}}))}else{const e=t[0];b=e.state_id,D(e)}s&&(s.setValue(b),s.subscribe((t=>{O(t)})))}}(l),w?"":`${R(ie,"Outer").$$render(t,{cls:"divkit-b8efc",componentContext:u,layoutParams:d,parentOf:c,parentOfSimpleMode:!0,replaceItems:function(t){const e=u.json.states;e&&(l=e.map(((e,r)=>Object.assign(Object.assign({},e),{div:t[r]}))),u.json=Object.assign(Object.assign({},u.json),{states:l}),b&&D(l.find((t=>t.state_id===b))||null))}},{},{default:()=>`${_?`${R(kn,"Unknown").$$render(t,{componentContext:_},{},{})}`:""} <div${W("class","divkit-adaae",0)} aria-hidden="true"${W("this",m,0)}>${N(C,(e=>"direction"in e?`<div${W("class",sr,0)}${q({left:`${e.offsetLeft}px`,top:`${e.offsetTop}px`,width:`${e.width}px`,height:`${e.height}px`})}><div${W("class",lr,0)}>${R(kn,"Unknown").$$render(t,{componentContext:e.componentContextCopy},{},{})}</div> </div>`:`<div${W("class",sr,0)}><div${W("class",lr,0)}>${R(kn,"Unknown").$$render(t,{componentContext:e.componentContextCopy},{},{})}</div> </div>`))}</div>`})} ${null!=u&&u.tooltips?`${N(u.tooltips,(e=>`${R(vr,"TooltipView").$$render(t,{ownerNode:e.ownerNode,data:e.desc,internalId:e.internalId,parentComponentContext:u},{},{})}`))}`:""}`})),hr=fr,mr={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"},yr=L(((t,e,r,n)=>{let i,a,s,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O=o,P=o,M=o,T=o,z=o,B=o;var U,L,H,q,J,G,Z,Y,X,Q;let{componentContext:K}=e,{layoutParams:tt}=e;const et=f(at);E=l(et.direction,(t=>k=t));const rt=et.genId("pager"),nt=et.getCustomization("pagerLeftClass"),ot=et.getCustomization("pagerRightClass");j=l(et.isDesktop,(t=>C=t)),er((function(){if(!vt)return;const t=function(){const t=Array.from(ct.children),e=ct.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,n=t.getBoundingClientRect(),"horizontal"===yt?n.left>=r.left&&n.right<=r.right:n.top>=r.top&&n.bottom<=r.bottom;var r,n}));return-1!==r?r:gt}();t!==gt&&(gt=t)}),50);let lt,ct,vt=!1,gt=0,ft=0,ht=!1,yt="horizontal",bt="",_t="",wt="";function $t(t,e="smooth"){const r="horizontal"===yt,n=ct.children[t],i=r?"offsetLeft":"offsetTop",o=r?"left":"top";ct.scroll({[o]:n[i],behavior:e}),gt=t}v((()=>{vt=!1,lt&&(et.unregisterInstance(lt),lt=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==K&&r.componentContext(K),void 0===e.layoutParams&&r.layoutParams&&void 0!==tt&&r.layoutParams(tt),K.json&&(_t=""),i=K.getDerivedFromVars(K.json.layout_mode),P(),P=l(i,(t=>A=t)),a=K.getDerivedFromVars(K.json.orientation),z(),z=l(a,(t=>D=t)),s=K.getDerivedFromVars(K.json.item_spacing),T(),T=l(s,(t=>V=t)),u=K.getDerivedFromVars(K.json.paddings),M(),M=l(u,(t=>F=t)),d=K.getDerivedFromVars(K.json.restrict_parent_scroll),B(),B=l(d,(t=>S=t)),p=(Array.isArray(K.json.items)&&K.json.items||[]).map(((t,e)=>K.produceChildContext(t,{path:e}))),A?"percentage"!==A.type&&"fixed"!==A.type?(ht=!0,K.logError(st(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):ht=!1:(ht=!0,K.logError(st(new Error('Empty "layout_mode" prop for div "pager"')))),yt=Te(D,yt);{const t=null==V?void 0:V.value;t&&St(t)&&(bt=dt(t||0))}if(_t=Ot(F,k,_t),g="horizontal"===yt?"grid-auto-columns":"grid-auto-rows","fixed"===(null==A?void 0:A.type)){const t=pt("horizontal"===yt?(("ltr"===k?null===(U=K.json.paddings)||void 0===U?void 0:U.start:null===(L=K.json.paddings)||void 0===L?void 0:L.end)||(null===(H=K.json.paddings)||void 0===H?void 0:H.left)||0)+(("ltr"===k?null===(q=K.json.paddings)||void 0===q?void 0:q.end:null===(J=K.json.paddings)||void 0===J?void 0:J.start)||(null===(G=K.json.paddings)||void 0===G?void 0:G.right)||0):((null===(Z=K.json.paddings)||void 0===Z?void 0:Z.top)||0)+((null===(Y=K.json.paddings)||void 0===Y?void 0:Y.bottom)||0)),e=null===(X=A.neighbour_page_width)||void 0===X?void 0:X.value;wt=e?`calc(100% + ${t} - 2 * ${pt(e)} - 2 * ${bt})`:"100%"}else if("percentage"===(null==A?void 0:A.type)){const t=null===(Q=A.page_width)||void 0===Q?void 0:Q.value;wt=`${Number(t)}%`}return h={"grid-gap":bt,padding:_t,[g]:wt},m={orientation:yt},y=ht,b=C&&vt&&!y,_="ltr"===k?gt>0:gt+1<p.length,w="ltr"===k?gt+1<p.length:gt>0,$=et.getStore("pagers"),O(),O=l($,(t=>x=t)),function(t,e){const r=K.json.id;if(r){const n=new Map(x);c($,x=n.set(r,{instId:rt,size:t,currentItem:e,scrollToPagerItem:$t}),x)}}(p.length,gt),function(t){var e;if(t===ft)return;ft=t;const r=K.getJsonWithVars(null===(e=p[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&K.execAnyActions(r)}(gt),K.json&&(lt&&(et.unregisterInstance(lt),lt=void 0),K.json.id&&!K.fakeElement&&(lt=K.json.id,et.registerInstance(lt,{setCurrentItem(t){if(t<0||t>p.length-1)throw new Error('Item is out of range in "set-current-item" action');$t(t)},setPreviousItem:function(t){let e=gt-1;e<0&&(e="ring"===t?p.length-1:gt),$t(e)},setNextItem:function(t){let e=gt+1;e>p.length-1&&(e="ring"===t?0:gt),$t(e)}}))),O(),E(),j(),P(),M(),T(),z(),B(),y?"":`${R(ie,"Outer").$$render(t,{cls:At("pager",mr,m),componentContext:K,layoutParams:tt,customPaddings:!0,parentOf:p.map((t=>t.json)),replaceItems:function(t){K=Object.assign(Object.assign({},K),{json:Object.assign(Object.assign({},K.json),{items:t.filter(mt)})})}},{},{default:()=>`<div class="${I(mr.pager__items,!0)+" "+I(S?it:"",!0)}"${W("style",ut(h),0)}${W("this",ct,0)}>${N(p,(e=>`<div${W("class",mr.pager__item,0)}>${R(kn,"Unknown").$$render(t,{componentContext:e},{},{})} </div>`))}</div> ${_&&b?` <div${W("class",nt||`${mr.pager__arrow} ${Ye} ${Qe}`,0)}>${nt?"":`<svg${W("class",Xe,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${W("class",mr["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>`:""} ${w&&b?` <div${W("class",ot||`${mr.pager__arrow} ${Ye} ${Ke}`,0)}>${ot?"":`<svg${W("class",Xe,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${W("class",mr["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>`:""}`})}`})),br=yr,_r={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"},wr=["rounded_rectangle","circle"],$r=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,v,g,h,m,y,b,_,w,x,k,E,C,j,A,F=o,V=o,D=o,S=o,O=o,P=o,M=o,T=o,z=o;var B,U;let{componentContext:L}=e,{layoutParams:H}=e;const J=f(at);y=l(J.direction,(t=>m=t));let G,Z,Y,X={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},Q={width:10,height:10,borderRadius:5,background:"#33919cb5"},K="default",et=15,rt=10,nt=5;if(void 0===e.componentContext&&r.componentContext&&void 0!==L&&r.componentContext(L),void 0===e.layoutParams&&r.layoutParams&&void 0!==H&&r.layoutParams(H),L.json&&(K="default",et=15,rt=10,nt=5,X={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},Q={width:10,height:10,borderRadius:5,background:"#33919cb5"}),i=L.getDerivedFromVars(L.json.shape),P(),P=l(i,(t=>E=t)),a=L.getDerivedFromVars(L.json.active_item_color),S(),S=l(a,(t=>x=t)),s=L.getDerivedFromVars(L.json.inactive_item_color),O(),O=l(s,(t=>k=t)),c=L.getDerivedFromVars(L.json.active_item_size),M(),M=l(c,(t=>C=t)),u=L.getDerivedFromVars(L.json.active_shape),z(),z=l(u,(t=>A=t)),d=L.getDerivedFromVars(L.json.inactive_shape),T(),T=l(d,(t=>j=t)),p=L.getDerivedFromVars(L.json.space_between_centers),V(),V=l(p,(t=>_=t)),v=L.getDerivedFromVars(L.json.items_placement),D(),D=l(v,(t=>w=t)),A&&(X=xe({type:"shape_drawable",shape:A},wr,X)),j&&(Q=xe({type:"shape_drawable",shape:j},wr,Q)),!A&&!j&&E){const t=ae(C,1.3);Q=xe({type:"shape_drawable",shape:E,color:Q.background},wr,Q),Q.background=gt(k,1,Q.background),X=Object.assign(Object.assign({},Q),{width:Q.width*t,height:Q.height*t,borderRadius:Q.borderRadius*t,background:X.background}),X.background=gt(x,1,X.background)}if(!w||"default"!==w.type&&"stretch"!==w.type)K="default",_&&(et=Pt(_.value,et));else if(K=w.type,"default"===K)et=Pt(null===(B=w.space_between_centers)||void 0===B?void 0:B.value,et);else if("stretch"===K){const t=w;rt=ae(t.max_visible_items,rt),nt=Pt(null===(U=t.item_spacing)||void 0===U?void 0:U.value,nt)}return g=J.getStore("pagers"),F(),F=l(g,(t=>b=t)),async function(t){if(L.json.pager_id&&t.has(L.json.pager_id)&&(Y=t.get(L.json.pager_id),await $(),Z)){const t=Z.children[Y.currentItem];if(t){const e=t.offsetLeft;G.scroll({left:e-G.clientWidth/2,behavior:"smooth"})}}}(b),h={placement:K,direction:m},y(),F(),V(),D(),S(),O(),P(),M(),T(),z(),`${R(ie,"Outer").$$render(t,{cls:At("indicator",_r,h),componentContext:L,layoutParams:H},{},{default:()=>`<div${W("class",_r.indicator__scroller,0)}${W("this",G,0)}><div${W("class",_r.indicator__items,0)} role="tablist"${q({margin:"default"===K?`0 ${dt(Math.max(0,X.width-Q.width)/2)}`:"","--divkit-indicator-inactive-width":dt(Q.width),"--divkit-indicator-inactive-height":dt(Q.height),"--divkit-indicator-inactive-border-radius":dt(Q.borderRadius),"--divkit-indicator-inactive-background":Q.background||"","--divkit-indicator-inactive-box-shadow":Q.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/Q.width,"--divkit-indicator-default-margin":"default"===K?`0 ${dt((et-Q.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===K?dt(nt):"","--divkit-indicator-stretch-max-count":"stretch"===K?rt:"","--divkit-indicator-stretch-max-spacer":"stretch"===K?dt((rt-1)*nt):""})}${W("this",Z,0)}>${Y?`${N(Array(Y.size),((t,e)=>{let r=e===Y.currentItem;return` <div class="${I(At("indicator__item",_r,{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)}"${W("aria-selected",r?"true":"false",0)}${W("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),xr=$r,kr={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 Er(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&gt(t.text_color)||"#000",i=se(t.font_weight);if(Yt(t.font_size)&&"transparent"!==n){var o,a;const e={fontSize:dt(t.font_size),fontWeight:i,textColor:n};return"number"==typeof(null==r||null===(o=r.x)||void 0===o?void 0:o.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 Cr(t,e,r){return Math.max(e,Math.min(r,Number(t)))}const jr="function"==typeof BigInt;function Ar(t){return jr?BigInt(t):Number(t)}const Fr=Ar("9223372036854775807"),Vr=Ar("-9223372036854775808");function Dr(t){const e=Ar(t);if(e>Fr||e<Vr)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 Sr=Dr(0);function Or(t){let e=t;return e<0&&(e=-e),e}function Pr(t){let e=0;return t>0?e=1:t<0&&(e=-1),Dr(e)}class Ir{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 Mr extends Ir{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}}class Tr extends Ir{convertValue(t){if("bigint"!=typeof t&&"number"!=typeof t)throw new Error("Incorrect variable value");try{return Dr(t)}catch(t){throw new Error("Incorrect variable value")}}fromString(t){try{return Dr(t)}catch(t){throw new Error("Incorrect variable value")}}getType(){return"integer"}}class Nr extends Ir{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 zr extends Ir{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 Rr extends Ir{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 Br extends Ir{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}class Ur extends Ir{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 Lr extends Ir{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 Wr={string:Mr,number:Nr,integer:Tr,boolean:zr,color:Rr,url:Br,dict:Ur,array:Lr};function Hr(t,e,r){if(!(e in Wr))throw new Error("Unsupported variable type");return new Wr[e](t,r)}function qr(){}function Jr(t){return t(this.value),qr}function Gr(){throw new Error("Cannot change the value of this type of variable")}const Zr={string:class extends Mr{},number:class extends Nr{},integer:class extends Tr{},boolean:class extends zr{},color:class extends Rr{},url:class extends Br{},dict:class extends Ur{},array:class extends Lr{}};for(const t in Zr){const e=Zr[t];e.prototype.subscribe=Jr,e.prototype.set=Gr,e.prototype.setValue=Gr}const Yr={width:10,height:10,borderRadius:5,background:"#000"},Xr=["rounded_rectangle","circle"],Qr=["rounded_rectangle"];function Kr(t,e,r,n,i){let o=[];if(i)for(let i=t;i<e;++i)o.push((i-r)/(n-r));else{for(let e=r;e<t;++e)o.push((e-r)/(n-r));for(let t=e;t<n+1;++t)o.push((t-r)/(n-r))}return o}const tn=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P,M,T,z,B,U,L,H,J,G,Z,Y,X,Q,K=o,tt=o,et=o,rt=o,nt=o,it=o,ot=o,lt=o,ct=o,ut=o,vt=o,gt=o,ft=o,ht=o;var mt,yt,bt,_t;let{componentContext:wt}=e,{layoutParams:$t}=e;const xt=f(at),kt=f(qt);let Et,Ct;O=l(xt.direction,(t=>S=t));let jt,Ft,Vt,Dt=0,Ot=100,Pt=Yr,It=Pt,Mt=Yr,Tt=Yr,Nt=null,Rt=null,Bt=Vt,Ut="",Lt="",Wt=!1,Ht=Cr(Y||0,Dt,Ot),Jt=Cr(Z||0,Dt,Ot),Gt=!1;function Zt(){if(!Ct)return;const t=Ot-Dt,e=(null==Nt?void 0:Nt.width)||0,r=(null==Rt?void 0:Rt.width)||0;Math.max(e,r)*t>=(null==Ct?void 0:Ct.clientWidth)?Gt||(wt.logError(st(new Error("Slider ticks overlap each other"),{level:"warn"})),Gt=!0):Gt=!1}er(Zt,50),v((()=>{Et&&(xt.unregisterFocusable(Et),Et=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==wt&&r.componentContext(wt),void 0===e.layoutParams&&r.layoutParams&&void 0!==$t&&r.layoutParams($t),wt.json&&(Pt=Yr,It=Pt,Mt=Yr,Tt=Yr,Nt=null,Rt=null,Vt=void 0,Bt=void 0,Ut="",Lt=""),i=wt.json.thumb_value_variable,a=wt.json.thumb_secondary_value_variable,s=i&&wt.getVariable(i,"integer")||Hr("temp","integer",0),gt(),gt=l(s,(t=>Y=t)),c=a&&wt.getVariable(a,"integer")||Hr("temp","integer",0),vt(),vt=l(c,(t=>Z=t)),u=wt.getDerivedFromVars(wt.json.min_value),ht(),ht=l(u,(t=>Q=t)),d=wt.getDerivedFromVars(wt.json.max_value),ft(),ft=l(d,(t=>X=t)),p=wt.getDerivedFromVars(wt.json.thumb_style),ut(),ut=l(p,(t=>G=t)),g=wt.getDerivedFromVars(wt.json.thumb_secondary_style),ct(),ct=l(g,(t=>J=t)),h=wt.getDerivedFromVars(wt.json.track_inactive_style),lt(),lt=l(h,(t=>H=t)),m=wt.getDerivedFromVars(wt.json.track_active_style),ot(),ot=l(m,(t=>L=t)),y=wt.getDerivedFromVars(wt.json.tick_mark_active_style),it(),it=l(y,(t=>U=t)),b=wt.getDerivedFromVars(wt.json.tick_mark_inactive_style),nt(),nt=l(b,(t=>B=t)),_=wt.getDerivedFromVars(wt.json.thumb_text_style),rt(),rt=l(_,(t=>z=t)),w=wt.getDerivedFromVars(wt.json.thumb_secondary_text_style),et(),et=l(w,(t=>T=t)),$=wt.getDerivedFromVars(wt.json.accessibility),tt(),tt=l($,(t=>M=t)),x=wt.getDerivedFromVars(wt.json.secondary_value_accessibility),K(),K=l(x,(t=>P=t)),Dt=zt(Q,Dt),Ot=zt(X,Ot),Zt();{const t=Cr(Y||0,Dt,Ot);t!==Ht&&(Ht=t)}{const t=Cr(Z||0,Dt,Ot);t!==Jt&&(Jt=t)}Pt=xe(G,Xr,Pt),It=xe(J,Xr,Pt),Mt=xe(H,Qr,Mt),Tt=xe(L,Qr,Tt);{let t=xe(U,Xr,Yr);t!==Yr&&(Nt=t)}Nt?(jt=a?Kr(Math.min(Ht,Jt),Math.max(Ht,Jt)+1,Dt,Ot,!0):Kr(Dt,Ht,Dt,Ot,!0),Zt()):jt=[];{let t=xe(B,Xr,Yr);t!==Yr&&(Rt=t)}Rt?(Ft=a?Kr(Math.min(Ht,Jt),Math.max(Ht,Jt)+1,Dt,Ot,!1):Kr(Ht+1,Ot+1,Dt,Ot,!0),Zt()):Ft=[],Vt=Er(z,Vt),Bt=Er(T,Vt),(null==M?void 0:M.description)?Ut=M.description:wt.logError(st(new Error('Missing accessibility "description" for slider'),{level:"warn"})),(null==P?void 0:P.description)?Lt=P.description:a&&wt.logError(st(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;kt.hasAction()?(wt.logError(st(new Error('Cannot show "slider" inside component with action'))),t=!0):Pt===Yr?(wt.logError(st(new Error('Missing "thumb_style" in slider'))),t=!0):Tt===Yr?(wt.logError(st(new Error('Missing "track_active_style" in slider'))),t=!0):Mt===Yr&&(wt.logError(st(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==Wt&&(Wt=t)}return k=dt(Math.max(...[Pt.width,It.width,0].filter(St))),E=dt(Math.max(...[Pt.height,It.height,0].filter(St))),C=(Ht-Dt)/(Ot-Dt),j=a?(Jt-Dt)/(Ot-Dt):void 0,A=void 0!==j?Math.abs(j-C):C,F=void 0!==j?Math.min(j,C):0,V={"--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===(mt=null==Vt?void 0:Vt.offset)||void 0===mt?void 0:mt.x)?pt(Vt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(yt=null==Vt?void 0:Vt.offset)||void 0===yt?void 0:yt.y)?pt(Vt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(bt=null==Bt?void 0:Bt.offset)||void 0===bt?void 0:bt.x)?pt(Bt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(_t=null==Bt?void 0:Bt.offset)||void 0===_t?void 0:_t.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":k,"--divkit-slider-max-thumb-height":E,"--divkit-slider-track-part":C,"--divkit-slider-track-secondary-part":j},D={direction:S},wt.json,O(),K(),tt(),et(),rt(),nt(),it(),ot(),lt(),ct(),ut(),vt(),gt(),ft(),ht()," "+(Wt?"":`${R(ie,"Outer").$$render(t,{cls:At("slider",kr,D),style:V,customDescription:!0,customActions:"slider",hasInnerFocusable:!0,componentContext:wt,layoutParams:$t},{},{default:({focusHandler:t,blurHandler:e})=>{var r,n,i,o,s,l;return`<div${W("class",kr["slider__tracks-wrapper"],0)}><div${W("class",kr["slider__tracks-inner"],0)}${W("this",Ct,0)}><div${W("class",kr.slider__track,0)}${q({height:dt(Mt.height),"border-radius":dt(Mt.borderRadius),background:Mt.background,"box-shadow":Mt.boxShadow||""})}></div> <div${W("class",kr["slider__active-track"],0)}${q({left:"ltr"===S?(100*F).toFixed(2)+"%":void 0,right:"ltr"===S?void 0:(100*F).toFixed(2)+"%",width:(100*A).toFixed(2)+"%",height:dt(Tt.height),"border-radius":dt(Tt.borderRadius),background:Tt.background,"box-shadow":Tt.boxShadow||""})}></div> ${N(jt,(t=>`<div class="${I(kr.slider__tick,!0)+" "+I(kr.slider__tick_active,!0)}"${q({"--divkit-slider-tick":t})}></div>`))} ${N(Ft,(t=>`<div class="${I(kr.slider__tick,!0)+" "+I(kr.slider__tick_inactive,!0)}"${q({"--divkit-slider-tick":t})}></div>`))} <div${W("class",kr.slider__thumb,0)}${q({"border-radius":dt(Pt.borderRadius),background:Pt.background,"box-shadow":Pt.boxShadow||""})}>${Vt?`<div${W("class",kr["slider__thumb-text"],0)}><div${W("class",kr["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===(i=Vt)||void 0===i?void 0:i.textColor)||"#000"})}>${I(Ht)}</div></div>`:""}</div> ${a?`<div class="${I(kr.slider__thumb,!0)+" "+I(kr.slider__thumb_secondary,!0)}"${q({"border-radius":dt(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${Bt?`<div class="${I(kr["slider__thumb-text"],!0)+" "+I(kr["slider__thumb-text_secondary"],!0)}"><div${W("class",kr["slider__thumb-text-inner"],0)}${q({"font-size":(null===(o=Bt)||void 0===o?void 0:o.fontSize)||"1em","font-weight":(null===(s=Bt)||void 0===s?void 0:s.fontWeight)||"",color:(null===(l=Bt)||void 0===l?void 0:l.textColor)||"#000"})}>${I(Jt)}</div></div>`:""}</div>`:""} <input type="range"${W("class",kr.slider__input,0)}${W("min",Dt,0)}${W("max",Ot,0)} step="1"${W("value",Ht,0)}${W("aria-label",Ut,0)}${W("this",undefined,0)}> ${a?`<input type="range"${W("class",`${kr.slider__input} ${kr.slider__input_secondary}`,0)}${W("min",Dt,0)}${W("max",Ot,0)} step="1"${W("value",Jt,0)}${W("aria-label",Lt,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 rn(t,e){if(t===e)return{start:t.length,added:0,removed:0};if(t.length>e.length){const r=rn(e,t);return{start:r.start,added:r.removed,removed:r.added}}let r=0,n=e.length-1;const i=e.length-t.length;for(;r<n&&r<t.length&&t[r]===e[r];)++r;for(;n-i>=r&&t[n-i]===e[n];)--n;return++n,{start:r,added:n-r,removed:n-r-i}}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{constructor(t){this.char=t}}class an{constructor(t,e,r){this.char=t,this.filter=e,this.placeholder=r}}class sn{constructor(t){nn(this,"filters",new Map),nn(this,"destructedValue",[]),nn(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 on)t+=r.char;else if(r instanceof an)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 an&&!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 an(null,this.filters.get(e.key),e.placeholder):new on(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=rn(this.value,t);void 0!==e&&(r.start=Math.max(0,e-r.added));const n=this.buildBodySubstring(r,t),i=this.buildTailSubstring(r);this.cleanup(r);const o=this.firstEmptyHolderIndex(),a=i?this.calculateMaxShift(i,o):void 0;this.replaceChars(n,o,a);const s=this.firstEmptyHolderIndex();this.replaceChars(i,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 an&&++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 an&&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 an&&(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 i=()=>{for(var t;n<this.destructedValue.length&&!(this.destructedValue[n]instanceof an);)++n;return null===(t=this.destructedValue[n])||void 0===t?void 0:t.filter};return t.split("").forEach((t=>{const e=i();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 an&&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 i=e,o=0;for(;i<this.destructedValue.length&&o<n.length;){const t=this.destructedValue[i],e=n[o];t instanceof an&&(t.char=e,++o),++i}}firstHolderAfter(t){let e=t;for(;e<this.destructedValue.length&&!(this.destructedValue[e]instanceof an);)++e;return e}}class ln extends sn{constructor(t,e){super(t),this.logError=e}onException(t){this.logError(t)}}function cn(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 un extends sn{constructor(t=void 0,e){super({pattern:"",decoding:[],alwaysVisible:!1}),cn(this,"currencyFormatter",new Intl.NumberFormat),cn(this,"decimalSeparator","."),cn(this,"localeDigits",{}),cn(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=rn(this.value,t),n=this.value.lastIndexOf(this.decimalSeparator),i=t.lastIndexOf(this.decimalSeparator),o=n!==i||-1===n&&-1===i,a=this.validFormat(t,r);this.cleanup(r);const s=this.parseFormat(a)||0;o&&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 i=-1;1===e.added&&0===e.removed&&[",","."].includes(t[e.start])&&(i=e.start);const o=this.currencyFormatter.resolvedOptions().maximumFractionDigits;let a=o;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 i=t[n];i===this.decimalSeparator?r=!0:!this.inDiff(e,n)&&r&&this.isDigit(i)&&a--}}const s=t.includes(this.decimalSeparator)||-1!==i,l=[];n=t.length-1;let c=!1;for(;n>=0;){const u=t[n],d=l.length<=o;this.isDigit(u)?this.inDiff(e,n)&&!c&&s?a>0&&(l.push(u),a--):l.push(u):d&&-1===r&&n===i?(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 dn(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 pn(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,i=Array.from(n.childNodes).indexOf(t)+1;r.setStart(n,i),r.setEnd(n,i),e.addRange(r)}}catch(t){}else for(let r=0,n=t.childNodes.length;r<n;++r){const n=t.childNodes[r],i=dn(n);if(e<=i)return void pn(n,e);e-=i}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 vn="undefined"!=typeof document&&"inputMode"in document.createElement("input"),gn={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"},fn=L(((t,e,r,n)=>{let i,a,s,u,d,p,g,h,m,y,b,_,w,x,k,E,C,j,A,F,V,D,S,O,P,M,T,N,z,B,U,L,H,q,J,G,Z,Y,X,Q,K,tt,et,rt,nt,it,ot,lt,ct=o,vt=o,ft=o,ht=o,mt=o,yt=o,bt=o,_t=o,wt=o,$t=o,xt=o,kt=o,Et=o,Ct=o,jt=o,Ft=o,St=o,Ot=o,It=o;var Mt;let{componentContext:Tt}=e,{layoutParams:Nt}=e;const zt=f(at);let Rt,Ut;L=l(zt.direction,(t=>U=t));let Lt,Wt,Ht,qt=null,Jt="",Gt="",Zt=!1,Xt="",Qt=12,Kt="",te="",ee="#000",re="",ne="start",oe="center",se="multi_line_text",ce="text",ue="",ve=null,ge="",fe="",he="";function me(t){Ut instanceof HTMLInputElement?Ut.selectionStart=Ut.selectionEnd=t:pn(Ut,t)}async function ye(){if(!Ut||!qt)return;qt.overrideRawValue(z),u.set(qt.rawValue),c(s,N=Jt=Gt=qt.value,N);const t=qt.cursorPosition;await $(),document.activeElement===Ut&&me(t)}var be;v((()=>{Rt&&(zt.unregisterFocusable(Rt),Rt=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==Tt&&r.componentContext(Tt),void 0===e.layoutParams&&r.layoutParams&&void 0!==Nt&&r.layoutParams(Nt),Tt.json&&(Xt="",Qt=12,Lt=void 0,Kt="",Wt=void 0,ee="#000",re="",ne="left",oe="center",se="multi_line_text",ce="text",Ht=void 0),i=Tt.json.text_variable,a=null===(Mt=Tt.json.mask)||void 0===Mt?void 0:Mt.raw_text_variable,s=i&&Tt.getVariable(i,"string")||Hr("temp","string",""),ct(),ct=l(s,(t=>N=t)),u=a&&Tt.getVariable(a,"string")||Hr("temp","string",""),vt(),vt=l(u,(t=>z=t)),d=Tt.getDerivedFromVars(Tt.json.hint_text),Ot(),Ot=l(d,(t=>ot=t)),p=Tt.getDerivedFromVars(Tt.json.hint_color),St(),St=l(p,(t=>it=t)),g=Tt.getDerivedFromVars(Tt.json.font_size),Ft(),Ft=l(g,(t=>nt=t)),h=Tt.getDerivedFromVars(Tt.json.font_weight),jt(),jt=l(h,(t=>rt=t)),m=Tt.getDerivedFromVars(Tt.json.font_family),Ct(),Ct=l(m,(t=>et=t)),y=Tt.getDerivedFromVars(Tt.json.line_height),Et(),Et=l(y,(t=>tt=t)),b=Tt.getDerivedFromVars(Tt.json.letter_spacing),kt(),kt=l(b,(t=>K=t)),_=Tt.getDerivedFromVars(Tt.json.text_color),xt(),xt=l(_,(t=>Q=t)),w=Tt.getDerivedFromVars(Tt.json.highlight_color),$t(),$t=l(w,(t=>X=t)),x=Tt.getDerivedFromVars(Tt.json.text_alignment_horizontal),wt(),wt=l(x,(t=>Y=t)),k=Tt.getDerivedFromVars(Tt.json.text_alignment_vertical),_t(),_t=l(k,(t=>Z=t)),E=Tt.getDerivedFromVars(Tt.json.keyboard_type),bt(),bt=l(E,(t=>G=t)),C=Tt.getDerivedFromVars(Tt.json.mask),yt(),yt=l(C,(t=>J=t)),j=Tt.getDerivedFromVars(Tt.json.max_visible_lines),mt(),mt=l(j,(t=>q=t)),A=Tt.getDerivedFromVars(Tt.json.paddings),ht(),ht=l(A,(t=>H=t)),F=Tt.getDerivedFromVars(Tt.json.accessibility),ft(),ft=l(F,(t=>B=t)),V=Tt.getDerivedFromVars(Tt.json.select_all_on_focus),It(),It=l(V,(t=>lt=t)),i?Zt=!1:(Zt=!0,Tt.logError(st(new Error('Missing "text_variable" in "input"')))),"fixed_length"===(null==(be=J)?void 0:be.type)?qt=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 ln(n,e)}return r||null}(be,Tt.logError,qt):"currency"===(null==be?void 0:be.type)&&(qt=function(t,e,r){return r?(r.updateCurrencyParams(t.locale),r):new un(t.locale,e)}(be,Tt.logError,qt)),qt&&ye(),qt||Jt===N||(Jt=Gt=N),qt&&qt.rawValue!==z&&ye(),D=ot,Xt=gt(it,1,Xt),Qt=ae(nt,Qt),Lt=le(rt,Lt),Kt=et&&"string"==typeof et?zt.typefaceProvider(et,{fontWeight:Lt||400}):"";{const t=tt;Yt(t)&&(Wt=t/Qt)}return Dt(K)&&(te=dt(K)),ee=gt(Q,1,ee),re=gt(X,1,re),ne=de(Y,U,ne),oe=pe(Z,oe),G&&G in gn&&(ce=gn[G],se=G),"currency"===(null==J?void 0:J.type)&&(ce=vn?"text":"tel",Ht="decimal"),S="multi_line_text"===se,ue=Yt(q)?`calc(${q*(Wt||1.25)*(Qt/10)+"em"} + ${pt(Pt(null==H?void 0:H.top,0)+Pt(null==H?void 0:H.bottom,0))})`:"",ve=Bt(H||void 0,ve),ge=ve?Vt({top:(Number(ve.top)||0)/Qt*10,right:(Number("ltr"===U?ve.end:ve.start)||Number(ve.right)||0)/Qt*10,bottom:(Number(ve.bottom)||0)/Qt*10,left:(Number("ltr"===U?ve.start:ve.end)||Number(ve.left)||0)/Qt*10},U):"",fe=ve?Vt({top:(Number(ve.top)||0)/Qt*10,bottom:(Number(ve.bottom)||0)/Qt*10},U):"",(null==B?void 0:B.description)?he=B.description:Tt.logError(st(new Error('Missing accessibility "description" for input'),{level:"warn"})),O={"highlight-color":Boolean(re),multiline:S,"alignment-horizontal":ne,"alignment-vertical":oe},P={"--divkit-input-hint-color":Xt,"--divkit-input-highlight-color":re,"--divkit-input-line-height":Wt,"font-weight":Lt,"font-family":Kt,"letter-spacing":te,color:ee,"max-height":ue},M={"font-size":dt(Qt),padding:ge},T={"font-size":dt(Qt),padding:fe},Ut&&Tt.json&&(Rt&&(zt.unregisterFocusable(Rt),Rt=void 0),Tt.json.id&&!Tt.fakeElement&&(Rt=Tt.json.id,zt.registerFocusable(Rt,{focus(){Ut&&Ut.focus()}}))),ct(),vt(),ft(),L(),ht(),mt(),yt(),bt(),_t(),wt(),$t(),xt(),kt(),Et(),Ct(),jt(),Ft(),St(),Ot(),It(),Zt?"":`${R(ie,"Outer").$$render(t,{cls:At("input",en,O),style:P,customDescription:!0,customActions:"input",customPaddings:!0,hasInnerFocusable:!0,componentContext:Tt,layoutParams:Nt},{},{default:({focusHandler:t,blurHandler:e,hasCustomFocus:r})=>{return S?`<span${W("class",en["input__scroll-wrapper"],0)}>${!Gt&&D?`<div${W("class",en.input__placeholder,0)} aria-hidden="true"${W("style",ut(M),0)}>${I(D)}</div>`:""} <span${W("class",en.input__aligner,0)} aria-hidden="true"${W("style",ut(T),0)}>​</span> <span${W("class",At("input__input",en,{"has-custom-focus":r,multiline:!0}),0)} autocapitalize="off" contenteditable="true"${W("aria-label",he,0)}${W("style",ut(M),0)}${W("this",Ut,0)}>${n=Gt,void 0===n?"":n}</span></span>`:`<input${W("type",ce,0)}${W("inputmode",Ht,0)}${W("class",At("input__input",en,{"has-custom-focus":r,singleline:!0}),0)} autocomplete="off" autocapitalize="off"${W("aria-label",he,0)}${W("style",ut(M),0)}${W("placeholder",D,0)}${W("value",Jt,0)}${W("this",Ut,0)}>`;var n}})}`})),hn={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"},mn=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P,M,T,z,B,U=o,L=o,H=o,q=o,J=o,G=o,Z=o,Y=o,X=o,Q=o,K=o,{componentContext:tt}=e,{layoutParams:et}=e;const rt=f(at);let nt;M=l(rt.direction,(t=>P=t));let it,ot,lt=!1,ct="",pt=null,vt="",ft="rgba(0,0,0,.45)",ht=12,mt="",yt="",bt="#000",_t="";v((()=>{nt&&(rt.unregisterFocusable(nt),nt=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),tt.json&&(pt=null,ft="rgba(0,0,0,.45)",ht=12,it=void 0,mt="",ot=void 0,yt="",bt="#000",_t=""),i=tt.json.value_variable,a=tt.json.options,s=Array.isArray(a)&&a.filter((t=>"string"==typeof t.value))||[],c=i&&tt.getVariable(i,"string")||Hr("temp","string",""),Q(),Q=l(c,(t=>z=t)),u=tt.getDerivedFromVars(tt.json.paddings),X(),X=l(u,(t=>T=t)),d=tt.getDerivedFromVars(tt.json.hint_text),K(),K=l(d,(t=>B=t)),p=tt.getDerivedFromVars(tt.json.hint_color),Y(),Y=l(p,(t=>O=t)),g=tt.getDerivedFromVars(tt.json.font_size),Z(),Z=l(g,(t=>S=t)),h=tt.getDerivedFromVars(tt.json.font_weight),G(),G=l(h,(t=>D=t)),m=tt.getDerivedFromVars(tt.json.font_family),J(),J=l(m,(t=>V=t)),y=tt.getDerivedFromVars(tt.json.line_height),q(),q=l(y,(t=>F=t)),b=tt.getDerivedFromVars(tt.json.letter_spacing),H(),H=l(b,(t=>A=t)),_=tt.getDerivedFromVars(tt.json.text_color),L(),L=l(_,(t=>j=t)),w=tt.getDerivedFromVars(tt.json.accessibility),U(),U=l(w,(t=>C=t)),Array.isArray(s)&&s.length||tt.logError(st(new Error('Empty selection "items" in "select"'))),i?lt=!1:(lt=!0,tt.logError(st(new Error('Missing "value_variable" in "select"'))));{const t=s.find((t=>t.value===z));t?ct=("string"==typeof t.text?t.text:t.value)||"":(ct="",z&&tt.logError(st(new Error('Value from the variable was not found in the selection items for "select"'))))}ht=ae(S,ht),pt=Bt(T||void 0,pt),vt=pt?Vt({top:(Number(pt.top)||0)/ht*10,right:(Number("ltr"===P?pt.end:pt.start)||Number(pt.right)||0)/ht*10,bottom:(Number(pt.bottom)||0)/ht*10,left:(Number("ltr"===P?pt.start:pt.end)||Number(pt.left)||0)/ht*10},P):"",ft=gt(O,1,ft),it=le(D,it),mt=V&&"string"==typeof V?rt.typefaceProvider(V,{fontWeight:it||400}):"";{const t=F;Yt(t)&&(ot=t/ht)}return Dt(A)&&(yt=dt(A/ht*10)),bt=gt(j,1,bt),(null==C?void 0:C.description)?_t=C.description:tt.logError(st(new Error('Missing accessibility "description" for select'),{level:"warn"})),$={hint:!ct},x={"--divkit-input-hint-color":ft,"font-weight":it,"font-family":mt,color:bt},k={padding:vt,"font-size":dt(ht),"line-height":ot,"letter-spacing":yt},E={"font-size":dt(ht),"line-height":ot,"letter-spacing":yt},tt.json,U(),L(),H(),q(),J(),G(),Z(),Y(),M(),X(),Q(),K(),lt?"":`${R(ie,"Outer").$$render(t,{cls:At("select",hn,$),style:x,customDescription:!0,customActions:"select",customPaddings:!0,hasInnerFocusable:!0,componentContext:tt,layoutParams:et},{},{default:({hasCustomFocus:t,focusHandler:e,blurHandler:r})=>`<span${W("class",hn["select__select-text"],0)}${W("style",ut(k),0)} aria-hidden="true"> ${I(ct||B||"​")}</span> <select${W("class",At("select__select",hn,{"has-custom-focus":t}),0)}${W("aria-label",_t,0)}${W("style",ut(E),0)}${W("this",undefined,0)}>${N(s,(t=>`<option${W("class",hn.select__option,0)}${W("value",t.value,0)}>${I(t.text||t.value)}</option>`))}</select>`})}`})),yn={video__video:"divkit-c11f9","video__aspect-wrapper":"divkit-cfe32",video_aspect:"divkit-a4f5c"},bn=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C=o,j=o,A=o,F=o,V=o,D=o,S=o,{componentContext:O}=e,{layoutParams:P}=e;const I=f(at);let M,T,z,B,U=!1,L=!1,H=[],J=!1,G=!1,Z=!1,Y="fit",X="0";function Q(){const t=null==T?void 0:T.play();t&&t.catch((t=>{O.logError(st(new Error("Video playing error"),{level:"error",additional:{originalText:String(t)}}))}))}var K,tt;v((()=>{M&&(I.unregisterInstance(M),M=void 0),B&&(B(),B=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==O&&r.componentContext(O),void 0===e.layoutParams&&r.layoutParams&&void 0!==P&&r.layoutParams(P),O.json&&(J=!1,G=!1,Z=!1,z=void 0,Y="fit"),i=O.json.elapsed_time_variable,a=i&&O.getVariable(i,"integer")||Hr("temp","integer",0),a&&(B&&B(),B=a.subscribe((function(t){L?L=!1:T&&(T.currentTime=Number(t)/1e3)}))),s=O.getDerivedFromVars(O.json.video_sources),S(),S=l(s,(t=>E=t)),c=O.getDerivedFromVars(O.json.repeatable),D(),D=l(c,(t=>k=t)),u=O.getDerivedFromVars(O.json.autostart),C(),C=l(u,(t=>b=t)),d=O.getDerivedFromVars(O.json.muted),V(),V=l(d,(t=>x=t)),p=O.getDerivedFromVars(O.json.preview),F(),F=l(p,(t=>$=t)),g=O.getDerivedFromVars(O.json.scale),A(),A=l(g,(t=>w=t)),h=O.getDerivedFromVars(O.json.aspect),j(),j=l(h,(t=>_=t)),K=E,tt=H,H=Array.isArray(K)&&K.length?K.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})):tt,H.length?U=!1:(U=!0,O.logError(st(new Error('Missing "video_sources" in "video"')))),J=ve(k,J),G=ve(b,G),Z=ve(x,Z),z="string"==typeof $?Re($):z,Y=function(t){return"fill"===t?"cover":"no_scale"===t?"none":"contain"}(w)||Y;{const t=null==_?void 0:_.ratio;X=t&&Yt(t)?(100/Number(t)).toFixed(2):"0"}return O.json&&(M&&(I.unregisterInstance(M),M=void 0),!O.json.id||U||O.fakeElement||(M=O.json.id,I.registerInstance(M,{pause:function(){null==T||T.pause()},start:Q}))),O.json&&b&&T&&Q(),m={aspect:"0"!==X},y={"object-fit":Y},C(),j(),A(),F(),V(),D(),S(),U?"":`${R(ie,"Outer").$$render(t,{cls:At("video",yn,m),customActions:"video",componentContext:O,layoutParams:P},{},{default:()=>m.aspect?`<div${W("class",yn["video__aspect-wrapper"],0)}${q({"padding-bottom":`${X}%`})}><video${W("class",yn.video__video,0)}${W("style",ut(y),0)} playsinline ${J?"loop":""} ${G?"autoplay":""} ${Z?"muted":""}${W("poster",z,0)}${W("this",T,0)}>${N(H,(t=>`<source${W("src",t.src,0)}${W("type",t.type,0)}>`))}</video></div>`:`<video${W("class",yn.video__video,0)}${W("style",ut(y),0)} playsinline ${J?"loop":""} ${G?"autoplay":""} ${Z?"muted":""}${W("poster",z,0)}${W("this",T,0)}>${N(H,(t=>`<source${W("src",t.src,0)}${W("type",t.type,0)}>`))}</video>`})}`})),_n=bn,wn=L(((t,e,r,n)=>{let i,o;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 i=s.json.items,void 0===i||Array.isArray(i)?v=!1:(v=!0,s.logError(st(new Error('Incorrect "items" prop for div "custom"')))),o=(!v&&i||[]).map(((t,e)=>s.produceChildContext(t,{path:e}))),u?`${R(ie,"Outer").$$render(t,{componentContext:s,layoutParams:l},{},{default:()=>{return(e=u.element)?`<${u.element}${S([T(s.json.custom_props||{})],{})}${W("this",undefined,0)}>${V(e)?"":`${d?`<template${S([T(p)],{})}> ${d}</template>`:""} ${!v&&i?`${N(o,(e=>`${R(kn,"Unknown").$$render(t,{componentContext:e},{},{})}`))}`:""}`}${V(e)?"":`</${e}>`}`:"";var e}})}`:""})),$n=wn,xn={};xn.text=he,xn.container=Ie,xn.separator=Ne,xn.image=Ue,xn.gif=Ue,xn.grid=Ge,xn.gallery=nr,xn.tabs=ar,xn.state=hr,xn.pager=br,xn.indicator=xr,xn.slider=tn,xn.input=fn,xn.select=mn,xn.video=_n,xn.custom=$n;const kn=L(((t,e,r,n)=>{let{componentContext:i}=e,{layoutParams:o}=e;const a=f(at);let s;void 0===e.componentContext&&r.componentContext&&void 0!==i&&r.componentContext(i),void 0===e.layoutParams&&r.layoutParams&&void 0!==o&&r.layoutParams(o);{const t=i.json;if(s=(null==t?void 0:t.type)&&xn[t.type]||void 0,!s){let e;e=(null==t?void 0:t.type)&&a.hasTemplate(t.type)?"Recursive template":"Unknown component",i.logError(st(new Error(e),{additional:{component:(null==t?void 0:t.type)||"<missing>"}}))}}return s?`${R(s||z,"svelte:component").$$render(t,{componentContext:i,layoutParams:o},{},{})}`:""})),En=L(((t,e,r,n)=>{let{svgFiltersMap:i}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==i&&r.svgFiltersMap(i),Object.keys(i).length?`<svg${W("class","divkit-dc22b",0)} aria-hidden="true"><defs>${N([...Object.keys(i)],(t=>{let[e,r]=t.split(":");return` <filter${W("id",i[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 Cn(t,e,r,n){const i=r[t.type];if(!i)return n(st(new Error("No such template"),{additional:{template:t.type}})),{json:t,templateContext:e};let o;const a={};for(o in e)e.hasOwnProperty(o)&&(a[o]=e[o]);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(a[o]=t[o]);const s=function t(e,r){const n=Object.keys(r).filter((t=>"__proto__"!==t)),i=n.filter((t=>"$"!==t.charAt(0))),o=n.filter((t=>"$"===t.charAt(0)));return i.forEach((n=>{const i=r[n];"object"==typeof i&&null!==i?(e[n]=Array.isArray(i)?[]:{},t(e[n],i)):e[n]=i})),o.forEach((t=>{const n=r[t],i=a[n];if(void 0!==i){const r=t.substring(1);e[r]=i}})),e}({},i);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(s[o]=t[o]);return{json:s,templateContext:a}}function jn(){}function An(t){return{subscribe:e=>(e(t),jn)}}function Fn(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function Vn(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function Dn(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 Sn(t){try{return Dr(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function On(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function Pn(t,e,r,n){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,Pn.prototype),i.expected=e,i.found=r,i.location=n,i.name="SyntaxError",i}function In(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}An(void 0),function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(Pn,Error),Pn.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 i=this.location.start,o=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,a=this.location.source+":"+o.line+":"+o.column;if(n){var s=this.location.end,l=In("",o.line.toString().length," "),c=n[i.line-1],u=(i.line===s.line?s.column:c.length+1)-i.column||1;e+="\n --\x3e "+a+"\n"+l+" |\n"+o.line+" | "+c+"\n"+l+" | "+In("",i.column-1," ")+In("",u,"^")}else e+="\n at "+a}return e},Pn.buildMessage=function(t,e){var r={literal:function(t){return'"'+i(t.text)+'"'},class:function(t){var e=t.parts.map((function(t){return Array.isArray(t)?o(t[0])+"-"+o(t[1]):o(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 i(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 o(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?'"'+i(t)+'"':"end of input"}(e)+" found."};const Mn=new Map,Tn=new Map;function Nn(t,e,r){const n={args:e,cb:r},i=Mn.get(t)||[];Mn.has(t)||Mn.set(t,i),i.push(n);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");Tn.set(o,n)}function zn(t,e){let r=t.args.length,n=t.args.length;const i=t.args[t.args.length-1];if("object"==typeof i&&i.isVararg&&(--r,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!==e[r].type)return{type:"mismatch",expected:n.type,found:e[r].type}}return{type:"match"}}function Rn(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=>{Rn(t,e)}));break;case"BinaryExpression":case"LogicalExpression":Rn(t.left,e),Rn(t.right,e);break;case"UnaryExpression":Rn(t.argument,e);break;case"ConditionalExpression":Rn(t.test,e),Rn(t.consequent,e),Rn(t.alternate,e);break;case"TryExpression":Rn(t.test,e),Rn(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{Rn(t,e)}))}}function Bn(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function Un(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function Ln(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 Un(t.value);if("color"===t.type)return Xn(Yn(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 Wn(t){let e=Ln(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"),e}function Hn(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function qn(t,e){if(jr)return Dr(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function Jn(t,e){if(e<Vr||e>Fr)throw new Error("Integer overflow.");!jr&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function Gn(t){const e=[];return Rn(t,{Variable(t){e.push(t.id.name)}}),e}function Zn(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function Yn(t){const e=ft(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function Xn(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 Qn(t){return Xn(Yn(t))}const Kn=Number.MAX_VALUE,ti=Number.MIN_VALUE,ei="string",ri="integer",ni="number",ii="boolean",oi="color",ai="url",si="datetime",li="dict",ci="array";function ui(t,e){return{type:ei,value:Ln(e)}}function di(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:ni,value:r}}function pi(t,e,r,n){const i=t.variables.get(e.value);let o;return o=i&&i.getType()===n?i.getValue():r.value,"color"===n&&(o=Qn(o)),{type:n,value:o}}function vi(t,e,r){return pi(t,e,r,r.type)}function gi(t,e,r){return pi(t,e,r,"color")}function fi(t,e,r){return pi(t,e,r,"url")}const hi=t=>(e,r)=>{let n=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++n:"getUTCDay"===t&&0===n&&(n=7),{type:ri,value:Dr(n)}},mi=hi("getUTCFullYear"),yi=hi("getUTCMonth"),bi=hi("getUTCDate"),_i=hi("getUTCDay"),wi=hi("getUTCHours"),$i=hi("getUTCMinutes"),xi=hi("getUTCSeconds"),ki=hi("getUTCMilliseconds");function Ei(t,e,r,n){if(!n.value.length)return t.warnings.push(st(new Error("String for padding is empty."),{level:"warn"})),"";let i="";const o=e.type===ei?e.value:Ln(e);for(;i.length+o.length<r.value;)i+=n.value;return i.length>0&&i.length+o.length>r.value&&(i=i.substring(0,Number(r.value)-Number(o.length))),i}function Ci(t,e,r,n){const i=Ei(t,e,r,n);return{type:ei,value:i+Ln(e)}}function ji(t,e,r,n){const i=Ei(t,e,r,n);return{type:ei,value:Ln(e)+i}}function Ai(t){return(e,r)=>{const n=Yn(r.value);return{type:ni,value:n[t]/255}}}function Fi(t){return(e,r,n)=>{const i=Yn(r.value);return i[t]=255*n.value,{type:oi,value:Xn(i)}}}const Vi=Ai("a"),Di=Ai("r"),Si=Ai("g"),Oi=Ai("b"),Pi=Fi("a"),Ii=Fi("r"),Mi=Fi("g"),Ti=Fi("b");function Ni(t,e,r,n){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let i=Dr(e.value)/Dr(r);return Jn(t,i),"number"==typeof i&&(i=Math.floor(i)),n&&(i=Dr(i)%Dr(n)),{type:ri,value:i}}const zi=36e5;function Ri(t,e){return(r,n,...i)=>{let o=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}(n.value,i.map((t=>t.value))),a=typeof o;if("array"===t&&!Array.isArray(o)||"array"!==t&&a!==t||"object"===a&&null===o)throw"object"===a&&(a=Array.isArray(o)?"array":null===o?"null":"dict"),new Error(`Incorrect value type: expected "${e}", got "${a}".`);if("number"===t&&"integer"===e){Jn(r,o);try{o=Dr(o)}catch(t){throw new Error("Cannot convert value to integer.")}}return"string"===t&&"color"===e&&(o=Qn(o)),{type:e,value:o}}}function Bi(t,e){return(r,n,i,...o)=>{try{return t(r,i,...o)}catch(t){let r=n.value;return"color"===e&&(r=Qn(r)),{type:e,value:r}}}}const Ui=Ri("string","string"),Li=Ri("number","number"),Wi=Ri("number","integer"),Hi=Ri("boolean","boolean"),qi=Ri("string","color"),Ji=Ri("string","url"),Gi=Ri("array","array"),Zi=Ri("object","dict"),Yi=Bi(Ui,"string"),Xi=Bi(Li,"number"),Qi=Bi(Wi,"integer"),Ki=Bi(Hi,"boolean"),to=Bi(qi,"color"),eo=Bi(Ji,"url");function ro(t,e){return(r,n,i)=>{if(i.value<0||i.value>=n.value.length)throw new Error(`Requested index (${i.value}) out of bounds array size (${n.value.length}).`);let o=n.value[Number(i.value)],a=typeof o;if("array"===t&&!Array.isArray(o)||"array"!==t&&a!==t||"object"===a&&null===o)throw"object"===a&&(a=Array.isArray(o)?"array":null===o?"null":"dict"),new Error(`Incorrect value type: expected "${e}", got "${a}".`);if("number"===t&&"integer"===e){Jn(r,o);try{o=Dr(o)}catch(t){throw new Error("Cannot convert value to integer.")}}return"string"===t&&"color"===e&&(o=Qn(o)),{type:e,value:o}}}function no(t,e){return(r,n,i,o)=>{try{return t(r,n,i)}catch(t){let r=o.value;return"color"===e&&(r=Qn(r)),{type:e,value:r}}}}const io=ro("string","string"),oo=ro("number","number"),ao=ro("number","integer"),so=ro("boolean","boolean"),lo=ro("string","color"),co=ro("string","url"),uo=ro("array","array"),po=ro("object","dict"),vo=no(io,"string"),go=no(oo,"number"),fo=no(ao,"integer"),ho=no(so,"boolean"),mo=no(lo,"color"),yo=no(co,"url");function bo(t){return t.map(Wn).join(", ")}Nn("toString",[ri],ui),Nn("toString",[ni],ui),Nn("toString",[ii],ui),Nn("toString",[oi],ui),Nn("toString",[ai],ui),Nn("toNumber",[ri],di),Nn("toNumber",[ei],di),Nn("toInteger",[ni],(function(t,e){if(e.value>Fr||e.value<Vr)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:ri,value:Dr(r)}})),Nn("toInteger",[ei],(function(t,e){let r;try{r=Dr(e.value)}catch(t){throw new Error("Unable to convert value to Integer.")}return{type:ri,value:r}})),Nn("toInteger",[ii],(function(t,e){return{type:ri,value:Dr(e.value?1:0)}})),Nn("toBoolean",[ri],(function(t,e){const r=Number(e.value);if(1!==r&&0!==r)throw new Error("Unable to convert value to Boolean.");return{type:ii,value:r}})),Nn("toBoolean",[ei],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:ii,value:"true"===e.value?1:0}})),Nn("toColor",[ei],(function(t,e){return{type:oi,value:Qn(e.value)}})),Nn("toUrl",[ei],(function(t,e){return{type:ai,value:e.value}})),Nn("encodeUri",[ei],(function(t,e){try{return{type:ei,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),Nn("decodeUri",[ei],(function(t,e){try{return{type:ei,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),Nn("getIntegerValue",[ei,ri],vi),Nn("getNumberValue",[ei,ni],vi),Nn("getBooleanValue",[ei,ii],vi),Nn("getStringValue",[ei,ei],vi),Nn("getColorValue",[ei,oi],gi),Nn("getColorValue",[ei,ei],gi),Nn("getUrlValue",[ei,ai],fi),Nn("getUrlValue",[ei,ei],fi),Nn("parseUnixTime",[ri],(function(t,e){return{type:si,value:new Date(1e3*Number(e.value))}})),Nn("nowLocal",[],(function(){return{type:si,value:new Date}})),Nn("addMillis",[si,ri],(function(t,e,r){return{type:si,value:new Date(e.value.getTime()+Number(r.value))}})),Nn("setYear",[si,ri],(function(t,e,r){const n=new Date(e.value);return n.setUTCFullYear(Number(r.value)),{type:si,value:n}})),Nn("setMonth",[si,ri],(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 i=new Date(e.value);return i.setUTCMonth(n-1),{type:si,value:i}})),Nn("setDay",[si,ri],(function(t,e,r){const n=new Date(e.value),i=Number(r.value);if(i<=0&&-1!==i||i>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 ${i} for date ${Ln(e)}.`);return n.setUTCDate(-1===i?0:i),{type:si,value:n}})),Nn("setHours",[si,ri],(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 i=new Date(e.value);return i.setUTCHours(n),{type:si,value:i}})),Nn("setMinutes",[si,ri],(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 i=new Date(e.value);return i.setUTCMinutes(n),{type:si,value:i}})),Nn("setSeconds",[si,ri],(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 i=new Date(e.value);return i.setUTCSeconds(n),{type:si,value:i}})),Nn("setMillis",[si,ri],(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 i=new Date(e.value);return i.setUTCMilliseconds(n),{type:si,value:i}})),Nn("getYear",[si],mi),Nn("getMonth",[si],yi),Nn("getDay",[si],bi),Nn("getDayOfWeek",[si],_i),Nn("getHours",[si],wi),Nn("getMinutes",[si],$i),Nn("getSeconds",[si],xi),Nn("getMillis",[si],ki),Nn("getIntervalSeconds",[ri],(function(t,e){return Ni(t,e,1e3,60)})),Nn("getIntervalTotalSeconds",[ri],(function(t,e){return Ni(t,e,1e3)})),Nn("getIntervalMinutes",[ri],(function(t,e){return Ni(t,e,6e4,60)})),Nn("getIntervalTotalMinutes",[ri],(function(t,e){return Ni(t,e,6e4)})),Nn("getIntervalHours",[ri],(function(t,e){return Ni(t,e,zi,24)})),Nn("getIntervalTotalHours",[ri],(function(t,e){return Ni(t,e,zi)})),Nn("getIntervalTotalDays",[ri],(function(t,e){return Ni(t,e,864e5)})),Nn("getIntervalTotalWeeks",[ri],(function(t,e){return Ni(t,e,6048e5)})),Nn("len",[ei],(function(t,e){return{type:ri,value:Dr(e.value.length)}})),Nn("contains",[ei,ei],(function(t,e,r){return{type:ii,value:e.value.includes(r.value)?1:0}})),Nn("substring",[ei,ri,ri],(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:ei,value:e.value.substring(Number(r.value),Number(n.value))}})),Nn("replaceAll",[ei,ei,ei],(function(t,e,r,n){let i;return i=r.value?e.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(r.value),"g"),n.value):e.value,{type:ei,value:i}})),Nn("index",[ei,ei],(function(t,e,r){return{type:ri,value:Dr(e.value.indexOf(r.value))}})),Nn("lastIndex",[ei,ei],(function(t,e,r){return{type:ri,value:Dr(e.value.lastIndexOf(r.value))}})),Nn("trim",[ei],(function(t,e){return{type:ei,value:e.value.trim()}})),Nn("trimLeft",[ei],(function(t,e){return{type:ei,value:e.value.replace(/^\s+/,"")}})),Nn("trimRight",[ei],(function(t,e){return{type:ei,value:e.value.replace(/\s+$/,"")}})),Nn("toUpperCase",[ei],(function(t,e){return{type:ei,value:e.value.toUpperCase()}})),Nn("toLowerCase",[ei],(function(t,e){return{type:ei,value:e.value.toLowerCase()}})),Nn("padStart",[ei,ri,ei],Ci),Nn("padStart",[ri,ri,ei],Ci),Nn("padEnd",[ei,ri,ei],ji),Nn("padEnd",[ri,ri,ei],ji),Nn("testRegex",[ei,ei],(function(t,e,r){let n;try{n=new RegExp(r.value)}catch(t){throw new Error("Invalid regular expression.")}return{type:ii,value:n.test(e.value)?1:0}})),Nn("div",[ri,ri],(function(t,e,r){if(r.value===Sr)throw new Error("Division by zero is not supported.");let n=e.value/r.value;return n=qn(0,n),Jn(t,n),{type:ri,value:n}})),Nn("div",[ni,ni],(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:ni,value:n}})),Nn("mod",[ri,ri],(function(t,e,r){if(r.value===Sr)throw new Error("Division by zero is not supported.");let n=e.value%r.value;return n=qn(0,n),Jn(t,n),{type:ri,value:n}})),Nn("mod",[ni,ni],(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:ni,value:n}})),Nn("mul",[{type:ri,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Sr;for(let n=1;n<e.length;++n)r*=e[n].value,r=qn(0,r),Jn(t,r);return{type:ri,value:r}})),Nn("mul",[{type:ni,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:ni,value:r}})),Nn("sub",[{type:ri,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Sr;for(let n=1;n<e.length;++n)r-=e[n].value,r=qn(0,r),Jn(t,r);return{type:ri,value:r}})),Nn("sub",[{type:ni,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:ni,value:r}})),Nn("sum",[{type:ri,isVararg:!0}],(function(t,...e){let r=Sr;for(let n=0;n<e.length;++n)r+=e[n].value,r=qn(0,r),Jn(t,r);return{type:ri,value:r}})),Nn("sum",[{type:ni,isVararg:!0}],(function(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value;return{type:ni,value:r}})),Nn("abs",[ri],(function(t,e){const r=Or(e.value);return Jn(t,r),{type:e.type,value:r}})),Nn("abs",[ni],(function(t,e){const r=Math.abs(e.value);return{type:ni,value:r}})),Nn("max",[{type:ri,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:ri,value:r}})),Nn("max",[{type:ni,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:ni,value:Math.max(...e.map((t=>t.value)))}})),Nn("min",[{type:ri,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:ri,value:r}})),Nn("min",[{type:ni,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:ni,value:Math.min(...e.map((t=>t.value)))}})),Nn("maxNumber",[],(function(){return{type:ni,value:Kn}})),Nn("minNumber",[],(function(){return{type:ni,value:ti}})),Nn("maxInteger",[],(function(t){return Jn(t,Fr),{type:ri,value:Fr}})),Nn("minInteger",[],(function(t){return Jn(t,Vr),{type:ri,value:Vr}})),Nn("round",[ni],(function(t,e){const r=Math.sign(e.value);return{type:ni,value:r*Math.round(Math.abs(e.value))}})),Nn("floor",[ni],(function(t,e){return{type:ni,value:Math.floor(e.value)}})),Nn("ceil",[ni],(function(t,e){return{type:ni,value:Math.ceil(e.value)}})),Nn("signum",[ri],(function(t,e){return{type:ri,value:Pr(e.value)}})),Nn("signum",[ni],(function(t,e){return{type:ni,value:Math.sign(e.value)}})),Nn("copySign",[ri,ri],(function(t,e,r){let n;if(r.value===Sr)n=e.value;else if(e.value===Sr)n=Dr(0);else{const t=Pr(r.value);n=Or(e.value)*t}return Jn(t,n),{type:ri,value:n}})),Nn("copySign",[ni,ni],(function(t,e,r){let n=Math.sign(r.value);0===n&&(n=Object.is(n,0)?1:-1);const i=Math.abs(e.value)*n;return{type:ni,value:i}})),Nn("getColorAlpha",[ei],Vi),Nn("getColorAlpha",[oi],Vi),Nn("getColorRed",[ei],Di),Nn("getColorRed",[oi],Di),Nn("getColorGreen",[ei],Si),Nn("getColorGreen",[oi],Si),Nn("getColorBlue",[ei],Oi),Nn("getColorBlue",[oi],Oi),Nn("setColorAlpha",[ei,ni],Pi),Nn("setColorAlpha",[oi,ni],Pi),Nn("setColorRed",[ei,ni],Ii),Nn("setColorRed",[oi,ni],Ii),Nn("setColorGreen",[ei,ni],Mi),Nn("setColorGreen",[oi,ni],Mi),Nn("setColorBlue",[ei,ni],Ti),Nn("setColorBlue",[oi,ni],Ti),Nn("rgb",[ni,ni,ni],(function(t,e,r,n){const i={a:255,r:255*e.value,g:255*r.value,b:255*n.value};return{type:oi,value:Xn(i)}})),Nn("argb",[ni,ni,ni,ni],(function(t,e,r,n,i){const o={a:255*e.value,r:255*r.value,g:255*n.value,b:255*i.value};return{type:oi,value:Xn(o)}})),Nn("getDictString",[li,{type:ei,isVararg:!0}],Ui),Nn("getStringFromDict",[li,{type:ei,isVararg:!0}],Ui),Nn("getDictNumber",[li,{type:ei,isVararg:!0}],Li),Nn("getNumberFromDict",[li,{type:ei,isVararg:!0}],Li),Nn("getDictInteger",[li,{type:ei,isVararg:!0}],Wi),Nn("getIntegerFromDict",[li,{type:ei,isVararg:!0}],Wi),Nn("getDictBoolean",[li,{type:ei,isVararg:!0}],Hi),Nn("getBooleanFromDict",[li,{type:ei,isVararg:!0}],Hi),Nn("getDictColor",[li,{type:ei,isVararg:!0}],qi),Nn("getColorFromDict",[li,{type:ei,isVararg:!0}],qi),Nn("getDictUrl",[li,{type:ei,isVararg:!0}],Ji),Nn("getUrlFromDict",[li,{type:ei,isVararg:!0}],Ji),Nn("getDictOptString",[ei,li,{type:ei,isVararg:!0}],Yi),Nn("getOptStringFromDict",[ei,li,{type:ei,isVararg:!0}],Yi),Nn("getDictOptNumber",[ni,li,{type:ei,isVararg:!0}],Xi),Nn("getOptNumberFromDict",[ni,li,{type:ei,isVararg:!0}],Xi),Nn("getDictOptInteger",[ri,li,{type:ei,isVararg:!0}],Qi),Nn("getOptIntegerFromDict",[ri,li,{type:ei,isVararg:!0}],Qi),Nn("getDictOptBoolean",[ii,li,{type:ei,isVararg:!0}],Ki),Nn("getOptBooleanFromDict",[ii,li,{type:ei,isVararg:!0}],Ki),Nn("getDictOptColor",[oi,li,{type:ei,isVararg:!0}],to),Nn("getOptColorFromDict",[oi,li,{type:ei,isVararg:!0}],to),Nn("getDictOptColor",[ei,li,{type:ei,isVararg:!0}],to),Nn("getOptColorFromDict",[ei,li,{type:ei,isVararg:!0}],to),Nn("getDictOptUrl",[ei,li,{type:ei,isVararg:!0}],eo),Nn("getOptUrlFromDict",[ei,li,{type:ei,isVararg:!0}],eo),Nn("getDictOptUrl",[ai,li,{type:ei,isVararg:!0}],eo),Nn("getOptUrlFromDict",[ai,li,{type:ei,isVararg:!0}],eo),Nn("getDictFromDict",[li,{type:ei,isVararg:!0}],Zi),Nn("getArrayFromDict",[li,{type:ei,isVararg:!0}],Gi),Nn("getOptArrayFromDict",[li,{type:ei,isVararg:!0}],(function(t,e,...r){try{return Gi(t,e,...r)}catch(t){return{type:ci,value:[]}}})),Nn("getOptDictFromDict",[li,{type:ei,isVararg:!0}],(function(t,e,...r){try{return Zi(t,e,...r)}catch(t){return{type:li,value:{}}}})),Nn("getArrayString",[ci,ri],io),Nn("getStringFromArray",[ci,ri],io),Nn("getArrayNumber",[ci,ri],oo),Nn("getNumberFromArray",[ci,ri],oo),Nn("getArrayInteger",[ci,ri],ao),Nn("getIntegerFromArray",[ci,ri],ao),Nn("getArrayBoolean",[ci,ri],so),Nn("getBooleanFromArray",[ci,ri],so),Nn("getArrayColor",[ci,ri],lo),Nn("getColorFromArray",[ci,ri],lo),Nn("getArrayUrl",[ci,ri],co),Nn("getUrlFromArray",[ci,ri],co),Nn("getArrayFromArray",[ci,ri],uo),Nn("getDictFromArray",[ci,ri],po),Nn("getArrayOptString",[ci,ri,ei],vo),Nn("getOptStringFromArray",[ci,ri,ei],vo),Nn("getArrayOptNumber",[ci,ri,ni],go),Nn("getOptNumberFromArray",[ci,ri,ni],go),Nn("getArrayOptInteger",[ci,ri,ri],fo),Nn("getOptIntegerFromArray",[ci,ri,ri],fo),Nn("getArrayOptBoolean",[ci,ri,ii],ho),Nn("getOptBooleanFromArray",[ci,ri,ii],ho),Nn("getArrayOptColor",[ci,ri,oi],mo),Nn("getOptColorFromArray",[ci,ri,oi],mo),Nn("getArrayOptColor",[ci,ri,ei],mo),Nn("getOptColorFromArray",[ci,ri,ei],mo),Nn("getArrayOptUrl",[ci,ri,ai],yo),Nn("getOptUrlFromArray",[ci,ri,ai],yo),Nn("getArrayOptUrl",[ci,ri,ei],yo),Nn("getOptUrlFromArray",[ci,ri,ei],yo),Nn("getOptArrayFromArray",[ci,ri],(function(t,e,r){try{return uo(t,e,r)}catch(t){return{type:ci,value:[]}}})),Nn("getOptDictFromArray",[ci,ri],(function(t,e,r){try{return po(t,e,r)}catch(t){return{type:li,value:{}}}})),Nn("len",[ci],(function(t,e){return{type:ri,value:Dr(e.value.length)}}));const _o={StringLiteral:function(t,e){return{type:ei,value:e.value}},NumberLiteral:function(t,e){return{type:ni,value:e.value}},IntegerLiteral:function(t,e){return Jn(t,e.value),{type:ri,value:e.value}},BooleanLiteral:function(t,e){return{type:ii,value:e.value?1:0}},UnaryExpression:function(t,e){const r=Bn(wo(t,e.argument));switch(e.operator){case"!":if(r.type===ii)return{type:ii,value:r.value?0:1};Zn(`${e.operator}${Wn(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const n="+"===e.operator?1:-1;if(r.type===ri){const e=r.value*Dr(n);return Jn(t,e),{type:ri,value:e}}if(r.type===ni)return{type:ni,value:r.value*n};Zn(`${e.operator}${Wn(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=Bn(wo(t,e.test));if(r.type===ii)return r.value?wo(t,e.consequent):wo(t,e.alternate);Zn(`${Wn(r)} ? ${Wn(wo(t,e.consequent))} : ${Wn(wo(t,e.alternate))}`,"Ternary must be called with a Boolean value as a condition.")},TryExpression:function(t,e){try{return wo(t,e.test)}catch(r){return wo(t,e.alternate)}},TemplateLiteral:function(t,e){let r="";if(2===e.quasis.length&&""===e.quasis[0].value&&""===e.quasis[1].value)return wo(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=Ln(wo(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:ei,value:r}},LogicalExpression:function(t,e){const r=Bn(wo(t,e.left));if(r.type!==ii&&Zn(`${Wn(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:ii,value:0};const n=Bn(wo(t,e.right));return n.type!==ii&&Zn(`${Wn(r)} ${e.operator} ${Wn(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${Hn(n.type)}.`),{type:ii,value:n.value}},BinaryExpression:function(t,e){const r=e.operator,n=wo(t,e.left),i=wo(t,e.right);if(n.type!==i.type&&Zn(`${Wn(n)} ${e.operator} ${Wn(i)}`,`Operator '${r}' cannot be applied to different types: ${Hn(n.type)} and ${Hn(i.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===si&&r.type===si?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:ii,value:n?1:0}}(r,n,i);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==ni&&e.type!==ri&&e.type!==si&&Zn(`${Wn(e)} ${t} ${Wn(r)}`,`Operator '${t}' cannot be applied to ${Hn(e.type)} type.`);const i=e.type===si?e.value.getTime():e.value,o=r.type===si?r.value.getTime():r.value;return n=">"===t?i>o:">="===t?i>=o:"<"===t?i<o:i<=o,{type:ii,value:n?1:0}}(r,n,i);if("+"===r||"-"===r)return function(t,e,r,n){if(r.type!==ei&&r.type!==ni&&r.type!==ri&&Zn(`${Wn(r)} ${e} ${Wn(n)}`,`Operator '${e}' cannot be applied to ${Hn(r.type)} type.`),r.type===ei)return"-"===e&&Zn(`${Wn(r)} - ${Wn(n)}`,`Operator '${e}' cannot be applied to ${Hn(r.type)} type.`),{type:ei,value:r.value+n.value};let i="+"===e?r.value+n.value:r.value-n.value;if(r.type===ri)try{i=qn(0,i),Jn(t,i)}catch(t){Zn(`${Wn(r)} ${e} ${Wn(n)}`,t.message)}return{type:r.type,value:i}}(t,r,n,i);if("/"===r||"*"===r||"%"===r)return function(t,e,r,n){let i;if(r.type!==ri&&r.type!==ni&&Zn(`${Wn(r)} ${e} ${Wn(n)}`,`Operator '${e}' cannot be applied to ${Hn(r.type)} type.`),"*"===e)i=r.value*n.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(n.value)&&Zn(`${Wn(r)} ${e} ${Wn(n)}`,"Division by zero is not supported."),i="/"===e?r.value/n.value:r.value%n.value}if(r.type===ri)try{i=qn(0,i),Jn(t,i)}catch(t){Zn(`${Wn(r)} ${e} ${Wn(n)}`,t.message)}return{type:r.type,value:i}}(t,r,n,i);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;let n;const i=e.arguments.map((e=>wo(t,e))),o=r+":"+i.map((t=>t.type)).join("#");if(Tn.has(o))n=Tn.get(o);else{const t=function(t,e){const r=Mn.get(t);if(!r)return{type:"missing"};let n=null;for(let t=0;t<r.length;++t){const i=zn(r[t],e);if("match"===i.type)return r[t];n||(n=i)}if(!n)throw new Error("Missing function");return n}(r,i);if("expected"in t||"type"in t&&"missing"===t.type){const e=i.map((t=>Hn(t.type))).join(", "),n=`${r}(${bo(i)})`;"few"===t.type&&0===i.length?Zn(n,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?Zn(n,`Function '${r}' has no matching override for given argument types: ${e}.`):Zn(n,`Unknown function name: ${r}.`)}n=t}if(!n)throw new Error("Function not found");try{return n.cb(t,...i)}catch(t){Zn(`${r}(${bo(i)})`,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 wo(t,e){if(e.type in _o)return _o[e.type](t,e);throw new Error("Unsupported expression")}class $o{constructor(t){this.ast=t}apply(t,e,r=!1){try{const n=function(t,e){try{const r={variables:t,warnings:[],safeIntegerOverflow:!1},n=wo(r,e);return r.safeIntegerOverflow&&r.warnings.push(st(new Error("Safe integer overflow, values may lose accuracy."),{level:"warn"})),{result:n,warnings:r.warnings}}catch(t){return{result:{type:"error",value:t.message},warnings:[]}}}(t,this.ast);n.warnings.forEach(e);const i=n.result;if("error"===i.type)return void e(st(new Error("Expression execution error"),{additional:{message:i.value}}));const o=i.value;if(o instanceof Date)return Un(o);if("boolean"===i.type)return Boolean(o);if("color"===i.type){const t=ft(String(o));if(t)return Xn(t);e(st(new Error("Expression execution error")))}if("integer"===i.type)return o>2147483647||o<-2147483648?void e(st(new Error("Expression result is out of 32-bit int range"))):Number(o);if(!r&&("array"===i.type||"dict"===i.type))try{return JSON.stringify(o)}catch(t){return e(st(new Error(`Failed to stringify ${i.type}`))),`<${i.type}>`}return o}catch(t){return void e(st(new Error("Expression execution error")))}}}function xo(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={},i=(e=void 0!==e?e:{}).grammarSource,o={start:Ve,JsonStringContents:function(){var t,e,r;for(t=me,e=[],r=De();r!==n;)e.push(r),r=De();return ye=t,Ot(e)}},a=Ve,s="@{",l="}",c="@{}",u="\\",d="?",p=":",v="!:",g="||",f="&&",h="==",m="!=",y=">=",b=">",_="<=",w="<",$="+",x="-",k="/",E="*",C="%",j="!",A="(",F=")",V=",",D="'",S=".",O="e",P="E",I="true",M="false",T=/^[^}]/,N=/^[^'}]/,z=/^[0-9]/,R=/^[a-zA-Z_0-9.]/,B=/^[a-zA-Z_]/,U=/^[ \t\r\n]/,L=ke("@{",!1),W=ke("}",!1),H=ke("@{}",!1),q=ke("\\",!1),J={type:"any"},G=Ee(["}"],!0,!1),Z=ke("?",!1),Y=ke(":",!1),X=ke("!:",!1),Q=ke("||",!1),K=ke("&&",!1),tt=ke("==",!1),et=ke("!=",!1),rt=ke(">=",!1),nt=ke(">",!1),it=ke("<=",!1),ot=ke("<",!1),at=ke("+",!1),st=ke("-",!1),lt=ke("/",!1),ct=ke("*",!1),ut=ke("%",!1),dt=ke("!",!1),pt=ke("(",!1),vt=ke(")",!1),gt=ke(",",!1),ft=Ce("string"),ht=ke("'",!1),mt=Ee(["'","}"],!0,!1),yt=Ce("integer"),bt=Ee([["0","9"]],!1,!1),_t=Ce("number"),wt=ke(".",!1),$t=ke("e",!1),xt=ke("E",!1),kt=Ce("boolean"),Et=ke("true",!1),Ct=ke("false",!1),jt=Ee([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),At=Ce("identifier"),Ft=Ee([["a","z"],["A","Z"],"_"],!1,!1),Vt=Ce("whitespace"),Dt=Ee([" ","\t","\r","\n"],!1,!1),St=function(t){return t},Ot=function(t){return Dn(t)},Pt=function(t){return t},It=function(){return""},Mt=function(){return xe()},Tt=function(){throw new Error("Error tokenizing '"+t+"'.")},Nt=function(){throw new Error("Error tokenizing '"+t+"'.")},zt=function(t){return t},Rt=function(t){return On(t)},Bt=function(){throw new Error("Error tokenizing '"+t+"'.")},Ut=function(t,e,r){return{type:"ConditionalExpression",test:t,consequent:e,alternate:r}},Lt=function(t,e){return{type:"TryExpression",test:t,alternate:e}},Wt=function(t,e){return Vn(t,e)},Ht=function(t,e){return Vn(t,e)},qt=function(t,e){return Fn(t,e)},Jt=function(t,e){return Fn(t,e)},Gt=function(t,e){return Fn(t,e)},Zt=function(t,e){return Fn(t,e)},Yt=function(t,e){return{type:"UnaryExpression",operator:t,argument:e}},Xt=function(t,e){return{type:"CallExpression",callee:t,arguments:e}},Qt=function(t){return{type:"Variable",id:t}},Kt=function(t,e){return[t,...e]},te=function(t){return t},ee=function(t){return t},re=function(t){return Dn(t)},ne=function(t){return t},ie=function(){return""},oe=function(){return xe()},ae=function(){throw new Error("Error tokenizing '"+t+"'.")},se=function(){throw new Error("Error tokenizing '"+t+"'.")},le=function(t){return t},ce=function(t){return On(t)},ue=function(){throw new Error("Error tokenizing '"+t+"'.")},de=function(){return{type:"IntegerLiteral",value:Sn(xe())}},pe=function(){return{type:"NumberLiteral",value:parseFloat(xe())}},ve=function(){return{type:"NumberLiteral",value:parseFloat(xe())}},ge=function(){return{type:"BooleanLiteral",value:!0}},fe=function(){return{type:"BooleanLiteral",value:!1}},he=function(){return{type:"Identifier",name:xe()}},me=0,ye=0,be=[{line:1,column:1}],_e=0,we=[],$e=0;if("startRule"in e){if(!(e.startRule in o))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=o[e.startRule]}function xe(){return t.substring(ye,me)}function ke(t,e){return{type:"literal",text:t,ignoreCase:e}}function Ee(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function Ce(t){return{type:"other",description:t}}function je(e){var r,n=be[e];if(n)return n;for(r=e-1;!be[r];)r--;for(n={line:(n=be[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return be[e]=n,n}function Ae(t,e,r){var n=je(t),o=je(e),a={source:i,start:{offset:t,line:n.line,column:n.column},end:{offset:e,line:o.line,column:o.column}};return r&&i&&"function"==typeof i.offset&&(a.start=i.offset(a.start),a.end=i.offset(a.end)),a}function Fe(t){me<_e||(me>_e&&(_e=me,we=[]),we.push(t))}function Ve(){var t,e;return t=me,He(),(e=Se())!==n?(He(),ye=t,t=St(e)):(me=t,t=n),t}function De(){var e,r,i,o,a;if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(L)),r!==n?(i=He(),(o=Se())!==n?(He(),125===t.charCodeAt(me)?(a=l,me++):(a=n,0===$e&&Fe(W)),a!==n?(ye=e,e=Pt(o)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,t.substr(me,3)===c?(r=c,me+=3):(r=n,0===$e&&Fe(H)),r!==n&&(ye=e,r=It()),(e=r)===n&&(e=me,r=me,$e++,92===t.charCodeAt(me)?(i=u,me++):(i=n,0===$e&&Fe(q)),i===n&&(t.substr(me,2)===s?(i=s,me+=2):(i=n,0===$e&&Fe(L))),$e--,i===n?r=void 0:(me=r,r=n),r!==n?(t.length>me?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(J)),i!==n?(ye=e,e=Mt()):(me=e,e=n)):(me=e,e=n),e===n))){if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(L)),r!==n){if(i=[],T.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(G)),o!==n)for(;o!==n;)i.push(o),T.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(G));else i=n;i!==n?(125===t.charCodeAt(me)?(o=l,me++):(o=n,0===$e&&Fe(W)),o!==n?(ye=e,e=Tt()):(me=e,e=n)):(me=e,e=n)}else me=e,e=n;e===n&&(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(L)),r!==n&&(ye=e,r=Nt()),(e=r)===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n?(t.substr(me,2)===s?(i=s,me+=2):(i=n,0===$e&&Fe(L)),i!==n?(ye=e,e=zt(i)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n?(t.length>me?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(J)),i!==n?(ye=e,e=Rt(i)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n&&(ye=e,r=Bt()),e=r))))}return e}function Se(){var e,r,i,o,a,s;return e=me,(r=Oe())!==n?(He(),63===t.charCodeAt(me)?(i=d,me++):(i=n,0===$e&&Fe(Z)),i!==n?(He(),(o=Se())!==n?(He(),58===t.charCodeAt(me)?(a=p,me++):(a=n,0===$e&&Fe(Y)),a!==n?(He(),(s=Se())!==n?(ye=e,e=Ut(r,o,s)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=Oe()),e}function Oe(){var e,r,i,o;return e=me,(r=Pe())!==n?(He(),t.substr(me,2)===v?(i=v,me+=2):(i=n,0===$e&&Fe(X)),i!==n?(He(),(o=Se())!==n?(ye=e,e=Lt(r,o)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=Pe()),e}function Pe(){var e,r,i,o,a,s,l,c;if(e=me,(r=Ie())!==n){for(i=[],o=me,a=He(),t.substr(me,2)===g?(s=g,me+=2):(s=n,0===$e&&Fe(Q)),s!==n?(l=He(),(c=Ie())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);o!==n;)i.push(o),o=me,a=He(),t.substr(me,2)===g?(s=g,me+=2):(s=n,0===$e&&Fe(Q)),s!==n?(l=He(),(c=Ie())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);ye=e,e=Wt(r,i)}else me=e,e=n;return e}function Ie(){var e,r,i,o,a,s,l,c;if(e=me,(r=Me())!==n){for(i=[],o=me,a=He(),t.substr(me,2)===f?(s=f,me+=2):(s=n,0===$e&&Fe(K)),s!==n?(l=He(),(c=Me())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);o!==n;)i.push(o),o=me,a=He(),t.substr(me,2)===f?(s=f,me+=2):(s=n,0===$e&&Fe(K)),s!==n?(l=He(),(c=Me())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);ye=e,e=Ht(r,i)}else me=e,e=n;return e}function Me(){var e,r,i,o,a,s,l,c;if(e=me,(r=Te())!==n){for(i=[],o=me,a=He(),t.substr(me,2)===h?(s=h,me+=2):(s=n,0===$e&&Fe(tt)),s===n&&(t.substr(me,2)===m?(s=m,me+=2):(s=n,0===$e&&Fe(et))),s!==n?(l=He(),(c=Te())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);o!==n;)i.push(o),o=me,a=He(),t.substr(me,2)===h?(s=h,me+=2):(s=n,0===$e&&Fe(tt)),s===n&&(t.substr(me,2)===m?(s=m,me+=2):(s=n,0===$e&&Fe(et))),s!==n?(l=He(),(c=Te())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);ye=e,e=qt(r,i)}else me=e,e=n;return e}function Te(){var e,r,i,o,a,s,l,c;if(e=me,(r=Ne())!==n){for(i=[],o=me,a=He(),t.substr(me,2)===y?(s=y,me+=2):(s=n,0===$e&&Fe(rt)),s===n&&(62===t.charCodeAt(me)?(s=b,me++):(s=n,0===$e&&Fe(nt)),s===n&&(t.substr(me,2)===_?(s=_,me+=2):(s=n,0===$e&&Fe(it)),s===n&&(60===t.charCodeAt(me)?(s=w,me++):(s=n,0===$e&&Fe(ot))))),s!==n?(l=He(),(c=Ne())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);o!==n;)i.push(o),o=me,a=He(),t.substr(me,2)===y?(s=y,me+=2):(s=n,0===$e&&Fe(rt)),s===n&&(62===t.charCodeAt(me)?(s=b,me++):(s=n,0===$e&&Fe(nt)),s===n&&(t.substr(me,2)===_?(s=_,me+=2):(s=n,0===$e&&Fe(it)),s===n&&(60===t.charCodeAt(me)?(s=w,me++):(s=n,0===$e&&Fe(ot))))),s!==n?(l=He(),(c=Ne())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);ye=e,e=Jt(r,i)}else me=e,e=n;return e}function Ne(){var e,r,i,o,a,s,l,c;if(e=me,(r=ze())!==n){for(i=[],o=me,a=He(),43===t.charCodeAt(me)?(s=$,me++):(s=n,0===$e&&Fe(at)),s===n&&(45===t.charCodeAt(me)?(s=x,me++):(s=n,0===$e&&Fe(st))),s!==n?(l=He(),(c=ze())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);o!==n;)i.push(o),o=me,a=He(),43===t.charCodeAt(me)?(s=$,me++):(s=n,0===$e&&Fe(at)),s===n&&(45===t.charCodeAt(me)?(s=x,me++):(s=n,0===$e&&Fe(st))),s!==n?(l=He(),(c=ze())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);ye=e,e=Gt(r,i)}else me=e,e=n;return e}function ze(){var e,r,i,o,a,s,l,c;if(e=me,(r=Re())!==n){for(i=[],o=me,a=He(),47===t.charCodeAt(me)?(s=k,me++):(s=n,0===$e&&Fe(lt)),s===n&&(42===t.charCodeAt(me)?(s=E,me++):(s=n,0===$e&&Fe(ct)),s===n&&(37===t.charCodeAt(me)?(s=C,me++):(s=n,0===$e&&Fe(ut)))),s!==n?(l=He(),(c=Re())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);o!==n;)i.push(o),o=me,a=He(),47===t.charCodeAt(me)?(s=k,me++):(s=n,0===$e&&Fe(lt)),s===n&&(42===t.charCodeAt(me)?(s=E,me++):(s=n,0===$e&&Fe(ct)),s===n&&(37===t.charCodeAt(me)?(s=C,me++):(s=n,0===$e&&Fe(ut)))),s!==n?(l=He(),(c=Re())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);ye=e,e=Zt(r,i)}else me=e,e=n;return e}function Re(){var e,r,i;return(e=Le())===n&&(e=Ue())===n&&(e=me,33===t.charCodeAt(me)?(r=j,me++):(r=n,0===$e&&Fe(dt)),r===n&&(43===t.charCodeAt(me)?(r=$,me++):(r=n,0===$e&&Fe(at)),r===n&&(45===t.charCodeAt(me)?(r=x,me++):(r=n,0===$e&&Fe(st)))),r!==n?(He(),(i=Re())!==n?(ye=e,e=Yt(r,i)):(me=e,e=n)):(me=e,e=n),e===n&&(e=function(){var e,r,i,o,a;return e=me,(r=We())!==n?(He(),40===t.charCodeAt(me)?(i=A,me++):(i=n,0===$e&&Fe(pt)),i!==n?(He(),o=function(){var e,r,i,o,a,s;if(e=me,(r=Se())!==n){for(i=[],o=me,He(),44===t.charCodeAt(me)?(a=V,me++):(a=n,0===$e&&Fe(gt)),a!==n?(He(),(s=Se())!==n?o=s:(me=o,o=n)):(me=o,o=n);o!==n;)i.push(o),o=me,He(),44===t.charCodeAt(me)?(a=V,me++):(a=n,0===$e&&Fe(gt)),a!==n?(He(),(s=Se())!==n?o=s:(me=o,o=n)):(me=o,o=n);ye=e,e=Kt(r,i)}else me=e,e=n;return e===n&&(e=He()),e}(),o!==n?(He(),41===t.charCodeAt(me)?(a=F,me++):(a=n,0===$e&&Fe(vt)),a!==n?(ye=e,e=Xt(r,o)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,(r=We())!==n&&(ye=e,r=Qt(r)),(e=r)===n&&(e=function(){var e,r,i,o;return e=function(){var e,r,i,o;return $e++,e=me,39===t.charCodeAt(me)?(r=D,me++):(r=n,0===$e&&Fe(ht)),r!==n?(i=function(){var t,e,r;for(t=me,e=[],r=Be();r!==n;)e.push(r),r=Be();return ye=t,re(e)}(),39===t.charCodeAt(me)?(o=D,me++):(o=n,0===$e&&Fe(ht)),o!==n?(ye=e,e=ee(i)):(me=e,e=n)):(me=e,e=n),$e--,e===n&&(r=n,0===$e&&Fe(ft)),e}(),e===n&&(e=Le())===n&&(e=Ue())===n&&(e=function(){var e,r;return $e++,e=me,t.substr(me,4)===I?(r=I,me+=4):(r=n,0===$e&&Fe(Et)),r!==n&&(ye=e,r=ge()),(e=r)===n&&(e=me,t.substr(me,5)===M?(r=M,me+=5):(r=n,0===$e&&Fe(Ct)),r!==n&&(ye=e,r=fe()),e=r),$e--,e===n&&(r=n,0===$e&&Fe(kt)),e}(),e===n&&(e=me,40===t.charCodeAt(me)?(r=A,me++):(r=n,0===$e&&Fe(pt)),r!==n?(He(),(i=Se())!==n?(He(),41===t.charCodeAt(me)?(o=F,me++):(o=n,0===$e&&Fe(vt)),o!==n?(ye=e,e=te(i)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n))),e}())),e}())),e}function Be(){var e,r,i,o,a;if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(L)),r!==n?(i=He(),(o=Se())!==n?(He(),125===t.charCodeAt(me)?(a=l,me++):(a=n,0===$e&&Fe(W)),a!==n?(ye=e,e=ne(o)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,t.substr(me,3)===c?(r=c,me+=3):(r=n,0===$e&&Fe(H)),r!==n&&(ye=e,r=ie()),(e=r)===n&&(e=me,r=me,$e++,92===t.charCodeAt(me)?(i=u,me++):(i=n,0===$e&&Fe(q)),i===n&&(39===t.charCodeAt(me)?(i=D,me++):(i=n,0===$e&&Fe(ht)),i===n&&(t.substr(me,2)===s?(i=s,me+=2):(i=n,0===$e&&Fe(L)))),$e--,i===n?r=void 0:(me=r,r=n),r!==n?(t.length>me?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(J)),i!==n?(ye=e,e=oe()):(me=e,e=n)):(me=e,e=n),e===n))){if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(L)),r!==n){if(i=[],N.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(mt)),o!==n)for(;o!==n;)i.push(o),N.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(mt));else i=n;i!==n?(125===t.charCodeAt(me)?(o=l,me++):(o=n,0===$e&&Fe(W)),o!==n?(ye=e,e=ae()):(me=e,e=n)):(me=e,e=n)}else me=e,e=n;e===n&&(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(L)),r!==n&&(ye=e,r=se()),(e=r)===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n?(t.substr(me,2)===s?(i=s,me+=2):(i=n,0===$e&&Fe(L)),i!==n?(ye=e,e=le(i)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n?(t.length>me?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(J)),i!==n?(ye=e,e=ce(i)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n&&(ye=e,r=ue()),e=r))))}return e}function Ue(){var e,r,i,o;if($e++,e=me,45===t.charCodeAt(me)?(r=x,me++):(r=n,0===$e&&Fe(st)),r===n&&(r=null),i=[],z.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(bt)),o!==n)for(;o!==n;)i.push(o),z.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(bt));else i=n;return i!==n?(ye=e,e=de()):(me=e,e=n),$e--,e===n&&(r=n,0===$e&&Fe(yt)),e}function Le(){var e,r,i,o,a,s,l,c,u,d;for($e++,e=me,45===t.charCodeAt(me)?(r=x,me++):(r=n,0===$e&&Fe(st)),r===n&&(r=null),i=[],z.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(bt));o!==n;)i.push(o),z.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(bt));if(46===t.charCodeAt(me)?(o=S,me++):(o=n,0===$e&&Fe(wt)),o!==n){if(a=[],z.test(t.charAt(me))?(s=t.charAt(me),me++):(s=n,0===$e&&Fe(bt)),s!==n)for(;s!==n;)a.push(s),z.test(t.charAt(me))?(s=t.charAt(me),me++):(s=n,0===$e&&Fe(bt));else a=n;if(a!==n){if(s=me,101===t.charCodeAt(me)?(l=O,me++):(l=n,0===$e&&Fe($t)),l===n&&(69===t.charCodeAt(me)?(l=P,me++):(l=n,0===$e&&Fe(xt))),l!==n){if(43===t.charCodeAt(me)?(c=$,me++):(c=n,0===$e&&Fe(at)),c===n&&(45===t.charCodeAt(me)?(c=x,me++):(c=n,0===$e&&Fe(st))),c===n&&(c=null),u=[],z.test(t.charAt(me))?(d=t.charAt(me),me++):(d=n,0===$e&&Fe(bt)),d!==n)for(;d!==n;)u.push(d),z.test(t.charAt(me))?(d=t.charAt(me),me++):(d=n,0===$e&&Fe(bt));else u=n;u!==n?s=l=[l,c,u]:(me=s,s=n)}else me=s,s=n;s===n&&(s=null),ye=e,e=pe()}else me=e,e=n}else me=e,e=n;if(e===n){if(e=me,45===t.charCodeAt(me)?(r=x,me++):(r=n,0===$e&&Fe(st)),r===n&&(r=null),i=[],z.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(bt)),o!==n)for(;o!==n;)i.push(o),z.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(bt));else i=n;if(i!==n)if(101===t.charCodeAt(me)?(o=O,me++):(o=n,0===$e&&Fe($t)),o===n&&(69===t.charCodeAt(me)?(o=P,me++):(o=n,0===$e&&Fe(xt))),o!==n){if(43===t.charCodeAt(me)?(a=$,me++):(a=n,0===$e&&Fe(at)),a===n&&(45===t.charCodeAt(me)?(a=x,me++):(a=n,0===$e&&Fe(st))),a===n&&(a=null),s=[],z.test(t.charAt(me))?(l=t.charAt(me),me++):(l=n,0===$e&&Fe(bt)),l!==n)for(;l!==n;)s.push(l),z.test(t.charAt(me))?(l=t.charAt(me),me++):(l=n,0===$e&&Fe(bt));else s=n;s!==n?(ye=e,e=ve()):(me=e,e=n)}else me=e,e=n;else me=e,e=n}return $e--,e===n&&(r=n,0===$e&&Fe(_t)),e}function We(){var e,r,i,o,a;if($e++,e=me,r=me,$e++,i=function(){var e,r,i,o;return e=me,t.substr(me,4)===I?(r=I,me+=4):(r=n,0===$e&&Fe(Et)),r===n&&(t.substr(me,5)===M?(r=M,me+=5):(r=n,0===$e&&Fe(Ct))),r!==n?(i=me,$e++,R.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(jt)),$e--,o===n?i=void 0:(me=i,i=n),i!==n?e=r=[r,i]:(me=e,e=n)):(me=e,e=n),e}(),$e--,i===n?r=void 0:(me=r,r=n),r!==n)if(B.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(Ft)),i!==n){for(o=[],R.test(t.charAt(me))?(a=t.charAt(me),me++):(a=n,0===$e&&Fe(jt));a!==n;)o.push(a),R.test(t.charAt(me))?(a=t.charAt(me),me++):(a=n,0===$e&&Fe(jt));ye=e,e=he()}else me=e,e=n;else me=e,e=n;return $e--,e===n&&(r=n,0===$e&&Fe(At)),e}function He(){var e,r;for($e++,e=[],U.test(t.charAt(me))?(r=t.charAt(me),me++):(r=n,0===$e&&Fe(Dt));r!==n;)e.push(r),U.test(t.charAt(me))?(r=t.charAt(me),me++):(r=n,0===$e&&Fe(Dt));return $e--,r=n,0===$e&&Fe(Vt),e}if((r=a())!==n&&me===t.length)return r;throw r!==n&&me<t.length&&Fe({type:"end"}),function(t,e,r){return new Pn(Pn.buildMessage(t,e),t,e,r)}(we,_e<t.length?t.charAt(_e):null,_e<t.length?Ae(_e,_e+1):Ae(_e,_e))}(t,{startRule:"JsonStringContents"}),n=Gn(r);return e.vars.push(...n),new $o(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=>xo(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=xo(t[i],e,r);return n}}var n;return t}function ko(t,e,r,n=!1){if(t){if(t instanceof $o)return t.apply(e,r,n);if(Array.isArray(t))return t.map((t=>ko(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=ko(t[i],e,r);return n}}return t}function Eo(t,e){const r={vars:[],hasExpression:!1},n=xo(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:(t,r)=>ko(n,t,e,r)}}const Co={pagers:function(){return Q(new Map)}},jo=new Map,Ao=new Map;function Fo(t){const e=jo.get(t)||Q("");return jo.has(t)||jo.set(t,e),e}function Vo(t){const e=Ao.get(t)||new Map;return Ao.has(t)||Ao.set(t,e),e}class Do{setVariable(t){const e=t.getName(),r=Vo(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Fo(this).set(e)}getVariable(t){return Vo(this).get(t)}list(){return Vo(this).values()}}function So(){return new Do}function Oo(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 Po=new Set(["start","stop","pause","resume","cancel","reset"]);class Io{constructor(t){Oo(this,"timers",new Map),Oo(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)&&Po.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)}tickOrUnholdAction(t){const e=performance.now(),r=(t.durationPassed||0)+e-(t.durationStarted||0);t.duration&&r>t.duration||(this.updateVariable(t,r),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((()=>{this.updateVariable(t,e),t.tickCountPredict&&void 0!==t.tickCount&&t.tickCount<t.tickCountPredict&&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(),i=Math.max(0,r-(t.tickPassed||0));t.tickTimeout=window.setTimeout((()=>{this.tickOrUnholdAction(t),t.tickPassed=(performance.now()-n-i)%r,e()}),i)};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))}callActions(t,e){const r=t.definition["end"===e?"end_actions":"tick_actions"];if(r){const t=this.applyVars(r);this.execAnyActions(t,{processUrls:!1})}}holdAll(){for(const[t,e]of this.timers)"running"===e.state&&(e.hold=!0,this.stopTimerTimeouts(e))}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&&this.tickOrUnholdAction(e),this.startOrResume(e)}}}function Mo(t,e,r,n){const{variable_name:i}=r;if(!i)return void e(st(new Error(`Incorrect ${r.type} action`),{additional:{name:i}}));const o=t.get(i);if(!o)return void e(st(new Error("Cannot find variable"),{additional:{name:i}}));const a=o.getType();"array"===a?n(o):e(st(new Error("Trying to insert value into the non-array"),{additional:{name:i,type:a}}))}let To=Q(!0),No=0;function zo(){To.set(!1)}function Ro(){To.set(!0)}function Bo(t,e){return t&&e?new Map([...t,...e]):t||e||void 0}const Uo=L(((t,e,r,n)=>{let i,o,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 Do}=e,{mix:x=""}=e,{customization:k={}}=e,{builtinProtocols:E=["http","https","tel","mailto","intent"]}=e,{extensions:C=new Map}=e,{onError:j}=e,{onStat:A}=e,{onCustomAction:F}=e,{onComponent:V}=e,{typefaceProvider:D=(t=>"")}=e,{fetchInit:S={}}=e,{tooltipRoot:O}=e,{customComponents:P}=e,{direction:M="ltr"}=e,T=Q("desktop"===b);if(s=l(T,(t=>a=t)),"auto"===b&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");T.set(!t.matches),t.addListener((()=>{T.set(!t.matches)}))}let N="light",z=null;const B=Q("rtl"===M?"rtl":"ltr");function U(t){_=t}function L(){return new Map}function H(){return new Map}function q(t){y=t}u=l(B,(t=>c=t));const J=new Set(E);let G=!1,Z=!1;m||(Z=!0,dt(st(new Error('"id" prop is required'))));const Y={stateChange:!1},X=Fo(w),tt=Vo(w),et=new Map,rt=new Map,it=new Map;let ot=null,lt=0,ct=[];function ut(t,e,r,n=!1){const i=Eo(e,t);if(!i.hasExpression)return e;const o=Bo(rt,r);return i.applyVars(o,n)}function dt(t){j?j({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function pt(t,e){A&&A({type:t,action:e})}function vt(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type&&t.type in i;){if(({json:t,templateContext:e}=Cn(t,e,i,dt)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}}let gt=0;function ft(t){return`${m}-${gt++}`}let ht={},yt={};function bt(t){_t(ut(dt,t))}function _t(t,e){const r=t.url?String(t.url):"",n=t.typed;if(!Lt(t))return;const o=(null==e?void 0:e.logError)||dt;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":!function(t){if(!t)throw new Error("Missing state id");let e=St,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],i=r[t+1];let o=e.getChild(n);if(!o)return;o.setState(i),e=o}}(s.get("state_id"));break;case"set_current_item":!function(t,e){if(!t||!e)throw new Error('Missing data for "set-current-item" action');if(Number.isNaN(Number(e)))throw new Error('Incorrect item for "set-current-item" action');const r=Vt(t);r&&r.setCurrentItem(Number(e))}(s.get("id"),s.get("item"));break;case"set_previous_item":!function(t,e){if(!t)throw new Error('Missing id for "set-previous-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-previous-item" action');e=e||"clamp";const r=Vt(t);r&&r.setPreviousItem(e)}(s.get("id"),s.get("overflow"));break;case"set_next_item":!function(t,e){if(!t)throw new Error('Missing id for "set-next-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-next-item" action');e=e||"clamp";const r=Vt(t);r&&r.setNextItem(e)}(s.get("id"),s.get("overflow"));break;case"set_variable":const a=s.get("name"),l=s.get("value");if(a&&null!==l){const t=rt.get(a);if(t){const e=t.getType();"dict"===e||"array"===e?o(st(new Error(`Setting ${e} variables is not supported`),{additional:{name:a}})):t.set(l)}else o(st(new Error("Cannot find variable"),{additional:{name:a}}))}else o(st(new Error("Incorrect set_variable_action"),{additional:{url:n}}));break;case"timer":const c=s.get("action"),u=s.get("id");ot?ot.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)||dt;if(t){const r=Vt(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)||dt;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 o,a,s;if(r){if(r.templates)for(const t in r.templates)i.hasOwnProperty(t)||(i[t]=r.templates[t]);if(Array.isArray(null===(o=r.patch)||void 0===o?void 0:o.changes)){if("transactional"===r.patch.mode){const i=r.patch.changes.find((t=>{const e=Ct.get(t.id);if(!e)return!0;const r=Array.isArray(t.items)?t.items.length:0;return!(!e.isSingleMode||1===r)}));if(i)return n(st(new Error("Skipping transactional, child is not found or broken"),{additional:{url:t,id:i.id}})),void wt(null===(a=e.download_callbacks)||void 0===a?void 0:a.on_fail_actions)}r.patch.changes.forEach((t=>{const e=Ct.get(t.id);e&&e.replaceWith(t.id,t.items)})),wt(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 i;n(st(new Error("Failed to download the patch"),{additional:{url:t,originalError:r}})),wt(null===(i=e.download_callbacks)||void 0===i?void 0:i.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 i=(null==r?void 0:r.logError)||dt;if(!t)return void i(st(new Error("Missing id in show_tooltip action")));const o=At.get(t);if(!o)return void i(st(new Error("Tooltip with the provided id is not found"),{additional:{id:t}}));if("true"!==e&&ct.some((e=>e.desc.id===t)))return;const a={internalId:++lt,ownerNode:o.onwerNode,desc:o.tooltip,timeoutId:0};ct=[...ct,a];const s=null!==(n=o.tooltip.duration)&&void 0!==n?n:5e3;s&&(a.timeoutId=window.setTimeout((()=>{a.timeoutId=0,ct=ct.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)||dt;t?ct=ct.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;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=rt.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:i,value:o}=r;!o||"number"!=typeof i&&void 0!==i?e(st(new Error("Incorrect array_insert_value action"),{additional:{name:n}})):Mo(t,e,r,(t=>{const a=t.getValue();if("number"==typeof i&&(i<0||i>a.length))e(st(new Error(`Index out of bound for mutation ${r.type}`),{additional:{name:n,index:i,length:a.length}}));else{const e=a.slice();"number"==typeof i?e.splice(i,0,o.value):e.push(o.value),t.setValue(e)}}))}(rt,o,n);break;case"array_remove_value":!function(t,e,r){const{variable_name:n,index:i}=r;"number"==typeof i?Mo(t,e,r,(t=>{const o=t.getValue();if("number"==typeof i&&(i<0||i>=o.length))e(st(new Error(`Index out of bound for mutation ${r.type}`),{additional:{name:n,index:i,length:o.length}}));else{const e=o.slice();e.splice(i,1),t.setValue(e)}})):e(st(new Error("Incorrect array_remove_value action"),{additional:{name:n}}))}(rt,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&&jt.get(n.element_id);t?t.focus():o(st(new Error("Incorrect focus_element action"),{additional:{elementId:n.element_id}}));break}default:o(st(new Error("Unknown type of action"),{additional:{type:n.type}}))}}async function wt(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 i=n.url,o=n.typed;if(i){const t=xt(i);if(t)if(kt(t,J)){if(e.processUrls)if("_blank"===n.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=i)}else location.href=i}else"div-action"===t?(_t(n,e.componentContext),await $()):n.log_id&&($t(n),await $())}else o&&_t(n,e.componentContext)}r.forEach((t=>{t.log_id&&pt("click",t)}))}function $t(t){null==F||F(t)}const Et=new Map,Ct=new Map,jt=new Map,At=new Map;function Vt(t){if(Et.has(t))return Et.get(t);dt(st(new Error("Missing instance with id"),{additional:{id:t}}))}const Dt=new Map;g(at,{logStat:pt,hasTemplate:function(t){return t in i},processTemplate:vt,genId:ft,genClass:function(t){return`divkit-${ft()}`},execAction:_t,execCustomAction:$t,isRunning:function(t){return Y[t]},setRunning:function(t,e){Y[t]=e},registerInstance:function(t,e){Et.has(t)?dt(st(new Error("Duplicate instance id"),{additional:{id:t}})):Et.set(t,e)},unregisterInstance:function(t){Et.delete(t)},registerParentOf:function(t,e){Ct.set(t,e)},unregisterParentOf:function(t){Ct.delete(t)},registerTooltip:function(t,e){const r=e.id;r&&(At.has(r)&&dt(st(new Error("Duplicate tooltip id"),{additional:{id:r}})),At.set(r,{onwerNode:t,tooltip:e}))},unregisterTooltip:function(t){const e=t.id;e&&(At.delete(e),ct.some((t=>t.desc.id===e))&&(ct=ct.filter((t=>t.desc.id!==e))))},onTooltipClose:function(t){ct=ct.filter((e=>e.internalId!==t))},tooltipRoot:O,registerFocusable:function(t,e){jt.set(t,e)},unregisterFocusable:function(t){jt.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(yt[r]=yt[r]||0,++yt[r],ht[r])return ht[r];const n=`${ft()}-svg-filter`;return ht=Object.assign(Object.assign({},ht),{[r]:n}),n},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;yt[r]&&0==--yt[r]&&(ht=Object.keys(ht).reduce(((t,e)=>(yt[e]&&(t[e]=ht[e]),t)),{}))},preparePrototypeVariables:function(t,e){const r=new Map,n=function(t,e,r){if(!(e in Zr))throw new Error("Unsupported variable type");return new Zr[e](t,r)}(t,"dict",e);return r.set(t,n),r},getStore:function(t){return Dt.has(t)||function(t){Dt.has(t)||Dt.set(t,Co[t]())}(t),Dt.get(t)},getCustomization:function(t){return null==k?void 0:k[t]},getBuiltinProtocols:function(){return J},getExtension:function(t,e){const r=C.get(t);if(r)return new r(e||{})},getExtensionContext:function(){return{variables:rt,logError:dt}},typefaceProvider:D,isDesktop:T,isPointerFocus:To,customComponents:P,direction:B,componentDevtool:void 0}),g(qt,{hasAction:()=>!1});const St={setState(t){throw new Error("Not implemented")},getChild(t){if(Ot&&Ot.has(t))return Ot.get(t);dt(st(new Error("Missing state block with id"),{additional:{id:t}}))}};let Ot=null;function Pt(t){if(t.type in Wr){"integer"===t.type&&"number"==typeof t.value&&(t.value>Number.MAX_SAFE_INTEGER||t.value<Number.MIN_SAFE_INTEGER)&&dt(st(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=Hr(t.name,t.type,t.value);et.set(t.name,e),rt.set(t.name,e)}catch(e){dt(st(e,{additional:{name:t.name}}))}}}g(Ft,{registerInstance(t,e){Ot||(Ot=new Map),Ot.has(t)?dt(st(new Error("Duplicate state with id"),{additional:{id:t}})):Ot.set(t,e)},unregisterInstance(t){null==Ot||Ot.delete(t)},runVisibilityTransition:(t,e,r,n,i)=>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 It=null===(d=null==y?void 0:y.card)||void 0===d?void 0:d.variables;Array.isArray(It)&&It.forEach((t=>{if(t&&t.name){if(et.has(t.name))return void dt(st(new Error("Duplicate variable"),{additional:{name:t.name}}));Pt(t)}}));const Mt=y.palette;Mt&&Mt[N].forEach((t=>{if(et.has(t.name))dt(st(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=Hr(t.name,"color",t.color);et.set(t.name,e),rt.set(t.name,e)}catch(e){dt(st(e,{additional:{name:t.name}}))}}));for(const[t,e]of tt)rt.has(t)||rt.set(t,e);X.subscribe((t=>{if(t&&!rt.has(t)){const e=tt.get(t);rt.set(t,e);const r=it.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const Tt=null===(f=null==y?void 0:y.card)||void 0===f?void 0:f.timers;if(Tt&&"undefined"!=typeof document){const t=ot=new Io({logError:dt,applyVars:t=>ut(dt,t),hasVariableWithType:function(t,e){const r=rt.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=rt.get(t);r?r.setValue(e):dt(st(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:wt});Tt.forEach((e=>t.createTimer(e)))}const Nt=function t(e){const r={json:{},path:[],templateContext:{},logError(t){t.additional=t.additional||{},t.additional.path=r.path.join("/"),dt(t)},execAnyActions:(t,e={})=>wt(t,{componentContext:r,processUrls:e.processUrls}),getDerivedFromVars:(t,e,n=!1)=>function(t,e,r,n=!1){if(!e)return An(e);const i=Bo(rt,r),o=Eo(e,t);return o.vars.length?K(o.vars.map((t=>i.get(t)||function(t){const e=it.get(t)||Q(void 0);return it.has(t)||it.set(t,e),e}(t))).filter(mt),(()=>o.applyVars(i,n))):o.hasExpression?An(o.applyVars(i)):An(e)}(r.logError,t,Bo(r.variables,e),n),getJsonWithVars:(t,e,n=!1)=>ut(r.logError,t,Bo(r.variables,e),n),produceChildContext(e,n={}){const i=t(r);let o=e,a=r.templateContext;const{templateContext:s,json:l}=vt(o,a);return i.json=l,i.templateContext=s,i.origJson=e,void 0!==n.path&&i.path.push(String(n.path)),e.type&&!n.isRootState&&i.path.push(e.type),i.variables=Bo(r.variables,n.variables),n.tooltips&&(i.tooltips=n.tooltips),n.fake&&(i.fakeElement=!0),n.isRootState&&(i.isRootState=!0),i},getVariable(t,e){const n=(r.variables||rt).get(t);if(n){const i=n.getType();if(i!==e)return void r.logError(st(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:i}}))}return n}};return e?(r.path=e.path.slice(),e.fakeElement&&(r.fakeElement=!0)):(r.json={type:"root"},r.isRootState=!0),r}();let zt;v((()=>{No--,No||(window.removeEventListener("keydown",zo),window.removeEventListener("pointerdown",Ro)),ot&&ot.destroy(),ct.forEach((t=>{t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=null)}))})),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!==j&&r.onError(j),void 0===e.onStat&&r.onStat&&void 0!==A&&r.onStat(A),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!==M&&r.direction(M),void 0===e.setTheme&&r.setTheme&&void 0!==U&&r.setTheme(U),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==L&&r.getDebugVariables(L),void 0===e.getDebugAllVariables&&r.getDebugAllVariables&&void 0!==H&&r.getDebugAllVariables(H),void 0===e.setData&&r.setData&&void 0!==q&&r.setData(q),void 0===e.execAction&&r.execAction&&void 0!==bt&&r.execAction(bt),"light"===_||"dark"===_?N=_:"system"===_?"undefined"!=typeof matchMedia?(z||(z=matchMedia("(prefers-color-scheme: dark)"),z.addListener((function(){"system"===_&&z&&(N=z.matches?"dark":"light")}))),N=z.matches?"dark":"light"):N="light":dt(st(new Error("Unsupported theme"))),N&&Mt&&Mt[N].forEach((t=>{const e=rt.get(t.name);e&&e.setValue(t.color)}));{G=!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 xn)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&&(G=!0,dt(t))}if(i=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!==It&&y.card.variables.forEach((t=>{t&&t.name&&!et.has(t.name)&&Pt(t)})),o=null===(h=null==y?void 0:y.card)||void 0===h?void 0:h.states,o&&!G&&!Z){const t={type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:o.map((t=>({state_id:t.state_id.toString(),div:t.div})))};zt=Nt.produceChildContext(t,{tooltips:ct,isRootState:!0})}return s(),u(),G||Z||!zt?"":`<div class="${I("divkit-b023c",!0)+I(a?` ${nt}`:"",!0)+I(x?` ${x}`:"",!0)}"${W("dir",c,0)}>${R(En,"RootSvgFilters").$$render(t,{svgFiltersMap:ht},{},{})} ${R(kn,"Unknown").$$render(t,{componentContext:zt},{},{})}</div>`})),Lo=Uo;function Wo(t){return Lo.render(t).html}var Ho=exports;for(var qo in e)Ho[qo]=e[qo];e.__esModule&&Object.defineProperty(Ho,"__esModule",{value:!0})})();
1
+ (()=>{"use strict";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),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{createGlobalVariablesController:()=>So,createVariable:()=>Hr,render:()=>Wo}),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 i{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;i.entries.set(r.target,r),null===(e=this._listeners.get(r.target))||void 0===e||e(r)}}))}}function o(){}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 o}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)}i.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),j(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 j(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 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(),i=e.slice(t+1).trim();n&&(r[n]=i)}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:A.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 i="",o=0;for(;n.test(r);){const t=n.lastIndex-1,e=r[t];i+=r.substring(o,t)+("&"===e?"&amp;":'"'===e?"&quot;":"&lt;"),o=t+1}return i+r.substring(o)}function M(t){return"string"==typeof t||t&&"object"==typeof t?I(t,!0):t}function T(t){const e={};for(const r in t)e[r]=M(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 L(t){function e(e,r,n,i,o){const a=u;d({$$:{on_destroy:B,context:new Map(o||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const s=t(e,r,n,i);return d(a),s}return{render:(t={},{$$slots:r={},context:n=new Map}={})=>{B=[];const i={title:"",head:"",css:new Set},o=e(i,t,{},r,n);return s(B),{html:o,css:{code:Array.from(i.css).map((t=>t.code)).join("\n"),map:null},head:i.title+i.head}},$$render:e}}function W(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}: ${M(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){Z(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 Z(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 Y(t,e,r,n){var i;const o=null===(i=r[t])||void 0===i?void 0:i.type;if(e="Boolean"===o&&"boolean"!=typeof e?null!=e:e,!n||!r[t])return e;if("toAttribute"===n)switch(o){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(o){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(),Z(this,"$$ctor",void 0),Z(this,"$$s",void 0),Z(this,"$$c",void 0),Z(this,"$$cn",!1),Z(this,"$$d",{}),Z(this,"$$r",!1),Z(this,"$$p_d",{}),Z(this,"$$l",{}),Z(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 i of this.$$s)i in r&&(e[i]=[t(i)]);for(const o of this.attributes){const a=this.$$g_p(o.name);a in this.$$d||(this.$$d[a]=Y(a,o.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=Y(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]=Y(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 X=[];function Q(t,e=o){let r;const n=new Set;function i(e){if(o=e,((i=t)!=i?o==o:i!==o||i&&"object"==typeof i||"function"==typeof i)&&(t=e,r)){const e=!X.length;for(const e of n)e[1](),X.push(e,t);if(e){for(let t=0;t<X.length;t+=2)X[t][0](X[t+1]);X.length=0}}var i,o}function a(e){i(e(t))}return{set:i,update:a,subscribe:function(s,l=o){const c=[s,l];return n.add(c),1===n.size&&(r=e(i,a)||o),s(t),()=>{n.delete(c),0===n.size&&r&&(r(),r=null)}}}}function K(t,e,r){const n=!Array.isArray(t),i=n?[t]:t;if(!i.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=o;const v=()=>{if(d)return;p();const i=e(n?u[0]:u,t,r);a?t(i):p="function"==typeof i?i:o},g=i.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",it="divkit-aa145",ot="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,i,o]=e,a=2===n.length?n:n+n,s=2===i.length?i:i+i,l=2===o.length?o:o+o,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,i]=e,o=2===r.length?r:r+r,a=2===n.length?n:n+n,s=2===i.length?i:i+i;return{a:255,r:parseInt(o,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 i;n&&"object"==typeof n&&"type"in n&&void 0!==n.value&&("fixed"===n.type?i=pt(n.value):"relative"===n.type&&(i=bt[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${i||"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){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 jt(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 i in r)if(r.hasOwnProperty(i)){const o=r[i];o&&At(n,e[`${t}_${i}`+("string"==typeof o?`_${o}`:"")])}return n.join(" ")}const Vt=Symbol("state");function Dt(t,e){var r,n;const i=t.top||0,o=(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===i&&0===o&&0===a&&0===s?"":dt(i)+" "+dt(o)+" "+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,i;if(!t)return r;const o=[t.top,null!==(n="ltr"===e?t.end:t.start)&&void 0!==n?n:t.right,t.bottom,null!==(i="ltr"===e?t.start:t.end)&&void 0!==i?i:t.left];for(let t=0;t<o.length;++t)if(o[t]&&!Ot(o[t]))return r;return Dt(t,e)}const It=Object.prototype.hasOwnProperty;function Mt(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 i=r[n];if(!It.call(e,i)||!Mt(t[i],e[i]))return!1}return!0}function Tt(t,e){return Mt(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 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:i}=e,{id:o=""}=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((()=>{o&&!y&&b.unregisterFocusable(o)})),void 0===e.componentContext&&r.componentContext&&void 0!==i&&r.componentContext(i),void 0===e.id&&r.id&&void 0!==o&&r.id(o),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="",i.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))||i.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:M(x)},{target:M($)},{style:M(u)},{class:I(c,!0)+" "+I(m?tt:et,!0)+" "+I(null!=l&&l.length?ot:"",!0)},T(d)],{})}${W("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?ot:"",!0)},{style:M(u)},{role:M(k?"button":null)},{tabindex:M(k?0:null)},T(d)],{})}${W("this",w,0)}>${n.default?n.default({}):""}</span>`})),Gt=Jt,Zt="divkit-b921d";function Yt(t){return St(t)&&t>0}function Xt(t,e){return t.map((t=>{if(t)if("blur"===t.type){if(Yt(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 Qt=L(((t,e,r,n)=>{let i,{direction:o}=e,{componentContext:a}=e,{background:s=[]}=e,{radius:l=""}=e;return f(at),void 0===e.direction&&r.direction&&void 0!==o&&r.direction(o),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),i=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"===o&&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(i,(t=>t.image_url?`<img${W("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${W("class",Zt,0)}${W("style",ut(t.style),0)}>`:`<span${W("class",Zt,0)}${W("style",ut(t.style),0)}></span>`))}</span>`})),Kt=Qt,te={left:"start",center:"center",right:"end",start:"start",end:"end"},ee={left:"end",center:"center",right:"start",start:"start",end:"end"},re={top:"start",center:"center",bottom:"end",baseline:"baseline"},ne=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,x,k,E,C,j,A,F,V,D,S,O,P,I,M,T,N,z,B,U,L,H,q,J,G,Z,Y,X,Q,tt,et,rt,nt,it,ot=o,lt=o,vt=o,ft=o,ht=o,bt=o,_t=o,wt=o,$t=o,At=o,St=o,It=o,Ht=o,qt=o,Jt=o,Zt=o,Yt=o,Xt=o,{componentContext:Qt}=e,{cls:ne=""}=e,{style:ie}=e,{layoutParams:oe={}}=e,{customDescription:ae=!1}=e,{customPaddings:se=!1}=e,{customActions:le=""}=e,{additionalPaddings:ce=null}=e,{heightByAspect:ue=!1}=e,{parentOf:de}=e,{parentOfSimpleMode:pe}=e,{replaceItems:ve}=e,{hasInnerFocusable:ge=!1}=e;const fe=f(at),he=f(Vt);let me,ye;I=l(fe.isPointerFocus,(t=>P=t)),et=l(fe.direction,(t=>tt=t));let be,_e,we,$e,xe,ke,Ee,Ce,je,Ae,Fe,Ve,De,Se,Oe,Pe,Ie,Me,Te,Ne,ze=null,Re=[],Be={},Ue={},Le=!1,We=1,He="transparent",qe=0,Je={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},Ge="",Ze=null,Ye="",Xe={},Qe=0,Ke=0,tr=0,er=!1,rr=!1,nr={},ir=0,or=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(de)||!ve)return;if(pe&&1!==(Array.isArray(e)&&e.length||0))return;const r=de.findIndex((e=>(null==e?void 0:e.id)===t)),n=de.slice();n.splice(r,1,...e||[]),de=n,ve(n)}function jr(){if(ze&&me){const t=fe.getExtensionContext();ze.forEach((e=>{var r;null===(r=e.unmountView)||void 0===r||r.call(e,me,t)})),ze=null}}function Ar(){Qt.json.focus&&(P||(kr=!0),Qt.execAnyActions(hr))}function Fr(){Qt.json.focus&&(kr=!1,Qt.execAnyActions(mr))}v((()=>{var t;Re.forEach((t=>{fe.unregisterParentOf(t)})),Re=[],null===(t=Qt.json.tooltips)||void 0===t||t.forEach((t=>{fe.unregisterTooltip(t)})),jr()})),void 0===e.componentContext&&r.componentContext&&void 0!==Qt&&r.componentContext(Qt),void 0===e.cls&&r.cls&&void 0!==ne&&r.cls(ne),void 0===e.style&&r.style&&void 0!==ie&&r.style(ie),void 0===e.layoutParams&&r.layoutParams&&void 0!==oe&&r.layoutParams(oe),void 0===e.customDescription&&r.customDescription&&void 0!==ae&&r.customDescription(ae),void 0===e.customPaddings&&r.customPaddings&&void 0!==se&&r.customPaddings(se),void 0===e.customActions&&r.customActions&&void 0!==le&&r.customActions(le),void 0===e.additionalPaddings&&r.additionalPaddings&&void 0!==ce&&r.additionalPaddings(ce),void 0===e.heightByAspect&&r.heightByAspect&&void 0!==ue&&r.heightByAspect(ue),void 0===e.parentOf&&r.parentOf&&void 0!==de&&r.parentOf(de),void 0===e.parentOfSimpleMode&&r.parentOfSimpleMode&&void 0!==pe&&r.parentOfSimpleMode(pe),void 0===e.replaceItems&&r.replaceItems&&void 0!==ve&&r.replaceItems(ve),void 0===e.hasInnerFocusable&&r.hasInnerFocusable&&void 0!==ge&&r.hasInnerFocusable(ge),Qt.json&&oe&&(Ze=null,Ye="",cr=1,_r=!1,wr="visible",$r=0,xr=0,Me=void 0,Te=void 0,ur=Qt.fakeElement?[]:Qt.json.transition_triggers||["state_change","visibility_change"],dr=Boolean(-1!==ur.indexOf("state_change")&&Qt.json.id),pr=Boolean(-1!==ur.indexOf("visibility_change")&&Qt.json.id)),i=Qt.getDerivedFromVars(Qt.json.focus),ft(),ft=l(i,(t=>z=t)),a=Qt.getDerivedFromVars(Qt.json.border),Xt(),Xt=l(a,(t=>it=t)),s=Qt.getDerivedFromVars(Qt.json.paddings),Yt(),Yt=l(s,(t=>nt=t)),c=Qt.getDerivedFromVars(Qt.json.margins),Jt(),Jt=l(c,(t=>Q=t)),u=Qt.getDerivedFromVars(Qt.json.width),Ht(),Ht=l(u,(t=>Y=t)),d=Qt.getDerivedFromVars(Qt.json.alignment_horizontal),Zt(),Zt=l(d,(t=>rt=t)),p=Qt.getDerivedFromVars(Qt.json.height),It(),It=l(p,(t=>Z=t)),g=Qt.getDerivedFromVars(Qt.json.alignment_vertical),qt(),qt=l(g,(t=>X=t)),h=Qt.getDerivedFromVars(Qt.json.alpha),St(),St=l(h,(t=>G=t)),m=Qt.getDerivedFromVars(Qt.json.accessibility),At(),At=l(m,(t=>J=t)),y=Qt.getDerivedFromVars(Qt.json.background),$t(),$t=l(y,(t=>q=t)),b=Qt.getDerivedFromVars(Qt.json.action),_t(),_t=l(b,(t=>L=t)),_=Qt.getDerivedFromVars(Qt.json.actions),wt(),wt=l(_,(t=>H=t)),w=Qt.getDerivedFromVars(Qt.json.doubletap_actions),bt(),bt=l(w,(t=>U=t)),x=Qt.getDerivedFromVars(Qt.json.longtap_actions),ht(),ht=l(x,(t=>B=t)),k=Qt.getDerivedFromVars(Qt.json.action_animation),vt(),vt=l(k,(t=>N=t)),E=Qt.getDerivedFromVars(Qt.json.visibility),lt(),lt=l(E,(t=>T=t)),C=Qt.getDerivedFromVars(Qt.json.transform),ot(),ot=l(C,(t=>M=t)),Re.forEach((t=>{fe.unregisterParentOf(t)})),Re=[],de&&de.forEach((t=>{(null==t?void 0:t.id)&&(Re.push(t.id),fe.registerParentOf(t.id,{replaceWith:Cr,isSingleMode:Boolean(pe)}))}));{const t=kr&&(null==z?void 0:z.border)?z.border:it;let e={},r={},n=!1,i="";if(t){if(t.has_shadow){const r=t.shadow;e["box-shadow"]=r?function(t){var e,r,n,i,o,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===(i=n.y)||void 0===i?void 0:i.value)||0)+" "+dt(null!==(o=t.blur)&&void 0!==o?o: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,We=Et(t.stroke.width,We),He=gt(t.stroke.color,1,He),r.border=`${dt(We)} 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),r["border-radius"]=e["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},r["border-radius"]=e["border-radius"]=dt(qe)),n&&We&&(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)+We/2})),i=Ut(t)}}Be=Tt(e,Be),Ue=Tt(r,Ue),Le=n,Ge=i}Ze=Bt(nt&&!se?nt:void 0,Ze),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 i=t[n];i&&(r[n]=i);const o=e[n];o&&(r[n]=(r[n]||0)+o)})),r}(Ze,ce),tt),Ye=Pt(Q,tt,Ye);{let t,e,r,n,i={},o=0,a=0,s=!1,l=!1;const c=null==Y?void 0:Y.type;if("fixed"===c)Qe=Et(null==Y?void 0:Y.value,Qe),e=dt(Qe);else if("wrap_content"===c||("match_parent"===c||!c)&&oe.parentHorizontalWrapContent){if(t="content",("wrap_content"===c&&(null==Y?void 0:Y.constrained)||("match_parent"===c||!c)&&oe.parentHorizontalWrapContent)&&(i["width-constrained"]=!0,"horizontal"===oe.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Y;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||Qt.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,Qt.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==Q?void 0:Q.left)||0)+((null==Q?void 0:Q.right)||0))})`:"horizontal"===oe.parentContainerOrientation&&(o=Y&&"weight"in Y&&Y.weight||1,oe.parentContainerWrap&&(s=!0));if("parent"===t)i["halign-self"]="stretch";else{const t=rt;i["halign-self"]="left"===t||"center"===t||"right"===t||"start"===t||"end"===t?("ltr"===tt?te:ee)[t]:oe.parentHAlign||"start"}t&&(i.width=t),be=e,_e=r,we=n,Ke=o,tr=a,Xe=Tt(i,Xe),er=s,rr=l}{let t,e,r,n,i={},o=0,a=0,s=!1,l=!1;const c=null==Z?void 0:Z.type;if(ue);else if("fixed"===c)ir=Et(null==Z?void 0:Z.value,ir),e=dt(ir);else if("match_parent"!==c||oe.parentVerticalWrapContent){if(t="content",("wrap_content"===c&&(null==Z?void 0:Z.constrained)||"match_parent"===c&&oe.parentVerticalWrapContent)&&(i["height-constrained"]=!0,"vertical"===oe.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Z;(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&&Qt.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,Qt.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==Q?void 0:Q.top)||0)+((null==Q?void 0:Q.bottom)||0))})`:"vertical"===oe.parentContainerOrientation&&(o=(null==Z?void 0:Z.weight)||1,oe.parentContainerWrap&&(s=!0));if("parent"===t)i["valign-self"]="stretch";else{const t=X;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===oe.parentContainerOrientation?i["valign-self"]=re[t]:i["valign-self"]=oe.parentVAlign||"start"}t&&(i.height=t),$e=e,xe=r,ke=n,or=o,ar=a,nr=Tt(i,nr),sr=s,lr=l}var Vr,Dr,Sr;if(A=!!oe.overlapParent||void 0,F=oe.overlapParent&&(!Y||"match_parent"===Y.type)&&!oe.parentHorizontalWrapContent&&"match_parent"===(null==Z?void 0:Z.type)&&!oe.parentVerticalWrapContent,V=oe.gridArea?`${oe.gridArea.y+1}/${oe.gridArea.x+1}/span ${oe.gridArea.rowSpan}/span ${oe.gridArea.colSpan}`:void 0,Dr=cr,cr=!Ot(Vr=G)||void 0===Vr||Vr>1?Dr:Number(Vr),Ee=1===cr?void 0:cr,ye=void 0,J&&!ae&&J.description&&(ye={},ye["aria-label"]=J.description),Ce=kr&&(null==z?void 0:z.background)?z.background:q,je={},Ae=!1,Array.isArray(Ce)&&(Ae=Ce.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(Ge),!Ae)){const t=yt(Ce);je["background-color"]=t.color,je["background-image"]=t.image,je["background-size"]=t.size,je["background-position"]=t.position,je["background-repeat"]="no-repeat"}Fe=void 0,dr&&Qt.json.transition_in&&fe.isRunning("stateChange")&&(Fe=!0),De=void 0,dr&&Qt.json.transition_change&&fe.isRunning("stateChange")&&he.hasTransitionChange(Qt.json.id)&&(De=!0);{let t=H||L&&[L]||[],e=U||[],r=B||[],n=(null==z?void 0:z.on_focus)||[],i=(null==z?void 0:z.on_blur)||[];Qt.fakeElement?(t=[],e=[],r=[],n=[],i=[]):(Array.isArray(t)||(t=[],Qt.logError(st(new Error("Actions should be array")))),Array.isArray(e)||(e=[],Qt.logError(st(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],Qt.logError(st(new Error("LongTapActions should be array")))),Array.isArray(n)||(n=[],Qt.logError(st(new Error("FocusActions should be array")))),Array.isArray(i)||(i=[],Qt.logError(st(new Error("BlurActions should be array"))))),(t.length||e.length||r.length)&&le&&(t=[],e=[],r=[],Qt.logError(st(new Error(`Cannot use action on component "${le}"`)))),vr=t.filter(Lt),gr=e.filter(Lt),fr=r.filter(Lt),hr=n.filter(Lt),mr=i.filter(Lt)}N&&(yr=Rt(N),br=yr.map((function(t){const e=zt(t.start_value,1),r=zt(t.end_value,1),n=Et(t.start_delay,0),i="undefined"!=typeof matchMedia&&(Wt||(Wt=window.matchMedia("(prefers-reduced-motion)")),Wt.matches)?0:Et(t.duration,300),o=Nt(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return Se=e,Oe=r,`opacity ${i}ms ${o} ${n}ms`;case"scale":return Pe=e,Ie=r,`transform ${i}ms ${o} ${n}ms`;case"native":case"no_animation":return"";default:return Qt.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?Qt.json.transition_in:Qt.json.transition_out;pr&&r&&(await $(),"in"===e&&(Ve=!0),he.runVisibilityTransition(Object.assign(Object.assign({},Qt.json),{visibility:"visible"}),Qt,r,me,e).then((()=>{"in"===e&&(Ve=!1)})).catch((t=>{throw"in"===e&&(Ve=!1),t})))}(e)),_r||(_r=!0)}if(Qt.json&&me&&!Mt(Qt.json.extensions,Ne)){let t=Ne=Qt.json.extensions;$().then((()=>{if(t===Ne&&me&&(jr(),Array.isArray(Qt.json.extensions))){const t=fe.getExtensionContext();ze=Qt.json.extensions.map((e=>{var r;const n=e.id;if(!n)return;const i=fe.getExtension(n,e.params);return i&&(null===(r=i.mountView)||void 0===r||r.call(i,me,t)),i})).filter(mt)}}))}if(Qt&&Er&&Er.update(Qt),D=Object.assign(Object.assign(Object.assign({},Xe),nr),{"parent-overlap":A,"parent-overlap-absolute":F,"scroll-snap":oe.scrollSnap,"hide-on-transition-in":Fe||Ve||De,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&&Qt.json.focus)}),M&&void 0!==M.rotation){const t=M.pivot_x||{type:"pivot-percentage",value:50};$r=zt(t.value,$r);const e="pivot-fixed"===t.type?dt($r):`${$r}%`,r=M.pivot_y||{type:"pivot-percentage",value:50};xr=zt(r.value,xr),Me=`${e} ${"pivot-fixed"===r.type?dt(xr):`${xr}%`}`,Te=`rotate(${M.rotation}deg)`}return S=er||sr?"100%":Ke||or?0:void 0,O=Object.assign(Object.assign(Object.assign(Object.assign({},ie),je),Be),{width:be,"min-width":_e,"max-width":we,height:$e,"min-height":xe,"max-height":ke||(null==ie?void 0:ie["max-height"]),"grid-area":V,padding:j,margin:Ye,opacity:Ee,transition:br,"transform-origin":Me,transform:Te,"flex-grow":Ke||or||void 0,"flex-shrink":tr||ar?1:void 0,"flex-basis":S,"--divkit-animation-opacity-start":Se,"--divkit-animation-opacity-end":Oe,"--divkit-animation-scale-start":Pe,"--divkit-animation-scale-end":Ie}),I(),ot(),lt(),vt(),ft(),ht(),bt(),_t(),wt(),$t(),At(),St(),It(),Ht(),qt(),Jt(),et(),Zt(),Yt(),Xt(),rr||lr?"":`${R(Gt,"Actionable").$$render(t,{componentContext:Qt,id:Qt.json.id,use:function(t){var e;me=t,dr&&Qt.json.transition_in&&he.registerChildWithTransitionIn(Qt.json,Qt,Qt.json.transition_in,t).then((()=>{Fe=!1})).catch((t=>{throw Fe=!1,t})),dr&&Qt.json.transition_out&&he.registerChildWithTransitionOut(Qt.json,Qt,Qt.json.transition_out,t),dr&&Qt.json.transition_change&&he.registerChildWithTransitionChange(Qt.json,Qt,Qt.json.transition_change,t).then((()=>{De=!1})).catch((t=>{throw De=!1,t}));const r=Qt.fakeElement?[]:Qt.json.visibility_actions||Qt.json.visibility_action&&[Qt.json.visibility_action],n=Qt.fakeElement?[]:Qt.json.disappear_actions;let i;(Array.isArray(r)&&r.length||Array.isArray(n)&&n.length)&&(i=function(t,{visibilityActions:e,disappearActions:r,rootCtx:n,componentContext:i}){const o=[];e&&e.forEach((t=>{o.push({type:"visibility",index:o.length,action:t,visible:!1,count:0,finished:!1})})),r&&r.forEach((t=>{o.push({type:"disappear",index:o.length,action:t,visible:!1,count:0,finished:!1})}));const a=o.map(((t,e)=>{const r="visibility"===t.type;return i.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(),o.forEach((t=>{t.timer&&clearTimeout(t.timer)}))},c=K(a,(t=>t)).subscribe((e=>{const r=e.filter(jt),a={};r.forEach((t=>{a[t.index]=t})),l();const c=[...new Set(r.map((t=>{const e="visibility"===o[t.index].type;return Ct(e,t.visibility_percentage,e?50:0)/100})))];c.length&&(s=new IntersectionObserver((t=>{t.forEach((t=>{r.forEach((e=>{const r=o[e.index],a="visibility"===r.type,s=Ct(a,e.visibility_percentage,a?50:0);let l;l=0===s?t.intersectionRatio>=1e-12:t.intersectionRatio>=s/100;const c=a?!r.visible&&l:r.visible&&!l,u=a?!l:l;c?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);const o=i.getJsonWithVars(r.action),s=o.url,l=o.typed;if(s){const t=xt(s);t&&!kt(t,n.getBuiltinProtocols())&&("div-action"===t?n.execAction(o):o.log_id&&n.execCustomAction(o))}else l&&n.execAction(o);n.logStat(a?"visible":"disappear",o)}),Et(e.visibility_duration,800))):u&&r.timer&&clearTimeout(r.timer),r.visible=l}))}))}),{threshold:c}),s.observe(t))}));return{destroy(){l(),c()}}}(t,{visibilityActions:r,disappearActions:n,rootCtx:fe,componentContext:Qt}));const o=Qt.json.id;return o&&he.registerChild(o),null===(e=Qt.json.tooltips)||void 0===e||e.forEach((e=>{fe.registerTooltip(t,e)})),{destroy(){o&&he.unregisterChild(o),i&&i.destroy(),Er&&Er.destroy()}}},cls:ne+" "+Ft("outer",ct,D),style:ut(O),actions:vr,doubleTapActions:gr,longTapActions:fr,attrs:ye,hasInnerFocusable:ge,isNativeActionAnimation:!yr.length||(Sr=yr,Sr.some((t=>"native"===t.name)))},{},{default:()=>` ${Ae?`${R(Kt,"OuterBackground").$$render(t,{componentContext:Qt,direction:tt,background:Ce,radius:Ge},{},{})}`:""}${n.default?n.default({focusHandler:Ar,blurHandler:Fr,hasCustomFocus:kr}):""}${Le?`<span${W("class",ct.outer__border,0)}${W("style",ut(Ue),0)}></span>`:""}`})}`})),ie=ne,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 ae(t,e){const r=Number(t);return Number.isNaN(r)||r<=0?e:r}function se(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function le(t,e){return se(t)||e}const ce=L(((t,e,r,n)=>{let i,o,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="",j=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="",j=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 $=ae(h.font_size,$),Yt(h.line_height)&&(x=Number(h.line_height)/$),Ot(h.letter_spacing)&&(k=dt(h.letter_spacing)),_=le(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),i=h.top_offset?dt(h.top_offset):"",o=h.background?yt([h.background]):null,j=(null===(u=h.border)||void 0===u?void 0:u.stroke)&&h.border.stroke.color&&"transparent"!==gt(h.border.stroke.color)&&Yt(h.border.stroke.width)?{color:h.border.stroke.color,width:h.border.stroke.width}:null,a=ae(null===(d=h.border)||void 0===d?void 0:d.corner_radius,0),s=h.text_shadow?function(t,e){var r,n,i,o,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===(i=n.x)||void 0===i?void 0:i.value)||0)/e)+" "+dt(10*((null===(o=t.offset)||void 0===o||null===(a=o.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==o?void 0:o.color)||void 0,"box-shadow":j?`inset 0 0 0 ${dt(j.width)} ${j.color}`:void 0,"border-radius":a?dt(a):void 0},`${i?`<span${W("class",oe["text-range__top-offset"],0)}${q({"margin-top":i})}></span>`:""}${R(Gt,"Actionable").$$render(t,{componentContext:p,cls:Ft("text-range",oe,l),actions:y,style:ut(c)},{},{default:()=>`${I(v)}`})}`})),ue=ce;function de(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 pe(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?"top"===t?"start":"bottom"===t?"end":t:e}function ve(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}function ge(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const fe=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P,I,M,T,z,B,U,L,H,q,J,G,Z,Y=o,X=o,Q=o,K=o,tt=o,et=o,nt=o,it=o,ot=o,st=o,ct=o,pt=o,vt=o,ft=o,ht=o,{componentContext:mt}=e,{layoutParams:bt}=e;const _t=f(at);L=l(_t.direction,(t=>U=t));let wt,$t="",xt=12,kt=1.25,Et=!1,Ct="",jt="",At=!1,Vt="start",Dt="start",St="",Ot="",Pt="",It=!1,Mt=[],Tt=[];var Nt;v((()=>{Tt.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,jt="",At=!1,Vt="start",Dt="start",St="",Pt="",It=!1),i=mt.getDerivedFromVars(mt.json.text),ht(),ht=l(i,(t=>Z=t)),a=mt.getDerivedFromVars(mt.json.ranges),X(),X=l(a,(t=>D=t)),s=mt.getDerivedFromVars(mt.json.images),Y(),Y=l(s,(t=>V=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}),Q(),Q=l(c,(t=>S=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),ot(),ot=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),it(),it=l(m,(t=>T=t)),y=mt.getDerivedFromVars(mt.json.focused_text_color),nt(),nt=l(y,(t=>M=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=Z,$t=String(null!=Nt?Nt:""),xt=ae(G,xt);{const t=J;Yt(t)?(kt=Number(t)/xt,Et=!0):Et=!1}x=1===z;{let t,e="",r="",n=!1;if(z&&z>1){const i=Number(z);e=i*kt+"em",t=i,r=i,n=!0}else q&&1!==z&&(n=!0);Ct=e,wt=t,jt=r,At=n}Vt=de(H,U,Vt),Dt=pe(B,Dt),k=!D||$t&&1===D.length&&D[0]&&0===D[0].start&&"number"==typeof D[0].end&&D[0].end>=$t.length,E=Boolean(T)!==Boolean(D&&D[0]&&D[0].text_color);{let t="";z&&k&&E&&(t=gt(T||D&&D[0]&&D[0].text_color,1,St)),St=t}Ot=gt(M,1,Ot),C="none"===I?"none":"";{let t="";if(P){const e=yt([P]);e.image&&(t=e.image)}Pt=t}return It=ve(O,It),function(t,e,r){let n=[];if(Tt.forEach((([t,e])=>{_t.removeSvgFilter(t,e)})),Tt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(Mt=[]);const i=t;let o=e||[{start:0,end:i.length}],a=r||[],s=0,l=[],c=[];o.forEach((t=>{void 0!==t.start&&void 0!==t.end&&(c.push({index:t.start,range:t,type:"rangeStart",isStart:!0}),c.push({index:t.end,range:t,type:"rangeEnd"}))})),a.forEach(((t,e)=>{void 0!==t.start&&t.url&&t.start<=i.length&&c.push({index:t.start,image:t,type:"image",arrayIndex:e})})),c.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)),c.forEach((t=>{var e,r;let o="image"===t.type?null:t.range,a=t.index;if(a>s){let o=Object.assign(Object.assign({},S),...l);n.push({text:i.substring(s,a),textStyles:o,actions:"rangeEnd"===t.type&&(null===(r=null===(e=t.range)||void 0===e?void 0:e.actions)||void 0===r?void 0:r.filter(Lt))||void 0})}if("rangeStart"===t.type&&o)l.push(o);else if("rangeEnd"===t.type)l=l.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},S),...l),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 o={"font-size":dt(10*(Number(e.font_size)||12)/xt)};let a="";const s=t.image.tint_color,c=ge(t.image.tint_mode,"source_in");if(s){const e=gt(t.image.tint_color);a=_t.addSvgFilter(e,c),Tt.push([e,c])}n.push({image:{url:t.image.url,width:r,height:i,wrapperStyle:o,svgFilterId:a,preloadRequired:Boolean(t.image.preload_required)}})}s=a})),s<i.length&&n.push({text:i.substring(s),textStyles:Object.assign({},S)}),Mt=n}($t,D,V),j={singleline:x,multiline:At,halign:Vt,valign:Dt,truncate:C,"has-focus-color":Boolean(Ot)},A={gradient:Boolean(Pt)},F={"font-size":dt(xt),"line-height":kt,"max-height":Ct,"-webkit-line-clamp":jt,color:St,"background-image":Pt,"--divkit-text-focus-color":Ot},Y(),X(),Q(),K(),tt(),et(),nt(),it(),ot(),st(),L(),ct(),pt(),vt(),ft(),ht(),`${R(ie,"Outer").$$render(t,{cls:Ft("text",lt,j)+" "+(It?"":rt),componentContext:mt,layoutParams:bt},{},{default:()=>`<span${W("class",Ft("text__inner",lt,A),0)}${W("style",ut(F),0)}>${Mt.length?`${N(Mt,(e=>"text"in e?e.text?`${R(ue,"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":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(ue,"TextRangeView").$$render(t,{componentContext:mt,text:$t,rootFontSize:xt,textStyles:S,singleline:x},{},{})}`}</span>`})}`})),he=fe,me={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 ye(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 be(t,e,r){const n=((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);null!=e&&e.show_at_start&&(r?t.top=e.style.height+i:t.left=e.style.width+n),null!=e&&e.show_at_end&&(r?t.bottom=e.style.height+i:t.right=e.style.width+n)}function _e(t,e,r){let n;const i=((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),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+i:0]:[null!=e&&e.show_between?e.style.height+o:0,null!=r&&r.show_between?r.style.width+a:0],n.map(dt).join(" ")}function we(t){var e;const r=null===(e=t.width)||void 0===e?void 0:e.type;return"wrap_content"===r||"fixed"===r}function $e(t){var e;return"match_parent"!==(null===(e=t.height)||void 0===e?void 0:e.type)}function xe(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===(o=(i=t.shape).item_width)||void 0===o?void 0:o.value,10),height:Et(null===(a=i.item_height)||void 0===a?void 0:a.value,10),radius:Et(null===(s=i.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 i,o,a,s;return function(t,e,r){var n;const i={},o=e.stroke||(null==r?void 0:r.stroke),a=null!=o&&o.color?gt(o.color):"",s=null!=o&&o.width?Number(null!==(n=o.width)&&void 0!==n?n:1):"";i.width=t.width,i.height=t.height,i.borderRadius=t.radius;const l=e.background_color||(null==r?void 0:r.color);return i.background=gt(l),a&&s&&(i.boxShadow=`inset 0 0 0 ${dt(s)} ${a}`),i}(n,t.shape,{color:t.color,stroke:t.stroke})}let ke;function Ee(){if("undefined"==typeof document&&(ke=!0),void 0!==ke)return ke;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),ke=1===t.scrollHeight,document.body.removeChild(t),ke}const Ce="divkit-a7719",je="divkit-f6e9a";function Ae(t,e,r,n,i,o){const a=e.margins.left,s=e.margins.right,l=e.margins.top,c=e.margins.bottom;o?t.push({top:r.bottom+l,left:i.left+a,width:Math.max(0,i.right-i.left-a-s),height:n.top-r.bottom-l-c,style:e.style}):t.push({top:i.top+l,left:r.right+a,width:n.left-r.right-a-s,height:Math.max(0,i.bottom-i.top-l-c),style:e.style})}function Fe(t,e,r,n,i,o){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"===i||"space-evenly"===i?(s=o.left-e.style.width,l=o.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 i=0;i<r.length-1;++i)Ae(t,e,r[i],r[i+1],a,n);if(null==e?void 0:e.show_at_end){const s=r[r.length-1];let l,c;"space-around"===i||"space-evenly"===i?(l=o.bottom+e.style.height,c=o.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 Ve=L(((t,e,r,n)=>{let i,{orientation:o}=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,i=!1;return function(){const e=Date.now();return!n||Math.abs(e-n)>10?(n=e,r=t.apply(this,arguments)):(i||(i=!0,setTimeout((()=>{i=!1,r=t.apply(this,arguments)}),10)),r)}}((function(){if(!i)return;const t=i.getBoundingClientRect(),e=window.getComputedStyle(i),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=[...i.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(),i=r.left,a=r.right,s=r.bottom;for(;n.length;){let e=n[0],r=e.getBoundingClientRect();if("vertical"===o){if(r.top<s)break}else if("ltr"===u?r.left<a:r.right>i)break;a=Math.max(a,r.right),i=Math.min(i,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"===o&&e.reverse(),a&&Fe(g,a,e,"vertical"===o,"vertical"===o?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"===o&&v.reverse(),s&&Fe(g,s,v,"horizontal"===o,"vertical"===o?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!==o&&r.orientation(o),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),i=null,(f&&i||h||m)&&(h&&(h.disconnect(),h=null),m&&(m.disconnect(),m=null),f&&i&&("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(je))&&!(null==r?void 0:r.contains(Ce))}))&&d()})),h.observe(i,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(m=new ResizeObserver(d),m.observe(i)))),f&&i&&d(),` <div${W("class",Ce,0)}${W("this",p,0)}>${N(g,(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",je,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>`})),De={start:"start",center:"center",end:"end","space-between":"start","space-around":"start","space-evenly":"start"},Se={start:"start",center:"center",end:"end",baseline:"baseline","space-between":"start","space-around":"start","space-evenly":"start"},Oe=["rounded_rectangle","circle"],Pe=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,v,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P,I,M,T,z,B=o,U=o,L=o,W=o,H=o,q=o,J=o,G=o,Z=o,Y=o,X=o,Q=o;var tt,et,rt,nt,it,ot,st;let{componentContext:lt}=e,{layoutParams:ct}=e;const ut=f(at);let dt;S=l(ut.direction,(t=>D=t));let pt,vt="vertical",gt="start",ft="start",ht=null,yt=null,bt={},_t=[];void 0===e.componentContext&&r.componentContext&&void 0!==lt&&r.componentContext(lt),void 0===e.layoutParams&&r.layoutParams&&void 0!==ct&&r.layoutParams(ct),lt.json&&(vt="vertical",gt="start",ft="start",pt=void 0),i=lt.json.items,a=lt.getDerivedFromVars(null===(tt=lt.json.item_builder)||void 0===tt?void 0:tt.data,void 0,!0),Q(),Q=l(a,(t=>z=t)),s=lt.getDerivedFromVars(lt.json.orientation),X(),X=l(s,(t=>T=t)),c=lt.getDerivedFromVars(lt.json.layout_mode),Y(),Y=l(c,(t=>M=t)),u=lt.getDerivedFromVars(lt.json.content_alignment_vertical),G(),G=l(u,(t=>P=t)),d=lt.getDerivedFromVars(lt.json.content_alignment_horizontal),J(),J=l(d,(t=>O=t)),p=lt.getDerivedFromVars(lt.json.separator),q(),q=l(p,(t=>V=t)),v=lt.getDerivedFromVars(lt.json.line_separator),H(),H=l(v,(t=>F=t)),g=lt.getDerivedFromVars(lt.json.aspect),W(),W=l(g,(t=>A=t)),h=lt.getDerivedFromVars(lt.json.width),U(),U=l(h,(t=>C=t)),m=lt.getDerivedFromVars(lt.json.height),L(),L=l(m,(t=>j=t)),y=lt.getDerivedFromVars(lt.json.clip_to_bounds),B(),B=l(y,(t=>E=t));{let t=[];if(lt.json.item_builder&&Array.isArray(z)&&Array.isArray(lt.json.item_builder.prototypes)){const e=lt.json.item_builder;t=[],z.forEach((r=>{if(null===r||"object"!=typeof r)return;const n=ut.preparePrototypeVariables(e.data_element_name||"it",r);let i;for(let t=0;t<e.prototypes.length;++t){const r=e.prototypes[t];if(r.div){if(void 0===r.selector){i=r.div;break}if(lt.getJsonWithVars(r.selector,n)){i=r.div;break}}}i&&t.push({div:i,vars:n})}))}else t=(i||[]).map((t=>({div:t})));_t=t.map(((t,e)=>lt.produceChildContext(t.div,{path:e,variables:t.vars})))}{let t=[];_t.forEach((e=>{t.push(lt.getDerivedFromVars({width:e.json.width,height:e.json.height}))})),dt=K(t,(t=>[...t])),Z(),Z=l(dt,(t=>I=t))}if(vt=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(T,vt),b="wrap"===M,_="horizontal"!==vt&&!b&&I.some(we),w="vertical"!==vt&&!b&&I.some($e),gt=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}(P,gt),ft=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}(O,D,ft),(null==V?void 0:V.style)&&"overlap"!==vt&&Ee()){const t=xe(V.style,Oe,(null==ht?void 0:ht.style)||null);ht=t?{show_at_start:Boolean(null!==(et=V.show_at_start)&&void 0!==et&&et),show_at_end:Boolean(null!==(rt=V.show_at_end)&&void 0!==rt&&rt),show_between:Boolean(null===(nt=V.show_between)||void 0===nt||nt),style:t,margins:ye(V.margins)}:null}else ht=null;if((null==F?void 0:F.style)&&"overlap"!==vt&&Ee()){const t=xe(F.style,Oe,(null==yt?void 0:yt.style)||null);yt=t?{show_at_start:Boolean(null!==(it=F.show_at_start)&&void 0!==it&&it),show_at_end:Boolean(null!==(ot=F.show_at_end)&&void 0!==ot&&ot),show_between:Boolean(null===(st=F.show_between)||void 0===st||st),style:t,margins:ye(F.margins)}:null}else yt=null;$=ht||yt?function(t,e,r){const n={};return be(n,e,"vertical"===t),be(n,r,"horizontal"===t),n}(vt,ht,yt):null;{const t=null==A?void 0:A.ratio;pt=t&&Yt(t)?t:void 0}{let t={};"overlap"===vt&&(t.overlapParent=!0),"horizontal"!==vt&&(t.parentHAlign=b?"start":De[ft]),"vertical"!==vt&&(t.parentVAlign=b?"start":Se[gt]),pt||w||j&&"wrap_content"!==j.type&&("match_parent"!==j.type||!(null==ct?void 0:ct.parentVerticalWrapContent))||(t.parentVerticalWrapContent=!0),!_&&("wrap_content"===(null==C?void 0:C.type)||"match_parent"===(null==C?void 0:C.type)&&(null==ct?void 0:ct.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0),"horizontal"===vt&&(t.parentContainerOrientation="horizontal"),"vertical"===vt&&(t.parentContainerOrientation="vertical"),b&&(t.parentContainerWrap=!0),bt=Tt(t,bt)}return x={orientation:vt,valign:gt,halign:ft,wrap:b,overflow:!1===E||0===E?"visible":void 0},k={gap:ht||yt?_e(vt,ht,yt):void 0,"aspect-ratio":pt},B(),U(),L(),W(),H(),q(),S(),J(),G(),Z(),Y(),X(),Q(),`${R(ie,"Outer").$$render(t,{cls:Ft("container",me,x),componentContext:lt,layoutParams:ct,style:k,additionalPaddings:$,heightByAspect:Boolean(pt),parentOf:_t.map((t=>t.json)),replaceItems:function(t){lt=Object.assign(Object.assign({},lt),{json:Object.assign(Object.assign({},lt.json),{items:t.filter(mt)})})}},{},{default:()=>`${N(_t,(e=>`${R(kn,"Unknown").$$render(t,{componentContext:e,layoutParams:bt},{},{})}`))} ${ht||yt?`${R(Ve,"ContainerSeparators").$$render(t,{direction:D,separator:ht,lineSeparator:yt,orientation:vt,contentHAlign:ft,contentVAlign:gt},{},{})}`:""}`})}`})),Ie=Pe,Me={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 Ne=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,v=o,{componentContext:g}=e,{layoutParams:f}=e,h="horizontal",m="rgba(0,0,0,0.08)";return void 0===e.componentContext&&r.componentContext&&void 0!==g&&r.componentContext(g),void 0===e.layoutParams&&r.layoutParams&&void 0!==f&&r.layoutParams(f),g.json&&(h="horizontal",m="rgba(0,0,0,0.08)"),i=g.getDerivedFromVars(g.json.delimiter_style),v(),v=l(i,(t=>p=t)),h=Te(null==p?void 0:p.orientation,h),a=!((null==p?void 0:p.color)&&("transparent"===p.color||9===p.color.length&&0===p.color.indexOf("#00"))),m=gt(null==p?void 0:p.color,1,m),s="horizontal"===h?"100%":dt(1),c="horizontal"===h?dt(1):"100%",u={background:m,width:s,height:c},d={orientation:h},v(),`${R(ie,"Outer").$$render(t,{cls:Ft("separator",Me,d),componentContext:g,layoutParams:f},{},{default:()=>a?`<span${W("class",Me.separator__inner,0)}${W("style",ut(u),0)}></span>`:""})}`})),ze={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 Re(t){return t.startsWith("data:")?ht(t):`data:image/jpg;base64,${ht(t)}`}const Be="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Ue=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P,I,M,T,N,z,B,U,L,H,J,G=o,Z=o,Y=o,X=o,Q=o,K=o,tt=o,et=o,rt=o,nt=o,it=o,ot=o,lt=o,ct=o,dt=o,{componentContext:pt}=e,{layoutParams:vt}=e;const ft=f(at);let ht;V=l(ft.direction,(t=>F=t));let mt,yt,bt=0,_t=!1,xt="rgba(0,0,0,0.08)",kt=!1,Ct="",jt="none",At="50% 50%",Vt="0",Dt="source_in",St="",Ot="",Pt=0,It=0,Mt=0,Tt="",zt="",Rt=!1;v((()=>{ft.removeSvgFilter(yt,Dt)})),void 0===e.componentContext&&r.componentContext&&void 0!==pt&&r.componentContext(pt),void 0===e.layoutParams&&r.layoutParams&&void 0!==vt&&r.layoutParams(vt),pt.json&&(jt="none",At="50% 50%",Dt="source_in"),i=pt.getDerivedFromVars(pt.json.image_url),lt(),lt=l(i,(t=>L=t)),a=pt.getDerivedFromVars(pt.json.gif_url),ct(),ct=l(a,(t=>H=t)),s=pt.getDerivedFromVars(pt.json.width),ot(),ot=l(s,(t=>U=t)),c=pt.getDerivedFromVars(pt.json.height),it(),it=l(c,(t=>B=t)),u=pt.getDerivedFromVars(pt.json.preview),nt(),nt=l(u,(t=>z=t)),d=pt.getDerivedFromVars(pt.json.placeholder_color),rt(),rt=l(d,(t=>N=t)),p=pt.getDerivedFromVars(pt.json.scale),et(),et=l(p,(t=>T=t)),g=pt.getDerivedFromVars({content_alignment_horizontal:pt.json.content_alignment_horizontal,content_alignment_vertical:pt.json.content_alignment_vertical}),tt(),tt=l(g,(t=>M=t)),h=pt.getDerivedFromVars(pt.json.accessibility),K(),K=l(h,(t=>I=t)),m=pt.getDerivedFromVars(pt.json.aspect),Q(),Q=l(m,(t=>P=t)),y=pt.getDerivedFromVars(pt.json.tint_color),X(),X=l(y,(t=>O=t)),b=pt.getDerivedFromVars(pt.json.tint_mode),Y(),Y=l(b,(t=>S=t)),_=pt.getDerivedFromVars(pt.json.appearance_animation),Z(),Z=l(_,(t=>D=t)),w=pt.getDerivedFromVars(pt.json.filters),G(),G=l(w,(t=>A=t)),$=pt.getDerivedFromVars(pt.json.preload_required),dt(),dt=l($,(t=>J=t));{let t="gif"===pt.json.type?H:L;_t="empty://"===t,_t&&(t=Be),mt=t}bt=0,mt?kt=!1:(kt=!0,pt.logError(st(new Error(`Missing "${"gif"===pt.json.type?"gif_url":"image_url"}" for "${pt.json.type}"`)))),x="wrap_content"===(null==U?void 0:U.type),k="wrap_content"===(null==B?void 0:B.type),Ct=z?`url("${Re(z)}")`:"",xt=gt(N,1,xt),jt=wt(T)||jt,At=function(t,e,r){let n=t.content_alignment_horizontal;const i=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||i&&"top"!==i&&"center"!==i&&"bottom"!==i?r:$t({content_alignment_horizontal:n,content_alignment_vertical:i})}(M,F,At),E=(null==I?void 0:I.description)||"";{const t=null==P?void 0:P.ratio;Vt=t&&Yt(t)?(100/Number(t)).toFixed(2):"0"}{const t=O?gt(O):void 0,e=ge(S,Dt);t===yt&&e===Dt||(ft.removeSvgFilter(yt,Dt),St=t?ft.addSvgFilter(t,e):"",yt=t,Dt=e)}if(D&&"fade"===D.type){const t=D;Ot=Nt(t.interpolator,"ease_in_out").replace(/_/g,"-"),Mt=Et(t.duration,300),It=Et(t.start_delay,0),Pt=Et(t.alpha,0)}{let t="",e="";Array.isArray(A)&&A.length&&(t=Xt(A,pt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),Tt=t,zt=e,Rt="rtl"===F&&Array.isArray(A)&&A.some((t=>"rtl_mirror"===t.type))}return C={aspect:"0"!==Vt,"is-width-content":x,"is-height-content":k,loaded:!1,"before-appearance":Boolean(Ot)&&!0,"is-rtl-mirror":Rt},j={"background-image":Ct,"background-color":Ct?void 0:xt,"background-size":jt,"clip-path":zt||void 0,"object-fit":jt,"object-position":At,filter:["",Tt].filter(Boolean).join(" "),"--divkit-appearance-interpolator":Ot||void 0,"--divkit-appearance-fade-start":Ot?Pt:void 0,"--divkit-appearance-delay":Ot?`${It}ms`:void 0,"--divkit-appearance-duration":Ot?`${Mt}ms`:void 0},G(),V(),Z(),Y(),X(),Q(),K(),tt(),et(),rt(),nt(),it(),ot(),lt(),ct(),dt(),kt?"":`${R(ie,"Outer").$$render(t,{cls:Ft("image",ze,C),componentContext:pt,layoutParams:vt,customDescription:!0},{},{default:()=>C.aspect?`<span${W("class",ze["image__aspect-wrapper"],0)}${q({"padding-bottom":`${Vt}%`})}><img${W("class",ze.image__image,0)}${W("src",mt,0)}${W("loading",J?"eager":"lazy",0)} decoding="async"${W("style",ut(j),0)}${W("alt",E,0)}${W("aria-hidden",E?null:"true",0)}${W("this",ht,0)}></span>`:`<img${W("class",ze.image__image,0)}${W("src",mt,0)}${W("loading",J?"eager":"lazy",0)} decoding="async"${W("style",ut(j),0)}${W("alt",E,0)}${W("aria-hidden",E?null:"true",0)}${W("this",ht,0)}>`})}`})),Le={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 He(t){return String(Math.ceil(1e3*t)/1e3)}function qe(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,i=0;const o=[];if(t.every(Boolean)){i=t.reduce(((t,e)=>t+e),0);for(let o=0;o<r;++o){if(!e[o])continue;const r=e[o]/t[o]*i;r>n&&(n=r)}}for(let e=0;e<r;++e)n?o[e]=`minmax(${dt(n*t[e]/i)},${He(t[e])}fr)`:t[e]?o[e]=`${He(t[e])}fr`:o[e]="auto";return o.join(" ")}const Je=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,v,g,h,m,y,b,_,w=o,$=o,x=o,k=o,{componentContext:E}=e,{layoutParams:C}=e;h=l(f(at).direction,(t=>g=t));let j,A,F=1,V=[],D=[],S=[],O=[],P=0,I=!1,M="start",T="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),E.json&&(F=1,M="start",T="start"),i=Array.isArray(E.json.items)&&E.json.items||[],a=E.getDerivedFromVars(E.json.column_count),k(),k=l(a,(t=>_=t)),s=E.getDerivedFromVars(E.json.content_alignment_vertical),$(),$=l(s,(t=>y=t)),c=E.getDerivedFromVars(E.json.content_alignment_horizontal),w(),w=l(c,(t=>m=t)),F=ae(_,F),u=i.map(((t,e)=>E.produceChildContext(t,{path:e})));{let t=[];u.forEach((e=>{t.push(E.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),j=K(t,(t=>[...t])),x(),x=l(j,(t=>b=t))}{const t={};let e=0,r=0;V=[],D=[],S=[],O=[],I=!1,A=u.map(((n,i)=>{var o,a,s,l;const c=b[i],u=Number(c.columnSpan)||1,d=Number(c.rowSpan)||1,p={x:e,y:r,colSpan:u,rowSpan:d},v="match_parent"===(null===(o=c.width)||void 0===o?void 0:o.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]?I=!0:(t[n+"_"+e]=!0,(!V[n]||V[n]<v)&&(V[n]=v),(!D[e]||D[e]<g)&&(D[e]=g),(!S[n]||S[n]<f)&&(S[n]=f),(!O[e]||O[e]<h)&&(O[e]=h));do{++e,e>=F&&(e=0,++r)}while(t[e+"_"+r]);return{componentContext:n,layoutParams:{gridArea:p}}})),0!==e&&(I=!0),I&&E.logError(st(new Error('Mismatching "grid" rows/columns'))),P=r}return M=pe(y,M),T=de(m,g,T),d={valign:M,halign:T},p={"grid-template-columns":qe(V,S,F),"grid-template-rows":qe(D,O,P)},v=I,h(),w(),$(),x(),k(),v?"":`${R(ie,"Outer").$$render(t,{cls:Ft("grid",Le,d),componentContext:E,style:p,layoutParams:C,parentOf:u.map((t=>t.json)),replaceItems:function(t){E=Object.assign(Object.assign({},E),{json:Object.assign(Object.assign({},E.json),{items:t.filter(mt)})})}},{},{default:()=>`${N(A,(e=>`${R(kn,"Unknown").$$render(t,{componentContext:e.componentContext,layoutParams:e.layoutParams},{},{})}`))}`})}`})),Ge=Je,Ze={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"},Ye="divkit-bf36b",Xe="divkit-a67bf",Qe="divkit-e2a31",Ke="divkit-c684b";function tr(t){const e=[];let r=t[0],n=1;for(let i=1;i<=t.length;i++)t[i]!==r?(e.push(n>1?`repeat(${n}, ${r})`:r),r=t[i],n=1):n++;return e.join(" ")}function er(t,e){let r;return function(...n){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,n),r=null}),e)}}const rr=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P,M,T,z,B,U,L,H=o,q=o,J=o,G=o,Z=o,Y=o,X=o,Q=o,tt=o,et=o,rt=o,{componentContext:nt}=e,{layoutParams:ot}=e;const st=f(at);let lt;j=l(st.direction,(t=>C=t));let ct,pt=[],vt=!1,gt=!1,ft=null,ht=!1;const yt=st.getCustomization("galleryLeftClass"),bt=st.getCustomization("galleryRightClass");let _t,wt,$t,xt,kt,Ct=1,jt="horizontal",At="start",Vt=8,Dt="",St=[],Ot={},It=!1,Mt={},Nt=0;U=l(st.isDesktop,(t=>B=t));const zt=er((function(){if(!lt)return;let t=lt.scrollLeft;"rtl"===C&&(t*=-1);const e=lt.scrollWidth,r=lt.offsetWidth;"ltr"===C?(vt=t>2,gt=t+r<e-2):(gt=t>2,vt=t+r<e-2)}),50);function Rt(){let t=[],e=pt[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<Ct;++e){const n=pt[e].children[r];n&&t.push(n)}return t}function Bt(t,e,r="smooth"){const n="horizontal"===jt,i=n?"offsetLeft":"offsetTop",o=n?"left":"top",a=t[e];a&&lt.scroll({[o]:Math.max(0,a[i]+.01-Vt/2),behavior:r})}function Ut(t){const e=Rt(),r=lt.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 i=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()))),o=i.findIndex(Boolean);return-1!==o?"prev"===t&&2===i.filter(Boolean).length?o+1:o:"prev"===t?1:e.length-2}v((()=>{ht=!1,_t&&!nt.fakeElement&&(st.unregisterInstance(_t),_t=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==nt&&r.componentContext(nt),void 0===e.layoutParams&&r.layoutParams&&void 0!==ot&&r.layoutParams(ot),nt.json&&(Ct=1,jt="horizontal",At="start",Vt=8,Dt=""),i=Array.isArray(nt.json.items)&&nt.json.items||[],a=nt.getDerivedFromVars(nt.json.column_count),et(),et=l(a,(t=>z=t)),s=nt.getDerivedFromVars(nt.json.orientation),tt(),tt=l(s,(t=>T=t)),c=nt.getDerivedFromVars(nt.json.cross_content_alignment),Q(),Q=l(c,(t=>M=t)),u=nt.getDerivedFromVars(nt.json.item_spacing),X(),X=l(u,(t=>P=t)),d=nt.getDerivedFromVars(nt.json.cross_spacing),Y(),Y=l(d,(t=>O=t)),p=nt.getDerivedFromVars(nt.json.paddings),Z(),Z=l(p,(t=>S=t)),g=nt.getDerivedFromVars(nt.json.scroll_mode),J(),J=l(g,(t=>V=t)),h=nt.getDerivedFromVars(nt.json.restrict_parent_scroll),rt(),rt=l(h,(t=>L=t)),m=nt.getDerivedFromVars(nt.json.scrollbar),q(),q=l(m,(t=>F=t)),y=nt.getDerivedFromVars(nt.json.default_item),H(),H=l(y,(t=>A=t)),b=i.map(((t,e)=>nt.produceChildContext(t,{path:e}))),_=B&&ht,_?"undefined"!=typeof ResizeObserver&&(ft=new ResizeObserver((()=>{zt()})),ft.observe(ct)):ft&&(ft.disconnect(),ft=null),Ct=ae(z,Ct),w=function(t,e){let r=0,n=[];for(let i=0;i<t.length;++i)n[r]||(n[r]=[]),n[r].push(t[i]),++r>=e&&(r=0);return n}(b,Ct),jt=Te(T,jt),At=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(M,At),Vt=Et(P,Vt),wt=dt(Vt),xt=Et(O,Vt),$t=dt(xt),Dt=Pt(S,C,Dt),$="horizontal"===jt?"grid-template-columns":"grid-template-rows";{let t=[];b.forEach((e=>{const r="horizontal"===jt?"width":"height";t.push(nt.getDerivedFromVars(e.json[r]))})),kt=K(t,(t=>t)),G(),G=l(kt,(t=>D=t))}St=[],Ct>1?St.push("auto"):D.forEach((t=>{!t&&"horizontal"===jt||"match_parent"===(null==t?void 0:t.type)?St.push("100%"):St.push("max-content")}));{const t={};let e={};It=!1,"horizontal"===jt?e.parentVAlign=At:e.parentHAlign=At,"paging"===V&&(It=!0,e.scrollSnap="start",t["horizontal"===jt?"scroll-padding-left":"scroll-padding-top"]=dt(Vt/2)),1===Ct&&(e.parentLayoutOrientation=jt),Ot=Tt(t,Ot),Mt=Tt(e,Mt)}return x={padding:Dt,"grid-gap":$t},k={"grid-gap":wt,[$]:tr(St)},E={orientation:jt,"scroll-snap":It,scrollbar:"auto"===F?"auto":"none"},Nt=Et(A,Nt),nt.json&&zt(),nt.json&&(_t&&(st.unregisterInstance(_t),_t=void 0),nt.json.id&&!nt.fakeElement&&(_t=nt.json.id,st.registerInstance(_t,{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');Bt(e,t)},setPreviousItem(t){const e=Ut("prev"),r=Rt();let n=e-1;n<0&&(n="ring"===t?r.length-1:e),Bt(r,n)},setNextItem(t){const e="horizontal"===jt?lt.scrollLeft+lt.offsetWidth===lt.scrollWidth:lt.scrollTop+lt.offsetHeight===lt.scrollHeight,r=Rt();if(e&&"ring"===t)return void Bt(r,0);const n=Ut("next");let i=n+1;i>r.length-1&&(i="ring"===t?0:n),Bt(r,i)}}))),j(),H(),q(),J(),G(),Z(),Y(),X(),Q(),tt(),et(),U(),rt(),` ${R(ie,"Outer").$$render(t,{cls:Ft("gallery",Ze,E),componentContext:nt,layoutParams:ot,customPaddings:!0,customActions:"gallery",parentOf:i,replaceItems:function(t){nt=Object.assign(Object.assign({},nt),{json:Object.assign(Object.assign({},nt.json),{items:t.filter(mt)})})}},{},{default:()=>`<div class="${I(Ze.gallery__scroller,!0)+" "+I(L?it:"",!0)}"${W("style",ut(Ot),0)}${W("this",lt,0)}><div${W("class",Ze["gallery__items-grid"],0)}${W("style",ut(x),0)}${W("this",ct,0)}>${N(w,((e,r)=>`<div${W("class",Ze.gallery__items,0)}${W("style",ut(k),0)}${W("this",pt[r],0)}>${N(e,(e=>`${R(kn,"Unknown").$$render(t,{componentContext:e,layoutParams:Mt},{},{})}`))} </div>`))}</div></div> ${"horizontal"===jt?`${vt&&_?` <div${W("class",yt||`${Ze.gallery__arrow} ${Ye} ${Qe}`,0)}>${yt?"":`<svg${W("class",Xe,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${W("class",Ze["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&&_?` <div${W("class",bt||`${Ze.gallery__arrow} ${Ye} ${Ke}`,0)}>${bt?"":`<svg${W("class",Xe,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${W("class",Ze["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,ir={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__separator:"divkit-b85bf"},or=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,x,k,E,C,j,A,F,V,D,S,O,P,M,T,z,B=o,U=o,L=o,H=o,J=o,G=o,Z=o,Y=o,X=o;var K,tt;let{componentContext:et}=e,{layoutParams:rt}=e;const nt=f(at);V=l(nt.direction,(t=>F=t));const ot=nt.genId("tabs");let lt,ct=!1,vt=Q([]);C=l(vt,(t=>E=t));let ft,ht,mt,yt,bt,_t,wt,$t={},xt=12,kt="",Ct="",jt="",At="",Vt="",St="",It="",Mt="",Nt="",zt="",Rt=0,Wt="",Ht="",qt=null,Jt=!1,Zt=!1,Xt=[],Qt=[],Kt=null;async function te(t,e=!1){if(_t=_,_=t,Jt||(Jt=!0,ht.style.height=dt(ht.clientHeight),mt.style.transform=`translate3d(${100*-(null!=_t?_t:_)}%,0,0)`),Zt=!0,async function(t){await $(),mt.style.transform=`translate3d(${t}%,0,0)`}(100*-_),function(t=!1){const e=t?Math.max(0,_-1):Math.min(_,null!=_t?_t:_),r=t?Math.min(i.length-1,_+1):Math.max(_,null!=_t?_t:_);Xt=Xt.map(((t,n)=>{var o;return t||(n>=e&&n<=r&&(null===(o=i[n])||void 0===o?void 0:o.div)?et.produceChildContext(i[n].div,{path:n}):void 0)})),Qt=Qt.map(((t,n)=>n>=e&&n<=r))}(),async function(){await $();const t=document.getElementById(`${ot}-panel-${_}`);t&&(ht.style.height=dt(t.offsetHeight))}(),Kt&&clearTimeout(Kt),Kt=window.setTimeout((()=>{Qt=i.map(((t,e)=>e===_))}),400),wt=-_*ht.clientWidth,e){await $();const t=ft.querySelector(`.${ir.tabs__item_selected}`);t&&t.focus()}}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),et.json&&(xt=12,kt="",At="",yt=void 0,Vt="",bt=void 0,St="",It="",Mt="",Nt="",zt="",Rt=0,Wt="",Ht="",qt=null),i=et.json.items||[],a=i.map((t=>t.div)),s=et.getDerivedFromVars(et.json.width),Y(),Y=l(s,(t=>T=t)),c=et.getDerivedFromVars(et.json.height),Z(),Z=l(c,(t=>M=t)),u=et.getJsonWithVars(et.json.selected_tab),d=et.getDerivedFromVars(et.json.tab_title_style),G(),G=l(d,(t=>P=t)),p=et.getDerivedFromVars(et.json.has_separator),J(),J=l(p,(t=>O=t)),g=et.getDerivedFromVars(et.json.separator_color),H(),H=l(g,(t=>S=t)),h=et.getDerivedFromVars(et.json.separator_paddings),L(),L=l(h,(t=>D=t)),m=et.getDerivedFromVars(et.json.switch_tabs_by_content_swipe_enabled),U(),U=l(m,(t=>A=t)),y=et.getDerivedFromVars(et.json.restrict_parent_scroll),X(),X=l(y,(t=>z=t)),b=et.getDerivedFromVars(et.json.title_paddings),B(),B=l(b,(t=>j=t)),_=u&&Number(u)||0,Array.isArray(i)&&i.length){let t=[];i.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([]);(null==E?void 0:E.length)?ct=!1:(ct=!0,et.logError(st(new Error('Incorrect or empty "items" prop for div "tabs"'))));{let t={};"wrap_content"===(null==T?void 0:T.type)&&(t.parentHorizontalWrapContent=!0),M&&"wrap_content"!==M.type||(t.parentVerticalWrapContent=!0),$t=Tt(t,$t)}if(!ct&&(_<0||_>=i.length)&&(et.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:et.json.selected_tab,length:i.length}})),_=_<0?0:i.length-1),ct||E.some((t=>_===t.index))||(et.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:et.json.selected_tab}})),_=(null===(K=E[0])||void 0===K?void 0:K.index)||0),w=P||{},xt=ae(w.font_size,xt),w.font_size||w.paddings){const t=w.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/xt*10,right:(Number("ltr"===F?t.end:t.start)||Number(t.right)||0)/xt*10,bottom:(Number(t.bottom)||0)/xt*10,left:(Number("ltr"===F?t.start:t.end)||Number(t.left)||0)/xt*10};kt=Pt(e,F,kt)}{const t=w.line_height;void 0!==t&&Yt(t)&&(Ct=dt(t/xt*10))}{const t=w.letter_spacing;void 0!==t&&Ot(t)&&(jt=dt(t/xt*10))}if(w.corner_radius||w.corners_radius||w.font_size){const t=null!==(tt=w.corner_radius)&&void 0!==tt?tt:1e3;w.corners_radius?At=function(t,e,r,n){const i=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<i.length;++t)if(i[t]&&!Ot(i[t]))return n;return Ut(t,e,r)}(w.corners_radius,t,xt,At):Ot(t)&&(At=dt(t/xt*10))}return yt=le(w.active_font_weight||w.font_weight,yt),Vt=w.font_family&&"string"==typeof w.font_family?nt.typefaceProvider(w.font_family,{fontWeight:yt||400}):"",bt=le(w.inactive_font_weight||w.font_weight,bt),St=w.font_family&&"string"==typeof w.font_family?nt.typefaceProvider(w.font_family,{fontWeight:bt||400}):"",It=gt(w.active_text_color,1,It),Mt=gt(w.inactive_text_color,1,Mt),Nt=gt(w.active_background_color,1,Nt),zt=gt(w.inactive_background_color,1,zt),Rt=Et(w.item_spacing,Rt),O&&(S&&(Wt=gt(S,1,Wt)),D&&(Ht=Pt(D,F,Ht))),x={background:Wt,margin:Ht},k=void 0===A||Boolean(A),qt=Bt(j||void 0,qt),function(t){ct||(Xt=t.map(((t,e)=>{if(e===_&&(null==t?void 0:t.div))return et.produceChildContext(t.div,{path:e})})),Qt=t.map(((t,e)=>e===_)))}(i),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>i.length-1)throw new Error('Item is out of range in "set-current-item" action');te(t)},setPreviousItem(t){let e=_-1;e<0&&(e="ring"===t?i.length-1:_),te(e)},setNextItem(t){let e=_+1;e>i.length-1&&(e="ring"===t?0:_),te(e)}}))),C(),B(),U(),V(),L(),H(),J(),G(),Z(),Y(),X(),ct?"":`${R(ie,"Outer").$$render(t,{cls:Ft("tabs",ir,{}),componentContext:et,layoutParams:rt,customActions:"tabs",parentOf:a,parentOfSimpleMode:!0,replaceItems:function(t){et.json.items&&(et=Object.assign(Object.assign({},et),{json:Object.assign(Object.assign({},et.json),{items:et.json.items.map(((e,r)=>Object.assign(Object.assign({},e),{div:t[r]})))})}))}},{},{default:()=>` <div class="${I(ir.tabs__list,!0)+" "+I(z?it:"",!0)}" role="tablist"${q({"--divkit-tabs-title-padding":qt?Dt(qt,F):"","--divkit-tabs-font-size":dt(xt),"--divkit-tabs-paddings":kt,"--divkit-tabs-line-height":Ct,"--divkit-tabs-letter-spacing":jt,"--divkit-tabs-active-font-weight":yt||"","--divkit-tabs-inactive-font-weight":bt||"","--divkit-tabs-active-font-family":Vt||"","--divkit-tabs-inactive-font-family":St||"","--divkit-tabs-active-text-color":It,"--divkit-tabs-inactive-text-color":Mt,"--divkit-tabs-active-background-color":Nt,"--divkit-tabs-inactive-background-color":zt,"--divkit-tabs-border-radius":At,"--divkit-tabs-items-spacing":Rt?pt(Rt):""})}${W("this",ft,0)}>${N(E,(e=>{let r=e.index,n=r===_;return` ${R(Gt,"Actionable").$$render(t,{componentContext:et,cls:Ft("tabs__item",ir,{selected:n,actionable:Boolean(e.title_click_action)}),actions:e.title_click_action&&!et.fakeElement?[e.title_click_action].filter(Lt):[],attrs:{id:`${ot}-tab-${r}`,"aria-controls":`${ot}-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 _===e||(te(e),!1)}(0,r)},{},{default:()=>`${I(e.title)} `})}`}))}</div> ${O?`<div${W("class",ir.tabs__separator,0)}${W("style",ut(x),0)}></div>`:""} <div class="${I(ir.tabs__panels,!0)+" "+I(z?it:"",!0)}"${W("this",ht,0)}><div${W("class",Ft("tabs__swiper",ir,{inited:Jt,animated:Zt}),0)}${W("this",mt,0)}>${N(E,(e=>{let r=e.index,n=Xt[r];return` <div${W("class",Ft("tabs__panel",ir,{visible:Qt[r]}),0)} role="tabpanel" id="${I(ot,!0)+"-panel-"+I(r,!0)}" aria-labelledby="${I(ot,!0)+"-tab-"+I(r,!0)}" style="${"left: "+I(100*r,!0)+"%"}">${n?`${R(kn,"Unknown").$$render(t,{componentContext:n,layoutParams:$t},{},{})}`:""} </div>`}))}</div></div>`})}`})),ar=or,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),i=r-n;return t[n]*i+t[n+1]*(1-i)}}function ur(t){return Math.max(...t.map((t=>(Number(t.duration)||200)+(Number(t.start_delay)||0))))}function dr(t){const e=[];return"set"===t.type?(t.items||[]).forEach((t=>{e.push(...dr(t))})):e.push(t),e}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 pr={tooltip:"divkit-f1907",tooltip_visible:"divkit-e5914"},vr=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,$=o,x=o,k=o,E=o,C=o;var j,A,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),i=P.produceChildContext(S.div),a=P.getDerivedFromVars(S.position),k(),k=l(a,(t=>m=t)),s=P.getDerivedFromVars(null===(A=null===(j=S.offset)||void 0===j?void 0:j.x)||void 0===A?void 0:A.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",pr,p),!0)+" "+I(y?nt:"",!0)}"${q({top:"",left:"",width:"",height:""})}${W("this",undefined,0)}>${R(kn,"Unknown").$$render(t,{componentContext:i},{},{})}</div>`}));function gr(t){return"change_bounds"===t.type?t:"set"===t.type?gr(t.items[0]):null}const fr=L(((t,e,r,n)=>{let i,o,a,s,l,c,{componentContext:u}=e,{layoutParams:d}=e;const p=f(at),h=f(Vt);let m,y,b,_,w=!1,x=new Map,k=new Set,E=null,C=[],j=[],A=[],F=[],V=!1;function D(t){_=(null==t?void 0:t.div)?u.produceChildContext(t.div,{path:t.state_id||"<unknown>"}):void 0}function S(t,e,r){let{json:n,parentComponentContext:i,transitions:o,node:a}=e;n=u.getJsonWithVars(n),o=u.getJsonWithVars(o);const s=dr(o),l=a.getBoundingClientRect(),c=Object.assign(Object.assign({},n),{margins:void 0,alpha:(d=s,d.some((t=>"fade"===t.type))?void 0:n.alpha)});var d;return{json:c,componentContextCopy:i.produceChildContext(c,{fake:!0}),elementBbox:l,rootBbox:t,transitions:s,alpha:n.alpha,width:l.width,height:l.height,offsetTop:l.top-t.top,offsetLeft:l.left-t.left,direction:r,resolvePromise:e.resolvePromise,node:e.node}}async function O(t){if(b===t)return;p.setRunning("stateChange",!0);const e=new Set(k);C.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),C=[];let r=[];if(m){const t=m.getBoundingClientRect();r=A.map((e=>S(t,e,"out")))}F.forEach((t=>{x.set(t.id,t.node.getBoundingClientRect())})),j=[],A=[],F=[];const n=l.find((e=>e.state_id===t))||null;if(n?(b=t,null==s||s.setValue(b),D(n)):u.logError(st(new Error("Cannot find state with id"),{additional:{stateId:t}})),await $(),!m)return;const i=m.getBoundingClientRect();let o=j.filter((t=>{var r;return!(!t.json.id||e.has(t.json.id))||(null===(r=t.resolvePromise)||void 0===r||r.call(t),!1)})).map((t=>S(i,t,"in")));r=r.filter((t=>{var e;return!(!t.json.id||k.has(t.json.id))||(null===(e=t.resolvePromise)||void 0===e||e.call(t),!1)}));const a=r.concat(o),c=a.reduce(((t,e)=>Math.max(t,ur(e.transitions))),0),d=F.filter((t=>x.has(t.id))).map((t=>{const e=Object.assign(Object.assign({},t.json),{margins:void 0,width:{type:"match_parent"},height:{type:"match_parent"}});return{json:e,componentContextCopy:t.parentComponentContext.produceChildContext(e,{fake:!0}),rootBbox:i,beforeBbox:x.get(t.id),afterBbox:t.node.getBoundingClientRect(),node:t.node,transition:u.getJsonWithVars(gr(t.transitions)),resolvePromise:t.resolvePromise}}));C=[...a.map((t=>Object.assign(Object.assign({},t),{maxDuration:c}))),...d],x.clear(),p.setRunning("stateChange",!1)}return g(Vt,{registerInstance(t,e){E||(E=new Map),E.has(t)?u.logError(st(new Error("Duplicate state with id"),{additional:{id:t}})):E.set(t,e)},unregisterInstance(t){null==E||E.delete(t)},runVisibilityTransition(t,e,r,n,i){if(!m)return Promise.resolve();const o=S(m.getBoundingClientRect(),{json:t,parentComponentContext:e,transitions:r,node:n},i),a=ur(o.transitions),s=Object.assign(Object.assign({},o),{maxDuration:a});return C=[...C.filter((t=>t.node!==o.node)),s],new Promise((t=>{s.resolvePromise=t}))},registerChildWithTransitionIn(t,e,r,n){const i={json:t,parentComponentContext:e,transitions:r,node:n};return j.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,n){const i={json:t,parentComponentContext:e,transitions:r,node:n};return A.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,n){const i=t.id;if(!i)return Promise.resolve();const o={id:i,json:t,parentComponentContext:e,transitions:r,node:n};return F.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&x.has(t),registerChild(t){k.add(t)},unregisterChild(t){k.delete(t)}}),v((()=>{y&&h.unregisterInstance(y)})),void 0===e.componentContext&&r.componentContext&&void 0!==u&&r.componentContext(u),void 0===e.layoutParams&&r.layoutParams&&void 0!==d&&r.layoutParams(d),i=u.json.div_id||u.json.id,o=u.getJsonWithVars(u.json.default_state_id),a=u.json.state_id_variable,s=a?u.getVariable(a,"string"):null,u.json&&(V=!1),i?w=!1:(w=!0,u.logError(st(new Error('Missing "id" prop for div "state"')))),u.json&&(k=new Set),l=u.json.states||[],c=l.map((t=>t.div)),(null==l?void 0:l.length)?w=!1:(w=!0,u.logError(st(new Error('Empty "states" prop for div "state"')))),u.json&&(y&&(h.unregisterInstance(y),y=void 0),i&&!(null==u?void 0:u.fakeElement)&&(y=i,h.registerInstance(i,{setState:O,getChild:function(t){if(E&&E.has(t))return E.get(t);u.logError(st(new Error("Missing state block with id"),{additional:{id:t}}))}}))),!V&&function(t){if(!V&&(V=!0,t.length)){const e=(null==s?void 0:s.getValue())||o;if(e){b=e;const r=t.find((t=>t.state_id===b))||null;D(r),r||u.logError(st(new Error("Cannot find state for default_state_id"),{additional:{selectedId:b}}))}else{const e=t[0];b=e.state_id,D(e)}s&&(s.setValue(b),s.subscribe((t=>{O(t)})))}}(l),w?"":`${R(ie,"Outer").$$render(t,{cls:"divkit-b8efc",componentContext:u,layoutParams:d,parentOf:c,parentOfSimpleMode:!0,replaceItems:function(t){const e=u.json.states;e&&(l=e.map(((e,r)=>Object.assign(Object.assign({},e),{div:t[r]}))),u.json=Object.assign(Object.assign({},u.json),{states:l}),b&&D(l.find((t=>t.state_id===b))||null))}},{},{default:()=>`${_?`${R(kn,"Unknown").$$render(t,{componentContext:_},{},{})}`:""} <div${W("class","divkit-adaae",0)} aria-hidden="true"${W("this",m,0)}>${N(C,(e=>"direction"in e?`<div${W("class",sr,0)}${q({left:`${e.offsetLeft}px`,top:`${e.offsetTop}px`,width:`${e.width}px`,height:`${e.height}px`})}><div${W("class",lr,0)}>${R(kn,"Unknown").$$render(t,{componentContext:e.componentContextCopy},{},{})}</div> </div>`:`<div${W("class",sr,0)}><div${W("class",lr,0)}>${R(kn,"Unknown").$$render(t,{componentContext:e.componentContextCopy},{},{})}</div> </div>`))}</div>`})} ${null!=u&&u.tooltips?`${N(u.tooltips,(e=>`${R(vr,"TooltipView").$$render(t,{ownerNode:e.ownerNode,data:e.desc,internalId:e.internalId,parentComponentContext:u},{},{})}`))}`:""}`})),hr=fr,mr={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"},yr=L(((t,e,r,n)=>{let i,a,s,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O=o,P=o,M=o,T=o,z=o,B=o;var U,L,H,q,J,G,Z,Y,X,Q;let{componentContext:K}=e,{layoutParams:tt}=e;const et=f(at);E=l(et.direction,(t=>k=t));const rt=et.genId("pager"),nt=et.getCustomization("pagerLeftClass"),ot=et.getCustomization("pagerRightClass");j=l(et.isDesktop,(t=>C=t)),er((function(){if(!vt)return;const t=function(){const t=Array.from(ct.children),e=ct.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,n=t.getBoundingClientRect(),"horizontal"===yt?n.left>=r.left&&n.right<=r.right:n.top>=r.top&&n.bottom<=r.bottom;var r,n}));return-1!==r?r:gt}();t!==gt&&(gt=t)}),50);let lt,ct,vt=!1,gt=0,ft=0,ht=!1,yt="horizontal",bt="",_t="",wt="";function $t(t,e="smooth"){const r="horizontal"===yt,n=ct.children[t],i=r?"offsetLeft":"offsetTop",o=r?"left":"top";ct.scroll({[o]:n[i],behavior:e}),gt=t}v((()=>{vt=!1,lt&&(et.unregisterInstance(lt),lt=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==K&&r.componentContext(K),void 0===e.layoutParams&&r.layoutParams&&void 0!==tt&&r.layoutParams(tt),K.json&&(_t=""),i=K.getDerivedFromVars(K.json.layout_mode),P(),P=l(i,(t=>A=t)),a=K.getDerivedFromVars(K.json.orientation),z(),z=l(a,(t=>D=t)),s=K.getDerivedFromVars(K.json.item_spacing),T(),T=l(s,(t=>V=t)),u=K.getDerivedFromVars(K.json.paddings),M(),M=l(u,(t=>F=t)),d=K.getDerivedFromVars(K.json.restrict_parent_scroll),B(),B=l(d,(t=>S=t)),p=(Array.isArray(K.json.items)&&K.json.items||[]).map(((t,e)=>K.produceChildContext(t,{path:e}))),A?"percentage"!==A.type&&"fixed"!==A.type?(ht=!0,K.logError(st(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):ht=!1:(ht=!0,K.logError(st(new Error('Empty "layout_mode" prop for div "pager"')))),yt=Te(D,yt);{const t=null==V?void 0:V.value;t&&Ot(t)&&(bt=dt(t||0))}if(_t=Pt(F,k,_t),g="horizontal"===yt?"grid-auto-columns":"grid-auto-rows","fixed"===(null==A?void 0:A.type)){const t=pt("horizontal"===yt?(("ltr"===k?null===(U=K.json.paddings)||void 0===U?void 0:U.start:null===(L=K.json.paddings)||void 0===L?void 0:L.end)||(null===(H=K.json.paddings)||void 0===H?void 0:H.left)||0)+(("ltr"===k?null===(q=K.json.paddings)||void 0===q?void 0:q.end:null===(J=K.json.paddings)||void 0===J?void 0:J.start)||(null===(G=K.json.paddings)||void 0===G?void 0:G.right)||0):((null===(Z=K.json.paddings)||void 0===Z?void 0:Z.top)||0)+((null===(Y=K.json.paddings)||void 0===Y?void 0:Y.bottom)||0)),e=null===(X=A.neighbour_page_width)||void 0===X?void 0:X.value;wt=e?`calc(100% + ${t} - 2 * ${pt(e)} - 2 * ${bt})`:"100%"}else if("percentage"===(null==A?void 0:A.type)){const t=null===(Q=A.page_width)||void 0===Q?void 0:Q.value;wt=`${Number(t)}%`}return h={"grid-gap":bt,padding:_t,[g]:wt},m={orientation:yt},y=ht,b=C&&vt&&!y,_="ltr"===k?gt>0:gt+1<p.length,w="ltr"===k?gt+1<p.length:gt>0,$=et.getStore("pagers"),O(),O=l($,(t=>x=t)),function(t,e){const r=K.json.id;if(r){const n=new Map(x);c($,x=n.set(r,{instId:rt,size:t,currentItem:e,scrollToPagerItem:$t}),x)}}(p.length,gt),function(t){var e;if(t===ft)return;ft=t;const r=K.getJsonWithVars(null===(e=p[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&K.execAnyActions(r)}(gt),K.json&&(lt&&(et.unregisterInstance(lt),lt=void 0),K.json.id&&!K.fakeElement&&(lt=K.json.id,et.registerInstance(lt,{setCurrentItem(t){if(t<0||t>p.length-1)throw new Error('Item is out of range in "set-current-item" action');$t(t)},setPreviousItem:function(t){let e=gt-1;e<0&&(e="ring"===t?p.length-1:gt),$t(e)},setNextItem:function(t){let e=gt+1;e>p.length-1&&(e="ring"===t?0:gt),$t(e)}}))),O(),E(),j(),P(),M(),T(),z(),B(),y?"":`${R(ie,"Outer").$$render(t,{cls:Ft("pager",mr,m),componentContext:K,layoutParams:tt,customPaddings:!0,parentOf:p.map((t=>t.json)),replaceItems:function(t){K=Object.assign(Object.assign({},K),{json:Object.assign(Object.assign({},K.json),{items:t.filter(mt)})})}},{},{default:()=>`<div class="${I(mr.pager__items,!0)+" "+I(S?it:"",!0)}"${W("style",ut(h),0)}${W("this",ct,0)}>${N(p,(e=>`<div${W("class",mr.pager__item,0)}>${R(kn,"Unknown").$$render(t,{componentContext:e},{},{})} </div>`))}</div> ${_&&b?` <div${W("class",nt||`${mr.pager__arrow} ${Ye} ${Qe}`,0)}>${nt?"":`<svg${W("class",Xe,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${W("class",mr["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>`:""} ${w&&b?` <div${W("class",ot||`${mr.pager__arrow} ${Ye} ${Ke}`,0)}>${ot?"":`<svg${W("class",Xe,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${W("class",mr["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>`:""}`})}`})),br=yr,_r={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"},wr=["rounded_rectangle","circle"],$r=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,v,g,h,m,y,b,_,w,x,k,E,C,j,A,F=o,V=o,D=o,S=o,O=o,P=o,M=o,T=o,z=o;var B,U;let{componentContext:L}=e,{layoutParams:H}=e;const J=f(at);y=l(J.direction,(t=>m=t));let G,Z,Y,X={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},Q={width:10,height:10,borderRadius:5,background:"#33919cb5"},K="default",et=15,rt=10,nt=5;if(void 0===e.componentContext&&r.componentContext&&void 0!==L&&r.componentContext(L),void 0===e.layoutParams&&r.layoutParams&&void 0!==H&&r.layoutParams(H),L.json&&(K="default",et=15,rt=10,nt=5,X={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},Q={width:10,height:10,borderRadius:5,background:"#33919cb5"}),i=L.getDerivedFromVars(L.json.shape),P(),P=l(i,(t=>E=t)),a=L.getDerivedFromVars(L.json.active_item_color),S(),S=l(a,(t=>x=t)),s=L.getDerivedFromVars(L.json.inactive_item_color),O(),O=l(s,(t=>k=t)),c=L.getDerivedFromVars(L.json.active_item_size),M(),M=l(c,(t=>C=t)),u=L.getDerivedFromVars(L.json.active_shape),z(),z=l(u,(t=>A=t)),d=L.getDerivedFromVars(L.json.inactive_shape),T(),T=l(d,(t=>j=t)),p=L.getDerivedFromVars(L.json.space_between_centers),V(),V=l(p,(t=>_=t)),v=L.getDerivedFromVars(L.json.items_placement),D(),D=l(v,(t=>w=t)),A&&(X=xe({type:"shape_drawable",shape:A},wr,X)),j&&(Q=xe({type:"shape_drawable",shape:j},wr,Q)),!A&&!j&&E){const t=ae(C,1.3);Q=xe({type:"shape_drawable",shape:E,color:Q.background},wr,Q),Q.background=gt(k,1,Q.background),X=Object.assign(Object.assign({},Q),{width:Q.width*t,height:Q.height*t,borderRadius:Q.borderRadius*t,background:X.background}),X.background=gt(x,1,X.background)}if(!w||"default"!==w.type&&"stretch"!==w.type)K="default",_&&(et=Et(_.value,et));else if(K=w.type,"default"===K)et=Et(null===(B=w.space_between_centers)||void 0===B?void 0:B.value,et);else if("stretch"===K){const t=w;rt=ae(t.max_visible_items,rt),nt=Et(null===(U=t.item_spacing)||void 0===U?void 0:U.value,nt)}return g=J.getStore("pagers"),F(),F=l(g,(t=>b=t)),async function(t){if(L.json.pager_id&&t.has(L.json.pager_id)&&(Y=t.get(L.json.pager_id),await $(),Z)){const t=Z.children[Y.currentItem];if(t){const e=t.offsetLeft;G.scroll({left:e-G.clientWidth/2,behavior:"smooth"})}}}(b),h={placement:K,direction:m},y(),F(),V(),D(),S(),O(),P(),M(),T(),z(),`${R(ie,"Outer").$$render(t,{cls:Ft("indicator",_r,h),componentContext:L,layoutParams:H},{},{default:()=>`<div${W("class",_r.indicator__scroller,0)}${W("this",G,0)}><div${W("class",_r.indicator__items,0)} role="tablist"${q({margin:"default"===K?`0 ${dt(Math.max(0,X.width-Q.width)/2)}`:"","--divkit-indicator-inactive-width":dt(Q.width),"--divkit-indicator-inactive-height":dt(Q.height),"--divkit-indicator-inactive-border-radius":dt(Q.borderRadius),"--divkit-indicator-inactive-background":Q.background||"","--divkit-indicator-inactive-box-shadow":Q.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/Q.width,"--divkit-indicator-default-margin":"default"===K?`0 ${dt((et-Q.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===K?dt(nt):"","--divkit-indicator-stretch-max-count":"stretch"===K?rt:"","--divkit-indicator-stretch-max-spacer":"stretch"===K?dt((rt-1)*nt):""})}${W("this",Z,0)}>${Y?`${N(Array(Y.size),((t,e)=>{let r=e===Y.currentItem;return` <div class="${I(Ft("indicator__item",_r,{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)}"${W("aria-selected",r?"true":"false",0)}${W("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),xr=$r,kr={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 Er(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&gt(t.text_color)||"#000",i=se(t.font_weight);if(Yt(t.font_size)&&"transparent"!==n){var o,a;const e={fontSize:dt(t.font_size),fontWeight:i,textColor:n};return"number"==typeof(null==r||null===(o=r.x)||void 0===o?void 0:o.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 Cr(t,e,r){return Math.max(e,Math.min(r,Number(t)))}const jr="function"==typeof BigInt;function Ar(t){return jr?BigInt(t):Number(t)}const Fr=Ar("9223372036854775807"),Vr=Ar("-9223372036854775808");function Dr(t){const e=Ar(t);if(e>Fr||e<Vr)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 Sr=Dr(0);function Or(t){let e=t;return e<0&&(e=-e),e}function Pr(t){let e=0;return t>0?e=1:t<0&&(e=-1),Dr(e)}class Ir{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 Mr extends Ir{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}}class Tr extends Ir{convertValue(t){if("bigint"!=typeof t&&"number"!=typeof t)throw new Error("Incorrect variable value");try{return Dr(t)}catch(t){throw new Error("Incorrect variable value")}}fromString(t){try{return Dr(t)}catch(t){throw new Error("Incorrect variable value")}}getType(){return"integer"}}class Nr extends Ir{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 zr extends Ir{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 Rr extends Ir{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 Br extends Ir{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}class Ur extends Ir{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 Lr extends Ir{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 Wr={string:Mr,number:Nr,integer:Tr,boolean:zr,color:Rr,url:Br,dict:Ur,array:Lr};function Hr(t,e,r){if(!(e in Wr))throw new Error("Unsupported variable type");return new Wr[e](t,r)}function qr(){}function Jr(t){return t(this.value),qr}function Gr(){throw new Error("Cannot change the value of this type of variable")}const Zr={string:class extends Mr{},number:class extends Nr{},integer:class extends Tr{},boolean:class extends zr{},color:class extends Rr{},url:class extends Br{},dict:class extends Ur{},array:class extends Lr{}};for(const t in Zr){const e=Zr[t];e.prototype.subscribe=Jr,e.prototype.set=Gr,e.prototype.setValue=Gr}const Yr={width:10,height:10,borderRadius:5,background:"#000"},Xr=["rounded_rectangle","circle"],Qr=["rounded_rectangle"];function Kr(t,e,r,n,i){let o=[];if(i)for(let i=t;i<e;++i)o.push((i-r)/(n-r));else{for(let e=r;e<t;++e)o.push((e-r)/(n-r));for(let t=e;t<n+1;++t)o.push((t-r)/(n-r))}return o}const tn=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P,M,T,z,B,U,L,H,J,G,Z,Y,X,Q,K=o,tt=o,et=o,rt=o,nt=o,it=o,ot=o,lt=o,ct=o,ut=o,vt=o,gt=o,ft=o,ht=o;var mt,yt,bt,_t;let{componentContext:wt}=e,{layoutParams:$t}=e;const xt=f(at),kt=f(qt);let Et,Ct;O=l(xt.direction,(t=>S=t));let jt,At,Vt,Dt=0,St=100,Pt=Yr,It=Pt,Mt=Yr,Tt=Yr,Nt=null,Rt=null,Bt=Vt,Ut="",Lt="",Wt=!1,Ht=Cr(Y||0,Dt,St),Jt=Cr(Z||0,Dt,St),Gt=!1;function Zt(){if(!Ct)return;const t=St-Dt,e=(null==Nt?void 0:Nt.width)||0,r=(null==Rt?void 0:Rt.width)||0;Math.max(e,r)*t>=(null==Ct?void 0:Ct.clientWidth)?Gt||(wt.logError(st(new Error("Slider ticks overlap each other"),{level:"warn"})),Gt=!0):Gt=!1}er(Zt,50),v((()=>{Et&&(xt.unregisterFocusable(Et),Et=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==wt&&r.componentContext(wt),void 0===e.layoutParams&&r.layoutParams&&void 0!==$t&&r.layoutParams($t),wt.json&&(Pt=Yr,It=Pt,Mt=Yr,Tt=Yr,Nt=null,Rt=null,Vt=void 0,Bt=void 0,Ut="",Lt=""),i=wt.json.thumb_value_variable,a=wt.json.thumb_secondary_value_variable,s=i&&wt.getVariable(i,"integer")||Hr("temp","integer",0),gt(),gt=l(s,(t=>Y=t)),c=a&&wt.getVariable(a,"integer")||Hr("temp","integer",0),vt(),vt=l(c,(t=>Z=t)),u=wt.getDerivedFromVars(wt.json.min_value),ht(),ht=l(u,(t=>Q=t)),d=wt.getDerivedFromVars(wt.json.max_value),ft(),ft=l(d,(t=>X=t)),p=wt.getDerivedFromVars(wt.json.thumb_style),ut(),ut=l(p,(t=>G=t)),g=wt.getDerivedFromVars(wt.json.thumb_secondary_style),ct(),ct=l(g,(t=>J=t)),h=wt.getDerivedFromVars(wt.json.track_inactive_style),lt(),lt=l(h,(t=>H=t)),m=wt.getDerivedFromVars(wt.json.track_active_style),ot(),ot=l(m,(t=>L=t)),y=wt.getDerivedFromVars(wt.json.tick_mark_active_style),it(),it=l(y,(t=>U=t)),b=wt.getDerivedFromVars(wt.json.tick_mark_inactive_style),nt(),nt=l(b,(t=>B=t)),_=wt.getDerivedFromVars(wt.json.thumb_text_style),rt(),rt=l(_,(t=>z=t)),w=wt.getDerivedFromVars(wt.json.thumb_secondary_text_style),et(),et=l(w,(t=>T=t)),$=wt.getDerivedFromVars(wt.json.accessibility),tt(),tt=l($,(t=>M=t)),x=wt.getDerivedFromVars(wt.json.secondary_value_accessibility),K(),K=l(x,(t=>P=t)),Dt=zt(Q,Dt),St=zt(X,St),Zt();{const t=Cr(Y||0,Dt,St);t!==Ht&&(Ht=t)}{const t=Cr(Z||0,Dt,St);t!==Jt&&(Jt=t)}Pt=xe(G,Xr,Pt),It=xe(J,Xr,Pt),Mt=xe(H,Qr,Mt),Tt=xe(L,Qr,Tt);{let t=xe(U,Xr,Yr);t!==Yr&&(Nt=t)}Nt?(jt=a?Kr(Math.min(Ht,Jt),Math.max(Ht,Jt)+1,Dt,St,!0):Kr(Dt,Ht,Dt,St,!0),Zt()):jt=[];{let t=xe(B,Xr,Yr);t!==Yr&&(Rt=t)}Rt?(At=a?Kr(Math.min(Ht,Jt),Math.max(Ht,Jt)+1,Dt,St,!1):Kr(Ht+1,St+1,Dt,St,!0),Zt()):At=[],Vt=Er(z,Vt),Bt=Er(T,Vt),(null==M?void 0:M.description)?Ut=M.description:wt.logError(st(new Error('Missing accessibility "description" for slider'),{level:"warn"})),(null==P?void 0:P.description)?Lt=P.description:a&&wt.logError(st(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;kt.hasAction()?(wt.logError(st(new Error('Cannot show "slider" inside component with action'))),t=!0):Pt===Yr?(wt.logError(st(new Error('Missing "thumb_style" in slider'))),t=!0):Tt===Yr?(wt.logError(st(new Error('Missing "track_active_style" in slider'))),t=!0):Mt===Yr&&(wt.logError(st(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==Wt&&(Wt=t)}return k=dt(Math.max(...[Pt.width,It.width,0].filter(Ot))),E=dt(Math.max(...[Pt.height,It.height,0].filter(Ot))),C=(Ht-Dt)/(St-Dt),j=a?(Jt-Dt)/(St-Dt):void 0,A=void 0!==j?Math.abs(j-C):C,F=void 0!==j?Math.min(j,C):0,V={"--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===(mt=null==Vt?void 0:Vt.offset)||void 0===mt?void 0:mt.x)?pt(Vt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(yt=null==Vt?void 0:Vt.offset)||void 0===yt?void 0:yt.y)?pt(Vt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(bt=null==Bt?void 0:Bt.offset)||void 0===bt?void 0:bt.x)?pt(Bt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(_t=null==Bt?void 0:Bt.offset)||void 0===_t?void 0:_t.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":k,"--divkit-slider-max-thumb-height":E,"--divkit-slider-track-part":C,"--divkit-slider-track-secondary-part":j},D={direction:S},wt.json,O(),K(),tt(),et(),rt(),nt(),it(),ot(),lt(),ct(),ut(),vt(),gt(),ft(),ht()," "+(Wt?"":`${R(ie,"Outer").$$render(t,{cls:Ft("slider",kr,D),style:V,customDescription:!0,customActions:"slider",hasInnerFocusable:!0,componentContext:wt,layoutParams:$t},{},{default:({focusHandler:t,blurHandler:e})=>{var r,n,i,o,s,l;return`<div${W("class",kr["slider__tracks-wrapper"],0)}><div${W("class",kr["slider__tracks-inner"],0)}${W("this",Ct,0)}><div${W("class",kr.slider__track,0)}${q({height:dt(Mt.height),"border-radius":dt(Mt.borderRadius),background:Mt.background,"box-shadow":Mt.boxShadow||""})}></div> <div${W("class",kr["slider__active-track"],0)}${q({left:"ltr"===S?(100*F).toFixed(2)+"%":void 0,right:"ltr"===S?void 0:(100*F).toFixed(2)+"%",width:(100*A).toFixed(2)+"%",height:dt(Tt.height),"border-radius":dt(Tt.borderRadius),background:Tt.background,"box-shadow":Tt.boxShadow||""})}></div> ${N(jt,(t=>`<div class="${I(kr.slider__tick,!0)+" "+I(kr.slider__tick_active,!0)}"${q({"--divkit-slider-tick":t})}></div>`))} ${N(At,(t=>`<div class="${I(kr.slider__tick,!0)+" "+I(kr.slider__tick_inactive,!0)}"${q({"--divkit-slider-tick":t})}></div>`))} <div${W("class",kr.slider__thumb,0)}${q({"border-radius":dt(Pt.borderRadius),background:Pt.background,"box-shadow":Pt.boxShadow||""})}>${Vt?`<div${W("class",kr["slider__thumb-text"],0)}><div${W("class",kr["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===(i=Vt)||void 0===i?void 0:i.textColor)||"#000"})}>${I(Ht)}</div></div>`:""}</div> ${a?`<div class="${I(kr.slider__thumb,!0)+" "+I(kr.slider__thumb_secondary,!0)}"${q({"border-radius":dt(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${Bt?`<div class="${I(kr["slider__thumb-text"],!0)+" "+I(kr["slider__thumb-text_secondary"],!0)}"><div${W("class",kr["slider__thumb-text-inner"],0)}${q({"font-size":(null===(o=Bt)||void 0===o?void 0:o.fontSize)||"1em","font-weight":(null===(s=Bt)||void 0===s?void 0:s.fontWeight)||"",color:(null===(l=Bt)||void 0===l?void 0:l.textColor)||"#000"})}>${I(Jt)}</div></div>`:""}</div>`:""} <input type="range"${W("class",kr.slider__input,0)}${W("min",Dt,0)}${W("max",St,0)} step="1"${W("value",Ht,0)}${W("aria-label",Ut,0)}${W("this",undefined,0)}> ${a?`<input type="range"${W("class",`${kr.slider__input} ${kr.slider__input_secondary}`,0)}${W("min",Dt,0)}${W("max",St,0)} step="1"${W("value",Jt,0)}${W("aria-label",Lt,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 rn(t,e){if(t===e)return{start:t.length,added:0,removed:0};if(t.length>e.length){const r=rn(e,t);return{start:r.start,added:r.removed,removed:r.added}}let r=0,n=e.length-1;const i=e.length-t.length;for(;r<n&&r<t.length&&t[r]===e[r];)++r;for(;n-i>=r&&t[n-i]===e[n];)--n;return++n,{start:r,added:n-r,removed:n-r-i}}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{constructor(t){this.char=t}}class an{constructor(t,e,r){this.char=t,this.filter=e,this.placeholder=r}}class sn{constructor(t){nn(this,"filters",new Map),nn(this,"destructedValue",[]),nn(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 on)t+=r.char;else if(r instanceof an)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 an&&!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 an(null,this.filters.get(e.key),e.placeholder):new on(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=rn(this.value,t);void 0!==e&&(r.start=Math.max(0,e-r.added));const n=this.buildBodySubstring(r,t),i=this.buildTailSubstring(r);this.cleanup(r);const o=this.firstEmptyHolderIndex(),a=i?this.calculateMaxShift(i,o):void 0;this.replaceChars(n,o,a);const s=this.firstEmptyHolderIndex();this.replaceChars(i,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 an&&++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 an&&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 an&&(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 i=()=>{for(var t;n<this.destructedValue.length&&!(this.destructedValue[n]instanceof an);)++n;return null===(t=this.destructedValue[n])||void 0===t?void 0:t.filter};return t.split("").forEach((t=>{const e=i();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 an&&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 i=e,o=0;for(;i<this.destructedValue.length&&o<n.length;){const t=this.destructedValue[i],e=n[o];t instanceof an&&(t.char=e,++o),++i}}firstHolderAfter(t){let e=t;for(;e<this.destructedValue.length&&!(this.destructedValue[e]instanceof an);)++e;return e}}class ln extends sn{constructor(t,e){super(t),this.logError=e}onException(t){this.logError(t)}}function cn(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 un extends sn{constructor(t=void 0,e){super({pattern:"",decoding:[],alwaysVisible:!1}),cn(this,"currencyFormatter",new Intl.NumberFormat),cn(this,"decimalSeparator","."),cn(this,"localeDigits",{}),cn(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=rn(this.value,t),n=this.value.lastIndexOf(this.decimalSeparator),i=t.lastIndexOf(this.decimalSeparator),o=n!==i||-1===n&&-1===i,a=this.validFormat(t,r);this.cleanup(r);const s=this.parseFormat(a)||0;o&&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 i=-1;1===e.added&&0===e.removed&&[",","."].includes(t[e.start])&&(i=e.start);const o=this.currencyFormatter.resolvedOptions().maximumFractionDigits;let a=o;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 i=t[n];i===this.decimalSeparator?r=!0:!this.inDiff(e,n)&&r&&this.isDigit(i)&&a--}}const s=t.includes(this.decimalSeparator)||-1!==i,l=[];n=t.length-1;let c=!1;for(;n>=0;){const u=t[n],d=l.length<=o;this.isDigit(u)?this.inDiff(e,n)&&!c&&s?a>0&&(l.push(u),a--):l.push(u):d&&-1===r&&n===i?(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 dn(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 pn(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,i=Array.from(n.childNodes).indexOf(t)+1;r.setStart(n,i),r.setEnd(n,i),e.addRange(r)}}catch(t){}else for(let r=0,n=t.childNodes.length;r<n;++r){const n=t.childNodes[r],i=dn(n);if(e<=i)return void pn(n,e);e-=i}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 vn="undefined"!=typeof document&&"inputMode"in document.createElement("input"),gn={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"},fn=L(((t,e,r,n)=>{let i,a,s,u,d,p,g,h,m,y,b,_,w,x,k,E,C,j,A,F,V,D,S,O,P,M,T,N,z,B,U,L,H,q,J,G,Z,Y,X,Q,K,tt,et,rt,nt,it,ot,lt,ct=o,vt=o,ft=o,ht=o,mt=o,yt=o,bt=o,_t=o,wt=o,$t=o,xt=o,kt=o,Ct=o,jt=o,At=o,Vt=o,Ot=o,Pt=o,It=o;var Mt;let{componentContext:Tt}=e,{layoutParams:Nt}=e;const zt=f(at);let Rt,Ut;L=l(zt.direction,(t=>U=t));let Lt,Wt,Ht,qt=null,Jt="",Gt="",Zt=!1,Xt="",Qt=12,Kt="",te="",ee="#000",re="",ne="start",oe="center",se="multi_line_text",ce="text",ue="",ve=null,ge="",fe="",he="";function me(t){Ut instanceof HTMLInputElement?Ut.selectionStart=Ut.selectionEnd=t:pn(Ut,t)}async function ye(){if(!Ut||!qt)return;qt.overrideRawValue(z),u.set(qt.rawValue),c(s,N=Jt=Gt=qt.value,N);const t=qt.cursorPosition;await $(),document.activeElement===Ut&&me(t)}var be;v((()=>{Rt&&(zt.unregisterFocusable(Rt),Rt=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==Tt&&r.componentContext(Tt),void 0===e.layoutParams&&r.layoutParams&&void 0!==Nt&&r.layoutParams(Nt),Tt.json&&(Xt="",Qt=12,Lt=void 0,Kt="",Wt=void 0,ee="#000",re="",ne="left",oe="center",se="multi_line_text",ce="text",Ht=void 0),i=Tt.json.text_variable,a=null===(Mt=Tt.json.mask)||void 0===Mt?void 0:Mt.raw_text_variable,s=i&&Tt.getVariable(i,"string")||Hr("temp","string",""),ct(),ct=l(s,(t=>N=t)),u=a&&Tt.getVariable(a,"string")||Hr("temp","string",""),vt(),vt=l(u,(t=>z=t)),d=Tt.getDerivedFromVars(Tt.json.hint_text),Pt(),Pt=l(d,(t=>ot=t)),p=Tt.getDerivedFromVars(Tt.json.hint_color),Ot(),Ot=l(p,(t=>it=t)),g=Tt.getDerivedFromVars(Tt.json.font_size),Vt(),Vt=l(g,(t=>nt=t)),h=Tt.getDerivedFromVars(Tt.json.font_weight),At(),At=l(h,(t=>rt=t)),m=Tt.getDerivedFromVars(Tt.json.font_family),jt(),jt=l(m,(t=>et=t)),y=Tt.getDerivedFromVars(Tt.json.line_height),Ct(),Ct=l(y,(t=>tt=t)),b=Tt.getDerivedFromVars(Tt.json.letter_spacing),kt(),kt=l(b,(t=>K=t)),_=Tt.getDerivedFromVars(Tt.json.text_color),xt(),xt=l(_,(t=>Q=t)),w=Tt.getDerivedFromVars(Tt.json.highlight_color),$t(),$t=l(w,(t=>X=t)),x=Tt.getDerivedFromVars(Tt.json.text_alignment_horizontal),wt(),wt=l(x,(t=>Y=t)),k=Tt.getDerivedFromVars(Tt.json.text_alignment_vertical),_t(),_t=l(k,(t=>Z=t)),E=Tt.getDerivedFromVars(Tt.json.keyboard_type),bt(),bt=l(E,(t=>G=t)),C=Tt.getDerivedFromVars(Tt.json.mask),yt(),yt=l(C,(t=>J=t)),j=Tt.getDerivedFromVars(Tt.json.max_visible_lines),mt(),mt=l(j,(t=>q=t)),A=Tt.getDerivedFromVars(Tt.json.paddings),ht(),ht=l(A,(t=>H=t)),F=Tt.getDerivedFromVars(Tt.json.accessibility),ft(),ft=l(F,(t=>B=t)),V=Tt.getDerivedFromVars(Tt.json.select_all_on_focus),It(),It=l(V,(t=>lt=t)),i?Zt=!1:(Zt=!0,Tt.logError(st(new Error('Missing "text_variable" in "input"')))),"fixed_length"===(null==(be=J)?void 0:be.type)?qt=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 ln(n,e)}return r||null}(be,Tt.logError,qt):"currency"===(null==be?void 0:be.type)&&(qt=function(t,e,r){return r?(r.updateCurrencyParams(t.locale),r):new un(t.locale,e)}(be,Tt.logError,qt)),qt&&ye(),qt||Jt===N||(Jt=Gt=N),qt&&qt.rawValue!==z&&ye(),D=ot,Xt=gt(it,1,Xt),Qt=ae(nt,Qt),Lt=le(rt,Lt),Kt=et&&"string"==typeof et?zt.typefaceProvider(et,{fontWeight:Lt||400}):"";{const t=tt;Yt(t)&&(Wt=t/Qt)}return St(K)&&(te=dt(K)),ee=gt(Q,1,ee),re=gt(X,1,re),ne=de(Y,U,ne),oe=pe(Z,oe),G&&G in gn&&(ce=gn[G],se=G),"currency"===(null==J?void 0:J.type)&&(ce=vn?"text":"tel",Ht="decimal"),S="multi_line_text"===se,ue=Yt(q)?`calc(${q*(Wt||1.25)*(Qt/10)+"em"} + ${pt(Et(null==H?void 0:H.top,0)+Et(null==H?void 0:H.bottom,0))})`:"",ve=Bt(H||void 0,ve),ge=ve?Dt({top:(Number(ve.top)||0)/Qt*10,right:(Number("ltr"===U?ve.end:ve.start)||Number(ve.right)||0)/Qt*10,bottom:(Number(ve.bottom)||0)/Qt*10,left:(Number("ltr"===U?ve.start:ve.end)||Number(ve.left)||0)/Qt*10},U):"",fe=ve?Dt({top:(Number(ve.top)||0)/Qt*10,bottom:(Number(ve.bottom)||0)/Qt*10},U):"",(null==B?void 0:B.description)?he=B.description:Tt.logError(st(new Error('Missing accessibility "description" for input'),{level:"warn"})),O={"highlight-color":Boolean(re),multiline:S,"alignment-horizontal":ne,"alignment-vertical":oe},P={"--divkit-input-hint-color":Xt,"--divkit-input-highlight-color":re,"--divkit-input-line-height":Wt,"font-weight":Lt,"font-family":Kt,"letter-spacing":te,color:ee,"max-height":ue},M={"font-size":dt(Qt),padding:ge},T={"font-size":dt(Qt),padding:fe},Ut&&Tt.json&&(Rt&&(zt.unregisterFocusable(Rt),Rt=void 0),Tt.json.id&&!Tt.fakeElement&&(Rt=Tt.json.id,zt.registerFocusable(Rt,{focus(){Ut&&Ut.focus()}}))),ct(),vt(),ft(),L(),ht(),mt(),yt(),bt(),_t(),wt(),$t(),xt(),kt(),Ct(),jt(),At(),Vt(),Ot(),Pt(),It(),Zt?"":`${R(ie,"Outer").$$render(t,{cls:Ft("input",en,O),style:P,customDescription:!0,customActions:"input",customPaddings:!0,hasInnerFocusable:!0,componentContext:Tt,layoutParams:Nt},{},{default:({focusHandler:t,blurHandler:e,hasCustomFocus:r})=>{return S?`<span${W("class",en["input__scroll-wrapper"],0)}>${!Gt&&D?`<div${W("class",en.input__placeholder,0)} aria-hidden="true"${W("style",ut(M),0)}>${I(D)}</div>`:""} <span${W("class",en.input__aligner,0)} aria-hidden="true"${W("style",ut(T),0)}>​</span> <span${W("class",Ft("input__input",en,{"has-custom-focus":r,multiline:!0}),0)} autocapitalize="off" contenteditable="true"${W("aria-label",he,0)}${W("style",ut(M),0)}${W("this",Ut,0)}>${n=Gt,void 0===n?"":n}</span></span>`:`<input${W("type",ce,0)}${W("inputmode",Ht,0)}${W("class",Ft("input__input",en,{"has-custom-focus":r,singleline:!0}),0)} autocomplete="off" autocapitalize="off"${W("aria-label",he,0)}${W("style",ut(M),0)}${W("placeholder",D,0)}${W("value",Jt,0)}${W("this",Ut,0)}>`;var n}})}`})),hn={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"},mn=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P,M,T,z,B,U=o,L=o,H=o,q=o,J=o,G=o,Z=o,Y=o,X=o,Q=o,K=o,{componentContext:tt}=e,{layoutParams:et}=e;const rt=f(at);let nt;M=l(rt.direction,(t=>P=t));let it,ot,lt=!1,ct="",pt=null,vt="",ft="rgba(0,0,0,.45)",ht=12,mt="",yt="",bt="#000",_t="";v((()=>{nt&&(rt.unregisterFocusable(nt),nt=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),tt.json&&(pt=null,ft="rgba(0,0,0,.45)",ht=12,it=void 0,mt="",ot=void 0,yt="",bt="#000",_t=""),i=tt.json.value_variable,a=tt.json.options,s=Array.isArray(a)&&a.filter((t=>"string"==typeof t.value))||[],c=i&&tt.getVariable(i,"string")||Hr("temp","string",""),Q(),Q=l(c,(t=>z=t)),u=tt.getDerivedFromVars(tt.json.paddings),X(),X=l(u,(t=>T=t)),d=tt.getDerivedFromVars(tt.json.hint_text),K(),K=l(d,(t=>B=t)),p=tt.getDerivedFromVars(tt.json.hint_color),Y(),Y=l(p,(t=>O=t)),g=tt.getDerivedFromVars(tt.json.font_size),Z(),Z=l(g,(t=>S=t)),h=tt.getDerivedFromVars(tt.json.font_weight),G(),G=l(h,(t=>D=t)),m=tt.getDerivedFromVars(tt.json.font_family),J(),J=l(m,(t=>V=t)),y=tt.getDerivedFromVars(tt.json.line_height),q(),q=l(y,(t=>F=t)),b=tt.getDerivedFromVars(tt.json.letter_spacing),H(),H=l(b,(t=>A=t)),_=tt.getDerivedFromVars(tt.json.text_color),L(),L=l(_,(t=>j=t)),w=tt.getDerivedFromVars(tt.json.accessibility),U(),U=l(w,(t=>C=t)),Array.isArray(s)&&s.length||tt.logError(st(new Error('Empty selection "items" in "select"'))),i?lt=!1:(lt=!0,tt.logError(st(new Error('Missing "value_variable" in "select"'))));{const t=s.find((t=>t.value===z));t?ct=("string"==typeof t.text?t.text:t.value)||"":(ct="",z&&tt.logError(st(new Error('Value from the variable was not found in the selection items for "select"'))))}ht=ae(S,ht),pt=Bt(T||void 0,pt),vt=pt?Dt({top:(Number(pt.top)||0)/ht*10,right:(Number("ltr"===P?pt.end:pt.start)||Number(pt.right)||0)/ht*10,bottom:(Number(pt.bottom)||0)/ht*10,left:(Number("ltr"===P?pt.start:pt.end)||Number(pt.left)||0)/ht*10},P):"",ft=gt(O,1,ft),it=le(D,it),mt=V&&"string"==typeof V?rt.typefaceProvider(V,{fontWeight:it||400}):"";{const t=F;Yt(t)&&(ot=t/ht)}return St(A)&&(yt=dt(A/ht*10)),bt=gt(j,1,bt),(null==C?void 0:C.description)?_t=C.description:tt.logError(st(new Error('Missing accessibility "description" for select'),{level:"warn"})),$={hint:!ct},x={"--divkit-input-hint-color":ft,"font-weight":it,"font-family":mt,color:bt},k={padding:vt,"font-size":dt(ht),"line-height":ot,"letter-spacing":yt},E={"font-size":dt(ht),"line-height":ot,"letter-spacing":yt},tt.json,U(),L(),H(),q(),J(),G(),Z(),Y(),M(),X(),Q(),K(),lt?"":`${R(ie,"Outer").$$render(t,{cls:Ft("select",hn,$),style:x,customDescription:!0,customActions:"select",customPaddings:!0,hasInnerFocusable:!0,componentContext:tt,layoutParams:et},{},{default:({hasCustomFocus:t,focusHandler:e,blurHandler:r})=>`<span${W("class",hn["select__select-text"],0)}${W("style",ut(k),0)} aria-hidden="true"> ${I(ct||B||"​")}</span> <select${W("class",Ft("select__select",hn,{"has-custom-focus":t}),0)}${W("aria-label",_t,0)}${W("style",ut(E),0)}${W("this",undefined,0)}>${N(s,(t=>`<option${W("class",hn.select__option,0)}${W("value",t.value,0)}>${I(t.text||t.value)}</option>`))}</select>`})}`})),yn={video__video:"divkit-c11f9","video__aspect-wrapper":"divkit-cfe32",video_aspect:"divkit-a4f5c"},bn=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C=o,j=o,A=o,F=o,V=o,D=o,S=o,{componentContext:O}=e,{layoutParams:P}=e;const I=f(at);let M,T,z,B,U=!1,L=!1,H=[],J=!1,G=!1,Z=!1,Y="fit",X="0";function Q(){const t=null==T?void 0:T.play();t&&t.catch((t=>{O.logError(st(new Error("Video playing error"),{level:"error",additional:{originalText:String(t)}}))}))}var K,tt;v((()=>{M&&(I.unregisterInstance(M),M=void 0),B&&(B(),B=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==O&&r.componentContext(O),void 0===e.layoutParams&&r.layoutParams&&void 0!==P&&r.layoutParams(P),O.json&&(J=!1,G=!1,Z=!1,z=void 0,Y="fit"),i=O.json.elapsed_time_variable,a=i&&O.getVariable(i,"integer")||Hr("temp","integer",0),a&&(B&&B(),B=a.subscribe((function(t){L?L=!1:T&&(T.currentTime=Number(t)/1e3)}))),s=O.getDerivedFromVars(O.json.video_sources),S(),S=l(s,(t=>E=t)),c=O.getDerivedFromVars(O.json.repeatable),D(),D=l(c,(t=>k=t)),u=O.getDerivedFromVars(O.json.autostart),C(),C=l(u,(t=>b=t)),d=O.getDerivedFromVars(O.json.muted),V(),V=l(d,(t=>x=t)),p=O.getDerivedFromVars(O.json.preview),F(),F=l(p,(t=>$=t)),g=O.getDerivedFromVars(O.json.scale),A(),A=l(g,(t=>w=t)),h=O.getDerivedFromVars(O.json.aspect),j(),j=l(h,(t=>_=t)),K=E,tt=H,H=Array.isArray(K)&&K.length?K.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})):tt,H.length?U=!1:(U=!0,O.logError(st(new Error('Missing "video_sources" in "video"')))),J=ve(k,J),G=ve(b,G),Z=ve(x,Z),z="string"==typeof $?Re($):z,Y=function(t){return"fill"===t?"cover":"no_scale"===t?"none":"contain"}(w)||Y;{const t=null==_?void 0:_.ratio;X=t&&Yt(t)?(100/Number(t)).toFixed(2):"0"}return O.json&&(M&&(I.unregisterInstance(M),M=void 0),!O.json.id||U||O.fakeElement||(M=O.json.id,I.registerInstance(M,{pause:function(){null==T||T.pause()},start:Q}))),O.json&&b&&T&&Q(),m={aspect:"0"!==X},y={"object-fit":Y},C(),j(),A(),F(),V(),D(),S(),U?"":`${R(ie,"Outer").$$render(t,{cls:Ft("video",yn,m),customActions:"video",componentContext:O,layoutParams:P},{},{default:()=>m.aspect?`<div${W("class",yn["video__aspect-wrapper"],0)}${q({"padding-bottom":`${X}%`})}><video${W("class",yn.video__video,0)}${W("style",ut(y),0)} playsinline ${J?"loop":""} ${G?"autoplay":""} ${Z?"muted":""}${W("poster",z,0)}${W("this",T,0)}>${N(H,(t=>`<source${W("src",t.src,0)}${W("type",t.type,0)}>`))}</video></div>`:`<video${W("class",yn.video__video,0)}${W("style",ut(y),0)} playsinline ${J?"loop":""} ${G?"autoplay":""} ${Z?"muted":""}${W("poster",z,0)}${W("this",T,0)}>${N(H,(t=>`<source${W("src",t.src,0)}${W("type",t.type,0)}>`))}</video>`})}`})),_n=bn,wn=L(((t,e,r,n)=>{let i,o;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 i=s.json.items,void 0===i||Array.isArray(i)?v=!1:(v=!0,s.logError(st(new Error('Incorrect "items" prop for div "custom"')))),o=(!v&&i||[]).map(((t,e)=>s.produceChildContext(t,{path:e}))),u?`${R(ie,"Outer").$$render(t,{componentContext:s,layoutParams:l},{},{default:()=>{return(e=u.element)?`<${u.element}${S([T(s.json.custom_props||{})],{})}${W("this",undefined,0)}>${V(e)?"":`${d?`<template${S([T(p)],{})}> ${d}</template>`:""} ${!v&&i?`${N(o,(e=>`${R(kn,"Unknown").$$render(t,{componentContext:e},{},{})}`))}`:""}`}${V(e)?"":`</${e}>`}`:"";var e}})}`:""})),$n=wn,xn={};xn.text=he,xn.container=Ie,xn.separator=Ne,xn.image=Ue,xn.gif=Ue,xn.grid=Ge,xn.gallery=nr,xn.tabs=ar,xn.state=hr,xn.pager=br,xn.indicator=xr,xn.slider=tn,xn.input=fn,xn.select=mn,xn.video=_n,xn.custom=$n;const kn=L(((t,e,r,n)=>{let{componentContext:i}=e,{layoutParams:o}=e;const a=f(at);let s;void 0===e.componentContext&&r.componentContext&&void 0!==i&&r.componentContext(i),void 0===e.layoutParams&&r.layoutParams&&void 0!==o&&r.layoutParams(o);{const t=i.json;if(s=(null==t?void 0:t.type)&&xn[t.type]||void 0,!s){let e;e=(null==t?void 0:t.type)&&a.hasTemplate(t.type)?"Recursive template":"Unknown component",i.logError(st(new Error(e),{additional:{component:(null==t?void 0:t.type)||"<missing>"}}))}}return s?`${R(s||z,"svelte:component").$$render(t,{componentContext:i,layoutParams:o},{},{})}`:""})),En=L(((t,e,r,n)=>{let{svgFiltersMap:i}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==i&&r.svgFiltersMap(i),Object.keys(i).length?`<svg${W("class","divkit-dc22b",0)} aria-hidden="true"><defs>${N([...Object.keys(i)],(t=>{let[e,r]=t.split(":");return` <filter${W("id",i[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 Cn(t,e,r,n){const i=r[t.type];if(!i)return n(st(new Error("No such template"),{additional:{template:t.type}})),{json:t,templateContext:e};let o;const a={};for(o in e)e.hasOwnProperty(o)&&(a[o]=e[o]);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(a[o]=t[o]);const s=function t(e,r){const n=Object.keys(r).filter((t=>"__proto__"!==t)),i=n.filter((t=>"$"!==t.charAt(0))),o=n.filter((t=>"$"===t.charAt(0)));return i.forEach((n=>{const i=r[n];"object"==typeof i&&null!==i?(e[n]=Array.isArray(i)?[]:{},t(e[n],i)):e[n]=i})),o.forEach((t=>{const n=r[t],i=a[n];if(void 0!==i){const r=t.substring(1);e[r]=i}})),e}({},i);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(s[o]=t[o]);return{json:s,templateContext:a}}function jn(){}function An(t){return{subscribe:e=>(e(t),jn)}}function Fn(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function Vn(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function Dn(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 Sn(t){try{return Dr(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function On(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function Pn(t,e,r,n){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,Pn.prototype),i.expected=e,i.found=r,i.location=n,i.name="SyntaxError",i}function In(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}An(void 0),function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(Pn,Error),Pn.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 i=this.location.start,o=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,a=this.location.source+":"+o.line+":"+o.column;if(n){var s=this.location.end,l=In("",o.line.toString().length," "),c=n[i.line-1],u=(i.line===s.line?s.column:c.length+1)-i.column||1;e+="\n --\x3e "+a+"\n"+l+" |\n"+o.line+" | "+c+"\n"+l+" | "+In("",i.column-1," ")+In("",u,"^")}else e+="\n at "+a}return e},Pn.buildMessage=function(t,e){var r={literal:function(t){return'"'+i(t.text)+'"'},class:function(t){var e=t.parts.map((function(t){return Array.isArray(t)?o(t[0])+"-"+o(t[1]):o(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 i(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 o(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?'"'+i(t)+'"':"end of input"}(e)+" found."};const Mn=new Map,Tn=new Map;function Nn(t,e,r){const n={args:e,cb:r},i=Mn.get(t)||[];Mn.has(t)||Mn.set(t,i),i.push(n);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");Tn.set(o,n)}function zn(t,e){let r=t.args.length,n=t.args.length;const i=t.args[t.args.length-1];if("object"==typeof i&&i.isVararg&&(--r,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!==e[r].type)return{type:"mismatch",expected:n.type,found:e[r].type}}return{type:"match"}}function Rn(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=>{Rn(t,e)}));break;case"BinaryExpression":case"LogicalExpression":Rn(t.left,e),Rn(t.right,e);break;case"UnaryExpression":Rn(t.argument,e);break;case"ConditionalExpression":Rn(t.test,e),Rn(t.consequent,e),Rn(t.alternate,e);break;case"TryExpression":Rn(t.test,e),Rn(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{Rn(t,e)}))}}function Bn(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function Un(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function Ln(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 Un(t.value);if("color"===t.type)return Xn(Yn(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 Wn(t){let e=Ln(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"),e}function Hn(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function qn(t,e){if(jr)return Dr(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function Jn(t,e){if(e<Vr||e>Fr)throw new Error("Integer overflow.");!jr&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function Gn(t){const e=[];return Rn(t,{Variable(t){e.push(t.id.name)}}),e}function Zn(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function Yn(t){const e=ft(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function Xn(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 Qn(t){return Xn(Yn(t))}const Kn=Number.MAX_VALUE,ti=Number.MIN_VALUE,ei="string",ri="integer",ni="number",ii="boolean",oi="color",ai="url",si="datetime",li="dict",ci="array";function ui(t,e){return{type:ei,value:Ln(e)}}function di(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:ni,value:r}}function pi(t,e,r,n){const i=t.variables.get(e.value);let o;return o=i&&i.getType()===n?i.getValue():r.value,"color"===n&&(o=Qn(o)),{type:n,value:o}}function vi(t,e,r){return pi(t,e,r,r.type)}function gi(t,e,r){return pi(t,e,r,"color")}function fi(t,e,r){return pi(t,e,r,"url")}const hi=t=>(e,r)=>{let n=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++n:"getUTCDay"===t&&0===n&&(n=7),{type:ri,value:Dr(n)}},mi=hi("getUTCFullYear"),yi=hi("getUTCMonth"),bi=hi("getUTCDate"),_i=hi("getUTCDay"),wi=hi("getUTCHours"),$i=hi("getUTCMinutes"),xi=hi("getUTCSeconds"),ki=hi("getUTCMilliseconds");function Ei(t,e,r,n){if(!n.value.length)return t.warnings.push(st(new Error("String for padding is empty."),{level:"warn"})),"";let i="";const o=e.type===ei?e.value:Ln(e);for(;i.length+o.length<r.value;)i+=n.value;return i.length>0&&i.length+o.length>r.value&&(i=i.substring(0,Number(r.value)-Number(o.length))),i}function Ci(t,e,r,n){const i=Ei(t,e,r,n);return{type:ei,value:i+Ln(e)}}function ji(t,e,r,n){const i=Ei(t,e,r,n);return{type:ei,value:Ln(e)+i}}function Ai(t){return(e,r)=>{const n=Yn(r.value);return{type:ni,value:n[t]/255}}}function Fi(t){return(e,r,n)=>{const i=Yn(r.value);return i[t]=255*n.value,{type:oi,value:Xn(i)}}}const Vi=Ai("a"),Di=Ai("r"),Si=Ai("g"),Oi=Ai("b"),Pi=Fi("a"),Ii=Fi("r"),Mi=Fi("g"),Ti=Fi("b");function Ni(t,e,r,n){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let i=Dr(e.value)/Dr(r);return Jn(t,i),"number"==typeof i&&(i=Math.floor(i)),n&&(i=Dr(i)%Dr(n)),{type:ri,value:i}}const zi=36e5;function Ri(t,e){return(r,n,...i)=>{let o=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}(n.value,i.map((t=>t.value))),a=typeof o;if("array"===t&&!Array.isArray(o)||"array"!==t&&a!==t||"object"===a&&null===o)throw"object"===a&&(a=Array.isArray(o)?"array":null===o?"null":"dict"),new Error(`Incorrect value type: expected "${e}", got "${a}".`);if("number"===t&&"integer"===e){Jn(r,o);try{o=Dr(o)}catch(t){throw new Error("Cannot convert value to integer.")}}return"string"===t&&"color"===e&&(o=Qn(o)),{type:e,value:o}}}function Bi(t,e){return(r,n,i,...o)=>{try{return t(r,i,...o)}catch(t){let r=n.value;return"color"===e&&(r=Qn(r)),{type:e,value:r}}}}const Ui=Ri("string","string"),Li=Ri("number","number"),Wi=Ri("number","integer"),Hi=Ri("boolean","boolean"),qi=Ri("string","color"),Ji=Ri("string","url"),Gi=Ri("array","array"),Zi=Ri("object","dict"),Yi=Bi(Ui,"string"),Xi=Bi(Li,"number"),Qi=Bi(Wi,"integer"),Ki=Bi(Hi,"boolean"),to=Bi(qi,"color"),eo=Bi(Ji,"url");function ro(t,e){return(r,n,i)=>{if(i.value<0||i.value>=n.value.length)throw new Error(`Requested index (${i.value}) out of bounds array size (${n.value.length}).`);let o=n.value[Number(i.value)],a=typeof o;if("array"===t&&!Array.isArray(o)||"array"!==t&&a!==t||"object"===a&&null===o)throw"object"===a&&(a=Array.isArray(o)?"array":null===o?"null":"dict"),new Error(`Incorrect value type: expected "${e}", got "${a}".`);if("number"===t&&"integer"===e){Jn(r,o);try{o=Dr(o)}catch(t){throw new Error("Cannot convert value to integer.")}}return"string"===t&&"color"===e&&(o=Qn(o)),{type:e,value:o}}}function no(t,e){return(r,n,i,o)=>{try{return t(r,n,i)}catch(t){let r=o.value;return"color"===e&&(r=Qn(r)),{type:e,value:r}}}}const io=ro("string","string"),oo=ro("number","number"),ao=ro("number","integer"),so=ro("boolean","boolean"),lo=ro("string","color"),co=ro("string","url"),uo=ro("array","array"),po=ro("object","dict"),vo=no(io,"string"),go=no(oo,"number"),fo=no(ao,"integer"),ho=no(so,"boolean"),mo=no(lo,"color"),yo=no(co,"url");function bo(t){return t.map(Wn).join(", ")}Nn("toString",[ri],ui),Nn("toString",[ni],ui),Nn("toString",[ii],ui),Nn("toString",[oi],ui),Nn("toString",[ai],ui),Nn("toNumber",[ri],di),Nn("toNumber",[ei],di),Nn("toInteger",[ni],(function(t,e){if(e.value>Fr||e.value<Vr)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:ri,value:Dr(r)}})),Nn("toInteger",[ei],(function(t,e){let r;try{r=Dr(e.value)}catch(t){throw new Error("Unable to convert value to Integer.")}return{type:ri,value:r}})),Nn("toInteger",[ii],(function(t,e){return{type:ri,value:Dr(e.value?1:0)}})),Nn("toBoolean",[ri],(function(t,e){const r=Number(e.value);if(1!==r&&0!==r)throw new Error("Unable to convert value to Boolean.");return{type:ii,value:r}})),Nn("toBoolean",[ei],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:ii,value:"true"===e.value?1:0}})),Nn("toColor",[ei],(function(t,e){return{type:oi,value:Qn(e.value)}})),Nn("toUrl",[ei],(function(t,e){return{type:ai,value:e.value}})),Nn("encodeUri",[ei],(function(t,e){try{return{type:ei,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),Nn("decodeUri",[ei],(function(t,e){try{return{type:ei,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),Nn("getIntegerValue",[ei,ri],vi),Nn("getNumberValue",[ei,ni],vi),Nn("getBooleanValue",[ei,ii],vi),Nn("getStringValue",[ei,ei],vi),Nn("getColorValue",[ei,oi],gi),Nn("getColorValue",[ei,ei],gi),Nn("getUrlValue",[ei,ai],fi),Nn("getUrlValue",[ei,ei],fi),Nn("parseUnixTime",[ri],(function(t,e){return{type:si,value:new Date(1e3*Number(e.value))}})),Nn("nowLocal",[],(function(){return{type:si,value:new Date}})),Nn("addMillis",[si,ri],(function(t,e,r){return{type:si,value:new Date(e.value.getTime()+Number(r.value))}})),Nn("setYear",[si,ri],(function(t,e,r){const n=new Date(e.value);return n.setUTCFullYear(Number(r.value)),{type:si,value:n}})),Nn("setMonth",[si,ri],(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 i=new Date(e.value);return i.setUTCMonth(n-1),{type:si,value:i}})),Nn("setDay",[si,ri],(function(t,e,r){const n=new Date(e.value),i=Number(r.value);if(i<=0&&-1!==i||i>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 ${i} for date ${Ln(e)}.`);return n.setUTCDate(-1===i?0:i),{type:si,value:n}})),Nn("setHours",[si,ri],(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 i=new Date(e.value);return i.setUTCHours(n),{type:si,value:i}})),Nn("setMinutes",[si,ri],(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 i=new Date(e.value);return i.setUTCMinutes(n),{type:si,value:i}})),Nn("setSeconds",[si,ri],(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 i=new Date(e.value);return i.setUTCSeconds(n),{type:si,value:i}})),Nn("setMillis",[si,ri],(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 i=new Date(e.value);return i.setUTCMilliseconds(n),{type:si,value:i}})),Nn("getYear",[si],mi),Nn("getMonth",[si],yi),Nn("getDay",[si],bi),Nn("getDayOfWeek",[si],_i),Nn("getHours",[si],wi),Nn("getMinutes",[si],$i),Nn("getSeconds",[si],xi),Nn("getMillis",[si],ki),Nn("getIntervalSeconds",[ri],(function(t,e){return Ni(t,e,1e3,60)})),Nn("getIntervalTotalSeconds",[ri],(function(t,e){return Ni(t,e,1e3)})),Nn("getIntervalMinutes",[ri],(function(t,e){return Ni(t,e,6e4,60)})),Nn("getIntervalTotalMinutes",[ri],(function(t,e){return Ni(t,e,6e4)})),Nn("getIntervalHours",[ri],(function(t,e){return Ni(t,e,zi,24)})),Nn("getIntervalTotalHours",[ri],(function(t,e){return Ni(t,e,zi)})),Nn("getIntervalTotalDays",[ri],(function(t,e){return Ni(t,e,864e5)})),Nn("getIntervalTotalWeeks",[ri],(function(t,e){return Ni(t,e,6048e5)})),Nn("len",[ei],(function(t,e){return{type:ri,value:Dr(e.value.length)}})),Nn("contains",[ei,ei],(function(t,e,r){return{type:ii,value:e.value.includes(r.value)?1:0}})),Nn("substring",[ei,ri,ri],(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:ei,value:e.value.substring(Number(r.value),Number(n.value))}})),Nn("replaceAll",[ei,ei,ei],(function(t,e,r,n){let i;return i=r.value?e.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(r.value),"g"),n.value):e.value,{type:ei,value:i}})),Nn("index",[ei,ei],(function(t,e,r){return{type:ri,value:Dr(e.value.indexOf(r.value))}})),Nn("lastIndex",[ei,ei],(function(t,e,r){return{type:ri,value:Dr(e.value.lastIndexOf(r.value))}})),Nn("trim",[ei],(function(t,e){return{type:ei,value:e.value.trim()}})),Nn("trimLeft",[ei],(function(t,e){return{type:ei,value:e.value.replace(/^\s+/,"")}})),Nn("trimRight",[ei],(function(t,e){return{type:ei,value:e.value.replace(/\s+$/,"")}})),Nn("toUpperCase",[ei],(function(t,e){return{type:ei,value:e.value.toUpperCase()}})),Nn("toLowerCase",[ei],(function(t,e){return{type:ei,value:e.value.toLowerCase()}})),Nn("padStart",[ei,ri,ei],Ci),Nn("padStart",[ri,ri,ei],Ci),Nn("padEnd",[ei,ri,ei],ji),Nn("padEnd",[ri,ri,ei],ji),Nn("testRegex",[ei,ei],(function(t,e,r){let n;try{n=new RegExp(r.value)}catch(t){throw new Error("Invalid regular expression.")}return{type:ii,value:n.test(e.value)?1:0}})),Nn("div",[ri,ri],(function(t,e,r){if(r.value===Sr)throw new Error("Division by zero is not supported.");let n=e.value/r.value;return n=qn(0,n),Jn(t,n),{type:ri,value:n}})),Nn("div",[ni,ni],(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:ni,value:n}})),Nn("mod",[ri,ri],(function(t,e,r){if(r.value===Sr)throw new Error("Division by zero is not supported.");let n=e.value%r.value;return n=qn(0,n),Jn(t,n),{type:ri,value:n}})),Nn("mod",[ni,ni],(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:ni,value:n}})),Nn("mul",[{type:ri,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Sr;for(let n=1;n<e.length;++n)r*=e[n].value,r=qn(0,r),Jn(t,r);return{type:ri,value:r}})),Nn("mul",[{type:ni,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:ni,value:r}})),Nn("sub",[{type:ri,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Sr;for(let n=1;n<e.length;++n)r-=e[n].value,r=qn(0,r),Jn(t,r);return{type:ri,value:r}})),Nn("sub",[{type:ni,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:ni,value:r}})),Nn("sum",[{type:ri,isVararg:!0}],(function(t,...e){let r=Sr;for(let n=0;n<e.length;++n)r+=e[n].value,r=qn(0,r),Jn(t,r);return{type:ri,value:r}})),Nn("sum",[{type:ni,isVararg:!0}],(function(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value;return{type:ni,value:r}})),Nn("abs",[ri],(function(t,e){const r=Or(e.value);return Jn(t,r),{type:e.type,value:r}})),Nn("abs",[ni],(function(t,e){const r=Math.abs(e.value);return{type:ni,value:r}})),Nn("max",[{type:ri,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:ri,value:r}})),Nn("max",[{type:ni,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:ni,value:Math.max(...e.map((t=>t.value)))}})),Nn("min",[{type:ri,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:ri,value:r}})),Nn("min",[{type:ni,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:ni,value:Math.min(...e.map((t=>t.value)))}})),Nn("maxNumber",[],(function(){return{type:ni,value:Kn}})),Nn("minNumber",[],(function(){return{type:ni,value:ti}})),Nn("maxInteger",[],(function(t){return Jn(t,Fr),{type:ri,value:Fr}})),Nn("minInteger",[],(function(t){return Jn(t,Vr),{type:ri,value:Vr}})),Nn("round",[ni],(function(t,e){const r=Math.sign(e.value);return{type:ni,value:r*Math.round(Math.abs(e.value))}})),Nn("floor",[ni],(function(t,e){return{type:ni,value:Math.floor(e.value)}})),Nn("ceil",[ni],(function(t,e){return{type:ni,value:Math.ceil(e.value)}})),Nn("signum",[ri],(function(t,e){return{type:ri,value:Pr(e.value)}})),Nn("signum",[ni],(function(t,e){return{type:ni,value:Math.sign(e.value)}})),Nn("copySign",[ri,ri],(function(t,e,r){let n;if(r.value===Sr)n=e.value;else if(e.value===Sr)n=Dr(0);else{const t=Pr(r.value);n=Or(e.value)*t}return Jn(t,n),{type:ri,value:n}})),Nn("copySign",[ni,ni],(function(t,e,r){let n=Math.sign(r.value);0===n&&(n=Object.is(n,0)?1:-1);const i=Math.abs(e.value)*n;return{type:ni,value:i}})),Nn("getColorAlpha",[ei],Vi),Nn("getColorAlpha",[oi],Vi),Nn("getColorRed",[ei],Di),Nn("getColorRed",[oi],Di),Nn("getColorGreen",[ei],Si),Nn("getColorGreen",[oi],Si),Nn("getColorBlue",[ei],Oi),Nn("getColorBlue",[oi],Oi),Nn("setColorAlpha",[ei,ni],Pi),Nn("setColorAlpha",[oi,ni],Pi),Nn("setColorRed",[ei,ni],Ii),Nn("setColorRed",[oi,ni],Ii),Nn("setColorGreen",[ei,ni],Mi),Nn("setColorGreen",[oi,ni],Mi),Nn("setColorBlue",[ei,ni],Ti),Nn("setColorBlue",[oi,ni],Ti),Nn("rgb",[ni,ni,ni],(function(t,e,r,n){const i={a:255,r:255*e.value,g:255*r.value,b:255*n.value};return{type:oi,value:Xn(i)}})),Nn("argb",[ni,ni,ni,ni],(function(t,e,r,n,i){const o={a:255*e.value,r:255*r.value,g:255*n.value,b:255*i.value};return{type:oi,value:Xn(o)}})),Nn("getDictString",[li,{type:ei,isVararg:!0}],Ui),Nn("getStringFromDict",[li,{type:ei,isVararg:!0}],Ui),Nn("getDictNumber",[li,{type:ei,isVararg:!0}],Li),Nn("getNumberFromDict",[li,{type:ei,isVararg:!0}],Li),Nn("getDictInteger",[li,{type:ei,isVararg:!0}],Wi),Nn("getIntegerFromDict",[li,{type:ei,isVararg:!0}],Wi),Nn("getDictBoolean",[li,{type:ei,isVararg:!0}],Hi),Nn("getBooleanFromDict",[li,{type:ei,isVararg:!0}],Hi),Nn("getDictColor",[li,{type:ei,isVararg:!0}],qi),Nn("getColorFromDict",[li,{type:ei,isVararg:!0}],qi),Nn("getDictUrl",[li,{type:ei,isVararg:!0}],Ji),Nn("getUrlFromDict",[li,{type:ei,isVararg:!0}],Ji),Nn("getDictOptString",[ei,li,{type:ei,isVararg:!0}],Yi),Nn("getOptStringFromDict",[ei,li,{type:ei,isVararg:!0}],Yi),Nn("getDictOptNumber",[ni,li,{type:ei,isVararg:!0}],Xi),Nn("getOptNumberFromDict",[ni,li,{type:ei,isVararg:!0}],Xi),Nn("getDictOptInteger",[ri,li,{type:ei,isVararg:!0}],Qi),Nn("getOptIntegerFromDict",[ri,li,{type:ei,isVararg:!0}],Qi),Nn("getDictOptBoolean",[ii,li,{type:ei,isVararg:!0}],Ki),Nn("getOptBooleanFromDict",[ii,li,{type:ei,isVararg:!0}],Ki),Nn("getDictOptColor",[oi,li,{type:ei,isVararg:!0}],to),Nn("getOptColorFromDict",[oi,li,{type:ei,isVararg:!0}],to),Nn("getDictOptColor",[ei,li,{type:ei,isVararg:!0}],to),Nn("getOptColorFromDict",[ei,li,{type:ei,isVararg:!0}],to),Nn("getDictOptUrl",[ei,li,{type:ei,isVararg:!0}],eo),Nn("getOptUrlFromDict",[ei,li,{type:ei,isVararg:!0}],eo),Nn("getDictOptUrl",[ai,li,{type:ei,isVararg:!0}],eo),Nn("getOptUrlFromDict",[ai,li,{type:ei,isVararg:!0}],eo),Nn("getDictFromDict",[li,{type:ei,isVararg:!0}],Zi),Nn("getArrayFromDict",[li,{type:ei,isVararg:!0}],Gi),Nn("getOptArrayFromDict",[li,{type:ei,isVararg:!0}],(function(t,e,...r){try{return Gi(t,e,...r)}catch(t){return{type:ci,value:[]}}})),Nn("getOptDictFromDict",[li,{type:ei,isVararg:!0}],(function(t,e,...r){try{return Zi(t,e,...r)}catch(t){return{type:li,value:{}}}})),Nn("getArrayString",[ci,ri],io),Nn("getStringFromArray",[ci,ri],io),Nn("getArrayNumber",[ci,ri],oo),Nn("getNumberFromArray",[ci,ri],oo),Nn("getArrayInteger",[ci,ri],ao),Nn("getIntegerFromArray",[ci,ri],ao),Nn("getArrayBoolean",[ci,ri],so),Nn("getBooleanFromArray",[ci,ri],so),Nn("getArrayColor",[ci,ri],lo),Nn("getColorFromArray",[ci,ri],lo),Nn("getArrayUrl",[ci,ri],co),Nn("getUrlFromArray",[ci,ri],co),Nn("getArrayFromArray",[ci,ri],uo),Nn("getDictFromArray",[ci,ri],po),Nn("getArrayOptString",[ci,ri,ei],vo),Nn("getOptStringFromArray",[ci,ri,ei],vo),Nn("getArrayOptNumber",[ci,ri,ni],go),Nn("getOptNumberFromArray",[ci,ri,ni],go),Nn("getArrayOptInteger",[ci,ri,ri],fo),Nn("getOptIntegerFromArray",[ci,ri,ri],fo),Nn("getArrayOptBoolean",[ci,ri,ii],ho),Nn("getOptBooleanFromArray",[ci,ri,ii],ho),Nn("getArrayOptColor",[ci,ri,oi],mo),Nn("getOptColorFromArray",[ci,ri,oi],mo),Nn("getArrayOptColor",[ci,ri,ei],mo),Nn("getOptColorFromArray",[ci,ri,ei],mo),Nn("getArrayOptUrl",[ci,ri,ai],yo),Nn("getOptUrlFromArray",[ci,ri,ai],yo),Nn("getArrayOptUrl",[ci,ri,ei],yo),Nn("getOptUrlFromArray",[ci,ri,ei],yo),Nn("getOptArrayFromArray",[ci,ri],(function(t,e,r){try{return uo(t,e,r)}catch(t){return{type:ci,value:[]}}})),Nn("getOptDictFromArray",[ci,ri],(function(t,e,r){try{return po(t,e,r)}catch(t){return{type:li,value:{}}}})),Nn("len",[ci],(function(t,e){return{type:ri,value:Dr(e.value.length)}}));const _o={StringLiteral:function(t,e){return{type:ei,value:e.value}},NumberLiteral:function(t,e){return{type:ni,value:e.value}},IntegerLiteral:function(t,e){return Jn(t,e.value),{type:ri,value:e.value}},BooleanLiteral:function(t,e){return{type:ii,value:e.value?1:0}},UnaryExpression:function(t,e){const r=Bn(wo(t,e.argument));switch(e.operator){case"!":if(r.type===ii)return{type:ii,value:r.value?0:1};Zn(`${e.operator}${Wn(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const n="+"===e.operator?1:-1;if(r.type===ri){const e=r.value*Dr(n);return Jn(t,e),{type:ri,value:e}}if(r.type===ni)return{type:ni,value:r.value*n};Zn(`${e.operator}${Wn(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=Bn(wo(t,e.test));if(r.type===ii)return r.value?wo(t,e.consequent):wo(t,e.alternate);Zn(`${Wn(r)} ? ${Wn(wo(t,e.consequent))} : ${Wn(wo(t,e.alternate))}`,"Ternary must be called with a Boolean value as a condition.")},TryExpression:function(t,e){try{return wo(t,e.test)}catch(r){return wo(t,e.alternate)}},TemplateLiteral:function(t,e){let r="";if(2===e.quasis.length&&""===e.quasis[0].value&&""===e.quasis[1].value)return wo(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=Ln(wo(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:ei,value:r}},LogicalExpression:function(t,e){const r=Bn(wo(t,e.left));if(r.type!==ii&&Zn(`${Wn(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:ii,value:0};const n=Bn(wo(t,e.right));return n.type!==ii&&Zn(`${Wn(r)} ${e.operator} ${Wn(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${Hn(n.type)}.`),{type:ii,value:n.value}},BinaryExpression:function(t,e){const r=e.operator,n=wo(t,e.left),i=wo(t,e.right);if(n.type!==i.type&&Zn(`${Wn(n)} ${e.operator} ${Wn(i)}`,`Operator '${r}' cannot be applied to different types: ${Hn(n.type)} and ${Hn(i.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===si&&r.type===si?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:ii,value:n?1:0}}(r,n,i);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==ni&&e.type!==ri&&e.type!==si&&Zn(`${Wn(e)} ${t} ${Wn(r)}`,`Operator '${t}' cannot be applied to ${Hn(e.type)} type.`);const i=e.type===si?e.value.getTime():e.value,o=r.type===si?r.value.getTime():r.value;return n=">"===t?i>o:">="===t?i>=o:"<"===t?i<o:i<=o,{type:ii,value:n?1:0}}(r,n,i);if("+"===r||"-"===r)return function(t,e,r,n){if(r.type!==ei&&r.type!==ni&&r.type!==ri&&Zn(`${Wn(r)} ${e} ${Wn(n)}`,`Operator '${e}' cannot be applied to ${Hn(r.type)} type.`),r.type===ei)return"-"===e&&Zn(`${Wn(r)} - ${Wn(n)}`,`Operator '${e}' cannot be applied to ${Hn(r.type)} type.`),{type:ei,value:r.value+n.value};let i="+"===e?r.value+n.value:r.value-n.value;if(r.type===ri)try{i=qn(0,i),Jn(t,i)}catch(t){Zn(`${Wn(r)} ${e} ${Wn(n)}`,t.message)}return{type:r.type,value:i}}(t,r,n,i);if("/"===r||"*"===r||"%"===r)return function(t,e,r,n){let i;if(r.type!==ri&&r.type!==ni&&Zn(`${Wn(r)} ${e} ${Wn(n)}`,`Operator '${e}' cannot be applied to ${Hn(r.type)} type.`),"*"===e)i=r.value*n.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(n.value)&&Zn(`${Wn(r)} ${e} ${Wn(n)}`,"Division by zero is not supported."),i="/"===e?r.value/n.value:r.value%n.value}if(r.type===ri)try{i=qn(0,i),Jn(t,i)}catch(t){Zn(`${Wn(r)} ${e} ${Wn(n)}`,t.message)}return{type:r.type,value:i}}(t,r,n,i);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;let n;const i=e.arguments.map((e=>wo(t,e))),o=r+":"+i.map((t=>t.type)).join("#");if(Tn.has(o))n=Tn.get(o);else{const t=function(t,e){const r=Mn.get(t);if(!r)return{type:"missing"};let n=null;for(let t=0;t<r.length;++t){const i=zn(r[t],e);if("match"===i.type)return r[t];n||(n=i)}if(!n)throw new Error("Missing function");return n}(r,i);if("expected"in t||"type"in t&&"missing"===t.type){const e=i.map((t=>Hn(t.type))).join(", "),n=`${r}(${bo(i)})`;"few"===t.type&&0===i.length?Zn(n,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?Zn(n,`Function '${r}' has no matching override for given argument types: ${e}.`):Zn(n,`Unknown function name: ${r}.`)}n=t}if(!n)throw new Error("Function not found");try{return n.cb(t,...i)}catch(t){Zn(`${r}(${bo(i)})`,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 wo(t,e){if(e.type in _o)return _o[e.type](t,e);throw new Error("Unsupported expression")}class $o{constructor(t){this.ast=t}apply(t,e,r=!1){try{const n=function(t,e){try{const r={variables:t,warnings:[],safeIntegerOverflow:!1},n=wo(r,e);return r.safeIntegerOverflow&&r.warnings.push(st(new Error("Safe integer overflow, values may lose accuracy."),{level:"warn"})),{result:n,warnings:r.warnings}}catch(t){return{result:{type:"error",value:t.message},warnings:[]}}}(t,this.ast);n.warnings.forEach(e);const i=n.result;if("error"===i.type)return void e(st(new Error("Expression execution error"),{additional:{message:i.value}}));const o=i.value;if(o instanceof Date)return Un(o);if("boolean"===i.type)return Boolean(o);if("color"===i.type){const t=ft(String(o));if(t)return Xn(t);e(st(new Error("Expression execution error")))}if("integer"===i.type)return o>2147483647||o<-2147483648?void e(st(new Error("Expression result is out of 32-bit int range"))):Number(o);if(!r&&("array"===i.type||"dict"===i.type))try{return JSON.stringify(o)}catch(t){return e(st(new Error(`Failed to stringify ${i.type}`))),`<${i.type}>`}return o}catch(t){return void e(st(new Error("Expression execution error")))}}}function xo(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={},i=(e=void 0!==e?e:{}).grammarSource,o={start:Ve,JsonStringContents:function(){var t,e,r;for(t=me,e=[],r=De();r!==n;)e.push(r),r=De();return ye=t,Ot(e)}},a=Ve,s="@{",l="}",c="@{}",u="\\",d="?",p=":",v="!:",g="||",f="&&",h="==",m="!=",y=">=",b=">",_="<=",w="<",$="+",x="-",k="/",E="*",C="%",j="!",A="(",F=")",V=",",D="'",S=".",O="e",P="E",I="true",M="false",T=/^[^}]/,N=/^[^'}]/,z=/^[0-9]/,R=/^[a-zA-Z_0-9.]/,B=/^[a-zA-Z_]/,U=/^[ \t\r\n]/,L=ke("@{",!1),W=ke("}",!1),H=ke("@{}",!1),q=ke("\\",!1),J={type:"any"},G=Ee(["}"],!0,!1),Z=ke("?",!1),Y=ke(":",!1),X=ke("!:",!1),Q=ke("||",!1),K=ke("&&",!1),tt=ke("==",!1),et=ke("!=",!1),rt=ke(">=",!1),nt=ke(">",!1),it=ke("<=",!1),ot=ke("<",!1),at=ke("+",!1),st=ke("-",!1),lt=ke("/",!1),ct=ke("*",!1),ut=ke("%",!1),dt=ke("!",!1),pt=ke("(",!1),vt=ke(")",!1),gt=ke(",",!1),ft=Ce("string"),ht=ke("'",!1),mt=Ee(["'","}"],!0,!1),yt=Ce("integer"),bt=Ee([["0","9"]],!1,!1),_t=Ce("number"),wt=ke(".",!1),$t=ke("e",!1),xt=ke("E",!1),kt=Ce("boolean"),Et=ke("true",!1),Ct=ke("false",!1),jt=Ee([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),At=Ce("identifier"),Ft=Ee([["a","z"],["A","Z"],"_"],!1,!1),Vt=Ce("whitespace"),Dt=Ee([" ","\t","\r","\n"],!1,!1),St=function(t){return t},Ot=function(t){return Dn(t)},Pt=function(t){return t},It=function(){return""},Mt=function(){return xe()},Tt=function(){throw new Error("Error tokenizing '"+t+"'.")},Nt=function(){throw new Error("Error tokenizing '"+t+"'.")},zt=function(t){return t},Rt=function(t){return On(t)},Bt=function(){throw new Error("Error tokenizing '"+t+"'.")},Ut=function(t,e,r){return{type:"ConditionalExpression",test:t,consequent:e,alternate:r}},Lt=function(t,e){return{type:"TryExpression",test:t,alternate:e}},Wt=function(t,e){return Vn(t,e)},Ht=function(t,e){return Vn(t,e)},qt=function(t,e){return Fn(t,e)},Jt=function(t,e){return Fn(t,e)},Gt=function(t,e){return Fn(t,e)},Zt=function(t,e){return Fn(t,e)},Yt=function(t,e){return{type:"UnaryExpression",operator:t,argument:e}},Xt=function(t,e){return{type:"CallExpression",callee:t,arguments:e}},Qt=function(t){return{type:"Variable",id:t}},Kt=function(t,e){return[t,...e]},te=function(t){return t},ee=function(t){return t},re=function(t){return Dn(t)},ne=function(t){return t},ie=function(){return""},oe=function(){return xe()},ae=function(){throw new Error("Error tokenizing '"+t+"'.")},se=function(){throw new Error("Error tokenizing '"+t+"'.")},le=function(t){return t},ce=function(t){return On(t)},ue=function(){throw new Error("Error tokenizing '"+t+"'.")},de=function(){return{type:"IntegerLiteral",value:Sn(xe())}},pe=function(){return{type:"NumberLiteral",value:parseFloat(xe())}},ve=function(){return{type:"NumberLiteral",value:parseFloat(xe())}},ge=function(){return{type:"BooleanLiteral",value:!0}},fe=function(){return{type:"BooleanLiteral",value:!1}},he=function(){return{type:"Identifier",name:xe()}},me=0,ye=0,be=[{line:1,column:1}],_e=0,we=[],$e=0;if("startRule"in e){if(!(e.startRule in o))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=o[e.startRule]}function xe(){return t.substring(ye,me)}function ke(t,e){return{type:"literal",text:t,ignoreCase:e}}function Ee(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function Ce(t){return{type:"other",description:t}}function je(e){var r,n=be[e];if(n)return n;for(r=e-1;!be[r];)r--;for(n={line:(n=be[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return be[e]=n,n}function Ae(t,e,r){var n=je(t),o=je(e),a={source:i,start:{offset:t,line:n.line,column:n.column},end:{offset:e,line:o.line,column:o.column}};return r&&i&&"function"==typeof i.offset&&(a.start=i.offset(a.start),a.end=i.offset(a.end)),a}function Fe(t){me<_e||(me>_e&&(_e=me,we=[]),we.push(t))}function Ve(){var t,e;return t=me,He(),(e=Se())!==n?(He(),ye=t,t=St(e)):(me=t,t=n),t}function De(){var e,r,i,o,a;if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(L)),r!==n?(i=He(),(o=Se())!==n?(He(),125===t.charCodeAt(me)?(a=l,me++):(a=n,0===$e&&Fe(W)),a!==n?(ye=e,e=Pt(o)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,t.substr(me,3)===c?(r=c,me+=3):(r=n,0===$e&&Fe(H)),r!==n&&(ye=e,r=It()),(e=r)===n&&(e=me,r=me,$e++,92===t.charCodeAt(me)?(i=u,me++):(i=n,0===$e&&Fe(q)),i===n&&(t.substr(me,2)===s?(i=s,me+=2):(i=n,0===$e&&Fe(L))),$e--,i===n?r=void 0:(me=r,r=n),r!==n?(t.length>me?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(J)),i!==n?(ye=e,e=Mt()):(me=e,e=n)):(me=e,e=n),e===n))){if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(L)),r!==n){if(i=[],T.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(G)),o!==n)for(;o!==n;)i.push(o),T.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(G));else i=n;i!==n?(125===t.charCodeAt(me)?(o=l,me++):(o=n,0===$e&&Fe(W)),o!==n?(ye=e,e=Tt()):(me=e,e=n)):(me=e,e=n)}else me=e,e=n;e===n&&(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(L)),r!==n&&(ye=e,r=Nt()),(e=r)===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n?(t.substr(me,2)===s?(i=s,me+=2):(i=n,0===$e&&Fe(L)),i!==n?(ye=e,e=zt(i)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n?(t.length>me?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(J)),i!==n?(ye=e,e=Rt(i)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n&&(ye=e,r=Bt()),e=r))))}return e}function Se(){var e,r,i,o,a,s;return e=me,(r=Oe())!==n?(He(),63===t.charCodeAt(me)?(i=d,me++):(i=n,0===$e&&Fe(Z)),i!==n?(He(),(o=Se())!==n?(He(),58===t.charCodeAt(me)?(a=p,me++):(a=n,0===$e&&Fe(Y)),a!==n?(He(),(s=Se())!==n?(ye=e,e=Ut(r,o,s)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=Oe()),e}function Oe(){var e,r,i,o;return e=me,(r=Pe())!==n?(He(),t.substr(me,2)===v?(i=v,me+=2):(i=n,0===$e&&Fe(X)),i!==n?(He(),(o=Se())!==n?(ye=e,e=Lt(r,o)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=Pe()),e}function Pe(){var e,r,i,o,a,s,l,c;if(e=me,(r=Ie())!==n){for(i=[],o=me,a=He(),t.substr(me,2)===g?(s=g,me+=2):(s=n,0===$e&&Fe(Q)),s!==n?(l=He(),(c=Ie())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);o!==n;)i.push(o),o=me,a=He(),t.substr(me,2)===g?(s=g,me+=2):(s=n,0===$e&&Fe(Q)),s!==n?(l=He(),(c=Ie())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);ye=e,e=Wt(r,i)}else me=e,e=n;return e}function Ie(){var e,r,i,o,a,s,l,c;if(e=me,(r=Me())!==n){for(i=[],o=me,a=He(),t.substr(me,2)===f?(s=f,me+=2):(s=n,0===$e&&Fe(K)),s!==n?(l=He(),(c=Me())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);o!==n;)i.push(o),o=me,a=He(),t.substr(me,2)===f?(s=f,me+=2):(s=n,0===$e&&Fe(K)),s!==n?(l=He(),(c=Me())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);ye=e,e=Ht(r,i)}else me=e,e=n;return e}function Me(){var e,r,i,o,a,s,l,c;if(e=me,(r=Te())!==n){for(i=[],o=me,a=He(),t.substr(me,2)===h?(s=h,me+=2):(s=n,0===$e&&Fe(tt)),s===n&&(t.substr(me,2)===m?(s=m,me+=2):(s=n,0===$e&&Fe(et))),s!==n?(l=He(),(c=Te())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);o!==n;)i.push(o),o=me,a=He(),t.substr(me,2)===h?(s=h,me+=2):(s=n,0===$e&&Fe(tt)),s===n&&(t.substr(me,2)===m?(s=m,me+=2):(s=n,0===$e&&Fe(et))),s!==n?(l=He(),(c=Te())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);ye=e,e=qt(r,i)}else me=e,e=n;return e}function Te(){var e,r,i,o,a,s,l,c;if(e=me,(r=Ne())!==n){for(i=[],o=me,a=He(),t.substr(me,2)===y?(s=y,me+=2):(s=n,0===$e&&Fe(rt)),s===n&&(62===t.charCodeAt(me)?(s=b,me++):(s=n,0===$e&&Fe(nt)),s===n&&(t.substr(me,2)===_?(s=_,me+=2):(s=n,0===$e&&Fe(it)),s===n&&(60===t.charCodeAt(me)?(s=w,me++):(s=n,0===$e&&Fe(ot))))),s!==n?(l=He(),(c=Ne())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);o!==n;)i.push(o),o=me,a=He(),t.substr(me,2)===y?(s=y,me+=2):(s=n,0===$e&&Fe(rt)),s===n&&(62===t.charCodeAt(me)?(s=b,me++):(s=n,0===$e&&Fe(nt)),s===n&&(t.substr(me,2)===_?(s=_,me+=2):(s=n,0===$e&&Fe(it)),s===n&&(60===t.charCodeAt(me)?(s=w,me++):(s=n,0===$e&&Fe(ot))))),s!==n?(l=He(),(c=Ne())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);ye=e,e=Jt(r,i)}else me=e,e=n;return e}function Ne(){var e,r,i,o,a,s,l,c;if(e=me,(r=ze())!==n){for(i=[],o=me,a=He(),43===t.charCodeAt(me)?(s=$,me++):(s=n,0===$e&&Fe(at)),s===n&&(45===t.charCodeAt(me)?(s=x,me++):(s=n,0===$e&&Fe(st))),s!==n?(l=He(),(c=ze())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);o!==n;)i.push(o),o=me,a=He(),43===t.charCodeAt(me)?(s=$,me++):(s=n,0===$e&&Fe(at)),s===n&&(45===t.charCodeAt(me)?(s=x,me++):(s=n,0===$e&&Fe(st))),s!==n?(l=He(),(c=ze())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);ye=e,e=Gt(r,i)}else me=e,e=n;return e}function ze(){var e,r,i,o,a,s,l,c;if(e=me,(r=Re())!==n){for(i=[],o=me,a=He(),47===t.charCodeAt(me)?(s=k,me++):(s=n,0===$e&&Fe(lt)),s===n&&(42===t.charCodeAt(me)?(s=E,me++):(s=n,0===$e&&Fe(ct)),s===n&&(37===t.charCodeAt(me)?(s=C,me++):(s=n,0===$e&&Fe(ut)))),s!==n?(l=He(),(c=Re())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);o!==n;)i.push(o),o=me,a=He(),47===t.charCodeAt(me)?(s=k,me++):(s=n,0===$e&&Fe(lt)),s===n&&(42===t.charCodeAt(me)?(s=E,me++):(s=n,0===$e&&Fe(ct)),s===n&&(37===t.charCodeAt(me)?(s=C,me++):(s=n,0===$e&&Fe(ut)))),s!==n?(l=He(),(c=Re())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);ye=e,e=Zt(r,i)}else me=e,e=n;return e}function Re(){var e,r,i;return(e=Le())===n&&(e=Ue())===n&&(e=me,33===t.charCodeAt(me)?(r=j,me++):(r=n,0===$e&&Fe(dt)),r===n&&(43===t.charCodeAt(me)?(r=$,me++):(r=n,0===$e&&Fe(at)),r===n&&(45===t.charCodeAt(me)?(r=x,me++):(r=n,0===$e&&Fe(st)))),r!==n?(He(),(i=Re())!==n?(ye=e,e=Yt(r,i)):(me=e,e=n)):(me=e,e=n),e===n&&(e=function(){var e,r,i,o,a;return e=me,(r=We())!==n?(He(),40===t.charCodeAt(me)?(i=A,me++):(i=n,0===$e&&Fe(pt)),i!==n?(He(),o=function(){var e,r,i,o,a,s;if(e=me,(r=Se())!==n){for(i=[],o=me,He(),44===t.charCodeAt(me)?(a=V,me++):(a=n,0===$e&&Fe(gt)),a!==n?(He(),(s=Se())!==n?o=s:(me=o,o=n)):(me=o,o=n);o!==n;)i.push(o),o=me,He(),44===t.charCodeAt(me)?(a=V,me++):(a=n,0===$e&&Fe(gt)),a!==n?(He(),(s=Se())!==n?o=s:(me=o,o=n)):(me=o,o=n);ye=e,e=Kt(r,i)}else me=e,e=n;return e===n&&(e=He()),e}(),o!==n?(He(),41===t.charCodeAt(me)?(a=F,me++):(a=n,0===$e&&Fe(vt)),a!==n?(ye=e,e=Xt(r,o)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,(r=We())!==n&&(ye=e,r=Qt(r)),(e=r)===n&&(e=function(){var e,r,i,o;return e=function(){var e,r,i,o;return $e++,e=me,39===t.charCodeAt(me)?(r=D,me++):(r=n,0===$e&&Fe(ht)),r!==n?(i=function(){var t,e,r;for(t=me,e=[],r=Be();r!==n;)e.push(r),r=Be();return ye=t,re(e)}(),39===t.charCodeAt(me)?(o=D,me++):(o=n,0===$e&&Fe(ht)),o!==n?(ye=e,e=ee(i)):(me=e,e=n)):(me=e,e=n),$e--,e===n&&(r=n,0===$e&&Fe(ft)),e}(),e===n&&(e=Le())===n&&(e=Ue())===n&&(e=function(){var e,r;return $e++,e=me,t.substr(me,4)===I?(r=I,me+=4):(r=n,0===$e&&Fe(Et)),r!==n&&(ye=e,r=ge()),(e=r)===n&&(e=me,t.substr(me,5)===M?(r=M,me+=5):(r=n,0===$e&&Fe(Ct)),r!==n&&(ye=e,r=fe()),e=r),$e--,e===n&&(r=n,0===$e&&Fe(kt)),e}(),e===n&&(e=me,40===t.charCodeAt(me)?(r=A,me++):(r=n,0===$e&&Fe(pt)),r!==n?(He(),(i=Se())!==n?(He(),41===t.charCodeAt(me)?(o=F,me++):(o=n,0===$e&&Fe(vt)),o!==n?(ye=e,e=te(i)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n))),e}())),e}())),e}function Be(){var e,r,i,o,a;if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(L)),r!==n?(i=He(),(o=Se())!==n?(He(),125===t.charCodeAt(me)?(a=l,me++):(a=n,0===$e&&Fe(W)),a!==n?(ye=e,e=ne(o)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,t.substr(me,3)===c?(r=c,me+=3):(r=n,0===$e&&Fe(H)),r!==n&&(ye=e,r=ie()),(e=r)===n&&(e=me,r=me,$e++,92===t.charCodeAt(me)?(i=u,me++):(i=n,0===$e&&Fe(q)),i===n&&(39===t.charCodeAt(me)?(i=D,me++):(i=n,0===$e&&Fe(ht)),i===n&&(t.substr(me,2)===s?(i=s,me+=2):(i=n,0===$e&&Fe(L)))),$e--,i===n?r=void 0:(me=r,r=n),r!==n?(t.length>me?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(J)),i!==n?(ye=e,e=oe()):(me=e,e=n)):(me=e,e=n),e===n))){if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(L)),r!==n){if(i=[],N.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(mt)),o!==n)for(;o!==n;)i.push(o),N.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(mt));else i=n;i!==n?(125===t.charCodeAt(me)?(o=l,me++):(o=n,0===$e&&Fe(W)),o!==n?(ye=e,e=ae()):(me=e,e=n)):(me=e,e=n)}else me=e,e=n;e===n&&(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(L)),r!==n&&(ye=e,r=se()),(e=r)===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n?(t.substr(me,2)===s?(i=s,me+=2):(i=n,0===$e&&Fe(L)),i!==n?(ye=e,e=le(i)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n?(t.length>me?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(J)),i!==n?(ye=e,e=ce(i)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n&&(ye=e,r=ue()),e=r))))}return e}function Ue(){var e,r,i,o;if($e++,e=me,45===t.charCodeAt(me)?(r=x,me++):(r=n,0===$e&&Fe(st)),r===n&&(r=null),i=[],z.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(bt)),o!==n)for(;o!==n;)i.push(o),z.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(bt));else i=n;return i!==n?(ye=e,e=de()):(me=e,e=n),$e--,e===n&&(r=n,0===$e&&Fe(yt)),e}function Le(){var e,r,i,o,a,s,l,c,u,d;for($e++,e=me,45===t.charCodeAt(me)?(r=x,me++):(r=n,0===$e&&Fe(st)),r===n&&(r=null),i=[],z.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(bt));o!==n;)i.push(o),z.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(bt));if(46===t.charCodeAt(me)?(o=S,me++):(o=n,0===$e&&Fe(wt)),o!==n){if(a=[],z.test(t.charAt(me))?(s=t.charAt(me),me++):(s=n,0===$e&&Fe(bt)),s!==n)for(;s!==n;)a.push(s),z.test(t.charAt(me))?(s=t.charAt(me),me++):(s=n,0===$e&&Fe(bt));else a=n;if(a!==n){if(s=me,101===t.charCodeAt(me)?(l=O,me++):(l=n,0===$e&&Fe($t)),l===n&&(69===t.charCodeAt(me)?(l=P,me++):(l=n,0===$e&&Fe(xt))),l!==n){if(43===t.charCodeAt(me)?(c=$,me++):(c=n,0===$e&&Fe(at)),c===n&&(45===t.charCodeAt(me)?(c=x,me++):(c=n,0===$e&&Fe(st))),c===n&&(c=null),u=[],z.test(t.charAt(me))?(d=t.charAt(me),me++):(d=n,0===$e&&Fe(bt)),d!==n)for(;d!==n;)u.push(d),z.test(t.charAt(me))?(d=t.charAt(me),me++):(d=n,0===$e&&Fe(bt));else u=n;u!==n?s=l=[l,c,u]:(me=s,s=n)}else me=s,s=n;s===n&&(s=null),ye=e,e=pe()}else me=e,e=n}else me=e,e=n;if(e===n){if(e=me,45===t.charCodeAt(me)?(r=x,me++):(r=n,0===$e&&Fe(st)),r===n&&(r=null),i=[],z.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(bt)),o!==n)for(;o!==n;)i.push(o),z.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(bt));else i=n;if(i!==n)if(101===t.charCodeAt(me)?(o=O,me++):(o=n,0===$e&&Fe($t)),o===n&&(69===t.charCodeAt(me)?(o=P,me++):(o=n,0===$e&&Fe(xt))),o!==n){if(43===t.charCodeAt(me)?(a=$,me++):(a=n,0===$e&&Fe(at)),a===n&&(45===t.charCodeAt(me)?(a=x,me++):(a=n,0===$e&&Fe(st))),a===n&&(a=null),s=[],z.test(t.charAt(me))?(l=t.charAt(me),me++):(l=n,0===$e&&Fe(bt)),l!==n)for(;l!==n;)s.push(l),z.test(t.charAt(me))?(l=t.charAt(me),me++):(l=n,0===$e&&Fe(bt));else s=n;s!==n?(ye=e,e=ve()):(me=e,e=n)}else me=e,e=n;else me=e,e=n}return $e--,e===n&&(r=n,0===$e&&Fe(_t)),e}function We(){var e,r,i,o,a;if($e++,e=me,r=me,$e++,i=function(){var e,r,i,o;return e=me,t.substr(me,4)===I?(r=I,me+=4):(r=n,0===$e&&Fe(Et)),r===n&&(t.substr(me,5)===M?(r=M,me+=5):(r=n,0===$e&&Fe(Ct))),r!==n?(i=me,$e++,R.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(jt)),$e--,o===n?i=void 0:(me=i,i=n),i!==n?e=r=[r,i]:(me=e,e=n)):(me=e,e=n),e}(),$e--,i===n?r=void 0:(me=r,r=n),r!==n)if(B.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(Ft)),i!==n){for(o=[],R.test(t.charAt(me))?(a=t.charAt(me),me++):(a=n,0===$e&&Fe(jt));a!==n;)o.push(a),R.test(t.charAt(me))?(a=t.charAt(me),me++):(a=n,0===$e&&Fe(jt));ye=e,e=he()}else me=e,e=n;else me=e,e=n;return $e--,e===n&&(r=n,0===$e&&Fe(At)),e}function He(){var e,r;for($e++,e=[],U.test(t.charAt(me))?(r=t.charAt(me),me++):(r=n,0===$e&&Fe(Dt));r!==n;)e.push(r),U.test(t.charAt(me))?(r=t.charAt(me),me++):(r=n,0===$e&&Fe(Dt));return $e--,r=n,0===$e&&Fe(Vt),e}if((r=a())!==n&&me===t.length)return r;throw r!==n&&me<t.length&&Fe({type:"end"}),function(t,e,r){return new Pn(Pn.buildMessage(t,e),t,e,r)}(we,_e<t.length?t.charAt(_e):null,_e<t.length?Ae(_e,_e+1):Ae(_e,_e))}(t,{startRule:"JsonStringContents"}),n=Gn(r);return e.vars.push(...n),new $o(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=>xo(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=xo(t[i],e,r);return n}}var n;return t}function ko(t,e,r,n=!1){if(t){if(t instanceof $o)return t.apply(e,r,n);if(Array.isArray(t))return t.map((t=>ko(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=ko(t[i],e,r);return n}}return t}function Eo(t,e){const r={vars:[],hasExpression:!1},n=xo(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:(t,r)=>ko(n,t,e,r)}}const Co={pagers:function(){return Q(new Map)}},jo=new Map,Ao=new Map;function Fo(t){const e=jo.get(t)||Q("");return jo.has(t)||jo.set(t,e),e}function Vo(t){const e=Ao.get(t)||new Map;return Ao.has(t)||Ao.set(t,e),e}class Do{setVariable(t){const e=t.getName(),r=Vo(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Fo(this).set(e)}getVariable(t){return Vo(this).get(t)}list(){return Vo(this).values()}}function So(){return new Do}function Oo(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 Po=new Set(["start","stop","pause","resume","cancel","reset"]);class Io{constructor(t){Oo(this,"timers",new Map),Oo(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)&&Po.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)}tickOrUnholdAction(t){const e=performance.now(),r=(t.durationPassed||0)+e-(t.durationStarted||0);t.duration&&r>t.duration||(this.updateVariable(t,r),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((()=>{this.updateVariable(t,e),t.tickCountPredict&&void 0!==t.tickCount&&t.tickCount<t.tickCountPredict&&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(),i=Math.max(0,r-(t.tickPassed||0));t.tickTimeout=window.setTimeout((()=>{this.tickOrUnholdAction(t),t.tickPassed=(performance.now()-n-i)%r,e()}),i)};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))}callActions(t,e){const r=t.definition["end"===e?"end_actions":"tick_actions"];if(r){const t=this.applyVars(r);this.execAnyActions(t,{processUrls:!1})}}holdAll(){for(const[t,e]of this.timers)"running"===e.state&&(e.hold=!0,this.stopTimerTimeouts(e))}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&&this.tickOrUnholdAction(e),this.startOrResume(e)}}}function Mo(t,e,r,n){const{variable_name:i}=r;if(!i)return void e(st(new Error(`Incorrect ${r.type} action`),{additional:{name:i}}));const o=t.get(i);if(!o)return void e(st(new Error("Cannot find variable"),{additional:{name:i}}));const a=o.getType();"array"===a?n(o):e(st(new Error("Trying to insert value into the non-array"),{additional:{name:i,type:a}}))}let To=Q(!0),No=0;function zo(){To.set(!1)}function Ro(){To.set(!0)}function Bo(t,e){return t&&e?new Map([...t,...e]):t||e||void 0}const Uo=L(((t,e,r,n)=>{let i,o,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 Do}=e,{mix:x=""}=e,{customization:k={}}=e,{builtinProtocols:E=["http","https","tel","mailto","intent"]}=e,{extensions:C=new Map}=e,{onError:j}=e,{onStat:A}=e,{onCustomAction:F}=e,{onComponent:V}=e,{typefaceProvider:D=(t=>"")}=e,{fetchInit:S={}}=e,{tooltipRoot:O}=e,{customComponents:P}=e,{direction:M="ltr"}=e,T=Q("desktop"===b);if(s=l(T,(t=>a=t)),"auto"===b&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");T.set(!t.matches),t.addListener((()=>{T.set(!t.matches)}))}let N="light",z=null;const B=Q("rtl"===M?"rtl":"ltr");function U(t){_=t}function L(){return new Map}function H(){return new Map}function q(t){y=t}u=l(B,(t=>c=t));const J=new Set(E);let G=!1,Z=!1;m||(Z=!0,dt(st(new Error('"id" prop is required'))));const Y={stateChange:!1},X=Fo(w),tt=Vo(w),et=new Map,rt=new Map,it=new Map;let ot=null,lt=0,ct=[];function ut(t,e,r,n=!1){const i=Eo(e,t);if(!i.hasExpression)return e;const o=Bo(rt,r);return i.applyVars(o,n)}function dt(t){j?j({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function pt(t,e){A&&A({type:t,action:e})}function vt(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type&&t.type in i;){if(({json:t,templateContext:e}=Cn(t,e,i,dt)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}}let gt=0;function ft(t){return`${m}-${gt++}`}let ht={},yt={};function bt(t){_t(ut(dt,t))}function _t(t,e){const r=t.url?String(t.url):"",n=t.typed;if(!Lt(t))return;const o=(null==e?void 0:e.logError)||dt;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":!function(t){if(!t)throw new Error("Missing state id");let e=St,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],i=r[t+1];let o=e.getChild(n);if(!o)return;o.setState(i),e=o}}(s.get("state_id"));break;case"set_current_item":!function(t,e){if(!t||!e)throw new Error('Missing data for "set-current-item" action');if(Number.isNaN(Number(e)))throw new Error('Incorrect item for "set-current-item" action');const r=Ft(t);r&&r.setCurrentItem(Number(e))}(s.get("id"),s.get("item"));break;case"set_previous_item":!function(t,e){if(!t)throw new Error('Missing id for "set-previous-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-previous-item" action');e=e||"clamp";const r=Ft(t);r&&r.setPreviousItem(e)}(s.get("id"),s.get("overflow"));break;case"set_next_item":!function(t,e){if(!t)throw new Error('Missing id for "set-next-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-next-item" action');e=e||"clamp";const r=Ft(t);r&&r.setNextItem(e)}(s.get("id"),s.get("overflow"));break;case"set_variable":const a=s.get("name"),l=s.get("value");if(a&&null!==l){const t=rt.get(a);if(t){const e=t.getType();"dict"===e||"array"===e?o(st(new Error(`Setting ${e} variables is not supported`),{additional:{name:a}})):t.set(l)}else o(st(new Error("Cannot find variable"),{additional:{name:a}}))}else o(st(new Error("Incorrect set_variable_action"),{additional:{url:n}}));break;case"timer":const c=s.get("action"),u=s.get("id");ot?ot.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)||dt;if(t){const r=Ft(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)||dt;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 o,a,s;if(r){if(r.templates)for(const t in r.templates)i.hasOwnProperty(t)||(i[t]=r.templates[t]);if(Array.isArray(null===(o=r.patch)||void 0===o?void 0:o.changes)){if("transactional"===r.patch.mode){const i=r.patch.changes.find((t=>{const e=Ct.get(t.id);if(!e)return!0;const r=Array.isArray(t.items)?t.items.length:0;return!(!e.isSingleMode||1===r)}));if(i)return n(st(new Error("Skipping transactional, child is not found or broken"),{additional:{url:t,id:i.id}})),void wt(null===(a=e.download_callbacks)||void 0===a?void 0:a.on_fail_actions)}r.patch.changes.forEach((t=>{const e=Ct.get(t.id);e&&e.replaceWith(t.id,t.items)})),wt(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 i;n(st(new Error("Failed to download the patch"),{additional:{url:t,originalError:r}})),wt(null===(i=e.download_callbacks)||void 0===i?void 0:i.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 i=(null==r?void 0:r.logError)||dt;if(!t)return void i(st(new Error("Missing id in show_tooltip action")));const o=At.get(t);if(!o)return void i(st(new Error("Tooltip with the provided id is not found"),{additional:{id:t}}));if("true"!==e&&ct.some((e=>e.desc.id===t)))return;const a={internalId:++lt,ownerNode:o.onwerNode,desc:o.tooltip,timeoutId:0};ct=[...ct,a];const s=null!==(n=o.tooltip.duration)&&void 0!==n?n:5e3;s&&(a.timeoutId=window.setTimeout((()=>{a.timeoutId=0,ct=ct.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)||dt;t?ct=ct.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;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=rt.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:i,value:o}=r;!o||"number"!=typeof i&&void 0!==i?e(st(new Error("Incorrect array_insert_value action"),{additional:{name:n}})):Mo(t,e,r,(t=>{const a=t.getValue();if("number"==typeof i&&(i<0||i>a.length))e(st(new Error(`Index out of bound for mutation ${r.type}`),{additional:{name:n,index:i,length:a.length}}));else{const e=a.slice();"number"==typeof i?e.splice(i,0,o.value):e.push(o.value),t.setValue(e)}}))}(rt,o,n);break;case"array_remove_value":!function(t,e,r){const{variable_name:n,index:i}=r;"number"==typeof i?Mo(t,e,r,(t=>{const o=t.getValue();if("number"==typeof i&&(i<0||i>=o.length))e(st(new Error(`Index out of bound for mutation ${r.type}`),{additional:{name:n,index:i,length:o.length}}));else{const e=o.slice();e.splice(i,1),t.setValue(e)}})):e(st(new Error("Incorrect array_remove_value action"),{additional:{name:n}}))}(rt,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&&jt.get(n.element_id);t?t.focus():o(st(new Error("Incorrect focus_element action"),{additional:{elementId:n.element_id}}));break}default:o(st(new Error("Unknown type of action"),{additional:{type:n.type}}))}}async function wt(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 i=n.url,o=n.typed;if(i){const t=xt(i);if(t)if(kt(t,J)){if(e.processUrls)if("_blank"===n.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=i)}else location.href=i}else"div-action"===t?(_t(n,e.componentContext),await $()):n.log_id&&($t(n),await $())}else o&&_t(n,e.componentContext)}r.forEach((t=>{t.log_id&&pt("click",t)}))}function $t(t){null==F||F(t)}const Et=new Map,Ct=new Map,jt=new Map,At=new Map;function Ft(t){if(Et.has(t))return Et.get(t);dt(st(new Error("Missing instance with id"),{additional:{id:t}}))}const Dt=new Map;g(at,{logStat:pt,hasTemplate:function(t){return t in i},processTemplate:vt,genId:ft,genClass:function(t){return`divkit-${ft()}`},execAction:_t,execCustomAction:$t,isRunning:function(t){return Y[t]},setRunning:function(t,e){Y[t]=e},registerInstance:function(t,e){Et.has(t)?dt(st(new Error("Duplicate instance id"),{additional:{id:t}})):Et.set(t,e)},unregisterInstance:function(t){Et.delete(t)},registerParentOf:function(t,e){Ct.set(t,e)},unregisterParentOf:function(t){Ct.delete(t)},registerTooltip:function(t,e){const r=e.id;r&&(At.has(r)&&dt(st(new Error("Duplicate tooltip id"),{additional:{id:r}})),At.set(r,{onwerNode:t,tooltip:e}))},unregisterTooltip:function(t){const e=t.id;e&&(At.delete(e),ct.some((t=>t.desc.id===e))&&(ct=ct.filter((t=>t.desc.id!==e))))},onTooltipClose:function(t){ct=ct.filter((e=>e.internalId!==t))},tooltipRoot:O,registerFocusable:function(t,e){jt.set(t,e)},unregisterFocusable:function(t){jt.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(yt[r]=yt[r]||0,++yt[r],ht[r])return ht[r];const n=`${ft()}-svg-filter`;return ht=Object.assign(Object.assign({},ht),{[r]:n}),n},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;yt[r]&&0==--yt[r]&&(ht=Object.keys(ht).reduce(((t,e)=>(yt[e]&&(t[e]=ht[e]),t)),{}))},preparePrototypeVariables:function(t,e){const r=new Map,n=function(t,e,r){if(!(e in Zr))throw new Error("Unsupported variable type");return new Zr[e](t,r)}(t,"dict",e);return r.set(t,n),r},getStore:function(t){return Dt.has(t)||function(t){Dt.has(t)||Dt.set(t,Co[t]())}(t),Dt.get(t)},getCustomization:function(t){return null==k?void 0:k[t]},getBuiltinProtocols:function(){return J},getExtension:function(t,e){const r=C.get(t);if(r)return new r(e||{})},getExtensionContext:function(){return{variables:rt,logError:dt}},typefaceProvider:D,isDesktop:T,isPointerFocus:To,customComponents:P,direction:B,componentDevtool:void 0}),g(qt,{hasAction:()=>!1});const St={setState(t){throw new Error("Not implemented")},getChild(t){if(Ot&&Ot.has(t))return Ot.get(t);dt(st(new Error("Missing state block with id"),{additional:{id:t}}))}};let Ot=null;function Pt(t){if(t.type in Wr){"integer"===t.type&&"number"==typeof t.value&&(t.value>Number.MAX_SAFE_INTEGER||t.value<Number.MIN_SAFE_INTEGER)&&dt(st(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=Hr(t.name,t.type,t.value);et.set(t.name,e),rt.set(t.name,e)}catch(e){dt(st(e,{additional:{name:t.name}}))}}}g(Vt,{registerInstance(t,e){Ot||(Ot=new Map),Ot.has(t)?dt(st(new Error("Duplicate state with id"),{additional:{id:t}})):Ot.set(t,e)},unregisterInstance(t){null==Ot||Ot.delete(t)},runVisibilityTransition:(t,e,r,n,i)=>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 It=null===(d=null==y?void 0:y.card)||void 0===d?void 0:d.variables;Array.isArray(It)&&It.forEach((t=>{if(t&&t.name){if(et.has(t.name))return void dt(st(new Error("Duplicate variable"),{additional:{name:t.name}}));Pt(t)}}));const Mt=y.palette;Mt&&Mt[N].forEach((t=>{if(et.has(t.name))dt(st(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=Hr(t.name,"color",t.color);et.set(t.name,e),rt.set(t.name,e)}catch(e){dt(st(e,{additional:{name:t.name}}))}}));for(const[t,e]of tt)rt.has(t)||rt.set(t,e);X.subscribe((t=>{if(t&&!rt.has(t)){const e=tt.get(t);rt.set(t,e);const r=it.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const Tt=null===(f=null==y?void 0:y.card)||void 0===f?void 0:f.timers;if(Tt&&"undefined"!=typeof document){const t=ot=new Io({logError:dt,applyVars:t=>ut(dt,t),hasVariableWithType:function(t,e){const r=rt.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=rt.get(t);r?r.setValue(e):dt(st(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:wt});Tt.forEach((e=>t.createTimer(e)))}const Nt=function t(e){const r={json:{},path:[],templateContext:{},logError(t){t.additional=t.additional||{},t.additional.path=r.path.join("/"),dt(t)},execAnyActions:(t,e={})=>wt(t,{componentContext:r,processUrls:e.processUrls}),getDerivedFromVars:(t,e,n=!1)=>function(t,e,r,n=!1){if(!e)return An(e);const i=Bo(rt,r),o=Eo(e,t);return o.vars.length?K(o.vars.map((t=>i.get(t)||function(t){const e=it.get(t)||Q(void 0);return it.has(t)||it.set(t,e),e}(t))).filter(mt),(()=>o.applyVars(i,n))):o.hasExpression?An(o.applyVars(i)):An(e)}(r.logError,t,Bo(r.variables,e),n),getJsonWithVars:(t,e,n=!1)=>ut(r.logError,t,Bo(r.variables,e),n),produceChildContext(e,n={}){const i=t(r);let o=e,a=r.templateContext;const{templateContext:s,json:l}=vt(o,a);return i.json=l,i.templateContext=s,i.origJson=e,void 0!==n.path&&i.path.push(String(n.path)),e.type&&!n.isRootState&&i.path.push(e.type),i.variables=Bo(r.variables,n.variables),n.tooltips&&(i.tooltips=n.tooltips),n.fake&&(i.fakeElement=!0),n.isRootState&&(i.isRootState=!0),i},getVariable(t,e){const n=(r.variables||rt).get(t);if(n){const i=n.getType();if(i!==e)return void r.logError(st(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:i}}))}return n}};return e?(r.path=e.path.slice(),e.fakeElement&&(r.fakeElement=!0)):(r.json={type:"root"},r.isRootState=!0),r}();let zt;v((()=>{No--,No||(window.removeEventListener("keydown",zo),window.removeEventListener("pointerdown",Ro)),ot&&ot.destroy(),ct.forEach((t=>{t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=null)}))})),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!==j&&r.onError(j),void 0===e.onStat&&r.onStat&&void 0!==A&&r.onStat(A),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!==M&&r.direction(M),void 0===e.setTheme&&r.setTheme&&void 0!==U&&r.setTheme(U),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==L&&r.getDebugVariables(L),void 0===e.getDebugAllVariables&&r.getDebugAllVariables&&void 0!==H&&r.getDebugAllVariables(H),void 0===e.setData&&r.setData&&void 0!==q&&r.setData(q),void 0===e.execAction&&r.execAction&&void 0!==bt&&r.execAction(bt),"light"===_||"dark"===_?N=_:"system"===_?"undefined"!=typeof matchMedia?(z||(z=matchMedia("(prefers-color-scheme: dark)"),z.addListener((function(){"system"===_&&z&&(N=z.matches?"dark":"light")}))),N=z.matches?"dark":"light"):N="light":dt(st(new Error("Unsupported theme"))),N&&Mt&&Mt[N].forEach((t=>{const e=rt.get(t.name);e&&e.setValue(t.color)}));{G=!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 xn)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&&(G=!0,dt(t))}if(i=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!==It&&y.card.variables.forEach((t=>{t&&t.name&&!et.has(t.name)&&Pt(t)})),o=null===(h=null==y?void 0:y.card)||void 0===h?void 0:h.states,o&&!G&&!Z){const t={type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:o.map((t=>({state_id:t.state_id.toString(),div:t.div})))};zt=Nt.produceChildContext(t,{tooltips:ct,isRootState:!0})}return s(),u(),G||Z||!zt?"":`<div class="${I("divkit-b023c",!0)+I(a?` ${nt}`:"",!0)+I(x?` ${x}`:"",!0)}"${W("dir",c,0)}>${R(En,"RootSvgFilters").$$render(t,{svgFiltersMap:ht},{},{})} ${R(kn,"Unknown").$$render(t,{componentContext:zt},{},{})}</div>`})),Lo=Uo;function Wo(t){return Lo.render(t).html}var Ho=exports;for(var qo in e)Ho[qo]=e[qo];e.__esModule&&Object.defineProperty(Ho,"__esModule",{value:!0})})();
2
2
  //# sourceMappingURL=server.js.map