@divkitframework/divkit 21.0.0 → 21.1.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={};function r(){}function n(t){return t()}function i(t){t.forEach(n)}function o(t){return"function"==typeof t}function a(t,...e){if(null==t)return r;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}let s;function l(t){s=t}function c(){if(!s)throw new Error("Function called outside component initialization");return s}function u(t){c().$$.on_destroy.push(t)}function d(t,e){return c().$$.context.set(t,e),e}function v(t){return c().$$.context.get(t)}t.r(e),t.d(e,{createGlobalVariablesController:()=>_n,createVariable:()=>er,render:()=>Cn}),new Set,new Map;const p=[],g=[],h=[],f=[],m=Promise.resolve();let y=!1;function b(){return y||(y=!0,m.then(x)),m}function _(t){h.push(t)}const w=new Set;let $=0;function x(){const t=s;do{for(;$<p.length;){const t=p[$];$++,l(t),k(t.$$)}for(l(null),p.length=0,$=0;g.length;)g.pop()();for(let t=0;t<h.length;t+=1){const e=h[t];w.has(e)||(w.add(e),e())}h.length=0}while(p.length);for(;f.length;)f.pop()();y=!1,w.clear(),l(t)}function k(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(_)}}new Set,"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;const E=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),C=/[\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 F(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=N(n):r.style=N(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(C.test(t))return;const e=r[t];!0===e?n+=" "+t:E.has(t.toLowerCase())?e&&(n+=" "+t):null!=e&&(n+=` ${t}="${e}"`)})),n}const A=/[&"]/g,V=/[&<]/g;function j(t,e=!1){const r=String(t),n=e?A:V;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 P(t){return"string"==typeof t||t&&"object"==typeof t?j(t,!0):t}function S(t){const e={};for(const r in t)e[r]=P(t[r]);return e}function D(t,e){let r="";for(let n=0;n<t.length;n+=1)r+=e(t[n],n);return r}const z={$$render:()=>""};function M(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`);return t}let T,O;function I(t){function e(e,r,n,i,o){const a=s;l({$$:{on_destroy:T,context:new Map(o||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const c=t(e,r,n,i);return l(a),c}return{render:(t={},{$$slots:r={},context:n=new Map}={})=>{T=[];const o={title:"",head:"",css:new Set},a=e(o,t,{},r,n);return i(T),{html:a,css:{code:Array.from(o.css).map((t=>t.code)).join("\n"),map:null},head:o.title+o.head}},$$render:e}}function J(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${j(e,!0)}"`}`}function N(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${t[e]};`)).join(" ")}function B(t){const e=N(t);return e?` style="${e}"`:""}"function"==typeof HTMLElement&&(O=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(o);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,r){this[t]=r}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){(function(t,e){const r=t.$$;null!==r.fragment&&(i(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])})(this,1),this.$destroy=r}$on(t,e){const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(e),()=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});const R=[];function U(t,e=r){let n;const i=new Set;function o(e){if(o=e,((r=t)!=r?o==o:r!==o||r&&"object"==typeof r||"function"==typeof r)&&(t=e,n)){const e=!R.length;for(const e of i)e[1](),R.push(e,t);if(e){for(let t=0;t<R.length;t+=2)R[t][0](R[t+1]);R.length=0}}var r,o}return{set:o,update:function(e){o(e(t))},subscribe:function(a,s=r){const l=[a,s];return i.add(l),1===i.size&&(n=e(o)||r),a(t),()=>{i.delete(l),0===i.size&&(n(),n=null)}}}}function W(t,e,n){const s=!Array.isArray(t),l=s?[t]:t,c=e.length<2;return u=t=>{let n=!1;const u=[];let d=0,v=r;const p=()=>{if(d)return;v();const n=e(s?u[0]:u,t);c?t(n):v=o(n)?n:r},g=l.map(((t,e)=>a(t,(t=>{u[e]=t,d&=~(1<<e),n&&p()}),(()=>{d|=1<<e}))));return n=!0,p(),function(){i(g),v()}},{subscribe:U(n,u).subscribe};var u}const L="divkit-bd259",q="divkit-d9099",H="divkit-c016b",G="divkit-aa145",Z="divkit-f0cba",Y=Symbol("root");function X(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const K={text:"divkit-d9b0e",text_halign_left:"divkit-a4cb7",text_halign_center:"divkit-e1659",text_halign_right:"divkit-ea280",text_valign_top:"divkit-d8ce0",text_valign_center:"divkit-ef58e",text_valign_bottom:"divkit-fe8ed",text_valign_baseline:"divkit-e0c6c",text__inner:"divkit-b8528",text_singleline:"divkit-ef11c",text_truncate_none:"divkit-c6ea1",text_multiline:"divkit-ee8e3",text__inner_gradient:"divkit-cb8e0",text__image:"divkit-bf6e2",text__image_hidden:"divkit-f1002"},Q={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_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"};function tt(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 et(t){if("number"!=typeof t&&"string"!=typeof t||!t)return"0";const e=Number(t);return isNaN(e)?"0":Math.ceil(1e3*e)/1e4+"em"}function rt(t){let e=et(t);return"0"===e&&(e+="em"),e}function nt(t,e){for(;t.length<e;)t="0"+t;return t}function it(t,e=1,r="transparent"){if("#"!==(t=(t||"").toLowerCase()).charAt(0))return r;const n=ot(t);return n?(n.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>nt(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(n)):r}function ot(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 at(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 st=Boolean;function lt(t){if(1===t.length&&"solid"===t[0].type)return{color:it(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=it(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(st);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>it(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:dt(t.bg.scale),pos:vt(t.bg),image:'url("'+at(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(st);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=rt(n.value):"relative"===n.type&&(i=ct[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${i||"farthest-corner"} at ${ut(t.bg.center_x)} ${ut(t.bg.center_y)},`+r.map((t=>it(t))).join(",")+")"}}({bg:t}):void 0)).filter(st).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 ct={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function ut(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return rt(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function dt(t){return"fill"!==t&&t?"fit"===t?"contain":void 0:"cover"}function vt(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 pt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}function gt(t,e){return e.has(t)}function ht(t,e){e&&t.push(e)}function ft(t,e,r){const n=[];ht(n,e[t]);for(const i in r)if(r.hasOwnProperty(i)){const o=r[i];o&&ht(n,e[`${t}_${i}`+("string"==typeof o?`_${o}`:"")])}return n.join(" ")}const mt=Symbol("state");function yt(t){return et(t.top||0)+" "+et(t.right||0)+" "+et(t.bottom||0)+" "+et(t.left||0)}function bt(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function _t(t){return bt(t)&&t>=0}function wt(t,e){if(!t)return e;const r=[t.top,t.right,t.bottom,t.left];for(let t=0;t<r.length;++t)if(r[t]&&!_t(r[t]))return e;return yt(t)}function $t(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const xt=Object.prototype.hasOwnProperty;function kt(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(!xt.call(e,i)||!kt(t[i],e[i]))return!1}return!0}function Et(t,e){return kt(t,e)?e:t}function Ct(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function Ft(t,e){const r=Number(t);return isNaN(r)?e:r}function At(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...At(t))})):e.push(t),e}function Vt(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>et((t||e)/r*10))).join(" ")}function jt(){}const Pt=Symbol("action"),St=I(((t,e,r,n)=>{let{actions:i}=e,{doubleTapActions:o}=e,{longTapActions:a}=e,{cls:s=""}=e,{style:l=null}=e,{attrs:c}=e,{use:u=jt}=e,{customAction:p=null}=e,{isNativeActionAnimation:g=!0}=e;const h=v(Y),f=v(Pt);d(Pt,{hasAction:()=>Boolean(f.hasAction()||(null==i?void 0:i.length))});let m,y="";if(Array.isArray(i)&&(null==i?void 0:i.length))for(let t=0;t<i.length;++t){const e=i[t].url;if(e){y=e,m=i[t].target||void 0;break}}Array.isArray(i)&&(null==i?void 0:i.length)&&f.hasAction()&&(y="",h.logError(X(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:i}})));let b=Boolean(p);return y&&!gt(pt(y),h.getBuiltinProtocols())&&(y="",b=!0),void 0===e.actions&&r.actions&&void 0!==i&&r.actions(i),void 0===e.doubleTapActions&&r.doubleTapActions&&void 0!==o&&r.doubleTapActions(o),void 0===e.longTapActions&&r.longTapActions&&void 0!==a&&r.longTapActions(a),void 0===e.cls&&r.cls&&void 0!==s&&r.cls(s),void 0===e.style&&r.style&&void 0!==l&&r.style(l),void 0===e.attrs&&r.attrs&&void 0!==c&&r.attrs(c),void 0===e.use&&r.use&&void 0!==u&&r.use(u),void 0===e.customAction&&r.customAction&&void 0!==p&&r.customAction(p),void 0===e.isNativeActionAnimation&&r.isNativeActionAnimation&&void 0!==g&&r.isNativeActionAnimation(g),y?`<a${F([{href:P(y)},{target:P(m)},{style:P(l)},{class:j(s,!0)+" "+j(g?L:q,!0)+" "+j(null!=a&&a.length?Z:"",!0)},S(c)],{})}>${n.default?n.default({}):""}</a>`:`<span${F([{class:j(s,!0)+j(b?` ${g?L:q} divkit-c016b`:"",!0)+" "+j(null!=a&&a.length?Z:"",!0)},{style:P(l)},{role:P(b?"button":null)},{tabindex:P(b?0:null)},S(c)],{})}>${n.default?n.default({}):""}</span>`})),Dt=St,zt="divkit-b921d";function Mt(t){return bt(t)&&t>0}function Tt(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(Mt(t.radius))return`blur(${rt(t.radius/2)})`}else e(X(new Error("Unknown filter"),{level:"warn",additional:{filter:null==t?void 0:t.type}}))})).filter(Boolean).join(" ")}const Ot=I(((t,e,r,n)=>{let i,{background:o=[]}=e,{radius:a=""}=e;const s=v(Y);return void 0===e.background&&r.background&&void 0!==o&&r.background(o),void 0===e.radius&&r.radius&&void 0!==a&&r.radius(a),i=o.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=lt([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=Tt(t.filters,s.logError)))}return r})),`<span${J("class","divkit-bf253"+(a?" divkit-dcad7":""),0)}${B({"border-radius":a})}>${D(i,(t=>t.image_url?`<img${J("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${J("class",zt,0)}${J("style",tt(t.style),0)}>`:`<span${J("class",zt,0)}${J("style",tt(t.style),0)}></span>`))}</span>`})),It=Ot,Jt=I(((t,e,n,i)=>{let o,s,l,c,u,d,p,g,h,f,m,y,_,w,$,x,k,E,C,F,A,V,j,P,S,D,z,T,O,I,N,B,R,U,W,L,q,H,G,Z,K,nt=r,ot=r,at=r,st=r,ct=r,ut=r,dt=r,vt=r,ht=r,bt=r,xt=r,kt=r,jt=r,Pt=r,St=r,zt=r,Mt=r;var Tt,Ot,Jt,Nt,Bt,Rt;let{json:Ut={}}=e,{origJson:Wt}=e,{templateContext:Lt}=e,{cls:qt=""}=e,{style:Ht}=e,{layoutParams:Gt={}}=e,{customDescription:Zt=!1}=e,{customPaddings:Yt=!1}=e,{customActions:Xt=""}=e,{forceWidth:Kt=!1}=e,{forceHeight:Qt=!1}=e,{additionalPaddings:te=null}=e;const ee={left:"start",center:"center",right:"end"},re={top:"start",center:"center",bottom:"end",baseline:"baseline"},ne=v(Y),ie=v(mt);let oe,ae,se,le,ce,ue,de,ve={},pe={},ge=!1,he=1,fe="transparent",me=0,ye={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},be="",_e=null,we="",$e={},xe=0,ke=0,Ee=0,Ce=!1,Fe=!1,Ae={},Ve=0,je=0,Pe=0,Se=!1,De=!1,ze=1;const Me=Gt.fakeElement?[]:Ut.transition_triggers||["state_change","visibility_change"],Te=-1!==Me.indexOf("state_change")&&Ut.id,Oe=-1!==Me.indexOf("visibility_change")&&Ut.id;let Ie,Je,Ne,Be,Re,Ue,We,Le,qe,He=[],Ge=[],Ze=[],Ye=[],Xe="",Ke=!1,Qe="visible",tr=0,er=0;void 0===e.json&&n.json&&void 0!==Ut&&n.json(Ut),void 0===e.origJson&&n.origJson&&void 0!==Wt&&n.origJson(Wt),void 0===e.templateContext&&n.templateContext&&void 0!==Lt&&n.templateContext(Lt),void 0===e.cls&&n.cls&&void 0!==qt&&n.cls(qt),void 0===e.style&&n.style&&void 0!==Ht&&n.style(Ht),void 0===e.layoutParams&&n.layoutParams&&void 0!==Gt&&n.layoutParams(Gt),void 0===e.customDescription&&n.customDescription&&void 0!==Zt&&n.customDescription(Zt),void 0===e.customPaddings&&n.customPaddings&&void 0!==Yt&&n.customPaddings(Yt),void 0===e.customActions&&n.customActions&&void 0!==Xt&&n.customActions(Xt),void 0===e.forceWidth&&n.forceWidth&&void 0!==Kt&&n.forceWidth(Kt),void 0===e.forceHeight&&n.forceHeight&&void 0!==Qt&&n.forceHeight(Qt),void 0===e.additionalPaddings&&n.additionalPaddings&&void 0!==te&&n.additionalPaddings(te),o=ne.getDerivedFromVars(Ut.border),Mt(),Mt=a(o,(t=>K=t));{let t={},e={},r=!1,n="";if(K){if(K.has_shadow){const e=K.shadow;t["box-shadow"]=e?et((null===(Ot=null===(Tt=e.offset)||void 0===Tt?void 0:Tt.x)||void 0===Ot?void 0:Ot.value)||0)+" "+et((null===(Nt=null===(Jt=e.offset)||void 0===Jt?void 0:Jt.y)||void 0===Nt?void 0:Nt.value)||0)+" "+et(null!==(Bt=e.blur)&&void 0!==Bt?Bt:2)+" "+it(e.color||"#000000",null!==(Rt=e.alpha)&&void 0!==Rt?Rt:.19):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}if(K.stroke&&(r=!0,he=$t(K.stroke.width,he),fe=it(K.stroke.color,1,fe),e.border=`${et(he)} solid ${fe}`),K.corners_radius?(ye=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]&&!_t(r[t]))return e;return t}(K.corners_radius,ye),e["border-radius"]=t["border-radius"]=Vt(ye)):K.corner_radius&&(me=$t(K.corner_radius,me),ye={"top-left":me,"top-right":me,"bottom-right":me,"bottom-left":me},e["border-radius"]=t["border-radius"]=et(me)),r&&he&&(K.corners_radius||K.corner_radius)){let t=Object.assign({},ye);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+he/2})),n=Vt(t)}}ve=Et(t,ve),pe=Et(e,pe),ge=r,be=n}s=ne.getDerivedFromVars(Ut.paddings),zt(),zt=a(s,(t=>Z=t)),_e=function(t,e){if(!t)return e;const r=["top","right","bottom","left"];for(let n=0;n<r.length;++n)if(t[r[n]]&&!_t(t[r[n]]))return e;return t}(Z&&!Yt?Z:void 0,_e),l=yt(function(t,e){if(!t&&!e)return{};if(!e)return t;if(!t)return e;const r={};return["top","right","bottom","left"].forEach((n=>{const i=t[n];i&&(r[n]=i);const o=e[n];o&&(r[n]=(r[n]||0)+o)})),r}(_e,te)),c=ne.getDerivedFromVars(Ut.margins),Pt(),Pt=a(c,(t=>H=t)),we=wt(H,we),u=ne.getDerivedFromVars(Ut.width),kt(),kt=a(u,(t=>L=t)),d=ne.getDerivedFromVars(Ut.alignment_horizontal),St(),St=a(d,(t=>G=t));{let t,e,r={},n=0,i=0,o=!1,a=!1;const s=null==L?void 0:L.type;if("fixed"===s?(xe=$t(null==L?void 0:L.value,xe),e=et(xe)):"wrap_content"===s||!Gt.overlapParent&&"match_parent"===s&&Gt.parentHorizontalWrapContent?(t="content",("wrap_content"===s&&(null==L?void 0:L.constrained)||"match_parent"===s&&Gt.parentHorizontalWrapContent)&&(r["width-constrained"]=!0,i=1),"match_parent"===s&&ne.logError(X(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))):(t="parent","vertical"===Gt.parentContainerOrientation&&Gt.parentContainerWrap&&(a=!0,ne.logError(X(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===Gt.parentLayoutOrientation?e=`calc(100% - ${rt(((null==H?void 0:H.left)||0)+((null==H?void 0:H.right)||0))})`:"horizontal"===Gt.parentContainerOrientation&&(n=L&&"weight"in L&&L.weight||1,Gt.parentContainerWrap&&(o=!0))),"content"===t&&Kt&&(t="parent",ne.logError(X(new Error("Incorrect usage of width with value 'wrap_content'"),{level:"warn"}))),"parent"===t)r["halign-self"]="stretch";else{const t=G;r["halign-self"]="left"===t||"center"===t||"right"===t?ee[t]:Gt.parentHAlign||"start"}t&&(r.width=t),se=e,ke=n,Ee=i,$e=Et(r,$e),Ce=o,Fe=a}p=ne.getDerivedFromVars(Ut.height),xt(),xt=a(p,(t=>W=t)),g=ne.getDerivedFromVars(Ut.alignment_vertical),jt(),jt=a(g,(t=>q=t));{let t,e,r={},n=0,i=0,o=!1,a=!1;const s=null==W?void 0:W.type;if("fixed"===s?(Ve=$t(null==W?void 0:W.value,Ve),e=et(Ve)):"match_parent"!==s||!Gt.overlapParent&&Gt.parentVerticalWrapContent?(t="content",("wrap_content"===s&&(null==W?void 0:W.constrained)||"match_parent"===s&&Gt.parentVerticalWrapContent)&&(r["height-constrained"]=!0,i=1),"match_parent"===s&&ne.logError(X(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))):(t="parent","horizontal"===Gt.parentContainerOrientation&&Gt.parentContainerWrap&&(a=!0,ne.logError(X(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===Gt.parentLayoutOrientation?e=`calc(100% - ${rt(((null==H?void 0:H.top)||0)+((null==H?void 0:H.bottom)||0))})`:"vertical"===Gt.parentContainerOrientation&&(n=(null==W?void 0:W.weight)||1,Gt.parentContainerWrap&&(o=!0))),"content"===t&&Qt&&(t="parent",ne.logError(X(new Error("Incorrect usage of height with value 'wrap_content'"),{level:"warn"}))),"parent"===t)r["valign-self"]="stretch";else{const t=q;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===Gt.parentContainerOrientation?r["valign-self"]=re[t]:r["valign-self"]=Gt.parentVAlign||"start"}t&&(r.height=t),le=e,je=n,Pe=i,Ae=Et(r,Ae),Se=o,De=a}var rr,nr,ir;if(h=!!Gt.overlapParent||void 0,f=Gt.overlapParent&&(!L||"match_parent"===L.type)&&"match_parent"===(null==W?void 0:W.type),m=Gt.gridArea?`${Gt.gridArea.y+1}/${Gt.gridArea.x+1}/span ${Gt.gridArea.rowSpan}/span ${Gt.gridArea.colSpan}`:void 0,y=ne.getDerivedFromVars(Ut.alpha),bt(),bt=a(y,(t=>U=t)),nr=ze,ze=!_t(rr=U)||void 0===rr||rr>1?nr:Number(rr),ce=1===ze?void 0:ze,_=ne.getDerivedFromVars(Ut.accessibility),ht(),ht=a(_,(t=>R=t)),ae=void 0,R&&!Zt&&R.description&&(ae={},ae["aria-label"]=R.description),w=ne.getDerivedFromVars(Ut.background),vt(),vt=a(w,(t=>B=t)),ue={},de=!1,B&&(de=B.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(be),!de)){const t=lt(B);ue["background-color"]=t.color,ue["background-image"]=t.image,ue["background-size"]=t.size,ue["background-position"]=t.position,ue["background-repeat"]="no-repeat"}Ie=void 0,Te&&Ut.transition_in&&ne.isRunning("stateChange")&&(Ie=!0),Ne=void 0,Te&&Ut.transition_change&&ne.isRunning("stateChange")&&ie.hasTransitionChange(Ut.id)&&(Ne=!0),$=ne.getDerivedFromVars(Ut.action),ut(),ut=a($,(t=>I=t)),x=ne.getDerivedFromVars(Ut.actions),dt(),dt=a(x,(t=>N=t)),k=ne.getDerivedFromVars(Ut.doubletap_actions),ct(),ct=a(k,(t=>O=t)),E=ne.getDerivedFromVars(Ut.longtap_actions),st(),st=a(E,(t=>T=t));{let t=N||I&&[I]||[],e=O||[],r=T||[];Gt.fakeElement?(t=[],e=[],r=[]):(Array.isArray(t)||(t=[],ne.logError(X(new Error("Actions should be array")))),Array.isArray(e)||(e=[],ne.logError(X(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],ne.logError(X(new Error("LongTapActions should be array"))))),(t.length||e.length||r.length)&&Xt&&(t=[],e=[],r=[],ne.logError(X(new Error(`Cannot use action on component "${Xt}"`)))),He=t,Ge=e,Ze=r}C=ne.getDerivedFromVars(Ut.action_animation),at(),at=a(C,(t=>z=t)),z&&(Ye=At(z),Xe=Ye.map((function(t){const e=Ft(t.start_value,1),r=Ft(t.end_value,1),n=$t(t.start_delay,0),i=$t(t.duration,300),o=Ct(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return Be=e,Re=r,`opacity ${i}ms ${o} ${n}ms`;case"scale":return Ue=e,We=r,`transform ${i}ms ${o} ${n}ms`;case"native":case"no_animation":return"";default:return ne.logError(X(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", ")),F=ne.getDerivedFromVars(Ut.visibility),ot(),ot=a(F,(t=>D=t));{const t=Qe,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(D,Qe);t!==e&&(!Ke||"visible"!==Qe&&"visible"!==e?Qe=e:async function(t){Qe=t;const e="visible"===t?"in":"out",r="in"===e?Ut.transition_in:Ut.transition_out;Oe&&r&&(await b(),"in"===e&&(Je=!0),ie.runVisibilityTransition(Object.assign(Object.assign({},Ut),{visibility:"visible"}),Lt,r,oe,e).then((()=>{"in"===e&&(Je=!1)})).catch((t=>{throw"in"===e&&(Je=!1),t})))}(e)),Ke||(Ke=!0)}if(A=Object.assign(Object.assign(Object.assign({},$e),Ae),{"parent-overlap":h,"parent-overlap-absolute":f,"scroll-snap":Gt.scrollSnap,"hide-on-transition-in":Ie||Je||Ne,visibility:Qe,"has-action-animation":Boolean(Xe),"parent-flex":Gt.parentContainerOrientation||void 0}),V=ne.getDerivedFromVars(Ut.transform),nt(),nt=a(V,(t=>S=t)),S&&void 0!==S.rotation){const t=S.pivot_x||{type:"pivot-percentage",value:50};tr=Ft(t.value,tr);const e="pivot-fixed"===t.type?et(tr):`${tr}%`,r=S.pivot_y||{type:"pivot-percentage",value:50};er=Ft(r.value,er),Le=`${e} ${"pivot-fixed"===r.type?et(er):`${er}%`}`,qe=`rotate(${S.rotation}deg)`}return j=Ce||Se?"100%":ke||je?0:void 0,P=Object.assign(Object.assign(Object.assign(Object.assign({},Ht),ue),ve),{width:se,height:le,"grid-area":m,padding:l,margin:we,opacity:ce,transition:Xe,"transform-origin":Le,transform:qe,"flex-grow":ke||je||void 0,"flex-shrink":Ee||Pe?1:void 0,"flex-basis":j,"--divkit-animation-opacity-start":Be,"--divkit-animation-opacity-end":Re,"--divkit-animation-scale-start":Ue,"--divkit-animation-scale-end":We}),nt(),ot(),at(),st(),ct(),ut(),dt(),vt(),ht(),bt(),xt(),kt(),jt(),Pt(),St(),zt(),Mt(),Fe||De?"":`${M(Dt,"Actionable").$$render(t,{use:function(t){oe=t,Te&&Ut.transition_in&&ie.registerChildWithTransitionIn(Ut,Lt,Ut.transition_in,t).then((()=>{Ie=!1})).catch((t=>{throw Ie=!1,t})),Te&&Ut.transition_out&&ie.registerChildWithTransitionOut(Ut,Lt,Ut.transition_out,t),Te&&Ut.transition_change&&ie.registerChildWithTransitionChange(Ut,Lt,Ut.transition_change,t).then((()=>{Ne=!1})).catch((t=>{throw Ne=!1,t})),function(t,{visibilityActions:e,rootCtx:r}){if(null==e||!e.length)return;const n=e.map((t=>({action:t,visible:!1,count:0,finished:!1}))),i=[...new Set([...e.map((t=>(t.visibility_percentage||50)/100))])];new IntersectionObserver((t=>{t.forEach((t=>{n.forEach((e=>{const n=t.intersectionRatio>=(e.action.visibility_percentage||50)/100;!e.visible&&n?e.finished||(e.timer=setTimeout((()=>{++e.count;const t=0===e.action.log_limit?1/0:e.action.log_limit||1;++e.count>=t&&(e.finished=!0);const n=e.action.url;if(n){const t=pt(n);t&&!gt(t,r.getBuiltinProtocols())&&("div-action"===t?r.execAction(e.action):e.action.log_id&&r.execCustomAction(e.action))}r.logStat("visible",e.action)}),e.action.visibility_duration||800)):n||e.timer&&clearTimeout(e.timer),e.visible=n}))}))}),{threshold:i}).observe(t)}(t,{visibilityActions:Gt.fakeElement?[]:ne.getJsonWithVars(Ut.visibility_actions||Ut.visibility_action&&[Ut.visibility_action]),rootCtx:ne});const e=Ut.id;e&&ie.registerChild(e);let r=null;return{destroy(){e&&ie.unregisterChild(e),r&&r.destroy()}}},cls:qt+" "+ft("outer",Q,A),style:tt(P),actions:He,doubleTapActions:Ge,longTapActions:Ze,attrs:ae,isNativeActionAnimation:!Ye.length||(ir=Ye,ir.some((t=>"native"===t.name)))},{},{default:()=>`${de?`${M(It,"OuterBackground").$$render(t,{background:B,radius:be},{},{})}`:""}${i.default?i.default({}):""}${ge?`<span${J("class",Q.outer__border,0)}${J("style",tt(pe),0)}></span>`:""}`})}`})),Nt=Jt,Bt={"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 Rt(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function Ut(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function Wt(t,e){return Ut(t)||e}const Lt=I(((t,e,r,n)=>{let i,o,a,s,l;var c,u;let d,{text:v}=e,{rootFontSize:p}=e,{textStyles:g={}}=e,{singleline:h=!1}=e,{actions:f}=e,m="none",y=12,b=1.25,_="",w="",$=null;void 0===e.text&&r.text&&void 0!==v&&r.text(v),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==p&&r.rootFontSize(p),void 0===e.textStyles&&r.textStyles&&void 0!==g&&r.textStyles(g),void 0===e.singleline&&r.singleline&&void 0!==h&&r.singleline(h),void 0===e.actions&&r.actions&&void 0!==f&&r.actions(f);{let t="none";(g.underline||g.strike)&&("single"===g.underline&&"single"===g.strike?t="both":"single"===g.underline?t="underline":"single"===g.strike&&(t="strike")),m=t}return y=Rt(g.font_size,y),Mt(g.line_height)&&(b=Number(g.line_height)/y),_t(g.letter_spacing)&&(_=et(g.letter_spacing)),d=Wt(g.font_weight,d),w=it(g.text_color,1,w),i=g.top_offset?et(g.top_offset):"",o=g.background?lt([g.background]):null,$=(null===(c=g.border)||void 0===c?void 0:c.stroke)&&"transparent"!==it(g.border.stroke.color)&&Mt(g.border.stroke.width)?{color:g.border.stroke.color,width:g.border.stroke.width}:null,a=Rt(null===(u=g.border)||void 0===u?void 0:u.corner_radius,0),s={singleline:h,decoration:m},l={"font-size":et(10*y/p),"line-height":b,"letter-spacing":_,"font-weight":d,color:w,background:(null==o?void 0:o.color)||void 0,"box-shadow":$?`inset 0 0 0 ${et($.width)} ${$.color}`:void 0,"border-radius":a?et(a):void 0},`${i?`<span${J("class",Bt["text-range__top-offset"],0)}${B({"margin-top":i})}></span>`:""}${M(Dt,"Actionable").$$render(t,{cls:ft("text-range",Bt,s),actions:f,style:tt(l)},{},{default:()=>`${j(v)}`})}`})),qt=Lt;function Ht(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Gt(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function Zt(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const Yt=I(((t,e,n,i)=>{let o,s,l,c,d,p,g,h,f,m,y,b,_,w,$,x,k,E,C,F,A,V,j,P,S,z,T,O,I,N,B,R,U,W=r,L=r,q=r,G=r,Z=r,Q=r,rt=r,nt=r,ot=r,at=r,st=r,ct=r,ut=r,{json:dt={}}=e,{templateContext:vt}=e,{origJson:pt}=e,{layoutParams:gt}=e;const ht=v(Y);let mt=!1,yt="",bt=12,_t=1.25,wt=!1,$t="",xt="",kt=!1,Et="left",Ct="top",Ft="",At="",Vt=!1,jt=[],Pt=[];var St,Dt;u((()=>{Pt.forEach((([t,e])=>{ht.removeSvgFilter(t,e)}))})),void 0===e.json&&n.json&&void 0!==dt&&n.json(dt),void 0===e.templateContext&&n.templateContext&&void 0!==vt&&n.templateContext(vt),void 0===e.origJson&&n.origJson&&void 0!==pt&&n.origJson(pt),void 0===e.layoutParams&&n.layoutParams&&void 0!==gt&&n.layoutParams(gt),o=ht.getDerivedFromVars(dt.text),ut(),ut=a(o,(t=>U=t)),St=U,Dt=yt,yt=String(null!=St?St:"")||Dt,yt?mt=!1:(mt=!0,ht.logError(X(new Error('Missing "text" prop for div "text"')))),s=ht.getDerivedFromVars(dt.ranges),L(),L=a(s,(t=>V=t)),l=ht.getDerivedFromVars(dt.images),W(),W=a(l,(t=>A=t)),c=ht.getDerivedFromVars({font_size:dt.font_size,letter_spacing:dt.letter_spacing,font_weight:dt.font_weight,text_color:dt.text_color,underline:dt.underline,strike:dt.strike,line_height:dt.line_height}),q(),q=a(c,(t=>j=t)),d=ht.getDerivedFromVars(dt.font_size),ct(),ct=a(d,(t=>R=t)),bt=Rt(R,bt),p=ht.getDerivedFromVars(dt.line_height),st(),st=a(p,(t=>B=t));{const t=B;Mt(t)?(_t=Number(t)/bt,wt=!0):wt=!1}g=ht.getDerivedFromVars(dt.max_lines),nt(),nt=a(g,(t=>O=t)),h=1===O;{let t="",e="",r=!1;if(O&&O>1){let n=Number(O);t=n*_t+"em",V||A||(e=n,r=!0)}$t=t,xt=e,kt=r}f=ht.getDerivedFromVars(dt.text_alignment_horizontal),at(),at=a(f,(t=>N=t)),Et=Ht(N,Et),m=ht.getDerivedFromVars(dt.text_alignment_vertical),ot(),ot=a(m,(t=>I=t)),Ct=Gt(I,Ct),y=!V||yt&&1===V.length&&V[0]&&0===V[0].start&&"number"==typeof V[0].end&&V[0].end>=yt.length,b=ht.getDerivedFromVars(dt.text_color),rt(),rt=a(b,(t=>T=t)),_=Boolean(T)!==Boolean(V&&V[0]&&V[0].text_color);{let t="";O&&y&&_&&(t=it(T||V&&V[0]&&V[0].text_color,1,Ft)),Ft=t}w=ht.getDerivedFromVars(dt.truncate),Q(),Q=a(w,(t=>z=t)),$="none"===z?"none":"",x=ht.getDerivedFromVars(dt.text_gradient),Z(),Z=a(x,(t=>S=t));{let t="";if(S){const e=lt([S]);e.image&&(t=e.image)}At=t}return k=ht.getDerivedFromVars(dt.selectable),G(),G=a(k,(t=>P=t)),Vt=function(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}(P,Vt),function(t,e,r){let n=[];if(Pt.forEach((([t,e])=>{ht.removeSvgFilter(t,e)})),Pt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(jt=[]);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;let r="image"===t.type?null:t.range,o=t.index;if(o>s){let r=Object.assign(Object.assign({},j),...l);n.push({text:i.substring(s,o),textStyles:r,actions:"rangeEnd"===t.type&&(null===(e=t.range)||void 0===e?void 0:e.actions)||void 0})}if("rangeStart"===t.type&&r)l.push(r);else if("rangeEnd"===t.type)l=l.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},j),...l),r=et(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),i=et(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":et(10*(Number(e.font_size)||12)/bt)};let a="";const s=t.image.tint_color,c=Zt(t.image.tint_mode,"source_in");if(s){const e=it(t.image.tint_color);a=ht.addSvgFilter(e,c),Pt.push([e,c])}n.push({image:{url:t.image.url,width:r,height:i,wrapperStyle:o,svgFilterId:a}})}s=o})),s<i.length&&n.push({text:i.substring(s),textStyles:Object.assign({},j)}),jt=n}(yt,V,A),E={singleline:h,multiline:kt,halign:Et,valign:Ct,truncate:$},C={gradient:Boolean(At)},F={"font-size":et(bt),"line-height":_t,"max-height":$t,"-webkit-line-clamp":xt,color:Ft,"background-image":At},W(),L(),q(),G(),Z(),Q(),rt(),nt(),ot(),at(),st(),ct(),ut(),mt?"":`${M(Nt,"Outer").$$render(t,{cls:ft("text",K,E)+" "+(Vt?"":H),json:dt,origJson:pt,templateContext:vt,layoutParams:gt},{},{default:()=>`<span${J("class",ft("text__inner",K,C),0)}${J("style",tt(F),0)}>${jt.length?`${D(jt,((e,r)=>"text"in e?e.text?`${M(qt,"TextRangeView").$$render(t,{text:e.text,rootFontSize:bt,textStyles:e.textStyles,singleline:h,actions:e.actions},{},{})}`:"":e.image?`<span${J("style",tt(e.image.wrapperStyle),0)}><img${J("class",K.text__image,0)}${J("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${J("style",tt({width:e.image.width,height:e.image.height,"margin-top":wt?`-${e.image.height}`:void 0,"margin-bottom":wt?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${M(qt,"TextRangeView").$$render(t,{text:yt,rootFontSize:bt,textStyles:j,singleline:h},{},{})}`}</span>`})}`})),Xt=Yt,Kt={container:"divkit-d37d6",container_wrap:"divkit-c8551",container_orientation_vertical:"divkit-ddc33",container_valign_top:"divkit-a331a",container_valign_center:"divkit-aae61",container_valign_bottom:"divkit-c2226",container_orientation_horizontal:"divkit-fe458",container_halign_left:"divkit-a3091",container_halign_center:"divkit-bac9d",container_halign_right:"divkit-f4230",container_orientation_overlap:"divkit-a644d"};function Qt(t,e,r){if(!(t&&t.shape&&t.color&&t.shape.type&&e.includes(t.shape.type)))return r;const n=it(t.color);let i,o,a;if("rounded_rectangle"===t.shape.type){var s,l,c,u;i=Number((null===(s=t.shape.item_width)||void 0===s?void 0:s.value)||10),o=Number((null===(l=t.shape.item_height)||void 0===l?void 0:l.value)||10),a=Number(null!==(c=null===(u=t.shape.corner_radius)||void 0===u?void 0:u.value)&&void 0!==c?c:5)}else{if("circle"!==t.shape.type)return r;var d;i=o=a=2*Number((null===(d=t.shape.radius)||void 0===d?void 0:d.value)||10)}if("shape_drawable"===t.type&&"transparent"!==n){var v,p,g;const e={},r=null!==(v=t.stroke)&&void 0!==v&&v.color?it(t.stroke.color):"",s=null!==(p=t.stroke)&&void 0!==p&&p.width?Number(null!==(g=t.stroke.width)&&void 0!==g?g:1):"";return e.width=i,e.height=o,e.borderRadius=a,e.background=n,r&&s&&(e.boxShadow=`inset 0 0 0 ${et(s)} ${r}`),e}return r}function te(t,e,r){null!=e&&e.show_at_start&&(r?t.top=e.style.height:t.left=e.style.width),null!=e&&e.show_at_end&&(r?t.bottom=e.style.height:t.right=e.style.width)}function ee(t,e,r){let n;return n="horizontal"===t?[null!=r&&r.show_between?r.style.height:0,null!=e&&e.show_between?e.style.width:0]:[null!=e&&e.show_between?e.style.height:0,null!=r&&r.show_between?r.style.width:0],n.map(et).join(" ")}const re="divkit-a7719",ne="divkit-f6e9a";function ie(t,e,r,n,i,o){o?t.push({top:r.bottom,left:i.left,width:i.right-i.left,height:n.top-r.bottom,style:e}):t.push({top:i.top,left:r.right,width:n.left-r.right,height:i.bottom-i.top,style:e})}function oe(t,e,r,n){const i={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)&&ie(t,e.style,{top:0,right:r[0].left-e.style.width,bottom:r[0].top-e.style.height,left:0},r[0],i,n),null==e?void 0:e.show_between)for(let o=0;o<r.length-1;++o)ie(t,e.style,r[o],r[o+1],i,n);if(null==e?void 0:e.show_at_end){const o=r[r.length-1];ie(t,e.style,o,{top:o.bottom+e.style.height,right:0,bottom:0,left:o.right+e.style.width},i,n)}}const ae=I(((t,e,r,n)=>{let i,{orientation:o}=e,{separator:a}=e,{lineSeparator:s}=e;const l=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();d=[];let e=[...i.children].filter((t=>t!==c&&!t.classList.contains(Q.outer__border))),r=[];for(;e.length;){const t=[],n=e.shift();t.push(n);let i=n.getBoundingClientRect(),a=i.right,s=i.bottom;for(;e.length;){let r=e[0],n=r.getBoundingClientRect();if("vertical"===o){if(n.top<s)break}else if(n.left<a)break;a=Math.max(a,n.right),s=Math.max(s,n.bottom),t.push(r),e.shift()}r.push(t)}const n=[];r.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)));a&&oe(d,a,e,"vertical"===o);const r={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)))};n.push(r)})),s&&oe(d,s,n,"horizontal"===o),d.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let c,d=[],v=!1,p=null,g=null;return u((()=>{v=!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),i=null,(v&&i||p||g)&&(p&&(p.disconnect(),p=null),g&&(g.disconnect(),g=null),v&&i&&("undefined"!=typeof MutationObserver&&(p=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(ne))&&!(null==r?void 0:r.contains(re))}))&&l()})),p.observe(i,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(g=new ResizeObserver(l),g.observe(i)))),v&&i&&l(),`\n\n<div${J("class",re,0)}${J("this",c,0)}>${D(d,(t=>`<div${J("class","divkit-c770e",0)}${B({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${J("class",ne,0)}${B({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>\n </div>`))}</div>`}));let se;function le(){if(void 0!==se)return se;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),se=1===t.scrollHeight,document.body.removeChild(t),se}const ce=I(((t,e,n,i)=>{let o,s,l,c,u,d,p,g,h,f,m,y,b,_,w,$,x,k,E,C,F,A,V=r,j=r,P=r,S=r,z=r,T=r,O=r,I=r;var J,N,B,R,U,W;let{json:L={}}=e,{templateContext:q}=e,{origJson:H}=e,{layoutParams:G}=e;const Z={left:"start",center:"center",right:"end"},K={top:"start",center:"center",bottom:"end",baseline:"baseline"},Q=["rounded_rectangle","circle"],tt=v(Y);let et=!1,rt="vertical",nt="top",it="left",ot=null,at=null,st={};if(void 0===e.json&&n.json&&void 0!==L&&n.json(L),void 0===e.templateContext&&n.templateContext&&void 0!==q&&n.templateContext(q),void 0===e.origJson&&n.origJson&&void 0!==H&&n.origJson(H),void 0===e.layoutParams&&n.layoutParams&&void 0!==G&&n.layoutParams(G),o=L.items,(null==o?void 0:o.length)&&Array.isArray(o)?et=!1:(et=!0,tt.logError(X(new Error('Incorrect or empty "items" prop for div "container"')))),s=(!et&&o||[]).map((t=>{let e=t,r=q;return({templateContext:r,json:e}=tt.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=tt.getDerivedFromVars(L.orientation),I(),I=a(l,(t=>A=t)),rt=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(A,rt),c=tt.getDerivedFromVars(L.content_alignment_vertical),O(),O=a(c,(t=>F=t)),nt=Gt(F,nt),u=tt.getDerivedFromVars(L.content_alignment_horizontal),T(),T=a(u,(t=>C=t)),it=Ht(C,it),d=tt.getDerivedFromVars(L.layout_mode),z(),z=a(d,(t=>E=t)),p="wrap"===E,g=tt.getDerivedFromVars(L.separator),S(),S=a(g,(t=>k=t)),(null==k?void 0:k.style)&&"overlap"!==rt&&le()){const t=Qt(k.style,Q,(null==ot?void 0:ot.style)||null);ot=t?{show_at_start:Boolean(null!==(J=k.show_at_start)&&void 0!==J&&J),show_at_end:Boolean(null!==(N=k.show_at_end)&&void 0!==N&&N),show_between:Boolean(null===(B=k.show_between)||void 0===B||B),style:t}:null}else ot=null;if(h=tt.getDerivedFromVars(L.line_separator),P(),P=a(h,(t=>x=t)),(null==x?void 0:x.style)&&"overlap"!==rt&&le()){const t=Qt(x.style,Q,(null==at?void 0:at.style)||null);at=t?{show_at_start:Boolean(null!==(R=x.show_at_start)&&void 0!==R&&R),show_at_end:Boolean(null!==(U=x.show_at_end)&&void 0!==U&&U),show_between:Boolean(null===(W=x.show_between)||void 0===W||W),style:t}:null}else at=null;f=ot||at?function(t,e,r){const n={};return te(n,e,"vertical"===t),te(n,r,"horizontal"===t),n}(rt,ot,at):null,m=tt.getDerivedFromVars(L.width),V(),V=a(m,(t=>w=t)),y=tt.getDerivedFromVars(L.height),j(),j=a(y,(t=>$=t));{let t={};(null==G?void 0:G.fakeElement)&&(t.fakeElement=!0),"overlap"===rt&&(t.overlapParent=!0),"horizontal"!==rt&&(t.parentHAlign=Z[it],(!$||"wrap_content"===$.type||"match_parent"===$.type&&(null==G?void 0:G.parentVerticalWrapContent))&&(t.parentVerticalWrapContent=!0)),"vertical"!==rt&&(t.parentVAlign=K[nt],("wrap_content"===(null==w?void 0:w.type)||"match_parent"===(null==w?void 0:w.type)&&(null==G?void 0:G.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0)),"horizontal"===rt&&(t.parentContainerOrientation="horizontal"),"vertical"===rt&&(t.parentContainerOrientation="vertical"),p&&(t.parentContainerWrap=!0),st=Et(t,st)}return b={orientation:rt,valign:nt,halign:it,wrap:p},_={gap:ot||at?ee(rt,ot,at):void 0},V(),j(),P(),S(),z(),T(),O(),I(),et?"":`${M(Nt,"Outer").$$render(t,{cls:ft("container",Kt,b),style:_,json:L,origJson:H,templateContext:q,layoutParams:G,additionalPaddings:f},{},{default:()=>`${D(s,(e=>`${M(sr,"Unknown").$$render(t,{layoutParams:st,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n\n ${ot||at?`${M(ae,"ContainerSeparators").$$render(t,{separator:ot,lineSeparator:at,orientation:rt},{},{})}`:""}`})}`})),ue=ce,de={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function ve(t,e){return"vertical"===t||"horizontal"===t?t:e}const pe=I(((t,e,n,i)=>{let o,s,l,c,u,d,p,g=r,{json:h={}}=e,{templateContext:f}=e,{origJson:m}=e,{layoutParams:y}=e;const b=v(Y);let _="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&n.json&&void 0!==h&&n.json(h),void 0===e.templateContext&&n.templateContext&&void 0!==f&&n.templateContext(f),void 0===e.origJson&&n.origJson&&void 0!==m&&n.origJson(m),void 0===e.layoutParams&&n.layoutParams&&void 0!==y&&n.layoutParams(y),o=b.getDerivedFromVars(h.delimiter_style),g(),g=a(o,(t=>p=t)),_=ve(null==p?void 0:p.orientation,_),s=!((null==p?void 0:p.color)&&("transparent"===p.color||9===p.color.length&&0===p.color.indexOf("#00"))),w=it(null==p?void 0:p.color,1,w),l="horizontal"===_?"100%":et(1),c="horizontal"===_?et(1):"100%",u={background:w,width:l,height:c},d={orientation:_},g(),`${M(Nt,"Outer").$$render(t,{cls:ft("separator",de,d),json:h,origJson:m,templateContext:f,layoutParams:y},{},{default:()=>s?`<span${J("class",de.separator__inner,0)}${J("style",tt(u),0)}></span>`:""})}`})),ge={image:"divkit-a448f","image_is-width-content":"divkit-fe14a","image_is-height-content":"divkit-f4d92",image__image:"divkit-ce046",image_error:"divkit-f10d9","image__aspect-wrapper":"divkit-dc808",image_aspect:"divkit-ae784",image_loaded:"divkit-cf4e0","divkit-image-appearance":"divkit-e555f","image_before-appearance":"divkit-ffe8a"},he=I(((t,e,n,i)=>{let o,s,l,c,d,p,g,h,f,m,y,b,_,w,$,x,k,E,C,F,A,V,j,P,S,D,z,T,O,I,N,R,U,W,L,q=r,H=r,G=r,Z=r,K=r,Q=r,et=r,rt=r,nt=r,ot=r,st=r,lt=r,ct=r,ut=r,{json:pt={}}=e,{templateContext:gt}=e,{origJson:ht}=e,{layoutParams:mt}=e;const yt=v(Y);let bt,_t=0,wt="rgba(0,0,0,0.08)",xt=!1,kt="",Et="none",Ft="50% 50%",At="0",Vt="source_in",jt="",Pt="",St=0,Dt=0,zt=0,Ot="",It="";u((()=>{yt.removeSvgFilter(bt,Vt)})),void 0===e.json&&n.json&&void 0!==pt&&n.json(pt),void 0===e.templateContext&&n.templateContext&&void 0!==gt&&n.templateContext(gt),void 0===e.origJson&&n.origJson&&void 0!==ht&&n.origJson(ht),void 0===e.layoutParams&&n.layoutParams&&void 0!==mt&&n.layoutParams(mt),o=yt.getDerivedFromVars(pt.image_url),ut(),ut=a(o,(t=>L=t)),s=yt.getDerivedFromVars(pt.gif_url),ct(),ct=a(s,(t=>W=t)),l=L||W,_t=0,l?xt=!1:(xt=!0,yt.logError(X(new Error('Missing "image_url" for "image"')))),c=yt.getDerivedFromVars(pt.width),lt(),lt=a(c,(t=>U=t)),d="wrap_content"===(null==U?void 0:U.type),p=yt.getDerivedFromVars(pt.height),st(),st=a(p,(t=>R=t)),g="wrap_content"===(null==R?void 0:R.type),h=yt.getDerivedFromVars(pt.preview),ot(),ot=a(h,(t=>N=t));{const t=N;kt=t?t.startsWith("data:")?`url("${at(t)}")`:`url("data:image/jpg;base64,${at(t)}")`:""}f=yt.getDerivedFromVars(pt.placeholder_color),nt(),nt=a(f,(t=>I=t)),wt=it(I,1,wt),m=yt.getDerivedFromVars(pt.scale),rt(),rt=a(m,(t=>O=t)),Et=dt(O)||Et,y=yt.getDerivedFromVars({content_alignment_horizontal:pt.content_alignment_horizontal,content_alignment_vertical:pt.content_alignment_vertical}),et(),et=a(y,(t=>T=t)),Ft=function(t,e){const r=t.content_alignment_horizontal,n=t.content_alignment_vertical;return r&&"left"!==r&&"center"!==r&&"right"!==r||n&&"top"!==n&&"center"!==n&&"bottom"!==n?e:vt(t)}(T,Ft),b=yt.getDerivedFromVars(pt.accessibility),Q(),Q=a(b,(t=>z=t)),_=(null==z?void 0:z.description)||"",w=yt.getDerivedFromVars(pt.aspect),K(),K=a(w,(t=>D=t));{const t=null==D?void 0:D.ratio;At=t&&Mt(t)?(100/Number(t)).toFixed(2):"0"}$=yt.getDerivedFromVars(pt.tint_color),Z(),Z=a($,(t=>S=t)),x=yt.getDerivedFromVars(pt.tint_mode),G(),G=a(x,(t=>P=t));{const t=S,e=t?it(t):void 0,r=Zt(P,Vt);e===bt&&r===Vt||(yt.removeSvgFilter(bt,Vt),jt=e?yt.addSvgFilter(e,r):"",bt=e,Vt=r)}if(k=yt.getDerivedFromVars(pt.appearance_animation),H(),H=a(k,(t=>j=t)),j&&"fade"===j.type){const t=j;Pt=Ct(t.interpolator,"ease_in_out").replace(/_/g,"-"),zt=$t(t.duration,300),Dt=$t(t.start_delay,0),St=$t(t.alpha,0)}E=yt.getDerivedFromVars(pt.filters),q(),q=a(E,(t=>V=t));{let t="",e="";Array.isArray(V)&&V.length&&(t=Tt(V,yt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),Ot=t,It=e}return C={aspect:"0"!==At,"is-width-content":d,"is-height-content":g,loaded:!1,"before-appearance":Boolean(Pt)&&!0},F={"background-image":kt,"background-color":kt?void 0:wt,"background-size":Et},A={"object-fit":Et,"object-position":Ft,filter:["",Ot].filter(Boolean).join(" "),"clip-path":It||void 0,"--divkit-appearance-interpolator":Pt||void 0,"--divkit-appearance-fade-start":Pt?St:void 0,"--divkit-appearance-delay":Pt?`${Dt}ms`:void 0,"--divkit-appearance-duration":Pt?`${zt}ms`:void 0},q(),H(),G(),Z(),K(),Q(),et(),rt(),nt(),ot(),st(),lt(),ct(),ut(),xt?"":`${M(Nt,"Outer").$$render(t,{cls:ft("image",ge,C),json:pt,origJson:ht,templateContext:gt,layoutParams:mt,style:F,customDescription:!0},{},{default:()=>C.aspect?`<span${J("class",ge["image__aspect-wrapper"],0)}${B({"padding-bottom":`${At}%`})}><img${J("class",ge.image__image,0)}${J("src",l,0)} loading="lazy" decoding="async"${J("style",tt(A),0)}${J("alt",_,0)}${J("aria-hidden",_?null:"true",0)}></span>`:`<img${J("class",ge.image__image,0)}${J("src",l,0)} loading="lazy" decoding="async"${J("style",tt(A),0)}${J("alt",_,0)}${J("aria-hidden",_?null:"true",0)}>`})}`})),fe={grid:"divkit-d9080",grid_halign_left:"divkit-f63b3",grid_halign_center:"divkit-a14a6",grid_halign_right:"divkit-b0717",grid_valign_top:"divkit-fbca8",grid_valign_center:"divkit-d4310",grid_valign_bottom:"divkit-e4205"};function me(t){return t>0&&t<1}function ye(t){return String(Math.ceil(1e3*t)/1e3)}function be(t,e,r){if(t.some(me)){const e=Math.max(...t.filter(me).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(${et(n*t[e]/i)},${ye(t[e])}fr)`:t[e]?o[e]=`${ye(t[e])}fr`:o[e]="auto";return o.join(" ")}const _e=I(((t,e,n,i)=>{let o,s,l,c,u,d,p,g,h,f,m,y,b=r,_=r,w=r,$=r,{json:x={}}=e,{templateContext:k}=e,{origJson:E}=e,{layoutParams:C}=e;const F=v(Y);let A,V,j=!1,P=1,S=[],z=[],T=[],O=[],I=0,J=!1,N="top",B="left";void 0===e.json&&n.json&&void 0!==x&&n.json(x),void 0===e.templateContext&&n.templateContext&&void 0!==k&&n.templateContext(k),void 0===e.origJson&&n.origJson&&void 0!==E&&n.origJson(E),void 0===e.layoutParams&&n.layoutParams&&void 0!==C&&n.layoutParams(C),o=x.items,(null==o?void 0:o.length)&&Array.isArray(o)?j=!1:(j=!0,F.logError(X(new Error('Incorrect or empty "items" prop for div "grid"')))),s=F.getDerivedFromVars(x.column_count),$(),$=a(s,(t=>y=t)),P=Rt(y,P),l=(!j&&o||[]).map((t=>{let e=t,r=k;return({templateContext:r,json:e}=F.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];l.forEach((e=>{t.push(F.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),A=W(t,(t=>[...t])),w(),w=a(A,(t=>m=t))}{const t={};let e=0,r=0;S=[],z=[],T=[],O=[],J=!1,V=l.map(((n,i)=>{var o,a,s,l;const c=m[i],u=Number(c.columnSpan)||1,d=Number(c.rowSpan)||1,v={x:e,y:r,colSpan:u,rowSpan:d},p="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,h=1===u&&"fixed"===(null===(s=c.width)||void 0===s?void 0:s.type)&&c.width.value?Number(c.width.value)/u:0,f=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]?J=!0:(t[n+"_"+e]=!0,(!S[n]||S[n]<p)&&(S[n]=p),(!z[e]||z[e]<g)&&(z[e]=g),(!T[n]||T[n]<h)&&(T[n]=h),(!O[e]||O[e]<f)&&(O[e]=f));do{++e,e>=P&&(e=0,++r)}while(t[e+"_"+r]);return Object.assign(Object.assign({},n),{layoutParams:{gridArea:v,fakeElement:(null==C?void 0:C.fakeElement)||!1}})})),0!==e&&(J=!0),J&&F.logError(X(new Error('Mismatching "grid" rows/columns'))),I=r}return c=F.getDerivedFromVars(x.content_alignment_vertical),_(),_=a(c,(t=>f=t)),N=Gt(f,N),u=F.getDerivedFromVars(x.content_alignment_horizontal),b(),b=a(u,(t=>h=t)),B=Ht(h,B),d={valign:N,halign:B},p={"grid-template-columns":be(S,T,P),"grid-template-rows":be(z,O,I)},g=j||J,b(),_(),w(),$(),g?"":`${M(Nt,"Outer").$$render(t,{cls:ft("grid",fe,d),json:x,origJson:E,templateContext:k,style:p,layoutParams:C},{},{default:()=>`${D(V,(e=>`${M(sr,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),we=_e,$e={gallery:"divkit-cbb0f",gallery_orientation_horizontal:"divkit-c9be7",gallery_orientation_vertical:"divkit-a72d5",gallery__scroller:"divkit-a4e39","gallery_scroll-snap":"divkit-f606e","gallery__items-grid":"divkit-eb4a5",gallery__items:"divkit-af276",gallery__arrow:"divkit-b72d7","gallery__arrow-icon":"divkit-d100d",gallery__arrow_left:"divkit-a0a5d",gallery__arrow_right:"divkit-f0f59","gallery__arrow-icon-path":"divkit-b4173"};function xe(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 ke(t,e){let r;return function(...n){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,n),r=null}),e)}}const Ee=I(((t,e,n,i)=>{let o,s,l,c,d,p,g,h,f,m,y,b,_,w,$,x,k,E,C,F,A,V,P,S,z,T,O,I,N,B=r,R=r,U=r,L=r,q=r,H=r,Z=r,K=r,Q=r,rt=r,{json:nt={}}=e,{templateContext:it}=e,{origJson:ot}=e,{layoutParams:at}=e;const st=v(Y);let lt,ct,ut=[],dt=!1,vt=!1,pt=null,gt=!1;const ht=st.getCustomization("galleryLeftClass"),mt=st.getCustomization("galleryRightClass");let yt=!1;I=a(st.isDesktop,(t=>O=t));let bt,_t,xt,kt,Ct=1,Ft="horizontal",At="start",Vt=8,jt="",Pt=[],St={},Dt=!1,zt={},Mt=0;const Tt=ke((function(){const t=lt.scrollLeft,e=lt.scrollWidth,r=lt.offsetWidth;dt=t>2,vt=t+r<e-2}),50);function Ot(){let t=[],e=ut[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<Ct;++e){const n=ut[e].children[r];n&&t.push(n)}return t}function It(t,e,r="smooth"){const n="horizontal"===Ft,i=n?"offsetLeft":"offsetTop",o=n?"left":"top";lt.scroll({[o]:Math.max(0,t[e][i]-Vt/2),behavior:r})}function Jt(t){const e=Ot(),r=lt.getBoundingClientRect(),n=e.findIndex((t=>function(t,e){return"horizontal"===Ft?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"===Ft?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}!nt.id||yt||(null==at?void 0:at.fakeElement)||st.registerInstance(nt.id,{setCurrentItem(t){const e=Ot();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');It(e,t)},setPreviousItem(t){const e=Jt("prev"),r=Ot();let n=e-1;n<0&&(n="ring"===t?r.length-1:e),It(r,n)},setNextItem(t){const e="horizontal"===Ft?lt.scrollLeft+lt.offsetWidth===lt.scrollWidth:lt.scrollTop+lt.offsetHeight===lt.scrollHeight,r=Ot();if(e&&"ring"===t)return void It(r,0);const n=Jt("next");let i=n+1;i>r.length-1&&(i="ring"===t?0:n),It(r,i)}}),u((()=>{gt=!1,nt.id&&!(null==at?void 0:at.fakeElement)&&st.unregisterInstance(nt.id)})),void 0===e.json&&n.json&&void 0!==nt&&n.json(nt),void 0===e.templateContext&&n.templateContext&&void 0!==it&&n.templateContext(it),void 0===e.origJson&&n.origJson&&void 0!==ot&&n.origJson(ot),void 0===e.layoutParams&&n.layoutParams&&void 0!==at&&n.layoutParams(at),o=nt.items,(null==o?void 0:o.length)&&Array.isArray(o)?yt=!1:(yt=!0,st.logError(X(new Error('Incorrect or empty "items" prop for div "gallery"')))),s=(!yt&&o||[]).map((t=>{let e=t,r=it;return({templateContext:r,json:e}=st.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=O&&gt&&!yt,l?"undefined"!=typeof ResizeObserver&&(pt=new ResizeObserver((()=>{Tt()})),pt.observe(ct)):pt&&(pt.disconnect(),pt=null),c=st.getDerivedFromVars(nt.column_count),Q(),Q=a(c,(t=>T=t)),Ct=Rt(T,Ct),d=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}(s,Ct),p=st.getDerivedFromVars(nt.orientation),K(),K=a(p,(t=>z=t)),Ft=ve(z,Ft),g=st.getDerivedFromVars(nt.cross_content_alignment),Z(),Z=a(g,(t=>S=t)),At=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(S,At),h=st.getDerivedFromVars(nt.item_spacing),H(),H=a(h,(t=>P=t)),Vt=$t(P,Vt),bt=et(Vt),f=st.getDerivedFromVars(nt.cross_spacing),q(),q=a(f,(t=>V=t)),xt=$t(V,Vt),_t=et(xt),m=st.getDerivedFromVars(nt.paddings),L(),L=a(m,(t=>A=t)),jt=wt(A,jt),y="horizontal"===Ft?"grid-template-columns":"grid-template-rows";{let t=[];s.forEach((e=>{const r="horizontal"===Ft?"width":"height";t.push(st.getDerivedFromVars(e.json[r]))})),kt=W(t,(t=>t)),U(),U=a(kt,(t=>F=t))}Pt=[],Ct>1?Pt.push("auto"):F.forEach((t=>{!t&&"horizontal"===Ft||"match_parent"===(null==t?void 0:t.type)?Pt.push("100%"):Pt.push("max-content")})),b=st.getDerivedFromVars(nt.scroll_mode),R(),R=a(b,(t=>C=t));{const t={};let e={};Dt=!1,(null==at?void 0:at.fakeElement)&&(e.fakeElement=!0),"horizontal"===Ft?e.parentVAlign=At:e.parentHAlign=At,"paging"===C&&(Dt=!0,e.scrollSnap="start",t["horizontal"===Ft?"scroll-padding-left":"scroll-padding-top"]=et(Vt/2)),1===Ct&&(e.parentLayoutOrientation=Ft),St=Et(t,St),zt=Et(e,zt)}return _=st.getDerivedFromVars(nt.restrict_parent_scroll),rt(),rt=a(_,(t=>N=t)),w={padding:jt,"grid-gap":_t},$={"grid-gap":bt,[y]:xe(Pt)},x={orientation:Ft,"scroll-snap":Dt},k=st.getDerivedFromVars(nt.default_item),B(),B=a(k,(t=>E=t)),Mt=$t(E,Mt),B(),R(),U(),L(),q(),H(),Z(),K(),Q(),I(),rt(),"\n\n"+(yt?"":`${M(Nt,"Outer").$$render(t,{cls:ft("gallery",$e,x),json:nt,origJson:ot,templateContext:it,layoutParams:at,customPaddings:!0,customActions:"gallery",forceHeight:"vertical"===Ft,forceWidth:"horizontal"===Ft},{},{default:()=>`<div class="${j($e.gallery__scroller,!0)+" "+j(N?G:"",!0)}"${J("style",tt(St),0)}${J("this",lt,0)}><div${J("class",$e["gallery__items-grid"],0)}${J("style",tt(w),0)}${J("this",ct,0)}>${D(d,((e,r)=>`<div${J("class",$e.gallery__items,0)}${J("style",tt($),0)}${J("this",ut[r],0)}>${D(e,(e=>`${M(sr,"Unknown").$$render(t,{layoutParams:zt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===Ft?`${dt&&l?`<div${J("class",ht||`${$e.gallery__arrow} ${$e.gallery__arrow_left}`,0)}>${ht?"":`<svg${J("class",$e["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${J("class",$e["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>`:""}\n ${vt&&l?`<div${J("class",mt||`${$e.gallery__arrow} ${$e.gallery__arrow_right}`,0)}>${mt?"":`<svg${J("class",$e["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${J("class",$e["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>`:""}`:""}`})}`)})),Ce=Ee,Fe={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"},Ae=I(((t,e,n,i)=>{let o,s,l,c,d,p,g,h,f,m,y,_,w,$,x,k,E,C,F,A,V=r,P=r,S=r,z=r,T=r,O=r,I=r,N=r;var R;let{json:U={}}=e,{templateContext:W}=e,{origJson:L}=e,{layoutParams:q}=e;const H=v(Y),Z=H.genId("tabs");let K,Q,rt,nt=!1,ot={};const at=H.getJsonWithVars(U.selected_tab);let st,lt,ct=at&&Number(at)||0,ut=12,dt="",vt="",pt="",gt="",ht="",mt="",yt="",bt="",$t="",xt="",kt=!1,Ct=!1,Ft=ct,At=[],jt=[];async function Pt(t,e=!1){if(Ft=ct,ct=t,kt||(kt=!0,Q.style.height=et(Q.clientHeight),rt.style.transform=`translate3d(${100*-Ft}%,0,0)`),Ct=!0,async function(t){await b(),rt.style.transform=`translate3d(${t}%,0,0)`}(100*-ct),function(t=!1){const e=t?Math.max(0,ct-1):Math.min(ct,Ft),r=t?Math.min(o.length-1,ct+1):Math.max(ct,Ft);At=At.map(((t,n)=>t||n>=e&&n<=r)),jt=jt.map(((t,n)=>n>=e&&n<=r))}(),async function(){await b();const t=document.getElementById(`${Z}-panel-${ct}`);t&&(Q.style.height=et(t.offsetHeight))}(),zt&&clearTimeout(zt),zt=window.setTimeout((()=>{jt=o.map(((t,e)=>e===ct))}),400),St=-ct*Q.clientWidth,e){await b();const t=K.querySelector(`.${Fe.tabs__item_selected}`);t&&t.focus()}}let St,zt=null;!U.id||nt||(null==q?void 0:q.fakeElement)||H.registerInstance(U.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');Pt(t)},setPreviousItem(t){let e=ct-1;e<0&&(e="ring"===t?o.length-1:ct),Pt(e)},setNextItem(t){let e=ct+1;e>o.length-1&&(e="ring"===t?0:ct),Pt(e)}}),u((()=>{U.id&&!(null==q?void 0:q.fakeElement)&&H.unregisterInstance(U.id)})),void 0===e.json&&n.json&&void 0!==U&&n.json(U),void 0===e.templateContext&&n.templateContext&&void 0!==W&&n.templateContext(W),void 0===e.origJson&&n.origJson&&void 0!==L&&n.origJson(L),void 0===e.layoutParams&&n.layoutParams&&void 0!==q&&n.layoutParams(q),o=U.items||[],(null==o?void 0:o.length)&&Array.isArray(o)?nt=!1:(nt=!0,H.logError(X(new Error('Incorrect or empty "items" prop for div "tabs"')))),s=H.getDerivedFromVars(U.width),I(),I=a(s,(t=>F=t)),l=H.getDerivedFromVars(U.height),O(),O=a(l,(t=>C=t));{let t={};(null==q?void 0:q.fakeElement)&&(t.fakeElement=!0),"wrap_content"===(null==F?void 0:F.type)&&(t.parentHorizontalWrapContent=!0),C&&"wrap_content"!==C.type||(t.parentVerticalWrapContent=!0),ot=Et(t,ot)}if(!nt&&(ct<0||ct>=o.length)&&(H.logError(X(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:U.selected_tab,length:o.length}})),ct=ct<0?0:o.length-1),c=H.getDerivedFromVars(U.tab_title_style),T(),T=a(c,(t=>E=t)),d=E||{},ut=Rt(d.font_size,ut),d.font_size||d.paddings){const t=d.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/ut*10,right:(Number(t.right)||0)/ut*10,bottom:(Number(t.bottom)||0)/ut*10,left:(Number(t.left)||0)/ut*10};dt=wt(e,dt)}{const t=d.line_height;void 0!==t&&Mt(t)&&(vt=et(t/ut*10))}{const t=d.letter_spacing;void 0!==t&&_t(t)&&(pt=et(t/ut*10))}if(d.corner_radius||d.corners_radius||d.font_size){const t=null!==(R=d.corner_radius)&&void 0!==R?R:1e3;d.corners_radius?gt=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]&&!_t(i[t]))return n;return Vt(t,e,r)}(d.corners_radius,t,ut,gt):_t(t)&&(gt=et(t/ut*10))}return st=Wt(d.active_font_weight||d.font_weight,st),lt=Wt(d.inactive_font_weight||d.font_weight,lt),ht=it(d.active_text_color,1,ht),mt=it(d.inactive_text_color,1,mt),yt=it(d.active_background_color,1,yt),bt=it(d.inactive_background_color,1,bt),p=H.getDerivedFromVars(U.has_separator),z(),z=a(p,(t=>k=t)),g=H.getDerivedFromVars(U.separator_color),S(),S=a(g,(t=>x=t)),h=H.getDerivedFromVars(U.separator_paddings),P(),P=a(h,(t=>$=t)),k&&(x&&($t=it(x,1,$t)),$&&(xt=wt($,xt))),f={background:$t,margin:xt},m=H.getDerivedFromVars(U.switch_tabs_by_content_swipe_enabled),V(),V=a(m,(t=>w=t)),y=void 0===w||Boolean(w),_=H.getDerivedFromVars(U.restrict_parent_scroll),N(),N=a(_,(t=>A=t)),nt||(At=o.map(((t,e)=>e===ct)),jt=o.map(((t,e)=>e===ct))),V(),P(),S(),z(),T(),O(),I(),N(),nt?"":`${M(Nt,"Outer").$$render(t,{cls:ft("tabs",Fe,{}),json:U,origJson:L,templateContext:W,layoutParams:q,customActions:"tabs"},{},{default:()=>`<div class="${j(Fe.tabs__list,!0)+" "+j(A?G:"",!0)}" role="tablist"${B({"--divkit-tabs-font-size":et(ut),"--divkit-tabs-paddings":dt,"--divkit-tabs-line-height":vt,"--divkit-tabs-letter-spacing":pt,"--divkit-tabs-active-font-weight":st||"","--divkit-tabs-inactive-font-weight":lt||"","--divkit-tabs-active-text-color":ht,"--divkit-tabs-inactive-text-color":mt,"--divkit-tabs-active-background-color":yt,"--divkit-tabs-inactive-background-color":bt,"--divkit-tabs-border-radius":gt})}${J("this",K,0)}>${D(o,((e,r)=>{let n=r===ct;return`\n\n ${M(Dt,"Actionable").$$render(t,{cls:ft("tabs__item",Fe,{selected:n,actionable:Boolean(e.title_click_action)}),actions:!e.title_click_action||null!=q&&q.fakeElement?[]:[e.title_click_action],attrs:{id:`${Z}-tab-${r}`,"aria-controls":`${Z}-panel-${r}`,role:"tab",tabindex:!n||null!=q&&q.fakeElement?"-1":e.title_click_action?void 0:"0","aria-selected":n?"true":"false"},customAction:null!=q&&q.fakeElement?null:t=>function(t,e){return ct===e||(Pt(e),!1)}(0,r)},{},{default:()=>`${j(e.title)}\n `})}`}))}</div>\n ${k?`<div${J("class",Fe.tabs__separator,0)}${J("style",tt(f),0)}></div>`:""}\n <div class="${j(Fe.tabs__panels,!0)+" "+j(A?G:"",!0)}"${J("this",Q,0)}><div${J("class",ft("tabs__swiper",Fe,{inited:kt,animated:Ct}),0)}${J("this",rt,0)}>${D(o,((e,r)=>`<div${J("class",ft("tabs__panel",Fe,{visible:jt[r]}),0)} role="tabpanel" id="${j(Z,!0)+"-panel-"+j(r,!0)}" aria-labelledby="${j(Z,!0)+"-tab-"+j(r,!0)}" style="${"left: "+j(100*r,!0)+"%"}">${At[r]?`${M(sr,"Unknown").$$render(t,{div:e.div,templateContext:W,layoutParams:ot},{},{})}`:""}\n </div>`))}</div></div>`})}`})),Ve=Ae,je="divkit-eb860",Pe="divkit-e08c6";function Se(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)}}Se([.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]),Se([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 De=I(((t,e,r,n)=>{let i,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const c=v(Y),p=v(mt);let g=new Map,h=new Set,f=!1,m=null,y=[],_=[],w=[],$=[];const x=o.div_id||o.id;let k;x?(null==l?void 0:l.fakeElement)||(p.registerInstance(x,{async setState(t){if(k===t)return;c.setRunning("stateChange",!0),new Set(h),y.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),y=[],$.forEach((t=>{g.set(t.id,t.node.getBoundingClientRect())})),_=[],w=[],$=[];const e=i.find((e=>e.state_id===t))||null;e?(k=t,E=e):c.logError(X(new Error("Cannot find state with id"),{additional:{stateId:t}})),await b()},getChild(t){if(m&&m.has(t))return m.get(t);c.logError(X(new Error("Missing state block with id"),{additional:{id:t}}))}}),d(mt,{registerInstance(t,e){m||(m=new Map),m.has(t)?c.logError(X(new Error("Duplicate state with id"),{additional:{id:t}})):m.set(t,e)},unregisterInstance(t){null==m||m.delete(t)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return _.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return w.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,templateContext:e,transitions:r,node:n};return $.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&g.has(t),registerChild(t){h.add(t)},unregisterChild(t){h.delete(t)}})):(f=!0,c.logError(X(new Error('Missing "id" prop for div "state"'))));let E=null;const C=c.getJsonWithVars(o.default_state_id);let F=!1;return u((()=>{x&&!(null==l?void 0:l.fakeElement)&&p.unregisterInstance(x)})),void 0===e.json&&r.json&&void 0!==o&&r.json(o),void 0===e.templateContext&&r.templateContext&&void 0!==a&&r.templateContext(a),void 0===e.origJson&&r.origJson&&void 0!==s&&r.origJson(s),void 0===e.layoutParams&&r.layoutParams&&void 0!==l&&r.layoutParams(l),o&&(h=new Set),i=o.states||[],(null==i?void 0:i.length)?f=!1:(f=!0,c.logError(X(new Error('Empty "states" prop for div "state"')))),function(t){F||(F=!0,t.length&&(C?(k=C,E=t.find((t=>t.state_id===k))||null,E||c.logError(X(new Error("Cannot find state for default_state_id"),{additional:{selectedId:k}}))):(E=t[0],k=E.state_id)))}(i),f?"":`${M(Nt,"Outer").$$render(t,{cls:"divkit-b8efc",json:o,origJson:s,templateContext:a,layoutParams:l},{},{default:()=>{var e;return`${null!==(e=E)&&void 0!==e&&e.div?`${M(sr,"Unknown").$$render(t,{div:E.div,templateContext:a},{},{})}`:""}\n <div${J("class","divkit-adaae",0)} aria-hidden="true"${J("this",undefined,0)}>${D(y,(e=>"direction"in e?`<div${J("class",je,0)} style="${"left:"+j(e.offsetLeft,!0)+"px;top:"+j(e.offsetTop,!0)+"px;width:"+j(e.width,!0)+"px;height:"+j(e.height,!0)+"px"}"><div${J("class",Pe,0)}>${M(sr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`:`<div${J("class",je,0)}><div${J("class",Pe,0)}>${M(sr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`))}</div>`}})}`})),ze={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f"},Me=I(((t,e,n,i)=>{let o,s,l,c,d,p,g,h,f,m,y,b,_,w,$,x,k,E=r,C=r,F=r,A=r,V=r,P=r;var S,z,T,O,I,N,B;let{json:R={}}=e,{templateContext:U}=e,{origJson:W}=e,{layoutParams:L}=e;const q=v(Y),H=q.genId("pager");let Z,K=!1,Q=0,nt=0,it=!1,ot="horizontal",at="",st="",lt="";function ct(t,e="smooth"){const r="horizontal"===ot,n=Z.children[t],i=r?"offsetLeft":"offsetTop",o=r?"left":"top";Z.scroll({[o]:n[i],behavior:e}),Q=t}ke((function(){const t=function(){const t=Array.from(Z.children),e=Z.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,n=t.getBoundingClientRect(),"horizontal"===ot?n.left>=r.left&&n.right<=r.right:n.top>=r.top&&n.bottom<=r.bottom;var r,n}));return-1!==r?r:Q}();t!==Q&&(Q=t)}),50),R.id&&!(null==L?void 0:L.fakeElement)&&q.registerInstance(R.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');ct(t)},setPreviousItem(t){let e=Q-1;e<0&&(e="ring"===t?o.length-1:Q),ct(e)},setNextItem(t){let e=Q+1;e>o.length-1&&(e="ring"===t?0:Q),ct(e)}}),u((()=>{R.id&&!(null==L?void 0:L.fakeElement)&&q.unregisterInstance(R.id)})),void 0===e.json&&n.json&&void 0!==R&&n.json(R),void 0===e.templateContext&&n.templateContext&&void 0!==U&&n.templateContext(U),void 0===e.origJson&&n.origJson&&void 0!==W&&n.origJson(W),void 0===e.layoutParams&&n.layoutParams&&void 0!==L&&n.layoutParams(L),(null===(S=R.items)||void 0===S?void 0:S.length)&&Array.isArray(R.items)?K=!1:(K=!0,q.logError(X(new Error('Incorrect or empty "items" prop for div "pager"')))),o=(!K&&R.items||[]).map((t=>{let e=t,r=U;return({templateContext:r,json:e}=q.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=q.getDerivedFromVars(R.layout_mode),C(),C=a(s,(t=>_=t)),_?"percentage"!==_.type&&"fixed"!==_.type?(it=!0,q.logError(X(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):it=!1:(it=!0,q.logError(X(new Error('Empty "layout_mode" prop for div "pager"')))),l=q.getDerivedFromVars(R.orientation),V(),V=a(l,(t=>x=t)),ot=ve(x,ot),c=q.getDerivedFromVars(R.item_spacing),A(),A=a(c,(t=>$=t));{const t=null==$?void 0:$.value;t&&_t(t)&&(at=et(t||0))}if(d=q.getDerivedFromVars(R.paddings),F(),F=a(d,(t=>w=t)),st=wt(w,st),p=q.getDerivedFromVars(R.restrict_parent_scroll),P(),P=a(p,(t=>k=t)),g="horizontal"===ot?"grid-auto-columns":"grid-auto-rows","fixed"===(null==_?void 0:_.type)){const t=rt("horizontal"===ot?((null===(z=R.paddings)||void 0===z?void 0:z.left)||0)+((null===(T=R.paddings)||void 0===T?void 0:T.right)||0):((null===(O=R.paddings)||void 0===O?void 0:O.top)||0)+((null===(I=R.paddings)||void 0===I?void 0:I.bottom)||0)),e=null===(N=_.neighbour_page_width)||void 0===N?void 0:N.value;lt=e?`calc(100% + ${t} - 2 * ${rt(e)} - 2 * ${at})`:"100%"}else if("percentage"===(null==_?void 0:_.type)){const t=null===(B=_.page_width)||void 0===B?void 0:B.value;lt=`${Number(t)}%`}return h={"grid-gap":at,padding:st,[g]:lt},f={orientation:ot},m=K||it,y=q.getStore("pagers"),E(),E=a(y,(t=>b=t)),function(t,e){const r=R.id;if(r){const o=new Map(b);n=y,b=o.set(r,{instId:H,size:t,currentItem:e,scrollToPagerItem:ct}),i=b,n.set(i)}var n,i}(o.length,Q),function(t){var e;if(t===nt)return;nt=t;const r=q.getJsonWithVars(null===(e=o[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&q.execAnyActions(r)}(Q),E(),C(),F(),A(),V(),P(),m?"":`${M(Nt,"Outer").$$render(t,{cls:ft("pager",ze,f),json:R,origJson:W,templateContext:U,layoutParams:L,customPaddings:!0},{},{default:()=>`<div class="${j(ze.pager__items,!0)+" "+j(k?G:"",!0)}"${J("style",tt(h),0)}${J("this",Z,0)}>${D(o,(e=>`<div${J("class",ze.pager__item,0)}>${M(sr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson,layoutParams:null!=L&&L.fakeElement?{fakeElement:!0}:void 0},{},{})}\n </div>`))}</div>`})}`})),Te=Me,Oe={indicator:"divkit-d8e3f",indicator__scroller:"divkit-b5db0",indicator__items:"divkit-d5d94",indicator__item:"divkit-f6629",indicator__item_active:"divkit-b39cd"},Ie=I(((t,e,n,i)=>{let o,s,l,c,u,d,p,g,h,f,m,y,_=r,w=r,$=r,x=r,k=r,E=r;var C;let{json:F={}}=e,{templateContext:A}=e,{origJson:V}=e,{layoutParams:P}=e;const S=v(Y);let z,T,O,I=5,N=10,R=10,U=5,W="#ffdc60",q=it("#33919cb5"),H=15,G=1.3;return void 0===e.json&&n.json&&void 0!==F&&n.json(F),void 0===e.templateContext&&n.templateContext&&void 0!==A&&n.templateContext(A),void 0===e.origJson&&n.origJson&&void 0!==V&&n.origJson(V),void 0===e.layoutParams&&n.layoutParams&&void 0!==P&&n.layoutParams(P),o=S.getDerivedFromVars(F.shape),E(),E=a(o,(t=>y=t)),y&&("rounded_rectangle"===y.type?(y.item_width&&(N=$t(y.item_width.value,N)),y.item_height&&(R=$t(y.item_height.value,R)),y.corner_radius&&(U=$t(y.corner_radius.value,U))):"circle"===y.type&&(I=$t(null===(C=y.radius)||void 0===C?void 0:C.value,I),N=R=U=2*I)),s=S.getDerivedFromVars(F.active_item_color),k(),k=a(s,(t=>m=t)),W=it(m,1,W),l=S.getDerivedFromVars(F.inactive_item_color),x(),x=a(l,(t=>f=t)),q=it(f,1,q),c=S.getDerivedFromVars(F.space_between_centers),$(),$=a(c,(t=>h=t)),h&&(H=$t(h.value,H)),u=S.getDerivedFromVars(F.active_item_size),w(),w=a(u,(t=>g=t)),G=Rt(g,G),d=S.getStore("pagers"),_(),_=a(d,(t=>p=t)),async function(t){if(F.pager_id&&t.has(F.pager_id)){O=t.get(F.pager_id),await b();const e=T.children[O.currentItem].offsetLeft;z.scroll({left:e-z.clientWidth/2,behavior:"smooth"})}}(p),_(),w(),$(),x(),k(),E(),`${M(Nt,"Outer").$$render(t,{cls:ft("indicator",Oe,{}),json:F,origJson:V,templateContext:A,layoutParams:P},{},{default:()=>`<div${J("class",Oe.indicator__scroller,0)}${J("this",z,0)}><div${J("class",Oe.indicator__items,0)} role="tablist"${B({margin:`0 ${et((G-1)*N/2)}`,"--divkit-indicator-width":et(N),"--divkit-indicator-height":et(R),"--divkit-indicator-border-radius":et(U),"--divkit-indicator-active-color":W,"--divkit-indicator-inactive-color":q,"--divkit-indicator-active-scale":G,"--divkit-indicator-margin":`0 ${et((H-N)/2)}`})}${J("this",T,0)}>${O?`${D(Array(O.size),((t,e)=>{let r=e===O.currentItem;return`\n <div class="${j(ft("indicator__item",Oe,{active:r}),!0)+" "+j(L,!0)}" role="tab" id="${j(O.instId,!0)+"-tab-"+j(e,!0)}" aria-controls="${j(O.instId,!0)+"-panel-"+j(e,!0)}"${J("aria-selected",r?"true":"false",0)}${J("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),Je=Ie,Ne={slider:"divkit-ef4f7",slider__input:"divkit-d1d65",slider__input_secondary:"divkit-c7980",slider__thumb:"divkit-f3453",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 Be(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&it(t.text_color)||"#000",i=Ut(t.font_weight);if(Mt(t.font_size)&&"transparent"!==n){var o,a;const e={fontSize:et(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 Re(t,e,r){return Math.max(e,Math.min(r,t))}const Ue=2147483647,We=-2147483648,Le=Number.MAX_VALUE,qe=Number.MIN_VALUE,He="string",Ge="integer",Ze="number",Ye="boolean",Xe="color",Ke="datetime";class Qe{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=U(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}}const tr={string:class extends Qe{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends Qe{convertValue(t){if("number"!=typeof t||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"}},integer:class extends Qe{convertValue(t){if("number"!=typeof t||isNaN(t)||t>Ue||t<We||t!==Math.round(t))throw new Error("Incorrect variable value");return t}fromString(t){const e=Number(t);return this.convertValue(e)}getType(){return"integer"}},boolean:class extends Qe{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"}},color:class extends Qe{convertValue(t){if("string"!=typeof t||!ot(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends Qe{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function er(t,e,r){if(!(e in tr))throw new Error("Unsupported variable type");return new tr[e](t,r)}function rr(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 nr=I(((t,e,n,i)=>{let o,s,l,c,u,d,p,g,h,f,m,y,b,_,w,$,x,k,E,C,F,A,V,P,S,z,T,O,I,N,R,U,W,L,q,H,G=r,Z=r,K=r,Q=r,tt=r,nt=r,it=r,ot=r,at=r,st=r,lt=r,ct=r;var ut,dt,vt,pt;let{json:gt={}}=e,{templateContext:ht}=e,{origJson:mt}=e,{layoutParams:yt}=e;const bt={width:10,height:10,borderRadius:5,background:"#000"},wt=["rounded_rectangle","circle"],$t=["rounded_rectangle"],xt=v(Y),kt=v(Pt);let Et=0,Ct=100;const At=xt.getJsonWithVars(gt.thumb_value_variable),Vt=xt.getJsonWithVars(gt.thumb_secondary_value_variable);L=a(At&&xt.getVariable(At,"integer")||er("temp","integer",0),(t=>W=t)),U=a(Vt&&xt.getVariable(Vt,"integer")||er("temp","integer",0),(t=>R=t));let jt,St,Dt,zt=Re(W||0,Et,Ct),Mt=Re(R||0,Et,Ct),Tt=bt,Ot=Tt,It=bt,Jt=bt,Bt=null,Rt=null,Ut=Dt,Wt="",Lt="",qt=!1;ke((function(){}),50),void 0===e.json&&n.json&&void 0!==gt&&n.json(gt),void 0===e.templateContext&&n.templateContext&&void 0!==ht&&n.templateContext(ht),void 0===e.origJson&&n.origJson&&void 0!==mt&&n.origJson(mt),void 0===e.layoutParams&&n.layoutParams&&void 0!==yt&&n.layoutParams(yt),o=xt.getDerivedFromVars(gt.min_value),ct(),ct=a(o,(t=>H=t)),s=xt.getDerivedFromVars(gt.max_value),lt(),lt=a(s,(t=>q=t)),Et=Ft(H,Et),Ct=Ft(q,Ct);{const t=Re(W||0,Et,Ct);t!==zt&&(zt=t)}{const t=Re(R||0,Et,Ct);t!==Mt&&(Mt=t)}l=xt.getDerivedFromVars(gt.thumb_style),st(),st=a(l,(t=>N=t)),Tt=Qt(N,wt,Tt),c=xt.getDerivedFromVars(gt.thumb_secondary_style),at(),at=a(c,(t=>I=t)),Ot=Qt(I,wt,Tt),u=xt.getDerivedFromVars(gt.track_inactive_style),ot(),ot=a(u,(t=>O=t)),It=Qt(O,$t,It),d=xt.getDerivedFromVars(gt.track_active_style),it(),it=a(d,(t=>T=t)),Jt=Qt(T,$t,Jt),p=xt.getDerivedFromVars(gt.tick_mark_active_style),nt(),nt=a(p,(t=>z=t));{let t=Qt(z,wt,bt);t!==bt&&(Bt=t)}jt=Bt?Vt?rr(Math.min(zt,Mt),Math.max(zt,Mt)+1,Et,Ct,!0):rr(Et,zt,Et,Ct,!0):[],g=xt.getDerivedFromVars(gt.tick_mark_inactive_style),tt(),tt=a(g,(t=>S=t));{let t=Qt(S,wt,bt);t!==bt&&(Rt=t)}St=Rt?Vt?rr(Math.min(zt,Mt),Math.max(zt,Mt)+1,Et,Ct,!1):rr(zt+1,Ct+1,Et,Ct,!0):[],h=xt.getDerivedFromVars(gt.thumb_text_style),Q(),Q=a(h,(t=>P=t)),Dt=Be(P,Dt),f=xt.getDerivedFromVars(gt.thumb_secondary_text_style),K(),K=a(f,(t=>V=t)),Ut=Be(V,Dt),m=xt.getDerivedFromVars(gt.accessibility),Z(),Z=a(m,(t=>A=t)),(null==A?void 0:A.description)?Wt=A.description:xt.logError(X(new Error('Missing accessibility "description" for slider'),{level:"warn"})),y=xt.getDerivedFromVars(gt.secondary_value_accessibility),G(),G=a(y,(t=>F=t)),(null==F?void 0:F.description)?Lt=F.description:Vt&&xt.logError(X(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;kt.hasAction()?(xt.logError(X(new Error('Cannot show "slider" inside component with action'))),t=!0):Tt===bt?(xt.logError(X(new Error('Missing "thumb_style" in slider'))),t=!0):Jt===bt?(xt.logError(X(new Error('Missing "track_active_style" in slider'))),t=!0):It===bt&&(xt.logError(X(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==qt&&(qt=t)}return b=et(Math.max(...[Tt.width,Ot.width,0].filter(_t))),_=et(Math.max(...[Tt.height,Ot.height,0].filter(_t))),w=(zt-Et)/(Ct-Et),$=Vt?(Mt-Et)/(Ct-Et):void 0,x=void 0!==$?Math.abs($-w):w,k=void 0!==$?Math.min($,w):0,E={"--divkit-slider-thumb-width":et(Tt.width),"--divkit-slider-thumb-height":et(Tt.height),"--divkit-slider-thumb-secondary-width":et(Ot.width),"--divkit-slider-thumb-secondary-height":et(Ot.height),"--divkit-slider-text-offset-x":(null===(ut=null==Dt?void 0:Dt.offset)||void 0===ut?void 0:ut.x)?rt(Dt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(dt=null==Dt?void 0:Dt.offset)||void 0===dt?void 0:dt.y)?rt(Dt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(vt=null==Ut?void 0:Ut.offset)||void 0===vt?void 0:vt.x)?rt(Ut.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(pt=null==Ut?void 0:Ut.offset)||void 0===pt?void 0:pt.y)?rt(Ut.offset.y):void 0,"--divkit-slider-tick-active-width":Bt?et(Bt.width):void 0,"--divkit-slider-tick-active-height":Bt?et(Bt.height):void 0,"--divkit-slider-tick-active-border-radius":Bt?et(Bt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Bt?void 0:Bt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Bt?void 0:Bt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Rt?et(Rt.width):void 0,"--divkit-slider-tick-inactive-height":Rt?et(Rt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Rt?et(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":b,"--divkit-slider-max-thumb-height":_,"--divkit-slider-track-part":w,"--divkit-slider-track-secondary-part":$},C={},G(),Z(),K(),Q(),tt(),nt(),it(),ot(),at(),st(),U(),L(),lt(),ct(),"\n\n"+(qt?"":`${M(Nt,"Outer").$$render(t,{cls:ft("slider",Ne,C),style:E,customDescription:!0,customActions:"slider",json:gt,origJson:mt,templateContext:ht,layoutParams:yt},{},{default:()=>{var t,e,r,n,i,o;return`<div${J("class",Ne["slider__tracks-wrapper"],0)}><div${J("class",Ne["slider__tracks-inner"],0)}${J("this",undefined,0)}><div${J("class",Ne.slider__track,0)}${B({height:et(It.height),"border-radius":et(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}></div>\n <div${J("class",Ne["slider__active-track"],0)}${B({left:(100*k).toFixed(2)+"%",width:(100*x).toFixed(2)+"%",height:et(Jt.height),"border-radius":et(Jt.borderRadius),background:Jt.background,"box-shadow":Jt.boxShadow||""})}></div>\n ${D(jt,(t=>`<div class="${j(Ne.slider__tick,!0)+" "+j(Ne.slider__tick_active,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n ${D(St,(t=>`<div class="${j(Ne.slider__tick,!0)+" "+j(Ne.slider__tick_inactive,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n <div${J("class",Ne.slider__thumb,0)}${B({"border-radius":et(Tt.borderRadius),background:Tt.background,"box-shadow":Tt.boxShadow||""})}>${Dt?`<div${J("class",Ne["slider__thumb-text"],0)}><div${J("class",Ne["slider__thumb-text-inner"],0)}${B({"font-size":(null===(t=Dt)||void 0===t?void 0:t.fontSize)||"1em","font-weight":(null===(e=Dt)||void 0===e?void 0:e.fontWeight)||"",color:(null===(r=Dt)||void 0===r?void 0:r.textColor)||"#000"})}>${j(zt)}</div></div>`:""}</div>\n ${Vt?`<div class="${j(Ne.slider__thumb,!0)+" "+j(Ne.slider__thumb_secondary,!0)}"${B({"border-radius":et(Ot.borderRadius),background:Ot.background,"box-shadow":Ot.boxShadow||""})}>${Ut?`<div class="${j(Ne["slider__thumb-text"],!0)+" "+j(Ne["slider__thumb-text_secondary"],!0)}"><div${J("class",Ne["slider__thumb-text-inner"],0)}${B({"font-size":(null===(n=Ut)||void 0===n?void 0:n.fontSize)||"1em","font-weight":(null===(i=Ut)||void 0===i?void 0:i.fontWeight)||"",color:(null===(o=Ut)||void 0===o?void 0:o.textColor)||"#000"})}>${j(Mt)}</div></div>`:""}</div>`:""}\n <input type="range"${J("class",Ne.slider__input,0)}${J("min",Et,0)}${J("max",Ct,0)} step="1"${J("value",zt,0)}${J("aria-label",Wt,0)}>\n ${Vt?`<input type="range"${J("class",`${Ne.slider__input} ${Ne.slider__input_secondary}`,0)}${J("min",Et,0)}${J("max",Ct,0)} step="1"${J("value",Mt,0)}${J("aria-label",Lt,0)}>`:""}</div></div>`}})}`)})),ir={input:"divkit-c3a4c",input__wrapper:"divkit-ef7eb",input__holder:"divkit-bb3da",input_multiline:"divkit-e48a3",input__input:"divkit-f11e0","input_highlight-color":"divkit-cc00f","input_vertical-overflow":"divkit-b7075"},or={text:Xt,container:ue,separator:pe,image:he,gif:he,grid:we,gallery:Ce,tabs:Ve,state:De,pager:Te,indicator:Je,slider:nr,input:I(((t,e,n,i)=>{let o,s,l,c,u,d,p,g,h,f,m,y,b,_,w,$,x,k,E,C,F,A,V,P,S,D,z,T,O,I,N,B,R=r,U=r,{json:W={}}=e,{templateContext:L}=e,{origJson:q}=e,{layoutParams:H}=e;const G=v(Y);let Z;const K=G.getJsonWithVars(W.text_variable);let Q=!1;K||(Q=!0,G.logError(X(new Error('Missing "text_variable" in "input"')))),I=a(K&&G.getVariable(K,"string")||er("temp","string",""),(t=>O=t));let tt="";T=a(G.getDerivedFromVars(W.hint_text),(t=>z=t)),D=a(G.getDerivedFromVars(W.hint_color),(t=>S=t));let nt="";P=a(G.getDerivedFromVars(W.font_size),(t=>V=t));let ot,at,st=12;A=a(G.getDerivedFromVars(W.font_weight),(t=>F=t)),C=a(G.getDerivedFromVars(W.line_height),(t=>E=t)),k=a(G.getDerivedFromVars(W.letter_spacing),(t=>x=t));let lt="";$=a(G.getDerivedFromVars(W.text_color),(t=>w=t));let ct="#000";_=a(G.getDerivedFromVars(W.highlight_color),(t=>b=t));let ut="";y=a(G.getDerivedFromVars(W.keyboard_type),(t=>m=t));const dt={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let vt="multi_line_text",pt="text";f=a(G.getDerivedFromVars(W.max_visible_lines),(t=>h=t));let gt="",ht="";B=a(G.getDerivedFromVars(W.select_all_on_focus),(t=>N=t)),void 0===e.json&&n.json&&void 0!==W&&n.json(W),void 0===e.templateContext&&n.templateContext&&void 0!==L&&n.templateContext(L),void 0===e.origJson&&n.origJson&&void 0!==q&&n.origJson(q),void 0===e.layoutParams&&n.layoutParams&&void 0!==H&&n.layoutParams(H),tt=O,o=z,nt=it(S,1,nt),st=Rt(V,st),ot=Wt(F,ot);{const t=E;Mt(t)&&(at=t/st)}return bt(x)&&(lt=et(x/st*10)),ct=it(w,1,ct),ut=it(b,1,ut),m&&m in dt&&(pt=dt[m],vt=m),s="multi_line_text"===vt,l=G.getDerivedFromVars(W.paddings),U(),U=a(l,(t=>g=t)),Mt(h)&&(gt=`calc(${h*(at||1.25)+"em"} + ${rt($t(null==g?void 0:g.top,0)+$t(null==g?void 0:g.bottom,0))})`),c=G.getDerivedFromVars(W.accessibility),R(),R=a(c,(t=>p=t)),(null==p?void 0:p.description)?ht=p.description:G.logError(X(new Error('Missing accessibility "description" for input'),{level:"warn"})),u={"highlight-color":Boolean(ut),"vertical-overflow":!1,multiline:s},d={"--divkit-input-hint-color":nt,"--divkit-input-highlight-color":ut,"font-size":et(st),"font-weight":ot,"line-height":at,"letter-spacing":lt,color:ct,"max-height":gt},R(),U(),f(),y(),_(),$(),k(),C(),A(),P(),D(),T(),I(),B(),Q?"":`${M(Nt,"Outer").$$render(t,{cls:ft("input",ir,u),style:d,customDescription:!0,customActions:"input",json:W,origJson:q,templateContext:L,layoutParams:H},{},{default:()=>`<span${J("class",ir.input__wrapper,0)}><span${J("class",ir.input__holder,0)} aria-hidden="true"${J("this",undefined,0)}>\n ${j(tt)}${tt.endsWith("\n")||!tt?"​":""}</span>\n ${s?`<textarea${J("class",ir.input__input,0)} autocomplete="off" autocapitalize="off"${J("aria-label",ht,0)}${J("placeholder",o,0)}${J("this",Z,0)}>${j(tt,!0)}</textarea>`:`<input${J("type",pt,0)}${J("class",ir.input__input,0)} autocomplete="off" autocapitalize="off"${J("aria-label",ht,0)}${J("placeholder",o,0)}${J("value",tt,0)}${J("this",Z,0)}>`}</span>`})}`}))},ar=I(((t,e,r,n)=>{let{div:i}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=v(Y);let c,u,d;if(void 0===e.div&&r.div&&void 0!==i&&r.div(i),void 0===e.templateContext&&r.templateContext&&void 0!==o&&r.templateContext(o),void 0===e.origJson&&r.origJson&&void 0!==a&&r.origJson(a),void 0===e.layoutParams&&r.layoutParams&&void 0!==s&&r.layoutParams(s),c=i,u=o,d=c&&or[c.type]||void 0,!d&&(({templateContext:u,json:c}=l.processTemplate(c,u)),d=c&&or[c.type]||void 0,!d)){let t;t=(null==c?void 0:c.type)&&l.hasTemplate(c.type)?"Recursive template":"Unknown component",l.logError(X(new Error(t),{additional:{component:(null==c?void 0:c.type)||"<missing>"}}))}return d?`${M(d||z,"svelte:component").$$render(t,{json:c,templateContext:u,layoutParams:s,origJson:a||i},{},{})}`:""})),sr=ar,lr=I(((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${J("class","divkit-dc22b",0)} aria-hidden="true"><defs>${D([...Object.keys(i)],(t=>{let[e,r]=t.split(":");return`\n <filter${J("id",i[t],0)}><feFlood${J("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${J("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"${J("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function cr(t,e,r,n){const i=r[t.type];if(!i)return n(X(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 e(r,i){const o=Object.keys(i).filter((t=>"__proto__"!==t)),s=o.filter((t=>"$"!==t.charAt(0))),l=o.filter((t=>"$"===t.charAt(0)));return s.forEach((t=>{const n=i[t];"object"==typeof n&&null!==n?(r[t]=Array.isArray(n)?[]:{},e(r[t],n)):r[t]=n})),l.forEach((e=>{const o=i[e],s=a[o];if(void 0!==s){const t=e.substring(1);r[t]=s}else n(X(new Error("Missing template field"),{level:"warn",additional:{key:e,template:t.type}}))})),r}({},i);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(s[o]=t[o]);return{json:s,templateContext:a}}function ur(){}function dr(t){return{subscribe:e=>(e(t),ur)}}function vr(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function pr(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function gr(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 hr(t){var e=parseInt(t,10);if(e>Ue||e<We)throw new Error(`Value ${t} can't be converted to Integer type.`);return e}function fr(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function mr(t,e,r,n){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,mr.prototype),i.expected=e,i.found=r,i.location=n,i.name="SyntaxError",i}function yr(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function br(t,e){var r,n={},i=(e=void 0!==e?e:{}).grammarSource,o={start:Vt,JsonStringContents:function(){var t,e,r;for(t=ft,e=[],r=jt();r!==n;)e.push(r),r=jt();return mt=t,e=ht(e)}},a=Vt,s="@{",l="}",c="@{}",u="\\",d="||",v="&&",p="==",g="!=",h=">=",f="<=",m="+",y="-",b="true",_="false",w=/^[^}]/,$=/^[^'}]/,x=/^[0-9]/,k=/^[a-zA-Z_0-9.]/,E=/^[a-zA-Z_]/,C=/^[ \t\r\n]/,F=xt("@{",!1),A=xt("}",!1),V=xt("@{}",!1),j=xt("\\",!1),P={type:"any"},S=kt(["}"],!0,!1),D=xt("?",!1),z=xt(":",!1),M=xt("||",!1),T=xt("&&",!1),O=xt("==",!1),I=xt("!=",!1),J=xt(">=",!1),N=xt(">",!1),B=xt("<=",!1),R=xt("<",!1),U=xt("+",!1),W=xt("-",!1),L=xt("/",!1),q=xt("*",!1),H=xt("%",!1),G=xt("!",!1),Z=xt("(",!1),Y=xt(")",!1),X=xt(",",!1),K=Et("string"),Q=xt("'",!1),tt=kt(["'","}"],!0,!1),et=Et("integer"),rt=kt([["0","9"]],!1,!1),nt=Et("number"),it=xt(".",!1),ot=xt("e",!1),at=xt("E",!1),st=Et("boolean"),lt=xt("true",!1),ct=xt("false",!1),ut=kt([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),dt=Et("identifier"),vt=kt([["a","z"],["A","Z"],"_"],!1,!1),pt=Et("whitespace"),gt=kt([" ","\t","\r","\n"],!1,!1),ht=function(t){return gr(t)},ft=0,mt=0,yt=[{line:1,column:1}],bt=0,_t=[],wt=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 $t(){return t.substring(mt,ft)}function xt(t,e){return{type:"literal",text:t,ignoreCase:e}}function kt(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function Et(t){return{type:"other",description:t}}function Ct(e){var r,n=yt[e];if(n)return n;for(r=e-1;!yt[r];)r--;for(n={line:(n=yt[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return yt[e]=n,n}function Ft(t,e){var r=Ct(t),n=Ct(e);return{source:i,start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:n.line,column:n.column}}}function At(t){ft<bt||(ft>bt&&(bt=ft,_t=[]),_t.push(t))}function Vt(){var t,e;return t=ft,Ut(),(e=Pt())!==n?(Ut(),mt=t,t=e):(ft=t,t=n),t}function jt(){var e,r,i,o,a;if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n?(i=Ut(),(o=Pt())!==n?(Ut(),125===t.charCodeAt(ft)?(a=l,ft++):(a=n,0===wt&&At(A)),a!==n?(mt=e,e=o):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,t.substr(ft,3)===c?(r=c,ft+=3):(r=n,0===wt&&At(V)),r!==n&&(mt=e,r=""),(e=r)===n&&(e=ft,r=ft,wt++,92===t.charCodeAt(ft)?(i=u,ft++):(i=n,0===wt&&At(j)),i===n&&(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F))),wt--,i===n?r=void 0:(ft=r,r=n),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(P)),i!==n?(mt=e,e=$t()):(ft=e,e=n)):(ft=e,e=n),e===n))){if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n){if(i=[],w.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(S)),o!==n)for(;o!==n;)i.push(o),w.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(S));else i=n;i!==n?(125===t.charCodeAt(ft)?(o=l,ft++):(o=n,0===wt&&At(A)),o!==n?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ft=e,e=n)):(ft=e,e=n)}else ft=e,e=n;e===n&&(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===n&&(e=ft,92===t.charCodeAt(ft)?(r=u,ft++):(r=n,0===wt&&At(j)),r!==n?(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F)),i!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=u,ft++):(r=n,0===wt&&At(j)),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(P)),i!==n?(mt=e,e=fr(i)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=u,ft++):(r=n,0===wt&&At(j)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Pt(){var e,r,i,o,a,s;return e=ft,(r=St())!==n?(Ut(),63===t.charCodeAt(ft)?(i="?",ft++):(i=n,0===wt&&At(D)),i!==n?(Ut(),(o=Pt())!==n?(Ut(),58===t.charCodeAt(ft)?(a=":",ft++):(a=n,0===wt&&At(z)),a!==n?(Ut(),(s=Pt())!==n?(mt=e,e={type:"ConditionalExpression",test:r,consequent:o,alternate:s}):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=St()),e}function St(){var e,r,i,o,a,s,l,c;if(e=ft,(r=Dt())!==n){for(i=[],o=ft,a=Ut(),t.substr(ft,2)===d?(s=d,ft+=2):(s=n,0===wt&&At(M)),s!==n?(l=Ut(),(c=Dt())!==n?o=a=[a,s,l,c]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Ut(),t.substr(ft,2)===d?(s=d,ft+=2):(s=n,0===wt&&At(M)),s!==n?(l=Ut(),(c=Dt())!==n?o=a=[a,s,l,c]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=pr(r,i)}else ft=e,e=n;return e}function Dt(){var e,r,i,o,a,s,l,c;if(e=ft,(r=zt())!==n){for(i=[],o=ft,a=Ut(),t.substr(ft,2)===v?(s=v,ft+=2):(s=n,0===wt&&At(T)),s!==n?(l=Ut(),(c=zt())!==n?o=a=[a,s,l,c]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Ut(),t.substr(ft,2)===v?(s=v,ft+=2):(s=n,0===wt&&At(T)),s!==n?(l=Ut(),(c=zt())!==n?o=a=[a,s,l,c]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=pr(r,i)}else ft=e,e=n;return e}function zt(){var e,r,i,o,a,s,l,c;if(e=ft,(r=Mt())!==n){for(i=[],o=ft,a=Ut(),t.substr(ft,2)===p?(s=p,ft+=2):(s=n,0===wt&&At(O)),s===n&&(t.substr(ft,2)===g?(s=g,ft+=2):(s=n,0===wt&&At(I))),s!==n?(l=Ut(),(c=Mt())!==n?o=a=[a,s,l,c]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Ut(),t.substr(ft,2)===p?(s=p,ft+=2):(s=n,0===wt&&At(O)),s===n&&(t.substr(ft,2)===g?(s=g,ft+=2):(s=n,0===wt&&At(I))),s!==n?(l=Ut(),(c=Mt())!==n?o=a=[a,s,l,c]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=vr(r,i)}else ft=e,e=n;return e}function Mt(){var e,r,i,o,a,s,l,c;if(e=ft,(r=Tt())!==n){for(i=[],o=ft,a=Ut(),t.substr(ft,2)===h?(s=h,ft+=2):(s=n,0===wt&&At(J)),s===n&&(62===t.charCodeAt(ft)?(s=">",ft++):(s=n,0===wt&&At(N)),s===n&&(t.substr(ft,2)===f?(s=f,ft+=2):(s=n,0===wt&&At(B)),s===n&&(60===t.charCodeAt(ft)?(s="<",ft++):(s=n,0===wt&&At(R))))),s!==n?(l=Ut(),(c=Tt())!==n?o=a=[a,s,l,c]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Ut(),t.substr(ft,2)===h?(s=h,ft+=2):(s=n,0===wt&&At(J)),s===n&&(62===t.charCodeAt(ft)?(s=">",ft++):(s=n,0===wt&&At(N)),s===n&&(t.substr(ft,2)===f?(s=f,ft+=2):(s=n,0===wt&&At(B)),s===n&&(60===t.charCodeAt(ft)?(s="<",ft++):(s=n,0===wt&&At(R))))),s!==n?(l=Ut(),(c=Tt())!==n?o=a=[a,s,l,c]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=vr(r,i)}else ft=e,e=n;return e}function Tt(){var e,r,i,o,a,s,l,c;if(e=ft,(r=Ot())!==n){for(i=[],o=ft,a=Ut(),43===t.charCodeAt(ft)?(s=m,ft++):(s=n,0===wt&&At(U)),s===n&&(45===t.charCodeAt(ft)?(s=y,ft++):(s=n,0===wt&&At(W))),s!==n?(l=Ut(),(c=Ot())!==n?o=a=[a,s,l,c]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Ut(),43===t.charCodeAt(ft)?(s=m,ft++):(s=n,0===wt&&At(U)),s===n&&(45===t.charCodeAt(ft)?(s=y,ft++):(s=n,0===wt&&At(W))),s!==n?(l=Ut(),(c=Ot())!==n?o=a=[a,s,l,c]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=vr(r,i)}else ft=e,e=n;return e}function Ot(){var e,r,i,o,a,s,l,c;if(e=ft,(r=It())!==n){for(i=[],o=ft,a=Ut(),47===t.charCodeAt(ft)?(s="/",ft++):(s=n,0===wt&&At(L)),s===n&&(42===t.charCodeAt(ft)?(s="*",ft++):(s=n,0===wt&&At(q)),s===n&&(37===t.charCodeAt(ft)?(s="%",ft++):(s=n,0===wt&&At(H)))),s!==n?(l=Ut(),(c=It())!==n?o=a=[a,s,l,c]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Ut(),47===t.charCodeAt(ft)?(s="/",ft++):(s=n,0===wt&&At(L)),s===n&&(42===t.charCodeAt(ft)?(s="*",ft++):(s=n,0===wt&&At(q)),s===n&&(37===t.charCodeAt(ft)?(s="%",ft++):(s=n,0===wt&&At(H)))),s!==n?(l=Ut(),(c=It())!==n?o=a=[a,s,l,c]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=vr(r,i)}else ft=e,e=n;return e}function It(){var e,r,i;return(e=Bt())===n&&(e=Nt())===n&&(e=ft,33===t.charCodeAt(ft)?(r="!",ft++):(r=n,0===wt&&At(G)),r===n&&(43===t.charCodeAt(ft)?(r=m,ft++):(r=n,0===wt&&At(U)),r===n&&(45===t.charCodeAt(ft)?(r=y,ft++):(r=n,0===wt&&At(W)))),r!==n?(Ut(),(i=It())!==n?(mt=e,e={type:"UnaryExpression",operator:r,argument:i}):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=function(){var e,r,i,o,a;return e=ft,(r=Rt())!==n?(Ut(),40===t.charCodeAt(ft)?(i="(",ft++):(i=n,0===wt&&At(Z)),i!==n?(Ut(),o=function(){var e,r,i,o,a,s,l;if(e=ft,(r=Pt())!==n){for(i=[],o=ft,Ut(),44===t.charCodeAt(ft)?(a=",",ft++):(a=n,0===wt&&At(X)),a!==n?(Ut(),(s=Pt())!==n?o=s:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,Ut(),44===t.charCodeAt(ft)?(a=",",ft++):(a=n,0===wt&&At(X)),a!==n?(Ut(),(s=Pt())!==n?o=s:(ft=o,o=n)):(ft=o,o=n);mt=e,l=i,e=[r,...l]}else ft=e,e=n;return e===n&&(e=Ut()),e}(),o!==n?(Ut(),41===t.charCodeAt(ft)?(a=")",ft++):(a=n,0===wt&&At(Y)),a!==n?(mt=e,e={type:"CallExpression",callee:r,arguments:o}):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,(r=Rt())!==n&&(mt=e,r={type:"Variable",id:r}),(e=r)===n&&(e=function(){var e,r,i,o;return e=function(){var e,r,i,o;return wt++,e=ft,39===t.charCodeAt(ft)?(r="'",ft++):(r=n,0===wt&&At(Q)),r!==n?(i=function(){var t,e,r;for(t=ft,e=[],r=Jt();r!==n;)e.push(r),r=Jt();return mt=t,e=gr(e)}(),39===t.charCodeAt(ft)?(o="'",ft++):(o=n,0===wt&&At(Q)),o!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n),wt--,e===n&&(r=n,0===wt&&At(K)),e}(),e===n&&(e=Bt())===n&&(e=Nt())===n&&(e=function(){var e,r;return wt++,e=ft,t.substr(ft,4)===b?(r=b,ft+=4):(r=n,0===wt&&At(lt)),r!==n&&(mt=e,r={type:"BooleanLiteral",value:!0}),(e=r)===n&&(e=ft,t.substr(ft,5)===_?(r=_,ft+=5):(r=n,0===wt&&At(ct)),r!==n&&(mt=e,r={type:"BooleanLiteral",value:!1}),e=r),wt--,e===n&&(r=n,0===wt&&At(st)),e}(),e===n&&(e=ft,40===t.charCodeAt(ft)?(r="(",ft++):(r=n,0===wt&&At(Z)),r!==n&&(i=Pt())!==n?(41===t.charCodeAt(ft)?(o=")",ft++):(o=n,0===wt&&At(Y)),o!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n))),e}())),e}())),e}function Jt(){var e,r,i,o,a;if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n?(i=Ut(),(o=Pt())!==n?(Ut(),125===t.charCodeAt(ft)?(a=l,ft++):(a=n,0===wt&&At(A)),a!==n?(mt=e,e=o):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,t.substr(ft,3)===c?(r=c,ft+=3):(r=n,0===wt&&At(V)),r!==n&&(mt=e,r=""),(e=r)===n&&(e=ft,r=ft,wt++,92===t.charCodeAt(ft)?(i=u,ft++):(i=n,0===wt&&At(j)),i===n&&(39===t.charCodeAt(ft)?(i="'",ft++):(i=n,0===wt&&At(Q)),i===n&&(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F)))),wt--,i===n?r=void 0:(ft=r,r=n),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(P)),i!==n?(mt=e,e=$t()):(ft=e,e=n)):(ft=e,e=n),e===n))){if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n){if(i=[],$.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(tt)),o!==n)for(;o!==n;)i.push(o),$.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(tt));else i=n;i!==n?(125===t.charCodeAt(ft)?(o=l,ft++):(o=n,0===wt&&At(A)),o!==n?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ft=e,e=n)):(ft=e,e=n)}else ft=e,e=n;e===n&&(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===n&&(e=ft,92===t.charCodeAt(ft)?(r=u,ft++):(r=n,0===wt&&At(j)),r!==n?(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F)),i!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=u,ft++):(r=n,0===wt&&At(j)),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(P)),i!==n?(mt=e,e=fr(i)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=u,ft++):(r=n,0===wt&&At(j)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Nt(){var e,r,i,o;if(wt++,e=ft,45===t.charCodeAt(ft)?(r=y,ft++):(r=n,0===wt&&At(W)),r===n&&(r=null),i=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt)),o!==n)for(;o!==n;)i.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));else i=n;return i!==n?(mt=e,e={type:"IntegerLiteral",value:hr($t())}):(ft=e,e=n),wt--,e===n&&(r=n,0===wt&&At(et)),e}function Bt(){var e,r,i,o,a,s,l,c,u,d;for(wt++,e=ft,45===t.charCodeAt(ft)?(r=y,ft++):(r=n,0===wt&&At(W)),r===n&&(r=null),i=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));o!==n;)i.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));if(46===t.charCodeAt(ft)?(o=".",ft++):(o=n,0===wt&&At(it)),o!==n){if(a=[],x.test(t.charAt(ft))?(s=t.charAt(ft),ft++):(s=n,0===wt&&At(rt)),s!==n)for(;s!==n;)a.push(s),x.test(t.charAt(ft))?(s=t.charAt(ft),ft++):(s=n,0===wt&&At(rt));else a=n;if(a!==n){if(s=ft,101===t.charCodeAt(ft)?(l="e",ft++):(l=n,0===wt&&At(ot)),l===n&&(69===t.charCodeAt(ft)?(l="E",ft++):(l=n,0===wt&&At(at))),l!==n){if(43===t.charCodeAt(ft)?(c=m,ft++):(c=n,0===wt&&At(U)),c===n&&(45===t.charCodeAt(ft)?(c=y,ft++):(c=n,0===wt&&At(W))),c===n&&(c=null),u=[],x.test(t.charAt(ft))?(d=t.charAt(ft),ft++):(d=n,0===wt&&At(rt)),d!==n)for(;d!==n;)u.push(d),x.test(t.charAt(ft))?(d=t.charAt(ft),ft++):(d=n,0===wt&&At(rt));else u=n;u!==n?s=l=[l,c,u]:(ft=s,s=n)}else ft=s,s=n;s===n&&(s=null),mt=e,e={type:"NumberLiteral",value:parseFloat($t())}}else ft=e,e=n}else ft=e,e=n;if(e===n){if(e=ft,45===t.charCodeAt(ft)?(r=y,ft++):(r=n,0===wt&&At(W)),r===n&&(r=null),i=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt)),o!==n)for(;o!==n;)i.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));else i=n;if(i!==n)if(101===t.charCodeAt(ft)?(o="e",ft++):(o=n,0===wt&&At(ot)),o===n&&(69===t.charCodeAt(ft)?(o="E",ft++):(o=n,0===wt&&At(at))),o!==n){if(43===t.charCodeAt(ft)?(a=m,ft++):(a=n,0===wt&&At(U)),a===n&&(45===t.charCodeAt(ft)?(a=y,ft++):(a=n,0===wt&&At(W))),a===n&&(a=null),s=[],x.test(t.charAt(ft))?(l=t.charAt(ft),ft++):(l=n,0===wt&&At(rt)),l!==n)for(;l!==n;)s.push(l),x.test(t.charAt(ft))?(l=t.charAt(ft),ft++):(l=n,0===wt&&At(rt));else s=n;s!==n?(mt=e,e={type:"NumberLiteral",value:parseFloat($t())}):(ft=e,e=n)}else ft=e,e=n;else ft=e,e=n}return wt--,e===n&&(r=n,0===wt&&At(nt)),e}function Rt(){var e,r,i,o,a;if(wt++,e=ft,r=ft,wt++,i=function(){var e,r,i,o;return e=ft,t.substr(ft,4)===b?(r=b,ft+=4):(r=n,0===wt&&At(lt)),r===n&&(t.substr(ft,5)===_?(r=_,ft+=5):(r=n,0===wt&&At(ct))),r!==n?(i=ft,wt++,k.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(ut)),wt--,o===n?i=void 0:(ft=i,i=n),i!==n?e=r=[r,i]:(ft=e,e=n)):(ft=e,e=n),e}(),wt--,i===n?r=void 0:(ft=r,r=n),r!==n)if(E.test(t.charAt(ft))?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(vt)),i!==n){for(o=[],k.test(t.charAt(ft))?(a=t.charAt(ft),ft++):(a=n,0===wt&&At(ut));a!==n;)o.push(a),k.test(t.charAt(ft))?(a=t.charAt(ft),ft++):(a=n,0===wt&&At(ut));mt=e,e={type:"Identifier",name:$t()}}else ft=e,e=n;else ft=e,e=n;return wt--,e===n&&(r=n,0===wt&&At(dt)),e}function Ut(){var e,r;for(wt++,e=[],C.test(t.charAt(ft))?(r=t.charAt(ft),ft++):(r=n,0===wt&&At(gt));r!==n;)e.push(r),C.test(t.charAt(ft))?(r=t.charAt(ft),ft++):(r=n,0===wt&&At(gt));return wt--,r=n,0===wt&&At(pt),e}if((r=a())!==n&&ft===t.length)return r;throw r!==n&&ft<t.length&&At({type:"end"}),function(t,e,r){return new mr(mr.buildMessage(t,e),t,e,r)}(_t,bt<t.length?t.charAt(bt):null,bt<t.length?Ft(bt,bt+1):Ft(bt,bt))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(mr,Error),mr.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+":"+i.line+":"+i.column;if(n){var a=this.location.end,s=yr("",i.line.toString().length," "),l=n[i.line-1],c=(i.line===a.line?a.column:l.length+1)-i.column||1;e+="\n --\x3e "+o+"\n"+s+" |\n"+i.line+" | "+l+"\n"+s+" | "+yr("",i.column-1," ")+yr("",c,"^")}else e+="\n at "+o}return e},mr.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 _r=new Map,wr=new Map;function $r(t,e,r){const n={args:e,cb:r},i=_r.get(t)||[];_r.has(t)||_r.set(t,i),i.push(n);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");wr.set(o,n)}function xr(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 kr(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=>{kr(t,e)}));break;case"BinaryExpression":case"LogicalExpression":kr(t.left,e),kr(t.right,e);break;case"UnaryExpression":kr(t.argument,e);break;case"ConditionalExpression":kr(t.test,e),kr(t.consequent,e),kr(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{kr(t,e)}))}}function Er(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function Cr(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function Fr(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 Cr(t.value);if("color"===t.type)return Tr(Mr(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function Ar(t){let e=Fr(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function Vr(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}const jr=new Int32Array(1);function Pr(t){return jr[0]=t,jr[0]}function Sr(t){if(t<We||t>Ue)throw new Error("Integer overflow.")}function Dr(t){const e=[];return kr(t,{Variable(t){e.push(t.id.name)}}),e}function zr(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function Mr(t){const e=ot(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function Tr(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 nt(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function Or(t){return{type:He,value:Fr(t)}}function Ir(t){const e=Number(t.value);if(isNaN(e)||!Number.isFinite(e))throw new Error("Unable to convert value to Number.");return{type:Ze,value:e}}function Jr(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value/e.value;return t.type===Ge&&(r=Pr(r)),{type:t.type,value:r}}function Nr(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value%e.value;return t.type===Ge&&(r=Pr(r)),{type:t.type,value:r}}function Br(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e*=t[r].value,t[0].type===Ge&&(e=Pr(e));return{type:t[0].type,value:e}}function Rr(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e-=t[r].value,t[0].type===Ge&&(e=Pr(e));return{type:t.length?t[0].type:Ge,value:e}}function Ur(...t){let e=0;for(let r=0;r<t.length;++r)e+=t[r].value,t[0].type===Ge&&(e=Pr(e));return{type:t.length?t[0].type:Ge,value:e}}function Wr(t){const e=Math.abs(t.value);return t.type===Ge&&Sr(e),{type:t.type,value:e}}function Lr(...t){if(!t.length)throw new Error("Non empty argument list is required for max function.");return{type:t[0].type,value:Math.max(...t.map((t=>t.value)))}}function qr(...t){if(!t.length)throw new Error("Non empty argument list is required for min function.");return{type:t[0].type,value:Math.min(...t.map((t=>t.value)))}}function Hr(t){return{type:t.type,value:Math.sign(t.value)}}function Gr(t,e){let r;if(0===e.value&&t.type===Ge)r=t.value;else if(0===t.value&&t.type===Ge)r=0;else{let n=Math.sign(e.value);t.type===Ze&&0===n&&(n=Object.is(n,0)?1:-1),r=Math.abs(t.value)*n}return t.type===Ge&&Sr(r),{type:t.type,value:r}}function Zr(t){return e=>{const r=Mr(e.value);return{type:Ze,value:r[t]/255}}}function Yr(t){return(e,r)=>{const n=Mr(e.value);return n[t]=255*r.value,{type:Xe,value:Tr(n)}}}const Xr=Zr("a"),Kr=Zr("r"),Qr=Zr("g"),tn=Zr("b"),en=Yr("a"),rn=Yr("r"),nn=Yr("g"),on=Yr("b");function an(t){return t.map(Ar).join(", ")}$r("toString",[Ge],Or),$r("toString",[Ze],Or),$r("toString",[Ye],Or),$r("toString",[Xe],Or),$r("toString",["url"],Or),$r("toNumber",[Ge],Ir),$r("toNumber",[He],Ir),$r("toInteger",[Ze],(function(t){if(t.value>Ue||t.value<We)throw new Error("Unable to convert value to Integer.");const e=t.value-t.value%1;return{type:Ge,value:e}})),$r("toInteger",[He],(function(t){const e=Number(t.value);if(isNaN(e)||e%1!=0||e>Ue||e<We)throw new Error("Unable to convert value to Integer.");return{type:Ge,value:e}})),$r("toInteger",[Ye],(function(t){return{type:Ge,value:t.value?1:0}})),$r("toBoolean",[Ge],(function(t){if(1!==t.value&&0!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Ye,value:t.value}})),$r("toBoolean",[He],(function(t){if("true"!==t.value&&"false"!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Ye,value:"true"===t.value?1:0}})),$r("encodeUri",[He],(function(t){try{return{type:He,value:encodeURIComponent(t.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),$r("decodeUri",[He],(function(t){try{return{type:He,value:decodeURIComponent(t.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),$r("parseUnixTime",[Ge],(function(t){return{type:Ke,value:new Date(1e3*t.value)}})),$r("nowLocal",[],(function(){return{type:Ke,value:new Date}})),$r("addMillis",[Ke,Ge],(function(t,e){return{type:Ke,value:new Date(t.value.getTime()+e.value)}})),$r("setYear",[Ke,Ge],(function(t,e){const r=new Date(t.value);return r.setFullYear(e.value),{type:Ke,value:r}})),$r("setMonth",[Ke,Ge],(function(t,e){if(e.value<1||e.value>12)throw new Error(`Expecting month in [1..12], instead got ${e.value}.`);const r=new Date(t.value);return r.setMonth(e.value-1),{type:Ke,value:r}})),$r("setDay",[Ke,Ge],(function(t,e){const r=new Date(t.value);if(e.value<=0&&-1!==e.value||e.value>function(t){const e=new Date(t);return e.setMonth(e.getMonth()+1),e.setDate(0),e.getDate()}(r))throw new Error(`Unable to set day ${e.value} for date ${Fr(t)}.`);return r.setDate(-1===e.value?0:e.value),{type:Ke,value:r}})),$r("setHours",[Ke,Ge],(function(t,e){if(e.value<0||e.value>23)throw new Error(`Expecting hours in [0..23], instead got ${e.value}.`);const r=new Date(t.value);return r.setHours(e.value-r.getTimezoneOffset()/60),{type:Ke,value:r}})),$r("setMinutes",[Ke,Ge],(function(t,e){if(e.value<0||e.value>59)throw new Error(`Expecting minutes in [0..59], instead got ${e.value}.`);const r=new Date(t.value);return r.setMinutes(e.value),{type:Ke,value:r}})),$r("setSeconds",[Ke,Ge],(function(t,e){if(e.value<0||e.value>59)throw new Error(`Expecting seconds in [0..59], instead got ${e.value}.`);const r=new Date(t.value);return r.setSeconds(e.value),{type:Ke,value:r}})),$r("setMillis",[Ke,Ge],(function(t,e){if(e.value<0||e.value>999)throw new Error(`Expecting millis in [0..999], instead got ${e.value}.`);const r=new Date(t.value);return r.setMilliseconds(e.value),{type:Ke,value:r}})),$r("len",[He],(function(t){return{type:Ge,value:t.value.length}})),$r("contains",[He,He],(function(t,e){return{type:Ye,value:t.value.includes(e.value)?1:0}})),$r("substring",[He,Ge,Ge],(function(t,e,r){if(r.value<e.value)throw new Error("Indexes should be in ascending order.");if(e.value<0||e.value>t.value.length||r.value<0||r.value>t.value.length)throw new Error("Indexes are out of bounds.");return{type:He,value:t.value.substring(e.value,r.value)}})),$r("replaceAll",[He,He,He],(function(t,e,r){let n;return n=e.value?t.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(e.value),"g"),r.value):t.value,{type:He,value:n}})),$r("index",[He,He],(function(t,e){return{type:Ge,value:t.value.indexOf(e.value)}})),$r("lastIndex",[He,He],(function(t,e){return{type:Ge,value:t.value.lastIndexOf(e.value)}})),$r("trim",[He],(function(t){return{type:He,value:t.value.trim()}})),$r("trimLeft",[He],(function(t){return{type:He,value:t.value.replace(/^\s+/,"")}})),$r("trimRight",[He],(function(t){return{type:He,value:t.value.replace(/\s+$/,"")}})),$r("toUpperCase",[He],(function(t){return{type:He,value:t.value.toUpperCase()}})),$r("toLowerCase",[He],(function(t){return{type:He,value:t.value.toLowerCase()}})),$r("div",[Ge,Ge],Jr),$r("div",[Ze,Ze],Jr),$r("mod",[Ge,Ge],Nr),$r("mod",[Ze,Ze],Nr),$r("mul",[{type:Ge,isVararg:!0}],Br),$r("mul",[{type:Ze,isVararg:!0}],Br),$r("sub",[{type:Ge,isVararg:!0}],Rr),$r("sub",[{type:Ze,isVararg:!0}],Rr),$r("sum",[{type:Ge,isVararg:!0}],Ur),$r("sum",[{type:Ze,isVararg:!0}],Ur),$r("abs",[Ge],Wr),$r("abs",[Ze],Wr),$r("max",[{type:Ge,isVararg:!0}],Lr),$r("max",[{type:Ze,isVararg:!0}],Lr),$r("min",[{type:Ge,isVararg:!0}],qr),$r("min",[{type:Ze,isVararg:!0}],qr),$r("maxNumber",[],(function(){return{type:Ze,value:Le}})),$r("minNumber",[],(function(){return{type:Ze,value:qe}})),$r("maxInteger",[],(function(){return{type:Ge,value:Ue}})),$r("minInteger",[],(function(){return{type:Ge,value:We}})),$r("round",[Ze],(function(t){const e=Math.sign(t.value);return{type:Ze,value:e*Math.round(Math.abs(t.value))}})),$r("floor",[Ze],(function(t){return{type:Ze,value:Math.floor(t.value)}})),$r("ceil",[Ze],(function(t){return{type:Ze,value:Math.ceil(t.value)}})),$r("signum",[Ze],Hr),$r("signum",[Ge],Hr),$r("copySign",[Ze,Ze],Gr),$r("copySign",[Ge,Ge],Gr),$r("getColorAlpha",[He],Xr),$r("getColorAlpha",[Xe],Xr),$r("getColorRed",[He],Kr),$r("getColorRed",[Xe],Kr),$r("getColorGreen",[He],Qr),$r("getColorGreen",[Xe],Qr),$r("getColorBlue",[He],tn),$r("getColorBlue",[Xe],tn),$r("setColorAlpha",[He,Ze],en),$r("setColorAlpha",[Xe,Ze],en),$r("setColorRed",[He,Ze],rn),$r("setColorRed",[Xe,Ze],rn),$r("setColorGreen",[He,Ze],nn),$r("setColorGreen",[Xe,Ze],nn),$r("setColorBlue",[He,Ze],on),$r("setColorBlue",[Xe,Ze],on),$r("rgb",[Ze,Ze,Ze],(function(t,e,r){const n={a:255,r:255*t.value,g:255*e.value,b:255*r.value};return{type:Xe,value:Tr(n)}})),$r("argb",[Ze,Ze,Ze,Ze],(function(t,e,r,n){const i={a:255*t.value,r:255*e.value,g:255*r.value,b:255*n.value};return{type:Xe,value:Tr(i)}}));const sn={StringLiteral:function(t,e){return{type:He,value:e.value}},NumberLiteral:function(t,e){return{type:Ze,value:e.value}},IntegerLiteral:function(t,e){return{type:Ge,value:e.value}},BooleanLiteral:function(t,e){return{type:Ye,value:e.value?1:0}},UnaryExpression:function(t,e){const r=Er(ln(t,e.argument));switch(e.operator){case"!":if(r.type===Ye)return{type:Ye,value:r.value?0:1};zr(`${e.operator}${Ar(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const t="+"===e.operator?1:-1;if(r.type===Ge)return{type:Ge,value:r.value*t};if(r.type===Ze)return{type:Ze,value:r.value*t};zr(`${e.operator}${Ar(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=Er(ln(t,e.test));if(r.type===Ye)return r.value?ln(t,e.consequent):ln(t,e.alternate);zr(`${Ar(r)} ? ${Ar(ln(t,e.consequent))} : ${Ar(ln(t,e.alternate))}`,"Ternary must be called with a Boolean value as a condition.")},TemplateLiteral:function(t,e){let r="";if(2===e.quasis.length&&""===e.quasis[0].value&&""===e.quasis[1].value)return ln(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=Fr(ln(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:He,value:r}},LogicalExpression:function(t,e){const r=Er(ln(t,e.left));if(r.type!==Ye&&zr(`${Ar(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Ye,value:0};const n=Er(ln(t,e.right));return n.type!==Ye&&zr(`${Ar(r)} ${e.operator} ${Ar(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${Vr(n.type)}.`),{type:Ye,value:n.value}},BinaryExpression:function(t,e){const r=e.operator,n=ln(t,e.left),i=ln(t,e.right);if(n.type!==i.type&&zr(`${Ar(n)} ${e.operator} ${Ar(i)}`,`Operator '${r}' cannot be applied to different types: ${Vr(n.type)} and ${Vr(i.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===Ke&&r.type===Ke?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:Ye,value:n?1:0}}(r,n,i);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==Ze&&e.type!==Ge&&e.type!==Ke&&zr(`${Ar(e)} ${t} ${Ar(r)}`,`Operator '${t}' cannot be applied to ${Vr(e.type)} type.`);const i=e.type===Ke?e.value.getTime():e.value,o=r.type===Ke?r.value.getTime():r.value;return n=">"===t?i>o:">="===t?i>=o:"<"===t?i<o:i<=o,{type:Ye,value:n?1:0}}(r,n,i);if("+"===r||"-"===r)return function(t,e,r){if(e.type!==He&&e.type!==Ze&&e.type!==Ge&&zr(`${Ar(e)} ${t} ${Ar(r)}`,`Operator '${t}' cannot be applied to ${Vr(e.type)} type.`),e.type===He)return"-"===t&&zr(`${Ar(e)} - ${Ar(r)}`,`Operator '${t}' cannot be applied to ${Vr(e.type)} type.`),{type:He,value:e.value+r.value};let n="+"===t?e.value+r.value:e.value-r.value;return e.type===Ge&&(n=Pr(n)),{type:e.type,value:n}}(r,n,i);if("/"===r||"*"===r||"%"===r)return function(t,e,r){let n;if(e.type!==Ge&&e.type!==Ze&&zr(`${Ar(e)} ${t} ${Ar(r)}`,`Operator '${t}' cannot be applied to ${Vr(e.type)} type.`),"*"===t)n=e.value*r.value;else{if("/"!==t&&"%"!==t)throw new Error(`Unsupported operation ${t}`);0===r.value&&zr(`${Ar(e)} ${t} ${Ar(r)}`,"Division by zero is not supported."),n="/"===t?e.value/r.value:e.value%r.value}return e.type===Ge&&(n=Pr(n)),{type:e.type,value:n}}(r,n,i);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;if(!_r.has(r))throw new Error(`Unknown function name: ${r}.`);let n;const i=e.arguments.map((e=>ln(t,e))),o=r+":"+i.map((t=>t.type)).join("#");if(wr.has(o))n=wr.get(o);else{const t=function(t,e){const r=_r.get(t);if(!r)throw new Error("Missing function");let n=null;for(let t=0;t<r.length;++t){const i=xr(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){const e=i.map((t=>Vr(t.type))).join(", "),n=`${r}(${an(i)})`;"few"===t.type&&0===i.length?zr(n,`Non empty argument list is required for function '${r}'.`):(t.type,zr(n,`Function '${r}' has no matching override for given argument types: ${e}.`))}n=t}if(!n)throw new Error("Function not found");try{return n.cb(...i)}catch(t){zr(`${r}(${an(i)})`,t.message)}},Variable:function(t,e){const r=e.id.name,n=t.get(r);if(n)return function(t){return{type:t.getType(),value:t.getValue()}}(n);throw new Error(`Variable '${r}' has value null`)}};function ln(t,e){if(e.type in sn)return sn[e.type](t,e);throw new Error("Unsupported expression")}function cn(t,e){try{return ln(t,e)}catch(t){return{type:"error",value:t.message}}}class un{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return kr(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=cn(t,this.ast);if("error"===r.type)return void e(X(new Error("Expression execution error"),{additional:{message:r.value}}));const n=r.value;if(n instanceof Date)return Cr(n);if("boolean"===r.type)return Boolean(n);if("color"===r.type){const t=ot(String(n));if(t)return Tr(t);e(X(new Error("Expression execution error")))}return n}catch(t){return void e(X(new Error("Expression execution error")))}}}function dn(t,e,r){if(t)if("string"==typeof t){if((n=t).indexOf("@{")>-1||n.indexOf("\\")>-1){e.hasExpression=!0;try{const r=br(t,{startRule:"JsonStringContents"}),n=Dr(r);return e.vars.push(...n),new un(r)}catch(e){return void r(X(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>dn(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=dn(t[i],e,r);return n}}var n;return t}function vn(t,e,r){if(t){if(t instanceof un)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>vn(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=vn(t[i],e,r);return n}}return t}function pn(t,e){const r={vars:[],hasExpression:!1},n=dn(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>vn(n,t,e)}}const gn={pagers:function(){return U(new Map)}},hn=new Map,fn=new Map;function mn(t){const e=hn.get(t)||U("");return hn.has(t)||hn.set(t,e),e}function yn(t){const e=fn.get(t)||new Map;return fn.has(t)||fn.set(t,e),e}class bn{setVariable(t){const e=t.getName(),r=yn(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),mn(this).set(e)}getVariable(t){return yn(this).get(t)}}function _n(){return new bn}function wn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const $n=new Set(["start","stop","pause","resume","cancel","reset"]);class xn{constructor(t){wn(this,"timers",new Map),wn(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(X(new Error("Misconfigured timer"),{additional:{id:t.id}})):this.logError(X(new Error("Missing timer id")))}execTimerAction(t,e){if(!(t&&e&&this.timers.has(t)&&$n.has(e)))return void this.logError(X(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"))}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),this.stop(t)}),Math.max(0,e-(t.durationPassed||0))));const r=t.tick;if(r){const e=()=>{t.tickStarted=performance.now(),t.tickTimeout=window.setTimeout((()=>{this.tickOrUnholdAction(t),t.tickPassed=0,e()}),Math.max(0,r-(t.tickPassed||0)))};e()}}start(t){if("running"===t.state)return void this.logError(X(new Error("The timer is already running")));if("paused"===t.state)return void this.logError(X(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)),this.startOrResume(t)):this.logError(X(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(X(new Error("The timer has already been stopped")))}pause(t){if("stopped"===t.state)return void this.logError(X(new Error("The timer has already been stopped")));if("paused"===t.state)return void this.logError(X(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(X(new Error("The timer is already running"))):this.logError(X(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,!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)}}}const kn=I(((t,e,r,n)=>{let i,o;var s,l,c,v;let{id:p}=e,{json:g={}}=e,{platform:h="auto"}=e,{theme:f="system"}=e,{globalVariablesController:m=new bn}=e,{mix:y=""}=e,{customization:_={}}=e,{builtinProtocols:w=["http","https","tel","mailto","intent"]}=e,{onError:$}=e,{onStat:x}=e,{onCustomAction:k}=e,{onComponent:E}=e,C=U("desktop"===h);if(o=a(C,(t=>i=t)),"auto"===h&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");C.set(!t.matches),t.addListener((()=>{C.set(!t.matches)}))}let F="light",A=null;function V(t){f=t}const P=new Set(w);let S=!1;g||(S=!0,G(X(new Error('"json" prop is required')))),p||(S=!0,G(X(new Error('"id" prop is required'))));let D=function(t){if(!t)return X(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return X(new Error("Missing card"));if(!e.states||!e.states.length)return X(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in or)return X(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return X(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return X(new Error("Missing state_id"),{additional:{index:t}})}return null}(g);const z=g.templates||{};D&&(S=!0,G(D));const T={stateChange:!1},O=mn(m),I=yn(m),J=new Map,N=new Map,B=new Map;let R=null;function L(t,e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e){const r=N.get(t);r&&r.setValue(e)}}function q(t){const e=N.get(t);return null==e?void 0:e.getValue()}function H(t){const e=pn(t,G);return e.vars.length?e.applyVars(N):t}function G(t){$?$({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function Z(t,e){x&&x({type:t,action:e})}let K=0;function Q(t){return`${p}-${K++}`}let tt={},et={};function rt(t){const e=t.url?String(t.url):"";if(e)try{const t=e.replace(/div-action:\/\//,""),r=/([^?]+)\?(.+)/.exec(t);if(!r)return;const n=new URLSearchParams(r[2]);switch(r[1]){case"set_state":!function(t){if(!t)throw new Error("Missing state id");let e=ut,r=t.split("/");if(r=["root",...r],r.length<2||r.length%2!=0)throw new Error("Incorrect state id format");for(let t=0;t<r.length;t+=2){const n=r[t],i=r[t+1];let o=e.getChild(n);if(!o)return;o.setState(i),e=o}}(n.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(isNaN(Number(e)))throw new Error('Incorrect item for "set-current-item" action');const r=at(t);r&&r.setCurrentItem(Number(e))}(n.get("id"),n.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=at(t);r&&r.setPreviousItem(e)}(n.get("id"),n.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=at(t);r&&r.setNextItem(e)}(n.get("id"),n.get("overflow"));break;case"set_variable":const r=n.get("name"),i=n.get("value");if(r&&null!==i){const t=N.get(r);t?t.set(i):G(X(new Error("Cannot find variable"),{additional:{name:r}}))}else G(X(new Error("Incorrect set_variable_action"),{additional:{url:t}}));break;case"timer":const o=n.get("action"),a=n.get("id");R?R.execTimerAction(a,o):G(X(new Error("Incorrect timer action"),{additional:{id:a,action:o}}));break;default:G(X(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){G(X(t,{additional:{url:e}}))}}async function nt(t,e){if(t){for(let r=0;r<t.length;++r){let n=t[r];const i=n.url;if(i){const t=pt(i);if(t)if(gt(t,P)){if(e)if("_blank"===n.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=i)}else location.href=i}else"div-action"===t?(rt(n),await b()):n.log_id&&(it(n),await b())}}t.forEach((t=>{t.log_id&&Z("click",t)}))}}function it(t){null==k||k(t)}const ot=new Map;function at(t){if(ot.has(t))return ot.get(t);G(X(new Error("Missing instance with id"),{additional:{id:t}}))}const lt=new Map;function ct(t){for(const e of t)N.has(e)&&t.delete(e);return t}d(Y,{logError:G,logStat:Z,hasTemplate:function(t){return t in z},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in z;){if(({json:t,templateContext:e}=cr(t,e,z,G)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:Q,genClass:function(t){return`divkit-${Q()}`},execAction:rt,execAnyActions:nt,execCustomAction:it,isRunning:function(t){return T[t]},setRunning:function(t,e){T[t]=e},registerInstance:function(t,e){ot.has(t)?G(X(new Error("Duplicate instance id"),{additional:{id:t}})):ot.set(t,e)},unregisterInstance:function(t){ot.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(et[r]=et[r]||0,++et[r],tt[r])return tt[r];const n=`${Q()}-svg-filter`;return tt=Object.assign(Object.assign({},tt),{[r]:n}),n},removeSvgFilter:function(t,e){t&&et[t]&&0==--et[`${t}:${e}`]&&(tt=Object.keys(tt).reduce(((t,e)=>(et[e]&&(t[e]=tt[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return dr(t);const e=pn(t,G);return e.vars.length?W(e.vars.map((t=>N.get(t)||function(t){const e=B.get(t)||U(void 0);return B.has(t)||B.set(t,e),e}(t))).filter(st),(()=>e.applyVars(N))):e.hasExpression?dr(e.applyVars(N)):dr(t)},getJsonWithVars:H,getStore:function(t){return lt.has(t)||function(t){lt.has(t)||lt.set(t,gn[t]())}(t),lt.get(t)},getVariable:function(t,e){const r=N.get(t);if(r){const n=r.getType();if(n!==e)return void G(X(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:n}}))}return r},getCustomization:function(t){return null==_?void 0:_[t]},getBuiltinProtocols:function(){return P},isDesktop:C,registerComponent:void 0,unregisterComponent:void 0}),d(Pt,{hasAction:()=>!1});const ut={setState(t){throw new Error("Not implemented")},getChild(t){if(dt&&dt.has(t))return dt.get(t);G(X(new Error("Missing state block with id"),{additional:{id:t}}))}};let dt=null;d(mt,{registerInstance(t,e){dt||(dt=new Map),dt.has(t)?G(X(new Error("Duplicate state with id"),{additional:{id:t}})):dt.set(t,e)},unregisterInstance(t){null==dt||dt.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 vt=null===(s=null==g?void 0:g.card)||void 0===s?void 0:s.variables;Array.isArray(vt)&&vt.forEach((t=>{if(t&&t.type in tr&&t.name){if(J.has(t.name))return void G(X(new Error("Duplicate variable"),{additional:{name:t.name}}));try{const e=er(t.name,t.type,t.value);J.set(t.name,e),N.set(t.name,e)}catch(e){G(X(e,{additional:{name:t.name}}))}}}));const ht=g.palette;ht&&ht[F].forEach((t=>{if(J.has(t.name))G(X(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=er(t.name,"color",t.color);J.set(t.name,e),N.set(t.name,e)}catch(e){G(X(e,{additional:{name:t.name}}))}}));for(const[t,e]of I)N.has(t)||N.set(t,e);O.subscribe((t=>{if(t&&!N.has(t)){const e=I.get(t);N.set(t,e);const r=B.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const ft=null===(l=null==g?void 0:g.card)||void 0===l?void 0:l.variable_triggers;Array.isArray(ft)&&ft.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void G(X(new Error("variable_trigger has a condition that is not a string"),{additional:{condition:t.condition}}));const r=t.mode||"on_condition";if("on_variable"===r||"on_condition"===r)try{const n=br(t.condition,{startRule:"JsonStringContents"}),i=Dr(n);if(!i.length)return void G(X(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return ct(e),e.size?new Promise((t=>{const r=O.subscribe((()=>{ct(e),e.size||(r(),t())}))})):Promise.resolve()})(i).then((()=>{W(i.map((t=>N.get(t))).filter(st),(()=>cn(N,n))).subscribe((n=>{"error"!==n.type?(n.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=H(t);e.log_id&&rt(e)})),e=Boolean(n.value)):G(X(new Error("variable_trigger condition execution error"),{additional:{message:n.value}}))}))}))}catch(e){G(X(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else G(X(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));const yt=null===(c=null==g?void 0:g.card)||void 0===c?void 0:c.timers;if(yt){const t=R=new xn({logError:G,applyVars:H,hasVariableWithType:function(t,e){const r=N.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=N.get(t);r?r.setValue(e):G(X(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:nt});yt.forEach((e=>t.createTimer(e)))}const bt=null===(v=null==g?void 0:g.card)||void 0===v?void 0:v.states,_t=bt&&!S?{type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:bt.map((t=>({state_id:t.state_id.toString(),div:t.div})))}:void 0;return u((()=>{R&&R.destroy()})),void 0===e.id&&r.id&&void 0!==p&&r.id(p),void 0===e.json&&r.json&&void 0!==g&&r.json(g),void 0===e.platform&&r.platform&&void 0!==h&&r.platform(h),void 0===e.theme&&r.theme&&void 0!==f&&r.theme(f),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==m&&r.globalVariablesController(m),void 0===e.mix&&r.mix&&void 0!==y&&r.mix(y),void 0===e.customization&&r.customization&&void 0!==_&&r.customization(_),void 0===e.builtinProtocols&&r.builtinProtocols&&void 0!==w&&r.builtinProtocols(w),void 0===e.onError&&r.onError&&void 0!==$&&r.onError($),void 0===e.onStat&&r.onStat&&void 0!==x&&r.onStat(x),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==k&&r.onCustomAction(k),void 0===e.onComponent&&r.onComponent&&void 0!==E&&r.onComponent(E),void 0===e.setTheme&&r.setTheme&&void 0!==V&&r.setTheme(V),void 0===e.setVariable&&r.setVariable&&void 0!==L&&r.setVariable(L),void 0===e.getVariable&&r.getVariable&&void 0!==q&&r.getVariable(q),void 0===e.execAction&&r.execAction&&void 0!==rt&&r.execAction(rt),"light"===f||"dark"===f?F=f:"system"===f?"undefined"!=typeof matchMedia?(A||(A=matchMedia("(prefers-color-scheme: dark)"),A.addListener((function(){"system"===f&&A&&(F=A.matches?"dark":"light")}))),F=A.matches?"dark":"light"):F="light":G(X(new Error("Unsupported theme"))),F&&(ht&&ht[F].forEach((t=>{const e=N.get(t.name);e&&e.setValue(t.color)}))),o(),!S&&_t?`<div class="${j("divkit-b023c",!0)+j(i?" divkit-ee112":"",!0)+j(y?` ${y}`:"",!0)}">${M(lr,"RootSvgFilters").$$render(t,{svgFiltersMap:tt},{},{})}\n ${M(sr,"Unknown").$$render(t,{div:_t,templateContext:{}},{},{})}</div>`:""})),En=kn;function Cn(t){return En.render({id:t.id,json:t.json,globalVariablesController:t.globalVariablesController,mix:t.mix,customization:t.customization,builtinProtocols:t.builtinProtocols,onError:t.onError,platform:t.platform}).html}var Fn=exports;for(var An in e)Fn[An]=e[An];e.__esModule&&Object.defineProperty(Fn,"__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={};function r(){}function n(t){return t()}function i(t){t.forEach(n)}function o(t){return"function"==typeof t}function a(t,...e){if(null==t)return r;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}let s;function l(t){s=t}function u(){if(!s)throw new Error("Function called outside component initialization");return s}function c(t){u().$$.on_destroy.push(t)}function d(t,e){return u().$$.context.set(t,e),e}function v(t){return u().$$.context.get(t)}t.r(e),t.d(e,{createGlobalVariablesController:()=>En,createVariable:()=>er,render:()=>Sn}),new Set,new Map;const p=[],g=[],h=[],f=[],m=Promise.resolve();let y=!1;function _(){return y||(y=!0,m.then(x)),m}function b(t){h.push(t)}const w=new Set;let $=0;function x(){const t=s;do{for(;$<p.length;){const t=p[$];$++,l(t),k(t.$$)}for(l(null),p.length=0,$=0;g.length;)g.pop()();for(let t=0;t<h.length;t+=1){const e=h[t];w.has(e)||(w.add(e),e())}h.length=0}while(p.length);for(;f.length;)f.pop()();y=!1,w.clear(),l(t)}function k(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(b)}}new Set,"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;const E=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),C=/[\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 F(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=N(n):r.style=N(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(C.test(t))return;const e=r[t];!0===e?n+=" "+t:E.has(t.toLowerCase())?e&&(n+=" "+t):null!=e&&(n+=` ${t}="${e}"`)})),n}const A=/[&"]/g,V=/[&<]/g;function j(t,e=!1){const r=String(t),n=e?A:V;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 S(t){return"string"==typeof t||t&&"object"==typeof t?j(t,!0):t}function P(t){const e={};for(const r in t)e[r]=S(t[r]);return e}function D(t,e){let r="";for(let n=0;n<t.length;n+=1)r+=e(t[n],n);return r}const z={$$render:()=>""};function M(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`);return t}let T,I;function O(t){function e(e,r,n,i,o){const a=s;l({$$:{on_destroy:T,context:new Map(o||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const u=t(e,r,n,i);return l(a),u}return{render:(t={},{$$slots:r={},context:n=new Map}={})=>{T=[];const o={title:"",head:"",css:new Set},a=e(o,t,{},r,n);return i(T),{html:a,css:{code:Array.from(o.css).map((t=>t.code)).join("\n"),map:null},head:o.title+o.head}},$$render:e}}function J(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${j(e,!0)}"`}`}function N(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${t[e]};`)).join(" ")}function B(t){const e=N(t);return e?` style="${e}"`:""}"function"==typeof HTMLElement&&(I=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(o);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,r){this[t]=r}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){(function(t,e){const r=t.$$;null!==r.fragment&&(i(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])})(this,1),this.$destroy=r}$on(t,e){const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(e),()=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});const R=[];function U(t,e=r){let n;const i=new Set;function o(e){if(o=e,((r=t)!=r?o==o:r!==o||r&&"object"==typeof r||"function"==typeof r)&&(t=e,n)){const e=!R.length;for(const e of i)e[1](),R.push(e,t);if(e){for(let t=0;t<R.length;t+=2)R[t][0](R[t+1]);R.length=0}}var r,o}return{set:o,update:function(e){o(e(t))},subscribe:function(a,s=r){const l=[a,s];return i.add(l),1===i.size&&(n=e(o)||r),a(t),()=>{i.delete(l),0===i.size&&(n(),n=null)}}}}function L(t,e,n){const s=!Array.isArray(t),l=s?[t]:t,u=e.length<2;return c=t=>{let n=!1;const c=[];let d=0,v=r;const p=()=>{if(d)return;v();const n=e(s?c[0]:c,t);u?t(n):v=o(n)?n:r},g=l.map(((t,e)=>a(t,(t=>{c[e]=t,d&=~(1<<e),n&&p()}),(()=>{d|=1<<e}))));return n=!0,p(),function(){i(g),v()}},{subscribe:U(n,c).subscribe};var c}const W="divkit-bd259",q="divkit-d9099",H="divkit-c016b",G="divkit-aa145",Z="divkit-f0cba",Y=Symbol("root");function X(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const K={text:"divkit-d9b0e",text_halign_left:"divkit-a4cb7",text_halign_center:"divkit-e1659",text_halign_right:"divkit-ea280",text_valign_top:"divkit-d8ce0",text_valign_center:"divkit-ef58e",text_valign_bottom:"divkit-fe8ed",text_valign_baseline:"divkit-e0c6c",text__inner:"divkit-b8528",text_singleline:"divkit-ef11c",text_truncate_none:"divkit-c6ea1",text_multiline:"divkit-ee8e3",text__inner_gradient:"divkit-cb8e0",text__image:"divkit-bf6e2",text__image_hidden:"divkit-f1002"},Q={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_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"};function tt(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 et(t){if("number"!=typeof t&&"string"!=typeof t||!t)return"0";const e=Number(t);return isNaN(e)?"0":Math.ceil(1e3*e)/1e4+"em"}function rt(t){let e=et(t);return"0"===e&&(e+="em"),e}function nt(t,e){for(;t.length<e;)t="0"+t;return t}function it(t,e=1,r="transparent"){if("#"!==(t=(t||"").toLowerCase()).charAt(0))return r;const n=ot(t);return n?(n.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>nt(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(n)):r}function ot(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,u=2===r.length?r:r+r;return{a:parseInt(u,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 at(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 st=Boolean;function lt(t){if(1===t.length&&"solid"===t[0].type)return{color:it(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=it(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(st);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>it(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:dt(t.bg.scale),pos:vt(t.bg),image:'url("'+at(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(st);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=rt(n.value):"relative"===n.type&&(i=ut[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${i||"farthest-corner"} at ${ct(t.bg.center_x)} ${ct(t.bg.center_y)},`+r.map((t=>it(t))).join(",")+")"}}({bg:t}):void 0)).filter(st).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 ut={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function ct(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return rt(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function dt(t){return"fill"!==t&&t?"fit"===t?"contain":void 0:"cover"}function vt(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 pt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}function gt(t,e){return e.has(t)}function ht(t,e){e&&t.push(e)}function ft(t,e,r){const n=[];ht(n,e[t]);for(const i in r)if(r.hasOwnProperty(i)){const o=r[i];o&&ht(n,e[`${t}_${i}`+("string"==typeof o?`_${o}`:"")])}return n.join(" ")}const mt=Symbol("state");function yt(t){return et(t.top||0)+" "+et(t.right||0)+" "+et(t.bottom||0)+" "+et(t.left||0)}function _t(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function bt(t){return _t(t)&&t>=0}function wt(t,e){if(!t)return e;const r=[t.top,t.right,t.bottom,t.left];for(let t=0;t<r.length;++t)if(r[t]&&!bt(r[t]))return e;return yt(t)}function $t(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const xt=Object.prototype.hasOwnProperty;function kt(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(!xt.call(e,i)||!kt(t[i],e[i]))return!1}return!0}function Et(t,e){return kt(t,e)?e:t}function Ct(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function Ft(t,e){const r=Number(t);return isNaN(r)?e:r}function At(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...At(t))})):e.push(t),e}function Vt(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>et((t||e)/r*10))).join(" ")}function jt(){}const St=Symbol("action"),Pt=O(((t,e,r,n)=>{let{actions:i}=e,{doubleTapActions:o}=e,{longTapActions:a}=e,{cls:s=""}=e,{style:l=null}=e,{attrs:u}=e,{use:c=jt}=e,{customAction:p=null}=e,{isNativeActionAnimation:g=!0}=e;const h=v(Y),f=v(St);d(St,{hasAction:()=>Boolean(f.hasAction()||(null==i?void 0:i.length))});let m,y="";if(Array.isArray(i)&&(null==i?void 0:i.length))for(let t=0;t<i.length;++t){const e=i[t].url;if(e){y=e,m=i[t].target||void 0;break}}Array.isArray(i)&&(null==i?void 0:i.length)&&f.hasAction()&&(y="",h.logError(X(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:i}})));let _=Boolean(p);return y&&!gt(pt(y),h.getBuiltinProtocols())&&(y="",_=!0),void 0===e.actions&&r.actions&&void 0!==i&&r.actions(i),void 0===e.doubleTapActions&&r.doubleTapActions&&void 0!==o&&r.doubleTapActions(o),void 0===e.longTapActions&&r.longTapActions&&void 0!==a&&r.longTapActions(a),void 0===e.cls&&r.cls&&void 0!==s&&r.cls(s),void 0===e.style&&r.style&&void 0!==l&&r.style(l),void 0===e.attrs&&r.attrs&&void 0!==u&&r.attrs(u),void 0===e.use&&r.use&&void 0!==c&&r.use(c),void 0===e.customAction&&r.customAction&&void 0!==p&&r.customAction(p),void 0===e.isNativeActionAnimation&&r.isNativeActionAnimation&&void 0!==g&&r.isNativeActionAnimation(g),y?`<a${F([{href:S(y)},{target:S(m)},{style:S(l)},{class:j(s,!0)+" "+j(g?W:q,!0)+" "+j(null!=a&&a.length?Z:"",!0)},P(u)],{})}>${n.default?n.default({}):""}</a>`:`<span${F([{class:j(s,!0)+j(_?` ${g?W:q} divkit-c016b`:"",!0)+" "+j(null!=a&&a.length?Z:"",!0)},{style:S(l)},{role:S(_?"button":null)},{tabindex:S(_?0:null)},P(u)],{})}>${n.default?n.default({}):""}</span>`})),Dt=Pt,zt="divkit-b921d";function Mt(t){return _t(t)&&t>0}function Tt(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(Mt(t.radius))return`blur(${rt(t.radius/2)})`}else e(X(new Error("Unknown filter"),{level:"warn",additional:{filter:null==t?void 0:t.type}}))})).filter(Boolean).join(" ")}const It=O(((t,e,r,n)=>{let i,{background:o=[]}=e,{radius:a=""}=e;const s=v(Y);return void 0===e.background&&r.background&&void 0!==o&&r.background(o),void 0===e.radius&&r.radius&&void 0!==a&&r.radius(a),i=o.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=lt([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=Tt(t.filters,s.logError)))}return r})),`<span${J("class","divkit-bf253"+(a?" divkit-dcad7":""),0)}${B({"border-radius":a})}>${D(i,(t=>t.image_url?`<img${J("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${J("class",zt,0)}${J("style",tt(t.style),0)}>`:`<span${J("class",zt,0)}${J("style",tt(t.style),0)}></span>`))}</span>`})),Ot=It,Jt=O(((t,e,n,i)=>{let o,s,l,u,c,d,p,g,h,f,m,y,b,w,$,x,k,E,C,F,A,V,j,S,P,D,z,T,I,O,N,B,R,U,L,W,q,H,G,Z,K,nt=r,ot=r,at=r,st=r,ut=r,ct=r,dt=r,vt=r,ht=r,_t=r,xt=r,kt=r,jt=r,St=r,Pt=r,zt=r,Mt=r;var Tt,It,Jt,Nt,Bt,Rt;let{json:Ut={}}=e,{origJson:Lt}=e,{templateContext:Wt}=e,{cls:qt=""}=e,{style:Ht}=e,{layoutParams:Gt={}}=e,{customDescription:Zt=!1}=e,{customPaddings:Yt=!1}=e,{customActions:Xt=""}=e,{additionalPaddings:Kt=null}=e;const Qt={left:"start",center:"center",right:"end"},te={top:"start",center:"center",bottom:"end",baseline:"baseline"},ee=v(Y),re=v(mt);let ne,ie,oe,ae,se,le,ue,ce,de,ve,pe,ge={},he={},fe=!1,me=1,ye="transparent",_e=0,be={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},we="",$e=null,xe="",ke={},Ee=0,Ce=0,Fe=0,Ae=!1,Ve=!1,je={},Se=0,Pe=0,De=0,ze=!1,Me=!1,Te=1;const Ie=Gt.fakeElement?[]:Ut.transition_triggers||["state_change","visibility_change"],Oe=-1!==Ie.indexOf("state_change")&&Ut.id,Je=-1!==Ie.indexOf("visibility_change")&&Ut.id;let Ne,Be,Re,Ue,Le,We,qe,He,Ge,Ze=[],Ye=[],Xe=[],Ke=[],Qe="",tr=!1,er="visible",rr=0,nr=0;void 0===e.json&&n.json&&void 0!==Ut&&n.json(Ut),void 0===e.origJson&&n.origJson&&void 0!==Lt&&n.origJson(Lt),void 0===e.templateContext&&n.templateContext&&void 0!==Wt&&n.templateContext(Wt),void 0===e.cls&&n.cls&&void 0!==qt&&n.cls(qt),void 0===e.style&&n.style&&void 0!==Ht&&n.style(Ht),void 0===e.layoutParams&&n.layoutParams&&void 0!==Gt&&n.layoutParams(Gt),void 0===e.customDescription&&n.customDescription&&void 0!==Zt&&n.customDescription(Zt),void 0===e.customPaddings&&n.customPaddings&&void 0!==Yt&&n.customPaddings(Yt),void 0===e.customActions&&n.customActions&&void 0!==Xt&&n.customActions(Xt),void 0===e.additionalPaddings&&n.additionalPaddings&&void 0!==Kt&&n.additionalPaddings(Kt),o=ee.getDerivedFromVars(Ut.border),Mt(),Mt=a(o,(t=>K=t));{let t={},e={},r=!1,n="";if(K){if(K.has_shadow){const e=K.shadow;t["box-shadow"]=e?et((null===(It=null===(Tt=e.offset)||void 0===Tt?void 0:Tt.x)||void 0===It?void 0:It.value)||0)+" "+et((null===(Nt=null===(Jt=e.offset)||void 0===Jt?void 0:Jt.y)||void 0===Nt?void 0:Nt.value)||0)+" "+et(null!==(Bt=e.blur)&&void 0!==Bt?Bt:2)+" "+it(e.color||"#000000",null!==(Rt=e.alpha)&&void 0!==Rt?Rt:.19):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}if(K.stroke&&(r=!0,me=$t(K.stroke.width,me),ye=it(K.stroke.color,1,ye),e.border=`${et(me)} solid ${ye}`),K.corners_radius?(be=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]&&!bt(r[t]))return e;return t}(K.corners_radius,be),e["border-radius"]=t["border-radius"]=Vt(be)):K.corner_radius&&(_e=$t(K.corner_radius,_e),be={"top-left":_e,"top-right":_e,"bottom-right":_e,"bottom-left":_e},e["border-radius"]=t["border-radius"]=et(_e)),r&&me&&(K.corners_radius||K.corner_radius)){let t=Object.assign({},be);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+me/2})),n=Vt(t)}}ge=Et(t,ge),he=Et(e,he),fe=r,we=n}s=ee.getDerivedFromVars(Ut.paddings),zt(),zt=a(s,(t=>Z=t)),$e=function(t,e){if(!t)return e;const r=["top","right","bottom","left"];for(let n=0;n<r.length;++n)if(t[r[n]]&&!bt(t[r[n]]))return e;return t}(Z&&!Yt?Z:void 0,$e),l=yt(function(t,e){if(!t&&!e)return{};if(!e)return t;if(!t)return e;const r={};return["top","right","bottom","left"].forEach((n=>{const i=t[n];i&&(r[n]=i);const o=e[n];o&&(r[n]=(r[n]||0)+o)})),r}($e,Kt)),u=ee.getDerivedFromVars(Ut.margins),St(),St=a(u,(t=>H=t)),xe=wt(H,xe),c=ee.getDerivedFromVars(Ut.width),kt(),kt=a(c,(t=>W=t)),d=ee.getDerivedFromVars(Ut.alignment_horizontal),Pt(),Pt=a(d,(t=>G=t));{let t,e,r,n,i={},o=0,a=0,s=!1,l=!1;const u=null==W?void 0:W.type;if("fixed"===u)Ee=$t(null==W?void 0:W.value,Ee),e=et(Ee);else if("wrap_content"===u||!Gt.overlapParent&&"match_parent"===u&&Gt.parentHorizontalWrapContent){if(t="content",("wrap_content"===u&&(null==W?void 0:W.constrained)||"match_parent"===u&&Gt.parentHorizontalWrapContent)&&(i["width-constrained"]=!0,a=1),"wrap_content"===u){const t=W;t.min_size&&bt(t.min_size.value)&&(r=et(t.min_size.value)),t.max_size&&bt(t.max_size.value)&&(n=et(t.max_size.value))}"match_parent"===u&&ee.logError(X(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","vertical"===Gt.parentContainerOrientation&&Gt.parentContainerWrap&&(l=!0,ee.logError(X(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===Gt.parentLayoutOrientation?e=`calc(100% - ${rt(((null==H?void 0:H.left)||0)+((null==H?void 0:H.right)||0))})`:"horizontal"===Gt.parentContainerOrientation&&(o=W&&"weight"in W&&W.weight||1,Gt.parentContainerWrap&&(s=!0));if("parent"===t)i["halign-self"]="stretch";else{const t=G;i["halign-self"]="left"===t||"center"===t||"right"===t?Qt[t]:Gt.parentHAlign||"start"}t&&(i.width=t),oe=e,ae=r,se=n,Ce=o,Fe=a,ke=Et(i,ke),Ae=s,Ve=l}p=ee.getDerivedFromVars(Ut.height),xt(),xt=a(p,(t=>L=t)),g=ee.getDerivedFromVars(Ut.alignment_vertical),jt(),jt=a(g,(t=>q=t));{let t,e,r,n,i={},o=0,a=0,s=!1,l=!1;const u=null==L?void 0:L.type;if("fixed"===u)Se=$t(null==L?void 0:L.value,Se),e=et(Se);else if("match_parent"!==u||!Gt.overlapParent&&Gt.parentVerticalWrapContent){if(t="content",("wrap_content"===u&&(null==L?void 0:L.constrained)||"match_parent"===u&&Gt.parentVerticalWrapContent)&&(i["height-constrained"]=!0,a=1),"wrap_content"===u){const t=L;(null==t?void 0:t.min_size)&&bt(t.min_size.value)&&(r=et(t.min_size.value)),(null==t?void 0:t.max_size)&&bt(t.max_size.value)&&(n=et(t.max_size.value))}"match_parent"===u&&ee.logError(X(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","horizontal"===Gt.parentContainerOrientation&&Gt.parentContainerWrap&&(l=!0,ee.logError(X(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===Gt.parentLayoutOrientation?e=`calc(100% - ${rt(((null==H?void 0:H.top)||0)+((null==H?void 0:H.bottom)||0))})`:"vertical"===Gt.parentContainerOrientation&&(o=(null==L?void 0:L.weight)||1,Gt.parentContainerWrap&&(s=!0));if("parent"===t)i["valign-self"]="stretch";else{const t=q;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===Gt.parentContainerOrientation?i["valign-self"]=te[t]:i["valign-self"]=Gt.parentVAlign||"start"}t&&(i.height=t),le=e,ue=r,ce=n,Pe=o,De=a,je=Et(i,je),ze=s,Me=l}var ir,or,ar;if(h=!!Gt.overlapParent||void 0,f=Gt.overlapParent&&(!W||"match_parent"===W.type)&&"match_parent"===(null==L?void 0:L.type),m=Gt.gridArea?`${Gt.gridArea.y+1}/${Gt.gridArea.x+1}/span ${Gt.gridArea.rowSpan}/span ${Gt.gridArea.colSpan}`:void 0,y=ee.getDerivedFromVars(Ut.alpha),_t(),_t=a(y,(t=>U=t)),or=Te,Te=!bt(ir=U)||void 0===ir||ir>1?or:Number(ir),de=1===Te?void 0:Te,b=ee.getDerivedFromVars(Ut.accessibility),ht(),ht=a(b,(t=>R=t)),ie=void 0,R&&!Zt&&R.description&&(ie={},ie["aria-label"]=R.description),w=ee.getDerivedFromVars(Ut.background),vt(),vt=a(w,(t=>B=t)),ve={},pe=!1,B&&(pe=B.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(we),!pe)){const t=lt(B);ve["background-color"]=t.color,ve["background-image"]=t.image,ve["background-size"]=t.size,ve["background-position"]=t.position,ve["background-repeat"]="no-repeat"}Ne=void 0,Oe&&Ut.transition_in&&ee.isRunning("stateChange")&&(Ne=!0),Re=void 0,Oe&&Ut.transition_change&&ee.isRunning("stateChange")&&re.hasTransitionChange(Ut.id)&&(Re=!0),$=ee.getDerivedFromVars(Ut.action),ct(),ct=a($,(t=>O=t)),x=ee.getDerivedFromVars(Ut.actions),dt(),dt=a(x,(t=>N=t)),k=ee.getDerivedFromVars(Ut.doubletap_actions),ut(),ut=a(k,(t=>I=t)),E=ee.getDerivedFromVars(Ut.longtap_actions),st(),st=a(E,(t=>T=t));{let t=N||O&&[O]||[],e=I||[],r=T||[];Gt.fakeElement?(t=[],e=[],r=[]):(Array.isArray(t)||(t=[],ee.logError(X(new Error("Actions should be array")))),Array.isArray(e)||(e=[],ee.logError(X(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],ee.logError(X(new Error("LongTapActions should be array"))))),(t.length||e.length||r.length)&&Xt&&(t=[],e=[],r=[],ee.logError(X(new Error(`Cannot use action on component "${Xt}"`)))),Ze=t,Ye=e,Xe=r}C=ee.getDerivedFromVars(Ut.action_animation),at(),at=a(C,(t=>z=t)),z&&(Ke=At(z),Qe=Ke.map((function(t){const e=Ft(t.start_value,1),r=Ft(t.end_value,1),n=$t(t.start_delay,0),i=$t(t.duration,300),o=Ct(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return Ue=e,Le=r,`opacity ${i}ms ${o} ${n}ms`;case"scale":return We=e,qe=r,`transform ${i}ms ${o} ${n}ms`;case"native":case"no_animation":return"";default:return ee.logError(X(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", ")),F=ee.getDerivedFromVars(Ut.visibility),ot(),ot=a(F,(t=>D=t));{const t=er,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(D,er);t!==e&&(!tr||"visible"!==er&&"visible"!==e?er=e:async function(t){er=t;const e="visible"===t?"in":"out",r="in"===e?Ut.transition_in:Ut.transition_out;Je&&r&&(await _(),"in"===e&&(Be=!0),re.runVisibilityTransition(Object.assign(Object.assign({},Ut),{visibility:"visible"}),Wt,r,ne,e).then((()=>{"in"===e&&(Be=!1)})).catch((t=>{throw"in"===e&&(Be=!1),t})))}(e)),tr||(tr=!0)}if(A=Object.assign(Object.assign(Object.assign({},ke),je),{"parent-overlap":h,"parent-overlap-absolute":f,"scroll-snap":Gt.scrollSnap,"hide-on-transition-in":Ne||Be||Re,visibility:er,"has-action-animation":Boolean(Qe),"parent-flex":Gt.parentContainerOrientation||void 0}),V=ee.getDerivedFromVars(Ut.transform),nt(),nt=a(V,(t=>P=t)),P&&void 0!==P.rotation){const t=P.pivot_x||{type:"pivot-percentage",value:50};rr=Ft(t.value,rr);const e="pivot-fixed"===t.type?et(rr):`${rr}%`,r=P.pivot_y||{type:"pivot-percentage",value:50};nr=Ft(r.value,nr),He=`${e} ${"pivot-fixed"===r.type?et(nr):`${nr}%`}`,Ge=`rotate(${P.rotation}deg)`}return j=Ae||ze?"100%":Ce||Pe?0:void 0,S=Object.assign(Object.assign(Object.assign(Object.assign({},Ht),ve),ge),{width:oe,"min-width":ae,"max-width":se,height:le,"min-height":ue,"max-height":ce||(null==Ht?void 0:Ht["max-height"]),"grid-area":m,padding:l,margin:xe,opacity:de,transition:Qe,"transform-origin":He,transform:Ge,"flex-grow":Ce||Pe||void 0,"flex-shrink":Fe||De?1:void 0,"flex-basis":j,"--divkit-animation-opacity-start":Ue,"--divkit-animation-opacity-end":Le,"--divkit-animation-scale-start":We,"--divkit-animation-scale-end":qe}),nt(),ot(),at(),st(),ut(),ct(),dt(),vt(),ht(),_t(),xt(),kt(),jt(),St(),Pt(),zt(),Mt(),Ve||Me?"":`${M(Dt,"Actionable").$$render(t,{use:function(t){ne=t,Oe&&Ut.transition_in&&re.registerChildWithTransitionIn(Ut,Wt,Ut.transition_in,t).then((()=>{Ne=!1})).catch((t=>{throw Ne=!1,t})),Oe&&Ut.transition_out&&re.registerChildWithTransitionOut(Ut,Wt,Ut.transition_out,t),Oe&&Ut.transition_change&&re.registerChildWithTransitionChange(Ut,Wt,Ut.transition_change,t).then((()=>{Re=!1})).catch((t=>{throw Re=!1,t})),function(t,{visibilityActions:e,rootCtx:r}){if(null==e||!e.length)return;const n=e.map((t=>({action:t,visible:!1,count:0,finished:!1}))),i=[...new Set([...e.map((t=>(t.visibility_percentage||50)/100))])];new IntersectionObserver((t=>{t.forEach((t=>{n.forEach((e=>{const n=t.intersectionRatio>=(e.action.visibility_percentage||50)/100;!e.visible&&n?e.finished||(e.timer=setTimeout((()=>{++e.count;const t=0===e.action.log_limit?1/0:e.action.log_limit||1;++e.count>=t&&(e.finished=!0);const n=e.action.url;if(n){const t=pt(n);t&&!gt(t,r.getBuiltinProtocols())&&("div-action"===t?r.execAction(e.action):e.action.log_id&&r.execCustomAction(e.action))}r.logStat("visible",e.action)}),e.action.visibility_duration||800)):n||e.timer&&clearTimeout(e.timer),e.visible=n}))}))}),{threshold:i}).observe(t)}(t,{visibilityActions:Gt.fakeElement?[]:ee.getJsonWithVars(Ut.visibility_actions||Ut.visibility_action&&[Ut.visibility_action]),rootCtx:ee});const e=Ut.id;e&&re.registerChild(e);let r=null;return{destroy(){e&&re.unregisterChild(e),r&&r.destroy()}}},cls:qt+" "+ft("outer",Q,A),style:tt(S),actions:Ze,doubleTapActions:Ye,longTapActions:Xe,attrs:ie,isNativeActionAnimation:!Ke.length||(ar=Ke,ar.some((t=>"native"===t.name)))},{},{default:()=>`${pe?`${M(Ot,"OuterBackground").$$render(t,{background:B,radius:we},{},{})}`:""}${i.default?i.default({}):""}${fe?`<span${J("class",Q.outer__border,0)}${J("style",tt(he),0)}></span>`:""}`})}`})),Nt=Jt,Bt={"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 Rt(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function Ut(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function Lt(t,e){return Ut(t)||e}const Wt=O(((t,e,r,n)=>{let i,o,a,s,l;var u,c;let d,{text:v}=e,{rootFontSize:p}=e,{textStyles:g={}}=e,{singleline:h=!1}=e,{actions:f}=e,m="none",y=12,_=1.25,b="",w="",$=null;void 0===e.text&&r.text&&void 0!==v&&r.text(v),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==p&&r.rootFontSize(p),void 0===e.textStyles&&r.textStyles&&void 0!==g&&r.textStyles(g),void 0===e.singleline&&r.singleline&&void 0!==h&&r.singleline(h),void 0===e.actions&&r.actions&&void 0!==f&&r.actions(f);{let t="none";(g.underline||g.strike)&&("single"===g.underline&&"single"===g.strike?t="both":"single"===g.underline?t="underline":"single"===g.strike&&(t="strike")),m=t}return y=Rt(g.font_size,y),Mt(g.line_height)&&(_=Number(g.line_height)/y),bt(g.letter_spacing)&&(b=et(g.letter_spacing)),d=Lt(g.font_weight,d),w=it(g.text_color,1,w),i=g.top_offset?et(g.top_offset):"",o=g.background?lt([g.background]):null,$=(null===(u=g.border)||void 0===u?void 0:u.stroke)&&"transparent"!==it(g.border.stroke.color)&&Mt(g.border.stroke.width)?{color:g.border.stroke.color,width:g.border.stroke.width}:null,a=Rt(null===(c=g.border)||void 0===c?void 0:c.corner_radius,0),s={singleline:h,decoration:m},l={"font-size":et(10*y/p),"line-height":_,"letter-spacing":b,"font-weight":d,color:w,background:(null==o?void 0:o.color)||void 0,"box-shadow":$?`inset 0 0 0 ${et($.width)} ${$.color}`:void 0,"border-radius":a?et(a):void 0},`${i?`<span${J("class",Bt["text-range__top-offset"],0)}${B({"margin-top":i})}></span>`:""}${M(Dt,"Actionable").$$render(t,{cls:ft("text-range",Bt,s),actions:f,style:tt(l)},{},{default:()=>`${j(v)}`})}`})),qt=Wt;function Ht(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Gt(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function Zt(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const Yt=O(((t,e,n,i)=>{let o,s,l,u,d,p,g,h,f,m,y,_,b,w,$,x,k,E,C,F,A,V,j,S,P,z,T,I,O,N,B,R,U,L=r,W=r,q=r,G=r,Z=r,Q=r,rt=r,nt=r,ot=r,at=r,st=r,ut=r,ct=r,{json:dt={}}=e,{templateContext:vt}=e,{origJson:pt}=e,{layoutParams:gt}=e;const ht=v(Y);let mt=!1,yt="",_t=12,bt=1.25,wt=!1,$t="",xt="",kt=!1,Et="left",Ct="top",Ft="",At="",Vt=!1,jt=[],St=[];var Pt,Dt;c((()=>{St.forEach((([t,e])=>{ht.removeSvgFilter(t,e)}))})),void 0===e.json&&n.json&&void 0!==dt&&n.json(dt),void 0===e.templateContext&&n.templateContext&&void 0!==vt&&n.templateContext(vt),void 0===e.origJson&&n.origJson&&void 0!==pt&&n.origJson(pt),void 0===e.layoutParams&&n.layoutParams&&void 0!==gt&&n.layoutParams(gt),o=ht.getDerivedFromVars(dt.text),ct(),ct=a(o,(t=>U=t)),Pt=U,Dt=yt,yt=String(null!=Pt?Pt:"")||Dt,yt?mt=!1:(mt=!0,ht.logError(X(new Error('Missing "text" prop for div "text"')))),s=ht.getDerivedFromVars(dt.ranges),W(),W=a(s,(t=>V=t)),l=ht.getDerivedFromVars(dt.images),L(),L=a(l,(t=>A=t)),u=ht.getDerivedFromVars({font_size:dt.font_size,letter_spacing:dt.letter_spacing,font_weight:dt.font_weight,text_color:dt.text_color,underline:dt.underline,strike:dt.strike,line_height:dt.line_height}),q(),q=a(u,(t=>j=t)),d=ht.getDerivedFromVars(dt.font_size),ut(),ut=a(d,(t=>R=t)),_t=Rt(R,_t),p=ht.getDerivedFromVars(dt.line_height),st(),st=a(p,(t=>B=t));{const t=B;Mt(t)?(bt=Number(t)/_t,wt=!0):wt=!1}g=ht.getDerivedFromVars(dt.max_lines),nt(),nt=a(g,(t=>I=t)),h=1===I;{let t="",e="",r=!1;if(I&&I>1){let n=Number(I);t=n*bt+"em",V||A||(e=n,r=!0)}$t=t,xt=e,kt=r}f=ht.getDerivedFromVars(dt.text_alignment_horizontal),at(),at=a(f,(t=>N=t)),Et=Ht(N,Et),m=ht.getDerivedFromVars(dt.text_alignment_vertical),ot(),ot=a(m,(t=>O=t)),Ct=Gt(O,Ct),y=!V||yt&&1===V.length&&V[0]&&0===V[0].start&&"number"==typeof V[0].end&&V[0].end>=yt.length,_=ht.getDerivedFromVars(dt.text_color),rt(),rt=a(_,(t=>T=t)),b=Boolean(T)!==Boolean(V&&V[0]&&V[0].text_color);{let t="";I&&y&&b&&(t=it(T||V&&V[0]&&V[0].text_color,1,Ft)),Ft=t}w=ht.getDerivedFromVars(dt.truncate),Q(),Q=a(w,(t=>z=t)),$="none"===z?"none":"",x=ht.getDerivedFromVars(dt.text_gradient),Z(),Z=a(x,(t=>P=t));{let t="";if(P){const e=lt([P]);e.image&&(t=e.image)}At=t}return k=ht.getDerivedFromVars(dt.selectable),G(),G=a(k,(t=>S=t)),Vt=function(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}(S,Vt),function(t,e,r){let n=[];if(St.forEach((([t,e])=>{ht.removeSvgFilter(t,e)})),St=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(jt=[]);const i=t;let o=e||[{start:0,end:i.length}],a=r||[],s=0,l=[],u=[];o.forEach((t=>{void 0!==t.start&&void 0!==t.end&&(u.push({index:t.start,range:t,type:"rangeStart",isStart:!0}),u.push({index:t.end,range:t,type:"rangeEnd"}))})),a.forEach(((t,e)=>{void 0!==t.start&&t.url&&t.start<=i.length&&u.push({index:t.start,image:t,type:"image",arrayIndex:e})})),u.sort(((t,e)=>t.index===e.index?t.type!==e.type?"image"===t.type?-1:"image"===e.type?1:t.type<e.type?-1:1:"image"===t.type&&"image"===e.type?e.arrayIndex-t.arrayIndex:"rangeStart"===t.type&&"rangeStart"===e.type?t.range.end-e.range.end:"rangeStart"===t.type?1:"rangeStart"===e.type?-1:"image"!==t.type&&"image"!==e.type?t.range.start-e.range.start:0:t.index-e.index)),u.forEach((t=>{var e;let r="image"===t.type?null:t.range,o=t.index;if(o>s){let r=Object.assign(Object.assign({},j),...l);n.push({text:i.substring(s,o),textStyles:r,actions:"rangeEnd"===t.type&&(null===(e=t.range)||void 0===e?void 0:e.actions)||void 0})}if("rangeStart"===t.type&&r)l.push(r);else if("rangeEnd"===t.type)l=l.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},j),...l),r=et(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),i=et(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":et(10*(Number(e.font_size)||12)/_t)};let a="";const s=t.image.tint_color,u=Zt(t.image.tint_mode,"source_in");if(s){const e=it(t.image.tint_color);a=ht.addSvgFilter(e,u),St.push([e,u])}n.push({image:{url:t.image.url,width:r,height:i,wrapperStyle:o,svgFilterId:a}})}s=o})),s<i.length&&n.push({text:i.substring(s),textStyles:Object.assign({},j)}),jt=n}(yt,V,A),E={singleline:h,multiline:kt,halign:Et,valign:Ct,truncate:$},C={gradient:Boolean(At)},F={"font-size":et(_t),"line-height":bt,"max-height":$t,"-webkit-line-clamp":xt,color:Ft,"background-image":At},L(),W(),q(),G(),Z(),Q(),rt(),nt(),ot(),at(),st(),ut(),ct(),mt?"":`${M(Nt,"Outer").$$render(t,{cls:ft("text",K,E)+" "+(Vt?"":H),json:dt,origJson:pt,templateContext:vt,layoutParams:gt},{},{default:()=>`<span${J("class",ft("text__inner",K,C),0)}${J("style",tt(F),0)}>${jt.length?`${D(jt,((e,r)=>"text"in e?e.text?`${M(qt,"TextRangeView").$$render(t,{text:e.text,rootFontSize:_t,textStyles:e.textStyles,singleline:h,actions:e.actions},{},{})}`:"":e.image?`<span${J("style",tt(e.image.wrapperStyle),0)}><img${J("class",K.text__image,0)}${J("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${J("style",tt({width:e.image.width,height:e.image.height,"margin-top":wt?`-${e.image.height}`:void 0,"margin-bottom":wt?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${M(qt,"TextRangeView").$$render(t,{text:yt,rootFontSize:_t,textStyles:j,singleline:h},{},{})}`}</span>`})}`})),Xt=Yt,Kt={container:"divkit-d37d6",container_wrap:"divkit-c8551",container_orientation_vertical:"divkit-ddc33",container_valign_top:"divkit-a331a",container_valign_center:"divkit-aae61",container_valign_bottom:"divkit-c2226",container_orientation_horizontal:"divkit-fe458",container_halign_left:"divkit-a3091",container_halign_center:"divkit-bac9d",container_halign_right:"divkit-f4230",container_orientation_overlap:"divkit-a644d"};function Qt(t,e,r){if(!(t&&t.shape&&t.color&&t.shape.type&&e.includes(t.shape.type)))return r;const n=it(t.color);let i,o,a;if("rounded_rectangle"===t.shape.type){var s,l,u,c;i=Number((null===(s=t.shape.item_width)||void 0===s?void 0:s.value)||10),o=Number((null===(l=t.shape.item_height)||void 0===l?void 0:l.value)||10),a=Number(null!==(u=null===(c=t.shape.corner_radius)||void 0===c?void 0:c.value)&&void 0!==u?u:5)}else{if("circle"!==t.shape.type)return r;var d;i=o=a=2*Number((null===(d=t.shape.radius)||void 0===d?void 0:d.value)||10)}if("shape_drawable"===t.type&&"transparent"!==n){var v,p,g;const e={},r=null!==(v=t.stroke)&&void 0!==v&&v.color?it(t.stroke.color):"",s=null!==(p=t.stroke)&&void 0!==p&&p.width?Number(null!==(g=t.stroke.width)&&void 0!==g?g:1):"";return e.width=i,e.height=o,e.borderRadius=a,e.background=n,r&&s&&(e.boxShadow=`inset 0 0 0 ${et(s)} ${r}`),e}return r}function te(t,e,r){null!=e&&e.show_at_start&&(r?t.top=e.style.height:t.left=e.style.width),null!=e&&e.show_at_end&&(r?t.bottom=e.style.height:t.right=e.style.width)}function ee(t,e,r){let n;return n="horizontal"===t?[null!=r&&r.show_between?r.style.height:0,null!=e&&e.show_between?e.style.width:0]:[null!=e&&e.show_between?e.style.height:0,null!=r&&r.show_between?r.style.width:0],n.map(et).join(" ")}const re="divkit-a7719",ne="divkit-f6e9a";function ie(t,e,r,n,i,o){o?t.push({top:r.bottom,left:i.left,width:i.right-i.left,height:n.top-r.bottom,style:e}):t.push({top:i.top,left:r.right,width:n.left-r.right,height:i.bottom-i.top,style:e})}function oe(t,e,r,n){const i={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)&&ie(t,e.style,{top:0,right:r[0].left-e.style.width,bottom:r[0].top-e.style.height,left:0},r[0],i,n),null==e?void 0:e.show_between)for(let o=0;o<r.length-1;++o)ie(t,e.style,r[o],r[o+1],i,n);if(null==e?void 0:e.show_at_end){const o=r[r.length-1];ie(t,e.style,o,{top:o.bottom+e.style.height,right:0,bottom:0,left:o.right+e.style.width},i,n)}}const ae=O(((t,e,r,n)=>{let i,{orientation:o}=e,{separator:a}=e,{lineSeparator:s}=e;const l=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();d=[];let e=[...i.children].filter((t=>t!==u&&!t.classList.contains(Q.outer__border))),r=[];for(;e.length;){const t=[],n=e.shift();t.push(n);let i=n.getBoundingClientRect(),a=i.right,s=i.bottom;for(;e.length;){let r=e[0],n=r.getBoundingClientRect();if("vertical"===o){if(n.top<s)break}else if(n.left<a)break;a=Math.max(a,n.right),s=Math.max(s,n.bottom),t.push(r),e.shift()}r.push(t)}const n=[];r.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)));a&&oe(d,a,e,"vertical"===o);const r={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)))};n.push(r)})),s&&oe(d,s,n,"horizontal"===o),d.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let u,d=[],v=!1,p=null,g=null;return c((()=>{v=!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),i=null,(v&&i||p||g)&&(p&&(p.disconnect(),p=null),g&&(g.disconnect(),g=null),v&&i&&("undefined"!=typeof MutationObserver&&(p=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(ne))&&!(null==r?void 0:r.contains(re))}))&&l()})),p.observe(i,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(g=new ResizeObserver(l),g.observe(i)))),v&&i&&l(),`\n\n<div${J("class",re,0)}${J("this",u,0)}>${D(d,(t=>`<div${J("class","divkit-c770e",0)}${B({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${J("class",ne,0)}${B({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>\n </div>`))}</div>`}));let se;function le(){if(void 0!==se)return se;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),se=1===t.scrollHeight,document.body.removeChild(t),se}const ue=O(((t,e,n,i)=>{let o,s,l,u,c,d,p,g,h,f,m,y,_,b,w,$,x,k,E,C,F,A,V=r,j=r,S=r,P=r,z=r,T=r,I=r,O=r;var J,N,B,R,U,L;let{json:W={}}=e,{templateContext:q}=e,{origJson:H}=e,{layoutParams:G}=e;const Z={left:"start",center:"center",right:"end"},K={top:"start",center:"center",bottom:"end",baseline:"baseline"},Q=["rounded_rectangle","circle"],tt=v(Y);let et=!1,rt="vertical",nt="top",it="left",ot=null,at=null,st={};if(void 0===e.json&&n.json&&void 0!==W&&n.json(W),void 0===e.templateContext&&n.templateContext&&void 0!==q&&n.templateContext(q),void 0===e.origJson&&n.origJson&&void 0!==H&&n.origJson(H),void 0===e.layoutParams&&n.layoutParams&&void 0!==G&&n.layoutParams(G),o=W.items,(null==o?void 0:o.length)&&Array.isArray(o)?et=!1:(et=!0,tt.logError(X(new Error('Incorrect or empty "items" prop for div "container"')))),s=(!et&&o||[]).map((t=>{let e=t,r=q;return({templateContext:r,json:e}=tt.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=tt.getDerivedFromVars(W.orientation),O(),O=a(l,(t=>A=t)),rt=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(A,rt),u=tt.getDerivedFromVars(W.content_alignment_vertical),I(),I=a(u,(t=>F=t)),nt=Gt(F,nt),c=tt.getDerivedFromVars(W.content_alignment_horizontal),T(),T=a(c,(t=>C=t)),it=Ht(C,it),d=tt.getDerivedFromVars(W.layout_mode),z(),z=a(d,(t=>E=t)),p="wrap"===E,g=tt.getDerivedFromVars(W.separator),P(),P=a(g,(t=>k=t)),(null==k?void 0:k.style)&&"overlap"!==rt&&le()){const t=Qt(k.style,Q,(null==ot?void 0:ot.style)||null);ot=t?{show_at_start:Boolean(null!==(J=k.show_at_start)&&void 0!==J&&J),show_at_end:Boolean(null!==(N=k.show_at_end)&&void 0!==N&&N),show_between:Boolean(null===(B=k.show_between)||void 0===B||B),style:t}:null}else ot=null;if(h=tt.getDerivedFromVars(W.line_separator),S(),S=a(h,(t=>x=t)),(null==x?void 0:x.style)&&"overlap"!==rt&&le()){const t=Qt(x.style,Q,(null==at?void 0:at.style)||null);at=t?{show_at_start:Boolean(null!==(R=x.show_at_start)&&void 0!==R&&R),show_at_end:Boolean(null!==(U=x.show_at_end)&&void 0!==U&&U),show_between:Boolean(null===(L=x.show_between)||void 0===L||L),style:t}:null}else at=null;f=ot||at?function(t,e,r){const n={};return te(n,e,"vertical"===t),te(n,r,"horizontal"===t),n}(rt,ot,at):null,m=tt.getDerivedFromVars(W.width),V(),V=a(m,(t=>w=t)),y=tt.getDerivedFromVars(W.height),j(),j=a(y,(t=>$=t));{let t={};(null==G?void 0:G.fakeElement)&&(t.fakeElement=!0),"overlap"===rt&&(t.overlapParent=!0),"horizontal"!==rt&&(t.parentHAlign=Z[it],(!$||"wrap_content"===$.type||"match_parent"===$.type&&(null==G?void 0:G.parentVerticalWrapContent))&&(t.parentVerticalWrapContent=!0)),"vertical"!==rt&&(t.parentVAlign=K[nt],("wrap_content"===(null==w?void 0:w.type)||"match_parent"===(null==w?void 0:w.type)&&(null==G?void 0:G.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0)),"horizontal"===rt&&(t.parentContainerOrientation="horizontal"),"vertical"===rt&&(t.parentContainerOrientation="vertical"),p&&(t.parentContainerWrap=!0),st=Et(t,st)}return _={orientation:rt,valign:nt,halign:it,wrap:p},b={gap:ot||at?ee(rt,ot,at):void 0},V(),j(),S(),P(),z(),T(),I(),O(),et?"":`${M(Nt,"Outer").$$render(t,{cls:ft("container",Kt,_),style:b,json:W,origJson:H,templateContext:q,layoutParams:G,additionalPaddings:f},{},{default:()=>`${D(s,(e=>`${M(sr,"Unknown").$$render(t,{layoutParams:st,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n\n ${ot||at?`${M(ae,"ContainerSeparators").$$render(t,{separator:ot,lineSeparator:at,orientation:rt},{},{})}`:""}`})}`})),ce=ue,de={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function ve(t,e){return"vertical"===t||"horizontal"===t?t:e}const pe=O(((t,e,n,i)=>{let o,s,l,u,c,d,p,g=r,{json:h={}}=e,{templateContext:f}=e,{origJson:m}=e,{layoutParams:y}=e;const _=v(Y);let b="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&n.json&&void 0!==h&&n.json(h),void 0===e.templateContext&&n.templateContext&&void 0!==f&&n.templateContext(f),void 0===e.origJson&&n.origJson&&void 0!==m&&n.origJson(m),void 0===e.layoutParams&&n.layoutParams&&void 0!==y&&n.layoutParams(y),o=_.getDerivedFromVars(h.delimiter_style),g(),g=a(o,(t=>p=t)),b=ve(null==p?void 0:p.orientation,b),s=!((null==p?void 0:p.color)&&("transparent"===p.color||9===p.color.length&&0===p.color.indexOf("#00"))),w=it(null==p?void 0:p.color,1,w),l="horizontal"===b?"100%":et(1),u="horizontal"===b?et(1):"100%",c={background:w,width:l,height:u},d={orientation:b},g(),`${M(Nt,"Outer").$$render(t,{cls:ft("separator",de,d),json:h,origJson:m,templateContext:f,layoutParams:y},{},{default:()=>s?`<span${J("class",de.separator__inner,0)}${J("style",tt(c),0)}></span>`:""})}`})),ge={image:"divkit-a448f","image_is-width-content":"divkit-fe14a","image_is-height-content":"divkit-f4d92",image__image:"divkit-ce046",image_error:"divkit-f10d9","image__aspect-wrapper":"divkit-dc808",image_aspect:"divkit-ae784",image_loaded:"divkit-cf4e0","divkit-image-appearance":"divkit-e555f","image_before-appearance":"divkit-ffe8a"},he=O(((t,e,n,i)=>{let o,s,l,u,d,p,g,h,f,m,y,_,b,w,$,x,k,E,C,F,A,V,j,S,P,D,z,T,I,O,N,R,U,L,W,q=r,H=r,G=r,Z=r,K=r,Q=r,et=r,rt=r,nt=r,ot=r,st=r,lt=r,ut=r,ct=r,{json:pt={}}=e,{templateContext:gt}=e,{origJson:ht}=e,{layoutParams:mt}=e;const yt=v(Y);let _t,bt=0,wt="rgba(0,0,0,0.08)",xt=!1,kt="",Et="none",Ft="50% 50%",At="0",Vt="source_in",jt="",St="",Pt=0,Dt=0,zt=0,It="",Ot="";c((()=>{yt.removeSvgFilter(_t,Vt)})),void 0===e.json&&n.json&&void 0!==pt&&n.json(pt),void 0===e.templateContext&&n.templateContext&&void 0!==gt&&n.templateContext(gt),void 0===e.origJson&&n.origJson&&void 0!==ht&&n.origJson(ht),void 0===e.layoutParams&&n.layoutParams&&void 0!==mt&&n.layoutParams(mt),o=yt.getDerivedFromVars(pt.image_url),ct(),ct=a(o,(t=>W=t)),s=yt.getDerivedFromVars(pt.gif_url),ut(),ut=a(s,(t=>L=t)),l=W||L,bt=0,l?xt=!1:(xt=!0,yt.logError(X(new Error('Missing "image_url" for "image"')))),u=yt.getDerivedFromVars(pt.width),lt(),lt=a(u,(t=>U=t)),d="wrap_content"===(null==U?void 0:U.type),p=yt.getDerivedFromVars(pt.height),st(),st=a(p,(t=>R=t)),g="wrap_content"===(null==R?void 0:R.type),h=yt.getDerivedFromVars(pt.preview),ot(),ot=a(h,(t=>N=t));{const t=N;kt=t?t.startsWith("data:")?`url("${at(t)}")`:`url("data:image/jpg;base64,${at(t)}")`:""}f=yt.getDerivedFromVars(pt.placeholder_color),nt(),nt=a(f,(t=>O=t)),wt=it(O,1,wt),m=yt.getDerivedFromVars(pt.scale),rt(),rt=a(m,(t=>I=t)),Et=dt(I)||Et,y=yt.getDerivedFromVars({content_alignment_horizontal:pt.content_alignment_horizontal,content_alignment_vertical:pt.content_alignment_vertical}),et(),et=a(y,(t=>T=t)),Ft=function(t,e){const r=t.content_alignment_horizontal,n=t.content_alignment_vertical;return r&&"left"!==r&&"center"!==r&&"right"!==r||n&&"top"!==n&&"center"!==n&&"bottom"!==n?e:vt(t)}(T,Ft),_=yt.getDerivedFromVars(pt.accessibility),Q(),Q=a(_,(t=>z=t)),b=(null==z?void 0:z.description)||"",w=yt.getDerivedFromVars(pt.aspect),K(),K=a(w,(t=>D=t));{const t=null==D?void 0:D.ratio;At=t&&Mt(t)?(100/Number(t)).toFixed(2):"0"}$=yt.getDerivedFromVars(pt.tint_color),Z(),Z=a($,(t=>P=t)),x=yt.getDerivedFromVars(pt.tint_mode),G(),G=a(x,(t=>S=t));{const t=P,e=t?it(t):void 0,r=Zt(S,Vt);e===_t&&r===Vt||(yt.removeSvgFilter(_t,Vt),jt=e?yt.addSvgFilter(e,r):"",_t=e,Vt=r)}if(k=yt.getDerivedFromVars(pt.appearance_animation),H(),H=a(k,(t=>j=t)),j&&"fade"===j.type){const t=j;St=Ct(t.interpolator,"ease_in_out").replace(/_/g,"-"),zt=$t(t.duration,300),Dt=$t(t.start_delay,0),Pt=$t(t.alpha,0)}E=yt.getDerivedFromVars(pt.filters),q(),q=a(E,(t=>V=t));{let t="",e="";Array.isArray(V)&&V.length&&(t=Tt(V,yt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),It=t,Ot=e}return C={aspect:"0"!==At,"is-width-content":d,"is-height-content":g,loaded:!1,"before-appearance":Boolean(St)&&!0},F={"background-image":kt,"background-color":kt?void 0:wt,"background-size":Et},A={"object-fit":Et,"object-position":Ft,filter:["",It].filter(Boolean).join(" "),"clip-path":Ot||void 0,"--divkit-appearance-interpolator":St||void 0,"--divkit-appearance-fade-start":St?Pt:void 0,"--divkit-appearance-delay":St?`${Dt}ms`:void 0,"--divkit-appearance-duration":St?`${zt}ms`:void 0},q(),H(),G(),Z(),K(),Q(),et(),rt(),nt(),ot(),st(),lt(),ut(),ct(),xt?"":`${M(Nt,"Outer").$$render(t,{cls:ft("image",ge,C),json:pt,origJson:ht,templateContext:gt,layoutParams:mt,style:F,customDescription:!0},{},{default:()=>C.aspect?`<span${J("class",ge["image__aspect-wrapper"],0)}${B({"padding-bottom":`${At}%`})}><img${J("class",ge.image__image,0)}${J("src",l,0)} loading="lazy" decoding="async"${J("style",tt(A),0)}${J("alt",b,0)}${J("aria-hidden",b?null:"true",0)}></span>`:`<img${J("class",ge.image__image,0)}${J("src",l,0)} loading="lazy" decoding="async"${J("style",tt(A),0)}${J("alt",b,0)}${J("aria-hidden",b?null:"true",0)}>`})}`})),fe={grid:"divkit-d9080",grid_halign_left:"divkit-f63b3",grid_halign_center:"divkit-a14a6",grid_halign_right:"divkit-b0717",grid_valign_top:"divkit-fbca8",grid_valign_center:"divkit-d4310",grid_valign_bottom:"divkit-e4205"};function me(t){return t>0&&t<1}function ye(t){return String(Math.ceil(1e3*t)/1e3)}function _e(t,e,r){if(t.some(me)){const e=Math.max(...t.filter(me).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(${et(n*t[e]/i)},${ye(t[e])}fr)`:t[e]?o[e]=`${ye(t[e])}fr`:o[e]="auto";return o.join(" ")}const be=O(((t,e,n,i)=>{let o,s,l,u,c,d,p,g,h,f,m,y,_=r,b=r,w=r,$=r,{json:x={}}=e,{templateContext:k}=e,{origJson:E}=e,{layoutParams:C}=e;const F=v(Y);let A,V,j=!1,S=1,P=[],z=[],T=[],I=[],O=0,J=!1,N="top",B="left";void 0===e.json&&n.json&&void 0!==x&&n.json(x),void 0===e.templateContext&&n.templateContext&&void 0!==k&&n.templateContext(k),void 0===e.origJson&&n.origJson&&void 0!==E&&n.origJson(E),void 0===e.layoutParams&&n.layoutParams&&void 0!==C&&n.layoutParams(C),o=x.items,(null==o?void 0:o.length)&&Array.isArray(o)?j=!1:(j=!0,F.logError(X(new Error('Incorrect or empty "items" prop for div "grid"')))),s=F.getDerivedFromVars(x.column_count),$(),$=a(s,(t=>y=t)),S=Rt(y,S),l=(!j&&o||[]).map((t=>{let e=t,r=k;return({templateContext:r,json:e}=F.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];l.forEach((e=>{t.push(F.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),A=L(t,(t=>[...t])),w(),w=a(A,(t=>m=t))}{const t={};let e=0,r=0;P=[],z=[],T=[],I=[],J=!1,V=l.map(((n,i)=>{var o,a,s,l;const u=m[i],c=Number(u.columnSpan)||1,d=Number(u.rowSpan)||1,v={x:e,y:r,colSpan:c,rowSpan:d},p="match_parent"===(null===(o=u.width)||void 0===o?void 0:o.type)?Number(u.width.weight||1)/c:0,g="match_parent"===(null===(a=u.height)||void 0===a?void 0:a.type)?Number(u.height.weight||1)/d:0,h=1===c&&"fixed"===(null===(s=u.width)||void 0===s?void 0:s.type)&&u.width.value?Number(u.width.value)/c:0,f=1===d&&"fixed"===(null===(l=u.height)||void 0===l?void 0:l.type)&&u.height.value?Number(u.height.value)/d:0;for(let n=e;n<e+c;++n)for(let e=r;e<r+d;++e)t[n+"_"+e]?J=!0:(t[n+"_"+e]=!0,(!P[n]||P[n]<p)&&(P[n]=p),(!z[e]||z[e]<g)&&(z[e]=g),(!T[n]||T[n]<h)&&(T[n]=h),(!I[e]||I[e]<f)&&(I[e]=f));do{++e,e>=S&&(e=0,++r)}while(t[e+"_"+r]);return Object.assign(Object.assign({},n),{layoutParams:{gridArea:v,fakeElement:(null==C?void 0:C.fakeElement)||!1}})})),0!==e&&(J=!0),J&&F.logError(X(new Error('Mismatching "grid" rows/columns'))),O=r}return u=F.getDerivedFromVars(x.content_alignment_vertical),b(),b=a(u,(t=>f=t)),N=Gt(f,N),c=F.getDerivedFromVars(x.content_alignment_horizontal),_(),_=a(c,(t=>h=t)),B=Ht(h,B),d={valign:N,halign:B},p={"grid-template-columns":_e(P,T,S),"grid-template-rows":_e(z,I,O)},g=j||J,_(),b(),w(),$(),g?"":`${M(Nt,"Outer").$$render(t,{cls:ft("grid",fe,d),json:x,origJson:E,templateContext:k,style:p,layoutParams:C},{},{default:()=>`${D(V,(e=>`${M(sr,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),we=be,$e={gallery:"divkit-cbb0f",gallery_orientation_horizontal:"divkit-c9be7",gallery_orientation_vertical:"divkit-a72d5",gallery__scroller:"divkit-a4e39","gallery_scroll-snap":"divkit-f606e","gallery__items-grid":"divkit-eb4a5",gallery__items:"divkit-af276",gallery__arrow:"divkit-b72d7","gallery__arrow-icon":"divkit-d100d",gallery__arrow_left:"divkit-a0a5d",gallery__arrow_right:"divkit-f0f59","gallery__arrow-icon-path":"divkit-b4173"};function xe(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 ke(t,e){let r;return function(...n){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,n),r=null}),e)}}const Ee=O(((t,e,n,i)=>{let o,s,l,u,d,p,g,h,f,m,y,_,b,w,$,x,k,E,C,F,A,V,S,P,z,T,I,O,N,B=r,R=r,U=r,W=r,q=r,H=r,Z=r,K=r,Q=r,rt=r,{json:nt={}}=e,{templateContext:it}=e,{origJson:ot}=e,{layoutParams:at}=e;const st=v(Y);let lt,ut,ct=[],dt=!1,vt=!1,pt=null,gt=!1;const ht=st.getCustomization("galleryLeftClass"),mt=st.getCustomization("galleryRightClass");let yt=!1;O=a(st.isDesktop,(t=>I=t));let _t,bt,xt,kt,Ct=1,Ft="horizontal",At="start",Vt=8,jt="",St=[],Pt={},Dt=!1,zt={},Mt=0;const Tt=ke((function(){const t=lt.scrollLeft,e=lt.scrollWidth,r=lt.offsetWidth;dt=t>2,vt=t+r<e-2}),50);function It(){let t=[],e=ct[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<Ct;++e){const n=ct[e].children[r];n&&t.push(n)}return t}function Ot(t,e,r="smooth"){const n="horizontal"===Ft,i=n?"offsetLeft":"offsetTop",o=n?"left":"top";lt.scroll({[o]:Math.max(0,t[e][i]-Vt/2),behavior:r})}function Jt(t){const e=It(),r=lt.getBoundingClientRect(),n=e.findIndex((t=>function(t,e){return"horizontal"===Ft?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"===Ft?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}!nt.id||yt||(null==at?void 0:at.fakeElement)||st.registerInstance(nt.id,{setCurrentItem(t){const e=It();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Ot(e,t)},setPreviousItem(t){const e=Jt("prev"),r=It();let n=e-1;n<0&&(n="ring"===t?r.length-1:e),Ot(r,n)},setNextItem(t){const e="horizontal"===Ft?lt.scrollLeft+lt.offsetWidth===lt.scrollWidth:lt.scrollTop+lt.offsetHeight===lt.scrollHeight,r=It();if(e&&"ring"===t)return void Ot(r,0);const n=Jt("next");let i=n+1;i>r.length-1&&(i="ring"===t?0:n),Ot(r,i)}}),c((()=>{gt=!1,nt.id&&!(null==at?void 0:at.fakeElement)&&st.unregisterInstance(nt.id)})),void 0===e.json&&n.json&&void 0!==nt&&n.json(nt),void 0===e.templateContext&&n.templateContext&&void 0!==it&&n.templateContext(it),void 0===e.origJson&&n.origJson&&void 0!==ot&&n.origJson(ot),void 0===e.layoutParams&&n.layoutParams&&void 0!==at&&n.layoutParams(at),o=nt.items,(null==o?void 0:o.length)&&Array.isArray(o)?yt=!1:(yt=!0,st.logError(X(new Error('Incorrect or empty "items" prop for div "gallery"')))),s=(!yt&&o||[]).map((t=>{let e=t,r=it;return({templateContext:r,json:e}=st.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=I&&gt&&!yt,l?"undefined"!=typeof ResizeObserver&&(pt=new ResizeObserver((()=>{Tt()})),pt.observe(ut)):pt&&(pt.disconnect(),pt=null),u=st.getDerivedFromVars(nt.column_count),Q(),Q=a(u,(t=>T=t)),Ct=Rt(T,Ct),d=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}(s,Ct),p=st.getDerivedFromVars(nt.orientation),K(),K=a(p,(t=>z=t)),Ft=ve(z,Ft),g=st.getDerivedFromVars(nt.cross_content_alignment),Z(),Z=a(g,(t=>P=t)),At=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(P,At),h=st.getDerivedFromVars(nt.item_spacing),H(),H=a(h,(t=>S=t)),Vt=$t(S,Vt),_t=et(Vt),f=st.getDerivedFromVars(nt.cross_spacing),q(),q=a(f,(t=>V=t)),xt=$t(V,Vt),bt=et(xt),m=st.getDerivedFromVars(nt.paddings),W(),W=a(m,(t=>A=t)),jt=wt(A,jt),y="horizontal"===Ft?"grid-template-columns":"grid-template-rows";{let t=[];s.forEach((e=>{const r="horizontal"===Ft?"width":"height";t.push(st.getDerivedFromVars(e.json[r]))})),kt=L(t,(t=>t)),U(),U=a(kt,(t=>F=t))}St=[],Ct>1?St.push("auto"):F.forEach((t=>{!t&&"horizontal"===Ft||"match_parent"===(null==t?void 0:t.type)?St.push("100%"):St.push("max-content")})),_=st.getDerivedFromVars(nt.scroll_mode),R(),R=a(_,(t=>C=t));{const t={};let e={};Dt=!1,(null==at?void 0:at.fakeElement)&&(e.fakeElement=!0),"horizontal"===Ft?e.parentVAlign=At:e.parentHAlign=At,"paging"===C&&(Dt=!0,e.scrollSnap="start",t["horizontal"===Ft?"scroll-padding-left":"scroll-padding-top"]=et(Vt/2)),1===Ct&&(e.parentLayoutOrientation=Ft),Pt=Et(t,Pt),zt=Et(e,zt)}return b=st.getDerivedFromVars(nt.restrict_parent_scroll),rt(),rt=a(b,(t=>N=t)),w={padding:jt,"grid-gap":bt},$={"grid-gap":_t,[y]:xe(St)},x={orientation:Ft,"scroll-snap":Dt},k=st.getDerivedFromVars(nt.default_item),B(),B=a(k,(t=>E=t)),Mt=$t(E,Mt),B(),R(),U(),W(),q(),H(),Z(),K(),Q(),O(),rt(),"\n\n"+(yt?"":`${M(Nt,"Outer").$$render(t,{cls:ft("gallery",$e,x),json:nt,origJson:ot,templateContext:it,layoutParams:at,customPaddings:!0,customActions:"gallery"},{},{default:()=>`<div class="${j($e.gallery__scroller,!0)+" "+j(N?G:"",!0)}"${J("style",tt(Pt),0)}${J("this",lt,0)}><div${J("class",$e["gallery__items-grid"],0)}${J("style",tt(w),0)}${J("this",ut,0)}>${D(d,((e,r)=>`<div${J("class",$e.gallery__items,0)}${J("style",tt($),0)}${J("this",ct[r],0)}>${D(e,(e=>`${M(sr,"Unknown").$$render(t,{layoutParams:zt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===Ft?`${dt&&l?`<div${J("class",ht||`${$e.gallery__arrow} ${$e.gallery__arrow_left}`,0)}>${ht?"":`<svg${J("class",$e["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${J("class",$e["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>`:""}\n ${vt&&l?`<div${J("class",mt||`${$e.gallery__arrow} ${$e.gallery__arrow_right}`,0)}>${mt?"":`<svg${J("class",$e["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${J("class",$e["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>`:""}`:""}`})}`)})),Ce=Ee,Fe={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"},Ae=O(((t,e,n,i)=>{let o,s,l,u,d,p,g,h,f,m,y,b,w,$,x,k,E,C,F,A,V=r,S=r,P=r,z=r,T=r,I=r,O=r,N=r;var R;let{json:U={}}=e,{templateContext:L}=e,{origJson:W}=e,{layoutParams:q}=e;const H=v(Y),Z=H.genId("tabs");let K,Q,rt,nt=!1,ot={};const at=H.getJsonWithVars(U.selected_tab);let st,lt,ut=at&&Number(at)||0,ct=12,dt="",vt="",pt="",gt="",ht="",mt="",yt="",_t="",$t="",xt="",kt=!1,Ct=!1,Ft=ut,At=[],jt=[];async function St(t,e=!1){if(Ft=ut,ut=t,kt||(kt=!0,Q.style.height=et(Q.clientHeight),rt.style.transform=`translate3d(${100*-Ft}%,0,0)`),Ct=!0,async function(t){await _(),rt.style.transform=`translate3d(${t}%,0,0)`}(100*-ut),function(t=!1){const e=t?Math.max(0,ut-1):Math.min(ut,Ft),r=t?Math.min(o.length-1,ut+1):Math.max(ut,Ft);At=At.map(((t,n)=>t||n>=e&&n<=r)),jt=jt.map(((t,n)=>n>=e&&n<=r))}(),async function(){await _();const t=document.getElementById(`${Z}-panel-${ut}`);t&&(Q.style.height=et(t.offsetHeight))}(),zt&&clearTimeout(zt),zt=window.setTimeout((()=>{jt=o.map(((t,e)=>e===ut))}),400),Pt=-ut*Q.clientWidth,e){await _();const t=K.querySelector(`.${Fe.tabs__item_selected}`);t&&t.focus()}}let Pt,zt=null;!U.id||nt||(null==q?void 0:q.fakeElement)||H.registerInstance(U.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');St(t)},setPreviousItem(t){let e=ut-1;e<0&&(e="ring"===t?o.length-1:ut),St(e)},setNextItem(t){let e=ut+1;e>o.length-1&&(e="ring"===t?0:ut),St(e)}}),c((()=>{U.id&&!(null==q?void 0:q.fakeElement)&&H.unregisterInstance(U.id)})),void 0===e.json&&n.json&&void 0!==U&&n.json(U),void 0===e.templateContext&&n.templateContext&&void 0!==L&&n.templateContext(L),void 0===e.origJson&&n.origJson&&void 0!==W&&n.origJson(W),void 0===e.layoutParams&&n.layoutParams&&void 0!==q&&n.layoutParams(q),o=U.items||[],(null==o?void 0:o.length)&&Array.isArray(o)?nt=!1:(nt=!0,H.logError(X(new Error('Incorrect or empty "items" prop for div "tabs"')))),s=H.getDerivedFromVars(U.width),O(),O=a(s,(t=>F=t)),l=H.getDerivedFromVars(U.height),I(),I=a(l,(t=>C=t));{let t={};(null==q?void 0:q.fakeElement)&&(t.fakeElement=!0),"wrap_content"===(null==F?void 0:F.type)&&(t.parentHorizontalWrapContent=!0),C&&"wrap_content"!==C.type||(t.parentVerticalWrapContent=!0),ot=Et(t,ot)}if(!nt&&(ut<0||ut>=o.length)&&(H.logError(X(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:U.selected_tab,length:o.length}})),ut=ut<0?0:o.length-1),u=H.getDerivedFromVars(U.tab_title_style),T(),T=a(u,(t=>E=t)),d=E||{},ct=Rt(d.font_size,ct),d.font_size||d.paddings){const t=d.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/ct*10,right:(Number(t.right)||0)/ct*10,bottom:(Number(t.bottom)||0)/ct*10,left:(Number(t.left)||0)/ct*10};dt=wt(e,dt)}{const t=d.line_height;void 0!==t&&Mt(t)&&(vt=et(t/ct*10))}{const t=d.letter_spacing;void 0!==t&&bt(t)&&(pt=et(t/ct*10))}if(d.corner_radius||d.corners_radius||d.font_size){const t=null!==(R=d.corner_radius)&&void 0!==R?R:1e3;d.corners_radius?gt=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]&&!bt(i[t]))return n;return Vt(t,e,r)}(d.corners_radius,t,ct,gt):bt(t)&&(gt=et(t/ct*10))}return st=Lt(d.active_font_weight||d.font_weight,st),lt=Lt(d.inactive_font_weight||d.font_weight,lt),ht=it(d.active_text_color,1,ht),mt=it(d.inactive_text_color,1,mt),yt=it(d.active_background_color,1,yt),_t=it(d.inactive_background_color,1,_t),p=H.getDerivedFromVars(U.has_separator),z(),z=a(p,(t=>k=t)),g=H.getDerivedFromVars(U.separator_color),P(),P=a(g,(t=>x=t)),h=H.getDerivedFromVars(U.separator_paddings),S(),S=a(h,(t=>$=t)),k&&(x&&($t=it(x,1,$t)),$&&(xt=wt($,xt))),f={background:$t,margin:xt},m=H.getDerivedFromVars(U.switch_tabs_by_content_swipe_enabled),V(),V=a(m,(t=>w=t)),y=void 0===w||Boolean(w),b=H.getDerivedFromVars(U.restrict_parent_scroll),N(),N=a(b,(t=>A=t)),nt||(At=o.map(((t,e)=>e===ut)),jt=o.map(((t,e)=>e===ut))),V(),S(),P(),z(),T(),I(),O(),N(),nt?"":`${M(Nt,"Outer").$$render(t,{cls:ft("tabs",Fe,{}),json:U,origJson:W,templateContext:L,layoutParams:q,customActions:"tabs"},{},{default:()=>`<div class="${j(Fe.tabs__list,!0)+" "+j(A?G:"",!0)}" role="tablist"${B({"--divkit-tabs-font-size":et(ct),"--divkit-tabs-paddings":dt,"--divkit-tabs-line-height":vt,"--divkit-tabs-letter-spacing":pt,"--divkit-tabs-active-font-weight":st||"","--divkit-tabs-inactive-font-weight":lt||"","--divkit-tabs-active-text-color":ht,"--divkit-tabs-inactive-text-color":mt,"--divkit-tabs-active-background-color":yt,"--divkit-tabs-inactive-background-color":_t,"--divkit-tabs-border-radius":gt})}${J("this",K,0)}>${D(o,((e,r)=>{let n=r===ut;return`\n\n ${M(Dt,"Actionable").$$render(t,{cls:ft("tabs__item",Fe,{selected:n,actionable:Boolean(e.title_click_action)}),actions:!e.title_click_action||null!=q&&q.fakeElement?[]:[e.title_click_action],attrs:{id:`${Z}-tab-${r}`,"aria-controls":`${Z}-panel-${r}`,role:"tab",tabindex:!n||null!=q&&q.fakeElement?"-1":e.title_click_action?void 0:"0","aria-selected":n?"true":"false"},customAction:null!=q&&q.fakeElement?null:t=>function(t,e){return ut===e||(St(e),!1)}(0,r)},{},{default:()=>`${j(e.title)}\n `})}`}))}</div>\n ${k?`<div${J("class",Fe.tabs__separator,0)}${J("style",tt(f),0)}></div>`:""}\n <div class="${j(Fe.tabs__panels,!0)+" "+j(A?G:"",!0)}"${J("this",Q,0)}><div${J("class",ft("tabs__swiper",Fe,{inited:kt,animated:Ct}),0)}${J("this",rt,0)}>${D(o,((e,r)=>`<div${J("class",ft("tabs__panel",Fe,{visible:jt[r]}),0)} role="tabpanel" id="${j(Z,!0)+"-panel-"+j(r,!0)}" aria-labelledby="${j(Z,!0)+"-tab-"+j(r,!0)}" style="${"left: "+j(100*r,!0)+"%"}">${At[r]?`${M(sr,"Unknown").$$render(t,{div:e.div,templateContext:L,layoutParams:ot},{},{})}`:""}\n </div>`))}</div></div>`})}`})),Ve=Ae,je="divkit-eb860",Se="divkit-e08c6";function Pe(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)}}Pe([.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]),Pe([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 De=O(((t,e,r,n)=>{let i,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const u=v(Y),p=v(mt);let g=new Map,h=new Set,f=!1,m=null,y=[],b=[],w=[],$=[];const x=o.div_id||o.id;let k;x?(null==l?void 0:l.fakeElement)||(p.registerInstance(x,{async setState(t){if(k===t)return;u.setRunning("stateChange",!0),new Set(h),y.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),y=[],$.forEach((t=>{g.set(t.id,t.node.getBoundingClientRect())})),b=[],w=[],$=[];const e=i.find((e=>e.state_id===t))||null;e?(k=t,E=e):u.logError(X(new Error("Cannot find state with id"),{additional:{stateId:t}})),await _()},getChild(t){if(m&&m.has(t))return m.get(t);u.logError(X(new Error("Missing state block with id"),{additional:{id:t}}))}}),d(mt,{registerInstance(t,e){m||(m=new Map),m.has(t)?u.logError(X(new Error("Duplicate state with id"),{additional:{id:t}})):m.set(t,e)},unregisterInstance(t){null==m||m.delete(t)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return b.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return w.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,templateContext:e,transitions:r,node:n};return $.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&g.has(t),registerChild(t){h.add(t)},unregisterChild(t){h.delete(t)}})):(f=!0,u.logError(X(new Error('Missing "id" prop for div "state"'))));let E=null;const C=u.getJsonWithVars(o.default_state_id);let F=!1;return c((()=>{x&&!(null==l?void 0:l.fakeElement)&&p.unregisterInstance(x)})),void 0===e.json&&r.json&&void 0!==o&&r.json(o),void 0===e.templateContext&&r.templateContext&&void 0!==a&&r.templateContext(a),void 0===e.origJson&&r.origJson&&void 0!==s&&r.origJson(s),void 0===e.layoutParams&&r.layoutParams&&void 0!==l&&r.layoutParams(l),o&&(h=new Set),i=o.states||[],(null==i?void 0:i.length)?f=!1:(f=!0,u.logError(X(new Error('Empty "states" prop for div "state"')))),function(t){F||(F=!0,t.length&&(C?(k=C,E=t.find((t=>t.state_id===k))||null,E||u.logError(X(new Error("Cannot find state for default_state_id"),{additional:{selectedId:k}}))):(E=t[0],k=E.state_id)))}(i),f?"":`${M(Nt,"Outer").$$render(t,{cls:"divkit-b8efc",json:o,origJson:s,templateContext:a,layoutParams:l},{},{default:()=>{var e;return`${null!==(e=E)&&void 0!==e&&e.div?`${M(sr,"Unknown").$$render(t,{div:E.div,templateContext:a},{},{})}`:""}\n <div${J("class","divkit-adaae",0)} aria-hidden="true"${J("this",undefined,0)}>${D(y,(e=>"direction"in e?`<div${J("class",je,0)} style="${"left:"+j(e.offsetLeft,!0)+"px;top:"+j(e.offsetTop,!0)+"px;width:"+j(e.width,!0)+"px;height:"+j(e.height,!0)+"px"}"><div${J("class",Se,0)}>${M(sr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`:`<div${J("class",je,0)}><div${J("class",Se,0)}>${M(sr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`))}</div>`}})}`})),ze={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f"},Me=O(((t,e,n,i)=>{let o,s,l,u,d,p,g,h,f,m,y,_,b,w,$,x,k,E=r,C=r,F=r,A=r,V=r,S=r;var P,z,T,I,O,N,B;let{json:R={}}=e,{templateContext:U}=e,{origJson:L}=e,{layoutParams:W}=e;const q=v(Y),H=q.genId("pager");let Z,K=!1,Q=0,nt=0,it=!1,ot="horizontal",at="",st="",lt="";function ut(t,e="smooth"){const r="horizontal"===ot,n=Z.children[t],i=r?"offsetLeft":"offsetTop",o=r?"left":"top";Z.scroll({[o]:n[i],behavior:e}),Q=t}ke((function(){const t=function(){const t=Array.from(Z.children),e=Z.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,n=t.getBoundingClientRect(),"horizontal"===ot?n.left>=r.left&&n.right<=r.right:n.top>=r.top&&n.bottom<=r.bottom;var r,n}));return-1!==r?r:Q}();t!==Q&&(Q=t)}),50),R.id&&!(null==W?void 0:W.fakeElement)&&q.registerInstance(R.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');ut(t)},setPreviousItem(t){let e=Q-1;e<0&&(e="ring"===t?o.length-1:Q),ut(e)},setNextItem(t){let e=Q+1;e>o.length-1&&(e="ring"===t?0:Q),ut(e)}}),c((()=>{R.id&&!(null==W?void 0:W.fakeElement)&&q.unregisterInstance(R.id)})),void 0===e.json&&n.json&&void 0!==R&&n.json(R),void 0===e.templateContext&&n.templateContext&&void 0!==U&&n.templateContext(U),void 0===e.origJson&&n.origJson&&void 0!==L&&n.origJson(L),void 0===e.layoutParams&&n.layoutParams&&void 0!==W&&n.layoutParams(W),(null===(P=R.items)||void 0===P?void 0:P.length)&&Array.isArray(R.items)?K=!1:(K=!0,q.logError(X(new Error('Incorrect or empty "items" prop for div "pager"')))),o=(!K&&R.items||[]).map((t=>{let e=t,r=U;return({templateContext:r,json:e}=q.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=q.getDerivedFromVars(R.layout_mode),C(),C=a(s,(t=>b=t)),b?"percentage"!==b.type&&"fixed"!==b.type?(it=!0,q.logError(X(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):it=!1:(it=!0,q.logError(X(new Error('Empty "layout_mode" prop for div "pager"')))),l=q.getDerivedFromVars(R.orientation),V(),V=a(l,(t=>x=t)),ot=ve(x,ot),u=q.getDerivedFromVars(R.item_spacing),A(),A=a(u,(t=>$=t));{const t=null==$?void 0:$.value;t&&bt(t)&&(at=et(t||0))}if(d=q.getDerivedFromVars(R.paddings),F(),F=a(d,(t=>w=t)),st=wt(w,st),p=q.getDerivedFromVars(R.restrict_parent_scroll),S(),S=a(p,(t=>k=t)),g="horizontal"===ot?"grid-auto-columns":"grid-auto-rows","fixed"===(null==b?void 0:b.type)){const t=rt("horizontal"===ot?((null===(z=R.paddings)||void 0===z?void 0:z.left)||0)+((null===(T=R.paddings)||void 0===T?void 0:T.right)||0):((null===(I=R.paddings)||void 0===I?void 0:I.top)||0)+((null===(O=R.paddings)||void 0===O?void 0:O.bottom)||0)),e=null===(N=b.neighbour_page_width)||void 0===N?void 0:N.value;lt=e?`calc(100% + ${t} - 2 * ${rt(e)} - 2 * ${at})`:"100%"}else if("percentage"===(null==b?void 0:b.type)){const t=null===(B=b.page_width)||void 0===B?void 0:B.value;lt=`${Number(t)}%`}return h={"grid-gap":at,padding:st,[g]:lt},f={orientation:ot},m=K||it,y=q.getStore("pagers"),E(),E=a(y,(t=>_=t)),function(t,e){const r=R.id;if(r){const o=new Map(_);n=y,_=o.set(r,{instId:H,size:t,currentItem:e,scrollToPagerItem:ut}),i=_,n.set(i)}var n,i}(o.length,Q),function(t){var e;if(t===nt)return;nt=t;const r=q.getJsonWithVars(null===(e=o[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&q.execAnyActions(r)}(Q),E(),C(),F(),A(),V(),S(),m?"":`${M(Nt,"Outer").$$render(t,{cls:ft("pager",ze,f),json:R,origJson:L,templateContext:U,layoutParams:W,customPaddings:!0},{},{default:()=>`<div class="${j(ze.pager__items,!0)+" "+j(k?G:"",!0)}"${J("style",tt(h),0)}${J("this",Z,0)}>${D(o,(e=>`<div${J("class",ze.pager__item,0)}>${M(sr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson,layoutParams:null!=W&&W.fakeElement?{fakeElement:!0}:void 0},{},{})}\n </div>`))}</div>`})}`})),Te=Me,Ie={indicator:"divkit-d8e3f",indicator__scroller:"divkit-b5db0",indicator__items:"divkit-d5d94",indicator__item:"divkit-f6629",indicator__item_active:"divkit-b39cd"},Oe=O(((t,e,n,i)=>{let o,s,l,u,c,d,p,g,h,f,m,y,b=r,w=r,$=r,x=r,k=r,E=r;var C;let{json:F={}}=e,{templateContext:A}=e,{origJson:V}=e,{layoutParams:S}=e;const P=v(Y);let z,T,I,O=5,N=10,R=10,U=5,L="#ffdc60",q=it("#33919cb5"),H=15,G=1.3;return void 0===e.json&&n.json&&void 0!==F&&n.json(F),void 0===e.templateContext&&n.templateContext&&void 0!==A&&n.templateContext(A),void 0===e.origJson&&n.origJson&&void 0!==V&&n.origJson(V),void 0===e.layoutParams&&n.layoutParams&&void 0!==S&&n.layoutParams(S),o=P.getDerivedFromVars(F.shape),E(),E=a(o,(t=>y=t)),y&&("rounded_rectangle"===y.type?(y.item_width&&(N=$t(y.item_width.value,N)),y.item_height&&(R=$t(y.item_height.value,R)),y.corner_radius&&(U=$t(y.corner_radius.value,U))):"circle"===y.type&&(O=$t(null===(C=y.radius)||void 0===C?void 0:C.value,O),N=R=U=2*O)),s=P.getDerivedFromVars(F.active_item_color),k(),k=a(s,(t=>m=t)),L=it(m,1,L),l=P.getDerivedFromVars(F.inactive_item_color),x(),x=a(l,(t=>f=t)),q=it(f,1,q),u=P.getDerivedFromVars(F.space_between_centers),$(),$=a(u,(t=>h=t)),h&&(H=$t(h.value,H)),c=P.getDerivedFromVars(F.active_item_size),w(),w=a(c,(t=>g=t)),G=Rt(g,G),d=P.getStore("pagers"),b(),b=a(d,(t=>p=t)),async function(t){if(F.pager_id&&t.has(F.pager_id)){I=t.get(F.pager_id),await _();const e=T.children[I.currentItem].offsetLeft;z.scroll({left:e-z.clientWidth/2,behavior:"smooth"})}}(p),b(),w(),$(),x(),k(),E(),`${M(Nt,"Outer").$$render(t,{cls:ft("indicator",Ie,{}),json:F,origJson:V,templateContext:A,layoutParams:S},{},{default:()=>`<div${J("class",Ie.indicator__scroller,0)}${J("this",z,0)}><div${J("class",Ie.indicator__items,0)} role="tablist"${B({margin:`0 ${et((G-1)*N/2)}`,"--divkit-indicator-width":et(N),"--divkit-indicator-height":et(R),"--divkit-indicator-border-radius":et(U),"--divkit-indicator-active-color":L,"--divkit-indicator-inactive-color":q,"--divkit-indicator-active-scale":G,"--divkit-indicator-margin":`0 ${et((H-N)/2)}`})}${J("this",T,0)}>${I?`${D(Array(I.size),((t,e)=>{let r=e===I.currentItem;return`\n <div class="${j(ft("indicator__item",Ie,{active:r}),!0)+" "+j(W,!0)}" role="tab" id="${j(I.instId,!0)+"-tab-"+j(e,!0)}" aria-controls="${j(I.instId,!0)+"-panel-"+j(e,!0)}"${J("aria-selected",r?"true":"false",0)}${J("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),Je=Oe,Ne={slider:"divkit-ef4f7",slider__input:"divkit-d1d65",slider__input_secondary:"divkit-c7980",slider__thumb:"divkit-f3453",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 Be(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&it(t.text_color)||"#000",i=Ut(t.font_weight);if(Mt(t.font_size)&&"transparent"!==n){var o,a;const e={fontSize:et(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 Re(t,e,r){return Math.max(e,Math.min(r,t))}const Ue=2147483647,Le=-2147483648,We=Number.MAX_VALUE,qe=Number.MIN_VALUE,He="string",Ge="integer",Ze="number",Ye="boolean",Xe="color",Ke="datetime";class Qe{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=U(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}}const tr={string:class extends Qe{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends Qe{convertValue(t){if("number"!=typeof t||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"}},integer:class extends Qe{convertValue(t){if("number"!=typeof t||isNaN(t)||t>Ue||t<Le||t!==Math.round(t))throw new Error("Incorrect variable value");return t}fromString(t){const e=Number(t);return this.convertValue(e)}getType(){return"integer"}},boolean:class extends Qe{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"}},color:class extends Qe{convertValue(t){if("string"!=typeof t||!ot(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends Qe{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function er(t,e,r){if(!(e in tr))throw new Error("Unsupported variable type");return new tr[e](t,r)}function rr(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 nr=O(((t,e,n,i)=>{let o,s,l,u,c,d,p,g,h,f,m,y,_,b,w,$,x,k,E,C,F,A,V,S,P,z,T,I,O,N,R,U,L,W,q,H,G=r,Z=r,K=r,Q=r,tt=r,nt=r,it=r,ot=r,at=r,st=r,lt=r,ut=r;var ct,dt,vt,pt;let{json:gt={}}=e,{templateContext:ht}=e,{origJson:mt}=e,{layoutParams:yt}=e;const _t={width:10,height:10,borderRadius:5,background:"#000"},wt=["rounded_rectangle","circle"],$t=["rounded_rectangle"],xt=v(Y),kt=v(St);let Et=0,Ct=100;const At=xt.getJsonWithVars(gt.thumb_value_variable),Vt=xt.getJsonWithVars(gt.thumb_secondary_value_variable);W=a(At&&xt.getVariable(At,"integer")||er("temp","integer",0),(t=>L=t)),U=a(Vt&&xt.getVariable(Vt,"integer")||er("temp","integer",0),(t=>R=t));let jt,Pt,Dt,zt=Re(L||0,Et,Ct),Mt=Re(R||0,Et,Ct),Tt=_t,It=Tt,Ot=_t,Jt=_t,Bt=null,Rt=null,Ut=Dt,Lt="",Wt="",qt=!1;ke((function(){}),50),void 0===e.json&&n.json&&void 0!==gt&&n.json(gt),void 0===e.templateContext&&n.templateContext&&void 0!==ht&&n.templateContext(ht),void 0===e.origJson&&n.origJson&&void 0!==mt&&n.origJson(mt),void 0===e.layoutParams&&n.layoutParams&&void 0!==yt&&n.layoutParams(yt),o=xt.getDerivedFromVars(gt.min_value),ut(),ut=a(o,(t=>H=t)),s=xt.getDerivedFromVars(gt.max_value),lt(),lt=a(s,(t=>q=t)),Et=Ft(H,Et),Ct=Ft(q,Ct);{const t=Re(L||0,Et,Ct);t!==zt&&(zt=t)}{const t=Re(R||0,Et,Ct);t!==Mt&&(Mt=t)}l=xt.getDerivedFromVars(gt.thumb_style),st(),st=a(l,(t=>N=t)),Tt=Qt(N,wt,Tt),u=xt.getDerivedFromVars(gt.thumb_secondary_style),at(),at=a(u,(t=>O=t)),It=Qt(O,wt,Tt),c=xt.getDerivedFromVars(gt.track_inactive_style),ot(),ot=a(c,(t=>I=t)),Ot=Qt(I,$t,Ot),d=xt.getDerivedFromVars(gt.track_active_style),it(),it=a(d,(t=>T=t)),Jt=Qt(T,$t,Jt),p=xt.getDerivedFromVars(gt.tick_mark_active_style),nt(),nt=a(p,(t=>z=t));{let t=Qt(z,wt,_t);t!==_t&&(Bt=t)}jt=Bt?Vt?rr(Math.min(zt,Mt),Math.max(zt,Mt)+1,Et,Ct,!0):rr(Et,zt,Et,Ct,!0):[],g=xt.getDerivedFromVars(gt.tick_mark_inactive_style),tt(),tt=a(g,(t=>P=t));{let t=Qt(P,wt,_t);t!==_t&&(Rt=t)}Pt=Rt?Vt?rr(Math.min(zt,Mt),Math.max(zt,Mt)+1,Et,Ct,!1):rr(zt+1,Ct+1,Et,Ct,!0):[],h=xt.getDerivedFromVars(gt.thumb_text_style),Q(),Q=a(h,(t=>S=t)),Dt=Be(S,Dt),f=xt.getDerivedFromVars(gt.thumb_secondary_text_style),K(),K=a(f,(t=>V=t)),Ut=Be(V,Dt),m=xt.getDerivedFromVars(gt.accessibility),Z(),Z=a(m,(t=>A=t)),(null==A?void 0:A.description)?Lt=A.description:xt.logError(X(new Error('Missing accessibility "description" for slider'),{level:"warn"})),y=xt.getDerivedFromVars(gt.secondary_value_accessibility),G(),G=a(y,(t=>F=t)),(null==F?void 0:F.description)?Wt=F.description:Vt&&xt.logError(X(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;kt.hasAction()?(xt.logError(X(new Error('Cannot show "slider" inside component with action'))),t=!0):Tt===_t?(xt.logError(X(new Error('Missing "thumb_style" in slider'))),t=!0):Jt===_t?(xt.logError(X(new Error('Missing "track_active_style" in slider'))),t=!0):Ot===_t&&(xt.logError(X(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==qt&&(qt=t)}return _=et(Math.max(...[Tt.width,It.width,0].filter(bt))),b=et(Math.max(...[Tt.height,It.height,0].filter(bt))),w=(zt-Et)/(Ct-Et),$=Vt?(Mt-Et)/(Ct-Et):void 0,x=void 0!==$?Math.abs($-w):w,k=void 0!==$?Math.min($,w):0,E={"--divkit-slider-thumb-width":et(Tt.width),"--divkit-slider-thumb-height":et(Tt.height),"--divkit-slider-thumb-secondary-width":et(It.width),"--divkit-slider-thumb-secondary-height":et(It.height),"--divkit-slider-text-offset-x":(null===(ct=null==Dt?void 0:Dt.offset)||void 0===ct?void 0:ct.x)?rt(Dt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(dt=null==Dt?void 0:Dt.offset)||void 0===dt?void 0:dt.y)?rt(Dt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(vt=null==Ut?void 0:Ut.offset)||void 0===vt?void 0:vt.x)?rt(Ut.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(pt=null==Ut?void 0:Ut.offset)||void 0===pt?void 0:pt.y)?rt(Ut.offset.y):void 0,"--divkit-slider-tick-active-width":Bt?et(Bt.width):void 0,"--divkit-slider-tick-active-height":Bt?et(Bt.height):void 0,"--divkit-slider-tick-active-border-radius":Bt?et(Bt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Bt?void 0:Bt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Bt?void 0:Bt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Rt?et(Rt.width):void 0,"--divkit-slider-tick-inactive-height":Rt?et(Rt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Rt?et(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":_,"--divkit-slider-max-thumb-height":b,"--divkit-slider-track-part":w,"--divkit-slider-track-secondary-part":$},C={},G(),Z(),K(),Q(),tt(),nt(),it(),ot(),at(),st(),U(),W(),lt(),ut(),"\n\n"+(qt?"":`${M(Nt,"Outer").$$render(t,{cls:ft("slider",Ne,C),style:E,customDescription:!0,customActions:"slider",json:gt,origJson:mt,templateContext:ht,layoutParams:yt},{},{default:()=>{var t,e,r,n,i,o;return`<div${J("class",Ne["slider__tracks-wrapper"],0)}><div${J("class",Ne["slider__tracks-inner"],0)}${J("this",undefined,0)}><div${J("class",Ne.slider__track,0)}${B({height:et(Ot.height),"border-radius":et(Ot.borderRadius),background:Ot.background,"box-shadow":Ot.boxShadow||""})}></div>\n <div${J("class",Ne["slider__active-track"],0)}${B({left:(100*k).toFixed(2)+"%",width:(100*x).toFixed(2)+"%",height:et(Jt.height),"border-radius":et(Jt.borderRadius),background:Jt.background,"box-shadow":Jt.boxShadow||""})}></div>\n ${D(jt,(t=>`<div class="${j(Ne.slider__tick,!0)+" "+j(Ne.slider__tick_active,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n ${D(Pt,(t=>`<div class="${j(Ne.slider__tick,!0)+" "+j(Ne.slider__tick_inactive,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n <div${J("class",Ne.slider__thumb,0)}${B({"border-radius":et(Tt.borderRadius),background:Tt.background,"box-shadow":Tt.boxShadow||""})}>${Dt?`<div${J("class",Ne["slider__thumb-text"],0)}><div${J("class",Ne["slider__thumb-text-inner"],0)}${B({"font-size":(null===(t=Dt)||void 0===t?void 0:t.fontSize)||"1em","font-weight":(null===(e=Dt)||void 0===e?void 0:e.fontWeight)||"",color:(null===(r=Dt)||void 0===r?void 0:r.textColor)||"#000"})}>${j(zt)}</div></div>`:""}</div>\n ${Vt?`<div class="${j(Ne.slider__thumb,!0)+" "+j(Ne.slider__thumb_secondary,!0)}"${B({"border-radius":et(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${Ut?`<div class="${j(Ne["slider__thumb-text"],!0)+" "+j(Ne["slider__thumb-text_secondary"],!0)}"><div${J("class",Ne["slider__thumb-text-inner"],0)}${B({"font-size":(null===(n=Ut)||void 0===n?void 0:n.fontSize)||"1em","font-weight":(null===(i=Ut)||void 0===i?void 0:i.fontWeight)||"",color:(null===(o=Ut)||void 0===o?void 0:o.textColor)||"#000"})}>${j(Mt)}</div></div>`:""}</div>`:""}\n <input type="range"${J("class",Ne.slider__input,0)}${J("min",Et,0)}${J("max",Ct,0)} step="1"${J("value",zt,0)}${J("aria-label",Lt,0)}>\n ${Vt?`<input type="range"${J("class",`${Ne.slider__input} ${Ne.slider__input_secondary}`,0)}${J("min",Et,0)}${J("max",Ct,0)} step="1"${J("value",Mt,0)}${J("aria-label",Wt,0)}>`:""}</div></div>`}})}`)})),ir={input:"divkit-c3a4c",input__wrapper:"divkit-ef7eb",input__holder:"divkit-bb3da",input_multiline:"divkit-e48a3",input__input:"divkit-f11e0","input_highlight-color":"divkit-cc00f","input_vertical-overflow":"divkit-b7075"},or={text:Xt,container:ce,separator:pe,image:he,gif:he,grid:we,gallery:Ce,tabs:Ve,state:De,pager:Te,indicator:Je,slider:nr,input:O(((t,e,n,i)=>{let o,s,l,u,c,d,p,g,h,f,m,y,_,b,w,$,x,k,E,C,F,A,V,S,P,D,z,T,I,O,N,B,R=r,U=r,{json:L={}}=e,{templateContext:W}=e,{origJson:q}=e,{layoutParams:H}=e;const G=v(Y);let Z;const K=G.getJsonWithVars(L.text_variable);let Q=!1;K||(Q=!0,G.logError(X(new Error('Missing "text_variable" in "input"')))),O=a(K&&G.getVariable(K,"string")||er("temp","string",""),(t=>I=t));let tt="";T=a(G.getDerivedFromVars(L.hint_text),(t=>z=t)),D=a(G.getDerivedFromVars(L.hint_color),(t=>P=t));let nt="";S=a(G.getDerivedFromVars(L.font_size),(t=>V=t));let ot,at,st=12;A=a(G.getDerivedFromVars(L.font_weight),(t=>F=t)),C=a(G.getDerivedFromVars(L.line_height),(t=>E=t)),k=a(G.getDerivedFromVars(L.letter_spacing),(t=>x=t));let lt="";$=a(G.getDerivedFromVars(L.text_color),(t=>w=t));let ut="#000";b=a(G.getDerivedFromVars(L.highlight_color),(t=>_=t));let ct="";y=a(G.getDerivedFromVars(L.keyboard_type),(t=>m=t));const dt={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let vt="multi_line_text",pt="text";f=a(G.getDerivedFromVars(L.max_visible_lines),(t=>h=t));let gt="",ht="";B=a(G.getDerivedFromVars(L.select_all_on_focus),(t=>N=t)),void 0===e.json&&n.json&&void 0!==L&&n.json(L),void 0===e.templateContext&&n.templateContext&&void 0!==W&&n.templateContext(W),void 0===e.origJson&&n.origJson&&void 0!==q&&n.origJson(q),void 0===e.layoutParams&&n.layoutParams&&void 0!==H&&n.layoutParams(H),tt=I,o=z,nt=it(P,1,nt),st=Rt(V,st),ot=Lt(F,ot);{const t=E;Mt(t)&&(at=t/st)}return _t(x)&&(lt=et(x/st*10)),ut=it(w,1,ut),ct=it(_,1,ct),m&&m in dt&&(pt=dt[m],vt=m),s="multi_line_text"===vt,l=G.getDerivedFromVars(L.paddings),U(),U=a(l,(t=>g=t)),Mt(h)&&(gt=`calc(${h*(at||1.25)+"em"} + ${rt($t(null==g?void 0:g.top,0)+$t(null==g?void 0:g.bottom,0))})`),u=G.getDerivedFromVars(L.accessibility),R(),R=a(u,(t=>p=t)),(null==p?void 0:p.description)?ht=p.description:G.logError(X(new Error('Missing accessibility "description" for input'),{level:"warn"})),c={"highlight-color":Boolean(ct),"vertical-overflow":!1,multiline:s},d={"--divkit-input-hint-color":nt,"--divkit-input-highlight-color":ct,"font-size":et(st),"font-weight":ot,"line-height":at,"letter-spacing":lt,color:ut,"max-height":gt},R(),U(),f(),y(),b(),$(),k(),C(),A(),S(),D(),T(),O(),B(),Q?"":`${M(Nt,"Outer").$$render(t,{cls:ft("input",ir,c),style:d,customDescription:!0,customActions:"input",json:L,origJson:q,templateContext:W,layoutParams:H},{},{default:()=>`<span${J("class",ir.input__wrapper,0)}><span${J("class",ir.input__holder,0)} aria-hidden="true"${J("this",undefined,0)}>\n ${j(tt)}${tt.endsWith("\n")||!tt?"​":""}</span>\n ${s?`<textarea${J("class",ir.input__input,0)} autocomplete="off" autocapitalize="off"${J("aria-label",ht,0)}${J("placeholder",o,0)}${J("this",Z,0)}>${j(tt,!0)}</textarea>`:`<input${J("type",pt,0)}${J("class",ir.input__input,0)} autocomplete="off" autocapitalize="off"${J("aria-label",ht,0)}${J("placeholder",o,0)}${J("value",tt,0)}${J("this",Z,0)}>`}</span>`})}`}))},ar=O(((t,e,r,n)=>{let{div:i}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=v(Y);let u,c,d;if(void 0===e.div&&r.div&&void 0!==i&&r.div(i),void 0===e.templateContext&&r.templateContext&&void 0!==o&&r.templateContext(o),void 0===e.origJson&&r.origJson&&void 0!==a&&r.origJson(a),void 0===e.layoutParams&&r.layoutParams&&void 0!==s&&r.layoutParams(s),u=i,c=o,d=u&&or[u.type]||void 0,!d&&(({templateContext:c,json:u}=l.processTemplate(u,c)),d=u&&or[u.type]||void 0,!d)){let t;t=(null==u?void 0:u.type)&&l.hasTemplate(u.type)?"Recursive template":"Unknown component",l.logError(X(new Error(t),{additional:{component:(null==u?void 0:u.type)||"<missing>"}}))}return d?`${M(d||z,"svelte:component").$$render(t,{json:u,templateContext:c,layoutParams:s,origJson:a||i},{},{})}`:""})),sr=ar,lr=O(((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${J("class","divkit-dc22b",0)} aria-hidden="true"><defs>${D([...Object.keys(i)],(t=>{let[e,r]=t.split(":");return`\n <filter${J("id",i[t],0)}><feFlood${J("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${J("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"${J("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function ur(t,e,r,n){const i=r[t.type];if(!i)return n(X(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 e(r,i){const o=Object.keys(i).filter((t=>"__proto__"!==t)),s=o.filter((t=>"$"!==t.charAt(0))),l=o.filter((t=>"$"===t.charAt(0)));return s.forEach((t=>{const n=i[t];"object"==typeof n&&null!==n?(r[t]=Array.isArray(n)?[]:{},e(r[t],n)):r[t]=n})),l.forEach((e=>{const o=i[e],s=a[o];if(void 0!==s){const t=e.substring(1);r[t]=s}else n(X(new Error("Missing template field"),{level:"warn",additional:{key:e,template:t.type}}))})),r}({},i);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(s[o]=t[o]);return{json:s,templateContext:a}}function cr(){}function dr(t){return{subscribe:e=>(e(t),cr)}}function vr(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function pr(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function gr(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 hr(t){var e=parseInt(t,10);if(e>Ue||e<Le)throw new Error(`Value ${t} can't be converted to Integer type.`);return e}function fr(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function mr(t,e,r,n){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,mr.prototype),i.expected=e,i.found=r,i.location=n,i.name="SyntaxError",i}function yr(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function _r(t,e){var r,n={},i=(e=void 0!==e?e:{}).grammarSource,o={start:Vt,JsonStringContents:function(){var t,e,r;for(t=ft,e=[],r=jt();r!==n;)e.push(r),r=jt();return mt=t,e=ht(e)}},a=Vt,s="@{",l="}",u="@{}",c="\\",d="||",v="&&",p="==",g="!=",h=">=",f="<=",m="+",y="-",_="true",b="false",w=/^[^}]/,$=/^[^'}]/,x=/^[0-9]/,k=/^[a-zA-Z_0-9.]/,E=/^[a-zA-Z_]/,C=/^[ \t\r\n]/,F=xt("@{",!1),A=xt("}",!1),V=xt("@{}",!1),j=xt("\\",!1),S={type:"any"},P=kt(["}"],!0,!1),D=xt("?",!1),z=xt(":",!1),M=xt("||",!1),T=xt("&&",!1),I=xt("==",!1),O=xt("!=",!1),J=xt(">=",!1),N=xt(">",!1),B=xt("<=",!1),R=xt("<",!1),U=xt("+",!1),L=xt("-",!1),W=xt("/",!1),q=xt("*",!1),H=xt("%",!1),G=xt("!",!1),Z=xt("(",!1),Y=xt(")",!1),X=xt(",",!1),K=Et("string"),Q=xt("'",!1),tt=kt(["'","}"],!0,!1),et=Et("integer"),rt=kt([["0","9"]],!1,!1),nt=Et("number"),it=xt(".",!1),ot=xt("e",!1),at=xt("E",!1),st=Et("boolean"),lt=xt("true",!1),ut=xt("false",!1),ct=kt([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),dt=Et("identifier"),vt=kt([["a","z"],["A","Z"],"_"],!1,!1),pt=Et("whitespace"),gt=kt([" ","\t","\r","\n"],!1,!1),ht=function(t){return gr(t)},ft=0,mt=0,yt=[{line:1,column:1}],_t=0,bt=[],wt=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 $t(){return t.substring(mt,ft)}function xt(t,e){return{type:"literal",text:t,ignoreCase:e}}function kt(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function Et(t){return{type:"other",description:t}}function Ct(e){var r,n=yt[e];if(n)return n;for(r=e-1;!yt[r];)r--;for(n={line:(n=yt[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return yt[e]=n,n}function Ft(t,e){var r=Ct(t),n=Ct(e);return{source:i,start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:n.line,column:n.column}}}function At(t){ft<_t||(ft>_t&&(_t=ft,bt=[]),bt.push(t))}function Vt(){var t,e;return t=ft,Ut(),(e=St())!==n?(Ut(),mt=t,t=e):(ft=t,t=n),t}function jt(){var e,r,i,o,a;if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n?(i=Ut(),(o=St())!==n?(Ut(),125===t.charCodeAt(ft)?(a=l,ft++):(a=n,0===wt&&At(A)),a!==n?(mt=e,e=o):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,t.substr(ft,3)===u?(r=u,ft+=3):(r=n,0===wt&&At(V)),r!==n&&(mt=e,r=""),(e=r)===n&&(e=ft,r=ft,wt++,92===t.charCodeAt(ft)?(i=c,ft++):(i=n,0===wt&&At(j)),i===n&&(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F))),wt--,i===n?r=void 0:(ft=r,r=n),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(S)),i!==n?(mt=e,e=$t()):(ft=e,e=n)):(ft=e,e=n),e===n))){if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n){if(i=[],w.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(P)),o!==n)for(;o!==n;)i.push(o),w.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(P));else i=n;i!==n?(125===t.charCodeAt(ft)?(o=l,ft++):(o=n,0===wt&&At(A)),o!==n?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ft=e,e=n)):(ft=e,e=n)}else ft=e,e=n;e===n&&(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F)),i!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(S)),i!==n?(mt=e,e=fr(i)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function St(){var e,r,i,o,a,s;return e=ft,(r=Pt())!==n?(Ut(),63===t.charCodeAt(ft)?(i="?",ft++):(i=n,0===wt&&At(D)),i!==n?(Ut(),(o=St())!==n?(Ut(),58===t.charCodeAt(ft)?(a=":",ft++):(a=n,0===wt&&At(z)),a!==n?(Ut(),(s=St())!==n?(mt=e,e={type:"ConditionalExpression",test:r,consequent:o,alternate:s}):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=Pt()),e}function Pt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Dt())!==n){for(i=[],o=ft,a=Ut(),t.substr(ft,2)===d?(s=d,ft+=2):(s=n,0===wt&&At(M)),s!==n?(l=Ut(),(u=Dt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Ut(),t.substr(ft,2)===d?(s=d,ft+=2):(s=n,0===wt&&At(M)),s!==n?(l=Ut(),(u=Dt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=pr(r,i)}else ft=e,e=n;return e}function Dt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=zt())!==n){for(i=[],o=ft,a=Ut(),t.substr(ft,2)===v?(s=v,ft+=2):(s=n,0===wt&&At(T)),s!==n?(l=Ut(),(u=zt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Ut(),t.substr(ft,2)===v?(s=v,ft+=2):(s=n,0===wt&&At(T)),s!==n?(l=Ut(),(u=zt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=pr(r,i)}else ft=e,e=n;return e}function zt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Mt())!==n){for(i=[],o=ft,a=Ut(),t.substr(ft,2)===p?(s=p,ft+=2):(s=n,0===wt&&At(I)),s===n&&(t.substr(ft,2)===g?(s=g,ft+=2):(s=n,0===wt&&At(O))),s!==n?(l=Ut(),(u=Mt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Ut(),t.substr(ft,2)===p?(s=p,ft+=2):(s=n,0===wt&&At(I)),s===n&&(t.substr(ft,2)===g?(s=g,ft+=2):(s=n,0===wt&&At(O))),s!==n?(l=Ut(),(u=Mt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=vr(r,i)}else ft=e,e=n;return e}function Mt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Tt())!==n){for(i=[],o=ft,a=Ut(),t.substr(ft,2)===h?(s=h,ft+=2):(s=n,0===wt&&At(J)),s===n&&(62===t.charCodeAt(ft)?(s=">",ft++):(s=n,0===wt&&At(N)),s===n&&(t.substr(ft,2)===f?(s=f,ft+=2):(s=n,0===wt&&At(B)),s===n&&(60===t.charCodeAt(ft)?(s="<",ft++):(s=n,0===wt&&At(R))))),s!==n?(l=Ut(),(u=Tt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Ut(),t.substr(ft,2)===h?(s=h,ft+=2):(s=n,0===wt&&At(J)),s===n&&(62===t.charCodeAt(ft)?(s=">",ft++):(s=n,0===wt&&At(N)),s===n&&(t.substr(ft,2)===f?(s=f,ft+=2):(s=n,0===wt&&At(B)),s===n&&(60===t.charCodeAt(ft)?(s="<",ft++):(s=n,0===wt&&At(R))))),s!==n?(l=Ut(),(u=Tt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=vr(r,i)}else ft=e,e=n;return e}function Tt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=It())!==n){for(i=[],o=ft,a=Ut(),43===t.charCodeAt(ft)?(s=m,ft++):(s=n,0===wt&&At(U)),s===n&&(45===t.charCodeAt(ft)?(s=y,ft++):(s=n,0===wt&&At(L))),s!==n?(l=Ut(),(u=It())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Ut(),43===t.charCodeAt(ft)?(s=m,ft++):(s=n,0===wt&&At(U)),s===n&&(45===t.charCodeAt(ft)?(s=y,ft++):(s=n,0===wt&&At(L))),s!==n?(l=Ut(),(u=It())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=vr(r,i)}else ft=e,e=n;return e}function It(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Ot())!==n){for(i=[],o=ft,a=Ut(),47===t.charCodeAt(ft)?(s="/",ft++):(s=n,0===wt&&At(W)),s===n&&(42===t.charCodeAt(ft)?(s="*",ft++):(s=n,0===wt&&At(q)),s===n&&(37===t.charCodeAt(ft)?(s="%",ft++):(s=n,0===wt&&At(H)))),s!==n?(l=Ut(),(u=Ot())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Ut(),47===t.charCodeAt(ft)?(s="/",ft++):(s=n,0===wt&&At(W)),s===n&&(42===t.charCodeAt(ft)?(s="*",ft++):(s=n,0===wt&&At(q)),s===n&&(37===t.charCodeAt(ft)?(s="%",ft++):(s=n,0===wt&&At(H)))),s!==n?(l=Ut(),(u=Ot())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=vr(r,i)}else ft=e,e=n;return e}function Ot(){var e,r,i;return(e=Bt())===n&&(e=Nt())===n&&(e=ft,33===t.charCodeAt(ft)?(r="!",ft++):(r=n,0===wt&&At(G)),r===n&&(43===t.charCodeAt(ft)?(r=m,ft++):(r=n,0===wt&&At(U)),r===n&&(45===t.charCodeAt(ft)?(r=y,ft++):(r=n,0===wt&&At(L)))),r!==n?(Ut(),(i=Ot())!==n?(mt=e,e={type:"UnaryExpression",operator:r,argument:i}):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=function(){var e,r,i,o,a;return e=ft,(r=Rt())!==n?(Ut(),40===t.charCodeAt(ft)?(i="(",ft++):(i=n,0===wt&&At(Z)),i!==n?(Ut(),o=function(){var e,r,i,o,a,s,l;if(e=ft,(r=St())!==n){for(i=[],o=ft,Ut(),44===t.charCodeAt(ft)?(a=",",ft++):(a=n,0===wt&&At(X)),a!==n?(Ut(),(s=St())!==n?o=s:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,Ut(),44===t.charCodeAt(ft)?(a=",",ft++):(a=n,0===wt&&At(X)),a!==n?(Ut(),(s=St())!==n?o=s:(ft=o,o=n)):(ft=o,o=n);mt=e,l=i,e=[r,...l]}else ft=e,e=n;return e===n&&(e=Ut()),e}(),o!==n?(Ut(),41===t.charCodeAt(ft)?(a=")",ft++):(a=n,0===wt&&At(Y)),a!==n?(mt=e,e={type:"CallExpression",callee:r,arguments:o}):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,(r=Rt())!==n&&(mt=e,r={type:"Variable",id:r}),(e=r)===n&&(e=function(){var e,r,i,o;return e=function(){var e,r,i,o;return wt++,e=ft,39===t.charCodeAt(ft)?(r="'",ft++):(r=n,0===wt&&At(Q)),r!==n?(i=function(){var t,e,r;for(t=ft,e=[],r=Jt();r!==n;)e.push(r),r=Jt();return mt=t,e=gr(e)}(),39===t.charCodeAt(ft)?(o="'",ft++):(o=n,0===wt&&At(Q)),o!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n),wt--,e===n&&(r=n,0===wt&&At(K)),e}(),e===n&&(e=Bt())===n&&(e=Nt())===n&&(e=function(){var e,r;return wt++,e=ft,t.substr(ft,4)===_?(r=_,ft+=4):(r=n,0===wt&&At(lt)),r!==n&&(mt=e,r={type:"BooleanLiteral",value:!0}),(e=r)===n&&(e=ft,t.substr(ft,5)===b?(r=b,ft+=5):(r=n,0===wt&&At(ut)),r!==n&&(mt=e,r={type:"BooleanLiteral",value:!1}),e=r),wt--,e===n&&(r=n,0===wt&&At(st)),e}(),e===n&&(e=ft,40===t.charCodeAt(ft)?(r="(",ft++):(r=n,0===wt&&At(Z)),r!==n&&(i=St())!==n?(41===t.charCodeAt(ft)?(o=")",ft++):(o=n,0===wt&&At(Y)),o!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n))),e}())),e}())),e}function Jt(){var e,r,i,o,a;if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n?(i=Ut(),(o=St())!==n?(Ut(),125===t.charCodeAt(ft)?(a=l,ft++):(a=n,0===wt&&At(A)),a!==n?(mt=e,e=o):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,t.substr(ft,3)===u?(r=u,ft+=3):(r=n,0===wt&&At(V)),r!==n&&(mt=e,r=""),(e=r)===n&&(e=ft,r=ft,wt++,92===t.charCodeAt(ft)?(i=c,ft++):(i=n,0===wt&&At(j)),i===n&&(39===t.charCodeAt(ft)?(i="'",ft++):(i=n,0===wt&&At(Q)),i===n&&(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F)))),wt--,i===n?r=void 0:(ft=r,r=n),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(S)),i!==n?(mt=e,e=$t()):(ft=e,e=n)):(ft=e,e=n),e===n))){if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n){if(i=[],$.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(tt)),o!==n)for(;o!==n;)i.push(o),$.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(tt));else i=n;i!==n?(125===t.charCodeAt(ft)?(o=l,ft++):(o=n,0===wt&&At(A)),o!==n?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ft=e,e=n)):(ft=e,e=n)}else ft=e,e=n;e===n&&(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F)),i!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(S)),i!==n?(mt=e,e=fr(i)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Nt(){var e,r,i,o;if(wt++,e=ft,45===t.charCodeAt(ft)?(r=y,ft++):(r=n,0===wt&&At(L)),r===n&&(r=null),i=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt)),o!==n)for(;o!==n;)i.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));else i=n;return i!==n?(mt=e,e={type:"IntegerLiteral",value:hr($t())}):(ft=e,e=n),wt--,e===n&&(r=n,0===wt&&At(et)),e}function Bt(){var e,r,i,o,a,s,l,u,c,d;for(wt++,e=ft,45===t.charCodeAt(ft)?(r=y,ft++):(r=n,0===wt&&At(L)),r===n&&(r=null),i=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));o!==n;)i.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));if(46===t.charCodeAt(ft)?(o=".",ft++):(o=n,0===wt&&At(it)),o!==n){if(a=[],x.test(t.charAt(ft))?(s=t.charAt(ft),ft++):(s=n,0===wt&&At(rt)),s!==n)for(;s!==n;)a.push(s),x.test(t.charAt(ft))?(s=t.charAt(ft),ft++):(s=n,0===wt&&At(rt));else a=n;if(a!==n){if(s=ft,101===t.charCodeAt(ft)?(l="e",ft++):(l=n,0===wt&&At(ot)),l===n&&(69===t.charCodeAt(ft)?(l="E",ft++):(l=n,0===wt&&At(at))),l!==n){if(43===t.charCodeAt(ft)?(u=m,ft++):(u=n,0===wt&&At(U)),u===n&&(45===t.charCodeAt(ft)?(u=y,ft++):(u=n,0===wt&&At(L))),u===n&&(u=null),c=[],x.test(t.charAt(ft))?(d=t.charAt(ft),ft++):(d=n,0===wt&&At(rt)),d!==n)for(;d!==n;)c.push(d),x.test(t.charAt(ft))?(d=t.charAt(ft),ft++):(d=n,0===wt&&At(rt));else c=n;c!==n?s=l=[l,u,c]:(ft=s,s=n)}else ft=s,s=n;s===n&&(s=null),mt=e,e={type:"NumberLiteral",value:parseFloat($t())}}else ft=e,e=n}else ft=e,e=n;if(e===n){if(e=ft,45===t.charCodeAt(ft)?(r=y,ft++):(r=n,0===wt&&At(L)),r===n&&(r=null),i=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt)),o!==n)for(;o!==n;)i.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));else i=n;if(i!==n)if(101===t.charCodeAt(ft)?(o="e",ft++):(o=n,0===wt&&At(ot)),o===n&&(69===t.charCodeAt(ft)?(o="E",ft++):(o=n,0===wt&&At(at))),o!==n){if(43===t.charCodeAt(ft)?(a=m,ft++):(a=n,0===wt&&At(U)),a===n&&(45===t.charCodeAt(ft)?(a=y,ft++):(a=n,0===wt&&At(L))),a===n&&(a=null),s=[],x.test(t.charAt(ft))?(l=t.charAt(ft),ft++):(l=n,0===wt&&At(rt)),l!==n)for(;l!==n;)s.push(l),x.test(t.charAt(ft))?(l=t.charAt(ft),ft++):(l=n,0===wt&&At(rt));else s=n;s!==n?(mt=e,e={type:"NumberLiteral",value:parseFloat($t())}):(ft=e,e=n)}else ft=e,e=n;else ft=e,e=n}return wt--,e===n&&(r=n,0===wt&&At(nt)),e}function Rt(){var e,r,i,o,a;if(wt++,e=ft,r=ft,wt++,i=function(){var e,r,i,o;return e=ft,t.substr(ft,4)===_?(r=_,ft+=4):(r=n,0===wt&&At(lt)),r===n&&(t.substr(ft,5)===b?(r=b,ft+=5):(r=n,0===wt&&At(ut))),r!==n?(i=ft,wt++,k.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(ct)),wt--,o===n?i=void 0:(ft=i,i=n),i!==n?e=r=[r,i]:(ft=e,e=n)):(ft=e,e=n),e}(),wt--,i===n?r=void 0:(ft=r,r=n),r!==n)if(E.test(t.charAt(ft))?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(vt)),i!==n){for(o=[],k.test(t.charAt(ft))?(a=t.charAt(ft),ft++):(a=n,0===wt&&At(ct));a!==n;)o.push(a),k.test(t.charAt(ft))?(a=t.charAt(ft),ft++):(a=n,0===wt&&At(ct));mt=e,e={type:"Identifier",name:$t()}}else ft=e,e=n;else ft=e,e=n;return wt--,e===n&&(r=n,0===wt&&At(dt)),e}function Ut(){var e,r;for(wt++,e=[],C.test(t.charAt(ft))?(r=t.charAt(ft),ft++):(r=n,0===wt&&At(gt));r!==n;)e.push(r),C.test(t.charAt(ft))?(r=t.charAt(ft),ft++):(r=n,0===wt&&At(gt));return wt--,r=n,0===wt&&At(pt),e}if((r=a())!==n&&ft===t.length)return r;throw r!==n&&ft<t.length&&At({type:"end"}),function(t,e,r){return new mr(mr.buildMessage(t,e),t,e,r)}(bt,_t<t.length?t.charAt(_t):null,_t<t.length?Ft(_t,_t+1):Ft(_t,_t))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(mr,Error),mr.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+":"+i.line+":"+i.column;if(n){var a=this.location.end,s=yr("",i.line.toString().length," "),l=n[i.line-1],u=(i.line===a.line?a.column:l.length+1)-i.column||1;e+="\n --\x3e "+o+"\n"+s+" |\n"+i.line+" | "+l+"\n"+s+" | "+yr("",i.column-1," ")+yr("",u,"^")}else e+="\n at "+o}return e},mr.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 br=new Map,wr=new Map;function $r(t,e,r){const n={args:e,cb:r},i=br.get(t)||[];br.has(t)||br.set(t,i),i.push(n);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");wr.set(o,n)}function xr(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 kr(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=>{kr(t,e)}));break;case"BinaryExpression":case"LogicalExpression":kr(t.left,e),kr(t.right,e);break;case"UnaryExpression":kr(t.argument,e);break;case"ConditionalExpression":kr(t.test,e),kr(t.consequent,e),kr(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{kr(t,e)}))}}function Er(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function Cr(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function Fr(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 Cr(t.value);if("color"===t.type)return Tr(Mr(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function Ar(t){let e=Fr(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function Vr(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}const jr=new Int32Array(1);function Sr(t){return jr[0]=t,jr[0]}function Pr(t){if(t<Le||t>Ue)throw new Error("Integer overflow.")}function Dr(t){const e=[];return kr(t,{Variable(t){e.push(t.id.name)}}),e}function zr(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function Mr(t){const e=ot(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function Tr(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 nt(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function Ir(t){return{type:He,value:Fr(t)}}function Or(t){const e=Number(t.value);if(isNaN(e)||!Number.isFinite(e))throw new Error("Unable to convert value to Number.");return{type:Ze,value:e}}function Jr(t,e,r){let n="";const i=t.type===He?t.value:Fr(t);for(;n.length+i.length<e.value;)n+=r.value;return n.length>0&&n.length+i.length>e.value&&(n=n.substring(0,e.value-i.length)),n}function Nr(t,e,r){const n=Jr(t,e,r);return{type:He,value:n+Fr(t)}}function Br(t,e,r){const n=Jr(t,e,r);return{type:He,value:Fr(t)+n}}function Rr(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value/e.value;return t.type===Ge&&(r=Sr(r)),{type:t.type,value:r}}function Ur(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value%e.value;return t.type===Ge&&(r=Sr(r)),{type:t.type,value:r}}function Lr(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e*=t[r].value,t[0].type===Ge&&(e=Sr(e));return{type:t[0].type,value:e}}function Wr(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e-=t[r].value,t[0].type===Ge&&(e=Sr(e));return{type:t.length?t[0].type:Ge,value:e}}function qr(...t){let e=0;for(let r=0;r<t.length;++r)e+=t[r].value,t[0].type===Ge&&(e=Sr(e));return{type:t.length?t[0].type:Ge,value:e}}function Hr(t){const e=Math.abs(t.value);return t.type===Ge&&Pr(e),{type:t.type,value:e}}function Gr(...t){if(!t.length)throw new Error("Non empty argument list is required for max function.");return{type:t[0].type,value:Math.max(...t.map((t=>t.value)))}}function Zr(...t){if(!t.length)throw new Error("Non empty argument list is required for min function.");return{type:t[0].type,value:Math.min(...t.map((t=>t.value)))}}function Yr(t){return{type:t.type,value:Math.sign(t.value)}}function Xr(t,e){let r;if(0===e.value&&t.type===Ge)r=t.value;else if(0===t.value&&t.type===Ge)r=0;else{let n=Math.sign(e.value);t.type===Ze&&0===n&&(n=Object.is(n,0)?1:-1),r=Math.abs(t.value)*n}return t.type===Ge&&Pr(r),{type:t.type,value:r}}function Kr(t){return e=>{const r=Mr(e.value);return{type:Ze,value:r[t]/255}}}function Qr(t){return(e,r)=>{const n=Mr(e.value);return n[t]=255*r.value,{type:Xe,value:Tr(n)}}}const tn=Kr("a"),en=Kr("r"),rn=Kr("g"),nn=Kr("b"),on=Qr("a"),an=Qr("r"),sn=Qr("g"),ln=Qr("b");function un(t,e,r){if(t.value<0)throw new Error("Expecting non-negative number of milliseconds.");let n=Math.floor(t.value/e);return r&&(n%=r),{type:Ge,value:n}}const cn=36e5;function dn(t){return t.map(Ar).join(", ")}$r("toString",[Ge],Ir),$r("toString",[Ze],Ir),$r("toString",[Ye],Ir),$r("toString",[Xe],Ir),$r("toString",["url"],Ir),$r("toNumber",[Ge],Or),$r("toNumber",[He],Or),$r("toInteger",[Ze],(function(t){if(t.value>Ue||t.value<Le)throw new Error("Unable to convert value to Integer.");const e=t.value-t.value%1;return{type:Ge,value:e}})),$r("toInteger",[He],(function(t){const e=Number(t.value);if(isNaN(e)||e%1!=0||e>Ue||e<Le)throw new Error("Unable to convert value to Integer.");return{type:Ge,value:e}})),$r("toInteger",[Ye],(function(t){return{type:Ge,value:t.value?1:0}})),$r("toBoolean",[Ge],(function(t){if(1!==t.value&&0!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Ye,value:t.value}})),$r("toBoolean",[He],(function(t){if("true"!==t.value&&"false"!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Ye,value:"true"===t.value?1:0}})),$r("encodeUri",[He],(function(t){try{return{type:He,value:encodeURIComponent(t.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),$r("decodeUri",[He],(function(t){try{return{type:He,value:decodeURIComponent(t.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),$r("parseUnixTime",[Ge],(function(t){return{type:Ke,value:new Date(1e3*t.value)}})),$r("nowLocal",[],(function(){return{type:Ke,value:new Date}})),$r("addMillis",[Ke,Ge],(function(t,e){return{type:Ke,value:new Date(t.value.getTime()+e.value)}})),$r("setYear",[Ke,Ge],(function(t,e){const r=new Date(t.value);return r.setFullYear(e.value),{type:Ke,value:r}})),$r("setMonth",[Ke,Ge],(function(t,e){if(e.value<1||e.value>12)throw new Error(`Expecting month in [1..12], instead got ${e.value}.`);const r=new Date(t.value);return r.setMonth(e.value-1),{type:Ke,value:r}})),$r("setDay",[Ke,Ge],(function(t,e){const r=new Date(t.value);if(e.value<=0&&-1!==e.value||e.value>function(t){const e=new Date(t);return e.setMonth(e.getMonth()+1),e.setDate(0),e.getDate()}(r))throw new Error(`Unable to set day ${e.value} for date ${Fr(t)}.`);return r.setDate(-1===e.value?0:e.value),{type:Ke,value:r}})),$r("setHours",[Ke,Ge],(function(t,e){if(e.value<0||e.value>23)throw new Error(`Expecting hours in [0..23], instead got ${e.value}.`);const r=new Date(t.value);return r.setHours(e.value-r.getTimezoneOffset()/60),{type:Ke,value:r}})),$r("setMinutes",[Ke,Ge],(function(t,e){if(e.value<0||e.value>59)throw new Error(`Expecting minutes in [0..59], instead got ${e.value}.`);const r=new Date(t.value);return r.setMinutes(e.value),{type:Ke,value:r}})),$r("setSeconds",[Ke,Ge],(function(t,e){if(e.value<0||e.value>59)throw new Error(`Expecting seconds in [0..59], instead got ${e.value}.`);const r=new Date(t.value);return r.setSeconds(e.value),{type:Ke,value:r}})),$r("setMillis",[Ke,Ge],(function(t,e){if(e.value<0||e.value>999)throw new Error(`Expecting millis in [0..999], instead got ${e.value}.`);const r=new Date(t.value);return r.setMilliseconds(e.value),{type:Ke,value:r}})),$r("getIntervalSeconds",[Ge],(function(t){return un(t,1e3,60)})),$r("getIntervalTotalSeconds",[Ge],(function(t){return un(t,1e3)})),$r("getIntervalMinutes",[Ge],(function(t){return un(t,6e4,60)})),$r("getIntervalTotalMinutes",[Ge],(function(t){return un(t,6e4)})),$r("getIntervalHours",[Ge],(function(t){return un(t,cn,24)})),$r("getIntervalTotalHours",[Ge],(function(t){return un(t,cn)})),$r("getIntervalTotalDays",[Ge],(function(t){return un(t,864e5)})),$r("getIntervalTotalWeeks",[Ge],(function(t){return un(t,6048e5)})),$r("len",[He],(function(t){return{type:Ge,value:t.value.length}})),$r("contains",[He,He],(function(t,e){return{type:Ye,value:t.value.includes(e.value)?1:0}})),$r("substring",[He,Ge,Ge],(function(t,e,r){if(r.value<e.value)throw new Error("Indexes should be in ascending order.");if(e.value<0||e.value>t.value.length||r.value<0||r.value>t.value.length)throw new Error("Indexes are out of bounds.");return{type:He,value:t.value.substring(e.value,r.value)}})),$r("replaceAll",[He,He,He],(function(t,e,r){let n;return n=e.value?t.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(e.value),"g"),r.value):t.value,{type:He,value:n}})),$r("index",[He,He],(function(t,e){return{type:Ge,value:t.value.indexOf(e.value)}})),$r("lastIndex",[He,He],(function(t,e){return{type:Ge,value:t.value.lastIndexOf(e.value)}})),$r("trim",[He],(function(t){return{type:He,value:t.value.trim()}})),$r("trimLeft",[He],(function(t){return{type:He,value:t.value.replace(/^\s+/,"")}})),$r("trimRight",[He],(function(t){return{type:He,value:t.value.replace(/\s+$/,"")}})),$r("toUpperCase",[He],(function(t){return{type:He,value:t.value.toUpperCase()}})),$r("toLowerCase",[He],(function(t){return{type:He,value:t.value.toLowerCase()}})),$r("padStart",[He,Ge,He],Nr),$r("padStart",[Ge,Ge,He],Nr),$r("padEnd",[He,Ge,He],Br),$r("padEnd",[Ge,Ge,He],Br),$r("div",[Ge,Ge],Rr),$r("div",[Ze,Ze],Rr),$r("mod",[Ge,Ge],Ur),$r("mod",[Ze,Ze],Ur),$r("mul",[{type:Ge,isVararg:!0}],Lr),$r("mul",[{type:Ze,isVararg:!0}],Lr),$r("sub",[{type:Ge,isVararg:!0}],Wr),$r("sub",[{type:Ze,isVararg:!0}],Wr),$r("sum",[{type:Ge,isVararg:!0}],qr),$r("sum",[{type:Ze,isVararg:!0}],qr),$r("abs",[Ge],Hr),$r("abs",[Ze],Hr),$r("max",[{type:Ge,isVararg:!0}],Gr),$r("max",[{type:Ze,isVararg:!0}],Gr),$r("min",[{type:Ge,isVararg:!0}],Zr),$r("min",[{type:Ze,isVararg:!0}],Zr),$r("maxNumber",[],(function(){return{type:Ze,value:We}})),$r("minNumber",[],(function(){return{type:Ze,value:qe}})),$r("maxInteger",[],(function(){return{type:Ge,value:Ue}})),$r("minInteger",[],(function(){return{type:Ge,value:Le}})),$r("round",[Ze],(function(t){const e=Math.sign(t.value);return{type:Ze,value:e*Math.round(Math.abs(t.value))}})),$r("floor",[Ze],(function(t){return{type:Ze,value:Math.floor(t.value)}})),$r("ceil",[Ze],(function(t){return{type:Ze,value:Math.ceil(t.value)}})),$r("signum",[Ze],Yr),$r("signum",[Ge],Yr),$r("copySign",[Ze,Ze],Xr),$r("copySign",[Ge,Ge],Xr),$r("getColorAlpha",[He],tn),$r("getColorAlpha",[Xe],tn),$r("getColorRed",[He],en),$r("getColorRed",[Xe],en),$r("getColorGreen",[He],rn),$r("getColorGreen",[Xe],rn),$r("getColorBlue",[He],nn),$r("getColorBlue",[Xe],nn),$r("setColorAlpha",[He,Ze],on),$r("setColorAlpha",[Xe,Ze],on),$r("setColorRed",[He,Ze],an),$r("setColorRed",[Xe,Ze],an),$r("setColorGreen",[He,Ze],sn),$r("setColorGreen",[Xe,Ze],sn),$r("setColorBlue",[He,Ze],ln),$r("setColorBlue",[Xe,Ze],ln),$r("rgb",[Ze,Ze,Ze],(function(t,e,r){const n={a:255,r:255*t.value,g:255*e.value,b:255*r.value};return{type:Xe,value:Tr(n)}})),$r("argb",[Ze,Ze,Ze,Ze],(function(t,e,r,n){const i={a:255*t.value,r:255*e.value,g:255*r.value,b:255*n.value};return{type:Xe,value:Tr(i)}}));const vn={StringLiteral:function(t,e){return{type:He,value:e.value}},NumberLiteral:function(t,e){return{type:Ze,value:e.value}},IntegerLiteral:function(t,e){return{type:Ge,value:e.value}},BooleanLiteral:function(t,e){return{type:Ye,value:e.value?1:0}},UnaryExpression:function(t,e){const r=Er(pn(t,e.argument));switch(e.operator){case"!":if(r.type===Ye)return{type:Ye,value:r.value?0:1};zr(`${e.operator}${Ar(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const t="+"===e.operator?1:-1;if(r.type===Ge)return{type:Ge,value:r.value*t};if(r.type===Ze)return{type:Ze,value:r.value*t};zr(`${e.operator}${Ar(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=Er(pn(t,e.test));if(r.type===Ye)return r.value?pn(t,e.consequent):pn(t,e.alternate);zr(`${Ar(r)} ? ${Ar(pn(t,e.consequent))} : ${Ar(pn(t,e.alternate))}`,"Ternary must be called with a Boolean value as a condition.")},TemplateLiteral:function(t,e){let r="";if(2===e.quasis.length&&""===e.quasis[0].value&&""===e.quasis[1].value)return pn(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=Fr(pn(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:He,value:r}},LogicalExpression:function(t,e){const r=Er(pn(t,e.left));if(r.type!==Ye&&zr(`${Ar(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Ye,value:0};const n=Er(pn(t,e.right));return n.type!==Ye&&zr(`${Ar(r)} ${e.operator} ${Ar(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${Vr(n.type)}.`),{type:Ye,value:n.value}},BinaryExpression:function(t,e){const r=e.operator,n=pn(t,e.left),i=pn(t,e.right);if(n.type!==i.type&&zr(`${Ar(n)} ${e.operator} ${Ar(i)}`,`Operator '${r}' cannot be applied to different types: ${Vr(n.type)} and ${Vr(i.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===Ke&&r.type===Ke?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:Ye,value:n?1:0}}(r,n,i);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==Ze&&e.type!==Ge&&e.type!==Ke&&zr(`${Ar(e)} ${t} ${Ar(r)}`,`Operator '${t}' cannot be applied to ${Vr(e.type)} type.`);const i=e.type===Ke?e.value.getTime():e.value,o=r.type===Ke?r.value.getTime():r.value;return n=">"===t?i>o:">="===t?i>=o:"<"===t?i<o:i<=o,{type:Ye,value:n?1:0}}(r,n,i);if("+"===r||"-"===r)return function(t,e,r){if(e.type!==He&&e.type!==Ze&&e.type!==Ge&&zr(`${Ar(e)} ${t} ${Ar(r)}`,`Operator '${t}' cannot be applied to ${Vr(e.type)} type.`),e.type===He)return"-"===t&&zr(`${Ar(e)} - ${Ar(r)}`,`Operator '${t}' cannot be applied to ${Vr(e.type)} type.`),{type:He,value:e.value+r.value};let n="+"===t?e.value+r.value:e.value-r.value;return e.type===Ge&&(n=Sr(n)),{type:e.type,value:n}}(r,n,i);if("/"===r||"*"===r||"%"===r)return function(t,e,r){let n;if(e.type!==Ge&&e.type!==Ze&&zr(`${Ar(e)} ${t} ${Ar(r)}`,`Operator '${t}' cannot be applied to ${Vr(e.type)} type.`),"*"===t)n=e.value*r.value;else{if("/"!==t&&"%"!==t)throw new Error(`Unsupported operation ${t}`);0===r.value&&zr(`${Ar(e)} ${t} ${Ar(r)}`,"Division by zero is not supported."),n="/"===t?e.value/r.value:e.value%r.value}return e.type===Ge&&(n=Sr(n)),{type:e.type,value:n}}(r,n,i);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;if(!br.has(r))throw new Error(`Unknown function name: ${r}.`);let n;const i=e.arguments.map((e=>pn(t,e))),o=r+":"+i.map((t=>t.type)).join("#");if(wr.has(o))n=wr.get(o);else{const t=function(t,e){const r=br.get(t);if(!r)throw new Error("Missing function");let n=null;for(let t=0;t<r.length;++t){const i=xr(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){const e=i.map((t=>Vr(t.type))).join(", "),n=`${r}(${dn(i)})`;"few"===t.type&&0===i.length?zr(n,`Non empty argument list is required for function '${r}'.`):(t.type,zr(n,`Function '${r}' has no matching override for given argument types: ${e}.`))}n=t}if(!n)throw new Error("Function not found");try{return n.cb(...i)}catch(t){zr(`${r}(${dn(i)})`,t.message)}},Variable:function(t,e){const r=e.id.name,n=t.get(r);if(n)return function(t){return{type:t.getType(),value:t.getValue()}}(n);throw new Error(`Variable '${r}' has value null`)}};function pn(t,e){if(e.type in vn)return vn[e.type](t,e);throw new Error("Unsupported expression")}function gn(t,e){try{return pn(t,e)}catch(t){return{type:"error",value:t.message}}}class hn{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return kr(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=gn(t,this.ast);if("error"===r.type)return void e(X(new Error("Expression execution error"),{additional:{message:r.value}}));const n=r.value;if(n instanceof Date)return Cr(n);if("boolean"===r.type)return Boolean(n);if("color"===r.type){const t=ot(String(n));if(t)return Tr(t);e(X(new Error("Expression execution error")))}return n}catch(t){return void e(X(new Error("Expression execution error")))}}}function fn(t,e,r){if(t)if("string"==typeof t){if((n=t).indexOf("@{")>-1||n.indexOf("\\")>-1){e.hasExpression=!0;try{const r=_r(t,{startRule:"JsonStringContents"}),n=Dr(r);return e.vars.push(...n),new hn(r)}catch(e){return void r(X(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>fn(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=fn(t[i],e,r);return n}}var n;return t}function mn(t,e,r){if(t){if(t instanceof hn)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>mn(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=mn(t[i],e,r);return n}}return t}function yn(t,e){const r={vars:[],hasExpression:!1},n=fn(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>mn(n,t,e)}}const _n={pagers:function(){return U(new Map)}},bn=new Map,wn=new Map;function $n(t){const e=bn.get(t)||U("");return bn.has(t)||bn.set(t,e),e}function xn(t){const e=wn.get(t)||new Map;return wn.has(t)||wn.set(t,e),e}class kn{setVariable(t){const e=t.getName(),r=xn(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),$n(this).set(e)}getVariable(t){return xn(this).get(t)}}function En(){return new kn}function Cn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const Fn=new Set(["start","stop","pause","resume","cancel","reset"]);class An{constructor(t){Cn(this,"timers",new Map),Cn(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(X(new Error("Misconfigured timer"),{additional:{id:t.id}})):this.logError(X(new Error("Missing timer id")))}execTimerAction(t,e){if(!(t&&e&&this.timers.has(t)&&Fn.has(e)))return void this.logError(X(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"))}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),this.stop(t)}),Math.max(0,e-(t.durationPassed||0))));const r=t.tick;if(r){const e=()=>{t.tickStarted=performance.now(),t.tickTimeout=window.setTimeout((()=>{this.tickOrUnholdAction(t),t.tickPassed=0,e()}),Math.max(0,r-(t.tickPassed||0)))};e()}}start(t){if("running"===t.state)return void this.logError(X(new Error("The timer is already running")));if("paused"===t.state)return void this.logError(X(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(X(new Error("Incorrect timer properties"),{additional:{id:t.definition.id}})):this.startOrResume(t)):this.logError(X(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(X(new Error("The timer has already been stopped")))}pause(t){if("stopped"===t.state)return void this.logError(X(new Error("The timer has already been stopped")));if("paused"===t.state)return void this.logError(X(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(X(new Error("The timer is already running"))):this.logError(X(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,!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)}}}const Vn=O(((t,e,r,n)=>{let i,o;var s,l,u,v;let{id:p}=e,{json:g={}}=e,{platform:h="auto"}=e,{theme:f="system"}=e,{globalVariablesController:m=new kn}=e,{mix:y=""}=e,{customization:b={}}=e,{builtinProtocols:w=["http","https","tel","mailto","intent"]}=e,{onError:$}=e,{onStat:x}=e,{onCustomAction:k}=e,{onComponent:E}=e,C=U("desktop"===h);if(o=a(C,(t=>i=t)),"auto"===h&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");C.set(!t.matches),t.addListener((()=>{C.set(!t.matches)}))}let F="light",A=null;function V(t){f=t}function S(){}const P=new Set(w);let D=!1;g||(D=!0,Z(X(new Error('"json" prop is required')))),p||(D=!0,Z(X(new Error('"id" prop is required'))));let z=function(t){if(!t)return X(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return X(new Error("Missing card"));if(!e.states||!e.states.length)return X(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in or)return X(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return X(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return X(new Error("Missing state_id"),{additional:{index:t}})}return null}(g);const T=g.templates||{};z&&(D=!0,Z(z));const I={stateChange:!1},O=$n(m),J=xn(m),N=new Map,B=new Map,R=new Map;let W=null;function q(t,e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e){const r=B.get(t);r&&r.setValue(e)}}function H(t){const e=B.get(t);return null==e?void 0:e.getValue()}function G(t){const e=yn(t,Z);return e.vars.length?e.applyVars(B):t}function Z(t){$?$({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function K(t,e){x&&x({type:t,action:e})}let Q=0;function tt(t){return`${p}-${Q++}`}let et={},rt={};function nt(t){const e=t.url?String(t.url):"";if(e)try{const t=e.replace(/div-action:\/\//,""),r=/([^?]+)\?(.+)/.exec(t);if(!r)return;const n=new URLSearchParams(r[2]);switch(r[1]){case"set_state":!function(t){if(!t)throw new Error("Missing state id");let e=dt,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}}(n.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(isNaN(Number(e)))throw new Error('Incorrect item for "set-current-item" action');const r=lt(t);r&&r.setCurrentItem(Number(e))}(n.get("id"),n.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=lt(t);r&&r.setPreviousItem(e)}(n.get("id"),n.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=lt(t);r&&r.setNextItem(e)}(n.get("id"),n.get("overflow"));break;case"set_variable":const r=n.get("name"),i=n.get("value");if(r&&null!==i){const t=B.get(r);t?t.set(i):Z(X(new Error("Cannot find variable"),{additional:{name:r}}))}else Z(X(new Error("Incorrect set_variable_action"),{additional:{url:t}}));break;case"timer":const o=n.get("action"),a=n.get("id");W?W.execTimerAction(a,o):Z(X(new Error("Incorrect timer action"),{additional:{id:a,action:o}}));break;default:Z(X(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){Z(X(t,{additional:{url:e}}))}}async function it(t,e){if(t){for(let r=0;r<t.length;++r){let n=t[r];const i=n.url;if(i){const t=pt(i);if(t)if(gt(t,P)){if(e)if("_blank"===n.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=i)}else location.href=i}else"div-action"===t?(nt(n),await _()):n.log_id&&(ot(n),await _())}}t.forEach((t=>{t.log_id&&K("click",t)}))}}function ot(t){null==k||k(t)}const at=new Map;function lt(t){if(at.has(t))return at.get(t);Z(X(new Error("Missing instance with id"),{additional:{id:t}}))}const ut=new Map;function ct(t){for(const e of t)B.has(e)&&t.delete(e);return t}d(Y,{logError:Z,logStat:K,hasTemplate:function(t){return t in T},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in T;){if(({json:t,templateContext:e}=ur(t,e,T,Z)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:tt,genClass:function(t){return`divkit-${tt()}`},execAction:nt,execAnyActions:it,execCustomAction:ot,isRunning:function(t){return I[t]},setRunning:function(t,e){I[t]=e},registerInstance:function(t,e){at.has(t)?Z(X(new Error("Duplicate instance id"),{additional:{id:t}})):at.set(t,e)},unregisterInstance:function(t){at.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(rt[r]=rt[r]||0,++rt[r],et[r])return et[r];const n=`${tt()}-svg-filter`;return et=Object.assign(Object.assign({},et),{[r]:n}),n},removeSvgFilter:function(t,e){t&&rt[t]&&0==--rt[`${t}:${e}`]&&(et=Object.keys(et).reduce(((t,e)=>(rt[e]&&(t[e]=et[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return dr(t);const e=yn(t,Z);return e.vars.length?L(e.vars.map((t=>B.get(t)||function(t){const e=R.get(t)||U(void 0);return R.has(t)||R.set(t,e),e}(t))).filter(st),(()=>e.applyVars(B))):e.hasExpression?dr(e.applyVars(B)):dr(t)},getJsonWithVars:G,getStore:function(t){return ut.has(t)||function(t){ut.has(t)||ut.set(t,_n[t]())}(t),ut.get(t)},getVariable:function(t,e){const r=B.get(t);if(r){const n=r.getType();if(n!==e)return void Z(X(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:n}}))}return r},getCustomization:function(t){return null==b?void 0:b[t]},getBuiltinProtocols:function(){return P},isDesktop:C,registerComponent:void 0,unregisterComponent:void 0}),d(St,{hasAction:()=>!1});const dt={setState(t){throw new Error("Not implemented")},getChild(t){if(vt&&vt.has(t))return vt.get(t);Z(X(new Error("Missing state block with id"),{additional:{id:t}}))}};let vt=null;d(mt,{registerInstance(t,e){vt||(vt=new Map),vt.has(t)?Z(X(new Error("Duplicate state with id"),{additional:{id:t}})):vt.set(t,e)},unregisterInstance(t){null==vt||vt.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 ht=null===(s=null==g?void 0:g.card)||void 0===s?void 0:s.variables;Array.isArray(ht)&&ht.forEach((t=>{if(t&&t.type in tr&&t.name){if(N.has(t.name))return void Z(X(new Error("Duplicate variable"),{additional:{name:t.name}}));try{const e=er(t.name,t.type,t.value);N.set(t.name,e),B.set(t.name,e)}catch(e){Z(X(e,{additional:{name:t.name}}))}}}));const ft=g.palette;ft&&ft[F].forEach((t=>{if(N.has(t.name))Z(X(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=er(t.name,"color",t.color);N.set(t.name,e),B.set(t.name,e)}catch(e){Z(X(e,{additional:{name:t.name}}))}}));for(const[t,e]of J)B.has(t)||B.set(t,e);O.subscribe((t=>{if(t&&!B.has(t)){const e=J.get(t);B.set(t,e);const r=R.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const yt=null===(l=null==g?void 0:g.card)||void 0===l?void 0:l.variable_triggers;Array.isArray(yt)&&yt.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void Z(X(new Error("variable_trigger has a condition that is not a string"),{additional:{condition:t.condition}}));const r=t.mode||"on_condition";if("on_variable"===r||"on_condition"===r)try{const n=_r(t.condition,{startRule:"JsonStringContents"}),i=Dr(n);if(!i.length)return void Z(X(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return ct(e),e.size?new Promise((t=>{const r=O.subscribe((()=>{ct(e),e.size||(r(),t())}))})):Promise.resolve()})(i).then((()=>{L(i.map((t=>B.get(t))).filter(st),(()=>gn(B,n))).subscribe((n=>{"error"!==n.type?(n.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=G(t);e.log_id&&nt(e)})),e=Boolean(n.value)):Z(X(new Error("variable_trigger condition execution error"),{additional:{message:n.value}}))}))}))}catch(e){Z(X(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else Z(X(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));const _t=null===(u=null==g?void 0:g.card)||void 0===u?void 0:u.timers;if(_t){const t=W=new An({logError:Z,applyVars:G,hasVariableWithType:function(t,e){const r=B.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=B.get(t);r?r.setValue(e):Z(X(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:it});_t.forEach((e=>t.createTimer(e)))}const bt=null===(v=null==g?void 0:g.card)||void 0===v?void 0:v.states,wt=bt&&!D?{type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:bt.map((t=>({state_id:t.state_id.toString(),div:t.div})))}:void 0;return c((()=>{W&&W.destroy()})),void 0===e.id&&r.id&&void 0!==p&&r.id(p),void 0===e.json&&r.json&&void 0!==g&&r.json(g),void 0===e.platform&&r.platform&&void 0!==h&&r.platform(h),void 0===e.theme&&r.theme&&void 0!==f&&r.theme(f),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==m&&r.globalVariablesController(m),void 0===e.mix&&r.mix&&void 0!==y&&r.mix(y),void 0===e.customization&&r.customization&&void 0!==b&&r.customization(b),void 0===e.builtinProtocols&&r.builtinProtocols&&void 0!==w&&r.builtinProtocols(w),void 0===e.onError&&r.onError&&void 0!==$&&r.onError($),void 0===e.onStat&&r.onStat&&void 0!==x&&r.onStat(x),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==k&&r.onCustomAction(k),void 0===e.onComponent&&r.onComponent&&void 0!==E&&r.onComponent(E),void 0===e.setTheme&&r.setTheme&&void 0!==V&&r.setTheme(V),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==S&&r.getDebugVariables(S),void 0===e.setVariable&&r.setVariable&&void 0!==q&&r.setVariable(q),void 0===e.getVariable&&r.getVariable&&void 0!==H&&r.getVariable(H),void 0===e.execAction&&r.execAction&&void 0!==nt&&r.execAction(nt),"light"===f||"dark"===f?F=f:"system"===f?"undefined"!=typeof matchMedia?(A||(A=matchMedia("(prefers-color-scheme: dark)"),A.addListener((function(){"system"===f&&A&&(F=A.matches?"dark":"light")}))),F=A.matches?"dark":"light"):F="light":Z(X(new Error("Unsupported theme"))),F&&(ft&&ft[F].forEach((t=>{const e=B.get(t.name);e&&e.setValue(t.color)}))),o(),!D&&wt?`<div class="${j("divkit-b023c",!0)+j(i?" divkit-ee112":"",!0)+j(y?` ${y}`:"",!0)}">${M(lr,"RootSvgFilters").$$render(t,{svgFiltersMap:et},{},{})}\n ${M(sr,"Unknown").$$render(t,{div:wt,templateContext:{}},{},{})}</div>`:""})),jn=Vn;function Sn(t){return jn.render({id:t.id,json:t.json,globalVariablesController:t.globalVariablesController,mix:t.mix,customization:t.customization,builtinProtocols:t.builtinProtocols,onError:t.onError,platform:t.platform}).html}var Pn=exports;for(var Dn in e)Pn[Dn]=e[Dn];e.__esModule&&Object.defineProperty(Pn,"__esModule",{value:!0})})();
2
2
  //# sourceMappingURL=server.js.map