PageSourceSearch

https://meetborderless.com/build/assets/create-B7yMiwXq.js

js meetborderless.com collected 2026-10-09 22:42:22 UTC 9,421 bytes, 1 lines download raw bytes

1import{j as e}from"./app-C1iegf7Q.js";import{u as S,H as F,L as h}from"./inertia-BpyZy4w-.js";import{T as L,V as R}from"./video-url-input-DQIKuIRO.js";import{R as T}from"./RichTextEditor-CGDxVgC4.js";import{B as u}from"./button-BE4q1_FS.js";import{I as j}from"./input-DJt0nBB3.js";import{L as o}from"./label-Czc25Mye.js";import{S as l,e as c,f as n,a as m,c as d}from"./select-Bn8hgKYl.js";import{S as g}from"./switch-DhdMz2rn.js";import{T as f}from"./textarea-CXLxrYIG.js";import{a as V}from"./admin-layout-BhXWbUlP.js";import{A}from"./arrow-left-DCX0fhKH.js";/* empty css            */import"./criterion-select-CKY8-FHk.js";import"./sparkles-C0aC1RHI.js";import"./createLucideIcon-wqc1LSWg.js";import"./video-CJHgxwGi.js";import"./youtube-D44Ae3nQ.js";import"./circle-check-big-AJlsIacq.js";import"./circle-alert-D8tEThd5.js";import"./index-DgRF6w_M.js";import"./index-DJlprK4q.js";import"./index-DV0GpYST.js";import"./index-B9qJRYKv.js";import"./utils-BiuKVCuu.js";import"./link-DKPEjeqT.js";import"./underline-BUwyLhKb.js";import"./list-BgP0xxm1.js";import"./quote-BLp7dxmt.js";import"./undo-BjvUJKje.js";import"./loader-circle-C_KBZAGS.js";import"./image-vCg-0Xge.js";import"./minus-BxBzNlIL.js";import"./index-CGXdj8xB.js";import"./index-DdRFMukF.js";import"./index-BdQq_4o_.js";import"./index-Dc_FVRD7.js";import"./index-B0NHTN87.js";import"./index-C48dRAib.js";import"./index-BDqbV96p.js";import"./index-Cja0wFUH.js";import"./index-CL12STDK.js";import"./Combination-Cr5kvm8y.js";import"./index-C_n-C52S.js";import"./index-D4vO54bj.js";import"./index-BRU_LjHB.js";import"./index-XydtsrKA.js";import"./index-Cs5D2gCo.js";import"./index-DyGg2PJd.js";import"./chevron-down-B1YaU0K5.js";import"./check-0O-UND6N.js";import"./chevron-up-CLp5HMgA.js";import"./app-logo-Dz0wogSq.js";import"./logo-light-DU4bWymm.js";import"./flash-toast-C6O0iVL1.js";import"./info-D2ZN_yLm.js";import"./triangle-alert-C7AVwNi-.js";import"./circle-x-Bp6Mbpgt.js";import"./circle-check-BMWvzPMx.js";import"./x-DQSeRCcH.js";import"./menu-BR3Nc3Gr.js";import"./users-BCcupCXV.js";import"./folder-open-I72SPUVk.js";import"./pound-sterling-D16GLaAZ.js";import"./book-open-DVFlG_9t.js";function Me({categories:v,types:y,accessLevels:_,journeys:b,criteria:N}){const{data:r,setData:s,post:k,processing:x,errors:i}=S({title:"",category_id:"",type:"article",journey_key:"general",content:"",excerpt:"",access_level:"free",is_published:!1,featured_image:"",metadata:{},use_markdown:!0,criterion_code:"",template_schema:"",source_docx_path:""}),w=t=>{t.preventDefault(),k("/admin/resources")},C=async t=>{const a=new FormData;a.append("image",t);const p=await fetch("/api/upload/image",{method:"POST",body:a,headers:{"X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]')?.getAttribute("content")||""}});if(!p.ok)throw new Error("Upload failed");return(await p.json()).url};return e.jsxs(V,{children:[e.jsx(F,{title:"Create Resource · Admin"}),e.jsx("div",{className:"px-4 py-5 sm:px-6 sm:py-7",children:e.jsxs("div",{className:"mx-auto max-w-4xl",children:[e.jsxs("div",{className:"mb-5",children:[e.jsxs(h,{href:"/admin/resources",className:"mb-2 inline-flex items-center gap-1 text-xs font-medium text-ink-3 hover:text-ink",children:[e.jsx(A,{className:"h-3.5 w-3.5"})," Back to Resources"]}),e.jsx("h1",{className:"text-xl font-semibold text-ink",children:"Create New Resource"})]}),e.jsx("form",{onSubmit:w,children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"rounded-card border border-line bg-white p-5",children:[e.jsx("h2",{className:"text-sm font-semibold text-ink",children:"Basic Information"}),e.jsx("p",{className:"mt-0.5 text-sm text-ink-3",children:"Core details about the resource"}),e.jsxs("div",{className:"mt-4 space-y-4",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"title",children:"Title *"}),e.jsx(j,{id:"title",value:r.title,onChange:t=>s("title",t.target.value),placeholder:"e.g., Guide to UK Visa Applications",required:!0}),i.title&&e.jsx("p",{className:"mt-1 text-xs text-red",children:i.title}),e.jsx("p",{className:"mt-1 text-xs text-ink-3",children:"Slug will be auto-generated from the title"})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"category_id",children:"Category *"}),e.jsxs(l,{value:r.category_id,onValueChange:t=>s("category_id",t),children:[e.jsx(c,{children:e.jsx(n,{placeholder:"Select category"})}),e.jsx(m,{children:v.map(t=>e.jsx(d,{value:t.id.toString(),children:t.name},t.id))})]}),i.category_id&&e.jsx("p",{className:"mt-1 text-xs text-red",children:i.category_id})]}),e.jsxs("div",{children:[e.jsx(o,{htmlFor:"type",children:"Type *"}),e.jsxs(l,{value:r.type,onValueChange:t=>s("type",t),children:[e.jsx(c,{children:e.jsx(n,{placeholder:"Select type"})}),e.jsx(m,{children:Object.entries(y).map(([t,a])=>e.jsx(d,{value:t,children:a},t))})]}),i.type&&e.jsx("p",{className:"mt-1 text-xs text-red",children:i.type})]})]}),e.jsxs("div",{children:[e.jsx(o,{htmlFor:"journey_key",children:"Journey (Library grouping)"}),e.jsxs(l,{value:r.journey_key,onValueChange:t=>s("journey_key",t),children:[e.jsx(c,{className:"max-w-xs",children:e.jsx(n,{placeholder:"Select journey"})}),e.jsx(m,{children:Object.entries(b).map(([t,a])=>e.jsx(d,{value:t,children:a},t))})]}),e.jsx("p",{className:"mt-1 text-xs text-ink-3",children:"Groups this under a route in the members Library. Leave as general if it applies to everyone."}),i.journey_key&&e.jsx("p",{className:"mt-1 text-xs text-red",children:i.journey_key})]}),e.jsxs("div",{children:[e.jsx(o,{htmlFor:"excerpt",children:"Excerpt"}),e.jsx(f,{id:"excerpt",value:r.excerpt,onChange:t=>s("excerpt",t.target.value),rows:2,placeholder:"Brief summary for previews (max 500 characters)"}),i.excerpt&&e.jsx("p",{className:"mt-1 text-xs text-red",children:i.excerpt})]}),e.jsxs("div",{children:[e.jsx(o,{htmlFor:"content",children:"Content"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(g,{id:"use-markdown",checked:r.use_markdown,onCheckedChange:t=>s("use_markdown",t)}),e.jsx(o,{htmlFor:"airplane-mode",children:"Use Markdown"})]}
1),r.use_markdown?e.jsx(f,{id:"excerpt",value:r.content,onChange:t=>s("content",t.target.value),rows:30,placeholder:"Full content of the resource..."}):e.jsx(T,{value:r.content,onChange:t=>s("content",t),placeholder:"Full content of the resource...",error:i.content,onImageUpload:C,minHeight:"300px"})]})]})]}),r.type==="template"&&e.jsx(L,{title:r.title,journeyKey:r.journey_key,criterionCode:r.criterion_code,templateSchema:r.template_schema,sourceDocxPath:r.source_docx_path,criteria:N,onCriterion:t=>s("criterion_code",t),onSchema:t=>s("template_schema",t),onSourcePath:t=>s("source_docx_path",t),errors:i}),r.type==="video"&&e.jsxs("div",{className:"rounded-card border border-line bg-white p-5",children:[e.jsx("h2",{className:"text-sm font-semibold text-ink",children:"Video Settings"}),e.jsx("p",{className:"mt-0.5 text-sm text-ink-3",children:"Configure the video source for this resource"}),e.jsx("div",{className:"mt-4",children:e.jsx(R,{value:r.metadata?.video,onChange:t=>{const a={...r.metadata};t?(a.video=t,t.thumbnail&&!r.featured_image&&s("featured_image",t.thumbnail)):delete a.video,s("metadata",a)}})})]}),e.jsxs("div",{className:"rounded-card border border-line bg-white p-5",children:[e.jsx("h2",{className:"text-sm font-semibold text-ink",children:"Media"}),e.jsx("p",{className:"mt-0.5 text-sm text-ink-3",children:"Featured image for the resource"}),e.jsxs("div",{className:"mt-4",children:[e.jsx(o,{htmlFor:"featured_image",children:"Featured Image URL"}),e.jsx(j,{id:"featured_image",value:r.featured_image,onChange:t=>s("featured_image",t.target.value),placeholder:"https://example.com/image.jpg"}),i.featured_image&&e.jsx("p",{className:"mt-1 text-xs text-red",children:i.featured_image}),r.featured_image&&e.jsx("div",{className:"mt-2",children:e.jsx("img",{src:r.featured_image,alt:"Preview",className:"max-w-xs rounded border border-line",onError:t=>{t.target.style.display="none"}})})]})]}),e.jsxs("div",{className:"rounded-card border border-line bg-white p-5",children:[e.jsx("h2",{className:"text-sm font-semibold text-ink",children:"Access & Publishing"}),e.jsx("p",{className:"mt-0.5 text-sm text-ink-3",children:"Control who can access this resource"}),e.jsxs("div",{className:"mt-4 space-y-4",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"access_level",children:"Access Level *"}),e.jsxs(l,{value:r.access_level,onValueChange:t=>s("access_level",t),children:[e.jsx(c,{className:"max-w-xs",children:e.jsx(n,{placeholder:"Select access level"})}),e.jsx(m,{children:Object.entries(_).map(([t,a])=>e.jsx(d,{value:t,children:a},t))})]}),i.access_level&&e.jsx("p",{className:"mt-1 text-xs text-red",children:i.access_level})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"is_published",children:"Published"}),e.jsx("p",{className:"text-sm text-ink-3",children:"Make this resource visible to users"})]}),e.jsx(g,{id:"is_published",checked:r.is_published,onCheckedChange:t=>s("is_published",t)})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx(u,{type:"button",variant:"outline",asChild:!0,children:e.jsx(h,{href:"/admin/resources",children:"Cancel"})}),e.jsx(u,{type:"submit",disabled:x,children:x?"Creating...":"Create Resource"})]})]})})]})})]})}export{Me 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.