1"use strict";(self.webpackChunkhikingbook=self.webpackChunkhikingbook||[]).push([[34,5559,6380],{8517(e,t,s){s.d(t,{x:()=>i.A});var i=s(9367),l=s(25381),a=s(57984);s(13994),s(72382);let r=(0,l.JK)(!0);"zh_TW"!==r&&(r=r.split("_")[0]);const o={now:(0,a.yf)().subtract(30,"year").toDate(),locale:r.toLowerCase()};s.d(t,["p",0,o])},15002(e,t,s){s.d(t,{A:()=>i});class i{constructor(e){this.proReviewUserID=e.proReviewUserID,this.reply=e.reply||"",this.createdAt=e.createdAt?new Date(e.createdAt):new Date,this.updatedAt=e.updatedAt?new Date(e.updatedAt):new Date}}},40231(e,t,s){s.d(t,{A:()=>a});var i=s(5559),l=s(15002);class a{constructor(e){this.userID=e.userID,this.rating=e.rating||5,this.title=e.title||"",this.review=e.review||"",this.tags=e.tags||[],this.createdAt=e.createdAt?new Date(e.createdAt):new Date,this.updatedAt=e.updatedAt?new Date(e.updatedAt):new Date,this.user=e.user?new i.A(e.user):null,this.proReviewReply=e.proReviewReply?new l.A(e.proReviewReply):null,this.highlightedAt=e.highlightedAt?new Date(e.highlightedAt):null}get isEmpty(){return 0===this.title.length&&0===this.review.length&&0===this.tags.length}get isHighlight(){return null!=this.highlightedAt}set isHighlight(e){this.highlightedAt=e?new Date:null}}},5559(e,t,s){s.d(t,{A:()=>l});var i=s(56059);class l{constructor(e){this.encodedID=e.encodedID,this.displayName=e.displayName||"",this.username=e.username||"",this.avatarURL=e.avatarURL||"",this.state=e.state||i.A.userState.nonactivated,this.isPro=e.isPro||!1,this.isSponsor=e.isSponsor||!1,this.numPublicActivities=e.numPublicActivities||0,this.numFollowers=e.numFollowers||0,this.numTrailCompletions=e.numTrailCompletions||0,this.isFollowing=e.isFollowing||!1,this.followingFollower=e.followingFollower?new l(e.followingFollower):null,this.trailLatestCompletedAt=e.trailLatestCompletedAt?new Date(e.trailLatestCompletedAt):null}get profileURL(){return`/${this.username}`}get activated(){return this.state===i.A.userState.activated}}},56380(e,t,s){function i(e){var t=e.match(/^(\w+) ((\d+)-(\d+)|\*)\/(\d+|\*)$/);if(!t)return null;var s=t[1],i=t[3],l=t[4],a=t[5],r={unit:s,start:null!=i?Number(i):null,end:null!=l?Number(l):null,size:"*"===a?null:Number(a)};return null===r.start&&null===r.end&&null===r.size?null:r}s.d(t,{parse:()=>i})},1940(e,t){t.A=(e,t)=>{const s=e.__vccOpts||e;for(const[e,i]of t)s[e]=i;return s}},60034(e,t,s){s.r(t),s.d(t,{default:()=>I});s(47144),s(25744);var i=s(49424);const l={class:"sticky-top bg-dark py-3 d-flex flex-column gap-3"},a={class:"row gy-3 align-items-end"},r={class:"col-md"},o={class:"input-group"},n={class:"col-md-auto"},c=["value"],d={class:"form-check-label"},h={class:"col-md-auto"},u={key:0,class:"d-flex flex-column gap-2 mb-3"},p={class:"text-warning"},g={class:"row gy-3"},v={class:"card"},w={class:"card-body"},m=["id"],f=["for"],k=["id","onUpdate:modelValue"],b={class:"text-end mt-2"},y=["onClick"],L={class:"d-flex justify-content-between align-items-center mt-2"},R={class:"badge bg-primary"},A={class:"d-flex gap-2 align-items-center"},C={class:"form-check form-switch"},x=["id","onUpdate:modelValue","onChange"],P=["for"],D=["data-bs-target"];s(99921),s(8021),s(86873);var T=s(25381),$=s(56380),F=s(40231),U=s(15002),V=s(8517),E=s(56059);const H={components:{InfiniteLoading:(0,i.$V)(()=>Promise.all([s.e(3900),s.e(1633)]).then(()=>s(84014))),ProReviewView:(0,i.$V)(()=>Promise.all([s.e(3900),s.e(971)]).then(()=>s(971))),flatpickr:V.x},data:()=>({totalProReviews:0,proReviews:[],datesText:"",params:{limit:12,dates:[],status:"not-replied",ratings:[3,5]}}),computed:{flatpickrRangeConfig:()=>Object.assign({},V.p,{mode:"range",dateFormat:E.A.format.flatpickr.date,now:new Date})},methods:{filter(){this.proReviews.length=0,this.$refs.infiniteLoading.reload()},fetchProReviews(e){this.params.offset=this.proReviews.length,(0,T.hd)(`/pro-reviews?${(0,T.jw)(this.params)}`,{methods:"GET",includeHeaders:!0}).then(({headers:t,body:s})=>{const i=(0,$.parse)(t.get("Content-Range"));i&&(this.totalProReviews=i.size),s.forEach(e=>{const t=new F.A(e);t.proReviewReply||(t.proReviewReply=new U.A({proReviewUserID:t.userID})),this.proReviews.push(t)}),this.proReviews.length>=this.totalProReviews?e.complete():e.loaded()}).catch(()=>{e.error()})},putProReviewReply(e,t){const s=this.$refs.replyForm[e];s.checkValidity()?(0,T.hd)("/pro-review-replies",{method:"PUT",body:JSON.stringify([this.proReviews[e].proReviewReply])},t.target).then(t=>{t.length>
10&&(this.proReviews[e].proReviewReply=new U.A(t[0])),this.$bus.emit("showToast",{result:!0})}).catch(e=>{this.$bus.emit("showToast",{result:!1,message:"["+e.status+"] "+e.message})}):s.classList.add("was-validated")},patchProReview(e){(0,T.hd)(`/pro-reviews/${(0,T.cJ)(e.userID)}`,{method:"PATCH",body:JSON.stringify({isHighlight:e.isHighlight})}).then(()=>{this.$bus.emit("showToast",{result:!0})}).catch(e=>{this.$bus.emit("showToast",{result:!1,message:"["+e.status+"] "+e.message})})},datesOnChange(e){this.params.dates=e}}};const I=(0,s(1940).A)(H,[["render",function(e,t,s,T,$,F){const U=(0,i.g2)("flatpickr"),V=(0,i.g2)("pro-review-view"),E=(0,i.g2)("infinite-loading");return(0,i.uX)(),(0,i.CE)(i.FK,null,[(0,i.Lk)("div",l,[t[6]||(t[6]=(0,i.Lk)("div",{class:"d-flex align-items-center justify-content-between"},[(0,i.Lk)("div",{class:"d-flex align-items-center gap-2"},[(0,i.Lk)("h1",null,[(0,i.Lk)("i",{class:"bi bi-pencil"}),(0,i.eW)(" Pro Reviews")])])],-1)),(0,i.Lk)("div",a,[(0,i.Lk)("div",r,[(0,i.Lk)("div",o,[(0,i.bF)(U,{modelValue:$.datesText,"onUpdate:modelValue":t[0]||(t[0]=e=>$.datesText=e),type:"text",class:"form-control",placeholder:"æ¥æç¯å",config:F.flatpickrRangeConfig,onOnChange:F.datesOnChange},null,8,["modelValue","config","onOnChange"]),(0,i.bo)((0,i.Lk)("select",{"onUpdate:modelValue":t[1]||(t[1]=e=>$.params.status=e),class:"form-select"},[...t[4]||(t[4]=[(0,i.Lk)("option",{value:"all"}," å ¨é¨ ",-1),(0,i.Lk)("option",{value:"highlighted"}," Highlighted ",-1),(0,i.Lk)("option",{value:"replied"}," å·²åè¦ ",-1),(0,i.Lk)("option",{value:"not-replied"}," å°æªåè¦ ",-1)])],512),[[i.u1,$.params.status]])])]),(0,i.Lk)("div",n,[t[5]||(t[5]=(0,i.Lk)("div",null,[(0,i.Lk)("label",{class:"form-label"},"è©å")],-1)),((0,i.uX)(),(0,i.CE)(i.FK,null,(0,i.pI)(5,e=>(0,i.Lk)("div",{key:e,class:"form-check form-check-inline"},[(0,i.bo)((0,i.Lk)("input",{"onUpdate:modelValue":t[2]||(t[2]=e=>$.params.ratings=e),class:"form-check-input",type:"checkbox",value:e},null,8,c),[[i.lH,$.params.ratings]]),(0,i.Lk)("label",d,(0,i.v_)(e),1)])),64))]),(0,i.Lk)("div",h,[(0,i.Lk)("button",{class:"btn btn-success",onClick:t[3]||(t[3]=(...e)=>F.filter&&F.filter(...e))}," ç¯©é¸ ")])])]),$.totalProReviews>0?((0,i.uX)(),(0,i.CE)("div",u,[(0,i.Lk)("h4",p," Total: "+(0,i.v_)($.totalProReviews),1),(0,i.Lk)("div",g,[((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)($.proReviews,(e,s)=>((0,i.uX)(),(0,i.CE)("div",{key:s,class:"col-md-4"},[(0,i.Lk)("div",v,[(0,i.Lk)("div",w,[(0,i.bF)(V,{"pro-review":e,full:!0},null,8,["pro-review"]),(0,i.Lk)("div",{id:`review-${s}`,class:"collapse"},[t[8]||(t[8]=(0,i.Lk)("hr",null,null,-1)),(0,i.Lk)("form",{ref_for:!0,ref:"replyForm",novalidate:""},[(0,i.Lk)("div",null,[(0,i.Lk)("label",{class:"form-label",for:`reply-${s}`},"åè¦",8,f),(0,i.bo)((0,i.Lk)("textarea",{id:`reply-${s}`,"onUpdate:modelValue":t=>e.proReviewReply.reply=t,class:"form-control",rows:"3",required:""},null,8,k),[[i.Jo,e.proReviewReply.reply,void 0,{trim:!0}]]),t[7]||(t[7]=(0,i.Lk)("div",{class:"invalid-feedback"}," è«æä¾ææçåè¦ ",-1))]),(0,i.Lk)("div",b,[(0,i.Lk)("button",{type:"button",class:"btn btn-success btn-sm",onClick:e=>F.putProReviewReply(s,e)}," éåº ",8,y)])],512)],8,m),(0,i.Lk)("div",L,[(0,i.Lk)("span",R,(0,i.v_)(e.rating),1),(0,i.Lk)("div",A,[(0,i.Lk)("div",C,[(0,i.bo)((0,i.Lk)("input",{id:`highlight-${s}`,"onUpdate:modelValue":t=>e.isHighlight=t,class:"form-check-input",type:"checkbox",role:"switch",onChange:t=>F.patchProReview(e)},null,40,x),[[i.lH,e.isHighlight]]),(0,i.Lk)("label",{class:"form-check-label",for:`highlight-${s}`},"Highlight",8,P)]),(0,i.Lk)("button",{class:"btn btn-success btn-sm",type:"button","data-bs-toggle":"collapse","data-bs-target":`#review-${s}`,"aria-expanded":"false"}," Toggle ",8,D)])])])])]))),128))])])):(0,i.Q3)("v-if",!0),(0,i.bF)(E,{ref:"infiniteLoading",load:F.fetchProReviews},(0,i.eX)({_:2},[$.totalProReviews<=0?{name:"complete",fn:(0,i.k6)(()=>[t[9]||(t[9]=(0,i.Lk)("h5",{class:"text-center"}," No Reviews ",-1))]),key:"0"}:void 0]),1032,["load"])],64)}]])},69786(e,t,s){var i=s(41175),l=s(82001),a=TypeError,r=Object.getOwnPropertyDescriptor,o=i&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=o?function(e,t){if(l(e)&&!r(e,"length").writable)throw new a("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},12504(e){var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw new t("Maximum allowed index exceeded");return e}},99921(e,t,s){var i=s(11187),l=s(16674),a=s(95807),r=s(69786),o=s(12504);i({target:"Array",proto:!0,arity:1,forced:s(94892)(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=l(this),s=a(t),i=arguments.length;o(s+i);for(var n=0;n<i;n++)t[s]=arguments[n],s++;return r(t,s),s}})}}]); 2//# sourceMappingURL=34.a4e5fe56ba40968d7cb7.min.js.map
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.