New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

webflow-contact-form

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webflow-contact-form - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

index.html

2

dist/main.bundle.js
/*! For license information please see main.bundle.js.LICENSE.txt */
(()=>{"use strict";var t=function(r,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)r.hasOwnProperty(n)&&(t[n]=r[n])},t(r,n)};function r(r,n){function e(){this.constructor=r}t(r,n),r.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}function n(t){return t&&"function"==typeof t.schedule}var e=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}();function o(t){return"function"==typeof t}var i=!1,u={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;i=t},get useDeprecatedSynchronousErrorHandling(){return i}};function s(t){setTimeout((function(){throw t}),0)}var c={closed:!0,next:function(t){},error:function(t){if(u.useDeprecatedSynchronousErrorHandling)throw t;s(t)},complete:function(){}};function a(t){return null!==t&&"object"==typeof t}var f=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,r){return r+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}(),p=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var r;if(!this.closed){var n=this,i=n._parentOrParents,u=n._ctorUnsubscribe,s=n._unsubscribe,c=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,i instanceof t)i.remove(this);else if(null!==i)for(var p=0;p<i.length;++p){i[p].remove(this)}if(o(s)){u&&(this._unsubscribe=void 0);try{s.call(this)}catch(t){r=t instanceof f?l(t.errors):[t]}}if(e(c)){p=-1;for(var h=c.length;++p<h;){var b=c[p];if(a(b))try{b.unsubscribe()}catch(t){r=r||[],t instanceof f?r=r.concat(l(t.errors)):r.push(t)}}}if(r)throw new f(r)}},t.prototype.add=function(r){var n=r;if(!r)return t.EMPTY;switch(typeof r){case"function":n=new t(r);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){var e=n;(n=new t)._subscriptions=[e]}break;default:throw new Error("unrecognized teardown "+r+" added to Subscription.")}var o=n._parentOrParents;if(null===o)n._parentOrParents=this;else if(o instanceof t){if(o===this)return n;n._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return n;o.push(this)}var i=this._subscriptions;return null===i?this._subscriptions=[n]:i.push(n),n},t.prototype.remove=function(t){var r=this._subscriptions;if(r){var n=r.indexOf(t);-1!==n&&r.splice(n,1)}},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}();function l(t){return t.reduce((function(t,r){return t.concat(r instanceof f?r.errors:r)}),[])}var h=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),b=function(t){function n(r,e,o){var i=t.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=c;break;case 1:if(!r){i.destination=c;break}if("object"==typeof r){r instanceof n?(i.syncErrorThrowable=r.syncErrorThrowable,i.destination=r,r.add(i)):(i.syncErrorThrowable=!0,i.destination=new d(i,r));break}default:i.syncErrorThrowable=!0,i.destination=new d(i,r,e,o)}return i}return r(n,t),n.prototype[h]=function(){return this},n.create=function(t,r,e){var o=new n(t,r,e);return o.syncErrorThrowable=!1,o},n.prototype.next=function(t){this.isStopped||this._next(t)},n.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},n.prototype._next=function(t){this.destination.next(t)},n.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},n.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},n.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},n}(p),d=function(t){function n(r,n,e,i){var u,s=t.call(this)||this;s._parentSubscriber=r;var a=s;return o(n)?u=n:n&&(u=n.next,e=n.error,i=n.complete,n!==c&&(o((a=Object.create(n)).unsubscribe)&&s.add(a.unsubscribe.bind(a)),a.unsubscribe=s.unsubscribe.bind(s))),s._context=a,s._next=u,s._error=e,s._complete=i,s}return r(n,t),n.prototype.next=function(t){if(!this.isStopped&&this._next){var r=this._parentSubscriber;u.useDeprecatedSynchronousErrorHandling&&r.syncErrorThrowable?this.__tryOrSetError(r,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},n.prototype.error=function(t){if(!this.isStopped){var r=this._parentSubscriber,n=u.useDeprecatedSynchronousErrorHandling;if(this._error)n&&r.syncErrorThrowable?(this.__tryOrSetError(r,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(r.syncErrorThrowable)n?(r.syncErrorValue=t,r.syncErrorThrown=!0):s(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;s(t)}}},n.prototype.complete=function(){var t=this;if(!this.isStopped){var r=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};u.useDeprecatedSynchronousErrorHandling&&r.syncErrorThrowable?(this.__tryOrSetError(r,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},n.prototype.__tryOrUnsub=function(t,r){try{t.call(this._context,r)}catch(t){if(this.unsubscribe(),u.useDeprecatedSynchronousErrorHandling)throw t;s(t)}},n.prototype.__tryOrSetError=function(t,r,n){if(!u.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{r.call(this._context,n)}catch(r){return u.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=r,t.syncErrorThrown=!0,!0):(s(r),!0)}return!1},n.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},n}(b),y=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.notifyNext=function(t,r,n,e,o){this.destination.next(r)},n.prototype.notifyError=function(t,r){this.destination.error(t)},n.prototype.notifyComplete=function(t){this.destination.complete()},n}(b),v=function(t){function n(r,n,e){var o=t.call(this)||this;return o.parent=r,o.outerValue=n,o.outerIndex=e,o.index=0,o}return r(n,t),n.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},n.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},n.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},n}(b),m=function(t){return function(r){for(var n=0,e=t.length;n<e&&!r.closed;n++)r.next(t[n]);r.complete()}};function _(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var w=_(),S=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}(),x=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function g(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}var E=function(t){if(t&&"function"==typeof t[S])return e=t,function(t){var r=e[S]();if("function"!=typeof r.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return r.subscribe(t)};if(x(t))return m(t);if(g(t))return n=t,function(t){return n.then((function(r){t.closed||(t.next(r),t.complete())}),(function(r){return t.error(r)})).then(null,s),t};if(t&&"function"==typeof t[w])return r=t,function(t){for(var n=r[w]();;){var e=void 0;try{e=n.next()}catch(r){return t.error(r),t}if(e.done){t.complete();break}if(t.next(e.value),t.closed)break}return"function"==typeof n.return&&t.add((function(){n.return&&n.return()})),t};var r,n,e,o=a(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+o+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function O(t){return t}function A(t){return 0===t.length?O:1===t.length?t[0]:function(r){return t.reduce((function(t,r){return r(t)}),r)}}var T=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(r){var n=new t;return n.source=this,n.operator=r,n},t.prototype.subscribe=function(t,r,n){var e=this.operator,o=function(t,r,n){if(t){if(t instanceof b)return t;if(t[h])return t[h]()}return t||r||n?new b(t,r,n):new b(c)}(t,r,n);if(e?o.add(e.call(o,this.source)):o.add(this.source||u.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),u.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){u.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=r),!function(t){for(;t;){var r=t,n=r.closed,e=r.destination,o=r.isStopped;if(n||o)return!1;t=e&&e instanceof b?e:null}return!0}(t)?console.warn(r):t.error(r)}},t.prototype.forEach=function(t,r){var n=this;return new(r=j(r))((function(r,e){var o;o=n.subscribe((function(r){try{t(r)}catch(t){e(t),o&&o.unsubscribe()}}),e,r)}))},t.prototype._subscribe=function(t){var r=this.source;return r&&r.subscribe(t)},t.prototype[S]=function(){return this},t.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return 0===t.length?this:A(t)(this)},t.prototype.toPromise=function(t){var r=this;return new(t=j(t))((function(t,n){var e;r.subscribe((function(t){return e=t}),(function(t){return n(t)}),(function(){return t(e)}))}))},t.create=function(r){return new t(r)},t}();function j(t){if(t||(t=u.Promise||Promise),!t)throw new Error("no Promise impl found");return t}function I(t,r,n,e,o){if(void 0===o&&(o=new v(t,n,e)),!o.closed)return r instanceof T?r.subscribe(o):E(r)(o)}function N(t,r){return new T((function(n){var e=new p,o=0;return e.add(r.schedule((function(){o!==t.length?(n.next(t[o++]),n.closed||e.add(this.schedule())):n.complete()}))),e}))}function P(t,r){return r?N(t,r):new T(m(t))}var C={};function k(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var o=void 0,i=void 0;return n(t[t.length-1])&&(i=t.pop()),"function"==typeof t[t.length-1]&&(o=t.pop()),1===t.length&&e(t[0])&&(t=t[0]),P(t,i).lift(new D(o))}var D=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,r){return r.subscribe(new q(t,this.resultSelector))},t}(),q=function(t){function n(r,n){var e=t.call(this,r)||this;return e.resultSelector=n,e.active=0,e.values=[],e.observables=[],e}return r(n,t),n.prototype._next=function(t){this.values.push(C),this.observables.push(t)},n.prototype._complete=function(){var t=this.observables,r=t.length;if(0===r)this.destination.complete();else{this.active=r,this.toRespond=r;for(var n=0;n<r;n++){var e=t[n];this.add(I(this,e,void 0,n))}}},n.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},n.prototype.notifyNext=function(t,r,n){var e=this.values,o=e[n],i=this.toRespond?o===C?--this.toRespond:this.toRespond:0;e[n]=r,0===i&&(this.resultSelector?this._tryResultSelector(e):this.destination.next(e.slice()))},n.prototype._tryResultSelector=function(t){var r;try{r=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(r)},n}(y);function H(t,r){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new V(t,r))}}var V=function(){function t(t,r){this.project=t,this.thisArg=r}return t.prototype.call=function(t,r){return r.subscribe(new Y(t,this.project,this.thisArg))},t}(),Y=function(t){function n(r,n,e){var o=t.call(this,r)||this;return o.project=n,o.count=0,o.thisArg=e||o,o}return r(n,t),n.prototype._next=function(t){var r;try{r=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(r)},n}(b);function L(t,r,n,i){return o(n)&&(i=n,n=void 0),i?L(t,r,n).pipe(H((function(t){return e(t)?i.apply(void 0,t):i(t)}))):new T((function(e){U(t,r,(function(t){arguments.length>1?e.next(Array.prototype.slice.call(arguments)):e.next(t)}),e,n)}))}function U(t,r,n,e,o){var i;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){var u=t;t.addEventListener(r,n,o),i=function(){return u.removeEventListener(r,n,o)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){var s=t;t.on(r,n),i=function(){return s.off(r,n)}}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t)){var c=t;t.addListener(r,n),i=function(){return c.removeListener(r,n)}}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(var a=0,f=t.length;a<f;a++)U(t[a],r,n,e,o)}e.add(i)}var M=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}(),R=function(t){function n(r,n){var e=t.call(this)||this;return e.subject=r,e.subscriber=n,e.closed=!1,e}return r(n,t),n.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,r=t.observers;if(this.subject=null,r&&0!==r.length&&!t.isStopped&&!t.closed){var n=r.indexOf(this.subscriber);-1!==n&&r.splice(n,1)}}},n}(p),F=function(t){function n(r){var n=t.call(this,r)||this;return n.destination=r,n}return r(n,t),n}(b),W=function(t){function n(){var r=t.call(this)||this;return r.observers=[],r.closed=!1,r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return r(n,t),n.prototype[h]=function(){return new F(this)},n.prototype.lift=function(t){var r=new z(this,this);return r.operator=t,r},n.prototype.next=function(t){if(this.closed)throw new M;if(!this.isStopped)for(var r=this.observers,n=r.length,e=r.slice(),o=0;o<n;o++)e[o].next(t)},n.prototype.error=function(t){if(this.closed)throw new M;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var r=this.observers,n=r.length,e=r.slice(),o=0;o<n;o++)e[o].error(t);this.observers.length=0},n.prototype.complete=function(){if(this.closed)throw new M;this.isStopped=!0;for(var t=this.observers,r=t.length,n=t.slice(),e=0;e<r;e++)n[e].complete();this.observers.length=0},n.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},n.prototype._trySubscribe=function(r){if(this.closed)throw new M;return t.prototype._trySubscribe.call(this,r)},n.prototype._subscribe=function(t){if(this.closed)throw new M;return this.hasError?(t.error(this.thrownError),p.EMPTY):this.isStopped?(t.complete(),p.EMPTY):(this.observers.push(t),new R(this,t))},n.prototype.asObservable=function(){var t=new T;return t.source=this,t},n.create=function(t,r){return new z(t,r)},n}(T),z=function(t){function n(r,n){var e=t.call(this)||this;return e.destination=r,e.source=n,e}return r(n,t),n.prototype.next=function(t){var r=this.destination;r&&r.next&&r.next(t)},n.prototype.error=function(t){var r=this.destination;r&&r.error&&this.destination.error(t)},n.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},n.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):p.EMPTY},n}(W);function $(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var e=t[t.length-1];return n(e)?(t.pop(),N(t,e)):P(t)}function B(t,r){if(null!=t){if(function(t){return t&&"function"==typeof t[S]}(t))return function(t,r){return new T((function(n){var e=new p;return e.add(r.schedule((function(){var o=t[S]();e.add(o.subscribe({next:function(t){e.add(r.schedule((function(){return n.next(t)})))},error:function(t){e.add(r.schedule((function(){return n.error(t)})))},complete:function(){e.add(r.schedule((function(){return n.complete()})))}}))}))),e}))}(t,r);if(g(t))return function(t,r){return new T((function(n){var e=new p;return e.add(r.schedule((function(){return t.then((function(t){e.add(r.schedule((function(){n.next(t),e.add(r.schedule((function(){return n.complete()})))})))}),(function(t){e.add(r.schedule((function(){return n.error(t)})))}))}))),e}))}(t,r);if(x(t))return N(t,r);if(function(t){return t&&"function"==typeof t[w]}(t)||"string"==typeof t)return function(t,r){if(!t)throw new Error("Iterable cannot be null");return new T((function(n){var e,o=new p;return o.add((function(){e&&"function"==typeof e.return&&e.return()})),o.add(r.schedule((function(){e=t[w](),o.add(r.schedule((function(){if(!n.closed){var t,r;try{var o=e.next();t=o.value,r=o.done}catch(t){return void n.error(t)}r?n.complete():(n.next(t),this.schedule())}})))}))),o}))}(t,r)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}function G(t,r){return r?B(t,r):t instanceof T?t:new T(E(t))}var J=function(t){function n(r){var n=t.call(this)||this;return n.parent=r,n}return r(n,t),n.prototype._next=function(t){this.parent.notifyNext(t)},n.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},n.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},n}(b),K=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.notifyNext=function(t){this.destination.next(t)},n.prototype.notifyError=function(t){this.destination.error(t)},n.prototype.notifyComplete=function(){this.destination.complete()},n}(b);function Q(t,r){if(!r.closed){if(t instanceof T)return t.subscribe(r);var n;try{n=E(t)(r)}catch(t){r.error(t)}return n}}function X(t,r,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof r?function(e){return e.pipe(X((function(n,e){return G(t(n,e)).pipe(H((function(t,o){return r(n,t,e,o)})))}),n))}:("number"==typeof r&&(n=r),function(r){return r.lift(new Z(t,n))})}var Z=function(){function t(t,r){void 0===r&&(r=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=r}return t.prototype.call=function(t,r){return r.subscribe(new tt(t,this.project,this.concurrent))},t}(),tt=function(t){function n(r,n,e){void 0===e&&(e=Number.POSITIVE_INFINITY);var o=t.call(this,r)||this;return o.project=n,o.concurrent=e,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return r(n,t),n.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},n.prototype._tryNext=function(t){var r,n=this.index++;try{r=this.project(t,n)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(r)},n.prototype._innerSub=function(t){var r=new J(this),n=this.destination;n.add(r);var e=Q(t,r);e!==r&&n.add(e)},n.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},n.prototype.notifyNext=function(t){this.destination.next(t)},n.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},n}(K);function rt(){return void 0===(t=1)&&(t=Number.POSITIVE_INFINITY),X(O,t);var t}function nt(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return rt()($.apply(void 0,t))}function et(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var e=t[t.length-1];return n(e)?(t.pop(),function(r){return nt(t,r,e)}):function(r){return nt(t,r)}}function ot(){}function it(t,r,n){return function(e){return e.lift(new ut(t,r,n))}}var ut=function(){function t(t,r,n){this.nextOrObserver=t,this.error=r,this.complete=n}return t.prototype.call=function(t,r){return r.subscribe(new st(t,this.nextOrObserver,this.error,this.complete))},t}(),st=function(t){function n(r,n,e,i){var u=t.call(this,r)||this;return u._tapNext=ot,u._tapError=ot,u._tapComplete=ot,u._tapError=e||ot,u._tapComplete=i||ot,o(n)?(u._context=u,u._tapNext=n):n&&(u._context=n,u._tapNext=n.next||ot,u._tapError=n.error||ot,u._tapComplete=n.complete||ot),u}return r(n,t),n.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},n.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},n.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},n}(b);function ct(t,r){return"function"==typeof r?function(n){return n.pipe(ct((function(n,e){return G(t(n,e)).pipe(H((function(t,o){return r(n,t,e,o)})))})))}:function(r){return r.lift(new at(t))}}var at=function(){function t(t){this.project=t}return t.prototype.call=function(t,r){return r.subscribe(new ft(t,this.project))},t}(),ft=function(t){function n(r,n){var e=t.call(this,r)||this;return e.project=n,e.index=0,e}return r(n,t),n.prototype._next=function(t){var r,n=this.index++;try{r=this.project(t,n)}catch(t){return void this.destination.error(t)}this._innerSub(r)},n.prototype._innerSub=function(t){var r=this.innerSubscription;r&&r.unsubscribe();var n=new J(this),e=this.destination;e.add(n),this.innerSubscription=Q(t,n),this.innerSubscription!==n&&e.add(this.innerSubscription)},n.prototype._complete=function(){var r=this.innerSubscription;r&&!r.closed||t.prototype._complete.call(this),this.unsubscribe()},n.prototype._unsubscribe=function(){this.innerSubscription=void 0},n.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&t.prototype._complete.call(this)},n.prototype.notifyNext=function(t){this.destination.next(t)},n}(K),pt=160,lt=190,ht=218.75,bt=190,dt=218.75,yt=241.25,vt=190,mt=218.75,_t=241.25,wt=145;function St(t,r){(null==r||r>t.length)&&(r=t.length);for(var n=0,e=new Array(r);n<r;n++)e[n]=t[n];return e}function xt(t){return function(t){if(Array.isArray(t))return St(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,r){if(!t)return;if("string"==typeof t)return St(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return St(t,r)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gt(t,r){(null==r||r>t.length)&&(r=t.length);for(var n=0,e=new Array(r);n<r;n++)e[n]=t[n];return e}function Et(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function Ot(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},e=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),e.forEach((function(r){Et(t,r,n[r])}))}return t}function At(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var e,o,i=[],u=!0,s=!1;try{for(n=n.call(t);!(u=(e=n.next()).done)&&(i.push(e.value),!r||i.length!==r);u=!0);}catch(t){s=!0,o=t}finally{try{u||null==n.return||n.return()}finally{if(s)throw o}}return i}}(t,r)||function(t,r){if(!t)return;if("string"==typeof t)return gt(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gt(t,r)}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Tt=function(t,r){var n,e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){for(var o=arguments.length,i=new Array(o),u=0;u<o;u++)i[u]=arguments[u];!n&&e&&t.apply(void 0,xt(i)),clearTimeout(n),n=setTimeout((function(){return t.apply(void 0,xt(i))}),r)}}((function(t){var r="".concat(t.toFixed(2)," zł");t>=2500&&(r="Prosimy o kontakt"),document.querySelector("#price").textContent=r}),500);setTimeout((function(){var t=function(t){var r,n=t.querySelector("select"),e=t.querySelectorAll("input"),o={Wysoko:"wysokosc",Waga:"waga",Ilo:"ilosc"},i=k(Array.from(e).map((function(t){return L(t,"input").pipe(et(0),H((function(){return null!==(r=t.valueAsNumber)&&void 0!==r?r:0})),H((function(t){return Number.isNaN(t)?0:t})),H((function(r){return Et({},function(t){var r=t.getAttribute("data-name");return Object.entries(o).reduce((function(t,n){var e=At(n,2),o=e[0],i=e[1];return(null==r?void 0:r.startsWith(o))?i:t}),"")}(t),r)})))}))).pipe(H((function(t){return t.reduce((function(t,r){return Ot({},t,r)}),{})})));return k([i,L(n,"change").pipe(et(n.selectedIndex),H((function(){return n.selectedIndex})),H((function(t){return{typ:t}})))])},r=new W,n=document.querySelector(".data-input.insurance"),e=L(document.querySelector(".data-input.insurance"),"input").pipe(H((function(){return n.value})),it((function(t){return console.log("insurance",t)})),et(0));k([r,e]).pipe(ct((function(){var r=document.querySelectorAll("#srow");return k(Array.from(r).map((function(r){return t(r)})))})),H((function(t){return t.map((function(t){return t.reduce((function(t,r){return Ot({},t,r)}),{})}))})),H((function(t){return t.map((function(t){var r,e,o,i,u,s,c,a,f,p,l,h,b=t.waga,d=t.ilosc,y=t.typ;return r=y,e=d,o=b,i=Number(n.value),u=0,s=1===r?e:0,c=2===r?e:0,a=3===r?e:0,f=4===r?e:0,p=1===r?o:0,l=3===r?o:0,h=4===r?o:0,r&&e&&o?(s>0&&(p<=400?u+=s*pt:p<=800?u+=s*lt:p<=1e3&&(u+=s*ht)),a>0&&(l<=400?u+=a*bt:l<=800?u+=a*dt:l<=1e3&&(u+=a*yt)),f>0&&(h<=400?u+=f*vt:h<=800?u+=f*mt:h<=1e3&&(u+=f*_t)),c>0&&(2===r?o:0)<=200&&(u+=c*wt),1.1575*(u+(i=(i||0)<3e3?3e3:i)*(.17/100))*1.23):0}))})),H((function(t){return t.reduce((function(t,r){return t+r}),0)})),et(0),it((function(t){return Tt(t)}))).subscribe(),r.next();var o=1;document.querySelector("#btn-duplicate").addEventListener("click",(function(){var t,n,e=document.querySelector('[initial-row="0"]').cloneNode(!0);e.setAttribute("initial-row","".concat(o)),t=e,(n=document.querySelector('[initial-row="'.concat(o-1,'"]'))).parentNode.insertBefore(t,n.nextSibling);var i=++o;e.querySelectorAll("input").forEach((function(t){t.setAttribute("data-name","".concat(t.getAttribute("data-name")," ").concat(i)),t.setAttribute("name","".concat(t.getAttribute("name")," ").concat(i)),t.setAttribute("id","".concat(t.getAttribute("id")," ").concat(i)),t.value=""})),e.querySelectorAll("select").forEach((function(t){t.setAttribute("data-name","".concat(t.getAttribute("data-name")," ").concat(i)),t.setAttribute("name","".concat(t.getAttribute("name")," ").concat(i)),t.setAttribute("id","".concat(t.getAttribute("id")," ").concat(i))}));var u=e.querySelector("#btn-delete");u.style.opacity="1",u.addEventListener("click",(function(){o--,e.remove(),r.next()})),setTimeout((function(){r.next()}),1)}))}),1e3)})();
(()=>{"use strict";var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};function e(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}function n(t){return"function"==typeof t}var r=!1,o={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;r=t},get useDeprecatedSynchronousErrorHandling(){return r}};function i(t){setTimeout((function(){throw t}),0)}var u={closed:!0,next:function(t){},error:function(t){if(o.useDeprecatedSynchronousErrorHandling)throw t;i(t)},complete:function(){}},c=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}();function s(t){return null!==t&&"object"==typeof t}var a=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}(),l=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var e;if(!this.closed){var r=this,o=r._parentOrParents,i=r._ctorUnsubscribe,u=r._unsubscribe,l=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,o instanceof t)o.remove(this);else if(null!==o)for(var p=0;p<o.length;++p){o[p].remove(this)}if(n(u)){i&&(this._unsubscribe=void 0);try{u.call(this)}catch(t){e=t instanceof a?f(t.errors):[t]}}if(c(l)){p=-1;for(var h=l.length;++p<h;){var d=l[p];if(s(d))try{d.unsubscribe()}catch(t){e=e||[],t instanceof a?e=e.concat(f(t.errors)):e.push(t)}}}if(e)throw new a(e)}},t.prototype.add=function(e){var n=e;if(!e)return t.EMPTY;switch(typeof e){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){var r=n;(n=new t)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var o=n._parentOrParents;if(null===o)n._parentOrParents=this;else if(o instanceof t){if(o===this)return n;n._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return n;o.push(this)}var i=this._subscriptions;return null===i?this._subscriptions=[n]:i.push(n),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}();function f(t){return t.reduce((function(t,e){return t.concat(e instanceof a?e.errors:e)}),[])}var p=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),h=function(t){function n(e,r,o){var i=t.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=u;break;case 1:if(!e){i.destination=u;break}if("object"==typeof e){e instanceof n?(i.syncErrorThrowable=e.syncErrorThrowable,i.destination=e,e.add(i)):(i.syncErrorThrowable=!0,i.destination=new d(i,e));break}default:i.syncErrorThrowable=!0,i.destination=new d(i,e,r,o)}return i}return e(n,t),n.prototype[p]=function(){return this},n.create=function(t,e,r){var o=new n(t,e,r);return o.syncErrorThrowable=!1,o},n.prototype.next=function(t){this.isStopped||this._next(t)},n.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},n.prototype._next=function(t){this.destination.next(t)},n.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},n.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},n.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},n}(l),d=function(t){function r(e,r,o,i){var c,s=t.call(this)||this;s._parentSubscriber=e;var a=s;return n(r)?c=r:r&&(c=r.next,o=r.error,i=r.complete,r!==u&&(n((a=Object.create(r)).unsubscribe)&&s.add(a.unsubscribe.bind(a)),a.unsubscribe=s.unsubscribe.bind(s))),s._context=a,s._next=c,s._error=o,s._complete=i,s}return e(r,t),r.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;o.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},r.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=o.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):i(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;i(t)}}},r.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};o.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},r.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),o.useDeprecatedSynchronousErrorHandling)throw t;i(t)}},r.prototype.__tryOrSetError=function(t,e,n){if(!o.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(e){return o.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(i(e),!0)}return!1},r.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},r}(h);function b(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new y(t,e))}}var y=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new v(t,this.project,this.thisArg))},t}(),v=function(t){function n(e,n,r){var o=t.call(this,e)||this;return o.project=n,o.count=0,o.thisArg=r||o,o}return e(n,t),n.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},n}(h),m=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return e(n,t),n.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},n.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),setInterval(t.flush.bind(t,this),n)},n.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return e;clearInterval(e)},n.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},n.prototype._execute=function(t,e){var n=!1,r=void 0;try{this.work(t)}catch(t){n=!0,r=!!t&&t||new Error(t)}if(n)return this.unsubscribe(),r},n.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},n}(function(t){function n(e,n){return t.call(this)||this}return e(n,t),n.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},n}(l)),w=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=function(){return Date.now()},t}(),_=new(function(t){function n(e,r){void 0===r&&(r=w.now);var o=t.call(this,e,(function(){return n.delegate&&n.delegate!==o?n.delegate.now():r()}))||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return e(n,t),n.prototype.schedule=function(e,r,o){return void 0===r&&(r=0),n.delegate&&n.delegate!==this?n.delegate.schedule(e,r,o):t.prototype.schedule.call(this,e,r,o)},n.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},n}(w))(m);var E=function(){function t(t,e){this.dueTime=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new S(t,this.dueTime,this.scheduler))},t}(),S=function(t){function n(e,n,r){var o=t.call(this,e)||this;return o.dueTime=n,o.scheduler=r,o.debouncedSubscription=null,o.lastValue=null,o.hasValue=!1,o}return e(n,t),n.prototype._next=function(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(g,this.dueTime,this))},n.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},n.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var t=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}},n.prototype.clearDebounce=function(){var t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)},n}(h);function g(t){t.debouncedNext()}function A(){}function P(t,e,n){return function(r){return r.lift(new O(t,e,n))}}var O=function(){function t(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}return t.prototype.call=function(t,e){return e.subscribe(new T(t,this.nextOrObserver,this.error,this.complete))},t}(),T=function(t){function r(e,r,o,i){var u=t.call(this,e)||this;return u._tapNext=A,u._tapError=A,u._tapComplete=A,u._tapError=o||A,u._tapComplete=i||A,n(r)?(u._context=u,u._tapNext=r):r&&(u._context=r,u._tapNext=r.next||A,u._tapError=r.error||A,u._tapComplete=r.complete||A),u}return e(r,t),r.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},r.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},r.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},r}(h);var x=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function I(t){return t}function k(t){return 0===t.length?I:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var j=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r=this.operator,i=function(t,e,n){if(t){if(t instanceof h)return t;if(t[p])return t[p]()}return t||e||n?new h(t,e,n):new h(u)}(t,e,n);if(r?i.add(r.call(i,this.source)):i.add(this.source||o.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),o.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){o.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),!function(t){for(;t;){var e=t,n=e.closed,r=e.destination,o=e.isStopped;if(n||o)return!1;t=r&&r instanceof h?r:null}return!0}(t)?console.warn(e):t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=N(e))((function(e,r){var o;o=n.subscribe((function(e){try{t(e)}catch(t){r(t),o&&o.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[x]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:k(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=N(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function N(t){if(t||(t=o.Promise||Promise),!t)throw new Error("no Promise impl found");return t}function C(t){return t&&"function"==typeof t.schedule}var R=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.complete()}};function D(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var L=D(),Y=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function z(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}var W=function(t){if(t&&"function"==typeof t[x])return r=t,function(t){var e=r[x]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(Y(t))return R(t);if(z(t))return n=t,function(t){return n.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,i),t};if(t&&"function"==typeof t[L])return e=t,function(t){for(var n=e[L]();;){var r=void 0;try{r=n.next()}catch(e){return t.error(e),t}if(r.done){t.complete();break}if(t.next(r.value),t.closed)break}return"function"==typeof n.return&&t.add((function(){n.return&&n.return()})),t};var e,n,r,o=s(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+o+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function q(t,e){return new j((function(n){var r=new l,o=0;return r.add(e.schedule((function(){o!==t.length?(n.next(t[o++]),n.closed||r.add(this.schedule())):n.complete()}))),r}))}function F(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[x]}(t))return function(t,e){return new j((function(n){var r=new l;return r.add(e.schedule((function(){var o=t[x]();r.add(o.subscribe({next:function(t){r.add(e.schedule((function(){return n.next(t)})))},error:function(t){r.add(e.schedule((function(){return n.error(t)})))},complete:function(){r.add(e.schedule((function(){return n.complete()})))}}))}))),r}))}(t,e);if(z(t))return function(t,e){return new j((function(n){var r=new l;return r.add(e.schedule((function(){return t.then((function(t){r.add(e.schedule((function(){n.next(t),r.add(e.schedule((function(){return n.complete()})))})))}),(function(t){r.add(e.schedule((function(){return n.error(t)})))}))}))),r}))}(t,e);if(Y(t))return q(t,e);if(function(t){return t&&"function"==typeof t[L]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new j((function(n){var r,o=new l;return o.add((function(){r&&"function"==typeof r.return&&r.return()})),o.add(e.schedule((function(){r=t[L](),o.add(e.schedule((function(){if(!n.closed){var t,e;try{var o=r.next();t=o.value,e=o.done}catch(t){return void n.error(t)}e?n.complete():(n.next(t),this.schedule())}})))}))),o}))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}function V(t,e){return e?F(t,e):t instanceof j?t:new j(W(t))}var M=function(t){function n(e){var n=t.call(this)||this;return n.parent=e,n}return e(n,t),n.prototype._next=function(t){this.parent.notifyNext(t)},n.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},n.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},n}(h),U=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.notifyNext=function(t){this.destination.next(t)},n.prototype.notifyError=function(t){this.destination.error(t)},n.prototype.notifyComplete=function(){this.destination.complete()},n}(h);function Z(t,e){if(!e.closed){if(t instanceof j)return t.subscribe(e);var n;try{n=W(t)(e)}catch(t){e.error(t)}return n}}function $(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?function(r){return r.pipe($((function(n,r){return V(t(n,r)).pipe(b((function(t,o){return e(n,t,r,o)})))}),n))}:("number"==typeof e&&(n=e),function(e){return e.lift(new H(t,n))})}var H=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new Q(t,this.project,this.concurrent))},t}(),Q=function(t){function n(e,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY);var o=t.call(this,e)||this;return o.project=n,o.concurrent=r,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return e(n,t),n.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},n.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e)},n.prototype._innerSub=function(t){var e=new M(this),n=this.destination;n.add(e);var r=Z(t,e);r!==e&&n.add(r)},n.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},n.prototype.notifyNext=function(t){this.destination.next(t)},n.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},n}(U);function B(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),$(I,t)}function K(t,e){return e?q(t,e):new j(R(t))}function G(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Number.POSITIVE_INFINITY,r=null,o=t[t.length-1];return C(o)?(r=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof o&&(n=t.pop()),null===r&&1===t.length&&t[0]instanceof j?t[0]:B(n)(K(t,r))}function J(t,e,r,o){return n(r)&&(o=r,r=void 0),o?J(t,e,r).pipe(b((function(t){return c(t)?o.apply(void 0,t):o(t)}))):new j((function(n){X(t,e,(function(t){arguments.length>1?n.next(Array.prototype.slice.call(arguments)):n.next(t)}),n,r)}))}function X(t,e,n,r,o){var i;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){var u=t;t.addEventListener(e,n,o),i=function(){return u.removeEventListener(e,n,o)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){var c=t;t.on(e,n),i=function(){return c.off(e,n)}}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t)){var s=t;t.addListener(e,n),i=function(){return s.removeListener(e,n)}}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(var a=0,l=t.length;a<l;a++)X(t[a],e,n,r,o)}r.add(i)}function tt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return C(n)?(t.pop(),q(t,n)):K(t)}function et(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return B(1)(tt.apply(void 0,t))}function nt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return C(n)?(t.pop(),function(e){return et(t,e,n)}):function(e){return et(t,e)}}function rt(t,e){if(null==t)throw new Error(e||"Expected variable to be defined, but received ".concat(t))}function ot(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function it(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ut(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}var ct=function(){function t(e,n){var r,o,i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),it(this,"name",void 0),it(this,"selector",void 0),it(this,"element",void 0),it(this,"type",void 0),it(this,"value$",void 0),this.name=e,this.selector=n,this.element=document.querySelector(this.selector),this.type=null!==(o=null===(r=this.element)||void 0===r?void 0:r.getAttribute("type"))&&void 0!==o?o:null,this.value$=(st(this.element)?"number"===this.type?function(t){var e=document.querySelector(t);return rt(e,'Expected "'.concat(t,'" to be defined')),J(e,"input").pipe(nt(0),b((function(){return e.valueAsNumber})))}(this.selector):function(t){var e=document.querySelector(t);return rt(e,'Expected "'.concat(t,'" to be defined')),J(e,"input").pipe(nt(0),b((function(){return e.value})))}(this.selector):function(t){var e=document.querySelector(t);return rt(e,'Expected "'.concat(t,'" to be defined')),J(e,"change").pipe(nt(0),b((function(){return e.selectedIndex})))}(this.selector)).pipe(b((function(t){return t})),P((function(t){return console.debug('[FormControl."'.concat(i.name,'"]: value'),t)}))),console.debug("[FormControl.ctor]: ",e,n)}var e,n,r;return e=t,(n=[{key:"getValue",value:function(){var t=this.element;if(st(t))return"number"===this.type?t.valueAsNumber:t.value;if(at(t))return t.selectedIndex;throw new Error('Expected "'.concat(this.name," (").concat(this.selector,')" to be a valid form control'))}},{key:"setValue",value:function(t){console.debug("[FormControl.".concat(this.name,"]: setValue(").concat(t,")"));var e=this.element;if(st(e)){if("string"==typeof t)return void(e.value=t);if("number"==typeof t)return void(e.valueAsNumber=t)}else if(at(e)&&"number"==typeof t)return void(e.selectedIndex=t);throw new Error('Could not set value "'.concat(t,'" on element "').concat(this.name," (").concat(this.selector,')"'))}}])&&ot(e.prototype,n),r&&ot(e,r),t}();function st(t){return ut(t,HTMLInputElement)}function at(t){return ut(t,HTMLSelectElement)}function lt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ft(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function pt(t){return function(t){if(Array.isArray(t))return lt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return lt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ht="".concat("#wf-form-Wycena-Przesy-ki"," #FS2 + div"),dt=function(){function t(){var e,n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n="controls",r=[new ct("fromAddress","".concat(ht,' input[name="Adres-za-adunku"]')),new ct("fromCity","".concat(ht,' input[name="Miejscowo-za-adunku"]')),new ct("fromPostcode","".concat(ht,' input[name="Kod-pocztowy-za-adunku"]')),new ct("toAddress","".concat(ht,' input[name="Adres-roz-adunku"]')),new ct("toCity","".concat(ht,' input[name="Miejscowo-roz-adunku"]')),new ct("toPostcode","".concat(ht,' input[name="Kod-pocztowy-roz-adunku"]'))],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r}var e,n,r;return e=t,(n=[{key:"initialize",value:function(){this.controls.forEach((function(t){var e=localStorage.getItem("goasap-Address-".concat(t.name));e&&t.setValue(e)})),G.apply(void 0,pt(this.controls.map((function(t){return t.value$.pipe(b((function(e){return{value:e,name:t.name}})))})))).pipe(b((function(t){return localStorage.setItem("goasap-Address-".concat(t.name),t.value)}))).subscribe()}}])&&ft(e.prototype,n),r&&ft(e,r),t}();function bt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function yt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],u=!0,c=!1;try{for(n=n.call(t);!(u=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{u||null==n.return||n.return()}finally{if(c)throw o}}return i}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return bt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bt(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function mt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function wt(t){return function(t){if(Array.isArray(t))return vt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return vt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var _t="".concat("#wf-form-Wycena-Przesy-ki"," #FS3 + div"),Et=function(){function t(){var e,n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n="controls",r=[new ct("fromCompanyName","".concat(_t,' input[name="Nazwa-firmy-za-adunek"]')),new ct("fromFirstName","".concat(_t,' input[name="Imi-nadawcy"]')),new ct("fromSurname","".concat(_t,' input[name="Nazwisko-nadawcy"]')),new ct("fromPhone","".concat(_t,' input[name="Telefon-nadawcy"]'))],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r}var e,n,r;return e=t,(n=[{key:"initialize",value:function(){this.controls.forEach((function(t){var e=localStorage.getItem("goasap-Address-".concat(t.name));e&&t.setValue(e)})),G.apply(void 0,wt(this.controls.map((function(t){return t.value$.pipe(b((function(e){return{value:e,name:t.name}})))})))).pipe(b((function(t){return localStorage.setItem("goasap-Address-".concat(t.name),t.value)}))).subscribe()}}])&&mt(e.prototype,n),r&&mt(e,r),t}();function St(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function gt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function At(t){return function(t){if(Array.isArray(t))return St(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return St(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return St(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Pt="".concat("#wf-form-Wycena-Przesy-ki"," #FS4 + div"),Ot=function(){function t(){var e,n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n="controls",r=[new ct("nip","".concat(Pt,' input[name="NIP-P-atnika"]')),new ct("name","".concat(Pt,' input[name="Imi-p-atnika"]')),new ct("surname","".concat(Pt,' input[name="Nazwisko-p-atnika"]')),new ct("email","".concat(Pt,' input[name="Telefon-nadawcy-2"]'))],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r}var e,n,r;return e=t,(n=[{key:"initialize",value:function(){this.controls.forEach((function(t){var e=localStorage.getItem("goasap-Address-".concat(t.name));e&&t.setValue(e)})),G.apply(void 0,At(this.controls.map((function(t){return t.value$.pipe(b((function(e){return{value:e,name:t.name}})))})))).pipe(b((function(t){return localStorage.setItem("goasap-Address-".concat(t.name),t.value)}))).subscribe()}}])&&gt(e.prototype,n),r&&gt(e,r),t}(),Tt=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}(),xt=function(t){function n(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r}return e(n,t),n.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},n}(l),It=function(t){function n(e){var n=t.call(this,e)||this;return n.destination=e,n}return e(n,t),n}(h),kt=function(t){function n(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return e(n,t),n.prototype[p]=function(){return new It(this)},n.prototype.lift=function(t){var e=new jt(this,this);return e.operator=t,e},n.prototype.next=function(t){if(this.closed)throw new Tt;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].next(t)},n.prototype.error=function(t){if(this.closed)throw new Tt;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].error(t);this.observers.length=0},n.prototype.complete=function(){if(this.closed)throw new Tt;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].complete();this.observers.length=0},n.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},n.prototype._trySubscribe=function(e){if(this.closed)throw new Tt;return t.prototype._trySubscribe.call(this,e)},n.prototype._subscribe=function(t){if(this.closed)throw new Tt;return this.hasError?(t.error(this.thrownError),l.EMPTY):this.isStopped?(t.complete(),l.EMPTY):(this.observers.push(t),new xt(this,t))},n.prototype.asObservable=function(){var t=new j;return t.source=this,t},n.create=function(t,e){return new jt(t,e)},n}(j),jt=function(t){function n(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return e(n,t),n.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},n.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},n.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},n.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):l.EMPTY},n}(kt),Nt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.notifyNext=function(t,e,n,r,o){this.destination.next(e)},n.prototype.notifyError=function(t,e){this.destination.error(t)},n.prototype.notifyComplete=function(t){this.destination.complete()},n}(h),Ct=function(t){function n(e,n,r){var o=t.call(this)||this;return o.parent=e,o.outerValue=n,o.outerIndex=r,o.index=0,o}return e(n,t),n.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},n.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},n.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},n}(h);function Rt(t,e,n,r,o){if(void 0===o&&(o=new Ct(t,n,r)),!o.closed)return e instanceof j?e.subscribe(o):W(e)(o)}var Dt={};var Lt=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Yt(t,this.resultSelector))},t}(),Yt=function(t){function n(e,n){var r=t.call(this,e)||this;return r.resultSelector=n,r.active=0,r.values=[],r.observables=[],r}return e(n,t),n.prototype._next=function(t){this.values.push(Dt),this.observables.push(t)},n.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var n=0;n<e;n++){var r=t[n];this.add(Rt(this,r,void 0,n))}}},n.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},n.prototype.notifyNext=function(t,e,n){var r=this.values,o=r[n],i=this.toRespond?o===Dt?--this.toRespond:this.toRespond:0;r[n]=e,0===i&&(this.resultSelector?this._tryResultSelector(r):this.destination.next(r.slice()))},n.prototype._tryResultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},n}(Nt);function zt(t,e){return"function"==typeof e?function(n){return n.pipe(zt((function(n,r){return V(t(n,r)).pipe(b((function(t,o){return e(n,t,r,o)})))})))}:function(e){return e.lift(new Wt(t))}}var Wt=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new qt(t,this.project))},t}(),qt=function(t){function n(e,n){var r=t.call(this,e)||this;return r.project=n,r.index=0,r}return e(n,t),n.prototype._next=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this._innerSub(e)},n.prototype._innerSub=function(t){var e=this.innerSubscription;e&&e.unsubscribe();var n=new M(this),r=this.destination;r.add(n),this.innerSubscription=Z(t,n),this.innerSubscription!==n&&r.add(this.innerSubscription)},n.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this),this.unsubscribe()},n.prototype._unsubscribe=function(){this.innerSubscription=void 0},n.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&t.prototype._complete.call(this)},n.prototype.notifyNext=function(t){this.destination.next(t)},n}(U);function Ft(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Vt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Mt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ut(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],u=!0,c=!1;try{for(n=n.call(t);!(u=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{u||null==n.return||n.return()}finally{if(c)throw o}}return i}}(t,e)||$t(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zt(t){return function(t){if(Array.isArray(t))return Ft(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||$t(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $t(t,e){if(t){if("string"==typeof t)return Ft(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ft(t,e):void 0}}var Ht,Qt,Bt,Kt,Gt,Jt,Xt,te,ee,ne,re,oe,ie,ue,ce,se,ae,le,fe,pe,he,de,be,ye,ve,me,we,_e,Ee,Se,ge,Ae,Pe,Oe,Te,xe,Ie,ke,je,Ne,Ce,Re,De,Le,Ye,ze,We,qe,Fe,Ve,Me="".concat("#wf-form-Wycena-Przesy-ki"," #Step1 + div"),Ue=1,Ze=function(){function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Mt(this,"initializeForm$$",new kt),Mt(this,"rows",[this.getFormRow(0)]),Mt(this,"insuranceInput",new ct("insurance","".concat(Me," .data-input.insurance"))),Mt(this,"value$",function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=void 0,r=void 0;return C(t[t.length-1])&&(r=t.pop()),"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&c(t[0])&&(t=t[0]),K(t,r).lift(new Lt(n))}([this.initializeForm$$.pipe(b((function(){return e.rows})),b((function(t){return t.map((function(t){return t.map((function(t){return t.value$}))})).flat(2)})),zt((function(t){return G.apply(void 0,Zt(t))})),b((function(t){return e.rows}))),this.insuranceInput.value$]).pipe(b((function(t){var e=Ut(t,2),n=e[0];return{insurance:e[1],rows:n.map((function(t){return t.reduce((function(t,e){return t[e.name]=e.getValue(),t}),{})}))}})),P((function(t){return console.debug("[QuoteForm]: value",t)})))),setTimeout((function(){return e.initialize()}),5)}var e,n,r;return e=t,(n=[{key:"initialize",value:function(){var t=this;console.debug("[QuoteForm]. initialize()"),document.querySelector("".concat(Me," #btn-duplicate")).addEventListener("click",(function(){t.addRow(),setTimeout((function(){return t.initializeForm()}),1)})),this.initializeForm()}},{key:"initializeForm",value:function(){console.debug("[QuoteForm]: initializeForm()"),this.initializeForm$$.next()}},{key:"addRow",value:function(){var t=this;console.debug("[QuoteForm]: addRow()");var e,n,r=document.querySelector('[initial-row="0"]').cloneNode(!0);r.setAttribute("initial-row","".concat(Ue)),e=r,(n=document.querySelector('[initial-row="'.concat(Ue-1,'"]'))).parentNode.insertBefore(e,n.nextSibling),this.rows.push(this.getFormRow(Ue));var o=++Ue;r.querySelectorAll("input").forEach((function(t){t.setAttribute("data-name","".concat(t.getAttribute("data-name")," ").concat(o)),t.setAttribute("name","".concat(t.getAttribute("name")," ").concat(o)),t.setAttribute("id","".concat(t.getAttribute("id")," ").concat(o)),t.value=""})),r.querySelectorAll("select").forEach((function(t){t.setAttribute("data-name","".concat(t.getAttribute("data-name")," ").concat(o)),t.setAttribute("name","".concat(t.getAttribute("name")," ").concat(o)),t.setAttribute("id","".concat(t.getAttribute("id")," ").concat(o))}));var i=r.querySelector("#btn-delete");i.style.opacity="1",i.addEventListener("click",(function(){return t.deleteRow(r)}))}},{key:"deleteRow",value:function(t){Ue--,t.remove(),this.rows.splice(Ue,1),this.initializeForm(),console.debug("[QuoteForm]: deleteRow(".concat(Ue,")"),this.rows)}},{key:"getFormRow",value:function(t){console.debug("[QuoteForm]: getFormRow(".concat(t,")"));var e="".concat(Me,' [initial-row="').concat(t,'"]');return[new ct("type","".concat(e," select")),new ct("height","".concat(e," input#Wysoko")),new ct("weight","".concat(e," input#Waga")),new ct("qty","".concat(e," input#Ilo"))]}}])&&Vt(e.prototype,n),r&&Vt(e,r),t}();function $e(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function He(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(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}(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t}var Qe={ZMIENNA_WARTOSC_PROCENT:null!==(ke=null===(Ht=window.quote)||void 0===Ht||null===(Qt=Ht.WARTOSCI)||void 0===Qt?void 0:Qt.ZMIENNA_WARTOSC_PROCENT)&&void 0!==ke?ke:0,UBEZPIECZENIE_PROCENT:null!==(je=null===(Bt=window.quote)||void 0===Bt||null===(Kt=Bt.WARTOSCI)||void 0===Kt?void 0:Kt.UBEZPIECZENIE_PROCENT)&&void 0!==je?je:0,VAT_PROCENT:null!==(Ne=null===(Gt=window.quote)||void 0===Gt||null===(Jt=Gt.WARTOSCI)||void 0===Jt?void 0:Jt.VAT_PROCENT)&&void 0!==Ne?Ne:0,PALETA_TYPE_EURO:{Do_400_kilo:null!==(Ce=null===(Xt=window.quote)||void 0===Xt||null===(te=Xt.WARTOSCI)||void 0===te||null===(ee=te.PALETA_TYPE_EURO)||void 0===ee?void 0:ee.Do_400_kilo)&&void 0!==Ce?Ce:0,Do_800_kilo:null!==(Re=null===(ne=window.quote)||void 0===ne||null===(re=ne.WARTOSCI)||void 0===re||null===(oe=re.PALETA_TYPE_EURO)||void 0===oe?void 0:oe.Do_800_kilo)&&void 0!==Re?Re:0,Do_1000_kilo:null!==(De=null===(ie=window.quote)||void 0===ie||null===(ue=ie.WARTOSCI)||void 0===ue||null===(ce=ue.PALETA_TYPE_EURO)||void 0===ce?void 0:ce.Do_1000_kilo)&&void 0!==De?De:0},PALETA_TYPE_PRZEMYSLOWA:{Do_400_kilo:null!==(Le=null===(se=window.quote)||void 0===se||null===(ae=se.WARTOSCI)||void 0===ae||null===(le=ae.PALETA_TYPE_PRZEMYSLOWA)||void 0===le?void 0:le.Do_400_kilo)&&void 0!==Le?Le:0,Do_800_kilo:null!==(Ye=null===(fe=window.quote)||void 0===fe||null===(pe=fe.WARTOSCI)||void 0===pe||null===(he=pe.PALETA_TYPE_PRZEMYSLOWA)||void 0===he?void 0:he.Do_800_kilo)&&void 0!==Ye?Ye:0,Do_1000_kilo:null!==(ze=null===(de=window.quote)||void 0===de||null===(be=de.WARTOSCI)||void 0===be||null===(ye=be.PALETA_TYPE_PRZEMYSLOWA)||void 0===ye?void 0:ye.Do_1000_kilo)&&void 0!==ze?ze:0},PALETA_TYPE_PRZEMYSLOWA_PLUS:{Do_400_kilo:null!==(We=null===(ve=window.quote)||void 0===ve||null===(me=ve.WARTOSCI)||void 0===me||null===(we=me.PALETA_TYPE_PRZEMYSLOWA_PLUS)||void 0===we?void 0:we.Do_400_kilo)&&void 0!==We?We:0,Do_800_kilo:null!==(qe=null===(_e=window.quote)||void 0===_e||null===(Ee=_e.WARTOSCI)||void 0===Ee||null===(Se=Ee.PALETA_TYPE_PRZEMYSLOWA_PLUS)||void 0===Se?void 0:Se.Do_800_kilo)&&void 0!==qe?qe:0,Do_1000_kilo:null!==(Fe=null===(ge=window.quote)||void 0===ge||null===(Ae=ge.WARTOSCI)||void 0===Ae||null===(Pe=Ae.PALETA_TYPE_PRZEMYSLOWA_PLUS)||void 0===Pe?void 0:Pe.Do_1000_kilo)&&void 0!==Fe?Fe:0},PALETA_TYPE_POLPALETA:{Do_200_kilo:null!==(Ve=null===(Oe=window.quote)||void 0===Oe||null===(Te=Oe.WARTOSCI)||void 0===Te||null===(xe=Te.PALETA_TYPE_POLPALETA)||void 0===xe?void 0:xe.Do_200_kilo)&&void 0!==Ve?Ve:0}};console.debug("[validatePalety]: quote config",window.quote);var Be=function(t){var e=Object.entries(t).map((function(e){var n=yt(e,2),r=n[0],o=n[1];return null==o||0===o?r:"object"==typeof o?Object.entries(t||{}).map((function(t){var e=yt(t,2),n=e[0];if(void 0===e[1])return n})):void 0})).flat().filter(Boolean);return!e.length||(alert("Błąd w formularzu. Prosimy o kontakt.\n\nNie skonfigurowano wartości dla ".concat(e.join(", "))),!1)}(Qe);if(console.debug("[validatePalety]: valid",Be,Qe),Be&&!(null===(Ie=window.quote)||void 0===Ie?void 0:Ie.DISABLED)){var Ke,Ge,Je,Xe,tn=null!==(Je=null===(Ke=window.quote)||void 0===Ke?void 0:Ke.ZA_WYSOKA_CENA)&&void 0!==Je?Je:2500,en=null!==(Xe=null===(Ge=window.quote)||void 0===Ge?void 0:Ge.ZA_WYSOKA_CENA_MESSAGE)&&void 0!==Xe?Xe:"Prosimy o kontakt";setTimeout((function(){var t,e;(new Ze).value$.pipe(b((function(t){var e=t.rows,n=t.insurance;return e.map((function(t){return function(t,e){var n=t.PALETA_TYPE_EURO,r=t.PALETA_TYPE_POLPALETA,o=t.PALETA_TYPE_PRZEMYSLOWA,i=t.PALETA_TYPE_PRZEMYSLOWA_PLUS,u=t.UBEZPIECZENIE_PROCENT,c=t.VAT_PROCENT,s=t.ZMIENNA_WARTOSC_PROCENT,a=0,l=e.type,f=e.qty,p=e.weight,h=e.insurance,d=1===l?f:0,b=2===l?f:0,y=3===l?f:0,v=4===l?f:0,m=1===l?p:0,w=3===l?p:0,_=4===l?p:0,E=2===l?p:0;return l&&f&&p?(d>0&&(m<=400?a+=d*n.Do_400_kilo:m<=800?a+=d*n.Do_800_kilo:m<=1e3&&(a+=d*n.Do_1000_kilo)),y>0&&(w<=400?a+=y*o.Do_400_kilo:w<=800?a+=y*o.Do_800_kilo:w<=1e3&&(a+=y*o.Do_1000_kilo)),v>0&&(_<=400?a+=v*i.Do_400_kilo:_<=800?a+=v*i.Do_800_kilo:_<=1e3&&(a+=v*i.Do_1000_kilo)),b>0&&E<=200&&(a+=b*r.Do_200_kilo),(a+(h=(h||0)<3e3?3e3:h)*(u/100))*((100+s)/100)*((100+c)/100)):0}(Qe,He(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){$e(t,e,n[e])}))}return t}({},t),{insurance:n}))})).reduce((function(t,e){return t+e}),0)})),(t=250,void 0===e&&(e=_),function(n){return n.lift(new E(t,e))}),P((function(t){return console.debug("[QuoteForm]: price",t)})),b((function(t){return t>=tn?en:"".concat(t.toFixed(2)," zł")})),P((function(t){return console.debug("[QuoteForm]: price label",t)})),P((function(t){return document.querySelector("#price").textContent=t}))).subscribe(),(new dt).initialize(),(new Et).initialize(),(new Ot).initialize()}),1e3)}})();
{
"name": "webflow-contact-form",
"version": "1.0.3",
"version": "1.0.4",
"devDependencies": {

@@ -5,0 +5,0 @@ "@swc/cli": "^0.1.57",

@@ -1,30 +0,75 @@

const ZMIENNIA_WARTOSC_PROCENT = 15.75;
const UBEZPIECZENIE_PROCENT = 0.17;
const VAT_PROCENT = 23;
export interface PaletaConfig {
ZMIENNA_WARTOSC_PROCENT: number;
UBEZPIECZENIE_PROCENT: number;
VAT_PROCENT: number;
const PALETA_TYPE_EURO = {
Do_400_kilo: 160,
Do_800_kilo: 190,
Do_1000_kilo: 218.75,
};
PALETA_TYPE_EURO: {
Do_400_kilo: number;
Do_800_kilo: number;
Do_1000_kilo: number;
};
const PALETA_TYPE_PRZEMYSLOWA = {
Do_400_kilo: 190,
Do_800_kilo: 218.75,
Do_1000_kilo: 241.25,
};
PALETA_TYPE_PRZEMYSLOWA: {
Do_400_kilo: number;
Do_800_kilo: number;
Do_1000_kilo: number;
};
const PALETA_TYPE_PRZEMYSLOWA_PLUS = {
Do_400_kilo: 190,
Do_800_kilo: 218.75,
Do_1000_kilo: 241.25,
};
PALETA_TYPE_PRZEMYSLOWA_PLUS: {
Do_400_kilo: number;
Do_800_kilo: number;
Do_1000_kilo: number;
};
const PALETA_TYPE_POLPALETA = {
Do_200_kilo: 145,
};
PALETA_TYPE_POLPALETA: {
Do_200_kilo: number;
};
}
export function calculateShippingPrice(type: number, qty: number, weight: number, insurance: number): number {
export function validatePalety(config: PaletaConfig): boolean {
const undefinedKeys = Object.entries(config)
.map(([key, value]) => {
if (value === undefined || value === null || value === 0) {
return key;
} else if (typeof value === 'object') {
return Object.entries(config || {}).map(([key, value]) => {
if (typeof value === 'undefined') {
return key;
}
});
}
})
.flat()
.filter(Boolean);
if (undefinedKeys.length) {
alert(`Błąd w formularzu. Prosimy o kontakt.\n\nNie skonfigurowano wartości dla ${undefinedKeys.join(', ')}`);
return false;
}
return true;
}
export function calculateRow(
config: PaletaConfig,
values: {
type: number;
qty: number;
weight: number;
insurance: number;
},
): number {
const {
PALETA_TYPE_EURO,
PALETA_TYPE_POLPALETA,
PALETA_TYPE_PRZEMYSLOWA,
PALETA_TYPE_PRZEMYSLOWA_PLUS,
UBEZPIECZENIE_PROCENT,
VAT_PROCENT,
ZMIENNA_WARTOSC_PROCENT,
} = config;
let totalBasePrice = 0;
let { type, qty, weight, insurance } = values;
const typeEuroQty = type === 1 ? qty : 0;

@@ -87,3 +132,3 @@ const typePolpaletaQty = type === 2 ? qty : 0;

const insuranceCost = insurance * (UBEZPIECZENIE_PROCENT / 100);
const totalNetPrice = (totalBasePrice + insuranceCost) * ((100 + ZMIENNIA_WARTOSC_PROCENT) / 100);
const totalNetPrice = (totalBasePrice + insuranceCost) * ((100 + ZMIENNA_WARTOSC_PROCENT) / 100);
const totalPrice = totalNetPrice * ((100 + VAT_PROCENT) / 100);

@@ -90,0 +135,0 @@

@@ -1,144 +0,101 @@

import { Subject, combineLatest, fromEvent } from 'rxjs';
import { map, startWith, switchMap, tap } from 'rxjs/operators';
import { calculateShippingPrice } from './calculate-shipping-price';
import { debounce } from './debounce';
import { debounceTime, map, tap } from 'rxjs/operators';
import { AddressForm } from './address-form';
import { PaletaConfig, calculateRow, validatePalety } from './calculate-shipping-price';
import { ContactForm } from './contact-form';
import { PaymentForm } from './payment-form';
import { QuoteForm } from './quote-form';
const ZA_WYSOKA_CENA = 2500;
const ZA_WYSOKA_CENA_MESSAGE = 'Prosimy o kontakt';
declare const window: {
quote?: {
DISABLED?: boolean;
ZA_WYSOKA_CENA?: number;
ZA_WYSOKA_CENA_MESSAGE?: string;
WARTOSCI?: Partial<PaletaConfig>;
};
};
function setPriceOutput(price) {
let textContent = `${price.toFixed(2)} zł`;
// <script type="text/javascript" >
// window.quote = {
// ZA_WYSOKA_CENA: 2500,
// ZA_WYSOKA_CENA_MESSAGE: 'Prosimy o kontakt',
// WARTOSCI: {
// ZMIENNA_WARTOSC_PROCENT: 15.75,
// UBEZPIECZENIE_PROCENT: 0.17,
// VAT_PROCENT: 23,
// PALETA_TYPE_EURO: {
// Do_400_kilo: 160,
// Do_800_kilo: 190,
// Do_1000_kilo: 218.75,
// },
// PALETA_TYPE_PRZEMYSLOWA: {
// Do_400_kilo: 190,
// Do_800_kilo: 218.75,
// Do_1000_kilo: 241.25,
// },
// PALETA_TYPE_PRZEMYSLOWA_PLUS: {
// Do_400_kilo: 190,
// Do_800_kilo: 218.75,
// Do_1000_kilo: 241.25,
// },
// PALETA_TYPE_POLPALETA: {
// Do_200_kilo: 145,
// },
// },
// };
// </script>
if (price >= ZA_WYSOKA_CENA) {
textContent = ZA_WYSOKA_CENA_MESSAGE;
}
const PALETY: PaletaConfig = {
ZMIENNA_WARTOSC_PROCENT: window.quote?.WARTOSCI?.ZMIENNA_WARTOSC_PROCENT ?? 0,
UBEZPIECZENIE_PROCENT: window.quote?.WARTOSCI?.UBEZPIECZENIE_PROCENT ?? 0,
VAT_PROCENT: window.quote?.WARTOSCI?.VAT_PROCENT ?? 0,
document.querySelector('#price')!.textContent = textContent;
}
PALETA_TYPE_EURO: {
Do_400_kilo: window.quote?.WARTOSCI?.PALETA_TYPE_EURO?.Do_400_kilo ?? 0,
Do_800_kilo: window.quote?.WARTOSCI?.PALETA_TYPE_EURO?.Do_800_kilo ?? 0,
Do_1000_kilo: window.quote?.WARTOSCI?.PALETA_TYPE_EURO?.Do_1000_kilo ?? 0,
},
const debouncedSetPriceOutput = debounce(setPriceOutput, 500);
PALETA_TYPE_PRZEMYSLOWA: {
Do_400_kilo: window.quote?.WARTOSCI?.PALETA_TYPE_PRZEMYSLOWA?.Do_400_kilo ?? 0,
Do_800_kilo: window.quote?.WARTOSCI?.PALETA_TYPE_PRZEMYSLOWA?.Do_800_kilo ?? 0,
Do_1000_kilo: window.quote?.WARTOSCI?.PALETA_TYPE_PRZEMYSLOWA?.Do_1000_kilo ?? 0,
},
setTimeout(() => {
const reset$ = new Subject();
PALETA_TYPE_PRZEMYSLOWA_PLUS: {
Do_400_kilo: window.quote?.WARTOSCI?.PALETA_TYPE_PRZEMYSLOWA_PLUS?.Do_400_kilo ?? 0,
Do_800_kilo: window.quote?.WARTOSCI?.PALETA_TYPE_PRZEMYSLOWA_PLUS?.Do_800_kilo ?? 0,
Do_1000_kilo: window.quote?.WARTOSCI?.PALETA_TYPE_PRZEMYSLOWA_PLUS?.Do_1000_kilo ?? 0,
},
// @return Observable<{ wysokosc: number, waga: number, ilosc: number, type: string }>
function getValues(node) {
const select = node.querySelector('select');
const inputs = node.querySelectorAll('input') as HTMLInputElement[];
PALETA_TYPE_POLPALETA: {
Do_200_kilo: window.quote?.WARTOSCI?.PALETA_TYPE_POLPALETA?.Do_200_kilo ?? 0,
},
};
const idToKey = {
Wysoko: 'wysokosc',
Waga: 'waga',
Ilo: 'ilosc',
};
console.debug(`[validatePalety]: quote config`, window.quote);
const valid = validatePalety(PALETY);
console.debug(`[validatePalety]: valid`, valid, PALETY);
const getInputKey = (input) => {
const dataName = input.getAttribute('data-name');
return Object.entries(idToKey).reduce((name, [id, key]) => {
if (dataName?.startsWith(id)) {
return key;
}
if (valid && !window.quote?.DISABLED) {
const ZA_WYSOKA_CENA = window.quote?.ZA_WYSOKA_CENA ?? 2500;
const ZA_WYSOKA_CENA_MESSAGE = window.quote?.ZA_WYSOKA_CENA_MESSAGE ?? 'Prosimy o kontakt';
return name;
}, '');
};
const inputs$ = combineLatest(
Array.from(inputs).map((input) =>
fromEvent(input, 'input').pipe(
startWith(0),
map(() => input.valueAsNumber ?? 0),
map((value) => (Number.isNaN(value) ? 0 : value)),
map((value) => ({ [getInputKey(input)]: value })),
setTimeout(() => {
new QuoteForm().value$
.pipe(
map(({ rows, insurance }) =>
rows.map((row) => calculateRow(PALETY, { ...row, insurance })).reduce((sum, row) => sum + row, 0),
),
),
).pipe(
map((values) =>
values.reduce(
(all, value) => ({
...all,
...value,
}),
{},
),
),
);
debounceTime(250),
tap((price) => console.debug(`[QuoteForm]: price`, price)),
map((price) => (price >= ZA_WYSOKA_CENA ? ZA_WYSOKA_CENA_MESSAGE : `${price.toFixed(2)} zł`)),
tap((price) => console.debug(`[QuoteForm]: price label`, price)),
tap((price) => (document.querySelector('#price')!.textContent = price)),
)
.subscribe();
const select$ = fromEvent(select, 'change').pipe(
startWith(select.selectedIndex),
map(() => select.selectedIndex),
map((value) => ({ typ: value })),
);
return combineLatest([inputs$, select$]);
}
const insuranceInput = document.querySelector('.data-input.insurance')! as HTMLInputElement;
const insurance$ = fromEvent(document.querySelector('.data-input.insurance')!, 'input').pipe(
map(() => insuranceInput.value),
tap((insurance) => console.log('insurance', insurance)),
startWith(0),
);
combineLatest([reset$, insurance$])
.pipe(
switchMap(() => {
const rows = document.querySelectorAll('#srow');
return combineLatest(Array.from(rows).map((row) => getValues(row)));
}),
map((values) => values.map((value) => value.reduce((finalValue, value) => ({ ...finalValue, ...value }), {}))),
map((values) => {
return values.map((value) => {
const { waga, ilosc, typ } = value as { waga: number; ilosc: number; typ: number };
return calculateShippingPrice(typ, ilosc, waga, Number(insuranceInput.value));
});
}),
map((values) => values.reduce((sum, current) => (sum += current), 0)),
startWith(0),
tap((sum) => debouncedSetPriceOutput(sum)),
)
.subscribe();
reset$.next();
function insertAfter(newNode, existingNode) {
existingNode.parentNode.insertBefore(newNode, existingNode.nextSibling);
}
let counter = 1;
document.querySelector('#btn-duplicate')!.addEventListener('click', () => {
const row = document.querySelector('[initial-row="0"]') as HTMLElement;
const node = row.cloneNode(true)! as HTMLElement;
node.setAttribute('initial-row', `${counter}`);
insertAfter(node, document.querySelector(`[initial-row="${counter - 1}"]`));
const newId = ++counter;
node.querySelectorAll('input').forEach((input) => {
input.setAttribute('data-name', `${input.getAttribute('data-name')} ${newId}`);
input.setAttribute('name', `${input.getAttribute('name')} ${newId}`);
input.setAttribute('id', `${input.getAttribute('id')} ${newId}`);
input.value = '';
});
node.querySelectorAll('select').forEach((input) => {
input.setAttribute('data-name', `${input.getAttribute('data-name')} ${newId}`);
input.setAttribute('name', `${input.getAttribute('name')} ${newId}`);
input.setAttribute('id', `${input.getAttribute('id')} ${newId}`);
// input.value = undefined;
});
const btnDelete = node.querySelector('#btn-delete') as HTMLElement;
btnDelete.style.opacity = '1';
btnDelete.addEventListener('click', () => {
counter--;
node.remove();
reset$.next();
});
setTimeout(() => {
reset$.next();
}, 1);
});
}, 1000);
new AddressForm().initialize();
new ContactForm().initialize();
new PaymentForm().initialize();
}, 1000);
}

@@ -7,6 +7,5 @@ {

"strict": true,
"module": "es6",
"target": "es5",
"module": "ESNext",
"target": "ES2021",
"outDir": "./dist",
"allowJs": true,
"moduleResolution": "node",

@@ -13,0 +12,0 @@ "baseUrl": ".",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc