Files
ai/charting_library/bundles/start-free-trial-impl.46ed8d43707329dbf0fc.js
2023-02-02 13:31:14 +00:00

27 lines
76 KiB
JavaScript

(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[9144],{92395:()=>{},49381:()=>{},86473:t=>{t.exports={errorDialog:"errorDialog-0R3aCXZS"}},43024:t=>{t.exports={"tv-free-trial":"tv-free-trial-q2JdOW0b","tv-free-trial__total":"tv-free-trial__total-q2JdOW0b","tv-free-trial__total-separator":"tv-free-trial__total-separator-q2JdOW0b","tv-free-trial__total-today":"tv-free-trial__total-today-q2JdOW0b","tv-free-trial__total-after-trial":"tv-free-trial__total-after-trial-q2JdOW0b","tv-free-trial__total-today-description-container":"tv-free-trial__total-today-description-container-q2JdOW0b","tv-free-trial__total-after-trial-description-container":"tv-free-trial__total-after-trial-description-container-q2JdOW0b","tv-free-trial__total-today-price":"tv-free-trial__total-today-price-q2JdOW0b","tv-free-trial__total-after-trial-price":"tv-free-trial__total-after-trial-price-q2JdOW0b","tv-free-trial__total-today-price-year":"tv-free-trial__total-today-price-year-q2JdOW0b","tv-free-trial__total-after-trial-price-year":"tv-free-trial__total-after-trial-price-year-q2JdOW0b","tv-free-trial__total-today-price-year--crossed":"tv-free-trial__total-today-price-year--crossed-q2JdOW0b","tv-free-trial__total-after-trial-price-year--crossed":"tv-free-trial__total-after-trial-price-year--crossed-q2JdOW0b","tv-free-trial__total-today-title":"tv-free-trial__total-today-title-q2JdOW0b","tv-free-trial__total-after-trial-title":"tv-free-trial__total-after-trial-title-q2JdOW0b","tv-free-trial__total-today-description":"tv-free-trial__total-today-description-q2JdOW0b","tv-free-trial__total-after-trial-description":"tv-free-trial__total-after-trial-description-q2JdOW0b","tv-free-trial__footer-info":"tv-free-trial__footer-info-q2JdOW0b","tv-free-trial__footer-info-block":"tv-free-trial__footer-info-block-q2JdOW0b"}},71385:t=>{t.exports={"tv-start-free-trial":"tv-start-free-trial-7bqZMNHV","tv-start-free-trial__section":"tv-start-free-trial__section-7bqZMNHV","tv-start-free-trial__title":"tv-start-free-trial__title-7bqZMNHV"}},66875:t=>{t.exports={errors:"errors-Cv6NxnRZ",show:"show-Cv6NxnRZ",error:"error-Cv6NxnRZ"}},93314:t=>{t.exports={"error-icon":"error-icon-llFIA0b4","intent-danger":"intent-danger-llFIA0b4","intent-warning":"intent-warning-llFIA0b4"}},52965:t=>{t.exports={"static-messages":"static-messages-Yp0dNSLN",errors:"errors-Yp0dNSLN",warnings:"warnings-Yp0dNSLN",message:"message-Yp0dNSLN"}},16059:t=>{t.exports={menuWrap:"menuWrap-8MKeZifP",isMeasuring:"isMeasuring-8MKeZifP",scrollWrap:"scrollWrap-8MKeZifP",momentumBased:"momentumBased-8MKeZifP",menuBox:"menuBox-8MKeZifP",isHidden:"isHidden-8MKeZifP"}},23576:t=>{t.exports={"tablet-small-breakpoint":"screen and (max-width: 428px)",item:"item-4TFSfyGO",hovered:"hovered-4TFSfyGO",isDisabled:"isDisabled-4TFSfyGO",isActive:"isActive-4TFSfyGO",shortcut:"shortcut-4TFSfyGO",toolbox:"toolbox-4TFSfyGO",withIcon:"withIcon-4TFSfyGO",icon:"icon-4TFSfyGO",labelRow:"labelRow-4TFSfyGO",label:"label-4TFSfyGO",showOnHover:"showOnHover-4TFSfyGO"}},9078:(t,e,n)=>{"use strict";n.d(e,{
showErrorDialog:()=>o});var i=n(28353),r=n(86473);function s(t){const{title:e,content:n,actions:s,btnTitle:o,btnType:a,help:l}=t;return{title:e||(0,i.t)("Error"),help:l,content:n,addClass:r.errorDialog,destroyOnClose:!0,width:500,dataset:{"dialog-type":"error-dialog"},actions:s||[{key:[13,32],method:"close",name:"ok",text:o||(0,i.t)("OK"),type:a||"primary"}]}}function o(t){(async function(t){return(await Promise.all([n.e(509),n.e(3118),n.e(1729),n.e(6708),n.e(1536),n.e(7678),n.e(4834)]).then(n.bind(n,89725))).createDialog({...s(t),type:"modal"})})(t).then(t=>t.open())}},43209:(t,e,n)=>{"use strict";n.d(e,{formValidate:()=>p});var i=n(28353),r=n(20497),s=(n(22358),n(18609));function o(t){return null==t.which?t.keyCode<32?null:String.fromCharCode(t.keyCode):0!==t.which&&0!==t.charCode?t.which<32?null:String.fromCharCode(t.which):null}var a=n(23127);const l=n(98125).getLogger("CommonUI.TVFormValidate"),c={required:(0,i.t)("This field is required"),number:(0,i.t)("Please enter a valid number"),digit:(0,i.t)("Please enter only digits"),email:(0,i.t)("Please enter a valid email address"),password:(0,i.t)("Your password should be at least 7 characters long that include letters and numbers."),weakPassword:(0,i.t)("Please use a stronger password"),pattern:(0,i.t)("Please match the requested format"),url:(0,i.t)("Please enter a valid URL"),minlength:(0,i.t)("Please enter at least {number} characters"),maxlength:(0,i.t)("Please enter no more than {number} characters"),min:(0,i.t)("Please enter a value greater than or equal to {number}"),max:(0,i.t)("Please enter a value less than or equal to {number}"),latin:(0,i.t)("Only English language is allowed"),"latin-for-en-local":(0,i.t)("Only English language is allowed"),maxfilesize:(0,i.t)("Max file size is {size}"),fileextensions:function(t){return a.isArray(t)||(t=[t]),(0,i.t)("Allowed extension is {extensions}").format({extensions:t.join(", ")})}},d=function(t,e,n){if("function"==typeof t)return t(e,n)},h={required:function(t,e,n){if("function"!=typeof t||t(e,n))switch(n.attr("type")){case"checkbox":if(!n.is(":checked"))return c.required;break;default:if(""===e.trim())return c.required}},type:function(t,e,n){if(""!==e)switch(t){case"number":if(isNaN(e))return c.number;break;case"digits":if(isNaN(e))return c.digit;break;case"email":if(!/^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@(([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{2,})$/i.test(e))return c.email;break;case"password":if(n.data("strength")){const t=/\d/.test(e)&&/[^\d_\s.;:,\\/|@!#?$%^&*()[\]\-+={}'"<>~`±§]/.test(e);if(e.length<7||!t)return n.data("too_easy",!0),c.password;if(/^\d?(.)\1+\d?$/.test(e)||/^.?(\d)\1+.?$/.test(e))return n.data("too_easy",!0),c.weakPassword;n.removeData("too_easy")}break;case"url":
if(!/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3} ){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(e))return c.url}},pattern:function(t,e){if(""!==e){if(!new RegExp(t).test(e))return c.pattern}},minlength:function(t,e){if(""!==e&&e.length<parseInt(t))return c.minlength.format({number:t})},maxlength:function(t,e){if(""!==e&&e.length>parseInt(t))return c.maxlength.format({number:t})},min:function(t,e){if(""!==e&&parseFloat(e)<parseFloat(t))return c.min.format({number:t})},max:function(t,e){if(""!==e&&parseFloat(e)>parseFloat(t))return c.max.format({number:t})},latin:function(t,e){if(""!==e&&!(0,s.isLatin)(e))return c.latin},"latin-for-en-local":function(t,e){if(""!==e&&"en"===window.locale&&!(0,s.isLatin)(e))return c.latin},maxfilesize:function(t,e,n){if(""===e)return;const r=n.get(0),s=r.files[0].size,o=parseInt(t);return r.files||l.logWarn("This browser doesn't seem to support the `files` property of file inputs."),o<s?c.maxfilesize.format({size:function(t){const e=[(0,i.t)("Bytes"),(0,i.t)("KB"),(0,i.t)("MB"),(0,i.t)("GB"),(0,i.t)("TB")];if(!t)return(0,i.t)("0 Byte");const n=parseInt(Math.floor(Math.log(t)/Math.log(1024)));return Math.round(t/Math.pow(1024,n),2)+" "+e[n]}(o)}):void 0},fileextensions:function(t,e,n){if(""===e)return;const i=n.get(0).files[0].name,r=/(?:\.([^.]+))?$/.exec(i)[1].toLowerCase(),s=t.split(",").map(t=>t.toLowerCase());return-1===s.indexOf(r)?c.fileextensions(s):void 0},custom:d,"custom-change":d,"custom-blur":d};class u{constructor(t,e={}){this.$form=t;const n=["input","textarea"],i=[":submit",":reset",":image",":disabled",'[type="hidden"]',".js-validate-ignore"];void 0!==e.validateElements&&n.push(...e.validateElements),void 0!==e.ignoreElements&&i.push(...e.ignoreElements),this.$controls=t.find(n.join()).not(i.join()).tvControlError(),this.rules={},this.fields={},this.valid=!0,this.$controls.each((t,e)=>{const n=a(e),i=n.attr("name"),r=n.tvControlError("getInstance");this.fields[i]={$el:n,view:r},this.rules[i]={},this.rules[i].required=n.attr("required"),this.rules[i].type=n.attr("type"),this.rules[i].pattern=n.attr("pattern"),this.rules[i].maxlength=n.attr("maxlength"),this.rules[i].minlength=n.attr("minlength"),this.rules[i].min=n.attr("min"),this.rules[i].max=n.attr("max"),this.rules[i].maxfilesize=n.attr("maxfilesize"),this.rules[i].fileextensions=n.attr("fileextensions"),this.rules[i].latin=n.data("rule-latin"),this.rules[i]["latin-for-en-local"]=n.data("rule-latin-for-en-local"),this.rules[i].latin&&n.on("keypress",t=>{this.testChar(i,o(t),"latin")}),this.rules[i]["latin-for-en-local"]&&n.on("keypress",t=>{this.testChar(i,o(t),"latin-for-en-local")}),n.on("blur",()=>{this.validateField(i,["required","custom-change"])
}),n.on("change",()=>{r.clear(),this.validateField(i,["custom-blur"])})}),e.onError&&"function"==typeof e.onError&&(this.onError=e.onError),e.onChange&&"function"==typeof e.onChange&&(this.onChange=e.onChange),e.rules&&a.extend(!0,this.rules,e.rules),t.attr("novalidate","novalidate"),!1!==e.submitValidate&&t.on("submit",t=>{this.validate()||t.preventDefault()}),t.on("reset",t=>{this.clear()})}validateField(t,e=[]){if(void 0===this.rules[t])return;void 0!==this.onChange&&this.onChange(this.isValid());const n=this.fields[t].$el,i=this.rules[t],r=Object.keys(i);for(let s=0;s<r.length;s++){if(-1!==e.indexOf(r[s]))continue;const o=i[r[s]];if(o){const e=h[r[s]](o,n.val(),n);e?this.setError({name:t,error:e,id:r[s],noRender:!0}):this.removeError({name:t,id:r[s],noRender:!0})}}return!this.fields[t].view.render().hasErrors()}isValid(){return Object.keys(this.rules).every(t=>{const e=this.fields[t].$el,n=this.rules[t];return!Object.keys(n).filter(t=>null!=n[t]).some(t=>{const i=h[t](n[t],e.val(),e);return Boolean(i)})})}validate(){this.valid=!0;const t=Object.keys(this.rules);for(let e=0;e<t.length;e++)this.valid=this.validateField(t[e])&&this.valid;return!this.valid&&this.onError&&this.onError(),this.valid}clear(){const t=Object.keys(this.fields);for(let e=0;e<t.length;e++)this.fields[t[e]].view.clear().render()}setError({name:t,error:e,id:n,noRender:i}){return n=void 0===n?Date.now():n,this.fields[t].view.add({id:n,message:e}),i||this.fields[t].view.render(),this}removeError({name:t,id:e,noRender:n}){return this.fields[t].view.remove({id:e}),n||this.fields[t].view.render(),this}testChar(t,e,n){h[n](!1,e)?(event.preventDefault(),this.setError({name:t,error:c.latin,id:n,noRender:!1})):this.removeError({name:t,id:n,noRender:!1})}}function p(t,e){return new u(a(t),e)}a.fn.tvFormValidate=(0,r.createTvBlockWithInstance)("tv-form-validate",(function(t,e={}){return new u(t,e)}))},23651:(t,e,n)=>{"use strict";n.d(e,{getPrice:()=>l});var i=n(85198),r=n(10878);const s=(0,n(98125).getLogger)("Payment.Price");class o{constructor(){this._cache={}}get(t){const e=this._getKey(t);return e in this._cache?this._cache[e]:void 0}add(t,e){this._cache[this._getKey(t)]=e}static getInstance(){return o._instance||(o._instance=new o),o._instance}_getKey(t){const{productId:e,billingCycle:n="",country_code_alpha2:i="",region:r="",postal_code:s="",locality:o="",currency:a,withTax:l}=t;return`${e}_${n}_${i}_${a}_${r}_${s}_${o}_${l?"tax":""}`}}class a{constructor(){this._cache={}}getCache(t){return t in this._cache||(this._cache[t]=o.getInstance()),this._cache[t]}static getInstance(){return a._instance||(a._instance=new a),a._instance}}async function l(t){const{products:e,billingCycle:n,billingAddress:o,currency:l=r.Currencies.Usd,withTax:c=!1}=t,d=a.getInstance().getCache(l),h=[],u=[],p=c?o:{country_code_alpha2:o.country_code_alpha2};e.forEach(t=>{const e=d.get({productId:t,billingCycle:n,withTax:c,currency:l,...p});e?h.push(e):(u.push(t),h.push(null))});const f={products:u,billing_cycle:n,currency:l,billing_address:p,with_tax:c},_=await async function(t){
if(0===t.products.length)return Promise.resolve({results:[]});const e=await(0,i.fetch)("/order/price/",{method:"POST",body:JSON.stringify(t),credentials:"include"});if(!e.ok){const t=await e.json(),n=Error(t.detail);throw n.name="ApiError:"+t.code,s.logError(t.detail),n}return e.json()}(f);u.forEach((t,e)=>{const i=_.results[e];i&&d.add({productId:t,billingCycle:n,withTax:c,currency:l,...p},i)});const m=[..._.results];return{results:h.map(t=>null!=t?t:m.shift())}}},27468:(t,e,n)=>{"use strict";n.d(e,{formatPrice:()=>b,getTemplate:()=>C});var i=n(55532),r=n(28353),s=n(78540),o=n(53402),a=n(82531),l=n(43024);const c=r.t("Your card will be charged {cost} on {billing_date}."),d=r.t("The bank will hold {cost} today to verify the card."),h=r.t("You can cancel auto-renewal"),u=r.t("You can cancel your trial & auto-renewal BEFORE {billing_date} and you will not be charged at all."),p=r.t("Payable today"),f=r.t("Free trial"),_=r.t("Payable on {billing_date}"),m=r.t("{plan} plan ({billingCycle}){point}"),v=r.t("US");function g(t){return`<span class="i-no-break">${t}</span>`}function b(t){return`<span class="i-no-break">$${(0,o.round2)(t)} ${v}</span>`}function y(t){return{[s.BillingCycle.Monthly]:r.t("monthly"),[s.BillingCycle.OneYear]:r.t("1 year"),[s.BillingCycle.ThreeMonths]:r.t("3 months"),[s.BillingCycle.TwoYears]:r.t("2 years")}[t]||""}function C(t){const{productData:e,billingCycle:n,isChangeTrial:v,expirationDateTs:C,setChangePriceCallback:w,className:x}=t,S=n===s.BillingCycle.OneYear,E=(0,a.getTrialLength)();let k;k=C?i.unix(+C):i().add(E,"days"),k=k.add(1,"days"),k=k.format("LL"),w&&w(t=>{const{total:i,full_monthly_price:r}=t,s=parseFloat(i.toString())-parseFloat(i.toString())+parseFloat(r?r.toString():"0"),a=document.body.querySelectorAll(".js-trial-dialog-footer");Array.from(a).forEach(i=>{const r=i.querySelector(".js-footer-billing-text");if(r){r.innerHTML="";const e=`\n\t\t\t\t\t\t${c.format({billing_date:g(k),cost:b(t.total)})}\n\t\t\t\t\t\t${d.format({cost:b(1)})}\n\t\t\t\t\t`;r.insertAdjacentHTML("afterbegin",e)}const a=i.querySelector(".js-footer-billing-price");a&&(a.innerHTML="",a.insertAdjacentHTML("afterbegin",b(t.total)));const l=i.querySelector(".js-footer-billing-crossed");l&&(l.textContent=s.toString());const h=i.querySelector(".js-footer-total-after-trial-description");h&&(h.textContent=m.format({plan:(0,o.humanizeProPlan)(e.text_id),billingCycle:y(n),point:""}))})});const T=u.format({billing_date:g(k)}),A=r.t("Free trial ({days} day)",{plural:"Free trial ({days} days)",context:"free_trial",count:E});return`\n\t\t<div class="${l["tv-free-trial"]} js-trial-dialog-footer ${x||""}">\n\t\t\t<div class="${l["tv-free-trial__total"]}">\n\t\t\t\t<div class="${l["tv-free-trial__total-today"]}">\n\t\t\t\t\t<div class="${l["tv-free-trial__total-today-description-container"]}">\n\t\t\t\t\t\t<div class="${l["tv-free-trial__total-today-title"]}">${p}</div>\n\t\t\t\t\t\t<div class="${l["tv-free-trial__total-today-description"]}">\n\t\t\t\t\t\t\t${v?f:A.format({days:E.toString()
})}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="${l["tv-free-trial__total-today-price"]}">${b(0)}</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="${l["tv-free-trial__total-separator"]}"></div>\n\t\t\t\t<div class="${l["tv-free-trial__total-after-trial"]}">\n\t\t\t\t\t<div class="${l["tv-free-trial__total-after-trial-description-container"]}">\n\t\t\t\t\t\t<div class="${l["tv-free-trial__total-after-trial-title"]}">\n\t\t\t\t\t\t\t${_.format({billing_date:g(k)})}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="${l["tv-free-trial__total-after-trial-description"]} js-footer-total-after-trial-description">${m.format({plan:(0,o.humanizeProPlan)(e.text_id),billingCycle:y(n),point:""})}</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="${l["tv-free-trial__total-after-trial-price"]}">\n\t\t\t\t\t\t${!S||v?"":`\n\t\t\t\t\t\t\t<span class="${l["tv-free-trial__total-after-trial-price-year"]}">\n\t\t\t\t\t\t\t\t$<span class="${l["tv-free-trial__total-after-trial-price-year--crossed"]} js-footer-billing-crossed"></span> ${r.t("US")}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t`}\n\t\t\t\t\t\t<span class="js-footer-billing-price"></span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="${l["tv-free-trial__footer-info"]}">\n\t\t\t\t<div class="${l["tv-free-trial__footer-info-block"]}">\n\t\t\t\t\t<h3>${h}</h3>\n\t\t\t\t\t<p class="js-footer-billing-text"></p>\n\t\t\t\t</div>\n\n\t\t\t\t<div class="${l["tv-free-trial__footer-info-block"]}">\n\t\t\t\t\t<h3>${h}</h3>\n\t\t\t\t\t<p class="js-footer-auto-renewal">${T}</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t`}},28170:(t,e,n)=>{"use strict";n.r(e),n.d(e,{showStartFreeTrialDialog:()=>kt});n(94419);var i,r=n(28353),s=(n(49381),n(92395),n(88537)),o=n(32563),a=n(68587),l=n(15840),c=n(2872),d=n.n(c),h=n(58498),u=n(65112),p=n(56840),f=n(62820),_=n(59199);!function(t){t[t.Left=0]="Left",t[t.Right=1]="Right"}(i||(i={}));const m={saveTab:"",noSlider:!1,onTabClick:!1,loadedClass:"i-loaded",tabsContainerClass:"tv-tabs",tabClass:"tv-tabs__tab",tabDisabledClass:"disabled",activeTabClass:"i-active",activePageClass:"active",sliderClass:"tv-tabs__slider",scrollBoxClass:"tv-tabs__scroll-box",scrollWrapClass:"tv-tabs__scroll-wrap",lArrowClass:"tv-tabs__left-arrow",rArrowClass:"tv-tabs__right-arrow"},v=h,g=u;class b{constructor(t,e,n={}){this._animating=!1,this._prevWidth=-1,this._bindings=[],this._options=(0,l.deepExtend)({},m,n),this.tabChanged=new(d()),this._elTabs=t,this._elPages=e,this._elScrollWrap=C(this._options.scrollWrapClass||"",this._elTabs,"wrapInner"),this._elScrollBox=C(this._options.scrollBoxClass||"",this._elScrollWrap,"wrapInner"),this._options.noSlider||(this._elSlider=C(this._options.sliderClass||"",this._elScrollBox,"append")),o.mobiletouch||(this._elArrowLeft=C(this._options.lArrowClass||"",this._elTabs,"append",`<div class="${this._options.lArrowClass||""} i-slided">${v}</div>`),this._elArrowRight=C(this._options.rArrowClass||"",this._elTabs,"append",`<div class="${this._options.rArrowClass||""} i-slided">${g}</div>`),
this._addClass(this._elArrowLeft,this._options.addLeftArrowsClass),this._addClass(this._elArrowRight,this._options.addRightArrowsClass)),this._addClass(this._elScrollBox,this._options.addScrollBoxClass),this._addClass(this._elSlider,this._options.addSliderClass),this._addClass(this._elTabs,this._options.tabsContainerClass),this._addClass(this.getTabsArray(),this._options.tabClass),this._addClass(this._elTabs,this._options.loadedClass),this.checkScrollArrows(!0),this._initActivePage(),this._bindEvents()}getTabsArray(){const t=this._elScrollBox.children;if(!this._options.sliderClass)return Array.prototype.slice.call(t);const e=[];for(let n=0;n<t.length;n++){const i=t[n];S(i,this._options.sliderClass)||e.push(i)}return e}getPagesArray(){return this._elPages?Array.prototype.slice.call(this._elPages.children):[]}getElTabs(){return this._elTabs}getElPages(){return this._elPages}checkScrollArrows(t=!1){const e=Math.ceil(this._elScrollWrap.scrollLeft),n=y(this._elScrollWrap),r=this._elScrollWrap.scrollWidth-n-2;function s(t){x(t,"i-slided"),t.style.transition=""}function o(e,n){w(e,"i-slided"),t&&(e.style.transition="none")}this._elArrowLeft&&(e>=1?s(this._elArrowLeft):(e<=1||this._elScrollWrap.scrollWidth<=n)&&o(this._elArrowLeft,i.Left)),this._elArrowRight&&(r-e>1?s(this._elArrowRight):(e>=r||this._elScrollWrap.scrollWidth<=n)&&o(this._elArrowRight,i.Right))}index(){const t=this.getElActiveTab();return t?this.getTabsArray().indexOf(t):-1}getElActiveTab(){return this._getActiveElement(this.getTabsArray(),this._options.activeTabClass||"",this._options.inactiveTabClass)}getElActivePage(){return this._getActiveElement(this.getPagesArray(),this._options.activePageClass||"",this._options.inactivePageClass)}setActivePage(t,e,n){if(-1===t||t===this.index()&&!n)return;const i=this.index();function r(e,n,i){e.forEach((e,r)=>{const s=t===r;n&&E(e,n,s),i&&E(e,i,!s)})}r(this.getTabsArray(),this._options.activeTabClass,this._options.inactiveTabClass),r(this.getPagesArray(),this._options.activePageClass,this._options.inactivePageClass),this._options.noSlider||this.updateSlider(i,t,e),this._options.saveTab&&p.setValue(this._options.saveTab,t),this.tabChanged.fire(t)}updateSlider(t,e,n){if(this._options.noSlider)return;const i=this.getTabsArray()[e];if(0===i.clientWidth||0===i.clientHeight||"none"===window.getComputedStyle(i).getPropertyValue("display"))return;const r=window.getComputedStyle(i);let s=i.offsetLeft+parseInt(r.getPropertyValue("padding-left")),o=y(i);const l=i.querySelector(".js-tabs__slider-pos");if(l){const t=window.getComputedStyle(l);s+=parseInt(t.getPropertyValue("padding-left"))+l.offsetLeft,o-=o-y(l)}if(n=n||-1===t||document.all&&!window.atob)this._elSlider.style.left=s+"px",this._elSlider.style.width=o+"px";else{this._animating=!0;const t=parseInt(getComputedStyle(this._elSlider).left),e=parseInt(getComputedStyle(this._elSlider).width);(0,_.doAnimate)({from:t,to:s,duration:a.dur,onStep:(t,e)=>{this._elSlider.style.left=e+"px"}}),(0,_.doAnimate)({from:e,to:o,duration:a.dur,onStep:(t,e)=>{
this._elSlider.style.width=e+"px"},onComplete:()=>{this._animating=!1}})}}onTabClick(t){const e=t.currentTarget||t.target,n=this.getTabsArray().indexOf(e);-1===n||this._isTabDisabled(e)||this.setActivePage(n),document.activeElement.blur(),t.preventDefault()}resizeSlider(){if(this._options.noSlider)return;const t=this._elTabs.offsetWidth;if(t===this._prevWidth)return;this._prevWidth=t;const e=this.index();this.updateSlider(e,e,!0)}count(){return this.getTabsArray().length}add(t,e){this._elScrollBox.appendChild(t),this._elPages&&e&&this._elPages.appendChild(e),this._bindTabEvents(t),this.checkScrollArrows(!0)}remove(t){function e(t){t.parentElement&&t.parentElement.removeChild(t)}const n=this.tabAt(t);n&&(this._unbindTabEvents(n),e(n));const i=this.pageAt(t);i&&e(i);const r=t-1>=0?t-1:0;this.setActivePage(r),this.checkScrollArrows(!0)}indexOfTab(t){return this.getTabsArray().indexOf(t)}indexOfPage(t){return this.getPagesArray().indexOf(t)}pageAt(t){return this.getPagesArray()[t]||null}tabAt(t){return this.getTabsArray()[t]||null}deselect(){const t=this.getElActiveTab();this._options.activeTabClass&&t&&x(t,this._options.activeTabClass);const e=this.getElActivePage();return this._options.activePageClass&&e&&x(e,this._options.activePageClass),this._elSlider&&(this._elSlider.style.left="",this._elSlider.style.width=""),this}stop(){this._unbindEvents({})}_addClass(t,e){"string"==typeof e&&(Array.isArray(t)||(t=[t]),t.forEach(t=>{w(t,e)}))}_initActivePage(){let t=0;this._options.saveTab&&(t=p.getInt(this._options.saveTab,0));const e=this.index();-1!==e&&(t=e),void 0!==this._options.activeTab&&(t=this._options.activeTab),this.setActivePage(t,!0,!0)}_bindEvents(){this.getTabsArray().forEach(this._bindTabEvents.bind(this)),this._bindOneEvent({eventName:"scroll",listener:this.checkScrollArrows.bind(this,!1),target:this._elScrollWrap}),this._elArrowLeft&&this._bindOneEvent({eventName:"click",listener:()=>{const t=this.getTabsArray();let e=0,n=!1;const i=this._elScrollWrap.scrollLeft;(0,f.isRtl)()&&t.reverse(),t.forEach(t=>{if(n)return;const r=t.offsetLeft+t.offsetWidth;r>i?n=!0:e=r}),(0,_.doAnimate)({from:this._elScrollWrap.scrollLeft,to:this._elScrollWrap.scrollLeft+Math.floor(e-i-y(this._elArrowLeft)),duration:a.dur/2,onStep:(t,e)=>{this._elScrollWrap.scrollLeft=e}})},target:this._elArrowLeft}),this._elArrowRight&&this._bindOneEvent({eventName:"click",listener:()=>{const t=this.getTabsArray();let e=0;const n=(0,f.isRtl)()?0:this._elScrollWrap.scrollLeft+y(this._elScrollWrap);(0,f.isRtl)()&&t.reverse(),t.forEach(t=>{if(0!==e)return;const i=t.offsetLeft+t.offsetWidth;i>n&&(e=i)}),(0,_.doAnimate)({from:this._elScrollWrap.scrollLeft,to:this._elScrollWrap.scrollLeft+Math.ceil(e-n+y((0,s.ensureDefined)(this._elArrowRight))),duration:a.dur/2,onStep:(t,e)=>{this._elScrollWrap.scrollLeft=e}})},target:this._elArrowRight});const t=Array.prototype.slice.call(this._elTabs.querySelectorAll(".js-tabs__slider-hover")||[]);t.length&&t.forEach(t=>this._bindOneEvent({eventName:"mouseenter",listener:t=>{if(this._animating)return
;const e=t.currentTarget;e&&this._options.activeTabClass&&S(e,this._options.activeTabClass)&&this._hoverSlider(e)},target:t}));let e=null;const n=()=>{e=null,this.checkScrollArrows(!0),this._options.noSlider||this.resizeSlider()};this._bindOneEvent({eventName:"resize",listener:()=>{null===e&&(e=window.requestAnimationFrame(n))},target:window})}_bindTabEvents(t){this._bindOneEvent({eventName:"click",listener:t=>{"function"==typeof this._options.onTabClick?this._options.onTabClick(t):this.onTabClick(t)},target:t})}_unbindTabEvents(t){this._unbindEvents({target:t})}_bindOneEvent(t){t.target.addEventListener(t.eventName,t.listener),this._bindings.push(t)}_unbindEvents(t){const e=e=>!(void 0!==e.eventName&&e.eventName!==t.eventName||void 0!==e.target&&e.target!==t.target||void 0!==e.listener&&e.listener!==t.listener);this._bindings.filter(e).forEach(t=>t.target.removeEventListener(t.eventName,t.listener)),this._bindings=this._bindings.filter(t=>!e(t))}_getActiveElement(t,e,n){return t.filter(t=>e?S(t,e):!!n&&!S(t,n))[0]||null}_isTabDisabled(t){return S(t,"i-disabled")||this._options.tabDisabledClass&&S(t,this._options.tabDisabledClass)||t.hasAttribute("disabled")}_hoverSlider(t){const e=y(t),n=window.getComputedStyle(t),i=t.offsetLeft+parseInt(n.getPropertyValue("padding-left"))+parseInt(n.getPropertyValue("margin-left"));(0,_.doAnimate)({from:parseInt(getComputedStyle(this._elSlider).left),to:i,duration:a.dur/4,onStep:(t,e)=>{this._elSlider.style.left=e+"px"}}),(0,_.doAnimate)({from:parseInt(getComputedStyle(this._elSlider).width),to:e,duration:a.dur/4,onStep:(t,e)=>{this._elSlider.style.width=e+"px"}});const r=()=>{this.getElActiveTab()===t&&this._unhoverSlider(t),t.removeEventListener("mousleave",r)};t.addEventListener("mouseleave",r)}_unhoverSlider(t){const e=window.getComputedStyle(t),n=t.querySelector(".js-tabs__slider-pos"),i=window.getComputedStyle(n),r=t.offsetLeft+parseInt(e.getPropertyValue("padding-left"))+parseInt(e.getPropertyValue("margin-left"))+parseInt(i.getPropertyValue("padding-left"))+n.offsetLeft,s=y(t),o=s-(s-y(n));(0,_.doAnimate)({from:parseInt(getComputedStyle(this._elSlider).left),to:r,duration:a.dur/2,onStep:(t,e)=>{this._elSlider.style.left=e+"px"}}),(0,_.doAnimate)({from:parseInt(getComputedStyle(this._elSlider).width),to:o,duration:a.dur/2,onStep:(t,e)=>{this._elSlider.style.width=e+"px"}})}}function y(t){if(0===t.offsetWidth)return 0;{const e=window.getComputedStyle(t);return t.offsetWidth-parseFloat(e.getPropertyValue("padding-left"))-parseFloat(e.getPropertyValue("padding-right"))-parseFloat(e.getPropertyValue("border-left-width"))-parseFloat(e.getPropertyValue("border-right-width"))}}function C(t,e,n,i){let r=e.querySelector("."+t);if(!r){const s=document.createElement("div");if(s.innerHTML=i||`<div class="${t}"></div>`,r=s.firstElementChild,"append"===n)e.appendChild(r);else{if("wrapInner"!==n)throw new Error("Unknown insertMethod");{const t=Array.prototype.slice.call(e.childNodes);for(let e=0;e<t.length;e++)r.appendChild(t[e]);e.appendChild(r)}}}return r}function w(t,e){
t.classList.add(...k(e))}function x(t,e){t.classList.remove(...k(e))}function S(t,e){return k(e).every(e=>t.classList.contains(e))}function E(t,e,n){k(e).forEach(e=>t.classList.toggle(e,n))}function k(t){return t.split(/\s+/)}function T(t){return t.find('input[name="BILLTOFULLNAME"]')}function A(t){return t.trim().split(/\s/g).filter(t=>t.length).slice(0,2)}const P={BILLTOFULLNAME:{required:!0,custom:(t,e)=>{const n=A(t);if(!t||""!==t&&2!==n.length)return r.t("FULL NAME is incomplete");if(!/^[\u0000-\u007f]*$/.test(t))return r.t("Must contain only ASCII characters");return n[0].length>30?r.t("First name must be no longer than 30 characters."):n[1].length>30?r.t("Last name must be no longer than 30 characters."):void 0}}};var $=n(10878);const O=(0,r.t)("Pay with"),M=(0,r.t)("PayPal account"),I=(0,r.t)("Subscribe"),L=(0,r.t)("One Click"),W=(0,r.t)("New Card"),F=(0,r.t)("Card"),R=(0,r.t)("PayPal"),N=(0,r.t)("Crypto by Coinbase"),j=(0,r.t)("Payment card number"),B=(0,r.t)("Cardholder name"),D=(0,r.t)("Expiration date"),V=(0,r.t)("Security code"),z=(0,r.t)("You will be automatically redirected to PayPal in order to finish your purchase."),q=(0,r.t)("After the payment is sent, you will be automatically redirected back to TradingView."),H=(0,r.t)("It is an important step, please don't interrupt it."),U=(0,r.t)("Coinbase payment method is not available for special offers. If you want to continue {linkStart}click here{linkEnd}"),Y=(0,r.t)("You will be automatically redirected to Coinbase in order to finish your purchase.");function X(t,e){return t?`\n\t\t<div class="tv-card-info-collector__non-pro-container js-non-pro-container">\n\t\t\t<label class="js-non-pro-checkbox-wrap">\n\t\t\t\t<span class="tv-control-checkbox tv-card-info-collector__non-pro-checkbox">\n\t\t\t\t\t<input type="checkbox" name="non_pro_confirmed" class="tv-control-checkbox__input js-non-pro-checkbox">\n\t\t\t\t\t<span class="tv-control-checkbox__box">${n(4135)}</span>\n\t\t\t\t\t<span class="tv-control-checkbox__ripple js-ripple"></span>\n\t\t\t\t</span>\n\t\t\t\t<span class="tv-control-checkbox__label tv-card-info-collector__non-pro-label ${e?"":"i-align_center"}">\n\t\t\t\t\t${t} <i class="apply-common-tooltip tv-card-info-collector__non-pro-help-button js-non-pro-help-button">\n\t\t\t\t\t\t${n(65417)}\n\t\t\t\t\t</i>\n\t\t\t\t</span>\n\t\t\t</label>\n\t\t</div>\n\t`:""}function J(t){return t?`\n\t\t<div class="tv-card-info-collector__policy-container js-policy-container">\n\t\t\t<label class="js-policy-checkbox-wrap">\n\t\t\t\t<span class="tv-control-checkbox tv-card-info-collector__policy-checkbox">\n\t\t\t\t\t<input type="checkbox" name="policy-checkbox" class="tv-control-checkbox__input js-policy-checkbox">\n\t\t\t\t\t<span class="tv-control-checkbox__box">${n(4135)}</span>\n\t\t\t\t\t<span class="tv-control-checkbox__ripple js-ripple"></span>\n\t\t\t\t</span>\n\t\t\t\t<span class="tv-control-checkbox__label tv-card-info-collector__policy-terms">${t}.</span>\n\t\t\t</label>\n\t\t</div>\n\t`:""}function G(t){
return t?`\n\t\t<div class="tv-card-info-collector__ice-message-container js-ice-message-container">\n\t\t\t<label class="js-ice-message-checkbox-wrap">\n\t\t\t\t<span class="tv-control-checkbox tv-card-info-collector__ice-message-checkbox">\n\t\t\t\t\t<input type="checkbox" name="ice-message-checkbox" class="tv-control-checkbox__input js-ice-message-checkbox">\n\t\t\t\t\t<span class="tv-control-checkbox__box">${n(4135)}</span>\n\t\t\t\t\t<span class="tv-control-checkbox__ripple js-ripple"></span>\n\t\t\t\t</span>\n\t\t\t\t<span class="tv-control-checkbox__label tv-card-info-collector__ice-message-label">${t}.</span>\n\t\t\t</label>\n\t\t</div>\n\t`:""}function K(t){return t?`\n\t\t<a class="tv-button tv-button--link tv-button--no-padding tv-card-info-collector__actions--cancel-button js-cancel-btn">\n\t\t\t${t}\n\t\t</a>\n\t`:""}function Z(t,e){return`\n\t\t<button class="tv-button tv-button--primary tv-button--size_large tv-button--loader ${e}">\n\t\t\t${t}\n\t\t</button>\n\t`}function Q(t){return`\n\t\t<div class="tv-card-info-collector">\n\t\t\t${function(t){const{message:e,is_reference_tab_visible:n,is_card_tab_visible:i,is_paypal_tab_visible:r,is_coinbase_tab_visible:s}=t;return`\n\t\t${e?'<p class="tv-card-info-collector__message">'+e+"</p>":""}\n\t\t<div class="tv-card-info-collector__tabs-container">\n\t\t\t<div class="tv-tabs tv-card-info-collector__tabs tv-tabs--no-padding js-tabs" id="tabs">\n\t\t\t\t${(()=>{let t="";return n?(t+=`<div class="tv-tabs__tab tv-card-info-collector__tab">${L}</div>`,i&&(t+=`<div class="tv-tabs__tab tv-card-info-collector__tab">${W}</div>`)):i&&(t+=`<div class="tv-tabs__tab tv-card-info-collector__tab">${F}</div>`),r&&(t+=`<div class="tv-tabs__tab tv-card-info-collector__tab">${R}</div>`),s&&(t+=`<div class="tv-tabs__tab tv-card-info-collector__tab">${N}</div>`),t})()}\n\t\t\t</div>\n\t\t</div>\n\t`}(t)}\n\n\t\t\t<div class="js-pages">\n\t\t\t\t${function(t){if(!t.is_reference_tab_visible||!t.is_reference_allowed)return"";const{paymentMethodHint:e,billing_cycle:n,product_id:i,child_products:r,exchanges_only:s,user:o,non_pro_message:a,policy_message:l,ice_message:c,okText:d,cancelText:h,footer:u}=t,p=t.buyButtonTitle||I
;return`\n\t\t<div class="tv-card-info-collector__tab-wrapper">\n\t\t\t<form action="/paypal/oneclick/" class="js-oneclick-validate" method="POST">\n\t\t\t\t<div class="tv-card-info-collector__payment-message">\n\t\t\t\t\t<p class="tv-card-info-collector__payment-text">${"P"===e?M:O+` XXXX-XXXX-XXXX-<b>${e}</b>`}</p>\n\t\t\t\t</div>\n\t\t\t\t<input type="hidden" name="billing_cycle" value="${n}"/>\n\t\t\t\t<input type="hidden" name="product" value="${i}"/>\n\t\t\t\t<input type="hidden" name="child_products" value="${r}"/>\n\t\t\t\t<input type="hidden" name="exchanges_only" value="${s}"/>\n\t\t\t\t<input type="hidden" name="BILLTOFULLNAME" value="${o.first_name} ${o.last_name}"/>\n\t\t\t\t<div class="js-order-inputs"></div>\n\t\t\t\t${u?`<div>${u}</div>`:""}\n\t\t\t\t<div class="tv-card-info-collector__actions">\n\t\t\t\t\t<div class="tv-card-info-collector__actions--horz-offset">\n\t\t\t\t\t\t${G(c)}\n\t\t\t\t\t\t${X(a,h)}\n\t\t\t\t\t\t${J(l)}\n\t\t\t\t\t\t<div class="tv-card-info-collector__actions-container">\n\t\t\t\t\t\t\t${K(h)}\n\t\t\t\t\t\t\t${Z(d||p,"js-one-click-button")}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t</div>\n\t`}(t)}\n\t\t\t\t${function(t){if(!t.is_card_tab_visible||!t.is_card_allowed)return"";const{api_host:e,okText:n,non_pro_message:i,policy_message:r,ice_message:s,cancelText:o,footer:a}=t,l=t.buyButtonTitle||I
;return`\n\t\t<div class="tv-card-info-collector__tab-wrapper">\n\t\t\t<form action="https://${e}" method="POST" class="js-validate">\n\t\t\t\t<input type="hidden" name="SECURETOKEN" value=""/>\n\t\t\t\t<input type="hidden" name="SECURETOKENID" value=""/>\n\t\t\t\t<input type="hidden" name="ACCT" value=""/>\n\t\t\t\t<input type="hidden" name="EXPDATE" value=""/>\n\t\t\t\t<input type="hidden" name="BILLTOFIRSTNAME" value=""/>\n\t\t\t\t<input type="hidden" name="BILLTOLASTNAME" value=""/>\n\t\t\t\t<input type="hidden" name="BILLTOCOUNTRY" value=""/>\n\t\t\t\t<input type="hidden" name="BILLTOZIP" value=""/>\n\n\t\t\t\t<div class="tv-card-info-collector__card-wrapper">\n\t\t\t\t\t<div class="tv-card-info-collector__card-parts">\n\t\t\t\t\t\t<div class="tv-card-info-collector__input-holder">\n\t\t\t\t\t\t\t<div class="tv-card-info-collector__input-name">${j}</div>\n\t\t\t\t\t\t\t<input type="text" name="ACCT_visible" class="tv-control-input tv-control-input--size_large tv-card-info-collector__input-holder__card-input" maxlength="22" required autocomplete="cc-number" pattern="[0-9]*" inputmode="numeric" data-html2canvas-ignore>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="tv-card-info-collector__input-holder">\n\t\t\t\t\t\t\t<div class="tv-card-info-collector__input-name">${D}</div>\n\t\t\t\t\t\t\t<input type="text" name="EXPDATE_visible" class="tv-control-input tv-control-input--size_large tv-card-info-collector__input-holder__card-input" placeholder="MM/YY" maxlength="5" required autocomplete="cc-exp" pattern="[0-9]*" inputmode="numeric" data-html2canvas-ignore>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="tv-card-info-collector__input-holder">\n\t\t\t\t\t\t\t<div class="tv-card-info-collector__input-name">${V}</div>\n\t\t\t\t\t\t\t<input type="digits" name="CVV2" class="tv-control-input tv-control-input--size_large tv-card-info-collector__input-holder__card-input" maxlength="4" required autocomplete="cc-csc" pattern="[0-9]*" inputmode="numeric" data-html2canvas-ignore>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="tv-card-info-collector__card-parts">\n\t\t\t\t\t\t<div class="tv-card-info-collector__input-holder">\n\t\t\t\t\t\t\t<div class="tv-card-info-collector__input-name">${B}</div>\n\t\t\t\t\t\t\t<input type="text" name="BILLTOFULLNAME" class="tv-control-input tv-control-input--size_large tv-card-info-collector__input-holder__card-input" data-rule-latin="true" required autocomplete="cc-name" data-html2canvas-ignore>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="js-order-inputs"></div>\n\t\t\t\t${a?`<div>${a}</div>`:""}\n\t\t\t\t<div class="tv-card-info-collector__actions">\n\t\t\t\t\t<div class="tv-card-info-collector__actions--horz-offset">\n\t\t\t\t\t\t${G(s)}\n\t\t\t\t\t\t${X(i,o)}\n\t\t\t\t\t\t${J(r)}\n\t\t\t\t\t\t<div class="tv-card-info-collector__actions-container">\n\t\t\t\t\t\t\t${K(o)}\n\t\t\t\t\t\t\t${Z(n||l,"js-card-form")}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t</div>\n\t`}(t)}\n\t\t\t\t${function(t){
if(!t.is_paypal_tab_visible||!t.is_paypal_allowed)return"";const{billing_cycle:e,product_id:n,startTrial:i,exchanges_only:r,child_products:s,okText:o,cancelText:a,non_pro_message:l,policy_message:c,ice_message:d,footer:h}=t,u=t.buyButtonTitle||I;return`\n\t\t<div class="tv-card-info-collector__tab-wrapper">\n\t\t\t<form action="/paypal/expresscheckout/" class="js-expreccheckout-validate" method="POST">\n\t\t\t\t<input type="hidden" name="billing_cycle" value="${e||""}" />\n\t\t\t\t<input type="hidden" name="product" value="${n||""}" />\n\t\t\t\t<input type="hidden" name="trial_product" value="${i||""}" />\n\t\t\t\t<input type="hidden" name="exchanges_only" value="${r||""}" />\n\t\t\t\t<input type="hidden" name="child_products" value="${s||""}" />\n\n\t\t\t\t<div class="tv-card-info-collector__payment-message">\n\t\t\t\t\t<p class="tv-card-info-collector__payment-text">${z}</p>\n\t\t\t\t\t<p class="tv-card-info-collector__payment-text">${q}\n\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t<span>${H}</span>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t<div class="js-order-inputs"></div>\n\t\t\t\t${h?`<div>${h}</div>`:""}\n\t\t\t\t<div class="tv-card-info-collector__actions">\n\t\t\t\t\t<div class="tv-card-info-collector__actions--horz-offset">\n\t\t\t\t\t\t${G(d)}\n\t\t\t\t\t\t${X(l,a)}\n\t\t\t\t\t\t${J(c)}\n\t\t\t\t\t\t<div class="tv-card-info-collector__actions-container">\n\t\t\t\t\t\t\t${K(a)}\n\t\t\t\t\t\t\t${Z(o||u,"js-paypal-form")}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t</div>\n\t`}(t)}\n\t\t\t\t${function(t){if(!t.is_coinbase_allowed)return`\n\t\t\t<div class="tv-card-info-collector__tab-wrapper">\n\t\t\t\t<div class="tv-card-info-collector__payment-message">\n\t\t\t\t\t<p class="tv-card-info-collector__payment-text">\n\t\t\t\t\t\t${U.format({linkStart:'<a href class="js-card-info-collector__coinbase-button">',linkEnd:"</a>"})}\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`;const{non_pro_message:e,policy_message:n,ice_message:i,cancelText:r,okText:s,footer:o}=t,a=t.buyButtonTitle||I;return`\n\t\t<div class="tv-card-info-collector__tab-wrapper">\n\t\t\t<form action="/coinbase/begin/" method="POST" class="js-coinbase-validate">\n\t\t\t\t<div class="tv-card-info-collector__payment-message">\n\t\t\t\t\t<p class="tv-card-info-collector__payment-text">${Y}</p>\n\t\t\t\t\t<p class="tv-card-info-collector__payment-text">${q}\n\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t<span>${H}</span>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t<div class="js-order-inputs"></div>\n\t\t\t\t${o?`<div>${o}</div>`:""}\n\t\t\t\t<div class="tv-card-info-collector__actions">\n\t\t\t\t\t<div class="tv-card-info-collector__actions--horz-offset">\n\t\t\t\t\t\t${G(i)}\n\t\t\t\t\t\t${X(e,r)}\n\t\t\t\t\t\t${J(n)}\n\t\t\t\t\t\t<div class="tv-card-info-collector__actions-container">\n\t\t\t\t\t\t\t${Z(s||a,"js-card-info-collector__coinbase-button")}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t</div>\n\t`}(t)}\n\t\t\t</div>\n\t\t</div>\n\t`}var tt=n(23578),et=n(9078),nt=n(59496),it=n(87995),rt=n(66302)
;var st=n(30798),ot=n(85198),at=(n(43209),n(78754),n(8250),n(23127));const lt=t=>t.replace(/\D/g,"");class ct{constructor(t,e={}){const n=e.product&&(e.product.type===window.pro.PRODUCT_TYPES.exchange||e.child_products&&Object.keys(e.child_products).length>0),i=!("policy_checkbox"in e)||e.policy_checkbox,s=e.product&&("exchange-iceusa"===e.product.text_id||e.child_products&&void 0!==e.child_products["exchange-iceusa"]),o={address:!0,email:!0,billing_cycle:null,exchanges_only:null,child_products:{},paymentMethodHint:null,api_host:null,userBillingInfo:{},user:window.user,ice_message:s?(0,r.t)("I have read and agreed with the {link_start}ICE Subscriber Agreement{link_end}").format({link_start:'<a href="https://s3.tradingview.com/exchange-agreements/ice-subscriber-addendum.pdf" target="_blank" tabindex="-1">',link_end:"</a>"}):null,non_pro_message:n?(0,r.t)("I'm a non-professional trader"):null,non_pro_message_hint:(0,r.t)("Non-professional trader means any natural person who receives market data solely for his/her personal, non-business use and cannot be a corporation, trust, organization, institution or partnership account."),policy_message:i?(0,r.t)("I have read and agreed to the {linkTermsStart}Terms of Use{linkEnd} and {linkPolicyStart}Privacy Policy{linkEnd}").format({linkTermsStart:'<a target="_blank" href="/policies/" tabindex="-1">',linkPolicyStart:'<a target="_blank" href="/privacy-policy/" tabindex="-1">',linkEnd:"</a>"}):null,currency:$.Currencies.Usd,payment_method:"paypal",is_card_allowed:!0,is_card_tab_visible:!0,is_paypal_allowed:!0,is_paypal_tab_visible:!0,is_coinbase_allowed:!0,is_coinbase_tab_visible:!0};e.paymentMethodHint&&(o.is_reference_allowed=!0,o.is_reference_tab_visible=!0);const a=Object.assign(o,e);a.child_products=Object.keys(a.child_products),a.product_id=pro.getProductId(e.product)||a.child_products[0],a.child_products=a.child_products.join(","),this.$html=at(Q(a)),this.$cvvInput=this.$html.find('[name="CVV2"]'),this.$cardNumberInput=this.$html.find('input[name="ACCT_visible"]'),this.$expDateInput=this.$html.find('[name="EXPDATE_visible"]'),this.$acctInput=this.$html.find('[name="ACCT"]'),this.$expDate=this.$html.find('[name="EXPDATE"]'),this.currency=a.currency,this.paymentMethod=a.payment_method,this.showNonProCheckboxes=n,this.showPolicyCheckboxes=i,this.showICEMessageCheckboxes=s,this.showEmail=a.email,this.showAddress=a.address,this.nonProCheckboxes=[],this.policyCheckboxes=[],this.iceMessageCheckboxes=[],this.userBillingInfo=a.userBillingInfo,this.inputsValidators=new Map,this.excludedFields=a.excludedFields,this.onCountryChange=a.onCountryChange,t.empty().append(this.$html),this.initTabs(),this.showNonProCheckboxes&&this.initNonProCheck(a),i&&this.initCheck(".js-policy-container",".js-policy-checkbox-wrap",".js-policy-checkbox","policy-checkbox",this.policyCheckboxes),s&&this.initCheck(".js-ice-message-container",".js-ice-message-checkbox-wrap",".js-ice-message-checkbox","ice-message-checkbox",this.iceMessageCheckboxes),this.initForm(a),this.assignPaymentDialogHandlers({
product:e.product,trial_product:e.startTrial,billing_cycle:e.billing_cycle,exchanges_only:e.exchanges_only,child_products:e.child_products,is_coinbase_allowed:e.is_coinbase_allowed,update_product:e.update_product}),this.assignPaymentDialogCancelHandler(e.onCancel),a.is_card_tab_visible&&this.assignCardInputHandlers()}initOrderInputs(t){const e=t.get(0),n=e.querySelector(".js-order-inputs");this.inputsValidators.set(e,{}),function(t){const{addressTitle:e,container:n,billingInfo:i,showEmail:r,showAddress:s,onChange:o,setValidators:a,className:l,onCountryChange:c,excludedFields:d=new Set}=t;it.render(nt.createElement(rt.OrderInputs,{addressTitle:e,billingInfo:i,showEmail:r,showAddress:s,onChange:o,onSetValidators:a,className:l,excludedFields:d,onCountryChange:c}),n)}({addressTitle:(0,r.t)("Billing address"),container:n,billingInfo:this.userBillingInfo,showEmail:this.showEmail,showAddress:this.showAddress,onChange:e=>{t.data("orderInputs",e)},setValidators:(t,n)=>{this.inputsValidators.get(e)[t]=n},excludedFields:this.excludedFields,onCountryChange:this.onCountryChange})}cardValidateRules(t,e){return{onError:()=>{t.find(".js-card-form").tvButtonLoader("stop"),this.setStartSubmitFlag(!1)},rules:{...{CVV2:{required:!0,maxlength:4,custom:(t,e)=>{var n=lt(this.$cardNumberInput.val());return n.startsWith("35")&&t.length>0&&3!==t.length?(0,r.t)("JCB must have 3 symbols in CVV/CSC code"):(n.startsWith("34")||n.startsWith("37"))&&t.length>0&&4!==t.length?(0,r.t)("AMEX must have 4 symbols in CVV/CSC code"):(n.startsWith("4")||n.startsWith("5"))&&t.length>0&&3!==t.length?(0,r.t)("VISA and Mastercard must have 3 symbols in CVV/CSC code"):void 0}},...P},...e}}}initCardData(t,e){const n=this.cardValidateRules(t,e);this.initOrderInputs(t),t.tvFormValidate(n)}oneClickRules(t){return{onError:()=>{this.$html.find(".js-one-click-button").tvButtonLoader("stop"),this.setStartSubmitFlag(!1)},validateElements:["select"],rules:t}}initOneClickData(t,e){const n=this.oneClickRules(e);this.initOrderInputs(t),t.tvFormValidate(n)}coinbaseRules(t){return{onError:()=>{this.$html.find(".js-card-info-collector__coinbase-button").tvButtonLoader("stop"),this.setStartSubmitFlag(!1)},rules:t}}initCoinbaseData(t,e){const n=this.coinbaseRules(e);this.initOrderInputs(t),t.tvFormValidate(n)}expressCheckoutRules(t){return{onError:()=>{this.$html.find(".js-paypal-form").tvButtonLoader("stop"),this.setStartSubmitFlag(!1)},rules:t}}initExpressCheckoutData(t,e){const n=this.expressCheckoutRules(e);this.initOrderInputs(t),t.tvFormValidate(n)}initForm({non_pro_message_hint:t}){var e={};this.showNonProCheckboxes&&(e={non_pro_confirmed:{custom:(e,n)=>{if(!n.prop("checked"))return t}}});var n={};this.showPolicyCheckboxes&&(n={"policy-checkbox":{custom:(t,e)=>{if(!e.prop("checked"))return(0,r.t)("You need to accept our Terms of Use and Privacy Policy to continue")}}});var i={};this.showICEMessageCheckboxes&&(i={"ice-message-checkbox":{custom:(t,e)=>{if(!e.prop("checked"))return(0,r.t)("This field is required")}}});const s={...e,...n,...i},o=this.$html.find(".js-validate")
;o.length>0&&this.initCardData(o,s);const a=this.$html.find(".js-oneclick-validate");a.length>0&&this.initOneClickData(a,s);const l=this.$html.find(".js-coinbase-validate");l.length>0&&this.initCoinbaseData(l,s);const c=this.$html.find(".js-expreccheckout-validate");c.length>0&&this.initExpressCheckoutData(c,s)}initTabs(){this.$html.find(".js-tabs").each((t,e)=>{const n=this.$html.find(".js-pages").get(0);this.tabs=new b(e,n,{activeTabClass:"i-active",activePageClass:null,inactiveTabClass:null,inactivePageClass:"i-hidden"}),this.tabs.tabChanged.subscribe(null,()=>{if(!this.onCountryChange)return;const t=Array.from(n.children).find(t=>!t.classList.contains("i-hidden")),e=at(t.querySelector("form")).data("orderInputs"),i=e?e[st.OrderInputsConsts.Country]:void 0;this.onCountryChange(i)}),setTimeout(()=>{this.tabs.updateSlider(0,0,!0),"bitcoin"===this.paymentMethod?this.tabs.setActivePage(this.tabs.count()-1):this.tabs.setActivePage(0)},100)})}initNonProCheck({non_pro_message_hint:t}){const e=this.$html.find("form");this.$html.find(".js-non-pro-container").each((n,i)=>{const r=at(i).find(".js-non-pro-checkbox-wrap"),s=r.find(".tv-control-checkbox"),o=r.find(".js-non-pro-checkbox");s.data("tv-control-error-wrap",r),this.nonProCheckboxes.push(o),o.change(()=>{this.nonProCheckboxes.forEach(t=>{t.prop("checked",o.prop("checked"))}),e.each((t,e)=>{at(e).tvFormValidate("validateField","non_pro_confirmed")})});const a=r.find(".js-non-pro-help-button");let l;a.mouseenter(()=>{l=Date.now(),e.each((e,n)=>{const i=at(n).tvFormValidate("getInstance").fields;if("non_pro_confirmed"in i){const{view:e}=i.non_pro_confirmed;e.hasErrors()||(e.add({id:l,message:t}),e.render())}})}),a.mouseleave(()=>{e.each((t,e)=>{const n=at(e).tvFormValidate("getInstance").fields;if("non_pro_confirmed"in n){const{view:t}=n.non_pro_confirmed;t.remove({id:l}),t.render()}})})})}initCheck(t,e,n,i,r){const s=this.$html.find("form");this.$html.find(t).each((t,o)=>{const a=at(o).find(e),l=a.find(".tv-control-checkbox"),c=a.find(n);l.data("tv-control-error-wrap",a),r.push(c),c.change(()=>{r.forEach(t=>{t.prop("checked",c.prop("checked"))}),s.each((t,e)=>{at(e).tvFormValidate("validateField",i)})})})}setStartSubmitFlag(t){this._submitStarted=!!t}isSubmitStarted(){return this._submitStarted}checkFormValidity(t){let e=!0;this.showPolicyCheckboxes&&(e=t.find(".js-policy-checkbox").prop("checked"),t.tvFormValidate("validateField","policy-checkbox"));let n=!0;this.showNonProCheckboxes&&(n=t.find(".js-non-pro-checkbox").prop("checked"),t.tvFormValidate("validateField","non_pro_confirmed"));let i=!0;this.showICEMessageCheckboxes&&(i=t.find(".js-ice-message-checkbox").prop("checked"),t.tvFormValidate("validateField","ice-message-checkbox"));const r=this.inputsValidators.get(t[0]);Object.keys(r).forEach(t=>{"function"==typeof r[t]&&r[t]()});const s=t.data("orderInputs");return n&&e&&i&&s.isValid}checkOrder(t,e){return Object.keys(e).forEach(t=>{void 0===e[t]&&delete e[t]}),new Promise((n,i)=>{(0,ot.fetch)(t,{method:"POST",credentials:"include",headers:{
"Content-Type":"application/json"},body:JSON.stringify(e)}).then(t=>t.json()).then(t=>{if(t.go_on_error&&(window.location.href="/paypal/error/"),t.code||t.detail)return i(t);n(t)}).catch(i)})}showError(t,e,n){(0,et.showErrorDialog)({title:e,content:t,btnTitle:n})}assignPaymentDialogCancelHandler(t){this.$html.on("click",".js-cancel-btn",e=>{e.preventDefault(),t&&t(e)})}assignPaymentDialogHandlers(t={}){const e=t.billing_cycle||"",n=Boolean(t.exchanges_only),i=t.is_coinbase_allowed,s=Object.keys(t.child_products||{}),o=pro.getProductId(t.product)||s[0],a=t.trial_product,l=(t,i,l={},c={})=>new Promise((d,h)=>{this.setStartSubmitFlag(!0);const u=t.data("orderInputs");let p;if(u){const{isValid:t,...e}=u;c={...c,...e},p=u[st.OrderInputsConsts.BillToEmail]}const f=t.find('input[name="non_pro_confirmed"]');let _;f.length&&(_=f.is(":checked")),this.checkOrder(i,{exchanges_only:n,email:p,product:o,billing_cycle:e,trial_product:a,child_products:s.join(","),non_pro_confirmed:_,...l,...c}).then(t=>{d(t)}).catch(t=>(this.setStartSubmitFlag(!1),t?("anonymization_activated"===t.code?this.showError((0,r.t)("Your order can't be processed due to an active account deletion request. Please cancel it by clicking Cancel Account Deletion at the bottom of the page and try placing an order again."),(0,r.t)("We are unable to process your order"),(0,r.t)("Got it")):this.showError(t.detail),h(t)):h()))});this.$html.on("click",".js-card-form",e=>{const n=at(e.currentTarget),i=n.closest("form");if(e.preventDefault(),this.isSubmitStarted())return;if(!this.checkFormValidity(i))return;const r=lt(i.find('input[name="ACCT_visible"]').val()),s=(lt(i.find('input[name="CVV2"]').val()),lt(i.find('input[name="EXPDATE_visible"]').val())),o=A(T(i).val());i.find('input[name="ACCT"]').val(r),i.find('input[name="EXPDATE"]').val(s),i.find('input[name="BILLTOFIRSTNAME"]').val(o[0]),i.find('input[name="BILLTOLASTNAME"]').val(o[1]);n.tvButtonLoader("start"),l(i,"/order/transaction-details/",{merchant:"paypal",firstname:o[0],lastname:o[1],update_product:t.update_product},{}).then(t=>{t.token&&t.token_id&&(i.find('input[name="SECURETOKEN"]').val(t.token),i.find('input[name="SECURETOKENID"]').val(t.token_id)),i.submit()}).catch(()=>{n.tvButtonLoader("stop")})}),this.$html.on("click",".js-one-click-button",t=>{const e=at(t.currentTarget),n=e.closest("form");if(t.preventDefault(),this.isSubmitStarted())return;if(!this.checkFormValidity(n))return;const i=A(T(n).val());e.tvButtonLoader("start"),l(n,"/order/transaction-details/",{merchant:"paypal",firstname:i[0],lastname:i[1]}).then(()=>{n.submit()}).catch(()=>{e.tvButtonLoader("stop")})}),this.$html.on("click",".js-paypal-form",e=>{const n=at(e.currentTarget),i=n.closest("form");e.preventDefault(),this.isSubmitStarted()||this.checkFormValidity(i)&&(n.tvButtonLoader("start"),l(i,"/order/transaction-details/",{merchant:"paypal",update_product:t.update_product}).then(()=>{i.submit()}).catch(()=>{n.tvButtonLoader("stop")}))}),this.$html.on("click",".js-card-info-collector__coinbase-button",n=>{
const r=at(n.currentTarget),s=r.closest("form");if(n.preventDefault(),!i)return(0,tt.visitPaymentPage)(e,{productName:t.product.text_id});this.isSubmitStarted()||this.checkFormValidity(s)&&(r.tvButtonLoader("start"),l(s,"/order/transaction-details/",{merchant:"coinbase",currency:this.currency}).then(()=>{s.submit()}).catch(()=>{r.tvButtonLoader("stop")}))})}handleCardInputEvent(t,e,n){t&&("function"==typeof e&&t.addEventListener("input",n=>{t.value=e(t.value);const i=new Event("change");t.dispatchEvent(i)}),"function"==typeof n&&t.addEventListener("change",e=>n(t.value)))}assignCardInputHandlers(){const t=(t,e,n=" ")=>{const i=[];let r,s=0;for(;s<e.length&&t.length>e[s];s++)r=e[s-1]?e[s-1]:0,i.push(t.substr(r,e[s]-r));return i[0]&&i.push(t.substring(e[s-1])),i.join(n)};this.handleCardInputEvent(this.$cardNumberInput.get(0),e=>{if((e=lt(e)).length>4){let n=[];return n="3"===e[0]&&"4"===e[1]||"7"===e[1]?[4,10]:[4,8,12],t(e,n," ")}return e},t=>{const e=lt(t);this.$acctInput.val(e),((e.startsWith("34")||e.startsWith("37"))&&15===e.length||(e.startsWith("4")||e.startsWith("5"))&&16===e.length||19===e.length)&&this.$expDateInput.focus()}),this.handleCardInputEvent(this.$expDateInput.get(0),e=>(e=lt(e)).length>2?t(e,[2],"/"):e,t=>{const e=lt(t);this.$expDate.val(e),4===e.length&&this.$cvvInput.focus()}),this.handleCardInputEvent(this.$cvvInput.get(0),t=>lt(t),t=>{const e=this.$cardNumberInput.val();(4===t.length||3===t.length&&(e.startsWith("4")||e.startsWith("5")))&&T(this.$html).focus()}),this.handleCardInputEvent(T(this.$html).get(0)),this.handleCardInputEvent(this.$html.find(`input[name="${st.OrderInputsConsts.Zip}"`).get(0))}}var dt=n(78540),ht=n(53402),ut=n(49483),pt=n(76266),ft=n(27468),_t=n(12107),mt=n(23651),vt=n(93573),gt=n(82531),bt=n(71385);const yt=r.t("Skip trial and pay now"),Ct=r.t("I have read and agreed with the {policiesLinkTag}Terms of Use{linkCloseTag} and {pivacyPolicyLinkTag}Privacy Policy{linkCloseTag}"),wt=r.t("I authorize TradingView to charge me automatically every year until I cancel my subscription."),xt=r.t("I authorize TradingView to charge me automatically every month until I cancel my subscription."),St=r.t("If the auto renewal fails for an annual plan I will automatically be switched to a monthly plan for {cost} per month."),Et=r.t("I acknowledge that refunds are NOT available for monthly payments.");async function kt(t){const{createDialog:e}=await Promise.all([n.e(3118),n.e(1729),n.e(1536),n.e(4002)]).then(n.bind(n,89725)),i=window.pro,{startTrial:s,billingCycle:o}=t,{current_country_code:a}=await(0,vt.getCountries)();i.findProduct(s).then(t=>{const n=(0,gt.getTrialLength)(),l=r.t("Start {days}-day free trial",{plural:"Start {days}-day free trial",context:"free_trial",count:n}),c=r.t("Start free {days}-day {trial_plan_name}",{plural:"Start free {days}-day {trial_plan_name}",context:"free_trial",count:n}),d=e({type:"modal",width:768,closeOnEsc:!1,destroyOnClose:!0,closeOnOutsideClick:!1,fixBodyState:!ut.CheckMobile.any(),title:c.format({days:n.toString(),trial_plan_name:(0,
ht.humanizeProPlan)(s,!0)}),titleTemplate:`<h2 class="${bt["tv-start-free-trial__title"]}">{{{ title }}}</h2>`,content:"<div>",addClass:bt["tv-start-free-trial"]+" tv-text",contentWrapTemplate:`<div class="${bt["tv-start-free-trial__section"]} tv-dialog__section--no-border">`});let h;const u=Ct.format({policiesLinkTag:'<a target="_blank" tabindex="-1" href="/policies/">',pivacyPolicyLinkTag:'<a target="_blank" tabindex="-1" href="/privacy-policy/">',linkCloseTag:"</a>"});o===dt.BillingCycle.OneYear?(h=wt,(0,pt.isFeatureEnabled)("switching_trial_year_to_month_disabled")||(h+=" "+St.format({cost:(0,ft.formatPrice)(i.getCost(t,dt.BillingCycle.Monthly))})),h+=" "+u):h=`${xt}<br>${Et} ${u}`;let p=null,f=null;async function _(t){if(p===t||!t)return;p=t;const e=await(0,mt.getPrice)({products:[s],billingCycle:o,billingAddress:{country_code_alpha2:p}});var n;0!==e.results.length&&(n=e.results[0].price,f&&f(n))}const m={api_host:window.initData.api_host,startTrial:s,billing_cycle:o,product:i.getProduct("update-payment-info-verification"),address:!1,okText:l.format({days:n.toString()}),cancelText:yt,policy_checkbox:!0,policy_message:h,is_coinbase_allowed:!1,is_coinbase_tab_visible:!1,onCancel:()=>{(0,_t.trackTrialAction)(s,o,"skip","paypal"),(0,tt.visitPaymentPage)(o,{paymentMethod:"paypal",productName:s})},footer:(0,ft.getTemplate)({productData:t,billingCycle:o,setChangePriceCallback:t=>{f=t}}),excludedFields:new Set([st.OrderInputsConsts.BillToEmail,st.OrderInputsConsts.CardholderName]),onCountryChange:_};new ct(d.$content,m),_(a),d.on("afterClose",()=>(0,_t.trackTrialAction)(s,o,"close","paypal")),d.open(),(0,_t.trackTrialAction)(s,o,"show","paypal")})}},1405:(t,e,n)=>{"use strict";n.d(e,{anchors:()=>i});n(59496);const i={bottom:{attachment:{horizontal:"left",vertical:"top"},targetAttachment:{horizontal:"left",vertical:"bottom"}},top:{attachment:{horizontal:"left",vertical:"bottom"},targetAttachment:{horizontal:"left",vertical:"top"}},topRight:{attachment:{horizontal:"right",vertical:"bottom"},targetAttachment:{horizontal:"right",vertical:"top"}},bottomRight:{attachment:{horizontal:"right",vertical:"top"},targetAttachment:{horizontal:"right",vertical:"bottom"}}}},70412:(t,e,n)=>{"use strict";n.d(e,{hoverMouseEventFilter:()=>s,useAccurateHover:()=>o,useHover:()=>r});var i=n(59496);function r(){const[t,e]=(0,i.useState)(!1);return[t,{onMouseOver:function(t){s(t)&&e(!0)},onMouseOut:function(t){s(t)&&e(!1)}}]}function s(t){return!t.currentTarget.contains(t.relatedTarget)}function o(t){const[e,n]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{const e=e=>{if(null===t.current)return;const i=t.current.contains(e.target);n(i)};return document.addEventListener("mouseover",e),()=>document.removeEventListener("mouseover",e)},[]),e}},10959:(t,e,n)=>{"use strict";n.d(e,{ErrorIcon:()=>l});var i=n(59496),r=n(97754),s=n(9745),o=n(83546),a=n(93314);function l(t){const{intent:e="danger"}=t;return i.createElement(s.Icon,{icon:o,className:r(a["error-icon"],a["intent-"+e])})}},86623:(t,e,n)=>{"use strict";n.d(e,{FormInput:()=>c})
;var i=n(59496),r=n(31261),s=n(86629),o=n(78274),a=n(47201),l=n(66092);function c(t){var e;const{intent:n,onFocus:c,onBlur:d,onMouseOver:h,onMouseOut:u,containerReference:p=null,endSlot:f,hasErrors:_,hasWarnings:m,errors:v,warnings:g,alwaysShowAttachedErrors:b,iconHidden:y,messagesPosition:C,messagesAttachment:w,customErrorsAttachment:x,messagesRoot:S,inheritMessagesWidthFromTarget:E,disableMessagesRtlStyles:k,...T}=t,A=(0,s.useControlValidationLayout)({hasErrors:_,hasWarnings:m,errors:v,warnings:g,alwaysShowAttachedErrors:b,iconHidden:y,messagesPosition:C,messagesAttachment:w,customErrorsAttachment:x,messagesRoot:S,inheritMessagesWidthFromTarget:E,disableMessagesRtlStyles:k}),P=(0,a.createSafeMulticastEventHandler)(c,A.onFocus),$=(0,a.createSafeMulticastEventHandler)(d,A.onBlur),O=(0,a.createSafeMulticastEventHandler)(h,A.onMouseOver),M=(0,a.createSafeMulticastEventHandler)(u,A.onMouseOut);return i.createElement(i.Fragment,null,i.createElement(r.InputControl,{...T,intent:null!==(e=A.intent)&&void 0!==e?e:n,onFocus:P,onBlur:$,onMouseOver:O,onMouseOut:M,containerReference:(0,l.useMergedRefs)([p,A.containerReference]),endSlot:i.createElement(i.Fragment,null,A.icon&&i.createElement(o.EndSlot,{icon:!0},A.icon),f)}),A.renderedErrors)}},86629:(t,e,n)=>{"use strict";n.d(e,{MessagesPosition:()=>v,useControlValidationLayout:()=>T});var i=n(59496),r=n(97754),s=n(29202),o=n(70412),a=n(78274),l=n(1405),c=n(86431),d=n(87995);var h=n(66875),u=n(62820);class p extends i.PureComponent{render(){const{children:t=[],show:e=!1,customErrorClass:n,disableRtlStyles:s}=this.props,o=r(h.errors,{[h.show]:e},n),a=t.map((t,e)=>i.createElement("div",{className:h.error,key:e},t));let l={position:"absolute",top:this.props.top,width:this.props.width,height:this.props.height,bottom:void 0!==this.props.bottom?this.props.bottom:"100%",right:void 0!==this.props.right?this.props.right:0,left:this.props.left,zIndex:this.props.zIndex,maxWidth:this.props.maxWidth};if((0,u.isRtl)()&&!s){const{left:t,right:e}=l;l={...l,left:e,right:t}}return i.createElement("div",{style:l,className:o},a)}}const f=(0,c.makeOverlapable)((_=p,(m=class extends i.PureComponent{constructor(t){super(t),this._getComponentInstance=t=>{this._instance=t},this._throttleCalcProps=()=>{requestAnimationFrame(()=>this.setState(this._calcProps(this.props)))},this.state=this._getStateFromProps()}componentDidMount(){this._instanceElem=d.findDOMNode(this._instance),this.props.attachOnce||this._subscribe(),this.setState(this._calcProps(this.props))}componentDidUpdate(t){t.children===this.props.children&&t.top===this.props.top&&t.left===this.props.left&&t.width===this.props.width||this.setState(this._getStateFromProps(),()=>this.setState(this._calcProps(this.props)))}render(){return i.createElement("div",{style:{position:"absolute",width:"100%",top:0,left:0}},i.createElement(_,{...this.props,ref:this._getComponentInstance,top:this.state.top,bottom:void 0!==this.state.bottom?this.state.bottom:"auto",right:void 0!==this.state.right?this.state.right:"auto",left:this.state.left,
width:this.state.width,maxWidth:this.state.maxWidth},this.props.children))}componentWillUnmount(){this._unsubsribe()}_getStateFromProps(){return{bottom:this.props.bottom,left:this.props.left,right:this.props.right,top:void 0!==this.props.top?this.props.top:-1e4,width:this.props.inheritWidthFromTarget?this.props.target&&this.props.target.getBoundingClientRect().width:this.props.width,maxWidth:this.props.inheritMaxWidthFromTarget&&this.props.target&&this.props.target.getBoundingClientRect().width}}_calcProps(t){if(t.target&&t.attachment&&t.targetAttachment){const e=this._calcTargetProps(t.target,t.attachment,t.targetAttachment);if(null===e)return{};const{width:n,inheritWidthFromTarget:i=!0,inheritMaxWidthFromTarget:r=!1}=this.props,s={width:i?e.width:n,maxWidth:r?e.width:void 0};switch(t.attachment.vertical){case"bottom":case"middle":s.top=e.y;break;default:s[t.attachment.vertical]=e.y}switch(t.attachment.horizontal){case"right":case"center":s.left=e.x;break;default:s[t.attachment.horizontal]=e.x}return s}return{}}_calcTargetProps(t,e,n){const i=t.getBoundingClientRect(),r=this._instanceElem.getBoundingClientRect(),s="parent"===this.props.root?this._getCoordsRelToParentEl(t,i):this._getCoordsRelToDocument(i);if(null===s)return null;const o=this._getDimensions(r),a=this._getDimensions(i).width;let l=0,c=0;switch(e.vertical){case"top":c=s[n.vertical];break;case"bottom":c=s[n.vertical]-o.height;break;case"middle":c=s[n.vertical]-o.height/2}switch(e.horizontal){case"left":l=s[n.horizontal];break;case"right":l=s[n.horizontal]-o.width;break;case"center":l=s[n.horizontal]-o.width/2}return"number"==typeof this.props.attachmentOffsetY&&(c+=this.props.attachmentOffsetY),"number"==typeof this.props.attachmentOffsetX&&(l+=this.props.attachmentOffsetX),{x:l,y:c,width:a}}_getCoordsRelToDocument(t){const e=pageYOffset,n=pageXOffset,i=t.top+e,r=t.bottom+e,s=t.left+n;return{top:i,bottom:r,left:s,right:t.right+n,middle:(i+t.height)/2,center:s+t.width/2}}_getCoordsRelToParentEl(t,e){const n=t.offsetParent;if(null===n)return null;const i=n.scrollTop,r=n.scrollLeft,s=t.offsetTop+i,o=t.offsetLeft+r,a=e.width+o;return{top:s,bottom:e.height+s,left:o,right:a,middle:(s+e.height)/2,center:(o+e.width)/2}}_getDimensions(t){return{height:t.height,width:t.width}}_subscribe(){"document"===this.props.root&&(window.addEventListener("scroll",this._throttleCalcProps,!0),window.addEventListener("resize",this._throttleCalcProps))}_unsubsribe(){window.removeEventListener("scroll",this._throttleCalcProps,!0),window.removeEventListener("resize",this._throttleCalcProps)}}).displayName="Attachable Component",m));var _,m,v,g,b=n(10959),y=n(52965);!function(t){t[t.Attached=0]="Attached",t[t.Static=1]="Static",t[t.Hidden=2]="Hidden"}(v||(v={})),function(t){t.Top="top",t.Bottom="bottom"}(g||(g={}));const C={top:{attachment:l.anchors.topRight.attachment,targetAttachment:l.anchors.topRight.targetAttachment,attachmentOffsetY:-4},bottom:{attachment:l.anchors.bottomRight.attachment,targetAttachment:l.anchors.bottomRight.targetAttachment,attachmentOffsetY:4}}
;function w(t){const{isOpened:e,target:n,errorAttachment:r=g.Top,customErrorsAttachment:s,root:o="parent",inheritWidthFromTarget:a=!1,disableRtlStyles:l,children:c}=t,{attachment:d,targetAttachment:h,attachmentOffsetY:u}=null!=s?s:C[r];return i.createElement(f,{isOpened:e,target:n,root:o,inheritWidthFromTarget:a,attachment:d,targetAttachment:h,attachmentOffsetY:u,disableRtlStyles:l,inheritMaxWidthFromTarget:!0,show:!0},c)}function x(t,e){return Boolean(t)&&void 0!==e&&e.length>0}function S(t,e,n){return t===v.Attached&&x(e,n)}function E(t,e,n){return t===v.Static&&x(e,n)}function k(t,e,n){const{hasErrors:i,hasWarnings:r,alwaysShowAttachedErrors:s,iconHidden:o,errors:a,warnings:l,messagesPosition:c=v.Static}=t,d=S(c,i,a),h=S(c,r,l),u=d&&(e||n||Boolean(s)),p=!u&&h&&(e||n),f=E(c,i,a),_=!f&&E(c,r,l),m=!o&&Boolean(i);return{hasAttachedErrorMessages:d,hasAttachedWarningMessages:h,showAttachedErrorMessages:u,showAttachedWarningMessages:p,showStaticErrorMessages:f,showStaticWarningMessages:_,showErrorIcon:m,showWarningIcon:!o&&!m&&Boolean(r),intent:function(t,e){return Boolean(t)?"danger":Boolean(e)?"warning":void 0}(i,r)}}function T(t){var e,n;const{errors:l,warnings:c,messagesAttachment:d,customErrorsAttachment:h,messagesRoot:u,inheritMessagesWidthFromTarget:p,disableMessagesRtlStyles:f}=t,[_,m]=(0,s.useFocus)(),[v,g]=(0,o.useHover)(),C=(0,i.useRef)(null),{hasAttachedErrorMessages:x,hasAttachedWarningMessages:S,showAttachedErrorMessages:E,showAttachedWarningMessages:T,showStaticErrorMessages:A,showStaticWarningMessages:P,showErrorIcon:$,showWarningIcon:O,intent:M}=k(t,_,v),I=$||O?i.createElement(b.ErrorIcon,{intent:$?"danger":"warning"}):void 0,L=x?i.createElement(w,{errorAttachment:d,customErrorsAttachment:h,isOpened:E,target:C.current,root:u,inheritWidthFromTarget:p,disableRtlStyles:f,children:l}):void 0,W=S?i.createElement(w,{errorAttachment:d,isOpened:T,target:C.current,root:u,inheritWidthFromTarget:p,disableRtlStyles:f,children:c}):void 0,F=A?i.createElement(a.AfterSlot,{className:r(y["static-messages"],y.errors)},null==l?void 0:l.map((t,e)=>i.createElement("p",{key:e,className:y.message},t))):void 0,R=P?i.createElement(a.AfterSlot,{className:r(y["static-messages"],y.warnings)},null==c?void 0:c.map((t,e)=>i.createElement("p",{key:e,className:y.message},t))):void 0;return{icon:I,renderedErrors:null!==(n=null!==(e=null!=L?L:W)&&void 0!==e?e:F)&&void 0!==n?n:R,containerReference:C,intent:M,...m,...g}}},64706:(t,e,n)=>{"use strict";n.d(e,{MenuContext:()=>i});const i=n(59496).createContext(null)},27317:(t,e,n)=>{"use strict";n.d(e,{DEFAULT_MENU_THEME:()=>m,Menu:()=>v});var i=n(59496),r=n(97754),s=n.n(r),o=n(88537),a=n(64514),l=n(54475),c=n(50655),d=n(59064),h=n(88216),u=n(25760),p=n(14758),f=n(64706),_=n(16059);const m=_;class v extends i.PureComponent{constructor(t){super(t),this._containerRef=null,this._scrollWrapRef=null,this._raf=null,this._scrollRaf=null,this._scrollTimeout=void 0,this._manager=new h.OverlapManager,this._hotkeys=null,this._scroll=0,this._handleContainerRef=t=>{this._containerRef=t,
this.props.reference&&("function"==typeof this.props.reference&&this.props.reference(t),"object"==typeof this.props.reference&&(this.props.reference.current=t))},this._handleScrollWrapRef=t=>{this._scrollWrapRef=t,"function"==typeof this.props.scrollWrapReference&&this.props.scrollWrapReference(t),"object"==typeof this.props.scrollWrapReference&&(this.props.scrollWrapReference.current=t)},this._handleMeasure=({callback:t,forceRecalcPosition:e}={})=>{var n,i,r,s;if(this.state.isMeasureValid&&!e)return;const{position:l}=this.props,c=(0,o.ensureNotNull)(this._containerRef);let d=c.getBoundingClientRect();const h=document.documentElement.clientHeight,u=document.documentElement.clientWidth,p=null!==(n=this.props.closeOnScrollOutsideOffset)&&void 0!==n?n:0;let f=h-0-p;const _=d.height>f;if(_){(0,o.ensureNotNull)(this._scrollWrapRef).style.overflowY="scroll",d=c.getBoundingClientRect()}const{width:m,height:v}=d,g="function"==typeof l?l(m,v,h):l,b=u-(null!==(i=g.overrideWidth)&&void 0!==i?i:m)-0,y=(0,a.clamp)(g.x,0,Math.max(0,b)),C=0+p,w=h-(null!==(r=g.overrideHeight)&&void 0!==r?r:v)-0;let x=(0,a.clamp)(g.y,C,Math.max(C,w));if(g.forbidCorrectYCoord&&x<g.y&&(f-=g.y-x,x=g.y),e&&void 0!==this.props.closeOnScrollOutsideOffset&&g.y<=this.props.closeOnScrollOutsideOffset)return void this._handleGlobalClose(!0);const S=null!==(s=g.overrideHeight)&&void 0!==s?s:_?f:void 0;this.setState({appearingMenuHeight:e?this.state.appearingMenuHeight:S,appearingMenuWidth:e?this.state.appearingMenuWidth:g.overrideWidth,appearingPosition:{x:y,y:x},isMeasureValid:!0},()=>{this._restoreScrollPosition(),t&&t()})},this._restoreScrollPosition=()=>{const t=document.activeElement,e=(0,o.ensureNotNull)(this._containerRef);if(null!==t&&e.contains(t))try{t.scrollIntoView()}catch(t){}else(0,o.ensureNotNull)(this._scrollWrapRef).scrollTop=this._scroll},this._resizeForced=()=>{this.setState({appearingMenuHeight:void 0,appearingMenuWidth:void 0,appearingPosition:void 0,isMeasureValid:void 0})},this._resize=()=>{null===this._raf&&(this._raf=requestAnimationFrame(()=>{this.setState({appearingMenuHeight:void 0,appearingMenuWidth:void 0,appearingPosition:void 0,isMeasureValid:void 0}),this._raf=null}))},this._handleGlobalClose=t=>{this.props.onClose(t)},this._handleSlot=t=>{this._manager.setContainer(t)},this._handleScroll=()=>{this._scroll=(0,o.ensureNotNull)(this._scrollWrapRef).scrollTop},this._handleScrollOutsideEnd=()=>{clearTimeout(this._scrollTimeout),this._scrollTimeout=setTimeout(()=>{this._handleMeasure({forceRecalcPosition:!0})},80)},this._handleScrollOutside=t=>{t.target!==this._scrollWrapRef&&(this._handleScrollOutsideEnd(),null===this._scrollRaf&&(this._scrollRaf=requestAnimationFrame(()=>{this._handleMeasure({forceRecalcPosition:!0}),this._scrollRaf=null})))},this.state={}}componentDidMount(){this._handleMeasure({callback:this.props.onOpen});const{customCloseDelegate:t=d.globalCloseDelegate}=this.props;t.subscribe(this,this._handleGlobalClose),window.addEventListener("resize",this._resize);const e=null!==this.context
;this._hotkeys||e||(this._hotkeys=u.createGroup({desc:"Popup menu"}),this._hotkeys.add({desc:"Close",hotkey:27,handler:()=>this._handleGlobalClose()})),this.props.repositionOnScroll&&window.addEventListener("scroll",this._handleScrollOutside,{capture:!0})}componentDidUpdate(){this._handleMeasure()}componentWillUnmount(){const{customCloseDelegate:t=d.globalCloseDelegate}=this.props;t.unsubscribe(this,this._handleGlobalClose),window.removeEventListener("resize",this._resize),window.removeEventListener("scroll",this._handleScrollOutside,{capture:!0}),this._hotkeys&&(this._hotkeys.destroy(),this._hotkeys=null),null!==this._raf&&(cancelAnimationFrame(this._raf),this._raf=null),null!==this._scrollRaf&&(cancelAnimationFrame(this._scrollRaf),this._scrollRaf=null),this._scrollTimeout&&clearTimeout(this._scrollTimeout)}render(){const{id:t,role:e,"aria-labelledby":n,"aria-activedescendant":r,children:o,minWidth:a,theme:d=_,className:h,maxHeight:u,onMouseOver:m,onMouseOut:v,onKeyDown:b,onFocus:y,onBlur:C}=this.props,{appearingMenuHeight:w,appearingMenuWidth:x,appearingPosition:S,isMeasureValid:E}=this.state;return i.createElement(f.MenuContext.Provider,{value:this},i.createElement(p.SubmenuHandler,null,i.createElement(c.SlotContext.Provider,{value:this._manager},i.createElement("div",{id:t,role:e,"aria-labelledby":n,"aria-activedescendant":r,className:s()(h,d.menuWrap,!E&&d.isMeasuring),style:{height:w,left:S&&S.x,minWidth:a,position:"fixed",top:S&&S.y,width:x},"data-name":this.props["data-name"],ref:this._handleContainerRef,onScrollCapture:this.props.onScroll,onContextMenu:l.preventDefaultForContextMenu,tabIndex:this.props.tabIndex,onMouseOver:m,onMouseOut:v,onKeyDown:b,onFocus:y,onBlur:C},i.createElement("div",{className:s()(d.scrollWrap,!this.props.noMomentumBasedScroll&&d.momentumBased),style:{overflowY:void 0!==w?"scroll":"auto",maxHeight:u},onScrollCapture:this._handleScroll,ref:this._handleScrollWrapRef},i.createElement(g,{className:d.menuBox},o)))),i.createElement(c.Slot,{reference:this._handleSlot})))}update(t){t?this._resizeForced():this._resize()}}function g(t){const e=(0,o.ensureNotNull)((0,i.useContext)(p.SubmenuContext)),n=i.useRef(null);return i.createElement("div",{ref:n,className:t.className,onMouseOver:function(t){if(!(null!==e.current&&t.target instanceof Node&&(i=t.target,null===(r=n.current)||void 0===r?void 0:r.contains(i))))return;var i,r;e.isSubmenuNode(t.target)||e.setCurrent(null)},"data-name":"menu-inner"},t.children)}v.contextType=p.SubmenuContext},16396:(t,e,n)=>{"use strict";n.d(e,{DEFAULT_POPUP_MENU_ITEM_THEME:()=>c,PopupMenuItem:()=>u});var i=n(59496),r=n(97754),s=n(59064),o=n(51768),a=n(90186),l=n(23576);const c=l;function d(t){const{reference:e,...n}=t,r={...n,ref:e};return i.createElement(t.href?"a":"div",r)}function h(t){t.stopPropagation()}function u(t){
const{id:e,role:n,"aria-selected":c,className:u,title:p,labelRowClassName:f,labelClassName:_,shortcut:m,forceShowShortcuts:v,icon:g,isActive:b,isDisabled:y,isHovered:C,appearAsDisabled:w,label:x,link:S,showToolboxOnHover:E,target:k,rel:T,toolbox:A,reference:P,onMouseOut:$,onMouseOver:O,suppressToolboxClick:M=!0,theme:I=l}=t,L=(0,a.filterDataProps)(t),W=(0,i.useRef)(null);return i.createElement(d,{...L,id:e,role:n,"aria-selected":c,className:r(u,I.item,g&&I.withIcon,{[I.isActive]:b,[I.isDisabled]:y||w,[I.hovered]:C}),title:p,href:S,target:k,rel:T,reference:function(t){W.current=t,"function"==typeof P&&P(t);"object"==typeof P&&(P.current=t)},onClick:function(e){const{dontClosePopup:n,onClick:i,onClickArg:r,trackEventObject:a}=t;if(y)return;a&&(0,o.trackEvent)(a.category,a.event,a.label);i&&i(r,e);n||(0,s.globalCloseMenu)()},onContextMenu:function(e){const{trackEventObject:n,trackRightClick:i}=t;n&&i&&(0,o.trackEvent)(n.category,n.event,n.label+"_rightClick")},onMouseUp:function(e){const{trackEventObject:n,trackMouseWheelClick:i}=t;if(1===e.button&&S&&n){let t=n.label;i&&(t+="_mouseWheelClick"),(0,o.trackEvent)(n.category,n.event,t)}},onMouseOver:O,onMouseOut:$},void 0!==g&&i.createElement("div",{className:I.icon,dangerouslySetInnerHTML:{__html:g}}),i.createElement("div",{className:r(I.labelRow,f)},i.createElement("div",{className:r(I.label,_)},x)),(void 0!==m||v)&&i.createElement("div",{className:I.shortcut},(F=m)&&F.split("+").join(" + ")),void 0!==A&&i.createElement("div",{onClick:M?h:void 0,className:r(I.toolbox,{[I.showOnHover]:E})},A));var F}},29197:(t,e,n)=>{"use strict";n.d(e,{CloseDelegateContext:()=>s});var i=n(59496),r=n(59064);const s=i.createContext(r.globalCloseDelegate)},50628:(t,e,n)=>{"use strict";n.d(e,{PopupMenu:()=>c});var i=n(59496),r=n(87995),s=n(65718),o=n(27317),a=n(29197),l=n(58095);function c(t){const{controller:e,children:n,isOpened:c,closeOnClickOutside:d=!0,doNotCloseOn:h,onClickOutside:u,onClose:p,...f}=t,_=(0,i.useContext)(a.CloseDelegateContext),m=(0,l.useOutsideEvent)({handler:function(t){u&&u(t);if(!d)return;if(h&&t.target instanceof Node){const e=r.findDOMNode(h);if(e instanceof Node&&e.contains(t.target))return}p()},mouseDown:!0,touchStart:!0});return c?i.createElement(s.Portal,{top:"0",left:"0",right:"0",bottom:"0",pointerEvents:"none"},i.createElement("span",{ref:m,style:{pointerEvents:"auto"}},i.createElement(o.Menu,{...f,onClose:p,onScroll:function(e){const{onScroll:n}=t;n&&n(e)},customCloseDelegate:_,ref:e},n))):null}},14758:(t,e,n)=>{"use strict";n.d(e,{SubmenuContext:()=>r,SubmenuHandler:()=>s});var i=n(59496);const r=i.createContext(null);function s(t){const[e,n]=(0,i.useState)(null),s=(0,i.useRef)(null),o=(0,i.useRef)(new Map);return(0,i.useEffect)(()=>()=>{null!==s.current&&clearTimeout(s.current)},[]),i.createElement(r.Provider,{value:{current:e,setCurrent:function(t){null!==s.current&&(clearTimeout(s.current),s.current=null);null===e?n(t):s.current=setTimeout(()=>{s.current=null,n(t)},100)},registerSubmenu:function(t,e){return o.current.set(t,e),()=>{o.current.delete(t)}},
isSubmenuNode:function(t){return Array.from(o.current.values()).some(e=>e(t))}}},t.children)}},65417:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28" fill="none"><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M14 4a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM3 14a11 11 0 1 1 22 0 11 11 0 0 1-22 0z"/><path fill="currentColor" d="M13.5 20v-7.5H12V11h3v9h-1.5z"/><circle fill="currentColor" cx="14" cy="9" r="1"/></svg>'},83546:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16" fill="none"><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M8 15c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm0 1c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zm-1-12c0-.552.448-1 1-1s1 .448 1 1v4c0 .552-.448 1-1 1s-1-.448-1-1v-4zm1 7c-.552 0-1 .448-1 1s.448 1 1 1 1-.448 1-1-.448-1-1-1z"/></svg>'},58498:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M8.5 1.5L3.5 7l5 5.5"/></svg>'},65112:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M5.5 1.5l5 5.5-5 5.5"/></svg>'}}]);