PageSourceSearch

https://appt.doctorsfile.jp/_next/static/chunks/pages/admin/notice-68393f5f8d8b5d46.js

js doctorsfile.jp collected 2026-09-24 08:50:13 UTC 8,493 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[69],{8674:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/notice",function(){return n(75135)}])},27376:function(e,t,n){"use strict";n.d(t,{v:function(){return a}});var s=n(85893);n(67294);let a=e=>{let{children:t}=e;return(0,s.jsx)("div",{id:"popup-modal",tabIndex:-1,className:" fixed flex inset-0 items-center justify-center overflow-x-hidden overflow-y-auto z-50 max-h-full p-4 bg-admin-modal-bg ",children:(0,s.jsx)("div",{className:" relative flex w-full h-full items-center justify-center",children:t})})}},32146:function(e,t,n){"use strict";var s=n(85893);n(67294);let a=e=>{let{text:t,additionalClassNames:n}=e,a="\n    absolute\n    text-xs\n    font-extralight\n    text-admin-label-text\n  ",l=n?"".concat(a," ").concat(n):a;return(0,s.jsx)("div",{className:l,children:t})};t.Z=a},75135:function(e,t,n){"use strict";n.r(t),n.d(t,{Notice:function(){return y},__N_SSP:function(){return N},default:function(){return w}});var s=n(85893),a=n(67294),l=n(27856),i=n.n(l),r=n(73309),o=n(2553),d=n(53591),c=n(32146),m=n(40944),u=n(9198),p=n.n(u);n(459),(0,u.registerLocale)("ja",m.Z),(0,u.setDefaultLocale)("ja");let x=e=>{let{selectedDate:t,handleDateChange:n,id:a,label:l}=e;return(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"w-20 absolute flex items-center",children:(0,s.jsx)(c.Z,{text:l,additionalClassNames:""})}),(0,s.jsx)(p(),{id:a,selected:t,onChange:n,className:" min-h-[2.75rem] w-48 absolute border border-admin-border rounded-lg text-xs pl-4 ",popperPlacement:"bottom",popperModifiers:[{name:"offset",options:{offset:[0,30]}}],dateFormat:"P",locale:"ja"})]})},h=e=>{let{id:t,value:n,onChange:a,rows:l,additionalClassNames:i,placeholder:r}=e,o="block p-2.5 w-[calc(100%-20rem)] text-xs text-admin-main-text bg-gray-50 rounded-lg border border-gray-300 focus:ring-admin-focus focus:border-admin-focus absolute",d=i?"".concat(o," ").concat(i):o;return(0,s.jsx)("textarea",{id:t,value:n,onChange:a,rows:l,className:d,placeholder:r})},f=Array.from({length:1440}).map((e,t)=>"".concat(Math.floor(t/60).toString().padStart(2,"0"),":").concat((t%60).toString().padStart(2,"0"))),g=e=>{let{selectedTime:t,handleTimeChange:n}=e;return(0,s.jsx)("select",{value:t,onChange:n,className:" mt-[3.5rem] ml-[12.3rem] min-h-[2.75rem] min-w-[4.75rem] border border-admin-border rounded-lg text-xs",children:f.map(e=>(0,s.jsx)("option",{value:e,children:e},e))})};var j=n(61735),b=n(27376);let v=e=>{let{title:t,content:n,onClose:l}=e,[o,d]=(0,a.useState)(""),[c,m]=(0,a.useState)(""),u=t.replace(/\n/g,"<br />"),p=n.replace(/\n/g,"<br />");return(0,a.useEffect)(()=>{d(i().sanitize(u))},[u]),(0,a.useEffect)(()=>{m(i().sanitize(p))},[p]),(0,s.jsx)(b.v,{children:(0,s.jsxs)("div",{className:"relative w-[55rem] h-[36rem] bg-white rounded-lg shadow-md flex flex-col items-center justify-center",children:[(0,s.jsx)("div",{className:"text-left w-[52rem] mt-4 mb-2 font-bold",children:"重要なお知らせ"}),(0,s.jsxs)("div",{className:"p-6 text-lg  text-admin-main-text w-[52rem] h-[27rem] border border-gray-800 overflow-auto",children:[(0,s.jsx)("div",{className:"Link",children:(0,s.jsx)("span",{dangerouslySetInnerHTML:{__html:o}})}),(0,s.jsx)("div",{className:"Link mt-6",children:(0,s.jsx)("span",{dangerouslySetInnerHTML:{__html:c}})})]}),(0,s.jsx)("span",{className:"mt-4",children:(0,s.jsx)(r.o,{type:"submit",onClick:l,color:"cancel",children:"閉じる"})})]})})};var C=n(69597);let M=new Date;var N=!0;let y=e=>{var t;let{userData:n}=e,l=(0,a.useContext)(C.Lu),m=(e,t)=>{let n=e.getFullYear().toString().padStart(4,"0"),s=(e.getMonth()+1).toString().padStart(2,"0"),a=e.getDate().toString().padStart(2,"0"),[l,i]=t.split(":");return"".concat(n).concat(s).concat(a).concat(l).concat(i)},[u,p]=(0,a.useState)({title:"",content:"",startDate:M,endDate:M,startTime:"00:00",endTime:"00:00",isModalOpen:!1,isConfirmModalOpen:!1,isCompleteModalOpen:!1,completeModalMessage:"",modalStatus:"success",isCurrentlyPublished:!1}),f=e=>{p(t=>({...t,...e}))},b=e=>{f({completeModalMessage:e,isCompleteModalOpen:!0,modalStatus:"warning"})}
1,N=m(M,M.toTimeString().slice(0,5));function y(e){if("string"==typeof e)return new Date(parseInt(e.substring(0,4)),parseInt(e.substring(4,6))-1,parseInt(e.substring(6,8)))}function w(e){return"string"!=typeof e?"00:00":"".concat(e.substring(8,10),":").concat(e.substring(10,12))}(0,a.useEffect)(()=>{l.getNotice().then(e=>{if("publishedAt"in e&&"expiredAt"in e&&"subject"in e&&"message"in e){let{publishedAt:t,expiredAt:n,subject:s,message:a}=e,l=y(t),i=w(t),r=y(n),o=w(n);f({startDate:l,startTime:i,endDate:r,endTime:o,title:s||"",content:a||""}),f({isCurrentlyPublished:t<=N&&N<=n})}}).catch(e=>{throw e})},[]);let D=e=>{f({title:e.target.value})},T=e=>{f({content:e.target.value})},O=e=>{e.preventDefault(),u.title.trim()?u.title.length>2e3?b("タイトルの入力可能文字数を超えています。"):u.content.trim()?u.content.length>1e4?b("お知らせ本文の入力可能文字数を超えています。"):u.startDate&&u.startTime.trim()?u.endDate&&u.endTime.trim()?f({isConfirmModalOpen:!0}):b("掲載終了日時を入力してください。"):b("掲載開始日時を入力してください。"):b("お知らせ本文を入力してください。"):b("タイトルを入力してください。")},S=async()=>{let e="",t="";u.startDate&&u.endDate&&(e=m(u.startDate,u.startTime),t=m(u.endDate,u.endTime));let n={publishedAt:e,expiredAt:t,subject:i().sanitize(u.title),message:i().sanitize(u.content)};l.updateNotice(n).then(n=>{f({completeModalMessage:"更新が完了しました",isCompleteModalOpen:!0,isConfirmModalOpen:!1}),f({isConfirmModalOpen:!1,completeModalMessage:"更新が完了しました",isCompleteModalOpen:!0,isCurrentlyPublished:e<=N&&N<=t})}).catch(e=>{e.response.json().then(e=>{let t=e.error_message,n=Object.keys(t).map(e=>"".concat(t[e].join(", "))).join("\n");f({completeModalMessage:"更新に失敗しました。".concat(n)})}),f({isCompleteModalOpen:!0})})},_=()=>{f({isModalOpen:!0})},k=e=>{e.preventDefault(),f({title:"",content:"",startDate:M,startTime:"00:00",endDate:M,endTime:"23:59"})},P=()=>{f({isModalOpen:!1,isConfirmModalOpen:!1,isCompleteModalOpen:!1})};return(0,s.jsx)(j.Z,{title:"お知らせ投稿",userData:n,children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"pb-5",children:[(0,s.jsxs)("div",{className:"flex",children:[(0,s.jsxs)("div",{className:"flex items-center max-w-full",children:[(0,s.jsx)(x,{selectedDate:u.startDate,handleDateChange:e=>f({startDate:e}),label:"掲載開始日時"}),(0,s.jsx)(g,{selectedTime:u.startTime,handleTimeChange:e=>f({startTime:e.target.value})})]}),(0,s.jsxs)("div",{className:"flex items-center ml-4",children:[(0,s.jsx)(x,{selectedDate:u.endDate,handleDateChange:e=>f({endDate:e}),label:"掲載終了日時"}),(0,s.jsx)(g,{selectedTime:u.endTime,handleTimeChange:e=>f({endTime:e.target.value})})]}),u.isCurrentlyPublished&&(0,s.jsx)("span",{className:"ml-10 mt-14 h-10 bg-pink-100 text-red-600 font-bold rounded px-2 py-2",children:"掲載中"})]}),(0,s.jsx)("div",{className:"mt-5 left-sys-menu",children:(0,s.jsx)(c.Z,{text:"タイトル"})}),(0,s.jsx)("div",{className:"mt-9 left-sys-menu",children:(0,s.jsx)(h,{id:"title",value:u.title,onChange:D,rows:2,placeholder:"タイトルを入力して下さい"})}),(0,s.jsx)("div",{className:"mt-28 left-sys-menu",children:(0,s.jsx)(c.Z,{text:"本文"})}),(0,s.jsx)("div",{className:"mt-32 h-80 left-sys-menu",children:(0,s.jsx)(h,{id:"message",value:u.content,onChange:T,rows:4,placeholder:"本文を入力して下さい",additionalClassNames:"h-80"})})]}),(0,s.jsx)("div",{className:"mt-5 grid justify-items-end",children:(0,s.jsxs)("div",{className:"flex gap-6",children:[(0,s.jsx)(r.o,{type:"submit",onClick:O,children:"更新"}),(0,s.jsx)(r.o,{type:"submit",onClick:_,color:"gray",children:"プレビュー"}),(0,s.jsx)(r.o,{type:"button",onClick:k,color:"gray",children:"クリア"})]})}),u.isModalOpen&&(0,s.jsx)(v,{title:u.title,content:u.content,onClose:P}),u.isConfirmModalOpen&&(0,s.jsx)(d.s,{content:"更新しますか",showModal:u.isConfirmModalOpen,onConfirm:S,onClose:P}),u.isCompleteModalOpen&&(0,s.jsx)(o.$,{content:null!==(t=u.completeModalMessage)&&void 0!==t?t:"",showModal:u.isCompleteModalOpen,onClose:P,status:u.modalStatus})]})})};var w=y}},function(e){e.O(0,[5445,6556,1137,1664,2298,7049,3034,5456,8801,651,1735,9774,2888,179],function(){return e(e.s=8674)}),_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.