PageSourceSearch

https://www.silverile.com/_next/static/chunks/pages/ideas-1de21e69b0d0c350.js

js silverile.com collected 2026-10-09 22:59:12 UTC 33,275 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6120],{10941:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>IdeasPageRoute});var s=a(37876),o=a(10553),i=a(31777),n=a(14232),r=a(90262),l=a(72147),c=a(7227),d=a(69241),p=a(4697),u=a(47951),m=a(45879);function getPaginationUtilityClass(e){return(0,m.Ay)("MuiPagination",e)}(0,u.A)("MuiPagination",["root","ul","outlined","text"]);var v=a(84335);var g=a(54526),h=a(34549);function getPaginationItemUtilityClass(e){return(0,m.Ay)("MuiPaginationItem",e)}const x=(0,u.A)("MuiPaginationItem",["root","page","sizeSmall","sizeLarge","text","textPrimary","textSecondary","outlined","outlinedPrimary","outlinedSecondary","rounded","ellipsis","firstLast","previousNext","focusVisible","disabled","selected","icon","colorPrimary","colorSecondary"]);var _=a(15247),y=a(98428),b=a(55818),f=a(86377),j=a(57155),N=a(49932);const S=(0,N.A)((0,s.jsx)("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"NavigateBefore"),P=(0,N.A)((0,s.jsx)("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext");var A=a(24369),C=a(35268),I=a(42259),w=a(77573);const overridesResolver=(e,t)=>{const{ownerState:a}=e;return[t.root,t[a.variant],t["size".concat((0,y.A)(a.size))],"text"===a.variant&&t["text".concat((0,y.A)(a.color))],"outlined"===a.variant&&t["outlined".concat((0,y.A)(a.color))],"rounded"===a.shape&&t.rounded,"page"===a.type&&t.page,("start-ellipsis"===a.type||"end-ellipsis"===a.type)&&t.ellipsis,("previous"===a.type||"next"===a.type)&&t.previousNext,("first"===a.type||"last"===a.type)&&t.firstLast]},B=(0,C.Ay)("div",{name:"MuiPaginationItem",slot:"Root",overridesResolver})((0,I.A)(e=>{let{theme:t}=e;return{...t.typography.body2,borderRadius:16,textAlign:"center",boxSizing:"border-box",minWidth:32,padding:"0 6px",margin:"0 3px",color:(t.vars||t).palette.text.primary,height:"auto",["&.".concat(x.disabled)]:{opacity:(t.vars||t).palette.action.disabledOpacity},variants:[{props:{size:"small"},style:{minWidth:26,borderRadius:13,margin:"0 1px",padding:"0 4px"}},{props:{size:"large"},style:{minWidth:40,borderRadius:20,padding:"0 10px",fontSize:t.typography.pxToRem(15)}}]}})),T=(0,C.Ay)(_.A,{name:"MuiPaginationItem",slot:"Root",overridesResolver})((0,I.A)(e=>{let{theme:t}=e;return{...t.typography.body2,borderRadius:16,textAlign:"center",boxSizing:"border-box",minWidth:32,height:32,padding:"0 6px",margin:"0 3px",color:(t.vars||t).palette.text.primary,["&.".concat(x.focusVisible)]:{backgroundColor:(t.vars||t).palette.action.focus},["&.".concat(x.disabled)]:{opacity:(t.vars||t).palette.action.disabledOpacity},transition:t.transitions.create(["color","background-color"],{duration:t.transitions.duration.short}),"&:hover":{backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},["&.".concat(x.selected)]:{backgroundColor:(t.vars||t).palette.action.selected,"&:hover":{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.action.selectedChannel," / calc(").concat(t.vars.palette.action.selectedOpacity," + ").concat(t.vars.palette.action.hoverOpacity,"))"):(0,g.X4)(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(t.vars||t).palette.action.selected}},["&.".concat(x.focusVisible)]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.action.selectedChannel," / calc(").concat(t.vars.palette.action.selectedOpacity," + ").concat(t.vars.palette.action.focusOpacity,"))"):(0,g.X4)(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)},["&.".concat(x.disabled)]:{opacity:1,color:(t.vars||t).palette.action.disabled,backgroundColor:(t.vars||t).palette.action.selected}},variants:[{props:{size:"small"},style:{minWidth:26,height:26,borderRadius:13,margin:"0 1px",padding:"0 4px"}},{props:{size:"large"},style:{minWidth:40,height:40,borderRadius:20,padding:"0 10px",fontSize:t.typography.pxToRem(15)}},{props:{shape:"rounded"},style:{borderRadius:(t.vars||t).shape.borderRadius}},{props:{variant:"outlined"},style:{border:t.vars?"1px solid rgba(".concat(t.vars.palette.common.onBackgroun
1dChannel," / 0.23)"):"1px solid ".concat("light"===t.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),["&.".concat(x.selected)]:{["&.".concat(x.disabled)]:{borderColor:(t.vars||t).palette.action.disabledBackground,color:(t.vars||t).palette.action.disabled}}}},{props:{variant:"text"},style:{["&.".concat(x.selected)]:{["&.".concat(x.disabled)]:{color:(t.vars||t).palette.action.disabled}}}},...Object.entries(t.palette).filter((0,b.A)(["dark","contrastText"])).map(e=>{let[a]=e;return{props:{variant:"text",color:a},style:{["&.".concat(x.selected)]:{color:(t.vars||t).palette[a].contrastText,backgroundColor:(t.vars||t).palette[a].main,"&:hover":{backgroundColor:(t.vars||t).palette[a].dark,"@media (hover: none)":{backgroundColor:(t.vars||t).palette[a].main}},["&.".concat(x.focusVisible)]:{backgroundColor:(t.vars||t).palette[a].dark},["&.".concat(x.disabled)]:{color:(t.vars||t).palette.action.disabled}}}}}),...Object.entries(t.palette).filter((0,b.A)(["light"])).map(e=>{let[a]=e;return{props:{variant:"outlined",color:a},style:{["&.".concat(x.selected)]:{color:(t.vars||t).palette[a].main,border:"1px solid ".concat(t.vars?"rgba(".concat(t.vars.palette[a].mainChannel," / 0.5)"):(0,g.X4)(t.palette[a].main,.5)),backgroundColor:t.vars?"rgba(".concat(t.vars.palette[a].mainChannel," / ").concat(t.vars.palette.action.activatedOpacity,")"):(0,g.X4)(t.palette[a].main,t.palette.action.activatedOpacity),"&:hover":{backgroundColor:t.vars?"rgba(".concat(t.vars.palette[a].mainChannel," / calc(").concat(t.vars.palette.action.activatedOpacity," + ").concat(t.vars.palette.action.focusOpacity,"))"):(0,g.X4)(t.palette[a].main,t.palette.action.activatedOpacity+t.palette.action.focusOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},["&.".concat(x.focusVisible)]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette[a].mainChannel," / calc(").concat(t.vars.palette.action.activatedOpacity," + ").concat(t.vars.palette.action.focusOpacity,"))"):(0,g.X4)(t.palette[a].main,t.palette.action.activatedOpacity+t.palette.action.focusOpacity)}}}}})]}})),k=(0,C.Ay)("div",{name:"MuiPaginationItem",slot:"Icon",overridesResolver:(e,t)=>t.icon})((0,I.A)(e=>{let{theme:t}=e;return{fontSize:t.typography.pxToRem(20),margin:"0 -8px",variants:[{props:{size:"small"},style:{fontSize:t.typography.pxToRem(18)}},{props:{size:"large"},style:{fontSize:t.typography.pxToRem(22)}}]}})),D=n.forwardRef(function PaginationItem(e,t){const a=(0,w.b)({props:e,name:"MuiPaginationItem"}),{className:o,color:i="standard",component:n,components:r={},disabled:l=!1,page:c,selected:u=!1,shape:m="circular",size:v="medium",slots:g={},slotProps:x={},type:_="page",variant:b="text",...N}=a,C={...a,color:i,disabled:l,selected:u,shape:m,size:v,type:_,variant:b},I=(0,h.I)(),D=(e=>{const{classes:t,color:a,disabled:s,selected:o,size:i,shape:n,type:r,variant:l}=e,c={root:["root","size".concat((0,y.A)(i)),l,n,"standard"!==a&&"color".concat((0,y.A)(a)),"standard"!==a&&"".concat(l).concat((0,y.A)(a)),s&&"disabled",o&&"selected",{page:"page",first:"firstLast",last:"firstLast","start-ellipsis":"ellipsis","end-ellipsis":"ellipsis",previous:"previousNext",next:"previousNext"}[r]],icon:["icon"]};return(0,p.A)(c,getPaginationItemUtilityClass,t)})(C);var F,R,z,L;const E={slots:{previous:null!==(F=g.previous)&&void 0!==F?F:r.previous,next:null!==(R=g.next)&&void 0!==R?R:r.next,first:null!==(z=g.first)&&void 0!==z?z:r.first,last:null!==(L=g.last)&&void 0!==L?L:r.last},slotProps:x},[O,M]=(0,A.A)("previous",{elementType:S,externalForwardedProps:E,ownerState:C}),[H,U]=(0,A.A)("next",{elementType:P,externalForwardedProps:E,ownerState:C}),[W,G]=(0,A.A)("first",{elementType:f.A,externalForwardedProps:E,ownerState:C}),[V,K]=(0,A.A)("last",{elementType:j.A,externalForwardedProps:E,ownerState:C}),X=I?{previous:"next",next:"previous",first:"last",last:"first"}[_]:_,Y={previous:O,next:H,first:W,last:V}[X],Q={previous:M,next:U,first:G,last:K}[X];return"start-ellipsis"===_||"end-ellipsis"===_?(0,s.jsx)(B,{ref:t,ownerState:C,className:(0,d.A)(D.root,o),children:"…"}):(0,s.jsxs)(T,{ref:t,ownerState:C,component:n,disabled:l,className:(0,d.A)(D.root,o),...N,children:["page"===_&&c,Y?(0,s.jsx)(k,{...Q,className:D.icon,as:Y}):null]})}),F=(0,C.Ay)("nav",{name:"MuiPagination",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t[a.variant]]}})({}),R=(0,C.Ay)("ul",{name:"MuiPagination",slot:"Ul",overridesResolver:(e,t)=>t.ul})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"});function defaultGetAriaLabel(e,t,a){return"page"===e?"".concat(a?"":"Go to ","page ").concat(t):"Go to ".concat(e," page")}const z=n.forwardRef(function Pagination(e,t){const a=(0,w.b)({props:e,name:"MuiPagination"}),{boundaryCount:o=1,className:i,color:n="standard",count:r=1,defaultPage:l=1,disabled:c=!1,getItemAriaLabel:u=defaultGetAriaLabel,hideNextButton:m=!1,hidePrevButton:g=!1,onChange:h,page:x,renderItem:_=e=>(0,s.jsx)(D,{...e}),shape:y="circular",showFirstButton:b=!1,showLastButton:f=!1,siblingCount:j=1,size:N="medium",variant:S="text",...P}=a,{items:A}=function usePagination(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{boundaryCount:t=1,componentName:a="usePagination",count:s=1,defaultPage:o=1,disabled:i=!1,hideNextButton:n=!1,hidePrevButton:r=!1,onChange:l,page:c,showFirstButton:d=!1,showLastButton:p=!1,siblingCount:u=1,...m}=e,[g,h]=(0,v.A)({controlled:c,default:o,name:a,state:"page"}),handleClick=(e,t)=>{c||h(t),l&&l(e,t)},range=(e,t)=>
1{const a=t-e+1;return Array.from({length:a},(t,a)=>e+a)},x=range(1,Math.min(t,s)),_=range(Math.max(s-t+1,t+1),s),y=Math.max(Math.min(g-u,s-t-2*u-1),t+2),b=Math.min(Math.max(g+u,t+2*u+2),s-t-1),f=[...d?["first"]:[],...r?[]:["previous"],...x,...y>t+2?["start-ellipsis"]:t+1<s-t?[t+1]:[],...range(y,b),...b<s-t-1?["end-ellipsis"]:s-t>t?[s-t]:[],..._,...n?[]:["next"],...p?["last"]:[]],buttonPage=e=>{switch(e){case"first":return 1;case"previous":return g-1;case"next":return g+1;case"last":return s;default:return null}};return{items:f.map(e=>"number"==typeof e?{onClick:t=>{handleClick(t,e)},type:"page",page:e,selected:e===g,disabled:i,"aria-current":e===g?"page":void 0}:{onClick:t=>{handleClick(t,buttonPage(e))},type:e,page:buttonPage(e),selected:!1,disabled:i||!e.includes("ellipsis")&&("next"===e||"last"===e?g>=s:g<=1)}),...m}}({...a,componentName:"Pagination"}),C={...a,boundaryCount:o,color:n,count:r,defaultPage:l,disabled:c,getItemAriaLabel:u,hideNextButton:m,hidePrevButton:g,renderItem:_,shape:y,showFirstButton:b,showLastButton:f,siblingCount:j,size:N,variant:S},I=(e=>{const{classes:t,variant:a}=e,s={root:["root",a],ul:["ul"]};return(0,p.A)(s,getPaginationUtilityClass,t)})(C);return(0,s.jsx)(F,{"aria-label":"pagination navigation",className:(0,d.A)(I.root,i),ownerState:C,ref:t,...P,children:(0,s.jsx)(R,{className:I.ul,ownerState:C,children:A.map((e,t)=>(0,s.jsx)("li",{children:_({...e,color:n,"aria-label":u(e.type,e.page,e.selected),shape:y,size:N,variant:S})},t))})})});var L=a(87701),E=a(59454),O=a(95654),M=a(88757),H=a(73729),U=a(95282),W=a(28644),G=a(59642),V=a(25233);const K=(0,N.A)((0,s.jsx)("path",{d:"M3 18h6v-2H3zM3 6v2h18V6zm0 7h12v-2H3z"}),"Sort"),X=(0,N.A)((0,s.jsx)("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack");var Y=a(94593),Q=a(95726),q=a(43261),Z=a(37467),$=a(89133),J=a(17680),ee=a(44725),te=a(89099),ae=a(53583),se=a(44940),oe=a(27009),ie=a(77922),ne=a(51069),re=a(52859),le=a(85541),ce=a.n(le);const EditIdeaPageDialog=e=>{let{item:t,open:a,onClose:o,onSave:i}=e;const[r,l]=(0,n.useState)(""),[c,d]=(0,n.useState)(""),[p,u]=(0,n.use
1State)(""),[m,v]=(0,n.useState)({}),[g,h]=(0,n.useState)(!1);(0,n.useEffect)(()=>{t&&(l(t.title||""),d(t.note||""),u(t.dueDate||""),v({}),h(!1))},[t]);const handleSave=()=>{const e=(()=>{const e={};return r.trim()?r.trim().length<2?e.title="Title must be at least 2 characters":r.trim().length>150&&(e.title="Title must be 150 characters or fewer"):e.title="Title is required",c.length>500&&(e.note="Note must be 500 characters or fewer"),e})();v(e),Object.keys(e).length>0||(h(!0),i({title:r.trim(),note:c.trim(),dueDate:p||null}))};return(0,s.jsx)(L.A,{open:a,onClose:o,PaperProps:{sx:{borderRadius:"10px",background:"var(--silverile-ai-white, #ffffff)",boxShadow:"0 12px 40px rgba(0,0,0,0.18)"}},children:(0,s.jsxs)("div",{className:ce().editDialogContent,children:[(0,s.jsxs)("div",{className:ce().editDialogTitle,children:[(0,s.jsx)(Y.A,{}),"Edit Idea"]}),(0,s.jsxs)("div",{className:ce().editFormRow,children:[(0,s.jsxs)("label",{className:ce().editFormLabel,children:["Title ",(0,s.jsx)("span",{style:{color:"var(--silverile-ai-theme-error, #ef4444)"},children:"*"})]}),(0,s.jsx)("input",{className:"".concat(ce().editFormInput," ").concat(m.title?ce().editFormInputError:""),type:"text",value:r,onChange:e=>{l(e.target.value),m.title&&v(e=>({...e,title:void 0}))},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),handleSave())},maxLength:150,autoFocus:!0}),m.title&&(0,s.jsx)("div",{className:ce().editErrorText,children:m.title})]}),(0,s.jsxs)("div",{className:ce().editFormRow,children:[(0,s.jsx)("label",{className:ce().editFormLabel,children:"Note"}),(0,s.jsx)("textarea",{className:"".concat(ce().editFormInput," ").concat(ce().editFormTextarea," ").concat(m.note?ce().editFormInputError:""),value:c,onChange:e=>{d(e.target.value),m.note&&v(e=>({...e,note:void 0}))},maxLength:500,rows:3}),m.note&&(0,s.jsx)("div",{className:ce().editErrorText,children:m.note})]}),(0,s.jsxs)("div",{className:ce().editFormRow,children:[(0,s.jsx)("label",{className:ce().editFormLabel,children:"Due Date"}),(0,s.jsx)("input",{className:ce().editFormInput,type:"date",value:p,onChange:e=>u(e.target.value)})]}),(0,s.jsxs)("div",{className:ce().editDialogActions,children:[(0,s.jsx)("button",{className:ce().editCancelBtn,onClick:o,children:"Cancel"}),(0,s.jsx)("button",{className:ce().editSaveBtn,onClick:handleSave,disabled:!r.trim()||g,children:g?"Saving…":"Save"})]})]})})},ConvertToStoryPageDialog=e=>{let{item:t,open:a,onClose:o,onSave:i,currentProduct:r,defaultUserProducts:l}=e;
1const[c,d]=(0,n.useState)(r||0),[p,u]=(0,n.useState)(0),[m,v]=(0,n.useState)([]),[g,h]=(0,n.useState)(""),[x,_]=(0,n.useState)(""),[y,b]=(0,n.useState)(!1),[f,j]=(0,n.useState)(""),[N,S]=(0,n.useState)(null),[P,A]=(0,n.useState)(!1),[C,I]=(0,n.useState)([]),[w,B]=(0,n.useState)(0),[T,k]=(0,n.useState)(3),[D,F]=(0,n.useState)(!1);(0,n.useEffect)(()=>{t&&(h(t.title||""),_(t.note||""),b(!1),j(""),S(null),k(3),d(r||0))},[t]),(0,n.useEffect)(()=>{c&&c>0&&t&&(A(!0),u(0),(0,ie.RS)(c).then(e=>{const t=Array.isArray(e)?e:[];v(t),t.length>=1&&u(t[0].storyTypeId||t[0].id||0)}).catch(()=>v([])).finally(()=>A(!1)))},[c,t]),(0,n.useEffect)(()=>{c&&c>0&&t&&(F(!0),B(0),(0,ne.getParentListForProduct)(c).then(e=>{const t=Array.isArray(e)?e:[];I(t);const a=t.find(e=>"Default Branch"===e.value);a?B(a.id):t.length>0&&B(t[0].id)}).catch(()=>I([])).finally(()=>F(!1)))},[c,t]);return(0,s.jsx)(L.A,{open:a,onClose:N?()=>{S(null),o()}:o,PaperProps:{sx:{borderRadius:"10px",background:"var(--silverile-ai-white, #ffffff)",boxShadow:"0 12px 40px rgba(0,0,0,0.18)",minWidth:400}},children:(0,s.jsx)("div",{className:ce().editDialogContent,children:N?(0,s.jsxs)("div",{className:ce().convertSuccess,children:[(0,s.jsx)(H.A,{style:{fontSize:48,color:"var(--silverile-ai-theme-success, #27AE60)"}}),(0,s.jsx)("div",{className:ce().convertSuccessTitle,children:"Story Created!"}),(0,s.jsxs)("div",{className:ce().convertSuccessSubtext,children:["Idea converted to story",N.companyStoryId?" #".concat(N.companyStoryId):"","."]}),(0,s.jsx)("button",{className:ce().editSaveBtn,onClick:()=>{S(null),o()},style:{marginTop:16},children:"Done"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:ce().editDialogTitle,children:[(0,s.jsx)(q.A,{}),"Convert Idea to Story"]}),f&&(0,s.jsx)("div",{className:ce().convertError,children:f}),(0,s.jsxs)("div",{className:ce().editFormRow,children:[(0,s.jsxs)("label",{className:ce().editFormLabel,children:["Project ",(0,s.jsx)("span",{style:{color:"var(--silverile-ai-theme-error, #ef4444)"},children:"*"})]}),(0,s.jsxs)("select",{className:ce().editFormInput,value:c,onChange:e=>d(Number(e.target.value)),children:[(0,s.jsx)("option",{value:0,children:"Select project…"}),(l||[]).filter(e=>0!==e.id).map(e=>(0,s.jsxs)("option",{value:e.id,children:[e.label,e.id===r?" (current)":""]},e.id))]})]}),m.length>1&&(0,s.jsxs)("div",{className:ce().editFormRow,children:[(0,s.jsxs)("label",{className:ce().editFormLabel,children:["Story Type ",(0,s.jsx)("span",{style:{color:"var(--silverile-ai-theme-error, #ef4444)"},children:"*"})]}),(0,s.jsxs)("select",{className:ce().editFormInput,value:p,onChange:e=>u(Number(e.target.value)),disabled:!c||P,children:[(0,s.jsx)("option",{value:0,children:P?"Loading…":"Select story type…"}),m.map(e=>(0,s.jsx)("option",{value:e.storyTypeId||e.id,children:e.storyTypeDescr||e.storyTypeName||e.name||"Type ".concat(e.storyTypeId||e.id)},e.storyTypeId||e.id))]})]}),(0,s.jsxs)("div",{className:ce().editFormRow,children:[(0,s.jsxs)("label",{className:ce().editFormLabel,children:["Branch ",(0,s.jsx)("span",{style:{color:"var(--silverile-ai-theme-error, #ef4444)"},children:"*"})]}),(0,s.jsxs)("select",{className:ce().editFormInput,value:w,onChange:e=>B(Number(e.target.value)),disabled:!c||D,children:[(0,s.jsx)("option",{value:0,children:D?"Loading…":"Select branch…"}),C.map(e=>(0,s.jsx)("option",{value:e.id,children:e.value||"Branch ".concat(e.id)},e.id))]})]}),(0,s.jsxs)("div",{className:ce().editFormRow,children:[(0,s.jsxs)("label",{className:ce().editFormLabel,children:["Story Title ",(0,s.jsx)("span",{style:{color:"var(--silverile-ai-theme-error, #ef4444)"},children:"*"})]}),(0,s.jsx)("input",{className:ce().editFormInput,type:"text",value:g,onChange:e=>h(e.target.value),maxLength:250})]}),(0,s.jsxs)("div",{className:ce().editFormRow,children:[(0,s.jsx)("label",{className:ce().editFormLabel,children:"Points"}),(0,s.jsx)("input",{className:ce().editFormInput,type:"number",value:T,onChange:e=>k(e.target.value),min:0,max:99,style:{width:80}})]}),(0,s.jsxs)("div",{className:ce().editFormRow,children:[(0,s.jsxs)("label",{className:ce().editFormLabel,children:["Description ",(0,s.jsx)("span",{style:{color:"var(--silverile-ai-theme-error, #ef4444)"},children:"*"})]}),(0,s.jsx)("textarea",{className:"".concat(ce().editFormInput," ").concat(ce().editFormTextarea),value:x,onChange:e=>_(e.target.value),rows:3})]}),(0,s.jsxs)("div",{className:ce().editDialogActions,children:[(0,s.jsx)("button",{className:ce().edit
1CancelBtn,onClick:o,children:"Cancel"}),(0,s.jsx)("button",{className:ce().convertSaveBtn,onClick:async()=>{if(g.trim())if(c)if(p)if(w)if(x.trim()){b(!0),j("");try{const e=await i({projectId:c,storyTypeId:p,title:g.trim(),description:x.trim(),parentId:w,points:Number(T)||0});e&&e.success&&S(e)}catch(e){j(e.message||"Failed to convert idea to story"),b(!1)}}else j("Description is required");else j("Please select a branch");else j("Please select a story type");else j("Please select a project");else j("Title is required")},disabled:!g.trim()||!x.trim()||!c||!p||!w||y,children:y?"Converting…":"Convert to Story"})]})]})})})},Ideas_IdeasPage=()=>{const e=(0,te.useRouter)(),t=(0,i.wA)(),a=(0,i.d4)(e=>e.auth.user),o=(0,i.d4)(e=>{var t;return null===(t=e.entitylist)||void 0===t?void 0:t.currentProduct}),r=(0,i.d4)(e=>{var t;return null===(t=e.entitylist)||void 0===t?void 0:t.currentCompany}),d=(0,i.d4)(e=>{var t;return(null===(t=e.user)||void 0===t?void 0:t.defaultUserProducts)||[]}),[p,u]=(0,n.useState)([]),[m,v]=(0,n.useState)(!0),[g,h]=(0,n.useState)(0),[x,_]=(0,n.use
1State)(0),[y,b]=(0,n.useState)(0),[f,j]=(0,n.useState)("all"),[N,S]=(0,n.useState)("dateAdded"),[P,A]=(0,n.useState)("desc"),C=(0,n.useCallback)(async()=>{v(!0);try{const e=await(0,se.Z$)({status:f,page:g,size:20,sortBy:N,sortDir:P});e&&(u(e.content||[]),_(e.totalPages||0),b(e.totalElements||0))}catch(e){console.error("[ideas page] fetch failed",e)}finally{v(!1)}},[f,g,N,P]);(0,n.useEffect)(()=>{(null==a?void 0:a.userId)&&C()},[null==a?void 0:a.userId,C]);const I=(0,n.useCallback)(async()=>{await C(),(null==a?void 0:a.userId)&&t((0,ae.Zu)(a.userId))},[C,null==a?void 0:a.userId,t]),[w,B]=(0,n.useState)(null),[T,k]=(0,n.useState)(null),D=(0,n.useRef)(null),F=(0,n.useCallback)(e=>{e.convertedStoryId&&D.current&&D.current.handleDialogUpdateStoryOpen(a,"update",e.convertedStoryId,null,e.title)},[a]),[R,L]=(0,n.useState)(!1),[ie,ne]=(0,n.useState)(""),[le,de]=(0,n.useState)(""),[pe,ue]=(0,n.useState)(""),[me,ve]=(0,n.useState)({}),[ge,he]=(0,n.useState)(!1),resetAddForm=()=>{ne(""),de(""),ue(""),ve({})},handleAddIdea=async()=>{const e={};if(ie.trim()?ie.trim().length<2?e.title="Title must be at least 2 characters":ie.trim().length>150&&(e.title="Title must be 150 characters or fewer"):e.title="Title is required",le.length>500&&(e.note="Note must be 500 characters or fewer"),Object.keys(e).length>0)ve(e);else{he(!0);try{await(0,se.kB)({userId:null==a?void 0:a.userId,title:ie.trim(),note:le.trim(),dueDate:pe||null,completed:!1}),resetAddForm(),L(!1),I()}catch(e){console.error("[ideas page] add failed",e),ve({title:"Failed to add idea"})}finally{he(!1)}}},formatDate=e=>{if(!e)return"";const t=new Date(e);return t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:t.getFullYear()!==(new Date).getFullYear()?"numeric":void 0})};return(0,s.jsxs)("div",{className:ce().pageWrapper,children:[(0,s.jsxs)("div",{className:ce().pageHeader,children:[(0,s.jsxs)("div",{className:ce().pageHeaderLeft,children:[(0,s.jsx)("button",{className:ce().backBtn,onClick:()=>e.back(),title:"Go back",children:(0,s.jsx)(X,{fontSize:"small"})}),(0,s.jsx)(E.A,{}),(0,s.jsx)("h1",{className:ce().pageTitle,children:"My Ideas"}),(0,s.jsx)("span",{className:ce().totalBadge,children:y})]}),(0,s.jsxs)("button",{className:ce().addIdeaBtn,onClick:()=>L(!0),title:"Add new idea",children:[(0,s.jsx)(J.A,{fontSize:"small"}),"Add Idea"]})]}),(0,s.jsxs)("div",{className:ce().toolbar,children:[(0,s.jsxs)("div",{className:ce().filterGroup,children:[(0,s.jsx)(V.A,{fontSize:"small",className:ce().toolbarIcon}),["all","active","completed"].map(e=>(0,s.jsx)("button",{className:"".concat(ce().filterBtn," ").concat(f===e?ce().filterBtnActive:""),onClick:()=>(j(e),void h(0)),children:e.charAt(0).toUpperCase()+e.slice(1)},e))]}),(0,s.jsxs)("div",{className:ce().sortGroup,children:[(0,s.jsx)(K,{fontSize:"small",className:ce().toolbarIcon}),[{field:"dateAdded",label:"Date Added"},{field:"dueDate",label:"Due Date"},{field:"title",label:"Title"}].map(e=>{let{field:t,label:a}=e;return(0,s.jsxs)("button",{className:"".concat(ce().sortBtn," ").concat(N===t?ce().sortBtnActive:""),onClick:()=>(e=>{N===e?A(e=>"desc"===e?"asc":"desc"):(S(e),A("desc")),h(0)})(t),children:[a,N===t&&(0,s.jsx)("span",{className:ce().sortArrow,children:"asc"===P?" ↑":" ↓"})]},t)})]})]}),(0,s.jsx)("div",{className:ce().content,children:m&&0===p.length?(0,s.jsxs)("div",{className:ce().loadingContainer,children:[(0,s.jsx)(l.A,{size:36}),(0,s.jsx)("span",{children:"Loading items..."})]}):(0,s.jsxs)("div",{className:ce().itemsTable,children:[(0,s.jsxs)("div",{className:ce().tableHeader,children:[(0,s.jsx)("span",{className:ce().colStatus,children:"Status"}),(0,s.jsx)("span",{className:ce().colTitle,children:"Title"}),(0,s.jsx)("span",{className:ce().colNote,children:"Note"}),(0,s.jsx)("span",{className:ce().colDate,children:"Date Added"}),(0,s.jsx)("span",{className:ce().colDue,children:"Due Date"}),(0,s.jsxs)("span",{className:ce().colActions,children:["Actions",(0,s.jsx)(c.A,{title:"Refresh",children:(0,s.jsx)("button",{className:ce().refreshBtn,onClick:I,disabled:m,children:(0,s.jsx)(Q.A,{fontSize:"small",className:m?ce().refreshSpin:""})})})]})]}),R&&(0,s.jsxs)("div",{className:ce().addRow,children:[(0,s.jsx)("span",{className:ce().colStatus,children:(0,s.jsx)(J.A,{fontSize:"small",style:{color:"var(--silverile-ai-theme-accent, #4f46e5)"}})}),(0,s.jsxs)("span",{className:ce().colTitle,children:[(0,s.jsx)("input",{className:"".concat(ce().addInput," ").concat(me.title?ce().addInputError:""),type:"text",placeholder:"Idea title *",value:ie,onChange:e=>{ne(e.target.value),me.title&&ve(e=>({...e,title:void 0}))},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),handleAddIdea()),"Escape"===e.key&&(resetAddForm(),L(!1))},maxLength:150,autoFocus:!0}),me.title&&(0,s.jsx)("div",{className:ce().addError,children:me.title})]}),(0,s.jsx)("span",{className:ce().colNote,children:(0,s.jsx)("textarea",{className:"".concat(ce().addInput," ").concat(ce().addTextarea," ").concat(me.note?ce().addInputError:""),placeholder:"Note (optional)",value:le,onChange:e=>{de(e.target.value),me.note&&ve(e=>({...e,note:void 0}))},maxLength:500,rows:2})}),(0,s.jsx)("span",{className:ce().colDate}),(0,s.jsx)("span",{className:ce().colDue,children:(0,s.jsx)("input",{className:ce().addDateInput,type:"date",value:pe,onCh
1ange:e=>ue(e.target.value),min:(new Date).toISOString().split("T")[0]})}),(0,s.jsxs)("span",{className:ce().colActions,children:[(0,s.jsx)(c.A,{title:"Save",children:(0,s.jsx)("button",{className:ce().addSaveBtn,onClick:handleAddIdea,disabled:!ie.trim()||ge,children:ge?(0,s.jsx)(l.A,{size:14}):(0,s.jsx)(M.A,{fontSize:"small"})})}),(0,s.jsx)(c.A,{title:"Cancel",children:(0,s.jsx)("button",{className:ce().addCancelBtn,onClick:()=>{resetAddForm(),L(!1)},children:(0,s.jsx)(ee.A,{fontSize:"small"})})})]})]}),0!==p.length||R?p.map(e=>{const t="converted"===e.ideaStatus;return(0,s.jsxs)("div",{className:"".concat(ce().tableRow," ").concat(e.completed?ce().tableRowCompleted:""," ").concat(t?ce().tableRowConverted:""),children:[(0,s.jsx)("span",{className:ce().colStatus,children:(0,s.jsx)(c.A,{title:e.completed?"Mark incomplete":"Mark complete",children:(0,s.jsx)("button",{className:"".concat(ce().statusBtn," ").concat(e.completed?ce().statusBtnDone:""),onClick:()=>(async(e,t)=>{try{await(0,se.Hc)(e,!t),I()}catch(e){console.error("[ideas page] toggle failed",e)}})(e.ideaId,e.completed),children:e.completed?(0,s.jsx)(H.A,{fontSize:"small"}):(0,s.jsx)(M.A,{fontSize:"small"})})})}),(0,s.jsxs)("span",{className:"".concat(ce().colTitle," ").concat(e.completed?ce().completedText:""),children:[e.title,t&&(0,s.jsxs)("span",{className:ce().convertedBadge,children:[(0,s.jsx)(Z.A,{style:{fontSize:11}}),"Converted"]})]}),(0,s.jsx)("span",{className:"".concat(ce().colNote," ").concat(e.completed?ce().completedText:""),children:e.note||"—"}),(0,s.jsxs)("span",{className:ce().colDate,children:[(0,s.jsx)(W.A,{style:{fontSize:13}}),formatDate(e.dateAdded)]}),(0,s.jsx)("span",{className:"".concat(ce().colDue," ").concat(e.dueDate&&(a=e.dueDate,a&&new Date(a)<new Date((new Date).toDateString()))&&!e.completed?ce().overdue:""),children:e.dueDate?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(U.A,{style:{fontSize:13}}),formatDate(e.dueDate)]}):"—"}),(0,s.jsxs)("span",{className:ce().colActions,children:[t&&e.convertedStoryId&&(0,s.jsx)(c.A,{title:"View Story",children:(0,s.jsx)("button",{className:ce().convertBtn,onClick:()=>F(e),children:(0,s.jsx)($.A,{fontSize:"small"})})}),!t&&(0,s.jsx)(c.A,{title:"Convert to Story",children:(0,s.jsx)("button",{className:ce().convertBtn,onClick:()=>k(e),children:(0,s.jsx)(q.A,{fontSize:"small"})})}),(0,s.jsx)(c.A,{title:"Edit",children:(0,s.jsx)("button",{className:ce().editBtn,onClick:()=>B(e),children:(0,s.jsx)(Y.A,{fontSize:"small"})})}),(0,s.jsx)(c.A,{title:"Delete",children:(0,s.jsx)("button",{className:ce().deleteBtn,onClick:()=>(async e=>{try{await(0,se.E2)(e),I()}catch(e){console.error("[ideas page] delete failed",e)}})(e.ideaId),children:(0,s.jsx)(O.A,{fontSize:"small"})})})]})]},e.ideaId);var a}):(0,s.jsxs)("div",{className:ce().emptyState,children:[(0,s.jsx)(G.A,{style:{fontSize:56,opacity:.4}}),(0,s.jsx)("div",{className:ce().emptyText,children:"all"===f?"No ideas yet — click Add Idea to get started":"No ".concat(f," items")})]})]})}),x>1&&(0,s.jsxs)("div",{className:ce().paginationBar,children:[(0,s.jsx)(z,{count:x,page:g+1,onChange:(e,t)=>
1{h(t-1)},color:"primary",size:"small",shape:"rounded"}),(0,s.jsxs)("span",{className:ce().paginationInfo,children:["Page ",g+1," of ",x," (",y," items)"]})]}),(0,s.jsx)(EditIdeaPageDialog,{item:w,open:Boolean(w),onClose:()=>B(null),onSave:async e=>{if(w)try{await(0,se.kB)({ideaId:w.ideaId,title:e.title,note:e.note,dueDate:e.dueDate||null,completed:w.completed,ideaStatus:w.ideaStatus,convertedStoryId:w.convertedStoryId}),B(null),I()}catch(e){console.error("[ideas page] edit failed",e)}}}),(0,s.jsx)(ConvertToStoryPageDialog,{item:T,open:Boolean(T),onClose:()=>k(null),onSave:async e=>{let{projectId:t,storyTypeId:a,title:s,description:o,parentId:i,points:n}=e;if(T)try{const e={story:{storyTitle:s,description:o||"",productId:t,companyId:r||0,storyType:a,statusId:1,parentId:i||0,points:null!=n?n:3,priorityId:2},remarks:"Converted from idea: ".concat(T.title),associateEntities:[]},l=await(0,oe.tf)(e);if(l&&0!==l.status){const e=l.id||l.storyId;return e&&await(0,se.pr)(T.ideaId,e),T.completed||await(0,se.Hc)(T.ideaId,!0),k(null),I(),{success:!0,storyId:e,companyStoryId:l.companyStoryId}}throw new Error((null==l?void 0:l.message)||"Failed to create story")}catch(e){throw console.error("[ideas page] convert to story failed",e),e}},currentProduct:o,defaultUserProducts:d}),(0,s.jsx)(re.A,{ref:D})]})};function IdeasPageRoute(){const e=(0,o.useSession)(),t=(0,i.d4)(e=>e.auth.user);return(0,n.useEffect)(()=>{},[e]),e&&e.data&&e.data.user&&"authenticated"===e.status&&t&&t.userId?(0,s.jsx)(Ideas_IdeasPage,{}):e&&"loading"===e.status?(0,s.jsx)("div",{className:"silver_reached_info",children:(0,s.jsxs)("div",{style:{textAlign:"center",marginTop:"50px"},children:[(0,s.jsx)(l.A,{sx:60}),(0,s.jsx)("p",{style:{marginTop:"10px"},children:"Loading... Please wait"})]})}):e&&"unauthenticated"===e.status?(0,s.jsx)(r.A,{}):void 0}},11556:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/ideas",function(){return a(10941)}])},85541:e=>{e.exports={pageWrapper:"ideasPage_pageWrapper__RunQv",pageHeader:"ideasPage_pageHeader__OvDeq",pageHeaderLeft:"ideasPage_pageHeaderLeft__mNR0c",backBtn:"ideasPage_backBtn__CAoLg",pageTitle:"ideasPage_pageTitle__yLgA3",totalBadge:"ideasPage_totalBadge__wtIGm",refreshBtn:"ideasPage_refreshBtn__1Wir0",refreshSpin:"ideasPage_refreshSpin__byS7c",spin:"ideasPage_spin__vcTCR",toolbar:"ideasPage_toolbar__x58j5",filterGroup:"ideasPage_filterGroup__vRUxp",sortGroup:"ideasPage_sortGroup__uUK6e",toolbarIcon:"ideasPage_toolbarIcon__Ppm9X",filterBtn:"ideasPage_filterBtn___fUeb",sortBtn:"ideasPage_sortBtn__cKWoH",filterBtnActive:"ideasPage_filterBtnActive__xWknj",sortBtnActive:"ideasPage_sortBtnActive__CYBVb",sortArrow:"ideasPage_sortArrow___hY01",content:"ideasPage_content__Qc6Wd",loadingContainer:"ideasPage_loadingContainer___8w6K",emptyState:"ideasPage_emptyState__K2Vm_",emptyText:"ideasPage_emptyText__B9Hxx",itemsTable:"ideasPage_itemsTable__f0NnI",tableHeader:"ideasPage_tableHeader__Gy6DN",tableRow:"ideasPage_tableRow__sOiM4",tableRowCompleted:"ideasPage_tableRowCompleted__YvoMi",completedText:"ideasPage_completedText__fPF5s",colStatus:"ideasPage_colStatus__wNF12",colTitle:"ideasPage_colTitle__1LAw5",colNote:"ideasPage_colNote__i_IoK",colDate:"ideasPage_colDate__l9MFF",colDue:"ideasPage_colDue__hfCyL",overdue:"ideasPage_overdue__vIVX7",colActions:"ideasPage_colActions__73Dg_",statusBtn:"ideasPage_statusBtn__CKYtd",statusBtnDone:"ideasPage_statusBtnDone__hEwgV",deleteBtn:"ideasPage_deleteBtn__9OOFF",editBtn:"ideasPage_editBtn__CQfjf",convertBtn:"ideasPage_convertBtn__BAbN7",convertedBadge:"ideasPage_convertedBadge__sWrFR",tableRowConverted:"ideasPage_tableRowConverted__ZekrF",convertSaveBtn:"ideasPage_convertSaveBtn__OFNCz",convertError:"ideasPage_convertError__wNUnL",convertSuccess:"ideasPage_convertSuccess__6pl9g",convertSuccessTitle:"ideasPage_convertSuccessTitle__hE2_m",convertSuccessSubtext:"ideasPage_convertSuccessSubtext__XzrWZ",editDialogContent:"ideasPage_editDialogContent__bU1Q3",editDialogTitle:"ideasPage_editDialogTitle__ht_1z",editFormRow:"ideasPage_editFormRow__YZKb1",editFormLabel:"ideasPage_editFormLabel__jcYoI",editFormInput:"ideasPage_editFormInput__A_319",editFormTextarea:"ideasPage_editFormTextarea___7wQB",editFormInputError:"ideasPage_editFormInputError__LVImz",editErrorText:"ideasPage_editErrorText__AtYmh",editDialogActions:"ideasPage_editDialogActions__5hDov",editCancelBtn:"ideasPage_editCancelBtn__k_0S6",editSaveBtn:"ideasPage_editSaveBtn__ss7I6",paginationBar:"ideasPage_paginationBar__kLrud",paginationInfo:"ideasPage_paginationInfo__FfdcR",addIdeaBtn:"ideasPage_addIdeaBtn__UT8GF",addRow:"ideasPage_addRow__6OPNs",addInput:"ideasPage_addInput__BGowr",addTextarea:"ideasPage_addTextarea__mN1Bg",addInputError:"ideasPage_addInputError___yCyQ",addDateInput:"ideasPage_addDateInput__ymaar",addError:"ideasPage_addError__3F_o8",addSaveBtn:"ideasPage_addSaveBtn__BNkHj",addCancelBtn:"ideasPage_addCancelBtn__4xfTN"}}},e=>{e.O(0,[6593,636,8792],()=>{return t=11556,e(e.s=t);var t});var t=e.O();_N_E=t}]);

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.