@divkitframework/divkit 10.0.0 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function r(){}function n(t){return t()}function i(t){t.forEach(n)}function o(t){return"function"==typeof t}function a(t,...e){if(null==t)return r;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}let s;function l(t){s=t}function c(){if(!s)throw new Error("Function called outside component initialization");return s}function u(t){c().$$.on_destroy.push(t)}function d(t,e){return c().$$.context.set(t,e),e}function v(t){return c().$$.context.get(t)}t.d(e,{M:()=>qr,Os:()=>Ee,sY:()=>Gr}),new Set,new Map;const g=[],p=[],h=[],f=[],m=Promise.resolve();let y=!1;function _(){return y||(y=!0,m.then(x)),m}function b(t){h.push(t)}const w=new Set;let $=0;function x(){const t=s;do{for(;$<g.length;){const t=g[$];$++,l(t),k(t.$$)}for(l(null),g.length=0,$=0;p.length;)p.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(g.length);for(;f.length;)f.pop()();y=!1,w.clear(),l(t)}function k(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(b)}}new Set,"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;const C=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),F=/[\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 E(t,e){const r=Object.assign({},...t);if(e){const t=e.classes,n=e.styles;t&&(null==r.class?r.class=t:r.class+=" "+t),n&&(null==r.style?r.style=T(n):r.style=T(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),n=e.slice(0,t).trim(),i=e.slice(t+1).trim();n&&(r[n]=i)}for(const t in e){const n=e[t];n?r[t]=n:delete r[t]}return r}(r.style,n)))}let n="";return Object.keys(r).forEach((t=>{if(F.test(t))return;const e=r[t];!0===e?n+=" "+t:C.has(t.toLowerCase())?e&&(n+=" "+t):null!=e&&(n+=` ${t}="${e}"`)})),n}const A=/[&"]/g,V=/[&<]/g;function j(t,e=!1){const r=String(t),n=e?A:V;n.lastIndex=0;let i="",o=0;for(;n.test(r);){const t=n.lastIndex-1,e=r[t];i+=r.substring(o,t)+("&"===e?"&amp;":'"'===e?"&quot;":"&lt;"),o=t+1}return i+r.substring(o)}function D(t){return"string"==typeof t||t&&"object"==typeof t?j(t,!0):t}function 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 I,O;function J(t){function e(e,r,n,i,o){const a=s;l({$$:{on_destroy:I,context:new Map(o||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const c=t(e,r,n,i);return l(a),c}return{render:(t={},{$$slots:r={},context:n=new Map}={})=>{I=[];const o={title:"",head:"",css:new Set},a=e(o,t,{},r,n);return i(I),{html:a,css:{code:Array.from(o.css).map((t=>t.code)).join("\n"),map:null},head:o.title+o.head}},$$render:e}}function N(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${j(e,!0)}"`}`}function T(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${t[e]};`)).join(" ")}function U(t){const e=T(t);return e?` style="${e}"`:""}"function"==typeof HTMLElement&&(O=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(o);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,r){this[t]=r}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){(function(t,e){const r=t.$$;null!==r.fragment&&(i(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])})(this,1),this.$destroy=r}$on(t,e){const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(e),()=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});const B=[];function L(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=!B.length;for(const e of i)e[1](),B.push(e,t);if(e){for(let t=0;t<B.length;t+=2)B[t][0](B[t+1]);B.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 R(t,e,n){const s=!Array.isArray(t),l=s?[t]:t,c=e.length<2;return{subscribe:L(n,(t=>{let n=!1;const u=[];let d=0,v=r;const g=()=>{if(d)return;v();const n=e(s?u[0]:u,t);c?t(n):v=o(n)?n:r},p=l.map(((t,e)=>a(t,(t=>{u[e]=t,d&=~(1<<e),n&&g()}),(()=>{d|=1<<e}))));return n=!0,g(),function(){i(p),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-d9b0",text_halign_left:"divkit-a4cb",text_halign_center:"divkit-e165",text_halign_right:"divkit-ea28",text_valign_top:"divkit-d8ce",text_valign_center:"divkit-ef58",text_valign_bottom:"divkit-fe8e",text_width_content:"divkit-f41f",text_height_content:"divkit-ea52",text__inner:"divkit-b852",text_singleline:"divkit-ef11",text_truncate_none:"divkit-c6ea",text_multiline:"divkit-ee8e",text__inner_gradient:"divkit-cb8e",text__image:"divkit-bf6e",text__image_hidden:"divkit-f100"},G={outer:"divkit-d65a","outer_hide-on-transition-in":"divkit-a6d1","outer_halign-self_start":"divkit-cc45","outer_halign-self_center":"divkit-b833","outer_halign-self_end":"divkit-c573","outer_halign-self_stretch":"divkit-dcc7","outer_valign-self_start":"divkit-e807","outer_valign-self_center":"divkit-d40a","outer_valign-self_end":"divkit-e9f8","outer_valign-self_stretch":"divkit-b7aa","outer_parent-flex_vertical":"divkit-c143","outer_parent-flex_horizontal":"divkit-ef30","outer_width-constrained":"divkit-d321","outer_height-constrained":"divkit-a525","outer_parent-overlap":"divkit-dab2","outer_parent-overlap-absolute":"divkit-d43f","outer_scroll-snap_center":"divkit-d9e3","outer_scroll-snap_start":"divkit-efd1",outer__border:"divkit-d405",outer_visibility_invisible:"divkit-f018",outer_visibility_gone:"divkit-e784","outer_has-action-animation":"divkit-f498"};function Y(t){if(!t)return;let e="";for(const r in t)if(t.hasOwnProperty(r)){if(!t[r]&&0!==t[r])continue;e&&(e+=";"),e+=r+":"+String(t[r])}return e||void 0}function Z(t){if("number"!=typeof t&&"string"!=typeof t||!t)return"0";const e=Number(t);return isNaN(e)?"0":Math.ceil(1e3*e)/1e4+"em"}function X(t){let e=Z(t);return"0"===e&&(e+="em"),e}function K(t,e){for(;t.length<e;)t="0"+t;return t}function Q(t,e=1,r="transparent"){if("#"!==(t=(t||"").toLowerCase()).charAt(0))return r;const n=tt(t);return n?(n.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>K(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(n)):r}function tt(t){const e=t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])$/i)||t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i);if(e){if(5===e.length){const[t,r,n,i,o]=e,a=2===n.length?n:n+n,s=2===i.length?i:i+i,l=2===o.length?o:o+o,c=2===r.length?r:r+r;return{a:parseInt(c,16),r:parseInt(a,16),g:parseInt(s,16),b:parseInt(l,16)}}const[t,r,n,i]=e,o=2===r.length?r:r+r,a=2===n.length?n:n+n,s=2===i.length?i:i+i;return{a:255,r:parseInt(o,16),g:parseInt(a,16),b:parseInt(s,16)}}return null}function et(t){let e=String(t);return e.indexOf("&")>-1&&(e=e.replace(/&/g,"&amp;")),e.indexOf("<")>-1&&(e=e.replace(/</g,"&lt;")),e.indexOf(">")>-1&&(e=e.replace(/>/g,"&gt;")),e.indexOf('"')>-1&&(e=e.replace(/"/g,"&quot;")),e}const rt=Boolean;function nt(t){if(1===t.length&&"solid"===t[0].type)return{color:Q(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=Q(t.bg.color||"transparent");return{size:void 0,pos:void 0,image:`linear-gradient(to bottom,${e},${e})`}}({bg:t}):"gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const r=t.bg.colors.filter(rt);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>Q(t))).join(",")+")"}:void 0}({bg:t}):"image"===t.type?function(t){var e;const r=null===(e=t.bg)||void 0===e?void 0:e.image_url;if(r)return{size:at(t.bg.scale),pos:st(t.bg),image:'url("'+et(r)+'")'}}({bg:t}):"radial_gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const r=t.bg.colors.filter(rt);if(!r.length)return;const n=t.bg.radius;let i;n&&"object"==typeof n&&"type"in n&&void 0!==n.value&&("fixed"===n.type?i=X(n.value):"relative"===n.type&&(i=it[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${i||"farthest-corner"} at ${ot(t.bg.center_x)} ${ot(t.bg.center_y)},`+r.map((t=>Q(t))).join(",")+")"}}({bg:t}):void 0)).filter(rt).reverse().reduce((function(t,e){return t.image.push(e.image),t.size.push(e.size||"auto"),t.position.push(e.pos||"50% 50%"),t}),{image:[],size:[],position:[]});return{image:e.image.join(","),size:e.size.join(","),position:e.position.join(",")}}const it={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function ot(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return X(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function at(t){return"fill"!==t&&t?"fit"===t?"contain":void 0:"cover"}function st(t){let e,r;return e="left"===t.content_alignment_horizontal?"0%":"right"===t.content_alignment_horizontal?"100%":"50%",r="top"===t.content_alignment_vertical?"0%":"bottom"===t.content_alignment_vertical?"100%":"50%",e+" "+r}function lt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}const ct=new Set(["http","https","tel","mailto","intent"]);function ut(t){return ct.has(t)}function dt(t,e){e&&t.push(e)}function vt(t,e,r){const n=[];dt(n,e[t]);for(const i in r)if(r.hasOwnProperty(i)){const o=r[i];o&&dt(n,e[`${t}_${i}`+("string"==typeof o?`_${o}`:"")])}return n.join(" ")}const gt=Symbol("state");function pt(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function ht(t){return pt(t)&&t>=0}function ft(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 function(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(" ")}(t,e,r)}function mt(t,e){if(!t)return e;const r=[t.top,t.right,t.bottom,t.left];for(let t=0;t<r.length;++t)if(r[t]&&!ht(r[t]))return e;return function(t){return Z(t.top||0)+" "+Z(t.right||0)+" "+Z(t.bottom||0)+" "+Z(t.left||0)}(t)}function yt(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const _t=Object.prototype.hasOwnProperty;function bt(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return Object.is(t,e);const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++){const i=r[n];if(!_t.call(e,i)||!bt(t[i],e[i]))return!1}return!0}function wt(t,e){return bt(t,e)?e:t}function $t(){}const xt=Symbol("action"),kt=J(((t,e,r,n)=>{let{actions:i}=e,{cls:o=""}=e,{style:a=null}=e,{attrs:s}=e,{use:l=$t}=e,{customAction:c=null}=e,{hasActionAnimation:u=!1}=e;const g=v(W),p=v(xt);d(xt,{hasAction:()=>Boolean(p.hasAction()||(null==i?void 0:i.length))});let h,f="";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){f=e,h=i[t].target||void 0;break}}Array.isArray(i)&&(null==i?void 0:i.length)&&p.hasAction()&&(f="",g.logError(q(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:i}})));let m=Boolean(c);return f&&!ut(lt(f))&&(f="",m=!0),void 0===e.actions&&r.actions&&void 0!==i&&r.actions(i),void 0===e.cls&&r.cls&&void 0!==o&&r.cls(o),void 0===e.style&&r.style&&void 0!==a&&r.style(a),void 0===e.attrs&&r.attrs&&void 0!==s&&r.attrs(s),void 0===e.use&&r.use&&void 0!==l&&r.use(l),void 0===e.customAction&&r.customAction&&void 0!==c&&r.customAction(c),void 0===e.hasActionAnimation&&r.hasActionAnimation&&void 0!==u&&r.hasActionAnimation(u),f?`<a${E([{href:D(f)},{target:D(h)},{style:D(a)},{class:j(o,!0)+" "+j(u?"":"divkit-bd25",!0)},S(s)],{})}>${n.default?n.default({}):""}</a>`:`<span${E([{class:j(o,!0)+j(m?` ${u?"":"divkit-bd25"} divkit-c016`:"",!0)},{style:D(a)},{role:D(m?"button":null)},S(s)],{})}>${n.default?n.default({}):""}</span>`})),Ct=J(((t,e,r,n)=>{let{background:i=[]}=e;const o=i.map((t=>{const e={},r=nt([t]),n={style:e};return"solid"===t.type&&(e["background-color"]=r.color),"gradient"===t.type&&(e["background-image"]=r.image),"image"===t.type&&(e.opacity=Number(t.alpha),n.image_url=t.image_url,e["object-fit"]=r.size,e["object-position"]=r.position),n}));return void 0===e.background&&r.background&&void 0!==i&&r.background(i),`<span${N("class","divkit-bf25",0)}>${P(o,(t=>t.image_url?`<img${N("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${N("class","divkit-b921",0)}${N("style",Y(t.style),0)}>`:`<span${N("class","divkit-b921",0)}${N("style",Y(t.style),0)}></span>`))}</span>`}));function Ft(t,e){const r=Number(t);return isNaN(r)?e:r}const Et=J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p,h,f,m,y,b,w,$,x,k,C,F,E,A,V,j,D,S,P,z,I,O,J,T,U,B,L,R,H=r,K=r,tt=r,et=r,rt=r,it=r,ot=r,at=r,st=r,ct=r,dt=r,pt=r,_t=r,bt=r,$t=r;var xt,Et,At,Vt,jt,Dt;let{json:St={}}=e,{origJson:Pt}=e,{templateContext:zt}=e,{cls:Mt=""}=e,{style:It}=e,{layoutParams:Ot={}}=e,{customDescription:Jt=!1}=e,{customPaddings:Nt=!1}=e,{customActions:Tt=""}=e,{forceWidth:Ut=!1}=e,{forceHeight:Bt=!1}=e;const Lt={left:"start",center:"center",right:"end"},Rt={top:"start",center:"center",bottom:"end"},Wt=v(W),qt=v(gt);let Ht,Gt,Yt,Zt,Xt,Kt,Qt,te={},ee={},re=!1,ne=1,ie="transparent",oe=0,ae="",se="",le="",ce={},ue=0,de=0,ve=0,ge={},pe=0,he=0,fe=0,me=1;const ye=St.transition_triggers||["state_change","visibility_change"],_e=-1!==ye.indexOf("state_change")&&St.id,be=-1!==ye.indexOf("visibility_change")&&St.id;let we,$e,xe,ke,Ce,Fe,Ee,Ae,Ve,je=[],De="",Se=!1,Pe="visible",ze=0,Me=0;void 0===e.json&&n.json&&void 0!==St&&n.json(St),void 0===e.origJson&&n.origJson&&void 0!==Pt&&n.origJson(Pt),void 0===e.templateContext&&n.templateContext&&void 0!==zt&&n.templateContext(zt),void 0===e.cls&&n.cls&&void 0!==Mt&&n.cls(Mt),void 0===e.style&&n.style&&void 0!==It&&n.style(It),void 0===e.layoutParams&&n.layoutParams&&void 0!==Ot&&n.layoutParams(Ot),void 0===e.customDescription&&n.customDescription&&void 0!==Jt&&n.customDescription(Jt),void 0===e.customPaddings&&n.customPaddings&&void 0!==Nt&&n.customPaddings(Nt),void 0===e.customActions&&n.customActions&&void 0!==Tt&&n.customActions(Tt),void 0===e.forceWidth&&n.forceWidth&&void 0!==Ut&&n.forceWidth(Ut),void 0===e.forceHeight&&n.forceHeight&&void 0!==Bt&&n.forceHeight(Bt),o=Wt.getDerivedFromVars(St.border),$t(),$t=a(o,(t=>R=t));{let t={},e={},r=!1;if(R){if(R.has_shadow){const e=R.shadow;t["box-shadow"]=e?Z((null===(Et=null===(xt=e.offset)||void 0===xt?void 0:xt.x)||void 0===Et?void 0:Et.value)||0)+" "+Z((null===(Vt=null===(At=e.offset)||void 0===At?void 0:At.y)||void 0===Vt?void 0:Vt.value)||0)+" "+Z(null!==(jt=e.blur)&&void 0!==jt?jt:2)+" "+Q(e.color||"#000000",null!==(Dt=e.alpha)&&void 0!==Dt?Dt:.19):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}R.stroke&&(r=!0,ne=yt(R.stroke.width,ne),ie=Q(R.stroke.color,1,ie),e.border=`${Z(ne)} solid ${ie}`),R.corners_radius?(ae=ft(R.corners_radius,0,10,ae),e["border-radius"]=t["border-radius"]=ae):R.corner_radius&&(oe=yt(R.corner_radius,oe),e["border-radius"]=t["border-radius"]=Z(oe))}te=wt(t,te),ee=wt(e,ee),re=r}s=Wt.getDerivedFromVars(St.paddings),bt(),bt=a(s,(t=>L=t)),se=mt(L&&!Nt?L:void 0,se),l=Wt.getDerivedFromVars(St.margins),pt(),pt=a(l,(t=>U=t)),le=mt(U,le),c=Wt.getDerivedFromVars(St.width),ct(),ct=a(c,(t=>J=t)),u=Wt.getDerivedFromVars(St.alignment_horizontal),_t(),_t=a(u,(t=>B=t));{let t,e,r={},n=0,i=0;const o=null==J?void 0:J.type;if("fixed"===o?(ue=yt(null==J?void 0:J.value,ue),e=Z(ue)):"wrap_content"===o||!Ot.overlapParent&&"match_parent"===o&&Ot.parentHorizontalWrapContent?(t="content",("wrap_content"===o&&(null==J?void 0:J.constrained)||"match_parent"===o&&Ot.parentHorizontalWrapContent)&&(r["width-constrained"]=!0,i=1),"match_parent"===o&&Wt.logError(q(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))):(t="parent","vertical"===Ot.parentLayoutOrientation?e=`calc(100% - ${X(((null==U?void 0:U.left)||0)+((null==U?void 0:U.right)||0))})`:"horizontal"===Ot.parentContainerOrientation&&(n=J&&"weight"in J&&J.weight||1)),"content"===t&&Ut&&(t="parent",Wt.logError(q(new Error("Incorrect usage of width with value 'wrap_content'"),{level:"warn"}))),"parent"===t)r["halign-self"]="stretch";else{const t=B;r["halign-self"]="left"===t||"center"===t||"right"===t?Lt[t]:Ot.parentHAlign||"start"}t&&(r.width=t),Yt=e,de=n,ve=i,ce=wt(r,ce)}d=Wt.getDerivedFromVars(St.height),st(),st=a(d,(t=>O=t)),g=Wt.getDerivedFromVars(St.alignment_vertical),dt(),dt=a(g,(t=>T=t));{let t,e,r={},n=0,i=0;const o=null==O?void 0:O.type;if("fixed"===o?(pe=yt(null==O?void 0:O.value,pe),e=Z(pe)):"match_parent"!==o||!Ot.overlapParent&&Ot.parentVerticalWrapContent?(t="content",("wrap_content"===o&&(null==O?void 0:O.constrained)||"match_parent"===o&&Ot.parentVerticalWrapContent)&&(r["height-constrained"]=!0,i=1),"match_parent"===o&&Wt.logError(q(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))):(t="parent","horizontal"===Ot.parentLayoutOrientation?e=`calc(100% - ${X(((null==U?void 0:U.top)||0)+((null==U?void 0:U.bottom)||0))})`:"vertical"===Ot.parentContainerOrientation&&(n=(null==O?void 0:O.weight)||1)),"content"===t&&Bt&&(t="parent",Wt.logError(q(new Error("Incorrect usage of height with value 'wrap_content'"),{level:"warn"}))),"parent"===t)r["valign-self"]="stretch";else{const t=T;r["valign-self"]="top"===t||"center"===t||"bottom"===t?Rt[t]:Ot.parentVAlign||"start"}t&&(r.height=t),Zt=e,he=n,fe=i,ge=wt(r,ge)}var Ie,Oe;if(p=!!Ot.overlapParent||void 0,h=Ot.overlapParent&&(!J||"match_parent"===J.type)&&"match_parent"===(null==O?void 0:O.type),f=Ot.gridArea?`${Ot.gridArea.y+1}/${Ot.gridArea.x+1}/span ${Ot.gridArea.rowSpan}/span ${Ot.gridArea.colSpan}`:void 0,m=Wt.getDerivedFromVars(St.alpha),at(),at=a(m,(t=>I=t)),Oe=me,me=!ht(Ie=I)||void 0===Ie||Ie>1?Oe:Number(Ie),Xt=1===me?void 0:me,y=Wt.getDerivedFromVars(St.accessibility),ot(),ot=a(y,(t=>z=t)),Gt=void 0,z&&!Jt&&z.description&&(Gt={},Gt["aria-label"]=z.description),b=Wt.getDerivedFromVars(St.background),it(),it=a(b,(t=>P=t)),Kt={},Qt=!1,P&&(Qt=P.some((t=>"image"===t.type)),!Qt)){const t=nt(P);Kt["background-color"]=t.color,Kt["background-image"]=t.image,Kt["background-size"]=t.size,Kt["background-position"]=t.position,Kt["background-repeat"]="no-repeat"}we=void 0,_e&&St.transition_in&&Wt.isRunning("stateChange")&&(we=!0),xe=void 0,_e&&St.transition_change&&Wt.isRunning("stateChange")&&qt.hasTransitionChange(St.id)&&(xe=!0),w=Wt.getDerivedFromVars(St.action),et(),et=a(w,(t=>D=t)),$=Wt.getDerivedFromVars(St.actions),rt(),rt=a($,(t=>S=t));{let t=S||D&&[D]||[];Array.isArray(t)?t.length&&Tt&&(t=[],Wt.logError(q(new Error(`Cannot use action on component "${Tt}"`)))):(t=[],Wt.logError(q(new Error("Actions should be array")))),je=t}x=Wt.getDerivedFromVars(St.action_animation),tt(),tt=a(x,(t=>j=t)),j&&(De=function t(e){var r;const n=Ft(e.start_value,1),i=Ft(e.end_value,1),o=yt(e.start_delay,0),a=yt(e.duration,300),s=function(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:"ease_in_out"}(e.interpolator).replace(/_/g,"-");switch(e.name){case"fade":return ke=n,Ce=i,`opacity ${a}ms ${s} ${o}ms`;case"scale":return Fe=n,Ee=i,`transform ${a}ms ${s} ${o}ms`;case"set":return(null===(r=e.items)||void 0===r?void 0:r.length)?e.items.map(t).join(", "):(Wt.logError(q(new Error("Empty items value for action_animation with name='set'"))),"");default:return Wt.logError(q(new Error("Unknown action_animation name"),{additional:{animation:e.name}})),""}}(j)),k=Wt.getDerivedFromVars(St.visibility),K(),K=a(k,(t=>V=t));{const t=Pe,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(V,Pe);t!==e&&(!Se||"visible"!==Pe&&"visible"!==e?Pe=e:async function(t){Pe=t;const e="visible"===t?"in":"out",r="in"===e?St.transition_in:St.transition_out;be&&r&&(await _(),"in"===e&&($e=!0),qt.runVisibilityTransition(Object.assign(Object.assign({},St),{visibility:"visible"}),zt,r,Ht,e).then((()=>{"in"===e&&($e=!1)})).catch((t=>{throw"in"===e&&($e=!1),t})))}(e)),Se||(Se=!0)}if(C=Object.assign(Object.assign(Object.assign({},ce),ge),{"parent-overlap":p,"parent-overlap-absolute":h,"scroll-snap":Ot.scrollSnap,"hide-on-transition-in":we||$e||xe,visibility:Pe,"has-action-animation":Boolean(De),"parent-flex":Ot.parentContainerOrientation||void 0}),F=Wt.getDerivedFromVars(St.transform),H(),H=a(F,(t=>A=t)),A&&void 0!==A.rotation){const t=A.pivot_x||{type:"pivot-percentage",value:50};ze=Ft(t.value,ze);const e="pivot-fixed"===t.type?Z(ze):`${ze}%`,r=A.pivot_y||{type:"pivot-percentage",value:50};Me=Ft(r.value,Me),Ae=`${e} ${"pivot-fixed"===r.type?Z(Me):`${Me}%`}`,Ve=`rotate(${A.rotation}deg)`}return E=Object.assign(Object.assign(Object.assign(Object.assign({},It),Kt),te),{width:Yt,height:Zt,"grid-area":f,padding:se,margin:le,opacity:Xt,transition:De,"transform-origin":Ae,transform:Ve,"flex-grow":de||he||void 0,"flex-shrink":ve||fe?1:void 0,"flex-basis":de||he?0:void 0,"--divkit-animation-opacity-start":ke,"--divkit-animation-opacity-end":Ce,"--divkit-animation-scale-start":Fe,"--divkit-animation-scale-end":Ee}),H(),K(),tt(),et(),rt(),it(),ot(),at(),st(),ct(),dt(),pt(),_t(),bt(),$t(),`${M(kt,"Actionable").$$render(t,{use:function(t){Ht=t,_e&&St.transition_in&&qt.registerChildWithTransitionIn(St,zt,St.transition_in,t).then((()=>{we=!1})).catch((t=>{throw we=!1,t})),_e&&St.transition_out&&qt.registerChildWithTransitionOut(St,zt,St.transition_out,t),_e&&St.transition_change&&qt.registerChildWithTransitionChange(St,zt,St.transition_change,t).then((()=>{xe=!1})).catch((t=>{throw xe=!1,t})),function(t,{visibilityActions:e,rootCtx:r}){if(null==e||!e.length)return;const n=e.map((t=>({action:t,visible:!1,count:0,finished:!1}))),i=[...new Set([...e.map((t=>(t.visibility_percentage||50)/100))])];new IntersectionObserver((t=>{t.forEach((t=>{n.forEach((e=>{const n=t.intersectionRatio>=(e.action.visibility_percentage||50)/100;!e.visible&&n?e.finished||(e.timer=setTimeout((()=>{++e.count;const t=0===e.action.log_limit?1/0:e.action.log_limit||1;++e.count>=t&&(e.finished=!0);const n=e.action.url;if(n){const t=lt(n);t&&!ut(t)&&("div-action"===t?r.execAction(e.action):e.action.log_id&&r.execCustomAction(e.action))}r.logStat("visible",e.action)}),e.action.visibility_duration||800)):n||e.timer&&clearTimeout(e.timer),e.visible=n}))}))}),{threshold:i}).observe(t)}(t,{visibilityActions:Wt.getJsonWithVars(St.visibility_actions||St.visibility_action&&[St.visibility_action]),rootCtx:Wt});const e=St.id;e&&qt.registerChild(e);let r=null;return{destroy(){e&&qt.unregisterChild(e),r&&r.destroy()}}},cls:Mt+" "+vt("outer",G,C),style:Y(E),actions:je,attrs:Gt,hasActionAnimation:Boolean(De)},{},{default:()=>`${Qt?`${M(Ct,"OuterBackground").$$render(t,{background:P},{},{})}`:""}${i.default?i.default({}):""}${re?`<span${N("class",G.outer__border,0)}${N("style",Y(ee),0)}></span>`:""}`})}`})),At={"text-range":"divkit-faf0","text-range_singleline":"divkit-ccb6","text-range__top-offset":"divkit-d923","text-range_decoration_both":"divkit-d7e0","text-range_decoration_underline":"divkit-f3dd","text-range_decoration_strike":"divkit-d27b","text-range_decoration_none":"divkit-c6b0"};function Vt(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function jt(t){return pt(t)&&t>0}function Dt(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function St(t,e){return Dt(t)||e}const Pt=J(((t,e,r,n)=>{let i,o,a,s,{text:l}=e,{rootFontSize:c}=e,{textStyles:u={}}=e,{singleline:d=!1}=e,{actions:v}=e,g="none",p=12,h=1.25,f="",m="";void 0===e.text&&r.text&&void 0!==l&&r.text(l),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==c&&r.rootFontSize(c),void 0===e.textStyles&&r.textStyles&&void 0!==u&&r.textStyles(u),void 0===e.singleline&&r.singleline&&void 0!==d&&r.singleline(d),void 0===e.actions&&r.actions&&void 0!==v&&r.actions(v);{let t="none";(u.underline||u.strike)&&("single"===u.underline&&"single"===u.strike?t="both":"single"===u.underline?t="underline":"single"===u.strike&&(t="strike")),g=t}return p=Vt(u.font_size,p),jt(u.line_height)&&(h=Number(u.line_height)/p),ht(u.letter_spacing)&&(f=Z(u.letter_spacing)),s=St(u.font_weight,s),m=Q(u.text_color,1,m),i=u.top_offset?Z(u.top_offset):"",o={singleline:d,decoration:g},a={"font-size":Z(10*p/c),"line-height":h,"letter-spacing":f,"font-weight":s,color:m},`${i?`<span${N("class",At["text-range__top-offset"],0)}${U({"margin-top":i})}></span>`:""}${M(kt,"Actionable").$$render(t,{cls:vt("text-range",At,o),actions:v,style:Y(a)},{},{default:()=>`${j(l)}`})}`}));function zt(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Mt(t,e){return"top"===t||"center"===t||"bottom"===t?t:e}const It=J(((t,e,n,i)=>{let o,s,l,c,d,g,p,h,f,m,y,_,b,w,$,x,k,C,F,E,A,V,j,D,S,z,I,O,J,T,U,B,L,R,G,X,K,tt=r,et=r,rt=r,it=r,ot=r,at=r,st=r,lt=r,ct=r,ut=r,dt=r,gt=r,pt=r,ht=r,ft=r,{json:mt={}}=e,{templateContext:yt}=e,{origJson:_t}=e,{layoutParams:bt}=e;const wt=v(W);let $t=!1,xt="",kt=12,Ct=1.25,Ft=!1,At="",Dt="",St=!1,It="left",Ot="top",Jt="",Nt="",Tt=!1,Ut=[],Bt=[];var Lt,Rt;u((()=>{Bt.forEach((t=>{wt.removeSvgFilter(t)}))})),void 0===e.json&&n.json&&void 0!==mt&&n.json(mt),void 0===e.templateContext&&n.templateContext&&void 0!==yt&&n.templateContext(yt),void 0===e.origJson&&n.origJson&&void 0!==_t&&n.origJson(_t),void 0===e.layoutParams&&n.layoutParams&&void 0!==bt&&n.layoutParams(bt),o=wt.getDerivedFromVars(mt.text),ft(),ft=a(o,(t=>K=t)),Lt=K,Rt=xt,xt=String(null!=Lt?Lt:"")||Rt,xt?$t=!1:($t=!0,wt.logError(q(new Error('Missing "text" prop for div "text"')))),s=wt.getDerivedFromVars(mt.ranges),it(),it=a(s,(t=>z=t)),l=wt.getDerivedFromVars(mt.images),rt(),rt=a(l,(t=>S=t)),c=wt.getDerivedFromVars({font_size:mt.font_size,letter_spacing:mt.letter_spacing,font_weight:mt.font_weight,text_color:mt.text_color,underline:mt.underline,strike:mt.strike,line_height:mt.line_height}),ot(),ot=a(c,(t=>I=t)),d=wt.getDerivedFromVars(mt.font_size),ht(),ht=a(d,(t=>X=t)),kt=Vt(X,kt),g=wt.getDerivedFromVars(mt.line_height),pt(),pt=a(g,(t=>G=t));{const t=G;jt(t)?(Ct=Number(t)/kt,Ft=!0):Ft=!1}p=wt.getDerivedFromVars(mt.max_lines),ut(),ut=a(p,(t=>B=t)),h=1===B;{let t="",e="",r=!1;if(B&&B>1){let n=Number(B);t=n*Ct+"em",z||S||(e=n,r=!0)}At=t,Dt=e,St=r}f=wt.getDerivedFromVars(mt.text_alignment_horizontal),gt(),gt=a(f,(t=>R=t)),It=zt(R,It),m=wt.getDerivedFromVars(mt.text_alignment_vertical),dt(),dt=a(m,(t=>L=t)),Ot=Mt(L,Ot),y=!z||xt&&1===z.length&&z[0]&&0===z[0].start&&"number"==typeof z[0].end&&z[0].end>=xt.length,_=wt.getDerivedFromVars(mt.text_color),ct(),ct=a(_,(t=>U=t)),b=Boolean(U)!==Boolean(z&&z[0]&&z[0].text_color);{let t="";B&&y&&b&&(t=Q(U||z&&z[0]&&z[0].text_color,1,Jt)),Jt=t}w=wt.getDerivedFromVars(mt.truncate),lt(),lt=a(w,(t=>T=t)),$="none"===T?"none":"",x=wt.getDerivedFromVars(mt.text_gradient),st(),st=a(x,(t=>J=t));{let t="";if(J){const e=nt([J]);e.image&&(t=e.image)}Nt=t}return k=wt.getDerivedFromVars(mt.selectable),at(),at=a(k,(t=>O=t)),Tt=function(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}(O,Tt),C=wt.getDerivedFromVars(mt.width),et(),et=a(C,(t=>D=t)),F=wt.getDerivedFromVars(mt.height),tt(),tt=a(F,(t=>j=t)),function(t,e,r){let n=[];if(Bt.forEach((t=>{wt.removeSvgFilter(t)})),Bt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(Ut=[]);const i=t;let o=e||[{start:0,end:i.length}],a=r||[],s=0,l=[],c=[];o.forEach((t=>{void 0!==t.start&&void 0!==t.end&&(c.push({index:t.start,range:t,type:"rangeStart",isStart:!0}),c.push({index:t.end,range:t,type:"rangeEnd"}))})),a.forEach(((t,e)=>{void 0!==t.start&&t.url&&t.start<=i.length&&c.push({index:t.start,image:t,type:"image",arrayIndex:e})})),c.sort(((t,e)=>t.index===e.index?t.type!==e.type?"image"===t.type?-1:"image"===e.type?1:t.type<e.type?-1:1:"image"===t.type&&"image"===e.type?e.arrayIndex-t.arrayIndex:"rangeStart"===t.type&&"rangeStart"===e.type?t.range.end-e.range.end:"rangeStart"===t.type?1:"rangeStart"===e.type?-1:"image"!==t.type&&"image"!==e.type?t.range.start-e.range.start:0:t.index-e.index)),c.forEach((t=>{var e;let r="image"===t.type?null:t.range,o=t.index;if(o>s){let r=Object.assign(Object.assign({},I),...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({},I),...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)/kt)};let a="";if(t.image.tint_color){const e=Q(t.image.tint_color);a=wt.addSvgFilter(e),Bt.push(e)}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({},I)}),Ut=n}(xt,z,S),E={singleline:h,multiline:St,halign:It,valign:Ot,truncate:$,width:"wrap_content"!==(null==D?void 0:D.type)||D.constrained?"":"content",height:!j||"wrap_content"===j.type&&!j.constrained?"content":""},A={gradient:Boolean(Nt)},V={"font-size":Z(kt),"line-height":Ct,"max-height":At,"-webkit-line-clamp":Dt,color:Jt,"background-image":Nt},tt(),et(),rt(),it(),ot(),at(),st(),lt(),ct(),ut(),dt(),gt(),pt(),ht(),ft(),$t?"":`${M(Et,"Outer").$$render(t,{cls:vt("text",H,E)+" "+(Tt?"":"divkit-c016"),json:mt,origJson:_t,templateContext:yt,layoutParams:bt},{},{default:()=>`<span${N("class",vt("text__inner",H,A),0)}${N("style",Y(V),0)}>${Ut.length?`${P(Ut,((e,r)=>"text"in e?e.text?`${M(Pt,"TextRangeView").$$render(t,{text:e.text,rootFontSize:kt,textStyles:e.textStyles,singleline:h,actions:e.actions},{},{})}`:"":e.image?`<span${N("style",Y(e.image.wrapperStyle),0)}><img${N("class",H.text__image,0)}${N("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${N("style",Y({width:e.image.width,height:e.image.height,"margin-top":Ft?`-${e.image.height}`:void 0,"margin-bottom":Ft?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${M(Pt,"TextRangeView").$$render(t,{text:xt,rootFontSize:kt,textStyles:I,singleline:h},{},{})}`}</span>`})}`})),Ot=It,Jt={container:"divkit-d37d",container_orientation_vertical:"divkit-ddc3",container_valign_top:"divkit-a331",container_valign_center:"divkit-aae6",container_valign_bottom:"divkit-c222",container_orientation_horizontal:"divkit-fe45",container_halign_left:"divkit-a309",container_halign_center:"divkit-bac9",container_halign_right:"divkit-f423",container_orientation_overlap:"divkit-a644"},Nt=J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p,h,f,m,y,_,b=r,w=r,$=r,x=r,k=r,{json:C={}}=e,{templateContext:F}=e,{origJson:E}=e,{layoutParams:A}=e;const V={left:"start",center:"center",right:"end"},j={top:"start",center:"center",bottom:"end"},D=v(W);let S=!1,z="vertical",I="top",O="left",J={};void 0===e.json&&n.json&&void 0!==C&&n.json(C),void 0===e.templateContext&&n.templateContext&&void 0!==F&&n.templateContext(F),void 0===e.origJson&&n.origJson&&void 0!==E&&n.origJson(E),void 0===e.layoutParams&&n.layoutParams&&void 0!==A&&n.layoutParams(A),o=C.items,(null==o?void 0:o.length)&&Array.isArray(o)?S=!1:(S=!0,D.logError(q(new Error('Incorrect or empty "items" prop for div "container"')))),s=(!S&&o||[]).map((t=>{let e=t,r=F;return({templateContext:r,json:e}=D.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=D.getDerivedFromVars(C.orientation),k(),k=a(l,(t=>_=t)),z=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(_,z),c=D.getDerivedFromVars(C.content_alignment_vertical),x(),x=a(c,(t=>y=t)),I=Mt(y,I),u=D.getDerivedFromVars(C.content_alignment_horizontal),$(),$=a(u,(t=>m=t)),O=zt(m,O),d=D.getDerivedFromVars(C.width),b(),b=a(d,(t=>h=t)),g=D.getDerivedFromVars(C.height),w(),w=a(g,(t=>f=t));{let t={};"overlap"===z&&(t.overlapParent=!0),"horizontal"!==z&&(t.parentHAlign=V[O],(!f||"wrap_content"===f.type||"match_parent"===f.type&&(null==A?void 0:A.parentVerticalWrapContent))&&(t.parentVerticalWrapContent=!0)),"vertical"!==z&&(t.parentVAlign=j[I],("wrap_content"===(null==h?void 0:h.type)||"match_parent"===(null==h?void 0:h.type)&&(null==A?void 0:A.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0)),"horizontal"===z&&(t.parentContainerOrientation="horizontal"),"vertical"===z&&(t.parentContainerOrientation="vertical"),J=wt(t,J)}return p={orientation:z,valign:I,halign:O},b(),w(),$(),x(),k(),S?"":`${M(Et,"Outer").$$render(t,{cls:vt("container",Jt,p),json:C,origJson:E,templateContext:F,layoutParams:A},{},{default:()=>`${P(s,(e=>`${M(Pe,"Unknown").$$render(t,{layoutParams:J,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),Tt={separator:"divkit-a30b",separator_orientation_horizontal:"divkit-f529",separator_orientation_vertical:"divkit-e9e2",separator__inner:"divkit-db7d"};function Ut(t,e){return"vertical"===t||"horizontal"===t?t:e}const Bt=J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p=r,{json:h={}}=e,{templateContext:f}=e,{origJson:m}=e,{layoutParams:y}=e;const _=v(W);let b="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&n.json&&void 0!==h&&n.json(h),void 0===e.templateContext&&n.templateContext&&void 0!==f&&n.templateContext(f),void 0===e.origJson&&n.origJson&&void 0!==m&&n.origJson(m),void 0===e.layoutParams&&n.layoutParams&&void 0!==y&&n.layoutParams(y),o=_.getDerivedFromVars(h.delimiter_style),p(),p=a(o,(t=>g=t)),b=Ut(null==g?void 0:g.orientation,b),s=!((null==g?void 0:g.color)&&("transparent"===g.color||9===g.color.length&&0===g.color.indexOf("#00"))),w=Q(null==g?void 0:g.color,1,w),l="horizontal"===b?"100%":Z(1),c="horizontal"===b?Z(1):"100%",u={background:w,width:l,height:c},d={orientation:b},p(),`${M(Et,"Outer").$$render(t,{cls:vt("separator",Tt,d),json:h,origJson:m,templateContext:f,layoutParams:y},{},{default:()=>s?`<span${N("class",Tt.separator__inner,0)}${N("style",Y(u),0)}></span>`:""})}`})),Lt={image:"divkit-a448","image_is-width-content":"divkit-fe14","image_is-height-content":"divkit-f4d9",image__image:"divkit-ce04",image_error:"divkit-f10d","image__aspect-wrapper":"divkit-dc80",image_aspect:"divkit-ae78"},Rt=J(((t,e,n,i)=>{let o,s,l,c,d,g,p,h,f,m,y,_,b,w,$,x,k,C,F,E,A,V,j,D,S,P,z,I,O,J=r,T=r,B=r,L=r,R=r,H=r,G=r,Z=r,X=r,K=r,tt=r,{json:rt={}}=e,{templateContext:nt}=e,{origJson:it}=e,{layoutParams:ot}=e;const lt=v(W);let ct,ut=!1,dt=!0,gt="rgba(0,0,0,0.08)",pt=!1,ht="",ft="none",mt="50% 50%",yt="0",_t="";u((()=>{lt.removeSvgFilter(ct)})),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=lt.getDerivedFromVars(rt.image_url),tt(),tt=a(o,(t=>O=t)),s=lt.getDerivedFromVars(rt.gif_url),K(),K=a(s,(t=>I=t)),l=O||I,dt=!0,ut=!1,l?pt=!1:(pt=!0,lt.logError(q(new Error('Missing "image_url" for "image"')))),c=lt.getDerivedFromVars(rt.width),X(),X=a(c,(t=>z=t)),d="wrap_content"===(null==z?void 0:z.type),g=lt.getDerivedFromVars(rt.height),Z(),Z=a(g,(t=>P=t)),p="wrap_content"===(null==P?void 0:P.type),h=lt.getDerivedFromVars(rt.preview),G(),G=a(h,(t=>S=t));{const t=S;ht=t?t.startsWith("data:")?`url("${et(t)}")`:`url("data:image/jpg;base64,${et(t)}")`:""}f=lt.getDerivedFromVars(rt.placeholder_color),H(),H=a(f,(t=>D=t)),gt=Q(D,1,gt),m=lt.getDerivedFromVars(rt.scale),R(),R=a(m,(t=>j=t)),ft=at(j)||ft,y=lt.getDerivedFromVars({content_alignment_horizontal:rt.content_alignment_horizontal,content_alignment_vertical:rt.content_alignment_vertical}),L(),L=a(y,(t=>V=t)),mt=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)}(V,mt),_=lt.getDerivedFromVars(rt.accessibility),B(),B=a(_,(t=>A=t)),b=(null==A?void 0:A.description)||"",w=lt.getDerivedFromVars(rt.aspect),T(),T=a(w,(t=>E=t));{const t=null==E?void 0:E.ratio;yt=t&&jt(t)?(100/Number(t)).toFixed(2):"0"}$=lt.getDerivedFromVars(rt.tint_color),J(),J=a($,(t=>F=t));{const t=F,e=t?Q(t):void 0;e!==ct&&(lt.removeSvgFilter(ct),_t=e?lt.addSvgFilter(e):"",ct=e)}return x={aspect:"0"!==yt,"is-width-content":d,"is-height-content":p},k={"background-image":ht,"background-color":gt,"object-fit":ft,"object-position":mt,filter:""},C=Y(k),J(),T(),B(),L(),R(),H(),G(),Z(),X(),K(),tt(),pt?"":`${M(Et,"Outer").$$render(t,{cls:vt("image",Lt,x),json:rt,origJson:it,templateContext:nt,layoutParams:ot,customDescription:!0},{},{default:()=>x.aspect?`<span${N("class",Lt["image__aspect-wrapper"],0)}${U({"padding-bottom":`${yt}%`})}><img${N("class",Lt.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",C,0)}${N("alt",b,0)}${N("aria-hidden",b?null:"true",0)}></span>`:`<img${N("class",Lt.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",Y(k),0)}${N("alt",b,0)}${N("aria-hidden",b?null:"true",0)}>`})}`})),Wt={grid:"divkit-d908",grid_halign_left:"divkit-f63b",grid_halign_center:"divkit-a14a",grid_halign_right:"divkit-b071",grid_valign_top:"divkit-fbca",grid_valign_center:"divkit-d431",grid_valign_bottom:"divkit-e420"};function qt(t){return t>0&&t<1}function Ht(t){return String(Math.ceil(1e3*t)/1e3)}function Gt(t,e,r){if(t.some(qt)){const e=Math.max(...t.filter(qt).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)},${Ht(t[e])}fr)`:t[e]?o[e]=`${Ht(t[e])}fr`:o[e]="auto";return o.join(" ")}const Yt=J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p,h,f,m,y,_=r,b=r,w=r,$=r,{json:x={}}=e,{templateContext:k}=e,{origJson:C}=e,{layoutParams:F}=e;const E=v(W);let A,V,j=!1,D=1,S=[],z=[],I=[],O=[],J=0,N=!1,T="top",U="left";void 0===e.json&&n.json&&void 0!==x&&n.json(x),void 0===e.templateContext&&n.templateContext&&void 0!==k&&n.templateContext(k),void 0===e.origJson&&n.origJson&&void 0!==C&&n.origJson(C),void 0===e.layoutParams&&n.layoutParams&&void 0!==F&&n.layoutParams(F),o=x.items,(null==o?void 0:o.length)&&Array.isArray(o)?j=!1:(j=!0,E.logError(q(new Error('Incorrect or empty "items" prop for div "grid"')))),s=E.getDerivedFromVars(x.column_count),$(),$=a(s,(t=>y=t)),D=Vt(y,D),l=(!j&&o||[]).map((t=>{let e=t,r=k;return({templateContext:r,json:e}=E.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];l.forEach((e=>{t.push(E.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),A=R(t,(t=>[...t])),w(),w=a(A,(t=>m=t))}{const t={};let e=0,r=0;S=[],z=[],I=[],O=[],N=!1,V=l.map(((n,i)=>{var o,a,s,l;const c=m[i],u=Number(c.columnSpan)||1,d=Number(c.rowSpan)||1,v={x:e,y:r,colSpan:u,rowSpan:d},g="match_parent"===(null===(o=c.width)||void 0===o?void 0:o.type)?Number(c.width.weight||1)/u:0,p="match_parent"===(null===(a=c.height)||void 0===a?void 0:a.type)?Number(c.height.weight||1)/d:0,h=1===u&&"fixed"===(null===(s=c.width)||void 0===s?void 0:s.type)&&c.width.value?Number(c.width.value)/u:0,f=1===d&&"fixed"===(null===(l=c.height)||void 0===l?void 0:l.type)&&c.height.value?Number(c.height.value)/d:0;for(let n=e;n<e+u;++n)for(let e=r;e<r+d;++e)t[n+"_"+e]?N=!0:(t[n+"_"+e]=!0,(!S[n]||S[n]<g)&&(S[n]=g),(!z[e]||z[e]<p)&&(z[e]=p),(!I[n]||I[n]<h)&&(I[n]=h),(!O[e]||O[e]<f)&&(O[e]=f));do{++e,e>=D&&(e=0,++r)}while(t[e+"_"+r]);return Object.assign(Object.assign({},n),{layoutParams:{gridArea:v}})})),0!==e&&(N=!0),N&&E.logError(q(new Error('Mismatching "grid" rows/columns'))),J=r}return c=E.getDerivedFromVars(x.content_alignment_vertical),b(),b=a(c,(t=>f=t)),T=Mt(f,T),u=E.getDerivedFromVars(x.content_alignment_horizontal),_(),_=a(u,(t=>h=t)),U=zt(h,U),d={valign:T,halign:U},g={"grid-template-columns":Gt(S,I,D),"grid-template-rows":Gt(z,O,J)},p=j||N,_(),b(),w(),$(),p?"":`${M(Et,"Outer").$$render(t,{cls:vt("grid",Wt,d),json:x,origJson:C,templateContext:k,style:g,layoutParams:F},{},{default:()=>`${P(V,(e=>`${M(Pe,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),Zt=Yt,Xt={gallery:"divkit-cbb0",gallery_orientation_horizontal:"divkit-c9be",gallery_orientation_vertical:"divkit-a72d",gallery__scroller:"divkit-a4e3","gallery_scroll-snap":"divkit-f606","gallery__items-grid":"divkit-eb4a",gallery__items:"divkit-af27",gallery__arrow:"divkit-b72d","gallery__arrow-icon":"divkit-d100",gallery__arrow_left:"divkit-a0a5",gallery__arrow_right:"divkit-f0f5","gallery__arrow-icon-path":"divkit-b417"};function Kt(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(" ")}const Qt=J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p,h,f,m,y,_,b,w,$,x,k,C,F,E,A,V=r,j=r,D=r,S=r,z=r,I=r,O=r,J=r,{json:T={}}=e,{templateContext:U}=e,{origJson:B}=e,{layoutParams:L}=e;const H=v(W);let G,X,K,Q=[],tt=!1,et=1,rt="horizontal",nt="start",it=8,ot="",at=[],st={},lt=!1,ct={},ut=0;function dt(){let t=[],e=Q[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<et;++e){const n=Q[e].children[r];n&&t.push(n)}return t}function gt(t,e,r="smooth"){const n="horizontal"===rt,i=n?"offsetLeft":"offsetTop",o=n?"left":"top";G.scroll({[o]:Math.max(0,t[e][i]-it/2),behavior:r})}function pt(t){const e=dt(),r=G.getBoundingClientRect(),n=e.findIndex((t=>function(t,e){return"horizontal"===rt?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"===rt?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}T.id&&!tt&&H.registerInstance(T.id,{setCurrentItem(t){const e=dt();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');gt(e,t)},setPreviousItem(t){const e=pt("prev"),r=dt();let n=e-1;n<0&&(n="ring"===t?r.length-1:e),gt(r,n)},setNextItem(t){const e="horizontal"===rt?G.scrollLeft+G.offsetWidth===G.scrollWidth:G.scrollTop+G.offsetHeight===G.scrollHeight,r=dt();if(e&&"ring"===t)return void gt(r,0);const n=pt("next");let i=n+1;i>r.length-1&&(i="ring"===t?0:n),gt(r,i)}}),void 0===e.json&&n.json&&void 0!==T&&n.json(T),void 0===e.templateContext&&n.templateContext&&void 0!==U&&n.templateContext(U),void 0===e.origJson&&n.origJson&&void 0!==B&&n.origJson(B),void 0===e.layoutParams&&n.layoutParams&&void 0!==L&&n.layoutParams(L),o=T.items,(null==o?void 0:o.length)&&Array.isArray(o)?tt=!1:(tt=!0,H.logError(q(new Error('Incorrect or empty "items" prop for div "gallery"')))),s=(!tt&&o||[]).map((t=>{let e=t,r=U;return({templateContext:r,json:e}=H.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=H.getDerivedFromVars(T.column_count),J(),J=a(l,(t=>A=t)),et=Vt(A,et),c=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),u=H.getDerivedFromVars(T.orientation),O(),O=a(u,(t=>E=t)),rt=Ut(E,rt),d=H.getDerivedFromVars(T.cross_content_alignment),I(),I=a(d,(t=>F=t)),nt=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(F,nt),g=H.getDerivedFromVars(T.item_spacing),z(),z=a(g,(t=>C=t)),it=yt(C,it),X=Z(it),p=H.getDerivedFromVars(T.paddings),S(),S=a(p,(t=>k=t)),ot=mt(k,ot),h="horizontal"===rt?"grid-template-columns":"grid-template-rows";{let t=[];s.forEach((e=>{const r="horizontal"===rt?"width":"height";t.push(H.getDerivedFromVars(e.json[r]))})),K=R(t,(t=>t)),D(),D=a(K,(t=>x=t))}at=[],et>1?at.push("auto"):x.forEach((t=>{!t&&"horizontal"===rt||"match_parent"===(null==t?void 0:t.type)?at.push("100%"):at.push("max-content")})),f=H.getDerivedFromVars(T.scroll_mode),j(),j=a(f,(t=>$=t));{const t={};let e={};lt=!1,"horizontal"===rt?e.parentVAlign=nt:e.parentHAlign=nt,"paging"===$&&(lt=!0,e.scrollSnap="start",t["horizontal"===rt?"scroll-padding-left":"scroll-padding-top"]=Z(it/2)),1===et&&(e.parentLayoutOrientation=rt),st=wt(t,st),ct=wt(e,ct)}return m={padding:ot,"grid-gap":X},y={"grid-gap":X,[h]:Kt(at)},_={orientation:rt,"scroll-snap":lt},b=H.getDerivedFromVars(T.default_item),V(),V=a(b,(t=>w=t)),ut=yt(w,ut),V(),j(),D(),S(),z(),I(),O(),J(),tt?"":`${M(Et,"Outer").$$render(t,{cls:vt("gallery",Xt,_),json:T,origJson:B,templateContext:U,layoutParams:L,customPaddings:!0,customActions:"gallery",forceHeight:"vertical"===rt,forceWidth:"horizontal"===rt},{},{default:()=>`<div${N("class",Xt.gallery__scroller,0)}${N("style",Y(st),0)}${N("this",G,0)}><div${N("class",Xt["gallery__items-grid"],0)}${N("style",Y(m),0)}>${P(c,((e,r)=>`<div${N("class",Xt.gallery__items,0)}${N("style",Y(y),0)}${N("this",Q[r],0)}>${P(e,(e=>`${M(Pe,"Unknown").$$render(t,{layoutParams:ct,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===rt?"\n ":""}`})}`})),te=Qt,ee={tabs:"divkit-e0df",tabs__list:"divkit-ea19",tabs__item:"divkit-c25c",tabs__item_selected:"divkit-d560",tabs__item_actionable:"divkit-dfda",tabs__panels:"divkit-f5dc",tabs__swiper:"divkit-eb42",tabs__swiper_animated:"divkit-b9f1",tabs__swiper_inited:"divkit-fa57",tabs__panel:"divkit-cc9f",tabs__panel_visible:"divkit-e730",tabs__separator:"divkit-b85b"},re=J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p,h,f,m,y,b,w,$,x,k,C,F=r,E=r,A=r,V=r,D=r,S=r,z=r;var I;let{json:O={}}=e,{templateContext:J}=e,{origJson:T}=e,{layoutParams:B}=e;const L=v(W),R=L.genId("tabs");let H,G,X,K=!1,tt={};const et=L.getJsonWithVars(O.selected_tab);let rt,nt,it=et&&Number(et)||0,ot=12,at="",st="",lt="",ct="",ut="",dt="",gt="",pt="",yt="",_t="",bt=!1,$t=!1,xt=it,Ct=[],Ft=[];async function At(t,e=!1){if(xt=it,it=t,bt||(bt=!0,G.style.height=Z(G.clientHeight),X.style.transform=`translate3d(${100*-xt}%,0,0)`),$t=!0,async function(t){await _(),X.style.transform=`translate3d(${t}%,0,0)`}(100*-it),function(t=!1){const e=t?Math.max(0,it-1):Math.min(it,xt),r=t?Math.min(o.length-1,it+1):Math.max(it,xt);Ct=Ct.map(((t,n)=>t||n>=e&&n<=r)),Ft=Ft.map(((t,n)=>n>=e&&n<=r))}(),async function(){await _();const t=document.getElementById(`${R}-panel-${it}`);t&&(G.style.height=Z(t.offsetHeight))}(),Pt&&clearTimeout(Pt),Pt=window.setTimeout((()=>{Ft=o.map(((t,e)=>e===it))}),400),Dt=-it*G.clientWidth,e){await _();const t=H.querySelector(`.${ee.tabs__item_selected}`);t&&t.focus()}}let Dt,Pt=null;O.id&&!K&&L.registerInstance(O.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');At(t)},setPreviousItem(t){let e=it-1;e<0&&(e="ring"===t?o.length-1:it),At(e)},setNextItem(t){let e=it+1;e>o.length-1&&(e="ring"===t?0:it),At(e)}}),void 0===e.json&&n.json&&void 0!==O&&n.json(O),void 0===e.templateContext&&n.templateContext&&void 0!==J&&n.templateContext(J),void 0===e.origJson&&n.origJson&&void 0!==T&&n.origJson(T),void 0===e.layoutParams&&n.layoutParams&&void 0!==B&&n.layoutParams(B),o=O.items||[],(null==o?void 0:o.length)&&Array.isArray(o)?K=!1:(K=!0,L.logError(q(new Error('Incorrect or empty "items" prop for div "tabs"')))),s=L.getDerivedFromVars(O.width),z(),z=a(s,(t=>C=t)),l=L.getDerivedFromVars(O.height),S(),S=a(l,(t=>k=t));{let t={};"wrap_content"===(null==C?void 0:C.type)&&(t.parentHorizontalWrapContent=!0),k&&"wrap_content"!==k.type||(t.parentVerticalWrapContent=!0),tt=wt(t,tt)}if(!K&&(it<0||it>=o.length)&&(L.logError(q(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:O.selected_tab,length:o.length}})),it=it<0?0:o.length-1),c=L.getDerivedFromVars(O.tab_title_style),D(),D=a(c,(t=>x=t)),u=x||{},ot=Vt(u.font_size,ot),u.font_size||u.paddings){const t=u.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/ot*10,right:(Number(t.right)||0)/ot*10,bottom:(Number(t.bottom)||0)/ot*10,left:(Number(t.left)||0)/ot*10};at=mt(e,at)}{const t=u.line_height;void 0!==t&&jt(t)&&(st=Z(t/ot*10))}{const t=u.letter_spacing;void 0!==t&&ht(t)&&(lt=Z(t/ot*10))}if(u.corner_radius||u.corners_radius||u.font_size){const t=null!==(I=u.corner_radius)&&void 0!==I?I:1e3;u.corners_radius?ct=ft(u.corners_radius,t,ot,ct):ht(t)&&(ct=Z(t/ot*10))}return rt=St(u.active_font_weight||u.font_weight,rt),nt=St(u.inactive_font_weight||u.font_weight,nt),ut=Q(u.active_text_color,1,ut),dt=Q(u.inactive_text_color,1,dt),gt=Q(u.active_background_color,1,gt),pt=Q(u.inactive_background_color,1,pt),d=L.getDerivedFromVars(O.has_separator),V(),V=a(d,(t=>$=t)),g=L.getDerivedFromVars(O.separator_color),A(),A=a(g,(t=>w=t)),p=L.getDerivedFromVars(O.separator_paddings),E(),E=a(p,(t=>b=t)),$&&(w&&(yt=Q(w,1,yt)),b&&(_t=mt(b,_t))),h={background:yt,margin:_t},f=L.getDerivedFromVars(O.switch_tabs_by_content_swipe_enabled),F(),F=a(f,(t=>y=t)),m=void 0===y||Boolean(y),K||(Ct=o.map(((t,e)=>e===it)),Ft=o.map(((t,e)=>e===it))),F(),E(),A(),V(),D(),S(),z(),K?"":`${M(Et,"Outer").$$render(t,{cls:vt("tabs",ee,{}),json:O,origJson:T,templateContext:J,layoutParams:B,customActions:"tabs"},{},{default:()=>`<div${N("class",ee.tabs__list,0)} role="tablist"${U({"--divkit-tabs-font-size":Z(ot),"--divkit-tabs-paddings":at,"--divkit-tabs-line-height":st,"--divkit-tabs-letter-spacing":lt,"--divkit-tabs-active-font-weight":rt||"","--divkit-tabs-inactive-font-weight":nt||"","--divkit-tabs-active-text-color":ut,"--divkit-tabs-inactive-text-color":dt,"--divkit-tabs-active-background-color":gt,"--divkit-tabs-inactive-background-color":pt,"--divkit-tabs-border-radius":ct})}${N("this",H,0)}>${P(o,((e,r)=>{let n=r===it;return`\n\n ${M(kt,"Actionable").$$render(t,{cls:vt("tabs__item",ee,{selected:n,actionable:Boolean(e.title_click_action)}),actions:e.title_click_action?[e.title_click_action]:[],attrs:{id:`${R}-tab-${r}`,"aria-controls":`${R}-panel-${r}`,role:"tab",tabindex:n?e.title_click_action?void 0:"0":"-1","aria-selected":n?"true":"false"},customAction:t=>function(t,e){return it===e||(At(e),!1)}(0,r)},{},{default:()=>`${j(e.title)}\n `})}`}))}</div>\n ${$?`<div${N("class",ee.tabs__separator,0)}${N("style",Y(h),0)}></div>`:""}\n <div${N("class",ee.tabs__panels,0)}${N("this",G,0)}><div${N("class",vt("tabs__swiper",ee,{inited:bt,animated:$t}),0)}${N("this",X,0)}>${P(o,((e,r)=>`<div${N("class",vt("tabs__panel",ee,{visible:Ft[r]}),0)} role="tabpanel" id="${j(R,!0)+"-panel-"+j(r,!0)}" aria-labelledby="${j(R,!0)+"-tab-"+j(r,!0)}" style="${"left: "+j(100*r,!0)+"%"}">${Ct[r]?`${M(Pe,"Unknown").$$render(t,{div:e.div,templateContext:J,layoutParams:tt},{},{})}`:""}\n </div>`))}</div></div>`})}`})),ne=re;function ie(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)}}ie([.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]),ie([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 oe=J(((t,e,r,n)=>{let i,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const c=v(W);let u=new Map,g=new Set,p=!1,h=null,f=[],m=[],y=[],b=[];const w=o.div_id||o.id;w?(v(gt).registerInstance(w,{async setState(t){if($===t)return;c.setRunning("stateChange",!0),new Set(g),f.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),f=[],b.forEach((t=>{u.set(t.id,t.node.getBoundingClientRect())})),m=[],y=[],b=[];const e=i.find((e=>e.state_id===t))||null;e?($=t,x=e):c.logError(q(new Error("Cannot find state with id"),{additional:{stateId:t}})),await _()},getChild(t){if(h&&h.has(t))return h.get(t);c.logError(q(new Error("Missing state block with id"),{additional:{id:t}}))}}),d(gt,{registerInstance(t,e){h||(h=new Map),h.has(t)?c.logError(q(new Error("Duplicate state with id"),{additional:{id:t}})):h.set(t,e)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return m.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return y.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 b.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&u.has(t),registerChild(t){g.add(t)},unregisterChild(t){g.delete(t)}})):(p=!0,c.logError(q(new Error('Missing "id" prop for div "state"'))));let $,x=null;const k=c.getJsonWithVars(o.default_state_id);let C=!1;return 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&&(g=new Set),i=o.states||[],(null==i?void 0:i.length)?p=!1:(p=!0,c.logError(q(new Error('Empty "states" prop for div "state"')))),function(t){C||(C=!0,t.length&&(k?($=k,x=t.find((t=>t.state_id===$))||null,x||c.logError(q(new Error("Cannot find state for default_state_id"),{additional:{selectedId:$}}))):(x=t[0],$=x.state_id)))}(i),p?"":`${M(Et,"Outer").$$render(t,{cls:"divkit-b8ef",json:o,origJson:s,templateContext:a,layoutParams:l},{},{default:()=>{var e;return`${null!==(e=x)&&void 0!==e&&e.div?`${M(Pe,"Unknown").$$render(t,{div:x.div,templateContext:a},{},{})}`:""}\n <div${N("class","divkit-adaa",0)}${N("this",undefined,0)}>${P(f,(e=>"direction"in e?`<div${N("class","divkit-eb86",0)} style="${"left:"+j(e.offsetLeft,!0)+"px;top:"+j(e.offsetTop,!0)+"px;width:"+j(e.width,!0)+"px;height:"+j(e.height,!0)+"px"}"><div${N("class","divkit-e08c",0)}>${M(Pe,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext},{},{})}</div>\n </div>`:`<div${N("class","divkit-eb86",0)}><div${N("class","divkit-e08c",0)}>${M(Pe,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext},{},{})}</div>\n </div>`))}</div>`}})}`})),ae={pager:"divkit-c5fe",pager__items:"divkit-f698",pager__item:"divkit-feca",pager_orientation_horizontal:"divkit-b0a1",pager_orientation_vertical:"divkit-f772"},se=J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p,h,f,m,y,_,b,w,$=r,x=r,k=r,C=r,F=r;var E,A,V,j,D,S,z;let{json:I={}}=e,{templateContext:O}=e,{origJson:J}=e,{layoutParams:T}=e;const U=v(W),B=U.genId("pager");let L,R=!1,H=0,G=!1,K="horizontal",Q="",tt="",et="";function rt(t,e="smooth"){const r="horizontal"===K,n=L.children[t],i=r?"offsetLeft":"offsetTop",o=r?"left":"top";L.scroll({[o]:n[i],behavior:e}),H=t}I.id&&U.registerInstance(I.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');rt(t)},setPreviousItem(t){let e=H-1;e<0&&(e="ring"===t?o.length-1:H),rt(e)},setNextItem(t){let e=H+1;e>o.length-1&&(e="ring"===t?0:H),rt(e)}}),void 0===e.json&&n.json&&void 0!==I&&n.json(I),void 0===e.templateContext&&n.templateContext&&void 0!==O&&n.templateContext(O),void 0===e.origJson&&n.origJson&&void 0!==J&&n.origJson(J),void 0===e.layoutParams&&n.layoutParams&&void 0!==T&&n.layoutParams(T),(null===(E=I.items)||void 0===E?void 0:E.length)&&Array.isArray(I.items)?R=!1:(R=!0,U.logError(q(new Error('Incorrect or empty "items" prop for div "pager"')))),o=(!R&&I.items||[]).map((t=>{let e=t,r=O;return({templateContext:r,json:e}=U.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=U.getDerivedFromVars(I.layout_mode),x(),x=a(s,(t=>y=t)),y?"percentage"!==y.type&&"fixed"!==y.type?(G=!0,U.logError(q(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):G=!1:(G=!0,U.logError(q(new Error('Empty "layout_mode" prop for div "pager"')))),l=U.getDerivedFromVars(I.orientation),F(),F=a(l,(t=>w=t)),K=Ut(w,K),c=U.getDerivedFromVars(I.item_spacing),C(),C=a(c,(t=>b=t));{const t=null==b?void 0:b.value;t&&ht(t)&&(Q=Z(t||0))}if(u=U.getDerivedFromVars(I.paddings),k(),k=a(u,(t=>_=t)),tt=mt(_,tt),d="horizontal"===K?"grid-auto-columns":"grid-auto-rows","fixed"===(null==y?void 0:y.type)){const t=X("horizontal"===K?((null===(A=I.paddings)||void 0===A?void 0:A.left)||0)+((null===(V=I.paddings)||void 0===V?void 0:V.right)||0):((null===(j=I.paddings)||void 0===j?void 0:j.top)||0)+((null===(D=I.paddings)||void 0===D?void 0:D.bottom)||0)),e=null===(S=y.neighbour_page_width)||void 0===S?void 0:S.value;et=e?`calc(100% + ${t} - 2 * ${X(e)} - 2 * ${Q})`:"100%"}else if("percentage"===(null==y?void 0:y.type)){const t=null===(z=y.page_width)||void 0===z?void 0:z.value;et=`${Number(t)}%`}return g={"grid-gap":Q,padding:tt,[d]:et},p={orientation:K},h=R||G,f=U.getStore("pagers"),$(),$=a(f,(t=>m=t)),function(t,e){const r=I.id;if(r){const o=new Map(m);n=f,m=o.set(r,{instId:B,size:t,currentItem:e,scrollToPagerItem:rt}),i=m,n.set(i)}var n,i}(o.length,H),$(),x(),k(),C(),F(),h?"":`${M(Et,"Outer").$$render(t,{cls:vt("pager",ae,p),json:I,origJson:J,templateContext:O,layoutParams:T,customPaddings:!0},{},{default:()=>`<div${N("class",ae.pager__items,0)}${N("style",Y(g),0)}${N("this",L,0)}>${P(o,(e=>`<div${N("class",ae.pager__item,0)}>${M(Pe,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}\n </div>`))}</div>`})}`})),le=se,ce={indicator:"divkit-d8e3",indicator__scroller:"divkit-b5db",indicator__items:"divkit-d5d9",indicator__item:"divkit-f662",indicator__item_active:"divkit-b39c"},ue=J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p,h,f,m,y,b=r,w=r,$=r,x=r,k=r,C=r,{json:F={}}=e,{templateContext:E}=e,{origJson:A}=e,{layoutParams:V}=e;const D=v(W);let S,z,I,O=10,J=10,T=5,B="#ffdc60",L=Q("#33919cb5"),R=15,q=1.3;return void 0===e.json&&n.json&&void 0!==F&&n.json(F),void 0===e.templateContext&&n.templateContext&&void 0!==E&&n.templateContext(E),void 0===e.origJson&&n.origJson&&void 0!==A&&n.origJson(A),void 0===e.layoutParams&&n.layoutParams&&void 0!==V&&n.layoutParams(V),o=D.getDerivedFromVars(F.shape),C(),C=a(o,(t=>y=t)),y&&(y.item_width&&(O=yt(y.item_width.value,O)),y.item_height&&(J=yt(y.item_height.value,J)),y.corner_radius&&(T=yt(y.corner_radius.value,T))),s=D.getDerivedFromVars(F.active_item_color),k(),k=a(s,(t=>m=t)),B=Q(m,1,B),l=D.getDerivedFromVars(F.inactive_item_color),x(),x=a(l,(t=>f=t)),L=Q(f,1,L),c=D.getDerivedFromVars(F.space_between_centers),$(),$=a(c,(t=>h=t)),h&&(R=yt(h.value,R)),u=D.getDerivedFromVars(F.active_item_size),w(),w=a(u,(t=>p=t)),q=Vt(p,q),d=D.getStore("pagers"),b(),b=a(d,(t=>g=t)),async function(t){if(F.pager_id&&t.has(F.pager_id)){I=t.get(F.pager_id),await _();const e=z.children[I.currentItem].offsetLeft;S.scroll({left:e-S.clientWidth/2,behavior:"smooth"})}}(g),b(),w(),$(),x(),k(),C(),`${M(Et,"Outer").$$render(t,{cls:vt("indicator",ce,{}),json:F,origJson:A,templateContext:E,layoutParams:V},{},{default:()=>`<div${N("class",ce.indicator__scroller,0)}${N("this",S,0)}><div${N("class",ce.indicator__items,0)} role="tablist"${U({margin:`0 ${Z((q-1)*O/2)}`,"--divkit-indicator-width":Z(O),"--divkit-indicator-height":Z(J),"--divkit-indicator-border-radius":Z(T),"--divkit-indicator-active-color":B,"--divkit-indicator-inactive-color":L,"--divkit-indicator-active-scale":q,"--divkit-indicator-margin":`0 ${Z((R-O)/2)}`})}${N("this",z,0)}>${I?`${P(Array(I.size),((t,e)=>{let r=e===I.currentItem;return`\n <div class="${j(vt("indicator__item",ce,{active:r}),!0)+" "+j("divkit-bd25",!0)}" role="tab" id="${j(I.instId,!0)+"-tab-"+j(e,!0)}" aria-controls="${j(I.instId,!0)+"-panel-"+j(e,!0)}"${N("aria-selected",r?"true":"false",0)}${N("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),de=ue,ve={slider:"divkit-ef4f",slider__input:"divkit-d1d6",slider__input_secondary:"divkit-c798",slider__thumb:"divkit-f345",slider__thumb_secondary:"divkit-e198","slider__tracks-wrapper":"divkit-f733","slider__tracks-inner":"divkit-ac90",slider__track:"divkit-e956","slider__active-track":"divkit-ec5b","slider__thumb-text-wrapper":"divkit-ee57","slider__thumb-text":"divkit-c4af","slider__thumb-text_secondary":"divkit-d882",slider__tick:"divkit-bd9b",slider__tick_active:"divkit-d8ce",slider__tick_inactive:"divkit-e71e"};function ge(t,e){var r,n,i;if(!t||!t.shape||!t.color)return e;const o=Q(t.color),a=Number((null===(r=t.shape.item_width)||void 0===r?void 0:r.value)||10),s=Number((null===(n=t.shape.item_height)||void 0===n?void 0:n.value)||10),l=Number((null===(i=t.shape.corner_radius)||void 0===i?void 0:i.value)||5);if("shape_drawable"===t.type&&"transparent"!==o&&"rounded_rectangle"===t.shape.type){var c,u;const e={},r=null!==(c=t.stroke)&&void 0!==c&&c.color?Q(t.stroke.color):"",n=null!==(u=t.stroke)&&void 0!==u&&u.width?Number(t.stroke.width||1):"";return e.width=a,e.height=s,e.borderRadius=l,e.background=o,r&&n&&(e.boxShadow=`inset 0 0 0 ${Z(n)} ${r}`),e}return e}function pe(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&Q(t.text_color)||"#000",i=Dt(t.font_weight);if(jt(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 he(t,e,r){return Math.max(e,Math.min(r,t))}const fe=-2147483648,me=Number.MAX_VALUE,ye=Number.MIN_VALUE,_e="string",be="integer",we="number",$e="boolean",xe="color",ke="datetime";class Ce{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=L(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 Fe={string:class extends Ce{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends Ce{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 Ce{convertValue(t){if("number"!=typeof t||isNaN(t)||t>2147483647||t<fe||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 Ce{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 Ce{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 Ce{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function Ee(t,e,r){if(!(e in Fe))throw new Error("Unsupported variable type");return new Fe[e](t,r)}function Ae(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 Ve=J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p,h,f,m,y,_,b,w,$,x,k,C,F,E,A,V,D,S,z,I,O,J,T,B,L,R,H,G,Y,K,Q,tt,et,rt=r,nt=r,it=r,ot=r,at=r,st=r,lt=r,ct=r,ut=r,dt=r,gt=r,pt=r;var ft,mt,yt,_t,bt,wt,$t,kt;let{json:Ct={}}=e,{templateContext:At}=e,{origJson:Vt}=e,{layoutParams:jt}=e;const Dt={width:10,height:10,borderRadius:5,background:"#000"},St=v(W),Pt=v(xt);let zt=0,Mt=100;const It=St.getJsonWithVars(Ct.thumb_value_variable),Ot=St.getJsonWithVars(Ct.thumb_secondary_value_variable);Q=a(It&&St.getVariable(It,"integer")||Ee("temp","integer",0),(t=>K=t)),Y=a(Ot&&St.getVariable(Ot,"integer")||Ee("temp","integer",0),(t=>G=t));let Jt,Nt,Tt,Ut=he(K||0,zt,Mt),Bt=he(G||0,zt,Mt),Lt=Dt,Rt=Lt,Wt=Dt,qt=Dt,Ht=null,Gt=null,Yt=Tt,Zt="",Xt="",Kt=!1;void 0===e.json&&n.json&&void 0!==Ct&&n.json(Ct),void 0===e.templateContext&&n.templateContext&&void 0!==At&&n.templateContext(At),void 0===e.origJson&&n.origJson&&void 0!==Vt&&n.origJson(Vt),void 0===e.layoutParams&&n.layoutParams&&void 0!==jt&&n.layoutParams(jt),o=St.getDerivedFromVars(Ct.min_value),pt(),pt=a(o,(t=>et=t)),s=St.getDerivedFromVars(Ct.max_value),gt(),gt=a(s,(t=>tt=t)),zt=Ft(et,zt),Mt=Ft(tt,Mt);{const t=he(K||0,zt,Mt);t!==Ut&&(Ut=t)}{const t=he(G||0,zt,Mt);t!==Bt&&(Bt=t)}if(l=St.getDerivedFromVars(Ct.thumb_style),dt(),dt=a(l,(t=>H=t)),Lt=ge(H,Lt),c=St.getDerivedFromVars(Ct.thumb_secondary_style),ut(),ut=a(c,(t=>R=t)),Rt=ge(R,Lt),u=St.getDerivedFromVars(Ct.track_inactive_style),ct(),ct=a(u,(t=>L=t)),Wt=ge(L,Wt),d=St.getDerivedFromVars(Ct.track_active_style),lt(),lt=a(d,(t=>B=t)),qt=ge(B,qt),g=Mt-zt+1<=20,p=St.getDerivedFromVars(Ct.tick_mark_active_style),st(),st=a(p,(t=>T=t)),g){let t=ge(T,Dt);t!==Dt&&(Ht=t)}else Ht=null;if(Jt=Ht?Ot?Ae(Math.min(Ut,Bt),Math.max(Ut,Bt)+1,zt,Mt,!0):Ae(zt,Ut,zt,Mt,!0):[],h=St.getDerivedFromVars(Ct.tick_mark_inactive_style),at(),at=a(h,(t=>J=t)),g){let t=ge(J,Dt);t!==Dt&&(Gt=t)}else Gt=null;Nt=Gt?Ot?Ae(Math.min(Ut,Bt),Math.max(Ut,Bt)+1,zt,Mt,!1):Ae(Ut+1,Mt+1,zt,Mt,!0):[],f=St.getDerivedFromVars(Ct.thumb_text_style),ot(),ot=a(f,(t=>O=t)),Tt=pe(O,Tt),m=St.getDerivedFromVars(Ct.thumb_secondary_text_style),it(),it=a(m,(t=>I=t)),Yt=pe(I,Tt),y=St.getDerivedFromVars(Ct.accessibility),nt(),nt=a(y,(t=>z=t)),(null==z?void 0:z.description)?Zt=z.description:St.logError(q(new Error('Missing accessibility "description" for slider'),{level:"warn"})),_=St.getDerivedFromVars(Ct.secondary_value_accessibility),rt(),rt=a(_,(t=>S=t)),(null==S?void 0:S.description)?Xt=S.description:Ot&&St.logError(q(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;Pt.hasAction()?(St.logError(q(new Error('Cannot show "slider" inside component with action'))),t=!0):Lt===Dt?(St.logError(q(new Error('Missing "thumb_style" in slider'))),t=!0):qt===Dt?(St.logError(q(new Error('Missing "track_active_style" in slider'))),t=!0):Wt===Dt&&(St.logError(q(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==Kt&&(Kt=t)}return b=Math.max(...[Lt.height,Rt.height,Wt.height,qt.height,0].filter(ht)),w=Z(Math.max(...[Lt.width,Rt.width,0].filter(ht))),$=Z(Math.max(...[Lt.height,Rt.height,0].filter(ht))),x=(Ut-zt)/(Mt-zt),k=Ot?(Bt-zt)/(Mt-zt):void 0,C=void 0!==k?Math.abs(k-x):x,F=void 0!==k?Math.min(k,x):0,E=-Math.min(...[(b-Lt.height)/2+((null===(ft=null==Tt?void 0:Tt.offset)||void 0===ft?void 0:ft.y)||0),Ot?(b-Rt.height)/2+((null===(mt=null==Yt?void 0:Yt.offset)||void 0===mt?void 0:mt.y)||0):0,0].filter((t=>void 0!==t&&"number"==typeof t&&!isNaN(t)))),A=Math.max(...[((null===(yt=null==Tt?void 0:Tt.offset)||void 0===yt?void 0:yt.y)||0)-(b-Lt.height)/2,Ot?((null===(_t=null==Yt?void 0:Yt.offset)||void 0===_t?void 0:_t.y)||0)-(b-Rt.height)/2:0,0].filter((t=>void 0!==t&&"number"==typeof t&&!isNaN(t)))),V={"--divkit-slider-thumb-width":Z(Lt.width),"--divkit-slider-thumb-height":Z(Lt.height),"--divkit-slider-thumb-secondary-width":Z(Rt.width),"--divkit-slider-thumb-secondary-height":Z(Rt.height),"--divkit-slider-text-offset-x":(null===(bt=null==Tt?void 0:Tt.offset)||void 0===bt?void 0:bt.x)?X(Tt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(wt=null==Tt?void 0:Tt.offset)||void 0===wt?void 0:wt.y)?X(Tt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===($t=null==Yt?void 0:Yt.offset)||void 0===$t?void 0:$t.x)?X(Yt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(kt=null==Yt?void 0:Yt.offset)||void 0===kt?void 0:kt.y)?X(Yt.offset.y):void 0,"--divkit-slider-tick-active-width":Ht?Z(Ht.width):void 0,"--divkit-slider-tick-active-height":Ht?Z(Ht.height):void 0,"--divkit-slider-tick-active-border-radius":Ht?Z(Ht.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Ht?void 0:Ht.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Ht?void 0:Ht.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Gt?Z(Gt.width):void 0,"--divkit-slider-tick-inactive-height":Gt?Z(Gt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Gt?Z(Gt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Gt?void 0:Gt.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Gt?void 0:Gt.boxShadow)||void 0,"--divkit-slider-max-height":Z(b),"--divkit-slider-max-thumb-width":w,"--divkit-slider-max-thumb-height":$,"--divkit-slider-track-part":x,"--divkit-slider-track-secondary-part":k,"--divkit-slider-offset-top":X(E),"--divkit-slider-offset-bottom":X(A)},D={},rt(),nt(),it(),ot(),at(),st(),lt(),ct(),ut(),dt(),Y(),Q(),gt(),pt(),Kt?"":`${M(Et,"Outer").$$render(t,{cls:vt("slider",ve,D),style:V,customDescription:!0,customActions:"slider",json:Ct,origJson:Vt,templateContext:At,layoutParams:jt},{},{default:()=>{var t,e,r,n,i,o;return`<div${N("class",ve["slider__tracks-wrapper"],0)}>${Tt||Ot&&Yt?`<div${N("class",ve["slider__thumb-text-wrapper"],0)} aria-hidden="true">${Tt?`<div${N("class",ve["slider__thumb-text"],0)}><div${N("class",ve["slider__thumb-text-inner"],0)}${U({"font-size":(null===(t=Tt)||void 0===t?void 0:t.fontSize)||"1em","font-weight":(null===(e=Tt)||void 0===e?void 0:e.fontWeight)||"",color:(null===(r=Tt)||void 0===r?void 0:r.textColor)||"#000"})}>${j(Ut)}</div></div>`:""}\n ${Ot?`<div class="${j(ve["slider__thumb-text"],!0)+" "+j(ve["slider__thumb-text_secondary"],!0)}"><div${N("class",ve["slider__thumb-text-inner"],0)}${U({"font-size":(null===(n=Yt)||void 0===n?void 0:n.fontSize)||"1em","font-weight":(null===(i=Yt)||void 0===i?void 0:i.fontWeight)||"",color:(null===(o=Yt)||void 0===o?void 0:o.textColor)||"#000"})}>${j(Bt)}</div></div>`:""}</div>`:""}\n <div${N("class",ve["slider__tracks-inner"],0)}${N("this",undefined,0)}><div${N("class",ve.slider__track,0)}${U({height:Z(Wt.height),"border-radius":Z(Wt.borderRadius),background:Wt.background,"box-shadow":Wt.boxShadow||""})}></div>\n <div${N("class",ve["slider__active-track"],0)}${U({left:(100*F).toFixed(2)+"%",width:(100*C).toFixed(2)+"%",height:Z(qt.height),"border-radius":Z(qt.borderRadius),background:qt.background,"box-shadow":qt.boxShadow||""})}></div>\n ${P(Jt,(t=>`<div class="${j(ve.slider__tick,!0)+" "+j(ve.slider__tick_active,!0)}"${U({"--divkit-slider-tick":t})}></div>`))}\n ${P(Nt,(t=>`<div class="${j(ve.slider__tick,!0)+" "+j(ve.slider__tick_inactive,!0)}"${U({"--divkit-slider-tick":t})}></div>`))}\n <div${N("class",ve.slider__thumb,0)}${U({"border-radius":Z(Lt.borderRadius),background:Lt.background,"box-shadow":Lt.boxShadow||""})}></div>\n ${Ot?`<div class="${j(ve.slider__thumb,!0)+" "+j(ve.slider__thumb_secondary,!0)}"${U({"border-radius":Z(Rt.borderRadius),background:Rt.background,"box-shadow":Rt.boxShadow||""})}></div>`:""}\n <input type="range"${N("class",ve.slider__input,0)}${N("min",zt,0)}${N("max",Mt,0)} step="1"${N("value",Ut,0)}${N("aria-label",Zt,0)}>\n ${Ot?`<input type="range"${N("class",`${ve.slider__input} ${ve.slider__input_secondary}`,0)}${N("min",zt,0)}${N("max",Mt,0)} step="1"${N("value",Bt,0)}${N("aria-label",Xt,0)}>`:""}</div></div>`}})}`})),je={input:"divkit-c3a4",input__wrapper:"divkit-ef7e",input__holder:"divkit-bb3d",input_multiline:"divkit-e48a",input__input:"divkit-f11e","input_highlight-color":"divkit-cc00","input_vertical-overflow":"divkit-b707"},De={text:Ot,container:Nt,separator:Bt,image:Rt,gif:Rt,grid:Zt,gallery:te,tabs:ne,state:oe,pager:le,indicator:de,slider:Ve,input:J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p,h,f,m,y,_,b,w,$,x,k,C,F,E,A,V,D,S,P,z,I,O,J,T,U,B=r,L=r,{json:R={}}=e,{templateContext:H}=e,{origJson:G}=e,{layoutParams:Y}=e;const K=v(W);let tt;const et=K.getJsonWithVars(R.text_variable);let rt=!1;et||(rt=!0,K.logError(q(new Error('Missing "text_variable" in "input"')))),J=a(et&&K.getVariable(et,"string")||Ee("temp","string",""),(t=>O=t));let nt="";I=a(K.getDerivedFromVars(R.hint_text),(t=>z=t)),P=a(K.getDerivedFromVars(R.hint_color),(t=>S=t));let it="";D=a(K.getDerivedFromVars(R.font_size),(t=>V=t));let ot,at,st=12;A=a(K.getDerivedFromVars(R.font_weight),(t=>E=t)),F=a(K.getDerivedFromVars(R.line_height),(t=>C=t)),k=a(K.getDerivedFromVars(R.letter_spacing),(t=>x=t));let lt="";$=a(K.getDerivedFromVars(R.text_color),(t=>w=t));let ct="#000";b=a(K.getDerivedFromVars(R.highlight_color),(t=>_=t));let ut="";y=a(K.getDerivedFromVars(R.keyboard_type),(t=>m=t));const dt={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let gt="multi_line_text",ht="text";f=a(K.getDerivedFromVars(R.max_visible_lines),(t=>h=t));let ft="",mt="";U=a(K.getDerivedFromVars(R.select_all_on_focus),(t=>T=t)),void 0===e.json&&n.json&&void 0!==R&&n.json(R),void 0===e.templateContext&&n.templateContext&&void 0!==H&&n.templateContext(H),void 0===e.origJson&&n.origJson&&void 0!==G&&n.origJson(G),void 0===e.layoutParams&&n.layoutParams&&void 0!==Y&&n.layoutParams(Y),nt=O,o=z,it=Q(S,1,it),st=Vt(V,st),ot=St(E,ot);{const t=C;jt(t)&&(at=t/st)}return pt(x)&&(lt=Z(x/st*10)),ct=Q(w,1,ct),ut=Q(_,1,ut),m&&m in dt&&(ht=dt[m],gt=m),s="multi_line_text"===gt,l=K.getDerivedFromVars(R.paddings),L(),L=a(l,(t=>p=t)),jt(h)&&(ft=`calc(${h*(at||1.25)+"em"} + ${X(yt(null==p?void 0:p.top,0)+yt(null==p?void 0:p.bottom,0))})`),c=K.getDerivedFromVars(R.accessibility),B(),B=a(c,(t=>g=t)),(null==g?void 0:g.description)?mt=g.description:K.logError(q(new Error('Missing accessibility "description" for input'),{level:"warn"})),u={"highlight-color":Boolean(ut),"vertical-overflow":!1,multiline:s},d={"--divkit-input-hint-color":it,"--divkit-input-highlight-color":ut,"font-size":Z(st),"font-weight":ot,"line-height":at,"letter-spacing":lt,color:ct,"max-height":ft},B(),L(),f(),y(),b(),$(),k(),F(),A(),D(),P(),I(),J(),U(),rt?"":`${M(Et,"Outer").$$render(t,{cls:vt("input",je,u),style:d,customDescription:!0,customActions:"input",json:R,origJson:G,templateContext:H,layoutParams:Y},{},{default:()=>`<span${N("class",je.input__wrapper,0)}><span${N("class",je.input__holder,0)} aria-hidden="true"${N("this",undefined,0)}>\n ${j(nt)}${nt.endsWith("\n")||!nt?"​":""}</span>\n ${s?`<textarea${N("class",je.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",mt,0)}${N("placeholder",o,0)}${N("this",tt,0)}>${j(nt,!0)}</textarea>`:`<input${N("type",ht,0)}${N("class",je.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",mt,0)}${N("placeholder",o,0)}${N("value",nt,0)}${N("this",tt,0)}>`}</span>`})}`}))},Se=J(((t,e,r,n)=>{let{div:i}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=v(W);let c,u,d;if(void 0===e.div&&r.div&&void 0!==i&&r.div(i),void 0===e.templateContext&&r.templateContext&&void 0!==o&&r.templateContext(o),void 0===e.origJson&&r.origJson&&void 0!==a&&r.origJson(a),void 0===e.layoutParams&&r.layoutParams&&void 0!==s&&r.layoutParams(s),c=i,u=o,d=c&&De[c.type]||void 0,!d&&(({templateContext:u,json:c}=l.processTemplate(c,u)),d=c&&De[c.type]||void 0,!d)){let t;t=(null==c?void 0:c.type)&&l.hasTemplate(c.type)?"Recursive template":"Unknown component",l.logError(q(new Error(t),{additional:{component:(null==c?void 0:c.type)||"<missing>"}}))}return d?`${M(d||z,"svelte:component").$$render(t,{json:c,templateContext:u,layoutParams:s,origJson:a||i},{},{})}`:""})),Pe=Se,ze=J(((t,e,r,n)=>{let{svgFiltersMap:i}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==i&&r.svgFiltersMap(i),Object.keys(i).length?`<svg${N("class","divkit-dc22",0)} aria-hidden="true"><defs>${P([...Object.keys(i)],(t=>`<filter${N("id",i[t],0)}><feFlood${N("flood-color",t,0)}></feFlood><feComposite in2="SourceGraphic" operator="in"></feComposite></filter>`))}</defs></svg>`:""}));function Me(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 Ie(){}function Oe(t){return{subscribe:e=>(e(t),Ie)}}function Je(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function Ne(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function Te(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 Ue(t){var e=parseInt(t,10);if(e>2147483647||e<fe)throw new Error(`Value ${t} can't be converted to Integer type.`);return e}function Be(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function Le(t,e,r,n){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,Le.prototype),i.expected=e,i.found=r,i.location=n,i.name="SyntaxError",i}function Re(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function We(t,e){var r,n,i,o,a={},s=(e=void 0!==e?e:{}).grammarSource,l={start:St,JsonStringContents:function(){var t,e,r;for(t=_t,e=[],r=Pt();r!==a;)e.push(r),r=Pt();return bt=t,e=yt(e)}},c=St,u="@{",d="}",v="@{}",g="\\",p="||",h="&&",f="==",m="!=",y=">=",_="<=",b="+",w="-",$="true",x="false",k=/^[^}]/,C=/^[^'}]/,F=/^[0-9]/,E=/^[a-zA-Z_0-9.]/,A=/^[a-zA-Z_]/,V=/^[ \t\r\n]/,j=Ft("@{",!1),D=Ft("}",!1),S=Ft("@{}",!1),P=Ft("\\",!1),z={type:"any"},M=Et(["}"],!0,!1),I=Ft("?",!1),O=Ft(":",!1),J=Ft("||",!1),N=Ft("&&",!1),T=Ft("==",!1),U=Ft("!=",!1),B=Ft(">=",!1),L=Ft(">",!1),R=Ft("<=",!1),W=Ft("<",!1),q=Ft("+",!1),H=Ft("-",!1),G=Ft("/",!1),Y=Ft("*",!1),Z=Ft("%",!1),X=Ft("!",!1),K=Ft("(",!1),Q=Ft(")",!1),tt=Ft(",",!1),et=At("string"),rt=Ft("'",!1),nt=Et(["'","}"],!0,!1),it=At("integer"),ot=Et([["0","9"]],!1,!1),at=At("number"),st=Ft(".",!1),lt=Ft("e",!1),ct=Ft("E",!1),ut=At("boolean"),dt=Ft("true",!1),vt=Ft("false",!1),gt=Et([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),pt=At("identifier"),ht=Et([["a","z"],["A","Z"],"_"],!1,!1),ft=At("whitespace"),mt=Et([" ","\t","\r","\n"],!1,!1),yt=function(t){return Te(t)},_t=0,bt=0,wt=[{line:1,column:1}],$t=0,xt=[],kt=0;if("startRule"in e){if(!(e.startRule in l))throw new Error("Can't start parsing from rule \""+e.startRule+'".');c=l[e.startRule]}function Ct(){return t.substring(bt,_t)}function Ft(t,e){return{type:"literal",text:t,ignoreCase:e}}function Et(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function At(t){return{type:"other",description:t}}function Vt(e){var r,n=wt[e];if(n)return n;for(r=e-1;!wt[r];)r--;for(n={line:(n=wt[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return wt[e]=n,n}function jt(t,e){var r=Vt(t),n=Vt(e);return{source:s,start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:n.line,column:n.column}}}function Dt(t){_t<$t||(_t>$t&&($t=_t,xt=[]),xt.push(t))}function St(){var t,e;return t=_t,qt(),(e=zt())!==a?(qt(),bt=t,t=e):(_t=t,t=a),t}function Pt(){var e,r,n,i,o;if(e=_t,t.substr(_t,2)===u?(r=u,_t+=2):(r=a,0===kt&&Dt(j)),r!==a?(n=qt(),(i=zt())!==a?(qt(),125===t.charCodeAt(_t)?(o=d,_t++):(o=a,0===kt&&Dt(D)),o!==a?(bt=e,e=i):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,t.substr(_t,3)===v?(r=v,_t+=3):(r=a,0===kt&&Dt(S)),r!==a&&(bt=e,r=""),(e=r)===a&&(e=_t,r=_t,kt++,92===t.charCodeAt(_t)?(n=g,_t++):(n=a,0===kt&&Dt(P)),n===a&&(t.substr(_t,2)===u?(n=u,_t+=2):(n=a,0===kt&&Dt(j))),kt--,n===a?r=void 0:(_t=r,r=a),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(z)),n!==a?(bt=e,e=Ct()):(_t=e,e=a)):(_t=e,e=a),e===a))){if(e=_t,t.substr(_t,2)===u?(r=u,_t+=2):(r=a,0===kt&&Dt(j)),r!==a){if(n=[],k.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(M)),i!==a)for(;i!==a;)n.push(i),k.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(M));else n=a;n!==a?(125===t.charCodeAt(_t)?(i=d,_t++):(i=a,0===kt&&Dt(D)),i!==a?(bt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(_t=e,e=a)):(_t=e,e=a)}else _t=e,e=a;e===a&&(e=_t,t.substr(_t,2)===u?(r=u,_t+=2):(r=a,0===kt&&Dt(j)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a?(t.substr(_t,2)===u?(n=u,_t+=2):(n=a,0===kt&&Dt(j)),n!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(z)),n!==a?(bt=e,e=Be(n)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function zt(){var e,r,n,i,o,s;return e=_t,(r=Mt())!==a?(qt(),63===t.charCodeAt(_t)?(n="?",_t++):(n=a,0===kt&&Dt(I)),n!==a?(qt(),(i=zt())!==a?(qt(),58===t.charCodeAt(_t)?(o=":",_t++):(o=a,0===kt&&Dt(O)),o!==a?(qt(),(s=zt())!==a?(bt=e,e={type:"ConditionalExpression",test:r,consequent:i,alternate:s}):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=Mt()),e}function Mt(){var e,r,n,i,o,s,l,c;if(e=_t,(r=It())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===p?(s=p,_t+=2):(s=a,0===kt&&Dt(J)),s!==a?(l=qt(),(c=It())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===p?(s=p,_t+=2):(s=a,0===kt&&Dt(J)),s!==a?(l=qt(),(c=It())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Ne(r,n)}else _t=e,e=a;return e}function It(){var e,r,n,i,o,s,l,c;if(e=_t,(r=Ot())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===h?(s=h,_t+=2):(s=a,0===kt&&Dt(N)),s!==a?(l=qt(),(c=Ot())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===h?(s=h,_t+=2):(s=a,0===kt&&Dt(N)),s!==a?(l=qt(),(c=Ot())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Ne(r,n)}else _t=e,e=a;return e}function Ot(){var e,r,n,i,o,s,l,c;if(e=_t,(r=Jt())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===f?(s=f,_t+=2):(s=a,0===kt&&Dt(T)),s===a&&(t.substr(_t,2)===m?(s=m,_t+=2):(s=a,0===kt&&Dt(U))),s!==a?(l=qt(),(c=Jt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===f?(s=f,_t+=2):(s=a,0===kt&&Dt(T)),s===a&&(t.substr(_t,2)===m?(s=m,_t+=2):(s=a,0===kt&&Dt(U))),s!==a?(l=qt(),(c=Jt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Je(r,n)}else _t=e,e=a;return e}function Jt(){var e,r,n,i,o,s,l,c;if(e=_t,(r=Nt())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===y?(s=y,_t+=2):(s=a,0===kt&&Dt(B)),s===a&&(62===t.charCodeAt(_t)?(s=">",_t++):(s=a,0===kt&&Dt(L)),s===a&&(t.substr(_t,2)===_?(s=_,_t+=2):(s=a,0===kt&&Dt(R)),s===a&&(60===t.charCodeAt(_t)?(s="<",_t++):(s=a,0===kt&&Dt(W))))),s!==a?(l=qt(),(c=Nt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===y?(s=y,_t+=2):(s=a,0===kt&&Dt(B)),s===a&&(62===t.charCodeAt(_t)?(s=">",_t++):(s=a,0===kt&&Dt(L)),s===a&&(t.substr(_t,2)===_?(s=_,_t+=2):(s=a,0===kt&&Dt(R)),s===a&&(60===t.charCodeAt(_t)?(s="<",_t++):(s=a,0===kt&&Dt(W))))),s!==a?(l=qt(),(c=Nt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Je(r,n)}else _t=e,e=a;return e}function Nt(){var e,r,n,i,o,s,l,c;if(e=_t,(r=Tt())!==a){for(n=[],i=_t,o=qt(),43===t.charCodeAt(_t)?(s=b,_t++):(s=a,0===kt&&Dt(q)),s===a&&(45===t.charCodeAt(_t)?(s=w,_t++):(s=a,0===kt&&Dt(H))),s!==a?(l=qt(),(c=Tt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),43===t.charCodeAt(_t)?(s=b,_t++):(s=a,0===kt&&Dt(q)),s===a&&(45===t.charCodeAt(_t)?(s=w,_t++):(s=a,0===kt&&Dt(H))),s!==a?(l=qt(),(c=Tt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Je(r,n)}else _t=e,e=a;return e}function Tt(){var e,r,n,i,o,s,l,c;if(e=_t,(r=Ut())!==a){for(n=[],i=_t,o=qt(),47===t.charCodeAt(_t)?(s="/",_t++):(s=a,0===kt&&Dt(G)),s===a&&(42===t.charCodeAt(_t)?(s="*",_t++):(s=a,0===kt&&Dt(Y)),s===a&&(37===t.charCodeAt(_t)?(s="%",_t++):(s=a,0===kt&&Dt(Z)))),s!==a?(l=qt(),(c=Ut())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),47===t.charCodeAt(_t)?(s="/",_t++):(s=a,0===kt&&Dt(G)),s===a&&(42===t.charCodeAt(_t)?(s="*",_t++):(s=a,0===kt&&Dt(Y)),s===a&&(37===t.charCodeAt(_t)?(s="%",_t++):(s=a,0===kt&&Dt(Z)))),s!==a?(l=qt(),(c=Ut())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Je(r,n)}else _t=e,e=a;return e}function Ut(){var e,r,n;return(e=Rt())===a&&(e=Lt())===a&&(e=_t,33===t.charCodeAt(_t)?(r="!",_t++):(r=a,0===kt&&Dt(X)),r===a&&(43===t.charCodeAt(_t)?(r=b,_t++):(r=a,0===kt&&Dt(q)),r===a&&(45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)))),r!==a?(qt(),(n=Ut())!==a?(bt=e,e={type:"UnaryExpression",operator:r,argument:n}):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=function(){var e,r,n,i,o;return e=_t,(r=Wt())!==a?(qt(),40===t.charCodeAt(_t)?(n="(",_t++):(n=a,0===kt&&Dt(K)),n!==a?(qt(),i=function(){var e,r,n,i,o,s,l;if(e=_t,(r=zt())!==a){for(n=[],i=_t,qt(),44===t.charCodeAt(_t)?(o=",",_t++):(o=a,0===kt&&Dt(tt)),o!==a?(qt(),(s=zt())!==a?i=s:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,qt(),44===t.charCodeAt(_t)?(o=",",_t++):(o=a,0===kt&&Dt(tt)),o!==a?(qt(),(s=zt())!==a?i=s:(_t=i,i=a)):(_t=i,i=a);bt=e,l=n,e=[r,...l]}else _t=e,e=a;return e===a&&(e=qt()),e}(),i!==a?(qt(),41===t.charCodeAt(_t)?(o=")",_t++):(o=a,0===kt&&Dt(Q)),o!==a?(bt=e,e={type:"CallExpression",callee:r,arguments:i}):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,(r=Wt())!==a&&(bt=e,r={type:"Variable",id:r}),(e=r)===a&&(e=function(){var e,r,n,i;return e=function(){var e,r,n,i;return kt++,e=_t,39===t.charCodeAt(_t)?(r="'",_t++):(r=a,0===kt&&Dt(rt)),r!==a?(n=function(){var t,e,r;for(t=_t,e=[],r=Bt();r!==a;)e.push(r),r=Bt();return bt=t,e=Te(e)}(),39===t.charCodeAt(_t)?(i="'",_t++):(i=a,0===kt&&Dt(rt)),i!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a),kt--,e===a&&(r=a,0===kt&&Dt(et)),e}(),e===a&&(e=Rt())===a&&(e=Lt())===a&&(e=function(){var e,r;return kt++,e=_t,t.substr(_t,4)===$?(r=$,_t+=4):(r=a,0===kt&&Dt(dt)),r!==a&&(bt=e,r={type:"BooleanLiteral",value:!0}),(e=r)===a&&(e=_t,t.substr(_t,5)===x?(r=x,_t+=5):(r=a,0===kt&&Dt(vt)),r!==a&&(bt=e,r={type:"BooleanLiteral",value:!1}),e=r),kt--,e===a&&(r=a,0===kt&&Dt(ut)),e}(),e===a&&(e=_t,40===t.charCodeAt(_t)?(r="(",_t++):(r=a,0===kt&&Dt(K)),r!==a&&(n=zt())!==a?(41===t.charCodeAt(_t)?(i=")",_t++):(i=a,0===kt&&Dt(Q)),i!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a))),e}())),e}())),e}function Bt(){var e,r,n,i,o;if(e=_t,t.substr(_t,2)===u?(r=u,_t+=2):(r=a,0===kt&&Dt(j)),r!==a?(n=qt(),(i=zt())!==a?(qt(),125===t.charCodeAt(_t)?(o=d,_t++):(o=a,0===kt&&Dt(D)),o!==a?(bt=e,e=i):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,t.substr(_t,3)===v?(r=v,_t+=3):(r=a,0===kt&&Dt(S)),r!==a&&(bt=e,r=""),(e=r)===a&&(e=_t,r=_t,kt++,92===t.charCodeAt(_t)?(n=g,_t++):(n=a,0===kt&&Dt(P)),n===a&&(39===t.charCodeAt(_t)?(n="'",_t++):(n=a,0===kt&&Dt(rt)),n===a&&(t.substr(_t,2)===u?(n=u,_t+=2):(n=a,0===kt&&Dt(j)))),kt--,n===a?r=void 0:(_t=r,r=a),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(z)),n!==a?(bt=e,e=Ct()):(_t=e,e=a)):(_t=e,e=a),e===a))){if(e=_t,t.substr(_t,2)===u?(r=u,_t+=2):(r=a,0===kt&&Dt(j)),r!==a){if(n=[],C.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(nt)),i!==a)for(;i!==a;)n.push(i),C.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(nt));else n=a;n!==a?(125===t.charCodeAt(_t)?(i=d,_t++):(i=a,0===kt&&Dt(D)),i!==a?(bt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(_t=e,e=a)):(_t=e,e=a)}else _t=e,e=a;e===a&&(e=_t,t.substr(_t,2)===u?(r=u,_t+=2):(r=a,0===kt&&Dt(j)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a?(t.substr(_t,2)===u?(n=u,_t+=2):(n=a,0===kt&&Dt(j)),n!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(z)),n!==a?(bt=e,e=Be(n)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Lt(){var e,r,n,i;if(kt++,e=_t,45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)),r===a&&(r=null),n=[],F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot)),i!==a)for(;i!==a;)n.push(i),F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));else n=a;return n!==a?(bt=e,e={type:"IntegerLiteral",value:Ue(Ct())}):(_t=e,e=a),kt--,e===a&&(r=a,0===kt&&Dt(it)),e}function Rt(){var e,r,n,i,o,s,l,c,u,d;for(kt++,e=_t,45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)),r===a&&(r=null),n=[],F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));i!==a;)n.push(i),F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));if(46===t.charCodeAt(_t)?(i=".",_t++):(i=a,0===kt&&Dt(st)),i!==a){if(o=[],F.test(t.charAt(_t))?(s=t.charAt(_t),_t++):(s=a,0===kt&&Dt(ot)),s!==a)for(;s!==a;)o.push(s),F.test(t.charAt(_t))?(s=t.charAt(_t),_t++):(s=a,0===kt&&Dt(ot));else o=a;if(o!==a){if(s=_t,101===t.charCodeAt(_t)?(l="e",_t++):(l=a,0===kt&&Dt(lt)),l===a&&(69===t.charCodeAt(_t)?(l="E",_t++):(l=a,0===kt&&Dt(ct))),l!==a){if(43===t.charCodeAt(_t)?(c=b,_t++):(c=a,0===kt&&Dt(q)),c===a&&(45===t.charCodeAt(_t)?(c=w,_t++):(c=a,0===kt&&Dt(H))),c===a&&(c=null),u=[],F.test(t.charAt(_t))?(d=t.charAt(_t),_t++):(d=a,0===kt&&Dt(ot)),d!==a)for(;d!==a;)u.push(d),F.test(t.charAt(_t))?(d=t.charAt(_t),_t++):(d=a,0===kt&&Dt(ot));else u=a;u!==a?s=l=[l,c,u]:(_t=s,s=a)}else _t=s,s=a;s===a&&(s=null),bt=e,e={type:"NumberLiteral",value:parseFloat(Ct())}}else _t=e,e=a}else _t=e,e=a;if(e===a){if(e=_t,45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)),r===a&&(r=null),n=[],F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot)),i!==a)for(;i!==a;)n.push(i),F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));else n=a;if(n!==a)if(101===t.charCodeAt(_t)?(i="e",_t++):(i=a,0===kt&&Dt(lt)),i===a&&(69===t.charCodeAt(_t)?(i="E",_t++):(i=a,0===kt&&Dt(ct))),i!==a){if(43===t.charCodeAt(_t)?(o=b,_t++):(o=a,0===kt&&Dt(q)),o===a&&(45===t.charCodeAt(_t)?(o=w,_t++):(o=a,0===kt&&Dt(H))),o===a&&(o=null),s=[],F.test(t.charAt(_t))?(l=t.charAt(_t),_t++):(l=a,0===kt&&Dt(ot)),l!==a)for(;l!==a;)s.push(l),F.test(t.charAt(_t))?(l=t.charAt(_t),_t++):(l=a,0===kt&&Dt(ot));else s=a;s!==a?(bt=e,e={type:"NumberLiteral",value:parseFloat(Ct())}):(_t=e,e=a)}else _t=e,e=a;else _t=e,e=a}return kt--,e===a&&(r=a,0===kt&&Dt(at)),e}function Wt(){var e,r,n,i,o;if(kt++,e=_t,r=_t,kt++,n=function(){var e,r,n,i;return e=_t,t.substr(_t,4)===$?(r=$,_t+=4):(r=a,0===kt&&Dt(dt)),r===a&&(t.substr(_t,5)===x?(r=x,_t+=5):(r=a,0===kt&&Dt(vt))),r!==a?(n=_t,kt++,E.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(gt)),kt--,i===a?n=void 0:(_t=n,n=a),n!==a?e=r=[r,n]:(_t=e,e=a)):(_t=e,e=a),e}(),kt--,n===a?r=void 0:(_t=r,r=a),r!==a)if(A.test(t.charAt(_t))?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(ht)),n!==a){for(i=[],E.test(t.charAt(_t))?(o=t.charAt(_t),_t++):(o=a,0===kt&&Dt(gt));o!==a;)i.push(o),E.test(t.charAt(_t))?(o=t.charAt(_t),_t++):(o=a,0===kt&&Dt(gt));bt=e,e={type:"Identifier",name:Ct()}}else _t=e,e=a;else _t=e,e=a;return kt--,e===a&&(r=a,0===kt&&Dt(pt)),e}function qt(){var e,r;for(kt++,e=[],V.test(t.charAt(_t))?(r=t.charAt(_t),_t++):(r=a,0===kt&&Dt(mt));r!==a;)e.push(r),V.test(t.charAt(_t))?(r=t.charAt(_t),_t++):(r=a,0===kt&&Dt(mt));return kt--,r=a,0===kt&&Dt(ft),e}if((r=c())!==a&&_t===t.length)return r;throw r!==a&&_t<t.length&&Dt({type:"end"}),n=xt,i=$t<t.length?t.charAt($t):null,o=$t<t.length?jt($t,$t+1):jt($t,$t),new Le(Le.buildMessage(n,i),n,i,o)}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(Le,Error),Le.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=Re("",i.line.toString().length," "),l=n[i.line-1],c=(i.line===a.line?a.column:l.length+1)-i.column||1;e+="\n --\x3e "+o+"\n"+s+" |\n"+i.line+" | "+l+"\n"+s+" | "+Re("",i.column-1," ")+Re("",c,"^")}else e+="\n at "+o}return e},Le.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 qe=new Map,He=new Map;function Ge(t,e,r){const n={args:e,cb:r},i=qe.get(t)||[];qe.has(t)||qe.set(t,i),i.push(n);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");He.set(o,n)}function Ye(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 Ze(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=>{Ze(t,e)}));break;case"BinaryExpression":case"LogicalExpression":Ze(t.left,e),Ze(t.right,e);break;case"UnaryExpression":Ze(t.argument,e);break;case"ConditionalExpression":Ze(t.test,e),Ze(t.consequent,e),Ze(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{Ze(t,e)}))}}function Xe(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function Ke(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function Qe(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 Ke(t.value);if("color"===t.type)return lr(sr(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function tr(t){let e=Qe(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function er(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}const rr=new Int32Array(1);function nr(t){return rr[0]=t,rr[0]}function ir(t){if(t<fe||t>2147483647)throw new Error("Integer overflow.")}function or(t){const e=[];return Ze(t,{Variable(t){e.push(t.id.name)}}),e}function ar(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function sr(t){const e=tt(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function lr(t){return`#${[t.a,t.r,t.g,t.b].map((t=>{if(t<0||t>255)throw new Error("Value out of range 0..1.");return K(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function cr(t){return{type:_e,value:Qe(t)}}function ur(t){const e=Number(t.value);if(isNaN(e)||!Number.isFinite(e))throw new Error("Unable to convert value to Number.");return{type:we,value:e}}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===be&&(r=nr(r)),{type:t.type,value:r}}function vr(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value%e.value;return t.type===be&&(r=nr(r)),{type:t.type,value:r}}function gr(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e*=t[r].value,t[0].type===be&&(e=nr(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===be&&(e=nr(e));return{type:t.length?t[0].type:be,value:e}}function hr(...t){let e=0;for(let r=0;r<t.length;++r)e+=t[r].value,t[0].type===be&&(e=nr(e));return{type:t.length?t[0].type:be,value:e}}function fr(t){const e=Math.abs(t.value);return t.type===be&&ir(e),{type:t.type,value:e}}function mr(...t){if(!t.length)throw new Error("Non empty argument list is required.");return{type:t[0].type,value:Math.max(...t.map((t=>t.value)))}}function yr(...t){if(!t.length)throw new Error("Non empty argument list is required.");return{type:t[0].type,value:Math.min(...t.map((t=>t.value)))}}function _r(t){return{type:t.type,value:Math.sign(t.value)}}function br(t,e){let r;if(0===e.value&&t.type===be)r=t.value;else if(0===t.value&&t.type===be)r=0;else{let n=Math.sign(e.value);t.type===we&&0===n&&(n=Object.is(n,0)?1:-1),r=Math.abs(t.value)*n}return t.type===be&&ir(r),{type:t.type,value:r}}function wr(t){return e=>{const r=sr(e.value);return{type:we,value:r[t]/255}}}function $r(t){return(e,r)=>{const n=sr(e.value);return n[t]=255*r.value,{type:e.type,value:lr(n)}}}const xr=wr("a"),kr=wr("r"),Cr=wr("g"),Fr=wr("b"),Er=$r("a"),Ar=$r("r"),Vr=$r("g"),jr=$r("b");function Dr(t){return t.map(tr).join(", ")}Ge("toString",[be],cr),Ge("toString",[we],cr),Ge("toString",[$e],cr),Ge("toString",[xe],cr),Ge("toString",["url"],cr),Ge("toNumber",[be],ur),Ge("toNumber",[_e],ur),Ge("toInteger",[we],(function(t){if(t.value>2147483647||t.value<fe)throw new Error("Unable to convert value to Integer.");const e=t.value-t.value%1;return{type:be,value:e}})),Ge("toInteger",[_e],(function(t){const e=Number(t.value);if(isNaN(e)||e%1!=0||e>2147483647||e<fe)throw new Error("Unable to convert value to Integer.");return{type:be,value:e}})),Ge("toInteger",[$e],(function(t){return{type:be,value:t.value?1:0}})),Ge("toBoolean",[be],(function(t){if(1!==t.value&&0!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:$e,value:t.value}})),Ge("toBoolean",[_e],(function(t){if("true"!==t.value&&"false"!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:$e,value:"true"===t.value?1:0}})),Ge("encodeUri",[_e],(function(t){try{return{type:_e,value:encodeURIComponent(t.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),Ge("decodeUri",[_e],(function(t){try{return{type:_e,value:decodeURIComponent(t.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),Ge("parseUnixTime",[be],(function(t){return{type:ke,value:new Date(1e3*t.value)}})),Ge("nowLocal",[],(function(){return{type:ke,value:new Date}})),Ge("addMillis",[ke,be],(function(t,e){return{type:ke,value:new Date(t.value.getTime()+e.value)}})),Ge("setYear",[ke,be],(function(t,e){const r=new Date(t.value);return r.setFullYear(e.value),{type:ke,value:r}})),Ge("setMonth",[ke,be],(function(t,e){if(e.value<1||e.value>12)throw new Error(`Expecting month in [1..12], instead got ${e.value}.`);const r=new Date(t.value);return r.setMonth(e.value-1),{type:ke,value:r}})),Ge("setDay",[ke,be],(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 ${Qe(t)}.`);return r.setDate(-1===e.value?0:e.value),{type:ke,value:r}})),Ge("setHours",[ke,be],(function(t,e){if(e.value<0||e.value>23)throw new Error(`Expecting hours in [0..23], instead got ${e.value}.`);const r=new Date(t.value);return r.setHours(e.value-r.getTimezoneOffset()/60),{type:ke,value:r}})),Ge("setMinutes",[ke,be],(function(t,e){if(e.value<0||e.value>59)throw new Error(`Expecting minutes in [0..59], instead got ${e.value}.`);const r=new Date(t.value);return r.setMinutes(e.value),{type:ke,value:r}})),Ge("setSeconds",[ke,be],(function(t,e){if(e.value<0||e.value>59)throw new Error(`Expecting seconds in [0..59], instead got ${e.value}.`);const r=new Date(t.value);return r.setSeconds(e.value),{type:ke,value:r}})),Ge("setMillis",[ke,be],(function(t,e){if(e.value<0||e.value>999)throw new Error(`Expecting millis in [0..999], instead got ${e.value}.`);const r=new Date(t.value);return r.setMilliseconds(e.value),{type:ke,value:r}})),Ge("len",[_e],(function(t){return{type:be,value:t.value.length}})),Ge("contains",[_e,_e],(function(t,e){return{type:$e,value:t.value.includes(e.value)?1:0}})),Ge("substring",[_e,be,be],(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:_e,value:t.value.substring(e.value,r.value)}})),Ge("replaceAll",[_e,_e,_e],(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:_e,value:n}})),Ge("index",[_e,_e],(function(t,e){return{type:be,value:t.value.indexOf(e.value)}})),Ge("lastIndex",[_e,_e],(function(t,e){return{type:be,value:t.value.lastIndexOf(e.value)}})),Ge("trim",[_e],(function(t){return{type:_e,value:t.value.trim()}})),Ge("trimLeft",[_e],(function(t){return{type:_e,value:t.value.replace(/^\s+/,"")}})),Ge("trimRight",[_e],(function(t){return{type:_e,value:t.value.replace(/\s+$/,"")}})),Ge("toUpperCase",[_e],(function(t){return{type:_e,value:t.value.toUpperCase()}})),Ge("toLowerCase",[_e],(function(t){return{type:_e,value:t.value.toLowerCase()}})),Ge("div",[be,be],dr),Ge("div",[we,we],dr),Ge("mod",[be,be],vr),Ge("mod",[we,we],vr),Ge("mul",[{type:be,isVararg:!0}],gr),Ge("mul",[{type:we,isVararg:!0}],gr),Ge("sub",[{type:be,isVararg:!0}],pr),Ge("sub",[{type:we,isVararg:!0}],pr),Ge("sum",[{type:be,isVararg:!0}],hr),Ge("sum",[{type:we,isVararg:!0}],hr),Ge("abs",[be],fr),Ge("abs",[we],fr),Ge("max",[{type:be,isVararg:!0}],mr),Ge("max",[{type:we,isVararg:!0}],mr),Ge("min",[{type:be,isVararg:!0}],yr),Ge("min",[{type:we,isVararg:!0}],yr),Ge("maxNumber",[],(function(){return{type:we,value:me}})),Ge("minNumber",[],(function(){return{type:we,value:ye}})),Ge("maxInteger",[],(function(){return{type:be,value:2147483647}})),Ge("minInteger",[],(function(){return{type:be,value:fe}})),Ge("round",[we],(function(t){const e=Math.sign(t.value);return{type:we,value:e*Math.round(Math.abs(t.value))}})),Ge("floor",[we],(function(t){return{type:we,value:Math.floor(t.value)}})),Ge("ceil",[we],(function(t){return{type:we,value:Math.ceil(t.value)}})),Ge("signum",[we],_r),Ge("signum",[be],_r),Ge("copySign",[we,we],br),Ge("copySign",[be,be],br),Ge("getColorAlpha",[_e],xr),Ge("getColorAlpha",[xe],xr),Ge("getColorRed",[_e],kr),Ge("getColorRed",[xe],kr),Ge("getColorGreen",[_e],Cr),Ge("getColorGreen",[xe],Cr),Ge("getColorBlue",[_e],Fr),Ge("getColorBlue",[xe],Fr),Ge("setColorAlpha",[_e,we],Er),Ge("setColorAlpha",[xe,we],Er),Ge("setColorRed",[_e,we],Ar),Ge("setColorRed",[xe,we],Ar),Ge("setColorGreen",[_e,we],Vr),Ge("setColorGreen",[xe,we],Vr),Ge("setColorBlue",[_e,we],jr),Ge("setColorBlue",[xe,we],jr),Ge("rgb",[we,we,we],(function(t,e,r){const n={a:255,r:255*t.value,g:255*e.value,b:255*r.value};return{type:_e,value:lr(n)}})),Ge("argb",[we,we,we,we],(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:_e,value:lr(i)}}));const Sr={StringLiteral:function(t,e){return{type:_e,value:e.value}},NumberLiteral:function(t,e){return{type:we,value:e.value}},IntegerLiteral:function(t,e){return{type:be,value:e.value}},BooleanLiteral:function(t,e){return{type:$e,value:e.value?1:0}},UnaryExpression:function(t,e){const r=Xe(Pr(t,e.argument));switch(e.operator){case"!":if(r.type===$e)return{type:$e,value:r.value?0:1};ar(`${e.operator}${tr(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const t="+"===e.operator?1:-1;if(r.type===be)return{type:be,value:r.value*t};if(r.type===we)return{type:we,value:r.value*t};ar(`${e.operator}${tr(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=Xe(Pr(t,e.test));if(r.type===$e)return r.value?Pr(t,e.consequent):Pr(t,e.alternate);ar(`${tr(r)} ? ${tr(Pr(t,e.consequent))} : ${tr(Pr(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 Pr(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=Qe(Pr(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:_e,value:r}},LogicalExpression:function(t,e){const r=Xe(Pr(t,e.left));if(r.type!==$e&&ar(`${tr(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:$e,value:0};const n=Xe(Pr(t,e.right));return n.type!==$e&&ar(`${tr(r)} ${e.operator} ${tr(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${er(n.type)}.`),{type:$e,value:n.value}},BinaryExpression:function(t,e){const r=e.operator,n=Pr(t,e.left),i=Pr(t,e.right);if(n.type!==i.type&&ar(`${tr(n)} ${e.operator} ${tr(i)}`,`Operator '${r}' cannot be applied to different types: ${er(n.type)} and ${er(i.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===ke&&r.type===ke?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:$e,value:n?1:0}}(r,n,i);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==we&&e.type!==be&&e.type!==ke&&ar(`${tr(e)} ${t} ${tr(r)}`,`Operator '${t}' cannot be applied to ${er(e.type)} type.`);const i=e.type===ke?e.value.getTime():e.value,o=r.type===ke?r.value.getTime():r.value;return n=">"===t?i>o:">="===t?i>=o:"<"===t?i<o:i<=o,{type:$e,value:n?1:0}}(r,n,i);if("+"===r||"-"===r)return function(t,e,r){if(e.type!==_e&&e.type!==we&&e.type!==be&&ar(`${tr(e)} ${t} ${tr(r)}`,`Operator '${t}' cannot be applied to ${er(e.type)} type.`),e.type===_e)return"-"===t&&ar(`${tr(e)} - ${tr(r)}`,`Operator '${t}' cannot be applied to ${er(e.type)} type.`),{type:_e,value:e.value+r.value};let n="+"===t?e.value+r.value:e.value-r.value;return e.type===be&&(n=nr(n)),{type:e.type,value:n}}(r,n,i);if("/"===r||"*"===r||"%"===r)return function(t,e,r){let n;if(e.type!==be&&e.type!==we&&ar(`${tr(e)} ${t} ${tr(r)}`,`Operator '${t}' cannot be applied to ${er(e.type)} type.`),"*"===t)n=e.value*r.value;else{if("/"!==t&&"%"!==t)throw new Error(`Unsupported operation ${t}`);0===r.value&&ar(`${tr(e)} ${t} ${tr(r)}`,"Division by zero is not supported."),n="/"===t?e.value/r.value:e.value%r.value}return e.type===be&&(n=nr(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(!qe.has(r))throw new Error(`Unknown function name: ${r}.`);let n;const i=e.arguments.map((e=>Pr(t,e))),o=r+":"+i.map((t=>t.type)).join("#");if(He.has(o))n=He.get(o);else{const t=function(t,e){const r=qe.get(t);if(!r)throw new Error("Missing function");let n=null;for(let t=0;t<r.length;++t){const i=Ye(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=>er(t.type))).join(", "),n=`${r}(${Dr(i)})`;"few"===t.type&&0===i.length?ar(n,`Non empty argument list is required for function '${r}'.`):(t.type,ar(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){ar(`${r}(${Dr(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 Pr(t,e){if(e.type in Sr)return Sr[e.type](t,e);throw new Error("Unsupported expression")}function zr(t,e){try{return Pr(t,e)}catch(t){return{type:"error",value:t.message}}}const Mr=/(?:[^\\]|^)@{.+}/i;class Ir{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return Ze(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=zr(t,this.ast);if("error"===r.type)return void e(q(new Error("Expression execution error"),{additional:{message:r.value}}));const n=r.value;return n instanceof Date?Ke(n):n}catch(t){return void e(q(new Error("Expression execution error")))}}}function Or(t,e,r){if(t)if("string"==typeof t){if(n=t,Mr.test(n))try{const r=We(t,{startRule:"JsonStringContents"}),n=or(r);return e.push(...n),new Ir(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=>Or(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=Or(t[i],e,r);return n}}var n;return t}function Jr(t,e,r){if(t){if(t instanceof Ir)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>Jr(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=Jr(t[i],e,r);return n}}return t}function Nr(t,e){let r=[];const n=Or(t,r,e);return r=[...new Set(r)],{vars:r,applyVars:t=>Jr(n,t,e)}}const Tr={pagers:function(){return L(new Map)}},Ur=new Map,Br=new Map;function Lr(t){const e=Ur.get(t)||L("");return Ur.has(t)||Ur.set(t,e),e}function Rr(t){const e=Br.get(t)||new Map;return Br.has(t)||Br.set(t,e),e}class Wr{setVariable(t){const e=t.getName(),r=Rr(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Lr(this).set(e)}getVariable(t){return Rr(this).get(t)}}function qr(){return new Wr}const Hr=J(((t,e,r,n)=>{var i,o,a,s,l;let{id:c}=e,{json:u={}}=e,{platform:v="auto"}=e,{theme:g="system"}=e,{globalVariablesController:p=new Wr}=e,{onError:h}=e,{onStat:f}=e,{onCustomAction:m}=e,{onComponent:y}=e,_="desktop"===v;if("auto"===v&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");_=!t.matches,t.addListener((()=>{_=!t.matches}))}let b="light";if("light"===g||"dark"===g)b=g;else if("system"===g)if("undefined"!=typeof matchMedia){const t=matchMedia("(prefers-color-scheme: dark)");b=t.matches?"dark":"light",t.addListener((()=>{b=t.matches?"dark":"light",K&&K[b].forEach((t=>{const e=A.get(t.name);e&&e.setValue(t.color)}))}))}else b="light";else z(q(new Error("Unsupported theme")));let w=!1;u||(w=!0,z(q(new Error('"json" prop is required')))),c||(w=!0,z(q(new Error('"id" prop is required'))));let $=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 De)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}});return null}(u);const x=u.templates||{};$&&(w=!0,z($));const k={stateChange:!1},C=Lr(p),F=Rr(p),E=new Map,A=new Map,V=new Map;function D(t,e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e){const r=A.get(t);r&&r.setValue(e)}}function S(t){const e=A.get(t);return null==e?void 0:e.getValue()}function P(t){const e=Nr(t,z);return e.vars.length?e.applyVars(A):t}function z(t){h?h({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}let I=0;function O(t){return`${c}-${I++}`}let J={},N={};function T(t){const e=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=t.split("/");const r=e.shift()||"";if(e=[r,"root","0",...e],e.length<5||e.length%2!=1)throw new Error("Incorrect state id format");let n=Y;for(let t=1;t<e.length;t+=2){const r=e[t],i=e[t+1];let o=n.getChild(r);if(!o)return;o.setState(i),n=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=B(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=B(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=B(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=A.get(r);t?t.set(i):z(q(new Error("Cannot find variable"),{additional:{name:r}}))}else z(q(new Error("Incorrect set_variable_action"),{additional:{url:t}}));break;default:z(q(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){z(q(t,{additional:{url:e}}))}}const U=new Map;function B(t){if(U.has(t))return U.get(t);z(q(new Error("Missing instance with id"),{additional:{id:t}}))}const H=new Map;function G(t){for(const e of t)A.has(e)&&t.delete(e);return t}d(W,{logError:z,logStat:function(t,e){f&&f({type:t,action:e})},hasTemplate:function(t){return t in x},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in x;){if(({json:t,templateContext:e}=Me(t,e,x,z)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:O,genClass:function(t){return`divkit-${O()}`},execAction:T,execCustomAction:function(t){null==m||m(t)},isRunning:function(t){return k[t]},setRunning:function(t,e){k[t]=e},registerInstance:function(t,e){U.has(t)?z(q(new Error("Duplicate instance id"),{additional:{id:t}})):U.set(t,e)},addSvgFilter:function(t){if(N[t]=N[t]||0,++N[t],J[t])return J[t];const e=`${O()}-svg-filter`;return J=Object.assign(Object.assign({},J),{[t]:e}),e},removeSvgFilter:function(t){t&&N[t]&&0==--N[t]&&(J=Object.keys(J).reduce(((t,e)=>(N[e]&&(t[e]=J[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return Oe(t);const e=Nr(t,z);return e.vars.length?R(e.vars.map((t=>A.get(t)||function(t){const e=V.get(t)||L(void 0);return V.has(t)||V.set(t,e),e}(t))).filter(rt),(()=>e.applyVars(A))):Oe(t)},getJsonWithVars:P,getStore:function(t){return H.has(t)||function(t){H.has(t)||H.set(t,Tr[t]())}(t),H.get(t)},getVariable:function(t,e){const r=A.get(t);if(r){const n=r.getType();if(n!==e)return void z(q(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:n}}))}return r},registerComponent:void 0,unregisterComponent:void 0}),d(xt,{hasAction:()=>!1});const Y={setState(t){throw new Error("Not implemented")},getChild(t){if(Z&&Z.has(t))return Z.get(t);z(q(new Error("Missing state block with id"),{additional:{id:t}}))}};let Z=null;d(gt,{registerInstance(t,e){Z||(Z=new Map),Z.has(t)?z(q(new Error("Duplicate state with id"),{additional:{id:t}})):Z.set(t,e)},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 X=null===(i=null==u?void 0:u.card)||void 0===i?void 0:i.variables;Array.isArray(X)&&X.forEach((t=>{if(t&&t.type in Fe&&t.name){if(E.has(t.name))return void z(q(new Error("Duplicate variable"),{additional:{name:t.name}}));try{const e=Ee(t.name,t.type,t.value);E.set(t.name,e),A.set(t.name,e)}catch(e){z(q(e,{additional:{name:t.name}}))}}}));const K=u.palette;K&&K[b].forEach((t=>{if(E.has(t.name))z(q(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=Ee(t.name,"color",t.color);E.set(t.name,e),A.set(t.name,e)}catch(e){z(q(e,{additional:{name:t.name}}))}}));for(const[t,e]of F)A.has(t)||A.set(t,e);C.subscribe((t=>{if(t&&!A.has(t)){const e=F.get(t);A.set(t,e);const r=V.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const Q=null===(o=null==u?void 0:u.card)||void 0===o?void 0:o.variable_triggers;Array.isArray(Q)&&Q.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void z(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=We(t.condition,{startRule:"JsonStringContents"}),i=or(n);if(!i.length)return void z(q(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return G(e),e.size?new Promise((t=>{const r=C.subscribe((()=>{G(e),e.size||(r(),t())}))})):Promise.resolve()})(i).then((()=>{R(i.map((t=>A.get(t))).filter(rt),(()=>zr(A,n))).subscribe((n=>{"error"!==n.type?(n.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=P(t);e.log_id&&T(e)})),e=Boolean(n.value)):z(q(new Error("variable_trigger condition execution error"),{additional:{message:n.value}}))}))}))}catch(e){z(q(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else z(q(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));let tt=null===(l=null===(s=null===(a=null==u?void 0:u.card)||void 0===a?void 0:a.states)||void 0===s?void 0:s[0])||void 0===l?void 0:l.div,et=tt&&{type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:[{state_id:"0",div:tt}]};return void 0===e.id&&r.id&&void 0!==c&&r.id(c),void 0===e.json&&r.json&&void 0!==u&&r.json(u),void 0===e.platform&&r.platform&&void 0!==v&&r.platform(v),void 0===e.theme&&r.theme&&void 0!==g&&r.theme(g),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==p&&r.globalVariablesController(p),void 0===e.onError&&r.onError&&void 0!==h&&r.onError(h),void 0===e.onStat&&r.onStat&&void 0!==f&&r.onStat(f),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==m&&r.onCustomAction(m),void 0===e.onComponent&&r.onComponent&&void 0!==y&&r.onComponent(y),void 0===e.setVariable&&r.setVariable&&void 0!==D&&r.setVariable(D),void 0===e.getVariable&&r.getVariable&&void 0!==S&&r.getVariable(S),void 0===e.execAction&&r.execAction&&void 0!==T&&r.execAction(T),!w&&et?`<div class="${j("divkit-b023",!0)+j(_?" divkit-ee11":"",!0)}">${M(ze,"RootSvgFilters").$$render(t,{svgFiltersMap:J},{},{})}\n ${M(Pe,"Unknown").$$render(t,{div:et,templateContext:{}},{},{})}</div>`:""}));function Gr(t){return Hr.render({id:t.id,json:t.json,globalVariablesController:t.globalVariablesController,onError:t.onError,platform:t.platform}).html}var Yr=e.M,Zr=e.Os,Xr=e.sY;export{Yr as createGlobalVariablesController,Zr as createVariable,Xr as render};
1
+ var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function r(){}function n(t){return t()}function i(t){t.forEach(n)}function o(t){return"function"==typeof t}function a(t,...e){if(null==t)return r;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}let s;function l(t){s=t}function c(){if(!s)throw new Error("Function called outside component initialization");return s}function u(t){c().$$.on_destroy.push(t)}function d(t,e){return c().$$.context.set(t,e),e}function v(t){return c().$$.context.get(t)}t.d(e,{M:()=>Hr,Os:()=>Ve,sY:()=>Yr}),new Set,new Map;const g=[],p=[],f=[],h=[],m=Promise.resolve();let y=!1;function _(){return y||(y=!0,m.then(x)),m}function b(t){f.push(t)}const w=new Set;let $=0;function x(){const t=s;do{for(;$<g.length;){const t=g[$];$++,l(t),k(t.$$)}for(l(null),g.length=0,$=0;p.length;)p.pop()();for(let t=0;t<f.length;t+=1){const e=f[t];w.has(e)||(w.add(e),e())}f.length=0}while(g.length);for(;h.length;)h.pop()();y=!1,w.clear(),l(t)}function k(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(b)}}new Set,"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;const E=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),C=/[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;function F(t,e){const r=Object.assign({},...t);if(e){const t=e.classes,n=e.styles;t&&(null==r.class?r.class=t:r.class+=" "+t),n&&(null==r.style?r.style=T(n):r.style=T(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),n=e.slice(0,t).trim(),i=e.slice(t+1).trim();n&&(r[n]=i)}for(const t in e){const n=e[t];n?r[t]=n:delete r[t]}return r}(r.style,n)))}let n="";return Object.keys(r).forEach((t=>{if(C.test(t))return;const e=r[t];!0===e?n+=" "+t:E.has(t.toLowerCase())?e&&(n+=" "+t):null!=e&&(n+=` ${t}="${e}"`)})),n}const A=/[&"]/g,V=/[&<]/g;function j(t,e=!1){const r=String(t),n=e?A:V;n.lastIndex=0;let i="",o=0;for(;n.test(r);){const t=n.lastIndex-1,e=r[t];i+=r.substring(o,t)+("&"===e?"&amp;":'"'===e?"&quot;":"&lt;"),o=t+1}return i+r.substring(o)}function D(t){return"string"==typeof t||t&&"object"==typeof t?j(t,!0):t}function S(t){const e={};for(const r in t)e[r]=D(t[r]);return e}function z(t,e){let r="";for(let n=0;n<t.length;n+=1)r+=e(t[n],n);return r}const P={$$render:()=>""};function I(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 M,O;function J(t){function e(e,r,n,i,o){const a=s;l({$$:{on_destroy:M,context:new Map(o||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const c=t(e,r,n,i);return l(a),c}return{render:(t={},{$$slots:r={},context:n=new Map}={})=>{M=[];const o={title:"",head:"",css:new Set},a=e(o,t,{},r,n);return i(M),{html:a,css:{code:Array.from(o.css).map((t=>t.code)).join("\n"),map:null},head:o.title+o.head}},$$render:e}}function N(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${j(e,!0)}"`}`}function T(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${t[e]};`)).join(" ")}function B(t){const e=T(t);return e?` style="${e}"`:""}"function"==typeof HTMLElement&&(O=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(o);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,r){this[t]=r}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){(function(t,e){const r=t.$$;null!==r.fragment&&(i(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])})(this,1),this.$destroy=r}$on(t,e){const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(e),()=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});const U=[];function W(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=!U.length;for(const e of i)e[1](),U.push(e,t);if(e){for(let t=0;t<U.length;t+=2)U[t][0](U[t+1]);U.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 R(t,e,n){const s=!Array.isArray(t),l=s?[t]:t,c=e.length<2;return{subscribe:W(n,(t=>{let n=!1;const u=[];let d=0,v=r;const g=()=>{if(d)return;v();const n=e(s?u[0]:u,t);c?t(n):v=o(n)?n:r},p=l.map(((t,e)=>a(t,(t=>{u[e]=t,d&=~(1<<e),n&&g()}),(()=>{d|=1<<e}))));return n=!0,g(),function(){i(p),v()}})).subscribe}}const L=Symbol("root");function q(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const H={text:"divkit-d9b0",text_halign_left:"divkit-a4cb",text_halign_center:"divkit-e165",text_halign_right:"divkit-ea28",text_valign_top:"divkit-d8ce",text_valign_center:"divkit-ef58",text_valign_bottom:"divkit-fe8e",text__inner:"divkit-b852",text_singleline:"divkit-ef11",text_truncate_none:"divkit-c6ea",text_multiline:"divkit-ee8e",text__inner_gradient:"divkit-cb8e",text__image:"divkit-bf6e",text__image_hidden:"divkit-f100"},G={outer:"divkit-d65a","outer_hide-on-transition-in":"divkit-a6d1","outer_halign-self_start":"divkit-cc45","outer_halign-self_center":"divkit-b833","outer_halign-self_end":"divkit-c573","outer_halign-self_stretch":"divkit-dcc7","outer_valign-self_start":"divkit-e807","outer_valign-self_center":"divkit-d40a","outer_valign-self_end":"divkit-e9f8","outer_valign-self_stretch":"divkit-b7aa","outer_parent-flex_vertical":"divkit-c143","outer_parent-flex_horizontal":"divkit-ef30",outer_width_content:"divkit-b8f4",outer_height_content:"divkit-faa6","outer_width-constrained":"divkit-d321","outer_height-constrained":"divkit-a525","outer_parent-overlap":"divkit-dab2","outer_parent-overlap-absolute":"divkit-d43f","outer_scroll-snap_center":"divkit-d9e3","outer_scroll-snap_start":"divkit-efd1",outer__border:"divkit-d405",outer_visibility_invisible:"divkit-f018",outer_visibility_gone:"divkit-e784","outer_has-action-animation":"divkit-f498"};function Y(t){if(!t)return;let e="";for(const r in t)if(t.hasOwnProperty(r)){if(!t[r]&&0!==t[r])continue;e&&(e+=";"),e+=r+":"+String(t[r])}return e||void 0}function Z(t){if("number"!=typeof t&&"string"!=typeof t||!t)return"0";const e=Number(t);return isNaN(e)?"0":Math.ceil(1e3*e)/1e4+"em"}function X(t){let e=Z(t);return"0"===e&&(e+="em"),e}function K(t,e){for(;t.length<e;)t="0"+t;return t}function Q(t,e=1,r="transparent"){if("#"!==(t=(t||"").toLowerCase()).charAt(0))return r;const n=tt(t);return n?(n.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>K(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(n)):r}function tt(t){const e=t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])$/i)||t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i);if(e){if(5===e.length){const[t,r,n,i,o]=e,a=2===n.length?n:n+n,s=2===i.length?i:i+i,l=2===o.length?o:o+o,c=2===r.length?r:r+r;return{a:parseInt(c,16),r:parseInt(a,16),g:parseInt(s,16),b:parseInt(l,16)}}const[t,r,n,i]=e,o=2===r.length?r:r+r,a=2===n.length?n:n+n,s=2===i.length?i:i+i;return{a:255,r:parseInt(o,16),g:parseInt(a,16),b:parseInt(s,16)}}return null}function et(t){let e=String(t);return e.indexOf("&")>-1&&(e=e.replace(/&/g,"&amp;")),e.indexOf("<")>-1&&(e=e.replace(/</g,"&lt;")),e.indexOf(">")>-1&&(e=e.replace(/>/g,"&gt;")),e.indexOf('"')>-1&&(e=e.replace(/"/g,"&quot;")),e}const rt=Boolean;function nt(t){if(1===t.length&&"solid"===t[0].type)return{color:Q(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=Q(t.bg.color||"transparent");return{size:void 0,pos:void 0,image:`linear-gradient(to bottom,${e},${e})`}}({bg:t}):"gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const r=t.bg.colors.filter(rt);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>Q(t))).join(",")+")"}:void 0}({bg:t}):"image"===t.type?function(t){var e;const r=null===(e=t.bg)||void 0===e?void 0:e.image_url;if(r)return{size:at(t.bg.scale),pos:st(t.bg),image:'url("'+et(r)+'")'}}({bg:t}):"radial_gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const r=t.bg.colors.filter(rt);if(!r.length)return;const n=t.bg.radius;let i;n&&"object"==typeof n&&"type"in n&&void 0!==n.value&&("fixed"===n.type?i=X(n.value):"relative"===n.type&&(i=it[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${i||"farthest-corner"} at ${ot(t.bg.center_x)} ${ot(t.bg.center_y)},`+r.map((t=>Q(t))).join(",")+")"}}({bg:t}):void 0)).filter(rt).reverse().reduce((function(t,e){return t.image.push(e.image),t.size.push(e.size||"auto"),t.position.push(e.pos||"50% 50%"),t}),{image:[],size:[],position:[]});return{image:e.image.join(","),size:e.size.join(","),position:e.position.join(",")}}const it={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function ot(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return X(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function at(t){return"fill"!==t&&t?"fit"===t?"contain":void 0:"cover"}function st(t){let e,r;return e="left"===t.content_alignment_horizontal?"0%":"right"===t.content_alignment_horizontal?"100%":"50%",r="top"===t.content_alignment_vertical?"0%":"bottom"===t.content_alignment_vertical?"100%":"50%",e+" "+r}function lt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}const ct=new Set(["http","https","tel","mailto","intent"]);function ut(t){return ct.has(t)}function dt(t,e){e&&t.push(e)}function vt(t,e,r){const n=[];dt(n,e[t]);for(const i in r)if(r.hasOwnProperty(i)){const o=r[i];o&&dt(n,e[`${t}_${i}`+("string"==typeof o?`_${o}`:"")])}return n.join(" ")}const gt=Symbol("state");function pt(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function ft(t){return pt(t)&&t>=0}function ht(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]&&!ft(i[t]))return n;return function(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(" ")}(t,e,r)}function mt(t,e){if(!t)return e;const r=[t.top,t.right,t.bottom,t.left];for(let t=0;t<r.length;++t)if(r[t]&&!ft(r[t]))return e;return function(t){return Z(t.top||0)+" "+Z(t.right||0)+" "+Z(t.bottom||0)+" "+Z(t.left||0)}(t)}function yt(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const _t=Object.prototype.hasOwnProperty;function bt(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return Object.is(t,e);const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++){const i=r[n];if(!_t.call(e,i)||!bt(t[i],e[i]))return!1}return!0}function wt(t,e){return bt(t,e)?e:t}function $t(){}const xt=Symbol("action"),kt=J(((t,e,r,n)=>{let{actions:i}=e,{doubleTapActions:o}=e,{longTapActions:a}=e,{cls:s=""}=e,{style:l=null}=e,{attrs:c}=e,{use:u=$t}=e,{customAction:g=null}=e,{hasActionAnimation:p=!1}=e;const f=v(L),h=v(xt);d(xt,{hasAction:()=>Boolean(h.hasAction()||(null==i?void 0:i.length))});let m,y="";if(Array.isArray(i)&&(null==i?void 0:i.length))for(let t=0;t<i.length;++t){const e=i[t].url;if(e){y=e,m=i[t].target||void 0;break}}Array.isArray(i)&&(null==i?void 0:i.length)&&h.hasAction()&&(y="",f.logError(q(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:i}})));let _=Boolean(g);return y&&!ut(lt(y))&&(y="",_=!0),void 0===e.actions&&r.actions&&void 0!==i&&r.actions(i),void 0===e.doubleTapActions&&r.doubleTapActions&&void 0!==o&&r.doubleTapActions(o),void 0===e.longTapActions&&r.longTapActions&&void 0!==a&&r.longTapActions(a),void 0===e.cls&&r.cls&&void 0!==s&&r.cls(s),void 0===e.style&&r.style&&void 0!==l&&r.style(l),void 0===e.attrs&&r.attrs&&void 0!==c&&r.attrs(c),void 0===e.use&&r.use&&void 0!==u&&r.use(u),void 0===e.customAction&&r.customAction&&void 0!==g&&r.customAction(g),void 0===e.hasActionAnimation&&r.hasActionAnimation&&void 0!==p&&r.hasActionAnimation(p),y?`<a${F([{href:D(y)},{target:D(m)},{style:D(l)},{class:j(s,!0)+" "+j(p?"":"divkit-bd25",!0)+" "+j(null!=a&&a.length?"divkit-f0cb":"",!0)},S(c)],{})}>${n.default?n.default({}):""}</a>`:`<span${F([{class:j(s,!0)+j(_?` ${p?"":"divkit-bd25"} divkit-c016`:"",!0)+" "+j(null!=a&&a.length?"divkit-f0cb":"",!0)},{style:D(l)},{role:D(_?"button":null)},{tabindex:D(_?0:null)},S(c)],{})}>${n.default?n.default({}):""}</span>`})),Et=J(((t,e,r,n)=>{let{background:i=[]}=e;const o=i.map((t=>{const e={},r=nt([t]),n={style:e};return"solid"===t.type&&(e["background-color"]=r.color),"gradient"===t.type&&(e["background-image"]=r.image),"image"===t.type&&(e.opacity=Number(t.alpha),n.image_url=t.image_url,e["object-fit"]=r.size,e["object-position"]=r.position),n}));return void 0===e.background&&r.background&&void 0!==i&&r.background(i),`<span${N("class","divkit-bf25",0)}>${z(o,(t=>t.image_url?`<img${N("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${N("class","divkit-b921",0)}${N("style",Y(t.style),0)}>`:`<span${N("class","divkit-b921",0)}${N("style",Y(t.style),0)}></span>`))}</span>`}));function Ct(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function Ft(t,e){const r=Number(t);return isNaN(r)?e:r}const At=J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p,f,h,m,y,b,w,$,x,k,E,C,F,A,V,j,D,S,z,P,M,O,J,T,B,U,W,R,H,K,tt,et,rt,it=r,ot=r,at=r,st=r,ct=r,dt=r,pt=r,_t=r,bt=r,$t=r,xt=r,At=r,Vt=r,jt=r,Dt=r,St=r,zt=r;var Pt,It,Mt,Ot,Jt,Nt;let{json:Tt={}}=e,{origJson:Bt}=e,{templateContext:Ut}=e,{cls:Wt=""}=e,{style:Rt}=e,{layoutParams:Lt={}}=e,{customDescription:qt=!1}=e,{customPaddings:Ht=!1}=e,{customActions:Gt=""}=e,{forceWidth:Yt=!1}=e,{forceHeight:Zt=!1}=e;const Xt={left:"start",center:"center",right:"end"},Kt={top:"start",center:"center",bottom:"end"},Qt=v(L),te=v(gt);let ee,re,ne,ie,oe,ae,se,le={},ce={},ue=!1,de=1,ve="transparent",ge=0,pe="",fe="",he="",me={},ye=0,_e=0,be=0,we=!1,$e=!1,xe={},ke=0,Ee=0,Ce=0,Fe=!1,Ae=!1,Ve=1;const je=Lt.fakeElement?[]:Tt.transition_triggers||["state_change","visibility_change"],De=-1!==je.indexOf("state_change")&&Tt.id,Se=-1!==je.indexOf("visibility_change")&&Tt.id;let ze,Pe,Ie,Me,Oe,Je,Ne,Te,Be,Ue=[],We=[],Re=[],Le="",qe=!1,He="visible",Ge=0,Ye=0;void 0===e.json&&n.json&&void 0!==Tt&&n.json(Tt),void 0===e.origJson&&n.origJson&&void 0!==Bt&&n.origJson(Bt),void 0===e.templateContext&&n.templateContext&&void 0!==Ut&&n.templateContext(Ut),void 0===e.cls&&n.cls&&void 0!==Wt&&n.cls(Wt),void 0===e.style&&n.style&&void 0!==Rt&&n.style(Rt),void 0===e.layoutParams&&n.layoutParams&&void 0!==Lt&&n.layoutParams(Lt),void 0===e.customDescription&&n.customDescription&&void 0!==qt&&n.customDescription(qt),void 0===e.customPaddings&&n.customPaddings&&void 0!==Ht&&n.customPaddings(Ht),void 0===e.customActions&&n.customActions&&void 0!==Gt&&n.customActions(Gt),void 0===e.forceWidth&&n.forceWidth&&void 0!==Yt&&n.forceWidth(Yt),void 0===e.forceHeight&&n.forceHeight&&void 0!==Zt&&n.forceHeight(Zt),o=Qt.getDerivedFromVars(Tt.border),zt(),zt=a(o,(t=>rt=t));{let t={},e={},r=!1;if(rt){if(rt.has_shadow){const e=rt.shadow;t["box-shadow"]=e?Z((null===(It=null===(Pt=e.offset)||void 0===Pt?void 0:Pt.x)||void 0===It?void 0:It.value)||0)+" "+Z((null===(Ot=null===(Mt=e.offset)||void 0===Mt?void 0:Mt.y)||void 0===Ot?void 0:Ot.value)||0)+" "+Z(null!==(Jt=e.blur)&&void 0!==Jt?Jt:2)+" "+Q(e.color||"#000000",null!==(Nt=e.alpha)&&void 0!==Nt?Nt:.19):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}rt.stroke&&(r=!0,de=yt(rt.stroke.width,de),ve=Q(rt.stroke.color,1,ve),e.border=`${Z(de)} solid ${ve}`),rt.corners_radius?(pe=ht(rt.corners_radius,0,10,pe),e["border-radius"]=t["border-radius"]=pe):rt.corner_radius&&(ge=yt(rt.corner_radius,ge),e["border-radius"]=t["border-radius"]=Z(ge))}le=wt(t,le),ce=wt(e,ce),ue=r}s=Qt.getDerivedFromVars(Tt.paddings),St(),St=a(s,(t=>et=t)),fe=mt(et&&!Ht?et:void 0,fe),l=Qt.getDerivedFromVars(Tt.margins),jt(),jt=a(l,(t=>K=t)),he=mt(K,he),c=Qt.getDerivedFromVars(Tt.width),At(),At=a(c,(t=>R=t)),u=Qt.getDerivedFromVars(Tt.alignment_horizontal),Dt(),Dt=a(u,(t=>tt=t));{let t,e,r={},n=0,i=0,o=!1,a=!1;const s=null==R?void 0:R.type;if("fixed"===s?(ye=yt(null==R?void 0:R.value,ye),e=Z(ye)):"wrap_content"===s||!Lt.overlapParent&&"match_parent"===s&&Lt.parentHorizontalWrapContent?(t="content",("wrap_content"===s&&(null==R?void 0:R.constrained)||"match_parent"===s&&Lt.parentHorizontalWrapContent)&&(r["width-constrained"]=!0,i=1),"match_parent"===s&&Qt.logError(q(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))):(t="parent","vertical"===Lt.parentContainerOrientation&&Lt.parentContainerWrap&&(a=!0,Qt.logError(q(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===Lt.parentLayoutOrientation?e=`calc(100% - ${X(((null==K?void 0:K.left)||0)+((null==K?void 0:K.right)||0))})`:"horizontal"===Lt.parentContainerOrientation&&(n=R&&"weight"in R&&R.weight||1,Lt.parentContainerWrap&&(o=!0))),"content"===t&&Yt&&(t="parent",Qt.logError(q(new Error("Incorrect usage of width with value 'wrap_content'"),{level:"warn"}))),"parent"===t)r["halign-self"]="stretch";else{const t=tt;r["halign-self"]="left"===t||"center"===t||"right"===t?Xt[t]:Lt.parentHAlign||"start"}t&&(r.width=t),ne=e,_e=n,be=i,me=wt(r,me),we=o,$e=a}d=Qt.getDerivedFromVars(Tt.height),xt(),xt=a(d,(t=>W=t)),g=Qt.getDerivedFromVars(Tt.alignment_vertical),Vt(),Vt=a(g,(t=>H=t));{let t,e,r={},n=0,i=0,o=!1,a=!1;const s=null==W?void 0:W.type;if("fixed"===s?(ke=yt(null==W?void 0:W.value,ke),e=Z(ke)):"match_parent"!==s||!Lt.overlapParent&&Lt.parentVerticalWrapContent?(t="content",("wrap_content"===s&&(null==W?void 0:W.constrained)||"match_parent"===s&&Lt.parentVerticalWrapContent)&&(r["height-constrained"]=!0,i=1),"match_parent"===s&&Qt.logError(q(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))):(t="parent","horizontal"===Lt.parentContainerOrientation&&Lt.parentContainerWrap&&(a=!0,Qt.logError(q(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===Lt.parentLayoutOrientation?e=`calc(100% - ${X(((null==K?void 0:K.top)||0)+((null==K?void 0:K.bottom)||0))})`:"vertical"===Lt.parentContainerOrientation&&(n=(null==W?void 0:W.weight)||1,Lt.parentContainerWrap&&(o=!0))),"content"===t&&Zt&&(t="parent",Qt.logError(q(new Error("Incorrect usage of height with value 'wrap_content'"),{level:"warn"}))),"parent"===t)r["valign-self"]="stretch";else{const t=H;r["valign-self"]="top"===t||"center"===t||"bottom"===t?Kt[t]:Lt.parentVAlign||"start"}t&&(r.height=t),ie=e,Ee=n,Ce=i,xe=wt(r,xe),Fe=o,Ae=a}var Ze,Xe;if(p=!!Lt.overlapParent||void 0,f=Lt.overlapParent&&(!R||"match_parent"===R.type)&&"match_parent"===(null==W?void 0:W.type),h=Lt.gridArea?`${Lt.gridArea.y+1}/${Lt.gridArea.x+1}/span ${Lt.gridArea.rowSpan}/span ${Lt.gridArea.colSpan}`:void 0,m=Qt.getDerivedFromVars(Tt.alpha),$t(),$t=a(m,(t=>U=t)),Xe=Ve,Ve=!ft(Ze=U)||void 0===Ze||Ze>1?Xe:Number(Ze),oe=1===Ve?void 0:Ve,y=Qt.getDerivedFromVars(Tt.accessibility),bt(),bt=a(y,(t=>B=t)),re=void 0,B&&!qt&&B.description&&(re={},re["aria-label"]=B.description),b=Qt.getDerivedFromVars(Tt.background),_t(),_t=a(b,(t=>T=t)),ae={},se=!1,T&&(se=T.some((t=>"image"===t.type)),!se)){const t=nt(T);ae["background-color"]=t.color,ae["background-image"]=t.image,ae["background-size"]=t.size,ae["background-position"]=t.position,ae["background-repeat"]="no-repeat"}ze=void 0,De&&Tt.transition_in&&Qt.isRunning("stateChange")&&(ze=!0),Ie=void 0,De&&Tt.transition_change&&Qt.isRunning("stateChange")&&te.hasTransitionChange(Tt.id)&&(Ie=!0),w=Qt.getDerivedFromVars(Tt.action),dt(),dt=a(w,(t=>O=t)),$=Qt.getDerivedFromVars(Tt.actions),pt(),pt=a($,(t=>J=t)),x=Qt.getDerivedFromVars(Tt.doubletap_actions),ct(),ct=a(x,(t=>M=t)),k=Qt.getDerivedFromVars(Tt.longtap_actions),st(),st=a(k,(t=>P=t));{let t=J||O&&[O]||[],e=M||[],r=P||[];Lt.fakeElement?(t=[],e=[],r=[]):(Array.isArray(t)||(t=[],Qt.logError(q(new Error("Actions should be array")))),Array.isArray(e)||(e=[],Qt.logError(q(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],Qt.logError(q(new Error("LongTapActions should be array"))))),(t.length||e.length||r.length)&&Gt&&(t=[],e=[],r=[],Qt.logError(q(new Error(`Cannot use action on component "${Gt}"`)))),Ue=t,We=e,Re=r}E=Qt.getDerivedFromVars(Tt.action_animation),at(),at=a(E,(t=>z=t)),z&&(Le=function t(e){var r;const n=Ft(e.start_value,1),i=Ft(e.end_value,1),o=yt(e.start_delay,0),a=yt(e.duration,300),s=Ct(e.interpolator,"ease_in_out").replace(/_/g,"-");switch(e.name){case"fade":return Me=n,Oe=i,`opacity ${a}ms ${s} ${o}ms`;case"scale":return Je=n,Ne=i,`transform ${a}ms ${s} ${o}ms`;case"set":return(null===(r=e.items)||void 0===r?void 0:r.length)?e.items.map(t).join(", "):(Qt.logError(q(new Error("Empty items value for action_animation with name='set'"))),"");default:return Qt.logError(q(new Error("Unknown action_animation name"),{additional:{animation:e.name}})),""}}(z)),C=Qt.getDerivedFromVars(Tt.visibility),ot(),ot=a(C,(t=>S=t));{const t=He,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(S,He);t!==e&&(!qe||"visible"!==He&&"visible"!==e?He=e:async function(t){He=t;const e="visible"===t?"in":"out",r="in"===e?Tt.transition_in:Tt.transition_out;Se&&r&&(await _(),"in"===e&&(Pe=!0),te.runVisibilityTransition(Object.assign(Object.assign({},Tt),{visibility:"visible"}),Ut,r,ee,e).then((()=>{"in"===e&&(Pe=!1)})).catch((t=>{throw"in"===e&&(Pe=!1),t})))}(e)),qe||(qe=!0)}if(F=Object.assign(Object.assign(Object.assign({},me),xe),{"parent-overlap":p,"parent-overlap-absolute":f,"scroll-snap":Lt.scrollSnap,"hide-on-transition-in":ze||Pe||Ie,visibility:He,"has-action-animation":Boolean(Le),"parent-flex":Lt.parentContainerOrientation||void 0}),A=Qt.getDerivedFromVars(Tt.transform),it(),it=a(A,(t=>D=t)),D&&void 0!==D.rotation){const t=D.pivot_x||{type:"pivot-percentage",value:50};Ge=Ft(t.value,Ge);const e="pivot-fixed"===t.type?Z(Ge):`${Ge}%`,r=D.pivot_y||{type:"pivot-percentage",value:50};Ye=Ft(r.value,Ye),Te=`${e} ${"pivot-fixed"===r.type?Z(Ye):`${Ye}%`}`,Be=`rotate(${D.rotation}deg)`}return V=we||Fe?"100%":_e||Ee?0:void 0,j=Object.assign(Object.assign(Object.assign(Object.assign({},Rt),ae),le),{width:ne,height:ie,"grid-area":h,padding:fe,margin:he,opacity:oe,transition:Le,"transform-origin":Te,transform:Be,"flex-grow":_e||Ee||void 0,"flex-shrink":be||Ce?1:void 0,"flex-basis":V,"--divkit-animation-opacity-start":Me,"--divkit-animation-opacity-end":Oe,"--divkit-animation-scale-start":Je,"--divkit-animation-scale-end":Ne}),it(),ot(),at(),st(),ct(),dt(),pt(),_t(),bt(),$t(),xt(),At(),Vt(),jt(),Dt(),St(),zt(),$e||Ae?"":`${I(kt,"Actionable").$$render(t,{use:function(t){ee=t,De&&Tt.transition_in&&te.registerChildWithTransitionIn(Tt,Ut,Tt.transition_in,t).then((()=>{ze=!1})).catch((t=>{throw ze=!1,t})),De&&Tt.transition_out&&te.registerChildWithTransitionOut(Tt,Ut,Tt.transition_out,t),De&&Tt.transition_change&&te.registerChildWithTransitionChange(Tt,Ut,Tt.transition_change,t).then((()=>{Ie=!1})).catch((t=>{throw Ie=!1,t})),function(t,{visibilityActions:e,rootCtx:r}){if(null==e||!e.length)return;const n=e.map((t=>({action:t,visible:!1,count:0,finished:!1}))),i=[...new Set([...e.map((t=>(t.visibility_percentage||50)/100))])];new IntersectionObserver((t=>{t.forEach((t=>{n.forEach((e=>{const n=t.intersectionRatio>=(e.action.visibility_percentage||50)/100;!e.visible&&n?e.finished||(e.timer=setTimeout((()=>{++e.count;const t=0===e.action.log_limit?1/0:e.action.log_limit||1;++e.count>=t&&(e.finished=!0);const n=e.action.url;if(n){const t=lt(n);t&&!ut(t)&&("div-action"===t?r.execAction(e.action):e.action.log_id&&r.execCustomAction(e.action))}r.logStat("visible",e.action)}),e.action.visibility_duration||800)):n||e.timer&&clearTimeout(e.timer),e.visible=n}))}))}),{threshold:i}).observe(t)}(t,{visibilityActions:Lt.fakeElement?[]:Qt.getJsonWithVars(Tt.visibility_actions||Tt.visibility_action&&[Tt.visibility_action]),rootCtx:Qt});const e=Tt.id;e&&te.registerChild(e);let r=null;return{destroy(){e&&te.unregisterChild(e),r&&r.destroy()}}},cls:Wt+" "+vt("outer",G,F),style:Y(j),actions:Ue,doubleTapActions:We,longTapActions:Re,attrs:re,hasActionAnimation:Boolean(Le)},{},{default:()=>`${se?`${I(Et,"OuterBackground").$$render(t,{background:T},{},{})}`:""}${i.default?i.default({}):""}${ue?`<span${N("class",G.outer__border,0)}${N("style",Y(ce),0)}></span>`:""}`})}`})),Vt={"text-range":"divkit-faf0","text-range_singleline":"divkit-ccb6","text-range__top-offset":"divkit-d923","text-range_decoration_both":"divkit-d7e0","text-range_decoration_underline":"divkit-f3dd","text-range_decoration_strike":"divkit-d27b","text-range_decoration_none":"divkit-c6b0"};function jt(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function Dt(t){return pt(t)&&t>0}function St(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function zt(t,e){return St(t)||e}const Pt=J(((t,e,r,n)=>{let i,o,a,s,{text:l}=e,{rootFontSize:c}=e,{textStyles:u={}}=e,{singleline:d=!1}=e,{actions:v}=e,g="none",p=12,f=1.25,h="",m="";void 0===e.text&&r.text&&void 0!==l&&r.text(l),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==c&&r.rootFontSize(c),void 0===e.textStyles&&r.textStyles&&void 0!==u&&r.textStyles(u),void 0===e.singleline&&r.singleline&&void 0!==d&&r.singleline(d),void 0===e.actions&&r.actions&&void 0!==v&&r.actions(v);{let t="none";(u.underline||u.strike)&&("single"===u.underline&&"single"===u.strike?t="both":"single"===u.underline?t="underline":"single"===u.strike&&(t="strike")),g=t}return p=jt(u.font_size,p),Dt(u.line_height)&&(f=Number(u.line_height)/p),ft(u.letter_spacing)&&(h=Z(u.letter_spacing)),s=zt(u.font_weight,s),m=Q(u.text_color,1,m),i=u.top_offset?Z(u.top_offset):"",o={singleline:d,decoration:g},a={"font-size":Z(10*p/c),"line-height":f,"letter-spacing":h,"font-weight":s,color:m},`${i?`<span${N("class",Vt["text-range__top-offset"],0)}${B({"margin-top":i})}></span>`:""}${I(kt,"Actionable").$$render(t,{cls:vt("text-range",Vt,o),actions:v,style:Y(a)},{},{default:()=>`${j(l)}`})}`}));function It(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Mt(t,e){return"top"===t||"center"===t||"bottom"===t?t:e}const Ot=J(((t,e,n,i)=>{let o,s,l,c,d,g,p,f,h,m,y,_,b,w,$,x,k,E,C,F,A,V,j,D,S,P,M,O,J,T,B,U,W,R=r,G=r,X=r,K=r,tt=r,et=r,rt=r,it=r,ot=r,at=r,st=r,lt=r,ct=r,{json:ut={}}=e,{templateContext:dt}=e,{origJson:gt}=e,{layoutParams:pt}=e;const ft=v(L);let ht=!1,mt="",yt=12,_t=1.25,bt=!1,wt="",$t="",xt=!1,kt="left",Et="top",Ct="",Ft="",Vt=!1,St=[],zt=[];var Ot,Jt;u((()=>{zt.forEach((t=>{ft.removeSvgFilter(t)}))})),void 0===e.json&&n.json&&void 0!==ut&&n.json(ut),void 0===e.templateContext&&n.templateContext&&void 0!==dt&&n.templateContext(dt),void 0===e.origJson&&n.origJson&&void 0!==gt&&n.origJson(gt),void 0===e.layoutParams&&n.layoutParams&&void 0!==pt&&n.layoutParams(pt),o=ft.getDerivedFromVars(ut.text),ct(),ct=a(o,(t=>W=t)),Ot=W,Jt=mt,mt=String(null!=Ot?Ot:"")||Jt,mt?ht=!1:(ht=!0,ft.logError(q(new Error('Missing "text" prop for div "text"')))),s=ft.getDerivedFromVars(ut.ranges),G(),G=a(s,(t=>V=t)),l=ft.getDerivedFromVars(ut.images),R(),R=a(l,(t=>A=t)),c=ft.getDerivedFromVars({font_size:ut.font_size,letter_spacing:ut.letter_spacing,font_weight:ut.font_weight,text_color:ut.text_color,underline:ut.underline,strike:ut.strike,line_height:ut.line_height}),X(),X=a(c,(t=>j=t)),d=ft.getDerivedFromVars(ut.font_size),lt(),lt=a(d,(t=>U=t)),yt=jt(U,yt),g=ft.getDerivedFromVars(ut.line_height),st(),st=a(g,(t=>B=t));{const t=B;Dt(t)?(_t=Number(t)/yt,bt=!0):bt=!1}p=ft.getDerivedFromVars(ut.max_lines),it(),it=a(p,(t=>O=t)),f=1===O;{let t="",e="",r=!1;if(O&&O>1){let n=Number(O);t=n*_t+"em",V||A||(e=n,r=!0)}wt=t,$t=e,xt=r}h=ft.getDerivedFromVars(ut.text_alignment_horizontal),at(),at=a(h,(t=>T=t)),kt=It(T,kt),m=ft.getDerivedFromVars(ut.text_alignment_vertical),ot(),ot=a(m,(t=>J=t)),Et=Mt(J,Et),y=!V||mt&&1===V.length&&V[0]&&0===V[0].start&&"number"==typeof V[0].end&&V[0].end>=mt.length,_=ft.getDerivedFromVars(ut.text_color),rt(),rt=a(_,(t=>M=t)),b=Boolean(M)!==Boolean(V&&V[0]&&V[0].text_color);{let t="";O&&y&&b&&(t=Q(M||V&&V[0]&&V[0].text_color,1,Ct)),Ct=t}w=ft.getDerivedFromVars(ut.truncate),et(),et=a(w,(t=>P=t)),$="none"===P?"none":"",x=ft.getDerivedFromVars(ut.text_gradient),tt(),tt=a(x,(t=>S=t));{let t="";if(S){const e=nt([S]);e.image&&(t=e.image)}Ft=t}return k=ft.getDerivedFromVars(ut.selectable),K(),K=a(k,(t=>D=t)),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(zt.forEach((t=>{ft.removeSvgFilter(t)})),zt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(St=[]);const i=t;let o=e||[{start:0,end:i.length}],a=r||[],s=0,l=[],c=[];o.forEach((t=>{void 0!==t.start&&void 0!==t.end&&(c.push({index:t.start,range:t,type:"rangeStart",isStart:!0}),c.push({index:t.end,range:t,type:"rangeEnd"}))})),a.forEach(((t,e)=>{void 0!==t.start&&t.url&&t.start<=i.length&&c.push({index:t.start,image:t,type:"image",arrayIndex:e})})),c.sort(((t,e)=>t.index===e.index?t.type!==e.type?"image"===t.type?-1:"image"===e.type?1:t.type<e.type?-1:1:"image"===t.type&&"image"===e.type?e.arrayIndex-t.arrayIndex:"rangeStart"===t.type&&"rangeStart"===e.type?t.range.end-e.range.end:"rangeStart"===t.type?1:"rangeStart"===e.type?-1:"image"!==t.type&&"image"!==e.type?t.range.start-e.range.start:0:t.index-e.index)),c.forEach((t=>{var e;let r="image"===t.type?null:t.range,o=t.index;if(o>s){let r=Object.assign(Object.assign({},j),...l);n.push({text:i.substring(s,o),textStyles:r,actions:"rangeEnd"===t.type&&(null===(e=t.range)||void 0===e?void 0:e.actions)||void 0})}if("rangeStart"===t.type&&r)l.push(r);else if("rangeEnd"===t.type)l=l.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},j),...l),r=Z(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),i=Z(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":Z(10*(Number(e.font_size)||12)/yt)};let a="";if(t.image.tint_color){const e=Q(t.image.tint_color);a=ft.addSvgFilter(e),zt.push(e)}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)}),St=n}(mt,V,A),E={singleline:f,multiline:xt,halign:kt,valign:Et,truncate:$},C={gradient:Boolean(Ft)},F={"font-size":Z(yt),"line-height":_t,"max-height":wt,"-webkit-line-clamp":$t,color:Ct,"background-image":Ft},R(),G(),X(),K(),tt(),et(),rt(),it(),ot(),at(),st(),lt(),ct(),ht?"":`${I(At,"Outer").$$render(t,{cls:vt("text",H,E)+" "+(Vt?"":"divkit-c016"),json:ut,origJson:gt,templateContext:dt,layoutParams:pt},{},{default:()=>`<span${N("class",vt("text__inner",H,C),0)}${N("style",Y(F),0)}>${St.length?`${z(St,((e,r)=>"text"in e?e.text?`${I(Pt,"TextRangeView").$$render(t,{text:e.text,rootFontSize:yt,textStyles:e.textStyles,singleline:f,actions:e.actions},{},{})}`:"":e.image?`<span${N("style",Y(e.image.wrapperStyle),0)}><img${N("class",H.text__image,0)}${N("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${N("style",Y({width:e.image.width,height:e.image.height,"margin-top":bt?`-${e.image.height}`:void 0,"margin-bottom":bt?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${I(Pt,"TextRangeView").$$render(t,{text:mt,rootFontSize:yt,textStyles:j,singleline:f},{},{})}`}</span>`})}`})),Jt=Ot,Nt={container:"divkit-d37d",container_wrap:"divkit-c855",container_orientation_vertical:"divkit-ddc3",container_valign_top:"divkit-a331",container_valign_center:"divkit-aae6",container_valign_bottom:"divkit-c222",container_orientation_horizontal:"divkit-fe45",container_halign_left:"divkit-a309",container_halign_center:"divkit-bac9",container_halign_right:"divkit-f423",container_orientation_overlap:"divkit-a644"},Tt=J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p,f,h,m,y,_,b,w,$,x=r,k=r,E=r,C=r,F=r,A=r,{json:V={}}=e,{templateContext:j}=e,{origJson:D}=e,{layoutParams:S}=e;const P={left:"start",center:"center",right:"end"},M={top:"start",center:"center",bottom:"end"},O=v(L);let J=!1,N="vertical",T="top",B="left",U={};void 0===e.json&&n.json&&void 0!==V&&n.json(V),void 0===e.templateContext&&n.templateContext&&void 0!==j&&n.templateContext(j),void 0===e.origJson&&n.origJson&&void 0!==D&&n.origJson(D),void 0===e.layoutParams&&n.layoutParams&&void 0!==S&&n.layoutParams(S),o=V.items,(null==o?void 0:o.length)&&Array.isArray(o)?J=!1:(J=!0,O.logError(q(new Error('Incorrect or empty "items" prop for div "container"')))),s=(!J&&o||[]).map((t=>{let e=t,r=j;return({templateContext:r,json:e}=O.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=O.getDerivedFromVars(V.orientation),A(),A=a(l,(t=>$=t)),N=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}($,N),c=O.getDerivedFromVars(V.content_alignment_vertical),F(),F=a(c,(t=>w=t)),T=Mt(w,T),u=O.getDerivedFromVars(V.content_alignment_horizontal),C(),C=a(u,(t=>b=t)),B=It(b,B),d=O.getDerivedFromVars(V.layout_mode),E(),E=a(d,(t=>_=t)),g="wrap"===_,p=O.getDerivedFromVars(V.width),x(),x=a(p,(t=>m=t)),f=O.getDerivedFromVars(V.height),k(),k=a(f,(t=>y=t));{let t={};(null==S?void 0:S.fakeElement)&&(t.fakeElement=!0),"overlap"===N&&(t.overlapParent=!0),"horizontal"!==N&&(t.parentHAlign=P[B],(!y||"wrap_content"===y.type||"match_parent"===y.type&&(null==S?void 0:S.parentVerticalWrapContent))&&(t.parentVerticalWrapContent=!0)),"vertical"!==N&&(t.parentVAlign=M[T],("wrap_content"===(null==m?void 0:m.type)||"match_parent"===(null==m?void 0:m.type)&&(null==S?void 0:S.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0)),"horizontal"===N&&(t.parentContainerOrientation="horizontal"),"vertical"===N&&(t.parentContainerOrientation="vertical"),g&&(t.parentContainerWrap=!0),U=wt(t,U)}return h={orientation:N,valign:T,halign:B,wrap:g},x(),k(),E(),C(),F(),A(),J?"":`${I(At,"Outer").$$render(t,{cls:vt("container",Nt,h),json:V,origJson:D,templateContext:j,layoutParams:S},{},{default:()=>`${z(s,(e=>`${I(Ie,"Unknown").$$render(t,{layoutParams:U,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),Bt={separator:"divkit-a30b",separator_orientation_horizontal:"divkit-f529",separator_orientation_vertical:"divkit-e9e2",separator__inner:"divkit-db7d"};function Ut(t,e){return"vertical"===t||"horizontal"===t?t:e}const Wt=J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p=r,{json:f={}}=e,{templateContext:h}=e,{origJson:m}=e,{layoutParams:y}=e;const _=v(L);let b="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&n.json&&void 0!==f&&n.json(f),void 0===e.templateContext&&n.templateContext&&void 0!==h&&n.templateContext(h),void 0===e.origJson&&n.origJson&&void 0!==m&&n.origJson(m),void 0===e.layoutParams&&n.layoutParams&&void 0!==y&&n.layoutParams(y),o=_.getDerivedFromVars(f.delimiter_style),p(),p=a(o,(t=>g=t)),b=Ut(null==g?void 0:g.orientation,b),s=!((null==g?void 0:g.color)&&("transparent"===g.color||9===g.color.length&&0===g.color.indexOf("#00"))),w=Q(null==g?void 0:g.color,1,w),l="horizontal"===b?"100%":Z(1),c="horizontal"===b?Z(1):"100%",u={background:w,width:l,height:c},d={orientation:b},p(),`${I(At,"Outer").$$render(t,{cls:vt("separator",Bt,d),json:f,origJson:m,templateContext:h,layoutParams:y},{},{default:()=>s?`<span${N("class",Bt.separator__inner,0)}${N("style",Y(u),0)}></span>`:""})}`})),Rt={image:"divkit-a448","image_is-width-content":"divkit-fe14","image_is-height-content":"divkit-f4d9",image__image:"divkit-ce04",image_error:"divkit-f10d","image__aspect-wrapper":"divkit-dc80",image_aspect:"divkit-ae78",image_loaded:"divkit-cf4e","divkit-image-appearance":"divkit-e555","image_before-appearance":"divkit-ffe8"},Lt=J(((t,e,n,i)=>{let o,s,l,c,d,g,p,f,h,m,y,_,b,w,$,x,k,E,C,F,A,V,j,D,S,z,P,M,O,J,T,U=r,W=r,R=r,H=r,G=r,Z=r,X=r,K=r,tt=r,rt=r,nt=r,it=r,{json:ot={}}=e,{templateContext:lt}=e,{origJson:ct}=e,{layoutParams:ut}=e;const dt=v(L);let gt,pt=0,ft="rgba(0,0,0,0.08)",ht=!1,mt="",_t="none",bt="50% 50%",wt="0",$t="",xt="",kt=0,Et=0,Ft=0;u((()=>{dt.removeSvgFilter(gt)})),void 0===e.json&&n.json&&void 0!==ot&&n.json(ot),void 0===e.templateContext&&n.templateContext&&void 0!==lt&&n.templateContext(lt),void 0===e.origJson&&n.origJson&&void 0!==ct&&n.origJson(ct),void 0===e.layoutParams&&n.layoutParams&&void 0!==ut&&n.layoutParams(ut),o=dt.getDerivedFromVars(ot.image_url),it(),it=a(o,(t=>T=t)),s=dt.getDerivedFromVars(ot.gif_url),nt(),nt=a(s,(t=>J=t)),l=T||J,pt=0,l?ht=!1:(ht=!0,dt.logError(q(new Error('Missing "image_url" for "image"')))),c=dt.getDerivedFromVars(ot.width),rt(),rt=a(c,(t=>O=t)),d="wrap_content"===(null==O?void 0:O.type),g=dt.getDerivedFromVars(ot.height),tt(),tt=a(g,(t=>M=t)),p="wrap_content"===(null==M?void 0:M.type),f=dt.getDerivedFromVars(ot.preview),K(),K=a(f,(t=>P=t));{const t=P;mt=t?t.startsWith("data:")?`url("${et(t)}")`:`url("data:image/jpg;base64,${et(t)}")`:""}h=dt.getDerivedFromVars(ot.placeholder_color),X(),X=a(h,(t=>z=t)),ft=Q(z,1,ft),m=dt.getDerivedFromVars(ot.scale),Z(),Z=a(m,(t=>S=t)),_t=at(S)||_t,y=dt.getDerivedFromVars({content_alignment_horizontal:ot.content_alignment_horizontal,content_alignment_vertical:ot.content_alignment_vertical}),G(),G=a(y,(t=>D=t)),bt=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)}(D,bt),_=dt.getDerivedFromVars(ot.accessibility),H(),H=a(_,(t=>j=t)),b=(null==j?void 0:j.description)||"",w=dt.getDerivedFromVars(ot.aspect),R(),R=a(w,(t=>V=t));{const t=null==V?void 0:V.ratio;wt=t&&Dt(t)?(100/Number(t)).toFixed(2):"0"}$=dt.getDerivedFromVars(ot.tint_color),W(),W=a($,(t=>A=t));{const t=A,e=t?Q(t):void 0;e!==gt&&(dt.removeSvgFilter(gt),$t=e?dt.addSvgFilter(e):"",gt=e)}if(x=dt.getDerivedFromVars(ot.appearance_animation),U(),U=a(x,(t=>F=t)),F&&"fade"===F.type){const t=F;xt=Ct(t.interpolator,"ease_in_out").replace(/_/g,"-"),Ft=yt(t.duration,300),Et=yt(t.start_delay,0),kt=yt(t.alpha,0)}return k={aspect:"0"!==wt,"is-width-content":d,"is-height-content":p,loaded:!1,"before-appearance":Boolean(xt)&&!0},E={"background-image":mt,"background-color":ft},C={"object-fit":_t,"object-position":bt,filter:"","--divkit-appearance-interpolator":xt||void 0,"--divkit-appearance-fade-start":xt?kt:void 0,"--divkit-appearance-delay":xt?`${Et}ms`:void 0,"--divkit-appearance-duration":xt?`${Ft}ms`:void 0},U(),W(),R(),H(),G(),Z(),X(),K(),tt(),rt(),nt(),it(),ht?"":`${I(At,"Outer").$$render(t,{cls:vt("image",Rt,k),json:ot,origJson:ct,templateContext:lt,layoutParams:ut,style:E,customDescription:!0},{},{default:()=>k.aspect?`<span${N("class",Rt["image__aspect-wrapper"],0)}${B({"padding-bottom":`${wt}%`})}><img${N("class",Rt.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",Y(C),0)}${N("alt",b,0)}${N("aria-hidden",b?null:"true",0)}></span>`:`<img${N("class",Rt.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",Y(C),0)}${N("alt",b,0)}${N("aria-hidden",b?null:"true",0)}>`})}`})),qt={grid:"divkit-d908",grid_halign_left:"divkit-f63b",grid_halign_center:"divkit-a14a",grid_halign_right:"divkit-b071",grid_valign_top:"divkit-fbca",grid_valign_center:"divkit-d431",grid_valign_bottom:"divkit-e420"};function Ht(t){return t>0&&t<1}function Gt(t){return String(Math.ceil(1e3*t)/1e3)}function Yt(t,e,r){if(t.some(Ht)){const e=Math.max(...t.filter(Ht).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)},${Gt(t[e])}fr)`:t[e]?o[e]=`${Gt(t[e])}fr`:o[e]="auto";return o.join(" ")}const Zt=J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p,f,h,m,y,_=r,b=r,w=r,$=r,{json:x={}}=e,{templateContext:k}=e,{origJson:E}=e,{layoutParams:C}=e;const F=v(L);let A,V,j=!1,D=1,S=[],P=[],M=[],O=[],J=0,N=!1,T="top",B="left";void 0===e.json&&n.json&&void 0!==x&&n.json(x),void 0===e.templateContext&&n.templateContext&&void 0!==k&&n.templateContext(k),void 0===e.origJson&&n.origJson&&void 0!==E&&n.origJson(E),void 0===e.layoutParams&&n.layoutParams&&void 0!==C&&n.layoutParams(C),o=x.items,(null==o?void 0:o.length)&&Array.isArray(o)?j=!1:(j=!0,F.logError(q(new Error('Incorrect or empty "items" prop for div "grid"')))),s=F.getDerivedFromVars(x.column_count),$(),$=a(s,(t=>y=t)),D=jt(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=R(t,(t=>[...t])),w(),w=a(A,(t=>m=t))}{const t={};let e=0,r=0;S=[],P=[],M=[],O=[],N=!1,V=l.map(((n,i)=>{var o,a,s,l;const c=m[i],u=Number(c.columnSpan)||1,d=Number(c.rowSpan)||1,v={x:e,y:r,colSpan:u,rowSpan:d},g="match_parent"===(null===(o=c.width)||void 0===o?void 0:o.type)?Number(c.width.weight||1)/u:0,p="match_parent"===(null===(a=c.height)||void 0===a?void 0:a.type)?Number(c.height.weight||1)/d:0,f=1===u&&"fixed"===(null===(s=c.width)||void 0===s?void 0:s.type)&&c.width.value?Number(c.width.value)/u:0,h=1===d&&"fixed"===(null===(l=c.height)||void 0===l?void 0:l.type)&&c.height.value?Number(c.height.value)/d:0;for(let n=e;n<e+u;++n)for(let e=r;e<r+d;++e)t[n+"_"+e]?N=!0:(t[n+"_"+e]=!0,(!S[n]||S[n]<g)&&(S[n]=g),(!P[e]||P[e]<p)&&(P[e]=p),(!M[n]||M[n]<f)&&(M[n]=f),(!O[e]||O[e]<h)&&(O[e]=h));do{++e,e>=D&&(e=0,++r)}while(t[e+"_"+r]);return Object.assign(Object.assign({},n),{layoutParams:{gridArea:v,fakeElement:(null==C?void 0:C.fakeElement)||!1}})})),0!==e&&(N=!0),N&&F.logError(q(new Error('Mismatching "grid" rows/columns'))),J=r}return c=F.getDerivedFromVars(x.content_alignment_vertical),b(),b=a(c,(t=>h=t)),T=Mt(h,T),u=F.getDerivedFromVars(x.content_alignment_horizontal),_(),_=a(u,(t=>f=t)),B=It(f,B),d={valign:T,halign:B},g={"grid-template-columns":Yt(S,M,D),"grid-template-rows":Yt(P,O,J)},p=j||N,_(),b(),w(),$(),p?"":`${I(At,"Outer").$$render(t,{cls:vt("grid",qt,d),json:x,origJson:E,templateContext:k,style:g,layoutParams:C},{},{default:()=>`${z(V,(e=>`${I(Ie,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),Xt=Zt,Kt={gallery:"divkit-cbb0",gallery_orientation_horizontal:"divkit-c9be",gallery_orientation_vertical:"divkit-a72d",gallery__scroller:"divkit-a4e3","gallery_scroll-snap":"divkit-f606","gallery__items-grid":"divkit-eb4a",gallery__items:"divkit-af27",gallery__arrow:"divkit-b72d","gallery__arrow-icon":"divkit-d100",gallery__arrow_left:"divkit-a0a5",gallery__arrow_right:"divkit-f0f5","gallery__arrow-icon-path":"divkit-b417"};function Qt(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 te(t,e){let r;return function(...n){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,n),r=null}),e)}}const ee=J(((t,e,n,i)=>{let o,s,l,c,d,g,p,f,h,m,y,_,b,w,$,x,k,E,C,F,A,V,D,S,P,M,O,J,T,B=r,U=r,W=r,H=r,G=r,X=r,K=r,Q=r,tt=r,et=r,{json:rt={}}=e,{templateContext:nt}=e,{origJson:it}=e,{layoutParams:ot}=e;const at=v(L);let st,lt,ct=[],ut=!1,dt=!1,gt=null,pt=!1,ft=!1;J=a(at.isDesktop,(t=>O=t));let ht,_t,bt,$t,xt=1,kt="horizontal",Et="start",Ct=8,Ft="",Vt=[],Dt={},St=!1,zt={},Pt=0;const It=te((function(){const t=st.scrollLeft,e=st.scrollWidth,r=st.offsetWidth;ut=t>2,dt=t+r<e-2}),50);function Mt(){let t=[],e=ct[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<xt;++e){const n=ct[e].children[r];n&&t.push(n)}return t}function Ot(t,e,r="smooth"){const n="horizontal"===kt,i=n?"offsetLeft":"offsetTop",o=n?"left":"top";st.scroll({[o]:Math.max(0,t[e][i]-Ct/2),behavior:r})}function Jt(t){const e=Mt(),r=st.getBoundingClientRect(),n=e.findIndex((t=>function(t,e){return"horizontal"===kt?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}(r,t.getBoundingClientRect())));if(-1!==n)return n;const i=e.map((t=>function(t,e){return"horizontal"===kt?e.right>t.left&&t.right>e.left:e.bottom>t.top&&t.bottom>e.top}(r,t.getBoundingClientRect()))),o=i.findIndex(Boolean);return-1!==o?"prev"===t&&2===i.filter(Boolean).length?o+1:o:"prev"===t?1:e.length-2}!rt.id||ft||(null==ot?void 0:ot.fakeElement)||at.registerInstance(rt.id,{setCurrentItem(t){const e=Mt();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Ot(e,t)},setPreviousItem(t){const e=Jt("prev"),r=Mt();let n=e-1;n<0&&(n="ring"===t?r.length-1:e),Ot(r,n)},setNextItem(t){const e="horizontal"===kt?st.scrollLeft+st.offsetWidth===st.scrollWidth:st.scrollTop+st.offsetHeight===st.scrollHeight,r=Mt();if(e&&"ring"===t)return void Ot(r,0);const n=Jt("next");let i=n+1;i>r.length-1&&(i="ring"===t?0:n),Ot(r,i)}}),u((()=>{pt=!1,rt.id&&!(null==ot?void 0:ot.fakeElement)&&at.unregisterInstance(rt.id)})),void 0===e.json&&n.json&&void 0!==rt&&n.json(rt),void 0===e.templateContext&&n.templateContext&&void 0!==nt&&n.templateContext(nt),void 0===e.origJson&&n.origJson&&void 0!==it&&n.origJson(it),void 0===e.layoutParams&&n.layoutParams&&void 0!==ot&&n.layoutParams(ot),o=rt.items,(null==o?void 0:o.length)&&Array.isArray(o)?ft=!1:(ft=!0,at.logError(q(new Error('Incorrect or empty "items" prop for div "gallery"')))),s=(!ft&&o||[]).map((t=>{let e=t,r=nt;return({templateContext:r,json:e}=at.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=O&&pt&&!ft,l?"undefined"!=typeof ResizeObserver&&(gt=new ResizeObserver((()=>{It()})),gt.observe(lt)):gt&&(gt.disconnect(),gt=null),c=at.getDerivedFromVars(rt.column_count),tt(),tt=a(c,(t=>M=t)),xt=jt(M,xt),d=function(t,e){let r=0,n=[];for(let i=0;i<t.length;++i)n[r]||(n[r]=[]),n[r].push(t[i]),++r>=e&&(r=0);return n}(s,xt),g=at.getDerivedFromVars(rt.orientation),Q(),Q=a(g,(t=>P=t)),kt=Ut(P,kt),p=at.getDerivedFromVars(rt.cross_content_alignment),K(),K=a(p,(t=>S=t)),Et=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(S,Et),f=at.getDerivedFromVars(rt.item_spacing),X(),X=a(f,(t=>D=t)),Ct=yt(D,Ct),ht=Z(Ct),h=at.getDerivedFromVars(rt.cross_spacing),G(),G=a(h,(t=>V=t)),bt=yt(V,Ct),_t=Z(bt),m=at.getDerivedFromVars(rt.paddings),H(),H=a(m,(t=>A=t)),Ft=mt(A,Ft),y="horizontal"===kt?"grid-template-columns":"grid-template-rows";{let t=[];s.forEach((e=>{const r="horizontal"===kt?"width":"height";t.push(at.getDerivedFromVars(e.json[r]))})),$t=R(t,(t=>t)),W(),W=a($t,(t=>F=t))}Vt=[],xt>1?Vt.push("auto"):F.forEach((t=>{!t&&"horizontal"===kt||"match_parent"===(null==t?void 0:t.type)?Vt.push("100%"):Vt.push("max-content")})),_=at.getDerivedFromVars(rt.scroll_mode),U(),U=a(_,(t=>C=t));{const t={};let e={};St=!1,(null==ot?void 0:ot.fakeElement)&&(e.fakeElement=!0),"horizontal"===kt?e.parentVAlign=Et:e.parentHAlign=Et,"paging"===C&&(St=!0,e.scrollSnap="start",t["horizontal"===kt?"scroll-padding-left":"scroll-padding-top"]=Z(Ct/2)),1===xt&&(e.parentLayoutOrientation=kt),Dt=wt(t,Dt),zt=wt(e,zt)}return b=at.getDerivedFromVars(rt.restrict_parent_scroll),et(),et=a(b,(t=>T=t)),w={padding:Ft,"grid-gap":_t},$={"grid-gap":ht,[y]:Qt(Vt)},x={orientation:kt,"scroll-snap":St},k=at.getDerivedFromVars(rt.default_item),B(),B=a(k,(t=>E=t)),Pt=yt(E,Pt),B(),U(),W(),H(),G(),X(),K(),Q(),tt(),J(),et(),"\n\n"+(ft?"":`${I(At,"Outer").$$render(t,{cls:vt("gallery",Kt,x),json:rt,origJson:it,templateContext:nt,layoutParams:ot,customPaddings:!0,customActions:"gallery",forceHeight:"vertical"===kt,forceWidth:"horizontal"===kt},{},{default:()=>`<div class="${j(Kt.gallery__scroller,!0)+" "+j(T?"divkit-aa14":"",!0)}"${N("style",Y(Dt),0)}${N("this",st,0)}><div${N("class",Kt["gallery__items-grid"],0)}${N("style",Y(w),0)}${N("this",lt,0)}>${z(d,((e,r)=>`<div${N("class",Kt.gallery__items,0)}${N("style",Y($),0)}${N("this",ct[r],0)}>${z(e,(e=>`${I(Ie,"Unknown").$$render(t,{layoutParams:zt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===kt?`${ut&&l?`<div class="${j(Kt.gallery__arrow,!0)+" "+j(Kt.gallery__arrow_left,!0)}"><svg${N("class",Kt["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${N("class",Kt["gallery__arrow-icon-path"],0)} d="m10 16 8.3 8 1.03-1-4-6-.7-1 .7-1 4-6-1.03-1z"></path></svg></div>`:""}\n ${dt&&l?`<div class="${j(Kt.gallery__arrow,!0)+" "+j(Kt.gallery__arrow_right,!0)}"><svg${N("class",Kt["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${N("class",Kt["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>`:""}`:""}`})}`)})),re=ee,ne={tabs:"divkit-e0df",tabs__list:"divkit-ea19",tabs__item:"divkit-c25c",tabs__item_selected:"divkit-d560",tabs__item_actionable:"divkit-dfda",tabs__panels:"divkit-f5dc",tabs__swiper:"divkit-eb42",tabs__swiper_animated:"divkit-b9f1",tabs__swiper_inited:"divkit-fa57",tabs__panel:"divkit-cc9f",tabs__panel_visible:"divkit-e730",tabs__separator:"divkit-b85b"},ie=J(((t,e,n,i)=>{let o,s,l,c,d,g,p,f,h,m,y,b,w,$,x,k,E,C,F,A,V=r,D=r,S=r,P=r,M=r,O=r,J=r,T=r;var U;let{json:W={}}=e,{templateContext:R}=e,{origJson:H}=e,{layoutParams:G}=e;const X=v(L),K=X.genId("tabs");let tt,et,rt,nt=!1,it={};const ot=X.getJsonWithVars(W.selected_tab);let at,st,lt=ot&&Number(ot)||0,ct=12,ut="",dt="",gt="",pt="",yt="",_t="",bt="",$t="",xt="",Et="",Ct=!1,Ft=!1,Vt=lt,St=[],Pt=[];async function It(t,e=!1){if(Vt=lt,lt=t,Ct||(Ct=!0,et.style.height=Z(et.clientHeight),rt.style.transform=`translate3d(${100*-Vt}%,0,0)`),Ft=!0,async function(t){await _(),rt.style.transform=`translate3d(${t}%,0,0)`}(100*-lt),function(t=!1){const e=t?Math.max(0,lt-1):Math.min(lt,Vt),r=t?Math.min(o.length-1,lt+1):Math.max(lt,Vt);St=St.map(((t,n)=>t||n>=e&&n<=r)),Pt=Pt.map(((t,n)=>n>=e&&n<=r))}(),async function(){await _();const t=document.getElementById(`${K}-panel-${lt}`);t&&(et.style.height=Z(t.offsetHeight))}(),Ot&&clearTimeout(Ot),Ot=window.setTimeout((()=>{Pt=o.map(((t,e)=>e===lt))}),400),Mt=-lt*et.clientWidth,e){await _();const t=tt.querySelector(`.${ne.tabs__item_selected}`);t&&t.focus()}}let Mt,Ot=null;!W.id||nt||(null==G?void 0:G.fakeElement)||X.registerInstance(W.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');It(t)},setPreviousItem(t){let e=lt-1;e<0&&(e="ring"===t?o.length-1:lt),It(e)},setNextItem(t){let e=lt+1;e>o.length-1&&(e="ring"===t?0:lt),It(e)}}),u((()=>{W.id&&!(null==G?void 0:G.fakeElement)&&X.unregisterInstance(W.id)})),void 0===e.json&&n.json&&void 0!==W&&n.json(W),void 0===e.templateContext&&n.templateContext&&void 0!==R&&n.templateContext(R),void 0===e.origJson&&n.origJson&&void 0!==H&&n.origJson(H),void 0===e.layoutParams&&n.layoutParams&&void 0!==G&&n.layoutParams(G),o=W.items||[],(null==o?void 0:o.length)&&Array.isArray(o)?nt=!1:(nt=!0,X.logError(q(new Error('Incorrect or empty "items" prop for div "tabs"')))),s=X.getDerivedFromVars(W.width),J(),J=a(s,(t=>F=t)),l=X.getDerivedFromVars(W.height),O(),O=a(l,(t=>C=t));{let t={};(null==G?void 0:G.fakeElement)&&(t.fakeElement=!0),"wrap_content"===(null==F?void 0:F.type)&&(t.parentHorizontalWrapContent=!0),C&&"wrap_content"!==C.type||(t.parentVerticalWrapContent=!0),it=wt(t,it)}if(!nt&&(lt<0||lt>=o.length)&&(X.logError(q(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:W.selected_tab,length:o.length}})),lt=lt<0?0:o.length-1),c=X.getDerivedFromVars(W.tab_title_style),M(),M=a(c,(t=>E=t)),d=E||{},ct=jt(d.font_size,ct),d.font_size||d.paddings){const t=d.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/ct*10,right:(Number(t.right)||0)/ct*10,bottom:(Number(t.bottom)||0)/ct*10,left:(Number(t.left)||0)/ct*10};ut=mt(e,ut)}{const t=d.line_height;void 0!==t&&Dt(t)&&(dt=Z(t/ct*10))}{const t=d.letter_spacing;void 0!==t&&ft(t)&&(gt=Z(t/ct*10))}if(d.corner_radius||d.corners_radius||d.font_size){const t=null!==(U=d.corner_radius)&&void 0!==U?U:1e3;d.corners_radius?pt=ht(d.corners_radius,t,ct,pt):ft(t)&&(pt=Z(t/ct*10))}return at=zt(d.active_font_weight||d.font_weight,at),st=zt(d.inactive_font_weight||d.font_weight,st),yt=Q(d.active_text_color,1,yt),_t=Q(d.inactive_text_color,1,_t),bt=Q(d.active_background_color,1,bt),$t=Q(d.inactive_background_color,1,$t),g=X.getDerivedFromVars(W.has_separator),P(),P=a(g,(t=>k=t)),p=X.getDerivedFromVars(W.separator_color),S(),S=a(p,(t=>x=t)),f=X.getDerivedFromVars(W.separator_paddings),D(),D=a(f,(t=>$=t)),k&&(x&&(xt=Q(x,1,xt)),$&&(Et=mt($,Et))),h={background:xt,margin:Et},m=X.getDerivedFromVars(W.switch_tabs_by_content_swipe_enabled),V(),V=a(m,(t=>w=t)),y=void 0===w||Boolean(w),b=X.getDerivedFromVars(W.restrict_parent_scroll),T(),T=a(b,(t=>A=t)),nt||(St=o.map(((t,e)=>e===lt)),Pt=o.map(((t,e)=>e===lt))),V(),D(),S(),P(),M(),O(),J(),T(),nt?"":`${I(At,"Outer").$$render(t,{cls:vt("tabs",ne,{}),json:W,origJson:H,templateContext:R,layoutParams:G,customActions:"tabs"},{},{default:()=>`<div class="${j(ne.tabs__list,!0)+" "+j(A?"divkit-aa14":"",!0)}" role="tablist"${B({"--divkit-tabs-font-size":Z(ct),"--divkit-tabs-paddings":ut,"--divkit-tabs-line-height":dt,"--divkit-tabs-letter-spacing":gt,"--divkit-tabs-active-font-weight":at||"","--divkit-tabs-inactive-font-weight":st||"","--divkit-tabs-active-text-color":yt,"--divkit-tabs-inactive-text-color":_t,"--divkit-tabs-active-background-color":bt,"--divkit-tabs-inactive-background-color":$t,"--divkit-tabs-border-radius":pt})}${N("this",tt,0)}>${z(o,((e,r)=>{let n=r===lt;return`\n\n ${I(kt,"Actionable").$$render(t,{cls:vt("tabs__item",ne,{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||(It(e),!1)}(0,r)},{},{default:()=>`${j(e.title)}\n `})}`}))}</div>\n ${k?`<div${N("class",ne.tabs__separator,0)}${N("style",Y(h),0)}></div>`:""}\n <div class="${j(ne.tabs__panels,!0)+" "+j(A?"divkit-aa14":"",!0)}"${N("this",et,0)}><div${N("class",vt("tabs__swiper",ne,{inited:Ct,animated:Ft}),0)}${N("this",rt,0)}>${z(o,((e,r)=>`<div${N("class",vt("tabs__panel",ne,{visible:Pt[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)+"%"}">${St[r]?`${I(Ie,"Unknown").$$render(t,{div:e.div,templateContext:R,layoutParams:it},{},{})}`:""}\n </div>`))}</div></div>`})}`})),oe=ie;function ae(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)}}ae([.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]),ae([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 se=J(((t,e,r,n)=>{let i,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const c=v(L),g=v(gt);let p=new Map,f=new Set,h=!1,m=null,y=[],b=[],w=[],$=[];const x=o.div_id||o.id;let k;x?(null==l?void 0:l.fakeElement)||(g.registerInstance(x,{async setState(t){if(k===t)return;c.setRunning("stateChange",!0),new Set(f),y.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),y=[],$.forEach((t=>{p.set(t.id,t.node.getBoundingClientRect())})),b=[],w=[],$=[];const e=i.find((e=>e.state_id===t))||null;e?(k=t,E=e):c.logError(q(new Error("Cannot find state with id"),{additional:{stateId:t}})),await _()},getChild(t){if(m&&m.has(t))return m.get(t);c.logError(q(new Error("Missing state block with id"),{additional:{id:t}}))}}),d(gt,{registerInstance(t,e){m||(m=new Map),m.has(t)?c.logError(q(new Error("Duplicate state with id"),{additional:{id:t}})):m.set(t,e)},unregisterInstance(t){null==m||m.delete(t)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return b.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return w.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,n){const i=t.id;if(!i)return Promise.resolve();const o={id:i,json:t,templateContext:e,transitions:r,node:n};return $.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&p.has(t),registerChild(t){f.add(t)},unregisterChild(t){f.delete(t)}})):(h=!0,c.logError(q(new Error('Missing "id" prop for div "state"'))));let E=null;const C=c.getJsonWithVars(o.default_state_id);let F=!1;return u((()=>{x&&!(null==l?void 0:l.fakeElement)&&g.unregisterInstance(x)})),void 0===e.json&&r.json&&void 0!==o&&r.json(o),void 0===e.templateContext&&r.templateContext&&void 0!==a&&r.templateContext(a),void 0===e.origJson&&r.origJson&&void 0!==s&&r.origJson(s),void 0===e.layoutParams&&r.layoutParams&&void 0!==l&&r.layoutParams(l),o&&(f=new Set),i=o.states||[],(null==i?void 0:i.length)?h=!1:(h=!0,c.logError(q(new Error('Empty "states" prop for div "state"')))),function(t){F||(F=!0,t.length&&(C?(k=C,E=t.find((t=>t.state_id===k))||null,E||c.logError(q(new Error("Cannot find state for default_state_id"),{additional:{selectedId:k}}))):(E=t[0],k=E.state_id)))}(i),h?"":`${I(At,"Outer").$$render(t,{cls:"divkit-b8ef",json:o,origJson:s,templateContext:a,layoutParams:l},{},{default:()=>{var e;return`${null!==(e=E)&&void 0!==e&&e.div?`${I(Ie,"Unknown").$$render(t,{div:E.div,templateContext:a},{},{})}`:""}\n <div${N("class","divkit-adaa",0)} aria-hidden="true"${N("this",undefined,0)}>${z(y,(e=>"direction"in e?`<div${N("class","divkit-eb86",0)} style="${"left:"+j(e.offsetLeft,!0)+"px;top:"+j(e.offsetTop,!0)+"px;width:"+j(e.width,!0)+"px;height:"+j(e.height,!0)+"px"}"><div${N("class","divkit-e08c",0)}>${I(Ie,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`:`<div${N("class","divkit-eb86",0)}><div${N("class","divkit-e08c",0)}>${I(Ie,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`))}</div>`}})}`})),le={pager:"divkit-c5fe",pager__items:"divkit-f698",pager__item:"divkit-feca",pager_orientation_horizontal:"divkit-b0a1",pager_orientation_vertical:"divkit-f772"},ce=J(((t,e,n,i)=>{let o,s,l,c,d,g,p,f,h,m,y,_,b,w,$,x,k,E=r,C=r,F=r,A=r,V=r,D=r;var S,P,M,O,J,T,B;let{json:U={}}=e,{templateContext:W}=e,{origJson:R}=e,{layoutParams:H}=e;const G=v(L),K=G.genId("pager");let Q,tt=!1,et=0,rt=!1,nt="horizontal",it="",ot="",at="";function st(t,e="smooth"){const r="horizontal"===nt,n=Q.children[t],i=r?"offsetLeft":"offsetTop",o=r?"left":"top";Q.scroll({[o]:n[i],behavior:e}),et=t}te((function(){const t=function(){const t=Array.from(Q.children),e=Q.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,n=t.getBoundingClientRect(),"horizontal"===nt?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),U.id&&!(null==H?void 0:H.fakeElement)&&G.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=et-1;e<0&&(e="ring"===t?o.length-1:et),st(e)},setNextItem(t){let e=et+1;e>o.length-1&&(e="ring"===t?0:et),st(e)}}),u((()=>{U.id&&!(null==H?void 0:H.fakeElement)&&G.unregisterInstance(U.id)})),void 0===e.json&&n.json&&void 0!==U&&n.json(U),void 0===e.templateContext&&n.templateContext&&void 0!==W&&n.templateContext(W),void 0===e.origJson&&n.origJson&&void 0!==R&&n.origJson(R),void 0===e.layoutParams&&n.layoutParams&&void 0!==H&&n.layoutParams(H),(null===(S=U.items)||void 0===S?void 0:S.length)&&Array.isArray(U.items)?tt=!1:(tt=!0,G.logError(q(new Error('Incorrect or empty "items" prop for div "pager"')))),o=(!tt&&U.items||[]).map((t=>{let e=t,r=W;return({templateContext:r,json:e}=G.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=G.getDerivedFromVars(U.layout_mode),C(),C=a(s,(t=>b=t)),b?"percentage"!==b.type&&"fixed"!==b.type?(rt=!0,G.logError(q(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):rt=!1:(rt=!0,G.logError(q(new Error('Empty "layout_mode" prop for div "pager"')))),l=G.getDerivedFromVars(U.orientation),V(),V=a(l,(t=>x=t)),nt=Ut(x,nt),c=G.getDerivedFromVars(U.item_spacing),A(),A=a(c,(t=>$=t));{const t=null==$?void 0:$.value;t&&ft(t)&&(it=Z(t||0))}if(d=G.getDerivedFromVars(U.paddings),F(),F=a(d,(t=>w=t)),ot=mt(w,ot),g=G.getDerivedFromVars(U.restrict_parent_scroll),D(),D=a(g,(t=>k=t)),p="horizontal"===nt?"grid-auto-columns":"grid-auto-rows","fixed"===(null==b?void 0:b.type)){const t=X("horizontal"===nt?((null===(P=U.paddings)||void 0===P?void 0:P.left)||0)+((null===(M=U.paddings)||void 0===M?void 0:M.right)||0):((null===(O=U.paddings)||void 0===O?void 0:O.top)||0)+((null===(J=U.paddings)||void 0===J?void 0:J.bottom)||0)),e=null===(T=b.neighbour_page_width)||void 0===T?void 0:T.value;at=e?`calc(100% + ${t} - 2 * ${X(e)} - 2 * ${it})`:"100%"}else if("percentage"===(null==b?void 0:b.type)){const t=null===(B=b.page_width)||void 0===B?void 0:B.value;at=`${Number(t)}%`}return f={"grid-gap":it,padding:ot,[p]:at},h={orientation:nt},m=tt||rt,y=G.getStore("pagers"),E(),E=a(y,(t=>_=t)),function(t,e){const r=U.id;if(r){const o=new Map(_);n=y,_=o.set(r,{instId:K,size:t,currentItem:e,scrollToPagerItem:st}),i=_,n.set(i)}var n,i}(o.length,et),E(),C(),F(),A(),V(),D(),m?"":`${I(At,"Outer").$$render(t,{cls:vt("pager",le,h),json:U,origJson:R,templateContext:W,layoutParams:H,customPaddings:!0},{},{default:()=>`<div class="${j(le.pager__items,!0)+" "+j(k?"divkit-aa14":"",!0)}"${N("style",Y(f),0)}${N("this",Q,0)}>${z(o,(e=>`<div${N("class",le.pager__item,0)}>${I(Ie,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson,layoutParams:null!=H&&H.fakeElement?{fakeElement:!0}:void 0},{},{})}\n </div>`))}</div>`})}`})),ue=ce,de={indicator:"divkit-d8e3",indicator__scroller:"divkit-b5db",indicator__items:"divkit-d5d9",indicator__item:"divkit-f662",indicator__item_active:"divkit-b39c"},ve=J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p,f,h,m,y,b=r,w=r,$=r,x=r,k=r,E=r,{json:C={}}=e,{templateContext:F}=e,{origJson:A}=e,{layoutParams:V}=e;const D=v(L);let S,P,M,O=10,J=10,T=5,U="#ffdc60",W=Q("#33919cb5"),R=15,q=1.3;return void 0===e.json&&n.json&&void 0!==C&&n.json(C),void 0===e.templateContext&&n.templateContext&&void 0!==F&&n.templateContext(F),void 0===e.origJson&&n.origJson&&void 0!==A&&n.origJson(A),void 0===e.layoutParams&&n.layoutParams&&void 0!==V&&n.layoutParams(V),o=D.getDerivedFromVars(C.shape),E(),E=a(o,(t=>y=t)),y&&(y.item_width&&(O=yt(y.item_width.value,O)),y.item_height&&(J=yt(y.item_height.value,J)),y.corner_radius&&(T=yt(y.corner_radius.value,T))),s=D.getDerivedFromVars(C.active_item_color),k(),k=a(s,(t=>m=t)),U=Q(m,1,U),l=D.getDerivedFromVars(C.inactive_item_color),x(),x=a(l,(t=>h=t)),W=Q(h,1,W),c=D.getDerivedFromVars(C.space_between_centers),$(),$=a(c,(t=>f=t)),f&&(R=yt(f.value,R)),u=D.getDerivedFromVars(C.active_item_size),w(),w=a(u,(t=>p=t)),q=jt(p,q),d=D.getStore("pagers"),b(),b=a(d,(t=>g=t)),async function(t){if(C.pager_id&&t.has(C.pager_id)){M=t.get(C.pager_id),await _();const e=P.children[M.currentItem].offsetLeft;S.scroll({left:e-S.clientWidth/2,behavior:"smooth"})}}(g),b(),w(),$(),x(),k(),E(),`${I(At,"Outer").$$render(t,{cls:vt("indicator",de,{}),json:C,origJson:A,templateContext:F,layoutParams:V},{},{default:()=>`<div${N("class",de.indicator__scroller,0)}${N("this",S,0)}><div${N("class",de.indicator__items,0)} role="tablist"${B({margin:`0 ${Z((q-1)*O/2)}`,"--divkit-indicator-width":Z(O),"--divkit-indicator-height":Z(J),"--divkit-indicator-border-radius":Z(T),"--divkit-indicator-active-color":U,"--divkit-indicator-inactive-color":W,"--divkit-indicator-active-scale":q,"--divkit-indicator-margin":`0 ${Z((R-O)/2)}`})}${N("this",P,0)}>${M?`${z(Array(M.size),((t,e)=>{let r=e===M.currentItem;return`\n <div class="${j(vt("indicator__item",de,{active:r}),!0)+" "+j("divkit-bd25",!0)}" role="tab" id="${j(M.instId,!0)+"-tab-"+j(e,!0)}" aria-controls="${j(M.instId,!0)+"-panel-"+j(e,!0)}"${N("aria-selected",r?"true":"false",0)}${N("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),ge=ve,pe={slider:"divkit-ef4f",slider__input:"divkit-d1d6",slider__input_secondary:"divkit-c798",slider__thumb:"divkit-f345",slider__thumb_secondary:"divkit-e198","slider__tracks-wrapper":"divkit-f733","slider__tracks-inner":"divkit-ac90",slider__track:"divkit-e956","slider__active-track":"divkit-ec5b","slider__thumb-text":"divkit-c4af","slider__thumb-text_secondary":"divkit-d882",slider__tick:"divkit-bd9b",slider__tick_active:"divkit-d8ce",slider__tick_inactive:"divkit-e71e"};function fe(t,e){var r,n,i;if(!t||!t.shape||!t.color)return e;const o=Q(t.color),a=Number((null===(r=t.shape.item_width)||void 0===r?void 0:r.value)||10),s=Number((null===(n=t.shape.item_height)||void 0===n?void 0:n.value)||10),l=Number((null===(i=t.shape.corner_radius)||void 0===i?void 0:i.value)||5);if("shape_drawable"===t.type&&"transparent"!==o&&"rounded_rectangle"===t.shape.type){var c,u;const e={},r=null!==(c=t.stroke)&&void 0!==c&&c.color?Q(t.stroke.color):"",n=null!==(u=t.stroke)&&void 0!==u&&u.width?Number(t.stroke.width||1):"";return e.width=a,e.height=s,e.borderRadius=l,e.background=o,r&&n&&(e.boxShadow=`inset 0 0 0 ${Z(n)} ${r}`),e}return e}function he(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&Q(t.text_color)||"#000",i=St(t.font_weight);if(Dt(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 me(t,e,r){return Math.max(e,Math.min(r,t))}const ye=-2147483648,_e=Number.MAX_VALUE,be=Number.MIN_VALUE,we="string",$e="integer",xe="number",ke="boolean",Ee="color",Ce="datetime";class Fe{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=W(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 Ae={string:class extends Fe{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends Fe{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 Fe{convertValue(t){if("number"!=typeof t||isNaN(t)||t>2147483647||t<ye||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 Fe{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 Fe{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 Fe{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function Ve(t,e,r){if(!(e in Ae))throw new Error("Unsupported variable type");return new Ae[e](t,r)}function je(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 De=J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p,f,h,m,y,_,b,w,$,x,k,E,C,F,A,V,D,S,P,M,O,J,T,U,W,R,H,G,Y,K=r,Q=r,tt=r,et=r,rt=r,nt=r,it=r,ot=r,at=r,st=r,lt=r,ct=r;var ut,dt,gt,pt;let{json:ht={}}=e,{templateContext:mt}=e,{origJson:yt}=e,{layoutParams:_t}=e;const bt={width:10,height:10,borderRadius:5,background:"#000"},wt=v(L),$t=v(xt);let kt=0,Et=100;const Ct=wt.getJsonWithVars(ht.thumb_value_variable),Vt=wt.getJsonWithVars(ht.thumb_secondary_value_variable);H=a(Ct&&wt.getVariable(Ct,"integer")||Ve("temp","integer",0),(t=>R=t)),W=a(Vt&&wt.getVariable(Vt,"integer")||Ve("temp","integer",0),(t=>U=t));let jt,Dt,St,zt=me(R||0,kt,Et),Pt=me(U||0,kt,Et),It=bt,Mt=It,Ot=bt,Jt=bt,Nt=null,Tt=null,Bt=St,Ut="",Wt="",Rt=!1;te((function(){}),50),void 0===e.json&&n.json&&void 0!==ht&&n.json(ht),void 0===e.templateContext&&n.templateContext&&void 0!==mt&&n.templateContext(mt),void 0===e.origJson&&n.origJson&&void 0!==yt&&n.origJson(yt),void 0===e.layoutParams&&n.layoutParams&&void 0!==_t&&n.layoutParams(_t),o=wt.getDerivedFromVars(ht.min_value),ct(),ct=a(o,(t=>Y=t)),s=wt.getDerivedFromVars(ht.max_value),lt(),lt=a(s,(t=>G=t)),kt=Ft(Y,kt),Et=Ft(G,Et);{const t=me(R||0,kt,Et);t!==zt&&(zt=t)}{const t=me(U||0,kt,Et);t!==Pt&&(Pt=t)}l=wt.getDerivedFromVars(ht.thumb_style),st(),st=a(l,(t=>T=t)),It=fe(T,It),c=wt.getDerivedFromVars(ht.thumb_secondary_style),at(),at=a(c,(t=>J=t)),Mt=fe(J,It),u=wt.getDerivedFromVars(ht.track_inactive_style),ot(),ot=a(u,(t=>O=t)),Ot=fe(O,Ot),d=wt.getDerivedFromVars(ht.track_active_style),it(),it=a(d,(t=>M=t)),Jt=fe(M,Jt),g=wt.getDerivedFromVars(ht.tick_mark_active_style),nt(),nt=a(g,(t=>P=t));{let t=fe(P,bt);t!==bt&&(Nt=t)}jt=Nt?Vt?je(Math.min(zt,Pt),Math.max(zt,Pt)+1,kt,Et,!0):je(kt,zt,kt,Et,!0):[],p=wt.getDerivedFromVars(ht.tick_mark_inactive_style),rt(),rt=a(p,(t=>S=t));{let t=fe(S,bt);t!==bt&&(Tt=t)}Dt=Tt?Vt?je(Math.min(zt,Pt),Math.max(zt,Pt)+1,kt,Et,!1):je(zt+1,Et+1,kt,Et,!0):[],f=wt.getDerivedFromVars(ht.thumb_text_style),et(),et=a(f,(t=>D=t)),St=he(D,St),h=wt.getDerivedFromVars(ht.thumb_secondary_text_style),tt(),tt=a(h,(t=>V=t)),Bt=he(V,St),m=wt.getDerivedFromVars(ht.accessibility),Q(),Q=a(m,(t=>A=t)),(null==A?void 0:A.description)?Ut=A.description:wt.logError(q(new Error('Missing accessibility "description" for slider'),{level:"warn"})),y=wt.getDerivedFromVars(ht.secondary_value_accessibility),K(),K=a(y,(t=>F=t)),(null==F?void 0:F.description)?Wt=F.description:Vt&&wt.logError(q(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;$t.hasAction()?(wt.logError(q(new Error('Cannot show "slider" inside component with action'))),t=!0):It===bt?(wt.logError(q(new Error('Missing "thumb_style" in slider'))),t=!0):Jt===bt?(wt.logError(q(new Error('Missing "track_active_style" in slider'))),t=!0):Ot===bt&&(wt.logError(q(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==Rt&&(Rt=t)}return _=Z(Math.max(...[It.width,Mt.width,0].filter(ft))),b=Z(Math.max(...[It.height,Mt.height,0].filter(ft))),w=(zt-kt)/(Et-kt),$=Vt?(Pt-kt)/(Et-kt):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(Mt.width),"--divkit-slider-thumb-secondary-height":Z(Mt.height),"--divkit-slider-text-offset-x":(null===(ut=null==St?void 0:St.offset)||void 0===ut?void 0:ut.x)?X(St.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(dt=null==St?void 0:St.offset)||void 0===dt?void 0:dt.y)?X(St.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(gt=null==Bt?void 0:Bt.offset)||void 0===gt?void 0:gt.x)?X(Bt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(pt=null==Bt?void 0:Bt.offset)||void 0===pt?void 0:pt.y)?X(Bt.offset.y):void 0,"--divkit-slider-tick-active-width":Nt?Z(Nt.width):void 0,"--divkit-slider-tick-active-height":Nt?Z(Nt.height):void 0,"--divkit-slider-tick-active-border-radius":Nt?Z(Nt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Nt?void 0:Nt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Nt?void 0:Nt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Tt?Z(Tt.width):void 0,"--divkit-slider-tick-inactive-height":Tt?Z(Tt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Tt?Z(Tt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Tt?void 0:Tt.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Tt?void 0:Tt.boxShadow)||void 0,"--divkit-slider-max-thumb-width":_,"--divkit-slider-max-thumb-height":b,"--divkit-slider-track-part":w,"--divkit-slider-track-secondary-part":$},C={},K(),Q(),tt(),et(),rt(),nt(),it(),ot(),at(),st(),W(),H(),lt(),ct(),"\n\n"+(Rt?"":`${I(At,"Outer").$$render(t,{cls:vt("slider",pe,C),style:E,customDescription:!0,customActions:"slider",json:ht,origJson:yt,templateContext:mt,layoutParams:_t},{},{default:()=>{var t,e,r,n,i,o;return`<div${N("class",pe["slider__tracks-wrapper"],0)}><div${N("class",pe["slider__tracks-inner"],0)}${N("this",undefined,0)}><div${N("class",pe.slider__track,0)}${B({height:Z(Ot.height),"border-radius":Z(Ot.borderRadius),background:Ot.background,"box-shadow":Ot.boxShadow||""})}></div>\n <div${N("class",pe["slider__active-track"],0)}${B({left:(100*k).toFixed(2)+"%",width:(100*x).toFixed(2)+"%",height:Z(Jt.height),"border-radius":Z(Jt.borderRadius),background:Jt.background,"box-shadow":Jt.boxShadow||""})}></div>\n ${z(jt,(t=>`<div class="${j(pe.slider__tick,!0)+" "+j(pe.slider__tick_active,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n ${z(Dt,(t=>`<div class="${j(pe.slider__tick,!0)+" "+j(pe.slider__tick_inactive,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n <div${N("class",pe.slider__thumb,0)}${B({"border-radius":Z(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${St?`<div${N("class",pe["slider__thumb-text"],0)}><div${N("class",pe["slider__thumb-text-inner"],0)}${B({"font-size":(null===(t=St)||void 0===t?void 0:t.fontSize)||"1em","font-weight":(null===(e=St)||void 0===e?void 0:e.fontWeight)||"",color:(null===(r=St)||void 0===r?void 0:r.textColor)||"#000"})}>${j(zt)}</div></div>`:""}</div>\n ${Vt?`<div class="${j(pe.slider__thumb,!0)+" "+j(pe.slider__thumb_secondary,!0)}"${B({"border-radius":Z(Mt.borderRadius),background:Mt.background,"box-shadow":Mt.boxShadow||""})}>${Bt?`<div class="${j(pe["slider__thumb-text"],!0)+" "+j(pe["slider__thumb-text_secondary"],!0)}"><div${N("class",pe["slider__thumb-text-inner"],0)}${B({"font-size":(null===(n=Bt)||void 0===n?void 0:n.fontSize)||"1em","font-weight":(null===(i=Bt)||void 0===i?void 0:i.fontWeight)||"",color:(null===(o=Bt)||void 0===o?void 0:o.textColor)||"#000"})}>${j(Pt)}</div></div>`:""}</div>`:""}\n <input type="range"${N("class",pe.slider__input,0)}${N("min",kt,0)}${N("max",Et,0)} step="1"${N("value",zt,0)}${N("aria-label",Ut,0)}>\n ${Vt?`<input type="range"${N("class",`${pe.slider__input} ${pe.slider__input_secondary}`,0)}${N("min",kt,0)}${N("max",Et,0)} step="1"${N("value",Pt,0)}${N("aria-label",Wt,0)}>`:""}</div></div>`}})}`)})),Se={input:"divkit-c3a4",input__wrapper:"divkit-ef7e",input__holder:"divkit-bb3d",input_multiline:"divkit-e48a",input__input:"divkit-f11e","input_highlight-color":"divkit-cc00","input_vertical-overflow":"divkit-b707"},ze={text:Jt,container:Tt,separator:Wt,image:Lt,gif:Lt,grid:Xt,gallery:re,tabs:oe,state:se,pager:ue,indicator:ge,slider:De,input:J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p,f,h,m,y,_,b,w,$,x,k,E,C,F,A,V,D,S,z,P,M,O,J,T,B,U=r,W=r,{json:R={}}=e,{templateContext:H}=e,{origJson:G}=e,{layoutParams:Y}=e;const K=v(L);let tt;const et=K.getJsonWithVars(R.text_variable);let rt=!1;et||(rt=!0,K.logError(q(new Error('Missing "text_variable" in "input"')))),J=a(et&&K.getVariable(et,"string")||Ve("temp","string",""),(t=>O=t));let nt="";M=a(K.getDerivedFromVars(R.hint_text),(t=>P=t)),z=a(K.getDerivedFromVars(R.hint_color),(t=>S=t));let it="";D=a(K.getDerivedFromVars(R.font_size),(t=>V=t));let ot,at,st=12;A=a(K.getDerivedFromVars(R.font_weight),(t=>F=t)),C=a(K.getDerivedFromVars(R.line_height),(t=>E=t)),k=a(K.getDerivedFromVars(R.letter_spacing),(t=>x=t));let lt="";$=a(K.getDerivedFromVars(R.text_color),(t=>w=t));let ct="#000";b=a(K.getDerivedFromVars(R.highlight_color),(t=>_=t));let ut="";y=a(K.getDerivedFromVars(R.keyboard_type),(t=>m=t));const dt={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let gt="multi_line_text",ft="text";h=a(K.getDerivedFromVars(R.max_visible_lines),(t=>f=t));let ht="",mt="";B=a(K.getDerivedFromVars(R.select_all_on_focus),(t=>T=t)),void 0===e.json&&n.json&&void 0!==R&&n.json(R),void 0===e.templateContext&&n.templateContext&&void 0!==H&&n.templateContext(H),void 0===e.origJson&&n.origJson&&void 0!==G&&n.origJson(G),void 0===e.layoutParams&&n.layoutParams&&void 0!==Y&&n.layoutParams(Y),nt=O,o=P,it=Q(S,1,it),st=jt(V,st),ot=zt(F,ot);{const t=E;Dt(t)&&(at=t/st)}return pt(x)&&(lt=Z(x/st*10)),ct=Q(w,1,ct),ut=Q(_,1,ut),m&&m in dt&&(ft=dt[m],gt=m),s="multi_line_text"===gt,l=K.getDerivedFromVars(R.paddings),W(),W=a(l,(t=>p=t)),Dt(f)&&(ht=`calc(${f*(at||1.25)+"em"} + ${X(yt(null==p?void 0:p.top,0)+yt(null==p?void 0:p.bottom,0))})`),c=K.getDerivedFromVars(R.accessibility),U(),U=a(c,(t=>g=t)),(null==g?void 0:g.description)?mt=g.description:K.logError(q(new Error('Missing accessibility "description" for input'),{level:"warn"})),u={"highlight-color":Boolean(ut),"vertical-overflow":!1,multiline:s},d={"--divkit-input-hint-color":it,"--divkit-input-highlight-color":ut,"font-size":Z(st),"font-weight":ot,"line-height":at,"letter-spacing":lt,color:ct,"max-height":ht},U(),W(),h(),y(),b(),$(),k(),C(),A(),D(),z(),M(),J(),B(),rt?"":`${I(At,"Outer").$$render(t,{cls:vt("input",Se,u),style:d,customDescription:!0,customActions:"input",json:R,origJson:G,templateContext:H,layoutParams:Y},{},{default:()=>`<span${N("class",Se.input__wrapper,0)}><span${N("class",Se.input__holder,0)} aria-hidden="true"${N("this",undefined,0)}>\n ${j(nt)}${nt.endsWith("\n")||!nt?"​":""}</span>\n ${s?`<textarea${N("class",Se.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",mt,0)}${N("placeholder",o,0)}${N("this",tt,0)}>${j(nt,!0)}</textarea>`:`<input${N("type",ft,0)}${N("class",Se.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",mt,0)}${N("placeholder",o,0)}${N("value",nt,0)}${N("this",tt,0)}>`}</span>`})}`}))},Pe=J(((t,e,r,n)=>{let{div:i}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=v(L);let c,u,d;if(void 0===e.div&&r.div&&void 0!==i&&r.div(i),void 0===e.templateContext&&r.templateContext&&void 0!==o&&r.templateContext(o),void 0===e.origJson&&r.origJson&&void 0!==a&&r.origJson(a),void 0===e.layoutParams&&r.layoutParams&&void 0!==s&&r.layoutParams(s),c=i,u=o,d=c&&ze[c.type]||void 0,!d&&(({templateContext:u,json:c}=l.processTemplate(c,u)),d=c&&ze[c.type]||void 0,!d)){let t;t=(null==c?void 0:c.type)&&l.hasTemplate(c.type)?"Recursive template":"Unknown component",l.logError(q(new Error(t),{additional:{component:(null==c?void 0:c.type)||"<missing>"}}))}return d?`${I(d||P,"svelte:component").$$render(t,{json:c,templateContext:u,layoutParams:s,origJson:a||i},{},{})}`:""})),Ie=Pe,Me=J(((t,e,r,n)=>{let{svgFiltersMap:i}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==i&&r.svgFiltersMap(i),Object.keys(i).length?`<svg${N("class","divkit-dc22",0)} aria-hidden="true"><defs>${z([...Object.keys(i)],(t=>`<filter${N("id",i[t],0)}><feFlood${N("flood-color",t,0)}></feFlood><feComposite in2="SourceGraphic" operator="in"></feComposite></filter>`))}</defs></svg>`:""}));function Oe(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 Je(){}function Ne(t){return{subscribe:e=>(e(t),Je)}}function Te(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function Be(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function Ue(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 We(t){var e=parseInt(t,10);if(e>2147483647||e<ye)throw new Error(`Value ${t} can't be converted to Integer type.`);return e}function Re(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function Le(t,e,r,n){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,Le.prototype),i.expected=e,i.found=r,i.location=n,i.name="SyntaxError",i}function qe(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function He(t,e){var r,n,i,o,a={},s=(e=void 0!==e?e:{}).grammarSource,l={start:St,JsonStringContents:function(){var t,e,r;for(t=_t,e=[],r=zt();r!==a;)e.push(r),r=zt();return bt=t,e=yt(e)}},c=St,u="@{",d="}",v="@{}",g="\\",p="||",f="&&",h="==",m="!=",y=">=",_="<=",b="+",w="-",$="true",x="false",k=/^[^}]/,E=/^[^'}]/,C=/^[0-9]/,F=/^[a-zA-Z_0-9.]/,A=/^[a-zA-Z_]/,V=/^[ \t\r\n]/,j=Ct("@{",!1),D=Ct("}",!1),S=Ct("@{}",!1),z=Ct("\\",!1),P={type:"any"},I=Ft(["}"],!0,!1),M=Ct("?",!1),O=Ct(":",!1),J=Ct("||",!1),N=Ct("&&",!1),T=Ct("==",!1),B=Ct("!=",!1),U=Ct(">=",!1),W=Ct(">",!1),R=Ct("<=",!1),L=Ct("<",!1),q=Ct("+",!1),H=Ct("-",!1),G=Ct("/",!1),Y=Ct("*",!1),Z=Ct("%",!1),X=Ct("!",!1),K=Ct("(",!1),Q=Ct(")",!1),tt=Ct(",",!1),et=At("string"),rt=Ct("'",!1),nt=Ft(["'","}"],!0,!1),it=At("integer"),ot=Ft([["0","9"]],!1,!1),at=At("number"),st=Ct(".",!1),lt=Ct("e",!1),ct=Ct("E",!1),ut=At("boolean"),dt=Ct("true",!1),vt=Ct("false",!1),gt=Ft([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),pt=At("identifier"),ft=Ft([["a","z"],["A","Z"],"_"],!1,!1),ht=At("whitespace"),mt=Ft([" ","\t","\r","\n"],!1,!1),yt=function(t){return Ue(t)},_t=0,bt=0,wt=[{line:1,column:1}],$t=0,xt=[],kt=0;if("startRule"in e){if(!(e.startRule in l))throw new Error("Can't start parsing from rule \""+e.startRule+'".');c=l[e.startRule]}function Et(){return t.substring(bt,_t)}function Ct(t,e){return{type:"literal",text:t,ignoreCase:e}}function Ft(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function At(t){return{type:"other",description:t}}function Vt(e){var r,n=wt[e];if(n)return n;for(r=e-1;!wt[r];)r--;for(n={line:(n=wt[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return wt[e]=n,n}function jt(t,e){var r=Vt(t),n=Vt(e);return{source:s,start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:n.line,column:n.column}}}function Dt(t){_t<$t||(_t>$t&&($t=_t,xt=[]),xt.push(t))}function St(){var t,e;return t=_t,qt(),(e=Pt())!==a?(qt(),bt=t,t=e):(_t=t,t=a),t}function zt(){var e,r,n,i,o;if(e=_t,t.substr(_t,2)===u?(r=u,_t+=2):(r=a,0===kt&&Dt(j)),r!==a?(n=qt(),(i=Pt())!==a?(qt(),125===t.charCodeAt(_t)?(o=d,_t++):(o=a,0===kt&&Dt(D)),o!==a?(bt=e,e=i):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,t.substr(_t,3)===v?(r=v,_t+=3):(r=a,0===kt&&Dt(S)),r!==a&&(bt=e,r=""),(e=r)===a&&(e=_t,r=_t,kt++,92===t.charCodeAt(_t)?(n=g,_t++):(n=a,0===kt&&Dt(z)),n===a&&(t.substr(_t,2)===u?(n=u,_t+=2):(n=a,0===kt&&Dt(j))),kt--,n===a?r=void 0:(_t=r,r=a),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(P)),n!==a?(bt=e,e=Et()):(_t=e,e=a)):(_t=e,e=a),e===a))){if(e=_t,t.substr(_t,2)===u?(r=u,_t+=2):(r=a,0===kt&&Dt(j)),r!==a){if(n=[],k.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(I)),i!==a)for(;i!==a;)n.push(i),k.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(I));else n=a;n!==a?(125===t.charCodeAt(_t)?(i=d,_t++):(i=a,0===kt&&Dt(D)),i!==a?(bt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(_t=e,e=a)):(_t=e,e=a)}else _t=e,e=a;e===a&&(e=_t,t.substr(_t,2)===u?(r=u,_t+=2):(r=a,0===kt&&Dt(j)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(z)),r!==a?(t.substr(_t,2)===u?(n=u,_t+=2):(n=a,0===kt&&Dt(j)),n!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(z)),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(P)),n!==a?(bt=e,e=Re(n)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(z)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Pt(){var e,r,n,i,o,s;return e=_t,(r=It())!==a?(qt(),63===t.charCodeAt(_t)?(n="?",_t++):(n=a,0===kt&&Dt(M)),n!==a?(qt(),(i=Pt())!==a?(qt(),58===t.charCodeAt(_t)?(o=":",_t++):(o=a,0===kt&&Dt(O)),o!==a?(qt(),(s=Pt())!==a?(bt=e,e={type:"ConditionalExpression",test:r,consequent:i,alternate:s}):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=It()),e}function It(){var e,r,n,i,o,s,l,c;if(e=_t,(r=Mt())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===p?(s=p,_t+=2):(s=a,0===kt&&Dt(J)),s!==a?(l=qt(),(c=Mt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===p?(s=p,_t+=2):(s=a,0===kt&&Dt(J)),s!==a?(l=qt(),(c=Mt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Be(r,n)}else _t=e,e=a;return e}function Mt(){var e,r,n,i,o,s,l,c;if(e=_t,(r=Ot())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===f?(s=f,_t+=2):(s=a,0===kt&&Dt(N)),s!==a?(l=qt(),(c=Ot())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===f?(s=f,_t+=2):(s=a,0===kt&&Dt(N)),s!==a?(l=qt(),(c=Ot())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Be(r,n)}else _t=e,e=a;return e}function Ot(){var e,r,n,i,o,s,l,c;if(e=_t,(r=Jt())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===h?(s=h,_t+=2):(s=a,0===kt&&Dt(T)),s===a&&(t.substr(_t,2)===m?(s=m,_t+=2):(s=a,0===kt&&Dt(B))),s!==a?(l=qt(),(c=Jt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===h?(s=h,_t+=2):(s=a,0===kt&&Dt(T)),s===a&&(t.substr(_t,2)===m?(s=m,_t+=2):(s=a,0===kt&&Dt(B))),s!==a?(l=qt(),(c=Jt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Te(r,n)}else _t=e,e=a;return e}function Jt(){var e,r,n,i,o,s,l,c;if(e=_t,(r=Nt())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===y?(s=y,_t+=2):(s=a,0===kt&&Dt(U)),s===a&&(62===t.charCodeAt(_t)?(s=">",_t++):(s=a,0===kt&&Dt(W)),s===a&&(t.substr(_t,2)===_?(s=_,_t+=2):(s=a,0===kt&&Dt(R)),s===a&&(60===t.charCodeAt(_t)?(s="<",_t++):(s=a,0===kt&&Dt(L))))),s!==a?(l=qt(),(c=Nt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===y?(s=y,_t+=2):(s=a,0===kt&&Dt(U)),s===a&&(62===t.charCodeAt(_t)?(s=">",_t++):(s=a,0===kt&&Dt(W)),s===a&&(t.substr(_t,2)===_?(s=_,_t+=2):(s=a,0===kt&&Dt(R)),s===a&&(60===t.charCodeAt(_t)?(s="<",_t++):(s=a,0===kt&&Dt(L))))),s!==a?(l=qt(),(c=Nt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Te(r,n)}else _t=e,e=a;return e}function Nt(){var e,r,n,i,o,s,l,c;if(e=_t,(r=Tt())!==a){for(n=[],i=_t,o=qt(),43===t.charCodeAt(_t)?(s=b,_t++):(s=a,0===kt&&Dt(q)),s===a&&(45===t.charCodeAt(_t)?(s=w,_t++):(s=a,0===kt&&Dt(H))),s!==a?(l=qt(),(c=Tt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),43===t.charCodeAt(_t)?(s=b,_t++):(s=a,0===kt&&Dt(q)),s===a&&(45===t.charCodeAt(_t)?(s=w,_t++):(s=a,0===kt&&Dt(H))),s!==a?(l=qt(),(c=Tt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Te(r,n)}else _t=e,e=a;return e}function Tt(){var e,r,n,i,o,s,l,c;if(e=_t,(r=Bt())!==a){for(n=[],i=_t,o=qt(),47===t.charCodeAt(_t)?(s="/",_t++):(s=a,0===kt&&Dt(G)),s===a&&(42===t.charCodeAt(_t)?(s="*",_t++):(s=a,0===kt&&Dt(Y)),s===a&&(37===t.charCodeAt(_t)?(s="%",_t++):(s=a,0===kt&&Dt(Z)))),s!==a?(l=qt(),(c=Bt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),47===t.charCodeAt(_t)?(s="/",_t++):(s=a,0===kt&&Dt(G)),s===a&&(42===t.charCodeAt(_t)?(s="*",_t++):(s=a,0===kt&&Dt(Y)),s===a&&(37===t.charCodeAt(_t)?(s="%",_t++):(s=a,0===kt&&Dt(Z)))),s!==a?(l=qt(),(c=Bt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Te(r,n)}else _t=e,e=a;return e}function Bt(){var e,r,n;return(e=Rt())===a&&(e=Wt())===a&&(e=_t,33===t.charCodeAt(_t)?(r="!",_t++):(r=a,0===kt&&Dt(X)),r===a&&(43===t.charCodeAt(_t)?(r=b,_t++):(r=a,0===kt&&Dt(q)),r===a&&(45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)))),r!==a?(qt(),(n=Bt())!==a?(bt=e,e={type:"UnaryExpression",operator:r,argument:n}):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=function(){var e,r,n,i,o;return e=_t,(r=Lt())!==a?(qt(),40===t.charCodeAt(_t)?(n="(",_t++):(n=a,0===kt&&Dt(K)),n!==a?(qt(),i=function(){var e,r,n,i,o,s,l;if(e=_t,(r=Pt())!==a){for(n=[],i=_t,qt(),44===t.charCodeAt(_t)?(o=",",_t++):(o=a,0===kt&&Dt(tt)),o!==a?(qt(),(s=Pt())!==a?i=s:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,qt(),44===t.charCodeAt(_t)?(o=",",_t++):(o=a,0===kt&&Dt(tt)),o!==a?(qt(),(s=Pt())!==a?i=s:(_t=i,i=a)):(_t=i,i=a);bt=e,l=n,e=[r,...l]}else _t=e,e=a;return e===a&&(e=qt()),e}(),i!==a?(qt(),41===t.charCodeAt(_t)?(o=")",_t++):(o=a,0===kt&&Dt(Q)),o!==a?(bt=e,e={type:"CallExpression",callee:r,arguments:i}):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,(r=Lt())!==a&&(bt=e,r={type:"Variable",id:r}),(e=r)===a&&(e=function(){var e,r,n,i;return e=function(){var e,r,n,i;return kt++,e=_t,39===t.charCodeAt(_t)?(r="'",_t++):(r=a,0===kt&&Dt(rt)),r!==a?(n=function(){var t,e,r;for(t=_t,e=[],r=Ut();r!==a;)e.push(r),r=Ut();return bt=t,e=Ue(e)}(),39===t.charCodeAt(_t)?(i="'",_t++):(i=a,0===kt&&Dt(rt)),i!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a),kt--,e===a&&(r=a,0===kt&&Dt(et)),e}(),e===a&&(e=Rt())===a&&(e=Wt())===a&&(e=function(){var e,r;return kt++,e=_t,t.substr(_t,4)===$?(r=$,_t+=4):(r=a,0===kt&&Dt(dt)),r!==a&&(bt=e,r={type:"BooleanLiteral",value:!0}),(e=r)===a&&(e=_t,t.substr(_t,5)===x?(r=x,_t+=5):(r=a,0===kt&&Dt(vt)),r!==a&&(bt=e,r={type:"BooleanLiteral",value:!1}),e=r),kt--,e===a&&(r=a,0===kt&&Dt(ut)),e}(),e===a&&(e=_t,40===t.charCodeAt(_t)?(r="(",_t++):(r=a,0===kt&&Dt(K)),r!==a&&(n=Pt())!==a?(41===t.charCodeAt(_t)?(i=")",_t++):(i=a,0===kt&&Dt(Q)),i!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a))),e}())),e}())),e}function Ut(){var e,r,n,i,o;if(e=_t,t.substr(_t,2)===u?(r=u,_t+=2):(r=a,0===kt&&Dt(j)),r!==a?(n=qt(),(i=Pt())!==a?(qt(),125===t.charCodeAt(_t)?(o=d,_t++):(o=a,0===kt&&Dt(D)),o!==a?(bt=e,e=i):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,t.substr(_t,3)===v?(r=v,_t+=3):(r=a,0===kt&&Dt(S)),r!==a&&(bt=e,r=""),(e=r)===a&&(e=_t,r=_t,kt++,92===t.charCodeAt(_t)?(n=g,_t++):(n=a,0===kt&&Dt(z)),n===a&&(39===t.charCodeAt(_t)?(n="'",_t++):(n=a,0===kt&&Dt(rt)),n===a&&(t.substr(_t,2)===u?(n=u,_t+=2):(n=a,0===kt&&Dt(j)))),kt--,n===a?r=void 0:(_t=r,r=a),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(P)),n!==a?(bt=e,e=Et()):(_t=e,e=a)):(_t=e,e=a),e===a))){if(e=_t,t.substr(_t,2)===u?(r=u,_t+=2):(r=a,0===kt&&Dt(j)),r!==a){if(n=[],E.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(nt)),i!==a)for(;i!==a;)n.push(i),E.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(nt));else n=a;n!==a?(125===t.charCodeAt(_t)?(i=d,_t++):(i=a,0===kt&&Dt(D)),i!==a?(bt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(_t=e,e=a)):(_t=e,e=a)}else _t=e,e=a;e===a&&(e=_t,t.substr(_t,2)===u?(r=u,_t+=2):(r=a,0===kt&&Dt(j)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(z)),r!==a?(t.substr(_t,2)===u?(n=u,_t+=2):(n=a,0===kt&&Dt(j)),n!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(z)),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(P)),n!==a?(bt=e,e=Re(n)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(z)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Wt(){var e,r,n,i;if(kt++,e=_t,45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)),r===a&&(r=null),n=[],C.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot)),i!==a)for(;i!==a;)n.push(i),C.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));else n=a;return n!==a?(bt=e,e={type:"IntegerLiteral",value:We(Et())}):(_t=e,e=a),kt--,e===a&&(r=a,0===kt&&Dt(it)),e}function Rt(){var e,r,n,i,o,s,l,c,u,d;for(kt++,e=_t,45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)),r===a&&(r=null),n=[],C.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));i!==a;)n.push(i),C.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));if(46===t.charCodeAt(_t)?(i=".",_t++):(i=a,0===kt&&Dt(st)),i!==a){if(o=[],C.test(t.charAt(_t))?(s=t.charAt(_t),_t++):(s=a,0===kt&&Dt(ot)),s!==a)for(;s!==a;)o.push(s),C.test(t.charAt(_t))?(s=t.charAt(_t),_t++):(s=a,0===kt&&Dt(ot));else o=a;if(o!==a){if(s=_t,101===t.charCodeAt(_t)?(l="e",_t++):(l=a,0===kt&&Dt(lt)),l===a&&(69===t.charCodeAt(_t)?(l="E",_t++):(l=a,0===kt&&Dt(ct))),l!==a){if(43===t.charCodeAt(_t)?(c=b,_t++):(c=a,0===kt&&Dt(q)),c===a&&(45===t.charCodeAt(_t)?(c=w,_t++):(c=a,0===kt&&Dt(H))),c===a&&(c=null),u=[],C.test(t.charAt(_t))?(d=t.charAt(_t),_t++):(d=a,0===kt&&Dt(ot)),d!==a)for(;d!==a;)u.push(d),C.test(t.charAt(_t))?(d=t.charAt(_t),_t++):(d=a,0===kt&&Dt(ot));else u=a;u!==a?s=l=[l,c,u]:(_t=s,s=a)}else _t=s,s=a;s===a&&(s=null),bt=e,e={type:"NumberLiteral",value:parseFloat(Et())}}else _t=e,e=a}else _t=e,e=a;if(e===a){if(e=_t,45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)),r===a&&(r=null),n=[],C.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot)),i!==a)for(;i!==a;)n.push(i),C.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));else n=a;if(n!==a)if(101===t.charCodeAt(_t)?(i="e",_t++):(i=a,0===kt&&Dt(lt)),i===a&&(69===t.charCodeAt(_t)?(i="E",_t++):(i=a,0===kt&&Dt(ct))),i!==a){if(43===t.charCodeAt(_t)?(o=b,_t++):(o=a,0===kt&&Dt(q)),o===a&&(45===t.charCodeAt(_t)?(o=w,_t++):(o=a,0===kt&&Dt(H))),o===a&&(o=null),s=[],C.test(t.charAt(_t))?(l=t.charAt(_t),_t++):(l=a,0===kt&&Dt(ot)),l!==a)for(;l!==a;)s.push(l),C.test(t.charAt(_t))?(l=t.charAt(_t),_t++):(l=a,0===kt&&Dt(ot));else s=a;s!==a?(bt=e,e={type:"NumberLiteral",value:parseFloat(Et())}):(_t=e,e=a)}else _t=e,e=a;else _t=e,e=a}return kt--,e===a&&(r=a,0===kt&&Dt(at)),e}function Lt(){var e,r,n,i,o;if(kt++,e=_t,r=_t,kt++,n=function(){var e,r,n,i;return e=_t,t.substr(_t,4)===$?(r=$,_t+=4):(r=a,0===kt&&Dt(dt)),r===a&&(t.substr(_t,5)===x?(r=x,_t+=5):(r=a,0===kt&&Dt(vt))),r!==a?(n=_t,kt++,F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(gt)),kt--,i===a?n=void 0:(_t=n,n=a),n!==a?e=r=[r,n]:(_t=e,e=a)):(_t=e,e=a),e}(),kt--,n===a?r=void 0:(_t=r,r=a),r!==a)if(A.test(t.charAt(_t))?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(ft)),n!==a){for(i=[],F.test(t.charAt(_t))?(o=t.charAt(_t),_t++):(o=a,0===kt&&Dt(gt));o!==a;)i.push(o),F.test(t.charAt(_t))?(o=t.charAt(_t),_t++):(o=a,0===kt&&Dt(gt));bt=e,e={type:"Identifier",name:Et()}}else _t=e,e=a;else _t=e,e=a;return kt--,e===a&&(r=a,0===kt&&Dt(pt)),e}function qt(){var e,r;for(kt++,e=[],V.test(t.charAt(_t))?(r=t.charAt(_t),_t++):(r=a,0===kt&&Dt(mt));r!==a;)e.push(r),V.test(t.charAt(_t))?(r=t.charAt(_t),_t++):(r=a,0===kt&&Dt(mt));return kt--,r=a,0===kt&&Dt(ht),e}if((r=c())!==a&&_t===t.length)return r;throw r!==a&&_t<t.length&&Dt({type:"end"}),n=xt,i=$t<t.length?t.charAt($t):null,o=$t<t.length?jt($t,$t+1):jt($t,$t),new Le(Le.buildMessage(n,i),n,i,o)}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(Le,Error),Le.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=qe("",i.line.toString().length," "),l=n[i.line-1],c=(i.line===a.line?a.column:l.length+1)-i.column||1;e+="\n --\x3e "+o+"\n"+s+" |\n"+i.line+" | "+l+"\n"+s+" | "+qe("",i.column-1," ")+qe("",c,"^")}else e+="\n at "+o}return e},Le.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 Ge=new Map,Ye=new Map;function Ze(t,e,r){const n={args:e,cb:r},i=Ge.get(t)||[];Ge.has(t)||Ge.set(t,i),i.push(n);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");Ye.set(o,n)}function Xe(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 Ke(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=>{Ke(t,e)}));break;case"BinaryExpression":case"LogicalExpression":Ke(t.left,e),Ke(t.right,e);break;case"UnaryExpression":Ke(t.argument,e);break;case"ConditionalExpression":Ke(t.test,e),Ke(t.consequent,e),Ke(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{Ke(t,e)}))}}function Qe(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function tr(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function er(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 tr(t.value);if("color"===t.type)return ur(cr(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function rr(t){let e=er(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function nr(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}const ir=new Int32Array(1);function or(t){return ir[0]=t,ir[0]}function ar(t){if(t<ye||t>2147483647)throw new Error("Integer overflow.")}function sr(t){const e=[];return Ke(t,{Variable(t){e.push(t.id.name)}}),e}function lr(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function cr(t){const e=tt(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function ur(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 dr(t){return{type:we,value:er(t)}}function vr(t){const e=Number(t.value);if(isNaN(e)||!Number.isFinite(e))throw new Error("Unable to convert value to Number.");return{type:xe,value:e}}function gr(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value/e.value;return t.type===$e&&(r=or(r)),{type:t.type,value:r}}function pr(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value%e.value;return t.type===$e&&(r=or(r)),{type:t.type,value:r}}function fr(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e*=t[r].value,t[0].type===$e&&(e=or(e));return{type:t[0].type,value:e}}function hr(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e-=t[r].value,t[0].type===$e&&(e=or(e));return{type:t.length?t[0].type:$e,value:e}}function mr(...t){let e=0;for(let r=0;r<t.length;++r)e+=t[r].value,t[0].type===$e&&(e=or(e));return{type:t.length?t[0].type:$e,value:e}}function yr(t){const e=Math.abs(t.value);return t.type===$e&&ar(e),{type:t.type,value:e}}function _r(...t){if(!t.length)throw new Error("Non empty argument list is required.");return{type:t[0].type,value:Math.max(...t.map((t=>t.value)))}}function br(...t){if(!t.length)throw new Error("Non empty argument list is required.");return{type:t[0].type,value:Math.min(...t.map((t=>t.value)))}}function wr(t){return{type:t.type,value:Math.sign(t.value)}}function $r(t,e){let r;if(0===e.value&&t.type===$e)r=t.value;else if(0===t.value&&t.type===$e)r=0;else{let n=Math.sign(e.value);t.type===xe&&0===n&&(n=Object.is(n,0)?1:-1),r=Math.abs(t.value)*n}return t.type===$e&&ar(r),{type:t.type,value:r}}function xr(t){return e=>{const r=cr(e.value);return{type:xe,value:r[t]/255}}}function kr(t){return(e,r)=>{const n=cr(e.value);return n[t]=255*r.value,{type:Ee,value:ur(n)}}}const Er=xr("a"),Cr=xr("r"),Fr=xr("g"),Ar=xr("b"),Vr=kr("a"),jr=kr("r"),Dr=kr("g"),Sr=kr("b");function zr(t){return t.map(rr).join(", ")}Ze("toString",[$e],dr),Ze("toString",[xe],dr),Ze("toString",[ke],dr),Ze("toString",[Ee],dr),Ze("toString",["url"],dr),Ze("toNumber",[$e],vr),Ze("toNumber",[we],vr),Ze("toInteger",[xe],(function(t){if(t.value>2147483647||t.value<ye)throw new Error("Unable to convert value to Integer.");const e=t.value-t.value%1;return{type:$e,value:e}})),Ze("toInteger",[we],(function(t){const e=Number(t.value);if(isNaN(e)||e%1!=0||e>2147483647||e<ye)throw new Error("Unable to convert value to Integer.");return{type:$e,value:e}})),Ze("toInteger",[ke],(function(t){return{type:$e,value:t.value?1:0}})),Ze("toBoolean",[$e],(function(t){if(1!==t.value&&0!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:ke,value:t.value}})),Ze("toBoolean",[we],(function(t){if("true"!==t.value&&"false"!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:ke,value:"true"===t.value?1:0}})),Ze("encodeUri",[we],(function(t){try{return{type:we,value:encodeURIComponent(t.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),Ze("decodeUri",[we],(function(t){try{return{type:we,value:decodeURIComponent(t.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),Ze("parseUnixTime",[$e],(function(t){return{type:Ce,value:new Date(1e3*t.value)}})),Ze("nowLocal",[],(function(){return{type:Ce,value:new Date}})),Ze("addMillis",[Ce,$e],(function(t,e){return{type:Ce,value:new Date(t.value.getTime()+e.value)}})),Ze("setYear",[Ce,$e],(function(t,e){const r=new Date(t.value);return r.setFullYear(e.value),{type:Ce,value:r}})),Ze("setMonth",[Ce,$e],(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:Ce,value:r}})),Ze("setDay",[Ce,$e],(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 ${er(t)}.`);return r.setDate(-1===e.value?0:e.value),{type:Ce,value:r}})),Ze("setHours",[Ce,$e],(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:Ce,value:r}})),Ze("setMinutes",[Ce,$e],(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:Ce,value:r}})),Ze("setSeconds",[Ce,$e],(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:Ce,value:r}})),Ze("setMillis",[Ce,$e],(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:Ce,value:r}})),Ze("len",[we],(function(t){return{type:$e,value:t.value.length}})),Ze("contains",[we,we],(function(t,e){return{type:ke,value:t.value.includes(e.value)?1:0}})),Ze("substring",[we,$e,$e],(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:we,value:t.value.substring(e.value,r.value)}})),Ze("replaceAll",[we,we,we],(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:we,value:n}})),Ze("index",[we,we],(function(t,e){return{type:$e,value:t.value.indexOf(e.value)}})),Ze("lastIndex",[we,we],(function(t,e){return{type:$e,value:t.value.lastIndexOf(e.value)}})),Ze("trim",[we],(function(t){return{type:we,value:t.value.trim()}})),Ze("trimLeft",[we],(function(t){return{type:we,value:t.value.replace(/^\s+/,"")}})),Ze("trimRight",[we],(function(t){return{type:we,value:t.value.replace(/\s+$/,"")}})),Ze("toUpperCase",[we],(function(t){return{type:we,value:t.value.toUpperCase()}})),Ze("toLowerCase",[we],(function(t){return{type:we,value:t.value.toLowerCase()}})),Ze("div",[$e,$e],gr),Ze("div",[xe,xe],gr),Ze("mod",[$e,$e],pr),Ze("mod",[xe,xe],pr),Ze("mul",[{type:$e,isVararg:!0}],fr),Ze("mul",[{type:xe,isVararg:!0}],fr),Ze("sub",[{type:$e,isVararg:!0}],hr),Ze("sub",[{type:xe,isVararg:!0}],hr),Ze("sum",[{type:$e,isVararg:!0}],mr),Ze("sum",[{type:xe,isVararg:!0}],mr),Ze("abs",[$e],yr),Ze("abs",[xe],yr),Ze("max",[{type:$e,isVararg:!0}],_r),Ze("max",[{type:xe,isVararg:!0}],_r),Ze("min",[{type:$e,isVararg:!0}],br),Ze("min",[{type:xe,isVararg:!0}],br),Ze("maxNumber",[],(function(){return{type:xe,value:_e}})),Ze("minNumber",[],(function(){return{type:xe,value:be}})),Ze("maxInteger",[],(function(){return{type:$e,value:2147483647}})),Ze("minInteger",[],(function(){return{type:$e,value:ye}})),Ze("round",[xe],(function(t){const e=Math.sign(t.value);return{type:xe,value:e*Math.round(Math.abs(t.value))}})),Ze("floor",[xe],(function(t){return{type:xe,value:Math.floor(t.value)}})),Ze("ceil",[xe],(function(t){return{type:xe,value:Math.ceil(t.value)}})),Ze("signum",[xe],wr),Ze("signum",[$e],wr),Ze("copySign",[xe,xe],$r),Ze("copySign",[$e,$e],$r),Ze("getColorAlpha",[we],Er),Ze("getColorAlpha",[Ee],Er),Ze("getColorRed",[we],Cr),Ze("getColorRed",[Ee],Cr),Ze("getColorGreen",[we],Fr),Ze("getColorGreen",[Ee],Fr),Ze("getColorBlue",[we],Ar),Ze("getColorBlue",[Ee],Ar),Ze("setColorAlpha",[we,xe],Vr),Ze("setColorAlpha",[Ee,xe],Vr),Ze("setColorRed",[we,xe],jr),Ze("setColorRed",[Ee,xe],jr),Ze("setColorGreen",[we,xe],Dr),Ze("setColorGreen",[Ee,xe],Dr),Ze("setColorBlue",[we,xe],Sr),Ze("setColorBlue",[Ee,xe],Sr),Ze("rgb",[xe,xe,xe],(function(t,e,r){const n={a:255,r:255*t.value,g:255*e.value,b:255*r.value};return{type:Ee,value:ur(n)}})),Ze("argb",[xe,xe,xe,xe],(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:Ee,value:ur(i)}}));const Pr={StringLiteral:function(t,e){return{type:we,value:e.value}},NumberLiteral:function(t,e){return{type:xe,value:e.value}},IntegerLiteral:function(t,e){return{type:$e,value:e.value}},BooleanLiteral:function(t,e){return{type:ke,value:e.value?1:0}},UnaryExpression:function(t,e){const r=Qe(Ir(t,e.argument));switch(e.operator){case"!":if(r.type===ke)return{type:ke,value:r.value?0:1};lr(`${e.operator}${rr(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const t="+"===e.operator?1:-1;if(r.type===$e)return{type:$e,value:r.value*t};if(r.type===xe)return{type:xe,value:r.value*t};lr(`${e.operator}${rr(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=Qe(Ir(t,e.test));if(r.type===ke)return r.value?Ir(t,e.consequent):Ir(t,e.alternate);lr(`${rr(r)} ? ${rr(Ir(t,e.consequent))} : ${rr(Ir(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 Ir(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=er(Ir(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:we,value:r}},LogicalExpression:function(t,e){const r=Qe(Ir(t,e.left));if(r.type!==ke&&lr(`${rr(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:ke,value:0};const n=Qe(Ir(t,e.right));return n.type!==ke&&lr(`${rr(r)} ${e.operator} ${rr(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${nr(n.type)}.`),{type:ke,value:n.value}},BinaryExpression:function(t,e){const r=e.operator,n=Ir(t,e.left),i=Ir(t,e.right);if(n.type!==i.type&&lr(`${rr(n)} ${e.operator} ${rr(i)}`,`Operator '${r}' cannot be applied to different types: ${nr(n.type)} and ${nr(i.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===Ce&&r.type===Ce?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:ke,value:n?1:0}}(r,n,i);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==xe&&e.type!==$e&&e.type!==Ce&&lr(`${rr(e)} ${t} ${rr(r)}`,`Operator '${t}' cannot be applied to ${nr(e.type)} type.`);const i=e.type===Ce?e.value.getTime():e.value,o=r.type===Ce?r.value.getTime():r.value;return n=">"===t?i>o:">="===t?i>=o:"<"===t?i<o:i<=o,{type:ke,value:n?1:0}}(r,n,i);if("+"===r||"-"===r)return function(t,e,r){if(e.type!==we&&e.type!==xe&&e.type!==$e&&lr(`${rr(e)} ${t} ${rr(r)}`,`Operator '${t}' cannot be applied to ${nr(e.type)} type.`),e.type===we)return"-"===t&&lr(`${rr(e)} - ${rr(r)}`,`Operator '${t}' cannot be applied to ${nr(e.type)} type.`),{type:we,value:e.value+r.value};let n="+"===t?e.value+r.value:e.value-r.value;return e.type===$e&&(n=or(n)),{type:e.type,value:n}}(r,n,i);if("/"===r||"*"===r||"%"===r)return function(t,e,r){let n;if(e.type!==$e&&e.type!==xe&&lr(`${rr(e)} ${t} ${rr(r)}`,`Operator '${t}' cannot be applied to ${nr(e.type)} type.`),"*"===t)n=e.value*r.value;else{if("/"!==t&&"%"!==t)throw new Error(`Unsupported operation ${t}`);0===r.value&&lr(`${rr(e)} ${t} ${rr(r)}`,"Division by zero is not supported."),n="/"===t?e.value/r.value:e.value%r.value}return e.type===$e&&(n=or(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(!Ge.has(r))throw new Error(`Unknown function name: ${r}.`);let n;const i=e.arguments.map((e=>Ir(t,e))),o=r+":"+i.map((t=>t.type)).join("#");if(Ye.has(o))n=Ye.get(o);else{const t=function(t,e){const r=Ge.get(t);if(!r)throw new Error("Missing function");let n=null;for(let t=0;t<r.length;++t){const i=Xe(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=>nr(t.type))).join(", "),n=`${r}(${zr(i)})`;"few"===t.type&&0===i.length?lr(n,`Non empty argument list is required for function '${r}'.`):(t.type,lr(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){lr(`${r}(${zr(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 Ir(t,e){if(e.type in Pr)return Pr[e.type](t,e);throw new Error("Unsupported expression")}function Mr(t,e){try{return Ir(t,e)}catch(t){return{type:"error",value:t.message}}}class Or{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return Ke(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=Mr(t,this.ast);if("error"===r.type)return void e(q(new Error("Expression execution error"),{additional:{message:r.value}}));const n=r.value;return n instanceof Date?tr(n):"boolean"===r.type?Boolean(n):n}catch(t){return void e(q(new Error("Expression execution error")))}}}function Jr(t,e,r){if(t)if("string"==typeof t){if((n=t).indexOf("@{")>-1||n.indexOf("\\")>-1){e.hasExpression=!0;try{const r=He(t,{startRule:"JsonStringContents"}),n=sr(r);return e.vars.push(...n),new Or(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=>Jr(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=Jr(t[i],e,r);return n}}var n;return t}function Nr(t,e,r){if(t){if(t instanceof Or)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>Nr(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=Nr(t[i],e,r);return n}}return t}function Tr(t,e){const r={vars:[],hasExpression:!1},n=Jr(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>Nr(n,t,e)}}const Br={pagers:function(){return W(new Map)}},Ur=new Map,Wr=new Map;function Rr(t){const e=Ur.get(t)||W("");return Ur.has(t)||Ur.set(t,e),e}function Lr(t){const e=Wr.get(t)||new Map;return Wr.has(t)||Wr.set(t,e),e}class qr{setVariable(t){const e=t.getName(),r=Lr(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Rr(this).set(e)}getVariable(t){return Lr(this).get(t)}}function Hr(){return new qr}const Gr=J(((t,e,r,n)=>{let i,o;var s,l,c;let{id:u}=e,{json:v={}}=e,{platform:g="auto"}=e,{theme:p="system"}=e,{globalVariablesController:f=new qr}=e,{onError:h}=e,{onStat:m}=e,{onCustomAction:y}=e,{onComponent:_}=e,b=W("desktop"===g);if(o=a(b,(t=>i=t)),"auto"===g&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");b.set(!t.matches),t.addListener((()=>{b.set(!t.matches)}))}let w="light";if("light"===p||"dark"===p)w=p;else if("system"===p)if("undefined"!=typeof matchMedia){const t=matchMedia("(prefers-color-scheme: dark)");w=t.matches?"dark":"light",t.addListener((()=>{w=t.matches?"dark":"light",Q&&Q[w].forEach((t=>{const e=V.get(t.name);e&&e.setValue(t.color)}))}))}else w="light";else M(q(new Error("Unsupported theme")));let $=!1;v||($=!0,M(q(new Error('"json" prop is required')))),u||($=!0,M(q(new Error('"id" prop is required'))));let x=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 ze)return q(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return q(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return q(new Error("Missing state_id"),{additional:{index:t}})}return null}(v);const k=v.templates||{};x&&($=!0,M(x));const E={stateChange:!1},C=Rr(f),F=Lr(f),A=new Map,V=new Map,D=new Map;function S(t,e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e){const r=V.get(t);r&&r.setValue(e)}}function z(t){const e=V.get(t);return null==e?void 0:e.getValue()}function P(t){const e=Tr(t,M);return e.vars.length?e.applyVars(V):t}function M(t){h?h({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}let O=0;function J(t){return`${u}-${O++}`}let N={},T={};function B(t){const e=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=Z,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=H(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=H(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=H(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=V.get(r);t?t.set(i):M(q(new Error("Cannot find variable"),{additional:{name:r}}))}else M(q(new Error("Incorrect set_variable_action"),{additional:{url:t}}));break;default:M(q(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){M(q(t,{additional:{url:e}}))}}const U=new Map;function H(t){if(U.has(t))return U.get(t);M(q(new Error("Missing instance with id"),{additional:{id:t}}))}const G=new Map;function Y(t){for(const e of t)V.has(e)&&t.delete(e);return t}d(L,{logError:M,logStat:function(t,e){m&&m({type:t,action:e})},hasTemplate:function(t){return t in k},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in k;){if(({json:t,templateContext:e}=Oe(t,e,k,M)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:J,genClass:function(t){return`divkit-${J()}`},execAction:B,execCustomAction:function(t){null==y||y(t)},isRunning:function(t){return E[t]},setRunning:function(t,e){E[t]=e},registerInstance:function(t,e){U.has(t)?M(q(new Error("Duplicate instance id"),{additional:{id:t}})):U.set(t,e)},unregisterInstance:function(t){U.delete(t)},addSvgFilter:function(t){if(T[t]=T[t]||0,++T[t],N[t])return N[t];const e=`${J()}-svg-filter`;return N=Object.assign(Object.assign({},N),{[t]:e}),e},removeSvgFilter:function(t){t&&T[t]&&0==--T[t]&&(N=Object.keys(N).reduce(((t,e)=>(T[e]&&(t[e]=N[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return Ne(t);const e=Tr(t,M);return e.vars.length?R(e.vars.map((t=>V.get(t)||function(t){const e=D.get(t)||W(void 0);return D.has(t)||D.set(t,e),e}(t))).filter(rt),(()=>e.applyVars(V))):e.hasExpression?Ne(e.applyVars(V)):Ne(t)},getJsonWithVars:P,getStore:function(t){return G.has(t)||function(t){G.has(t)||G.set(t,Br[t]())}(t),G.get(t)},getVariable:function(t,e){const r=V.get(t);if(r){const n=r.getType();if(n!==e)return void M(q(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:n}}))}return r},isDesktop:b,registerComponent:void 0,unregisterComponent:void 0}),d(xt,{hasAction:()=>!1});const Z={setState(t){throw new Error("Not implemented")},getChild(t){if(X&&X.has(t))return X.get(t);M(q(new Error("Missing state block with id"),{additional:{id:t}}))}};let X=null;d(gt,{registerInstance(t,e){X||(X=new Map),X.has(t)?M(q(new Error("Duplicate state with id"),{additional:{id:t}})):X.set(t,e)},unregisterInstance(t){null==X||X.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 K=null===(s=null==v?void 0:v.card)||void 0===s?void 0:s.variables;Array.isArray(K)&&K.forEach((t=>{if(t&&t.type in Ae&&t.name){if(A.has(t.name))return void M(q(new Error("Duplicate variable"),{additional:{name:t.name}}));try{const e=Ve(t.name,t.type,t.value);A.set(t.name,e),V.set(t.name,e)}catch(e){M(q(e,{additional:{name:t.name}}))}}}));const Q=v.palette;Q&&Q[w].forEach((t=>{if(A.has(t.name))M(q(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=Ve(t.name,"color",t.color);A.set(t.name,e),V.set(t.name,e)}catch(e){M(q(e,{additional:{name:t.name}}))}}));for(const[t,e]of F)V.has(t)||V.set(t,e);C.subscribe((t=>{if(t&&!V.has(t)){const e=F.get(t);V.set(t,e);const r=D.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const tt=null===(l=null==v?void 0:v.card)||void 0===l?void 0:l.variable_triggers;Array.isArray(tt)&&tt.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void M(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=He(t.condition,{startRule:"JsonStringContents"}),i=sr(n);if(!i.length)return void M(q(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return Y(e),e.size?new Promise((t=>{const r=C.subscribe((()=>{Y(e),e.size||(r(),t())}))})):Promise.resolve()})(i).then((()=>{R(i.map((t=>V.get(t))).filter(rt),(()=>Mr(V,n))).subscribe((n=>{"error"!==n.type?(n.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=P(t);e.log_id&&B(e)})),e=Boolean(n.value)):M(q(new Error("variable_trigger condition execution error"),{additional:{message:n.value}}))}))}))}catch(e){M(q(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else M(q(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));const et=null===(c=v.card)||void 0===c?void 0:c.states,nt=et&&!$?{type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:et.map((t=>({state_id:t.state_id.toString(),div:t.div})))}:void 0;return void 0===e.id&&r.id&&void 0!==u&&r.id(u),void 0===e.json&&r.json&&void 0!==v&&r.json(v),void 0===e.platform&&r.platform&&void 0!==g&&r.platform(g),void 0===e.theme&&r.theme&&void 0!==p&&r.theme(p),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==f&&r.globalVariablesController(f),void 0===e.onError&&r.onError&&void 0!==h&&r.onError(h),void 0===e.onStat&&r.onStat&&void 0!==m&&r.onStat(m),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==y&&r.onCustomAction(y),void 0===e.onComponent&&r.onComponent&&void 0!==_&&r.onComponent(_),void 0===e.setVariable&&r.setVariable&&void 0!==S&&r.setVariable(S),void 0===e.getVariable&&r.getVariable&&void 0!==z&&r.getVariable(z),void 0===e.execAction&&r.execAction&&void 0!==B&&r.execAction(B),o(),!$&&nt?`<div class="${j("divkit-b023",!0)+j(i?" divkit-ee11":"",!0)}">${I(Me,"RootSvgFilters").$$render(t,{svgFiltersMap:N},{},{})}\n ${I(Ie,"Unknown").$$render(t,{div:nt,templateContext:{}},{},{})}</div>`:""}));function Yr(t){return Gr.render({id:t.id,json:t.json,globalVariablesController:t.globalVariablesController,onError:t.onError,platform:t.platform}).html}var Zr=e.M,Xr=e.Os,Kr=e.sY;export{Zr as createGlobalVariablesController,Xr as createVariable,Kr as render};
2
2
  //# sourceMappingURL=server.mjs.map