1"use strict";(self.webpackChunkhealthcare_forms_frontend=self.webpackChunkhealthcare_forms_frontend||[]).push([[1356],{67108(e,t,n){n.d(t,{FeatureAccessSettings:()=>L});var i=n(89379),s=n(5544),r=n(9950),a=n(16491),o=n(82053),l=n(25277),c=n(37324),d=n(46639),h=n(2235),u=n(18160),p=n(93230),f=n(10226),x=n(65471),m=n(44414);const g=(0,x.A)((0,m.jsx)("path",{d:"M10 13c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m0-2c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3m8.5-2 1.09-2.41L22 5.5l-2.41-1.09L18.5 2l-1.09 2.41L15 5.5l2.41 1.09zm2.78 3.72L20.5 11l-.78 1.72-1.72.78 1.72.78.78 1.72.78-1.72L23 13.5zM16.25 14c0-.12 0-.25-.01-.37l1.94-1.47-2.5-4.33-2.24.94c-.2-.13-.42-.26-.64-.37L12.5 6h-5l-.3 2.41c-.22.11-.43.24-.64.37l-2.24-.95-2.5 4.33 1.94 1.47c-.01.12-.01.25-.01.37s0 .25.01.37l-1.94 1.47 2.5 4.33 2.24-.94c.2.13.42.26.64.37l.3 2.4h5l.3-2.41c.22-.11.43-.23.64-.37l2.24.94 2.5-4.33-1.94-1.47c.01-.11.01-.24.01-.36m-1.42 3.64-1.73-.73c-.56.6-1.3 1.04-2.13 1.23L10.73 20H9.27l-.23-1.86c-.83-.19-1.57-.63-2.13-1.23l-1.73.73-.73-1.27 1.49-1.13c-.12-.39-.18-.8-.18-1.23 0-.43.06-.84.18-1.23l-1.49-1.13.73-1.27 1.73.73c.56-.6 1.3-1.04 2.13-1.23L9.27 8h1.47l.23 1.86c.83.19 1.57.63 2.13 1.23l1.73-.73.73 1.27-1.49 1.13c.12.39.18.8.18 1.23 0 .43-.06.84-.18 1.23l1.49 1.13z"}),"SettingsSuggestOutlined");var v=n(8868),A=n(63834);const y=(0,x.A)((0,m.jsx)("path",{d:"M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 16H5V10h14zm0-12H5V6h14zM9 14H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm-8 4H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2z"}),"CalendarMonthOutlined");var b=n(72934),k=n(81941),j=n(98696),S=n(34009);const C="#ffffff",w="#f9f8f6",z="#e8e5e0",P="#8f5b36",_="#3d3929",D="#706f6a",M="#9c9a95",H=e=>{let t=e.title,n=e.description,i=e.checked,s=e.onChange,r=e.disabled,d=void 0!==r&&r,h=e.badge,u=e.helperText,p=e.icon;return(0,m.jsxs)(a.A,{sx:{display:"flex",justifyContent:"space-between",gap:3,p:2.5,borderRadius:"16px",border:"1px solid ".concat(z),backgroundColor:d?"#fcfbf9":C},children:[(0,m.jsxs)(a.A,{sx:{display:"flex",gap:2,minWidth:0},children:[(0,m.jsx)(a.A,{sx:{width:44,height:44,borderRadius:"14px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#f4ede4",color:P,flexShrink:0},children:p}),(0,m.jsxs)(a.A,{sx:{minWidth:0},children:[(0,m.jsxs)(a.A,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[(0,m.jsx)(o.A,{sx:{fontSize:"17px",fontWeight:700,color:_},children:t}),h?(0,m.jsx)(l.A,{size:"small",label:h,sx:{height:24,backgroundColor:"#fbf4ea",color:P,fontWeight:600}}):null]}),(0,m.jsx)(o.A,{sx:{mt:.75,color:D,maxWidth:640},children:n}),u?(0,m.jsx)(o.A,{sx:{mt:1,fontSize:"13px",color:M},children:u}):null]})]}),(0,m.jsx)(c.A,{checked:i,onChange:(e,t)=>
1s(t),disabled:d,sx:{alignSelf:"center",mr:-1}})]})},L=()=>{const e=(0,k.j)(),t=(0,k.G)(e=>e.auth.organization),n=(0,j.Im)(),l=(0,s.A)(n,2),c=l[0],x=l[1].isLoading,C=(0,r.useState)(null),M=(0,s.A)(C,2),L=M[0],R=M[1],V=(0,r.useMemo)(()=>(e=>{const t=(null===e||void 0===e?void 0:e.settings)||{},n=null===e||void 0===e?void 0:e.entitlements,i=Boolean(!1!==(null===n||void 0===n?void 0:n.patient_registry)&&!1!==t.patient_registry_enabled);return{patientProfiles:i,clinicalDocumentation:Boolean(i&&!1!==(null===n||void 0===n?void 0:n.daily_notes)&&!1!==t.daily_notes_enabled),scheduling:Boolean(!1!==(null===n||void 0===n?void 0:n.scheduling))}})(t),[t]),W=(0,r.useState)(V),I=(0,s.A)(W,2),N=I[0],O=I[1];(0,r.useEffect)(()=>{O(V)},[V]);const T=N.patientProfiles!==V.patientProfiles||N.clinicalDocumentation!==V.clinicalDocumentation||N.scheduling!==V.scheduling;return t?(0,m.jsx)(a.A,{sx:{maxWidth:980,mx:"auto",p:3},children:(0,m.jsxs)(h.A,{sx:{p:4},children:[(0,m.jsxs)(a.A,{sx:{display:"flex",alignItems:"center",gap:2,mb:3},children:[(0,m.jsx)(a.A,{sx:{width:52,height:52,borderRadius:"18px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#f4ede4",color:P},children:(0,m.jsx)(g,{})}),(0,m.jsxs)(a.A,{children:[(0,m.jsx)(o.A,{variant:"h4",fontWeight:"bold",children:"Feature Access"}),(0,m.jsx)(o.A,{variant:"body2",color:"text.secondary",children:"Change which workflows this organization can use after onboarding."})]})]}),L?(0,m.jsx)(u.A,{severity:L.type,sx:{mb:3},onClose:()=>R(null),children:L.text}):null,(0,m.jsx)(u.A,{severity:"info",sx:{mb:3,backgroundColor:"#fbf8f2",border:"1px solid ".concat(z)},children:"These controls update product access immediately. Billing enforcement is not attached yet, but this maps cleanly to future Stripe-based plan rules."}),(0,m.jsxs)(p.A,{spacing:2,children:[(0,m.jsx)(H,{title:"Patient Profiles",description:"Enable the searchable patient registry, patient demographics, and patient profile pages.",helperText:"Turn this on if the clinic wants durable patient records instead of response-only workflows.",checked:N.patientProfiles,onChange:e=>{O(t=>({patientProfiles:e,clinicalDocumentation:!!e&&t.clinicalDocumentation,scheduling:t.scheduling}))},badge:"Core Clinical",icon:(0,m.jsx)(v.A,{})}),(0,m.jsx)(H,{title:"Clinical Documentation",description:"Enable note templates, daily notes, and patient-linked clinical documentation.",helperText:"This depends on Patient Profiles because notes are attached to patient records.",checked:N.clinicalDocumentation,onChange:e=>{O(t=>(0,i.A)((0,i.A)({},t),{},{patientProfiles:!!e||t.patientProfiles,clinicalDocumentation:e}))},disabled:!N.patientProfiles,badge:"Depends on Profiles",icon:(0,m.jsx)(A.A,{})}),(0,m.jsx)(H,{title:"Scheduling",description:"Enable scheduling settings, visit types, and appointment management flows.",helperText:"Leave this off if the clinic is only using intake forms and charting.",checked:N.scheduling,onChange:e=>{O(t=>(0,i.A)((0,i.A)({},t),{},{scheduling:e}))},badge:"Operational",icon:(0,m.jsx)(y,{})})]}),(0,m.jsxs)(a.A,{sx:{mt:3,p:2.5,borderRadius:"16px",backgroundColor:w,border:"1px solid ".concat(z)},children:[(0,m.jsx)(o.A,{sx:{fontSize:"15px",fontWeight:700,color:_},children:"Current billing behavior"}),(0,m.jsx)(o.A,{sx:{mt:.75,color:D},children:"Changing these switches only updates organization entitlements today. If you later wire specific features to Stripe products or plan tiers, this screen can become the control point for upgrades, downgrades, or locked features."})]}),(0,m.jsx)(a.A,{sx:{mt:4,display:"flex",justifyContent:"flex-end"},children:(0,m.jsx)(f.A,{variant:"contained",onClick:async()=>{if(t){R(null);try{const n=await c({patient_registry:N.patientProfiles,daily_notes:N.patientProfiles&&N.clinicalDocumentation,scheduling:N.scheduling,source:"settings"}).unwrap();e((0,S.eC)((0,i.A)((0,i.A)({},t),{},{settings:(0,i.A)((0,i.A)({},t.settings),{},{patient_registry_enabled:N.patientProfiles,daily_notes_enabled:N.patientProfiles&&N.clinicalDocumentation}),entitlements:n.entitlements||{patient_registry:N.patientProfiles,daily_notes:N.patientProfiles&&N.clinicalDocumentation,scheduling:N.scheduling,feature_setup_completed:!0,source:"settings",updated_at:(new Date).toISOString()},needs_feature_setup:!1}))),R({type:"success",text:"Feature access updated for your organization."})}catch(s){var n;R({type:"error",text:(null===s||void 0===s||null===(n=s.data)||void 0===n?void 0:n.error)||(null===s||void 0===s?void 0:s.message)||"Unable to update feature access."})}}else R({type:"error",text:"Organization details are not loaded yet."})},disabled:!T||x,startIcon:x?(0,m.jsx)(d.A,{size:18}):(0,m.jsx)(b.A,{}),sx:{minWidth:220,borderRadius:"12px"},children:x?"Saving...":T?"Save Feature Access":"No Changes"})})]})}):(0,m.jsx)(a.A,{sx:{display:"flex",justifyContent:"center",py:6},children:(0,m.jsx)(d.A,{})})}},8868(e,t,n){n.d(t,{A:()=>r});var i=n(65471),s=n(44414);const r=(0,i.A)((0,s.jsx)("path",{d:"M16.5 13c-1.2 0-3.07.34-4.5 1-1.43-.67-3.3-1-4.5-1C5.33 13 1 14.08 1 16.25V19h22v-2.75c0-2.17-4.33-3.25-6.5-3.25m-4 4.5h-10v-1.25c0-.54 2.56-1.75 5-1.75s5 1.21 5 1.75zm9 0H14v-1.25c0-.46-.2-.86-.52-1.22.88-.3 1.96-.53 3.02-.53 2.44 0 5 1.21 5 1.75zM7.5 12c1.93 0 3.5-1.57 3.5-3.5S9.43 5 7.5 5 4 6.57 4 8.5 5.57 12 7.5 12m0-5.5c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m9 5.5c1.93 0 3.5-1.57 3.5-3.5S18.43 5 16.5 5 13 6.57 13 8.5s1.57 3.5 3.5 3.5m0-5.5c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2"}),"PeopleOutline")},72934(e,t,n){n.d(t,{A:()=>r});var i=n(65471),s=n(44414);const r=(0,i.A)((0,s.jsx)("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z"}),"Save")},63834(e,t,n){n.d(t,{A:()=>r});var i=n(65471),s=n(44414);const r=(0,i.A)((0,s.jsx)("path",{d:"M19 5v9h-5v5H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h10l6-6V5c0-1.1-.9-2-2-2m-7 11H7v-2h5zm5-4H7V8h10z"}),"StickyNote2Outlined")},46639(e,t,n){n.d(t,{A:()=>H});var i=n(57528),s=n(98587),r=n(58168),a=n(9950),o=n(72004),l=n(88465),c=n(88283),d=n(61676),h=n(18463),u=n(59254),p=n(1763),f=n(423);function x(e){return(0,f.Ay)("MuiCircularProgress",e)}(0,p.A)("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);var m,g,v,A,y=n(44414);const b=["className","color","disableShrink","size","style","thickness","value","variant"];let k,j,S,C;const w=44,z=(0,c.i7)(k||(k=m||(m=(0,i.A)(["\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n"])))),P=(0,c.i7)(j||(j=g||(g=(0,i.A)(["\n 0% {\n stroke-dasharray: 1px, 200px;\n stroke-dashoffset: 0;\n }\n\n 50% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -15px;\n }\n\n 100% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -125px;\n }\n"])))),_=(0,u.Ay)("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const n=e.ownerState;return[t.root,t[n.variant],t["color".concat((0,d.A)(n.color))]]}})(e=>{let t=e.ownerState,n=e.theme;return(0,r.A)({display:"inline-block"},"determinate"===t.variant&&{transition:n.transitions.create("transform")},"inherit"!==t.color&&{color:(n.vars||n).palette[t.color].main})},e=>"indeterminate"===e.ownerState.variant&&(0,c.AH)(S||(S=v||(v=(0,i.A)(["\n animation: "," 1.4s linear infinite;\n "]))),z)),D=(0,u.Ay)("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),M=(0,u.Ay)("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const n=e.ownerState;return[t.circle,t["circle".concat((0,d.A)(n.variant))],n.disableShrink&&t.circleDisableShrink]}})(e=>{let t=e.ownerState,n=e.theme;return(0,r.A)({stroke:"currentColor"},"determinate"===t.variant&&{transition:n.transitions.create("stroke-dashoffset")},"indeterminate"===t.variant&&{strokeDasharray:"80px, 200px",strokeDashoffset:0})},e=>{let t=e.ownerState;return"indeterminate"===t.variant&&!t.disableShrink&&(0,c.AH)(C||(C=A||(A=(0,i.A)(["\n animation: "," 1.4s ease-in-out infinite;\n "]))),P)}),H=a.forwardRef(function(e,t){const n=(0,h.b)({props:e,name:"MuiCircularProgress"}),i=n.className,a=n.color,c=void 0===a?"primary":a,u=n.disableShrink,p=void 0!==u&&u,f=n.size,m=void 0===f?40:f,g
1=n.style,v=n.thickness,A=void 0===v?3.6:v,k=n.value,j=void 0===k?0:k,S=n.variant,C=void 0===S?"indeterminate":S,z=(0,s.A)(n,b),P=(0,r.A)({},n,{color:c,disableShrink:p,size:m,thickness:A,value:j,variant:C}),H=(e=>{const t=e.classes,n=e.variant,i=e.color,s=e.disableShrink,r={root:["root",n,"color".concat((0,d.A)(i))],svg:["svg"],circle:["circle","circle".concat((0,d.A)(n)),s&&"circleDisableShrink"]};return(0,l.A)(r,x,t)})(P),L={},R={},V={};if("determinate"===C){const e=2*Math.PI*((w-A)/2);L.strokeDasharray=e.toFixed(3),V["aria-valuenow"]=Math.round(j),L.strokeDashoffset="".concat(((100-j)/100*e).toFixed(3),"px"),R.transform="rotate(-90deg)"}return(0,y.jsx)(_,(0,r.A)({className:(0,o.A)(H.root,i),style:(0,r.A)({width:m,height:m},R,g),ownerState:P,ref:t,role:"progressbar"},V,z,{children:(0,y.jsx)(D,{className:H.svg,ownerState:P,viewBox:"".concat(22," ").concat(22," ").concat(w," ").concat(w),children:(0,y.jsx)(M,{className:H.circle,style:L,ownerState:P,cx:w,cy:w,r:(w-A)/2,fill:"none",strokeWidth:A})})}))})},15866(e,t,n){n.d(t,{A:()=>i});const i=n(9950).createContext(void 0)},39766(e,t,n){n.d(t,{A:()=>r});var i=n(9950),s=n(15866);function r(){return i.useContext(s.A)}},4570(e,t,n){n.d(t,{A:()=>r});var i=n(5544),s=n(9950);const r=function(e){let t=e.controlled,n=e.default;e.name,e.state;const r=s.useRef(void 0!==t).current,a=s.useState(n),o=(0,i.A)(a,2),l=o[0],c=o[1];return[r?t:l,s.useCallback(e=>{r||c(e)},[])]}}}]);
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.