PageSourceSearch

https://uttarakhandtourism.gov.in/build/assets/Create-BSE-gIEm.js

js uttarakhandtourism.gov.in collected 2026-10-02 06:29:36 UTC 9,483 bytes, 1 lines download raw bytes

1import{G,r as p,j as i,S as V}from"./app-Ha4X7SlF.js";import{A as z}from"./AuthenticatedLayout-BZKUhDrh.js";import{I as a}from"./InputError-Do4kQPnM.js";import{I as o}from"./InputLabel-D410np7F.js";import{P}from"./PrimaryButton-Bjn3n3t2.js";import{T as c}from"./TextInput-YH4SiJD7.js";import{Q as j}from"./index-C9bVzuNG.js";/* empty css                   */import{M as U}from"./MediaModal-DTWNCtfU.js";import Q from"./MediaPreview-D7BGVdAv.js";import{h as R,a as J,v as K}from"./helpers-C3Ubf4D0.js";import{T as W,S as X}from"./constants-gejEprHZ.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 xe({auth:h,medias:b}){const v=window.location.origin;new Date().toISOString().split("T")[0];const{data:s,setData:l,post:T,processing:N,errors:n,setError:t}=G({title:"",description:"",short_description:"",status:0,slug:"",adventure_type:"",author_id:h.user.id,media_id:0,title_hi:"",description_hi:"",short_description_hi:""}),[y,g]=p.useState(!1),C=e=>{if(e){t("title","");const r=e.slice(0,W);J(r)&&(l(d=>({...d,title:r})),t("slug",""))}else t("title","The title field is required."),l("title",e)},k=e=>{e?t("adventure_type",""):t("adventure_type","The adventure type field is required."),l("adventure_type",e)},w=e=>{e?(t("title_hi",""),l("title_hi",e)):(t("title_hi","The title in hindi field is required."),l("title_hi",e))},q=e=>{if(e){const r=e.slice(0,X);K(r)&&(t("slug",""),l("slug",r))}else t("slug","The slug field is required."),l("slug",e)},S=(e,r)=>{t("description",e?"":"The Description field is required."),l("description",e)},D=e=>{t("short_description",e?"":"The Short Description field is required."),l("short_description",e)},F=(e,r)=>{t("description_hi",e?"":"The Description in hindi field is required."),l("description_hi",e)},A=e=>{t("short_description_hi",e?"":"The Short Description in hindi field is required."),l("short_description_hi",e)};p.useEffect(()=>{document.querySelectorAll("label").forEach(r=>{r.classList.add("req-star")})},[]);const E=()=>{let e=!0;return s.title?s.title.length<3&&(e=!1,t("title","The title field minimum length should be more than 3 characters.")):(e=!1,t("title","The title field is required.")),s.slug?t("slug",""):(e=!1,t("slug","The slug field is required.")),s.description?s.description.length<3&&(e=!1,t("description","The description field minimum length should be more than 3 characters.")):(e=!1,t("description","The description field is required.")),s.short_description?s.short_description.length<3&&(e=!1,t("short_description","The short description field minimum length should be more than 3 characters.")):(e=!1,t("short_description","The short description field is required.")),s.media_id||(t("media_id","The banner image is required."),e=!1),s.title_hi?s.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.")),s.description_hi?s.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.")),s.short_description_hi?s.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},I=e=>{e.preventDefault(),E()&&T(route("adventure.store"),{onFinish:()=>
1{l({title:"",description:"",status:0,slug:"",adventure_type:"",short_description:"",author_id:h.user.id,media_id:0,title_hi:"",description_hi:"",short_description_hi:""})}})},f={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"]]},x=["header","font","size","bold","italic","underline","align","strike","script","blockquote","background","list","bullet","indent","link","image","color","code-block"],[m,L]=p.useState(null),M=e=>{var r;L(e),l("media_id",(r=e[0])==null?void 0:r.id),t("media_id",""),_()},B=()=>{g(!0)},_=()=>{g(!1)},H=e=>{if(e){if(t("title",""),e.length<=90){const r=e.slice(0,60);l(d=>({...d,title:e,slug:O(r)})),t("slug","")}}else t("title","The title field is required."),l(r=>({...r,title:e,slug:e}))},O=e=>e.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-");return i.jsxs(z,{user:h.user,header:i.jsx("h2",{className:"font-semibold text-xl text-gray-800 leading-tight",children:"Create Adventure"}),children:[i.jsx(V,{title:"Create Adventure"}),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("div",{className:"flex justify-between items-center",children:i.jsx("h3",{className:"text-lg font-semibold",children:"Create Adventure"})})}),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:"mt-4 w-1/2",children:[i.jsx(o,{htmlFor:"title",value:"Title"}),i.jsx(c,{id:"title",name:"title",value:s.title,className:"mt-1 block w-full focus:border-black rounded-sm bg-gray-100",autoComplete:"title",isFocused:!0,onChange:e=>C(e.target.value),onBlur:e=>H(e.target.value),required:!0}),i.jsx(a,{message:n.title,className:"mt-2"})]}),i.jsxs("div",{className:"mt-4 w-1/2",children:[i.jsx(o,{htmlFor:"title_hi",value:"Title in hindi"}),i.jsx(c,{id:"title_hi",name:"title_hi",value:s.title_hi,className:"mt-1 block w-full focus:border-black rounded-sm bg-gray-100",autoComplete:"title_hi",onChange:e=>w(e.target.value),required:!0}),i.jsx(a,{message:n.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(o,{htmlFor:"slug",value:"Slug"}),i.jsx(c,{id:"slug",name:"slug",value:s.slug,className:"mt-1 block w-full focus:border-black rounded-sm bg-gray-100",autoComplete:"slug",onChange:e=>q(e.target.value),required:!0}),i.jsx(a,{message:n.slug,className:"mt-2"})]}),i.jsxs("div",{className:"mt-4 w-1/2",children:[i.jsx(o,{htmlFor:"adventure_type",value:"Adventure Type :"}),i.jsxs("select",{className:"mt-1 block w-full focus:border-black rounded-sm bg-gray-100 border-gray-300",value:s.adventure_type,onChange:e=>k(e.target.value),children:[i.jsx("option",{value:"default",children:"Default"}),i.jsx("option",{value:"trekking",children:"Trekking"})]}),i.jsx(a,{message:n.adventure_type,className:"mt-2"})]})]}),i.jsxs("div",{className:"flex gap-4",children:[i.jsxs("div",{className:"mt-4 w-1/2",children:[i.jsx(o,{htmlFor:"short_description",value:"Short Description"}),i.jsx(c,{id:"short_description",name:"short_description",value:s.short_description,className:"mt-1 block w-full focus:border-black rounded-sm bg-gray-100",autoComplete:"title",onChange:e=>D(e.target.value),required:!0}),i.jsx(a,{message:n.short_description,className:"mt-2"})]}),i.jsxs("div",{className:"mt-4 w-1/2",children:[i.jsx(o,{htmlFor:"short_description_hi",value:"Short Description in hindi"}),i.jsx(c,{id:"short_description_hi",name:"short_description_hi",value:s.short_description_hi,className:"mt-1 block w-full focus:border-black rounded-sm bg-gray-100",autoComplete:"short_description_hi",onChange:e=>A(e.target.value),required:!0}),i.jsx(a,{message:n.short_description_hi,className:"mt-2"})]})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"mt-4",children:[i.jsx(o,{htmlFor:"description",value:"Description"}),i.jsx(j,{value:s.description,onChange:(e,r,d,u)=>{u.getText().trim(),S(e)},theme:"snow",modules:f,formats:x,placeholder:"Compose your description here...",style:{height:"200px"}})]}),i.jsx("div",{style:{marginTop:"70px"},children:i.jsx(a,{message:n.description,className:"mt-2"})}),i.jsxs("div",{className:"mt-4",children:[i.jsx(o,{htmlFor:"description_hi",value:"Description in hindi"}),i.jsx(j,{value:s.description_hi,onChange:(e,r,d,u)=>{u.getText().trim(),F(e)},theme:"snow",modules:f,formats:x,placeholder:"Compose your description here...",style:{height:"200px"}})]}),i.jsx("div",{style:{marginTop:"70px"},children:i.jsx(a,{message:n.description_hi,className:"mt-2"})})]})]}),i.jsx("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.jsx("h3",{children:"Banner Images"}),i.jsx("button",{onClick:B,className:"text-blue-500 text-sm underline",children:"Upload Banner Image"}),i.jsx(U,{imageOnly:!0,isOpen:y,onClose:_,onFileSelect:M,medias:b}),m==null?void 0:m.map((e,r)=>i.jsx(Q,{item:{file_path:e.file_path,file_name:e.file_name,format:e.format||"",title:""},baseUrl:v,handleDocumentClick:R,componentType:0})),i.jsx(a,{message:n.media_id,className:"mt-2"}),i.jsx("form",{onSubmit:I,className:"my-2",children:i.jsx("div",{className:"flex items-center justify-end mt-4",children:i.jsx(P,{className:"ms-4 bgTheme",disabled:N,children:"Create Adventure"})})})]})})]})]})})]})}export{xe 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.