hart-estate-widget 4.6.7 → 4.6.8

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/build/api.js CHANGED
@@ -1 +1 @@
1
- var r={d:(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},o:(r,e)=>Object.prototype.hasOwnProperty.call(r,e)},e={};r.d(e,{j:()=>t});class t{baseUrl;constructor(r){this.baseUrl=r}get headers(){return{Accept:"application/json;widget-version=4.6.7"}}loadCrmWidgetData=async r=>{if(!r)return this.makeError(404,"No crmPlanId!");try{const e=await this.fetch(`/api/crm/plans/${r}/v4/widget`);return e.ok?{...await e.json(),is_crm:!0,crm_plan_id:r}:this.makeErrorFromResponse(e,"Failed to get CRM Plan widget data!")}catch(r){return this.makeError(520,r.message)}};loadWidgetData=async r=>{if(!r)return this.makeError(404,"No planId!");try{const e=await this.fetch(`/api/plans/${r}/v4/widget`);return e.ok?{...await e.json(),is_crm:!1,plan_id:r}:this.makeErrorFromResponse(e,"Failed to get Plan widget data!")}catch(r){return this.makeError(520,r.message)}};loadJson=async r=>{try{return(await fetch(r)).json()}catch(r){return this.makeError(500,r.message)}};makeError(r,e="Unknown error"){return{error:{status:r,message:e}}}async makeErrorFromResponse(r,e){if("application/json"===r.headers.get("Content-Type")){const e=await r.json();if("message"in e&&"string"==typeof e.message)return this.makeError(r.status,e.message)}return this.makeError(r.status,e)}fetch(r,e={headers:this.headers}){return fetch(`${this.baseUrl}${r}`,e)}}const a=e.j;export{a as Api};
1
+ var r={d:(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},o:(r,e)=>Object.prototype.hasOwnProperty.call(r,e)},e={};r.d(e,{j:()=>t});class t{baseUrl;constructor(r){this.baseUrl=r}get headers(){return{Accept:"application/json;widget-version=4.6.8"}}loadCrmWidgetData=async r=>{if(!r)return this.makeError(404,"No crmPlanId!");try{const e=await this.fetch(`/api/crm/plans/${r}/v4/widget`);return e.ok?{...await e.json(),is_crm:!0,crm_plan_id:r}:this.makeErrorFromResponse(e,"Failed to get CRM Plan widget data!")}catch(r){return this.makeError(520,r.message)}};loadWidgetData=async r=>{if(!r)return this.makeError(404,"No planId!");try{const e=await this.fetch(`/api/plans/${r}/v4/widget`);return e.ok?{...await e.json(),is_crm:!1,plan_id:r}:this.makeErrorFromResponse(e,"Failed to get Plan widget data!")}catch(r){return this.makeError(520,r.message)}};loadJson=async r=>{try{return(await fetch(r)).json()}catch(r){return this.makeError(500,r.message)}};makeError(r,e="Unknown error"){return{error:{status:r,message:e}}}async makeErrorFromResponse(r,e){if("application/json"===r.headers.get("Content-Type")){const e=await r.json();if("message"in e&&"string"==typeof e.message)return this.makeError(r.status,e.message)}return this.makeError(r.status,e)}fetch(r,e={headers:this.headers}){return fetch(`${this.baseUrl}${r}`,e)}}const a=e.j;export{a as Api};
@@ -1 +1 @@
1
- class e{counterId;constructor(e){this.counterId=e,this.init()}init(){console.warn("function"!=typeof window.ym),"function"==typeof window.ym?(console.warn(this.counterId),window.ym(this.counterId,"init",{ssr:!0,webvisor:!0,clickmap:!0,ecommerce:"dataLayer",accurateTrackBounce:!0,trackLinks:!0})):console.warn("[YandexMetrikaProvider] ym is not defined (loader script not executed?)")}reachGoal(e,r){if("function"==typeof window.ym)try{window.ym(this.counterId,"reachGoal",e,r)}catch(e){console.error("[YandexMetrikaProvider] reachGoal error",e)}else console.warn("[YandexMetrikaProvider] ym is not defined")}}class r{unsubscribe;provider;constructor(r){this.provider=new e(r)}get id(){return"mrgroup"}get name(){return"MRGroup Analytics Plugin"}get version(){return"1.0.0"}init(e){return this.unsubscribe=e.analyticsStore.subscribe((e=>this.onEvent(e))),!0}shutdown(){this.unsubscribe?.()}onEvent(e){switch(e.type){case"roomSelected":this.provider.reachGoal("room_selected",e.params);break;case"tabSelected":this.provider.reachGoal("tab_selected",e.params);break;case"styleSelected":this.provider.reachGoal("style_selected",e.params);break;case"sessionFinished":this.provider.reachGoal("finished",e.params)}}}export{r as MRGroupPlugin};
1
+ class e{counterId;constructor(e){this.counterId=e}init(){"function"==typeof window.ym?window.ym(this.counterId,"init",{ssr:!0,webvisor:!0,clickmap:!0,ecommerce:"dataLayer",accurateTrackBounce:!0,trackLinks:!0}):console.warn("[YandexMetrikaProvider] ym is not defined (loader script not executed?)")}reachGoal(e,r){if("function"==typeof window.ym)try{window.ym(this.counterId,"reachGoal",e,r)}catch(e){console.error("[YandexMetrikaProvider] reachGoal error",e)}else console.warn("[YandexMetrikaProvider] ym is not defined")}}class r{unsubscribe;provider;constructor(r){this.provider=new e(r)}get id(){return"mrgroup"}get name(){return"MRGroup Analytics Plugin"}get version(){return"1.0.0"}init(e){return this.provider.init(),this.unsubscribe=e.analyticsStore.subscribe((e=>this.onEvent(e))),!0}shutdown(){this.unsubscribe?.()}onEvent(e){switch(e.type){case"roomSelected":this.provider.reachGoal("room_selected",e.params);break;case"tabSelected":this.provider.reachGoal("tab_selected",e.params);break;case"styleSelected":this.provider.reachGoal("style_selected",e.params);break;case"sessionFinished":this.provider.reachGoal("finished",e.params)}}}export{r as MRGroupPlugin};
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "sideEffects": [
13
13
  "*.sass"
14
14
  ],
15
- "version": "4.6.7",
15
+ "version": "4.6.8",
16
16
  "private": false,
17
17
  "main": "build/createWidget.js",
18
18
  "module": "build/createWidget.js",