openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
16 lines • 3.38 kB
JavaScript
import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{R as t,wr as n,z as r}from"./control-ui-foundation-Cydpkyqa.js";import{Bn as i,Sc as a,bc as o,zn as s}from"./control-ui-core-Rwzhj6nO.js";import{K as c,X as l,q as u}from"./lit-runtime-CV_MH99K.js";import{_ as d,_n as f,g as p,jn as m}from"./control-ui-core-YphAl4aM.js";import{Yt as h,en as g}from"./control-ui-core-vvcQQV2m.js";import{J as _,K as v,L as y,Q as b,V as x,X as S,Z as C,et as w,q as T,z as E}from"./control-ui-boot-chat-_QSl8fbH.js";import{n as D,t as O}from"./en-settings-D_ebb5Hk.js";import{n as k,t as A}from"./settings-workspace-Bseic8Tf.js";var j;function M(){return(M=e((()=>{r(),c(),f(),d(),y(),A(),h(),O(),a(),i(),D(),j=class extends o{constructor(...e){super(...e),this.subscriptions=new s(this).watch(()=>this.context?.nativeDeviceSettings,(e,t)=>e.subscribe(t))}disconnectedCallback(){this.subscriptions.clear(),super.disconnectedCallback()}renderPermissions(e){let t=this.context.nativeDeviceSettings,{permissions:n}=e;return l`
${S({title:g(`configPage.deviceSettings.systemAccess`)},n.entries.map(({id:e,status:n})=>_({title:g(`configPage.deviceSettings.permissions.${e}.title`),description:g(`configPage.deviceSettings.permissions.${e}.hint`),stackedOnNarrow:!0,control:l`
${b({kind:n===`granted`?`ok`:n===`denied`?`danger`:`muted`,label:g(`configPage.deviceSettings.permissionStatuses.${n}`)})}
${n===`notDetermined`?l`<button type="button" class="btn" @click=${()=>t?.requestPermission(e)}>${g(`configPage.deviceSettings.grant`)}</button>`:n===`denied`?l`<button type="button" class="btn" @click=${()=>t?.openSystemSettings(e)}>${g(`configPage.deviceSettings.openSystemSettings`)}</button>`:u}
`})))}
${S({title:g(`configPage.deviceSettings.location`)},l`
${_({title:g(`configPage.deviceSettings.locationAccess`),description:g(`configPage.deviceSettings.locationHint`),stackedOnNarrow:!0,control:C({value:n.location.mode,ariaLabel:g(`configPage.deviceSettings.locationAccess`),options:[`off`,`whileUsing`,`always`].map(e=>({value:e,label:g(`configPage.deviceSettings.locationModes.${e}`)})),onChange:e=>t?.set(`permissions.location.mode`,e)})})}
${w({title:g(`configPage.deviceSettings.preciseLocation`),description:g(`configPage.deviceSettings.preciseLocationHint`),checked:n.location.precise,disabled:n.location.mode===`off`,onChange:e=>t?.set(`permissions.location.precise`,e)})}
`)}
${S({title:g(`configPage.deviceSettings.privacy`)},w({title:g(`configPage.deviceSettings.activePresence`),description:g(`configPage.deviceSettings.activePresenceHint`),checked:e.capabilities.activeComputerPresenceEnabled,onChange:e=>t?.set(`capabilities.activeComputerPresenceEnabled`,e)}))}
`}render(){let e=this.context?.nativeDeviceSettings,t=e?.snapshot,n=e?t?this.renderPermissions(t):x(g(`configPage.deviceSettings.loading`)):x(g(`configPage.deviceSettings.appOnly`));return l`
${T({title:m(`device-permissions`),subtitle:l`${g(`configPage.deviceSettings.permissionsIntro`)}
${E(`https://docs.openclaw.ai/platforms/macos`)}`})}
${k(v(n))}
`}},n([t({context:p,subscribe:!0})],j.prototype,`context`,void 0),customElements.get(`openclaw-device-permissions-page`)||customElements.define(`openclaw-device-permissions-page`,j)})))()}M();
//# sourceMappingURL=permissions-page-CkfvtzK5.js.map