1import{u as p,e as f,a as v,eE as x,e9 as b,j as e,E as h,et as y,bz as w,d as T}from"./index-6AHMKm1b.js";import{C as j}from"./CircleAlertFillIcon-CMvoLOkp.js";import{T as C}from"./TcgDocumentPreviewContent-DK8ScJR1.js";import{T as E}from"./TcgEntitledRouteGuard-BP6FgR-I.js";import"./useApiErrorHandler-CvZwsHwS.js";import"./tcgDocumentView-0I7nc65z.js";import"./useIsTcgEntitled-CTYwKaJG.js";function N(){var o,l;const{t:s}=p(),d=f(),a=v(r=>r.websiteId()),i=x(a,a>0),t=i.data,c=((l=(o=t==null?void 0:t.renderedContent)==null?void 0:o[(t==null?void 0:t.defaultLanguage)??"en"])==null?void 0:l.rendered_html)??"",n=b(),u=async()=>{if(a<=0)return;const r=t==null?void 0:t.userResponses;if(!r)return;const{defaultLanguage:g,preferredLanguages:m}=y(r);try{await n.mutateAsync({website_id:a,answers:r,is_draft:!1,default_language:g,preferred_languages:m}),d({to:w.GENERATED,search:{success:!0}})}catch{}};return e.jsxs("div",{className:"w-full","data-testid":"tcg-preview-step",children:[e.jsx("h5",{className:"text-4xl font-bold text-dark leading-[34px] mb-6",children:s("tcg.preview.title",{defaultValue:"Preview"})}),e.jsxs("div",{role:"note","aria-label":s("tcg.preview.legalDisclaimerAria",{defaultValue:"Legal disclaimer"}),className:"mb-6 flex items-start gap-3 rounded-lg bg-warning-lighter px-4 py-3 text-dark",children:[e.jsx(j,{width:20,height:20,svgColor:"warning-dark",className:"mt-0.5 shrink-0"}),e.jsx("p",{className:"text-sm leading-5",children:s("tcg.preview.legalDisclaimer",{defaultValue:"We do not take any responsibility, and we are not liable, for any Terms & Conditions created using our service. Any information, materials, or services provided herein do not ensure any form of regulatory compliance and are not intended to be a substitute for professional legal advice. If any legal assistance is required, users should seek the services of an attorney."})})]}),e.jsx(C,{websiteId:a}),e.jsx("div",{className:"flex items-center justify-end mt-8 pt-6 border-t border-gray-border",children:e.jsx(h,{type:"button",variant:"primary","data-testid":"tcg-preview-generate-button",disabled:n.isPending||a<=0||!i.isSuccess||i.isFetching||!c,onClick:()=>void u(),children:s("tcg.preview.generate_button",{defaultValue:"Generate Terms & Conditions"})})})]})}const D=T("/terms-and-conditions/preview")({component:()=>e.jsx(E,{children:e.jsx(N,{})})});export{D as Route};
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.