Current File : //var/www/vinorea/modules/ps_accounts/views/js/index.js |
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
(function(n){function t(t){for(var o,c,i=t[0],u=t[1],l=t[2],d=0,p=[];d<i.length;d++)c=i[d],Object.prototype.hasOwnProperty.call(r,c)&&r[c]&&p.push(r[c][0]),r[c]=0;for(o in u)Object.prototype.hasOwnProperty.call(u,o)&&(n[o]=u[o]);s&&s(t);while(p.length)p.shift()();return a.push.apply(a,l||[]),e()}function e(){for(var n,t=0;t<a.length;t++){for(var e=a[t],o=!0,i=1;i<e.length;i++){var u=e[i];0!==r[u]&&(o=!1)}o&&(a.splice(t--,1),n=c(c.s=e[0]))}return n}var o={},r={index:0},a=[];function c(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,c),e.l=!0,e.exports}c.m=n,c.c=o,c.d=function(n,t,e){c.o(n,t)||Object.defineProperty(n,t,{enumerable:!0,get:e})},c.r=function(n){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},c.t=function(n,t){if(1&t&&(n=c(n)),8&t)return n;if(4&t&&"object"===typeof n&&n&&n.__esModule)return n;var e=Object.create(null);if(c.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var o in n)c.d(e,o,function(t){return n[t]}.bind(null,o));return e},c.n=function(n){var t=n&&n.__esModule?function(){return n["default"]}:function(){return n};return c.d(t,"a",t),t},c.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},c.p="";var i=window["webpackJsonp"]=window["webpackJsonp"]||[],u=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var s=u;a.push([0,"chunk-vendors"]),e()})({0:function(n,t,e){n.exports=e("6cfb")},"6cfb":function(n,t,e){"use strict";e.r(t);e("e260"),e("e6cf"),e("cca6"),e("a79d");var o=e("2b0e"),r=function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("div",{staticClass:"app-container"},[n._m(0),e("div",{staticClass:"app-body"},[n.loaded?e("div",[e("p",{domProps:{innerHTML:n._s(n.fact)}})]):e("div",[e("p",[n._v(" loaded ")])])]),e("div",{staticClass:"app-footer"},[e("ps_account",{attrs:{buttonText:"valider"}})],1)])},a=[function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("div",{staticClass:"app-header"},[e("h2",[n._v("ps account")])])}],c=function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("div",{staticClass:"ps_account text-center"},[e("button",{staticClass:"btn btn-primary",on:{click:function(t){return t.stopPropagation(),t.preventDefault(),n.connectSSO()}}},[n._v(" "+n._s(n.buttonText)+" ")])])},i=[],u={name:"PsAccount",props:{buttonText:String},methods:{connectSSO:function(){window.open(this.$parent.sso_url,"_blank")}}},l=u,s=(e("c9df"),e("2877")),d=Object(s["a"])(l,c,i,!1,null,"2a745a2c",null),p=d.exports,f=e("bc3a"),h=e.n(f),v=e("2ef0");function _(n){var t=new FormData;return t.append("ajax",!0),t.append("action",n.action),t.append("controller",n.controller),Object(v["forEach"])(n.data,(function(n,e){t.append(e,n)})),h.a.post(ajax_controller_url,t).then((function(n){return n.data})).catch((function(n){console.log(n)}))}var b={name:"app",components:{ps_account:p},data:function(){return{fact:null,api_url:null,sso_url:null,loaded:!1,ready:{loading:!1}}},coed:{},watch:{ready:{deep:!0,handler:"isFullLoaded"}},methods:{showChunk:function(n){this.fact=n.value},ajaxProcessStandAliveUserConnexion:function(){var n=this;_({action:"StandAliveUserConnexion",controller:"AdminAjaxPsAccounts"}).then((function(t){console.log(t.data),!1!==t&&0!=t.state&&n.showChunk(t)})).catch((function(n){console.log(n)}))},loadingCompleted:function(){this.ready.loading=!0},isFullLoaded:function(){this.ready.loading&&(this.loaded=!0)}},created:function(){this.sso_url=Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_SSO_URL,this.api_url=Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_API_URL,window.setTimeout(this.loadingCompleted,2e3)},mounted:function(){var n=this;this.ajaxProcessStandAliveUserConnexion(),window.setInterval((function(){n.ajaxProcessStandAliveUserConnexion()}),5e3)}},m=b,x=(e("a59f"),Object(s["a"])(m,r,a,!1,null,null,null)),y=x.exports,g=e("5f5b");e("f9e3"),e("2dd8");o["default"].use(g["a"]),o["default"].config.productionTip=!1,new o["default"]({render:function(n){return n(y)}}).$mount("#app")},"8ce0":function(n,t,e){},a59f:function(n,t,e){"use strict";var o=e("cdc5"),r=e.n(o);r.a},c9df:function(n,t,e){"use strict";var o=e("8ce0"),r=e.n(o);r.a},cdc5:function(n,t,e){}});
//# sourceMappingURL=index.js.map