@divkitframework/divkit 23.0.0 → 23.2.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 u(){if(!s)throw new Error("Function called outside component initialization");return s}function c(t){u().$$.on_destroy.push(t)}function d(t,e){return u().$$.context.set(t,e),e}function v(t){return u().$$.context.get(t)}t.d(e,{M:()=>vn,Os:()=>Ue,sY:()=>mn}),new Set,new Map;const p=[],g=[],h=[],f=[],m=Promise.resolve();let y=!1;function b(){return y||(y=!0,m.then(x)),m}function _(t){h.push(t)}const w=new Set;let $=0;function x(){const t=s;do{for(;$<p.length;){const t=p[$];$++,l(t),k(t.$$)}for(l(null),p.length=0,$=0;g.length;)g.pop()();for(let t=0;t<h.length;t+=1){const e=h[t];w.has(e)||(w.add(e),e())}h.length=0}while(p.length);for(;f.length;)f.pop()();y=!1,w.clear(),l(t)}function k(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(_)}}new Set,"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;const E=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),C=/[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;function F(t,e){const r=Object.assign({},...t);if(e){const t=e.classes,n=e.styles;t&&(null==r.class?r.class=t:r.class+=" "+t),n&&(null==r.style?r.style=N(n):r.style=N(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),n=e.slice(0,t).trim(),i=e.slice(t+1).trim();n&&(r[n]=i)}for(const t in e){const n=e[t];n?r[t]=n:delete r[t]}return r}(r.style,n)))}let n="";return Object.keys(r).forEach((t=>{if(C.test(t))return;const e=r[t];!0===e?n+=" "+t:E.has(t.toLowerCase())?e&&(n+=" "+t):null!=e&&(n+=` ${t}="${e}"`)})),n}const A=/[&"]/g,V=/[&<]/g;function j(t,e=!1){const r=String(t),n=e?A:V;n.lastIndex=0;let i="",o=0;for(;n.test(r);){const t=n.lastIndex-1,e=r[t];i+=r.substring(o,t)+("&"===e?"&amp;":'"'===e?"&quot;":"&lt;"),o=t+1}return i+r.substring(o)}function 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 P(t,e){let r="";for(let n=0;n<t.length;n+=1)r+=e(t[n],n);return r}const z={$$render:()=>""};function M(t,e){if(!t||!t.$$render)throw"svelte:component"===e&&(e+=" this={...}"),new Error(`<${e}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules`);return t}let T,I;function O(t){function e(e,r,n,i,o){const a=s;l({$$:{on_destroy:T,context:new Map(o||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const u=t(e,r,n,i);return l(a),u}return{render:(t={},{$$slots:r={},context:n=new Map}={})=>{T=[];const o={title:"",head:"",css:new Set},a=e(o,t,{},r,n);return i(T),{html:a,css:{code:Array.from(o.css).map((t=>t.code)).join("\n"),map:null},head:o.title+o.head}},$$render:e}}function J(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${j(e,!0)}"`}`}function N(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${t[e]};`)).join(" ")}function B(t){const e=N(t);return e?` style="${e}"`:""}"function"==typeof HTMLElement&&(I=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(o);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,r){this[t]=r}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){(function(t,e){const r=t.$$;null!==r.fragment&&(i(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])})(this,1),this.$destroy=r}$on(t,e){const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(e),()=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});const R=[];function U(t,e=r){let n;const i=new Set;function o(e){if(o=e,((r=t)!=r?o==o:r!==o||r&&"object"==typeof r||"function"==typeof r)&&(t=e,n)){const e=!R.length;for(const e of i)e[1](),R.push(e,t);if(e){for(let t=0;t<R.length;t+=2)R[t][0](R[t+1]);R.length=0}}var r,o}return{set:o,update:function(e){o(e(t))},subscribe:function(a,s=r){const l=[a,s];return i.add(l),1===i.size&&(n=e(o)||r),a(t),()=>{i.delete(l),0===i.size&&(n(),n=null)}}}}function L(t,e,n){const s=!Array.isArray(t),l=s?[t]:t,u=e.length<2;return{subscribe:U(n,(t=>{let n=!1;const c=[];let d=0,v=r;const p=()=>{if(d)return;v();const n=e(s?c[0]:c,t);u?t(n):v=o(n)?n:r},g=l.map(((t,e)=>a(t,(t=>{c[e]=t,d&=~(1<<e),n&&p()}),(()=>{d|=1<<e}))));return n=!0,p(),function(){i(g),v()}})).subscribe}}const W=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,u=2===r.length?r:r+r;return{a:parseInt(u,16),r:parseInt(a,16),g:parseInt(s,16),b:parseInt(l,16)}}const[t,r,n,i]=e,o=2===r.length?r:r+r,a=2===n.length?n:n+n,s=2===i.length?i:i+i;return{a:255,r:parseInt(o,16),g:parseInt(a,16),b:parseInt(s,16)}}return null}function 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]||""}function ut(t,e){return e.has(t)}function ct(t,e){e&&t.push(e)}function dt(t,e,r){const n=[];ct(n,e[t]);for(const i in r)if(r.hasOwnProperty(i)){const o=r[i];o&&ct(n,e[`${t}_${i}`+("string"==typeof o?`_${o}`:"")])}return n.join(" ")}const vt=Symbol("state");function pt(t){return Z(t.top||0)+" "+Z(t.right||0)+" "+Z(t.bottom||0)+" "+Z(t.left||0)}function gt(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function ht(t){return gt(t)&&t>=0}function ft(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 pt(t)}function mt(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const yt=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(!yt.call(e,i)||!bt(t[i],e[i]))return!1}return!0}function _t(t,e){return bt(t,e)?e:t}function wt(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function $t(t,e){const r=Number(t);return isNaN(r)?e:r}function xt(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...xt(t))})):e.push(t),e}function kt(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 Ct=Symbol("action"),Ft=O(((t,e,r,n)=>{let{actions:i}=e,{doubleTapActions:o}=e,{longTapActions:a}=e,{cls:s=""}=e,{style:l=null}=e,{attrs:u}=e,{use:c=Et}=e,{customAction:p=null}=e,{isNativeActionAnimation:g=!0}=e;const h=v(W),f=v(Ct);d(Ct,{hasAction:()=>Boolean(f.hasAction()||(null==i?void 0:i.length))});let m,y="";if(Array.isArray(i)&&(null==i?void 0:i.length))for(let t=0;t<i.length;++t){const e=i[t].url;if(e){y=e,m=i[t].target||void 0;break}}Array.isArray(i)&&(null==i?void 0:i.length)&&f.hasAction()&&(y="",h.logError(q(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:i}})));let b=Boolean(p);return y&&!ut(lt(y),h.getBuiltinProtocols())&&(y="",b=!0),void 0===e.actions&&r.actions&&void 0!==i&&r.actions(i),void 0===e.doubleTapActions&&r.doubleTapActions&&void 0!==o&&r.doubleTapActions(o),void 0===e.longTapActions&&r.longTapActions&&void 0!==a&&r.longTapActions(a),void 0===e.cls&&r.cls&&void 0!==s&&r.cls(s),void 0===e.style&&r.style&&void 0!==l&&r.style(l),void 0===e.attrs&&r.attrs&&void 0!==u&&r.attrs(u),void 0===e.use&&r.use&&void 0!==c&&r.use(c),void 0===e.customAction&&r.customAction&&void 0!==p&&r.customAction(p),void 0===e.isNativeActionAnimation&&r.isNativeActionAnimation&&void 0!==g&&r.isNativeActionAnimation(g),y?`<a${F([{href: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(u)],{})}>${n.default?n.default({}):""}</a>`:`<span${F([{class:j(s,!0)+j(b?` ${g?"divkit-bd259":"divkit-d9099"} divkit-c016b`:"",!0)+" "+j(null!=a&&a.length?"divkit-f0cba":"",!0)},{style:D(l)},{role:D(b?"button":null)},{tabindex:D(b?0:null)},S(u)],{})}>${n.default?n.default({}):""}</span>`}));function At(t){return gt(t)&&t>0}function Vt(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(At(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 jt=O(((t,e,r,n)=>{let i,{background:o=[]}=e,{radius:a=""}=e;const s=v(W);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=Vt(t.filters,s.logError)))}return r})),`<span${J("class","divkit-bf253"+(a?" divkit-dcad7":""),0)}${B({"border-radius":a})}>${P(i,(t=>t.image_url?`<img${J("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${J("class","divkit-b921d",0)}${J("style",Y(t.style),0)}>`:`<span${J("class","divkit-b921d",0)}${J("style",Y(t.style),0)}></span>`))}</span>`})),Dt=jt,St=O(((t,e,n,i)=>{let o,s,l,u,c,d,p,g,h,f,m,y,_,w,$,x,k,E,C,F,A,V,j,D,S,P,z,T,I,O,N,B,R,U,L,H,K,tt,et,rt,it,ot=r,at=r,st=r,ct=r,gt=r,yt=r,bt=r,Et=r,Ct=r,At=r,Vt=r,jt=r,St=r,Pt=r,zt=r,Mt=r,Tt=r;var It,Ot,Jt,Nt,Bt,Rt;let{json:Ut={}}=e,{origJson:Lt}=e,{templateContext:Wt}=e,{cls:qt=""}=e,{style:Ht}=e,{layoutParams:Gt={}}=e,{customDescription:Yt=!1}=e,{customPaddings:Zt=!1}=e,{customActions:Xt=""}=e,{additionalPaddings:Kt=null}=e;const Qt={left:"start",center:"center",right:"end"},te={top:"start",center:"center",bottom:"end",baseline:"baseline"},ee=v(W),re=v(vt);let ne,ie,oe,ae,se,le,ue,ce,de,ve,pe,ge={},he={},fe=!1,me=1,ye="transparent",be=0,_e={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},we="",$e=null,xe="",ke={},Ee=0,Ce=0,Fe=0,Ae=!1,Ve=!1,je={},De=0,Se=0,Pe=0,ze=!1,Me=!1,Te=1;const Ie=Gt.fakeElement?[]:Ut.transition_triggers||["state_change","visibility_change"],Oe=-1!==Ie.indexOf("state_change")&&Ut.id,Je=-1!==Ie.indexOf("visibility_change")&&Ut.id;let Ne,Be,Re,Ue,Le,We,qe,He,Ge,Ye=[],Ze=[],Xe=[],Ke=[],Qe="",tr=!1,er="visible",rr=0,nr=0;void 0===e.json&&n.json&&void 0!==Ut&&n.json(Ut),void 0===e.origJson&&n.origJson&&void 0!==Lt&&n.origJson(Lt),void 0===e.templateContext&&n.templateContext&&void 0!==Wt&&n.templateContext(Wt),void 0===e.cls&&n.cls&&void 0!==qt&&n.cls(qt),void 0===e.style&&n.style&&void 0!==Ht&&n.style(Ht),void 0===e.layoutParams&&n.layoutParams&&void 0!==Gt&&n.layoutParams(Gt),void 0===e.customDescription&&n.customDescription&&void 0!==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.additionalPaddings&&n.additionalPaddings&&void 0!==Kt&&n.additionalPaddings(Kt),o=ee.getDerivedFromVars(Ut.border),Tt(),Tt=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===(Ot=null===(It=e.offset)||void 0===It?void 0:It.x)||void 0===Ot?void 0:Ot.value)||0)+" "+Z((null===(Nt=null===(Jt=e.offset)||void 0===Jt?void 0:Jt.y)||void 0===Nt?void 0:Nt.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,me=mt(it.stroke.width,me),ye=Q(it.stroke.color,1,ye),e.border=`${Z(me)} solid ${ye}`),it.corners_radius?(_e=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,_e),e["border-radius"]=t["border-radius"]=kt(_e)):it.corner_radius&&(be=mt(it.corner_radius,be),_e={"top-left":be,"top-right":be,"bottom-right":be,"bottom-left":be},e["border-radius"]=t["border-radius"]=Z(be)),r&&me&&(it.corners_radius||it.corner_radius)){let t=Object.assign({},_e);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+me/2})),n=kt(t)}}ge=_t(t,ge),he=_t(e,he),fe=r,we=n}s=ee.getDerivedFromVars(Ut.paddings),Mt(),Mt=a(s,(t=>rt=t)),$e=function(t,e){if(!t)return e;const r=["top","right","bottom","left"];for(let n=0;n<r.length;++n)if(t[r[n]]&&!ht(t[r[n]]))return e;return t}(rt&&!Zt?rt:void 0,$e),l=pt(function(t,e){if(!t&&!e)return{};if(!e)return t;if(!t)return e;const r={};return["top","right","bottom","left"].forEach((n=>{const i=t[n];i&&(r[n]=i);const o=e[n];o&&(r[n]=(r[n]||0)+o)})),r}($e,Kt)),u=ee.getDerivedFromVars(Ut.margins),Pt(),Pt=a(u,(t=>tt=t)),xe=ft(tt,xe),c=ee.getDerivedFromVars(Ut.width),jt(),jt=a(c,(t=>H=t)),d=ee.getDerivedFromVars(Ut.alignment_horizontal),zt(),zt=a(d,(t=>et=t));{let t,e,r,n,i={},o=0,a=0,s=!1,l=!1;const u=null==H?void 0:H.type;if("fixed"===u)Ee=mt(null==H?void 0:H.value,Ee),e=Z(Ee);else if("wrap_content"===u||!Gt.overlapParent&&"match_parent"===u&&Gt.parentHorizontalWrapContent){if(t="content",("wrap_content"===u&&(null==H?void 0:H.constrained)||"match_parent"===u&&Gt.parentHorizontalWrapContent)&&(i["width-constrained"]=!0,a=1),"wrap_content"===u){const t=H;t.min_size&&ht(t.min_size.value)&&(r=Z(t.min_size.value)),t.max_size&&ht(t.max_size.value)&&(n=Z(t.max_size.value))}"match_parent"===u&&ee.logError(q(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","vertical"===Gt.parentContainerOrientation&&Gt.parentContainerWrap&&(l=!0,ee.logError(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&&(o=H&&"weight"in H&&H.weight||1,Gt.parentContainerWrap&&(s=!0));if("parent"===t)i["halign-self"]="stretch";else{const t=et;i["halign-self"]="left"===t||"center"===t||"right"===t?Qt[t]:Gt.parentHAlign||"start"}t&&(i.width=t),oe=e,ae=r,se=n,Ce=o,Fe=a,ke=_t(i,ke),Ae=s,Ve=l}p=ee.getDerivedFromVars(Ut.height),Vt(),Vt=a(p,(t=>L=t)),g=ee.getDerivedFromVars(Ut.alignment_vertical),St(),St=a(g,(t=>K=t));{let t,e,r,n,i={},o=0,a=0,s=!1,l=!1;const u=null==L?void 0:L.type;if("fixed"===u)De=mt(null==L?void 0:L.value,De),e=Z(De);else if("match_parent"!==u||!Gt.overlapParent&&Gt.parentVerticalWrapContent){if(t="content",("wrap_content"===u&&(null==L?void 0:L.constrained)||"match_parent"===u&&Gt.parentVerticalWrapContent)&&(i["height-constrained"]=!0,a=1),"wrap_content"===u){const t=L;(null==t?void 0:t.min_size)&&ht(t.min_size.value)&&(r=Z(t.min_size.value)),(null==t?void 0:t.max_size)&&ht(t.max_size.value)&&(n=Z(t.max_size.value))}"match_parent"===u&&ee.logError(q(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","horizontal"===Gt.parentContainerOrientation&&Gt.parentContainerWrap&&(l=!0,ee.logError(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&&(o=(null==L?void 0:L.weight)||1,Gt.parentContainerWrap&&(s=!0));if("parent"===t)i["valign-self"]="stretch";else{const t=K;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===Gt.parentContainerOrientation?i["valign-self"]=te[t]:i["valign-self"]=Gt.parentVAlign||"start"}t&&(i.height=t),le=e,ue=r,ce=n,Se=o,Pe=a,je=_t(i,je),ze=s,Me=l}var ir,or,ar;if(h=!!Gt.overlapParent||void 0,f=Gt.overlapParent&&(!H||"match_parent"===H.type)&&"match_parent"===(null==L?void 0:L.type),m=Gt.gridArea?`${Gt.gridArea.y+1}/${Gt.gridArea.x+1}/span ${Gt.gridArea.rowSpan}/span ${Gt.gridArea.colSpan}`:void 0,y=ee.getDerivedFromVars(Ut.alpha),At(),At=a(y,(t=>U=t)),or=Te,Te=!ht(ir=U)||void 0===ir||ir>1?or:Number(ir),de=1===Te?void 0:Te,_=ee.getDerivedFromVars(Ut.accessibility),Ct(),Ct=a(_,(t=>R=t)),ie=void 0,R&&!Yt&&R.description&&(ie={},ie["aria-label"]=R.description),w=ee.getDerivedFromVars(Ut.background),Et(),Et=a(w,(t=>B=t)),ve={},pe=!1,B&&(pe=B.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(we),!pe)){const t=nt(B);ve["background-color"]=t.color,ve["background-image"]=t.image,ve["background-size"]=t.size,ve["background-position"]=t.position,ve["background-repeat"]="no-repeat"}Ne=void 0,Oe&&Ut.transition_in&&ee.isRunning("stateChange")&&(Ne=!0),Re=void 0,Oe&&Ut.transition_change&&ee.isRunning("stateChange")&&re.hasTransitionChange(Ut.id)&&(Re=!0),$=ee.getDerivedFromVars(Ut.action),yt(),yt=a($,(t=>O=t)),x=ee.getDerivedFromVars(Ut.actions),bt(),bt=a(x,(t=>N=t)),k=ee.getDerivedFromVars(Ut.doubletap_actions),gt(),gt=a(k,(t=>I=t)),E=ee.getDerivedFromVars(Ut.longtap_actions),ct(),ct=a(E,(t=>T=t));{let t=N||O&&[O]||[],e=I||[],r=T||[];Gt.fakeElement?(t=[],e=[],r=[]):(Array.isArray(t)||(t=[],ee.logError(q(new Error("Actions should be array")))),Array.isArray(e)||(e=[],ee.logError(q(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],ee.logError(q(new Error("LongTapActions should be array"))))),(t.length||e.length||r.length)&&Xt&&(t=[],e=[],r=[],ee.logError(q(new Error(`Cannot use action on component "${Xt}"`)))),Ye=t,Ze=e,Xe=r}C=ee.getDerivedFromVars(Ut.action_animation),st(),st=a(C,(t=>z=t)),z&&(Ke=xt(z),Qe=Ke.map((function(t){const e=$t(t.start_value,1),r=$t(t.end_value,1),n=mt(t.start_delay,0),i=mt(t.duration,300),o=wt(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return Ue=e,Le=r,`opacity ${i}ms ${o} ${n}ms`;case"scale":return We=e,qe=r,`transform ${i}ms ${o} ${n}ms`;case"native":case"no_animation":return"";default:return ee.logError(q(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", ")),F=ee.getDerivedFromVars(Ut.visibility),at(),at=a(F,(t=>P=t));{const t=er,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(P,er);t!==e&&(!tr||"visible"!==er&&"visible"!==e?er=e:async function(t){er=t;const e="visible"===t?"in":"out",r="in"===e?Ut.transition_in:Ut.transition_out;Je&&r&&(await b(),"in"===e&&(Be=!0),re.runVisibilityTransition(Object.assign(Object.assign({},Ut),{visibility:"visible"}),Wt,r,ne,e).then((()=>{"in"===e&&(Be=!1)})).catch((t=>{throw"in"===e&&(Be=!1),t})))}(e)),tr||(tr=!0)}if(A=Object.assign(Object.assign(Object.assign({},ke),je),{"parent-overlap":h,"parent-overlap-absolute":f,"scroll-snap":Gt.scrollSnap,"hide-on-transition-in":Ne||Be||Re,visibility:er,"has-action-animation":Boolean(Qe),"parent-flex":Gt.parentContainerOrientation||void 0}),V=ee.getDerivedFromVars(Ut.transform),ot(),ot=a(V,(t=>S=t)),S&&void 0!==S.rotation){const t=S.pivot_x||{type:"pivot-percentage",value:50};rr=$t(t.value,rr);const e="pivot-fixed"===t.type?Z(rr):`${rr}%`,r=S.pivot_y||{type:"pivot-percentage",value:50};nr=$t(r.value,nr),He=`${e} ${"pivot-fixed"===r.type?Z(nr):`${nr}%`}`,Ge=`rotate(${S.rotation}deg)`}return j=Ae||ze?"100%":Ce||Se?0:void 0,D=Object.assign(Object.assign(Object.assign(Object.assign({},Ht),ve),ge),{width:oe,"min-width":ae,"max-width":se,height:le,"min-height":ue,"max-height":ce||(null==Ht?void 0:Ht["max-height"]),"grid-area":m,padding:l,margin:xe,opacity:de,transition:Qe,"transform-origin":He,transform:Ge,"flex-grow":Ce||Se||void 0,"flex-shrink":Fe||Pe?1:void 0,"flex-basis":j,"--divkit-animation-opacity-start":Ue,"--divkit-animation-opacity-end":Le,"--divkit-animation-scale-start":We,"--divkit-animation-scale-end":qe}),ot(),at(),st(),ct(),gt(),yt(),bt(),Et(),Ct(),At(),Vt(),jt(),St(),Pt(),zt(),Mt(),Tt(),Ve||Me?"":`${M(Ft,"Actionable").$$render(t,{use:function(t){ne=t,Oe&&Ut.transition_in&&re.registerChildWithTransitionIn(Ut,Wt,Ut.transition_in,t).then((()=>{Ne=!1})).catch((t=>{throw Ne=!1,t})),Oe&&Ut.transition_out&&re.registerChildWithTransitionOut(Ut,Wt,Ut.transition_out,t),Oe&&Ut.transition_change&&re.registerChildWithTransitionChange(Ut,Wt,Ut.transition_change,t).then((()=>{Re=!1})).catch((t=>{throw Re=!1,t})),function(t,{visibilityActions:e,rootCtx:r}){if(null==e||!e.length)return;const n=e.map((t=>({action:t,visible:!1,count:0,finished:!1}))),i=[...new Set([...e.map((t=>(t.visibility_percentage||50)/100))])];new IntersectionObserver((t=>{t.forEach((t=>{n.forEach((e=>{const n=t.intersectionRatio>=(e.action.visibility_percentage||50)/100;!e.visible&&n?e.finished||(e.timer=setTimeout((()=>{++e.count;const t=0===e.action.log_limit?1/0:e.action.log_limit||1;++e.count>=t&&(e.finished=!0);const n=e.action.url;if(n){const t=lt(n);t&&!ut(t,r.getBuiltinProtocols())&&("div-action"===t?r.execAction(e.action):e.action.log_id&&r.execCustomAction(e.action))}r.logStat("visible",e.action)}),e.action.visibility_duration||800)):n||e.timer&&clearTimeout(e.timer),e.visible=n}))}))}),{threshold:i}).observe(t)}(t,{visibilityActions:Gt.fakeElement?[]:ee.getJsonWithVars(Ut.visibility_actions||Ut.visibility_action&&[Ut.visibility_action]),rootCtx:ee});const e=Ut.id;e&&re.registerChild(e);let r=null;return{destroy(){e&&re.unregisterChild(e),r&&r.destroy()}}},cls:qt+" "+dt("outer",G,A),style:Y(D),actions:Ye,doubleTapActions:Ze,longTapActions:Xe,attrs:ie,isNativeActionAnimation:!Ke.length||(ar=Ke,ar.some((t=>"native"===t.name)))},{},{default:()=>`${pe?`${M(Dt,"OuterBackground").$$render(t,{background:B,radius:we},{},{})}`:""}${i.default?i.default({}):""}${fe?`<span${J("class",G.outer__border,0)}${J("style",Y(he),0)}></span>`:""}`})}`})),Pt=St,zt={"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 Mt(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function Tt(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function It(t,e){return Tt(t)||e}const Ot=O(((t,e,r,n)=>{let i,o,a,s,l;var u,c;let d,{text:v}=e,{rootFontSize:p}=e,{textStyles:g={}}=e,{singleline:h=!1}=e,{actions:f}=e,m="none",y=12,b=1.25,_="",w="",$=null;void 0===e.text&&r.text&&void 0!==v&&r.text(v),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==p&&r.rootFontSize(p),void 0===e.textStyles&&r.textStyles&&void 0!==g&&r.textStyles(g),void 0===e.singleline&&r.singleline&&void 0!==h&&r.singleline(h),void 0===e.actions&&r.actions&&void 0!==f&&r.actions(f);{let t="none";(g.underline||g.strike)&&("single"===g.underline&&"single"===g.strike?t="both":"single"===g.underline?t="underline":"single"===g.strike&&(t="strike")),m=t}return y=Mt(g.font_size,y),At(g.line_height)&&(b=Number(g.line_height)/y),ht(g.letter_spacing)&&(_=Z(g.letter_spacing)),d=It(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===(u=g.border)||void 0===u?void 0:u.stroke)&&"transparent"!==Q(g.border.stroke.color)&&At(g.border.stroke.width)?{color:g.border.stroke.color,width:g.border.stroke.width}:null,a=Mt(null===(c=g.border)||void 0===c?void 0:c.corner_radius,0),s={singleline:h,decoration:m},l={"font-size":Z(10*y/p),"line-height":b,"letter-spacing":_,"font-weight":d,color:w,background:(null==o?void 0:o.color)||void 0,"box-shadow":$?`inset 0 0 0 ${Z($.width)} ${$.color}`:void 0,"border-radius":a?Z(a):void 0},`${i?`<span${J("class",zt["text-range__top-offset"],0)}${B({"margin-top":i})}></span>`:""}${M(Ft,"Actionable").$$render(t,{cls:dt("text-range",zt,s),actions:f,style:Y(l)},{},{default:()=>`${j(v)}`})}`})),Jt=Ot;function Nt(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Bt(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function Rt(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const Ut=O(((t,e,n,i)=>{let o,s,l,u,d,p,g,h,f,m,y,b,_,w,$,x,k,E,C,F,A,V,j,D,S,z,T,I,O,N,B,R,U,L=r,G=r,X=r,K=r,tt=r,et=r,rt=r,it=r,ot=r,at=r,st=r,lt=r,ut=r,{json:ct={}}=e,{templateContext:vt}=e,{origJson:pt}=e,{layoutParams:gt}=e;const ht=v(W);let ft=!1,mt="",yt=12,bt=1.25,_t=!1,wt="",$t="",xt=!1,kt="left",Et="top",Ct="",Ft="",Vt=!1,jt=[],Dt=[];var St,zt;c((()=>{Dt.forEach((([t,e])=>{ht.removeSvgFilter(t,e)}))})),void 0===e.json&&n.json&&void 0!==ct&&n.json(ct),void 0===e.templateContext&&n.templateContext&&void 0!==vt&&n.templateContext(vt),void 0===e.origJson&&n.origJson&&void 0!==pt&&n.origJson(pt),void 0===e.layoutParams&&n.layoutParams&&void 0!==gt&&n.layoutParams(gt),o=ht.getDerivedFromVars(ct.text),ut(),ut=a(o,(t=>U=t)),St=U,zt=mt,mt=String(null!=St?St:"")||zt,mt?ft=!1:(ft=!0,ht.logError(q(new Error('Missing "text" prop for div "text"')))),s=ht.getDerivedFromVars(ct.ranges),G(),G=a(s,(t=>V=t)),l=ht.getDerivedFromVars(ct.images),L(),L=a(l,(t=>A=t)),u=ht.getDerivedFromVars({font_size:ct.font_size,letter_spacing:ct.letter_spacing,font_weight:ct.font_weight,text_color:ct.text_color,underline:ct.underline,strike:ct.strike,line_height:ct.line_height}),X(),X=a(u,(t=>j=t)),d=ht.getDerivedFromVars(ct.font_size),lt(),lt=a(d,(t=>R=t)),yt=Mt(R,yt),p=ht.getDerivedFromVars(ct.line_height),st(),st=a(p,(t=>B=t));{const t=B;At(t)?(bt=Number(t)/yt,_t=!0):_t=!1}g=ht.getDerivedFromVars(ct.max_lines),it(),it=a(g,(t=>I=t)),h=1===I;{let t="",e="",r=!1;if(I&&I>1){let n=Number(I);t=n*bt+"em",V||A||(e=n,r=!0)}wt=t,$t=e,xt=r}f=ht.getDerivedFromVars(ct.text_alignment_horizontal),at(),at=a(f,(t=>N=t)),kt=Nt(N,kt),m=ht.getDerivedFromVars(ct.text_alignment_vertical),ot(),ot=a(m,(t=>O=t)),Et=Bt(O,Et),y=!V||mt&&1===V.length&&V[0]&&0===V[0].start&&"number"==typeof V[0].end&&V[0].end>=mt.length,b=ht.getDerivedFromVars(ct.text_color),rt(),rt=a(b,(t=>T=t)),_=Boolean(T)!==Boolean(V&&V[0]&&V[0].text_color);{let t="";I&&y&&_&&(t=Q(T||V&&V[0]&&V[0].text_color,1,Ct)),Ct=t}w=ht.getDerivedFromVars(ct.truncate),et(),et=a(w,(t=>z=t)),$="none"===z?"none":"",x=ht.getDerivedFromVars(ct.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=ht.getDerivedFromVars(ct.selectable),K(),K=a(k,(t=>D=t)),Vt=function(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}(D,Vt),function(t,e,r){let n=[];if(Dt.forEach((([t,e])=>{ht.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=[],u=[];o.forEach((t=>{void 0!==t.start&&void 0!==t.end&&(u.push({index:t.start,range:t,type:"rangeStart",isStart:!0}),u.push({index:t.end,range:t,type:"rangeEnd"}))})),a.forEach(((t,e)=>{void 0!==t.start&&t.url&&t.start<=i.length&&u.push({index:t.start,image:t,type:"image",arrayIndex:e})})),u.sort(((t,e)=>t.index===e.index?t.type!==e.type?"image"===t.type?-1:"image"===e.type?1:t.type<e.type?-1:1:"image"===t.type&&"image"===e.type?e.arrayIndex-t.arrayIndex:"rangeStart"===t.type&&"rangeStart"===e.type?t.range.end-e.range.end:"rangeStart"===t.type?1:"rangeStart"===e.type?-1:"image"!==t.type&&"image"!==e.type?t.range.start-e.range.start:0:t.index-e.index)),u.forEach((t=>{var e;let r="image"===t.type?null:t.range,o=t.index;if(o>s){let r=Object.assign(Object.assign({},j),...l);n.push({text:i.substring(s,o),textStyles:r,actions:"rangeEnd"===t.type&&(null===(e=t.range)||void 0===e?void 0:e.actions)||void 0})}if("rangeStart"===t.type&&r)l.push(r);else if("rangeEnd"===t.type)l=l.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},j),...l),r=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,u=Rt(t.image.tint_mode,"source_in");if(s){const e=Q(t.image.tint_color);a=ht.addSvgFilter(e,u),Dt.push([e,u])}n.push({image:{url:t.image.url,width:r,height:i,wrapperStyle:o,svgFilterId:a}})}s=o})),s<i.length&&n.push({text:i.substring(s),textStyles:Object.assign({},j)}),jt=n}(mt,V,A),E={singleline:h,multiline:xt,halign:kt,valign:Et,truncate:$},C={gradient:Boolean(Ft)},F={"font-size":Z(yt),"line-height":bt,"max-height":wt,"-webkit-line-clamp":$t,color:Ct,"background-image":Ft},L(),G(),X(),K(),tt(),et(),rt(),it(),ot(),at(),st(),lt(),ut(),ft?"":`${M(Pt,"Outer").$$render(t,{cls:dt("text",H,E)+" "+(Vt?"":"divkit-c016b"),json:ct,origJson:pt,templateContext:vt,layoutParams:gt},{},{default:()=>`<span${J("class",dt("text__inner",H,C),0)}${J("style",Y(F),0)}>${jt.length?`${P(jt,((e,r)=>"text"in e?e.text?`${M(Jt,"TextRangeView").$$render(t,{text:e.text,rootFontSize:yt,textStyles:e.textStyles,singleline:h,actions:e.actions},{},{})}`:"":e.image?`<span${J("style",Y(e.image.wrapperStyle),0)}><img${J("class",H.text__image,0)}${J("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${J("style",Y({width:e.image.width,height:e.image.height,"margin-top":_t?`-${e.image.height}`:void 0,"margin-bottom":_t?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${M(Jt,"TextRangeView").$$render(t,{text:mt,rootFontSize:yt,textStyles:j,singleline:h},{},{})}`}</span>`})}`})),Lt=Ut,Wt={container:"divkit-d37d6",container_wrap:"divkit-c8551",container_orientation_vertical:"divkit-ddc33",container_valign_top:"divkit-a331a",container_valign_center:"divkit-aae61",container_valign_bottom:"divkit-c2226",container_orientation_horizontal:"divkit-fe458",container_halign_left:"divkit-a3091",container_halign_center:"divkit-bac9d",container_halign_right:"divkit-f4230",container_orientation_overlap:"divkit-a644d"};function qt(t,e,r){if(!(t&&t.shape&&t.color&&t.shape.type&&e.includes(t.shape.type)))return r;const n=Q(t.color);let i,o,a;if("rounded_rectangle"===t.shape.type){var s,l,u,c;i=Number((null===(s=t.shape.item_width)||void 0===s?void 0:s.value)||10),o=Number((null===(l=t.shape.item_height)||void 0===l?void 0:l.value)||10),a=Number(null!==(u=null===(c=t.shape.corner_radius)||void 0===c?void 0:c.value)&&void 0!==u?u:5)}else{if("circle"!==t.shape.type)return r;var d;i=o=a=2*Number((null===(d=t.shape.radius)||void 0===d?void 0:d.value)||10)}if("shape_drawable"===t.type&&"transparent"!==n){var v,p,g;const e={},r=null!==(v=t.stroke)&&void 0!==v&&v.color?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 Ht(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 Gt(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 Yt(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 Zt(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)&&Yt(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)Yt(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];Yt(t,e.style,o,{top:o.bottom+e.style.height,right:0,bottom:0,left:o.right+e.style.width},i,n)}}const Xt=O(((t,e,r,n)=>{let i,{orientation:o}=e,{separator:a}=e,{lineSeparator:s}=e;const l=function(t,e){let r,n=0,i=!1;return function(){const e=Date.now();return!n||Math.abs(e-n)>10?(n=e,r=t.apply(this,arguments)):(i||(i=!0,setTimeout((()=>{i=!1,r=t.apply(this,arguments)}),10)),r)}}((function(){if(!i)return;const t=i.getBoundingClientRect();d=[];let e=[...i.children].filter((t=>t!==u&&!t.classList.contains(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&&Zt(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&&Zt(d,s,n,"horizontal"===o),d.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let u,d=[],v=!1,p=null,g=null;return c((()=>{v=!1})),void 0===e.orientation&&r.orientation&&void 0!==o&&r.orientation(o),void 0===e.separator&&r.separator&&void 0!==a&&r.separator(a),void 0===e.lineSeparator&&r.lineSeparator&&void 0!==s&&r.lineSeparator(s),i=null,(v&&i||p||g)&&(p&&(p.disconnect(),p=null),g&&(g.disconnect(),g=null),v&&i&&("undefined"!=typeof MutationObserver&&(p=new MutationObserver((function(t){t.some((t=>{var e;const r=null===(e=t.target)||void 0===e?void 0:e.classList;return!(null==r?void 0:r.contains("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${J("class","divkit-a7719",0)}${J("this",u,0)}>${P(d,(t=>`<div${J("class","divkit-c770e",0)}${B({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${J("class","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 Kt;function Qt(){if(void 0!==Kt)return Kt;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),Kt=1===t.scrollHeight,document.body.removeChild(t),Kt}const te=O(((t,e,n,i)=>{let o,s,l,u,c,d,p,g,h,f,m,y,b,_,w,$,x,k,E,C,F,A,V=r,j=r,D=r,S=r,z=r,T=r,I=r,O=r;var J,N,B,R,U,L;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(W);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),O(),O=a(l,(t=>A=t)),rt=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(A,rt),u=tt.getDerivedFromVars(H.content_alignment_vertical),I(),I=a(u,(t=>F=t)),nt=Bt(F,nt),c=tt.getDerivedFromVars(H.content_alignment_horizontal),T(),T=a(c,(t=>C=t)),it=Nt(C,it),d=tt.getDerivedFromVars(H.layout_mode),z(),z=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&&Qt()){const t=qt(k.style,Q,(null==ot?void 0:ot.style)||null);ot=t?{show_at_start:Boolean(null!==(J=k.show_at_start)&&void 0!==J&&J),show_at_end:Boolean(null!==(N=k.show_at_end)&&void 0!==N&&N),show_between:Boolean(null===(B=k.show_between)||void 0===B||B),style:t}:null}else ot=null;if(h=tt.getDerivedFromVars(H.line_separator),D(),D=a(h,(t=>x=t)),(null==x?void 0:x.style)&&"overlap"!==rt&&Qt()){const t=qt(x.style,Q,(null==at?void 0:at.style)||null);at=t?{show_at_start:Boolean(null!==(R=x.show_at_start)&&void 0!==R&&R),show_at_end:Boolean(null!==(U=x.show_at_end)&&void 0!==U&&U),show_between:Boolean(null===(L=x.show_between)||void 0===L||L),style:t}:null}else at=null;f=ot||at?function(t,e,r){const n={};return Ht(n,e,"vertical"===t),Ht(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=_t(t,st)}return b={orientation:rt,valign:nt,halign:it,wrap:p},_={gap:ot||at?Gt(rt,ot,at):void 0},V(),j(),D(),S(),z(),T(),I(),O(),et?"":`${M(Pt,"Outer").$$render(t,{cls:dt("container",Wt,b),style:_,json:H,origJson:Y,templateContext:G,layoutParams:Z,additionalPaddings:f},{},{default:()=>`${P(s,(e=>`${M(Ye,"Unknown").$$render(t,{layoutParams:st,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n\n ${ot||at?`${M(Xt,"ContainerSeparators").$$render(t,{separator:ot,lineSeparator:at,orientation:rt},{},{})}`:""}`})}`})),ee=te,re={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function ne(t,e){return"vertical"===t||"horizontal"===t?t:e}const ie=O(((t,e,n,i)=>{let o,s,l,u,c,d,p,g=r,{json:h={}}=e,{templateContext:f}=e,{origJson:m}=e,{layoutParams:y}=e;const b=v(W);let _="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&n.json&&void 0!==h&&n.json(h),void 0===e.templateContext&&n.templateContext&&void 0!==f&&n.templateContext(f),void 0===e.origJson&&n.origJson&&void 0!==m&&n.origJson(m),void 0===e.layoutParams&&n.layoutParams&&void 0!==y&&n.layoutParams(y),o=b.getDerivedFromVars(h.delimiter_style),g(),g=a(o,(t=>p=t)),_=ne(null==p?void 0:p.orientation,_),s=!((null==p?void 0:p.color)&&("transparent"===p.color||9===p.color.length&&0===p.color.indexOf("#00"))),w=Q(null==p?void 0:p.color,1,w),l="horizontal"===_?"100%":Z(1),u="horizontal"===_?Z(1):"100%",c={background:w,width:l,height:u},d={orientation:_},g(),`${M(Pt,"Outer").$$render(t,{cls:dt("separator",re,d),json:h,origJson:m,templateContext:f,layoutParams:y},{},{default:()=>s?`<span${J("class",re.separator__inner,0)}${J("style",Y(c),0)}></span>`:""})}`})),oe={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"},ae=O(((t,e,n,i)=>{let o,s,l,u,d,p,g,h,f,m,y,b,_,w,$,x,k,E,C,F,A,V,j,D,S,P,z,T,I,O,N,R,U,L,H=r,G=r,Z=r,X=r,K=r,tt=r,rt=r,nt=r,it=r,ot=r,lt=r,ut=r,ct=r,vt=r,{json:pt={}}=e,{templateContext:gt}=e,{origJson:ht}=e,{layoutParams:ft}=e;const yt=v(W);let bt,_t=0,$t="rgba(0,0,0,0.08)",xt=!1,kt="",Et="none",Ct="50% 50%",Ft="0",jt="source_in",Dt="",St="",zt=0,Mt=0,Tt=0,It="",Ot="";c((()=>{yt.removeSvgFilter(bt,jt)})),void 0===e.json&&n.json&&void 0!==pt&&n.json(pt),void 0===e.templateContext&&n.templateContext&&void 0!==gt&&n.templateContext(gt),void 0===e.origJson&&n.origJson&&void 0!==ht&&n.origJson(ht),void 0===e.layoutParams&&n.layoutParams&&void 0!==ft&&n.layoutParams(ft),o=yt.getDerivedFromVars(pt.image_url),vt(),vt=a(o,(t=>L=t)),s=yt.getDerivedFromVars(pt.gif_url),ct(),ct=a(s,(t=>U=t)),l=L||U,_t=0,l?xt=!1:(xt=!0,yt.logError(q(new Error('Missing "image_url" for "image"')))),u=yt.getDerivedFromVars(pt.width),ut(),ut=a(u,(t=>R=t)),d="wrap_content"===(null==R?void 0:R.type),p=yt.getDerivedFromVars(pt.height),lt(),lt=a(p,(t=>N=t)),g="wrap_content"===(null==N?void 0:N.type),h=yt.getDerivedFromVars(pt.preview),ot(),ot=a(h,(t=>O=t));{const t=O;kt=t?t.startsWith("data:")?`url("${et(t)}")`:`url("data:image/jpg;base64,${et(t)}")`:""}f=yt.getDerivedFromVars(pt.placeholder_color),it(),it=a(f,(t=>I=t)),$t=Q(I,1,$t),m=yt.getDerivedFromVars(pt.scale),nt(),nt=a(m,(t=>T=t)),Et=at(T)||Et,y=yt.getDerivedFromVars({content_alignment_horizontal:pt.content_alignment_horizontal,content_alignment_vertical:pt.content_alignment_vertical}),rt(),rt=a(y,(t=>z=t)),Ct=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)}(z,Ct),b=yt.getDerivedFromVars(pt.accessibility),tt(),tt=a(b,(t=>P=t)),_=(null==P?void 0:P.description)||"",w=yt.getDerivedFromVars(pt.aspect),K(),K=a(w,(t=>S=t));{const t=null==S?void 0:S.ratio;Ft=t&&At(t)?(100/Number(t)).toFixed(2):"0"}$=yt.getDerivedFromVars(pt.tint_color),X(),X=a($,(t=>D=t)),x=yt.getDerivedFromVars(pt.tint_mode),Z(),Z=a(x,(t=>j=t));{const t=D,e=t?Q(t):void 0,r=Rt(j,jt);e===bt&&r===jt||(yt.removeSvgFilter(bt,jt),Dt=e?yt.addSvgFilter(e,r):"",bt=e,jt=r)}if(k=yt.getDerivedFromVars(pt.appearance_animation),G(),G=a(k,(t=>V=t)),V&&"fade"===V.type){const t=V;St=wt(t.interpolator,"ease_in_out").replace(/_/g,"-"),Tt=mt(t.duration,300),Mt=mt(t.start_delay,0),zt=mt(t.alpha,0)}E=yt.getDerivedFromVars(pt.filters),H(),H=a(E,(t=>A=t));{let t="",e="";Array.isArray(A)&&A.length&&(t=Vt(A,yt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),It=t,Ot=e}return C={aspect:"0"!==Ft,"is-width-content":d,"is-height-content":g,loaded:!1,"before-appearance":Boolean(St)&&!0},F={"background-image":kt,"background-color":kt?void 0:$t,"background-size":Et,"clip-path":Ot||void 0,"object-fit":Et,"object-position":Ct,filter:["",It].filter(Boolean).join(" "),"--divkit-appearance-interpolator":St||void 0,"--divkit-appearance-fade-start":St?zt:void 0,"--divkit-appearance-delay":St?`${Mt}ms`:void 0,"--divkit-appearance-duration":St?`${Tt}ms`:void 0},H(),G(),Z(),X(),K(),tt(),rt(),nt(),it(),ot(),lt(),ut(),ct(),vt(),xt?"":`${M(Pt,"Outer").$$render(t,{cls:dt("image",oe,C),json:pt,origJson:ht,templateContext:gt,layoutParams:ft,customDescription:!0},{},{default:()=>C.aspect?`<span${J("class",oe["image__aspect-wrapper"],0)}${B({"padding-bottom":`${Ft}%`})}><img${J("class",oe.image__image,0)}${J("src",l,0)} loading="lazy" decoding="async"${J("style",Y(F),0)}${J("alt",_,0)}${J("aria-hidden",_?null:"true",0)}></span>`:`<img${J("class",oe.image__image,0)}${J("src",l,0)} loading="lazy" decoding="async"${J("style",Y(F),0)}${J("alt",_,0)}${J("aria-hidden",_?null:"true",0)}>`})}`})),se={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 le(t){return t>0&&t<1}function ue(t){return String(Math.ceil(1e3*t)/1e3)}function ce(t,e,r){if(t.some(le)){const e=Math.max(...t.filter(le).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 de=O(((t,e,n,i)=>{let o,s,l,u,c,d,p,g,h,f,m,y,b=r,_=r,w=r,$=r,{json:x={}}=e,{templateContext:k}=e,{origJson:E}=e,{layoutParams:C}=e;const F=v(W);let A,V,j=!1,D=1,S=[],z=[],T=[],I=[],O=0,J=!1,N="top",B="left";void 0===e.json&&n.json&&void 0!==x&&n.json(x),void 0===e.templateContext&&n.templateContext&&void 0!==k&&n.templateContext(k),void 0===e.origJson&&n.origJson&&void 0!==E&&n.origJson(E),void 0===e.layoutParams&&n.layoutParams&&void 0!==C&&n.layoutParams(C),o=x.items,(null==o?void 0:o.length)&&Array.isArray(o)?j=!1:(j=!0,F.logError(q(new Error('Incorrect or empty "items" prop for div "grid"')))),s=F.getDerivedFromVars(x.column_count),$(),$=a(s,(t=>y=t)),D=Mt(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=L(t,(t=>[...t])),w(),w=a(A,(t=>m=t))}{const t={};let e=0,r=0;S=[],z=[],T=[],I=[],J=!1,V=l.map(((n,i)=>{var o,a,s,l;const u=m[i],c=Number(u.columnSpan)||1,d=Number(u.rowSpan)||1,v={x:e,y:r,colSpan:c,rowSpan:d},p="match_parent"===(null===(o=u.width)||void 0===o?void 0:o.type)?Number(u.width.weight||1)/c:0,g="match_parent"===(null===(a=u.height)||void 0===a?void 0:a.type)?Number(u.height.weight||1)/d:0,h=1===c&&"fixed"===(null===(s=u.width)||void 0===s?void 0:s.type)&&u.width.value?Number(u.width.value)/c:0,f=1===d&&"fixed"===(null===(l=u.height)||void 0===l?void 0:l.type)&&u.height.value?Number(u.height.value)/d:0;for(let n=e;n<e+c;++n)for(let e=r;e<r+d;++e)t[n+"_"+e]?J=!0:(t[n+"_"+e]=!0,(!S[n]||S[n]<p)&&(S[n]=p),(!z[e]||z[e]<g)&&(z[e]=g),(!T[n]||T[n]<h)&&(T[n]=h),(!I[e]||I[e]<f)&&(I[e]=f));do{++e,e>=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&&(J=!0),J&&F.logError(q(new Error('Mismatching "grid" rows/columns'))),O=r}return u=F.getDerivedFromVars(x.content_alignment_vertical),_(),_=a(u,(t=>f=t)),N=Bt(f,N),c=F.getDerivedFromVars(x.content_alignment_horizontal),b(),b=a(c,(t=>h=t)),B=Nt(h,B),d={valign:N,halign:B},p={"grid-template-columns":ce(S,T,D),"grid-template-rows":ce(z,I,O)},g=j||J,b(),_(),w(),$(),g?"":`${M(Pt,"Outer").$$render(t,{cls:dt("grid",se,d),json:x,origJson:E,templateContext:k,style:p,layoutParams:C},{},{default:()=>`${P(V,(e=>`${M(Ye,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),ve=de,pe={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 ge(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 fe=O(((t,e,n,i)=>{let o,s,l,u,d,p,g,h,f,m,y,b,_,w,$,x,k,E,C,F,A,V,D,S,z,T,I,O,N,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(W);let st,lt,ut=[],ct=!1,vt=!1,pt=null,gt=!1;const ht=at.getCustomization("galleryLeftClass"),yt=at.getCustomization("galleryRightClass");let bt=!1;O=a(at.isDesktop,(t=>I=t));let wt,$t,xt,kt,Et=1,Ct="horizontal",Ft="start",At=8,Vt="",jt=[],Dt={},St=!1,zt={},Tt=0;const It=he((function(){const t=st.scrollLeft,e=st.scrollWidth,r=st.offsetWidth;ct=t>2,vt=t+r<e-2}),50);function Ot(){let t=[],e=ut[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<Et;++e){const n=ut[e].children[r];n&&t.push(n)}return t}function Jt(t,e,r="smooth"){const n="horizontal"===Ct,i=n?"offsetLeft":"offsetTop",o=n?"left":"top";st.scroll({[o]:Math.max(0,t[e][i]-At/2),behavior:r})}function Nt(t){const e=Ot(),r=st.getBoundingClientRect(),n=e.findIndex((t=>function(t,e){return"horizontal"===Ct?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}(r,t.getBoundingClientRect())));if(-1!==n)return n;const i=e.map((t=>function(t,e){return"horizontal"===Ct?e.right>t.left&&t.right>e.left:e.bottom>t.top&&t.bottom>e.top}(r,t.getBoundingClientRect()))),o=i.findIndex(Boolean);return-1!==o?"prev"===t&&2===i.filter(Boolean).length?o+1:o:"prev"===t?1:e.length-2}!rt.id||bt||(null==ot?void 0:ot.fakeElement)||at.registerInstance(rt.id,{setCurrentItem(t){const e=Ot();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Jt(e,t)},setPreviousItem(t){const e=Nt("prev"),r=Ot();let n=e-1;n<0&&(n="ring"===t?r.length-1:e),Jt(r,n)},setNextItem(t){const e="horizontal"===Ct?st.scrollLeft+st.offsetWidth===st.scrollWidth:st.scrollTop+st.offsetHeight===st.scrollHeight,r=Ot();if(e&&"ring"===t)return void Jt(r,0);const n=Nt("next");let i=n+1;i>r.length-1&&(i="ring"===t?0:n),Jt(r,i)}}),c((()=>{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)?bt=!1:(bt=!0,at.logError(q(new Error('Incorrect or empty "items" prop for div "gallery"')))),s=(!bt&&o||[]).map((t=>{let e=t,r=nt;return({templateContext:r,json:e}=at.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=I&&gt&&!bt,l?"undefined"!=typeof ResizeObserver&&(pt=new ResizeObserver((()=>{It()})),pt.observe(lt)):pt&&(pt.disconnect(),pt=null),u=at.getDerivedFromVars(rt.column_count),tt(),tt=a(u,(t=>T=t)),Et=Mt(T,Et),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,Et),p=at.getDerivedFromVars(rt.orientation),Q(),Q=a(p,(t=>z=t)),Ct=ne(z,Ct),g=at.getDerivedFromVars(rt.cross_content_alignment),K(),K=a(g,(t=>S=t)),Ft=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(S,Ft),h=at.getDerivedFromVars(rt.item_spacing),X(),X=a(h,(t=>D=t)),At=mt(D,At),wt=Z(At),f=at.getDerivedFromVars(rt.cross_spacing),G(),G=a(f,(t=>V=t)),xt=mt(V,At),$t=Z(xt),m=at.getDerivedFromVars(rt.paddings),H(),H=a(m,(t=>A=t)),Vt=ft(A,Vt),y="horizontal"===Ct?"grid-template-columns":"grid-template-rows";{let t=[];s.forEach((e=>{const r="horizontal"===Ct?"width":"height";t.push(at.getDerivedFromVars(e.json[r]))})),kt=L(t,(t=>t)),U(),U=a(kt,(t=>F=t))}jt=[],Et>1?jt.push("auto"):F.forEach((t=>{!t&&"horizontal"===Ct||"match_parent"===(null==t?void 0:t.type)?jt.push("100%"):jt.push("max-content")})),b=at.getDerivedFromVars(rt.scroll_mode),R(),R=a(b,(t=>C=t));{const t={};let e={};St=!1,(null==ot?void 0:ot.fakeElement)&&(e.fakeElement=!0),"horizontal"===Ct?e.parentVAlign=Ft:e.parentHAlign=Ft,"paging"===C&&(St=!0,e.scrollSnap="start",t["horizontal"===Ct?"scroll-padding-left":"scroll-padding-top"]=Z(At/2)),1===Et&&(e.parentLayoutOrientation=Ct),Dt=_t(t,Dt),zt=_t(e,zt)}return _=at.getDerivedFromVars(rt.restrict_parent_scroll),et(),et=a(_,(t=>N=t)),w={padding:Vt,"grid-gap":$t},$={"grid-gap":wt,[y]:ge(jt)},x={orientation:Ct,"scroll-snap":St},k=at.getDerivedFromVars(rt.default_item),B(),B=a(k,(t=>E=t)),Tt=mt(E,Tt),B(),R(),U(),H(),G(),X(),K(),Q(),tt(),O(),et(),"\n\n"+(bt?"":`${M(Pt,"Outer").$$render(t,{cls:dt("gallery",pe,x),json:rt,origJson:it,templateContext:nt,layoutParams:ot,customPaddings:!0,customActions:"gallery"},{},{default:()=>`<div class="${j(pe.gallery__scroller,!0)+" "+j(N?"divkit-aa145":"",!0)}"${J("style",Y(Dt),0)}${J("this",st,0)}><div${J("class",pe["gallery__items-grid"],0)}${J("style",Y(w),0)}${J("this",lt,0)}>${P(d,((e,r)=>`<div${J("class",pe.gallery__items,0)}${J("style",Y($),0)}${J("this",ut[r],0)}>${P(e,(e=>`${M(Ye,"Unknown").$$render(t,{layoutParams:zt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===Ct?`${ct&&l?`<div${J("class",ht||`${pe.gallery__arrow} ${pe.gallery__arrow_left}`,0)}>${ht?"":`<svg${J("class",pe["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${J("class",pe["gallery__arrow-icon-path"],0)} d="m10 16 8.3 8 1.03-1-4-6-.7-1 .7-1 4-6-1.03-1z"></path></svg>`}</div>`:""}\n ${vt&&l?`<div${J("class",yt||`${pe.gallery__arrow} ${pe.gallery__arrow_right}`,0)}>${yt?"":`<svg${J("class",pe["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${J("class",pe["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>`:""}`:""}`})}`)})),me=fe,ye={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=O(((t,e,n,i)=>{let o,s,l,u,d,p,g,h,f,m,y,_,w,$,x,k,E,C,F,A,V=r,D=r,S=r,z=r,T=r,I=r,O=r,N=r;var R;let{json:U={}}=e,{templateContext:L}=e,{origJson:H}=e,{layoutParams:G}=e;const X=v(W),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,ut=12,ct="",vt="",pt="",gt="",mt="",yt="",bt="",wt="",$t="",xt="",Et=!1,Ct=!1,Vt=lt,jt=[],Dt=[];async function St(t,e=!1){if(Vt=lt,lt=t,Et||(Et=!0,et.style.height=Z(et.clientHeight),rt.style.transform=`translate3d(${100*-Vt}%,0,0)`),Ct=!0,async function(t){await b(),rt.style.transform=`translate3d(${t}%,0,0)`}(100*-lt),function(t=!1){const e=t?Math.max(0,lt-1):Math.min(lt,Vt),r=t?Math.min(o.length-1,lt+1):Math.max(lt,Vt);jt=jt.map(((t,n)=>t||n>=e&&n<=r)),Dt=Dt.map(((t,n)=>n>=e&&n<=r))}(),async function(){await b();const t=document.getElementById(`${K}-panel-${lt}`);t&&(et.style.height=Z(t.offsetHeight))}(),Tt&&clearTimeout(Tt),Tt=window.setTimeout((()=>{Dt=o.map(((t,e)=>e===lt))}),400),zt=-lt*et.clientWidth,e){await b();const t=tt.querySelector(`.${ye.tabs__item_selected}`);t&&t.focus()}}let zt,Tt=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)}}),c((()=>{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!==L&&n.templateContext(L),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),O(),O=a(s,(t=>F=t)),l=X.getDerivedFromVars(U.height),I(),I=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=_t(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),u=X.getDerivedFromVars(U.tab_title_style),T(),T=a(u,(t=>E=t)),d=E||{},ut=Mt(d.font_size,ut),d.font_size||d.paddings){const t=d.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/ut*10,right:(Number(t.right)||0)/ut*10,bottom:(Number(t.bottom)||0)/ut*10,left:(Number(t.left)||0)/ut*10};ct=ft(e,ct)}{const t=d.line_height;void 0!==t&&At(t)&&(vt=Z(t/ut*10))}{const t=d.letter_spacing;void 0!==t&&ht(t)&&(pt=Z(t/ut*10))}if(d.corner_radius||d.corners_radius||d.font_size){const t=null!==(R=d.corner_radius)&&void 0!==R?R:1e3;d.corners_radius?gt=function(t,e,r,n){const i=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<i.length;++t)if(i[t]&&!ht(i[t]))return n;return kt(t,e,r)}(d.corners_radius,t,ut,gt):ht(t)&&(gt=Z(t/ut*10))}return at=It(d.active_font_weight||d.font_weight,at),st=It(d.inactive_font_weight||d.font_weight,st),mt=Q(d.active_text_color,1,mt),yt=Q(d.inactive_text_color,1,yt),bt=Q(d.active_background_color,1,bt),wt=Q(d.inactive_background_color,1,wt),p=X.getDerivedFromVars(U.has_separator),z(),z=a(p,(t=>k=t)),g=X.getDerivedFromVars(U.separator_color),S(),S=a(g,(t=>x=t)),h=X.getDerivedFromVars(U.separator_paddings),D(),D=a(h,(t=>$=t)),k&&(x&&($t=Q(x,1,$t)),$&&(xt=ft($,xt))),f={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),_=X.getDerivedFromVars(U.restrict_parent_scroll),N(),N=a(_,(t=>A=t)),nt||(jt=o.map(((t,e)=>e===lt)),Dt=o.map(((t,e)=>e===lt))),V(),D(),S(),z(),T(),I(),O(),N(),nt?"":`${M(Pt,"Outer").$$render(t,{cls:dt("tabs",ye,{}),json:U,origJson:H,templateContext:L,layoutParams:G,customActions:"tabs"},{},{default:()=>`<div class="${j(ye.tabs__list,!0)+" "+j(A?"divkit-aa145":"",!0)}" role="tablist"${B({"--divkit-tabs-font-size":Z(ut),"--divkit-tabs-paddings":ct,"--divkit-tabs-line-height":vt,"--divkit-tabs-letter-spacing":pt,"--divkit-tabs-active-font-weight":at||"","--divkit-tabs-inactive-font-weight":st||"","--divkit-tabs-active-text-color":mt,"--divkit-tabs-inactive-text-color":yt,"--divkit-tabs-active-background-color":bt,"--divkit-tabs-inactive-background-color":wt,"--divkit-tabs-border-radius":gt})}${J("this",tt,0)}>${P(o,((e,r)=>{let n=r===lt;return`\n\n ${M(Ft,"Actionable").$$render(t,{cls:dt("tabs__item",ye,{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${J("class",ye.tabs__separator,0)}${J("style",Y(f),0)}></div>`:""}\n <div class="${j(ye.tabs__panels,!0)+" "+j(A?"divkit-aa145":"",!0)}"${J("this",et,0)}><div${J("class",dt("tabs__swiper",ye,{inited:Et,animated:Ct}),0)}${J("this",rt,0)}>${P(o,((e,r)=>`<div${J("class",dt("tabs__panel",ye,{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(Ye,"Unknown").$$render(t,{div:e.div,templateContext:L,layoutParams:it},{},{})}`:""}\n </div>`))}</div></div>`})}`})),_e=be;function we(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)}}we([.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]),we([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 $e=O(((t,e,r,n)=>{let i,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const u=v(W),p=v(vt);let g=new Map,h=new Set,f=!1,m=null,y=[],_=[],w=[],$=[];const x=o.div_id||o.id;let k;x?(null==l?void 0:l.fakeElement)||(p.registerInstance(x,{async setState(t){if(k===t)return;u.setRunning("stateChange",!0),new Set(h),y.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),y=[],$.forEach((t=>{g.set(t.id,t.node.getBoundingClientRect())})),_=[],w=[],$=[];const e=i.find((e=>e.state_id===t))||null;e?(k=t,E=e):u.logError(q(new Error("Cannot find state with id"),{additional:{stateId:t}})),await b()},getChild(t){if(m&&m.has(t))return m.get(t);u.logError(q(new Error("Missing state block with id"),{additional:{id:t}}))}}),d(vt,{registerInstance(t,e){m||(m=new Map),m.has(t)?u.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 _.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return w.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,n){const i=t.id;if(!i)return Promise.resolve();const o={id:i,json:t,templateContext:e,transitions:r,node:n};return $.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&g.has(t),registerChild(t){h.add(t)},unregisterChild(t){h.delete(t)}})):(f=!0,u.logError(q(new Error('Missing "id" prop for div "state"'))));let E=null;const C=u.getJsonWithVars(o.default_state_id);let F=!1;return c((()=>{x&&!(null==l?void 0:l.fakeElement)&&p.unregisterInstance(x)})),void 0===e.json&&r.json&&void 0!==o&&r.json(o),void 0===e.templateContext&&r.templateContext&&void 0!==a&&r.templateContext(a),void 0===e.origJson&&r.origJson&&void 0!==s&&r.origJson(s),void 0===e.layoutParams&&r.layoutParams&&void 0!==l&&r.layoutParams(l),o&&(h=new Set),i=o.states||[],(null==i?void 0:i.length)?f=!1:(f=!0,u.logError(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||u.logError(q(new Error("Cannot find state for default_state_id"),{additional:{selectedId:k}}))):(E=t[0],k=E.state_id)))}(i),f?"":`${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(Ye,"Unknown").$$render(t,{div:E.div,templateContext:a},{},{})}`:""}\n <div${J("class","divkit-adaae",0)} aria-hidden="true"${J("this",undefined,0)}>${P(y,(e=>"direction"in e?`<div${J("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${J("class","divkit-e08c6",0)}>${M(Ye,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`:`<div${J("class","divkit-eb860",0)}><div${J("class","divkit-e08c6",0)}>${M(Ye,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`))}</div>`}})}`})),xe={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f"},ke=O(((t,e,n,i)=>{let o,s,l,u,d,p,g,h,f,m,y,b,_,w,$,x,k,E=r,C=r,F=r,A=r,V=r,D=r;var S,z,T,I,O,N,B;let{json:R={}}=e,{templateContext:U}=e,{origJson:L}=e,{layoutParams:H}=e;const G=v(W),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)}}),c((()=>{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!==L&&n.origJson(L),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=>_=t)),_?"percentage"!==_.type&&"fixed"!==_.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=ne(x,it),u=G.getDerivedFromVars(R.item_spacing),A(),A=a(u,(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=ft(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==_?void 0:_.type)){const t=X("horizontal"===it?((null===(z=R.paddings)||void 0===z?void 0:z.left)||0)+((null===(T=R.paddings)||void 0===T?void 0:T.right)||0):((null===(I=R.paddings)||void 0===I?void 0:I.top)||0)+((null===(O=R.paddings)||void 0===O?void 0:O.bottom)||0)),e=null===(N=_.neighbour_page_width)||void 0===N?void 0:N.value;st=e?`calc(100% + ${t} - 2 * ${X(e)} - 2 * ${ot})`:"100%"}else if("percentage"===(null==_?void 0:_.type)){const t=null===(B=_.page_width)||void 0===B?void 0:B.value;st=`${Number(t)}%`}return h={"grid-gap":ot,padding:at,[g]:st},f={orientation:it},m=tt||nt,y=G.getStore("pagers"),E(),E=a(y,(t=>b=t)),function(t,e){const r=R.id;if(r){const o=new Map(b);n=y,b=o.set(r,{instId:K,size:t,currentItem:e,scrollToPagerItem:lt}),i=b,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:dt("pager",xe,f),json:R,origJson:L,templateContext:U,layoutParams:H,customPaddings:!0},{},{default:()=>`<div class="${j(xe.pager__items,!0)+" "+j(k?"divkit-aa145":"",!0)}"${J("style",Y(h),0)}${J("this",Q,0)}>${P(o,(e=>`<div${J("class",xe.pager__item,0)}>${M(Ye,"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=ke,Ce={indicator:"divkit-d8e3f",indicator__scroller:"divkit-b5db0",indicator__items:"divkit-d5d94",indicator__item:"divkit-f6629",indicator__item_active:"divkit-b39cd"},Fe=O(((t,e,n,i)=>{let o,s,l,u,c,d,p,g,h,f,m,y,_=r,w=r,$=r,x=r,k=r,E=r;var C;let{json:F={}}=e,{templateContext:A}=e,{origJson:V}=e,{layoutParams:D}=e;const S=v(W);let z,T,I,O=5,N=10,R=10,U=5,L="#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&&(N=mt(y.item_width.value,N)),y.item_height&&(R=mt(y.item_height.value,R)),y.corner_radius&&(U=mt(y.corner_radius.value,U))):"circle"===y.type&&(O=mt(null===(C=y.radius)||void 0===C?void 0:C.value,O),N=R=U=2*O)),s=S.getDerivedFromVars(F.active_item_color),k(),k=a(s,(t=>m=t)),L=Q(m,1,L),l=S.getDerivedFromVars(F.inactive_item_color),x(),x=a(l,(t=>f=t)),q=Q(f,1,q),u=S.getDerivedFromVars(F.space_between_centers),$(),$=a(u,(t=>h=t)),h&&(H=mt(h.value,H)),c=S.getDerivedFromVars(F.active_item_size),w(),w=a(c,(t=>g=t)),G=Mt(g,G),d=S.getStore("pagers"),_(),_=a(d,(t=>p=t)),async function(t){if(F.pager_id&&t.has(F.pager_id)){I=t.get(F.pager_id),await b();const e=T.children[I.currentItem].offsetLeft;z.scroll({left:e-z.clientWidth/2,behavior:"smooth"})}}(p),_(),w(),$(),x(),k(),E(),`${M(Pt,"Outer").$$render(t,{cls:dt("indicator",Ce,{}),json:F,origJson:V,templateContext:A,layoutParams:D},{},{default:()=>`<div${J("class",Ce.indicator__scroller,0)}${J("this",z,0)}><div${J("class",Ce.indicator__items,0)} role="tablist"${B({margin:`0 ${Z((G-1)*N/2)}`,"--divkit-indicator-width":Z(N),"--divkit-indicator-height":Z(R),"--divkit-indicator-border-radius":Z(U),"--divkit-indicator-active-color":L,"--divkit-indicator-inactive-color":q,"--divkit-indicator-active-scale":G,"--divkit-indicator-margin":`0 ${Z((H-N)/2)}`})}${J("this",T,0)}>${I?`${P(Array(I.size),((t,e)=>{let r=e===I.currentItem;return`\n <div class="${j(dt("indicator__item",Ce,{active:r}),!0)+" "+j("divkit-bd259",!0)}" role="tab" id="${j(I.instId,!0)+"-tab-"+j(e,!0)}" aria-controls="${j(I.instId,!0)+"-panel-"+j(e,!0)}"${J("aria-selected",r?"true":"false",0)}${J("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),Ae=Fe,Ve={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 je(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&Q(t.text_color)||"#000",i=Tt(t.font_weight);if(At(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 De(t,e,r){return Math.max(e,Math.min(r,t))}const Se=-2147483648,Pe=Number.MAX_VALUE,ze=Number.MIN_VALUE,Me="string",Te="integer",Ie="number",Oe="boolean",Je="color",Ne="datetime";class Be{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 Re={string:class extends Be{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends Be{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 Be{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 Be{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 Be{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 Be{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function Ue(t,e,r){if(!(e in Re))throw new Error("Unsupported variable type");return new Re[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 We=O(((t,e,n,i)=>{let o,s,l,u,c,d,p,g,h,f,m,y,b,_,w,$,x,k,E,C,F,A,V,D,S,z,T,I,O,N,R,U,L,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,ut=r;var ct,vt,pt,gt;let{json:ft={}}=e,{templateContext:mt}=e,{origJson:yt}=e,{layoutParams:bt}=e;const _t={width:10,height:10,borderRadius:5,background:"#000"},wt=["rounded_rectangle","circle"],xt=["rounded_rectangle"],kt=v(W),Et=v(Ct);let Ft=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")||Ue("temp","integer",0),(t=>L=t)),U=a(jt&&kt.getVariable(jt,"integer")||Ue("temp","integer",0),(t=>R=t));let Dt,St,zt,Mt=De(L||0,Ft,At),Tt=De(R||0,Ft,At),It=_t,Ot=It,Jt=_t,Nt=_t,Bt=null,Rt=null,Ut=zt,Lt="",Wt="",Ht=!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!==bt&&n.layoutParams(bt),o=kt.getDerivedFromVars(ft.min_value),ut(),ut=a(o,(t=>Y=t)),s=kt.getDerivedFromVars(ft.max_value),lt(),lt=a(s,(t=>G=t)),Ft=$t(Y,Ft),At=$t(G,At);{const t=De(L||0,Ft,At);t!==Mt&&(Mt=t)}{const t=De(R||0,Ft,At);t!==Tt&&(Tt=t)}l=kt.getDerivedFromVars(ft.thumb_style),st(),st=a(l,(t=>N=t)),It=qt(N,wt,It),u=kt.getDerivedFromVars(ft.thumb_secondary_style),at(),at=a(u,(t=>O=t)),Ot=qt(O,wt,It),c=kt.getDerivedFromVars(ft.track_inactive_style),ot(),ot=a(c,(t=>I=t)),Jt=qt(I,xt,Jt),d=kt.getDerivedFromVars(ft.track_active_style),it(),it=a(d,(t=>T=t)),Nt=qt(T,xt,Nt),p=kt.getDerivedFromVars(ft.tick_mark_active_style),nt(),nt=a(p,(t=>z=t));{let t=qt(z,wt,_t);t!==_t&&(Bt=t)}Dt=Bt?jt?Le(Math.min(Mt,Tt),Math.max(Mt,Tt)+1,Ft,At,!0):Le(Ft,Mt,Ft,At,!0):[],g=kt.getDerivedFromVars(ft.tick_mark_inactive_style),rt(),rt=a(g,(t=>S=t));{let t=qt(S,wt,_t);t!==_t&&(Rt=t)}St=Rt?jt?Le(Math.min(Mt,Tt),Math.max(Mt,Tt)+1,Ft,At,!1):Le(Mt+1,At+1,Ft,At,!0):[],h=kt.getDerivedFromVars(ft.thumb_text_style),et(),et=a(h,(t=>D=t)),zt=je(D,zt),f=kt.getDerivedFromVars(ft.thumb_secondary_text_style),tt(),tt=a(f,(t=>V=t)),Ut=je(V,zt),m=kt.getDerivedFromVars(ft.accessibility),Q(),Q=a(m,(t=>A=t)),(null==A?void 0:A.description)?Lt=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)?Wt=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):It===_t?(kt.logError(q(new Error('Missing "thumb_style" in slider'))),t=!0):Nt===_t?(kt.logError(q(new Error('Missing "track_active_style" in slider'))),t=!0):Jt===_t&&(kt.logError(q(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==Ht&&(Ht=t)}return b=Z(Math.max(...[It.width,Ot.width,0].filter(ht))),_=Z(Math.max(...[It.height,Ot.height,0].filter(ht))),w=(Mt-Ft)/(At-Ft),$=jt?(Tt-Ft)/(At-Ft):void 0,x=void 0!==$?Math.abs($-w):w,k=void 0!==$?Math.min($,w):0,E={"--divkit-slider-thumb-width":Z(It.width),"--divkit-slider-thumb-height":Z(It.height),"--divkit-slider-thumb-secondary-width":Z(Ot.width),"--divkit-slider-thumb-secondary-height":Z(Ot.height),"--divkit-slider-text-offset-x":(null===(ct=null==zt?void 0:zt.offset)||void 0===ct?void 0:ct.x)?X(zt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(vt=null==zt?void 0:zt.offset)||void 0===vt?void 0:vt.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":b,"--divkit-slider-max-thumb-height":_,"--divkit-slider-track-part":w,"--divkit-slider-track-secondary-part":$},C={},K(),Q(),tt(),et(),rt(),nt(),it(),ot(),at(),st(),U(),H(),lt(),ut(),"\n\n"+(Ht?"":`${M(Pt,"Outer").$$render(t,{cls:dt("slider",Ve,C),style:E,customDescription:!0,customActions:"slider",json:ft,origJson:yt,templateContext:mt,layoutParams:bt},{},{default:()=>{var t,e,r,n,i,o;return`<div${J("class",Ve["slider__tracks-wrapper"],0)}><div${J("class",Ve["slider__tracks-inner"],0)}${J("this",undefined,0)}><div${J("class",Ve.slider__track,0)}${B({height:Z(Jt.height),"border-radius":Z(Jt.borderRadius),background:Jt.background,"box-shadow":Jt.boxShadow||""})}></div>\n <div${J("class",Ve["slider__active-track"],0)}${B({left:(100*k).toFixed(2)+"%",width:(100*x).toFixed(2)+"%",height:Z(Nt.height),"border-radius":Z(Nt.borderRadius),background:Nt.background,"box-shadow":Nt.boxShadow||""})}></div>\n ${P(Dt,(t=>`<div class="${j(Ve.slider__tick,!0)+" "+j(Ve.slider__tick_active,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n ${P(St,(t=>`<div class="${j(Ve.slider__tick,!0)+" "+j(Ve.slider__tick_inactive,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n <div${J("class",Ve.slider__thumb,0)}${B({"border-radius":Z(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${zt?`<div${J("class",Ve["slider__thumb-text"],0)}><div${J("class",Ve["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(Ve.slider__thumb,!0)+" "+j(Ve.slider__thumb_secondary,!0)}"${B({"border-radius":Z(Ot.borderRadius),background:Ot.background,"box-shadow":Ot.boxShadow||""})}>${Ut?`<div class="${j(Ve["slider__thumb-text"],!0)+" "+j(Ve["slider__thumb-text_secondary"],!0)}"><div${J("class",Ve["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(Tt)}</div></div>`:""}</div>`:""}\n <input type="range"${J("class",Ve.slider__input,0)}${J("min",Ft,0)}${J("max",At,0)} step="1"${J("value",Mt,0)}${J("aria-label",Lt,0)}>\n ${jt?`<input type="range"${J("class",`${Ve.slider__input} ${Ve.slider__input_secondary}`,0)}${J("min",Ft,0)}${J("max",At,0)} step="1"${J("value",Tt,0)}${J("aria-label",Wt,0)}>`:""}</div></div>`}})}`)})),qe={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"},He={text:Lt,container:ee,separator:ie,image:ae,gif:ae,grid:ve,gallery:me,tabs:_e,state:$e,pager:Ee,indicator:Ae,slider:We,input:O(((t,e,n,i)=>{let o,s,l,u,c,d,p,g,h,f,m,y,b,_,w,$,x,k,E,C,F,A,V,D,S,P,z,T,I,O,N,B,R=r,U=r,{json:L={}}=e,{templateContext:H}=e,{origJson:G}=e,{layoutParams:Y}=e;const K=v(W);let tt;const et=K.getJsonWithVars(L.text_variable);let rt=!1;et||(rt=!0,K.logError(q(new Error('Missing "text_variable" in "input"')))),O=a(et&&K.getVariable(et,"string")||Ue("temp","string",""),(t=>I=t));let nt="";T=a(K.getDerivedFromVars(L.hint_text),(t=>z=t)),P=a(K.getDerivedFromVars(L.hint_color),(t=>S=t));let it="";D=a(K.getDerivedFromVars(L.font_size),(t=>V=t));let ot,at,st=12;A=a(K.getDerivedFromVars(L.font_weight),(t=>F=t)),C=a(K.getDerivedFromVars(L.line_height),(t=>E=t)),k=a(K.getDerivedFromVars(L.letter_spacing),(t=>x=t));let lt="";$=a(K.getDerivedFromVars(L.text_color),(t=>w=t));let ut="#000";_=a(K.getDerivedFromVars(L.highlight_color),(t=>b=t));let ct="";y=a(K.getDerivedFromVars(L.keyboard_type),(t=>m=t));const vt={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let pt="multi_line_text",ht="text";f=a(K.getDerivedFromVars(L.max_visible_lines),(t=>h=t));let ft="",yt="";B=a(K.getDerivedFromVars(L.select_all_on_focus),(t=>N=t)),void 0===e.json&&n.json&&void 0!==L&&n.json(L),void 0===e.templateContext&&n.templateContext&&void 0!==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=I,o=z,it=Q(S,1,it),st=Mt(V,st),ot=It(F,ot);{const t=E;At(t)&&(at=t/st)}return gt(x)&&(lt=Z(x/st*10)),ut=Q(w,1,ut),ct=Q(b,1,ct),m&&m in vt&&(ht=vt[m],pt=m),s="multi_line_text"===pt,l=K.getDerivedFromVars(L.paddings),U(),U=a(l,(t=>g=t)),At(h)&&(ft=`calc(${h*(at||1.25)+"em"} + ${X(mt(null==g?void 0:g.top,0)+mt(null==g?void 0:g.bottom,0))})`),u=K.getDerivedFromVars(L.accessibility),R(),R=a(u,(t=>p=t)),(null==p?void 0:p.description)?yt=p.description:K.logError(q(new Error('Missing accessibility "description" for input'),{level:"warn"})),c={"highlight-color":Boolean(ct),"vertical-overflow":!1,multiline:s},d={"--divkit-input-hint-color":it,"--divkit-input-highlight-color":ct,"font-size":Z(st),"font-weight":ot,"line-height":at,"letter-spacing":lt,color:ut,"max-height":ft},R(),U(),f(),y(),_(),$(),k(),C(),A(),D(),P(),T(),O(),B(),rt?"":`${M(Pt,"Outer").$$render(t,{cls:dt("input",qe,c),style:d,customDescription:!0,customActions:"input",json:L,origJson:G,templateContext:H,layoutParams:Y},{},{default:()=>`<span${J("class",qe.input__wrapper,0)}><span${J("class",qe.input__holder,0)} aria-hidden="true"${J("this",undefined,0)}>\n ${j(nt)}${nt.endsWith("\n")||!nt?"​":""}</span>\n ${s?`<textarea${J("class",qe.input__input,0)} autocomplete="off" autocapitalize="off"${J("aria-label",yt,0)}${J("placeholder",o,0)}${J("this",tt,0)}>${j(nt,!0)}</textarea>`:`<input${J("type",ht,0)}${J("class",qe.input__input,0)} autocomplete="off" autocapitalize="off"${J("aria-label",yt,0)}${J("placeholder",o,0)}${J("value",nt,0)}${J("this",tt,0)}>`}</span>`})}`}))},Ge=O(((t,e,r,n)=>{let{div:i}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=v(W);let u,c,d;if(void 0===e.div&&r.div&&void 0!==i&&r.div(i),void 0===e.templateContext&&r.templateContext&&void 0!==o&&r.templateContext(o),void 0===e.origJson&&r.origJson&&void 0!==a&&r.origJson(a),void 0===e.layoutParams&&r.layoutParams&&void 0!==s&&r.layoutParams(s),u=i,c=o,d=u&&He[u.type]||void 0,!d&&(({templateContext:c,json:u}=l.processTemplate(u,c)),d=u&&He[u.type]||void 0,!d)){let t;t=(null==u?void 0:u.type)&&l.hasTemplate(u.type)?"Recursive template":"Unknown component",l.logError(q(new Error(t),{additional:{component:(null==u?void 0:u.type)||"<missing>"}}))}return d?`${M(d||z,"svelte:component").$$render(t,{json:u,templateContext:c,layoutParams:s,origJson:a||i},{},{})}`:""})),Ye=Ge,Ze=O(((t,e,r,n)=>{let{svgFiltersMap:i}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==i&&r.svgFiltersMap(i),Object.keys(i).length?`<svg${J("class","divkit-dc22b",0)} aria-hidden="true"><defs>${P([...Object.keys(i)],(t=>{let[e,r]=t.split(":");return`\n <filter${J("id",i[t],0)}><feFlood${J("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${J("operator",r.split("_")[1],0)}></feComposite>`:"multiply"===r?'<feComposite in2="SourceGraphic" operator="arithmetic" k1="1" k2="0" k3="0" k4="0"></feComposite>':`<feBlend in2="SourceGraphic"${J("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function Xe(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 Ke(){}function Qe(t){return{subscribe:e=>(e(t),Ke)}}function tr(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function er(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function rr(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 nr(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 ir(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function or(t,e,r,n){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,or.prototype),i.expected=e,i.found=r,i.location=n,i.name="SyntaxError",i}function ar(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function sr(t,e){var r,n={},i=(e=void 0!==e?e:{}).grammarSource,o={start:Vt,JsonStringContents:function(){var t,e,r;for(t=ft,e=[],r=jt();r!==n;)e.push(r),r=jt();return mt=t,e=ht(e)}},a=Vt,s="@{",l="}",u="@{}",c="\\",d="||",v="&&",p="==",g="!=",h=">=",f="<=",m="+",y="-",b="true",_="false",w=/^[^}]/,$=/^[^'}]/,x=/^[0-9]/,k=/^[a-zA-Z_0-9.]/,E=/^[a-zA-Z_]/,C=/^[ \t\r\n]/,F=xt("@{",!1),A=xt("}",!1),V=xt("@{}",!1),j=xt("\\",!1),D={type:"any"},S=kt(["}"],!0,!1),P=xt("?",!1),z=xt(":",!1),M=xt("||",!1),T=xt("&&",!1),I=xt("==",!1),O=xt("!=",!1),J=xt(">=",!1),N=xt(">",!1),B=xt("<=",!1),R=xt("<",!1),U=xt("+",!1),L=xt("-",!1),W=xt("/",!1),q=xt("*",!1),H=xt("%",!1),G=xt("!",!1),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),ut=xt("false",!1),ct=kt([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),dt=Et("identifier"),vt=kt([["a","z"],["A","Z"],"_"],!1,!1),pt=Et("whitespace"),gt=kt([" ","\t","\r","\n"],!1,!1),ht=function(t){return rr(t)},ft=0,mt=0,yt=[{line:1,column:1}],bt=0,_t=[],wt=0;if("startRule"in e){if(!(e.startRule in o))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=o[e.startRule]}function $t(){return t.substring(mt,ft)}function xt(t,e){return{type:"literal",text:t,ignoreCase:e}}function kt(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function Et(t){return{type:"other",description:t}}function Ct(e){var r,n=yt[e];if(n)return n;for(r=e-1;!yt[r];)r--;for(n={line:(n=yt[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return yt[e]=n,n}function Ft(t,e){var r=Ct(t),n=Ct(e);return{source:i,start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:n.line,column:n.column}}}function At(t){ft<bt||(ft>bt&&(bt=ft,_t=[]),_t.push(t))}function Vt(){var t,e;return t=ft,Ut(),(e=Dt())!==n?(Ut(),mt=t,t=e):(ft=t,t=n),t}function jt(){var e,r,i,o,a;if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n?(i=Ut(),(o=Dt())!==n?(Ut(),125===t.charCodeAt(ft)?(a=l,ft++):(a=n,0===wt&&At(A)),a!==n?(mt=e,e=o):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,t.substr(ft,3)===u?(r=u,ft+=3):(r=n,0===wt&&At(V)),r!==n&&(mt=e,r=""),(e=r)===n&&(e=ft,r=ft,wt++,92===t.charCodeAt(ft)?(i=c,ft++):(i=n,0===wt&&At(j)),i===n&&(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F))),wt--,i===n?r=void 0:(ft=r,r=n),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=$t()):(ft=e,e=n)):(ft=e,e=n),e===n))){if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n){if(i=[],w.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(S)),o!==n)for(;o!==n;)i.push(o),w.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(S));else i=n;i!==n?(125===t.charCodeAt(ft)?(o=l,ft++):(o=n,0===wt&&At(A)),o!==n?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ft=e,e=n)):(ft=e,e=n)}else ft=e,e=n;e===n&&(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F)),i!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=ir(i)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Dt(){var e,r,i,o,a,s;return e=ft,(r=St())!==n?(Ut(),63===t.charCodeAt(ft)?(i="?",ft++):(i=n,0===wt&&At(P)),i!==n?(Ut(),(o=Dt())!==n?(Ut(),58===t.charCodeAt(ft)?(a=":",ft++):(a=n,0===wt&&At(z)),a!==n?(Ut(),(s=Dt())!==n?(mt=e,e={type:"ConditionalExpression",test:r,consequent:o,alternate:s}):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=St()),e}function St(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Pt())!==n){for(i=[],o=ft,a=Ut(),t.substr(ft,2)===d?(s=d,ft+=2):(s=n,0===wt&&At(M)),s!==n?(l=Ut(),(u=Pt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Ut(),t.substr(ft,2)===d?(s=d,ft+=2):(s=n,0===wt&&At(M)),s!==n?(l=Ut(),(u=Pt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=er(r,i)}else ft=e,e=n;return e}function Pt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=zt())!==n){for(i=[],o=ft,a=Ut(),t.substr(ft,2)===v?(s=v,ft+=2):(s=n,0===wt&&At(T)),s!==n?(l=Ut(),(u=zt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Ut(),t.substr(ft,2)===v?(s=v,ft+=2):(s=n,0===wt&&At(T)),s!==n?(l=Ut(),(u=zt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=er(r,i)}else ft=e,e=n;return e}function zt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Mt())!==n){for(i=[],o=ft,a=Ut(),t.substr(ft,2)===p?(s=p,ft+=2):(s=n,0===wt&&At(I)),s===n&&(t.substr(ft,2)===g?(s=g,ft+=2):(s=n,0===wt&&At(O))),s!==n?(l=Ut(),(u=Mt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Ut(),t.substr(ft,2)===p?(s=p,ft+=2):(s=n,0===wt&&At(I)),s===n&&(t.substr(ft,2)===g?(s=g,ft+=2):(s=n,0===wt&&At(O))),s!==n?(l=Ut(),(u=Mt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=tr(r,i)}else ft=e,e=n;return e}function Mt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Tt())!==n){for(i=[],o=ft,a=Ut(),t.substr(ft,2)===h?(s=h,ft+=2):(s=n,0===wt&&At(J)),s===n&&(62===t.charCodeAt(ft)?(s=">",ft++):(s=n,0===wt&&At(N)),s===n&&(t.substr(ft,2)===f?(s=f,ft+=2):(s=n,0===wt&&At(B)),s===n&&(60===t.charCodeAt(ft)?(s="<",ft++):(s=n,0===wt&&At(R))))),s!==n?(l=Ut(),(u=Tt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Ut(),t.substr(ft,2)===h?(s=h,ft+=2):(s=n,0===wt&&At(J)),s===n&&(62===t.charCodeAt(ft)?(s=">",ft++):(s=n,0===wt&&At(N)),s===n&&(t.substr(ft,2)===f?(s=f,ft+=2):(s=n,0===wt&&At(B)),s===n&&(60===t.charCodeAt(ft)?(s="<",ft++):(s=n,0===wt&&At(R))))),s!==n?(l=Ut(),(u=Tt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=tr(r,i)}else ft=e,e=n;return e}function Tt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=It())!==n){for(i=[],o=ft,a=Ut(),43===t.charCodeAt(ft)?(s=m,ft++):(s=n,0===wt&&At(U)),s===n&&(45===t.charCodeAt(ft)?(s=y,ft++):(s=n,0===wt&&At(L))),s!==n?(l=Ut(),(u=It())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Ut(),43===t.charCodeAt(ft)?(s=m,ft++):(s=n,0===wt&&At(U)),s===n&&(45===t.charCodeAt(ft)?(s=y,ft++):(s=n,0===wt&&At(L))),s!==n?(l=Ut(),(u=It())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=tr(r,i)}else ft=e,e=n;return e}function It(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Ot())!==n){for(i=[],o=ft,a=Ut(),47===t.charCodeAt(ft)?(s="/",ft++):(s=n,0===wt&&At(W)),s===n&&(42===t.charCodeAt(ft)?(s="*",ft++):(s=n,0===wt&&At(q)),s===n&&(37===t.charCodeAt(ft)?(s="%",ft++):(s=n,0===wt&&At(H)))),s!==n?(l=Ut(),(u=Ot())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Ut(),47===t.charCodeAt(ft)?(s="/",ft++):(s=n,0===wt&&At(W)),s===n&&(42===t.charCodeAt(ft)?(s="*",ft++):(s=n,0===wt&&At(q)),s===n&&(37===t.charCodeAt(ft)?(s="%",ft++):(s=n,0===wt&&At(H)))),s!==n?(l=Ut(),(u=Ot())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=tr(r,i)}else ft=e,e=n;return e}function Ot(){var e,r,i;return(e=Bt())===n&&(e=Nt())===n&&(e=ft,33===t.charCodeAt(ft)?(r="!",ft++):(r=n,0===wt&&At(G)),r===n&&(43===t.charCodeAt(ft)?(r=m,ft++):(r=n,0===wt&&At(U)),r===n&&(45===t.charCodeAt(ft)?(r=y,ft++):(r=n,0===wt&&At(L)))),r!==n?(Ut(),(i=Ot())!==n?(mt=e,e={type:"UnaryExpression",operator:r,argument:i}):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=function(){var e,r,i,o,a;return e=ft,(r=Rt())!==n?(Ut(),40===t.charCodeAt(ft)?(i="(",ft++):(i=n,0===wt&&At(Y)),i!==n?(Ut(),o=function(){var e,r,i,o,a,s,l;if(e=ft,(r=Dt())!==n){for(i=[],o=ft,Ut(),44===t.charCodeAt(ft)?(a=",",ft++):(a=n,0===wt&&At(X)),a!==n?(Ut(),(s=Dt())!==n?o=s:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,Ut(),44===t.charCodeAt(ft)?(a=",",ft++):(a=n,0===wt&&At(X)),a!==n?(Ut(),(s=Dt())!==n?o=s:(ft=o,o=n)):(ft=o,o=n);mt=e,l=i,e=[r,...l]}else ft=e,e=n;return e===n&&(e=Ut()),e}(),o!==n?(Ut(),41===t.charCodeAt(ft)?(a=")",ft++):(a=n,0===wt&&At(Z)),a!==n?(mt=e,e={type:"CallExpression",callee:r,arguments:o}):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,(r=Rt())!==n&&(mt=e,r={type:"Variable",id:r}),(e=r)===n&&(e=function(){var e,r,i,o;return e=function(){var e,r,i,o;return wt++,e=ft,39===t.charCodeAt(ft)?(r="'",ft++):(r=n,0===wt&&At(Q)),r!==n?(i=function(){var t,e,r;for(t=ft,e=[],r=Jt();r!==n;)e.push(r),r=Jt();return mt=t,e=rr(e)}(),39===t.charCodeAt(ft)?(o="'",ft++):(o=n,0===wt&&At(Q)),o!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n),wt--,e===n&&(r=n,0===wt&&At(K)),e}(),e===n&&(e=Bt())===n&&(e=Nt())===n&&(e=function(){var e,r;return wt++,e=ft,t.substr(ft,4)===b?(r=b,ft+=4):(r=n,0===wt&&At(lt)),r!==n&&(mt=e,r={type:"BooleanLiteral",value:!0}),(e=r)===n&&(e=ft,t.substr(ft,5)===_?(r=_,ft+=5):(r=n,0===wt&&At(ut)),r!==n&&(mt=e,r={type:"BooleanLiteral",value:!1}),e=r),wt--,e===n&&(r=n,0===wt&&At(st)),e}(),e===n&&(e=ft,40===t.charCodeAt(ft)?(r="(",ft++):(r=n,0===wt&&At(Y)),r!==n&&(i=Dt())!==n?(41===t.charCodeAt(ft)?(o=")",ft++):(o=n,0===wt&&At(Z)),o!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n))),e}())),e}())),e}function Jt(){var e,r,i,o,a;if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n?(i=Ut(),(o=Dt())!==n?(Ut(),125===t.charCodeAt(ft)?(a=l,ft++):(a=n,0===wt&&At(A)),a!==n?(mt=e,e=o):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,t.substr(ft,3)===u?(r=u,ft+=3):(r=n,0===wt&&At(V)),r!==n&&(mt=e,r=""),(e=r)===n&&(e=ft,r=ft,wt++,92===t.charCodeAt(ft)?(i=c,ft++):(i=n,0===wt&&At(j)),i===n&&(39===t.charCodeAt(ft)?(i="'",ft++):(i=n,0===wt&&At(Q)),i===n&&(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F)))),wt--,i===n?r=void 0:(ft=r,r=n),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=$t()):(ft=e,e=n)):(ft=e,e=n),e===n))){if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n){if(i=[],$.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(tt)),o!==n)for(;o!==n;)i.push(o),$.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(tt));else i=n;i!==n?(125===t.charCodeAt(ft)?(o=l,ft++):(o=n,0===wt&&At(A)),o!==n?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ft=e,e=n)):(ft=e,e=n)}else ft=e,e=n;e===n&&(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F)),i!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=ir(i)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Nt(){var e,r,i,o;if(wt++,e=ft,45===t.charCodeAt(ft)?(r=y,ft++):(r=n,0===wt&&At(L)),r===n&&(r=null),i=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt)),o!==n)for(;o!==n;)i.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));else i=n;return i!==n?(mt=e,e={type:"IntegerLiteral",value:nr($t())}):(ft=e,e=n),wt--,e===n&&(r=n,0===wt&&At(et)),e}function Bt(){var e,r,i,o,a,s,l,u,c,d;for(wt++,e=ft,45===t.charCodeAt(ft)?(r=y,ft++):(r=n,0===wt&&At(L)),r===n&&(r=null),i=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));o!==n;)i.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));if(46===t.charCodeAt(ft)?(o=".",ft++):(o=n,0===wt&&At(it)),o!==n){if(a=[],x.test(t.charAt(ft))?(s=t.charAt(ft),ft++):(s=n,0===wt&&At(rt)),s!==n)for(;s!==n;)a.push(s),x.test(t.charAt(ft))?(s=t.charAt(ft),ft++):(s=n,0===wt&&At(rt));else a=n;if(a!==n){if(s=ft,101===t.charCodeAt(ft)?(l="e",ft++):(l=n,0===wt&&At(ot)),l===n&&(69===t.charCodeAt(ft)?(l="E",ft++):(l=n,0===wt&&At(at))),l!==n){if(43===t.charCodeAt(ft)?(u=m,ft++):(u=n,0===wt&&At(U)),u===n&&(45===t.charCodeAt(ft)?(u=y,ft++):(u=n,0===wt&&At(L))),u===n&&(u=null),c=[],x.test(t.charAt(ft))?(d=t.charAt(ft),ft++):(d=n,0===wt&&At(rt)),d!==n)for(;d!==n;)c.push(d),x.test(t.charAt(ft))?(d=t.charAt(ft),ft++):(d=n,0===wt&&At(rt));else c=n;c!==n?s=l=[l,u,c]:(ft=s,s=n)}else ft=s,s=n;s===n&&(s=null),mt=e,e={type:"NumberLiteral",value:parseFloat($t())}}else ft=e,e=n}else ft=e,e=n;if(e===n){if(e=ft,45===t.charCodeAt(ft)?(r=y,ft++):(r=n,0===wt&&At(L)),r===n&&(r=null),i=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt)),o!==n)for(;o!==n;)i.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));else i=n;if(i!==n)if(101===t.charCodeAt(ft)?(o="e",ft++):(o=n,0===wt&&At(ot)),o===n&&(69===t.charCodeAt(ft)?(o="E",ft++):(o=n,0===wt&&At(at))),o!==n){if(43===t.charCodeAt(ft)?(a=m,ft++):(a=n,0===wt&&At(U)),a===n&&(45===t.charCodeAt(ft)?(a=y,ft++):(a=n,0===wt&&At(L))),a===n&&(a=null),s=[],x.test(t.charAt(ft))?(l=t.charAt(ft),ft++):(l=n,0===wt&&At(rt)),l!==n)for(;l!==n;)s.push(l),x.test(t.charAt(ft))?(l=t.charAt(ft),ft++):(l=n,0===wt&&At(rt));else s=n;s!==n?(mt=e,e={type:"NumberLiteral",value:parseFloat($t())}):(ft=e,e=n)}else ft=e,e=n;else ft=e,e=n}return wt--,e===n&&(r=n,0===wt&&At(nt)),e}function Rt(){var e,r,i,o,a;if(wt++,e=ft,r=ft,wt++,i=function(){var e,r,i,o;return e=ft,t.substr(ft,4)===b?(r=b,ft+=4):(r=n,0===wt&&At(lt)),r===n&&(t.substr(ft,5)===_?(r=_,ft+=5):(r=n,0===wt&&At(ut))),r!==n?(i=ft,wt++,k.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(ct)),wt--,o===n?i=void 0:(ft=i,i=n),i!==n?e=r=[r,i]:(ft=e,e=n)):(ft=e,e=n),e}(),wt--,i===n?r=void 0:(ft=r,r=n),r!==n)if(E.test(t.charAt(ft))?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(vt)),i!==n){for(o=[],k.test(t.charAt(ft))?(a=t.charAt(ft),ft++):(a=n,0===wt&&At(ct));a!==n;)o.push(a),k.test(t.charAt(ft))?(a=t.charAt(ft),ft++):(a=n,0===wt&&At(ct));mt=e,e={type:"Identifier",name:$t()}}else ft=e,e=n;else ft=e,e=n;return wt--,e===n&&(r=n,0===wt&&At(dt)),e}function Ut(){var e,r;for(wt++,e=[],C.test(t.charAt(ft))?(r=t.charAt(ft),ft++):(r=n,0===wt&&At(gt));r!==n;)e.push(r),C.test(t.charAt(ft))?(r=t.charAt(ft),ft++):(r=n,0===wt&&At(gt));return wt--,r=n,0===wt&&At(pt),e}if((r=a())!==n&&ft===t.length)return r;throw r!==n&&ft<t.length&&At({type:"end"}),function(t,e,r){return new or(or.buildMessage(t,e),t,e,r)}(_t,bt<t.length?t.charAt(bt):null,bt<t.length?Ft(bt,bt+1):Ft(bt,bt))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(or,Error),or.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=ar("",i.line.toString().length," "),l=n[i.line-1],u=(i.line===a.line?a.column:l.length+1)-i.column||1;e+="\n --\x3e "+o+"\n"+s+" |\n"+i.line+" | "+l+"\n"+s+" | "+ar("",i.column-1," ")+ar("",u,"^")}else e+="\n at "+o}return e},or.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 lr=new Map,ur=new Map;function cr(t,e,r){const n={args:e,cb:r},i=lr.get(t)||[];lr.has(t)||lr.set(t,i),i.push(n);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");ur.set(o,n)}function dr(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 vr(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=>{vr(t,e)}));break;case"BinaryExpression":case"LogicalExpression":vr(t.left,e),vr(t.right,e);break;case"UnaryExpression":vr(t.argument,e);break;case"ConditionalExpression":vr(t.test,e),vr(t.consequent,e),vr(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{vr(t,e)}))}}function pr(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function gr(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 gr(t.value);if("color"===t.type)return kr(xr(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function fr(t){let e=hr(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function mr(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}const yr=new Int32Array(1);function br(t){return yr[0]=t,yr[0]}function _r(t){if(t<Se||t>2147483647)throw new Error("Integer overflow.")}function wr(t){const e=[];return vr(t,{Variable(t){e.push(t.id.name)}}),e}function $r(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function xr(t){const e=tt(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function kr(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:Me,value:hr(t)}}function Cr(t){const e=Number(t.value);if(isNaN(e)||!Number.isFinite(e))throw new Error("Unable to convert value to Number.");return{type:Ie,value:e}}function Fr(t,e,r){let n="";const i=t.type===Me?t.value:hr(t);for(;n.length+i.length<e.value;)n+=r.value;return n.length>0&&n.length+i.length>e.value&&(n=n.substring(0,e.value-i.length)),n}function Ar(t,e,r){const n=Fr(t,e,r);return{type:Me,value:n+hr(t)}}function Vr(t,e,r){const n=Fr(t,e,r);return{type:Me,value:hr(t)+n}}function jr(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value/e.value;return t.type===Te&&(r=br(r)),{type:t.type,value:r}}function Dr(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value%e.value;return t.type===Te&&(r=br(r)),{type:t.type,value:r}}function Sr(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e*=t[r].value,t[0].type===Te&&(e=br(e));return{type:t[0].type,value:e}}function Pr(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e-=t[r].value,t[0].type===Te&&(e=br(e));return{type:t.length?t[0].type:Te,value:e}}function zr(...t){let e=0;for(let r=0;r<t.length;++r)e+=t[r].value,t[0].type===Te&&(e=br(e));return{type:t.length?t[0].type:Te,value:e}}function Mr(t){const e=Math.abs(t.value);return t.type===Te&&_r(e),{type:t.type,value:e}}function Tr(...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 Ir(...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 Or(t){return{type:t.type,value:Math.sign(t.value)}}function Jr(t,e){let r;if(0===e.value&&t.type===Te)r=t.value;else if(0===t.value&&t.type===Te)r=0;else{let n=Math.sign(e.value);t.type===Ie&&0===n&&(n=Object.is(n,0)?1:-1),r=Math.abs(t.value)*n}return t.type===Te&&_r(r),{type:t.type,value:r}}function Nr(t){return e=>{const r=xr(e.value);return{type:Ie,value:r[t]/255}}}function Br(t){return(e,r)=>{const n=xr(e.value);return n[t]=255*r.value,{type:Je,value:kr(n)}}}const Rr=Nr("a"),Ur=Nr("r"),Lr=Nr("g"),Wr=Nr("b"),qr=Br("a"),Hr=Br("r"),Gr=Br("g"),Yr=Br("b");function Zr(t,e,r){if(t.value<0)throw new Error("Expecting non-negative number of milliseconds.");let n=Math.floor(t.value/e);return r&&(n%=r),{type:Te,value:n}}function Xr(t){return t.map(fr).join(", ")}cr("toString",[Te],Er),cr("toString",[Ie],Er),cr("toString",[Oe],Er),cr("toString",[Je],Er),cr("toString",["url"],Er),cr("toNumber",[Te],Cr),cr("toNumber",[Me],Cr),cr("toInteger",[Ie],(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:Te,value:e}})),cr("toInteger",[Me],(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:Te,value:e}})),cr("toInteger",[Oe],(function(t){return{type:Te,value:t.value?1:0}})),cr("toBoolean",[Te],(function(t){if(1!==t.value&&0!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Oe,value:t.value}})),cr("toBoolean",[Me],(function(t){if("true"!==t.value&&"false"!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Oe,value:"true"===t.value?1:0}})),cr("encodeUri",[Me],(function(t){try{return{type:Me,value:encodeURIComponent(t.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),cr("decodeUri",[Me],(function(t){try{return{type:Me,value:decodeURIComponent(t.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),cr("parseUnixTime",[Te],(function(t){return{type:Ne,value:new Date(1e3*t.value)}})),cr("nowLocal",[],(function(){return{type:Ne,value:new Date}})),cr("addMillis",[Ne,Te],(function(t,e){return{type:Ne,value:new Date(t.value.getTime()+e.value)}})),cr("setYear",[Ne,Te],(function(t,e){const r=new Date(t.value);return r.setFullYear(e.value),{type:Ne,value:r}})),cr("setMonth",[Ne,Te],(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:Ne,value:r}})),cr("setDay",[Ne,Te],(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:Ne,value:r}})),cr("setHours",[Ne,Te],(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:Ne,value:r}})),cr("setMinutes",[Ne,Te],(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:Ne,value:r}})),cr("setSeconds",[Ne,Te],(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:Ne,value:r}})),cr("setMillis",[Ne,Te],(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:Ne,value:r}})),cr("getIntervalSeconds",[Te],(function(t){return Zr(t,1e3,60)})),cr("getIntervalTotalSeconds",[Te],(function(t){return Zr(t,1e3)})),cr("getIntervalMinutes",[Te],(function(t){return Zr(t,6e4,60)})),cr("getIntervalTotalMinutes",[Te],(function(t){return Zr(t,6e4)})),cr("getIntervalHours",[Te],(function(t){return Zr(t,36e5,24)})),cr("getIntervalTotalHours",[Te],(function(t){return Zr(t,36e5)})),cr("getIntervalTotalDays",[Te],(function(t){return Zr(t,864e5)})),cr("getIntervalTotalWeeks",[Te],(function(t){return Zr(t,6048e5)})),cr("len",[Me],(function(t){return{type:Te,value:t.value.length}})),cr("contains",[Me,Me],(function(t,e){return{type:Oe,value:t.value.includes(e.value)?1:0}})),cr("substring",[Me,Te,Te],(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:Me,value:t.value.substring(e.value,r.value)}})),cr("replaceAll",[Me,Me,Me],(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:Me,value:n}})),cr("index",[Me,Me],(function(t,e){return{type:Te,value:t.value.indexOf(e.value)}})),cr("lastIndex",[Me,Me],(function(t,e){return{type:Te,value:t.value.lastIndexOf(e.value)}})),cr("trim",[Me],(function(t){return{type:Me,value:t.value.trim()}})),cr("trimLeft",[Me],(function(t){return{type:Me,value:t.value.replace(/^\s+/,"")}})),cr("trimRight",[Me],(function(t){return{type:Me,value:t.value.replace(/\s+$/,"")}})),cr("toUpperCase",[Me],(function(t){return{type:Me,value:t.value.toUpperCase()}})),cr("toLowerCase",[Me],(function(t){return{type:Me,value:t.value.toLowerCase()}})),cr("padStart",[Me,Te,Me],Ar),cr("padStart",[Te,Te,Me],Ar),cr("padEnd",[Me,Te,Me],Vr),cr("padEnd",[Te,Te,Me],Vr),cr("div",[Te,Te],jr),cr("div",[Ie,Ie],jr),cr("mod",[Te,Te],Dr),cr("mod",[Ie,Ie],Dr),cr("mul",[{type:Te,isVararg:!0}],Sr),cr("mul",[{type:Ie,isVararg:!0}],Sr),cr("sub",[{type:Te,isVararg:!0}],Pr),cr("sub",[{type:Ie,isVararg:!0}],Pr),cr("sum",[{type:Te,isVararg:!0}],zr),cr("sum",[{type:Ie,isVararg:!0}],zr),cr("abs",[Te],Mr),cr("abs",[Ie],Mr),cr("max",[{type:Te,isVararg:!0}],Tr),cr("max",[{type:Ie,isVararg:!0}],Tr),cr("min",[{type:Te,isVararg:!0}],Ir),cr("min",[{type:Ie,isVararg:!0}],Ir),cr("maxNumber",[],(function(){return{type:Ie,value:Pe}})),cr("minNumber",[],(function(){return{type:Ie,value:ze}})),cr("maxInteger",[],(function(){return{type:Te,value:2147483647}})),cr("minInteger",[],(function(){return{type:Te,value:Se}})),cr("round",[Ie],(function(t){const e=Math.sign(t.value);return{type:Ie,value:e*Math.round(Math.abs(t.value))}})),cr("floor",[Ie],(function(t){return{type:Ie,value:Math.floor(t.value)}})),cr("ceil",[Ie],(function(t){return{type:Ie,value:Math.ceil(t.value)}})),cr("signum",[Ie],Or),cr("signum",[Te],Or),cr("copySign",[Ie,Ie],Jr),cr("copySign",[Te,Te],Jr),cr("getColorAlpha",[Me],Rr),cr("getColorAlpha",[Je],Rr),cr("getColorRed",[Me],Ur),cr("getColorRed",[Je],Ur),cr("getColorGreen",[Me],Lr),cr("getColorGreen",[Je],Lr),cr("getColorBlue",[Me],Wr),cr("getColorBlue",[Je],Wr),cr("setColorAlpha",[Me,Ie],qr),cr("setColorAlpha",[Je,Ie],qr),cr("setColorRed",[Me,Ie],Hr),cr("setColorRed",[Je,Ie],Hr),cr("setColorGreen",[Me,Ie],Gr),cr("setColorGreen",[Je,Ie],Gr),cr("setColorBlue",[Me,Ie],Yr),cr("setColorBlue",[Je,Ie],Yr),cr("rgb",[Ie,Ie,Ie],(function(t,e,r){const n={a:255,r:255*t.value,g:255*e.value,b:255*r.value};return{type:Je,value:kr(n)}})),cr("argb",[Ie,Ie,Ie,Ie],(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:Je,value:kr(i)}}));const Kr={StringLiteral:function(t,e){return{type:Me,value:e.value}},NumberLiteral:function(t,e){return{type:Ie,value:e.value}},IntegerLiteral:function(t,e){return{type:Te,value:e.value}},BooleanLiteral:function(t,e){return{type:Oe,value:e.value?1:0}},UnaryExpression:function(t,e){const r=pr(Qr(t,e.argument));switch(e.operator){case"!":if(r.type===Oe)return{type:Oe,value:r.value?0:1};$r(`${e.operator}${fr(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const t="+"===e.operator?1:-1;if(r.type===Te)return{type:Te,value:r.value*t};if(r.type===Ie)return{type:Ie,value:r.value*t};$r(`${e.operator}${fr(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=pr(Qr(t,e.test));if(r.type===Oe)return r.value?Qr(t,e.consequent):Qr(t,e.alternate);$r(`${fr(r)} ? ${fr(Qr(t,e.consequent))} : ${fr(Qr(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 Qr(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=hr(Qr(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:Me,value:r}},LogicalExpression:function(t,e){const r=pr(Qr(t,e.left));if(r.type!==Oe&&$r(`${fr(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Oe,value:0};const n=pr(Qr(t,e.right));return n.type!==Oe&&$r(`${fr(r)} ${e.operator} ${fr(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${mr(n.type)}.`),{type:Oe,value:n.value}},BinaryExpression:function(t,e){const r=e.operator,n=Qr(t,e.left),i=Qr(t,e.right);if(n.type!==i.type&&$r(`${fr(n)} ${e.operator} ${fr(i)}`,`Operator '${r}' cannot be applied to different types: ${mr(n.type)} and ${mr(i.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===Ne&&r.type===Ne?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:Oe,value:n?1:0}}(r,n,i);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==Ie&&e.type!==Te&&e.type!==Ne&&$r(`${fr(e)} ${t} ${fr(r)}`,`Operator '${t}' cannot be applied to ${mr(e.type)} type.`);const i=e.type===Ne?e.value.getTime():e.value,o=r.type===Ne?r.value.getTime():r.value;return n=">"===t?i>o:">="===t?i>=o:"<"===t?i<o:i<=o,{type:Oe,value:n?1:0}}(r,n,i);if("+"===r||"-"===r)return function(t,e,r){if(e.type!==Me&&e.type!==Ie&&e.type!==Te&&$r(`${fr(e)} ${t} ${fr(r)}`,`Operator '${t}' cannot be applied to ${mr(e.type)} type.`),e.type===Me)return"-"===t&&$r(`${fr(e)} - ${fr(r)}`,`Operator '${t}' cannot be applied to ${mr(e.type)} type.`),{type:Me,value:e.value+r.value};let n="+"===t?e.value+r.value:e.value-r.value;return e.type===Te&&(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!==Te&&e.type!==Ie&&$r(`${fr(e)} ${t} ${fr(r)}`,`Operator '${t}' cannot be applied to ${mr(e.type)} type.`),"*"===t)n=e.value*r.value;else{if("/"!==t&&"%"!==t)throw new Error(`Unsupported operation ${t}`);0===r.value&&$r(`${fr(e)} ${t} ${fr(r)}`,"Division by zero is not supported."),n="/"===t?e.value/r.value:e.value%r.value}return e.type===Te&&(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(!lr.has(r))throw new Error(`Unknown function name: ${r}.`);let n;const i=e.arguments.map((e=>Qr(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=lr.get(t);if(!r)throw new Error("Missing function");let n=null;for(let t=0;t<r.length;++t){const i=dr(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=>mr(t.type))).join(", "),n=`${r}(${Xr(i)})`;"few"===t.type&&0===i.length?$r(n,`Non empty argument list is required for function '${r}'.`):(t.type,$r(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){$r(`${r}(${Xr(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 Qr(t,e){if(e.type in Kr)return Kr[e.type](t,e);throw new Error("Unsupported expression")}function tn(t,e){try{return Qr(t,e)}catch(t){return{type:"error",value:t.message}}}class en{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return vr(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=tn(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 gr(n);if("boolean"===r.type)return Boolean(n);if("color"===r.type){const t=tt(String(n));if(t)return kr(t);e(q(new Error("Expression execution error")))}return n}catch(t){return void e(q(new Error("Expression execution error")))}}}function rn(t,e,r){if(t)if("string"==typeof t){if((n=t).indexOf("@{")>-1||n.indexOf("\\")>-1){e.hasExpression=!0;try{const r=sr(t,{startRule:"JsonStringContents"}),n=wr(r);return e.vars.push(...n),new en(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=>rn(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=rn(t[i],e,r);return n}}var n;return t}function nn(t,e,r){if(t){if(t instanceof en)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>nn(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=nn(t[i],e,r);return n}}return t}function on(t,e){const r={vars:[],hasExpression:!1},n=rn(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>nn(n,t,e)}}const an={pagers:function(){return U(new Map)}},sn=new Map,ln=new Map;function un(t){const e=sn.get(t)||U("");return sn.has(t)||sn.set(t,e),e}function cn(t){const e=ln.get(t)||new Map;return ln.has(t)||ln.set(t,e),e}class dn{setVariable(t){const e=t.getName(),r=cn(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),un(this).set(e)}getVariable(t){return cn(this).get(t)}}function vn(){return new dn}function pn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const gn=new Set(["start","stop","pause","resume","cancel","reset"]);class hn{constructor(t){pn(this,"timers",new Map),pn(this,"awaitActions",[]),this.logError=t.logError,this.applyVars=t.applyVars,this.hasVariableWithType=t.hasVariableWithType,this.setVariableValue=t.setVariableValue,this.execAnyActions=t.execAnyActions,this.visibilityHandler=()=>{"visible"===document.visibilityState?(this.awaitActions.forEach((({id:t,action:e})=>{this.execTimerAction(t,e)})),this.awaitActions=[],this.unholdAll()):this.holdAll()},document.addEventListener("visibilitychange",this.visibilityHandler)}destroy(){document.removeEventListener("visibilitychange",this.visibilityHandler);for(const[t,e]of this.timers)this.stopTimerTimeouts(e)}createTimer(t){null!=t&&t.id?t.duration||t.tick_interval&&(t.value_variable||t.tick_actions)?this.timers.set(t.id,{state:"stopped",definition:t}):this.logError(q(new Error("Misconfigured timer"),{additional:{id:t.id}})):this.logError(q(new Error("Missing timer id")))}execTimerAction(t,e){if(!(t&&e&&this.timers.has(t)&&gn.has(e)))return void this.logError(q(new Error("Incorrect timer action"),{additional:{id:t,action:e}}));const r=e;if("visible"!==document.visibilityState)return void this.awaitActions.push({id:t,action:r});const n=this.timers.get(t);this[r](n)}stopTimerTimeouts(t){t.durationTimeout&&(clearTimeout(t.durationTimeout),t.durationTimeout=void 0),t.tickTimeout&&(clearTimeout(t.tickTimeout),t.tickTimeout=void 0)}tickOrUnholdAction(t){const e=performance.now(),r=(t.durationPassed||0)+e-(t.durationStarted||0);t.duration&&r>t.duration||(this.updateVariable(t,r),this.callActions(t,"tick"))}startOrResume(t){t.state="running",t.hold=!1,t.durationStarted=performance.now();const e=t.duration;e&&(t.durationTimeout=window.setTimeout((()=>{this.updateVariable(t,e),this.stop(t)}),Math.max(0,e-(t.durationPassed||0))));const r=t.tick;if(r){const e=()=>{t.tickStarted=performance.now(),t.tickTimeout=window.setTimeout((()=>{this.tickOrUnholdAction(t),t.tickPassed=0,e()}),Math.max(0,r-(t.tickPassed||0)))};e()}}start(t){if("running"===t.state)return void this.logError(q(new Error("The timer is already running")));if("paused"===t.state)return void this.logError(q(new Error("The timer is paused")));const e=t.definition.value_variable;!e||this.hasVariableWithType(e,"integer")?(e&&this.setVariableValue(e,0),t.definition.duration&&(t.duration=this.applyVars(t.definition.duration)),t.definition.tick_interval&&(t.tick=this.applyVars(t.definition.tick_interval)),void 0!==t.duration&&t.duration<0||void 0!==t.tick&&t.tick<=0?this.logError(q(new Error("Incorrect timer properties"),{additional:{id:t.definition.id}})):this.startOrResume(t)):this.logError(q(new Error("Cannot find variable"),{additional:{name:e}}))}stop(t){"stopped"!==t.state?(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t),this.callActions(t,"end")):this.logError(q(new Error("The timer has already been stopped")))}pause(t){if("stopped"===t.state)return void this.logError(q(new Error("The timer has already been stopped")));if("paused"===t.state)return void this.logError(q(new Error("The timer has already been paused")));t.state="paused",this.stopTimerTimeouts(t);const e=performance.now();t.durationStarted&&(t.durationPassed=(t.durationPassed||0)+e-t.durationStarted),t.tickStarted&&(t.tickPassed=(t.tickPassed||0)+e-t.tickStarted);const r=t.definition.value_variable;r&&t.durationPassed&&this.setVariableValue(r,Math.round(t.durationPassed))}resume(t){"stopped"!==t.state?"running"!==t.state?this.startOrResume(t):this.logError(q(new Error("The timer is already running"))):this.logError(q(new Error("The timer has already been stopped")))}cancel(t){"stopped"!==t.state&&(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t))}reset(t){this.cancel(t),this.start(t)}updateVariable(t,e){const r=t.definition.value_variable;r&&this.setVariableValue(r,Math.round(e))}callActions(t,e){const r=t.definition["end"===e?"end_actions":"tick_actions"];if(r){const t=this.applyVars(r);this.execAnyActions(t,!1)}}holdAll(){for(const[t,e]of this.timers)"running"===e.state&&(e.hold=!0,this.stopTimerTimeouts(e))}unholdAll(){for(const[t,e]of this.timers)if("running"===e.state&&e.hold){const t=performance.now();e.durationStarted&&(e.durationPassed=(e.durationPassed||0)+t-e.durationStarted),e.tickStarted&&(e.tickPassed=(e.tickPassed||0)+t-e.tickStarted),e.tick&&this.tickOrUnholdAction(e),this.startOrResume(e)}}}const fn=O(((t,e,r,n)=>{let i,o;var s,l,u,v;let{id:p}=e,{json:g={}}=e,{platform:h="auto"}=e,{theme:f="system"}=e,{globalVariablesController:m=new dn}=e,{mix:y=""}=e,{customization:_={}}=e,{builtinProtocols:w=["http","https","tel","mailto","intent"]}=e,{onError:$}=e,{onStat:x}=e,{onCustomAction:k}=e,{onComponent:E}=e,C=U("desktop"===h);if(o=a(C,(t=>i=t)),"auto"===h&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");C.set(!t.matches),t.addListener((()=>{C.set(!t.matches)}))}let F="light",A=null;function V(t){f=t}function D(){}const S=new Set(w);let P=!1;g||(P=!0,X(q(new Error('"json" prop is required')))),p||(P=!0,X(q(new Error('"id" prop is required'))));let z=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 He)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}(g);const T=g.templates||{};z&&(P=!0,X(z));const I={stateChange:!1},O=un(m),J=cn(m),N=new Map,B=new Map,R=new Map;let H=null;function G(t,e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e){const r=B.get(t);r&&r.setValue(e)}}function Y(t){const e=B.get(t);return null==e?void 0:e.getValue()}function Z(t){const e=on(t,X);return e.vars.length?e.applyVars(B):t}function X(t){$?$({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function K(t,e){x&&x({type:t,action:e})}let Q=0;function tt(t){return`${p}-${Q++}`}let et={},nt={};function it(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=gt,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=ct(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=ct(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=ct(t);r&&r.setNextItem(e)}(n.get("id"),n.get("overflow"));break;case"set_variable":const r=n.get("name"),i=n.get("value");if(r&&null!==i){const t=B.get(r);t?t.set(i):X(q(new Error("Cannot find variable"),{additional:{name:r}}))}else X(q(new Error("Incorrect set_variable_action"),{additional:{url:t}}));break;case"timer":const o=n.get("action"),a=n.get("id");H?H.execTimerAction(a,o):X(q(new Error("Incorrect timer action"),{additional:{id:a,action:o}}));break;default:X(q(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){X(q(t,{additional:{url:e}}))}}async function ot(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,S)){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?(it(n),await b()):n.log_id&&(at(n),await b())}}t.forEach((t=>{t.log_id&&K("click",t)}))}}function at(t){null==k||k(t)}const st=new Map;function ct(t){if(st.has(t))return st.get(t);X(q(new Error("Missing instance with id"),{additional:{id:t}}))}const dt=new Map;function pt(t){for(const e of t)B.has(e)&&t.delete(e);return t}d(W,{logError:X,logStat:K,hasTemplate:function(t){return t in T},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in T;){if(({json:t,templateContext:e}=Xe(t,e,T,X)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:tt,genClass:function(t){return`divkit-${tt()}`},execAction:it,execAnyActions:ot,execCustomAction:at,isRunning:function(t){return I[t]},setRunning:function(t,e){I[t]=e},registerInstance:function(t,e){st.has(t)?X(q(new Error("Duplicate instance id"),{additional:{id:t}})):st.set(t,e)},unregisterInstance:function(t){st.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(nt[r]=nt[r]||0,++nt[r],et[r])return et[r];const n=`${tt()}-svg-filter`;return et=Object.assign(Object.assign({},et),{[r]:n}),n},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;nt[r]&&0==--nt[r]&&(et=Object.keys(et).reduce(((t,e)=>(nt[e]&&(t[e]=et[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return Qe(t);const e=on(t,X);return e.vars.length?L(e.vars.map((t=>B.get(t)||function(t){const e=R.get(t)||U(void 0);return R.has(t)||R.set(t,e),e}(t))).filter(rt),(()=>e.applyVars(B))):e.hasExpression?Qe(e.applyVars(B)):Qe(t)},getJsonWithVars:Z,getStore:function(t){return dt.has(t)||function(t){dt.has(t)||dt.set(t,an[t]())}(t),dt.get(t)},getVariable:function(t,e){const r=B.get(t);if(r){const n=r.getType();if(n!==e)return void X(q(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:n}}))}return r},getCustomization:function(t){return null==_?void 0:_[t]},getBuiltinProtocols:function(){return S},isDesktop:C,registerComponent:void 0,unregisterComponent:void 0}),d(Ct,{hasAction:()=>!1});const gt={setState(t){throw new Error("Not implemented")},getChild(t){if(ht&&ht.has(t))return ht.get(t);X(q(new Error("Missing state block with id"),{additional:{id:t}}))}};let ht=null;d(vt,{registerInstance(t,e){ht||(ht=new Map),ht.has(t)?X(q(new Error("Duplicate state with id"),{additional:{id:t}})):ht.set(t,e)},unregisterInstance(t){null==ht||ht.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 ft=null===(s=null==g?void 0:g.card)||void 0===s?void 0:s.variables;Array.isArray(ft)&&ft.forEach((t=>{if(t&&t.type in Re&&t.name){if(N.has(t.name))return void X(q(new Error("Duplicate variable"),{additional:{name:t.name}}));try{const e=Ue(t.name,t.type,t.value);N.set(t.name,e),B.set(t.name,e)}catch(e){X(q(e,{additional:{name:t.name}}))}}}));const mt=g.palette;mt&&mt[F].forEach((t=>{if(N.has(t.name))X(q(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=Ue(t.name,"color",t.color);N.set(t.name,e),B.set(t.name,e)}catch(e){X(q(e,{additional:{name:t.name}}))}}));for(const[t,e]of J)B.has(t)||B.set(t,e);O.subscribe((t=>{if(t&&!B.has(t)){const e=J.get(t);B.set(t,e);const r=R.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const yt=null===(l=null==g?void 0:g.card)||void 0===l?void 0:l.variable_triggers;Array.isArray(yt)&&yt.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void X(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=sr(t.condition,{startRule:"JsonStringContents"}),i=wr(n);if(!i.length)return void X(q(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return pt(e),e.size?new Promise((t=>{const r=O.subscribe((()=>{pt(e),e.size||(r(),t())}))})):Promise.resolve()})(i).then((()=>{L(i.map((t=>B.get(t))).filter(rt),(()=>tn(B,n))).subscribe((n=>{"error"!==n.type?(n.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=Z(t);e.log_id&&it(e)})),e=Boolean(n.value)):X(q(new Error("variable_trigger condition execution error"),{additional:{message:n.value}}))}))}))}catch(e){X(q(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else X(q(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));const bt=null===(u=null==g?void 0:g.card)||void 0===u?void 0:u.timers;if(bt){const t=H=new hn({logError:X,applyVars:Z,hasVariableWithType:function(t,e){const r=B.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=B.get(t);r?r.setValue(e):X(q(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:ot});bt.forEach((e=>t.createTimer(e)))}const _t=null===(v=null==g?void 0:g.card)||void 0===v?void 0:v.states,wt=_t&&!P?{type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:_t.map((t=>({state_id:t.state_id.toString(),div:t.div})))}:void 0;return c((()=>{H&&H.destroy()})),void 0===e.id&&r.id&&void 0!==p&&r.id(p),void 0===e.json&&r.json&&void 0!==g&&r.json(g),void 0===e.platform&&r.platform&&void 0!==h&&r.platform(h),void 0===e.theme&&r.theme&&void 0!==f&&r.theme(f),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==m&&r.globalVariablesController(m),void 0===e.mix&&r.mix&&void 0!==y&&r.mix(y),void 0===e.customization&&r.customization&&void 0!==_&&r.customization(_),void 0===e.builtinProtocols&&r.builtinProtocols&&void 0!==w&&r.builtinProtocols(w),void 0===e.onError&&r.onError&&void 0!==$&&r.onError($),void 0===e.onStat&&r.onStat&&void 0!==x&&r.onStat(x),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==k&&r.onCustomAction(k),void 0===e.onComponent&&r.onComponent&&void 0!==E&&r.onComponent(E),void 0===e.setTheme&&r.setTheme&&void 0!==V&&r.setTheme(V),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==D&&r.getDebugVariables(D),void 0===e.setVariable&&r.setVariable&&void 0!==G&&r.setVariable(G),void 0===e.getVariable&&r.getVariable&&void 0!==Y&&r.getVariable(Y),void 0===e.execAction&&r.execAction&&void 0!==it&&r.execAction(it),"light"===f||"dark"===f?F=f:"system"===f?"undefined"!=typeof matchMedia?(A||(A=matchMedia("(prefers-color-scheme: dark)"),A.addListener((function(){"system"===f&&A&&(F=A.matches?"dark":"light")}))),F=A.matches?"dark":"light"):F="light":X(q(new Error("Unsupported theme"))),F&&(mt&&mt[F].forEach((t=>{const e=B.get(t.name);e&&e.setValue(t.color)}))),o(),!P&&wt?`<div class="${j("divkit-b023c",!0)+j(i?" divkit-ee112":"",!0)+j(y?` ${y}`:"",!0)}">${M(Ze,"RootSvgFilters").$$render(t,{svgFiltersMap:et},{},{})}\n ${M(Ye,"Unknown").$$render(t,{div:wt,templateContext:{}},{},{})}</div>`:""}));function mn(t){return fn.render({id:t.id,json:t.json,globalVariablesController:t.globalVariablesController,mix:t.mix,customization:t.customization,builtinProtocols:t.builtinProtocols,onError:t.onError,platform:t.platform}).html}var yn=e.M,bn=e.Os,_n=e.sY;export{yn as createGlobalVariablesController,bn as createVariable,_n as render};
1
+ var t={d:(e,r)=>{for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function r(){}function i(t){return t()}function n(t){t.forEach(i)}function o(t){return"function"==typeof t}function a(t,...e){if(null==t)return r;const i=t.subscribe(...e);return i.unsubscribe?()=>i.unsubscribe():i}let s;function l(t){s=t}function d(){if(!s)throw new Error("Function called outside component initialization");return s}function u(t){d().$$.on_destroy.push(t)}function c(t,e){return d().$$.context.set(t,e),e}function v(t){return d().$$.context.get(t)}t.d(e,{M:()=>ci,Os:()=>Ue,sY:()=>fi}),new Set,new Map;const p=[],g=[],h=[],f=[],m=Promise.resolve();let y=!1;function b(){return y||(y=!0,m.then(x)),m}function _(t){h.push(t)}const w=new Set;let $=0;function x(){const t=s;do{for(;$<p.length;){const t=p[$];$++,l(t),k(t.$$)}for(l(null),p.length=0,$=0;g.length;)g.pop()();for(let t=0;t<h.length;t+=1){const e=h[t];w.has(e)||(w.add(e),e())}h.length=0}while(p.length);for(;f.length;)f.pop()();y=!1,w.clear(),l(t)}function k(t){if(null!==t.fragment){t.update(),n(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(_)}}new Set,"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;const E=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),C=/[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;function F(t,e){const r=Object.assign({},...t);if(e){const t=e.classes,i=e.styles;t&&(null==r.class?r.class=t:r.class+=" "+t),i&&(null==r.style?r.style=N(i):r.style=N(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),i=e.slice(0,t).trim(),n=e.slice(t+1).trim();i&&(r[i]=n)}for(const t in e){const i=e[t];i?r[t]=i:delete r[t]}return r}(r.style,i)))}let i="";return Object.keys(r).forEach((t=>{if(C.test(t))return;const e=r[t];!0===e?i+=" "+t:E.has(t.toLowerCase())?e&&(i+=" "+t):null!=e&&(i+=` ${t}="${e}"`)})),i}const A=/[&"]/g,V=/[&<]/g;function j(t,e=!1){const r=String(t),i=e?A:V;i.lastIndex=0;let n="",o=0;for(;i.test(r);){const t=i.lastIndex-1,e=r[t];n+=r.substring(o,t)+("&"===e?"&amp;":'"'===e?"&quot;":"&lt;"),o=t+1}return n+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 P(t,e){let r="";for(let i=0;i<t.length;i+=1)r+=e(t[i],i);return r}const z={$$render:()=>""};function M(t,e){if(!t||!t.$$render)throw"svelte:component"===e&&(e+=" this={...}"),new Error(`<${e}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules`);return t}let T,I;function O(t){function e(e,r,i,n,o){const a=s;l({$$:{on_destroy:T,context:new Map(o||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const d=t(e,r,i,n);return l(a),d}return{render:(t={},{$$slots:r={},context:i=new Map}={})=>{T=[];const o={title:"",head:"",css:new Set},a=e(o,t,{},r,i);return n(T),{html:a,css:{code:Array.from(o.css).map((t=>t.code)).join("\n"),map:null},head:o.title+o.head}},$$render:e}}function J(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${j(e,!0)}"`}`}function N(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${t[e]};`)).join(" ")}function B(t){const e=N(t);return e?` style="${e}"`:""}"function"==typeof HTMLElement&&(I=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(i).filter(o);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,r){this[t]=r}disconnectedCallback(){n(this.$$.on_disconnect)}$destroy(){(function(t,e){const r=t.$$;null!==r.fragment&&(n(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 i;const n=new Set;function o(e){if(o=e,((r=t)!=r?o==o:r!==o||r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!R.length;for(const e of n)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 n.add(l),1===n.size&&(i=e(o)||r),a(t),()=>{n.delete(l),0===n.size&&(i(),i=null)}}}}function L(t,e,i){const s=!Array.isArray(t),l=s?[t]:t,d=e.length<2;return{subscribe:U(i,(t=>{let i=!1;const u=[];let c=0,v=r;const p=()=>{if(c)return;v();const i=e(s?u[0]:u,t);d?t(i):v=o(i)?i:r},g=l.map(((t,e)=>a(t,(t=>{u[e]=t,c&=~(1<<e),i&&p()}),(()=>{c|=1<<e}))));return i=!0,p(),function(){n(g),v()}})).subscribe}}const W=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 i=tt(t);return i?(i.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)})`}(i)):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,i,n,o]=e,a=2===i.length?i:i+i,s=2===n.length?n:n+n,l=2===o.length?o:o+o,d=2===r.length?r:r+r;return{a:parseInt(d,16),r:parseInt(a,16),g:parseInt(s,16),b:parseInt(l,16)}}const[t,r,i,n]=e,o=2===r.length?r:r+r,a=2===i.length?i:i+i,s=2===n.length?n:n+n;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 it(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 i=t.bg.radius;let n;i&&"object"==typeof i&&"type"in i&&void 0!==i.value&&("fixed"===i.type?n=X(i.value):"relative"===i.type&&(n=nt[i.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${n||"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 nt={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]||""}function dt(t,e){return e.has(t)}function ut(t,e){e&&t.push(e)}function ct(t,e,r){const i=[];ut(i,e[t]);for(const n in r)if(r.hasOwnProperty(n)){const o=r[n];o&&ut(i,e[`${t}_${n}`+("string"==typeof o?`_${o}`:"")])}return i.join(" ")}const vt=Symbol("state");function pt(t){return Z(t.top||0)+" "+Z(t.right||0)+" "+Z(t.bottom||0)+" "+Z(t.left||0)}function gt(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function ht(t){return gt(t)&&t>=0}function ft(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 pt(t)}function mt(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const yt=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),i=Object.keys(e);if(r.length!==i.length)return!1;for(let i=0;i<r.length;i++){const n=r[i];if(!yt.call(e,n)||!bt(t[n],e[n]))return!1}return!0}function _t(t,e){return bt(t,e)?e:t}function wt(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function $t(t,e){const r=Number(t);return isNaN(r)?e:r}function xt(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...xt(t))})):e.push(t),e}function kt(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 Ct=Symbol("action"),Ft=O(((t,e,r,i)=>{let{actions:n}=e,{doubleTapActions:o}=e,{longTapActions:a}=e,{cls:s=""}=e,{style:l=null}=e,{attrs:d}=e,{use:u=Et}=e,{customAction:p=null}=e,{isNativeActionAnimation:g=!0}=e;const h=v(W),f=v(Ct);c(Ct,{hasAction:()=>Boolean(f.hasAction()||(null==n?void 0:n.length))});let m,y="";if(Array.isArray(n)&&(null==n?void 0:n.length))for(let t=0;t<n.length;++t){const e=n[t].url;if(e){y=e,m=n[t].target||void 0;break}}Array.isArray(n)&&(null==n?void 0:n.length)&&f.hasAction()&&(y="",h.logError(q(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:n}})));let b=Boolean(p);return y&&!dt(lt(y),h.getBuiltinProtocols())&&(y="",b=!0),void 0===e.actions&&r.actions&&void 0!==n&&r.actions(n),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!==d&&r.attrs(d),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(d)],{})}>${i.default?i.default({}):""}</a>`:`<span${F([{class:j(s,!0)+j(b?` ${g?"divkit-bd259":"divkit-d9099"} divkit-c016b`:"",!0)+" "+j(null!=a&&a.length?"divkit-f0cba":"",!0)},{style:D(l)},{role:D(b?"button":null)},{tabindex:D(b?0:null)},S(d)],{})}>${i.default?i.default({}):""}</span>`}));function At(t){return gt(t)&&t>0}function Vt(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(At(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 jt=O(((t,e,r,i)=>{let n,{background:o=[]}=e,{radius:a=""}=e;const s=v(W);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),n=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 i=it([t]);"solid"===t.type&&(e["background-color"]=i.color),"gradient"===t.type&&(e["background-image"]=i.image),"image"===t.type&&(e.opacity=Number(t.alpha),r.image_url=t.image_url,e["object-fit"]=i.size,e["object-position"]=i.position,Array.isArray(t.filters)&&t.filters.length&&(e.filter=Vt(t.filters,s.logError)))}return r})),`<span${J("class","divkit-bf253"+(a?" divkit-dcad7":""),0)}${B({"border-radius":a})}>${P(n,(t=>t.image_url?`<img${J("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${J("class","divkit-b921d",0)}${J("style",Y(t.style),0)}>`:`<span${J("class","divkit-b921d",0)}${J("style",Y(t.style),0)}></span>`))}</span>`})),Dt=jt,St=O(((t,e,i,n)=>{let o,s,l,d,u,c,p,g,h,f,m,y,_,w,$,x,k,E,C,F,A,V,j,D,S,P,z,T,I,O,N,B,R,U,L,H,K,tt,et,rt,nt,ot=r,at=r,st=r,ut=r,gt=r,yt=r,bt=r,Et=r,Ct=r,At=r,Vt=r,jt=r,St=r,Pt=r,zt=r,Mt=r,Tt=r;var It,Ot,Jt,Nt,Bt,Rt;let{json:Ut={}}=e,{origJson:Lt}=e,{templateContext:Wt}=e,{cls:qt=""}=e,{style:Ht}=e,{layoutParams:Gt={}}=e,{customDescription:Yt=!1}=e,{customPaddings:Zt=!1}=e,{customActions:Xt=""}=e,{additionalPaddings:Kt=null}=e;const Qt={left:"start",center:"center",right:"end"},te={top:"start",center:"center",bottom:"end",baseline:"baseline"},ee=v(W),re=v(vt);let ie,ne,oe,ae,se,le,de,ue,ce,ve,pe,ge={},he={},fe=!1,me=1,ye="transparent",be=0,_e={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},we="",$e=null,xe="",ke={},Ee=0,Ce=0,Fe=0,Ae=!1,Ve=!1,je={},De=0,Se=0,Pe=0,ze=!1,Me=!1,Te=1;const Ie=Gt.fakeElement?[]:Ut.transition_triggers||["state_change","visibility_change"],Oe=-1!==Ie.indexOf("state_change")&&Ut.id,Je=-1!==Ie.indexOf("visibility_change")&&Ut.id;let Ne,Be,Re,Ue,Le,We,qe,He,Ge,Ye=[],Ze=[],Xe=[],Ke=[],Qe="",tr=!1,er="visible",rr=0,ir=0;void 0===e.json&&i.json&&void 0!==Ut&&i.json(Ut),void 0===e.origJson&&i.origJson&&void 0!==Lt&&i.origJson(Lt),void 0===e.templateContext&&i.templateContext&&void 0!==Wt&&i.templateContext(Wt),void 0===e.cls&&i.cls&&void 0!==qt&&i.cls(qt),void 0===e.style&&i.style&&void 0!==Ht&&i.style(Ht),void 0===e.layoutParams&&i.layoutParams&&void 0!==Gt&&i.layoutParams(Gt),void 0===e.customDescription&&i.customDescription&&void 0!==Yt&&i.customDescription(Yt),void 0===e.customPaddings&&i.customPaddings&&void 0!==Zt&&i.customPaddings(Zt),void 0===e.customActions&&i.customActions&&void 0!==Xt&&i.customActions(Xt),void 0===e.additionalPaddings&&i.additionalPaddings&&void 0!==Kt&&i.additionalPaddings(Kt),o=ee.getDerivedFromVars(Ut.border),Tt(),Tt=a(o,(t=>nt=t));{let t={},e={},r=!1,i="";if(nt){if(nt.has_shadow){const e=nt.shadow;t["box-shadow"]=e?Z((null===(Ot=null===(It=e.offset)||void 0===It?void 0:It.x)||void 0===Ot?void 0:Ot.value)||0)+" "+Z((null===(Nt=null===(Jt=e.offset)||void 0===Jt?void 0:Jt.y)||void 0===Nt?void 0:Nt.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(nt.stroke&&(r=!0,me=mt(nt.stroke.width,me),ye=Q(nt.stroke.color,1,ye),e.border=`${Z(me)} solid ${ye}`),nt.corners_radius?(_e=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}(nt.corners_radius,_e),e["border-radius"]=t["border-radius"]=kt(_e)):nt.corner_radius&&(be=mt(nt.corner_radius,be),_e={"top-left":be,"top-right":be,"bottom-right":be,"bottom-left":be},e["border-radius"]=t["border-radius"]=Z(be)),r&&me&&(nt.corners_radius||nt.corner_radius)){let t=Object.assign({},_e);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+me/2})),i=kt(t)}}ge=_t(t,ge),he=_t(e,he),fe=r,we=i}s=ee.getDerivedFromVars(Ut.paddings),Mt(),Mt=a(s,(t=>rt=t)),$e=function(t,e){if(!t)return e;const r=["top","right","bottom","left"];for(let i=0;i<r.length;++i)if(t[r[i]]&&!ht(t[r[i]]))return e;return t}(rt&&!Zt?rt:void 0,$e),l=pt(function(t,e){if(!t&&!e)return{};if(!e)return t;if(!t)return e;const r={};return["top","right","bottom","left"].forEach((i=>{const n=t[i];n&&(r[i]=n);const o=e[i];o&&(r[i]=(r[i]||0)+o)})),r}($e,Kt)),d=ee.getDerivedFromVars(Ut.margins),Pt(),Pt=a(d,(t=>tt=t)),xe=ft(tt,xe),u=ee.getDerivedFromVars(Ut.width),jt(),jt=a(u,(t=>H=t)),c=ee.getDerivedFromVars(Ut.alignment_horizontal),zt(),zt=a(c,(t=>et=t));{let t,e,r,i,n={},o=0,a=0,s=!1,l=!1;const d=null==H?void 0:H.type;if("fixed"===d)Ee=mt(null==H?void 0:H.value,Ee),e=Z(Ee);else if("wrap_content"!==d&&(Gt.overlapParent||"match_parent"!==d&&d||!Gt.parentHorizontalWrapContent))t="parent","vertical"===Gt.parentContainerOrientation&&Gt.parentContainerWrap&&(l=!0,ee.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&&(o=H&&"weight"in H&&H.weight||1,Gt.parentContainerWrap&&(s=!0));else{if(t="content",("wrap_content"===d&&(null==H?void 0:H.constrained)||("match_parent"===d||!d)&&Gt.parentHorizontalWrapContent)&&(n["width-constrained"]=!0,"horizontal"===Gt.parentContainerOrientation&&(a=1)),"wrap_content"===d){const t=H;t.min_size&&ht(t.min_size.value)&&(r=Z(t.min_size.value)),t.max_size&&ht(t.max_size.value)&&(i=Z(t.max_size.value))}"match_parent"!==d&&d||ee.logError(q(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}if("parent"===t)n["halign-self"]="stretch";else{const t=et;n["halign-self"]="left"===t||"center"===t||"right"===t?Qt[t]:Gt.parentHAlign||"start"}t&&(n.width=t),oe=e,ae=r,se=i,Ce=o,Fe=a,ke=_t(n,ke),Ae=s,Ve=l}p=ee.getDerivedFromVars(Ut.height),Vt(),Vt=a(p,(t=>L=t)),g=ee.getDerivedFromVars(Ut.alignment_vertical),St(),St=a(g,(t=>K=t));{let t,e,r,i,n={},o=0,a=0,s=!1,l=!1;const d=null==L?void 0:L.type;if("fixed"===d)De=mt(null==L?void 0:L.value,De),e=Z(De);else if("match_parent"!==d||!Gt.overlapParent&&Gt.parentVerticalWrapContent){if(t="content",("wrap_content"===d&&(null==L?void 0:L.constrained)||"match_parent"===d&&Gt.parentVerticalWrapContent)&&(n["height-constrained"]=!0,"vertical"===Gt.parentContainerOrientation&&(a=1)),"wrap_content"===d){const t=L;(null==t?void 0:t.min_size)&&ht(t.min_size.value)&&(r=Z(t.min_size.value)),(null==t?void 0:t.max_size)&&ht(t.max_size.value)&&(i=Z(t.max_size.value))}"match_parent"===d&&ee.logError(q(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","horizontal"===Gt.parentContainerOrientation&&Gt.parentContainerWrap&&(l=!0,ee.logError(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&&(o=(null==L?void 0:L.weight)||1,Gt.parentContainerWrap&&(s=!0));if("parent"===t)n["valign-self"]="stretch";else{const t=K;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===Gt.parentContainerOrientation?n["valign-self"]=te[t]:n["valign-self"]=Gt.parentVAlign||"start"}t&&(n.height=t),le=e,de=r,ue=i,Se=o,Pe=a,je=_t(n,je),ze=s,Me=l}var nr,or,ar;if(h=!!Gt.overlapParent||void 0,f=Gt.overlapParent&&(!H||"match_parent"===H.type)&&"match_parent"===(null==L?void 0:L.type),m=Gt.gridArea?`${Gt.gridArea.y+1}/${Gt.gridArea.x+1}/span ${Gt.gridArea.rowSpan}/span ${Gt.gridArea.colSpan}`:void 0,y=ee.getDerivedFromVars(Ut.alpha),At(),At=a(y,(t=>U=t)),or=Te,Te=!ht(nr=U)||void 0===nr||nr>1?or:Number(nr),ce=1===Te?void 0:Te,_=ee.getDerivedFromVars(Ut.accessibility),Ct(),Ct=a(_,(t=>R=t)),ne=void 0,R&&!Yt&&R.description&&(ne={},ne["aria-label"]=R.description),w=ee.getDerivedFromVars(Ut.background),Et(),Et=a(w,(t=>B=t)),ve={},pe=!1,B&&(pe=B.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(we),!pe)){const t=it(B);ve["background-color"]=t.color,ve["background-image"]=t.image,ve["background-size"]=t.size,ve["background-position"]=t.position,ve["background-repeat"]="no-repeat"}Ne=void 0,Oe&&Ut.transition_in&&ee.isRunning("stateChange")&&(Ne=!0),Re=void 0,Oe&&Ut.transition_change&&ee.isRunning("stateChange")&&re.hasTransitionChange(Ut.id)&&(Re=!0),$=ee.getDerivedFromVars(Ut.action),yt(),yt=a($,(t=>O=t)),x=ee.getDerivedFromVars(Ut.actions),bt(),bt=a(x,(t=>N=t)),k=ee.getDerivedFromVars(Ut.doubletap_actions),gt(),gt=a(k,(t=>I=t)),E=ee.getDerivedFromVars(Ut.longtap_actions),ut(),ut=a(E,(t=>T=t));{let t=N||O&&[O]||[],e=I||[],r=T||[];Gt.fakeElement?(t=[],e=[],r=[]):(Array.isArray(t)||(t=[],ee.logError(q(new Error("Actions should be array")))),Array.isArray(e)||(e=[],ee.logError(q(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],ee.logError(q(new Error("LongTapActions should be array"))))),(t.length||e.length||r.length)&&Xt&&(t=[],e=[],r=[],ee.logError(q(new Error(`Cannot use action on component "${Xt}"`)))),Ye=t,Ze=e,Xe=r}C=ee.getDerivedFromVars(Ut.action_animation),st(),st=a(C,(t=>z=t)),z&&(Ke=xt(z),Qe=Ke.map((function(t){const e=$t(t.start_value,1),r=$t(t.end_value,1),i=mt(t.start_delay,0),n=mt(t.duration,300),o=wt(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return Ue=e,Le=r,`opacity ${n}ms ${o} ${i}ms`;case"scale":return We=e,qe=r,`transform ${n}ms ${o} ${i}ms`;case"native":case"no_animation":return"";default:return ee.logError(q(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", ")),F=ee.getDerivedFromVars(Ut.visibility),at(),at=a(F,(t=>P=t));{const t=er,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(P,er);t!==e&&(!tr||"visible"!==er&&"visible"!==e?er=e:async function(t){er=t;const e="visible"===t?"in":"out",r="in"===e?Ut.transition_in:Ut.transition_out;Je&&r&&(await b(),"in"===e&&(Be=!0),re.runVisibilityTransition(Object.assign(Object.assign({},Ut),{visibility:"visible"}),Wt,r,ie,e).then((()=>{"in"===e&&(Be=!1)})).catch((t=>{throw"in"===e&&(Be=!1),t})))}(e)),tr||(tr=!0)}if(A=Object.assign(Object.assign(Object.assign({},ke),je),{"parent-overlap":h,"parent-overlap-absolute":f,"scroll-snap":Gt.scrollSnap,"hide-on-transition-in":Ne||Be||Re,visibility:er,"has-action-animation":Boolean(Qe),"parent-flex":Gt.parentContainerOrientation||void 0}),V=ee.getDerivedFromVars(Ut.transform),ot(),ot=a(V,(t=>S=t)),S&&void 0!==S.rotation){const t=S.pivot_x||{type:"pivot-percentage",value:50};rr=$t(t.value,rr);const e="pivot-fixed"===t.type?Z(rr):`${rr}%`,r=S.pivot_y||{type:"pivot-percentage",value:50};ir=$t(r.value,ir),He=`${e} ${"pivot-fixed"===r.type?Z(ir):`${ir}%`}`,Ge=`rotate(${S.rotation}deg)`}return j=Ae||ze?"100%":Ce||Se?0:void 0,D=Object.assign(Object.assign(Object.assign(Object.assign({},Ht),ve),ge),{width:oe,"min-width":ae,"max-width":se,height:le,"min-height":de,"max-height":ue||(null==Ht?void 0:Ht["max-height"]),"grid-area":m,padding:l,margin:xe,opacity:ce,transition:Qe,"transform-origin":He,transform:Ge,"flex-grow":Ce||Se||void 0,"flex-shrink":Fe||Pe?1:void 0,"flex-basis":j,"--divkit-animation-opacity-start":Ue,"--divkit-animation-opacity-end":Le,"--divkit-animation-scale-start":We,"--divkit-animation-scale-end":qe}),ot(),at(),st(),ut(),gt(),yt(),bt(),Et(),Ct(),At(),Vt(),jt(),St(),Pt(),zt(),Mt(),Tt(),Ve||Me?"":`${M(Ft,"Actionable").$$render(t,{use:function(t){ie=t,Oe&&Ut.transition_in&&re.registerChildWithTransitionIn(Ut,Wt,Ut.transition_in,t).then((()=>{Ne=!1})).catch((t=>{throw Ne=!1,t})),Oe&&Ut.transition_out&&re.registerChildWithTransitionOut(Ut,Wt,Ut.transition_out,t),Oe&&Ut.transition_change&&re.registerChildWithTransitionChange(Ut,Wt,Ut.transition_change,t).then((()=>{Re=!1})).catch((t=>{throw Re=!1,t})),function(t,{visibilityActions:e,rootCtx:r}){if(null==e||!e.length)return;const i=e.map((t=>({action:t,visible:!1,count:0,finished:!1}))),n=[...new Set([...e.map((t=>(t.visibility_percentage||50)/100))])];new IntersectionObserver((t=>{t.forEach((t=>{i.forEach((e=>{const i=t.intersectionRatio>=(e.action.visibility_percentage||50)/100;!e.visible&&i?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 i=e.action.url;if(i){const t=lt(i);t&&!dt(t,r.getBuiltinProtocols())&&("div-action"===t?r.execAction(e.action):e.action.log_id&&r.execCustomAction(e.action))}r.logStat("visible",e.action)}),e.action.visibility_duration||800)):i||e.timer&&clearTimeout(e.timer),e.visible=i}))}))}),{threshold:n}).observe(t)}(t,{visibilityActions:Gt.fakeElement?[]:ee.getJsonWithVars(Ut.visibility_actions||Ut.visibility_action&&[Ut.visibility_action]),rootCtx:ee});const e=Ut.id;e&&re.registerChild(e);let r=null;return{destroy(){e&&re.unregisterChild(e),r&&r.destroy()}}},cls:qt+" "+ct("outer",G,A),style:Y(D),actions:Ye,doubleTapActions:Ze,longTapActions:Xe,attrs:ne,isNativeActionAnimation:!Ke.length||(ar=Ke,ar.some((t=>"native"===t.name)))},{},{default:()=>`${pe?`${M(Dt,"OuterBackground").$$render(t,{background:B,radius:we},{},{})}`:""}${n.default?n.default({}):""}${fe?`<span${J("class",G.outer__border,0)}${J("style",Y(he),0)}></span>`:""}`})}`})),Pt=St,zt={"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 Mt(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function Tt(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function It(t,e){return Tt(t)||e}const Ot=O(((t,e,r,i)=>{let n,o,a,s,l;var d,u;let c,{text:v}=e,{rootFontSize:p}=e,{textStyles:g={}}=e,{singleline:h=!1}=e,{actions:f}=e,m="none",y=12,b=1.25,_="",w="",$=null;void 0===e.text&&r.text&&void 0!==v&&r.text(v),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==p&&r.rootFontSize(p),void 0===e.textStyles&&r.textStyles&&void 0!==g&&r.textStyles(g),void 0===e.singleline&&r.singleline&&void 0!==h&&r.singleline(h),void 0===e.actions&&r.actions&&void 0!==f&&r.actions(f);{let t="none";(g.underline||g.strike)&&("single"===g.underline&&"single"===g.strike?t="both":"single"===g.underline?t="underline":"single"===g.strike&&(t="strike")),m=t}return y=Mt(g.font_size,y),At(g.line_height)&&(b=Number(g.line_height)/y),ht(g.letter_spacing)&&(_=Z(g.letter_spacing)),c=It(g.font_weight,c),w=Q(g.text_color,1,w),n=g.top_offset?Z(g.top_offset):"",o=g.background?it([g.background]):null,$=(null===(d=g.border)||void 0===d?void 0:d.stroke)&&"transparent"!==Q(g.border.stroke.color)&&At(g.border.stroke.width)?{color:g.border.stroke.color,width:g.border.stroke.width}:null,a=Mt(null===(u=g.border)||void 0===u?void 0:u.corner_radius,0),s={singleline:h,decoration:m},l={"font-size":Z(10*y/p),"line-height":b,"letter-spacing":_,"font-weight":c,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},`${n?`<span${J("class",zt["text-range__top-offset"],0)}${B({"margin-top":n})}></span>`:""}${M(Ft,"Actionable").$$render(t,{cls:ct("text-range",zt,s),actions:f,style:Y(l)},{},{default:()=>`${j(v)}`})}`})),Jt=Ot;function Nt(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Bt(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function Rt(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const Ut=O(((t,e,i,n)=>{let o,s,l,d,c,p,g,h,f,m,y,b,_,w,$,x,k,E,C,F,A,V,j,D,S,z,T,I,O,N,B,R,U,L=r,G=r,X=r,K=r,tt=r,et=r,rt=r,nt=r,ot=r,at=r,st=r,lt=r,dt=r,{json:ut={}}=e,{templateContext:vt}=e,{origJson:pt}=e,{layoutParams:gt}=e;const ht=v(W);let ft=!1,mt="",yt=12,bt=1.25,_t=!1,wt="",$t="",xt=!1,kt="left",Et="top",Ct="",Ft="",Vt=!1,jt=[],Dt=[];var St,zt;u((()=>{Dt.forEach((([t,e])=>{ht.removeSvgFilter(t,e)}))})),void 0===e.json&&i.json&&void 0!==ut&&i.json(ut),void 0===e.templateContext&&i.templateContext&&void 0!==vt&&i.templateContext(vt),void 0===e.origJson&&i.origJson&&void 0!==pt&&i.origJson(pt),void 0===e.layoutParams&&i.layoutParams&&void 0!==gt&&i.layoutParams(gt),o=ht.getDerivedFromVars(ut.text),dt(),dt=a(o,(t=>U=t)),St=U,zt=mt,mt=String(null!=St?St:"")||zt,mt?ft=!1:(ft=!0,ht.logError(q(new Error('Missing "text" prop for div "text"')))),s=ht.getDerivedFromVars(ut.ranges),G(),G=a(s,(t=>V=t)),l=ht.getDerivedFromVars(ut.images),L(),L=a(l,(t=>A=t)),d=ht.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(d,(t=>j=t)),c=ht.getDerivedFromVars(ut.font_size),lt(),lt=a(c,(t=>R=t)),yt=Mt(R,yt),p=ht.getDerivedFromVars(ut.line_height),st(),st=a(p,(t=>B=t));{const t=B;At(t)?(bt=Number(t)/yt,_t=!0):_t=!1}g=ht.getDerivedFromVars(ut.max_lines),nt(),nt=a(g,(t=>I=t)),h=1===I;{let t="",e="",r=!1;if(I&&I>1){let i=Number(I);t=i*bt+"em",V||A||(e=i,r=!0)}wt=t,$t=e,xt=r}f=ht.getDerivedFromVars(ut.text_alignment_horizontal),at(),at=a(f,(t=>N=t)),kt=Nt(N,kt),m=ht.getDerivedFromVars(ut.text_alignment_vertical),ot(),ot=a(m,(t=>O=t)),Et=Bt(O,Et),y=!V||mt&&1===V.length&&V[0]&&0===V[0].start&&"number"==typeof V[0].end&&V[0].end>=mt.length,b=ht.getDerivedFromVars(ut.text_color),rt(),rt=a(b,(t=>T=t)),_=Boolean(T)!==Boolean(V&&V[0]&&V[0].text_color);{let t="";I&&y&&_&&(t=Q(T||V&&V[0]&&V[0].text_color,1,Ct)),Ct=t}w=ht.getDerivedFromVars(ut.truncate),et(),et=a(w,(t=>z=t)),$="none"===z?"none":"",x=ht.getDerivedFromVars(ut.text_gradient),tt(),tt=a(x,(t=>S=t));{let t="";if(S){const e=it([S]);e.image&&(t=e.image)}Ft=t}return k=ht.getDerivedFromVars(ut.selectable),K(),K=a(k,(t=>D=t)),Vt=function(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}(D,Vt),function(t,e,r){let i=[];if(Dt.forEach((([t,e])=>{ht.removeSvgFilter(t,e)})),Dt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(jt=[]);const n=t;let o=e||[{start:0,end:n.length}],a=r||[],s=0,l=[],d=[];o.forEach((t=>{void 0!==t.start&&void 0!==t.end&&(d.push({index:t.start,range:t,type:"rangeStart",isStart:!0}),d.push({index:t.end,range:t,type:"rangeEnd"}))})),a.forEach(((t,e)=>{void 0!==t.start&&t.url&&t.start<=n.length&&d.push({index:t.start,image:t,type:"image",arrayIndex:e})})),d.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)),d.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);i.push({text:n.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)),n=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,d=Rt(t.image.tint_mode,"source_in");if(s){const e=Q(t.image.tint_color);a=ht.addSvgFilter(e,d),Dt.push([e,d])}i.push({image:{url:t.image.url,width:r,height:n,wrapperStyle:o,svgFilterId:a}})}s=o})),s<n.length&&i.push({text:n.substring(s),textStyles:Object.assign({},j)}),jt=i}(mt,V,A),E={singleline:h,multiline:xt,halign:kt,valign:Et,truncate:$},C={gradient:Boolean(Ft)},F={"font-size":Z(yt),"line-height":bt,"max-height":wt,"-webkit-line-clamp":$t,color:Ct,"background-image":Ft},L(),G(),X(),K(),tt(),et(),rt(),nt(),ot(),at(),st(),lt(),dt(),ft?"":`${M(Pt,"Outer").$$render(t,{cls:ct("text",H,E)+" "+(Vt?"":"divkit-c016b"),json:ut,origJson:pt,templateContext:vt,layoutParams:gt},{},{default:()=>`<span${J("class",ct("text__inner",H,C),0)}${J("style",Y(F),0)}>${jt.length?`${P(jt,((e,r)=>"text"in e?e.text?`${M(Jt,"TextRangeView").$$render(t,{text:e.text,rootFontSize:yt,textStyles:e.textStyles,singleline:h,actions:e.actions},{},{})}`:"":e.image?`<span${J("style",Y(e.image.wrapperStyle),0)}><img${J("class",H.text__image,0)}${J("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${J("style",Y({width:e.image.width,height:e.image.height,"margin-top":_t?`-${e.image.height}`:void 0,"margin-bottom":_t?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${M(Jt,"TextRangeView").$$render(t,{text:mt,rootFontSize:yt,textStyles:j,singleline:h},{},{})}`}</span>`})}`})),Lt=Ut,Wt={container:"divkit-d37d6",container_wrap:"divkit-c8551",container_orientation_vertical:"divkit-ddc33",container_valign_top:"divkit-a331a",container_valign_center:"divkit-aae61",container_valign_bottom:"divkit-c2226",container_orientation_horizontal:"divkit-fe458",container_halign_left:"divkit-a3091",container_halign_center:"divkit-bac9d",container_halign_right:"divkit-f4230",container_orientation_overlap:"divkit-a644d"};function qt(t,e,r){if(!(t&&t.shape&&t.shape.type&&e.includes(t.shape.type)&&"shape_drawable"===t.type))return r;let i;if("rounded_rectangle"===t.shape.type)n=t.shape,i={width:Number((null===(o=n.item_width)||void 0===o?void 0:o.value)||10),height:Number((null===(a=n.item_height)||void 0===a?void 0:a.value)||10),radius:Number(null!==(s=null===(l=n.corner_radius)||void 0===l?void 0:l.value)&&void 0!==s?s:5)};else{if("circle"!==t.shape.type)return r;i=function(t){var e;const r=2*Number((null===(e=t.radius)||void 0===e?void 0:e.value)||10);return{width:r,height:r,radius:r}}(t.shape)}var n,o,a,s,l;return function(t,e,r){var i;const n={},o=e.stroke||(null==r?void 0:r.stroke),a=null!=o&&o.color?Q(o.color):"",s=null!=o&&o.width?Number(null!==(i=o.width)&&void 0!==i?i:1):"";n.width=t.width,n.height=t.height,n.borderRadius=t.radius;const l=e.background_color||(null==r?void 0:r.color);return n.background=Q(l),a&&s&&(n.boxShadow=`inset 0 0 0 ${Z(s)} ${a}`),n}(i,t.shape,{color:t.color,stroke:t.stroke})}function Ht(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 Gt(t,e,r){let i;return i="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],i.map(Z).join(" ")}function Yt(t,e,r,i,n,o){o?t.push({top:r.bottom,left:n.left,width:n.right-n.left,height:i.top-r.bottom,style:e}):t.push({top:n.top,left:r.right,width:i.left-r.right,height:n.bottom-n.top,style:e})}function Zt(t,e,r,i){const n={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)&&Yt(t,e.style,{top:0,right:r[0].left-e.style.width,bottom:r[0].top-e.style.height,left:0},r[0],n,i),null==e?void 0:e.show_between)for(let o=0;o<r.length-1;++o)Yt(t,e.style,r[o],r[o+1],n,i);if(null==e?void 0:e.show_at_end){const o=r[r.length-1];Yt(t,e.style,o,{top:o.bottom+e.style.height,right:0,bottom:0,left:o.right+e.style.width},n,i)}}const Xt=O(((t,e,r,i)=>{let n,{orientation:o}=e,{separator:a}=e,{lineSeparator:s}=e;const l=function(t,e){let r,i=0,n=!1;return function(){const e=Date.now();return!i||Math.abs(e-i)>10?(i=e,r=t.apply(this,arguments)):(n||(n=!0,setTimeout((()=>{n=!1,r=t.apply(this,arguments)}),10)),r)}}((function(){if(!n)return;const t=n.getBoundingClientRect();c=[];let e=[...n.children].filter((t=>t!==d&&!t.classList.contains(G.outer__border))),r=[];for(;e.length;){const t=[],i=e.shift();t.push(i);let n=i.getBoundingClientRect(),a=n.right,s=n.bottom;for(;e.length;){let r=e[0],i=r.getBoundingClientRect();if("vertical"===o){if(i.top<s)break}else if(i.left<a)break;a=Math.max(a,i.right),s=Math.max(s,i.bottom),t.push(r),e.shift()}r.push(t)}const i=[];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&&Zt(c,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)))};i.push(r)})),s&&Zt(c,s,i,"horizontal"===o),c.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let d,c=[],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),n=null,(v&&n||p||g)&&(p&&(p.disconnect(),p=null),g&&(g.disconnect(),g=null),v&&n&&("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(n,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(g=new ResizeObserver(l),g.observe(n)))),v&&n&&l(),`\n\n<div${J("class","divkit-a7719",0)}${J("this",d,0)}>${P(c,(t=>`<div${J("class","divkit-c770e",0)}${B({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${J("class","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 Kt;function Qt(){if(void 0!==Kt)return Kt;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),Kt=1===t.scrollHeight,document.body.removeChild(t),Kt}const te=O(((t,e,i,n)=>{let o,s,l,d,u,c,p,g,h,f,m,y,b,_,w,$,x,k,E,C,F,A,V=r,j=r,D=r,S=r,z=r,T=r,I=r,O=r;var J,N,B,R,U,L;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(W);let et=!1,rt="vertical",it="top",nt="left",ot=null,at=null,st={};if(void 0===e.json&&i.json&&void 0!==H&&i.json(H),void 0===e.templateContext&&i.templateContext&&void 0!==G&&i.templateContext(G),void 0===e.origJson&&i.origJson&&void 0!==Y&&i.origJson(Y),void 0===e.layoutParams&&i.layoutParams&&void 0!==Z&&i.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),O(),O=a(l,(t=>A=t)),rt=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(A,rt),d=tt.getDerivedFromVars(H.content_alignment_vertical),I(),I=a(d,(t=>F=t)),it=Bt(F,it),u=tt.getDerivedFromVars(H.content_alignment_horizontal),T(),T=a(u,(t=>C=t)),nt=Nt(C,nt),c=tt.getDerivedFromVars(H.layout_mode),z(),z=a(c,(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&&Qt()){const t=qt(k.style,Q,(null==ot?void 0:ot.style)||null);ot=t?{show_at_start:Boolean(null!==(J=k.show_at_start)&&void 0!==J&&J),show_at_end:Boolean(null!==(N=k.show_at_end)&&void 0!==N&&N),show_between:Boolean(null===(B=k.show_between)||void 0===B||B),style:t}:null}else ot=null;if(h=tt.getDerivedFromVars(H.line_separator),D(),D=a(h,(t=>x=t)),(null==x?void 0:x.style)&&"overlap"!==rt&&Qt()){const t=qt(x.style,Q,(null==at?void 0:at.style)||null);at=t?{show_at_start:Boolean(null!==(R=x.show_at_start)&&void 0!==R&&R),show_at_end:Boolean(null!==(U=x.show_at_end)&&void 0!==U&&U),show_between:Boolean(null===(L=x.show_between)||void 0===L||L),style:t}:null}else at=null;f=ot||at?function(t,e,r){const i={};return Ht(i,e,"vertical"===t),Ht(i,r,"horizontal"===t),i}(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[nt],(!$||"wrap_content"===$.type||"match_parent"===$.type&&(null==Z?void 0:Z.parentVerticalWrapContent))&&(t.parentVerticalWrapContent=!0)),"vertical"!==rt&&(t.parentVAlign=K[it],("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=_t(t,st)}return b={orientation:rt,valign:it,halign:nt,wrap:p},_={gap:ot||at?Gt(rt,ot,at):void 0},V(),j(),D(),S(),z(),T(),I(),O(),et?"":`${M(Pt,"Outer").$$render(t,{cls:ct("container",Wt,b),style:_,json:H,origJson:Y,templateContext:G,layoutParams:Z,additionalPaddings:f},{},{default:()=>`${P(s,(e=>`${M(Ye,"Unknown").$$render(t,{layoutParams:st,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n\n ${ot||at?`${M(Xt,"ContainerSeparators").$$render(t,{separator:ot,lineSeparator:at,orientation:rt},{},{})}`:""}`})}`})),ee=te,re={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 ne=O(((t,e,i,n)=>{let o,s,l,d,u,c,p,g=r,{json:h={}}=e,{templateContext:f}=e,{origJson:m}=e,{layoutParams:y}=e;const b=v(W);let _="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&i.json&&void 0!==h&&i.json(h),void 0===e.templateContext&&i.templateContext&&void 0!==f&&i.templateContext(f),void 0===e.origJson&&i.origJson&&void 0!==m&&i.origJson(m),void 0===e.layoutParams&&i.layoutParams&&void 0!==y&&i.layoutParams(y),o=b.getDerivedFromVars(h.delimiter_style),g(),g=a(o,(t=>p=t)),_=ie(null==p?void 0:p.orientation,_),s=!((null==p?void 0:p.color)&&("transparent"===p.color||9===p.color.length&&0===p.color.indexOf("#00"))),w=Q(null==p?void 0:p.color,1,w),l="horizontal"===_?"100%":Z(1),d="horizontal"===_?Z(1):"100%",u={background:w,width:l,height:d},c={orientation:_},g(),`${M(Pt,"Outer").$$render(t,{cls:ct("separator",re,c),json:h,origJson:m,templateContext:f,layoutParams:y},{},{default:()=>s?`<span${J("class",re.separator__inner,0)}${J("style",Y(u),0)}></span>`:""})}`})),oe={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"},ae=O(((t,e,i,n)=>{let o,s,l,d,c,p,g,h,f,m,y,b,_,w,$,x,k,E,C,F,A,V,j,D,S,P,z,T,I,O,N,R,U,L,H=r,G=r,Z=r,X=r,K=r,tt=r,rt=r,it=r,nt=r,ot=r,lt=r,dt=r,ut=r,vt=r,{json:pt={}}=e,{templateContext:gt}=e,{origJson:ht}=e,{layoutParams:ft}=e;const yt=v(W);let bt,_t=0,$t="rgba(0,0,0,0.08)",xt=!1,kt="",Et="none",Ct="50% 50%",Ft="0",jt="source_in",Dt="",St="",zt=0,Mt=0,Tt=0,It="",Ot="";u((()=>{yt.removeSvgFilter(bt,jt)})),void 0===e.json&&i.json&&void 0!==pt&&i.json(pt),void 0===e.templateContext&&i.templateContext&&void 0!==gt&&i.templateContext(gt),void 0===e.origJson&&i.origJson&&void 0!==ht&&i.origJson(ht),void 0===e.layoutParams&&i.layoutParams&&void 0!==ft&&i.layoutParams(ft),o=yt.getDerivedFromVars(pt.image_url),vt(),vt=a(o,(t=>L=t)),s=yt.getDerivedFromVars(pt.gif_url),ut(),ut=a(s,(t=>U=t)),l=L||U,_t=0,l?xt=!1:(xt=!0,yt.logError(q(new Error('Missing "image_url" for "image"')))),d=yt.getDerivedFromVars(pt.width),dt(),dt=a(d,(t=>R=t)),c="wrap_content"===(null==R?void 0:R.type),p=yt.getDerivedFromVars(pt.height),lt(),lt=a(p,(t=>N=t)),g="wrap_content"===(null==N?void 0:N.type),h=yt.getDerivedFromVars(pt.preview),ot(),ot=a(h,(t=>O=t));{const t=O;kt=t?t.startsWith("data:")?`url("${et(t)}")`:`url("data:image/jpg;base64,${et(t)}")`:""}f=yt.getDerivedFromVars(pt.placeholder_color),nt(),nt=a(f,(t=>I=t)),$t=Q(I,1,$t),m=yt.getDerivedFromVars(pt.scale),it(),it=a(m,(t=>T=t)),Et=at(T)||Et,y=yt.getDerivedFromVars({content_alignment_horizontal:pt.content_alignment_horizontal,content_alignment_vertical:pt.content_alignment_vertical}),rt(),rt=a(y,(t=>z=t)),Ct=function(t,e){const r=t.content_alignment_horizontal,i=t.content_alignment_vertical;return r&&"left"!==r&&"center"!==r&&"right"!==r||i&&"top"!==i&&"center"!==i&&"bottom"!==i?e:st(t)}(z,Ct),b=yt.getDerivedFromVars(pt.accessibility),tt(),tt=a(b,(t=>P=t)),_=(null==P?void 0:P.description)||"",w=yt.getDerivedFromVars(pt.aspect),K(),K=a(w,(t=>S=t));{const t=null==S?void 0:S.ratio;Ft=t&&At(t)?(100/Number(t)).toFixed(2):"0"}$=yt.getDerivedFromVars(pt.tint_color),X(),X=a($,(t=>D=t)),x=yt.getDerivedFromVars(pt.tint_mode),Z(),Z=a(x,(t=>j=t));{const t=D,e=t?Q(t):void 0,r=Rt(j,jt);e===bt&&r===jt||(yt.removeSvgFilter(bt,jt),Dt=e?yt.addSvgFilter(e,r):"",bt=e,jt=r)}if(k=yt.getDerivedFromVars(pt.appearance_animation),G(),G=a(k,(t=>V=t)),V&&"fade"===V.type){const t=V;St=wt(t.interpolator,"ease_in_out").replace(/_/g,"-"),Tt=mt(t.duration,300),Mt=mt(t.start_delay,0),zt=mt(t.alpha,0)}E=yt.getDerivedFromVars(pt.filters),H(),H=a(E,(t=>A=t));{let t="",e="";Array.isArray(A)&&A.length&&(t=Vt(A,yt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),It=t,Ot=e}return C={aspect:"0"!==Ft,"is-width-content":c,"is-height-content":g,loaded:!1,"before-appearance":Boolean(St)&&!0},F={"background-image":kt,"background-color":kt?void 0:$t,"background-size":Et,"clip-path":Ot||void 0,"object-fit":Et,"object-position":Ct,filter:["",It].filter(Boolean).join(" "),"--divkit-appearance-interpolator":St||void 0,"--divkit-appearance-fade-start":St?zt:void 0,"--divkit-appearance-delay":St?`${Mt}ms`:void 0,"--divkit-appearance-duration":St?`${Tt}ms`:void 0},H(),G(),Z(),X(),K(),tt(),rt(),it(),nt(),ot(),lt(),dt(),ut(),vt(),xt?"":`${M(Pt,"Outer").$$render(t,{cls:ct("image",oe,C),json:pt,origJson:ht,templateContext:gt,layoutParams:ft,customDescription:!0},{},{default:()=>C.aspect?`<span${J("class",oe["image__aspect-wrapper"],0)}${B({"padding-bottom":`${Ft}%`})}><img${J("class",oe.image__image,0)}${J("src",l,0)} loading="lazy" decoding="async"${J("style",Y(F),0)}${J("alt",_,0)}${J("aria-hidden",_?null:"true",0)}></span>`:`<img${J("class",oe.image__image,0)}${J("src",l,0)} loading="lazy" decoding="async"${J("style",Y(F),0)}${J("alt",_,0)}${J("aria-hidden",_?null:"true",0)}>`})}`})),se={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 le(t){return t>0&&t<1}function de(t){return String(Math.ceil(1e3*t)/1e3)}function ue(t,e,r){if(t.some(le)){const e=Math.max(...t.filter(le).map((t=>1/t)));t=t.map((t=>t*e))}let i=0,n=0;const o=[];if(t.every(Boolean)){n=t.reduce(((t,e)=>t+e),0);for(let o=0;o<r;++o){if(!e[o])continue;const r=e[o]/t[o]*n;r>i&&(i=r)}}for(let e=0;e<r;++e)i?o[e]=`minmax(${Z(i*t[e]/n)},${de(t[e])}fr)`:t[e]?o[e]=`${de(t[e])}fr`:o[e]="auto";return o.join(" ")}const ce=O(((t,e,i,n)=>{let o,s,l,d,u,c,p,g,h,f,m,y,b=r,_=r,w=r,$=r,{json:x={}}=e,{templateContext:k}=e,{origJson:E}=e,{layoutParams:C}=e;const F=v(W);let A,V,j=!1,D=1,S=[],z=[],T=[],I=[],O=0,J=!1,N="top",B="left";void 0===e.json&&i.json&&void 0!==x&&i.json(x),void 0===e.templateContext&&i.templateContext&&void 0!==k&&i.templateContext(k),void 0===e.origJson&&i.origJson&&void 0!==E&&i.origJson(E),void 0===e.layoutParams&&i.layoutParams&&void 0!==C&&i.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=Mt(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=L(t,(t=>[...t])),w(),w=a(A,(t=>m=t))}{const t={};let e=0,r=0;S=[],z=[],T=[],I=[],J=!1,V=l.map(((i,n)=>{var o,a,s,l;const d=m[n],u=Number(d.columnSpan)||1,c=Number(d.rowSpan)||1,v={x:e,y:r,colSpan:u,rowSpan:c},p="match_parent"===(null===(o=d.width)||void 0===o?void 0:o.type)?Number(d.width.weight||1)/u:0,g="match_parent"===(null===(a=d.height)||void 0===a?void 0:a.type)?Number(d.height.weight||1)/c:0,h=1===u&&"fixed"===(null===(s=d.width)||void 0===s?void 0:s.type)&&d.width.value?Number(d.width.value)/u:0,f=1===c&&"fixed"===(null===(l=d.height)||void 0===l?void 0:l.type)&&d.height.value?Number(d.height.value)/c:0;for(let i=e;i<e+u;++i)for(let e=r;e<r+c;++e)t[i+"_"+e]?J=!0:(t[i+"_"+e]=!0,(!S[i]||S[i]<p)&&(S[i]=p),(!z[e]||z[e]<g)&&(z[e]=g),(!T[i]||T[i]<h)&&(T[i]=h),(!I[e]||I[e]<f)&&(I[e]=f));do{++e,e>=D&&(e=0,++r)}while(t[e+"_"+r]);return Object.assign(Object.assign({},i),{layoutParams:{gridArea:v,fakeElement:(null==C?void 0:C.fakeElement)||!1}})})),0!==e&&(J=!0),J&&F.logError(q(new Error('Mismatching "grid" rows/columns'))),O=r}return d=F.getDerivedFromVars(x.content_alignment_vertical),_(),_=a(d,(t=>f=t)),N=Bt(f,N),u=F.getDerivedFromVars(x.content_alignment_horizontal),b(),b=a(u,(t=>h=t)),B=Nt(h,B),c={valign:N,halign:B},p={"grid-template-columns":ue(S,T,D),"grid-template-rows":ue(z,I,O)},g=j||J,b(),_(),w(),$(),g?"":`${M(Pt,"Outer").$$render(t,{cls:ct("grid",se,c),json:x,origJson:E,templateContext:k,style:p,layoutParams:C},{},{default:()=>`${P(V,(e=>`${M(Ye,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),ve=ce,pe={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 ge(t){const e=[];let r=t[0],i=1;for(let n=1;n<=t.length;n++)t[n]!==r?(e.push(i>1?`repeat(${i}, ${r})`:r),r=t[n],i=1):i++;return e.join(" ")}function he(t,e){let r;return function(...i){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,i),r=null}),e)}}const fe=O(((t,e,i,n)=>{let o,s,l,d,c,p,g,h,f,m,y,b,_,w,$,x,k,E,C,F,A,V,D,S,z,T,I,O,N,B=r,R=r,U=r,H=r,G=r,X=r,K=r,Q=r,tt=r,et=r,{json:rt={}}=e,{templateContext:it}=e,{origJson:nt}=e,{layoutParams:ot}=e;const at=v(W);let st,lt,dt=[],ut=!1,vt=!1,pt=null,gt=!1;const ht=at.getCustomization("galleryLeftClass"),yt=at.getCustomization("galleryRightClass");let bt=!1;O=a(at.isDesktop,(t=>I=t));let wt,$t,xt,kt,Et=1,Ct="horizontal",Ft="start",At=8,Vt="",jt=[],Dt={},St=!1,zt={},Tt=0;const It=he((function(){const t=st.scrollLeft,e=st.scrollWidth,r=st.offsetWidth;ut=t>2,vt=t+r<e-2}),50);function Ot(){let t=[],e=dt[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<Et;++e){const i=dt[e].children[r];i&&t.push(i)}return t}function Jt(t,e,r="smooth"){const i="horizontal"===Ct,n=i?"offsetLeft":"offsetTop",o=i?"left":"top";st.scroll({[o]:Math.max(0,t[e][n]-At/2),behavior:r})}function Nt(t){const e=Ot(),r=st.getBoundingClientRect(),i=e.findIndex((t=>function(t,e){return"horizontal"===Ct?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}(r,t.getBoundingClientRect())));if(-1!==i)return i;const n=e.map((t=>function(t,e){return"horizontal"===Ct?e.right>t.left&&t.right>e.left:e.bottom>t.top&&t.bottom>e.top}(r,t.getBoundingClientRect()))),o=n.findIndex(Boolean);return-1!==o?"prev"===t&&2===n.filter(Boolean).length?o+1:o:"prev"===t?1:e.length-2}!rt.id||bt||(null==ot?void 0:ot.fakeElement)||at.registerInstance(rt.id,{setCurrentItem(t){const e=Ot();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Jt(e,t)},setPreviousItem(t){const e=Nt("prev"),r=Ot();let i=e-1;i<0&&(i="ring"===t?r.length-1:e),Jt(r,i)},setNextItem(t){const e="horizontal"===Ct?st.scrollLeft+st.offsetWidth===st.scrollWidth:st.scrollTop+st.offsetHeight===st.scrollHeight,r=Ot();if(e&&"ring"===t)return void Jt(r,0);const i=Nt("next");let n=i+1;n>r.length-1&&(n="ring"===t?0:i),Jt(r,n)}}),u((()=>{gt=!1,rt.id&&!(null==ot?void 0:ot.fakeElement)&&at.unregisterInstance(rt.id)})),void 0===e.json&&i.json&&void 0!==rt&&i.json(rt),void 0===e.templateContext&&i.templateContext&&void 0!==it&&i.templateContext(it),void 0===e.origJson&&i.origJson&&void 0!==nt&&i.origJson(nt),void 0===e.layoutParams&&i.layoutParams&&void 0!==ot&&i.layoutParams(ot),o=rt.items,(null==o?void 0:o.length)&&Array.isArray(o)?bt=!1:(bt=!0,at.logError(q(new Error('Incorrect or empty "items" prop for div "gallery"')))),s=(!bt&&o||[]).map((t=>{let e=t,r=it;return({templateContext:r,json:e}=at.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=I&&gt&&!bt,l?"undefined"!=typeof ResizeObserver&&(pt=new ResizeObserver((()=>{It()})),pt.observe(lt)):pt&&(pt.disconnect(),pt=null),d=at.getDerivedFromVars(rt.column_count),tt(),tt=a(d,(t=>T=t)),Et=Mt(T,Et),c=function(t,e){let r=0,i=[];for(let n=0;n<t.length;++n)i[r]||(i[r]=[]),i[r].push(t[n]),++r>=e&&(r=0);return i}(s,Et),p=at.getDerivedFromVars(rt.orientation),Q(),Q=a(p,(t=>z=t)),Ct=ie(z,Ct),g=at.getDerivedFromVars(rt.cross_content_alignment),K(),K=a(g,(t=>S=t)),Ft=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(S,Ft),h=at.getDerivedFromVars(rt.item_spacing),X(),X=a(h,(t=>D=t)),At=mt(D,At),wt=Z(At),f=at.getDerivedFromVars(rt.cross_spacing),G(),G=a(f,(t=>V=t)),xt=mt(V,At),$t=Z(xt),m=at.getDerivedFromVars(rt.paddings),H(),H=a(m,(t=>A=t)),Vt=ft(A,Vt),y="horizontal"===Ct?"grid-template-columns":"grid-template-rows";{let t=[];s.forEach((e=>{const r="horizontal"===Ct?"width":"height";t.push(at.getDerivedFromVars(e.json[r]))})),kt=L(t,(t=>t)),U(),U=a(kt,(t=>F=t))}jt=[],Et>1?jt.push("auto"):F.forEach((t=>{!t&&"horizontal"===Ct||"match_parent"===(null==t?void 0:t.type)?jt.push("100%"):jt.push("max-content")})),b=at.getDerivedFromVars(rt.scroll_mode),R(),R=a(b,(t=>C=t));{const t={};let e={};St=!1,(null==ot?void 0:ot.fakeElement)&&(e.fakeElement=!0),"horizontal"===Ct?e.parentVAlign=Ft:e.parentHAlign=Ft,"paging"===C&&(St=!0,e.scrollSnap="start",t["horizontal"===Ct?"scroll-padding-left":"scroll-padding-top"]=Z(At/2)),1===Et&&(e.parentLayoutOrientation=Ct),Dt=_t(t,Dt),zt=_t(e,zt)}return _=at.getDerivedFromVars(rt.restrict_parent_scroll),et(),et=a(_,(t=>N=t)),w={padding:Vt,"grid-gap":$t},$={"grid-gap":wt,[y]:ge(jt)},x={orientation:Ct,"scroll-snap":St},k=at.getDerivedFromVars(rt.default_item),B(),B=a(k,(t=>E=t)),Tt=mt(E,Tt),B(),R(),U(),H(),G(),X(),K(),Q(),tt(),O(),et(),"\n\n"+(bt?"":`${M(Pt,"Outer").$$render(t,{cls:ct("gallery",pe,x),json:rt,origJson:nt,templateContext:it,layoutParams:ot,customPaddings:!0,customActions:"gallery"},{},{default:()=>`<div class="${j(pe.gallery__scroller,!0)+" "+j(N?"divkit-aa145":"",!0)}"${J("style",Y(Dt),0)}${J("this",st,0)}><div${J("class",pe["gallery__items-grid"],0)}${J("style",Y(w),0)}${J("this",lt,0)}>${P(c,((e,r)=>`<div${J("class",pe.gallery__items,0)}${J("style",Y($),0)}${J("this",dt[r],0)}>${P(e,(e=>`${M(Ye,"Unknown").$$render(t,{layoutParams:zt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===Ct?`${ut&&l?`<div${J("class",ht||`${pe.gallery__arrow} ${pe.gallery__arrow_left}`,0)}>${ht?"":`<svg${J("class",pe["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${J("class",pe["gallery__arrow-icon-path"],0)} d="m10 16 8.3 8 1.03-1-4-6-.7-1 .7-1 4-6-1.03-1z"></path></svg>`}</div>`:""}\n ${vt&&l?`<div${J("class",yt||`${pe.gallery__arrow} ${pe.gallery__arrow_right}`,0)}>${yt?"":`<svg${J("class",pe["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${J("class",pe["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>`:""}`:""}`})}`)})),me=fe,ye={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=O(((t,e,i,n)=>{let o,s,l,d,c,p,g,h,f,m,y,_,w,$,x,k,E,C,F,A,V=r,D=r,S=r,z=r,T=r,I=r,O=r,N=r;var R;let{json:U={}}=e,{templateContext:L}=e,{origJson:H}=e,{layoutParams:G}=e;const X=v(W),K=X.genId("tabs");let tt,et,rt,it=!1,nt={};const ot=X.getJsonWithVars(U.selected_tab);let at,st,lt=ot&&Number(ot)||0,dt=12,ut="",vt="",pt="",gt="",mt="",yt="",bt="",wt="",$t="",xt="",Et=!1,Ct=!1,Vt=lt,jt=[],Dt=[];async function St(t,e=!1){if(Vt=lt,lt=t,Et||(Et=!0,et.style.height=Z(et.clientHeight),rt.style.transform=`translate3d(${100*-Vt}%,0,0)`),Ct=!0,async function(t){await b(),rt.style.transform=`translate3d(${t}%,0,0)`}(100*-lt),function(t=!1){const e=t?Math.max(0,lt-1):Math.min(lt,Vt),r=t?Math.min(o.length-1,lt+1):Math.max(lt,Vt);jt=jt.map(((t,i)=>t||i>=e&&i<=r)),Dt=Dt.map(((t,i)=>i>=e&&i<=r))}(),async function(){await b();const t=document.getElementById(`${K}-panel-${lt}`);t&&(et.style.height=Z(t.offsetHeight))}(),Tt&&clearTimeout(Tt),Tt=window.setTimeout((()=>{Dt=o.map(((t,e)=>e===lt))}),400),zt=-lt*et.clientWidth,e){await b();const t=tt.querySelector(`.${ye.tabs__item_selected}`);t&&t.focus()}}let zt,Tt=null;!U.id||it||(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&&i.json&&void 0!==U&&i.json(U),void 0===e.templateContext&&i.templateContext&&void 0!==L&&i.templateContext(L),void 0===e.origJson&&i.origJson&&void 0!==H&&i.origJson(H),void 0===e.layoutParams&&i.layoutParams&&void 0!==G&&i.layoutParams(G),o=U.items||[],(null==o?void 0:o.length)&&Array.isArray(o)?it=!1:(it=!0,X.logError(q(new Error('Incorrect or empty "items" prop for div "tabs"')))),s=X.getDerivedFromVars(U.width),O(),O=a(s,(t=>F=t)),l=X.getDerivedFromVars(U.height),I(),I=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),nt=_t(t,nt)}if(!it&&(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),d=X.getDerivedFromVars(U.tab_title_style),T(),T=a(d,(t=>E=t)),c=E||{},dt=Mt(c.font_size,dt),c.font_size||c.paddings){const t=c.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/dt*10,right:(Number(t.right)||0)/dt*10,bottom:(Number(t.bottom)||0)/dt*10,left:(Number(t.left)||0)/dt*10};ut=ft(e,ut)}{const t=c.line_height;void 0!==t&&At(t)&&(vt=Z(t/dt*10))}{const t=c.letter_spacing;void 0!==t&&ht(t)&&(pt=Z(t/dt*10))}if(c.corner_radius||c.corners_radius||c.font_size){const t=null!==(R=c.corner_radius)&&void 0!==R?R:1e3;c.corners_radius?gt=function(t,e,r,i){const n=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<n.length;++t)if(n[t]&&!ht(n[t]))return i;return kt(t,e,r)}(c.corners_radius,t,dt,gt):ht(t)&&(gt=Z(t/dt*10))}return at=It(c.active_font_weight||c.font_weight,at),st=It(c.inactive_font_weight||c.font_weight,st),mt=Q(c.active_text_color,1,mt),yt=Q(c.inactive_text_color,1,yt),bt=Q(c.active_background_color,1,bt),wt=Q(c.inactive_background_color,1,wt),p=X.getDerivedFromVars(U.has_separator),z(),z=a(p,(t=>k=t)),g=X.getDerivedFromVars(U.separator_color),S(),S=a(g,(t=>x=t)),h=X.getDerivedFromVars(U.separator_paddings),D(),D=a(h,(t=>$=t)),k&&(x&&($t=Q(x,1,$t)),$&&(xt=ft($,xt))),f={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),_=X.getDerivedFromVars(U.restrict_parent_scroll),N(),N=a(_,(t=>A=t)),it||(jt=o.map(((t,e)=>e===lt)),Dt=o.map(((t,e)=>e===lt))),V(),D(),S(),z(),T(),I(),O(),N(),it?"":`${M(Pt,"Outer").$$render(t,{cls:ct("tabs",ye,{}),json:U,origJson:H,templateContext:L,layoutParams:G,customActions:"tabs"},{},{default:()=>`<div class="${j(ye.tabs__list,!0)+" "+j(A?"divkit-aa145":"",!0)}" role="tablist"${B({"--divkit-tabs-font-size":Z(dt),"--divkit-tabs-paddings":ut,"--divkit-tabs-line-height":vt,"--divkit-tabs-letter-spacing":pt,"--divkit-tabs-active-font-weight":at||"","--divkit-tabs-inactive-font-weight":st||"","--divkit-tabs-active-text-color":mt,"--divkit-tabs-inactive-text-color":yt,"--divkit-tabs-active-background-color":bt,"--divkit-tabs-inactive-background-color":wt,"--divkit-tabs-border-radius":gt})}${J("this",tt,0)}>${P(o,((e,r)=>{let i=r===lt;return`\n\n ${M(Ft,"Actionable").$$render(t,{cls:ct("tabs__item",ye,{selected:i,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:!i||null!=G&&G.fakeElement?"-1":e.title_click_action?void 0:"0","aria-selected":i?"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${J("class",ye.tabs__separator,0)}${J("style",Y(f),0)}></div>`:""}\n <div class="${j(ye.tabs__panels,!0)+" "+j(A?"divkit-aa145":"",!0)}"${J("this",et,0)}><div${J("class",ct("tabs__swiper",ye,{inited:Et,animated:Ct}),0)}${J("this",rt,0)}>${P(o,((e,r)=>`<div${J("class",ct("tabs__panel",ye,{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(Ye,"Unknown").$$render(t,{div:e.div,templateContext:L,layoutParams:nt},{},{})}`:""}\n </div>`))}</div></div>`})}`})),_e=be;function we(t){return e=>{if(e<=0)return 0;if(e>=1)return 1;const r=e*t.length,i=Math.floor(r),n=r-i;return t[i]*n+t[i+1]*(1-n)}}we([.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]),we([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 $e=O(((t,e,r,i)=>{let n,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const d=v(W),p=v(vt);let g=new Map,h=new Set,f=!1,m=null,y=[],_=[],w=[],$=[];const x=o.div_id||o.id;let k;x?(null==l?void 0:l.fakeElement)||(p.registerInstance(x,{async setState(t){if(k===t)return;d.setRunning("stateChange",!0),new Set(h),y.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),y=[],$.forEach((t=>{g.set(t.id,t.node.getBoundingClientRect())})),_=[],w=[],$=[];const e=n.find((e=>e.state_id===t))||null;e?(k=t,E=e):d.logError(q(new Error("Cannot find state with id"),{additional:{stateId:t}})),await b()},getChild(t){if(m&&m.has(t))return m.get(t);d.logError(q(new Error("Missing state block with id"),{additional:{id:t}}))}}),c(vt,{registerInstance(t,e){m||(m=new Map),m.has(t)?d.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,i,n)=>Promise.resolve(),registerChildWithTransitionIn(t,e,r,i){const n={json:t,templateContext:e,transitions:r,node:i};return _.push(n),new Promise((t=>{n.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,i){const n={json:t,templateContext:e,transitions:r,node:i};return w.push(n),new Promise((t=>{n.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,i){const n=t.id;if(!n)return Promise.resolve();const o={id:n,json:t,templateContext:e,transitions:r,node:i};return $.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&g.has(t),registerChild(t){h.add(t)},unregisterChild(t){h.delete(t)}})):(f=!0,d.logError(q(new Error('Missing "id" prop for div "state"'))));let E=null;const C=d.getJsonWithVars(o.default_state_id);let F=!1;return u((()=>{x&&!(null==l?void 0:l.fakeElement)&&p.unregisterInstance(x)})),void 0===e.json&&r.json&&void 0!==o&&r.json(o),void 0===e.templateContext&&r.templateContext&&void 0!==a&&r.templateContext(a),void 0===e.origJson&&r.origJson&&void 0!==s&&r.origJson(s),void 0===e.layoutParams&&r.layoutParams&&void 0!==l&&r.layoutParams(l),o&&(h=new Set),n=o.states||[],(null==n?void 0:n.length)?f=!1:(f=!0,d.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||d.logError(q(new Error("Cannot find state for default_state_id"),{additional:{selectedId:k}}))):(E=t[0],k=E.state_id)))}(n),f?"":`${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(Ye,"Unknown").$$render(t,{div:E.div,templateContext:a},{},{})}`:""}\n <div${J("class","divkit-adaae",0)} aria-hidden="true"${J("this",undefined,0)}>${P(y,(e=>"direction"in e?`<div${J("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${J("class","divkit-e08c6",0)}>${M(Ye,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`:`<div${J("class","divkit-eb860",0)}><div${J("class","divkit-e08c6",0)}>${M(Ye,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`))}</div>`}})}`})),xe={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f"},ke=O(((t,e,i,n)=>{let o,s,l,d,c,p,g,h,f,m,y,b,_,w,$,x,k,E=r,C=r,F=r,A=r,V=r,D=r;var S,z,T,I,O,N,B;let{json:R={}}=e,{templateContext:U}=e,{origJson:L}=e,{layoutParams:H}=e;const G=v(W),K=G.genId("pager");let Q,tt=!1,et=0,rt=0,it=!1,nt="horizontal",ot="",at="",st="";function lt(t,e="smooth"){const r="horizontal"===nt,i=Q.children[t],n=r?"offsetLeft":"offsetTop",o=r?"left":"top";Q.scroll({[o]:i[n],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,i=t.getBoundingClientRect(),"horizontal"===nt?i.left>=r.left&&i.right<=r.right:i.top>=r.top&&i.bottom<=r.bottom;var r,i}));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&&i.json&&void 0!==R&&i.json(R),void 0===e.templateContext&&i.templateContext&&void 0!==U&&i.templateContext(U),void 0===e.origJson&&i.origJson&&void 0!==L&&i.origJson(L),void 0===e.layoutParams&&i.layoutParams&&void 0!==H&&i.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=>_=t)),_?"percentage"!==_.type&&"fixed"!==_.type?(it=!0,G.logError(q(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):it=!1:(it=!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)),nt=ie(x,nt),d=G.getDerivedFromVars(R.item_spacing),A(),A=a(d,(t=>$=t));{const t=null==$?void 0:$.value;t&&ht(t)&&(ot=Z(t||0))}if(c=G.getDerivedFromVars(R.paddings),F(),F=a(c,(t=>w=t)),at=ft(w,at),p=G.getDerivedFromVars(R.restrict_parent_scroll),D(),D=a(p,(t=>k=t)),g="horizontal"===nt?"grid-auto-columns":"grid-auto-rows","fixed"===(null==_?void 0:_.type)){const t=X("horizontal"===nt?((null===(z=R.paddings)||void 0===z?void 0:z.left)||0)+((null===(T=R.paddings)||void 0===T?void 0:T.right)||0):((null===(I=R.paddings)||void 0===I?void 0:I.top)||0)+((null===(O=R.paddings)||void 0===O?void 0:O.bottom)||0)),e=null===(N=_.neighbour_page_width)||void 0===N?void 0:N.value;st=e?`calc(100% + ${t} - 2 * ${X(e)} - 2 * ${ot})`:"100%"}else if("percentage"===(null==_?void 0:_.type)){const t=null===(B=_.page_width)||void 0===B?void 0:B.value;st=`${Number(t)}%`}return h={"grid-gap":ot,padding:at,[g]:st},f={orientation:nt},m=tt||it,y=G.getStore("pagers"),E(),E=a(y,(t=>b=t)),function(t,e){const r=R.id;if(r){const o=new Map(b);i=y,b=o.set(r,{instId:K,size:t,currentItem:e,scrollToPagerItem:lt}),n=b,i.set(n)}var i,n}(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:ct("pager",xe,f),json:R,origJson:L,templateContext:U,layoutParams:H,customPaddings:!0},{},{default:()=>`<div class="${j(xe.pager__items,!0)+" "+j(k?"divkit-aa145":"",!0)}"${J("style",Y(h),0)}${J("this",Q,0)}>${P(o,(e=>`<div${J("class",xe.pager__item,0)}>${M(Ye,"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=ke,Ce={indicator:"divkit-d8e3f",indicator__scroller:"divkit-b5db0",indicator__items:"divkit-d5d94",indicator__item:"divkit-f6629",indicator_placement_default:"divkit-c1670",indicator__item_active:"divkit-b39cd",indicator_placement_stretch:"divkit-b6bd3"},Fe=O(((t,e,i,n)=>{let o,s,l,d,u,c,p,g,h,f,m,y,_,w,$,x,k,E,C,F=r,A=r,V=r,D=r,S=r,z=r,T=r,I=r,O=r;var N,R;let{json:U={}}=e,{templateContext:L}=e,{origJson:q}=e,{layoutParams:H}=e;const G=["rounded_rectangle","circle"],Y=v(W);let X,K,tt,et={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},rt={width:10,height:10,borderRadius:5,background:"#33919cb5"},it="default",nt=15,ot=10,at=5;if(void 0===e.json&&i.json&&void 0!==U&&i.json(U),void 0===e.templateContext&&i.templateContext&&void 0!==L&&i.templateContext(L),void 0===e.origJson&&i.origJson&&void 0!==q&&i.origJson(q),void 0===e.layoutParams&&i.layoutParams&&void 0!==H&&i.layoutParams(H),o=Y.getDerivedFromVars(U.shape),z(),z=a(o,(t=>x=t)),s=Y.getDerivedFromVars(U.active_item_color),D(),D=a(s,(t=>w=t)),l=Y.getDerivedFromVars(U.inactive_item_color),S(),S=a(l,(t=>$=t)),d=Y.getDerivedFromVars(U.active_item_size),T(),T=a(d,(t=>k=t)),u=Y.getDerivedFromVars(U.active_shape),O(),O=a(u,(t=>C=t)),c=Y.getDerivedFromVars(U.inactive_shape),I(),I=a(c,(t=>E=t)),C&&(et=qt({type:"shape_drawable",shape:C},G,et)),E&&(rt=qt({type:"shape_drawable",shape:E},G,rt)),!C&&!E&&x){const t=Mt(k,1.3);rt=qt({type:"shape_drawable",shape:x,color:rt.background},G,rt),rt.background=Q($,1,rt.background),et=Object.assign(Object.assign({},rt),{width:rt.width*t,height:rt.height*t,borderRadius:rt.borderRadius*t,background:et.background}),et.background=Q(w,1,et.background)}if(p=Y.getDerivedFromVars(U.space_between_centers),A(),A=a(p,(t=>y=t)),g=Y.getDerivedFromVars(U.items_placement),V(),V=a(g,(t=>_=t)),!_||"default"!==_.type&&"stretch"!==_.type)it="default",y&&(nt=mt(y.value,nt));else if(it=_.type,"default"===it)nt=mt(null===(N=_.space_between_centers)||void 0===N?void 0:N.value,nt);else if("stretch"===it){const t=_;ot=Mt(t.max_visible_items,ot),at=mt(null===(R=t.item_spacing)||void 0===R?void 0:R.value,at)}return h=Y.getStore("pagers"),F(),F=a(h,(t=>m=t)),async function(t){if(U.pager_id&&t.has(U.pager_id)){tt=t.get(U.pager_id),await b();const e=K.children[tt.currentItem].offsetLeft;X.scroll({left:e-X.clientWidth/2,behavior:"smooth"})}}(m),f={placement:it},F(),A(),V(),D(),S(),z(),T(),I(),O(),`${M(Pt,"Outer").$$render(t,{cls:ct("indicator",Ce,f),json:U,origJson:q,templateContext:L,layoutParams:H},{},{default:()=>`<div${J("class",Ce.indicator__scroller,0)}${J("this",X,0)}><div${J("class",Ce.indicator__items,0)} role="tablist"${B({margin:"default"===it?`0 ${Z(Math.max(0,et.width-rt.width)/2)}`:"","--divkit-indicator-inactive-width":Z(rt.width),"--divkit-indicator-inactive-height":Z(rt.height),"--divkit-indicator-inactive-border-radius":Z(rt.borderRadius),"--divkit-indicator-inactive-background":rt.background||"","--divkit-indicator-inactive-box-shadow":rt.boxShadow||"","--divkit-indicator-active-width":Z(et.width),"--divkit-indicator-active-height":Z(et.height),"--divkit-indicator-active-border-radius":Z(et.borderRadius),"--divkit-indicator-active-background":et.background||"","--divkit-indicator-active-box-shadow":et.boxShadow||"","--divkit-indicator-active-scale":et.width/rt.width,"--divkit-indicator-default-margin":"default"===it?`0 ${Z((nt-rt.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===it?Z(at):"","--divkit-indicator-stretch-max-count":"stretch"===it?ot:"","--divkit-indicator-stretch-max-spacer":"stretch"===it?Z((ot-1)*at):""})}${J("this",K,0)}>${tt?`${P(Array(tt.size),((t,e)=>{let r=e===tt.currentItem;return`\n <div class="${j(ct("indicator__item",Ce,{active:r}),!0)+" "+j("divkit-bd259",!0)}" role="tab" id="${j(tt.instId,!0)+"-tab-"+j(e,!0)}" aria-controls="${j(tt.instId,!0)+"-panel-"+j(e,!0)}"${J("aria-selected",r?"true":"false",0)}${J("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),Ae=Fe,Ve={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 je(t,e){if(!t||!t.font_size)return e;const r=t.offset,i=t.text_color&&Q(t.text_color)||"#000",n=Tt(t.font_weight);if(At(t.font_size)&&"transparent"!==i){var o,a;const e={fontSize:Z(t.font_size),fontWeight:n,textColor:i};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 De(t,e,r){return Math.max(e,Math.min(r,t))}const Se=-2147483648,Pe=Number.MAX_VALUE,ze=Number.MIN_VALUE,Me="string",Te="integer",Ie="number",Oe="boolean",Je="color",Ne="datetime";class Be{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 Re={string:class extends Be{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends Be{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 Be{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 Be{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 Be{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 Be{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function Ue(t,e,r){if(!(e in Re))throw new Error("Unsupported variable type");return new Re[e](t,r)}function Le(t,e,r,i,n){let o=[];if(n)for(let n=t;n<e;++n)o.push((n-r)/(i-r));else{for(let e=r;e<t;++e)o.push((e-r)/(i-r));for(let t=e;t<i+1;++t)o.push((t-r)/(i-r))}return o}const We=O(((t,e,i,n)=>{let o,s,l,d,u,c,p,g,h,f,m,y,b,_,w,$,x,k,E,C,F,A,V,D,S,z,T,I,O,N,R,U,L,H,G,Y,K=r,Q=r,tt=r,et=r,rt=r,it=r,nt=r,ot=r,at=r,st=r,lt=r,dt=r;var ut,vt,pt,gt;let{json:ft={}}=e,{templateContext:mt}=e,{origJson:yt}=e,{layoutParams:bt}=e;const _t={width:10,height:10,borderRadius:5,background:"#000"},wt=["rounded_rectangle","circle"],xt=["rounded_rectangle"],kt=v(W),Et=v(Ct);let Ft=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")||Ue("temp","integer",0),(t=>L=t)),U=a(jt&&kt.getVariable(jt,"integer")||Ue("temp","integer",0),(t=>R=t));let Dt,St,zt,Mt=De(L||0,Ft,At),Tt=De(R||0,Ft,At),It=_t,Ot=It,Jt=_t,Nt=_t,Bt=null,Rt=null,Ut=zt,Lt="",Wt="",Ht=!1;he((function(){}),50),void 0===e.json&&i.json&&void 0!==ft&&i.json(ft),void 0===e.templateContext&&i.templateContext&&void 0!==mt&&i.templateContext(mt),void 0===e.origJson&&i.origJson&&void 0!==yt&&i.origJson(yt),void 0===e.layoutParams&&i.layoutParams&&void 0!==bt&&i.layoutParams(bt),o=kt.getDerivedFromVars(ft.min_value),dt(),dt=a(o,(t=>Y=t)),s=kt.getDerivedFromVars(ft.max_value),lt(),lt=a(s,(t=>G=t)),Ft=$t(Y,Ft),At=$t(G,At);{const t=De(L||0,Ft,At);t!==Mt&&(Mt=t)}{const t=De(R||0,Ft,At);t!==Tt&&(Tt=t)}l=kt.getDerivedFromVars(ft.thumb_style),st(),st=a(l,(t=>N=t)),It=qt(N,wt,It),d=kt.getDerivedFromVars(ft.thumb_secondary_style),at(),at=a(d,(t=>O=t)),Ot=qt(O,wt,It),u=kt.getDerivedFromVars(ft.track_inactive_style),ot(),ot=a(u,(t=>I=t)),Jt=qt(I,xt,Jt),c=kt.getDerivedFromVars(ft.track_active_style),nt(),nt=a(c,(t=>T=t)),Nt=qt(T,xt,Nt),p=kt.getDerivedFromVars(ft.tick_mark_active_style),it(),it=a(p,(t=>z=t));{let t=qt(z,wt,_t);t!==_t&&(Bt=t)}Dt=Bt?jt?Le(Math.min(Mt,Tt),Math.max(Mt,Tt)+1,Ft,At,!0):Le(Ft,Mt,Ft,At,!0):[],g=kt.getDerivedFromVars(ft.tick_mark_inactive_style),rt(),rt=a(g,(t=>S=t));{let t=qt(S,wt,_t);t!==_t&&(Rt=t)}St=Rt?jt?Le(Math.min(Mt,Tt),Math.max(Mt,Tt)+1,Ft,At,!1):Le(Mt+1,At+1,Ft,At,!0):[],h=kt.getDerivedFromVars(ft.thumb_text_style),et(),et=a(h,(t=>D=t)),zt=je(D,zt),f=kt.getDerivedFromVars(ft.thumb_secondary_text_style),tt(),tt=a(f,(t=>V=t)),Ut=je(V,zt),m=kt.getDerivedFromVars(ft.accessibility),Q(),Q=a(m,(t=>A=t)),(null==A?void 0:A.description)?Lt=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)?Wt=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):It===_t?(kt.logError(q(new Error('Missing "thumb_style" in slider'))),t=!0):Nt===_t?(kt.logError(q(new Error('Missing "track_active_style" in slider'))),t=!0):Jt===_t&&(kt.logError(q(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==Ht&&(Ht=t)}return b=Z(Math.max(...[It.width,Ot.width,0].filter(ht))),_=Z(Math.max(...[It.height,Ot.height,0].filter(ht))),w=(Mt-Ft)/(At-Ft),$=jt?(Tt-Ft)/(At-Ft):void 0,x=void 0!==$?Math.abs($-w):w,k=void 0!==$?Math.min($,w):0,E={"--divkit-slider-thumb-width":Z(It.width),"--divkit-slider-thumb-height":Z(It.height),"--divkit-slider-thumb-secondary-width":Z(Ot.width),"--divkit-slider-thumb-secondary-height":Z(Ot.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===(vt=null==zt?void 0:zt.offset)||void 0===vt?void 0:vt.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":b,"--divkit-slider-max-thumb-height":_,"--divkit-slider-track-part":w,"--divkit-slider-track-secondary-part":$},C={},K(),Q(),tt(),et(),rt(),it(),nt(),ot(),at(),st(),U(),H(),lt(),dt(),"\n\n"+(Ht?"":`${M(Pt,"Outer").$$render(t,{cls:ct("slider",Ve,C),style:E,customDescription:!0,customActions:"slider",json:ft,origJson:yt,templateContext:mt,layoutParams:bt},{},{default:()=>{var t,e,r,i,n,o;return`<div${J("class",Ve["slider__tracks-wrapper"],0)}><div${J("class",Ve["slider__tracks-inner"],0)}${J("this",undefined,0)}><div${J("class",Ve.slider__track,0)}${B({height:Z(Jt.height),"border-radius":Z(Jt.borderRadius),background:Jt.background,"box-shadow":Jt.boxShadow||""})}></div>\n <div${J("class",Ve["slider__active-track"],0)}${B({left:(100*k).toFixed(2)+"%",width:(100*x).toFixed(2)+"%",height:Z(Nt.height),"border-radius":Z(Nt.borderRadius),background:Nt.background,"box-shadow":Nt.boxShadow||""})}></div>\n ${P(Dt,(t=>`<div class="${j(Ve.slider__tick,!0)+" "+j(Ve.slider__tick_active,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n ${P(St,(t=>`<div class="${j(Ve.slider__tick,!0)+" "+j(Ve.slider__tick_inactive,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n <div${J("class",Ve.slider__thumb,0)}${B({"border-radius":Z(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${zt?`<div${J("class",Ve["slider__thumb-text"],0)}><div${J("class",Ve["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(Ve.slider__thumb,!0)+" "+j(Ve.slider__thumb_secondary,!0)}"${B({"border-radius":Z(Ot.borderRadius),background:Ot.background,"box-shadow":Ot.boxShadow||""})}>${Ut?`<div class="${j(Ve["slider__thumb-text"],!0)+" "+j(Ve["slider__thumb-text_secondary"],!0)}"><div${J("class",Ve["slider__thumb-text-inner"],0)}${B({"font-size":(null===(i=Ut)||void 0===i?void 0:i.fontSize)||"1em","font-weight":(null===(n=Ut)||void 0===n?void 0:n.fontWeight)||"",color:(null===(o=Ut)||void 0===o?void 0:o.textColor)||"#000"})}>${j(Tt)}</div></div>`:""}</div>`:""}\n <input type="range"${J("class",Ve.slider__input,0)}${J("min",Ft,0)}${J("max",At,0)} step="1"${J("value",Mt,0)}${J("aria-label",Lt,0)}>\n ${jt?`<input type="range"${J("class",`${Ve.slider__input} ${Ve.slider__input_secondary}`,0)}${J("min",Ft,0)}${J("max",At,0)} step="1"${J("value",Tt,0)}${J("aria-label",Wt,0)}>`:""}</div></div>`}})}`)})),qe={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"},He={text:Lt,container:ee,separator:ne,image:ae,gif:ae,grid:ve,gallery:me,tabs:_e,state:$e,pager:Ee,indicator:Ae,slider:We,input:O(((t,e,i,n)=>{let o,s,l,d,u,c,p,g,h,f,m,y,b,_,w,$,x,k,E,C,F,A,V,D,S,P,z,T,I,O,N,B,R=r,U=r,{json:L={}}=e,{templateContext:H}=e,{origJson:G}=e,{layoutParams:Y}=e;const K=v(W);let tt;const et=K.getJsonWithVars(L.text_variable);let rt=!1;et||(rt=!0,K.logError(q(new Error('Missing "text_variable" in "input"')))),O=a(et&&K.getVariable(et,"string")||Ue("temp","string",""),(t=>I=t));let it="";T=a(K.getDerivedFromVars(L.hint_text),(t=>z=t)),P=a(K.getDerivedFromVars(L.hint_color),(t=>S=t));let nt="";D=a(K.getDerivedFromVars(L.font_size),(t=>V=t));let ot,at,st=12;A=a(K.getDerivedFromVars(L.font_weight),(t=>F=t)),C=a(K.getDerivedFromVars(L.line_height),(t=>E=t)),k=a(K.getDerivedFromVars(L.letter_spacing),(t=>x=t));let lt="";$=a(K.getDerivedFromVars(L.text_color),(t=>w=t));let dt="#000";_=a(K.getDerivedFromVars(L.highlight_color),(t=>b=t));let ut="";y=a(K.getDerivedFromVars(L.keyboard_type),(t=>m=t));const vt={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let pt="multi_line_text",ht="text";f=a(K.getDerivedFromVars(L.max_visible_lines),(t=>h=t));let ft="",yt="";B=a(K.getDerivedFromVars(L.select_all_on_focus),(t=>N=t)),void 0===e.json&&i.json&&void 0!==L&&i.json(L),void 0===e.templateContext&&i.templateContext&&void 0!==H&&i.templateContext(H),void 0===e.origJson&&i.origJson&&void 0!==G&&i.origJson(G),void 0===e.layoutParams&&i.layoutParams&&void 0!==Y&&i.layoutParams(Y),it=I,o=z,nt=Q(S,1,nt),st=Mt(V,st),ot=It(F,ot);{const t=E;At(t)&&(at=t/st)}return gt(x)&&(lt=Z(x/st*10)),dt=Q(w,1,dt),ut=Q(b,1,ut),m&&m in vt&&(ht=vt[m],pt=m),s="multi_line_text"===pt,l=K.getDerivedFromVars(L.paddings),U(),U=a(l,(t=>g=t)),At(h)&&(ft=`calc(${h*(at||1.25)+"em"} + ${X(mt(null==g?void 0:g.top,0)+mt(null==g?void 0:g.bottom,0))})`),d=K.getDerivedFromVars(L.accessibility),R(),R=a(d,(t=>p=t)),(null==p?void 0:p.description)?yt=p.description:K.logError(q(new Error('Missing accessibility "description" for input'),{level:"warn"})),u={"highlight-color":Boolean(ut),"vertical-overflow":!1,multiline:s},c={"--divkit-input-hint-color":nt,"--divkit-input-highlight-color":ut,"font-size":Z(st),"font-weight":ot,"line-height":at,"letter-spacing":lt,color:dt,"max-height":ft},R(),U(),f(),y(),_(),$(),k(),C(),A(),D(),P(),T(),O(),B(),rt?"":`${M(Pt,"Outer").$$render(t,{cls:ct("input",qe,u),style:c,customDescription:!0,customActions:"input",json:L,origJson:G,templateContext:H,layoutParams:Y},{},{default:()=>`<span${J("class",qe.input__wrapper,0)}><span${J("class",qe.input__holder,0)} aria-hidden="true"${J("this",undefined,0)}>\n ${j(it)}${it.endsWith("\n")||!it?"​":""}</span>\n ${s?`<textarea${J("class",qe.input__input,0)} autocomplete="off" autocapitalize="off"${J("aria-label",yt,0)}${J("placeholder",o,0)}${J("this",tt,0)}>${j(it,!0)}</textarea>`:`<input${J("type",ht,0)}${J("class",qe.input__input,0)} autocomplete="off" autocapitalize="off"${J("aria-label",yt,0)}${J("placeholder",o,0)}${J("value",it,0)}${J("this",tt,0)}>`}</span>`})}`}))},Ge=O(((t,e,r,i)=>{let{div:n}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=v(W);let d,u,c;if(void 0===e.div&&r.div&&void 0!==n&&r.div(n),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),d=n,u=o,c=d&&He[d.type]||void 0,!c&&(({templateContext:u,json:d}=l.processTemplate(d,u)),c=d&&He[d.type]||void 0,!c)){let t;t=(null==d?void 0:d.type)&&l.hasTemplate(d.type)?"Recursive template":"Unknown component",l.logError(q(new Error(t),{additional:{component:(null==d?void 0:d.type)||"<missing>"}}))}return c?`${M(c||z,"svelte:component").$$render(t,{json:d,templateContext:u,layoutParams:s,origJson:a||n},{},{})}`:""})),Ye=Ge,Ze=O(((t,e,r,i)=>{let{svgFiltersMap:n}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==n&&r.svgFiltersMap(n),Object.keys(n).length?`<svg${J("class","divkit-dc22b",0)} aria-hidden="true"><defs>${P([...Object.keys(n)],(t=>{let[e,r]=t.split(":");return`\n <filter${J("id",n[t],0)}><feFlood${J("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${J("operator",r.split("_")[1],0)}></feComposite>`:"multiply"===r?'<feComposite in2="SourceGraphic" operator="arithmetic" k1="1" k2="0" k3="0" k4="0"></feComposite>':`<feBlend in2="SourceGraphic"${J("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function Xe(t,e,r,i){const n=r[t.type];if(!n)return i(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,n){const o=Object.keys(n).filter((t=>"__proto__"!==t)),s=o.filter((t=>"$"!==t.charAt(0))),l=o.filter((t=>"$"===t.charAt(0)));return s.forEach((t=>{const i=n[t];"object"==typeof i&&null!==i?(r[t]=Array.isArray(i)?[]:{},e(r[t],i)):r[t]=i})),l.forEach((e=>{const o=n[e],s=a[o];if(void 0!==s){const t=e.substring(1);r[t]=s}else i(q(new Error("Missing template field"),{level:"warn",additional:{key:e,template:t.type}}))})),r}({},n);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(s[o]=t[o]);return{json:s,templateContext:a}}function Ke(){}function Qe(t){return{subscribe:e=>(e(t),Ke)}}function tr(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function er(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function rr(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 nr(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function or(t,e,r,i){var n=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(n,or.prototype),n.expected=e,n.found=r,n.location=i,n.name="SyntaxError",n}function ar(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function sr(t,e){var r,i={},n=(e=void 0!==e?e:{}).grammarSource,o={start:Vt,JsonStringContents:function(){var t,e,r;for(t=ft,e=[],r=jt();r!==i;)e.push(r),r=jt();return mt=t,e=ht(e)}},a=Vt,s="@{",l="}",d="@{}",u="\\",c="||",v="&&",p="==",g="!=",h=">=",f="<=",m="+",y="-",b="true",_="false",w=/^[^}]/,$=/^[^'}]/,x=/^[0-9]/,k=/^[a-zA-Z_0-9.]/,E=/^[a-zA-Z_]/,C=/^[ \t\r\n]/,F=xt("@{",!1),A=xt("}",!1),V=xt("@{}",!1),j=xt("\\",!1),D={type:"any"},S=kt(["}"],!0,!1),P=xt("?",!1),z=xt(":",!1),M=xt("||",!1),T=xt("&&",!1),I=xt("==",!1),O=xt("!=",!1),J=xt(">=",!1),N=xt(">",!1),B=xt("<=",!1),R=xt("<",!1),U=xt("+",!1),L=xt("-",!1),W=xt("/",!1),q=xt("*",!1),H=xt("%",!1),G=xt("!",!1),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),it=Et("number"),nt=xt(".",!1),ot=xt("e",!1),at=xt("E",!1),st=Et("boolean"),lt=xt("true",!1),dt=xt("false",!1),ut=kt([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),ct=Et("identifier"),vt=kt([["a","z"],["A","Z"],"_"],!1,!1),pt=Et("whitespace"),gt=kt([" ","\t","\r","\n"],!1,!1),ht=function(t){return rr(t)},ft=0,mt=0,yt=[{line:1,column:1}],bt=0,_t=[],wt=0;if("startRule"in e){if(!(e.startRule in o))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=o[e.startRule]}function $t(){return t.substring(mt,ft)}function xt(t,e){return{type:"literal",text:t,ignoreCase:e}}function kt(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function Et(t){return{type:"other",description:t}}function Ct(e){var r,i=yt[e];if(i)return i;for(r=e-1;!yt[r];)r--;for(i={line:(i=yt[r]).line,column:i.column};r<e;)10===t.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return yt[e]=i,i}function Ft(t,e){var r=Ct(t),i=Ct(e);return{source:n,start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:i.line,column:i.column}}}function At(t){ft<bt||(ft>bt&&(bt=ft,_t=[]),_t.push(t))}function Vt(){var t,e;return t=ft,Ut(),(e=Dt())!==i?(Ut(),mt=t,t=e):(ft=t,t=i),t}function jt(){var e,r,n,o,a;if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=i,0===wt&&At(F)),r!==i?(n=Ut(),(o=Dt())!==i?(Ut(),125===t.charCodeAt(ft)?(a=l,ft++):(a=i,0===wt&&At(A)),a!==i?(mt=e,e=o):(ft=e,e=i)):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=ft,t.substr(ft,3)===d?(r=d,ft+=3):(r=i,0===wt&&At(V)),r!==i&&(mt=e,r=""),(e=r)===i&&(e=ft,r=ft,wt++,92===t.charCodeAt(ft)?(n=u,ft++):(n=i,0===wt&&At(j)),n===i&&(t.substr(ft,2)===s?(n=s,ft+=2):(n=i,0===wt&&At(F))),wt--,n===i?r=void 0:(ft=r,r=i),r!==i?(t.length>ft?(n=t.charAt(ft),ft++):(n=i,0===wt&&At(D)),n!==i?(mt=e,e=$t()):(ft=e,e=i)):(ft=e,e=i),e===i))){if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=i,0===wt&&At(F)),r!==i){if(n=[],w.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(S)),o!==i)for(;o!==i;)n.push(o),w.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(S));else n=i;n!==i?(125===t.charCodeAt(ft)?(o=l,ft++):(o=i,0===wt&&At(A)),o!==i?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ft=e,e=i)):(ft=e,e=i)}else ft=e,e=i;e===i&&(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=i,0===wt&&At(F)),r!==i&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===i&&(e=ft,92===t.charCodeAt(ft)?(r=u,ft++):(r=i,0===wt&&At(j)),r!==i?(t.substr(ft,2)===s?(n=s,ft+=2):(n=i,0===wt&&At(F)),n!==i?(mt=e,e=n):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=ft,92===t.charCodeAt(ft)?(r=u,ft++):(r=i,0===wt&&At(j)),r!==i?(t.length>ft?(n=t.charAt(ft),ft++):(n=i,0===wt&&At(D)),n!==i?(mt=e,e=nr(n)):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=ft,92===t.charCodeAt(ft)?(r=u,ft++):(r=i,0===wt&&At(j)),r!==i&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Dt(){var e,r,n,o,a,s;return e=ft,(r=St())!==i?(Ut(),63===t.charCodeAt(ft)?(n="?",ft++):(n=i,0===wt&&At(P)),n!==i?(Ut(),(o=Dt())!==i?(Ut(),58===t.charCodeAt(ft)?(a=":",ft++):(a=i,0===wt&&At(z)),a!==i?(Ut(),(s=Dt())!==i?(mt=e,e={type:"ConditionalExpression",test:r,consequent:o,alternate:s}):(ft=e,e=i)):(ft=e,e=i)):(ft=e,e=i)):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=St()),e}function St(){var e,r,n,o,a,s,l,d;if(e=ft,(r=Pt())!==i){for(n=[],o=ft,a=Ut(),t.substr(ft,2)===c?(s=c,ft+=2):(s=i,0===wt&&At(M)),s!==i?(l=Ut(),(d=Pt())!==i?o=a=[a,s,l,d]:(ft=o,o=i)):(ft=o,o=i);o!==i;)n.push(o),o=ft,a=Ut(),t.substr(ft,2)===c?(s=c,ft+=2):(s=i,0===wt&&At(M)),s!==i?(l=Ut(),(d=Pt())!==i?o=a=[a,s,l,d]:(ft=o,o=i)):(ft=o,o=i);mt=e,e=er(r,n)}else ft=e,e=i;return e}function Pt(){var e,r,n,o,a,s,l,d;if(e=ft,(r=zt())!==i){for(n=[],o=ft,a=Ut(),t.substr(ft,2)===v?(s=v,ft+=2):(s=i,0===wt&&At(T)),s!==i?(l=Ut(),(d=zt())!==i?o=a=[a,s,l,d]:(ft=o,o=i)):(ft=o,o=i);o!==i;)n.push(o),o=ft,a=Ut(),t.substr(ft,2)===v?(s=v,ft+=2):(s=i,0===wt&&At(T)),s!==i?(l=Ut(),(d=zt())!==i?o=a=[a,s,l,d]:(ft=o,o=i)):(ft=o,o=i);mt=e,e=er(r,n)}else ft=e,e=i;return e}function zt(){var e,r,n,o,a,s,l,d;if(e=ft,(r=Mt())!==i){for(n=[],o=ft,a=Ut(),t.substr(ft,2)===p?(s=p,ft+=2):(s=i,0===wt&&At(I)),s===i&&(t.substr(ft,2)===g?(s=g,ft+=2):(s=i,0===wt&&At(O))),s!==i?(l=Ut(),(d=Mt())!==i?o=a=[a,s,l,d]:(ft=o,o=i)):(ft=o,o=i);o!==i;)n.push(o),o=ft,a=Ut(),t.substr(ft,2)===p?(s=p,ft+=2):(s=i,0===wt&&At(I)),s===i&&(t.substr(ft,2)===g?(s=g,ft+=2):(s=i,0===wt&&At(O))),s!==i?(l=Ut(),(d=Mt())!==i?o=a=[a,s,l,d]:(ft=o,o=i)):(ft=o,o=i);mt=e,e=tr(r,n)}else ft=e,e=i;return e}function Mt(){var e,r,n,o,a,s,l,d;if(e=ft,(r=Tt())!==i){for(n=[],o=ft,a=Ut(),t.substr(ft,2)===h?(s=h,ft+=2):(s=i,0===wt&&At(J)),s===i&&(62===t.charCodeAt(ft)?(s=">",ft++):(s=i,0===wt&&At(N)),s===i&&(t.substr(ft,2)===f?(s=f,ft+=2):(s=i,0===wt&&At(B)),s===i&&(60===t.charCodeAt(ft)?(s="<",ft++):(s=i,0===wt&&At(R))))),s!==i?(l=Ut(),(d=Tt())!==i?o=a=[a,s,l,d]:(ft=o,o=i)):(ft=o,o=i);o!==i;)n.push(o),o=ft,a=Ut(),t.substr(ft,2)===h?(s=h,ft+=2):(s=i,0===wt&&At(J)),s===i&&(62===t.charCodeAt(ft)?(s=">",ft++):(s=i,0===wt&&At(N)),s===i&&(t.substr(ft,2)===f?(s=f,ft+=2):(s=i,0===wt&&At(B)),s===i&&(60===t.charCodeAt(ft)?(s="<",ft++):(s=i,0===wt&&At(R))))),s!==i?(l=Ut(),(d=Tt())!==i?o=a=[a,s,l,d]:(ft=o,o=i)):(ft=o,o=i);mt=e,e=tr(r,n)}else ft=e,e=i;return e}function Tt(){var e,r,n,o,a,s,l,d;if(e=ft,(r=It())!==i){for(n=[],o=ft,a=Ut(),43===t.charCodeAt(ft)?(s=m,ft++):(s=i,0===wt&&At(U)),s===i&&(45===t.charCodeAt(ft)?(s=y,ft++):(s=i,0===wt&&At(L))),s!==i?(l=Ut(),(d=It())!==i?o=a=[a,s,l,d]:(ft=o,o=i)):(ft=o,o=i);o!==i;)n.push(o),o=ft,a=Ut(),43===t.charCodeAt(ft)?(s=m,ft++):(s=i,0===wt&&At(U)),s===i&&(45===t.charCodeAt(ft)?(s=y,ft++):(s=i,0===wt&&At(L))),s!==i?(l=Ut(),(d=It())!==i?o=a=[a,s,l,d]:(ft=o,o=i)):(ft=o,o=i);mt=e,e=tr(r,n)}else ft=e,e=i;return e}function It(){var e,r,n,o,a,s,l,d;if(e=ft,(r=Ot())!==i){for(n=[],o=ft,a=Ut(),47===t.charCodeAt(ft)?(s="/",ft++):(s=i,0===wt&&At(W)),s===i&&(42===t.charCodeAt(ft)?(s="*",ft++):(s=i,0===wt&&At(q)),s===i&&(37===t.charCodeAt(ft)?(s="%",ft++):(s=i,0===wt&&At(H)))),s!==i?(l=Ut(),(d=Ot())!==i?o=a=[a,s,l,d]:(ft=o,o=i)):(ft=o,o=i);o!==i;)n.push(o),o=ft,a=Ut(),47===t.charCodeAt(ft)?(s="/",ft++):(s=i,0===wt&&At(W)),s===i&&(42===t.charCodeAt(ft)?(s="*",ft++):(s=i,0===wt&&At(q)),s===i&&(37===t.charCodeAt(ft)?(s="%",ft++):(s=i,0===wt&&At(H)))),s!==i?(l=Ut(),(d=Ot())!==i?o=a=[a,s,l,d]:(ft=o,o=i)):(ft=o,o=i);mt=e,e=tr(r,n)}else ft=e,e=i;return e}function Ot(){var e,r,n;return(e=Bt())===i&&(e=Nt())===i&&(e=ft,33===t.charCodeAt(ft)?(r="!",ft++):(r=i,0===wt&&At(G)),r===i&&(43===t.charCodeAt(ft)?(r=m,ft++):(r=i,0===wt&&At(U)),r===i&&(45===t.charCodeAt(ft)?(r=y,ft++):(r=i,0===wt&&At(L)))),r!==i?(Ut(),(n=Ot())!==i?(mt=e,e={type:"UnaryExpression",operator:r,argument:n}):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=function(){var e,r,n,o,a;return e=ft,(r=Rt())!==i?(Ut(),40===t.charCodeAt(ft)?(n="(",ft++):(n=i,0===wt&&At(Y)),n!==i?(Ut(),o=function(){var e,r,n,o,a,s,l;if(e=ft,(r=Dt())!==i){for(n=[],o=ft,Ut(),44===t.charCodeAt(ft)?(a=",",ft++):(a=i,0===wt&&At(X)),a!==i?(Ut(),(s=Dt())!==i?o=s:(ft=o,o=i)):(ft=o,o=i);o!==i;)n.push(o),o=ft,Ut(),44===t.charCodeAt(ft)?(a=",",ft++):(a=i,0===wt&&At(X)),a!==i?(Ut(),(s=Dt())!==i?o=s:(ft=o,o=i)):(ft=o,o=i);mt=e,l=n,e=[r,...l]}else ft=e,e=i;return e===i&&(e=Ut()),e}(),o!==i?(Ut(),41===t.charCodeAt(ft)?(a=")",ft++):(a=i,0===wt&&At(Z)),a!==i?(mt=e,e={type:"CallExpression",callee:r,arguments:o}):(ft=e,e=i)):(ft=e,e=i)):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=ft,(r=Rt())!==i&&(mt=e,r={type:"Variable",id:r}),(e=r)===i&&(e=function(){var e,r,n,o;return e=function(){var e,r,n,o;return wt++,e=ft,39===t.charCodeAt(ft)?(r="'",ft++):(r=i,0===wt&&At(Q)),r!==i?(n=function(){var t,e,r;for(t=ft,e=[],r=Jt();r!==i;)e.push(r),r=Jt();return mt=t,e=rr(e)}(),39===t.charCodeAt(ft)?(o="'",ft++):(o=i,0===wt&&At(Q)),o!==i?(mt=e,e=n):(ft=e,e=i)):(ft=e,e=i),wt--,e===i&&(r=i,0===wt&&At(K)),e}(),e===i&&(e=Bt())===i&&(e=Nt())===i&&(e=function(){var e,r;return wt++,e=ft,t.substr(ft,4)===b?(r=b,ft+=4):(r=i,0===wt&&At(lt)),r!==i&&(mt=e,r={type:"BooleanLiteral",value:!0}),(e=r)===i&&(e=ft,t.substr(ft,5)===_?(r=_,ft+=5):(r=i,0===wt&&At(dt)),r!==i&&(mt=e,r={type:"BooleanLiteral",value:!1}),e=r),wt--,e===i&&(r=i,0===wt&&At(st)),e}(),e===i&&(e=ft,40===t.charCodeAt(ft)?(r="(",ft++):(r=i,0===wt&&At(Y)),r!==i&&(n=Dt())!==i?(41===t.charCodeAt(ft)?(o=")",ft++):(o=i,0===wt&&At(Z)),o!==i?(mt=e,e=n):(ft=e,e=i)):(ft=e,e=i))),e}())),e}())),e}function Jt(){var e,r,n,o,a;if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=i,0===wt&&At(F)),r!==i?(n=Ut(),(o=Dt())!==i?(Ut(),125===t.charCodeAt(ft)?(a=l,ft++):(a=i,0===wt&&At(A)),a!==i?(mt=e,e=o):(ft=e,e=i)):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=ft,t.substr(ft,3)===d?(r=d,ft+=3):(r=i,0===wt&&At(V)),r!==i&&(mt=e,r=""),(e=r)===i&&(e=ft,r=ft,wt++,92===t.charCodeAt(ft)?(n=u,ft++):(n=i,0===wt&&At(j)),n===i&&(39===t.charCodeAt(ft)?(n="'",ft++):(n=i,0===wt&&At(Q)),n===i&&(t.substr(ft,2)===s?(n=s,ft+=2):(n=i,0===wt&&At(F)))),wt--,n===i?r=void 0:(ft=r,r=i),r!==i?(t.length>ft?(n=t.charAt(ft),ft++):(n=i,0===wt&&At(D)),n!==i?(mt=e,e=$t()):(ft=e,e=i)):(ft=e,e=i),e===i))){if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=i,0===wt&&At(F)),r!==i){if(n=[],$.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(tt)),o!==i)for(;o!==i;)n.push(o),$.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(tt));else n=i;n!==i?(125===t.charCodeAt(ft)?(o=l,ft++):(o=i,0===wt&&At(A)),o!==i?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ft=e,e=i)):(ft=e,e=i)}else ft=e,e=i;e===i&&(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=i,0===wt&&At(F)),r!==i&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===i&&(e=ft,92===t.charCodeAt(ft)?(r=u,ft++):(r=i,0===wt&&At(j)),r!==i?(t.substr(ft,2)===s?(n=s,ft+=2):(n=i,0===wt&&At(F)),n!==i?(mt=e,e=n):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=ft,92===t.charCodeAt(ft)?(r=u,ft++):(r=i,0===wt&&At(j)),r!==i?(t.length>ft?(n=t.charAt(ft),ft++):(n=i,0===wt&&At(D)),n!==i?(mt=e,e=nr(n)):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=ft,92===t.charCodeAt(ft)?(r=u,ft++):(r=i,0===wt&&At(j)),r!==i&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Nt(){var e,r,n,o;if(wt++,e=ft,45===t.charCodeAt(ft)?(r=y,ft++):(r=i,0===wt&&At(L)),r===i&&(r=null),n=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(rt)),o!==i)for(;o!==i;)n.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(rt));else n=i;return n!==i?(mt=e,e={type:"IntegerLiteral",value:ir($t())}):(ft=e,e=i),wt--,e===i&&(r=i,0===wt&&At(et)),e}function Bt(){var e,r,n,o,a,s,l,d,u,c;for(wt++,e=ft,45===t.charCodeAt(ft)?(r=y,ft++):(r=i,0===wt&&At(L)),r===i&&(r=null),n=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(rt));o!==i;)n.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(rt));if(46===t.charCodeAt(ft)?(o=".",ft++):(o=i,0===wt&&At(nt)),o!==i){if(a=[],x.test(t.charAt(ft))?(s=t.charAt(ft),ft++):(s=i,0===wt&&At(rt)),s!==i)for(;s!==i;)a.push(s),x.test(t.charAt(ft))?(s=t.charAt(ft),ft++):(s=i,0===wt&&At(rt));else a=i;if(a!==i){if(s=ft,101===t.charCodeAt(ft)?(l="e",ft++):(l=i,0===wt&&At(ot)),l===i&&(69===t.charCodeAt(ft)?(l="E",ft++):(l=i,0===wt&&At(at))),l!==i){if(43===t.charCodeAt(ft)?(d=m,ft++):(d=i,0===wt&&At(U)),d===i&&(45===t.charCodeAt(ft)?(d=y,ft++):(d=i,0===wt&&At(L))),d===i&&(d=null),u=[],x.test(t.charAt(ft))?(c=t.charAt(ft),ft++):(c=i,0===wt&&At(rt)),c!==i)for(;c!==i;)u.push(c),x.test(t.charAt(ft))?(c=t.charAt(ft),ft++):(c=i,0===wt&&At(rt));else u=i;u!==i?s=l=[l,d,u]:(ft=s,s=i)}else ft=s,s=i;s===i&&(s=null),mt=e,e={type:"NumberLiteral",value:parseFloat($t())}}else ft=e,e=i}else ft=e,e=i;if(e===i){if(e=ft,45===t.charCodeAt(ft)?(r=y,ft++):(r=i,0===wt&&At(L)),r===i&&(r=null),n=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(rt)),o!==i)for(;o!==i;)n.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(rt));else n=i;if(n!==i)if(101===t.charCodeAt(ft)?(o="e",ft++):(o=i,0===wt&&At(ot)),o===i&&(69===t.charCodeAt(ft)?(o="E",ft++):(o=i,0===wt&&At(at))),o!==i){if(43===t.charCodeAt(ft)?(a=m,ft++):(a=i,0===wt&&At(U)),a===i&&(45===t.charCodeAt(ft)?(a=y,ft++):(a=i,0===wt&&At(L))),a===i&&(a=null),s=[],x.test(t.charAt(ft))?(l=t.charAt(ft),ft++):(l=i,0===wt&&At(rt)),l!==i)for(;l!==i;)s.push(l),x.test(t.charAt(ft))?(l=t.charAt(ft),ft++):(l=i,0===wt&&At(rt));else s=i;s!==i?(mt=e,e={type:"NumberLiteral",value:parseFloat($t())}):(ft=e,e=i)}else ft=e,e=i;else ft=e,e=i}return wt--,e===i&&(r=i,0===wt&&At(it)),e}function Rt(){var e,r,n,o,a;if(wt++,e=ft,r=ft,wt++,n=function(){var e,r,n,o;return e=ft,t.substr(ft,4)===b?(r=b,ft+=4):(r=i,0===wt&&At(lt)),r===i&&(t.substr(ft,5)===_?(r=_,ft+=5):(r=i,0===wt&&At(dt))),r!==i?(n=ft,wt++,k.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(ut)),wt--,o===i?n=void 0:(ft=n,n=i),n!==i?e=r=[r,n]:(ft=e,e=i)):(ft=e,e=i),e}(),wt--,n===i?r=void 0:(ft=r,r=i),r!==i)if(E.test(t.charAt(ft))?(n=t.charAt(ft),ft++):(n=i,0===wt&&At(vt)),n!==i){for(o=[],k.test(t.charAt(ft))?(a=t.charAt(ft),ft++):(a=i,0===wt&&At(ut));a!==i;)o.push(a),k.test(t.charAt(ft))?(a=t.charAt(ft),ft++):(a=i,0===wt&&At(ut));mt=e,e={type:"Identifier",name:$t()}}else ft=e,e=i;else ft=e,e=i;return wt--,e===i&&(r=i,0===wt&&At(ct)),e}function Ut(){var e,r;for(wt++,e=[],C.test(t.charAt(ft))?(r=t.charAt(ft),ft++):(r=i,0===wt&&At(gt));r!==i;)e.push(r),C.test(t.charAt(ft))?(r=t.charAt(ft),ft++):(r=i,0===wt&&At(gt));return wt--,r=i,0===wt&&At(pt),e}if((r=a())!==i&&ft===t.length)return r;throw r!==i&&ft<t.length&&At({type:"end"}),function(t,e,r){return new or(or.buildMessage(t,e),t,e,r)}(_t,bt<t.length?t.charAt(bt):null,bt<t.length?Ft(bt,bt+1):Ft(bt,bt))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(or,Error),or.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,i=null;for(r=0;r<t.length;r++)if(t[r].source===this.location.source){i=t[r].text.split(/\r\n|\n|\r/g);break}var n=this.location.start,o=this.location.source+":"+n.line+":"+n.column;if(i){var a=this.location.end,s=ar("",n.line.toString().length," "),l=i[n.line-1],d=(n.line===a.line?a.column:l.length+1)-n.column||1;e+="\n --\x3e "+o+"\n"+s+" |\n"+n.line+" | "+l+"\n"+s+" | "+ar("",n.column-1," ")+ar("",d,"^")}else e+="\n at "+o}return e},or.buildMessage=function(t,e){var r={literal:function(t){return'"'+n(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 i(t){return t.charCodeAt(0).toString(16).toUpperCase()}function n(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"+i(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+i(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"+i(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+i(t)}))}function a(t){return r[t.type](t)}return"Expected "+function(t){var e,r,i=t.map(a);if(i.sort(),i.length>0){for(e=1,r=1;e<i.length;e++)i[e-1]!==i[e]&&(i[r]=i[e],r++);i.length=r}switch(i.length){case 1:return i[0];case 2:return i[0]+" or "+i[1];default:return i.slice(0,-1).join(", ")+", or "+i[i.length-1]}}(t)+" but "+function(t){return t?'"'+n(t)+'"':"end of input"}(e)+" found."};const lr=new Map,dr=new Map;function ur(t,e,r){const i={args:e,cb:r},n=lr.get(t)||[];lr.has(t)||lr.set(t,n),n.push(i);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");dr.set(o,i)}function cr(t,e){let r=t.args.length,i=t.args.length;const n=t.args[t.args.length-1];if("object"==typeof n&&n.isVararg&&(--r,i=1/0),e.length<r)return{type:"few",expected:r,found:e.length};if(e.length>i)return{type:"many",expected:i,found:e.length};for(let r=0;r<e.length;++r){let i=r>=t.args.length?t.args[t.args.length-1]:t.args[r];if("object"!=typeof i&&(i={type:i}),i.type!==e[r].type)return{type:"mismatch",expected:i.type,found:e[r].type}}return{type:"match"}}function vr(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=>{vr(t,e)}));break;case"BinaryExpression":case"LogicalExpression":vr(t.left,e),vr(t.right,e);break;case"UnaryExpression":vr(t.argument,e);break;case"ConditionalExpression":vr(t.test,e),vr(t.consequent,e),vr(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{vr(t,e)}))}}function pr(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function gr(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 gr(t.value);if("color"===t.type)return kr(xr(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function fr(t){let e=hr(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function mr(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}const yr=new Int32Array(1);function br(t){return yr[0]=t,yr[0]}function _r(t){if(t<Se||t>2147483647)throw new Error("Integer overflow.")}function wr(t){const e=[];return vr(t,{Variable(t){e.push(t.id.name)}}),e}function $r(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function xr(t){const e=tt(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function kr(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:Me,value:hr(t)}}function Cr(t){const e=Number(t.value);if(isNaN(e)||!Number.isFinite(e))throw new Error("Unable to convert value to Number.");return{type:Ie,value:e}}function Fr(t,e,r){if(!r.value.length)return"";let i="";const n=t.type===Me?t.value:hr(t);for(;i.length+n.length<e.value;)i+=r.value;return i.length>0&&i.length+n.length>e.value&&(i=i.substring(0,e.value-n.length)),i}function Ar(t,e,r){const i=Fr(t,e,r);return{type:Me,value:i+hr(t)}}function Vr(t,e,r){const i=Fr(t,e,r);return{type:Me,value:hr(t)+i}}function jr(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value/e.value;return t.type===Te&&(r=br(r)),{type:t.type,value:r}}function Dr(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value%e.value;return t.type===Te&&(r=br(r)),{type:t.type,value:r}}function Sr(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e*=t[r].value,t[0].type===Te&&(e=br(e));return{type:t[0].type,value:e}}function Pr(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e-=t[r].value,t[0].type===Te&&(e=br(e));return{type:t.length?t[0].type:Te,value:e}}function zr(...t){let e=0;for(let r=0;r<t.length;++r)e+=t[r].value,t[0].type===Te&&(e=br(e));return{type:t.length?t[0].type:Te,value:e}}function Mr(t){const e=Math.abs(t.value);return t.type===Te&&_r(e),{type:t.type,value:e}}function Tr(...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 Ir(...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 Or(t){return{type:t.type,value:Math.sign(t.value)}}function Jr(t,e){let r;if(0===e.value&&t.type===Te)r=t.value;else if(0===t.value&&t.type===Te)r=0;else{let i=Math.sign(e.value);t.type===Ie&&0===i&&(i=Object.is(i,0)?1:-1),r=Math.abs(t.value)*i}return t.type===Te&&_r(r),{type:t.type,value:r}}function Nr(t){return e=>{const r=xr(e.value);return{type:Ie,value:r[t]/255}}}function Br(t){return(e,r)=>{const i=xr(e.value);return i[t]=255*r.value,{type:Je,value:kr(i)}}}const Rr=Nr("a"),Ur=Nr("r"),Lr=Nr("g"),Wr=Nr("b"),qr=Br("a"),Hr=Br("r"),Gr=Br("g"),Yr=Br("b");function Zr(t,e,r){if(t.value<0)throw new Error("Expecting non-negative number of milliseconds.");let i=Math.floor(t.value/e);return r&&(i%=r),{type:Te,value:i}}function Xr(t){return t.map(fr).join(", ")}ur("toString",[Te],Er),ur("toString",[Ie],Er),ur("toString",[Oe],Er),ur("toString",[Je],Er),ur("toString",["url"],Er),ur("toNumber",[Te],Cr),ur("toNumber",[Me],Cr),ur("toInteger",[Ie],(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:Te,value:e}})),ur("toInteger",[Me],(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:Te,value:e}})),ur("toInteger",[Oe],(function(t){return{type:Te,value:t.value?1:0}})),ur("toBoolean",[Te],(function(t){if(1!==t.value&&0!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Oe,value:t.value}})),ur("toBoolean",[Me],(function(t){if("true"!==t.value&&"false"!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Oe,value:"true"===t.value?1:0}})),ur("encodeUri",[Me],(function(t){try{return{type:Me,value:encodeURIComponent(t.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),ur("decodeUri",[Me],(function(t){try{return{type:Me,value:decodeURIComponent(t.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),ur("parseUnixTime",[Te],(function(t){return{type:Ne,value:new Date(1e3*t.value)}})),ur("nowLocal",[],(function(){return{type:Ne,value:new Date}})),ur("addMillis",[Ne,Te],(function(t,e){return{type:Ne,value:new Date(t.value.getTime()+e.value)}})),ur("setYear",[Ne,Te],(function(t,e){const r=new Date(t.value);return r.setFullYear(e.value),{type:Ne,value:r}})),ur("setMonth",[Ne,Te],(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:Ne,value:r}})),ur("setDay",[Ne,Te],(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:Ne,value:r}})),ur("setHours",[Ne,Te],(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:Ne,value:r}})),ur("setMinutes",[Ne,Te],(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:Ne,value:r}})),ur("setSeconds",[Ne,Te],(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:Ne,value:r}})),ur("setMillis",[Ne,Te],(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:Ne,value:r}})),ur("getIntervalSeconds",[Te],(function(t){return Zr(t,1e3,60)})),ur("getIntervalTotalSeconds",[Te],(function(t){return Zr(t,1e3)})),ur("getIntervalMinutes",[Te],(function(t){return Zr(t,6e4,60)})),ur("getIntervalTotalMinutes",[Te],(function(t){return Zr(t,6e4)})),ur("getIntervalHours",[Te],(function(t){return Zr(t,36e5,24)})),ur("getIntervalTotalHours",[Te],(function(t){return Zr(t,36e5)})),ur("getIntervalTotalDays",[Te],(function(t){return Zr(t,864e5)})),ur("getIntervalTotalWeeks",[Te],(function(t){return Zr(t,6048e5)})),ur("len",[Me],(function(t){return{type:Te,value:t.value.length}})),ur("contains",[Me,Me],(function(t,e){return{type:Oe,value:t.value.includes(e.value)?1:0}})),ur("substring",[Me,Te,Te],(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:Me,value:t.value.substring(e.value,r.value)}})),ur("replaceAll",[Me,Me,Me],(function(t,e,r){let i;return i=e.value?t.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(e.value),"g"),r.value):t.value,{type:Me,value:i}})),ur("index",[Me,Me],(function(t,e){return{type:Te,value:t.value.indexOf(e.value)}})),ur("lastIndex",[Me,Me],(function(t,e){return{type:Te,value:t.value.lastIndexOf(e.value)}})),ur("trim",[Me],(function(t){return{type:Me,value:t.value.trim()}})),ur("trimLeft",[Me],(function(t){return{type:Me,value:t.value.replace(/^\s+/,"")}})),ur("trimRight",[Me],(function(t){return{type:Me,value:t.value.replace(/\s+$/,"")}})),ur("toUpperCase",[Me],(function(t){return{type:Me,value:t.value.toUpperCase()}})),ur("toLowerCase",[Me],(function(t){return{type:Me,value:t.value.toLowerCase()}})),ur("padStart",[Me,Te,Me],Ar),ur("padStart",[Te,Te,Me],Ar),ur("padEnd",[Me,Te,Me],Vr),ur("padEnd",[Te,Te,Me],Vr),ur("div",[Te,Te],jr),ur("div",[Ie,Ie],jr),ur("mod",[Te,Te],Dr),ur("mod",[Ie,Ie],Dr),ur("mul",[{type:Te,isVararg:!0}],Sr),ur("mul",[{type:Ie,isVararg:!0}],Sr),ur("sub",[{type:Te,isVararg:!0}],Pr),ur("sub",[{type:Ie,isVararg:!0}],Pr),ur("sum",[{type:Te,isVararg:!0}],zr),ur("sum",[{type:Ie,isVararg:!0}],zr),ur("abs",[Te],Mr),ur("abs",[Ie],Mr),ur("max",[{type:Te,isVararg:!0}],Tr),ur("max",[{type:Ie,isVararg:!0}],Tr),ur("min",[{type:Te,isVararg:!0}],Ir),ur("min",[{type:Ie,isVararg:!0}],Ir),ur("maxNumber",[],(function(){return{type:Ie,value:Pe}})),ur("minNumber",[],(function(){return{type:Ie,value:ze}})),ur("maxInteger",[],(function(){return{type:Te,value:2147483647}})),ur("minInteger",[],(function(){return{type:Te,value:Se}})),ur("round",[Ie],(function(t){const e=Math.sign(t.value);return{type:Ie,value:e*Math.round(Math.abs(t.value))}})),ur("floor",[Ie],(function(t){return{type:Ie,value:Math.floor(t.value)}})),ur("ceil",[Ie],(function(t){return{type:Ie,value:Math.ceil(t.value)}})),ur("signum",[Ie],Or),ur("signum",[Te],Or),ur("copySign",[Ie,Ie],Jr),ur("copySign",[Te,Te],Jr),ur("getColorAlpha",[Me],Rr),ur("getColorAlpha",[Je],Rr),ur("getColorRed",[Me],Ur),ur("getColorRed",[Je],Ur),ur("getColorGreen",[Me],Lr),ur("getColorGreen",[Je],Lr),ur("getColorBlue",[Me],Wr),ur("getColorBlue",[Je],Wr),ur("setColorAlpha",[Me,Ie],qr),ur("setColorAlpha",[Je,Ie],qr),ur("setColorRed",[Me,Ie],Hr),ur("setColorRed",[Je,Ie],Hr),ur("setColorGreen",[Me,Ie],Gr),ur("setColorGreen",[Je,Ie],Gr),ur("setColorBlue",[Me,Ie],Yr),ur("setColorBlue",[Je,Ie],Yr),ur("rgb",[Ie,Ie,Ie],(function(t,e,r){const i={a:255,r:255*t.value,g:255*e.value,b:255*r.value};return{type:Je,value:kr(i)}})),ur("argb",[Ie,Ie,Ie,Ie],(function(t,e,r,i){const n={a:255*t.value,r:255*e.value,g:255*r.value,b:255*i.value};return{type:Je,value:kr(n)}}));const Kr={StringLiteral:function(t,e){return{type:Me,value:e.value}},NumberLiteral:function(t,e){return{type:Ie,value:e.value}},IntegerLiteral:function(t,e){return{type:Te,value:e.value}},BooleanLiteral:function(t,e){return{type:Oe,value:e.value?1:0}},UnaryExpression:function(t,e){const r=pr(Qr(t,e.argument));switch(e.operator){case"!":if(r.type===Oe)return{type:Oe,value:r.value?0:1};$r(`${e.operator}${fr(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const t="+"===e.operator?1:-1;if(r.type===Te)return{type:Te,value:r.value*t};if(r.type===Ie)return{type:Ie,value:r.value*t};$r(`${e.operator}${fr(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=pr(Qr(t,e.test));if(r.type===Oe)return r.value?Qr(t,e.consequent):Qr(t,e.alternate);$r(`${fr(r)} ? ${fr(Qr(t,e.consequent))} : ${fr(Qr(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 Qr(t,e.expressions[0]);for(let i=0;i<e.expressions.length;++i)r+=e.quasis[i].value,r+=hr(Qr(t,e.expressions[i]));return r+=e.quasis[e.quasis.length-1].value,{type:Me,value:r}},LogicalExpression:function(t,e){const r=pr(Qr(t,e.left));if(r.type!==Oe&&$r(`${fr(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Oe,value:0};const i=pr(Qr(t,e.right));return i.type!==Oe&&$r(`${fr(r)} ${e.operator} ${fr(i)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${mr(i.type)}.`),{type:Oe,value:i.value}},BinaryExpression:function(t,e){const r=e.operator,i=Qr(t,e.left),n=Qr(t,e.right);if(i.type!==n.type&&$r(`${fr(i)} ${e.operator} ${fr(n)}`,`Operator '${r}' cannot be applied to different types: ${mr(i.type)} and ${mr(n.type)}.`),"=="===r||"!="===r)return function(t,e,r){let i;return i=e.type===Ne&&r.type===Ne?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(i=!i),{type:Oe,value:i?1:0}}(r,i,n);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let i;e.type!==Ie&&e.type!==Te&&e.type!==Ne&&$r(`${fr(e)} ${t} ${fr(r)}`,`Operator '${t}' cannot be applied to ${mr(e.type)} type.`);const n=e.type===Ne?e.value.getTime():e.value,o=r.type===Ne?r.value.getTime():r.value;return i=">"===t?n>o:">="===t?n>=o:"<"===t?n<o:n<=o,{type:Oe,value:i?1:0}}(r,i,n);if("+"===r||"-"===r)return function(t,e,r){if(e.type!==Me&&e.type!==Ie&&e.type!==Te&&$r(`${fr(e)} ${t} ${fr(r)}`,`Operator '${t}' cannot be applied to ${mr(e.type)} type.`),e.type===Me)return"-"===t&&$r(`${fr(e)} - ${fr(r)}`,`Operator '${t}' cannot be applied to ${mr(e.type)} type.`),{type:Me,value:e.value+r.value};let i="+"===t?e.value+r.value:e.value-r.value;return e.type===Te&&(i=br(i)),{type:e.type,value:i}}(r,i,n);if("/"===r||"*"===r||"%"===r)return function(t,e,r){let i;if(e.type!==Te&&e.type!==Ie&&$r(`${fr(e)} ${t} ${fr(r)}`,`Operator '${t}' cannot be applied to ${mr(e.type)} type.`),"*"===t)i=e.value*r.value;else{if("/"!==t&&"%"!==t)throw new Error(`Unsupported operation ${t}`);0===r.value&&$r(`${fr(e)} ${t} ${fr(r)}`,"Division by zero is not supported."),i="/"===t?e.value/r.value:e.value%r.value}return e.type===Te&&(i=br(i)),{type:e.type,value:i}}(r,i,n);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;if(!lr.has(r))throw new Error(`Unknown function name: ${r}.`);let i;const n=e.arguments.map((e=>Qr(t,e))),o=r+":"+n.map((t=>t.type)).join("#");if(dr.has(o))i=dr.get(o);else{const t=function(t,e){const r=lr.get(t);if(!r)throw new Error("Missing function");let i=null;for(let t=0;t<r.length;++t){const n=cr(r[t],e);if("match"===n.type)return r[t];i||(i=n)}if(!i)throw new Error("Missing function");return i}(r,n);if("expected"in t){const e=n.map((t=>mr(t.type))).join(", "),i=`${r}(${Xr(n)})`;"few"===t.type&&0===n.length?$r(i,`Non empty argument list is required for function '${r}'.`):(t.type,$r(i,`Function '${r}' has no matching override for given argument types: ${e}.`))}i=t}if(!i)throw new Error("Function not found");try{return i.cb(...n)}catch(t){$r(`${r}(${Xr(n)})`,t.message)}},Variable:function(t,e){const r=e.id.name,i=t.get(r);if(i)return function(t){return{type:t.getType(),value:t.getValue()}}(i);throw new Error(`Variable '${r}' has value null`)}};function Qr(t,e){if(e.type in Kr)return Kr[e.type](t,e);throw new Error("Unsupported expression")}function ti(t,e){try{return Qr(t,e)}catch(t){return{type:"error",value:t.message}}}class ei{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return vr(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=ti(t,this.ast);if("error"===r.type)return void e(q(new Error("Expression execution error"),{additional:{message:r.value}}));const i=r.value;if(i instanceof Date)return gr(i);if("boolean"===r.type)return Boolean(i);if("color"===r.type){const t=tt(String(i));if(t)return kr(t);e(q(new Error("Expression execution error")))}return i}catch(t){return void e(q(new Error("Expression execution error")))}}}function ri(t,e,r){if(t)if("string"==typeof t){if((i=t).indexOf("@{")>-1||i.indexOf("\\")>-1){e.hasExpression=!0;try{const r=sr(t,{startRule:"JsonStringContents"}),i=wr(r);return e.vars.push(...i),new ei(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=>ri(t,e,r)));if("object"==typeof t){const i={};for(const n in t)i[n]=ri(t[n],e,r);return i}}var i;return t}function ii(t,e,r){if(t){if(t instanceof ei)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>ii(t,e,r)));if("object"==typeof t){const i={};for(const n in t)i[n]=ii(t[n],e,r);return i}}return t}function ni(t,e){const r={vars:[],hasExpression:!1},i=ri(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>ii(i,t,e)}}const oi={pagers:function(){return U(new Map)}},ai=new Map,si=new Map;function li(t){const e=ai.get(t)||U("");return ai.has(t)||ai.set(t,e),e}function di(t){const e=si.get(t)||new Map;return si.has(t)||si.set(t,e),e}class ui{setVariable(t){const e=t.getName(),r=di(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),li(this).set(e)}getVariable(t){return di(this).get(t)}}function ci(){return new ui}function vi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const pi=new Set(["start","stop","pause","resume","cancel","reset"]);class gi{constructor(t){vi(this,"timers",new Map),vi(this,"awaitActions",[]),this.logError=t.logError,this.applyVars=t.applyVars,this.hasVariableWithType=t.hasVariableWithType,this.setVariableValue=t.setVariableValue,this.execAnyActions=t.execAnyActions,this.visibilityHandler=()=>{"visible"===document.visibilityState?(this.awaitActions.forEach((({id:t,action:e})=>{this.execTimerAction(t,e)})),this.awaitActions=[],this.unholdAll()):this.holdAll()},document.addEventListener("visibilitychange",this.visibilityHandler)}destroy(){document.removeEventListener("visibilitychange",this.visibilityHandler);for(const[t,e]of this.timers)this.stopTimerTimeouts(e)}createTimer(t){null!=t&&t.id?t.duration||t.tick_interval&&(t.value_variable||t.tick_actions)?this.timers.set(t.id,{state:"stopped",definition:t}):this.logError(q(new Error("Misconfigured timer"),{additional:{id:t.id}})):this.logError(q(new Error("Missing timer id")))}execTimerAction(t,e){if(!(t&&e&&this.timers.has(t)&&pi.has(e)))return void this.logError(q(new Error("Incorrect timer action"),{additional:{id:t,action:e}}));const r=e;if("visible"!==document.visibilityState)return void this.awaitActions.push({id:t,action:r});const i=this.timers.get(t);this[r](i)}stopTimerTimeouts(t){t.durationTimeout&&(clearTimeout(t.durationTimeout),t.durationTimeout=void 0),t.tickTimeout&&(clearTimeout(t.tickTimeout),t.tickTimeout=void 0)}tickOrUnholdAction(t){const e=performance.now(),r=(t.durationPassed||0)+e-(t.durationStarted||0);t.duration&&r>t.duration||(this.updateVariable(t,r),this.callActions(t,"tick"))}startOrResume(t){t.state="running",t.hold=!1,t.durationStarted=performance.now();const e=t.duration;e&&(t.durationTimeout=window.setTimeout((()=>{this.updateVariable(t,e),this.stop(t)}),Math.max(0,e-(t.durationPassed||0))));const r=t.tick;if(r){const e=()=>{t.tickStarted=performance.now(),t.tickTimeout=window.setTimeout((()=>{this.tickOrUnholdAction(t),t.tickPassed=0,e()}),Math.max(0,r-(t.tickPassed||0)))};e()}}start(t){if("running"===t.state)return void this.logError(q(new Error("The timer is already running")));if("paused"===t.state)return void this.logError(q(new Error("The timer is paused")));const e=t.definition.value_variable;!e||this.hasVariableWithType(e,"integer")?(e&&this.setVariableValue(e,0),t.definition.duration&&(t.duration=this.applyVars(t.definition.duration)),t.definition.tick_interval&&(t.tick=this.applyVars(t.definition.tick_interval)),void 0!==t.duration&&t.duration<0||void 0!==t.tick&&t.tick<=0?this.logError(q(new Error("Incorrect timer properties"),{additional:{id:t.definition.id}})):this.startOrResume(t)):this.logError(q(new Error("Cannot find variable"),{additional:{name:e}}))}stop(t){"stopped"!==t.state?(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t),this.callActions(t,"end")):this.logError(q(new Error("The timer has already been stopped")))}pause(t){if("stopped"===t.state)return void this.logError(q(new Error("The timer has already been stopped")));if("paused"===t.state)return void this.logError(q(new Error("The timer has already been paused")));t.state="paused",this.stopTimerTimeouts(t);const e=performance.now();t.durationStarted&&(t.durationPassed=(t.durationPassed||0)+e-t.durationStarted),t.tickStarted&&(t.tickPassed=(t.tickPassed||0)+e-t.tickStarted);const r=t.definition.value_variable;r&&t.durationPassed&&this.setVariableValue(r,Math.round(t.durationPassed))}resume(t){"stopped"!==t.state?"running"!==t.state?this.startOrResume(t):this.logError(q(new Error("The timer is already running"))):this.logError(q(new Error("The timer has already been stopped")))}cancel(t){"stopped"!==t.state&&(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t))}reset(t){this.cancel(t),this.start(t)}updateVariable(t,e){const r=t.definition.value_variable;r&&this.setVariableValue(r,Math.round(e))}callActions(t,e){const r=t.definition["end"===e?"end_actions":"tick_actions"];if(r){const t=this.applyVars(r);this.execAnyActions(t,!1)}}holdAll(){for(const[t,e]of this.timers)"running"===e.state&&(e.hold=!0,this.stopTimerTimeouts(e))}unholdAll(){for(const[t,e]of this.timers)if("running"===e.state&&e.hold){const t=performance.now();e.durationStarted&&(e.durationPassed=(e.durationPassed||0)+t-e.durationStarted),e.tickStarted&&(e.tickPassed=(e.tickPassed||0)+t-e.tickStarted),e.tick&&this.tickOrUnholdAction(e),this.startOrResume(e)}}}const hi=O(((t,e,r,i)=>{let n,o;var s,l,d,v;let{id:p}=e,{json:g={}}=e,{platform:h="auto"}=e,{theme:f="system"}=e,{globalVariablesController:m=new ui}=e,{mix:y=""}=e,{customization:_={}}=e,{builtinProtocols:w=["http","https","tel","mailto","intent"]}=e,{onError:$}=e,{onStat:x}=e,{onCustomAction:k}=e,{onComponent:E}=e,C=U("desktop"===h);if(o=a(C,(t=>n=t)),"auto"===h&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");C.set(!t.matches),t.addListener((()=>{C.set(!t.matches)}))}let F="light",A=null;function V(t){f=t}function D(){}const S=new Set(w);let P=!1;g||(P=!0,X(q(new Error('"json" prop is required')))),p||(P=!0,X(q(new Error('"id" prop is required'))));let z=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 He)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}(g);const T=g.templates||{};z&&(P=!0,X(z));const I={stateChange:!1},O=li(m),J=di(m),N=new Map,B=new Map,R=new Map;let H=null;function G(t,e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e){const r=B.get(t);r&&r.setValue(e)}}function Y(t){const e=B.get(t);return null==e?void 0:e.getValue()}function Z(t){const e=ni(t,X);return e.vars.length?e.applyVars(B):t}function X(t){$?$({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function K(t,e){x&&x({type:t,action:e})}let Q=0;function tt(t){return`${p}-${Q++}`}let et={},it={};function nt(t){const e=t.url?String(t.url):"";if(e)try{const t=e.replace(/div-action:\/\//,""),r=/([^?]+)\?(.+)/.exec(t);if(!r)return;const i=new URLSearchParams(r[2]);switch(r[1]){case"set_state":!function(t){if(!t)throw new Error("Missing state id");let e=gt,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 i=r[t],n=r[t+1];let o=e.getChild(i);if(!o)return;o.setState(n),e=o}}(i.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=ut(t);r&&r.setCurrentItem(Number(e))}(i.get("id"),i.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=ut(t);r&&r.setPreviousItem(e)}(i.get("id"),i.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=ut(t);r&&r.setNextItem(e)}(i.get("id"),i.get("overflow"));break;case"set_variable":const r=i.get("name"),n=i.get("value");if(r&&null!==n){const t=B.get(r);t?t.set(n):X(q(new Error("Cannot find variable"),{additional:{name:r}}))}else X(q(new Error("Incorrect set_variable_action"),{additional:{url:t}}));break;case"timer":const o=i.get("action"),a=i.get("id");H?H.execTimerAction(a,o):X(q(new Error("Incorrect timer action"),{additional:{id:a,action:o}}));break;default:X(q(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){X(q(t,{additional:{url:e}}))}}async function ot(t,e){if(t){for(let r=0;r<t.length;++r){let i=t[r];const n=i.url;if(n){const t=lt(n);if(t)if(dt(t,S)){if(e)if("_blank"===i.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=n)}else location.href=n}else"div-action"===t?(nt(i),await b()):i.log_id&&(at(i),await b())}}t.forEach((t=>{t.log_id&&K("click",t)}))}}function at(t){null==k||k(t)}const st=new Map;function ut(t){if(st.has(t))return st.get(t);X(q(new Error("Missing instance with id"),{additional:{id:t}}))}const ct=new Map;function pt(t){for(const e of t)B.has(e)&&t.delete(e);return t}c(W,{logError:X,logStat:K,hasTemplate:function(t){return t in T},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in T;){if(({json:t,templateContext:e}=Xe(t,e,T,X)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:tt,genClass:function(t){return`divkit-${tt()}`},execAction:nt,execAnyActions:ot,execCustomAction:at,isRunning:function(t){return I[t]},setRunning:function(t,e){I[t]=e},registerInstance:function(t,e){st.has(t)?X(q(new Error("Duplicate instance id"),{additional:{id:t}})):st.set(t,e)},unregisterInstance:function(t){st.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(it[r]=it[r]||0,++it[r],et[r])return et[r];const i=`${tt()}-svg-filter`;return et=Object.assign(Object.assign({},et),{[r]:i}),i},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;it[r]&&0==--it[r]&&(et=Object.keys(et).reduce(((t,e)=>(it[e]&&(t[e]=et[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return Qe(t);const e=ni(t,X);return e.vars.length?L(e.vars.map((t=>B.get(t)||function(t){const e=R.get(t)||U(void 0);return R.has(t)||R.set(t,e),e}(t))).filter(rt),(()=>e.applyVars(B))):e.hasExpression?Qe(e.applyVars(B)):Qe(t)},getJsonWithVars:Z,getStore:function(t){return ct.has(t)||function(t){ct.has(t)||ct.set(t,oi[t]())}(t),ct.get(t)},getVariable:function(t,e){const r=B.get(t);if(r){const i=r.getType();if(i!==e)return void X(q(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:i}}))}return r},getCustomization:function(t){return null==_?void 0:_[t]},getBuiltinProtocols:function(){return S},isDesktop:C,registerComponent:void 0,unregisterComponent:void 0}),c(Ct,{hasAction:()=>!1});const gt={setState(t){throw new Error("Not implemented")},getChild(t){if(ht&&ht.has(t))return ht.get(t);X(q(new Error("Missing state block with id"),{additional:{id:t}}))}};let ht=null;c(vt,{registerInstance(t,e){ht||(ht=new Map),ht.has(t)?X(q(new Error("Duplicate state with id"),{additional:{id:t}})):ht.set(t,e)},unregisterInstance(t){null==ht||ht.delete(t)},runVisibilityTransition:(t,e,r,i,n)=>Promise.resolve(),registerChildWithTransitionIn:(t,e,r,i)=>Promise.resolve(),registerChildWithTransitionOut:(t,e,r,i)=>Promise.resolve(),registerChildWithTransitionChange:(t,e,r,i)=>Promise.resolve(),hasTransitionChange:t=>!1,registerChild(t){},unregisterChild(t){}});const ft=null===(s=null==g?void 0:g.card)||void 0===s?void 0:s.variables;Array.isArray(ft)&&ft.forEach((t=>{if(t&&t.type in Re&&t.name){if(N.has(t.name))return void X(q(new Error("Duplicate variable"),{additional:{name:t.name}}));try{const e=Ue(t.name,t.type,t.value);N.set(t.name,e),B.set(t.name,e)}catch(e){X(q(e,{additional:{name:t.name}}))}}}));const mt=g.palette;mt&&mt[F].forEach((t=>{if(N.has(t.name))X(q(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=Ue(t.name,"color",t.color);N.set(t.name,e),B.set(t.name,e)}catch(e){X(q(e,{additional:{name:t.name}}))}}));for(const[t,e]of J)B.has(t)||B.set(t,e);O.subscribe((t=>{if(t&&!B.has(t)){const e=J.get(t);B.set(t,e);const r=R.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const yt=null===(l=null==g?void 0:g.card)||void 0===l?void 0:l.variable_triggers;Array.isArray(yt)&&yt.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void X(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 i=sr(t.condition,{startRule:"JsonStringContents"}),n=wr(i);if(!n.length)return void X(q(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return pt(e),e.size?new Promise((t=>{const r=O.subscribe((()=>{pt(e),e.size||(r(),t())}))})):Promise.resolve()})(n).then((()=>{L(n.map((t=>B.get(t))).filter(rt),(()=>ti(B,i))).subscribe((i=>{"error"!==i.type?(i.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=Z(t);e.log_id&&nt(e)})),e=Boolean(i.value)):X(q(new Error("variable_trigger condition execution error"),{additional:{message:i.value}}))}))}))}catch(e){X(q(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else X(q(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));const bt=null===(d=null==g?void 0:g.card)||void 0===d?void 0:d.timers;if(bt){const t=H=new gi({logError:X,applyVars:Z,hasVariableWithType:function(t,e){const r=B.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=B.get(t);r?r.setValue(e):X(q(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:ot});bt.forEach((e=>t.createTimer(e)))}const _t=null===(v=null==g?void 0:g.card)||void 0===v?void 0:v.states,wt=_t&&!P?{type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:_t.map((t=>({state_id:t.state_id.toString(),div:t.div})))}:void 0;return u((()=>{H&&H.destroy()})),void 0===e.id&&r.id&&void 0!==p&&r.id(p),void 0===e.json&&r.json&&void 0!==g&&r.json(g),void 0===e.platform&&r.platform&&void 0!==h&&r.platform(h),void 0===e.theme&&r.theme&&void 0!==f&&r.theme(f),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==m&&r.globalVariablesController(m),void 0===e.mix&&r.mix&&void 0!==y&&r.mix(y),void 0===e.customization&&r.customization&&void 0!==_&&r.customization(_),void 0===e.builtinProtocols&&r.builtinProtocols&&void 0!==w&&r.builtinProtocols(w),void 0===e.onError&&r.onError&&void 0!==$&&r.onError($),void 0===e.onStat&&r.onStat&&void 0!==x&&r.onStat(x),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==k&&r.onCustomAction(k),void 0===e.onComponent&&r.onComponent&&void 0!==E&&r.onComponent(E),void 0===e.setTheme&&r.setTheme&&void 0!==V&&r.setTheme(V),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==D&&r.getDebugVariables(D),void 0===e.setVariable&&r.setVariable&&void 0!==G&&r.setVariable(G),void 0===e.getVariable&&r.getVariable&&void 0!==Y&&r.getVariable(Y),void 0===e.execAction&&r.execAction&&void 0!==nt&&r.execAction(nt),"light"===f||"dark"===f?F=f:"system"===f?"undefined"!=typeof matchMedia?(A||(A=matchMedia("(prefers-color-scheme: dark)"),A.addListener((function(){"system"===f&&A&&(F=A.matches?"dark":"light")}))),F=A.matches?"dark":"light"):F="light":X(q(new Error("Unsupported theme"))),F&&(mt&&mt[F].forEach((t=>{const e=B.get(t.name);e&&e.setValue(t.color)}))),o(),!P&&wt?`<div class="${j("divkit-b023c",!0)+j(n?" divkit-ee112":"",!0)+j(y?` ${y}`:"",!0)}">${M(Ze,"RootSvgFilters").$$render(t,{svgFiltersMap:et},{},{})}\n ${M(Ye,"Unknown").$$render(t,{div:wt,templateContext:{}},{},{})}</div>`:""}));function fi(t){return hi.render({id:t.id,json:t.json,globalVariablesController:t.globalVariablesController,mix:t.mix,customization:t.customization,builtinProtocols:t.builtinProtocols,onError:t.onError,platform:t.platform}).html}var mi=e.M,yi=e.Os,bi=e.sY;export{mi as createGlobalVariablesController,yi as createVariable,bi as render};
2
2
  //# sourceMappingURL=server.mjs.map