(()=>{var t={2564:t=>{"use strict";var e=Object.assign||function(t){for(var e,n=1;n=this.maxSize&&(this.list.remove(s),delete this.hash[s.key],this.size--),(n=this.hash[t])?(n.val=e,this.list.moveToFront(n)):(n=new i(t,e),this.list.add(n),this.hash[t]=n,this.size++)},get:function(t){var e=this.hash[t];if(e)return this.list.moveToFront(e),e.val},reset:function(){this.size=0,this.hash={},this.list=new s}}),n.mixin(s.prototype,{add:function(t){this.head&&(t.next=this.head,this.head.prev=t),this.head=t,this.tail=this.tail||t},remove:function(t){t.prev?t.prev.next=t.next:this.head=t.next,t.next?t.next.prev=t.prev:this.tail=t.prev},moveToFront:function(t){this.remove(t),this.add(t)}}),t}(),a=function(){"use strict";var t;try{(t=window.localStorage).setItem("~~~","!"),t.removeItem("~~~")}catch(e){t=null}function s(e,s){this.prefix=["__",e,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+n.escapeRegExChars(this.prefix)),this.ls=s||t,!this.ls&&this._noop()}return n.mixin(s.prototype,{_prefix:function(t){return this.prefix+t},_ttlKey:function(t){return this._prefix(t)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=n.noop},_safeSet:function(t,e){try{this.ls.setItem(t,e)}catch(t){"QuotaExceededError"===t.name&&(this.clear(),this._noop())}},get:function(t){return this.isExpired(t)&&this.remove(t),o(this.ls.getItem(this._prefix(t)))},set:function(t,e,s){return n.isNumber(s)?this._safeSet(this._ttlKey(t),r(i()+s)):this.ls.removeItem(this._ttlKey(t)),this._safeSet(this._prefix(t),r(e))},remove:function(t){return this.ls.removeItem(this._ttlKey(t)),this.ls.removeItem(this._prefix(t)),this},clear:function(){var t,e=a(this.keyMatcher);for(t=e.length;t--;)this.remove(e[t]);return this},isExpired:function(t){var e=o(this.ls.getItem(this._ttlKey(t)));return!!(n.isNumber(e)&&i()>e)}}),s;function i(){return(new Date).getTime()}function r(t){return JSON.stringify(n.isUndefined(t)?null:t)}function o(t){return e.parseJSON(t)}function a(e){var n,s,i=[],r=t.length;for(n=0;ne[s]||(i.push(t[n]),n++),s++);return i}}(),l=function(){"use strict";var t;function e(t){this.url=t.url,this.ttl=t.ttl,this.cache=t.cache,this.prepare=t.prepare,this.transform=t.transform,this.transport=t.transport,this.thumbprint=t.thumbprint,this.storage=new a(t.cacheKey)}return t={data:"data",protocol:"protocol",thumbprint:"thumbprint"},n.mixin(e.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},store:function(e){this.cache&&(this.storage.set(t.data,e,this.ttl),this.storage.set(t.protocol,location.protocol,this.ttl),this.storage.set(t.thumbprint,this.thumbprint,this.ttl))},fromCache:function(){var e,n={};return this.cache?(n.data=this.storage.get(t.data),n.protocol=this.storage.get(t.protocol),n.thumbprint=this.storage.get(t.thumbprint),e=n.thumbprint!==this.thumbprint||n.protocol!==location.protocol,n.data&&!e?n.data:null):null},fromNetwork:function(t){var e,n=this;function s(){t(!0)}function i(e){t(null,n.transform(e))}t&&(e=this.prepare(this._settings()),this.transport(e).fail(s).done(i))},clear:function(){return this.storage.clear(),this}}),e}(),d=function(){"use strict";function t(t){this.url=t.url,this.prepare=t.prepare,this.transform=t.transform,this.transport=new c({cache:t.cache,limiter:t.limiter,transport:t.transport})}return n.mixin(t.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},get:function(t,e){var n,s=this;if(e)return t=t||"",n=this.prepare(t,this._settings()),this.transport.get(n,i);function i(t,n){e(t?[]:s.transform(n))}},cancelLastRequest:function(){this.transport.cancel()}}),t}(),h=function(){"use strict";return function(s){var r,o;return r={initialize:!0,identify:n.stringify,datumTokenizer:null,queryTokenizer:null,sufficient:5,sorter:null,local:[],prefetch:null,remote:null},!(s=n.mixin(r,s||{})).datumTokenizer&&e.error("datumTokenizer is required"),!s.queryTokenizer&&e.error("queryTokenizer is required"),o=s.sorter,s.sorter=o?function(t){return t.sort(o)}:n.identity,s.local=n.isFunction(s.local)?s.local():s.local,s.prefetch=t(s.prefetch),s.remote=i(s.remote),s};function t(t){var i;return t?(i={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:n.identity,transform:n.identity,transport:null},t=n.isString(t)?{url:t}:t,!(t=n.mixin(i,t)).url&&e.error("prefetch requires url to be set"),t.transform=t.filter||t.transform,t.cacheKey=t.cacheKey||t.url,t.thumbprint=s+t.thumbprint,t.transport=t.transport?a(t.transport):e.ajax,t):null}function i(t){var s;if(t)return s={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:n.identity,transport:null},t=n.isString(t)?{url:t}:t,!(t=n.mixin(s,t)).url&&e.error("remote requires url to be set"),t.transform=t.filter||t.transform,t.prepare=r(t),t.limiter=o(t),t.transport=t.transport?a(t.transport):e.ajax,delete t.replace,delete t.wildcard,delete t.rateLimitBy,delete t.rateLimitWait,t}function r(t){var e,n,s;return e=t.prepare,n=t.replace,s=t.wildcard,e||(e=n?i:t.wildcard?r:o);function i(t,e){return e.url=n(e.url,t),e}function r(t,e){return e.url=e.url.replace(s,encodeURIComponent(t)),e}function o(t,e){return e}}function o(t){var e,s,i;return e=t.limiter,s=t.rateLimitBy,i=t.rateLimitWait,e||(e=/^throttle$/i.test(s)?o(i):r(i)),e;function r(t){return function(e){return n.debounce(e,t)}}function o(t){return function(e){return n.throttle(e,t)}}}function a(t){return function(s){var i=e.Deferred();return t(s,r,o),i;function r(t){n.defer((function(){i.resolve(t)}))}function o(t){n.defer((function(){i.reject(t)}))}}}}(),p=function(){"use strict";var t;function s(t){t=h(t),this.sorter=t.sorter,this.identify=t.identify,this.sufficient=t.sufficient,this.local=t.local,this.remote=t.remote?new d(t.remote):null,this.prefetch=t.prefetch?new l(t.prefetch):null,this.index=new u({identify:this.identify,datumTokenizer:t.datumTokenizer,queryTokenizer:t.queryTokenizer}),!1!==t.initialize&&this.initialize()}return t=window&&window.Bloodhound,s.noConflict=function(){return window&&(window.Bloodhound=t),s},s.tokenizers=i,n.mixin(s.prototype,{__ttAdapter:function(){var t=this;return this.remote?e:n;function e(e,n,s){return t.search(e,n,s)}function n(e,n){return t.search(e,n)}},_loadPrefetch:function(){var t,n,s=this;return t=e.Deferred(),this.prefetch?(n=this.prefetch.fromCache())?(this.index.bootstrap(n),t.resolve()):this.prefetch.fromNetwork(i):t.resolve(),t.promise();function i(e,n){if(e)return t.reject();s.add(n),s.prefetch.store(s.index.serialize()),t.resolve()}},_initialize:function(){var t=this;return this.clear(),(this.initPromise=this._loadPrefetch()).done(e),this.initPromise;function e(){t.add(t.local)}},initialize:function(t){return!this.initPromise||t?this._initialize():this.initPromise},add:function(t){return this.index.add(t),this},get:function(t){return t=n.isArray(t)?t:[].slice.call(arguments),this.index.get(t)},search:function(t,e,s){var i,r=this;return i=this.sorter(this.index.search(t)),e(this.remote?i.slice():i),this.remote&&i.length',menu:'
'}}function i(t){var e={};return n.each(t,(function(t,n){e[n]="."+t})),e}function r(){var t={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return n.isMsie()&&n.mixin(t.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),t}}(),i=function(){"use strict";var t,s;function i(t){t&&t.el||e.error("EventBus initialized without el"),this.$el=e(t.el)}return t="typeahead:",s={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},n.mixin(i.prototype,{_trigger:function(n,s){var i;return i=e.Event(t+n),(s=s||[]).unshift(i),this.$el.trigger.apply(this.$el,s),i},before:function(t){var e;return e=[].slice.call(arguments,1),this._trigger("before"+t,e).isDefaultPrevented()},trigger:function(t){var e;this._trigger(t,[].slice.call(arguments,1)),(e=s[t])&&this._trigger(e,[].slice.call(arguments,1))}}),i}(),r=function(){"use strict";var t=/\s+/,e=c();return{onSync:i,onAsync:s,off:r,trigger:o};function n(e,n,s,i){var r;if(!s)return this;for(n=n.split(t),s=i?u(s,i):s,this._callbacks=this._callbacks||{};r=n.shift();)this._callbacks[r]=this._callbacks[r]||{sync:[],async:[]},this._callbacks[r][e].push(s);return this}function s(t,e,s){return n.call(this,"async",t,e,s)}function i(t,e,s){return n.call(this,"sync",t,e,s)}function r(e){var n;if(!this._callbacks)return this;for(e=e.split(t);n=e.shift();)delete this._callbacks[n];return this}function o(n){var s,i,r,o,c;if(!this._callbacks)return this;for(n=n.split(t),r=[].slice.call(arguments,1);(s=n.shift())&&(i=this._callbacks[s]);)o=a(i.sync,this,[s].concat(r)),c=a(i.async,this,[s].concat(r)),o()&&e(c);return this}function a(t,e,n){return s;function s(){for(var s,i=0,r=t.length;!s&&i9?this.$input.on("input.tt",r):this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",(function(e){t[e.which||e.keyCode]||n.defer(n.bind(o._onInput,o,e))})),this},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getLangDir:function(){return this.dir},getQuery:function(){return this.query||""},setQuery:function(t,e){this.setInputValue(t),this._setQuery(t,e)},hasQueryChangedSinceLastFocus:function(){return this.query!==this.queryWhenFocused},getInputValue:function(){return this.$input.val()},setInputValue:function(t){this.$input.val(t),this.clearHintIfInvalid(),this._checkLanguageDirection()},resetInputValue:function(){this.setInputValue(this.query)},getHint:function(){return this.$hint.val()},setHint:function(t){this.$hint.val(t)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var t,e,n;n=(t=this.getInputValue())!==(e=this.getHint())&&0===e.indexOf(t),(""===t||!n||this.hasOverflow())&&this.clearHint()},hasFocus:function(){return this.$input.is(":focus")},hasOverflow:function(){var t=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=t},isCursorAtEnd:function(){var t,e,s;return t=this.$input.val().length,e=this.$input[0].selectionStart,n.isNumber(e)?e===t:!document.selection||((s=document.selection.createRange()).moveStart("character",-t),t===s.text.length)},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$overflowHelper.remove(),this.$hint=this.$input=this.$overflowHelper=e("
")}}),s;function i(t){return e('').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:t.css("font-family"),fontSize:t.css("font-size"),fontStyle:t.css("font-style"),fontVariant:t.css("font-variant"),fontWeight:t.css("font-weight"),wordSpacing:t.css("word-spacing"),letterSpacing:t.css("letter-spacing"),textIndent:t.css("text-indent"),textRendering:t.css("text-rendering"),textTransform:t.css("text-transform")}).insertAfter(t)}function o(t,e){return s.normalizeQuery(t)===s.normalizeQuery(e)}function a(t){return t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}}(),c=function(){"use strict";var t,s;function i(t,i){(t=t||{}).templates=t.templates||{},t.templates.notFound=t.templates.notFound||t.templates.empty,t.source||e.error("missing source"),t.node||e.error("missing node"),t.name&&!u(t.name)&&e.error("invalid dataset name: "+t.name),i.mixin(this),this.highlight=!!t.highlight,this.name=t.name||s(),this.limit=t.limit||5,this.displayFn=a(t.display||t.displayKey),this.templates=c(t.templates,this.displayFn),this.source=t.source.__ttAdapter?t.source.__ttAdapter():t.source,this.async=n.isUndefined(t.async)?this.source.length>2:!!t.async,this._resetLastSuggestion(),this.$el=e(t.node).addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}return t={val:"tt-selectable-display",obj:"tt-selectable-object"},s=n.getIdGenerator(),i.extractData=function(n){var s=e(n);return s.data(t.obj)?{val:s.data(t.val)||"",obj:s.data(t.obj)||null}:null},n.mixin(i.prototype,r,{_overwrite:function(t,e){(e=e||[]).length?this._renderSuggestions(t,e):this.async&&this.templates.pending?this._renderPending(t):!this.async&&this.templates.notFound?this._renderNotFound(t):this._empty(),this.trigger("rendered",this.name,e,!1)},_append:function(t,e){(e=e||[]).length&&this.$lastSuggestion.length?this._appendSuggestions(t,e):e.length?this._renderSuggestions(t,e):!this.$lastSuggestion.length&&this.templates.notFound&&this._renderNotFound(t),this.trigger("rendered",this.name,e,!0)},_renderSuggestions:function(t,e){var n;n=this._getSuggestionsFragment(t,e),this.$lastSuggestion=n.children().last(),this.$el.html(n).prepend(this._getHeader(t,e)).append(this._getFooter(t,e))},_appendSuggestions:function(t,e){var n,s;s=(n=this._getSuggestionsFragment(t,e)).children().last(),this.$lastSuggestion.after(n),this.$lastSuggestion=s},_renderPending:function(t){var e=this.templates.pending;this._resetLastSuggestion(),e&&this.$el.html(e({query:t,dataset:this.name}))},_renderNotFound:function(t){var e=this.templates.notFound;this._resetLastSuggestion(),e&&this.$el.html(e({query:t,dataset:this.name}))},_empty:function(){this.$el.empty(),this._resetLastSuggestion()},_getSuggestionsFragment:function(s,i){var r,a=this;return r=document.createDocumentFragment(),n.each(i,(function(n){var i,o;o=a._injectQuery(s,n),i=e(a.templates.suggestion(o)).data(t.obj,n).data(t.val,a.displayFn(n)).addClass(a.classes.suggestion+" "+a.classes.selectable),r.appendChild(i[0])})),this.highlight&&o({className:this.classes.highlight,node:r,pattern:s}),e(r)},_getFooter:function(t,e){return this.templates.footer?this.templates.footer({query:t,suggestions:e,dataset:this.name}):null},_getHeader:function(t,e){return this.templates.header?this.templates.header({query:t,suggestions:e,dataset:this.name}):null},_resetLastSuggestion:function(){this.$lastSuggestion=e()},_injectQuery:function(t,e){return n.isObject(e)?n.mixin({_query:t},e):e},update:function(t){var n=this,s=!1,i=!1,r=0;function o(e){i||(i=!0,e=(e||[]).slice(0,n.limit),r=e.length,n._overwrite(t,e),r")}}),i;function a(t){return t=t||n.stringify,n.isFunction(t)?t:e;function e(e){return e[t]}}function c(t,s){return{notFound:t.notFound&&n.templatify(t.notFound),pending:t.pending&&n.templatify(t.pending),header:t.header&&n.templatify(t.header),footer:t.footer&&n.templatify(t.footer),suggestion:t.suggestion||i};function i(t){return e("
").text(s(t))}}function u(t){return/^[_a-zA-Z0-9-]+$/.test(t)}}(),u=function(){"use strict";function t(t,s){var i=this;function r(t){var n=i.$node.find(t.node).first();return t.node=n.length?n:e("
").appendTo(i.$node),new c(t,s)}(t=t||{}).node||e.error("node is required"),s.mixin(this),this.$node=e(t.node),this.query=null,this.datasets=n.map(t.datasets,r)}return n.mixin(t.prototype,r,{_onSelectableClick:function(t){this.trigger("selectableClicked",e(t.currentTarget))},_onRendered:function(t,e,n,s){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetRendered",e,n,s)},_onCleared:function(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetCleared")},_propagate:function(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function(){return n.every(this.datasets,t);function t(t){return t.isEmpty()}},_getSelectables:function(){return this.$node.find(this.selectors.selectable)},_removeCursor:function(){var t=this.getActiveSelectable();t&&t.removeClass(this.classes.cursor)},_ensureVisible:function(t){var e,n,s,i;n=(e=t.position().top)+t.outerHeight(!0),s=this.$node.scrollTop(),i=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10),e<0?this.$node.scrollTop(s+e):i"),n.each(this.datasets,t)}}),t}(),l=function(){"use strict";var t=u.prototype;function e(){u.apply(this,[].slice.call(arguments,0))}return n.mixin(e.prototype,u.prototype,{open:function(){return!this._allDatasetsEmpty()&&this._show(),t.open.apply(this,[].slice.call(arguments,0))},close:function(){return this._hide(),t.close.apply(this,[].slice.call(arguments,0))},_onRendered:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),t._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),t._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function(e){return this.$node.css("ltr"===e?this.css.ltr:this.css.rtl),t.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function(){this.$node.hide()},_show:function(){this.$node.css("display","block")}}),e}(),d=function(){"use strict";function t(t,i){var r,o,a,c,u,l,d,h,p,m,f;(t=t||{}).input||e.error("missing input"),t.menu||e.error("missing menu"),t.eventBus||e.error("missing event bus"),i.mixin(this),this.eventBus=t.eventBus,this.minLength=n.isNumber(t.minLength)?t.minLength:1,this.input=t.input,this.menu=t.menu,this.enabled=!0,this.active=!1,this.input.hasFocus()&&this.activate(),this.dir=this.input.getLangDir(),this._hacks(),this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this),r=s(this,"activate","open","_onFocused"),o=s(this,"deactivate","_onBlurred"),a=s(this,"isActive","isOpen","_onEnterKeyed"),c=s(this,"isActive","isOpen","_onTabKeyed"),u=s(this,"isActive","_onEscKeyed"),l=s(this,"isActive","open","_onUpKeyed"),d=s(this,"isActive","open","_onDownKeyed"),h=s(this,"isActive","isOpen","_onLeftKeyed"),p=s(this,"isActive","isOpen","_onRightKeyed"),m=s(this,"_openIfActive","_onQueryChanged"),f=s(this,"_openIfActive","_onWhitespaceChanged"),this.input.bind().onSync("focused",r,this).onSync("blurred",o,this).onSync("enterKeyed",a,this).onSync("tabKeyed",c,this).onSync("escKeyed",u,this).onSync("upKeyed",l,this).onSync("downKeyed",d,this).onSync("leftKeyed",h,this).onSync("rightKeyed",p,this).onSync("queryChanged",m,this).onSync("whitespaceChanged",f,this).onSync("langDirChanged",this._onLangDirChanged,this)}return n.mixin(t.prototype,{_hacks:function(){var t,s;t=this.input.$input||e("
"),s=this.menu.$node||e("
"),t.on("blur.tt",(function(e){var i,r,o;i=document.activeElement,r=s.is(i),o=s.has(i).length>0,n.isMsie()&&(r||o)&&(e.preventDefault(),e.stopImmediatePropagation(),n.defer((function(){t.focus()})))})),s.on("mousedown.tt",(function(t){t.preventDefault()}))},_onSelectableClicked:function(t,e){this.select(e)},_onDatasetCleared:function(){this._updateHint()},_onDatasetRendered:function(t,e,n,s){this._updateHint(),this.eventBus.trigger("render",n,s,e)},_onAsyncRequested:function(t,e,n){this.eventBus.trigger("asyncrequest",n,e)},_onAsyncCanceled:function(t,e,n){this.eventBus.trigger("asynccancel",n,e)},_onAsyncReceived:function(t,e,n){this.eventBus.trigger("asyncreceive",n,e)},_onFocused:function(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function(t,e){var n;(n=this.menu.getActiveSelectable())&&this.select(n)&&e.preventDefault()},_onTabKeyed:function(t,e){var n;(n=this.menu.getActiveSelectable())?this.select(n)&&e.preventDefault():(n=this.menu.getTopSelectable())&&this.autocomplete(n)&&e.preventDefault()},_onEscKeyed:function(){this.close()},_onUpKeyed:function(){this.moveCursor(-1)},_onDownKeyed:function(){this.moveCursor(1)},_onLeftKeyed:function(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onRightKeyed:function(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onQueryChanged:function(t,e){this._minLengthMet(e)?this.menu.update(e):this.menu.empty()},_onWhitespaceChanged:function(){this._updateHint()},_onLangDirChanged:function(t,e){this.dir!==e&&(this.dir=e,this.menu.setLanguageDirection(e))},_openIfActive:function(){this.isActive()&&this.open()},_minLengthMet:function(t){return(t=n.isString(t)?t:this.input.getQuery()||"").length>=this.minLength},_updateHint:function(){var t,e,s,i,r,o;t=this.menu.getTopSelectable(),e=this.menu.getSelectableData(t),s=this.input.getInputValue(),!e||n.isBlankString(s)||this.input.hasOverflow()?this.input.clearHint():(i=a.normalizeQuery(s),r=n.escapeRegExChars(i),(o=new RegExp("^(?:"+r+")(.+$)","i").exec(e.val))&&this.input.setHint(s+o[1]))},isEnabled:function(){return this.enabled},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},isActive:function(){return this.active},activate:function(){return!!this.isActive()||!(!this.isEnabled()||this.eventBus.before("active"))&&(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function(){return!this.isActive()||!this.eventBus.before("idle")&&(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0)},isOpen:function(){return this.menu.isOpen()},open:function(){return this.isOpen()||this.eventBus.before("open")||(this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function(){return this.isOpen()&&!this.eventBus.before("close")&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function(t){this.input.setQuery(n.toStr(t))},getVal:function(){return this.input.getQuery()},select:function(t){var e=this.menu.getSelectableData(t);return!(!e||this.eventBus.before("select",e.obj)||(this.input.setQuery(e.val,!0),this.eventBus.trigger("select",e.obj),this.close(),0))},autocomplete:function(t){var e,n;return e=this.input.getQuery(),!(!(n=this.menu.getSelectableData(t))||e===n.val||this.eventBus.before("autocomplete",n.obj)||(this.input.setQuery(n.val),this.eventBus.trigger("autocomplete",n.obj),0))},moveCursor:function(t){var e,n,s,i;return e=this.input.getQuery(),n=this.menu.selectableRelativeToCursor(t),i=(s=this.menu.getSelectableData(n))?s.obj:null,!(this._minLengthMet()&&this.menu.update(e)||this.eventBus.before("cursorchange",i)||(this.menu.setCursor(n),s?this.input.setInputValue(s.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",i),0))},destroy:function(){this.input.destroy(),this.menu.destroy()}}),t;function s(t){var e=[].slice.call(arguments,1);return function(){var s=[].slice.call(arguments);n.each(e,(function(e){return t[e].apply(t,s)}))}}}(),void function(){"use strict";var t,r,o;function c(t,n){t.each((function(){var t,s=e(this);(t=s.data(r.typeahead))&&n(t,s)}))}function h(t,e){return t.clone().addClass(e.classes.hint).removeData().css(e.css.hint).css(m(t)).prop("readonly",!0).removeAttr("id name placeholder required").attr({autocomplete:"off",spellcheck:"false",tabindex:-1})}function p(t,e){t.data(r.attrs,{dir:t.attr("dir"),autocomplete:t.attr("autocomplete"),spellcheck:t.attr("spellcheck"),style:t.attr("style")}),t.addClass(e.classes.input).attr({autocomplete:"off",spellcheck:!1});try{!t.attr("dir")&&t.attr("dir","auto")}catch(t){}return t}function m(t){return{backgroundAttachment:t.css("background-attachment"),backgroundClip:t.css("background-clip"),backgroundColor:t.css("background-color"),backgroundImage:t.css("background-image"),backgroundOrigin:t.css("background-origin"),backgroundPosition:t.css("background-position"),backgroundRepeat:t.css("background-repeat"),backgroundSize:t.css("background-size")}}function f(t){var e,s;e=t.data(r.www),s=t.parent().filter(e.selectors.wrapper),n.each(t.data(r.attrs),(function(e,s){n.isUndefined(e)?t.removeAttr(s):t.attr(s,e)})),t.removeData(r.typeahead).removeData(r.www).removeData(r.attr).removeClass(e.classes.input),s.length&&(t.detach().insertAfter(s),s.remove())}function g(t){var s;return(s=n.isJQuery(t)||n.isElement(t)?e(t).first():[]).length?s:null}t=e.fn.typeahead,r={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},o={initialize:function(t,o){var c;return o=n.isArray(o)?o:[].slice.call(arguments,1),c=s((t=t||{}).classNames),this.each(m);function m(){var s,m,f,v,_,y,b,S,k,I,x;n.each(o,(function(e){e.highlight=!!t.highlight})),s=e(this),m=e(c.html.wrapper),f=g(t.hint),v=g(t.menu),_=!1!==t.hint&&!f,y=!1!==t.menu&&!v,_&&(f=h(s,c)),y&&(v=e(c.html.menu).css(c.css.menu)),f&&f.val(""),s=p(s,c),(_||y)&&(m.css(c.css.wrapper),s.css(_?c.css.input:c.css.inputWithNoHint),s.wrap(m).parent().prepend(_?f:null).append(y?v:null)),x=y?l:u,b=new i({el:s}),S=new a({hint:f,input:s},c),k=new x({node:v,datasets:o},c),I=new d({input:S,menu:k,eventBus:b,minLength:t.minLength},c),s.data(r.www,c),s.data(r.typeahead,I)}},isEnabled:function(){var t;return c(this.first(),(function(e){t=e.isEnabled()})),t},enable:function(){return c(this,(function(t){t.enable()})),this},disable:function(){return c(this,(function(t){t.disable()})),this},isActive:function(){var t;return c(this.first(),(function(e){t=e.isActive()})),t},activate:function(){return c(this,(function(t){t.activate()})),this},deactivate:function(){return c(this,(function(t){t.deactivate()})),this},isOpen:function(){var t;return c(this.first(),(function(e){t=e.isOpen()})),t},open:function(){return c(this,(function(t){t.open()})),this},close:function(){return c(this,(function(t){t.close()})),this},select:function(t){var n=!1,s=e(t);return c(this.first(),(function(t){n=t.select(s)})),n},autocomplete:function(t){var n=!1,s=e(t);return c(this.first(),(function(t){n=t.autocomplete(s)})),n},moveCursor:function(t){var e=!1;return c(this.first(),(function(n){e=n.moveCursor(t)})),e},val:function(t){var e;return arguments.length?(c(this,(function(e){e.setVal(t)})),this):(c(this.first(),(function(t){e=t.getVal()})),e)},destroy:function(){return c(this,(function(t,e){f(e),t.destroy()})),this}},e.fn.typeahead=function(t){return o[t]?o[t].apply(this,[].slice.call(arguments,1)):o.initialize.apply(this,arguments)},e.fn.typeahead.noConflict=function(){return e.fn.typeahead=t,this}}();var e,n,s,i,r,o,a,c,u,l,d}.apply(e,s),void 0===i||(t.exports=i)},9567:t=>{"use strict";t.exports=window.jQuery}},e={};function n(s){var i=e[s];if(void 0!==i)return i.exports;var r=e[s]={exports:{}};return t[s].call(r.exports,r,r.exports,n),r.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var s in e)n.o(e,s)&&!n.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};(()=>{"use strict";n.r(s); /** * Copyright since 2007 PrestaShop SA and Contributors * PrestaShop is an International Registered Trademark & Property of PrestaShop SA * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.md. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/OSL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to https://devdocs.prestashop.com/ for more information. * * @author PrestaShop SA and Contributors * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ class t{constructor(t,e){this.currencySymbolSelect=t,this.callbackChange=e,this.init()}init(){const t=document.querySelector(this.currencySymbolSelect);t&&(this.callbackChange(this.getSymbol(t)),t.addEventListener("change",(()=>this.callbackChange(this.getSymbol(t)))))}getSymbol(t){var e,n;const s=null!=(e=t.dataset.defaultCurrencySymbol)?e:"",i=t.item(t.selectedIndex);return i&&null!=(n=i.getAttribute("symbol"))?n:s}} /** * Copyright since 2007 PrestaShop SA and Contributors * PrestaShop is an International Registered Trademark & Property of PrestaShop SA * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.md. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/OSL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to https://devdocs.prestashop.com/ for more information. * * @author PrestaShop SA and Contributors * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */const e="#specific_price_product_id",i='form[name="specific_price"]',r="#specific_price_groups_currency_id",o="#specific_price_customer",a=".js-fixed-price-row .input-group.money-type .input-group-append .input-group-text, .js-fixed-price-row .input-group.money-type .input-group-prepend .input-group-text",c="#specific_price_impact_reduction_type",u=".price-reduction-value .input-group .input-group-append .input-group-text, .price-reduction-value .input-group .input-group-prepend .input-group-text",l=".js-include-tax-row",d="#specific_price_customer_list .entity-item",h="#specific_price_groups_shop_id",p="#specific_price_combination_id",m="switchSpecificPriceCustomer",{$:f}=window;class g{constructor(t,e,n,s){this.$reductionTypeSelector=f(t),this.$taxInclusionInputs=f(e),this.currencySymbolSelect=n,this.reductionAmountSymbolSelector=s,this.handle(),this.$reductionTypeSelector.on("change",(()=>this.handle()))}handle(){const t="percentage"===this.$reductionTypeSelector.val();if(t?this.$taxInclusionInputs.fadeOut():this.$taxInclusionInputs.fadeIn(),""!==this.reductionAmountSymbolSelector){const e=document.querySelectorAll(this.reductionAmountSymbolSelector);e.length&&e.forEach((e=>{e.innerHTML=t?"%":this.getSymbol(e.innerHTML)}))}}getSymbol(t){var e,n;const s=document.querySelector(this.currencySymbolSelect);if(!s)return t;const i=null!=(e=s.dataset.defaultCurrencySymbol)?e:"",r=s.item(s.selectedIndex);return r&&null!=(n=r.getAttribute("symbol"))?n:i}} /** * Copyright since 2007 PrestaShop SA and Contributors * PrestaShop is an International Registered Trademark & Property of PrestaShop SA * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.md. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/OSL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to https://devdocs.prestashop.com/ for more information. * * @author PrestaShop SA and Contributors * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ const{$:v}=window;class _{constructor(t,e){this.router=t,this.productId=e,this.container=document.querySelector(i),this.shopId=null,this.initComponent()}initComponent(){return t=this,e=null,n=function*(){const t=v(p),e=this,n=t.data("minimum-results-for-search");t.select2({minimumResultsForSearch:n,ajax:{url:()=>this.getUrl(n),dataType:"json",type:"GET",delay:250,data:t=>({q:t.term}),processResults(t){const n=e.getChoiceForAllCombinations(),s=[{id:n.combinationId,text:n.combinationName}];return s.push(...t.combinations.map((t=>({id:t.combinationId,text:t.combinationName})))),{results:s}}}})},new Promise(((s,i)=>{var r=t=>{try{a(n.next(t))}catch(t){i(t)}},o=t=>{try{a(n.throw(t))}catch(t){i(t)}},a=t=>t.done?s(t.value):Promise.resolve(t.value).then(r,o);a((n=n.apply(t,e)).next())}));var t,e,n}getUrl(t){const e={productId:this.productId,limit:t},n=this.container.querySelector(h);let s=null;return null!==n&&(s=Number(n.value)),s&&(e.shopId=s),this.router.generate("admin_products_search_product_combinations",e)}getChoiceForAllCombinations(){const t=this.container.querySelector(p);return{combinationId:Number(t.dataset.allCombinationsValue),combinationName:String(t.dataset.allCombinationsLabel)}}}var y=n(2564),b=n.n(y);const S=JSON.parse('{"base_url":"","routes":{"admin_common_notifications":{"tokens":[["text","/common/notifications"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_product_form":{"tokens":[["variable","/","\\\\d+","id"],["text","/sell/catalog/products"]],"defaults":[],"requirements":{"id":"\\\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_feature_get_feature_values":{"tokens":[["variable","/","\\\\d+","idFeature"],["text","/sell/catalog/products/features"]],"defaults":{"idFeature":0},"requirements":{"idFeature":"\\\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_products_combinations":{"tokens":[["text","/combinations"],["variable","/","[^/]++","productId"],["text","/sell/catalog/products-v2"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_products_combinations_ids":{"tokens":[["text","/combinations/ids"],["variable","/","[^/]++","productId"],["text","/sell/catalog/products-v2"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_products_combinations_update_combination_from_listing":{"tokens":[["text","/update-combination-from-listing"],["variable","/","[^/]++","productId"],["text","/sell/catalog/products-v2/combinations"]],"defaults":[],"requirements":{"combinationId":"\\\\d+"},"hosttokens":[],"methods":["PATCH"],"schemes":[]},"admin_products_combinations_edit_combination":{"tokens":[["text","/edit"],["variable","/","\\\\d+","combinationId"],["text","/sell/catalog/products-v2/combinations"]],"defaults":[],"requirements":{"combinationId":"\\\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_products_combinations_bulk_edit_combination":{"tokens":[["text","/combinations/bulk-edit"],["variable","/","\\\\d+","productId"],["text","/sell/catalog/products-v2"]],"defaults":[],"requirements":{"productId":"\\\\d+"},"hosttokens":[],"methods":["PATCH"],"schemes":[]},"admin_products_combinations_delete_combination":{"tokens":[["variable","/","\\\\d+","shopId"],["text","/delete"],["variable","/","\\\\d+","combinationId"],["text","/sell/catalog/products-v2/combinations"]],"defaults":{"shopId":null},"requirements":{"combinationId":"\\\\d+","shopId":"\\\\d+"},"hosttokens":[],"methods":["DELETE"],"schemes":[]},"admin_products_combinations_bulk_delete":{"tokens":[["variable","/","\\\\d+","shopId"],["text","/combinations/bulk-delete"],["variable","/","\\\\d+","productId"],["text","/sell/catalog/products-v2"]],"defaults":{"shopId":null},"requirements":{"productId":"\\\\d+","shopId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_attribute_groups":{"tokens":[["variable","/","\\\\d+","shopId"],["text","/attribute-groups"],["variable","/","[^/]++","productId"],["text","/sell/catalog/products-v2"]],"defaults":{"shopId":null},"requirements":{"shopId":"\\\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_all_attribute_groups":{"tokens":[["variable","/","\\\\d+","shopId"],["text","/sell/catalog/products-v2/all-attribute-groups"]],"defaults":{"shopId":null},"requirements":{"shopId":"\\\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_products_combinations_generate":{"tokens":[["variable","/","\\\\d+","shopId"],["variable","/","\\\\d+","productId"],["text","/sell/catalog/products-v2/generate-combinations"]],"defaults":{"shopId":null},"requirements":{"productId":"\\\\d+","shopId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_images_for_shop":{"tokens":[["variable","/","\\\\d+","shopId"],["text","/images-for-shop"],["variable","/","\\\\d+","productId"],["text","/sell/catalog/products-v2"]],"defaults":[],"requirements":{"productId":"\\\\d+","shopId":"\\\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_products_product_shop_images":{"tokens":[["text","/shopImages"],["variable","/","\\\\d+","productId"],["text","/sell/catalog/products-v2"]],"defaults":[],"requirements":{"productId":"\\\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_products_add_image":{"tokens":[["text","/sell/catalog/products-v2/images/add"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_update_image":{"tokens":[["text","/update"],["variable","/","\\\\d+","productImageId"],["text","/sell/catalog/products-v2/images"]],"defaults":[],"requirements":{"productImageId":"\\\\d+"},"hosttokens":[],"methods":["PATCH"],"schemes":[]},"admin_products_delete_image":{"tokens":[["text","/delete"],["variable","/","\\\\d+","productImageId"],["text","/sell/catalog/products-v2/images"]],"defaults":[],"requirements":{"productImageId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_specific_prices_list":{"tokens":[["text","/specific-prices/list"],["variable","/","\\\\d+","productId"],["text","/sell/catalog/products-v2"]],"defaults":[],"requirements":{"productId":"\\\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_products_specific_prices_create":{"tokens":[["text","/specific-prices/create"],["variable","/","\\\\d+","productId"],["text","/sell/catalog/products-v2"]],"defaults":[],"requirements":{"productId":"\\\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_products_specific_prices_edit":{"tokens":[["text","/edit"],["variable","/","\\\\d+","specificPriceId"],["text","/sell/catalog/products-v2/specific-prices"]],"defaults":[],"requirements":{"specificPriceId":"\\\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_products_specific_prices_delete":{"tokens":[["text","/delete"],["variable","/","\\\\d+","specificPriceId"],["text","/sell/catalog/products-v2/specific-prices"]],"defaults":[],"requirements":{"specificPriceId":"\\\\d+"},"hosttokens":[],"methods":["DELETE"],"schemes":[]},"admin_products_edit":{"tokens":[["text","/edit"],["variable","/","\\\\d+","productId"],["text","/sell/catalog/products-v2"]],"defaults":[],"requirements":{"productId":"\\\\d+"},"hosttokens":[],"methods":["GET","POST","PATCH"],"schemes":[]},"admin_products_select_shops":{"tokens":[["text","/shops"],["variable","/","\\\\d+","productId"],["text","/sell/catalog/products-v2"]],"defaults":[],"requirements":{"productId":"\\\\d+"},"hosttokens":[],"methods":["GET","POST","PATCH"],"schemes":[]},"admin_products_bulk_enable_all_shops":{"tokens":[["text","/sell/catalog/products-v2/bulk-enable-all-shops"]],"defaults":[],"requirements":{"productId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_bulk_enable_shop":{"tokens":[["variable","/","\\\\d+","shopId"],["text","/sell/catalog/products-v2/bulk-enable-shop"]],"defaults":[],"requirements":{"productId":"\\\\d+","shopId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_bulk_enable_shop_group":{"tokens":[["variable","/","\\\\d+","shopGroupId"],["text","/sell/catalog/products-v2/bulk-enable-shop-group"]],"defaults":[],"requirements":{"productId":"\\\\d+","shopGroupId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_bulk_disable_all_shops":{"tokens":[["text","/sell/catalog/products-v2/bulk-disable-for-all-shops"]],"defaults":[],"requirements":{"productId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_bulk_disable_shop":{"tokens":[["variable","/","\\\\d+","shopId"],["text","/sell/catalog/products-v2/bulk-disable-shop"]],"defaults":[],"requirements":{"productId":"\\\\d+","shopId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_bulk_disable_shop_group":{"tokens":[["variable","/","\\\\d+","shopGroupId"],["text","/sell/catalog/products-v2/bulk-disable-shop-group"]],"defaults":[],"requirements":{"productId":"\\\\d+","shopGroupId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_bulk_duplicate_all_shops":{"tokens":[["text","/sell/catalog/products-v2/bulk-duplicate-all-shops"]],"defaults":[],"requirements":{"productId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_bulk_duplicate_shop":{"tokens":[["variable","/","\\\\d+","shopId"],["text","/sell/catalog/products-v2/bulk-duplicate-shop"]],"defaults":[],"requirements":{"productId":"\\\\d+","shopId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_bulk_duplicate_shop_group":{"tokens":[["variable","/","\\\\d+","shopGroupId"],["text","/sell/catalog/products-v2/bulk-duplicate-shop-group"]],"defaults":[],"requirements":{"productId":"\\\\d+","shopGroupId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_bulk_delete_from_all_shops":{"tokens":[["text","/sell/catalog/products-v2/bulk-delete-from-all-shops"]],"defaults":[],"requirements":{"productId":"\\\\d+"},"hosttokens":[],"methods":["POST","DELETE"],"schemes":[]},"admin_products_bulk_delete_from_shop":{"tokens":[["variable","/","\\\\d+","shopId"],["text","/sell/catalog/products-v2/bulk-delete-from-shop"]],"defaults":[],"requirements":{"productId":"\\\\d+","shopId":"\\\\d+"},"hosttokens":[],"methods":["POST","DELETE"],"schemes":[]},"admin_products_bulk_delete_from_shop_group":{"tokens":[["variable","/","\\\\d+","shopGroupId"],["text","/sell/catalog/products-v2/bulk-delete-from-shop-group"]],"defaults":[],"requirements":{"productId":"\\\\d+","shopGroupId":"\\\\d+"},"hosttokens":[],"methods":["POST","DELETE"],"schemes":[]},"admin_products_search_product_combinations":{"tokens":[["variable","/","\\\\d+","languageId"],["variable","/","\\\\d+","shopId"],["text","/search-product-combinations"],["variable","/","\\\\d+","productId"],["text","/sell/catalog/products-v2"]],"defaults":{"languageId":null,"shopId":null},"requirements":{"productId":"\\\\d+","shopId":"\\\\d+","languageId":"\\\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_products_quantity":{"tokens":[["variable","/","\\\\d+","shopId"],["text","/quantity"],["variable","/","\\\\d+","productId"],["text","/sell/catalog/products-v2"]],"defaults":[],"requirements":{"productId":"\\\\d+","shopId":"\\\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_categories_get_categories_tree":{"tokens":[["text","/sell/catalog/categories/tree"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_catalog_price_rules_list_for_product":{"tokens":[["variable","/","[^/]++","productId"],["text","/sell/catalog/catalog-price-rules/list-for-product"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_cart_rules_search":{"tokens":[["text","/sell/catalog/cart-rules/search"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_customers_view":{"tokens":[["text","/view"],["variable","/","\\\\d+","customerId"],["text","/sell/customers"]],"defaults":[],"requirements":{"customerId":"\\\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_customers_search":{"tokens":[["text","/sell/customers/search"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_customers_carts":{"tokens":[["text","/carts"],["variable","/","\\\\d+","customerId"],["text","/sell/customers"]],"defaults":[],"requirements":{"customerId":"\\\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_customers_orders":{"tokens":[["text","/orders"],["variable","/","\\\\d+","customerId"],["text","/sell/customers"]],"defaults":[],"requirements":{"customerId":"\\\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_addresses_create":{"tokens":[["text","/sell/addresses/new"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_addresses_edit":{"tokens":[["text","/edit"],["variable","/","\\\\d+","addressId"],["text","/sell/addresses"]],"defaults":[],"requirements":{"addressId":"\\\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_order_addresses_edit":{"tokens":[["text","/edit"],["variable","/","delivery|invoice","addressType"],["variable","/","\\\\d+","orderId"],["text","/sell/addresses/order"]],"defaults":[],"requirements":{"orderId":"\\\\d+","addressType":"delivery|invoice"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_cart_addresses_edit":{"tokens":[["text","/edit"],["variable","/","delivery|invoice","addressType"],["variable","/","\\\\d+","cartId"],["text","/sell/addresses/cart"]],"defaults":[],"requirements":{"cartId":"\\\\d+","addressType":"delivery|invoice"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_customer_threads_view":{"tokens":[["text","/view"],["variable","/","\\\\d+","customerThreadId"],["text","/sell/customer-service/customer-threads"]],"defaults":[],"requirements":{"customerThreadId":"\\\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_carts_view":{"tokens":[["text","/view"],["variable","/","\\\\d+","cartId"],["text","/sell/orders/carts"]],"defaults":[],"requirements":{"cartId":"\\\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_carts_info":{"tokens":[["text","/info"],["variable","/","\\\\d+","cartId"],["text","/sell/orders/carts"]],"defaults":[],"requirements":{"cartId":"\\\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_carts_create":{"tokens":[["text","/sell/orders/carts/new"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_edit_addresses":{"tokens":[["text","/addresses"],["variable","/","\\\\d+","cartId"],["text","/sell/orders/carts"]],"defaults":[],"requirements":{"cartId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_edit_carrier":{"tokens":[["text","/carrier"],["variable","/","\\\\d+","cartId"],["text","/sell/orders/carts"]],"defaults":[],"requirements":{"cartId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_edit_currency":{"tokens":[["text","/currency"],["variable","/","\\\\d+","cartId"],["text","/sell/orders/carts"]],"defaults":[],"requirements":{"cartId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_edit_language":{"tokens":[["text","/language"],["variable","/","\\\\d+","cartId"],["text","/sell/orders/carts"]],"defaults":[],"requirements":{"cartId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_set_delivery_settings":{"tokens":[["text","/rules/delivery-settings"],["variable","/","\\\\d+","cartId"],["text","/sell/orders/carts"]],"defaults":[],"requirements":{"cartId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_add_cart_rule":{"tokens":[["text","/cart-rules"],["variable","/","[^/]++","cartId"],["text","/sell/orders/carts"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_delete_cart_rule":{"tokens":[["text","/delete"],["variable","/","[^/]++","cartRuleId"],["text","/cart-rules"],["variable","/","[^/]++","cartId"],["text","/sell/orders/carts"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_add_product":{"tokens":[["text","/products"],["variable","/","\\\\d+","cartId"],["text","/sell/orders/carts"]],"defaults":[],"requirements":{"cartId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_edit_product_price":{"tokens":[["text","/price"],["variable","/","\\\\d+","productId"],["text","/products"],["variable","/","\\\\d+","cartId"],["text","/sell/orders/carts"]],"defaults":[],"requirements":{"cartId":"\\\\d+","productId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_edit_product_quantity":{"tokens":[["text","/quantity"],["variable","/","\\\\d+","productId"],["text","/products"],["variable","/","\\\\d+","cartId"],["text","/sell/orders/carts"]],"defaults":[],"requirements":{"cartId":"\\\\d+","productId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_delete_product":{"tokens":[["text","/delete-product"],["variable","/","\\\\d+","cartId"],["text","/sell/orders/carts"]],"defaults":[],"requirements":{"cartId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_place":{"tokens":[["text","/sell/orders/place"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_view":{"tokens":[["text","/view"],["variable","/","\\\\d+","orderId"],["text","/sell/orders"]],"defaults":[],"requirements":{"orderId":"\\\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_orders_duplicate_cart":{"tokens":[["text","/duplicate-cart"],["variable","/","\\\\d+","orderId"],["text","/sell/orders"]],"defaults":[],"requirements":{"orderId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_update_product":{"tokens":[["variable","/","\\\\d+","orderDetailId"],["text","/products"],["variable","/","\\\\d+","orderId"],["text","/sell/orders"]],"defaults":[],"requirements":{"orderId":"\\\\d+","orderDetailId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_partial_refund":{"tokens":[["text","/partial-refund"],["variable","/","\\\\d+","orderId"],["text","/sell/orders"]],"defaults":[],"requirements":{"orderId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_standard_refund":{"tokens":[["text","/standard-refund"],["variable","/","\\\\d+","orderId"],["text","/sell/orders"]],"defaults":[],"requirements":{"orderId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_return_product":{"tokens":[["text","/return-product"],["variable","/","\\\\d+","orderId"],["text","/sell/orders"]],"defaults":[],"requirements":{"orderId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_send_process_order_email":{"tokens":[["text","/sell/orders/process-order-email"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_add_product":{"tokens":[["text","/products"],["variable","/","\\\\d+","orderId"],["text","/sell/orders"]],"defaults":[],"requirements":{"orderId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_delete_product":{"tokens":[["text","/delete"],["variable","/","\\\\d+","orderDetailId"],["text","/products"],["variable","/","\\\\d+","orderId"],["text","/sell/orders"]],"defaults":[],"requirements":{"orderId":"\\\\d+","orderDetailId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_get_discounts":{"tokens":[["text","/discounts"],["variable","/","\\\\d+","orderId"],["text","/sell/orders"]],"defaults":[],"requirements":{"orderId":"\\\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_get_prices":{"tokens":[["text","/prices"],["variable","/","\\\\d+","orderId"],["text","/sell/orders"]],"defaults":[],"requirements":{"orderId":"\\\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_get_payments":{"tokens":[["text","/payments"],["variable","/","\\\\d+","orderId"],["text","/sell/orders"]],"defaults":[],"requirements":{"orderId":"\\\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_get_products":{"tokens":[["text","/products"],["variable","/","\\\\d+","orderId"],["text","/sell/orders"]],"defaults":[],"requirements":{"orderId":"\\\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_get_invoices":{"tokens":[["text","/invoices"],["variable","/","\\\\d+","orderId"],["text","/sell/orders"]],"defaults":[],"requirements":{"orderId":"\\\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_get_documents":{"tokens":[["text","/documents"],["variable","/","\\\\d+","orderId"],["text","/sell/orders"]],"defaults":[],"requirements":{"orderId":"\\\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_get_shipping":{"tokens":[["text","/shipping"],["variable","/","\\\\d+","orderId"],["text","/sell/orders"]],"defaults":[],"requirements":{"orderId":"\\\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_cancellation":{"tokens":[["text","/cancellation"],["variable","/","\\\\d+","orderId"],["text","/sell/orders"]],"defaults":[],"requirements":{"orderId":"\\\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_configure_product_pagination":{"tokens":[["text","/sell/orders/configure-product-pagination"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_product_prices":{"tokens":[["text","/products/prices"],["variable","/","\\\\d+","orderId"],["text","/sell/orders"]],"defaults":[],"requirements":{"orderId":"\\\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_products_search":{"tokens":[["text","/sell/orders/products/search"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_attachments_attachment_info":{"tokens":[["text","/info"],["variable","/","\\\\d+","attachmentId"],["text","/sell/attachments"]],"defaults":[],"requirements":{"attachmentId":"\\\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_attachments_search":{"tokens":[["variable","/","[^/]++","searchPhrase"],["text","/sell/attachments/search"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_shops_search":{"tokens":[["variable","/","[^/]++","searchTerm"],["text","/configure/advanced/shops/search"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]}},"prefix":"","host":"localhost","port":"","scheme":"http","locale":""}'),{$:k}=window;class I{constructor(){window.prestashop&&window.prestashop.customRoutes&&Object.assign(S.routes,window.prestashop.customRoutes),b().setData(S),b().setBaseUrl(k(document).find("body").data("base-url"))}generate(t,e={}){const n=Object.assign(e,{_token:k(document).find("body").data("token")});return b().generate(t,n)}}var x=Object.defineProperty,w=Object.getOwnPropertySymbols,T=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable,O=(t,e,n)=>e in t?x(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,E=(t,e)=>{for(var n in e||(e={}))T.call(e,n)&&O(t,n,e[n]);if(w)for(var n of w(e))C.call(e,n)&&O(t,n,e[n]);return t}; /** * Copyright since 2007 PrestaShop SA and Contributors * PrestaShop is an International Registered Trademark & Property of PrestaShop SA * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.md. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/OSL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to https://devdocs.prestashop.com/ for more information. * * @author PrestaShop SA and Contributors * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ class q{constructor(t,e){this.$searchInput=t,this.searchInputId=this.$searchInput.prop("id");const n={suggestion:t=>{let e=t;return"function"==typeof this.config.display?e=this.config.display(t):Object.prototype.hasOwnProperty.call(t,this.config.display)&&(e=t[this.config.display]),`
${e}
`},pending:t=>`
Searching for "${t.query}"
`,notFound:t=>`
No results found for "${t.query}"
`};this.config=E({minLength:2,highlight:!0,hint:!1,onSelect:(t,e,n)=>(n.typeahead("val",t[this.config.value]),!0),onClose:(t,e)=>(e.typeahead("val",""),!0),suggestionLimit:30,dataLimit:0,display:"name",value:"id",templates:n},e),Object.prototype.hasOwnProperty.call(e,"templates")&&(this.config.templates=E(E({},n),e.templates)),this.buildTypeahead()}buildTypeahead(){const t={minLength:this.config.minLength,highlight:this.config.highlight,hint:this.config.hint,onSelect:this.config.onSelect,onClose:this.config.onClose},e={source:this.config.source,display:this.config.display,value:this.config.value,limit:this.config.suggestionLimit,dataLimit:this.config.dataLimit,templates:this.config.templates};this.$searchInput.typeahead(t,e).bind("typeahead:select",((t,e)=>this.config.onSelect(e,t,this.$searchInput))).bind("typeahead:close",(t=>{this.config.onClose(t,this.$searchInput)}))}}var $=n(9567),A=Object.defineProperty,P=Object.getOwnPropertySymbols,L=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,D=(t,e,n)=>e in t?A(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,j=(t,e)=>{for(var n in e||(e={}))L.call(e,n)&&D(t,n,e[n]);if(P)for(var n of P(e))R.call(e,n)&&D(t,n,e[n]);return t}; /** * Copyright since 2007 PrestaShop SA and Contributors * PrestaShop is an International Registered Trademark & Property of PrestaShop SA * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.md. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/OSL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to https://devdocs.prestashop.com/ for more information. * * @author PrestaShop SA and Contributors * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ class B{constructor(t){const e=j({id:"confirm-modal",closable:!1},t);this.buildModalContainer(e)}buildModalContainer(t){this.container=document.createElement("div"),this.container.classList.add("modal","fade"),this.container.id=t.id,this.dialog=document.createElement("div"),this.dialog.classList.add("modal-dialog"),t.dialogStyle&&Object.keys(t.dialogStyle).forEach((e=>{this.dialog.style[e]=t.dialogStyle[e]})),this.content=document.createElement("div"),this.content.classList.add("modal-content"),this.message=document.createElement("p"),this.message.classList.add("modal-message"),this.header=document.createElement("div"),this.header.classList.add("modal-header"),t.modalTitle&&(this.title=document.createElement("h4"),this.title.classList.add("modal-title"),this.title.innerHTML=t.modalTitle),this.closeIcon=document.createElement("button"),this.closeIcon.classList.add("close"),this.closeIcon.setAttribute("type","button"),this.closeIcon.dataset.dismiss="modal",this.closeIcon.innerHTML="×",this.body=document.createElement("div"),this.body.classList.add("modal-body","text-left","font-weight-normal"),this.title&&this.header.appendChild(this.title),this.header.appendChild(this.closeIcon),this.content.append(this.header,this.body),this.body.appendChild(this.message),this.dialog.appendChild(this.content),this.container.appendChild(this.dialog)}}class M{constructor(t){const e=j({id:"confirm-modal",closable:!1,dialogStyle:{}},t);this.initContainer(e)}initContainer(t){this.modal||(this.modal=new B(t)),this.$modal=$(this.modal.container);const{id:e,closable:n}=t;this.$modal.modal({backdrop:!!n||"static",keyboard:void 0===n||n,show:!1}),this.$modal.on("hidden.bs.modal",(()=>{const n=document.querySelector(`#${e}`);n&&n.remove(),t.closeCallback&&t.closeCallback()})),document.body.appendChild(this.modal.container)}setTitle(t){return this.modal.title||(this.modal.title=document.createElement("h4"),this.modal.title.classList.add("modal-title"),this.modal.closeIcon?this.modal.header.insertBefore(this.modal.title,this.modal.closeIcon):this.modal.header.appendChild(this.modal.title)),this.modal.title.innerHTML=t,this}render(t){return this.modal.message.innerHTML=t,this}show(){return this.$modal.modal("show"),this}hide(){return this.$modal.modal("hide"),this.$modal.on("shown.bs.modal",(()=>{this.$modal.modal("hide"),this.$modal.off("shown.bs.modal")})),this}} /** * Copyright since 2007 PrestaShop SA and Contributors * PrestaShop is an International Registered Trademark & Property of PrestaShop SA * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.md. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/OSL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to https://devdocs.prestashop.com/ for more information. * * @author PrestaShop SA and Contributors * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ function F(t){return void 0===t}var G=Object.defineProperty,z=Object.getOwnPropertySymbols,H=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,K=(t,e,n)=>e in t?G(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n; /** * Copyright since 2007 PrestaShop SA and Contributors * PrestaShop is an International Registered Trademark & Property of PrestaShop SA * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.md. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/OSL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to https://devdocs.prestashop.com/ for more information. * * @author PrestaShop SA and Contributors * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ class Q extends B{constructor(t){super(t)}buildModalContainer(t){super.buildModalContainer(t),this.message.classList.add("confirm-message"),this.message.innerHTML=t.confirmMessage,this.footer=document.createElement("div"),this.footer.classList.add("modal-footer"),this.closeButton=document.createElement("button"),this.closeButton.setAttribute("type","button"),this.closeButton.classList.add("btn","btn-outline-secondary","btn-lg"),this.closeButton.dataset.dismiss="modal",this.closeButton.innerHTML=t.closeButtonLabel,this.confirmButton=document.createElement("button"),this.confirmButton.setAttribute("type","button"),this.confirmButton.classList.add("btn",t.confirmButtonClass,"btn-lg","btn-confirm-submit"),this.confirmButton.dataset.dismiss="modal",this.confirmButton.innerHTML=t.confirmButtonLabel,this.footer.append(this.closeButton,...t.customButtons,this.confirmButton),this.content.append(this.footer)}}class V extends M{constructor(t,e,n){var s;let i;i=F(t.confirmCallback)?F(e)?()=>{console.error("No confirm callback provided for ConfirmModal component.")}:e:t.confirmCallback;super(((t,e)=>{for(var n in e||(e={}))H.call(e,n)&&K(t,n,e[n]);if(z)for(var n of z(e))N.call(e,n)&&K(t,n,e[n]);return t})({id:"confirm-modal",confirmMessage:"Are you sure?",closeButtonLabel:"Close",confirmButtonLabel:"Accept",confirmButtonClass:"btn-primary",customButtons:[],closable:!1,modalTitle:t.confirmTitle,dialogStyle:{},confirmCallback:i,closeCallback:null!=(s=t.closeCallback)?s:n},t))}initContainer(t){this.modal=new Q(t),this.modal.confirmButton.addEventListener("click",t.confirmCallback),super.initContainer(t)}}var U=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var n=-1;return t.some((function(t,s){return t[0]===e&&(n=s,!0)})),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var n=t(this.__entries__,e),s=this.__entries__[n];return s&&s[1]},e.prototype.set=function(e,n){var s=t(this.__entries__,e);~s?this.__entries__[s][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,s=t(n,e);~s&&n.splice(s,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,s=this.__entries__;n0},t.prototype.connect_=function(){W&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),X?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){W&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;Z.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),et=function(t,e){for(var n=0,s=Object.keys(e);n0},t}(),pt="undefined"!=typeof WeakMap?new WeakMap:new U,mt=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=tt.getInstance(),s=new ht(e,n,this);pt.set(this,s)};["observe","unobserve","disconnect"].forEach((function(t){mt.prototype[t]=function(){var e;return(e=pt.get(this))[t].apply(e,arguments)}}));void 0!==J.ResizeObserver&&J.ResizeObserver;const ft=class extends Event{constructor(t,e={}){super(ft.parentWindowEvent),this.eventName=t,this.eventParameters=e}get name(){return this.eventName}get parameters(){return this.eventParameters}};ft.parentWindowEvent="IframeClientEvent";Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable; /** * Copyright since 2007 PrestaShop SA and Contributors * PrestaShop is an International Registered Trademark & Property of PrestaShop SA * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.md. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/OSL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to https://devdocs.prestashop.com/ for more information. * * @author PrestaShop SA and Contributors * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */const gt=V;var vt=n(3943),_t=n.n(vt),yt=n(9567); /** * Copyright since 2007 PrestaShop SA and Contributors * PrestaShop is an International Registered Trademark & Property of PrestaShop SA * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.md. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/OSL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to https://devdocs.prestashop.com/ for more information. * * @author PrestaShop SA and Contributors * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ const bt={searchInputSelector:".entity-search-input",entitiesContainerSelector:".entities-list",listContainerSelector:".entities-list-container",entityItemSelector:".entity-item",entityDeleteSelector:".entity-item-delete",emptyStateSelector:".empty-entity-list"};class St{constructor(t,e){this.$entitySearchInputContainer=t,this.options={},this.buildOptions(e),this.$entitySearchInput=yt(this.options.searchInputSelector,this.$entitySearchInputContainer),this.$entitiesContainer=yt(this.options.entitiesContainerSelector,this.$entitySearchInputContainer),this.$listContainer=yt(this.options.listContainerSelector,this.$entitySearchInputContainer),this.$emptyState=yt(this.options.emptyStateSelector,this.$entitySearchInputContainer),this.buildRemoteSource(),this.buildAutoCompleteSearch(),this.buildActions(),this.updateEmptyState()}setValues(t){this.clearSelectedItems(),!t||t.length<=0||t.forEach(((t,e)=>{this.appendSelectedItem(e)}))}addItem(t){return this.appendSelectedItem(t)}getOption(t){return this.options[t]}setOption(t,e){this.options[t]=e,"remoteUrl"===t&&this.entityRemoteSource&&(this.entityRemoteSource.remote.url=this.options.remoteUrl)}buildOptions(t){const e=t||{},n={suggestionField:"name",prototypeTemplate:void 0,prototypeIndex:"__index__",prototypeMapping:{id:"__id__",name:"__name__",image:"__image__"},identifierField:"id",allowDelete:!0,dataLimit:0,minLength:2,remoteUrl:void 0,filterSelected:!0,filteredIdentities:[],removeModal:{id:"modal-confirm-remove-entity",title:"Delete item",message:"Are you sure you want to delete this item?",apply:"Delete",cancel:"Cancel",buttonClass:"btn-danger"},searchInputSelector:bt.searchInputSelector,entitiesContainerSelector:bt.entitiesContainerSelector,listContainerSelector:bt.listContainerSelector,entityItemSelector:bt.entityItemSelector,entityDeleteSelector:bt.entityDeleteSelector,emptyStateSelector:bt.emptyStateSelector,queryWildcard:"__QUERY__",onRemovedContent:void 0,onSelectedContent:void 0,responseTransformer:t=>t||[],suggestionTemplate:void 0,extraQueryParams:void 0};Object.keys(n).forEach((t=>{this.initOption(t,e,n[t])})),this.options.filteredIdentities=this.options.filteredIdentities.map(String)}initOption(t,e,n){Object.prototype.hasOwnProperty.call(e,t)?this.options[t]=e[t]:void 0!==this.$entitySearchInputContainer.data(t)?this.options[t]=this.$entitySearchInputContainer.data(t):this.options[t]=n}buildActions(){yt(this.$entitiesContainer).on("click",this.options.entityDeleteSelector,(t=>{if(!this.options.allowDelete)return;const e=yt(t.target).closest(this.options.entityItemSelector);new gt({id:this.options.removeModal.id,confirmTitle:this.options.removeModal.title,confirmMessage:this.options.removeModal.message,closeButtonLabel:this.options.removeModal.cancel,confirmButtonLabel:this.options.removeModal.apply,confirmButtonClass:this.options.removeModal.buttonClass,closable:!0},(()=>{e.remove(),this.updateEmptyState(),void 0!==this.options.onRemovedContent&&this.options.onRemovedContent(e)})).show()}));yt(this.options.entityDeleteSelector,this.$entitiesContainer).toggle(!!this.options.allowDelete)}buildAutoCompleteSearch(){const t={source:this.entityRemoteSource,dataLimit:this.options.dataLimit,value:this.options.identifierField,minLength:this.options.minLength,templates:{suggestion:t=>this.showSuggestion(t)},onSelect:t=>1===this.options.dataLimit?this.replaceSelectedItem(t):this.appendSelectedItem(t)};this.$entitySearchInput.length&&(this.autoSearch=new q(this.$entitySearchInput,t))}showSuggestion(t){if(!F(this.options.suggestionTemplate))return this.options.suggestionTemplate(t);let e="";return Object.prototype.hasOwnProperty.call(t,"image")&&(e=` `),`
${e}${t[this.options.suggestionField]}
`}buildRemoteSource(){this.entityRemoteSource=new(_t())({datumTokenizer:_t().tokenizers.whitespace,queryTokenizer:_t().tokenizers.whitespace,identify(t){return t[this.options.identifierField]},remote:{url:this.options.remoteUrl,replace:(t,e)=>{const n=t.replace(this.options.queryWildcard,e);if(!F(this.options.extraQueryParams)){const t=this.options.extraQueryParams();return`${n}&${Object.keys(t).map((e=>`${e}=${encodeURIComponent(t[e])}`)).join("&")}`}return n},cache:!1,transform:t=>{if(!t)return[];const e=this.options.responseTransformer(t),n=this.getSelectedIds(),s=[];return e.forEach((t=>{const e=String(t[this.options.identifierField]),i=this.options.filterSelected&&n.includes(e),r=this.options.filteredIdentities.includes(e);i||r||s.push(t)})),s}}})}clearSelectedItems(){this.$entitiesContainer.empty(),this.updateEmptyState()}replaceSelectedItem(t){return this.clearSelectedItems(),this.addSelectedContentToContainer(t),!0}appendSelectedItem(t){const e=yt(this.options.entityItemSelector,this.$entitiesContainer);return!(0!==this.options.dataLimit&&e.length>=this.options.dataLimit)&&(this.addSelectedContentToContainer(t),!0)}updateEmptyState(){const t=yt(this.options.entityItemSelector,this.$entitiesContainer);this.$emptyState.toggle(0===t.length),this.$listContainer.toggle(0!==t.length)}addSelectedContentToContainer(t){const e=yt(this.options.entityItemSelector,this.$entitiesContainer),n=e.length?this.getIndexFromItem(e.last())+1:0,s=this.renderSelected(t,n),i=yt(s);yt(this.options.entityDeleteSelector,i).toggle(!!this.options.allowDelete),this.$entitiesContainer.append(i),void 0!==this.options.onSelectedContent&&this.options.onSelectedContent(i,t),this.updateEmptyState()}getIndexFromItem(t){let e=t.index();const n=`\\[(\\d+)\\]\\[${this.options.identifierField}\\]`;return t.find("input").each(((t,s)=>{const i=s.name.match(n);if(i&&i.length>0){const t=parseInt(i[1],10);Number.isNaN(t)||(e=t)}})),e}renderSelected(t,e){let n=this.options.prototypeTemplate.replace(new RegExp(this.options.prototypeIndex,"g"),String(e));return Object.keys(this.options.prototypeMapping).forEach((e=>{const s=t[e]||"";n=n.replace(new RegExp(this.options.prototypeMapping[e],"g"),s)})),n}getSelectedIds(){const t=[];return yt(this.options.entityItemSelector,this.$entitiesContainer).each(((e,n)=>{const s=`\\[${this.options.identifierField}\\]`;yt(n).find("input").each(((e,n)=>{n.name.match(s)&&t.push(n.value)}))})),t}}var kt=n(9567),It=Object.defineProperty,xt=Object.defineProperties,wt=Object.getOwnPropertyDescriptors,Tt=Object.getOwnPropertySymbols,Ct=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable,Et=(t,e,n)=>e in t?It(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n; /** * Copyright since 2007 PrestaShop SA and Contributors * PrestaShop is an International Registered Trademark & Property of PrestaShop SA * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.md. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/OSL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to https://devdocs.prestashop.com/ for more information. * * @author PrestaShop SA and Contributors * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ class qt{constructor(){this.init()}init(){let t={responseTransformer:t=>t&&0!==t.customers.length?Object.values(t.customers):[]};if(null!==this.getShopIdSelect()){e=((t,e)=>{for(var n in e||(e={}))Ct.call(e,n)&&Et(t,n,e[n]);if(Tt)for(var n of Tt(e))Ot.call(e,n)&&Et(t,n,e[n]);return t})({},t),t=xt(e,wt({extraQueryParams:()=>{var t;return{shopId:null!=(t=Number(this.getShopIdSelect().value))?t:null}}}));const n=this.initCustomerSearchInput(t);this.getShopIdSelect().addEventListener("change",(()=>n.setValues([])))}else this.initCustomerSearchInput(t);var e}initCustomerSearchInput(t){return new St(kt(o),t)}getShopIdSelect(){return document.querySelector(`${i} ${h}`)}} /** * Copyright since 2007 PrestaShop SA and Contributors * PrestaShop is an International Registered Trademark & Property of PrestaShop SA * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.md. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/OSL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to https://devdocs.prestashop.com/ for more information. * * @author PrestaShop SA and Contributors * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ const{$:$t}=window;$t((()=>{window.prestashop.component.initComponents(["EventEmitter","DisablingSwitch","DateRange"]);const{eventEmitter:n}=window.prestashop.instance;new t(r,(t=>{if(""===t)return;const e=document.querySelectorAll(a);e.length&&e.forEach((e=>{e.innerHTML=t}));const n=document.querySelector(c);if(n){for(let e=0;e{e.innerHTML=t}))}}})),new g(c,l,r,u),new qt,n.on(m,(t=>{$t(d).toggleClass("disabled",t.disable)})),new _(new I,Number($t(e).val()))}))})(),window.specific_price_form=s})();