PageSourceSearch

https://dreamy-dijkstra-527e49.netlify.app/js/app.01a02edd.js

js dreamy-dijkstra-527e49.netlify.app collected 2026-10-03 10:39:59 UTC 109,486 bytes, 2 lines download raw bytes

1(function(){"use strict";var t={3614:function(t,e,a){var o=a(5471),i=a(1482),s=a(8929),r=a(2696),n=a(8024),l=a(4341),c=a(2938),d=a(9925),p=a(6179),u=a(4400),m=a(4),f=a(6268),y=a(765),v=a(8841),g=a(1995),h=a(1034),_=a(2367),A=function(){var t=this,e=t._self._c;t._self._setupProxy;return e(i.A,[e(s.A,{directives:[{name:"show",rawName:"v-show",value:t.appState.isInitialState||t.appState.isEditFactoryMode&&t.$vuetify.breakpoint.mdAndUp,expression:"appState.isInitialState || (appState.isEditFactoryMode && $vuetify.breakpoint.mdAndUp)"}],attrs:{app:"",color:"primary",dark:"","clipped-right":""}},[e(n.A,{staticClass:"d-sm-none",staticStyle:{visibility:"hidden"},attrs:{icon:""}},[e(p.A,[t._v("mdi-temp")])],1),e(h.A,{staticClass:"d-sm-none"}),e(_.sw,[t._v("農地工廠回報")]),e(h.A),e("div",{staticClass:"d-none d-sm-flex"},[e(n.A,{attrs:{text:""},on:{click:t.modalActions.openTutorialModal}},[t._v(" 使用教學 ")]),e(n.A,{attrs:{text:""},on:{click:t.modalActions.openSafetyModal}},[t._v(" 安全須知 ")]),e(n.A,{attrs:{text:""},on:{click:t.modalActions.openContactModal}},[t._v(" 聯絡我們 ")]),e(n.A,{attrs:{text:"",href:"https://about.disfactory.tw/#question"}},[t._v(" 常見問題 ")]),e(n.A,{attrs:{text:"",href:"https://about.disfactory.tw",target:"_blank"}},[t._v(" 關於回報系統 ")]),e(n.A,{attrs:{text:"",href:"https://airtable.com/shrUraKakZRpH52DO",target:"_blank"}},[t._v(" 問題回報 ")])],1),e(r.A,{staticClass:"d-flex d-sm-none",on:{click:function(e){t.drawer=!t.drawer}}})],1),e(g.A,{staticClass:"app-sidebar",attrs:{app:"",right:"",temporary:""},model:{value:t.drawer,callback:function(e){t.drawer=e},expression:"drawer"}},[e(u.A,{attrs:{nav:"",dense:""}},[e(f.A,{attrs:{"active-class":"deep-purple--text text--accent-4"}},[e(m.A,{on:{click:t.modalActions.openTutorialModal}},[e(y.UZ,[t._v("使用教學")])],1),e(m.A,{on:{click:t.modalActions.openSafetyModal}},[e(y.UZ,[t._v("安全須知")])],1),e(m.A,{on:{click:t.modalActions.openContactModal}},[e(y.UZ,[t._v("聯絡我們")])],1),e(m.A,{attrs:{href:"https://about.disfactory.tw/#section-f_c360c8de-447e-4c0a-a856-4af18b9a5240",target:"_blank"}},[e(y.UZ)],1),e(m.A,{attrs:{href:"https://about.disfactory.tw",target:"_blank"}},[e(y.UZ,[t._v("關於回報系統")])],1),e(m.A,{attrs:{href:"https://airtable.com/shrUraKakZRpH52DO",target:"_blank"}},[e(y.UZ,[t._v("問題回報")])],1)],1)],1)],1),e(v.A,{staticStyle:{"max-height":"100%",height:"100%"}},[e("app-alert",{attrs:{alert:t.alertState.alert,dismiss:t.alertActions.dismissAlert}}),e(d.A,{attrs:{"max-width":"305"},model:{value:t.modalState.createFactorySuccessModal,callback:function(e){t.$set(t.modalState,"createFactorySuccessModal",e)},expression:"modalState.createFactorySuccessModal"}},[e(l.A,{staticClass:"text-center pt-5"},[e(p.A,{staticStyle:{"font-size":"80px"},attrs:{color:"primary"}},[t._v(" mdi-checkbox-marked-circle ")]),e(c.ri,{staticClass:"secondary--text justify-center"},[t._v(" 新增可疑工廠成功 ")]),e(c.OQ,[e("small",[t._v(" 3 秒後自動關閉提示訊息 ")])])],1)],1),e(d.A,{attrs:{"max-width":"305"},model:{value:t.modalState.updateFactoryImageSuccessModal,callback:function(e){t.$set(t.modalState,"updateFactoryImageSuccessModal",e)},expression:"modalState.updateFactoryImageSuccessModal"}},[e(l.A,{staticClass:"text-center pt-5"},[e(p.A,{staticStyle:{"font-size":"80px"},attrs:{color:"primary"}},[t._v(" mdi-checkbox-marked-circle ")]),e(c.ri,{staticClass:"secondary--text justify-center"},[t._v(" 補充工廠照片成功 ")]),e(c.OQ,[e("small",[t._v(" 3 秒後自動關閉提示訊息 ")])])],1)],1),e(d.A,{attrs:{"max-width":"305"},model:{value:t.modalState.updateFactorySuccessModal,callback:function(e){t.$set(t.modalState,"updateFactorySuccessModal",e)},expression:"modalState.updateFactorySuccessModal"}},[e(l.A,{staticClass:"text-center pt-5"},[e(p.A,{staticStyle:{"font-size":"80px"},attrs:{color:"primary"}},[t._v(" mdi-checkbox-marked-circle ")]),e(c.ri,{staticClass:"secondary--text justify-center"},[t._v(" 補充工廠資訊成功 ")]),e(c.OQ,[e("small",[t._v(" 3 秒後自動關閉提示訊息 ")])])],1)],1),e("about-modal",{attrs:{open:t.modalState.aboutModalOpen,dismiss:t.modalActions.closeAboutModal}}),e("contact-modal",{attrs:{open:t.modalState.contactModalOpen,dismiss:t.modalActions.closeContactModal}}),e("getting-started-modal",{attrs:{open:t.modalState.gettingStartedModalOpen,dismiss:t.modalActions.closeGettingStartedModal}}),e("safety-modal",{model:{value:t.modalState.safetyModalOpen,callback:function(e){t.$set(t.modalState,"safetyModalOpen",e)},expression:"modalState.safetyModalOpen"}}),e("tutorial-modal",{attrs:{open:t.modalState.tutorialModalOpen,dismiss:t.modalActions.closeTutorialModal}}),e("ios-version-modal",{attrs:{open:t.modalState.supportIOSVersionModalOpen,dismiss:t.modalActions.closesupportIOSVersionModal}}),e("api-config-modal",{attrs:{open:t.modalState.apiConfigModalOpen,dismiss:t.modalActions.closeApiConfigModal}}),e("MapView",{attrs:{setFactoryLocation:t.appActions.setFactoryLocation}}),t.appState.isCreateMode?e("create-factory-steps"):t._e(),t.appState.isEditMode?e("update-factory-steps"):t._e()],1),e("factory-detail-page")],1)},w=[],b=function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",{staticClass:"map-container"},[e("div",{ref:"root",staticClass:"map"}),t.appState.isInitialPage?e("div",{staticClass:"container-fluid px-1 pt-7 pb-4 filter-buttons-container",class:{desktop:t.$vuetify.breakpoint.mdAndUp,"sidebar-expanded":t.appState.factoryDetailsExpanded}},[e("display-setting-bottom-sheet"),t._l(t.filterButtonsData,(function(a){return e(n.A,{key:a.value,staticClass:"mx-2 mb-5 primary--text",class:{"
1inactive-filter":!t.checkActive(a.value)},attrs:{rounded:"",color:"white",name:a.text},on:{click:function(e){return t.onClickFilterButton(a.value)}}},[e(p.A,{attrs:{color:a.color}},[t._v("mdi-map-marker")]),t._v(" "+t._s(a.text)+" ")],1)}))],2):t._e(),e("div",{staticClass:"ol-fit-location ol-unselectable ol-control",attrs:{"data-label":"map-locate"},on:{click:t.zoomToGeolocation}},[t._m(0)]),t.appState.selectFactoryMode?e("div",{staticClass:"center-point"}):t._e(),t.appState.selectFactoryMode?t._e():e("div",{staticClass:"factory-button-group flex justify-center mb-5 mb-8-md"},[e(n.A,{attrs:{color:"primary",rounded:"",large:""},on:{click:t.onClickCreateFactoryButton}},[t._v(" 我想新增可疑工廠 ")])],1)])},x=[function(){var t=this,e=t._self._c;t._self._setupProxy;return e("button",{attrs:{title:"定位"}},[e("img",{attrs:{src:"/images/locate.svg",alt:"locate"}})])}],S=a(5215),C=a(181),F=a.n(C),k=a(4618),I=a(7234),M=a(3610),E=function(){var t=this,e=t._self._c;t._self._setupProxy;return e("span",[t.$vuetify.breakpoint.mdAndUp?e(I.A,{attrs:{"content-class":"display-setting-popover","close-on-content-click":!1,"nudge-width":200,"offset-y":""},scopedSlots:t._u([{key:"activator",fn:function(a){var o=a.on,i=a.attrs;return[e(n.A,t._g(t._b({staticClass:"mx-2 mb-5 white--text",attrs:{color:"primary"}},"v-btn",i,!1),o),[t._v(" 顯示設定 ")])]}}],null,!1,3665771213),model:{value:t.isOpen,callback:function(e){t.isOpen=e},expression:"isOpen"}},[e(l.A,[e(u.A,[e(m.A,[e("h2",{staticClass:"primary--text text-button"},[t._v("農地範圍 •")]),e(n.A,{staticClass:"primary--text",class:t.isLUIMapVisable?"font-weight-light":"font-weight-bold",attrs:{text:"","x-small":""},on:{click:function(e){t.isLUIMapVisable=!1}}},[t._v("隱藏")]),e(n.A,{staticClass:"primary--text",class:t.isLUIMapVisable?"font-weight-bold":"font-weight-light",attrs:{text:"","x-small":""},on:{click:function(e){t.isLUIMapVisable=!0}}},[t._v("顯示")])],1),e(m.A,[e("switch-map-mode-button",{attrs:{isInSheet:!0}})],1)],1)],1)],1):e(k.A,{scopedSlots:t._u([{key:"activator",fn:function(a){var o=a.on,i=a.attrs;return[e(n.A,t._g(t._b({staticClass:"mx-2 mb-5 white--text",attrs:{color:"primary"}},"v-btn",i,!1),o),[t._v(" 顯示設定 ")])]}}]),model:{value:t.isOpen,callback:function(e){t.isOpen=e},expression:"isOpen"}},[e(u.A,[e(M.A,[t._v("地圖顯示設定")]),e(m.A,[e("h2",{staticClass:"primary--text text-button"},[t._v("農地範圍 •")]),e(n.A,{staticClass:"primary--text",class:t.isLUIMapVisable?"font-weight-light":"font-weight-bold",attrs:{text:"","x-small":""},on:{click:function(e){t.isLUIMapVisable=!1}}},[t._v("隱藏")]),e(n.A,{staticClass:"primary--text",class:t.isLUIMapVisable?"font-weight-bold":"font-weight-light",attrs:{text:"","x-small":""},on:{click:function(e){t.isLUIMapVisable=!0}}},[t._v("顯示")])],1),e(m.A,[e("switch-map-mode-button",{attrs:{isInSheet:!0}})],1)],1)],1)],1)},T=[];const O=Symbol("MAIN_MAP_CONTROLLER");a(2010);var L=function(){var t=this,e=t._self._c;t._self._setupProxy;return e(k.A,{scopedSlots:t._u([{key:"activator",fn:function(a){var o=a.on,i=a.attrs;return[e(n.A,t._g(t._b({staticClass:"primary--text",class:t.isInSheet?"pa-0":null,attrs:{rounded:!t.isInSheet,text:t.isInSheet,color:"white"}},"v-btn",i,!1),o),[t._v(" 切換地圖模式 • "+t._s(t.currentMapModeName)+" ")])]}}]),model:{value:t.mapModeBottomSheet,callback:function(e){t.mapModeBottomSheet=e},expression:"mapModeBottomSheet"}},[e(u.A,[e(M.A,[t._v("切換地圖模式")]),t._l(t.mapModes,(function(a){return e(m.A,{key:a.type,on:{click:function(e){t.currentMapMode=a.type}}},[e(y.UZ,{staticClass:"primary--text"},[t._v(t._s(a.name))])],1)}))],2)],1)},P=[],U=(a(4114),a(2772)),D=a(8436),R=a(7884),z=a(8069),B=a(6445),$=a(2671),V=a(9144),G=a(5370),N=a(4477),j=a(2475),K=a(1117),W=a(6928),H=a(3618),Y=a(8108),Z=a(5752),Q=a(8762),J=a(5612),q=a(1286),X=a(9464),tt=a(9361),et=a(2025),at=a(8116),ot=a(833),it=a(2661),st=a(8568),rt=a(1149),nt=a(3474);const lt=[{value:"2-1",text:"金屬: 沖床、銑床、車床、鏜孔"},{value:"2-2",text:"金屬: 焊接、鑄造、熱處理"},{value:"2-3",text:"金屬: 金屬表面處理、噴漆"},{value:"3",text:"塑膠加工、射出"},{value:"4",text:"橡膠加工"},{value:"5",text:"非金屬礦物(石材)"},{value:"6",text:"食品"},{value:"7",text:"皮革"},{value:"8",text:"紡織"},{value:"9",text:"其他"}],ct=["default",0,1,2,3],dt=[{type:"default",name:"未處理",documentDisplayStatuses:["疑似工廠"],color:"#A22A29"},{type:0,name:"處理中",documentDisplayStatuses:["已檢舉","已排程稽查","陳述意見期","已勒令停工"],color:"#457287"},{type:1,name:"已斷電",documentDisplayStatuses:["已發函斷電","已排程拆除"],color:"#364516"},{type:2,name:"已拆除",documentDisplayStatuses:["已拆除"],color:"#A1A1A1"},{type:3,name:"無法處理",documentDisplayStatuses:["等待新事證"],color:"#E0E0E0"}],pt=dt.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e.type]:e})),{}),ut=t=>pt[t].name,mt=t=>pt[t].color,ft=window.OffscreenCanvas?new OffscreenCanvas(500,500):document.createElement("canvas"),yt=ft.getContext("2d"),vt=t=>e=>new Promise((a=>{const o=new Image;o.crossOrigin="",o.src=e,o.style.display="none",o.onload=()=>(0,S.sH)(void 0,void 0,void 0,(function*(){ft.width=o.width,ft.height=o.height,yt.clearRect(0,0,ft.width,ft.height),yt.drawImage(o,0,0);const e=yt.getImageData(0,0,o.width,o.height),{data:i}=e;yield Promise.resolve(t(i));const s=document.createElement("canvas"),r=s.getContext("2d");s.width=o.width,s.height=o.height,r.putImageData(e,0,0),a(s.toDataURL()),o.remove(),s.remove()}))})),gt=(vt((t=>{for(let e=0;e<t.length;e+=4){const a=(t[e]+t[e+1]+t[e+2])/3;t[e]=a,t[e+1]=a,t[e+2]=a}})),[[255,241,0]]),ht=(t,e)=>!t.some(((t,a)=>e[a]!==t)),_t=t=>gt.some((e=>ht(e,t))),At=vt((t=>{for(let e=0;e<t.length;e+=4){const a=Array.from(t.slice(e,e+3));_t(a)?(t[e]=0,t[e+1]=0,t[e+2]=0,t[e+3]=1):(t[e]=0,t[e+1]=0,t[e+2]=0,t[e+3]=255)}}));var wt=a(3833),bt=a(2380),xt=a(3399),St=a(7694),Ct=a(2033),Ft=a(9031);const kt={version:8,name:"Light",sources:{protomaps:{type:"vector",tiles:["https://api.protomaps.com/tiles/v2/{z}/{x}/{y}.pbf"],minzoom:0,maxzoom:14,attribution:'<a href="https://protomaps.com" target="_blank">Protomaps</a> © <a href="https://www.openstreetmap.org" target="_blank"> OpenStreetMap</a>'}},layers:[{id:"background",type:"background",paint:{"background-color":"#dddddd"}}
1,{id:"earth",type:"fill",source:"protomaps","source-layer":"earth",paint:{"fill-color":" #e7f1ee"}},{id:"landuse_park",type:"fill",source:"protomaps","source-layer":"landuse",filter:["any",["==","pmap:kind","park"],["==","landuse","cemetery"]],paint:{"fill-color":"#c2f7d1"}},{id:"landuse_hospital",type:"fill",source:"protomaps","source-layer":"landuse",filter:["any",["==","pmap:kind","hospital"]],paint:{"fill-color":"#ffeae8"}},{id:"landuse_industrial",type:"fill",source:"protomaps","source-layer":"landuse",filter:["any",["==","pmap:kind","industrial"]],paint:{"fill-color":"#f8ffed"}},{id:"landuse_school",type:"fill",source:"protomaps","source-layer":"landuse",filter:["any",["==","pmap:kind","school"]],paint:{"fill-color":"#f2fef9"}},{id:"natural_wood",type:"fill",source:"protomaps","source-layer":"natural",filter:["any",["==","natural","wood"],["==","leisure","nature_reserve"],["==","landuse","forest"]],paint:{"fill-color":"#eafbe9"}},{id:"landuse_pedestrian",type:"fill",source:"protomaps","source-layer":"landuse",filter:["any",["==","highway","footway"]],paint:{"fill-color":"#eef0f0"}},{id:"natural_scrub",type:"fill",source:"protomaps","source-layer":"natural",filter:["in","natural","scrub","grassland"],paint:{"fill-color":"rgb(219,239,209)"}},{id:"natural_glacier",type:"fill",source:"protomaps","source-layer":"natural",filter:["==","natural","glacier"],paint:{"fill-color":"white"}},{id:"natural_sand",type:"fill",source:"protomaps","source-layer":"natural",filter:["==","natural","sand"],paint:{"fill-color":"#eff5e7"}},{id:"landuse_aerodrome",type:"fill",source:"protomaps","source-layer":"landuse",filter:["==","aeroway","aerodrome"],paint:{"fill-color":"#dbe7e7"}},{id:"transit_runway",type:"line",source:"protomaps","source-layer":"transit",filter:["has","aeroway"],paint:{"line-color":"#d1d9d9","line-width":6}},{id:"landuse_runway",type:"fill",source:"protomaps","source-layer":"landuse",filter:["any",["==","aeroway","runway"],["==","area:aeroway","runway"],["==","area:aeroway","taxiway"]],paint:{"fill-color":"#d1d9d9"}},{id:"water",type:"fill",source:"protomaps","source-layer":"water",paint:{"fill-color":"#a4cae1"}},{id:"roads_tunnels_other_casing",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["<","pmap:level",0],["==","pmap:kind","other"]],paint:{"line-color":"#ffffff","line-gap-width":["interpolate",["exponential",1.6],["zoom"],14,0,14.5,.5,20,12]}},{id:"roads_tunnels_other",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["<","pmap:level",0],["==","pmap:kind","other"]],paint:{"line-color":"#f7f7f7","line-dasharray":[1,1],"line-width":["interpolate",["exponential",1.6],["zoom"],14,0,14.5,.5,20,12]}},{id:"roads_tunnels_minor_casing",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["<","pmap:level",0],["==","pmap:kind","minor_road"]],paint:{"line-color":"#e2e2e2","line-dasharray":[3,2],"line-gap-width":["interpolate",["exponential",1.6],["zoom"],12,0,12.5,.5,20,32],"line-width":["interpolate",["exponential",1.6],["zoom"],12,0,12.5,1]}},{id:"roads_tunnels_minor",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["<","pmap:level",0],["==","pmap:kind","minor_road"]],paint:{"line-color":"#ebebeb","line-width":["interpolate",["exponential",1.6],["zoom"],12,0,12.5,.5,20,32]}},{id:"roads_tunnels_medium_casing",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["<","pmap:level",0],["==","pmap:kind","medium_road"]],paint:{"line-color":"#e1e1e1","line-dasharray":[3,2],"line-gap-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,.5,20,32],"line-width":["interpolate",["exponential",1.6],["zoom"],10,0,10.5,1]}},{id:"roads_tunnels_medium",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["<","pmap:level",0],["==","pmap:kind","medium_road"]],paint:{"line-color":"#ebebeb","line-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,.5,20,32]}},{id:"roads_tunnels_major_casing",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["<","pmap:level",0],["==","pmap:kind","major_road"]],paint:{"line-color":"#e3cfd3","line-dasharray":[3,2],"line-gap-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,.5,
119,32],"line-width":["interpolate",["exponential",1.6],["zoom"],9,0,9.5,1]}},{id:"roads_tunnels_major",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["<","pmap:level",0],["==","pmap:kind","major_road"]],paint:{"line-color":"#ebebeb","line-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,.5,19,32]}},{id:"roads_tunnels_highway_casing",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["<","pmap:level",0],["==","pmap:kind","highway"]],paint:{"line-color":"#ebcea2","line-dasharray":[3,2],"line-gap-width":["interpolate",["exponential",1.6],["zoom"],3,0,3.5,.5,18,32],"line-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,1]}},{id:"roads_tunnels_highway",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["<","pmap:level",0],["==","pmap:kind","highway"]],paint:{"line-color":"#ebebeb","line-width":["interpolate",["exponential",1.6],["zoom"],3,0,3.5,.5,18,32]}},{id:"physical_line_waterway",type:"line",source:"protomaps","source-layer":"physical_line",filter:["==",["get","pmap:kind"],"waterway"],paint:{"line-color":"#a4cae1","line-width":.5}},{id:"buildings",type:"fill-extrusion",source:"protomaps","source-layer":"buildings",paint:{"fill-extrusion-color":"#cbcece","fill-extrusion-height":["to-number",["get","height"]],"fill-extrusion-opacity":.5}},{id:"roads_other",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["==","pmap:level",0],["==","pmap:kind","other"]],paint:{"line-color":"#ffffff","line-dasharray":[2,1],"line-width":["interpolate",["exponential",1.6],["zoom"],14,0,14.5,.5,20,12]}},{id:"roads_minor_casing",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["==","pmap:level",0],["==","pmap:kind","minor_road"]],paint:{"line-color":"#e2e2e2","line-gap-width":["interpolate",["exponential",1.6],["zoom"],12,0,12.5,.5,20,32],"line-width":["interpolate",["exponential",1.6],["zoom"],12,0,12.5,1]}},{id:"roads_minor",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["==","pmap:level",0],["==","pmap:kind","minor_road"]],paint:{"line-color":"white","line-width":["interpolate",["exponential",1.6],["zoom"],12,0,12.5,.5,20,32]}},{id:"roads_medium_casing",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["==","pmap:level",0],["==","pmap:kind","medium_road"]],paint:{"line-color":"#e1e1e1","line-gap-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,.5,20,32],"line-width":["interpolate",["exponential",1.6],["zoom"],10,0,10.5,1]}},{id:"roads_medium",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["==","pmap:level",0],["==","pmap:kind","medium_road"]],paint:{"line-color":"#ffffff","line-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,.5,20,32]}},{id:"roads_major_casing",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["==","pmap:level",0],["==","pmap:kind","major_road"]],paint:{"line-color":"#e3cfd3","line-gap-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,.5,19,32],"line-width":["interpolate",["exponential",1.6],["zoom"],9,0,9.5,1]}},{id:"roads_major",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["==","pmap:level",0],["==","pmap:kind","major_road"]],paint:{"line-color":"#ffffff","line-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,.5,19,32]}},{id:"roads_highway_casing",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["==","pmap:level",0],["==","pmap:kind","highway"]],paint:{"line-color":"#ebcea2","line-gap-width":["interpolate",["exponential",1.6],["zoom"],3,0,3.5,.5,18,32],"line-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,1]}},{id:"roads_highway",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["==","pmap:level",0],["==","pmap:kind","highway"]],paint:{"line-color":"#fefffc","line-width":["interpolate",["exponential",1.6],["zoom"],3,0,3.5,.5,18,32]}},{id:"transit_railway",type:"line",source:"protomaps","source-layer":"transit",filter:["all",["==","pmap:kind","railway"]],paint:{"line-color":"#b3bcc9","line-width":2}},{id:"transit_railway_tracks",type:"line",source:"protomaps","source-layer":"transit",filter:["all",["==","pmap:kind","railway"]],paint:{"line-color":"#ffffff","line-width":.8,"line-dasharray":[6,10]}},{id:"boundaries",type:"line",source:"protomaps","source-layer":"boundaries",paint:{"line-color":"#5c4a6b","line-width":.5,"line-dasharray":[3,2]}},{id:"physical_line_waterway_label",type:"symbol",source:"protomaps","source-layer":"physical_line",minzoom:14,layout:{"symbol-placement":"line","text-font":["Microsoft JhengHei","STHeitiTC-Medium"],"text-field":["get","name"],"text-size":14,"text-letter-spacing":.3},paint:{"text-color":"white","text-halo-color":"#a4cae1","text-halo-width":2}},{id:"roads_bridges_other_casing",type:"line",source:"protomaps","source-layer":"roads",filter:["all",[">","pmap:level",0],["==","pmap:kind","other"]],paint:{"line-color":"#ffffff","line-gap-width":["interpolate",["exponential",1.6],["zoom"],14,0,14.5,.5,20,12]}},{id:"roads_bridges_other",type:"line",source:"protomaps","source-layer":"roads",filter:["all",[">","pmap:level",0],["==","pmap:kind","other"]],paint:{"line-color":"#ffffff","line-dasharray":[2,1],"line-width":["interpolate",["exponential",1.6],["zoom"],14,0,14.5,.5,20,12]}}
1,{id:"roads_bridges_minor_casing",type:"line",source:"protomaps","source-layer":"roads",filter:["all",[">","pmap:level",0],["==","pmap:kind","minor_road"]],paint:{"line-color":"#e2e2e2","line-gap-width":["interpolate",["exponential",1.6],["zoom"],12,0,12.5,.5,20,32],"line-width":["interpolate",["exponential",1.6],["zoom"],12,0,12.5,1]}},{id:"roads_bridges_minor",type:"line",source:"protomaps","source-layer":"roads",filter:["all",[">","pmap:level",0],["==","pmap:kind","minor_road"]],paint:{"line-color":"white","line-width":["interpolate",["exponential",1.6],["zoom"],12,0,12.5,.5,20,32]}},{id:"roads_bridges_medium_casing",type:"line",source:"protomaps","source-layer":"roads",filter:["all",[">","pmap:level",0],["==","pmap:kind","medium_road"]],paint:{"line-color":"#e1e1e1","line-gap-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,.5,20,32],"line-width":["interpolate",["exponential",1.6],["zoom"],10,0,10.5,1]}},{id:"roads_bridges_medium",type:"line",source:"protomaps","source-layer":"roads",filter:["all",[">","pmap:level",0],["==","pmap:kind","medium_road"]],paint:{"line-color":"#ffffff","line-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,.5,20,32]}},{id:"roads_bridges_major_casing",type:"line",source:"protomaps","source-layer":"roads",filter:["all",[">","pmap:level",0],["==","pmap:kind","major_road"]],paint:{"line-color":"#e3cfd3","line-gap-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,.5,19,32],"line-width":["interpolate",["exponential",1.6],["zoom"],9,0,9.5,1]}},{id:"roads_bridges_major",type:"line",source:"protomaps","source-layer":"roads",filter:["all",[">","pmap:level",0],["==","pmap:kind","major_road"]],paint:{"line-color":"#ffffff","line-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,.5,19,32]}},{id:"roads_bridges_highway_casing",type:"line",source:"protomaps","source-layer":"roads",filter:["all",[">","pmap:level",0],["==","pmap:kind","highway"]],paint:{"line-color":"#ebcea2","line-gap-width":["interpolate",["exponential",1.6],["zoom"],3,0,3.5,.5,18,32],"line-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,1]}},{id:"roads_bridges_highway",type:"line",source:"protomaps","source-layer":"roads",filter:["all",[">","pmap:level",0],["==","pmap:kind","highway"]],paint:{"line-color":"#fefffc","line-width":["interpolate",["exponential",1.6],["zoom"],3,0,3.5,.5,18,32]}},{id:"roads_labels",type:"symbol",source:"protomaps","source-layer":"roads",minzoom:13,layout:{"symbol-placement":"line","text-font":["Microsoft JhengHei","STHeitiTC-Medium"],"text-field":["get","name"],"text-size":14},paint:{"text-color":"#91888b","text-halo-color":"white","text-halo-width":2}},{id:"mask",type:"fill",source:"protomaps","source-layer":"mask",paint:{"fill-color":"#dddddd"}},{id:"physical_point_ocean",type:"symbol",source:"protomaps","source-layer":"physical_point",filter:["any",["==","place","sea"],["==","place","ocean"]],layout:{"text-font":["Microsoft JhengHei","STHeitiTC-Medium"],"text-field":["get","name"],"text-size":14,"text-letter-spacing":.15},paint:{"text-color":"white","text-halo-color":"#a4cae1","text-halo-width":1}},{id:"physical_point_peak",type:"symbol",source:"protomaps","source-layer":"physical_point",filter:["any",["==","natural","peak"]],layout:{"text-font":["Microsoft JhengHei","STHeitiTC-Medium"],"text-field":["get","name"],"text-size":14},paint:{"text-color":"#61bb5b","text-halo-color":"#ffffff","text-halo-width":1.5}},{id:"places_subplace",type:"symbol",source:"protomaps","source-layer":"places",filter:["==","pmap:kind","neighbourhood"],minzoom:10,layout:{"text-field":"{name}","text-font":["Microsoft JhengHei","STHeitiTC-Medium"],"text-size":{base:1.2,stops:[[11,13],[14,15]]},"text-transform":"uppercase"},paint:{"text-color":"#757d91","text-halo-color":"white","text-halo-width":1}},{id:"places_city_circle",type:"circle",source:"protomaps","source-layer":"places",filter:["==","pmap:kind","city"],paint:{"circle-radius":2,"circle-stroke-width":2,"circle-stroke-color":"white","circle-color":"#666666"},maxzoom:8},{id:"places_city",type:"symbol",source:"protomaps","source-layer":"places",filter:["==","pmap:kind","city"],layout:{"text-field":"{name}","text-font":["Microsoft JhengHei","STHeitiTC-Medium"],"text-size":["step",["get","pmap:rank"],0,1,18,2,16],"text-variable-anchor":["bottom-left"],"text-radial-offset":.2},paint:{"text-color":"#787878","text-halo-color":"white","text-halo-width":1}},{id:"places_state",type:"symbol",source:"protomaps","source-layer":"places",filter:["==","pmap:kind","state"],layout:{"text-field":"{name}","text-font":["Microsoft JhengHei","STHeitiTC-Medium"],"text-size":12,"text-radial-offset":.2,"text-anchor":"center","text-transform":"uppercase"},paint:{"text-color":"#bdbdbd","text-halo-color":"white","text-halo-width":.5}},{id:"places_country",type:"symbol",source:"protomaps","source-layer":"places",filter:["==","place","country"],layout:{"text-field":"{name}","text-font":["Microsoft JhengHei","STHeitiTC-Medium"],"text-size":{base:1.2,stops:[[2,14],[6,14],[8,20]]},"text-transform":"uppercase"},paint:{"text-color":"#9590aa","text-halo-color":"white","text-halo-width":1}}]},It=new Map;class Mt{static getFactoryCacheKey(t){return`${t.lat},${t.lng}`}static getFactoryCache(t){return It.get(this.getFactoryCacheKey(t))}static setFactoryCache(t,e){It.set(this.getFactoryCacheKey(t),e)}}var Et=Mt;const Tt=t=>`/images/marker-${t}.svg`,Ot=t=>{var e;return null===(e=dt.find((e=>e.type==t)))||void 0===e?void 0:e.color};function Lt(t){var e;return t.wont_fix?dt[4].type:t.document_display_status?null===(e=dt.find((e=>e.documentDisplayStatuses.includes(t.document_display_status))))||void 0===e?void 0:e.type:dt[0].type}var Pt;(function(t){t[t["OSM"]=0]="OSM",t[t["TAIWAN"]=1]="TAIWAN",t[t["SATELITE"]=2]="SATELITE",t[t["PROTOMAP"]=3]="PROTOMAP"})(Pt||(Pt={}));const Ut={[Pt.OSM]:"簡易地圖",[Pt.TAIWAN]:"詳細地圖",[Pt.SATELITE]:"衛星地圖",[Pt.PROTOMAP]:"向量地圖"},Dt=()=>Object.entries({zoomIn:"/images/zoom-in.svg",zoomOut:"/images/zoom-out.svg"}).reduce(((t,[e,a])=>{const o=document.createElement("img");return o.setAttribute("src",a),o.setAttribute("alt","zoomIn"===e?"放大":"縮小"),Object.assign(Object.assign({},t),{[e]:o})}),{}),Rt=ct.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:new z.Ay({image:new B.A({anchorYUnits:j.A.PIXELS,anchorOrigin:wt.A.BOTTOM_LEFT,src:Tt(e)}),zIndex:ct.indexOf(e)})})),{}),zt=new z.Ay({}),Bt=new z.Ay({image:new $.A({fill:new V.A({color:"#A22929"}),radius:12,stroke:new G.A({color:"#FFFFFF",width:1})})}),$t=new Map;class Vt{constructor(t){this.appliedFilters=ct,this.factoryMap=new Map,this._map=t,this._factoriesLayerStatusMap={}}
1get mapInstance(){return this._map}get factories(){return[...this.factoryMap.values()]}getFactoriesLayerForStatus(t){const e=50;if(!this._factoriesLayerStatusMap[`${t}`]){this._factoriesLayerStatusMap[`${t}`]=new q.A({features:[]});const a=new X.A({distance:e,source:this._factoriesLayerStatusMap[`${t}`]}),o={},i=new Q.A({source:a,zIndex:3,style:(i,s)=>{const r=this.mapInstance.map.getView().getZoom(),n=a.getDistance();r>16?0!==n&&a.setDistance(0):n!==e&&a.setDistance(e);const l=i.get("features");if(l.length>1){const e=l.length;let a=o[e];return a||(a=new z.Ay({image:new $.A({radius:20,stroke:new G.A({color:"#fff"}),fill:new V.A({color:Ot(t)})}),text:new N.A({text:e.toString(),fill:new V.A({color:"#fff"}),scale:1.8})}),o[e]=a),a}{const t=l[0];return i.set("factoryId",t.get("factoryId")),t.getStyle()}}});i.setProperties({factoryStatus:t}),this.mapInstance.map.addLayer(i)}return this._factoriesLayerStatusMap[`${t}`]}getFactory(t){return this.factoryMap.get(t)}updateFactory(t,e){this.factoryMap.set(t,e);const a=this.getFactoriesLayerForStatus(Lt(e)).getFeatureById(t);if(a){const o=this.getFactoryStyle(e);$t.set(t,o.clone()),a.setStyle(o)}}addFactories(t){const e=this.createFactoryFeature.bind(this),a=[],o=[];t.forEach((t=>{this.factoryMap.has(t.id)?o.push(t):a.push(t)}));const i=a.map(e).filter(Boolean),s={};i.forEach((t=>{s[t.get("factoryStatus")]||(s[t.get("factoryStatus")]=[]),s[t.get("factoryStatus")].push(t)})),Object.entries(s).forEach((([t,e])=>{this.getFactoriesLayerForStatus(t).addFeatures(e)}))}hideFactories(t){t.forEach((t=>{const e=this.getFactoriesLayerForStatus(Lt(t)).getFeatureById(t.id);e.setStyle(zt)}))}setFactoryStatusFilter(t){this.appliedFilters=t,this.updateFactoriesFeatureStyle()}isFactoryVisible(t){return this.appliedFilters.includes(Lt(t))}getFactoryStyle(t){const e=this.isFactoryVisible(t);return e?Rt[Lt(t)]:zt}createFactoryFeature(t){const e=Et.getFactoryCache(t);if(e)return null;const a=new U.A({geometry:new K.A((0,Y.pd)([t.lng,t.lat],"EPSG:4326","EPSG:3857"))});a.setId(t.id),a.set("factoryId",t.id),a.set("factoryStatus",Lt(t));const o=this.getFactoryStyle(t);return $t.set(t.id,o.clone()),a.setStyle(o),this.factoryMap.set(t.id,t),Et.setFactoryCache(t,a),a}forEachFeatureFactory(t){Object.entries(this._factoriesLayerStatusMap).forEach((([,e])=>{e.getFeatures().forEach((e=>{const a=e.getId(),o=this.factoryMap.get(a);t(e,o)}))}))}displayAllFactory(){this.forEachFeatureFactory(((t,e)=>{t.setStyle(Rt[Lt(e)])}))}updateFactoriesFeatureStyle(){this.forEachFeatureFactory(((t,e)=>{t.setStyle(this.getFactoryStyle(e))}))}}const Gt=()=>{const t=(0,Y.Jt)("EPSG:3857"),e=t.getExtent(),a=new Array(21),o=(0,Z.RG)(e)/256,i=new Array(21);for(let s=0;s<21;++s)a[s]=o/Math.pow(2,s),i[s]=s;return new H.A({origin:(0,Z.Py)(e),resolutions:a,matrixIds:i})},Nt=(t,e)=>{if(t===Pt.PROTOMAP){const t=(0,Y.DI)([119.90423060095736,21.83090666506977,122.2876172488333,25.33409668479448],"EPSG:4326","EPSG:3857"),e=new bt.A({source:new xt.A({attributions:'<a href="https://protomaps.com" target="_blank">Protomaps</a> © <a href="https://www.openstreetmap.org" target="_blank"> OpenStreetMap</a>',format:new St.A,url:{VUE_APP_BASE_URL:"https://staging.disfactory.tw/api",VUE_APP_PROTOMAP_API_KEY:"e6cfbd46818cf623",NODE_ENV:"production",BASE_URL:"/"}.VUE_APP_PROTOMAP_SOURCE_URL||"https://api.disfactory.tw/tiles/{z}/{x}/{y}.pbf",maxZoom:14}),opacity:1,zIndex:1,renderMode:Ct.A.VECTOR});return e.setExtent(t),(0,Ft.Ay)(e,kt,"protomaps"),e}{const a=(()=>{switch(t){case Pt.OSM:return new tt.A({crossOrigin:"Anonymous",attributions:'<a href="https://osm.tw/" target="_blank">OpenStreetMap 台灣</a>'});case Pt.TAIWAN:return new W.A({matrixSet:"EPSG:3857",format:"image/png",url:"https://wmts.nlsc.gov.tw/wmts",layer:"EMAP",tileGrid:e,crossOrigin:"Anonymous",style:"default",wrapX:!0,attributions:'<a href="https://maps.nlsc.gov.tw/" target="_blank">國土測繪圖資服務雲</a>'});case Pt.SATELITE:return new W.A({matrixSet:"EPSG:3857",format:"image/png",url:"https://wmts.nlsc.gov.tw/wmts/PHOTO_MIX/default/EPSG:3857/{TileMatrix}/{TileRow}/{TileCol}",layer:"EMAP",tileGrid:e,requestEncoding:"REST",crossOrigin:"Anonymous",style:"default",wrapX:!0,attributions:'<a href="https://maps.nlsc.gov.tw/" target="_blank">國土測繪圖資服務雲</a>'});default:return new tt.A({crossOrigin:"Anonymous",attributions:'<a href="https://osm.tw/" target="_blank">OpenStreetMap 台灣</a>'})}})();
1return new J.A({source:a,opacity:.6,zIndex:1})}},jt=t=>new J.A({source:new W.A({matrixSet:"EPSG:3857",format:"image/png",url:"https://wmts.nlsc.gov.tw/wmts/nURBAN2/default/EPSG:3857/{TileMatrix}/{TileRow}/{TileCol}",layer:"LUIMAP",requestEncoding:"REST",tileGrid:t,tileLoadFunction:function(t,e){const a=t.getImage();At(e).then((t=>{a.src=t}))},crossOrigin:"Anonymous",style:"default",wrapX:!0,attributions:'<a href="https://maps.nlsc.gov.tw/" target="_blank">國土測繪圖資服務雲</a>'}),opacity:.5,zIndex:2,className:"lui-layer"});class Kt{constructor(t,e={},a={}){this.tileGrid=Gt(),this.hasInitialLocation=!1,this.mapDom=t,this.baseLayer=Nt(Pt.OSM,this.tileGrid),this._map=this.instantiateOLMap(this.mapDom,this.baseLayer,a),a.minimap||(this.geolocation=this.setupGeolocationTracking(this._map)),this.setupEventListeners(this._map,e)}get map(){return this._map}setupEventListeners(t,e){const a=()=>(0,S.sH)(this,void 0,void 0,(function*(){const a=t.getView(),o=a.getZoom(),i=a.getResolutionForZoom(o),s=Math.ceil(i/2),[r,n]=(0,Y.pd)(a.getCenter(),"EPSG:3857","EPSG:4326");if(e.onMoved){const{width:t,height:a}=this.mapDom.getBoundingClientRect(),i=yield this.canPlaceFactory([t/2,a/2]);e.onMoved([r,n,s,o],i)}}));t.on("change:resolution",a),t.on("moveend",a),t.on("rendercomplete",a),t.on("zoomend",(()=>{const a=t.getView(),o=a.getZoom();e.onZoomed&&e.onZoomed(o)})),t.on("click",(a=>(0,S.sH)(this,void 0,void 0,(function*(){if(e.onClicked){const[o,i]=(0,Y.pd)(a.coordinate,"EPSG:3857","EPSG:4326"),s=t.forEachFeatureAtPixel(a.pixel,(t=>t),{layerFilter:t=>5!==t.getZIndex()});e.onClicked([o,i],s)}})))),t.on("pointermove",(e=>{e.dragging||(t.getTargetElement().style.cursor=t.hasFeatureAtPixel(t.getEventPixel(e.originalEvent))?"pointer":"")}));const o=this.getLUIMAPLayer();o.on("change:visible",(function(){e.onLUILayerVisibilityChange&&e.onLUILayerVisibilityChange(o.getVisible())}))}setCoordinate(t,e,a){const o=this.map.getView();a=a||o.getZoom(),o.setCenter((0,Y.pd)([t,e],"EPSG:4326","EPSG:3857")),o.setZoom(a)}instantiateOLMap(t,e,a={}){const o=Gt();let i,s;if(a.getInitialLocation&&(s=a.getInitialLocation())){const[t,e,a]=s;i=new D.Ay({center:(0,Y.pd)([t,e],"EPSG:4326","EPSG:3857"),zoom:a}),this.hasInitialLocation=!0}else i=new D.Ay({center:(0,Y.pd)([120.48504632216294,24.088258816482295],"EPSG:4326","EPSG:3857"),zoom:14});const r=Dt(),n={target:t,layers:[e,jt(o)],view:i,controls:[new et.A({zoomInLabel:r.zoomIn,zoomOutLabel:r.zoomOut,zoomInTipLabel:"放大",zoomOutTipLabel:"縮小"}),new at.A,new ot.A,new it.A],interactions:(0,rt.NT)({pinchRotate:!1}).extend([new nt.A({threshold:.4})])};return a.minimap&&(n.controls=[],n.interactions=[]),new R.A(n)}setupGeolocationTracking(t){const e=t.getView(),a=new st.A({trackingOptions:{enableHighAccuracy:!0},projection:e.getProjection()});a.setTracking(!0);const o=this.setupGeolocationLayer(a);return t.addLayer(o),a}setupGeolocationLayer(t){const e=new U.A,a=t=>Number.isNaN(t)?new z.Ay({image:new $.A({fill:new V.A({color:"#0099ff"}),stroke:new G.A({color:"#fff",width:3}),radius:15})}):new z.Ay({image:new B.A({anchor:[.5,.5],src:"/images/now.svg",rotation:t,rotateWithView:!0})});e.setStyle(a(NaN)),t.on("change:position",(function(){const a=t.getPosition();e.setGeometry(a?new K.A(a):void 0)})),t.on("change:heading",(function(){var o;e.setStyle(a(null!==(o=t.getHeading())&&void 0!==o?o:NaN))}));const o=new U.A;t.on("change:accuracyGeometry",(function(){o.setGeometry(t.getAccuracyGeometry())}));let i=this.hasInitialLocation;t.on("change",(()=>{if(i)return;const e=t.getPosition();e&&(this.zoomToGeolocation(),i=!0)}));const s=new Q.A({source:new q.A({features:[e,o]}),zIndex:5});return s}zoomToGeolocation(){if(!this.geolocation)throw new Error("No location permission");const t=this.geolocation.getPosition();if(!t)throw new Error("No location permission");const e=this._map.getView();e.setCenter(t),e.setZoom(16)}changeBaseMap(t){this._map.removeLayer(this.baseLayer),this.baseLayer=Nt(t,this.tileGrid),this._map.addLayer(this.baseLayer)}canPlaceFactory(t){return(0,S.sH)(this,void 0,void 0,(function*(){return new Promise((e=>{let a=!1;
1const o=this._map.forEachLayerAtPixel(t,(function(t,o){const[,,,i]=o;a=!0,e(128!==i)}),{layerFilter:t=>"lui-layer"===t.getClassName()});a||e(void 0===o||o)}))}))}getLUIMAPLayer(){let t;if(this._map.getLayers().forEach((e=>{"LUIMAP"===e.getProperties().source.layer_&&(t=e)})),!t)throw new TypeError("LUIMAP Layer not found");return t}setLUILayerVisible(t){const e=this.getLUIMAPLayer();e.setVisible(t)}getLUILayerVisible(){const t=this.getLUIMAPLayer();return t.getVisible()}setMinimapPin(t,e){const a=(0,Y.pd)([t,e],"EPSG:4326","EPSG:3857");if(this.minimapPinFeature)this.minimapPinFeature.setGeometry(new K.A(a));else{const t=new U.A({geometry:new K.A(a)});t.setStyle(Bt),this.minimapPinFeature=t;const e=new q.A({features:[t]}),o=new Q.A({source:e,zIndex:4});this.map.addLayer(o)}this._map.getView().setCenter(a)}}function Wt(t,e={},a){const o=new Kt(t,e,a);return window.changeBaseMap=o.changeBaseMap.bind(o),new Vt(o)}function Ht(t,e){const a=new Kt(t,{},{minimap:!0});return a.map.getView().setCenter(e),new Vt(a)}const Yt=Symbol("MapModeSymbol");function Zt(){const t=(0,o.WQ)(Yt);if(!t)throw new Error("Please use provideMapMode before useMapMode.");return t}var Qt=(0,o.pM)({name:"SwitchMapModeButton",props:{isInSheet:{type:Boolean,default:!1}},setup(){const t=(0,o.KR)(!1),e=(0,o.WQ)(O,(0,o.KR)()),{currentMapMode:a}=Zt(),i=(0,o.EW)({get:()=>a.value,set:o=>{var i;a.value=o,null===(i=e.value)||void 0===i||i.mapInstance.changeBaseMap(o),t.value=!1}}),s=[Pt.SATELITE,Pt.OSM,Pt.TAIWAN,Pt.PROTOMAP].map((t=>({type:t,name:Ut[t]}))),r=(0,o.EW)((()=>{var t,e,a;return null!==(e=null===(t=s.find((t=>t.type===i.value)))||void 0===t?void 0:t.name)&&void 0!==e?e:null===(a=s[0])||void 0===a?void 0:a.name}));return{mapModeBottomSheet:t,mapModes:s,currentMapMode:i,currentMapModeName:r}}}),Jt=Qt,qt=a(845),Xt=(0,qt.A)(Jt,L,P,!1,null,null,null),te=Xt.exports,ee=(0,o.pM)({name:"DisplaySettingBottomSheet",components:{SwitchMapModeButton:te},setup(){const t=(0,o.KR)(!1),e=(0,o.WQ)(O,(0,o.KR)()),a=(0,o.KR)(!1),i=(0,o.EW)({get:()=>{var t;return!!(null===(t=e.value)||void 0===t?void 0:t.mapInstance.getLUILayerVisible())},set:t=>{var o;null===(o=e.value)||void 0===o||o.mapInstance.setLUILayerVisible(t),a.value=t}});return{isOpen:t,isLUIMapVisable:i}}}),ae=ee,oe=(0,qt.A)(ae,E,T,!1,null,"2c80a36f",null),ie=oe.exports,se=(a(4603),a(7566),a(8721),a(2505)),re=a.n(se),ne=a(8308),le=a.n(ne);const ce="api-base-url",de="https://staging.disfactory.tw/api",pe=(0,o.KR)(localStorage.getItem(ce)),ue=(0,o.EW)((()=>pe.value||de)),me=()=>de,fe=t=>{pe.value=t,localStorage.setItem(ce,t)},ye=()=>{pe.value=null,localStorage.removeItem(ce)},ve=()=>pe.value,ge=re().create({headers:{"Content-Type":"application/json"}}),he=()=>{ge.defaults.baseURL=ue.value};he(),(0,o.wB)(ue,he);const _e={VUE_APP_BASE_URL:"https://staging.disfactory.tw/api",VUE_APP_PROTOMAP_API_KEY:"e6cfbd46818cf623",NODE_ENV:"production",BASE_URL:"/"}.VUE_APP_IMAGE_UPLOAD_PROVIDER||"imgur",Ae={VUE_APP_BASE_URL:"https://staging.disfactory.tw/api",VUE_APP_PROTOMAP_API_KEY:"e6cfbd46818cf623",NODE_ENV:"production",BASE_URL:"/"}.VUE_APP_IMAGE_UPLOAD_URL||"";function we(t,e,a){return(0,S.sH)(this,void 0,void 0,(function*(){try{const{data:o}=yield ge.get(`/factories?range=${t}&lng=${e}&lat=${a}`);return o}catch(o){throw console.error(o),new TypeError("Get factory failed")}}))}function be(t){return(0,S.sH)(this,void 0,void 0,(function*(){try{const{data:e}=yield ge.get(`/factories/${t}`);return e}catch(e){throw console.error(e),new TypeError("Get factory failed")}}))}const xe="39048813b021935";function Se(t){return(0,S.sH)(this,void 0,void 0,(function*(){const e=new FormData;e.append("image",t);const{data:a}=yield re()({method:"POST",url:"https://api.imgur.com/3/image",data:e,headers:{"Content-Type":"multipart/form-data",Authorization:`Client-ID ${xe}`}});return{link:a.data.link,deletehash:a.data.deletehash,file:t}}))}function Ce(t){var e;return(0,S.sH)(this,void 0,void 0,(function*(){const a=new FormData;a.append("image",t);const o=Ae||`${ue.value}/upload`,{data:i}=yield re()({method:"POST",url:o,data:a,headers:{"Content-Type":"multipart/form-data"}});if(!i.success)throw new Error((null===(e=i.data)||void 0===e?void 0:e.error)||"Image upload failed");return{link:i.data.link,deletehash:i.data.deletehash,file:t}}))}function Fe(t){return(0,S.sH)(this,void 0,void 0,(function*(){return"backend"===_e?Ce(t):Se(t)}))}const ke=t=>t[0]+t[1]/60+t[2]/3600;function Ie(t){const e=new FileReader;return new Promise((a=>{e.onload=t=>{if(!t.target)return void a({});const e=le().readFromBinaryFile(t.target.result),o={};e.GPSLatitude&&(o.Latitude=ke(e.GPSLatitude)),e.GPSLongitude&&(o.Longitude=ke(e.GPSLongitude)),e.DateTimeOriginal&&(o.DateTimeOriginal=e.DateTimeOriginal),a(o)},e.readAsArrayBuffer(t)}))}function Me({link:t,file:e,deletehash:a}){return(0,S.sH)(this,void 0,void 0,(function*(){const o=yield Ie(e),{data:i}=yield ge.post("/images",Object.assign(Object.assign({url:t},o),{deletehash:a}));return{token:i.token,src:URL.createObjectURL(e)}}))}function Ee(t){return(0,S.sH)(this,void 0,void 0,(function*(){return Promise.all(Array.from(t).map((t=>Fe(t).then((t=>Me(t))))))}
1))}function Te(t,e,{nickname:a,contact:o}){return(0,S.sH)(this,void 0,void 0,(function*(){return Promise.all(Array.from(e).map((e=>Fe(e).then((e=>(()=>(0,S.sH)(this,void 0,void 0,(function*(){const i=yield Ie(e.file),{data:s}=yield ge.post(`/factories/${t}/images`,Object.assign(Object.assign({url:e.link},i),{nickname:a,contact:o,deletehash:e.deletehash}));return s.image_path=e.link,s})))())))))}))}function Oe(t){return(0,S.sH)(this,void 0,void 0,(function*(){try{const{data:e}=yield ge.post("/factories",JSON.stringify(t));return e}catch(e){throw console.error(e),new TypeError("Create factory failed")}}))}function Le(t,e){return(0,S.sH)(this,void 0,void 0,(function*(){try{const{data:a}=yield ge.put(`/factories/${t}`,JSON.stringify(e));return a}catch(a){throw console.error(a),new TypeError("Update factory failed")}}))}function Pe(t){return(0,S.sH)(this,void 0,void 0,(function*(){try{const{data:e}=yield ge.get(`/factories/${t}/report_records`);return e}catch(e){throw console.error(e),new TypeError("Fetch factory error")}}))}var Ue=a(5378),De=a(2317);function Re(){var t;const e=(0,o.nI)(),a=null===(t=null===e||void 0===e?void 0:e.proxy)||void 0===t?void 0:t.$gtag,i=t=>{a&&a.pageview({page_path:t})},s=(t,e={})=>{a&&a.event(t,e)};return{pageview:i,event:s}}const ze=!(!navigator.userAgent.match(/(iPod|iPhone|iPad)/)||!navigator.userAgent.match(/AppleWebKit/));/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function Be(){if(/iP(hone|od|ad)/.test(navigator.platform)){const t=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);if(t)return[parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3]||"0",10)].join(".")}}function $e(){let t;return!!ze&&!!(t=Be())&&!!t.match(/^13\.(1|2|3)/)}const Ve=(0,o.Kh)({updateFactorySuccessModal:!1,updateFactoryImageSuccessModal:!1,createFactorySuccessModal:!1,aboutModalOpen:!1,contactModalOpen:!1,safetyModalOpen:!1,gettingStartedModalOpen:"true"!==localStorage.getItem("use-app"),tutorialModalOpen:!1,supportIOSVersionModalOpen:$e(),apiConfigModalOpen:!1,sidebarOpen:!1,filterModalOpen:!1}),Ge=()=>{const{event:t}=Re(),e=()=>{Ve.updateFactoryImageSuccessModal=!0,window.setTimeout((()=>{Ve.updateFactoryImageSuccessModal=!1}),3e3)},a=()=>{Ve.updateFactorySuccessModal=!0,window.setTimeout((()=>{Ve.updateFactorySuccessModal=!1}),3e3)},o=()=>{Ve.createFactorySuccessModal=!0,window.setTimeout((()=>{Ve.createFactorySuccessModal=!1}),3e3)},i=()=>{Ve.createFactorySuccessModal=!1},s=()=>{Ve.aboutModalOpen=!0},r=()=>{Ve.aboutModalOpen=!1},n=()=>{Ve.contactModalOpen=!0},l=()=>{Ve.contactModalOpen=!1},c=()=>{Ve.safetyModalOpen=!0},d=()=>{Ve.safetyModalOpen=!1},p=()=>{Ve.gettingStartedModalOpen=!0},u=()=>{Ve.gettingStartedModalOpen=!1},m=()=>{Ve.tutorialModalOpen=!0},f=()=>{Ve.tutorialModalOpen=!1},y=()=>{Ve.apiConfigModalOpen=!0};window.openApiConfigModal=y;const v=()=>{Ve.apiConfigModalOpen=!1},g=()=>{Ve.supportIOSVersionModalOpen=!1},h=()=>{const e=!Ve.sidebarOpen;t("toggleSidebar",{target:e}),Ve.sidebarOpen=e},_=()=>{t("closeFilterModal"),Ve.filterModalOpen=!1},A=()=>{t("openFilterModal"),Ve.filterModalOpen=!0},w={openUpdateFactorySuccessModal:a,openUpdateFactoryImagesSuccessModal:e,openCreateFactorySuccessModal:o,closeCreateFactorySuccessModal:i,openAboutModal:s,closeAboutModal:r,openContactModal:n,closeContactModal:l,openSafetyModal:c,closeSafetyModal:d,openGettingStartedModal:p,closeGettingStartedModal:u,openTutorialModal:m,closeTutorialModal:f,openApiConfigModal:y,closeApiConfigModal:v,toggleSidebar:h,openFilterModal:A,closeFilterModal:_,closesupportIOSVersionModal:g};return[Ve,w]};var Ne;(function(t){t["INITIAL"]="INITIAL",t["CREATE_FACTORY_1"]="CREATE_FACTORY_1",t["CREATE_FACTORY_2"]="CREATE_FACTORY_2",t["CREATE_FACTORY_3"]="CREATE_FACTORY_3",t["UPDATE_FACTORY_IMAGES"]="UPDATE_FACTORY_IMAGES",t["UPDATE_FACTORY_MODE"]="UPDATE_FACTORY_MODE"})(Ne||(Ne={}));const je=[Ne.CREATE_FACTORY_1,Ne.CREATE_FACTORY_2,Ne.CREATE_FACTORY_3],Ke=[Ne.UPDATE_FACTORY_IMAGES,Ne.UPDATE_FACTORY_MODE],We=(0,o.Kh)({pageState:Ne.INITIAL,factoryData:null,factoryLocation:[],get isCreateMode(){return je.includes(We.pageState)},get createStepIndex(){return je.indexOf(We.pageState)+1},get isEditImagesMode(){return We.pageState===Ne.UPDATE_FACTORY_IMAGES},get isEditFactoryMode(){return We.pageState===Ne.UPDATE_FACTORY_MODE},updateFactoryField:"others",get isEditComment(){return We.pageState===Ne.UPDATE_FACTORY_MODE&&"others"===We.updateFactoryField},get isEditName(){return We.pageState===Ne.UPDATE_FACTORY_MODE&&"name"===We.updateFactoryField},get isEditType(){return We.pageState===Ne.UPDATE_FACTORY_MODE&&"factory_type"===We.updateFactoryField},get isEditMode(){return Ke.includes(We.pageState)},get isInitialState(){return We.pageState===Ne.INITIAL},get selectFactoryMode(){return We.pageState===Ne.CREATE_FACTORY_1},get formPageOpen(){return je.includes(We.pageState)||We.pageState===Ne.UPDATE_FACTORY_IMAGES},get isInitialPage(){return We.pageState===Ne.INITIAL},mapLngLat:[],canPlaceFactory:!1,factoryDetailsExpanded:!1}),He=()=>{const{event:t,pageview:e}=Re(),a=()=>{throw new Error("Invalid page transition")},o={startCreateFactory(){We.pageState===Ne.INITIAL?We.pageState=Ne.CREATE_FACTORY_1:a(),t("enterSelectFactoryMode")},gotoNextCreate(){const t=je.indexOf(We.pageState);-1!==t&&t!==je.length-1?We.pageState=je[t+1]:a(),0===t&&e("/create")},nextCreateStep(){const t=je.indexOf(We.pageState);je[t+1]&&(We.pageState=je[t+1])},previousCreateStep(){const t=je.indexOf(We.pageState);je[t-1]&&(We.pageState=je[t-1])},cancelCreateFactory(){We.pageState in je?We.pageState=Ne.INITIAL:a(),t("exitSelectFactoryMode")},gotoCreateStep(t){je[t]?We.pageState=je[t]:a()}
1,startUpdateFactoryImages(){We.pageState===Ne.INITIAL?We.pageState=Ne.UPDATE_FACTORY_IMAGES:a(),e("/edit")},cancelUpdateFactoryImages(){We.pageState===Ne.UPDATE_FACTORY_IMAGES?We.pageState=Ne.INITIAL:a(),t("exitUpdateFactoryImagesMode")},startUpdateFactoryComment(t="others"){We.pageState===Ne.INITIAL?(We.pageState=Ne.UPDATE_FACTORY_MODE,We.updateFactoryField=t):a(),e("/editComment")},cancelUpdateFactoryComment(){We.pageState===Ne.UPDATE_FACTORY_MODE?We.pageState=Ne.INITIAL:a(),t("exitUpdateFactoryCommentsMode")},closeFactoryPage(){je.includes(We.pageState)||Ke.includes(We.pageState)?We.pageState=Ne.INITIAL:a(),t("closeFactoryPage")}};function i(t){We.factoryData=t}function s(){We.factoryDetailsExpanded=!0}function r(){var t,e,a;const o=$t.get(null===(t=We.factoryData)||void 0===t?void 0:t.id);o&&(null===(a=null===(e=We.factoryData)||void 0===e?void 0:e.feature)||void 0===a||a.setStyle(o)),We.factoryDetailsExpanded=!1,We.factoryData=null}function n(){We.factoryDetailsExpanded=!We.factoryDetailsExpanded}const l={pageTransition:o,updateFactoryData:i,openEditFactoryForm(t){i(t),o.startUpdateFactoryImages(),e("/edit")},setFactoryLocation(e){We.factoryLocation=e,t("setFactoryLocation")},expandFactoryDetail:s,collapseFactoryDetail:r,toggleFactoryDetail:n};return[We,l]};var Ye;(function(t){t["info"]="info",t["warn"]="warn",t["error"]="error"})(Ye||(Ye={}));const Ze=(0,o.Kh)({alert:null,timeout:void 0}),Qe=()=>{const t={showAlert(t,e=3e3,a=Ye.warn,o="此錯誤訊息將在3秒後消失。"){Ze.alert={title:t,level:a,dismissText:o},Ze.timeout&&window.clearTimeout(Ze.timeout),Ze.timeout=window.setTimeout((()=>{Ze.alert=null,Ze.timeout=void 0}),e)},dismissAlert(){Ze.alert=null,Ze.timeout&&(window.clearTimeout(Ze.timeout),Ze.timeout=void 0)}};return[Ze,t]};function Je(t){const e=/^#(.+)/.exec(t);return e?e[1].split("&").reduce(((t,e)=>{const[a,o]=e.split("=");return Object.assign(Object.assign({},t),{[a]:o})}),{}):{}}function qe(t){return"#"+Object.entries(t).map((([t,e])=>`${t}=${e}`)).join("&")}const Xe=["lat","lng","zoom"],ta=new class{constructor(){this.s={},this.lng=this.defineGetterSetter("lng"),this.lat=this.defineGetterSetter("lat"),this.zoom=this.defineGetterSetter("zoom")}load(t){const{map:e}=Je(t.hash),a=/([\d.]+)\/([\d.]+)\/([\d.]+)$/.exec(e);null!==a&&(this.s.zoom=parseFloat(a[1]),this.s.lng=parseFloat(a[2]),this.s.lat=parseFloat(a[3]))}dumps(){var t;return Xe.some((t=>"undefined"===typeof this.s[t]))?"":`#map=${null===(t=this.s.zoom)||void 0===t?void 0:t.toFixed(2)}/${this.s.lng}/${this.s.lat}`}defineGetterSetter(t){return(...e)=>(e.length>0&&(this.s[t]=e[0]),this.s[t])}};function ea(t,e,a){return(0,S.sH)(this,void 0,void 0,(function*(){const o=Je(e.hash),{factoryId:i}=o,s=(0,S.Tt)(o,["factoryId"]);if(!i)return;const r=yield be(i);r&&(t.addFactories([r]),t.mapInstance.setCoordinate(r.lng,r.lat),e.hash=qe(s),a(i))}))}const aa=()=>(0,o.dY)();var oa=(0,o.pM)({name:"MapView",components:{DisplaySettingBottomSheet:ie},props:{setFactoryLocation:{type:Function,required:!0}},setup(t,e){const{event:a}=Re(),i=(0,o.KR)(null),s=(0,o.KR)(null),r=(0,o.WQ)(O,(0,o.KR)()),n=(0,o.nI)(),[,l]=Ge(),[c,{openEditFactoryForm:d,pageTransition:p,expandFactoryDetail:u}]=He(),[,m]=Qe(),f=t=>{if(!r.value)return;const e=t.get("factoryId"),a=r.value.getFactory(e);a&&(a.feature=t,c.factoryData=a)},y=function(){r.value&&r.value.mapInstance.map.updateSize()},v=()=>{c.factoryData&&d(c.factoryData)};function g(){r.value&&(r.value.mapInstance.setLUILayerVisible(!0),p.startCreateFactory())}(0,o.sV)((()=>{const t=new Ue.A({element:s.value,positioning:De.A.BOTTOM_LEFT}),e=(t,e)=>(0,S.sH)(this,void 0,void 0,(function*(){var t,o,i,s,l,d,p,m,v,g,h,_,A,w,b,x;if((null===(o=null===(t=c.factoryData)||void 0===t?void 0:t.feature)||void 0===o?void 0:o.get("defaultStyle"))&&(null===(s=null===(i=c.factoryData)||void 0===i?void 0:i.feature)||void 0===s||s.setStyle(null===(d=null===(l=c.factoryData)||void 0===l?void 0:l.feature)||void 0===d?void 0:d.get("defaultStyle"))),e)if(a("clickFactoryPin"),e.get("factoryId"))f(e),(null===(p=null===n||void 0===n?void 0:n.proxy)||void 0===p?void 0:p.$vuetify.breakpoint.mdAndUp)&&u();else{const t=e.getGeometry(),a=t.getCoordinates();null===(g=null===(v=null===(m=null===r||void 0===r?void 0:r.value)||void 0===m?void 0:m.mapInstance)||void 0===v?void 0:v.map)||void 0===g||g.getView().setCenter(a);const o=null===(A=null===(_=null===(h=null===r||void 0===r?void 0:r.value)||void 0===h?void 0:h.mapInstance)||void 0===_?void 0:_.map)||void 0===A?void 0:A.getView().getZoom();null===(x=null===(b=null===(w=null===r||void 0===r?void 0:r.value)||void 0===w?void 0:w.mapInstance)||void 0===b?void 0:b.map)||void 0===x||x.getView().setZoom((o||0)+1)}else c.factoryData=null;yield aa(),y()}));let o=null;const l=F()((function(t,e,a){return(0,S.sH)(this,void 0,void 0,(function*(){const i=yield we(t,e,a);Array.isArray(i)&&o.addFactories(i)}))}),500);o=Wt(i.value,{onMoved:function([t,e,o,i],s){return(0,S.sH)(this,void 0,void 0,(function*(){ta.lat(e),ta.lng(t),ta.zoom(i),window.location.hash=ta.dumps(),c.canPlaceFactory=s,c.mapLngLat=[t,e],a("moveMap");try{yield l(o,t,e)}catch(r){}}))},onClicked:e,onZoomed:function(t){ta.zoom(t),window.location.hash=ta.dumps()}},{getInitialLocation:function(){if(ta.load(window.location),""!==ta.dumps())return[ta.lng(),ta.lat(),ta.zoom()]}}),ea(o,window.location,(t=>{var a;const i=null===(a=null===r||void 0===r?void 0:r.value)||void 0===a?void 0:a.getFactory(t);if(i){const a=o.getFactoriesLayerForStatus(Lt(i)).getFeatureById(t);e([0,0],a)}})),o.mapInstance.map.addOverlay(t),r.value=o,o.mapInstance.setLUILayerVisible(!1)})),(0,o.sV)((()=>{window.addEventListener("resize",y)})),(0,o.hi)((()=>{window.removeEventListener("resize",y)}));const h=(0,o.KR)(ct),_=t=>h.value.includes(t),A=t=>{r.value&&(_(t)?h.value=h.value.filter((e=>e!==t)):h.value=[...h.value,t],r.value.mapInstance.map.getLayers().forEac
1h((t=>{const e=t.get("factoryStatus");if(void 0===e)return;const a="default"===e?e:Number(e);h.value.includes(a)?t.setVisible(!0):t.setVisible(!1)})))},w=ct.map((t=>({text:ut(t),color:mt(t),value:t,name:t})));return{root:i,modalActions:l,popup:s,zoomToGeolocation:function(){if(r.value){a("zoomToGeolocation");try{r.value.mapInstance.zoomToGeolocation()}catch(t){m.showAlert("您沒開放手機定位權限, \n請開放定位權限以用定位功能。")}}},appState:c,onClickEditFactoryData:v,onClickCreateFactoryButton:g,onClickFilterButton:A,filterButtonsData:w,checkActive:_,appliedFilters:h}}}),ia=oa,sa=(0,qt.A)(ia,b,x,!1,null,"4a1d0225",null),ra=sa.exports,na=function(){var t=this,e=t._self._c;t._self._setupProxy;return t.alert?e("div",{staticClass:"app-alert"},[e("div",{staticClass:"close",attrs:{"data-label":"alert-close"},on:{click:t.dismiss}}),e("img",{attrs:{src:"/images/alert.svg",alt:"alert"}}),e("div",[e("div",{staticClass:"alert-title"},[t._v(t._s(t.alert.title))]),e("p",{staticClass:"alert-descriptioin"},[t._v(t._s(t.alert.dismissText))])])]):t._e()},la=[],ca=(0,o.pM)({name:"AppAlert",props:{alert:{type:Object},dismiss:{type:Function}}}),da=ca,pa=(0,qt.A)(da,na,la,!1,null,"91efb6e0",null),ua=pa.exports,ma=a(6319),fa=a(3059),ya=(a(9868),function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",{staticClass:"create-factory-steps"},[e(s.A,{staticClass:"d-block d-md-none",attrs:{fixed:"",color:"white"}},[e("div",{staticClass:"btn-container",class:{hide:1===t.appState.createStepIndex}},[e(n.A,{staticClass:"secondary--text",attrs:{icon:""},on:{click:t.onBack}},[e(p.A,[t._v("mdi-keyboard-backspace")])],1)],1),e(h.A),e(_.sw,{staticClass:"secondary--text"},[t._v("新增可疑工廠 步驟 ("+t._s(t.appState.createStepIndex)+"/3)")]),e(h.A),e("div",{staticClass:"btn-container"},[e(d.A,{attrs:{"max-width":"290"},scopedSlots:t._u([{key:"activator",fn:function(a){var o=a.on,i=a.attrs;return[e(n.A,t._g(t._b({staticClass:"secondary--text",attrs:{icon:""}},"v-btn",i,!1),o),[e(p.A,[t._v("mdi-close")])],1)]}}]),model:{value:t.discardDialog,callback:function(e){t.discardDialog=e},expression:"discardDialog"}},[e(l.A,[e(c.ri,{staticClass:"secondary--text"},[t._v("放棄新增可疑工廠嗎?")]),e(c.OQ,[t._v("放棄新增可疑工廠時,你將遺失所有已輸入的資料。下次需重新填寫。")]),e(ma.A,{staticClass:"text-center"},[e(n.A,{attrs:{width:"100%","x-large":"",rounded:"",color:"primary"},on:{click:function(e){t.discardDialog=!1}}},[t._v("繼續填寫資料")]),e("a",{staticClass:"d-block mt-4 text-decoration-underline",on:{click:t.cancelCreateFactory}},[t._v("放棄新增")])],1)],1)],1)],1)],1),e(s.A,{directives:[{name:"show",rawName:"v-show",value:t.$vuetify.breakpoint.mdAndUp,expression:"$vuetify.breakpoint.mdAndUp"}],attrs:{fixed:"",color:"white"}},[e(_.sw,[t._v("新增可疑工廠")]),e("div",{staticClass:"ml-15 desktop-step-item",on:{click:function(e){return t.switchStep(1)}}},[e("span",[t._v("選擇工廠位置")]),e(p.A,{staticClass:"mr-1"},[t._v("mdi-chevron-right")])],1),e("div",{staticClass:"desktop-step-item",class:{inactive:t.appState.createStepIndex<2},on:{click:function(e){return t.switchStep(2)}}},[e("span",[t._v("上傳工廠照片")]),e(p.A,{staticClass:"mr-1"},[t._v("mdi-chevron-right")])],1),e("div",{staticClass:"desktop-step-item",class:{inactive:t.appState.createStepIndex<3},on:{click:function(e){return t.switchStep(3)}}},[e("span",[t._v("確認及補充工廠資訊")])]),e(h.A),t.$vuetify.breakpoint.mdAndUp?e(d.A,{attrs:{"max-width":"290"},scopedSlots:t._u([{key:"activator",fn:function(a){var o=a.on,i=a.attrs;return[e(n.A,t._g(t._b({attrs:{outlined:""}},"v-btn",i,!1),o),[t._v(" 取消新增 ")])]}}],null,!1,67231085),model:{value:t.discardDialog,callback:function(e){t.discardDialog=e},expression:"discardDialog"}},[e(l.A,[e(c.ri,{staticClass:"secondary--text"},[t._v("放棄新增可疑工廠嗎?")]),e(c.OQ,[t._v("放棄新增可疑工廠時,你將遺失所有已輸入的資料。下次需重新填寫。")]),e(ma.A,{staticClass:"text-center"},[e(n.A,{attrs:{width:"100%","x-large":"",rounded:"",color:"primary"},on:{click:function(e){t.discardDialog=!1}}},[t._v("繼續填寫資料")]),e("a",{staticClass:"d-block mt-4 text-decoration-underline",on:{click:t.cancelCreateFactory}},[t._v("放棄新增")])],1)],1)],1):t._e()],1),1===t.appState.createStepIndex?e("div",{staticClass:"create-factory-step-1"},[t.showLongLat?e("div",{staticClass:"select-location-container container-fluid pa-3 py-md-5 px-md-10",class:{desktop:t.$vuetify.breakpoint.mdAndUp}},[e("div",{staticClass:"d-flex flex-md-row justify-space-between align-end align-md-center"},[e("div",{staticClass:"d-flex flex-column flex-md-row align-start align-md-center justify-space-between justify-md-start flex-grow-1"},[e("p",{staticClass:"mb-4 my-md-3 mr-md-10 wgs"},[t._v("以下經緯度版本為WGS84")]),t.inlineLocationForm?t._e():e("p",{staticClass:"font-weight-medium h5 mb-0 mb-1-md mr-md-10 location-text"},[t._v(" 經度:"+t._s(t.appState.mapLngLat[0].toFixed(7))+" ")]),t.inlineLocationForm?t._e():e("p",{staticClass:"font-weight-medium h5 mb-0 mr-md-8 location-text"},[t._v(" 緯度:"+t._s(t.appState.mapLngLat[1].toFixed(7))+" ")]),t.inlineLocationForm?t._e():e(n.A,{staticClass:"mr-2 d-none d-md-block primary--text",attrs:{rounded:"",color:"white"},on:{click:t.toggleInlineLocationForm}}
1,[t._v(" 搜尋經緯度 ")]),t.inlineLocationForm?e("div",{staticClass:"d-none d-md-flex justify-space-between align-center flex-grow-1"},[e("div",{staticClass:"d-flex align-center"},[e("p",{staticClass:"font-weight-medium h5 mb-0 mr-7"},[t._v(" 搜尋經緯度 ")]),e("div",{staticClass:"d-block mr-7",staticStyle:{height:"36px",width:"1px","background-color":"#EAF3BF"}}),e("h5",{staticClass:"mr-2"},[t._v("經度")]),e(fa.A,{staticClass:"mr-7",attrs:{"hide-details":"",outilned:"",solo:"",placeholder:"例:121.5231872",dense:""},model:{value:t.locationInputState.longitude,callback:function(e){t.$set(t.locationInputState,"longitude",e)},expression:"locationInputState.longitude"}}),e("h5",{staticClass:"mr-2"},[t._v("緯度")]),e(fa.A,{staticClass:"mr-7",attrs:{"hide-details":"",outilned:"",solo:"",placeholder:"例:25.0458344",dense:""},model:{value:t.locationInputState.latitude,callback:function(e){t.$set(t.locationInputState,"latitude",e)},expression:"locationInputState.latitude"}}),e("h5",{staticClass:"text-decoration-underline mr-5",staticStyle:{cursor:"pointer"},on:{click:t.clearLocationInput}},[t._v("清空")]),e(n.A,{staticClass:"primary--text",attrs:{rounded:"",color:"white"},on:{click:t.setLocation}},[t._v("定位")])],1),t.inlineLocationForm?e("div",{staticClass:"d-flex align-center"},[e("div",{staticClass:"d-block d-none d-md-block mx-7",staticStyle:{height:"36px",width:"1px","background-color":"#EAF3BF"}}),e(n.A,{staticClass:"primary--text",attrs:{icon:""},on:{click:t.toggleInlineLocationForm}},[e(p.A,{attrs:{color:"white"}},[t._v("mdi-close")])],1)],1):t._e()]):t._e()],1),e(d.A,{attrs:{"max-width":"290"},scopedSlots:t._u([{key:"activator",fn:function(a){var o=a.on,i=a.attrs;return[e(n.A,t._g(t._b({staticClass:"mr-2 d-md-none primary--text",attrs:{rounded:"",color:"white"}},"v-btn",i,!1),o),[t._v(" 搜尋經緯度 ")])]}}],null,!1,1129603853),model:{value:t.chooseLocationDialog,callback:function(e){t.chooseLocationDialog=e},expression:"chooseLocationDialog"}},[e(l.A,{staticClass:"primary",attrs:{outlined:""}},[e(c.OQ,{staticClass:"pt-4 white--text"},[e("p",[t._v(" 以下經緯度版本為WGS84 ")]),e("h3",{staticClass:"mb-2"},[t._v("經度")]),e(fa.A,{attrs:{outilned:"",solo:"",placeholder:"例:121.5231872"},model:{value:t.locationInputState.longitude,callback:function(e){t.$set(t.locationInputState,"longitude",e)},expression:"locationInputState.longitude"}}),e("h3",{staticClass:"mb-2"},[t._v("緯度")]),e(fa.A,{attrs:{outilned:"",solo:"",placeholder:"例:25.0458344"},model:{value:t.locationInputState.latitude,callback:function(e){t.$set(t.locationInputState,"latitude",e)},expression:"locationInputState.latitude"}}),e("div",{staticClass:"d-flex justify-space-between mt-3 align-end"},[e("a",{staticClass:"text-decoration-underline white--text",staticStyle:{height:"36px","line-height":"36px"},on:{click:t.clearLocationInput}},[t._v("清空")]),e(n.A,{staticClass:"primary--text",attrs:{rounded:"",color:"white"},on:{click:t.setLocation}},[t._v("定位")])],1)],1)],1)],1)],1)]):t._e(),e("div",{staticClass:"px-5 py-4"},[e(n.A,{staticClass:"mr-2 primary--text",attrs:{rounded:"",color:"white"},on:{click:t.toggleShowLongLat}},[t._v(" "+t._s(t.showLongLat?"隱藏經緯度":"顯示經緯度")+" ")]),e("switch-map-mode-button"),e(ma.A,{staticClass:"choose-location-btn-container d-flex justify-center",attrs:{fluid:"",bottom:"50"}},[e(n.A,{staticClass:"px-md-15",attrs:{"x-large":"",rounded:"",color:"secondary"},on:{click:t.chooseLocation}},[t._v(" 選擇此地點 ")])],1)],1)]):t._e(),2===t.appState.createStepIndex?e("image-upload-form",{attrs:{uploading:t.imageUploadState.uploading,error:t.imageUploadState.error,previewImages:t.uploadedImages,onClickRemoveImage:t.onClickRemoveImage,valid:t.imageUploadFormValid,submit:t.pageTransition.gotoNextCreate,formState:t.formState},model:{value:t.selectedImages,callback:function(e){t.selectedImages=e},expression:"selectedImages"}}):t._e(),3===t.appState.createStepIndex?e("confirm-factory",{attrs:{formState:t.formState,previewImages:t.uploadedImages,submit:t.submitFactory}}):t._e()],1)}),va=[];const ga=()=>{const t=(0,o.KR)([]),e=(0,o.Kh)({error:null,uploading:!1}),a=(0,o.KR)(null);(0,o.wB)(a,(()=>{e.error=null,a.value&&(e.uploading=!0,Ee(a.value).then((e=>{t.value=[...t.value,...e]})).catch((t=>{console.error(t),e.error=!0})).finally((()=>{e.uploading=!1})))}));const i=({src:e})=>{t.value=t.value.filter((t=>t.src!==e))},s=(0,o.EW)((()=>t.value.length>0&&!e.uploading));return{selectedImages:a,imageUploadState:e,uploadedImages:t,onClickRemoveImage:i,imageUploadFormValid:s}},ha=()=>{const t=(0,o.KR)([]),e={error:null,uploading:!1},a=(0,o.KR)(null);(0,o.wB)(a,(()=>{if(!a.value)return;const e=Array.from(a.value).map((t=>URL.createObjectURL(t))).map((t=>({src:t,token:t}
1)));t.value=[...t.value,...e]}));const i=({src:e})=>{t.value=t.value.filter((t=>t.src!==e))},s=(0,o.EW)((()=>t.value.length>0));return{selectedImages:a,imageUploadState:e,uploadedImages:t,onClickRemoveImage:i,imageUploadFormValid:s}};var _a=a(7180),Aa=function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",{staticClass:"image-upload-form w-100"},[e(ma.A,{staticClass:"pt-3 pt-md-12 pb-md-8",staticStyle:{"max-width":"630px",position:"relative"}},[e("h2",{staticClass:"mb-4 secondary--text"},[t._v("上傳工廠照片")]),e("p",[t._v("請至少上傳一張工廠照片。")]),e("h3",{staticClass:"mb-3 mt-7 primary--text required"},[t._v("工廠照片")]),e("div",{staticClass:"flex align-items-center mb-3"},[e(n.A,{staticClass:"mr-3",attrs:{disabled:t.uploading,outlined:""}},[e("label",[e("input",{ref:"image",staticStyle:{display:"none"},attrs:{multiple:"",type:"file",accept:"image/*",disabled:t.uploading},on:{change:t.onChange}}),t._v(" 新增照片 ")])]),t.uploading&&!t.disableProgressiveUpload?e("span",[t._v("上傳中...")]):t._e(),!t.valid||t.uploading||t.error||t.disableProgressiveUpload?t._e():e("span",[t._v(" 上傳成功 "),e(p.A,{staticClass:"primary--text"},[t._v("mdi-checkbox-marked-circle")])],1),t.error&&!t.disableProgressiveUpload?e("span",[t._v("上傳錯誤")]):t._e()],1),e("div",{staticClass:"preview-images-container mb-2"},t._l(t.previewImages,(function(a){return e("div",{key:a.token,staticClass:"uploaded-image"},[e("img",{attrs:{src:a.src}}),e("button",{staticClass:"remove-image-btn",on:{click:function(e){return t.removeImage(a)}}})])})),0),e("hr"),e("h2",{staticClass:"mt-7 mb-2 secondary--text"},[t._v("聯絡資訊(非必填)")]),e("p",[t._v(" 如果對於照片有疑問,"),e("br"),t._v(" 我們會透過以下提供的資訊聯絡你。"),e("br"),t._v(" 如不願揭露自己身份,可跳過不填。 ")]),e("h3",{staticClass:"primary--text mt-7 mb-2"},[t._v("聯絡人暱稱")]),e(fa.A,{attrs:{outlined:"",placeholder:"例:林先生、林小姐",value:t.formState.nickname},on:{input:function(e){return t.$emit("update:formState",(0,_a.A)((0,_a.A)({},t.formState),{},{nickname:e}))}}}),e("h3",{staticClass:"primary--text mt-7 mb-2"},[t._v("聯絡方式 (email或電話)")]),e(fa.A,{attrs:{outlined:"",placeholder:"例:[email protected]、0920-123456",value:t.formState.contact},on:{input:function(e){return t.$emit("update:formState",(0,_a.A)((0,_a.A)({},t.formState),{},{contact:e}))}}}),e("div",{staticClass:"bottom-button-container w-100 d-flex justify-center align-items-center px-xs-3 pb-md-9"},[e(n.A,{staticStyle:{width:"100%","max-width":"345px"},attrs:{"x-large":"",rounded:"",disabled:!t.valid,color:"primary"},on:{click:t.onSubmit}},[t._v(" "+t._s(t.submitText||"下一步")+" ")])],1)],1)],1)},wa=[],ba=(0,o.pM)({props:{previewImages:{type:Array,default:()=>[]},uploading:{default:!1},error:{default:null},onClickRemoveImage:{type:Function},submit:{type:Function},valid:{type:Boolean,default:!1},formState:{type:Object},submitText:{type:String},disableProgressiveUpload:{type:Boolean,default:!1}},name:"ImageUploadForm",setup(t,e){return{images:[],onChange:function(t){e.emit("input",t.target.files)},onSubmit(){t.valid&&"function"===typeof t.submit&&t.submit()},removeImage:e=>{t.onClickRemoveImage(e)}}}}),xa=ba,Sa=(0,qt.A)(xa,Aa,wa,!1,null,"0d0d6a7c",null),Ca=Sa.exports,Fa=a(3419),ka=a(1567),Ia=function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",{staticClass:"confirm-factory-page"},[e(ma.A,{staticClass:"pt-3 pt-md-12",staticStyle:{"max-width":"630px",position:"relative"}},[e("h2",{staticClass:"mt-2 mb-2 secondary--text"},[t._v("確認及補充工廠資訊")]),e("p",[t._v("請確認工廠地點及照片,並補充工廠資訊。")]),e("h3",{staticClass:"mt-7 mb-2 required primary--text"},[t._v("工廠地點")]),e("p",[t._v(" 返回"),e("a",{on:{click:t.gotoStepOne}},[t._v("步驟(1/3)")]),t._v("編輯 ")]),e("div",{staticClass:"d-flex flex-column flex-md-row justify-md-between"},[e("div",{staticClass:"w-100 minimap-container",class:{desktop:t.$vuetify.breakpoint.mdAndUp},staticStyle:{position:"relative"}}
1,[e("minimap",{attrs:{initialFactories:t.initialFactories,initialLocation:t.initialLocation,pinLocation:t.appState.factoryLocation}}),e("div",{staticClass:"minimap-overlay",on:{click:t.gotoStepOne}})],1),e("div",{staticClass:"d-flex justify-between mt-3 mt-md-0 ml-md-4 d-md-inline-flex flex-md-column justify-md-start"},[e("p",[t._v(" 經度:"+t._s(t.appState.factoryLocation[0].toFixed(7))+" "),e("br"),t._v(" 緯度:"+t._s(t.appState.factoryLocation[1].toFixed(7))+" ")]),e("p",[e("small",[t._v("以上經緯度版本為WGS84")])])])]),e("h3",{staticClass:"mt-7 mb-2 required primary--text"},[t._v("工廠照片")]),e("p",[t._v(" 返回"),e("a",{on:{click:t.gotoStepTwo}},[t._v("步驟(2/3)")]),t._v("編輯 ")]),e("div",{staticClass:"preview-images-container mb-2"},t._l(t.previewImages,(function(t){return e("div",{key:t.token,staticClass:"uploaded-image"},[e("img",{attrs:{src:t.src}})])})),0),e("h3",{staticClass:"mt-5 mb-2 primary--text"},[t._v("聯絡人暱稱")]),e("p",[t._v(t._s(t.formState.nickname||"未填寫"))]),e("h3",{staticClass:"mt-5 mb-2 primary--text"},[t._v("聯絡方式 (email或電話)")]),e("p",[t._v(t._s(t.formState.contact||"未填寫"))]),e("hr"),e("h2",{staticClass:"mt-5 secondary--text mb-5"},[t._v("其他工廠資訊(非必填)")]),e("p",[t._v("提供明確的工廠資訊能夠幫助我們更快速的填寫公文。")]),e("h3",{staticClass:"mt-5 mb-2 primary--text"},[t._v("工廠描述")]),e(ka.A,{attrs:{outlined:"",solo:"",value:t.formState.others,placeholder:"例:常常散發異味"},on:{input:function(e){return t.$emit("update:formState",(0,_a.A)((0,_a.A)({},t.formState),{},{others:e}))}}}),e("h3",{staticClass:"mt-5 mb-2 primary--text"},[t._v("工廠外部文字")]),e(fa.A,{attrs:{outlined:"",value:t.formState.name,placeholder:"例:小明化工廠",color:"primary"},on:{input:function(e){return t.$emit("update:formState",(0,_a.A)((0,_a.A)({},t.formState),{},{name:e}))}}}),e("h3",{staticClass:"mt-5 mb-2 primary--text"},[t._v("工廠類型")]),e(Fa.A,{attrs:{items:t.factoryTypeItems,value:t.formState.type,solo:"",outlined:"",placeholder:"未選擇"},on:{input:function(e){return t.$emit("update:formState",(0,_a.A)((0,_a.A)({},t.formState),{},{type:e}))}}}),e("div",{staticClass:"bottom-button-container w-100 d-flex justify-center align-items-center px-xs-3 pb-md-9"},[e(n.A,t._g(t._b({staticStyle:{width:"100%","max-width":"345px"},attrs:{"x-large":"",rounded:"",color:"primary"},on:{click:t.submit}},"v-btn",t.attrs,!1),t.on),[t._v(" 確認送出 ")])],1)],1)],1)},Ma=[],Ea=function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",{ref:"minimap"})},Ta=[],Oa=(0,o.pM)({props:{initialLocation:{type:Array,default:()=>[]},pinLocation:{type:Array,default:()=>[]},initialFactories:{type:Array,default:()=>[]}},name:"MinimapView",setup(t){const e=(0,o.KR)(null);return(0,o.sV)((()=>{const a=Ht(e.value,t.initialLocation);a.addFactories(t.initialFactories),a.mapInstance.setMinimapPin(...t.pinLocation)})),{minimap:e}}}),La=Oa,Pa=(0,qt.A)(La,Ea,Ta,!1,null,null,null),Ua=Pa.exports,Da=(0,o.pM)({name:"ConfirmFactory",components:{Minimap:Ua},props:{formState:{type:Object,default:()=>({})},previewImages:{type:Array,default:()=>[]},submit:{type:Function}},emits:["update:formState"],setup(){var t,e;const a=(0,o.WQ)(O,(0,o.KR)()),[i,{pageTransition:s}]=He(),r=null===(t=a.value)||void 0===t?void 0:t.factories,n=null===(e=a.value)||void 0===e?void 0:e.mapInstance.map.getView().getCenter(),l=[...lt];return{appState:i,initialFactories:r,initialLocation:n,gotoStepOne(){a.value&&(s.gotoCreateStep(0),a.value.mapInstance.setLUILayerVisible(!0))},gotoStepTwo(){s.gotoCreateStep(1)},factoryTypeItems:l}}}),Ra=Da,za=(0,qt.A)(Ra,Ia,Ma,!1,null,"993177d2",null),Ba=za.exports;function $a(t){const e=e=>{"backPressed"===e.state&&t()};window.history.pushState("backPressed","",null),window.history.pushState("dummy","",null),window.addEventListener("popstate",e,{once:!0}),(0,o.hi)((()=>{window.removeEventListener("popstate",e)}))}var Va=(0,o.pM)({name:"CreateFactorySteps",components:{ImageUploadForm:Ca,ConfirmFactory:Ba,SwitchMapModeButton:te},setup(){const[t,{pageTransition:e,setFactoryLocation:a}]=He(),[,{openCreateFactorySuccessModal:i}
1]=Ge(),[,s]=Qe(),{event:r}=Re(),n=(0,o.KR)(!1),l=(0,o.WQ)(O,(0,o.KR)());function c(){l.value&&(l.value.mapInstance.setLUILayerVisible(!1),n.value=!1,e.closeFactoryPage())}const d=()=>{1===t.createStepIndex?c():2===t.createStepIndex?l.value&&(l.value.mapInstance.setLUILayerVisible(!0),e.previousCreateStep()):e.previousCreateStep()};$a(d);const p=(0,o.Kh)({nickname:"",contact:"",others:"",name:"",type:void 0,submitting:!1}),{selectedImages:u,imageUploadState:m,uploadedImages:f,onClickRemoveImage:y,imageUploadFormValid:v}=ga(),g=()=>(0,S.sH)(this,void 0,void 0,(function*(){p.submitting=!0;try{const[e,a]=t.factoryLocation,o={name:p.name,others:p.others,type:p.type,lng:e,lat:a,images:f.value.map((t=>t.token)),nickname:p.nickname,contact:p.contact};r("createFactory",{lng:e,lat:a});const i=yield Oe(o);l.value&&l.value.addFactories([i])}catch(a){}finally{p.submitting=!1}e.closeFactoryPage(),i()})),h=(0,o.KR)(!1),_=()=>{h.value=!h.value},A=(0,o.KR)(!1),w=(0,o.KR)(!1),b=()=>{w.value=!w.value},x=(0,o.Kh)({longitude:"",latitude:""}),C=()=>{x.longitude="",x.latitude=""},F=()=>{if(!l.value)return;const t=parseFloat(x.longitude),e=parseFloat(x.latitude);if(!x.longitude||!x.latitude||isNaN(t)||isNaN(e))A.value=!1;else{let a=l.value.mapInstance.map.getView().getZoom();(!a||a<=17)&&(a=17),l.value.mapInstance.setCoordinate(t,e,a),A.value=!1}},k=e=>{const a=t.createStepIndex-e;for(let t=0;t<a;t++)d()};return{appState:t,pageTransition:e,formState:p,cancelCreateFactory:c,onBack:d,chooseLocation(){l.value&&(t.canPlaceFactory?(l.value.mapInstance.setLUILayerVisible(!1),a(t.mapLngLat),e.nextCreateStep()):s.showAlert("此地點不在農地範圍內,\n請回報在農地範圍內的工廠。"))},selectedImages:u,imageUploadState:m,uploadedImages:f,onClickRemoveImage:y,imageUploadFormValid:v,discardDialog:n,submitFactory:g,showLongLat:h,toggleShowLongLat:_,chooseLocationDialog:A,inlineLocationForm:w,locationInputState:x,clearLocationInput:C,toggleInlineLocationForm:b,setLocation:F,switchStep:k}}}),Ga=Va,Na=(0,qt.A)(Ga,ya,va,!1,null,"06e1f5c6",null),ja=Na.exports,Ka=function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",{staticClass:"update-factory-steps"},[e(s.A,{staticClass:"d-block d-md-none",attrs:{fixed:"",color:"white"}},[e(h.A),t.appState.isEditImagesMode?e(_.sw,{staticClass:"secondary--text"},[t._v("補充照片")]):e(_.sw,{staticClass:"secondary--text"},[t._v(" "+t._s(t.updateFormAppTitle)+" ")]),e(h.A),e("div",{staticClass:"btn-container"},[e(d.A,{attrs:{"max-width":"290"},scopedSlots:t._u([{key:"activator",fn:function(a){var o=a.on,i=a.attrs;return[e(n.A,t._g(t._b({attrs:{icon:""}},"v-btn",i,!1),o),[e(p.A,[t._v("mdi-close")])],1)]}}]),model:{value:t.discardDialog,callback:function(e){t.discardDialog=e},expression:"discardDialog"}},[t.appState.isEditImagesMode?e(l.A,[e(c.ri,{staticClass:"headline"},[t._v("補充照片尚未完成")]),e(c.OQ,[t._v("放棄補充照片的話,你將遺失所有未新增的資料。下次需重新上傳照片")]),e(ma.A,{staticClass:"text-center"},[e(n.A,{attrs:{width:"100%","x-large":"",rounded:"",color:"green darken-1"},on:{click:function(e){t.discardDialog=!1}}},[t._v("繼續編輯")]),e("a",{staticClass:"d-block mt-4",on:{click:t.cancelUpdateFactoryImages}},[t._v("確定放棄")])],1)],1):e(l.A,[e(c.ri,{staticClass:"secondary--text"},[t._v(t._s(t.updateFormAppTitle)+"尚未完成!")]),e(c.OQ,[t._v("放棄編輯的話,你將遺失所有未新增的資料。下次需重新填寫。")]),e(ma.A,{staticClass:"text-center"},[e(n.A,{attrs:{width:"100%","x-large":"",rounded:"",color:"primary"},on:{click:function(e){t.discardDialog=!1}}},[t._v("繼續編輯")]),e("a",{staticClass:"d-block mt-4",on:{click:t.cancelUpdateFactory}},[t._v("確定放棄")])],1)],1)],1)],1)],1),t.appState.isEditImagesMode?e(s.A,{staticClass:"d-none d-md-block",attrs:{fixed:"",color:"white"}},[e(_.sw,{staticClass:"secondary--text"},[t._v("補充照片")]),e(h.A),e(d.A,{attrs:{"max-width":"290"},scopedSlots:t._u([{key:"activator",fn:function(a){var o=a.on,i=a.attrs;return[e(n.A,t._g(t._b({attrs:{outlined:""}},"v-btn",i,!1),o),[t._v(" 取消 ")])]}}],null,!1,1770517635),model:{value:t.discardDialog,callback:function(e){t.discardDialog=e},expression:"discardDialog"}},[e(l.A,[e(c.ri,{staticClass:"secondary--text"},[t._v("補充照片尚未完成")]),e(c.OQ,[t._v("放棄補充照片的話,你å°
1‡éºå¤±æ‰€æœ‰æœªæ–°å¢žçš„資料。下次需重新上傳照片")]),e(ma.A,{staticClass:"text-center"},[e(n.A,{attrs:{width:"100%","x-large":"",rounded:"",color:"primary"},on:{click:function(e){t.discardDialog=!1}}},[t._v("繼續編輯")]),e("a",{staticClass:"d-block mt-4",on:{click:t.cancelUpdateFactoryImages}},[t._v("確定放棄")])],1)],1)],1)],1):t._e(),t.appState.isEditImagesMode?e("image-upload-form",{attrs:{uploading:t.imageUploadState.uploading,error:t.imageUploadState.error,previewImages:t.uploadedImages,onClickRemoveImage:t.onClickRemoveImage,valid:t.imagesValid,submit:t.submitImageUpload,formState:t.imageUploadFormState,submitText:t.imageSubmitting?"照片上傳中...":"確認新增照片",disableProgressiveUpload:""},model:{value:t.selectedImages,callback:function(e){t.selectedImages=e},expression:"selectedImages"}}):t.$vuetify.breakpoint.smAndDown?e("div",{staticClass:"update-factory-comment-container w-100 px-4 py-4 d-flex flex-column justify-between"},[e("div",[e("h3",{staticClass:"mt-4 mb-2 primary--text"},[t._v(t._s(t.updateFormTitle))]),t.appState.isEditComment?e(ka.A,{attrs:{outlined:"",solo:"",placeholder:"例:常常散發異味"},model:{value:t.formState.others,callback:function(e){t.$set(t.formState,"others",e)},expression:"formState.others"}}):t._e(),t.appState.isEditName?e(fa.A,{attrs:{outlined:"",placeholder:"例:小明化工廠",color:"primary"},model:{value:t.formState.name,callback:function(e){t.$set(t.formState,"name",e)},expression:"formState.name"}}):t._e(),t.appState.isEditType?e(Fa.A,{attrs:{items:t.factoryTypeItems,solo:"",outlined:"",placeholder:"未選擇"},model:{value:t.formState.factory_type,callback:function(e){t.$set(t.formState,"factory_type",e)},expression:"formState.factory_type"}}):t._e()],1),e(n.A,{staticClass:"w-100 primary",staticStyle:{width:"100%","max-width":"345px",margin:"0 auto"},attrs:{"x-large":"",rounded:"",disabled:!t.isCurrentFieldValid},on:{click:t.submitUpdateFactory}},[t._v(" "+t._s(t.updateFormButton)+" ")])],1):t._e(),t.$vuetify.breakpoint.mdAndUp?e(d.A,{attrs:{persistent:"","max-width":"395"},model:{value:t.appState.isEditFactoryMode,callback:function(e){t.$set(t.appState,"isEditFactoryMode",e)},expression:"appState.isEditFactoryMode"}},[e("div",{staticClass:"update-factory-comment-modal w-100 px-4 py-4 d-flex flex-column justify-between"},[e("div",{staticClass:"d-flex justify-end"},[e(n.A,{attrs:{icon:""},on:{click:t.cancelUpdateFactory}},[e(p.A,[t._v("mdi-close")])],1)],1),e("div",[e("h3",{staticClass:"mb-3"},[t._v(t._s(t.updateFormTitle))]),t.appState.isEditComment?e(ka.A,{attrs:{outlined:"",solo:"",placeholder:"例:常常散發異味"},model:{value:t.formState.others,callback:function(e){t.$set(t.formState,"others",e)},expression:"formState.others"}}):t._e(),t.appState.isEditName?e(fa.A,{attrs:{outlined:"",placeholder:"例:小明化工廠",color:"primary"},model:{value:t.formState.name,callback:function(e){t.$set(t.formState,"name",e)},expression:"formState.name"}}):t._e(),t.appState.isEditType?e(Fa.A,{attrs:{items:t.factoryTypeItems,solo:"",outlined:"",placeholder:"未選擇"},model:{value:t.formState.factory_type,callback:function(e){t.$set(t.formState,"factory_type",e)},expression:"formState.factory_type"}}):t._e()],1),e(n.A,{staticClass:"w-100",staticStyle:{width:"100%","max-width":"345px",margin:"0 auto"},attrs:{"x-large":"",rounded:"",disabled:!t.isCurrentFieldValid,color:"primary"},on:{click:t.submitUpdateFactory}},[t._v(" "+t._s(t.updateFormButton)+" ")])],1)]):t._e()],1)},Wa=[],Ha=(0,o.pM)({name:"UpdateFactorySteps",components:{ImageUploadForm:Ca},setup(){var t,e;const[a,{pageTransition:i}]=He(),[,s]=Ge(),r=(0,o.WQ)(O,(0,o.KR)()),{event:n}=Re(),{selectedImages:l,imageUploadState:c,uploadedImages:d,onClickRemoveImage:p,imageUploadFormValid:u}=ha(),m=(0,o.Kh)({nickname:"",contact:""}),f=(0,o.KR)(!1),y=(0,o.EW)((()=>u.value&&!f.value)),v=()=>(0,S.sH)(this,void 0,void 0,(function*(){var t,e;if((null===(t=a.factoryData)||void 0===t?void 0:t.id)&&l.value){f.value=!0;try{const t=yield Te(null===(e=a.factoryData)||void 0===e?void 0:e.id,l.value,{nickname:m.nickname,contact:m.contact});if(r.value){const e=a.factoryData;e.images=e.images.concat(t),r.value.updateFactory(e.id,e),a.factoryData=e}i.cancelUpdateFactoryImages(),s.openUpdateFactoryImagesSuccessModal()}catch(o){console.error(o)}f.value=!1}})),g=(0,o.KR)(!1),h=()=>{g.value=!1,i.cancelUpdateFactoryImages()},_=()=>{g.value=!1,i.cancelUpdateFactoryComment()},A=(0,o.Kh)({others:"",name:null===(t=a.factoryData)||void 0===t?void 0:t.name,factory_type:null===(e=a.factoryData)||void 0===e?void 0:e.type,submitting:!1}),w=[...lt],b={others:(0,o.EW)((()=>A.others.length>0&&!A.submitting)),name:(0,o.EW)((()=>{var t,e;return(null===(t=null===A||void 0===A?void 0:A.name)||void 0===t?void 0:t.length)&&(null===(e=A.name)||void 0===e?void 0:e.length)>0&&!A.submitting})),factory_type:(0,o.EW)((()=>!!A.factory_type&&!A.submitting))},x=(0,o.EW)((()=>{const t=a.updateFactoryField;return b[t].value})),C=(0,o.EW)((()=>a.isEditComment?"補充工廠描述":a.isEditName?"更改外部文字":"更改工廠類型")),F=(0,o.EW)((()=>a.isEditComment?"工廠描述":a.isEditName?"工廠外部文字":a.isEditType?"工廠類型":void 0)),k=(0,o.EW)((()=>a.isEditComment?"新增工廠描述":a.isEditName?"確認更改工廠外部文字":a.isEditType?"確認更改工廠類型":void 0)),I=()=>(0,S.sH)(this,void 0,void 0,(function*(){var t,e;if((null===(t=a.factoryData)||void 0===t?void 0:t.id)&&x.value){A.submitting=!0;try{const t=a.updateFactoryField;n("updateFactory",{field:t});const o=yield Le(null===(e=a.factoryData)||void 0===e?void 0:e.id,{[t]:A[t]});r.value&&(r.value.updateFactory(o.id,o),a.factoryData=o),i.cancelUpdateFactoryComment(),s.openUpdateFactorySuccessModal()}catch(o){}A.submitting=!1}}));return{appState:a,pageTransition:i,discardDialog:g,imageUploadFormState:m,selectedImages:l,imageUploadState:c,uploadedImages:d,onClickRemoveImage:p,imagesValid:y,submitImageUpload:v,cancelUpdateFactoryImages:h,cancelUpdateFactory:_,updateFormAppTitle:C,updateFormTitle:F,updateFormButton:k,formState:A,isCurrentFieldValid:x,factoryTypeItems:w,submitUpdateFactory:I,imageSubmitting:f}}}),Ya=Ha,Za=(0,qt.A)(Ya,Ka,Wa,!1,null,"72c2d901",null),Qa=Za.exports,Ja=a(5625),qa=a(9636),Xa=function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",[e(l.A,{directives:[{name:"show",rawName:"v-show",value:!t.a
1ppState.formPageOpen,expression:"!appState.formPageOpen"}],staticClass:"factory-container",class:{full:t.full,desktop:t.$vuetify.breakpoint.mdAndUp,empty:!t.appState.factoryData},attrs:{elevation:"3"}},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.appState.factoryData,expression:"appState.factoryData"}],ref:"factoryDetailScrollerRef",staticClass:"factory-detail-scroller"},[t.scrollOff?e(s.A,{staticClass:"d-block d-md-none",attrs:{fixed:"",color:"white"}},[e(h.A),e(_.sw,[e(p.A,{staticStyle:{"margin-bottom":"5px"},attrs:{color:t.statusColor}},[t._v("mdi-map-marker")]),t._v(t._s(t.factoryStatusText)+" ")],1),e(h.A),e("div",{staticClass:"btn-container"},[e(p.A,{staticClass:"float-right",on:{click:t.collapseFactoryDetail}},[t._v("mdi-close")]),e(p.A,{staticClass:"float-right mr-4",on:{click:t.copyToClipboard}},[t._v("mdi-share-variant")])],1),t.showCopiedMessage?e("div",{staticClass:"copied-message flex justify-center align-items-center"},[e(p.A,{staticClass:"mr-1",attrs:{color:"white"}},[t._v("mdi-content-copy")]),t._v(" 已複製連結 ")],1):t._e()],1):t._e(),e(c.OQ,[e("div",{staticClass:"d-flex justify-between align-items-center mb-3"},[e("span",{staticClass:"factory-status-title"},[t._v("工廠狀態")]),t.$vuetify.breakpoint.mdAndUp?e(n.A,{attrs:{rounded:"",outlined:t.showCopiedMessage,color:t.showCopiedMessage?null:"white"},on:{click:t.copyToClipboard}},[e(p.A,{staticClass:"mr-1"},[t._v("mdi-share-variant")]),t._v(" "+t._s(t.showCopiedMessage?"已複製連結":"分享工廠")+" ")],1):e("span",[e(p.A,{staticClass:"mr-4",on:{click:t.copyToClipboard}},[t._v("mdi-share-variant")]),e(p.A,{on:{click:t.collapseFactoryDetail}},[t._v("mdi-close")])],1)],1),e("p",{staticClass:"factory-status secondary--text mb-2",staticStyle:{clear:"both"}},[e(p.A,{staticStyle:{"margin-bottom":"5px"},attrs:{color:t.statusColor}},[t._v("mdi-map-marker")]),t._v(t._s(t.factoryStatusText)+" ")],1),e("p",{staticClass:"caption mb-0",staticStyle:{color:"#A1A1A1"}},[t._v(" 工廠編號 "+t._s(t.factoryId)+" "),e("br"),t._v(" "+t._s(t.lastUpdatedAt)+" ")]),t.showCopiedMessage&&!t.scrollOff?e("div",{staticClass:"copied-message flex justify-center align-items-center"},[e(p.A,{staticClass:"mr-1",attrs:{color:"white"}},[t._v("mdi-content-copy")]),t._v(" 已複製連結 ")],1):t._e()]),e(Ja.Ay,{ref:"slideGroup",attrs:{"show-arrows":t.images.length>0}},[e(qa.A,[e("div",{staticClass:"update-image-button d-flex flex-column justify-center align-items-center",on:{click:t.pageTransition.startUpdateFactoryImages}},[e(p.A,{staticClass:"mb-1",attrs:{color:"white"}},[t._v("mdi-camera-plus")]),t._v(" 補充照片 ")],1)]),t._l(t.images,(function(a,o){return e(qa.A,{key:a.id,staticClass:"mr-4",class:{"ml-4":0===o},nativeOn:{click:function(e){return t.setLightboxIndex(o)}}},[e("ImgurFallbackImage",{attrs:{src:a.url,className:"factory-slide-image"}})],1)}))],2),e("div",{staticClass:"mt-4 mx-3 mb-2"},[e("h3",{staticClass:"mb-1"},[t._v("地段 / 地址")]),e("p",{staticClass:"mb-5"},[t._v(t._s(t.factoryAddressAndLandcode))]),t.full||t.$vuetify.breakpoint.mdAndUp?e("div",{staticClass:"mb-5"},[e("h3",{staticClass:"mb-1"},[t._v("經緯度")]),e("p",{staticClass:"mb-1"},[t._v(t._s(t.longitude)+", "+t._s(t.latitude))]),e("p",{staticClass:"text-caption"},[t._v("以上經緯度版本為 WGS84")])]):t._e(),t.source?[e("h3",{staticClass:"mb-1"},[t._v("資料來源")]),e("p",{staticClass:"mb-5"},[t._v(t._s(t.source))])]:t._e(),t.full||t.$vuetify.breakpoint.mdAndUp?e("hr"):t._e(),t.full||t.$vuetify.breakpoint.mdAndUp?t._e():e(n.A,{staticClass:"m-0 mb-0 px-0 v-btn-plain",attrs:{text:"",depressed:"",elevation:"0",ripple:!1,color:"#697F01"},on:{click:t.expandFactoryDetail}},[t._v(" 顯示更多資訊   "),e(p.A,[t._v("mdi-menu-down")])],1),t.full||t.$vuetify.breakpoint.mdAndUp?e("div",{staticClass:"mt-4"},[e("h2",{staticClass:"mb-5"},[t._v("其他工廠資訊")]),e("h3",{staticClass:"mb-1"},[t._v("工廠外部文字")]),t.factoryName?e("p",{staticClass:"mb-3"},[t._v(t._s(t.factoryName))]):t._e(),e(n.A,{staticClass:"d-block mb-5",attrs:{outlined:""}
1,on:{click:function(e){return t.startUpdateFactoryCommentFor("name")}}},[t._v(" "+t._s(t.factoryName?"更改外部文字":"回報外部文字")+" ")]),e("h3",{staticClass:"mb-1"},[t._v("工廠類型")]),t.factoryType?e("p",{staticClass:"mb-3"},[t._v(t._s(t.factoryType))]):t._e(),e(n.A,{staticClass:"d-block mb-5",attrs:{outlined:""},on:{click:function(e){return t.startUpdateFactoryCommentFor("factory_type")}}},[t._v(" "+t._s(t.factoryType?"更改工廠類型":"回報工廠類型")+" ")]),e("h3",{staticClass:"mb-1"},[t._v("工廠描述")]),e(n.A,{staticClass:"mb-2",attrs:{outlined:""},on:{click:function(e){return t.startUpdateFactoryCommentFor("others")}}},[t._v("補充工廠描述")]),t._l(t.pastDescriptions,(function(a,o){return e("div",{key:o,staticClass:"mt-2",staticStyle:{"font-size":"14px"}},[e("p",{staticClass:"color-gray-light mb-1"},[t._v(t._s(a.date))]),e("p",{staticStyle:{"line-height":"24px"}},[t._v(t._s(a.others))])])})),t.factoryFollowups.length>0?[e("h3",{staticClass:"mb-1"},[t._v("政府回應")]),t._l(t.factoryFollowups,(function(a,o){return e("div",{key:o,staticClass:"mt-2",staticStyle:{"font-size":"14px"}},[e("p",{staticStyle:{"line-height":"24px"}},[t._v(t._s(a.note))])])}))]:t._e()],2):t._e()],2)],1),e("div",{directives:[{name:"show",rawName:"v-show",value:!t.appState.factoryData,expression:"!appState.factoryData"}],staticClass:"factory-detail-scroller px-4 py-5"},[e("h1",{staticClass:"secondary--text mb-5"},[t._v("請選擇一個地標")]),e("p",[t._v("請選擇一間工廠查看工廠詳細資訊。")])]),e("div",{directives:[{name:"show",rawName:"v-show",value:t.$vuetify.breakpoint.mdAndUp,expression:"$vuetify.breakpoint.mdAndUp"}],staticClass:"sidebar-collapse-button d-flex align-items-center justify-center",on:{click:t.toggleFactoryDetail}},[e(p.A,{attrs:{color:"primary"}},[t._v("mdi-menu-left")])],1)]),e("CoolLightBox",{attrs:{items:t.lightboxItems,index:t.lightboxIndex},on:{close:function(){return t.setLightboxIndex(null)}}})],1)},to=[],eo=a(7965),ao=a.n(eo);const oo=lt.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e.value]:e.text})),{}),io=t=>t.type?oo[t.type]:null,so=t=>{const e=(0,o.KR)(0),a=(0,o.KR)(0),i=()=>{if(!t.value)return;const o=t.value;e.value=o.scrollTop,a.value=o.scrollLeft};return(0,o.wB)(t,(t=>{t&&(e.value=t.scrollTop,a.value=t.scrollLeft,t.addEventListener("scroll",i))})),(0,o.hi)((()=>{t.value&&t.value.removeEventListener("scroll",i)})),{scrollTop:e,scrollLeft:a}};var ro=so,no=function(){var t=this,e=t._self._c;t._self._setupProxy;return e("img",{class:t.className,attrs:{src:t.imageUrl,alt:t.alt},on:{error:t.onError}})},lo=[];const co=/i\.imgur\.com\/([a-zA-Z0-9]+)\.([a-zA-Z0-9]+)(\?.*)?$/,po={VUE_APP_BASE_URL:"https://staging.disfactory.tw/api",VUE_APP_PROTOMAP_API_KEY:"e6cfbd46818cf623",NODE_ENV:"production",BASE_URL:"/"}.VUE_APP_IMGUR_FALLBACK_URL;var uo=(0,o.pM)({name:"ImgurFallbackImage",props:{src:{type:String,required:!0},alt:{type:String,default:""},className:{type:String,default:""}},setup(t,e){const a=(0,o.EW)((()=>{const e=co.exec(t.src);return e?{id:e[1],ext:e[2]}:null})),i=(0,o.EW)((()=>a.value?`${po}/${a.value.id}.${a.value.ext}`:t.src)),s=(0,o.KR)(t.src);(0,o.wB)((()=>t.src),(t=>{s.value=t}));const r=()=>{s.value=i.value};return{imageUrl:s,onError:r}}}),mo=uo,fo=(0,qt.A)(mo,no,lo,!1,null,null,null),yo=fo.exports,vo=(0,o.pM)({name:"FactoryDetailPage",components:{ImgurFallbackImage:yo},setup(){const[t,{pageTransition:e,expandFactoryDetail:a,collapseFactoryDetail:i,toggleFactoryDetail:s}]=He(),r=(0,o.EW)((()=>t.factoryData?t.factoryData.images:[])),n=(0,o.EW)((()=>t.factoryData?t.factoryData.images.map((t=>({title:"",description:"",src:t.url}))):[])),l=(0,o.KR)(null),c=t=>{l.value=t},d=(0,o.EW)((()=>t.factoryData?Lt(t.factoryData):void 0)),p=(0,o.EW)((()=>t.factoryData?t.factoryData.follow_ups_for_user:[])),u=(0,o.EW)((()=>{if("undefined"!==typeof d.value){const e=ut(d.value),{document_display_status:a}=t.factoryData||{};return a?`${e}:${a}`:e}return""})),m=(0,o.EW)((()=>"undefined"!==typeof d.value?Ot(d.value):null)),f=(0,o.EW)((()=>t.factoryData?t.factoryData.display_number:"")),y=(0,o.EW)((()=>t.factoryData?io(t.factoryData):null)),v=(0,o.EW)((()=>{var e;return(null===(e=t.factoryData)||void 0===e?void 0:e.name)||""})),g=(0,o.EW)((()=>
1{if(t.factoryData){const{townname:e,sectname:a,sectcode:o,landcode:i}=t.factoryData;return e&&a&&o&&i?`${e} ${a} (${o}) ${i}地號`:"擷取中"}return""})),h=(0,o.EW)((()=>{var e;return t.factoryData?null===(e=t.factoryData.source)||void 0===e?void 0:e.split("").map((function(t){switch(t){case"U":return"本系統";case"G":return"農委會";case"E":return"經濟部";default:return""}})).filter(Boolean).join("、"):""})),_=(0,o.EW)((()=>t.factoryDetailsExpanded)),A=(0,o.EW)((()=>{var e;return null===(e=t.factoryData)||void 0===e?void 0:e.lng.toFixed(7)})),w=(0,o.EW)((()=>{var e;return null===(e=t.factoryData)||void 0===e?void 0:e.lat.toFixed(7)})),b=(0,o.KR)(null),{scrollTop:x}=ro(b),C=(0,o.EW)((()=>x.value>29&&_.value)),F=(0,o.KR)(!1),k=()=>{var e,a;if(!t.factoryData)return;const{host:o,protocol:i}=window.location,s=`${i}//${o}/#map=16/${null===(e=t.factoryData)||void 0===e?void 0:e.lng}/${null===(a=t.factoryData)||void 0===a?void 0:a.lat}&factoryId=${t.factoryData.id}`;ao()(s),F.value=!0,window.setTimeout((()=>{F.value=!1}),1e3)},I=(0,o.KR)(null);let M;(0,o.$u)((()=>{var t;if(JSON.stringify(r.value)===JSON.stringify(M))return;if(!M)return void(M=r.value.slice());if(M=r.value.slice(),!I.value)return;const e=null===(t=I.value)||void 0===t?void 0:t.$refs.content;window.setTimeout((()=>{e.style="translateX(0px)"}),50)}));const E=(t="others")=>{e.startUpdateFactoryComment(t)},T=(0,o.KR)([]);(0,o.wB)((()=>t.factoryData),(function(){t.factoryData&&(()=>{(0,S.sH)(this,void 0,void 0,(function*(){var e;T.value=((yield Pe(null===(e=t.factoryData)||void 0===e?void 0:e.id))||[]).sort(((t,e)=>new Date(e.created_at)>=new Date(t.created_at)?1:-1))}))})()}));const O=(0,o.EW)((()=>T.value.map((t=>{const e=new Date(t.created_at),a=`${e.getFullYear()}/${e.getMonth()+1}/${e.getDate()}`;return{date:a,others:t.others}})).filter((t=>t.others)))),L=(0,o.EW)((()=>{if(!t.factoryData||!t.factoryData.reported_at)return null;let e;e=0===T.value.length?new Date(t.factoryData.reported_at):new Date(T.value[0].created_at);const a=`${e.getFullYear()}/${e.getMonth()+1}/${e.getDate()}`;return`最後更新 ${a}`}));return{full:_,appState:t,pageTransition:e,images:r,expandFactoryDetail:a,collapseFactoryDetail:i,toggleFactoryDetail:s,factoryStatus:d,factoryStatusText:u,statusColor:m,factoryId:f,factoryType:y,factoryName:v,factoryAddressAndLandcode:g,factoryFollowups:p,source:h,pastDescriptions:O,lastUpdatedAt:L,longitude:A,latitude:w,factoryDetailScrollerRef:b,scrollOff:C,showCopiedMessage:F,copyToClipboard:k,slideGroup:I,startUpdateFactoryCommentFor:E,lightboxItems:n,lightboxIndex:l,setLightboxIndex:c}}}),go=vo,ho=(0,qt.A)(go,Xa,to,!1,null,"d5d4ce3a",null),_o=ho.exports,Ao=function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",{staticClass:"about-dialog-container"},[e("app-modal",{attrs:{open:t.open,dismiss:t.dismiss}},[e("div",{staticClass:"page"},[e("h3",[t._v("關於回報系統")]),e("p",[t._v(" 農地違章工廠舉報系統為協助民眾回報揭露農地違章工廠資訊,並非實際完成舉報。 ")]),e("p",[t._v(" 地球公民基金會將整理資料進行部分案件追蹤,完成舉報者可於「已舉報」案件查見。 ")]),e("p",[t._v(" 105.05.20 前的違章工廠我們將持續收集資訊,但本系統優先針對新增建與中高污染違章工廠進行舉報。 ")]),e("p",[t._v(" 本系統感謝 g0v.tw 社群朋友共同開發。 ")]),e("p",[t._v(" 既有疑似違章工廠資料來源為 2019 å¹´ 7 月 30 日取自內政部國土測繪圖資雲"),e("a",{attrs:{href:"https://maps.nlsc.gov.tw/"}},[t._v("網站")]),t._v("。 ")]),e("p",[t._v(" 全站使用者貢獻資料以 "),e("a",{attrs:{href:"https://creativecommons.org/licenses/by/3.0/tw/"}},[t._v("CC BY 姓名標示 3.0")]),t._v(" 釋出,標註「© 農地違章工廠舉報小幫手貢獻者」,原始碼以 MIT 開放授權公開在 "),e("a",{attrs:{href:"https://github.com/Disfactory/Disfactory"}},[t._v("GitHub")]),t._v(" 上 ")])])])],1)},wo=[],bo=function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",{staticClass:"app-modal-component",class:{open:t.open},attrs:{"data-testid":"modal-container"}},[e("div",{staticClass:"app-modal-backdrop",attrs:{"data-label":"modal-backdrop"},on:{click:t.dismiss}}),e("div",{staticClass:"app-modal"},[t.showCloseButton?e("div",{staticClass:"close",attrs:{"data-label":"modal-close","data-testid":"modal-close"},on:{click:t.dismiss}}):t._e(),t._t("default")],2)])},xo=[],So=(0,o.pM)({name:"AppModal",props:{open:{type:Boolean,default:!1},dismiss:{type:Function},showCloseButton:{type:Boolean,default:!0}}}),Co=So,Fo=(0,qt.A)(Co,bo,xo,!1,null,"68da9dd0",null),ko=Fo.exports,Io=(0,o.pM)({name:"AboutModal",components:{AppModal:ko},props:{open:{type:Boolean,default:!1},dismiss:{type:Function}}}),Mo=Io,Eo=(0,qt.A)(Mo,Ao,wo,!1,null,null,null),To=Eo.exports,Oo=function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",{staticClass:"contact-modal-container"},[e("app-modal",{attrs:{open:t.open,dismiss:t.dismiss}},[e("div",{staticClass:"page"},[e("img",{attrs:{width:"137",src:"/images/cet-logo.png",alt:"Citizen of the Earth Taiwan"}}),e("h3",[t._v(" 有任何回報相關問題"),e("br"),t._v(" 歡迎聯絡 ")]),e("p",[t._v(" 地球公民基金會"),e("br"),t._v(" TEL: 02-23920371"),e("br"),t._v(" Email: "),e("a",{attrs:{href:"mailto:[email protected]"}}
1,[t._v("[email protected]")]),e("br")])])])],1)},Lo=[],Po=(0,o.pM)({name:"ContactModal",components:{AppModal:ko},props:{open:{type:Boolean,default:!1},dismiss:{type:Function}}}),Uo=Po,Do=(0,qt.A)(Uo,Oo,Lo,!1,null,null,null),Ro=Do.exports,zo=function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",{staticClass:"getting-started-container"},[e("app-modal",{attrs:{open:t.open,showCloseButton:!1,dismiss:t.dismiss}},[e("div",{staticClass:"page"},[e("h3",{staticClass:"text-center"},[t._v("歡迎來到"),e("b",[t._v("農地違章工廠回報系統!")])]),e("br"),e("br"),e("p",[t._v("需要大家回報以下工廠之照片及資訊:")]),e("p",[e("ul",[e("li",[t._v("2016.05.20後新增的農地違章工廠")]),e("li",[t._v("中高污染工廠")])])]),e("p",[t._v("以上資訊將由"),e("b",[t._v("地球公民基金會")]),t._v("彙整後,向政府舉報並追蹤拆除進度。")]),e("small",{staticClass:"text-center",staticStyle:{"padding-left":"20px","padding-right":"20px"}},[t._v(" 行動前請同意資料貢獻"),e("a",{attrs:{href:"https://license.disfactory.tw/#%E8%BE%B2%E5%9C%B0%E9%81%95%E7%AB%A0%E5%B7%A5%E5%BB%A0%E5%9B%9E%E5%A0%B1%E7%B3%BB%E7%B5%B1%EF%BC%88disfactory%EF%BC%89%E8%B2%A2%E7%8D%BB%E5%8D%94%E8%AD%B0",target:"_blank"}},[t._v("授權條款")]),t._v("與"),e("a",{attrs:{href:"https://license.disfactory.tw/#%E9%9A%B1%E7%A7%81%E6%AC%8A%E6%A2%9D%E6%AC%BE",target:"_blank"}},[t._v("隱私條款")]),t._v("。本網站由"),e("a",{attrs:{href:"https://www.cet-taiwan.org/",target:"_blank"}},[t._v("地球公民基金會")]),t._v("與 "),e("a",{attrs:{href:"https://g0v.tw/",target:"_blank"}},[t._v("g0v.tw")]),t._v(" 社群共同開發。 ")]),e("app-button",{on:{click:t.agree}},[t._v("我同意加入回報")]),e("small",[e("a",{attrs:{href:"https://about.disfactory.tw"}},[t._v("我不同意,請帶我離開這個頁面")])])],1)])],1)},Bo=[],$o=a(2473),Vo=(a(9195),function(){var t=this,e=t._self._c;t._self._setupProxy;return e("button",{class:(0,_a.A)({outline:t.outline,disabled:t.disabled,rect:t.rect,small:t.small,auto:t.auto},(0,$o.A)({},t.color,!0)),on:{click:t.click}},[t._t("default")],2)}),Go=[],No=(0,o.pM)({name:"AppButton",props:{outline:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},rect:{type:Boolean,default:!1},color:{type:String,default:"default"},small:{type:Boolean,default:!1},auto:{type:Boolean,default:!1}},setup(t,e){const a=()=>{t.disabled||e.emit("click")};return{click:a}}}),jo=No,Ko=(0,qt.A)(jo,Vo,Go,!1,null,"dcff7058",null),Wo=Ko.exports,Ho=(0,o.pM)({name:"GettingStartedModal",components:{AppModal:ko,AppButton:Wo},props:{open:{type:Boolean,default:!1},dismiss:{type:Function}},setup(t){return{agree(){localStorage.setItem("use-app","true"),t.dismiss&&t.dismiss()}}}}),Yo=Ho,Zo=(0,qt.A)(Yo,zo,Bo,!1,null,null,null),Qo=Zo.exports,Jo=function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",{staticClass:"tutorial-modal-container"},[e("app-modal",{attrs:{open:t.open,dismiss:t.onDismissClick}},[t.isAdd||t.isUpdate?e("div",{staticClass:"back-button",attrs:{"data-testid":"back-button"},on:{click:t.openHome}},[e("span"),e("span"),e("span")]):t._e(),e("div",{staticClass:"page"},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.isHome,expression:"isHome"}],attrs:{id:"tutorial-home"}},[e("h2",[t._v("使用說明")]),e("p",[t._v(" 如果系統無法讀取你的位置, 請至手機系統設定開啟位置權限。 ")]),e("div",{staticClass:"outline-button",on:{click:t.openAdd}},[t._v("如何新增一筆"),e("br"),t._v("違章工廠的資料?")]),e("div",{staticClass:"outline-button",on:{click:t.openUpdate}},[t._v("如何在一筆資料裡"),e("br"),t._v("補充更多資訊?")])]),e("div",{directives:[{name:"show",rawName:"v-show",value:t.isAdd,expression:"isAdd"}],attrs:{id:"tutorial-add-factory"}},[e("carousel",{ref:"createCarousel",attrs:{"per-page":1,paginationActiveColor:"#6E8501",paginationColor:"#e3e3e3",paginationPadding:5}},t._l(t.addImages,(function(a,o){return e("slide",{key:a},[e("h2",[t._v("新增違章工廠("+t._s(o+1)+"/7)")]),e("img",{attrs:{src:a}})])})),1)],1),e("div",{directives:[{name:"show",rawName:"v-show",value:t.isUpdate,expression:"isUpdate"}],attrs:{id:"tutorial-update-factory"}},[e("carousel",{ref:"updateCarousel",attrs:{"per-page":1,paginationActiveColor:"#6E8501",paginationColor:"#e3e3e3",paginationPadding:5}},t._l(t.updateImages,(function(a,o){return e("slide",{key:a},[e("h2",[t._v("補充工廠資訊("+t._s(o+1)+"/4)")]),e("img",{attrs:{src:a}})])}
1)),1)],1)])])],1)},qo=[],Xo=a(7742),ti=(0,o.pM)({name:"TutorialModal",components:{AppModal:ko,Carousel:Xo.Carousel,Slide:Xo.Slide},props:{open:{type:Boolean,default:!1},dismiss:{type:Function}},setup(t){const e=(0,o.KR)("home"),a=(0,o.EW)((()=>"home"===e.value)),i=(0,o.EW)((()=>"add"===e.value)),s=(0,o.EW)((()=>"update"===e.value)),r=(0,o.KR)(null),n=(0,o.KR)(null),l=()=>{e.value="home"},c=()=>{r.value.goToPage(0),e.value="add"},d=()=>{n.value.goToPage(0),e.value="update"},p=new Array(7).fill(!0).map(((t,e)=>`/images/tutorial/create-${e+1}.jpg`)),u=new Array(4).fill(!0).map(((t,e)=>`/images/tutorial/update-${e+1}.jpg`)),m=()=>{l(),t.dismiss()};return{isHome:a,isAdd:i,isUpdate:s,openHome:l,openAdd:c,openUpdate:d,addImages:p,updateImages:u,onDismissClick:m,createCarousel:r,updateCarousel:n}}}),ei=ti,ai=(0,qt.A)(ei,Jo,qo,!1,null,null,null),oi=ai.exports,ii=a(2738),si=a(4242),ri=function(){var t=this,e=t._self._c;t._self._setupProxy;return e(d.A,t._b({attrs:{"max-width":"350"},model:{value:t.safetyModalState,callback:function(e){t.safetyModalState=e},expression:"safetyModalState"}},"v-dialog",t.$attrs,!1),[e("div",{staticClass:"safety-modal"},[e(ii.A,{attrs:{"progress-color":"#6E8501",light:"","hide-delimiter-background":"",progress:!1}},[e(l.A,[e(si.A,{staticClass:"page pa-3"},[e("h1",{staticClass:"mt-3 pb-1 mb-4"},[t._v("安全須知")]),e("p",[t._v(" 請參考以下建議,前往違章工廠拍照蒐證 ")])]),e(si.A,{staticClass:"page pa-3"},[e("img",{attrs:{src:"/images/safety_notice/1.png",alt:""}}),e("h2",[t._v(" 場勘 ")]),e("p",[t._v(" 假裝路過,檢查有無監視器;尋找適合拍照的隱蔽處 ")])]),e(si.A,{staticClass:"page pa-3"},[e("img",{attrs:{src:"/images/safety_notice/2.png",alt:""}}),e("h2",[t._v("藏身")]),e("p",[t._v(" 盡量避開監視器、他人視線;盡量在隱蔽處拍照(例如:車上、民宅內、樹叢間、遠方) ")])]),e(si.A,{staticClass:"page pa-3"},[e("img",{attrs:{src:"/images/safety_notice/3.png",alt:""}}),e("h2",[t._v("避嫌")]),e("p",[t._v("假如地點不夠隱密,請用手機拍照,降低他人戒心")])]),e(si.A,{staticClass:"page pa-3"},[e("img",{attrs:{src:"/images/safety_notice/4.png",alt:""}}),e("h2",[t._v("速離")]),e("p",[t._v("拍到1張清晰照片即可離去")])]),e(si.A,{staticClass:"page pa-3"},[e("img",{attrs:{src:"/images/safety_notice/5.png",alt:""}}),e("h2",[t._v("應變")]),e("p",[t._v("假如有人上前問話,請表現得「充滿好奇心」,試著跟對方聊天(例如:好奇水電師傅的施工技術),再伺機離開。")])])],1)],1)],1)])},ni=[],li=(0,o.pM)({name:"SafetyModal",props:{value:{required:!0,type:Boolean}},setup(t,e){const a=(0,o.EW)({get:()=>t.value,set:t=>e.emit("input",t)});return{safetyModalState:a}}}),ci=li,di=(0,qt.A)(ci,ri,ni,!1,null,null,null),pi=di.exports,ui=function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",{staticClass:"ios-version-modal-container"},[e("app-modal",{attrs:{open:t.open,dismiss:t.dismiss}},[e("div",{staticClass:"page"},[e("h3",[t._v("⚠️你的手機無法新增可疑工廠")]),e("p",[t._v(" 很抱歉,你的 iPhone iOS 操作系統無法成功在本網站上傳照片。"),e("br"),t._v(" 請改用電腦新增可疑工廠照片或是至「系統設定」升級 iOS操作系統版本到至少 13.4 以上。瀏覽地圖功能則不受影響。 ")]),e("app-button",{on:{click:t.dismiss}},[t._v("知道了")])],1)])],1)},mi=[],fi=(0,o.pM)({name:"IosVersionModal",components:{AppModal:ko,AppButton:Wo},props:{open:{type:Boolean,default:!1},dismiss:{type:Function}}}),yi=fi,vi=(0,qt.A)(yi,ui,mi,!1,null,null,null),gi=vi.exports,hi=function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",{staticClass:"api-config-modal-container"},[e("app-modal",{attrs:{open:t.open,dismiss:t.dismiss}},[e("div",{staticClass:"page"},[e("h2",[t._v("API 設定")]),e("div",{staticClass:"form-section"},[e("label",{attrs:{for:"api-url-input"}},[t._v("API 基礎網址")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.apiUrl,expression:"apiUrl"}],staticClass:"url-input",attrs:{id:"api-url-input",type:"text",placeholder:t.defaultUrl,"data-testid":"api-url-input"},domProps:{value:t.apiUrl},on:{input:function(e){e.target.composing||(t.apiUrl=e.target.value)}}}),e("small",{staticClass:"help-text"},[t._v(" 留空將使用預設值:"+t._s(t.defaultUrl)+" ")])]),e("div",{staticClass:"button-section"},[e("app-button",{attrs:{"data-testid":"save-button"},on:{click:t.saveConfiguration}},[t._v(" 儲存設定 ")]),e("app-button",{attrs:{outline:!0,"data-testid":"reset-button"},on:{click:t.resetToDefault}},[t._v(" 重置為預設值 ")])],1),e("div",{staticClass:"current-config"},[e("strong",[t._v("目前使用的 API 網址:")]),e("span",{staticClass:"current-url"}
1,[t._v(t._s(t.currentUrl))])])])])],1)},_i=[],Ai=(0,o.pM)({name:"ApiConfigModal",components:{AppModal:ko,AppButton:Wo},props:{open:{type:Boolean,default:!1},dismiss:{type:Function}},setup(t){const e=(0,o.KR)(ve()||""),a=me(),i=(0,o.EW)((()=>ue.value)),s=()=>{const a=e.value.trim();a?fe(a):ye(),t.dismiss&&t.dismiss()},r=()=>{e.value="",ye(),t.dismiss&&t.dismiss()};return{apiUrl:e,defaultUrl:a,currentUrl:i,saveConfiguration:s,resetToDefault:r}}}),wi=Ai,bi=(0,qt.A)(wi,hi,_i,!1,null,"dfcdf030",null),xi=bi.exports,Si=(0,o.pM)({name:"App",components:{MapView:ra,AppAlert:ua,AboutModal:To,ContactModal:Ro,GettingStartedModal:Qo,SafetyModal:pi,TutorialModal:oi,IosVersionModal:gi,ApiConfigModal:xi,CreateFactorySteps:ja,UpdateFactorySteps:Qa,FactoryDetailPage:_o},setup(){const[t,e]=Ge(),[a,i]=He(),[s,r]=Qe();(0,o.Gt)(O,(0,o.KR)(null));const n=(0,o.KR)(!1);return{appState:a,alertState:s,alertActions:r,appActions:i,modalState:t,modalActions:e,drawer:n}}}),Ci=Si,Fi=(0,qt.A)(Ci,A,w,!1,null,null,null),ki=Fi.exports,Ii=a(8685),Mi=a(3723);(0,Mi.k)("/service-worker.js",{ready(){console.log("App is being served from cache by a service worker.\nFor more details, visit https://goo.gl/AFskqB")},registered(){console.log("Service worker has been registered.")},cached(){console.log("Content has been cached for offline use.")},updatefound(){console.log("New content is downloading.")},updated(){console.log("New content is available; please refresh.")},offline(){console.log("No internet connection found. App is running in offline mode.")},error(t){console.error("Error during service worker registration:",t)}});var Ei=a(7073),Ti=a(269),Oi=a(689);o.Ay.use(Ti.A);var Li=new Ti.A({theme:{themes:{light:{primary:"#697F01",secondary:"#364516",accent:Oi.A.green.base}}}});o.Ay.config.productionTip=!1,o.Ay.use(Ii.A),o.Ay.use(Ei.Ay,{config:{id:"UA-154739393-1"},enabled:!0}),new o.Ay({vuetify:Li,render:t=>t(ki)}).$mount("#app")}},e={};function a(o){var i=e[o];if(void 0!==i)return i.exports;var s=e[o]={exports:{}};return t[o].call(s.exports,s,s.exports,a),s.exports}a.m=t,function(){var t=[];a.O=function(e,o,i,s){if(!o){var r=1/0;for(d=0;d<t.length;d++){o=t[d][0],i=t[d][1],s=t[d][2];for(var n=!0,l=0;l<o.length;l++)(!1&s||r>=s)&&Object.keys(a.O).every((function(t){return a.O[t](o[l])}))?o.splice(l--,1):(n=!1,s<r&&(r=s));if(n){t.splice(d--,1);var c=i();void 0!==c&&(e=c)}}return e}s=s||0;for(var d=t.length;d>0&&t[d-1][2]>s;d--)t[d]=t[d-1];t[d]=[o,i,s]}}(),function(){a.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return a.d(e,{a:e}),e}}(),function(){a.d=function(t,e){for(var o in e)a.o(e,o)&&!a.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})}}(),function(){a.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}()}(),function(){a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}(),function(){a.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}}(),function(){var t={524:0};a.O.j=function(e){return 0===t[e]};var e=function(e,o){var i,s,r=o[0],n=o[1],l=o[2],c=0;if(r.some((function(e){return 0!==t[e]}))){for(i in n)a.o(n,i)&&(a.m[i]=n[i]);if(l)var d=l(a)}for(e&&e(o);c<r.length;c++)s=r[c],a.o(t,s)&&t[s]&&t[s][0](),t[s]=0;return a.O(d)},o=self["webpackChunkfrontend"]=self["webpackChunkfrontend"]||[];o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))}();var o=a.O(void 0,[504],(function(){return a(3614)}));o=a.O(o)})();
2//# sourceMappingURL=app.01a02edd.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.