PageSourceSearch

https://uttarakhandtourism.gov.in/build/assets/Edit-Djvrx2hz.js

js uttarakhandtourism.gov.in collected 2026-10-02 06:30:00 UTC 9,659 bytes, 1 lines download raw bytes

1import{r as f,G as Q,j as i,S as B}from"./app-Ha4X7SlF.js";import{A as J}from"./AuthenticatedLayout-BZKUhDrh.js";import{I as c}from"./InputError-Do4kQPnM.js";import{I as h}from"./InputLabel-D410np7F.js";import{P as K}from"./PrimaryButton-Bjn3n3t2.js";import{T as u}from"./TextInput-YH4SiJD7.js";import{Q as v}from"./index-C9bVzuNG.js";/* empty css                   */import{M as W}from"./MediaModal-DTWNCtfU.js";import X from"./MediaPreview-D7BGVdAv.js";import{D as y}from"./constants-gejEprHZ.js";import{h as Y}from"./helpers-C3Ubf4D0.js";import{F as Z}from"./XCircleIcon-BkDjDRq6.js";import"./transition-DszwGdUG.js";import"./Sidebar-BmBFQuN7.js";import"./SvgSwitcher-DH9r9e5c.js";import"./ToastNotification-BhTNdAie.js";import"./_baseIsEqual-CXvocJ9U.js";import"./index-BCTjt6el.js";import"./index-DFCUUP5-.js";import"./moment-C5S46NFB.js";function je({auth:p,medias:_,career:n}){const w=window.location.origin,T=new Date().toISOString().split("T")[0],[k,g]=f.useState([]),C=[..._,...k].filter((e,s,r)=>r.findIndex(a=>a.id==e.id)===s),S=e=>{g(s=>[...s,...e].filter((a,m,z)=>z.findIndex(G=>G.id==a.id)===m)),o(s=>({...s,media_ids:[...s.media_ids,...e.map(r=>r.id)].filter((r,a,m)=>m.indexOf(r)===a)})),t("media_ids",""),b()},D=e=>{g(s=>s.filter(r=>r.id!=e)),o(s=>({...s,media_ids:s.media_ids.filter(r=>r!=e)}))},[q,x]=f.useState(!1),F=()=>x(!0),b=()=>x(!1),{data:l,setData:o,put:E,processing:I,errors:d,setError:t}=Q({unique_number:n.unique_number||"",title:n.title||"",slug:n.slug||"",short_description:n.short_description||"",description:n.description||"",status:n.status||0,published_at:new Date(n.published_at).toISOString().slice(0,10)||new Date().toISOString().slice(0,10),author_id:p.user.id,media_ids:JSON.parse(n.media_ids)||[],title_hi:n.title_hi||"",short_description_hi:n.short_description_hi||"",description_hi:n.description_hi||""}),O=e=>{e?(e.length<3?t("title","Title must be at least 3 characters long."):t("title",""),o("title",e)):(t("title","The title field is required."),o("title",e))},M=e=>{e?(t("title_hi",""),o("title_hi",e)):(t("title_hi","The title in hindi field is required."),o("title_hi",e))},P=e=>{e.length<=120?(t("short_description",""),o("short_description",e)):t("short_description","Short description cannot exceed 120 characters.")},V=e=>{e?e.length<=120&&(t("short_description_hi",""),o("short_description_hi",e)):(t("short_description_hi","The short description in hindi field is required."),o("short_description_hi",e))},A=(e,s)=>{const r=e.slice(0,y);o("description",r),t("description",s.trim()?"":"The description field is required.")},H=(e,s)=>{if(s.trim()==="")t("description_hi","The description in hindi field is required.");else{const r=e.slice(0,y);o("description_hi",r),t("description_hi","")}};f.useEffect(()=>{document.querySelectorAll("label").forEach(s=>{s.classList.add("req-star")})},[]);const L=()=>{let e=!0;return(!l.title||l.title.length<3)&&(e=!1,t("title","Title must be at least 3 characters long.")),l.short_description||(e=!1,t("short_description","Short description is required.")),(!l.description||l.description.length<3)&&(e=!1,t("description","Description must be at least 3 characters long.")),l.published_at||(e=!1,t("published_at","The published at field is required.")),l.title_hi?l.title_hi.length<3&&(e=!1,t("title_hi","The title in hindi field minimum length should be more than 3 characters.")):(e=!1,t("title_hi","The title in hindi field is required.")),l.description_hi?l.description_hi.length<3&&(e=!1,t("description_hi","The description in hindi field minimum length should be more than 3 characters.")):(e=!1,t("description_hi","The description in hindi field is required.")),l.short_description_hi?l.short_description_hi.length<3&&(e=!1,t("short_description_hi","The short description in hindi field minimum length should be more than 3 characters.")):(e=!1,t("short_description_hi","The short description in hindi field is required.")),e},R=e=>{e.preventDefault(),L()&&E(route("careers.update",n.id),{onFinish:()=>{o({unique_number:"",title:"",slug:"",short_description:"",description:"",status:0,published_at:"",author_id:p.user.id,media_ids:[],title_hi:"",short_description_hi:"",description_hi:""})}})},U=e=>{o("published_at",e),t("published_at",e?"":"The published at field is required.")},j={toolbar:[["bold","italic","underline","strike"],["blockquote","code-block"],["link","image","video","formula"],[{header:1},{header:2}],[{list:"ordered"},{list:"bullet"},{list:"check"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{direction:"rtl"}],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["clean"]]},N=["header","font","size","bold","italic","underline","align","strike","script","blockquote","background","list","bullet","indent","link","image","color","code-block"];return i.jsxs(J,{user:p.user,header:i.jsx("h2",{className:"font-semibold text-xl text-gray-800 leading-tight",children:"Edit Vacancy"}),children:[i.jsx(B,{title:"Edit Vacancy"}),i.jsx("div",{className:"py-4",children:i.jsxs("div",{className:"max-w-8xl mx-auto px-6 lg:px-8 space-y-5",children:[i.jsx("div",{className:"py-2",children:i.jsx("h3",{className:"text-lg font-semibold",children:"Edit Vacancy"})}),i.jsxs("div",{className:"flex",children:[i.jsxs("div",{className:"p-4 sm:p-8 bg-white shadow sm:rounded-lg w-2/3",children:[i.jsxs("div",{className:"flex gap-4",children:[i.jsxs("div",{className:"w-1/2",children:[i.jsx(h,{htmlFor:"title",value:"Title"}),i.jsx(u,{id:"title",name:"title",value:l.title,className:"mt-1 block w-full focus:border-black rounded-sm bg-gray-100",onChange:e=>O(e.target.value),required:!0}),i.jsx(c,{message:d.title,className:"mt-2"})]}),i.jsxs("div",{className:"w-1/2",children:[i.jsx(h,{htmlFor:"title_hi",value:"Title in hindi"}),i.jsx(u,{id:"title_hi",name:"title_hi",value:l.title_hi,className:"mt-1 block w-full focus:border-black rounded-sm bg-gray-100",autoComplete:"title_hi",isFocused:!0,onChange:e=>M(e.target.value),required:!0}),i.jsx(c,{message:d.title_hi,className:"mt-2"})]})]}),i.jsxs("div",{className:"flex gap-4",children:[i.jsxs("div",{className:"mt-4 w-1/2",children:[i.jsx(h,{htmlFor:"short_description",value:"Short Description"}),i.jsx(u,{id:"short_description",name:"short_description",value:l.short_description,className:"mt-1 block w-full focus:border-black rounded-sm bg-gray-100",onChange:e=>P(e.target.value),required:!0}),i.jsx(c,{message:d.short_description,className:"mt-2"})]}),i.jsxs("div",{className:"mt-4 w-1/2",children:[i.jsx(h,{htmlFor:"short_description_hi",value:"Short Description in hindi"}),i.jsx(u,{id:"short_description_hi",name:"short_description_hi",value:l.short_description_hi,className:"mt-1 block w-full focus:border-black rounded-sm bg-gray-100",onChange:e=>V(e.target.value),required:!0}),i.jsx(c,{message:d.short_description_hi,className:"mt-2"})]})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"mt-4",children:[i.jsx(h,{htmlFor:"description",value:"Description"}),i.jsx(v,{value:l.description,onChange:(e,s,r,a)=>{const m=a.getText().trim();A(e,m)},theme:"snow",modules:j,formats:N,placeholder:"Compose your description here...",style:{height:"200px"}})]}),i.jsx("div",{style:{marginTop:"70px"},children:i.jsx(c,{message:d.description,className:"mt-2"})}),i.jsxs("div",{className:"mt-4",children:[i.jsx(h,{htmlFor:"description_hi",value:"Description in Hindi"}),i.jsx(v,{value:l.description_hi,onChange:(e,s,r,a)=>{const m=a.getText().trim();H(e,m)},theme:"snow",modules:j,formats:N,placeholder:"Compose your description here...",style:{height:"200px"}})]}),i.jsx("div",{style:{marginTop:"70px"},children:i.jsx(c,{message:d.description_hi,className:"mt-2"})})]})]}),i.jsxs("div",{className:"ml-5 w-1/3",children:[i.jsxs("div",{className:"w-full p-4 sm:p-8 bg-white shadow sm:rounded-lg",children:[i.jsxs("div",{className:"mb-3",children:[i.jsx(h,{htmlFor:"status",value:"Status :"}),i.jsxs("select",{className:"mt-1 block w-full focus:border-black rounded-sm bg-gray-100 border-gray-300",value:l.status,onChange:e=>o("status",Number(e.target.value)),children:[i.jsx("option",{value:0,children:"Draft"}),i.jsx("option",{value:1,children:"Publish"})]}),i.jsx(c,{message:d.status,className:"mt-2"})]}),i.jsxs("div",{className:"mb-3",children:[i.jsx(h,{htmlFor:"published_at",value:"Published At :"}),i.jsx("input",{type:"date",min:T,onKeyDown:e=>e.preventDefault(),className:"mt-1 block w-full focus:border-black rounded-sm bg-gray-100 border-gray-300",value:l.published_at,onChange:e=>U(e.target.value)}),i.jsx(c,{message:d.published_at,className:"mt-2"})]}),i.jsx("form",{onSubmit:R,className:"my-2",children:i.jsx("div",{className:"flex items-center justify-end mt-4",children:i.jsx(K,{className:"ms-4 bgTheme",disabled:I,children:"Update Vacancy"})})})]}),i.jsxs("div",{className:"mt-5 w-full p-4 sm:p-8 bg-white shadow sm:rounded-lg",children:[i.jsx("h3",{children:"Documents"}),i.jsx("button",{onClick:F,className:"py-2 text-blue-500",children:"Upload Documents"}),i.jsx(W,{isOpen:q,onClose:b,onFileSelect:S,medias:_,multipleDocs:!0,uploadDocumentOnly:!0,isOnlyDocument:!0}),l.media_ids&&l.media_ids.map(e=>C.filter(s=>s.id==e).map((s,r)=>i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"relative ",children:[i.jsx(X,{item:{file_path:s.file_path,file_name:s.file_name,format:s.format||"",title:""},baseUrl:w,handleDocumentClick:Y,componentType:0}),s.file_path,i.jsx("button",{onClick:()=>D(s.id),className:"absolute top-0 right-0 text-red-500",children:i.jsx(Z,{className:"w-6 h-6"})})]},s.id),i.jsx("br",{})]}))),i.jsx(c,{message:d.media_ids,className:"mt-2"})]})]})]})]})})]})}export{je as default};

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.