Current Path : /var/www/www-root/data/www/monolith-realty.ru/bitrix/js/location/widget/dist/ |
Current File : /var/www/www-root/data/www/monolith-realty.ru/bitrix/js/location/widget/dist/widget.bundle.min.js |
this.BX=this.BX||{};this.BX.Location=this.BX.Location||{};(function(e,t,s,i,a,l,r,n,d,o,b){"use strict";var c=function e(){babelHelpers.classCallCheck(this,e)};babelHelpers.defineProperty(c,"INITIAL","INITIAL");babelHelpers.defineProperty(c,"DATA_INPUTTING","DATA_INPUTTING");babelHelpers.defineProperty(c,"DATA_SELECTED","DATA_SELECTED");babelHelpers.defineProperty(c,"DATA_SUPPOSED","DATA_SUPPOSED");babelHelpers.defineProperty(c,"DATA_LOADING","DATA_LOADING");babelHelpers.defineProperty(c,"DATA_LOADED","DATA_LOADED");var u,p;function h(e,t){f(e,t);t.add(e)}function v(e,t,s){f(e,t);t.set(e,s)}function f(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function H(e,t,s){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return s}var F=new WeakMap;var P=new WeakMap;var m=new WeakMap;var g=new WeakMap;var T=new WeakSet;var w=function(){function e(t){babelHelpers.classCallCheck(this,e);h(this,T);v(this,F,{writable:true,value:void 0});v(this,P,{writable:true,value:void 0});v(this,m,{writable:true,value:void 0});v(this,g,{writable:true,value:void 0});if(!(t.addressFormat instanceof n.Format)){throw new Error("addressFormat must be instance of Format")}babelHelpers.classPrivateFieldSet(this,g,t.addressFormat)}babelHelpers.createClass(e,[{key:"render",value:function e(t){babelHelpers.classPrivateFieldSet(this,F,t.address);var s=H(this,T,y).call(this,babelHelpers.classPrivateFieldGet(this,F));babelHelpers.classPrivateFieldSet(this,m,b.Tag.render(u||(u=babelHelpers.taggedTemplateLiteral(['<div class="location-map-address-text">',"</div>"])),s));babelHelpers.classPrivateFieldSet(this,P,b.Tag.render(p||(p=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div class="location-map-address-container">\n\t\t\t\t<div class="location-map-address-icon"></div>\n\t\t\t\t',"\n\t\t\t</div>"])),babelHelpers.classPrivateFieldGet(this,m)));if(s===""){this.hide()}return babelHelpers.classPrivateFieldGet(this,P)}},{key:"show",value:function e(){if(babelHelpers.classPrivateFieldGet(this,P)){babelHelpers.classPrivateFieldGet(this,P).style.display="block"}}},{key:"hide",value:function e(){if(babelHelpers.classPrivateFieldGet(this,P)){babelHelpers.classPrivateFieldGet(this,P).style.display="none"}}},{key:"isHidden",value:function e(){return!babelHelpers.classPrivateFieldGet(this,P)||babelHelpers.classPrivateFieldGet(this,P).style.display==="none"}},{key:"address",set:function e(t){babelHelpers.classPrivateFieldSet(this,F,t);if(!babelHelpers.classPrivateFieldGet(this,m)){return}babelHelpers.classPrivateFieldGet(this,m).innerHTML=H(this,T,y).call(this,t);if(!t&&!this.isHidden()){this.hide()}else if(t&&this.isHidden()){this.show()}}}]);return e}();function y(e){var t="";if(e){t=n.AddressStringConverter.convertAddressToStringTemplate(e,babelHelpers.classPrivateFieldGet(this,g).getTemplate(n.FormatTemplateType.DEFAULT),n.AddressStringConverter.CONTENT_TYPE_HTML,", ",babelHelpers.classPrivateFieldGet(this,g))}return t}var I=t.Vue.extend({props:{address:{required:true},addressFormat:{required:true},isHidden:{required:true}},methods:{handleApplyClick:function e(){this.$emit("apply",{address:this.address})},convertAddressToString:function e(t){if(!t){return""}return t.toString(this.addressFormat,n.AddressStringConverter.STRATEGY_TYPE_TEMPLATE_COMMA)}},computed:{addressString:function e(){if(!this.address){return""}return this.address.toString(this.addressFormat,n.AddressStringConverter.STRATEGY_TYPE_TEMPLATE_COMMA,n.AddressStringConverter.CONTENT_TYPE_TEXT)},containerStyles:function e(){return{display:this.isHidden?"none":"flex"}},containerClasses:function e(){return this.isHidden?{hidden:true}:{}},localize:function e(){return t.Vue.getFilteredPhrases("LOCATION_WIDGET_")}},template:'\n\t\t<div\n\t\t\t:class="containerClasses"\n\t\t\t:style="containerStyles"\n\t\t\tclass="location-map-address-changed"\n\t\t>\n\t\t\t<div class="location-map-address-changed-inner">\n\t\t\t<div class="location-map-address-changed-title">\n\t\t\t\t{{localize.LOCATION_WIDGET_AUI_ADDRESS_CHANGED_NEW_ADDRESS}}\n\t\t\t</div>\n\t\t\t<div class="location-map-address-changed-text">{{addressString}}</div>\n\t\t\t</div>\n\t\t\t<button @click="handleApplyClick" type="button" class="location-map-address-apply-btn">\n\t\t\t\t{{localize.LOCATION_WIDGET_AUI_ADDRESS_APPLY}}\n\t\t\t</button>\n\t\t</div>\t\n\t'});function G(e,t){S(e,t);t.add(e)}function S(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function E(e,t,s){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return s}var k=new WeakSet;var C=function(e){babelHelpers.inherits(t,e);function t(){var e;var s;babelHelpers.classCallCheck(this,t);for(var i=arguments.length,a=new Array(i),l=0;l<i;l++){a[l]=arguments[l]}s=babelHelpers.possibleConstructorReturn(this,(e=babelHelpers.getPrototypeOf(t)).call.apply(e,[this].concat(a)));G(babelHelpers.assertThisInitialized(s),k);return s}babelHelpers.createClass(t,[{key:"getBindElement",value:function e(){return this.bindElement}},{key:"adjustPosition",value:function e(s){var i,a;if(this.bindOptions.position&&this.bindOptions.position==="right"){i=true;a=E(this,k,A).call(this)}if(!(i&&a)){babelHelpers.get(babelHelpers.getPrototypeOf(t.prototype),"adjustPosition",this).call(this,s)}}}]);return t}(a.Popup);function A(){var e=this.bindElement.getBoundingClientRect();var t=this.getPopupContainer().offsetHeight;var s=this.getPopupContainer().offsetWidth;if(e.left+e.width+s>document.documentElement.clientWidth){return false}var i=t/2;var a=e.left+e.width+10;var l=window.pageYOffset+e.top+e.height/2-t/2;if(l<window.pageYOffset){i-=window.pageYOffset-l;l=window.pageYOffset}else if(l>window.pageYOffset+document.body.clientHeight-t){i+=l-(window.pageYOffset+document.body.clientHeight-t);l=window.pageYOffset+document.body.clientHeight-t}this.setAngle({position:"left",offset:i});b.Dom.adjust(this.popupContainer,{style:{top:"".concat(l,"px"),left:"".concat(a,"px"),zIndex:this.getZindex()}});return true}var W,_,M;function z(e,t){O(e,t);t.add(e)}function L(e,t,s){O(e,t);t.set(e,s)}function O(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function N(e,t,s){B(e,t);D(s,"get");return R(e,s)}function D(e,t){if(e===undefined){throw new TypeError("attempted to "+t+" private static field before its declaration")}}function B(e,t){if(e!==t){throw new TypeError("Private static access of wrong provenance")}}function R(e,t){if(t.get){return t.get.call(e)}return t.value}function X(e,t,s){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return s}var x=new WeakMap;var U=new WeakMap;var V=new WeakMap;var Y=new WeakMap;var j=new WeakMap;var K=new WeakMap;var $=new WeakMap;var q=new WeakMap;var J=new WeakMap;var Z=new WeakMap;var Q=new WeakMap;var ee=new WeakMap;var te=new WeakMap;var se=new WeakMap;var ie=new WeakSet;var ae=new WeakSet;var le=new WeakSet;var re=new WeakSet;var ne=new WeakSet;var de=new WeakSet;var oe=new WeakSet;var be=function(e){babelHelpers.inherits(t,e);function t(e){var s;babelHelpers.classCallCheck(this,t);s=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this,e));z(babelHelpers.assertThisInitialized(s),oe);z(babelHelpers.assertThisInitialized(s),de);z(babelHelpers.assertThisInitialized(s),ne);z(babelHelpers.assertThisInitialized(s),re);z(babelHelpers.assertThisInitialized(s),le);z(babelHelpers.assertThisInitialized(s),ae);z(babelHelpers.assertThisInitialized(s),ie);L(babelHelpers.assertThisInitialized(s),x,{writable:true,value:void 0});L(babelHelpers.assertThisInitialized(s),U,{writable:true,value:void 0});L(babelHelpers.assertThisInitialized(s),V,{writable:true,value:void 0});L(babelHelpers.assertThisInitialized(s),Y,{writable:true,value:void 0});L(babelHelpers.assertThisInitialized(s),j,{writable:true,value:void 0});L(babelHelpers.assertThisInitialized(s),K,{writable:true,value:void 0});L(babelHelpers.assertThisInitialized(s),$,{writable:true,value:void 0});L(babelHelpers.assertThisInitialized(s),q,{writable:true,value:void 0});L(babelHelpers.assertThisInitialized(s),J,{writable:true,value:void 0});L(babelHelpers.assertThisInitialized(s),Z,{writable:true,value:false});L(babelHelpers.assertThisInitialized(s),Q,{writable:true,value:void 0});L(babelHelpers.assertThisInitialized(s),ee,{writable:true,value:void 0});L(babelHelpers.assertThisInitialized(s),te,{writable:true,value:void 0});L(babelHelpers.assertThisInitialized(s),se,{writable:true,value:void 0});s.setEventNamespace("BX.Location.Widget.MapPopup");if(!(e.map instanceof n.MapBase)){BX.debug("map must be instance of Map")}babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),x,e.map);if(e.geocodingService instanceof n.GeocodingServiceBase){babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),ee,e.geocodingService)}babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),x).onLocationChangedEventSubscribe(X(babelHelpers.assertThisInitialized(s),ae,ue).bind(babelHelpers.assertThisInitialized(s)));if(!(e.popup instanceof C)){BX.debug("popup must be instance of Popup")}babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),Y,e.popup);if(!(e.addressFormat instanceof n.Format)){BX.debug("addressFormat must be instance of Format")}babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),$,e.addressFormat);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),j,new w({addressFormat:babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),$)}));X(babelHelpers.assertThisInitialized(s),ie,ce).call(babelHelpers.assertThisInitialized(s));if(e.gallery){babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),q,e.gallery)}babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),J,e.locationRepository);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),se,e.userLocationPoint);return s}babelHelpers.createClass(t,[{key:"render",value:function e(t){babelHelpers.classPrivateFieldSet(this,V,t.address);babelHelpers.classPrivateFieldSet(this,U,t.mode);babelHelpers.classPrivateFieldSet(this,Z,false);babelHelpers.classPrivateFieldSet(this,Q,b.Tag.render(W||(W=babelHelpers.taggedTemplateLiteral(['<div class="location-map-inner"></div>']))));X(this,le,pe).call(this,t.bindElement,babelHelpers.classPrivateFieldGet(this,Q))}},{key:"show",value:function e(){var s=this;var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;X(this,ne,ve).call(this,babelHelpers.classPrivateFieldGet(this,V),i).then((function(e){if(!e){return}babelHelpers.classPrivateFieldGet(s,Y).show();if(!babelHelpers.classPrivateFieldGet(s,Z)){X(s,oe,He).call(s,{location:e}).then((function(){if(babelHelpers.classPrivateFieldGet(s,q)){babelHelpers.classPrivateFieldGet(s,q).location=e}s.emit(N(t,t,ge));babelHelpers.classPrivateFieldGet(s,x).onMapShow()}));babelHelpers.classPrivateFieldSet(s,Z,true)}else{babelHelpers.classPrivateFieldGet(s,x).location=e;if(babelHelpers.classPrivateFieldGet(s,q)){babelHelpers.classPrivateFieldGet(s,q).location=e}s.emit(N(t,t,ge));babelHelpers.classPrivateFieldGet(s,x).onMapShow()}}))}},{key:"isShown",value:function e(){return babelHelpers.classPrivateFieldGet(this,Y).isShown()}},{key:"close",value:function e(){babelHelpers.classPrivateFieldGet(this,Y).close();babelHelpers.classPrivateFieldGet(this,K).$props.isHidden=true;this.emit(N(t,t,Te))}},{key:"onChangedEventSubscribe",value:function e(s){this.subscribe(N(t,t,Fe),s)}},{key:"onMouseOverSubscribe",value:function e(s){this.subscribe(N(t,t,Pe),s)}},{key:"onMouseOutSubscribe",value:function e(s){this.subscribe(N(t,t,me),s)}},{key:"subscribeOnShowedEvent",value:function e(s){this.subscribe(N(t,t,ge),s)}},{key:"subscribeOnClosedEvent",value:function e(s){this.subscribe(N(t,t,Te),s)}},{key:"destroy",value:function e(){babelHelpers.classPrivateFieldSet(this,x,null);babelHelpers.classPrivateFieldSet(this,q,null);babelHelpers.classPrivateFieldSet(this,j,null);babelHelpers.classPrivateFieldSet(this,K,null);babelHelpers.classPrivateFieldGet(this,Y).destroy();babelHelpers.classPrivateFieldSet(this,Y,null);b.Dom.remove(babelHelpers.classPrivateFieldGet(this,te));babelHelpers.classPrivateFieldSet(this,te,null);b.Event.unbindAll(this)}},{key:"bindElement",get:function e(){return babelHelpers.classPrivateFieldGet(this,Y).getBindElement()},set:function e(t){if(b.Type.isDomNode(t)){babelHelpers.classPrivateFieldGet(this,Y).setBindElement(t)}else{BX.debug("bindElement must be type of dom node")}}},{key:"address",set:function e(t){var s=this;babelHelpers.classPrivateFieldSet(this,V,t);babelHelpers.classPrivateFieldGet(this,j).address=t;X(this,ne,ve).call(this,t).then((function(e){X(s,de,fe).call(s,e)}))}},{key:"mode",set:function e(t){babelHelpers.classPrivateFieldSet(this,U,t);babelHelpers.classPrivateFieldGet(this,x).mode=t}}]);return t}(o.EventEmitter);function ce(){var e=this;babelHelpers.classPrivateFieldSet(this,K,new I({propsData:{address:babelHelpers.classPrivateFieldGet(this,V),addressFormat:babelHelpers.classPrivateFieldGet(this,$),isHidden:true}}));babelHelpers.classPrivateFieldGet(this,K).$mount();babelHelpers.classPrivateFieldGet(this,K).$on("apply",(function(t){var s=t.address;babelHelpers.classPrivateFieldSet(e,V,s);babelHelpers.classPrivateFieldGet(e,j).address=s;babelHelpers.classPrivateFieldGet(e,K).$props.isHidden=true;e.emit(N(be,be,Fe),{address:s})}))}function ue(e){var t=e.getData();var s=t.location;var i=s.toAddress();if(!babelHelpers.classPrivateFieldGet(this,V)){babelHelpers.classPrivateFieldSet(this,V,i);babelHelpers.classPrivateFieldGet(this,j).address=i;this.emit(N(be,be,Fe),{address:i})}else if(i.fieldCollection.isEqual(babelHelpers.classPrivateFieldGet(this,V).fieldCollection,n.LocationType.ADDRESS_LINE_1)){babelHelpers.classPrivateFieldGet(this,V).latitude=i.latitude;babelHelpers.classPrivateFieldGet(this,V).longitude=i.longitude;if(babelHelpers.classPrivateFieldGet(this,V).location){babelHelpers.classPrivateFieldGet(this,V).location.latitude=i.latitude;babelHelpers.classPrivateFieldGet(this,V).location.longitude=i.longitude}this.emit(N(be,be,Fe),{address:babelHelpers.classPrivateFieldGet(this,V)});babelHelpers.classPrivateFieldGet(this,K).$props.isHidden=true}else{babelHelpers.classPrivateFieldGet(this,j).address=i;babelHelpers.classPrivateFieldGet(this,K).$props.address=i;babelHelpers.classPrivateFieldGet(this,K).$props.isHidden=false}if(babelHelpers.classPrivateFieldGet(this,q)){babelHelpers.classPrivateFieldGet(this,q).location=s}}function pe(e,t){var s=this;var i="";if(babelHelpers.classPrivateFieldGet(this,q)){i=babelHelpers.classPrivateFieldGet(this,q).render()}var a=b.Tag.render(_||(_=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div class="location-map-address-third-party-warning">\n\t\t\t\t',"\n\t\t\t</div>\n\t\t"])),b.Loc.getMessage("LOCATION_WIDGET_THIRD_PARTY_WARNING"));babelHelpers.classPrivateFieldSet(this,te,b.Tag.render(M||(M=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div class="location-map-wrapper">\n\t\t\t\t<div class="location-map-container">\n\t\t\t\t\t',"\n\t\t\t\t\t","\n\t\t\t\t</div>\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t</div>"])),t,i,babelHelpers.classPrivateFieldGet(this,U)===n.ControlMode.edit?babelHelpers.classPrivateFieldGet(this,j).render({address:babelHelpers.classPrivateFieldGet(this,V)}):"",a,babelHelpers.classPrivateFieldGet(this,U)===n.ControlMode.edit?babelHelpers.classPrivateFieldGet(this,K).$el:""));b.Event.bind(babelHelpers.classPrivateFieldGet(this,te),"click",(function(e){return e.stopPropagation()}));b.Event.bind(babelHelpers.classPrivateFieldGet(this,te),"mouseover",(function(e){return s.emit(N(be,be,Pe),e)}));b.Event.bind(babelHelpers.classPrivateFieldGet(this,te),"mouseout",(function(e){return s.emit(N(be,be,me),e)}));this.bindElement=e;babelHelpers.classPrivateFieldGet(this,Y).setContent(babelHelpers.classPrivateFieldGet(this,te))}function he(e){var t=null;var s;var i;if(e.latitude&&e.longitude){s=e.latitude;i=e.longitude}else if(e.location&&e.location.latitude&&e.location.longitude){s=e.location.latitude;i=e.location.longitude}if(s&&s!=="0"&&i&&i!=="0"){t=[s,i]}return t}function ve(e){var t=this;var s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return new Promise((function(i){if(s){i(babelHelpers.classPrivateFieldGet(t,se)&&babelHelpers.classPrivateFieldGet(t,U)!==n.ControlMode.view?new n.Location({latitude:babelHelpers.classPrivateFieldGet(t,se).latitude,longitude:babelHelpers.classPrivateFieldGet(t,se).longitude}):null);return}if(e){var a=X(t,re,he).call(t,e);if(a){i(new n.Location({latitude:a[0],longitude:a[1],type:e.getType()}));return}}i(null)}))}function fe(e){if(babelHelpers.classPrivateFieldGet(this,x)){babelHelpers.classPrivateFieldGet(this,x).location=e}if(babelHelpers.classPrivateFieldGet(this,q)){babelHelpers.classPrivateFieldGet(this,q).location=e}}function He(e){var t=e.location;return babelHelpers.classPrivateFieldGet(this,x).render({mapContainer:babelHelpers.classPrivateFieldGet(this,Q),location:t,mode:babelHelpers.classPrivateFieldGet(this,U)})}var Fe={writable:true,value:"onChanged"};var Pe={writable:true,value:"onMouseOver"};var me={writable:true,value:"onMouseOut"};var ge={writable:true,value:"onShow"};var Te={writable:true,value:"onClose"};var we=function(){function e(t){babelHelpers.classCallCheck(this,e);babelHelpers.defineProperty(this,"_saveResourceStrategy",false);this._saveResourceStrategy=t.saveResourceStrategy}babelHelpers.createClass(e,[{key:"render",value:function e(t){throw new n.MethodNotImplemented("Method render must be implemented")}},{key:"setAddressWidget",value:function e(t){throw new n.MethodNotImplemented("Method render must be implemented")}},{key:"setAddress",value:function e(t){throw new n.MethodNotImplemented("Method set address must be implemented")}},{key:"setMode",value:function e(t){}},{key:"destroy",value:function e(){}},{key:"resetView",value:function e(){}}]);return e}();function ye(e,t){var s=typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!s){if(Array.isArray(e)||(s=Ie(e))||t&&e&&typeof e.length==="number"){if(s)e=s;var i=0;var a=function e(){};return{s:a,n:function t(){if(i>=e.length)return{done:true};return{done:false,value:e[i++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l=true,r=false,n;return{s:function t(){s=s.call(e)},n:function e(){var t=s.next();l=t.done;return t},e:function e(t){r=true;n=t},f:function e(){try{if(!l&&s["return"]!=null)s["return"]()}finally{if(r)throw n}}}}function Ie(e,t){if(!e)return;if(typeof e==="string")return Ge(e,t);var s=Object.prototype.toString.call(e).slice(8,-1);if(s==="Object"&&e.constructor)s=e.constructor.name;if(s==="Map"||s==="Set")return Array.from(e);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return Ge(e,t)}function Ge(e,t){if(t==null||t>e.length)t=e.length;for(var s=0,i=new Array(t);s<t;s++)i[s]=e[s];return i}function Se(e,t){ke(e,t);t.add(e)}function Ee(e,t,s){ke(e,t);t.set(e,s)}function ke(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function Ce(e,t,s){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return s}var Ae=new WeakMap;var We=new WeakMap;var _e=new WeakMap;var Me=new WeakMap;var ze=new WeakMap;var Le=new WeakMap;var Oe=new WeakMap;var Ne=new WeakMap;var De=new WeakMap;var Be=new WeakMap;var Re=new WeakMap;var Xe=new WeakMap;var xe=new WeakMap;var Ue=new WeakSet;var Ve=new WeakSet;var Ye=new WeakSet;var je=new WeakSet;var Ke=new WeakSet;var $e=new WeakSet;var qe=new WeakSet;var Je=new WeakSet;var Ze=new WeakSet;var Qe=new WeakSet;var et=function(e){babelHelpers.inherits(t,e);function t(e){var s;babelHelpers.classCallCheck(this,t);s=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this));Se(babelHelpers.assertThisInitialized(s),Qe);Se(babelHelpers.assertThisInitialized(s),Ze);Se(babelHelpers.assertThisInitialized(s),Je);Se(babelHelpers.assertThisInitialized(s),qe);Se(babelHelpers.assertThisInitialized(s),$e);Se(babelHelpers.assertThisInitialized(s),Ke);Se(babelHelpers.assertThisInitialized(s),je);Se(babelHelpers.assertThisInitialized(s),Ye);Se(babelHelpers.assertThisInitialized(s),Ve);Se(babelHelpers.assertThisInitialized(s),Ue);Ee(babelHelpers.assertThisInitialized(s),Ae,{writable:true,value:void 0});Ee(babelHelpers.assertThisInitialized(s),We,{writable:true,value:void 0});Ee(babelHelpers.assertThisInitialized(s),_e,{writable:true,value:void 0});Ee(babelHelpers.assertThisInitialized(s),Me,{writable:true,value:void 0});Ee(babelHelpers.assertThisInitialized(s),ze,{writable:true,value:void 0});Ee(babelHelpers.assertThisInitialized(s),Le,{writable:true,value:[]});Ee(babelHelpers.assertThisInitialized(s),Oe,{writable:true,value:void 0});Ee(babelHelpers.assertThisInitialized(s),Ne,{writable:true,value:void 0});Ee(babelHelpers.assertThisInitialized(s),De,{writable:true,value:false});Ee(babelHelpers.assertThisInitialized(s),Be,{writable:true,value:false});Ee(babelHelpers.assertThisInitialized(s),Re,{writable:true,value:false});Ee(babelHelpers.assertThisInitialized(s),Xe,{writable:true,value:true});Ee(babelHelpers.assertThisInitialized(s),xe,{writable:true,value:void 0});s.setEventNamespace("BX.Location.Widget.Address");if(!(e.addressFormat instanceof n.Format)){BX.debug("addressFormat must be instance of Format")}babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),Me,e.addressFormat);if(e.address&&!(e.address instanceof n.Address)){BX.debug("address must be instance of Address")}babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),_e,e.address||null);if(!n.ControlMode.isValid(e.mode)){BX.debug("mode must be valid ControlMode")}babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),Ae,e.mode);if(!b.Type.isString(e.languageId)){throw new TypeError("props.languageId must be type of string")}babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),ze,e.languageId);if(e.features){if(!b.Type.isArray(e.features)){throw new TypeError("features must be an array")}e.features.forEach((function(e){Ce(babelHelpers.assertThisInitialized(s),Ue,tt).call(babelHelpers.assertThisInitialized(s),e)}))}if(b.Type.isBoolean(e.needWarmBackendAfterAddressChanged)){babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),Xe,e.needWarmBackendAfterAddressChanged)}if(e.locationRepository instanceof n.LocationRepository){babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),xe,e.locationRepository)}else if(babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),Xe)){babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),xe,new n.LocationRepository)}babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),We,c.INITIAL);return s}babelHelpers.createClass(t,[{key:"setAddressByFeature",value:function e(t,s){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var l=babelHelpers.classPrivateFieldGet(this,_e)?babelHelpers.classPrivateFieldGet(this,_e).id:0;if(t&&!t.getFieldValue(n.AddressType.ADDRESS_LINE_1)&&babelHelpers.classPrivateFieldGet(this,Me).isTemplateExists(n.FormatTemplateType.ADDRESS_LINE_1)){t.setFieldValue(n.AddressType.ADDRESS_LINE_1,n.AddressStringConverter.convertAddressToStringTemplate(t,babelHelpers.classPrivateFieldGet(this,Me).getTemplate(n.FormatTemplateType.ADDRESS_LINE_1),n.AddressStringConverter.CONTENT_TYPE_TEXT,null,babelHelpers.classPrivateFieldGet(this,Me)))}babelHelpers.classPrivateFieldSet(this,_e,t);var r=a.hasOwnProperty("storeAsLastAddress")?a.storeAsLastAddress:true;if(r){Ce(this,Ze,ot).call(this)}if(l>0){babelHelpers.classPrivateFieldGet(this,_e).id=l}babelHelpers.classPrivateFieldSet(this,Be,true);Ce(this,qe,nt).call(this,t);Ce(this,Ve,st).call(this,"setAddress",[t],s,i);if(babelHelpers.classPrivateFieldGet(this,We)!==c.DATA_INPUTTING){Ce(this,Ye,it).call(this)}}},{key:"emitFeatureEvent",value:function e(s){this.emit(t.onFeatureEvent,s)}},{key:"onInputKeyup",value:function e(t){switch(t.code){case"Tab":case"Esc":case"Enter":case"NumpadEnter":this.resetView();break}}},{key:"onInputInput",value:function e(t){babelHelpers.classPrivateFieldSet(this,Re,true)}},{key:"resetView",value:function e(){Ce(this,Ve,st).call(this,"resetView")}},{key:"render",value:function e(t){if(!b.Type.isDomNode(t.controlWrapper)){BX.debug("props.controlWrapper must be instance of Element")}babelHelpers.classPrivateFieldSet(this,Ne,t.controlWrapper);if(babelHelpers.classPrivateFieldGet(this,Ae)===n.ControlMode.edit){if(!b.Type.isDomNode(t.inputNode)){BX.debug("props.inputNode must be instance of Element")}babelHelpers.classPrivateFieldSet(this,Oe,t.inputNode);Ce(this,qe,nt).call(this,babelHelpers.classPrivateFieldGet(this,_e))}Ce(this,Ve,st).call(this,"render",[t]);if(babelHelpers.classPrivateFieldGet(this,Ae)===n.ControlMode.edit){b.Event.bind(babelHelpers.classPrivateFieldGet(this,Oe),"focus",Ce(this,Ke,lt).bind(this));b.Event.bind(babelHelpers.classPrivateFieldGet(this,Oe),"focusout",Ce(this,Je,dt).bind(this));b.Event.bind(babelHelpers.classPrivateFieldGet(this,Oe),"keyup",this.onInputKeyup.bind(this));b.Event.bind(babelHelpers.classPrivateFieldGet(this,Oe),"input",this.onInputInput.bind(this))}}},{key:"setStateByFeature",value:function e(s){babelHelpers.classPrivateFieldSet(this,We,s);this.emit(t.onStateChangedEvent,{state:s})}},{key:"subscribeOnStateChangedEvent",value:function e(s){this.subscribe(t.onStateChangedEvent,s)}},{key:"subscribeOnAddressChangedEvent",value:function e(s){this.subscribe(t.onAddressChangedEvent,s)}},{key:"subscribeOnFeatureEvent",value:function e(s){this.subscribe(t.onFeatureEvent,s)}},{key:"subscribeOnErrorEvent",value:function e(t){n.ErrorPublisher.getInstance().subscribe(t)}},{key:"destroy",value:function e(){if(babelHelpers.classPrivateFieldGet(this,De)){return}b.Event.unbindAll(this);b.Event.unbind(babelHelpers.classPrivateFieldGet(this,Oe),"focus",Ce(this,Ke,lt));b.Event.unbind(babelHelpers.classPrivateFieldGet(this,Oe),"focusout",Ce(this,Je,dt));b.Event.unbind(babelHelpers.classPrivateFieldGet(this,Oe),"keyup",this.onInputKeyup);b.Event.unbind(babelHelpers.classPrivateFieldGet(this,Oe),"input",this.onInputInput);Ce(this,Ve,st).call(this,"destroy");Ce(this,Qe,bt).call(this);babelHelpers.classPrivateFieldSet(this,De,true)}},{key:"isDestroyed",value:function e(){return babelHelpers.classPrivateFieldGet(this,De)}},{key:"features",get:function e(){return babelHelpers.classPrivateFieldGet(this,Le)}},{key:"controlWrapper",get:function e(){return babelHelpers.classPrivateFieldGet(this,Ne)}},{key:"inputNode",get:function e(){return babelHelpers.classPrivateFieldGet(this,Oe)}},{key:"address",get:function e(){return babelHelpers.classPrivateFieldGet(this,_e)},set:function e(t){if(t&&!(t instanceof n.Address)){BX.debug("address must be instance of Address")}babelHelpers.classPrivateFieldSet(this,_e,t);Ce(this,Ze,ot).call(this);Ce(this,Ve,st).call(this,"setAddress",[t]);babelHelpers.classPrivateFieldSet(this,Re,false);babelHelpers.classPrivateFieldSet(this,Be,false);Ce(this,qe,nt).call(this,t)}},{key:"mode",get:function e(){return babelHelpers.classPrivateFieldGet(this,Ae)},set:function e(t){if(!n.ControlMode.isValid(t)){BX.debug("mode must be valid ControlMode")}babelHelpers.classPrivateFieldSet(this,Ae,t);Ce(this,Ve,st).call(this,"setMode",[t])}},{key:"state",get:function e(){return babelHelpers.classPrivateFieldGet(this,We)}},{key:"addressFormat",get:function e(){return babelHelpers.classPrivateFieldGet(this,Me)}}]);return t}(o.EventEmitter);function tt(e){if(!(e instanceof we)){BX.debug("feature must be instance of BaseFeature")}e.setAddressWidget(this);babelHelpers.classPrivateFieldGet(this,Le).push(e)}function st(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var s=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[];var a;var l=ye(babelHelpers.classPrivateFieldGet(this,Le)),r;try{for(l.s();!(r=l.n()).done;){var n=r.value;var d=false;var o=ye(i),b;try{for(o.s();!(b=o.n()).done;){var c=b.value;if(n instanceof c){d=true;break}}}catch(e){o.e(e)}finally{o.f()}if(!d&&n!==s){a=n[e].apply(n,t)}}}catch(e){l.e(e)}finally{l.f()}return a}function it(){this.emit(et.onAddressChangedEvent,{address:babelHelpers.classPrivateFieldGet(this,_e)});if(babelHelpers.classPrivateFieldGet(this,_e)&&babelHelpers.classPrivateFieldGet(this,Xe)){Ce(this,je,at).call(this,babelHelpers.classPrivateFieldGet(this,_e))}}function at(e){if(e.location!==null&&e.location.id<=0){babelHelpers.classPrivateFieldGet(this,xe).findParents(e.location)}}function lt(e){var t=babelHelpers.classPrivateFieldGet(this,Oe).value;if(t.length>0){BX.setCaretPosition(babelHelpers.classPrivateFieldGet(this,Oe),t.length)}}function rt(e,t){var s="";if(e){if(!babelHelpers.classPrivateFieldGet(this,Me).isTemplateExists(t)){console.error('Address format "'.concat(babelHelpers.classPrivateFieldGet(this,Me).code,'" does not have a template "').concat(t,'"'));return""}s=n.AddressStringConverter.convertAddressToStringTemplate(e,babelHelpers.classPrivateFieldGet(this,Me).getTemplate(t),n.AddressStringConverter.CONTENT_TYPE_TEXT,", ",babelHelpers.classPrivateFieldGet(this,Me))}return s}function nt(e){if(babelHelpers.classPrivateFieldGet(this,Oe)){var t=Ce(this,$e,rt).call(this,e,n.FormatTemplateType.AUTOCOMPLETE);var s=Ce(this,$e,rt).call(this,e,n.FormatTemplateType.DEFAULT);babelHelpers.classPrivateFieldGet(this,Oe).value=t.trim()!==""?t:s;babelHelpers.classPrivateFieldGet(this,Oe).title=s;var i=babelHelpers.classPrivateFieldGet(this,Oe).selectionStart;var a=t.length;babelHelpers.classPrivateFieldGet(this,Oe).setSelectionRange(i,a)}}function dt(e){if(babelHelpers.classPrivateFieldGet(this,Re)&&!babelHelpers.classPrivateFieldGet(this,Be)){var t=babelHelpers.classPrivateFieldGet(this,Oe).value.trim();var s=new n.Address({languageId:babelHelpers.classPrivateFieldGet(this,ze)});s.setFieldValue(babelHelpers.classPrivateFieldGet(this,Me).fieldForUnRecognized,t);this.address=s;Ce(this,Ye,it).call(this)}babelHelpers.classPrivateFieldSet(this,Re,false);babelHelpers.classPrivateFieldSet(this,Be,false)}function ot(){if(babelHelpers.classPrivateFieldGet(this,_e)&&babelHelpers.classPrivateFieldGet(this,_e).fieldCollection&&babelHelpers.classPrivateFieldGet(this,_e).fieldCollection.isFieldExists(n.AddressType.LOCALITY)){n.Storage.getInstance().lastAddress=babelHelpers.classPrivateFieldGet(this,_e)}}function bt(){babelHelpers.classPrivateFieldGet(this,Le).splice(0,babelHelpers.classPrivateFieldGet(this,Le).length)}babelHelpers.defineProperty(et,"onAddressChangedEvent","onAddressChanged");babelHelpers.defineProperty(et,"onStateChangedEvent","onStateChanged");babelHelpers.defineProperty(et,"onFeatureEvent","onFeatureEvent");var ct,ut,pt;function ht(e,t,s){vt(e,t);t.set(e,s)}function vt(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}var ft=new WeakMap;var Ht=new WeakMap;var Ft=new WeakMap;var Pt=function(e){babelHelpers.inherits(t,e);function t(){var e;babelHelpers.classCallCheck(this,t);e=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this));ht(babelHelpers.assertThisInitialized(e),ft,{writable:true,value:void 0});ht(babelHelpers.assertThisInitialized(e),Ht,{writable:true,value:void 0});ht(babelHelpers.assertThisInitialized(e),Ft,{writable:true,value:void 0});e.setEventNamespace("BX.Location.Widget.Autocomplete.MenuBottom");return e}babelHelpers.createClass(t,[{key:"render",value:function e(){babelHelpers.classPrivateFieldSet(this,Ht,b.Tag.render(ct||(ct=babelHelpers.taggedTemplateLiteral(['<div class="location-map-popup-item--info-left"></div>']))));babelHelpers.classPrivateFieldSet(this,Ft,b.Tag.render(ut||(ut=babelHelpers.taggedTemplateLiteral(["<div></div>"]))));babelHelpers.classPrivateFieldSet(this,ft,b.Tag.render(pt||(pt=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div>\n\t\t\t\t<span class="location-map-popup-item--info"> \t\t\n\t\t\t\t\t',"\n\t\t\t\t\t","\n\t\t\t\t</span>\t\t\t\n\t\t\t</div>\n\t\t"])),babelHelpers.classPrivateFieldGet(this,Ht),babelHelpers.classPrivateFieldGet(this,Ft)));return babelHelpers.classPrivateFieldGet(this,ft)}},{key:"setRightItemNode",value:function e(t){while(babelHelpers.classPrivateFieldGet(this,Ft).firstChild){babelHelpers.classPrivateFieldGet(this,Ft).removeChild(babelHelpers.classPrivateFieldGet(this,Ft).firstChild)}babelHelpers.classPrivateFieldGet(this,Ft).appendChild(t)}},{key:"setLeftItemNode",value:function e(t){while(babelHelpers.classPrivateFieldGet(this,Ht).firstChild){babelHelpers.classPrivateFieldGet(this,Ht).removeChild(babelHelpers.classPrivateFieldGet(this,Ht).firstChild)}babelHelpers.classPrivateFieldGet(this,Ht).appendChild(t)}}]);return t}(o.EventEmitter);function mt(e,t,s){gt(e,t);t.set(e,s)}function gt(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}var Tt=new WeakMap;var wt=function(e){babelHelpers.inherits(t,e);function t(e){var s;babelHelpers.classCallCheck(this,t);s=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this,e));babelHelpers.defineProperty(babelHelpers.assertThisInitialized(s),"choseItemIdx",-1);mt(babelHelpers.assertThisInitialized(s),Tt,{writable:true,value:void 0});var i=e.bindElement.getBoundingClientRect();s.popupWindow.setMaxWidth(i.width);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),Tt,new Pt);s.layout.menuContainer.appendChild(babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),Tt).render());return s}babelHelpers.createClass(t,[{key:"isMenuEmpty",value:function e(){return this.menuItems.length<=0}},{key:"isChoseLastItem",value:function e(){return this.choseItemIdx>=this.menuItems.length-1}},{key:"isChoseFirstItem",value:function e(){return this.choseItemIdx===0}},{key:"isItemChosen",value:function e(){return this.choseItemIdx>=0}},{key:"isDestroyed",value:function e(){return this.getPopupWindow().isDestroyed()}},{key:"isItemExist",value:function e(t){return typeof this.menuItems[t]!=="undefined"}},{key:"getChosenItem",value:function e(){var t=null;if(this.isItemChosen()&&this.isItemExist(this.choseItemIdx)){t=this.menuItems[this.choseItemIdx]}return t}},{key:"chooseNextItem",value:function e(){if(!this.isMenuEmpty()&&!this.isChoseLastItem()){this.chooseItem(this.choseItemIdx+1)}return this.getChosenItem()}},{key:"choosePrevItem",value:function e(){if(!this.isMenuEmpty()&&!this.isChoseFirstItem()){this.chooseItem(this.choseItemIdx-1)}return this.getChosenItem()}},{key:"highlightItem",value:function e(t){if(this.isItemExist(t)){var s=this.getChosenItem();if(s&&s.layout.item){s.layout.item.classList.add("highlighted")}}}},{key:"unHighlightItem",value:function e(t){if(this.isItemExist(t)){var s=this.getChosenItem();if(s&&s.layout.item){s.layout.item.classList.remove("highlighted")}}}},{key:"chooseItem",value:function e(t){var s=t;if(s<0){s=this.menuItems.length-1}else if(s>this.menuItems.length-1){s=0}this.unHighlightItem(this.choseItemIdx);this.choseItemIdx=s;this.highlightItem(this.choseItemIdx)}},{key:"clearItems",value:function e(){while(this.menuItems.length>0){this.removeMenuItem(this.menuItems[0].id)}}},{key:"isShown",value:function e(){return this.getPopupWindow().isShown()}},{key:"setBottomRightItemNode",value:function e(t){babelHelpers.classPrivateFieldGet(this,Tt).setRightItemNode(t)}},{key:"setBottomLeftItemNode",value:function e(t){babelHelpers.classPrivateFieldGet(this,Tt).setLeftItemNode(t)}}]);return t}(a.Menu);function yt(e,t){var s=typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!s){if(Array.isArray(e)||(s=It(e))||t&&e&&typeof e.length==="number"){if(s)e=s;var i=0;var a=function e(){};return{s:a,n:function t(){if(i>=e.length)return{done:true};return{done:false,value:e[i++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l=true,r=false,n;return{s:function t(){s=s.call(e)},n:function e(){var t=s.next();l=t.done;return t},e:function e(t){r=true;n=t},f:function e(){try{if(!l&&s["return"]!=null)s["return"]()}finally{if(r)throw n}}}}function It(e,t){if(!e)return;if(typeof e==="string")return Gt(e,t);var s=Object.prototype.toString.call(e).slice(8,-1);if(s==="Object"&&e.constructor)s=e.constructor.name;if(s==="Map"||s==="Set")return Array.from(e);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return Gt(e,t)}function Gt(e,t){if(t==null||t>e.length)t=e.length;for(var s=0,i=new Array(t);s<t;s++)i[s]=e[s];return i}function St(e,t){kt(e,t);t.add(e)}function Et(e,t,s){kt(e,t);t.set(e,s)}function kt(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function Ct(e,t,s){At(e,t);return s}function At(e,t){if(e!==t){throw new TypeError("Private static access of wrong provenance")}}function Wt(e,t,s){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return s}var _t=new WeakMap;var Mt=new WeakMap;var zt=new WeakMap;var Lt=new WeakMap;var Ot=new WeakSet;var Nt=new WeakSet;var Dt=new WeakSet;var Bt=new WeakSet;var Rt=new WeakSet;var Xt=function(e){babelHelpers.inherits(t,e);function t(e){var s;babelHelpers.classCallCheck(this,t);s=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this,e));St(babelHelpers.assertThisInitialized(s),Rt);St(babelHelpers.assertThisInitialized(s),Bt);St(babelHelpers.assertThisInitialized(s),Dt);St(babelHelpers.assertThisInitialized(s),Nt);St(babelHelpers.assertThisInitialized(s),Ot);Et(babelHelpers.assertThisInitialized(s),_t,{writable:true,value:void 0});Et(babelHelpers.assertThisInitialized(s),Mt,{writable:true,value:void 0});Et(babelHelpers.assertThisInitialized(s),zt,{writable:true,value:void 0});Et(babelHelpers.assertThisInitialized(s),Lt,{writable:true,value:void 0});s.setEventNamespace("BX.Location.Widget.Prompt");babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),_t,e.inputNode);if(e.menuNode){babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),Mt,e.menuNode)}return s}babelHelpers.createClass(t,[{key:"getMenu",value:function e(){if(!babelHelpers.classPrivateFieldGet(this,zt)||babelHelpers.classPrivateFieldGet(this,zt).isDestroyed()){babelHelpers.classPrivateFieldSet(this,zt,Wt(this,Ot,xt).call(this))}return babelHelpers.classPrivateFieldGet(this,zt)}},{key:"show",value:function e(t,s){if(t.length>0){this.setMenuItems(t,s);this.getMenu().show()}}},{key:"close",value:function e(){this.getMenu().close()}},{key:"setMenuItems",value:function e(s,i,a){var l=this;this.getMenu().clearItems();if(Array.isArray(s)){babelHelpers.classPrivateFieldSet(this,Lt,s.slice());var r=!a||!a.getFieldValue(n.AddressType.LOCALITY)||!Ct(t,t,Yt).call(t,babelHelpers.classPrivateFieldGet(this,Lt));if(r){s.forEach((function(e,t){l.getMenu().addMenuItem(Wt(l,Dt,jt).call(l,t,e,i))}))}else{s.forEach((function(e,t){if(Wt(l,Nt,Ut).call(l,a,e)){l.getMenu().addMenuItem(Wt(l,Dt,jt).call(l,t,e,i))}}));var d=false;s.forEach((function(e,t){if(!Wt(l,Nt,Ut).call(l,a,e)){if(!d){l.getMenu().addMenuItem({html:b.Loc.getMessage("LOCATION_WIDGET_PROMPT_IN_OTHER_CITY"),delimiter:true})}l.getMenu().addMenuItem(Wt(l,Dt,jt).call(l,t,e,i));d=true}}))}}}},{key:"choosePrevItem",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var s=null;var i=this.getMenu().choosePrevItem();if(i){if(i.delimiter&&i.delimiter===true){s=t?this.getMenu().chooseNextItem():this.choosePrevItem(true)}else{s=Wt(this,Rt,$t).call(this,this.getMenu().choseItemIdx)}}return s}},{key:"chooseNextItem",value:function e(){var t=null;var s=this.getMenu().chooseNextItem();if(s){if(s.delimiter&&s.delimiter===true){t=this.chooseNextItem()}else{t=Wt(this,Rt,$t).call(this,this.getMenu().choseItemIdx)}}return t}},{key:"isItemChosen",value:function e(){return this.getMenu().isItemChosen()}},{key:"getChosenItem",value:function e(){var t=null;var s=this.getMenu().getChosenItem();if(s&&s.id){t=Wt(this,Rt,$t).call(this,this.getMenu().choseItemIdx)}return t}},{key:"isShown",value:function e(){return this.getMenu().isShown()}},{key:"destroy",value:function e(){if(babelHelpers.classPrivateFieldGet(this,zt)){babelHelpers.classPrivateFieldGet(this,zt).destroy();babelHelpers.classPrivateFieldSet(this,zt,null)}babelHelpers.classPrivateFieldSet(this,Lt,null)}}],[{key:"createMenuItemText",value:function e(t,s,i){var a="\n\t\t<div>\n\t\t\t<strong>".concat(t,"</strong>\n\t\t</div>");var l;if(i.getFieldValue(n.LocationType.TMP_TYPE_CLARIFICATION)){l=i.getFieldValue(n.LocationType.TMP_TYPE_CLARIFICATION);if(l){if(i.getFieldValue(n.LocationType.TMP_TYPE_HINT)){l+=" <i>(".concat(i.getFieldValue(n.LocationType.TMP_TYPE_HINT),")</i>")}a+="<div>".concat(l,"</div>")}}return'<div data-role="location-widget-menu-item" tabindex="-1">'+a+"</div>"}}]);return t}(o.EventEmitter);function xt(){return new wt({bindElement:babelHelpers.classPrivateFieldGet(this,Mt)?babelHelpers.classPrivateFieldGet(this,Mt):babelHelpers.classPrivateFieldGet(this,_t),autoHide:false,closeByEsc:true,className:"location-widget-prompt-menu"})}function Ut(e,t){return e&&e.getFieldValue(n.AddressType.LOCALITY)&&t&&t.address&&t.address.getFieldValue(n.AddressType.LOCALITY)&&Ct(Xt,Xt,Vt).call(Xt,t.address).includes(e.getFieldValue(n.AddressType.LOCALITY))}function Vt(e){var t=[];if(e.getFieldValue(n.AddressType.LOCALITY)){t.push(e.getFieldValue(n.AddressType.LOCALITY))}if(e.getFieldValue(n.AddressType.ADM_LEVEL_1)){t.push(e.getFieldValue(n.AddressType.ADM_LEVEL_1))}return t}function Yt(e){var t=yt(e),s;try{for(t.s();!(s=t.n()).done;){var i=s.value;if(i.address&&i.address.getFieldValue(n.AddressType.LOCALITY)){return true}}}catch(e){t.e(e)}finally{t.f()}return false}function jt(e,t,s){var i=this;return{id:e,title:t.name,html:Xt.createMenuItemText(t.name,s,t),onclick:function t(s,a){Wt(i,Bt,Kt).call(i,e);i.close()}}}function Kt(e){var t=Wt(this,Rt,$t).call(this,e);if(t){this.emit(Xt.onItemSelectedEvent,{location:t})}}function $t(e){var t=null;if(babelHelpers.classPrivateFieldGet(this,Lt)[e]!==undefined){t=babelHelpers.classPrivateFieldGet(this,Lt)[e]}if(!t){BX.debug("Location with index ".concat(e," was not found"))}return t}babelHelpers.defineProperty(Xt,"onItemSelectedEvent","onItemSelected");function qt(e,t){Zt(e,t);t.add(e)}function Jt(e,t,s){Zt(e,t);t.set(e,s)}function Zt(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function Qt(e,t,s){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return s}var es=new WeakMap;var ts=new WeakMap;var ss=new WeakMap;var is=new WeakMap;var as=new WeakSet;var ls=new WeakSet;var rs=new WeakSet;var ns=function(){function e(t,s,i){babelHelpers.classCallCheck(this,e);qt(this,rs);qt(this,ls);qt(this,as);Jt(this,es,{writable:true,value:null});Jt(this,ts,{writable:true,value:""});Jt(this,ss,{writable:true,value:""});Jt(this,is,{writable:true,value:null});if(!(t instanceof HTMLInputElement)){throw new TypeError("Wrong input type")}babelHelpers.classPrivateFieldSet(this,es,t);if(!(s instanceof n.Format)){throw new TypeError("Wrong addressFormat type")}babelHelpers.classPrivateFieldSet(this,is,s);if(i&&!(i instanceof n.Address)){throw new TypeError("Wrong address type")}if(i){this.setValueFromAddress(i)}}babelHelpers.createClass(e,[{key:"setValue",value:function e(t){var s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;babelHelpers.classPrivateFieldSet(this,ts,t);babelHelpers.classPrivateFieldGet(this,es).value=t;if(s){babelHelpers.classPrivateFieldSet(this,ss,t)}Qt(this,as,ds).call(this)}},{key:"actualize",value:function e(){babelHelpers.classPrivateFieldSet(this,ts,babelHelpers.classPrivateFieldGet(this,es).value);Qt(this,as,ds).call(this)}},{key:"isChanged",value:function e(){return babelHelpers.classPrivateFieldGet(this,ts).trim()!==babelHelpers.classPrivateFieldGet(this,es).value.trim()}},{key:"hasPureAddressString",value:function e(){return babelHelpers.classPrivateFieldGet(this,ss)!==""}},{key:"setValueFromAddress",value:function e(t){var s="";if(t){s=Qt(this,rs,bs).call(this,t,n.FormatTemplateType.AUTOCOMPLETE);if(s.trim()===""){s=Qt(this,rs,bs).call(this,t,n.FormatTemplateType.DEFAULT)}}this.setValue(s,true)}},{key:"value",get:function e(){return babelHelpers.classPrivateFieldGet(this,ts)}},{key:"customTail",get:function e(){if(babelHelpers.classPrivateFieldGet(this,ss)===""){return babelHelpers.classPrivateFieldGet(this,ts)}var t;if(!Qt(this,ls,os).call(this)){t=babelHelpers.classPrivateFieldGet(this,ts).slice(babelHelpers.classPrivateFieldGet(this,ss).length)}else{t=babelHelpers.classPrivateFieldGet(this,ts)}return t}}]);return e}();function ds(){if(Qt(this,ls,os).call(this)){babelHelpers.classPrivateFieldSet(this,ss,"")}}function os(){return babelHelpers.classPrivateFieldGet(this,ts)===""||babelHelpers.classPrivateFieldGet(this,ss)===""||babelHelpers.classPrivateFieldGet(this,ts).indexOf(babelHelpers.classPrivateFieldGet(this,ss))!==0}function bs(e,t){if(!babelHelpers.classPrivateFieldGet(this,is).isTemplateExists(t)){console.error('Address format "'.concat(babelHelpers.classPrivateFieldGet(this,is).code,'" does not have a template "').concat(t,'"'));return""}return n.AddressStringConverter.convertAddressToStringTemplate(e,babelHelpers.classPrivateFieldGet(this,is).getTemplate(t),n.AddressStringConverter.CONTENT_TYPE_TEXT,", ",babelHelpers.classPrivateFieldGet(this,is))}var cs,us;function ps(e,t){vs(e,t);t.add(e)}function hs(e,t,s){vs(e,t);t.set(e,s)}function vs(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function fs(e,t,s){Fs(e,t);Hs(s,"get");return Ps(e,s)}function Hs(e,t){if(e===undefined){throw new TypeError("attempted to "+t+" private static field before its declaration")}}function Fs(e,t){if(e!==t){throw new TypeError("Private static access of wrong provenance")}}function Ps(e,t){if(t.get){return t.get.call(e)}return t.value}function ms(e,t,s){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return s}var gs=new WeakMap;var Ts=new WeakMap;var ws=new WeakMap;var ys=new WeakMap;var Is=new WeakMap;var Gs=new WeakMap;var Ss=new WeakMap;var Es=new WeakMap;var ks=new WeakMap;var Cs=new WeakMap;var As=new WeakMap;var Ws=new WeakMap;var _s=new WeakMap;var Ms=new WeakMap;var zs=new WeakMap;var Ls=new WeakMap;var Os=new WeakMap;var Ns=new WeakMap;var Ds=new WeakMap;var Bs=new WeakSet;var Rs=new WeakSet;var Xs=new WeakSet;var xs=new WeakSet;var Us=new WeakSet;var Vs=new WeakSet;var Ys=new WeakSet;var js=new WeakSet;var Ks=new WeakSet;var $s=new WeakSet;var qs=new WeakSet;var Js=new WeakSet;var Zs=new WeakSet;var Qs=new WeakSet;var ei=new WeakSet;var ti=new WeakSet;var si=new WeakSet;var ii=new WeakSet;var ai=new WeakSet;var li=new WeakSet;var ri=new WeakSet;var ni=new WeakSet;var di=new WeakSet;var oi=new WeakSet;var bi=function(e){babelHelpers.inherits(t,e);function t(e){var s;babelHelpers.classCallCheck(this,t);s=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this,e));ps(babelHelpers.assertThisInitialized(s),oi);ps(babelHelpers.assertThisInitialized(s),di);ps(babelHelpers.assertThisInitialized(s),ni);ps(babelHelpers.assertThisInitialized(s),ri);ps(babelHelpers.assertThisInitialized(s),li);ps(babelHelpers.assertThisInitialized(s),ai);ps(babelHelpers.assertThisInitialized(s),ii);ps(babelHelpers.assertThisInitialized(s),si);ps(babelHelpers.assertThisInitialized(s),ti);ps(babelHelpers.assertThisInitialized(s),ei);ps(babelHelpers.assertThisInitialized(s),Qs);ps(babelHelpers.assertThisInitialized(s),Zs);ps(babelHelpers.assertThisInitialized(s),Js);ps(babelHelpers.assertThisInitialized(s),qs);ps(babelHelpers.assertThisInitialized(s),$s);ps(babelHelpers.assertThisInitialized(s),Ks);ps(babelHelpers.assertThisInitialized(s),js);ps(babelHelpers.assertThisInitialized(s),Ys);ps(babelHelpers.assertThisInitialized(s),Vs);ps(babelHelpers.assertThisInitialized(s),Us);ps(babelHelpers.assertThisInitialized(s),xs);ps(babelHelpers.assertThisInitialized(s),Xs);ps(babelHelpers.assertThisInitialized(s),Rs);ps(babelHelpers.assertThisInitialized(s),Bs);hs(babelHelpers.assertThisInitialized(s),gs,{writable:true,value:void 0});hs(babelHelpers.assertThisInitialized(s),Ts,{writable:true,value:null});hs(babelHelpers.assertThisInitialized(s),ws,{writable:true,value:void 0});hs(babelHelpers.assertThisInitialized(s),ys,{writable:true,value:void 0});hs(babelHelpers.assertThisInitialized(s),Is,{writable:true,value:void 0});hs(babelHelpers.assertThisInitialized(s),Gs,{writable:true,value:void 0});hs(babelHelpers.assertThisInitialized(s),Ss,{writable:true,value:void 0});hs(babelHelpers.assertThisInitialized(s),Es,{writable:true,value:void 0});hs(babelHelpers.assertThisInitialized(s),ks,{writable:true,value:void 0});hs(babelHelpers.assertThisInitialized(s),Cs,{writable:true,value:void 0});hs(babelHelpers.assertThisInitialized(s),As,{writable:true,value:null});hs(babelHelpers.assertThisInitialized(s),Ws,{writable:true,value:void 0});hs(babelHelpers.assertThisInitialized(s),_s,{writable:true,value:{requested:"",current:"",dropped:""}});hs(babelHelpers.assertThisInitialized(s),Ms,{writable:true,value:void 0});hs(babelHelpers.assertThisInitialized(s),zs,{writable:true,value:false});hs(babelHelpers.assertThisInitialized(s),Ls,{writable:true,value:false});hs(babelHelpers.assertThisInitialized(s),Os,{writable:true,value:false});hs(babelHelpers.assertThisInitialized(s),Ns,{writable:true,value:false});hs(babelHelpers.assertThisInitialized(s),Ds,{writable:true,value:null});s.setEventNamespace("BX.Location.Widget.Autocomplete");if(!(e.addressFormat instanceof n.Format)){throw new Error("props.addressFormat must be type of Format")}babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),ys,e.addressFormat);if(!(e.autocompleteService instanceof n.AutocompleteServiceBase)){throw new Error("props.autocompleteService must be type of AutocompleteServiceBase")}babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),Cs,e.autocompleteService);if(!e.languageId){throw new Error("props.languageId must be defined")}babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),ws,e.languageId);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),Is,e.sourceCode);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),gs,e.address);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),Es,e.presetLocationsProvider);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),Gs,e.locationRepository||new n.LocationRepository);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),Ss,e.userLocationPoint);ms(babelHelpers.assertThisInitialized(s),Zs,wi).call(babelHelpers.assertThisInitialized(s),c.INITIAL);return s}babelHelpers.createClass(t,[{key:"render",value:function e(t){babelHelpers.classPrivateFieldSet(this,Ws,t.inputNode);babelHelpers.classPrivateFieldSet(this,gs,t.address);babelHelpers.classPrivateFieldSet(this,Ts,new ns(babelHelpers.classPrivateFieldGet(this,Ws),babelHelpers.classPrivateFieldGet(this,ys),babelHelpers.classPrivateFieldGet(this,gs)));babelHelpers.classPrivateFieldGet(this,Ws).addEventListener("keydown",ms(this,ai,ki).bind(this));babelHelpers.classPrivateFieldGet(this,Ws).addEventListener("keyup",ms(this,li,Ci).bind(this));babelHelpers.classPrivateFieldGet(this,Ws).addEventListener("focus",ms(this,Ys,Hi).bind(this));babelHelpers.classPrivateFieldGet(this,Ws).addEventListener("focusout",ms(this,Vs,fi).bind(this));babelHelpers.classPrivateFieldGet(this,Ws).addEventListener("click",ms(this,Bs,ci).bind(this));babelHelpers.classPrivateFieldGet(this,Ws).addEventListener("paste",ms(this,ri,Ai).bind(this));babelHelpers.classPrivateFieldSet(this,ks,new Xt({inputNode:t.inputNode,menuNode:t.menuNode}));babelHelpers.classPrivateFieldGet(this,ks).subscribe(Xt.onItemSelectedEvent,ms(this,Js,Ti).bind(this));document.addEventListener("click",ms(this,Ks,Pi).bind(this))}},{key:"onAddressChangedEventSubscribe",value:function e(s){this.subscribe(fs(t,t,zi),s)}},{key:"onStateChangedEventSubscribe",value:function e(s){this.subscribe(fs(t,t,Li),s)}},{key:"onSearchStartedEventSubscribe",value:function e(s){this.subscribe(fs(t,t,Oi),s)}},{key:"onSearchCompletedEventSubscribe",value:function e(s){this.subscribe(fs(t,t,Ni),s)}},{key:"onShowOnMapClickedEventSubscribe",value:function e(s){this.subscribe(fs(t,t,Di),s)}},{key:"showPrompt",value:function e(t){babelHelpers.classPrivateFieldGet(this,_s).requested=t;babelHelpers.classPrivateFieldGet(this,_s).current=t;babelHelpers.classPrivateFieldGet(this,_s).dropped="";ms(this,di,_i).call(this,t)}},{key:"closePrompt",value:function e(){if(babelHelpers.classPrivateFieldGet(this,ks)){babelHelpers.classPrivateFieldGet(this,ks).close()}}},{key:"isPromptShown",value:function e(){if(babelHelpers.classPrivateFieldGet(this,ks)){babelHelpers.classPrivateFieldGet(this,ks).isShown()}}},{key:"destroy",value:function e(){if(babelHelpers.classPrivateFieldGet(this,Ls)){return}b.Event.unbindAll(this);if(babelHelpers.classPrivateFieldGet(this,ks)){babelHelpers.classPrivateFieldGet(this,ks).destroy();babelHelpers.classPrivateFieldSet(this,ks,null)}babelHelpers.classPrivateFieldSet(this,As,null);if(babelHelpers.classPrivateFieldGet(this,Ws)){babelHelpers.classPrivateFieldGet(this,Ws).removeEventListener("keydown",ms(this,ai,ki));babelHelpers.classPrivateFieldGet(this,Ws).removeEventListener("keyup",ms(this,li,Ci));babelHelpers.classPrivateFieldGet(this,Ws).removeEventListener("focus",ms(this,Ys,Hi));babelHelpers.classPrivateFieldGet(this,Ws).removeEventListener("focusout",ms(this,Vs,fi));babelHelpers.classPrivateFieldGet(this,Ws).removeEventListener("click",ms(this,Bs,ci));babelHelpers.classPrivateFieldGet(this,Ws).removeEventListener("paste",ms(this,ri,Ai))}document.removeEventListener("click",ms(this,Ks,Pi));babelHelpers.classPrivateFieldSet(this,Ls,true)}},{key:"address",set:function e(t){babelHelpers.classPrivateFieldSet(this,gs,t);if(babelHelpers.classPrivateFieldGet(this,Ts)){babelHelpers.classPrivateFieldGet(this,Ts).setValueFromAddress(babelHelpers.classPrivateFieldGet(this,gs))}if(!t){babelHelpers.classPrivateFieldSet(this,zs,true)}},get:function e(){return babelHelpers.classPrivateFieldGet(this,gs)}},{key:"state",get:function e(){return babelHelpers.classPrivateFieldGet(this,Ms)}}]);return t}(o.EventEmitter);function ci(e){var t=babelHelpers.classPrivateFieldGet(this,Ts).value;if(t.length===0){ms(this,Rs,ui).call(this)}}function ui(){var e=babelHelpers.classPrivateFieldGet(this,Es).call(this);babelHelpers.classPrivateFieldGet(this,ks).setMenuItems(e,"");var t;if(e.length>0){t=b.Loc.getMessage("LOCATION_WIDGET_PICK_ADDRESS_OR_SHOW_ON_MAP")}else{t=b.Loc.getMessage("LOCATION_WIDGET_START_PRINTING_OR_SHOW_ON_MAP")}ms(this,Us,vi).call(this,t,null)}function pi(e){var t=b.Tag.render(cs||(cs=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<span class="location-map-popup-item--show-on-map">\n\t\t\t\t\t',"\n\t\t\t\t</span>\n\t\t"])),b.Loc.getMessage("LOCATION_WIDGET_SHOW_ON_MAP"));t.addEventListener("click",ms(this,qs,gi).call(this,e));return t}function hi(e){return b.Tag.render(us||(us=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<span>\n\t\t\t\t\t<span class="menu-popup-item-icon"></span>\n\t\t\t\t\t<span class="menu-popup-item-text">',"</span>\n\t\t\t\t</span>\n\t\t"])),e)}function vi(e,t){babelHelpers.classPrivateFieldGet(this,ks).getMenu().setBottomRightItemNode(ms(this,Xs,pi).call(this,t));babelHelpers.classPrivateFieldGet(this,ks).getMenu().setBottomLeftItemNode(ms(this,xs,hi).call(this,e));babelHelpers.classPrivateFieldGet(this,ks).getMenu().show()}function fi(e){if(babelHelpers.classPrivateFieldGet(this,Ls)){return}if(babelHelpers.classPrivateFieldGet(this,Ms)===c.DATA_INPUTTING&&!(e.relatedTarget&&e.relatedTarget.getAttribute("data-role")==="location-widget-menu-item")){ms(this,Zs,wi).call(this,c.DATA_SUPPOSED);var t=false;if(babelHelpers.classPrivateFieldGet(this,Ts)){if(!babelHelpers.classPrivateFieldGet(this,gs)||!babelHelpers.classPrivateFieldGet(this,Ts).hasPureAddressString()){babelHelpers.classPrivateFieldSet(this,gs,ms(this,si,Si).call(this,babelHelpers.classPrivateFieldGet(this,Ts).value));t=true}else if(babelHelpers.classPrivateFieldGet(this,Ts).customTail!==""){var s=babelHelpers.classPrivateFieldGet(this,gs).getFieldValue(babelHelpers.classPrivateFieldGet(this,ys).fieldForUnRecognized);var i=s?s+babelHelpers.classPrivateFieldGet(this,Ts).customTail:babelHelpers.classPrivateFieldGet(this,Ts).customTail;babelHelpers.classPrivateFieldGet(this,gs).setFieldValue(babelHelpers.classPrivateFieldGet(this,ys).fieldForUnRecognized,i);t=true}}if(t){babelHelpers.classPrivateFieldGet(this,Ts).setValueFromAddress(babelHelpers.classPrivateFieldGet(this,gs));ms(this,ei,Ii).call(this,[],{storeAsLastAddress:false})}}e.stopImmediatePropagation()}function Hi(){var e=this;if(babelHelpers.classPrivateFieldGet(this,Ls)){return}if(!babelHelpers.classPrivateFieldGet(this,gs)){var t=n.Storage.getInstance().lastAddress;if(t&&t.fieldCollection.isFieldExists(n.AddressType.LOCALITY)&&!babelHelpers.classPrivateFieldGet(this,zs)){var s={};s[n.AddressType.LOCALITY]=t.fieldCollection.getFieldValue(n.AddressType.LOCALITY);if(t.fieldCollection.isFieldExists(n.AddressType.COUNTRY)){s[n.AddressType.COUNTRY]=t.fieldCollection.getFieldValue(n.AddressType.COUNTRY)}if(t.fieldCollection.isFieldExists(n.AddressType.ADM_LEVEL_1)){s[n.AddressType.ADM_LEVEL_1]=t.fieldCollection.getFieldValue(n.AddressType.ADM_LEVEL_1)}if(["RU","RU_2"].includes(babelHelpers.classPrivateFieldGet(this,ys).code)){s[n.AddressType.ADDRESS_LINE_2]=", "}babelHelpers.classPrivateFieldSet(this,gs,new n.Address({languageId:t.languageId,fieldCollection:s}));babelHelpers.classPrivateFieldGet(this,Ts).setValueFromAddress(babelHelpers.classPrivateFieldGet(this,gs));ms(this,Zs,wi).call(this,c.DATA_SUPPOSED);ms(this,ei,Ii).call(this,[],{storeAsLastAddress:false});setTimeout((function(){BX.setCaretPosition(babelHelpers.classPrivateFieldGet(e,Ws),babelHelpers.classPrivateFieldGet(e,Ws).value.length)}),0)}}else{if(babelHelpers.classPrivateFieldGet(this,gs)&&(!babelHelpers.classPrivateFieldGet(this,gs).location||!babelHelpers.classPrivateFieldGet(this,gs).location.hasExternalRelation())&&babelHelpers.classPrivateFieldGet(this,Ts).value.length>0){this.showPrompt(babelHelpers.classPrivateFieldGet(this,Ts).value)}}}function Fi(){var e={};if(babelHelpers.classPrivateFieldGet(this,gs)&&babelHelpers.classPrivateFieldGet(this,gs).latitude&&babelHelpers.classPrivateFieldGet(this,gs).longitude){e.biasPoint=new n.Point(babelHelpers.classPrivateFieldGet(this,gs).latitude,babelHelpers.classPrivateFieldGet(this,gs).longitude)}return e}function Pi(e){if(babelHelpers.classPrivateFieldGet(this,Ls)){return}if(e.target===babelHelpers.classPrivateFieldGet(this,Ws)){return}if(babelHelpers.classPrivateFieldGet(this,ks).isShown()){babelHelpers.classPrivateFieldGet(this,ks).close()}}function mi(e,t){var s=this;if(Array.isArray(e)&&e.length>0){if(e.length===1&&babelHelpers.classPrivateFieldGet(this,gs)&&babelHelpers.classPrivateFieldGet(this,gs).location&&babelHelpers.classPrivateFieldGet(this,gs).location.externalId&&babelHelpers.classPrivateFieldGet(this,gs).location.externalId===e[0].externalId){this.closePrompt();return}babelHelpers.classPrivateFieldGet(this,ks).setMenuItems(e,babelHelpers.classPrivateFieldGet(this,_s).requested,this.address);ms(this,Us,vi).call(this,b.Loc.getMessage("LOCATION_WIDGET_PICK_ADDRESS_OR_SHOW_ON_MAP"),e[0])}else{babelHelpers.classPrivateFieldGet(this,ks).getMenu().clearItems();babelHelpers.classPrivateFieldGet(this,ks).getMenu().addMenuItem({id:"notFound",html:"<span>".concat(b.Loc.getMessage("LOCATION_WIDGET_PROMPT_ADDRESS_NOT_FOUND"),"</span>"),onclick:function e(t,i){babelHelpers.classPrivateFieldGet(s,ks).close()}});ms(this,Us,vi).call(this,b.Loc.getMessage("LOCATION_WIDGET_CHECK_ADDRESS_OR_SHOW_ON_MAP"),null)}}function gi(e){var t=this;return function(){if(e){ms(t,Qs,yi).call(t,e);return}setTimeout((function(){t.emit(fs(bi,bi,Di))}),1)}}function Ti(e){if(e.data.location){ms(this,Qs,yi).call(this,e.data.location)}}function wi(e){babelHelpers.classPrivateFieldSet(this,Ms,e);this.emit(fs(bi,bi,Li),{state:babelHelpers.classPrivateFieldGet(this,Ms)})}function yi(e){var t=this;var s;ms(this,Zs,wi).call(this,c.DATA_SELECTED);if(e){if(e.hasExternalRelation()&&babelHelpers.classPrivateFieldGet(this,Is)===e.sourceCode){s=ms(this,ti,Gi).call(this,e).then((function(s){if(e.address&&e.address.getFieldValue(n.AddressType.ADDRESS_LINE_2)){var i="";if(s.address.getFieldValue(n.AddressType.ADDRESS_LINE_2)){i=s.address.getFieldValue(n.AddressType.ADDRESS_LINE_2);i+=", "}i+=e.address.getFieldValue(n.AddressType.ADDRESS_LINE_2);s.address.setFieldValue(n.AddressType.ADDRESS_LINE_2,i)}ms(t,ni,Wi).call(t,s,0);return true}),(function(e){return n.ErrorPublisher.getInstance().notify(e.errors)}))}else{s=new Promise((function(s){setTimeout((function(){ms(t,ni,Wi).call(t,e,0);s()}),0)}))}}else{s=new Promise((function(e){setTimeout((function(){ms(t,ni,Wi).call(t,null,0);e()}),0)}))}return s}function Ii(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.emit(fs(bi,bi,zi),{address:babelHelpers.classPrivateFieldGet(this,gs),excludeSetAddressFeatures:e,options:t})}function Gi(e){var t=this;ms(this,Zs,wi).call(this,c.DATA_LOADING);return babelHelpers.classPrivateFieldGet(this,Gs).findByExternalId(e.externalId,e.sourceCode,e.languageId).then((function(s){ms(t,Zs,wi).call(t,c.DATA_LOADED);var i;if(s.latitude!=="0"&&s.longitude!=="0"&&s!==""){i=s;i.name=e.name}else{i=e}return i}),(function(e){n.ErrorPublisher.getInstance().notify(e.errors)}))}function Si(e){var t=new n.Address({languageId:babelHelpers.classPrivateFieldGet(this,ws)});t.setFieldValue(babelHelpers.classPrivateFieldGet(this,ys).fieldForUnRecognized,e);return t}function Ei(e){babelHelpers.classPrivateFieldSet(this,gs,e?e.toAddress():null);babelHelpers.classPrivateFieldGet(this,Ts).setValueFromAddress(babelHelpers.classPrivateFieldGet(this,gs));ms(this,ei,Ii).call(this)}function ki(e){if(!(babelHelpers.classPrivateFieldGet(this,Ws)&&babelHelpers.classPrivateFieldGet(this,Ws).selectionStart===0&&babelHelpers.classPrivateFieldGet(this,Ws).selectionEnd===babelHelpers.classPrivateFieldGet(this,Ws).value.length)){return}if(e.code==="Backspace"||e.code==="Delete"||e.code==="KeyV"&&(e.ctrlKey||e.metaKey)||e.code==="KeyX"&&(e.ctrlKey||e.metaKey)||e.code==="Insert"&&e.shiftKey||!(e.ctrlKey||e.metaKey)&&babelHelpers.toConsumableArray(e.key).length===1){this.address=null;ms(this,ei,Ii).call(this)}}function Ci(e){var t=this;if(babelHelpers.classPrivateFieldGet(this,Ls)){return}if(babelHelpers.classPrivateFieldGet(this,Ms)!==c.DATA_INPUTTING&&babelHelpers.classPrivateFieldGet(this,Ts).isChanged()){ms(this,Zs,wi).call(this,c.DATA_INPUTTING)}if(babelHelpers.classPrivateFieldGet(this,ks).isShown()){var s;var i=700;switch(e.code){case"NumpadEnter":case"Enter":if(babelHelpers.classPrivateFieldGet(this,ks).isItemChosen()){ms(this,Qs,yi).call(this,babelHelpers.classPrivateFieldGet(this,ks).getChosenItem()).then((function(){babelHelpers.classPrivateFieldGet(t,ks).close()}),(function(e){return BX.debug(e)}))}return;case"Tab":case"Escape":ms(this,Zs,wi).call(this,c.DATA_SUPPOSED);ms(this,ei,Ii).call(this);babelHelpers.classPrivateFieldGet(this,ks).close();return;case"ArrowUp":s=babelHelpers.classPrivateFieldGet(this,ks).choosePrevItem();if(s&&s.address){ms(this,ni,Wi).call(this,s,i)}return;case"ArrowDown":s=babelHelpers.classPrivateFieldGet(this,ks).chooseNextItem();if(s&&s.address){ms(this,ni,Wi).call(this,s,i)}return}}if(babelHelpers.classPrivateFieldGet(this,Ts).isChanged()){babelHelpers.classPrivateFieldGet(this,Ts).actualize();this.showPrompt(babelHelpers.classPrivateFieldGet(this,Ts).value)}if(babelHelpers.classPrivateFieldGet(this,Ts).value.length===0){ms(this,Rs,ui).call(this)}}function Ai(){var e=this;setTimeout((function(){if(babelHelpers.classPrivateFieldGet(e,Ms)!==c.DATA_INPUTTING&&babelHelpers.classPrivateFieldGet(e,Ts).isChanged()){ms(e,Zs,wi).call(e,c.DATA_INPUTTING)}if(babelHelpers.classPrivateFieldGet(e,Ts).isChanged()){babelHelpers.classPrivateFieldGet(e,Ts).actualize();e.showPrompt(babelHelpers.classPrivateFieldGet(e,Ts).value)}}),0)}function Wi(e,t){var s=this;if(babelHelpers.classPrivateFieldGet(this,Ds)!==null){clearTimeout(babelHelpers.classPrivateFieldGet(this,Ds))}babelHelpers.classPrivateFieldSet(this,Ds,setTimeout((function(){ms(s,ii,Ei).call(s,e)}),t))}function _i(e){if(e.length<=3){return}if(babelHelpers.classPrivateFieldGet(this,As)!==null){clearTimeout(babelHelpers.classPrivateFieldGet(this,As))}babelHelpers.classPrivateFieldSet(this,As,ms(this,oi,Mi).call(this,e))}function Mi(e){var t=this;return setTimeout((function(){if(babelHelpers.classPrivateFieldGet(t,Os)){clearTimeout(babelHelpers.classPrivateFieldGet(t,As));babelHelpers.classPrivateFieldSet(t,As,ms(t,oi,Mi).call(t,e));babelHelpers.classPrivateFieldSet(t,Ns,true);return}babelHelpers.classPrivateFieldSet(t,Ns,false);t.emit(fs(bi,bi,Oi));babelHelpers.classPrivateFieldSet(t,Os,true);var s=ms(t,js,Fi).call(t);babelHelpers.classPrivateFieldGet(t,Cs).autocomplete(e,s).then((function(e){babelHelpers.classPrivateFieldSet(t,As,null);if(!babelHelpers.classPrivateFieldGet(t,Ns)){ms(t,$s,mi).call(t,e,s);t.emit(fs(bi,bi,Ni))}babelHelpers.classPrivateFieldSet(t,Os,false)}),(function(e){if(!babelHelpers.classPrivateFieldGet(t,Ns)){t.emit(fs(bi,bi,Ni))}babelHelpers.classPrivateFieldSet(t,Os,false);BX.debug(e)}))}),300)}var zi={writable:true,value:"onAddressChanged"};var Li={writable:true,value:"onStateChanged"};var Oi={writable:true,value:"onSearchStarted"};var Ni={writable:true,value:"onSearchCompleted"};var Di={writable:true,value:"onShowOnMapClicked"};var Bi,Ri;function Xi(e,t,s){xi(e,t);t.set(e,s)}function xi(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}var Ui=new WeakMap;var Vi=new WeakMap;var Yi=new WeakMap;var ji=new WeakMap;var Ki=new WeakMap;var $i=function(){function e(t){babelHelpers.classCallCheck(this,e);Xi(this,Ui,{writable:true,value:void 0});Xi(this,Vi,{writable:true,value:void 0});Xi(this,Yi,{writable:true,value:void 0});Xi(this,ji,{writable:true,value:void 0});Xi(this,Ki,{writable:true,value:void 0});babelHelpers.classPrivateFieldSet(this,Vi,t.url);babelHelpers.classPrivateFieldSet(this,Yi,t.link||"");babelHelpers.classPrivateFieldSet(this,Ui,t.description||"");babelHelpers.classPrivateFieldSet(this,ji,t.location);babelHelpers.classPrivateFieldSet(this,Ki,t.title||"")}babelHelpers.createClass(e,[{key:"render",value:function e(){var t="";if(babelHelpers.classPrivateFieldGet(this,Ui)){t=b.Tag.render(Bi||(Bi=babelHelpers.taggedTemplateLiteral(['<span class="location-map-item-description">',"</span>"])),babelHelpers.classPrivateFieldGet(this,Ui))}return b.Tag.render(Ri||(Ri=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div class="location-map-photo-item-block">\n\t\t\t\t<span class="location-map-photo-item-block-image-block-inner">\n\t\t\t\t\t','\n\t\t\t\t\t<span \n\t\t\t\t\t\tdata-viewer data-viewer-type="image" \n\t\t\t\t\t\tdata-src="','" \n\t\t\t\t\t\tdata-title="','"\n\t\t\t\t\t\tclass="location-map-item-photo-image" \n\t\t\t\t\t\tdata-viewer-group-by="','"\n\t\t\t\t\t\tstyle="background-image: url(',');">\t\t\t\t\t\t\t\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t</div>'])),t,babelHelpers.classPrivateFieldGet(this,Yi),babelHelpers.classPrivateFieldGet(this,Ki),babelHelpers.classPrivateFieldGet(this,ji).externalId,babelHelpers.classPrivateFieldGet(this,Vi))}}]);return e}();var qi,Ji;function Zi(e,t){var s=typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!s){if(Array.isArray(e)||(s=Qi(e))||t&&e&&typeof e.length==="number"){if(s)e=s;var i=0;var a=function e(){};return{s:a,n:function t(){if(i>=e.length)return{done:true};return{done:false,value:e[i++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l=true,r=false,n;return{s:function t(){s=s.call(e)},n:function e(){var t=s.next();l=t.done;return t},e:function e(t){r=true;n=t},f:function e(){try{if(!l&&s["return"]!=null)s["return"]()}finally{if(r)throw n}}}}function Qi(e,t){if(!e)return;if(typeof e==="string")return ea(e,t);var s=Object.prototype.toString.call(e).slice(8,-1);if(s==="Object"&&e.constructor)s=e.constructor.name;if(s==="Map"||s==="Set")return Array.from(e);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return ea(e,t)}function ea(e,t){if(t==null||t>e.length)t=e.length;for(var s=0,i=new Array(t);s<t;s++)i[s]=e[s];return i}function ta(e,t){ia(e,t);t.add(e)}function sa(e,t,s){ia(e,t);t.set(e,s)}function ia(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function aa(e,t,s){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return s}var la=new WeakMap;var ra=new WeakMap;var na=new WeakMap;var da=new WeakMap;var oa=new WeakMap;var ba=new WeakMap;var ca=new WeakMap;var ua=new WeakMap;var pa=new WeakSet;var ha=new WeakSet;var va=function(){function e(t){babelHelpers.classCallCheck(this,e);ta(this,ha);ta(this,pa);sa(this,la,{writable:true,value:[]});sa(this,ra,{writable:true,value:null});sa(this,na,{writable:true,value:null});sa(this,da,{writable:true,value:void 0});sa(this,oa,{writable:true,value:void 0});sa(this,ba,{writable:true,value:void 0});sa(this,ca,{writable:true,value:void 0});sa(this,ua,{writable:true,value:void 0});babelHelpers.classPrivateFieldSet(this,da,t.thumbnailHeight);babelHelpers.classPrivateFieldSet(this,oa,t.thumbnailWidth);babelHelpers.classPrivateFieldSet(this,ca,t.maxPhotoCount);babelHelpers.classPrivateFieldSet(this,ba,t.photoService)}babelHelpers.createClass(e,[{key:"refresh",value:function e(){var t=this;if(babelHelpers.classPrivateFieldGet(this,ua)){babelHelpers.classPrivateFieldGet(this,ba).requestPhotos({location:babelHelpers.classPrivateFieldGet(this,ua),thumbnailHeight:babelHelpers.classPrivateFieldGet(this,da),thumbnailWidth:babelHelpers.classPrivateFieldGet(this,oa),maxPhotoCount:babelHelpers.classPrivateFieldGet(this,ca)}).then((function(e){if(Array.isArray(e)&&e.length>0){aa(t,pa,fa).call(t,e);t.show()}else{t.hide()}}))}else{this.hide()}}},{key:"hide",value:function e(){if(babelHelpers.classPrivateFieldGet(this,ra)){babelHelpers.classPrivateFieldGet(this,ra).style.display="none"}}},{key:"isHidden",value:function e(){return!babelHelpers.classPrivateFieldGet(this,ra)||babelHelpers.classPrivateFieldGet(this,ra).clientWidth<=0}},{key:"show",value:function e(){if(babelHelpers.classPrivateFieldGet(this,ra)){babelHelpers.classPrivateFieldGet(this,ra).style.display="block"}}},{key:"render",value:function e(){babelHelpers.classPrivateFieldSet(this,na,b.Tag.render(qi||(qi=babelHelpers.taggedTemplateLiteral(['\t\t\t\t\t\n\t\t\t\t<div class="location-map-photo-inner">\t\t\t\t\t\n\t\t\t\t</div>']))));babelHelpers.classPrivateFieldSet(this,ra,b.Tag.render(Ji||(Ji=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div class="location-map-photo-container">\n\t\t\t\t',"\n\t\t\t</div>"])),babelHelpers.classPrivateFieldGet(this,na)));return babelHelpers.classPrivateFieldGet(this,ra)}},{key:"location",set:function e(t){babelHelpers.classPrivateFieldSet(this,ua,t);this.refresh()}}]);return e}();function fa(e){if(!babelHelpers.classPrivateFieldGet(this,ua)){return}var t=[];var s=Zi(e),i;try{for(s.s();!(i=s.n()).done;){var a=i.value;t.push(new $i({url:a.thumbnail.url,link:a.url,location:babelHelpers.classPrivateFieldGet(this,ua),title:babelHelpers.classPrivateFieldGet(this,ua).name+" ( "+BX.util.strip_tags(a.description)+" )"}))}}catch(e){s.e(e)}finally{s.f()}if(!Array.isArray(t)){BX.debug("Wrong type of photos. Must be array");return}babelHelpers.classPrivateFieldSet(this,la,[]);for(var l=0,r=t;l<r.length;l++){var n=r[l];babelHelpers.classPrivateFieldGet(this,la).push(n)}if(babelHelpers.classPrivateFieldGet(this,la).length>0&&babelHelpers.classPrivateFieldGet(this,na)){var d=babelHelpers.classPrivateFieldGet(this,la)?aa(this,ha,Ha).call(this,babelHelpers.classPrivateFieldGet(this,la)):"";babelHelpers.classPrivateFieldGet(this,na).innerHTML="";if(d.length>0){var o=Zi(d),b;try{for(o.s();!(b=o.n()).done;){var c=b.value;babelHelpers.classPrivateFieldGet(this,na).appendChild(c)}}catch(e){o.e(e)}finally{o.f()}}}}function Ha(e){var t=[];var s=Zi(e),i;try{for(s.s();!(i=s.n()).done;){var a=i.value;t.push(a.render())}}catch(e){s.e(e)}finally{s.f()}return t}var Fa,Pa,ma,ga;function Ta(e,t){ya(e,t);t.add(e)}function wa(e,t,s){ya(e,t);t.set(e,s)}function ya(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function Ia(e,t,s){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return s}function Ga(e,t,s){Ea(e,t);Sa(s,"get");return ka(e,s)}function Sa(e,t){if(e===undefined){throw new TypeError("attempted to "+t+" private static field before its declaration")}}function Ea(e,t){if(e!==t){throw new TypeError("Private static access of wrong provenance")}}function ka(e,t){if(t.get){return t.get.call(e)}return t.value}var Ca=new WeakMap;var Aa=new WeakMap;var Wa=new WeakMap;var _a=new WeakMap;var Ma=new WeakMap;var za=new WeakMap;var La=new WeakMap;var Oa=new WeakMap;var Na=new WeakMap;var Da=new WeakSet;var Ba=new WeakSet;var Ra=new WeakSet;var Xa=new WeakSet;var xa=function(e){babelHelpers.inherits(t,e);function t(e){var s;babelHelpers.classCallCheck(this,t);s=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this,e));Ta(babelHelpers.assertThisInitialized(s),Xa);Ta(babelHelpers.assertThisInitialized(s),Ra);Ta(babelHelpers.assertThisInitialized(s),Ba);Ta(babelHelpers.assertThisInitialized(s),Da);wa(babelHelpers.assertThisInitialized(s),Ca,{writable:true,value:void 0});wa(babelHelpers.assertThisInitialized(s),Aa,{writable:true,value:void 0});wa(babelHelpers.assertThisInitialized(s),Wa,{writable:true,value:void 0});wa(babelHelpers.assertThisInitialized(s),_a,{writable:true,value:void 0});wa(babelHelpers.assertThisInitialized(s),Ma,{writable:true,value:void 0});wa(babelHelpers.assertThisInitialized(s),za,{writable:true,value:void 0});wa(babelHelpers.assertThisInitialized(s),La,{writable:true,value:void 0});wa(babelHelpers.assertThisInitialized(s),Oa,{writable:true,value:null});wa(babelHelpers.assertThisInitialized(s),Na,{writable:true,value:c.INITIAL});s.setEventNamespace("BX.Location.Widget.Field");babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),Ca,e.title);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),Wa,e.type);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),_a,e.sort);return s}babelHelpers.createClass(t,[{key:"render",value:function e(t){babelHelpers.classPrivateFieldSet(this,Aa,typeof t.value==="string"?t.value:"");if(!n.ControlMode.isValid(t.mode)){BX.debug("props.mode must be valid ControlMode")}babelHelpers.classPrivateFieldSet(this,Ma,t.mode);babelHelpers.classPrivateFieldSet(this,Oa,b.Tag.render(Fa||(Fa=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div class="ui-entity-editor-content-block ui-entity-editor-field-text">\n\t\t\t\t<div class="ui-entity-editor-block-title">\n\t\t\t\t\t<label class="ui-entity-editor-block-title-text">',":</label>\t\t\t\t\n\t\t\t\t</div>\n\t\t\t</div>"])),babelHelpers.classPrivateFieldGet(this,Ca)));if(babelHelpers.classPrivateFieldGet(this,Ma)===n.ControlMode.edit){Ia(this,Ba,Va).call(this,babelHelpers.classPrivateFieldGet(this,Oa))}else{Ia(this,Ra,Ya).call(this,babelHelpers.classPrivateFieldGet(this,Oa))}return babelHelpers.classPrivateFieldGet(this,Oa)}},{key:"subscribeOnValueChangedEvent",value:function e(s){this.subscribe(Ga(t,t,Ka),s)}},{key:"subscribeOnStateChangedEvent",value:function e(s){this.subscribe(Ga(t,t,$a),s)}},{key:"destroy",value:function e(){b.Dom.remove(babelHelpers.classPrivateFieldGet(this,Oa));b.Event.unbindAll(this);babelHelpers.classPrivateFieldSet(this,Oa,null)}},{key:"container",get:function e(){return babelHelpers.classPrivateFieldGet(this,Oa)}},{key:"state",get:function e(){return babelHelpers.classPrivateFieldGet(this,Na)}},{key:"type",set:function e(t){babelHelpers.classPrivateFieldSet(this,Wa,t)},get:function e(){return babelHelpers.classPrivateFieldGet(this,Wa)}},{key:"sort",set:function e(t){babelHelpers.classPrivateFieldSet(this,_a,t)},get:function e(){return babelHelpers.classPrivateFieldGet(this,_a)}},{key:"value",set:function e(t){babelHelpers.classPrivateFieldSet(this,Aa,typeof t==="string"?t:"");Ia(this,Xa,ja).call(this)},get:function e(){return babelHelpers.classPrivateFieldGet(this,Aa)}}]);return t}(o.EventEmitter);function Ua(e){babelHelpers.classPrivateFieldSet(this,Na,e);this.emit(Ga(xa,xa,$a),{state:babelHelpers.classPrivateFieldGet(this,Na)})}function Va(e){var t=this;babelHelpers.classPrivateFieldSet(this,za,b.Tag.render(Pa||(Pa=babelHelpers.taggedTemplateLiteral(['<input type="text" class="ui-ctl-element" value="','">'])),b.Text.encode(babelHelpers.classPrivateFieldGet(this,Aa))));babelHelpers.classPrivateFieldSet(this,La,null);b.Event.bind(babelHelpers.classPrivateFieldGet(this,za),"focus",(function(e){Ia(t,Da,Ua).call(t,c.DATA_INPUTTING)}));b.Event.bind(babelHelpers.classPrivateFieldGet(this,za),"focusout",(function(e){Ia(t,Da,Ua).call(t,c.DATA_SELECTED)}));b.Event.bind(babelHelpers.classPrivateFieldGet(this,za),"change",(function(e){Ia(t,Da,Ua).call(t,c.DATA_SELECTED);babelHelpers.classPrivateFieldSet(t,Aa,babelHelpers.classPrivateFieldGet(t,za).value);t.emit(Ga(xa,xa,Ka),{value:t})}));e.appendChild(b.Tag.render(ma||(ma=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-entity-editor-content-block">\n\t\t\t\t\t<div class="ui-ctl ui-ctl-textbox ui-ctl-w100">\n\t\t\t\t\t\t',"\n\t\t\t\t\t</div>\n\t\t\t\t</div>"])),babelHelpers.classPrivateFieldGet(this,za)))}function Ya(e){babelHelpers.classPrivateFieldSet(this,za,null);babelHelpers.classPrivateFieldSet(this,La,b.Tag.render(ga||(ga=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div class="ui-title-6">\n\t\t\t\t',"\n\t\t\t</div>"])),b.Text.encode(babelHelpers.classPrivateFieldGet(this,Aa))));e.appendChild(babelHelpers.classPrivateFieldGet(this,La))}function ja(){if(babelHelpers.classPrivateFieldGet(this,Ma)===n.ControlMode.edit){babelHelpers.classPrivateFieldGet(this,za).value=babelHelpers.classPrivateFieldGet(this,Aa)}else{babelHelpers.classPrivateFieldGet(this,La).innerHTML=b.Text.encode(babelHelpers.classPrivateFieldGet(this,Aa))}}var Ka={writable:true,value:"onValueChanged"};var $a={writable:true,value:"onStateChanged"};function qa(e,t){var s=typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!s){if(Array.isArray(e)||(s=Ja(e))||t&&e&&typeof e.length==="number"){if(s)e=s;var i=0;var a=function e(){};return{s:a,n:function t(){if(i>=e.length)return{done:true};return{done:false,value:e[i++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l=true,r=false,n;return{s:function t(){s=s.call(e)},n:function e(){var t=s.next();l=t.done;return t},e:function e(t){r=true;n=t},f:function e(){try{if(!l&&s["return"]!=null)s["return"]()}finally{if(r)throw n}}}}function Ja(e,t){if(!e)return;if(typeof e==="string")return Za(e,t);var s=Object.prototype.toString.call(e).slice(8,-1);if(s==="Object"&&e.constructor)s=e.constructor.name;if(s==="Map"||s==="Set")return Array.from(e);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return Za(e,t)}function Za(e,t){if(t==null||t>e.length)t=e.length;for(var s=0,i=new Array(t);s<t;s++)i[s]=e[s];return i}function Qa(e,t){tl(e,t);t.add(e)}function el(e,t,s){tl(e,t);t.set(e,s)}function tl(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function sl(e,t,s){al(e,t);il(s,"get");return ll(e,s)}function il(e,t){if(e===undefined){throw new TypeError("attempted to "+t+" private static field before its declaration")}}function al(e,t){if(e!==t){throw new TypeError("Private static access of wrong provenance")}}function ll(e,t){if(t.get){return t.get.call(e)}return t.value}function rl(e,t,s){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return s}var nl=new WeakMap;var dl=new WeakMap;var ol=new WeakMap;var bl=new WeakMap;var cl=new WeakMap;var ul=new WeakMap;var pl=new WeakMap;var hl=new WeakSet;var vl=new WeakSet;var fl=new WeakSet;var Hl=function(e){babelHelpers.inherits(t,e);function t(e){var s;babelHelpers.classCallCheck(this,t);s=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this,e));Qa(babelHelpers.assertThisInitialized(s),fl);Qa(babelHelpers.assertThisInitialized(s),vl);Qa(babelHelpers.assertThisInitialized(s),hl);el(babelHelpers.assertThisInitialized(s),nl,{writable:true,value:void 0});el(babelHelpers.assertThisInitialized(s),dl,{writable:true,value:void 0});el(babelHelpers.assertThisInitialized(s),ol,{writable:true,value:void 0});el(babelHelpers.assertThisInitialized(s),bl,{writable:true,value:[]});el(babelHelpers.assertThisInitialized(s),cl,{writable:true,value:void 0});el(babelHelpers.assertThisInitialized(s),ul,{writable:true,value:void 0});el(babelHelpers.assertThisInitialized(s),pl,{writable:true,value:void 0});s.setEventNamespace("BX.Location.Widget.Fields");if(!(e.addressFormat instanceof n.Format)){BX.debug("addressFormat must be instance of Format")}babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),dl,e.addressFormat);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),cl,e.languageId);rl(babelHelpers.assertThisInitialized(s),hl,Fl).call(babelHelpers.assertThisInitialized(s));return s}babelHelpers.createClass(t,[{key:"render",value:function e(t){if(t.address&&!(t.address instanceof n.Address)){BX.debug("props.address must be instance of Address")}babelHelpers.classPrivateFieldSet(this,nl,t.address);if(!n.ControlMode.isValid(t.mode)){BX.debug("props.mode must be valid ControlMode")}babelHelpers.classPrivateFieldSet(this,ol,t.mode);if(!b.Type.isDomNode(t.container)){BX.debug("props.container must be dom node")}babelHelpers.classPrivateFieldSet(this,ul,t.container);var s=qa(babelHelpers.classPrivateFieldGet(this,bl)),i;try{for(s.s();!(i=s.n()).done;){var a=i.value;var l=babelHelpers.classPrivateFieldGet(this,nl)?babelHelpers.classPrivateFieldGet(this,nl).getFieldValue(a.type):"";if(babelHelpers.classPrivateFieldGet(this,ol)===n.ControlMode.view&&!l){continue}var r=a.render({value:l,mode:babelHelpers.classPrivateFieldGet(this,ol)});babelHelpers.classPrivateFieldGet(this,ul).appendChild(r)}}catch(e){s.e(e)}finally{s.f()}}},{key:"subscribeOnAddressChangedEvent",value:function e(s){this.subscribe(sl(t,t,gl),s)}},{key:"destroy",value:function e(){b.Event.unbindAll(this);var t=qa(babelHelpers.classPrivateFieldGet(this,bl)),s;try{for(t.s();!(s=t.n()).done;){var i=s.value;i.destroy()}}catch(e){t.e(e)}finally{t.f()}b.Dom.clean(babelHelpers.classPrivateFieldGet(this,ul))}},{key:"subscribeOnStateChangedEvent",value:function e(s){this.subscribe(sl(t,t,Tl),s)}},{key:"address",set:function e(t){if(t&&!(t instanceof n.Address)){BX.debug("address must be instance of Address")}babelHelpers.classPrivateFieldSet(this,nl,t);var s=qa(babelHelpers.classPrivateFieldGet(this,bl)),i;try{for(s.s();!(i=s.n()).done;){var a=i.value;a.value=babelHelpers.classPrivateFieldGet(this,nl)?babelHelpers.classPrivateFieldGet(this,nl).getFieldValue(a.type):""}}catch(e){s.e(e)}finally{s.f()}}},{key:"state",get:function e(){return babelHelpers.classPrivateFieldGet(this,pl)}}]);return t}(o.EventEmitter);function Fl(){var e=this;var t=function t(){if(!babelHelpers.classPrivateFieldGet(e,dl).fieldCollection.fields.hasOwnProperty(s)){return"continue"}var i=babelHelpers.classPrivateFieldGet(e,dl).fieldCollection.fields[s];var a=new xa({title:i.name,type:i.type,sort:i.sort});a.subscribeOnValueChangedEvent((function(t){rl(e,vl,Pl).call(e,a)}));a.subscribeOnStateChangedEvent((function(t){var s=t.getData();rl(e,fl,ml).call(e,s.state)}));babelHelpers.classPrivateFieldGet(e,bl).push(a)};for(var s in babelHelpers.classPrivateFieldGet(this,dl).fieldCollection.fields){var i=t();if(i==="continue")continue}babelHelpers.classPrivateFieldGet(this,bl).sort((function(e,t){return e.sort-t.sort}))}function Pl(e){if(!babelHelpers.classPrivateFieldGet(this,nl)){babelHelpers.classPrivateFieldSet(this,nl,new n.Address({languageId:babelHelpers.classPrivateFieldGet(this,cl)}))}babelHelpers.classPrivateFieldGet(this,nl).setFieldValue(e.type,e.value);this.emit(sl(Hl,Hl,gl),{address:babelHelpers.classPrivateFieldGet(this,nl),changedField:e})}function ml(e){babelHelpers.classPrivateFieldSet(this,pl,e);this.emit(sl(Hl,Hl,Tl),{state:babelHelpers.classPrivateFieldGet(this,pl)})}var gl={writable:true,value:"onAddressChanged"};var Tl={writable:true,value:"onStateChanged"};function wl(e,t,s){yl(e,t);t.set(e,s)}function yl(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}var Il=new WeakMap;var Gl=new WeakMap;var Sl=new WeakMap;var El=function(e){babelHelpers.inherits(t,e);function t(e){var s;babelHelpers.classCallCheck(this,t);s=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this,e));wl(babelHelpers.assertThisInitialized(s),Il,{writable:true,value:null});wl(babelHelpers.assertThisInitialized(s),Gl,{writable:true,value:null});wl(babelHelpers.assertThisInitialized(s),Sl,{writable:true,value:null});if(!(e.map instanceof be)){BX.debug("props.map must be instance of MapPopup")}babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),Il,e.map);babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),Il).onChangedEventSubscribe((function(e){var t=e.getData();babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),Sl).setAddressByFeature(t.address,babelHelpers.assertThisInitialized(s))}));return s}babelHelpers.createClass(t,[{key:"showMap",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;if(!babelHelpers.classPrivateFieldGet(this,Il).isShown()){babelHelpers.classPrivateFieldGet(this,Il).show(t)}}},{key:"closeMap",value:function e(){if(babelHelpers.classPrivateFieldGet(this,Il).isShown()){babelHelpers.classPrivateFieldGet(this,Il).close()}babelHelpers.classPrivateFieldGet(this,Il).bindelement=babelHelpers.classPrivateFieldGet(this,Gl)}},{key:"resetView",value:function e(){this.closeMap()}},{key:"render",value:function e(t){if(!b.Type.isDomNode(t.mapBindElement)){BX.debug("props.mapBindElement must be instance of Element")}babelHelpers.classPrivateFieldSet(this,Gl,t.mapBindElement);babelHelpers.classPrivateFieldGet(this,Il).render({bindElement:t.mapBindElement,address:babelHelpers.classPrivateFieldGet(this,Sl).address,mode:babelHelpers.classPrivateFieldGet(this,Sl).mode})}},{key:"setAddress",value:function e(t){if(this.addressWidget.state===c.DATA_INPUTTING){return}babelHelpers.classPrivateFieldGet(this,Il).address=t}},{key:"setAddressWidget",value:function e(t){babelHelpers.classPrivateFieldSet(this,Sl,t)}},{key:"setMode",value:function e(t){babelHelpers.classPrivateFieldGet(this,Il).mode=t}},{key:"destroy",value:function e(){babelHelpers.classPrivateFieldGet(this,Il).destroy();babelHelpers.classPrivateFieldSet(this,Il,null)}},{key:"map",get:function e(){return babelHelpers.classPrivateFieldGet(this,Il)}},{key:"addressWidget",get:function e(){return babelHelpers.classPrivateFieldGet(this,Sl)}},{key:"mapBindElement",get:function e(){return babelHelpers.classPrivateFieldGet(this,Gl)}}]);return t}(we);function kl(e,t,s){Cl(e,t);t.set(e,s)}function Cl(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}var Al=new WeakMap;var Wl=new WeakMap;var _l=function(e){babelHelpers.inherits(t,e);function t(e){var s;babelHelpers.classCallCheck(this,t);s=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this,e));kl(babelHelpers.assertThisInitialized(s),Al,{writable:true,value:void 0});kl(babelHelpers.assertThisInitialized(s),Wl,{writable:true,value:null});if(!(e.autocomplete instanceof bi)){BX.debug("props.autocomplete must be instance of Autocomplete")}babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),Al,e.autocomplete);babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),Al).onAddressChangedEventSubscribe((function(e){var t=e.getData();babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),Wl).setAddressByFeature(t.address,babelHelpers.assertThisInitialized(s),t.excludeSetAddressFeatures,t.options)}));babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),Al).onStateChangedEventSubscribe((function(e){var t=e.getData();babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),Wl).setStateByFeature(t.state)}));babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),Al).onSearchStartedEventSubscribe((function(e){var i=e.getData();babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),Wl).emitFeatureEvent({feature:babelHelpers.assertThisInitialized(s),eventCode:t.searchStartedEvent,payload:i})}));babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),Al).onSearchCompletedEventSubscribe((function(e){var i=e.getData();babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),Wl).emitFeatureEvent({feature:babelHelpers.assertThisInitialized(s),eventCode:t.searchCompletedEvent,payload:i})}));babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),Al).onShowOnMapClickedEventSubscribe((function(e){var i=e.getData();babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),Wl).emitFeatureEvent({feature:babelHelpers.assertThisInitialized(s),eventCode:t.showOnMapClickedEvent,payload:i})}));return s}babelHelpers.createClass(t,[{key:"resetView",value:function e(){babelHelpers.classPrivateFieldGet(this,Al).closePrompt()}},{key:"render",value:function e(t){if(babelHelpers.classPrivateFieldGet(this,Wl).mode===n.ControlMode.edit){babelHelpers.classPrivateFieldGet(this,Al).render({inputNode:babelHelpers.classPrivateFieldGet(this,Wl).inputNode,menuNode:t.autocompleteMenuElement,address:babelHelpers.classPrivateFieldGet(this,Wl).address,mode:babelHelpers.classPrivateFieldGet(this,Wl).mode})}}},{key:"setAddress",value:function e(t){babelHelpers.classPrivateFieldGet(this,Al).address=t}},{key:"setAddressWidget",value:function e(t){babelHelpers.classPrivateFieldSet(this,Wl,t)}},{key:"destroy",value:function e(){babelHelpers.classPrivateFieldGet(this,Al).destroy();babelHelpers.classPrivateFieldSet(this,Al,null)}}]);return t}(we);babelHelpers.defineProperty(_l,"searchStartedEvent","searchStarted");babelHelpers.defineProperty(_l,"searchCompletedEvent","searchCompleted");babelHelpers.defineProperty(_l,"showOnMapClickedEvent","showOnMapClicked");function Ml(e,t,s){zl(e,t);t.set(e,s)}function zl(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}var Ll=new WeakMap;var Ol=new WeakMap;var Nl=function(e){babelHelpers.inherits(t,e);function t(e){var s;babelHelpers.classCallCheck(this,t);s=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this,e));Ml(babelHelpers.assertThisInitialized(s),Ll,{writable:true,value:void 0});Ml(babelHelpers.assertThisInitialized(s),Ol,{writable:true,value:null});if(!(e.fields instanceof Hl)){BX.debug("props.Fields must be instance of Fields")}babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),Ll,e.fields);babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),Ll).subscribeOnAddressChangedEvent((function(e){var t=e.getData();babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),Ol).setAddressByFeature(t.address,babelHelpers.assertThisInitialized(s))}));babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),Ll).subscribeOnStateChangedEvent((function(e){var t=e.getData();babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),Ol).setStateByFeature(t.state)}));return s}babelHelpers.createClass(t,[{key:"render",value:function e(t){if(babelHelpers.classPrivateFieldGet(this,Ol).mode===n.ControlMode.edit){if(!b.Type.isDomNode(t.fieldsContainer)){BX.debug("props.fieldsContainer must be instance of Element")}babelHelpers.classPrivateFieldGet(this,Ll).render({address:babelHelpers.classPrivateFieldGet(this,Ol).address,mode:babelHelpers.classPrivateFieldGet(this,Ol).mode,container:t.fieldsContainer})}}},{key:"setAddressWidget",value:function e(t){babelHelpers.classPrivateFieldSet(this,Ol,t)}},{key:"setAddress",value:function e(t){babelHelpers.classPrivateFieldGet(this,Ll).address=t}},{key:"setMode",value:function e(t){babelHelpers.classPrivateFieldGet(this,Ll).mode=t}},{key:"destroy",value:function e(){babelHelpers.classPrivateFieldGet(this,Ll).destroy();babelHelpers.classPrivateFieldSet(this,Ll,null)}}]);return t}(we);function Dl(e,t){Rl(e,t);t.add(e)}function Bl(e,t,s){Rl(e,t);t.set(e,s)}function Rl(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function Xl(e,t,s){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return s}var xl=new WeakMap;var Ul=new WeakMap;var Vl=new WeakMap;var Yl=new WeakMap;var jl=new WeakMap;var Kl=new WeakSet;var $l=new WeakSet;var ql=new WeakSet;var Jl=new WeakSet;var Zl=function(e){babelHelpers.inherits(t,e);function t(){var e;var s;babelHelpers.classCallCheck(this,t);for(var i=arguments.length,a=new Array(i),l=0;l<i;l++){a[l]=arguments[l]}s=babelHelpers.possibleConstructorReturn(this,(e=babelHelpers.getPrototypeOf(t)).call.apply(e,[this].concat(a)));Dl(babelHelpers.assertThisInitialized(s),Jl);Dl(babelHelpers.assertThisInitialized(s),ql);Dl(babelHelpers.assertThisInitialized(s),$l);Dl(babelHelpers.assertThisInitialized(s),Kl);Bl(babelHelpers.assertThisInitialized(s),xl,{writable:true,value:null});Bl(babelHelpers.assertThisInitialized(s),Ul,{writable:true,value:700});Bl(babelHelpers.assertThisInitialized(s),Vl,{writable:true,value:null});Bl(babelHelpers.assertThisInitialized(s),Yl,{writable:true,value:800});Bl(babelHelpers.assertThisInitialized(s),jl,{writable:true,value:false});return s}babelHelpers.createClass(t,[{key:"render",value:function e(s){babelHelpers.get(babelHelpers.getPrototypeOf(t.prototype),"render",this).call(this,s);this.addressWidget.controlWrapper.addEventListener("click",Xl(this,Kl,Ql).bind(this));this.addressWidget.controlWrapper.addEventListener("mouseover",Xl(this,ql,tr).bind(this));this.addressWidget.controlWrapper.addEventListener("mouseout",Xl(this,Jl,sr).bind(this));document.addEventListener("click",Xl(this,$l,er).bind(this));this.map.onMouseOverSubscribe(Xl(this,ql,tr).bind(this));this.map.onMouseOutSubscribe(Xl(this,Jl,sr).bind(this))}},{key:"setAddress",value:function e(t){if(!t){this.closeMap()}this.map.address=t;if(t&&this.addressWidget.state!==c.DATA_SUPPOSED){this.showMap()}}},{key:"destroy",value:function e(){if(babelHelpers.classPrivateFieldGet(this,jl)){return}document.removeEventListener("click",Xl(this,$l,er));if(this.addressWidget.controlWrapper){this.addressWidget.controlWrapper.removeEventListener("click",Xl(this,Kl,Ql));this.addressWidget.controlWrapper.removeEventListener("mouseover",Xl(this,ql,tr));this.addressWidget.controlWrapper.removeEventListener("mouseout",Xl(this,Jl,sr))}babelHelpers.classPrivateFieldSet(this,xl,null);babelHelpers.classPrivateFieldSet(this,Vl,null);babelHelpers.get(babelHelpers.getPrototypeOf(t.prototype),"destroy",this).call(this);babelHelpers.classPrivateFieldSet(this,jl,true)}}]);return t}(El);function Ql(e){if(babelHelpers.classPrivateFieldGet(this,jl)){return}if(this.addressWidget.mode===n.ControlMode.view){if(this.map.isShown()){this.closeMap()}else{clearTimeout(babelHelpers.classPrivateFieldGet(this,xl))}}else if(this.addressWidget.mode===n.ControlMode.edit&&this._saveResourceStrategy===false){if(this.addressWidget.address&&!this.map.isShown()&&e.target===this.addressWidget.inputNode){this.showMap()}}}function er(e){if(babelHelpers.classPrivateFieldGet(this,jl)){return}if(this.addressWidget.inputNode!==e.target){this.closeMap()}}function tr(){var e=this;if(babelHelpers.classPrivateFieldGet(this,jl)){return}clearTimeout(babelHelpers.classPrivateFieldGet(this,xl));clearTimeout(babelHelpers.classPrivateFieldGet(this,Vl));if(this.addressWidget.mode!==n.ControlMode.view){return}if(this.addressWidget.address&&!this.map.isShown()){babelHelpers.classPrivateFieldSet(this,xl,setTimeout((function(){e.showMap()}),babelHelpers.classPrivateFieldGet(this,Ul)))}}function sr(){var e=this;if(babelHelpers.classPrivateFieldGet(this,jl)){return}clearTimeout(babelHelpers.classPrivateFieldGet(this,xl));clearTimeout(babelHelpers.classPrivateFieldGet(this,Vl));if(this.addressWidget.mode!==n.ControlMode.view){return}if(this.addressWidget.mode===n.ControlMode.view&&this.map.isShown()){babelHelpers.classPrivateFieldSet(this,Vl,setTimeout((function(){e.closeMap()}),babelHelpers.classPrivateFieldGet(this,Yl)))}}var ir=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,[{key:"createAddressWidget",value:function e(t){var s=t.sourceCode||BX.message("LOCATION_WIDGET_SOURCE_CODE");var i=t.sourceParams||BX.message("LOCATION_WIDGET_SOURCE_PARAMS");var a=t.languageId||BX.message("LOCATION_WIDGET_LANGUAGE_ID");var r=t.sourceLanguageId||BX.message("LOCATION_WIDGET_SOURCE_LANGUAGE_ID");var d=new n.Location(JSON.parse(BX.message("LOCATION_WIDGET_USER_LOCATION_POINT")));var o=t.addressFormat||new n.Format(JSON.parse(BX.message("LOCATION_WIDGET_DEFAULT_FORMAT")));var b=t.presetLocationsProvider?t.presetLocationsProvider:function(){return t.presetLocationList?t.presetLocationList:[]};var c=[];if(!t.useFeatures||t.useFeatures.fields!==false){c.push(this.createFieldsFeature({addressFormat:o,languageId:a}))}var u=null;if(s&&i){try{u=l.Factory.create(s,a,r,i)}catch(e){if(e instanceof n.SourceCreationError){u=null}else{throw e}}}var p=null;if(u){if(!t.useFeatures||t.useFeatures.autocomplete!==false){c.push(this.createAutocompleteFeature({languageId:a,addressFormat:o,source:u,userLocationPoint:d,presetLocationsProvider:b}))}if(!t.useFeatures||t.useFeatures.map!==false){var h=!!i.showPhotos;var v=!!i.useGeocodingService;var f=80;var H=150;var F=h?5:0;var P="auto";p=this.createMapFeature({addressFormat:o,source:u,useGeocodingService:v,popupOptions:t.popupOptions,popupBindOptions:t.popupBindOptions,thumbnailHeight:t.thumbnailHeight||f,thumbnailWidth:t.thumbnailWidth||H,maxPhotoCount:t.maxPhotoCount||F,mapBehavior:t.mapBehavior||P,userLocationPoint:d});c.push(p)}}var m=new et({features:c,address:t.address,mode:t.mode,addressFormat:o,languageId:a});if(p){m.subscribeOnFeatureEvent((function(e){var t=e.getData();if(t.feature instanceof _l&&t.eventCode===_l.showOnMapClickedEvent){p.showMap(true)}}))}return m}},{key:"createFieldsFeature",value:function e(t){var s=new Hl({addressFormat:t.addressFormat,languageId:t.languageId});return new Nl({fields:s})}},{key:"createAutocompleteFeature",value:function e(t){var s=new bi({sourceCode:t.source.sourceCode,languageId:t.languageId,addressFormat:t.addressFormat,autocompleteService:t.source.autocompleteService,userLocationPoint:t.userLocationPoint,presetLocationsProvider:t.presetLocationsProvider});return new _l({autocomplete:s})}},{key:"createMapFeature",value:function e(t){var s={cacheable:true,closeByEsc:true,className:"location-popup-window location-source-".concat(t.source.sourceCode),animation:"fading",angle:true,bindOptions:t.popupBindOptions};if(t.popupOptions){s=Object.assign(s,t.popupOptions)}var a=new C(s);var l=null;if(t.maxPhotoCount>0){l=new va({photoService:t.source.photoService,thumbnailHeight:t.thumbnailHeight,thumbnailWidth:t.thumbnailWidth,maxPhotoCount:t.maxPhotoCount})}var r={saveResourceStrategy:t.source.sourceCode===i.Google.code,map:new be({addressFormat:t.addressFormat,map:t.source.map,popup:a,gallery:l,locationRepository:new n.LocationRepository,geocodingService:t.useGeocodingService?t.source.geocodingService:null,userLocationPoint:t.userLocationPoint})};var d;if(t.mapBehavior==="manual"){d=new El(r)}else{d=new Zl(r)}return d}}]);return e}();var ar;function lr(e,t){nr(e,t);t.add(e)}function rr(e,t,s){nr(e,t);t.set(e,s)}function nr(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function dr(e,t,s){br(e,t);or(s,"get");return cr(e,s)}function or(e,t){if(e===undefined){throw new TypeError("attempted to "+t+" private static field before its declaration")}}function br(e,t){if(e!==t){throw new TypeError("Private static access of wrong provenance")}}function cr(e,t){if(t.get){return t.get.call(e)}return t.value}function ur(e,t,s){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return s}var pr=new WeakMap;var hr=new WeakMap;var vr=new WeakMap;var fr=new WeakSet;var Hr=function(e){babelHelpers.inherits(t,e);function t(){var e;var s=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,t);e=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this));lr(babelHelpers.assertThisInitialized(e),fr);rr(babelHelpers.assertThisInitialized(e),pr,{writable:true,value:void 0});rr(babelHelpers.assertThisInitialized(e),hr,{writable:true,value:void 0});rr(babelHelpers.assertThisInitialized(e),vr,{writable:true,value:["on","off"]});e.setEventNamespace("BX.Location.Widget.Switch");babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(e),pr,s.state);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(e),vr,s.titles);return e}babelHelpers.createClass(t,[{key:"render",value:function e(s){var i=this;babelHelpers.classPrivateFieldSet(this,hr,b.Tag.render(ar||(ar=babelHelpers.taggedTemplateLiteral(['\t\t\t\n\t\t\t<span class="ui-link ui-link-secondary ui-entity-editor-block-title-link">\n\t\t\t\t',"\n\t\t\t</span>"])),ur(this,fr,Fr).call(this)));babelHelpers.classPrivateFieldGet(this,hr).addEventListener("click",(function(e){i.state=babelHelpers.classPrivateFieldGet(i,pr)===t.STATE_OFF?t.STATE_ON:t.STATE_OFF;i.emit(dr(t,t,Pr),{state:babelHelpers.classPrivateFieldGet(i,pr)});e.stopPropagation();return false}));babelHelpers.classPrivateFieldGet(this,hr).addEventListener("mouseover",(function(e){e.stopPropagation()}));return babelHelpers.classPrivateFieldGet(this,hr)}},{key:"subscribeOnToggleEventSubscribe",value:function e(s){this.subscribe(dr(t,t,Pr),s)}},{key:"state",set:function e(t){babelHelpers.classPrivateFieldSet(this,pr,t);if(babelHelpers.classPrivateFieldGet(this,hr)){babelHelpers.classPrivateFieldGet(this,hr).innerHTML=ur(this,fr,Fr).call(this)}},get:function e(){return babelHelpers.classPrivateFieldGet(this,pr)}}]);return t}(o.EventEmitter);function Fr(){return babelHelpers.classPrivateFieldGet(this,vr)[babelHelpers.classPrivateFieldGet(this,pr)]}babelHelpers.defineProperty(Hr,"STATE_OFF",0);babelHelpers.defineProperty(Hr,"STATE_ON",1);var Pr={writable:true,value:"onToggleEvent"};var mr;function gr(e,t){wr(e,t);t.add(e)}function Tr(e,t,s){wr(e,t);t.set(e,s)}function wr(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function yr(e,t,s){Gr(e,t);Ir(s,"get");return Sr(e,s)}function Ir(e,t){if(e===undefined){throw new TypeError("attempted to "+t+" private static field before its declaration")}}function Gr(e,t){if(e!==t){throw new TypeError("Private static access of wrong provenance")}}function Sr(e,t){if(t.get){return t.get.call(e)}return t.value}function Er(e,t,s){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return s}var kr=new WeakMap;var Cr=new WeakMap;var Ar=new WeakSet;var Wr=function(e){babelHelpers.inherits(t,e);function t(){var e;babelHelpers.classCallCheck(this,t);e=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this));gr(babelHelpers.assertThisInitialized(e),Ar);Tr(babelHelpers.assertThisInitialized(e),kr,{writable:true,value:t.TYPE_SEARCH});Tr(babelHelpers.assertThisInitialized(e),Cr,{writable:true,value:void 0});e.setEventNamespace("BX.Location.Widget.Icon");return e}babelHelpers.createClass(t,[{key:"render",value:function e(s){var i=this;babelHelpers.classPrivateFieldSet(this,kr,s.type);babelHelpers.classPrivateFieldSet(this,Cr,b.Tag.render(mr||(mr=babelHelpers.taggedTemplateLiteral(['<div class="','"></div>'])),Er(this,Ar,_r).call(this,babelHelpers.classPrivateFieldGet(this,kr))));babelHelpers.classPrivateFieldGet(this,Cr).addEventListener("click",(function(e){i.emit(yr(t,t,Mr))}));return babelHelpers.classPrivateFieldGet(this,Cr)}},{key:"subscribeOnClickEvent",value:function e(s){this.subscribe(yr(t,t,Mr),s)}},{key:"type",set:function e(t){babelHelpers.classPrivateFieldSet(this,kr,t);if(babelHelpers.classPrivateFieldGet(this,Cr)){babelHelpers.classPrivateFieldGet(this,Cr).className=Er(this,Ar,_r).call(this,babelHelpers.classPrivateFieldGet(this,kr))}}}]);return t}(o.EventEmitter);function _r(e){var t="";if(e===Wr.TYPE_CLEAR){t="ui-ctl-after ui-ctl-icon-btn ui-ctl-icon-clear"}else if(e===Wr.TYPE_SEARCH){t="ui-ctl-after ui-ctl-icon-search"}else if(e===Wr.TYPE_LOADER){t="ui-ctl-after ui-ctl-icon-loader"}else{BX.debug("Wrong icon type")}return t}var Mr={writable:true,value:"onClick"};babelHelpers.defineProperty(Wr,"TYPE_CLEAR","clear");babelHelpers.defineProperty(Wr,"TYPE_SEARCH","search");babelHelpers.defineProperty(Wr,"TYPE_LOADER","loader");var zr,Lr,Or,Nr,Dr,Br,Rr,Xr,xr;function Ur(e,t){Vr(e,t);t.add(e)}function Vr(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function Yr(e,t,s){jr(e,t);return s}function jr(e,t){if(e!==t){throw new TypeError("Private static access of wrong provenance")}}function Kr(e,t,s){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return s}var $r=new WeakSet;var qr=new WeakSet;var Jr=new WeakSet;var Zr=new WeakSet;var Qr=new WeakSet;var en=new WeakSet;var tn=new WeakSet;var sn=new WeakSet;var an=function(e){babelHelpers.inherits(t,e);function t(e){var s;babelHelpers.classCallCheck(this,t);s=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this,e));Ur(babelHelpers.assertThisInitialized(s),sn);Ur(babelHelpers.assertThisInitialized(s),tn);Ur(babelHelpers.assertThisInitialized(s),en);Ur(babelHelpers.assertThisInitialized(s),Qr);Ur(babelHelpers.assertThisInitialized(s),Zr);Ur(babelHelpers.assertThisInitialized(s),Jr);Ur(babelHelpers.assertThisInitialized(s),qr);Ur(babelHelpers.assertThisInitialized(s),$r);s._input=null;s._inputIcon=null;s._hiddenInput=null;s._innerWrapper=null;s._addressWidget=null;s._addressFieldsContainer=null;return s}babelHelpers.createClass(t,[{key:"initialize",value:function e(s,i){babelHelpers.get(babelHelpers.getPrototypeOf(t.prototype),"initialize",this).call(this,s,i);var a=this.getValue();var l=null;if(b.Type.isStringFilled(a)){try{l=new n.Address(JSON.parse(a))}catch(e){BX.debug("Cant parse address value");return}}var r=new ir;this._addressWidget=r.createAddressWidget({address:l,mode:this._mode===BX.UI.EntityEditorMode.edit?n.ControlMode.edit:n.ControlMode.view,popupBindOptions:{position:"right"}});this._addressWidget.subscribeOnStateChangedEvent(Kr(this,Qr,on).bind(this));this._addressWidget.subscribeOnAddressChangedEvent(Kr(this,en,bn).bind(this));this._fieldsSwitch=new Hr({state:Hr.STATE_OFF,titles:[BX.message("LOCATION_WIDGET_AUI_MORE"),BX.message("LOCATION_WIDGET_AUI_BRIEFLY")]});this._fieldsSwitch.subscribeOnToggleEventSubscribe(Kr(this,qr,rn).bind(this))}},{key:"focus",value:function e(){if(!this._input){return}BX.focus(this._input);BX.UI.EditorTextHelper.getCurrent().setPositionAtEnd(this._input)}},{key:"getModeSwitchType",value:function e(t){var s=BX.UI.EntityEditorModeSwitchType.common;if(t===BX.UI.EntityEditorMode.edit){s|=BX.UI.EntityEditorModeSwitchType.button|BX.UI.EntityEditorModeSwitchType.content}return s}},{key:"doSetMode",value:function e(t){this._addressWidget.mode=t===BX.UI.EntityEditorMode.edit?n.ControlMode.edit:n.ControlMode.view;this._fieldsSwitch.state=Hr.STATE_OFF}},{key:"getContentWrapper",value:function e(){return this._innerWrapper}},{key:"save",value:function e(){if(!this.isEditable()){return}var t=Kr(this,sn,pn).call(this);this._model.setField(this.getName(),t?t.toJson():"");this._addressWidget.resetView()}},{key:"showError",value:function e(s,i){babelHelpers.get(babelHelpers.getPrototypeOf(t.prototype),"showError",this).apply(this,[s,i]);if(this._input){BX.addClass(this._inputContainer,"ui-ctl-danger")}}},{key:"clearError",value:function e(){babelHelpers.get(babelHelpers.getPrototypeOf(t.prototype),"clearError",this).apply(this);if(this._input){BX.removeClass(this._inputContainer,"ui-ctl-danger")}}},{key:"doClearLayout",value:function e(t){this._input=null;this._innerWrapper=null;this._inputContainer=null;this._addressFieldsContainer=null;this._inputIcon=null;this._hiddenInput=null;b.Dom.clean(this._innerWrapper)}},{key:"validate",value:function e(t){if(!(this._mode===BX.UI.EntityEditorMode.edit&&this._input)){throw Error("BX.Location.UIAddress. Invalid validation context")}this.clearError();if(this.hasValidators()){return this.executeValidators(t)}var s=!this.isRequired()||BX.util.trim(this._input.value)!=="";if(!s){t.addError(BX.UI.EntityValidationError.create({field:this}));this.showRequiredFieldError(this._input)}return s}},{key:"getRuntimeValue",value:function e(){return this._mode===BX.UI.EntityEditorMode.edit?Kr(this,sn,pn).call(this):null}},{key:"layout",value:function e(s){if(this._hasLayout){return}this.ensureWrapperCreated({classNames:["ui-entity-card-content-block-field-phone"]});this.adjustWrapper();var i=this.getTitle();if(this.isDragEnabled()){this._wrapper.appendChild(this.createDragButton())}var a={};if(this._mode===BX.UI.EntityEditorMode.edit){this._wrapper.appendChild(this.createTitleNode(i));this._input=b.Tag.render(zr||(zr=babelHelpers.taggedTemplateLiteral(['<input class="ui-ctl-element ui-ctl-textbox" value="" type="text" autocomplete="off" name="','">'])),"".concat(this.getName(),"_STRING"));this._hiddenInput=b.Tag.render(Lr||(Lr=babelHelpers.taggedTemplateLiteral(["<input value='",'\' type="hidden" name="','">'])),this.getValue(),this.getName());this._inputIcon=new Wr;this._inputIcon.subscribeOnClickEvent(Kr(this,$r,ln).bind(this));var l=this._inputIcon.render({type:Yr(t,t,cn).call(t,Kr(this,sn,pn).call(this))});this._inputContainer=b.Tag.render(Or||(Or=babelHelpers.taggedTemplateLiteral(['<div class="ui-ctl ui-ctl-w100 ui-ctl-after-icon">',"","","</div>"])),l,this._input,this._hiddenInput);this._titleWrapper.appendChild(b.Tag.render(Nr||(Nr=babelHelpers.taggedTemplateLiteral(["",""])),this._fieldsSwitch.render(this._mode)));this._innerWrapper=b.Tag.render(Dr||(Dr=babelHelpers.taggedTemplateLiteral(['\t\t\t\t\t\t \n\t\t\t\t<div class="location-search-control-block">\t\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t</div>"])),this._inputContainer);a.inputNode=this._input;a.mapBindElement=l;this._addressFieldsContainer=b.Tag.render(Br||(Br=babelHelpers.taggedTemplateLiteral(['<div class="location-fields-control-block"></div>'])));if(this._fieldsSwitch.state===Hr.STATE_ON){this._addressFieldsContainer.classList.add("visible")}a.fieldsContainer=this._addressFieldsContainer;this._innerWrapper.appendChild(this._addressFieldsContainer)}else{this._wrapper.appendChild(this.createTitleNode(i));var r;if(this.hasContentToDisplay()){var n=Kr(this,tn,un).call(this,Kr(this,sn,pn).call(this));r=b.Tag.render(Rr||(Rr=babelHelpers.taggedTemplateLiteral(['<span class="ui-link ui-link-dark ui-link-dotted">',"</span>"])),n);this._innerWrapper=b.Tag.render(Xr||(Xr=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="location-search-control-block">\n\t\t\t\t\t\t<div class="ui-entity-editor-content-block-text">\n\t\t\t\t\t\t\t',"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>"])),r);a.mapBindElement=r}else{this._innerWrapper=b.Tag.render(xr||(xr=babelHelpers.taggedTemplateLiteral(['<div class="location-search-control-block">\n\t\t\t\t\t',"\n\t\t\t\t</div>"])),BX.message("UI_ENTITY_EDITOR_FIELD_EMPTY"));a.mapBindElement=this._innerWrapper}}a.controlWrapper=this._innerWrapper;this._addressWidget.render(a);this._wrapper.appendChild(this._innerWrapper);this._addressWidget.subscribeOnErrorEvent(this.errorListener.bind(this));if(this.isContextMenuEnabled()){this._wrapper.appendChild(this.createContextMenuButton())}if(this.isDragEnabled()){this.initializeDragDropAbilities()}this.registerLayout(s);this._hasLayout=true}},{key:"errorListener",value:function e(t){var s=this;var i=t.getData();var a=i.errors;if(this._inputIcon){this._inputIcon.type=Wr.TYPE_CLEAR}if(!b.Type.isArray(a)){return}a.forEach((function(e){var t;if(e.message){t=e.message}else{t=BX.message("LOCATION_WIDGET_AUI_UNKNOWN_ERROR")}if(e.code){t+=" [".concat(e.code,"]")}s.showError(t)}))}},{key:"processModelChange",value:function e(t){if(BX.prop.get(t,"originator",null)===this){return}if(!BX.prop.getBoolean(t,"forAll",false)&&BX.prop.getString(t,"name","")!==this.getName()){return}this.refreshLayout()}}],[{key:"create",value:function e(s,i){var a=new t;a.initialize(s,i);return a}},{key:"registerField",value:function e(){if(typeof BX.UI.EntityEditorControlFactory!=="undefined"){BX.UI.EntityEditorControlFactory.registerFactoryMethod("address",t.registerFieldMethod)}else{BX.addCustomEvent("BX.UI.EntityEditorControlFactory:onInitialize",(function(e,s){s.methods.address=t.registerFieldMethod}))}}},{key:"registerFieldMethod",value:function e(s,i,a){var l=null;if(s==="address"){l=t.create(i,a)}return l}}]);return t}(BX.UI.EntityEditorField);function ln(){if(this._input.value!==""){this._input.value="";this._addressWidget.address=null;this._inputIcon.type=Wr.TYPE_SEARCH}if(this.hasError()){this.clearError()}}function rn(e){var t=e.getData();var s=t.state;if(s===Hr.STATE_OFF){Kr(this,Jr,nn).call(this)}else{Kr(this,Zr,dn).call(this)}this._addressWidget.resetView()}function nn(){if(this._addressFieldsContainer){this._addressFieldsContainer.classList.remove("visible")}}function dn(){if(this._addressFieldsContainer){this._addressFieldsContainer.classList.add("visible")}}function on(e){var t=e.getData();var s=t.state;var i;if(t.state===d.State.DATA_LOADING){i=Wr.TYPE_LOADER}else{if(t.state===d.State.DATA_INPUTTING){this.markAsChanged()}i=Yr(an,an,cn).call(an,Kr(this,sn,pn).call(this))}this._inputIcon.type=i}function bn(e){var t=e.getData();var s=t.address;if(this._hiddenInput){this._hiddenInput.value=s?s.toJson():"";this.markAsChanged()}if(this._inputIcon){this._inputIcon.type=Yr(an,an,cn).call(an,s)}}function cn(e){return e?Wr.TYPE_CLEAR:Wr.TYPE_SEARCH}function un(e){if(!e){return""}return e.toString(this._addressWidget.addressFormat)}function pn(){return this._addressWidget.address}an.registerField();e.Address=et;e.BaseFeature=we;e.MapFeature=El;e.AutocompleteFeature=_l;e.FieldsFeature=Nl;e.Factory=ir;e.State=c;e.UIAddress=an})(this.BX.Location.Widget=this.BX.Location.Widget||{},BX,BX,BX.Location.Google,BX.Main,BX.Location.Source,BX,BX.Location.Core,BX.Location.Widget,BX.Event,BX); //# sourceMappingURL=widget.bundle.map.js