@divkitframework/divkit 8.0.0 → 9.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.
- package/dist/browser/client-devtool.js +1 -1
- package/dist/browser/client-devtool.js.map +1 -1
- package/dist/browser/client-hydratable.js +1 -1
- package/dist/browser/client-hydratable.js.map +1 -1
- package/dist/browser/client.js +1 -1
- package/dist/browser/client.js.map +1 -1
- package/dist/client-devtool.js +1 -1
- package/dist/client-devtool.js.map +1 -1
- package/dist/client-hydratable.js +1 -1
- package/dist/client-hydratable.js.map +1 -1
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/esm/client-devtool.mjs +1 -1
- package/dist/esm/client-devtool.mjs.map +1 -1
- package/dist/esm/client-hydratable.mjs +1 -1
- package/dist/esm/client-hydratable.mjs.map +1 -1
- package/dist/esm/client.mjs +1 -1
- package/dist/esm/client.mjs.map +1 -1
- package/dist/esm/server.mjs +1 -1
- package/dist/esm/server.mjs.map +1 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/server.mjs
CHANGED
|
@@ -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:()=>Rr,Os:()=>Ce,sY:()=>qr}),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?"&":'"'===e?""":"<"),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,"&")),e.indexOf("<")>-1&&(e=e.replace(/</g,"<")),e.indexOf(">")>-1&&(e=e.replace(/>/g,">")),e.indexOf('"')>-1&&(e=e.replace(/"/g,""")),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:it(t.bg.scale),pos:ot(t.bg),image:'url("'+et(r)+'")'}}({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(",")}}function it(t){return"fill"!==t&&t?"fit"===t?"contain":void 0:"cover"}function ot(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 at(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}const st=new Set(["http","https","tel","mailto","intent"]);function lt(t){return st.has(t)}function ct(t,e){e&&t.push(e)}function ut(t,e,r){const n=[];ct(n,e[t]);for(const i in r)if(r.hasOwnProperty(i)){const o=r[i];o&&ct(n,e[`${t}_${i}`+("string"==typeof o?`_${o}`:"")])}return n.join(" ")}const dt=Symbol("state");function vt(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function gt(t){return vt(t)&&t>=0}function pt(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]&&!gt(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 ht(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]&&!gt(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 ft(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const mt=Object.prototype.hasOwnProperty;function yt(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(!mt.call(e,i)||!yt(t[i],e[i]))return!1}return!0}function _t(t,e){return yt(t,e)?e:t}function bt(){}const wt=Symbol("action"),$t=J(((t,e,r,n)=>{let{actions:i}=e,{cls:o=""}=e,{style:a=null}=e,{attrs:s}=e,{use:l=bt}=e,{customAction:c=null}=e,{hasActionAnimation:u=!1}=e;const g=v(W),p=v(wt);d(wt,{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&&!lt(at(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>`})),xt=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 kt(t,e){const r=Number(t);return isNaN(r)?e:r}const Ct=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,st=r,ct=r,vt=r,mt=r,yt=r,bt=r,wt=r,Ct=r;var Ft,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(dt);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),Ct(),Ct=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===(Ft=e.offset)||void 0===Ft?void 0:Ft.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=ft(R.stroke.width,ne),ie=Q(R.stroke.color,1,ie),e.border=`${Z(ne)} solid ${ie}`),R.corners_radius?(ae=pt(R.corners_radius,0,10,ae),e["border-radius"]=t["border-radius"]=ae):R.corner_radius&&(oe=ft(R.corner_radius,oe),e["border-radius"]=t["border-radius"]=Z(oe))}te=_t(t,te),ee=_t(e,ee),re=r}s=Wt.getDerivedFromVars(St.paddings),wt(),wt=a(s,(t=>L=t)),se=ht(L&&!Nt?L:void 0,se),l=Wt.getDerivedFromVars(St.margins),yt(),yt=a(l,(t=>U=t)),le=ht(U,le),c=Wt.getDerivedFromVars(St.width),vt(),vt=a(c,(t=>J=t)),u=Wt.getDerivedFromVars(St.alignment_horizontal),bt(),bt=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=ft(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=_t(r,ce)}d=Wt.getDerivedFromVars(St.height),ct(),ct=a(d,(t=>O=t)),g=Wt.getDerivedFromVars(St.alignment_vertical),mt(),mt=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=ft(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=_t(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),st(),st=a(m,(t=>I=t)),Oe=me,me=!gt(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=kt(e.start_value,1),i=kt(e.end_value,1),o=ft(e.start_delay,0),a=ft(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=kt(t.value,ze);const e="pivot-fixed"===t.type?Z(ze):`${ze}%`,r=A.pivot_y||{type:"pivot-percentage",value:50};Me=kt(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(),st(),ct(),vt(),mt(),yt(),bt(),wt(),Ct(),`${M($t,"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=at(n);t&&!lt(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+" "+ut("outer",G,C),style:Y(E),actions:je,attrs:Gt,hasActionAnimation:Boolean(De)},{},{default:()=>`${Qt?`${M(xt,"OuterBackground").$$render(t,{background:P},{},{})}`:""}${i.default?i.default({}):""}${re?`<span${N("class",G.outer__border,0)}${N("style",Y(ee),0)}></span>`:""}`})}`})),Ft={"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 Et(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function At(t){return vt(t)&&t>0}function Vt(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function jt(t,e){return Vt(t)||e}const Dt=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=Et(u.font_size,p),At(u.line_height)&&(h=Number(u.line_height)/p),gt(u.letter_spacing)&&(f=Z(u.letter_spacing)),s=jt(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",Ft["text-range__top-offset"],0)}${U({"margin-top":i})}></span>`:""}${M($t,"Actionable").$$render(t,{cls:ut("text-range",Ft,o),actions:v,style:Y(a)},{},{default:()=>`${j(l)}`})}`}));function St(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Pt(t,e){return"top"===t||"center"===t||"bottom"===t?t:e}const zt=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,dt=r,vt=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,Ft=1.25,Vt=!1,jt="",zt="",Mt=!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=Et(X,kt),g=wt.getDerivedFromVars(mt.line_height),pt(),pt=a(g,(t=>G=t));{const t=G;At(t)?(Ft=Number(t)/kt,Vt=!0):Vt=!1}p=wt.getDerivedFromVars(mt.max_lines),dt(),dt=a(p,(t=>B=t)),h=1===B;{let t="",e="",r=!1;if(B&&B>1){let n=Number(B);t=n*Ft+"em",z||S||(e=n,r=!0)}jt=t,zt=e,Mt=r}f=wt.getDerivedFromVars(mt.text_alignment_horizontal),gt(),gt=a(f,(t=>R=t)),It=St(R,It),m=wt.getDerivedFromVars(mt.text_alignment_vertical),vt(),vt=a(m,(t=>L=t)),Ot=Pt(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:Mt,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":Ft,"max-height":jt,"-webkit-line-clamp":zt,color:Jt,"background-image":Nt},tt(),et(),rt(),it(),ot(),at(),st(),lt(),ct(),dt(),vt(),gt(),pt(),ht(),ft(),$t?"":`${M(Ct,"Outer").$$render(t,{cls:ut("text",H,E)+" "+(Tt?"":"divkit-c016"),json:mt,origJson:_t,templateContext:yt,layoutParams:bt},{},{default:()=>`<span${N("class",ut("text__inner",H,A),0)}${N("style",Y(V),0)}>${Ut.length?`${P(Ut,((e,r)=>"text"in e?e.text?`${M(Dt,"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":Vt?`-${e.image.height}`:void 0,"margin-bottom":Vt?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${M(Dt,"TextRangeView").$$render(t,{text:xt,rootFontSize:kt,textStyles:I,singleline:h},{},{})}`}</span>`})}`})),Mt=zt,It={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"},Ot=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=Pt(y,I),u=D.getDerivedFromVars(C.content_alignment_horizontal),$(),$=a(u,(t=>m=t)),O=St(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=_t(t,J)}return p={orientation:z,valign:I,halign:O},b(),w(),$(),x(),k(),S?"":`${M(Ct,"Outer").$$render(t,{cls:ut("container",It,p),json:C,origJson:E,templateContext:F,layoutParams:A},{},{default:()=>`${P(s,(e=>`${M(De,"Unknown").$$render(t,{layoutParams:J,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),Jt={separator:"divkit-a30b",separator_orientation_horizontal:"divkit-f529",separator_orientation_vertical:"divkit-e9e2",separator__inner:"divkit-db7d"};function Nt(t,e){return"vertical"===t||"horizontal"===t?t:e}const Tt=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=Nt(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(Ct,"Outer").$$render(t,{cls:ut("separator",Jt,d),json:h,origJson:m,templateContext:f,layoutParams:y},{},{default:()=>s?`<span${N("class",Jt.separator__inner,0)}${N("style",Y(u),0)}></span>`:""})}`})),Ut={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"},Bt=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:at}=e,{layoutParams:st}=e;const lt=v(W);let ct,dt=!1,vt=!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!==at&&n.origJson(at),void 0===e.layoutParams&&n.layoutParams&&void 0!==st&&n.layoutParams(st),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,vt=!0,dt=!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=it(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:ot(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&&At(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(Ct,"Outer").$$render(t,{cls:ut("image",Ut,x),json:rt,origJson:at,templateContext:nt,layoutParams:st,customDescription:!0},{},{default:()=>x.aspect?`<span${N("class",Ut["image__aspect-wrapper"],0)}${U({"padding-bottom":`${yt}%`})}><img${N("class",Ut.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",Ut.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)}>`})}`})),Lt={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 Rt(t){return t>0&&t<1}function Wt(t){return String(Math.ceil(1e3*t)/1e3)}function qt(t,e,r){if(t.some(Rt)){const e=Math.max(...t.filter(Rt).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)},${Wt(t[e])}fr)`:t[e]?o[e]=`${Wt(t[e])}fr`:o[e]="auto";return o.join(" ")}const Ht=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=Et(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=Pt(f,T),u=E.getDerivedFromVars(x.content_alignment_horizontal),_(),_=a(u,(t=>h=t)),U=St(h,U),d={valign:T,halign:U},g={"grid-template-columns":qt(S,I,D),"grid-template-rows":qt(z,O,J)},p=j||N,_(),b(),w(),$(),p?"":`${M(Ct,"Outer").$$render(t,{cls:ut("grid",Lt,d),json:x,origJson:C,templateContext:k,style:g,layoutParams:F},{},{default:()=>`${P(V,(e=>`${M(De,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),Gt=Ht,Yt={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 Zt(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 Xt=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={},dt=0;function vt(){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=vt(),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=vt();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=vt();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=vt();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=Et(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=Nt(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=ft(C,it),X=Z(it),p=H.getDerivedFromVars(T.paddings),S(),S=a(p,(t=>k=t)),ot=ht(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=_t(t,st),ct=_t(e,ct)}return m={padding:ot,"grid-gap":X},y={"grid-gap":X,[h]:Zt(at)},_={orientation:rt,"scroll-snap":lt},b=H.getDerivedFromVars(T.default_item),V(),V=a(b,(t=>w=t)),dt=ft(w,dt),V(),j(),D(),S(),z(),I(),O(),J(),tt?"":`${M(Ct,"Outer").$$render(t,{cls:ut("gallery",Yt,_),json:T,origJson:B,templateContext:U,layoutParams:L,customPaddings:!0,customActions:"gallery",forceHeight:"vertical"===rt,forceWidth:"horizontal"===rt},{},{default:()=>`<div${N("class",Yt.gallery__scroller,0)}${N("style",Y(st),0)}${N("this",G,0)}><div${N("class",Yt["gallery__items-grid"],0)}${N("style",Y(m),0)}>${P(c,((e,r)=>`<div${N("class",Yt.gallery__items,0)}${N("style",Y(y),0)}${N("this",Q[r],0)}>${P(e,(e=>`${M(De,"Unknown").$$render(t,{layoutParams:ct,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===rt?"\n ":""}`})}`})),Kt=Xt,Qt={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"},te=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="",dt="",vt="",ft="",mt="",yt="",bt="",wt=!1,xt=!1,kt=it,Ft=[],Vt=[];async function Dt(t,e=!1){if(kt=it,it=t,wt||(wt=!0,G.style.height=Z(G.clientHeight),X.style.transform=`translate3d(${100*-kt}%,0,0)`),xt=!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,kt),r=t?Math.min(o.length-1,it+1):Math.max(it,kt);Ft=Ft.map(((t,n)=>t||n>=e&&n<=r)),Vt=Vt.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((()=>{Vt=o.map(((t,e)=>e===it))}),400),St=-it*G.clientWidth,e){await _();const t=H.querySelector(`.${Qt.tabs__item_selected}`);t&&t.focus()}}let St,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');Dt(t)},setPreviousItem(t){let e=it-1;e<0&&(e="ring"===t?o.length-1:it),Dt(e)},setNextItem(t){let e=it+1;e>o.length-1&&(e="ring"===t?0:it),Dt(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=_t(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=Et(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=ht(e,at)}{const t=u.line_height;void 0!==t&&At(t)&&(st=Z(t/ot*10))}{const t=u.letter_spacing;void 0!==t&>(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=pt(u.corners_radius,t,ot,ct):gt(t)&&(ct=Z(t/ot*10))}return rt=jt(u.active_font_weight||u.font_weight,rt),nt=jt(u.inactive_font_weight||u.font_weight,nt),dt=Q(u.active_text_color,1,dt),vt=Q(u.inactive_text_color,1,vt),ft=Q(u.active_background_color,1,ft),mt=Q(u.inactive_background_color,1,mt),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&&(bt=ht(b,bt))),h={background:yt,margin:bt},f=L.getDerivedFromVars(O.switch_tabs_by_content_swipe_enabled),F(),F=a(f,(t=>y=t)),m=void 0===y||Boolean(y),K||(Ft=o.map(((t,e)=>e===it)),Vt=o.map(((t,e)=>e===it))),F(),E(),A(),V(),D(),S(),z(),K?"":`${M(Ct,"Outer").$$render(t,{cls:ut("tabs",Qt,{}),json:O,origJson:T,templateContext:J,layoutParams:B,customActions:"tabs"},{},{default:()=>`<div${N("class",Qt.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":dt,"--divkit-tabs-inactive-text-color":vt,"--divkit-tabs-active-background-color":ft,"--divkit-tabs-inactive-background-color":mt,"--divkit-tabs-border-radius":ct})}${N("this",H,0)}>${P(o,((e,r)=>{let n=r===it;return`\n\n ${M($t,"Actionable").$$render(t,{cls:ut("tabs__item",Qt,{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||(Dt(e),!1)}(0,r)},{},{default:()=>`${j(e.title)}\n `})}`}))}</div>\n ${$?`<div${N("class",Qt.tabs__separator,0)}${N("style",Y(h),0)}></div>`:""}\n <div${N("class",Qt.tabs__panels,0)}${N("this",G,0)}><div${N("class",ut("tabs__swiper",Qt,{inited:wt,animated:xt}),0)}${N("this",X,0)}>${P(o,((e,r)=>`<div${N("class",ut("tabs__panel",Qt,{visible:Vt[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)+"%"}">${Ft[r]?`${M(De,"Unknown").$$render(t,{div:e.div,templateContext:J,layoutParams:tt},{},{})}`:""}\n </div>`))}</div></div>`})}`})),ee=te;function re(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)}}re([.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]),re([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 ne=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(dt).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(dt,{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(Ct,"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(De,"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(De,"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(De,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext},{},{})}</div>\n </div>`))}</div>`}})}`})),ie={pager:"divkit-c5fe",pager__items:"divkit-f698",pager__item:"divkit-feca",pager_orientation_horizontal:"divkit-b0a1",pager_orientation_vertical:"divkit-f772"},oe=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=Nt(w,K),c=U.getDerivedFromVars(I.item_spacing),C(),C=a(c,(t=>b=t));{const t=null==b?void 0:b.value;t&>(t)&&(Q=Z(t||0))}if(u=U.getDerivedFromVars(I.paddings),k(),k=a(u,(t=>_=t)),tt=ht(_,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(Ct,"Outer").$$render(t,{cls:ut("pager",ie,p),json:I,origJson:J,templateContext:O,layoutParams:T,customPaddings:!0},{},{default:()=>`<div${N("class",ie.pager__items,0)}${N("style",Y(g),0)}${N("this",L,0)}>${P(o,(e=>`<div${N("class",ie.pager__item,0)}>${M(De,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}\n </div>`))}</div>`})}`})),ae=oe,se={indicator:"divkit-d8e3",indicator__scroller:"divkit-b5db",indicator__items:"divkit-d5d9",indicator__item:"divkit-f662",indicator__item_active:"divkit-b39c"},le=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=ft(y.item_width.value,O)),y.item_height&&(J=ft(y.item_height.value,J)),y.corner_radius&&(T=ft(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=ft(h.value,R)),u=D.getDerivedFromVars(F.active_item_size),w(),w=a(u,(t=>p=t)),q=Et(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(Ct,"Outer").$$render(t,{cls:ut("indicator",se,{}),json:F,origJson:A,templateContext:E,layoutParams:V},{},{default:()=>`<div${N("class",se.indicator__scroller,0)}${N("this",S,0)}><div${N("class",se.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(ut("indicator__item",se,{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>`})}`})),ce=le,ue={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 de(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 ve(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&Q(t.text_color)||"#000",i=Vt(t.font_weight);if(At(t.font_size)&&"transparent"!==n){var o,a;const e={fontSize:Z(t.font_size),fontWeight:i,textColor:n};return"number"==typeof(null==r||null===(o=r.x)||void 0===o?void 0:o.value)&&"number"==typeof(null==r||null===(a=r.y)||void 0===a?void 0:a.value)&&(e.offset={x:r.x.value,y:r.y.value}),e}}function ge(t,e,r){return Math.max(e,Math.min(r,t))}const pe=-2147483648,he=Number.MAX_VALUE,fe=Number.MIN_VALUE,me="string",ye="integer",_e="number",be="boolean",we="color",$e="datetime";class xe{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 ke={string:class extends xe{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends xe{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 xe{convertValue(t){if("number"!=typeof t||isNaN(t)||t>2147483647||t<pe||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 xe{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 xe{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 xe{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function Ce(t,e,r){if(!(e in ke))throw new Error("Unsupported variable type");return new ke[e](t,r)}function Fe(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 Ee=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,dt=r,vt=r,pt=r,ht=r;var ft,mt,yt,_t,bt,$t,xt,Ft;let{json:Et={}}=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(wt);let zt=0,Mt=100;const It=St.getJsonWithVars(Et.thumb_value_variable),Ot=St.getJsonWithVars(Et.thumb_secondary_value_variable);Q=a(It&&St.getVariable(It,"integer")||Ce("temp","integer",0),(t=>K=t)),Y=a(Ot&&St.getVariable(Ot,"integer")||Ce("temp","integer",0),(t=>G=t));let Jt,Nt,Tt,Ut=ge(K||0,zt,Mt),Bt=ge(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!==Et&&n.json(Et),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(Et.min_value),ht(),ht=a(o,(t=>et=t)),s=St.getDerivedFromVars(Et.max_value),pt(),pt=a(s,(t=>tt=t)),zt=kt(et,zt),Mt=kt(tt,Mt);{const t=ge(K||0,zt,Mt);t!==Ut&&(Ut=t)}{const t=ge(G||0,zt,Mt);t!==Bt&&(Bt=t)}if(l=St.getDerivedFromVars(Et.thumb_style),vt(),vt=a(l,(t=>H=t)),Lt=de(H,Lt),c=St.getDerivedFromVars(Et.thumb_secondary_style),dt(),dt=a(c,(t=>R=t)),Rt=de(R,Lt),u=St.getDerivedFromVars(Et.track_inactive_style),ct(),ct=a(u,(t=>L=t)),Wt=de(L,Wt),d=St.getDerivedFromVars(Et.track_active_style),lt(),lt=a(d,(t=>B=t)),qt=de(B,qt),g=Mt-zt+1<=20,p=St.getDerivedFromVars(Et.tick_mark_active_style),st(),st=a(p,(t=>T=t)),g){let t=de(T,Dt);t!==Dt&&(Ht=t)}else Ht=null;if(Jt=Ht?Ot?Fe(Math.min(Ut,Bt),Math.max(Ut,Bt)+1,zt,Mt,!0):Fe(zt,Ut,zt,Mt,!0):[],h=St.getDerivedFromVars(Et.tick_mark_inactive_style),at(),at=a(h,(t=>J=t)),g){let t=de(J,Dt);t!==Dt&&(Gt=t)}else Gt=null;Nt=Gt?Ot?Fe(Math.min(Ut,Bt),Math.max(Ut,Bt)+1,zt,Mt,!1):Fe(Ut+1,Mt+1,zt,Mt,!0):[],f=St.getDerivedFromVars(Et.thumb_text_style),ot(),ot=a(f,(t=>O=t)),Tt=ve(O,Tt),m=St.getDerivedFromVars(Et.thumb_secondary_text_style),it(),it=a(m,(t=>I=t)),Yt=ve(I,Tt),y=St.getDerivedFromVars(Et.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(Et.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(gt)),w=Z(Math.max(...[Lt.width,Rt.width,0].filter(gt))),$=Z(Math.max(...[Lt.height,Rt.height,0].filter(gt))),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===($t=null==Tt?void 0:Tt.offset)||void 0===$t?void 0:$t.y)?X(Tt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(xt=null==Yt?void 0:Yt.offset)||void 0===xt?void 0:xt.x)?X(Yt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(Ft=null==Yt?void 0:Yt.offset)||void 0===Ft?void 0:Ft.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(),dt(),vt(),Y(),Q(),pt(),ht(),Kt?"":`${M(Ct,"Outer").$$render(t,{cls:ut("slider",ue,D),style:V,customDescription:!0,customActions:"slider",json:Et,origJson:Vt,templateContext:At,layoutParams:jt},{},{default:()=>{var t,e,r,n,i,o;return`<div${N("class",ue["slider__tracks-wrapper"],0)}>${Tt||Ot&&Yt?`<div${N("class",ue["slider__thumb-text-wrapper"],0)} aria-hidden="true">${Tt?`<div${N("class",ue["slider__thumb-text"],0)}><div${N("class",ue["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(ue["slider__thumb-text"],!0)+" "+j(ue["slider__thumb-text_secondary"],!0)}"><div${N("class",ue["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",ue["slider__tracks-inner"],0)}${N("this",undefined,0)}><div${N("class",ue.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",ue["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(ue.slider__tick,!0)+" "+j(ue.slider__tick_active,!0)}"${U({"--divkit-slider-tick":t})}></div>`))}\n ${P(Nt,(t=>`<div class="${j(ue.slider__tick,!0)+" "+j(ue.slider__tick_inactive,!0)}"${U({"--divkit-slider-tick":t})}></div>`))}\n <div${N("class",ue.slider__thumb,0)}${U({"border-radius":Z(Lt.borderRadius),background:Lt.background,"box-shadow":Lt.boxShadow||""})}></div>\n ${Ot?`<div class="${j(ue.slider__thumb,!0)+" "+j(ue.slider__thumb_secondary,!0)}"${U({"border-radius":Z(Rt.borderRadius),background:Rt.background,"box-shadow":Rt.boxShadow||""})}></div>`:""}\n <input type="range"${N("class",ue.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",`${ue.slider__input} ${ue.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>`}})}`})),Ae={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"},Ve={text:Mt,container:Ot,separator:Tt,image:Bt,gif:Bt,grid:Gt,gallery:Kt,tabs:ee,state:ne,pager:ae,indicator:ce,slider:Ee,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")||Ce("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 dt="";y=a(K.getDerivedFromVars(R.keyboard_type),(t=>m=t));const gt={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let pt="multi_line_text",ht="text";f=a(K.getDerivedFromVars(R.max_visible_lines),(t=>h=t));let mt="",yt="";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=Et(V,st),ot=jt(E,ot);{const t=C;At(t)&&(at=t/st)}return vt(x)&&(lt=Z(x/st*10)),ct=Q(w,1,ct),dt=Q(_,1,dt),m&&m in gt&&(ht=gt[m],pt=m),s="multi_line_text"===pt,l=K.getDerivedFromVars(R.paddings),L(),L=a(l,(t=>p=t)),At(h)&&(mt=`calc(${h*(at||1.25)+"em"} + ${X(ft(null==p?void 0:p.top,0)+ft(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)?yt=g.description:K.logError(q(new Error('Missing accessibility "description" for input'),{level:"warn"})),u={"highlight-color":Boolean(dt),"vertical-overflow":!1,multiline:s},d={"--divkit-input-hint-color":it,"--divkit-input-highlight-color":dt,"font-size":Z(st),"font-weight":ot,"line-height":at,"letter-spacing":lt,color:ct,"max-height":mt},B(),L(),f(),y(),b(),$(),k(),F(),A(),D(),P(),I(),J(),U(),rt?"":`${M(Ct,"Outer").$$render(t,{cls:ut("input",Ae,u),style:d,customDescription:!0,customActions:"input",json:R,origJson:G,templateContext:H,layoutParams:Y},{},{default:()=>`<span${N("class",Ae.input__wrapper,0)}><span${N("class",Ae.input__holder,0)} aria-hidden="true"${N("this",undefined,0)}>\n ${j(nt)}${nt.endsWith("\n")||!nt?"":""}</span>\n ${s?`<textarea${N("class",Ae.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",yt,0)}${N("placeholder",o,0)}${N("this",tt,0)}>${j(nt,!0)}</textarea>`:`<input${N("type",ht,0)}${N("class",Ae.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",yt,0)}${N("placeholder",o,0)}${N("value",nt,0)}${N("this",tt,0)}>`}</span>`})}`}))},je=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&&Ve[c.type]||void 0,!d&&(({templateContext:u,json:c}=l.processTemplate(c,u)),d=c&&Ve[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},{},{})}`:""})),De=je,Se=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 Pe(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 ze(){}function Me(t){return{subscribe:e=>(e(t),ze)}}function Ie(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function Oe(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function Je(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 Ne(t){var e=parseInt(t,10);if(e>2147483647||e<pe)throw new Error(`Value ${t} can't be converted to Integer type.`);return e}function Te(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function Ue(t,e,r,n){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,Ue.prototype),i.expected=e,i.found=r,i.location=n,i.name="SyntaxError",i}function Be(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function Le(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 Je(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=Te(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=Oe(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=Oe(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=Ie(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=Ie(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=Ie(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=Ie(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=Je(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=Te(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:Ne(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 Ue(Ue.buildMessage(n,i),n,i,o)}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(Ue,Error),Ue.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=Be("",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+" | "+Be("",i.column-1," ")+Be("",c,"^")}else e+="\n at "+o}return e},Ue.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 Re=new Map,We=new Map;function qe(t,e,r){const n={args:e,cb:r},i=Re.get(t)||[];Re.has(t)||Re.set(t,i),i.push(n);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");We.set(o,n)}function He(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 Ge(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=>{Ge(t,e)}));break;case"BinaryExpression":case"LogicalExpression":Ge(t.left,e),Ge(t.right,e);break;case"UnaryExpression":Ge(t.argument,e);break;case"ConditionalExpression":Ge(t.test,e),Ge(t.consequent,e),Ge(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{Ge(t,e)}))}}function Ye(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function Ze(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function Xe(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 Ze(t.value);if("color"===t.type)return ar(or(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function Ke(t){let e=Xe(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function Qe(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}const tr=new Int32Array(1);function er(t){return tr[0]=t,tr[0]}function rr(t){if(t<pe||t>2147483647)throw new Error("Integer overflow.")}function nr(t){const e=[];return Ge(t,{Variable(t){e.push(t.id.name)}}),e}function ir(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function or(t){const e=tt(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function ar(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 sr(t){return{type:me,value:Xe(t)}}function lr(t){const e=Number(t.value);if(isNaN(e)||!Number.isFinite(e))throw new Error("Unable to convert value to Number.");return{type:_e,value:e}}function cr(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value/e.value;return t.type===ye&&(r=er(r)),{type:t.type,value:r}}function ur(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value%e.value;return t.type===ye&&(r=er(r)),{type:t.type,value:r}}function dr(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e*=t[r].value,t[0].type===ye&&(e=er(e));return{type:t[0].type,value:e}}function vr(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e-=t[r].value,t[0].type===ye&&(e=er(e));return{type:t.length?t[0].type:ye,value:e}}function gr(...t){let e=0;for(let r=0;r<t.length;++r)e+=t[r].value,t[0].type===ye&&(e=er(e));return{type:t.length?t[0].type:ye,value:e}}function pr(t){const e=Math.abs(t.value);return t.type===ye&&rr(e),{type:t.type,value:e}}function hr(...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 fr(...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 mr(t){return{type:t.type,value:Math.sign(t.value)}}function yr(t,e){let r;if(0===e.value&&t.type===ye)r=t.value;else if(0===t.value&&t.type===ye)r=0;else{let n=Math.sign(e.value);t.type===_e&&0===n&&(n=Object.is(n,0)?1:-1),r=Math.abs(t.value)*n}return t.type===ye&&rr(r),{type:t.type,value:r}}function _r(t){return e=>{const r=or(e.value);return{type:_e,value:r[t]/255}}}function br(t){return(e,r)=>{const n=or(e.value);return n[t]=255*r.value,{type:e.type,value:ar(n)}}}const wr=_r("a"),$r=_r("r"),xr=_r("g"),kr=_r("b"),Cr=br("a"),Fr=br("r"),Er=br("g"),Ar=br("b");function Vr(t){return t.map(Ke).join(", ")}qe("toString",[ye],sr),qe("toString",[_e],sr),qe("toString",[be],sr),qe("toString",[we],sr),qe("toString",["url"],sr),qe("toNumber",[ye],lr),qe("toNumber",[me],lr),qe("toInteger",[_e],(function(t){if(t.value>2147483647||t.value<pe)throw new Error("Unable to convert value to Integer.");const e=t.value-t.value%1;return{type:ye,value:e}})),qe("toInteger",[me],(function(t){const e=Number(t.value);if(isNaN(e)||e%1!=0||e>2147483647||e<pe)throw new Error("Unable to convert value to Integer.");return{type:ye,value:e}})),qe("toInteger",[be],(function(t){return{type:ye,value:t.value?1:0}})),qe("toBoolean",[ye],(function(t){if(1!==t.value&&0!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:be,value:t.value}})),qe("toBoolean",[me],(function(t){if("true"!==t.value&&"false"!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:be,value:"true"===t.value?1:0}})),qe("encodeUri",[me],(function(t){try{return{type:me,value:encodeURIComponent(t.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),qe("decodeUri",[me],(function(t){try{return{type:me,value:decodeURIComponent(t.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),qe("parseUnixTime",[ye],(function(t){return{type:$e,value:new Date(1e3*t.value)}})),qe("nowLocal",[],(function(){return{type:$e,value:new Date}})),qe("addMillis",[$e,ye],(function(t,e){return{type:$e,value:new Date(t.value.getTime()+e.value)}})),qe("setYear",[$e,ye],(function(t,e){const r=new Date(t.value);return r.setFullYear(e.value),{type:$e,value:r}})),qe("setMonth",[$e,ye],(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:$e,value:r}})),qe("setDay",[$e,ye],(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 ${Xe(t)}.`);return r.setDate(-1===e.value?0:e.value),{type:$e,value:r}})),qe("setHours",[$e,ye],(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:$e,value:r}})),qe("setMinutes",[$e,ye],(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:$e,value:r}})),qe("setSeconds",[$e,ye],(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:$e,value:r}})),qe("setMillis",[$e,ye],(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:$e,value:r}})),qe("len",[me],(function(t){return{type:ye,value:t.value.length}})),qe("contains",[me,me],(function(t,e){return{type:be,value:t.value.includes(e.value)?1:0}})),qe("substring",[me,ye,ye],(function(t,e,r){if(r.value<e.value)throw new Error("Indexes should be in ascending order.");if(e.value<0||e.value>t.value.length||r.value<0||r.value>t.value.length)throw new Error("Indexes are out of bounds.");return{type:me,value:t.value.substring(e.value,r.value)}})),qe("replaceAll",[me,me,me],(function(t,e,r){let n;return n=e.value?t.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(e.value),"g"),r.value):t.value,{type:me,value:n}})),qe("index",[me,me],(function(t,e){return{type:ye,value:t.value.indexOf(e.value)}})),qe("lastIndex",[me,me],(function(t,e){return{type:ye,value:t.value.lastIndexOf(e.value)}})),qe("trim",[me],(function(t){return{type:me,value:t.value.trim()}})),qe("trimLeft",[me],(function(t){return{type:me,value:t.value.replace(/^\s+/,"")}})),qe("trimRight",[me],(function(t){return{type:me,value:t.value.replace(/\s+$/,"")}})),qe("toUpperCase",[me],(function(t){return{type:me,value:t.value.toUpperCase()}})),qe("toLowerCase",[me],(function(t){return{type:me,value:t.value.toLowerCase()}})),qe("div",[ye,ye],cr),qe("div",[_e,_e],cr),qe("mod",[ye,ye],ur),qe("mod",[_e,_e],ur),qe("mul",[{type:ye,isVararg:!0}],dr),qe("mul",[{type:_e,isVararg:!0}],dr),qe("sub",[{type:ye,isVararg:!0}],vr),qe("sub",[{type:_e,isVararg:!0}],vr),qe("sum",[{type:ye,isVararg:!0}],gr),qe("sum",[{type:_e,isVararg:!0}],gr),qe("abs",[ye],pr),qe("abs",[_e],pr),qe("max",[{type:ye,isVararg:!0}],hr),qe("max",[{type:_e,isVararg:!0}],hr),qe("min",[{type:ye,isVararg:!0}],fr),qe("min",[{type:_e,isVararg:!0}],fr),qe("maxNumber",[],(function(){return{type:_e,value:he}})),qe("minNumber",[],(function(){return{type:_e,value:fe}})),qe("maxInteger",[],(function(){return{type:ye,value:2147483647}})),qe("minInteger",[],(function(){return{type:ye,value:pe}})),qe("round",[_e],(function(t){const e=Math.sign(t.value);return{type:_e,value:e*Math.round(Math.abs(t.value))}})),qe("floor",[_e],(function(t){return{type:_e,value:Math.floor(t.value)}})),qe("ceil",[_e],(function(t){return{type:_e,value:Math.ceil(t.value)}})),qe("signum",[_e],mr),qe("signum",[ye],mr),qe("copySign",[_e,_e],yr),qe("copySign",[ye,ye],yr),qe("getColorAlpha",[me],wr),qe("getColorAlpha",[we],wr),qe("getColorRed",[me],$r),qe("getColorRed",[we],$r),qe("getColorGreen",[me],xr),qe("getColorGreen",[we],xr),qe("getColorBlue",[me],kr),qe("getColorBlue",[we],kr),qe("setColorAlpha",[me,_e],Cr),qe("setColorAlpha",[we,_e],Cr),qe("setColorRed",[me,_e],Fr),qe("setColorRed",[we,_e],Fr),qe("setColorGreen",[me,_e],Er),qe("setColorGreen",[we,_e],Er),qe("setColorBlue",[me,_e],Ar),qe("setColorBlue",[we,_e],Ar),qe("rgb",[_e,_e,_e],(function(t,e,r){const n={a:255,r:255*t.value,g:255*e.value,b:255*r.value};return{type:me,value:ar(n)}})),qe("argb",[_e,_e,_e,_e],(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:me,value:ar(i)}}));const jr={StringLiteral:function(t,e){return{type:me,value:e.value}},NumberLiteral:function(t,e){return{type:_e,value:e.value}},IntegerLiteral:function(t,e){return{type:ye,value:e.value}},BooleanLiteral:function(t,e){return{type:be,value:e.value?1:0}},UnaryExpression:function(t,e){const r=Ye(Dr(t,e.argument));switch(e.operator){case"!":if(r.type===be)return{type:be,value:r.value?0:1};ir(`${e.operator}${Ke(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const t="+"===e.operator?1:-1;if(r.type===ye)return{type:ye,value:r.value*t};if(r.type===_e)return{type:_e,value:r.value*t};ir(`${e.operator}${Ke(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=Ye(Dr(t,e.test));if(r.type===be)return r.value?Dr(t,e.consequent):Dr(t,e.alternate);ir(`${Ke(r)} ? ${Ke(Dr(t,e.consequent))} : ${Ke(Dr(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 Dr(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=Xe(Dr(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:me,value:r}},LogicalExpression:function(t,e){const r=Ye(Dr(t,e.left));if(r.type!==be&&ir(`${Ke(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:be,value:0};const n=Ye(Dr(t,e.right));return n.type!==be&&ir(`${Ke(r)} ${e.operator} ${Ke(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${Qe(n.type)}.`),{type:be,value:n.value}},BinaryExpression:function(t,e){const r=e.operator,n=Dr(t,e.left),i=Dr(t,e.right);if(n.type!==i.type&&ir(`${Ke(n)} ${e.operator} ${Ke(i)}`,`Operator '${r}' cannot be applied to different types: ${Qe(n.type)} and ${Qe(i.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===$e&&r.type===$e?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:be,value:n?1:0}}(r,n,i);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==_e&&e.type!==ye&&e.type!==$e&&ir(`${Ke(e)} ${t} ${Ke(r)}`,`Operator '${t}' cannot be applied to ${Qe(e.type)} type.`);const i=e.type===$e?e.value.getTime():e.value,o=r.type===$e?r.value.getTime():r.value;return n=">"===t?i>o:">="===t?i>=o:"<"===t?i<o:i<=o,{type:be,value:n?1:0}}(r,n,i);if("+"===r||"-"===r)return function(t,e,r){if(e.type!==me&&e.type!==_e&&e.type!==ye&&ir(`${Ke(e)} ${t} ${Ke(r)}`,`Operator '${t}' cannot be applied to ${Qe(e.type)} type.`),e.type===me)return"-"===t&&ir(`${Ke(e)} - ${Ke(r)}`,`Operator '${t}' cannot be applied to ${Qe(e.type)} type.`),{type:me,value:e.value+r.value};let n="+"===t?e.value+r.value:e.value-r.value;return e.type===ye&&(n=er(n)),{type:e.type,value:n}}(r,n,i);if("/"===r||"*"===r||"%"===r)return function(t,e,r){let n;if(e.type!==ye&&e.type!==_e&&ir(`${Ke(e)} ${t} ${Ke(r)}`,`Operator '${t}' cannot be applied to ${Qe(e.type)} type.`),"*"===t)n=e.value*r.value;else{if("/"!==t&&"%"!==t)throw new Error(`Unsupported operation ${t}`);0===r.value&&ir(`${Ke(e)} ${t} ${Ke(r)}`,"Division by zero is not supported."),n="/"===t?e.value/r.value:e.value%r.value}return e.type===ye&&(n=er(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(!Re.has(r))throw new Error(`Unknown function name: ${r}.`);let n;const i=e.arguments.map((e=>Dr(t,e))),o=r+":"+i.map((t=>t.type)).join("#");if(We.has(o))n=We.get(o);else{const t=function(t,e){const r=Re.get(t);if(!r)throw new Error("Missing function");let n=null;for(let t=0;t<r.length;++t){const i=He(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=>Qe(t.type))).join(", "),n=`${r}(${Vr(i)})`;"few"===t.type&&0===i.length?ir(n,`Non empty argument list is required for function '${r}'.`):(t.type,ir(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){ir(`${r}(${Vr(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 Dr(t,e){if(e.type in jr)return jr[e.type](t,e);throw new Error("Unsupported expression")}function Sr(t,e){try{return Dr(t,e)}catch(t){return{type:"error",value:t.message}}}const Pr=/(?:[^\\]|^)@{.+}/i;class zr{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return Ge(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=Sr(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?Ze(n):n}catch(t){return void e(q(new Error("Expression execution error")))}}}function Mr(t,e,r){if(t)if("string"==typeof t){if(n=t,Pr.test(n))try{const r=Le(t,{startRule:"JsonStringContents"}),n=nr(r);return e.push(...n),new zr(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=>Mr(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=Mr(t[i],e,r);return n}}var n;return t}function Ir(t,e,r){if(t){if(t instanceof zr)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>Ir(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=Ir(t[i],e,r);return n}}return t}function Or(t,e){let r=[];const n=Mr(t,r,e);return r=[...new Set(r)],{vars:r,applyVars:t=>Ir(n,t,e)}}const Jr={pagers:function(){return L(new Map)}},Nr=new Map,Tr=new Map;function Ur(t){const e=Nr.get(t)||L("");return Nr.has(t)||Nr.set(t,e),e}function Br(t){const e=Tr.get(t)||new Map;return Tr.has(t)||Tr.set(t,e),e}class Lr{setVariable(t){const e=t.getName(),r=Br(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Ur(this).set(e)}getVariable(t){return Br(this).get(t)}}function Rr(){return new Lr}const Wr=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 Lr}=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 Ve)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=Ur(p),F=Br(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=Or(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}=Pe(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 Me(t);const e=Or(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))):Me(t)},getJsonWithVars:P,getStore:function(t){return H.has(t)||function(t){H.has(t)||H.set(t,Jr[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(wt,{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(dt,{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 ke&&t.name){if(E.has(t.name))return void z(q(new Error("Duplicate variable"),{additional:{name:t.name}}));try{const e=Ce(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=Ce(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=Le(t.condition,{startRule:"JsonStringContents"}),i=nr(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),(()=>Sr(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(Se,"RootSvgFilters").$$render(t,{svgFiltersMap:J},{},{})}\n ${M(De,"Unknown").$$render(t,{div:et,templateContext:{}},{},{})}</div>`:""}));function qr(t){return Wr.render({id:t.id,json:t.json,globalVariablesController:t.globalVariablesController,onError:t.onError,platform:t.platform}).html}var Hr=e.M,Gr=e.Os,Yr=e.sY;export{Hr as createGlobalVariablesController,Gr as createVariable,Yr 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:()=>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?"&":'"'===e?""":"<"),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,"&")),e.indexOf("<")>-1&&(e=e.replace(/</g,"<")),e.indexOf(">")>-1&&(e=e.replace(/>/g,">")),e.indexOf('"')>-1&&(e=e.replace(/"/g,""")),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};
|
|
2
2
|
//# sourceMappingURL=server.mjs.map
|