PageSourceSearch

https://withwilla.io/assets/Index-XuWY88ns.js

js withwilla.io collected 2026-10-02 02:00:09 UTC 32,543 bytes, 2 lines download raw bytes

1import{p as e,a as c,w as ko,v as Fo,z as jo}from"./chunk-LFPYN7LY-DwefVaon.js";import{A as wo}from"./ArrowBack-zalehysE.js";import{c as L}from"./createSvgIcon-BMaA90Cr.js";import{M as Y,D as Io}from"./Delete-tRQbabk_.js";import{A as Ro}from"./Add-2YALfP6K.js";import{C as Z}from"./Close-Bc5rho2N.js";import{D as zo}from"./Dashboard-D_r1QFHj.js";import{l as so,a as Ao,b as $o,d as Bo,g as ao,e as Do}from"./contentService-Cpq26qRV.js";import{g as J}from"./imageUtils-B3ztoQJs.js";import{t as Po}from"./mixpanel-Dn-GqnH4.js";import{c as To,M as lo}from"./Modal-DFBflG7o.js";import{a as co,g as po,s as U,c as xo,m as Q,b as H,r as uo,B as i,T as u}from"./Box-B-kefjj2.js";import{I as K}from"./IconButton-B2W9XC_q.js";import{u as fo,c as V,a as d}from"./DefaultPropsProvider-BQI3A88f.js";import{u as q}from"./useSlot-D7JaLDIT.js";import{u as Mo}from"./useTimeout-0_MtHRdg.js";import{B as to,C as _}from"./CircularProgress-B90yVYXV.js";import{S as Lo}from"./SwitchBase-B_TgMAv8.js";import{u as Oo}from"./useFormControl-C1BJJF8o.js";import{B as G}from"./Button-Ck9E553y.js";import{M as Wo}from"./Menu-CeCOdSID.js";import"./apiClient-CEHBCmoT.js";import"./index-DRkYdtty.js";import"./useTheme-BLwv8XwK.js";import"./mergeSlotProps-D8CNLEGP.js";import"./Paper-C1rYGmz9.js";const Eo=L(e.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}));function No(o){return po("MuiChip",o)}const l=co("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),Ho=o=>{const{classes:a,disabled:r,size:n,color:t,iconColor:F,onDelete:C,clickable:x,variant:p}=o,h={root:["root",p,r&&"disabled",`size${d(n)}`,`color${d(t)}`,x&&"clickable",x&&`clickableColor${d(t)}`,C&&"deletable",C&&`deletableColor${d(t)}`,`${p}${d(t)}`],label:["label",`label${d(n)}`],avatar:["avatar",`avatar${d(n)}`,`avatarColor${d(t)}`],icon:["icon",`icon${d(n)}`,`iconColor${d(F)}`],deleteIcon:["deleteIcon",`deleteIcon${d(n)}`,`deleteIconColor${d(t)}`,`deleteIcon${d(p)}Color${d(t)}`]};return xo(h,No,a)},Uo=U("div",{name:"MuiChip",slot:"Root",overridesResolver:(o,a)=>{const{ownerState:r}=o,{color:n,iconColor:t,clickable:F,onDelete:C,size:x,variant:p}=r;return[{[`& .${l.avatar}`]:a.avatar},{[`& .${l.avatar}`]:a[`avatar${d(x)}`]},{[`& .${l.avatar}`]:a[`avatarColor${d(n)}`]},{[`& .${l.icon}`]:a.icon},{[`& .${l.icon}`]:a[`icon${d(x)}`]},{[`& .${l.icon}`]:a[`iconColor${d(t)}`]},{[`& .${l.deleteIcon}`]:a.deleteIcon},{[`& .${l.deleteIcon}`]:a[`deleteIcon${d(x)}`]},{[`& .${l.deleteIcon}`]:a[`deleteIconColor${d(n)}`]},{[`& .${l.deleteIcon}`]:a[`deleteIcon${d(p)}Color${d(n)}`]},a.root,a[`size${d(x)}`],a[`color${d(n)}`],F&&a.clickable,F&&n!=="default"&&a[`clickableColor${d(n)}`],C&&a.deletable,C&&n!=="default"&&a[`deletableColor${d(n)}`],a[p],a[`${p}${d(n)}`]]}})(Q(({theme:o})=>{const a=o.palette.mode==="light"?o.palette.grey[700]:o.palette.grey[300];return{maxWidth:"100%",fontFamily:o.typography.fontFamily,fontSize:o.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,lineHeight:1.5,color:(o.vars||o).palette.text.primary,backgroundColor:(o.vars||o).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:o.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${l.disabled}`]:{opacity:(o.vars||o).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${l.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:o.vars?o.vars.palette.Chip.defaultAvatarColor:a,fontSize:o.typography.pxToRem(12)},[`& .${l.avatarColorPrimary}`]:{color:(o.vars||o).palette.primary.contrastText,backgroundColor:(o.vars||o).palette.primary.dark},[`& .${l.avatarColorSecondary}
1`]:{color:(o.vars||o).palette.secondary.contrastText,backgroundColor:(o.vars||o).palette.secondary.dark},[`& .${l.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:o.typography.pxToRem(10)},[`& .${l.icon}`]:{marginLeft:5,marginRight:-6},[`& .${l.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:o.alpha((o.vars||o).palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:o.alpha((o.vars||o).palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${l.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${l.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(o.palette).filter(H(["contrastText"])).map(([r])=>({props:{color:r},style:{backgroundColor:(o.vars||o).palette[r].main,color:(o.vars||o).palette[r].contrastText,[`& .${l.deleteIcon}`]:{color:o.alpha((o.vars||o).palette[r].contrastText,.7),"&:hover, &:active":{color:(o.vars||o).palette[r].contrastText}}}})),{props:r=>r.iconColor===r.color,style:{[`& .${l.icon}`]:{color:o.vars?o.vars.palette.Chip.defaultIconColor:a}}},{props:r=>r.iconColor===r.color&&r.color!=="default",style:{[`& .${l.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${l.focusVisible}`]:{backgroundColor:o.alpha((o.vars||o).palette.action.selected,`${(o.vars||o).palette.action.selectedOpacity} + ${(o.vars||o).palette.action.focusOpacity}`)}}},...Object.entries(o.palette).filter(H(["dark"])).map(([r])=>({props:{color:r,onDelete:!0},style:{[`&.${l.focusVisible}`]:{background:(o.vars||o).palette[r].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:o.alpha((o.vars||o).palette.action.selected,`${(o.vars||o).palette.action.selectedOpacity} + ${(o.vars||o).palette.action.hoverOpacity}`)},[`&.${l.focusVisible}`]:{backgroundColor:o.alpha((o.vars||o).palette.action.selected,`${(o.vars||o).palette.action.selectedOpacity} + ${(o.vars||o).palette.action.focusOpacity}`)},"&:active":{boxShadow:(o.vars||o).shadows[1]}}},...Object.entries(o.palette).filter(H(["dark"])).map(([r])=>({props:{color:r,clickable:!0},style:{[`&:hover, &.${l.focusVisible}`]:{backgroundColor:(o.vars||o).palette[r].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:o.vars?`1px solid ${o.vars.palette.Chip.defaultBorder}`:`1px solid ${o.palette.mode==="light"?o.palette.grey[400]:o.palette.grey[700]}`,[`&.${l.clickable}:hover`]:{backgroundColor:(o.vars||o).palette.action.hover},[`&.${l.focusVisible}`]:{backgroundColor:(o.vars||o).palette.action.focus},[`& .${l.avatar}`]:{marginLeft:4},[`& .${l.avatarSmall}`]:{marginLeft:2},[`& .${l.icon}`]:{marginLeft:4},[`& .${l.iconSmall}`]:{marginLeft:2},[`& .${l.deleteIcon}`]:{marginRight:5},[`& .${l.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(o.palette).filter(H()).map(([r])=>({props:{variant:"outlined",color:r},style:{color:(o.vars||o).palette[r].main,border:`1px solid ${o.alpha((o.vars||o).palette[r].main,.7)}`,[`&.${l.clickable}:hover`]:{backgroundColor:o.alpha((o.vars||o).palette[r].main,(o.vars||o).palette.action.hoverOpacity)},[`&.${l.focusVisible}`]:{backgroundColor:o.alpha((o.vars||o).palette[r].main,(o.vars||o).palette.action.focusOpacity)},[`& .${l.deleteIcon}`]:{color:o.alpha((o.vars||o).palette[r].main,.7),"&:hover, &:active":{color:(o.vars||o).palette[r].main}}}}))]}})),Vo=U("span",{name:"MuiChip",slot:"Label",overridesResolver:(o,a)=>{const{ownerState:r}=o,{size:n}=r;return[a.label,a[`label${d(n)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function no(o){return o.key==="Backspace"||o.key==="Delete"}const go=c.forwardRef(function(a,r){const n=fo({props:a,name:"MuiChip"}),{avatar:t,className:F,clickable:C,color:x="default",component:p,deleteIcon:h,disabled:y=!1,icon:S,label:w,onClick:I,onDelete:b,onKeyDown:k,onKeyUp:A,size:s="medium",variant:v="filled",tabIndex:j,skipFocusWhenDisabled:f=!1,slots:z={},slotProps:$={},...P}=n,O=c.useRef(null),T=Mo(O,r),B=m=>{m.stopPropagation(),b(m)},g=m=>{m.currentTarget===m.target&&no(m)&&m.preventDefault(),k&&k(m)},R=m=>{m.currentTarget===m.target&&b&&no(m)&&b(m),A&&A(m)},W=C!==!1&&I?!0:C,E=W||b?to:p||"div",N={...n,component:E,disabled:y,size:s,color:x,iconColor:c.isValidElement(S)&&S.props.color||x,onDelete:!!b,clickable:W,variant:v}
1,M=Ho(N),mo=E===to?{component:p||"div",focusVisibleClassName:M.focusVisible,...b&&{disableRipple:!0}}:{};let X=null;b&&(X=h&&c.isValidElement(h)?c.cloneElement(h,{className:V(h.props.className,M.deleteIcon),onClick:B}):e.jsx(Eo,{className:M.deleteIcon,onClick:B}));let oo=null;t&&c.isValidElement(t)&&(oo=c.cloneElement(t,{className:V(M.avatar,t.props.className)}));let eo=null;S&&c.isValidElement(S)&&(eo=c.cloneElement(S,{className:V(M.icon,S.props.className)}));const ro={slots:z,slotProps:$},[Co,vo]=q("root",{elementType:Uo,externalForwardedProps:{...ro,...P},ownerState:N,shouldForwardComponentProp:!0,ref:T,className:V(M.root,F),additionalProps:{disabled:W&&y?!0:void 0,tabIndex:f&&y?-1:j,...mo},getSlotProps:m=>({...m,onClick:D=>{m.onClick?.(D),I?.(D)},onKeyDown:D=>{m.onKeyDown?.(D),g(D)},onKeyUp:D=>{m.onKeyUp?.(D),R(D)}})}),[yo,So]=q("label",{elementType:Vo,externalForwardedProps:ro,ownerState:N,className:M.label});return e.jsxs(Co,{as:E,...vo,children:[oo||eo,e.jsx(yo,{...So,children:w}),X]})}),Ko=L(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),_o=L(e.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"})),Go=U("span",{name:"MuiRadioButtonIcon",shouldForwardProp:uo})({position:"relative",display:"flex"}),Yo=U(Ko,{name:"MuiRadioButtonIcon"})({transform:"scale(1)"}),qo=U(_o,{name:"MuiRadioButtonIcon"})(Q(({theme:o})=>({left:0,position:"absolute",transform:"scale(0)",transition:o.transitions.create("transform",{easing:o.transitions.easing.easeIn,duration:o.transitions.duration.shortest}),variants:[{props:{checked:!0},style:{transform:"scale(1)",transition:o.transitions.create("transform",{easing:o.transitions.easing.easeOut,duration:o.transitions.duration.shortest})}}]})));function ho(o){const{checked:a=!1,classes:r={},fontSize:n}=o,t={...o,checked:a};return e.jsxs(Go,{className:r.root,ownerState:t,children:[e.jsx(Yo,{fontSize:n,className:r.background,ownerState:t}),e.jsx(qo,{fontSize:n,className:r.dot,ownerState:t})]})}const Zo=c.createContext(void 0);function Jo(){return c.useContext(Zo)}function Qo(o){return po("MuiRadio",o)}const io=co("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),Xo=o=>{const{classes:a,color:r,size:n}=o,t={root:["root",`color${d(r)}`,n!=="medium"&&`size${d(n)}`]};return{...a,...xo(t,Qo,a)}},oe=U(Lo,{shouldForwardProp:o=>uo(o)||o==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(o,a)=>{const{ownerState:r}=o;return[a.root,r.size!=="medium"&&a[`size${d(r.size)}`],a[`color${d(r.color)}`]]}})(Q(({theme:o})=>({color:(o.vars||o).palette.text.secondary,[`&.${io.disabled}`]:{color:(o.vars||o).palette.action.disabled},variants:[{props:{color:"default",disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:o.alpha((o.vars||o).palette.action.active,(o.vars||o).palette.action.hoverOpacity)}}},...Object.entries(o.palette).filter(H()).map(([a])=>({props:{color:a,disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:o.alpha((o.vars||o).palette[a].main,(o.vars||o).palette.action.hoverOpacity)}}})),...Object.entries(o.palette).filter(H()).map(([a])=>({props:{color:a,disabled:!1},style:{[`&.${io.checked}`]:{color:(o.vars||o).palette[a].main}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})));function ee(o,a){return typeof a=="object"&&a!==null?o===a:String(o)===String(a)}const re=e.jsx(ho,{checked:!0}),ae=e.jsx(ho,{}),bo=c.forwardRef(function(a,r){const n=fo({props:a,name:"MuiRadio"}),{checked:t,checkedIcon:F=re,color:C="primary",icon:x=ae,name:p,onChange:h,size:y="medium",className:S,disabled:w,disableRipple:I=!1,slots:b={},slotProps:k={},inputProps:A,...s}=n,v=Oo();let j=w;v&&typeof j>"u"&&(j=v.disabled),j??=!1;const f={...n,disabled:j,disableRipple:I,color:C,size:y},z=Xo(f),$=Jo();let P=t;const O=To(h,$&&$.onChange);let T=p;$&&(typeof P>"u"&&(P=ee($.value,n.value)),typeof T>"u"&&(T=$.name));const B=k.input??A,[g,R]=q("root",{ref:r,elementType:oe,className:V(z.root,S),shouldForwardComponentProp:!0,externalForwardedProps:{slots:b,slotProps:k,...s},getSlotProps:W=>({...W,onChange:(E,...N)=>{W.onChange?.(E,...N),O(E,...N)}}),ownerState:f,additionalProps:{type:"radio",icon:c.cloneElement(x,{fontSize:x.props.fontSize??y}),checkedIcon:c.cloneElement(F,{fontSize:F.props.fontSize??y}),disabled:j,name:T,checked:P,slots:b,slotProps:{input:typeof B=="function"?B(f):B}}});return e.jsx(g,{...R,classes:z})}),te=L(e.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"})),ne=L(e.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"})),ie=L(e.jsx("path",{d:"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3
1-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92"})),se=L(e.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56M12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96M4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2s.06 1.34.14 2zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56m2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8M12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96M14.34 14H9.66c-.09-.66-.16-1.32-.16-2s.07-1.35.16-2h4.68c.09.65.16 1.32.16 2s-.07 1.34-.16 2m.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56M16.36 14c.08-.66.14-1.32.14-2s-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2z"}));function le({open:o,onClose:a,item:r,onSuccess:n}){const[t,F]=c.useState([]),[C,x]=c.useState(!1),[p,h]=c.useState(null),[y,S]=c.useState(!1),{primary:w}=J(r),I=r.title||r.url||"",b=r.publisher||r.siteName||(()=>{try{return new URL(r.url).hostname}catch{return""}})(),k=c.useCallback(async()=>{x(!0);try{const s=await so(),v=Array.isArray(r.boardIds)?r.boardIds.map(f=>String(f)):r.boardIds?[String(r.boardIds)]:[],j=s.filter(f=>{const z=String(f.id);return v.includes(z)?!1:f.isOwner!==!1?!0:f.isShared===!0&&f.canCollaborate===!0});F(j)}catch(s){console.error("Failed to load boards:",s)}finally{x(!1)}},[r]);c.useEffect(()=>{o&&(k(),h(null))},[o,k]);const A=async()=>{if(!(!p||!r.id||y)){S(!0);try{await Ao(p,r.id),n?.(),a()}catch(s){console.error("Failed to add save to board:",s),window.alert("Failed to add to board. Please try again.")}finally{S(!1)}}};return e.jsx(lo,{open:o,onClose:a,sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsxs(i,{sx:{position:"relative",width:{xs:"90%",sm:"80%",md:"900px"},maxWidth:"900px",height:"90vh",backgroundColor:"#FFFFFF",borderRadius:2,boxShadow:"0 8px 32px rgba(0, 0, 0, 0.12)",display:"flex",flexDirection:{xs:"column",md:"row"},overflow:"hidden"},children:[e.jsx(K,{onClick:a,sx:{position:"absolute",top:16,right:16,zIndex:10,color:"#000000",backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"}},children:e.jsx(Z,{})}),e.jsxs(i,{sx:{width:{xs:"100%",md:"40%"},backgroundColor:"#F9FAFB",padding:3,display:"flex",flexDirection:"column",gap:2},children:[w&&e.jsxs(i,{sx:{position:"relative",width:"100%",borderRadius:2,overflow:"hidden"},children:[e.jsx(i,{component:"img",src:w,alt:I,sx:{width:"100%",height:"auto",borderRadius:2,objectFit:"cover",maxHeight:300,backgroundColor:"#F3F4F6",display:"block"}}),b&&e.jsx(go,{label:b,sx:{position:"absolute",bottom:12,left:12,backgroundColor:"#F3F4F6",color:"#000000",fontSize:12,height:28,fontWeight:500,boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"}})]}),e.jsx(u,{variant:"h2",sx:{fontSize:{xs:20,md:24},fontWeight:700,lineHeight:1.2,color:"#000000",margin:0,marginTop:w?2:0},children:I}),r.description&&e.jsx(u,{sx:{fontSize:14,lineHeight:1.5,color:"#6B7280",marginTop:.5},children:r.description})]}),e.jsxs(i,{sx:{flex:1,padding:3,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsx(u,{variant:"h1",sx:{fontSize:{xs:20,md:24},fontWeight:700,lineHeight:1.3,color:"#000000",marginBottom:3},children:"Save your content to a board and stay organized"}),e.jsx(i,{sx:{flex:1,overflowY:"auto",marginBottom:2,"&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-track":{backgroundColor:"#F3F4F6"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#D1D5DB",borderRadius:"4px","&:hover":{backgroundColor:"#9CA3AF"}}},children:C?e.jsx(i,{sx:{display:"flex",justifyContent:"center",padding:4},children:e.jsx(_,{size:24})}):e.jsxs(e.Fragment,{children:[t.map(s=>{const v=s.createdAt?new Date(s.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"";return e.jsxs(i,{onClick:()=>h(s.id),sx:{display:"flex",alignItems:"flex-start",padding:2,borderRadius:1,cursor:"pointer","&:hover":{backgroundColor:"#F9FAFB"}},children:[e.jsx(bo,{checked:p===s.id,onChange:()=>
1h(s.id),sx:{padding:0,marginRight:2,color:"#D1D5DB","&.Mui-checked":{color:"#000000"}}}),e.jsxs(i,{sx:{flex:1},children:[e.jsx(u,{sx:{fontSize:16,fontWeight:600,color:"#000000",marginBottom:.5},children:s.name}),v&&e.jsxs(u,{sx:{fontSize:14,color:"#6B7280"},children:["Board created on: ",v]})]})]},s.id)}),t.length===0&&!C&&e.jsx(u,{sx:{fontSize:14,color:"#6B7280",textAlign:"center",padding:4,fontStyle:"italic"},children:"No boards found"})]})}),e.jsxs(i,{sx:{display:"flex",gap:2,paddingTop:2,borderTop:"1px solid #E5E7EB"},children:[e.jsx(G,{variant:"outlined",onClick:a,sx:{flex:1,padding:"10px 16px",borderRadius:1,borderColor:"#D1D5DB",backgroundColor:"#FFFFFF",color:"#111827",fontSize:14,fontWeight:500,textTransform:"none","&:hover":{borderColor:"#9CA3AF",backgroundColor:"#F9FAFB"}},children:"Cancel"}),e.jsx(G,{variant:"contained",onClick:A,disabled:!p||y,sx:{flex:1,padding:"10px 16px",borderRadius:1,backgroundColor:"#000000",color:"#FFFFFF",fontSize:14,fontWeight:500,textTransform:"none","&:hover":{backgroundColor:"#1a1a1a"},"&.Mui-disabled":{backgroundColor:"#D1D5DB",color:"#9CA3AF"}},children:y?e.jsx(_,{size:16,color:"inherit"}):"Save"})]})]})]})})}function ce({open:o,onClose:a,item:r,onSuccess:n}){const[t,F]=c.useState([]),[C,x]=c.useState(!1),[p,h]=c.useState(null),[y,S]=c.useState(!1),{primary:w}=J(r),I=r.title||r.url||"",b=r.publisher||r.siteName||(()=>{try{return new URL(r.url).hostname}catch{return""}})(),k=c.useCallback(async()=>{x(!0);try{const s=await so(),v=Array.isArray(r.boardIds)?r.boardIds.map(f=>String(f)):r.boardIds?[String(r.boardIds)]:[],j=s.filter(f=>{const z=String(f.id);return v.includes(z)});F(j)}catch(s){console.error("Failed to load boards:",s)}finally{x(!1)}},[r]);c.useEffect(()=>{o&&(k(),h(null))},[o,k]);const A=async()=>{if(!(!p||!r.id||y)){S(!0);try{const f=((await $o(p))?.data?.items||[]).find(z=>String(z.id)===String(r.id))?.edgeId;if(!f){window.alert("Could not find the association. It may have already been removed.");return}await Bo(p,f),n?.(),a()}catch(s){console.error("Failed to remove from board:",s),window.alert("Failed to remove from board. Please try again.")}finally{S(!1)}}};return e.jsx(lo,{open:o,onClose:a,sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsxs(i,{sx:{position:"relative",width:{xs:"90%",sm:"80%",md:"900px"},maxWidth:"900px",height:"90vh",backgroundColor:"#FFFFFF",borderRadius:2,boxShadow:"0 8px 32px rgba(0, 0, 0, 0.12)",display:"flex",flexDirection:{xs:"column",md:"row"},overflow:"hidden"},children:[e.jsx(K,{onClick:a,sx:{position:"absolute",top:16,right:16,zIndex:10,color:"#000000",backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"}},children:e.jsx(Z,{})}),e.jsxs(i,{sx:{width:{xs:"100%",md:"40%"},backgroundColor:"#F9FAFB",padding:3,display:"flex",flexDirection:"column",gap:2},children:[w&&e.jsxs(i,{sx:{position:"relative",width:"100%",borderRadius:2,overflow:"hidden"},children:[e.jsx(i,{component:"img",src:w,alt:I,sx:{width:"100%",height:"auto",borderRadius:2,objectFit:"cover",maxHeight:300,backgroundColor:"#F3F4F6",display:"block"}}),b&&e.jsx(go,{label:b,sx:{position:"absolute",bottom:12,left:12,backgroundColor:"#F3F4F6",color:"#000000",fontSize:12,height:28,fontWeight:500,boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"}})]}),e.jsx(u,{variant:"h2",sx:{fontSize:{xs:20,md:24},fontWeight:700,lineHeight:1.2,color:"#000000",margin:0,marginTop:w?2:0},children:I}),r.description&&e.jsx(u,{sx:{fontSize:14,lineHeight:1.5,color:"#6B7280",marginTop:.5},children:r.description})]}),e.jsxs(i,{sx:{flex:1,padding:3,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsx(u,{variant:"h1",sx:{fontSize:{xs:20,md:24},fontWeight:700,lineHeight:1.3,color:"#000000",marginBottom:1},children:"Remove content from board"}),e.jsx(u,{sx:{fontSize:14,color:"#6B7280",marginBottom:3,lineHeight:1.5},children:"Select a board to remove this content from"}),e.jsx(i,{sx:{flex:1,overflowY:"auto",marginBottom:2,"&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-track":{backgroundColor:"#F3F4F6"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#D1D5DB",borderRadius:"4px","&:hover":{backgroundColor:"#9
1CA3AF"}}},children:C?e.jsx(i,{sx:{display:"flex",justifyContent:"center",padding:4},children:e.jsx(_,{size:24})}):e.jsxs(e.Fragment,{children:[t.map(s=>{const v=s.createdAt?new Date(s.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"";return e.jsxs(i,{onClick:()=>h(s.id),sx:{display:"flex",alignItems:"flex-start",padding:2,borderRadius:1,cursor:"pointer","&:hover":{backgroundColor:"#F9FAFB"}},children:[e.jsx(bo,{checked:p===s.id,onChange:()=>h(s.id),sx:{padding:0,marginRight:2,color:"#D1D5DB","&.Mui-checked":{color:"#000000"}}}),e.jsxs(i,{sx:{flex:1},children:[e.jsx(u,{sx:{fontSize:16,fontWeight:600,color:"#000000",marginBottom:.5},children:s.name}),v&&e.jsxs(u,{sx:{fontSize:14,color:"#6B7280"},children:["Board created on: ",v]})]})]},s.id)}),t.length===0&&!C&&e.jsx(u,{sx:{fontSize:14,color:"#6B7280",textAlign:"center",padding:4,fontStyle:"italic"},children:"This content is not currently associated with any boards"})]})}),e.jsxs(i,{sx:{display:"flex",gap:2,paddingTop:2,borderTop:"1px solid #E5E7EB"},children:[e.jsx(G,{variant:"outlined",onClick:a,sx:{flex:1,padding:"10px 16px",borderRadius:1,borderColor:"#D1D5DB",backgroundColor:"#FFFFFF",color:"#111827",fontSize:14,fontWeight:500,textTransform:"none","&:hover":{borderColor:"#9CA3AF",backgroundColor:"#F9FAFB"}},children:"Cancel"}),e.jsx(G,{variant:"contained",onClick:A,disabled:!p||y,sx:{flex:1,padding:"10px 16px",borderRadius:1,backgroundColor:"#000000",color:"#FFFFFF",fontSize:14,fontWeight:500,textTransform:"none","&:hover":{backgroundColor:"#1a1a1a"},"&.Mui-disabled":{backgroundColor:"#D1D5DB",color:"#9CA3AF"}},children:y?e.jsx(_,{size:16,color:"inherit"}):"Remove"})]})]})]})})}const Me=ko(function(){const a=Fo(),r=jo(),n=r.id?decodeURIComponent(r.id):"";c.useEffect(()=>{n&&Po("web_screen_viewed",{screen:"web_SaveDetails",save_id:n})},[n]);const[t,F]=c.useState(null),[C,x]=c.useState(!0),[p,h]=c.useState(""),[y,S]=c.useState(!1),[w,I]=c.useState(!1),[b,k]=c.useState(null);if(c.useEffect(()=>{if(!n){a("/dashboard");return}(async()=>{x(!0);try{const R=(await ao(n))?.data?.item;R&&(F(R),h(R.comments||R.comment||""))}finally{x(!1)}})()},[n,a]),C)return e.jsx(i,{sx:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(u,{sx:{color:"#9CA3AF",fontSize:"0.88rem"},children:"Loading details..."})});if(!t)return e.jsx(i,{sx:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(u,{sx:{color:"#B91C1C",fontSize:"0.88rem"},children:"Item not found."})});const{primary:A}=J(t),s=t.title||t.url,v=t.publisher||t.siteName||(()=>{try{return new URL(t.url).hostname}catch{return""}})(),j=Array.isArray(t.boardNames)?t.boardNames:[],f=async()=>{if(k(null),!!window.confirm("Are you sure you want to delete this save?"))try{await Do(t.id),a("/dashboard")}catch{window.alert("Failed to delete item.")}},z=()=>{k(null),t.url&&window.open(t.url,"_blank","noopener,noreferrer")},$=async()=>{k(null);const g=t.url;if(!g)return;const R=s?`${s}
2${g}`:g;if(navigator.share)try{await navigator.share({text:R,url:g});return}catch{}try{await navigator.clipboard.writeText(g),window.alert("Link copied to clipboard.")}catch{window.alert("Unable to share this link.")}},P=()=>{S(!0)},O=async()=>{if(n)try{const R=(await ao(n))?.data?.item;R&&F(R)}catch(g){console.error("Failed to refresh item:",g)}},T=()=>{I(!0)},B=t.createdAt?new Date(t.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"";return e.jsxs(e.Fragment,{children:[e.jsxs(i,{sx:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"},children:[e.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:2,padding:"16px 32px",borderBottom:"1px solid rgba(26, 26, 26, 0.06)",backgroundColor:"#FFFFFF",flexShrink:0},children:[e.jsx(K,{onClick:()=>a("/dashboard"),title:"Back to Saves",sx:{width:32,height:32,border:"1px solid rgba(26, 26, 26, 0.08)",borderRadius:"8px",color:"#4A4A4A","&:hover":{backgroundColor:"#f9f9f9"}},children:e.jsx(wo,{sx:{fontSize:16}})}),e.jsxs(i,{sx:{marginLeft:"auto"},children:[e.jsx(K,{onClick:g=>k(g.currentTarget),title:"More actions",sx:{width:32,height:32,border:"1px solid rgba(26, 26, 26, 0.08)",borderRadius:"8px",color:"#4A4A4A","&:hover":{backgroundColor:"#f9f9f9"}},children:e.jsx(te,{sx:{fontSize:18}})}
2),e.jsxs(Wo,{anchorEl:b,open:!!b,onClose:()=>k(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{marginTop:"6px",minWidth:160,borderRadius:"10px",border:"1px solid rgba(26, 26, 26, 0.08)",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.08)",padding:"4px"}}},children:[e.jsxs(Y,{onClick:z,sx:{fontSize:"0.82rem",fontWeight:400,color:"#4A4A4A",borderRadius:"6px",gap:1.25,padding:"9px 12px","&:hover":{backgroundColor:"#f9f9f9"}},children:[e.jsx(ne,{sx:{fontSize:15}}),"Open original"]}),e.jsxs(Y,{onClick:$,sx:{fontSize:"0.82rem",fontWeight:400,color:"#4A4A4A",borderRadius:"6px",gap:1.25,padding:"9px 12px","&:hover":{backgroundColor:"#f9f9f9"}},children:[e.jsx(ie,{sx:{fontSize:15}}),"Share"]}),e.jsxs(Y,{onClick:f,sx:{fontSize:"0.82rem",fontWeight:400,color:"#dc2626",borderRadius:"6px",gap:1.25,padding:"9px 12px","&:hover":{backgroundColor:"#fef2f2"}},children:[e.jsx(Io,{sx:{fontSize:15}}),"Delete"]})]})]})]}),e.jsxs(i,{sx:{flex:1,minHeight:0,display:"grid",gridTemplateColumns:{xs:"1fr",md:"1fr 380px"},gridTemplateRows:{xs:"280px 1fr",md:"1fr"},overflow:"hidden"},children:[e.jsx(i,{sx:{backgroundColor:"#f9f9f9",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",padding:{xs:2,md:4}},children:A?e.jsx(i,{component:"img",src:A,alt:s||"Save image",sx:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain",borderRadius:"12px",boxShadow:"0 4px 24px rgba(0, 0, 0, 0.08)"}}):e.jsx(u,{sx:{color:"#9CA3AF",fontSize:"0.88rem"},children:"No image available"})}),e.jsxs(i,{sx:{borderLeft:{md:"1px solid rgba(26, 26, 26, 0.06)"},borderTop:{xs:"1px solid rgba(26, 26, 26, 0.06)",md:"none"},padding:"28px",overflowY:"auto",display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(i,{children:[e.jsx(u,{variant:"h1",sx:{fontSize:"1.2rem",fontWeight:600,color:"#1A1A1A",lineHeight:1.4,letterSpacing:"-0.01em"},children:s}),B&&e.jsx(u,{sx:{fontSize:"0.82rem",color:"#9CA3AF",marginTop:"6px"},children:B})]}),e.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:1},children:[j.map(g=>e.jsxs(i,{sx:{display:"inline-flex",alignItems:"center",gap:"6px",fontSize:"0.78rem",fontWeight:500,color:"#0077b6",backgroundColor:"#e8f8fc",padding:"5px 8px 5px 12px",borderRadius:"8px",width:"fit-content"},children:[e.jsx(zo,{sx:{fontSize:13}}),g.boardName,e.jsx(K,{onClick:T,title:`Remove from ${g.boardName}`,sx:{width:18,height:18,backgroundColor:"rgba(0, 119, 182, 0.12)",color:"#0077b6",marginLeft:"2px",padding:0,"&:hover":{backgroundColor:"rgba(0, 119, 182, 0.22)"}},children:e.jsx(Z,{sx:{fontSize:10}})})]},g.boardId)),e.jsxs(i,{component:"button",onClick:P,sx:{display:"inline-flex",alignItems:"center",gap:"5px",fontSize:"0.78rem",fontWeight:500,color:"#0077b6",background:"none",border:"none",cursor:"pointer",padding:0,fontFamily:"inherit",width:"fit-content","&:hover":{color:"#005f8a"}},children:[e.jsx(Ro,{sx:{fontSize:14}}),"Add to board"]})]}),e.jsx(i,{sx:{height:"1px",backgroundColor:"rgba(26, 26, 26, 0.06)"}}),t.description&&e.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:1},children:[e.jsx(u,{sx:{fontSize:"0.7rem",fontWeight:600,color:"#9CA3AF",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Description"}),e.jsx(u,{sx:{fontSize:"0.88rem",color:"#4A4A4A",lineHeight:1.6},children:t.description})]}),v&&e.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:1},children:[e.jsx(u,{sx:{fontSize:"0.7rem",fontWeight:600,color:"#9CA3AF",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Source"}),e.jsxs(i,{sx:{display:"inline-flex",alignItems:"center",gap:1,fontSize:"0.85rem",color:"#4A4A4A"},children:[e.jsx(se,{sx:{fontSize:15,color:"#9CA3AF"}}),v]})]}),t.url&&e.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:1},children:[e.jsx(u,{sx:{fontSize:"0.7rem",fontWeight:600,color:"#9CA3AF",textTransform:"uppercase",letterSpacing:"0.05em"},children:"URL"}),e.jsx(i,{component:"a",href:t.url,target:"_blank",rel:"noopener noreferrer",sx:{fontSize:"0.78rem",color:"#0077b6",textDecoration:"none",wordBreak:"break-all",lineHeight:1.5,"&:hover":{textDecoration:"underline"}},children:t.url})]}),e.jsx(i,{sx:{height:"1px",backgroundColor:"rgba(26, 26, 26, 0.06)"}}),e.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:1},children:[e.jsx(u,{sx:{fontSize:"0.7rem",fontWeight:600,color:"#9
2CA3AF",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Notes"}),e.jsx(i,{component:"textarea",value:p,onChange:g=>h(g.target.value),placeholder:"Add your thoughts...",sx:{width:"100%",padding:"12px 14px",border:"1.5px solid rgba(26, 26, 26, 0.12)",borderRadius:"10px",fontSize:"0.85rem",fontFamily:"inherit",color:"#1A1A1A",backgroundColor:"#FFFFFF",outline:"none",resize:"vertical",minHeight:"100px",lineHeight:1.6,boxSizing:"border-box",transition:"border-color 0.2s ease, box-shadow 0.2s ease","&:focus":{borderColor:"#0077b6",boxShadow:"0 0 0 3px rgba(0, 119, 182, 0.08)"},"&::placeholder":{color:"#9CA3AF"}}}),e.jsx(i,{component:"button",sx:{display:"block",width:"100%",padding:"10px",border:"none",borderRadius:"10px",backgroundColor:"#1A1A1A",color:"#FFFFFF",fontSize:"0.85rem",fontWeight:500,fontFamily:"inherit",cursor:"pointer",marginTop:"4px","&:hover":{backgroundColor:"#333333"}},children:"Save Notes"})]})]})]})]}),t&&e.jsxs(e.Fragment,{children:[e.jsx(le,{open:y,onClose:()=>S(!1),item:t,onSuccess:O}),e.jsx(ce,{open:w,onClose:()=>I(!1),item:t,onSuccess:O})]})]})});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.