PageSourceSearch

https://platform.msc.guide/_next/static/chunks/pages/ticket-settings-d10812b0facafbec.js

js msc.guide collected 2026-10-02 16:14:25 UTC 13,832 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8533],{2350:function(){},55705:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/ticket-settings",function(){return n(47391)}])},72495:function(e,t,n){"use strict";var i=n(85893),s=n(36465),r=n.n(s);t.Z=()=>(0,i.jsxs)("footer",{className:"jsx-b6eba00745b92e46 field",children:[(0,i.jsx)("div",{className:"jsx-b6eba00745b92e46 content",children:(0,i.jsx)("p",{className:"jsx-b6eba00745b92e46",children:(0,i.jsx)("strong",{className:"jsx-b6eba00745b92e46",children:"\xa9 2020 Region Computer"})})}),(0,i.jsx)(r(),{id:"b6eba00745b92e46",children:"footer.jsx-b6eba00745b92e46 strong.jsx-b6eba00745b92e46{color:white}footer.jsx-b6eba00745b92e46{margin-top:10px;margin-bottom:10px;text-align:center;background-color:#3273dc;padding-top:30px;padding-right:30px;padding-bottom:30px;padding-left:80px}"})]})},98648:function(e,t,n){"use strict";var i=n(85893),s=n(67294);n(96486),t.Z=()=>{let e=new Date,t=new Date(e.getFullYear(),e.getMonth(),e.getDate()),n=(e-t)/6e4,[r,o]=(0,s.use
1State)([]),[a,l]=(0,s.useState)(!1),[c,u]=(0,s.useState)({id:0,timeStart:"",timeEnd:"",timeStr:""}),d={zh:{title:"取籌時段設定",select:"選擇時段:",add:"新增",timeSlot:"時段:",reserved:"人數",action:"操作",turnOff:"啟用中",turnOn:"關閉中",switch:"( 點擊按鈕切換開關 )"},en:{title:"Ticket Time Slot Settings",select:"Time Slot:",add:"add",timeSlot:"Time Slots:",reserved:"count",action:"action",turnOff:"On",turnOn:"Off",switch:"( Toggle Switch On/Off )"}},[h,f]=(0,s.useState)("zh");(0,s.useEffect)(()=>{let e=[],t=new Date,i=new Date;t.setHours(10,0,0,0),i.setHours(18,0,0,0);for(let s=600;s<1080;s+=20)if(s>n){let n=t.toISOString(),r=i.toISOString().slice(11,16);t.setMinutes(t.getMinutes()+20),i.setMinutes(i.getMinutes()+20);let o=t.toISOString(),a=i.toISOString().slice(11,16);e.push({id:s/20+1,timeStart:n,timeEnd:o,timeStr:"".concat(r,"-").concat(a)})}else t.setMinutes(t.getMinutes()+20),i.setMinutes(i.getMinutes()+20);o(e),u(e[0]),l(!0)},[]);let[m,p]=(0,s.useState)([]),g=async()=>{let e=await fetch("/api/ticketsetting?action=getAll"),t=await e.json(),n=[];if(t&&t.length>0&&t.map(e=>{let t=new Date(e.start_at),i=new Date(e.end_at),s="".concat(t.toString().slice(16,21),"-").concat(i.toString().slice(16,21));n.push({id:e.id,timeStart:t.toISOString(),time:s,count:e.count,enable:e.enable})}),p(n),n.length>0){let e=r.filter(e=>!n.some(t=>t.timeStart===e.timeStart));o(e),u(e[0])}};(0,s.useEffect)(()=>{let e=setInterval(()=>{a&&g()},1e4);return()=>{clearInterval(e)}},[]),(0,s.useEffect)(()=>{a&&g()},[a]);let S=async()=>{if(c.id){let e=await fetch("/api/ticketsetting?action=add&start=".concat(c.timeStart,"&end=").concat(c.timeEnd));e?location.reload():alert("新增失敗,請再次嘗試")}else alert("未選擇時段")},_=async(e,t)=>{let n=await fetch("/api/ticketsetting?action=switch&tsId=".concat(e,"&enable=").concat(t));n?location.reload():alert("切換失敗,請再次嘗試")};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{style:{textAlign:"end",fontSize:12},children:[(0,i.jsx)("span",{style:"zh"===h?{color:"#0066CC",fontWeight:"bold"}:{},onClick:()=>f("zh"),children:"中文"}),(0,i.jsx)("span",{children:"/"}),(0,i.jsx)("span",{style:"en"===h?{color:"#0066CC",fontWeight:"bold"}:{},onClick:()=>f("en"),children:"En"})]}),(0,i.jsx)("div",{className:"container",style:{minHeight:"75vh",fontSize:14},children:(0,i.jsxs)("div",{className:"field box",children:[(0,i.jsx)("div",{style:{fontSize:18,fontWeight:"bold",textAlign:"center",marginBottom:16},children:d[h].title}),(0,i.jsx)("div",{style:{display:"flex",justifyContent:"center",marginTop:10,marginBottom:20},children:(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{children:d[h].select}),(0,i.jsx)("select",{style:{paddingLeft:4,paddingRight:4},onChange:e=>{u(r[e.target.value])},children:r.map((e,t)=>(0,i.jsx)("option",{value:t,children:e.timeStr},e.id))}),(0,i.jsx)("button",{type:"submit",className:"button is-primary  is-small",style:{marginLeft:10},onClick:S,children:d[h].add})]})}),(0,i.jsxs)("table",{className:"table is-hoverable is-fullwidth",children:[(0,i.jsx)("thead",{tyle:{wordBreak:"keep-all"},children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:d[h].timeSlot}),(0,i.jsx)("th",{children:d[h].reserved}),(0,i.jsx)("th",{children:d[h].action})]})}),(0,i.jsx)("tbody",{style:{wordBreak:"break-all"},children:m.map(e=>(0,i.jsxs)("tr",{style:{color:e.enable?"":"#9D9D9D"},children:[(0,i.jsx)("td",{children:e.time}),(0,i.jsx)("td",{children:"".concat(e.count,"/15")}),(0,i.jsx)("td",{children:(0,i.jsx)("button",{type:"submit",className:"button is-".concat(e.enable?"success":"danger","  is-small"),onClick:()=>_(e.id,!e.enable),children:e.enable?d[h].turnOff:d[h].turnOn})})]},e.id))})]}),m.length>0&&(0,i.jsx)("div",{style:{textAlign:"end"},children:d[h].switch})]})})]})}},69578:function(e,t,n){var i=n(34155);n(2350);var s=n(67294),r=s&&"object"==typeof s&&"default"in s?s:{default:s};function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var a=void 0!==i&&i.env&&!0,l=function(e){return"[object String]"===Object.prototype.toString.call(e)},c=function(){function e(e){var t=void 0===e?{}:e,n=t.name,i=void 0===n?"stylesheet":n,s=t.optimizeForSpeed,r=void 0===s?a:s;u(l(i),"`name` must be a string"),this._name=i,this._deletedRulePlaceholder="#"+i+"-deleted-rule____{}",u("boolean"==typeof r,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=r,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var o=document.querySelector('meta[property="csp-nonce"]');this._nonce=o?o.getAttribute("content"):null}var t,n=e.prototype;return n.setOptimizeForSpeed=function(e){u("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),u(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},n.isOptimizeForSpeed=function(){return this._optimizeForSpeed},n.inject=function(){var e=this;if(u(!this._injected,"sheet already injected"),this._injected=!0,this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.get
1Sheet(),this._optimizeForSpeed||(a||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,n){return"number"==typeof n?e._serverSheet.cssRules[n]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),n},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},n.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},n.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},n.insertRule=function(e,t){if(u(l(e),"`insertRule` accepts only strings"),this._optimizeForSpeed){var n=this.getSheet();"number"!=typeof t&&(t=n.cssRules.length);try{n.insertRule(e,t)}catch(t){return a||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var i=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,i))}return this._rulesCount++},n.replaceRule=function(e,t){if(this._optimizeForSpeed){var n=this.getSheet();if(t.trim()||(t=this._deletedRulePlaceholder),!n.cssRules[e])return e;n.deleteRule(e);try{n.insertRule(t,e)}catch(i){a||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),n.insertRule(this._deletedRulePlaceholder,e)}}else{var i=this._tags[e];u(i,"old rule at index `"+e+"` not found"),i.textContent=t}return e},n.deleteRule=function(e){if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];u(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},n.flush=function(){this._injected=!1,this._rulesCount=0,this._tags.forEac
1h(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]},n.cssRules=function(){var e=this;return this._tags.reduce(function(t,n){return n?t=t.concat(Array.prototype.map.call(e.getSheetForTag(n).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},n.makeStyleTag=function(e,t,n){t&&u(l(t),"makeStyleTag accepts only strings as second parameter");var i=document.createElement("style");this._nonce&&i.setAttribute("nonce",this._nonce),i.type="text/css",i.setAttribute("data-"+e,""),t&&i.appendChild(document.createTextNode(t));var s=document.head||document.getElementsByTagName("head")[0];return n?s.insertBefore(i,n):s.appendChild(i),i},o(e.prototype,[{key:"length",get:function(){return this._rulesCount}}]),t&&o(e,t),e}();function u(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var d=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0},h={};function f(e,t){if(!t)return"jsx-"+e;var n=String(t),i=e+n;return h[i]||(h[i]="jsx-"+d(e+"-"+n)),h[i]}function m(e,t){var n=e+t;return h[n]||(h[n]=t.replace(/__jsx-style-dynamic-selector/g,e)),h[n]}var p=function(){function e(e){var t=void 0===e?{}:e,n=t.styleSheet,i=void 0===n?null:n,s=t.optimizeForSpeed,r=void 0!==s&&s;this._sheet=i||new c({name:"styled-jsx",optimizeForSpeed:r}),this._sheet.inject(),i&&"boolean"==typeof r&&(this._sheet.setOptimizeForSpeed(r),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var n=this.getIdAndRules(e),i=n.styleId,s=n.rules;if(i in this._instancesCounts){this._instancesCounts[i]+=1;return}var r=s.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[i]=r,this._instancesCounts[i]=1},t.remove=function(e){var t=this,n=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(n in this._instancesCounts,"styleId: `"+n+"` not found"),this._instancesCounts[n]-=1,this._instancesCounts[n]<1){var i=this._fromServer&&this._fromServer[n];i?(i.parentNode.removeChild(i),delete this._fromServer[n]):(this._indices[n].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[n]),delete this._instancesCounts[n]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],n=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return n[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,n;return t=this.cssRules(),void 0===(n=e)&&(n={}),t.map(function(e){var t=e[0],i=e[1];return r.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:n.nonce?n.nonce:void 0,dangerouslySetInnerHTML:{__html:i}})})},t.getIdAndRules=function(e){var t=e.children,n=e.dynamic,i=e.id;if(n){var s=f(i,n);return{styleId:s,rules:Array.isArray(t)?t.map(function(e){return m(s,e)}):[m(s,t)]}}return{styleId:f(i),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),g=s.createContext(null);g.displayName="StyleSheetContext";var S=r.default.useInsertionEffect||r.default.useLayoutEffect,_=new p;function v(e){var t=_||s.useContext(g);return t&&S(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)]),null}v.dynamic=function(e){return e.map(function(e){return f(e[0],e[1])}).join(" ")},t.style=v},36465:function(e,t,n){"use strict";e.exports=n(69578).style},47391:function(e,t,n){"use strict";n.r(t);var i=n(85893),s=n(67294),r=n(98648);n(72495),t.default=()=>
1{let[e,t]=(0,s.useState)(""),[n,o]=(0,s.useState)(!1),[a,l]=(0,s.useState)(!0),c=async function(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;if(console.log("pw: ",i),i&&!n){let e=await fetch("/api/ticketsettinglogin?pw=".concat(i)),t=await e.json();!0===t&&(localStorage.setItem("ticketSettingPassword",i),o(!0))}l(!1),t("")};return((0,s.useEffect)(()=>{let e=localStorage.getItem("ticketSettingPassword");c(e)},[]),a)?(0,i.jsx)(i.Fragment,{}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("nav",{className:"bd-navbar navbar has-shadow is-spaced is-link",children:(0,i.jsx)("div",{className:"navbar-brand",children:(0,i.jsx)("a",{className:"navbar-item",href:"/admin",children:(0,i.jsx)("img",{src:"/logo.png"})})})}),(0,i.jsx)("div",{style:{margin:"50px"},children:n?(0,i.jsx)(r.Z,{}):(0,i.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,i.jsx)("div",{style:{fontSize:20,fontWeight:"bold",marginBottom:20},children:"取籌時段設定"}),(0,i.jsx)("div",{style:{fontSize:16,marginBottom:2,marginRight:10},children:"password : "}),(0,i.jsx)("input",{type:"password",value:e,style:{fontSize:"20px",width:200},onChange:e=>{t(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&c()}}),(0,i.jsx)("button",{onClick:()=>{c()},style:{fontSize:"18px",width:200,marginTop:5},children:"submit"})]})})]})}}},function(e){e.O(0,[3662,9774,2888,179],function(){return e(e.s=55705)}),_N_E=e.O()}]);

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.