diff --git a/packages/Webkul/Core/src/Core.php b/packages/Webkul/Core/src/Core.php
index f16fe1152..7f37f5913 100755
--- a/packages/Webkul/Core/src/Core.php
+++ b/packages/Webkul/Core/src/Core.php
@@ -232,6 +232,16 @@ class Core
return ($channel = $this->getDefaultChannel()) ? $channelCode = $channel->code : '';
}
+ /**
+ * Get channel code from request.
+ *
+ * @return string
+ */
+ public function getRequestedChannelCode(): string
+ {
+ return request()->get('channel') ?: ($this->getCurrentChannelCode() ?: $this->getDefaultChannelCode());
+ }
+
/**
* Returns the channel name.
*
@@ -245,7 +255,7 @@ class Core
}
/**
- * Returns all locales
+ * Return all locales.
*
* @return \Illuminate\Support\Collection
*/
@@ -260,6 +270,27 @@ class Core
return $locales = $this->localeRepository->all();
}
+ /**
+ * Return all locales which are present in requested channel.
+ *
+ * @return array
+ */
+ public function getAllLocalesByRequestedChannel()
+ {
+ static $data = [];
+
+ if (! empty($data)) {
+ return $data;
+ }
+
+ $channel = $this->channelRepository->findOneByField('code', $this->getRequestedChannelCode());
+
+ return $data = [
+ 'channel' => $channel,
+ 'locales' => $channel->locales
+ ];
+ }
+
/**
* Returns current locale.
*
@@ -282,6 +313,35 @@ class Core
return $locale;
}
+ /**
+ * Get locale code from request. Here if you want to use admin locale,
+ * you can pass it as an argument.
+ *
+ * @param string $localeKey optional
+ * @return string
+ */
+ public function getRequestedLocaleCode($localeKey = 'locale'): string
+ {
+ return request()->get($localeKey) ?: app()->getLocale();
+ }
+
+ /**
+ * Check requested locale code in requested channel. If not found,
+ * then set channel default locale code.
+ *
+ * @return string
+ */
+ public function checkRequestedLocaleCodeInRequestedChannel()
+ {
+ $localeCode = $this->getRequestedLocaleCode();
+
+ $channelLocales = $this->getAllLocalesByRequestedChannel();
+
+ return ! $channelLocales['locales']->contains('code', $localeCode)
+ ? $channelLocales['channel']->default_locale->code
+ : $localeCode;
+ }
+
/**
* Returns all customer groups.
*
diff --git a/packages/Webkul/Core/src/Repositories/CoreConfigRepository.php b/packages/Webkul/Core/src/Repositories/CoreConfigRepository.php
index 37a22ffb4..97d37d81d 100755
--- a/packages/Webkul/Core/src/Repositories/CoreConfigRepository.php
+++ b/packages/Webkul/Core/src/Repositories/CoreConfigRepository.php
@@ -26,8 +26,6 @@ class CoreConfigRepository extends Repository
*/
public function create(array $data)
{
- unset($data['_token']);
-
if ($data['locale'] || $data['channel']) {
$locale = $data['locale'];
$channel = $data['channel'];
diff --git a/packages/Webkul/Product/src/Models/Product.php b/packages/Webkul/Product/src/Models/Product.php
index 84f6bf6a5..84cd3b1d1 100755
--- a/packages/Webkul/Product/src/Models/Product.php
+++ b/packages/Webkul/Product/src/Models/Product.php
@@ -391,9 +391,8 @@ class Product extends Model implements ProductContract
return;
}
- $channel = request()->get('channel') ?: (core()->getCurrentChannelCode() ?: core()->getDefaultChannelCode());
-
- $locale = request()->get('locale') ?: app()->getLocale();
+ $locale = core()->checkRequestedLocaleCodeInRequestedChannel();
+ $channel = core()->getRequestedChannelCode();
if ($attribute->value_per_channel) {
if ($attribute->value_per_locale) {
diff --git a/packages/Webkul/Ui/publishable/assets/js/ui.js b/packages/Webkul/Ui/publishable/assets/js/ui.js
index fd164247d..d75e44814 100644
--- a/packages/Webkul/Ui/publishable/assets/js/ui.js
+++ b/packages/Webkul/Ui/publishable/assets/js/ui.js
@@ -1,2 +1,2 @@
/*! For license information please see ui.js.LICENSE.txt */
-!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=0)}({"+6XX":function(t,e,n){var r=n("y1pI");t.exports=function(t){return r(this.__data__,t)>-1}},"+K+b":function(t,e,n){var r=n("JHRd");t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},"+Qka":function(t,e,n){var r=n("fmRc"),i=n("t2Dn"),o=n("cq/+"),a=n("T1AV"),s=n("GoyQ"),c=n("mTTR"),l=n("itsj");t.exports=function t(e,n,u,f,p){e!==n&&o(n,(function(o,c){if(p||(p=new r),s(o))a(e,n,c,u,t,f,p);else{var d=f?f(l(e,c),o,c+"",e,n,p):void 0;void 0===d&&(d=o),i(e,c,d)}}),c)}},"+Xmh":function(t,e,n){n("jm62"),t.exports=n("g3g5").Object.getOwnPropertyDescriptors},"+auO":function(t,e,n){var r=n("XKFU"),i=n("lvtm");r(r.S,"Math",{cbrt:function(t){return i(t=+t)*Math.pow(Math.abs(t),1/3)}})},"+iFO":function(t,e,n){var r=n("dTAl"),i=n("LcsW"),o=n("6sVZ");t.exports=function(t){return"function"!=typeof t.constructor||o(t)?{}:r(i(t))}},"+lvF":function(t,e,n){t.exports=n("VTer")("native-function-to-string",Function.toString)},"+oPb":function(t,e,n){"use strict";n("OGtf")("blink",(function(t){return function(){return t(this,"blink","","")}}))},"+rLv":function(t,e,n){var r=n("dyZX").document;t.exports=r&&r.documentElement},"/8Fb":function(t,e,n){var r=n("XKFU"),i=n("UExd")(!0);r(r.S,"Object",{entries:function(t){return i(t)}})},"/KAi":function(t,e,n){var r=n("XKFU"),i=n("dyZX").isFinite;r(r.S,"Number",{isFinite:function(t){return"number"==typeof t&&i(t)}})},"/SS/":function(t,e,n){var r=n("XKFU");r(r.S,"Object",{setPrototypeOf:n("i5dc").set})},"/e88":function(t,e){t.exports="\t\n\v\f\r \u2028\u2029\ufeff"},0:function(t,e,n){n("uPOf"),n("qg2B"),t.exports=n("w/dW")},"0/R4":function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},"03A+":function(t,e,n){var r=n("JTzB"),i=n("ExA7"),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(t){return i(t)&&a.call(t,"callee")&&!s.call(t,"callee")};t.exports=c},"0Cz8":function(t,e,n){var r=n("Xi7e"),i=n("ebwN"),o=n("e4Nc");t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(t,e),this.size=n.size,this}},"0E+W":function(t,e,n){n("elZq")("Array")},"0LDn":function(t,e,n){"use strict";n("OGtf")("italics",(function(t){return function(){return t(this,"i","","")}}))},"0YWM":function(t,e,n){var r=n("EemH"),i=n("OP3Y"),o=n("aagx"),a=n("XKFU"),s=n("0/R4"),c=n("y3w9");a(a.S,"Reflect",{get:function t(e,n){var a,l,u=arguments.length<3?e:arguments[2];return c(e)===u?e[n]:(a=r.f(e,n))?o(a,"value")?a.value:void 0!==a.get?a.get.call(u):void 0:s(l=i(e))?t(l,n,u):void 0}})},"0l/t":function(t,e,n){"use strict";var r=n("XKFU"),i=n("CkkT")(2);r(r.P+r.F*!n("LyE8")([].filter,!0),"Array",{filter:function(t){return i(this,t,arguments[1])}})},"0mN4":function(t,e,n){"use strict";n("OGtf")("fixed",(function(t){return function(){return t(this,"tt","","")}}))},"0sh+":function(t,e,n){var r=n("quPj"),i=n("vhPU");t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},"0ycA":function(t,e){t.exports=function(){return[]}},"11IZ":function(t,e,n){var r=n("dyZX").parseFloat,i=n("qncB").trim;t.exports=1/r(n("/e88")+"-0")!=-1/0?function(t){var e=i(String(t),3),n=r(e);return 0===n&&"-"==e.charAt(0)?-0:n}:r},"1MBn":function(t,e,n){var r=n("DVgA"),i=n("JiEa"),o=n("UqcF");t.exports=function(t){var e=r(t),n=i.f;if(n)for(var a,s=n(t),c=o.f,l=0;s.length>l;)c.call(t,a=s[l++])&&e.push(a);return e}},"1TsA":function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},"1hJj":function(t,e,n){var r=n("e4Nc"),i=n("ftKO"),o=n("3A9y");function a(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new r;++e
-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},"25dN":function(t,e,n){var r=n("XKFU");r(r.S,"Object",{is:n("g6HL")})},"2GTP":function(t,e,n){var r=n("eaoh");t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},"2OiF":function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},"2Spj":function(t,e,n){var r=n("XKFU");r(r.P,"Function",{bind:n("8MEG")})},"2atp":function(t,e,n){var r=n("XKFU"),i=Math.atanh;r(r.S+r.F*!(i&&1/i(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},"2faE":function(t,e,n){var r=n("5K7Z"),i=n("eUtF"),o=n("G8Mo"),a=Object.defineProperty;e.f=n("jmDH")?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},"2gN3":function(t,e,n){var r=n("Kz5y")["__core-js_shared__"];t.exports=r},"3A9y":function(t,e){t.exports=function(t){return this.__data__.has(t)}},"3Fdi":function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},"3L66":function(t,e,n){var r=n("MMmD"),i=n("ExA7");t.exports=function(t){return i(t)&&r(t)}},"3Lyj":function(t,e,n){var r=n("KroJ");t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},"3xty":function(t,e,n){var r=n("XKFU"),i=n("2OiF"),o=n("y3w9"),a=(n("dyZX").Reflect||{}).apply,s=Function.apply;r(r.S+r.F*!n("eeVq")((function(){a((function(){}))})),"Reflect",{apply:function(t,e,n){var r=i(t),c=o(n);return a?a(r,e,c):s.call(r,e,c)}})},"433b":function(t,e,n){"use strict";(function(t){var r=n("cDf5"),i=n.n(r),o=n("lSNA"),a=n.n(o),s=n("lwsE"),c=n.n(s),l=n("W8MJ"),u=n.n(l),f=n("8L3F"),p=n("Y+p1"),d=n.n(p),h=n("JSzz"),v=n("QkVN"),m=n.n(v),g=function(){};function y(t){return"string"==typeof t&&(t=t.split(" ")),t}function b(t,e){var n,r=y(e);n=t.className instanceof g?y(t.className.baseVal):y(t.className),r.forEach((function(t){-1===n.indexOf(t)&&n.push(t)})),t instanceof SVGElement?t.setAttribute("class",n.join(" ")):t.className=n.join(" ")}function w(t,e){var n,r=y(e);n=t.className instanceof g?y(t.className.baseVal):y(t.className),r.forEach((function(t){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})),t instanceof SVGElement?t.setAttribute("class",n.join(" ")):t.className=n.join(" ")}"undefined"!=typeof window&&(g=window.SVGAnimatedString);var x=!1;if("undefined"!=typeof window){x=!1;try{var _=Object.defineProperty({},"passive",{get:function(){x=!0}});window.addEventListener("test",null,_)}catch(t){}}function k(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function C(t){for(var e=1;e',trigger:"hover focus",offset:0},O=[],E=function(){function t(e,n){var r=this;c()(this,t),a()(this,"_events",[]),a()(this,"_setTooltipNodeEvent",(function(t,e,n,i){var o=t.relatedreference||t.toElement||t.relatedTarget;return!!r._tooltipNode.contains(o)&&(r._tooltipNode.addEventListener(t.type,(function n(o){var a=o.relatedreference||o.toElement||o.relatedTarget;r._tooltipNode.removeEventListener(t.type,n),e.contains(a)||r._scheduleHide(e,i.delay,i,o)})),!0)})),n=C(C({},S),n),e.jquery&&(e=e[0]),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.reference=e,this.options=n,this._isOpen=!1,this._init()}return u()(t,[{key:"show",value:function(){this._show(this.reference,this.options)}},{key:"hide",value:function(){this._hide()}},{key:"dispose",value:function(){this._dispose()}},{key:"toggle",value:function(){return this._isOpen?this.hide():this.show()}},{key:"setClasses",value:function(t){this._classes=t}},{key:"setContent",value:function(t){this.options.title=t,this._tooltipNode&&this._setContent(t,this.options)}},{key:"setOptions",value:function(t){var e=!1,n=t&&t.classes||R.options.defaultClass;d()(this._classes,n)||(this.setClasses(n),e=!0),t=P(t);var r=!1,i=!1;for(var o in this.options.offset===t.offset&&this.options.placement===t.placement||(r=!0),(this.options.template!==t.template||this.options.trigger!==t.trigger||this.options.container!==t.container||e)&&(i=!0),t)this.options[o]=t[o];if(this._tooltipNode)if(i){var a=this._isOpen;this.dispose(),this._init(),a&&this.show()}else r&&this.popperInstance.update()}},{key:"_init",value:function(){var t="string"==typeof this.options.trigger?this.options.trigger.split(" "):[];this._isDisposed=!1,this._enableDocumentTouch=-1===t.indexOf("manual"),t=t.filter((function(t){return-1!==["click","hover","focus"].indexOf(t)})),this._setEventListeners(this.reference,t,this.options),this.$_originalTitle=this.reference.getAttribute("title"),this.reference.removeAttribute("title"),this.reference.setAttribute("data-original-title",this.$_originalTitle)}},{key:"_create",value:function(t,e){var n=this,r=window.document.createElement("div");r.innerHTML=e.trim();var i=r.childNodes[0];return i.id=this.options.ariaId||"tooltip_".concat(Math.random().toString(36).substr(2,10)),i.setAttribute("aria-hidden","true"),this.options.autoHide&&-1!==this.options.trigger.indexOf("hover")&&(i.addEventListener("mouseenter",(function(e){return n._scheduleHide(t,n.options.delay,n.options,e)})),i.addEventListener("click",(function(e){return n._scheduleHide(t,n.options.delay,n.options,e)}))),i}},{key:"_setContent",value:function(t,e){var n=this;this.asyncContent=!1,this._applyContent(t,e).then((function(){n.popperInstance&&n.popperInstance.update()}))}},{key:"_applyContent",value:function(t,e){var n=this;return new Promise((function(r,i){var o=e.html,a=n._tooltipNode;if(a){var s=a.querySelector(n.options.innerSelector);if(1===t.nodeType){if(o){for(;s.firstChild;)s.removeChild(s.firstChild);s.appendChild(t)}}else{if("function"==typeof t){var c=t();return void(c&&"function"==typeof c.then?(n.asyncContent=!0,e.loadingClass&&b(a,e.loadingClass),e.loadingContent&&n._applyContent(e.loadingContent,e),c.then((function(t){return e.loadingClass&&w(a,e.loadingClass),n._applyContent(t,e)})).then(r).catch(i)):n._applyContent(c,e).then(r).catch(i))}o?s.innerHTML=t:s.innerText=t}r()}}))}},{key:"_show",value:function(t,e){if(e&&"string"==typeof e.container&&!document.querySelector(e.container))return;clearTimeout(this._disposeTimer),delete(e=Object.assign({},e)).offset;var n=!0;this._tooltipNode&&(b(this._tooltipNode,this._classes),n=!1);var r=this._ensureShown(t,e);return n&&this._tooltipNode&&b(this._tooltipNode,this._classes),b(t,["v-tooltip-open"]),r}},{key:"_ensureShown",value:function(t,e){var n=this;if(this._isOpen)return this;if(this._isOpen=!0,O.push(this),this._tooltipNode)return this._tooltipNode.style.display="",this._tooltipNode.setAttribute("aria-hidden","false"),this.popperInstance.enableEventListeners(),this.popperInstance.update(),this.asyncContent&&this._setContent(e.title,e),this;var r=t.getAttribute("title")||e.title;if(!r)return this;var i=this._create(t,e.template);this._tooltipNode=i,t.setAttribute("aria-describedby",i.id);var o=this._findContainer(e.container,t);this._append(i,o);var a=C(C({},e.popperOptions),{},{placement:e.placement});return a.modifiers=C(C({},a.modifiers),{},{arrow:{element:this.options.arrowSelector}}),e.boundariesElement&&(a.modifiers.preventOverflow={boundariesElement:e.boundariesElement}),this.popperInstance=new f.a(t,i,a),this._setContent(r,e),requestAnimationFrame((function(){!n._isDisposed&&n.popperInstance?(n.popperInstance.update(),requestAnimationFrame((function(){n._isDisposed?n.dispose():n._isOpen&&i.setAttribute("aria-hidden","false")}))):n.dispose()})),this}},{key:"_noLongerOpen",value:function(){var t=O.indexOf(this);-1!==t&&O.splice(t,1)}},{key:"_hide",value:function(){var t=this;if(!this._isOpen)return this;this._isOpen=!1,this._noLongerOpen(),this._tooltipNode.style.display="none",this._tooltipNode.setAttribute("aria-hidden","true"),this.popperInstance&&this.popperInstance.disableEventListeners(),clearTimeout(this._disposeTimer);var e=R.options.disposeTimeout;return null!==e&&(this._disposeTimer=setTimeout((function(){t._tooltipNode&&(t._tooltipNode.removeEventListener("mouseenter",t.hide),t._tooltipNode.removeEventListener("click",t.hide),t._removeTooltipNode())}),e)),w(this.reference,["v-tooltip-open"]),this}},{key:"_removeTooltipNode",value:function(){if(this._tooltipNode){var t=this._tooltipNode.parentNode;t&&(t.removeChild(this._tooltipNode),this.reference.removeAttribute("aria-describedby")),this._tooltipNode=null}}},{key:"_dispose",value:function(){var t=this;return this._isDisposed=!0,this.reference.removeAttribute("data-original-title"),this.$_originalTitle&&this.reference.setAttribute("title",this.$_originalTitle),this._events.forEach((function(e){var n=e.func,r=e.event;t.reference.removeEventListener(r,n)})),this._events=[],this._tooltipNode?(this._hide(),this._tooltipNode.removeEventListener("mouseenter",this.hide),this._tooltipNode.removeEventListener("click",this.hide),this.popperInstance.destroy(),this.popperInstance.options.removeOnDestroy||this._removeTooltipNode()):this._noLongerOpen(),this}},{key:"_findContainer",value:function(t,e){return"string"==typeof t?t=window.document.querySelector(t):!1===t&&(t=e.parentNode),t}},{key:"_append",value:function(t,e){e.appendChild(t)}},{key:"_setEventListeners",value:function(t,e,n){var r=this,i=[],o=[];e.forEach((function(t){switch(t){case"hover":i.push("mouseenter"),o.push("mouseleave"),r.options.hideOnTargetClick&&o.push("click");break;case"focus":i.push("focus"),o.push("blur"),r.options.hideOnTargetClick&&o.push("click");break;case"click":i.push("click"),o.push("click")}})),i.forEach((function(e){var i=function(e){!0!==r._isOpen&&(e.usedByTooltip=!0,r._scheduleShow(t,n.delay,n,e))};r._events.push({event:e,func:i}),t.addEventListener(e,i)})),o.forEach((function(e){var i=function(e){!0!==e.usedByTooltip&&r._scheduleHide(t,n.delay,n,e)};r._events.push({event:e,func:i}),t.addEventListener(e,i)}))}},{key:"_onDocumentTouch",value:function(t){this._enableDocumentTouch&&this._scheduleHide(this.reference,this.options.delay,this.options,t)}},{key:"_scheduleShow",value:function(t,e,n){var r=this,i=e&&e.show||e||0;clearTimeout(this._scheduleTimer),this._scheduleTimer=window.setTimeout((function(){return r._show(t,n)}),i)}},{key:"_scheduleHide",value:function(t,e,n,r){var i=this,o=e&&e.hide||e||0;clearTimeout(this._scheduleTimer),this._scheduleTimer=window.setTimeout((function(){if(!1!==i._isOpen&&i._tooltipNode.ownerDocument.body.contains(i._tooltipNode)){if("mouseleave"===r.type)if(i._setTooltipNodeEvent(r,t,e,n))return;i._hide(t,n)}}),o)}}]),t}();function D(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function F(t){for(var e=1;e
',defaultArrowSelector:".tooltip-arrow, .tooltip__arrow",defaultInnerSelector:".tooltip-inner, .tooltip__inner",defaultDelay:0,defaultTrigger:"hover focus",defaultOffset:0,defaultContainer:"body",defaultBoundariesElement:void 0,defaultPopperOptions:{},defaultLoadingClass:"tooltip-loading",defaultLoadingContent:"...",autoHide:!0,defaultHideOnTargetClick:!0,disposeTimeout:5e3,popover:{defaultPlacement:"bottom",defaultClass:"vue-popover-theme",defaultBaseClass:"tooltip popover",defaultWrapperClass:"wrapper",defaultInnerClass:"tooltip-inner popover-inner",defaultArrowClass:"tooltip-arrow popover-arrow",defaultOpenClass:"open",defaultDelay:0,defaultTrigger:"click",defaultOffset:0,defaultContainer:"body",defaultBoundariesElement:void 0,defaultPopperOptions:{},defaultAutoHide:!0,defaultHandleResize:!0}};function P(t){var e={placement:void 0!==t.placement?t.placement:R.options.defaultPlacement,delay:void 0!==t.delay?t.delay:R.options.defaultDelay,html:void 0!==t.html?t.html:R.options.defaultHtml,template:void 0!==t.template?t.template:R.options.defaultTemplate,arrowSelector:void 0!==t.arrowSelector?t.arrowSelector:R.options.defaultArrowSelector,innerSelector:void 0!==t.innerSelector?t.innerSelector:R.options.defaultInnerSelector,trigger:void 0!==t.trigger?t.trigger:R.options.defaultTrigger,offset:void 0!==t.offset?t.offset:R.options.defaultOffset,container:void 0!==t.container?t.container:R.options.defaultContainer,boundariesElement:void 0!==t.boundariesElement?t.boundariesElement:R.options.defaultBoundariesElement,autoHide:void 0!==t.autoHide?t.autoHide:R.options.autoHide,hideOnTargetClick:void 0!==t.hideOnTargetClick?t.hideOnTargetClick:R.options.defaultHideOnTargetClick,loadingClass:void 0!==t.loadingClass?t.loadingClass:R.options.defaultLoadingClass,loadingContent:void 0!==t.loadingContent?t.loadingContent:R.options.defaultLoadingContent,popperOptions:F({},void 0!==t.popperOptions?t.popperOptions:R.options.defaultPopperOptions)};if(e.offset){var n=i()(e.offset),r=e.offset;("number"===n||"string"===n&&-1===r.indexOf(","))&&(r="0, ".concat(r)),e.popperOptions.modifiers||(e.popperOptions.modifiers={}),e.popperOptions.modifiers.offset={offset:r}}return e.trigger&&-1!==e.trigger.indexOf("click")&&(e.hideOnTargetClick=!1),e}function j(t,e){for(var n=t.placement,r=0;r