PageSourceSearch

https://www.nwgroom.com/build/assets/ApiTokenManager-B2f01kJQ.js

js nwgroom.com collected 2026-10-07 03:27:12 UTC 9,135 bytes, 1 lines download raw bytes

1import{o as l,d as a,a as s,r as c,b as n,w as t,c as z,e as U,f as W,n as $,g as _,u as E,T as h,h as w,i as m,j as u,F as A,k as C,t as x}from"./app-DvBmKPjB.js";import{A as H}from"./ActionMessage-D_kRKFqB.js";import{_ as F}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{_ as S}from"./Checkbox-CSGaRLcE.js";import{_ as Y,a as T,b as P}from"./SecondaryButton-Byfg7MAk.js";import{_ as j,a as q,b as G}from"./TextInput-Cl7QBnoG.js";import{_ as B}from"./PrimaryButton-B1XQlVR3.js";const J={},K={class:"md:col-span-1 flex justify-between"},O={class:"px-4 sm:px-0"},Q={class:"text-lg font-medium text-gray-900 dark:text-gray-100"},R={class:"mt-1 text-sm text-gray-600 dark:text-gray-400"},X={class:"px-4 sm:px-0"};function Z(i,d){return l(),a("div",K,[s("div",O,[s("h3",Q,[c(i.$slots,"title")]),s("p",R,[c(i.$slots,"description")])]),s("div",X,[c(i.$slots,"aside")])])}const I=F(J,[["render",Z]]),ee={class:"md:grid md:grid-cols-3 md:gap-6"},se={class:"mt-5 md:mt-0 md:col-span-2"},te={class:"px-4 py-5 sm:p-6 bg-white dark:bg-gray-800 shadow sm:rounded-lg"},oe={__name:"ActionSection",setup(i){return(d,r)=>(l(),a("div",ee,[n(I,null,{title:t(()=>[c(d.$slots,"title")]),description:t(()=>[c(d.$slots,"description")]),_:3}),s("div",se,[s("div",te,[c(d.$slots,"content")])])]))}},ne={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},ie={class:"sm:flex sm:items-start"},re={class:"mt-3 text-center sm:mt-0 sm:ms-4 sm:text-start"},le={class:"text-lg font-medium text-gray-900 dark:text-gray-100"},ae={class:"mt-4 text-sm text-gray-600 dark:text-gray-400"},de={class:"flex flex-row justify-end px-6 py-4 bg-gray-100 dark:bg-gray-800 text-end"},me={__name:"ConfirmationModal",props:{show:{type:Boolean,default:!1},maxWidth:{type:String,default:"2xl"},closeable:{type:Boolean,default:!0}},emits:["close"],setup(i,{emit:d}){const r=d,p=()=>{r("close")};return(g,f)=>(l(),z(Y,{show:i.show,"max-width":i.maxWidth,closeable:i.closeable,onClose:p},{default:t(()=>[s("div",ne,[s("div",ie,[f[0]||(f[0]=s("div",{class:"mx-auto shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10"},[s("svg",{class:"h-6 w-6 text-red-600 dark:text-red-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})])],-1)),s("div",re,[s("h3",le,[c(g.$slots,"title")]),s("div",ae,[c(g.$slots,"content")])])])]),s("div",de,[c(g.$slots,"footer")])]),_:3},8,["show","max-width","closeable"]))}},ue=["type"],ce={__name:"DangerButton",props:{type:{type:String,default:"button"}},setup(i){return(d,r)=>(l(),a("button",{type:i.type,class:"inline-flex items-center justify-center px-4 py-2 bg-red-600 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-red-500 active:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 dark:focus:ring-offset-gray-800 transition ease-in-out duration-150"},[c(d.$slots,"default")],8,ue))}},pe={class:"md:grid md:grid-cols-3 md:gap-6"},ge={class:"mt-5 md:mt-0 md:col-span-2"},fe={class:"grid grid-cols-6 gap-6"},ve={key:0,class:"flex items-center justify-end px-4 py-3 bg-gray-50 dark:bg-gray-800 text-end sm:px-6 shadow sm:rounded-bl-md sm:rounded-br-md"},ye={__name:"FormSection",emits:["submitted"],setup(i){const d=U(()=>!!E().actions);return(r,p)=>(l(),a("div",pe,[n(I,null,{title:t(()=>[c(r.$slots,"title")]),description:t(()=>[c(r.$slots,"description")]),_:3}),s("div",ge,[s("form",{onSubmit:p[0]||(p[0]=W(g=>r.$emit("submitted"),["prevent"]))},[s("div",{class:$(["px-4 py-5 bg-white dark:bg-gray-800 sm:p-6 shadow",d.value?"sm:rounded-tl-md sm:rounded-tr-md":"sm:rounded-md"])},[s("div",fe,[c(r.$slots,"form")])],2),d.value?(l(),a("div",ve,[c(r.$slots,"actions")])):_("",!0)],32)])]))}},ke={},_e={class:"hidden sm:block"};function be(i,d){return l(),a("div",_e,d[0]||(d[0]=[s("div",{class:"py-8"},[s("div",{class:"border-t border-gray-200 dark:border-gray-700"})],-1)]))}const xe=F(ke,[["render",be]]),$e={class:"col-span-6 sm:col-span-4"},he={key:0,class:"col-span-6"},we={class:"mt-2 grid grid-cols-1 md:grid-cols-2 gap-4"},Ae={class:"flex items-center"},Ce={class:"ms-2 text-sm text-gray-600 dark:text-gray-400"},Pe={key:0},Se={class:"mt-10 sm:mt-0"},Te={class:"space-y-6"},je={class:"break-all dark:text-white"},Be={class:"flex items-center ms-2"},Fe={key:0,class:"text-sm text-gray-400"},Ie=["onClick"],De=["onClick"],Me={key:0,class:"mt-4 bg-gray-100 dark:bg-gray-900 px-4 py-2 rounded font-mono text-sm text-gray-500 break-all"},Ve={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Ne={class:"flex items-center"},Le={class:"ms-2 text-sm text-gray-600 dark:text-gray-400"},Ge={__name:"ApiTokenManager",props:{tokens:Array,availablePermissions:Array,defaultPermissions:Array},setup(i){const r=h({name:"",permissions:i.defaultPermissions}),p=h({permissions:[]}),g=h({}),f=w(!1),y=w(null),k=w(null),D=()=>{r.post(route("api-tokens.store"),{preserveScroll:!0,onSuccess:()=>{f.value=!0,r.reset()}})},M=v=>{p.permissions=v.abilities,y.value=v},V=()=>{p.put(route("api-tokens.update",y.value),{preserveScroll:!0,preserveState:!0,onSuccess:()=>y.value=null})},N=v=>{k.value=v},L=()=>{g.delete(route("api-tokens.destroy",k.value),{preserveScroll:!0,preserveState:!0,onSuccess:()=>k.value=null})};return(v,e)=>(l(),a("div",null,[n(ye,{onSubmitted:D},{title:t(()=>e[9]||(e[9]=[m(" Create API Token ")])),description:t(()=>e[10]||(e[10]=[m(" API tokens allow third-party services to authenticate with our application on your behalf. ")])),form:t(()=>[s("div",$e,[n(j,{for:"name",value:"Name"}),n(q,{id:"name",modelValue:u(r).name,"onUpdate:modelValue":e[0]||(e[0]=o=>u(r).name=o),type:"text",class:"mt-1 block w-full",autofocus:""},null,8,["modelValue"]),n(G,{message:u(r).errors.name,class:"mt-2"},null,8,["message"])]),i.availablePermissions.length>0?(l(),a("div",he,[n(j,{for:"permissions",value:"Permissions"}),s("div",we,[(l(!0),a(A,null,C(i.availablePermissions,o=>(l(),a("div",{key:o},[s("label",Ae,[n(S,{checked:u(r).permissions,"onUpdate:checked":e[1]||(e[1]=b=>u(r).permissions=b),value:o},null,8,["checked","value"]),s("span",Ce,x(o),1)])]))),128))])])):_("",!0)]),actions:t(()=>[n(H,{on:u(r).recentlySuccessful,class:"me-3"},{default:t(()=>e[11]||(e[11]=[m(" Created. ")])),_:1},8,["on"]),n(B,{class:$({"opacity-25":u(r).processing}),disabled:u(r).processing},{default:t(()=>e[12]||(e[12]=[m(" Create ")])),_:1},8,["class","disabled"])]),_:1}),i.tokens.length>0?(l(),a("div",Pe,[n(xe),s("div",Se,[n(oe,null,{title:t(()=>e[13]||(e[13]=[m(" Manage API Tokens ")])),description:t(()=>e[14]||(e[14]=[m(" You may delete any of your existing tokens if they are no longer needed. ")])),content:t(()=>[s("div",Te,[(l(!0),a(A,null,C(i.tokens,o=>(l(),a("div",{key:o.id,class:"flex items-center justify-between"},[s("div",je,x(o.name),1),s("div",Be,[o.last_used_ago?(l(),a("div",Fe," Last used "+x(o.last_used_ago),1)):_("",!0),i.availablePermissions.length>0?(l(),a("button",{key:1,class:"cursor-pointer ms-6 text-sm text-gray-400 underline",onClick:b=>M(o)}," Permissions ",8,Ie)):_("",!0),s("button",{class:"cursor-pointer ms-6 text-sm text-red-500",onClick:b=>N(o)}," Delete ",8,De)])]))),128))])]),_:1})])])):_("",!0),n(T,{show:f.value,onClose:e[3]||(e[3]=o=>f.value=!1)},{title:t(()=>e[15]||(e[15]=[m(" API Token ")])),content:t(()=>[e[16]||(e[16]=s("div",null," Please copy your new API token. For your security, it won't be shown again. ",-1)),v.$page.props.jetstream.flash.token?(l(),a("div",Me,x(v.$page.props.jetstream.flash.token),1)):_("",!0)]),footer:t(()=>[n(P,{onClick:e[2]||(e[2]=o=>f.value=!1)},{default:t(()=>
1e[17]||(e[17]=[m(" Close ")])),_:1})]),_:1},8,["show"]),n(T,{show:y.value!=null,onClose:e[6]||(e[6]=o=>y.value=null)},{title:t(()=>e[18]||(e[18]=[m(" API Token Permissions ")])),content:t(()=>[s("div",Ve,[(l(!0),a(A,null,C(i.availablePermissions,o=>(l(),a("div",{key:o},[s("label",Ne,[n(S,{checked:u(p).permissions,"onUpdate:checked":e[4]||(e[4]=b=>u(p).permissions=b),value:o},null,8,["checked","value"]),s("span",Le,x(o),1)])]))),128))])]),footer:t(()=>[n(P,{onClick:e[5]||(e[5]=o=>y.value=null)},{default:t(()=>e[19]||(e[19]=[m(" Cancel ")])),_:1}),n(B,{class:$(["ms-3",{"opacity-25":u(p).processing}]),disabled:u(p).processing,onClick:V},{default:t(()=>e[20]||(e[20]=[m(" Save ")])),_:1},8,["class","disabled"])]),_:1},8,["show"]),n(me,{show:k.value!=null,onClose:e[8]||(e[8]=o=>k.value=null)},{title:t(()=>e[21]||(e[21]=[m(" Delete API Token ")])),content:t(()=>e[22]||(e[22]=[m(" Are you sure you would like to delete this API token? ")])),footer:t(()=>[n(P,{onClick:e[7]||(e[7]=o=>k.value=null)},{default:t(()=>e[23]||(e[23]=[m(" Cancel ")])),_:1}),n(ce,{class:$(["ms-3",{"opacity-25":u(g).processing}]),disabled:u(g).processing,onClick:L},{default:t(()=>e[24]||(e[24]=[m(" Delete ")])),_:1},8,["class","disabled"])]),_:1},8,["show"])]))}};export{Ge 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.