@salla.sa/twilight-components 1.0.12 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{esm → twilight-components}/Helper-81ac9a8c.js +0 -0
- package/dist/twilight-components/app-globals-0f993ce5.js +3 -0
- package/dist/twilight-components/css-shim-a64b8820.js +4 -0
- package/dist/twilight-components/dom-d08ba8aa.js +73 -0
- package/dist/twilight-components/index-8cf58712.js +3010 -0
- package/dist/twilight-components/index.esm.js +3 -1
- package/dist/twilight-components/multi-warehouse.entry.js +89 -0
- package/dist/twilight-components/salla-button.entry.js +73 -0
- package/dist/{esm → twilight-components}/salla-localization.entry.js +8 -7
- package/dist/{esm/salla-login-0e85b2d8.js → twilight-components/salla-login-97e0a9ab.js} +1 -1
- package/dist/twilight-components/salla-login.entry.js +2 -0
- package/dist/twilight-components/salla-modal.entry.js +85 -0
- package/dist/{esm → twilight-components}/salla-product-availability.entry.js +12 -15
- package/dist/{esm → twilight-components}/salla-rating.entry.js +17 -17
- package/dist/{esm/salla-search-615b8f94.js → twilight-components/salla-search-df1c9b54.js} +1 -1
- package/dist/twilight-components/salla-search.entry.js +2 -0
- package/dist/{esm → twilight-components}/salla-verify.entry.js +1 -1
- package/dist/twilight-components/shadow-css-bc14d9fd.js +389 -0
- package/dist/twilight-components/twilight-components.css +3 -0
- package/dist/twilight-components/twilight-components.esm.js +125 -1
- package/dist/types/components/salla-button/salla-button.d.ts +1 -0
- package/dist/types/components/salla-localization/salla-localization.d.ts +2 -2
- package/dist/types/components/salla-product-availability/salla-product-availability.d.ts +4 -3
- package/dist/types/components.d.ts +14 -10
- package/package.json +1 -1
- package/dist/cjs/Helper-8852feaa.js +0 -23
- package/dist/cjs/index-23da2c6b.js +0 -1601
- package/dist/cjs/index.cjs.js +0 -12
- package/dist/cjs/loader.cjs.js +0 -21
- package/dist/cjs/multi-warehouse_4.cjs.entry.js +0 -242
- package/dist/cjs/salla-localization.cjs.entry.js +0 -76
- package/dist/cjs/salla-login-476fb312.js +0 -14
- package/dist/cjs/salla-product-availability.cjs.entry.js +0 -78
- package/dist/cjs/salla-rating.cjs.entry.js +0 -299
- package/dist/cjs/salla-search-f9e00be9.js +0 -97
- package/dist/cjs/salla-search.cjs.entry.js +0 -10
- package/dist/cjs/salla-verify.cjs.entry.js +0 -96
- package/dist/cjs/twilight-components.cjs.js +0 -19
- package/dist/collection/Helpers/Helper.js +0 -19
- package/dist/collection/collection-manifest.json +0 -20
- package/dist/collection/components/generate-summary.js +0 -35
- package/dist/collection/components/multi-warehouse/multi-warehouse.css +0 -13
- package/dist/collection/components/multi-warehouse/multi-warehouse.js +0 -238
- package/dist/collection/components/salla-button/salla-button.css +0 -3
- package/dist/collection/components/salla-button/salla-button.js +0 -219
- package/dist/collection/components/salla-localization/salla-localization.js +0 -201
- package/dist/collection/components/salla-login/salla-login.js +0 -31
- package/dist/collection/components/salla-modal/salla-modal.js +0 -316
- package/dist/collection/components/salla-product-availability/salla-product-availability.js +0 -316
- package/dist/collection/components/salla-rating/salla-rating.css +0 -3
- package/dist/collection/components/salla-rating/salla-rating.js +0 -484
- package/dist/collection/components/salla-search/salla-search.js +0 -155
- package/dist/collection/components/salla-verify/salla-verify.js +0 -99
- package/dist/collection/index.js +0 -2
- package/dist/collection/interfaces/colors.js +0 -1
- package/dist/collection/interfaces/index.js +0 -2
- package/dist/collection/interfaces/ratio.js +0 -1
- package/dist/collection/plugins/tailwind-theme/generator.js +0 -53
- package/dist/collection/plugins/tailwind-theme/index.js +0 -26
- package/dist/esm/index-643344dc.js +0 -1573
- package/dist/esm/index.js +0 -3
- package/dist/esm/loader.js +0 -17
- package/dist/esm/multi-warehouse_4.entry.js +0 -235
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/salla-search.entry.js +0 -2
- package/dist/esm/twilight-components.js +0 -17
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/twilight-components/p-2b8a5fa4.entry.js +0 -1
- package/dist/twilight-components/p-36c87e2e.js +0 -1
- package/dist/twilight-components/p-4e37a6cb.entry.js +0 -1
- package/dist/twilight-components/p-751643d8.entry.js +0 -1
- package/dist/twilight-components/p-8a2410e6.js +0 -1
- package/dist/twilight-components/p-94b18718.entry.js +0 -1
- package/dist/twilight-components/p-9bc28e0c.js +0 -1
- package/dist/twilight-components/p-bb503365.entry.js +0 -1
- package/dist/twilight-components/p-d1ef2268.js +0 -1
- package/dist/twilight-components/p-d34bbfc4.entry.js +0 -1
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
(function(){
|
|
2
|
-
/*
|
|
3
|
-
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
|
4
|
-
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
5
|
-
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
6
|
-
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
7
|
-
Code distributed by Google as part of the polymer project is also
|
|
8
|
-
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
9
|
-
*/
|
|
10
|
-
'use strict';var aa=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" "));function g(a){var b=aa.has(a);a=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(a);return!b&&a}function l(a){var b=a.isConnected;if(void 0!==b)return b;for(;a&&!(a.__CE_isImportDocument||a instanceof Document);)a=a.parentNode||(window.ShadowRoot&&a instanceof ShadowRoot?a.host:void 0);return!(!a||!(a.__CE_isImportDocument||a instanceof Document))}
|
|
11
|
-
function n(a,b){for(;b&&b!==a&&!b.nextSibling;)b=b.parentNode;return b&&b!==a?b.nextSibling:null}
|
|
12
|
-
function p(a,b,d){d=void 0===d?new Set:d;for(var c=a;c;){if(c.nodeType===Node.ELEMENT_NODE){var e=c;b(e);var f=e.localName;if("link"===f&&"import"===e.getAttribute("rel")){c=e.import;if(c instanceof Node&&!d.has(c))for(d.add(c),c=c.firstChild;c;c=c.nextSibling)p(c,b,d);c=n(a,e);continue}else if("template"===f){c=n(a,e);continue}if(e=e.__CE_shadowRoot)for(e=e.firstChild;e;e=e.nextSibling)p(e,b,d)}c=c.firstChild?c.firstChild:n(a,c)}}function r(a,b,d){a[b]=d};function u(){this.a=new Map;this.g=new Map;this.c=[];this.f=[];this.b=!1}function ba(a,b,d){a.a.set(b,d);a.g.set(d.constructorFunction,d)}function ca(a,b){a.b=!0;a.c.push(b)}function da(a,b){a.b=!0;a.f.push(b)}function v(a,b){a.b&&p(b,function(b){return w(a,b)})}function w(a,b){if(a.b&&!b.__CE_patched){b.__CE_patched=!0;for(var d=0;d<a.c.length;d++)a.c[d](b);for(d=0;d<a.f.length;d++)a.f[d](b)}}
|
|
13
|
-
function x(a,b){var d=[];p(b,function(b){return d.push(b)});for(b=0;b<d.length;b++){var c=d[b];1===c.__CE_state?a.connectedCallback(c):y(a,c)}}function z(a,b){var d=[];p(b,function(b){return d.push(b)});for(b=0;b<d.length;b++){var c=d[b];1===c.__CE_state&&a.disconnectedCallback(c)}}
|
|
14
|
-
function A(a,b,d){d=void 0===d?{}:d;var c=d.u||new Set,e=d.i||function(b){return y(a,b)},f=[];p(b,function(b){if("link"===b.localName&&"import"===b.getAttribute("rel")){var d=b.import;d instanceof Node&&(d.__CE_isImportDocument=!0,d.__CE_hasRegistry=!0);d&&"complete"===d.readyState?d.__CE_documentLoadHandled=!0:b.addEventListener("load",function(){var d=b.import;if(!d.__CE_documentLoadHandled){d.__CE_documentLoadHandled=!0;var f=new Set(c);f.delete(d);A(a,d,{u:f,i:e})}})}else f.push(b)},c);if(a.b)for(b=
|
|
15
|
-
0;b<f.length;b++)w(a,f[b]);for(b=0;b<f.length;b++)e(f[b])}
|
|
16
|
-
function y(a,b){if(void 0===b.__CE_state){var d=b.ownerDocument;if(d.defaultView||d.__CE_isImportDocument&&d.__CE_hasRegistry)if(d=a.a.get(b.localName)){d.constructionStack.push(b);var c=d.constructorFunction;try{try{if(new c!==b)throw Error("The custom element constructor did not produce the element being upgraded.");}finally{d.constructionStack.pop()}}catch(t){throw b.__CE_state=2,t;}b.__CE_state=1;b.__CE_definition=d;if(d.attributeChangedCallback)for(d=d.observedAttributes,c=0;c<d.length;c++){var e=
|
|
17
|
-
d[c],f=b.getAttribute(e);null!==f&&a.attributeChangedCallback(b,e,null,f,null)}l(b)&&a.connectedCallback(b)}}}u.prototype.connectedCallback=function(a){var b=a.__CE_definition;b.connectedCallback&&b.connectedCallback.call(a)};u.prototype.disconnectedCallback=function(a){var b=a.__CE_definition;b.disconnectedCallback&&b.disconnectedCallback.call(a)};
|
|
18
|
-
u.prototype.attributeChangedCallback=function(a,b,d,c,e){var f=a.__CE_definition;f.attributeChangedCallback&&-1<f.observedAttributes.indexOf(b)&&f.attributeChangedCallback.call(a,b,d,c,e)};function B(a){var b=document;this.c=a;this.a=b;this.b=void 0;A(this.c,this.a);"loading"===this.a.readyState&&(this.b=new MutationObserver(this.f.bind(this)),this.b.observe(this.a,{childList:!0,subtree:!0}))}function C(a){a.b&&a.b.disconnect()}B.prototype.f=function(a){var b=this.a.readyState;"interactive"!==b&&"complete"!==b||C(this);for(b=0;b<a.length;b++)for(var d=a[b].addedNodes,c=0;c<d.length;c++)A(this.c,d[c])};function ea(){var a=this;this.b=this.a=void 0;this.c=new Promise(function(b){a.b=b;a.a&&b(a.a)})}function D(a){if(a.a)throw Error("Already resolved.");a.a=void 0;a.b&&a.b(void 0)};function E(a){this.c=!1;this.a=a;this.j=new Map;this.f=function(b){return b()};this.b=!1;this.g=[];this.o=new B(a)}
|
|
19
|
-
E.prototype.l=function(a,b){var d=this;if(!(b instanceof Function))throw new TypeError("Custom element constructors must be functions.");if(!g(a))throw new SyntaxError("The element name '"+a+"' is not valid.");if(this.a.a.get(a))throw Error("A custom element with name '"+a+"' has already been defined.");if(this.c)throw Error("A custom element is already being defined.");this.c=!0;try{var c=function(b){var a=e[b];if(void 0!==a&&!(a instanceof Function))throw Error("The '"+b+"' callback must be a function.");
|
|
20
|
-
return a},e=b.prototype;if(!(e instanceof Object))throw new TypeError("The custom element constructor's prototype is not an object.");var f=c("connectedCallback");var t=c("disconnectedCallback");var k=c("adoptedCallback");var h=c("attributeChangedCallback");var m=b.observedAttributes||[]}catch(q){return}finally{this.c=!1}b={localName:a,constructorFunction:b,connectedCallback:f,disconnectedCallback:t,adoptedCallback:k,attributeChangedCallback:h,observedAttributes:m,constructionStack:[]};ba(this.a,
|
|
21
|
-
a,b);this.g.push(b);this.b||(this.b=!0,this.f(function(){return fa(d)}))};E.prototype.i=function(a){A(this.a,a)};
|
|
22
|
-
function fa(a){if(!1!==a.b){a.b=!1;for(var b=a.g,d=[],c=new Map,e=0;e<b.length;e++)c.set(b[e].localName,[]);A(a.a,document,{i:function(b){if(void 0===b.__CE_state){var e=b.localName,f=c.get(e);f?f.push(b):a.a.a.get(e)&&d.push(b)}}});for(e=0;e<d.length;e++)y(a.a,d[e]);for(;0<b.length;){var f=b.shift();e=f.localName;f=c.get(f.localName);for(var t=0;t<f.length;t++)y(a.a,f[t]);(e=a.j.get(e))&&D(e)}}}E.prototype.get=function(a){if(a=this.a.a.get(a))return a.constructorFunction};
|
|
23
|
-
E.prototype.m=function(a){if(!g(a))return Promise.reject(new SyntaxError("'"+a+"' is not a valid custom element name."));var b=this.j.get(a);if(b)return b.c;b=new ea;this.j.set(a,b);this.a.a.get(a)&&!this.g.some(function(b){return b.localName===a})&&D(b);return b.c};E.prototype.s=function(a){C(this.o);var b=this.f;this.f=function(d){return a(function(){return b(d)})}};window.CustomElementRegistry=E;E.prototype.define=E.prototype.l;E.prototype.upgrade=E.prototype.i;E.prototype.get=E.prototype.get;
|
|
24
|
-
E.prototype.whenDefined=E.prototype.m;E.prototype.polyfillWrapFlushCallback=E.prototype.s;var F=window.Document.prototype.createElement,G=window.Document.prototype.createElementNS,ha=window.Document.prototype.importNode,ia=window.Document.prototype.prepend,ja=window.Document.prototype.append,ka=window.DocumentFragment.prototype.prepend,la=window.DocumentFragment.prototype.append,H=window.Node.prototype.cloneNode,I=window.Node.prototype.appendChild,J=window.Node.prototype.insertBefore,K=window.Node.prototype.removeChild,L=window.Node.prototype.replaceChild,M=Object.getOwnPropertyDescriptor(window.Node.prototype,
|
|
25
|
-
"textContent"),N=window.Element.prototype.attachShadow,O=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),P=window.Element.prototype.getAttribute,Q=window.Element.prototype.setAttribute,R=window.Element.prototype.removeAttribute,S=window.Element.prototype.getAttributeNS,T=window.Element.prototype.setAttributeNS,U=window.Element.prototype.removeAttributeNS,ma=window.Element.prototype.insertAdjacentElement,na=window.Element.prototype.insertAdjacentHTML,oa=window.Element.prototype.prepend,
|
|
26
|
-
pa=window.Element.prototype.append,V=window.Element.prototype.before,qa=window.Element.prototype.after,ra=window.Element.prototype.replaceWith,sa=window.Element.prototype.remove,ta=window.HTMLElement,W=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),ua=window.HTMLElement.prototype.insertAdjacentElement,va=window.HTMLElement.prototype.insertAdjacentHTML;var wa=new function(){};function xa(){var a=X;window.HTMLElement=function(){function b(){var b=this.constructor,c=a.g.get(b);if(!c)throw Error("The custom element being constructed was not registered with `customElements`.");var e=c.constructionStack;if(0===e.length)return e=F.call(document,c.localName),Object.setPrototypeOf(e,b.prototype),e.__CE_state=1,e.__CE_definition=c,w(a,e),e;c=e.length-1;var f=e[c];if(f===wa)throw Error("The HTMLElement constructor was either called reentrantly for this constructor or called multiple times.");
|
|
27
|
-
e[c]=wa;Object.setPrototypeOf(f,b.prototype);w(a,f);return f}b.prototype=ta.prototype;Object.defineProperty(b.prototype,"constructor",{writable:!0,configurable:!0,enumerable:!1,value:b});return b}()};function Y(a,b,d){function c(b){return function(d){for(var e=[],c=0;c<arguments.length;++c)e[c]=arguments[c];c=[];for(var f=[],m=0;m<e.length;m++){var q=e[m];q instanceof Element&&l(q)&&f.push(q);if(q instanceof DocumentFragment)for(q=q.firstChild;q;q=q.nextSibling)c.push(q);else c.push(q)}b.apply(this,e);for(e=0;e<f.length;e++)z(a,f[e]);if(l(this))for(e=0;e<c.length;e++)f=c[e],f instanceof Element&&x(a,f)}}void 0!==d.h&&(b.prepend=c(d.h));void 0!==d.append&&(b.append=c(d.append))};function ya(){var a=X;r(Document.prototype,"createElement",function(b){if(this.__CE_hasRegistry){var d=a.a.get(b);if(d)return new d.constructorFunction}b=F.call(this,b);w(a,b);return b});r(Document.prototype,"importNode",function(b,d){b=ha.call(this,b,!!d);this.__CE_hasRegistry?A(a,b):v(a,b);return b});r(Document.prototype,"createElementNS",function(b,d){if(this.__CE_hasRegistry&&(null===b||"http://www.w3.org/1999/xhtml"===b)){var c=a.a.get(d);if(c)return new c.constructorFunction}b=G.call(this,b,
|
|
28
|
-
d);w(a,b);return b});Y(a,Document.prototype,{h:ia,append:ja})};function za(){function a(a,c){Object.defineProperty(a,"textContent",{enumerable:c.enumerable,configurable:!0,get:c.get,set:function(a){if(this.nodeType===Node.TEXT_NODE)c.set.call(this,a);else{var d=void 0;if(this.firstChild){var e=this.childNodes,k=e.length;if(0<k&&l(this)){d=Array(k);for(var h=0;h<k;h++)d[h]=e[h]}}c.set.call(this,a);if(d)for(a=0;a<d.length;a++)z(b,d[a])}}})}var b=X;r(Node.prototype,"insertBefore",function(a,c){if(a instanceof DocumentFragment){var e=Array.prototype.slice.apply(a.childNodes);
|
|
29
|
-
a=J.call(this,a,c);if(l(this))for(c=0;c<e.length;c++)x(b,e[c]);return a}e=l(a);c=J.call(this,a,c);e&&z(b,a);l(this)&&x(b,a);return c});r(Node.prototype,"appendChild",function(a){if(a instanceof DocumentFragment){var c=Array.prototype.slice.apply(a.childNodes);a=I.call(this,a);if(l(this))for(var e=0;e<c.length;e++)x(b,c[e]);return a}c=l(a);e=I.call(this,a);c&&z(b,a);l(this)&&x(b,a);return e});r(Node.prototype,"cloneNode",function(a){a=H.call(this,!!a);this.ownerDocument.__CE_hasRegistry?A(b,a):v(b,
|
|
30
|
-
a);return a});r(Node.prototype,"removeChild",function(a){var c=l(a),e=K.call(this,a);c&&z(b,a);return e});r(Node.prototype,"replaceChild",function(a,c){if(a instanceof DocumentFragment){var e=Array.prototype.slice.apply(a.childNodes);a=L.call(this,a,c);if(l(this))for(z(b,c),c=0;c<e.length;c++)x(b,e[c]);return a}e=l(a);var f=L.call(this,a,c),d=l(this);d&&z(b,c);e&&z(b,a);d&&x(b,a);return f});M&&M.get?a(Node.prototype,M):ca(b,function(b){a(b,{enumerable:!0,configurable:!0,get:function(){for(var a=[],
|
|
31
|
-
b=0;b<this.childNodes.length;b++){var f=this.childNodes[b];f.nodeType!==Node.COMMENT_NODE&&a.push(f.textContent)}return a.join("")},set:function(a){for(;this.firstChild;)K.call(this,this.firstChild);null!=a&&""!==a&&I.call(this,document.createTextNode(a))}})})};function Aa(a){function b(b){return function(e){for(var c=[],d=0;d<arguments.length;++d)c[d]=arguments[d];d=[];for(var k=[],h=0;h<c.length;h++){var m=c[h];m instanceof Element&&l(m)&&k.push(m);if(m instanceof DocumentFragment)for(m=m.firstChild;m;m=m.nextSibling)d.push(m);else d.push(m)}b.apply(this,c);for(c=0;c<k.length;c++)z(a,k[c]);if(l(this))for(c=0;c<d.length;c++)k=d[c],k instanceof Element&&x(a,k)}}var d=Element.prototype;void 0!==V&&(d.before=b(V));void 0!==V&&(d.after=b(qa));void 0!==ra&&
|
|
32
|
-
r(d,"replaceWith",function(b){for(var e=[],c=0;c<arguments.length;++c)e[c]=arguments[c];c=[];for(var d=[],k=0;k<e.length;k++){var h=e[k];h instanceof Element&&l(h)&&d.push(h);if(h instanceof DocumentFragment)for(h=h.firstChild;h;h=h.nextSibling)c.push(h);else c.push(h)}k=l(this);ra.apply(this,e);for(e=0;e<d.length;e++)z(a,d[e]);if(k)for(z(a,this),e=0;e<c.length;e++)d=c[e],d instanceof Element&&x(a,d)});void 0!==sa&&r(d,"remove",function(){var b=l(this);sa.call(this);b&&z(a,this)})};function Ba(){function a(a,b){Object.defineProperty(a,"innerHTML",{enumerable:b.enumerable,configurable:!0,get:b.get,set:function(a){var e=this,d=void 0;l(this)&&(d=[],p(this,function(a){a!==e&&d.push(a)}));b.set.call(this,a);if(d)for(var f=0;f<d.length;f++){var t=d[f];1===t.__CE_state&&c.disconnectedCallback(t)}this.ownerDocument.__CE_hasRegistry?A(c,this):v(c,this);return a}})}function b(a,b){r(a,"insertAdjacentElement",function(a,e){var d=l(e);a=b.call(this,a,e);d&&z(c,e);l(a)&&x(c,e);return a})}
|
|
33
|
-
function d(a,b){function e(a,b){for(var e=[];a!==b;a=a.nextSibling)e.push(a);for(b=0;b<e.length;b++)A(c,e[b])}r(a,"insertAdjacentHTML",function(a,c){a=a.toLowerCase();if("beforebegin"===a){var d=this.previousSibling;b.call(this,a,c);e(d||this.parentNode.firstChild,this)}else if("afterbegin"===a)d=this.firstChild,b.call(this,a,c),e(this.firstChild,d);else if("beforeend"===a)d=this.lastChild,b.call(this,a,c),e(d||this.firstChild,null);else if("afterend"===a)d=this.nextSibling,b.call(this,a,c),e(this.nextSibling,
|
|
34
|
-
d);else throw new SyntaxError("The value provided ("+String(a)+") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'.");})}var c=X;N&&r(Element.prototype,"attachShadow",function(a){a=N.call(this,a);var b=c;if(b.b&&!a.__CE_patched){a.__CE_patched=!0;for(var e=0;e<b.c.length;e++)b.c[e](a)}return this.__CE_shadowRoot=a});O&&O.get?a(Element.prototype,O):W&&W.get?a(HTMLElement.prototype,W):da(c,function(b){a(b,{enumerable:!0,configurable:!0,get:function(){return H.call(this,!0).innerHTML},
|
|
35
|
-
set:function(a){var b="template"===this.localName,c=b?this.content:this,e=G.call(document,this.namespaceURI,this.localName);for(e.innerHTML=a;0<c.childNodes.length;)K.call(c,c.childNodes[0]);for(a=b?e.content:e;0<a.childNodes.length;)I.call(c,a.childNodes[0])}})});r(Element.prototype,"setAttribute",function(a,b){if(1!==this.__CE_state)return Q.call(this,a,b);var e=P.call(this,a);Q.call(this,a,b);b=P.call(this,a);c.attributeChangedCallback(this,a,e,b,null)});r(Element.prototype,"setAttributeNS",function(a,
|
|
36
|
-
b,d){if(1!==this.__CE_state)return T.call(this,a,b,d);var e=S.call(this,a,b);T.call(this,a,b,d);d=S.call(this,a,b);c.attributeChangedCallback(this,b,e,d,a)});r(Element.prototype,"removeAttribute",function(a){if(1!==this.__CE_state)return R.call(this,a);var b=P.call(this,a);R.call(this,a);null!==b&&c.attributeChangedCallback(this,a,b,null,null)});r(Element.prototype,"removeAttributeNS",function(a,b){if(1!==this.__CE_state)return U.call(this,a,b);var d=S.call(this,a,b);U.call(this,a,b);var e=S.call(this,
|
|
37
|
-
a,b);d!==e&&c.attributeChangedCallback(this,b,d,e,a)});ua?b(HTMLElement.prototype,ua):ma?b(Element.prototype,ma):console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched.");va?d(HTMLElement.prototype,va):na?d(Element.prototype,na):console.warn("Custom Elements: `Element#insertAdjacentHTML` was not patched.");Y(c,Element.prototype,{h:oa,append:pa});Aa(c)};var Z=window.customElements;if(!Z||Z.forcePolyfill||"function"!=typeof Z.define||"function"!=typeof Z.get){var X=new u;xa();ya();Y(X,DocumentFragment.prototype,{h:ka,append:la});za();Ba();document.__CE_hasRegistry=!0;var customElements=new E(X);Object.defineProperty(window,"customElements",{configurable:!0,enumerable:!0,value:customElements})};
|
|
38
|
-
}).call(self);
|
|
39
|
-
|
|
40
|
-
// Polyfill document.baseURI
|
|
41
|
-
"string"!==typeof document.baseURI&&Object.defineProperty(Document.prototype,"baseURI",{enumerable:!0,configurable:!0,get:function(){var a=document.querySelector("base");return a&&a.href?a.href:document.URL}});
|
|
42
|
-
|
|
43
|
-
// Polyfill CustomEvent
|
|
44
|
-
"function"!==typeof window.CustomEvent&&(window.CustomEvent=function(c,a){a=a||{bubbles:!1,cancelable:!1,detail:void 0};var b=document.createEvent("CustomEvent");b.initCustomEvent(c,a.bubbles,a.cancelable,a.detail);return b},window.CustomEvent.prototype=window.Event.prototype);
|
|
45
|
-
|
|
46
|
-
// Event.composedPath
|
|
47
|
-
(function(b,c,d){b.composedPath||(b.composedPath=function(){if(this.path)return this.path;var a=this.target;for(this.path=[];null!==a.parentNode;)this.path.push(a),a=a.parentNode;this.path.push(c,d);return this.path})})(Event.prototype,document,window);
|
|
48
|
-
|
|
49
|
-
/*!
|
|
50
|
-
Element.closest and Element.matches
|
|
51
|
-
https://github.com/jonathantneal/closest
|
|
52
|
-
Creative Commons Zero v1.0 Universal
|
|
53
|
-
*/
|
|
54
|
-
(function(a){"function"!==typeof a.matches&&(a.matches=a.msMatchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||function(a){a=(this.document||this.ownerDocument).querySelectorAll(a);for(var b=0;a[b]&&a[b]!==this;)++b;return!!a[b]});"function"!==typeof a.closest&&(a.closest=function(a){for(var b=this;b&&1===b.nodeType;){if(b.matches(a))return b;b=b.parentNode}return null})})(window.Element.prototype);
|
|
55
|
-
|
|
56
|
-
/*!
|
|
57
|
-
Element.getRootNode()
|
|
58
|
-
*/
|
|
59
|
-
(function(c){function d(a){a=b(a);return a&&11===a.nodeType?d(a.host):a}function b(a){return a&&a.parentNode?b(a.parentNode):a}"function"!==typeof c.getRootNode&&(c.getRootNode=function(a){return a&&a.composed?d(this):b(this)})})(Element.prototype);
|
|
60
|
-
|
|
61
|
-
/*!
|
|
62
|
-
Element.isConnected()
|
|
63
|
-
*/
|
|
64
|
-
(function(a){"isConnected"in a||Object.defineProperty(a,"isConnected",{configurable:!0,enumerable:!0,get:function(){var a=this.getRootNode({composed:!0});return a&&9===a.nodeType}})})(Element.prototype);
|
|
65
|
-
|
|
66
|
-
/*!
|
|
67
|
-
Element.remove()
|
|
68
|
-
*/
|
|
69
|
-
(function(b){b.forEach(function(a){a.hasOwnProperty("remove")||Object.defineProperty(a,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){null!==this.parentNode&&this.parentNode.removeChild(this)}})})})([Element.prototype,CharacterData.prototype,DocumentType.prototype]);
|
|
70
|
-
|
|
71
|
-
/*!
|
|
72
|
-
Element.classList
|
|
73
|
-
*/
|
|
74
|
-
!function(e){'classList'in e||Object.defineProperty(e,"classList",{get:function(){var e=this,t=(e.getAttribute("class")||"").replace(/^\s+|\s$/g,"").split(/\s+/g);function n(){t.length>0?e.setAttribute("class",t.join(" ")):e.removeAttribute("class")}return""===t[0]&&t.splice(0,1),t.toggle=function(e,i){void 0!==i?i?t.add(e):t.remove(e):-1!==t.indexOf(e)?t.splice(t.indexOf(e),1):t.push(e),n()},t.add=function(){for(var e=[].slice.call(arguments),i=0,s=e.length;i<s;i++)-1===t.indexOf(e[i])&&t.push(e[i]);n()},t.remove=function(){for(var e=[].slice.call(arguments),i=0,s=e.length;i<s;i++)-1!==t.indexOf(e[i])&&t.splice(t.indexOf(e[i]),1);n()},t.item=function(e){return t[e]},t.contains=function(e){return-1!==t.indexOf(e)},t.replace=function(e,i){-1!==t.indexOf(e)&&t.splice(t.indexOf(e),1,i),n()},t.value=e.getAttribute("class")||"",t}})}(Element.prototype);
|
|
75
|
-
|
|
76
|
-
/*!
|
|
77
|
-
DOMTokenList
|
|
78
|
-
*/
|
|
79
|
-
(function(b){try{document.body.classList.add()}catch(e){var c=b.add,d=b.remove;b.add=function(){for(var a=0;a<arguments.length;a++)c.call(this,arguments[a])};b.remove=function(){for(var a=0;a<arguments.length;a++)d.call(this,arguments[a])}}})(DOMTokenList.prototype);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(){if("undefined"!==typeof window&&void 0!==window.Reflect&&void 0!==window.customElements){var a=HTMLElement;window.HTMLElement=function(){return Reflect.construct(a,[],this.constructor)};HTMLElement.prototype=a.prototype;HTMLElement.prototype.constructor=HTMLElement;Object.setPrototypeOf(HTMLElement,a)}})();
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export function applyPolyfills() {
|
|
2
|
-
var promises = [];
|
|
3
|
-
if (typeof window !== 'undefined') {
|
|
4
|
-
var win = window;
|
|
5
|
-
|
|
6
|
-
if (!win.customElements ||
|
|
7
|
-
(win.Element && (!win.Element.prototype.closest || !win.Element.prototype.matches || !win.Element.prototype.remove || !win.Element.prototype.getRootNode))) {
|
|
8
|
-
promises.push(import(/* webpackChunkName: "polyfills-dom" */ './dom.js'));
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
var checkIfURLIsSupported = function() {
|
|
12
|
-
try {
|
|
13
|
-
var u = new URL('b', 'http://a');
|
|
14
|
-
u.pathname = 'c%20d';
|
|
15
|
-
return (u.href === 'http://a/c%20d') && u.searchParams;
|
|
16
|
-
} catch (e) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
if (
|
|
22
|
-
'function' !== typeof Object.assign || !Object.entries ||
|
|
23
|
-
!Array.prototype.find || !Array.prototype.includes ||
|
|
24
|
-
!String.prototype.startsWith || !String.prototype.endsWith ||
|
|
25
|
-
(win.NodeList && !win.NodeList.prototype.forEach) ||
|
|
26
|
-
!win.fetch ||
|
|
27
|
-
!checkIfURLIsSupported() ||
|
|
28
|
-
typeof WeakMap == 'undefined'
|
|
29
|
-
) {
|
|
30
|
-
promises.push(import(/* webpackChunkName: "polyfills-core-js" */ './core-js.js'));
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return Promise.all(promises);
|
|
34
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SystemJS 4.0.2
|
|
3
|
-
* MANUAL PATCH: remove script.crossOrigin = "anonymous"
|
|
4
|
-
* MANUAL PATCH: add conditionally apply, n.System=n.System||new u
|
|
5
|
-
*/
|
|
6
|
-
!function(){var e="undefined"!=typeof self,n=e?self:global;var t;if("undefined"!=typeof document){var e=document.querySelector("base[href]");e&&(t=e.href)}if(!t&&"undefined"!=typeof location){var e=(t=location.href.split("#")[0].split("?")[0]).lastIndexOf("/");-1!==e&&(t=t.slice(0,e+1))}var r=/\\/g,o="undefined"!=typeof Symbol,i=o&&Symbol.toStringTag,c=o?Symbol():"@";function u(){this[c]={}}var s=u.prototype;var l;s.import=function(e,n){var t=this;return Promise.resolve(t.resolve(e,n)).then(function(e){var n=function e(n,t,r){var o=n[c][t];if(o)return o;var u=[],s=Object.create(null);i&&Object.defineProperty(s,i,{value:"Module"});var l=Promise.resolve().then(function(){return n.instantiate(t,r)}).then(function(e){if(!e)throw Error("Module "+t+" did not instantiate");var r=e[1](function(e,n){o.h=!0;var t=!1;if("object"!=typeof e)e in s&&s[e]===n||(s[e]=n,t=!0);else for(var n in e){var r=e[n];n in s&&s[n]===r||(s[n]=r,t=!0)}if(t)for(var e=0;e<u.length;e++)u[e](s);return n},2===e[1].length?{import:function(e){return n.import(e,t)},meta:n.createContext(t)}:void 0);return o.e=r.execute||function(){},[e[0],r.setters||[]]});var f=l.then(function(r){return Promise.all(r[0].map(function(o,i){var c=r[1][i];return Promise.resolve(n.resolve(o,t)).then(function(r){var o=e(n,r,t);return Promise.resolve(o.I).then(function(){return c&&(o.i.push(c),!o.h&&o.I||c(o.n)),o})})})).then(function(e){o.d=e})});return f.catch(function(e){o.e=null,o.er=e}),o=n[c][t]={id:t,i:u,n:s,I:l,L:f,h:!1,d:void 0,e:void 0,er:void 0,E:void 0,C:void 0}}(t,e);return n.C||function(e,n){return n.C=function e(n,t,r){if(!r[t.id])return r[t.id]=!0,Promise.resolve(t.L).then(function(){return Promise.all(t.d.map(function(t){return e(n,t,r)}))})}(e,n,{}).then(function(){return function e(n,t,r){if(r[t.id])return;if(r[t.id]=!0,!t.e){if(t.er)throw t.er;return t.E?t.E:void 0}var o;return t.d.forEach(function(t){{var i=e(n,t,r);i&&(o=o||[]).push(i)}}),o?Promise.all(o).then(i):i();function i(){try{var e=t.e.call(f);if(e)return e=e.then(function(){t.C=t.n,t.E=null}),t.E=t.E||e;t.C=t.n}catch(e){throw t.er=e,e}finally{t.L=t.I=void 0,t.e=null}}}(e,n,{})}).then(function(){return n.n})}(t,n)})},s.createContext=function(e){return{url:e}},s.register=function(e,n){l=[e,n]},s.getRegister=function(){var e=l;return l=void 0,e};var f=Object.freeze(Object.create(null));n.System=n.System||new u;var d=s.register;s.register=function(e,n){d.call(this,e,n)},s.instantiate=function(e,n){var t=this;return".json"===e.substr(-5)?fetch(e).then(function(e){return e.text()}).then(function(e){return[[],function(n){return{execute:function(){n("default",JSON.parse(e))}}}]}):new Promise(function(r,o){var i;function c(n){n.filename===e&&(i=n.error)}window.addEventListener("error",c);var u=document.createElement("script");u.charset="utf-8",u.async=!0,u.addEventListener("error",function(){window.removeEventListener("error",c),o(Error("Error loading "+e+(n?" from "+n:"")))}),u.addEventListener("load",function(){window.removeEventListener("error",c),document.head.removeChild(u),i?o(i):r(t.getRegister())}),u.src=e,document.head.appendChild(u)})},e&&"function"==typeof importScripts&&(s.instantiate=function(e){var n=this;return new Promise(function(t,r){try{importScripts(e)}catch(e){r(e)}t(n.getRegister())})}),s.resolve=function(e,n){var o=function(e,n){if(-1!==e.indexOf("\\")&&(e=e.replace(r,"/")),"/"===e[0]&&"/"===e[1])return n.slice(0,n.indexOf(":")+1)+e;if("."===e[0]&&("/"===e[1]||"."===e[1]&&("/"===e[2]||2===e.length&&(e+="/"))||1===e.length&&(e+="/"))||"/"===e[0]){var t=n.slice(0,n.indexOf(":")+1);var r;if(r="/"===n[t.length+1]?"file:"!==t?(r=n.slice(t.length+2)).slice(r.indexOf("/")+1):n.slice(8):n.slice(t.length+("/"===n[t.length])),"/"===e[0])return n.slice(0,n.length-r.length-1)+e;var o=r.slice(0,r.lastIndexOf("/")+1)+e,i=[];var c=-1;for(var e=0;e<o.length;e++)-1!==c?"/"===o[e]&&(i.push(o.slice(c,e+1)),c=-1):"."===o[e]?"."!==o[e+1]||"/"!==o[e+2]&&e+2!==o.length?"/"===o[e+1]||e+1===o.length?e+=1:c=e:(i.pop(),e+=2):c=e;return-1!==c&&i.push(o.slice(c)),n.slice(0,n.length-r.length)+i.join("")}}(e,n||t);if(!o){if(-1!==e.indexOf(":"))return Promise.resolve(e);throw Error('Cannot resolve "'+e+(n?'" from '+n:'"'))}return Promise.resolve(o)}}();
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-643344dc.js';
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
Stencil Client Patch Browser v2.8.1 | MIT Licensed | https://stenciljs.com
|
|
5
|
-
*/
|
|
6
|
-
const patchBrowser = () => {
|
|
7
|
-
const importMeta = import.meta.url;
|
|
8
|
-
const opts = {};
|
|
9
|
-
if (importMeta !== '') {
|
|
10
|
-
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
11
|
-
}
|
|
12
|
-
return promiseResolve(opts);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["multi-warehouse_4",[[4,"multi-warehouse",{"position":[1],"displayAs":[1,"display-as"],"browseProductsFrom":[1,"browse-products-from"],"branches":[16],"current":[1026],"open":[32],"selected":[32],"isOpenedBefore":[32],"show":[64],"hide":[64]}],[0,"salla-login"],[4,"salla-button",{"btnStyle":[513,"btn-style"],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"load":[64],"stop":[64],"disable":[64],"enable":[64]}],[4,"salla-modal",{"error":[4],"success":[4],"isClosable":[1028,"is-closable"],"modalWidth":[513,"modal-width"],"visible":[516],"subTitle":[1,"sub-title"],"icon":[1],"show":[64],"hide":[64],"setTitle":[64]}]]],["salla-localization",[[4,"salla-localization",{"languages":[1],"currencies":[1],"ok":[1],"show":[64],"hide":[64],"submit":[64]}]]],["salla-product-availability",[[4,"salla-product-availability",{"channels":[1],"buttonText":[1,"button-text"],"countryCode":[1,"country-code"],"subscribe":[1],"cancel":[1],"subTitle":[1,"sub-title"],"mobileLabel":[1,"mobile-label"],"emailLabel":[1,"email-label"],"mobilePlaceholder":[1,"mobile-placeholder"],"emailPlaceholder":[1,"email-placeholder"],"productId":[2,"product-id"],"subscribed":[1],"submit":[64]}]]],["salla-rating",[[0,"salla-rating",{"orderId":[2,"order-id"],"thanksMsg":[1,"thanks-msg"],"isStoreRating":[4,"is-store-rating"],"isProductsRating":[4,"is-products-rating"],"isShippingRating":[4,"is-shipping-rating"],"show":[64],"hide":[64]}]]],["salla-verify",[[0,"salla-verify"]]],["salla-search",[[4,"salla-search",{"searchPlaceholder":[1,"search-placeholder"],"noResultsText":[1,"no-results-text"],"searchTerm":[32],"results":[32],"fetchStatus":[32],"showResult":[32],"showModal":[32]}]]]], options);
|
|
17
|
-
});
|
package/dist/index.cjs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('./cjs/index.cjs.js');
|
package/dist/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './esm/index.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,h as t,H as l,g as i}from"./p-d1ef2268.js";import{H as a}from"./p-9bc28e0c.js";const e=class{constructor(t){s(this,t),this.isUser=a.isUser(),this.buttonText=salla.lang.get("pages.products.notify_availability"),this.countryCode=salla.config.country_code||"SA",this.subscribe=salla.lang.get("common.elements.submit"),this.cancel=salla.lang.get("common.elements.cancel"),this.subTitle=salla.lang.get("pages.products.notify_availability_subtitle"),this.mobileLabel=salla.lang.get("common.elements.mobile"),this.emailLabel=salla.lang.get("common.elements.email"),this.mobilePlaceholder=salla.lang.get("common.elements.mobile_placeholder"),this.emailPlaceholder=salla.lang.get("common.elements.email_placeholder"),this.productId=salla.config.page.id,this.subscribed=salla.lang.get("pages.products.notify_availability_success"),this.isUser||(this.channelsWatcher(this.channels),this.title_=this.host.title||salla.lang.get("pages.products.notify_availability_title"),this.host.removeAttribute("title"))}channelsWatcher(s){this.channels_=s.split(",")}async submit(){if(this.isUser)return salla.api.product.availabilitySubscribe(this.productId).then((()=>{salla.success(this.subscribed)})).then((()=>this.host.remove()));let s={id:this.productId,country_code:this.countryCode};return""!==this.mobile.value&&(s.mobile=this.mobile.value),""!==this.email.value&&(s.email=this.email.value),this.btn.load().then((()=>this.btn.disable())).then((()=>salla.api.product.availabilitySubscribe(s))).then((()=>{salla.success(this.subscribed)})).then((()=>this.btn.stop())).then((()=>this.modal.hide())).then((()=>this.host.remove())).catch((()=>this.btn.stop()&&this.btn.enable()))}render(){return t(l,null,t("slot",null,t("salla-button",{onClick:()=>this.isUser?this.submit():this.modal.show()},this.buttonText)),this.isUser?"":this.renderModal())}renderModal(){return t("salla-modal",{ref:s=>this.modal=s,id:"product-availability-modal",title:this.title_,subTitle:this.subTitle,icon:"sicon-bell-ring",modalWidth:"w-full"},t("div",{class:"s-product-availability-body"},this.channels_.includes("email")?[t("label",{class:"s-product-availability-label"},this.emailLabel),t("input",{class:"s-product-availability-input",placeholder:this.emailPlaceholder,ref:s=>this.email=s,type:"email"})]:"",this.channels_.includes("sms")?[t("label",{class:"s-product-availability-label"},this.mobileLabel),t("input",{class:"s-product-availability-input",placeholder:this.mobilePlaceholder,ref:s=>this.mobile=s,type:"text"}),t("input",{type:"hidden",value:this.countryCode})]:""),t("div",{slot:"footer",class:"common-anime flex justify-between space-s-4"},t("salla-button",{ref:s=>this.btn=s,class:"w-full",onClick:()=>this.submit()},this.subscribe),t("salla-button",{class:"w-full",color:"outline"},this.cancel)))}get host(){return i(this)}static get watchers(){return{channels:["channelsWatcher"]}}};export{e as salla_product_availability}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as s}from"./p-d1ef2268.js";const t=class{constructor(s){e(this,s)}render(){return s("salla-modal",{id:"salla-login",title:"سجل دخول إلى الموقع"},s("div",{id:"showLoginMethods"},s("p",{class:"text-sm text-gray-text mb-5"},"اختر الوسيلة المناسبة"),s("div",{id:"openEmailLogin",class:"mb-2.5 box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200"},s("div",{class:"flex-shrink-0"},s("div",{class:"bg-primary w-12 h-12 text-lg text-white rounded-icon"},s("i",{class:"sicon-mail"}))),s("div",{class:"flex-1 min-w-0"},s("a",{href:"#",class:"focus:outline-none flex justify-between items-center"},s("div",{class:"flex-1"},s("span",{class:"absolute inset-0","aria-hidden":"true"}),s("p",{class:"text-sm text-gray-text"},"سجل دخول"),s("h6",{class:"font-boldf"},"البريد الإلكتروني")),s("i",{class:"sicon-keyboard_arrow_left text-primary text-xl"})))),s("div",{class:"box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200"},s("div",{class:"flex-shrink-0"},s("div",{class:"bg-primary w-12 h-12 text-lg text-white rounded-icon"},s("i",{class:"sicon-phone"}))),s("div",{class:"flex-1 min-w-0"},s("a",{href:"#",class:"focus:outline-none flex justify-between items-center"},s("div",{class:"flex-1"},s("span",{class:"absolute inset-0","aria-hidden":"true"}),s("p",{class:"text-sm text-gray-text"},"سجل دخول"),s("h6",{class:"font-boldf"},"الهاتف")),s("i",{class:"sicon-keyboard_arrow_left text-primary text-xl"}))))))}};export{t as S}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,h as i,g as e}from"./p-d1ef2268.js";import{H as t}from"./p-9bc28e0c.js";const l=class{constructor(i){s(this,i),t.setHost(this.host),salla.event.on("profile::verify.mobile",(s=>this.show(s)))}show({international_mobile:s,_country_iso2:i}){return this.mobile=s,this.country_code=i,this.resendTimer(),this.otpInputs=document.querySelectorAll(".s-verify-input"),this.otpInputs[0].focus(),t.onKeyUp(".s-verify-input",(s=>{var i,e,t,l;let r=s.keyCode||s.charCode;salla.helpers.digitsOnly(s.target),s.target.value?(null===(i=s.target.nextElementSibling)||void 0===i||i.focus(),null===(e=s.target.nextElementSibling)||void 0===e||e.select()):[8,46].includes(r)&&(null===(t=s.target.previousElementSibling)||void 0===t||t.focus(),null===(l=s.target.previousElementSibling)||void 0===l||l.select()),this.toggleOTPSubmit()})),t.on("paste",".s-verify-input",(s=>{let i=s.clipboardData.getData("text").toArabicDigits().replace(/[^0-9.]/g,"").replace("..",".");this.otpInputs.forEach(((s,e)=>s.value=i[e]||"")),this.toggleOTPSubmit(),setTimeout((()=>this.otpInputs[3].focus()),100)})),this.modal.show()}toggleOTPSubmit(){let s=[];if(this.otpInputs.forEach((i=>i.value&&s.push(i.value))),this.code.value=s.join(""),4===s.length)return this.btn.removeAttribute("disabled"),void this.btn.click();this.btn.setAttribute("disabled","")}resendTimer(){t.showElement(this.resendMessage).hideElement(this.resend);let s=30,i=setInterval((()=>{-1===s?(clearTimeout(i),t.hideElement(this.resendMessage).showElement(this.resend)):(this.timer.innerHTML=`${s>=10?s:"0"+s} : 00`,s--)}),1e3)}submit(){return this.btn.load().then((()=>this.btn.disable())).then((()=>salla.document.api.request("profile/verify-mobile",{mobile:this.mobile,country_code:this.country_code,code:this.code.value}))).then((()=>this.btn.stop()&&this.btn.disable())).then((()=>this.modal.hide())).then((()=>window.location.reload())).catch((()=>this.btn.stop()&&this.btn.enable()))}resendCode(){return this.btn.stop().then((()=>this.btn.disable())).then((()=>{this.otpInputs.forEach((s=>s.value="")),this.otpInputs[0].focus()})).then((()=>salla.api.auth.resend({phone:this.mobile,country_code:this.country_code}))).then((()=>this.resendTimer())).catch((()=>this.resendTimer()))}render(){return i("salla-modal",{id:"s-verify",ref:s=>this.modal=s,title:salla.lang.get("pages.profile.verify_title")},i("div",{class:"s-verify-message",innerHTML:salla.lang.get("pages.profile.verify_message")}),i("label",{class:"s-verify-label"},salla.lang.get("pages.profile.verify_placeholder")),i("input",{type:"hidden",name:"code",maxlength:"4",required:!0,ref:s=>this.code=s}),i("div",{class:"s-verify-codes",dir:"ltr"},[1,2,3,4].map((()=>i("input",{type:"text",maxlength:"1",class:"s-verify-input",required:!0})))),i("div",{slot:"footer",class:"s-verify-footer"},i("salla-button",{class:"s-verify-submit",disabled:!0,onClick:()=>this.submit(),ref:s=>this.btn=s},salla.lang.get("pages.profile.verify")),i("p",{class:"s-verify-resend-message",ref:s=>this.resendMessage=s},salla.lang.get("blocks.header.resend_after"),i("b",{class:"s-verify-timer",ref:s=>this.timer=s})),i("a",{href:"#",class:"s-verify-resend",onClick:()=>this.resendCode(),ref:s=>this.resend=s},salla.lang.get("blocks.comments.submit"))))}get host(){return e(this)}};export{l as salla_verify}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{S as salla_search}from"./p-8a2410e6.js";import"./p-d1ef2268.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,h as t,H as i,g as e}from"./p-d1ef2268.js";const r=class{constructor(t){s(this,t),this.fetchStatus="",this.showModal=!1,this.searchPlaceholder="Search here ...",this.noResultsText="There are no results at the moment",this.handleChange=s=>{this.searchTerm=s.target.value,this.fetchStatus="loading",this.showResult=!1,this.results=[],this.searchTerm.length>2&&window.salla.search.api.search(this.searchTerm).then((s=>s)).then((s=>{console.log("response",s),this.fetchStatus="idle",this.results=s.results,this.showResult=!0,this.results.length<1&&(this.fetchStatus="error")})).catch((s=>{this.showResult=!0,this.fetchStatus="error",console.log(s)}))},this.openSearch=()=>{this.searchTerm="",this.fetchStatus="",this.results=[],this.showModal=!0,window.scrollTo(0,0),document.getElementsByTagName("html")[0].style.position="fixed",document.getElementsByTagName("html")[0].style.overflowY="scroll"},this.closeSearch=()=>{this.searchTerm="",this.fetchStatus="",this.results=[],document.getElementsByTagName("html")[0].style.position="static",document.getElementsByTagName("html")[0].style.overflowY="auto",this.showModal=!1}}componentWillLoad(){this.hasSearchIconSlot=!!this.hostElement.querySelector('[slot="search-icon"]'),this.hasProductTemplateSlot=!!this.hostElement.querySelector('[slot="product-template"]'),this.hasProductTemplateSlot&&(this.productTemplateHtml=this.hostElement.querySelector('[slot="product-template"]').innerHTML)}getProduct(s){var i,e;if(this.hasProductTemplateSlot){let e=this.productTemplateHtml.replace("{title}",s.title).replace("{price}",null===(i=s.price)||void 0===i?void 0:i.after).replace("{url}",s.url).replace("{thumb}",s.thumb);return t("div",{class:"s-search-product",innerHTML:e})}return t("div",{class:"s-search-product"},t("a",{target:"_blank",href:s.url,class:"s-search-product-image-container"},t("img",{class:"s-search-product-image",src:s.thumb})),t("div",{class:"s-search-product-details"},t("div",{class:"s-search-product-title"},s.title),t("div",{class:"s-search-product-price"},null===(e=s.price)||void 0===e?void 0:e.after)))}render(){return t(i,{class:"s-search"},t("button",{type:"button",onClick:this.openSearch,class:"s-search-search-button-icon"},this.hasSearchIconSlot?t("slot",{name:"search-icon"}):t("i",{class:"sicon-search font-bold"})),this.showModal&&t("div",{class:"s-search-container",style:{backgroundColor:"rgba(0,0,0,0.5)"}},t("div",{class:"s-search-wrapper",onClick:this.closeSearch},t("div",{class:"s-search-inner",onClick:s=>{s.stopPropagation()}},t("div",{class:"s-search-search-box-container"},t("div",{class:this.showResult?"s-search-search-box-inner-open":"s-search-search-box-inner"},t("input",{class:"s-search-input",type:"text",placeholder:this.searchPlaceholder,value:this.searchTerm,onInput:s=>this.handleChange(s)}),"loading"!=this.fetchStatus?t("button",{class:"s-search-search-icon"},t("i",{class:"sicon-search"})):t("span",{class:"s-search-spinner"},t("span",{class:"s-search-spinner-loader"})))),t("div",{class:"s-search-search-results"},"error"===this.fetchStatus&&t("p",{class:"s-search-no-results error p-4 text-sm text-gray-text"},this.noResultsText),this.results&&this.results.map((s=>this.getProduct(s))))))))}get hostElement(){return e(this)}};export{r as S}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as e,H as a,g as s}from"./p-d1ef2268.js";import{H as i}from"./p-9bc28e0c.js";const r=class{constructor(e){t(this,e),this.stars=[1,2,3,4,5],this.order={shipping:{id:5622},products:[{title:"ميكروفون عالى الجودة",image:"https://salla-dev.s3.eu-central-1.amazonaws.com/Mvyk/pMdEEyMVpZFj4L1Hrdm2g48AuiSx0TrKULBiOnPo.jpg",price:"10,978.00 ر.س",qty:"2",totalBefore:"1120 ر.س",discount:"-5%",total:"1064 ر.س",id:"2314513454",getOptimusRouteKey:"7351233357"},{title:"ساعة ذكية بنظام اندرويد",image:"https://salla-dev.s3.eu-central-1.amazonaws.com/Mvyk/T4kTqYNuPAZmPMLw1bx92RnjVMZyFszVXOUZQsFJ.jpg",price:"10,978.00 ر.س",qty:"2",totalBefore:"1120 ر.س",discount:"-5%",total:"1064 ر.س",id:"679822376",getOptimusRouteKey:"73233357"}]},this.isProductsRating=!1,this.ratingChain=Promise.resolve(),this.stepsCount=0,i.setHost(this.host)}async show(){return this.modal.show()}async hide(){return this.modal.hide()}componentWillLoad(){this.stepsCount=[this.isStoreRating,this.isProductsRating,this.isShippingRating].filter((t=>t)).length,this.getData()}componentDidRender(){this.show(),this.initiateRating()}initiateRating(){this.highlightSelectedStars(),this.starsRating(),this.handleWizard();const t=this.host.querySelector(".step:first-child");this.setModalHeight(t),salla.event.on("submit::order-rating",(()=>this.sendRating().then((()=>{let t=10,e=setInterval((()=>{t--,this.host.querySelector(".close-time").innerHTML=`00:0${t}`,0==t&&(this.hide(),clearInterval(e))}),1e3);this.host.querySelector(".wizard-footer").classList.add("opacity-0","pointer-events-0"),this.host.querySelector(".s-order-rating-title").classList.add("opacity-0","pointer-events-0"),i.toggle(".step","hidden","block",(()=>!0)),i.toggle(".thankyou-view","is-opened","hidden",(()=>!0));const a=this.host.querySelector(".thankyou-view");this.setModalHeight(a),setTimeout((()=>{i.toggleElement(a,["opacity-1","translate-x-0"],["opacity-0","translate-x-3"],(()=>!0))}),200)}))))}handleWizard(){let t=0,e=document.querySelectorAll(".step"),a=document.querySelectorAll(".step-dot");i.toggleElement(e[0],["opacity-1","translate-x-0"],["opacity-0","translate-x-3","hidden"],(()=>!0)),console.log("🚀 ~ file: order-rating.tsx ~ line 129 ~ OrderRating ~ handleWizard ~ steps[0]",e[0]),i.onClick("#prev-btn",(()=>{t>0&&t--,this.showActiveStep(e,a,t),0==t&&i.toggle("#prev-btn",["pointer-events-none","opacity-0"],"block",(()=>!0))})),i.onClick("#next-btn",(()=>{this.ratingValidation(),t==this.stepsCount-1?salla.event.dispatch("submit::order-rating"):(t<this.stepsCount-1&&t++,this.showActiveStep(e,a,t),i.toggle("#prev-btn","block",["pointer-events-none","opacity-0"],(()=>!0)))}))}showActiveStep(t,e,a){i.toggle(".step-dot","bg-gray-200","bg-primay",(()=>!0)),i.toggleElement(e[a],"bg-primary","bg-gray-200",(()=>!0)),i.toggle(".step",["hidden","opacity-0","translate-x-3"],["active","opacity-1","translate-x-0"],(()=>!0)),i.toggleElement(t[a],"active","hidden",(()=>!0)),this.setModalHeight(t[a]),setTimeout((()=>{i.toggleElement(t[a],["opacity-1","translate-x-0"],["opacity-0","translate-x-3"],(()=>!0))}),200)}setModalHeight(t){const e=this.host.querySelector(".s-order-rating-steps-wrapper");setTimeout((()=>{null==e||e.setAttribute("style","height:"+(null==t?void 0:t.scrollHeight)+"px")}))}sendRating(){return i.all(".rating-section",(t=>{let e=t.dataset.type,a=[];t.querySelectorAll(".rating-outer-form").forEach((t=>{let s={};t.querySelectorAll("[name]").forEach((function(t){let e=salla.helpers.inputData(t.name,t.value,s);s[e.name]=e.value})),a=[],a.push(s),this.sendFeedback(e,a)}))})),this.ratingChain}sendFeedback(t,e){e&&0!=e.length&&(this.nextBtn.load(),salla.config.canLeave=!1,this.ratingChain=salla.feedback.api[t](e[0]).then((function(){salla.config.canLeave=!0})).catch((()=>salla.config.canLeave=!0)))}ratingValidation(){let t="";if(document.querySelectorAll(".rating-section.active").forEach((e=>{e.querySelectorAll(".rating-outer-form").forEach((e=>{let a=e.querySelector(".rating_hidden_input"),s=e.querySelector(".comment"),i=e.querySelector(".validation-message");if(a.value&&s.value&&s.value.length>3)return s.classList.remove("has-error"),void(i.innerHTML="");s.value&&s.value.length>3?s.classList.remove("has-error"):s.classList.add("has-error"),t=a.value?salla.lang.get("common.errors.not_less_than_chars",{chars:4})+" "+s.getAttribute("placeholder"):e.dataset.starsError||salla.lang.get("pages.rating.rate_store_stars"),i.innerHTML=t}))})),t){let e=document.querySelectorAll(".has-error");throw e.length&&window.scrollTo({top:e[0].offsetTop-80}),new Error(t)}}getData(){salla.api.order.endpointsMethods.details="get",console.log("🚀 ~ file",salla.order.api.details(this.orderId))}starsRating(){let t=["selected","text-theme-yellow"];salla.document.event.onSubmit(".rate-element",(function(e){e.preventDefault();var a=e.target.querySelectorAll(".btn--star.hovered"),s=a[a.length-1];if(s){var i=parseInt(s.dataset.star,10);e.target.querySelector(".rating_hidden_input").value=i,e.target.querySelectorAll(".btn--star").forEach((function(e,a){a<i?e.classList.add(...t):e.classList.remove(...t)}));var r=e.target.querySelector('.star[aria-pressed="true"]');r&&r.removeAttribute("aria-pressed"),s.setAttribute("aria-pressed",!0)}}))}highlightSelectedStars(){let t=["hovered","text-theme-yellow"];i.all(".rate-element",(e=>{let a=e.querySelectorAll(".btn--star");e.addEventListener("mouseout",(()=>e.querySelectorAll(".btn--star").forEach((e=>e.classList.remove(...t))))),a.forEach(((e,s)=>{e.addEventListener("mouseover",(()=>{if(e.classList.add(...t),s<=1)"BUTTON"===e.previousElementSibling.tagName&&e.previousElementSibling.classList.add(...t);else for(let e=0;e<s;e++)a[e].classList.add(...t)})),e.addEventListener("mouseout",(()=>{e.classList.contains(...t)&&e.classList.remove(...t)}))}))}))}render(){return e(a,null,e("salla-modal",{class:"hidden","modal-width":"w-[800px]",ref:t=>this.modal=t,title:salla.lang.get("pages.rating.rate_order")+' <span class="unicode">(#'+this.orderId+")</span>"},e("div",{class:"s-order-rating-steps-wrapper mt-12 mb-10 transition-all duration-300 ease-elastic"},this.isStoreRating&&this.renderStoreRating(),this.isProductsRating&&this.renderProductsRating(),this.isShippingRating&&this.renderShippingRating(),this.renderThanksView()),e("div",{class:"wizard-footer relative flex justify-between items-center"},e("button",{id:"prev-btn",class:"font-bold text-sm w-28 h-10 px-4 text-primary hover:text-primary-d opacity-0 pointer-events-none duration-300 transition-all"},"السابق"),this.stepsCount>1?e("ul",{class:"flex justify-center text-center space-s-1.5 flex-1"},[0,1,2].slice(0,this.stepsCount).map((t=>e("li",{class:(0==t?"bg-primary":"bg-gray-200")+" step-dot w-2.5 h-2.5 rounded-full transition-colors duration-300"})))):"",e("salla-button",{id:"next-btn",class:"w-28",ref:t=>this.nextBtn=t},"التالي"))))}renderStoreRating(){return e("section",{class:"step rating-section active transition-all duration-500","data-type":"store"},e("div",{class:"rating-outer-form","data-stars-error":salla.lang.get("pages.rating.rate_store_stars")},e("input",{type:"hidden",name:"order_id",value:this.orderId}),e("input",{type:"hidden",name:"type",value:"store"}),e("div",{class:"flex flex-col items-center "},e("div",{class:"w-28 h-28 border border-gray-200 rounded-full flex items-center justify-center mb-4"},e("img",{src:"https://salla-dev.s3.eu-central-1.amazonaws.com/Mvyk/X3NKcY7nhaFQlR7kBBHvfDpMY48cerunKrmDA1gi.png",alt:"store name",class:"w-12 object-contain"})),e("h2",{class:"section-title text-lg font-bold mb-4"},salla.lang.get("pages.rating.rate_the_store"))),e("div",{class:"rating-wrap flex items-center flex justify-center mb-4"},e("form",{class:"rate-element rate-element--has-label"},this.getStarsRating())),e("textarea",{id:"storeReview",name:"comment",class:"form-input comment h-20",placeholder:salla.lang.get("pages.rating.write_store_rate")}),e("small",{class:"text-red-400 validation-message"})))}renderProductsRating(){return e("section",{class:"step rating-section products-section transition-all duration-500 opacity-0 translate-x-3 hidden","data-type":"product"},e("div",{class:"overflow-hidden"},this.order.products.map(((t,a)=>e("div",{class:"rating-outer-form mb-8 last:mb-0","data-stars-error":salla.lang.get("pages.rating.rate_product_stars",{item:t.title})},e("div",{class:"product-item"},e("div",{class:"flex space-s-5"},e("img",{src:t.image,alt:t.title,class:"w-18 h-14 object-cover rounded-md"}),e("div",{class:"flex-1"},e("h3",{class:"section-title leading-5 mb-1.5 font-bold md:text-sm"}," ",t.title),e("div",{class:"rw-product-entry__rate"},e("div",{class:"rating-wrap flex items-center space-s-4"},e("form",{class:"rate-element rate-element--has-label"},this.getStarsRating())),e("input",{type:"hidden",name:"order_id",value:this.orderId}),e("input",{type:"hidden",name:`products[${a}][product_id]`,value:t.getOptimusRouteKey}),e("input",{type:"hidden",name:"type",value:"products"}),e("textarea",{"data-product-id":t.id,name:`products[${a}][comment]`,id:`productReview_${t.id}`,class:"comment form-input h-20 product-review",placeholder:salla.lang.get("pages.rating.write_product_rate")}),e("small",{class:"text-red-400 validation-message"}))))))))))}renderShippingRating(){return e("section",{class:"step rating-section py-5 rounded-md transition-all duration-500 opacity-0 translate-x-3 hidden","data-type":"shipping"},e("div",{class:"rating-outer-form","data-stars-error":salla.lang.get("pages.rating.rate_shipping_stars")},e("input",{type:"hidden",name:"order_id",value:this.orderId}),e("input",{type:"hidden",name:"shipping_company_id",value:this.order.shipping.id}),e("input",{type:"hidden",name:"type",value:"shipping"}),e("div",{class:"flex flex-col items-center "},e("div",{class:"w-28 h-28 overflow-hidden border border-gray-200 rounded-full flex items-center justify-center mb-4"},e("img",{src:"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcScPt4R6KaKDldrXb-9pUljFwL3m6A72BhN6p1qZJKprwC6VbCWC_8ASZgiJAoL_l7DepM&usqp=CAU",alt:"company name",class:"w-full h-full object-contain"})),e("h2",{class:"section-title text-lg font-bold mb-4"}," ",salla.lang.get("pages.rating.rate_shipping")," ارامكس")),e("div",{class:"rating-wrap flex flex justify-center mb-4"},e("form",{class:"rate-element ratFeedbackPresentere-element--has-label"},this.getStarsRating())),e("textarea",{id:"shippingReview",name:"comment",class:"form-input comment h-20 mb-2",placeholder:salla.lang.get("pages.rating.write_shipping_rate")}),e("small",{class:"text-red-400 validation-message"})))}renderThanksView(){return e("div",{class:"thankyou-view px-8 text-center transition-all duration-500 opacity-0 translate-x-3 hidden"},e("span",{class:"w-20 h-20 text-4xl inline-flex justify-center items-center bg-gray-50 rounded-full text-primary sicon-check-circle2"}),e("div",{class:"mt-4 mb-6"},e("h3",{class:"font-bold"},salla.lang.get("pages.rating.thanks")),e("div",{class:"text-gray-400 text-sm",innerHTML:this.thanksMsg})),e("a",{href:"#!",onClick:()=>this.hide(),class:"btn btn-primary h-10 flex-none px-8"},"عودة إلي تفاصيل الطلب"),e("time",{class:"close-time text-gray-400 block h-6 mt-3 text-sm"}))}getStarsRating(){return e("div",{class:"mb-1"},e("input",{type:"hidden",class:"rating_hidden_input",name:"rating",value:""}),this.stars.map((t=>e("button",{type:"submit",class:"btn btn--transparent px-1 text-2xl text-gray-400 btn--star","data-star":t},e("i",{class:"sicon-star2"})))))}get host(){return s(this)}};r.style=":host{display:block}";export{r as salla_rating}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
class t extends salla.AppHelpers{setHost(t){this.host=t}getElement(t){return this.host.querySelector(t)}getAttribute(t,e){var s;return null===(s=this.getElement(t))||void 0===s?void 0:s.getAttribute(e)}val(t){return this.getAttribute(t,"value")}isUser(){return!!salla.config.is_user}}const e=new t;export{e as H}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as l,h as s,g as a}from"./p-d1ef2268.js";import{H as i}from"./p-9bc28e0c.js";const t=class{constructor(s){var a,t;l(this,s),this.language=salla.config.language,this.currency=salla.config.currency,this.languages=salla.lang.get("common.titles.language"),this.currencies=salla.lang.get("common.titles.currency"),this.ok=salla.lang.get("common.elements.ok"),i.setHost(this.host),salla.event.on("localization::show",(()=>this.show())),this.languageSlot=(null===(a=i.getElement('[slot="language"]'))||void 0===a?void 0:a.innerHTML)||'<label class="s-localization-label" for"lang-{code}"><span>{name}</span><div class="s-localization-flag flag iti__flag iti__{country_code}"></div></label>',this.currencySlot=(null===(t=i.getElement('[slot="currency"]'))||void 0===t?void 0:t.innerHTML)||'<label class="s-localization-label" for="currency-{code}"><span>{name}</span><small class="s-localization-currency">{code}</small></label>'}async show(){return this.modal.show()}async hide(){return this.modal.hide()}async submit(){let l;this.btn.load().then((()=>{if(this.currency&&this.currency.code!==salla.config.currency.code)return l=window.location.href,salla.currency.api.change(this.currency.code)})).then((()=>{this.language&&this.language.code!==salla.config.language.code&&(l=this.language.url)})).then((()=>this.btn.stop())).then((()=>this.hide())).then((()=>l&&(window.location.href=l)))}render(){return s("salla-modal",{id:"salla-localization",class:"hidden",ref:l=>this.modal=l},s("slot",{name:"header"},s("div",{slot:"header"})),s("div",{class:"s-localization-inner"},salla.config.languages?s("div",{class:"s-localization-section"},s("label",{class:"s-localization-title"},this.languages),s("fieldset",{class:"s-localization-fieldset"},s("legend",{class:"sr-only"},salla.lang.get("blocks.header.change_language")),s("div",{class:"s-localization-section-inner"},salla.config.languages.map((l=>s("div",{class:"s-localization-item"},s("input",{class:"s-localization-input",type:"radio",checked:this.language.code==l.code,onChange:()=>this.language=l,name:"language",id:"lang-"+l.code.toLowerCase(),value:l.code}),s("div",{id:"language-slot",innerHTML:this.languageSlot.replace(/\{name\}/g,l.name).replace(/\{code\}/g,l.code).replace(/\{country_code\}/g,l.country_code)}))))))):"",salla.config.currencies?s("div",{class:"s-localization-section"},s("label",{class:"s-localization-title"},this.currencies),s("fieldset",{class:"s-localization-fieldset"},s("legend",{class:"sr-only"},salla.lang.get("blocks.header.change_currency")),s("div",{class:"s-localization-section-inner"},salla.config.currencies.map((l=>s("div",{class:"s-localization-item"},s("input",{class:"s-localization-input",type:"radio",name:"currency",checked:this.currency.code==l.code,onChange:()=>this.currency=l,id:"currency-"+l.code,value:l.code}),s("div",{id:"currency-slot",innerHTML:this.currencySlot.replace(/\{name\}/g,l.name).replace(/\{code\}/g,l.code).replace(/\{country_code\}/g,l.country_code)}))))))):""),s("p",{slot:"footer"},s("slot",{name:"footer"},s("salla-button",{ref:l=>this.btn=l,onClick:()=>this.submit(),class:"w-full"},this.ok))))}componentDidRender(){this.host.querySelectorAll("#currency-slot").forEach((l=>l.replaceWith(l.firstChild))),this.host.querySelectorAll("#language-slot").forEach((l=>l.replaceWith(l.firstChild)))}get host(){return a(this)}};export{t as salla_localization}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e,t,l=!1,n=!1,o=!1,s=!1;const i="undefined"!=typeof window?window:{},r=i.document||{head:{}},c={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,l,n)=>e.addEventListener(t,l,n),rel:(e,t,l,n)=>e.removeEventListener(t,l,n),ce:(e,t)=>new CustomEvent(e,t)},f=e=>Promise.resolve(e),a=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),u="http://www.w3.org/1999/xlink",$=new WeakMap,d=e=>"sc-"+e.o,y={},h=e=>"object"==(e=typeof e)||"function"===e,p=(e,t,...l)=>{let n=null,o=null,s=null,i=!1,r=!1,c=[];const f=t=>{for(let l=0;l<t.length;l++)n=t[l],Array.isArray(n)?f(n):null!=n&&"boolean"!=typeof n&&((i="function"!=typeof e&&!h(n))&&(n+=""),i&&r?c[c.length-1].i+=n:c.push(i?m(null,n):n),r=i)};if(f(l),t){t.key&&(o=t.key),t.name&&(s=t.name);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const a=m(e,null);return a.u=t,c.length>0&&(a.$=c),a.h=o,a.p=s,a},m=(e,t)=>({t:0,m:e,i:t,k:null,$:null,u:null,h:null,p:null}),b={},w=(e,t,l,n,o,s)=>{if(l!==n){let r=te(e,t),f=t.toLowerCase();if("class"===t){const t=e.classList,o=g(l),s=g(n);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in l)n&&null!=n[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in n)l&&n[t]===l[t]||(t.includes("-")?e.style.setProperty(t,n[t]):e.style[t]=n[t])}else if("key"===t);else if("ref"===t)n&&n(e);else if(r||"o"!==t[0]||"n"!==t[1]){const i=h(n);if((r||i&&null!==n)&&!o)try{if(e.tagName.includes("-"))e[t]=n;else{let o=null==n?"":n;"list"===t?r=!1:null!=l&&e[t]==o||(e[t]=o)}}catch(e){}let c=!1;f!==(f=f.replace(/^xlink\:?/,""))&&(t=f,c=!0),null==n||!1===n?!1===n&&""!==e.getAttribute(t)||(c?e.removeAttributeNS(u,t):e.removeAttribute(t)):(!r||4&s||o)&&!i&&(n=!0===n?"":n,c?e.setAttributeNS(u,t,n):e.setAttribute(t,n))}else t="-"===t[2]?t.slice(3):te(i,f)?f.slice(2):f[2]+t.slice(3),l&&c.rel(e,t,l,!1),n&&c.ael(e,t,n,!1)}},k=/\s/,g=e=>e?e.split(k):[],S=(e,t,l,n)=>{const o=11===t.k.nodeType&&t.k.host?t.k.host:t.k,s=e&&e.u||y,i=t.u||y;for(n in s)n in i||w(o,n,s[n],void 0,l,t.t);for(n in i)w(o,n,s[n],i[n],l,t.t)},j=(n,s,i)=>{let c,f,a,u=s.$[i],$=0;if(l||(o=!0,"slot"===u.m&&(u.t|=u.$?2:1)),null!==u.i)c=u.k=r.createTextNode(u.i);else if(1&u.t)c=u.k=r.createTextNode("");else if(c=u.k=r.createElement(2&u.t?"slot-fb":u.m),S(null,u,!1),u.$)for($=0;$<u.$.length;++$)f=j(n,u,$),f&&c.appendChild(f);return c["s-hn"]=t,3&u.t&&(c["s-sr"]=!0,c["s-cr"]=e,c["s-sn"]=u.p||"",a=n&&n.$&&n.$[i],a&&a.m===u.m&&n.k&&v(n.k,!1)),c},v=(e,l)=>{c.t|=1;const n=e.childNodes;for(let e=n.length-1;e>=0;e--){const s=n[e];s["s-hn"]!==t&&s["s-ol"]&&(x(s).insertBefore(s,R(s)),s["s-ol"].remove(),s["s-ol"]=void 0,o=!0),l&&v(s,l)}c.t&=-2},M=(e,t,l,n,o,s)=>{let i,r=e["s-cr"]&&e["s-cr"].parentNode||e;for(;o<=s;++o)n[o]&&(i=j(null,l,o),i&&(n[o].k=i,r.insertBefore(i,R(t))))},O=(e,t,l,o,s)=>{for(;t<=l;++t)(o=e[t])&&(s=o.k,A(o),n=!0,s["s-ol"]?s["s-ol"].remove():v(s,!0),s.remove())},C=(e,t)=>e.m===t.m&&("slot"===e.m?e.p===t.p:e.h===t.h),R=e=>e&&e["s-ol"]||e,x=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,P=(e,t)=>{const l=t.k=e.k,n=e.$,o=t.$,s=t.i;let i;null===s?("slot"===t.m||S(e,t,!1),null!==n&&null!==o?((e,t,l,n)=>{let o,s,i=0,r=0,c=0,f=0,a=t.length-1,u=t[0],$=t[a],d=n.length-1,y=n[0],h=n[d];for(;i<=a&&r<=d;)if(null==u)u=t[++i];else if(null==$)$=t[--a];else if(null==y)y=n[++r];else if(null==h)h=n[--d];else if(C(u,y))P(u,y),u=t[++i],y=n[++r];else if(C($,h))P($,h),$=t[--a],h=n[--d];else if(C(u,h))"slot"!==u.m&&"slot"!==h.m||v(u.k.parentNode,!1),P(u,h),e.insertBefore(u.k,$.k.nextSibling),u=t[++i],h=n[--d];else if(C($,y))"slot"!==u.m&&"slot"!==h.m||v($.k.parentNode,!1),P($,y),e.insertBefore($.k,u.k),$=t[--a],y=n[++r];else{for(c=-1,f=i;f<=a;++f)if(t[f]&&null!==t[f].h&&t[f].h===y.h){c=f;break}c>=0?(s=t[c],s.m!==y.m?o=j(t&&t[r],l,c):(P(s,y),t[c]=void 0,o=s.k),y=n[++r]):(o=j(t&&t[r],l,r),y=n[++r]),o&&x(u.k).insertBefore(o,R(u.k))}i>a?M(e,null==n[d+1]?null:n[d+1].k,l,n,r,d):r>d&&O(t,i,a)})(l,n,t,o):null!==o?(null!==e.i&&(l.textContent=""),M(l,null,t,o,0,o.length-1)):null!==n&&O(n,0,n.length-1)):(i=l["s-cr"])?i.parentNode.textContent=s:e.i!==s&&(l.data=s)},T=e=>{let t,l,n,o,s,i,r=e.childNodes;for(l=0,n=r.length;l<n;l++)if(t=r[l],1===t.nodeType){if(t["s-sr"])for(s=t["s-sn"],t.hidden=!1,o=0;o<n;o++)if(i=r[o].nodeType,r[o]["s-hn"]!==t["s-hn"]||""!==s){if(1===i&&s===r[o].getAttribute("slot")){t.hidden=!0;break}}else if(1===i||3===i&&""!==r[o].textContent.trim()){t.hidden=!0;break}T(t)}},E=[],L=e=>{let t,l,o,s,i,r,c=0,f=e.childNodes,a=f.length;for(;c<a;c++){if(t=f[c],t["s-sr"]&&(l=t["s-cr"])&&l.parentNode)for(o=l.parentNode.childNodes,s=t["s-sn"],r=o.length-1;r>=0;r--)l=o[r],l["s-cn"]||l["s-nr"]||l["s-hn"]===t["s-hn"]||(W(l,s)?(i=E.find((e=>e.g===l)),n=!0,l["s-sn"]=l["s-sn"]||s,i?i.S=t:E.push({S:t,g:l}),l["s-sr"]&&E.map((e=>{W(e.g,l["s-sn"])&&(i=E.find((e=>e.g===l)),i&&!e.S&&(e.S=i.S))}))):E.some((e=>e.g===l))||E.push({g:l}));1===t.nodeType&&L(t)}},W=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,A=e=>{e.u&&e.u.ref&&e.u.ref(null),e.$&&e.$.map(A)},F=e=>Y(e).j,H=(e,t,l)=>{const n=F(e);return{emit:e=>N(n,t,{bubbles:!!(4&l),composed:!!(2&l),cancelable:!!(1&l),detail:e})}},N=(e,t,l)=>{const n=c.ce(t,l);return e.dispatchEvent(n),n},U=(e,t)=>{t&&!e.v&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.v=t)))},q=(e,t)=>{if(e.t|=16,!(4&e.t))return U(e,e.M),$e((()=>D(e,t)));e.t|=512},D=(e,t)=>{const l=e.O;let n;return t&&(n=G(l,"componentWillLoad")),I(n,(()=>V(e,l,t)))},V=async(e,t,l)=>{const n=e.j,o=n["s-rc"];l&&(e=>{const t=e.C;((e,t)=>{let l=d(t),n=se.get(l);if(e=11===e.nodeType?e:r,n)if("string"==typeof n){let t,o=$.get(e=e.head||e);o||$.set(e,o=new Set),o.has(l)||(t=r.createElement("style"),t.innerHTML=n,e.insertBefore(t,e.querySelector("link")),o&&o.add(l))}else e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n])})(e.j.getRootNode(),t)})(e);_(e,t),o&&(o.map((e=>e())),n["s-rc"]=void 0);{const t=n["s-p"],l=()=>z(e);0===t.length?l():(Promise.all(t).then(l),e.t|=4,t.length=0)}},_=(s,i)=>{try{i=i.render(),s.t&=-17,s.t|=2,((s,i)=>{const f=s.j,a=s.C,u=s.R||m(null,null),$=(e=>e&&e.m===b)(i)?i:p(null,null,i);if(t=f.tagName,a.P&&($.u=$.u||{},a.P.map((([e,t])=>$.u[t]=f[e]))),$.m=null,$.t|=4,s.R=$,$.k=u.k=f,e=f["s-cr"],l=0!=(1&a.t),n=!1,P(u,$),c.t|=1,o){let e,t,l,n,o,s;L($.k);let i=0;for(;i<E.length;i++)e=E[i],t=e.g,t["s-ol"]||(l=r.createTextNode(""),l["s-nr"]=t,t.parentNode.insertBefore(t["s-ol"]=l,t));for(i=0;i<E.length;i++)if(e=E[i],t=e.g,e.S){for(n=e.S.parentNode,o=e.S.nextSibling,l=t["s-ol"];l=l.previousSibling;)if(s=l["s-nr"],s&&s["s-sn"]===t["s-sn"]&&n===s.parentNode&&(s=s.nextSibling,!s||!s["s-nr"])){o=s;break}(!o&&n!==t.parentNode||t.nextSibling!==o)&&t!==o&&(!t["s-hn"]&&t["s-ol"]&&(t["s-hn"]=t["s-ol"].parentNode.nodeName),n.insertBefore(t,o))}else 1===t.nodeType&&(t.hidden=!0)}n&&T($.k),c.t&=-2,E.length=0})(s,i)}catch(e){le(e,s.j)}return null},z=e=>{const t=e.j,l=e.M;G(e.O,"componentDidRender"),64&e.t||(e.t|=64,J(t),e.T(t),l||B()),e.L(t),e.v&&(e.v(),e.v=void 0),512&e.t&&ue((()=>q(e,!1))),e.t&=-517},B=()=>{J(r.documentElement),ue((()=>N(i,"appload",{detail:{namespace:"twilight-components"}})))},G=(e,t,l)=>{if(e&&e[t])try{return e[t](l)}catch(e){le(e)}},I=(e,t)=>e&&e.then?e.then(t):t(),J=e=>e.classList.add("hydrated"),K=(e,t,l)=>{if(t.W){e.watchers&&(t.A=e.watchers);const n=Object.entries(t.W),o=e.prototype;if(n.map((([e,[n]])=>{31&n||2&l&&32&n?Object.defineProperty(o,e,{get(){return((e,t)=>Y(this).F.get(t))(0,e)},set(l){((e,t,l,n)=>{const o=Y(e),s=o.j,i=o.F.get(t),r=o.t,c=o.O;if(l=((e,t)=>null==e||h(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(l,n.W[t][0]),!(8&r&&void 0!==i||l===i)&&(o.F.set(t,l),c)){if(n.A&&128&r){const e=n.A[t];e&&e.map((e=>{try{c[e](l,i,t)}catch(e){le(e,s)}}))}2==(18&r)&&q(o,!1)}})(this,e,l,t)},configurable:!0,enumerable:!0}):1&l&&64&n&&Object.defineProperty(o,e,{value(...t){const l=Y(this);return l.H.then((()=>l.O[e](...t)))}})})),1&l){const l=new Map;o.attributeChangedCallback=function(e,t,n){c.jmp((()=>{const t=l.get(e);this.hasOwnProperty(t)&&(n=this[t],delete this[t]),this[t]=(null!==n||"boolean"!=typeof this[t])&&n}))},e.observedAttributes=n.filter((([e,t])=>15&t[0])).map((([e,n])=>{const o=n[1]||e;return l.set(o,e),512&n[0]&&t.P.push([e,o]),o}))}}return e},Q=(e,t={})=>{const l=[],n=t.exclude||[],o=i.customElements,s=r.head,f=s.querySelector("meta[charset]"),u=r.createElement("style"),$=[];let y,h=!0;Object.assign(c,t),c.l=new URL(t.resourcesUrl||"./",r.baseURI).href,e.map((e=>e[1].map((t=>{const s={t:t[0],o:t[1],W:t[2],N:t[3]};s.W=t[2],s.P=[],s.A={};const i=s.o,f=class extends HTMLElement{constructor(e){super(e),ee(e=this,s)}connectedCallback(){y&&(clearTimeout(y),y=null),h?$.push(this):c.jmp((()=>(e=>{if(0==(1&c.t)){const t=Y(e),l=t.C,n=()=>{};if(!(1&t.t)){t.t|=1,12&l.t&&(e=>{const t=e["s-cr"]=r.createComment("");t["s-cn"]=!0,e.insertBefore(t,e.firstChild)})(e);{let l=e;for(;l=l.parentNode||l.host;)if(l["s-p"]){U(t,t.M=l);break}}l.W&&Object.entries(l.W).map((([t,[l]])=>{if(31&l&&e.hasOwnProperty(t)){const l=e[t];delete e[t],e[t]=l}})),(async(e,t,l,n,o)=>{if(0==(32&t.t)){{if(t.t|=32,(o=oe(l)).then){const e=()=>{};o=await o,e()}o.isProxied||(l.A=o.watchers,K(o,l,2),o.isProxied=!0);const e=()=>{};t.t|=8;try{new o(t)}catch(e){le(e)}t.t&=-9,t.t|=128,e()}if(o.style){let e=o.style;const t=d(l);if(!se.has(t)){const n=()=>{};((e,t,l)=>{let n=se.get(e);a&&l?(n=n||new CSSStyleSheet,n.replace(t)):n=t,se.set(e,n)})(t,e,!!(1&l.t)),n()}}}const s=t.M,i=()=>q(t,!0);s&&s["s-rc"]?s["s-rc"].push(i):i()})(0,t,l)}n()}})(this)))}disconnectedCallback(){c.jmp((()=>{}))}componentOnReady(){return Y(this).U}};s.q=e[0],n.includes(i)||o.get(i)||(l.push(i),o.define(i,K(f,s,1)))})))),u.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",u.setAttribute("data-styles",""),s.insertBefore(u,f?f.nextSibling:s.firstChild),h=!1,$.length?$.map((e=>e.connectedCallback())):c.jmp((()=>y=setTimeout(B,30)))},X=new WeakMap,Y=e=>X.get(e),Z=(e,t)=>X.set(t.O=e,t),ee=(e,t)=>{const l={t:0,j:e,C:t,F:new Map};return l.H=new Promise((e=>l.L=e)),l.U=new Promise((e=>l.T=e)),e["s-p"]=[],e["s-rc"]=[],X.set(e,l)},te=(e,t)=>t in e,le=(e,t)=>(0,console.error)(e,t),ne=new Map,oe=e=>{const t=e.o.replace(/-/g,"_"),l=e.q,n=ne.get(l);return n?n[t]:import(`./${l}.entry.js`).then((e=>(ne.set(l,e),e[t])),le)},se=new Map,ie=[],re=[],ce=(e,t)=>l=>{e.push(l),s||(s=!0,t&&4&c.t?ue(ae):c.raf(ae))},fe=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){le(e)}e.length=0},ae=()=>{fe(ie),fe(re),(s=ie.length>0)&&c.raf(ae)},ue=e=>f().then(e),$e=ce(re,!0);export{b as H,Q as b,H as c,F as g,p as h,f as p,Z as r}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,h as t,g as i,c as e,H as a}from"./p-d1ef2268.js";import{H as l}from"./p-9bc28e0c.js";export{S as salla_login}from"./p-36c87e2e.js";let o=require("store/src/store-engine"),h=require("store/storages/sessionStorage"),r=o.createStore(h);const n=class{constructor(t){s(this,t),this.open=!1,this.isOpenedBefore=r.get("multi-warehouse-opened-before"),this.displayAs="default",this.browseProductsFrom="all",this.branches=[{id:1,name:"فرع الرياض",open:!0,available:!0,limited:!1,tag:"متوفر"},{id:2,name:"فرع جدة",open:!1,available:!1,limited:!1,tag:"غير متوفر"},{id:3,name:"فرع مكة",open:!0,available:!0,limited:!1,tag:"متوفر"},{id:4,name:"فرع المدينة",open:!0,available:!0,limited:!1,tag:"متوفر"},{id:5,name:"فرع جازان",open:!0,available:!0,limited:!0,tag:"الكمية محدودة"}],this.current=1,this.currentBranch=s=>this.branches.filter((s=>s.id==this.current))[0][s],this.statusColor=(s=null)=>s?s.limited?"text-red-400":s.available?"text-green-500":"text-gray-400":this.currentBranch("limited")?"text-red-400":this.currentBranch("available")?"text-green-500":"text-gray-400",this.isChoiceable=()=>"all"!==this.browseProductsFrom&&"single"==this.position||"header"==this.position,this.formTitle=()=>this.isChoiceable()?"توفر المنتج في الفروع الآخرى":"التسوق من فرع آخر",salla.event.on("branches::show",(()=>this.show()))}async show(){return this.modal.show()}async hide(){return this.modal.hide()}handelChange(s){this.selected=s.target.value}handleSubmit(){this.btn.load().then((()=>{setTimeout((()=>location.reload()),2e3)})),r.set("multi-warehouse-opened-before",!0),this.show(),setTimeout((()=>{this.current=this.selected}),300)}render(){return t("salla-modal",{icon:"sicon-store-alt",title:"فرع الرياض","sub-title":"أنت الآن تتصفح المتجر من","is-closable":this.isOpenedBefore||"popup"!=this.displayAs?"true":"false",ref:s=>this.modal=s,"modal-width":"w-116",id:"s-multi-warehouse-modal",class:"hidden"},t("div",{class:"text-right"},t("fieldset",{class:"mt-4"},t("h4",{class:"text-sm text-gray-600 mb-6"},this.formTitle()),t("legend",{class:"sr-only"},this.formTitle()),this.branches.length<=5?t("div",{class:"space-y-5"},this.branches.map((s=>t("div",{class:"flex items-center"},t("input",{id:this.position+"_branch_"+s.id,disabled:!s.open&&this.isChoiceable(),name:"lang",type:"radio",value:s.id,onChange:s=>this.handelChange(s),class:{"me-3 focus:ring-primary h-4 w-4 text-primary border-gray-300":!0,"opacity-50":!s.open,hidden:!this.isChoiceable()},checked:this.current==s.id}),t("label",{htmlFor:this.position+"_branch_"+s.id,class:{"flex items-center justify-between text-sm font-medium text-gray-700 flex-grow":!0,"cursor-pointer":this.isChoiceable()}},t("span",{class:{"opacity-50":!s.open}},s.name),this.isChoiceable()?t("small",{class:"text-red-400"},s.open?"":"مُغلق"):t("span",{class:this.statusColor(s)},s.tag)))))):t("select",{class:"w-full h-10 transition-colors duration-300 focus:ring-transparent focus:border-primary sm:text-sm border-gray-200 rounded-md appearance-none visibility_condition px-4",onInput:s=>this.handelChange(s)},this.branches.map((s=>t("option",{value:s.id,disabled:!s.open,selected:this.selected==s.id},s.name," ",s.open?"":"- مُغلق")))))),this.isChoiceable()?t("div",{slot:"footer",class:"mt-6"},t("slot",{name:"footer"},t("salla-button",{"loader-position":"before",ref:s=>this.btn=s,onClick:()=>this.handleSubmit(),class:"w-full"},salla.lang.get("common.elements.ok")))):"")}componentDidRender(){this.isOpenedBefore||"popup"!=this.displayAs||this.show()}get host(){return i(this)}};n.style="#s-multi-warehouse-modal .s-modal-header{display:flex;flex-direction:column;margin-bottom:40px}#s-multi-warehouse-modal .s-modal-sub-title{margin:0}#s-multi-warehouse-modal .s-modal-title{order:10}";const d=class{constructor(t){s(this,t),this.btnStyle="primary",this.loading=!1,this.disabled=!1,this.loaderPosition="before",this.hostAttributes={};for(let s=0;s<this.host.attributes.length;s++)this.hostAttributes[this.host.attributes[s].name]=this.host.attributes[s].value;this.hostAttributes.type=this.hostAttributes.type||"button",this.hostAttributes.class=(this.hostAttributes.class||"")+" s-button-btn btn--has-loading btn-"+this.btnStyle+" loader-"+this.loaderPosition,this.hostAttributes.class+="before"==this.loaderPosition?" flex-row-reverse":"",delete this.hostAttributes["btn-style"],delete this.hostAttributes.id}async load(){return"center"==this.loaderPosition&&this.host.querySelector(".btn-text").classList.add("opacity-0"),this.host.setAttribute("loading",""),this.host}async stop(){return this.host.removeAttribute("loading"),this.host}async disable(){this.host.setAttribute("disabled","")}async enable(){this.host.removeAttribute("disabled")}handleVisible(s,t){this.btn.classList.remove("btn-"+t),this.btn.classList.add("btn-"+s)}handleLoading(s){l.toggleElement(this.btn,"btn--is-loading","btn--no-loading",(()=>s))}render(){return t("button",Object.assign({ref:s=>this.btn=s,disabled:this.disabled},this.hostAttributes),t("span",{class:"btn-text transition-opacity duration-300"},t("slot",null)),this.loading?t("span",{class:{"loader loader--small s-button-loader":!0,"absolute right-2":"start"===this.loaderPosition,"absolute left-2":"end"===this.loaderPosition,"absolute top-1/2 left-1/2 !-translate-x-1/2 !-translate-y-1/2 !m-0":"center"===this.loaderPosition}}):"")}get host(){return i(this)}static get watchers(){return{btnStyle:["handleVisible"],loading:["handleLoading"]}}};d.style=":host{display:block}";const c=class{constructor(t){s(this,t),this.ready=e(this,"ready",7),this.close=e(this,"close",7),this.error=!1,this.success=!1,this.isClosable=!0,this.modalWidth="w-96",this.visible=!1,this.subTitle="",this.icon="",salla.event.on("modal::open",(s=>s.dataset.target==this.host.id&&this.show())),salla.event.on("modal::close",(s=>s.dataset.target==this.host.id&&this.hide())),this.title=this.host.title,this.host.removeAttribute("title")}handleVisible(s){if(!s)return this.toggleModal(!1),void this.close.emit();this.host.classList.remove("hidden"),setTimeout((()=>this.toggleModal(!0))),this.ready.emit()}async show(){return this.host.setAttribute("visible",""),this.host}async hide(){return this.host.removeAttribute("visible"),this.host}async setTitle(s){return this.title=s,this.host}toggleModal(s){l.toggleElement(this.host.querySelector(".s-modal-overlay"),"ease-out duration-300 opacity-100","opacity-0",(()=>s)).toggleElement(this.host.querySelector(".s-modal-body"),"ease-out duration-300 opacity-100 translate-y-0 sm:scale-100","opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",(()=>s)).toggleElement(document.body,"modal-is-open","modal-is-closed",(()=>s)),s||setTimeout((()=>this.host.classList.add("hidden")),350)}closeModal(){this.isClosable&&this.host.removeAttribute("visible")}render(){return this.host.id=this.host.id||"salla-modal",t(a,{class:"s-modal-container hidden","aria-modal":"true",role:"dialog"},t("div",{class:"s-modal-wrapper"},t("div",{class:"s-modal-overlay",onClick:()=>this.closeModal()}),t("span",{class:"s-modal-spacer"},""),t("div",{class:"s-modal-body "+this.modalWidth},t("div",{class:{"s-modal-header":!0,"text-center":""!=this.icon}},this.isClosable?t("button",{class:"s-modal-close cursor-pointer",onClick:()=>this.closeModal(),type:"button"},t("span",{class:"sicon-cancel"})):"",this.error||this.success||this.icon?t("div",{class:{"s-modal-icon":!0,"s-modal-bg-error":this.error,"s-modal-bg-success":this.success,"s-modal-bg-normal":!this.error&&!this.success}},t("i",{class:{[this.icon]:!0,"s-modal-text-error":this.error,"s-modal-text-success":this.success}})):"",t("div",{class:"s-modal-title",innerHTML:this.title}),t("p",{class:"s-modal-sub-title",innerHTML:this.subTitle})),t("slot",null),t("slot",{name:"footer"}))))}get host(){return i(this)}static get watchers(){return{visible:["handleVisible"]}}};export{n as multi_warehouse,d as salla_button,c as salla_modal}
|