@divkitframework/divkit 18.0.0 → 19.0.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.
@@ -1,2 +1,2 @@
1
- var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};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.d(e,{M:()=>cn,Os:()=>We,sY:()=>dn}),new Set,new Map;const p=[],g=[],f=[],h=[],m=Promise.resolve();let y=!1;function _(){return y||(y=!0,m.then(x)),m}function b(t){f.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<f.length;t+=1){const e=f[t];w.has(e)||(w.add(e),e())}f.length=0}while(p.length);for(;h.length;)h.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=T(n):r.style=T(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 D(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]=D(t[r]);return e}function z(t,e){let r="";for(let n=0;n<t.length;n+=1)r+=e(t[n],n);return r}const P={$$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 I,O;function J(t){function e(e,r,n,i,o){const a=s;l({$$:{on_destroy:I,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}={})=>{I=[];const o={title:"",head:"",css:new Set},a=e(o,t,{},r,n);return i(I),{html:a,css:{code:Array.from(o.css).map((t=>t.code)).join("\n"),map:null},head:o.title+o.head}},$$render:e}}function N(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${j(e,!0)}"`}`}function T(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${t[e]};`)).join(" ")}function B(t){const e=T(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{subscribe:U(n,(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}}const L=Symbol("root");function q(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const H={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"},G={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 Y(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 Z(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 X(t){let e=Z(t);return"0"===e&&(e+="em"),e}function K(t,e){for(;t.length<e;)t="0"+t;return t}function Q(t,e=1,r="transparent"){if("#"!==(t=(t||"").toLowerCase()).charAt(0))return r;const n=tt(t);return n?(n.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>K(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(n)):r}function tt(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 et(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 rt=Boolean;function nt(t){if(1===t.length&&"solid"===t[0].type)return{color:Q(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=Q(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(rt);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>Q(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:at(t.bg.scale),pos:st(t.bg),image:'url("'+et(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(rt);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=X(n.value):"relative"===n.type&&(i=it[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${i||"farthest-corner"} at ${ot(t.bg.center_x)} ${ot(t.bg.center_y)},`+r.map((t=>Q(t))).join(",")+")"}}({bg:t}):void 0)).filter(rt).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 it={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function ot(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return X(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function at(t){return"fill"!==t&&t?"fit"===t?"contain":void 0:"cover"}function st(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 lt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}const ct=new Set(["http","https","tel","mailto","intent"]);function ut(t){return ct.has(t)}function dt(t,e){e&&t.push(e)}function vt(t,e,r){const n=[];dt(n,e[t]);for(const i in r)if(r.hasOwnProperty(i)){const o=r[i];o&&dt(n,e[`${t}_${i}`+("string"==typeof o?`_${o}`:"")])}return n.join(" ")}const pt=Symbol("state");function gt(t){return Z(t.top||0)+" "+Z(t.right||0)+" "+Z(t.bottom||0)+" "+Z(t.left||0)}function ft(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function ht(t){return ft(t)&&t>=0}function mt(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]&&!ht(r[t]))return e;return gt(t)}function yt(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const _t=Object.prototype.hasOwnProperty;function bt(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(!_t.call(e,i)||!bt(t[i],e[i]))return!1}return!0}function wt(t,e){return bt(t,e)?e:t}function $t(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function xt(t,e){const r=Number(t);return isNaN(r)?e:r}function kt(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...kt(t))})):e.push(t),e}function Et(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>Z((t||e)/r*10))).join(" ")}function Ct(){}const Ft=Symbol("action"),At=J(((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=Ct}=e,{customAction:p=null}=e,{isNativeActionAnimation:g=!0}=e;const f=v(L),h=v(Ft);d(Ft,{hasAction:()=>Boolean(h.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)&&h.hasAction()&&(y="",f.logError(q(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:i}})));let _=Boolean(p);return y&&!ut(lt(y))&&(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!==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:D(y)},{target:D(m)},{style:D(l)},{class:j(s,!0)+" "+j(g?"divkit-bd259":"divkit-d9099",!0)+" "+j(null!=a&&a.length?"divkit-f0cba":"",!0)},S(c)],{})}>${n.default?n.default({}):""}</a>`:`<span${F([{class:j(s,!0)+j(_?` ${g?"divkit-bd259":"divkit-d9099"} divkit-c016b`:"",!0)+" "+j(null!=a&&a.length?"divkit-f0cba":"",!0)},{style:D(l)},{role:D(_?"button":null)},{tabindex:D(_?0:null)},S(c)],{})}>${n.default?n.default({}):""}</span>`}));function Vt(t){return ft(t)&&t>0}function jt(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(Vt(t.radius))return`blur(${X(t.radius/2)})`}else e(q(new Error("Unknown filter"),{level:"warn",additional:{filter:null==t?void 0:t.type}}))})).filter(Boolean).join(" ")}const Dt=J(((t,e,r,n)=>{let i,{background:o=[]}=e,{radius:a=""}=e;const s=v(L);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=nt([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=jt(t.filters,s.logError)))}return r})),`<span${N("class","divkit-bf253"+(a?" divkit-dcad7":""),0)}${B({"border-radius":a})}>${z(i,(t=>t.image_url?`<img${N("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${N("class","divkit-b921d",0)}${N("style",Y(t.style),0)}>`:`<span${N("class","divkit-b921d",0)}${N("style",Y(t.style),0)}></span>`))}</span>`})),St=Dt,zt=J(((t,e,n,i)=>{let o,s,l,c,u,d,p,g,f,h,m,y,b,w,$,x,k,E,C,F,A,V,j,D,S,z,P,I,O,J,T,B,R,U,W,H,K,tt,et,rt,it,ot=r,at=r,st=r,ct=r,dt=r,ft=r,_t=r,bt=r,Ct=r,Ft=r,Vt=r,jt=r,Dt=r,zt=r,Pt=r,Mt=r,It=r;var Ot,Jt,Nt,Tt,Bt,Rt;let{json:Ut={}}=e,{origJson:Wt}=e,{templateContext:Lt}=e,{cls:qt=""}=e,{style:Ht}=e,{layoutParams:Gt={}}=e,{customDescription:Yt=!1}=e,{customPaddings:Zt=!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(L),ie=v(pt);let oe,ae,se,le,ce,ue,de,ve={},pe={},ge=!1,fe=1,he="transparent",me=0,ye={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},_e="",be=null,we="",$e={},xe=0,ke=0,Ee=0,Ce=!1,Fe=!1,Ae={},Ve=0,je=0,De=0,Se=!1,ze=!1,Pe=1;const Me=Gt.fakeElement?[]:Ut.transition_triggers||["state_change","visibility_change"],Ie=-1!==Me.indexOf("state_change")&&Ut.id,Oe=-1!==Me.indexOf("visibility_change")&&Ut.id;let Je,Ne,Te,Be,Re,Ue,We,Le,qe,He=[],Ge=[],Ye=[],Ze=[],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!==Yt&&n.customDescription(Yt),void 0===e.customPaddings&&n.customPaddings&&void 0!==Zt&&n.customPaddings(Zt),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),It(),It=a(o,(t=>it=t));{let t={},e={},r=!1,n="";if(it){if(it.has_shadow){const e=it.shadow;t["box-shadow"]=e?Z((null===(Jt=null===(Ot=e.offset)||void 0===Ot?void 0:Ot.x)||void 0===Jt?void 0:Jt.value)||0)+" "+Z((null===(Tt=null===(Nt=e.offset)||void 0===Nt?void 0:Nt.y)||void 0===Tt?void 0:Tt.value)||0)+" "+Z(null!==(Bt=e.blur)&&void 0!==Bt?Bt:2)+" "+Q(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(it.stroke&&(r=!0,fe=yt(it.stroke.width,fe),he=Q(it.stroke.color,1,he),e.border=`${Z(fe)} solid ${he}`),it.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]&&!ht(r[t]))return e;return t}(it.corners_radius,ye),e["border-radius"]=t["border-radius"]=Et(ye)):it.corner_radius&&(me=yt(it.corner_radius,me),ye={"top-left":me,"top-right":me,"bottom-right":me,"bottom-left":me},e["border-radius"]=t["border-radius"]=Z(me)),r&&fe&&(it.corners_radius||it.corner_radius)){let t=Object.assign({},ye);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+fe/2})),n=Et(t)}}ve=wt(t,ve),pe=wt(e,pe),ge=r,_e=n}s=ne.getDerivedFromVars(Ut.paddings),Mt(),Mt=a(s,(t=>rt=t)),be=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]]&&!ht(t[r[n]]))return e;return t}(rt&&!Zt?rt:void 0,be),l=gt(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}(be,te)),c=ne.getDerivedFromVars(Ut.margins),zt(),zt=a(c,(t=>tt=t)),we=mt(tt,we),u=ne.getDerivedFromVars(Ut.width),jt(),jt=a(u,(t=>H=t)),d=ne.getDerivedFromVars(Ut.alignment_horizontal),Pt(),Pt=a(d,(t=>et=t));{let t,e,r={},n=0,i=0,o=!1,a=!1;const s=null==H?void 0:H.type;if("fixed"===s?(xe=yt(null==H?void 0:H.value,xe),e=Z(xe)):"wrap_content"===s||!Gt.overlapParent&&"match_parent"===s&&Gt.parentHorizontalWrapContent?(t="content",("wrap_content"===s&&(null==H?void 0:H.constrained)||"match_parent"===s&&Gt.parentHorizontalWrapContent)&&(r["width-constrained"]=!0,i=1),"match_parent"===s&&ne.logError(q(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(q(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===Gt.parentLayoutOrientation?e=`calc(100% - ${X(((null==tt?void 0:tt.left)||0)+((null==tt?void 0:tt.right)||0))})`:"horizontal"===Gt.parentContainerOrientation&&(n=H&&"weight"in H&&H.weight||1,Gt.parentContainerWrap&&(o=!0))),"content"===t&&Kt&&(t="parent",ne.logError(q(new Error("Incorrect usage of width with value 'wrap_content'"),{level:"warn"}))),"parent"===t)r["halign-self"]="stretch";else{const t=et;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=wt(r,$e),Ce=o,Fe=a}p=ne.getDerivedFromVars(Ut.height),Vt(),Vt=a(p,(t=>W=t)),g=ne.getDerivedFromVars(Ut.alignment_vertical),Dt(),Dt=a(g,(t=>K=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=yt(null==W?void 0:W.value,Ve),e=Z(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(q(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(q(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===Gt.parentLayoutOrientation?e=`calc(100% - ${X(((null==tt?void 0:tt.top)||0)+((null==tt?void 0:tt.bottom)||0))})`:"vertical"===Gt.parentContainerOrientation&&(n=(null==W?void 0:W.weight)||1,Gt.parentContainerWrap&&(o=!0))),"content"===t&&Qt&&(t="parent",ne.logError(q(new Error("Incorrect usage of height with value 'wrap_content'"),{level:"warn"}))),"parent"===t)r["valign-self"]="stretch";else{const t=K;"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,De=i,Ae=wt(r,Ae),Se=o,ze=a}var rr,nr,ir;if(f=!!Gt.overlapParent||void 0,h=Gt.overlapParent&&(!H||"match_parent"===H.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),Ft(),Ft=a(y,(t=>U=t)),nr=Pe,Pe=!ht(rr=U)||void 0===rr||rr>1?nr:Number(rr),ce=1===Pe?void 0:Pe,b=ne.getDerivedFromVars(Ut.accessibility),Ct(),Ct=a(b,(t=>R=t)),ae=void 0,R&&!Yt&&R.description&&(ae={},ae["aria-label"]=R.description),w=ne.getDerivedFromVars(Ut.background),bt(),bt=a(w,(t=>B=t)),ue={},de=!1,B&&(de=B.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(_e),!de)){const t=nt(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"}Je=void 0,Ie&&Ut.transition_in&&ne.isRunning("stateChange")&&(Je=!0),Te=void 0,Ie&&Ut.transition_change&&ne.isRunning("stateChange")&&ie.hasTransitionChange(Ut.id)&&(Te=!0),$=ne.getDerivedFromVars(Ut.action),ft(),ft=a($,(t=>J=t)),x=ne.getDerivedFromVars(Ut.actions),_t(),_t=a(x,(t=>T=t)),k=ne.getDerivedFromVars(Ut.doubletap_actions),dt(),dt=a(k,(t=>O=t)),E=ne.getDerivedFromVars(Ut.longtap_actions),ct(),ct=a(E,(t=>I=t));{let t=T||J&&[J]||[],e=O||[],r=I||[];Gt.fakeElement?(t=[],e=[],r=[]):(Array.isArray(t)||(t=[],ne.logError(q(new Error("Actions should be array")))),Array.isArray(e)||(e=[],ne.logError(q(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],ne.logError(q(new Error("LongTapActions should be array"))))),(t.length||e.length||r.length)&&Xt&&(t=[],e=[],r=[],ne.logError(q(new Error(`Cannot use action on component "${Xt}"`)))),He=t,Ge=e,Ye=r}C=ne.getDerivedFromVars(Ut.action_animation),st(),st=a(C,(t=>P=t)),P&&(Ze=kt(P),Xe=Ze.map((function(t){const e=xt(t.start_value,1),r=xt(t.end_value,1),n=yt(t.start_delay,0),i=yt(t.duration,300),o=$t(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(q(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", ")),F=ne.getDerivedFromVars(Ut.visibility),at(),at=a(F,(t=>z=t));{const t=Qe,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(z,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 _(),"in"===e&&(Ne=!0),ie.runVisibilityTransition(Object.assign(Object.assign({},Ut),{visibility:"visible"}),Lt,r,oe,e).then((()=>{"in"===e&&(Ne=!1)})).catch((t=>{throw"in"===e&&(Ne=!1),t})))}(e)),Ke||(Ke=!0)}if(A=Object.assign(Object.assign(Object.assign({},$e),Ae),{"parent-overlap":f,"parent-overlap-absolute":h,"scroll-snap":Gt.scrollSnap,"hide-on-transition-in":Je||Ne||Te,visibility:Qe,"has-action-animation":Boolean(Xe),"parent-flex":Gt.parentContainerOrientation||void 0}),V=ne.getDerivedFromVars(Ut.transform),ot(),ot=a(V,(t=>S=t)),S&&void 0!==S.rotation){const t=S.pivot_x||{type:"pivot-percentage",value:50};tr=xt(t.value,tr);const e="pivot-fixed"===t.type?Z(tr):`${tr}%`,r=S.pivot_y||{type:"pivot-percentage",value:50};er=xt(r.value,er),Le=`${e} ${"pivot-fixed"===r.type?Z(er):`${er}%`}`,qe=`rotate(${S.rotation}deg)`}return j=Ce||Se?"100%":ke||je?0:void 0,D=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||De?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}),ot(),at(),st(),ct(),dt(),ft(),_t(),bt(),Ct(),Ft(),Vt(),jt(),Dt(),zt(),Pt(),Mt(),It(),Fe||ze?"":`${M(At,"Actionable").$$render(t,{use:function(t){oe=t,Ie&&Ut.transition_in&&ie.registerChildWithTransitionIn(Ut,Lt,Ut.transition_in,t).then((()=>{Je=!1})).catch((t=>{throw Je=!1,t})),Ie&&Ut.transition_out&&ie.registerChildWithTransitionOut(Ut,Lt,Ut.transition_out,t),Ie&&Ut.transition_change&&ie.registerChildWithTransitionChange(Ut,Lt,Ut.transition_change,t).then((()=>{Te=!1})).catch((t=>{throw Te=!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=lt(n);t&&!ut(t)&&("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+" "+vt("outer",G,A),style:Y(D),actions:He,doubleTapActions:Ge,longTapActions:Ye,attrs:ae,isNativeActionAnimation:!Ze.length||(ir=Ze,ir.some((t=>"native"===t.name)))},{},{default:()=>`${de?`${M(St,"OuterBackground").$$render(t,{background:B,radius:_e},{},{})}`:""}${i.default?i.default({}):""}${ge?`<span${N("class",G.outer__border,0)}${N("style",Y(pe),0)}></span>`:""}`})}`})),Pt=zt,Mt={"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 It(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function Ot(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function Jt(t,e){return Ot(t)||e}const Nt=J(((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:f=!1}=e,{actions:h}=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!==f&&r.singleline(f),void 0===e.actions&&r.actions&&void 0!==h&&r.actions(h);{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=It(g.font_size,y),Vt(g.line_height)&&(_=Number(g.line_height)/y),ht(g.letter_spacing)&&(b=Z(g.letter_spacing)),d=Jt(g.font_weight,d),w=Q(g.text_color,1,w),i=g.top_offset?Z(g.top_offset):"",o=g.background?nt([g.background]):null,$=(null===(c=g.border)||void 0===c?void 0:c.stroke)&&"transparent"!==Q(g.border.stroke.color)&&Vt(g.border.stroke.width)?{color:g.border.stroke.color,width:g.border.stroke.width}:null,a=It(null===(u=g.border)||void 0===u?void 0:u.corner_radius,0),s={singleline:f,decoration:m},l={"font-size":Z(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 ${Z($.width)} ${$.color}`:void 0,"border-radius":a?Z(a):void 0},`${i?`<span${N("class",Mt["text-range__top-offset"],0)}${B({"margin-top":i})}></span>`:""}${M(At,"Actionable").$$render(t,{cls:vt("text-range",Mt,s),actions:h,style:Y(l)},{},{default:()=>`${j(v)}`})}`})),Tt=Nt;function Bt(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Rt(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function Ut(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const Wt=J(((t,e,n,i)=>{let o,s,l,c,d,p,g,f,h,m,y,_,b,w,$,x,k,E,C,F,A,V,j,D,S,P,I,O,J,T,B,R,U,W=r,G=r,X=r,K=r,tt=r,et=r,rt=r,it=r,ot=r,at=r,st=r,lt=r,ct=r,{json:ut={}}=e,{templateContext:dt}=e,{origJson:pt}=e,{layoutParams:gt}=e;const ft=v(L);let ht=!1,mt="",yt=12,_t=1.25,bt=!1,wt="",$t="",xt=!1,kt="left",Et="top",Ct="",Ft="",At=!1,jt=[],Dt=[];var St,zt;u((()=>{Dt.forEach((([t,e])=>{ft.removeSvgFilter(t,e)}))})),void 0===e.json&&n.json&&void 0!==ut&&n.json(ut),void 0===e.templateContext&&n.templateContext&&void 0!==dt&&n.templateContext(dt),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=ft.getDerivedFromVars(ut.text),ct(),ct=a(o,(t=>U=t)),St=U,zt=mt,mt=String(null!=St?St:"")||zt,mt?ht=!1:(ht=!0,ft.logError(q(new Error('Missing "text" prop for div "text"')))),s=ft.getDerivedFromVars(ut.ranges),G(),G=a(s,(t=>V=t)),l=ft.getDerivedFromVars(ut.images),W(),W=a(l,(t=>A=t)),c=ft.getDerivedFromVars({font_size:ut.font_size,letter_spacing:ut.letter_spacing,font_weight:ut.font_weight,text_color:ut.text_color,underline:ut.underline,strike:ut.strike,line_height:ut.line_height}),X(),X=a(c,(t=>j=t)),d=ft.getDerivedFromVars(ut.font_size),lt(),lt=a(d,(t=>R=t)),yt=It(R,yt),p=ft.getDerivedFromVars(ut.line_height),st(),st=a(p,(t=>B=t));{const t=B;Vt(t)?(_t=Number(t)/yt,bt=!0):bt=!1}g=ft.getDerivedFromVars(ut.max_lines),it(),it=a(g,(t=>O=t)),f=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)}wt=t,$t=e,xt=r}h=ft.getDerivedFromVars(ut.text_alignment_horizontal),at(),at=a(h,(t=>T=t)),kt=Bt(T,kt),m=ft.getDerivedFromVars(ut.text_alignment_vertical),ot(),ot=a(m,(t=>J=t)),Et=Rt(J,Et),y=!V||mt&&1===V.length&&V[0]&&0===V[0].start&&"number"==typeof V[0].end&&V[0].end>=mt.length,_=ft.getDerivedFromVars(ut.text_color),rt(),rt=a(_,(t=>I=t)),b=Boolean(I)!==Boolean(V&&V[0]&&V[0].text_color);{let t="";O&&y&&b&&(t=Q(I||V&&V[0]&&V[0].text_color,1,Ct)),Ct=t}w=ft.getDerivedFromVars(ut.truncate),et(),et=a(w,(t=>P=t)),$="none"===P?"none":"",x=ft.getDerivedFromVars(ut.text_gradient),tt(),tt=a(x,(t=>S=t));{let t="";if(S){const e=nt([S]);e.image&&(t=e.image)}Ft=t}return k=ft.getDerivedFromVars(ut.selectable),K(),K=a(k,(t=>D=t)),At=function(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}(D,At),function(t,e,r){let n=[];if(Dt.forEach((([t,e])=>{ft.removeSvgFilter(t,e)})),Dt=[],!(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=Z(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),i=Z(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":Z(10*(Number(e.font_size)||12)/yt)};let a="";const s=t.image.tint_color,c=Ut(t.image.tint_mode,"source_in");if(s){const e=Q(t.image.tint_color);a=ft.addSvgFilter(e,c),Dt.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}(mt,V,A),E={singleline:f,multiline:xt,halign:kt,valign:Et,truncate:$},C={gradient:Boolean(Ft)},F={"font-size":Z(yt),"line-height":_t,"max-height":wt,"-webkit-line-clamp":$t,color:Ct,"background-image":Ft},W(),G(),X(),K(),tt(),et(),rt(),it(),ot(),at(),st(),lt(),ct(),ht?"":`${M(Pt,"Outer").$$render(t,{cls:vt("text",H,E)+" "+(At?"":"divkit-c016b"),json:ut,origJson:pt,templateContext:dt,layoutParams:gt},{},{default:()=>`<span${N("class",vt("text__inner",H,C),0)}${N("style",Y(F),0)}>${jt.length?`${z(jt,((e,r)=>"text"in e?e.text?`${M(Tt,"TextRangeView").$$render(t,{text:e.text,rootFontSize:yt,textStyles:e.textStyles,singleline:f,actions:e.actions},{},{})}`:"":e.image?`<span${N("style",Y(e.image.wrapperStyle),0)}><img${N("class",H.text__image,0)}${N("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${N("style",Y({width:e.image.width,height:e.image.height,"margin-top":bt?`-${e.image.height}`:void 0,"margin-bottom":bt?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${M(Tt,"TextRangeView").$$render(t,{text:mt,rootFontSize:yt,textStyles:j,singleline:f},{},{})}`}</span>`})}`})),Lt=Wt,qt={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 Ht(t,e,r){if(!(t&&t.shape&&t.color&&t.shape.type&&e.includes(t.shape.type)))return r;const n=Q(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?Q(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 ${Z(s)} ${r}`),e}return r}function Gt(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 Yt(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(Z).join(" ")}function Zt(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 Xt(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)&&Zt(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)Zt(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];Zt(t,e.style,o,{top:o.bottom+e.style.height,right:0,bottom:0,left:o.right+e.style.width},i,n)}}const Kt=J(((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(G.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&&Xt(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&&Xt(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("divkit-f6e9a"))&&!(null==r?void 0:r.contains("divkit-a7719"))}))&&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${N("this",c,0)}>${z(d,(t=>`<div${N("class","divkit-c770e",0)}${B({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${N("class","divkit-f6e9a",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 Qt;function te(){if(void 0!==Qt)return Qt;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),Qt=1===t.scrollHeight,document.body.removeChild(t),Qt}const ee=J(((t,e,n,i)=>{let o,s,l,c,u,d,p,g,f,h,m,y,_,b,w,$,x,k,E,C,F,A,V=r,j=r,D=r,S=r,P=r,I=r,O=r,J=r;var N,T,B,R,U,W;let{json:H={}}=e,{templateContext:G}=e,{origJson:Y}=e,{layoutParams:Z}=e;const X={left:"start",center:"center",right:"end"},K={top:"start",center:"center",bottom:"end",baseline:"baseline"},Q=["rounded_rectangle","circle"],tt=v(L);let et=!1,rt="vertical",nt="top",it="left",ot=null,at=null,st={};if(void 0===e.json&&n.json&&void 0!==H&&n.json(H),void 0===e.templateContext&&n.templateContext&&void 0!==G&&n.templateContext(G),void 0===e.origJson&&n.origJson&&void 0!==Y&&n.origJson(Y),void 0===e.layoutParams&&n.layoutParams&&void 0!==Z&&n.layoutParams(Z),o=H.items,(null==o?void 0:o.length)&&Array.isArray(o)?et=!1:(et=!0,tt.logError(q(new Error('Incorrect or empty "items" prop for div "container"')))),s=(!et&&o||[]).map((t=>{let e=t,r=G;return({templateContext:r,json:e}=tt.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=tt.getDerivedFromVars(H.orientation),J(),J=a(l,(t=>A=t)),rt=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(A,rt),c=tt.getDerivedFromVars(H.content_alignment_vertical),O(),O=a(c,(t=>F=t)),nt=Rt(F,nt),u=tt.getDerivedFromVars(H.content_alignment_horizontal),I(),I=a(u,(t=>C=t)),it=Bt(C,it),d=tt.getDerivedFromVars(H.layout_mode),P(),P=a(d,(t=>E=t)),p="wrap"===E,g=tt.getDerivedFromVars(H.separator),S(),S=a(g,(t=>k=t)),(null==k?void 0:k.style)&&"overlap"!==rt&&te()){const t=Ht(k.style,Q,(null==ot?void 0:ot.style)||null);ot=t?{show_at_start:Boolean(null!==(N=k.show_at_start)&&void 0!==N&&N),show_at_end:Boolean(null!==(T=k.show_at_end)&&void 0!==T&&T),show_between:Boolean(null===(B=k.show_between)||void 0===B||B),style:t}:null}else ot=null;if(f=tt.getDerivedFromVars(H.line_separator),D(),D=a(f,(t=>x=t)),(null==x?void 0:x.style)&&"overlap"!==rt&&te()){const t=Ht(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;h=ot||at?function(t,e,r){const n={};return Gt(n,e,"vertical"===t),Gt(n,r,"horizontal"===t),n}(rt,ot,at):null,m=tt.getDerivedFromVars(H.width),V(),V=a(m,(t=>w=t)),y=tt.getDerivedFromVars(H.height),j(),j=a(y,(t=>$=t));{let t={};(null==Z?void 0:Z.fakeElement)&&(t.fakeElement=!0),"overlap"===rt&&(t.overlapParent=!0),"horizontal"!==rt&&(t.parentHAlign=X[it],(!$||"wrap_content"===$.type||"match_parent"===$.type&&(null==Z?void 0:Z.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==Z?void 0:Z.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0)),"horizontal"===rt&&(t.parentContainerOrientation="horizontal"),"vertical"===rt&&(t.parentContainerOrientation="vertical"),p&&(t.parentContainerWrap=!0),st=wt(t,st)}return _={orientation:rt,valign:nt,halign:it,wrap:p},b={gap:ot||at?Yt(rt,ot,at):void 0},V(),j(),D(),S(),P(),I(),O(),J(),et?"":`${M(Pt,"Outer").$$render(t,{cls:vt("container",qt,_),style:b,json:H,origJson:Y,templateContext:G,layoutParams:Z,additionalPaddings:h},{},{default:()=>`${z(s,(e=>`${M(Ze,"Unknown").$$render(t,{layoutParams:st,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n\n ${ot||at?`${M(Kt,"ContainerSeparators").$$render(t,{separator:ot,lineSeparator:at,orientation:rt},{},{})}`:""}`})}`})),re=ee,ne={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function ie(t,e){return"vertical"===t||"horizontal"===t?t:e}const oe=J(((t,e,n,i)=>{let o,s,l,c,u,d,p,g=r,{json:f={}}=e,{templateContext:h}=e,{origJson:m}=e,{layoutParams:y}=e;const _=v(L);let b="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&n.json&&void 0!==f&&n.json(f),void 0===e.templateContext&&n.templateContext&&void 0!==h&&n.templateContext(h),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(f.delimiter_style),g(),g=a(o,(t=>p=t)),b=ie(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=Q(null==p?void 0:p.color,1,w),l="horizontal"===b?"100%":Z(1),c="horizontal"===b?Z(1):"100%",u={background:w,width:l,height:c},d={orientation:b},g(),`${M(Pt,"Outer").$$render(t,{cls:vt("separator",ne,d),json:f,origJson:m,templateContext:h,layoutParams:y},{},{default:()=>s?`<span${N("class",ne.separator__inner,0)}${N("style",Y(u),0)}></span>`:""})}`})),ae={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"},se=J(((t,e,n,i)=>{let o,s,l,c,d,p,g,f,h,m,y,_,b,w,$,x,k,E,C,F,A,V,j,D,S,z,P,I,O,J,T,R,U,W,H,G=r,Z=r,X=r,K=r,tt=r,rt=r,nt=r,it=r,ot=r,lt=r,ct=r,ut=r,dt=r,pt=r,{json:gt={}}=e,{templateContext:ft}=e,{origJson:ht}=e,{layoutParams:mt}=e;const _t=v(L);let bt,wt=0,xt="rgba(0,0,0,0.08)",kt=!1,Et="",Ct="none",Ft="50% 50%",At="0",Dt="source_in",St="",zt="",Mt=0,It=0,Ot=0,Jt="",Nt="";u((()=>{_t.removeSvgFilter(bt,Dt)})),void 0===e.json&&n.json&&void 0!==gt&&n.json(gt),void 0===e.templateContext&&n.templateContext&&void 0!==ft&&n.templateContext(ft),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=_t.getDerivedFromVars(gt.image_url),pt(),pt=a(o,(t=>H=t)),s=_t.getDerivedFromVars(gt.gif_url),dt(),dt=a(s,(t=>W=t)),l=H||W,wt=0,l?kt=!1:(kt=!0,_t.logError(q(new Error('Missing "image_url" for "image"')))),c=_t.getDerivedFromVars(gt.width),ut(),ut=a(c,(t=>U=t)),d="wrap_content"===(null==U?void 0:U.type),p=_t.getDerivedFromVars(gt.height),ct(),ct=a(p,(t=>R=t)),g="wrap_content"===(null==R?void 0:R.type),f=_t.getDerivedFromVars(gt.preview),lt(),lt=a(f,(t=>T=t));{const t=T;Et=t?t.startsWith("data:")?`url("${et(t)}")`:`url("data:image/jpg;base64,${et(t)}")`:""}h=_t.getDerivedFromVars(gt.placeholder_color),ot(),ot=a(h,(t=>J=t)),xt=Q(J,1,xt),m=_t.getDerivedFromVars(gt.scale),it(),it=a(m,(t=>O=t)),Ct=at(O)||Ct,y=_t.getDerivedFromVars({content_alignment_horizontal:gt.content_alignment_horizontal,content_alignment_vertical:gt.content_alignment_vertical}),nt(),nt=a(y,(t=>I=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:st(t)}(I,Ft),_=_t.getDerivedFromVars(gt.accessibility),rt(),rt=a(_,(t=>P=t)),b=(null==P?void 0:P.description)||"",w=_t.getDerivedFromVars(gt.aspect),tt(),tt=a(w,(t=>z=t));{const t=null==z?void 0:z.ratio;At=t&&Vt(t)?(100/Number(t)).toFixed(2):"0"}$=_t.getDerivedFromVars(gt.tint_color),K(),K=a($,(t=>S=t)),x=_t.getDerivedFromVars(gt.tint_mode),X(),X=a(x,(t=>D=t));{const t=S,e=t?Q(t):void 0,r=Ut(D,Dt);e===bt&&r===Dt||(_t.removeSvgFilter(bt,Dt),St=e?_t.addSvgFilter(e,r):"",bt=e,Dt=r)}if(k=_t.getDerivedFromVars(gt.appearance_animation),Z(),Z=a(k,(t=>j=t)),j&&"fade"===j.type){const t=j;zt=$t(t.interpolator,"ease_in_out").replace(/_/g,"-"),Ot=yt(t.duration,300),It=yt(t.start_delay,0),Mt=yt(t.alpha,0)}E=_t.getDerivedFromVars(gt.filters),G(),G=a(E,(t=>V=t));{let t="",e="";Array.isArray(V)&&V.length&&(t=jt(V,_t.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),Jt=t,Nt=e}return C={aspect:"0"!==At,"is-width-content":d,"is-height-content":g,loaded:!1,"before-appearance":Boolean(zt)&&!0},F={"background-image":Et,"background-color":Et?void 0:xt,"background-size":Ct},A={"object-fit":Ct,"object-position":Ft,filter:["",Jt].filter(Boolean).join(" "),"clip-path":Nt||void 0,"--divkit-appearance-interpolator":zt||void 0,"--divkit-appearance-fade-start":zt?Mt:void 0,"--divkit-appearance-delay":zt?`${It}ms`:void 0,"--divkit-appearance-duration":zt?`${Ot}ms`:void 0},G(),Z(),X(),K(),tt(),rt(),nt(),it(),ot(),lt(),ct(),ut(),dt(),pt(),kt?"":`${M(Pt,"Outer").$$render(t,{cls:vt("image",ae,C),json:gt,origJson:ht,templateContext:ft,layoutParams:mt,style:F,customDescription:!0},{},{default:()=>C.aspect?`<span${N("class",ae["image__aspect-wrapper"],0)}${B({"padding-bottom":`${At}%`})}><img${N("class",ae.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",Y(A),0)}${N("alt",b,0)}${N("aria-hidden",b?null:"true",0)}></span>`:`<img${N("class",ae.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",Y(A),0)}${N("alt",b,0)}${N("aria-hidden",b?null:"true",0)}>`})}`})),le={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 ce(t){return t>0&&t<1}function ue(t){return String(Math.ceil(1e3*t)/1e3)}function de(t,e,r){if(t.some(ce)){const e=Math.max(...t.filter(ce).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(${Z(n*t[e]/i)},${ue(t[e])}fr)`:t[e]?o[e]=`${ue(t[e])}fr`:o[e]="auto";return o.join(" ")}const ve=J(((t,e,n,i)=>{let o,s,l,c,u,d,p,g,f,h,m,y,_=r,b=r,w=r,$=r,{json:x={}}=e,{templateContext:k}=e,{origJson:E}=e,{layoutParams:C}=e;const F=v(L);let A,V,j=!1,D=1,S=[],P=[],I=[],O=[],J=0,N=!1,T="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(q(new Error('Incorrect or empty "items" prop for div "grid"')))),s=F.getDerivedFromVars(x.column_count),$(),$=a(s,(t=>y=t)),D=It(y,D),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=[],P=[],I=[],O=[],N=!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,f=1===u&&"fixed"===(null===(s=c.width)||void 0===s?void 0:s.type)&&c.width.value?Number(c.width.value)/u:0,h=1===d&&"fixed"===(null===(l=c.height)||void 0===l?void 0:l.type)&&c.height.value?Number(c.height.value)/d:0;for(let n=e;n<e+u;++n)for(let e=r;e<r+d;++e)t[n+"_"+e]?N=!0:(t[n+"_"+e]=!0,(!S[n]||S[n]<p)&&(S[n]=p),(!P[e]||P[e]<g)&&(P[e]=g),(!I[n]||I[n]<f)&&(I[n]=f),(!O[e]||O[e]<h)&&(O[e]=h));do{++e,e>=D&&(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&&(N=!0),N&&F.logError(q(new Error('Mismatching "grid" rows/columns'))),J=r}return c=F.getDerivedFromVars(x.content_alignment_vertical),b(),b=a(c,(t=>h=t)),T=Rt(h,T),u=F.getDerivedFromVars(x.content_alignment_horizontal),_(),_=a(u,(t=>f=t)),B=Bt(f,B),d={valign:T,halign:B},p={"grid-template-columns":de(S,I,D),"grid-template-rows":de(P,O,J)},g=j||N,_(),b(),w(),$(),g?"":`${M(Pt,"Outer").$$render(t,{cls:vt("grid",le,d),json:x,origJson:E,templateContext:k,style:p,layoutParams:C},{},{default:()=>`${z(V,(e=>`${M(Ze,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),pe=ve,ge={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 fe(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 he(t,e){let r;return function(...n){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,n),r=null}),e)}}const me=J(((t,e,n,i)=>{let o,s,l,c,d,p,g,f,h,m,y,_,b,w,$,x,k,E,C,F,A,V,D,S,P,I,O,J,T,B=r,R=r,U=r,H=r,G=r,X=r,K=r,Q=r,tt=r,et=r,{json:rt={}}=e,{templateContext:nt}=e,{origJson:it}=e,{layoutParams:ot}=e;const at=v(L);let st,lt,ct=[],ut=!1,dt=!1,pt=null,gt=!1,ft=!1;J=a(at.isDesktop,(t=>O=t));let ht,_t,bt,$t,xt=1,kt="horizontal",Et="start",Ct=8,Ft="",At=[],Vt={},jt=!1,Dt={},St=0;const zt=he((function(){const t=st.scrollLeft,e=st.scrollWidth,r=st.offsetWidth;ut=t>2,dt=t+r<e-2}),50);function Mt(){let t=[],e=ct[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<xt;++e){const n=ct[e].children[r];n&&t.push(n)}return t}function Ot(t,e,r="smooth"){const n="horizontal"===kt,i=n?"offsetLeft":"offsetTop",o=n?"left":"top";st.scroll({[o]:Math.max(0,t[e][i]-Ct/2),behavior:r})}function Jt(t){const e=Mt(),r=st.getBoundingClientRect(),n=e.findIndex((t=>function(t,e){return"horizontal"===kt?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"===kt?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}!rt.id||ft||(null==ot?void 0:ot.fakeElement)||at.registerInstance(rt.id,{setCurrentItem(t){const e=Mt();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=Mt();let n=e-1;n<0&&(n="ring"===t?r.length-1:e),Ot(r,n)},setNextItem(t){const e="horizontal"===kt?st.scrollLeft+st.offsetWidth===st.scrollWidth:st.scrollTop+st.offsetHeight===st.scrollHeight,r=Mt();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)}}),u((()=>{gt=!1,rt.id&&!(null==ot?void 0:ot.fakeElement)&&at.unregisterInstance(rt.id)})),void 0===e.json&&n.json&&void 0!==rt&&n.json(rt),void 0===e.templateContext&&n.templateContext&&void 0!==nt&&n.templateContext(nt),void 0===e.origJson&&n.origJson&&void 0!==it&&n.origJson(it),void 0===e.layoutParams&&n.layoutParams&&void 0!==ot&&n.layoutParams(ot),o=rt.items,(null==o?void 0:o.length)&&Array.isArray(o)?ft=!1:(ft=!0,at.logError(q(new Error('Incorrect or empty "items" prop for div "gallery"')))),s=(!ft&&o||[]).map((t=>{let e=t,r=nt;return({templateContext:r,json:e}=at.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=O&&gt&&!ft,l?"undefined"!=typeof ResizeObserver&&(pt=new ResizeObserver((()=>{zt()})),pt.observe(lt)):pt&&(pt.disconnect(),pt=null),c=at.getDerivedFromVars(rt.column_count),tt(),tt=a(c,(t=>I=t)),xt=It(I,xt),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,xt),p=at.getDerivedFromVars(rt.orientation),Q(),Q=a(p,(t=>P=t)),kt=ie(P,kt),g=at.getDerivedFromVars(rt.cross_content_alignment),K(),K=a(g,(t=>S=t)),Et=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(S,Et),f=at.getDerivedFromVars(rt.item_spacing),X(),X=a(f,(t=>D=t)),Ct=yt(D,Ct),ht=Z(Ct),h=at.getDerivedFromVars(rt.cross_spacing),G(),G=a(h,(t=>V=t)),bt=yt(V,Ct),_t=Z(bt),m=at.getDerivedFromVars(rt.paddings),H(),H=a(m,(t=>A=t)),Ft=mt(A,Ft),y="horizontal"===kt?"grid-template-columns":"grid-template-rows";{let t=[];s.forEach((e=>{const r="horizontal"===kt?"width":"height";t.push(at.getDerivedFromVars(e.json[r]))})),$t=W(t,(t=>t)),U(),U=a($t,(t=>F=t))}At=[],xt>1?At.push("auto"):F.forEach((t=>{!t&&"horizontal"===kt||"match_parent"===(null==t?void 0:t.type)?At.push("100%"):At.push("max-content")})),_=at.getDerivedFromVars(rt.scroll_mode),R(),R=a(_,(t=>C=t));{const t={};let e={};jt=!1,(null==ot?void 0:ot.fakeElement)&&(e.fakeElement=!0),"horizontal"===kt?e.parentVAlign=Et:e.parentHAlign=Et,"paging"===C&&(jt=!0,e.scrollSnap="start",t["horizontal"===kt?"scroll-padding-left":"scroll-padding-top"]=Z(Ct/2)),1===xt&&(e.parentLayoutOrientation=kt),Vt=wt(t,Vt),Dt=wt(e,Dt)}return b=at.getDerivedFromVars(rt.restrict_parent_scroll),et(),et=a(b,(t=>T=t)),w={padding:Ft,"grid-gap":_t},$={"grid-gap":ht,[y]:fe(At)},x={orientation:kt,"scroll-snap":jt},k=at.getDerivedFromVars(rt.default_item),B(),B=a(k,(t=>E=t)),St=yt(E,St),B(),R(),U(),H(),G(),X(),K(),Q(),tt(),J(),et(),"\n\n"+(ft?"":`${M(Pt,"Outer").$$render(t,{cls:vt("gallery",ge,x),json:rt,origJson:it,templateContext:nt,layoutParams:ot,customPaddings:!0,customActions:"gallery",forceHeight:"vertical"===kt,forceWidth:"horizontal"===kt},{},{default:()=>`<div class="${j(ge.gallery__scroller,!0)+" "+j(T?"divkit-aa145":"",!0)}"${N("style",Y(Vt),0)}${N("this",st,0)}><div${N("class",ge["gallery__items-grid"],0)}${N("style",Y(w),0)}${N("this",lt,0)}>${z(d,((e,r)=>`<div${N("class",ge.gallery__items,0)}${N("style",Y($),0)}${N("this",ct[r],0)}>${z(e,(e=>`${M(Ze,"Unknown").$$render(t,{layoutParams:Dt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===kt?`${ut&&l?`<div class="${j(ge.gallery__arrow,!0)+" "+j(ge.gallery__arrow_left,!0)}"><svg${N("class",ge["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${N("class",ge["gallery__arrow-icon-path"],0)} d="m10 16 8.3 8 1.03-1-4-6-.7-1 .7-1 4-6-1.03-1z"></path></svg></div>`:""}\n ${dt&&l?`<div class="${j(ge.gallery__arrow,!0)+" "+j(ge.gallery__arrow_right,!0)}"><svg${N("class",ge["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${N("class",ge["gallery__arrow-icon-path"],0)} d="M22 16l-8.3 8-1.03-1 4-6 .7-1-.7-1-4-6 1.03-1 8.3 8z"></path></svg></div>`:""}`:""}`})}`)})),ye=me,_e={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"},be=J(((t,e,n,i)=>{let o,s,l,c,d,p,g,f,h,m,y,b,w,$,x,k,E,C,F,A,V=r,D=r,S=r,P=r,I=r,O=r,J=r,T=r;var R;let{json:U={}}=e,{templateContext:W}=e,{origJson:H}=e,{layoutParams:G}=e;const X=v(L),K=X.genId("tabs");let tt,et,rt,nt=!1,it={};const ot=X.getJsonWithVars(U.selected_tab);let at,st,lt=ot&&Number(ot)||0,ct=12,ut="",dt="",pt="",gt="",ft="",yt="",_t="",bt="",$t="",xt="",kt=!1,Ct=!1,Ft=lt,jt=[],Dt=[];async function St(t,e=!1){if(Ft=lt,lt=t,kt||(kt=!0,et.style.height=Z(et.clientHeight),rt.style.transform=`translate3d(${100*-Ft}%,0,0)`),Ct=!0,async function(t){await _(),rt.style.transform=`translate3d(${t}%,0,0)`}(100*-lt),function(t=!1){const e=t?Math.max(0,lt-1):Math.min(lt,Ft),r=t?Math.min(o.length-1,lt+1):Math.max(lt,Ft);jt=jt.map(((t,n)=>t||n>=e&&n<=r)),Dt=Dt.map(((t,n)=>n>=e&&n<=r))}(),async function(){await _();const t=document.getElementById(`${K}-panel-${lt}`);t&&(et.style.height=Z(t.offsetHeight))}(),Mt&&clearTimeout(Mt),Mt=window.setTimeout((()=>{Dt=o.map(((t,e)=>e===lt))}),400),zt=-lt*et.clientWidth,e){await _();const t=tt.querySelector(`.${_e.tabs__item_selected}`);t&&t.focus()}}let zt,Mt=null;!U.id||nt||(null==G?void 0:G.fakeElement)||X.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=lt-1;e<0&&(e="ring"===t?o.length-1:lt),St(e)},setNextItem(t){let e=lt+1;e>o.length-1&&(e="ring"===t?0:lt),St(e)}}),u((()=>{U.id&&!(null==G?void 0:G.fakeElement)&&X.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!==H&&n.origJson(H),void 0===e.layoutParams&&n.layoutParams&&void 0!==G&&n.layoutParams(G),o=U.items||[],(null==o?void 0:o.length)&&Array.isArray(o)?nt=!1:(nt=!0,X.logError(q(new Error('Incorrect or empty "items" prop for div "tabs"')))),s=X.getDerivedFromVars(U.width),J(),J=a(s,(t=>F=t)),l=X.getDerivedFromVars(U.height),O(),O=a(l,(t=>C=t));{let t={};(null==G?void 0:G.fakeElement)&&(t.fakeElement=!0),"wrap_content"===(null==F?void 0:F.type)&&(t.parentHorizontalWrapContent=!0),C&&"wrap_content"!==C.type||(t.parentVerticalWrapContent=!0),it=wt(t,it)}if(!nt&&(lt<0||lt>=o.length)&&(X.logError(q(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:U.selected_tab,length:o.length}})),lt=lt<0?0:o.length-1),c=X.getDerivedFromVars(U.tab_title_style),I(),I=a(c,(t=>E=t)),d=E||{},ct=It(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};ut=mt(e,ut)}{const t=d.line_height;void 0!==t&&Vt(t)&&(dt=Z(t/ct*10))}{const t=d.letter_spacing;void 0!==t&&ht(t)&&(pt=Z(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]&&!ht(i[t]))return n;return Et(t,e,r)}(d.corners_radius,t,ct,gt):ht(t)&&(gt=Z(t/ct*10))}return at=Jt(d.active_font_weight||d.font_weight,at),st=Jt(d.inactive_font_weight||d.font_weight,st),ft=Q(d.active_text_color,1,ft),yt=Q(d.inactive_text_color,1,yt),_t=Q(d.active_background_color,1,_t),bt=Q(d.inactive_background_color,1,bt),p=X.getDerivedFromVars(U.has_separator),P(),P=a(p,(t=>k=t)),g=X.getDerivedFromVars(U.separator_color),S(),S=a(g,(t=>x=t)),f=X.getDerivedFromVars(U.separator_paddings),D(),D=a(f,(t=>$=t)),k&&(x&&($t=Q(x,1,$t)),$&&(xt=mt($,xt))),h={background:$t,margin:xt},m=X.getDerivedFromVars(U.switch_tabs_by_content_swipe_enabled),V(),V=a(m,(t=>w=t)),y=void 0===w||Boolean(w),b=X.getDerivedFromVars(U.restrict_parent_scroll),T(),T=a(b,(t=>A=t)),nt||(jt=o.map(((t,e)=>e===lt)),Dt=o.map(((t,e)=>e===lt))),V(),D(),S(),P(),I(),O(),J(),T(),nt?"":`${M(Pt,"Outer").$$render(t,{cls:vt("tabs",_e,{}),json:U,origJson:H,templateContext:W,layoutParams:G,customActions:"tabs"},{},{default:()=>`<div class="${j(_e.tabs__list,!0)+" "+j(A?"divkit-aa145":"",!0)}" role="tablist"${B({"--divkit-tabs-font-size":Z(ct),"--divkit-tabs-paddings":ut,"--divkit-tabs-line-height":dt,"--divkit-tabs-letter-spacing":pt,"--divkit-tabs-active-font-weight":at||"","--divkit-tabs-inactive-font-weight":st||"","--divkit-tabs-active-text-color":ft,"--divkit-tabs-inactive-text-color":yt,"--divkit-tabs-active-background-color":_t,"--divkit-tabs-inactive-background-color":bt,"--divkit-tabs-border-radius":gt})}${N("this",tt,0)}>${z(o,((e,r)=>{let n=r===lt;return`\n\n ${M(At,"Actionable").$$render(t,{cls:vt("tabs__item",_e,{selected:n,actionable:Boolean(e.title_click_action)}),actions:!e.title_click_action||null!=G&&G.fakeElement?[]:[e.title_click_action],attrs:{id:`${K}-tab-${r}`,"aria-controls":`${K}-panel-${r}`,role:"tab",tabindex:!n||null!=G&&G.fakeElement?"-1":e.title_click_action?void 0:"0","aria-selected":n?"true":"false"},customAction:null!=G&&G.fakeElement?null:t=>function(t,e){return lt===e||(St(e),!1)}(0,r)},{},{default:()=>`${j(e.title)}\n `})}`}))}</div>\n ${k?`<div${N("class",_e.tabs__separator,0)}${N("style",Y(h),0)}></div>`:""}\n <div class="${j(_e.tabs__panels,!0)+" "+j(A?"divkit-aa145":"",!0)}"${N("this",et,0)}><div${N("class",vt("tabs__swiper",_e,{inited:kt,animated:Ct}),0)}${N("this",rt,0)}>${z(o,((e,r)=>`<div${N("class",vt("tabs__panel",_e,{visible:Dt[r]}),0)} role="tabpanel" id="${j(K,!0)+"-panel-"+j(r,!0)}" aria-labelledby="${j(K,!0)+"-tab-"+j(r,!0)}" style="${"left: "+j(100*r,!0)+"%"}">${jt[r]?`${M(Ze,"Unknown").$$render(t,{div:e.div,templateContext:W,layoutParams:it},{},{})}`:""}\n </div>`))}</div></div>`})}`})),we=be;function $e(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)}}$e([.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]),$e([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 xe=J(((t,e,r,n)=>{let i,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const c=v(L),p=v(pt);let g=new Map,f=new Set,h=!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;c.setRunning("stateChange",!0),new Set(f),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):c.logError(q(new Error("Cannot find state with id"),{additional:{stateId:t}})),await _()},getChild(t){if(m&&m.has(t))return m.get(t);c.logError(q(new Error("Missing state block with id"),{additional:{id:t}}))}}),d(pt,{registerInstance(t,e){m||(m=new Map),m.has(t)?c.logError(q(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){f.add(t)},unregisterChild(t){f.delete(t)}})):(h=!0,c.logError(q(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&&(f=new Set),i=o.states||[],(null==i?void 0:i.length)?h=!1:(h=!0,c.logError(q(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(q(new Error("Cannot find state for default_state_id"),{additional:{selectedId:k}}))):(E=t[0],k=E.state_id)))}(i),h?"":`${M(Pt,"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(Ze,"Unknown").$$render(t,{div:E.div,templateContext:a},{},{})}`:""}\n <div${N("class","divkit-adaae",0)} aria-hidden="true"${N("this",undefined,0)}>${z(y,(e=>"direction"in e?`<div${N("class","divkit-eb860",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${N("class","divkit-e08c6",0)}>${M(Ze,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`:`<div${N("class","divkit-eb860",0)}><div${N("class","divkit-e08c6",0)}>${M(Ze,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`))}</div>`}})}`})),ke={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f"},Ee=J(((t,e,n,i)=>{let o,s,l,c,d,p,g,f,h,m,y,_,b,w,$,x,k,E=r,C=r,F=r,A=r,V=r,D=r;var S,P,I,O,J,T,B;let{json:R={}}=e,{templateContext:U}=e,{origJson:W}=e,{layoutParams:H}=e;const G=v(L),K=G.genId("pager");let Q,tt=!1,et=0,rt=0,nt=!1,it="horizontal",ot="",at="",st="";function lt(t,e="smooth"){const r="horizontal"===it,n=Q.children[t],i=r?"offsetLeft":"offsetTop",o=r?"left":"top";Q.scroll({[o]:n[i],behavior:e}),et=t}he((function(){const t=function(){const t=Array.from(Q.children),e=Q.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,n=t.getBoundingClientRect(),"horizontal"===it?n.left>=r.left&&n.right<=r.right:n.top>=r.top&&n.bottom<=r.bottom;var r,n}));return-1!==r?r:et}();t!==et&&(et=t)}),50),R.id&&!(null==H?void 0:H.fakeElement)&&G.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');lt(t)},setPreviousItem(t){let e=et-1;e<0&&(e="ring"===t?o.length-1:et),lt(e)},setNextItem(t){let e=et+1;e>o.length-1&&(e="ring"===t?0:et),lt(e)}}),u((()=>{R.id&&!(null==H?void 0:H.fakeElement)&&G.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!==H&&n.layoutParams(H),(null===(S=R.items)||void 0===S?void 0:S.length)&&Array.isArray(R.items)?tt=!1:(tt=!0,G.logError(q(new Error('Incorrect or empty "items" prop for div "pager"')))),o=(!tt&&R.items||[]).map((t=>{let e=t,r=U;return({templateContext:r,json:e}=G.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=G.getDerivedFromVars(R.layout_mode),C(),C=a(s,(t=>b=t)),b?"percentage"!==b.type&&"fixed"!==b.type?(nt=!0,G.logError(q(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):nt=!1:(nt=!0,G.logError(q(new Error('Empty "layout_mode" prop for div "pager"')))),l=G.getDerivedFromVars(R.orientation),V(),V=a(l,(t=>x=t)),it=ie(x,it),c=G.getDerivedFromVars(R.item_spacing),A(),A=a(c,(t=>$=t));{const t=null==$?void 0:$.value;t&&ht(t)&&(ot=Z(t||0))}if(d=G.getDerivedFromVars(R.paddings),F(),F=a(d,(t=>w=t)),at=mt(w,at),p=G.getDerivedFromVars(R.restrict_parent_scroll),D(),D=a(p,(t=>k=t)),g="horizontal"===it?"grid-auto-columns":"grid-auto-rows","fixed"===(null==b?void 0:b.type)){const t=X("horizontal"===it?((null===(P=R.paddings)||void 0===P?void 0:P.left)||0)+((null===(I=R.paddings)||void 0===I?void 0:I.right)||0):((null===(O=R.paddings)||void 0===O?void 0:O.top)||0)+((null===(J=R.paddings)||void 0===J?void 0:J.bottom)||0)),e=null===(T=b.neighbour_page_width)||void 0===T?void 0:T.value;st=e?`calc(100% + ${t} - 2 * ${X(e)} - 2 * ${ot})`:"100%"}else if("percentage"===(null==b?void 0:b.type)){const t=null===(B=b.page_width)||void 0===B?void 0:B.value;st=`${Number(t)}%`}return f={"grid-gap":ot,padding:at,[g]:st},h={orientation:it},m=tt||nt,y=G.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:K,size:t,currentItem:e,scrollToPagerItem:lt}),i=_,n.set(i)}var n,i}(o.length,et),function(t){var e;if(t===rt)return;rt=t;const r=G.getJsonWithVars(null===(e=o[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&G.execAnyActions(r)}(et),E(),C(),F(),A(),V(),D(),m?"":`${M(Pt,"Outer").$$render(t,{cls:vt("pager",ke,h),json:R,origJson:W,templateContext:U,layoutParams:H,customPaddings:!0},{},{default:()=>`<div class="${j(ke.pager__items,!0)+" "+j(k?"divkit-aa145":"",!0)}"${N("style",Y(f),0)}${N("this",Q,0)}>${z(o,(e=>`<div${N("class",ke.pager__item,0)}>${M(Ze,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson,layoutParams:null!=H&&H.fakeElement?{fakeElement:!0}:void 0},{},{})}\n </div>`))}</div>`})}`})),Ce=Ee,Fe={indicator:"divkit-d8e3f",indicator__scroller:"divkit-b5db0",indicator__items:"divkit-d5d94",indicator__item:"divkit-f6629",indicator__item_active:"divkit-b39cd"},Ae=J(((t,e,n,i)=>{let o,s,l,c,u,d,p,g,f,h,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:D}=e;const S=v(L);let P,I,O,J=5,T=10,R=10,U=5,W="#ffdc60",q=Q("#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!==D&&n.layoutParams(D),o=S.getDerivedFromVars(F.shape),E(),E=a(o,(t=>y=t)),y&&("rounded_rectangle"===y.type?(y.item_width&&(T=yt(y.item_width.value,T)),y.item_height&&(R=yt(y.item_height.value,R)),y.corner_radius&&(U=yt(y.corner_radius.value,U))):"circle"===y.type&&(J=yt(null===(C=y.radius)||void 0===C?void 0:C.value,J),T=R=U=2*J)),s=S.getDerivedFromVars(F.active_item_color),k(),k=a(s,(t=>m=t)),W=Q(m,1,W),l=S.getDerivedFromVars(F.inactive_item_color),x(),x=a(l,(t=>h=t)),q=Q(h,1,q),c=S.getDerivedFromVars(F.space_between_centers),$(),$=a(c,(t=>f=t)),f&&(H=yt(f.value,H)),u=S.getDerivedFromVars(F.active_item_size),w(),w=a(u,(t=>g=t)),G=It(g,G),d=S.getStore("pagers"),b(),b=a(d,(t=>p=t)),async function(t){if(F.pager_id&&t.has(F.pager_id)){O=t.get(F.pager_id),await _();const e=I.children[O.currentItem].offsetLeft;P.scroll({left:e-P.clientWidth/2,behavior:"smooth"})}}(p),b(),w(),$(),x(),k(),E(),`${M(Pt,"Outer").$$render(t,{cls:vt("indicator",Fe,{}),json:F,origJson:V,templateContext:A,layoutParams:D},{},{default:()=>`<div${N("class",Fe.indicator__scroller,0)}${N("this",P,0)}><div${N("class",Fe.indicator__items,0)} role="tablist"${B({margin:`0 ${Z((G-1)*T/2)}`,"--divkit-indicator-width":Z(T),"--divkit-indicator-height":Z(R),"--divkit-indicator-border-radius":Z(U),"--divkit-indicator-active-color":W,"--divkit-indicator-inactive-color":q,"--divkit-indicator-active-scale":G,"--divkit-indicator-margin":`0 ${Z((H-T)/2)}`})}${N("this",I,0)}>${O?`${z(Array(O.size),((t,e)=>{let r=e===O.currentItem;return`\n <div class="${j(vt("indicator__item",Fe,{active:r}),!0)+" "+j("divkit-bd259",!0)}" role="tab" id="${j(O.instId,!0)+"-tab-"+j(e,!0)}" aria-controls="${j(O.instId,!0)+"-panel-"+j(e,!0)}"${N("aria-selected",r?"true":"false",0)}${N("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),Ve=Ae,je={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 De(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&Q(t.text_color)||"#000",i=Ot(t.font_weight);if(Vt(t.font_size)&&"transparent"!==n){var o,a;const e={fontSize:Z(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 Se(t,e,r){return Math.max(e,Math.min(r,t))}const ze=-2147483648,Pe=Number.MAX_VALUE,Me=Number.MIN_VALUE,Ie="string",Oe="integer",Je="number",Ne="boolean",Te="color",Be="datetime";class Re{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 Ue={string:class extends Re{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends Re{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 Re{convertValue(t){if("number"!=typeof t||isNaN(t)||t>2147483647||t<ze||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 Re{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 Re{convertValue(t){if("string"!=typeof t||!tt(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends Re{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function We(t,e,r){if(!(e in Ue))throw new Error("Unsupported variable type");return new Ue[e](t,r)}function Le(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 qe=J(((t,e,n,i)=>{let o,s,l,c,u,d,p,g,f,h,m,y,_,b,w,$,x,k,E,C,F,A,V,D,S,P,I,O,J,T,R,U,W,H,G,Y,K=r,Q=r,tt=r,et=r,rt=r,nt=r,it=r,ot=r,at=r,st=r,lt=r,ct=r;var ut,dt,pt,gt;let{json:ft={}}=e,{templateContext:mt}=e,{origJson:yt}=e,{layoutParams:_t}=e;const bt={width:10,height:10,borderRadius:5,background:"#000"},wt=["rounded_rectangle","circle"],$t=["rounded_rectangle"],kt=v(L),Et=v(Ft);let Ct=0,At=100;const Vt=kt.getJsonWithVars(ft.thumb_value_variable),jt=kt.getJsonWithVars(ft.thumb_secondary_value_variable);H=a(Vt&&kt.getVariable(Vt,"integer")||We("temp","integer",0),(t=>W=t)),U=a(jt&&kt.getVariable(jt,"integer")||We("temp","integer",0),(t=>R=t));let Dt,St,zt,Mt=Se(W||0,Ct,At),It=Se(R||0,Ct,At),Ot=bt,Jt=Ot,Nt=bt,Tt=bt,Bt=null,Rt=null,Ut=zt,Wt="",Lt="",qt=!1;he((function(){}),50),void 0===e.json&&n.json&&void 0!==ft&&n.json(ft),void 0===e.templateContext&&n.templateContext&&void 0!==mt&&n.templateContext(mt),void 0===e.origJson&&n.origJson&&void 0!==yt&&n.origJson(yt),void 0===e.layoutParams&&n.layoutParams&&void 0!==_t&&n.layoutParams(_t),o=kt.getDerivedFromVars(ft.min_value),ct(),ct=a(o,(t=>Y=t)),s=kt.getDerivedFromVars(ft.max_value),lt(),lt=a(s,(t=>G=t)),Ct=xt(Y,Ct),At=xt(G,At);{const t=Se(W||0,Ct,At);t!==Mt&&(Mt=t)}{const t=Se(R||0,Ct,At);t!==It&&(It=t)}l=kt.getDerivedFromVars(ft.thumb_style),st(),st=a(l,(t=>T=t)),Ot=Ht(T,wt,Ot),c=kt.getDerivedFromVars(ft.thumb_secondary_style),at(),at=a(c,(t=>J=t)),Jt=Ht(J,wt,Ot),u=kt.getDerivedFromVars(ft.track_inactive_style),ot(),ot=a(u,(t=>O=t)),Nt=Ht(O,$t,Nt),d=kt.getDerivedFromVars(ft.track_active_style),it(),it=a(d,(t=>I=t)),Tt=Ht(I,$t,Tt),p=kt.getDerivedFromVars(ft.tick_mark_active_style),nt(),nt=a(p,(t=>P=t));{let t=Ht(P,wt,bt);t!==bt&&(Bt=t)}Dt=Bt?jt?Le(Math.min(Mt,It),Math.max(Mt,It)+1,Ct,At,!0):Le(Ct,Mt,Ct,At,!0):[],g=kt.getDerivedFromVars(ft.tick_mark_inactive_style),rt(),rt=a(g,(t=>S=t));{let t=Ht(S,wt,bt);t!==bt&&(Rt=t)}St=Rt?jt?Le(Math.min(Mt,It),Math.max(Mt,It)+1,Ct,At,!1):Le(Mt+1,At+1,Ct,At,!0):[],f=kt.getDerivedFromVars(ft.thumb_text_style),et(),et=a(f,(t=>D=t)),zt=De(D,zt),h=kt.getDerivedFromVars(ft.thumb_secondary_text_style),tt(),tt=a(h,(t=>V=t)),Ut=De(V,zt),m=kt.getDerivedFromVars(ft.accessibility),Q(),Q=a(m,(t=>A=t)),(null==A?void 0:A.description)?Wt=A.description:kt.logError(q(new Error('Missing accessibility "description" for slider'),{level:"warn"})),y=kt.getDerivedFromVars(ft.secondary_value_accessibility),K(),K=a(y,(t=>F=t)),(null==F?void 0:F.description)?Lt=F.description:jt&&kt.logError(q(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;Et.hasAction()?(kt.logError(q(new Error('Cannot show "slider" inside component with action'))),t=!0):Ot===bt?(kt.logError(q(new Error('Missing "thumb_style" in slider'))),t=!0):Tt===bt?(kt.logError(q(new Error('Missing "track_active_style" in slider'))),t=!0):Nt===bt&&(kt.logError(q(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==qt&&(qt=t)}return _=Z(Math.max(...[Ot.width,Jt.width,0].filter(ht))),b=Z(Math.max(...[Ot.height,Jt.height,0].filter(ht))),w=(Mt-Ct)/(At-Ct),$=jt?(It-Ct)/(At-Ct):void 0,x=void 0!==$?Math.abs($-w):w,k=void 0!==$?Math.min($,w):0,E={"--divkit-slider-thumb-width":Z(Ot.width),"--divkit-slider-thumb-height":Z(Ot.height),"--divkit-slider-thumb-secondary-width":Z(Jt.width),"--divkit-slider-thumb-secondary-height":Z(Jt.height),"--divkit-slider-text-offset-x":(null===(ut=null==zt?void 0:zt.offset)||void 0===ut?void 0:ut.x)?X(zt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(dt=null==zt?void 0:zt.offset)||void 0===dt?void 0:dt.y)?X(zt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(pt=null==Ut?void 0:Ut.offset)||void 0===pt?void 0:pt.x)?X(Ut.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(gt=null==Ut?void 0:Ut.offset)||void 0===gt?void 0:gt.y)?X(Ut.offset.y):void 0,"--divkit-slider-tick-active-width":Bt?Z(Bt.width):void 0,"--divkit-slider-tick-active-height":Bt?Z(Bt.height):void 0,"--divkit-slider-tick-active-border-radius":Bt?Z(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?Z(Rt.width):void 0,"--divkit-slider-tick-inactive-height":Rt?Z(Rt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Rt?Z(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={},K(),Q(),tt(),et(),rt(),nt(),it(),ot(),at(),st(),U(),H(),lt(),ct(),"\n\n"+(qt?"":`${M(Pt,"Outer").$$render(t,{cls:vt("slider",je,C),style:E,customDescription:!0,customActions:"slider",json:ft,origJson:yt,templateContext:mt,layoutParams:_t},{},{default:()=>{var t,e,r,n,i,o;return`<div${N("class",je["slider__tracks-wrapper"],0)}><div${N("class",je["slider__tracks-inner"],0)}${N("this",undefined,0)}><div${N("class",je.slider__track,0)}${B({height:Z(Nt.height),"border-radius":Z(Nt.borderRadius),background:Nt.background,"box-shadow":Nt.boxShadow||""})}></div>\n <div${N("class",je["slider__active-track"],0)}${B({left:(100*k).toFixed(2)+"%",width:(100*x).toFixed(2)+"%",height:Z(Tt.height),"border-radius":Z(Tt.borderRadius),background:Tt.background,"box-shadow":Tt.boxShadow||""})}></div>\n ${z(Dt,(t=>`<div class="${j(je.slider__tick,!0)+" "+j(je.slider__tick_active,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n ${z(St,(t=>`<div class="${j(je.slider__tick,!0)+" "+j(je.slider__tick_inactive,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n <div${N("class",je.slider__thumb,0)}${B({"border-radius":Z(Ot.borderRadius),background:Ot.background,"box-shadow":Ot.boxShadow||""})}>${zt?`<div${N("class",je["slider__thumb-text"],0)}><div${N("class",je["slider__thumb-text-inner"],0)}${B({"font-size":(null===(t=zt)||void 0===t?void 0:t.fontSize)||"1em","font-weight":(null===(e=zt)||void 0===e?void 0:e.fontWeight)||"",color:(null===(r=zt)||void 0===r?void 0:r.textColor)||"#000"})}>${j(Mt)}</div></div>`:""}</div>\n ${jt?`<div class="${j(je.slider__thumb,!0)+" "+j(je.slider__thumb_secondary,!0)}"${B({"border-radius":Z(Jt.borderRadius),background:Jt.background,"box-shadow":Jt.boxShadow||""})}>${Ut?`<div class="${j(je["slider__thumb-text"],!0)+" "+j(je["slider__thumb-text_secondary"],!0)}"><div${N("class",je["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(It)}</div></div>`:""}</div>`:""}\n <input type="range"${N("class",je.slider__input,0)}${N("min",Ct,0)}${N("max",At,0)} step="1"${N("value",Mt,0)}${N("aria-label",Wt,0)}>\n ${jt?`<input type="range"${N("class",`${je.slider__input} ${je.slider__input_secondary}`,0)}${N("min",Ct,0)}${N("max",At,0)} step="1"${N("value",It,0)}${N("aria-label",Lt,0)}>`:""}</div></div>`}})}`)})),He={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"},Ge={text:Lt,container:re,separator:oe,image:se,gif:se,grid:pe,gallery:ye,tabs:we,state:xe,pager:Ce,indicator:Ve,slider:qe,input:J(((t,e,n,i)=>{let o,s,l,c,u,d,p,g,f,h,m,y,_,b,w,$,x,k,E,C,F,A,V,D,S,z,P,I,O,J,T,B,R=r,U=r,{json:W={}}=e,{templateContext:H}=e,{origJson:G}=e,{layoutParams:Y}=e;const K=v(L);let tt;const et=K.getJsonWithVars(W.text_variable);let rt=!1;et||(rt=!0,K.logError(q(new Error('Missing "text_variable" in "input"')))),J=a(et&&K.getVariable(et,"string")||We("temp","string",""),(t=>O=t));let nt="";I=a(K.getDerivedFromVars(W.hint_text),(t=>P=t)),z=a(K.getDerivedFromVars(W.hint_color),(t=>S=t));let it="";D=a(K.getDerivedFromVars(W.font_size),(t=>V=t));let ot,at,st=12;A=a(K.getDerivedFromVars(W.font_weight),(t=>F=t)),C=a(K.getDerivedFromVars(W.line_height),(t=>E=t)),k=a(K.getDerivedFromVars(W.letter_spacing),(t=>x=t));let lt="";$=a(K.getDerivedFromVars(W.text_color),(t=>w=t));let ct="#000";b=a(K.getDerivedFromVars(W.highlight_color),(t=>_=t));let ut="";y=a(K.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 pt="multi_line_text",gt="text";h=a(K.getDerivedFromVars(W.max_visible_lines),(t=>f=t));let ht="",mt="";B=a(K.getDerivedFromVars(W.select_all_on_focus),(t=>T=t)),void 0===e.json&&n.json&&void 0!==W&&n.json(W),void 0===e.templateContext&&n.templateContext&&void 0!==H&&n.templateContext(H),void 0===e.origJson&&n.origJson&&void 0!==G&&n.origJson(G),void 0===e.layoutParams&&n.layoutParams&&void 0!==Y&&n.layoutParams(Y),nt=O,o=P,it=Q(S,1,it),st=It(V,st),ot=Jt(F,ot);{const t=E;Vt(t)&&(at=t/st)}return ft(x)&&(lt=Z(x/st*10)),ct=Q(w,1,ct),ut=Q(_,1,ut),m&&m in dt&&(gt=dt[m],pt=m),s="multi_line_text"===pt,l=K.getDerivedFromVars(W.paddings),U(),U=a(l,(t=>g=t)),Vt(f)&&(ht=`calc(${f*(at||1.25)+"em"} + ${X(yt(null==g?void 0:g.top,0)+yt(null==g?void 0:g.bottom,0))})`),c=K.getDerivedFromVars(W.accessibility),R(),R=a(c,(t=>p=t)),(null==p?void 0:p.description)?mt=p.description:K.logError(q(new Error('Missing accessibility "description" for input'),{level:"warn"})),u={"highlight-color":Boolean(ut),"vertical-overflow":!1,multiline:s},d={"--divkit-input-hint-color":it,"--divkit-input-highlight-color":ut,"font-size":Z(st),"font-weight":ot,"line-height":at,"letter-spacing":lt,color:ct,"max-height":ht},R(),U(),h(),y(),b(),$(),k(),C(),A(),D(),z(),I(),J(),B(),rt?"":`${M(Pt,"Outer").$$render(t,{cls:vt("input",He,u),style:d,customDescription:!0,customActions:"input",json:W,origJson:G,templateContext:H,layoutParams:Y},{},{default:()=>`<span${N("class",He.input__wrapper,0)}><span${N("class",He.input__holder,0)} aria-hidden="true"${N("this",undefined,0)}>\n ${j(nt)}${nt.endsWith("\n")||!nt?"​":""}</span>\n ${s?`<textarea${N("class",He.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",mt,0)}${N("placeholder",o,0)}${N("this",tt,0)}>${j(nt,!0)}</textarea>`:`<input${N("type",gt,0)}${N("class",He.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",mt,0)}${N("placeholder",o,0)}${N("value",nt,0)}${N("this",tt,0)}>`}</span>`})}`}))},Ye=J(((t,e,r,n)=>{let{div:i}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=v(L);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&&Ge[c.type]||void 0,!d&&(({templateContext:u,json:c}=l.processTemplate(c,u)),d=c&&Ge[c.type]||void 0,!d)){let t;t=(null==c?void 0:c.type)&&l.hasTemplate(c.type)?"Recursive template":"Unknown component",l.logError(q(new Error(t),{additional:{component:(null==c?void 0:c.type)||"<missing>"}}))}return d?`${M(d||P,"svelte:component").$$render(t,{json:c,templateContext:u,layoutParams:s,origJson:a||i},{},{})}`:""})),Ze=Ye,Xe=J(((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${N("class","divkit-dc22b",0)} aria-hidden="true"><defs>${z([...Object.keys(i)],(t=>{let[e,r]=t.split(":");return`\n <filter${N("id",i[t],0)}><feFlood${N("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${N("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"${N("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function Ke(t,e,r,n){const i=r[t.type];if(!i)return n(q(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(q(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 Qe(){}function tr(t){return{subscribe:e=>(e(t),Qe)}}function er(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function rr(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function nr(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 ir(t){var e=parseInt(t,10);if(e>2147483647||e<ze)throw new Error(`Value ${t} can't be converted to Integer type.`);return e}function or(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function ar(t,e,r,n){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,ar.prototype),i.expected=e,i.found=r,i.location=n,i.name="SyntaxError",i}function sr(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function lr(t,e){var r,n={},i=(e=void 0!==e?e:{}).grammarSource,o={start:Vt,JsonStringContents:function(){var t,e,r;for(t=ht,e=[],r=jt();r!==n;)e.push(r),r=jt();return mt=t,e=ft(e)}},a=Vt,s="@{",l="}",c="@{}",u="\\",d="||",v="&&",p="==",g="!=",f=">=",h="<=",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),D={type:"any"},S=kt(["}"],!0,!1),z=xt("?",!1),P=xt(":",!1),M=xt("||",!1),I=xt("&&",!1),O=xt("==",!1),J=xt("!=",!1),N=xt(">=",!1),T=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),Y=xt("(",!1),Z=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),ft=function(t){return nr(t)},ht=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,ht)}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){ht<_t||(ht>_t&&(_t=ht,bt=[]),bt.push(t))}function Vt(){var t,e;return t=ht,Ut(),(e=Dt())!==n?(Ut(),mt=t,t=e):(ht=t,t=n),t}function jt(){var e,r,i,o,a;if(e=ht,t.substr(ht,2)===s?(r=s,ht+=2):(r=n,0===wt&&At(F)),r!==n?(i=Ut(),(o=Dt())!==n?(Ut(),125===t.charCodeAt(ht)?(a=l,ht++):(a=n,0===wt&&At(A)),a!==n?(mt=e,e=o):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,t.substr(ht,3)===c?(r=c,ht+=3):(r=n,0===wt&&At(V)),r!==n&&(mt=e,r=""),(e=r)===n&&(e=ht,r=ht,wt++,92===t.charCodeAt(ht)?(i=u,ht++):(i=n,0===wt&&At(j)),i===n&&(t.substr(ht,2)===s?(i=s,ht+=2):(i=n,0===wt&&At(F))),wt--,i===n?r=void 0:(ht=r,r=n),r!==n?(t.length>ht?(i=t.charAt(ht),ht++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=$t()):(ht=e,e=n)):(ht=e,e=n),e===n))){if(e=ht,t.substr(ht,2)===s?(r=s,ht+=2):(r=n,0===wt&&At(F)),r!==n){if(i=[],w.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(S)),o!==n)for(;o!==n;)i.push(o),w.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(S));else i=n;i!==n?(125===t.charCodeAt(ht)?(o=l,ht++):(o=n,0===wt&&At(A)),o!==n?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ht=e,e=n)):(ht=e,e=n)}else ht=e,e=n;e===n&&(e=ht,t.substr(ht,2)===s?(r=s,ht+=2):(r=n,0===wt&&At(F)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===n&&(e=ht,92===t.charCodeAt(ht)?(r=u,ht++):(r=n,0===wt&&At(j)),r!==n?(t.substr(ht,2)===s?(i=s,ht+=2):(i=n,0===wt&&At(F)),i!==n?(mt=e,e=i):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,92===t.charCodeAt(ht)?(r=u,ht++):(r=n,0===wt&&At(j)),r!==n?(t.length>ht?(i=t.charAt(ht),ht++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=or(i)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,92===t.charCodeAt(ht)?(r=u,ht++):(r=n,0===wt&&At(j)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Dt(){var e,r,i,o,a,s;return e=ht,(r=St())!==n?(Ut(),63===t.charCodeAt(ht)?(i="?",ht++):(i=n,0===wt&&At(z)),i!==n?(Ut(),(o=Dt())!==n?(Ut(),58===t.charCodeAt(ht)?(a=":",ht++):(a=n,0===wt&&At(P)),a!==n?(Ut(),(s=Dt())!==n?(mt=e,e={type:"ConditionalExpression",test:r,consequent:o,alternate:s}):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=St()),e}function St(){var e,r,i,o,a,s,l,c;if(e=ht,(r=zt())!==n){for(i=[],o=ht,a=Ut(),t.substr(ht,2)===d?(s=d,ht+=2):(s=n,0===wt&&At(M)),s!==n?(l=Ut(),(c=zt())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),t.substr(ht,2)===d?(s=d,ht+=2):(s=n,0===wt&&At(M)),s!==n?(l=Ut(),(c=zt())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=rr(r,i)}else ht=e,e=n;return e}function zt(){var e,r,i,o,a,s,l,c;if(e=ht,(r=Pt())!==n){for(i=[],o=ht,a=Ut(),t.substr(ht,2)===v?(s=v,ht+=2):(s=n,0===wt&&At(I)),s!==n?(l=Ut(),(c=Pt())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),t.substr(ht,2)===v?(s=v,ht+=2):(s=n,0===wt&&At(I)),s!==n?(l=Ut(),(c=Pt())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=rr(r,i)}else ht=e,e=n;return e}function Pt(){var e,r,i,o,a,s,l,c;if(e=ht,(r=Mt())!==n){for(i=[],o=ht,a=Ut(),t.substr(ht,2)===p?(s=p,ht+=2):(s=n,0===wt&&At(O)),s===n&&(t.substr(ht,2)===g?(s=g,ht+=2):(s=n,0===wt&&At(J))),s!==n?(l=Ut(),(c=Mt())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),t.substr(ht,2)===p?(s=p,ht+=2):(s=n,0===wt&&At(O)),s===n&&(t.substr(ht,2)===g?(s=g,ht+=2):(s=n,0===wt&&At(J))),s!==n?(l=Ut(),(c=Mt())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=er(r,i)}else ht=e,e=n;return e}function Mt(){var e,r,i,o,a,s,l,c;if(e=ht,(r=It())!==n){for(i=[],o=ht,a=Ut(),t.substr(ht,2)===f?(s=f,ht+=2):(s=n,0===wt&&At(N)),s===n&&(62===t.charCodeAt(ht)?(s=">",ht++):(s=n,0===wt&&At(T)),s===n&&(t.substr(ht,2)===h?(s=h,ht+=2):(s=n,0===wt&&At(B)),s===n&&(60===t.charCodeAt(ht)?(s="<",ht++):(s=n,0===wt&&At(R))))),s!==n?(l=Ut(),(c=It())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),t.substr(ht,2)===f?(s=f,ht+=2):(s=n,0===wt&&At(N)),s===n&&(62===t.charCodeAt(ht)?(s=">",ht++):(s=n,0===wt&&At(T)),s===n&&(t.substr(ht,2)===h?(s=h,ht+=2):(s=n,0===wt&&At(B)),s===n&&(60===t.charCodeAt(ht)?(s="<",ht++):(s=n,0===wt&&At(R))))),s!==n?(l=Ut(),(c=It())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=er(r,i)}else ht=e,e=n;return e}function It(){var e,r,i,o,a,s,l,c;if(e=ht,(r=Ot())!==n){for(i=[],o=ht,a=Ut(),43===t.charCodeAt(ht)?(s=m,ht++):(s=n,0===wt&&At(U)),s===n&&(45===t.charCodeAt(ht)?(s=y,ht++):(s=n,0===wt&&At(W))),s!==n?(l=Ut(),(c=Ot())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),43===t.charCodeAt(ht)?(s=m,ht++):(s=n,0===wt&&At(U)),s===n&&(45===t.charCodeAt(ht)?(s=y,ht++):(s=n,0===wt&&At(W))),s!==n?(l=Ut(),(c=Ot())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=er(r,i)}else ht=e,e=n;return e}function Ot(){var e,r,i,o,a,s,l,c;if(e=ht,(r=Jt())!==n){for(i=[],o=ht,a=Ut(),47===t.charCodeAt(ht)?(s="/",ht++):(s=n,0===wt&&At(L)),s===n&&(42===t.charCodeAt(ht)?(s="*",ht++):(s=n,0===wt&&At(q)),s===n&&(37===t.charCodeAt(ht)?(s="%",ht++):(s=n,0===wt&&At(H)))),s!==n?(l=Ut(),(c=Jt())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),47===t.charCodeAt(ht)?(s="/",ht++):(s=n,0===wt&&At(L)),s===n&&(42===t.charCodeAt(ht)?(s="*",ht++):(s=n,0===wt&&At(q)),s===n&&(37===t.charCodeAt(ht)?(s="%",ht++):(s=n,0===wt&&At(H)))),s!==n?(l=Ut(),(c=Jt())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=er(r,i)}else ht=e,e=n;return e}function Jt(){var e,r,i;return(e=Bt())===n&&(e=Tt())===n&&(e=ht,33===t.charCodeAt(ht)?(r="!",ht++):(r=n,0===wt&&At(G)),r===n&&(43===t.charCodeAt(ht)?(r=m,ht++):(r=n,0===wt&&At(U)),r===n&&(45===t.charCodeAt(ht)?(r=y,ht++):(r=n,0===wt&&At(W)))),r!==n?(Ut(),(i=Jt())!==n?(mt=e,e={type:"UnaryExpression",operator:r,argument:i}):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=function(){var e,r,i,o,a;return e=ht,(r=Rt())!==n?(Ut(),40===t.charCodeAt(ht)?(i="(",ht++):(i=n,0===wt&&At(Y)),i!==n?(Ut(),o=function(){var e,r,i,o,a,s,l;if(e=ht,(r=Dt())!==n){for(i=[],o=ht,Ut(),44===t.charCodeAt(ht)?(a=",",ht++):(a=n,0===wt&&At(X)),a!==n?(Ut(),(s=Dt())!==n?o=s:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,Ut(),44===t.charCodeAt(ht)?(a=",",ht++):(a=n,0===wt&&At(X)),a!==n?(Ut(),(s=Dt())!==n?o=s:(ht=o,o=n)):(ht=o,o=n);mt=e,l=i,e=[r,...l]}else ht=e,e=n;return e===n&&(e=Ut()),e}(),o!==n?(Ut(),41===t.charCodeAt(ht)?(a=")",ht++):(a=n,0===wt&&At(Z)),a!==n?(mt=e,e={type:"CallExpression",callee:r,arguments:o}):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,(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=ht,39===t.charCodeAt(ht)?(r="'",ht++):(r=n,0===wt&&At(Q)),r!==n?(i=function(){var t,e,r;for(t=ht,e=[],r=Nt();r!==n;)e.push(r),r=Nt();return mt=t,e=nr(e)}(),39===t.charCodeAt(ht)?(o="'",ht++):(o=n,0===wt&&At(Q)),o!==n?(mt=e,e=i):(ht=e,e=n)):(ht=e,e=n),wt--,e===n&&(r=n,0===wt&&At(K)),e}(),e===n&&(e=Bt())===n&&(e=Tt())===n&&(e=function(){var e,r;return wt++,e=ht,t.substr(ht,4)===_?(r=_,ht+=4):(r=n,0===wt&&At(lt)),r!==n&&(mt=e,r={type:"BooleanLiteral",value:!0}),(e=r)===n&&(e=ht,t.substr(ht,5)===b?(r=b,ht+=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=ht,40===t.charCodeAt(ht)?(r="(",ht++):(r=n,0===wt&&At(Y)),r!==n&&(i=Dt())!==n?(41===t.charCodeAt(ht)?(o=")",ht++):(o=n,0===wt&&At(Z)),o!==n?(mt=e,e=i):(ht=e,e=n)):(ht=e,e=n))),e}())),e}())),e}function Nt(){var e,r,i,o,a;if(e=ht,t.substr(ht,2)===s?(r=s,ht+=2):(r=n,0===wt&&At(F)),r!==n?(i=Ut(),(o=Dt())!==n?(Ut(),125===t.charCodeAt(ht)?(a=l,ht++):(a=n,0===wt&&At(A)),a!==n?(mt=e,e=o):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,t.substr(ht,3)===c?(r=c,ht+=3):(r=n,0===wt&&At(V)),r!==n&&(mt=e,r=""),(e=r)===n&&(e=ht,r=ht,wt++,92===t.charCodeAt(ht)?(i=u,ht++):(i=n,0===wt&&At(j)),i===n&&(39===t.charCodeAt(ht)?(i="'",ht++):(i=n,0===wt&&At(Q)),i===n&&(t.substr(ht,2)===s?(i=s,ht+=2):(i=n,0===wt&&At(F)))),wt--,i===n?r=void 0:(ht=r,r=n),r!==n?(t.length>ht?(i=t.charAt(ht),ht++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=$t()):(ht=e,e=n)):(ht=e,e=n),e===n))){if(e=ht,t.substr(ht,2)===s?(r=s,ht+=2):(r=n,0===wt&&At(F)),r!==n){if(i=[],$.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(tt)),o!==n)for(;o!==n;)i.push(o),$.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(tt));else i=n;i!==n?(125===t.charCodeAt(ht)?(o=l,ht++):(o=n,0===wt&&At(A)),o!==n?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ht=e,e=n)):(ht=e,e=n)}else ht=e,e=n;e===n&&(e=ht,t.substr(ht,2)===s?(r=s,ht+=2):(r=n,0===wt&&At(F)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===n&&(e=ht,92===t.charCodeAt(ht)?(r=u,ht++):(r=n,0===wt&&At(j)),r!==n?(t.substr(ht,2)===s?(i=s,ht+=2):(i=n,0===wt&&At(F)),i!==n?(mt=e,e=i):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,92===t.charCodeAt(ht)?(r=u,ht++):(r=n,0===wt&&At(j)),r!==n?(t.length>ht?(i=t.charAt(ht),ht++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=or(i)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,92===t.charCodeAt(ht)?(r=u,ht++):(r=n,0===wt&&At(j)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Tt(){var e,r,i,o;if(wt++,e=ht,45===t.charCodeAt(ht)?(r=y,ht++):(r=n,0===wt&&At(W)),r===n&&(r=null),i=[],x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt)),o!==n)for(;o!==n;)i.push(o),x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt));else i=n;return i!==n?(mt=e,e={type:"IntegerLiteral",value:ir($t())}):(ht=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=ht,45===t.charCodeAt(ht)?(r=y,ht++):(r=n,0===wt&&At(W)),r===n&&(r=null),i=[],x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt));o!==n;)i.push(o),x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt));if(46===t.charCodeAt(ht)?(o=".",ht++):(o=n,0===wt&&At(it)),o!==n){if(a=[],x.test(t.charAt(ht))?(s=t.charAt(ht),ht++):(s=n,0===wt&&At(rt)),s!==n)for(;s!==n;)a.push(s),x.test(t.charAt(ht))?(s=t.charAt(ht),ht++):(s=n,0===wt&&At(rt));else a=n;if(a!==n){if(s=ht,101===t.charCodeAt(ht)?(l="e",ht++):(l=n,0===wt&&At(ot)),l===n&&(69===t.charCodeAt(ht)?(l="E",ht++):(l=n,0===wt&&At(at))),l!==n){if(43===t.charCodeAt(ht)?(c=m,ht++):(c=n,0===wt&&At(U)),c===n&&(45===t.charCodeAt(ht)?(c=y,ht++):(c=n,0===wt&&At(W))),c===n&&(c=null),u=[],x.test(t.charAt(ht))?(d=t.charAt(ht),ht++):(d=n,0===wt&&At(rt)),d!==n)for(;d!==n;)u.push(d),x.test(t.charAt(ht))?(d=t.charAt(ht),ht++):(d=n,0===wt&&At(rt));else u=n;u!==n?s=l=[l,c,u]:(ht=s,s=n)}else ht=s,s=n;s===n&&(s=null),mt=e,e={type:"NumberLiteral",value:parseFloat($t())}}else ht=e,e=n}else ht=e,e=n;if(e===n){if(e=ht,45===t.charCodeAt(ht)?(r=y,ht++):(r=n,0===wt&&At(W)),r===n&&(r=null),i=[],x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt)),o!==n)for(;o!==n;)i.push(o),x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt));else i=n;if(i!==n)if(101===t.charCodeAt(ht)?(o="e",ht++):(o=n,0===wt&&At(ot)),o===n&&(69===t.charCodeAt(ht)?(o="E",ht++):(o=n,0===wt&&At(at))),o!==n){if(43===t.charCodeAt(ht)?(a=m,ht++):(a=n,0===wt&&At(U)),a===n&&(45===t.charCodeAt(ht)?(a=y,ht++):(a=n,0===wt&&At(W))),a===n&&(a=null),s=[],x.test(t.charAt(ht))?(l=t.charAt(ht),ht++):(l=n,0===wt&&At(rt)),l!==n)for(;l!==n;)s.push(l),x.test(t.charAt(ht))?(l=t.charAt(ht),ht++):(l=n,0===wt&&At(rt));else s=n;s!==n?(mt=e,e={type:"NumberLiteral",value:parseFloat($t())}):(ht=e,e=n)}else ht=e,e=n;else ht=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=ht,r=ht,wt++,i=function(){var e,r,i,o;return e=ht,t.substr(ht,4)===_?(r=_,ht+=4):(r=n,0===wt&&At(lt)),r===n&&(t.substr(ht,5)===b?(r=b,ht+=5):(r=n,0===wt&&At(ct))),r!==n?(i=ht,wt++,k.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(ut)),wt--,o===n?i=void 0:(ht=i,i=n),i!==n?e=r=[r,i]:(ht=e,e=n)):(ht=e,e=n),e}(),wt--,i===n?r=void 0:(ht=r,r=n),r!==n)if(E.test(t.charAt(ht))?(i=t.charAt(ht),ht++):(i=n,0===wt&&At(vt)),i!==n){for(o=[],k.test(t.charAt(ht))?(a=t.charAt(ht),ht++):(a=n,0===wt&&At(ut));a!==n;)o.push(a),k.test(t.charAt(ht))?(a=t.charAt(ht),ht++):(a=n,0===wt&&At(ut));mt=e,e={type:"Identifier",name:$t()}}else ht=e,e=n;else ht=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(ht))?(r=t.charAt(ht),ht++):(r=n,0===wt&&At(gt));r!==n;)e.push(r),C.test(t.charAt(ht))?(r=t.charAt(ht),ht++):(r=n,0===wt&&At(gt));return wt--,r=n,0===wt&&At(pt),e}if((r=a())!==n&&ht===t.length)return r;throw r!==n&&ht<t.length&&At({type:"end"}),function(t,e,r){return new ar(ar.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}(ar,Error),ar.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=sr("",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+" | "+sr("",i.column-1," ")+sr("",c,"^")}else e+="\n at "+o}return e},ar.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 cr=new Map,ur=new Map;function dr(t,e,r){const n={args:e,cb:r},i=cr.get(t)||[];cr.has(t)||cr.set(t,i),i.push(n);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");ur.set(o,n)}function vr(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 pr(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=>{pr(t,e)}));break;case"BinaryExpression":case"LogicalExpression":pr(t.left,e),pr(t.right,e);break;case"UnaryExpression":pr(t.argument,e);break;case"ConditionalExpression":pr(t.test,e),pr(t.consequent,e),pr(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{pr(t,e)}))}}function gr(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function fr(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function hr(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 fr(t.value);if("color"===t.type)return Er(kr(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function mr(t){let e=hr(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function yr(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}const _r=new Int32Array(1);function br(t){return _r[0]=t,_r[0]}function wr(t){if(t<ze||t>2147483647)throw new Error("Integer overflow.")}function $r(t){const e=[];return pr(t,{Variable(t){e.push(t.id.name)}}),e}function xr(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function kr(t){const e=tt(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function Er(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 K(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function Cr(t){return{type:Ie,value:hr(t)}}function Fr(t){const e=Number(t.value);if(isNaN(e)||!Number.isFinite(e))throw new Error("Unable to convert value to Number.");return{type:Je,value:e}}function Ar(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value/e.value;return t.type===Oe&&(r=br(r)),{type:t.type,value:r}}function Vr(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value%e.value;return t.type===Oe&&(r=br(r)),{type:t.type,value:r}}function jr(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e*=t[r].value,t[0].type===Oe&&(e=br(e));return{type:t[0].type,value:e}}function Dr(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e-=t[r].value,t[0].type===Oe&&(e=br(e));return{type:t.length?t[0].type:Oe,value:e}}function Sr(...t){let e=0;for(let r=0;r<t.length;++r)e+=t[r].value,t[0].type===Oe&&(e=br(e));return{type:t.length?t[0].type:Oe,value:e}}function zr(t){const e=Math.abs(t.value);return t.type===Oe&&wr(e),{type:t.type,value:e}}function Pr(...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 Mr(...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 Ir(t){return{type:t.type,value:Math.sign(t.value)}}function Or(t,e){let r;if(0===e.value&&t.type===Oe)r=t.value;else if(0===t.value&&t.type===Oe)r=0;else{let n=Math.sign(e.value);t.type===Je&&0===n&&(n=Object.is(n,0)?1:-1),r=Math.abs(t.value)*n}return t.type===Oe&&wr(r),{type:t.type,value:r}}function Jr(t){return e=>{const r=kr(e.value);return{type:Je,value:r[t]/255}}}function Nr(t){return(e,r)=>{const n=kr(e.value);return n[t]=255*r.value,{type:Te,value:Er(n)}}}const Tr=Jr("a"),Br=Jr("r"),Rr=Jr("g"),Ur=Jr("b"),Wr=Nr("a"),Lr=Nr("r"),qr=Nr("g"),Hr=Nr("b");function Gr(t){return t.map(mr).join(", ")}dr("toString",[Oe],Cr),dr("toString",[Je],Cr),dr("toString",[Ne],Cr),dr("toString",[Te],Cr),dr("toString",["url"],Cr),dr("toNumber",[Oe],Fr),dr("toNumber",[Ie],Fr),dr("toInteger",[Je],(function(t){if(t.value>2147483647||t.value<ze)throw new Error("Unable to convert value to Integer.");const e=t.value-t.value%1;return{type:Oe,value:e}})),dr("toInteger",[Ie],(function(t){const e=Number(t.value);if(isNaN(e)||e%1!=0||e>2147483647||e<ze)throw new Error("Unable to convert value to Integer.");return{type:Oe,value:e}})),dr("toInteger",[Ne],(function(t){return{type:Oe,value:t.value?1:0}})),dr("toBoolean",[Oe],(function(t){if(1!==t.value&&0!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Ne,value:t.value}})),dr("toBoolean",[Ie],(function(t){if("true"!==t.value&&"false"!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Ne,value:"true"===t.value?1:0}})),dr("encodeUri",[Ie],(function(t){try{return{type:Ie,value:encodeURIComponent(t.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),dr("decodeUri",[Ie],(function(t){try{return{type:Ie,value:decodeURIComponent(t.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),dr("parseUnixTime",[Oe],(function(t){return{type:Be,value:new Date(1e3*t.value)}})),dr("nowLocal",[],(function(){return{type:Be,value:new Date}})),dr("addMillis",[Be,Oe],(function(t,e){return{type:Be,value:new Date(t.value.getTime()+e.value)}})),dr("setYear",[Be,Oe],(function(t,e){const r=new Date(t.value);return r.setFullYear(e.value),{type:Be,value:r}})),dr("setMonth",[Be,Oe],(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:Be,value:r}})),dr("setDay",[Be,Oe],(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 ${hr(t)}.`);return r.setDate(-1===e.value?0:e.value),{type:Be,value:r}})),dr("setHours",[Be,Oe],(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:Be,value:r}})),dr("setMinutes",[Be,Oe],(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:Be,value:r}})),dr("setSeconds",[Be,Oe],(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:Be,value:r}})),dr("setMillis",[Be,Oe],(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:Be,value:r}})),dr("len",[Ie],(function(t){return{type:Oe,value:t.value.length}})),dr("contains",[Ie,Ie],(function(t,e){return{type:Ne,value:t.value.includes(e.value)?1:0}})),dr("substring",[Ie,Oe,Oe],(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:Ie,value:t.value.substring(e.value,r.value)}})),dr("replaceAll",[Ie,Ie,Ie],(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:Ie,value:n}})),dr("index",[Ie,Ie],(function(t,e){return{type:Oe,value:t.value.indexOf(e.value)}})),dr("lastIndex",[Ie,Ie],(function(t,e){return{type:Oe,value:t.value.lastIndexOf(e.value)}})),dr("trim",[Ie],(function(t){return{type:Ie,value:t.value.trim()}})),dr("trimLeft",[Ie],(function(t){return{type:Ie,value:t.value.replace(/^\s+/,"")}})),dr("trimRight",[Ie],(function(t){return{type:Ie,value:t.value.replace(/\s+$/,"")}})),dr("toUpperCase",[Ie],(function(t){return{type:Ie,value:t.value.toUpperCase()}})),dr("toLowerCase",[Ie],(function(t){return{type:Ie,value:t.value.toLowerCase()}})),dr("div",[Oe,Oe],Ar),dr("div",[Je,Je],Ar),dr("mod",[Oe,Oe],Vr),dr("mod",[Je,Je],Vr),dr("mul",[{type:Oe,isVararg:!0}],jr),dr("mul",[{type:Je,isVararg:!0}],jr),dr("sub",[{type:Oe,isVararg:!0}],Dr),dr("sub",[{type:Je,isVararg:!0}],Dr),dr("sum",[{type:Oe,isVararg:!0}],Sr),dr("sum",[{type:Je,isVararg:!0}],Sr),dr("abs",[Oe],zr),dr("abs",[Je],zr),dr("max",[{type:Oe,isVararg:!0}],Pr),dr("max",[{type:Je,isVararg:!0}],Pr),dr("min",[{type:Oe,isVararg:!0}],Mr),dr("min",[{type:Je,isVararg:!0}],Mr),dr("maxNumber",[],(function(){return{type:Je,value:Pe}})),dr("minNumber",[],(function(){return{type:Je,value:Me}})),dr("maxInteger",[],(function(){return{type:Oe,value:2147483647}})),dr("minInteger",[],(function(){return{type:Oe,value:ze}})),dr("round",[Je],(function(t){const e=Math.sign(t.value);return{type:Je,value:e*Math.round(Math.abs(t.value))}})),dr("floor",[Je],(function(t){return{type:Je,value:Math.floor(t.value)}})),dr("ceil",[Je],(function(t){return{type:Je,value:Math.ceil(t.value)}})),dr("signum",[Je],Ir),dr("signum",[Oe],Ir),dr("copySign",[Je,Je],Or),dr("copySign",[Oe,Oe],Or),dr("getColorAlpha",[Ie],Tr),dr("getColorAlpha",[Te],Tr),dr("getColorRed",[Ie],Br),dr("getColorRed",[Te],Br),dr("getColorGreen",[Ie],Rr),dr("getColorGreen",[Te],Rr),dr("getColorBlue",[Ie],Ur),dr("getColorBlue",[Te],Ur),dr("setColorAlpha",[Ie,Je],Wr),dr("setColorAlpha",[Te,Je],Wr),dr("setColorRed",[Ie,Je],Lr),dr("setColorRed",[Te,Je],Lr),dr("setColorGreen",[Ie,Je],qr),dr("setColorGreen",[Te,Je],qr),dr("setColorBlue",[Ie,Je],Hr),dr("setColorBlue",[Te,Je],Hr),dr("rgb",[Je,Je,Je],(function(t,e,r){const n={a:255,r:255*t.value,g:255*e.value,b:255*r.value};return{type:Te,value:Er(n)}})),dr("argb",[Je,Je,Je,Je],(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:Te,value:Er(i)}}));const Yr={StringLiteral:function(t,e){return{type:Ie,value:e.value}},NumberLiteral:function(t,e){return{type:Je,value:e.value}},IntegerLiteral:function(t,e){return{type:Oe,value:e.value}},BooleanLiteral:function(t,e){return{type:Ne,value:e.value?1:0}},UnaryExpression:function(t,e){const r=gr(Zr(t,e.argument));switch(e.operator){case"!":if(r.type===Ne)return{type:Ne,value:r.value?0:1};xr(`${e.operator}${mr(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const t="+"===e.operator?1:-1;if(r.type===Oe)return{type:Oe,value:r.value*t};if(r.type===Je)return{type:Je,value:r.value*t};xr(`${e.operator}${mr(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=gr(Zr(t,e.test));if(r.type===Ne)return r.value?Zr(t,e.consequent):Zr(t,e.alternate);xr(`${mr(r)} ? ${mr(Zr(t,e.consequent))} : ${mr(Zr(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 Zr(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=hr(Zr(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:Ie,value:r}},LogicalExpression:function(t,e){const r=gr(Zr(t,e.left));if(r.type!==Ne&&xr(`${mr(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Ne,value:0};const n=gr(Zr(t,e.right));return n.type!==Ne&&xr(`${mr(r)} ${e.operator} ${mr(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${yr(n.type)}.`),{type:Ne,value:n.value}},BinaryExpression:function(t,e){const r=e.operator,n=Zr(t,e.left),i=Zr(t,e.right);if(n.type!==i.type&&xr(`${mr(n)} ${e.operator} ${mr(i)}`,`Operator '${r}' cannot be applied to different types: ${yr(n.type)} and ${yr(i.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===Be&&r.type===Be?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:Ne,value:n?1:0}}(r,n,i);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==Je&&e.type!==Oe&&e.type!==Be&&xr(`${mr(e)} ${t} ${mr(r)}`,`Operator '${t}' cannot be applied to ${yr(e.type)} type.`);const i=e.type===Be?e.value.getTime():e.value,o=r.type===Be?r.value.getTime():r.value;return n=">"===t?i>o:">="===t?i>=o:"<"===t?i<o:i<=o,{type:Ne,value:n?1:0}}(r,n,i);if("+"===r||"-"===r)return function(t,e,r){if(e.type!==Ie&&e.type!==Je&&e.type!==Oe&&xr(`${mr(e)} ${t} ${mr(r)}`,`Operator '${t}' cannot be applied to ${yr(e.type)} type.`),e.type===Ie)return"-"===t&&xr(`${mr(e)} - ${mr(r)}`,`Operator '${t}' cannot be applied to ${yr(e.type)} type.`),{type:Ie,value:e.value+r.value};let n="+"===t?e.value+r.value:e.value-r.value;return e.type===Oe&&(n=br(n)),{type:e.type,value:n}}(r,n,i);if("/"===r||"*"===r||"%"===r)return function(t,e,r){let n;if(e.type!==Oe&&e.type!==Je&&xr(`${mr(e)} ${t} ${mr(r)}`,`Operator '${t}' cannot be applied to ${yr(e.type)} type.`),"*"===t)n=e.value*r.value;else{if("/"!==t&&"%"!==t)throw new Error(`Unsupported operation ${t}`);0===r.value&&xr(`${mr(e)} ${t} ${mr(r)}`,"Division by zero is not supported."),n="/"===t?e.value/r.value:e.value%r.value}return e.type===Oe&&(n=br(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(!cr.has(r))throw new Error(`Unknown function name: ${r}.`);let n;const i=e.arguments.map((e=>Zr(t,e))),o=r+":"+i.map((t=>t.type)).join("#");if(ur.has(o))n=ur.get(o);else{const t=function(t,e){const r=cr.get(t);if(!r)throw new Error("Missing function");let n=null;for(let t=0;t<r.length;++t){const i=vr(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=>yr(t.type))).join(", "),n=`${r}(${Gr(i)})`;"few"===t.type&&0===i.length?xr(n,`Non empty argument list is required for function '${r}'.`):(t.type,xr(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){xr(`${r}(${Gr(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 Zr(t,e){if(e.type in Yr)return Yr[e.type](t,e);throw new Error("Unsupported expression")}function Xr(t,e){try{return Zr(t,e)}catch(t){return{type:"error",value:t.message}}}class Kr{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return pr(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=Xr(t,this.ast);if("error"===r.type)return void e(q(new Error("Expression execution error"),{additional:{message:r.value}}));const n=r.value;if(n instanceof Date)return fr(n);if("boolean"===r.type)return Boolean(n);if("color"===r.type){const t=tt(String(n));if(t)return Er(t);e(q(new Error("Expression execution error")))}return n}catch(t){return void e(q(new Error("Expression execution error")))}}}function Qr(t,e,r){if(t)if("string"==typeof t){if((n=t).indexOf("@{")>-1||n.indexOf("\\")>-1){e.hasExpression=!0;try{const r=lr(t,{startRule:"JsonStringContents"}),n=$r(r);return e.vars.push(...n),new Kr(r)}catch(e){return void r(q(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>Qr(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=Qr(t[i],e,r);return n}}var n;return t}function tn(t,e,r){if(t){if(t instanceof Kr)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>tn(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=tn(t[i],e,r);return n}}return t}function en(t,e){const r={vars:[],hasExpression:!1},n=Qr(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>tn(n,t,e)}}const rn={pagers:function(){return U(new Map)}},nn=new Map,on=new Map;function an(t){const e=nn.get(t)||U("");return nn.has(t)||nn.set(t,e),e}function sn(t){const e=on.get(t)||new Map;return on.has(t)||on.set(t,e),e}class ln{setVariable(t){const e=t.getName(),r=sn(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),an(this).set(e)}getVariable(t){return sn(this).get(t)}}function cn(){return new ln}const un=J(((t,e,r,n)=>{let i,o;var s,l,c;let{id:u}=e,{json:v={}}=e,{platform:p="auto"}=e,{theme:g="system"}=e,{globalVariablesController:f=new ln}=e,{onError:h}=e,{onStat:m}=e,{onCustomAction:y}=e,{onComponent:b}=e,w=U("desktop"===p);if(o=a(w,(t=>i=t)),"auto"===p&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");w.set(!t.matches),t.addListener((()=>{w.set(!t.matches)}))}let $="light",x=null;function k(t){g=t}let E=!1;v||(E=!0,N(q(new Error('"json" prop is required')))),u||(E=!0,N(q(new Error('"id" prop is required'))));let C=function(t){if(!t)return q(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return q(new Error("Missing card"));if(!e.states||!e.states.length)return q(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in Ge)return q(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return q(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return q(new Error("Missing state_id"),{additional:{index:t}})}return null}(v);const F=v.templates||{};C&&(E=!0,N(C));const A={stateChange:!1},V=an(f),D=sn(f),S=new Map,z=new Map,P=new Map;function I(t,e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e){const r=z.get(t);r&&r.setValue(e)}}function O(t){const e=z.get(t);return null==e?void 0:e.getValue()}function J(t){const e=en(t,N);return e.vars.length?e.applyVars(z):t}function N(t){h?h({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function T(t,e){m&&m({type:t,action:e})}let B=0;function R(t){return`${u}-${B++}`}let H={},G={};function Y(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=et,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=K(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=K(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=K(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=z.get(r);t?t.set(i):N(q(new Error("Cannot find variable"),{additional:{name:r}}))}else N(q(new Error("Incorrect set_variable_action"),{additional:{url:t}}));break;default:N(q(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){N(q(t,{additional:{url:e}}))}}function Z(t){null==y||y(t)}const X=new Map;function K(t){if(X.has(t))return X.get(t);N(q(new Error("Missing instance with id"),{additional:{id:t}}))}const Q=new Map;function tt(t){for(const e of t)z.has(e)&&t.delete(e);return t}d(L,{logError:N,logStat:T,hasTemplate:function(t){return t in F},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in F;){if(({json:t,templateContext:e}=Ke(t,e,F,N)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:R,genClass:function(t){return`divkit-${R()}`},execAction:Y,execAnyActions:async function(t,e){if(t){for(let r=0;r<t.length;++r){let n=t[r];const i=n.url;if(i){const t=lt(i);if(t)if(ut(t)){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?(Y(n),await _()):n.log_id&&(Z(n),await _())}}t.forEach((t=>{t.log_id&&T("click",t)}))}},execCustomAction:Z,isRunning:function(t){return A[t]},setRunning:function(t,e){A[t]=e},registerInstance:function(t,e){X.has(t)?N(q(new Error("Duplicate instance id"),{additional:{id:t}})):X.set(t,e)},unregisterInstance:function(t){X.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(G[r]=G[r]||0,++G[r],H[r])return H[r];const n=`${R()}-svg-filter`;return H=Object.assign(Object.assign({},H),{[r]:n}),n},removeSvgFilter:function(t,e){t&&G[t]&&0==--G[`${t}:${e}`]&&(H=Object.keys(H).reduce(((t,e)=>(G[e]&&(t[e]=H[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return tr(t);const e=en(t,N);return e.vars.length?W(e.vars.map((t=>z.get(t)||function(t){const e=P.get(t)||U(void 0);return P.has(t)||P.set(t,e),e}(t))).filter(rt),(()=>e.applyVars(z))):e.hasExpression?tr(e.applyVars(z)):tr(t)},getJsonWithVars:J,getStore:function(t){return Q.has(t)||function(t){Q.has(t)||Q.set(t,rn[t]())}(t),Q.get(t)},getVariable:function(t,e){const r=z.get(t);if(r){const n=r.getType();if(n!==e)return void N(q(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:n}}))}return r},isDesktop:w,registerComponent:void 0,unregisterComponent:void 0}),d(Ft,{hasAction:()=>!1});const et={setState(t){throw new Error("Not implemented")},getChild(t){if(nt&&nt.has(t))return nt.get(t);N(q(new Error("Missing state block with id"),{additional:{id:t}}))}};let nt=null;d(pt,{registerInstance(t,e){nt||(nt=new Map),nt.has(t)?N(q(new Error("Duplicate state with id"),{additional:{id:t}})):nt.set(t,e)},unregisterInstance(t){null==nt||nt.delete(t)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionOut:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionChange:(t,e,r,n)=>Promise.resolve(),hasTransitionChange:t=>!1,registerChild(t){},unregisterChild(t){}});const it=null===(s=null==v?void 0:v.card)||void 0===s?void 0:s.variables;Array.isArray(it)&&it.forEach((t=>{if(t&&t.type in Ue&&t.name){if(S.has(t.name))return void N(q(new Error("Duplicate variable"),{additional:{name:t.name}}));try{const e=We(t.name,t.type,t.value);S.set(t.name,e),z.set(t.name,e)}catch(e){N(q(e,{additional:{name:t.name}}))}}}));const ot=v.palette;ot&&ot[$].forEach((t=>{if(S.has(t.name))N(q(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=We(t.name,"color",t.color);S.set(t.name,e),z.set(t.name,e)}catch(e){N(q(e,{additional:{name:t.name}}))}}));for(const[t,e]of D)z.has(t)||z.set(t,e);V.subscribe((t=>{if(t&&!z.has(t)){const e=D.get(t);z.set(t,e);const r=P.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const at=null===(l=null==v?void 0:v.card)||void 0===l?void 0:l.variable_triggers;Array.isArray(at)&&at.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void N(q(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=lr(t.condition,{startRule:"JsonStringContents"}),i=$r(n);if(!i.length)return void N(q(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return tt(e),e.size?new Promise((t=>{const r=V.subscribe((()=>{tt(e),e.size||(r(),t())}))})):Promise.resolve()})(i).then((()=>{W(i.map((t=>z.get(t))).filter(rt),(()=>Xr(z,n))).subscribe((n=>{"error"!==n.type?(n.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=J(t);e.log_id&&Y(e)})),e=Boolean(n.value)):N(q(new Error("variable_trigger condition execution error"),{additional:{message:n.value}}))}))}))}catch(e){N(q(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else N(q(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));const st=null===(c=v.card)||void 0===c?void 0:c.states,ct=st&&!E?{type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:st.map((t=>({state_id:t.state_id.toString(),div:t.div})))}:void 0;return void 0===e.id&&r.id&&void 0!==u&&r.id(u),void 0===e.json&&r.json&&void 0!==v&&r.json(v),void 0===e.platform&&r.platform&&void 0!==p&&r.platform(p),void 0===e.theme&&r.theme&&void 0!==g&&r.theme(g),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==f&&r.globalVariablesController(f),void 0===e.onError&&r.onError&&void 0!==h&&r.onError(h),void 0===e.onStat&&r.onStat&&void 0!==m&&r.onStat(m),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==y&&r.onCustomAction(y),void 0===e.onComponent&&r.onComponent&&void 0!==b&&r.onComponent(b),void 0===e.setTheme&&r.setTheme&&void 0!==k&&r.setTheme(k),void 0===e.setVariable&&r.setVariable&&void 0!==I&&r.setVariable(I),void 0===e.getVariable&&r.getVariable&&void 0!==O&&r.getVariable(O),void 0===e.execAction&&r.execAction&&void 0!==Y&&r.execAction(Y),"light"===g||"dark"===g?$=g:"system"===g?"undefined"!=typeof matchMedia?(x||(x=matchMedia("(prefers-color-scheme: dark)"),x.addListener((function(){"system"===g&&x&&($=x.matches?"dark":"light")}))),$=x.matches?"dark":"light"):$="light":N(q(new Error("Unsupported theme"))),$&&(ot&&ot[$].forEach((t=>{const e=z.get(t.name);e&&e.setValue(t.color)}))),o(),!E&&ct?`<div class="${j("divkit-b023c",!0)+j(i?" divkit-ee112":"",!0)}">${M(Xe,"RootSvgFilters").$$render(t,{svgFiltersMap:H},{},{})}\n ${M(Ze,"Unknown").$$render(t,{div:ct,templateContext:{}},{},{})}</div>`:""}));function dn(t){return un.render({id:t.id,json:t.json,globalVariablesController:t.globalVariablesController,onError:t.onError,platform:t.platform}).html}var vn=e.M,pn=e.Os,gn=e.sY;export{vn as createGlobalVariablesController,pn as createVariable,gn as render};
1
+ var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};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.d(e,{M:()=>cn,Os:()=>We,sY:()=>dn}),new Set,new Map;const p=[],g=[],f=[],h=[],m=Promise.resolve();let y=!1;function _(){return y||(y=!0,m.then(x)),m}function b(t){f.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<f.length;t+=1){const e=f[t];w.has(e)||(w.add(e),e())}f.length=0}while(p.length);for(;h.length;)h.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 C=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"]),E=/[\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=T(n):r.style=T(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(E.test(t))return;const e=r[t];!0===e?n+=" "+t:C.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 D(t){return"string"==typeof t||t&&"object"==typeof t?j(t,!0):t}function z(t){const e={};for(const r in t)e[r]=D(t[r]);return e}function S(t,e){let r="";for(let n=0;n<t.length;n+=1)r+=e(t[n],n);return r}const P={$$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 I,O;function J(t){function e(e,r,n,i,o){const a=s;l({$$:{on_destroy:I,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}={})=>{I=[];const o={title:"",head:"",css:new Set},a=e(o,t,{},r,n);return i(I),{html:a,css:{code:Array.from(o.css).map((t=>t.code)).join("\n"),map:null},head:o.title+o.head}},$$render:e}}function N(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${j(e,!0)}"`}`}function T(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${t[e]};`)).join(" ")}function B(t){const e=T(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{subscribe:U(n,(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}}const L=Symbol("root");function q(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const H={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"},G={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 Y(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 Z(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 X(t){let e=Z(t);return"0"===e&&(e+="em"),e}function K(t,e){for(;t.length<e;)t="0"+t;return t}function Q(t,e=1,r="transparent"){if("#"!==(t=(t||"").toLowerCase()).charAt(0))return r;const n=tt(t);return n?(n.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>K(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(n)):r}function tt(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 et(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 rt=Boolean;function nt(t){if(1===t.length&&"solid"===t[0].type)return{color:Q(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=Q(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(rt);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>Q(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:at(t.bg.scale),pos:st(t.bg),image:'url("'+et(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(rt);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=X(n.value):"relative"===n.type&&(i=it[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${i||"farthest-corner"} at ${ot(t.bg.center_x)} ${ot(t.bg.center_y)},`+r.map((t=>Q(t))).join(",")+")"}}({bg:t}):void 0)).filter(rt).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 it={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function ot(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return X(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function at(t){return"fill"!==t&&t?"fit"===t?"contain":void 0:"cover"}function st(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 lt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}const ct=new Set(["http","https","tel","mailto","intent"]);function ut(t){return ct.has(t)}function dt(t,e){e&&t.push(e)}function vt(t,e,r){const n=[];dt(n,e[t]);for(const i in r)if(r.hasOwnProperty(i)){const o=r[i];o&&dt(n,e[`${t}_${i}`+("string"==typeof o?`_${o}`:"")])}return n.join(" ")}const pt=Symbol("state");function gt(t){return Z(t.top||0)+" "+Z(t.right||0)+" "+Z(t.bottom||0)+" "+Z(t.left||0)}function ft(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function ht(t){return ft(t)&&t>=0}function mt(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]&&!ht(r[t]))return e;return gt(t)}function yt(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const _t=Object.prototype.hasOwnProperty;function bt(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(!_t.call(e,i)||!bt(t[i],e[i]))return!1}return!0}function wt(t,e){return bt(t,e)?e:t}function $t(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function xt(t,e){const r=Number(t);return isNaN(r)?e:r}function kt(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...kt(t))})):e.push(t),e}function Ct(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>Z((t||e)/r*10))).join(" ")}function Et(){}const Ft=Symbol("action"),At=J(((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=Et}=e,{customAction:p=null}=e,{isNativeActionAnimation:g=!0}=e;const f=v(L),h=v(Ft);d(Ft,{hasAction:()=>Boolean(h.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)&&h.hasAction()&&(y="",f.logError(q(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:i}})));let _=Boolean(p);return y&&!ut(lt(y))&&(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!==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:D(y)},{target:D(m)},{style:D(l)},{class:j(s,!0)+" "+j(g?"divkit-bd259":"divkit-d9099",!0)+" "+j(null!=a&&a.length?"divkit-f0cba":"",!0)},z(c)],{})}>${n.default?n.default({}):""}</a>`:`<span${F([{class:j(s,!0)+j(_?` ${g?"divkit-bd259":"divkit-d9099"} divkit-c016b`:"",!0)+" "+j(null!=a&&a.length?"divkit-f0cba":"",!0)},{style:D(l)},{role:D(_?"button":null)},{tabindex:D(_?0:null)},z(c)],{})}>${n.default?n.default({}):""}</span>`}));function Vt(t){return ft(t)&&t>0}function jt(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(Vt(t.radius))return`blur(${X(t.radius/2)})`}else e(q(new Error("Unknown filter"),{level:"warn",additional:{filter:null==t?void 0:t.type}}))})).filter(Boolean).join(" ")}const Dt=J(((t,e,r,n)=>{let i,{background:o=[]}=e,{radius:a=""}=e;const s=v(L);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=nt([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=jt(t.filters,s.logError)))}return r})),`<span${N("class","divkit-bf253"+(a?" divkit-dcad7":""),0)}${B({"border-radius":a})}>${S(i,(t=>t.image_url?`<img${N("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${N("class","divkit-b921d",0)}${N("style",Y(t.style),0)}>`:`<span${N("class","divkit-b921d",0)}${N("style",Y(t.style),0)}></span>`))}</span>`})),zt=Dt,St=J(((t,e,n,i)=>{let o,s,l,c,u,d,p,g,f,h,m,y,b,w,$,x,k,C,E,F,A,V,j,D,z,S,P,I,O,J,T,B,R,U,W,H,K,tt,et,rt,it,ot=r,at=r,st=r,ct=r,dt=r,ft=r,_t=r,bt=r,Et=r,Ft=r,Vt=r,jt=r,Dt=r,St=r,Pt=r,Mt=r,It=r;var Ot,Jt,Nt,Tt,Bt,Rt;let{json:Ut={}}=e,{origJson:Wt}=e,{templateContext:Lt}=e,{cls:qt=""}=e,{style:Ht}=e,{layoutParams:Gt={}}=e,{customDescription:Yt=!1}=e,{customPaddings:Zt=!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(L),ie=v(pt);let oe,ae,se,le,ce,ue,de,ve={},pe={},ge=!1,fe=1,he="transparent",me=0,ye={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},_e="",be=null,we="",$e={},xe=0,ke=0,Ce=0,Ee=!1,Fe=!1,Ae={},Ve=0,je=0,De=0,ze=!1,Se=!1,Pe=1;const Me=Gt.fakeElement?[]:Ut.transition_triggers||["state_change","visibility_change"],Ie=-1!==Me.indexOf("state_change")&&Ut.id,Oe=-1!==Me.indexOf("visibility_change")&&Ut.id;let Je,Ne,Te,Be,Re,Ue,We,Le,qe,He=[],Ge=[],Ye=[],Ze=[],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!==Yt&&n.customDescription(Yt),void 0===e.customPaddings&&n.customPaddings&&void 0!==Zt&&n.customPaddings(Zt),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),It(),It=a(o,(t=>it=t));{let t={},e={},r=!1,n="";if(it){if(it.has_shadow){const e=it.shadow;t["box-shadow"]=e?Z((null===(Jt=null===(Ot=e.offset)||void 0===Ot?void 0:Ot.x)||void 0===Jt?void 0:Jt.value)||0)+" "+Z((null===(Tt=null===(Nt=e.offset)||void 0===Nt?void 0:Nt.y)||void 0===Tt?void 0:Tt.value)||0)+" "+Z(null!==(Bt=e.blur)&&void 0!==Bt?Bt:2)+" "+Q(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(it.stroke&&(r=!0,fe=yt(it.stroke.width,fe),he=Q(it.stroke.color,1,he),e.border=`${Z(fe)} solid ${he}`),it.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]&&!ht(r[t]))return e;return t}(it.corners_radius,ye),e["border-radius"]=t["border-radius"]=Ct(ye)):it.corner_radius&&(me=yt(it.corner_radius,me),ye={"top-left":me,"top-right":me,"bottom-right":me,"bottom-left":me},e["border-radius"]=t["border-radius"]=Z(me)),r&&fe&&(it.corners_radius||it.corner_radius)){let t=Object.assign({},ye);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+fe/2})),n=Ct(t)}}ve=wt(t,ve),pe=wt(e,pe),ge=r,_e=n}s=ne.getDerivedFromVars(Ut.paddings),Mt(),Mt=a(s,(t=>rt=t)),be=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]]&&!ht(t[r[n]]))return e;return t}(rt&&!Zt?rt:void 0,be),l=gt(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}(be,te)),c=ne.getDerivedFromVars(Ut.margins),St(),St=a(c,(t=>tt=t)),we=mt(tt,we),u=ne.getDerivedFromVars(Ut.width),jt(),jt=a(u,(t=>H=t)),d=ne.getDerivedFromVars(Ut.alignment_horizontal),Pt(),Pt=a(d,(t=>et=t));{let t,e,r={},n=0,i=0,o=!1,a=!1;const s=null==H?void 0:H.type;if("fixed"===s?(xe=yt(null==H?void 0:H.value,xe),e=Z(xe)):"wrap_content"===s||!Gt.overlapParent&&"match_parent"===s&&Gt.parentHorizontalWrapContent?(t="content",("wrap_content"===s&&(null==H?void 0:H.constrained)||"match_parent"===s&&Gt.parentHorizontalWrapContent)&&(r["width-constrained"]=!0,i=1),"match_parent"===s&&ne.logError(q(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(q(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===Gt.parentLayoutOrientation?e=`calc(100% - ${X(((null==tt?void 0:tt.left)||0)+((null==tt?void 0:tt.right)||0))})`:"horizontal"===Gt.parentContainerOrientation&&(n=H&&"weight"in H&&H.weight||1,Gt.parentContainerWrap&&(o=!0))),"content"===t&&Kt&&(t="parent",ne.logError(q(new Error("Incorrect usage of width with value 'wrap_content'"),{level:"warn"}))),"parent"===t)r["halign-self"]="stretch";else{const t=et;r["halign-self"]="left"===t||"center"===t||"right"===t?ee[t]:Gt.parentHAlign||"start"}t&&(r.width=t),se=e,ke=n,Ce=i,$e=wt(r,$e),Ee=o,Fe=a}p=ne.getDerivedFromVars(Ut.height),Vt(),Vt=a(p,(t=>W=t)),g=ne.getDerivedFromVars(Ut.alignment_vertical),Dt(),Dt=a(g,(t=>K=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=yt(null==W?void 0:W.value,Ve),e=Z(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(q(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(q(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===Gt.parentLayoutOrientation?e=`calc(100% - ${X(((null==tt?void 0:tt.top)||0)+((null==tt?void 0:tt.bottom)||0))})`:"vertical"===Gt.parentContainerOrientation&&(n=(null==W?void 0:W.weight)||1,Gt.parentContainerWrap&&(o=!0))),"content"===t&&Qt&&(t="parent",ne.logError(q(new Error("Incorrect usage of height with value 'wrap_content'"),{level:"warn"}))),"parent"===t)r["valign-self"]="stretch";else{const t=K;"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,De=i,Ae=wt(r,Ae),ze=o,Se=a}var rr,nr,ir;if(f=!!Gt.overlapParent||void 0,h=Gt.overlapParent&&(!H||"match_parent"===H.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),Ft(),Ft=a(y,(t=>U=t)),nr=Pe,Pe=!ht(rr=U)||void 0===rr||rr>1?nr:Number(rr),ce=1===Pe?void 0:Pe,b=ne.getDerivedFromVars(Ut.accessibility),Et(),Et=a(b,(t=>R=t)),ae=void 0,R&&!Yt&&R.description&&(ae={},ae["aria-label"]=R.description),w=ne.getDerivedFromVars(Ut.background),bt(),bt=a(w,(t=>B=t)),ue={},de=!1,B&&(de=B.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(_e),!de)){const t=nt(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"}Je=void 0,Ie&&Ut.transition_in&&ne.isRunning("stateChange")&&(Je=!0),Te=void 0,Ie&&Ut.transition_change&&ne.isRunning("stateChange")&&ie.hasTransitionChange(Ut.id)&&(Te=!0),$=ne.getDerivedFromVars(Ut.action),ft(),ft=a($,(t=>J=t)),x=ne.getDerivedFromVars(Ut.actions),_t(),_t=a(x,(t=>T=t)),k=ne.getDerivedFromVars(Ut.doubletap_actions),dt(),dt=a(k,(t=>O=t)),C=ne.getDerivedFromVars(Ut.longtap_actions),ct(),ct=a(C,(t=>I=t));{let t=T||J&&[J]||[],e=O||[],r=I||[];Gt.fakeElement?(t=[],e=[],r=[]):(Array.isArray(t)||(t=[],ne.logError(q(new Error("Actions should be array")))),Array.isArray(e)||(e=[],ne.logError(q(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],ne.logError(q(new Error("LongTapActions should be array"))))),(t.length||e.length||r.length)&&Xt&&(t=[],e=[],r=[],ne.logError(q(new Error(`Cannot use action on component "${Xt}"`)))),He=t,Ge=e,Ye=r}E=ne.getDerivedFromVars(Ut.action_animation),st(),st=a(E,(t=>P=t)),P&&(Ze=kt(P),Xe=Ze.map((function(t){const e=xt(t.start_value,1),r=xt(t.end_value,1),n=yt(t.start_delay,0),i=yt(t.duration,300),o=$t(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(q(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", ")),F=ne.getDerivedFromVars(Ut.visibility),at(),at=a(F,(t=>S=t));{const t=Qe,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(S,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 _(),"in"===e&&(Ne=!0),ie.runVisibilityTransition(Object.assign(Object.assign({},Ut),{visibility:"visible"}),Lt,r,oe,e).then((()=>{"in"===e&&(Ne=!1)})).catch((t=>{throw"in"===e&&(Ne=!1),t})))}(e)),Ke||(Ke=!0)}if(A=Object.assign(Object.assign(Object.assign({},$e),Ae),{"parent-overlap":f,"parent-overlap-absolute":h,"scroll-snap":Gt.scrollSnap,"hide-on-transition-in":Je||Ne||Te,visibility:Qe,"has-action-animation":Boolean(Xe),"parent-flex":Gt.parentContainerOrientation||void 0}),V=ne.getDerivedFromVars(Ut.transform),ot(),ot=a(V,(t=>z=t)),z&&void 0!==z.rotation){const t=z.pivot_x||{type:"pivot-percentage",value:50};tr=xt(t.value,tr);const e="pivot-fixed"===t.type?Z(tr):`${tr}%`,r=z.pivot_y||{type:"pivot-percentage",value:50};er=xt(r.value,er),Le=`${e} ${"pivot-fixed"===r.type?Z(er):`${er}%`}`,qe=`rotate(${z.rotation}deg)`}return j=Ee||ze?"100%":ke||je?0:void 0,D=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":Ce||De?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}),ot(),at(),st(),ct(),dt(),ft(),_t(),bt(),Et(),Ft(),Vt(),jt(),Dt(),St(),Pt(),Mt(),It(),Fe||Se?"":`${M(At,"Actionable").$$render(t,{use:function(t){oe=t,Ie&&Ut.transition_in&&ie.registerChildWithTransitionIn(Ut,Lt,Ut.transition_in,t).then((()=>{Je=!1})).catch((t=>{throw Je=!1,t})),Ie&&Ut.transition_out&&ie.registerChildWithTransitionOut(Ut,Lt,Ut.transition_out,t),Ie&&Ut.transition_change&&ie.registerChildWithTransitionChange(Ut,Lt,Ut.transition_change,t).then((()=>{Te=!1})).catch((t=>{throw Te=!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=lt(n);t&&!ut(t)&&("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+" "+vt("outer",G,A),style:Y(D),actions:He,doubleTapActions:Ge,longTapActions:Ye,attrs:ae,isNativeActionAnimation:!Ze.length||(ir=Ze,ir.some((t=>"native"===t.name)))},{},{default:()=>`${de?`${M(zt,"OuterBackground").$$render(t,{background:B,radius:_e},{},{})}`:""}${i.default?i.default({}):""}${ge?`<span${N("class",G.outer__border,0)}${N("style",Y(pe),0)}></span>`:""}`})}`})),Pt=St,Mt={"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 It(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function Ot(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function Jt(t,e){return Ot(t)||e}const Nt=J(((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:f=!1}=e,{actions:h}=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!==f&&r.singleline(f),void 0===e.actions&&r.actions&&void 0!==h&&r.actions(h);{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=It(g.font_size,y),Vt(g.line_height)&&(_=Number(g.line_height)/y),ht(g.letter_spacing)&&(b=Z(g.letter_spacing)),d=Jt(g.font_weight,d),w=Q(g.text_color,1,w),i=g.top_offset?Z(g.top_offset):"",o=g.background?nt([g.background]):null,$=(null===(c=g.border)||void 0===c?void 0:c.stroke)&&"transparent"!==Q(g.border.stroke.color)&&Vt(g.border.stroke.width)?{color:g.border.stroke.color,width:g.border.stroke.width}:null,a=It(null===(u=g.border)||void 0===u?void 0:u.corner_radius,0),s={singleline:f,decoration:m},l={"font-size":Z(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 ${Z($.width)} ${$.color}`:void 0,"border-radius":a?Z(a):void 0},`${i?`<span${N("class",Mt["text-range__top-offset"],0)}${B({"margin-top":i})}></span>`:""}${M(At,"Actionable").$$render(t,{cls:vt("text-range",Mt,s),actions:h,style:Y(l)},{},{default:()=>`${j(v)}`})}`})),Tt=Nt;function Bt(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Rt(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function Ut(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const Wt=J(((t,e,n,i)=>{let o,s,l,c,d,p,g,f,h,m,y,_,b,w,$,x,k,C,E,F,A,V,j,D,z,P,I,O,J,T,B,R,U,W=r,G=r,X=r,K=r,tt=r,et=r,rt=r,it=r,ot=r,at=r,st=r,lt=r,ct=r,{json:ut={}}=e,{templateContext:dt}=e,{origJson:pt}=e,{layoutParams:gt}=e;const ft=v(L);let ht=!1,mt="",yt=12,_t=1.25,bt=!1,wt="",$t="",xt=!1,kt="left",Ct="top",Et="",Ft="",At=!1,jt=[],Dt=[];var zt,St;u((()=>{Dt.forEach((([t,e])=>{ft.removeSvgFilter(t,e)}))})),void 0===e.json&&n.json&&void 0!==ut&&n.json(ut),void 0===e.templateContext&&n.templateContext&&void 0!==dt&&n.templateContext(dt),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=ft.getDerivedFromVars(ut.text),ct(),ct=a(o,(t=>U=t)),zt=U,St=mt,mt=String(null!=zt?zt:"")||St,mt?ht=!1:(ht=!0,ft.logError(q(new Error('Missing "text" prop for div "text"')))),s=ft.getDerivedFromVars(ut.ranges),G(),G=a(s,(t=>V=t)),l=ft.getDerivedFromVars(ut.images),W(),W=a(l,(t=>A=t)),c=ft.getDerivedFromVars({font_size:ut.font_size,letter_spacing:ut.letter_spacing,font_weight:ut.font_weight,text_color:ut.text_color,underline:ut.underline,strike:ut.strike,line_height:ut.line_height}),X(),X=a(c,(t=>j=t)),d=ft.getDerivedFromVars(ut.font_size),lt(),lt=a(d,(t=>R=t)),yt=It(R,yt),p=ft.getDerivedFromVars(ut.line_height),st(),st=a(p,(t=>B=t));{const t=B;Vt(t)?(_t=Number(t)/yt,bt=!0):bt=!1}g=ft.getDerivedFromVars(ut.max_lines),it(),it=a(g,(t=>O=t)),f=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)}wt=t,$t=e,xt=r}h=ft.getDerivedFromVars(ut.text_alignment_horizontal),at(),at=a(h,(t=>T=t)),kt=Bt(T,kt),m=ft.getDerivedFromVars(ut.text_alignment_vertical),ot(),ot=a(m,(t=>J=t)),Ct=Rt(J,Ct),y=!V||mt&&1===V.length&&V[0]&&0===V[0].start&&"number"==typeof V[0].end&&V[0].end>=mt.length,_=ft.getDerivedFromVars(ut.text_color),rt(),rt=a(_,(t=>I=t)),b=Boolean(I)!==Boolean(V&&V[0]&&V[0].text_color);{let t="";O&&y&&b&&(t=Q(I||V&&V[0]&&V[0].text_color,1,Et)),Et=t}w=ft.getDerivedFromVars(ut.truncate),et(),et=a(w,(t=>P=t)),$="none"===P?"none":"",x=ft.getDerivedFromVars(ut.text_gradient),tt(),tt=a(x,(t=>z=t));{let t="";if(z){const e=nt([z]);e.image&&(t=e.image)}Ft=t}return k=ft.getDerivedFromVars(ut.selectable),K(),K=a(k,(t=>D=t)),At=function(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}(D,At),function(t,e,r){let n=[];if(Dt.forEach((([t,e])=>{ft.removeSvgFilter(t,e)})),Dt=[],!(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=Z(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),i=Z(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":Z(10*(Number(e.font_size)||12)/yt)};let a="";const s=t.image.tint_color,c=Ut(t.image.tint_mode,"source_in");if(s){const e=Q(t.image.tint_color);a=ft.addSvgFilter(e,c),Dt.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}(mt,V,A),C={singleline:f,multiline:xt,halign:kt,valign:Ct,truncate:$},E={gradient:Boolean(Ft)},F={"font-size":Z(yt),"line-height":_t,"max-height":wt,"-webkit-line-clamp":$t,color:Et,"background-image":Ft},W(),G(),X(),K(),tt(),et(),rt(),it(),ot(),at(),st(),lt(),ct(),ht?"":`${M(Pt,"Outer").$$render(t,{cls:vt("text",H,C)+" "+(At?"":"divkit-c016b"),json:ut,origJson:pt,templateContext:dt,layoutParams:gt},{},{default:()=>`<span${N("class",vt("text__inner",H,E),0)}${N("style",Y(F),0)}>${jt.length?`${S(jt,((e,r)=>"text"in e?e.text?`${M(Tt,"TextRangeView").$$render(t,{text:e.text,rootFontSize:yt,textStyles:e.textStyles,singleline:f,actions:e.actions},{},{})}`:"":e.image?`<span${N("style",Y(e.image.wrapperStyle),0)}><img${N("class",H.text__image,0)}${N("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${N("style",Y({width:e.image.width,height:e.image.height,"margin-top":bt?`-${e.image.height}`:void 0,"margin-bottom":bt?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${M(Tt,"TextRangeView").$$render(t,{text:mt,rootFontSize:yt,textStyles:j,singleline:f},{},{})}`}</span>`})}`})),Lt=Wt,qt={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 Ht(t,e,r){if(!(t&&t.shape&&t.color&&t.shape.type&&e.includes(t.shape.type)))return r;const n=Q(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?Q(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 ${Z(s)} ${r}`),e}return r}function Gt(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 Yt(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(Z).join(" ")}function Zt(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 Xt(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)&&Zt(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)Zt(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];Zt(t,e.style,o,{top:o.bottom+e.style.height,right:0,bottom:0,left:o.right+e.style.width},i,n)}}const Kt=J(((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(G.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&&Xt(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&&Xt(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("divkit-f6e9a"))&&!(null==r?void 0:r.contains("divkit-a7719"))}))&&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${N("class","divkit-a7719",0)}${N("this",c,0)}>${S(d,(t=>`<div${N("class","divkit-c770e",0)}${B({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${N("class","divkit-f6e9a",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 Qt;function te(){if(void 0!==Qt)return Qt;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),Qt=1===t.scrollHeight,document.body.removeChild(t),Qt}const ee=J(((t,e,n,i)=>{let o,s,l,c,u,d,p,g,f,h,m,y,_,b,w,$,x,k,C,E,F,A,V=r,j=r,D=r,z=r,P=r,I=r,O=r,J=r;var N,T,B,R,U,W;let{json:H={}}=e,{templateContext:G}=e,{origJson:Y}=e,{layoutParams:Z}=e;const X={left:"start",center:"center",right:"end"},K={top:"start",center:"center",bottom:"end",baseline:"baseline"},Q=["rounded_rectangle","circle"],tt=v(L);let et=!1,rt="vertical",nt="top",it="left",ot=null,at=null,st={};if(void 0===e.json&&n.json&&void 0!==H&&n.json(H),void 0===e.templateContext&&n.templateContext&&void 0!==G&&n.templateContext(G),void 0===e.origJson&&n.origJson&&void 0!==Y&&n.origJson(Y),void 0===e.layoutParams&&n.layoutParams&&void 0!==Z&&n.layoutParams(Z),o=H.items,(null==o?void 0:o.length)&&Array.isArray(o)?et=!1:(et=!0,tt.logError(q(new Error('Incorrect or empty "items" prop for div "container"')))),s=(!et&&o||[]).map((t=>{let e=t,r=G;return({templateContext:r,json:e}=tt.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=tt.getDerivedFromVars(H.orientation),J(),J=a(l,(t=>A=t)),rt=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(A,rt),c=tt.getDerivedFromVars(H.content_alignment_vertical),O(),O=a(c,(t=>F=t)),nt=Rt(F,nt),u=tt.getDerivedFromVars(H.content_alignment_horizontal),I(),I=a(u,(t=>E=t)),it=Bt(E,it),d=tt.getDerivedFromVars(H.layout_mode),P(),P=a(d,(t=>C=t)),p="wrap"===C,g=tt.getDerivedFromVars(H.separator),z(),z=a(g,(t=>k=t)),(null==k?void 0:k.style)&&"overlap"!==rt&&te()){const t=Ht(k.style,Q,(null==ot?void 0:ot.style)||null);ot=t?{show_at_start:Boolean(null!==(N=k.show_at_start)&&void 0!==N&&N),show_at_end:Boolean(null!==(T=k.show_at_end)&&void 0!==T&&T),show_between:Boolean(null===(B=k.show_between)||void 0===B||B),style:t}:null}else ot=null;if(f=tt.getDerivedFromVars(H.line_separator),D(),D=a(f,(t=>x=t)),(null==x?void 0:x.style)&&"overlap"!==rt&&te()){const t=Ht(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;h=ot||at?function(t,e,r){const n={};return Gt(n,e,"vertical"===t),Gt(n,r,"horizontal"===t),n}(rt,ot,at):null,m=tt.getDerivedFromVars(H.width),V(),V=a(m,(t=>w=t)),y=tt.getDerivedFromVars(H.height),j(),j=a(y,(t=>$=t));{let t={};(null==Z?void 0:Z.fakeElement)&&(t.fakeElement=!0),"overlap"===rt&&(t.overlapParent=!0),"horizontal"!==rt&&(t.parentHAlign=X[it],(!$||"wrap_content"===$.type||"match_parent"===$.type&&(null==Z?void 0:Z.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==Z?void 0:Z.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0)),"horizontal"===rt&&(t.parentContainerOrientation="horizontal"),"vertical"===rt&&(t.parentContainerOrientation="vertical"),p&&(t.parentContainerWrap=!0),st=wt(t,st)}return _={orientation:rt,valign:nt,halign:it,wrap:p},b={gap:ot||at?Yt(rt,ot,at):void 0},V(),j(),D(),z(),P(),I(),O(),J(),et?"":`${M(Pt,"Outer").$$render(t,{cls:vt("container",qt,_),style:b,json:H,origJson:Y,templateContext:G,layoutParams:Z,additionalPaddings:h},{},{default:()=>`${S(s,(e=>`${M(Ze,"Unknown").$$render(t,{layoutParams:st,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n\n ${ot||at?`${M(Kt,"ContainerSeparators").$$render(t,{separator:ot,lineSeparator:at,orientation:rt},{},{})}`:""}`})}`})),re=ee,ne={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function ie(t,e){return"vertical"===t||"horizontal"===t?t:e}const oe=J(((t,e,n,i)=>{let o,s,l,c,u,d,p,g=r,{json:f={}}=e,{templateContext:h}=e,{origJson:m}=e,{layoutParams:y}=e;const _=v(L);let b="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&n.json&&void 0!==f&&n.json(f),void 0===e.templateContext&&n.templateContext&&void 0!==h&&n.templateContext(h),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(f.delimiter_style),g(),g=a(o,(t=>p=t)),b=ie(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=Q(null==p?void 0:p.color,1,w),l="horizontal"===b?"100%":Z(1),c="horizontal"===b?Z(1):"100%",u={background:w,width:l,height:c},d={orientation:b},g(),`${M(Pt,"Outer").$$render(t,{cls:vt("separator",ne,d),json:f,origJson:m,templateContext:h,layoutParams:y},{},{default:()=>s?`<span${N("class",ne.separator__inner,0)}${N("style",Y(u),0)}></span>`:""})}`})),ae={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"},se=J(((t,e,n,i)=>{let o,s,l,c,d,p,g,f,h,m,y,_,b,w,$,x,k,C,E,F,A,V,j,D,z,S,P,I,O,J,T,R,U,W,H,G=r,Z=r,X=r,K=r,tt=r,rt=r,nt=r,it=r,ot=r,lt=r,ct=r,ut=r,dt=r,pt=r,{json:gt={}}=e,{templateContext:ft}=e,{origJson:ht}=e,{layoutParams:mt}=e;const _t=v(L);let bt,wt=0,xt="rgba(0,0,0,0.08)",kt=!1,Ct="",Et="none",Ft="50% 50%",At="0",Dt="source_in",zt="",St="",Mt=0,It=0,Ot=0,Jt="",Nt="";u((()=>{_t.removeSvgFilter(bt,Dt)})),void 0===e.json&&n.json&&void 0!==gt&&n.json(gt),void 0===e.templateContext&&n.templateContext&&void 0!==ft&&n.templateContext(ft),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=_t.getDerivedFromVars(gt.image_url),pt(),pt=a(o,(t=>H=t)),s=_t.getDerivedFromVars(gt.gif_url),dt(),dt=a(s,(t=>W=t)),l=H||W,wt=0,l?kt=!1:(kt=!0,_t.logError(q(new Error('Missing "image_url" for "image"')))),c=_t.getDerivedFromVars(gt.width),ut(),ut=a(c,(t=>U=t)),d="wrap_content"===(null==U?void 0:U.type),p=_t.getDerivedFromVars(gt.height),ct(),ct=a(p,(t=>R=t)),g="wrap_content"===(null==R?void 0:R.type),f=_t.getDerivedFromVars(gt.preview),lt(),lt=a(f,(t=>T=t));{const t=T;Ct=t?t.startsWith("data:")?`url("${et(t)}")`:`url("data:image/jpg;base64,${et(t)}")`:""}h=_t.getDerivedFromVars(gt.placeholder_color),ot(),ot=a(h,(t=>J=t)),xt=Q(J,1,xt),m=_t.getDerivedFromVars(gt.scale),it(),it=a(m,(t=>O=t)),Et=at(O)||Et,y=_t.getDerivedFromVars({content_alignment_horizontal:gt.content_alignment_horizontal,content_alignment_vertical:gt.content_alignment_vertical}),nt(),nt=a(y,(t=>I=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:st(t)}(I,Ft),_=_t.getDerivedFromVars(gt.accessibility),rt(),rt=a(_,(t=>P=t)),b=(null==P?void 0:P.description)||"",w=_t.getDerivedFromVars(gt.aspect),tt(),tt=a(w,(t=>S=t));{const t=null==S?void 0:S.ratio;At=t&&Vt(t)?(100/Number(t)).toFixed(2):"0"}$=_t.getDerivedFromVars(gt.tint_color),K(),K=a($,(t=>z=t)),x=_t.getDerivedFromVars(gt.tint_mode),X(),X=a(x,(t=>D=t));{const t=z,e=t?Q(t):void 0,r=Ut(D,Dt);e===bt&&r===Dt||(_t.removeSvgFilter(bt,Dt),zt=e?_t.addSvgFilter(e,r):"",bt=e,Dt=r)}if(k=_t.getDerivedFromVars(gt.appearance_animation),Z(),Z=a(k,(t=>j=t)),j&&"fade"===j.type){const t=j;St=$t(t.interpolator,"ease_in_out").replace(/_/g,"-"),Ot=yt(t.duration,300),It=yt(t.start_delay,0),Mt=yt(t.alpha,0)}C=_t.getDerivedFromVars(gt.filters),G(),G=a(C,(t=>V=t));{let t="",e="";Array.isArray(V)&&V.length&&(t=jt(V,_t.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),Jt=t,Nt=e}return E={aspect:"0"!==At,"is-width-content":d,"is-height-content":g,loaded:!1,"before-appearance":Boolean(St)&&!0},F={"background-image":Ct,"background-color":Ct?void 0:xt,"background-size":Et},A={"object-fit":Et,"object-position":Ft,filter:["",Jt].filter(Boolean).join(" "),"clip-path":Nt||void 0,"--divkit-appearance-interpolator":St||void 0,"--divkit-appearance-fade-start":St?Mt:void 0,"--divkit-appearance-delay":St?`${It}ms`:void 0,"--divkit-appearance-duration":St?`${Ot}ms`:void 0},G(),Z(),X(),K(),tt(),rt(),nt(),it(),ot(),lt(),ct(),ut(),dt(),pt(),kt?"":`${M(Pt,"Outer").$$render(t,{cls:vt("image",ae,E),json:gt,origJson:ht,templateContext:ft,layoutParams:mt,style:F,customDescription:!0},{},{default:()=>E.aspect?`<span${N("class",ae["image__aspect-wrapper"],0)}${B({"padding-bottom":`${At}%`})}><img${N("class",ae.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",Y(A),0)}${N("alt",b,0)}${N("aria-hidden",b?null:"true",0)}></span>`:`<img${N("class",ae.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",Y(A),0)}${N("alt",b,0)}${N("aria-hidden",b?null:"true",0)}>`})}`})),le={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 ce(t){return t>0&&t<1}function ue(t){return String(Math.ceil(1e3*t)/1e3)}function de(t,e,r){if(t.some(ce)){const e=Math.max(...t.filter(ce).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(${Z(n*t[e]/i)},${ue(t[e])}fr)`:t[e]?o[e]=`${ue(t[e])}fr`:o[e]="auto";return o.join(" ")}const ve=J(((t,e,n,i)=>{let o,s,l,c,u,d,p,g,f,h,m,y,_=r,b=r,w=r,$=r,{json:x={}}=e,{templateContext:k}=e,{origJson:C}=e,{layoutParams:E}=e;const F=v(L);let A,V,j=!1,D=1,z=[],P=[],I=[],O=[],J=0,N=!1,T="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!==C&&n.origJson(C),void 0===e.layoutParams&&n.layoutParams&&void 0!==E&&n.layoutParams(E),o=x.items,(null==o?void 0:o.length)&&Array.isArray(o)?j=!1:(j=!0,F.logError(q(new Error('Incorrect or empty "items" prop for div "grid"')))),s=F.getDerivedFromVars(x.column_count),$(),$=a(s,(t=>y=t)),D=It(y,D),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;z=[],P=[],I=[],O=[],N=!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,f=1===u&&"fixed"===(null===(s=c.width)||void 0===s?void 0:s.type)&&c.width.value?Number(c.width.value)/u:0,h=1===d&&"fixed"===(null===(l=c.height)||void 0===l?void 0:l.type)&&c.height.value?Number(c.height.value)/d:0;for(let n=e;n<e+u;++n)for(let e=r;e<r+d;++e)t[n+"_"+e]?N=!0:(t[n+"_"+e]=!0,(!z[n]||z[n]<p)&&(z[n]=p),(!P[e]||P[e]<g)&&(P[e]=g),(!I[n]||I[n]<f)&&(I[n]=f),(!O[e]||O[e]<h)&&(O[e]=h));do{++e,e>=D&&(e=0,++r)}while(t[e+"_"+r]);return Object.assign(Object.assign({},n),{layoutParams:{gridArea:v,fakeElement:(null==E?void 0:E.fakeElement)||!1}})})),0!==e&&(N=!0),N&&F.logError(q(new Error('Mismatching "grid" rows/columns'))),J=r}return c=F.getDerivedFromVars(x.content_alignment_vertical),b(),b=a(c,(t=>h=t)),T=Rt(h,T),u=F.getDerivedFromVars(x.content_alignment_horizontal),_(),_=a(u,(t=>f=t)),B=Bt(f,B),d={valign:T,halign:B},p={"grid-template-columns":de(z,I,D),"grid-template-rows":de(P,O,J)},g=j||N,_(),b(),w(),$(),g?"":`${M(Pt,"Outer").$$render(t,{cls:vt("grid",le,d),json:x,origJson:C,templateContext:k,style:p,layoutParams:E},{},{default:()=>`${S(V,(e=>`${M(Ze,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),pe=ve,ge={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 fe(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 he(t,e){let r;return function(...n){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,n),r=null}),e)}}const me=J(((t,e,n,i)=>{let o,s,l,c,d,p,g,f,h,m,y,_,b,w,$,x,k,C,E,F,A,V,D,z,P,I,O,J,T,B=r,R=r,U=r,H=r,G=r,X=r,K=r,Q=r,tt=r,et=r,{json:rt={}}=e,{templateContext:nt}=e,{origJson:it}=e,{layoutParams:ot}=e;const at=v(L);let st,lt,ct=[],ut=!1,dt=!1,pt=null,gt=!1;const ft=at.getCustomization("galleryLeftClass"),ht=at.getCustomization("galleryRightClass");let _t=!1;J=a(at.isDesktop,(t=>O=t));let bt,$t,xt,kt,Ct=1,Et="horizontal",Ft="start",At=8,Vt="",jt=[],Dt={},zt=!1,St={},Mt=0;const Ot=he((function(){const t=st.scrollLeft,e=st.scrollWidth,r=st.offsetWidth;ut=t>2,dt=t+r<e-2}),50);function Jt(){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 Nt(t,e,r="smooth"){const n="horizontal"===Et,i=n?"offsetLeft":"offsetTop",o=n?"left":"top";st.scroll({[o]:Math.max(0,t[e][i]-At/2),behavior:r})}function Tt(t){const e=Jt(),r=st.getBoundingClientRect(),n=e.findIndex((t=>function(t,e){return"horizontal"===Et?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"===Et?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}!rt.id||_t||(null==ot?void 0:ot.fakeElement)||at.registerInstance(rt.id,{setCurrentItem(t){const e=Jt();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Nt(e,t)},setPreviousItem(t){const e=Tt("prev"),r=Jt();let n=e-1;n<0&&(n="ring"===t?r.length-1:e),Nt(r,n)},setNextItem(t){const e="horizontal"===Et?st.scrollLeft+st.offsetWidth===st.scrollWidth:st.scrollTop+st.offsetHeight===st.scrollHeight,r=Jt();if(e&&"ring"===t)return void Nt(r,0);const n=Tt("next");let i=n+1;i>r.length-1&&(i="ring"===t?0:n),Nt(r,i)}}),u((()=>{gt=!1,rt.id&&!(null==ot?void 0:ot.fakeElement)&&at.unregisterInstance(rt.id)})),void 0===e.json&&n.json&&void 0!==rt&&n.json(rt),void 0===e.templateContext&&n.templateContext&&void 0!==nt&&n.templateContext(nt),void 0===e.origJson&&n.origJson&&void 0!==it&&n.origJson(it),void 0===e.layoutParams&&n.layoutParams&&void 0!==ot&&n.layoutParams(ot),o=rt.items,(null==o?void 0:o.length)&&Array.isArray(o)?_t=!1:(_t=!0,at.logError(q(new Error('Incorrect or empty "items" prop for div "gallery"')))),s=(!_t&&o||[]).map((t=>{let e=t,r=nt;return({templateContext:r,json:e}=at.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=O&&gt&&!_t,l?"undefined"!=typeof ResizeObserver&&(pt=new ResizeObserver((()=>{Ot()})),pt.observe(lt)):pt&&(pt.disconnect(),pt=null),c=at.getDerivedFromVars(rt.column_count),tt(),tt=a(c,(t=>I=t)),Ct=It(I,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=at.getDerivedFromVars(rt.orientation),Q(),Q=a(p,(t=>P=t)),Et=ie(P,Et),g=at.getDerivedFromVars(rt.cross_content_alignment),K(),K=a(g,(t=>z=t)),Ft=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(z,Ft),f=at.getDerivedFromVars(rt.item_spacing),X(),X=a(f,(t=>D=t)),At=yt(D,At),bt=Z(At),h=at.getDerivedFromVars(rt.cross_spacing),G(),G=a(h,(t=>V=t)),xt=yt(V,At),$t=Z(xt),m=at.getDerivedFromVars(rt.paddings),H(),H=a(m,(t=>A=t)),Vt=mt(A,Vt),y="horizontal"===Et?"grid-template-columns":"grid-template-rows";{let t=[];s.forEach((e=>{const r="horizontal"===Et?"width":"height";t.push(at.getDerivedFromVars(e.json[r]))})),kt=W(t,(t=>t)),U(),U=a(kt,(t=>F=t))}jt=[],Ct>1?jt.push("auto"):F.forEach((t=>{!t&&"horizontal"===Et||"match_parent"===(null==t?void 0:t.type)?jt.push("100%"):jt.push("max-content")})),_=at.getDerivedFromVars(rt.scroll_mode),R(),R=a(_,(t=>E=t));{const t={};let e={};zt=!1,(null==ot?void 0:ot.fakeElement)&&(e.fakeElement=!0),"horizontal"===Et?e.parentVAlign=Ft:e.parentHAlign=Ft,"paging"===E&&(zt=!0,e.scrollSnap="start",t["horizontal"===Et?"scroll-padding-left":"scroll-padding-top"]=Z(At/2)),1===Ct&&(e.parentLayoutOrientation=Et),Dt=wt(t,Dt),St=wt(e,St)}return b=at.getDerivedFromVars(rt.restrict_parent_scroll),et(),et=a(b,(t=>T=t)),w={padding:Vt,"grid-gap":$t},$={"grid-gap":bt,[y]:fe(jt)},x={orientation:Et,"scroll-snap":zt},k=at.getDerivedFromVars(rt.default_item),B(),B=a(k,(t=>C=t)),Mt=yt(C,Mt),B(),R(),U(),H(),G(),X(),K(),Q(),tt(),J(),et(),"\n\n"+(_t?"":`${M(Pt,"Outer").$$render(t,{cls:vt("gallery",ge,x),json:rt,origJson:it,templateContext:nt,layoutParams:ot,customPaddings:!0,customActions:"gallery",forceHeight:"vertical"===Et,forceWidth:"horizontal"===Et},{},{default:()=>`<div class="${j(ge.gallery__scroller,!0)+" "+j(T?"divkit-aa145":"",!0)}"${N("style",Y(Dt),0)}${N("this",st,0)}><div${N("class",ge["gallery__items-grid"],0)}${N("style",Y(w),0)}${N("this",lt,0)}>${S(d,((e,r)=>`<div${N("class",ge.gallery__items,0)}${N("style",Y($),0)}${N("this",ct[r],0)}>${S(e,(e=>`${M(Ze,"Unknown").$$render(t,{layoutParams:St,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===Et?`${ut&&l?`<div${N("class",ft||`${ge.gallery__arrow} ${ge.gallery__arrow_left}`,0)}>${ft?"":`<svg${N("class",ge["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${N("class",ge["gallery__arrow-icon-path"],0)} d="m10 16 8.3 8 1.03-1-4-6-.7-1 .7-1 4-6-1.03-1z"></path></svg>`}</div>`:""}\n ${dt&&l?`<div${N("class",ht||`${ge.gallery__arrow} ${ge.gallery__arrow_right}`,0)}>${ht?"":`<svg${N("class",ge["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${N("class",ge["gallery__arrow-icon-path"],0)} d="M22 16l-8.3 8-1.03-1 4-6 .7-1-.7-1-4-6 1.03-1 8.3 8z"></path></svg>`}</div>`:""}`:""}`})}`)})),ye=me,_e={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"},be=J(((t,e,n,i)=>{let o,s,l,c,d,p,g,f,h,m,y,b,w,$,x,k,C,E,F,A,V=r,D=r,z=r,P=r,I=r,O=r,J=r,T=r;var R;let{json:U={}}=e,{templateContext:W}=e,{origJson:H}=e,{layoutParams:G}=e;const X=v(L),K=X.genId("tabs");let tt,et,rt,nt=!1,it={};const ot=X.getJsonWithVars(U.selected_tab);let at,st,lt=ot&&Number(ot)||0,ct=12,ut="",dt="",pt="",gt="",ft="",yt="",_t="",bt="",$t="",xt="",kt=!1,Et=!1,Ft=lt,jt=[],Dt=[];async function zt(t,e=!1){if(Ft=lt,lt=t,kt||(kt=!0,et.style.height=Z(et.clientHeight),rt.style.transform=`translate3d(${100*-Ft}%,0,0)`),Et=!0,async function(t){await _(),rt.style.transform=`translate3d(${t}%,0,0)`}(100*-lt),function(t=!1){const e=t?Math.max(0,lt-1):Math.min(lt,Ft),r=t?Math.min(o.length-1,lt+1):Math.max(lt,Ft);jt=jt.map(((t,n)=>t||n>=e&&n<=r)),Dt=Dt.map(((t,n)=>n>=e&&n<=r))}(),async function(){await _();const t=document.getElementById(`${K}-panel-${lt}`);t&&(et.style.height=Z(t.offsetHeight))}(),Mt&&clearTimeout(Mt),Mt=window.setTimeout((()=>{Dt=o.map(((t,e)=>e===lt))}),400),St=-lt*et.clientWidth,e){await _();const t=tt.querySelector(`.${_e.tabs__item_selected}`);t&&t.focus()}}let St,Mt=null;!U.id||nt||(null==G?void 0:G.fakeElement)||X.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');zt(t)},setPreviousItem(t){let e=lt-1;e<0&&(e="ring"===t?o.length-1:lt),zt(e)},setNextItem(t){let e=lt+1;e>o.length-1&&(e="ring"===t?0:lt),zt(e)}}),u((()=>{U.id&&!(null==G?void 0:G.fakeElement)&&X.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!==H&&n.origJson(H),void 0===e.layoutParams&&n.layoutParams&&void 0!==G&&n.layoutParams(G),o=U.items||[],(null==o?void 0:o.length)&&Array.isArray(o)?nt=!1:(nt=!0,X.logError(q(new Error('Incorrect or empty "items" prop for div "tabs"')))),s=X.getDerivedFromVars(U.width),J(),J=a(s,(t=>F=t)),l=X.getDerivedFromVars(U.height),O(),O=a(l,(t=>E=t));{let t={};(null==G?void 0:G.fakeElement)&&(t.fakeElement=!0),"wrap_content"===(null==F?void 0:F.type)&&(t.parentHorizontalWrapContent=!0),E&&"wrap_content"!==E.type||(t.parentVerticalWrapContent=!0),it=wt(t,it)}if(!nt&&(lt<0||lt>=o.length)&&(X.logError(q(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:U.selected_tab,length:o.length}})),lt=lt<0?0:o.length-1),c=X.getDerivedFromVars(U.tab_title_style),I(),I=a(c,(t=>C=t)),d=C||{},ct=It(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};ut=mt(e,ut)}{const t=d.line_height;void 0!==t&&Vt(t)&&(dt=Z(t/ct*10))}{const t=d.letter_spacing;void 0!==t&&ht(t)&&(pt=Z(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]&&!ht(i[t]))return n;return Ct(t,e,r)}(d.corners_radius,t,ct,gt):ht(t)&&(gt=Z(t/ct*10))}return at=Jt(d.active_font_weight||d.font_weight,at),st=Jt(d.inactive_font_weight||d.font_weight,st),ft=Q(d.active_text_color,1,ft),yt=Q(d.inactive_text_color,1,yt),_t=Q(d.active_background_color,1,_t),bt=Q(d.inactive_background_color,1,bt),p=X.getDerivedFromVars(U.has_separator),P(),P=a(p,(t=>k=t)),g=X.getDerivedFromVars(U.separator_color),z(),z=a(g,(t=>x=t)),f=X.getDerivedFromVars(U.separator_paddings),D(),D=a(f,(t=>$=t)),k&&(x&&($t=Q(x,1,$t)),$&&(xt=mt($,xt))),h={background:$t,margin:xt},m=X.getDerivedFromVars(U.switch_tabs_by_content_swipe_enabled),V(),V=a(m,(t=>w=t)),y=void 0===w||Boolean(w),b=X.getDerivedFromVars(U.restrict_parent_scroll),T(),T=a(b,(t=>A=t)),nt||(jt=o.map(((t,e)=>e===lt)),Dt=o.map(((t,e)=>e===lt))),V(),D(),z(),P(),I(),O(),J(),T(),nt?"":`${M(Pt,"Outer").$$render(t,{cls:vt("tabs",_e,{}),json:U,origJson:H,templateContext:W,layoutParams:G,customActions:"tabs"},{},{default:()=>`<div class="${j(_e.tabs__list,!0)+" "+j(A?"divkit-aa145":"",!0)}" role="tablist"${B({"--divkit-tabs-font-size":Z(ct),"--divkit-tabs-paddings":ut,"--divkit-tabs-line-height":dt,"--divkit-tabs-letter-spacing":pt,"--divkit-tabs-active-font-weight":at||"","--divkit-tabs-inactive-font-weight":st||"","--divkit-tabs-active-text-color":ft,"--divkit-tabs-inactive-text-color":yt,"--divkit-tabs-active-background-color":_t,"--divkit-tabs-inactive-background-color":bt,"--divkit-tabs-border-radius":gt})}${N("this",tt,0)}>${S(o,((e,r)=>{let n=r===lt;return`\n\n ${M(At,"Actionable").$$render(t,{cls:vt("tabs__item",_e,{selected:n,actionable:Boolean(e.title_click_action)}),actions:!e.title_click_action||null!=G&&G.fakeElement?[]:[e.title_click_action],attrs:{id:`${K}-tab-${r}`,"aria-controls":`${K}-panel-${r}`,role:"tab",tabindex:!n||null!=G&&G.fakeElement?"-1":e.title_click_action?void 0:"0","aria-selected":n?"true":"false"},customAction:null!=G&&G.fakeElement?null:t=>function(t,e){return lt===e||(zt(e),!1)}(0,r)},{},{default:()=>`${j(e.title)}\n `})}`}))}</div>\n ${k?`<div${N("class",_e.tabs__separator,0)}${N("style",Y(h),0)}></div>`:""}\n <div class="${j(_e.tabs__panels,!0)+" "+j(A?"divkit-aa145":"",!0)}"${N("this",et,0)}><div${N("class",vt("tabs__swiper",_e,{inited:kt,animated:Et}),0)}${N("this",rt,0)}>${S(o,((e,r)=>`<div${N("class",vt("tabs__panel",_e,{visible:Dt[r]}),0)} role="tabpanel" id="${j(K,!0)+"-panel-"+j(r,!0)}" aria-labelledby="${j(K,!0)+"-tab-"+j(r,!0)}" style="${"left: "+j(100*r,!0)+"%"}">${jt[r]?`${M(Ze,"Unknown").$$render(t,{div:e.div,templateContext:W,layoutParams:it},{},{})}`:""}\n </div>`))}</div></div>`})}`})),we=be;function $e(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)}}$e([.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]),$e([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 xe=J(((t,e,r,n)=>{let i,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const c=v(L),p=v(pt);let g=new Map,f=new Set,h=!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;c.setRunning("stateChange",!0),new Set(f),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,C=e):c.logError(q(new Error("Cannot find state with id"),{additional:{stateId:t}})),await _()},getChild(t){if(m&&m.has(t))return m.get(t);c.logError(q(new Error("Missing state block with id"),{additional:{id:t}}))}}),d(pt,{registerInstance(t,e){m||(m=new Map),m.has(t)?c.logError(q(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){f.add(t)},unregisterChild(t){f.delete(t)}})):(h=!0,c.logError(q(new Error('Missing "id" prop for div "state"'))));let C=null;const E=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&&(f=new Set),i=o.states||[],(null==i?void 0:i.length)?h=!1:(h=!0,c.logError(q(new Error('Empty "states" prop for div "state"')))),function(t){F||(F=!0,t.length&&(E?(k=E,C=t.find((t=>t.state_id===k))||null,C||c.logError(q(new Error("Cannot find state for default_state_id"),{additional:{selectedId:k}}))):(C=t[0],k=C.state_id)))}(i),h?"":`${M(Pt,"Outer").$$render(t,{cls:"divkit-b8efc",json:o,origJson:s,templateContext:a,layoutParams:l},{},{default:()=>{var e;return`${null!==(e=C)&&void 0!==e&&e.div?`${M(Ze,"Unknown").$$render(t,{div:C.div,templateContext:a},{},{})}`:""}\n <div${N("class","divkit-adaae",0)} aria-hidden="true"${N("this",undefined,0)}>${S(y,(e=>"direction"in e?`<div${N("class","divkit-eb860",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${N("class","divkit-e08c6",0)}>${M(Ze,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`:`<div${N("class","divkit-eb860",0)}><div${N("class","divkit-e08c6",0)}>${M(Ze,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`))}</div>`}})}`})),ke={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f"},Ce=J(((t,e,n,i)=>{let o,s,l,c,d,p,g,f,h,m,y,_,b,w,$,x,k,C=r,E=r,F=r,A=r,V=r,D=r;var z,P,I,O,J,T,B;let{json:R={}}=e,{templateContext:U}=e,{origJson:W}=e,{layoutParams:H}=e;const G=v(L),K=G.genId("pager");let Q,tt=!1,et=0,rt=0,nt=!1,it="horizontal",ot="",at="",st="";function lt(t,e="smooth"){const r="horizontal"===it,n=Q.children[t],i=r?"offsetLeft":"offsetTop",o=r?"left":"top";Q.scroll({[o]:n[i],behavior:e}),et=t}he((function(){const t=function(){const t=Array.from(Q.children),e=Q.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,n=t.getBoundingClientRect(),"horizontal"===it?n.left>=r.left&&n.right<=r.right:n.top>=r.top&&n.bottom<=r.bottom;var r,n}));return-1!==r?r:et}();t!==et&&(et=t)}),50),R.id&&!(null==H?void 0:H.fakeElement)&&G.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');lt(t)},setPreviousItem(t){let e=et-1;e<0&&(e="ring"===t?o.length-1:et),lt(e)},setNextItem(t){let e=et+1;e>o.length-1&&(e="ring"===t?0:et),lt(e)}}),u((()=>{R.id&&!(null==H?void 0:H.fakeElement)&&G.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!==H&&n.layoutParams(H),(null===(z=R.items)||void 0===z?void 0:z.length)&&Array.isArray(R.items)?tt=!1:(tt=!0,G.logError(q(new Error('Incorrect or empty "items" prop for div "pager"')))),o=(!tt&&R.items||[]).map((t=>{let e=t,r=U;return({templateContext:r,json:e}=G.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=G.getDerivedFromVars(R.layout_mode),E(),E=a(s,(t=>b=t)),b?"percentage"!==b.type&&"fixed"!==b.type?(nt=!0,G.logError(q(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):nt=!1:(nt=!0,G.logError(q(new Error('Empty "layout_mode" prop for div "pager"')))),l=G.getDerivedFromVars(R.orientation),V(),V=a(l,(t=>x=t)),it=ie(x,it),c=G.getDerivedFromVars(R.item_spacing),A(),A=a(c,(t=>$=t));{const t=null==$?void 0:$.value;t&&ht(t)&&(ot=Z(t||0))}if(d=G.getDerivedFromVars(R.paddings),F(),F=a(d,(t=>w=t)),at=mt(w,at),p=G.getDerivedFromVars(R.restrict_parent_scroll),D(),D=a(p,(t=>k=t)),g="horizontal"===it?"grid-auto-columns":"grid-auto-rows","fixed"===(null==b?void 0:b.type)){const t=X("horizontal"===it?((null===(P=R.paddings)||void 0===P?void 0:P.left)||0)+((null===(I=R.paddings)||void 0===I?void 0:I.right)||0):((null===(O=R.paddings)||void 0===O?void 0:O.top)||0)+((null===(J=R.paddings)||void 0===J?void 0:J.bottom)||0)),e=null===(T=b.neighbour_page_width)||void 0===T?void 0:T.value;st=e?`calc(100% + ${t} - 2 * ${X(e)} - 2 * ${ot})`:"100%"}else if("percentage"===(null==b?void 0:b.type)){const t=null===(B=b.page_width)||void 0===B?void 0:B.value;st=`${Number(t)}%`}return f={"grid-gap":ot,padding:at,[g]:st},h={orientation:it},m=tt||nt,y=G.getStore("pagers"),C(),C=a(y,(t=>_=t)),function(t,e){const r=R.id;if(r){const o=new Map(_);n=y,_=o.set(r,{instId:K,size:t,currentItem:e,scrollToPagerItem:lt}),i=_,n.set(i)}var n,i}(o.length,et),function(t){var e;if(t===rt)return;rt=t;const r=G.getJsonWithVars(null===(e=o[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&G.execAnyActions(r)}(et),C(),E(),F(),A(),V(),D(),m?"":`${M(Pt,"Outer").$$render(t,{cls:vt("pager",ke,h),json:R,origJson:W,templateContext:U,layoutParams:H,customPaddings:!0},{},{default:()=>`<div class="${j(ke.pager__items,!0)+" "+j(k?"divkit-aa145":"",!0)}"${N("style",Y(f),0)}${N("this",Q,0)}>${S(o,(e=>`<div${N("class",ke.pager__item,0)}>${M(Ze,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson,layoutParams:null!=H&&H.fakeElement?{fakeElement:!0}:void 0},{},{})}\n </div>`))}</div>`})}`})),Ee=Ce,Fe={indicator:"divkit-d8e3f",indicator__scroller:"divkit-b5db0",indicator__items:"divkit-d5d94",indicator__item:"divkit-f6629",indicator__item_active:"divkit-b39cd"},Ae=J(((t,e,n,i)=>{let o,s,l,c,u,d,p,g,f,h,m,y,b=r,w=r,$=r,x=r,k=r,C=r;var E;let{json:F={}}=e,{templateContext:A}=e,{origJson:V}=e,{layoutParams:D}=e;const z=v(L);let P,I,O,J=5,T=10,R=10,U=5,W="#ffdc60",q=Q("#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!==D&&n.layoutParams(D),o=z.getDerivedFromVars(F.shape),C(),C=a(o,(t=>y=t)),y&&("rounded_rectangle"===y.type?(y.item_width&&(T=yt(y.item_width.value,T)),y.item_height&&(R=yt(y.item_height.value,R)),y.corner_radius&&(U=yt(y.corner_radius.value,U))):"circle"===y.type&&(J=yt(null===(E=y.radius)||void 0===E?void 0:E.value,J),T=R=U=2*J)),s=z.getDerivedFromVars(F.active_item_color),k(),k=a(s,(t=>m=t)),W=Q(m,1,W),l=z.getDerivedFromVars(F.inactive_item_color),x(),x=a(l,(t=>h=t)),q=Q(h,1,q),c=z.getDerivedFromVars(F.space_between_centers),$(),$=a(c,(t=>f=t)),f&&(H=yt(f.value,H)),u=z.getDerivedFromVars(F.active_item_size),w(),w=a(u,(t=>g=t)),G=It(g,G),d=z.getStore("pagers"),b(),b=a(d,(t=>p=t)),async function(t){if(F.pager_id&&t.has(F.pager_id)){O=t.get(F.pager_id),await _();const e=I.children[O.currentItem].offsetLeft;P.scroll({left:e-P.clientWidth/2,behavior:"smooth"})}}(p),b(),w(),$(),x(),k(),C(),`${M(Pt,"Outer").$$render(t,{cls:vt("indicator",Fe,{}),json:F,origJson:V,templateContext:A,layoutParams:D},{},{default:()=>`<div${N("class",Fe.indicator__scroller,0)}${N("this",P,0)}><div${N("class",Fe.indicator__items,0)} role="tablist"${B({margin:`0 ${Z((G-1)*T/2)}`,"--divkit-indicator-width":Z(T),"--divkit-indicator-height":Z(R),"--divkit-indicator-border-radius":Z(U),"--divkit-indicator-active-color":W,"--divkit-indicator-inactive-color":q,"--divkit-indicator-active-scale":G,"--divkit-indicator-margin":`0 ${Z((H-T)/2)}`})}${N("this",I,0)}>${O?`${S(Array(O.size),((t,e)=>{let r=e===O.currentItem;return`\n <div class="${j(vt("indicator__item",Fe,{active:r}),!0)+" "+j("divkit-bd259",!0)}" role="tab" id="${j(O.instId,!0)+"-tab-"+j(e,!0)}" aria-controls="${j(O.instId,!0)+"-panel-"+j(e,!0)}"${N("aria-selected",r?"true":"false",0)}${N("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),Ve=Ae,je={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 De(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&Q(t.text_color)||"#000",i=Ot(t.font_weight);if(Vt(t.font_size)&&"transparent"!==n){var o,a;const e={fontSize:Z(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 ze(t,e,r){return Math.max(e,Math.min(r,t))}const Se=-2147483648,Pe=Number.MAX_VALUE,Me=Number.MIN_VALUE,Ie="string",Oe="integer",Je="number",Ne="boolean",Te="color",Be="datetime";class Re{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 Ue={string:class extends Re{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends Re{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 Re{convertValue(t){if("number"!=typeof t||isNaN(t)||t>2147483647||t<Se||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 Re{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 Re{convertValue(t){if("string"!=typeof t||!tt(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends Re{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function We(t,e,r){if(!(e in Ue))throw new Error("Unsupported variable type");return new Ue[e](t,r)}function Le(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 qe=J(((t,e,n,i)=>{let o,s,l,c,u,d,p,g,f,h,m,y,_,b,w,$,x,k,C,E,F,A,V,D,z,P,I,O,J,T,R,U,W,H,G,Y,K=r,Q=r,tt=r,et=r,rt=r,nt=r,it=r,ot=r,at=r,st=r,lt=r,ct=r;var ut,dt,pt,gt;let{json:ft={}}=e,{templateContext:mt}=e,{origJson:yt}=e,{layoutParams:_t}=e;const bt={width:10,height:10,borderRadius:5,background:"#000"},wt=["rounded_rectangle","circle"],$t=["rounded_rectangle"],kt=v(L),Ct=v(Ft);let Et=0,At=100;const Vt=kt.getJsonWithVars(ft.thumb_value_variable),jt=kt.getJsonWithVars(ft.thumb_secondary_value_variable);H=a(Vt&&kt.getVariable(Vt,"integer")||We("temp","integer",0),(t=>W=t)),U=a(jt&&kt.getVariable(jt,"integer")||We("temp","integer",0),(t=>R=t));let Dt,zt,St,Mt=ze(W||0,Et,At),It=ze(R||0,Et,At),Ot=bt,Jt=Ot,Nt=bt,Tt=bt,Bt=null,Rt=null,Ut=St,Wt="",Lt="",qt=!1;he((function(){}),50),void 0===e.json&&n.json&&void 0!==ft&&n.json(ft),void 0===e.templateContext&&n.templateContext&&void 0!==mt&&n.templateContext(mt),void 0===e.origJson&&n.origJson&&void 0!==yt&&n.origJson(yt),void 0===e.layoutParams&&n.layoutParams&&void 0!==_t&&n.layoutParams(_t),o=kt.getDerivedFromVars(ft.min_value),ct(),ct=a(o,(t=>Y=t)),s=kt.getDerivedFromVars(ft.max_value),lt(),lt=a(s,(t=>G=t)),Et=xt(Y,Et),At=xt(G,At);{const t=ze(W||0,Et,At);t!==Mt&&(Mt=t)}{const t=ze(R||0,Et,At);t!==It&&(It=t)}l=kt.getDerivedFromVars(ft.thumb_style),st(),st=a(l,(t=>T=t)),Ot=Ht(T,wt,Ot),c=kt.getDerivedFromVars(ft.thumb_secondary_style),at(),at=a(c,(t=>J=t)),Jt=Ht(J,wt,Ot),u=kt.getDerivedFromVars(ft.track_inactive_style),ot(),ot=a(u,(t=>O=t)),Nt=Ht(O,$t,Nt),d=kt.getDerivedFromVars(ft.track_active_style),it(),it=a(d,(t=>I=t)),Tt=Ht(I,$t,Tt),p=kt.getDerivedFromVars(ft.tick_mark_active_style),nt(),nt=a(p,(t=>P=t));{let t=Ht(P,wt,bt);t!==bt&&(Bt=t)}Dt=Bt?jt?Le(Math.min(Mt,It),Math.max(Mt,It)+1,Et,At,!0):Le(Et,Mt,Et,At,!0):[],g=kt.getDerivedFromVars(ft.tick_mark_inactive_style),rt(),rt=a(g,(t=>z=t));{let t=Ht(z,wt,bt);t!==bt&&(Rt=t)}zt=Rt?jt?Le(Math.min(Mt,It),Math.max(Mt,It)+1,Et,At,!1):Le(Mt+1,At+1,Et,At,!0):[],f=kt.getDerivedFromVars(ft.thumb_text_style),et(),et=a(f,(t=>D=t)),St=De(D,St),h=kt.getDerivedFromVars(ft.thumb_secondary_text_style),tt(),tt=a(h,(t=>V=t)),Ut=De(V,St),m=kt.getDerivedFromVars(ft.accessibility),Q(),Q=a(m,(t=>A=t)),(null==A?void 0:A.description)?Wt=A.description:kt.logError(q(new Error('Missing accessibility "description" for slider'),{level:"warn"})),y=kt.getDerivedFromVars(ft.secondary_value_accessibility),K(),K=a(y,(t=>F=t)),(null==F?void 0:F.description)?Lt=F.description:jt&&kt.logError(q(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;Ct.hasAction()?(kt.logError(q(new Error('Cannot show "slider" inside component with action'))),t=!0):Ot===bt?(kt.logError(q(new Error('Missing "thumb_style" in slider'))),t=!0):Tt===bt?(kt.logError(q(new Error('Missing "track_active_style" in slider'))),t=!0):Nt===bt&&(kt.logError(q(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==qt&&(qt=t)}return _=Z(Math.max(...[Ot.width,Jt.width,0].filter(ht))),b=Z(Math.max(...[Ot.height,Jt.height,0].filter(ht))),w=(Mt-Et)/(At-Et),$=jt?(It-Et)/(At-Et):void 0,x=void 0!==$?Math.abs($-w):w,k=void 0!==$?Math.min($,w):0,C={"--divkit-slider-thumb-width":Z(Ot.width),"--divkit-slider-thumb-height":Z(Ot.height),"--divkit-slider-thumb-secondary-width":Z(Jt.width),"--divkit-slider-thumb-secondary-height":Z(Jt.height),"--divkit-slider-text-offset-x":(null===(ut=null==St?void 0:St.offset)||void 0===ut?void 0:ut.x)?X(St.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(dt=null==St?void 0:St.offset)||void 0===dt?void 0:dt.y)?X(St.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(pt=null==Ut?void 0:Ut.offset)||void 0===pt?void 0:pt.x)?X(Ut.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(gt=null==Ut?void 0:Ut.offset)||void 0===gt?void 0:gt.y)?X(Ut.offset.y):void 0,"--divkit-slider-tick-active-width":Bt?Z(Bt.width):void 0,"--divkit-slider-tick-active-height":Bt?Z(Bt.height):void 0,"--divkit-slider-tick-active-border-radius":Bt?Z(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?Z(Rt.width):void 0,"--divkit-slider-tick-inactive-height":Rt?Z(Rt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Rt?Z(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":$},E={},K(),Q(),tt(),et(),rt(),nt(),it(),ot(),at(),st(),U(),H(),lt(),ct(),"\n\n"+(qt?"":`${M(Pt,"Outer").$$render(t,{cls:vt("slider",je,E),style:C,customDescription:!0,customActions:"slider",json:ft,origJson:yt,templateContext:mt,layoutParams:_t},{},{default:()=>{var t,e,r,n,i,o;return`<div${N("class",je["slider__tracks-wrapper"],0)}><div${N("class",je["slider__tracks-inner"],0)}${N("this",undefined,0)}><div${N("class",je.slider__track,0)}${B({height:Z(Nt.height),"border-radius":Z(Nt.borderRadius),background:Nt.background,"box-shadow":Nt.boxShadow||""})}></div>\n <div${N("class",je["slider__active-track"],0)}${B({left:(100*k).toFixed(2)+"%",width:(100*x).toFixed(2)+"%",height:Z(Tt.height),"border-radius":Z(Tt.borderRadius),background:Tt.background,"box-shadow":Tt.boxShadow||""})}></div>\n ${S(Dt,(t=>`<div class="${j(je.slider__tick,!0)+" "+j(je.slider__tick_active,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n ${S(zt,(t=>`<div class="${j(je.slider__tick,!0)+" "+j(je.slider__tick_inactive,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n <div${N("class",je.slider__thumb,0)}${B({"border-radius":Z(Ot.borderRadius),background:Ot.background,"box-shadow":Ot.boxShadow||""})}>${St?`<div${N("class",je["slider__thumb-text"],0)}><div${N("class",je["slider__thumb-text-inner"],0)}${B({"font-size":(null===(t=St)||void 0===t?void 0:t.fontSize)||"1em","font-weight":(null===(e=St)||void 0===e?void 0:e.fontWeight)||"",color:(null===(r=St)||void 0===r?void 0:r.textColor)||"#000"})}>${j(Mt)}</div></div>`:""}</div>\n ${jt?`<div class="${j(je.slider__thumb,!0)+" "+j(je.slider__thumb_secondary,!0)}"${B({"border-radius":Z(Jt.borderRadius),background:Jt.background,"box-shadow":Jt.boxShadow||""})}>${Ut?`<div class="${j(je["slider__thumb-text"],!0)+" "+j(je["slider__thumb-text_secondary"],!0)}"><div${N("class",je["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(It)}</div></div>`:""}</div>`:""}\n <input type="range"${N("class",je.slider__input,0)}${N("min",Et,0)}${N("max",At,0)} step="1"${N("value",Mt,0)}${N("aria-label",Wt,0)}>\n ${jt?`<input type="range"${N("class",`${je.slider__input} ${je.slider__input_secondary}`,0)}${N("min",Et,0)}${N("max",At,0)} step="1"${N("value",It,0)}${N("aria-label",Lt,0)}>`:""}</div></div>`}})}`)})),He={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"},Ge={text:Lt,container:re,separator:oe,image:se,gif:se,grid:pe,gallery:ye,tabs:we,state:xe,pager:Ee,indicator:Ve,slider:qe,input:J(((t,e,n,i)=>{let o,s,l,c,u,d,p,g,f,h,m,y,_,b,w,$,x,k,C,E,F,A,V,D,z,S,P,I,O,J,T,B,R=r,U=r,{json:W={}}=e,{templateContext:H}=e,{origJson:G}=e,{layoutParams:Y}=e;const K=v(L);let tt;const et=K.getJsonWithVars(W.text_variable);let rt=!1;et||(rt=!0,K.logError(q(new Error('Missing "text_variable" in "input"')))),J=a(et&&K.getVariable(et,"string")||We("temp","string",""),(t=>O=t));let nt="";I=a(K.getDerivedFromVars(W.hint_text),(t=>P=t)),S=a(K.getDerivedFromVars(W.hint_color),(t=>z=t));let it="";D=a(K.getDerivedFromVars(W.font_size),(t=>V=t));let ot,at,st=12;A=a(K.getDerivedFromVars(W.font_weight),(t=>F=t)),E=a(K.getDerivedFromVars(W.line_height),(t=>C=t)),k=a(K.getDerivedFromVars(W.letter_spacing),(t=>x=t));let lt="";$=a(K.getDerivedFromVars(W.text_color),(t=>w=t));let ct="#000";b=a(K.getDerivedFromVars(W.highlight_color),(t=>_=t));let ut="";y=a(K.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 pt="multi_line_text",gt="text";h=a(K.getDerivedFromVars(W.max_visible_lines),(t=>f=t));let ht="",mt="";B=a(K.getDerivedFromVars(W.select_all_on_focus),(t=>T=t)),void 0===e.json&&n.json&&void 0!==W&&n.json(W),void 0===e.templateContext&&n.templateContext&&void 0!==H&&n.templateContext(H),void 0===e.origJson&&n.origJson&&void 0!==G&&n.origJson(G),void 0===e.layoutParams&&n.layoutParams&&void 0!==Y&&n.layoutParams(Y),nt=O,o=P,it=Q(z,1,it),st=It(V,st),ot=Jt(F,ot);{const t=C;Vt(t)&&(at=t/st)}return ft(x)&&(lt=Z(x/st*10)),ct=Q(w,1,ct),ut=Q(_,1,ut),m&&m in dt&&(gt=dt[m],pt=m),s="multi_line_text"===pt,l=K.getDerivedFromVars(W.paddings),U(),U=a(l,(t=>g=t)),Vt(f)&&(ht=`calc(${f*(at||1.25)+"em"} + ${X(yt(null==g?void 0:g.top,0)+yt(null==g?void 0:g.bottom,0))})`),c=K.getDerivedFromVars(W.accessibility),R(),R=a(c,(t=>p=t)),(null==p?void 0:p.description)?mt=p.description:K.logError(q(new Error('Missing accessibility "description" for input'),{level:"warn"})),u={"highlight-color":Boolean(ut),"vertical-overflow":!1,multiline:s},d={"--divkit-input-hint-color":it,"--divkit-input-highlight-color":ut,"font-size":Z(st),"font-weight":ot,"line-height":at,"letter-spacing":lt,color:ct,"max-height":ht},R(),U(),h(),y(),b(),$(),k(),E(),A(),D(),S(),I(),J(),B(),rt?"":`${M(Pt,"Outer").$$render(t,{cls:vt("input",He,u),style:d,customDescription:!0,customActions:"input",json:W,origJson:G,templateContext:H,layoutParams:Y},{},{default:()=>`<span${N("class",He.input__wrapper,0)}><span${N("class",He.input__holder,0)} aria-hidden="true"${N("this",undefined,0)}>\n ${j(nt)}${nt.endsWith("\n")||!nt?"​":""}</span>\n ${s?`<textarea${N("class",He.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",mt,0)}${N("placeholder",o,0)}${N("this",tt,0)}>${j(nt,!0)}</textarea>`:`<input${N("type",gt,0)}${N("class",He.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",mt,0)}${N("placeholder",o,0)}${N("value",nt,0)}${N("this",tt,0)}>`}</span>`})}`}))},Ye=J(((t,e,r,n)=>{let{div:i}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=v(L);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&&Ge[c.type]||void 0,!d&&(({templateContext:u,json:c}=l.processTemplate(c,u)),d=c&&Ge[c.type]||void 0,!d)){let t;t=(null==c?void 0:c.type)&&l.hasTemplate(c.type)?"Recursive template":"Unknown component",l.logError(q(new Error(t),{additional:{component:(null==c?void 0:c.type)||"<missing>"}}))}return d?`${M(d||P,"svelte:component").$$render(t,{json:c,templateContext:u,layoutParams:s,origJson:a||i},{},{})}`:""})),Ze=Ye,Xe=J(((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${N("class","divkit-dc22b",0)} aria-hidden="true"><defs>${S([...Object.keys(i)],(t=>{let[e,r]=t.split(":");return`\n <filter${N("id",i[t],0)}><feFlood${N("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${N("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"${N("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function Ke(t,e,r,n){const i=r[t.type];if(!i)return n(q(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(q(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 Qe(){}function tr(t){return{subscribe:e=>(e(t),Qe)}}function er(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function rr(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function nr(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 ir(t){var e=parseInt(t,10);if(e>2147483647||e<Se)throw new Error(`Value ${t} can't be converted to Integer type.`);return e}function or(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function ar(t,e,r,n){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,ar.prototype),i.expected=e,i.found=r,i.location=n,i.name="SyntaxError",i}function sr(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function lr(t,e){var r,n={},i=(e=void 0!==e?e:{}).grammarSource,o={start:Vt,JsonStringContents:function(){var t,e,r;for(t=ht,e=[],r=jt();r!==n;)e.push(r),r=jt();return mt=t,e=ft(e)}},a=Vt,s="@{",l="}",c="@{}",u="\\",d="||",v="&&",p="==",g="!=",f=">=",h="<=",m="+",y="-",_="true",b="false",w=/^[^}]/,$=/^[^'}]/,x=/^[0-9]/,k=/^[a-zA-Z_0-9.]/,C=/^[a-zA-Z_]/,E=/^[ \t\r\n]/,F=xt("@{",!1),A=xt("}",!1),V=xt("@{}",!1),j=xt("\\",!1),D={type:"any"},z=kt(["}"],!0,!1),S=xt("?",!1),P=xt(":",!1),M=xt("||",!1),I=xt("&&",!1),O=xt("==",!1),J=xt("!=",!1),N=xt(">=",!1),T=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),Y=xt("(",!1),Z=xt(")",!1),X=xt(",",!1),K=Ct("string"),Q=xt("'",!1),tt=kt(["'","}"],!0,!1),et=Ct("integer"),rt=kt([["0","9"]],!1,!1),nt=Ct("number"),it=xt(".",!1),ot=xt("e",!1),at=xt("E",!1),st=Ct("boolean"),lt=xt("true",!1),ct=xt("false",!1),ut=kt([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),dt=Ct("identifier"),vt=kt([["a","z"],["A","Z"],"_"],!1,!1),pt=Ct("whitespace"),gt=kt([" ","\t","\r","\n"],!1,!1),ft=function(t){return nr(t)},ht=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,ht)}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 Ct(t){return{type:"other",description:t}}function Et(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=Et(t),n=Et(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){ht<_t||(ht>_t&&(_t=ht,bt=[]),bt.push(t))}function Vt(){var t,e;return t=ht,Ut(),(e=Dt())!==n?(Ut(),mt=t,t=e):(ht=t,t=n),t}function jt(){var e,r,i,o,a;if(e=ht,t.substr(ht,2)===s?(r=s,ht+=2):(r=n,0===wt&&At(F)),r!==n?(i=Ut(),(o=Dt())!==n?(Ut(),125===t.charCodeAt(ht)?(a=l,ht++):(a=n,0===wt&&At(A)),a!==n?(mt=e,e=o):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,t.substr(ht,3)===c?(r=c,ht+=3):(r=n,0===wt&&At(V)),r!==n&&(mt=e,r=""),(e=r)===n&&(e=ht,r=ht,wt++,92===t.charCodeAt(ht)?(i=u,ht++):(i=n,0===wt&&At(j)),i===n&&(t.substr(ht,2)===s?(i=s,ht+=2):(i=n,0===wt&&At(F))),wt--,i===n?r=void 0:(ht=r,r=n),r!==n?(t.length>ht?(i=t.charAt(ht),ht++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=$t()):(ht=e,e=n)):(ht=e,e=n),e===n))){if(e=ht,t.substr(ht,2)===s?(r=s,ht+=2):(r=n,0===wt&&At(F)),r!==n){if(i=[],w.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(z)),o!==n)for(;o!==n;)i.push(o),w.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(z));else i=n;i!==n?(125===t.charCodeAt(ht)?(o=l,ht++):(o=n,0===wt&&At(A)),o!==n?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ht=e,e=n)):(ht=e,e=n)}else ht=e,e=n;e===n&&(e=ht,t.substr(ht,2)===s?(r=s,ht+=2):(r=n,0===wt&&At(F)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===n&&(e=ht,92===t.charCodeAt(ht)?(r=u,ht++):(r=n,0===wt&&At(j)),r!==n?(t.substr(ht,2)===s?(i=s,ht+=2):(i=n,0===wt&&At(F)),i!==n?(mt=e,e=i):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,92===t.charCodeAt(ht)?(r=u,ht++):(r=n,0===wt&&At(j)),r!==n?(t.length>ht?(i=t.charAt(ht),ht++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=or(i)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,92===t.charCodeAt(ht)?(r=u,ht++):(r=n,0===wt&&At(j)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Dt(){var e,r,i,o,a,s;return e=ht,(r=zt())!==n?(Ut(),63===t.charCodeAt(ht)?(i="?",ht++):(i=n,0===wt&&At(S)),i!==n?(Ut(),(o=Dt())!==n?(Ut(),58===t.charCodeAt(ht)?(a=":",ht++):(a=n,0===wt&&At(P)),a!==n?(Ut(),(s=Dt())!==n?(mt=e,e={type:"ConditionalExpression",test:r,consequent:o,alternate:s}):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=zt()),e}function zt(){var e,r,i,o,a,s,l,c;if(e=ht,(r=St())!==n){for(i=[],o=ht,a=Ut(),t.substr(ht,2)===d?(s=d,ht+=2):(s=n,0===wt&&At(M)),s!==n?(l=Ut(),(c=St())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),t.substr(ht,2)===d?(s=d,ht+=2):(s=n,0===wt&&At(M)),s!==n?(l=Ut(),(c=St())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=rr(r,i)}else ht=e,e=n;return e}function St(){var e,r,i,o,a,s,l,c;if(e=ht,(r=Pt())!==n){for(i=[],o=ht,a=Ut(),t.substr(ht,2)===v?(s=v,ht+=2):(s=n,0===wt&&At(I)),s!==n?(l=Ut(),(c=Pt())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),t.substr(ht,2)===v?(s=v,ht+=2):(s=n,0===wt&&At(I)),s!==n?(l=Ut(),(c=Pt())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=rr(r,i)}else ht=e,e=n;return e}function Pt(){var e,r,i,o,a,s,l,c;if(e=ht,(r=Mt())!==n){for(i=[],o=ht,a=Ut(),t.substr(ht,2)===p?(s=p,ht+=2):(s=n,0===wt&&At(O)),s===n&&(t.substr(ht,2)===g?(s=g,ht+=2):(s=n,0===wt&&At(J))),s!==n?(l=Ut(),(c=Mt())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),t.substr(ht,2)===p?(s=p,ht+=2):(s=n,0===wt&&At(O)),s===n&&(t.substr(ht,2)===g?(s=g,ht+=2):(s=n,0===wt&&At(J))),s!==n?(l=Ut(),(c=Mt())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=er(r,i)}else ht=e,e=n;return e}function Mt(){var e,r,i,o,a,s,l,c;if(e=ht,(r=It())!==n){for(i=[],o=ht,a=Ut(),t.substr(ht,2)===f?(s=f,ht+=2):(s=n,0===wt&&At(N)),s===n&&(62===t.charCodeAt(ht)?(s=">",ht++):(s=n,0===wt&&At(T)),s===n&&(t.substr(ht,2)===h?(s=h,ht+=2):(s=n,0===wt&&At(B)),s===n&&(60===t.charCodeAt(ht)?(s="<",ht++):(s=n,0===wt&&At(R))))),s!==n?(l=Ut(),(c=It())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),t.substr(ht,2)===f?(s=f,ht+=2):(s=n,0===wt&&At(N)),s===n&&(62===t.charCodeAt(ht)?(s=">",ht++):(s=n,0===wt&&At(T)),s===n&&(t.substr(ht,2)===h?(s=h,ht+=2):(s=n,0===wt&&At(B)),s===n&&(60===t.charCodeAt(ht)?(s="<",ht++):(s=n,0===wt&&At(R))))),s!==n?(l=Ut(),(c=It())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=er(r,i)}else ht=e,e=n;return e}function It(){var e,r,i,o,a,s,l,c;if(e=ht,(r=Ot())!==n){for(i=[],o=ht,a=Ut(),43===t.charCodeAt(ht)?(s=m,ht++):(s=n,0===wt&&At(U)),s===n&&(45===t.charCodeAt(ht)?(s=y,ht++):(s=n,0===wt&&At(W))),s!==n?(l=Ut(),(c=Ot())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),43===t.charCodeAt(ht)?(s=m,ht++):(s=n,0===wt&&At(U)),s===n&&(45===t.charCodeAt(ht)?(s=y,ht++):(s=n,0===wt&&At(W))),s!==n?(l=Ut(),(c=Ot())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=er(r,i)}else ht=e,e=n;return e}function Ot(){var e,r,i,o,a,s,l,c;if(e=ht,(r=Jt())!==n){for(i=[],o=ht,a=Ut(),47===t.charCodeAt(ht)?(s="/",ht++):(s=n,0===wt&&At(L)),s===n&&(42===t.charCodeAt(ht)?(s="*",ht++):(s=n,0===wt&&At(q)),s===n&&(37===t.charCodeAt(ht)?(s="%",ht++):(s=n,0===wt&&At(H)))),s!==n?(l=Ut(),(c=Jt())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,a=Ut(),47===t.charCodeAt(ht)?(s="/",ht++):(s=n,0===wt&&At(L)),s===n&&(42===t.charCodeAt(ht)?(s="*",ht++):(s=n,0===wt&&At(q)),s===n&&(37===t.charCodeAt(ht)?(s="%",ht++):(s=n,0===wt&&At(H)))),s!==n?(l=Ut(),(c=Jt())!==n?o=a=[a,s,l,c]:(ht=o,o=n)):(ht=o,o=n);mt=e,e=er(r,i)}else ht=e,e=n;return e}function Jt(){var e,r,i;return(e=Bt())===n&&(e=Tt())===n&&(e=ht,33===t.charCodeAt(ht)?(r="!",ht++):(r=n,0===wt&&At(G)),r===n&&(43===t.charCodeAt(ht)?(r=m,ht++):(r=n,0===wt&&At(U)),r===n&&(45===t.charCodeAt(ht)?(r=y,ht++):(r=n,0===wt&&At(W)))),r!==n?(Ut(),(i=Jt())!==n?(mt=e,e={type:"UnaryExpression",operator:r,argument:i}):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=function(){var e,r,i,o,a;return e=ht,(r=Rt())!==n?(Ut(),40===t.charCodeAt(ht)?(i="(",ht++):(i=n,0===wt&&At(Y)),i!==n?(Ut(),o=function(){var e,r,i,o,a,s,l;if(e=ht,(r=Dt())!==n){for(i=[],o=ht,Ut(),44===t.charCodeAt(ht)?(a=",",ht++):(a=n,0===wt&&At(X)),a!==n?(Ut(),(s=Dt())!==n?o=s:(ht=o,o=n)):(ht=o,o=n);o!==n;)i.push(o),o=ht,Ut(),44===t.charCodeAt(ht)?(a=",",ht++):(a=n,0===wt&&At(X)),a!==n?(Ut(),(s=Dt())!==n?o=s:(ht=o,o=n)):(ht=o,o=n);mt=e,l=i,e=[r,...l]}else ht=e,e=n;return e===n&&(e=Ut()),e}(),o!==n?(Ut(),41===t.charCodeAt(ht)?(a=")",ht++):(a=n,0===wt&&At(Z)),a!==n?(mt=e,e={type:"CallExpression",callee:r,arguments:o}):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,(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=ht,39===t.charCodeAt(ht)?(r="'",ht++):(r=n,0===wt&&At(Q)),r!==n?(i=function(){var t,e,r;for(t=ht,e=[],r=Nt();r!==n;)e.push(r),r=Nt();return mt=t,e=nr(e)}(),39===t.charCodeAt(ht)?(o="'",ht++):(o=n,0===wt&&At(Q)),o!==n?(mt=e,e=i):(ht=e,e=n)):(ht=e,e=n),wt--,e===n&&(r=n,0===wt&&At(K)),e}(),e===n&&(e=Bt())===n&&(e=Tt())===n&&(e=function(){var e,r;return wt++,e=ht,t.substr(ht,4)===_?(r=_,ht+=4):(r=n,0===wt&&At(lt)),r!==n&&(mt=e,r={type:"BooleanLiteral",value:!0}),(e=r)===n&&(e=ht,t.substr(ht,5)===b?(r=b,ht+=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=ht,40===t.charCodeAt(ht)?(r="(",ht++):(r=n,0===wt&&At(Y)),r!==n&&(i=Dt())!==n?(41===t.charCodeAt(ht)?(o=")",ht++):(o=n,0===wt&&At(Z)),o!==n?(mt=e,e=i):(ht=e,e=n)):(ht=e,e=n))),e}())),e}())),e}function Nt(){var e,r,i,o,a;if(e=ht,t.substr(ht,2)===s?(r=s,ht+=2):(r=n,0===wt&&At(F)),r!==n?(i=Ut(),(o=Dt())!==n?(Ut(),125===t.charCodeAt(ht)?(a=l,ht++):(a=n,0===wt&&At(A)),a!==n?(mt=e,e=o):(ht=e,e=n)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,t.substr(ht,3)===c?(r=c,ht+=3):(r=n,0===wt&&At(V)),r!==n&&(mt=e,r=""),(e=r)===n&&(e=ht,r=ht,wt++,92===t.charCodeAt(ht)?(i=u,ht++):(i=n,0===wt&&At(j)),i===n&&(39===t.charCodeAt(ht)?(i="'",ht++):(i=n,0===wt&&At(Q)),i===n&&(t.substr(ht,2)===s?(i=s,ht+=2):(i=n,0===wt&&At(F)))),wt--,i===n?r=void 0:(ht=r,r=n),r!==n?(t.length>ht?(i=t.charAt(ht),ht++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=$t()):(ht=e,e=n)):(ht=e,e=n),e===n))){if(e=ht,t.substr(ht,2)===s?(r=s,ht+=2):(r=n,0===wt&&At(F)),r!==n){if(i=[],$.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(tt)),o!==n)for(;o!==n;)i.push(o),$.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(tt));else i=n;i!==n?(125===t.charCodeAt(ht)?(o=l,ht++):(o=n,0===wt&&At(A)),o!==n?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ht=e,e=n)):(ht=e,e=n)}else ht=e,e=n;e===n&&(e=ht,t.substr(ht,2)===s?(r=s,ht+=2):(r=n,0===wt&&At(F)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===n&&(e=ht,92===t.charCodeAt(ht)?(r=u,ht++):(r=n,0===wt&&At(j)),r!==n?(t.substr(ht,2)===s?(i=s,ht+=2):(i=n,0===wt&&At(F)),i!==n?(mt=e,e=i):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,92===t.charCodeAt(ht)?(r=u,ht++):(r=n,0===wt&&At(j)),r!==n?(t.length>ht?(i=t.charAt(ht),ht++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=or(i)):(ht=e,e=n)):(ht=e,e=n),e===n&&(e=ht,92===t.charCodeAt(ht)?(r=u,ht++):(r=n,0===wt&&At(j)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Tt(){var e,r,i,o;if(wt++,e=ht,45===t.charCodeAt(ht)?(r=y,ht++):(r=n,0===wt&&At(W)),r===n&&(r=null),i=[],x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt)),o!==n)for(;o!==n;)i.push(o),x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt));else i=n;return i!==n?(mt=e,e={type:"IntegerLiteral",value:ir($t())}):(ht=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=ht,45===t.charCodeAt(ht)?(r=y,ht++):(r=n,0===wt&&At(W)),r===n&&(r=null),i=[],x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt));o!==n;)i.push(o),x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt));if(46===t.charCodeAt(ht)?(o=".",ht++):(o=n,0===wt&&At(it)),o!==n){if(a=[],x.test(t.charAt(ht))?(s=t.charAt(ht),ht++):(s=n,0===wt&&At(rt)),s!==n)for(;s!==n;)a.push(s),x.test(t.charAt(ht))?(s=t.charAt(ht),ht++):(s=n,0===wt&&At(rt));else a=n;if(a!==n){if(s=ht,101===t.charCodeAt(ht)?(l="e",ht++):(l=n,0===wt&&At(ot)),l===n&&(69===t.charCodeAt(ht)?(l="E",ht++):(l=n,0===wt&&At(at))),l!==n){if(43===t.charCodeAt(ht)?(c=m,ht++):(c=n,0===wt&&At(U)),c===n&&(45===t.charCodeAt(ht)?(c=y,ht++):(c=n,0===wt&&At(W))),c===n&&(c=null),u=[],x.test(t.charAt(ht))?(d=t.charAt(ht),ht++):(d=n,0===wt&&At(rt)),d!==n)for(;d!==n;)u.push(d),x.test(t.charAt(ht))?(d=t.charAt(ht),ht++):(d=n,0===wt&&At(rt));else u=n;u!==n?s=l=[l,c,u]:(ht=s,s=n)}else ht=s,s=n;s===n&&(s=null),mt=e,e={type:"NumberLiteral",value:parseFloat($t())}}else ht=e,e=n}else ht=e,e=n;if(e===n){if(e=ht,45===t.charCodeAt(ht)?(r=y,ht++):(r=n,0===wt&&At(W)),r===n&&(r=null),i=[],x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt)),o!==n)for(;o!==n;)i.push(o),x.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(rt));else i=n;if(i!==n)if(101===t.charCodeAt(ht)?(o="e",ht++):(o=n,0===wt&&At(ot)),o===n&&(69===t.charCodeAt(ht)?(o="E",ht++):(o=n,0===wt&&At(at))),o!==n){if(43===t.charCodeAt(ht)?(a=m,ht++):(a=n,0===wt&&At(U)),a===n&&(45===t.charCodeAt(ht)?(a=y,ht++):(a=n,0===wt&&At(W))),a===n&&(a=null),s=[],x.test(t.charAt(ht))?(l=t.charAt(ht),ht++):(l=n,0===wt&&At(rt)),l!==n)for(;l!==n;)s.push(l),x.test(t.charAt(ht))?(l=t.charAt(ht),ht++):(l=n,0===wt&&At(rt));else s=n;s!==n?(mt=e,e={type:"NumberLiteral",value:parseFloat($t())}):(ht=e,e=n)}else ht=e,e=n;else ht=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=ht,r=ht,wt++,i=function(){var e,r,i,o;return e=ht,t.substr(ht,4)===_?(r=_,ht+=4):(r=n,0===wt&&At(lt)),r===n&&(t.substr(ht,5)===b?(r=b,ht+=5):(r=n,0===wt&&At(ct))),r!==n?(i=ht,wt++,k.test(t.charAt(ht))?(o=t.charAt(ht),ht++):(o=n,0===wt&&At(ut)),wt--,o===n?i=void 0:(ht=i,i=n),i!==n?e=r=[r,i]:(ht=e,e=n)):(ht=e,e=n),e}(),wt--,i===n?r=void 0:(ht=r,r=n),r!==n)if(C.test(t.charAt(ht))?(i=t.charAt(ht),ht++):(i=n,0===wt&&At(vt)),i!==n){for(o=[],k.test(t.charAt(ht))?(a=t.charAt(ht),ht++):(a=n,0===wt&&At(ut));a!==n;)o.push(a),k.test(t.charAt(ht))?(a=t.charAt(ht),ht++):(a=n,0===wt&&At(ut));mt=e,e={type:"Identifier",name:$t()}}else ht=e,e=n;else ht=e,e=n;return wt--,e===n&&(r=n,0===wt&&At(dt)),e}function Ut(){var e,r;for(wt++,e=[],E.test(t.charAt(ht))?(r=t.charAt(ht),ht++):(r=n,0===wt&&At(gt));r!==n;)e.push(r),E.test(t.charAt(ht))?(r=t.charAt(ht),ht++):(r=n,0===wt&&At(gt));return wt--,r=n,0===wt&&At(pt),e}if((r=a())!==n&&ht===t.length)return r;throw r!==n&&ht<t.length&&At({type:"end"}),function(t,e,r){return new ar(ar.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}(ar,Error),ar.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=sr("",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+" | "+sr("",i.column-1," ")+sr("",c,"^")}else e+="\n at "+o}return e},ar.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 cr=new Map,ur=new Map;function dr(t,e,r){const n={args:e,cb:r},i=cr.get(t)||[];cr.has(t)||cr.set(t,i),i.push(n);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");ur.set(o,n)}function vr(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 pr(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=>{pr(t,e)}));break;case"BinaryExpression":case"LogicalExpression":pr(t.left,e),pr(t.right,e);break;case"UnaryExpression":pr(t.argument,e);break;case"ConditionalExpression":pr(t.test,e),pr(t.consequent,e),pr(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{pr(t,e)}))}}function gr(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function fr(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function hr(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 fr(t.value);if("color"===t.type)return Cr(kr(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function mr(t){let e=hr(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function yr(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}const _r=new Int32Array(1);function br(t){return _r[0]=t,_r[0]}function wr(t){if(t<Se||t>2147483647)throw new Error("Integer overflow.")}function $r(t){const e=[];return pr(t,{Variable(t){e.push(t.id.name)}}),e}function xr(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function kr(t){const e=tt(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function Cr(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 K(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function Er(t){return{type:Ie,value:hr(t)}}function Fr(t){const e=Number(t.value);if(isNaN(e)||!Number.isFinite(e))throw new Error("Unable to convert value to Number.");return{type:Je,value:e}}function Ar(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value/e.value;return t.type===Oe&&(r=br(r)),{type:t.type,value:r}}function Vr(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value%e.value;return t.type===Oe&&(r=br(r)),{type:t.type,value:r}}function jr(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e*=t[r].value,t[0].type===Oe&&(e=br(e));return{type:t[0].type,value:e}}function Dr(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e-=t[r].value,t[0].type===Oe&&(e=br(e));return{type:t.length?t[0].type:Oe,value:e}}function zr(...t){let e=0;for(let r=0;r<t.length;++r)e+=t[r].value,t[0].type===Oe&&(e=br(e));return{type:t.length?t[0].type:Oe,value:e}}function Sr(t){const e=Math.abs(t.value);return t.type===Oe&&wr(e),{type:t.type,value:e}}function Pr(...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 Mr(...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 Ir(t){return{type:t.type,value:Math.sign(t.value)}}function Or(t,e){let r;if(0===e.value&&t.type===Oe)r=t.value;else if(0===t.value&&t.type===Oe)r=0;else{let n=Math.sign(e.value);t.type===Je&&0===n&&(n=Object.is(n,0)?1:-1),r=Math.abs(t.value)*n}return t.type===Oe&&wr(r),{type:t.type,value:r}}function Jr(t){return e=>{const r=kr(e.value);return{type:Je,value:r[t]/255}}}function Nr(t){return(e,r)=>{const n=kr(e.value);return n[t]=255*r.value,{type:Te,value:Cr(n)}}}const Tr=Jr("a"),Br=Jr("r"),Rr=Jr("g"),Ur=Jr("b"),Wr=Nr("a"),Lr=Nr("r"),qr=Nr("g"),Hr=Nr("b");function Gr(t){return t.map(mr).join(", ")}dr("toString",[Oe],Er),dr("toString",[Je],Er),dr("toString",[Ne],Er),dr("toString",[Te],Er),dr("toString",["url"],Er),dr("toNumber",[Oe],Fr),dr("toNumber",[Ie],Fr),dr("toInteger",[Je],(function(t){if(t.value>2147483647||t.value<Se)throw new Error("Unable to convert value to Integer.");const e=t.value-t.value%1;return{type:Oe,value:e}})),dr("toInteger",[Ie],(function(t){const e=Number(t.value);if(isNaN(e)||e%1!=0||e>2147483647||e<Se)throw new Error("Unable to convert value to Integer.");return{type:Oe,value:e}})),dr("toInteger",[Ne],(function(t){return{type:Oe,value:t.value?1:0}})),dr("toBoolean",[Oe],(function(t){if(1!==t.value&&0!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Ne,value:t.value}})),dr("toBoolean",[Ie],(function(t){if("true"!==t.value&&"false"!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Ne,value:"true"===t.value?1:0}})),dr("encodeUri",[Ie],(function(t){try{return{type:Ie,value:encodeURIComponent(t.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),dr("decodeUri",[Ie],(function(t){try{return{type:Ie,value:decodeURIComponent(t.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),dr("parseUnixTime",[Oe],(function(t){return{type:Be,value:new Date(1e3*t.value)}})),dr("nowLocal",[],(function(){return{type:Be,value:new Date}})),dr("addMillis",[Be,Oe],(function(t,e){return{type:Be,value:new Date(t.value.getTime()+e.value)}})),dr("setYear",[Be,Oe],(function(t,e){const r=new Date(t.value);return r.setFullYear(e.value),{type:Be,value:r}})),dr("setMonth",[Be,Oe],(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:Be,value:r}})),dr("setDay",[Be,Oe],(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 ${hr(t)}.`);return r.setDate(-1===e.value?0:e.value),{type:Be,value:r}})),dr("setHours",[Be,Oe],(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:Be,value:r}})),dr("setMinutes",[Be,Oe],(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:Be,value:r}})),dr("setSeconds",[Be,Oe],(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:Be,value:r}})),dr("setMillis",[Be,Oe],(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:Be,value:r}})),dr("len",[Ie],(function(t){return{type:Oe,value:t.value.length}})),dr("contains",[Ie,Ie],(function(t,e){return{type:Ne,value:t.value.includes(e.value)?1:0}})),dr("substring",[Ie,Oe,Oe],(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:Ie,value:t.value.substring(e.value,r.value)}})),dr("replaceAll",[Ie,Ie,Ie],(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:Ie,value:n}})),dr("index",[Ie,Ie],(function(t,e){return{type:Oe,value:t.value.indexOf(e.value)}})),dr("lastIndex",[Ie,Ie],(function(t,e){return{type:Oe,value:t.value.lastIndexOf(e.value)}})),dr("trim",[Ie],(function(t){return{type:Ie,value:t.value.trim()}})),dr("trimLeft",[Ie],(function(t){return{type:Ie,value:t.value.replace(/^\s+/,"")}})),dr("trimRight",[Ie],(function(t){return{type:Ie,value:t.value.replace(/\s+$/,"")}})),dr("toUpperCase",[Ie],(function(t){return{type:Ie,value:t.value.toUpperCase()}})),dr("toLowerCase",[Ie],(function(t){return{type:Ie,value:t.value.toLowerCase()}})),dr("div",[Oe,Oe],Ar),dr("div",[Je,Je],Ar),dr("mod",[Oe,Oe],Vr),dr("mod",[Je,Je],Vr),dr("mul",[{type:Oe,isVararg:!0}],jr),dr("mul",[{type:Je,isVararg:!0}],jr),dr("sub",[{type:Oe,isVararg:!0}],Dr),dr("sub",[{type:Je,isVararg:!0}],Dr),dr("sum",[{type:Oe,isVararg:!0}],zr),dr("sum",[{type:Je,isVararg:!0}],zr),dr("abs",[Oe],Sr),dr("abs",[Je],Sr),dr("max",[{type:Oe,isVararg:!0}],Pr),dr("max",[{type:Je,isVararg:!0}],Pr),dr("min",[{type:Oe,isVararg:!0}],Mr),dr("min",[{type:Je,isVararg:!0}],Mr),dr("maxNumber",[],(function(){return{type:Je,value:Pe}})),dr("minNumber",[],(function(){return{type:Je,value:Me}})),dr("maxInteger",[],(function(){return{type:Oe,value:2147483647}})),dr("minInteger",[],(function(){return{type:Oe,value:Se}})),dr("round",[Je],(function(t){const e=Math.sign(t.value);return{type:Je,value:e*Math.round(Math.abs(t.value))}})),dr("floor",[Je],(function(t){return{type:Je,value:Math.floor(t.value)}})),dr("ceil",[Je],(function(t){return{type:Je,value:Math.ceil(t.value)}})),dr("signum",[Je],Ir),dr("signum",[Oe],Ir),dr("copySign",[Je,Je],Or),dr("copySign",[Oe,Oe],Or),dr("getColorAlpha",[Ie],Tr),dr("getColorAlpha",[Te],Tr),dr("getColorRed",[Ie],Br),dr("getColorRed",[Te],Br),dr("getColorGreen",[Ie],Rr),dr("getColorGreen",[Te],Rr),dr("getColorBlue",[Ie],Ur),dr("getColorBlue",[Te],Ur),dr("setColorAlpha",[Ie,Je],Wr),dr("setColorAlpha",[Te,Je],Wr),dr("setColorRed",[Ie,Je],Lr),dr("setColorRed",[Te,Je],Lr),dr("setColorGreen",[Ie,Je],qr),dr("setColorGreen",[Te,Je],qr),dr("setColorBlue",[Ie,Je],Hr),dr("setColorBlue",[Te,Je],Hr),dr("rgb",[Je,Je,Je],(function(t,e,r){const n={a:255,r:255*t.value,g:255*e.value,b:255*r.value};return{type:Te,value:Cr(n)}})),dr("argb",[Je,Je,Je,Je],(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:Te,value:Cr(i)}}));const Yr={StringLiteral:function(t,e){return{type:Ie,value:e.value}},NumberLiteral:function(t,e){return{type:Je,value:e.value}},IntegerLiteral:function(t,e){return{type:Oe,value:e.value}},BooleanLiteral:function(t,e){return{type:Ne,value:e.value?1:0}},UnaryExpression:function(t,e){const r=gr(Zr(t,e.argument));switch(e.operator){case"!":if(r.type===Ne)return{type:Ne,value:r.value?0:1};xr(`${e.operator}${mr(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const t="+"===e.operator?1:-1;if(r.type===Oe)return{type:Oe,value:r.value*t};if(r.type===Je)return{type:Je,value:r.value*t};xr(`${e.operator}${mr(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=gr(Zr(t,e.test));if(r.type===Ne)return r.value?Zr(t,e.consequent):Zr(t,e.alternate);xr(`${mr(r)} ? ${mr(Zr(t,e.consequent))} : ${mr(Zr(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 Zr(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=hr(Zr(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:Ie,value:r}},LogicalExpression:function(t,e){const r=gr(Zr(t,e.left));if(r.type!==Ne&&xr(`${mr(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Ne,value:0};const n=gr(Zr(t,e.right));return n.type!==Ne&&xr(`${mr(r)} ${e.operator} ${mr(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${yr(n.type)}.`),{type:Ne,value:n.value}},BinaryExpression:function(t,e){const r=e.operator,n=Zr(t,e.left),i=Zr(t,e.right);if(n.type!==i.type&&xr(`${mr(n)} ${e.operator} ${mr(i)}`,`Operator '${r}' cannot be applied to different types: ${yr(n.type)} and ${yr(i.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===Be&&r.type===Be?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:Ne,value:n?1:0}}(r,n,i);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==Je&&e.type!==Oe&&e.type!==Be&&xr(`${mr(e)} ${t} ${mr(r)}`,`Operator '${t}' cannot be applied to ${yr(e.type)} type.`);const i=e.type===Be?e.value.getTime():e.value,o=r.type===Be?r.value.getTime():r.value;return n=">"===t?i>o:">="===t?i>=o:"<"===t?i<o:i<=o,{type:Ne,value:n?1:0}}(r,n,i);if("+"===r||"-"===r)return function(t,e,r){if(e.type!==Ie&&e.type!==Je&&e.type!==Oe&&xr(`${mr(e)} ${t} ${mr(r)}`,`Operator '${t}' cannot be applied to ${yr(e.type)} type.`),e.type===Ie)return"-"===t&&xr(`${mr(e)} - ${mr(r)}`,`Operator '${t}' cannot be applied to ${yr(e.type)} type.`),{type:Ie,value:e.value+r.value};let n="+"===t?e.value+r.value:e.value-r.value;return e.type===Oe&&(n=br(n)),{type:e.type,value:n}}(r,n,i);if("/"===r||"*"===r||"%"===r)return function(t,e,r){let n;if(e.type!==Oe&&e.type!==Je&&xr(`${mr(e)} ${t} ${mr(r)}`,`Operator '${t}' cannot be applied to ${yr(e.type)} type.`),"*"===t)n=e.value*r.value;else{if("/"!==t&&"%"!==t)throw new Error(`Unsupported operation ${t}`);0===r.value&&xr(`${mr(e)} ${t} ${mr(r)}`,"Division by zero is not supported."),n="/"===t?e.value/r.value:e.value%r.value}return e.type===Oe&&(n=br(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(!cr.has(r))throw new Error(`Unknown function name: ${r}.`);let n;const i=e.arguments.map((e=>Zr(t,e))),o=r+":"+i.map((t=>t.type)).join("#");if(ur.has(o))n=ur.get(o);else{const t=function(t,e){const r=cr.get(t);if(!r)throw new Error("Missing function");let n=null;for(let t=0;t<r.length;++t){const i=vr(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=>yr(t.type))).join(", "),n=`${r}(${Gr(i)})`;"few"===t.type&&0===i.length?xr(n,`Non empty argument list is required for function '${r}'.`):(t.type,xr(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){xr(`${r}(${Gr(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 Zr(t,e){if(e.type in Yr)return Yr[e.type](t,e);throw new Error("Unsupported expression")}function Xr(t,e){try{return Zr(t,e)}catch(t){return{type:"error",value:t.message}}}class Kr{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return pr(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=Xr(t,this.ast);if("error"===r.type)return void e(q(new Error("Expression execution error"),{additional:{message:r.value}}));const n=r.value;if(n instanceof Date)return fr(n);if("boolean"===r.type)return Boolean(n);if("color"===r.type){const t=tt(String(n));if(t)return Cr(t);e(q(new Error("Expression execution error")))}return n}catch(t){return void e(q(new Error("Expression execution error")))}}}function Qr(t,e,r){if(t)if("string"==typeof t){if((n=t).indexOf("@{")>-1||n.indexOf("\\")>-1){e.hasExpression=!0;try{const r=lr(t,{startRule:"JsonStringContents"}),n=$r(r);return e.vars.push(...n),new Kr(r)}catch(e){return void r(q(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>Qr(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=Qr(t[i],e,r);return n}}var n;return t}function tn(t,e,r){if(t){if(t instanceof Kr)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>tn(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=tn(t[i],e,r);return n}}return t}function en(t,e){const r={vars:[],hasExpression:!1},n=Qr(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>tn(n,t,e)}}const rn={pagers:function(){return U(new Map)}},nn=new Map,on=new Map;function an(t){const e=nn.get(t)||U("");return nn.has(t)||nn.set(t,e),e}function sn(t){const e=on.get(t)||new Map;return on.has(t)||on.set(t,e),e}class ln{setVariable(t){const e=t.getName(),r=sn(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),an(this).set(e)}getVariable(t){return sn(this).get(t)}}function cn(){return new ln}const un=J(((t,e,r,n)=>{let i,o;var s,l,c;let{id:u}=e,{json:v={}}=e,{platform:p="auto"}=e,{theme:g="system"}=e,{globalVariablesController:f=new ln}=e,{mix:h=""}=e,{customization:m={}}=e,{onError:y}=e,{onStat:b}=e,{onCustomAction:w}=e,{onComponent:$}=e,x=U("desktop"===p);if(o=a(x,(t=>i=t)),"auto"===p&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");x.set(!t.matches),t.addListener((()=>{x.set(!t.matches)}))}let k="light",C=null;function E(t){g=t}let F=!1;v||(F=!0,B(q(new Error('"json" prop is required')))),u||(F=!0,B(q(new Error('"id" prop is required'))));let A=function(t){if(!t)return q(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return q(new Error("Missing card"));if(!e.states||!e.states.length)return q(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in Ge)return q(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return q(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return q(new Error("Missing state_id"),{additional:{index:t}})}return null}(v);const V=v.templates||{};A&&(F=!0,B(A));const D={stateChange:!1},z=an(f),S=sn(f),P=new Map,I=new Map,O=new Map;function J(t,e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e){const r=I.get(t);r&&r.setValue(e)}}function N(t){const e=I.get(t);return null==e?void 0:e.getValue()}function T(t){const e=en(t,B);return e.vars.length?e.applyVars(I):t}function B(t){y?y({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function R(t,e){b&&b({type:t,action:e})}let H=0;function G(t){return`${u}-${H++}`}let Y={},Z={};function X(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=it,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=tt(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=tt(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=tt(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=I.get(r);t?t.set(i):B(q(new Error("Cannot find variable"),{additional:{name:r}}))}else B(q(new Error("Incorrect set_variable_action"),{additional:{url:t}}));break;default:B(q(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){B(q(t,{additional:{url:e}}))}}function K(t){null==w||w(t)}const Q=new Map;function tt(t){if(Q.has(t))return Q.get(t);B(q(new Error("Missing instance with id"),{additional:{id:t}}))}const et=new Map;function nt(t){for(const e of t)I.has(e)&&t.delete(e);return t}d(L,{logError:B,logStat:R,hasTemplate:function(t){return t in V},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in V;){if(({json:t,templateContext:e}=Ke(t,e,V,B)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:G,genClass:function(t){return`divkit-${G()}`},execAction:X,execAnyActions:async function(t,e){if(t){for(let r=0;r<t.length;++r){let n=t[r];const i=n.url;if(i){const t=lt(i);if(t)if(ut(t)){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?(X(n),await _()):n.log_id&&(K(n),await _())}}t.forEach((t=>{t.log_id&&R("click",t)}))}},execCustomAction:K,isRunning:function(t){return D[t]},setRunning:function(t,e){D[t]=e},registerInstance:function(t,e){Q.has(t)?B(q(new Error("Duplicate instance id"),{additional:{id:t}})):Q.set(t,e)},unregisterInstance:function(t){Q.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(Z[r]=Z[r]||0,++Z[r],Y[r])return Y[r];const n=`${G()}-svg-filter`;return Y=Object.assign(Object.assign({},Y),{[r]:n}),n},removeSvgFilter:function(t,e){t&&Z[t]&&0==--Z[`${t}:${e}`]&&(Y=Object.keys(Y).reduce(((t,e)=>(Z[e]&&(t[e]=Y[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return tr(t);const e=en(t,B);return e.vars.length?W(e.vars.map((t=>I.get(t)||function(t){const e=O.get(t)||U(void 0);return O.has(t)||O.set(t,e),e}(t))).filter(rt),(()=>e.applyVars(I))):e.hasExpression?tr(e.applyVars(I)):tr(t)},getJsonWithVars:T,getStore:function(t){return et.has(t)||function(t){et.has(t)||et.set(t,rn[t]())}(t),et.get(t)},getVariable:function(t,e){const r=I.get(t);if(r){const n=r.getType();if(n!==e)return void B(q(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:n}}))}return r},getCustomization:function(t){return null==m?void 0:m[t]},isDesktop:x,registerComponent:void 0,unregisterComponent:void 0}),d(Ft,{hasAction:()=>!1});const it={setState(t){throw new Error("Not implemented")},getChild(t){if(ot&&ot.has(t))return ot.get(t);B(q(new Error("Missing state block with id"),{additional:{id:t}}))}};let ot=null;d(pt,{registerInstance(t,e){ot||(ot=new Map),ot.has(t)?B(q(new Error("Duplicate state with id"),{additional:{id:t}})):ot.set(t,e)},unregisterInstance(t){null==ot||ot.delete(t)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionOut:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionChange:(t,e,r,n)=>Promise.resolve(),hasTransitionChange:t=>!1,registerChild(t){},unregisterChild(t){}});const at=null===(s=null==v?void 0:v.card)||void 0===s?void 0:s.variables;Array.isArray(at)&&at.forEach((t=>{if(t&&t.type in Ue&&t.name){if(P.has(t.name))return void B(q(new Error("Duplicate variable"),{additional:{name:t.name}}));try{const e=We(t.name,t.type,t.value);P.set(t.name,e),I.set(t.name,e)}catch(e){B(q(e,{additional:{name:t.name}}))}}}));const st=v.palette;st&&st[k].forEach((t=>{if(P.has(t.name))B(q(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=We(t.name,"color",t.color);P.set(t.name,e),I.set(t.name,e)}catch(e){B(q(e,{additional:{name:t.name}}))}}));for(const[t,e]of S)I.has(t)||I.set(t,e);z.subscribe((t=>{if(t&&!I.has(t)){const e=S.get(t);I.set(t,e);const r=O.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const ct=null===(l=null==v?void 0:v.card)||void 0===l?void 0:l.variable_triggers;Array.isArray(ct)&&ct.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void B(q(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=lr(t.condition,{startRule:"JsonStringContents"}),i=$r(n);if(!i.length)return void B(q(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return nt(e),e.size?new Promise((t=>{const r=z.subscribe((()=>{nt(e),e.size||(r(),t())}))})):Promise.resolve()})(i).then((()=>{W(i.map((t=>I.get(t))).filter(rt),(()=>Xr(I,n))).subscribe((n=>{"error"!==n.type?(n.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=T(t);e.log_id&&X(e)})),e=Boolean(n.value)):B(q(new Error("variable_trigger condition execution error"),{additional:{message:n.value}}))}))}))}catch(e){B(q(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else B(q(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));const dt=null===(c=v.card)||void 0===c?void 0:c.states,vt=dt&&!F?{type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:dt.map((t=>({state_id:t.state_id.toString(),div:t.div})))}:void 0;return void 0===e.id&&r.id&&void 0!==u&&r.id(u),void 0===e.json&&r.json&&void 0!==v&&r.json(v),void 0===e.platform&&r.platform&&void 0!==p&&r.platform(p),void 0===e.theme&&r.theme&&void 0!==g&&r.theme(g),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==f&&r.globalVariablesController(f),void 0===e.mix&&r.mix&&void 0!==h&&r.mix(h),void 0===e.customization&&r.customization&&void 0!==m&&r.customization(m),void 0===e.onError&&r.onError&&void 0!==y&&r.onError(y),void 0===e.onStat&&r.onStat&&void 0!==b&&r.onStat(b),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==w&&r.onCustomAction(w),void 0===e.onComponent&&r.onComponent&&void 0!==$&&r.onComponent($),void 0===e.setTheme&&r.setTheme&&void 0!==E&&r.setTheme(E),void 0===e.setVariable&&r.setVariable&&void 0!==J&&r.setVariable(J),void 0===e.getVariable&&r.getVariable&&void 0!==N&&r.getVariable(N),void 0===e.execAction&&r.execAction&&void 0!==X&&r.execAction(X),"light"===g||"dark"===g?k=g:"system"===g?"undefined"!=typeof matchMedia?(C||(C=matchMedia("(prefers-color-scheme: dark)"),C.addListener((function(){"system"===g&&C&&(k=C.matches?"dark":"light")}))),k=C.matches?"dark":"light"):k="light":B(q(new Error("Unsupported theme"))),k&&(st&&st[k].forEach((t=>{const e=I.get(t.name);e&&e.setValue(t.color)}))),o(),!F&&vt?`<div class="${j("divkit-b023c",!0)+j(i?" divkit-ee112":"",!0)+j(h?` ${h}`:"",!0)}">${M(Xe,"RootSvgFilters").$$render(t,{svgFiltersMap:Y},{},{})}\n ${M(Ze,"Unknown").$$render(t,{div:vt,templateContext:{}},{},{})}</div>`:""}));function dn(t){return un.render({id:t.id,json:t.json,globalVariablesController:t.globalVariablesController,mix:t.mix,customization:t.customization,onError:t.onError,platform:t.platform}).html}var vn=e.M,pn=e.Os,gn=e.sY;export{vn as createGlobalVariablesController,pn as createVariable,gn as render};
2
2
  //# sourceMappingURL=server.mjs.map