1(self.webpackChunk=self.webpackChunk||[]).push([[6193],{78387:(t,e,i)=>{"use strict";i.d(e,{I:()=>r});var s=i(50791),n=i(31270);function r({tripId:t}){return async(e,i)=>{const r=(0,n.S)(i(),t),o=(null==r?void 0:r.cid)||null;return e({payload:{tripCid:o,tripId:t},type:"deleteTrip"}),(await fetch(`/api/v2/trips/${t}`,{headers:{"Content-Type":"application/json"},method:"DELETE"})).ok?(e({payload:{action:"deleteTripSuccess",lastModifyingActionTime:Date.now(),tripCid:o,tripId:t},type:"deleteTripSuccess"}),e((0,s.Yz)({text:"Trip successfully deleted.",type:"success"})),!0):(e({payload:{action:"deleteTripError",lastModifyingActionTime:Date.now(),tripCid:o,tripId:t},type:"deleteTripError"}),e((0,s.Yz)({text:"Oops. There was an issue trying to delete your trip.",type:"error"})),!1)}}},86193:(t,e,i)=>{"use strict";i.r(e),i(60336);var s=i(76834),n=i(9270),r=function(t,e){return function(){return t.apply(e,arguments)}},o={}.hasOwnProperty;rt.guide.views.AddMomentView=function(t){function e(){return this.warnAtWaypointLimit=r(this.warnAtWaypointLimit,this),this.handleMomentSaveSuccess=r(this.handleMomentSaveSuccess,this),this.handleCreateTextMomentClick=r(this.handleCreateTextMomentClick,this),this.handleCreatePhotoMomentClick=r(this.handleCreatePhotoMomentClick,this),this.render=r(this.render,this),this.setProps=r(this.setProps,this),this.setState=r(this.setState,this),this.getInitialState=r(this.getInitialState,this),this.initialize=r(this.initialize,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var i in e)o.call(e,i)&&(t[i]=e[i]);function s(){this.constructor=t}s.prototype=e.prototype,t.prototype=new s,t.__super__=e.prototype}(e,Backbone.View),e.prototype.events={"click .create-photo-moment":"handleCreatePhotoMomentClick","click .create-text-moment":"handleCreateTextMomentClick"},e.prototype.initialize=function(t){return this.props=t,this.state=this.getInitialState()},e.prototype.getInitialState=function(){return{isPhotoMoment:!1,isTextMoment:!1}},e.prototype.setState=function(t){return this.state=_.extend({},this.state,t)},e.prototype.setProps=function(t){return this.props=t,this.render()},e.prototype.render=function(){return this.el!==this.props.el&&this.setElement(this.props.el),this},e.prototype.handleCreatePhotoMomentClick=function(){var t;if(!this.warnAtWaypointLimit())return this.setState({isPhotoMoment:!0,isTextMoment:!1}),t=_.extend({},this.props,this.state,{onSaveSuccess:this.handleMomentSaveSuccess}),(0,n.ub)(t)},e.prototype.handleCreateTextMomentClick=function(){var t;if(!this.warnAtWaypointLimit())return this.setState({isPhotoMoment:!1,isTextMoment:!0}),t=_.extend({},this.props,this.state,{onSaveSuccess:this.handleMomentSaveSuccess}),(0,n.ub)(t)},e.prototype.handleMomentSaveSuccess=function(){return rt.core.actionCreators.trips.fetch({tripId:this.props.trip.id})},e.prototype.warnAtWaypointLimit=function(){if(this.props.trip.waypointsCount>=rt.models.Trip.WAYPOINT_LIMIT)return(0,s.q)({contentText:"Your trip may only contain a maximum of "+rt.core.trip.AUTHENTICATED_WAYPOINT_LIMIT+" waypoints.",headerText:"Waypoint limit reached."}),!0},e}(),i(5795),i(82225);var p=function(t,e){return function(){return t.apply(e,arguments)}},h={}.hasOwnProperty;rt.guide.views.PhotoMoment=function(t){function e(){return this.handleMomentSaveSuccess=p(this.handleMomentSaveSuccess,this),this.handleEditButtonClick=p(this.handleEditButtonClick,this),this.render=p(this.render,this),this.setProps=p(this.setProps,this),this.initialize=p(this.initialize,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var i in e)h.call(e,i)&&(t[i]=e[i]);function s(){this.constructor=t}s.prototype=e.prototype,t.prototype=new s,t.__super__=e.prototype}(e,Backbone.View),e.prototype.events={"click .edit":"handleEditButtonClick"},e.prototype.initialize=function(t){return this.props=t},e.prototype.setProps=function(t){return this.props=t,this.render()},e.prototype.render=function(){if(this.el!==this.props.el)return this.setElement(this.props.el)},e.prototype.handleEditButtonClick=function(){var t;return t=_.extend({},this.props,{isPhotoMoment:!0,onSaveSuccess:this.handleMomentSaveSuccess}),(0,n.ub)(t)},e.prototype.handleMomentSaveSuccess=function(){return rt.core.actionCreators.trips.fetch({tripId:this.props.trip.id})},e}(),i(29903),i(27408);
1var a=i(38329),l=Backbone.View.extend({events:{"click .update-image":"handleUpdateImageClick"},initialize:function(t){this.props=t,this.tripConclusionView=new rt.guide.views.TripConclusionView(this.getTripConclusionViewProps()),this.tripIntroductionView=new rt.guide.views.TripIntroductionView(this.getTripIntroductionViewProps()),this.tripNameView=new rt.guide.views.TripNameView(this.getTripNameViewProps()),this.tripSubtitleView=new rt.guide.views.TripSubtitleView(this.getTripSubtitleViewProps()),this.initializeOpenGraphView(),this.initializeWaypointViews(),(0,a.v)(this.props.trip.attributes.id)},initializeOpenGraphView:function(){this.$(".open-graph-view").length&&(this.openGraphView=new rt.core.openGraph.views.OpenGraphView(this.getOpenGraphViewProps()))},initializeWaypointViews:function(){this.waypointViewsById={},this.renderWaypointViews()},remove:function(){this.tripConclusionView.remove(),this.tripIntroductionView.remove(),this.tripNameView.remove(),this.tripSubtitleView.remove(),Object.keys(this.waypointViewsById).forEach((t=>{this.waypointViewsById[t].remove(),delete this.waypointViewsById[t]})),Backbone.View.prototype.remove.call(this)},render:function(){this.el!==this.props.el&&this.setElement(this.props.el),this.tripConclusionView.setProps(this.getTripConclusionViewProps()),this.tripIntroductionView.setProps(this.getTripIntroductionViewProps()),this.tripNameView.setProps(this.getTripNameViewProps()),this.tripSubtitleView.setProps(this.getTripSubtitleViewProps()),this.openGraphView&&this.openGraphView.setProps(this.getOpenGraphViewProps()),this.renderWaypointViews()},renderWaypointViews:function(){const t=[],e=Object.assign({},this.waypointViewsById);this.$(".waypoint-view").each(((i,s)=>{const n=parseInt(s.dataset.id,10),r=this.waypointViewsById[n];if(r){const t=this.props.trip.attributes.waypoints.get(n);r.setProps(this.getWaypointViewProps(t,s)),delete e[n]}else t.push(s)})),t.forEach((t=>{const e=parseInt(t.dataset.id,10),i=this.props.trip.attributes.waypoints.get(e);this.waypointViewsById[e]=new rt.guide.views.WaypointView(this.getWaypointViewProps(i,t))})),Object.keys(e).forEach((t=>{this.waypointViewsById[t].remove(),delete this.waypointViewsById[t]}))},setProps:function(t){this.props=t,this.render()},getTripConclusionViewProps:function(){return{el:this.$("#trip-conclusion-view")[0],onSaveTrip:this.handleSaveTrip.bind(this),trip:this.props.trip}},getTripIntroductionViewProps:function(){return{el:this.$("#trip-introduction-view")[0],onSaveTrip:this.handleSaveTrip.bind(this),trip:this.props.trip}},getTripNameViewProps:function(){return{el:this.$("#trip-name-view")[0],onSaveTrip:this.handleSaveTrip.bind(this)}},getTripSubtitleViewProps:function(){return{el:this.$("#trip-subtitle-view")[0],onSaveTrip:this.handleSaveTrip.bind(this)}},getWaypointViewProps:function(t,e){return{el:e,trip:this.props.trip,waypoint:t}},getOpenGraphViewProps:function(){return{el:this.$(".open-graph-view")[0],props:{lockVersion:this.props.trip.attributes.lock_version}}},handleSaveTrip:function(t){const{cid:e}=this.props.trip;rt.core.actionCreators.trips.updateGuide({trip:{attributes:t,cid:e},tripCid:e})},handleUpdateImageClick:function(){rt.core.actionCreators.history.navigate({url:rt.routes.trip_settings_path(this.props.trip.attributes.id)})}}),u=function(t,e){return function(){return t.apply(e,arguments)}},d={}.hasOwnProperty;rt.guide.views.TextMoment=function(t){function e(){return this.handleMomentSaveSuccess=u(this.handleMomentSaveSuccess,this),this.handleEditButtonClick=u(this.handleEditButtonClick,this),this.render=u(this.render,this),this.setProps=u(this.setProps,this),this.initialize=u(this.initialize,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var i in e)d.call(e,i)&&(t[i]=e[i]);function s(){this.constructor=t}s.prototype=e.prototype,t.prototype=new s,t.__super__=e.prototype}(e,Backbone.View),e.prototype.events={"click .edit":"handleEditButtonClick"},e.prototype.initialize=function(t){return this.props=t},e.prototype.setProps=function(t){return this.props=t,this.render()},e.prototype.render=function(){if(this.el!==this.props.el)return this.setElement(this.props.el)},e.prototype.handleEditButtonClick=function(){var t;return t=_.extend({},this.props,{isTextMoment:!0,onSaveSuccess:this.handleMomentSaveSuccess}),(0,n.ub)(t)},e.prototype.handleMomentSaveSuccess=function(){return rt.core.actionCreators.trips.fetch({tripId:this.props.trip.id})},e}();var c=i(22614),w=i(96369),v=i(78387),y=i(41148),g=i(81454),f=i(84629),m=i(86682),V=i(76318),b=i(76285);rt.guide.views.ToolbarView=Backbone.View.extend({events:{"click .delete":"handleDeleteButtonClick","click .leave":"handleLeaveButtonClick","click .print":"handlePrintButtonClick","click .settings":"handleSettingsButtonClick","click .share":"handleShareButtonClick","click .take-trip":"handleTakeTripButtonClick"},initialize:function(t){this.props=t,this.isCloning=!1,this.isCloned=!1,this.cacheElements()},render:function(){this.el!==this.props.el&&this.setElement(this.props.el)},setProps:function(t){this.props=_.extend({},t),this.render()},handleDeleteButtonClick:function(){(0,c.rm)({onPrimaryButtonClick:()=>{redux.dispatch((0,v.I)({tripId:this.props.trip.id})).then((()=>{const t=(0,V.HF)(redux.getState());rt.core.actionCreators.history.navigate({url:rt.routes.user_path(t.username)})}))}})},handleLeaveButtonClick:function(){(0,c.Bp)({onPrimaryButtonClick:async()=>{const{id:t,is_private:e}=this.props.trip.attributes,i=(0,V.HF)(redux.getState());await redux.dispatch((0,y.n)({isTripPrivate:e,tripId:t,userId:i.id}))?this.handleLeaveResolve():this.handleLeaveReject()}})},handleLeaveReject:function(){console.error("There was an error leaving this trip.")},handleLeaveResolve:function(){this.props.trip.attributes.is_private?rt.core.actionCreators.history.navigate({url:rt.routes.root_path()}):rt.core.actionCreators.trips.fetch({tripId:this.props.trip.attributes.id})},handlePrintButtonClick:function(){(0,m.$)({context:"print trip guide"}).then((t=>{t&&window.open(`/trips/${this.props.trip.attributes.id}/print`,"_blank","height=600, width=800")}))},handleSettingsButtonClick:function(){rt.core.actionCreators.history.navigate({url:rt.routes.trip_settings_path(this.props.trip.attributes.id)})},handleShareButtonClick:async function(){const t="trip guide";await(0,g.a)({context:t})&&(0,n.LZ)({context:t,shareType:"trip_guide",tripCid:this.props.trip.cid})},handleTakeTripButtonClick:function(){(0,f.z)({trackAuthenticationPromptedContext:"guide copy trip",tripId:this.props.trip.id}).then((t=>{t&&this.takeTrip()}))},cacheElements:function(){this.$takeTripButton=this.$(".take-trip"),this.$takeTripSp
1an=this.$takeTripButton.find("span")},clonedButton:function(){this.$takeTripSpan.text("Trip Saved"),this.$takeTripButton.removeClass("disabled").addClass("cloned")},disableButton:function(){this.$takeTripButton.addClass("disabled")},enableButton:function(){this.$takeTripButton.removeClass("disabled")},takeTrip:function(t){if(!this.isCloning&&!this.isCloned){const t=this.props.trip.attributes.id;this.isCloning=!0,this.disableButton(),rt.core.api.trips.clone({params:{tripId:t}}).then((e=>{this.isCloned=!0,this.isCloning=!1,this.clonedButton(),redux.dispatch((0,w.Sw)()),(0,b.jL)({properties:{context:"trip guide",new_trip_id:e.trip.id},tripId:t})}),(()=>{this.isCloning=!1,this.enableButton()}))}}}),i(11527);var P=class{constructor(t){this.props=t,this.setPreloaderView(),this.didScroll=!1,this.isLoading=!1,this.scrollInterval=this.setScrollInterval(),this.handleDocumentVisibilityChange=this.handleDocumentVisibilityChange.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.handleWindowScroll=this.handleWindowScroll.bind(this),window.addEventListener("resize",this.handleWindowResize,!1),window.addEventListener("scroll",this.handleWindowScroll,!1),document.addEventListener("visibilitychange",this.handleDocumentVisibilityChange,!1),this.render(),this.handleWindowScroll()}setProps(t){this.props=_.extend({},this.props,t),this.render()}remove(){window.clearInterval(this.scrollInterval),window.removeEventListener("resize",this.handleWindowResize,!1),window.removeEventListener("scroll",this.handleWindowScroll,!1),document.removeEventListener("visibilitychange",this.handleDocumentVisibilityChange,!1)}handleAjaxLoad(t){const e=this.props.page+1;this.preloaderView.insertAdjacentHTML("beforebegin",t.target.responseText),this.props.setPage&&this.props.setPage(e),this.isLoading=!1,rt.helpers.lazyLoad.update(),e>=this.props.totalPages&&this.remove()}handleDocumentVisibilityChange(){document.hidden?window.clearInterval(this.scrollInterval):this.scrollInterval=this.setScrollInterval()}handleScrollInterval(){this.didScroll&&(this.checkScrollPosition(),this.didScroll=!1)}handleWindowResize(){this.handleWindowScroll()}handleWindowScroll(){this.didScroll=!0}checkScrollPosition(){const t=this.props.el.getBoundingClientRect().bottom-window.innerHeight;!this.isLoading&&t<=0&&this.loadMore()}loadMore(){const t=new XMLHttpRequest,e=this.props.page+1;t.open("GET","/trips/"+this.props.tripId+"?page="+e+"&remote=true"),t.addEventListener("load",this.handleAjaxLoad.bind(this),!1),t.send(),this.isLoading=!0}setPreloaderView(){this.preloaderView=this.props.el.querySelector(".preloader-view")}setScrollInterval(){return window.setInterval(this.handleScrollInterval.bind(this),250)}render(){this.setPreloaderView()}};rt.guide.views.TripGuideContainerView=Backbone.View.extend({initialize:function(t){this.props=t,this.state=this.getInitialState(),this.listenTo(rt.app.events,"fluxstatechange",_.debounce(this.handleStateChange,0))},getInitialState:function(){var t=this.$("#trip-guide-view")[0];return{page:parseInt(t.dataset.page,10),totalPages:parseInt(t.dataset.totalPages,10),trip:this.props.initialTrip,tripGuideViewEl:t}},afterDomInsertion:function(){this.tripGuideView&&this.tripGuideView.afterDomInsertion(),this.state.page<this.state.totalPages&&(this.scrollLoader=new P(this.getScrollLoaderProps())),rt.helpers.ads.refreshAllAds()},remove:function(){this.tripGuideView&&this.tripGuideView.remove(),this.scrollLoader&&this.scrollLoader.remove(),Backbone.View.prototype.remove.call(this)},getTitle:function(){return this.el.querySelector("#trip-guide-view").dataset.title},setState:function(t){this.state=_.extend({},this.state,t),this.render()},handleStateChange:function(){var t,e=this.state.trip.id,i=rt.core.reducers.state.getTripById(redux.getState(),e);i&&this.state.trip.attributes.lock_version!==i.attributes.lock_version&&(t=this.lastFetchHtmlPromise=rt.guide.views.TripGuideContainerView.promiseHtml({page:this.state.page,tripId:e})).then(function(i){t===this.lastFetchHtmlPromise&&this.setState({trip:rt.core.reducers.state.getTripById(redux.getState(),e),tripGuideViewEl:$(i).find("#trip-guide-view")[0]})}.bind(this))},getScrollLoaderProps:function(){return{el:this.state.tripGuideViewEl.querySelector(".waypoint-list"),page:this.state.page,setPage:this.setPage.bind(this),totalPages:this.state.totalPages,tripId:this.state.trip.id}},getTripGuideViewProps:function(){return{el:this.state.tripGuideViewEl,trip:this.state.trip}},setPage:function(t){this.setState({page:t})},render:function(){this.$("#trip-guide-view")[0]!==this.state.tripGuideViewEl&&this.$("#trip-guide-container-view").html(this.state.tripGuideViewEl),this.tripGuideView?this.tripGuideView.setProps(this.getTripGuideViewProps()):this.tripGuideView=new rt.guide.views.TripGuideView(this.getTripGuideViewProps()),this.scrollLoader&&this.scrollLoader.setProps(this.getScrollLoaderProps()),rt.helpers.lazyLoad.update()}},{createView:function(t){return new Promise((e=>
1{const{tripId:i}=t,s=this.isRendered()?"main":this.promiseHtml(t);rt.core.actionCreators.trips.fetch({tripId:i}),rt.core.redux.subscribeUntil((()=>{const t=rt.core.reducers.state.getTripById(redux.getState(),i);return!(!t||!Number.isInteger(t.attributes.lock_version)||(Promise.resolve(s).then((i=>{e(new rt.guide.views.TripGuideContainerView({el:i,initialTrip:t}))})),0))}))}))},isRendered:function(){return rt.app.router.initialRoute&&document.getElementById("trip-guide-container-view")},promiseHtml:function({page:t,tripId:e}){return fetch(`${rt.routes.trip_guide_path(e)}?page=${t||1}`,{headers:{"X-Requested-With":"XMLHttpRequest"}}).then((t=>t.text()))}});var S=function(t,e){return function(){return t.apply(e,arguments)}},T={}.hasOwnProperty;rt.guide.views.TripGuideView=function(t){function e(){return this.getToolbarViewProps=S(this.getToolbarViewProps,this),this.getStandardGuideViewProps=S(this.getStandardGuideViewProps,this),this.remove=S(this.remove,this),this.cacheElements=S(this.cacheElements,this),this.render=S(this.render,this),this.setProps=S(this.setProps,this),this.afterDomInsertion=S(this.afterDomInsertion,this),this.initialize=S(this.initialize,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var i in e)T.call(e,i)&&(t[i]=e[i]);function s(){this.constructor=t}s.prototype=e.prototype,t.prototype=new s,t.__super__=e.prototype}(e,Backbone.View),e.prototype.initialize=function(t){return this.props=t,this.cacheElements()},e.prototype.afterDomInsertion=function(){return this.standardGuideView=new l(this.getStandardGuideViewProps()),this.toolbarView=new rt.guide.views.ToolbarView(this.getToolbarViewProps())},e.prototype.setProps=function(t){return this.props=t,this.render()},e.prototype.render=function(){return this.el!==this.props.el&&(this.setElement(this.props.el),this.cacheElements()),this.standardGuideView.setProps(this.getStandardGuideViewProps()),this.toolbarView.setProps(this.getToolbarViewProps()),this},e.prototype.cacheElements=function(){return this.$standardGuideView=this.$("#standard-guide-view")},e.prototype.remove=function(){return this.standardGuideView.remove(),this.toolbarView.remove(),e.__super__.remove.apply(this,arguments)},e.prototype.getStandardGuideViewProps=function(){return{el:this.$standardGuideView[0],trip:this.props.trip}},e.prototype.getToolbarViewProps=function(){return{el:this.$(".toolbar-view")[0],trip:this.props.trip}},e}(),i(76171),i(72361),i(8759);var C=i(76572),x=function(t,e){return function(){return t.apply(e,arguments)}},k={}.hasOwnProperty;rt.guide.views.WaypointView=function(t){function e(){return this.reduceWaypointIndex=x(this.reduceWaypointIndex,this),this.findCenter=x(this.findCenter,this),this.handleSave=x(this.handleSave,this),this.handleGuideTextSave=x(this.handleGuideTextSave,this),this.getTextMomentViewProps=x(this.getTextMomentViewProps,this),this.getPhotoMomentViewProps=x(this.getPhotoMomentViewProps,this),this.getMomentViewProps=x(this.getMomentViewProps,this),this.getGuideTextViewProps=x(this.getGuideTextViewProps,this),this.getAddMomentViewProps=x(this.getAddMomentViewProps,this),this.remove=x(this.remove,this),this.cacheElements=x(this.cacheElements,this),this.render=x(this.render,this),this.setProps=x(this.setProps,this),this.initialize=x(this.initialize,this),e.__super__.constructor.apply(this,arguments)}return function(t,e){for(var i in e)k.call(e,i)&&(t[i]=e[i]);function s(){this.constructor=t}s.prototype=e.prototype,t.prototype=new s,t.__super__=e.prototype}(e,Backbone.View),e.prototype.initialize=function(t){if(this.props=t,this.cacheElements(),this.$addMomentView.length&&(this.addMomentView=new rt.guide.views.AddMomentView(this.getAddMomentViewProps())),this.$guideTextView.length&&(this.guideTextView=new rt.guide.views.GuideTextView(this.getGuideTextViewProps())),this.$photoMoment.length&&(this.photoMoment=new rt.guide.views.PhotoMoment(this.getPhotoMomentViewProps())),this.$textMoment.length)return this.textMoment=new rt.guide.views.TextMoment(this.getTextMomentViewProps())},e.prototype.setProps=function(t){return this.props=t,this.render()},e.prototype.render=function(){if(this.el!==this.props.el&&(this.setElement(this.props.el),this.cacheElements()),this.addMomentView&&this.addMomentView.setProps(this.getAddMomentViewProps()),this.guideTextView&&this.guideTextView.setProps(this.getGuideTextViewProps()),this.photoMoment&&this.photoMoment.setProps(this.getPhotoMomentViewProps()),this.textMoment)return this.textMoment.
1setProps(this.getTextMomentViewProps())},e.prototype.cacheElements=function(){return this.waypointIndex=this.reduceWaypointIndex(),this.$guideTextView=this.$(".guide-text-view"),this.$photoMoment=this.$(".photo-moment"),this.$textMoment=this.$(".text-moment"),this.$addMomentView=this.$(".add-moment-view")},e.prototype.remove=function(){var t,i,s,n;return null!=(t=this.addMomentView)&&t.remove(),null!=(i=this.guideTextView)&&i.remove(),null!=(s=this.photoMoment)&&s.remove(),null!=(n=this.textMoment)&&n.remove(),e.__super__.remove.apply(this,arguments)},e.prototype.getAddMomentViewProps=function(){var t,e,i,s,n,r,o,p;return(n=rt.core.trip.getInsertionLeg(this.props.trip,this.waypointIndex))&&n.attributes.encoded_polyline?(s=n.attributes.encoded_polyline,i=(0,C.MC)(s),t=_.flatten((0,C.cT)(i),!0),r=[480,200],e=geoViewport.viewport(t,r).center):(p=this.props.trip.attributes.waypoints.at(this.waypointIndex-1),o=this.props.trip.attributes.waypoints.at(this.waypointIndex),e=this.findCenter(p.attributes.end_location,o.attributes.start_location)),{el:this.$addMomentView[0],trip:{cid:this.props.trip.cid,id:this.props.trip.attributes.id,lockVersion:this.props.trip.attributes.lock_version,waypointsCount:this.props.trip.attributes.waypoints_count},waypoint:{index:this.waypointIndex,moment:{location:e},routed:!0}}},e.prototype.getGuideTextViewProps=function(){return{el:this.$guideTextView[0],onGuideTextSave:this.handleGuideTextSave}},e.prototype.getMomentViewProps=function(t){var e,i,s,n,r,o,p,h,a;return e=null!=(i=this.props.waypoint)?i.attributes:void 0,{el:t,trip:{cid:this.props.trip.cid,id:this.props.trip.attributes.id,lockVersion:this.props.trip.attributes.lock_version},waypoint:{filters_appearance:null,id:null!=e?e.id:void 0,index:this.waypointIndex,moment:{content:null!=e&&null!=(s=e.moment)?s.content:void 0,id:null!=e&&null!=(n=e.moment)?n.id:void 0,image:null!=e&&null!=(r=e.moment)?r.image.base_url:void 0,image_attribution:null!=e&&null!=(o=e.moment)?o.image_attribution:void 0,image_attribution_url:null!=e&&null!=(p=e.moment)?p.image_attribution_url:void 0,image_caption:null!=e&&null!=(h=e.moment)?h.image_caption:void 0,location:null!=e&&null!=(a=e.moment)?a.loc:void 0},routed:null!=e?e.routed:void 0,type:"moment"}}},e.prototype.getPhotoMomentViewProps=function(){return this.getMomentViewProps(this.$photoMoment[0])},e.prototype.getTextMomentViewProps=function(){return this.getMomentViewProps(this.$textMoment[0])},e.prototype.handleGuideTextSave=function(t){return this.handleSave({guide_text:t})},e.prototype.handleSave=function(t){return rt.core.actionCreators.waypoints.updateGuide({attributes:t,tripCid:this.props.trip.cid,waypointCid:this.props.waypoint.cid})},e.prototype.findCenter=function(t,e){var i;return i=(0,C.cT)([t,e]),(0,C.eC)(i)},e.prototype.reduceWaypointIndex=function(){return this.props.trip.attributes.waypoints.indexOf(this.props.waypoint)},e}()},5795:()=>{!function(){"use strict";rt.guide.views.EditableView=Backbone.View.extend({events:{"click .cancel":"handleCancelButtonClick","click .edit":"handleEditButtonClick","click .editable-output":"handleEditableOutputClick","click .save":"handleSaveButtonClick","input .input":"handleInputInput"},initialize:function(t){this.props=t.props,this.initializeView()},initializeView:function(){this.$cancelButton=this.$(".cancel"),this.$input=this.$(".input"),this.$save=this.$(".save"),this.state=this.getInitialState()},getInitialState:function(){var t=this.$input.val();return{initialText:t,inputText:t,isEditing:!1,isLoading:!1}},setState:function(t){this.state=_.extend({},this.state,t),this.render()},setProps:function(t){this.willReceiveProps(t),this.props=t.props,this.render()},willReceiveProps:function(t){this.el!==t.el&&(this.setElement(t.el),this.initializeView())},handleCancelButtonClick:function(){this.state.isLoading||this.setState({inputText:this.state.initialText,isEditing:!1})},handleEditableOutputClick:function(){this.setFocus()},handleEditButtonClick:function(){this.setFocus()},handleInputInput:function(){this.setState({inputText:this.$input.val()})},handleSaveButtonClick:function(){this.state.isLoading||this.state.inputText===this.state.initialText||(this.setState({initialText:this.state.inputText,isLoading:!0}),this.props.onEditableSave({text:this.state.inputText}))},setFocus:function(){this.setState({isEditing:!0}),this.$input.focus()},render:function(){this.renderSaveButton(),this.$input.val(this.state.inputText),this.$el.toggleClass("editing",this.state.isEditing),this.$el.toggleClass("no-text",!this.state.initialText&&!this.state.isEditing),this.$cancelButton.toggleClass("disabled",this.state.isLoading),this.renderInputHeight()},renderInputHeight:function(){var t,e,i;this.state.isEditing&&(this.$input.css("height","1px"),e=parseInt(this.$input.css("line-height"),10),t=(i=this.$input[0].scrollHeight)>1?i:e,this.$input.css("height",t+"px"))},renderSaveButton:function(){this.state.inputText===this.state.initialText?this.$save.addClass("disabled"):this.$save.removeClass("disabled")}})}()},60336:()=>{var t,e,i;(t=window.rt).guide||(t.guide={}),(e=window.rt.guide).components||(e.components={}),(i=window.rt.guide).views||(i.views={})},82225:()=>{var t=function(t,e){return function(){return t.apply(e,arguments)}},e={}.hasOwnProperty;rt.guide.views.GuideTextView=function(i){function s(){return this.handleEditableSave=t(this.handleEditableSave,this),this.getEditableViewProps=t(this.getEditableViewProps,this),this.remove=t(this.remove,this),this.render=t(this.render,this),this.setProps=t(this.setProps,this),this.initialize=t(this.initialize,this),s.__super__.constructor.apply(this,arguments)}return function(t,i){for(var s in i)e.call(i,s)&&(t[s]=i[s]);function n(){this.constructor=t}n.prototype=i.prototype,t.prototype=new n,t.__super__=i.prototype}(s,Backbone.View),s.prototype.initialize=function(t){return this.props=t,this.editableView=new rt.guide.views.EditableView(this.getEditableViewProps())},s.prototype.setProps=function(t){return this.props=t,this.render()},s.prototype.render=function(){return this.el!==this.props.el&&this.setElement(this.props.el),this.editableView.setProps(this.getEditableViewProps())},s.prototype.remove=function(){return this.editableView.remove(),s.__super__.remove.apply(this,arguments)},s.prototype.getEditableViewProps=function(){return{el:this.$(".editable-view")[0],props:{onEditableSave:this.handleEditableSave}}},s.prototype.handleEditableSave=function(t){return this.props.onGuideTextSave(t.text)},s}()},29903:()=>{var t=function(t,e){return function(){return t.apply(e,arguments)}},e={}.hasOwnProperty;rt.guide.views.ScrollActionsView=function(i){function s(){return this.remove=t(this.remove,this),this.handleWindowScroll=t(this.handleWindowScroll,this),this.handleWindowResize=t
1(this.handleWindowResize,this),this.handleTransitionEnd=t(this.handleTransitionEnd,this),this.showScrollActions=t(this.showScrollActions,this),this.render=t(this.render,this),this.setProps=t(this.setProps,this),this.initialize=t(this.initialize,this),s.__super__.constructor.apply(this,arguments)}return function(t,i){for(var s in i)e.call(i,s)&&(t[s]=i[s]);function n(){this.constructor=t}n.prototype=i.prototype,t.prototype=new n,t.__super__=i.prototype}(s,Backbone.View),s.prototype.events={transitionend:"handleTransitionEnd"},s.prototype.initialize=function(t){return this.asideActions=t.asideActions,this.toolbarActions=t.toolbarActions,this.$window=$(window),this.$window.on("resize",this.handleWindowResize),this.$window.on("scroll",this.handleWindowScroll),this.handleWindowResize()},s.prototype.setProps=function(t){return this.props=t,this.render()},s.prototype.render=function(){if(this.el!==this.props.el)return this.setElement(this.props.el)},s.prototype.showScrollActions=function(){return this.toolbarActions.getBoundingClientRect().bottom<88&&this.asideActions.getBoundingClientRect().bottom>this.windowHeight},s.prototype.handleTransitionEnd=function(){if(!this.$el.hasClass("show"))return this.$el.css("visibility","hidden")},s.prototype.handleWindowResize=function(){return this.windowHeight=$(window).height(),this.handleWindowScroll()},s.prototype.handleWindowScroll=function(){return this.showScrollActions()?this.$el.css("visibility","visible").addClass("show"):this.$el.removeClass("show")},s.prototype.remove=function(){return this.$window.off("resize",this.handleWindowResize),this.$window.off("scroll",this.handleWindowScroll),s.__super__.remove.apply(this,arguments)},s}()},27408:()=>{var t=function(t,e){return function(){return t.apply(e,arguments)}},e={}.hasOwnProperty;rt.guide.views.SelectView=function(i){function s(){return this.handleSaveButtonClick=t(this.handleSaveButtonClick,this),this.handleCancelButtonClick=t(this.handleCancelButtonClick,this),this.handleInputChange=t(this.handleInputChange,this),this.checkActionsButtons=t(this.checkActionsButtons,this),this.resetSelect=t(this.resetSelect,this),this.getValue=t(this.getValue,this),this.initialize=t(this.initialize,this),s.__super__.constructor.apply(this,arguments)}return function(t,i){for(var s in i)e.call(i,s)&&(t[s]=i[s]);function n(){this.constructor=t}n.prototype=i.prototype,t.prototype=new n,t.__super__=i.prototype}(s,Backbone.View),s.prototype.events={"change .input":"handleInputChange","click .cancel":"handleCancelButtonClick","click .save":"handleSaveButtonClick"},s.prototype.initialize=function(t){return this.handleSelectSave=t.handleSelectSave,this.$input=this.$(".input"),this.$cancel=this.$(".cancel"),this.$save=this.$(".save"),this.value=this.$input.val(),this.currentValue=this.value},s.prototype.getValue=function(){return this.$input.val()?this.$input.val():null},s.prototype.resetSelect=function(){var t;return t=this.value?this.value:null,this.$input.val(t)},s.prototype.checkActionsButtons=function(){return this.value!==this.currentValue?(this.$cancel.removeClass("disabled"),this.$save.removeClass("disabled")):(this.$save.addClass("disabled"),this.$cancel.addClass("disabled"))},s.prototype.handleInputChange=function(){return this.currentValue=this.$input.val(),this.checkActionsButtons()},s.prototype.handleCancelButtonClick=function(){if(!this.$cancel.hasClass("disabled"))return this.currentValue=this.value,this.checkActionsButtons(),this.resetSelect()},s.prototype.handleSaveButtonClick=function(){if(!this.$save.hasClass("disabled"))return this.value=this.currentValue,this.checkActionsButtons(),this.handleSelectSave(this.getValue())},s}()},11527:()=>{var t=function(t,e){return function(){return t.apply(e,arguments)}},e={}.hasOwnProperty;rt.guide.views.TripConclusionView=function(i){function s(){return this.remove=t(this.remove,this),this.handleConclusionSave=t(this.handleConclusionSave,this),this.getEditableViewProps=t(this.getEditableViewProps,this),this.render=t(this.render,this),this.setProps=t(this.setProps,this),this.initialize=t(this.initialize,this),s.__super__.constructor.apply(this,arguments)}return function(t,i){for(var s in i)e.call(i,s)&&(t[s]=i[s]);function n(){this.constructor=t}n.prototype=i.prototype,t.prototype=new n,t.__super__=i.prototype}(s,Backbone.View),s.prototype.initialize=function(t){return this.props=t,this.editableView=new rt.guide.views.EditableView(this.getEditableViewProps())},s.prototype.setProps=function(t){return this.props=t,this.render()},s.prototype.render=function(){return this.el!==this.props.el&&this.setElement(this.props.el),this.editableView.setProps(this.getEditableViewProps()),this},s.prototype.getEditableViewProps=function(){return{el:this.$(".editable-view")[0],props:{onEditableSave:this.handleConclusionSave,trip:this.props.trip}}},s.prototype.handleConclusionSave=function(t){return t=_.extend({},t.imageData,{conclusion:t.text}),this.props.onSaveTrip(t)},s.prototype.remove=function(){return this.editableView.remove(),s.__super__.remove.apply(this,arguments)},s}()},76171:()=>{var t=function(t,e){return function(){return t.apply(e,arguments)}},e={}.hasOwnProperty;rt.guide.views.TripIntroductionView=function(i){function s(){return this.remove=t(this.remove,this),this.handleIntroductionSave=t(this.handleIntroductionSave,this),this.getEditableViewProps=t(this.getEditableViewProps,this),this.render=t(this.render,this),this.setProps=t(this.setProps,this),this.initialize=t(this.initialize,this),s.__super__.constructor.apply(this,arguments)}return function(t,i){for(var s in i)e.call(i,s)&&(t[s]=i[s]);function n(){this.constructor=t}n.prototype=i.prototype,t.prototype=new n,t.__super__=i.prototype}(s,Backbone.View),s.prototype.initialize=function(t){return this.props=t,this.editableView=new rt.guide.views.EditableView(this.getEditableViewProps())},s.prototype.setProps=function(t){return this.props=t,this.render()},s.prototype.render=function(){return this.el!==this.props.el&&this.setElement(this.props.el),this.editableView.setProps(this.getEditableViewProps()),this},s.prototype.getEditableViewProps=function(){return{el:this.$(".editable-view")[0],props:{onEditableSave:this.handleIntroductionSave,trip:this.props.trip}}},s.prototype.handleIntroductionSave=function(t){return t=_.extend({},t.imageData,{introduction:t.text}),this.props.onSaveTrip(t)},s.prototype.remove=function(){return this.editableView.remove(),s.__super__.remove.apply(this,arguments)},s}()},72361:()=>{var t=function(t,e){return function(){return t.apply(e,arguments)}},e={}.hasOwnProperty;rt.guide.views.TripNameView=function(i){function s(){return this.remove=t(this.remove,this),this.handleNameSave=t(this.handleNameSave,this),this.getEditableViewProps=t(this.getEditableViewProps,this),this.render=t(this.render,this),this.setProps=t(this.setProps,this),this.initialize=t(this.initialize,this),s.__super__.constructor.apply(this,arguments)}return function(t,i){for(var s in i)e.call(i,s)&&(t[s]=i[s]);function n(){this.constructor=t}n.prototype=i.prototype,t.prototype=new n,t.__super__=i.prototype}(s,Backbone.View),s.prototype.initialize=function(t){return this.props=t,this.editableView=new rt.guide.views.EditableView(this.getEditableViewProps())},s.prototype.setProps=function(t){return this.props=t,this.render()},s.prototype.render=function(){return this.el!==this.props.el&&this.setElement(this.props.el),this.editableView.setProps(this.getEditableViewProps()),this},s.prototype.getEditableViewProps=function(){return{el:this.$(".editable-view")[0],props:{onEditableSave:this.handleNameSave}}},s.prototype.handleNameSave=function(t){var e;return e=t.text?t.text:"My New Trip",this.props.onSaveTrip({name:e})},s.prototype.remove=function(){return this.editableView.remove(),s.__super__.remove.apply(this,arguments)},s}()},8759:()=>{var t=function(t,e){return function(){return t.apply(e,arguments)}},e={}.hasOwnProperty;rt.guide.views.TripSubtitleView=function(i){function s(){return this.remove=t(this.remove,this),this.handleSubtitleSave=t(this.handleSubtitleSave,this),this.getEditableViewProps=t(this.getEditableViewProps,this),this.render=t(this.render,this),this.setProps=t(this.setProps,this),this.initialize=t(this.initialize,this),s.__super__.constructor.apply(this,arguments)}return function(t,i){for(var s in i)e.call(i,s)&&(t[s]=i[s]);function n(){this.constructor=t}n.prototype=i.prototype,t.prototype=new n,t.__super__=i.prototype}(s,Backbone.View),s.prototype.initialize=function(t){return this.props=t,this.editableView=new rt.guide.views.EditableView(this.getEditableViewProps())},s.prototype.setProps=function(t){return this.props=t,this.render()},s.prototype.render=function(){return this.el!==this.props.el&&this.setElement(this.props.el),this.editableView.setProps(this.getEditableViewProps()),this},s.prototype.getEditableViewProps=function(){return{el:this.$(".editable-view")[0],props:{onEditableSave:this.handleSubtitleSave}}},s.prototype.handleSubtitleSave=function(t){return this.props.onSaveTrip({subt
1itle:t.text})},s.prototype.remove=function(){return this.editableView.remove(),s.__super__.remove.apply(this,arguments)},s}()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.